Skip to content

Commit 8ae2a52

Browse files
authored
Merge pull request #21 from HumanAssisted/0.3.2
0.3.2
2 parents 626e66c + a69d4f4 commit 8ae2a52

File tree

49 files changed

+2352
-663
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2352
-663
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,33 @@
11
# PLANNED
2+
23
- encrypt files at rest
34
- refine schema usage
45
- more getters and setters for documents recognized by schemas
56
- WASM builds
67

8+
9+
## 0.4.0
10+
- WASM
11+
12+
## 0.3.4
13+
14+
## 0.3.3
15+
- upgrade pqcrypto https://github.com/rustpq/pqcrypto/issues/79
16+
717
# COMPLETED
818

19+
## 0.3.2
20+
- [ ] add common clause to Apache 2.0
21+
- [x] use a single file to handle file i/o for all storage types
22+
- [x] use an ENV wrapper to prep for wasm
23+
- [x] complete migration away from fs calls except for config, security, tests, cli
24+
- [x] create tests using custom schemas - verify this is working
25+
- [] TEST init agent without needing configs in filesystem by checking that needed ENV variables are set
26+
- [] separate public key location from private key location
27+
- [] refactor API so easier to use from higher level libraries - create agent, load agent, save document, create document, update document
28+
29+
30+
931

1032
## 0.3.1
1133
- upgraded many dependencies using

Cargo.toml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ include = [
2929
"CHANGELOG.md",
3030
"basic-schemas.png",
3131
"benches/sign_and_check_sig.rs",
32+
"schemas/components/embedding/v1/embedding.schema.json",
3233
]
3334
description = "JACS JSON AI Communication Standard"
3435
readme = "README.md"
@@ -43,34 +44,36 @@ build = "build.rs"
4344

4445
[dependencies]
4546
base64 = "0.22.1"
46-
chrono = "0.4.39"
47+
chrono = "0.4.40"
4748
jsonschema = { version = "0.29", features = ["resolve-http", "resolve-file"] }
48-
log = "0.4.25"
49-
pem = "3.0.4"
49+
log = "0.4.27"
50+
pem = "3.0.5"
5051
rand = "0.9.0"
51-
rsa = { version= "0.9.7", features= ["sha2", "pem"]}
52+
rsa = { version= "0.9.8", features= ["sha2", "pem"]}
5253
serde = { version = "1.0", features = ["derive"] }
5354
serde_json = "1.0"
5455
signature = "2.2.0"
5556
url = "2.5.4"
5657
sha2 = "0.10.8"
5758
phf = { version = "0.11.3", features = ["macros"] }
58-
strum = "0.27.0"
59+
strum = "0.27.1"
5960
strum_macros = "0.27.0"
6061
secrecy = "0.10.3"
6162
aes-gcm = "0.10.3"
62-
clap = "4.5.29"
63+
clap = "4.5.35"
6364
regex = "1.11.1"
6465
mime_guess = "2.0.5"
65-
flate2 = "1.0.35"
66+
flate2 = "1.1.1"
6667
encoding_rs = "0.8.35"
6768
difference = "2.0.0"
6869
rpassword = "7.3.1"
6970
validator = "0.20.0"
70-
uuid = { version = "1.13.1", features = ["v4", "v7", "js"] }
71-
env_logger = "0.11.6"
71+
uuid = { version = "1.16.0", features = ["v4", "v7", "js"] }
72+
env_logger = "0.11.8"
7273
futures-util = "0.3.31"
73-
referencing = "0.29.0"
74+
referencing = "0.29.1"
75+
futures-executor = "0.3.31"
76+
# libp2p = "0.55.0"
7477
# [target.'cfg(target_os = "macos")'.dependencies]
7578
# pqcrypto-mldsa = { version = "0.1", default-features = false, features = ["serialization"] }
7679

@@ -81,7 +84,7 @@ referencing = "0.29.0"
8184
[dev-dependencies]
8285
color-eyre = "0.6"
8386
criterion = "0.5.1"
84-
mdbook = "0.4.44"
87+
mdbook = "0.4.48"
8588

