@mhome/artifact-protocol 0.3.0 → 1.1.1

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 CHANGED
@@ -3,7 +3,7 @@
3
3
  Storage-independent artifact references shared by mHome runtimes.
4
4
 
5
5
  The crate is the source of truth for the `meow-artifact://v1/` URI format and its
6
- immutable image, audio, and file metadata. The published schema and conformance
6
+ immutable image, audio, video, and file metadata. The published schema and conformance
7
7
  fixtures are intended for non-Rust runtimes.
8
8
 
9
9
  The crate also defines the transport-neutral `/artifact/resolve` request and response.
@@ -0,0 +1,28 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "valid": [
4
+ {
5
+ "name": "audio-request",
6
+ "value": { "kind": "AUDIO", "mimeType": "audio/ogg", "dataBase64": "eA==", "durationMillis": 1200 }
7
+ },
8
+ {
9
+ "name": "video-request",
10
+ "value": { "kind": "VIDEO", "mimeType": "video/mp4", "dataBase64": "eA==", "durationMillis": 2000 }
11
+ },
12
+ {
13
+ "name": "file-response",
14
+ "value": {
15
+ "uri": "meow-artifact://v1/tenant/scope/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/eyJrIjoiZiIsIm0iOiJhcHBsaWNhdGlvbi9wZGYiLCJzIjozMH0",
16
+ "kind": "FILE",
17
+ "mimeType": "application/pdf",
18
+ "sizeBytes": 30
19
+ }
20
+ }
21
+ ],
22
+ "invalid": [
23
+ {
24
+ "name": "unknown-field",
25
+ "value": { "kind": "FILE", "mimeType": "text/plain", "dataBase64": "eA==", "path": "/tmp/x" }
26
+ }
27
+ ]
28
+ }
@@ -18,6 +18,16 @@
18
18
  "sizeBytes": 20,
19
19
  "durationMillis": 1500
20
20
  },
21
+ {
22
+ "name": "video",
23
+ "uri": "meow-artifact://v1/tenant/scope/dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd/eyJrIjoidiIsIm0iOiJ2aWRlby9tcDQiLCJzIjo0MCwidyI6MTkyMCwiaCI6MTA4MCwiZCI6MjAwMH0",
24
+ "kind": "video",
25
+ "mimeType": "video/mp4",
26
+ "sizeBytes": 40,
27
+ "width": 1920,
28
+ "height": 1080,
29
+ "durationMillis": 2000
30
+ },
21
31
  {
22
32
  "name": "file",
23
33
  "uri": "meow-artifact://v1/tenant/scope/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/eyJrIjoiZiIsIm0iOiJhcHBsaWNhdGlvbi9wZGYiLCJzIjozMH0",
@@ -27,10 +37,6 @@
27
37
  }
28
38
  ],
