agentina 0.1.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +136 -0
  3. package/dist/cli.js +6091 -0
  4. package/package.json +45 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Anis Marrouchi / Noqta
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,136 @@
1
+ # agentina
2
+
3
+ **How parties will work together.**
4
+
5
+ Every working relationship today runs on emailed attachments, shared passwords, and blind trust: the client zips the folder, the accountant gets the bank login, the IT helper takes over the whole screen. agentina replaces that pattern. Each party keeps their own machine and their own AI assistants; a relationship is an **invite** plus exactly the access it needs β€” *this folder, read-only, for a month* β€” enforced by the giver's machine, watchable in an audit trail both sides keep, revocable in one click, and self-destructing when the engagement ends.
6
+
7
+ **Pick what you're doing β€” the console guides both sides:**
8
+
9
+ | | |
10
+ |---|---|
11
+ | πŸ§‘β€πŸ’» **Freelancer ↔ Client** | Deliver a project without emailing files back and forth. |
12
+ | 🧾 **Accountant ↔ Small business** | Monthly books without a single attachment β€” ask the bookkeeper assistant instead. |
13
+ | 🏒 **Agency ↔ Client** | Status on demand, staging access per sprint β€” nothing standing. |
14
+ | πŸ›  **IT helper ↔ Family** | Help someone's computer for an hour β€” they watch every move, then it's over. |
15
+
16
+ No accounts. No cloud in the middle. No telemetry. If Claude is installed, your assistants think; if not, everything else still works and the console shows the one command to add it.
17
+
18
+ ```
19
+ agentina demo β€” freelancer ↔ client, one trust boundary, loopback only
20
+
21
+ βœ“ pair β€” Amal joined "Badis (client)" β€” directional tokens exchanged
22
+ βœ“ invite replay rejected β€” the redeemed link is worthless
23
+ βœ“ connection test β€” Amalβ†’Badis 1ms Β· Badisβ†’Amal 1ms
24
+ βœ“ deny before grant β€” task without a grant β†’ 403 no-grant
25
+ βœ“ grant β€” Badis β†’ Amal: agent "files", fs:project-docs (ro)
26
+ βœ“ scoped read β€” "Redesign the checkout flow. Budget: 4 weeks. …"
27
+ βœ“ path escape denied β€” read ../secret.txt β†’ 403
28
+ βœ“ ungranted agent denied β€” task to "echo" β†’ agent-not-granted
29
+ βœ“ forged token denied β€” GET /ping with a forged token β†’ 401
30
+ βœ“ grant revoked β€” after revoke, the same read β†’ 403
31
+ βœ“ audit trail β€” 10 entries, 6 denials (pair, ping, task, grant-create, auth-denied)
32
+ ```
33
+
34
+ Try it in 30 seconds (no keys, no config):
35
+
36
+ ```bash
37
+ npx agentina demo
38
+ ```
39
+
40
+ ## Why
41
+
42
+ Multi-agent frameworks connect machines that all belong to **one** operator β€” trust is a shared secret, and any authenticated peer can invoke any agent. The moment two *different* owners want their agents to collaborate, you need more:
43
+
44
+ - **Parties, not just peers.** Every node is owned by a party; every inbound request is attributed to one before it runs.
45
+ - **Directional credentials.** Pairing mints two independent tokens β€” one per direction. Revoke one party without touching the rest. Invite links carry a one-time token, never a permanent secret.
46
+ - **Pairing alone grants nothing.** Access is a **Grant**, authored and enforced by the granting side: "this party may invoke these agents, scoped to this directory / repo / server / skill." Read-only means read-only β€” `..` traversal and symlink escapes fail closed.
47
+ - **Audit as a product.** Tasks, pairings, connection tests, grant changes, and *denials* β€” recorded with the party they were attributed to.
48
+
49
+ Built on the Linux Foundation's [A2A protocol](https://github.com/a2aproject/A2A) for agent cards and task exchange. Network-agnostic: a peer is any reachable URL β€” Tailscale, WireGuard, headscale, or plain WAN + TLS.
50
+
51
+ ## How it works
52
+
53
+ > **First time? Follow [the playlist](docs/tutorials/README.md)** β€” eight short episodes from install to the full security model, each one filmable as a YouTube tutorial. Start solo with [episode 01 β€” your own AI assistant](docs/tutorials/01-your-own-assistant.md), or jump to [episode 02 β€” connect two people](docs/tutorials/02-connect-two-people.md). The security model is documented in [SECURITY.md](SECURITY.md).
54
+
55
+ ```bash
56
+ # Party A (the freelancer) β€” bind your overlay-network IP so B can reach you
57
+ agentina init --name "Amal"
58
+ agentina start --bind 100.84.12.7 # tailscale ip -4; omit --bind for local-only demos
59
+ agentina invite # β†’ agentina://join/… (one-time, 15 min)
60
+
61
+ # Party B (the client), on their own machine
62
+ agentina init --name "Badis"
63
+ agentina start
64
+ agentina join "agentina://join/…" # redeems the invite, mints directional tokens
65
+ agentina test "Amal" # authenticated connection test
66
+
67
+ # The client decides exactly what the freelancer's agents may touch:
68
+ agentina grant --to "Amal" --agent files --fs ./project-docs --mode ro
69
+ agentina grants # list / audit what you've extended
70
+ agentina revoke gr_… # ends it instantly
71
+
72
+ # The freelancer asks the client's agent (within what was granted):
73
+ agentina ask "Badis" read brief.txt --agent files
74
+ ```
75
+
76
+ ## Channels β€” talk to the mesh where you already are
77
+
78
+ Mention an agent in a comment or a chat and it answers β€” including agents on the *other side* of a trust boundary. The router resolves `@name` to a local agent or a paired party's skill; cross-boundary tasks carry your party token and **the remote side enforces its grants** β€” a channel mention never bypasses them. A denial comes back as the reply, honestly, and lands in both audit logs.
79
+
80
+ ```bash
81
+ agentina channel telegram --token-env TG_BOT_TOKEN # DM the bot, or @files read brief.txt
82
+ agentina channel whatsapp --token-env WA_TOKEN --phone-id 1234567890 --verify-env WA_VERIFY
83
+ agentina channel discord --token-env DISCORD_BOT_TOKEN
84
+ agentina channel slack --token-env SLACK_BOT_TOKEN --secret-env SLACK_SIGNING_SECRET
85
+ agentina channel github --token-env GH_BOT_TOKEN --secret-env GH_HOOK_SECRET
86
+ agentina channel gitlab --host https://gitlab.example.com --token-env GL_BOT_TOKEN --secret-env GL_HOOK_SECRET
87
+ # each connection gets its own webhook address β€” the console shows it with a Copy button
88
+ # full walkthroughs: docs/tutorials/05-channels.md (or the console's built-in guides)
89
+ ```
90
+
91
+ | Channel | Status | How it listens |
92
+ |---|---|---|
93
+ | Telegram | βœ“ | Bot API long-poll β€” no public IP needed |
94
+ | WhatsApp | βœ“ | Meta Cloud API webhook, replies as your business number |
95
+ | Discord | βœ“ | Gateway websocket (outbound, Node 22+) β€” no public IP needed |
96
+ | Slack | βœ“ | Events API webhook (signed, replay-guarded), replies in-thread |
97
+ | GitHub | βœ“ | webhook on issue/PR comments (HMAC-verified), replies as the bot |
98
+ | GitLab | βœ“ | webhook on issue/MR comments, replies as the bot |
99
+ | Teams Β· Trello Β· Jira | planned | same `ChannelAdapter` contract β€” each is one small file |
100
+
101
+ Channels start the moment you save them in the console β€” paste the token in the form (stored owner-only on your machine; env vars override) and mention an agent. No restart, no terminal.
102
+
103
+ **Per agent, per channel.** A connection can be bound to one agent (`--agent bookkeeper`, or "Who answers here?" in the console): that bot or number becomes the agent's own face β€” message it like a person, no @mention needed. Several connections of the same kind coexist (each gets its own webhook address), so agentina is useful **solo**: your own agents, in your own chat apps, before any second party is involved.
104
+
105
+ Every adapter implements the same 4-method contract (`start`, `stop`, `sendReply`, + a name); routing, mention resolution, mesh hops, and grant enforcement are shared and never reimplemented per channel.
106
+
107
+ ## Packages
108
+
109
+ | Package | What it is |
110
+ |---|---|
111
+ | `agentina` | The CLI and node daemon. |
112
+ | `@agentina-mesh/protocol` | Wire types: A2A + party/grant extensions. Zero deps. |
113
+ | `@agentina-mesh/peer` | Peer registry, health checks with hysteresis, task exchange, invite codec. |
114
+ | `@agentina-mesh/grants` | Party attribution (`decideAuth`), credentials, audit log. |
115
+ | `@agentina-mesh/node` | The daemon: agent-card, `/task`, pairing handshake, control API. |
116
+ | `@agentina-mesh/console` | The web console each node serves at `/`: pairing, scope picker, grants, live activity. |
117
+ | `@agentina-mesh/channels` | Channel adapters (Telegram, WhatsApp, GitHub, GitLab) + the shared mention router. |
118
+
119
+ ## Roadmap
120
+
121
+ - **M0 βœ“:** pair β†’ connection test β†’ task exchange β†’ deny β†’ revoke β†’ audit.
122
+ - **M1 βœ“:** Grants enforced at `/task` (party β†’ allowed agents), `fs`/`skill` scopes with traversal/symlink-proof confinement, grant propose/approve/revoke, Claude Code adapter (cwd jailed to the granted root, tool allowlist derived from the grant mode).
123
+ - **M2 βœ“:** Web console β€” pairing wizard, scope picker, grants dashboard, live monitor. Non-technical users, zero CLI.
124
+ - **M3 βœ“:** Sessions β€” ephemeral agents that self-destruct with their grants (TTL or one click), `ssh`/`repo` scopes (credentials come only from the grant), grant expiry with live countdowns. Full console parity: every action clickable.
125
+ - **Later:** N-party meshes, hub (master-mesh) administration, Ed25519 credentials, relay transport.
126
+
127
+ ## Development
128
+
129
+ ```bash
130
+ pnpm install
131
+ pnpm test # unit + full two-node integration over real HTTP
132
+ pnpm typecheck
133
+ pnpm demo
134
+ ```
135
+
136
+ MIT.