loremfile 0.2.1 → 0.2.3
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 +9 -4
- package/package.json +1 -1
- package/src/mcp-fixtures.mjs +161 -0
- package/src/mcp.js +21 -119
- package/src/tools.json +56 -12
package/README.md
CHANGED
|
@@ -48,12 +48,17 @@ It speaks protocol `2026-07-28` (per-request metadata, `server/discover`) and `2
|
|
|
48
48
|
|
|
49
49
|
| Tool | Arguments | Returns |
|
|
50
50
|
|---|---|---|
|
|
51
|
-
| `list_fixtures` | `format`, `tag`, `max_bytes`, `limit`, `offset` | One page of
|
|
52
|
-
| `describe_fixture` | `path` (required) | One fixture's
|
|
51
|
+
| `list_fixtures` | `format`, `tag`, `max_bytes`, `limit`, `offset` | One page of fixtures in ascending path order, each with `path`, `url`, `format`, `mime`, `bytes`, `sha256`, `license`, `tags` and `description`, plus `total` and `next_offset`. `format` and `tag` accept a string or a list matched as any of. `limit` defaults to 50, at most 250. |
|
|
52
|
+
| `describe_fixture` | `path` (required) | One fixture's metadata, including the fields in a list row plus `size_class`, measured `props` and the catalog version that introduced it (`added_in`). |
|
|
53
53
|
| `verify_file` | `path` (required), `file` (required) | Whether the local `file` is the published `path`: `status` is `ok`, `changed` or `missing`, with both hashes and sizes. The file is read to hash it and goes nowhere. |
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
Omit `format` to discover the catalog keys in the results. The filter accepts `jpg`/`jpeg`,
|
|
56
|
+
`tif`/`tiff`, `htm`/`html` and `yml`/`yaml` interchangeably. `size_class` describes how the
|
|
57
|
+
byte count relates to the nominal size. `free` means the filename makes no size claim.
|
|
58
|
+
|
|
59
|
+
Fixtures are CC0 1.0 Universal (`CC0-1.0`). The bytes at each published fixture URL never
|
|
60
|
+
change. The manifest is read once per server process from loremfile.dev, under the same
|
|
61
|
+
rules as the commands above.
|
|
57
62
|
|
|
58
63
|
## What it will not do
|
|
59
64
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loremfile",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Download CC0 sample files from loremfile.dev and verify every byte",
|
|
5
5
|
"keywords": ["fixtures", "test-data", "sample-files", "cc0", "download", "mcp"],
|
|
6
6
|
"homepage": "https://loremfile.dev",
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// Argument validation and results for the two MCP tools that work over either transport.
|
|
2
|
+
|
|
3
|
+
export const DEFAULT_LIMIT = 50;
|
|
4
|
+
export const MAX_LIMIT = 250;
|
|
5
|
+
|
|
6
|
+
export const FIXTURE_INSTRUCTIONS =
|
|
7
|
+
"These tools return metadata for the test files published at loremfile.dev: URLs, sizes, " +
|
|
8
|
+
"SHA-256 hashes and measured properties, never file contents. " +
|
|
9
|
+
"Licence: https://loremfile.dev/legal/license.";
|
|
10
|
+
|
|
11
|
+
const FIXTURE_LICENSE = "CC0-1.0";
|
|
12
|
+
// The same extension pairs as site search. Keep the catalogue key in the result.
|
|
13
|
+
const FORMAT_SYNONYMS = new Map([
|
|
14
|
+
["jpg", "jpeg"], ["jpeg", "jpg"],
|
|
15
|
+
["tif", "tiff"], ["tiff", "tif"],
|
|
16
|
+
["htm", "html"], ["html", "htm"],
|
|
17
|
+
["yml", "yaml"], ["yaml", "yml"],
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
/** A failure the caller can act on, returned with isError. */
|
|
21
|
+
export class ToolError extends Error {}
|
|
22
|
+
|
|
23
|
+
export function only(args, allowed) {
|
|
24
|
+
if (args === null || typeof args !== "object" || Array.isArray(args)) {
|
|
25
|
+
throw new ToolError("arguments must be an object");
|
|
26
|
+
}
|
|
27
|
+
const unknown = Object.keys(args).filter((key) => !allowed.includes(key));
|
|
28
|
+
if (unknown.length > 0) {
|
|
29
|
+
throw new ToolError(
|
|
30
|
+
`unknown argument ${unknown.join(", ")}; this tool takes ${allowed.join(", ")}`,
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
return args;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function strings(value, name) {
|
|
37
|
+
if (value === undefined) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
const list = typeof value === "string" ? [value] : value;
|
|
41
|
+
if (!Array.isArray(list) || !list.every((item) => typeof item === "string")) {
|
|
42
|
+
throw new ToolError(`${name} must be a list of strings`);
|
|
43
|
+
}
|
|
44
|
+
return list;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function integer(value, name, { min, max, fallback }) {
|
|
48
|
+
if (value === undefined) {
|
|
49
|
+
return fallback;
|
|
50
|
+
}
|
|
51
|
+
if (!Number.isInteger(value) || value < min || (max !== undefined && value > max)) {
|
|
52
|
+
const range = max === undefined ? `at least ${min}` : `from ${min} to ${max}`;
|
|
53
|
+
throw new ToolError(`${name} must be a whole number ${range}, not ${JSON.stringify(value)}`);
|
|
54
|
+
}
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function text(value, name) {
|
|
59
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
60
|
+
throw new ToolError(`${name} is required and must be a non-empty string`);
|
|
61
|
+
}
|
|
62
|
+
return value;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function listArguments(args) {
|
|
66
|
+
only(args, ["format", "tag", "max_bytes", "limit", "offset"]);
|
|
67
|
+
const requestedFormats = strings(args.format, "format");
|
|
68
|
+
const formats = new Set(requestedFormats);
|
|
69
|
+
for (const format of requestedFormats) {
|
|
70
|
+
const synonym = FORMAT_SYNONYMS.get(format);
|
|
71
|
+
if (synonym !== undefined) {
|
|
72
|
+
formats.add(synonym);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
formats,
|
|
77
|
+
tags: new Set(strings(args.tag, "tag")),
|
|
78
|
+
maxBytes: integer(args.max_bytes, "max_bytes", { min: 0, fallback: null }),
|
|
79
|
+
limit: integer(args.limit, "limit", { min: 1, max: MAX_LIMIT, fallback: DEFAULT_LIMIT }),
|
|
80
|
+
offset: integer(args.offset, "offset", { min: 0, fallback: 0 }),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function describePath(args) {
|
|
85
|
+
only(args, ["path"]);
|
|
86
|
+
const { path } = args;
|
|
87
|
+
if (path === undefined) {
|
|
88
|
+
throw new ToolError("path is required");
|
|
89
|
+
}
|
|
90
|
+
if (typeof path !== "string") {
|
|
91
|
+
throw new ToolError(`path must be a string, not ${JSON.stringify(path)}`);
|
|
92
|
+
}
|
|
93
|
+
if (path.trim() === "") {
|
|
94
|
+
throw new ToolError(`path must be a non-empty string, not ${JSON.stringify(path)}`);
|
|
95
|
+
}
|
|
96
|
+
return path;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function byPath(entries, fixturePath) {
|
|
100
|
+
const entry = entries.find((candidate) => candidate.path === fixturePath);
|
|
101
|
+
if (entry === undefined) {
|
|
102
|
+
throw new ToolError(
|
|
103
|
+
`no published fixture at ${JSON.stringify(fixturePath)}; ` +
|
|
104
|
+
"list_fixtures shows what is published",
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
return entry;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function listResult(entries, query, version, baseUrl, isAlias) {
|
|
111
|
+
const { formats, tags, maxBytes, limit, offset } = query;
|
|
112
|
+
// Named lookups can return aliases. Listings skip them.
|
|
113
|
+
const matches = entries
|
|
114
|
+
.filter((e) => !isAlias(e))
|
|
115
|
+
.filter((e) => formats.size === 0 || formats.has(e.format))
|
|
116
|
+
.filter((e) => tags.size === 0 || (e.tags ?? []).some((tag) => tags.has(tag)))
|
|
117
|
+
.filter((e) => maxBytes === null || e.bytes <= maxBytes)
|
|
118
|
+
.sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
|
|
119
|
+
const page = matches.slice(offset, offset + limit);
|
|
120
|
+
return {
|
|
121
|
+
catalog_version: String(version ?? ""),
|
|
122
|
+
total: matches.length,
|
|
123
|
+
offset,
|
|
124
|
+
limit,
|
|
125
|
+
count: page.length,
|
|
126
|
+
next_offset: offset + limit < matches.length ? offset + limit : null,
|
|
127
|
+
fixtures: page.map((e) => ({
|
|
128
|
+
path: e.path,
|
|
129
|
+
url: `${baseUrl}${e.path}`,
|
|
130
|
+
format: e.format,
|
|
131
|
+
mime: e.mime,
|
|
132
|
+
bytes: e.bytes,
|
|
133
|
+
sha256: e.sha256,
|
|
134
|
+
license: FIXTURE_LICENSE,
|
|
135
|
+
tags: e.tags ?? [],
|
|
136
|
+
description: e.description ?? "",
|
|
137
|
+
})),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function describeResult(entry, version, baseUrl) {
|
|
142
|
+
const props = entry.props == null ? null : { ...entry.props };
|
|
143
|
+
if (props !== null) {
|
|
144
|
+
delete props.format;
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
catalog_version: String(version ?? ""),
|
|
148
|
+
path: entry.path,
|
|
149
|
+
url: `${baseUrl}${entry.path}`,
|
|
150
|
+
format: entry.format,
|
|
151
|
+
mime: entry.mime,
|
|
152
|
+
bytes: entry.bytes,
|
|
153
|
+
sha256: entry.sha256,
|
|
154
|
+
license: FIXTURE_LICENSE,
|
|
155
|
+
size_class: entry.size_class ?? null,
|
|
156
|
+
tags: entry.tags ?? [],
|
|
157
|
+
description: entry.description ?? "",
|
|
158
|
+
props,
|
|
159
|
+
added_in: entry.added_in ?? null,
|
|
160
|
+
};
|
|
161
|
+
}
|
package/src/mcp.js
CHANGED
|
@@ -13,6 +13,19 @@ import path from "node:path";
|
|
|
13
13
|
import { createInterface } from "node:readline";
|
|
14
14
|
|
|
15
15
|
import * as api from "./api.js";
|
|
16
|
+
import {
|
|
17
|
+
FIXTURE_INSTRUCTIONS,
|
|
18
|
+
ToolError,
|
|
19
|
+
byPath,
|
|
20
|
+
describePath,
|
|
21
|
+
describeResult,
|
|
22
|
+
listArguments,
|
|
23
|
+
listResult,
|
|
24
|
+
only,
|
|
25
|
+
text,
|
|
26
|
+
} from "./mcp-fixtures.mjs";
|
|
27
|
+
|
|
28
|
+
export { DEFAULT_LIMIT, MAX_LIMIT, ToolError } from "./mcp-fixtures.mjs";
|
|
16
29
|
|
|
17
30
|
export const MODERN = "2026-07-28";
|
|
18
31
|
export const LEGACY = "2025-11-25";
|
|
@@ -20,8 +33,6 @@ export const LEGACY = "2025-11-25";
|
|
|
20
33
|
export const SUPPORTED = [MODERN, LEGACY];
|
|
21
34
|
|
|
22
35
|
const META = "io.modelcontextprotocol/";
|
|
23
|
-
export const DEFAULT_LIMIT = 50;
|
|
24
|
-
export const MAX_LIMIT = 250;
|
|
25
36
|
|
|
26
37
|
/** JSON-RPC codes, and the one MCP code this server uses. */
|
|
27
38
|
export const CODES = {
|
|
@@ -38,10 +49,8 @@ export const SERVER_INFO = {
|
|
|
38
49
|
version: JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version,
|
|
39
50
|
};
|
|
40
51
|
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
"list_fixtures to find one, describe_fixture for its size, hash and measured properties, " +
|
|
44
|
-
"and verify_file to check a copy on disk. The tools return URLs, never file contents.";
|
|
52
|
+
const STDIO_INSTRUCTIONS = "verify_file compares a local file with the published hash.";
|
|
53
|
+
const INSTRUCTIONS = `${FIXTURE_INSTRUCTIONS} ${STDIO_INSTRUCTIONS}`;
|
|
45
54
|
|
|
46
55
|
/**
|
|
47
56
|
* The tool surface, shared byte for byte with the Python client (tools.json in both trees;
|
|
@@ -50,9 +59,6 @@ const INSTRUCTIONS =
|
|
|
50
59
|
*/
|
|
51
60
|
export const TOOLS = JSON.parse(readFileSync(new URL("./tools.json", import.meta.url), "utf8"));
|
|
52
61
|
|
|
53
|
-
/** A failure the model can act on: a tool result with `isError`, not a protocol error. */
|
|
54
|
-
export class ToolError extends Error {}
|
|
55
|
-
|
|
56
62
|
class ProtocolError extends Error {
|
|
57
63
|
constructor(code, message, data) {
|
|
58
64
|
super(message);
|
|
@@ -61,126 +67,22 @@ class ProtocolError extends Error {
|
|
|
61
67
|
}
|
|
62
68
|
}
|
|
63
69
|
|
|
64
|
-
// --- arguments ----------------------------------------------------------------------------
|
|
65
|
-
|
|
66
|
-
function only(args, allowed) {
|
|
67
|
-
if (args === null || typeof args !== "object" || Array.isArray(args)) {
|
|
68
|
-
throw new ToolError("arguments must be an object");
|
|
69
|
-
}
|
|
70
|
-
const unknown = Object.keys(args).filter((key) => !allowed.includes(key));
|
|
71
|
-
if (unknown.length > 0) {
|
|
72
|
-
throw new ToolError(
|
|
73
|
-
`unknown argument ${unknown.join(", ")}; this tool takes ${allowed.join(", ")}`,
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
return args;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function strings(value, name) {
|
|
80
|
-
if (value === undefined) {
|
|
81
|
-
return [];
|
|
82
|
-
}
|
|
83
|
-
const list = typeof value === "string" ? [value] : value;
|
|
84
|
-
if (!Array.isArray(list) || !list.every((item) => typeof item === "string")) {
|
|
85
|
-
throw new ToolError(`${name} must be a list of strings`);
|
|
86
|
-
}
|
|
87
|
-
return list;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function integer(value, name, { min, max, fallback }) {
|
|
91
|
-
if (value === undefined) {
|
|
92
|
-
return fallback;
|
|
93
|
-
}
|
|
94
|
-
if (!Number.isInteger(value) || value < min || (max !== undefined && value > max)) {
|
|
95
|
-
const range = max === undefined ? `at least ${min}` : `from ${min} to ${max}`;
|
|
96
|
-
throw new ToolError(`${name} must be a whole number ${range}, not ${JSON.stringify(value)}`);
|
|
97
|
-
}
|
|
98
|
-
return value;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function text(value, name) {
|
|
102
|
-
if (typeof value !== "string" || value.trim() === "") {
|
|
103
|
-
throw new ToolError(`${name} is required and must be a non-empty string`);
|
|
104
|
-
}
|
|
105
|
-
return value;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
70
|
// --- the tools ----------------------------------------------------------------------------
|
|
109
71
|
|
|
110
|
-
function url(entry) {
|
|
111
|
-
return `${api.baseUrl()}${entry.path}`;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function byPath(document, fixturePath) {
|
|
115
|
-
const entry = api.active(document).find((candidate) => candidate.path === fixturePath);
|
|
116
|
-
if (entry === undefined) {
|
|
117
|
-
throw new ToolError(
|
|
118
|
-
`no published fixture at ${JSON.stringify(fixturePath)}; ` +
|
|
119
|
-
"list_fixtures shows what is published",
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
return entry;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
72
|
async function listFixtures(document, args) {
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
const maxBytes = integer(args.max_bytes, "max_bytes", { min: 0, fallback: null });
|
|
130
|
-
const limit = integer(args.limit, "limit", { min: 1, max: MAX_LIMIT, fallback: DEFAULT_LIMIT });
|
|
131
|
-
const offset = integer(args.offset, "offset", { min: 0, fallback: 0 });
|
|
132
|
-
// The same filters as `loremfile list`: any of the formats, any of the tags, all three kinds.
|
|
133
|
-
// The sample.{format} aliases repeat another file's bytes and stay out; describe_fixture and
|
|
134
|
-
// verify_file still take one by path.
|
|
135
|
-
const matches = api
|
|
136
|
-
.active(document)
|
|
137
|
-
.filter((e) => !api.isAlias(e))
|
|
138
|
-
.filter((e) => formats.length === 0 || formats.includes(e.format))
|
|
139
|
-
.filter((e) => tags.length === 0 || (e.tags ?? []).some((tag) => tags.includes(tag)))
|
|
140
|
-
.filter((e) => maxBytes === null || e.bytes <= maxBytes)
|
|
141
|
-
.sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
|
|
142
|
-
const page = matches.slice(offset, offset + limit);
|
|
143
|
-
return {
|
|
144
|
-
catalog_version: String(document.catalog_version ?? ""),
|
|
145
|
-
total: matches.length,
|
|
146
|
-
offset,
|
|
147
|
-
limit,
|
|
148
|
-
count: page.length,
|
|
149
|
-
next_offset: offset + limit < matches.length ? offset + limit : null,
|
|
150
|
-
fixtures: page.map((e) => ({
|
|
151
|
-
path: e.path,
|
|
152
|
-
url: url(e),
|
|
153
|
-
format: e.format,
|
|
154
|
-
mime: e.mime,
|
|
155
|
-
bytes: e.bytes,
|
|
156
|
-
tags: e.tags ?? [],
|
|
157
|
-
description: e.description ?? "",
|
|
158
|
-
})),
|
|
159
|
-
};
|
|
73
|
+
const query = listArguments(args);
|
|
74
|
+
const entries = api.active(document);
|
|
75
|
+
return listResult(entries, query, document.catalog_version, api.baseUrl(), api.isAlias);
|
|
160
76
|
}
|
|
161
77
|
|
|
162
78
|
async function describeFixture(document, args) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
return {
|
|
166
|
-
catalog_version: String(document.catalog_version ?? ""),
|
|
167
|
-
path: entry.path,
|
|
168
|
-
url: url(entry),
|
|
169
|
-
format: entry.format,
|
|
170
|
-
mime: entry.mime,
|
|
171
|
-
bytes: entry.bytes,
|
|
172
|
-
sha256: entry.sha256,
|
|
173
|
-
size_class: entry.size_class ?? null,
|
|
174
|
-
tags: entry.tags ?? [],
|
|
175
|
-
description: entry.description ?? "",
|
|
176
|
-
props: entry.props ?? null,
|
|
177
|
-
added_in: entry.added_in ?? null,
|
|
178
|
-
};
|
|
79
|
+
const entry = byPath(api.active(document), describePath(args));
|
|
80
|
+
return describeResult(entry, document.catalog_version, api.baseUrl());
|
|
179
81
|
}
|
|
180
82
|
|
|
181
83
|
async function verifyFile(document, args) {
|
|
182
84
|
only(args, ["path", "file"]);
|
|
183
|
-
const entry = byPath(document, text(args.path, "path"));
|
|
85
|
+
const entry = byPath(api.active(document), text(args.path, "path"));
|
|
184
86
|
const file = path.resolve(text(args.file, "file"));
|
|
185
87
|
const info = await api.fileInfo(file);
|
|
186
88
|
const actual = info === null ? null : await api.hashFile(file);
|
package/src/tools.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
{
|
|
3
3
|
"name": "list_fixtures",
|
|
4
4
|
"title": "List loremfile.dev fixtures",
|
|
5
|
-
"description": "One page of
|
|
5
|
+
"description": "One page of published CC0 sample files in ascending path order, filtered by format, tag and maximum byte count. Reads fixture metadata over the network. Each row includes the URL, SHA-256 and a description. `total` counts every match. Use `next_offset` for the next page. It is null on the last page.",
|
|
6
6
|
"inputSchema": {
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
|
-
"description": "Formats to include, any of, e.g. [\"pdf\", \"png\"]."
|
|
21
|
+
"description": "Formats to include, any of, e.g. [\"pdf\", \"png\"]. Extension synonyms are jpg/jpeg, tif/tiff, htm/html and yml/yaml. Omit format to list all formats, with the catalogue key in each row's format field."
|
|
22
22
|
},
|
|
23
23
|
"tag": {
|
|
24
24
|
"anyOf": [
|
|
@@ -91,7 +91,8 @@
|
|
|
91
91
|
"type": "string"
|
|
92
92
|
},
|
|
93
93
|
"format": {
|
|
94
|
-
"type": "string"
|
|
94
|
+
"type": "string",
|
|
95
|
+
"description": "Catalogue format key, e.g. jpg."
|
|
95
96
|
},
|
|
96
97
|
"mime": {
|
|
97
98
|
"type": "string"
|
|
@@ -99,6 +100,15 @@
|
|
|
99
100
|
"bytes": {
|
|
100
101
|
"type": "integer"
|
|
101
102
|
},
|
|
103
|
+
"sha256": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"description": "Published SHA-256 of the fixture bytes, as 64 lowercase hexadecimal characters."
|
|
106
|
+
},
|
|
107
|
+
"license": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"const": "CC0-1.0",
|
|
110
|
+
"description": "CC0 1.0 Universal public domain dedication."
|
|
111
|
+
},
|
|
102
112
|
"tags": {
|
|
103
113
|
"type": "array",
|
|
104
114
|
"items": {
|
|
@@ -115,6 +125,8 @@
|
|
|
115
125
|
"format",
|
|
116
126
|
"mime",
|
|
117
127
|
"bytes",
|
|
128
|
+
"sha256",
|
|
129
|
+
"license",
|
|
118
130
|
"tags",
|
|
119
131
|
"description"
|
|
120
132
|
]
|
|
@@ -135,13 +147,13 @@
|
|
|
135
147
|
"readOnlyHint": true,
|
|
136
148
|
"destructiveHint": false,
|
|
137
149
|
"idempotentHint": true,
|
|
138
|
-
"openWorldHint":
|
|
150
|
+
"openWorldHint": true
|
|
139
151
|
}
|
|
140
152
|
},
|
|
141
153
|
{
|
|
142
154
|
"name": "describe_fixture",
|
|
143
155
|
"title": "Describe one loremfile.dev fixture",
|
|
144
|
-
"description": "
|
|
156
|
+
"description": "Published metadata for one CC0 fixture, including its URL, MIME type, byte count, SHA-256, tags, description and measured properties. Reads fixture metadata over the network. Fetch the URL for the file.",
|
|
145
157
|
"inputSchema": {
|
|
146
158
|
"type": "object",
|
|
147
159
|
"properties": {
|
|
@@ -168,7 +180,8 @@
|
|
|
168
180
|
"type": "string"
|
|
169
181
|
},
|
|
170
182
|
"format": {
|
|
171
|
-
"type": "string"
|
|
183
|
+
"type": "string",
|
|
184
|
+
"description": "Catalogue format key, e.g. jpg. Use it to filter list_fixtures."
|
|
172
185
|
},
|
|
173
186
|
"mime": {
|
|
174
187
|
"type": "string"
|
|
@@ -179,11 +192,17 @@
|
|
|
179
192
|
"sha256": {
|
|
180
193
|
"type": "string"
|
|
181
194
|
},
|
|
195
|
+
"license": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"const": "CC0-1.0",
|
|
198
|
+
"description": "CC0 1.0 Universal public domain dedication."
|
|
199
|
+
},
|
|
182
200
|
"size_class": {
|
|
183
201
|
"type": [
|
|
184
202
|
"string",
|
|
185
203
|
"null"
|
|
186
|
-
]
|
|
204
|
+
],
|
|
205
|
+
"description": "How the byte count relates to the nominal size. exact means equal, boundary means exactly one byte above or below, approx means within 5%, and free means the filename makes no size claim. Null if unrecorded."
|
|
187
206
|
},
|
|
188
207
|
"tags": {
|
|
189
208
|
"type": "array",
|
|
@@ -198,13 +217,37 @@
|
|
|
198
217
|
"type": [
|
|
199
218
|
"object",
|
|
200
219
|
"null"
|
|
201
|
-
]
|
|
220
|
+
],
|
|
221
|
+
"description": "Properties measured from the fixture bytes. Keys depend on the format and may be absent. Null if no properties are recorded. See https://loremfile.dev/docs/manifest for format-specific keys.",
|
|
222
|
+
"properties": {
|
|
223
|
+
"pages": {
|
|
224
|
+
"type": "integer",
|
|
225
|
+
"description": "Page count for a PDF, or number of page records in a HAR log."
|
|
226
|
+
},
|
|
227
|
+
"width": {
|
|
228
|
+
"type": ["number", "string", "null"],
|
|
229
|
+
"description": "Measured width in pixels for raster images and media, including embedded artwork where reported. SVG may record its width attribute or null."
|
|
230
|
+
},
|
|
231
|
+
"height": {
|
|
232
|
+
"type": ["number", "string", "null"],
|
|
233
|
+
"description": "Measured height in pixels for raster images and media, including embedded artwork where reported. SVG may record its height attribute or null."
|
|
234
|
+
},
|
|
235
|
+
"duration_ms": {
|
|
236
|
+
"type": "integer",
|
|
237
|
+
"description": "Measured audio or video duration in milliseconds."
|
|
238
|
+
},
|
|
239
|
+
"rows": {
|
|
240
|
+
"type": "integer",
|
|
241
|
+
"description": "Measured row count. The format determines which rows are included."
|
|
242
|
+
}
|
|
243
|
+
}
|
|
202
244
|
},
|
|
203
245
|
"added_in": {
|
|
204
246
|
"type": [
|
|
205
247
|
"string",
|
|
206
248
|
"null"
|
|
207
|
-
]
|
|
249
|
+
],
|
|
250
|
+
"description": "Catalogue version that first published the fixture. Null if unrecorded."
|
|
208
251
|
}
|
|
209
252
|
},
|
|
210
253
|
"required": [
|
|
@@ -215,6 +258,7 @@
|
|
|
215
258
|
"mime",
|
|
216
259
|
"bytes",
|
|
217
260
|
"sha256",
|
|
261
|
+
"license",
|
|
218
262
|
"size_class",
|
|
219
263
|
"tags",
|
|
220
264
|
"description",
|
|
@@ -226,13 +270,13 @@
|
|
|
226
270
|
"readOnlyHint": true,
|
|
227
271
|
"destructiveHint": false,
|
|
228
272
|
"idempotentHint": true,
|
|
229
|
-
"openWorldHint":
|
|
273
|
+
"openWorldHint": true
|
|
230
274
|
}
|
|
231
275
|
},
|
|
232
276
|
{
|
|
233
277
|
"name": "verify_file",
|
|
234
278
|
"title": "Verify a local copy of a loremfile.dev fixture",
|
|
235
|
-
"description": "Hash a file on this machine and compare it with the published SHA-256 and size of a fixture. `status` is ok, changed or missing. The file is read only to hash it.",
|
|
279
|
+
"description": "Hash a file on this machine and compare it with the published SHA-256 and size of a fixture. Reads the published manifest over the network. `status` is ok, changed or missing. The file is read only to hash it.",
|
|
236
280
|
"inputSchema": {
|
|
237
281
|
"type": "object",
|
|
238
282
|
"properties": {
|
|
@@ -301,7 +345,7 @@
|
|
|
301
345
|
"readOnlyHint": true,
|
|
302
346
|
"destructiveHint": false,
|
|
303
347
|
"idempotentHint": true,
|
|
304
|
-
"openWorldHint":
|
|
348
|
+
"openWorldHint": true
|
|
305
349
|
}
|
|
306
350
|
}
|
|
307
351
|
]
|