@todoist/mcp 17.3.9 → 17.3.10
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.js +3 -3
- package/dist/main-http.js +2 -2
- package/dist/main.js +1 -1
- package/dist/{mcp-server-Ci7ZsOc9.js → mcp-server-C-rRrxdI.js} +670 -635
- package/dist/{require-valid-todoist-token-Da2KnaWY.js → require-valid-todoist-token-CI1b833m.js} +1 -1
- package/dist/tools/find-activity.d.ts +2 -1
- package/dist/tools/find-activity.d.ts.map +1 -1
- package/dist/tools/user-info.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -172,10 +172,10 @@ const os = 'A due string must name one specific date or recurrence, such as "tom
|
|
|
172
172
|
INVALID_DATE: `Todoist could not parse a date in this request. ${os} Where a field asks for YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS, send exactly that, not words such as "today". Change only the date and retry.`,
|
|
173
173
|
MAX_ITEMS_LIMIT_REACHED: "This project has reached the maximum number of active tasks per project (subtasks count toward it; completed tasks do not). The cap is the same on every Todoist plan — upgrading will not raise it — and it is not an authentication or permission problem. Complete, delete, or move existing tasks out of the project, or add the task to a different project, then retry.",
|
|
174
174
|
USER_CANNOT_VIEW_TEMPLATE: "This template exists but belongs to another account. Personal templates are private to whoever saved them, and a link to one cannot be used by anyone else. Use a public gallery template instead, or ask the owner to export it with export-project-template and share the CSV."
|
|
175
|
-
},
|
|
175
|
+
}, Ur = {
|
|
176
176
|
PREMIUM_ONLY: "The user's Todoist plan does not include a feature this item used. It is not an authentication or permission problem, and retrying the same item will not help. On a task it is most often a deadline on a free plan: retry without `deadlineDate`. Tell the user what was left out and that it needs a plan upgrade."
|
|
177
177
|
};
|
|
178
|
-
function
|
|
178
|
+
function Rr(...e) {
|
|
179
179
|
for (const t of e) {
|
|
180
180
|
if (!t)
|
|
181
181
|
continue;
|
|
@@ -188,7 +188,7 @@ function Ur(...e) {
|
|
|
188
188
|
}
|
|
189
189
|
function ss(e) {
|
|
190
190
|
const t = e.tag?.toUpperCase();
|
|
191
|
-
return t && ze[t] ? t :
|
|
191
|
+
return t && ze[t] ? t : Rr(...e.rawText ?? [], e.message, e.details);
|
|
192
192
|
}
|
|
193
193
|
function Nr(e) {
|
|
194
194
|
const t = ss(e);
|
|
@@ -294,7 +294,7 @@ function as(e) {
|
|
|
294
294
|
const t = At(e);
|
|
295
295
|
if (!t)
|
|
296
296
|
return { summary: ns(e) };
|
|
297
|
-
const o = rs(t), r = t.message && !(o.length > 0 && pt(t.message)) ? t.message : "Todoist API request failed", n = o.length > 0 ? `${r} (${o.join(", ")})` : r, a = ss(t), i = a ?
|
|
297
|
+
const o = rs(t), r = t.message && !(o.length > 0 && pt(t.message)) ? t.message : "Todoist API request failed", n = o.length > 0 ? `${r} (${o.join(", ")})` : r, a = ss(t), i = a ? Ur[a] ?? ze[a] : void 0;
|
|
298
298
|
return a && i ? { summary: n, hint: { tag: a, text: i } } : { summary: n };
|
|
299
299
|
}
|
|
300
300
|
function Fr(e, {
|
|
@@ -316,7 +316,7 @@ function Hr(e) {
|
|
|
316
316
|
const t = At(e);
|
|
317
317
|
return t ? Mr(t) : ns(e);
|
|
318
318
|
}
|
|
319
|
-
const Wr = "17.3.
|
|
319
|
+
const Wr = "17.3.10", Br = {
|
|
320
320
|
version: Wr
|
|
321
321
|
}, xt = 3600 * 1e3, Kr = 365 * 24 * xt, $ = {
|
|
322
322
|
/** Default limit for task listings */
|
|
@@ -641,7 +641,7 @@ async function hs(e, t) {
|
|
|
641
641
|
const o = await hn();
|
|
642
642
|
return o ? (t.dispatcher = o.dispatcher, o.fetch ?? e) : e;
|
|
643
643
|
}
|
|
644
|
-
async function
|
|
644
|
+
async function Ih(e, t) {
|
|
645
645
|
const o = { ...t };
|
|
646
646
|
return (await hs(globalThis.fetch, o))(e, o);
|
|
647
647
|
}
|
|
@@ -803,7 +803,7 @@ const y = {
|
|
|
803
803
|
// OpenAI MCP tools
|
|
804
804
|
SEARCH: "search",
|
|
805
805
|
FETCH: "fetch"
|
|
806
|
-
},
|
|
806
|
+
}, vh = {
|
|
807
807
|
/**
|
|
808
808
|
* Strips email addresses from tool outputs that expose user data.
|
|
809
809
|
* Affects: find-project-collaborators, find-completed-tasks
|
|
@@ -870,13 +870,13 @@ function _n({
|
|
|
870
870
|
const uo = qo(br(import.meta.url)), Pn = [
|
|
871
871
|
ct(uo, "task-list", "index.html"),
|
|
872
872
|
ct(uo, "mcp-apps", "index.html")
|
|
873
|
-
],
|
|
873
|
+
], Un = `<!doctype html>
|
|
874
874
|
<html>
|
|
875
875
|
<body>
|
|
876
876
|
<p>Task list app is missing. Run "npm run build" to generate it.</p>
|
|
877
877
|
</body>
|
|
878
878
|
</html>`;
|
|
879
|
-
function
|
|
879
|
+
function Rn() {
|
|
880
880
|
const e = [];
|
|
881
881
|
for (const t of Pn)
|
|
882
882
|
try {
|
|
@@ -884,9 +884,9 @@ function Un() {
|
|
|
884
884
|
} catch (o) {
|
|
885
885
|
e.push(o);
|
|
886
886
|
}
|
|
887
|
-
return console.error("Failed to load task list app HTML from any known path:", e),
|
|
887
|
+
return console.error("Failed to load task list app HTML from any known path:", e), Un;
|
|
888
888
|
}
|
|
889
|
-
const ms =
|
|
889
|
+
const ms = Rn(), Nn = zo("sha256").update(ms).digest("hex").slice(0, 12), ft = `ui://todoist/task-list@${Nn}`, Ln = "ui://todoist/task-list@{hash}", bt = "Interactive task list widget", Mn = "https://ai.todoist.net", gt = {
|
|
890
890
|
ui: {
|
|
891
891
|
prefersBorder: !0,
|
|
892
892
|
csp: {
|
|
@@ -1077,22 +1077,22 @@ const Ae = {
|
|
|
1077
1077
|
argsSchema: Bn,
|
|
1078
1078
|
callback: Gn
|
|
1079
1079
|
}, fs = 'The duration of the task. Use format: "2h" (hours), "90m" (minutes), "2h30m" (combined), "1.5h" (decimal hours), or "3d" (whole days; days cannot be combined with hours or minutes). Todoist apps only display durations under 24 hours: a longer or day-based duration is stored and reported by this server, but the apps show the task as having no duration.', bs = 'Use format like "2h", "30m", "2h30m", "1.5h", or "3d"';
|
|
1080
|
-
class
|
|
1080
|
+
class R extends Error {
|
|
1081
1081
|
constructor(t, o) {
|
|
1082
1082
|
super(`Invalid duration format "${t}": ${o}`), this.name = "DurationParseError";
|
|
1083
1083
|
}
|
|
1084
1084
|
}
|
|
1085
1085
|
function Yn(e) {
|
|
1086
1086
|
if (!e || typeof e != "string")
|
|
1087
|
-
throw new
|
|
1087
|
+
throw new R(e, "Duration must be a non-empty string");
|
|
1088
1088
|
const t = e.trim().toLowerCase().replace(/\s+/g, "");
|
|
1089
1089
|
if (!t)
|
|
1090
|
-
throw new
|
|
1090
|
+
throw new R(e, "Duration must be a non-empty string");
|
|
1091
1091
|
const o = t.match(/^(\d+(?:\.\d+)?)d$/)?.[1];
|
|
1092
1092
|
if (o !== void 0)
|
|
1093
1093
|
return { amount: Jn(e, o), unit: "day" };
|
|
1094
1094
|
if (Vn(t))
|
|
1095
|
-
throw new
|
|
1095
|
+
throw new R(
|
|
1096
1096
|
e,
|
|
1097
1097
|
`${bs} (days cannot be combined with hours or minutes)`
|
|
1098
1098
|
);
|
|
@@ -1105,51 +1105,51 @@ const yt = "Duration is too large";
|
|
|
1105
1105
|
function Jn(e, t) {
|
|
1106
1106
|
const o = Number.parseFloat(t);
|
|
1107
1107
|
if (Number.isNaN(o) || o < 0)
|
|
1108
|
-
throw new
|
|
1108
|
+
throw new R(e, "Days must be a positive number");
|
|
1109
1109
|
if (!Number.isFinite(o))
|
|
1110
|
-
throw new
|
|
1110
|
+
throw new R(e, yt);
|
|
1111
1111
|
if (o % 1 !== 0)
|
|
1112
|
-
throw new
|
|
1112
|
+
throw new R(e, "Days must be a whole number");
|
|
1113
1113
|
if (o === 0)
|
|
1114
|
-
throw new
|
|
1114
|
+
throw new R(e, "Duration must be at least 1 day");
|
|
1115
1115
|
return o;
|
|
1116
1116
|
}
|
|
1117
1117
|
function Xn(e, t) {
|
|
1118
1118
|
const o = t.match(/^(?:(\d+(?:\.\d+)?)h)?(?:(\d+(?:\.\d+)?)m)?$/);
|
|
1119
1119
|
if (!o || !o[1] && !o[2])
|
|
1120
|
-
throw new
|
|
1120
|
+
throw new R(e, bs);
|
|
1121
1121
|
let r = 0;
|
|
1122
1122
|
const [, n, a] = o;
|
|
1123
1123
|
if (n) {
|
|
1124
1124
|
const i = Number.parseFloat(n);
|
|
1125
1125
|
if (Number.isNaN(i) || i < 0)
|
|
1126
|
-
throw new
|
|
1126
|
+
throw new R(e, "Hours must be a positive number");
|
|
1127
1127
|
r += i * 60;
|
|
1128
1128
|
}
|
|
1129
1129
|
if (a) {
|
|
1130
1130
|
const i = Number.parseFloat(a);
|
|
1131
1131
|
if (Number.isNaN(i) || i < 0)
|
|
1132
|
-
throw new
|
|
1132
|
+
throw new R(e, "Minutes must be a positive number");
|
|
1133
1133
|
if (!Number.isFinite(i))
|
|
1134
|
-
throw new
|
|
1134
|
+
throw new R(e, yt);
|
|
1135
1135
|
if (i % 1 !== 0)
|
|
1136
|
-
throw new
|
|
1136
|
+
throw new R(
|
|
1137
1137
|
e,
|
|
1138
1138
|
"Minutes must be a whole number (use decimal hours instead)"
|
|
1139
1139
|
);
|
|
1140
1140
|
r += i;
|
|
1141
1141
|
}
|
|
1142
1142
|
if (r = Math.round(r), !Number.isFinite(r))
|
|
1143
|
-
throw new
|
|
1143
|
+
throw new R(e, yt);
|
|
1144
1144
|
if (r === 0)
|
|
1145
|
-
throw new
|
|
1145
|
+
throw new R(e, "Duration must be greater than 0 minutes");
|
|
1146
1146
|
return r;
|
|
1147
1147
|
}
|
|
1148
|
-
function
|
|
1148
|
+
function Ut(e, t) {
|
|
1149
1149
|
try {
|
|
1150
1150
|
return Yn(t);
|
|
1151
1151
|
} catch (o) {
|
|
1152
|
-
throw o instanceof
|
|
1152
|
+
throw o instanceof R ? new Error(`${e}: ${o.message}`) : o;
|
|
1153
1153
|
}
|
|
1154
1154
|
}
|
|
1155
1155
|
function Zn(e, t = "minute") {
|
|
@@ -1159,7 +1159,7 @@ function Zn(e, t = "minute") {
|
|
|
1159
1159
|
const o = Math.floor(e / 60), r = e % 60;
|
|
1160
1160
|
return o === 0 ? `${r}m` : r === 0 ? `${o}h` : `${o}h${r}m`;
|
|
1161
1161
|
}
|
|
1162
|
-
const Qn = ["p1", "p2", "p3", "p4"],
|
|
1162
|
+
const Qn = ["p1", "p2", "p3", "p4"], Rt = 'Task priority as a string: "p1" (highest), "p2" (high), "p3" (medium), or "p4" (lowest/default). Integers like 1, 2, 3, or 4 are not accepted.', Nt = s.enum(Qn).describe(Rt);
|
|
1163
1163
|
function gs(e) {
|
|
1164
1164
|
return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
|
|
1165
1165
|
}
|
|
@@ -1978,7 +1978,7 @@ ${i.slice(0, _e.MAX_FAILURES_SHOWN).map((p) => ` ${p.item} (Error: ${p.error}
|
|
|
1978
1978
|
return c.join(`
|
|
1979
1979
|
`);
|
|
1980
1980
|
}
|
|
1981
|
-
function
|
|
1981
|
+
function U(e, t) {
|
|
1982
1982
|
if (t.length === 0)
|
|
1983
1983
|
return e;
|
|
1984
1984
|
const o = t.slice(0, _e.MAX_FAILURES_SHOWN), r = t.length - o.length, n = o.map((i) => ` ${i.item}: ${i.error}`).join(`
|
|
@@ -2112,7 +2112,7 @@ const $a = s.object({
|
|
|
2112
2112
|
getCurrentUser: n
|
|
2113
2113
|
});
|
|
2114
2114
|
return {
|
|
2115
|
-
textContent:
|
|
2115
|
+
textContent: U(
|
|
2116
2116
|
_a({ comments: h, notifiedNames: m }),
|
|
2117
2117
|
f
|
|
2118
2118
|
),
|
|
@@ -2204,7 +2204,7 @@ async function V(e, t, { limit: o = (r) => r() } = {}) {
|
|
|
2204
2204
|
function Ds(e) {
|
|
2205
2205
|
return e.description || void 0;
|
|
2206
2206
|
}
|
|
2207
|
-
const
|
|
2207
|
+
const Ua = {
|
|
2208
2208
|
search: s.string().optional().describe(
|
|
2209
2209
|
"Search for a filter by name (partial and case insensitive match). If omitted, all filters are returned."
|
|
2210
2210
|
)
|
|
@@ -2218,14 +2218,14 @@ const Ra = {
|
|
|
2218
2218
|
color: $e,
|
|
2219
2219
|
isFavorite: s.boolean().describe("Whether the filter is marked as favorite."),
|
|
2220
2220
|
itemOrder: s.number().describe("The display order of the filter.")
|
|
2221
|
-
}),
|
|
2221
|
+
}), Ra = {
|
|
2222
2222
|
filters: s.array(Gt).describe("The found filters."),
|
|
2223
2223
|
totalCount: s.number().describe("The total number of filters returned.")
|
|
2224
2224
|
}, Na = {
|
|
2225
2225
|
name: y.FIND_FILTERS,
|
|
2226
2226
|
description: 'List all personal filters or search for filters by name. Filters are saved custom views that use query syntax to organize tasks (e.g. "today & p1", "#Work & overdue").',
|
|
2227
|
-
parameters:
|
|
2228
|
-
outputSchema:
|
|
2227
|
+
parameters: Ua,
|
|
2228
|
+
outputSchema: Ra,
|
|
2229
2229
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2230
2230
|
async execute(e, t) {
|
|
2231
2231
|
let r = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((i) => !i.isDeleted);
|
|
@@ -2335,7 +2335,7 @@ const Ma = s.object({
|
|
|
2335
2335
|
`), h = p > 0 ? `Added ${p} filter${p === 1 ? "" : "s"}:
|
|
2336
2336
|
${f}` : "Added 0 filters";
|
|
2337
2337
|
return {
|
|
2338
|
-
textContent:
|
|
2338
|
+
textContent: U(h, u),
|
|
2339
2339
|
structuredContent: {
|
|
2340
2340
|
filters: l,
|
|
2341
2341
|
totalCount: l.length,
|
|
@@ -2421,7 +2421,7 @@ ${l}` + (d.length > 5 ? `
|
|
|
2421
2421
|
this.stateByClient = /* @__PURE__ */ new WeakMap();
|
|
2422
2422
|
}
|
|
2423
2423
|
}
|
|
2424
|
-
const
|
|
2424
|
+
const Ue = new za(), { ADD_PROJECTS: qa, LIST_WORKSPACES: Ga, UPDATE_PROJECTS: Ya } = y, Va = s.object({
|
|
2425
2425
|
name: s.string().min(1).describe("The name of the folder."),
|
|
2426
2426
|
workspace: s.string().trim().min(1).describe(`The workspace to create the folder in, by name or ID (see ${Ga}).`)
|
|
2427
2427
|
}), Ja = {
|
|
@@ -2441,7 +2441,7 @@ const Re = new za(), { ADD_PROJECTS: qa, LIST_WORKSPACES: Ga, UPDATE_PROJECTS: Y
|
|
|
2441
2441
|
const o = /* @__PURE__ */ new Map(), r = (d) => {
|
|
2442
2442
|
let u = o.get(d);
|
|
2443
2443
|
return u || (u = j(
|
|
2444
|
-
() =>
|
|
2444
|
+
() => Ue.resolveWorkspace(t, d)
|
|
2445
2445
|
).then(({ workspaceId: l }) => l), o.set(d, u)), u;
|
|
2446
2446
|
}, n = await Promise.allSettled(
|
|
2447
2447
|
e.map(async ({ name: d, workspace: u }) => {
|
|
@@ -2466,7 +2466,7 @@ function Qa(e, t) {
|
|
|
2466
2466
|
), n = o > 0 ? `Added ${o} folder${o === 1 ? "" : "s"}:
|
|
2467
2467
|
${r.join(`
|
|
2468
2468
|
`)}` : "Added 0 folders";
|
|
2469
|
-
return
|
|
2469
|
+
return U(n, t);
|
|
2470
2470
|
}
|
|
2471
2471
|
const ei = s.object({
|
|
2472
2472
|
name: s.string().min(1).max(128).describe("The name of the label."),
|
|
@@ -2512,7 +2512,7 @@ function ri({
|
|
|
2512
2512
|
const o = e.length, r = e.map((a) => `• ${a.name} (id=${a.id})`).join(`
|
|
2513
2513
|
`), n = o > 0 ? `Added ${o} label${o === 1 ? "" : "s"}:
|
|
2514
2514
|
${r}` : "Added 0 labels";
|
|
2515
|
-
return
|
|
2515
|
+
return U(n, t);
|
|
2516
2516
|
}
|
|
2517
2517
|
async function Yt(e, t) {
|
|
2518
2518
|
try {
|
|
@@ -2570,7 +2570,7 @@ const { FIND_FOLDERS: ni } = y, ai = s.object({
|
|
|
2570
2570
|
return Promise.resolve(void 0);
|
|
2571
2571
|
let w = o.get(g);
|
|
2572
2572
|
return w || (w = j(
|
|
2573
|
-
() =>
|
|
2573
|
+
() => Ue.resolveWorkspace(t, g)
|
|
2574
2574
|
).then(({ workspaceId: I }) => I), o.set(g, w)), w;
|
|
2575
2575
|
}, i = (g) => {
|
|
2576
2576
|
let w = r.get(g);
|
|
@@ -2709,7 +2709,7 @@ function mi({
|
|
|
2709
2709
|
const o = e.length, r = e.map((a) => `• ${a.name} (id=${a.id})`).join(`
|
|
2710
2710
|
`), n = o > 0 ? `Added ${o} project${o === 1 ? "" : "s"}:
|
|
2711
2711
|
${r}` : "Added 0 projects";
|
|
2712
|
-
return
|
|
2712
|
+
return U(n, t);
|
|
2713
2713
|
}
|
|
2714
2714
|
async function xs(e, t) {
|
|
2715
2715
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2746,10 +2746,10 @@ const Be = 25, Je = s.enum(Cr), _s = s.object({
|
|
|
2746
2746
|
string: s.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
|
|
2747
2747
|
timezone: s.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
|
|
2748
2748
|
lang: s.string().optional().describe('Language for parsing the due string, e.g. "en".')
|
|
2749
|
-
}), Ps = s.enum(Yo), Xe = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."),
|
|
2750
|
-
`${
|
|
2749
|
+
}), Ps = s.enum(Yo), Xe = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), Us = `Who to remind: user ID, email, name, or "me". Must collaborate on the task's project.`, Jt = H(
|
|
2750
|
+
`${Us} Defaults to the creator.`
|
|
2751
2751
|
), Xt = H(
|
|
2752
|
-
`${
|
|
2752
|
+
`${Us} Omit to keep the current one.`
|
|
2753
2753
|
), fi = s.object({
|
|
2754
2754
|
type: s.literal("relative"),
|
|
2755
2755
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
@@ -2864,7 +2864,7 @@ const Be = 25, Je = s.enum(Cr), _s = s.object({
|
|
|
2864
2864
|
return p?.status === "fulfilled" ? p.value : void 0;
|
|
2865
2865
|
});
|
|
2866
2866
|
return O(y.ADD_REMINDERS, o.length, i), {
|
|
2867
|
-
textContent:
|
|
2867
|
+
textContent: U(
|
|
2868
2868
|
[
|
|
2869
2869
|
Ii(c),
|
|
2870
2870
|
...Os(c, d)
|
|
@@ -2952,7 +2952,7 @@ function $i({
|
|
|
2952
2952
|
const o = e.length, r = e.map((a) => `• ${a.name} (id=${a.id}, projectId=${a.projectId})`).join(`
|
|
2953
2953
|
`), n = o > 0 ? `Added ${o} section${o === 1 ? "" : "s"}:
|
|
2954
2954
|
${r}` : "Added 0 sections";
|
|
2955
|
-
return
|
|
2955
|
+
return U(n, t);
|
|
2956
2956
|
}
|
|
2957
2957
|
const Te = {
|
|
2958
2958
|
USER_NOT_FOUND: "USER_NOT_FOUND",
|
|
@@ -3176,7 +3176,7 @@ const Zt = new Ei(), wo = D.TASK_CREATES_PER_OPERATION, Ai = s.object({
|
|
|
3176
3176
|
description: H(
|
|
3177
3177
|
"Additional details, notes, or context for the task. Use this for longer content rather than putting it in the task name. Supports Markdown."
|
|
3178
3178
|
),
|
|
3179
|
-
priority: Nt.optional().describe(
|
|
3179
|
+
priority: Nt.optional().describe(Rt),
|
|
3180
3180
|
dueString: H(
|
|
3181
3181
|
'The due date for the task, in natural language. Also use natural language for recurrences; do not prefix it with "recurring".'
|
|
3182
3182
|
),
|
|
@@ -3222,7 +3222,7 @@ const Zt = new Ei(), wo = D.TASK_CREATES_PER_OPERATION, Ai = s.object({
|
|
|
3222
3222
|
const { tasks: o } = s.object(To).parse(e), r = Oi(t), n = await Promise.allSettled(o.map((h) => _i(h, r))), a = n.flatMap((h, m) => {
|
|
3223
3223
|
const b = o[m];
|
|
3224
3224
|
return h.status === "fulfilled" && b ? [{ index: m, task: b, ...h.value }] : [];
|
|
3225
|
-
}), i = await
|
|
3225
|
+
}), i = await Ui(t, a), c = n.map(
|
|
3226
3226
|
(h, m) => h.status === "rejected" ? h : i.get(m) ?? {
|
|
3227
3227
|
status: "rejected",
|
|
3228
3228
|
reason: new Error("Todoist did not report whether this task was created")
|
|
@@ -3296,7 +3296,7 @@ async function _i(e, t) {
|
|
|
3296
3296
|
throw new Error(
|
|
3297
3297
|
`Task "${o}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
|
|
3298
3298
|
);
|
|
3299
|
-
const g = n ?
|
|
3299
|
+
const g = n ? Ut(`Task "${o}"`, n) : void 0;
|
|
3300
3300
|
let w;
|
|
3301
3301
|
u && (w = await Pi(e, t, b));
|
|
3302
3302
|
const I = Ce();
|
|
@@ -3346,7 +3346,7 @@ async function Pi(e, t, o) {
|
|
|
3346
3346
|
}
|
|
3347
3347
|
return d.resolvedUser?.userId;
|
|
3348
3348
|
}
|
|
3349
|
-
async function
|
|
3349
|
+
async function Ui(e, t) {
|
|
3350
3350
|
const o = /* @__PURE__ */ new Map();
|
|
3351
3351
|
if (t.length === 0)
|
|
3352
3352
|
return o;
|
|
@@ -3361,7 +3361,7 @@ async function Ri(e, t) {
|
|
|
3361
3361
|
status: "rejected",
|
|
3362
3362
|
// Only Todoist's answer about this task's own command can blame its
|
|
3363
3363
|
// due string; a failed request says nothing about any one task.
|
|
3364
|
-
reason: a ? h?.reason :
|
|
3364
|
+
reason: a ? h?.reason : Ri(h?.reason, l)
|
|
3365
3365
|
});
|
|
3366
3366
|
return;
|
|
3367
3367
|
}
|
|
@@ -3407,7 +3407,7 @@ async function Ri(e, t) {
|
|
|
3407
3407
|
}
|
|
3408
3408
|
return o;
|
|
3409
3409
|
}
|
|
3410
|
-
function
|
|
3410
|
+
function Ri(e, t) {
|
|
3411
3411
|
const o = Fr(e, {
|
|
3412
3412
|
taskContent: t.content,
|
|
3413
3413
|
dueString: t.dueString,
|
|
@@ -3598,7 +3598,7 @@ function Yi({
|
|
|
3598
3598
|
failures: t
|
|
3599
3599
|
});
|
|
3600
3600
|
}
|
|
3601
|
-
const
|
|
3601
|
+
const Rs = [
|
|
3602
3602
|
"project",
|
|
3603
3603
|
"section",
|
|
3604
3604
|
"task",
|
|
@@ -3609,11 +3609,11 @@ const Us = [
|
|
|
3609
3609
|
"reminder",
|
|
3610
3610
|
"location_reminder"
|
|
3611
3611
|
], Vi = {
|
|
3612
|
-
type: s.enum(
|
|
3612
|
+
type: s.enum(Rs).describe("The type of entity to delete."),
|
|
3613
3613
|
id: s.string().min(1).describe("The ID of the entity to delete.")
|
|
3614
3614
|
}, Ji = {
|
|
3615
3615
|
deletedEntity: s.object({
|
|
3616
|
-
type: s.enum(
|
|
3616
|
+
type: s.enum(Rs).describe("The type of deleted entity."),
|
|
3617
3617
|
id: s.string().describe("The ID of the deleted entity.")
|
|
3618
3618
|
}).describe("Information about the deleted entity."),
|
|
3619
3619
|
success: s.boolean().describe("Whether the deletion was successful.")
|
|
@@ -4022,14 +4022,21 @@ const mc = {
|
|
|
4022
4022
|
cursor: p ?? null
|
|
4023
4023
|
};
|
|
4024
4024
|
o && n ? f.objectEventTypes = `${o}:${n}` : o ? f.objectEventTypes = `${o}:` : n && (f.objectEventTypes = `:${n}`), r && r !== "remove" && (f.objectId = r), a && (f.parentProjectId = a), i && (f.parentItemId = i), c && (f.initiatorId = c), d && (f.dateFrom = d), u && (f.dateTo = u);
|
|
4025
|
-
const { results: h, nextCursor: m } = await t.getActivityLogs(f), b = h.map(pa), g = await M.getUserShortNames(
|
|
4025
|
+
const { results: h, nextCursor: m } = await t.getActivityLogs(f), b = h.map(pa), g = b.length > 0 ? await wc(t) : void 0, w = Tc(g), I = await M.getUserShortNames(
|
|
4026
4026
|
t,
|
|
4027
4027
|
b.flatMap(
|
|
4028
|
-
(
|
|
4029
|
-
)
|
|
4028
|
+
(S) => S.initiatorId && S.parentProjectId ? [S.parentProjectId] : []
|
|
4029
|
+
),
|
|
4030
|
+
g?.id ?? null
|
|
4030
4031
|
);
|
|
4031
4032
|
return {
|
|
4032
|
-
textContent:
|
|
4033
|
+
textContent: kc({
|
|
4034
|
+
events: b,
|
|
4035
|
+
args: e,
|
|
4036
|
+
nextCursor: m,
|
|
4037
|
+
initiatorNames: I,
|
|
4038
|
+
timeZone: w
|
|
4039
|
+
}),
|
|
4033
4040
|
structuredContent: {
|
|
4034
4041
|
events: b,
|
|
4035
4042
|
nextCursor: m ?? void 0,
|
|
@@ -4039,77 +4046,101 @@ const mc = {
|
|
|
4039
4046
|
}
|
|
4040
4047
|
};
|
|
4041
4048
|
}
|
|
4042
|
-
};
|
|
4043
|
-
function
|
|
4049
|
+
}, gc = "UTC";
|
|
4050
|
+
function yc(e) {
|
|
4051
|
+
try {
|
|
4052
|
+
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
4053
|
+
} catch {
|
|
4054
|
+
return !1;
|
|
4055
|
+
}
|
|
4056
|
+
}
|
|
4057
|
+
async function wc(e) {
|
|
4058
|
+
try {
|
|
4059
|
+
return await j(() => e.getUser());
|
|
4060
|
+
} catch (t) {
|
|
4061
|
+
return console.error(
|
|
4062
|
+
`${y.FIND_ACTIVITY}: could not load the user's time zone, using UTC`,
|
|
4063
|
+
t
|
|
4064
|
+
), null;
|
|
4065
|
+
}
|
|
4066
|
+
}
|
|
4067
|
+
function Tc(e) {
|
|
4068
|
+
const t = e?.tzInfo?.timezone;
|
|
4069
|
+
return t && yc(t) ? t : gc;
|
|
4070
|
+
}
|
|
4071
|
+
function kc({
|
|
4044
4072
|
events: e,
|
|
4045
4073
|
args: t,
|
|
4046
4074
|
nextCursor: o,
|
|
4047
|
-
initiatorNames: r
|
|
4075
|
+
initiatorNames: r,
|
|
4076
|
+
timeZone: n
|
|
4048
4077
|
}) {
|
|
4049
|
-
let
|
|
4050
|
-
const a = [];
|
|
4051
|
-
if (t.eventType && a.push(`${t.eventType}`), t.objectType) {
|
|
4052
|
-
const d = t.objectType === "task" ? "tasks" : `${t.objectType}s`;
|
|
4053
|
-
a.push(d);
|
|
4054
|
-
}
|
|
4055
|
-
a.length > 0 && (n = `Activity: ${a.join(" ")}`);
|
|
4078
|
+
let a = "Activity events";
|
|
4056
4079
|
const i = [];
|
|
4057
|
-
|
|
4080
|
+
if (t.eventType && i.push(`${t.eventType}`), t.objectType) {
|
|
4081
|
+
const u = t.objectType === "task" ? "tasks" : `${t.objectType}s`;
|
|
4082
|
+
i.push(u);
|
|
4083
|
+
}
|
|
4084
|
+
i.length > 0 && (a = `Activity: ${i.join(" ")}`);
|
|
4058
4085
|
const c = [];
|
|
4059
|
-
|
|
4060
|
-
|
|
4086
|
+
t.objectId && c.push(`object ID: ${t.objectId}`), t.projectId && c.push(`project: ${t.projectId}`), t.taskId && c.push(`task: ${t.taskId}`), t.initiatorId && c.push(`initiator: ${t.initiatorId}`), t.dateFrom && c.push(`from: ${t.dateFrom}`), t.dateTo && c.push(`until (exclusive): ${t.dateTo}`);
|
|
4087
|
+
const d = [];
|
|
4088
|
+
return e.length === 0 && (d.push("No activity events match the specified filters"), d.push("Note: Activity logs only show recent events"), t.eventType && d.push(`Try removing the eventType filter (${t.eventType})`), t.objectType && d.push(`Try removing the objectType filter (${t.objectType})`), (t.objectId || t.projectId || t.taskId) && d.push("Verify the object ID is correct")), oe({
|
|
4089
|
+
subject: a,
|
|
4061
4090
|
count: e.length,
|
|
4062
4091
|
limit: t.limit,
|
|
4063
4092
|
nextCursor: o ?? void 0,
|
|
4064
|
-
filterHints:
|
|
4065
|
-
|
|
4093
|
+
filterHints: c,
|
|
4094
|
+
notes: e.length > 0 ? [`Times are in ${n}.`] : void 0,
|
|
4095
|
+
previewLines: Ic(
|
|
4066
4096
|
e,
|
|
4067
4097
|
r,
|
|
4098
|
+
n,
|
|
4068
4099
|
Math.min(e.length, t.limit)
|
|
4069
4100
|
),
|
|
4070
|
-
zeroReasonHints:
|
|
4101
|
+
zeroReasonHints: d
|
|
4071
4102
|
});
|
|
4072
4103
|
}
|
|
4073
|
-
function
|
|
4074
|
-
const
|
|
4104
|
+
function Ic(e, t, o, r = 10) {
|
|
4105
|
+
const a = e.slice(0, r).map((i) => vc(i, t, o)).join(`
|
|
4075
4106
|
`);
|
|
4076
|
-
if (e.length >
|
|
4077
|
-
const
|
|
4078
|
-
return `${
|
|
4079
|
-
... and ${
|
|
4107
|
+
if (e.length > r) {
|
|
4108
|
+
const i = e.length - r;
|
|
4109
|
+
return `${a}
|
|
4110
|
+
... and ${i} more event${i === 1 ? "" : "s"}`;
|
|
4080
4111
|
}
|
|
4081
|
-
return
|
|
4112
|
+
return a;
|
|
4082
4113
|
}
|
|
4083
|
-
function
|
|
4084
|
-
const
|
|
4085
|
-
let
|
|
4114
|
+
function vc(e, t, o) {
|
|
4115
|
+
const r = Sc(e.eventDate, o), n = `${e.eventType} ${e.objectType}`;
|
|
4116
|
+
let a = "";
|
|
4086
4117
|
if (e.extraData) {
|
|
4087
|
-
const
|
|
4088
|
-
|
|
4118
|
+
const u = e.extraData.content || e.extraData.name || e.extraData.last_content;
|
|
4119
|
+
u && typeof u == "string" && (a = ` • "${u.length > 50 ? `${u.substring(0, 47)}...` : u}"`);
|
|
4089
4120
|
}
|
|
4090
|
-
const
|
|
4091
|
-
let
|
|
4121
|
+
const i = e.objectId ? ` • id=${e.objectId}` : "";
|
|
4122
|
+
let c = " • system";
|
|
4092
4123
|
if (e.initiatorId) {
|
|
4093
|
-
const
|
|
4094
|
-
|
|
4124
|
+
const u = t.get(e.initiatorId);
|
|
4125
|
+
c = u ? ` • by ${u}` : ` • by=${e.initiatorId}`;
|
|
4095
4126
|
}
|
|
4096
|
-
const
|
|
4097
|
-
return ` [${
|
|
4127
|
+
const d = e.parentProjectId ? ` • project=${e.parentProjectId}` : "";
|
|
4128
|
+
return ` [${r}] ${n}${a}${i}${c}${d}`;
|
|
4098
4129
|
}
|
|
4099
|
-
function
|
|
4130
|
+
function Sc(e, t) {
|
|
4100
4131
|
try {
|
|
4101
|
-
const
|
|
4132
|
+
const o = new Date(e), r = o.toLocaleDateString("en-US", { month: "short", timeZone: t }), n = o.toLocaleDateString("en-US", { day: "numeric", timeZone: t }), a = o.toLocaleTimeString("en-US", {
|
|
4102
4133
|
hour: "2-digit",
|
|
4103
4134
|
minute: "2-digit",
|
|
4104
|
-
|
|
4105
|
-
timeZone:
|
|
4135
|
+
hourCycle: "h23",
|
|
4136
|
+
timeZone: t
|
|
4106
4137
|
});
|
|
4107
|
-
return `${
|
|
4138
|
+
return `${r} ${n}, ${a}`;
|
|
4108
4139
|
} catch {
|
|
4109
4140
|
return e;
|
|
4110
4141
|
}
|
|
4111
4142
|
}
|
|
4112
|
-
const
|
|
4143
|
+
const Cc = {
|
|
4113
4144
|
taskId: s.string().optional().describe("Find comments for a specific task."),
|
|
4114
4145
|
projectId: s.string().optional().describe(
|
|
4115
4146
|
'Find comments for a specific project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -4117,7 +4148,7 @@ const kc = {
|
|
|
4117
4148
|
commentId: s.string().optional().describe("Get a specific comment by ID."),
|
|
4118
4149
|
cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
|
|
4119
4150
|
limit: s.number().int().min(1).max($.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
|
|
4120
|
-
},
|
|
4151
|
+
}, jc = {
|
|
4121
4152
|
comments: s.array(Le).describe("The found comments."),
|
|
4122
4153
|
searchType: s.string().describe(
|
|
4123
4154
|
'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
|
|
@@ -4126,11 +4157,11 @@ const kc = {
|
|
|
4126
4157
|
hasMore: s.boolean(),
|
|
4127
4158
|
nextCursor: s.string().optional(),
|
|
4128
4159
|
totalCount: s.number().describe("The total number of comments in this page.")
|
|
4129
|
-
},
|
|
4160
|
+
}, $c = {
|
|
4130
4161
|
name: y.FIND_COMMENTS,
|
|
4131
4162
|
description: "Find comments by task, project, or get a specific comment by ID. Exactly one of taskId, projectId, or commentId must be provided.",
|
|
4132
|
-
parameters:
|
|
4133
|
-
outputSchema:
|
|
4163
|
+
parameters: Cc,
|
|
4164
|
+
outputSchema: jc,
|
|
4134
4165
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4135
4166
|
async execute(e, t) {
|
|
4136
4167
|
const o = Ge(e.cursor), r = [e.taskId, e.projectId, e.commentId].filter(Boolean);
|
|
@@ -4165,7 +4196,7 @@ const kc = {
|
|
|
4165
4196
|
throw new Error("Invalid state: no search parameter provided");
|
|
4166
4197
|
const d = c.map(Ne);
|
|
4167
4198
|
return {
|
|
4168
|
-
textContent:
|
|
4199
|
+
textContent: Ec({
|
|
4169
4200
|
comments: d,
|
|
4170
4201
|
searchType: e.commentId ? "single" : e.taskId ? "task" : "project",
|
|
4171
4202
|
searchId: e.commentId || e.taskId || e.projectId || "",
|
|
@@ -4183,7 +4214,7 @@ const kc = {
|
|
|
4183
4214
|
};
|
|
4184
4215
|
}
|
|
4185
4216
|
};
|
|
4186
|
-
function
|
|
4217
|
+
function Ec({
|
|
4187
4218
|
comments: e,
|
|
4188
4219
|
searchType: t,
|
|
4189
4220
|
searchId: o,
|
|
@@ -4224,18 +4255,18 @@ function Fs(e, t) {
|
|
|
4224
4255
|
const o = new Date(e.getTime() + t * 60 * 1e3);
|
|
4225
4256
|
return Ms(o);
|
|
4226
4257
|
}
|
|
4227
|
-
function
|
|
4258
|
+
function Re(e, t) {
|
|
4228
4259
|
const [o, r, n] = e.split("-"), a = Number(o), i = Number(r), c = Number(n);
|
|
4229
4260
|
if (!Number.isFinite(a) || !Number.isFinite(i) || !Number.isFinite(c))
|
|
4230
4261
|
throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
|
|
4231
4262
|
const d = new Date(Date.UTC(a, i - 1, c));
|
|
4232
4263
|
return d.setUTCDate(d.getUTCDate() + t), Ms(d);
|
|
4233
4264
|
}
|
|
4234
|
-
function
|
|
4265
|
+
function Ac(e) {
|
|
4235
4266
|
const t = e < 0 ? "-" : "+", o = Math.abs(e), r = String(Math.floor(o / 60)).padStart(2, "0"), n = String(o % 60).padStart(2, "0");
|
|
4236
4267
|
return `${t}${r}:${n}`;
|
|
4237
4268
|
}
|
|
4238
|
-
function
|
|
4269
|
+
function Dc(e, t) {
|
|
4239
4270
|
try {
|
|
4240
4271
|
const o = new Intl.DateTimeFormat("en-US", { timeZone: t, timeZoneName: "longOffset" }).formatToParts(e).find((r) => r.type === "timeZoneName")?.value;
|
|
4241
4272
|
return o === void 0 ? void 0 : o === "GMT" ? 0 : Ze(o.slice(3));
|
|
@@ -4251,16 +4282,16 @@ function Hs({
|
|
|
4251
4282
|
}) {
|
|
4252
4283
|
const r = (l) => `${e}T00:00:00${l}`, n = Date.parse(`${e}T00:00:00Z`);
|
|
4253
4284
|
if (!t || Number.isNaN(n)) return r(o);
|
|
4254
|
-
const a = (l) =>
|
|
4285
|
+
const a = (l) => Dc(l, t), i = a(n - 840 * st), c = a(n + 840 * st);
|
|
4255
4286
|
if (i === void 0 || c === void 0) return r(o);
|
|
4256
4287
|
const d = [.../* @__PURE__ */ new Set([i, c])].filter(
|
|
4257
4288
|
(l) => a(n - l * st) === l
|
|
4258
4289
|
), u = d.length > 0 ? Math.max(...d) : i;
|
|
4259
|
-
return r(
|
|
4290
|
+
return r(Ac(u));
|
|
4260
4291
|
}
|
|
4261
|
-
const
|
|
4292
|
+
const xc = ["and", "or"], Qt = {
|
|
4262
4293
|
labels: s.string().array().max($.FILTER_VALUES_MAX).optional().describe("The labels to filter the tasks by"),
|
|
4263
|
-
labelsOperator: s.enum(
|
|
4294
|
+
labelsOperator: s.enum(xc).optional().describe(
|
|
4264
4295
|
'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
|
|
4265
4296
|
)
|
|
4266
4297
|
};
|
|
@@ -4276,31 +4307,31 @@ function eo(e = [], t = "or") {
|
|
|
4276
4307
|
function Ke(e) {
|
|
4277
4308
|
return e.normalize("NFD").replace(new RegExp("\\p{M}", "gu"), "").toLowerCase();
|
|
4278
4309
|
}
|
|
4279
|
-
function
|
|
4310
|
+
function Oc(e, t, o = "or") {
|
|
4280
4311
|
const r = new Set(e.map(Ke)), n = t.map((a) => Ke(Qe(a)));
|
|
4281
4312
|
return o === "and" ? n.every((a) => r.has(a)) : n.some((a) => r.has(a));
|
|
4282
4313
|
}
|
|
4283
|
-
function
|
|
4314
|
+
function _c(e, t) {
|
|
4284
4315
|
const o = Ke(Qe(e)), r = new Set(t.filter((n) => Ke(n) === o));
|
|
4285
4316
|
return r.size === 1 ? [...r][0] : void 0;
|
|
4286
4317
|
}
|
|
4287
4318
|
function Ie(e, t = "or") {
|
|
4288
4319
|
return e.map((o) => `@${Qe(o)}`).join(t === "and" ? " & " : " | ");
|
|
4289
4320
|
}
|
|
4290
|
-
const { FIND_ACTIVITY: $o } = y,
|
|
4291
|
-
function
|
|
4321
|
+
const { FIND_ACTIVITY: $o } = y, Pc = 7;
|
|
4322
|
+
function Uc({
|
|
4292
4323
|
since: e,
|
|
4293
4324
|
until: t,
|
|
4294
4325
|
userGmtOffset: o,
|
|
4295
4326
|
now: r = /* @__PURE__ */ new Date()
|
|
4296
4327
|
}) {
|
|
4297
|
-
const n = Ze(o), a = Fs(r, n), i =
|
|
4328
|
+
const n = Ze(o), a = Fs(r, n), i = Pc - 1, c = t ?? (e ? Re(e, i) : a);
|
|
4298
4329
|
return {
|
|
4299
|
-
since: e ??
|
|
4330
|
+
since: e ?? Re(c, -i),
|
|
4300
4331
|
until: c
|
|
4301
4332
|
};
|
|
4302
4333
|
}
|
|
4303
|
-
const
|
|
4334
|
+
const Rc = {
|
|
4304
4335
|
getBy: s.enum(["completion", "due"]).default("completion").describe(
|
|
4305
4336
|
'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).'
|
|
4306
4337
|
),
|
|
@@ -4324,17 +4355,17 @@ const Oc = {
|
|
|
4324
4355
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
4325
4356
|
),
|
|
4326
4357
|
...Qt
|
|
4327
|
-
},
|
|
4358
|
+
}, Nc = {
|
|
4328
4359
|
tasks: s.array(te).describe("The found completed tasks."),
|
|
4329
4360
|
nextCursor: s.string().optional(),
|
|
4330
4361
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
4331
4362
|
hasMore: s.boolean(),
|
|
4332
4363
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
4333
|
-
},
|
|
4364
|
+
}, Lc = {
|
|
4334
4365
|
name: y.FIND_COMPLETED_TASKS,
|
|
4335
4366
|
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.',
|
|
4336
|
-
parameters:
|
|
4337
|
-
outputSchema:
|
|
4367
|
+
parameters: Rc,
|
|
4368
|
+
outputSchema: Nc,
|
|
4338
4369
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4339
4370
|
async execute(e, t) {
|
|
4340
4371
|
const {
|
|
@@ -4358,12 +4389,12 @@ const Oc = {
|
|
|
4358
4389
|
const g = await t.getUser(), w = g.tzInfo?.gmtString || "+00:00", I = await pe({
|
|
4359
4390
|
projectId: d,
|
|
4360
4391
|
user: g
|
|
4361
|
-
}), k =
|
|
4392
|
+
}), k = Uc({
|
|
4362
4393
|
since: a,
|
|
4363
4394
|
until: i,
|
|
4364
4395
|
userGmtOffset: w
|
|
4365
4396
|
}), S = g.tzInfo?.timezone, E = (oo) => new Date(Hs({ date: oo, timeZone: S, fallbackOffset: w })), N = E(k.since).toISOString(), T = new Date(
|
|
4366
|
-
E(
|
|
4397
|
+
E(Re(k.until, 1)).getTime() - 1e3
|
|
4367
4398
|
).toISOString(), v = {
|
|
4368
4399
|
...e,
|
|
4369
4400
|
since: k.since,
|
|
@@ -4384,7 +4415,7 @@ const Oc = {
|
|
|
4384
4415
|
...b ? { filterQuery: b, filterLang: "en" } : {}
|
|
4385
4416
|
}), L = A.map(z);
|
|
4386
4417
|
return {
|
|
4387
|
-
textContent:
|
|
4418
|
+
textContent: Mc({
|
|
4388
4419
|
tasks: L,
|
|
4389
4420
|
args: v,
|
|
4390
4421
|
userGmtOffset: w,
|
|
@@ -4403,7 +4434,7 @@ const Oc = {
|
|
|
4403
4434
|
};
|
|
4404
4435
|
}
|
|
4405
4436
|
};
|
|
4406
|
-
function
|
|
4437
|
+
function Mc({
|
|
4407
4438
|
tasks: e,
|
|
4408
4439
|
args: t,
|
|
4409
4440
|
userGmtOffset: o,
|
|
@@ -4432,52 +4463,52 @@ function Rc({
|
|
|
4432
4463
|
// completing it, so the completed-tasks endpoints never return it while the
|
|
4433
4464
|
// recurrence is active. Nothing in the response can show the gap, so say it
|
|
4434
4465
|
// on every result rather than only when the list is empty.
|
|
4435
|
-
notes: [
|
|
4466
|
+
notes: [Fc(t, o, r)],
|
|
4436
4467
|
previewLines: Ve(e, Math.min(e.length, t.limit), i),
|
|
4437
4468
|
zeroReasonHints: l
|
|
4438
4469
|
});
|
|
4439
4470
|
}
|
|
4440
|
-
function
|
|
4471
|
+
function Fc(e, t, o) {
|
|
4441
4472
|
const r = "Completions of recurring tasks that are still active are not in this list.";
|
|
4442
4473
|
if (e.getBy === "due")
|
|
4443
4474
|
return `${r} ${$o} with objectType "task" and eventType "completed" reports them, but only by completion time: it cannot match a due-date range.`;
|
|
4444
|
-
const n = (c) => Hs({ date: c, timeZone: o, fallbackOffset: t }), a = n(e.since), i = n(
|
|
4475
|
+
const n = (c) => Hs({ date: c, timeZone: o, fallbackOffset: t }), a = n(e.since), i = n(Re(e.until, 1));
|
|
4445
4476
|
return `${r} To include them, call ${$o} with objectType "task", eventType "completed", dateFrom "${a}" and dateTo "${i}".`;
|
|
4446
4477
|
}
|
|
4447
|
-
const { ADD_FOLDERS:
|
|
4478
|
+
const { ADD_FOLDERS: Hc, FIND_PROJECTS: Wc, LIST_WORKSPACES: Bc } = y, Kc = {
|
|
4448
4479
|
workspace: s.string().trim().min(1).optional().describe(
|
|
4449
|
-
`The workspace to list folders for, by name or ID (see ${
|
|
4480
|
+
`The workspace to list folders for, by name or ID (see ${Bc}). Omit to list the folders of every workspace.`
|
|
4450
4481
|
)
|
|
4451
|
-
},
|
|
4482
|
+
}, zc = {
|
|
4452
4483
|
folders: s.array(Wt).describe("In sidebar order within each workspace."),
|
|
4453
4484
|
totalCount: s.number()
|
|
4454
|
-
},
|
|
4485
|
+
}, qc = {
|
|
4455
4486
|
name: y.FIND_FOLDERS,
|
|
4456
|
-
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 ${
|
|
4457
|
-
parameters:
|
|
4458
|
-
outputSchema:
|
|
4487
|
+
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 ${Wc} with folderId.`,
|
|
4488
|
+
parameters: Kc,
|
|
4489
|
+
outputSchema: zc,
|
|
4459
4490
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4460
4491
|
async execute({ workspace: e }, t) {
|
|
4461
|
-
const o = e ? [await
|
|
4492
|
+
const o = e ? [await Ue.resolveWorkspace(t, e)] : await Ue.listWorkspaces(t), r = await Promise.all(
|
|
4462
4493
|
o.map(async (a) => ({
|
|
4463
4494
|
...a,
|
|
4464
|
-
folders: await
|
|
4495
|
+
folders: await Gc(t, a.workspaceId)
|
|
4465
4496
|
}))
|
|
4466
4497
|
), n = r.flatMap((a) => a.folders);
|
|
4467
4498
|
return {
|
|
4468
|
-
textContent:
|
|
4499
|
+
textContent: Yc(r),
|
|
4469
4500
|
structuredContent: { folders: n, totalCount: n.length }
|
|
4470
4501
|
};
|
|
4471
4502
|
}
|
|
4472
4503
|
};
|
|
4473
|
-
async function
|
|
4504
|
+
async function Gc(e, t) {
|
|
4474
4505
|
return (await F({
|
|
4475
4506
|
apiMethod: (r) => j(() => e.getFolders(r)),
|
|
4476
4507
|
args: { workspaceId: t },
|
|
4477
4508
|
limit: $.FOLDERS_MAX
|
|
4478
4509
|
})).sort((r, n) => r.defaultOrder - n.defaultOrder).map(Bt);
|
|
4479
4510
|
}
|
|
4480
|
-
function
|
|
4511
|
+
function Yc(e) {
|
|
4481
4512
|
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(
|
|
4482
4513
|
({ workspaceId: t, workspaceName: o, folders: r }) => oe({
|
|
4483
4514
|
subject: `Folders in ${o} (id=${t})`,
|
|
@@ -4486,13 +4517,13 @@ function Kc(e) {
|
|
|
4486
4517
|
`),
|
|
4487
4518
|
zeroReasonHints: [
|
|
4488
4519
|
"No folders in this workspace",
|
|
4489
|
-
`Use ${
|
|
4520
|
+
`Use ${Hc} to create one`
|
|
4490
4521
|
]
|
|
4491
4522
|
})
|
|
4492
4523
|
).join(`
|
|
4493
4524
|
`);
|
|
4494
4525
|
}
|
|
4495
|
-
const
|
|
4526
|
+
const Vc = {
|
|
4496
4527
|
searchText: s.string().optional().describe(
|
|
4497
4528
|
'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.'
|
|
4498
4529
|
),
|
|
@@ -4500,7 +4531,7 @@ const zc = {
|
|
|
4500
4531
|
cursor: s.string().optional().describe(
|
|
4501
4532
|
"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."
|
|
4502
4533
|
)
|
|
4503
|
-
},
|
|
4534
|
+
}, Jc = {
|
|
4504
4535
|
labels: s.array(Ee).describe("The found personal labels."),
|
|
4505
4536
|
nextCursor: s.string().optional(),
|
|
4506
4537
|
totalCount: s.number().describe("The total number of labels in this page."),
|
|
@@ -4509,11 +4540,11 @@ const zc = {
|
|
|
4509
4540
|
"Names of all shared labels visible to you. These have no IDs or metadata — use their names directly when filtering tasks."
|
|
4510
4541
|
),
|
|
4511
4542
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
4512
|
-
},
|
|
4543
|
+
}, Xc = {
|
|
4513
4544
|
name: y.FIND_LABELS,
|
|
4514
4545
|
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.",
|
|
4515
|
-
parameters:
|
|
4516
|
-
outputSchema:
|
|
4546
|
+
parameters: Vc,
|
|
4547
|
+
outputSchema: Jc,
|
|
4517
4548
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4518
4549
|
async execute(e, t) {
|
|
4519
4550
|
const [o, r] = await Promise.all([
|
|
@@ -4524,7 +4555,7 @@ const zc = {
|
|
|
4524
4555
|
js(t)
|
|
4525
4556
|
]), { results: n, nextCursor: a } = o, i = e.searchText ? { searchText: e.searchText } : { limit: e.limit, cursor: e.cursor };
|
|
4526
4557
|
return {
|
|
4527
|
-
textContent:
|
|
4558
|
+
textContent: Zc({ labels: n, args: e, nextCursor: a, sharedLabels: r }),
|
|
4528
4559
|
structuredContent: {
|
|
4529
4560
|
labels: n.map((c) => Ee.parse(c)),
|
|
4530
4561
|
nextCursor: a ?? void 0,
|
|
@@ -4536,7 +4567,7 @@ const zc = {
|
|
|
4536
4567
|
};
|
|
4537
4568
|
}
|
|
4538
4569
|
};
|
|
4539
|
-
function
|
|
4570
|
+
function Zc({
|
|
4540
4571
|
labels: e,
|
|
4541
4572
|
args: t,
|
|
4542
4573
|
nextCursor: o,
|
|
@@ -4561,14 +4592,14 @@ No shared labels.`;
|
|
|
4561
4592
|
zeroReasonHints: p
|
|
4562
4593
|
}) + f;
|
|
4563
4594
|
}
|
|
4564
|
-
const { FIND_PROJECTS: Ws, ADD_TASKS: Bs, UPDATE_TASKS: Ks } = y,
|
|
4595
|
+
const { FIND_PROJECTS: Ws, ADD_TASKS: Bs, UPDATE_TASKS: Ks } = y, Qc = {
|
|
4565
4596
|
projectId: s.string().min(1).optional().describe(
|
|
4566
4597
|
'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.'
|
|
4567
4598
|
),
|
|
4568
4599
|
searchTerm: s.string().optional().describe(
|
|
4569
4600
|
"Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
|
|
4570
4601
|
)
|
|
4571
|
-
},
|
|
4602
|
+
}, ed = {
|
|
4572
4603
|
collaborators: s.array(Ia).describe("The found users."),
|
|
4573
4604
|
projectInfo: s.object({
|
|
4574
4605
|
id: s.string().describe("The project ID."),
|
|
@@ -4578,16 +4609,16 @@ const { FIND_PROJECTS: Ws, ADD_TASKS: Bs, UPDATE_TASKS: Ks } = y, Vc = {
|
|
|
4578
4609
|
totalCount: s.number().describe("The total number of users found."),
|
|
4579
4610
|
totalAvailable: s.number().optional().describe("The total number of available users before the search filter was applied."),
|
|
4580
4611
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
4581
|
-
},
|
|
4612
|
+
}, td = {
|
|
4582
4613
|
name: y.FIND_PROJECT_COLLABORATORS,
|
|
4583
4614
|
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.`,
|
|
4584
|
-
parameters:
|
|
4585
|
-
outputSchema:
|
|
4615
|
+
parameters: Qc,
|
|
4616
|
+
outputSchema: ed,
|
|
4586
4617
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4587
4618
|
async execute(e, t) {
|
|
4588
4619
|
const { projectId: o, searchTerm: r } = e;
|
|
4589
4620
|
if (!o)
|
|
4590
|
-
return
|
|
4621
|
+
return od({ searchTerm: r, client: t, appliedFilters: e });
|
|
4591
4622
|
let n = o, a;
|
|
4592
4623
|
try {
|
|
4593
4624
|
if (a = await ne(t, o), !a)
|
|
@@ -4657,12 +4688,12 @@ const { FIND_PROJECTS: Ws, ADD_TASKS: Bs, UPDATE_TASKS: Ks } = y, Vc = {
|
|
|
4657
4688
|
};
|
|
4658
4689
|
}
|
|
4659
4690
|
};
|
|
4660
|
-
async function
|
|
4691
|
+
async function od({
|
|
4661
4692
|
searchTerm: e,
|
|
4662
4693
|
client: t,
|
|
4663
4694
|
appliedFilters: o
|
|
4664
4695
|
}) {
|
|
4665
|
-
const r = await M.getAllCollaborators(t), n = await
|
|
4696
|
+
const r = await M.getAllCollaborators(t), n = await sd(t, r);
|
|
4666
4697
|
if (n.length === 0)
|
|
4667
4698
|
return {
|
|
4668
4699
|
textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
|
|
@@ -4696,7 +4727,7 @@ async function Zc({
|
|
|
4696
4727
|
}
|
|
4697
4728
|
};
|
|
4698
4729
|
}
|
|
4699
|
-
async function
|
|
4730
|
+
async function sd(e, t) {
|
|
4700
4731
|
try {
|
|
4701
4732
|
const o = await e.getUser();
|
|
4702
4733
|
return !o || t.some((r) => r.id === o.id) ? t : [
|
|
@@ -4741,11 +4772,11 @@ function qs({
|
|
|
4741
4772
|
nextSteps: l
|
|
4742
4773
|
});
|
|
4743
4774
|
}
|
|
4744
|
-
const { ADD_PROJECTS: Eo, FIND_FOLDERS: Gs, PROJECT_MANAGEMENT: Ys } = y,
|
|
4775
|
+
const { ADD_PROJECTS: Eo, FIND_FOLDERS: Gs, PROJECT_MANAGEMENT: Ys } = y, rd = {
|
|
4745
4776
|
active: "projects",
|
|
4746
4777
|
archived: "archived projects",
|
|
4747
4778
|
all: "projects (active and archived)"
|
|
4748
|
-
},
|
|
4779
|
+
}, nd = {
|
|
4749
4780
|
searchText: s.string().optional().describe(
|
|
4750
4781
|
'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.'
|
|
4751
4782
|
),
|
|
@@ -4760,24 +4791,24 @@ const { ADD_PROJECTS: Eo, FIND_FOLDERS: Gs, PROJECT_MANAGEMENT: Ys } = y, ed = {
|
|
|
4760
4791
|
includeUnjoined: s.boolean().optional().describe(
|
|
4761
4792
|
`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 ${Ys} (action 'join') only when the user asks.`
|
|
4762
4793
|
)
|
|
4763
|
-
},
|
|
4794
|
+
}, ad = s.object({
|
|
4764
4795
|
id: s.string(),
|
|
4765
4796
|
name: s.string(),
|
|
4766
4797
|
workspaceId: s.string(),
|
|
4767
4798
|
url: s.string()
|
|
4768
|
-
}),
|
|
4799
|
+
}), id = {
|
|
4769
4800
|
projects: s.array(me).describe("The found projects."),
|
|
4770
4801
|
nextCursor: s.string().optional(),
|
|
4771
4802
|
totalCount: s.number().describe("The total number of projects in this page."),
|
|
4772
4803
|
hasMore: s.boolean(),
|
|
4773
4804
|
appliedFilters: s.record(s.string(), s.unknown()),
|
|
4774
|
-
unjoinedProjects: s.array(
|
|
4805
|
+
unjoinedProjects: s.array(ad).optional().describe("Up to limit. With includeUnjoined, or when a search matched no joined project."),
|
|
4775
4806
|
unjoinedHasMore: s.boolean().optional().describe("More matched than limit; narrow with searchText.")
|
|
4776
|
-
},
|
|
4807
|
+
}, cd = {
|
|
4777
4808
|
name: y.FIND_PROJECTS,
|
|
4778
4809
|
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.",
|
|
4779
|
-
parameters:
|
|
4780
|
-
outputSchema:
|
|
4810
|
+
parameters: nd,
|
|
4811
|
+
outputSchema: id,
|
|
4781
4812
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4782
4813
|
async execute(e, t) {
|
|
4783
4814
|
const { searchText: o } = e, r = e.archivedStatus ?? "active";
|
|
@@ -4801,16 +4832,16 @@ const { ADD_PROJECTS: Eo, FIND_FOLDERS: Gs, PROJECT_MANAGEMENT: Ys } = y, ed = {
|
|
|
4801
4832
|
});
|
|
4802
4833
|
n = d.results, a = d.nextCursor;
|
|
4803
4834
|
}
|
|
4804
|
-
const i = n.map(he), c = await
|
|
4835
|
+
const i = n.map(he), c = await dd(t, e, i.length);
|
|
4805
4836
|
return {
|
|
4806
|
-
textContent:
|
|
4837
|
+
textContent: ud({ projects: i, args: e, nextCursor: a, unjoined: c }),
|
|
4807
4838
|
structuredContent: {
|
|
4808
4839
|
projects: i,
|
|
4809
4840
|
nextCursor: a ?? void 0,
|
|
4810
4841
|
totalCount: i.length,
|
|
4811
4842
|
hasMore: !!a,
|
|
4812
4843
|
appliedFilters: e,
|
|
4813
|
-
unjoinedProjects: c?.listed.map(
|
|
4844
|
+
unjoinedProjects: c?.listed.map(ld),
|
|
4814
4845
|
unjoinedHasMore: c ? c.total > c.listed.length : void 0
|
|
4815
4846
|
}
|
|
4816
4847
|
};
|
|
@@ -4822,7 +4853,7 @@ function to({ searchText: e, archivedStatus: t, folderId: o }) {
|
|
|
4822
4853
|
function Vs(e) {
|
|
4823
4854
|
return e.archivedStatus === "archived" ? !1 : to(e) || !e.cursor;
|
|
4824
4855
|
}
|
|
4825
|
-
async function
|
|
4856
|
+
async function dd(e, t, o) {
|
|
4826
4857
|
const { includeUnjoined: r, searchText: n, limit: a } = t, i = !!n && o === 0;
|
|
4827
4858
|
if (!Vs(t) || !(r || i))
|
|
4828
4859
|
return;
|
|
@@ -4838,16 +4869,16 @@ async function nd(e, t, o) {
|
|
|
4838
4869
|
);
|
|
4839
4870
|
return { listed: l.slice(0, a), total: l.length };
|
|
4840
4871
|
}
|
|
4841
|
-
function
|
|
4872
|
+
function ld({ id: e, name: t, workspaceId: o, url: r }) {
|
|
4842
4873
|
return { id: e, name: t, workspaceId: o, url: r };
|
|
4843
4874
|
}
|
|
4844
|
-
function
|
|
4875
|
+
function ud({
|
|
4845
4876
|
projects: e,
|
|
4846
4877
|
args: t,
|
|
4847
4878
|
nextCursor: o,
|
|
4848
4879
|
unjoined: r
|
|
4849
4880
|
}) {
|
|
4850
|
-
const n =
|
|
4881
|
+
const n = rd[t.archivedStatus ?? "active"], a = t.searchText ? `All ${n} matching "${t.searchText}"` : `${n.charAt(0).toUpperCase()}${n.slice(1)}`, i = [];
|
|
4851
4882
|
t.searchText && i.push(`searchText: "${t.searchText}"`), t.archivedStatus && t.archivedStatus !== "active" && i.push(`archivedStatus: "${t.archivedStatus}"`), t.folderId && i.push(`folderId: "${t.folderId}"`);
|
|
4852
4883
|
const c = 10, u = e.slice(0, c).map(ja).join(`
|
|
4853
4884
|
`), l = e.length - c, p = l > 0 ? `${u}
|
|
@@ -4879,22 +4910,22 @@ function id({
|
|
|
4879
4910
|
].join(`
|
|
4880
4911
|
`);
|
|
4881
4912
|
}
|
|
4882
|
-
const
|
|
4913
|
+
const pd = {
|
|
4883
4914
|
taskId: s.string().optional().describe(
|
|
4884
4915
|
"Find all reminders for a specific task. Returns both time-based and location reminders."
|
|
4885
4916
|
),
|
|
4886
4917
|
reminderId: s.string().optional().describe("Get a specific time-based reminder (relative or absolute) by its ID."),
|
|
4887
4918
|
locationReminderId: s.string().optional().describe("Get a specific location reminder by its ID.")
|
|
4888
|
-
},
|
|
4919
|
+
}, hd = {
|
|
4889
4920
|
reminders: s.array(Kt).describe("The found reminders (time-based and location)."),
|
|
4890
4921
|
searchType: s.string().describe('The search type used: "task", "reminder", or "location_reminder".'),
|
|
4891
4922
|
searchId: s.string().describe("The ID used for the search."),
|
|
4892
4923
|
totalCount: s.number().describe("Total reminders in this response.")
|
|
4893
|
-
},
|
|
4924
|
+
}, md = {
|
|
4894
4925
|
name: y.FIND_REMINDERS,
|
|
4895
4926
|
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.",
|
|
4896
|
-
parameters:
|
|
4897
|
-
outputSchema:
|
|
4927
|
+
parameters: pd,
|
|
4928
|
+
outputSchema: hd,
|
|
4898
4929
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4899
4930
|
async execute(e, t) {
|
|
4900
4931
|
const { taskId: o, reminderId: r, locationReminderId: n } = e, a = [o, r, n].filter(Boolean);
|
|
@@ -4940,7 +4971,7 @@ const cd = {
|
|
|
4940
4971
|
})
|
|
4941
4972
|
]), u = [...i, ...c].map(Pe);
|
|
4942
4973
|
return {
|
|
4943
|
-
textContent:
|
|
4974
|
+
textContent: fd(u, o),
|
|
4944
4975
|
structuredContent: {
|
|
4945
4976
|
reminders: u,
|
|
4946
4977
|
searchType: "task",
|
|
@@ -4952,7 +4983,7 @@ const cd = {
|
|
|
4952
4983
|
throw new Error("One of taskId, reminderId, or locationReminderId must be provided.");
|
|
4953
4984
|
}
|
|
4954
4985
|
};
|
|
4955
|
-
function
|
|
4986
|
+
function fd(e, t) {
|
|
4956
4987
|
if (e.length === 0)
|
|
4957
4988
|
return `No reminders found for task ${t}`;
|
|
4958
4989
|
const { timeBasedCount: o, locationCount: r } = $s(e), n = [];
|
|
@@ -4966,22 +4997,22 @@ function ud(e, t) {
|
|
|
4966
4997
|
}
|
|
4967
4998
|
return `Found ${n.join(" and ")} for task ${t}`;
|
|
4968
4999
|
}
|
|
4969
|
-
const { ADD_SECTIONS:
|
|
5000
|
+
const { ADD_SECTIONS: bd } = y, gd = {
|
|
4970
5001
|
projectId: s.string().min(1).describe(
|
|
4971
5002
|
'The ID of the project to search sections in. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
4972
5003
|
),
|
|
4973
5004
|
searchText: s.string().optional().describe(
|
|
4974
5005
|
'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.'
|
|
4975
5006
|
)
|
|
4976
|
-
},
|
|
5007
|
+
}, yd = {
|
|
4977
5008
|
sections: s.array(re).describe("The found sections."),
|
|
4978
5009
|
totalCount: s.number().describe("The total number of sections found."),
|
|
4979
5010
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
4980
|
-
},
|
|
5011
|
+
}, wd = {
|
|
4981
5012
|
name: y.FIND_SECTIONS,
|
|
4982
5013
|
description: "Search for sections by name or other criteria in a project. When searching, uses server-side search to avoid fetching all sections.",
|
|
4983
|
-
parameters:
|
|
4984
|
-
outputSchema:
|
|
5014
|
+
parameters: gd,
|
|
5015
|
+
outputSchema: yd,
|
|
4985
5016
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4986
5017
|
async execute(e, t) {
|
|
4987
5018
|
const o = await pe({
|
|
@@ -4994,7 +5025,7 @@ const { ADD_SECTIONS: pd } = y, hd = {
|
|
|
4994
5025
|
})).results;
|
|
4995
5026
|
const n = r.map(ae);
|
|
4996
5027
|
return {
|
|
4997
|
-
textContent:
|
|
5028
|
+
textContent: Td({
|
|
4998
5029
|
sections: n,
|
|
4999
5030
|
projectId: e.projectId,
|
|
5000
5031
|
searchText: e.searchText
|
|
@@ -5007,13 +5038,13 @@ const { ADD_SECTIONS: pd } = y, hd = {
|
|
|
5007
5038
|
};
|
|
5008
5039
|
}
|
|
5009
5040
|
};
|
|
5010
|
-
function
|
|
5041
|
+
function Td({
|
|
5011
5042
|
sections: e,
|
|
5012
5043
|
projectId: t,
|
|
5013
5044
|
searchText: o
|
|
5014
5045
|
}) {
|
|
5015
5046
|
const r = [];
|
|
5016
|
-
o ? (r.push("Try broader search terms"), r.push("Check spelling"), r.push("Remove searchText to see all sections")) : (r.push("Project has no sections yet"), r.push(`Use ${
|
|
5047
|
+
o ? (r.push("Try broader search terms"), r.push("Check spelling"), r.push("Remove searchText to see all sections")) : (r.push("Project has no sections yet"), r.push(`Use ${bd} to create sections`));
|
|
5017
5048
|
const n = o ? `Sections in project ${t} matching "${o}"` : `Sections in project ${t}`, a = e.length > 0 ? e.map((i) => ` ${i.name} • id=${i.id}`).join(`
|
|
5018
5049
|
`) : void 0;
|
|
5019
5050
|
return oe({
|
|
@@ -5027,7 +5058,7 @@ function Js(e) {
|
|
|
5027
5058
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
5028
5059
|
}
|
|
5029
5060
|
const rt = "+00:00";
|
|
5030
|
-
async function
|
|
5061
|
+
async function kd(e, t) {
|
|
5031
5062
|
if (t)
|
|
5032
5063
|
return t.tzInfo?.gmtString || rt;
|
|
5033
5064
|
try {
|
|
@@ -5039,7 +5070,7 @@ async function gd(e, t) {
|
|
|
5039
5070
|
), rt;
|
|
5040
5071
|
}
|
|
5041
5072
|
}
|
|
5042
|
-
const
|
|
5073
|
+
const Id = {
|
|
5043
5074
|
startDate: s.string().regex(/^(\d{4}-\d{2}-\d{2}|today)$/).optional().describe(
|
|
5044
5075
|
"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'."
|
|
5045
5076
|
),
|
|
@@ -5060,17 +5091,17 @@ const yd = {
|
|
|
5060
5091
|
"Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
|
|
5061
5092
|
),
|
|
5062
5093
|
...Qt
|
|
5063
|
-
},
|
|
5094
|
+
}, vd = {
|
|
5064
5095
|
tasks: s.array(te).describe("The found tasks."),
|
|
5065
5096
|
nextCursor: s.string().optional(),
|
|
5066
5097
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
5067
5098
|
hasMore: s.boolean(),
|
|
5068
5099
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
5069
|
-
},
|
|
5100
|
+
}, Sd = {
|
|
5070
5101
|
name: y.FIND_TASKS_BY_DATE,
|
|
5071
5102
|
description: "Get tasks by date range. startDate='today' includes overdue items. Default responsibleUserFiltering='unassignedOrMe' excludes others' tasks.",
|
|
5072
|
-
parameters:
|
|
5073
|
-
outputSchema:
|
|
5103
|
+
parameters: Id,
|
|
5104
|
+
outputSchema: vd,
|
|
5074
5105
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5075
5106
|
async execute(e, t) {
|
|
5076
5107
|
const o = e.startDate !== void 0 || e.overdueOption === "overdue-only" ? e : { ...e, startDate: "today" }, r = Ge(o.cursor), n = await Lt(t, o.responsibleUser), a = n?.userId, i = n?.email, c = o.responsibleUser?.trim().toLowerCase() === wt, d = a && !c ? await t.getUser() : void 0, u = c ? a : d?.id;
|
|
@@ -5079,7 +5110,7 @@ const yd = {
|
|
|
5079
5110
|
l = "overdue";
|
|
5080
5111
|
else if (o.startDate === "today")
|
|
5081
5112
|
if (o.daysCount > 1) {
|
|
5082
|
-
const g = await
|
|
5113
|
+
const g = await kd(t, d), w = Fs(/* @__PURE__ */ new Date(), Ze(g)), I = Re(w, o.daysCount), k = `(due after: ${w} | due: ${w}) & due before: ${I}`;
|
|
5083
5114
|
l = o.overdueOption === "exclude-overdue" ? k : `(${k} | overdue)`;
|
|
5084
5115
|
} else
|
|
5085
5116
|
l = o.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
@@ -5103,7 +5134,7 @@ const yd = {
|
|
|
5103
5134
|
limit: o.limit
|
|
5104
5135
|
});
|
|
5105
5136
|
return {
|
|
5106
|
-
textContent:
|
|
5137
|
+
textContent: Cd({
|
|
5107
5138
|
tasks: h,
|
|
5108
5139
|
args: o,
|
|
5109
5140
|
nextCursor: m,
|
|
@@ -5120,7 +5151,7 @@ const yd = {
|
|
|
5120
5151
|
};
|
|
5121
5152
|
}
|
|
5122
5153
|
};
|
|
5123
|
-
function
|
|
5154
|
+
function Cd({
|
|
5124
5155
|
tasks: e,
|
|
5125
5156
|
args: t,
|
|
5126
5157
|
nextCursor: o,
|
|
@@ -5171,14 +5202,14 @@ function kd({
|
|
|
5171
5202
|
zeroReasonHints: c
|
|
5172
5203
|
});
|
|
5173
5204
|
}
|
|
5174
|
-
const
|
|
5175
|
-
class
|
|
5205
|
+
const jd = 300 * 1e3;
|
|
5206
|
+
class $d {
|
|
5176
5207
|
constructor() {
|
|
5177
5208
|
this.cacheByClient = /* @__PURE__ */ new WeakMap();
|
|
5178
5209
|
}
|
|
5179
5210
|
async getFilters(t) {
|
|
5180
5211
|
const o = this.cacheByClient, r = o.get(t);
|
|
5181
|
-
if (r && Date.now() - r.timestamp <
|
|
5212
|
+
if (r && Date.now() - r.timestamp < jd)
|
|
5182
5213
|
return r.filters;
|
|
5183
5214
|
const a = ((await t.sync({
|
|
5184
5215
|
resourceTypes: ["filters"],
|
|
@@ -5235,19 +5266,19 @@ ${l}` + (d.length > 5 ? `
|
|
|
5235
5266
|
this.cacheByClient = /* @__PURE__ */ new WeakMap();
|
|
5236
5267
|
}
|
|
5237
5268
|
}
|
|
5238
|
-
const
|
|
5269
|
+
const Ed = new $d(), Ao = 5, It = "resume:", vt = "Invalid cursor. Pass the nextCursor from the previous call unchanged, with the same parameters.", Ad = s.object({
|
|
5239
5270
|
next: s.string(),
|
|
5240
5271
|
state: s.unknown().optional()
|
|
5241
5272
|
});
|
|
5242
|
-
function
|
|
5273
|
+
function Dd(e) {
|
|
5243
5274
|
return `${It}${Buffer.from(JSON.stringify(e)).toString("base64url")}`;
|
|
5244
5275
|
}
|
|
5245
|
-
function
|
|
5276
|
+
function xd(e) {
|
|
5246
5277
|
if (e) {
|
|
5247
5278
|
if (!e.startsWith(It)) throw new Error(vt);
|
|
5248
5279
|
try {
|
|
5249
5280
|
const t = e.slice(It.length);
|
|
5250
|
-
return
|
|
5281
|
+
return Ad.parse(
|
|
5251
5282
|
JSON.parse(Buffer.from(t, "base64url").toString())
|
|
5252
5283
|
);
|
|
5253
5284
|
} catch {
|
|
@@ -5255,7 +5286,7 @@ function $d(e) {
|
|
|
5255
5286
|
}
|
|
5256
5287
|
}
|
|
5257
5288
|
}
|
|
5258
|
-
async function
|
|
5289
|
+
async function Od({
|
|
5259
5290
|
fetchPage: e,
|
|
5260
5291
|
matches: t,
|
|
5261
5292
|
limit: o,
|
|
@@ -5274,7 +5305,7 @@ async function Ed({
|
|
|
5274
5305
|
}
|
|
5275
5306
|
if (t(f)) {
|
|
5276
5307
|
if (i.length === o)
|
|
5277
|
-
return { items: i, nextCursor:
|
|
5308
|
+
return { items: i, nextCursor: Dd({ next: f.id, state: a }) };
|
|
5278
5309
|
i.push(f);
|
|
5279
5310
|
}
|
|
5280
5311
|
}
|
|
@@ -5291,7 +5322,7 @@ async function Ed({
|
|
|
5291
5322
|
`Stopped after reading ${Ao * r} items without reaching the end of the list.`
|
|
5292
5323
|
);
|
|
5293
5324
|
}
|
|
5294
|
-
const { FIND_COMPLETED_TASKS: Do, ADD_TASKS: xo } = y,
|
|
5325
|
+
const { FIND_COMPLETED_TASKS: Do, ADD_TASKS: xo } = y, _d = {
|
|
5295
5326
|
searchText: s.string().optional().describe("The text to search for in tasks."),
|
|
5296
5327
|
projectId: s.string().optional().describe(
|
|
5297
5328
|
'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -5315,17 +5346,17 @@ const { FIND_COMPLETED_TASKS: Do, ADD_TASKS: xo } = y, Ad = {
|
|
|
5315
5346
|
"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."
|
|
5316
5347
|
),
|
|
5317
5348
|
...Qt
|
|
5318
|
-
},
|
|
5349
|
+
}, Pd = {
|
|
5319
5350
|
tasks: s.array(te).describe("The found tasks."),
|
|
5320
5351
|
nextCursor: s.string().optional(),
|
|
5321
5352
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
5322
5353
|
hasMore: s.boolean(),
|
|
5323
5354
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
5324
|
-
},
|
|
5355
|
+
}, Ud = {
|
|
5325
5356
|
name: y.FIND_TASKS,
|
|
5326
5357
|
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.',
|
|
5327
|
-
parameters:
|
|
5328
|
-
outputSchema:
|
|
5358
|
+
parameters: _d,
|
|
5359
|
+
outputSchema: Pd,
|
|
5329
5360
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5330
5361
|
async execute(e, t) {
|
|
5331
5362
|
const {
|
|
@@ -5351,16 +5382,16 @@ const { FIND_COMPLETED_TASKS: Do, ADD_TASKS: xo } = y, Ad = {
|
|
|
5351
5382
|
throw new Error(
|
|
5352
5383
|
'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
|
|
5353
5384
|
);
|
|
5354
|
-
const g = b ?
|
|
5385
|
+
const g = b ? xd(m) : void 0, w = b ? g ? Promise.resolve(Nd(g.state)) : Ld(t, l, p) : Promise.resolve(void 0), I = await t.getUser(), k = l && l.length > 0;
|
|
5355
5386
|
let S = f;
|
|
5356
|
-
h && (S = (await
|
|
5387
|
+
h && (S = (await Ed.resolveFilter(t, h)).filterQuery);
|
|
5357
5388
|
const E = await Lt(t, i), N = E?.userId, T = E?.email;
|
|
5358
5389
|
if (b) {
|
|
5359
5390
|
const q = {};
|
|
5360
5391
|
r && (q.projectId = await pe({ projectId: r, user: I })), n && (q.sectionId = n), a && (q.parentId = a);
|
|
5361
5392
|
const fe = await w;
|
|
5362
5393
|
fe && (q.label = fe);
|
|
5363
|
-
const ie = o?.toLowerCase(), { items: J, nextCursor: Fe } = await
|
|
5394
|
+
const ie = o?.toLowerCase(), { items: J, nextCursor: Fe } = await Od({
|
|
5364
5395
|
fetchPage: async (be) => {
|
|
5365
5396
|
const { results: ur, nextCursor: pr } = await t.getTasks({
|
|
5366
5397
|
...q,
|
|
@@ -5373,7 +5404,7 @@ const { FIND_COMPLETED_TASKS: Do, ADD_TASKS: xo } = y, Ad = {
|
|
|
5373
5404
|
resolvedAssigneeId: N,
|
|
5374
5405
|
currentUserId: I.id,
|
|
5375
5406
|
responsibleUserFiltering: c
|
|
5376
|
-
}).length === 1 && (!l?.length ||
|
|
5407
|
+
}).length === 1 && (!l?.length || Oc(be.labels, l, p)),
|
|
5377
5408
|
limit: d,
|
|
5378
5409
|
maxPageSize: $.TASKS_PAGE_MAX,
|
|
5379
5410
|
from: g,
|
|
@@ -5463,14 +5494,14 @@ const { FIND_COMPLETED_TASKS: Do, ADD_TASKS: xo } = y, Ad = {
|
|
|
5463
5494
|
}
|
|
5464
5495
|
};
|
|
5465
5496
|
}
|
|
5466
|
-
},
|
|
5467
|
-
function
|
|
5497
|
+
}, Rd = s.object({ apiLabel: s.string().optional() });
|
|
5498
|
+
function Nd(e) {
|
|
5468
5499
|
if (e === void 0) return;
|
|
5469
|
-
const t =
|
|
5500
|
+
const t = Rd.safeParse(e);
|
|
5470
5501
|
if (!t.success) throw new Error(vt);
|
|
5471
5502
|
return t.data.apiLabel;
|
|
5472
5503
|
}
|
|
5473
|
-
async function
|
|
5504
|
+
async function Ld(e, t, o) {
|
|
5474
5505
|
if (!(!t?.length || t.length > 1 && o !== "and"))
|
|
5475
5506
|
try {
|
|
5476
5507
|
const [r, n] = await Promise.all([
|
|
@@ -5478,7 +5509,7 @@ async function Pd(e, t, o) {
|
|
|
5478
5509
|
js(e)
|
|
5479
5510
|
]), a = [...r, ...n];
|
|
5480
5511
|
for (const i of t) {
|
|
5481
|
-
const c =
|
|
5512
|
+
const c = _c(i, a);
|
|
5482
5513
|
if (c) return c;
|
|
5483
5514
|
}
|
|
5484
5515
|
return;
|
|
@@ -5490,7 +5521,7 @@ async function Pd(e, t, o) {
|
|
|
5490
5521
|
return;
|
|
5491
5522
|
}
|
|
5492
5523
|
}
|
|
5493
|
-
function
|
|
5524
|
+
function Md(e) {
|
|
5494
5525
|
if (e.projectId) {
|
|
5495
5526
|
const t = [
|
|
5496
5527
|
e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
|
|
@@ -5526,7 +5557,7 @@ function nt({
|
|
|
5526
5557
|
const u = Ie(t.labels, t.labelsOperator);
|
|
5527
5558
|
c.push(`labels: ${u}`);
|
|
5528
5559
|
}
|
|
5529
|
-
e.length === 0 && d.push(...
|
|
5560
|
+
e.length === 0 && d.push(...Md(t));
|
|
5530
5561
|
} else {
|
|
5531
5562
|
const u = n || t.responsibleUser, l = [];
|
|
5532
5563
|
if (t.filter && l.push(`filter: ${t.filter}`), t.searchText && l.push(`"${t.searchText}"`), t.responsibleUser && l.push(`assigned to ${u}`), t.labels && t.labels.length > 0) {
|
|
@@ -5555,7 +5586,7 @@ function nt({
|
|
|
5555
5586
|
zeroReasonHints: d
|
|
5556
5587
|
});
|
|
5557
5588
|
}
|
|
5558
|
-
const
|
|
5589
|
+
const Fd = {
|
|
5559
5590
|
projectId: s.string().min(1).optional().describe(
|
|
5560
5591
|
`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.`
|
|
5561
5592
|
)
|
|
@@ -5569,7 +5600,7 @@ const Ud = {
|
|
|
5569
5600
|
sections: s.array(re),
|
|
5570
5601
|
children: s.array(Xs).describe("Nested child projects.")
|
|
5571
5602
|
})
|
|
5572
|
-
),
|
|
5603
|
+
), Hd = {
|
|
5573
5604
|
type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
5574
5605
|
totalProjects: s.number().optional().describe("Total number of projects (account overview only)."),
|
|
5575
5606
|
totalTasks: s.number().optional().describe("Total number of tasks."),
|
|
@@ -5603,7 +5634,7 @@ const Ud = {
|
|
|
5603
5634
|
tasksWithoutSection: s.number()
|
|
5604
5635
|
}).optional().describe("Statistics object (project overview only).")
|
|
5605
5636
|
};
|
|
5606
|
-
function
|
|
5637
|
+
function Wd(e) {
|
|
5607
5638
|
const t = {};
|
|
5608
5639
|
for (const n of e)
|
|
5609
5640
|
t[n.id] = {
|
|
@@ -5628,7 +5659,7 @@ function Ld(e) {
|
|
|
5628
5659
|
}
|
|
5629
5660
|
return r(o), o;
|
|
5630
5661
|
}
|
|
5631
|
-
async function
|
|
5662
|
+
async function Bd(e, t) {
|
|
5632
5663
|
const o = {};
|
|
5633
5664
|
return await Promise.all(
|
|
5634
5665
|
t.map(async (r) => {
|
|
@@ -5685,7 +5716,7 @@ function Qs(e, t) {
|
|
|
5685
5716
|
)
|
|
5686
5717
|
};
|
|
5687
5718
|
}
|
|
5688
|
-
async function
|
|
5719
|
+
async function Kd(e, t) {
|
|
5689
5720
|
let o = [], r;
|
|
5690
5721
|
do {
|
|
5691
5722
|
const { results: n, nextCursor: a } = await e.getTasks({
|
|
@@ -5697,12 +5728,12 @@ async function Fd(e, t) {
|
|
|
5697
5728
|
} while (r);
|
|
5698
5729
|
return o;
|
|
5699
5730
|
}
|
|
5700
|
-
async function
|
|
5731
|
+
async function zd(e, t) {
|
|
5701
5732
|
const { results: o } = await e.getSections({ projectId: t });
|
|
5702
5733
|
return o;
|
|
5703
5734
|
}
|
|
5704
|
-
async function
|
|
5705
|
-
const { results: t } = await e.getProjects({}), o = t.find((p) => Q(p) && p.inboxProject === !0), r = t.filter((p) => !Q(p) || p.inboxProject !== !0), n =
|
|
5735
|
+
async function qd(e) {
|
|
5736
|
+
const { results: t } = await e.getProjects({}), o = t.find((p) => Q(p) && p.inboxProject === !0), r = t.filter((p) => !Q(p) || p.inboxProject !== !0), n = Wd(r), a = t.map((p) => p.id), i = await Bd(e, a), c = ["# Personal Projects", ""];
|
|
5706
5737
|
if (o) {
|
|
5707
5738
|
c.push(`- Inbox Project: ${o.name} (id=${o.id})`);
|
|
5708
5739
|
for (const p of i[o.id] || [])
|
|
@@ -5742,13 +5773,13 @@ async function Wd(e) {
|
|
|
5742
5773
|
};
|
|
5743
5774
|
return { textContent: u, structuredContent: l };
|
|
5744
5775
|
}
|
|
5745
|
-
async function
|
|
5776
|
+
async function Gd(e, t) {
|
|
5746
5777
|
const o = ne(e, t), r = (h) => h.catch(async (m) => {
|
|
5747
5778
|
throw await o, m;
|
|
5748
5779
|
}), [n, a, i] = await Promise.all([
|
|
5749
5780
|
o,
|
|
5750
|
-
r(
|
|
5751
|
-
r(
|
|
5781
|
+
r(zd(e, t)),
|
|
5782
|
+
r(Kd(e, t))
|
|
5752
5783
|
]), c = await ve(e, i), d = {};
|
|
5753
5784
|
for (const h of a)
|
|
5754
5785
|
d[h.id] = [];
|
|
@@ -5790,27 +5821,27 @@ async function Bd(e, t) {
|
|
|
5790
5821
|
};
|
|
5791
5822
|
return { textContent: p, structuredContent: f };
|
|
5792
5823
|
}
|
|
5793
|
-
const
|
|
5824
|
+
const Yd = {
|
|
5794
5825
|
name: y.GET_OVERVIEW,
|
|
5795
5826
|
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.`,
|
|
5796
|
-
parameters:
|
|
5797
|
-
outputSchema:
|
|
5827
|
+
parameters: Fd,
|
|
5828
|
+
outputSchema: Hd,
|
|
5798
5829
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5799
5830
|
async execute(e, t) {
|
|
5800
|
-
const o = await pe({ projectId: e.projectId, client: t }), r = o ? await
|
|
5831
|
+
const o = await pe({ projectId: e.projectId, client: t }), r = o ? await Gd(t, o) : await qd(t);
|
|
5801
5832
|
return {
|
|
5802
5833
|
textContent: r.textContent,
|
|
5803
5834
|
structuredContent: r.structuredContent
|
|
5804
5835
|
};
|
|
5805
5836
|
}
|
|
5806
|
-
},
|
|
5837
|
+
}, Vd = {}, ke = s.object({
|
|
5807
5838
|
count: s.number().describe("Number of consecutive periods in this streak."),
|
|
5808
5839
|
start: s.string().describe("Start date of the streak."),
|
|
5809
5840
|
end: s.string().describe("End date of the streak.")
|
|
5810
5841
|
}), _o = s.object({
|
|
5811
5842
|
id: s.string().describe("Project ID."),
|
|
5812
5843
|
completed: s.number().describe("Number of tasks completed in this project.")
|
|
5813
|
-
}),
|
|
5844
|
+
}), Jd = {
|
|
5814
5845
|
completedCount: s.number().describe("Total number of completed tasks (all-time)."),
|
|
5815
5846
|
daysItems: s.array(
|
|
5816
5847
|
s.object({
|
|
@@ -5859,11 +5890,11 @@ const Kd = {
|
|
|
5859
5890
|
})
|
|
5860
5891
|
).describe("Recent karma change events with reasons."),
|
|
5861
5892
|
projectColors: s.record(s.string(), s.string()).describe("Map of project ID to color key.")
|
|
5862
|
-
},
|
|
5893
|
+
}, Xd = {
|
|
5863
5894
|
name: y.GET_PRODUCTIVITY_STATS,
|
|
5864
5895
|
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.',
|
|
5865
|
-
parameters:
|
|
5866
|
-
outputSchema:
|
|
5896
|
+
parameters: Vd,
|
|
5897
|
+
outputSchema: Jd,
|
|
5867
5898
|
annotations: {
|
|
5868
5899
|
readOnlyHint: !0,
|
|
5869
5900
|
destructiveHint: !1,
|
|
@@ -5872,7 +5903,7 @@ const Kd = {
|
|
|
5872
5903
|
async execute(e, t) {
|
|
5873
5904
|
const o = await t.getProductivityStats();
|
|
5874
5905
|
return {
|
|
5875
|
-
textContent:
|
|
5906
|
+
textContent: Zd(o),
|
|
5876
5907
|
structuredContent: {
|
|
5877
5908
|
completedCount: o.completedCount,
|
|
5878
5909
|
daysItems: o.daysItems,
|
|
@@ -5899,7 +5930,7 @@ const Kd = {
|
|
|
5899
5930
|
};
|
|
5900
5931
|
}
|
|
5901
5932
|
};
|
|
5902
|
-
function
|
|
5933
|
+
function Zd(e) {
|
|
5903
5934
|
const t = [
|
|
5904
5935
|
"# Productivity Statistics",
|
|
5905
5936
|
"",
|
|
@@ -5929,11 +5960,11 @@ function Yd(e) {
|
|
|
5929
5960
|
return t.join(`
|
|
5930
5961
|
`);
|
|
5931
5962
|
}
|
|
5932
|
-
const
|
|
5963
|
+
const Qd = {
|
|
5933
5964
|
projectId: s.string().min(1).describe("The ID of the project to get activity stats for."),
|
|
5934
5965
|
weeks: s.number().int().min(1).max(12).optional().describe("Number of weeks of activity data to retrieve (1-12, default 2)."),
|
|
5935
5966
|
includeWeeklyCounts: s.boolean().optional().describe("Include weekly rollup counts alongside daily counts.")
|
|
5936
|
-
},
|
|
5967
|
+
}, el = {
|
|
5937
5968
|
projectId: s.string().describe("The project ID."),
|
|
5938
5969
|
dayItems: s.array(
|
|
5939
5970
|
s.object({
|
|
@@ -5949,7 +5980,7 @@ const Vd = {
|
|
|
5949
5980
|
})
|
|
5950
5981
|
).optional().describe("Weekly completion rollups. Only included when includeWeeklyCounts is true.")
|
|
5951
5982
|
};
|
|
5952
|
-
function
|
|
5983
|
+
function tl(e, t) {
|
|
5953
5984
|
const o = [`# Activity Stats: Project ${e}`, ""];
|
|
5954
5985
|
if (t.dayItems.length > 0) {
|
|
5955
5986
|
o.push("## Daily Activity");
|
|
@@ -5965,11 +5996,11 @@ function Xd(e, t) {
|
|
|
5965
5996
|
return o.join(`
|
|
5966
5997
|
`);
|
|
5967
5998
|
}
|
|
5968
|
-
const
|
|
5999
|
+
const ol = {
|
|
5969
6000
|
name: y.GET_PROJECT_ACTIVITY_STATS,
|
|
5970
6001
|
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.",
|
|
5971
|
-
parameters:
|
|
5972
|
-
outputSchema:
|
|
6002
|
+
parameters: Qd,
|
|
6003
|
+
outputSchema: el,
|
|
5973
6004
|
annotations: {
|
|
5974
6005
|
readOnlyHint: !0,
|
|
5975
6006
|
destructiveHint: !1,
|
|
@@ -5981,7 +6012,7 @@ const Zd = {
|
|
|
5981
6012
|
includeWeeklyCounts: n
|
|
5982
6013
|
});
|
|
5983
6014
|
return {
|
|
5984
|
-
textContent:
|
|
6015
|
+
textContent: tl(o, a),
|
|
5985
6016
|
structuredContent: {
|
|
5986
6017
|
projectId: o,
|
|
5987
6018
|
dayItems: a.dayItems,
|
|
@@ -5989,9 +6020,9 @@ const Zd = {
|
|
|
5989
6020
|
}
|
|
5990
6021
|
};
|
|
5991
6022
|
}
|
|
5992
|
-
},
|
|
6023
|
+
}, sl = {
|
|
5993
6024
|
projectId: s.string().min(1).describe("The ID of the project to check health for.")
|
|
5994
|
-
},
|
|
6025
|
+
}, rl = {
|
|
5995
6026
|
projectId: s.string().describe("The project ID."),
|
|
5996
6027
|
projectName: s.string().describe("The project name."),
|
|
5997
6028
|
progress: s.object({
|
|
@@ -6008,18 +6039,18 @@ const Zd = {
|
|
|
6008
6039
|
updatedAt: s.string().optional().describe("When the health assessment was last updated.")
|
|
6009
6040
|
}).describe("Project health assessment.")
|
|
6010
6041
|
};
|
|
6011
|
-
function
|
|
6042
|
+
function nl(e, t, o) {
|
|
6012
6043
|
const r = [`# Project Health: ${e}`, ""];
|
|
6013
6044
|
return r.push(`**Status:** ${o.status}`), o.isStale && r.push("**Note:** Health data is stale and may not reflect recent changes."), o.updateInProgress && r.push("**Note:** A health analysis update is currently in progress."), o.updatedAt && r.push(`**Last Updated:** ${o.updatedAt.toISOString()}`), r.push(""), r.push("## Progress"), r.push(
|
|
6014
6045
|
`**Completed:** ${t.completedCount} | **Active:** ${t.activeCount} | **Progress:** ${t.progressPercent}%`
|
|
6015
6046
|
), o.description && (r.push(""), r.push("## Health Description"), r.push(o.description)), r.join(`
|
|
6016
6047
|
`);
|
|
6017
6048
|
}
|
|
6018
|
-
const
|
|
6049
|
+
const al = {
|
|
6019
6050
|
name: y.GET_PROJECT_HEALTH,
|
|
6020
6051
|
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.",
|
|
6021
|
-
parameters:
|
|
6022
|
-
outputSchema:
|
|
6052
|
+
parameters: sl,
|
|
6053
|
+
outputSchema: rl,
|
|
6023
6054
|
annotations: {
|
|
6024
6055
|
readOnlyHint: !0,
|
|
6025
6056
|
destructiveHint: !1,
|
|
@@ -6031,7 +6062,7 @@ const ol = {
|
|
|
6031
6062
|
t.getProjectHealth(o)
|
|
6032
6063
|
]), a = `Project ${o}`;
|
|
6033
6064
|
return {
|
|
6034
|
-
textContent:
|
|
6065
|
+
textContent: nl(a, r, n),
|
|
6035
6066
|
structuredContent: {
|
|
6036
6067
|
projectId: o,
|
|
6037
6068
|
projectName: a,
|
|
@@ -6051,7 +6082,7 @@ const ol = {
|
|
|
6051
6082
|
}
|
|
6052
6083
|
};
|
|
6053
6084
|
}
|
|
6054
|
-
},
|
|
6085
|
+
}, il = s.object({
|
|
6055
6086
|
message: s.string().optional(),
|
|
6056
6087
|
emoji: s.string().optional(),
|
|
6057
6088
|
activeUntil: s.string().optional().describe("ISO 8601 end. Omitted when it has no end."),
|
|
@@ -6059,9 +6090,9 @@ const ol = {
|
|
|
6059
6090
|
pauseActivity: s.boolean().describe("Karma and streaks paused.")
|
|
6060
6091
|
}), er = {
|
|
6061
6092
|
hasStatus: s.boolean(),
|
|
6062
|
-
status:
|
|
6093
|
+
status: il.optional().describe("Omitted when there is no active status.")
|
|
6063
6094
|
};
|
|
6064
|
-
function
|
|
6095
|
+
function cl(e) {
|
|
6065
6096
|
if (!e.user)
|
|
6066
6097
|
throw new Error("Todoist did not return the user, so the status is unknown.");
|
|
6067
6098
|
return e.user.status ?? null;
|
|
@@ -6070,9 +6101,9 @@ async function tr(e) {
|
|
|
6070
6101
|
const t = await j(
|
|
6071
6102
|
() => e.sync({ resourceTypes: ["user"], syncToken: "*" })
|
|
6072
6103
|
);
|
|
6073
|
-
return
|
|
6104
|
+
return cl(t);
|
|
6074
6105
|
}
|
|
6075
|
-
function
|
|
6106
|
+
function dl(e) {
|
|
6076
6107
|
const t = e.activeUntil ? new Date(e.activeUntil).toISOString() : void 0;
|
|
6077
6108
|
return {
|
|
6078
6109
|
...e.message ? { message: e.message } : {},
|
|
@@ -6088,7 +6119,7 @@ function Ct(e, t) {
|
|
|
6088
6119
|
textContent: `${t}: none`,
|
|
6089
6120
|
structuredContent: { hasStatus: !1 }
|
|
6090
6121
|
};
|
|
6091
|
-
const o =
|
|
6122
|
+
const o = dl(e), r = [`${t}: ${[o.emoji, o.message].filter(Boolean).join(" ")}`];
|
|
6092
6123
|
r.push(o.activeUntil ? `Until: ${o.activeUntil}` : "Until: no end");
|
|
6093
6124
|
const n = [
|
|
6094
6125
|
o.pauseNotifications ? "Comms notifications paused" : void 0,
|
|
@@ -6100,21 +6131,21 @@ function Ct(e, t) {
|
|
|
6100
6131
|
structuredContent: { hasStatus: !0, status: o }
|
|
6101
6132
|
};
|
|
6102
6133
|
}
|
|
6103
|
-
const
|
|
6134
|
+
const ll = {}, ul = {
|
|
6104
6135
|
name: y.GET_USER_STATUS,
|
|
6105
6136
|
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.",
|
|
6106
|
-
parameters:
|
|
6137
|
+
parameters: ll,
|
|
6107
6138
|
outputSchema: er,
|
|
6108
6139
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
6109
6140
|
async execute(e, t) {
|
|
6110
6141
|
return Ct(await tr(t), "Status");
|
|
6111
6142
|
}
|
|
6112
|
-
},
|
|
6143
|
+
}, pl = {
|
|
6113
6144
|
workspaceIdOrName: s.string().min(1).describe(
|
|
6114
6145
|
"The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
|
|
6115
6146
|
),
|
|
6116
6147
|
projectIds: s.array(s.string().min(1)).min(1).max($.FILTER_VALUES_MAX).optional().describe("Optional list of project IDs to scope insights to specific projects.")
|
|
6117
|
-
},
|
|
6148
|
+
}, hl = s.object({
|
|
6118
6149
|
projectId: s.string().describe("The project ID."),
|
|
6119
6150
|
health: s.object({
|
|
6120
6151
|
status: s.enum($t).describe("The health status of the project."),
|
|
@@ -6126,22 +6157,22 @@ const al = {}, il = {
|
|
|
6126
6157
|
activeCount: s.number().describe("Number of active tasks."),
|
|
6127
6158
|
progressPercent: s.number().describe("Completion percentage (0-100).")
|
|
6128
6159
|
}).optional().describe("Progress data for this project. Omitted when the project has none.")
|
|
6129
|
-
}),
|
|
6160
|
+
}), ml = {
|
|
6130
6161
|
workspaceId: s.string().describe("The resolved workspace ID."),
|
|
6131
6162
|
workspaceName: s.string().describe("The resolved workspace name."),
|
|
6132
|
-
projectInsights: s.array(
|
|
6133
|
-
},
|
|
6163
|
+
projectInsights: s.array(hl).describe("Health and progress insights for each project in the workspace.")
|
|
6164
|
+
}, fl = {
|
|
6134
6165
|
name: y.GET_WORKSPACE_INSIGHTS,
|
|
6135
6166
|
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.",
|
|
6136
|
-
parameters:
|
|
6137
|
-
outputSchema:
|
|
6167
|
+
parameters: pl,
|
|
6168
|
+
outputSchema: ml,
|
|
6138
6169
|
annotations: {
|
|
6139
6170
|
readOnlyHint: !0,
|
|
6140
6171
|
destructiveHint: !1,
|
|
6141
6172
|
idempotentHint: !0
|
|
6142
6173
|
},
|
|
6143
6174
|
async execute(e, t) {
|
|
6144
|
-
const { workspaceIdOrName: o, projectIds: r } = e, n = await
|
|
6175
|
+
const { workspaceIdOrName: o, projectIds: r } = e, n = await Ue.resolveWorkspace(t, o), i = (await t.getWorkspaceInsights(n.workspaceId, { projectIds: r })).projectInsights.map((d) => ({
|
|
6145
6176
|
projectId: d.projectId,
|
|
6146
6177
|
health: d.health ? {
|
|
6147
6178
|
status: d.health.status,
|
|
@@ -6174,7 +6205,7 @@ const al = {}, il = {
|
|
|
6174
6205
|
};
|
|
6175
6206
|
}
|
|
6176
6207
|
};
|
|
6177
|
-
function
|
|
6208
|
+
function bl(e) {
|
|
6178
6209
|
const t = e.trim();
|
|
6179
6210
|
if (!/^https?:\/\//i.test(t))
|
|
6180
6211
|
return t;
|
|
@@ -6184,7 +6215,7 @@ function pl(e) {
|
|
|
6184
6215
|
} catch {
|
|
6185
6216
|
throw new Error(`Could not read a template ID from "${t}".`);
|
|
6186
6217
|
}
|
|
6187
|
-
if (!
|
|
6218
|
+
if (!gl(o.hostname))
|
|
6188
6219
|
throw new Error(
|
|
6189
6220
|
`"${o.hostname}" is not a Todoist domain. Pass a todoist.com template URL or the template ID itself.`
|
|
6190
6221
|
);
|
|
@@ -6194,18 +6225,18 @@ function pl(e) {
|
|
|
6194
6225
|
throw new Error(`"${t}" is not a Todoist template URL.`);
|
|
6195
6226
|
return r.id;
|
|
6196
6227
|
}
|
|
6197
|
-
function
|
|
6228
|
+
function gl(e) {
|
|
6198
6229
|
const t = e.toLowerCase();
|
|
6199
6230
|
return t === "todoist.com" || t.endsWith(".todoist.com");
|
|
6200
6231
|
}
|
|
6201
6232
|
function Po(e) {
|
|
6202
6233
|
return e.replace(/[a-z]/gi, (t) => `[${t.toUpperCase()}${t.toLowerCase()}]`).replace(/\./g, "\\.");
|
|
6203
6234
|
}
|
|
6204
|
-
const
|
|
6235
|
+
const yl = new RegExp(
|
|
6205
6236
|
String.raw`^\s*(?:[A-Za-z0-9_\-]+|${Po("https")}:\/\/(?:[A-Za-z0-9\-]+\.)*${Po("todoist.com")}(?:\/\S*)?)\s*$`
|
|
6206
|
-
),
|
|
6237
|
+
), wl = {
|
|
6207
6238
|
projectId: s.string().min(1).describe("The ID of the existing project to import the template into."),
|
|
6208
|
-
templateId: s.string().regex(
|
|
6239
|
+
templateId: s.string().regex(yl, {
|
|
6209
6240
|
error: 'Pass a template slug ("product-launch"), a template ID ("UT_..."), or an https URL on todoist.com or one of its subdomains.'
|
|
6210
6241
|
}).optional().describe(
|
|
6211
6242
|
'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. There is no way to list templates through this server, so only use the ID or URL the user supplied. Provide either this or `csvFileContent`, not both.'
|
|
@@ -6214,16 +6245,16 @@ const ml = new RegExp(
|
|
|
6214
6245
|
"Raw CSV template content, as produced by export-project-template. Provide either this or `templateId`, not both."
|
|
6215
6246
|
),
|
|
6216
6247
|
locale: s.string().optional().describe('Locale for the imported content when using `templateId`. Defaults to "en".')
|
|
6217
|
-
},
|
|
6248
|
+
}, Tl = {
|
|
6218
6249
|
sections: s.array(re).describe("Sections created by the import."),
|
|
6219
6250
|
tasks: s.array(te).describe("Tasks created by the import."),
|
|
6220
6251
|
comments: s.array(Le).describe("Comments created by the import."),
|
|
6221
6252
|
totalCount: s.number().describe("The total number of objects created by the import.")
|
|
6222
|
-
},
|
|
6253
|
+
}, kl = {
|
|
6223
6254
|
name: y.IMPORT_PROJECT_TEMPLATE,
|
|
6224
6255
|
description: "Import a template into an existing project, adding its tasks, sections and comments to whatever is already there. Source it by template ID/URL or by passing CSV content from export-project-template. To start a new project from a template, create the project with add-projects first, then import into it. This writes immediately and cannot be undone, so only run it against a project the user named.",
|
|
6225
|
-
parameters:
|
|
6226
|
-
outputSchema:
|
|
6256
|
+
parameters: wl,
|
|
6257
|
+
outputSchema: Tl,
|
|
6227
6258
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
6228
6259
|
async execute({ projectId: e, templateId: t, csvFileContent: o, locale: r }, n) {
|
|
6229
6260
|
if (!!t == !!o)
|
|
@@ -6232,7 +6263,7 @@ const ml = new RegExp(
|
|
|
6232
6263
|
);
|
|
6233
6264
|
const a = t ? await n.importTemplateFromId({
|
|
6234
6265
|
projectId: e,
|
|
6235
|
-
templateId:
|
|
6266
|
+
templateId: bl(t),
|
|
6236
6267
|
locale: r
|
|
6237
6268
|
}) : await n.importCsvIntoProject({
|
|
6238
6269
|
projectId: e,
|
|
@@ -6241,7 +6272,7 @@ const ml = new RegExp(
|
|
|
6241
6272
|
fileName: "template.csv"
|
|
6242
6273
|
}), i = a.sections.map(ae), c = a.tasks.map(z), d = a.comments.map(Ne), u = a.projects.length + i.length + c.length + d.length;
|
|
6243
6274
|
return {
|
|
6244
|
-
textContent:
|
|
6275
|
+
textContent: Il({
|
|
6245
6276
|
projectId: e,
|
|
6246
6277
|
counts: {
|
|
6247
6278
|
projects: a.projects.length,
|
|
@@ -6255,7 +6286,7 @@ const ml = new RegExp(
|
|
|
6255
6286
|
};
|
|
6256
6287
|
}
|
|
6257
6288
|
};
|
|
6258
|
-
function
|
|
6289
|
+
function Il({
|
|
6259
6290
|
projectId: e,
|
|
6260
6291
|
counts: t,
|
|
6261
6292
|
totalCount: o
|
|
@@ -6265,7 +6296,7 @@ function yl({
|
|
|
6265
6296
|
const r = Object.entries(t).filter(([, n]) => n > 0).map(([n, a]) => `${a} ${a === 1 ? n.replace(/s$/, "") : n}`);
|
|
6266
6297
|
return `Imported template into project (id=${e}): ${r.join(", ")}.`;
|
|
6267
6298
|
}
|
|
6268
|
-
const
|
|
6299
|
+
const vl = {}, Sl = {
|
|
6269
6300
|
id: s.string().describe("The unique identifier for the workspace."),
|
|
6270
6301
|
name: s.string().describe("The name of the workspace."),
|
|
6271
6302
|
plan: s.enum(Ar).describe("The workspace plan type."),
|
|
@@ -6274,12 +6305,12 @@ const wl = {}, Tl = {
|
|
|
6274
6305
|
isGuestAllowed: s.boolean().describe("Whether guests are allowed in the workspace."),
|
|
6275
6306
|
createdAt: s.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
|
|
6276
6307
|
creatorId: s.string().describe("The ID of the user who created the workspace.")
|
|
6277
|
-
},
|
|
6308
|
+
}, Cl = {
|
|
6278
6309
|
type: s.literal("workspaces").describe("The type of the response."),
|
|
6279
|
-
workspaces: s.array(s.object(
|
|
6310
|
+
workspaces: s.array(s.object(Sl)).describe("List of workspaces."),
|
|
6280
6311
|
count: s.number().describe("The total number of workspaces.")
|
|
6281
6312
|
};
|
|
6282
|
-
async function
|
|
6313
|
+
async function jl(e) {
|
|
6283
6314
|
const o = (await e.getWorkspaces()).map((i) => ({
|
|
6284
6315
|
id: i.id,
|
|
6285
6316
|
name: i.name,
|
|
@@ -6310,20 +6341,20 @@ async function Il(e) {
|
|
|
6310
6341
|
};
|
|
6311
6342
|
return { textContent: n, structuredContent: a };
|
|
6312
6343
|
}
|
|
6313
|
-
const
|
|
6344
|
+
const $l = {
|
|
6314
6345
|
name: y.LIST_WORKSPACES,
|
|
6315
6346
|
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.",
|
|
6316
|
-
parameters:
|
|
6317
|
-
outputSchema:
|
|
6347
|
+
parameters: vl,
|
|
6348
|
+
outputSchema: Cl,
|
|
6318
6349
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
6319
6350
|
async execute(e, t) {
|
|
6320
|
-
const o = await
|
|
6351
|
+
const o = await jl(t);
|
|
6321
6352
|
return {
|
|
6322
6353
|
textContent: o.textContent,
|
|
6323
6354
|
structuredContent: o.structuredContent
|
|
6324
6355
|
};
|
|
6325
6356
|
}
|
|
6326
|
-
}, { FIND_TASKS:
|
|
6357
|
+
}, { FIND_TASKS: El, FIND_PROJECT_COLLABORATORS: Uo, UPDATE_TASKS: Al } = y, or = D.BULK_ACTIONS_PER_OPERATION, Dl = {
|
|
6327
6358
|
operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
6328
6359
|
taskIds: s.array(s.string()).min(1).max(or).describe("The IDs of the tasks to operate on (max 50)."),
|
|
6329
6360
|
responsibleUser: s.string().optional().describe(
|
|
@@ -6333,7 +6364,7 @@ const vl = {
|
|
|
6333
6364
|
"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."
|
|
6334
6365
|
),
|
|
6335
6366
|
dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
|
|
6336
|
-
},
|
|
6367
|
+
}, xl = {
|
|
6337
6368
|
results: s.array(
|
|
6338
6369
|
s.object({
|
|
6339
6370
|
taskId: s.string().describe("The ID of the task."),
|
|
@@ -6349,11 +6380,11 @@ const vl = {
|
|
|
6349
6380
|
failed: s.number().describe("Number of failed operations."),
|
|
6350
6381
|
dryRun: s.boolean().describe("Whether this was a dry run.")
|
|
6351
6382
|
}).optional().describe("Summary of the operation.")
|
|
6352
|
-
},
|
|
6383
|
+
}, Ol = {
|
|
6353
6384
|
name: y.MANAGE_ASSIGNMENTS,
|
|
6354
6385
|
description: `Assign, unassign or reassign up to ${or} 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.`,
|
|
6355
|
-
parameters:
|
|
6356
|
-
outputSchema:
|
|
6386
|
+
parameters: Dl,
|
|
6387
|
+
outputSchema: xl,
|
|
6357
6388
|
// Open world: assigning a task notifies the new assignee.
|
|
6358
6389
|
annotations: {
|
|
6359
6390
|
readOnlyHint: !1,
|
|
@@ -6582,39 +6613,39 @@ function at({
|
|
|
6582
6613
|
`;
|
|
6583
6614
|
}
|
|
6584
6615
|
return !o && r.length > 0 ? (c += `**Next steps:**
|
|
6585
|
-
`, c += `• Use ${
|
|
6586
|
-
`, c += `• Use ${
|
|
6587
|
-
`, n.length > 0 && (c += `• Check failed tasks and use ${
|
|
6616
|
+
`, c += `• Use ${El} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
|
|
6617
|
+
`, c += `• Use ${Al} for individual assignment changes
|
|
6618
|
+
`, n.length > 0 && (c += `• Check failed tasks and use ${Uo} to verify collaborator access
|
|
6588
6619
|
`)) : o ? (c += `**To execute:**
|
|
6589
6620
|
`, c += `• Remove dryRun parameter and run again to execute changes
|
|
6590
6621
|
`, r.length > 0 && (c += `• ${r.length} task${r.length === 1 ? "" : "s"} ready for ${e} operation
|
|
6591
6622
|
`), n.length > 0 && (c += `• Fix ${n.length} validation error${n.length === 1 ? "" : "s"} before executing
|
|
6592
6623
|
`)) : r.length === 0 && (c += `**Suggestions:**
|
|
6593
|
-
`, c += `• Use ${
|
|
6624
|
+
`, c += `• Use ${Uo} to find valid assignees
|
|
6594
6625
|
`, c += `• Check task IDs and assignee permissions
|
|
6595
6626
|
`, c += `• Use dryRun=true to validate before executing
|
|
6596
6627
|
`), c;
|
|
6597
6628
|
}
|
|
6598
|
-
const { FIND_PROJECTS:
|
|
6629
|
+
const { FIND_PROJECTS: _l } = y, Pl = {
|
|
6599
6630
|
action: s.enum(["archive", "unarchive", "join"]).describe("The action to perform on the project."),
|
|
6600
6631
|
projectId: s.string().min(1).describe("The ID of the project.")
|
|
6601
|
-
},
|
|
6632
|
+
}, Ul = {
|
|
6602
6633
|
project: me.describe("The updated project."),
|
|
6603
6634
|
success: s.boolean().describe("Whether the action was successful.")
|
|
6604
|
-
},
|
|
6635
|
+
}, Rl = {
|
|
6605
6636
|
archive: "Archived",
|
|
6606
6637
|
unarchive: "Unarchived",
|
|
6607
6638
|
join: "Joined"
|
|
6608
|
-
},
|
|
6639
|
+
}, Nl = {
|
|
6609
6640
|
name: y.PROJECT_MANAGEMENT,
|
|
6610
|
-
description: `Archive or unarchive a project by its ID, or join a workspace project the user hasn't joined (see ${
|
|
6611
|
-
parameters:
|
|
6612
|
-
outputSchema:
|
|
6641
|
+
description: `Archive or unarchive a project by its ID, or join a workspace project the user hasn't joined (see ${_l} includeUnjoined) when they ask to.`,
|
|
6642
|
+
parameters: Pl,
|
|
6643
|
+
outputSchema: Ul,
|
|
6613
6644
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
6614
6645
|
async execute(e, t) {
|
|
6615
|
-
const o = await
|
|
6646
|
+
const o = await Ll(e, t), r = he(o);
|
|
6616
6647
|
return {
|
|
6617
|
-
textContent: `${
|
|
6648
|
+
textContent: `${Rl[e.action]} project: ${r.name} (id=${r.id})`,
|
|
6618
6649
|
structuredContent: {
|
|
6619
6650
|
project: r,
|
|
6620
6651
|
success: !0
|
|
@@ -6622,7 +6653,7 @@ const { FIND_PROJECTS: Al } = y, Dl = {
|
|
|
6622
6653
|
};
|
|
6623
6654
|
}
|
|
6624
6655
|
};
|
|
6625
|
-
async function
|
|
6656
|
+
async function Ll({ action: e, projectId: t }, o) {
|
|
6626
6657
|
switch (e) {
|
|
6627
6658
|
case "archive":
|
|
6628
6659
|
return o.archiveProject(t);
|
|
@@ -6639,7 +6670,7 @@ async function Pl({ action: e, projectId: t }, o) {
|
|
|
6639
6670
|
}
|
|
6640
6671
|
}
|
|
6641
6672
|
}
|
|
6642
|
-
const
|
|
6673
|
+
const Ml = {
|
|
6643
6674
|
action: s.enum(["move-to-workspace", "move-to-personal"]).describe("The action to perform on the project."),
|
|
6644
6675
|
projectId: s.string().min(1).describe("The ID of the project to move."),
|
|
6645
6676
|
workspaceId: s.string().min(1).optional().describe("The target workspace ID. Required when action is move-to-workspace."),
|
|
@@ -6647,14 +6678,14 @@ const Rl = {
|
|
|
6647
6678
|
visibility: s.enum(["restricted", "team", "public"]).optional().describe(
|
|
6648
6679
|
"Optional access visibility for the project in the workspace (restricted, team, or public)."
|
|
6649
6680
|
)
|
|
6650
|
-
},
|
|
6681
|
+
}, Fl = {
|
|
6651
6682
|
project: me.describe("The moved project."),
|
|
6652
6683
|
success: s.boolean().describe("Whether the move was successful.")
|
|
6653
|
-
},
|
|
6684
|
+
}, Hl = {
|
|
6654
6685
|
name: y.PROJECT_MOVE,
|
|
6655
6686
|
description: "Move a project between personal and workspace contexts.",
|
|
6656
|
-
parameters:
|
|
6657
|
-
outputSchema:
|
|
6687
|
+
parameters: Ml,
|
|
6688
|
+
outputSchema: Fl,
|
|
6658
6689
|
// Destructive: move-to-personal removes every collaborator from the project.
|
|
6659
6690
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
6660
6691
|
async execute(e, t) {
|
|
@@ -6689,7 +6720,7 @@ function sr(e, t) {
|
|
|
6689
6720
|
for (const f of r)
|
|
6690
6721
|
if (!o.has(f))
|
|
6691
6722
|
throw new Error(`Sibling id=${f} is not in the list being reordered`);
|
|
6692
|
-
const n = e.every((f) => f.key !== null), i = [...e].sort(n ?
|
|
6723
|
+
const n = e.every((f) => f.key !== null), i = [...e].sort(n ? zl : ql).filter((f) => !r.has(f.id)), c = [...t].sort((f, h) => f.position - h.position);
|
|
6693
6724
|
let d;
|
|
6694
6725
|
for (const { id: f, position: h } of c) {
|
|
6695
6726
|
const m = o.get(f);
|
|
@@ -6697,8 +6728,8 @@ function sr(e, t) {
|
|
|
6697
6728
|
const b = d?.position === h ? d.index + 1 : h, g = Math.min(b, i.length);
|
|
6698
6729
|
i.splice(g, 0, m), d = { position: h, index: g };
|
|
6699
6730
|
}
|
|
6700
|
-
if (!n || !
|
|
6701
|
-
return
|
|
6731
|
+
if (!n || !Bl(i, r))
|
|
6732
|
+
return Kl(i);
|
|
6702
6733
|
const u = /* @__PURE__ */ new Map();
|
|
6703
6734
|
let l = [], p = null;
|
|
6704
6735
|
for (const f of i) {
|
|
@@ -6706,12 +6737,12 @@ function sr(e, t) {
|
|
|
6706
6737
|
l.push(f);
|
|
6707
6738
|
continue;
|
|
6708
6739
|
}
|
|
6709
|
-
|
|
6740
|
+
Ro(l, p, f.key, u), l = [], p = f.key;
|
|
6710
6741
|
}
|
|
6711
|
-
return
|
|
6742
|
+
return Ro(l, p, null, u), u;
|
|
6712
6743
|
}
|
|
6713
|
-
function
|
|
6714
|
-
if (e.length === 0 ||
|
|
6744
|
+
function Ro(e, t, o, r) {
|
|
6745
|
+
if (e.length === 0 || Wl(e, t, o))
|
|
6715
6746
|
return;
|
|
6716
6747
|
const n = ts(t, o, e.length);
|
|
6717
6748
|
e.forEach((a, i) => {
|
|
@@ -6719,7 +6750,7 @@ function Uo(e, t, o, r) {
|
|
|
6719
6750
|
c !== void 0 && c !== a.key && r.set(a.id, c);
|
|
6720
6751
|
});
|
|
6721
6752
|
}
|
|
6722
|
-
function
|
|
6753
|
+
function Wl(e, t, o) {
|
|
6723
6754
|
let r = t;
|
|
6724
6755
|
for (const { key: n } of e) {
|
|
6725
6756
|
if (n === null || r !== null && n <= r)
|
|
@@ -6728,7 +6759,7 @@ function Ll(e, t, o) {
|
|
|
6728
6759
|
}
|
|
6729
6760
|
return o === null || r !== null && r < o;
|
|
6730
6761
|
}
|
|
6731
|
-
function
|
|
6762
|
+
function Bl(e, t) {
|
|
6732
6763
|
let o = null;
|
|
6733
6764
|
for (const { id: r, key: n } of e)
|
|
6734
6765
|
if (!t.has(r)) {
|
|
@@ -6738,21 +6769,21 @@ function Ml(e, t) {
|
|
|
6738
6769
|
}
|
|
6739
6770
|
return !0;
|
|
6740
6771
|
}
|
|
6741
|
-
function
|
|
6772
|
+
function Kl(e) {
|
|
6742
6773
|
const t = ts(null, null, e.length), o = /* @__PURE__ */ new Map();
|
|
6743
6774
|
return e.forEach((r, n) => {
|
|
6744
6775
|
const a = t[n];
|
|
6745
6776
|
a !== void 0 && a !== r.key && o.set(r.id, a);
|
|
6746
6777
|
}), o;
|
|
6747
6778
|
}
|
|
6748
|
-
function
|
|
6779
|
+
function zl(e, t) {
|
|
6749
6780
|
const o = e.key ?? "", r = t.key ?? "";
|
|
6750
6781
|
return o < r ? -1 : o > r ? 1 : 0;
|
|
6751
6782
|
}
|
|
6752
|
-
function
|
|
6783
|
+
function ql(e, t) {
|
|
6753
6784
|
return e.legacyOrder - t.legacyOrder;
|
|
6754
6785
|
}
|
|
6755
|
-
const rr = ["project", "section"],
|
|
6786
|
+
const rr = ["project", "section"], Gl = s.object({
|
|
6756
6787
|
id: s.string().min(1).describe("The ID of the entity."),
|
|
6757
6788
|
order: s.number().int().min(0).optional().describe(
|
|
6758
6789
|
"0-based position among its siblings after the reorder: 0 is first, past the end is last. Unlisted siblings keep their relative order."
|
|
@@ -6760,25 +6791,25 @@ const rr = ["project", "section"], Bl = s.object({
|
|
|
6760
6791
|
parentId: s.string().min(1).optional().describe(
|
|
6761
6792
|
'Move a personal project under this parent project ID, or "root" for the top level. Personal projects only.'
|
|
6762
6793
|
)
|
|
6763
|
-
}),
|
|
6794
|
+
}), Yl = {
|
|
6764
6795
|
type: s.enum(rr).describe(
|
|
6765
6796
|
'"project": personal projects among the siblings under their parent, or workspace projects within their folder. "section": sections within their project.'
|
|
6766
6797
|
),
|
|
6767
|
-
items: s.array(
|
|
6798
|
+
items: s.array(Gl).min(1).max(D.BULK_ACTIONS_PER_OPERATION).describe(
|
|
6768
6799
|
"Each item needs order and/or parentId. Moves happen first, so order is a position under the new parent."
|
|
6769
6800
|
)
|
|
6770
|
-
},
|
|
6801
|
+
}, Vl = {
|
|
6771
6802
|
type: s.enum(rr).describe("The type of entity that was reordered/moved."),
|
|
6772
6803
|
movedCount: s.number().describe("The number of entities moved to a new parent."),
|
|
6773
6804
|
reorderedCount: s.number().describe("The number of entities reordered."),
|
|
6774
6805
|
affectedIds: s.array(s.string()).describe("The IDs of the entities moved or reordered."),
|
|
6775
6806
|
failures: s.array(_).describe("Entities that could not be moved or reordered, with the reason for each."),
|
|
6776
6807
|
success: s.boolean().describe("Whether every entity was moved and reordered as asked.")
|
|
6777
|
-
},
|
|
6808
|
+
}, Jl = {
|
|
6778
6809
|
name: y.REORDER_OBJECTS,
|
|
6779
6810
|
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.',
|
|
6780
|
-
parameters:
|
|
6781
|
-
outputSchema:
|
|
6811
|
+
parameters: Yl,
|
|
6812
|
+
outputSchema: Vl,
|
|
6782
6813
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
6783
6814
|
async execute(e, t) {
|
|
6784
6815
|
const { type: o, items: r } = e, n = /* @__PURE__ */ new Set();
|
|
@@ -6794,13 +6825,13 @@ const rr = ["project", "section"], Bl = s.object({
|
|
|
6794
6825
|
`parentId is only supported when type is "project", but type is "${o}".`
|
|
6795
6826
|
);
|
|
6796
6827
|
}
|
|
6797
|
-
const a = o === "project" ? await
|
|
6828
|
+
const a = o === "project" ? await Xl(t, r) : await Zl(t, r);
|
|
6798
6829
|
O(y.REORDER_OBJECTS, r.length, a.failures);
|
|
6799
6830
|
const i = o === "project" ? "projects" : "sections", c = r.map((l) => l.id).filter((l) => a.movedIds.has(l) || a.reorderedIds.has(l)), d = [];
|
|
6800
6831
|
a.movedIds.size > 0 && d.push(`moved ${a.movedIds.size}`), (a.reorderedIds.size > 0 || d.length === 0) && d.push(`reordered ${a.reorderedIds.size}`);
|
|
6801
6832
|
const u = c.length > 0 ? `${d.join(" and ")} ${i}: ${c.map((l) => `id=${l}`).join(", ")}` : `${d.join(" and ")} ${i}`;
|
|
6802
6833
|
return {
|
|
6803
|
-
textContent:
|
|
6834
|
+
textContent: U(u, a.failures),
|
|
6804
6835
|
structuredContent: {
|
|
6805
6836
|
type: o,
|
|
6806
6837
|
movedCount: a.movedIds.size,
|
|
@@ -6812,12 +6843,12 @@ const rr = ["project", "section"], Bl = s.object({
|
|
|
6812
6843
|
};
|
|
6813
6844
|
}
|
|
6814
6845
|
};
|
|
6815
|
-
async function
|
|
6846
|
+
async function Xl(e, t) {
|
|
6816
6847
|
const o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), n = [];
|
|
6817
6848
|
let a = await Lo(e);
|
|
6818
6849
|
const i = [];
|
|
6819
6850
|
for (const m of t) {
|
|
6820
|
-
const b = a.get(m.id), g = b ?
|
|
6851
|
+
const b = a.get(m.id), g = b ? Ql(b, m) : "Project not found, or you do not have access to it.";
|
|
6821
6852
|
g ? n.push({ item: m.id, error: g }) : i.push(m);
|
|
6822
6853
|
}
|
|
6823
6854
|
const c = i.filter((m) => m.parentId !== void 0), d = /* @__PURE__ */ new Set();
|
|
@@ -6853,7 +6884,7 @@ async function Gl(e, t) {
|
|
|
6853
6884
|
});
|
|
6854
6885
|
return { movedIds: o, reorderedIds: r, failures: n };
|
|
6855
6886
|
}
|
|
6856
|
-
const l = nr([...a.values()].filter(
|
|
6887
|
+
const l = nr([...a.values()].filter(eu), No), p = /* @__PURE__ */ new Map(), f = [];
|
|
6857
6888
|
for (const m of u) {
|
|
6858
6889
|
const b = a.get(m.id);
|
|
6859
6890
|
if (!b) {
|
|
@@ -6866,7 +6897,7 @@ async function Gl(e, t) {
|
|
|
6866
6897
|
}
|
|
6867
6898
|
const h = [];
|
|
6868
6899
|
for (const [m, b] of p) {
|
|
6869
|
-
const g = l.get(m) ?? [], w = sr(g.map(
|
|
6900
|
+
const g = l.get(m) ?? [], w = sr(g.map(tu), b);
|
|
6870
6901
|
for (const [I, k] of w) {
|
|
6871
6902
|
const S = a.get(I);
|
|
6872
6903
|
h.push({
|
|
@@ -6880,8 +6911,8 @@ async function Gl(e, t) {
|
|
|
6880
6911
|
}
|
|
6881
6912
|
return await ar(e, h, f, r, n), { movedIds: o, reorderedIds: r, failures: n };
|
|
6882
6913
|
}
|
|
6883
|
-
async function
|
|
6884
|
-
const o = /* @__PURE__ */ new Set(), r = [], n = await
|
|
6914
|
+
async function Zl(e, t) {
|
|
6915
|
+
const o = /* @__PURE__ */ new Set(), r = [], n = await ou(e), a = nr(
|
|
6885
6916
|
[...n.values()].filter((l) => !l.isDeleted && !l.isArchived),
|
|
6886
6917
|
(l) => l.projectId
|
|
6887
6918
|
), i = t.filter((l) => l.order !== void 0), c = /* @__PURE__ */ new Map(), d = [];
|
|
@@ -6940,7 +6971,7 @@ async function ar(e, t, o, r, n) {
|
|
|
6940
6971
|
for (const { id: i } of o)
|
|
6941
6972
|
a.has(i) || r.add(i);
|
|
6942
6973
|
}
|
|
6943
|
-
function
|
|
6974
|
+
function Ql(e, t) {
|
|
6944
6975
|
if (e.isDeleted)
|
|
6945
6976
|
return "Project not found, or you do not have access to it.";
|
|
6946
6977
|
if (e.isArchived)
|
|
@@ -6950,13 +6981,13 @@ function Vl(e, t) {
|
|
|
6950
6981
|
if (W(e) && t.parentId !== void 0)
|
|
6951
6982
|
return "parentId is only supported for personal projects. Workspace projects are ordered within their folder; omit parentId to reorder it there.";
|
|
6952
6983
|
}
|
|
6953
|
-
function
|
|
6984
|
+
function eu(e) {
|
|
6954
6985
|
return e.isDeleted || e.isArchived ? !1 : W(e) || !e.inboxProject;
|
|
6955
6986
|
}
|
|
6956
6987
|
function No(e) {
|
|
6957
6988
|
return W(e) ? `workspace:${e.workspaceId}:${e.folderId ?? "root"}` : `personal:${e.parentId ?? "root"}`;
|
|
6958
6989
|
}
|
|
6959
|
-
function
|
|
6990
|
+
function tu(e) {
|
|
6960
6991
|
return W(e) ? {
|
|
6961
6992
|
id: e.id,
|
|
6962
6993
|
key: e.defaultOrderKey ?? null,
|
|
@@ -6969,41 +7000,41 @@ async function Lo(e) {
|
|
|
6969
7000
|
);
|
|
6970
7001
|
return new Map((t.projects ?? []).map((o) => [o.id, o]));
|
|
6971
7002
|
}
|
|
6972
|
-
async function
|
|
7003
|
+
async function ou(e) {
|
|
6973
7004
|
const t = await j(
|
|
6974
7005
|
() => e.sync({ resourceTypes: ["sections"], syncToken: "*" })
|
|
6975
7006
|
);
|
|
6976
7007
|
return new Map((t.sections ?? []).map((o) => [o.id, o]));
|
|
6977
7008
|
}
|
|
6978
|
-
const
|
|
7009
|
+
const su = s.object({
|
|
6979
7010
|
id: s.string().min(1).describe("The ID of the task to reschedule."),
|
|
6980
7011
|
date: s.string().min(1).describe(
|
|
6981
7012
|
"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."
|
|
6982
7013
|
),
|
|
6983
7014
|
duration: s.string().optional().describe('Optional new duration, e.g. for time-blocking: "15m", "1h", "2h30m".')
|
|
6984
|
-
}),
|
|
6985
|
-
tasks: s.array(
|
|
6986
|
-
},
|
|
7015
|
+
}), ru = {
|
|
7016
|
+
tasks: s.array(su).min(1).max(D.BULK_ACTIONS_PER_OPERATION).describe("The tasks to reschedule with their new dates.")
|
|
7017
|
+
}, nu = {
|
|
6987
7018
|
tasks: s.array(te).describe("The rescheduled tasks."),
|
|
6988
7019
|
totalCount: s.number().describe("The total number of tasks rescheduled."),
|
|
6989
7020
|
rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks."),
|
|
6990
7021
|
failures: s.array(_).describe("Tasks that could not be rescheduled, with reasons.")
|
|
6991
|
-
},
|
|
7022
|
+
}, au = {
|
|
6992
7023
|
name: y.RESCHEDULE_TASKS,
|
|
6993
7024
|
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.",
|
|
6994
|
-
parameters:
|
|
6995
|
-
outputSchema:
|
|
7025
|
+
parameters: ru,
|
|
7026
|
+
outputSchema: nu,
|
|
6996
7027
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6997
7028
|
async execute(e, t) {
|
|
6998
7029
|
const { tasks: o } = e, r = o.map(
|
|
6999
|
-
(h) => h.duration ?
|
|
7030
|
+
(h) => h.duration ? Ut(`Task ${h.id}`, h.duration) : void 0
|
|
7000
7031
|
), n = [], a = await Promise.allSettled(
|
|
7001
7032
|
o.map((h) => j(() => t.getTask(h.id)))
|
|
7002
7033
|
), i = P(o, a, (h) => h.id);
|
|
7003
7034
|
n.push(...i.failures);
|
|
7004
7035
|
const c = [];
|
|
7005
7036
|
for (const { item: h, index: m, value: b } of i.succeeded) {
|
|
7006
|
-
const g =
|
|
7037
|
+
const g = iu(h.date, b);
|
|
7007
7038
|
g && c.push({
|
|
7008
7039
|
id: h.id,
|
|
7009
7040
|
command: Y("item_update", {
|
|
@@ -7046,7 +7077,7 @@ Could not read back ${l.join(", ")}: ${p}` : zt("Rescheduled", u, {
|
|
|
7046
7077
|
showDetails: u.length <= 5
|
|
7047
7078
|
});
|
|
7048
7079
|
return {
|
|
7049
|
-
textContent:
|
|
7080
|
+
textContent: U(f, n),
|
|
7050
7081
|
structuredContent: {
|
|
7051
7082
|
tasks: u,
|
|
7052
7083
|
totalCount: d.length,
|
|
@@ -7056,11 +7087,11 @@ Could not read back ${l.join(", ")}: ${p}` : zt("Rescheduled", u, {
|
|
|
7056
7087
|
};
|
|
7057
7088
|
}
|
|
7058
7089
|
};
|
|
7059
|
-
function
|
|
7090
|
+
function iu(e, t) {
|
|
7060
7091
|
if (t.due)
|
|
7061
7092
|
return {
|
|
7062
7093
|
due: {
|
|
7063
|
-
date:
|
|
7094
|
+
date: cu(e, t.due),
|
|
7064
7095
|
string: t.due.string,
|
|
7065
7096
|
isRecurring: t.due.isRecurring,
|
|
7066
7097
|
timezone: t.due.timezone ?? void 0,
|
|
@@ -7070,16 +7101,16 @@ function su(e, t) {
|
|
|
7070
7101
|
if (t.deadline)
|
|
7071
7102
|
return { deadline: { date: e.slice(0, 10) } };
|
|
7072
7103
|
}
|
|
7073
|
-
function
|
|
7104
|
+
function cu(e, t) {
|
|
7074
7105
|
if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
|
|
7075
7106
|
const r = t.datetime.substring(10);
|
|
7076
7107
|
return e + r;
|
|
7077
7108
|
}
|
|
7078
7109
|
return e;
|
|
7079
7110
|
}
|
|
7080
|
-
const
|
|
7111
|
+
const du = {
|
|
7081
7112
|
query: s.string().min(1).describe("The search query string to find tasks and projects.")
|
|
7082
|
-
},
|
|
7113
|
+
}, lu = {
|
|
7083
7114
|
results: s.array(
|
|
7084
7115
|
s.object({
|
|
7085
7116
|
id: s.string().describe("The ID of the result."),
|
|
@@ -7088,11 +7119,11 @@ const nu = {
|
|
|
7088
7119
|
})
|
|
7089
7120
|
).describe("The search results."),
|
|
7090
7121
|
totalCount: s.number().describe("Total number of results found.")
|
|
7091
|
-
},
|
|
7122
|
+
}, uu = {
|
|
7092
7123
|
name: y.SEARCH,
|
|
7093
7124
|
description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
|
|
7094
|
-
parameters:
|
|
7095
|
-
outputSchema:
|
|
7125
|
+
parameters: du,
|
|
7126
|
+
outputSchema: lu,
|
|
7096
7127
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
7097
7128
|
async execute(e, t) {
|
|
7098
7129
|
const { query: o } = e, [r, n] = await Promise.all([
|
|
@@ -7121,8 +7152,8 @@ const nu = {
|
|
|
7121
7152
|
structuredContent: { results: a, totalCount: a.length }
|
|
7122
7153
|
};
|
|
7123
7154
|
}
|
|
7124
|
-
},
|
|
7125
|
-
message: s.string().trim().min(1).max(
|
|
7155
|
+
}, pu = 80, hu = {
|
|
7156
|
+
message: s.string().trim().min(1).max(pu).optional().describe("Omit for an emoji-only status."),
|
|
7126
7157
|
emoji: s.string().trim().min(1).optional().describe("A Unicode emoji, such as 🏝️."),
|
|
7127
7158
|
activeUntil: s.string().trim().optional().describe(
|
|
7128
7159
|
"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."
|
|
@@ -7130,20 +7161,20 @@ const nu = {
|
|
|
7130
7161
|
pauseNotifications: s.boolean().optional().describe("Hold back Comms notifications while active. They are not sent later."),
|
|
7131
7162
|
pauseActivity: s.boolean().optional().describe("Pause Karma and streaks while active."),
|
|
7132
7163
|
clear: s.boolean().optional().describe("Remove the status. Use alone.")
|
|
7133
|
-
},
|
|
7164
|
+
}, mu = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|([+-])(\d{2}):(\d{2}))$/i, fu = -720, bu = 840;
|
|
7134
7165
|
function it(e) {
|
|
7135
7166
|
return new Error(
|
|
7136
7167
|
`activeUntil must be an ISO 8601 timestamp with Z or an offset, such as "2026-11-10T00:00:00+00:00". Got "${e}".`
|
|
7137
7168
|
);
|
|
7138
7169
|
}
|
|
7139
|
-
function
|
|
7140
|
-
const o =
|
|
7170
|
+
function gu(e, t) {
|
|
7171
|
+
const o = mu.exec(e);
|
|
7141
7172
|
if (!o)
|
|
7142
7173
|
throw it(e);
|
|
7143
7174
|
const [, r, n, a, i, c, d = "0", u = ""] = o, [l, p, f, h, m, b] = [r, n, a, i, c, d].map(Number), g = /* @__PURE__ */ new Date(0);
|
|
7144
7175
|
g.setUTCFullYear(l, p - 1, f), g.setUTCHours(h, m, b);
|
|
7145
7176
|
const w = g.getUTCFullYear() === l && g.getUTCMonth() === p - 1 && g.getUTCDate() === f && g.getUTCHours() === h && g.getUTCMinutes() === m && g.getUTCSeconds() === b, I = u.toUpperCase() === "Z" ? 0 : Ze(u);
|
|
7146
|
-
if (!w || I <
|
|
7177
|
+
if (!w || I < fu || I > bu)
|
|
7147
7178
|
throw it(e);
|
|
7148
7179
|
const k = new Date(e);
|
|
7149
7180
|
if (Number.isNaN(k.getTime()))
|
|
@@ -7153,7 +7184,7 @@ function hu(e, t) {
|
|
|
7153
7184
|
return k.toISOString();
|
|
7154
7185
|
}
|
|
7155
7186
|
const Mo = { scope: { mode: "all" } };
|
|
7156
|
-
function
|
|
7187
|
+
function yu(e, t) {
|
|
7157
7188
|
const { clear: o, message: r, emoji: n, activeUntil: a, pauseNotifications: i, pauseActivity: c } = e;
|
|
7158
7189
|
if (o) {
|
|
7159
7190
|
if (r !== void 0 || n !== void 0 || a !== void 0 || i === !0 || c === !0)
|
|
@@ -7167,7 +7198,7 @@ function mu(e, t) {
|
|
|
7167
7198
|
return {
|
|
7168
7199
|
message: r ?? null,
|
|
7169
7200
|
emoji: n ?? null,
|
|
7170
|
-
activeUntil: a !== void 0 ?
|
|
7201
|
+
activeUntil: a !== void 0 ? gu(a, t) : null,
|
|
7171
7202
|
effects: i || c ? {
|
|
7172
7203
|
pauseNotifications: i ? Mo : null,
|
|
7173
7204
|
pauseActivity: c ? Mo : null
|
|
@@ -7177,17 +7208,17 @@ function mu(e, t) {
|
|
|
7177
7208
|
function Fo(e) {
|
|
7178
7209
|
return e ? e.replace(/\uFE0F/g, "") : null;
|
|
7179
7210
|
}
|
|
7180
|
-
function
|
|
7211
|
+
function wu(e, t) {
|
|
7181
7212
|
const o = e.activeUntil ? new Date(e.activeUntil).getTime() : null, r = t.activeUntil ? new Date(t.activeUntil).getTime() : null;
|
|
7182
7213
|
return (
|
|
7183
7214
|
// An emoji-only status may be held with its message null or left out.
|
|
7184
7215
|
(e.message ?? null) === (t.message ?? null) && Fo(e.emoji) === Fo(t.emoji) && o === r && !!e.effects?.pauseNotifications == !!t.effects?.pauseNotifications && !!e.effects?.pauseActivity == !!t.effects?.pauseActivity
|
|
7185
7216
|
);
|
|
7186
7217
|
}
|
|
7187
|
-
const
|
|
7218
|
+
const Tu = {
|
|
7188
7219
|
name: y.SET_USER_STATUS,
|
|
7189
7220
|
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.",
|
|
7190
|
-
parameters:
|
|
7221
|
+
parameters: hu,
|
|
7191
7222
|
outputSchema: er,
|
|
7192
7223
|
annotations: {
|
|
7193
7224
|
readOnlyHint: !1,
|
|
@@ -7196,7 +7227,7 @@ const bu = {
|
|
|
7196
7227
|
openWorldHint: !0
|
|
7197
7228
|
},
|
|
7198
7229
|
async execute(e, t) {
|
|
7199
|
-
const o =
|
|
7230
|
+
const o = yu(e, /* @__PURE__ */ new Date()), {
|
|
7200
7231
|
outcomes: [r]
|
|
7201
7232
|
} = await V(t, [Y("user_update", { status: o })]);
|
|
7202
7233
|
if (r?.status !== "fulfilled")
|
|
@@ -7217,30 +7248,30 @@ const bu = {
|
|
|
7217
7248
|
throw new Error(
|
|
7218
7249
|
"Todoist accepted the status but reports no active status, so it may have expired already."
|
|
7219
7250
|
);
|
|
7220
|
-
if (!
|
|
7251
|
+
if (!wu(n, o))
|
|
7221
7252
|
throw new Error(
|
|
7222
7253
|
`Todoist accepted the status but reports a different one. Another app may have changed it at the same moment; use ${y.GET_USER_STATUS} to see it.`
|
|
7223
7254
|
);
|
|
7224
7255
|
return Ct(n, "Status set");
|
|
7225
7256
|
}
|
|
7226
|
-
},
|
|
7257
|
+
}, ku = {
|
|
7227
7258
|
ids: s.array(s.string().min(1)).min(1).max(D.BULK_ACTIONS_PER_OPERATION).describe("The IDs of the tasks to uncomplete.")
|
|
7228
|
-
},
|
|
7259
|
+
}, Iu = {
|
|
7229
7260
|
uncompleted: s.array(s.string()).describe("The IDs of successfully uncompleted tasks."),
|
|
7230
7261
|
failures: s.array(_).describe("Failed task uncompletion with error details."),
|
|
7231
7262
|
totalRequested: s.number().describe("The total number of tasks requested to uncomplete."),
|
|
7232
7263
|
successCount: s.number().describe("The number of successfully uncompleted tasks."),
|
|
7233
7264
|
failureCount: s.number().describe("The number of failed task uncompletions.")
|
|
7234
|
-
},
|
|
7265
|
+
}, vu = {
|
|
7235
7266
|
name: y.UNCOMPLETE_TASKS,
|
|
7236
7267
|
description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
|
|
7237
|
-
parameters:
|
|
7238
|
-
outputSchema:
|
|
7268
|
+
parameters: ku,
|
|
7269
|
+
outputSchema: Iu,
|
|
7239
7270
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
7240
7271
|
async execute(e, t) {
|
|
7241
|
-
const o = await
|
|
7272
|
+
const o = await Su(t, e.ids), { succeeded: r, failures: n } = P(e.ids, o, (c) => c), a = r.map(({ item: c }) => c);
|
|
7242
7273
|
return O(y.UNCOMPLETE_TASKS, e.ids.length, n), {
|
|
7243
|
-
textContent:
|
|
7274
|
+
textContent: Cu({
|
|
7244
7275
|
uncompleted: a,
|
|
7245
7276
|
failures: n,
|
|
7246
7277
|
args: e
|
|
@@ -7255,7 +7286,7 @@ const bu = {
|
|
|
7255
7286
|
};
|
|
7256
7287
|
}
|
|
7257
7288
|
};
|
|
7258
|
-
async function
|
|
7289
|
+
async function Su(e, t) {
|
|
7259
7290
|
const o = [...new Set(t)], { outcomes: r } = await V(
|
|
7260
7291
|
e,
|
|
7261
7292
|
o.map((a) => Y("item_uncomplete", { id: a })),
|
|
@@ -7268,7 +7299,7 @@ async function Tu(e, t) {
|
|
|
7268
7299
|
}
|
|
7269
7300
|
);
|
|
7270
7301
|
}
|
|
7271
|
-
function
|
|
7302
|
+
function Cu({
|
|
7272
7303
|
uncompleted: e,
|
|
7273
7304
|
failures: t,
|
|
7274
7305
|
args: o
|
|
@@ -7282,12 +7313,12 @@ function ku({
|
|
|
7282
7313
|
failures: t
|
|
7283
7314
|
});
|
|
7284
7315
|
}
|
|
7285
|
-
const
|
|
7316
|
+
const ju = s.object({
|
|
7286
7317
|
id: s.string().min(1).describe("The ID of the comment to update."),
|
|
7287
7318
|
content: s.string().min(1).describe("The new content for the comment.")
|
|
7288
|
-
}),
|
|
7289
|
-
comments: s.array(
|
|
7290
|
-
},
|
|
7319
|
+
}), $u = {
|
|
7320
|
+
comments: s.array(ju).min(1).max(D.ITEMS_PER_OPERATION).describe("The comments to update.")
|
|
7321
|
+
}, Eu = {
|
|
7291
7322
|
comments: s.array(Le).describe("The updated comments."),
|
|
7292
7323
|
totalCount: s.number().describe("The total number of comments updated."),
|
|
7293
7324
|
updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
|
|
@@ -7296,11 +7327,11 @@ const Iu = s.object({
|
|
|
7296
7327
|
updateCount: s.number().describe("The number of comments updated."),
|
|
7297
7328
|
failureCount: s.number()
|
|
7298
7329
|
}).describe("Summary of operations performed.")
|
|
7299
|
-
},
|
|
7330
|
+
}, Au = {
|
|
7300
7331
|
name: y.UPDATE_COMMENTS,
|
|
7301
7332
|
description: "Update multiple existing comments with new content.",
|
|
7302
|
-
parameters:
|
|
7303
|
-
outputSchema:
|
|
7333
|
+
parameters: $u,
|
|
7334
|
+
outputSchema: Eu,
|
|
7304
7335
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
7305
7336
|
async execute(e, t) {
|
|
7306
7337
|
const { comments: o } = e, r = await Promise.allSettled(
|
|
@@ -7311,8 +7342,8 @@ const Iu = s.object({
|
|
|
7311
7342
|
)
|
|
7312
7343
|
), { succeeded: n, failures: a } = P(o, r, (d) => d.id), i = n.map(({ value: d }) => Ne(d));
|
|
7313
7344
|
return O(y.UPDATE_COMMENTS, o.length, a), {
|
|
7314
|
-
textContent:
|
|
7315
|
-
|
|
7345
|
+
textContent: U(
|
|
7346
|
+
Du({ comments: i }),
|
|
7316
7347
|
a
|
|
7317
7348
|
),
|
|
7318
7349
|
structuredContent: {
|
|
@@ -7328,7 +7359,7 @@ const Iu = s.object({
|
|
|
7328
7359
|
};
|
|
7329
7360
|
}
|
|
7330
7361
|
};
|
|
7331
|
-
function
|
|
7362
|
+
function Du({ comments: e }) {
|
|
7332
7363
|
const t = e.filter((a) => a.taskId).length, o = e.filter((a) => a.projectId).length, r = [];
|
|
7333
7364
|
if (t > 0) {
|
|
7334
7365
|
const a = t > 1 ? "comments" : "comment";
|
|
@@ -7340,7 +7371,7 @@ function ju({ comments: e }) {
|
|
|
7340
7371
|
}
|
|
7341
7372
|
return r.length > 0 ? `Updated ${r.join(" and ")}` : "No comments updated";
|
|
7342
7373
|
}
|
|
7343
|
-
const
|
|
7374
|
+
const xu = s.object({
|
|
7344
7375
|
id: s.string().min(1).describe("The ID of the filter to update."),
|
|
7345
7376
|
name: s.string().min(1).optional().describe("The new name of the filter."),
|
|
7346
7377
|
query: s.string().min(1).optional().describe(
|
|
@@ -7355,9 +7386,9 @@ const $u = s.object({
|
|
|
7355
7386
|
).optional(),
|
|
7356
7387
|
color: je,
|
|
7357
7388
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite.")
|
|
7358
|
-
}),
|
|
7359
|
-
filters: s.array(
|
|
7360
|
-
},
|
|
7389
|
+
}), Ou = {
|
|
7390
|
+
filters: s.array(xu).min(1).max(D.ITEMS_PER_OPERATION).describe("The filters to update.")
|
|
7391
|
+
}, _u = {
|
|
7361
7392
|
filters: s.array(Gt).describe(
|
|
7362
7393
|
"The updated filters, as read back after the update. Empty if they could not be read back; updatedFilterIds still lists what was updated."
|
|
7363
7394
|
),
|
|
@@ -7369,15 +7400,15 @@ const $u = s.object({
|
|
|
7369
7400
|
skippedCount: s.number().describe("The number of filters skipped (no changes)."),
|
|
7370
7401
|
failureCount: s.number()
|
|
7371
7402
|
}).describe("Summary of operations performed.")
|
|
7372
|
-
},
|
|
7403
|
+
}, Pu = {
|
|
7373
7404
|
name: y.UPDATE_FILTERS,
|
|
7374
7405
|
description: "Update one or more existing personal filters with new values.",
|
|
7375
|
-
parameters:
|
|
7376
|
-
outputSchema:
|
|
7406
|
+
parameters: Ou,
|
|
7407
|
+
outputSchema: _u,
|
|
7377
7408
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
7378
7409
|
async execute(e, t) {
|
|
7379
7410
|
const { filters: o } = e, r = [], a = o.map((m) => {
|
|
7380
|
-
const b =
|
|
7411
|
+
const b = Nu(m);
|
|
7381
7412
|
return b !== null ? { kind: "skipped", reason: b } : (r.push(m), { kind: "updated", filter: m });
|
|
7382
7413
|
}).filter((m) => m.kind === "skipped").length;
|
|
7383
7414
|
if (r.length === 0)
|
|
@@ -7415,11 +7446,11 @@ const $u = s.object({
|
|
|
7415
7446
|
error: f
|
|
7416
7447
|
});
|
|
7417
7448
|
}
|
|
7418
|
-
m && (p =
|
|
7449
|
+
m && (p = Uu(m, new Set(l)));
|
|
7419
7450
|
}
|
|
7420
7451
|
return {
|
|
7421
|
-
textContent:
|
|
7422
|
-
|
|
7452
|
+
textContent: U(
|
|
7453
|
+
Ru({
|
|
7423
7454
|
filters: p,
|
|
7424
7455
|
updatedIds: l,
|
|
7425
7456
|
skippedCount: a,
|
|
@@ -7441,7 +7472,7 @@ const $u = s.object({
|
|
|
7441
7472
|
};
|
|
7442
7473
|
}
|
|
7443
7474
|
};
|
|
7444
|
-
function
|
|
7475
|
+
function Uu(e, t) {
|
|
7445
7476
|
return e.filter((o) => !o.isDeleted && t.has(o.id)).map((o) => ({
|
|
7446
7477
|
id: o.id,
|
|
7447
7478
|
name: o.name,
|
|
@@ -7452,7 +7483,7 @@ function xu(e, t) {
|
|
|
7452
7483
|
itemOrder: o.itemOrder
|
|
7453
7484
|
}));
|
|
7454
7485
|
}
|
|
7455
|
-
function
|
|
7486
|
+
function Ru({
|
|
7456
7487
|
filters: e,
|
|
7457
7488
|
updatedIds: t,
|
|
7458
7489
|
skippedCount: o,
|
|
@@ -7471,24 +7502,24 @@ ${i}`;
|
|
|
7471
7502
|
}
|
|
7472
7503
|
return a;
|
|
7473
7504
|
}
|
|
7474
|
-
function
|
|
7505
|
+
function Nu({ id: e, ...t }) {
|
|
7475
7506
|
return Object.values(t).every((r) => r === void 0) ? "no-fields" : null;
|
|
7476
7507
|
}
|
|
7477
|
-
const
|
|
7508
|
+
const Lu = s.object({
|
|
7478
7509
|
id: s.string().min(1).describe("The ID of the folder to rename."),
|
|
7479
7510
|
name: s.string().min(1).describe("The new name of the folder.")
|
|
7480
|
-
}),
|
|
7481
|
-
folders: s.array(
|
|
7482
|
-
},
|
|
7511
|
+
}), Mu = {
|
|
7512
|
+
folders: s.array(Lu).min(1).max(D.ITEMS_PER_OPERATION).describe("The folders to rename.")
|
|
7513
|
+
}, Fu = {
|
|
7483
7514
|
folders: s.array(Wt).describe("The renamed folders."),
|
|
7484
7515
|
failures: s.array(_).describe("Folders that could not be renamed, with the reason for each."),
|
|
7485
7516
|
successCount: s.number(),
|
|
7486
7517
|
failureCount: s.number()
|
|
7487
|
-
},
|
|
7518
|
+
}, Hu = {
|
|
7488
7519
|
name: y.UPDATE_FOLDERS,
|
|
7489
7520
|
description: "Rename one or more workspace folders.",
|
|
7490
|
-
parameters:
|
|
7491
|
-
outputSchema:
|
|
7521
|
+
parameters: Mu,
|
|
7522
|
+
outputSchema: Fu,
|
|
7492
7523
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
7493
7524
|
async execute({ folders: e }, t) {
|
|
7494
7525
|
const o = await Promise.allSettled(
|
|
@@ -7497,7 +7528,7 @@ const Pu = s.object({
|
|
|
7497
7528
|
)
|
|
7498
7529
|
), { succeeded: r, failures: n } = P(e, o, (i) => i.id), a = r.map(({ value: i }) => i);
|
|
7499
7530
|
return O(y.UPDATE_FOLDERS, e.length, n), {
|
|
7500
|
-
textContent:
|
|
7531
|
+
textContent: Wu(a, n),
|
|
7501
7532
|
structuredContent: {
|
|
7502
7533
|
folders: a.map(Bt),
|
|
7503
7534
|
failures: n,
|
|
@@ -7507,38 +7538,38 @@ const Pu = s.object({
|
|
|
7507
7538
|
};
|
|
7508
7539
|
}
|
|
7509
7540
|
};
|
|
7510
|
-
function
|
|
7541
|
+
function Wu(e, t) {
|
|
7511
7542
|
const o = e.length, r = e.map((a) => `• ${a.name} (id=${a.id})`), n = o > 0 ? `Renamed ${o} folder${o === 1 ? "" : "s"}:
|
|
7512
7543
|
${r.join(`
|
|
7513
7544
|
`)}` : "Renamed 0 folders";
|
|
7514
|
-
return
|
|
7545
|
+
return U(n, t);
|
|
7515
7546
|
}
|
|
7516
|
-
const
|
|
7547
|
+
const Bu = s.object({
|
|
7517
7548
|
labelType: s.literal("personal").describe("Update a personal label, identified by its ID."),
|
|
7518
7549
|
id: s.string().min(1).describe("The ID of the personal label to update."),
|
|
7519
7550
|
name: s.string().min(1).max(128).optional().describe("The new name of the label."),
|
|
7520
7551
|
color: je,
|
|
7521
7552
|
order: s.number().int().optional().describe("The new position of the label in the label list."),
|
|
7522
7553
|
isFavorite: s.boolean().optional().describe("Whether to mark the label as a favorite.")
|
|
7523
|
-
}),
|
|
7554
|
+
}), Ku = s.object({
|
|
7524
7555
|
labelType: s.literal("shared").describe(
|
|
7525
7556
|
"Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
|
|
7526
7557
|
),
|
|
7527
7558
|
name: s.string().min(1).describe("The current name of the shared label."),
|
|
7528
7559
|
newName: s.string().min(1).describe("The new name for the shared label.")
|
|
7529
|
-
}),
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
]),
|
|
7533
|
-
labels: s.array(
|
|
7560
|
+
}), zu = s.discriminatedUnion("labelType", [
|
|
7561
|
+
Bu,
|
|
7562
|
+
Ku
|
|
7563
|
+
]), qu = {
|
|
7564
|
+
labels: s.array(zu).min(1).max(D.ITEMS_PER_OPERATION).describe(
|
|
7534
7565
|
'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.'
|
|
7535
7566
|
)
|
|
7536
|
-
},
|
|
7567
|
+
}, Gu = s.object({
|
|
7537
7568
|
name: s.string().describe("The previous name of the shared label."),
|
|
7538
7569
|
newName: s.string().describe("The new name of the shared label.")
|
|
7539
|
-
}),
|
|
7570
|
+
}), Yu = {
|
|
7540
7571
|
updatedLabels: s.array(Ee).describe("The updated personal labels."),
|
|
7541
|
-
renamedSharedLabels: s.array(
|
|
7572
|
+
renamedSharedLabels: s.array(Gu).describe("The shared labels that were renamed."),
|
|
7542
7573
|
totalCount: s.number().describe("The total number of successful operations (personal + shared)."),
|
|
7543
7574
|
failures: s.array(_).describe(
|
|
7544
7575
|
"Labels that could not be updated, identified by ID (personal) or name (shared), with the reason for each."
|
|
@@ -7549,17 +7580,17 @@ const Mu = s.object({
|
|
|
7549
7580
|
skippedCount: s.number().describe("Number of operations skipped (no changes or shared label not found)."),
|
|
7550
7581
|
failureCount: s.number()
|
|
7551
7582
|
}).describe("Summary of operations performed.")
|
|
7552
|
-
},
|
|
7583
|
+
}, Vu = {
|
|
7553
7584
|
name: y.UPDATE_LABELS,
|
|
7554
7585
|
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.",
|
|
7555
|
-
parameters:
|
|
7556
|
-
outputSchema:
|
|
7586
|
+
parameters: qu,
|
|
7587
|
+
outputSchema: Yu,
|
|
7557
7588
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
7558
7589
|
async execute(e, t) {
|
|
7559
7590
|
const { labels: o } = e, r = await Promise.allSettled(
|
|
7560
7591
|
o.map(async (h) => {
|
|
7561
7592
|
if (h.labelType === "personal") {
|
|
7562
|
-
const b =
|
|
7593
|
+
const b = Xu(h);
|
|
7563
7594
|
if (b !== null) return { kind: "skipped", reason: b };
|
|
7564
7595
|
const { id: g, labelType: w, ...I } = h;
|
|
7565
7596
|
return { kind: "updated", label: await j(() => t.updateLabel(g, I)) };
|
|
@@ -7582,8 +7613,8 @@ const Mu = s.object({
|
|
|
7582
7613
|
(h) => h.kind === "skipped" && h.reason === "not-found"
|
|
7583
7614
|
).length;
|
|
7584
7615
|
return {
|
|
7585
|
-
textContent:
|
|
7586
|
-
|
|
7616
|
+
textContent: U(
|
|
7617
|
+
Ju({
|
|
7587
7618
|
updatedLabels: c,
|
|
7588
7619
|
renamedSharedLabels: d,
|
|
7589
7620
|
skippedNoFields: l,
|
|
@@ -7606,7 +7637,7 @@ const Mu = s.object({
|
|
|
7606
7637
|
};
|
|
7607
7638
|
}
|
|
7608
7639
|
};
|
|
7609
|
-
function
|
|
7640
|
+
function Ju({
|
|
7610
7641
|
updatedLabels: e,
|
|
7611
7642
|
renamedSharedLabels: t,
|
|
7612
7643
|
skippedNoFields: o,
|
|
@@ -7628,14 +7659,14 @@ function qu({
|
|
|
7628
7659
|
return c.join(`
|
|
7629
7660
|
`);
|
|
7630
7661
|
}
|
|
7631
|
-
function
|
|
7662
|
+
function Xu({
|
|
7632
7663
|
id: e,
|
|
7633
7664
|
labelType: t,
|
|
7634
7665
|
...o
|
|
7635
7666
|
}) {
|
|
7636
7667
|
return Object.values(o).every((n) => n === void 0) ? "no-fields" : null;
|
|
7637
7668
|
}
|
|
7638
|
-
const { FIND_FOLDERS:
|
|
7669
|
+
const { FIND_FOLDERS: Zu } = y, Qu = s.object({
|
|
7639
7670
|
id: s.string().min(1).describe("The ID of the project to update."),
|
|
7640
7671
|
name: s.string().min(1).optional().describe("The new name of the project."),
|
|
7641
7672
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
|
|
@@ -7652,11 +7683,11 @@ const { FIND_FOLDERS: Yu } = y, Vu = s.object({
|
|
|
7652
7683
|
color: je,
|
|
7653
7684
|
icon: s.enum([...Vo, "remove"]).optional().describe('The project icon, or "remove" to restore the default # icon.'),
|
|
7654
7685
|
folderId: s.string().min(1).optional().describe(
|
|
7655
|
-
`Move a workspace project into this folder (see ${
|
|
7686
|
+
`Move a workspace project into this folder (see ${Zu}), or "remove" for the workspace's top level.`
|
|
7656
7687
|
)
|
|
7657
|
-
}),
|
|
7658
|
-
projects: s.array(
|
|
7659
|
-
},
|
|
7688
|
+
}), ep = {
|
|
7689
|
+
projects: s.array(Qu).min(1).max(D.ITEMS_PER_OPERATION).describe("The projects to update.")
|
|
7690
|
+
}, tp = {
|
|
7660
7691
|
projects: s.array(me).describe("The updated projects."),
|
|
7661
7692
|
totalCount: s.number().describe("The total number of projects updated."),
|
|
7662
7693
|
updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
|
|
@@ -7666,16 +7697,16 @@ const { FIND_FOLDERS: Yu } = y, Vu = s.object({
|
|
|
7666
7697
|
skippedCount: s.number().describe("The number of projects skipped (no changes)."),
|
|
7667
7698
|
failureCount: s.number()
|
|
7668
7699
|
}).describe("Summary of operations performed.")
|
|
7669
|
-
},
|
|
7700
|
+
}, op = {
|
|
7670
7701
|
name: y.UPDATE_PROJECTS,
|
|
7671
7702
|
description: "Update multiple existing projects with new values.",
|
|
7672
|
-
parameters:
|
|
7673
|
-
outputSchema:
|
|
7703
|
+
parameters: ep,
|
|
7704
|
+
outputSchema: tp,
|
|
7674
7705
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
7675
7706
|
async execute(e, t) {
|
|
7676
7707
|
const { projects: o } = e, r = await Promise.allSettled(
|
|
7677
7708
|
o.map(async (l) => {
|
|
7678
|
-
const p =
|
|
7709
|
+
const p = rp(l);
|
|
7679
7710
|
if (p !== null) return { kind: "skipped", reason: p };
|
|
7680
7711
|
const { id: f, folderId: h, icon: m, ...b } = l, g = {
|
|
7681
7712
|
...b,
|
|
@@ -7689,7 +7720,7 @@ const { FIND_FOLDERS: Yu } = y, Vu = s.object({
|
|
|
7689
7720
|
for (const { value: l } of n)
|
|
7690
7721
|
l.kind === "updated" ? i.push(he(l.project)) : l.reason === "no-fields" ? c++ : d++;
|
|
7691
7722
|
return O(y.UPDATE_PROJECTS, o.length, a), {
|
|
7692
|
-
textContent:
|
|
7723
|
+
textContent: sp({
|
|
7693
7724
|
projects: i,
|
|
7694
7725
|
skippedNoFields: c,
|
|
7695
7726
|
skippedNoValidValues: d,
|
|
@@ -7709,7 +7740,7 @@ const { FIND_FOLDERS: Yu } = y, Vu = s.object({
|
|
|
7709
7740
|
};
|
|
7710
7741
|
}
|
|
7711
7742
|
};
|
|
7712
|
-
function
|
|
7743
|
+
function sp({
|
|
7713
7744
|
projects: e,
|
|
7714
7745
|
skippedNoFields: t,
|
|
7715
7746
|
skippedNoValidValues: o,
|
|
@@ -7720,27 +7751,27 @@ function Qu({
|
|
|
7720
7751
|
let i = `Updated ${n} project${n === 1 ? "" : "s"}`;
|
|
7721
7752
|
const c = [];
|
|
7722
7753
|
return t > 0 && c.push(`${t} skipped - no changes`), o > 0 && c.push(`${o} skipped - no valid field values`), c.length > 0 && (i += ` (${c.join(", ")})`), n > 0 && (i += `:
|
|
7723
|
-
${a}`),
|
|
7754
|
+
${a}`), U(i, r);
|
|
7724
7755
|
}
|
|
7725
|
-
function
|
|
7756
|
+
function rp({ id: e, ...t }) {
|
|
7726
7757
|
const o = Object.values(t);
|
|
7727
7758
|
return o.length === 0 ? "no-fields" : o.every((r) => r === void 0) ? "no-valid-values" : null;
|
|
7728
7759
|
}
|
|
7729
|
-
const
|
|
7760
|
+
const np = s.object({
|
|
7730
7761
|
type: s.literal("relative"),
|
|
7731
7762
|
id: s.string().min(1).describe("The ID of the relative reminder to update."),
|
|
7732
7763
|
minuteOffset: s.number().int().min(0).optional().describe("New minute offset before task due time."),
|
|
7733
7764
|
service: Je.optional().describe('New delivery method: "email" or "push".'),
|
|
7734
7765
|
isUrgent: Xe,
|
|
7735
7766
|
notifyUser: Xt
|
|
7736
|
-
}),
|
|
7767
|
+
}), ap = s.object({
|
|
7737
7768
|
type: s.literal("absolute"),
|
|
7738
7769
|
id: s.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
7739
7770
|
due: _s.optional().describe("New due date/time for the reminder."),
|
|
7740
7771
|
service: Je.optional().describe('New delivery method: "email" or "push".'),
|
|
7741
7772
|
isUrgent: Xe,
|
|
7742
7773
|
notifyUser: Xt
|
|
7743
|
-
}),
|
|
7774
|
+
}), ip = s.object({
|
|
7744
7775
|
type: s.literal("location"),
|
|
7745
7776
|
id: s.string().min(1).describe("The ID of the location reminder to update."),
|
|
7746
7777
|
name: s.string().optional().describe("New location name."),
|
|
@@ -7751,15 +7782,15 @@ const tp = s.object({
|
|
|
7751
7782
|
),
|
|
7752
7783
|
radius: s.number().int().optional().describe("New radius in meters."),
|
|
7753
7784
|
notifyUser: Xt
|
|
7754
|
-
}),
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
]),
|
|
7759
|
-
reminders: s.array(
|
|
7785
|
+
}), cp = s.discriminatedUnion("type", [
|
|
7786
|
+
np,
|
|
7787
|
+
ap,
|
|
7788
|
+
ip
|
|
7789
|
+
]), dp = {
|
|
7790
|
+
reminders: s.array(cp).min(1).max(Be).describe(
|
|
7760
7791
|
`Array of reminders to update (max ${Be}). Each must include the reminder type and ID. Only include fields that need to change.`
|
|
7761
7792
|
)
|
|
7762
|
-
},
|
|
7793
|
+
}, lp = {
|
|
7763
7794
|
reminders: s.array(Kt).describe("The updated reminders."),
|
|
7764
7795
|
totalCount: s.number().describe("Total reminders updated."),
|
|
7765
7796
|
updatedReminderIds: s.array(s.string()).describe("IDs of updated reminders."),
|
|
@@ -7768,11 +7799,11 @@ const tp = s.object({
|
|
|
7768
7799
|
updateCount: s.number(),
|
|
7769
7800
|
failureCount: s.number()
|
|
7770
7801
|
})
|
|
7771
|
-
},
|
|
7802
|
+
}, up = {
|
|
7772
7803
|
name: y.UPDATE_REMINDERS,
|
|
7773
7804
|
description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
|
|
7774
|
-
parameters:
|
|
7775
|
-
outputSchema:
|
|
7805
|
+
parameters: dp,
|
|
7806
|
+
outputSchema: lp,
|
|
7776
7807
|
annotations: {
|
|
7777
7808
|
readOnlyHint: !1,
|
|
7778
7809
|
destructiveHint: !0,
|
|
@@ -7829,7 +7860,7 @@ const tp = s.object({
|
|
|
7829
7860
|
O(y.UPDATE_REMINDERS, o.length, i);
|
|
7830
7861
|
const u = c.length === 1 ? "reminder" : "reminders";
|
|
7831
7862
|
return {
|
|
7832
|
-
textContent:
|
|
7863
|
+
textContent: U(
|
|
7833
7864
|
[
|
|
7834
7865
|
`Updated ${c.length} ${u}`,
|
|
7835
7866
|
...Os(c, d)
|
|
@@ -7849,7 +7880,7 @@ const tp = s.object({
|
|
|
7849
7880
|
}
|
|
7850
7881
|
};
|
|
7851
7882
|
}
|
|
7852
|
-
},
|
|
7883
|
+
}, pp = s.object({
|
|
7853
7884
|
id: s.string().min(1).describe("The ID of the section to update."),
|
|
7854
7885
|
name: s.string().min(1).optional().describe("The new name of the section."),
|
|
7855
7886
|
description: s.preprocess(
|
|
@@ -7864,9 +7895,9 @@ const tp = s.object({
|
|
|
7864
7895
|
).optional()
|
|
7865
7896
|
}).refine((e) => e.name !== void 0 || e.description !== void 0, {
|
|
7866
7897
|
message: 'Provide at least one of "name" or "description" to update.'
|
|
7867
|
-
}),
|
|
7868
|
-
sections: s.array(
|
|
7869
|
-
},
|
|
7898
|
+
}), hp = {
|
|
7899
|
+
sections: s.array(pp).min(1).max(D.ITEMS_PER_OPERATION).describe("The sections to update.")
|
|
7900
|
+
}, mp = {
|
|
7870
7901
|
sections: s.array(re).describe("The updated sections."),
|
|
7871
7902
|
totalCount: s.number().describe("The total number of sections updated."),
|
|
7872
7903
|
updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections."),
|
|
@@ -7875,11 +7906,11 @@ const tp = s.object({
|
|
|
7875
7906
|
updateCount: s.number(),
|
|
7876
7907
|
failureCount: s.number()
|
|
7877
7908
|
})
|
|
7878
|
-
},
|
|
7909
|
+
}, fp = {
|
|
7879
7910
|
name: y.UPDATE_SECTIONS,
|
|
7880
7911
|
description: "Update multiple existing sections with new values.",
|
|
7881
|
-
parameters:
|
|
7882
|
-
outputSchema:
|
|
7912
|
+
parameters: hp,
|
|
7913
|
+
outputSchema: mp,
|
|
7883
7914
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
7884
7915
|
async execute({ sections: e }, t) {
|
|
7885
7916
|
const o = await Promise.allSettled(
|
|
@@ -7892,7 +7923,7 @@ const tp = s.object({
|
|
|
7892
7923
|
})
|
|
7893
7924
|
), { succeeded: r, failures: n } = P(e, o, (c) => c.id), a = r.map(({ value: c }) => c);
|
|
7894
7925
|
return O(y.UPDATE_SECTIONS, e.length, n), {
|
|
7895
|
-
textContent:
|
|
7926
|
+
textContent: bp({
|
|
7896
7927
|
sections: a,
|
|
7897
7928
|
failures: n
|
|
7898
7929
|
}),
|
|
@@ -7909,39 +7940,39 @@ const tp = s.object({
|
|
|
7909
7940
|
};
|
|
7910
7941
|
}
|
|
7911
7942
|
};
|
|
7912
|
-
function
|
|
7943
|
+
function bp({
|
|
7913
7944
|
sections: e,
|
|
7914
7945
|
failures: t
|
|
7915
7946
|
}) {
|
|
7916
7947
|
const o = e.length, r = e.map((a) => `• ${a.name} (id=${a.id}, projectId=${a.projectId})`).join(`
|
|
7917
7948
|
`), n = o > 0 ? `Updated ${o} section${o === 1 ? "" : "s"}:
|
|
7918
7949
|
${r}` : "Updated 0 sections";
|
|
7919
|
-
return
|
|
7950
|
+
return U(n, t);
|
|
7920
7951
|
}
|
|
7921
7952
|
function ir(e, t) {
|
|
7922
7953
|
return t.projectId !== void 0 ? e.projectId === t.projectId && !e.sectionId && !e.parentId : t.sectionId !== void 0 ? e.sectionId === t.sectionId && !e.parentId : e.parentId === t.parentId;
|
|
7923
7954
|
}
|
|
7924
|
-
function
|
|
7955
|
+
function gp(e, t) {
|
|
7925
7956
|
return t.projectId !== void 0 ? e.projectId === t.projectId : t.sectionId !== void 0 ? e.sectionId === t.sectionId : e.parentId === t.parentId;
|
|
7926
7957
|
}
|
|
7927
|
-
function
|
|
7958
|
+
function yp(e) {
|
|
7928
7959
|
return e.projectId !== void 0 ? `project:${e.projectId}` : e.sectionId !== void 0 ? `section:${e.sectionId}` : `parent:${e.parentId}`;
|
|
7929
7960
|
}
|
|
7930
|
-
function
|
|
7961
|
+
function wp(e) {
|
|
7931
7962
|
const t = [];
|
|
7932
7963
|
return e.projectId && t.push({ projectId: e.projectId }), e.sectionId && t.push({ sectionId: e.sectionId }), e.parentId && t.push({ parentId: e.parentId }), t;
|
|
7933
7964
|
}
|
|
7934
|
-
function
|
|
7965
|
+
function Tp({
|
|
7935
7966
|
taskId: e,
|
|
7936
7967
|
request: t,
|
|
7937
7968
|
current: o
|
|
7938
7969
|
}) {
|
|
7939
|
-
const r =
|
|
7970
|
+
const r = wp(t);
|
|
7940
7971
|
if (r.length === 0)
|
|
7941
7972
|
return { redundantMoveSkipped: !1 };
|
|
7942
7973
|
let n = r, a = !1;
|
|
7943
7974
|
if (o) {
|
|
7944
|
-
const i = r.length === 1 ? (c) => ir(o, c) : (c) =>
|
|
7975
|
+
const i = r.length === 1 ? (c) => ir(o, c) : (c) => gp(o, c);
|
|
7945
7976
|
n = r.filter((c) => !i(c)), a = n.length < r.length;
|
|
7946
7977
|
}
|
|
7947
7978
|
if (n.length === 0)
|
|
@@ -7952,7 +7983,7 @@ function bp({
|
|
|
7952
7983
|
);
|
|
7953
7984
|
return { move: n[0], redundantMoveSkipped: a };
|
|
7954
7985
|
}
|
|
7955
|
-
const
|
|
7986
|
+
const kp = s.object({
|
|
7956
7987
|
id: s.string().min(1).describe("The ID of the task to update."),
|
|
7957
7988
|
content: s.string().optional().describe(
|
|
7958
7989
|
'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.'
|
|
@@ -7968,7 +7999,7 @@ const gp = s.object({
|
|
|
7968
7999
|
),
|
|
7969
8000
|
parentId: s.string().optional().describe("Make the task a subtask of this task ID. Omit unless the parent should change."),
|
|
7970
8001
|
order: s.number().optional().describe("The new order of the task within its parent/section."),
|
|
7971
|
-
priority: Nt.optional().describe(
|
|
8002
|
+
priority: Nt.optional().describe(Rt),
|
|
7972
8003
|
dueString: s.preprocess(
|
|
7973
8004
|
// Keep accepting legacy null while exposing a Gemini-compatible string schema.
|
|
7974
8005
|
(e) => e === null ? "remove" : e,
|
|
@@ -7998,9 +8029,9 @@ const gp = s.object({
|
|
|
7998
8029
|
isUncompletable: s.boolean().optional().describe(
|
|
7999
8030
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
8000
8031
|
)
|
|
8001
|
-
}),
|
|
8002
|
-
tasks: s.array(
|
|
8003
|
-
},
|
|
8032
|
+
}), Ip = (e) => !!(e.projectId || e.sectionId || e.parentId), cr = (e) => Object.keys(e).length > 0, vp = ["remove", "no date"], Sp = ["remove", "no date", "no deadline"], Ho = "no date", jt = D.TASKS_PER_OPERATION, Wo = {
|
|
8033
|
+
tasks: s.array(kp).min(1).max(jt).describe(`The tasks to update (max ${jt}).`)
|
|
8034
|
+
}, Cp = {
|
|
8004
8035
|
tasks: s.array(te).describe("The updated tasks."),
|
|
8005
8036
|
totalCount: s.number().describe("The total number of tasks updated."),
|
|
8006
8037
|
updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
|
|
@@ -8013,11 +8044,11 @@ const gp = s.object({
|
|
|
8013
8044
|
"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."
|
|
8014
8045
|
)
|
|
8015
8046
|
}).describe("Summary of operations performed.")
|
|
8016
|
-
},
|
|
8047
|
+
}, jp = {
|
|
8017
8048
|
name: y.UPDATE_TASKS,
|
|
8018
8049
|
description: "Update existing tasks including content, dates, priorities, and assignments. Send only the fields that change.",
|
|
8019
8050
|
parameters: Wo,
|
|
8020
|
-
outputSchema:
|
|
8051
|
+
outputSchema: Cp,
|
|
8021
8052
|
// Open world: assigning a task notifies the new assignee.
|
|
8022
8053
|
annotations: {
|
|
8023
8054
|
readOnlyHint: !1,
|
|
@@ -8030,11 +8061,11 @@ const gp = s.object({
|
|
|
8030
8061
|
r[T] = { kind: "failed", error: v };
|
|
8031
8062
|
}, a = (T, v) => {
|
|
8032
8063
|
n(T, K(v));
|
|
8033
|
-
}, i = o.map((T, v) => ({ task: T, index: v })).filter(({ task: T }) =>
|
|
8064
|
+
}, i = o.map((T, v) => ({ task: T, index: v })).filter(({ task: T }) => Rp(T)), c = await Ep(
|
|
8034
8065
|
i.map(({ task: T }) => T),
|
|
8035
8066
|
t
|
|
8036
8067
|
), d = await Promise.allSettled(
|
|
8037
|
-
i.map(({ task: T, index: v }) =>
|
|
8068
|
+
i.map(({ task: T, index: v }) => _p({ task: T, index: v, client: t, inbox: c }))
|
|
8038
8069
|
), u = [];
|
|
8039
8070
|
for (const [T, v] of d.entries()) {
|
|
8040
8071
|
const A = i[T]?.index ?? T;
|
|
@@ -8044,14 +8075,14 @@ const gp = s.object({
|
|
|
8044
8075
|
client: t,
|
|
8045
8076
|
ids: [
|
|
8046
8077
|
...new Set(
|
|
8047
|
-
u.filter((T) =>
|
|
8078
|
+
u.filter((T) => Ip(T.moveRequest) || T.checkRecurrence).map((T) => T.id)
|
|
8048
8079
|
)
|
|
8049
8080
|
]
|
|
8050
8081
|
});
|
|
8051
8082
|
for (const T of u) {
|
|
8052
8083
|
if (!T.checkRecurrence)
|
|
8053
8084
|
continue;
|
|
8054
|
-
const v =
|
|
8085
|
+
const v = Ap({
|
|
8055
8086
|
id: T.id,
|
|
8056
8087
|
current: l.get(T.id),
|
|
8057
8088
|
readFailed: p
|
|
@@ -8062,7 +8093,7 @@ const gp = s.object({
|
|
|
8062
8093
|
for (const T of u)
|
|
8063
8094
|
if (!T.failed)
|
|
8064
8095
|
try {
|
|
8065
|
-
const v =
|
|
8096
|
+
const v = Tp({
|
|
8066
8097
|
taskId: T.id,
|
|
8067
8098
|
request: T.moveRequest,
|
|
8068
8099
|
current: l.get(T.id)
|
|
@@ -8074,7 +8105,7 @@ const gp = s.object({
|
|
|
8074
8105
|
const h = /* @__PURE__ */ new Map(), m = [], b = (T) => {
|
|
8075
8106
|
const v = T.filter((A) => !A.failed);
|
|
8076
8107
|
v.length !== 0 && m.push(
|
|
8077
|
-
|
|
8108
|
+
Op({
|
|
8078
8109
|
client: t,
|
|
8079
8110
|
items: v,
|
|
8080
8111
|
onUpdated: (A, x) => {
|
|
@@ -8095,7 +8126,7 @@ const gp = s.object({
|
|
|
8095
8126
|
})
|
|
8096
8127
|
);
|
|
8097
8128
|
}, g = new Set(f.map(({ item: T }) => T.index));
|
|
8098
|
-
b(u.filter((T) => !g.has(T.index))), await
|
|
8129
|
+
b(u.filter((T) => !g.has(T.index))), await Dp({
|
|
8099
8130
|
client: t,
|
|
8100
8131
|
moving: f,
|
|
8101
8132
|
results: h,
|
|
@@ -8118,9 +8149,9 @@ const gp = s.object({
|
|
|
8118
8149
|
const v = h.get(T.index);
|
|
8119
8150
|
v && "task" in v && (r[T.index] = { kind: "updated", task: v.task });
|
|
8120
8151
|
}
|
|
8121
|
-
const { updatedTasks: w, failures: I, skippedCount: k } =
|
|
8152
|
+
const { updatedTasks: w, failures: I, skippedCount: k } = $p({ tasks: o, outcomes: r }), S = u.filter((T) => T.redundantMoveSkipped).length, E = w.map(z);
|
|
8122
8153
|
return O(y.UPDATE_TASKS, o.length, I), {
|
|
8123
|
-
textContent:
|
|
8154
|
+
textContent: Up({
|
|
8124
8155
|
tasks: E,
|
|
8125
8156
|
failures: I,
|
|
8126
8157
|
skippedCount: k,
|
|
@@ -8141,7 +8172,7 @@ const gp = s.object({
|
|
|
8141
8172
|
};
|
|
8142
8173
|
}
|
|
8143
8174
|
};
|
|
8144
|
-
function
|
|
8175
|
+
function $p({ tasks: e, outcomes: t }) {
|
|
8145
8176
|
const o = [], r = [];
|
|
8146
8177
|
let n = 0;
|
|
8147
8178
|
for (const [a, i] of t.entries()) {
|
|
@@ -8158,7 +8189,7 @@ function vp({ tasks: e, outcomes: t }) {
|
|
|
8158
8189
|
}
|
|
8159
8190
|
return { updatedTasks: o, failures: r, skippedCount: n };
|
|
8160
8191
|
}
|
|
8161
|
-
async function
|
|
8192
|
+
async function Ep(e, t) {
|
|
8162
8193
|
if (!e.some((o) => ee(o.projectId)))
|
|
8163
8194
|
return {};
|
|
8164
8195
|
try {
|
|
@@ -8183,7 +8214,7 @@ async function dr({
|
|
|
8183
8214
|
}
|
|
8184
8215
|
return { states: o, readFailed: !1 };
|
|
8185
8216
|
}
|
|
8186
|
-
function
|
|
8217
|
+
function Ap({
|
|
8187
8218
|
id: e,
|
|
8188
8219
|
current: t,
|
|
8189
8220
|
readFailed: o
|
|
@@ -8193,7 +8224,7 @@ function Cp({
|
|
|
8193
8224
|
if (t?.due?.isRecurring)
|
|
8194
8225
|
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 ${y.RESCHEDULE_TASKS} (it also accepts duration). To change or drop the recurrence on purpose, resend with replaceRecurrence: true.`;
|
|
8195
8226
|
}
|
|
8196
|
-
async function
|
|
8227
|
+
async function Dp({
|
|
8197
8228
|
client: e,
|
|
8198
8229
|
moving: t,
|
|
8199
8230
|
results: o,
|
|
@@ -8203,7 +8234,7 @@ async function jp({
|
|
|
8203
8234
|
return;
|
|
8204
8235
|
const n = /* @__PURE__ */ new Map();
|
|
8205
8236
|
for (const c of t) {
|
|
8206
|
-
const d =
|
|
8237
|
+
const d = yp(c.move), u = n.get(d);
|
|
8207
8238
|
u ? u.push(c) : n.set(d, [c]);
|
|
8208
8239
|
}
|
|
8209
8240
|
const a = sn(e), i = [];
|
|
@@ -8234,12 +8265,12 @@ async function jp({
|
|
|
8234
8265
|
}
|
|
8235
8266
|
}
|
|
8236
8267
|
if (i.length > 0) {
|
|
8237
|
-
await
|
|
8268
|
+
await xp({ client: e, unresolved: i, results: o });
|
|
8238
8269
|
for (const { group: c } of i)
|
|
8239
8270
|
r(c);
|
|
8240
8271
|
}
|
|
8241
8272
|
}
|
|
8242
|
-
async function
|
|
8273
|
+
async function xp({
|
|
8243
8274
|
client: e,
|
|
8244
8275
|
unresolved: t,
|
|
8245
8276
|
results: o
|
|
@@ -8257,7 +8288,7 @@ async function $p({
|
|
|
8257
8288
|
}
|
|
8258
8289
|
}
|
|
8259
8290
|
}
|
|
8260
|
-
async function
|
|
8291
|
+
async function Op({
|
|
8261
8292
|
client: e,
|
|
8262
8293
|
items: t,
|
|
8263
8294
|
onUpdated: o,
|
|
@@ -8277,7 +8308,7 @@ async function Ep({
|
|
|
8277
8308
|
})
|
|
8278
8309
|
);
|
|
8279
8310
|
}
|
|
8280
|
-
async function
|
|
8311
|
+
async function _p({
|
|
8281
8312
|
task: e,
|
|
8282
8313
|
index: t,
|
|
8283
8314
|
client: o,
|
|
@@ -8307,18 +8338,18 @@ async function Ap({
|
|
|
8307
8338
|
p && (w.priority = gs(p));
|
|
8308
8339
|
const I = Bo(
|
|
8309
8340
|
d,
|
|
8310
|
-
|
|
8341
|
+
vp,
|
|
8311
8342
|
Ho
|
|
8312
8343
|
);
|
|
8313
8344
|
I !== void 0 && (w = { ...w, dueString: I });
|
|
8314
|
-
const k = Bo(h,
|
|
8345
|
+
const k = Bo(h, Sp, null);
|
|
8315
8346
|
if (k !== void 0 && (w = { ...w, deadlineDate: k }), u) {
|
|
8316
|
-
const { amount: S, unit: E } =
|
|
8347
|
+
const { amount: S, unit: E } = Ut(`Task ${n}`, u);
|
|
8317
8348
|
w = { ...w, duration: S, durationUnit: E };
|
|
8318
8349
|
}
|
|
8319
8350
|
return l !== void 0 && (w = {
|
|
8320
8351
|
...w,
|
|
8321
|
-
assigneeId: await
|
|
8352
|
+
assigneeId: await Pp(o, n, l)
|
|
8322
8353
|
}), {
|
|
8323
8354
|
index: t,
|
|
8324
8355
|
id: n,
|
|
@@ -8333,7 +8364,7 @@ async function Ap({
|
|
|
8333
8364
|
failed: !1
|
|
8334
8365
|
};
|
|
8335
8366
|
}
|
|
8336
|
-
async function
|
|
8367
|
+
async function Pp(e, t, o) {
|
|
8337
8368
|
if (o === null || o === "unassign")
|
|
8338
8369
|
return null;
|
|
8339
8370
|
const r = await Zt.validateTaskUpdateAssignment(
|
|
@@ -8347,7 +8378,7 @@ async function Dp(e, t, o) {
|
|
|
8347
8378
|
}
|
|
8348
8379
|
return r.resolvedUser?.userId;
|
|
8349
8380
|
}
|
|
8350
|
-
function
|
|
8381
|
+
function Up({
|
|
8351
8382
|
tasks: e,
|
|
8352
8383
|
failures: t,
|
|
8353
8384
|
skippedCount: o,
|
|
@@ -8368,7 +8399,7 @@ function xp({
|
|
|
8368
8399
|
Failed (${t.length}) - address or drop these items:
|
|
8369
8400
|
${u}${l}`;
|
|
8370
8401
|
}
|
|
8371
|
-
function
|
|
8402
|
+
function Rp({
|
|
8372
8403
|
id: e,
|
|
8373
8404
|
replaceRecurrence: t,
|
|
8374
8405
|
...o
|
|
@@ -8383,7 +8414,7 @@ function Bo(e, t, o) {
|
|
|
8383
8414
|
const r = e.trim().toLowerCase();
|
|
8384
8415
|
return t.includes(r) ? o : e;
|
|
8385
8416
|
}
|
|
8386
|
-
const
|
|
8417
|
+
const Np = {}, Lp = {
|
|
8387
8418
|
type: s.literal("user_info").describe("The type of the response."),
|
|
8388
8419
|
userId: s.string().describe("The user ID."),
|
|
8389
8420
|
fullName: s.string().describe("The full name of the user."),
|
|
@@ -8400,25 +8431,29 @@ const _p = {}, Pp = {
|
|
|
8400
8431
|
email: s.string().describe("The email address of the user."),
|
|
8401
8432
|
plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
|
|
8402
8433
|
};
|
|
8403
|
-
function
|
|
8434
|
+
function Mp(e) {
|
|
8404
8435
|
return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
|
|
8405
8436
|
}
|
|
8406
|
-
function
|
|
8437
|
+
function Fp(e, t) {
|
|
8407
8438
|
const r = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
|
|
8408
8439
|
return n.setDate(e.getDate() - r), n;
|
|
8409
8440
|
}
|
|
8410
|
-
function
|
|
8441
|
+
function Hp(e) {
|
|
8411
8442
|
const t = new Date(e);
|
|
8412
8443
|
return t.setDate(e.getDate() + 6), t;
|
|
8413
8444
|
}
|
|
8414
|
-
function
|
|
8415
|
-
const t =
|
|
8416
|
-
|
|
8445
|
+
function Wp(e) {
|
|
8446
|
+
const t = Date.UTC(
|
|
8447
|
+
e.getFullYear(),
|
|
8448
|
+
e.getMonth(),
|
|
8449
|
+
e.getDate() + 3
|
|
8450
|
+
), o = new Date(t).getUTCFullYear(), r = (t - Date.UTC(o, 0, 1)) / 864e5;
|
|
8451
|
+
return Math.floor(r / 7) + 1;
|
|
8417
8452
|
}
|
|
8418
|
-
function
|
|
8453
|
+
function Bp(e) {
|
|
8419
8454
|
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
|
|
8420
8455
|
}
|
|
8421
|
-
function
|
|
8456
|
+
function Kp(e) {
|
|
8422
8457
|
try {
|
|
8423
8458
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
8424
8459
|
} catch {
|
|
@@ -8426,9 +8461,9 @@ function Fp(e) {
|
|
|
8426
8461
|
}
|
|
8427
8462
|
}
|
|
8428
8463
|
function lr(e) {
|
|
8429
|
-
return
|
|
8464
|
+
return Kp(e) ? e : "UTC";
|
|
8430
8465
|
}
|
|
8431
|
-
function
|
|
8466
|
+
function zp(e, t) {
|
|
8432
8467
|
const o = lr(t);
|
|
8433
8468
|
return e.toLocaleString("en-US", {
|
|
8434
8469
|
timeZone: o,
|
|
@@ -8441,8 +8476,8 @@ function Hp(e, t) {
|
|
|
8441
8476
|
hour12: !1
|
|
8442
8477
|
});
|
|
8443
8478
|
}
|
|
8444
|
-
async function
|
|
8445
|
-
const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r = lr(o), n = /* @__PURE__ */ new Date(), a =
|
|
8479
|
+
async function qp(e) {
|
|
8480
|
+
const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r = lr(o), n = /* @__PURE__ */ new Date(), a = zp(n, r), i = t.startDay ?? 1, c = Bp(i), d = Mp(t), u = new Date(n.toLocaleString("en-US", { timeZone: r })), l = Fp(u, i), p = Hp(l), f = Wp(l), m = [
|
|
8446
8481
|
"# User Information",
|
|
8447
8482
|
"",
|
|
8448
8483
|
`**User ID:** ${t.id}`,
|
|
@@ -8484,26 +8519,26 @@ async function Wp(e) {
|
|
|
8484
8519
|
};
|
|
8485
8520
|
return { textContent: m, structuredContent: b };
|
|
8486
8521
|
}
|
|
8487
|
-
const
|
|
8522
|
+
const Gp = {
|
|
8488
8523
|
name: y.USER_INFO,
|
|
8489
8524
|
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).",
|
|
8490
|
-
parameters:
|
|
8491
|
-
outputSchema:
|
|
8525
|
+
parameters: Np,
|
|
8526
|
+
outputSchema: Lp,
|
|
8492
8527
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
8493
8528
|
async execute(e, t) {
|
|
8494
|
-
const o = await
|
|
8529
|
+
const o = await qp(t);
|
|
8495
8530
|
return {
|
|
8496
8531
|
textContent: o.textContent,
|
|
8497
8532
|
structuredContent: o.structuredContent
|
|
8498
8533
|
};
|
|
8499
8534
|
}
|
|
8500
|
-
}, Ko = 10 * 1024 * 1024,
|
|
8535
|
+
}, Ko = 10 * 1024 * 1024, Yp = /* @__PURE__ */ new Set([
|
|
8501
8536
|
"image/png",
|
|
8502
8537
|
"image/jpeg",
|
|
8503
8538
|
"image/gif",
|
|
8504
8539
|
"image/webp",
|
|
8505
8540
|
"image/svg+xml"
|
|
8506
|
-
]),
|
|
8541
|
+
]), Vp = /* @__PURE__ */ new Set([
|
|
8507
8542
|
"text/plain",
|
|
8508
8543
|
"text/csv",
|
|
8509
8544
|
"text/html",
|
|
@@ -8511,7 +8546,7 @@ const Bp = {
|
|
|
8511
8546
|
"application/json",
|
|
8512
8547
|
"application/xml",
|
|
8513
8548
|
"text/xml"
|
|
8514
|
-
]),
|
|
8549
|
+
]), Jp = {
|
|
8515
8550
|
".png": "image/png",
|
|
8516
8551
|
".jpg": "image/jpeg",
|
|
8517
8552
|
".jpeg": "image/jpeg",
|
|
@@ -8526,23 +8561,23 @@ const Bp = {
|
|
|
8526
8561
|
".xml": "application/xml",
|
|
8527
8562
|
".pdf": "application/pdf"
|
|
8528
8563
|
};
|
|
8529
|
-
function
|
|
8530
|
-
return
|
|
8564
|
+
function Xp(e) {
|
|
8565
|
+
return Yp.has(e) ? "image" : Vp.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
8531
8566
|
}
|
|
8532
|
-
function
|
|
8567
|
+
function Zp(e) {
|
|
8533
8568
|
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
8534
8569
|
}
|
|
8535
|
-
function
|
|
8570
|
+
function Qp(e) {
|
|
8536
8571
|
try {
|
|
8537
8572
|
const t = new URL(e).pathname, o = t.lastIndexOf(".");
|
|
8538
8573
|
if (o === -1) return;
|
|
8539
8574
|
const r = t.slice(o).toLowerCase();
|
|
8540
|
-
return
|
|
8575
|
+
return Jp[r];
|
|
8541
8576
|
} catch {
|
|
8542
8577
|
return;
|
|
8543
8578
|
}
|
|
8544
8579
|
}
|
|
8545
|
-
function
|
|
8580
|
+
function eh(e) {
|
|
8546
8581
|
try {
|
|
8547
8582
|
const t = new URL(e).pathname, o = t.lastIndexOf("/");
|
|
8548
8583
|
return o === -1 ? void 0 : t.slice(o + 1) || void 0;
|
|
@@ -8550,23 +8585,23 @@ function Jp(e) {
|
|
|
8550
8585
|
return;
|
|
8551
8586
|
}
|
|
8552
8587
|
}
|
|
8553
|
-
const
|
|
8554
|
-
fileUrl: s.url().regex(
|
|
8588
|
+
const th = /^https:\/\/(?:files\.todoist\.com|todoist\.b-cdn\.net|d1ysz50cxb9zwl\.cloudfront\.net)\/\S*$/, oh = {
|
|
8589
|
+
fileUrl: s.url().regex(th, {
|
|
8555
8590
|
error: "Pass the fileUrl from a comment's fileAttachment: an https URL on files.todoist.com, todoist.b-cdn.net or d1ysz50cxb9zwl.cloudfront.net."
|
|
8556
8591
|
}).describe(
|
|
8557
8592
|
"The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
|
|
8558
8593
|
)
|
|
8559
|
-
},
|
|
8594
|
+
}, sh = {
|
|
8560
8595
|
name: y.VIEW_ATTACHMENT,
|
|
8561
8596
|
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).",
|
|
8562
|
-
parameters:
|
|
8597
|
+
parameters: oh,
|
|
8563
8598
|
annotations: {
|
|
8564
8599
|
readOnlyHint: !0,
|
|
8565
8600
|
destructiveHint: !1,
|
|
8566
8601
|
idempotentHint: !0
|
|
8567
8602
|
},
|
|
8568
8603
|
async execute({ fileUrl: e }, t) {
|
|
8569
|
-
const o = await t.viewAttachment(e), r = o.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, a =
|
|
8604
|
+
const o = await t.viewAttachment(e), r = o.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, a = eh(e), i = o.headers["content-type"], c = i ? Zp(i) : void 0, d = c && c !== "application/octet-stream" ? c : Qp(e) ?? c ?? "application/octet-stream";
|
|
8570
8605
|
if (n && n > Ko)
|
|
8571
8606
|
return {
|
|
8572
8607
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
@@ -8576,7 +8611,7 @@ const Xp = /^https:\/\/(?:files\.todoist\.com|todoist\.b-cdn\.net|d1ysz50cxb9zwl
|
|
|
8576
8611
|
return {
|
|
8577
8612
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(l / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
8578
8613
|
};
|
|
8579
|
-
const p =
|
|
8614
|
+
const p = Xp(d), f = [];
|
|
8580
8615
|
return p === "image" ? f.push({
|
|
8581
8616
|
type: "image",
|
|
8582
8617
|
data: u.toString("base64"),
|
|
@@ -8596,83 +8631,83 @@ const Xp = /^https:\/\/(?:files\.todoist\.com|todoist\.b-cdn\.net|d1ysz50cxb9zwl
|
|
|
8596
8631
|
contentItems: f
|
|
8597
8632
|
};
|
|
8598
8633
|
}
|
|
8599
|
-
},
|
|
8600
|
-
...
|
|
8634
|
+
}, rh = {
|
|
8635
|
+
...Sd,
|
|
8601
8636
|
_meta: {
|
|
8602
8637
|
ui: {
|
|
8603
8638
|
resourceUri: ft
|
|
8604
8639
|
}
|
|
8605
8640
|
}
|
|
8606
|
-
},
|
|
8641
|
+
}, nh = {
|
|
8607
8642
|
// Task management tools
|
|
8608
8643
|
addTasks: xi,
|
|
8609
8644
|
completeTasks: Ki,
|
|
8610
|
-
uncompleteTasks:
|
|
8611
|
-
updateTasks:
|
|
8612
|
-
rescheduleTasks:
|
|
8613
|
-
findTasks:
|
|
8614
|
-
findTasksByDate:
|
|
8615
|
-
findCompletedTasks:
|
|
8645
|
+
uncompleteTasks: vu,
|
|
8646
|
+
updateTasks: jp,
|
|
8647
|
+
rescheduleTasks: au,
|
|
8648
|
+
findTasks: Ud,
|
|
8649
|
+
findTasksByDate: rh,
|
|
8650
|
+
findCompletedTasks: Lc,
|
|
8616
8651
|
// Project management tools
|
|
8617
8652
|
addProjects: di,
|
|
8618
|
-
updateProjects:
|
|
8619
|
-
findProjects:
|
|
8620
|
-
projectManagement:
|
|
8621
|
-
projectMove:
|
|
8653
|
+
updateProjects: op,
|
|
8654
|
+
findProjects: cd,
|
|
8655
|
+
projectManagement: Nl,
|
|
8656
|
+
projectMove: Hl,
|
|
8622
8657
|
// Folder management tools
|
|
8623
8658
|
addFolders: Za,
|
|
8624
|
-
updateFolders:
|
|
8625
|
-
findFolders:
|
|
8659
|
+
updateFolders: Hu,
|
|
8660
|
+
findFolders: qc,
|
|
8626
8661
|
// Section management tools
|
|
8627
8662
|
addSections: ji,
|
|
8628
|
-
updateSections:
|
|
8629
|
-
findSections:
|
|
8663
|
+
updateSections: fp,
|
|
8664
|
+
findSections: wd,
|
|
8630
8665
|
// Comment management tools
|
|
8631
8666
|
addComments: Da,
|
|
8632
|
-
findComments:
|
|
8633
|
-
updateComments:
|
|
8667
|
+
findComments: $c,
|
|
8668
|
+
updateComments: Au,
|
|
8634
8669
|
// Reminder management tools
|
|
8635
8670
|
addReminders: ki,
|
|
8636
|
-
findReminders:
|
|
8637
|
-
updateReminders:
|
|
8671
|
+
findReminders: md,
|
|
8672
|
+
updateReminders: up,
|
|
8638
8673
|
// Attachment tools
|
|
8639
|
-
viewAttachment:
|
|
8674
|
+
viewAttachment: sh,
|
|
8640
8675
|
// Label management tools
|
|
8641
8676
|
addLabels: si,
|
|
8642
|
-
updateLabels:
|
|
8643
|
-
findLabels:
|
|
8677
|
+
updateLabels: Vu,
|
|
8678
|
+
findLabels: Xc,
|
|
8644
8679
|
// Filter management tools
|
|
8645
8680
|
findFilters: Na,
|
|
8646
8681
|
addFilters: Wa,
|
|
8647
|
-
updateFilters:
|
|
8682
|
+
updateFilters: Pu,
|
|
8648
8683
|
// Activity and audit tools
|
|
8649
8684
|
findActivity: bc,
|
|
8650
|
-
getProductivityStats:
|
|
8685
|
+
getProductivityStats: Xd,
|
|
8651
8686
|
// Health and insights tools
|
|
8652
|
-
getProjectHealth:
|
|
8653
|
-
getProjectActivityStats:
|
|
8687
|
+
getProjectHealth: al,
|
|
8688
|
+
getProjectActivityStats: ol,
|
|
8654
8689
|
analyzeProjectHealth: Hi,
|
|
8655
|
-
getWorkspaceInsights:
|
|
8690
|
+
getWorkspaceInsights: fl,
|
|
8656
8691
|
// General tools
|
|
8657
|
-
getOverview:
|
|
8692
|
+
getOverview: Yd,
|
|
8658
8693
|
deleteObject: Xi,
|
|
8659
8694
|
fetchObject: dc,
|
|
8660
|
-
reorderObjects:
|
|
8661
|
-
userInfo:
|
|
8662
|
-
getUserStatus:
|
|
8663
|
-
setUserStatus:
|
|
8695
|
+
reorderObjects: Jl,
|
|
8696
|
+
userInfo: Gp,
|
|
8697
|
+
getUserStatus: ul,
|
|
8698
|
+
setUserStatus: Tu,
|
|
8664
8699
|
// Assignment and collaboration tools
|
|
8665
|
-
findProjectCollaborators:
|
|
8666
|
-
manageAssignments:
|
|
8700
|
+
findProjectCollaborators: td,
|
|
8701
|
+
manageAssignments: Ol,
|
|
8667
8702
|
// Template tools
|
|
8668
8703
|
exportProjectTemplate: ec,
|
|
8669
|
-
importProjectTemplate:
|
|
8704
|
+
importProjectTemplate: kl,
|
|
8670
8705
|
// Workspace tools
|
|
8671
|
-
listWorkspaces:
|
|
8706
|
+
listWorkspaces: $l,
|
|
8672
8707
|
// OpenAI MCP tools
|
|
8673
|
-
search:
|
|
8708
|
+
search: uu,
|
|
8674
8709
|
fetch: pc
|
|
8675
|
-
},
|
|
8710
|
+
}, ah = Object.values(nh), ih = `
|
|
8676
8711
|
## Todoist Task and Project Management Tools
|
|
8677
8712
|
|
|
8678
8713
|
You have access to comprehensive Todoist management tools for personal productivity and team collaboration. Use these tools to help users manage tasks, projects, sections, comments, and assignments effectively.
|
|
@@ -8730,7 +8765,7 @@ For a productivity review, call **get-productivity-stats**, then find what the u
|
|
|
8730
8765
|
|
|
8731
8766
|
Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
|
|
8732
8767
|
`, De = { ttlMs: xt, cacheScope: "private" };
|
|
8733
|
-
function
|
|
8768
|
+
function Sh({
|
|
8734
8769
|
token: e,
|
|
8735
8770
|
baseUrl: t,
|
|
8736
8771
|
features: o = []
|
|
@@ -8742,7 +8777,7 @@ function Th({
|
|
|
8742
8777
|
tools: { listChanged: !0 },
|
|
8743
8778
|
prompts: { listChanged: !0 }
|
|
8744
8779
|
},
|
|
8745
|
-
instructions:
|
|
8780
|
+
instructions: ih,
|
|
8746
8781
|
cacheHints: {
|
|
8747
8782
|
"server/discover": De,
|
|
8748
8783
|
"tools/list": De,
|
|
@@ -8752,7 +8787,7 @@ function Th({
|
|
|
8752
8787
|
}
|
|
8753
8788
|
}
|
|
8754
8789
|
), n = gn(e, { baseUrl: t });
|
|
8755
|
-
return Wn(r), _n({ tools:
|
|
8790
|
+
return Wn(r), _n({ tools: ah, server: r, client: n, features: o }), r.registerPrompt(
|
|
8756
8791
|
Ae.name,
|
|
8757
8792
|
{
|
|
8758
8793
|
title: Ae.title,
|
|
@@ -8763,38 +8798,38 @@ function Th({
|
|
|
8763
8798
|
), r;
|
|
8764
8799
|
}
|
|
8765
8800
|
export {
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8801
|
+
jp as $,
|
|
8802
|
+
Sd as A,
|
|
8803
|
+
Sh as B,
|
|
8804
|
+
Yd as C,
|
|
8805
|
+
Xd as D,
|
|
8806
|
+
ol as E,
|
|
8807
|
+
vh as F,
|
|
8808
|
+
al as G,
|
|
8809
|
+
ul as H,
|
|
8810
|
+
fl as I,
|
|
8811
|
+
kl as J,
|
|
8812
|
+
$l as K,
|
|
8813
|
+
Ol as L,
|
|
8814
|
+
Nl as M,
|
|
8815
|
+
Hl as N,
|
|
8816
|
+
ah as O,
|
|
8817
|
+
Jl as P,
|
|
8818
|
+
au as Q,
|
|
8819
|
+
uu as R,
|
|
8820
|
+
Tu as S,
|
|
8821
|
+
vu as T,
|
|
8822
|
+
Au as U,
|
|
8823
|
+
Pu as V,
|
|
8824
|
+
Hu as W,
|
|
8825
|
+
Vu as X,
|
|
8826
|
+
op as Y,
|
|
8827
|
+
up as Z,
|
|
8828
|
+
fp as _,
|
|
8794
8829
|
Da as a,
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8830
|
+
Gp as a0,
|
|
8831
|
+
sh as a1,
|
|
8832
|
+
Ih as a2,
|
|
8798
8833
|
ln as a3,
|
|
8799
8834
|
Wa as b,
|
|
8800
8835
|
Za as c,
|
|
@@ -8810,15 +8845,15 @@ export {
|
|
|
8810
8845
|
pc as m,
|
|
8811
8846
|
dc as n,
|
|
8812
8847
|
bc as o,
|
|
8813
|
-
|
|
8814
|
-
|
|
8848
|
+
$c as p,
|
|
8849
|
+
Lc as q,
|
|
8815
8850
|
Na as r,
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8851
|
+
qc as s,
|
|
8852
|
+
nh as t,
|
|
8853
|
+
Xc as u,
|
|
8854
|
+
td as v,
|
|
8855
|
+
cd as w,
|
|
8856
|
+
md as x,
|
|
8857
|
+
wd as y,
|
|
8858
|
+
Ud as z
|
|
8824
8859
|
};
|