@mhome/artifact-protocol 1.8.0 → 1.10.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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Storage-independent artifact references shared by mHome runtimes.
4
4
 
5
- The crate is the source of truth for the `meow-artifact://v1/` URI format and its
5
+ The crate is the source of truth for the `meow-artifact://v2/` URI format and its
6
6
  immutable image, audio, video, and file metadata. The published schema and conformance
7
7
  fixtures are intended for non-Rust runtimes.
8
8
 
@@ -13,54 +13,54 @@ embedding them in a control-plane message.
13
13
  Delivery is an explicit `DATA_URL` or `SIGNED_URL` union; a signed URL may point to a
14
14
  cloud object store or an authenticated local streaming endpoint.
15
15
 
16
- TTL, storage placement, filesystem paths, signed URLs, and cloud object keys are
17
- runtime concerns and are deliberately not encoded into an artifact reference.
16
+ Retention mode and resource identity are encoded in the reference. Exact TTL deadlines,
17
+ filesystem paths, signed URLs, and cloud object keys remain runtime concerns.
18
18
 
19
- Capability media values (`Image`, `Audio`) use `MediaReference`: exactly `{ "uri": "meow-artifact://v1/..." }`. The reference has no URL, inline bytes, MIME or creation timestamp fields. Parse and check kind and tenant/scope at capability boundaries; do not implicitly import media. Upload bytes with `PutArtifactRequest` or explicitly download finite HTTP(S) content with `ImportArtifactRequest` via `/app/artifact/put` and `/app/artifact/import`. Storage metadata and upload transports retain their MIME and byte fields. Resolve to temporary delivery URLs only at consumers. Conversation media sources retain their existing tagged artifact protocol. Video storage remains unsupported by the runtimes.
19
+ Capability media values (`Image`, `Audio`) use `MediaReference`: exactly `{ "uri": "meow-artifact://v2/..." }`. The reference has no URL, inline bytes, MIME or creation timestamp fields. Parse and check kind and tenant/scope at capability boundaries; do not implicitly import media. Upload bytes with `PutArtifactRequest` or explicitly download finite HTTP(S) content with `ImportArtifactRequest` via `/app/artifact/put` and `/app/artifact/import`. Storage metadata and upload transports retain their MIME and byte fields. Resolve to temporary delivery URLs only at consumers. Conversation media sources retain their existing tagged artifact protocol. Video storage remains unsupported by the runtimes.
20
20
 
21
21
  Upload/import preserves bytes. Callers perform conversion before upload. Public ingress is limited to 1 MiB; internal producers retain their own limits. The shared reference and storage contracts do not impose the public ingress limit.
22
22
 
23
- ### Temporary artifacts (MeowCore)
23
+ ### Lifecycle and resource identity
24
24
 
25
- `put`, explicit HTTP `import`, and `upload/prepare` accept `temporary: true`.
26
- Omitting the flag preserves durable storage. The flag is a storage request, not
27
- part of the content-addressed URI: putting the same bytes in the same tenant and
28
- scope reuses that content. Existing durable content is never downgraded. Put and
29
- resolve responses report `temporary: true` and `expiresAtUnixMs` for temporary
30
- content; durable responses omit both fields.
25
+ `put`, explicit HTTP `import`, and `upload/prepare` accept `lifecycle`: `std`, `tmp`,
26
+ or `man`. Omission means `std`. Put/resolve responses report the selected lifecycle.
27
+ The former `temporary` request/response field is no longer accepted.
31
28
 
32
- MeowCore retains temporary objects for ten minutes from commit or repeated put /
33
- import revalidation. Ordinary reads do not renew expiration. Small objects (up to
34
- 1 MiB) use memory, subject to 64 MiB per runtime and 16 MiB per scope. New objects
35
- over these limits use temporary disk, capped at 512 MiB per runtime and 128 MiB
36
- per scope. Object limits are 4096 per runtime / 1024 per scope. Open snapshots
37
- continue to count against capacity after deletion or expiry. Exhausted capacity
38
- returns an availability error; unrelated live objects are not silently deleted.
39
- Ingress is bounded separately. These are implementation defaults, not URI fields.
29
+ The canonical URI is
30
+ `meow-artifact://v2/<tenant>/<scope>/<lifecycle>/<resourceId>/<sha256>/<metadata>`.
31
+ SHA-256 always hashes the original bytes. Standard and temporary resources use their
32
+ digest as resource ID in independent namespaces; the same bytes never share an object
33
+ across policies. Metadata remains canonical base64url JSON. Version 1 references are
34
+ not accepted; this is a coordinated protocol cutover, without automatic migration.
40
35
 
