naracli 1.0.27 → 1.0.30
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 +37 -4
- package/bin/nara-cli.ts +5 -4
- package/dist/nara-cli-bundle.cjs +4698 -2525
- package/package.json +8 -4
- package/src/cli/commands/agent.ts +399 -0
- package/src/cli/commands/quest.ts +14 -5
- package/src/cli/commands/skills.ts +2 -0
- package/src/cli/commands/zkid.ts +77 -37
- package/src/cli/index.ts +4 -0
- package/src/cli/utils/agent-config.ts +48 -0
- package/src/cli/utils/validation.ts +14 -0
- package/src/tests/agent-registry.test.ts +145 -0
- package/src/tests/helpers.ts +2 -23
- package/src/tests/quest-referral.test.ts +230 -0
- package/src/tests/quest.test.ts +155 -0
- package/src/tests/skills.test.ts +36 -20
- package/src/tests/zkid.test.ts +117 -5
- package/src/tests/skills.e2e.test.ts +0 -126
- package/src/tests/zkid.e2e.test.ts +0 -128
package/README.md
CHANGED
|
@@ -46,9 +46,11 @@ Wallet is saved to `~/.config/nara/id.json` by default.
|
|
|
46
46
|
|
|
47
47
|
| Command | Description |
|
|
48
48
|
| ------- | ----------- |
|
|
49
|
-
| `quest get` | Get current quest info |
|
|
49
|
+
| `quest get` | Get current quest info (includes difficulty) |
|
|
50
50
|
| `quest answer <answer>` | Submit answer with ZK proof |
|
|
51
51
|
|
|
52
|
+
**Options** (answer): `--relay [url]` — gasless submission via relay · `--agent <name>` — terminal/tool type (default: `naracli`) · `--model <name>` — AI model identifier · `--referral <agent-id>` — referral agent ID for earning referral points
|
|
53
|
+
|
|
52
54
|
### Skills Hub — Registry (on-chain)
|
|
53
55
|
|
|
54
56
|
| Command | Description |
|
|
@@ -85,10 +87,36 @@ Pull skill content from the chain and write it to your AI-agent skill directorie
|
|
|
85
87
|
| `zkid create <name>` | Register a new ZK ID on-chain |
|
|
86
88
|
| `zkid info <name>` | Query ZK ID account info (read-only) |
|
|
87
89
|
| `zkid deposit <name> <amount>` | Deposit NARA into ZK ID (1 / 10 / 100 / 1000 / 10000 / 100000) |
|
|
88
|
-
| `zkid scan
|
|
90
|
+
| `zkid scan [name]` | Scan for claimable deposits (all from config if no name, `-w` auto-withdraw) |
|
|
89
91
|
| `zkid withdraw <name>` | Anonymously withdraw a deposit (`--recipient <addr>`) |
|
|
90
92
|
| `zkid id-commitment <name>` | Output idCommitment hex for this wallet + name |
|
|
91
|
-
| `zkid transfer <name> <commitment>` | Transfer ZK ID ownership to a new commitment holder |
|
|
93
|
+
| `zkid transfer-owner <name> <commitment>` | Transfer ZK ID ownership to a new commitment holder |
|
|
94
|
+
|
|
95
|
+
### Agent Registry
|
|
96
|
+
|
|
97
|
+
| Command | Description |
|
|
98
|
+
| ------- | ----------- |
|
|
99
|
+
| `agent register <agent-id>` | Register a new agent on-chain |
|
|
100
|
+
| `agent get <agent-id>` | Get agent info (bio, metadata, version, points) |
|
|
101
|
+
| `agent set-bio <agent-id> <bio>` | Set agent bio (max 512 bytes) |
|
|
102
|
+
| `agent set-metadata <agent-id> <json>` | Set agent JSON metadata (max 800 bytes) |
|
|
103
|
+
| `agent upload-memory <agent-id> <file>` | Upload memory data from file |
|
|
104
|
+
| `agent memory <agent-id>` | Read agent memory content |
|
|
105
|
+
| `agent transfer <agent-id> <new-authority>` | Transfer agent authority |
|
|
106
|
+
| `agent close-buffer <agent-id>` | Close upload buffer, reclaim rent |
|
|
107
|
+
| `agent delete <agent-id>` | Delete agent, reclaim rent |
|
|
108
|
+
| `agent log <agent-id> <activity> <log>` | Log activity event on-chain (`--model`, `--referral`) |
|
|
109
|
+
|
|
110
|
+
### Agent Config
|
|
111
|
+
|
|
112
|
+
CLI automatically maintains `~/.config/nara/agent.json`:
|
|
113
|
+
|
|
114
|
+
- `agent_ids` — registered agent IDs (most recent first), used for on-chain activityLog
|
|
115
|
+
- `zk_ids` — created ZK ID names (most recent first), used by `zkid scan` with no arguments
|
|
116
|
+
|
|
117
|
+
When `agent_ids[0]` exists, `quest answer` automatically logs PoMI activity on-chain in the same transaction (direct submission only, not relay).
|
|
118
|
+
|
|
119
|
+
**Naming rules**: Agent IDs and skill names must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens.
|
|
92
120
|
|
|
93
121
|
Run `npx naracli <command> --help` for details.
|
|
94
122
|
|
|
@@ -108,7 +136,7 @@ npx naracli balance
|
|
|
108
136
|
|
|
109
137
|
# Answer a quest
|
|
110
138
|
npx naracli quest get
|
|
111
|
-
npx naracli quest answer "your answer"
|
|
139
|
+
npx naracli quest answer "your answer" --agent claude-code --model claude-opus-4-6
|
|
112
140
|
|
|
113
141
|
# Publish a skill to the chain
|
|
114
142
|
npx naracli skills register my-skill "Alice"
|
|
@@ -127,6 +155,11 @@ npx naracli zkid create my-id
|
|
|
127
155
|
npx naracli zkid deposit my-id 10
|
|
128
156
|
npx naracli zkid scan my-id
|
|
129
157
|
npx naracli zkid withdraw my-id
|
|
158
|
+
|
|
159
|
+
# Agent registry
|
|
160
|
+
npx naracli agent register my-agent
|
|
161
|
+
npx naracli agent set-bio my-agent "My AI agent"
|
|
162
|
+
npx naracli agent get my-agent
|
|
130
163
|
```
|
|
131
164
|
|
|
132
165
|
## SDK
|
package/bin/nara-cli.ts
CHANGED
|
@@ -27,10 +27,11 @@ program
|
|
|
27
27
|
// Register all command modules
|
|
28
28
|
registerCommands(program);
|
|
29
29
|
|
|
30
|
-
//
|
|
31
|
-
program.parse(process.argv);
|
|
32
|
-
|
|
33
|
-
// Show help if no command provided
|
|
30
|
+
// Show help if no command provided, then exit cleanly
|
|
34
31
|
if (!process.argv.slice(2).length) {
|
|
35
32
|
program.outputHelp();
|
|
33
|
+
process.exit(0);
|
|
36
34
|
}
|
|
35
|
+
|
|
36
|
+
// Parse arguments and execute
|
|
37
|
+
program.parse(process.argv);
|