@forumone/throughline 1.2.0 → 1.3.0-pr-285-01cb291
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/CHANGELOG.md +12 -0
- package/dist/audit/types.d.ts +1 -1
- package/dist/audit/types.d.ts.map +1 -1
- package/dist/audit/types.js +1 -0
- package/dist/audit/types.js.map +1 -1
- package/dist/content/describe.d.ts +61 -0
- package/dist/content/describe.d.ts.map +1 -0
- package/dist/content/describe.js +201 -0
- package/dist/content/describe.js.map +1 -0
- package/dist/content/index.d.ts +7 -0
- package/dist/content/index.d.ts.map +1 -0
- package/dist/content/index.js +4 -0
- package/dist/content/index.js.map +1 -0
- package/dist/content/options.d.ts +52 -0
- package/dist/content/options.d.ts.map +1 -0
- package/dist/content/options.js +2 -0
- package/dist/content/options.js.map +1 -0
- package/dist/content/plugin.d.ts +23 -0
- package/dist/content/plugin.d.ts.map +1 -0
- package/dist/content/plugin.js +68 -0
- package/dist/content/plugin.js.map +1 -0
- package/dist/content/tools.d.ts +88 -0
- package/dist/content/tools.d.ts.map +1 -0
- package/dist/content/tools.js +359 -0
- package/dist/content/tools.js.map +1 -0
- package/dist/mcp/audit-server.d.ts.map +1 -1
- package/dist/mcp/audit-server.js +2 -0
- package/dist/mcp/audit-server.js.map +1 -1
- package/dist/migrate/exports.json +22 -1
- package/dist/throughline.d.ts +8 -0
- package/dist/throughline.d.ts.map +1 -1
- package/dist/throughline.js +32 -0
- package/dist/throughline.js.map +1 -1
- package/package.json +9 -5
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createLocalReq, } from 'payload';
|
|
3
|
+
import { deniedEnvelope } from '../mcp/envelope.js';
|
|
4
|
+
import { matchRank } from '../editorial/palette/sources.js';
|
|
5
|
+
import { describeFields, writableFields } from './describe.js';
|
|
6
|
+
/*
|
|
7
|
+
The read half of the content tools: what an agent needs before it writes.
|
|
8
|
+
|
|
9
|
+
Every read runs as the key's person with `overrideAccess: false`, so it sees
|
|
10
|
+
what they would see in the admin and nothing more. The answer for a document is
|
|
11
|
+
in the shape the write tools take — the authored fields only, relationships as
|
|
12
|
+
ids, blocks with their ids — so a read can be edited and handed straight back.
|
|
13
|
+
*/
|
|
14
|
+
export const CONTENT_READ_TOOLS = {
|
|
15
|
+
describeContentType: {
|
|
16
|
+
name: 'describe_content_type',
|
|
17
|
+
description: 'What a content type is made of, before creating or editing one: every field an author may set, with its type, limits, whether it is required, a select\'s options, and for a link to another document the `find_related` kind that finds one. A blocks field lists the blocks it accepts (look each up with `get_contract`). Also what the page template already draws, so the layout does not repeat it, and what publishing requires. Read from the live configuration.',
|
|
18
|
+
},
|
|
19
|
+
findDocuments: {
|
|
20
|
+
name: 'find_documents',
|
|
21
|
+
description: 'Finds documents of one content type by title or slug, drafts included, newest first. Each result has its id, title, slug, status (draft or published, of the latest version), when it was last changed, and its admin and preview links. Use before creating something, so an existing document is edited rather than duplicated.',
|
|
22
|
+
},
|
|
23
|
+
findRelated: {
|
|
24
|
+
name: 'find_related',
|
|
25
|
+
description: 'Looks up something a document links to — an author, a client, a taxonomy term, an image — by a few letters of its name, to get the id a field needs. Images come back with their alt text and dimensions. Which kinds exist is in each field\'s `findWith` from `describe_content_type`. Read only.',
|
|
26
|
+
},
|
|
27
|
+
getDocument: {
|
|
28
|
+
name: 'get_document',
|
|
29
|
+
description: 'Reads one document in the shape the write tools accept: the fields an author may set, relationships as ids, and blocks with their ids. The latest draft by default; pass draft: false for the published version. Also its status and its admin and preview links.',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export const CONTENT_READ_TOOL_DESCRIPTORS = Object.values(CONTENT_READ_TOOLS);
|
|
33
|
+
function defaultCanUse(ctx) {
|
|
34
|
+
const roles = ctx.user?.roles ?? [];
|
|
35
|
+
return roles.includes('admin') || roles.includes('editor');
|
|
36
|
+
}
|
|
37
|
+
const DENIED = 'Only admins and editors can read content through these tools.';
|
|
38
|
+
/*
|
|
39
|
+
Two refusals before any query. No user means a key with nobody behind it, and
|
|
40
|
+
reading as nobody would read past every rule the person is subject to; the role
|
|
41
|
+
check is the same line `check_slug` and `find_references` draw.
|
|
42
|
+
*/
|
|
43
|
+
function refusal(ctx, canUse) {
|
|
44
|
+
if (!ctx.user) {
|
|
45
|
+
return deniedEnvelope('This key is not tied to a person, and content is read with that person\'s access.');
|
|
46
|
+
}
|
|
47
|
+
if (!canUse(ctx))
|
|
48
|
+
return deniedEnvelope(DENIED);
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
/** `ctx.user` as Payload's own user, the cast the publishing tools make for the same reason. */
|
|
52
|
+
function userOf(ctx) {
|
|
53
|
+
return ctx.user;
|
|
54
|
+
}
|
|
55
|
+
function unknownCollection(deps, collection) {
|
|
56
|
+
return {
|
|
57
|
+
error: `"${collection}" is not a content type these tools write. They write: ${Object.keys(deps.collections).join(', ')}.`,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function titleFieldOf(payload, collection) {
|
|
61
|
+
const config = payload.collections[collection]?.config;
|
|
62
|
+
return config?.admin?.useAsTitle ?? 'id';
|
|
63
|
+
}
|
|
64
|
+
function adminUrl(payload, collection, id) {
|
|
65
|
+
return `${payload.config.routes.admin}/collections/${collection}/${encodeURIComponent(String(id))}`;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The collection's own Preview link, absolute. `null` when it has none, or has
|
|
69
|
+
* none for this document yet — a draft with no slug, for instance.
|
|
70
|
+
*/
|
|
71
|
+
async function previewUrl(payload, collection, doc, req) {
|
|
72
|
+
const preview = payload.collections[collection]?.config.admin?.preview;
|
|
73
|
+
if (typeof preview !== 'function')
|
|
74
|
+
return null;
|
|
75
|
+
try {
|
|
76
|
+
const url = await preview(doc, { locale: req.locale ?? undefined, req, token: null });
|
|
77
|
+
if (typeof url !== 'string' || url === '')
|
|
78
|
+
return null;
|
|
79
|
+
return url.startsWith('/') ? `${payload.config.serverURL ?? ''}${url}` : url;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async function requestAs(payload, ctx) {
|
|
86
|
+
return createLocalReq({ user: userOf(ctx) ?? undefined }, payload);
|
|
87
|
+
}
|
|
88
|
+
function blockRegistry(payload) {
|
|
89
|
+
return new Map((payload.config.blocks ?? []).map((block) => [block.slug, block]));
|
|
90
|
+
}
|
|
91
|
+
/** Collection slug → the `find_related` kind that searches it. */
|
|
92
|
+
function findWithIndex(related) {
|
|
93
|
+
const index = new Map();
|
|
94
|
+
for (const [kind, options] of Object.entries(related)) {
|
|
95
|
+
if (!index.has(options.collection))
|
|
96
|
+
index.set(options.collection, kind);
|
|
97
|
+
}
|
|
98
|
+
return index;
|
|
99
|
+
}
|
|
100
|
+
/* ------------------------------------------------------------------------ */
|
|
101
|
+
const describeInput = z.object({
|
|
102
|
+
collection: z.string().describe('The content type\'s slug, e.g. "posts".'),
|
|
103
|
+
});
|
|
104
|
+
export function createDescribeContentTypeTool(deps) {
|
|
105
|
+
const canUse = deps.canUse ?? defaultCanUse;
|
|
106
|
+
return {
|
|
107
|
+
...CONTENT_READ_TOOLS.describeContentType,
|
|
108
|
+
inputSchema: describeInput,
|
|
109
|
+
handler: async (input, ctx) => {
|
|
110
|
+
const refused = refusal(ctx, canUse);
|
|
111
|
+
if (refused)
|
|
112
|
+
return refused;
|
|
113
|
+
const options = deps.collections[input.collection];
|
|
114
|
+
const config = deps.payload.collections[input.collection]?.config;
|
|
115
|
+
if (!options || !config)
|
|
116
|
+
return unknownCollection(deps, input.collection);
|
|
117
|
+
const describeCtx = {
|
|
118
|
+
blocks: blockRegistry(deps.payload),
|
|
119
|
+
req: await requestAs(deps.payload, ctx),
|
|
120
|
+
findWith: findWithIndex(deps.related),
|
|
121
|
+
};
|
|
122
|
+
const labels = config.labels;
|
|
123
|
+
return {
|
|
124
|
+
collection: input.collection,
|
|
125
|
+
...(typeof labels.singular === 'string' ? { label: labels.singular } : {}),
|
|
126
|
+
drafts: Boolean(config.versions && config.versions.drafts),
|
|
127
|
+
fields: await describeFields(writableFields(config.fields, options.fields), describeCtx),
|
|
128
|
+
...(options.templateDraws?.length
|
|
129
|
+
? {
|
|
130
|
+
templateDraws: options.templateDraws,
|
|
131
|
+
templateNote: 'The page template draws these itself from the document\'s own fields. Do not add them to a blocks field.',
|
|
132
|
+
}
|
|
133
|
+
: {}),
|
|
134
|
+
publishing: {
|
|
135
|
+
requires: options.publishRequires ?? [],
|
|
136
|
+
howTo: 'Writes are drafts. Run get_publish_status for the full preflight before offering to publish; going live is publish, schedule_publish or request_approval.',
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/* ------------------------------------------------------------------------ */
|
|
143
|
+
const findInput = z.object({
|
|
144
|
+
collection: z.string().describe('The content type\'s slug, e.g. "pages".'),
|
|
145
|
+
query: z
|
|
146
|
+
.string()
|
|
147
|
+
.optional()
|
|
148
|
+
.describe('A few letters of the title or slug. Omit for the most recently changed.'),
|
|
149
|
+
limit: z.number().int().positive().max(50).optional().describe('Default: 10.'),
|
|
150
|
+
});
|
|
151
|
+
export function createFindDocumentsTool(deps) {
|
|
152
|
+
const canUse = deps.canUse ?? defaultCanUse;
|
|
153
|
+
return {
|
|
154
|
+
...CONTENT_READ_TOOLS.findDocuments,
|
|
155
|
+
inputSchema: findInput,
|
|
156
|
+
handler: async (input, ctx) => {
|
|
157
|
+
const refused = refusal(ctx, canUse);
|
|
158
|
+
if (refused)
|
|
159
|
+
return refused;
|
|
160
|
+
const config = deps.payload.collections[input.collection]?.config;
|
|
161
|
+
if (!deps.collections[input.collection] || !config) {
|
|
162
|
+
return unknownCollection(deps, input.collection);
|
|
163
|
+
}
|
|
164
|
+
const titleField = titleFieldOf(deps.payload, input.collection);
|
|
165
|
+
const q = input.query?.trim() ?? '';
|
|
166
|
+
const hasSlug = config.flattenedFields.some((field) => field.name === 'slug');
|
|
167
|
+
const where = q
|
|
168
|
+
? {
|
|
169
|
+
or: [
|
|
170
|
+
{ [titleField]: { like: q } },
|
|
171
|
+
...(hasSlug ? [{ slug: { like: q } }] : []),
|
|
172
|
+
],
|
|
173
|
+
}
|
|
174
|
+
: undefined;
|
|
175
|
+
const drafts = Boolean(config.versions && config.versions.drafts);
|
|
176
|
+
const req = await requestAs(deps.payload, ctx);
|
|
177
|
+
const { docs } = await deps.payload.find({
|
|
178
|
+
collection: input.collection,
|
|
179
|
+
...(where ? { where } : {}),
|
|
180
|
+
limit: input.limit ?? 10,
|
|
181
|
+
depth: 0,
|
|
182
|
+
sort: '-updatedAt',
|
|
183
|
+
...(drafts ? { draft: true } : {}),
|
|
184
|
+
overrideAccess: false,
|
|
185
|
+
user: userOf(ctx),
|
|
186
|
+
req,
|
|
187
|
+
});
|
|
188
|
+
const results = await Promise.all(docs.map(async (doc) => {
|
|
189
|
+
const value = doc[titleField];
|
|
190
|
+
const title = typeof value === 'string' && value !== '' ? value : 'Untitled';
|
|
191
|
+
const id = doc['id'];
|
|
192
|
+
return {
|
|
193
|
+
id,
|
|
194
|
+
title,
|
|
195
|
+
...(typeof doc['slug'] === 'string' ? { slug: doc['slug'] } : {}),
|
|
196
|
+
...(typeof doc['_status'] === 'string' ? { status: doc['_status'] } : {}),
|
|
197
|
+
updatedAt: doc['updatedAt'],
|
|
198
|
+
adminUrl: adminUrl(deps.payload, input.collection, id),
|
|
199
|
+
previewUrl: await previewUrl(deps.payload, input.collection, doc, req),
|
|
200
|
+
...(q ? { rank: matchRank(title, q) } : {}),
|
|
201
|
+
};
|
|
202
|
+
}));
|
|
203
|
+
// Best title match first when there is a query, newest first within a rank.
|
|
204
|
+
if (q)
|
|
205
|
+
results.sort((a, b) => (a.rank ?? 0) - (b.rank ?? 0));
|
|
206
|
+
return { collection: input.collection, ...(q ? { query: q } : {}), results };
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
/* ------------------------------------------------------------------------ */
|
|
211
|
+
const relatedInput = z.object({
|
|
212
|
+
kind: z.string().describe('What to look up, e.g. "people" or "media": a field\'s `findWith`.'),
|
|
213
|
+
query: z.string().optional().describe('A few letters of its name. Omit to list the newest.'),
|
|
214
|
+
where: z
|
|
215
|
+
.record(z.string(), z.union([z.string(), z.number(), z.boolean()]))
|
|
216
|
+
.optional()
|
|
217
|
+
.describe('Exact matches on the fields this kind may be filtered by, e.g. { "type": "topic" }.'),
|
|
218
|
+
limit: z.number().int().positive().max(50).optional().describe('Default: 10.'),
|
|
219
|
+
});
|
|
220
|
+
/** What an upload result adds: enough to choose an image and describe it. */
|
|
221
|
+
function uploadFacts(doc) {
|
|
222
|
+
const facts = {};
|
|
223
|
+
for (const key of ['alt', 'filename', 'mimeType', 'width', 'height', 'url']) {
|
|
224
|
+
if (doc[key] !== undefined && doc[key] !== null)
|
|
225
|
+
facts[key] = doc[key];
|
|
226
|
+
}
|
|
227
|
+
return facts;
|
|
228
|
+
}
|
|
229
|
+
export function createFindRelatedTool(deps) {
|
|
230
|
+
const canUse = deps.canUse ?? defaultCanUse;
|
|
231
|
+
return {
|
|
232
|
+
...CONTENT_READ_TOOLS.findRelated,
|
|
233
|
+
inputSchema: relatedInput,
|
|
234
|
+
handler: async (input, ctx) => {
|
|
235
|
+
const refused = refusal(ctx, canUse);
|
|
236
|
+
if (refused)
|
|
237
|
+
return refused;
|
|
238
|
+
const kind = deps.related[input.kind];
|
|
239
|
+
if (!kind) {
|
|
240
|
+
return {
|
|
241
|
+
error: `There is no kind "${input.kind}". Kinds: ${Object.keys(deps.related).join(', ') || 'none'}.`,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
const allowed = new Set(kind.filters ?? []);
|
|
245
|
+
const refusedFilters = Object.keys(input.where ?? {}).filter((key) => !allowed.has(key));
|
|
246
|
+
if (refusedFilters.length > 0) {
|
|
247
|
+
return {
|
|
248
|
+
error: `"${input.kind}" cannot be filtered by ${refusedFilters.join(', ')}. It can be filtered by: ${[...allowed].join(', ') || 'nothing'}.`,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
const config = deps.payload.collections[kind.collection]?.config;
|
|
252
|
+
if (!config)
|
|
253
|
+
return { error: `The collection behind "${input.kind}" is not configured.` };
|
|
254
|
+
const titleField = titleFieldOf(deps.payload, kind.collection);
|
|
255
|
+
const q = input.query?.trim() ?? '';
|
|
256
|
+
const and = Object.entries(input.where ?? {}).map(([key, value]) => ({
|
|
257
|
+
[key]: { equals: value },
|
|
258
|
+
}));
|
|
259
|
+
if (q) {
|
|
260
|
+
const searched = kind.searchFields?.length ? kind.searchFields : [titleField];
|
|
261
|
+
and.push(searched.length === 1
|
|
262
|
+
? { [searched[0]]: { like: q } }
|
|
263
|
+
: { or: searched.map((field) => ({ [field]: { like: q } })) });
|
|
264
|
+
}
|
|
265
|
+
const { docs } = await deps.payload.find({
|
|
266
|
+
collection: kind.collection,
|
|
267
|
+
...(and.length ? { where: { and } } : {}),
|
|
268
|
+
limit: input.limit ?? 10,
|
|
269
|
+
depth: 0,
|
|
270
|
+
sort: '-updatedAt',
|
|
271
|
+
overrideAccess: false,
|
|
272
|
+
user: userOf(ctx),
|
|
273
|
+
});
|
|
274
|
+
const isUpload = Boolean(config.upload);
|
|
275
|
+
const results = docs.map((doc) => {
|
|
276
|
+
const value = doc[titleField];
|
|
277
|
+
const title = typeof value === 'string' && value !== '' ? value : String(doc['id']);
|
|
278
|
+
return {
|
|
279
|
+
id: doc['id'],
|
|
280
|
+
title,
|
|
281
|
+
...Object.fromEntries((kind.filters ?? []).map((key) => [key, doc[key]])),
|
|
282
|
+
...(isUpload ? uploadFacts(doc) : {}),
|
|
283
|
+
...(q ? { rank: matchRank(title, q) } : {}),
|
|
284
|
+
};
|
|
285
|
+
});
|
|
286
|
+
if (q)
|
|
287
|
+
results.sort((a, b) => (a.rank ?? 0) - (b.rank ?? 0));
|
|
288
|
+
return { kind: input.kind, collection: kind.collection, results };
|
|
289
|
+
},
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
/* ------------------------------------------------------------------------ */
|
|
293
|
+
const getInput = z.object({
|
|
294
|
+
collection: z.string().describe('The content type\'s slug, e.g. "posts".'),
|
|
295
|
+
id: z.union([z.string(), z.number()]).describe('The document id, from find_documents.'),
|
|
296
|
+
draft: z
|
|
297
|
+
.boolean()
|
|
298
|
+
.optional()
|
|
299
|
+
.describe('The latest draft (default), or false for the published version.'),
|
|
300
|
+
});
|
|
301
|
+
/** The authored fields of a document, as the write tools take them. */
|
|
302
|
+
export function toWriteShape(doc, fieldNames) {
|
|
303
|
+
const out = {};
|
|
304
|
+
for (const name of fieldNames) {
|
|
305
|
+
if (doc[name] !== undefined)
|
|
306
|
+
out[name] = doc[name];
|
|
307
|
+
}
|
|
308
|
+
return out;
|
|
309
|
+
}
|
|
310
|
+
export function createGetDocumentTool(deps) {
|
|
311
|
+
const canUse = deps.canUse ?? defaultCanUse;
|
|
312
|
+
return {
|
|
313
|
+
...CONTENT_READ_TOOLS.getDocument,
|
|
314
|
+
inputSchema: getInput,
|
|
315
|
+
handler: async (input, ctx) => {
|
|
316
|
+
const refused = refusal(ctx, canUse);
|
|
317
|
+
if (refused)
|
|
318
|
+
return refused;
|
|
319
|
+
const options = deps.collections[input.collection];
|
|
320
|
+
const config = deps.payload.collections[input.collection]?.config;
|
|
321
|
+
if (!options || !config)
|
|
322
|
+
return unknownCollection(deps, input.collection);
|
|
323
|
+
const drafts = Boolean(config.versions && config.versions.drafts);
|
|
324
|
+
const req = await requestAs(deps.payload, ctx);
|
|
325
|
+
const doc = (await deps.payload.findByID({
|
|
326
|
+
collection: input.collection,
|
|
327
|
+
id: input.id,
|
|
328
|
+
depth: 0,
|
|
329
|
+
...(drafts ? { draft: input.draft ?? true } : {}),
|
|
330
|
+
overrideAccess: false,
|
|
331
|
+
user: userOf(ctx),
|
|
332
|
+
disableErrors: true,
|
|
333
|
+
req,
|
|
334
|
+
}));
|
|
335
|
+
if (!doc) {
|
|
336
|
+
return { error: `No ${input.collection} document ${input.id} that you can read.` };
|
|
337
|
+
}
|
|
338
|
+
const names = writableFields(config.fields, options.fields).map((field) => field.name);
|
|
339
|
+
return {
|
|
340
|
+
collection: input.collection,
|
|
341
|
+
id: doc['id'],
|
|
342
|
+
...(typeof doc['_status'] === 'string' ? { status: doc['_status'] } : {}),
|
|
343
|
+
updatedAt: doc['updatedAt'],
|
|
344
|
+
adminUrl: adminUrl(deps.payload, input.collection, doc['id']),
|
|
345
|
+
previewUrl: await previewUrl(deps.payload, input.collection, doc, req),
|
|
346
|
+
data: toWriteShape(doc, names),
|
|
347
|
+
};
|
|
348
|
+
},
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
export function createContentReadTools(deps) {
|
|
352
|
+
return [
|
|
353
|
+
createDescribeContentTypeTool(deps),
|
|
354
|
+
createFindDocumentsTool(deps),
|
|
355
|
+
createFindRelatedTool(deps),
|
|
356
|
+
createGetDocumentTool(deps),
|
|
357
|
+
];
|
|
358
|
+
}
|
|
359
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/content/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EACL,cAAc,GAMf,MAAM,SAAS,CAAA;AAGhB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAwB,MAAM,eAAe,CAAA;AAGpF;;;;;;;EAOE;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,mBAAmB,EAAE;QACnB,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EACT,2cAA2c;KAC9c;IACD,aAAa,EAAE;QACb,IAAI,EAAE,gBAAgB;QACtB,WAAW,EACT,mUA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AG,CAC7D,CAAC,KAAK,EAAE,EAAE,CAAE,KAA0B,CAAC,IAAI,CAC5C,CAAA;YACD,OAAO;gBACL,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC;gBACb,GAAG,CAAC,OAAO,GAAG,CAAC,SAAS,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACzE,SAAS,EAAE,GAAG,CAAC,WAAW,CAAC;gBAC3B,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC,IAAI,CAAoB,CAAC;gBAChF,UAAU,EAAE,MAAM,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,EAAE,GAAG,EAAE,GAAG,CAAC;gBACtE,IAAI,EAAE,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC;aAC/B,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAqB;IAC1D,OAAO;QACL,6BAA6B,CAAC,IAAI,CAAC;QACnC,uBAAuB,CAAC,IAAI,CAAC;QAC7B,qBAAqB,CAAC,IAAI,CAAC;QAC3B,qBAAqB,CAAC,IAAI,CAAC;KACM,CAAA;AACrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-server.d.ts","sourceRoot":"","sources":["../../src/mcp/audit-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"audit-server.d.ts","sourceRoot":"","sources":["../../src/mcp/audit-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAkD1E;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAW7E;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAS3D"}
|
package/dist/mcp/audit-server.js
CHANGED
|
@@ -19,6 +19,7 @@ names line up. The seventh does not:
|
|
|
19
19
|
references references
|
|
20
20
|
fields fields
|
|
21
21
|
observability observability
|
|
22
|
+
content content
|
|
22
23
|
- payload
|
|
23
24
|
|
|
24
25
|
So `mcpServer: serverName as AuditMcpServer` compiles and is wrong for the
|
|
@@ -43,6 +44,7 @@ const AUDIT_SERVER_BY_COLLECTOR_NAME = {
|
|
|
43
44
|
references: 'references',
|
|
44
45
|
fields: 'fields',
|
|
45
46
|
observability: 'observability',
|
|
47
|
+
content: 'content',
|
|
46
48
|
};
|
|
47
49
|
/**
|
|
48
50
|
* The audit log's name for a collector server name, or `undefined` if there
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-server.js","sourceRoot":"","sources":["../../src/mcp/audit-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,mBAAmB,CAAA;AAE1E
|
|
1
|
+
{"version":3,"file":"audit-server.js","sourceRoot":"","sources":["../../src/mcp/audit-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,mBAAmB,CAAA;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCE;AACF,MAAM,8BAA8B,GAA6C;IAC/E,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,WAAW;IACvB,KAAK,EAAE,OAAO;IACd,YAAY,EAAE,cAAc;IAC5B,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,MAAM,EAAE,QAAQ;IAChB,aAAa,EAAE,eAAe;IAC9B,OAAO,EAAE,SAAS;CACnB,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,UAAkB;IAC/C;;;;;;MAME;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,8BAA8B,EAAE,UAAU,CAAC;QAC9D,CAAC,CAAC,8BAA8B,CAAC,UAAU,CAAC;QAC5C,CAAC,CAAC,SAAS,CAAA;AACf,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IACjD,OAAO,CACL,eAAe,UAAU,8DAA8D;QACvF,gFAAgF;QAChF,0BAA0B,MAAM,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;QACpF,sBAAsB,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,UAAU,kBAAkB;QACxF,+GAA+G;QAC/G,4EAA4E,CAC7E,CAAA;AACH,CAAC"}
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"BUILT_IN_ACCESSIBILITY_CHECKS": ["@forumone/throughline/publishing"],
|
|
43
43
|
"BaseCorePluginOptions": ["@forumone/throughline"],
|
|
44
44
|
"BaseWorkflowOptions": ["@forumone/throughline/jobs"],
|
|
45
|
+
"BlockDescription": ["@forumone/throughline/content"],
|
|
45
46
|
"BuildActionUrlArgs": ["@forumone/throughline/email"],
|
|
46
47
|
"BuildJobFailureReportInput": ["@forumone/throughline/observability"],
|
|
47
48
|
"BuildRequestErrorReportOptions": ["@forumone/throughline/observability"],
|
|
@@ -52,6 +53,8 @@
|
|
|
52
53
|
"COMMAND_PALETTE_PATH": ["@forumone/throughline/editorial"],
|
|
53
54
|
"CONTENT_CALENDAR_VIEW_PATH": ["@forumone/throughline/editorial"],
|
|
54
55
|
"CONTENT_HEALTH_VIEW_PATH": ["@forumone/throughline/editorial"],
|
|
56
|
+
"CONTENT_READ_TOOLS": ["@forumone/throughline/content"],
|
|
57
|
+
"CONTENT_READ_TOOL_DESCRIPTORS": ["@forumone/throughline/content"],
|
|
55
58
|
"CacheTagScheme": ["@forumone/throughline/cache-tags"],
|
|
56
59
|
"CacheTags": ["@forumone/throughline/cache-tags"],
|
|
57
60
|
"CalendarClock": ["@forumone/throughline/editorial"],
|
|
@@ -73,8 +76,11 @@
|
|
|
73
76
|
"ConfigInput": ["@forumone/throughline/testing"],
|
|
74
77
|
"ContentCalendarReport": ["@forumone/throughline/rsc"],
|
|
75
78
|
"ContentCalendarView": ["@forumone/throughline/rsc"],
|
|
79
|
+
"ContentCollectionOptions": ["@forumone/throughline/content"],
|
|
76
80
|
"ContentHealthReport": ["@forumone/throughline/rsc"],
|
|
77
81
|
"ContentHealthView": ["@forumone/throughline/rsc"],
|
|
82
|
+
"ContentPluginOptions": ["@forumone/throughline/content"],
|
|
83
|
+
"ContentToolDeps": ["@forumone/throughline/content"],
|
|
78
84
|
"CoreEvents": ["@forumone/throughline/jobs"],
|
|
79
85
|
"CorePlugin": ["@forumone/throughline"],
|
|
80
86
|
"CreateActionEndpointDeps": ["@forumone/throughline/approvals"],
|
|
@@ -89,6 +95,7 @@
|
|
|
89
95
|
"DEFAULT_REPORTED_HEADERS": ["@forumone/throughline/observability"],
|
|
90
96
|
"DERIVED_WRITE_CONTEXT": ["@forumone/throughline/publishing"],
|
|
91
97
|
"DescribeAnonymousAccessOptions": ["@forumone/throughline/testing"],
|
|
98
|
+
"DescribeContext": ["@forumone/throughline/content"],
|
|
92
99
|
"DocumentActionArgs": ["@forumone/throughline/publishing"],
|
|
93
100
|
"DocumentContentHashOptions": ["@forumone/throughline"],
|
|
94
101
|
"DocumentReferences": ["@forumone/throughline/media"],
|
|
@@ -114,6 +121,7 @@
|
|
|
114
121
|
"FailureAwareOptions": ["@forumone/throughline/jobs"],
|
|
115
122
|
"FailureHandlerOptions": ["@forumone/throughline/jobs"],
|
|
116
123
|
"FetchSyncStatusArgs": ["@forumone/throughline/client"],
|
|
124
|
+
"FieldDescription": ["@forumone/throughline/content"],
|
|
117
125
|
"FindContentNeedingAttentionOptions": ["@forumone/throughline/editorial"],
|
|
118
126
|
"FindReferencesOptions": ["@forumone/throughline/media"],
|
|
119
127
|
"FormattedAuditEvent": ["@forumone/throughline/audit"],
|
|
@@ -231,6 +239,7 @@
|
|
|
231
239
|
"ReferenceToolDeps": ["@forumone/throughline/media"],
|
|
232
240
|
"ReferencesInOptions": ["@forumone/throughline/media"],
|
|
233
241
|
"ReferencesPluginOptions": ["@forumone/throughline/media"],
|
|
242
|
+
"RelatedKindOptions": ["@forumone/throughline/content"],
|
|
234
243
|
"Report": ["@forumone/throughline/editorial"],
|
|
235
244
|
"ReportDeployment": ["@forumone/throughline/observability"],
|
|
236
245
|
"ReportableHeaders": ["@forumone/throughline/observability"],
|
|
@@ -324,6 +333,7 @@
|
|
|
324
333
|
"clientPrefix": ["@forumone/throughline/observability"],
|
|
325
334
|
"clockFor": ["@forumone/throughline/editorial"],
|
|
326
335
|
"componentsPlugin": ["@forumone/throughline/components"],
|
|
336
|
+
"contentPlugin": ["@forumone/throughline/content"],
|
|
327
337
|
"contentRevisedAt": ["@forumone/throughline/fields"],
|
|
328
338
|
"couldReference": ["@forumone/throughline/media"],
|
|
329
339
|
"counterFor": ["@forumone/throughline/fields"],
|
|
@@ -335,12 +345,17 @@
|
|
|
335
345
|
"createCacheTags": ["@forumone/throughline/cache-tags"],
|
|
336
346
|
"createCanDeleteTool": ["@forumone/throughline/media"],
|
|
337
347
|
"createCheckSlugTool": ["@forumone/throughline/fields"],
|
|
348
|
+
"createContentReadTools": ["@forumone/throughline/content"],
|
|
349
|
+
"createDescribeContentTypeTool": ["@forumone/throughline/content"],
|
|
338
350
|
"createEmailClient": ["@forumone/throughline/email"],
|
|
339
351
|
"createErrorReporter": ["@forumone/throughline/observability"],
|
|
340
352
|
"createFindContentNeedingAttentionTool": ["@forumone/throughline/editorial"],
|
|
353
|
+
"createFindDocumentsTool": ["@forumone/throughline/content"],
|
|
341
354
|
"createFindReferencesTool": ["@forumone/throughline/media"],
|
|
355
|
+
"createFindRelatedTool": ["@forumone/throughline/content"],
|
|
342
356
|
"createGetChangeHistoryTool": ["@forumone/throughline/audit"],
|
|
343
357
|
"createGetContentCalendarTool": ["@forumone/throughline/editorial"],
|
|
358
|
+
"createGetDocumentTool": ["@forumone/throughline/content"],
|
|
344
359
|
"createGetIntegrationStatusTool": ["@forumone/throughline/integrations"],
|
|
345
360
|
"createGetRecentFailuresTool": ["@forumone/throughline/audit"],
|
|
346
361
|
"createHealthcheckFailureHandler": ["@forumone/throughline/jobs"],
|
|
@@ -375,6 +390,8 @@
|
|
|
375
390
|
"describeAnonymousAccess": ["@forumone/throughline/testing"],
|
|
376
391
|
"describeBlock": ["@forumone/throughline/client"],
|
|
377
392
|
"describeErrorReporting": ["@forumone/throughline/observability"],
|
|
393
|
+
"describeField": ["@forumone/throughline/content"],
|
|
394
|
+
"describeFields": ["@forumone/throughline/content"],
|
|
378
395
|
"describeReferences": ["@forumone/throughline/media"],
|
|
379
396
|
"describeSyncOutcome": ["@forumone/throughline/client"],
|
|
380
397
|
"documentContentHash": ["@forumone/throughline"],
|
|
@@ -492,11 +509,14 @@
|
|
|
492
509
|
"syncHasFinished": ["@forumone/throughline/client"],
|
|
493
510
|
"throughline": ["@forumone/throughline"],
|
|
494
511
|
"titleOf": ["@forumone/throughline/fields"],
|
|
512
|
+
"toWriteShape": ["@forumone/throughline/content"],
|
|
495
513
|
"toolCalendar": ["@forumone/throughline/editorial"],
|
|
496
514
|
"toolReport": ["@forumone/throughline/editorial"],
|
|
497
515
|
"toolWork": ["@forumone/throughline/editorial"],
|
|
516
|
+
"topLevelFields": ["@forumone/throughline/content"],
|
|
498
517
|
"triggerSync": ["@forumone/throughline/client"],
|
|
499
518
|
"uniqueUploadPrefix": ["@forumone/throughline/media"],
|
|
519
|
+
"unknownFieldNames": ["@forumone/throughline/content"],
|
|
500
520
|
"unlistedField": ["@forumone/throughline/fields"],
|
|
501
521
|
"unpublishDocument": ["@forumone/throughline/publishing"],
|
|
502
522
|
"unscheduleDocument": ["@forumone/throughline/publishing"],
|
|
@@ -506,7 +526,8 @@
|
|
|
506
526
|
"verifyActionToken": ["@forumone/throughline/approvals"],
|
|
507
527
|
"webhookIntegration": ["@forumone/throughline/integrations"],
|
|
508
528
|
"whereQuery": ["@forumone/throughline/editorial"],
|
|
509
|
-
"withMeta": ["@forumone/throughline"]
|
|
529
|
+
"withMeta": ["@forumone/throughline"],
|
|
530
|
+
"writableFields": ["@forumone/throughline/content"]
|
|
510
531
|
},
|
|
511
532
|
"@forumone/throughline-design-system": {
|
|
512
533
|
"ArrangeOptions": ["@forumone/throughline-design-system/generate"],
|
package/dist/throughline.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { CollectionSlug, Plugin } from 'payload';
|
|
|
2
2
|
import type { ApprovalsPluginOptions } from './approvals/options.js';
|
|
3
3
|
import { type AuditPluginOptions } from './audit/plugin.js';
|
|
4
4
|
import type { AuditQueryPluginOptions } from './audit/query/options.js';
|
|
5
|
+
import type { ContentCollectionOptions, ContentPluginOptions } from './content/options.js';
|
|
5
6
|
import type { ComponentsPluginOptions } from './components/options.js';
|
|
6
7
|
import { type EditorialPluginOptions } from './editorial/plugin.js';
|
|
7
8
|
import type { WorkOptions } from './editorial/work/work.js';
|
|
@@ -65,6 +66,12 @@ export interface ThroughlineOptions {
|
|
|
65
66
|
integrations?: Omit<IntegrationsPluginOptions, Supplied | 'onTerminalFailure'>;
|
|
66
67
|
/** On when present: what refers to a document, and the delete guards. */
|
|
67
68
|
references?: Omit<ReferencesPluginOptions, Supplied>;
|
|
69
|
+
/**
|
|
70
|
+
* On when present: the content tools, which read and write drafts of the
|
|
71
|
+
* collections named here. Each collection's publish requirements are filled
|
|
72
|
+
* in from `publishing` when it is on.
|
|
73
|
+
*/
|
|
74
|
+
content?: Omit<ContentPluginOptions, Supplied>;
|
|
68
75
|
/** On when present: content health, the calendar, "Your work" and the palette. */
|
|
69
76
|
editorial?: Omit<EditorialPluginOptions, Supplied | 'work'> & {
|
|
70
77
|
work?: Omit<WorkOptions, 'collections'> & {
|
|
@@ -113,6 +120,7 @@ export interface ThroughlineSuite {
|
|
|
113
120
|
*/
|
|
114
121
|
export declare const publishScheduledThroughPipeline: ScheduledPublish;
|
|
115
122
|
export declare function throughline(options: ThroughlineOptions): ThroughlineSuite;
|
|
123
|
+
export declare function withPublishRequirements(collections: Readonly<Record<string, ContentCollectionOptions>>, publishing: ThroughlinePublishingOptions | undefined): Record<string, ContentCollectionOptions>;
|
|
116
124
|
/**
|
|
117
125
|
* An approval link signed with approvals' secret, against approvals' public
|
|
118
126
|
* URL: what every site wrote by hand. Each is read when a link is built, so an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throughline.d.ts","sourceRoot":"","sources":["../src/throughline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAU,MAAM,EAAE,MAAM,SAAS,CAAA;AAI7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAGpE,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAGxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"throughline.d.ts","sourceRoot":"","sources":["../src/throughline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAU,MAAM,EAAE,MAAM,SAAS,CAAA;AAI7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAGpE,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAGxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAGvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC1F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAA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AAG,aAAa,GAAG,SAAS,CAAC,CAAA;KACjG,CAAA;CACF;AAED,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAA;IACd,uFAAuF;IACvF,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,+GAA+G;IAC/G,IAAI,EAAE,GAAG,EAAE,CAAA;CACZ;AAED;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,EAAE,gBAW7C,CAAA;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,gBAAgB,CA6HzE;AAQD,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC,EAC/D,UAAU,EAAE,4BAA4B,GAAG,SAAS,GACnD,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAkB1C;AA6CD;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,IAAI,CAAC,sBAAsB,EAAE,aAAa,GAAG,WAAW,CAAC,GACnE,kBAAkB,CAAC,gBAAgB,CAAC,CAkBtC"}
|
package/dist/throughline.js
CHANGED
|
@@ -7,6 +7,7 @@ import { auditPlugin } from './audit/plugin.js';
|
|
|
7
7
|
import { DEFAULT_AUDIT_SLUG } from './audit/collection.js';
|
|
8
8
|
import { auditQueryPlugin } from './audit/query/plugin.js';
|
|
9
9
|
import { componentsPlugin } from './components/plugin.js';
|
|
10
|
+
import { contentPlugin } from './content/plugin.js';
|
|
10
11
|
import { editorialPlugin } from './editorial/plugin.js';
|
|
11
12
|
import { emailJobs, emailPlugin } from './email/plugin.js';
|
|
12
13
|
import { fieldsPlugin } from './fields/checkSlug.js';
|
|
@@ -117,6 +118,13 @@ export function throughline(options) {
|
|
|
117
118
|
plugins.push(referencesPlugin({ ...options.references, mcpTools }));
|
|
118
119
|
}
|
|
119
120
|
plugins.push(fieldsPlugin({ ...options.fields, mcpTools }));
|
|
121
|
+
if (options.content) {
|
|
122
|
+
plugins.push(contentPlugin({
|
|
123
|
+
...options.content,
|
|
124
|
+
collections: withPublishRequirements(options.content.collections, options.publishing),
|
|
125
|
+
mcpTools,
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
120
128
|
if (options.editorial) {
|
|
121
129
|
const { work, ...rest } = options.editorial;
|
|
122
130
|
plugins.push(editorialPlugin({ ...rest, work: { ...work, collections }, mcpTools }));
|
|
@@ -132,6 +140,30 @@ export function throughline(options) {
|
|
|
132
140
|
};
|
|
133
141
|
return { plugin, mcpTools: mcpTools.tools, jobs };
|
|
134
142
|
}
|
|
143
|
+
/*
|
|
144
|
+
What the publish pipeline's required-fields step will ask of each collection,
|
|
145
|
+
said once here rather than by the site: the SEO group's title and description,
|
|
146
|
+
the slug, and the collection's own `requiredFields`. A site's own
|
|
147
|
+
`publishRequires` comes after them.
|
|
148
|
+
*/
|
|
149
|
+
export function withPublishRequirements(collections, publishing) {
|
|
150
|
+
if (!publishing)
|
|
151
|
+
return { ...collections };
|
|
152
|
+
const seo = publishing.seoField ?? 'seo';
|
|
153
|
+
return Object.fromEntries(Object.entries(collections).map(([slug, entry]) => {
|
|
154
|
+
const own = publishing.collectionOptions?.[slug];
|
|
155
|
+
const field = own?.seoField ?? seo;
|
|
156
|
+
const requires = [
|
|
157
|
+
`${field}.title`,
|
|
158
|
+
`${field}.description`,
|
|
159
|
+
own?.slugField ?? 'slug',
|
|
160
|
+
...(own?.requiredFields ?? []).map((required) => `${required.path}: ${required.message}`),
|
|
161
|
+
'Alt text on every image, a heading order that does not skip levels, and a label on every link.',
|
|
162
|
+
...(entry.publishRequires ?? []),
|
|
163
|
+
];
|
|
164
|
+
return [slug, { ...entry, publishRequires: requires }];
|
|
165
|
+
}));
|
|
166
|
+
}
|
|
135
167
|
function suiteJobs(options, shared) {
|
|
136
168
|
const jobs = [];
|
|
137
169
|
const scheduled = options.collections.map((slug) => ({ slug }));
|