41
- `/artifact/persist` takes `{ "uri": "meow-artifact://…" }` and returns a put
42
- response after durable storage succeeds. Promotion is idempotent, preserves the
43
- URI, and leaves the temporary object readable if writing fails. MeowCore's
44
- existing thirty-day durable retention policy still applies. Expired or missing
45
- objects cannot be promoted. Persist before saving a reference in long-lived
46
- history or scheduling work beyond its expiration.
36
+ - `std`: durable content retained until explicit deletion or a Space/store purge.
37
+ Reads, metadata queries and repeated ingestion do not maintain an expiry timestamp.
38
+ - `tmp`: memory only, with one-hour idle retention, lost on process restart. Content
39
+ reads and repeated ingestion renew it; metadata and resolve do not. Reads reject
40
+ expired objects immediately. There is no disk spill, total capacity or object-count
41
+ quota; existing per-upload limits still apply.
42
+ - `man`: caller-managed durable content. Automatic retention never deletes it.
43
+ Each independent creation receives a fresh 128-bit creation ID. Callers can reserve
44
+ it before uploading by supplying `creationId` (32 lowercase hex characters), then
45
+ reuse it for retries. A supplied ID is accepted only for `man`; it cannot overwrite
46
+ existing different bytes. Deletion and explicit Space/store purge still apply.
47
+ Callers must durably record ownership and retry replacement/deletion after failures.
47
48
 
48
- `/artifact/delete` takes the same request and returns `{}`. Deleting missing
49
- content succeeds. Deletion affects all metadata aliases of that content in the
50
- same scope; an opened snapshot may finish, while subsequent opens fail. Do not
51
- delete after each LLM call when another caller may reuse the URI. There is no
52
- separate eviction API. A signed URL is not a revocable object identity: recreating
53
- the identical content may make an unexpired old URL usable again.
49
+ `/artifact/delete` takes `{ "uri": "meow-artifact://…" }` and returns `{}`. Missing content succeeds.
50
+ It deletes only the selected resource in its tenant, Space and lifecycle namespace;
51
+ metadata aliases of that resource share deletion. Independently created manual resources
52
+ do not share deletion. An already opened snapshot may finish after deletion or expiry.
53
+ Standard/temporary digest identities can be recreated: do not treat an unexpired signed
54
+ URL as a permanently revoked object ID.
54
55
 
55
- App Facade equivalents are `/app/artifact/persist` and `/app/artifact/delete`;
56
- Wasm hosts expose `artifact_persist_async` and `artifact_delete_async`. LLM inputs
57
- continue to use canonical Artifact references. Small temporary HTTP uploads and
58
- native read descriptors carry bounded inline bytes without a staging file;
59
- larger objects retain file-based streaming. Temporary delivery uses `no-store`,
60
- and host resolve grants never outlive the reported object expiration.
56
+ The App Facade exposes `/app/artifact/delete`; Wasm hosts expose
57
+ `artifact_delete_async`. LLM inputs continue to use
58
+ canonical references. Temporary HTTP uploads and native reads transfer bytes from memory;
59
+ large native transfers use bounded attachments on the existing IPC connection. Temporary
60
+ delivery uses `no-store`; resolve grants never outlive the reported object expiration.
61
+ Only `tmp` responses contain `expiresAtUnixMs`. Native transport descriptors retain their
62
+ `temporary` boolean to distinguish memory from disk; it is not an ingress lifecycle policy.
61
63
 
