@newtype-ai/nit 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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 newtype-ai
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,143 @@
1
+ # nit
2
+
3
+ Version control for agent cards.
4
+
5
+ nit manages `agent-card.json` the way git manages source code. One agent, different cards for different platforms — each branch is a platform-specific identity.
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.
10
+
11
+ ```
12
+ main → full agent card (public, discoverable)
13
+ faam.fun → { skills: [content, social], description: "Content creator..." }
14
+ polymarket.com → { skills: [research, trading], description: "Market analyst..." }
15
+ ```
16
+
17
+ ## Install
18
+
19
+ ```bash
20
+ npm install -g @newtype-ai/nit
21
+ ```
22
+
23
+ Or use directly:
24
+
25
+ ```bash
26
+ npx @newtype-ai/nit init
27
+ ```
28
+
29
+ ## Quick Start
30
+
31
+ ```bash
32
+ # Initialize in your project directory
33
+ nit init
34
+
35
+ # Create a platform-specific branch
36
+ nit branch faam.fun
37
+
38
+ # Switch to it and customize the card
39
+ nit checkout faam.fun
40
+ # edit agent-card.json...
41
+ nit commit -m "FAAM config"
42
+
43
+ # Push all branches to remote
44
+ nit push --all
45
+ ```
46
+
47
+ ## Commands
48
+
49
+ | Command | Description |
50
+ |---------|-------------|
51
+ | `nit init` | Create `.nit/`, generate Ed25519 keypair, initial commit |
52
+ | `nit status` | Current branch, uncommitted changes, ahead/behind remote |
53
+ | `nit commit -m "msg"` | Snapshot agent-card.json (auto-resolves SKILL.md pointers) |
54
+ | `nit log` | Commit history for current branch |
55
+ | `nit diff [target]` | JSON diff vs HEAD, branch, or commit |
56
+ | `nit branch [name]` | List branches or create a new one |
57
+ | `nit checkout <branch>` | Switch branch (overwrites agent-card.json) |
58
+ | `nit push [--all]` | Push branch(es) to remote |
59
+ | `nit remote` | Show remote URL and credential status |
60
+
61
+ ## How It Works
62
+
63
+ ### Identity
64
+
65
+ `nit init` generates an Ed25519 keypair stored in `.nit/identity/`. The public key is embedded in your agent card as:
66
+
67
+ ```json
68
+ {
69
+ "publicKey": "ed25519:<base64-key>"
70
+ }
71
+ ```
72
+
73
+ Platforms verify your identity by challenging you to sign a nonce — no shared secrets, no bearer tokens.
74
+
75
+ ### Branches
76
+
77
+ Each branch is a different agent card for a different platform. Branch name = root domain of the platform (e.g., `faam.fun`, `polymarket.com`).
78
+
79
+ `nit checkout faam.fun` overwrites `./agent-card.json` with that branch's version.
80
+
81
+ ### Skill Resolution
82
+
83
+ At commit time, nit discovers SKILL.md files from all major agent frameworks:
84
+
85
+ - `.claude/skills/` — Claude Code
86
+ - `.cursor/skills/` — Cursor
87
+ - `.windsurf/skills/` — Windsurf
88
+ - `.codex/skills/` — OpenAI Codex
89
+ - `.agents/skills/` — Generic
90
+
91
+ Skills referenced in your card are resolved against these files, and the committed card contains a self-contained snapshot.
92
+
93
+ ### Remote Protocol
94
+
95
+ The main branch is public. Non-main branches require signed-challenge authentication:
96
+
97
+ ```
98
+ GET /.well-known/agent-card.json → main card (public)
99
+ GET /.well-known/agent-card.json?branch=faam.fun → 401 { challenge }
100
+ GET ... + X-Nit-Signature + X-Nit-Challenge → branch card
101
+ ```
102
+
103
+ nit is the client. Any server can implement the protocol. [newtype-ai.org](https://newtype-ai.org) provides a hosted implementation.
104
+
105
+ ## Directory Structure
106
+
107
+ ```
108
+ your-project/
109
+ ├── .nit/ # nit repository (gitignored)
110
+ │ ├── HEAD # Current branch ref
111
+ │ ├── config # Remote credentials
112
+ │ ├── identity/
113
+ │ │ ├── agent.pub # Ed25519 public key
114
+ │ │ └── agent.key # Ed25519 private key (0600)
115
+ │ ├── objects/ # Content-addressable store
116
+ │ └── refs/heads/ # Branch pointers
117
+ ├── agent-card.json # Working copy (changes with checkout)
118
+ └── ...
119
+ ```
120
+
121
+ ## Programmatic API
122
+
123
+ ```typescript
124
+ import { init, commit, checkout, branch, push, status } from '@newtype-ai/nit';
125
+
126
+ await init();
127
+ await branch('faam.fun');
128
+ await checkout('faam.fun');
129
+ // modify agent-card.json...
130
+ await commit('FAAM config');
131
+ await push({ all: true });
132
+ ```
133
+
134
+ ## Design Principles
135
+
136
+ - **Zero runtime dependencies** — uses only Node.js builtins
137
+ - **nit is neutral** — knows nothing about any specific platform
138
+ - **Agent card is the identity** — the keypair proves "I am this agent"
139
+ - **Like git, not GitHub** — nit is the tool, newtype-ai.org is a hosting service
140
+
141
+ ## License
142
+
143
+ MIT