@forumone/throughline 1.3.0 → 1.4.0-next-a7a9a8c

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.
@@ -0,0 +1,119 @@
1
+ import { z } from 'zod';
2
+ import type { AuditWriter } from '../audit/writer.js';
3
+ import type { McpToolContext, McpToolDefinition } from '../plugin-contract/index.js';
4
+ import type { McpToolDescriptor } from '../mcp/collector.js';
5
+ import { type McpMeta } from '../mcp/meta.js';
6
+ import { type ContentToolDeps } from './tools.js';
7
+ export declare const CONTENT_WRITE_TOOLS: {
8
+ readonly createDraft: {
9
+ readonly name: "create_draft";
10
+ readonly description: "Creates a new draft of a content type from the fields `describe_content_type` lists. Never published: the result is a draft with an admin link and a preview link, and going live is publish, schedule_publish or request_approval. A slug is made from the title when none is given, and one already taken (the trash included) is refused with a free alternative. Blocks must be ones the field accepts, and the layout must pass the composition rules.";
11
+ };
12
+ readonly updateDraft: {
13
+ readonly name: "update_draft";
14
+ readonly description: "Changes fields of a document's draft, leaving the rest as they are. A group is merged (setting meta.title keeps meta.description); an array or a blocks field is replaced whole. Refused while somebody has the document open in the admin. The published version is untouched until it is published again.";
15
+ };
16
+ };
17
+ export declare const CONTENT_WRITE_TOOL_DESCRIPTORS: readonly McpToolDescriptor[];
18
+ export interface ContentWriteDeps extends ContentToolDeps {
19
+ audit?: AuditWriter;
20
+ }
21
+ declare const createInput: z.ZodObject<{
22
+ collection: z.ZodString;
23
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
24
+ } & {
25
+ _meta: z.ZodOptional<z.ZodObject<{
26
+ userPrompt: z.ZodOptional<z.ZodString>;
27
+ reasoning: z.ZodOptional<z.ZodString>;
28
+ changesSummary: z.ZodOptional<z.ZodString>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ reasoning?: string | undefined;
31
+ changesSummary?: string | undefined;
32
+ userPrompt?: string | undefined;
33
+ }, {
34
+ reasoning?: string | undefined;
35
+ changesSummary?: string | undefined;
36
+ userPrompt?: string | undefined;
37
+ }>>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ collection: string;
40
+ data: Record<string, unknown>;
41
+ _meta?: {
42
+ reasoning?: string | undefined;
43
+ changesSummary?: string | undefined;
44
+ userPrompt?: string | undefined;
45
+ } | undefined;
46
+ }, {
47
+ collection: string;
48
+ data: Record<string, unknown>;
49
+ _meta?: {
50
+ reasoning?: string | undefined;
51
+ changesSummary?: string | undefined;
52
+ userPrompt?: string | undefined;
53
+ } | undefined;
54
+ }>;
55
+ declare const updateInput: z.ZodObject<{
56
+ collection: z.ZodString;
57
+ id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
58
+ patch: z.ZodRecord<z.ZodString, z.ZodUnknown>;
59
+ } & {
60
+ _meta: z.ZodOptional<z.ZodObject<{
61
+ userPrompt: z.ZodOptional<z.ZodString>;
62
+ reasoning: z.ZodOptional<z.ZodString>;
63
+ changesSummary: z.ZodOptional<z.ZodString>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ reasoning?: string | undefined;
66
+ changesSummary?: string | undefined;
67
+ userPrompt?: string | undefined;
68
+ }, {
69
+ reasoning?: string | undefined;
70
+ changesSummary?: string | undefined;
71
+ userPrompt?: string | undefined;
72
+ }>>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ collection: string;
75
+ id: string | number;
76
+ patch: Record<string, unknown>;
77
+ _meta?: {
78
+ reasoning?: string | undefined;
79
+ changesSummary?: string | undefined;
80
+ userPrompt?: string | undefined;
81
+ } | undefined;
82
+ }, {
83
+ collection: string;
84
+ id: string | number;
85
+ patch: Record<string, unknown>;
86
+ _meta?: {
87
+ reasoning?: string | undefined;
88
+ changesSummary?: string | undefined;
89
+ userPrompt?: string | undefined;
90
+ } | undefined;
91
+ }>;
92
+ interface Checked {
93
+ error: string;
94
+ [key: string]: unknown;
95
+ }
96
+ export declare function createCreateDraftTool(deps: ContentWriteDeps): McpToolDefinition<typeof createInput>;
97
+ export declare function createUpdateDraftTool(deps: ContentWriteDeps): McpToolDefinition<typeof updateInput>;
98
+ /**
99
+ * The document's current draft, as the caller may read it — or why not: it is
100
+ * open in the admin, or there is nothing they can read.
101
+ */
102
+ export declare function openForWrite(deps: ContentWriteDeps, ctx: McpToolContext, collection: string, id: number | string): Promise<{
103
+ current: Record<string, unknown>;
104
+ } | Checked>;
105
+ /**
106
+ * Saves `data` to the document's draft as the caller, records it, and answers
107
+ * with the links. `data` holds only the top-level fields that change.
108
+ */
109
+ export declare function saveDraft(deps: ContentWriteDeps, ctx: McpToolContext, write: {
110
+ collection: string;
111
+ id: number | string;
112
+ data: Record<string, unknown>;
113
+ tool: string;
114
+ changed: readonly string[];
115
+ meta: McpMeta;
116
+ }): Promise<Record<string, unknown>>;
117
+ export declare function createContentWriteTools(deps: ContentWriteDeps): McpToolDefinition[];
118
+ export {};
119
+ //# sourceMappingURL=write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../src/content/write.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AACpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAYvD,OAAO,EAUL,KAAK,eAAe,EACrB,MAAM,YAAY,CAAA;AAenB,eAAO,MAAM,mBAAmB;;;;;;;;;CAWsB,CAAA;AAEtD,eAAO,MAAM,8BAA8B,EAAE,SAAS,iBAAiB,EACnC,CAAA;AAEpC,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,KAAK,CAAC,EAAE,WAAW,CAAA;CACpB;AAKD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKI,CAAA;AAErB,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMI,CAAA;AAErB,UAAU,OAAO;IACf,KAAK,EAAE,MAAM,CAAA;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AA2JD,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,gBAAgB,GACrB,iBAAiB,CAAC,OAAO,WAAW,CAAC,CAsEvC;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,gBAAgB,GACrB,iBAAiB,CAAC,OAAO,WAAW,CAAC,CAkDvC;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,gBAAgB,EACtB,GAAG,EAAE,cAAc,EACnB,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,MAAM,GAAG,MAAM,GAClB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,OAAO,CAAC,CAezD;AAED;;;GAGG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,gBAAgB,EACtB,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE;IACL,UAAU,EAAE,MAAM,CAAA;IAClB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1B,IAAI,EAAE,OAAO,CAAA;CACd,GACA,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAsClC;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,GAAG,iBAAiB,EAAE,CAEnF"}
@@ -0,0 +1,353 @@
1
+ import { z } from 'zod';
2
+ import { ValidationError } from 'payload';
3
+ import { withMeta } from '../mcp/meta.js';
4
+ import { checkSlug, hasSlugField } from '../fields/checkSlug.js';
5
+ import { slugify } from '../fields/slug.js';
6
+ import { topLevelFields, writableFields } from './describe.js';
7
+ import { compositionErrors, disallowedBlocks, lockHolder, lockRefusal, mergePatch, refusedFields, } from './guards.js';
8
+ import { adminUrl, blockRegistry, defaultCanUse, previewUrl, refusal, requestAs, titleFieldOf, unknownCollection, userOf, } from './tools.js';
9
+ /*
10
+ `create_draft` and `update_draft`: the step between reading the design system
11
+ and publishing, which until now only a person in the admin could take.
12
+
13
+ Drafts only. Every write is `draft: true` and none may carry `_status`, so a
14
+ document reaches the public only through the publishing tools — the same gates,
15
+ approvals and audit an editor's publish goes through. Each write runs as the
16
+ key's person with `overrideAccess: false`, refuses a document somebody has
17
+ open, checks the blocks it adds against the picker and the page against the
18
+ composition rules, and records itself in the audit log with the caller's
19
+ `_meta`.
20
+ */
21
+ export const CONTENT_WRITE_TOOLS = {
22
+ createDraft: {
23
+ name: 'create_draft',
24
+ description: 'Creates a new draft of a content type from the fields `describe_content_type` lists. Never published: the result is a draft with an admin link and a preview link, and going live is publish, schedule_publish or request_approval. A slug is made from the title when none is given, and one already taken (the trash included) is refused with a free alternative. Blocks must be ones the field accepts, and the layout must pass the composition rules.',
25
+ },
26
+ updateDraft: {
27
+ name: 'update_draft',
28
+ description: 'Changes fields of a document\'s draft, leaving the rest as they are. A group is merged (setting meta.title keeps meta.description); an array or a blocks field is replaced whole. Refused while somebody has the document open in the admin. The published version is untouched until it is published again.',
29
+ },
30
+ };
31
+ export const CONTENT_WRITE_TOOL_DESCRIPTORS = Object.values(CONTENT_WRITE_TOOLS);
32
+ const metaNote = 'Why, for the audit log: userPrompt (what was asked), reasoning, changesSummary.';
33
+ const createInput = withMeta({
34
+ collection: z.string().describe('The content type\'s slug, e.g. "pages".'),
35
+ data: z
36
+ .record(z.string(), z.unknown())
37
+ .describe('The fields to set, by name, as describe_content_type lists them.'),
38
+ }).describe(metaNote);
39
+ const updateInput = withMeta({
40
+ collection: z.string().describe('The content type\'s slug, e.g. "pages".'),
41
+ id: z.union([z.string(), z.number()]).describe('The document id.'),
42
+ patch: z
43
+ .record(z.string(), z.unknown())
44
+ .describe('Only the fields to change. A group is merged; an array or blocks field is replaced.'),
45
+ }).describe(metaNote);
46
+ /**
47
+ * The checks every write makes on the fields it carries: the allow-list, the
48
+ * blocks each blocks field may hold, and the composition of each blocks field
49
+ * as it will be saved.
50
+ */
51
+ async function checkWrite(deps, ctx, collection, data, current) {
52
+ const options = deps.collections[collection];
53
+ const refused = refusedFields(data, options.fields);
54
+ if (refused.length > 0) {
55
+ return { error: `Cannot set ${refused.map((r) => r.field).join(', ')}.`, refused };
56
+ }
57
+ const config = deps.payload.collections[collection].config;
58
+ const fields = topLevelFields(config.fields);
59
+ const req = await requestAs(deps.payload, ctx);
60
+ const registry = blockRegistry(deps.payload);
61
+ /*
62
+ A draft save skips validation, so a rich-text field handed a Markdown string
63
+ would store the string, and every renderer that expects an editor state would
64
+ fail on the page. Until a site gives the tools a converter, only an editor
65
+ state is accepted.
66
+ */
67
+ for (const field of fields) {
68
+ if (field.type !== 'richText' || !(field.name in data))
69
+ continue;
70
+ const value = data[field.name];
71
+ if (value !== null && !isEditorState(value)) {
72
+ return {
73
+ error: `${field.name} is rich text and takes an editor state ({ root: … }), as get_document returns it. Markdown and HTML are not accepted yet.`,
74
+ field: field.name,
75
+ };
76
+ }
77
+ }
78
+ for (const field of blockFields(fields, data)) {
79
+ const rows = data[field.name];
80
+ const currentRows = Array.isArray(current[field.name]) ? current[field.name] : [];
81
+ const disallowed = await disallowedBlocks(field, rows, currentRows, registry, req);
82
+ if (disallowed.length > 0) {
83
+ return {
84
+ error: `${field.name} does not accept ${disallowed.join(', ')}. describe_content_type lists the blocks it does.`,
85
+ field: field.name,
86
+ disallowed,
87
+ };
88
+ }
89
+ const issues = await compositionErrors(deps.payload, rows);
90
+ if (issues && issues.length > 0) {
91
+ return {
92
+ error: `${field.name} breaks ${issues.length} composition rule${issues.length === 1 ? '' : 's'}. Nothing was saved.`,
93
+ field: field.name,
94
+ issues,
95
+ };
96
+ }
97
+ }
98
+ return undefined;
99
+ }
100
+ function isEditorState(value) {
101
+ const root = value?.root;
102
+ return Boolean(root) && typeof root === 'object' && Array.isArray(root.children);
103
+ }
104
+ /** The top-level blocks fields `data` sets, with an array as their value. */
105
+ function blockFields(fields, data) {
106
+ return fields.filter((field) => field.type === 'blocks' && Array.isArray(data[field.name]));
107
+ }
108
+ /** Payload's refusal of a save, as something an agent can act on. */
109
+ function saveRefusal(error) {
110
+ if (error instanceof ValidationError) {
111
+ return {
112
+ error: error.message,
113
+ fields: (error.data?.errors ?? []).map((e) => ({ field: e.path, message: e.message })),
114
+ };
115
+ }
116
+ const status = error?.status;
117
+ if (status === 403 || status === 423) {
118
+ return { error: error.message };
119
+ }
120
+ return undefined;
121
+ }
122
+ async function slugRefusal(payload, collection, slug) {
123
+ const answer = await checkSlug(payload, collection, slug);
124
+ if (answer.available)
125
+ return undefined;
126
+ if (!('takenBy' in answer)) {
127
+ return { error: `"${slug}" cannot be a slug: ${answer.reason ?? 'nothing is left of it'}.` };
128
+ }
129
+ const { takenBy } = answer;
130
+ return {
131
+ error: `The slug "${answer.slug}" is taken by "${takenBy.title}"${takenBy.trashed ? ', which is in the trash' : ''}.`,
132
+ takenBy,
133
+ ...(answer.suggestion ? { suggestion: answer.suggestion } : {}),
134
+ };
135
+ }
136
+ function record(deps, ctx, event) {
137
+ if (!deps.audit)
138
+ return Promise.resolve();
139
+ return deps.audit({
140
+ actor: {
141
+ type: 'user',
142
+ userId: ctx.user ? String(ctx.user.id) : undefined,
143
+ userName: ctx.user?.name ?? ctx.user?.email,
144
+ apiKeyName: ctx.apiKeyName,
145
+ sessionId: ctx.sessionId,
146
+ },
147
+ action: event.action,
148
+ mcpServer: 'content',
149
+ mcpTool: event.tool,
150
+ targetCollection: event.collection,
151
+ targetId: String(event.id),
152
+ targetTitle: event.title,
153
+ prompt: event.meta?.userPrompt,
154
+ reasoning: event.meta?.reasoning,
155
+ changesSummary: event.meta?.changesSummary ?? `Set ${event.changed.join(', ')}.`,
156
+ });
157
+ }
158
+ function titleIn(payload, collection, doc) {
159
+ const value = doc[titleFieldOf(payload, collection)];
160
+ return typeof value === 'string' ? value : undefined;
161
+ }
162
+ /* ------------------------------------------------------------------------ */
163
+ export function createCreateDraftTool(deps) {
164
+ const canUse = deps.canUse ?? defaultCanUse;
165
+ return {
166
+ ...CONTENT_WRITE_TOOLS.createDraft,
167
+ inputSchema: createInput,
168
+ requiredScope: 'content.write',
169
+ handler: async (input, ctx) => {
170
+ const refused = refusal(ctx, canUse);
171
+ if (refused)
172
+ return refused;
173
+ const options = deps.collections[input.collection];
174
+ const config = deps.payload.collections[input.collection]?.config;
175
+ if (!options || !config)
176
+ return unknownCollection(deps, input.collection);
177
+ const data = { ...input.data };
178
+ const checked = await checkWrite(deps, ctx, input.collection, data, {});
179
+ if (checked)
180
+ return checked;
181
+ if (hasSlugField(config.fields) && options.fields.includes('slug')) {
182
+ const fromTitle = titleIn(deps.payload, input.collection, data);
183
+ const slug = typeof data['slug'] === 'string' && data['slug'].trim() !== ''
184
+ ? data['slug']
185
+ : fromTitle
186
+ ? slugify(fromTitle)
187
+ : '';
188
+ if (!slug)
189
+ return { error: 'A new document needs a title or a slug.' };
190
+ const taken = await slugRefusal(deps.payload, input.collection, slug);
191
+ if (taken)
192
+ return taken;
193
+ data['slug'] = slugify(slug);
194
+ }
195
+ const req = await requestAs(deps.payload, ctx);
196
+ let doc;
197
+ try {
198
+ doc = (await deps.payload.create({
199
+ collection: input.collection,
200
+ data: data,
201
+ draft: true,
202
+ depth: 0,
203
+ overrideAccess: false,
204
+ user: userOf(ctx),
205
+ req,
206
+ }));
207
+ }
208
+ catch (error) {
209
+ const answer = saveRefusal(error);
210
+ if (answer)
211
+ return answer;
212
+ throw error;
213
+ }
214
+ const id = doc['id'];
215
+ await record(deps, ctx, {
216
+ action: 'content.create',
217
+ tool: CONTENT_WRITE_TOOLS.createDraft.name,
218
+ collection: input.collection,
219
+ id,
220
+ title: titleIn(deps.payload, input.collection, doc),
221
+ changed: Object.keys(data),
222
+ meta: input._meta,
223
+ });
224
+ return {
225
+ collection: input.collection,
226
+ id,
227
+ status: 'draft',
228
+ ...(typeof doc['slug'] === 'string' ? { slug: doc['slug'] } : {}),
229
+ adminUrl: adminUrl(deps.payload, input.collection, id),
230
+ previewUrl: await previewUrl(deps.payload, input.collection, doc, req),
231
+ next: 'Run get_publish_status before offering to publish.',
232
+ };
233
+ },
234
+ };
235
+ }
236
+ export function createUpdateDraftTool(deps) {
237
+ const canUse = deps.canUse ?? defaultCanUse;
238
+ return {
239
+ ...CONTENT_WRITE_TOOLS.updateDraft,
240
+ inputSchema: updateInput,
241
+ requiredScope: 'content.write',
242
+ handler: async (input, ctx) => {
243
+ const refused = refusal(ctx, canUse);
244
+ if (refused)
245
+ return refused;
246
+ const options = deps.collections[input.collection];
247
+ const config = deps.payload.collections[input.collection]?.config;
248
+ if (!options || !config)
249
+ return unknownCollection(deps, input.collection);
250
+ if (Object.keys(input.patch).length === 0)
251
+ return { error: 'The patch sets nothing.' };
252
+ const allowlisted = refusedFields(input.patch, options.fields);
253
+ if (allowlisted.length > 0) {
254
+ return {
255
+ error: `Cannot set ${allowlisted.map((r) => r.field).join(', ')}.`,
256
+ refused: allowlisted,
257
+ };
258
+ }
259
+ const opened = await openForWrite(deps, ctx, input.collection, input.id);
260
+ if ('error' in opened)
261
+ return opened;
262
+ const { current } = opened;
263
+ const data = mergePatch(current, input.patch, writableFields(config.fields, options.fields));
264
+ const checked = await checkWrite(deps, ctx, input.collection, data, current);
265
+ if (checked)
266
+ return checked;
267
+ if (typeof data['slug'] === 'string' && slugify(data['slug']) !== current['slug']) {
268
+ const taken = await slugRefusal(deps.payload, input.collection, data['slug']);
269
+ if (taken)
270
+ return taken;
271
+ data['slug'] = slugify(data['slug']);
272
+ }
273
+ return saveDraft(deps, ctx, {
274
+ collection: input.collection,
275
+ id: input.id,
276
+ data,
277
+ tool: CONTENT_WRITE_TOOLS.updateDraft.name,
278
+ changed: Object.keys(input.patch),
279
+ meta: input._meta,
280
+ });
281
+ },
282
+ };
283
+ }
284
+ /**
285
+ * The document's current draft, as the caller may read it — or why not: it is
286
+ * open in the admin, or there is nothing they can read.
287
+ */
288
+ export async function openForWrite(deps, ctx, collection, id) {
289
+ const lock = await lockHolder(deps.payload, collection, id, ctx.user?.id);
290
+ if (lock)
291
+ return lockRefusal(collection, id, lock);
292
+ const current = (await deps.payload.findByID({
293
+ collection: collection,
294
+ id,
295
+ depth: 0,
296
+ draft: true,
297
+ overrideAccess: false,
298
+ user: userOf(ctx),
299
+ disableErrors: true,
300
+ req: await requestAs(deps.payload, ctx),
301
+ }));
302
+ if (!current)
303
+ return { error: `No ${collection} document ${id} that you can read.` };
304
+ return { current };
305
+ }
306
+ /**
307
+ * Saves `data` to the document's draft as the caller, records it, and answers
308
+ * with the links. `data` holds only the top-level fields that change.
309
+ */
310
+ export async function saveDraft(deps, ctx, write) {
311
+ const req = await requestAs(deps.payload, ctx);
312
+ let doc;
313
+ try {
314
+ doc = (await deps.payload.update({
315
+ collection: write.collection,
316
+ id: write.id,
317
+ data: write.data,
318
+ draft: true,
319
+ depth: 0,
320
+ overrideAccess: false,
321
+ overrideLock: false,
322
+ user: userOf(ctx),
323
+ req,
324
+ }));
325
+ }
326
+ catch (error) {
327
+ const answer = saveRefusal(error);
328
+ if (answer)
329
+ return answer;
330
+ throw error;
331
+ }
332
+ await record(deps, ctx, {
333
+ action: 'content.update',
334
+ tool: write.tool,
335
+ collection: write.collection,
336
+ id: write.id,
337
+ title: titleIn(deps.payload, write.collection, doc),
338
+ changed: write.changed,
339
+ meta: write.meta,
340
+ });
341
+ return {
342
+ collection: write.collection,
343
+ id: doc['id'],
344
+ status: typeof doc['_status'] === 'string' ? doc['_status'] : 'draft',
345
+ changed: write.changed,
346
+ adminUrl: adminUrl(deps.payload, write.collection, doc['id']),
347
+ previewUrl: await previewUrl(deps.payload, write.collection, doc, req),
348
+ };
349
+ }
350
+ export function createContentWriteTools(deps) {
351
+ return [createCreateDraftTool(deps), createUpdateDraftTool(deps)];
352
+ }
353
+ //# sourceMappingURL=write.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.js","sourceRoot":"","sources":["../../src/content/write.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,eAAe,EAAiD,MAAM,SAAS,CAAA;AAIxF,OAAO,EAAE,QAAQ,EAAgB,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,UAAU,EACV,aAAa,GACd,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,QAAQ,EACR,aAAa,EACb,aAAa,EACb,UAAU,EACV,OAAO,EACP,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,MAAM,GAEP,MAAM,YAAY,CAAA;AAEnB;;;;;;;;;;;EAWE;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,WAAW,EAAE;QACX,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,6bAA6b;KAChc;IACD,WAAW,EAAE;QACX,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,8SAA8S;KACjT;CACmD,CAAA;AAEtD,MAAM,CAAC,MAAM,8BAA8B,GACzC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAA;AAMpC,MAAM,QAAQ,GACZ,iFAAiF,CAAA;AAEnF,MAAM,WAAW,GAAG,QAAQ,CAAC;IAC3B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;I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