@monoflake/sdk 2026.1005.0 → 2026.1005.2

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.
@@ -33,7 +33,7 @@ export declare const ROOT_KEY = "state/index.json";
33
33
  * either. The type survives as the one thing that decides the extension: a caller asks for a
34
34
  * `content` object and the table below says that is spelled `json`.
35
35
  */
36
- export declare function artifactAddress(type: ArtifactType, hash: string): string;
36
+ export declare function artifactAddress(type: ArtifactType, cid: string): string;
37
37
  /**
38
38
  * Where an object lives: its content id, fanned out, and nothing else.
39
39
  *
@@ -36,8 +36,8 @@ const ROOT_KEY = "state/index.json";
36
36
  * either. The type survives as the one thing that decides the extension: a caller asks for a
37
37
  * `content` object and the table below says that is spelled `json`.
38
38
  */
39
- function artifactAddress(type, hash) {
40
- return `object/${hash}.${EXTENSION[type]}`;
39
+ function artifactAddress(type, cid) {
40
+ return `object/${cid}.${EXTENSION[type]}`;
41
41
  }
42
42
  /**
43
43
  * Where an object lives: its content id, fanned out, and nothing else.
@@ -71,14 +71,14 @@ function recordKey(resource) {
71
71
  function parseArtifactKey(key) {
72
72
  const match = /^([a-z]+)\/([0-9a-f]+)\.([a-z0-9]+)$/.exec(key);
73
73
  if (!match) return void 0;
74
- const [, type, hash, ext] = match;
75
- if (!type || !hash || !ext) return void 0;
76
- if (!HASH_PATTERN.test(hash)) return void 0;
74
+ const [, type, digest, ext] = match;
75
+ if (!type || !digest || !ext) return void 0;
76
+ if (!HASH_PATTERN.test(digest)) return void 0;
77
77
  if (!ARTIFACT_TYPES.includes(type)) return void 0;
78
78
  if (EXTENSION[type] !== ext) return void 0;
79
79
  return {
80
80
  type,
81
- hash,
81
+ hash: digest,
82
82
  ext
83
83
  };
84
84
  }
@@ -54,8 +54,8 @@ function longEdge(file) {
54
54
  function best(image, want) {
55
55
  const vector = image.variants.find((file) => SCALABLE_MIMES.has(file.mime));
56
56
  if (vector) return vector;
57
- const rungs = [...image.variants].sort((a, b) => longEdge(a) - longEdge(b));
58
- return rungs.find((file) => longEdge(file) >= want) ?? rungs[rungs.length - 1];
57
+ const ordered = image.variants.toSorted((a, b) => longEdge(a) - longEdge(b));
58
+ return ordered.find((file) => longEdge(file) >= want) ?? ordered.at(-1);
59
59
  }
60
60
  /**
61
61
  * What an icon's file is spelled with, keyed by what is in it.
@@ -50,10 +50,10 @@ export declare const NAMED = "public, max-age=3600";
50
50
  /**
51
51
  * What a key whose bytes cannot change earns.
52
52
  *
53
- * Content addressing is the usual reason -- a hashed name cannot denote different bytes, so a
54
- * cached copy is correct forever and needs no invalidation. It is not the only one: a Latin font
55
- * subset keeps the year on a written promise that re-subsetting renames it, which is why this is
56
- * named for the property rather than for the hash that normally carries it.
53
+ * Content addressing is the reason -- a hashed name cannot denote different bytes, so a cached
54
+ * copy is correct forever and needs no invalidation. Named for the property rather than the hash,
55
+ * since an exception with a promise of its own could earn it too; none does today -- see
56
+ * spec/architecture/artifacts.md.
57
57
  */
58
58
  export declare const UNCHANGING = "public, max-age=31536000, immutable";
59
59
  /**
@@ -40,10 +40,10 @@ const NAMED = `public, max-age=${NAMED_LIFE}`;
40
40
  /**
41
41
  * What a key whose bytes cannot change earns.
42
42
  *
43
- * Content addressing is the usual reason -- a hashed name cannot denote different bytes, so a
44
- * cached copy is correct forever and needs no invalidation. It is not the only one: a Latin font
45
- * subset keeps the year on a written promise that re-subsetting renames it, which is why this is
46
- * named for the property rather than for the hash that normally carries it.
43
+ * Content addressing is the reason -- a hashed name cannot denote different bytes, so a cached
44
+ * copy is correct forever and needs no invalidation. Named for the property rather than the hash,
45
+ * since an exception with a promise of its own could earn it too; none does today -- see
46
+ * spec/architecture/artifacts.md.
47
47
  */
48
48
  const UNCHANGING = `public, max-age=${UNCHANGING_LIFE}, immutable`;
49
49
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monoflake/sdk",
3
- "version": "2026.1005.0",
3
+ "version": "2026.1005.2",
4
4
  "description": "Addresses and clients for the platform.",
5
5
  "keywords": [
6
6
  "cloudflare-workers",