@todoist/mcp 20.1.0 → 21.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/dist/index.d.ts +18 -18
- package/dist/index.js +2 -2
- package/dist/main-http.js +2 -2
- package/dist/main.js +1 -1
- package/dist/{mcp-server-evoO2bJn.js → mcp-server-gTECUZ_6.js} +761 -781
- package/dist/{require-valid-todoist-token-a9fHse9A.js → require-valid-todoist-token-CND9-m2b.js} +1 -1
- package/dist/tool-registry.d.ts +18 -18
- package/dist/tools/add-template.d.ts +9 -9
- package/dist/tools/fetch-object.d.ts +3 -3
- package/dist/tools/update-template.d.ts +6 -6
- package/dist/utils/template-content.d.ts +3 -3
- package/dist/utils/template-content.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -351,7 +351,7 @@ function ft(e) {
|
|
|
351
351
|
}
|
|
352
352
|
var pt = {
|
|
353
353
|
name: "@todoist/mcp",
|
|
354
|
-
version: "
|
|
354
|
+
version: "21.0.0",
|
|
355
355
|
type: "module",
|
|
356
356
|
main: "./dist/index.js",
|
|
357
357
|
types: "./dist/index.d.ts",
|
|
@@ -3340,7 +3340,7 @@ var Ao = p.object({
|
|
|
3340
3340
|
content: p.string(),
|
|
3341
3341
|
postedUid: p.string().optional(),
|
|
3342
3342
|
postedAt: p.string().optional(),
|
|
3343
|
-
fileAttachment: p.string().
|
|
3343
|
+
fileAttachment: p.record(p.string(), p.unknown()).optional()
|
|
3344
3344
|
}, Mo = p.object({
|
|
3345
3345
|
projects: p.array(p.object({
|
|
3346
3346
|
viewStyle: p.enum(x),
|
|
@@ -3374,7 +3374,7 @@ var Ao = p.object({
|
|
|
3374
3374
|
...jo
|
|
3375
3375
|
})).max(Se.ITEMS),
|
|
3376
3376
|
projectComments: p.array(p.object(jo)).max(Se.ITEMS),
|
|
3377
|
-
projectViewOptionsDefaults: p.array(p.string()).max(Se.PROJECT_VIEW_OPTIONS).describe("Calendar settings
|
|
3377
|
+
projectViewOptionsDefaults: p.array(p.record(p.string(), p.unknown())).max(Se.PROJECT_VIEW_OPTIONS).describe("Calendar settings. Send back as received.")
|
|
3378
3378
|
});
|
|
3379
3379
|
function No(e) {
|
|
3380
3380
|
return {
|
|
@@ -3407,7 +3407,7 @@ function No(e) {
|
|
|
3407
3407
|
...Fo(t)
|
|
3408
3408
|
})),
|
|
3409
3409
|
projectComments: e.projectComments.map(Fo),
|
|
3410
|
-
projectViewOptionsDefaults: e.projectViewOptionsDefaults
|
|
3410
|
+
projectViewOptionsDefaults: e.projectViewOptionsDefaults
|
|
3411
3411
|
};
|
|
3412
3412
|
}
|
|
3413
3413
|
function Po(e) {
|
|
@@ -3424,39 +3424,19 @@ function Fo(e) {
|
|
|
3424
3424
|
content: e.content,
|
|
3425
3425
|
postedUid: e.postedUid ?? void 0,
|
|
3426
3426
|
postedAt: e.postedAt ?? void 0,
|
|
3427
|
-
fileAttachment: e.fileAttachment
|
|
3427
|
+
fileAttachment: e.fileAttachment ?? void 0
|
|
3428
3428
|
};
|
|
3429
3429
|
}
|
|
3430
|
-
function Io(e
|
|
3431
|
-
let n;
|
|
3432
|
-
try {
|
|
3433
|
-
n = JSON.parse(e);
|
|
3434
|
-
} catch {
|
|
3435
|
-
n = void 0;
|
|
3436
|
-
}
|
|
3437
|
-
if (typeof n != "object" || !n || Array.isArray(n)) throw Error(`${t} must be the JSON object fetch-object returned, sent back unchanged. Nothing was saved.`);
|
|
3438
|
-
return n;
|
|
3439
|
-
}
|
|
3440
|
-
function Lo(e, t) {
|
|
3441
|
-
let { fileAttachment: n, ...r } = e;
|
|
3442
|
-
return n === void 0 ? r : {
|
|
3443
|
-
...r,
|
|
3444
|
-
fileAttachment: Io(n, t)
|
|
3445
|
-
};
|
|
3446
|
-
}
|
|
3447
|
-
function Ro(e) {
|
|
3430
|
+
function Io(e) {
|
|
3448
3431
|
return {
|
|
3449
3432
|
...e,
|
|
3450
3433
|
tasks: e.tasks.map(({ priority: e, ...t }) => ({
|
|
3451
3434
|
...t,
|
|
3452
3435
|
...e ? { priority: cr(e) } : {}
|
|
3453
|
-
}))
|
|
3454
|
-
comments: e.comments.map((e, t) => Lo(e, `comments[${t}].fileAttachment`)),
|
|
3455
|
-
projectComments: e.projectComments.map((e, t) => Lo(e, `projectComments[${t}].fileAttachment`)),
|
|
3456
|
-
projectViewOptionsDefaults: e.projectViewOptionsDefaults.map((e, t) => Io(e, `projectViewOptionsDefaults[${t}]`))
|
|
3436
|
+
}))
|
|
3457
3437
|
};
|
|
3458
3438
|
}
|
|
3459
|
-
function
|
|
3439
|
+
function Lo(e) {
|
|
3460
3440
|
return [
|
|
3461
3441
|
["sections", e.sections.length],
|
|
3462
3442
|
["tasks", e.tasks.length],
|
|
@@ -3464,27 +3444,27 @@ function zo(e) {
|
|
|
3464
3444
|
["comments", e.comments.length + e.projectComments.length]
|
|
3465
3445
|
];
|
|
3466
3446
|
}
|
|
3467
|
-
function
|
|
3468
|
-
let n = (e) => e.projects[0]?.viewStyle ?? "none", r =
|
|
3469
|
-
return [`layout ${n(e)} → ${n(t)}`, ...
|
|
3447
|
+
function Ro(e, t) {
|
|
3448
|
+
let n = (e) => e.projects[0]?.viewStyle ?? "none", r = Lo(t);
|
|
3449
|
+
return [`layout ${n(e)} → ${n(t)}`, ...Lo(e).map(([e, t], n) => `${e} ${t} → ${r[n]?.[1]}`)].join(", ");
|
|
3470
3450
|
}
|
|
3471
|
-
function
|
|
3472
|
-
let n =
|
|
3451
|
+
function zo(e, t) {
|
|
3452
|
+
let n = Lo(t), r = Lo(e).flatMap(([e, t], r) => {
|
|
3473
3453
|
let i = n[r]?.[1] ?? 0;
|
|
3474
3454
|
return i < t ? [`${e} sent ${t}, saved ${i}`] : [];
|
|
3475
3455
|
});
|
|
3476
3456
|
return r.length > 0 ? r.join("; ") : void 0;
|
|
3477
3457
|
}
|
|
3478
|
-
var
|
|
3479
|
-
function
|
|
3480
|
-
let t = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, n = e.projects[0]?.viewStyle ?? "list", r = new Map(e.sections.map((e) => [e.id, e.name])), i = [`${n} layout, ${t(e.sections.length, "section")}, ${t(e.tasks.length, "task")}.`, ...e.tasks.slice(0,
|
|
3458
|
+
var Bo = 20;
|
|
3459
|
+
function Vo(e) {
|
|
3460
|
+
let t = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, n = e.projects[0]?.viewStyle ?? "list", r = new Map(e.sections.map((e) => [e.id, e.name])), i = [`${n} layout, ${t(e.sections.length, "section")}, ${t(e.tasks.length, "task")}.`, ...e.tasks.slice(0, Bo).map((e) => {
|
|
3481
3461
|
let t = e.parentId ? " " : "", n = e.sectionId ? ` [${r.get(e.sectionId) ?? e.sectionId}]` : "", i = e.due?.string ? ` (due ${e.due.string})` : "";
|
|
3482
3462
|
return `${t}- ${e.content}${n}${i}`;
|
|
3483
|
-
})], a = e.tasks.length -
|
|
3463
|
+
})], a = e.tasks.length - Bo;
|
|
3484
3464
|
return a > 0 && i.push(`… ${t(a, "more task")} in the full content.`), i.join("\n");
|
|
3485
3465
|
}
|
|
3486
3466
|
// src/tools/add-template.ts
|
|
3487
|
-
var
|
|
3467
|
+
var Ho = {
|
|
3488
3468
|
projectId: p.string().min(1).optional().describe("Start from this project, like the app's \"Save as template\". It is copied, not changed."),
|
|
3489
3469
|
csvFileContent: p.string().min(1).optional().describe("Start from this CSV, e.g. from export-project or a file the user shared. Not with projectId."),
|
|
3490
3470
|
preview: p.boolean().optional().describe("Defaults to true: return the draft without saving (blank, or from the project or CSV), to show the user and edit it first. Pass false only once the user has seen the draft, or asked to save as is."),
|
|
@@ -3494,24 +3474,24 @@ var Wo = {
|
|
|
3494
3474
|
color: pi("Unrecognized colors are omitted. Defaults to the project's color, or charcoal."),
|
|
3495
3475
|
workspace: p.string().trim().min(1).optional().describe("Workspace name or ID to save the template to, instead of the user's personal templates. Assignees are kept only when saving a project to its own workspace."),
|
|
3496
3476
|
sharedWithWorkspaceMembers: p.boolean().optional().describe("Share a workspace template with the workspace's members. Defaults to false.")
|
|
3497
|
-
},
|
|
3477
|
+
}, Uo = {
|
|
3498
3478
|
templateId: p.string().optional().describe("Absent for a draft."),
|
|
3499
3479
|
name: p.string().optional(),
|
|
3500
3480
|
workspaceId: p.string().optional().describe("Absent for personal templates."),
|
|
3501
3481
|
workspaceError: p.string().optional().describe("Set when the template was created but moving or sharing it failed."),
|
|
3502
3482
|
content: p.record(p.string(), p.unknown()).optional().describe("The draft. Edit it and send it back as `content` to save it.")
|
|
3503
|
-
},
|
|
3483
|
+
}, Wo = {
|
|
3504
3484
|
projects: [{ viewStyle: "list" }],
|
|
3505
3485
|
sections: [],
|
|
3506
3486
|
tasks: [],
|
|
3507
3487
|
comments: [],
|
|
3508
3488
|
projectComments: [],
|
|
3509
3489
|
projectViewOptionsDefaults: []
|
|
3510
|
-
},
|
|
3490
|
+
}, Go = "Before saving, show the user the draft and ask whether to change anything. Then call add-template again with preview: false, a name and description,", Ko = {
|
|
3511
3491
|
name: B.ADD_TEMPLATE,
|
|
3512
3492
|
description: "Create a reusable template in the user's Todoist: from a project, like the app's \"Save as template\"; from CSV content; or from scratch, starting from a blank draft. By default it only returns the draft. Show it to the user and ask whether to change anything, even when they described the whole template, unless they asked to save as is. Then save with preview: false, and `content` if it was edited. Each save creates a new template, which cannot be deleted here.",
|
|
3513
|
-
parameters:
|
|
3514
|
-
outputSchema:
|
|
3493
|
+
parameters: Ho,
|
|
3494
|
+
outputSchema: Uo,
|
|
3515
3495
|
annotations: {
|
|
3516
3496
|
readOnlyHint: !1,
|
|
3517
3497
|
destructiveHint: !1,
|
|
@@ -3522,7 +3502,7 @@ var Wo = {
|
|
|
3522
3502
|
let { projectId: n, csvFileContent: r, preview: i, content: a } = e;
|
|
3523
3503
|
if (n && r) throw Error("Start from a project or from a CSV, not both. Nothing was saved.");
|
|
3524
3504
|
let o = r ? new Blob([r], { type: "text/csv" }) : void 0;
|
|
3525
|
-
if (i !== !1) return
|
|
3505
|
+
if (i !== !1) return qo({
|
|
3526
3506
|
client: t,
|
|
3527
3507
|
projectId: n,
|
|
3528
3508
|
file: o,
|
|
@@ -3532,7 +3512,7 @@ var Wo = {
|
|
|
3532
3512
|
if (!n && !o && !a) throw Error("Nothing to save: pass `content`, or start from a `projectId` or `csvFileContent`.");
|
|
3533
3513
|
if (e.sharedWithWorkspaceMembers && !e.workspace) throw Error("Sharing needs `workspace`: only a workspace template can be shared with its members. Nothing was saved.");
|
|
3534
3514
|
if (!e.name || !e.description) throw Error("A name and a description are required to save the template. Leave out `preview` to see the draft first.");
|
|
3535
|
-
return
|
|
3515
|
+
return Jo(t, {
|
|
3536
3516
|
...e,
|
|
3537
3517
|
name: e.name,
|
|
3538
3518
|
description: e.description,
|
|
@@ -3540,15 +3520,15 @@ var Wo = {
|
|
|
3540
3520
|
});
|
|
3541
3521
|
}
|
|
3542
3522
|
};
|
|
3543
|
-
async function
|
|
3523
|
+
async function qo({ client: e, projectId: t, file: n, content: r }) {
|
|
3544
3524
|
if (r) return {
|
|
3545
|
-
textContent: `Template draft, not saved: ${
|
|
3525
|
+
textContent: `Template draft, not saved: ${Vo(r)}\n${Go} and this \`content\`.`,
|
|
3546
3526
|
structuredContent: { content: r }
|
|
3547
3527
|
};
|
|
3548
3528
|
if (t) {
|
|
3549
3529
|
let n = No((await e.previewProjectAsTemplate(t)).content);
|
|
3550
3530
|
return {
|
|
3551
|
-
textContent: `Draft of project (id=${t}) as a template, not saved: ${
|
|
3531
|
+
textContent: `Draft of project (id=${t}) as a template, not saved: ${Vo(n)}\n${Go} and the edited \`content\` if it changed.`,
|
|
3552
3532
|
structuredContent: { content: n }
|
|
3553
3533
|
};
|
|
3554
3534
|
}
|
|
@@ -3558,20 +3538,20 @@ async function Yo({ client: e, projectId: t, file: n, content: r }) {
|
|
|
3558
3538
|
fileName: "template.csv"
|
|
3559
3539
|
})).content);
|
|
3560
3540
|
return {
|
|
3561
|
-
textContent: `Draft of the CSV as a template, not saved: ${
|
|
3541
|
+
textContent: `Draft of the CSV as a template, not saved: ${Vo(t)}\n${Go} and either the CSV or the edited \`content\`.`,
|
|
3562
3542
|
structuredContent: { content: t }
|
|
3563
3543
|
};
|
|
3564
3544
|
}
|
|
3565
3545
|
return {
|
|
3566
|
-
textContent: `Blank template draft, not saved: ${
|
|
3567
|
-
structuredContent: { content:
|
|
3546
|
+
textContent: `Blank template draft, not saved: ${Vo(Wo)}\nAdd sections and tasks to its \`content\`. ${Go} and the \`content\`.`,
|
|
3547
|
+
structuredContent: { content: Wo }
|
|
3568
3548
|
};
|
|
3569
3549
|
}
|
|
3570
|
-
async function
|
|
3571
|
-
let [l, u] = await Promise.all([s ? oa.resolveWorkspace(e, s).then((e) => e.workspaceId) : void 0, t && (!o || s) ? G(e, t) : void 0]), d = r ?
|
|
3550
|
+
async function Jo(e, { projectId: t, file: n, content: r, name: i, description: a, color: o, workspace: s, sharedWithWorkspaceMembers: c }) {
|
|
3551
|
+
let [l, u] = await Promise.all([s ? oa.resolveWorkspace(e, s).then((e) => e.workspaceId) : void 0, t && (!o || s) ? G(e, t) : void 0]), d = r ? Io(r) : void 0, f;
|
|
3572
3552
|
if (t) {
|
|
3573
3553
|
let n = u && E(u) ? u.workspaceId : void 0;
|
|
3574
|
-
f = await
|
|
3554
|
+
f = await Xo(() => e.saveProjectAsTemplate({
|
|
3575
3555
|
projectId: t,
|
|
3576
3556
|
name: i,
|
|
3577
3557
|
description: a,
|
|
@@ -3585,7 +3565,7 @@ async function Xo(e, { projectId: t, file: n, content: r, name: i, description:
|
|
|
3585
3565
|
fileName: "template.csv"
|
|
3586
3566
|
} : void 0;
|
|
3587
3567
|
if (!t) throw Error("Nothing to save: pass `content`, or start from a `projectId` or `csvFileContent`.");
|
|
3588
|
-
f = await
|
|
3568
|
+
f = await Xo(() => e.addTemplate({
|
|
3589
3569
|
...t,
|
|
3590
3570
|
name: i,
|
|
3591
3571
|
description: a,
|
|
@@ -3603,7 +3583,7 @@ async function Xo(e, { projectId: t, file: n, content: r, name: i, description:
|
|
|
3603
3583
|
}
|
|
3604
3584
|
let g = f.workspaceId ?? void 0;
|
|
3605
3585
|
return {
|
|
3606
|
-
textContent:
|
|
3586
|
+
textContent: Yo({
|
|
3607
3587
|
source: t ? `project (id=${t})` : r ? "the draft" : "CSV content",
|
|
3608
3588
|
template: f,
|
|
3609
3589
|
workspaceId: g,
|
|
@@ -3617,11 +3597,11 @@ async function Xo(e, { projectId: t, file: n, content: r, name: i, description:
|
|
|
3617
3597
|
}
|
|
3618
3598
|
};
|
|
3619
3599
|
}
|
|
3620
|
-
function
|
|
3600
|
+
function Yo({ source: e, template: t, workspaceId: n, workspaceError: r }) {
|
|
3621
3601
|
let i = `Created template "${t.name}" (id=${t.id}) from ${e}.`, a = t.sharedWithWorkspaceMembers ? "shared with members" : "not yet shared with members";
|
|
3622
3602
|
return `${i}${n ? ` It is in the workspace's templates (workspace id=${n}), ${a}.` : " It is in your personal templates."}${r ? ` Moving it into the workspace or sharing it failed: ${r}. Retry with update-template.` : ""} Use add-projects with this templateId to start a new project from it.`;
|
|
3623
3603
|
}
|
|
3624
|
-
async function
|
|
3604
|
+
async function Xo(e) {
|
|
3625
3605
|
try {
|
|
3626
3606
|
return await e();
|
|
3627
3607
|
} catch (e) {
|
|
@@ -3630,7 +3610,7 @@ async function Qo(e) {
|
|
|
3630
3610
|
}
|
|
3631
3611
|
}
|
|
3632
3612
|
// src/tools/analyze-project-health.ts
|
|
3633
|
-
var
|
|
3613
|
+
var Zo = { projectId: p.string().min(1).describe("The ID of the project to analyze. This triggers a new health analysis which may take some time to complete.") }, Qo = {
|
|
3634
3614
|
projectId: p.string().describe("The project ID."),
|
|
3635
3615
|
health: p.object({
|
|
3636
3616
|
status: p.enum(v).describe("The health status after triggering analysis."),
|
|
@@ -3638,11 +3618,11 @@ var $o = { projectId: p.string().min(1).describe("The ID of the project to analy
|
|
|
3638
3618
|
updateInProgress: p.boolean().describe("Whether an analysis update is currently in progress.")
|
|
3639
3619
|
}).describe("The health response returned after triggering analysis."),
|
|
3640
3620
|
message: p.string().describe("A human-readable message about the analysis status.")
|
|
3641
|
-
},
|
|
3621
|
+
}, $o = {
|
|
3642
3622
|
name: B.ANALYZE_PROJECT_HEALTH,
|
|
3643
3623
|
description: "Trigger a new health analysis for a project. Use this when the health data is stale or you want a fresh assessment. The analysis may take time to complete — use get-project-health afterward to see updated results.",
|
|
3644
|
-
parameters:
|
|
3645
|
-
outputSchema:
|
|
3624
|
+
parameters: Zo,
|
|
3625
|
+
outputSchema: Qo,
|
|
3646
3626
|
annotations: {
|
|
3647
3627
|
readOnlyHint: !1,
|
|
3648
3628
|
destructiveHint: !1,
|
|
@@ -3663,26 +3643,26 @@ var $o = { projectId: p.string().min(1).describe("The ID of the project to analy
|
|
|
3663
3643
|
}
|
|
3664
3644
|
};
|
|
3665
3645
|
}
|
|
3666
|
-
},
|
|
3646
|
+
}, es = { ids: p.array(p.string().min(1)).min(1).max(O.BULK_ACTIONS_PER_OPERATION).describe("The IDs of the tasks to complete.") }, ts = {
|
|
3667
3647
|
completed: p.array(p.string()).describe("The IDs of successfully completed tasks."),
|
|
3668
3648
|
failures: p.array(Y).describe("Failed task completions with error details."),
|
|
3669
3649
|
totalRequested: p.number().describe("The total number of tasks requested to complete."),
|
|
3670
3650
|
successCount: p.number().describe("The number of successfully completed tasks."),
|
|
3671
3651
|
failureCount: p.number().describe("The number of failed task completions.")
|
|
3672
|
-
},
|
|
3652
|
+
}, ns = {
|
|
3673
3653
|
name: B.COMPLETE_TASKS,
|
|
3674
3654
|
description: "Complete one or more tasks by their IDs.",
|
|
3675
|
-
parameters:
|
|
3676
|
-
outputSchema:
|
|
3655
|
+
parameters: es,
|
|
3656
|
+
outputSchema: ts,
|
|
3677
3657
|
annotations: {
|
|
3678
3658
|
readOnlyHint: !1,
|
|
3679
3659
|
destructiveHint: !0,
|
|
3680
3660
|
idempotentHint: !1
|
|
3681
3661
|
},
|
|
3682
3662
|
async execute(e, t) {
|
|
3683
|
-
let n = await
|
|
3663
|
+
let n = await rs(t, e.ids), { succeeded: r, failures: i } = I(e.ids, n, (e) => e), a = r.map(({ item: e }) => e);
|
|
3684
3664
|
return L(B.COMPLETE_TASKS, e.ids.length, i), {
|
|
3685
|
-
textContent:
|
|
3665
|
+
textContent: ss({
|
|
3686
3666
|
completed: a,
|
|
3687
3667
|
failures: i,
|
|
3688
3668
|
args: e
|
|
@@ -3697,10 +3677,10 @@ var $o = { projectId: p.string().min(1).describe("The ID of the project to analy
|
|
|
3697
3677
|
};
|
|
3698
3678
|
}
|
|
3699
3679
|
};
|
|
3700
|
-
async function
|
|
3680
|
+
async function rs(e, t) {
|
|
3701
3681
|
let n = [...new Set(t)], r;
|
|
3702
3682
|
try {
|
|
3703
|
-
r = await
|
|
3683
|
+
r = await as(e, n);
|
|
3704
3684
|
} catch (e) {
|
|
3705
3685
|
return t.map(() => ({
|
|
3706
3686
|
status: "rejected",
|
|
@@ -3726,19 +3706,19 @@ async function as(e, t) {
|
|
|
3726
3706
|
let t = r.get(e);
|
|
3727
3707
|
return t?.status === "rejected" ? t : o.get(e) ?? {
|
|
3728
3708
|
status: "rejected",
|
|
3729
|
-
reason:
|
|
3709
|
+
reason: is(t?.value)
|
|
3730
3710
|
};
|
|
3731
3711
|
});
|
|
3732
3712
|
}
|
|
3733
|
-
function
|
|
3713
|
+
function is(e) {
|
|
3734
3714
|
return Error(e === "completed" ? "Task is already completed." : `Task not found, or already completed. Look for it with ${B.FIND_TASKS}, or ${B.FIND_COMPLETED_TASKS} if it may be done.`);
|
|
3735
3715
|
}
|
|
3736
|
-
async function
|
|
3716
|
+
async function as(e, t) {
|
|
3737
3717
|
try {
|
|
3738
3718
|
let { results: n } = await R(() => e.getTasks({
|
|
3739
3719
|
ids: t,
|
|
3740
3720
|
limit: t.length
|
|
3741
|
-
})), r = new Map(n.map((e) => [e.id,
|
|
3721
|
+
})), r = new Map(n.map((e) => [e.id, os(e)]));
|
|
3742
3722
|
return new Map(t.map((e) => [e, {
|
|
3743
3723
|
status: "fulfilled",
|
|
3744
3724
|
value: r.get(e) ?? "missing"
|
|
@@ -3755,17 +3735,17 @@ async function ss(e, t) {
|
|
|
3755
3735
|
let r = n[t];
|
|
3756
3736
|
return [e, r?.status === "fulfilled" ? {
|
|
3757
3737
|
status: "fulfilled",
|
|
3758
|
-
value:
|
|
3738
|
+
value: os(r.value)
|
|
3759
3739
|
} : {
|
|
3760
3740
|
status: "rejected",
|
|
3761
3741
|
reason: r?.reason
|
|
3762
3742
|
}];
|
|
3763
3743
|
}));
|
|
3764
3744
|
}
|
|
3765
|
-
function
|
|
3745
|
+
function os(e) {
|
|
3766
3746
|
return e.checked ? "completed" : "open";
|
|
3767
3747
|
}
|
|
3768
|
-
function
|
|
3748
|
+
function ss({ completed: e, failures: t, args: n }) {
|
|
3769
3749
|
return Pi({
|
|
3770
3750
|
action: "Completed tasks",
|
|
3771
3751
|
success: e.length,
|
|
@@ -3775,13 +3755,13 @@ function ls({ completed: e, failures: t, args: n }) {
|
|
|
3775
3755
|
});
|
|
3776
3756
|
}
|
|
3777
3757
|
// src/utils/filter-resolver.ts
|
|
3778
|
-
var
|
|
3758
|
+
var cs = 3e5, ls = new class {
|
|
3779
3759
|
constructor() {
|
|
3780
3760
|
this.cacheByClient = /* @__PURE__ */ new WeakMap();
|
|
3781
3761
|
}
|
|
3782
3762
|
async getFilters(e) {
|
|
3783
3763
|
let t = this.cacheByClient, n = t.get(e);
|
|
3784
|
-
if (n && Date.now() - n.timestamp <
|
|
3764
|
+
if (n && Date.now() - n.timestamp < cs) return n.filters;
|
|
3785
3765
|
let r = ((await e.sync({
|
|
3786
3766
|
resourceTypes: ["filters"],
|
|
3787
3767
|
syncToken: "*"
|
|
@@ -3824,7 +3804,7 @@ var us = 3e5, ds = new class {
|
|
|
3824
3804
|
clearCache() {
|
|
3825
3805
|
this.cacheByClient = /* @__PURE__ */ new WeakMap();
|
|
3826
3806
|
}
|
|
3827
|
-
}(),
|
|
3807
|
+
}(), us = [
|
|
3828
3808
|
"project",
|
|
3829
3809
|
"section",
|
|
3830
3810
|
"task",
|
|
@@ -3834,38 +3814,38 @@ var us = 3e5, ds = new class {
|
|
|
3834
3814
|
"folder",
|
|
3835
3815
|
"reminder",
|
|
3836
3816
|
"location_reminder"
|
|
3837
|
-
],
|
|
3838
|
-
type: p.enum(
|
|
3817
|
+
], ds = {
|
|
3818
|
+
type: p.enum(us).describe("The type of entity to delete."),
|
|
3839
3819
|
id: p.string().min(1).describe("The ID of the entity to delete.")
|
|
3840
|
-
},
|
|
3820
|
+
}, fs = {
|
|
3841
3821
|
deletedEntity: p.object({
|
|
3842
|
-
type: p.enum(
|
|
3822
|
+
type: p.enum(us).describe("The type of deleted entity."),
|
|
3843
3823
|
id: p.string().describe("The ID of the deleted entity.")
|
|
3844
3824
|
}).describe("Information about the deleted entity."),
|
|
3845
3825
|
success: p.boolean().describe("Whether the deletion was successful.")
|
|
3846
|
-
},
|
|
3847
|
-
function
|
|
3848
|
-
return e.length >
|
|
3826
|
+
}, ps = "This can't be undone.", ms = 80;
|
|
3827
|
+
function hs(e) {
|
|
3828
|
+
return e.length > ms ? `${e.slice(0, 79)}…` : e;
|
|
3849
3829
|
}
|
|
3850
|
-
async function
|
|
3830
|
+
async function gs(e, t, n) {
|
|
3851
3831
|
switch (t) {
|
|
3852
3832
|
case "section": return `the section "${(await e.getSection(n)).name}"`;
|
|
3853
|
-
case "task": return `the task "${
|
|
3854
|
-
case "comment": return `the comment "${
|
|
3833
|
+
case "task": return `the task "${hs((await e.getTask(n)).content)}"`;
|
|
3834
|
+
case "comment": return `the comment "${hs((await e.getComment(n)).content)}"`;
|
|
3855
3835
|
case "label": return `the label "${(await e.getLabel(n)).name}"`;
|
|
3856
3836
|
case "filter": {
|
|
3857
|
-
let t = await
|
|
3837
|
+
let t = await ls.findById(e, n);
|
|
3858
3838
|
return t ? `the filter "${t.name}"` : void 0;
|
|
3859
3839
|
}
|
|
3860
3840
|
case "folder": return `the folder "${(await e.getFolder(n)).name}"`;
|
|
3861
|
-
case "reminder": return `the reminder on the task "${
|
|
3862
|
-
case "location_reminder": return `the location reminder on the task "${
|
|
3841
|
+
case "reminder": return `the reminder on the task "${hs((await e.getTask((await e.getReminder(n)).itemId)).content)}"`;
|
|
3842
|
+
case "location_reminder": return `the location reminder on the task "${hs((await e.getTask((await e.getLocationReminder(n)).itemId)).content)}"`;
|
|
3863
3843
|
}
|
|
3864
3844
|
}
|
|
3865
|
-
async function
|
|
3866
|
-
return `Delete ${await r(t, () =>
|
|
3845
|
+
async function _s(e, t, n, { lookUp: r }) {
|
|
3846
|
+
return `Delete ${await r(t, () => gs(e, t, n)) ?? `the ${t.replace("_", " ")} (id=${n})`}? ${t === "folder" ? "Its projects are kept and moved to the top level of the workspace." : ps}`;
|
|
3867
3847
|
}
|
|
3868
|
-
async function
|
|
3848
|
+
async function vs(e, t, n) {
|
|
3869
3849
|
switch (t) {
|
|
3870
3850
|
case "project":
|
|
3871
3851
|
await e.deleteProject(n);
|
|
@@ -3896,11 +3876,11 @@ async function bs(e, t, n) {
|
|
|
3896
3876
|
return;
|
|
3897
3877
|
}
|
|
3898
3878
|
}
|
|
3899
|
-
var
|
|
3879
|
+
var ys = {
|
|
3900
3880
|
name: B.DELETE_OBJECT,
|
|
3901
3881
|
description: "Delete a project, section, task, comment, label, filter, folder, reminder, or location_reminder by its ID. Projects can be deleted whether active or archived (find archived ones via find-projects with archivedStatus); note a workspace project must be archived before it can be deleted, while personal projects can be deleted regardless. Deleting a folder keeps its projects, moving them to the top level of the workspace.",
|
|
3902
|
-
parameters:
|
|
3903
|
-
outputSchema:
|
|
3882
|
+
parameters: ds,
|
|
3883
|
+
outputSchema: fs,
|
|
3904
3884
|
annotations: {
|
|
3905
3885
|
readOnlyHint: !1,
|
|
3906
3886
|
destructiveHint: !0,
|
|
@@ -3911,10 +3891,10 @@ var xs = {
|
|
|
3911
3891
|
if (e.type === "project") {
|
|
3912
3892
|
let n = await G(t, e.id);
|
|
3913
3893
|
if (de(n) && !n.isArchived) throw Error(`Workspace project "${n.name}" must be archived before it can be deleted. Archive the project first, then delete it.`);
|
|
3914
|
-
r = `Delete the project "${n.name}" and everything in it? ${
|
|
3894
|
+
r = `Delete the project "${n.name}" and everything in it? ${ps}`;
|
|
3915
3895
|
} else {
|
|
3916
3896
|
let n = e.type;
|
|
3917
|
-
r = (r) =>
|
|
3897
|
+
r = (r) => _s(t, n, e.id, r);
|
|
3918
3898
|
}
|
|
3919
3899
|
let i = await n?.confirm({
|
|
3920
3900
|
key: "delete",
|
|
@@ -3929,7 +3909,7 @@ var xs = {
|
|
|
3929
3909
|
},
|
|
3930
3910
|
success: !1
|
|
3931
3911
|
}
|
|
3932
|
-
} : (await
|
|
3912
|
+
} : (await vs(t, e.type, e.id), {
|
|
3933
3913
|
textContent: e.type === "folder" ? `Deleted folder: id=${e.id}. Its projects were kept and moved to the top level of the workspace.` : `Deleted ${e.type}: id=${e.id}`,
|
|
3934
3914
|
structuredContent: {
|
|
3935
3915
|
deletedEntity: {
|
|
@@ -3940,21 +3920,21 @@ var xs = {
|
|
|
3940
3920
|
}
|
|
3941
3921
|
});
|
|
3942
3922
|
}
|
|
3943
|
-
},
|
|
3923
|
+
}, bs = 5, xs = ["file", "url"], Ss = {
|
|
3944
3924
|
projectId: p.string().min(1).describe("The ID of the project to export as CSV."),
|
|
3945
|
-
format: p.enum(
|
|
3925
|
+
format: p.enum(xs).default("file").describe("How to return the CSV. \"file\" returns the CSV content, which can be passed straight back to import-into-project. \"url\" uploads it and returns a download link instead, so the CSV of a large project is not returned in full. The link is public, permanent and cannot be revoked: anyone holding it can open it, so only use it when the user asks for a link."),
|
|
3946
3926
|
useRelativeDates: p.boolean().optional().describe("Export due dates relative to the import date (e.g. \"day 3\") instead of absolute dates. Defaults to false.")
|
|
3947
|
-
},
|
|
3948
|
-
format: p.enum(
|
|
3927
|
+
}, Cs = {
|
|
3928
|
+
format: p.enum(xs).describe("The format the template was exported in."),
|
|
3949
3929
|
content: p.string().optional().describe("The project as CSV. Only present when format is \"file\"."),
|
|
3950
3930
|
lineCount: p.number().optional().describe("Number of rows in the exported CSV. Only present when format is \"file\"."),
|
|
3951
3931
|
fileName: p.string().optional().describe("The generated file name. Only present when format is \"url\"."),
|
|
3952
3932
|
fileUrl: p.string().optional().describe("The shareable download URL. Only present when format is \"url\".")
|
|
3953
|
-
},
|
|
3933
|
+
}, ws = {
|
|
3954
3934
|
name: B.EXPORT_PROJECT,
|
|
3955
3935
|
description: "Export a project as CSV, like the app's \"Export as CSV\": as CSV content, or as a download link. To save a project as a template in the user's Todoist, use add-template instead. Use it to duplicate a project, share its structure, or hand the CSV to import-into-project. To read a project rather than export it, use find-tasks instead — it returns structured tasks rather than raw CSV. The project itself is not modified, but the \"url\" format uploads a copy and returns a public, permanent link that anyone holding it can open.",
|
|
3956
|
-
parameters:
|
|
3957
|
-
outputSchema:
|
|
3936
|
+
parameters: Ss,
|
|
3937
|
+
outputSchema: Cs,
|
|
3958
3938
|
annotations: {
|
|
3959
3939
|
readOnlyHint: !1,
|
|
3960
3940
|
destructiveHint: !1,
|
|
@@ -3981,7 +3961,7 @@ var xs = {
|
|
|
3981
3961
|
useRelativeDates: n
|
|
3982
3962
|
}), a = i.split("\n").filter((e) => e.trim().length > 0);
|
|
3983
3963
|
return {
|
|
3984
|
-
textContent:
|
|
3964
|
+
textContent: Ts({
|
|
3985
3965
|
projectId: e,
|
|
3986
3966
|
lines: a
|
|
3987
3967
|
}),
|
|
@@ -3993,26 +3973,26 @@ var xs = {
|
|
|
3993
3973
|
};
|
|
3994
3974
|
}
|
|
3995
3975
|
};
|
|
3996
|
-
function
|
|
3997
|
-
let n = `Exported project (id=${e}) as CSV (${t.length} row${t.length === 1 ? "" : "s"}).`, r = t.slice(0,
|
|
3976
|
+
function Ts({ projectId: e, lines: t }) {
|
|
3977
|
+
let n = `Exported project (id=${e}) as CSV (${t.length} row${t.length === 1 ? "" : "s"}).`, r = t.slice(0, bs).join("\n"), i = t.length - bs;
|
|
3998
3978
|
return i > 0 ? `${n}\n\n${r}\n… ${i} more row${i === 1 ? "" : "s"} in the full content.` : `${n}\n\n${r}`;
|
|
3999
3979
|
}
|
|
4000
3980
|
// src/utils/children.ts
|
|
4001
|
-
var
|
|
3981
|
+
var Es = J.pick({
|
|
4002
3982
|
id: !0,
|
|
4003
3983
|
content: !0,
|
|
4004
3984
|
dueDate: !0,
|
|
4005
3985
|
checked: !0
|
|
4006
|
-
}).extend({ hasChildren: p.boolean().describe("Whether this subtask has subtasks of its own. Fetch it with includeChildren to expand.") }),
|
|
3986
|
+
}).extend({ hasChildren: p.boolean().describe("Whether this subtask has subtasks of its own. Fetch it with includeChildren to expand.") }), Ds = mi.pick({
|
|
4007
3987
|
id: !0,
|
|
4008
3988
|
name: !0
|
|
4009
|
-
}).extend({ hasChildren: p.boolean().describe("Whether this sub-project has sub-projects of its own. Fetch it with includeChildren to expand.") }),
|
|
3989
|
+
}).extend({ hasChildren: p.boolean().describe("Whether this sub-project has sub-projects of its own. Fetch it with includeChildren to expand.") }), Os = {
|
|
4010
3990
|
childCount: p.number().optional().describe("The number of direct children listed in children. Only present when children were requested and the type supports them. 0 means the object definitively has none."),
|
|
4011
|
-
children: p.array(p.union([
|
|
3991
|
+
children: p.array(p.union([Es, Ds])).optional().describe("Direct children only: subtasks for a task, sub-projects for a project. Completed subtasks and archived sub-projects are excluded."),
|
|
4012
3992
|
hasMoreChildren: p.boolean().optional().describe(`Present when the object has more than ${D.CHILDREN_MAX} direct children and the list was truncated. Page through the rest with find-tasks by parentId for subtasks, or find-projects for sub-projects.`),
|
|
4013
3993
|
childrenError: p.string().optional().describe("Present when the children lookup failed or returned incomplete information. When no children are listed alongside it, childCount is unknown - do not read its absence as \"no children\".")
|
|
4014
3994
|
};
|
|
4015
|
-
async function
|
|
3995
|
+
async function ks(e, t) {
|
|
4016
3996
|
let { results: n, nextCursor: r } = await e.getTasks({
|
|
4017
3997
|
parentId: t,
|
|
4018
3998
|
limit: D.CHILDREN_MAX
|
|
@@ -4036,7 +4016,7 @@ async function js(e, t) {
|
|
|
4036
4016
|
childrenError: a ? `Could not check ${a} of ${n.length} subtasks for subtasks of their own; those are reported as hasChildren=false.` : void 0
|
|
4037
4017
|
};
|
|
4038
4018
|
}
|
|
4039
|
-
async function
|
|
4019
|
+
async function As(e, t) {
|
|
4040
4020
|
if (!ue(t)) return {
|
|
4041
4021
|
childCount: 0,
|
|
4042
4022
|
children: []
|
|
@@ -4058,30 +4038,30 @@ async function Ms(e, t) {
|
|
|
4058
4038
|
hasMoreChildren: i.length > a.length || void 0
|
|
4059
4039
|
};
|
|
4060
4040
|
}
|
|
4061
|
-
async function
|
|
4041
|
+
async function js(e) {
|
|
4062
4042
|
try {
|
|
4063
4043
|
return await e();
|
|
4064
4044
|
} catch (e) {
|
|
4065
4045
|
return { childrenError: e instanceof Error ? e.message : String(e) };
|
|
4066
4046
|
}
|
|
4067
4047
|
}
|
|
4068
|
-
function
|
|
4048
|
+
function Ms(e, t) {
|
|
4069
4049
|
if (t.childCount === void 0) return t.childrenError ? ` • ${e}=unavailable` : "";
|
|
4070
4050
|
let n = t.hasMoreChildren ? "+" : "", r = t.childrenError ? " (partial)" : "";
|
|
4071
4051
|
return ` • ${e}=${t.childCount}${n}${r}`;
|
|
4072
4052
|
}
|
|
4073
4053
|
// src/tools/fetch-object.ts
|
|
4074
|
-
var
|
|
4054
|
+
var Ns = [
|
|
4075
4055
|
"task",
|
|
4076
4056
|
"project",
|
|
4077
4057
|
"comment",
|
|
4078
4058
|
"section",
|
|
4079
4059
|
"template"
|
|
4080
|
-
],
|
|
4081
|
-
type: p.enum(
|
|
4060
|
+
], Ps = {
|
|
4061
|
+
type: p.enum(Ns).describe("The type of object to fetch."),
|
|
4082
4062
|
id: p.string().regex(Ca).describe("The unique ID of the object to fetch. For a template, also a gallery slug (\"product-launch\") or a Todoist template URL."),
|
|
4083
4063
|
includeChildren: p.boolean().optional().describe("Also return the direct children of the object: subtasks for a task, sub-projects for a project. Returns childCount plus a compact list, flagging each child that has children of its own. Use this to check whether a task hides subtasks instead of a speculative find-tasks lookup. Ignored for comments, sections and templates.")
|
|
4084
|
-
},
|
|
4064
|
+
}, Fs = p.object({
|
|
4085
4065
|
id: p.string(),
|
|
4086
4066
|
name: p.string(),
|
|
4087
4067
|
description: p.string(),
|
|
@@ -4090,22 +4070,22 @@ var Fs = [
|
|
|
4090
4070
|
sharedWithWorkspaceMembers: p.boolean().optional(),
|
|
4091
4071
|
canEdit: p.boolean().optional().describe("Whether update-template can change it."),
|
|
4092
4072
|
content: p.record(p.string(), p.unknown()).optional().describe("The template's content, in the shape update-template's `content` takes. Absent for setup templates.")
|
|
4093
|
-
}),
|
|
4094
|
-
type: p.enum(
|
|
4073
|
+
}), Is = {
|
|
4074
|
+
type: p.enum(Ns).describe("The type of object fetched."),
|
|
4095
4075
|
id: p.string().describe("The ID of the fetched object."),
|
|
4096
4076
|
object: p.union([
|
|
4097
4077
|
J,
|
|
4098
4078
|
mi,
|
|
4099
4079
|
bi,
|
|
4100
4080
|
hi,
|
|
4101
|
-
|
|
4081
|
+
Fs
|
|
4102
4082
|
]).describe("The fetched object data."),
|
|
4103
|
-
...
|
|
4104
|
-
},
|
|
4083
|
+
...Os
|
|
4084
|
+
}, Ls = {
|
|
4105
4085
|
name: B.FETCH_OBJECT,
|
|
4106
4086
|
description: "Fetch a single task, project, comment, section, or template by its ID. Use this when you have a specific object ID and want to retrieve its full details. Set includeChildren to also get its direct subtasks or sub-projects. A template comes with its full content (layout, sections, tasks, comments): to edit a saved template's content, change it and send all of it back to update-template as `content`.",
|
|
4107
|
-
parameters:
|
|
4108
|
-
outputSchema:
|
|
4087
|
+
parameters: Ps,
|
|
4088
|
+
outputSchema: Is,
|
|
4109
4089
|
annotations: {
|
|
4110
4090
|
readOnlyHint: !0,
|
|
4111
4091
|
destructiveHint: !1,
|
|
@@ -4116,9 +4096,9 @@ var Fs = [
|
|
|
4116
4096
|
try {
|
|
4117
4097
|
switch (n) {
|
|
4118
4098
|
case "task": {
|
|
4119
|
-
let [e, a] = await Promise.all([t.getTask(r), i ?
|
|
4099
|
+
let [e, a] = await Promise.all([t.getTask(r), i ? js(() => ks(t, r)) : Promise.resolve({})]), o = K(e);
|
|
4120
4100
|
return {
|
|
4121
|
-
textContent: `Found task: ${o.content} • id=${o.id} • priority=${o.priority} • project=${o.projectId}${
|
|
4101
|
+
textContent: `Found task: ${o.content} • id=${o.id} • priority=${o.priority} • project=${o.projectId}${Ms("subtasks", a)}`,
|
|
4122
4102
|
structuredContent: {
|
|
4123
4103
|
type: n,
|
|
4124
4104
|
id: r,
|
|
@@ -4128,9 +4108,9 @@ var Fs = [
|
|
|
4128
4108
|
};
|
|
4129
4109
|
}
|
|
4130
4110
|
case "project": {
|
|
4131
|
-
let e = await G(t, r), a = Jr(e), o = i ? await
|
|
4111
|
+
let e = await G(t, r), a = Jr(e), o = i ? await js(() => As(t, e)) : {};
|
|
4132
4112
|
return {
|
|
4133
|
-
textContent: `Found project: ${a.name} • id=${a.id} • color=${a.color}${a.icon ? ` • icon=${a.icon}` : ""} • viewStyle=${a.viewStyle}${
|
|
4113
|
+
textContent: `Found project: ${a.name} • id=${a.id} • color=${a.color}${a.icon ? ` • icon=${a.icon}` : ""} • viewStyle=${a.viewStyle}${Ms("subProjects", o)}`,
|
|
4134
4114
|
structuredContent: {
|
|
4135
4115
|
type: n,
|
|
4136
4116
|
id: r,
|
|
@@ -4164,11 +4144,11 @@ var Fs = [
|
|
|
4164
4144
|
};
|
|
4165
4145
|
}
|
|
4166
4146
|
case "template": {
|
|
4167
|
-
let e = Ta(r), [i, a] = await Promise.all([t.getTemplate(e),
|
|
4147
|
+
let e = Ta(r), [i, a] = await Promise.all([t.getTemplate(e), Rs(() => t.getTemplateContent(e))]), o = i.templateType === "setup";
|
|
4168
4148
|
if (!o && a.status === "rejected") throw a.reason;
|
|
4169
4149
|
let s = !o && a.status === "fulfilled" ? No(a.value.content) : void 0;
|
|
4170
4150
|
return {
|
|
4171
|
-
textContent: `Found template: ${i.name} • id=${i.id} • ${s ?
|
|
4151
|
+
textContent: `Found template: ${i.name} • id=${i.id} • ${s ? Vo(s) : "a setup template, which creates several projects and labels; its content cannot be read"}`,
|
|
4172
4152
|
structuredContent: {
|
|
4173
4153
|
type: n,
|
|
4174
4154
|
id: i.id,
|
|
@@ -4192,7 +4172,7 @@ var Fs = [
|
|
|
4192
4172
|
}
|
|
4193
4173
|
}
|
|
4194
4174
|
};
|
|
4195
|
-
async function
|
|
4175
|
+
async function Rs(e) {
|
|
4196
4176
|
try {
|
|
4197
4177
|
return {
|
|
4198
4178
|
status: "fulfilled",
|
|
@@ -4206,17 +4186,17 @@ async function Bs(e) {
|
|
|
4206
4186
|
}
|
|
4207
4187
|
}
|
|
4208
4188
|
// src/tools/fetch.ts
|
|
4209
|
-
var
|
|
4189
|
+
var zs = { id: p.string().min(1).describe("A unique identifier for the document in the format \"task:{id}\" or \"project:{id}\".") }, Bs = {
|
|
4210
4190
|
id: p.string().describe("The ID of the fetched document."),
|
|
4211
4191
|
title: p.string().describe("The title of the document."),
|
|
4212
4192
|
text: p.string().describe("The text content of the document."),
|
|
4213
4193
|
url: p.string().describe("The URL of the document."),
|
|
4214
4194
|
metadata: p.record(p.string(), p.unknown()).optional().describe("Additional metadata about the document.")
|
|
4215
|
-
},
|
|
4195
|
+
}, Vs = {
|
|
4216
4196
|
name: B.FETCH,
|
|
4217
4197
|
description: "Fetch the full contents of a task or project by its ID. The ID should be in the format \"task:{id}\" or \"project:{id}\". (Comments may exist; use find-comments to retrieve them.)",
|
|
4218
|
-
parameters:
|
|
4219
|
-
outputSchema:
|
|
4198
|
+
parameters: zs,
|
|
4199
|
+
outputSchema: Bs,
|
|
4220
4200
|
annotations: {
|
|
4221
4201
|
readOnlyHint: !0,
|
|
4222
4202
|
destructiveHint: !1,
|
|
@@ -4270,32 +4250,32 @@ var Vs = { id: p.string().min(1).describe("A unique identifier for the document
|
|
|
4270
4250
|
structuredContent: a
|
|
4271
4251
|
};
|
|
4272
4252
|
}
|
|
4273
|
-
},
|
|
4274
|
-
function
|
|
4275
|
-
return Q(e).pipe(
|
|
4253
|
+
}, Hs = p.union([p.iso.date(), p.iso.datetime({ offset: !0 })]);
|
|
4254
|
+
function Us(e) {
|
|
4255
|
+
return Q(e).pipe(Hs.optional());
|
|
4276
4256
|
}
|
|
4277
|
-
var
|
|
4257
|
+
var Ws = {
|
|
4278
4258
|
objectType: p.enum(g).optional().describe("Type of object to filter by."),
|
|
4279
4259
|
objectId: p.string().optional().describe("Filter by specific object ID (task, project, or comment). Requires objectType."),
|
|
4280
4260
|
eventType: p.enum(h).optional().describe("Type of event to filter by."),
|
|
4281
4261
|
projectId: p.string().optional().describe("Filter events by parent project ID."),
|
|
4282
4262
|
taskId: p.string().optional().describe("Filter events by parent task ID (for subtask events)."),
|
|
4283
4263
|
initiatorId: p.string().optional().describe("Filter by the user ID who initiated the event. A first-person question (\"what did I complete\") needs this: without it the results cover every collaborator. Get the ID from user-info when you do not already have it."),
|
|
4284
|
-
dateFrom:
|
|
4285
|
-
dateTo:
|
|
4264
|
+
dateFrom: Us("Inclusive start of the activity range, as an ISO 8601 date or date-time. For all events on one local calendar day, use that day's start, for example \"2026-08-02T00:00:00-04:00\". Natural-language dates such as \"tomorrow\" are not supported."),
|
|
4265
|
+
dateTo: Us("Exclusive end of the activity range, as an ISO 8601 date or date-time. For all events on 2026-08-02, use \"2026-08-03T00:00:00-04:00\". Natural-language dates such as \"tomorrow\" are not supported."),
|
|
4286
4266
|
limit: p.number().int().min(1).max(D.ACTIVITY_MAX).default(D.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
|
|
4287
4267
|
cursor: p.string().optional().describe("Pagination cursor for retrieving the next page of results.")
|
|
4288
|
-
},
|
|
4268
|
+
}, Gs = {
|
|
4289
4269
|
events: p.array(xi).describe("The activity events."),
|
|
4290
4270
|
nextCursor: p.string().optional(),
|
|
4291
4271
|
totalCount: p.number().describe("The total number of events in this page."),
|
|
4292
4272
|
hasMore: p.boolean(),
|
|
4293
4273
|
appliedFilters: p.record(p.string(), p.unknown())
|
|
4294
|
-
},
|
|
4274
|
+
}, Ks = {
|
|
4295
4275
|
name: B.FIND_ACTIVITY,
|
|
4296
4276
|
description: "Retrieve activity logs to monitor and audit changes in Todoist. Shows events from all users by default (use initiatorId to filter by specific user). To answer what someone completed in a period, including recurring task occurrences, use objectType \"task\", eventType \"completed\", and dateFrom/dateTo. For a first-person question (\"what did I get done\"), also set initiatorId to the current user from user-info, or the answer includes collaborators' completions. Track task completions, updates, deletions, project changes, and more with flexible filtering. Activity history availability and retention depend on the user plan.",
|
|
4297
|
-
parameters:
|
|
4298
|
-
outputSchema:
|
|
4277
|
+
parameters: Ws,
|
|
4278
|
+
outputSchema: Gs,
|
|
4299
4279
|
annotations: {
|
|
4300
4280
|
readOnlyHint: !0,
|
|
4301
4281
|
destructiveHint: !1,
|
|
@@ -4309,9 +4289,9 @@ var Ks = {
|
|
|
4309
4289
|
cursor: d ?? null
|
|
4310
4290
|
};
|
|
4311
4291
|
n && i ? f.objectEventTypes = `${n}:${i}` : n ? f.objectEventTypes = `${n}:` : i && (f.objectEventTypes = `:${i}`), r && r !== "remove" && (f.objectId = r), a && (f.parentProjectId = a), o && (f.parentItemId = o), s && (f.initiatorId = s), c && (f.dateFrom = c), l && (f.dateTo = l);
|
|
4312
|
-
let { results: p, nextCursor: m } = await t.getActivityLogs(f), h = p.map(Xr), _ = h.length > 0 ? await
|
|
4292
|
+
let { results: p, nextCursor: m } = await t.getActivityLogs(f), h = p.map(Xr), _ = h.length > 0 ? await Ys(t) : void 0, v = Xs(_);
|
|
4313
4293
|
return {
|
|
4314
|
-
textContent:
|
|
4294
|
+
textContent: Zs({
|
|
4315
4295
|
events: h,
|
|
4316
4296
|
args: e,
|
|
4317
4297
|
nextCursor: m,
|
|
@@ -4327,26 +4307,26 @@ var Ks = {
|
|
|
4327
4307
|
}
|
|
4328
4308
|
};
|
|
4329
4309
|
}
|
|
4330
|
-
},
|
|
4331
|
-
function
|
|
4310
|
+
}, qs = "UTC";
|
|
4311
|
+
function Js(e) {
|
|
4332
4312
|
try {
|
|
4333
4313
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
4334
4314
|
} catch {
|
|
4335
4315
|
return !1;
|
|
4336
4316
|
}
|
|
4337
4317
|
}
|
|
4338
|
-
async function
|
|
4318
|
+
async function Ys(e) {
|
|
4339
4319
|
try {
|
|
4340
4320
|
return await R(() => e.getUser());
|
|
4341
4321
|
} catch (e) {
|
|
4342
4322
|
return console.error(`${B.FIND_ACTIVITY}: could not load the user's time zone, using UTC`, e), null;
|
|
4343
4323
|
}
|
|
4344
4324
|
}
|
|
4345
|
-
function
|
|
4325
|
+
function Xs(e) {
|
|
4346
4326
|
let t = e?.tzInfo?.timezone;
|
|
4347
|
-
return t &&
|
|
4327
|
+
return t && Js(t) ? t : qs;
|
|
4348
4328
|
}
|
|
4349
|
-
function
|
|
4329
|
+
function Zs({ events: e, args: t, nextCursor: n, initiatorNames: r, timeZone: i }) {
|
|
4350
4330
|
let a = "Activity events", o = [];
|
|
4351
4331
|
if (t.eventType && o.push(`${t.eventType}`), t.objectType) {
|
|
4352
4332
|
let e = t.objectType === "task" ? "tasks" : `${t.objectType}s`;
|
|
@@ -4363,20 +4343,20 @@ function $s({ events: e, args: t, nextCursor: n, initiatorNames: r, timeZone: i
|
|
|
4363
4343
|
nextCursor: n ?? void 0,
|
|
4364
4344
|
filterHints: s,
|
|
4365
4345
|
notes: e.length > 0 ? [`Times are in ${i}.`] : void 0,
|
|
4366
|
-
previewLines:
|
|
4346
|
+
previewLines: Qs(e, r, i, Math.min(e.length, t.limit)),
|
|
4367
4347
|
zeroReasonHints: c
|
|
4368
4348
|
});
|
|
4369
4349
|
}
|
|
4370
|
-
function
|
|
4371
|
-
let i = e.slice(0, r).map((e) =>
|
|
4350
|
+
function Qs(e, t, n, r = 10) {
|
|
4351
|
+
let i = e.slice(0, r).map((e) => $s(e, t, n)).join("\n");
|
|
4372
4352
|
if (e.length > r) {
|
|
4373
4353
|
let t = e.length - r;
|
|
4374
4354
|
return `${i}\n ... and ${t} more event${t === 1 ? "" : "s"}`;
|
|
4375
4355
|
}
|
|
4376
4356
|
return i;
|
|
4377
4357
|
}
|
|
4378
|
-
function
|
|
4379
|
-
let r =
|
|
4358
|
+
function $s(e, t, n) {
|
|
4359
|
+
let r = ec(e.eventDate, n), i = `${e.eventType} ${e.objectType}`, a = "";
|
|
4380
4360
|
if (e.extraData) {
|
|
4381
4361
|
let t = e.extraData.content || e.extraData.name || e.extraData.last_content;
|
|
4382
4362
|
t && typeof t == "string" && (a = ` • "${t.length > 50 ? `${t.substring(0, 47)}...` : t}"`);
|
|
@@ -4389,7 +4369,7 @@ function tc(e, t, n) {
|
|
|
4389
4369
|
let c = e.parentProjectId ? ` • project=${e.parentProjectId}` : "";
|
|
4390
4370
|
return ` [${r}] ${i}${a}${o}${s}${c}`;
|
|
4391
4371
|
}
|
|
4392
|
-
function
|
|
4372
|
+
function ec(e, t) {
|
|
4393
4373
|
try {
|
|
4394
4374
|
let n = new Date(e);
|
|
4395
4375
|
return `${n.toLocaleDateString("en-US", {
|
|
@@ -4409,24 +4389,24 @@ function nc(e, t) {
|
|
|
4409
4389
|
}
|
|
4410
4390
|
}
|
|
4411
4391
|
// src/tools/find-comments.ts
|
|
4412
|
-
var
|
|
4392
|
+
var tc = {
|
|
4413
4393
|
taskId: p.string().optional().describe("Find comments for a specific task."),
|
|
4414
4394
|
projectId: p.string().optional().describe("Find comments for a specific project. Project ID should be an ID string, or the text \"inbox\", for inbox tasks."),
|
|
4415
4395
|
commentId: p.string().optional().describe("Get a specific comment by ID."),
|
|
4416
4396
|
cursor: p.string().optional().describe("Pagination cursor for retrieving more results."),
|
|
4417
4397
|
limit: p.number().int().min(1).max(D.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
|
|
4418
|
-
},
|
|
4398
|
+
}, nc = {
|
|
4419
4399
|
comments: p.array(bi).describe("The found comments."),
|
|
4420
4400
|
searchType: p.string().describe("The type of search performed: \"single\" (comment ID), \"task\" (task ID), or \"project\" (project ID)."),
|
|
4421
4401
|
searchId: p.string().describe("The ID that was searched for (comment, task, or project ID)."),
|
|
4422
4402
|
hasMore: p.boolean(),
|
|
4423
4403
|
nextCursor: p.string().optional(),
|
|
4424
4404
|
totalCount: p.number().describe("The total number of comments in this page.")
|
|
4425
|
-
},
|
|
4405
|
+
}, rc = {
|
|
4426
4406
|
name: B.FIND_COMMENTS,
|
|
4427
4407
|
description: "Find comments by task, project, or get a specific comment by ID. Exactly one of taskId, projectId, or commentId must be provided.",
|
|
4428
|
-
parameters:
|
|
4429
|
-
outputSchema:
|
|
4408
|
+
parameters: tc,
|
|
4409
|
+
outputSchema: nc,
|
|
4430
4410
|
annotations: {
|
|
4431
4411
|
readOnlyHint: !0,
|
|
4432
4412
|
destructiveHint: !1,
|
|
@@ -4462,7 +4442,7 @@ var rc = {
|
|
|
4462
4442
|
} else throw Error("Invalid state: no search parameter provided");
|
|
4463
4443
|
let c = s.map(Yr);
|
|
4464
4444
|
return {
|
|
4465
|
-
textContent:
|
|
4445
|
+
textContent: ic({
|
|
4466
4446
|
comments: c,
|
|
4467
4447
|
searchType: e.commentId ? "single" : e.taskId ? "task" : "project",
|
|
4468
4448
|
searchId: e.commentId || e.taskId || e.projectId || "",
|
|
@@ -4480,7 +4460,7 @@ var rc = {
|
|
|
4480
4460
|
};
|
|
4481
4461
|
}
|
|
4482
4462
|
};
|
|
4483
|
-
function
|
|
4463
|
+
function ic({ comments: e, searchType: t, searchId: n, hasMore: r, nextCursor: i }) {
|
|
4484
4464
|
if (e.length === 0) return `No comments found for ${t}${t === "single" ? "" : ` ${n}`}`;
|
|
4485
4465
|
let a;
|
|
4486
4466
|
if (t === "single") {
|
|
@@ -4497,43 +4477,43 @@ function oc({ comments: e, searchType: t, searchId: n, hasMore: r, nextCursor: i
|
|
|
4497
4477
|
}
|
|
4498
4478
|
return a;
|
|
4499
4479
|
}
|
|
4500
|
-
var
|
|
4480
|
+
var ac = {
|
|
4501
4481
|
labels: p.string().array().max(D.FILTER_VALUES_MAX).optional().describe("The labels to filter the tasks by"),
|
|
4502
4482
|
labelsOperator: p.enum(["and", "or"]).optional().describe("The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is \"or\".")
|
|
4503
4483
|
};
|
|
4504
|
-
function
|
|
4484
|
+
function oc(e) {
|
|
4505
4485
|
let t = e.trim();
|
|
4506
4486
|
return t.startsWith("@") ? t.slice(1) : t;
|
|
4507
4487
|
}
|
|
4508
|
-
function
|
|
4488
|
+
function sc(e = [], t = "or") {
|
|
4509
4489
|
if (e.length === 0) return "";
|
|
4510
4490
|
let n = t === "and" ? " & " : " | ";
|
|
4511
|
-
return `(${e.map((e) => `@${ae(
|
|
4491
|
+
return `(${e.map((e) => `@${ae(oc(e))}`).join(` ${n} `)})`;
|
|
4512
4492
|
}
|
|
4513
|
-
function
|
|
4493
|
+
function cc(e) {
|
|
4514
4494
|
return e.normalize("NFD").replace(/\p{M}/gu, "").toLowerCase();
|
|
4515
4495
|
}
|
|
4516
|
-
function
|
|
4517
|
-
let r = new Set(e.map(
|
|
4496
|
+
function lc(e, t, n = "or") {
|
|
4497
|
+
let r = new Set(e.map(cc)), i = t.map((e) => cc(oc(e)));
|
|
4518
4498
|
return n === "and" ? i.every((e) => r.has(e)) : i.some((e) => r.has(e));
|
|
4519
4499
|
}
|
|
4520
|
-
function
|
|
4521
|
-
let n =
|
|
4500
|
+
function uc(e, t) {
|
|
4501
|
+
let n = cc(oc(e)), r = new Set(t.filter((e) => cc(e) === n));
|
|
4522
4502
|
return r.size === 1 ? [...r][0] : void 0;
|
|
4523
4503
|
}
|
|
4524
|
-
function
|
|
4525
|
-
return e.map((e) => `@${
|
|
4504
|
+
function dc(e, t = "or") {
|
|
4505
|
+
return e.map((e) => `@${oc(e)}`).join(t === "and" ? " & " : " | ");
|
|
4526
4506
|
}
|
|
4527
4507
|
// src/tools/find-completed-tasks.ts
|
|
4528
|
-
var { FIND_ACTIVITY:
|
|
4529
|
-
function
|
|
4508
|
+
var { FIND_ACTIVITY: fc } = B;
|
|
4509
|
+
function pc({ since: e, until: t, userGmtOffset: n, now: r = /* @__PURE__ */ new Date() }) {
|
|
4530
4510
|
let i = jn(r, An(n)), a = t ?? (e ? Mn(e, 6) : i);
|
|
4531
4511
|
return {
|
|
4532
4512
|
since: e ?? Mn(a, -6),
|
|
4533
4513
|
until: a
|
|
4534
4514
|
};
|
|
4535
4515
|
}
|
|
4536
|
-
var
|
|
4516
|
+
var mc = {
|
|
4537
4517
|
getBy: p.enum(["completion", "due"]).default("completion").describe("The method to use to get the tasks: \"completion\" to get tasks by completion date (ie, when the task was actually completed), \"due\" to get tasks by due date (ie, when the task was due to be completed by)."),
|
|
4538
4518
|
since: p.iso.date().optional().describe("Optional start date for completed tasks. Format: YYYY-MM-DD. Defaults to 6 days before until (or today if until is omitted), resulting in a 7-day window."),
|
|
4539
4519
|
until: p.iso.date().optional().describe("Optional end date for completed tasks. Format: YYYY-MM-DD. Defaults to 6 days after since (or today if since is omitted), resulting in a 7-day window."),
|
|
@@ -4544,18 +4524,18 @@ var gc = {
|
|
|
4544
4524
|
responsibleUser: p.string().optional().describe("Filter completed tasks assigned to this user. User ID, name, or email. For personal queries (summaries, plans, reports), set to current user from user-info to exclude collaborators. Defaults to all collaborators."),
|
|
4545
4525
|
limit: p.number().int().min(1).max(D.COMPLETED_TASKS_MAX).default(D.COMPLETED_TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
4546
4526
|
cursor: p.string().optional().describe("The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."),
|
|
4547
|
-
...
|
|
4548
|
-
},
|
|
4527
|
+
...ac
|
|
4528
|
+
}, hc = {
|
|
4549
4529
|
tasks: p.array(J).describe("The found completed tasks."),
|
|
4550
4530
|
nextCursor: p.string().optional(),
|
|
4551
4531
|
totalCount: p.number().describe("The total number of tasks in this page."),
|
|
4552
4532
|
hasMore: p.boolean(),
|
|
4553
4533
|
appliedFilters: p.record(p.string(), p.unknown())
|
|
4554
|
-
},
|
|
4534
|
+
}, gc = {
|
|
4555
4535
|
name: B.FIND_COMPLETED_TASKS,
|
|
4556
4536
|
description: "Get completed tasks in a date range. Neither getBy mode returns completions of a recurring task that is still active. For \"what did I complete/get done\" questions, or whenever recurring work should count, use find-activity instead — it reports completion events, including every occurrence of a recurring task. since/until are optional and default to a 7-day window when omitted. Includes all collaborators by default. Person-specific queries (summaries, plans, reports) require responsibleUser.",
|
|
4557
|
-
parameters:
|
|
4558
|
-
outputSchema:
|
|
4537
|
+
parameters: mc,
|
|
4538
|
+
outputSchema: hc,
|
|
4559
4539
|
annotations: {
|
|
4560
4540
|
readOnlyHint: !0,
|
|
4561
4541
|
destructiveHint: !1,
|
|
@@ -4564,12 +4544,12 @@ var gc = {
|
|
|
4564
4544
|
async execute(e, t) {
|
|
4565
4545
|
let { getBy: n, labels: r, labelsOperator: i, since: a, until: o, responsibleUser: s, projectId: c, cursor: l, ...u } = e, d = Qr(l);
|
|
4566
4546
|
if (d && (!a || !o)) throw Error("Cursor pagination requires explicit since and until. Reuse structuredContent.appliedFilters.since and structuredContent.appliedFilters.until from the previous page.");
|
|
4567
|
-
let f = await Ar(t, s), p = f?.email, m =
|
|
4547
|
+
let f = await Ar(t, s), p = f?.email, m = sc(r, i);
|
|
4568
4548
|
f && p && (m = jr(m, `assigned to: ${p}`));
|
|
4569
4549
|
let h = await t.getUser(), g = h.tzInfo?.gmtString || "+00:00", _ = await Pr({
|
|
4570
4550
|
projectId: c,
|
|
4571
4551
|
user: h
|
|
4572
|
-
}), v =
|
|
4552
|
+
}), v = pc({
|
|
4573
4553
|
since: a,
|
|
4574
4554
|
until: o,
|
|
4575
4555
|
userGmtOffset: g
|
|
@@ -4603,7 +4583,7 @@ var gc = {
|
|
|
4603
4583
|
} : {}
|
|
4604
4584
|
}), w = C.map(K);
|
|
4605
4585
|
return {
|
|
4606
|
-
textContent:
|
|
4586
|
+
textContent: _c({
|
|
4607
4587
|
tasks: w,
|
|
4608
4588
|
args: ee,
|
|
4609
4589
|
userGmtOffset: g,
|
|
@@ -4622,10 +4602,10 @@ var gc = {
|
|
|
4622
4602
|
};
|
|
4623
4603
|
}
|
|
4624
4604
|
};
|
|
4625
|
-
function
|
|
4605
|
+
function _c({ tasks: e, args: t, userGmtOffset: n, userTimezone: r, nextCursor: i, assigneeEmail: a, assigneeNames: o }) {
|
|
4626
4606
|
let s = t.getBy === "completion" ? "completed" : "due", c = `Completed tasks (by ${s} date)`, l = [];
|
|
4627
4607
|
if (l.push(`${s} date: ${t.since} to ${t.until}`), t.projectId && l.push(`project: ${t.projectId}`), t.sectionId && l.push(`section: ${t.sectionId}`), t.parentId && l.push(`parent: ${t.parentId}`), t.workspaceId && l.push(`workspace: ${t.workspaceId}`), t.labels && t.labels.length > 0) {
|
|
4628
|
-
let e =
|
|
4608
|
+
let e = dc(t.labels, t.labelsOperator);
|
|
4629
4609
|
l.push(`labels: ${e}`);
|
|
4630
4610
|
}
|
|
4631
4611
|
if (t.responsibleUser) {
|
|
@@ -4639,30 +4619,30 @@ function yc({ tasks: e, args: t, userGmtOffset: n, userTimezone: r, nextCursor:
|
|
|
4639
4619
|
limit: t.limit,
|
|
4640
4620
|
nextCursor: i ?? void 0,
|
|
4641
4621
|
filterHints: l,
|
|
4642
|
-
notes: [
|
|
4622
|
+
notes: [vc(t, n, r)],
|
|
4643
4623
|
previewLines: Ri(e, Math.min(e.length, t.limit), o),
|
|
4644
4624
|
zeroReasonHints: u
|
|
4645
4625
|
});
|
|
4646
4626
|
}
|
|
4647
|
-
function
|
|
4627
|
+
function vc(e, t, n) {
|
|
4648
4628
|
let r = "Completions of recurring tasks that are still active are not in this list.";
|
|
4649
|
-
if (e.getBy === "due") return `${r} ${
|
|
4629
|
+
if (e.getBy === "due") return `${r} ${fc} with objectType "task" and eventType "completed" reports them, but only by completion time: it cannot match a due-date range.`;
|
|
4650
4630
|
let i = (e) => Rn({
|
|
4651
4631
|
date: e,
|
|
4652
4632
|
timeZone: n,
|
|
4653
4633
|
fallbackOffset: t
|
|
4654
4634
|
});
|
|
4655
|
-
return `${r} To include them, call ${
|
|
4635
|
+
return `${r} To include them, call ${fc} with objectType "task", eventType "completed", dateFrom "${i(e.since)}" and dateTo "${i(Mn(e.until, 1))}".`;
|
|
4656
4636
|
}
|
|
4657
4637
|
// src/tools/find-folders.ts
|
|
4658
|
-
var { ADD_FOLDERS:
|
|
4638
|
+
var { ADD_FOLDERS: yc, FIND_PROJECTS: bc, LIST_WORKSPACES: xc } = B, Sc = { workspace: p.string().trim().min(1).optional().describe(`The workspace to list folders for, by name or ID (see ${xc}). Omit to list the folders of every workspace.`) }, Cc = {
|
|
4659
4639
|
folders: p.array(_i).describe("In sidebar order within each workspace."),
|
|
4660
4640
|
totalCount: p.number()
|
|
4661
|
-
},
|
|
4641
|
+
}, wc = {
|
|
4662
4642
|
name: B.FIND_FOLDERS,
|
|
4663
|
-
description: `List the folders that group a workspace's projects. Only workspace projects go in folders; personal projects nest under a parent project instead. To see a folder's projects, use ${
|
|
4664
|
-
parameters:
|
|
4665
|
-
outputSchema:
|
|
4643
|
+
description: `List the folders that group a workspace's projects. Only workspace projects go in folders; personal projects nest under a parent project instead. To see a folder's projects, use ${bc} with folderId.`,
|
|
4644
|
+
parameters: Sc,
|
|
4645
|
+
outputSchema: Cc,
|
|
4666
4646
|
annotations: {
|
|
4667
4647
|
readOnlyHint: !0,
|
|
4668
4648
|
destructiveHint: !1,
|
|
@@ -4671,10 +4651,10 @@ var { ADD_FOLDERS: xc, FIND_PROJECTS: Sc, LIST_WORKSPACES: Cc } = B, wc = { work
|
|
|
4671
4651
|
async execute({ workspace: e }, t) {
|
|
4672
4652
|
let n = e ? [await oa.resolveWorkspace(t, e)] : await oa.listWorkspaces(t), r = await Promise.all(n.map(async (e) => ({
|
|
4673
4653
|
...e,
|
|
4674
|
-
folders: await
|
|
4654
|
+
folders: await Tc(t, e.workspaceId)
|
|
4675
4655
|
}))), i = r.flatMap((e) => e.folders);
|
|
4676
4656
|
return {
|
|
4677
|
-
textContent:
|
|
4657
|
+
textContent: Ec(r),
|
|
4678
4658
|
structuredContent: {
|
|
4679
4659
|
folders: i,
|
|
4680
4660
|
totalCount: i.length
|
|
@@ -4682,38 +4662,38 @@ var { ADD_FOLDERS: xc, FIND_PROJECTS: Sc, LIST_WORKSPACES: Cc } = B, wc = { work
|
|
|
4682
4662
|
};
|
|
4683
4663
|
}
|
|
4684
4664
|
};
|
|
4685
|
-
async function
|
|
4665
|
+
async function Tc(e, t) {
|
|
4686
4666
|
return (await W({
|
|
4687
4667
|
apiMethod: (t) => R(() => e.getFolders(t)),
|
|
4688
4668
|
args: { workspaceId: t },
|
|
4689
4669
|
limit: D.FOLDERS_MAX
|
|
4690
4670
|
})).sort((e, t) => e.defaultOrder - t.defaultOrder).map(vi);
|
|
4691
4671
|
}
|
|
4692
|
-
function
|
|
4672
|
+
function Ec(e) {
|
|
4693
4673
|
return e.length === 0 ? "The user is not in any workspace. Folders exist only in workspaces; personal projects nest under a parent project instead." : e.map(({ workspaceId: e, workspaceName: t, folders: n }) => Z({
|
|
4694
4674
|
subject: `Folders in ${t} (id=${e})`,
|
|
4695
4675
|
count: n.length,
|
|
4696
4676
|
previewLines: n.map((e) => ` ${e.name} • id=${e.id}`).join("\n"),
|
|
4697
|
-
zeroReasonHints: ["No folders in this workspace", `Use ${
|
|
4677
|
+
zeroReasonHints: ["No folders in this workspace", `Use ${yc} to create one`]
|
|
4698
4678
|
})).join("\n");
|
|
4699
4679
|
}
|
|
4700
4680
|
// src/tools/find-labels.ts
|
|
4701
|
-
var
|
|
4681
|
+
var Dc = {
|
|
4702
4682
|
searchText: p.string().optional().describe("Search for a label by name (partial and case insensitive match). Supports wildcards (e.g. \"work*\" for prefix match). Use \"\\*\" for a literal asterisk. If omitted, all labels are returned."),
|
|
4703
4683
|
limit: p.number().int().min(1).max(D.LABELS_MAX).default(D.LABELS_DEFAULT).describe("The maximum number of labels to return."),
|
|
4704
4684
|
cursor: p.string().optional().describe("The cursor to get the next page of labels (cursor is obtained from the previous call to this tool, with the same parameters). Ignored when searchText is provided.")
|
|
4705
|
-
},
|
|
4685
|
+
}, Oc = {
|
|
4706
4686
|
labels: p.array(Ci).describe("The found personal labels."),
|
|
4707
4687
|
nextCursor: p.string().optional(),
|
|
4708
4688
|
totalCount: p.number().describe("The total number of labels in this page."),
|
|
4709
4689
|
hasMore: p.boolean(),
|
|
4710
4690
|
sharedLabels: p.array(p.string()).describe("Names of all shared labels visible to you. These have no IDs or metadata — use their names directly when filtering tasks."),
|
|
4711
4691
|
appliedFilters: p.record(p.string(), p.unknown())
|
|
4712
|
-
},
|
|
4692
|
+
}, kc = {
|
|
4713
4693
|
name: B.FIND_LABELS,
|
|
4714
4694
|
description: "List personal labels and shared labels. Personal labels have full metadata (id, name, color, order, isFavorite) and support pagination and name search (partial, case insensitive). Shared labels are labels used on tasks shared with you — they are returned as names only (no IDs or metadata). When searching, all matching personal labels are fetched across all pages and returned as a single result set (limit and cursor are ignored). When not searching, personal labels are returned with pagination.",
|
|
4715
|
-
parameters:
|
|
4716
|
-
outputSchema:
|
|
4695
|
+
parameters: Dc,
|
|
4696
|
+
outputSchema: Oc,
|
|
4717
4697
|
annotations: {
|
|
4718
4698
|
readOnlyHint: !0,
|
|
4719
4699
|
destructiveHint: !1,
|
|
@@ -4731,7 +4711,7 @@ var kc = {
|
|
|
4731
4711
|
cursor: e.cursor
|
|
4732
4712
|
};
|
|
4733
4713
|
return {
|
|
4734
|
-
textContent:
|
|
4714
|
+
textContent: Ac({
|
|
4735
4715
|
labels: i,
|
|
4736
4716
|
args: e,
|
|
4737
4717
|
nextCursor: a,
|
|
@@ -4748,7 +4728,7 @@ var kc = {
|
|
|
4748
4728
|
};
|
|
4749
4729
|
}
|
|
4750
4730
|
};
|
|
4751
|
-
function
|
|
4731
|
+
function Ac({ labels: e, args: t, nextCursor: n, sharedLabels: r }) {
|
|
4752
4732
|
let i = t.searchText ? `All labels matching "${t.searchText}"` : "Labels", a = [];
|
|
4753
4733
|
t.searchText && a.push(`searchText: "${t.searchText}"`);
|
|
4754
4734
|
let o = e.slice(0, 10).map(Ii).join("\n"), s = e.length - 10, c = s > 0 ? `${o}\n …and ${s} more` : o, l = [];
|
|
@@ -4765,10 +4745,10 @@ function Mc({ labels: e, args: t, nextCursor: n, sharedLabels: r }) {
|
|
|
4765
4745
|
}) + u;
|
|
4766
4746
|
}
|
|
4767
4747
|
// src/tools/find-project-collaborators.ts
|
|
4768
|
-
var { FIND_PROJECTS:
|
|
4748
|
+
var { FIND_PROJECTS: jc, ADD_TASKS: Mc, UPDATE_TASKS: Nc } = B, Pc = {
|
|
4769
4749
|
projectId: p.string().min(1).optional().describe("Optional. If provided, searches only collaborators of this project. If omitted, searches across the collaborators of all shared projects the authenticated user can access (plus the authenticated user themselves) — use this for general \"find a user\" / \"who is X\" lookups."),
|
|
4770
4750
|
searchTerm: p.string().optional().describe("Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned.")
|
|
4771
|
-
},
|
|
4751
|
+
}, Fc = {
|
|
4772
4752
|
collaborators: p.array(Si).describe("The found users."),
|
|
4773
4753
|
projectInfo: p.object({
|
|
4774
4754
|
id: p.string().describe("The project ID."),
|
|
@@ -4778,11 +4758,11 @@ var { FIND_PROJECTS: Nc, ADD_TASKS: Pc, UPDATE_TASKS: Fc } = B, Ic = {
|
|
|
4778
4758
|
totalCount: p.number().describe("The total number of users found."),
|
|
4779
4759
|
totalAvailable: p.number().optional().describe("The total number of available users before the search filter was applied."),
|
|
4780
4760
|
appliedFilters: p.record(p.string(), p.unknown())
|
|
4781
|
-
},
|
|
4761
|
+
}, Ic = {
|
|
4782
4762
|
name: B.FIND_PROJECT_COLLABORATORS,
|
|
4783
4763
|
description: "Find Todoist users (collaborators, teammates) by name or email to look up their user ID. Use this whenever the user asks to find, look up, or identify a person — e.g. \"find Carrie's user ID\", \"who is Ernesto\", \"look up a user\". When projectId is omitted, searches across the collaborators of every shared project the authenticated user has access to, plus the authenticated user themselves — an empty result means the person is not a collaborator on any project you share with them, not necessarily that they do not exist in Todoist. When projectId is provided, searches only that project. Partial, case-insensitive match on name and email.",
|
|
4784
|
-
parameters:
|
|
4785
|
-
outputSchema:
|
|
4764
|
+
parameters: Pc,
|
|
4765
|
+
outputSchema: Fc,
|
|
4786
4766
|
annotations: {
|
|
4787
4767
|
readOnlyHint: !0,
|
|
4788
4768
|
destructiveHint: !1,
|
|
@@ -4790,7 +4770,7 @@ var { FIND_PROJECTS: Nc, ADD_TASKS: Pc, UPDATE_TASKS: Fc } = B, Ic = {
|
|
|
4790
4770
|
},
|
|
4791
4771
|
async execute(e, t) {
|
|
4792
4772
|
let { projectId: n, searchTerm: r } = e;
|
|
4793
|
-
if (!n) return
|
|
4773
|
+
if (!n) return Lc({
|
|
4794
4774
|
searchTerm: r,
|
|
4795
4775
|
client: t,
|
|
4796
4776
|
appliedFilters: e
|
|
@@ -4799,7 +4779,7 @@ var { FIND_PROJECTS: Nc, ADD_TASKS: Pc, UPDATE_TASKS: Fc } = B, Ic = {
|
|
|
4799
4779
|
try {
|
|
4800
4780
|
if (a = await G(t, n), !a) throw Error(`Project with ID "${n}" not found or not accessible`);
|
|
4801
4781
|
if (i = a.name, !a.isShared) return {
|
|
4802
|
-
textContent: `Project "${i}" is not shared and has no collaborators.\n\n**Next steps:**\n• Share the project to enable collaboration\n• Use ${
|
|
4782
|
+
textContent: `Project "${i}" is not shared and has no collaborators.\n\n**Next steps:**\n• Share the project to enable collaboration\n• Use ${Mc} and ${Nc} for assignment features once shared`,
|
|
4803
4783
|
structuredContent: {
|
|
4804
4784
|
collaborators: [],
|
|
4805
4785
|
projectInfo: {
|
|
@@ -4828,9 +4808,9 @@ var { FIND_PROJECTS: Nc, ADD_TASKS: Pc, UPDATE_TASKS: Fc } = B, Ic = {
|
|
|
4828
4808
|
appliedFilters: e
|
|
4829
4809
|
}
|
|
4830
4810
|
};
|
|
4831
|
-
let s =
|
|
4811
|
+
let s = zc(o, r);
|
|
4832
4812
|
return {
|
|
4833
|
-
textContent:
|
|
4813
|
+
textContent: Bc({
|
|
4834
4814
|
collaborators: s,
|
|
4835
4815
|
projectName: i,
|
|
4836
4816
|
searchTerm: r,
|
|
@@ -4850,10 +4830,10 @@ var { FIND_PROJECTS: Nc, ADD_TASKS: Pc, UPDATE_TASKS: Fc } = B, Ic = {
|
|
|
4850
4830
|
};
|
|
4851
4831
|
}
|
|
4852
4832
|
};
|
|
4853
|
-
async function
|
|
4854
|
-
let r = await
|
|
4833
|
+
async function Lc({ searchTerm: e, client: t, appliedFilters: n }) {
|
|
4834
|
+
let r = await Rc(t, await H.getAllCollaborators(t));
|
|
4855
4835
|
if (r.length === 0) return {
|
|
4856
|
-
textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.\n\n**Next steps:**\n• Use ${
|
|
4836
|
+
textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.\n\n**Next steps:**\n• Use ${jc} to find shared projects\n• Share a project to add collaborators\n• Ensure you have permission to view collaborators`,
|
|
4857
4837
|
structuredContent: {
|
|
4858
4838
|
collaborators: [],
|
|
4859
4839
|
projectInfo: void 0,
|
|
@@ -4862,9 +4842,9 @@ async function zc({ searchTerm: e, client: t, appliedFilters: n }) {
|
|
|
4862
4842
|
appliedFilters: n
|
|
4863
4843
|
}
|
|
4864
4844
|
};
|
|
4865
|
-
let i =
|
|
4845
|
+
let i = zc(r, e);
|
|
4866
4846
|
return {
|
|
4867
|
-
textContent:
|
|
4847
|
+
textContent: Bc({
|
|
4868
4848
|
collaborators: i,
|
|
4869
4849
|
projectName: void 0,
|
|
4870
4850
|
searchTerm: e,
|
|
@@ -4879,7 +4859,7 @@ async function zc({ searchTerm: e, client: t, appliedFilters: n }) {
|
|
|
4879
4859
|
}
|
|
4880
4860
|
};
|
|
4881
4861
|
}
|
|
4882
|
-
async function
|
|
4862
|
+
async function Rc(e, t) {
|
|
4883
4863
|
try {
|
|
4884
4864
|
let n = await e.getUser();
|
|
4885
4865
|
return !n || t.some((e) => e.id === n.id) ? t : [{
|
|
@@ -4891,12 +4871,12 @@ async function Bc(e, t) {
|
|
|
4891
4871
|
return t;
|
|
4892
4872
|
}
|
|
4893
4873
|
}
|
|
4894
|
-
function
|
|
4874
|
+
function zc(e, t) {
|
|
4895
4875
|
if (!t) return e;
|
|
4896
4876
|
let n = t.toLowerCase().trim();
|
|
4897
4877
|
return e.filter((e) => e.name.toLowerCase().includes(n) || e.email.toLowerCase().includes(n));
|
|
4898
4878
|
}
|
|
4899
|
-
function
|
|
4879
|
+
function Bc({ collaborators: e, projectName: t, searchTerm: n, totalAvailable: r }) {
|
|
4900
4880
|
let i = t ? `project "${t}"` : "workspace", a = t ? "Project collaborators" : "Workspace users", o = n ? `${a} matching "${n}"` : a, s = [];
|
|
4901
4881
|
n && s.push(`matching "${n}"`), s.push(`in ${i}`);
|
|
4902
4882
|
let c = [];
|
|
@@ -4904,7 +4884,7 @@ function Hc({ collaborators: e, projectName: t, searchTerm: n, totalAvailable: r
|
|
|
4904
4884
|
let l = [];
|
|
4905
4885
|
e.length === 0 && n && (l.push(`No users match "${n}"`), l.push("Try a broader search term or check spelling"), r > 0 && l.push(`${r} users available without filter`));
|
|
4906
4886
|
let u = [];
|
|
4907
|
-
return e.length > 0 ? (u.push(`Use ${
|
|
4887
|
+
return e.length > 0 ? (u.push(`Use ${Mc} with responsibleUser to assign new tasks`), u.push(`Use ${Nc} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${jc} to find other projects`), n && r > 0 && u.push("Try searching without filters to see all users")), Z({
|
|
4908
4888
|
subject: o,
|
|
4909
4889
|
count: e.length,
|
|
4910
4890
|
filterHints: s,
|
|
@@ -4914,11 +4894,11 @@ function Hc({ collaborators: e, projectName: t, searchTerm: n, totalAvailable: r
|
|
|
4914
4894
|
});
|
|
4915
4895
|
}
|
|
4916
4896
|
// src/tools/find-projects.ts
|
|
4917
|
-
var { ADD_PROJECTS:
|
|
4897
|
+
var { ADD_PROJECTS: Vc, FIND_FOLDERS: Hc, PROJECT_MANAGEMENT: Uc } = B, Wc = {
|
|
4918
4898
|
active: "projects",
|
|
4919
4899
|
archived: "archived projects",
|
|
4920
4900
|
all: "projects (active and archived)"
|
|
4921
|
-
},
|
|
4901
|
+
}, Gc = {
|
|
4922
4902
|
searchText: p.string().optional().describe("Search for a project by name (partial and case insensitive match). Supports wildcards (e.g. \"work*\" for prefix match). Use \"\\*\" for a literal asterisk. If omitted, all projects are returned."),
|
|
4923
4903
|
limit: p.number().int().min(1).max(D.PROJECTS_MAX).default(D.PROJECTS_DEFAULT).describe("The maximum number of projects to return."),
|
|
4924
4904
|
cursor: p.string().optional().describe("The cursor to get the next page of projects (cursor is obtained from the previous call to this tool, with the same parameters)."),
|
|
@@ -4927,26 +4907,26 @@ var { ADD_PROJECTS: Uc, FIND_FOLDERS: Wc, PROJECT_MANAGEMENT: Gc } = B, Kc = {
|
|
|
4927
4907
|
"archived",
|
|
4928
4908
|
"all"
|
|
4929
4909
|
]).optional().describe("Which projects to return by archive status: 'active' (default, non-archived only), 'archived' (archived only), or 'all' (both active and archived). Each project includes an isArchived field. Archived projects can be deleted via the delete-object tool (type: 'project')."),
|
|
4930
|
-
folderId: p.string().min(1).optional().describe(`Only projects in this workspace folder (see ${
|
|
4931
|
-
includeUnjoined: p.boolean().optional().describe(`Also list workspace projects the user can join but hasn't, in unjoinedProjects (first page only). They can't be read until joined; join with ${
|
|
4932
|
-
},
|
|
4910
|
+
folderId: p.string().min(1).optional().describe(`Only projects in this workspace folder (see ${Hc}).`),
|
|
4911
|
+
includeUnjoined: p.boolean().optional().describe(`Also list workspace projects the user can join but hasn't, in unjoinedProjects (first page only). They can't be read until joined; join with ${Uc} (action 'join') only when the user asks.`)
|
|
4912
|
+
}, Kc = p.object({
|
|
4933
4913
|
id: p.string(),
|
|
4934
4914
|
name: p.string(),
|
|
4935
4915
|
workspaceId: p.string(),
|
|
4936
4916
|
url: p.string()
|
|
4937
|
-
}),
|
|
4917
|
+
}), qc = {
|
|
4938
4918
|
projects: p.array(mi).describe("The found projects."),
|
|
4939
4919
|
nextCursor: p.string().optional(),
|
|
4940
4920
|
totalCount: p.number().describe("The total number of projects in this page."),
|
|
4941
4921
|
hasMore: p.boolean(),
|
|
4942
4922
|
appliedFilters: p.record(p.string(), p.unknown()),
|
|
4943
|
-
unjoinedProjects: p.array(
|
|
4923
|
+
unjoinedProjects: p.array(Kc).optional().describe("Up to limit. With includeUnjoined, or when a search matched no joined project."),
|
|
4944
4924
|
unjoinedHasMore: p.boolean().optional().describe("More matched than limit; narrow with searchText.")
|
|
4945
|
-
},
|
|
4925
|
+
}, Jc = {
|
|
4946
4926
|
name: B.FIND_PROJECTS,
|
|
4947
4927
|
description: "List or search by name the projects the user has joined. By default only active projects are returned; use archivedStatus ('archived' or 'all') to include archived projects. When searching, when archivedStatus is 'all', or when listing archived projects in a folder, all matching projects are returned (pagination is ignored). Otherwise projects are returned with pagination. Workspace projects the user hasn't joined are left out unless includeUnjoined is set, or a search matches no joined project.",
|
|
4948
|
-
parameters:
|
|
4949
|
-
outputSchema:
|
|
4928
|
+
parameters: Gc,
|
|
4929
|
+
outputSchema: qc,
|
|
4950
4930
|
annotations: {
|
|
4951
4931
|
readOnlyHint: !0,
|
|
4952
4932
|
destructiveHint: !1,
|
|
@@ -4954,7 +4934,7 @@ var { ADD_PROJECTS: Uc, FIND_FOLDERS: Wc, PROJECT_MANAGEMENT: Gc } = B, Kc = {
|
|
|
4954
4934
|
},
|
|
4955
4935
|
async execute(e, t) {
|
|
4956
4936
|
let { searchText: n } = e, r = e.archivedStatus ?? "active", i, a = null;
|
|
4957
|
-
if (
|
|
4937
|
+
if (Yc(e)) {
|
|
4958
4938
|
let a = Promise.resolve([]), [o, s] = await Promise.all([r === "archived" ? a : n ? Ir(t, n) : Lr(t, e.folderId), r === "active" ? a : Vr(t)]), c = n ? Ur(n) : null, l = c ? s.filter((e) => c.test(e.name)) : s, { folderId: u } = e, d = [...o, ...l];
|
|
4959
4939
|
i = u ? d.filter((e) => E(e) && e.folderId === u) : d;
|
|
4960
4940
|
} else {
|
|
@@ -4968,9 +4948,9 @@ var { ADD_PROJECTS: Uc, FIND_FOLDERS: Wc, PROJECT_MANAGEMENT: Gc } = B, Kc = {
|
|
|
4968
4948
|
});
|
|
4969
4949
|
i = n.results, a = n.nextCursor;
|
|
4970
4950
|
}
|
|
4971
|
-
let o = i.map(Jr), s = await
|
|
4951
|
+
let o = i.map(Jr), s = await Zc(t, e, o.length);
|
|
4972
4952
|
return {
|
|
4973
|
-
textContent:
|
|
4953
|
+
textContent: $c({
|
|
4974
4954
|
projects: o,
|
|
4975
4955
|
args: e,
|
|
4976
4956
|
nextCursor: a,
|
|
@@ -4982,21 +4962,21 @@ var { ADD_PROJECTS: Uc, FIND_FOLDERS: Wc, PROJECT_MANAGEMENT: Gc } = B, Kc = {
|
|
|
4982
4962
|
totalCount: o.length,
|
|
4983
4963
|
hasMore: !!a,
|
|
4984
4964
|
appliedFilters: e,
|
|
4985
|
-
unjoinedProjects: s?.listed.map(
|
|
4965
|
+
unjoinedProjects: s?.listed.map(Qc),
|
|
4986
4966
|
unjoinedHasMore: s ? s.total > s.listed.length : void 0
|
|
4987
4967
|
}
|
|
4988
4968
|
};
|
|
4989
4969
|
}
|
|
4990
4970
|
};
|
|
4991
|
-
function
|
|
4971
|
+
function Yc({ searchText: e, archivedStatus: t, folderId: n }) {
|
|
4992
4972
|
return !!e || t === "all" || !!n && t === "archived";
|
|
4993
4973
|
}
|
|
4994
|
-
function
|
|
4995
|
-
return e.archivedStatus === "archived" ? !1 :
|
|
4974
|
+
function Xc(e) {
|
|
4975
|
+
return e.archivedStatus === "archived" ? !1 : Yc(e) || !e.cursor;
|
|
4996
4976
|
}
|
|
4997
|
-
async function
|
|
4977
|
+
async function Zc(e, t, n) {
|
|
4998
4978
|
let { includeUnjoined: r, searchText: i, limit: a } = t, o = !!i && n === 0;
|
|
4999
|
-
if (!
|
|
4979
|
+
if (!Xc(t) || !(r || o)) return;
|
|
5000
4980
|
let s;
|
|
5001
4981
|
try {
|
|
5002
4982
|
s = await Rr(e);
|
|
@@ -5010,7 +4990,7 @@ async function $c(e, t, n) {
|
|
|
5010
4990
|
total: u.length
|
|
5011
4991
|
};
|
|
5012
4992
|
}
|
|
5013
|
-
function
|
|
4993
|
+
function Qc({ id: e, name: t, workspaceId: n, url: r }) {
|
|
5014
4994
|
return {
|
|
5015
4995
|
id: e,
|
|
5016
4996
|
name: t,
|
|
@@ -5018,15 +4998,15 @@ function el({ id: e, name: t, workspaceId: n, url: r }) {
|
|
|
5018
4998
|
url: r
|
|
5019
4999
|
};
|
|
5020
5000
|
}
|
|
5021
|
-
function
|
|
5022
|
-
let i =
|
|
5001
|
+
function $c({ projects: e, args: t, nextCursor: n, unjoined: r }) {
|
|
5002
|
+
let i = Wc[t.archivedStatus ?? "active"], a = t.searchText ? `All ${i} matching "${t.searchText}"` : `${i.charAt(0).toUpperCase()}${i.slice(1)}`, o = [];
|
|
5023
5003
|
t.searchText && o.push(`searchText: "${t.searchText}"`), t.archivedStatus && t.archivedStatus !== "active" && o.push(`archivedStatus: "${t.archivedStatus}"`), t.folderId && o.push(`folderId: "${t.folderId}"`);
|
|
5024
5004
|
let s = e.slice(0, 10).map(Li).join("\n"), c = e.length - 10, l = c > 0 ? `${s}\n …and ${c} more` : s, u = [], d = t.folderId ? " in this folder" : "";
|
|
5025
|
-
e.length === 0 && (t.searchText && r?.total ? u.push("None of the projects the user has joined match") : t.searchText ? (r ? u.push("No workspace project the user hasn't joined matches either") :
|
|
5005
|
+
e.length === 0 && (t.searchText && r?.total ? u.push("None of the projects the user has joined match") : t.searchText ? (r ? u.push("No workspace project the user hasn't joined matches either") : Xc(t) && u.push("Set includeUnjoined to also search workspace projects the user hasn't joined"), u.push("Try broader search terms"), u.push("Check spelling"), u.push("Remove searchText to see all projects")) : t.folderId && r?.total ? u.push("None of the projects the user has joined are in this folder") : t.archivedStatus === "archived" ? (u.push(`No archived projects${d}`), u.push("Use archivedStatus: 'all' to also see active projects")) : t.archivedStatus === "all" ? (u.push(t.folderId ? "No projects in this folder" : "No projects created yet"), t.folderId || u.push(`Use ${Vc} to create a project`)) : (u.push(`No active projects${d}`), u.push("Use archivedStatus: 'all' to include archived projects"), t.folderId || u.push(`Use ${Vc} to create a project`)), t.folderId && !r?.total && u.push(`Use ${Hc} to check the folder ID`));
|
|
5026
5006
|
let f = Z({
|
|
5027
5007
|
subject: a,
|
|
5028
5008
|
count: e.length,
|
|
5029
|
-
limit:
|
|
5009
|
+
limit: Yc(t) ? void 0 : t.limit,
|
|
5030
5010
|
nextCursor: n ?? void 0,
|
|
5031
5011
|
filterHints: o,
|
|
5032
5012
|
previewLines: l,
|
|
@@ -5038,24 +5018,24 @@ function tl({ projects: e, args: t, nextCursor: n, unjoined: r }) {
|
|
|
5038
5018
|
f,
|
|
5039
5019
|
`Workspace projects the user hasn't joined (${r.total}):`,
|
|
5040
5020
|
...p,
|
|
5041
|
-
`Their tasks, comments and activity can't be read until the user joins. Ask the user before joining one with ${
|
|
5021
|
+
`Their tasks, comments and activity can't be read until the user joins. Ask the user before joining one with ${Uc} (action: "join").`
|
|
5042
5022
|
].join("\n");
|
|
5043
5023
|
}
|
|
5044
5024
|
// src/tools/find-reminders.ts
|
|
5045
|
-
var
|
|
5025
|
+
var el = {
|
|
5046
5026
|
taskId: p.string().optional().describe("Find all reminders for a specific task. Returns both time-based and location reminders."),
|
|
5047
5027
|
reminderId: p.string().optional().describe("Get a specific time-based reminder (relative or absolute) by its ID."),
|
|
5048
5028
|
locationReminderId: p.string().optional().describe("Get a specific location reminder by its ID.")
|
|
5049
|
-
},
|
|
5029
|
+
}, tl = {
|
|
5050
5030
|
reminders: p.array(Ti).describe("The found reminders (time-based and location)."),
|
|
5051
5031
|
searchType: p.string().describe("The search type used: \"task\", \"reminder\", or \"location_reminder\"."),
|
|
5052
5032
|
searchId: p.string().describe("The ID used for the search."),
|
|
5053
5033
|
totalCount: p.number().describe("Total reminders in this response.")
|
|
5054
|
-
},
|
|
5034
|
+
}, nl = {
|
|
5055
5035
|
name: B.FIND_REMINDERS,
|
|
5056
5036
|
description: "Find reminders by task ID (returns all reminder types), or get a specific reminder by its ID. Use reminderId for time-based reminders and locationReminderId for location reminders.",
|
|
5057
|
-
parameters:
|
|
5058
|
-
outputSchema:
|
|
5037
|
+
parameters: el,
|
|
5038
|
+
outputSchema: tl,
|
|
5059
5039
|
annotations: {
|
|
5060
5040
|
readOnlyHint: !0,
|
|
5061
5041
|
destructiveHint: !1,
|
|
@@ -5102,7 +5082,7 @@ var nl = {
|
|
|
5102
5082
|
args: { taskId: n }
|
|
5103
5083
|
})]), i = [...e, ...r].map(ti);
|
|
5104
5084
|
return {
|
|
5105
|
-
textContent:
|
|
5085
|
+
textContent: rl(i, n),
|
|
5106
5086
|
structuredContent: {
|
|
5107
5087
|
reminders: i,
|
|
5108
5088
|
searchType: "task",
|
|
@@ -5114,7 +5094,7 @@ var nl = {
|
|
|
5114
5094
|
throw Error("One of taskId, reminderId, or locationReminderId must be provided.");
|
|
5115
5095
|
}
|
|
5116
5096
|
};
|
|
5117
|
-
function
|
|
5097
|
+
function rl(e, t) {
|
|
5118
5098
|
if (e.length === 0) return `No reminders found for task ${t}`;
|
|
5119
5099
|
let { timeBasedCount: n, locationCount: r } = ni(e), i = [];
|
|
5120
5100
|
if (n > 0) {
|
|
@@ -5128,11 +5108,11 @@ function al(e, t) {
|
|
|
5128
5108
|
return `Found ${i.join(" and ")} for task ${t}`;
|
|
5129
5109
|
}
|
|
5130
5110
|
// src/tools/find-sections.ts
|
|
5131
|
-
var { ADD_SECTIONS:
|
|
5111
|
+
var { ADD_SECTIONS: il } = B, al = {
|
|
5132
5112
|
active: "Sections",
|
|
5133
5113
|
archived: "Archived sections",
|
|
5134
5114
|
all: "Sections (active and archived)"
|
|
5135
|
-
},
|
|
5115
|
+
}, ol = {
|
|
5136
5116
|
projectId: p.string().min(1).describe("The ID of the project to search sections in. Project ID should be an ID string, or the text \"inbox\", for inbox tasks."),
|
|
5137
5117
|
searchText: p.string().optional().describe("Search for a section by name (partial and case insensitive match). Supports wildcards (e.g. \"work*\" for prefix match). Use \"\\*\" for a literal asterisk. If omitted, all sections in the project are returned."),
|
|
5138
5118
|
archivedStatus: p.enum([
|
|
@@ -5140,15 +5120,15 @@ var { ADD_SECTIONS: ol } = B, sl = {
|
|
|
5140
5120
|
"archived",
|
|
5141
5121
|
"all"
|
|
5142
5122
|
]).optional().describe("Default 'active'. 'archived' returns only archived sections, 'all' both.")
|
|
5143
|
-
},
|
|
5144
|
-
sections: p.array(
|
|
5123
|
+
}, sl = hi.extend({ isArchived: p.boolean() }), cl = {
|
|
5124
|
+
sections: p.array(sl).describe("The found sections."),
|
|
5145
5125
|
totalCount: p.number().describe("The total number of sections found."),
|
|
5146
5126
|
appliedFilters: p.record(p.string(), p.unknown())
|
|
5147
|
-
},
|
|
5127
|
+
}, ll = {
|
|
5148
5128
|
name: B.FIND_SECTIONS,
|
|
5149
5129
|
description: "Search for sections by name or other criteria in a project. When searching, uses server-side search to avoid fetching all sections. Archived sections are left out unless archivedStatus is set.",
|
|
5150
|
-
parameters:
|
|
5151
|
-
outputSchema:
|
|
5130
|
+
parameters: ol,
|
|
5131
|
+
outputSchema: cl,
|
|
5152
5132
|
annotations: {
|
|
5153
5133
|
readOnlyHint: !0,
|
|
5154
5134
|
destructiveHint: !1,
|
|
@@ -5158,9 +5138,9 @@ var { ADD_SECTIONS: ol } = B, sl = {
|
|
|
5158
5138
|
let n = await Pr({
|
|
5159
5139
|
projectId: e.projectId,
|
|
5160
5140
|
client: t
|
|
5161
|
-
}) ?? e.projectId, r = e.archivedStatus ?? "active", i = Promise.resolve([]), [a, o] = await Promise.all([r === "archived" ? i :
|
|
5141
|
+
}) ?? e.projectId, r = e.archivedStatus ?? "active", i = Promise.resolve([]), [a, o] = await Promise.all([r === "archived" ? i : ul(t, n, e.searchText), r === "active" ? i : Hr(t, n)]), s = e.searchText ? Ur(e.searchText) : null, c = s ? o.filter((e) => s.test(e.name)) : o, l = [...a, ...c].map(dl);
|
|
5162
5142
|
return {
|
|
5163
|
-
textContent:
|
|
5143
|
+
textContent: fl({
|
|
5164
5144
|
sections: l,
|
|
5165
5145
|
projectId: e.projectId,
|
|
5166
5146
|
searchText: e.searchText,
|
|
@@ -5174,19 +5154,19 @@ var { ADD_SECTIONS: ol } = B, sl = {
|
|
|
5174
5154
|
};
|
|
5175
5155
|
}
|
|
5176
5156
|
};
|
|
5177
|
-
async function
|
|
5157
|
+
async function ul(e, t, n) {
|
|
5178
5158
|
return n ? qr(e, n, t) : (await e.getSections({ projectId: t })).results;
|
|
5179
5159
|
}
|
|
5180
|
-
function
|
|
5160
|
+
function dl(e) {
|
|
5181
5161
|
return {
|
|
5182
5162
|
...gi(e),
|
|
5183
5163
|
isArchived: e.isArchived
|
|
5184
5164
|
};
|
|
5185
5165
|
}
|
|
5186
|
-
function
|
|
5166
|
+
function fl({ sections: e, projectId: t, searchText: n, archivedStatus: r }) {
|
|
5187
5167
|
let i = [];
|
|
5188
|
-
n ? (i.push("Try broader search terms"), i.push("Check spelling"), i.push("Remove searchText to see all sections")) : r === "archived" ? (i.push("No archived sections in this project"), i.push("Use archivedStatus: 'all' to also see active sections")) : (i.push("Project has no sections yet"), i.push(`Use ${
|
|
5189
|
-
let a = `${
|
|
5168
|
+
n ? (i.push("Try broader search terms"), i.push("Check spelling"), i.push("Remove searchText to see all sections")) : r === "archived" ? (i.push("No archived sections in this project"), i.push("Use archivedStatus: 'all' to also see active sections")) : (i.push("Project has no sections yet"), i.push(`Use ${il} to create sections`)), r === "active" && i.push("Use archivedStatus: 'all' to include archived sections");
|
|
5169
|
+
let a = `${al[r]} in project ${t}`, o = n ? `${a} matching "${n}"` : a, s = e.length > 0 ? e.map((e) => {
|
|
5190
5170
|
let t = e.isArchived ? " • Archived" : "";
|
|
5191
5171
|
return ` ${e.name}${t} • id=${e.id}`;
|
|
5192
5172
|
}).join("\n") : void 0;
|
|
@@ -5198,19 +5178,19 @@ function ml({ sections: e, projectId: t, searchText: n, archivedStatus: r }) {
|
|
|
5198
5178
|
});
|
|
5199
5179
|
}
|
|
5200
5180
|
// src/tools/find-tasks-by-date.ts
|
|
5201
|
-
function
|
|
5181
|
+
function pl(e) {
|
|
5202
5182
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
5203
5183
|
}
|
|
5204
|
-
var
|
|
5205
|
-
async function
|
|
5206
|
-
if (t) return t.tzInfo?.gmtString ||
|
|
5184
|
+
var ml = "+00:00";
|
|
5185
|
+
async function hl(e, t) {
|
|
5186
|
+
if (t) return t.tzInfo?.gmtString || ml;
|
|
5207
5187
|
try {
|
|
5208
|
-
return (await R(() => e.getUser())).tzInfo?.gmtString ||
|
|
5188
|
+
return (await R(() => e.getUser())).tzInfo?.gmtString || ml;
|
|
5209
5189
|
} catch (e) {
|
|
5210
|
-
return console.error(`${B.FIND_TASKS_BY_DATE}: could not load the user's timezone, using UTC`, e),
|
|
5190
|
+
return console.error(`${B.FIND_TASKS_BY_DATE}: could not load the user's timezone, using UTC`, e), ml;
|
|
5211
5191
|
}
|
|
5212
5192
|
}
|
|
5213
|
-
var
|
|
5193
|
+
var gl = {
|
|
5214
5194
|
startDate: p.string().regex(/^(\d{4}-\d{2}-\d{2}|today)$/).optional().describe("The start date to get the tasks for. Format: YYYY-MM-DD, or 'today', which by default also includes overdue tasks. Defaults to 'today' when omitted, except with overdueOption='overdue-only'."),
|
|
5215
5195
|
overdueOption: p.enum([
|
|
5216
5196
|
"overdue-only",
|
|
@@ -5222,18 +5202,18 @@ var vl = {
|
|
|
5222
5202
|
cursor: p.string().optional().describe("The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."),
|
|
5223
5203
|
responsibleUser: p.string().optional().describe("Filter tasks assigned to this user. User ID, name, or email. The current user also includes unassigned tasks."),
|
|
5224
5204
|
responsibleUserFiltering: p.enum(kr).optional().describe("Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."),
|
|
5225
|
-
...
|
|
5226
|
-
},
|
|
5205
|
+
...ac
|
|
5206
|
+
}, _l = {
|
|
5227
5207
|
tasks: p.array(J).describe("The found tasks."),
|
|
5228
5208
|
nextCursor: p.string().optional(),
|
|
5229
5209
|
totalCount: p.number().describe("The total number of tasks in this page."),
|
|
5230
5210
|
hasMore: p.boolean(),
|
|
5231
5211
|
appliedFilters: p.record(p.string(), p.unknown())
|
|
5232
|
-
},
|
|
5212
|
+
}, vl = {
|
|
5233
5213
|
name: B.FIND_TASKS_BY_DATE,
|
|
5234
5214
|
description: "Get tasks by date range. startDate='today' includes overdue items. Default responsibleUserFiltering='unassignedOrMe' excludes others' tasks.",
|
|
5235
|
-
parameters:
|
|
5236
|
-
outputSchema:
|
|
5215
|
+
parameters: gl,
|
|
5216
|
+
outputSchema: _l,
|
|
5237
5217
|
annotations: {
|
|
5238
5218
|
readOnlyHint: !0,
|
|
5239
5219
|
destructiveHint: !1,
|
|
@@ -5247,14 +5227,14 @@ var vl = {
|
|
|
5247
5227
|
if (n.overdueOption === "overdue-only") u = "overdue";
|
|
5248
5228
|
else if (n.startDate === "today") {
|
|
5249
5229
|
if (n.daysCount > 1) {
|
|
5250
|
-
let e = await
|
|
5230
|
+
let e = await hl(t, c), r = jn(/* @__PURE__ */ new Date(), An(e)), i = `(due after: ${r} | due: ${r}) & due before: ${Mn(r, n.daysCount)}`;
|
|
5251
5231
|
u = n.overdueOption === "exclude-overdue" ? i : `(${i} | overdue)`;
|
|
5252
5232
|
} else u = n.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
5253
5233
|
} else if (n.startDate) {
|
|
5254
|
-
let e = n.startDate, t = me(
|
|
5234
|
+
let e = n.startDate, t = me(pl(e), n.daysCount);
|
|
5255
5235
|
u = `(due after: ${e} | due: ${e}) & due before: ${he(t, { representation: "date" })}`;
|
|
5256
5236
|
}
|
|
5257
|
-
let d =
|
|
5237
|
+
let d = sc(n.labels, n.labelsOperator);
|
|
5258
5238
|
d.length > 0 && (u = jr(u, `(${d})`));
|
|
5259
5239
|
let f = Mr({
|
|
5260
5240
|
resolvedAssigneeId: a,
|
|
@@ -5270,7 +5250,7 @@ var vl = {
|
|
|
5270
5250
|
limit: n.limit
|
|
5271
5251
|
});
|
|
5272
5252
|
return {
|
|
5273
|
-
textContent:
|
|
5253
|
+
textContent: yl({
|
|
5274
5254
|
tasks: p,
|
|
5275
5255
|
args: n,
|
|
5276
5256
|
nextCursor: m,
|
|
@@ -5287,7 +5267,7 @@ var vl = {
|
|
|
5287
5267
|
};
|
|
5288
5268
|
}
|
|
5289
5269
|
};
|
|
5290
|
-
function
|
|
5270
|
+
function yl({ tasks: e, args: t, nextCursor: n, assigneeEmail: r, assigneeNames: i }) {
|
|
5291
5271
|
let a = [];
|
|
5292
5272
|
if (t.overdueOption === "overdue-only") a.push("overdue tasks only");
|
|
5293
5273
|
else if (t.startDate === "today") {
|
|
@@ -5295,7 +5275,7 @@ function xl({ tasks: e, args: t, nextCursor: n, assigneeEmail: r, assigneeNames:
|
|
|
5295
5275
|
a.push(`today${e}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`);
|
|
5296
5276
|
} else t.startDate && a.push(Nn(t.startDate, t.daysCount));
|
|
5297
5277
|
if (t.labels && t.labels.length > 0) {
|
|
5298
|
-
let e =
|
|
5278
|
+
let e = dc(t.labels, t.labelsOperator);
|
|
5299
5279
|
a.push(`labels: ${e}`);
|
|
5300
5280
|
}
|
|
5301
5281
|
if (t.responsibleUser) {
|
|
@@ -5331,27 +5311,27 @@ function xl({ tasks: e, args: t, nextCursor: n, assigneeEmail: r, assigneeNames:
|
|
|
5331
5311
|
});
|
|
5332
5312
|
}
|
|
5333
5313
|
// src/utils/filtered-pages.ts
|
|
5334
|
-
var
|
|
5314
|
+
var bl = 5, xl = "resume:", Sl = "Invalid cursor. Pass the nextCursor from the previous call unchanged, with the same parameters.", Cl = p.object({
|
|
5335
5315
|
next: p.string(),
|
|
5336
5316
|
state: p.unknown().optional()
|
|
5337
5317
|
});
|
|
5338
|
-
function
|
|
5339
|
-
return `${
|
|
5318
|
+
function wl(e) {
|
|
5319
|
+
return `${xl}${Buffer.from(JSON.stringify(e)).toString("base64url")}`;
|
|
5340
5320
|
}
|
|
5341
|
-
function
|
|
5321
|
+
function Tl(e) {
|
|
5342
5322
|
if (e) {
|
|
5343
|
-
if (!e.startsWith(
|
|
5323
|
+
if (!e.startsWith(xl)) throw Error(Sl);
|
|
5344
5324
|
try {
|
|
5345
5325
|
let t = e.slice(7);
|
|
5346
|
-
return
|
|
5326
|
+
return Cl.parse(JSON.parse(Buffer.from(t, "base64url").toString()));
|
|
5347
5327
|
} catch {
|
|
5348
|
-
throw Error(
|
|
5328
|
+
throw Error(Sl);
|
|
5349
5329
|
}
|
|
5350
5330
|
}
|
|
5351
5331
|
}
|
|
5352
|
-
async function
|
|
5332
|
+
async function El({ fetchPage: e, matches: t, limit: n, maxPageSize: r, from: i, state: a }) {
|
|
5353
5333
|
let o = [], s = i?.next, c = null;
|
|
5354
|
-
for (let i = 0; i <
|
|
5334
|
+
for (let i = 0; i < bl; i++) {
|
|
5355
5335
|
let { results: i, nextCursor: l } = await e({
|
|
5356
5336
|
cursor: c,
|
|
5357
5337
|
limit: r
|
|
@@ -5364,7 +5344,7 @@ async function Ol({ fetchPage: e, matches: t, limit: n, maxPageSize: r, from: i,
|
|
|
5364
5344
|
if (t(e)) {
|
|
5365
5345
|
if (o.length === n) return {
|
|
5366
5346
|
items: o,
|
|
5367
|
-
nextCursor:
|
|
5347
|
+
nextCursor: wl({
|
|
5368
5348
|
next: e.id,
|
|
5369
5349
|
state: a
|
|
5370
5350
|
})
|
|
@@ -5381,10 +5361,10 @@ async function Ol({ fetchPage: e, matches: t, limit: n, maxPageSize: r, from: i,
|
|
|
5381
5361
|
}
|
|
5382
5362
|
c = l;
|
|
5383
5363
|
}
|
|
5384
|
-
throw Error(`Stopped after reading ${
|
|
5364
|
+
throw Error(`Stopped after reading ${bl * r} items without reaching the end of the list.`);
|
|
5385
5365
|
}
|
|
5386
5366
|
// src/tools/find-tasks.ts
|
|
5387
|
-
var { FIND_COMPLETED_TASKS:
|
|
5367
|
+
var { FIND_COMPLETED_TASKS: Dl, ADD_TASKS: Ol } = B, kl = {
|
|
5388
5368
|
searchText: p.string().optional().describe("The text to search for in tasks."),
|
|
5389
5369
|
projectId: p.string().optional().describe("Find tasks in this project. Project ID should be an ID string, or the text \"inbox\", for inbox tasks."),
|
|
5390
5370
|
sectionId: p.string().optional().describe("Find tasks in this section."),
|
|
@@ -5395,18 +5375,18 @@ var { FIND_COMPLETED_TASKS: kl, ADD_TASKS: Al } = B, jl = {
|
|
|
5395
5375
|
cursor: p.string().optional().describe("The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."),
|
|
5396
5376
|
filter: p.string().optional().describe("A raw Todoist filter query string (e.g. \"today\", \"p1\", \"##Work\", \"(today | overdue) & p1\"). Combined with other filters using AND. Cannot be used with projectId, sectionId, parentId, or filterIdOrName."),
|
|
5397
5377
|
filterIdOrName: p.string().optional().describe("The ID or name of a saved Todoist filter. The filter's query will be fetched and used to find tasks. Cannot be used with the `filter` parameter, projectId, sectionId, or parentId."),
|
|
5398
|
-
...
|
|
5399
|
-
},
|
|
5378
|
+
...ac
|
|
5379
|
+
}, Al = {
|
|
5400
5380
|
tasks: p.array(J).describe("The found tasks."),
|
|
5401
5381
|
nextCursor: p.string().optional(),
|
|
5402
5382
|
totalCount: p.number().describe("The total number of tasks in this page."),
|
|
5403
5383
|
hasMore: p.boolean(),
|
|
5404
5384
|
appliedFilters: p.record(p.string(), p.unknown())
|
|
5405
|
-
},
|
|
5385
|
+
}, jl = {
|
|
5406
5386
|
name: B.FIND_TASKS,
|
|
5407
5387
|
description: "Find active tasks by text, project/section/parent, responsible user, labels, raw filter, or saved filter (filterIdOrName). Without filters, list a page. Default scope: unassigned + mine; responsibleUserFiltering=\"all\" includes others.",
|
|
5408
|
-
parameters:
|
|
5409
|
-
outputSchema:
|
|
5388
|
+
parameters: kl,
|
|
5389
|
+
outputSchema: Al,
|
|
5410
5390
|
annotations: {
|
|
5411
5391
|
readOnlyHint: !0,
|
|
5412
5392
|
destructiveHint: !1,
|
|
@@ -5417,8 +5397,8 @@ var { FIND_COMPLETED_TASKS: kl, ADD_TASKS: Al } = B, jl = {
|
|
|
5417
5397
|
if (f && p) throw Error("The `filter` and `filterIdOrName` parameters cannot be used together. Provide only one.");
|
|
5418
5398
|
let h = !!(r || i || a);
|
|
5419
5399
|
if ((f || p) && h) throw Error("The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. \"##ProjectName\").");
|
|
5420
|
-
let g = h ?
|
|
5421
|
-
p && (b = (await
|
|
5400
|
+
let g = h ? Tl(m) : void 0, _ = h ? g ? Promise.resolve(Nl(g.state)) : Pl(t, u, d) : Promise.resolve(void 0), v = await t.getUser(), y = u && u.length > 0, b = f;
|
|
5401
|
+
p && (b = (await ls.resolveFilter(t, p)).filterQuery);
|
|
5422
5402
|
let x = await Ar(t, o), S = x?.userId, ee = x?.email;
|
|
5423
5403
|
if (h) {
|
|
5424
5404
|
let o = {};
|
|
@@ -5428,7 +5408,7 @@ var { FIND_COMPLETED_TASKS: kl, ADD_TASKS: Al } = B, jl = {
|
|
|
5428
5408
|
})), i && (o.sectionId = i), a && (o.parentId = a);
|
|
5429
5409
|
let l = await _;
|
|
5430
5410
|
l && (o.label = l);
|
|
5431
|
-
let f = n?.toLowerCase(), { items: p, nextCursor: m } = await
|
|
5411
|
+
let f = n?.toLowerCase(), { items: p, nextCursor: m } = await El({
|
|
5432
5412
|
fetchPage: async (e) => {
|
|
5433
5413
|
let { results: n, nextCursor: r } = await t.getTasks({
|
|
5434
5414
|
...o,
|
|
@@ -5444,14 +5424,14 @@ var { FIND_COMPLETED_TASKS: kl, ADD_TASKS: Al } = B, jl = {
|
|
|
5444
5424
|
resolvedAssigneeId: S,
|
|
5445
5425
|
currentUserId: v.id,
|
|
5446
5426
|
responsibleUserFiltering: s
|
|
5447
|
-
}).length === 1 && (!u?.length ||
|
|
5427
|
+
}).length === 1 && (!u?.length || lc(e.labels, u, d)),
|
|
5448
5428
|
limit: c,
|
|
5449
5429
|
maxPageSize: D.TASKS_PAGE_MAX,
|
|
5450
5430
|
from: g,
|
|
5451
5431
|
state: l ? { apiLabel: l } : void 0
|
|
5452
5432
|
});
|
|
5453
5433
|
return {
|
|
5454
|
-
textContent:
|
|
5434
|
+
textContent: Il({
|
|
5455
5435
|
tasks: p,
|
|
5456
5436
|
args: e,
|
|
5457
5437
|
nextCursor: m,
|
|
@@ -5481,7 +5461,7 @@ var { FIND_COMPLETED_TASKS: kl, ADD_TASKS: Al } = B, jl = {
|
|
|
5481
5461
|
cursor: m ?? null
|
|
5482
5462
|
}), a = r.map(K);
|
|
5483
5463
|
return {
|
|
5484
|
-
textContent:
|
|
5464
|
+
textContent: Il({
|
|
5485
5465
|
tasks: a,
|
|
5486
5466
|
args: e,
|
|
5487
5467
|
nextCursor: i,
|
|
@@ -5500,7 +5480,7 @@ var { FIND_COMPLETED_TASKS: kl, ADD_TASKS: Al } = B, jl = {
|
|
|
5500
5480
|
}
|
|
5501
5481
|
let C = b ? `(${b})` : "";
|
|
5502
5482
|
n && (C = jr(C, `search: ${ae(n)}`));
|
|
5503
|
-
let te =
|
|
5483
|
+
let te = sc(u, d);
|
|
5504
5484
|
if (C = jr(C, te), !p || o || s) {
|
|
5505
5485
|
let e = Mr({
|
|
5506
5486
|
resolvedAssigneeId: S,
|
|
@@ -5517,7 +5497,7 @@ var { FIND_COMPLETED_TASKS: kl, ADD_TASKS: Al } = B, jl = {
|
|
|
5517
5497
|
limit: e.limit
|
|
5518
5498
|
});
|
|
5519
5499
|
return {
|
|
5520
|
-
textContent:
|
|
5500
|
+
textContent: Il({
|
|
5521
5501
|
tasks: w,
|
|
5522
5502
|
args: e,
|
|
5523
5503
|
nextCursor: ne,
|
|
@@ -5534,18 +5514,18 @@ var { FIND_COMPLETED_TASKS: kl, ADD_TASKS: Al } = B, jl = {
|
|
|
5534
5514
|
}
|
|
5535
5515
|
};
|
|
5536
5516
|
}
|
|
5537
|
-
},
|
|
5538
|
-
function
|
|
5517
|
+
}, Ml = p.object({ apiLabel: p.string().optional() });
|
|
5518
|
+
function Nl(e) {
|
|
5539
5519
|
if (e === void 0) return;
|
|
5540
|
-
let t =
|
|
5541
|
-
if (!t.success) throw Error(
|
|
5520
|
+
let t = Ml.safeParse(e);
|
|
5521
|
+
if (!t.success) throw Error(Sl);
|
|
5542
5522
|
return t.data.apiLabel;
|
|
5543
5523
|
}
|
|
5544
|
-
async function
|
|
5524
|
+
async function Pl(e, t, n) {
|
|
5545
5525
|
if (!(!t?.length || t.length > 1 && n !== "and")) try {
|
|
5546
5526
|
let [n, r] = await Promise.all([Gr(e), Kr(e)]), i = [...n, ...r];
|
|
5547
5527
|
for (let e of t) {
|
|
5548
|
-
let t =
|
|
5528
|
+
let t = uc(e, i);
|
|
5549
5529
|
if (t) return t;
|
|
5550
5530
|
}
|
|
5551
5531
|
return;
|
|
@@ -5554,10 +5534,10 @@ async function Il(e, t, n) {
|
|
|
5554
5534
|
return;
|
|
5555
5535
|
}
|
|
5556
5536
|
}
|
|
5557
|
-
function
|
|
5537
|
+
function Fl(e) {
|
|
5558
5538
|
if (e.projectId) {
|
|
5559
5539
|
let t = [e.searchText ? "No tasks in project match search" : "Project has no tasks yet"];
|
|
5560
|
-
return e.searchText || t.push(`Use ${
|
|
5540
|
+
return e.searchText || t.push(`Use ${Ol} to create tasks`), t;
|
|
5561
5541
|
}
|
|
5562
5542
|
if (e.sectionId) {
|
|
5563
5543
|
let t = [e.searchText ? "No tasks in section match search" : "Section is empty"];
|
|
@@ -5565,11 +5545,11 @@ function Ll(e) {
|
|
|
5565
5545
|
}
|
|
5566
5546
|
if (e.parentId) {
|
|
5567
5547
|
let t = [e.searchText ? "No subtasks match search" : "No subtasks created yet"];
|
|
5568
|
-
return e.searchText || t.push(`Use ${
|
|
5548
|
+
return e.searchText || t.push(`Use ${Ol} with parentId to add subtasks`), t;
|
|
5569
5549
|
}
|
|
5570
5550
|
return [];
|
|
5571
5551
|
}
|
|
5572
|
-
function
|
|
5552
|
+
function Il({ tasks: e, args: t, nextCursor: n, isContainerSearch: r, assigneeEmail: i, assigneeNames: a }) {
|
|
5573
5553
|
let o = "Tasks", s = [], c = [];
|
|
5574
5554
|
if (r) {
|
|
5575
5555
|
if (t.projectId ? (o = "Tasks in project", s.push(`in project ${t.projectId}`)) : t.sectionId ? (o = "Tasks in section", s.push(`in section ${t.sectionId}`)) : t.parentId ? (o = "Subtasks", s.push(`subtasks of ${t.parentId}`)) : o = "Tasks", t.searchText && (o += ` matching "${t.searchText}"`, s.push(`containing "${t.searchText}"`)), t.responsibleUser) {
|
|
@@ -5577,26 +5557,26 @@ function Rl({ tasks: e, args: t, nextCursor: n, isContainerSearch: r, assigneeEm
|
|
|
5577
5557
|
o += ` assigned to ${e}`, s.push(`assigned to ${e}`);
|
|
5578
5558
|
}
|
|
5579
5559
|
if (t.labels && t.labels.length > 0) {
|
|
5580
|
-
let e =
|
|
5560
|
+
let e = dc(t.labels, t.labelsOperator);
|
|
5581
5561
|
s.push(`labels: ${e}`);
|
|
5582
5562
|
}
|
|
5583
|
-
e.length === 0 && c.push(...
|
|
5563
|
+
e.length === 0 && c.push(...Fl(t));
|
|
5584
5564
|
} else {
|
|
5585
5565
|
let n = i || t.responsibleUser, r = [];
|
|
5586
5566
|
if (t.filter && r.push(`filter: ${t.filter}`), t.searchText && r.push(`"${t.searchText}"`), t.responsibleUser && r.push(`assigned to ${n}`), t.labels && t.labels.length > 0) {
|
|
5587
|
-
let e =
|
|
5567
|
+
let e = dc(t.labels, t.labelsOperator);
|
|
5588
5568
|
r.push(`with labels: ${e}`);
|
|
5589
5569
|
}
|
|
5590
|
-
if (t.filter && !t.searchText && !t.responsibleUser && !t.labels?.length ? (o = `Tasks matching filter: ${t.filter}`, s.push(`filter: ${t.filter}`)) : t.searchText ? (o = `Search results for ${r.join(" ")}`, s.push(`matching "${t.searchText}"`), t.filter && s.push(`filter: ${t.filter}`)) : t.responsibleUser && (!t.labels || t.labels.length === 0) ? (o = `Tasks assigned to ${n}`, t.filter && s.push(`filter: ${t.filter}`)) : t.labels && t.labels.length > 0 && !t.responsibleUser ? (o = `Tasks with labels: ${
|
|
5591
|
-
let e =
|
|
5570
|
+
if (t.filter && !t.searchText && !t.responsibleUser && !t.labels?.length ? (o = `Tasks matching filter: ${t.filter}`, s.push(`filter: ${t.filter}`)) : t.searchText ? (o = `Search results for ${r.join(" ")}`, s.push(`matching "${t.searchText}"`), t.filter && s.push(`filter: ${t.filter}`)) : t.responsibleUser && (!t.labels || t.labels.length === 0) ? (o = `Tasks assigned to ${n}`, t.filter && s.push(`filter: ${t.filter}`)) : t.labels && t.labels.length > 0 && !t.responsibleUser ? (o = `Tasks with labels: ${dc(t.labels, t.labelsOperator)}`, t.filter && s.push(`filter: ${t.filter}`)) : o = `Tasks ${r.join(" ")}`, t.responsibleUser && s.push(`assigned to ${n}`), t.labels && t.labels.length > 0) {
|
|
5571
|
+
let e = dc(t.labels, t.labelsOperator);
|
|
5592
5572
|
s.push(`labels: ${e}`);
|
|
5593
5573
|
}
|
|
5594
5574
|
if (e.length === 0) {
|
|
5595
5575
|
if (t.responsibleUser) {
|
|
5596
5576
|
let e = i || t.responsibleUser;
|
|
5597
|
-
c.push(`No tasks assigned to ${e}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${
|
|
5577
|
+
c.push(`No tasks assigned to ${e}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${Dl}`);
|
|
5598
5578
|
}
|
|
5599
|
-
t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${
|
|
5579
|
+
t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${Dl}`));
|
|
5600
5580
|
}
|
|
5601
5581
|
}
|
|
5602
5582
|
return Z({
|
|
@@ -5610,7 +5590,7 @@ function Rl({ tasks: e, args: t, nextCursor: n, isContainerSearch: r, assigneeEm
|
|
|
5610
5590
|
});
|
|
5611
5591
|
}
|
|
5612
5592
|
// src/tools/find-templates.ts
|
|
5613
|
-
var
|
|
5593
|
+
var Ll = {
|
|
5614
5594
|
query: p.string().trim().min(1).optional().describe("Words to search template names and descriptions for, e.g. \"launch\"."),
|
|
5615
5595
|
source: p.enum([
|
|
5616
5596
|
"all",
|
|
@@ -5621,7 +5601,7 @@ var zl = {
|
|
|
5621
5601
|
locale: p.string().optional().describe("Language of gallery template content, e.g. \"de\". Defaults to \"en\"."),
|
|
5622
5602
|
limit: p.number().int().min(1).max(D.TEMPLATES_MAX).optional().describe(`Defaults to ${D.TEMPLATES_DEFAULT}.`),
|
|
5623
5603
|
cursor: p.string().optional().describe("A previous result's `nextCursor`, for the next page.")
|
|
5624
|
-
},
|
|
5604
|
+
}, Rl = {
|
|
5625
5605
|
templates: p.array(p.object({
|
|
5626
5606
|
templateId: p.string(),
|
|
5627
5607
|
name: p.string(),
|
|
@@ -5629,11 +5609,11 @@ var zl = {
|
|
|
5629
5609
|
...Ei
|
|
5630
5610
|
})),
|
|
5631
5611
|
nextCursor: p.string().optional().describe("Absent on the last page.")
|
|
5632
|
-
},
|
|
5612
|
+
}, zl = {
|
|
5633
5613
|
name: B.FIND_TEMPLATES,
|
|
5634
5614
|
description: "Search the Todoist gallery's project templates and the user's personal and workspace ones, to find a template's ID for add-projects, import-into-project, fetch-object or update-template.",
|
|
5635
|
-
parameters:
|
|
5636
|
-
outputSchema:
|
|
5615
|
+
parameters: Ll,
|
|
5616
|
+
outputSchema: Rl,
|
|
5637
5617
|
annotations: {
|
|
5638
5618
|
readOnlyHint: !0,
|
|
5639
5619
|
destructiveHint: !1,
|
|
@@ -5649,7 +5629,7 @@ var zl = {
|
|
|
5649
5629
|
limit: r
|
|
5650
5630
|
});
|
|
5651
5631
|
return {
|
|
5652
|
-
textContent:
|
|
5632
|
+
textContent: Bl({
|
|
5653
5633
|
templates: o,
|
|
5654
5634
|
query: e,
|
|
5655
5635
|
nextCursor: s
|
|
@@ -5667,25 +5647,25 @@ var zl = {
|
|
|
5667
5647
|
};
|
|
5668
5648
|
}
|
|
5669
5649
|
};
|
|
5670
|
-
function
|
|
5650
|
+
function Bl({ templates: e, query: t, nextCursor: n }) {
|
|
5671
5651
|
let r = t ? ` matching "${t}"` : "";
|
|
5672
5652
|
if (e.length === 0) return `No templates found${r}.`;
|
|
5673
|
-
let i = e.map((e) => `- ${e.name} (id=${e.id}, ${
|
|
5653
|
+
let i = e.map((e) => `- ${e.name} (id=${e.id}, ${Vl(e)}): ${e.shortDescription}`), a = n ? `\n${zi([], n)}` : "";
|
|
5674
5654
|
return `Found ${e.length} template${e.length === 1 ? "" : "s"}${r}:\n${i.join("\n")}${a}`;
|
|
5675
5655
|
}
|
|
5676
|
-
function
|
|
5656
|
+
function Vl(e) {
|
|
5677
5657
|
return e.templateSource === "todoist" ? "gallery" : e.workspaceId ? `workspace ${e.workspaceId}` : "personal";
|
|
5678
5658
|
}
|
|
5679
5659
|
// src/tools/get-overview.ts
|
|
5680
|
-
var
|
|
5660
|
+
var Hl = { projectId: p.string().min(1).optional().describe("Optional project ID. Use \"inbox\" for the Inbox. If provided, returns that project's tasks grouped by section. If omitted, returns the project and section structure for the whole account with no tasks.") }, Ul = p.lazy(() => p.object({
|
|
5681
5661
|
id: p.string().describe("The project ID."),
|
|
5682
5662
|
name: p.string().describe("The project name."),
|
|
5683
5663
|
parentId: p.string().optional().describe("The parent project ID (for sub-projects, personal projects only)."),
|
|
5684
5664
|
folderId: p.string().optional().describe("The folder ID this project belongs to (workspace projects only)."),
|
|
5685
5665
|
childOrder: p.number().describe("The ordering index among siblings."),
|
|
5686
5666
|
sections: p.array(hi),
|
|
5687
|
-
children: p.array(
|
|
5688
|
-
})),
|
|
5667
|
+
children: p.array(Ul).describe("Nested child projects.")
|
|
5668
|
+
})), Wl = {
|
|
5689
5669
|
type: p.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
5690
5670
|
totalProjects: p.number().optional().describe("Total number of projects (account overview only)."),
|
|
5691
5671
|
totalTasks: p.number().optional().describe("Total number of tasks."),
|
|
@@ -5703,7 +5683,7 @@ var Wl = { projectId: p.string().min(1).optional().describe("Optional project ID
|
|
|
5703
5683
|
name: p.string().describe("The inbox project name."),
|
|
5704
5684
|
sections: p.array(hi).describe("Sections in the inbox project.")
|
|
5705
5685
|
}).optional().describe("Inbox information (account overview only)."),
|
|
5706
|
-
projects: p.array(p.lazy(() =>
|
|
5686
|
+
projects: p.array(p.lazy(() => Ul)).optional().describe("List of projects with hierarchy, folders, and ordering (account overview only)."),
|
|
5707
5687
|
project: p.object({
|
|
5708
5688
|
id: p.string().describe("The project ID."),
|
|
5709
5689
|
name: p.string().describe("The project name.")
|
|
@@ -5716,7 +5696,7 @@ var Wl = { projectId: p.string().min(1).optional().describe("Optional project ID
|
|
|
5716
5696
|
tasksWithoutSection: p.number()
|
|
5717
5697
|
}).optional().describe("Statistics object (project overview only).")
|
|
5718
5698
|
};
|
|
5719
|
-
function
|
|
5699
|
+
function Gl(e) {
|
|
5720
5700
|
let t = {};
|
|
5721
5701
|
for (let n of e) t[n.id] = {
|
|
5722
5702
|
...n,
|
|
@@ -5739,22 +5719,22 @@ function ql(e) {
|
|
|
5739
5719
|
}
|
|
5740
5720
|
return r(n), n;
|
|
5741
5721
|
}
|
|
5742
|
-
async function
|
|
5722
|
+
async function Kl(e, t) {
|
|
5743
5723
|
let n = {};
|
|
5744
5724
|
return await Promise.all(t.map(async (t) => {
|
|
5745
5725
|
let { results: r } = await e.getSections({ projectId: t });
|
|
5746
5726
|
n[t] = r;
|
|
5747
5727
|
})), n;
|
|
5748
5728
|
}
|
|
5749
|
-
function
|
|
5729
|
+
function ql(e, t, n = "") {
|
|
5750
5730
|
let r = [];
|
|
5751
5731
|
r.push(`${n}- Project: ${e.name} (id=${e.id})`);
|
|
5752
5732
|
let i = t[e.id] || [];
|
|
5753
5733
|
for (let e of i) r.push(`${n} - Section: ${e.name} (id=${e.id})`);
|
|
5754
|
-
for (let i of e.children) r.push(...
|
|
5734
|
+
for (let i of e.children) r.push(...ql(i, t, `${n} `));
|
|
5755
5735
|
return r;
|
|
5756
5736
|
}
|
|
5757
|
-
function
|
|
5737
|
+
function Jl(e) {
|
|
5758
5738
|
let t = {};
|
|
5759
5739
|
for (let n of e) t[n.id] = {
|
|
5760
5740
|
...n,
|
|
@@ -5773,15 +5753,15 @@ function Xl(e) {
|
|
|
5773
5753
|
}
|
|
5774
5754
|
return n;
|
|
5775
5755
|
}
|
|
5776
|
-
function
|
|
5756
|
+
function Yl(e, t, n = "") {
|
|
5777
5757
|
let r = [];
|
|
5778
5758
|
for (let i of e) {
|
|
5779
5759
|
let e = `id=${i.id}`, a = i.dueDate ? `; due=${i.dueDate}` : "", o = i.responsibleUid ? `; assignee=${t.get(i.responsibleUid) ?? i.responsibleUid}` : "", s = `; content=${i.content}`;
|
|
5780
|
-
r.push(`${n}- ${e}${a}${o}${s}`), i.children.length > 0 && r.push(...
|
|
5760
|
+
r.push(`${n}- ${e}${a}${o}${s}`), i.children.length > 0 && r.push(...Yl(i.children, t, `${n} `));
|
|
5781
5761
|
}
|
|
5782
5762
|
return r;
|
|
5783
5763
|
}
|
|
5784
|
-
function
|
|
5764
|
+
function Xl(e, t) {
|
|
5785
5765
|
return {
|
|
5786
5766
|
id: e.id,
|
|
5787
5767
|
name: e.name,
|
|
@@ -5789,10 +5769,10 @@ function Ql(e, t) {
|
|
|
5789
5769
|
folderId: de(e) ? e.folderId ?? void 0 : void 0,
|
|
5790
5770
|
childOrder: e.childOrder,
|
|
5791
5771
|
sections: (t[e.id] || []).map(gi),
|
|
5792
|
-
children: e.children.map((e) =>
|
|
5772
|
+
children: e.children.map((e) => Xl(e, t))
|
|
5793
5773
|
};
|
|
5794
5774
|
}
|
|
5795
|
-
async function
|
|
5775
|
+
async function Zl(e, t) {
|
|
5796
5776
|
let n = [], r;
|
|
5797
5777
|
do {
|
|
5798
5778
|
let { results: i, nextCursor: a } = await e.getTasks({
|
|
@@ -5804,17 +5784,17 @@ async function $l(e, t) {
|
|
|
5804
5784
|
} while (r);
|
|
5805
5785
|
return n;
|
|
5806
5786
|
}
|
|
5807
|
-
async function
|
|
5787
|
+
async function Ql(e, t) {
|
|
5808
5788
|
let { results: n } = await e.getSections({ projectId: t });
|
|
5809
5789
|
return n;
|
|
5810
5790
|
}
|
|
5811
|
-
async function
|
|
5812
|
-
let { results: t } = await e.getProjects({}), n = t.find((e) => le(e) && e.inboxProject === !0), r =
|
|
5791
|
+
async function $l(e) {
|
|
5792
|
+
let { results: t } = await e.getProjects({}), n = t.find((e) => le(e) && e.inboxProject === !0), r = Gl(t.filter((e) => !le(e) || e.inboxProject !== !0)), i = t.map((e) => e.id), a = await Kl(e, i), o = ["# Personal Projects", ""];
|
|
5813
5793
|
if (n) {
|
|
5814
5794
|
o.push(`- Inbox Project: ${n.name} (id=${n.id})`);
|
|
5815
5795
|
for (let e of a[n.id] || []) o.push(` - Section: ${e.name} (id=${e.id})`);
|
|
5816
5796
|
}
|
|
5817
|
-
if (r.length) for (let e of r) o.push(...
|
|
5797
|
+
if (r.length) for (let e of r) o.push(...ql(e, a));
|
|
5818
5798
|
else o.push("_No projects found._");
|
|
5819
5799
|
o.push(""), o.push(`_Note: This overview lists projects and sections only; tasks are not included. Call ${B.GET_OVERVIEW} with a projectId (or "inbox") to see a project's tasks._`, "");
|
|
5820
5800
|
let s = r.some((e) => e.children.length > 0);
|
|
@@ -5827,20 +5807,20 @@ async function tu(e) {
|
|
|
5827
5807
|
name: n.name,
|
|
5828
5808
|
sections: (a[n.id] || []).map(gi)
|
|
5829
5809
|
} : void 0,
|
|
5830
|
-
projects: r.map((e) =>
|
|
5810
|
+
projects: r.map((e) => Xl(e, a)),
|
|
5831
5811
|
totalProjects: t.length,
|
|
5832
5812
|
totalSections: i.reduce((e, t) => e + (a[t]?.length || 0), 0),
|
|
5833
5813
|
hasNestedProjects: s
|
|
5834
5814
|
}
|
|
5835
5815
|
};
|
|
5836
5816
|
}
|
|
5837
|
-
async function
|
|
5817
|
+
async function eu(e, t) {
|
|
5838
5818
|
let n = G(e, t), r = (e) => e.catch(async (e) => {
|
|
5839
5819
|
throw await n, e;
|
|
5840
5820
|
}), [i, a, o] = await Promise.all([
|
|
5841
5821
|
n,
|
|
5842
|
-
r(
|
|
5843
|
-
r(
|
|
5822
|
+
r(Ql(e, t)),
|
|
5823
|
+
r(Zl(e, t))
|
|
5844
5824
|
]), s = await Er(e, o), c = {};
|
|
5845
5825
|
for (let e of a) c[e.id] = [];
|
|
5846
5826
|
let l = [];
|
|
@@ -5848,15 +5828,15 @@ async function nu(e, t) {
|
|
|
5848
5828
|
let u = [`# ${i.name}`];
|
|
5849
5829
|
if (l.length > 0) {
|
|
5850
5830
|
u.push("");
|
|
5851
|
-
let e =
|
|
5852
|
-
u.push(...
|
|
5831
|
+
let e = Jl(l);
|
|
5832
|
+
u.push(...Yl(e, s));
|
|
5853
5833
|
}
|
|
5854
5834
|
for (let e of a) {
|
|
5855
5835
|
u.push(""), u.push(`## ${e.name}`);
|
|
5856
5836
|
let t = c[e.id];
|
|
5857
5837
|
if (!t?.length) continue;
|
|
5858
|
-
let n =
|
|
5859
|
-
u.push(...
|
|
5838
|
+
let n = Jl(t);
|
|
5839
|
+
u.push(...Yl(n, s));
|
|
5860
5840
|
}
|
|
5861
5841
|
return {
|
|
5862
5842
|
textContent: u.join("\n"),
|
|
@@ -5879,11 +5859,11 @@ async function nu(e, t) {
|
|
|
5879
5859
|
}
|
|
5880
5860
|
};
|
|
5881
5861
|
}
|
|
5882
|
-
var
|
|
5862
|
+
var tu = {
|
|
5883
5863
|
name: B.GET_OVERVIEW,
|
|
5884
5864
|
description: "Get a Markdown overview. Called without a projectId, returns the account's project and section structure only — no tasks — for navigation. Pass a projectId (or \"inbox\" for the Inbox) to get that project's tasks grouped by section.",
|
|
5885
|
-
parameters:
|
|
5886
|
-
outputSchema:
|
|
5865
|
+
parameters: Hl,
|
|
5866
|
+
outputSchema: Wl,
|
|
5887
5867
|
annotations: {
|
|
5888
5868
|
readOnlyHint: !0,
|
|
5889
5869
|
destructiveHint: !1,
|
|
@@ -5893,41 +5873,41 @@ var ru = {
|
|
|
5893
5873
|
let n = await Pr({
|
|
5894
5874
|
projectId: e.projectId,
|
|
5895
5875
|
client: t
|
|
5896
|
-
}), r = n ? await
|
|
5876
|
+
}), r = n ? await eu(t, n) : await $l(t);
|
|
5897
5877
|
return {
|
|
5898
5878
|
textContent: r.textContent,
|
|
5899
5879
|
structuredContent: r.structuredContent
|
|
5900
5880
|
};
|
|
5901
5881
|
}
|
|
5902
|
-
},
|
|
5882
|
+
}, nu = {}, ru = p.object({
|
|
5903
5883
|
count: p.number().describe("Number of consecutive periods in this streak."),
|
|
5904
5884
|
start: p.string().describe("Start date of the streak."),
|
|
5905
5885
|
end: p.string().describe("End date of the streak.")
|
|
5906
|
-
}),
|
|
5886
|
+
}), iu = p.object({
|
|
5907
5887
|
id: p.string().describe("Project ID."),
|
|
5908
5888
|
completed: p.number().describe("Number of tasks completed in this project.")
|
|
5909
|
-
}),
|
|
5889
|
+
}), au = {
|
|
5910
5890
|
completedCount: p.number().describe("Total number of completed tasks (all-time)."),
|
|
5911
5891
|
daysItems: p.array(p.object({
|
|
5912
5892
|
date: p.string().describe("Date string (YYYY-MM-DD)."),
|
|
5913
5893
|
totalCompleted: p.number().describe("Total tasks completed on this day."),
|
|
5914
|
-
items: p.array(
|
|
5894
|
+
items: p.array(iu).describe("Per-project completion breakdown for this day.")
|
|
5915
5895
|
})).describe("Daily completion breakdown (most recent days)."),
|
|
5916
5896
|
weekItems: p.array(p.object({
|
|
5917
5897
|
from: p.string().describe("Start date of the week."),
|
|
5918
5898
|
to: p.string().describe("End date of the week."),
|
|
5919
5899
|
totalCompleted: p.number().describe("Total tasks completed in this week."),
|
|
5920
|
-
items: p.array(
|
|
5900
|
+
items: p.array(iu).describe("Per-project completion breakdown for this week.")
|
|
5921
5901
|
})).describe("Weekly completion breakdown (most recent weeks)."),
|
|
5922
5902
|
goals: p.object({
|
|
5923
5903
|
dailyGoal: p.number().describe("Daily task completion goal."),
|
|
5924
5904
|
weeklyGoal: p.number().describe("Weekly task completion goal."),
|
|
5925
|
-
currentDailyStreak:
|
|
5926
|
-
currentWeeklyStreak:
|
|
5927
|
-
lastDailyStreak:
|
|
5928
|
-
lastWeeklyStreak:
|
|
5929
|
-
maxDailyStreak:
|
|
5930
|
-
maxWeeklyStreak:
|
|
5905
|
+
currentDailyStreak: ru.describe("Current daily goal streak."),
|
|
5906
|
+
currentWeeklyStreak: ru.describe("Current weekly goal streak."),
|
|
5907
|
+
lastDailyStreak: ru.describe("Previous daily goal streak."),
|
|
5908
|
+
lastWeeklyStreak: ru.describe("Previous weekly goal streak."),
|
|
5909
|
+
maxDailyStreak: ru.describe("Best daily goal streak ever."),
|
|
5910
|
+
maxWeeklyStreak: ru.describe("Best weekly goal streak ever."),
|
|
5931
5911
|
vacationMode: p.boolean().describe("Whether vacation mode is enabled."),
|
|
5932
5912
|
karmaDisabled: p.boolean().describe("Whether karma tracking is disabled.")
|
|
5933
5913
|
}).describe("Goal and streak information."),
|
|
@@ -5947,11 +5927,11 @@ var ru = {
|
|
|
5947
5927
|
negativeKarmaReasons: p.array(p.any()).describe("Reasons for negative karma.")
|
|
5948
5928
|
})).describe("Recent karma change events with reasons."),
|
|
5949
5929
|
projectColors: p.record(p.string(), p.string()).describe("Map of project ID to color key.")
|
|
5950
|
-
},
|
|
5930
|
+
}, ou = {
|
|
5951
5931
|
name: B.GET_PRODUCTIVITY_STATS,
|
|
5952
5932
|
description: "Get comprehensive productivity statistics including daily/weekly completion breakdowns, goal streaks (current, last, max), karma score and trends, and historical karma data. Useful for productivity analysis and tracking goal progress. Reports counts, streaks and karma only, never the tasks themselves — for \"what did I complete\", use find-activity.",
|
|
5953
|
-
parameters:
|
|
5954
|
-
outputSchema:
|
|
5933
|
+
parameters: nu,
|
|
5934
|
+
outputSchema: au,
|
|
5955
5935
|
annotations: {
|
|
5956
5936
|
readOnlyHint: !0,
|
|
5957
5937
|
destructiveHint: !1,
|
|
@@ -5960,7 +5940,7 @@ var ru = {
|
|
|
5960
5940
|
async execute(e, t) {
|
|
5961
5941
|
let n = await t.getProductivityStats();
|
|
5962
5942
|
return {
|
|
5963
|
-
textContent:
|
|
5943
|
+
textContent: su(n),
|
|
5964
5944
|
structuredContent: {
|
|
5965
5945
|
completedCount: n.completedCount,
|
|
5966
5946
|
daysItems: n.daysItems,
|
|
@@ -5987,7 +5967,7 @@ var ru = {
|
|
|
5987
5967
|
};
|
|
5988
5968
|
}
|
|
5989
5969
|
};
|
|
5990
|
-
function
|
|
5970
|
+
function su(e) {
|
|
5991
5971
|
let t = [
|
|
5992
5972
|
"# Productivity Statistics",
|
|
5993
5973
|
"",
|
|
@@ -6015,11 +5995,11 @@ function lu(e) {
|
|
|
6015
5995
|
return t.join("\n");
|
|
6016
5996
|
}
|
|
6017
5997
|
// src/tools/get-project-activity-stats.ts
|
|
6018
|
-
var
|
|
5998
|
+
var cu = {
|
|
6019
5999
|
projectId: p.string().min(1).describe("The ID of the project to get activity stats for."),
|
|
6020
6000
|
weeks: p.number().int().min(1).max(12).optional().describe("Number of weeks of activity data to retrieve (1-12, default 2)."),
|
|
6021
6001
|
includeWeeklyCounts: p.boolean().optional().describe("Include weekly rollup counts alongside daily counts.")
|
|
6022
|
-
},
|
|
6002
|
+
}, lu = {
|
|
6023
6003
|
projectId: p.string().describe("The project ID."),
|
|
6024
6004
|
dayItems: p.array(p.object({
|
|
6025
6005
|
date: p.string().describe("Date in ISO format."),
|
|
@@ -6031,7 +6011,7 @@ var uu = {
|
|
|
6031
6011
|
totalCount: p.number().describe("Number of tasks completed in this week.")
|
|
6032
6012
|
})).optional().describe("Weekly completion rollups. Only included when includeWeeklyCounts is true.")
|
|
6033
6013
|
};
|
|
6034
|
-
function
|
|
6014
|
+
function uu(e, t) {
|
|
6035
6015
|
let n = [`# Activity Stats: Project ${e}`, ""];
|
|
6036
6016
|
if (t.dayItems.length > 0) {
|
|
6037
6017
|
n.push("## Daily Activity");
|
|
@@ -6043,11 +6023,11 @@ function fu(e, t) {
|
|
|
6043
6023
|
}
|
|
6044
6024
|
return n.join("\n");
|
|
6045
6025
|
}
|
|
6046
|
-
var
|
|
6026
|
+
var du = {
|
|
6047
6027
|
name: B.GET_PROJECT_ACTIVITY_STATS,
|
|
6048
6028
|
description: "Get daily and optional weekly task completion counts for a project over a configurable time window (1-12 weeks). Useful for identifying completion trends and patterns.",
|
|
6049
|
-
parameters:
|
|
6050
|
-
outputSchema:
|
|
6029
|
+
parameters: cu,
|
|
6030
|
+
outputSchema: lu,
|
|
6051
6031
|
annotations: {
|
|
6052
6032
|
readOnlyHint: !0,
|
|
6053
6033
|
destructiveHint: !1,
|
|
@@ -6059,7 +6039,7 @@ var pu = {
|
|
|
6059
6039
|
includeWeeklyCounts: i
|
|
6060
6040
|
});
|
|
6061
6041
|
return {
|
|
6062
|
-
textContent:
|
|
6042
|
+
textContent: uu(n, a),
|
|
6063
6043
|
structuredContent: {
|
|
6064
6044
|
projectId: n,
|
|
6065
6045
|
dayItems: a.dayItems,
|
|
@@ -6067,7 +6047,7 @@ var pu = {
|
|
|
6067
6047
|
}
|
|
6068
6048
|
};
|
|
6069
6049
|
}
|
|
6070
|
-
},
|
|
6050
|
+
}, fu = { projectId: p.string().min(1).describe("The ID of the project to check health for.") }, pu = {
|
|
6071
6051
|
projectId: p.string().describe("The project ID."),
|
|
6072
6052
|
projectName: p.string().describe("The project name."),
|
|
6073
6053
|
progress: p.object({
|
|
@@ -6084,15 +6064,15 @@ var pu = {
|
|
|
6084
6064
|
updatedAt: p.string().optional().describe("When the health assessment was last updated.")
|
|
6085
6065
|
}).describe("Project health assessment.")
|
|
6086
6066
|
};
|
|
6087
|
-
function
|
|
6067
|
+
function mu(e, t, n) {
|
|
6088
6068
|
let r = [`# Project Health: ${e}`, ""];
|
|
6089
6069
|
return r.push(`**Status:** ${n.status}`), n.isStale && r.push("**Note:** Health data is stale and may not reflect recent changes."), n.updateInProgress && r.push("**Note:** A health analysis update is currently in progress."), n.updatedAt && r.push(`**Last Updated:** ${n.updatedAt.toISOString()}`), r.push(""), r.push("## Progress"), r.push(`**Completed:** ${t.completedCount} | **Active:** ${t.activeCount} | **Progress:** ${t.progressPercent}%`), n.description && (r.push(""), r.push("## Health Description"), r.push(n.description)), r.join("\n");
|
|
6090
6070
|
}
|
|
6091
|
-
var
|
|
6071
|
+
var hu = {
|
|
6092
6072
|
name: B.GET_PROJECT_HEALTH,
|
|
6093
6073
|
description: "Get a comprehensive health assessment for a project including completion progress, health status (EXCELLENT, ON_TRACK, AT_RISK, CRITICAL), and a written assessment. Use find-tasks and find-completed-tasks for task-level detail.",
|
|
6094
|
-
parameters:
|
|
6095
|
-
outputSchema:
|
|
6074
|
+
parameters: fu,
|
|
6075
|
+
outputSchema: pu,
|
|
6096
6076
|
annotations: {
|
|
6097
6077
|
readOnlyHint: !0,
|
|
6098
6078
|
destructiveHint: !1,
|
|
@@ -6101,7 +6081,7 @@ var _u = {
|
|
|
6101
6081
|
async execute(e, t) {
|
|
6102
6082
|
let { projectId: n } = e, [r, i] = await Promise.all([t.getProjectProgress(n), t.getProjectHealth(n)]), a = `Project ${n}`;
|
|
6103
6083
|
return {
|
|
6104
|
-
textContent:
|
|
6084
|
+
textContent: mu(a, r, i),
|
|
6105
6085
|
structuredContent: {
|
|
6106
6086
|
projectId: n,
|
|
6107
6087
|
projectName: a,
|
|
@@ -6121,27 +6101,27 @@ var _u = {
|
|
|
6121
6101
|
}
|
|
6122
6102
|
};
|
|
6123
6103
|
}
|
|
6124
|
-
},
|
|
6104
|
+
}, gu = p.object({
|
|
6125
6105
|
message: p.string().optional(),
|
|
6126
6106
|
emoji: p.string().optional(),
|
|
6127
6107
|
activeUntil: p.string().optional().describe("ISO 8601 end. Omitted when it has no end."),
|
|
6128
6108
|
pauseNotifications: p.boolean().describe("Comms notifications held back."),
|
|
6129
6109
|
pauseActivity: p.boolean().describe("Karma and streaks paused.")
|
|
6130
|
-
}),
|
|
6110
|
+
}), _u = {
|
|
6131
6111
|
hasStatus: p.boolean(),
|
|
6132
|
-
status:
|
|
6112
|
+
status: gu.optional().describe("Omitted when there is no active status.")
|
|
6133
6113
|
};
|
|
6134
|
-
function
|
|
6114
|
+
function vu(e) {
|
|
6135
6115
|
if (!e.user) throw Error("Todoist did not return the user, so the status is unknown.");
|
|
6136
6116
|
return e.user.status ?? null;
|
|
6137
6117
|
}
|
|
6138
|
-
async function
|
|
6139
|
-
return
|
|
6118
|
+
async function yu(e) {
|
|
6119
|
+
return vu(await R(() => e.sync({
|
|
6140
6120
|
resourceTypes: ["user"],
|
|
6141
6121
|
syncToken: "*"
|
|
6142
6122
|
})));
|
|
6143
6123
|
}
|
|
6144
|
-
function
|
|
6124
|
+
function bu(e) {
|
|
6145
6125
|
let t = e.activeUntil ? new Date(e.activeUntil).toISOString() : void 0;
|
|
6146
6126
|
return {
|
|
6147
6127
|
...e.message ? { message: e.message } : {},
|
|
@@ -6151,12 +6131,12 @@ function Su(e) {
|
|
|
6151
6131
|
pauseActivity: !!e.effects?.pauseActivity
|
|
6152
6132
|
};
|
|
6153
6133
|
}
|
|
6154
|
-
function
|
|
6134
|
+
function xu(e, t) {
|
|
6155
6135
|
if (!e) return {
|
|
6156
6136
|
textContent: `${t}: none`,
|
|
6157
6137
|
structuredContent: { hasStatus: !1 }
|
|
6158
6138
|
};
|
|
6159
|
-
let n =
|
|
6139
|
+
let n = bu(e), r = [`${t}: ${[n.emoji, n.message].filter(Boolean).join(" ")}`];
|
|
6160
6140
|
r.push(n.activeUntil ? `Until: ${n.activeUntil}` : "Until: no end");
|
|
6161
6141
|
let i = [n.pauseNotifications ? "Comms notifications paused" : void 0, n.pauseActivity ? "Karma and streaks paused" : void 0].filter((e) => e !== void 0);
|
|
6162
6142
|
return i.length > 0 && r.push(`Effects: ${i.join(", ")}`), {
|
|
@@ -6168,23 +6148,23 @@ function Cu(e, t) {
|
|
|
6168
6148
|
};
|
|
6169
6149
|
}
|
|
6170
6150
|
// src/tools/get-user-status.ts
|
|
6171
|
-
var
|
|
6151
|
+
var Su = {
|
|
6172
6152
|
name: B.GET_USER_STATUS,
|
|
6173
6153
|
description: "Get the user's status, the message and emoji shown next to their name in Todoist and Comms, with when it ends and whether it pauses Comms notifications or Karma and streaks. Returns no status when none is set or it has expired.",
|
|
6174
6154
|
parameters: {},
|
|
6175
|
-
outputSchema:
|
|
6155
|
+
outputSchema: _u,
|
|
6176
6156
|
annotations: {
|
|
6177
6157
|
readOnlyHint: !0,
|
|
6178
6158
|
destructiveHint: !1,
|
|
6179
6159
|
idempotentHint: !0
|
|
6180
6160
|
},
|
|
6181
6161
|
async execute(e, t) {
|
|
6182
|
-
return
|
|
6162
|
+
return xu(await yu(t), "Status");
|
|
6183
6163
|
}
|
|
6184
|
-
},
|
|
6164
|
+
}, Cu = {
|
|
6185
6165
|
workspaceIdOrName: p.string().min(1).describe("The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."),
|
|
6186
6166
|
projectIds: p.array(p.string().min(1)).min(1).max(D.FILTER_VALUES_MAX).optional().describe("Optional list of project IDs to scope insights to specific projects.")
|
|
6187
|
-
},
|
|
6167
|
+
}, wu = p.object({
|
|
6188
6168
|
projectId: p.string().describe("The project ID."),
|
|
6189
6169
|
health: p.object({
|
|
6190
6170
|
status: p.enum(v).describe("The health status of the project."),
|
|
@@ -6196,15 +6176,15 @@ var wu = {
|
|
|
6196
6176
|
activeCount: p.number().describe("Number of active tasks."),
|
|
6197
6177
|
progressPercent: p.number().describe("Completion percentage (0-100).")
|
|
6198
6178
|
}).optional().describe("Progress data for this project. Omitted when the project has none.")
|
|
6199
|
-
}),
|
|
6179
|
+
}), Tu = {
|
|
6200
6180
|
workspaceId: p.string().describe("The resolved workspace ID."),
|
|
6201
6181
|
workspaceName: p.string().describe("The resolved workspace name."),
|
|
6202
|
-
projectInsights: p.array(
|
|
6203
|
-
},
|
|
6182
|
+
projectInsights: p.array(wu).describe("Health and progress insights for each project in the workspace.")
|
|
6183
|
+
}, Eu = {
|
|
6204
6184
|
name: B.GET_WORKSPACE_INSIGHTS,
|
|
6205
6185
|
description: "Get aggregated health and progress insights across all projects in a workspace. Accepts workspace name or ID, with optional project ID filtering. Useful for a cross-project health overview.",
|
|
6206
|
-
parameters:
|
|
6207
|
-
outputSchema:
|
|
6186
|
+
parameters: Cu,
|
|
6187
|
+
outputSchema: Tu,
|
|
6208
6188
|
annotations: {
|
|
6209
6189
|
readOnlyHint: !0,
|
|
6210
6190
|
destructiveHint: !1,
|
|
@@ -6242,21 +6222,21 @@ var wu = {
|
|
|
6242
6222
|
}
|
|
6243
6223
|
};
|
|
6244
6224
|
}
|
|
6245
|
-
},
|
|
6225
|
+
}, Du = {
|
|
6246
6226
|
projectId: p.string().min(1).describe("The ID of the existing project to import into."),
|
|
6247
6227
|
templateId: p.string().regex(Ca, { error: wa }).optional().describe("The template to import — either a gallery slug (\"product-launch\"), a personal template ID (\"UT_28Ex...\"), or a full Todoist template URL, which is reduced to the ID automatically. Gallery templates work for anyone; personal templates only for the account that owns them. Find one with find-templates. Not with `csvFileContent`."),
|
|
6248
6228
|
csvFileContent: p.string().min(1).optional().describe("CSV content to import, e.g. from export-project or a file the user shared. Not with `templateId`."),
|
|
6249
6229
|
locale: p.string().optional().describe("Locale for a template's content. Defaults to \"en\".")
|
|
6250
|
-
},
|
|
6230
|
+
}, Ou = {
|
|
6251
6231
|
sections: p.array(hi).describe("Sections created by the import."),
|
|
6252
6232
|
tasks: p.array(J).describe("Tasks created by the import."),
|
|
6253
6233
|
comments: p.array(bi).describe("Comments created by the import."),
|
|
6254
6234
|
totalCount: p.number().describe("The total number of objects created by the import.")
|
|
6255
6235
|
};
|
|
6256
|
-
function
|
|
6236
|
+
function ku({ projectId: e, source: t, result: n }) {
|
|
6257
6237
|
let r = n.sections.map(gi), i = n.tasks.map(K), a = n.comments.map(Yr), o = n.projects.length + r.length + i.length + a.length;
|
|
6258
6238
|
return {
|
|
6259
|
-
textContent:
|
|
6239
|
+
textContent: Au({
|
|
6260
6240
|
projectId: e,
|
|
6261
6241
|
source: t,
|
|
6262
6242
|
counts: {
|
|
@@ -6275,18 +6255,18 @@ function ju({ projectId: e, source: t, result: n }) {
|
|
|
6275
6255
|
}
|
|
6276
6256
|
};
|
|
6277
6257
|
}
|
|
6278
|
-
function
|
|
6258
|
+
function Au({ projectId: e, source: t, counts: n, totalCount: r }) {
|
|
6279
6259
|
return r === 0 ? `Imported ${t} into project (id=${e}), but it created nothing.` : `Imported ${t} into project (id=${e}): ${Object.entries(n).filter(([, e]) => e > 0).map(([e, t]) => `${t} ${t === 1 ? e.replace(/s$/, "") : e}`).join(", ")}.`;
|
|
6280
6260
|
}
|
|
6281
|
-
async function
|
|
6261
|
+
async function ju(e, { projectId: t, templateId: n, locale: r }, { lookUp: i }) {
|
|
6282
6262
|
let [a, o] = await Promise.all([i("project", () => G(e, t), { fatal: (e) => e instanceof ot }), n ? i("template", () => e.getTemplate(Ta(n), r ? { locale: r } : void 0)) : void 0]);
|
|
6283
6263
|
return `Import ${n ? `the template "${o?.name ?? Ta(n)}"` : "the CSV"} into ${a ? `the project "${a.name}"` : `the project (id=${t})`}? Its sections, tasks and comments are added to what's already there. This can't be undone.`;
|
|
6284
6264
|
}
|
|
6285
|
-
var
|
|
6265
|
+
var Mu = {
|
|
6286
6266
|
name: B.IMPORT_INTO_PROJECT,
|
|
6287
6267
|
description: "Import a template (by ID or URL) or CSV content into an existing project, like the app's \"Import from CSV\", adding its tasks, sections and comments to whatever is already there. To start a new project from a template, use add-projects with templateId instead. This writes immediately and cannot be undone, so only run it against a project the user named.",
|
|
6288
|
-
parameters:
|
|
6289
|
-
outputSchema:
|
|
6268
|
+
parameters: Du,
|
|
6269
|
+
outputSchema: Ou,
|
|
6290
6270
|
annotations: {
|
|
6291
6271
|
readOnlyHint: !1,
|
|
6292
6272
|
destructiveHint: !1,
|
|
@@ -6296,7 +6276,7 @@ var Pu = {
|
|
|
6296
6276
|
if (!!t == !!n) throw Error("Provide exactly one source: either `templateId` or `csvFileContent`. Find template IDs with find-templates.");
|
|
6297
6277
|
let o = await a?.confirm({
|
|
6298
6278
|
key: "import",
|
|
6299
|
-
message: (n) =>
|
|
6279
|
+
message: (n) => ju(i, {
|
|
6300
6280
|
projectId: e,
|
|
6301
6281
|
templateId: t,
|
|
6302
6282
|
locale: r
|
|
@@ -6313,7 +6293,7 @@ var Pu = {
|
|
|
6313
6293
|
}
|
|
6314
6294
|
};
|
|
6315
6295
|
let s = (t) => new lt(t, `The import into project (id=${e}) did not complete. If you created that project for this import, it may be empty.`);
|
|
6316
|
-
return
|
|
6296
|
+
return ku(t ? {
|
|
6317
6297
|
projectId: e,
|
|
6318
6298
|
source: "template",
|
|
6319
6299
|
result: await i.importTemplateFromId({
|
|
@@ -6335,7 +6315,7 @@ var Pu = {
|
|
|
6335
6315
|
})
|
|
6336
6316
|
});
|
|
6337
6317
|
}
|
|
6338
|
-
},
|
|
6318
|
+
}, Nu = {}, Pu = {
|
|
6339
6319
|
id: p.string().describe("The unique identifier for the workspace."),
|
|
6340
6320
|
name: p.string().describe("The name of the workspace."),
|
|
6341
6321
|
plan: p.enum(ne).describe("The workspace plan type."),
|
|
@@ -6344,12 +6324,12 @@ var Pu = {
|
|
|
6344
6324
|
isGuestAllowed: p.boolean().describe("Whether guests are allowed in the workspace."),
|
|
6345
6325
|
createdAt: p.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
|
|
6346
6326
|
creatorId: p.string().describe("The ID of the user who created the workspace.")
|
|
6347
|
-
},
|
|
6327
|
+
}, Fu = {
|
|
6348
6328
|
type: p.literal("workspaces").describe("The type of the response."),
|
|
6349
|
-
workspaces: p.array(p.object(
|
|
6329
|
+
workspaces: p.array(p.object(Pu)).describe("List of workspaces."),
|
|
6350
6330
|
count: p.number().describe("The total number of workspaces.")
|
|
6351
6331
|
};
|
|
6352
|
-
async function
|
|
6332
|
+
async function Iu(e) {
|
|
6353
6333
|
let t = (await e.getWorkspaces()).map((e) => ({
|
|
6354
6334
|
id: e.id,
|
|
6355
6335
|
name: e.name,
|
|
@@ -6374,34 +6354,34 @@ async function Ru(e) {
|
|
|
6374
6354
|
}
|
|
6375
6355
|
};
|
|
6376
6356
|
}
|
|
6377
|
-
var
|
|
6357
|
+
var Lu = {
|
|
6378
6358
|
name: B.LIST_WORKSPACES,
|
|
6379
6359
|
description: "Get all workspaces for the authenticated user. Returns workspace details including ID, name, plan type (STARTER/BUSINESS), user role (ADMIN/MEMBER/GUEST), link sharing settings, guest permissions, creation date, and creator ID.",
|
|
6380
|
-
parameters:
|
|
6381
|
-
outputSchema:
|
|
6360
|
+
parameters: Nu,
|
|
6361
|
+
outputSchema: Fu,
|
|
6382
6362
|
annotations: {
|
|
6383
6363
|
readOnlyHint: !0,
|
|
6384
6364
|
destructiveHint: !1,
|
|
6385
6365
|
idempotentHint: !0
|
|
6386
6366
|
},
|
|
6387
6367
|
async execute(e, t) {
|
|
6388
|
-
let n = await
|
|
6368
|
+
let n = await Iu(t);
|
|
6389
6369
|
return {
|
|
6390
6370
|
textContent: n.textContent,
|
|
6391
6371
|
structuredContent: n.structuredContent
|
|
6392
6372
|
};
|
|
6393
6373
|
}
|
|
6394
|
-
}, { FIND_TASKS:
|
|
6374
|
+
}, { FIND_TASKS: Ru, FIND_PROJECT_COLLABORATORS: zu, UPDATE_TASKS: Bu } = B, Vu = O.BULK_ACTIONS_PER_OPERATION, Hu = {
|
|
6395
6375
|
operation: p.enum([
|
|
6396
6376
|
"assign",
|
|
6397
6377
|
"unassign",
|
|
6398
6378
|
"reassign"
|
|
6399
6379
|
]).describe("The assignment operation to perform."),
|
|
6400
|
-
taskIds: p.array(p.string()).min(1).max(
|
|
6380
|
+
taskIds: p.array(p.string()).min(1).max(Vu).describe("The IDs of the tasks to operate on (max 50)."),
|
|
6401
6381
|
responsibleUser: p.string().optional().describe("The user to assign tasks to. Can be \"me\" (assigns to current user), a user ID, name, or email. Required for assign and reassign operations."),
|
|
6402
6382
|
fromAssigneeUser: p.string().optional().describe("For reassign operations: the current assignee to reassign from. Can be user ID, name, or email. Optional - if not provided, reassigns from any current assignee."),
|
|
6403
6383
|
dryRun: p.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
|
|
6404
|
-
},
|
|
6384
|
+
}, Uu = {
|
|
6405
6385
|
results: p.array(p.object({
|
|
6406
6386
|
taskId: p.string().describe("The ID of the task."),
|
|
6407
6387
|
success: p.boolean().describe("Whether the operation was successful."),
|
|
@@ -6415,11 +6395,11 @@ var zu = {
|
|
|
6415
6395
|
failed: p.number().describe("Number of failed operations."),
|
|
6416
6396
|
dryRun: p.boolean().describe("Whether this was a dry run.")
|
|
6417
6397
|
}).optional().describe("Summary of the operation.")
|
|
6418
|
-
},
|
|
6398
|
+
}, Wu = {
|
|
6419
6399
|
name: B.MANAGE_ASSIGNMENTS,
|
|
6420
|
-
description: `Assign, unassign or reassign up to ${
|
|
6421
|
-
parameters:
|
|
6422
|
-
outputSchema:
|
|
6400
|
+
description: `Assign, unassign or reassign up to ${Vu} tasks at once. Assigning notifies the new assignee. Each task is updated independently, so one failure does not undo the others; failures are reported per task. Use dryRun to check the changes first.`,
|
|
6401
|
+
parameters: Hu,
|
|
6402
|
+
outputSchema: Uu,
|
|
6423
6403
|
annotations: {
|
|
6424
6404
|
readOnlyHint: !1,
|
|
6425
6405
|
destructiveHint: !0,
|
|
@@ -6469,7 +6449,7 @@ var zu = {
|
|
|
6469
6449
|
newAssigneeId: void 0
|
|
6470
6450
|
}));
|
|
6471
6451
|
return {
|
|
6472
|
-
textContent:
|
|
6452
|
+
textContent: Gu({
|
|
6473
6453
|
operation: n,
|
|
6474
6454
|
results: e,
|
|
6475
6455
|
dryRun: !0
|
|
@@ -6506,7 +6486,7 @@ var zu = {
|
|
|
6506
6486
|
throw Error(`All ${a.length} unassign operation(s) failed: ${e}`);
|
|
6507
6487
|
}
|
|
6508
6488
|
return {
|
|
6509
|
-
textContent:
|
|
6489
|
+
textContent: Gu({
|
|
6510
6490
|
operation: n,
|
|
6511
6491
|
results: a,
|
|
6512
6492
|
dryRun: !1
|
|
@@ -6581,7 +6561,7 @@ var zu = {
|
|
|
6581
6561
|
throw Error(`All ${_.length} ${n} operation(s) failed: ${e}`);
|
|
6582
6562
|
}
|
|
6583
6563
|
return {
|
|
6584
|
-
textContent:
|
|
6564
|
+
textContent: Gu({
|
|
6585
6565
|
operation: n,
|
|
6586
6566
|
results: _,
|
|
6587
6567
|
dryRun: o
|
|
@@ -6597,7 +6577,7 @@ var zu = {
|
|
|
6597
6577
|
};
|
|
6598
6578
|
}
|
|
6599
6579
|
};
|
|
6600
|
-
function
|
|
6580
|
+
function Gu({ operation: e, results: t, dryRun: n }) {
|
|
6601
6581
|
let r = t.filter((e) => e.success), i = t.filter((e) => !e.success), a = n ? "would be" : "were", o = {
|
|
6602
6582
|
assign: "assigned",
|
|
6603
6583
|
unassign: "unassigned",
|
|
@@ -6618,37 +6598,37 @@ function qu({ operation: e, results: t, dryRun: n }) {
|
|
|
6618
6598
|
for (let t of e) s += ` • Task ${t.taskId}: ${t.error}\n`;
|
|
6619
6599
|
i.length > 5 && (s += ` • ... and ${i.length - 5} more failures\n`), s += "\n";
|
|
6620
6600
|
}
|
|
6621
|
-
return !n && r.length > 0 ? (s += "**Next steps:**\n", s += `• Use ${
|
|
6601
|
+
return !n && r.length > 0 ? (s += "**Next steps:**\n", s += `• Use ${Ru} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks\n`, s += `• Use ${Bu} for individual assignment changes\n`, i.length > 0 && (s += `• Check failed tasks and use ${zu} to verify collaborator access\n`)) : n ? (s += "**To execute:**\n", s += "• Remove dryRun parameter and run again to execute changes\n", r.length > 0 && (s += `• ${r.length} task${r.length === 1 ? "" : "s"} ready for ${e} operation\n`), i.length > 0 && (s += `• Fix ${i.length} validation error${i.length === 1 ? "" : "s"} before executing\n`)) : r.length === 0 && (s += "**Suggestions:**\n", s += `• Use ${zu} to find valid assignees\n`, s += "• Check task IDs and assignee permissions\n", s += "• Use dryRun=true to validate before executing\n"), s;
|
|
6622
6602
|
}
|
|
6623
6603
|
// src/tools/project-management.ts
|
|
6624
|
-
var { FIND_PROJECTS:
|
|
6604
|
+
var { FIND_PROJECTS: Ku } = B, qu = {
|
|
6625
6605
|
action: p.enum([
|
|
6626
6606
|
"archive",
|
|
6627
6607
|
"unarchive",
|
|
6628
6608
|
"join"
|
|
6629
6609
|
]).describe("The action to perform on the project."),
|
|
6630
6610
|
projectId: p.string().min(1).describe("The ID of the project.")
|
|
6631
|
-
},
|
|
6611
|
+
}, Ju = {
|
|
6632
6612
|
project: mi.describe("The updated project."),
|
|
6633
6613
|
success: p.boolean().describe("Whether the action was successful.")
|
|
6634
|
-
},
|
|
6614
|
+
}, Yu = {
|
|
6635
6615
|
archive: "Archived",
|
|
6636
6616
|
unarchive: "Unarchived",
|
|
6637
6617
|
join: "Joined"
|
|
6638
|
-
},
|
|
6618
|
+
}, Xu = {
|
|
6639
6619
|
name: B.PROJECT_MANAGEMENT,
|
|
6640
|
-
description: `Archive or unarchive a project by its ID, or join a workspace project the user hasn't joined (see ${
|
|
6641
|
-
parameters:
|
|
6642
|
-
outputSchema:
|
|
6620
|
+
description: `Archive or unarchive a project by its ID, or join a workspace project the user hasn't joined (see ${Ku} includeUnjoined) when they ask to.`,
|
|
6621
|
+
parameters: qu,
|
|
6622
|
+
outputSchema: Ju,
|
|
6643
6623
|
annotations: {
|
|
6644
6624
|
readOnlyHint: !1,
|
|
6645
6625
|
destructiveHint: !1,
|
|
6646
6626
|
idempotentHint: !0
|
|
6647
6627
|
},
|
|
6648
6628
|
async execute(e, t) {
|
|
6649
|
-
let n = Jr(await
|
|
6629
|
+
let n = Jr(await Zu(e, t));
|
|
6650
6630
|
return {
|
|
6651
|
-
textContent: `${
|
|
6631
|
+
textContent: `${Yu[e.action]} project: ${n.name} (id=${n.id})`,
|
|
6652
6632
|
structuredContent: {
|
|
6653
6633
|
project: n,
|
|
6654
6634
|
success: !0
|
|
@@ -6656,7 +6636,7 @@ var { FIND_PROJECTS: Ju } = B, Yu = {
|
|
|
6656
6636
|
};
|
|
6657
6637
|
}
|
|
6658
6638
|
};
|
|
6659
|
-
async function
|
|
6639
|
+
async function Zu({ action: e, projectId: t }, n) {
|
|
6660
6640
|
switch (e) {
|
|
6661
6641
|
case "archive": return n.archiveProject(t);
|
|
6662
6642
|
case "unarchive": {
|
|
@@ -6670,7 +6650,7 @@ async function $u({ action: e, projectId: t }, n) {
|
|
|
6670
6650
|
}
|
|
6671
6651
|
}
|
|
6672
6652
|
// src/tools/project-move.ts
|
|
6673
|
-
var
|
|
6653
|
+
var Qu = {
|
|
6674
6654
|
action: p.enum(["move-to-workspace", "move-to-personal"]).describe("The action to perform on the project."),
|
|
6675
6655
|
projectId: p.string().min(1).describe("The ID of the project to move."),
|
|
6676
6656
|
workspaceId: p.string().min(1).optional().describe("The target workspace ID. Required when action is move-to-workspace."),
|
|
@@ -6680,14 +6660,14 @@ var ed = {
|
|
|
6680
6660
|
"team",
|
|
6681
6661
|
"public"
|
|
6682
6662
|
]).optional().describe("Optional access visibility for the project in the workspace (restricted, team, or public).")
|
|
6683
|
-
},
|
|
6663
|
+
}, $u = {
|
|
6684
6664
|
project: mi.describe("The moved project."),
|
|
6685
6665
|
success: p.boolean().describe("Whether the move was successful.")
|
|
6686
|
-
},
|
|
6666
|
+
}, ed = {
|
|
6687
6667
|
name: B.PROJECT_MOVE,
|
|
6688
6668
|
description: "Move a project between personal and workspace contexts.",
|
|
6689
|
-
parameters:
|
|
6690
|
-
outputSchema:
|
|
6669
|
+
parameters: Qu,
|
|
6670
|
+
outputSchema: $u,
|
|
6691
6671
|
annotations: {
|
|
6692
6672
|
readOnlyHint: !1,
|
|
6693
6673
|
destructiveHint: !0,
|
|
@@ -6717,10 +6697,10 @@ var ed = {
|
|
|
6717
6697
|
}
|
|
6718
6698
|
};
|
|
6719
6699
|
// src/utils/order-keys.ts
|
|
6720
|
-
function
|
|
6700
|
+
function td(e, t) {
|
|
6721
6701
|
let n = new Map(e.map((e) => [e.id, e])), r = new Set(t.map((e) => e.id));
|
|
6722
6702
|
for (let e of r) if (!n.has(e)) throw Error(`Sibling id=${e} is not in the list being reordered`);
|
|
6723
|
-
let i = e.every((e) => e.key !== null), a = [...e].sort(i ?
|
|
6703
|
+
let i = e.every((e) => e.key !== null), a = [...e].sort(i ? od : sd).filter((e) => !r.has(e.id)), o = [...t].sort((e, t) => e.position - t.position), s;
|
|
6724
6704
|
for (let { id: e, position: t } of o) {
|
|
6725
6705
|
let r = n.get(e);
|
|
6726
6706
|
if (!r) continue;
|
|
@@ -6730,20 +6710,20 @@ function rd(e, t) {
|
|
|
6730
6710
|
index: o
|
|
6731
6711
|
};
|
|
6732
6712
|
}
|
|
6733
|
-
if (!i || !
|
|
6713
|
+
if (!i || !id(a, r)) return ad(a);
|
|
6734
6714
|
let c = /* @__PURE__ */ new Map(), l = [], u = null;
|
|
6735
|
-
for (let e of a) r.has(e.id) ? l.push(e) : (
|
|
6736
|
-
return
|
|
6715
|
+
for (let e of a) r.has(e.id) ? l.push(e) : (nd(l, u, e.key, c), l = [], u = e.key);
|
|
6716
|
+
return nd(l, u, null, c), c;
|
|
6737
6717
|
}
|
|
6738
|
-
function
|
|
6739
|
-
if (e.length === 0 ||
|
|
6718
|
+
function nd(e, t, n, r) {
|
|
6719
|
+
if (e.length === 0 || rd(e, t, n)) return;
|
|
6740
6720
|
let i = ge(t, n, e.length);
|
|
6741
6721
|
e.forEach((e, t) => {
|
|
6742
6722
|
let n = i[t];
|
|
6743
6723
|
n !== void 0 && n !== e.key && r.set(e.id, n);
|
|
6744
6724
|
});
|
|
6745
6725
|
}
|
|
6746
|
-
function
|
|
6726
|
+
function rd(e, t, n) {
|
|
6747
6727
|
let r = t;
|
|
6748
6728
|
for (let { key: t } of e) {
|
|
6749
6729
|
if (t === null || r !== null && t <= r) return !1;
|
|
@@ -6751,7 +6731,7 @@ function ad(e, t, n) {
|
|
|
6751
6731
|
}
|
|
6752
6732
|
return n === null || r !== null && r < n;
|
|
6753
6733
|
}
|
|
6754
|
-
function
|
|
6734
|
+
function id(e, t) {
|
|
6755
6735
|
let n = null;
|
|
6756
6736
|
for (let { id: r, key: i } of e) if (!t.has(r)) {
|
|
6757
6737
|
if (i === null || n !== null && i <= n) return !1;
|
|
@@ -6759,40 +6739,40 @@ function od(e, t) {
|
|
|
6759
6739
|
}
|
|
6760
6740
|
return !0;
|
|
6761
6741
|
}
|
|
6762
|
-
function
|
|
6742
|
+
function ad(e) {
|
|
6763
6743
|
let t = ge(null, null, e.length), n = /* @__PURE__ */ new Map();
|
|
6764
6744
|
return e.forEach((e, r) => {
|
|
6765
6745
|
let i = t[r];
|
|
6766
6746
|
i !== void 0 && i !== e.key && n.set(e.id, i);
|
|
6767
6747
|
}), n;
|
|
6768
6748
|
}
|
|
6769
|
-
function
|
|
6749
|
+
function od(e, t) {
|
|
6770
6750
|
let n = e.key ?? "", r = t.key ?? "";
|
|
6771
6751
|
return n < r ? -1 : +(n > r);
|
|
6772
6752
|
}
|
|
6773
|
-
function
|
|
6753
|
+
function sd(e, t) {
|
|
6774
6754
|
return e.legacyOrder - t.legacyOrder;
|
|
6775
6755
|
}
|
|
6776
6756
|
// src/tools/reorder-objects.ts
|
|
6777
|
-
var
|
|
6757
|
+
var cd = ["project", "section"], ld = p.object({
|
|
6778
6758
|
id: p.string().min(1).describe("The ID of the entity."),
|
|
6779
6759
|
order: p.number().int().min(0).optional().describe("0-based position among its siblings after the reorder: 0 is first, past the end is last. Unlisted siblings keep their relative order."),
|
|
6780
6760
|
parentId: p.string().min(1).optional().describe("Move a personal project under this parent project ID, or \"root\" for the top level. Personal projects only.")
|
|
6781
|
-
}),
|
|
6782
|
-
type: p.enum(
|
|
6783
|
-
items: p.array(
|
|
6784
|
-
},
|
|
6785
|
-
type: p.enum(
|
|
6761
|
+
}), ud = {
|
|
6762
|
+
type: p.enum(cd).describe("\"project\": personal projects among the siblings under their parent, or workspace projects within their folder. \"section\": sections within their project."),
|
|
6763
|
+
items: p.array(ld).min(1).max(O.BULK_ACTIONS_PER_OPERATION).describe("Each item needs order and/or parentId. Moves happen first, so order is a position under the new parent.")
|
|
6764
|
+
}, dd = {
|
|
6765
|
+
type: p.enum(cd).describe("The type of entity that was reordered/moved."),
|
|
6786
6766
|
movedCount: p.number().describe("The number of entities moved to a new parent."),
|
|
6787
6767
|
reorderedCount: p.number().describe("The number of entities reordered."),
|
|
6788
6768
|
affectedIds: p.array(p.string()).describe("The IDs of the entities moved or reordered."),
|
|
6789
6769
|
failures: p.array(Y).describe("Entities that could not be moved or reordered, with the reason for each."),
|
|
6790
6770
|
success: p.boolean().describe("Whether every entity was moved and reordered as asked.")
|
|
6791
|
-
},
|
|
6771
|
+
}, fd = {
|
|
6792
6772
|
name: B.REORDER_OBJECTS,
|
|
6793
6773
|
description: "Reorder projects or sections, and optionally move personal projects to a new parent. Personal projects: order places a project among its siblings; parentId moves it (\"root\" for top level). Workspace projects: order places a project within its folder, in the shared default ordering every member sees; needs permission to reorder the workspace. Sections: order places a section within its project.",
|
|
6794
|
-
parameters:
|
|
6795
|
-
outputSchema:
|
|
6774
|
+
parameters: ud,
|
|
6775
|
+
outputSchema: dd,
|
|
6796
6776
|
annotations: {
|
|
6797
6777
|
readOnlyHint: !1,
|
|
6798
6778
|
destructiveHint: !1,
|
|
@@ -6805,7 +6785,7 @@ var ud = ["project", "section"], dd = p.object({
|
|
|
6805
6785
|
if (i.add(e.id), e.order === void 0 && e.parentId === void 0) throw Error(`Item id=${e.id} must have at least one of "order" or "parentId".`);
|
|
6806
6786
|
if (e.parentId !== void 0 && n !== "project") throw Error(`parentId is only supported when type is "project", but type is "${n}".`);
|
|
6807
6787
|
}
|
|
6808
|
-
let a = n === "project" ? await
|
|
6788
|
+
let a = n === "project" ? await pd(t, r) : await md(t, r);
|
|
6809
6789
|
L(B.REORDER_OBJECTS, r.length, a.failures);
|
|
6810
6790
|
let o = n === "project" ? "projects" : "sections", s = r.map((e) => e.id).filter((e) => a.movedIds.has(e) || a.reorderedIds.has(e)), c = [];
|
|
6811
6791
|
return a.movedIds.size > 0 && c.push(`moved ${a.movedIds.size}`), (a.reorderedIds.size > 0 || c.length === 0) && c.push(`reordered ${a.reorderedIds.size}`), {
|
|
@@ -6821,10 +6801,10 @@ var ud = ["project", "section"], dd = p.object({
|
|
|
6821
6801
|
};
|
|
6822
6802
|
}
|
|
6823
6803
|
};
|
|
6824
|
-
async function
|
|
6825
|
-
let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = [], a = await
|
|
6804
|
+
async function pd(e, t) {
|
|
6805
|
+
let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = [], a = await xd(e), o = [];
|
|
6826
6806
|
for (let e of t) {
|
|
6827
|
-
let t = a.get(e.id), n = t ?
|
|
6807
|
+
let t = a.get(e.id), n = t ? _d(t, e) : "Project not found, or you do not have access to it.";
|
|
6828
6808
|
n ? i.push({
|
|
6829
6809
|
item: e.id,
|
|
6830
6810
|
error: n
|
|
@@ -6852,7 +6832,7 @@ async function hd(e, t) {
|
|
|
6852
6832
|
failures: i
|
|
6853
6833
|
};
|
|
6854
6834
|
if (n.size > 0) try {
|
|
6855
|
-
a = await
|
|
6835
|
+
a = await xd(e);
|
|
6856
6836
|
} catch (e) {
|
|
6857
6837
|
let t = P(e);
|
|
6858
6838
|
for (let r of l) i.push({
|
|
@@ -6866,7 +6846,7 @@ async function hd(e, t) {
|
|
|
6866
6846
|
failures: i
|
|
6867
6847
|
};
|
|
6868
6848
|
}
|
|
6869
|
-
let u =
|
|
6849
|
+
let u = hd([...a.values()].filter(vd), yd), d = /* @__PURE__ */ new Map(), f = [];
|
|
6870
6850
|
for (let e of l) {
|
|
6871
6851
|
let t = a.get(e.id);
|
|
6872
6852
|
if (!t) {
|
|
@@ -6877,7 +6857,7 @@ async function hd(e, t) {
|
|
|
6877
6857
|
continue;
|
|
6878
6858
|
}
|
|
6879
6859
|
f.push(e);
|
|
6880
|
-
let n =
|
|
6860
|
+
let n = yd(t), r = d.get(n) ?? [];
|
|
6881
6861
|
r.push({
|
|
6882
6862
|
id: e.id,
|
|
6883
6863
|
position: e.order
|
|
@@ -6885,7 +6865,7 @@ async function hd(e, t) {
|
|
|
6885
6865
|
}
|
|
6886
6866
|
let p = [];
|
|
6887
6867
|
for (let [e, t] of d) {
|
|
6888
|
-
let n =
|
|
6868
|
+
let n = td((u.get(e) ?? []).map(bd), t);
|
|
6889
6869
|
for (let [e, t] of n) {
|
|
6890
6870
|
let n = a.get(e);
|
|
6891
6871
|
p.push({
|
|
@@ -6900,14 +6880,14 @@ async function hd(e, t) {
|
|
|
6900
6880
|
});
|
|
6901
6881
|
}
|
|
6902
6882
|
}
|
|
6903
|
-
return await
|
|
6883
|
+
return await gd(e, p, f, r, i), {
|
|
6904
6884
|
movedIds: n,
|
|
6905
6885
|
reorderedIds: r,
|
|
6906
6886
|
failures: i
|
|
6907
6887
|
};
|
|
6908
6888
|
}
|
|
6909
|
-
async function
|
|
6910
|
-
let n = /* @__PURE__ */ new Set(), r = [], i = await
|
|
6889
|
+
async function md(e, t) {
|
|
6890
|
+
let n = /* @__PURE__ */ new Set(), r = [], i = await Sd(e), a = hd([...i.values()].filter((e) => !e.isDeleted && !e.isArchived), (e) => e.projectId), o = t.filter((e) => e.order !== void 0), s = /* @__PURE__ */ new Map(), c = [];
|
|
6911
6891
|
for (let e of o) {
|
|
6912
6892
|
let t = i.get(e.id);
|
|
6913
6893
|
if (!t || t.isDeleted) {
|
|
@@ -6933,7 +6913,7 @@ async function gd(e, t) {
|
|
|
6933
6913
|
}
|
|
6934
6914
|
let l = [];
|
|
6935
6915
|
for (let [e, t] of s) {
|
|
6936
|
-
let n =
|
|
6916
|
+
let n = td((a.get(e) ?? []).map((e) => ({
|
|
6937
6917
|
id: e.id,
|
|
6938
6918
|
key: e.orderKey ?? null,
|
|
6939
6919
|
legacyOrder: e.sectionOrder
|
|
@@ -6946,13 +6926,13 @@ async function gd(e, t) {
|
|
|
6946
6926
|
})
|
|
6947
6927
|
});
|
|
6948
6928
|
}
|
|
6949
|
-
return await
|
|
6929
|
+
return await gd(e, l, c, n, r), {
|
|
6950
6930
|
movedIds: /* @__PURE__ */ new Set(),
|
|
6951
6931
|
reorderedIds: n,
|
|
6952
6932
|
failures: r
|
|
6953
6933
|
};
|
|
6954
6934
|
}
|
|
6955
|
-
function
|
|
6935
|
+
function hd(e, t) {
|
|
6956
6936
|
let n = /* @__PURE__ */ new Map();
|
|
6957
6937
|
for (let r of e) {
|
|
6958
6938
|
let e = t(r), i = n.get(e) ?? [];
|
|
@@ -6960,7 +6940,7 @@ function _d(e, t) {
|
|
|
6960
6940
|
}
|
|
6961
6941
|
return n;
|
|
6962
6942
|
}
|
|
6963
|
-
async function
|
|
6943
|
+
async function gd(e, t, n, r, i) {
|
|
6964
6944
|
let a = /* @__PURE__ */ new Set();
|
|
6965
6945
|
if (t.length > 0) {
|
|
6966
6946
|
let { outcomes: n } = await $(e, t.map((e) => e.command));
|
|
@@ -6975,19 +6955,19 @@ async function vd(e, t, n, r, i) {
|
|
|
6975
6955
|
}
|
|
6976
6956
|
for (let { id: e } of n) a.has(e) || r.add(e);
|
|
6977
6957
|
}
|
|
6978
|
-
function
|
|
6958
|
+
function _d(e, t) {
|
|
6979
6959
|
if (e.isDeleted) return "Project not found, or you do not have access to it.";
|
|
6980
6960
|
if (e.isArchived) return "Archived projects cannot be reordered or moved.";
|
|
6981
6961
|
if (!E(e) && e.inboxProject) return "The Inbox always comes first and cannot be reordered or moved.";
|
|
6982
6962
|
if (E(e) && t.parentId !== void 0) return "parentId is only supported for personal projects. Workspace projects are ordered within their folder; omit parentId to reorder it there.";
|
|
6983
6963
|
}
|
|
6984
|
-
function
|
|
6964
|
+
function vd(e) {
|
|
6985
6965
|
return e.isDeleted || e.isArchived ? !1 : E(e) || !e.inboxProject;
|
|
6986
6966
|
}
|
|
6987
|
-
function
|
|
6967
|
+
function yd(e) {
|
|
6988
6968
|
return E(e) ? `workspace:${e.workspaceId}:${e.folderId ?? "root"}` : `personal:${e.parentId ?? "root"}`;
|
|
6989
6969
|
}
|
|
6990
|
-
function
|
|
6970
|
+
function bd(e) {
|
|
6991
6971
|
return E(e) ? {
|
|
6992
6972
|
id: e.id,
|
|
6993
6973
|
key: e.defaultOrderKey ?? null,
|
|
@@ -6998,14 +6978,14 @@ function Sd(e) {
|
|
|
6998
6978
|
legacyOrder: e.childOrder
|
|
6999
6979
|
};
|
|
7000
6980
|
}
|
|
7001
|
-
async function
|
|
6981
|
+
async function xd(e) {
|
|
7002
6982
|
let t = await R(() => e.sync({
|
|
7003
6983
|
resourceTypes: ["projects"],
|
|
7004
6984
|
syncToken: "*"
|
|
7005
6985
|
}));
|
|
7006
6986
|
return new Map((t.projects ?? []).map((e) => [e.id, e]));
|
|
7007
6987
|
}
|
|
7008
|
-
async function
|
|
6988
|
+
async function Sd(e) {
|
|
7009
6989
|
let t = await R(() => e.sync({
|
|
7010
6990
|
resourceTypes: ["sections"],
|
|
7011
6991
|
syncToken: "*"
|
|
@@ -7013,20 +6993,20 @@ async function wd(e) {
|
|
|
7013
6993
|
return new Map((t.sections ?? []).map((e) => [e.id, e]));
|
|
7014
6994
|
}
|
|
7015
6995
|
// src/tools/reschedule-tasks.ts
|
|
7016
|
-
var
|
|
6996
|
+
var Cd = p.object({
|
|
7017
6997
|
id: p.string().min(1).describe("The ID of the task to reschedule."),
|
|
7018
6998
|
date: p.string().min(1).describe("The new date for the task. Use YYYY-MM-DD for date-only, or YYYY-MM-DDTHH:MM:SS for datetime. If date-only is provided and the task already has a specific time, the existing time is preserved."),
|
|
7019
6999
|
duration: p.string().optional().describe("Optional new duration, e.g. for time-blocking: \"15m\", \"1h\", \"2h30m\".")
|
|
7020
|
-
}),
|
|
7000
|
+
}), wd = { tasks: p.array(Cd).min(1).max(O.BULK_ACTIONS_PER_OPERATION).describe("The tasks to reschedule with their new dates.") }, Td = {
|
|
7021
7001
|
tasks: p.array(J).describe("The rescheduled tasks."),
|
|
7022
7002
|
totalCount: p.number().describe("The total number of tasks rescheduled."),
|
|
7023
7003
|
rescheduledTaskIds: p.array(p.string()).describe("The IDs of the rescheduled tasks."),
|
|
7024
7004
|
failures: p.array(Y).describe("Tasks that could not be rescheduled, with reasons.")
|
|
7025
|
-
},
|
|
7005
|
+
}, Ed = {
|
|
7026
7006
|
name: B.RESCHEDULE_TASKS,
|
|
7027
7007
|
description: "Reschedule tasks to new dates while preserving recurring schedules. Unlike update-tasks (which replaces the entire due string and can wipe recurrence), this tool changes only the date (and duration, if given), keeping recurrence patterns intact. Use this when moving recurring tasks to a different date or time without altering their repeat pattern. Without a due date, the deadline moves.",
|
|
7028
|
-
parameters:
|
|
7029
|
-
outputSchema:
|
|
7008
|
+
parameters: wd,
|
|
7009
|
+
outputSchema: Td,
|
|
7030
7010
|
annotations: {
|
|
7031
7011
|
readOnlyHint: !1,
|
|
7032
7012
|
destructiveHint: !0,
|
|
@@ -7037,7 +7017,7 @@ var Td = p.object({
|
|
|
7037
7017
|
i.push(...a.failures);
|
|
7038
7018
|
let o = [];
|
|
7039
7019
|
for (let { item: e, index: t, value: n } of a.succeeded) {
|
|
7040
|
-
let i =
|
|
7020
|
+
let i = Dd(e.date, n);
|
|
7041
7021
|
i && o.push({
|
|
7042
7022
|
id: e.id,
|
|
7043
7023
|
command: T("item_update", {
|
|
@@ -7074,9 +7054,9 @@ var Td = p.object({
|
|
|
7074
7054
|
};
|
|
7075
7055
|
}
|
|
7076
7056
|
};
|
|
7077
|
-
function
|
|
7057
|
+
function Dd(e, t) {
|
|
7078
7058
|
if (t.due) return { due: {
|
|
7079
|
-
date:
|
|
7059
|
+
date: Od(e, t.due),
|
|
7080
7060
|
...t.due.isRecurring && { string: t.due.string },
|
|
7081
7061
|
isRecurring: t.due.isRecurring,
|
|
7082
7062
|
timezone: t.due.timezone ?? void 0,
|
|
@@ -7084,28 +7064,28 @@ function kd(e, t) {
|
|
|
7084
7064
|
} };
|
|
7085
7065
|
if (t.deadline) return { deadline: { date: e.slice(0, 10) } };
|
|
7086
7066
|
}
|
|
7087
|
-
function
|
|
7067
|
+
function Od(e, t) {
|
|
7088
7068
|
let n = /^\d{4}-\d{2}-\d{2}$/.test(e), r = t.date.substring(10);
|
|
7089
7069
|
if (n && r) {
|
|
7090
7070
|
if (r.endsWith("Z") && t.timezone) {
|
|
7091
|
-
let n =
|
|
7071
|
+
let n = kd(e, t.date, t.timezone);
|
|
7092
7072
|
if (n) return n;
|
|
7093
7073
|
}
|
|
7094
7074
|
return e + r;
|
|
7095
7075
|
}
|
|
7096
7076
|
return e;
|
|
7097
7077
|
}
|
|
7098
|
-
function
|
|
7099
|
-
let r = Date.parse(t), i =
|
|
7078
|
+
function kd(e, t, n) {
|
|
7079
|
+
let r = Date.parse(t), i = jd(n, r);
|
|
7100
7080
|
if (i === void 0) return;
|
|
7101
7081
|
let a = new Date(r + i * 6e4).toISOString().slice(11, 19), o = Date.parse(`${e}T${a}Z`);
|
|
7102
7082
|
if (Number.isNaN(o) || new Date(o).toISOString().slice(0, 10) !== e) return;
|
|
7103
|
-
let s =
|
|
7083
|
+
let s = jd(n, o - i * 6e4) ?? i;
|
|
7104
7084
|
return `${(/* @__PURE__ */ new Date(o - s * 6e4)).toISOString().slice(0, 19)}Z`;
|
|
7105
7085
|
}
|
|
7106
|
-
var
|
|
7107
|
-
function
|
|
7108
|
-
let n =
|
|
7086
|
+
var Ad = /^GMT ([+-])(\d{1,2}):(\d{2})$/;
|
|
7087
|
+
function jd(e, t) {
|
|
7088
|
+
let n = Ad.exec(e);
|
|
7109
7089
|
if (n) {
|
|
7110
7090
|
let [, e, t, r] = n;
|
|
7111
7091
|
return An(`${e}${t?.padStart(2, "0")}:${r}`);
|
|
@@ -7113,18 +7093,18 @@ function Nd(e, t) {
|
|
|
7113
7093
|
return In(t, e);
|
|
7114
7094
|
}
|
|
7115
7095
|
// src/tools/search.ts
|
|
7116
|
-
var
|
|
7096
|
+
var Md = { query: p.string().min(1).describe("The search query string to find tasks and projects.") }, Nd = {
|
|
7117
7097
|
results: p.array(p.object({
|
|
7118
7098
|
id: p.string().describe("The ID of the result."),
|
|
7119
7099
|
title: p.string().describe("The title of the result."),
|
|
7120
7100
|
url: p.string().describe("The URL of the result.")
|
|
7121
7101
|
})).describe("The search results."),
|
|
7122
7102
|
totalCount: p.number().describe("Total number of results found.")
|
|
7123
|
-
},
|
|
7103
|
+
}, Pd = {
|
|
7124
7104
|
name: B.SEARCH,
|
|
7125
7105
|
description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
|
|
7126
|
-
parameters:
|
|
7127
|
-
outputSchema:
|
|
7106
|
+
parameters: Md,
|
|
7107
|
+
outputSchema: Nd,
|
|
7128
7108
|
annotations: {
|
|
7129
7109
|
readOnlyHint: !0,
|
|
7130
7110
|
destructiveHint: !1,
|
|
@@ -7155,20 +7135,20 @@ var Pd = { query: p.string().min(1).describe("The search query string to find ta
|
|
|
7155
7135
|
}
|
|
7156
7136
|
};
|
|
7157
7137
|
}
|
|
7158
|
-
},
|
|
7138
|
+
}, Fd = {
|
|
7159
7139
|
message: p.string().trim().min(1).max(80).optional().describe("Omit for an emoji-only status."),
|
|
7160
7140
|
emoji: p.string().trim().min(1).optional().describe("A Unicode emoji, such as 🏝️."),
|
|
7161
7141
|
activeUntil: p.string().trim().optional().describe("When it ends: a future ISO 8601 timestamp with Z or an offset, e.g. 2026-11-10T00:00:00+00:00. Omit for no end."),
|
|
7162
7142
|
pauseNotifications: p.boolean().optional().describe("Hold back Comms notifications while active. They are not sent later."),
|
|
7163
7143
|
pauseActivity: p.boolean().optional().describe("Pause Karma and streaks while active."),
|
|
7164
7144
|
clear: p.boolean().optional().describe("Remove the status. Use alone.")
|
|
7165
|
-
},
|
|
7166
|
-
function
|
|
7145
|
+
}, Id = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|([+-])(\d{2}):(\d{2}))$/i, Ld = -720, Rd = 840;
|
|
7146
|
+
function zd(e) {
|
|
7167
7147
|
return /* @__PURE__ */ Error(`activeUntil must be an ISO 8601 timestamp with Z or an offset, such as "2026-11-10T00:00:00+00:00". Got "${e}".`);
|
|
7168
7148
|
}
|
|
7169
|
-
function
|
|
7170
|
-
let n =
|
|
7171
|
-
if (!n) throw
|
|
7149
|
+
function Bd(e, t) {
|
|
7150
|
+
let n = Id.exec(e);
|
|
7151
|
+
if (!n) throw zd(e);
|
|
7172
7152
|
let [, r, i, a, o, s, c = "0", l = ""] = n, [u, d, f, p, m, h] = [
|
|
7173
7153
|
r,
|
|
7174
7154
|
i,
|
|
@@ -7179,14 +7159,14 @@ function Hd(e, t) {
|
|
|
7179
7159
|
].map(Number), g = /* @__PURE__ */ new Date(0);
|
|
7180
7160
|
g.setUTCFullYear(u, d - 1, f), g.setUTCHours(p, m, h);
|
|
7181
7161
|
let _ = g.getUTCFullYear() === u && g.getUTCMonth() === d - 1 && g.getUTCDate() === f && g.getUTCHours() === p && g.getUTCMinutes() === m && g.getUTCSeconds() === h, v = l.toUpperCase() === "Z" ? 0 : An(l);
|
|
7182
|
-
if (!_ || v <
|
|
7162
|
+
if (!_ || v < Ld || v > Rd) throw zd(e);
|
|
7183
7163
|
let y = new Date(e);
|
|
7184
|
-
if (Number.isNaN(y.getTime())) throw
|
|
7164
|
+
if (Number.isNaN(y.getTime())) throw zd(e);
|
|
7185
7165
|
if (y.getTime() <= t.getTime()) throw Error(`activeUntil must be in the future. Got "${e}".`);
|
|
7186
7166
|
return y.toISOString();
|
|
7187
7167
|
}
|
|
7188
|
-
var
|
|
7189
|
-
function
|
|
7168
|
+
var Vd = { scope: { mode: "all" } };
|
|
7169
|
+
function Hd(e, t) {
|
|
7190
7170
|
let { clear: n, message: r, emoji: i, activeUntil: a, pauseNotifications: o, pauseActivity: s } = e;
|
|
7191
7171
|
if (n) {
|
|
7192
7172
|
if (r !== void 0 || i !== void 0 || a !== void 0 || o === !0 || s === !0) throw Error("clear removes the status, so it cannot be combined with other fields.");
|
|
@@ -7196,25 +7176,25 @@ function Wd(e, t) {
|
|
|
7196
7176
|
return {
|
|
7197
7177
|
message: r ?? null,
|
|
7198
7178
|
emoji: i ?? null,
|
|
7199
|
-
activeUntil: a === void 0 ? null :
|
|
7179
|
+
activeUntil: a === void 0 ? null : Bd(a, t),
|
|
7200
7180
|
effects: o || s ? {
|
|
7201
|
-
pauseNotifications: o ?
|
|
7202
|
-
pauseActivity: s ?
|
|
7181
|
+
pauseNotifications: o ? Vd : null,
|
|
7182
|
+
pauseActivity: s ? Vd : null
|
|
7203
7183
|
} : null
|
|
7204
7184
|
};
|
|
7205
7185
|
}
|
|
7206
|
-
function
|
|
7186
|
+
function Ud(e) {
|
|
7207
7187
|
return e ? e.replace(/\uFE0F/g, "") : null;
|
|
7208
7188
|
}
|
|
7209
|
-
function
|
|
7189
|
+
function Wd(e, t) {
|
|
7210
7190
|
let n = e.activeUntil ? new Date(e.activeUntil).getTime() : null, r = t.activeUntil ? new Date(t.activeUntil).getTime() : null;
|
|
7211
|
-
return (e.message ?? null) === (t.message ?? null) &&
|
|
7191
|
+
return (e.message ?? null) === (t.message ?? null) && Ud(e.emoji) === Ud(t.emoji) && n === r && !!e.effects?.pauseNotifications == !!t.effects?.pauseNotifications && !!e.effects?.pauseActivity == !!t.effects?.pauseActivity;
|
|
7212
7192
|
}
|
|
7213
|
-
var
|
|
7193
|
+
var Gd = {
|
|
7214
7194
|
name: B.SET_USER_STATUS,
|
|
7215
7195
|
description: "Set or clear the user's status, shown next to their name in Todoist and Comms. It needs a message, an emoji or both. Replaces the whole status: any field omitted is removed, not kept. Use clear to remove the status.",
|
|
7216
|
-
parameters:
|
|
7217
|
-
outputSchema:
|
|
7196
|
+
parameters: Fd,
|
|
7197
|
+
outputSchema: _u,
|
|
7218
7198
|
annotations: {
|
|
7219
7199
|
readOnlyHint: !1,
|
|
7220
7200
|
destructiveHint: !0,
|
|
@@ -7222,39 +7202,39 @@ var qd = {
|
|
|
7222
7202
|
openWorldHint: !0
|
|
7223
7203
|
},
|
|
7224
7204
|
async execute(e, t) {
|
|
7225
|
-
let n =
|
|
7205
|
+
let n = Hd(e, /* @__PURE__ */ new Date()), { outcomes: [r] } = await $(t, [T("user_update", { status: n })]);
|
|
7226
7206
|
if (r?.status !== "fulfilled") throw r?.reason ?? /* @__PURE__ */ Error("Todoist did not report whether the status was applied.");
|
|
7227
|
-
let i = await
|
|
7207
|
+
let i = await yu(t).catch(() => {
|
|
7228
7208
|
throw Error(`The status was written, but reading it back failed, so it is unconfirmed. Use ${B.GET_USER_STATUS} to check it.`);
|
|
7229
7209
|
});
|
|
7230
7210
|
if (n === null) {
|
|
7231
7211
|
if (i) throw Error(`Todoist accepted the clear but still reports a status. Another app may have set it at the same moment; use ${B.GET_USER_STATUS} to see it.`);
|
|
7232
|
-
return
|
|
7212
|
+
return xu(null, "Status cleared");
|
|
7233
7213
|
}
|
|
7234
7214
|
if (!i) throw Error("Todoist accepted the status but reports no active status, so it may have expired already.");
|
|
7235
|
-
if (!
|
|
7236
|
-
return
|
|
7215
|
+
if (!Wd(i, n)) throw Error(`Todoist accepted the status but reports a different one. Another app may have changed it at the same moment; use ${B.GET_USER_STATUS} to see it.`);
|
|
7216
|
+
return xu(i, "Status set");
|
|
7237
7217
|
}
|
|
7238
|
-
},
|
|
7218
|
+
}, Kd = { ids: p.array(p.string().min(1)).min(1).max(O.BULK_ACTIONS_PER_OPERATION).describe("The IDs of the tasks to uncomplete.") }, qd = {
|
|
7239
7219
|
uncompleted: p.array(p.string()).describe("The IDs of successfully uncompleted tasks."),
|
|
7240
7220
|
failures: p.array(Y).describe("Failed task uncompletion with error details."),
|
|
7241
7221
|
totalRequested: p.number().describe("The total number of tasks requested to uncomplete."),
|
|
7242
7222
|
successCount: p.number().describe("The number of successfully uncompleted tasks."),
|
|
7243
7223
|
failureCount: p.number().describe("The number of failed task uncompletions.")
|
|
7244
|
-
},
|
|
7224
|
+
}, Jd = {
|
|
7245
7225
|
name: B.UNCOMPLETE_TASKS,
|
|
7246
7226
|
description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
|
|
7247
|
-
parameters:
|
|
7248
|
-
outputSchema:
|
|
7227
|
+
parameters: Kd,
|
|
7228
|
+
outputSchema: qd,
|
|
7249
7229
|
annotations: {
|
|
7250
7230
|
readOnlyHint: !1,
|
|
7251
7231
|
destructiveHint: !1,
|
|
7252
7232
|
idempotentHint: !1
|
|
7253
7233
|
},
|
|
7254
7234
|
async execute(e, t) {
|
|
7255
|
-
let n = await
|
|
7235
|
+
let n = await Yd(t, e.ids), { succeeded: r, failures: i } = I(e.ids, n, (e) => e), a = r.map(({ item: e }) => e);
|
|
7256
7236
|
return L(B.UNCOMPLETE_TASKS, e.ids.length, i), {
|
|
7257
|
-
textContent:
|
|
7237
|
+
textContent: Xd({
|
|
7258
7238
|
uncompleted: a,
|
|
7259
7239
|
failures: i,
|
|
7260
7240
|
args: e
|
|
@@ -7269,14 +7249,14 @@ var qd = {
|
|
|
7269
7249
|
};
|
|
7270
7250
|
}
|
|
7271
7251
|
};
|
|
7272
|
-
async function
|
|
7252
|
+
async function Yd(e, t) {
|
|
7273
7253
|
let n = [...new Set(t)], { outcomes: r } = await $(e, n.map((e) => T("item_uncomplete", { id: e })), { limit: Lt(e) }), i = new Map(n.map((e, t) => [e, r[t]]));
|
|
7274
7254
|
return t.map((e) => i.get(e) ?? {
|
|
7275
7255
|
status: "rejected",
|
|
7276
7256
|
reason: /* @__PURE__ */ Error("Todoist did not report whether this task was reopened")
|
|
7277
7257
|
});
|
|
7278
7258
|
}
|
|
7279
|
-
function
|
|
7259
|
+
function Xd({ uncompleted: e, failures: t, args: n }) {
|
|
7280
7260
|
return Pi({
|
|
7281
7261
|
action: "Uncompleted tasks",
|
|
7282
7262
|
success: e.length,
|
|
@@ -7287,10 +7267,10 @@ function Qd({ uncompleted: e, failures: t, args: n }) {
|
|
|
7287
7267
|
});
|
|
7288
7268
|
}
|
|
7289
7269
|
// src/tools/update-comments.ts
|
|
7290
|
-
var
|
|
7270
|
+
var Zd = p.object({
|
|
7291
7271
|
id: p.string().min(1).describe("The ID of the comment to update."),
|
|
7292
7272
|
content: p.string().min(1).describe("The new content for the comment.")
|
|
7293
|
-
}),
|
|
7273
|
+
}), Qd = { comments: p.array(Zd).min(1).max(O.ITEMS_PER_OPERATION).describe("The comments to update.") }, $d = {
|
|
7294
7274
|
comments: p.array(bi).describe("The updated comments."),
|
|
7295
7275
|
totalCount: p.number().describe("The total number of comments updated."),
|
|
7296
7276
|
updatedCommentIds: p.array(p.string()).describe("The IDs of the updated comments."),
|
|
@@ -7299,11 +7279,11 @@ var $d = p.object({
|
|
|
7299
7279
|
updateCount: p.number().describe("The number of comments updated."),
|
|
7300
7280
|
failureCount: p.number()
|
|
7301
7281
|
}).describe("Summary of operations performed.")
|
|
7302
|
-
},
|
|
7282
|
+
}, ef = {
|
|
7303
7283
|
name: B.UPDATE_COMMENTS,
|
|
7304
7284
|
description: "Update multiple existing comments with new content.",
|
|
7305
|
-
parameters:
|
|
7306
|
-
outputSchema:
|
|
7285
|
+
parameters: Qd,
|
|
7286
|
+
outputSchema: $d,
|
|
7307
7287
|
annotations: {
|
|
7308
7288
|
readOnlyHint: !1,
|
|
7309
7289
|
destructiveHint: !0,
|
|
@@ -7312,7 +7292,7 @@ var $d = p.object({
|
|
|
7312
7292
|
async execute(e, t) {
|
|
7313
7293
|
let { comments: n } = e, { succeeded: r, failures: i } = I(n, await Promise.allSettled(n.map((e) => R(() => t.updateComment(e.id, { content: e.content })))), (e) => e.id), a = r.map(({ value: e }) => Yr(e));
|
|
7314
7294
|
return L(B.UPDATE_COMMENTS, n.length, i), {
|
|
7315
|
-
textContent: X(
|
|
7295
|
+
textContent: X(tf({ comments: a }), i),
|
|
7316
7296
|
structuredContent: {
|
|
7317
7297
|
comments: a,
|
|
7318
7298
|
totalCount: a.length,
|
|
@@ -7326,7 +7306,7 @@ var $d = p.object({
|
|
|
7326
7306
|
};
|
|
7327
7307
|
}
|
|
7328
7308
|
};
|
|
7329
|
-
function
|
|
7309
|
+
function tf({ comments: e }) {
|
|
7330
7310
|
let t = e.filter((e) => e.taskId).length, n = e.filter((e) => e.projectId).length, r = [];
|
|
7331
7311
|
if (t > 0) {
|
|
7332
7312
|
let e = t > 1 ? "comments" : "comment";
|
|
@@ -7339,14 +7319,14 @@ function rf({ comments: e }) {
|
|
|
7339
7319
|
return r.length > 0 ? `Updated ${r.join(" and ")}` : "No comments updated";
|
|
7340
7320
|
}
|
|
7341
7321
|
// src/tools/update-filters.ts
|
|
7342
|
-
var
|
|
7322
|
+
var nf = p.object({
|
|
7343
7323
|
id: p.string().min(1).describe("The ID of the filter to update."),
|
|
7344
7324
|
name: p.string().min(1).optional().describe("The new name of the filter."),
|
|
7345
7325
|
query: p.string().min(1).optional().describe("The new filter query string. Examples: \"today & p1\", \"#Work & overdue\", \"@email & today\"."),
|
|
7346
7326
|
description: p.preprocess((e) => e === null ? "remove" : e, p.string().describe("A markdown description explaining what the filter is for. Use \"remove\" to clear the description; omit the field to leave it unchanged.")).optional(),
|
|
7347
7327
|
color: fi,
|
|
7348
7328
|
isFavorite: p.boolean().optional().describe("Whether to mark the filter as a favorite.")
|
|
7349
|
-
}),
|
|
7329
|
+
}), rf = { filters: p.array(nf).min(1).max(O.ITEMS_PER_OPERATION).describe("The filters to update.") }, af = {
|
|
7350
7330
|
filters: p.array(Xi).describe("The updated filters, as read back after the update. Empty if they could not be read back; updatedFilterIds still lists what was updated."),
|
|
7351
7331
|
totalCount: p.number().describe("The total number of filters updated."),
|
|
7352
7332
|
updatedFilterIds: p.array(p.string()).describe("The IDs of the updated filters."),
|
|
@@ -7356,11 +7336,11 @@ var af = p.object({
|
|
|
7356
7336
|
skippedCount: p.number().describe("The number of filters skipped (no changes)."),
|
|
7357
7337
|
failureCount: p.number()
|
|
7358
7338
|
}).describe("Summary of operations performed.")
|
|
7359
|
-
},
|
|
7339
|
+
}, of = {
|
|
7360
7340
|
name: B.UPDATE_FILTERS,
|
|
7361
7341
|
description: "Update one or more existing personal filters with new values.",
|
|
7362
|
-
parameters:
|
|
7363
|
-
outputSchema:
|
|
7342
|
+
parameters: rf,
|
|
7343
|
+
outputSchema: af,
|
|
7364
7344
|
annotations: {
|
|
7365
7345
|
readOnlyHint: !1,
|
|
7366
7346
|
destructiveHint: !0,
|
|
@@ -7368,7 +7348,7 @@ var af = p.object({
|
|
|
7368
7348
|
},
|
|
7369
7349
|
async execute(e, t) {
|
|
7370
7350
|
let { filters: n } = e, r = [], i = n.map((e) => {
|
|
7371
|
-
let t =
|
|
7351
|
+
let t = lf(e);
|
|
7372
7352
|
return t === null ? (r.push(e), {
|
|
7373
7353
|
kind: "updated",
|
|
7374
7354
|
filter: e
|
|
@@ -7415,10 +7395,10 @@ var af = p.object({
|
|
|
7415
7395
|
error: u
|
|
7416
7396
|
});
|
|
7417
7397
|
}
|
|
7418
|
-
e && (l =
|
|
7398
|
+
e && (l = sf(e, new Set(c)));
|
|
7419
7399
|
}
|
|
7420
7400
|
return {
|
|
7421
|
-
textContent: X(
|
|
7401
|
+
textContent: X(cf({
|
|
7422
7402
|
filters: l,
|
|
7423
7403
|
updatedIds: c,
|
|
7424
7404
|
skippedCount: i,
|
|
@@ -7438,7 +7418,7 @@ var af = p.object({
|
|
|
7438
7418
|
};
|
|
7439
7419
|
}
|
|
7440
7420
|
};
|
|
7441
|
-
function
|
|
7421
|
+
function sf(e, t) {
|
|
7442
7422
|
return e.filter((e) => !e.isDeleted && t.has(e.id)).map((e) => ({
|
|
7443
7423
|
id: e.id,
|
|
7444
7424
|
name: e.name,
|
|
@@ -7449,7 +7429,7 @@ function lf(e, t) {
|
|
|
7449
7429
|
itemOrder: e.itemOrder
|
|
7450
7430
|
}));
|
|
7451
7431
|
}
|
|
7452
|
-
function
|
|
7432
|
+
function cf({ filters: e, updatedIds: t, skippedCount: n, readBackError: r }) {
|
|
7453
7433
|
let i = t.length, a = `Updated ${i} filter${i === 1 ? "" : "s"}`;
|
|
7454
7434
|
if (n > 0 && (a += ` (${n} skipped - no changes)`), r) a += `: ${t.join(", ")}\nThe updated filters could not be read back: ${r}`;
|
|
7455
7435
|
else if (e.length > 0) {
|
|
@@ -7458,23 +7438,23 @@ function uf({ filters: e, updatedIds: t, skippedCount: n, readBackError: r }) {
|
|
|
7458
7438
|
}
|
|
7459
7439
|
return a;
|
|
7460
7440
|
}
|
|
7461
|
-
function
|
|
7441
|
+
function lf({ id: e, ...t }) {
|
|
7462
7442
|
return Object.values(t).every((e) => e === void 0) ? "no-fields" : null;
|
|
7463
7443
|
}
|
|
7464
7444
|
// src/tools/update-folders.ts
|
|
7465
|
-
var
|
|
7445
|
+
var uf = p.object({
|
|
7466
7446
|
id: p.string().min(1).describe("The ID of the folder to rename."),
|
|
7467
7447
|
name: p.string().min(1).describe("The new name of the folder.")
|
|
7468
|
-
}),
|
|
7448
|
+
}), df = { folders: p.array(uf).min(1).max(O.ITEMS_PER_OPERATION).describe("The folders to rename.") }, ff = {
|
|
7469
7449
|
folders: p.array(_i).describe("The renamed folders."),
|
|
7470
7450
|
failures: p.array(Y).describe("Folders that could not be renamed, with the reason for each."),
|
|
7471
7451
|
successCount: p.number(),
|
|
7472
7452
|
failureCount: p.number()
|
|
7473
|
-
},
|
|
7453
|
+
}, pf = {
|
|
7474
7454
|
name: B.UPDATE_FOLDERS,
|
|
7475
7455
|
description: "Rename one or more workspace folders.",
|
|
7476
|
-
parameters:
|
|
7477
|
-
outputSchema:
|
|
7456
|
+
parameters: df,
|
|
7457
|
+
outputSchema: ff,
|
|
7478
7458
|
annotations: {
|
|
7479
7459
|
readOnlyHint: !1,
|
|
7480
7460
|
destructiveHint: !0,
|
|
@@ -7483,7 +7463,7 @@ var ff = p.object({
|
|
|
7483
7463
|
async execute({ folders: e }, t) {
|
|
7484
7464
|
let { succeeded: n, failures: r } = I(e, await Promise.allSettled(e.map(({ id: e, name: n }) => R(() => t.updateFolder(e, { name: n })))), (e) => e.id), i = n.map(({ value: e }) => e);
|
|
7485
7465
|
return L(B.UPDATE_FOLDERS, e.length, r), {
|
|
7486
|
-
textContent:
|
|
7466
|
+
textContent: mf(i, r),
|
|
7487
7467
|
structuredContent: {
|
|
7488
7468
|
folders: i.map(vi),
|
|
7489
7469
|
failures: r,
|
|
@@ -7493,28 +7473,28 @@ var ff = p.object({
|
|
|
7493
7473
|
};
|
|
7494
7474
|
}
|
|
7495
7475
|
};
|
|
7496
|
-
function
|
|
7476
|
+
function mf(e, t) {
|
|
7497
7477
|
let n = e.length, r = e.map((e) => `• ${e.name} (id=${e.id})`);
|
|
7498
7478
|
return X(n > 0 ? `Renamed ${n} folder${n === 1 ? "" : "s"}:\n${r.join("\n")}` : "Renamed 0 folders", t);
|
|
7499
7479
|
}
|
|
7500
7480
|
// src/tools/update-labels.ts
|
|
7501
|
-
var
|
|
7481
|
+
var hf = p.object({
|
|
7502
7482
|
labelType: p.literal("personal").describe("Update a personal label, identified by its ID."),
|
|
7503
7483
|
id: p.string().min(1).describe("The ID of the personal label to update."),
|
|
7504
7484
|
name: p.string().min(1).max(128).optional().describe("The new name of the label."),
|
|
7505
7485
|
color: fi,
|
|
7506
7486
|
order: p.number().int().optional().describe("The new position of the label in the label list."),
|
|
7507
7487
|
isFavorite: p.boolean().optional().describe("Whether to mark the label as a favorite.")
|
|
7508
|
-
}),
|
|
7488
|
+
}), gf = p.object({
|
|
7509
7489
|
labelType: p.literal("shared").describe("Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."),
|
|
7510
7490
|
name: p.string().min(1).describe("The current name of the shared label."),
|
|
7511
7491
|
newName: p.string().min(1).describe("The new name for the shared label.")
|
|
7512
|
-
}),
|
|
7492
|
+
}), _f = p.discriminatedUnion("labelType", [hf, gf]), vf = { labels: p.array(_f).min(1).max(O.ITEMS_PER_OPERATION).describe("The labels to update. Use labelType=\"personal\" with an ID to update a personal label, or labelType=\"shared\" with name+newName to rename a shared label.") }, yf = p.object({
|
|
7513
7493
|
name: p.string().describe("The previous name of the shared label."),
|
|
7514
7494
|
newName: p.string().describe("The new name of the shared label.")
|
|
7515
|
-
}),
|
|
7495
|
+
}), bf = {
|
|
7516
7496
|
updatedLabels: p.array(Ci).describe("The updated personal labels."),
|
|
7517
|
-
renamedSharedLabels: p.array(
|
|
7497
|
+
renamedSharedLabels: p.array(yf).describe("The shared labels that were renamed."),
|
|
7518
7498
|
totalCount: p.number().describe("The total number of successful operations (personal + shared)."),
|
|
7519
7499
|
failures: p.array(Y).describe("Labels that could not be updated, identified by ID (personal) or name (shared), with the reason for each."),
|
|
7520
7500
|
appliedOperations: p.object({
|
|
@@ -7523,11 +7503,11 @@ var _f = p.object({
|
|
|
7523
7503
|
skippedCount: p.number().describe("Number of operations skipped (no changes or shared label not found)."),
|
|
7524
7504
|
failureCount: p.number()
|
|
7525
7505
|
}).describe("Summary of operations performed.")
|
|
7526
|
-
},
|
|
7506
|
+
}, xf = {
|
|
7527
7507
|
name: B.UPDATE_LABELS,
|
|
7528
7508
|
description: "Update one or more existing labels. Personal labels (identified by ID) can have their name, color, order, and favorite flag updated. Shared labels (identified by name) can only be renamed.",
|
|
7529
|
-
parameters:
|
|
7530
|
-
outputSchema:
|
|
7509
|
+
parameters: vf,
|
|
7510
|
+
outputSchema: bf,
|
|
7531
7511
|
annotations: {
|
|
7532
7512
|
readOnlyHint: !1,
|
|
7533
7513
|
destructiveHint: !0,
|
|
@@ -7536,7 +7516,7 @@ var _f = p.object({
|
|
|
7536
7516
|
async execute(e, t) {
|
|
7537
7517
|
let { labels: n } = e, { succeeded: r, failures: i } = I(n, await Promise.allSettled(n.map(async (e) => {
|
|
7538
7518
|
if (e.labelType === "personal") {
|
|
7539
|
-
let n =
|
|
7519
|
+
let n = Cf(e);
|
|
7540
7520
|
if (n !== null) return {
|
|
7541
7521
|
kind: "skipped",
|
|
7542
7522
|
reason: n
|
|
@@ -7565,7 +7545,7 @@ var _f = p.object({
|
|
|
7565
7545
|
newName: t
|
|
7566
7546
|
})), c = a.filter((e) => e.kind === "skipped").length, l = a.filter((e) => e.kind === "skipped" && e.reason === "no-fields").length, u = a.filter((e) => e.kind === "skipped" && e.reason === "not-found").length;
|
|
7567
7547
|
return {
|
|
7568
|
-
textContent: X(
|
|
7548
|
+
textContent: X(Sf({
|
|
7569
7549
|
updatedLabels: o,
|
|
7570
7550
|
renamedSharedLabels: s,
|
|
7571
7551
|
skippedNoFields: l,
|
|
@@ -7586,7 +7566,7 @@ var _f = p.object({
|
|
|
7586
7566
|
};
|
|
7587
7567
|
}
|
|
7588
7568
|
};
|
|
7589
|
-
function
|
|
7569
|
+
function Sf({ updatedLabels: e, renamedSharedLabels: t, skippedNoFields: n, skippedNotFound: r }) {
|
|
7590
7570
|
let i = e.length, a = t.length, o = i + a, s = [];
|
|
7591
7571
|
s.push(`Updated ${o} label${o === 1 ? "" : "s"} (${i} personal, ${a} shared)`);
|
|
7592
7572
|
let c = [];
|
|
@@ -7600,11 +7580,11 @@ function wf({ updatedLabels: e, renamedSharedLabels: t, skippedNoFields: n, skip
|
|
|
7600
7580
|
}
|
|
7601
7581
|
return s.join("\n");
|
|
7602
7582
|
}
|
|
7603
|
-
function
|
|
7583
|
+
function Cf({ id: e, labelType: t, ...n }) {
|
|
7604
7584
|
return Object.values(n).every((e) => e === void 0) ? "no-fields" : null;
|
|
7605
7585
|
}
|
|
7606
7586
|
// src/tools/update-projects.ts
|
|
7607
|
-
var { FIND_FOLDERS:
|
|
7587
|
+
var { FIND_FOLDERS: wf } = B, Tf = p.object({
|
|
7608
7588
|
id: p.string().min(1).describe("The ID of the project to update."),
|
|
7609
7589
|
name: p.string().min(1).optional().describe("The new name of the project."),
|
|
7610
7590
|
isFavorite: p.boolean().optional().describe("Whether the project is a favorite."),
|
|
@@ -7612,8 +7592,8 @@ var { FIND_FOLDERS: Ef } = B, Df = p.object({
|
|
|
7612
7592
|
description: p.preprocess((e) => e === null ? "" : e, p.string().describe("The description of the project (Markdown). Pass null (or an empty string) to clear it.")).optional(),
|
|
7613
7593
|
color: fi,
|
|
7614
7594
|
icon: p.enum([...b, "remove"]).optional().describe("The project icon, or \"remove\" to restore the default # icon."),
|
|
7615
|
-
folderId: p.string().min(1).optional().describe(`Move a workspace project into this folder (see ${
|
|
7616
|
-
}),
|
|
7595
|
+
folderId: p.string().min(1).optional().describe(`Move a workspace project into this folder (see ${wf}), or "remove" for the workspace's top level.`)
|
|
7596
|
+
}), Ef = { projects: p.array(Tf).min(1).max(O.ITEMS_PER_OPERATION).describe("The projects to update.") }, Df = {
|
|
7617
7597
|
projects: p.array(mi).describe("The updated projects."),
|
|
7618
7598
|
totalCount: p.number().describe("The total number of projects updated."),
|
|
7619
7599
|
updatedProjectIds: p.array(p.string()).describe("The IDs of the updated projects."),
|
|
@@ -7623,11 +7603,11 @@ var { FIND_FOLDERS: Ef } = B, Df = p.object({
|
|
|
7623
7603
|
skippedCount: p.number().describe("The number of projects skipped (no changes)."),
|
|
7624
7604
|
failureCount: p.number()
|
|
7625
7605
|
}).describe("Summary of operations performed.")
|
|
7626
|
-
},
|
|
7606
|
+
}, Of = {
|
|
7627
7607
|
name: B.UPDATE_PROJECTS,
|
|
7628
7608
|
description: "Update multiple existing projects with new values.",
|
|
7629
|
-
parameters:
|
|
7630
|
-
outputSchema:
|
|
7609
|
+
parameters: Ef,
|
|
7610
|
+
outputSchema: Df,
|
|
7631
7611
|
annotations: {
|
|
7632
7612
|
readOnlyHint: !1,
|
|
7633
7613
|
destructiveHint: !0,
|
|
@@ -7635,7 +7615,7 @@ var { FIND_FOLDERS: Ef } = B, Df = p.object({
|
|
|
7635
7615
|
},
|
|
7636
7616
|
async execute(e, t) {
|
|
7637
7617
|
let { projects: n } = e, { succeeded: r, failures: i } = I(n, await Promise.allSettled(n.map(async (e) => {
|
|
7638
|
-
let n =
|
|
7618
|
+
let n = Af(e);
|
|
7639
7619
|
if (n !== null) return {
|
|
7640
7620
|
kind: "skipped",
|
|
7641
7621
|
reason: n
|
|
@@ -7652,7 +7632,7 @@ var { FIND_FOLDERS: Ef } = B, Df = p.object({
|
|
|
7652
7632
|
})), (e) => e.id), a = [], o = 0, s = 0;
|
|
7653
7633
|
for (let { value: e } of r) e.kind === "updated" ? a.push(Jr(e.project)) : e.reason === "no-fields" ? o++ : s++;
|
|
7654
7634
|
return L(B.UPDATE_PROJECTS, n.length, i), {
|
|
7655
|
-
textContent:
|
|
7635
|
+
textContent: kf({
|
|
7656
7636
|
projects: a,
|
|
7657
7637
|
skippedNoFields: o,
|
|
7658
7638
|
skippedNoValidValues: s,
|
|
@@ -7672,30 +7652,30 @@ var { FIND_FOLDERS: Ef } = B, Df = p.object({
|
|
|
7672
7652
|
};
|
|
7673
7653
|
}
|
|
7674
7654
|
};
|
|
7675
|
-
function
|
|
7655
|
+
function kf({ projects: e, skippedNoFields: t, skippedNoValidValues: n, failures: r }) {
|
|
7676
7656
|
let i = e.length, a = e.map((e) => `• ${e.name} (id=${e.id})`).join("\n"), o = `Updated ${i} project${i === 1 ? "" : "s"}`, s = [];
|
|
7677
7657
|
return t > 0 && s.push(`${t} skipped - no changes`), n > 0 && s.push(`${n} skipped - no valid field values`), s.length > 0 && (o += ` (${s.join(", ")})`), i > 0 && (o += `:\n${a}`), X(o, r);
|
|
7678
7658
|
}
|
|
7679
|
-
function
|
|
7659
|
+
function Af({ id: e, ...t }) {
|
|
7680
7660
|
let n = Object.values(t);
|
|
7681
7661
|
return n.length === 0 ? "no-fields" : n.every((e) => e === void 0) ? "no-valid-values" : null;
|
|
7682
7662
|
}
|
|
7683
7663
|
// src/tools/update-reminders.ts
|
|
7684
|
-
var
|
|
7664
|
+
var jf = p.object({
|
|
7685
7665
|
type: p.literal("relative"),
|
|
7686
7666
|
id: p.string().min(1).describe("The ID of the relative reminder to update."),
|
|
7687
7667
|
minuteOffset: p.number().int().min(0).optional().describe("New minute offset before task due time."),
|
|
7688
7668
|
service: qa.optional().describe("New delivery method: \"email\" or \"push\"."),
|
|
7689
7669
|
isUrgent: Xa,
|
|
7690
7670
|
notifyUser: $a
|
|
7691
|
-
}),
|
|
7671
|
+
}), Mf = p.object({
|
|
7692
7672
|
type: p.literal("absolute"),
|
|
7693
7673
|
id: p.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
7694
7674
|
due: Ja.optional().describe("New due date/time for the reminder."),
|
|
7695
7675
|
service: qa.optional().describe("New delivery method: \"email\" or \"push\"."),
|
|
7696
7676
|
isUrgent: Xa,
|
|
7697
7677
|
notifyUser: $a
|
|
7698
|
-
}),
|
|
7678
|
+
}), Nf = p.object({
|
|
7699
7679
|
type: p.literal("location"),
|
|
7700
7680
|
id: p.string().min(1).describe("The ID of the location reminder to update."),
|
|
7701
7681
|
name: p.string().optional().describe("New location name."),
|
|
@@ -7704,11 +7684,11 @@ var Nf = p.object({
|
|
|
7704
7684
|
locTrigger: Ya.optional().describe("New trigger condition: \"on_enter\" or \"on_leave\"."),
|
|
7705
7685
|
radius: p.number().int().optional().describe("New radius in meters."),
|
|
7706
7686
|
notifyUser: $a
|
|
7707
|
-
}),
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
]),
|
|
7687
|
+
}), Pf = p.discriminatedUnion("type", [
|
|
7688
|
+
jf,
|
|
7689
|
+
Mf,
|
|
7690
|
+
Nf
|
|
7691
|
+
]), Ff = { reminders: p.array(Pf).min(1).max(25).describe("Array of reminders to update (max 25). Each must include the reminder type and ID. Only include fields that need to change.") }, If = {
|
|
7712
7692
|
reminders: p.array(Ti).describe("The updated reminders."),
|
|
7713
7693
|
totalCount: p.number().describe("Total reminders updated."),
|
|
7714
7694
|
updatedReminderIds: p.array(p.string()).describe("IDs of updated reminders."),
|
|
@@ -7717,11 +7697,11 @@ var Nf = p.object({
|
|
|
7717
7697
|
updateCount: p.number(),
|
|
7718
7698
|
failureCount: p.number()
|
|
7719
7699
|
})
|
|
7720
|
-
},
|
|
7700
|
+
}, Lf = {
|
|
7721
7701
|
name: B.UPDATE_REMINDERS,
|
|
7722
7702
|
description: "Update existing reminders. Each reminder must specify its type (\"relative\", \"absolute\", or \"location\") and ID. Only include fields that need to change.",
|
|
7723
|
-
parameters:
|
|
7724
|
-
outputSchema:
|
|
7703
|
+
parameters: Ff,
|
|
7704
|
+
outputSchema: If,
|
|
7725
7705
|
annotations: {
|
|
7726
7706
|
readOnlyHint: !1,
|
|
7727
7707
|
destructiveHint: !0,
|
|
@@ -7778,12 +7758,12 @@ var Nf = p.object({
|
|
|
7778
7758
|
}
|
|
7779
7759
|
};
|
|
7780
7760
|
}
|
|
7781
|
-
},
|
|
7761
|
+
}, Rf = p.object({
|
|
7782
7762
|
id: p.string().min(1).describe("The ID of the section to update."),
|
|
7783
7763
|
name: p.string().min(1).optional().describe("The new name of the section."),
|
|
7784
7764
|
description: p.preprocess((e) => e === null ? "" : e, p.string().describe("The description of the section (Markdown). Pass null (or an empty string) to clear it.")).optional(),
|
|
7785
7765
|
isArchived: p.boolean().optional().describe(`true archives (keeping its tasks, unlike ${B.DELETE_OBJECT}), false unarchives.`)
|
|
7786
|
-
}).refine((e) => e.name !== void 0 || e.description !== void 0 || e.isArchived !== void 0, { message: "Provide at least one of \"name\", \"description\" or \"isArchived\" to update." }),
|
|
7766
|
+
}).refine((e) => e.name !== void 0 || e.description !== void 0 || e.isArchived !== void 0, { message: "Provide at least one of \"name\", \"description\" or \"isArchived\" to update." }), zf = { sections: p.array(Rf).min(1).max(O.ITEMS_PER_OPERATION).describe("The sections to update.") }, Bf = {
|
|
7787
7767
|
sections: p.array(hi).describe("The updated sections."),
|
|
7788
7768
|
totalCount: p.number().describe("The total number of sections updated."),
|
|
7789
7769
|
updatedSectionIds: p.array(p.string()).describe("The IDs of the updated sections."),
|
|
@@ -7792,27 +7772,27 @@ var Nf = p.object({
|
|
|
7792
7772
|
updateCount: p.number(),
|
|
7793
7773
|
failureCount: p.number()
|
|
7794
7774
|
})
|
|
7795
|
-
},
|
|
7775
|
+
}, Vf = {
|
|
7796
7776
|
name: B.UPDATE_SECTIONS,
|
|
7797
7777
|
description: "Update, archive or unarchive multiple existing sections.",
|
|
7798
|
-
parameters:
|
|
7799
|
-
outputSchema:
|
|
7778
|
+
parameters: zf,
|
|
7779
|
+
outputSchema: Bf,
|
|
7800
7780
|
annotations: {
|
|
7801
7781
|
readOnlyHint: !1,
|
|
7802
7782
|
destructiveHint: !0,
|
|
7803
7783
|
idempotentHint: !1
|
|
7804
7784
|
},
|
|
7805
7785
|
async execute({ sections: e }, t) {
|
|
7806
|
-
let n = I(e, await Promise.allSettled(e.map((e) =>
|
|
7786
|
+
let n = I(e, await Promise.allSettled(e.map((e) => Uf(e, t))), (e) => e.id), r = n.succeeded.map(({ item: e, value: t }) => ({
|
|
7807
7787
|
id: e.id,
|
|
7808
7788
|
...t
|
|
7809
7789
|
})), i = [...n.failures, ...r.flatMap(({ id: e, partial: t }) => t ? [{
|
|
7810
7790
|
item: e,
|
|
7811
7791
|
...t,
|
|
7812
|
-
code:
|
|
7792
|
+
code: Hf
|
|
7813
7793
|
}] : [])], a = r.map(({ section: e }) => e);
|
|
7814
7794
|
return L(B.UPDATE_SECTIONS, e.length, i), {
|
|
7815
|
-
textContent:
|
|
7795
|
+
textContent: Gf({
|
|
7816
7796
|
updated: r.map(({ section: e, archiveChange: t }) => ({
|
|
7817
7797
|
section: e,
|
|
7818
7798
|
isArchived: t
|
|
@@ -7831,8 +7811,8 @@ var Nf = p.object({
|
|
|
7831
7811
|
}
|
|
7832
7812
|
};
|
|
7833
7813
|
}
|
|
7834
|
-
},
|
|
7835
|
-
async function
|
|
7814
|
+
}, Hf = "PARTIAL_UPDATE_APPLIED";
|
|
7815
|
+
async function Uf({ id: e, name: t, description: n, isArchived: r }, i) {
|
|
7836
7816
|
let a = [];
|
|
7837
7817
|
if (r === !1 && a.push({
|
|
7838
7818
|
label: "unarchive",
|
|
@@ -7872,37 +7852,37 @@ async function Gf({ id: e, name: t, description: n, isArchived: r }, i) {
|
|
|
7872
7852
|
}
|
|
7873
7853
|
return o;
|
|
7874
7854
|
}
|
|
7875
|
-
var
|
|
7855
|
+
var Wf = {
|
|
7876
7856
|
true: " - archived",
|
|
7877
7857
|
false: " - unarchived"
|
|
7878
7858
|
};
|
|
7879
|
-
function
|
|
7859
|
+
function Gf({ updated: e, failures: t }) {
|
|
7880
7860
|
let n = e.length, r = e.map(({ section: e, isArchived: t }) => {
|
|
7881
|
-
let n = t === void 0 ? "" :
|
|
7861
|
+
let n = t === void 0 ? "" : Wf[`${t}`];
|
|
7882
7862
|
return `• ${e.name} (id=${e.id}, projectId=${e.projectId})${n}`;
|
|
7883
7863
|
}).join("\n");
|
|
7884
7864
|
return X(n > 0 ? `Updated ${n} section${n === 1 ? "" : "s"}:\n${r}` : "Updated 0 sections", t);
|
|
7885
7865
|
}
|
|
7886
7866
|
// src/utils/move-planner.ts
|
|
7887
|
-
function
|
|
7867
|
+
function Kf(e, t) {
|
|
7888
7868
|
return t.projectId === void 0 ? t.sectionId === void 0 ? e.parentId === t.parentId : e.sectionId === t.sectionId && !e.parentId : e.projectId === t.projectId && !e.sectionId && !e.parentId;
|
|
7889
7869
|
}
|
|
7890
|
-
function
|
|
7870
|
+
function qf(e, t) {
|
|
7891
7871
|
return t.projectId === void 0 ? t.sectionId === void 0 ? e.parentId === t.parentId : e.sectionId === t.sectionId : e.projectId === t.projectId;
|
|
7892
7872
|
}
|
|
7893
|
-
function
|
|
7873
|
+
function Jf(e) {
|
|
7894
7874
|
return e.projectId === void 0 ? e.sectionId === void 0 ? `parent:${e.parentId}` : `section:${e.sectionId}` : `project:${e.projectId}`;
|
|
7895
7875
|
}
|
|
7896
|
-
function
|
|
7876
|
+
function Yf(e) {
|
|
7897
7877
|
let t = [];
|
|
7898
7878
|
return e.projectId && t.push({ projectId: e.projectId }), e.sectionId && t.push({ sectionId: e.sectionId }), e.parentId && t.push({ parentId: e.parentId }), t;
|
|
7899
7879
|
}
|
|
7900
|
-
function
|
|
7901
|
-
let r =
|
|
7880
|
+
function Xf({ taskId: e, request: t, current: n }) {
|
|
7881
|
+
let r = Yf(t);
|
|
7902
7882
|
if (r.length === 0) return { redundantMoveSkipped: !1 };
|
|
7903
7883
|
let i = r, a = !1;
|
|
7904
7884
|
if (n) {
|
|
7905
|
-
let e = r.length === 1 ? (e) =>
|
|
7885
|
+
let e = r.length === 1 ? (e) => Kf(n, e) : (e) => qf(n, e);
|
|
7906
7886
|
i = r.filter((t) => !e(t)), a = i.length < r.length;
|
|
7907
7887
|
}
|
|
7908
7888
|
if (i.length === 0) return { redundantMoveSkipped: a };
|
|
@@ -7913,7 +7893,7 @@ function Qf({ taskId: e, request: t, current: n }) {
|
|
|
7913
7893
|
};
|
|
7914
7894
|
}
|
|
7915
7895
|
// src/tools/update-tasks.ts
|
|
7916
|
-
var
|
|
7896
|
+
var Zf = p.object({
|
|
7917
7897
|
id: p.string().min(1).describe("The ID of the task to update."),
|
|
7918
7898
|
content: p.string().optional().describe("The new task name/title. Should be concise and actionable (e.g., \"Review PR #123\", \"Call dentist\"). For longer content, use the description field instead. Supports Markdown."),
|
|
7919
7899
|
description: p.string().optional().describe("New additional details, notes, or context for the task. Use this for longer content rather than putting it in the task name. Supports Markdown."),
|
|
@@ -7929,11 +7909,11 @@ var $f = p.object({
|
|
|
7929
7909
|
responsibleUser: p.preprocess((e) => e === null ? "unassign" : e, p.string()).optional().describe("Change task assignment. Use \"unassign\" to remove assignment. Can be \"me\" (assigns to current user), a user ID, name, or email. User must be a project collaborator."),
|
|
7930
7910
|
labels: p.array(p.string()).max(O.LABELS_PER_TASK).optional().describe("The new labels for the task. Replaces all existing labels."),
|
|
7931
7911
|
isUncompletable: p.boolean().optional().describe("Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed.")
|
|
7932
|
-
}),
|
|
7912
|
+
}), Qf = (e) => !!(e.projectId || e.sectionId || e.parentId), $f = (e) => Object.keys(e).length > 0, ep = ["remove", "no date"], tp = [
|
|
7933
7913
|
"remove",
|
|
7934
7914
|
"no date",
|
|
7935
7915
|
"no deadline"
|
|
7936
|
-
],
|
|
7916
|
+
], np = "no date", rp = O.TASKS_PER_OPERATION, ip = { tasks: p.array(Zf).min(1).max(rp).describe(`The tasks to update (max ${rp}).`) }, ap = {
|
|
7937
7917
|
tasks: p.array(J).describe("The updated tasks."),
|
|
7938
7918
|
totalCount: p.number().describe("The total number of tasks updated."),
|
|
7939
7919
|
updatedTaskIds: p.array(p.string()).describe("The IDs of the updated tasks."),
|
|
@@ -7944,11 +7924,11 @@ var $f = p.object({
|
|
|
7944
7924
|
failureCount: p.number(),
|
|
7945
7925
|
redundantMovesSkipped: p.number().describe("Moves not performed because the task was already in the requested destination. A non-zero count means container fields were sent that did not need to be.")
|
|
7946
7926
|
}).describe("Summary of operations performed.")
|
|
7947
|
-
},
|
|
7927
|
+
}, op = {
|
|
7948
7928
|
name: B.UPDATE_TASKS,
|
|
7949
7929
|
description: "Update existing tasks including content, dates, priorities, and assignments. Send only the fields that change.",
|
|
7950
|
-
parameters:
|
|
7951
|
-
outputSchema:
|
|
7930
|
+
parameters: ip,
|
|
7931
|
+
outputSchema: ap,
|
|
7952
7932
|
annotations: {
|
|
7953
7933
|
readOnlyHint: !1,
|
|
7954
7934
|
destructiveHint: !0,
|
|
@@ -7956,7 +7936,7 @@ var $f = p.object({
|
|
|
7956
7936
|
openWorldHint: !0
|
|
7957
7937
|
},
|
|
7958
7938
|
async execute(e, t) {
|
|
7959
|
-
let { tasks: n } = p.object(
|
|
7939
|
+
let { tasks: n } = p.object(ip).parse(e), r = n.map(() => ({ kind: "skipped" })), i = (e, t, n) => {
|
|
7960
7940
|
r[e] = {
|
|
7961
7941
|
kind: "failed",
|
|
7962
7942
|
error: t,
|
|
@@ -7967,7 +7947,7 @@ var $f = p.object({
|
|
|
7967
7947
|
}, o = n.map((e, t) => ({
|
|
7968
7948
|
task: e,
|
|
7969
7949
|
index: t
|
|
7970
|
-
})).filter(({ task: e }) =>
|
|
7950
|
+
})).filter(({ task: e }) => _p(e)), s = await cp(o.map(({ task: e }) => e), t), c = await Promise.allSettled(o.map(({ task: e, index: n }) => mp({
|
|
7971
7951
|
task: e,
|
|
7972
7952
|
index: n,
|
|
7973
7953
|
client: t,
|
|
@@ -7977,13 +7957,13 @@ var $f = p.object({
|
|
|
7977
7957
|
let n = o[e]?.index ?? e;
|
|
7978
7958
|
t.status === "fulfilled" ? l.push(t.value) : a(n, t.reason);
|
|
7979
7959
|
}
|
|
7980
|
-
let { states: u, readFailed: d } = await
|
|
7960
|
+
let { states: u, readFailed: d } = await lp({
|
|
7981
7961
|
client: t,
|
|
7982
|
-
ids: [...new Set(l.filter((e) =>
|
|
7962
|
+
ids: [...new Set(l.filter((e) => Qf(e.moveRequest) || e.checkRecurrence).map((e) => e.id))]
|
|
7983
7963
|
});
|
|
7984
7964
|
for (let e of l) {
|
|
7985
7965
|
if (!e.checkRecurrence) continue;
|
|
7986
|
-
let t =
|
|
7966
|
+
let t = up({
|
|
7987
7967
|
id: e.id,
|
|
7988
7968
|
current: u.get(e.id),
|
|
7989
7969
|
readFailed: d
|
|
@@ -7992,7 +7972,7 @@ var $f = p.object({
|
|
|
7992
7972
|
}
|
|
7993
7973
|
let f = [];
|
|
7994
7974
|
for (let e of l) if (!e.failed) try {
|
|
7995
|
-
let t =
|
|
7975
|
+
let t = Xf({
|
|
7996
7976
|
taskId: e.id,
|
|
7997
7977
|
request: e.moveRequest,
|
|
7998
7978
|
current: u.get(e.id)
|
|
@@ -8006,7 +7986,7 @@ var $f = p.object({
|
|
|
8006
7986
|
}
|
|
8007
7987
|
let m = /* @__PURE__ */ new Map(), h = [], g = (e) => {
|
|
8008
7988
|
let n = e.filter((e) => !e.failed);
|
|
8009
|
-
n.length !== 0 && h.push(
|
|
7989
|
+
n.length !== 0 && h.push(pp({
|
|
8010
7990
|
client: t,
|
|
8011
7991
|
items: n,
|
|
8012
7992
|
onUpdated: (e, t) => {
|
|
@@ -8026,7 +8006,7 @@ var $f = p.object({
|
|
|
8026
8006
|
}
|
|
8027
8007
|
}));
|
|
8028
8008
|
}, _ = new Set(f.map(({ item: e }) => e.index));
|
|
8029
|
-
g(l.filter((e) => !_.has(e.index))), await
|
|
8009
|
+
g(l.filter((e) => !_.has(e.index))), await dp({
|
|
8030
8010
|
client: t,
|
|
8031
8011
|
moving: f,
|
|
8032
8012
|
results: m,
|
|
@@ -8040,19 +8020,19 @@ var $f = p.object({
|
|
|
8040
8020
|
}
|
|
8041
8021
|
}), await Promise.all(h);
|
|
8042
8022
|
for (let e of l) {
|
|
8043
|
-
if (e.failed ||
|
|
8023
|
+
if (e.failed || $f(e.updateArgs)) continue;
|
|
8044
8024
|
let t = m.get(e.index);
|
|
8045
8025
|
t && "task" in t && (r[e.index] = {
|
|
8046
8026
|
kind: "updated",
|
|
8047
8027
|
task: t.task
|
|
8048
8028
|
});
|
|
8049
8029
|
}
|
|
8050
|
-
let { updatedTasks: v, failures: y, skippedCount: b } =
|
|
8030
|
+
let { updatedTasks: v, failures: y, skippedCount: b } = sp({
|
|
8051
8031
|
tasks: n,
|
|
8052
8032
|
outcomes: r
|
|
8053
8033
|
}), x = l.filter((e) => e.redundantMoveSkipped).length, S = v.map(K);
|
|
8054
8034
|
return L(B.UPDATE_TASKS, n.length, y), {
|
|
8055
|
-
textContent:
|
|
8035
|
+
textContent: gp({
|
|
8056
8036
|
tasks: S,
|
|
8057
8037
|
failures: y,
|
|
8058
8038
|
skippedCount: b,
|
|
@@ -8073,7 +8053,7 @@ var $f = p.object({
|
|
|
8073
8053
|
};
|
|
8074
8054
|
}
|
|
8075
8055
|
};
|
|
8076
|
-
function
|
|
8056
|
+
function sp({ tasks: e, outcomes: t }) {
|
|
8077
8057
|
let n = [], r = [], i = 0;
|
|
8078
8058
|
for (let [a, o] of t.entries()) {
|
|
8079
8059
|
let t = e[a]?.id ?? `Task ${a + 1}`;
|
|
@@ -8094,7 +8074,7 @@ function lp({ tasks: e, outcomes: t }) {
|
|
|
8094
8074
|
skippedCount: i
|
|
8095
8075
|
};
|
|
8096
8076
|
}
|
|
8097
|
-
async function
|
|
8077
|
+
async function cp(e, t) {
|
|
8098
8078
|
if (!e.some((e) => U(e.projectId))) return {};
|
|
8099
8079
|
try {
|
|
8100
8080
|
return { projectId: (await R(() => t.getUser())).inboxProjectId };
|
|
@@ -8102,7 +8082,7 @@ async function up(e, t) {
|
|
|
8102
8082
|
return { error: e };
|
|
8103
8083
|
}
|
|
8104
8084
|
}
|
|
8105
|
-
async function
|
|
8085
|
+
async function lp({ client: e, ids: t }) {
|
|
8106
8086
|
let n = /* @__PURE__ */ new Map();
|
|
8107
8087
|
if (t.length === 0) return {
|
|
8108
8088
|
states: n,
|
|
@@ -8111,7 +8091,7 @@ async function dp({ client: e, ids: t }) {
|
|
|
8111
8091
|
try {
|
|
8112
8092
|
let r = new Set(t), i = {
|
|
8113
8093
|
ids: t,
|
|
8114
|
-
limit:
|
|
8094
|
+
limit: rp
|
|
8115
8095
|
}, { results: a } = await R(() => e.getTasks(i));
|
|
8116
8096
|
for (let e of a) r.has(e.id) && n.set(e.id, e);
|
|
8117
8097
|
} catch (e) {
|
|
@@ -8126,15 +8106,15 @@ async function dp({ client: e, ids: t }) {
|
|
|
8126
8106
|
readFailed: !1
|
|
8127
8107
|
};
|
|
8128
8108
|
}
|
|
8129
|
-
function
|
|
8109
|
+
function up({ id: e, current: t, readFailed: n }) {
|
|
8130
8110
|
if (n) return `Task ${e}: could not check whether the task is recurring, so its due date was not changed. Retry the update.`;
|
|
8131
8111
|
if (t?.due?.isRecurring) return `Task ${e} recurs ("${t.due.string}"). dueString would replace that rule and make it a one-time task, so nothing was changed. To move it to another date or time, use ${B.RESCHEDULE_TASKS} (it also accepts duration). To change or drop the recurrence on purpose, resend with replaceRecurrence: true.`;
|
|
8132
8112
|
}
|
|
8133
|
-
async function
|
|
8113
|
+
async function dp({ client: e, moving: t, results: n, onResolved: r }) {
|
|
8134
8114
|
if (t.length === 0) return;
|
|
8135
8115
|
let i = /* @__PURE__ */ new Map();
|
|
8136
8116
|
for (let e of t) {
|
|
8137
|
-
let t =
|
|
8117
|
+
let t = Jf(e.move), n = i.get(t);
|
|
8138
8118
|
n ? n.push(e) : i.set(t, [e]);
|
|
8139
8119
|
}
|
|
8140
8120
|
let a = It(e), o = [];
|
|
@@ -8171,7 +8151,7 @@ async function pp({ client: e, moving: t, results: n, onResolved: r }) {
|
|
|
8171
8151
|
}
|
|
8172
8152
|
}
|
|
8173
8153
|
if (o.length > 0) {
|
|
8174
|
-
await
|
|
8154
|
+
await fp({
|
|
8175
8155
|
client: e,
|
|
8176
8156
|
unresolved: o,
|
|
8177
8157
|
results: n
|
|
@@ -8179,8 +8159,8 @@ async function pp({ client: e, moving: t, results: n, onResolved: r }) {
|
|
|
8179
8159
|
for (let { group: e } of o) r(e);
|
|
8180
8160
|
}
|
|
8181
8161
|
}
|
|
8182
|
-
async function
|
|
8183
|
-
let { states: r, rateLimit: i } = await
|
|
8162
|
+
async function fp({ client: e, unresolved: t, results: n }) {
|
|
8163
|
+
let { states: r, rateLimit: i } = await lp({
|
|
8184
8164
|
client: e,
|
|
8185
8165
|
ids: [...new Set(t.flatMap(({ group: e }) => e.map(({ item: e }) => e.id)))]
|
|
8186
8166
|
});
|
|
@@ -8191,16 +8171,16 @@ async function mp({ client: e, unresolved: t, results: n }) {
|
|
|
8191
8171
|
}, u = o === void 0 ? "Task not returned by the move" : P(o);
|
|
8192
8172
|
for (let { item: t } of e) {
|
|
8193
8173
|
let e = r.get(t.id);
|
|
8194
|
-
e &&
|
|
8174
|
+
e && Kf(e, a) ? n.set(t.index, { task: e }) : n.set(t.index, {
|
|
8195
8175
|
error: u,
|
|
8196
8176
|
rateLimit: l
|
|
8197
8177
|
});
|
|
8198
8178
|
}
|
|
8199
8179
|
}
|
|
8200
8180
|
}
|
|
8201
|
-
async function
|
|
8181
|
+
async function pp({ client: e, items: t, onUpdated: n, onFailed: r }) {
|
|
8202
8182
|
let i = Lt(e);
|
|
8203
|
-
await Promise.all(t.filter((e) =>
|
|
8183
|
+
await Promise.all(t.filter((e) => $f(e.updateArgs)).map(async (t) => {
|
|
8204
8184
|
try {
|
|
8205
8185
|
n(t, await i(() => R(() => e.updateTask(t.id, t.updateArgs))));
|
|
8206
8186
|
} catch (e) {
|
|
@@ -8208,7 +8188,7 @@ async function hp({ client: e, items: t, onUpdated: n, onFailed: r }) {
|
|
|
8208
8188
|
}
|
|
8209
8189
|
}));
|
|
8210
8190
|
}
|
|
8211
|
-
async function
|
|
8191
|
+
async function mp({ task: e, index: t, client: n, inbox: r }) {
|
|
8212
8192
|
let { id: i, projectId: a, sectionId: o, parentId: s, dueString: c, duration: l, responsibleUser: u, priority: d, labels: f, deadlineDate: p, replaceRecurrence: m, ...h } = e;
|
|
8213
8193
|
if (U(a) && r.error !== void 0) throw r.error;
|
|
8214
8194
|
let g = U(a) ? r.projectId : a, _ = {
|
|
@@ -8216,12 +8196,12 @@ async function gp({ task: e, index: t, client: n, inbox: r }) {
|
|
|
8216
8196
|
...f !== void 0 && { labels: f }
|
|
8217
8197
|
};
|
|
8218
8198
|
d && (_.priority = cr(d));
|
|
8219
|
-
let v =
|
|
8199
|
+
let v = vp(c, ep, np);
|
|
8220
8200
|
v !== void 0 && (_ = {
|
|
8221
8201
|
..._,
|
|
8222
8202
|
dueString: v
|
|
8223
8203
|
});
|
|
8224
|
-
let y =
|
|
8204
|
+
let y = vp(p, tp, null);
|
|
8225
8205
|
if (y !== void 0 && (_ = {
|
|
8226
8206
|
..._,
|
|
8227
8207
|
deadlineDate: y
|
|
@@ -8235,7 +8215,7 @@ async function gp({ task: e, index: t, client: n, inbox: r }) {
|
|
|
8235
8215
|
}
|
|
8236
8216
|
return u !== void 0 && (_ = {
|
|
8237
8217
|
..._,
|
|
8238
|
-
assigneeId: await
|
|
8218
|
+
assigneeId: await hp(n, i, u)
|
|
8239
8219
|
}), {
|
|
8240
8220
|
index: t,
|
|
8241
8221
|
id: i,
|
|
@@ -8246,11 +8226,11 @@ async function gp({ task: e, index: t, client: n, inbox: r }) {
|
|
|
8246
8226
|
parentId: s
|
|
8247
8227
|
},
|
|
8248
8228
|
redundantMoveSkipped: !1,
|
|
8249
|
-
checkRecurrence: v !== void 0 && v !==
|
|
8229
|
+
checkRecurrence: v !== void 0 && v !== np && m !== !0,
|
|
8250
8230
|
failed: !1
|
|
8251
8231
|
};
|
|
8252
8232
|
}
|
|
8253
|
-
async function
|
|
8233
|
+
async function hp(e, t, n) {
|
|
8254
8234
|
if (n === null || n === "unassign") return null;
|
|
8255
8235
|
let r = await go.validateTaskUpdateAssignment(e, t, n);
|
|
8256
8236
|
if (!r.isValid) {
|
|
@@ -8259,7 +8239,7 @@ async function _p(e, t, n) {
|
|
|
8259
8239
|
}
|
|
8260
8240
|
return r.resolvedUser?.userId;
|
|
8261
8241
|
}
|
|
8262
|
-
function
|
|
8242
|
+
function gp({ tasks: e, failures: t, skippedCount: n, redundantMovesSkipped: r }) {
|
|
8263
8243
|
let i = [];
|
|
8264
8244
|
n > 0 && i.push(`${n} skipped - no changes`), r > 0 && i.push(`${r} already in requested destination`), t.length > 0 && i.push(`${t.length} failed`);
|
|
8265
8245
|
let a = Ni("Updated", e, {
|
|
@@ -8270,17 +8250,17 @@ function vp({ tasks: e, failures: t, skippedCount: n, redundantMovesSkipped: r }
|
|
|
8270
8250
|
let o = t.slice(0, be.MAX_FAILURES_SHOWN), s = t.length - o.length, c = o.map((e) => ` ${e.item}: ${e.error}`).join("\n"), l = s > 0 ? `\n +${s} more` : "";
|
|
8271
8251
|
return `${a}\nFailed (${t.length}) - address or drop these items:\n${c}${l}`;
|
|
8272
8252
|
}
|
|
8273
|
-
function
|
|
8253
|
+
function _p({ id: e, replaceRecurrence: t, ...n }) {
|
|
8274
8254
|
return Object.keys(n).length > 0;
|
|
8275
8255
|
}
|
|
8276
|
-
function
|
|
8256
|
+
function vp(e, t, n) {
|
|
8277
8257
|
if (e === void 0) return e;
|
|
8278
8258
|
if (e === null) return n;
|
|
8279
8259
|
let r = e.trim().toLowerCase();
|
|
8280
8260
|
return t.includes(r) ? n : e;
|
|
8281
8261
|
}
|
|
8282
8262
|
// src/tools/update-template.ts
|
|
8283
|
-
var
|
|
8263
|
+
var yp = {
|
|
8284
8264
|
templateId: p.string().regex(Ca).describe("A saved template ID (\"UT_28Ex...\") or its Todoist URL."),
|
|
8285
8265
|
name: p.string().trim().min(1).optional(),
|
|
8286
8266
|
description: p.string().trim().min(1).optional(),
|
|
@@ -8289,16 +8269,16 @@ var xp = {
|
|
|
8289
8269
|
content: Mo.optional().describe("Replace the template's content: the `content` fetch-object returns for the template, with your edits, all of it. Anything left out is removed. Task IDs change on every save, so fetch the template again before each edit. Not with `projectId`."),
|
|
8290
8270
|
workspace: p.string().trim().min(1).optional().describe("Workspace name or ID to move a personal template into. A workspace template cannot move again."),
|
|
8291
8271
|
sharedWithWorkspaceMembers: p.boolean().optional().describe("Share a workspace template with its members, or stop sharing it. Only the author can change this.")
|
|
8292
|
-
},
|
|
8272
|
+
}, bp = {
|
|
8293
8273
|
templateId: p.string(),
|
|
8294
8274
|
name: p.string(),
|
|
8295
8275
|
workspaceId: p.string().optional().describe("Absent for personal templates."),
|
|
8296
8276
|
sharedWithWorkspaceMembers: p.boolean()
|
|
8297
|
-
},
|
|
8277
|
+
}, xp = {
|
|
8298
8278
|
name: B.UPDATE_TEMPLATE,
|
|
8299
8279
|
description: "Update a saved Todoist template: rename it, change its description or color, edit its content (layout, sections, tasks, comments) or replace it from a project, move it into a workspace, or share it with workspace members. Omitted fields stay unchanged. Gallery templates cannot be edited.",
|
|
8300
|
-
parameters:
|
|
8301
|
-
outputSchema:
|
|
8280
|
+
parameters: yp,
|
|
8281
|
+
outputSchema: bp,
|
|
8302
8282
|
annotations: {
|
|
8303
8283
|
readOnlyHint: !1,
|
|
8304
8284
|
destructiveHint: !0,
|
|
@@ -8318,7 +8298,7 @@ var xp = {
|
|
|
8318
8298
|
s
|
|
8319
8299
|
].every((e) => e === void 0)) throw Error("Nothing to update. Provide at least one field to change. An unrecognized color is ignored, so pass one of the listed colors.");
|
|
8320
8300
|
if (a && i) throw Error("Provide either `content` or `projectId`, not both: each replaces the whole content.");
|
|
8321
|
-
let u = a ?
|
|
8301
|
+
let u = a ? Io(a) : void 0, [d, f] = await Promise.all([u ? Sp(c, l, "before") : void 0, o ? oa.resolveWorkspace(c, o).then((e) => e.workspaceId) : void 0]), p = await c.updateTemplate(l, {
|
|
8322
8302
|
name: t,
|
|
8323
8303
|
description: n,
|
|
8324
8304
|
color: r,
|
|
@@ -8328,11 +8308,11 @@ var xp = {
|
|
|
8328
8308
|
sharedWithWorkspaceMembers: s
|
|
8329
8309
|
}), m = p.workspaceId ?? void 0, h = p.sharedWithWorkspaceMembers ?? !1, g = m ? ` It is in workspace (id=${m}) and ${h ? "shared with" : "not shared with"} its members.` : " It is a personal template.", _ = "";
|
|
8330
8310
|
if (u) {
|
|
8331
|
-
let e = await
|
|
8311
|
+
let e = await Sp(c, l, "after");
|
|
8332
8312
|
if (!e) _ = " The content was saved, but could not be read back to compare.";
|
|
8333
8313
|
else {
|
|
8334
|
-
_ = d ? ` Content: ${
|
|
8335
|
-
let t =
|
|
8314
|
+
_ = d ? ` Content: ${Ro(d, e)}.` : " The previous content could not be read, so the change is not reported.";
|
|
8315
|
+
let t = zo(u, e);
|
|
8336
8316
|
t && (_ += ` Not everything sent was kept: ${t}.`);
|
|
8337
8317
|
}
|
|
8338
8318
|
}
|
|
@@ -8347,7 +8327,7 @@ var xp = {
|
|
|
8347
8327
|
};
|
|
8348
8328
|
}
|
|
8349
8329
|
};
|
|
8350
|
-
async function
|
|
8330
|
+
async function Sp(e, t, n) {
|
|
8351
8331
|
try {
|
|
8352
8332
|
return (await R(() => e.getTemplateContent(t))).content;
|
|
8353
8333
|
} catch (e) {
|
|
@@ -8356,7 +8336,7 @@ async function wp(e, t, n) {
|
|
|
8356
8336
|
}
|
|
8357
8337
|
}
|
|
8358
8338
|
// src/tools/user-info.ts
|
|
8359
|
-
var
|
|
8339
|
+
var Cp = {}, wp = {
|
|
8360
8340
|
type: p.literal("user_info").describe("The type of the response."),
|
|
8361
8341
|
userId: p.string().describe("The user ID."),
|
|
8362
8342
|
fullName: p.string().describe("The full name of the user."),
|
|
@@ -8377,22 +8357,22 @@ var Tp = {}, Ep = {
|
|
|
8377
8357
|
"Todoist Business"
|
|
8378
8358
|
]).describe("The user plan.")
|
|
8379
8359
|
};
|
|
8380
|
-
function
|
|
8360
|
+
function Tp(e) {
|
|
8381
8361
|
return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
|
|
8382
8362
|
}
|
|
8383
|
-
function
|
|
8363
|
+
function Ep(e, t) {
|
|
8384
8364
|
let n = ((e.getDay() || 7) - t + 7) % 7, r = new Date(e);
|
|
8385
8365
|
return r.setDate(e.getDate() - n), r;
|
|
8386
8366
|
}
|
|
8387
|
-
function
|
|
8367
|
+
function Dp(e) {
|
|
8388
8368
|
let t = new Date(e);
|
|
8389
8369
|
return t.setDate(e.getDate() + 6), t;
|
|
8390
8370
|
}
|
|
8391
|
-
function
|
|
8371
|
+
function Op(e) {
|
|
8392
8372
|
let t = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate() + 3), n = new Date(t).getUTCFullYear(), r = (t - Date.UTC(n, 0, 1)) / 864e5;
|
|
8393
8373
|
return Math.floor(r / 7) + 1;
|
|
8394
8374
|
}
|
|
8395
|
-
function
|
|
8375
|
+
function kp(e) {
|
|
8396
8376
|
return [
|
|
8397
8377
|
"Sunday",
|
|
8398
8378
|
"Monday",
|
|
@@ -8403,18 +8383,18 @@ function jp(e) {
|
|
|
8403
8383
|
"Saturday"
|
|
8404
8384
|
][e === 7 ? 0 : e] ?? "Unknown";
|
|
8405
8385
|
}
|
|
8406
|
-
function
|
|
8386
|
+
function Ap(e) {
|
|
8407
8387
|
try {
|
|
8408
8388
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
8409
8389
|
} catch {
|
|
8410
8390
|
return !1;
|
|
8411
8391
|
}
|
|
8412
8392
|
}
|
|
8413
|
-
function
|
|
8414
|
-
return
|
|
8393
|
+
function jp(e) {
|
|
8394
|
+
return Ap(e) ? e : "UTC";
|
|
8415
8395
|
}
|
|
8416
|
-
function
|
|
8417
|
-
let n =
|
|
8396
|
+
function Mp(e, t) {
|
|
8397
|
+
let n = jp(t);
|
|
8418
8398
|
return e.toLocaleString("en-US", {
|
|
8419
8399
|
timeZone: n,
|
|
8420
8400
|
year: "numeric",
|
|
@@ -8426,8 +8406,8 @@ function Pp(e, t) {
|
|
|
8426
8406
|
hour12: !1
|
|
8427
8407
|
});
|
|
8428
8408
|
}
|
|
8429
|
-
async function
|
|
8430
|
-
let t = await e.getUser(), n =
|
|
8409
|
+
async function Np(e) {
|
|
8410
|
+
let t = await e.getUser(), n = jp(t.tzInfo?.timezone ?? "UTC"), r = /* @__PURE__ */ new Date(), i = Mp(r, n), a = t.startDay ?? 1, o = kp(a), s = Tp(t), c = Ep(new Date(r.toLocaleString("en-US", { timeZone: n })), a), l = Dp(c), u = Op(c);
|
|
8431
8411
|
return {
|
|
8432
8412
|
textContent: [
|
|
8433
8413
|
"# User Information",
|
|
@@ -8471,30 +8451,30 @@ async function Fp(e) {
|
|
|
8471
8451
|
}
|
|
8472
8452
|
};
|
|
8473
8453
|
}
|
|
8474
|
-
var
|
|
8454
|
+
var Pp = {
|
|
8475
8455
|
name: B.USER_INFO,
|
|
8476
8456
|
description: "Get comprehensive user information including user ID, full name, email, timezone with current local time, week start day preferences, current week dates, daily/weekly goal progress, and user plan (Free/Pro/Business).",
|
|
8477
|
-
parameters:
|
|
8478
|
-
outputSchema:
|
|
8457
|
+
parameters: Cp,
|
|
8458
|
+
outputSchema: wp,
|
|
8479
8459
|
annotations: {
|
|
8480
8460
|
readOnlyHint: !0,
|
|
8481
8461
|
destructiveHint: !1,
|
|
8482
8462
|
idempotentHint: !0
|
|
8483
8463
|
},
|
|
8484
8464
|
async execute(e, t) {
|
|
8485
|
-
let n = await
|
|
8465
|
+
let n = await Np(t);
|
|
8486
8466
|
return {
|
|
8487
8467
|
textContent: n.textContent,
|
|
8488
8468
|
structuredContent: n.structuredContent
|
|
8489
8469
|
};
|
|
8490
8470
|
}
|
|
8491
|
-
},
|
|
8471
|
+
}, Fp = 10485760, Ip = /* @__PURE__ */ new Set([
|
|
8492
8472
|
"image/png",
|
|
8493
8473
|
"image/jpeg",
|
|
8494
8474
|
"image/gif",
|
|
8495
8475
|
"image/webp",
|
|
8496
8476
|
"image/svg+xml"
|
|
8497
|
-
]),
|
|
8477
|
+
]), Lp = /* @__PURE__ */ new Set([
|
|
8498
8478
|
"text/plain",
|
|
8499
8479
|
"text/csv",
|
|
8500
8480
|
"text/html",
|
|
@@ -8502,7 +8482,7 @@ var Ip = {
|
|
|
8502
8482
|
"application/json",
|
|
8503
8483
|
"application/xml",
|
|
8504
8484
|
"text/xml"
|
|
8505
|
-
]),
|
|
8485
|
+
]), Rp = {
|
|
8506
8486
|
".png": "image/png",
|
|
8507
8487
|
".jpg": "image/jpeg",
|
|
8508
8488
|
".jpeg": "image/jpeg",
|
|
@@ -8517,21 +8497,21 @@ var Ip = {
|
|
|
8517
8497
|
".xml": "application/xml",
|
|
8518
8498
|
".pdf": "application/pdf"
|
|
8519
8499
|
};
|
|
8520
|
-
function
|
|
8521
|
-
return
|
|
8500
|
+
function zp(e) {
|
|
8501
|
+
return Ip.has(e) ? "image" : Lp.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
8522
8502
|
}
|
|
8523
|
-
function
|
|
8503
|
+
function Bp(e) {
|
|
8524
8504
|
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
8525
8505
|
}
|
|
8526
|
-
function
|
|
8506
|
+
function Vp(e) {
|
|
8527
8507
|
try {
|
|
8528
8508
|
let t = new URL(e).pathname, n = t.lastIndexOf(".");
|
|
8529
|
-
return n === -1 ? void 0 :
|
|
8509
|
+
return n === -1 ? void 0 : Rp[t.slice(n).toLowerCase()];
|
|
8530
8510
|
} catch {
|
|
8531
8511
|
return;
|
|
8532
8512
|
}
|
|
8533
8513
|
}
|
|
8534
|
-
function
|
|
8514
|
+
function Hp(e) {
|
|
8535
8515
|
try {
|
|
8536
8516
|
let t = new URL(e).pathname, n = t.lastIndexOf("/");
|
|
8537
8517
|
return n === -1 ? void 0 : t.slice(n + 1) || void 0;
|
|
@@ -8539,21 +8519,21 @@ function Wp(e) {
|
|
|
8539
8519
|
return;
|
|
8540
8520
|
}
|
|
8541
8521
|
}
|
|
8542
|
-
var
|
|
8522
|
+
var Up = { fileUrl: p.url().regex(/^https:\/\/(?:files\.todoist\.com|todoist\.b-cdn\.net|d1ysz50cxb9zwl\.cloudfront\.net)\/\S*$/, { error: "Pass the fileUrl from a comment's fileAttachment: an https URL on files.todoist.com, todoist.b-cdn.net or d1ysz50cxb9zwl.cloudfront.net." }).describe("The fileUrl from a comment's fileAttachment. Allowed hosts (https only): files.todoist.com, todoist.b-cdn.net, d1ysz50cxb9zwl.cloudfront.net.") }, Wp = {
|
|
8543
8523
|
name: B.VIEW_ATTACHMENT,
|
|
8544
8524
|
description: "View a file attachment from a Todoist comment. Pass the fileUrl from a comment's fileAttachment field. Supports images (returned inline), text files (returned as text), and binary files like PDFs (returned as embedded resources).",
|
|
8545
|
-
parameters:
|
|
8525
|
+
parameters: Up,
|
|
8546
8526
|
annotations: {
|
|
8547
8527
|
readOnlyHint: !0,
|
|
8548
8528
|
destructiveHint: !1,
|
|
8549
8529
|
idempotentHint: !0
|
|
8550
8530
|
},
|
|
8551
8531
|
async execute({ fileUrl: e }, t) {
|
|
8552
|
-
let n = await t.viewAttachment(e), r = n.headers["content-length"], i = r ? Number.parseInt(r, 10) : void 0, a =
|
|
8553
|
-
if (i && i >
|
|
8532
|
+
let n = await t.viewAttachment(e), r = n.headers["content-length"], i = r ? Number.parseInt(r, 10) : void 0, a = Hp(e), o = n.headers["content-type"], s = o ? Bp(o) : void 0, c = s && s !== "application/octet-stream" ? s : Vp(e) ?? s ?? "application/octet-stream";
|
|
8533
|
+
if (i && i > Fp) return { textContent: `Attachment "${a ?? e}" is too large to display inline (${(i / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${c}` };
|
|
8554
8534
|
let l = Buffer.from(await n.arrayBuffer()), u = l.byteLength;
|
|
8555
|
-
if (u >
|
|
8556
|
-
let d =
|
|
8535
|
+
if (u > Fp) return { textContent: `Attachment "${a ?? e}" is too large to display inline (${(u / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${c}` };
|
|
8536
|
+
let d = zp(c), f = [];
|
|
8557
8537
|
return d === "image" ? f.push({
|
|
8558
8538
|
type: "image",
|
|
8559
8539
|
data: l.toString("base64"),
|
|
@@ -8573,77 +8553,77 @@ var Gp = { fileUrl: p.url().regex(/^https:\/\/(?:files\.todoist\.com|todoist\.b-
|
|
|
8573
8553
|
contentItems: f
|
|
8574
8554
|
};
|
|
8575
8555
|
}
|
|
8576
|
-
},
|
|
8556
|
+
}, Gp = {
|
|
8577
8557
|
addTasks: xo,
|
|
8578
|
-
completeTasks:
|
|
8579
|
-
uncompleteTasks:
|
|
8580
|
-
updateTasks:
|
|
8581
|
-
rescheduleTasks:
|
|
8582
|
-
findTasks:
|
|
8558
|
+
completeTasks: ns,
|
|
8559
|
+
uncompleteTasks: Jd,
|
|
8560
|
+
updateTasks: op,
|
|
8561
|
+
rescheduleTasks: Ed,
|
|
8562
|
+
findTasks: jl,
|
|
8583
8563
|
findTasksByDate: {
|
|
8584
|
-
...
|
|
8564
|
+
...vl,
|
|
8585
8565
|
_meta: { ui: { resourceUri: ke } }
|
|
8586
8566
|
},
|
|
8587
|
-
findCompletedTasks:
|
|
8567
|
+
findCompletedTasks: gc,
|
|
8588
8568
|
addProjects: Pa,
|
|
8589
|
-
updateProjects:
|
|
8590
|
-
findProjects:
|
|
8591
|
-
projectManagement:
|
|
8592
|
-
projectMove:
|
|
8569
|
+
updateProjects: Of,
|
|
8570
|
+
findProjects: Jc,
|
|
8571
|
+
projectManagement: Xu,
|
|
8572
|
+
projectMove: ed,
|
|
8593
8573
|
addFolders: pa,
|
|
8594
|
-
updateFolders:
|
|
8595
|
-
findFolders:
|
|
8574
|
+
updateFolders: pf,
|
|
8575
|
+
findFolders: wc,
|
|
8596
8576
|
addSections: po,
|
|
8597
|
-
updateSections:
|
|
8598
|
-
findSections:
|
|
8577
|
+
updateSections: Vf,
|
|
8578
|
+
findSections: ll,
|
|
8599
8579
|
addComments: Ui,
|
|
8600
|
-
findComments:
|
|
8601
|
-
updateComments:
|
|
8580
|
+
findComments: rc,
|
|
8581
|
+
updateComments: ef,
|
|
8602
8582
|
addReminders: so,
|
|
8603
|
-
findReminders:
|
|
8604
|
-
updateReminders:
|
|
8605
|
-
viewAttachment:
|
|
8583
|
+
findReminders: nl,
|
|
8584
|
+
updateReminders: Lf,
|
|
8585
|
+
viewAttachment: Wp,
|
|
8606
8586
|
addLabels: va,
|
|
8607
|
-
updateLabels:
|
|
8608
|
-
findLabels:
|
|
8587
|
+
updateLabels: xf,
|
|
8588
|
+
findLabels: kc,
|
|
8609
8589
|
findFilters: Qi,
|
|
8610
8590
|
addFilters: ra,
|
|
8611
|
-
updateFilters:
|
|
8612
|
-
findActivity:
|
|
8613
|
-
getProductivityStats:
|
|
8614
|
-
getProjectHealth:
|
|
8615
|
-
getProjectActivityStats:
|
|
8616
|
-
analyzeProjectHealth:
|
|
8617
|
-
getWorkspaceInsights:
|
|
8618
|
-
getOverview:
|
|
8619
|
-
deleteObject:
|
|
8620
|
-
fetchObject:
|
|
8621
|
-
reorderObjects:
|
|
8622
|
-
userInfo:
|
|
8623
|
-
getUserStatus:
|
|
8624
|
-
setUserStatus:
|
|
8625
|
-
findProjectCollaborators:
|
|
8626
|
-
manageAssignments:
|
|
8627
|
-
exportProject:
|
|
8628
|
-
importIntoProject:
|
|
8629
|
-
addTemplate:
|
|
8630
|
-
findTemplates:
|
|
8631
|
-
updateTemplate:
|
|
8632
|
-
listWorkspaces:
|
|
8633
|
-
search:
|
|
8634
|
-
fetch:
|
|
8635
|
-
},
|
|
8636
|
-
function
|
|
8591
|
+
updateFilters: of,
|
|
8592
|
+
findActivity: Ks,
|
|
8593
|
+
getProductivityStats: ou,
|
|
8594
|
+
getProjectHealth: hu,
|
|
8595
|
+
getProjectActivityStats: du,
|
|
8596
|
+
analyzeProjectHealth: $o,
|
|
8597
|
+
getWorkspaceInsights: Eu,
|
|
8598
|
+
getOverview: tu,
|
|
8599
|
+
deleteObject: ys,
|
|
8600
|
+
fetchObject: Ls,
|
|
8601
|
+
reorderObjects: fd,
|
|
8602
|
+
userInfo: Pp,
|
|
8603
|
+
getUserStatus: Su,
|
|
8604
|
+
setUserStatus: Gd,
|
|
8605
|
+
findProjectCollaborators: Ic,
|
|
8606
|
+
manageAssignments: Wu,
|
|
8607
|
+
exportProject: ws,
|
|
8608
|
+
importIntoProject: Mu,
|
|
8609
|
+
addTemplate: Ko,
|
|
8610
|
+
findTemplates: zl,
|
|
8611
|
+
updateTemplate: xp,
|
|
8612
|
+
listWorkspaces: Lu,
|
|
8613
|
+
search: Pd,
|
|
8614
|
+
fetch: Vs
|
|
8615
|
+
}, Kp = Object.values(Gp), qp = "\n## Todoist\n\nManage Todoist: tasks (priorities, dates, durations, assignees, labels); projects, sections and folders, personal or in workspaces; comments and attachments, filters, reminders, templates, collaborators, user status, activity, overviews and productivity stats.\n\n**Dates**\n\n- To move a task to a different date or time use **reschedule-tasks**, never **update-tasks**. It also sets duration, for time-blocking. update-tasks replaces the whole due string, so it refuses a dueString on a recurring task unless replaceRecurrence is true.\n- Never send a task's existing projectId, sectionId or parentId back to **update-tasks** — those fields are treated as a move.\n- All dates respect the user's timezone.\n- Todoist apps hide durations of 24 hours or more (\"36h\", \"3d\"): only set one when the user explicitly asks for it.\n\n**Finding things**\n\n- For \"what did I complete?\", call **user-info** for the asker's user ID, then **find-activity** with objectType=\"task\", eventType=\"completed\", initiatorId, and dateFrom/dateTo. Without initiatorId the answer covers every collaborator. find-activity reports completion events, including each occurrence of a recurring task; **find-completed-tasks** lists completed tasks, which is not the same question.\n- To resolve a person's name or email to a user ID, or to answer \"who is X?\", use **find-project-collaborators** with just a searchTerm. It covers every shared project you can access plus yourself, so an empty result means they share none of them, not that they do not exist.\n- Before assigning work, call **find-project-collaborators** again with the target projectId: an ID only proves they share *some* project with you, and assignment needs that one.\n- To check whether a task has subtasks, use **fetch-object** with includeChildren, not a speculative **find-tasks**.\n- Filter tasks by label **name**. Label IDs are only for **delete-object** and **update-labels**. Shared labels can be renamed but not recoloured, reordered or favourited.\n\n**Comments**\n\n- Comments notify only the people **add-comments** is handed. When a comment mentions someone, name them in `notifyUsers` — writing \"@Ana\" in the text notifies nobody. Omit `notifyUsers` to notify whoever the Todoist apps would, or pass `[\"none\"]` to stay silent.\n- Editing a comment cannot notify anyone; only adding one can.\n\n**Deleting and archiving**\n\n- **delete-object** removes every object type, \"reminder\" and \"location_reminder\" included; there is no per-type delete tool.\n- A workspace project must be archived with **project-management** before it can be deleted. A personal project can be deleted directly.\n\n**Templates**\n\n- Use **find-templates** when the user names a template without its ID or URL. Start a project from one with **add-projects** and its templateId, or add one to an existing project with **import-into-project**; both write immediately and cannot be undone.\n- **add-template** saves a reusable template from a project (\"Save as template\"), CSV or scratch; **export-project** returns a CSV instead. Edit, move or share a saved template with **update-template**; to change its layout, sections or tasks, read it with **fetch-object** first, then send the edited content to **update-template**.\n\n**Project health**\n\n- Health data may be stale: if isStale is true, call **analyze-project-health** to refresh it before reading again.\n\n**Batches**\n\n- Prefer a batch tool over one call per item.\n- Per-item `failures` from a batch tool don't undo the rest: never retry the whole batch, re-send only the failed items whose reason is fixable.\n\nFor a productivity review, call **get-productivity-stats**, then find what the user completed as described under \"Finding things\".\n\n**Other Todoist apps**\n\n- Todoist Automations (workflows on a schedule or trigger, such as a new project, that can ask the user questions; Pro and Business plans) and Comms (team chat) are separate MCP servers on the same Todoist account: https://ai.todoist.net/mcp/automations and https://ai.todoist.net/mcp/comms. Never say one has no MCP support: tell the user they can add it.\n", Jp = "The official Todoist MCP server. Add, update, schedule, complete and search tasks, with priorities, due dates, deadlines, durations, labels and assignees. Organise projects, sections and folders, personal or in a workspace. Add, edit and read comments and view their attachments, and manage labels, saved filters, reminders and templates. Find collaborators, check or set your status, and review activity, project health and productivity stats.";
|
|
8616
|
+
function Yp({ token: e, baseUrl: n, features: r = [] }) {
|
|
8637
8617
|
let i = new t({
|
|
8638
8618
|
name: "todoist-mcp-server",
|
|
8639
8619
|
version: zt,
|
|
8640
|
-
description:
|
|
8620
|
+
description: Jp
|
|
8641
8621
|
}, {
|
|
8642
8622
|
capabilities: {
|
|
8643
8623
|
tools: { listChanged: !0 },
|
|
8644
8624
|
prompts: { listChanged: !0 }
|
|
8645
8625
|
},
|
|
8646
|
-
instructions:
|
|
8626
|
+
instructions: qp,
|
|
8647
8627
|
cacheHints: {
|
|
8648
8628
|
"server/discover": ye,
|
|
8649
8629
|
"tools/list": ye,
|
|
@@ -8653,7 +8633,7 @@ function Zp({ token: e, baseUrl: n, features: r = [] }) {
|
|
|
8653
8633
|
}
|
|
8654
8634
|
}), a = rn(e, { baseUrl: n });
|
|
8655
8635
|
return Ie(i), On({
|
|
8656
|
-
tools:
|
|
8636
|
+
tools: Kp,
|
|
8657
8637
|
server: i,
|
|
8658
8638
|
client: a,
|
|
8659
8639
|
features: r
|
|
@@ -8663,4 +8643,4 @@ function Zp({ token: e, baseUrl: n, features: r = [] }) {
|
|
|
8663
8643
|
argsSchema: Jn.argsSchema
|
|
8664
8644
|
}, (e) => Jn.callback(e, a)), i;
|
|
8665
8645
|
}
|
|
8666
|
-
export { Pa as $,
|
|
8646
|
+
export { Pa as $, tu as A, gc as B, Lu as C, hu as D, Su as E, nl as F, ws as G, Ks as H, Jc as I, $o as J, ys as K, Ic as L, jl as M, vl as N, du as O, ll as P, so as Q, kc as R, Wu as S, Eu as T, Vs as U, rc as V, Ls as W, xo as X, Ko as Y, po as Z, Pd as _, Pp as a, yn as at, ed as b, Vf as c, xf as d, va as et, pf as f, Gd as g, Jd as h, Wp as i, Ui as it, zl as j, ou as k, Lf as l, ef as m, Kp as n, ra as nt, xp as o, qt as ot, of as p, ns as q, Gp as r, Qi as rt, op as s, en as st, Yp as t, pa as tt, Of as u, Ed as v, Mu as w, Xu as x, fd as y, wc as z };
|