moltyjacs 0.3.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 HAI
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,223 @@
1
+ # moltyjacs
2
+
3
+ JACS cryptographic provenance plugin for OpenClaw.
4
+
5
+ ## Why use JACS?
6
+
7
+ **So your OpenClaw agent can be trusted—and can trust others.** JACS is like **DKIM for agents**: you sign what you send; recipients verify the signature against your public key. It’s **decentralized**—no single authority. You publish your key (DNS, optional HAI.ai); others fetch and verify. Without it, nothing you say or do can be proven. With JACS you sign messages, commitments, and state; anyone with your public key can verify they came from you and weren’t altered. You get proof of origin, integrity, and accountability. Other agents can discover your key via DNS or HAI.ai and verify your documents; you verify theirs with `jacs_verify_auto` and optional trust levels (domain, attested). Keys and signed payloads stay local; you send the same signed JSON over any channel (WhatsApp, HTTP, MCP). **Use it whenever another agent or human needs to trust that you said or agreed to something.**
8
+
9
+ ## Overview
10
+
11
+ moltyjacs adds post-quantum cryptographic signatures to your OpenClaw agent communications. It enables:
12
+
13
+ - **Document signing** - Sign any document with your agent's cryptographic identity
14
+ - **Verification** - Verify documents from other agents
15
+ - **Agent discovery** - Publish and discover agents via well-known endpoints and DNS
16
+ - **Multi-party agreements** - Create and manage agreements requiring multiple signatures
17
+
18
+ ## Installation
19
+
20
+ ### From npm
21
+
22
+ ```bash
23
+ npm install moltyjacs
24
+ ```
25
+
26
+ ### From ClawHub
27
+
28
+ ```bash
29
+ npx clawhub@latest install moltyjacs
30
+ ```
31
+
32
+ ### As OpenClaw Plugin
33
+
34
+ ```bash
35
+ openclaw plugins install moltyjacs
36
+ ```
37
+
38
+ ### From GitHub
39
+
40
+ ```bash
41
+ openclaw plugins install https://github.com/HumanAssisted/moltyjacs
42
+ ```
43
+
44
+ ## Quick Start
45
+
46
+ 1. Initialize JACS with key generation:
47
+ ```bash
48
+ openclaw jacs init
49
+ ```
50
+
51
+ 2. Sign a document:
52
+ ```bash
53
+ openclaw jacs sign document.json
54
+ ```
55
+
56
+ 3. Verify a signed document:
57
+ ```bash
58
+ openclaw jacs verify signed-document.json
59
+ ```
60
+
61
+ ## CLI Commands
62
+
63
+ | Command | Description |
64
+ |---------|-------------|
65
+ | `openclaw jacs init` | Initialize JACS with key generation |
66
+ | `openclaw jacs status` | Show agent status and configuration |
67
+ | `openclaw jacs sign <file>` | Sign a document file |
68
+ | `openclaw jacs verify <file>` | Verify a signed document |
69
+ | `openclaw jacs hash <string>` | Hash a string |
70
+ | `openclaw jacs dns-record <domain>` | Generate DNS TXT record for discovery |
71
+ | `openclaw jacs lookup <domain>` | Look up another agent's info |
72
+ | `openclaw jacs register [--api-key <key>] [--preview]` | Register this agent with HAI.ai for attested trust level |
73
+ | `openclaw jacs attestation [domain]` | Check attestation status for this agent or another by domain |
74
+ | `openclaw jacs claim [level]` | Set or view verification claim (includes DNS/HAI proof details) |
75
+
76
+ ## HAI.ai registration
77
+
78
+ To get an attested trust level, register your agent with HAI.ai once: run `openclaw jacs register`. You must set the `HAI_API_KEY` environment variable or pass `--api-key`. Use `--preview` to see what would be sent without registering. After registration, use `openclaw jacs attestation` to check your (or another agent's) attestation status, and `openclaw jacs claim <level>` to set or view your verification claim. `verified` now requires DNS TXT hash verification (domain configured + published hash matches your public key). See [Configuration](#configuration) and [Security](#security) for related options.
79
+
80
+ ## Agent Tools
81
+
82
+ When used with an AI agent, these tools are available:
83
+
84
+ | Tool | Purpose |
85
+ |------|---------|
86
+ | `jacs_sign` | Sign a document (returns signed doc; when small enough, includes `verification_url` for sharing) |
87
+ | `jacs_verify_link` | Get a shareable verification URL for a signed document (for https://hai.ai/jacs/verify) |
88
+ | `jacs_verify` | Verify a self-signed document |
89
+ | `jacs_verify_auto` | Verify any document (auto-fetches keys) |
90
+ | `jacs_fetch_pubkey` | Fetch another agent's public key |
91
+ | `jacs_verify_with_key` | Verify with a specific public key |
92
+ | `jacs_dns_lookup` | Look up DNS TXT record |
93
+ | `jacs_lookup_agent` | Get complete agent info |
94
+ | `jacs_create_agreement` | Create multi-party agreement |
95
+ | `jacs_sign_agreement` | Sign an agreement |
96
+ | `jacs_check_agreement` | Check agreement status |
97
+ | `jacs_hash` | Hash content |
98
+ | `jacs_identity` | Get your identity info |
99
+ | `jacs_audit` | Run read-only JACS security audit |
100
+
101
+ ## Well-Known Endpoints
102
+
103
+ Your agent exposes these endpoints:
104
+
105
+ - `GET /.well-known/jacs-pubkey.json` - Your public key
106
+ - `GET /jacs/status` - Health check
107
+ - `POST /jacs/verify` - Public verification (this agent)
108
+ - `GET /jacs/attestation` - Full attestation status (trust level, HAI registration, DNS verification)
109
+
110
+ **Recipients** can verify any JACS document at [https://hai.ai/jacs/verify](https://hai.ai/jacs/verify) (paste a link with `?s=` or the base64). Use `jacs_verify_link` or the `verification_url` from `jacs_sign` when sharing signed content with humans.
111
+
112
+ Signing is internal only; no external sign endpoint is exposed (to protect the agent's identity).
113
+
114
+ ## Configuration
115
+
116
+ Configure via `openclaw.plugin.json`:
117
+
118
+ ```json
119
+ {
120
+ "keyAlgorithm": "pq2025",
121
+ "autoSign": false,
122
+ "autoVerify": true,
123
+ "agentName": "My Agent",
124
+ "agentDescription": "Description",
125
+ "agentDomain": "agent.example.com"
126
+ }
127
+ ```
128
+
129
+ `agentId` is set automatically when you run `openclaw jacs init` and is not edited in the config file.
130
+
131
+ ### Environment variables
132
+
133
+ | Variable | Purpose |
134
+ |----------|---------|
135
+ | `JACS_PRIVATE_KEY_PASSWORD` | Password for the encrypted private key; required for signing when not prompted (e.g. headless/CI). |
136
+ | `HAI_API_KEY` | Used by `openclaw jacs register`; can be passed via `--api-key` instead. |
137
+ | `HAI_API_URL` | Optional override for HAI API base URL (default `https://api.hai.ai`). |
138
+
139
+ The key password is generated at `openclaw jacs init` and must be stored securely.
140
+
141
+ ### Key Algorithms
142
+
143
+ - `pq2025` (default) - Post-quantum ML-DSA-87
144
+ - `pq-dilithium` - Dilithium
145
+ - `ring-Ed25519` - Ed25519
146
+ - `RSA-PSS` - RSA with PSS padding
147
+
148
+ ## Security
149
+
150
+ - Private keys are encrypted with AES-256-GCM
151
+ - Key derivation uses PBKDF2
152
+ - Default algorithm (pq2025) provides quantum resistance
153
+ - DNS records enable DNSSEC-backed identity verification
154
+
155
+ ## Publishing
156
+
157
+ ### To npm
158
+
159
+ ```bash
160
+ npm run build
161
+ npm publish
162
+ ```
163
+
164
+ ### To ClawHub
165
+
166
+ ```bash
167
+ npm run clawhub:publish
168
+ ```
169
+
170
+ Or publish to both npm and ClawHub:
171
+
172
+ ```bash
173
+ npm run publish:all
174
+ ```
175
+
176
+ ### Manual ClawHub Publishing
177
+
178
+ 1. Install the ClawHub CLI:
179
+ ```bash
180
+ npm install -g clawhub
181
+ ```
182
+
183
+ 2. Publish the plugin:
184
+ ```bash
185
+ clawhub publish .
186
+ ```
187
+
188
+ 3. Sync updates:
189
+ ```bash
190
+ clawhub sync
191
+ ```
192
+
193
+ ## Development
194
+
195
+ ```bash
196
+ # Install dependencies
197
+ npm install
198
+
199
+ # Build
200
+ npm run build
201
+
202
+ # Watch mode
203
+ npm run watch
204
+
205
+ # Test local installation
206
+ openclaw plugins install . --link
207
+ openclaw plugins list
208
+ ```
209
+
210
+ ## Publishing
211
+
212
+ CI publishes on push of a tag `v*` (e.g. `v0.3.0`). **Publish [@hai.ai/jacs](https://www.npmjs.com/package/@hai.ai/jacs) from the [JACS](https://github.com/HumanAssisted/JACS) repo first** (tag `npm/v*`), then tag and push moltyjacs so the build can resolve the dependency.
213
+
214
+ ## License
215
+
216
+ MIT License - see [LICENSE](LICENSE)
217
+
218
+ ## Links
219
+ - [HAI.AI](https://hai.ai)
220
+ - [JACS Documentation](https://github.com/HumanAssisted/JACS/)
221
+ - [OpenClaw](https://docs.openclaw.ai)
222
+ - [ClawHub](https://www.clawhub.com)
223
+ - [GitHub](https://github.com/HumanAssisted/moltyjacs)
package/dist/cli.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ /**
2
+ * JACS CLI Commands for OpenClaw
3
+ *
4
+ * Provides command-line interface for JACS operations.
5
+ */
6
+ import type { OpenClawPluginAPI } from "./index";
7
+ export interface CLIResult {
8
+ text: string;
9
+ data?: any;
10
+ error?: string;
11
+ }
12
+ export interface CLICommand {
13
+ description: string;
14
+ args?: string[];
15
+ handler: (args: any) => Promise<CLIResult>;
16
+ }
17
+ export interface CLICommands {
18
+ [key: string]: CLICommand;
19
+ }
20
+ /**
21
+ * Creates CLI commands for the JACS plugin
22
+ */
23
+ export declare function cliCommands(api: OpenClawPluginAPI): CLICommands;
24
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAiC,MAAM,SAAS,CAAC;AAWhF,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,iBAAiB,GAAG,WAAW,CA+mB/D"}