8689

8790
[lib]
@@ -94,10 +97,11 @@ pqcrypto-traits = "0.3.5"
9497
ring = "0.17.9"
9598
reqwest = { version ="0.12.12", features = ["blocking", "json"] }
9699
walkdir = "2.5.0"
97-
object_store = { version ="0.11.2", features = ["serde","serde_json", "aws", "http"] }
100+
object_store = { version ="0.12.0", features = ["serde","serde_json", "aws", "http"] }
98101

99102
[target.'cfg(target_arch = "wasm32")'.dependencies]
100103
wasm-bindgen = "0.2.100"
104+
web-sys = { version = "0.3", features = ["Storage", "Window"] }
101105

102106
[[bin]]
103107
name = "jacs"

LICENSE

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
1+
“Commons Clause” License Condition v1.0
12

2-
Copyright 2024 Human Assisted Intelligence, LLC
3+
Software: JACS
4+
License: Apache 2.0
5+
Licensor: Human Assisted Intelligence, LLC
6+
Link: https://commonsclause.com/
7+
8+
The Software is provided to you by the Licensor under the License,
9+
as defined below, subject to the following condition.
10+
11+
Without limiting other conditions in the License, the grant of rights
12+
under the License will not include, and the License does not grant
13+
to you, the right to Sell the Software.
14+
15+
For purposes of the foregoing, “Sell” means practicing any or all of
16+
the rights granted to you under the License to provide to third parties,
17+
for a fee or other consideration (including without limitation fees for
18+
hosting or consulting/ support services related to the Software),
19+
a product or service whose value derives, entirely or substantially,
20+
from the functionality of the Software. Any license notice or attribution
21+
required by the License must also include this Commons Clause License
22+
Condition notice.
23+
24+
25+
Copyright 2024, 2025 Human Assisted Intelligence, LLC
326

427
Licensed under the Apache License, Version 2.0 (the "License");
528
you may not use this file except in compliance with the License.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Welcome to JACS (JSON Agent Communication Standard), a verifiable document forma
44

55
JACS documents enable more trusted data sharing between AI agents and Human UIs.
66

7-
** NOTE: Current version 0.3.0 *ALPHA* .
7+
** NOTE: Current version 0.3.2 *ALPHA* .
88

99
JACS is a JSON document format for creating secure, verifiable documents that AI agents, ML pipelines, SaaS services, and UIs can exchange and process. The goal of JACS is to ensure that these documents remain unchanged (immutable), produce the same verification result every time (idempotent), and can be used flexibly by software.
1010

@@ -14,6 +14,8 @@ JACS also provides standardization for agreement between agents. While each docu
1414

1515
Use JACS as is, embed in other projects or libraries, commercial or otherwise.
1616

