@newtype-ai/nit 0.4.7 → 0.4.9
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 +97 -46
- package/dist/chunk-Q5GX7ZXR.js +3842 -0
- package/dist/cli.js +86 -2
- package/dist/index.d.ts +78 -1
- package/dist/index.js +13 -1
- package/package.json +2 -1
- package/scripts/postinstall.js +8 -1
- package/dist/chunk-535YI4CD.js +0 -1599
package/README.md
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
# nit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://nodejs.org)
|
|
4
|
+
[](https://www.npmjs.com/package/@newtype-ai/nit)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Why
|
|
8
|
-
|
|
9
|
-
An agent working across multiple platforms (FAAM, Polymarket, etc.) needs to present different capabilities to each. nit lets you maintain branch-per-platform versions of your agent card, with cryptographic identity via Ed25519 keypairs.
|
|
6
|
+
Git for agent identity.
|
|
10
7
|
|
|
11
8
|
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
_ _ _____
|
|
10
|
+
| \ |"| ___ |_ " _|
|
|
11
|
+
<| \| |> |_"_| | |
|
|
12
|
+
U| |\ |u | | /| |\
|
|
13
|
+
|_| \_| U/| |\u u |_|U
|
|
14
|
+
|| \\,-.-,_|___|_,-._// \\_
|
|
15
|
+
(_") (_/ \_)-' '-(_/(__) (__)
|
|
15
16
|
```
|
|
16
17
|
|
|
18
|
+
**One identity. Any apps.**
|
|
19
|
+
|
|
20
|
+
- **Self-sovereign** — your keys, your identity. No authority assigns or revokes it
|
|
21
|
+
- **Ed25519 signed** — every commit cryptographically signed
|
|
22
|
+
- **Compatible with [A2A protocol](https://google.github.io/A2A/)** — uses the `agent-card.json` format
|
|
23
|
+
- **MIT licensed**
|
|
24
|
+
|
|
17
25
|
## Install
|
|
18
26
|
|
|
19
27
|
```bash
|
|
@@ -29,27 +37,77 @@ npx @newtype-ai/nit init
|
|
|
29
37
|
## Quick Start
|
|
30
38
|
|
|
31
39
|
```bash
|
|
32
|
-
# Initialize
|
|
40
|
+
# Initialize — generates Ed25519 keypair + initial agent-card.json
|
|
33
41
|
nit init
|
|
34
42
|
|
|
35
43
|
# Create a platform-specific branch
|
|
36
44
|
nit branch faam.io
|
|
37
|
-
|
|
38
|
-
# Switch to it and customize the card
|
|
39
45
|
nit checkout faam.io
|
|
40
|
-
|
|
46
|
+
|
|
47
|
+
# Edit agent-card.json — set name, description, skills
|
|
41
48
|
nit commit -m "FAAM config"
|
|
42
49
|
|
|
43
50
|
# Push all branches to remote
|
|
44
51
|
nit push --all
|
|
45
52
|
```
|
|
46
53
|
|
|
54
|
+
## Features
|
|
55
|
+
|
|
56
|
+
### Branch-per-platform
|
|
57
|
+
|
|
58
|
+
`main` is your canonical public identity. Each branch is a platform-specific persona — branch name = domain.
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
main → full agent card (public, discoverable)
|
|
62
|
+
faam.io → { skills: [content, social], description: "Content creator..." }
|
|
63
|
+
polymarket.com → { skills: [research, trading], description: "Market analyst..." }
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Data in one branch never pollutes another. Switch environments cleanly.
|
|
67
|
+
|
|
68
|
+
### Built-in crypto wallets
|
|
69
|
+
|
|
70
|
+
One keypair, multiple chains. No seed phrases, no extra key management.
|
|
71
|
+
|
|
72
|
+
- **Solana** — your Ed25519 public key *is* your Solana address
|
|
73
|
+
- **EVM** (Ethereum, BSC, Polygon, Arbitrum, etc.) — deterministic secp256k1 derivation from your Ed25519 seed
|
|
74
|
+
- **Sign & broadcast** — sign transactions and send them to any RPC endpoint
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
nit status # shows your wallet addresses
|
|
78
|
+
nit sign-tx --chain evm <hash> # sign a transaction
|
|
79
|
+
nit broadcast --chain evm <tx> # broadcast to RPC
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Skill resolution
|
|
83
|
+
|
|
84
|
+
Skills stored as pointers (`{ "id": "skill-name" }`) in your card — resolved from SKILL.md files at commit time. SKILL.md is the single source of truth.
|
|
85
|
+
|
|
86
|
+
Auto-discovers skills from major agent frameworks:
|
|
87
|
+
- `.claude/skills/` — Claude Code
|
|
88
|
+
- `.cursor/skills/` — Cursor
|
|
89
|
+
- `.windsurf/skills/` — Windsurf
|
|
90
|
+
- `.codex/skills/` — OpenAI Codex
|
|
91
|
+
- `.openclaw/workspace/skills/` — OpenClaw
|
|
92
|
+
|
|
93
|
+
### Configurable remote
|
|
94
|
+
|
|
95
|
+
Free hosting at [newtype-ai.org](https://newtype-ai.org). Or bring your own server:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
nit remote set-url origin https://my-server.com
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Zero runtime dependencies
|
|
102
|
+
|
|
103
|
+
Pure Node.js builtins. No bloat.
|
|
104
|
+
|
|
47
105
|
## Commands
|
|
48
106
|
|
|
49
107
|
| Command | Description |
|
|
50
108
|
|---------|-------------|
|
|
51
109
|
| `nit init` | Create `.nit/`, generate Ed25519 keypair, initial commit |
|
|
52
|
-
| `nit status` | Identity info, current branch, uncommitted changes |
|
|
110
|
+
| `nit status` | Identity info, current branch, wallet addresses, uncommitted changes |
|
|
53
111
|
| `nit commit -m "msg"` | Snapshot agent-card.json |
|
|
54
112
|
| `nit log` | Commit history for current branch |
|
|
55
113
|
| `nit diff [target]` | JSON diff vs HEAD, branch, or commit |
|
|
@@ -61,6 +119,10 @@ nit push --all
|
|
|
61
119
|
| `nit remote` | Show remote URL and credential status |
|
|
62
120
|
| `nit remote add <name> <url>` | Add a new remote |
|
|
63
121
|
| `nit remote set-url <name> <url>` | Change a remote's URL |
|
|
122
|
+
| `nit sign-tx --chain <c> <data>` | Sign transaction data (EVM: 32-byte hash, Solana: message bytes) |
|
|
123
|
+
| `nit broadcast --chain <c> <tx>` | Broadcast signed transaction to configured RPC endpoint |
|
|
124
|
+
| `nit rpc` | Show configured RPC endpoints |
|
|
125
|
+
| `nit rpc set-url <chain> <url>` | Set RPC endpoint for a chain |
|
|
64
126
|
|
|
65
127
|
## How It Works
|
|
66
128
|
|
|
@@ -80,41 +142,27 @@ Platforms verify your identity by challenging you to sign a nonce — no shared
|
|
|
80
142
|
|
|
81
143
|
nit also derives blockchain wallet addresses from your keypair — Solana (Ed25519 native) and EVM chains (Ethereum, BSC, Polygon, etc.) via a deterministic secp256k1 derivation. Run `nit status` to see your addresses.
|
|
82
144
|
|
|
83
|
-
###
|
|
84
|
-
|
|
85
|
-
Each branch is a different agent card for a different platform. Branch name = root domain of the platform (e.g., `faam.io`, `polymarket.com`).
|
|
145
|
+
### Login
|
|
86
146
|
|
|
87
|
-
|
|
147
|
+
When you log into an app, you sign a domain-bound payload with your private key. The app verifies it by fetching your public card. No OAuth, no API keys, no human account.
|
|
88
148
|
|
|
89
|
-
|
|
149
|
+
`nit sign --login <domain>` does two things automatically:
|
|
150
|
+
1. Switches to the domain's branch (creates it if it doesn't exist)
|
|
151
|
+
2. Generates the signed login payload
|
|
90
152
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
nit auto-discovers your skills directory from all major agent frameworks:
|
|
94
|
-
|
|
95
|
-
- `.claude/skills/` — Claude Code
|
|
96
|
-
- `.cursor/skills/` — Cursor
|
|
97
|
-
- `.windsurf/skills/` — Windsurf
|
|
98
|
-
- `.codex/skills/` — OpenAI Codex
|
|
99
|
-
- `.openclaw/workspace/skills/` — OpenClaw
|
|
100
|
-
|
|
101
|
-
The discovered path is stored in `.nit/config`. When `nit sign --login <domain>` creates a new branch, it auto-creates a SKILL.md template and adds a pointer to the card. The committed card always contains fully resolved, self-contained skill data.
|
|
153
|
+
The domain is baked into the signature — a signature for `faam.io` is mathematically invalid for `discord.com`.
|
|
102
154
|
|
|
103
155
|
### Remote Protocol
|
|
104
156
|
|
|
105
157
|
The main branch is public. Non-main branches require signed-challenge authentication:
|
|
106
158
|
|
|
107
159
|
```
|
|
108
|
-
GET /.well-known/agent-card.json
|
|
109
|
-
GET /.well-known/agent-card.json?branch=faam.io
|
|
110
|
-
GET ... + X-Nit-Signature + X-Nit-Challenge
|
|
160
|
+
GET /.well-known/agent-card.json → main card (public)
|
|
161
|
+
GET /.well-known/agent-card.json?branch=faam.io → 401 { challenge }
|
|
162
|
+
GET ... + X-Nit-Signature + X-Nit-Challenge → branch card
|
|
111
163
|
```
|
|
112
164
|
|
|
113
|
-
nit is the client. Any server can implement the protocol. [newtype-ai.org](https://newtype-ai.org) is the recommended free hosting
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
nit remote set-url origin https://my-server.com
|
|
117
|
-
```
|
|
165
|
+
nit is the client. Any server can implement the protocol. [newtype-ai.org](https://newtype-ai.org) is the recommended free hosting, but you can point to any compatible server.
|
|
118
166
|
|
|
119
167
|
## Directory Structure
|
|
120
168
|
|
|
@@ -136,7 +184,10 @@ your-project/
|
|
|
136
184
|
## Programmatic API
|
|
137
185
|
|
|
138
186
|
```typescript
|
|
139
|
-
import {
|
|
187
|
+
import {
|
|
188
|
+
init, commit, checkout, branch, push, status, sign, loginPayload,
|
|
189
|
+
loadRawKeyPair, getWalletAddresses, signTx, broadcast, rpcSetUrl,
|
|
190
|
+
} from '@newtype-ai/nit';
|
|
140
191
|
|
|
141
192
|
await init();
|
|
142
193
|
|
|
@@ -155,14 +206,14 @@ const keypair = await loadRawKeyPair('/path/to/.nit');
|
|
|
155
206
|
// Get blockchain wallet addresses (derived from your identity)
|
|
156
207
|
const addresses = await getWalletAddresses('/path/to/.nit');
|
|
157
208
|
// → { solana: "C54kvW3...", ethereum: "0x2317..." }
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## Design Principles
|
|
161
209
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
210
|
+
// Sign and broadcast transactions
|
|
211
|
+
await rpcSetUrl('evm', 'https://eth.llamarpc.com');
|
|
212
|
+
const sig = await signTx('evm', '0x<32-byte-keccak256-hash>');
|
|
213
|
+
// → { chain: 'evm', signature: '0x...', recovery: 0, address: '0x...' }
|
|
214
|
+
await broadcast('evm', '0x<signed-tx-hex>');
|
|
215
|
+
// → { chain: 'evm', txHash: '0x...', rpcUrl: 'https://...' }
|
|
216
|
+
```
|
|
166
217
|
|
|
167
218
|
## License
|
|
168
219
|
|