fleetmesh-schema 0.1.0__tar.gz
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.
- fleetmesh_schema-0.1.0/LICENSE +121 -0
- fleetmesh_schema-0.1.0/PKG-INFO +44 -0
- fleetmesh_schema-0.1.0/README.md +34 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/__init__.py +62 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schema/DIGEST +1 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schema/PROTOCOLS +10 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schema/conformance.json +492 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schema/constants.canonical.json +1 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schema/constants.json +494 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schema/kinds.canonical.json +1 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schema/kinds.json +215 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schema/messages.canonical.json +1 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schema/messages.json +552 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schema/schemaorg-terms.json +2712 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/common/didcomm-envelope.schema.json +85 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/common/nostr-event.schema.json +46 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/common/primitives.schema.json +207 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/compute/bacalhau-batch-job.schema.json +140 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/compute/benchmark-merkle-tower.schema.json +69 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/compute/image-transform.schema.json +95 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/compute/job-descriptor.schema.json +89 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/compute/llm-inference-job.schema.json +113 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/compute/spam-classifier.schema.json +82 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/compute/wot-pagerank.schema.json +100 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/compute/zk-verify-groth16.schema.json +93 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/budget/close.schema.json +65 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/budget/dispute.schema.json +35 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/budget/receipt-ack.schema.json +69 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/budget/receipt.schema.json +91 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/complaint/appeal.schema.json +30 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/complaint/evidence.schema.json +32 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/complaint/notice.schema.json +40 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/complaint/remedy.schema.json +31 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/complaint/withdraw.schema.json +29 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/compute/accept.schema.json +68 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/compute/cancel.schema.json +52 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/compute/progress.schema.json +62 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/compute/quote.schema.json +36 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/compute/refute.schema.json +102 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/compute/sealed.schema.json +103 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/compute/settled.schema.json +36 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/compute/stream.schema.json +59 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/peering/accept.schema.json +33 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/peering/amend.schema.json +73 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/peering/decline.schema.json +69 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/peering/offer.schema.json +40 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/peering/propose.schema.json +187 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/peering/terminate.schema.json +29 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/standing/ask.schema.json +36 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/standing/decline.schema.json +28 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/standing/tell.schema.json +33 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/sync/deliver.schema.json +63 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/sync/done.schema.json +30 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/sync/handover.schema.json +129 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/sync/have.schema.json +32 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/sync/need.schema.json +33 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/sync/open.schema.json +33 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/didcomm/sync/range.schema.json +32 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/events/kind-11801-descriptor.schema.json +133 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/events/kind-11802-revocation.schema.json +41 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/events/kind-11803-compute-offer.schema.json +54 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/events/kind-21801-heartbeat.schema.json +67 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/events/kind-21802-telemetry.schema.json +43 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/events/kind-30801-grant-envelope.schema.json +104 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/events/kind-30802-conformance-report.schema.json +153 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/events/kind-30803-coverage-claim.schema.json +120 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/events/kind-30804-gossip-topic-membership.schema.json +101 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/events/kind-30810-compute-ask.schema.json +222 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/events/kind-30811-compute-receipt.schema.json +213 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/identity/did-nostr-node.schema.json +75 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/identity/fleetmesh-auth.schema.json +137 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/manifests/compute-provider.schema.json +82 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/manifests/grant-policy.schema.json +80 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/manifests/inference-router.schema.json +62 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/manifests/meshnode.schema.json +125 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/manifests/peering.schema.json +86 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/manifests/workload-router.schema.json +115 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/payloads/compute-ask-payload.schema.json +116 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/payloads/compute-receipt-payload.schema.json +96 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/payloads/grant-payload.schema.json +83 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema/schemas/payloads/receipt-counters.schema.json +55 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema.egg-info/PKG-INFO +44 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema.egg-info/SOURCES.txt +85 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema.egg-info/dependency_links.txt +1 -0
- fleetmesh_schema-0.1.0/fleetmesh_schema.egg-info/top_level.txt +1 -0
- fleetmesh_schema-0.1.0/pyproject.toml +20 -0
- fleetmesh_schema-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Creative Commons Legal Code
|
|
2
|
+
|
|
3
|
+
CC0 1.0 Universal
|
|
4
|
+
|
|
5
|
+
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
|
6
|
+
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
|
7
|
+
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
|
8
|
+
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
|
9
|
+
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
|
10
|
+
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
|
11
|
+
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
|
12
|
+
HEREUNDER.
|
|
13
|
+
|
|
14
|
+
Statement of Purpose
|
|
15
|
+
|
|
16
|
+
The laws of most jurisdictions throughout the world automatically confer
|
|
17
|
+
exclusive Copyright and Related Rights (defined below) upon the creator
|
|
18
|
+
and subsequent owner(s) (each and all, an "owner") of an original work of
|
|
19
|
+
authorship and/or a database (each, a "Work").
|
|
20
|
+
|
|
21
|
+
Certain owners wish to permanently relinquish those rights to a Work for
|
|
22
|
+
the purpose of contributing to a commons of creative, cultural and
|
|
23
|
+
scientific works ("Commons") that the public can reliably and without fear
|
|
24
|
+
of later claims of infringement build upon, modify, incorporate in other
|
|
25
|
+
works, reuse and redistribute as freely as possible in any form whatsoever
|
|
26
|
+
and for any purposes, including without limitation commercial purposes.
|
|
27
|
+
These owners may contribute to the Commons to promote the ideal of a free
|
|
28
|
+
culture and the further production of creative, cultural and scientific
|
|
29
|
+
works, or to gain reputation or greater distribution for their Work in
|
|
30
|
+
part through the use and efforts of others.
|
|
31
|
+
|
|
32
|
+
For these and/or other purposes and motivations, and without any
|
|
33
|
+
expectation of additional consideration or compensation, the person
|
|
34
|
+
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
|
35
|
+
is an owner of Copyright and Related Rights in the Work, voluntarily
|
|
36
|
+
elects to apply CC0 to the Work and publicly distribute the Work under its
|
|
37
|
+
terms, with knowledge of his or her Copyright and Related Rights in the
|
|
38
|
+
Work and the meaning and intended legal effect of CC0 on those rights.
|
|
39
|
+
|
|
40
|
+
1. Copyright and Related Rights. A Work made available under CC0 may be
|
|
41
|
+
protected by copyright and related or neighboring rights ("Copyright and
|
|
42
|
+
Related Rights"). Copyright and Related Rights include, but are not
|
|
43
|
+
limited to, the following:
|
|
44
|
+
|
|
45
|
+
i. the right to reproduce, adapt, distribute, perform, display,
|
|
46
|
+
communicate, and translate a Work;
|
|
47
|
+
ii. moral rights retained by the original author(s) and/or performer(s);
|
|
48
|
+
iii. publicity and privacy rights pertaining to a person's image or
|
|
49
|
+
likeness depicted in a Work;
|
|
50
|
+
iv. rights protecting against unfair competition in regards to a Work,
|
|
51
|
+
subject to the limitations in paragraph 4(a), below;
|
|
52
|
+
v. rights protecting the extraction, dissemination, use and reuse of data
|
|
53
|
+
in a Work;
|
|
54
|
+
vi. database rights (such as those arising under Directive 96/9/EC of the
|
|
55
|
+
European Parliament and of the Council of 11 March 1996 on the legal
|
|
56
|
+
protection of databases, and under any national implementation
|
|
57
|
+
thereof, including any amended or successor version of such
|
|
58
|
+
directive); and
|
|
59
|
+
vii. other similar, equivalent or corresponding rights throughout the
|
|
60
|
+
world based on applicable law or treaty, and any national
|
|
61
|
+
implementations thereof.
|
|
62
|
+
|
|
63
|
+
2. Waiver. To the greatest extent permitted by, but not in contravention
|
|
64
|
+
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
|
65
|
+
irrevocably and unconditionally waives, abandons, and surrenders all of
|
|
66
|
+
Affirmer's Copyright and Related Rights and associated claims and causes
|
|
67
|
+
of action, whether now known or unknown (including existing as well as
|
|
68
|
+
future claims and causes of action), in the Work (i) in all territories
|
|
69
|
+
worldwide, (ii) for the maximum duration provided by applicable law or
|
|
70
|
+
treaty (including future time extensions), (iii) in any current or future
|
|
71
|
+
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
|
72
|
+
including without limitation commercial, advertising or promotional
|
|
73
|
+
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
|
74
|
+
member of the public at large and to the detriment of Affirmer's heirs and
|
|
75
|
+
successors, fully intending that such Waiver shall not be subject to
|
|
76
|
+
revocation, rescission, cancellation, termination, or any other legal or
|
|
77
|
+
equitable action to disrupt the quiet enjoyment of the Work by the public
|
|
78
|
+
as contemplated by Affirmer's express Statement of Purpose.
|
|
79
|
+
|
|
80
|
+
3. Public License Fallback. Should any part of the Waiver for any reason
|
|
81
|
+
be judged legally invalid or ineffective under applicable law, then the
|
|
82
|
+
Waiver shall be preserved to the maximum extent permitted taking into
|
|
83
|
+
account Affirmer's express Statement of Purpose. In addition, to the
|
|
84
|
+
extent the Waiver is so judged Affirmer hereby grants to each affected
|
|
85
|
+
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
|
86
|
+
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
|
87
|
+
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
|
88
|
+
maximum duration provided by applicable law or treaty (including future
|
|
89
|
+
time extensions), (iii) in any current or future medium and for any number
|
|
90
|
+
of copies, and (iv) for any purpose whatsoever, including without
|
|
91
|
+
limitation commercial, advertising or promotional purposes (the
|
|
92
|
+
"License"). The License shall be deemed effective as of the date CC0 was
|
|
93
|
+
applied by Affirmer to the Work. Should any part of the License for any
|
|
94
|
+
reason be judged legally invalid or ineffective under applicable law, such
|
|
95
|
+
partial invalidity or ineffectiveness shall not invalidate the remainder
|
|
96
|
+
of the License, and in such case Affirmer hereby affirms that he or she
|
|
97
|
+
will not (i) exercise any of his or her remaining Copyright and Related
|
|
98
|
+
Rights in the Work or (ii) assert any associated claims and causes of
|
|
99
|
+
action with respect to the Work, in either case contrary to Affirmer's
|
|
100
|
+
express Statement of Purpose.
|
|
101
|
+
|
|
102
|
+
4. Limitations and Disclaimers.
|
|
103
|
+
|
|
104
|
+
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
|
105
|
+
surrendered, licensed or otherwise affected by this document.
|
|
106
|
+
b. Affirmer offers the Work as-is and makes no representations or
|
|
107
|
+
warranties of any kind concerning the Work, express, implied,
|
|
108
|
+
statutory or otherwise, including without limitation warranties of
|
|
109
|
+
title, merchantability, fitness for a particular purpose, non
|
|
110
|
+
infringement, or the absence of latent or other defects, accuracy, or
|
|
111
|
+
the present or absence of errors, whether or not discoverable, all to
|
|
112
|
+
the greatest extent permissible under applicable law.
|
|
113
|
+
c. Affirmer disclaims responsibility for clearing rights of other persons
|
|
114
|
+
that may apply to the Work or any use thereof, including without
|
|
115
|
+
limitation any person's Copyright and Related Rights in the Work.
|
|
116
|
+
Further, Affirmer disclaims responsibility for obtaining any necessary
|
|
117
|
+
consents, permissions or other rights required for any use of the
|
|
118
|
+
Work.
|
|
119
|
+
d. Affirmer understands and acknowledges that Creative Commons is not a
|
|
120
|
+
party to this document and has no duty or obligation with respect to
|
|
121
|
+
this CC0 or use of the Work.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fleetmesh-schema
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Fleetmesh published schema files: constants, kinds, messages, digest and JSON Schemas
|
|
5
|
+
License: CC0-1.0
|
|
6
|
+
Requires-Python: >=3.9
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Dynamic: license-file
|
|
10
|
+
|
|
11
|
+
# Fleetmesh Schemas
|
|
12
|
+
|
|
13
|
+
Canonical machine-readable schemas, manifests, kind definitions, and protocol digest for **Fleetmesh** ([fleetmesh.org](https://www.fleetmesh.org)).
|
|
14
|
+
|
|
15
|
+
## Contents
|
|
16
|
+
|
|
17
|
+
- `manifests/`: Declarative manifests (`apiVersion: fleetmesh.org/v1alpha1`) for `MeshNode`, `Peering`, `GrantPolicy`, `ComputeProvider`, `InferenceRouter`, and `WorkloadRouter`.
|
|
18
|
+
- `schema/`:
|
|
19
|
+
- `constants.json`: Cryptographic primitives, window constants, and rate ceilings.
|
|
20
|
+
- `kinds.json`: Canonical event kind registry definitions.
|
|
21
|
+
- `messages.json`: Wire message envelope definitions.
|
|
22
|
+
- `DIGEST`: SHA-256 over canonical representations of constants, kinds, and messages.
|
|
23
|
+
- `PROTOCOLS`: Supported protocol capability URIs (`https://fleetmesh.org/*`).
|
|
24
|
+
- `conformance.json`: The conformance op catalogue (ops by plane, error codes, verdicts, wire shapes) that `scripts/conform.py` in fleetmesh.org drives; generated, not in the digest.
|
|
25
|
+
- `schemas/`: Formal JSON Schema Draft 2020-12 specifications for every event kind, DIDComm message, decrypted payload, manifest, and DID document.
|
|
26
|
+
|
|
27
|
+
## Protocol Version
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
fleetmesh/0.1-draft
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The authoritative protocol digest is stored in `schema/DIGEST`.
|
|
34
|
+
|
|
35
|
+
## Validation
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
python3 scripts/check-manifests.py
|
|
39
|
+
python3 scripts/validate-schemas.py
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Licence
|
|
43
|
+
|
|
44
|
+
[CC0 1.0 Universal](LICENSE)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Fleetmesh Schemas
|
|
2
|
+
|
|
3
|
+
Canonical machine-readable schemas, manifests, kind definitions, and protocol digest for **Fleetmesh** ([fleetmesh.org](https://www.fleetmesh.org)).
|
|
4
|
+
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- `manifests/`: Declarative manifests (`apiVersion: fleetmesh.org/v1alpha1`) for `MeshNode`, `Peering`, `GrantPolicy`, `ComputeProvider`, `InferenceRouter`, and `WorkloadRouter`.
|
|
8
|
+
- `schema/`:
|
|
9
|
+
- `constants.json`: Cryptographic primitives, window constants, and rate ceilings.
|
|
10
|
+
- `kinds.json`: Canonical event kind registry definitions.
|
|
11
|
+
- `messages.json`: Wire message envelope definitions.
|
|
12
|
+
- `DIGEST`: SHA-256 over canonical representations of constants, kinds, and messages.
|
|
13
|
+
- `PROTOCOLS`: Supported protocol capability URIs (`https://fleetmesh.org/*`).
|
|
14
|
+
- `conformance.json`: The conformance op catalogue (ops by plane, error codes, verdicts, wire shapes) that `scripts/conform.py` in fleetmesh.org drives; generated, not in the digest.
|
|
15
|
+
- `schemas/`: Formal JSON Schema Draft 2020-12 specifications for every event kind, DIDComm message, decrypted payload, manifest, and DID document.
|
|
16
|
+
|
|
17
|
+
## Protocol Version
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
fleetmesh/0.1-draft
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The authoritative protocol digest is stored in `schema/DIGEST`.
|
|
24
|
+
|
|
25
|
+
## Validation
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
python3 scripts/check-manifests.py
|
|
29
|
+
python3 scripts/validate-schemas.py
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Licence
|
|
33
|
+
|
|
34
|
+
[CC0 1.0 Universal](LICENSE)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""fleetmesh_schema: the published schema files as an installable package.
|
|
2
|
+
|
|
3
|
+
The files are the ones at the root of the schema repo - `schema/` (the digest
|
|
4
|
+
set: constants, kinds, messages, DIGEST, PROTOCOLS, conformance) and
|
|
5
|
+
`schemas/` (the JSON Schema documents). This package carries them, nothing
|
|
6
|
+
more: a path for anything that opens files itself, and one cached loader for
|
|
7
|
+
the JSON. Standard library only, no I/O at import time.
|
|
8
|
+
|
|
9
|
+
In a checkout the two directories are reached through the symlinks beside
|
|
10
|
+
this file; installed, they are package data at the same relative place, so
|
|
11
|
+
`files()` is the same path arithmetic either way.
|
|
12
|
+
"""
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import functools
|
|
16
|
+
import json
|
|
17
|
+
import os
|
|
18
|
+
from typing import Any
|
|
19
|
+
|
|
20
|
+
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
21
|
+
SCHEMA_DIR = os.path.join(HERE, 'schema') # constants.json, kinds.json, messages.json, DIGEST ...
|
|
22
|
+
SCHEMAS_DIR = os.path.join(HERE, 'schemas') # JSON Schema documents by plane
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def path(name: str) -> str:
|
|
26
|
+
"""Absolute path of a file under schema/ (constants.json, kinds.json, DIGEST ...)."""
|
|
27
|
+
return os.path.join(SCHEMA_DIR, name)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def schema_path(*parts: str) -> str:
|
|
31
|
+
"""Absolute path of a JSON Schema document under schemas/ (plane, ..., file)."""
|
|
32
|
+
return os.path.join(SCHEMAS_DIR, *parts)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@functools.lru_cache(maxsize=None)
|
|
36
|
+
def load_json(name: str) -> Any:
|
|
37
|
+
"""Parse one file under schema/, once; every importer sees the same object.
|
|
38
|
+
The path is in any error so a broken install names itself."""
|
|
39
|
+
p = path(name)
|
|
40
|
+
try:
|
|
41
|
+
with open(p, encoding='utf-8') as fh:
|
|
42
|
+
return json.load(fh)
|
|
43
|
+
except (OSError, json.JSONDecodeError) as e:
|
|
44
|
+
raise RuntimeError('cannot read schema file %s: %s' % (p, e)) from e
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@functools.lru_cache(maxsize=None)
|
|
48
|
+
def text(name: str) -> str:
|
|
49
|
+
"""One file under schema/ as stripped text (DIGEST, PROTOCOLS)."""
|
|
50
|
+
try:
|
|
51
|
+
with open(path(name), encoding='utf-8') as fh:
|
|
52
|
+
return fh.read().strip()
|
|
53
|
+
except OSError as e:
|
|
54
|
+
raise RuntimeError('cannot read schema file %s: %s' % (path(name), e)) from e
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def digest() -> str:
|
|
58
|
+
"""The protocol version digest, schema/DIGEST."""
|
|
59
|
+
return text('DIGEST')
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
__all__ = ['SCHEMA_DIR', 'SCHEMAS_DIR', 'path', 'schema_path', 'load_json', 'text', 'digest']
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
695a868c3f2b343dba6f134cc23706bf8e48db392122cce63e06b69b3f92b7a7
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
https://fleetmesh.org/blob/1.0 1cd7a7af0622a9235e0f4b667d3459234b3144bcdc21ae4606f5eaf325a30d5e
|
|
2
|
+
https://fleetmesh.org/budget/1.0 57927f029cc188df8be0fc1a8c66d22471329f3e8c2a786bcb6c3233cd405a7c
|
|
3
|
+
https://fleetmesh.org/complaint/1.0 041772e8861db065ac10badb8ca69b95bc05f37dd2e0a9fae0fe4b5be59b3717
|
|
4
|
+
https://fleetmesh.org/compute/1.0 4d8ccdc8618ab421f775985a705b044b3e0cf11c1b8bdb1468bb71151276b0c4
|
|
5
|
+
https://fleetmesh.org/compute/1.1 e87aaea83565f4cad55e4d02cd4719439691c1085fab68e4d2cac67ea7db1d75
|
|
6
|
+
https://fleetmesh.org/gossip/1.0 83171e6abf4ecd300de7de9a08c1f39242de1950d1ec0481e5f3b2fd975fc872
|
|
7
|
+
https://fleetmesh.org/peering/1.0 70aeab210ab49ba4085e779aba3d97db15cf16bff5969295ca7261a82c0cab12
|
|
8
|
+
https://fleetmesh.org/standing/1.0 23f50257e1143ebfb207431b0899895d208dbc0c320fa1c071c1f6684ccbfa85
|
|
9
|
+
https://fleetmesh.org/sync/1.0 335a86ca87886806c8018551f6f6f4efd9ec35002c549a5922fdc890de56824b
|
|
10
|
+
https://fleetmesh.org/video-transit/1.0 4dbaa35541d77a8fd5f919f2c4c0f8f3de8c6f0d8b8229aec7caba1a64e1d3cd
|