@mhome/artifact-protocol 1.7.0 → 1.9.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
@@ -19,3 +19,50 @@ runtime concerns and are deliberately not encoded into an artifact reference.
19
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.
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
+
23
+ ### Temporary artifacts (MeowCore)
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.
31
+
32
+ MeowCore keeps temporary content only in memory, without a total capacity or
33
+ object-count quota and without disk spill. Each successful content read resets
34
+ one hour of idle retention. Upload and repeated put / import revalidation also
35
+ reset that deadline; resolve and metadata queries do not. Objects never read
36
+ expire one hour after upload. Reads reject expired objects immediately, while
37
+ periodic maintenance reclaims idle entries. An already opened snapshot may
38
+ finish after deletion or expiry. Existing per-upload size and transport limits
39
+ still apply. The caller is responsible for peak memory use.
40
+
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.
47
+
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.
54
+
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. Temporary HTTP uploads and native
58
+ reads transfer content from memory without staging files. Large native transfers use bounded attachments on the existing
59
+ IPC connection; the JSON control frame limit is unchanged. Temporary delivery uses
60
+ `no-store`, and resolve grants never outlive the reported object expiration.
61
+
62
+ Temporary state is process-owned and is lost on restart. Startup removes
63
+ abandoned spill directories left by older runtimes. This contract adds no database
64
+ or migration. Cloud forwarding preserves the local owner’s lifetime metadata and
65
+ routes persist/delete to that owner. Cloud-owned storage rejects temporary writes;
66
+ it supports idempotent persist for existing durable content and exact-key delete.
67
+ A multi-instance cloud service must not emulate temporary storage with an
68
+ uncoordinated in-process map.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.artifact.v1",
3
- "contractVersion": "1.7.0",
3
+ "contractVersion": "1.9.0",
4
4
  "uriPrefix": "meow-artifact://v1/",
5
5
  "kinds": [
6
6
  "image",
@@ -30,5 +30,17 @@
30
30
  "import": {
31
31
  "schema": "schema/artifact-import.v1.schema.json",
32
32
  "schemaVersion": 1
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
+ "delete": {
41
+ "target": "/artifact/delete",
42
+ "requestSchema": "schema/artifact-resolve.v1.schema.json#/$defs/request",
43
+ "responseSchema": "schema/artifact-delete.v1.schema.json",
44
+ "schemaVersion": 1
33
45
  }
34
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhome/artifact-protocol",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "Build-time protocol artifacts for mhome.artifact",
5
5
  "license": "MIT",
6
6
  "repository": {
package/protocol.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "protocol": "mhome.artifact",
3
- "contractVersion": "1.7.0",
3
+ "contractVersion": "1.9.0",
4
4
  "manifest": "manifest/artifact.v1.json",
5
5
  "schemas": {
6
6
  "artifactMetadata": "schema/artifact-metadata.v1.schema.json",
7
7
  "artifactResolve": "schema/artifact-resolve.v1.schema.json",
8
8
  "artifactPut": "schema/artifact-put.v1.schema.json",
9
+ "artifactDelete": "schema/artifact-delete.v1.schema.json",
9
10
  "artifactImport": "schema/artifact-import.v1.schema.json",
10
11
  "mediaReference": "schema/media-reference.v1.schema.json",
11
12
  "artifactUpload": "schema/artifact-upload.v1.schema.json"
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "additionalProperties": false,
5
+ "properties": {}
6
+ }
@@ -25,6 +25,10 @@
25
25
  "type": "string",
26
26
  "minLength": 3,
27
27
  "maxLength": 255
28
+ },
29
+ "temporary": {
30
+ "type": "boolean",
31
+ "default": false
28
32
  }
29
33
  }
30
34
  }
@@ -58,8 +58,48 @@
58
58
  "type": "integer",
59
59
  "minimum": 1,
60
60
  "maximum": 9007199254740991
61
+ },
62
+ "temporary": {
63
+ "type": "boolean",
64
+ "default": false
65
+ },
66
+ "expiresAtUnixMs": {
67
+ "type": "integer",
68
+ "minimum": 1
61
69
  }
62
- }
70
+ },
71
+ "allOf": [
72
+ {
73
+ "if": {
74
+ "properties": {
75
+ "temporary": {
76
+ "const": true
77
+ }
78
+ },
79
+ "required": [
80
+ "temporary"
81
+ ]
82
+ },
83
+ "then": {
84
+ "properties": {
85
+ "expiresAtUnixMs": {}
86
+ },
87
+ "required": [
88
+ "expiresAtUnixMs"
89
+ ]
90
+ },
91
+ "else": {
92
+ "not": {
93
+ "properties": {
94
+ "expiresAtUnixMs": {}
95
+ },
96
+ "required": [
97
+ "expiresAtUnixMs"
98
+ ]
99
+ }
100
+ }
101
+ }
102
+ ]
63
103
  },
64
104
  "request": {
65
105
  "type": "object",
@@ -93,6 +133,10 @@
93
133
  "type": "integer",
94
134
  "minimum": 1,
95
135
  "maximum": 9007199254740991
136
+ },
137
+ "temporary": {
138
+ "type": "boolean",
139
+ "default": false
96
140
  }
97
141
  }
98
142
  },
@@ -149,8 +149,48 @@
149
149
  }
150
150
  }
151
151
  }
152
+ },
153
+ "temporary": {
154
+ "type": "boolean",
155
+ "default": false
156
+ },
157
+ "expiresAtUnixMs": {
158
+ "type": "integer",
159
+ "minimum": 1
152
160
  }
153
- }
161
+ },
162
+ "allOf": [
163
+ {
164
+ "if": {
165
+ "properties": {
166
+ "temporary": {
167
+ "const": true
168
+ }
169
+ },
170
+ "required": [
171
+ "temporary"
172
+ ]
173
+ },
174
+ "then": {
175
+ "properties": {
176
+ "expiresAtUnixMs": {}
177
+ },
178
+ "required": [
179
+ "expiresAtUnixMs"
180
+ ]
181
+ },
182
+ "else": {
183
+ "not": {
184
+ "properties": {
185
+ "expiresAtUnixMs": {}
186
+ },
187
+ "required": [
188
+ "expiresAtUnixMs"
189
+ ]
190
+ }
191
+ }
192
+ }
193
+ ]
154
194
  }
155
195
  }
156
196
  }
@@ -47,6 +47,10 @@
47
47
  "type": "integer",
48
48
  "minimum": 1,
49
49
  "maximum": 9007199254740991
50
+ },
51
+ "temporary": {
52
+ "type": "boolean",
53
+ "default": false
50
54
  }
51
55
  }
52
56
  },