17+
Please note that the [license][./LICENSE] is *modified* Apache 2.0, with the [Common Clause](https://commonsclause.com/) preamble. In simple terms, unless you are competing with HAI.AI, you can create commercial products with JACS.
18+
1719
## Basic use cases
1820

1921
1. version json documents and test against a schema

benches/sign_and_check_sig.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,32 @@ use jacs::agent::Agent;
66
use log::debug;
77

88
use jacs::agent::DOCUMENT_AGENT_SIGNATURE_FIELDNAME;
9+
use jacs::storage::jenv::set_env_var;
910
use rand::Rng;
1011
use std::env;
1112

1213
static BENCH_SAMPLE_SIZE: usize = 100;
1314

1415
fn set_enc_to_ring() {
15-
env::set_var(
16+
set_env_var(
1617
"JACS_AGENT_PRIVATE_KEY_FILENAME",
1718
"test-ring-Ed25519-private.pem",
18-
);
19-
env::set_var(
19+
)
20+
.expect("Failed to set private key filename");
21+
set_env_var(
2022
"JACS_AGENT_PUBLIC_KEY_FILENAME",
2123
"test-ring-Ed25519-public.pem",
22-
);
23-
env::set_var("JACS_AGENT_KEY_ALGORITHM", "ring-Ed25519");
24+
)
25+
.expect("Failed to set public key filename");
26+
set_env_var("JACS_AGENT_KEY_ALGORITHM", "ring-Ed25519").expect("Failed to set key algorithm");
2427
}
2528

2629
fn set_enc_to_pq() {
27-
env::set_var("JACS_AGENT_PRIVATE_KEY_FILENAME", "test-pq-private.pem");
28-
env::set_var("JACS_AGENT_PUBLIC_KEY_FILENAME", "test-pq-public.pem");
29-
env::set_var("JACS_AGENT_KEY_ALGORITHM", "pq-dilithium");
30+
set_env_var("JACS_AGENT_PRIVATE_KEY_FILENAME", "test-pq-private.pem")
31+
.expect("Failed to set private key filename");
32+
set_env_var("JACS_AGENT_PUBLIC_KEY_FILENAME", "test-pq-public.pem")
33+
.expect("Failed to set public key filename");
34+
set_env_var("JACS_AGENT_KEY_ALGORITHM", "pq-dilithium").expect("Failed to set key algorithm");
3035
}
3136

3237
fn load_test_agent_one() -> Agent {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Untitled string in Config Schema
2+
3+
```txt
4+
https://hai.ai/schemas/jacs.config.schema.json#/properties/jacs_default_storage
5+
```
6+
7+
default storage to use
8+
9+
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
10+
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :---------------------------------------------------------------------------------------- |
11+
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [jacs.config.schema.json\*](../../schemas/jacs.config.schema.json "open original schema") |
12+
13+
## jacs\_default\_storage Type
14+
15+
`string`
16+
17+
## jacs\_default\_storage Constraints
18+
19+
**enum**: the value of this property must be equal to one of the following values:
20+
21+
| Value | Explanation |
22+
| :------ | :---------- |
23+
| `"fs"` | |
24+
| `"aws"` | |
25+
| `"hai"` | |

docs/schema/jacs.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Jacs Configuration File
2929
| [jacs\_header\_schema\_version](#jacs_header_schema_version) | `string` | Optional | cannot be null | [Config](jacs-properties-jacs_header_schema_version.md "https://hai.ai/schemas/jacs.config.schema.json#/properties/jacs_header_schema_version") |
3030
| [jacs\_signature\_schema\_version](#jacs_signature_schema_version) | `string` | Optional | cannot be null | [Config](jacs-properties-jacs_signature_schema_version.md "https://hai.ai/schemas/jacs.config.schema.json#/properties/jacs_signature_schema_version") |
3131
| [jacs\_private\_key\_password](#jacs_private_key_password) | `string` | Optional | cannot be null | [Config](jacs-properties-jacs_private_key_password.md "https://hai.ai/schemas/jacs.config.schema.json#/properties/jacs_private_key_password") |
32+
| [jacs\_default\_storage](#jacs_default_storage) | `string` | Required | cannot be null | [Config](jacs-properties-jacs_default_storage.md "https://hai.ai/schemas/jacs.config.schema.json#/properties/jacs_default_storage") |
3233

3334
## jacs\_use\_filesystem
3435

@@ -237,3 +238,31 @@ encryption password. Do not use in production and instead only keep in ENV with
237238
### jacs\_private\_key\_password Type
238239

239240
`string`
241+
242+
## jacs\_default\_storage
243+
244+
default storage to use
245+
246+
`jacs_default_storage`
247+
248+
* is required
249+
250+
* Type: `string`
251+
252+
* cannot be null
253+
254+
* defined in: [Config](jacs-properties-jacs_default_storage.md "https://hai.ai/schemas/jacs.config.schema.json#/properties/jacs_default_storage")
255+
256+
### jacs\_default\_storage Type
257+
258+
`string`
259+
260+
### jacs\_default\_storage Constraints
261+
262+
**enum**: the value of this property must be equal to one of the following values:
263+
264+
| Value | Explanation |
265+
| :------ | :---------- |
266+
| `"fs"` | |
267+
| `"aws"` | |
268+
| `"hai"` | |
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"$schema": "https://hai.ai/schemas/header/v1/header.schema.json",
3+
"description": "We should embed an xml document here",
4+
"jacsFiles": [
5+
{
6+
"embed": false,
7+
"mimetype": "text/xml",
8+
"path": "raw/plants.xml",
9+
"sha256": "8615f88410eeafb38e2c386ed9dbae8fadf3d4d0e50a8dc43c4287246f104311"
10+
},
11+
{
12+
"embed": false,
13+
"mimetype": "text/xml",
14+
"path": "raw/breakfast.xml",
15+
"sha256": "71ae785d2f68d8b818da97171013033a5bfc632b6cad7d286e8e1907e023d0dd"
16+
}
17+
],
18+
"jacsId": "002a2ed6-2eec-4325-9072-a8612b3ae697",
19+
"jacsLevel": "raw",
20+
"jacsOriginalDate": "2025-02-17T23:58:00.976546+00:00",
21+
"jacsOriginalVersion": "470ba1a2-8d91-4066-b9f5-2ba91b83122a",
22+
"jacsSha256": "91590db6b2debaa3d459b02c51778538ba6078c7a99ff2ef882f078104eaa794",
23+
"jacsSignature": {
24+
"agentID": "ddf35096-d212-4ca9-a299-feda597d5525",
25+
"agentVersion": "b57d480f-b8d4-46e7-9d7c-942f2b132717",
26+
"date": "2025-02-17T23:58:01.332675+00:00",
27+
"fields": [
28+
"$schema",
29+
"description",
30+
"jacsFiles",
31+
"jacsId",
32+
"jacsLevel",
33+
"jacsOriginalDate",
34+
"jacsOriginalVersion",
35+
"jacsType",
36+
"jacsVersion",
37+
"jacsVersionDate"
38+
],
39+
"publicKeyHash": "2c9cc6361e2003173df86b9c267b3891193319da7fe7c6f42cb0fbe5b30d7c0d",
40+
"signature": "E4tGYMCPNM/ii01CUC+hywJzza694O20ODFW3NAYx7OaPJlTsFVyJ56i7NTY/hFotYqLm68zAmpGTL/vhlXhlelMHOVVsJa03+oXGj71a6scwBQdaEMasAMNsAKsEEQn27J6yux7CNtAI7jJtAcOoAc5OhOgLeXBArN2Uq9L7ahYzW5EsvQmIKMPNHx5EdFdOCol1kpYcYexe3JuzhkITAGk/hGAbKyAc6qyFHesKb4SsH4xHJJjWAJFr4UIc1Ege+TOCamRFD0npKuSc+hPcgUn/RFBZFfW7dlLcFbD+VlIc//mLGMlt0I07LCFIxkj/4JjbxEUGIo8XT1lDoCa/xWGzBb4wAhkrjkHfv7aMIrHSVgTqE5Kch7esDudx5e+N4bYX7f3vaOXlu2InpKw0j6KD2UZGYXdmr4KOBipyulH9dWyx/TYbGFbaNC1f+/83hei9kEPsH6BgIdCiax5CHo3n8Gs2rr5yqMDbs+YbEfcMYyQQtF1Ee4Gr1wAO6XEXU1cdlA9Tm6Fh4nFg3uuLgN1E3mSOZZGTdBA1i4mVzBE9Dum4MuGCnm4Xb4cuFTxhD8K5PRv1PPuGa3qsq8u/vTZTDLnH1WwquGHXhv7TX+yed1jQBiRKAoLhavEhVHGCdZTEILlubxvgPLPMK6kULavPEusWePydUJbzolam/Y=",
41+
"signingAlgorithm": "RSA-PSS"
42+
},
43+
"jacsType": "header",
44+
"jacsVersion": "470ba1a2-8d91-4066-b9f5-2ba91b83122a",
45+
"jacsVersionDate": "2025-02-17T23:58:00.976546+00:00"
46+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"$schema": "https://hai.ai/schemas/header/v1/header.schema.json",
3+
"description": "We should embed an xml document here",
4+
"jacsFiles": [
5+
{
6+
"embed": false,
7+
"mimetype": "text/xml",
8+
"path": "raw/plants.xml",
9+
"sha256": "8615f88410eeafb38e2c386ed9dbae8fadf3d4d0e50a8dc43c4287246f104311"
10+
},
11+
{
12+
"embed": false,
13+
"mimetype": "text/xml",
14+
"path": "raw/breakfast.xml",
15+
"sha256": "71ae785d2f68d8b818da97171013033a5bfc632b6cad7d286e8e1907e023d0dd"
16+
}
17+
],
18+
"jacsId": "10246cd3-5824-4b31-8340-224f22b801d6",
19+
"jacsLevel": "raw",
20+
"jacsOriginalDate": "2025-02-17T10:28:03.504197+00:00",
21+
"jacsOriginalVersion": "ddcd1726-582b-4bce-ab7f-74d42ccb3273",
22+
"jacsSha256": "6f30af9349d5063a61e3b3ae0c78ffcfc8bc2ee55a282268b87ef3bcf8ddd6b3",
23+
"jacsSignature": {
24+
"agentID": "ddf35096-d212-4ca9-a299-feda597d5525",
25+
"agentVersion": "b57d480f-b8d4-46e7-9d7c-942f2b132717",
26+
"date": "2025-02-17T10:28:03.868565+00:00",
27+
"fields": [
28+
"$schema",
29+
"description",
30+
"jacsFiles",
31+
"jacsId",
32+
"jacsLevel",
33+
"jacsOriginalDate",
34+
"jacsOriginalVersion",
35+
"jacsType",
36+
"jacsVersion",
37+
"jacsVersionDate"
38+
],
39+
"publicKeyHash": "2c9cc6361e2003173df86b9c267b3891193319da7fe7c6f42cb0fbe5b30d7c0d",
40+
"signature": "fYlqwrHCSt+5AhPqKa+tybqNY7Rhv5hrDv+tnQ24prMzQAFHZ7vIutgxeWoTDt4vC0KQm4euhLnEzSAXYEBBR4DpkCcFCzehocriX7nf0xiPWLpaOwnvNPBI+Xr2x9NQ1su6f0wJWD32KMFqQI/mwYi56OzdjU9ZXZ2yAk5HueScD551VnE1/+sGsTPeGX+eilSRZC4RV+BywkUiBIW6sVFSTcbHxvPaMoJUjX3Jf892wBPk4bKBsFbKJJ0JwzoOqQyeAYdM88viqv6P4wYeGMDDHMkjM+ThRSURaL0QoSuWpccfwZTBi+hRyth3O8KTcSKTJiXr4Ey/mrzjxLv9aLcA4iUGNEvI2dRM96id7y3b8CdVA9e7/KCu1upSI2N7/lT/D9sSG2NC6/RpW3lS4MbNrtiyFxBDO78/9+eQ9oSN0AskUacwSiPaKiJUTZmQrnGonmjSPqzGGDM6f7FVoF4nfdr3kjr8p/3C6RZwobYfre3UBfnyZLKoixn/zCCzd1nXJinnr4Xp8wW0v1gDAeM3m2PCDVU++CKeCuD0M3fDheLt2kOlp/BrGbFZXsSBHgNDkORlbuUqpvoFH62lri/nGpU54C0pfTOOQ8ECZh0pCWlz4Z5vhsvZ8N/+SjkBk6XwxSHKahbuWby0ayeYsYYJNgAb2sqH3KiEXGaa8Fc=",
41+
"signingAlgorithm": "RSA-PSS"
42+
},
43+
"jacsType": "header",
44+
"jacsVersion": "ddcd1726-582b-4bce-ab7f-74d42ccb3273",
45+
"jacsVersionDate": "2025-02-17T10:28:03.504197+00:00"
46+
}

0 commit comments

Comments
 (0)