62
- Temporary state is process-owned and is lost on restart, including spilled
63
- objects. The runtime removes abandoned spill directories on startup and expired
64
- entries during maintenance. This contract adds no database or migration. A
65
- cloud-owned artifact store needs its own implementation; a multi-instance cloud
66
- service must not emulate this with an uncoordinated in-process map.
64
+ Forwarding services must preserve the owner's policy and URI. Each storage implementation
65
+ must adopt the lifecycle contract before consuming this protocol release; a shared cloud
66
+ service must not emulate temporary storage with an uncoordinated process-local map.
@@ -12,7 +12,7 @@
12
12
  {
13
13
  "name": "file-response",
14
14
  "value": {
15
- "uri": "meow-artifact://v1/tenant/scope/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/eyJrIjoiZiIsIm0iOiJhcHBsaWNhdGlvbi9wZGYiLCJzIjozMH0",
15
+ "uri": "meow-artifact://v2/tenant/scope/std/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/eyJrIjoiZiIsIm0iOiJhcHBsaWNhdGlvbi9wZGYiLCJzIjozMH0",
16
16
  "kind": "FILE",
17
17
  "mimeType": "application/pdf",
18
18
  "sizeBytes": 30
@@ -3,7 +3,7 @@
3
3
  "valid": [
4
4
  {
5
5
  "name": "image",
6
- "uri": "meow-artifact://v1/tenant/scope/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiaSIsIm0iOiJpbWFnZS9wbmciLCJzIjoxMiwidyI6MiwiaCI6M30",
6
+ "uri": "meow-artifact://v2/tenant/scope/std/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiaSIsIm0iOiJpbWFnZS9wbmciLCJzIjoxMiwidyI6MiwiaCI6M30",
7
7
  "kind": "image",
8
8
  "mimeType": "image/png",
9
9
  "sizeBytes": 12,
@@ -12,7 +12,7 @@
12
12
  },
13
13
  {
14
14
  "name": "audio",
15
- "uri": "meow-artifact://v1/tenant/scope/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/eyJrIjoiYSIsIm0iOiJhdWRpby9vZ2ciLCJzIjoyMCwiZCI6MTUwMH0",
15
+ "uri": "meow-artifact://v2/tenant/scope/std/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/eyJrIjoiYSIsIm0iOiJhdWRpby9vZ2ciLCJzIjoyMCwiZCI6MTUwMH0",
16
16
  "kind": "audio",
17
17
  "mimeType": "audio/ogg",
18
18
  "sizeBytes": 20,
@@ -20,7 +20,7 @@
20
20
  },
21
21
  {
22
22
  "name": "video",
23
- "uri": "meow-artifact://v1/tenant/scope/dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd/eyJrIjoidiIsIm0iOiJ2aWRlby9tcDQiLCJzIjo0MCwidyI6MTkyMCwiaCI6MTA4MCwiZCI6MjAwMH0",
23
+ "uri": "meow-artifact://v2/tenant/scope/std/dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd/dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd/eyJrIjoidiIsIm0iOiJ2aWRlby9tcDQiLCJzIjo0MCwidyI6MTkyMCwiaCI6MTA4MCwiZCI6MjAwMH0",
24
24
  "kind": "video",
25
25
  "mimeType": "video/mp4",
26
26
  "sizeBytes": 40,
@@ -30,48 +30,78 @@
30
30
  },
31
31
  {
32
32
  "name": "file",
33
- "uri": "meow-artifact://v1/tenant/scope/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/eyJrIjoiZiIsIm0iOiJhcHBsaWNhdGlvbi9wZGYiLCJzIjozMH0",
33
+ "uri": "meow-artifact://v2/tenant/scope/std/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/eyJrIjoiZiIsIm0iOiJhcHBsaWNhdGlvbi9wZGYiLCJzIjozMH0",
34
34
  "kind": "file",
35
35
  "mimeType": "application/pdf",
36
36
  "sizeBytes": 30
37
+ },
38
+ {
39
+ "name": "tmp identity",
40
+ "uri": "meow-artifact://v2/tenant/scope/tmp/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiaSIsIm0iOiJpbWFnZS9wbmciLCJzIjoxMiwidyI6MiwiaCI6M30",
41
+ "kind": "image",
42
+ "mimeType": "image/png",
43
+ "sizeBytes": 12,
44
+ "width": 2,
45
+ "height": 3
46
+ },
47
+ {
48
+ "name": "man identity",
49
+ "uri": "meow-artifact://v2/tenant/scope/man/1234567890abcdef1234567890abcdef/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiaSIsIm0iOiJpbWFnZS9wbmciLCJzIjoxMiwidyI6MiwiaCI6M30",
50
+ "kind": "image",
51
+ "mimeType": "image/png",
52
+ "sizeBytes": 12,
53
+ "width": 2,
54
+ "height": 3
37
55
  }
38
56
  ],
39
57
  "invalid": [
40
58
  {
41
59
  "name": "file-with-video-mime",
42
- "uri": "meow-artifact://v1/tenant/scope/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiZiIsIm0iOiJ2aWRlby9tcDQiLCJzIjoxMH0"
60
+ "uri": "meow-artifact://v2/tenant/scope/std/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiZiIsIm0iOiJ2aWRlby9tcDQiLCJzIjoxMH0"
43
61
  },
44
62
  {
45
63
  "name": "image-with-duration",
46
- "uri": "meow-artifact://v1/tenant/scope/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiaSIsIm0iOiJpbWFnZS9wbmciLCJzIjoxMCwidyI6MSwiaCI6MSwiZCI6MX0"
64
+ "uri": "meow-artifact://v2/tenant/scope/std/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiaSIsIm0iOiJpbWFnZS9wbmciLCJzIjoxMCwidyI6MSwiaCI6MSwiZCI6MX0"
47
65
  },
48
66
  {
49
67
  "name": "uppercase-digest",
50
- "uri": "meow-artifact://v1/tenant/scope/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/eyJrIjoiZiIsIm0iOiJ0ZXh0L3BsYWluIiwicyI6MX0"
68
+ "uri": "meow-artifact://v2/tenant/scope/std/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/eyJrIjoiZiIsIm0iOiJ0ZXh0L3BsYWluIiwicyI6MX0"
51
69
  },
52
70
  {
53
71
  "name": "javascript-unsafe-size",
54
- "uri": "meow-artifact://v1/tenant/scope/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiZiIsIm0iOiJ0ZXh0L3BsYWluIiwicyI6OTAwNzE5OTI1NDc0MDk5Mn0"
72
+ "uri": "meow-artifact://v2/tenant/scope/std/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiZiIsIm0iOiJ0ZXh0L3BsYWluIiwicyI6OTAwNzE5OTI1NDc0MDk5Mn0"
55
73
  },
56
74
  {
57
75
  "name": "oversized-image-dimension",
58
- "uri": "meow-artifact://v1/tenant/scope/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiaSIsIm0iOiJpbWFnZS9wbmciLCJzIjoxMCwidyI6MjE0NzQ4MzY0OCwiaCI6MX0"
76
+ "uri": "meow-artifact://v2/tenant/scope/std/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiaSIsIm0iOiJpbWFnZS9wbmciLCJzIjoxMCwidyI6MjE0NzQ4MzY0OCwiaCI6MX0"
59
77
  },
60
78
  {
61
79
  "name": "padded-base64url",
62
- "uri": "meow-artifact://v1/tenant/scope/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiZiIsIm0iOiJ0ZXh0L3BsYWluIiwicyI6MX0="
80
+ "uri": "meow-artifact://v2/tenant/scope/std/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiZiIsIm0iOiJ0ZXh0L3BsYWluIiwicyI6MX0="
63
81
  },
64
82
  {
65
83
  "name": "leading-whitespace",
66
- "uri": " meow-artifact://v1/tenant/scope/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiZiIsIm0iOiJ0ZXh0L3BsYWluIiwicyI6MX0"
84
+ "uri": " meow-artifact://v2/tenant/scope/std/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiZiIsIm0iOiJ0ZXh0L3BsYWluIiwicyI6MX0"
67
85
  },
68
86
  {
69
87
  "name": "reordered-metadata",
70
- "uri": "meow-artifact://v1/tenant/scope/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJtIjoidGV4dC9wbGFpbiIsImsiOiJmIiwicyI6MX0"
88
+ "uri": "meow-artifact://v2/tenant/scope/std/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJtIjoidGV4dC9wbGFpbiIsImsiOiJmIiwicyI6MX0"
71
89
  },
72
90
  {
73
91
  "name": "duplicate-metadata-field",
74
- "uri": "meow-artifact://v1/tenant/scope/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiZiIsIm0iOiJ0ZXh0L3BsYWluIiwicyI6MSwicyI6MX0"
92
+ "uri": "meow-artifact://v2/tenant/scope/std/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiZiIsIm0iOiJ0ZXh0L3BsYWluIiwicyI6MSwicyI6MX0"
93
+ },
94
+ {
95
+ "name": "unknown lifecycle",
96
+ "uri": "meow-artifact://v2/tenant/scope/unknown/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiaSIsIm0iOiJpbWFnZS9wbmciLCJzIjoxMiwidyI6MiwiaCI6M30"
97
+ },
98
+ {
99
+ "name": "manual requires creation identity",
100
+ "uri": "meow-artifact://v2/tenant/scope/man/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiaSIsIm0iOiJpbWFnZS9wbmciLCJzIjoxMiwidyI6MiwiaCI6M30"
101
+ },
102
+ {
103
+ "name": "standard cannot carry manual identity",
104
+ "uri": "meow-artifact://v2/tenant/scope/std/1234567890abcdef1234567890abcdef/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiaSIsIm0iOiJpbWFnZS9wbmciLCJzIjoxMiwidyI6MiwiaCI6M30"
75
105
  }
76
106
  ]
77
107
  }
@@ -4,13 +4,13 @@
4
4
  {
5
5
  "name": "request",
6
6
  "value": {
7
- "uri": "meow-artifact://v1/tenant/scope/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiaSIsIm0iOiJpbWFnZS9wbmciLCJzIjoxMiwidyI6MiwiaCI6M30"
7
+ "uri": "meow-artifact://v2/tenant/scope/std/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiaSIsIm0iOiJpbWFnZS9wbmciLCJzIjoxMiwidyI6MiwiaCI6M30"
8
8
  }
9
9
  },
10
10
  {
11
11
  "name": "data-url-response",
12
12
  "value": {
13
- "uri": "meow-artifact://v1/tenant/scope/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/eyJrIjoiZiIsIm0iOiJhcHBsaWNhdGlvbi9wZGYiLCJzIjozMH0",
13
+ "uri": "meow-artifact://v2/tenant/scope/std/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/eyJrIjoiZiIsIm0iOiJhcHBsaWNhdGlvbi9wZGYiLCJzIjozMH0",
14
14
  "kind": "FILE",
15
15
  "mimeType": "application/pdf",
16
16
  "sizeBytes": 30,
@@ -23,7 +23,7 @@
23
23
  {
24
24
  "name": "signed-url-response",
25
25
  "value": {
26
- "uri": "meow-artifact://v1/tenant/scope/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/eyJrIjoiYSIsIm0iOiJhdWRpby9vZ2ciLCJzIjoyMCwiZCI6MTUwMH0",
26
+ "uri": "meow-artifact://v2/tenant/scope/std/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/eyJrIjoiYSIsIm0iOiJhdWRpby9vZ2ciLCJzIjoyMCwiZCI6MTUwMH0",
27
27
  "kind": "AUDIO",
28
28
  "mimeType": "audio/ogg",
29
29
  "sizeBytes": 20,
@@ -40,14 +40,14 @@
40
40
  {
41
41
  "name": "unknown-request-field",
42
42
  "value": {
43
- "uri": "meow-artifact://v1/tenant/scope/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiaSIsIm0iOiJpbWFnZS9wbmciLCJzIjoxMiwidyI6MiwiaCI6M30",
43
+ "uri": "meow-artifact://v2/tenant/scope/std/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/eyJrIjoiaSIsIm0iOiJpbWFnZS9wbmciLCJzIjoxMiwidyI6MiwiaCI6M30",
44
44
  "scopeId": "scope"
45
45
  }
46
46
  },
47
47
  {
48
48
  "name": "ambiguous-delivery",
49
49
  "value": {
50
- "uri": "meow-artifact://v1/tenant/scope/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/eyJrIjoiZiIsIm0iOiJhcHBsaWNhdGlvbi9wZGYiLCJzIjozMH0",
50
+ "uri": "meow-artifact://v2/tenant/scope/std/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/eyJrIjoiZiIsIm0iOiJhcHBsaWNhdGlvbi9wZGYiLCJzIjozMH0",
51
51
  "kind": "FILE",
52
52
  "mimeType": "application/pdf",
53
53
  "sizeBytes": 30,
@@ -61,7 +61,7 @@
61
61
  {
62
62
  "name": "signed-url-without-expiry",
63
63
  "value": {
64
- "uri": "meow-artifact://v1/tenant/scope/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/eyJrIjoiZiIsIm0iOiJhcHBsaWNhdGlvbi9wZGYiLCJzIjozMH0",
64
+ "uri": "meow-artifact://v2/tenant/scope/std/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc/eyJrIjoiZiIsIm0iOiJhcHBsaWNhdGlvbi9wZGYiLCJzIjozMH0",
65
65
  "kind": "FILE",
66
66
  "mimeType": "application/pdf",
67
67
  "sizeBytes": 30,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest": "mhome.artifact.v1",
3
- "contractVersion": "1.8.0",
4
- "uriPrefix": "meow-artifact://v1/",
3
+ "contractVersion": "1.10.0",
4
+ "uriPrefix": "meow-artifact://v2/",
5
5
  "kinds": [
6
6
  "image",
7
7
  "audio",
@@ -31,12 +31,6 @@
31
31
  "schema": "schema/artifact-import.v1.schema.json",
32
32
  "schemaVersion": 1
33
33
  },
34
- "persist": {
35
- "target": "/artifact/persist",
36
- "requestSchema": "schema/artifact-resolve.v1.schema.json#/$defs/request",
37
- "responseSchema": "schema/artifact-put.v1.schema.json#/$defs/response",
38
- "schemaVersion": 1
39
- },
40
34
  "delete": {
41
35
  "target": "/artifact/delete",
42
36
  "requestSchema": "schema/artifact-resolve.v1.schema.json#/$defs/request",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhome/artifact-protocol",
3
- "version": "1.8.0",
3
+ "version": "1.10.0",
4
4
  "description": "Build-time protocol artifacts for mhome.artifact",
5
5
  "license": "MIT",
6
6
  "repository": {
package/protocol.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "protocol": "mhome.artifact",
3
- "contractVersion": "1.8.0",
3
+ "contractVersion": "1.10.0",
4
4
  "manifest": "manifest/artifact.v1.json",
5
5
  "schemas": {
6
6
  "artifactMetadata": "schema/artifact-metadata.v1.schema.json",
@@ -26,9 +26,39 @@
26
26
  "minLength": 3,
27
27
  "maxLength": 255
28
28
  },
29
- "temporary": {
30
- "type": "boolean",
31
- "default": false
29
+ "lifecycle": {
30
+ "enum": [
31
+ "std",
32
+ "tmp",
33
+ "man"
34
+ ],
35
+ "default": "std"
36
+ },
37
+ "creationId": {
38
+ "type": "string",
39
+ "pattern": "^[a-f0-9]{32}$"
40
+ }
41
+ },
42
+ "allOf": [
43
+ {
44
+ "if": {
45
+ "properties": {
46
+ "creationId": {}
47
+ },
48
+ "required": [
49
+ "creationId"
50
+ ]
51
+ },
52
+ "then": {
53
+ "properties": {
54
+ "lifecycle": {
55
+ "const": "man"
56
+ }
57
+ },
58
+ "required": [
59
+ "lifecycle"
60
+ ]
61
+ }
32
62
  }
33
- }
63
+ ]
34
64
  }
@@ -23,7 +23,7 @@
23
23
  "properties": {
24
24
  "uri": {
25
25
  "type": "string",
26
- "pattern": "^meow-artifact://v1/",
26
+ "pattern": "^meow-artifact://v2/",
27
27
  "maxLength": 2048
28
28
  },
29
29
  "kind": {
@@ -59,9 +59,13 @@
59
59
  "minimum": 1,
60
60
  "maximum": 9007199254740991
61
61
  },
62
- "temporary": {
63
- "type": "boolean",
64
- "default": false
62
+ "lifecycle": {
63
+ "enum": [
64
+ "std",
65
+ "tmp",
66
+ "man"
67
+ ],
68
+ "default": "std"
65
69
  },
66
70
  "expiresAtUnixMs": {
67
71
  "type": "integer",
@@ -72,21 +76,27 @@
72
76
  {
73
77
  "if": {
74
78
  "properties": {
75
- "temporary": {
76
- "const": true
79
+ "lifecycle": {
80
+ "const": "tmp"
77
81
  }
78
82
  },
79
83
  "required": [
80
- "temporary"
84
+ "lifecycle"
81
85
  ]
82
86
  },
83
87
  "then": {
88
+ "properties": {
89
+ "expiresAtUnixMs": {}
90
+ },
84
91
  "required": [
85
92
  "expiresAtUnixMs"
86
93
  ]
87
94
  },
88
95
  "else": {
89
96
  "not": {
97
+ "properties": {
98
+ "expiresAtUnixMs": {}
99
+ },
90
100
  "required": [
91
101
  "expiresAtUnixMs"
92
102
  ]
@@ -128,11 +138,41 @@
128
138
  "minimum": 1,
129
139
  "maximum": 9007199254740991
130
140
  },
131
- "temporary": {
132
- "type": "boolean",
133
- "default": false
141
+ "lifecycle": {
142
+ "enum": [
143
+ "std",
144
+ "tmp",
145
+ "man"
146
+ ],
147
+ "default": "std"
148
+ },
149
+ "creationId": {
150
+ "type": "string",
151
+ "pattern": "^[a-f0-9]{32}$"
152
+ }
153
+ },
154
+ "allOf": [
155
+ {
156
+ "if": {
157
+ "properties": {
158
+ "creationId": {}
159
+ },
160
+ "required": [
161
+ "creationId"
162
+ ]
163
+ },
164
+ "then": {
165
+ "properties": {
166
+ "lifecycle": {
167
+ "const": "man"
168
+ }
169
+ },
170
+ "required": [
171
+ "lifecycle"
172
+ ]
173
+ }
134
174
  }
135
- }
175
+ ]
136
176
  },
137
177
  "response": {
138
178
  "$ref": "#/$defs/metadata"
@@ -20,7 +20,7 @@
20
20
  "properties": {
21
21
  "uri": {
22
22
  "type": "string",
23
- "pattern": "^meow-artifact://v1/",
23
+ "pattern": "^meow-artifact://v2/",
24
24
  "maxLength": 2048
25
25
  }
26
26
  }
@@ -38,7 +38,7 @@
38
38
  "properties": {
39
39
  "uri": {
40
40
  "type": "string",
41
- "pattern": "^meow-artifact://v1/",
41
+ "pattern": "^meow-artifact://v2/",
42
42
  "maxLength": 2048
43
43
  },
44
44
  "kind": {
@@ -150,9 +150,13 @@
150
150
  }
151
151
  }
152
152
  },
153
- "temporary": {
154
- "type": "boolean",
155
- "default": false
153
+ "lifecycle": {
154
+ "enum": [
155
+ "std",
156
+ "tmp",
157
+ "man"
158
+ ],
159
+ "default": "std"
156
160
  },
157
161
  "expiresAtUnixMs": {
158
162
  "type": "integer",
@@ -163,21 +167,27 @@
163
167
  {
164
168
  "if": {
165
169
  "properties": {
166
- "temporary": {
167
- "const": true
170
+ "lifecycle": {
171
+ "const": "tmp"
168
172
  }
169
173
  },
170
174
  "required": [
171
- "temporary"
175
+ "lifecycle"
172
176
  ]
173
177
  },
174
178
  "then": {
179
+ "properties": {
180
+ "expiresAtUnixMs": {}
181
+ },
175
182
  "required": [
176
183
  "expiresAtUnixMs"
177
184
  ]
178
185
  },
179
186
  "else": {
180
187
  "not": {
188
+ "properties": {
189
+ "expiresAtUnixMs": {}
190
+ },
181
191
  "required": [
182
192
  "expiresAtUnixMs"
183
193
  ]
@@ -48,11 +48,41 @@
48
48
  "minimum": 1,
49
49
  "maximum": 9007199254740991
50
50
  },
51
- "temporary": {
52
- "type": "boolean",
53
- "default": false
51
+ "lifecycle": {
52
+ "enum": [
53
+ "std",
54
+ "tmp",
55
+ "man"
56
+ ],
57
+ "default": "std"
58
+ },
59
+ "creationId": {
60
+ "type": "string",
61
+ "pattern": "^[a-f0-9]{32}$"
54
62
  }
55
- }
63
+ },
64
+ "allOf": [
65
+ {
66
+ "if": {
67
+ "properties": {
68
+ "creationId": {}
69
+ },
70
+ "required": [
71
+ "creationId"
72
+ ]
73
+ },
74
+ "then": {
75
+ "properties": {
76
+ "lifecycle": {
77
+ "const": "man"
78
+ }
79
+ },
80
+ "required": [
81
+ "lifecycle"
82
+ ]
83
+ }
84
+ }
85
+ ]
56
86
  },
57
87
  "response": {
58
88
  "type": "object",
@@ -10,7 +10,7 @@
10
10
  "properties": {
11
11
  "uri": {
12
12
  "type": "string",
13
- "pattern": "^meow-artifact://v1/",
13
+ "pattern": "^meow-artifact://v2/",
14
14
  "maxLength": 2048
15
15
  }
16
16
  }