29
39
  "invalid": [
30
- {
31
- "name": "video-kind",
32
- "uri": "meow-artifact://v1/tenant/scope/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoidiIsIm0iOiJ2aWRlby9tcDQiLCJzIjoxMH0"
33
- },
34
40
  {
35
41
  "name": "file-with-video-mime",
36
42
  "uri": "meow-artifact://v1/tenant/scope/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiZiIsIm0iOiJ2aWRlby9tcDQiLCJzIjoxMH0"
@@ -1,11 +1,16 @@
1
1
  {
2
2
  "manifest": "mhome.artifact.v1",
3
- "contractVersion": "0.3.0",
3
+ "contractVersion": "1.1.1",
4
4
  "uriPrefix": "meow-artifact://v1/",
5
- "kinds": ["image", "audio", "file"],
5
+ "kinds": ["image", "audio", "video", "file"],
6
6
  "resolve": {
7
7
  "target": "/artifact/resolve",
8
8
  "schema": "schema/artifact-resolve.v1.schema.json",
9
9
  "schemaVersion": 1
10
+ },
11
+ "put": {
12
+ "target": "/artifact/put",
13
+ "schema": "schema/artifact-put.v1.schema.json",
14
+ "schemaVersion": 1
10
15
  }
11
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhome/artifact-protocol",
3
- "version": "0.3.0",
3
+ "version": "1.1.1",
4
4
  "description": "Build-time protocol artifacts for mhome.artifact",
5
5
  "license": "MIT",
6
6
  "repository": {
package/protocol.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "protocol": "mhome.artifact",
3
- "contractVersion": "0.3.0",
3
+ "contractVersion": "1.1.1",
4
4
  "manifest": "manifest/artifact.v1.json",
5
5
  "schemas": {
6
6
  "artifactMetadata": "schema/artifact-metadata.v1.schema.json",
7
- "artifactResolve": "schema/artifact-resolve.v1.schema.json"
7
+ "artifactResolve": "schema/artifact-resolve.v1.schema.json",
8
+ "artifactPut": "schema/artifact-put.v1.schema.json"
8
9
  },
9
10
  "fixtures": {
10
11
  "artifactReference": "fixtures/artifact-reference.conformance.json",
11
- "artifactResolve": "fixtures/artifact-resolve.conformance.json"
12
+ "artifactResolve": "fixtures/artifact-resolve.conformance.json",
13
+ "artifactPut": "fixtures/artifact-put.conformance.json"
12
14
  }
13
15
  }
@@ -15,6 +15,19 @@
15
15
  "h": { "type": "integer", "minimum": 1, "maximum": 2147483647 }
16
16
  }
17
17
  },
18
+ {
19
+ "type": "object",
20
+ "additionalProperties": false,
21
+ "required": ["k", "m", "s", "w", "h"],
22
+ "properties": {
23
+ "k": { "const": "v" },
24
+ "m": { "type": "string", "pattern": "^video/[a-z0-9!#$&^_.+-]+$", "maxLength": 255 },
25
+ "s": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
26
+ "w": { "type": "integer", "minimum": 1, "maximum": 2147483647 },
27
+ "h": { "type": "integer", "minimum": 1, "maximum": 2147483647 },
28
+ "d": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }
29
+ }
30
+ },
18
31
  {
19
32
  "type": "object",
20
33
  "additionalProperties": false,
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mhome.ai/schema/artifact-put.v1.schema.json",
4
+ "title": "mHome Artifact Put v1",
5
+ "oneOf": [
6
+ { "$ref": "#/$defs/request" },
7
+ { "$ref": "#/$defs/response" }
8
+ ],
9
+ "$defs": {
10
+ "metadata": {
11
+ "type": "object",
12
+ "additionalProperties": false,
13
+ "required": ["uri", "kind", "mimeType", "sizeBytes"],
14
+ "properties": {
15
+ "uri": { "type": "string", "pattern": "^meow-artifact://v1/", "maxLength": 2048 },
16
+ "kind": { "enum": ["IMAGE", "AUDIO", "VIDEO", "FILE"] },
17
+ "mimeType": { "type": "string", "minLength": 3, "maxLength": 255 },
18
+ "sizeBytes": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
19
+ "width": { "type": "integer", "minimum": 1, "maximum": 2147483647 },
20
+ "height": { "type": "integer", "minimum": 1, "maximum": 2147483647 },
21
+ "durationMillis": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }
22
+ }
23
+ },
24
+ "request": {
25
+ "type": "object",
26
+ "additionalProperties": false,
27
+ "required": ["kind", "mimeType", "dataBase64"],
28
+ "properties": {
29
+ "kind": { "enum": ["IMAGE", "AUDIO", "VIDEO", "FILE"] },
30
+ "mimeType": { "type": "string", "minLength": 3, "maxLength": 255 },
31
+ "dataBase64": { "type": "string", "minLength": 4, "maxLength": 70000000, "pattern": "^[A-Za-z0-9+/]+={0,2}$" },
32
+ "durationMillis": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }
33
+ }
34
+ },
35
+ "response": { "$ref": "#/$defs/metadata" }
36
+ }
37
+ }
@@ -21,7 +21,7 @@
21
21
  "required": ["uri", "kind", "mimeType", "sizeBytes", "delivery"],
22
22
  "properties": {
23
23
  "uri": { "type": "string", "pattern": "^meow-artifact://v1/", "maxLength": 2048 },
24
- "kind": { "enum": ["IMAGE", "AUDIO", "FILE"] },
24
+ "kind": { "enum": ["IMAGE", "AUDIO", "VIDEO", "FILE"] },
25
25
  "mimeType": { "type": "string", "minLength": 3, "maxLength": 255 },
26
26
  "sizeBytes": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
27
27
  "width": { "type": "integer", "minimum": 1, "maximum": 2147483647 },