@agiletortoise/drafts-mcp-server 1.0.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/LICENSE +21 -0
- package/README.md +404 -0
- package/dist/applescript.d.ts +26 -0
- package/dist/applescript.d.ts.map +1 -0
- package/dist/applescript.js +105 -0
- package/dist/applescript.js.map +1 -0
- package/dist/drafts.d.ts +106 -0
- package/dist/drafts.d.ts.map +1 -0
- package/dist/drafts.js +498 -0
- package/dist/drafts.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +581 -0
- package/dist/index.js.map +1 -0
- package/package.json +53 -0
package/dist/drafts.js
ADDED
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
import { executeAppleScript, escapeAppleScriptString, parseAppleScriptList } from './applescript.js';
|
|
2
|
+
/**
|
|
3
|
+
* List all workspaces in Drafts
|
|
4
|
+
*/
|
|
5
|
+
export async function listWorkspaces() {
|
|
6
|
+
const script = `
|
|
7
|
+
tell application "Drafts"
|
|
8
|
+
set workspaceList to {}
|
|
9
|
+
repeat with w in workspaces
|
|
10
|
+
set end of workspaceList to name of w
|
|
11
|
+
end repeat
|
|
12
|
+
return workspaceList
|
|
13
|
+
end tell
|
|
14
|
+
`;
|
|
15
|
+
const result = await executeAppleScript(script);
|
|
16
|
+
const names = parseAppleScriptList(result);
|
|
17
|
+
return names.map(name => ({ name }));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get the current workspace
|
|
21
|
+
*/
|
|
22
|
+
export async function getCurrentWorkspace() {
|
|
23
|
+
const script = `
|
|
24
|
+
tell application "Drafts"
|
|
25
|
+
set w to current workspace
|
|
26
|
+
return name of w
|
|
27
|
+
end tell
|
|
28
|
+
`;
|
|
29
|
+
const result = await executeAppleScript(script);
|
|
30
|
+
return { name: result };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get the current draft
|
|
34
|
+
*/
|
|
35
|
+
export async function getCurrentDraft() {
|
|
36
|
+
const script = `
|
|
37
|
+
tell application "Drafts"
|
|
38
|
+
try
|
|
39
|
+
set theDraft to current draft
|
|
40
|
+
set props to "ID:" & id of theDraft
|
|
41
|
+
set props to props & "<<SEP>>TITLE:" & title of theDraft
|
|
42
|
+
set props to props & "<<SEP>>CONTENT:" & content of theDraft
|
|
43
|
+
set props to props & "<<SEP>>FLAGGED:" & flagged of theDraft
|
|
44
|
+
set props to props & "<<SEP>>FOLDER:" & folder of theDraft
|
|
45
|
+
set props to props & "<<SEP>>TAGS:" & ((tags of theDraft) as string)
|
|
46
|
+
set props to props & "<<SEP>>CREATED:" & ((creation date of theDraft) as string)
|
|
47
|
+
set props to props & "<<SEP>>MODIFIED:" & ((modification date of theDraft) as string)
|
|
48
|
+
set props to props & "<<SEP>>ACCESSED:" & ((access date of theDraft) as string)
|
|
49
|
+
set props to props & "<<SEP>>PERMALINK:" & permalink of theDraft
|
|
50
|
+
set props to props & "<<SEP>>CREATION_LAT:" & creation latitude of theDraft
|
|
51
|
+
set props to props & "<<SEP>>CREATION_LON:" & creation longitude of theDraft
|
|
52
|
+
set props to props & "<<SEP>>MODIFICATION_LAT:" & modification latitude of theDraft
|
|
53
|
+
set props to props & "<<SEP>>MODIFICATION_LON:" & modification longitude of theDraft
|
|
54
|
+
return props
|
|
55
|
+
on error errMsg
|
|
56
|
+
return "NOT_FOUND:" & errMsg
|
|
57
|
+
end try
|
|
58
|
+
end tell
|
|
59
|
+
`;
|
|
60
|
+
const result = await executeAppleScript(script);
|
|
61
|
+
if (result.startsWith('NOT_FOUND:')) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
return parseSingleDraft(result);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get drafts from a specific workspace
|
|
68
|
+
*/
|
|
69
|
+
export async function getWorkspaceDrafts(workspaceName, folder) {
|
|
70
|
+
const escapedWorkspace = escapeAppleScriptString(workspaceName);
|
|
71
|
+
const script = `
|
|
72
|
+
tell application "Drafts"
|
|
73
|
+
set targetWorkspace to workspace "${escapedWorkspace}"
|
|
74
|
+
|
|
75
|
+
${folder
|
|
76
|
+
? `set matchingDrafts to every draft of targetWorkspace whose folder is ${folder}`
|
|
77
|
+
: `set matchingDrafts to every draft of targetWorkspace`}
|
|
78
|
+
|
|
79
|
+
set results to ""
|
|
80
|
+
repeat with d in matchingDrafts
|
|
81
|
+
set theDraft to contents of d
|
|
82
|
+
set props to "ID:" & id of theDraft
|
|
83
|
+
set props to props & "<<SEP>>TITLE:" & title of theDraft
|
|
84
|
+
set props to props & "<<SEP>>CONTENT:" & content of theDraft
|
|
85
|
+
set props to props & "<<SEP>>FLAGGED:" & flagged of theDraft
|
|
86
|
+
set props to props & "<<SEP>>FOLDER:" & folder of theDraft
|
|
87
|
+
set props to props & "<<SEP>>TAGS:" & ((tags of theDraft) as string)
|
|
88
|
+
set props to props & "<<SEP>>CREATED:" & ((creation date of theDraft) as string)
|
|
89
|
+
set props to props & "<<SEP>>MODIFIED:" & ((modification date of theDraft) as string)
|
|
90
|
+
set props to props & "<<SEP>>ACCESSED:" & ((access date of theDraft) as string)
|
|
91
|
+
set props to props & "<<SEP>>PERMALINK:" & permalink of theDraft
|
|
92
|
+
set props to props & "<<SEP>>CREATION_LAT:" & creation latitude of theDraft
|
|
93
|
+
set props to props & "<<SEP>>CREATION_LON:" & creation longitude of theDraft
|
|
94
|
+
set props to props & "<<SEP>>MODIFICATION_LAT:" & modification latitude of theDraft
|
|
95
|
+
set props to props & "<<SEP>>MODIFICATION_LON:" & modification longitude of theDraft
|
|
96
|
+
set results to results & props & "<<END>>"
|
|
97
|
+
end repeat
|
|
98
|
+
|
|
99
|
+
return results
|
|
100
|
+
end tell
|
|
101
|
+
`;
|
|
102
|
+
const result = await executeAppleScript(script);
|
|
103
|
+
return parseDraftsList(result);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Convert ISO date string (YYYY-MM-DD) to AppleScript date format
|
|
107
|
+
*/
|
|
108
|
+
function toAppleScriptDate(isoDate) {
|
|
109
|
+
const months = ['January', 'February', 'March', 'April', 'May', 'June',
|
|
110
|
+
'July', 'August', 'September', 'October', 'November', 'December'];
|
|
111
|
+
const [year, month, day] = isoDate.split('-').map(Number);
|
|
112
|
+
return `${months[month - 1]} ${day}, ${year}`;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get drafts with flexible filtering
|
|
116
|
+
*/
|
|
117
|
+
export async function getDrafts(filter) {
|
|
118
|
+
const conditions = [];
|
|
119
|
+
const dateSetup = [];
|
|
120
|
+
if (filter.query) {
|
|
121
|
+
const escapedQuery = escapeAppleScriptString(filter.query);
|
|
122
|
+
conditions.push(`content contains "${escapedQuery}"`);
|
|
123
|
+
}
|
|
124
|
+
if (filter.folder) {
|
|
125
|
+
conditions.push(`folder is ${filter.folder}`);
|
|
126
|
+
}
|
|
127
|
+
if (filter.tag) {
|
|
128
|
+
const escapedTag = escapeAppleScriptString(filter.tag);
|
|
129
|
+
conditions.push(`tags contains "${escapedTag}"`);
|
|
130
|
+
}
|
|
131
|
+
if (filter.flagged !== undefined) {
|
|
132
|
+
conditions.push(`flagged is ${filter.flagged}`);
|
|
133
|
+
}
|
|
134
|
+
if (filter.createdAfter) {
|
|
135
|
+
dateSetup.push(`set createdAfterDate to date "${toAppleScriptDate(filter.createdAfter)}"`);
|
|
136
|
+
conditions.push(`creation date > createdAfterDate`);
|
|
137
|
+
}
|
|
138
|
+
if (filter.createdBefore) {
|
|
139
|
+
dateSetup.push(`set createdBeforeDate to date "${toAppleScriptDate(filter.createdBefore)}"`);
|
|
140
|
+
conditions.push(`creation date < createdBeforeDate`);
|
|
141
|
+
}
|
|
142
|
+
if (filter.modifiedAfter) {
|
|
143
|
+
dateSetup.push(`set modifiedAfterDate to date "${toAppleScriptDate(filter.modifiedAfter)}"`);
|
|
144
|
+
conditions.push(`modification date > modifiedAfterDate`);
|
|
145
|
+
}
|
|
146
|
+
if (filter.modifiedBefore) {
|
|
147
|
+
dateSetup.push(`set modifiedBeforeDate to date "${toAppleScriptDate(filter.modifiedBefore)}"`);
|
|
148
|
+
conditions.push(`modification date < modifiedBeforeDate`);
|
|
149
|
+
}
|
|
150
|
+
const whereClause = conditions.length > 0
|
|
151
|
+
? `whose ${conditions.join(' and ')}`
|
|
152
|
+
: '';
|
|
153
|
+
const script = `
|
|
154
|
+
tell application "Drafts"
|
|
155
|
+
${dateSetup.join('\n ')}
|
|
156
|
+
set matchingDrafts to every draft ${whereClause}
|
|
157
|
+
|
|
158
|
+
set results to ""
|
|
159
|
+
repeat with d in matchingDrafts
|
|
160
|
+
set theDraft to contents of d
|
|
161
|
+
set props to "ID:" & id of theDraft
|
|
162
|
+
set props to props & "<<SEP>>TITLE:" & title of theDraft
|
|
163
|
+
set props to props & "<<SEP>>CONTENT:" & content of theDraft
|
|
164
|
+
set props to props & "<<SEP>>FLAGGED:" & flagged of theDraft
|
|
165
|
+
set props to props & "<<SEP>>FOLDER:" & folder of theDraft
|
|
166
|
+
set props to props & "<<SEP>>TAGS:" & ((tags of theDraft) as string)
|
|
167
|
+
set props to props & "<<SEP>>CREATED:" & ((creation date of theDraft) as string)
|
|
168
|
+
set props to props & "<<SEP>>MODIFIED:" & ((modification date of theDraft) as string)
|
|
169
|
+
set props to props & "<<SEP>>ACCESSED:" & ((access date of theDraft) as string)
|
|
170
|
+
set props to props & "<<SEP>>PERMALINK:" & permalink of theDraft
|
|
171
|
+
set props to props & "<<SEP>>CREATION_LAT:" & creation latitude of theDraft
|
|
172
|
+
set props to props & "<<SEP>>CREATION_LON:" & creation longitude of theDraft
|
|
173
|
+
set props to props & "<<SEP>>MODIFICATION_LAT:" & modification latitude of theDraft
|
|
174
|
+
set props to props & "<<SEP>>MODIFICATION_LON:" & modification longitude of theDraft
|
|
175
|
+
set results to results & props & "<<END>>"
|
|
176
|
+
end repeat
|
|
177
|
+
|
|
178
|
+
return results
|
|
179
|
+
end tell
|
|
180
|
+
`;
|
|
181
|
+
const result = await executeAppleScript(script);
|
|
182
|
+
return parseDraftsList(result);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Create a new draft
|
|
186
|
+
*/
|
|
187
|
+
export async function createDraft(content, tags, flagged) {
|
|
188
|
+
const escapedContent = escapeAppleScriptString(content);
|
|
189
|
+
const tagList = tags && tags.length > 0
|
|
190
|
+
? `{${tags.map(t => `"${escapeAppleScriptString(t)}"`).join(', ')}}`
|
|
191
|
+
: '{}';
|
|
192
|
+
const script = `
|
|
193
|
+
tell application "Drafts"
|
|
194
|
+
set newDraft to make new draft with properties {content:"${escapedContent}"}
|
|
195
|
+
${tags && tags.length > 0 ? `set tags of newDraft to ${tagList}` : ''}
|
|
196
|
+
${flagged ? `set flagged of newDraft to true` : ''}
|
|
197
|
+
set theUUID to id of newDraft
|
|
198
|
+
return theUUID
|
|
199
|
+
end tell
|
|
200
|
+
`;
|
|
201
|
+
return await executeAppleScript(script);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Get a specific draft by UUID
|
|
205
|
+
*/
|
|
206
|
+
export async function getDraft(uuid) {
|
|
207
|
+
const escapedUuid = escapeAppleScriptString(uuid);
|
|
208
|
+
const script = `
|
|
209
|
+
tell application "Drafts"
|
|
210
|
+
try
|
|
211
|
+
set theDraft to draft id "${escapedUuid}"
|
|
212
|
+
set props to "ID:" & id of theDraft
|
|
213
|
+
set props to props & "<<SEP>>TITLE:" & title of theDraft
|
|
214
|
+
set props to props & "<<SEP>>CONTENT:" & content of theDraft
|
|
215
|
+
set props to props & "<<SEP>>FLAGGED:" & flagged of theDraft
|
|
216
|
+
set props to props & "<<SEP>>FOLDER:" & folder of theDraft
|
|
217
|
+
set props to props & "<<SEP>>TAGS:" & ((tags of theDraft) as string)
|
|
218
|
+
set props to props & "<<SEP>>CREATED:" & ((creation date of theDraft) as string)
|
|
219
|
+
set props to props & "<<SEP>>MODIFIED:" & ((modification date of theDraft) as string)
|
|
220
|
+
set props to props & "<<SEP>>ACCESSED:" & ((access date of theDraft) as string)
|
|
221
|
+
set props to props & "<<SEP>>PERMALINK:" & permalink of theDraft
|
|
222
|
+
set props to props & "<<SEP>>CREATION_LAT:" & creation latitude of theDraft
|
|
223
|
+
set props to props & "<<SEP>>CREATION_LON:" & creation longitude of theDraft
|
|
224
|
+
set props to props & "<<SEP>>MODIFICATION_LAT:" & modification latitude of theDraft
|
|
225
|
+
set props to props & "<<SEP>>MODIFICATION_LON:" & modification longitude of theDraft
|
|
226
|
+
return props
|
|
227
|
+
on error errMsg
|
|
228
|
+
return "NOT_FOUND:" & errMsg
|
|
229
|
+
end try
|
|
230
|
+
end tell
|
|
231
|
+
`;
|
|
232
|
+
const result = await executeAppleScript(script);
|
|
233
|
+
if (result.startsWith('NOT_FOUND:')) {
|
|
234
|
+
console.error('getDraft error:', result);
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
return parseSingleDraft(result);
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Update a draft's content
|
|
241
|
+
*/
|
|
242
|
+
export async function updateDraft(uuid, content) {
|
|
243
|
+
const escapedUuid = escapeAppleScriptString(uuid);
|
|
244
|
+
const escapedContent = escapeAppleScriptString(content);
|
|
245
|
+
const script = `
|
|
246
|
+
tell application "Drafts"
|
|
247
|
+
try
|
|
248
|
+
set targetDraft to draft id "${escapedUuid}"
|
|
249
|
+
set content of targetDraft to "${escapedContent}"
|
|
250
|
+
return "SUCCESS"
|
|
251
|
+
on error errMsg
|
|
252
|
+
return "ERROR: " & errMsg
|
|
253
|
+
end try
|
|
254
|
+
end tell
|
|
255
|
+
`;
|
|
256
|
+
const result = await executeAppleScript(script);
|
|
257
|
+
return result === 'SUCCESS';
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Add tags to a draft
|
|
261
|
+
*/
|
|
262
|
+
export async function addTagsToDraft(uuid, tags) {
|
|
263
|
+
const escapedUuid = escapeAppleScriptString(uuid);
|
|
264
|
+
const tagList = `{${tags.map(t => `"${escapeAppleScriptString(t)}"`).join(', ')}}`;
|
|
265
|
+
const script = `
|
|
266
|
+
tell application "Drafts"
|
|
267
|
+
try
|
|
268
|
+
set targetDraft to draft id "${escapedUuid}"
|
|
269
|
+
set currentTags to tags of targetDraft
|
|
270
|
+
set tags of targetDraft to currentTags & ${tagList}
|
|
271
|
+
return "SUCCESS"
|
|
272
|
+
on error errMsg
|
|
273
|
+
return "ERROR: " & errMsg
|
|
274
|
+
end try
|
|
275
|
+
end tell
|
|
276
|
+
`;
|
|
277
|
+
const result = await executeAppleScript(script);
|
|
278
|
+
return result === 'SUCCESS';
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Run an action on a draft
|
|
282
|
+
*/
|
|
283
|
+
export async function runAction(draftUuid, actionName) {
|
|
284
|
+
const escapedDraftUuid = escapeAppleScriptString(draftUuid);
|
|
285
|
+
const escapedActionName = escapeAppleScriptString(actionName);
|
|
286
|
+
const script = `
|
|
287
|
+
tell application "Drafts"
|
|
288
|
+
try
|
|
289
|
+
set targetDraft to draft id "${escapedDraftUuid}"
|
|
290
|
+
set targetAction to action "${escapedActionName}"
|
|
291
|
+
perform action targetAction on draft targetDraft
|
|
292
|
+
return "SUCCESS"
|
|
293
|
+
on error errMsg
|
|
294
|
+
return "ERROR: " & errMsg
|
|
295
|
+
end try
|
|
296
|
+
end tell
|
|
297
|
+
`;
|
|
298
|
+
const result = await executeAppleScript(script);
|
|
299
|
+
return result === 'SUCCESS';
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* List available actions
|
|
303
|
+
*/
|
|
304
|
+
export async function listActions() {
|
|
305
|
+
const script = `
|
|
306
|
+
tell application "Drafts"
|
|
307
|
+
set actionList to {}
|
|
308
|
+
repeat with a in actions
|
|
309
|
+
set end of actionList to name of a
|
|
310
|
+
end repeat
|
|
311
|
+
return actionList
|
|
312
|
+
end tell
|
|
313
|
+
`;
|
|
314
|
+
const result = await executeAppleScript(script);
|
|
315
|
+
const names = parseAppleScriptList(result);
|
|
316
|
+
return names.map(name => ({ name }));
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Search for drafts
|
|
320
|
+
*/
|
|
321
|
+
export async function searchDrafts(query) {
|
|
322
|
+
const escapedQuery = escapeAppleScriptString(query);
|
|
323
|
+
const script = `
|
|
324
|
+
tell application "Drafts"
|
|
325
|
+
set searchResults to search for query "${escapedQuery}"
|
|
326
|
+
set results to ""
|
|
327
|
+
repeat with d in searchResults
|
|
328
|
+
set theDraft to contents of d
|
|
329
|
+
set props to "ID:" & id of theDraft
|
|
330
|
+
set props to props & "<<SEP>>TITLE:" & title of theDraft
|
|
331
|
+
set props to props & "<<SEP>>CONTENT:" & content of theDraft
|
|
332
|
+
set props to props & "<<SEP>>FLAGGED:" & flagged of theDraft
|
|
333
|
+
set props to props & "<<SEP>>FOLDER:" & folder of theDraft
|
|
334
|
+
set props to props & "<<SEP>>TAGS:" & ((tags of theDraft) as string)
|
|
335
|
+
set props to props & "<<SEP>>CREATED:" & ((creation date of theDraft) as string)
|
|
336
|
+
set props to props & "<<SEP>>MODIFIED:" & ((modification date of theDraft) as string)
|
|
337
|
+
set props to props & "<<SEP>>ACCESSED:" & ((access date of theDraft) as string)
|
|
338
|
+
set props to props & "<<SEP>>PERMALINK:" & permalink of theDraft
|
|
339
|
+
set props to props & "<<SEP>>CREATION_LAT:" & creation latitude of theDraft
|
|
340
|
+
set props to props & "<<SEP>>CREATION_LON:" & creation longitude of theDraft
|
|
341
|
+
set props to props & "<<SEP>>MODIFICATION_LAT:" & modification latitude of theDraft
|
|
342
|
+
set props to props & "<<SEP>>MODIFICATION_LON:" & modification longitude of theDraft
|
|
343
|
+
set results to results & props & "<<END>>"
|
|
344
|
+
end repeat
|
|
345
|
+
return results
|
|
346
|
+
end tell
|
|
347
|
+
`;
|
|
348
|
+
const result = await executeAppleScript(script);
|
|
349
|
+
return parseDraftsList(result);
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Flag or unflag a draft
|
|
353
|
+
*/
|
|
354
|
+
export async function setDraftFlagged(uuid, flagged) {
|
|
355
|
+
const escapedUuid = escapeAppleScriptString(uuid);
|
|
356
|
+
const script = `
|
|
357
|
+
tell application "Drafts"
|
|
358
|
+
try
|
|
359
|
+
set targetDraft to draft id "${escapedUuid}"
|
|
360
|
+
set flagged of targetDraft to ${flagged}
|
|
361
|
+
return "SUCCESS"
|
|
362
|
+
on error errMsg
|
|
363
|
+
return "ERROR: " & errMsg
|
|
364
|
+
end try
|
|
365
|
+
end tell
|
|
366
|
+
`;
|
|
367
|
+
const result = await executeAppleScript(script);
|
|
368
|
+
return result === 'SUCCESS';
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Archive a draft
|
|
372
|
+
*/
|
|
373
|
+
export async function archiveDraft(uuid) {
|
|
374
|
+
const escapedUuid = escapeAppleScriptString(uuid);
|
|
375
|
+
const script = `
|
|
376
|
+
tell application "Drafts"
|
|
377
|
+
try
|
|
378
|
+
set targetDraft to draft id "${escapedUuid}"
|
|
379
|
+
set folder of targetDraft to archive
|
|
380
|
+
return "SUCCESS"
|
|
381
|
+
on error errMsg
|
|
382
|
+
return "ERROR: " & errMsg
|
|
383
|
+
end try
|
|
384
|
+
end tell
|
|
385
|
+
`;
|
|
386
|
+
const result = await executeAppleScript(script);
|
|
387
|
+
return result === 'SUCCESS';
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Move a draft to inbox
|
|
391
|
+
*/
|
|
392
|
+
export async function inboxDraft(uuid) {
|
|
393
|
+
const escapedUuid = escapeAppleScriptString(uuid);
|
|
394
|
+
const script = `
|
|
395
|
+
tell application "Drafts"
|
|
396
|
+
try
|
|
397
|
+
set targetDraft to draft id "${escapedUuid}"
|
|
398
|
+
set folder of targetDraft to inbox
|
|
399
|
+
return "SUCCESS"
|
|
400
|
+
on error errMsg
|
|
401
|
+
return "ERROR: " & errMsg
|
|
402
|
+
end try
|
|
403
|
+
end tell
|
|
404
|
+
`;
|
|
405
|
+
const result = await executeAppleScript(script);
|
|
406
|
+
return result === 'SUCCESS';
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Trash a draft
|
|
410
|
+
*/
|
|
411
|
+
export async function trashDraft(uuid) {
|
|
412
|
+
const escapedUuid = escapeAppleScriptString(uuid);
|
|
413
|
+
const script = `
|
|
414
|
+
tell application "Drafts"
|
|
415
|
+
try
|
|
416
|
+
set targetDraft to draft id "${escapedUuid}"
|
|
417
|
+
set folder of targetDraft to trash
|
|
418
|
+
return "SUCCESS"
|
|
419
|
+
on error errMsg
|
|
420
|
+
return "ERROR: " & errMsg
|
|
421
|
+
end try
|
|
422
|
+
end tell
|
|
423
|
+
`;
|
|
424
|
+
const result = await executeAppleScript(script);
|
|
425
|
+
return result === 'SUCCESS';
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Open a draft in the Drafts editor
|
|
429
|
+
*/
|
|
430
|
+
export async function openDraft(uuid) {
|
|
431
|
+
const escapedUuid = escapeAppleScriptString(uuid);
|
|
432
|
+
const script = `
|
|
433
|
+
tell application "Drafts"
|
|
434
|
+
try
|
|
435
|
+
activate
|
|
436
|
+
set targetDraft to draft id "${escapedUuid}"
|
|
437
|
+
open targetDraft
|
|
438
|
+
return "SUCCESS"
|
|
439
|
+
on error errMsg
|
|
440
|
+
return "ERROR: " & errMsg
|
|
441
|
+
end try
|
|
442
|
+
end tell
|
|
443
|
+
`;
|
|
444
|
+
const result = await executeAppleScript(script);
|
|
445
|
+
return result === 'SUCCESS';
|
|
446
|
+
}
|
|
447
|
+
// Helper functions for parsing AppleScript output
|
|
448
|
+
/**
|
|
449
|
+
* Parse AppleScript date string to ISO 8601 format
|
|
450
|
+
*/
|
|
451
|
+
function parseAppleScriptDate(dateStr) {
|
|
452
|
+
// AppleScript format: "Monday, November 10, 2025 at 7:56:32 AM"
|
|
453
|
+
const date = new Date(dateStr.replace(' at ', ' '));
|
|
454
|
+
return date.toISOString();
|
|
455
|
+
}
|
|
456
|
+
function parseDraftProperties(propsStr) {
|
|
457
|
+
const props = {};
|
|
458
|
+
const parts = propsStr.split('<<SEP>>');
|
|
459
|
+
for (const part of parts) {
|
|
460
|
+
const colonIdx = part.indexOf(':');
|
|
461
|
+
if (colonIdx !== -1) {
|
|
462
|
+
const key = part.substring(0, colonIdx);
|
|
463
|
+
const value = part.substring(colonIdx + 1);
|
|
464
|
+
props[key] = value;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
return {
|
|
468
|
+
id: props['ID'] || '',
|
|
469
|
+
title: props['TITLE'] || '',
|
|
470
|
+
content: props['CONTENT'] || '',
|
|
471
|
+
flagged: props['FLAGGED'] === 'true',
|
|
472
|
+
folder: (props['FOLDER'] || 'inbox'),
|
|
473
|
+
tags: props['TAGS'] ? props['TAGS'].split(', ').filter(t => t) : [],
|
|
474
|
+
creationDate: props['CREATED'] ? parseAppleScriptDate(props['CREATED']) : '',
|
|
475
|
+
modificationDate: props['MODIFIED'] ? parseAppleScriptDate(props['MODIFIED']) : '',
|
|
476
|
+
accessDate: props['ACCESSED'] ? parseAppleScriptDate(props['ACCESSED']) : '',
|
|
477
|
+
permalink: props['PERMALINK'] || '',
|
|
478
|
+
creationLatitude: parseFloat(props['CREATION_LAT']) || 0,
|
|
479
|
+
creationLongitude: parseFloat(props['CREATION_LON']) || 0,
|
|
480
|
+
modificationLatitude: parseFloat(props['MODIFICATION_LAT']) || 0,
|
|
481
|
+
modificationLongitude: parseFloat(props['MODIFICATION_LON']) || 0,
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
function parseDraftsList(output) {
|
|
485
|
+
const drafts = [];
|
|
486
|
+
if (!output || output.trim() === '') {
|
|
487
|
+
return drafts;
|
|
488
|
+
}
|
|
489
|
+
const entries = output.split('<<END>>').filter(e => e.trim() !== '');
|
|
490
|
+
for (const entry of entries) {
|
|
491
|
+
drafts.push(parseDraftProperties(entry));
|
|
492
|
+
}
|
|
493
|
+
return drafts;
|
|
494
|
+
}
|
|
495
|
+
function parseSingleDraft(output) {
|
|
496
|
+
return parseDraftProperties(output);
|
|
497
|
+
}
|
|
498
|
+
//# sourceMappingURL=drafts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drafts.js","sourceRoot":"","sources":["../src/drafts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AA2CrG;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,MAAM,MAAM,GAAG;;;;;;;;GAQd,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAE3C,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB;IACvC,MAAM,MAAM,GAAG;;;;;GAKd,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAChD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;GAuBd,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAEhD,IAAI,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAk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