@todoist/mcp 0.0.1 → 15.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +217 -29
- package/dist/filter-helpers.d.ts +53 -0
- package/dist/filter-helpers.d.ts.map +1 -0
- package/dist/http-app.d.ts +28 -0
- package/dist/http-app.d.ts.map +1 -0
- package/dist/index.d.ts +4347 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +61 -0
- package/dist/main-http.d.ts +3 -0
- package/dist/main-http.d.ts.map +1 -0
- package/dist/main-http.js +133 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +16 -0
- package/dist/mcp-apps/index.html +116 -0
- package/dist/mcp-helpers.d.ts +62 -0
- package/dist/mcp-helpers.d.ts.map +1 -0
- package/dist/mcp-server-y4HhlBJW.js +8152 -0
- package/dist/mcp-server.d.ts +16 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/middleware/require-trusted-host.d.ts +44 -0
- package/dist/middleware/require-trusted-host.d.ts.map +1 -0
- package/dist/middleware/require-valid-todoist-token.d.ts +39 -0
- package/dist/middleware/require-valid-todoist-token.d.ts.map +1 -0
- package/dist/prompts/productivity-analysis.d.ts +58 -0
- package/dist/prompts/productivity-analysis.d.ts.map +1 -0
- package/dist/require-valid-todoist-token-I1jh7sbd.js +63 -0
- package/dist/todoist-tool.d.ts +15 -0
- package/dist/todoist-tool.d.ts.map +1 -0
- package/dist/tool-execution-error.d.ts +27 -0
- package/dist/tool-execution-error.d.ts.map +1 -0
- package/dist/tool-helpers.d.ts +318 -0
- package/dist/tool-helpers.d.ts.map +1 -0
- package/dist/tool-registry.d.ts +4307 -0
- package/dist/tool-registry.d.ts.map +1 -0
- package/dist/tools/add-comments.d.ts +104 -0
- package/dist/tools/add-comments.d.ts.map +1 -0
- package/dist/tools/add-filters.d.ts +113 -0
- package/dist/tools/add-filters.d.ts.map +1 -0
- package/dist/tools/add-labels.d.ts +107 -0
- package/dist/tools/add-labels.d.ts.map +1 -0
- package/dist/tools/add-projects.d.ts +134 -0
- package/dist/tools/add-projects.d.ts.map +1 -0
- package/dist/tools/add-reminders.d.ts +174 -0
- package/dist/tools/add-reminders.d.ts.map +1 -0
- package/dist/tools/add-sections.d.ts +61 -0
- package/dist/tools/add-sections.d.ts.map +1 -0
- package/dist/tools/add-tasks.d.ts +123 -0
- package/dist/tools/add-tasks.d.ts.map +1 -0
- package/dist/tools/analyze-project-health.d.ts +45 -0
- package/dist/tools/analyze-project-health.d.ts.map +1 -0
- package/dist/tools/complete-tasks.d.ts +42 -0
- package/dist/tools/complete-tasks.d.ts.map +1 -0
- package/dist/tools/delete-object.d.ts +54 -0
- package/dist/tools/delete-object.d.ts.map +1 -0
- package/dist/tools/export-project-template.d.ts +54 -0
- package/dist/tools/export-project-template.d.ts.map +1 -0
- package/dist/tools/fetch-object.d.ts +243 -0
- package/dist/tools/fetch-object.d.ts.map +1 -0
- package/dist/tools/fetch.d.ts +41 -0
- package/dist/tools/fetch.d.ts.map +1 -0
- package/dist/tools/find-activity.d.ts +98 -0
- package/dist/tools/find-activity.d.ts.map +1 -0
- package/dist/tools/find-comments.d.ts +91 -0
- package/dist/tools/find-comments.d.ts.map +1 -0
- package/dist/tools/find-completed-tasks.d.ts +119 -0
- package/dist/tools/find-completed-tasks.d.ts.map +1 -0
- package/dist/tools/find-filters.d.ts +95 -0
- package/dist/tools/find-filters.d.ts.map +1 -0
- package/dist/tools/find-labels.d.ts +81 -0
- package/dist/tools/find-labels.d.ts.map +1 -0
- package/dist/tools/find-project-collaborators.d.ts +94 -0
- package/dist/tools/find-project-collaborators.d.ts.map +1 -0
- package/dist/tools/find-projects.d.ts +98 -0
- package/dist/tools/find-projects.d.ts.map +1 -0
- package/dist/tools/find-reminders.d.ts +99 -0
- package/dist/tools/find-reminders.d.ts.map +1 -0
- package/dist/tools/find-sections.d.ts +45 -0
- package/dist/tools/find-sections.d.ts.map +1 -0
- package/dist/tools/find-tasks-by-date.d.ts +137 -0
- package/dist/tools/find-tasks-by-date.d.ts.map +1 -0
- package/dist/tools/find-tasks.d.ts +120 -0
- package/dist/tools/find-tasks.d.ts.map +1 -0
- package/dist/tools/get-overview.d.ts +121 -0
- package/dist/tools/get-overview.d.ts.map +1 -0
- package/dist/tools/get-productivity-stats.d.ts +160 -0
- package/dist/tools/get-productivity-stats.d.ts.map +1 -0
- package/dist/tools/get-project-activity-stats.d.ts +48 -0
- package/dist/tools/get-project-activity-stats.d.ts.map +1 -0
- package/dist/tools/get-project-health.d.ts +104 -0
- package/dist/tools/get-project-health.d.ts.map +1 -0
- package/dist/tools/get-user-status.d.ts +35 -0
- package/dist/tools/get-user-status.d.ts.map +1 -0
- package/dist/tools/get-workspace-insights.d.ts +63 -0
- package/dist/tools/get-workspace-insights.d.ts.map +1 -0
- package/dist/tools/import-project-template.d.ts +148 -0
- package/dist/tools/import-project-template.d.ts.map +1 -0
- package/dist/tools/list-workspaces.d.ts +54 -0
- package/dist/tools/list-workspaces.d.ts.map +1 -0
- package/dist/tools/manage-assignments.d.ts +73 -0
- package/dist/tools/manage-assignments.d.ts.map +1 -0
- package/dist/tools/project-management.d.ts +82 -0
- package/dist/tools/project-management.d.ts.map +1 -0
- package/dist/tools/project-move.d.ts +92 -0
- package/dist/tools/project-move.d.ts.map +1 -0
- package/dist/tools/reorder-objects.d.ts +61 -0
- package/dist/tools/reorder-objects.d.ts.map +1 -0
- package/dist/tools/reschedule-tasks.d.ts +95 -0
- package/dist/tools/reschedule-tasks.d.ts.map +1 -0
- package/dist/tools/search.d.ts +43 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/set-user-status.d.ts +51 -0
- package/dist/tools/set-user-status.d.ts.map +1 -0
- package/dist/tools/uncomplete-tasks.d.ts +42 -0
- package/dist/tools/uncomplete-tasks.d.ts.map +1 -0
- package/dist/tools/update-comments.d.ts +100 -0
- package/dist/tools/update-comments.d.ts.map +1 -0
- package/dist/tools/update-filters.d.ts +121 -0
- package/dist/tools/update-filters.d.ts.map +1 -0
- package/dist/tools/update-labels.d.ts +133 -0
- package/dist/tools/update-labels.d.ts.map +1 -0
- package/dist/tools/update-projects.d.ts +138 -0
- package/dist/tools/update-projects.d.ts.map +1 -0
- package/dist/tools/update-reminders.d.ts +176 -0
- package/dist/tools/update-reminders.d.ts.map +1 -0
- package/dist/tools/update-sections.d.ts +65 -0
- package/dist/tools/update-sections.d.ts.map +1 -0
- package/dist/tools/update-tasks.d.ts +135 -0
- package/dist/tools/update-tasks.d.ts.map +1 -0
- package/dist/tools/user-info.d.ts +57 -0
- package/dist/tools/user-info.d.ts.map +1 -0
- package/dist/tools/view-attachment.d.ts +25 -0
- package/dist/tools/view-attachment.d.ts.map +1 -0
- package/dist/usage-tracking.d.ts +36 -0
- package/dist/usage-tracking.d.ts.map +1 -0
- package/dist/utils/assignment-validator.d.ts +69 -0
- package/dist/utils/assignment-validator.d.ts.map +1 -0
- package/dist/utils/batch-failures.d.ts +25 -0
- package/dist/utils/batch-failures.d.ts.map +1 -0
- package/dist/utils/children.d.ts +68 -0
- package/dist/utils/children.d.ts.map +1 -0
- package/dist/utils/colors.d.ts +68 -0
- package/dist/utils/colors.d.ts.map +1 -0
- package/dist/utils/comment-recipients.d.ts +35 -0
- package/dist/utils/comment-recipients.d.ts.map +1 -0
- package/dist/utils/concurrency.d.ts +35 -0
- package/dist/utils/concurrency.d.ts.map +1 -0
- package/dist/utils/constants.d.ts +93 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/date.d.ts +18 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/duration-parser.d.ts +39 -0
- package/dist/utils/duration-parser.d.ts.map +1 -0
- package/dist/utils/filter-description.d.ts +16 -0
- package/dist/utils/filter-description.d.ts.map +1 -0
- package/dist/utils/filter-resolver.d.ts +27 -0
- package/dist/utils/filter-resolver.d.ts.map +1 -0
- package/dist/utils/host.d.ts +6 -0
- package/dist/utils/host.d.ts.map +1 -0
- package/dist/utils/labels.d.ts +13 -0
- package/dist/utils/labels.d.ts.map +1 -0
- package/dist/utils/move-planner.d.ts +63 -0
- package/dist/utils/move-planner.d.ts.map +1 -0
- package/dist/utils/order-keys.d.ts +36 -0
- package/dist/utils/order-keys.d.ts.map +1 -0
- package/dist/utils/output-schemas.d.ts +209 -0
- package/dist/utils/output-schemas.d.ts.map +1 -0
- package/dist/utils/personal-project-limit.d.ts +31 -0
- package/dist/utils/personal-project-limit.d.ts.map +1 -0
- package/dist/utils/priorities.d.ts +14 -0
- package/dist/utils/priorities.d.ts.map +1 -0
- package/dist/utils/reminder-recipients.d.ts +21 -0
- package/dist/utils/reminder-recipients.d.ts.map +1 -0
- package/dist/utils/reminder-schemas.d.ts +41 -0
- package/dist/utils/reminder-schemas.d.ts.map +1 -0
- package/dist/utils/response-builders.d.ts +103 -0
- package/dist/utils/response-builders.d.ts.map +1 -0
- package/dist/utils/retry.d.ts +39 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/schema-helpers.d.ts +10 -0
- package/dist/utils/schema-helpers.d.ts.map +1 -0
- package/dist/utils/sync-commands.d.ts +21 -0
- package/dist/utils/sync-commands.d.ts.map +1 -0
- package/dist/utils/test-helpers.d.ts +118 -0
- package/dist/utils/test-helpers.d.ts.map +1 -0
- package/dist/utils/tool-names.d.ts +60 -0
- package/dist/utils/tool-names.d.ts.map +1 -0
- package/dist/utils/user-resolver.d.ts +92 -0
- package/dist/utils/user-resolver.d.ts.map +1 -0
- package/dist/utils/user-status.d.ts +32 -0
- package/dist/utils/user-status.d.ts.map +1 -0
- package/dist/utils/validate-todoist-token.d.ts +17 -0
- package/dist/utils/validate-todoist-token.d.ts.map +1 -0
- package/dist/utils/workspace-resolver.d.ts +31 -0
- package/dist/utils/workspace-resolver.d.ts.map +1 -0
- package/package.json +115 -8
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application-wide constants
|
|
3
|
+
*
|
|
4
|
+
* This module centralizes magic numbers and configuration values
|
|
5
|
+
* to improve maintainability and provide a single source of truth.
|
|
6
|
+
*/
|
|
7
|
+
/** One hour in milliseconds. */
|
|
8
|
+
export declare const ONE_HOUR_MS: number;
|
|
9
|
+
/** One year (365 days) in milliseconds. */
|
|
10
|
+
export declare const ONE_YEAR_MS: number;
|
|
11
|
+
export declare const ApiLimits: {
|
|
12
|
+
/** Default limit for task listings */
|
|
13
|
+
readonly TASKS_DEFAULT: 10;
|
|
14
|
+
/** Maximum limit for task search and list operations */
|
|
15
|
+
readonly TASKS_MAX: 100;
|
|
16
|
+
/** Default limit for completed tasks */
|
|
17
|
+
readonly COMPLETED_TASKS_DEFAULT: 50;
|
|
18
|
+
/** Maximum limit for completed tasks */
|
|
19
|
+
readonly COMPLETED_TASKS_MAX: 200;
|
|
20
|
+
/** Default limit for project listings */
|
|
21
|
+
readonly PROJECTS_DEFAULT: 50;
|
|
22
|
+
/** Maximum limit for project listings */
|
|
23
|
+
readonly PROJECTS_MAX: 200;
|
|
24
|
+
/** Maximum limit for section listings */
|
|
25
|
+
readonly SECTIONS_MAX: 200;
|
|
26
|
+
/** Batch size for fetching all tasks in a project */
|
|
27
|
+
readonly TASKS_BATCH_SIZE: 50;
|
|
28
|
+
/** Maximum number of direct children returned when children are requested alongside an object */
|
|
29
|
+
readonly CHILDREN_MAX: 25;
|
|
30
|
+
/** Default limit for comment listings */
|
|
31
|
+
readonly COMMENTS_DEFAULT: 10;
|
|
32
|
+
/** Maximum limit for comment search and list operations */
|
|
33
|
+
readonly COMMENTS_MAX: 10;
|
|
34
|
+
/** Maximum number of users a single comment can notify */
|
|
35
|
+
readonly NOTIFY_USERS_MAX: 25;
|
|
36
|
+
/** Default limit for activity log listings */
|
|
37
|
+
readonly ACTIVITY_DEFAULT: 20;
|
|
38
|
+
/** Maximum limit for activity log search and list operations */
|
|
39
|
+
readonly ACTIVITY_MAX: 100;
|
|
40
|
+
/** Default limit for label listings */
|
|
41
|
+
readonly LABELS_DEFAULT: 50;
|
|
42
|
+
/** Maximum limit for label listings */
|
|
43
|
+
readonly LABELS_MAX: 200;
|
|
44
|
+
/** Default limit for reminder listings */
|
|
45
|
+
readonly REMINDERS_DEFAULT: 50;
|
|
46
|
+
/** Maximum limit for reminder search operations */
|
|
47
|
+
readonly REMINDERS_MAX: 200;
|
|
48
|
+
};
|
|
49
|
+
export declare const DisplayLimits: {
|
|
50
|
+
/** Maximum number of failures to show in detailed error messages */
|
|
51
|
+
readonly MAX_FAILURES_SHOWN: 3;
|
|
52
|
+
/** Threshold for suggesting batch operations */
|
|
53
|
+
readonly BATCH_OPERATION_THRESHOLD: 10;
|
|
54
|
+
};
|
|
55
|
+
export declare const LogLimits: {
|
|
56
|
+
/** Maximum number of failed items named in one log line */
|
|
57
|
+
readonly MAX_FAILURES_LOGGED: 5;
|
|
58
|
+
};
|
|
59
|
+
export declare const BatchLimits: {
|
|
60
|
+
/** Maximum tasks accepted by one task create or update operation */
|
|
61
|
+
readonly TASKS_PER_OPERATION: 25;
|
|
62
|
+
};
|
|
63
|
+
export declare const ConcurrencyLimits: {
|
|
64
|
+
/**
|
|
65
|
+
* In-flight task-move requests per account, per process.
|
|
66
|
+
*
|
|
67
|
+
* Kept at 1 because the API locks the whole task tree for a move, and a tree
|
|
68
|
+
* spans a task's source as well as its destination — two moves of sibling
|
|
69
|
+
* subtasks contend even when they target different projects, and the loser
|
|
70
|
+
* fails. Batching same-destination moves into a single request means
|
|
71
|
+
* serialising costs little in practice. One per process is the smallest
|
|
72
|
+
* contribution a process can make; see the note above for the global picture.
|
|
73
|
+
*/
|
|
74
|
+
readonly TASK_MOVES: 1;
|
|
75
|
+
/** In-flight non-move write requests per account, per process. */
|
|
76
|
+
readonly WRITES: 4;
|
|
77
|
+
/**
|
|
78
|
+
* How long a request may wait for a slot before it is abandoned unsent.
|
|
79
|
+
*
|
|
80
|
+
* Matches the SDK's own 30s request timeout, which only starts once a request
|
|
81
|
+
* actually goes out: a task that has already waited that long would be
|
|
82
|
+
* answering a caller who has given up. Comfortably above the worst realistic
|
|
83
|
+
* queue (serialised moves to 100 distinct destinations is roughly 15s).
|
|
84
|
+
*/
|
|
85
|
+
readonly QUEUE_WAIT_MS: 30000;
|
|
86
|
+
};
|
|
87
|
+
export declare const ResponseConfig: {
|
|
88
|
+
/** Maximum characters per line in text responses */
|
|
89
|
+
readonly MAX_LINE_LENGTH: 100;
|
|
90
|
+
/** Indentation for nested items */
|
|
91
|
+
readonly INDENT_SIZE: 2;
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,gCAAgC;AAChC,eAAO,MAAM,WAAW,QAAiB,CAAA;AACzC,2CAA2C;AAC3C,eAAO,MAAM,WAAW,QAAyB,CAAA;AAGjD,eAAO,MAAM,SAAS;IAClB,sCAAsC;;IAEtC,wDAAwD;;IAExD,wCAAwC;;IAExC,wCAAwC;;IAExC,yCAAyC;;IAEzC,yCAAyC;;IAEzC,yCAAyC;;IAEzC,qDAAqD;;IAErD,iGAAiG;;IAEjG,yCAAyC;;IAEzC,2DAA2D;;IAE3D,0DAA0D;;IAE1D,8CAA8C;;IAE9C,gEAAgE;;IAEhE,uCAAuC;;IAEvC,uCAAuC;;IAEvC,0CAA0C;;IAE1C,mDAAmD;;CAE7C,CAAA;AAGV,eAAO,MAAM,aAAa;IACtB,oEAAoE;;IAEpE,gDAAgD;;CAE1C,CAAA;AAGV,eAAO,MAAM,SAAS;IAClB,2DAA2D;;CAErD,CAAA;AAGV,eAAO,MAAM,WAAW;IACpB,oEAAoE;;CAE9D,CAAA;AAYV,eAAO,MAAM,iBAAiB;IAC1B;;;;;;;;;OASG;;IAEH,kEAAkE;;IAElE;;;;;;;OAOG;;CAEG,CAAA;AAGV,eAAO,MAAM,cAAc;IACvB,oDAAoD;;IAEpD,mCAAmC;;CAE7B,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a Date using UTC calendar components (YYYY-MM-DD).
|
|
3
|
+
*/
|
|
4
|
+
export declare function formatUtcDate(date: Date): string;
|
|
5
|
+
/**
|
|
6
|
+
* Parse a GMT offset string (+HH:MM or -HH:MM) to total minutes.
|
|
7
|
+
* Falls back to 0 for malformed offsets.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseGmtOffsetToMinutes(gmtOffset: string): number;
|
|
10
|
+
/**
|
|
11
|
+
* Return the date string (YYYY-MM-DD) in a provided GMT offset.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getDateInOffset(date: Date, offsetMinutes: number): string;
|
|
14
|
+
/**
|
|
15
|
+
* Shift a YYYY-MM-DD date string by the specified number of days in UTC.
|
|
16
|
+
*/
|
|
17
|
+
export declare function shiftDateStringByDays(dateString: string, days: number): string;
|
|
18
|
+
//# sourceMappingURL=date.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/utils/date.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAKhD;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CASjE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAGzE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAa9E"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DurationUnit } from '@doist/todoist-sdk';
|
|
2
|
+
type ParsedDuration = {
|
|
3
|
+
amount: number;
|
|
4
|
+
unit: DurationUnit;
|
|
5
|
+
};
|
|
6
|
+
export declare const DURATION_INPUT_DESCRIPTION = "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.";
|
|
7
|
+
export declare class DurationParseError extends Error {
|
|
8
|
+
constructor(input: string, reason: string);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Parses a duration string in the restricted syntax into the amount and unit
|
|
12
|
+
* the API stores: whole days for "3d", otherwise minutes.
|
|
13
|
+
*
|
|
14
|
+
* @param durationStr - Duration string like "2h30m", "45m", "1.5h", "3d"
|
|
15
|
+
* @returns Parsed duration amount and unit
|
|
16
|
+
* @throws DurationParseError for invalid formats
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseDuration(durationStr: string): ParsedDuration;
|
|
19
|
+
/**
|
|
20
|
+
* Formats a stored duration back to a human-readable string.
|
|
21
|
+
* Used when returning task data to LLMs.
|
|
22
|
+
*
|
|
23
|
+
* The output mirrors the stored unit so it round-trips through `parseDuration`:
|
|
24
|
+
* day durations become "3d", and minute durations always use hours/minutes
|
|
25
|
+
* ("48h", never "2d") so a day-based and a minute-based duration stay
|
|
26
|
+
* distinguishable.
|
|
27
|
+
*
|
|
28
|
+
* @param amount - Duration amount in the given unit
|
|
29
|
+
* @param unit - The unit the amount is stored in
|
|
30
|
+
* @returns Formatted duration string like "2h30m", "45m" or "3d"
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* Parses one batch item's duration, prefixing a format error with `label` (e.g.
|
|
34
|
+
* `Task 123`) so the caller can report it against that item.
|
|
35
|
+
*/
|
|
36
|
+
export declare function parseItemDuration(label: string, durationStr: string): ParsedDuration;
|
|
37
|
+
export declare function formatDuration(amount: number, unit?: DurationUnit): string;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=duration-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration-parser.d.ts","sourceRoot":"","sources":["../../src/utils/duration-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,KAAK,cAAc,GAAG;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,YAAY,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,0BAA0B,gXACgU,CAAA;AAIvW,qBAAa,kBAAmB,SAAQ,KAAK;gBAC7B,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAI5C;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,CA0BjE;AAqFD;;;;;;;;;;;;GAYG;AACH;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,cAAc,CASpF;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,YAAuB,GAAG,MAAM,CAmBpF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes a filter's description for structured output.
|
|
3
|
+
*
|
|
4
|
+
* A filter with no description can arrive as either `null` or `""`: the column is
|
|
5
|
+
* nullable, and the sync view normalizes NULL to an empty string on the way out.
|
|
6
|
+
* Both mean the same thing, so both collapse to `undefined` here.
|
|
7
|
+
*
|
|
8
|
+
* Returning `undefined` rather than `null` matters. Structured content is sanitised
|
|
9
|
+
* with `removeNullFields` on the way out, so a null would be stripped from the payload
|
|
10
|
+
* and then fail validation against the declared output schema, which is optional
|
|
11
|
+
* rather than nullable.
|
|
12
|
+
*/
|
|
13
|
+
export declare function readFilterDescription(filter: {
|
|
14
|
+
description?: string | null;
|
|
15
|
+
}): string | undefined;
|
|
16
|
+
//# sourceMappingURL=filter-description.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-description.d.ts","sourceRoot":"","sources":["../../src/utils/filter-description.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,MAAM,GAAG,SAAS,CAGjG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TodoistApi } from '@doist/todoist-sdk';
|
|
2
|
+
export type ResolvedFilter = {
|
|
3
|
+
filterId: string;
|
|
4
|
+
filterName: string;
|
|
5
|
+
filterQuery: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class FilterResolver {
|
|
8
|
+
private cacheByClient;
|
|
9
|
+
private getFilters;
|
|
10
|
+
/**
|
|
11
|
+
* Resolve a filter name or ID to a filter ID, name, and query.
|
|
12
|
+
*
|
|
13
|
+
* Resolution order:
|
|
14
|
+
* 1. Exact ID match
|
|
15
|
+
* 2. Exact case-insensitive name match
|
|
16
|
+
* 3. Unique partial case-insensitive name match
|
|
17
|
+
* 4. Multiple partial matches → throw ambiguous error
|
|
18
|
+
* 5. No match → throw not-found error
|
|
19
|
+
*/
|
|
20
|
+
resolveFilter(client: TodoistApi, nameOrId: string): Promise<ResolvedFilter>;
|
|
21
|
+
/**
|
|
22
|
+
* Clear all client caches and detach pending syncs — useful for testing.
|
|
23
|
+
*/
|
|
24
|
+
clearCache(): void;
|
|
25
|
+
}
|
|
26
|
+
export declare const filterResolver: FilterResolver;
|
|
27
|
+
//# sourceMappingURL=filter-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-resolver.d.ts","sourceRoot":"","sources":["../../src/utils/filter-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE5D,MAAM,MAAM,cAAc,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;CACtB,CAAA;AAMD,qBAAa,cAAc;IAMvB,OAAO,CAAC,aAAa,CAA8C;YAErD,UAAU;IAiBxB;;;;;;;;;OASG;IACG,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAuDlF;;OAEG;IACH,UAAU,IAAI,IAAI;CAGrB;AAGD,eAAO,MAAM,cAAc,gBAAuB,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Strip the surrounding brackets from a bracketed IPv6 literal, if present. */
|
|
2
|
+
declare function normalizeListenHost(host: string): string;
|
|
3
|
+
/** Whether `host` refers to a loopback interface (localhost / 127.0.0.0/8 / ::1). */
|
|
4
|
+
declare function isLoopbackHost(host: string): boolean;
|
|
5
|
+
export { isLoopbackHost, normalizeListenHost };
|
|
6
|
+
//# sourceMappingURL=host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/utils/host.ts"],"names":[],"mappings":"AAEA,gFAAgF;AAChF,iBAAS,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED,qFAAqF;AACrF,iBAAS,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAY7C;AAED,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const LABELS_OPERATORS: readonly ["and", "or"];
|
|
3
|
+
type LabelsOperator = (typeof LABELS_OPERATORS)[number];
|
|
4
|
+
export declare const LabelsSchema: {
|
|
5
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6
|
+
labelsOperator: z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
and: "and";
|
|
8
|
+
or: "or";
|
|
9
|
+
}>>;
|
|
10
|
+
};
|
|
11
|
+
export declare function generateLabelsFilter(labels?: string[], labelsOperator?: LabelsOperator): string;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/utils/labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,QAAA,MAAM,gBAAgB,wBAAyB,CAAA;AAC/C,KAAK,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,eAAO,MAAM,YAAY;;;;;;CAQxB,CAAA;AAED,wBAAgB,oBAAoB,CAAC,MAAM,GAAE,MAAM,EAAO,EAAE,cAAc,GAAE,cAAqB,UAOhG"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { MoveTaskArgs, Task } from '@doist/todoist-sdk';
|
|
2
|
+
/** The container fields a caller can send to relocate a task. */
|
|
3
|
+
type MoveRequest = {
|
|
4
|
+
projectId?: string | undefined;
|
|
5
|
+
sectionId?: string | undefined;
|
|
6
|
+
parentId?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
type MovePlan = {
|
|
9
|
+
/** The move to perform, or undefined when the task is already where it was asked to go. */
|
|
10
|
+
move?: MoveTaskArgs;
|
|
11
|
+
/** True when a requested destination was dropped as already-satisfied. */
|
|
12
|
+
redundantMoveSkipped: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Whether moving `current` to `destination` would leave the task exactly where it
|
|
16
|
+
* already is, making the request a pointless write.
|
|
17
|
+
*
|
|
18
|
+
* Matching the destination field alone is not enough. Moving a task to a project
|
|
19
|
+
* also lifts it out of its section and out from under its parent, and moving it
|
|
20
|
+
* to a section lifts it out from under its parent — so a task that matches on
|
|
21
|
+
* `projectId` but sits in a section is *not* already in the requested end state.
|
|
22
|
+
*
|
|
23
|
+
* The extra conditions therefore make this predicate conservative on purpose: it
|
|
24
|
+
* only reports "redundant" when the task already looks the way the move would
|
|
25
|
+
* leave it under those detaching semantics. If the API turned out not to detach,
|
|
26
|
+
* the cost is a move we could have skipped, never a move we wrongly skipped.
|
|
27
|
+
*/
|
|
28
|
+
declare function isMoveRedundant(current: Task, destination: MoveTaskArgs): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Identifies a move destination, so tasks heading to the same place can be
|
|
31
|
+
* collapsed into one request.
|
|
32
|
+
*/
|
|
33
|
+
declare function destinationKey(move: MoveTaskArgs): string;
|
|
34
|
+
/**
|
|
35
|
+
* Works out what move, if any, a requested update actually needs.
|
|
36
|
+
*
|
|
37
|
+
* Callers commonly echo a task's whole current shape back when they only meant to
|
|
38
|
+
* edit a field, which would otherwise be read as a relocation. Dropping the
|
|
39
|
+
* containers the task already satisfies means those calls perform no move at all —
|
|
40
|
+
* and a request that names several containers, all but one of them unchanged,
|
|
41
|
+
* resolves to the single real move instead of being rejected as ambiguous.
|
|
42
|
+
*
|
|
43
|
+
* A single container is judged on the whole position it describes, so asking for a
|
|
44
|
+
* task's current project still moves it when that would lift it out of a section.
|
|
45
|
+
* Several containers are judged field by field, so a task described as already
|
|
46
|
+
* being in its project *and* its section is left alone rather than pulled out of
|
|
47
|
+
* that section.
|
|
48
|
+
*
|
|
49
|
+
* @param taskId - Used only to describe the task in error messages.
|
|
50
|
+
* @param request - The container fields as supplied by the caller.
|
|
51
|
+
* @param current - The task's current state, or undefined when it could not be
|
|
52
|
+
* read. Unknown state means every requested move is performed, matching the
|
|
53
|
+
* behaviour of not checking at all.
|
|
54
|
+
* @throws If more than one genuine destination remains, since the API accepts
|
|
55
|
+
* exactly one.
|
|
56
|
+
*/
|
|
57
|
+
declare function planMove({ taskId, request, current, }: {
|
|
58
|
+
taskId: string;
|
|
59
|
+
request: MoveRequest;
|
|
60
|
+
current: Task | undefined;
|
|
61
|
+
}): MovePlan;
|
|
62
|
+
export { destinationKey, isMoveRedundant, type MovePlan, type MoveRequest, planMove };
|
|
63
|
+
//# sourceMappingURL=move-planner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-planner.d.ts","sourceRoot":"","sources":["../../src/utils/move-planner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAE5D,iEAAiE;AACjE,KAAK,WAAW,GAAG;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAChC,CAAA;AAED,KAAK,QAAQ,GAAG;IACZ,2FAA2F;IAC3F,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,0EAA0E;IAC1E,oBAAoB,EAAE,OAAO,CAAA;CAChC,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,iBAAS,eAAe,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,GAAG,OAAO,CAY1E;AAsBD;;;GAGG;AACH,iBAAS,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAQlD;AAgBD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,QAAQ,CAAC,EACd,MAAM,EACN,OAAO,EACP,OAAO,GACV,EAAE;IACC,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,WAAW,CAAA;IACpB,OAAO,EAAE,IAAI,GAAG,SAAS,CAAA;CAC5B,GAAG,QAAQ,CA4BX;AAED,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** One entity in a list of siblings that Todoist orders by fractional-indexing key. */
|
|
2
|
+
type OrderedSibling = {
|
|
3
|
+
id: string;
|
|
4
|
+
/** The entity's order key, or null where Todoist has not assigned one yet. */
|
|
5
|
+
key: string | null;
|
|
6
|
+
/** The legacy integer order, used to sort the siblings when any of them has no key. */
|
|
7
|
+
legacyOrder: number;
|
|
8
|
+
};
|
|
9
|
+
/** Where one sibling should end up: a 0-based position in the reordered list. */
|
|
10
|
+
type Placement = {
|
|
11
|
+
id: string;
|
|
12
|
+
position: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Works out the order keys that put each placed sibling at its requested position.
|
|
16
|
+
*
|
|
17
|
+
* Positions are 0-based indexes into the list as it reads after the reorder, and
|
|
18
|
+
* one past the end (or beyond) appends. Placements are applied lowest position
|
|
19
|
+
* first, so several can be given at once and each lands where it asked. Placements
|
|
20
|
+
* that ask for the same position are kept together, in the order they were given.
|
|
21
|
+
*
|
|
22
|
+
* Only placed siblings get new keys: each run of them is keyed between the
|
|
23
|
+
* unplaced neighbours around it, so every other sibling keeps its key. A placed
|
|
24
|
+
* sibling whose key already sits in the right place keeps it too, so repeating a
|
|
25
|
+
* reorder writes nothing. When the existing keys cannot anchor a placement (a
|
|
26
|
+
* sibling has no key yet, or two share one), the whole list is re-keyed in its
|
|
27
|
+
* new order instead.
|
|
28
|
+
*
|
|
29
|
+
* Keys compare by UTF-16 code unit, as Todoist sorts them, never by locale.
|
|
30
|
+
*
|
|
31
|
+
* @returns The new key for each sibling whose key must change.
|
|
32
|
+
*/
|
|
33
|
+
declare function computeOrderKeys(siblings: readonly OrderedSibling[], placements: readonly Placement[]): Map<string, string>;
|
|
34
|
+
export { computeOrderKeys };
|
|
35
|
+
export type { OrderedSibling, Placement };
|
|
36
|
+
//# sourceMappingURL=order-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-keys.d.ts","sourceRoot":"","sources":["../../src/utils/order-keys.ts"],"names":[],"mappings":"AAEA,uFAAuF;AACvF,KAAK,cAAc,GAAG;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,8EAA8E;IAC9E,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,uFAAuF;IACvF,WAAW,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,iFAAiF;AACjF,KAAK,SAAS,GAAG;IACb,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,iBAAS,gBAAgB,CACrB,QAAQ,EAAE,SAAS,cAAc,EAAE,EACnC,UAAU,EAAE,SAAS,SAAS,EAAE,GACjC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA0CrB;AAyED,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAC3B,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { Section } from '@doist/todoist-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Schema for a mapped task object returned by tools
|
|
5
|
+
*/
|
|
6
|
+
declare const TaskSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
content: z.ZodString;
|
|
9
|
+
description: z.ZodString;
|
|
10
|
+
dueDate: z.ZodOptional<z.ZodString>;
|
|
11
|
+
recurring: z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>;
|
|
12
|
+
deadlineDate: z.ZodOptional<z.ZodString>;
|
|
13
|
+
priority: z.ZodEnum<{
|
|
14
|
+
p1: "p1";
|
|
15
|
+
p2: "p2";
|
|
16
|
+
p3: "p3";
|
|
17
|
+
p4: "p4";
|
|
18
|
+
}>;
|
|
19
|
+
projectId: z.ZodString;
|
|
20
|
+
sectionId: z.ZodOptional<z.ZodString>;
|
|
21
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
22
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
23
|
+
duration: z.ZodOptional<z.ZodString>;
|
|
24
|
+
responsibleUid: z.ZodOptional<z.ZodString>;
|
|
25
|
+
isUncompletable: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
assignedByUid: z.ZodOptional<z.ZodString>;
|
|
27
|
+
isDeleted: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
checked: z.ZodBoolean;
|
|
29
|
+
completedAt: z.ZodOptional<z.ZodString>;
|
|
30
|
+
addedAt: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
/**
|
|
33
|
+
* Schema for a mapped project object returned by tools
|
|
34
|
+
*/
|
|
35
|
+
declare const ProjectSchema: z.ZodObject<{
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
description: z.ZodString;
|
|
39
|
+
color: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
berry_red: "berry_red";
|
|
41
|
+
red: "red";
|
|
42
|
+
orange: "orange";
|
|
43
|
+
yellow: "yellow";
|
|
44
|
+
olive_green: "olive_green";
|
|
45
|
+
lime_green: "lime_green";
|
|
46
|
+
green: "green";
|
|
47
|
+
mint_green: "mint_green";
|
|
48
|
+
teal: "teal";
|
|
49
|
+
sky_blue: "sky_blue";
|
|
50
|
+
light_blue: "light_blue";
|
|
51
|
+
blue: "blue";
|
|
52
|
+
grape: "grape";
|
|
53
|
+
violet: "violet";
|
|
54
|
+
lavender: "lavender";
|
|
55
|
+
magenta: "magenta";
|
|
56
|
+
salmon: "salmon";
|
|
57
|
+
charcoal: "charcoal";
|
|
58
|
+
grey: "grey";
|
|
59
|
+
taupe: "taupe";
|
|
60
|
+
}>>>;
|
|
61
|
+
isFavorite: z.ZodBoolean;
|
|
62
|
+
isShared: z.ZodBoolean;
|
|
63
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
64
|
+
inboxProject: z.ZodBoolean;
|
|
65
|
+
viewStyle: z.ZodString;
|
|
66
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
67
|
+
folderId: z.ZodOptional<z.ZodString>;
|
|
68
|
+
childOrder: z.ZodNumber;
|
|
69
|
+
isArchived: z.ZodBoolean;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
/**
|
|
72
|
+
* Schema for a section object returned by tools
|
|
73
|
+
*/
|
|
74
|
+
declare const SectionSchema: z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
name: z.ZodString;
|
|
77
|
+
sectionOrder: z.ZodNumber;
|
|
78
|
+
description: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
type SectionSummary = z.infer<typeof SectionSchema>;
|
|
81
|
+
/**
|
|
82
|
+
* Strip an SDK Section down to the fields declared in SectionSchema. Keeps tool
|
|
83
|
+
* responses aligned with the schema. The output schema uses an optional string
|
|
84
|
+
* (Gemini-compatible), so the read's `string | null` description maps `null` to
|
|
85
|
+
* `undefined`.
|
|
86
|
+
*/
|
|
87
|
+
declare function toSectionSummary({ id, name, sectionOrder, description }: Section): SectionSummary;
|
|
88
|
+
/**
|
|
89
|
+
* Schema for a comment object returned by tools
|
|
90
|
+
*/
|
|
91
|
+
declare const CommentSchema: z.ZodObject<{
|
|
92
|
+
id: z.ZodString;
|
|
93
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
94
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
95
|
+
content: z.ZodString;
|
|
96
|
+
postedAt: z.ZodString;
|
|
97
|
+
postedUid: z.ZodOptional<z.ZodString>;
|
|
98
|
+
notifiedUserIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
99
|
+
fileAttachment: z.ZodOptional<z.ZodObject<{
|
|
100
|
+
resourceType: z.ZodString;
|
|
101
|
+
fileName: z.ZodOptional<z.ZodString>;
|
|
102
|
+
fileSize: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
fileType: z.ZodOptional<z.ZodString>;
|
|
104
|
+
fileUrl: z.ZodOptional<z.ZodString>;
|
|
105
|
+
fileDuration: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
uploadState: z.ZodOptional<z.ZodEnum<{
|
|
107
|
+
pending: "pending";
|
|
108
|
+
completed: "completed";
|
|
109
|
+
}>>;
|
|
110
|
+
url: z.ZodOptional<z.ZodString>;
|
|
111
|
+
title: z.ZodOptional<z.ZodString>;
|
|
112
|
+
image: z.ZodOptional<z.ZodString>;
|
|
113
|
+
imageWidth: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
imageHeight: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
/**
|
|
118
|
+
* Schema for an activity event object returned by tools
|
|
119
|
+
*/
|
|
120
|
+
declare const ActivityEventSchema: z.ZodObject<{
|
|
121
|
+
id: z.ZodOptional<z.ZodString>;
|
|
122
|
+
objectType: z.ZodString;
|
|
123
|
+
objectId: z.ZodString;
|
|
124
|
+
eventType: z.ZodString;
|
|
125
|
+
eventDate: z.ZodString;
|
|
126
|
+
parentProjectId: z.ZodOptional<z.ZodString>;
|
|
127
|
+
parentItemId: z.ZodOptional<z.ZodString>;
|
|
128
|
+
initiatorId: z.ZodOptional<z.ZodString>;
|
|
129
|
+
extraData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
/**
|
|
132
|
+
* Schema for a user/collaborator object returned by tools
|
|
133
|
+
*/
|
|
134
|
+
declare const CollaboratorSchema: z.ZodObject<{
|
|
135
|
+
id: z.ZodString;
|
|
136
|
+
name: z.ZodString;
|
|
137
|
+
email: z.ZodString;
|
|
138
|
+
}, z.core.$strip>;
|
|
139
|
+
/**
|
|
140
|
+
* Schema for a label object returned by tools
|
|
141
|
+
*/
|
|
142
|
+
declare const LabelSchema: z.ZodObject<{
|
|
143
|
+
id: z.ZodString;
|
|
144
|
+
name: z.ZodString;
|
|
145
|
+
color: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
|
|
146
|
+
berry_red: "berry_red";
|
|
147
|
+
red: "red";
|
|
148
|
+
orange: "orange";
|
|
149
|
+
yellow: "yellow";
|
|
150
|
+
olive_green: "olive_green";
|
|
151
|
+
lime_green: "lime_green";
|
|
152
|
+
green: "green";
|
|
153
|
+
mint_green: "mint_green";
|
|
154
|
+
teal: "teal";
|
|
155
|
+
sky_blue: "sky_blue";
|
|
156
|
+
light_blue: "light_blue";
|
|
157
|
+
blue: "blue";
|
|
158
|
+
grape: "grape";
|
|
159
|
+
violet: "violet";
|
|
160
|
+
lavender: "lavender";
|
|
161
|
+
magenta: "magenta";
|
|
162
|
+
salmon: "salmon";
|
|
163
|
+
charcoal: "charcoal";
|
|
164
|
+
grey: "grey";
|
|
165
|
+
taupe: "taupe";
|
|
166
|
+
}>>>;
|
|
167
|
+
order: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
|
|
168
|
+
isFavorite: z.ZodBoolean;
|
|
169
|
+
}, z.core.$strip>;
|
|
170
|
+
/**
|
|
171
|
+
* Schema for a mapped reminder object returned by tools
|
|
172
|
+
*/
|
|
173
|
+
declare const ReminderSchema: z.ZodObject<{
|
|
174
|
+
id: z.ZodString;
|
|
175
|
+
taskId: z.ZodString;
|
|
176
|
+
type: z.ZodEnum<{
|
|
177
|
+
location: "location";
|
|
178
|
+
absolute: "absolute";
|
|
179
|
+
relative: "relative";
|
|
180
|
+
}>;
|
|
181
|
+
notifyUid: z.ZodOptional<z.ZodString>;
|
|
182
|
+
minuteOffset: z.ZodOptional<z.ZodNumber>;
|
|
183
|
+
due: z.ZodOptional<z.ZodObject<{
|
|
184
|
+
isRecurring: z.ZodBoolean;
|
|
185
|
+
string: z.ZodString;
|
|
186
|
+
date: z.ZodString;
|
|
187
|
+
datetime: z.ZodOptional<z.ZodString>;
|
|
188
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
name: z.ZodOptional<z.ZodString>;
|
|
191
|
+
locLat: z.ZodOptional<z.ZodString>;
|
|
192
|
+
locLong: z.ZodOptional<z.ZodString>;
|
|
193
|
+
locTrigger: z.ZodOptional<z.ZodEnum<{
|
|
194
|
+
on_enter: "on_enter";
|
|
195
|
+
on_leave: "on_leave";
|
|
196
|
+
}>>;
|
|
197
|
+
radius: z.ZodOptional<z.ZodNumber>;
|
|
198
|
+
isUrgent: z.ZodOptional<z.ZodBoolean>;
|
|
199
|
+
}, z.core.$strip>;
|
|
200
|
+
/**
|
|
201
|
+
* Schema for batch operation failure
|
|
202
|
+
*/
|
|
203
|
+
declare const FailureSchema: z.ZodObject<{
|
|
204
|
+
item: z.ZodString;
|
|
205
|
+
error: z.ZodString;
|
|
206
|
+
code: z.ZodOptional<z.ZodString>;
|
|
207
|
+
}, z.core.$strip>;
|
|
208
|
+
export { ActivityEventSchema, CollaboratorSchema, CommentSchema, FailureSchema, LabelSchema, ProjectSchema, ReminderSchema, SectionSchema, type SectionSummary, TaskSchema, toSectionSummary, };
|
|
209
|
+
//# sourceMappingURL=output-schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-schemas.d.ts","sourceRoot":"","sources":["../../src/utils/output-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACpF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB;;GAEG;AACH,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;iBAsBd,CAAA;AAEF;;GAEG;AACH,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAcjB,CAAA;AAEF;;GAEG;AACH,QAAA,MAAM,aAAa;;;;;iBAKjB,CAAA;AAEF,KAAK,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEnD;;;;;GAKG;AACH,iBAAS,gBAAgB,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,EAAE,OAAO,GAAG,cAAc,CAE1F;AAoBD;;GAEG;AACH,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;iBAYjB,CAAA;AAEF;;GAEG;AACH,QAAA,MAAM,mBAAmB;;;;;;;;;;iBAUvB,CAAA;AAEF;;GAEG;AACH,QAAA,MAAM,kBAAkB;;;;iBAItB,CAAA;AAEF;;GAEG;AACH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMf,CAAA;AAaF;;GAEG;AACH,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;iBAalB,CAAA;AAEF;;GAEG;AACH,QAAA,MAAM,aAAa;;;;iBAIjB,CAAA;AAEF,OAAO,EACH,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,EACd,aAAa,EACb,KAAK,cAAc,EACnB,UAAU,EACV,gBAAgB,GACnB,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TodoistApi } from '@doist/todoist-sdk';
|
|
2
|
+
import { ToolName } from './tool-names.js';
|
|
3
|
+
type PersonalProjectCapacity = {
|
|
4
|
+
/** The account's current plan limit on active personal projects. */
|
|
5
|
+
maxProjects: number;
|
|
6
|
+
/** Active personal projects that count towards the limit. */
|
|
7
|
+
activeCount: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Reads the account's personal project limit and how many projects count towards it.
|
|
11
|
+
*
|
|
12
|
+
* The API accepts a couple of projects beyond the plan limit, so offline clients
|
|
13
|
+
* can sync at the boundary. It therefore does not reject a create, unarchive or
|
|
14
|
+
* move-to-personal that the Todoist apps refuse; a tool that adds an active
|
|
15
|
+
* personal project checks this capacity first, as the apps do. The SDK applies the
|
|
16
|
+
* apps' counting rule: every active personal project except the Inbox.
|
|
17
|
+
*
|
|
18
|
+
* @returns The capacity, or `undefined` when the read fails or the plan has no
|
|
19
|
+
* project limit. The underlying error is logged under `toolName`, since the message
|
|
20
|
+
* the caller reports is deliberately generic.
|
|
21
|
+
*/
|
|
22
|
+
declare function loadPersonalProjectCapacity(client: TodoistApi, toolName: ToolName): Promise<PersonalProjectCapacity | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* Throws unless the account has room for one more active personal project.
|
|
25
|
+
*
|
|
26
|
+
* @param outcome - What the caller did not do, e.g. "This project was not created."
|
|
27
|
+
*/
|
|
28
|
+
declare function assertPersonalProjectCapacity(capacity: PersonalProjectCapacity | undefined, outcome: string): asserts capacity is PersonalProjectCapacity;
|
|
29
|
+
export { assertPersonalProjectCapacity, loadPersonalProjectCapacity };
|
|
30
|
+
export type { PersonalProjectCapacity };
|
|
31
|
+
//# sourceMappingURL=personal-project-limit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personal-project-limit.d.ts","sourceRoot":"","sources":["../../src/utils/personal-project-limit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C,KAAK,uBAAuB,GAAG;IAC3B,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAA;IACnB,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,iBAAe,2BAA2B,CACtC,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,QAAQ,GACnB,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAU9C;AAED;;;;GAIG;AACH,iBAAS,6BAA6B,CAClC,QAAQ,EAAE,uBAAuB,GAAG,SAAS,EAC7C,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,QAAQ,IAAI,uBAAuB,CAW7C;AAED,OAAO,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,CAAA;AACrE,YAAY,EAAE,uBAAuB,EAAE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const PRIORITY_VALUES: readonly ["p1", "p2", "p3", "p4"];
|
|
3
|
+
export type Priority = (typeof PRIORITY_VALUES)[number];
|
|
4
|
+
export declare const PRIORITY_INPUT_DESCRIPTION = "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.";
|
|
5
|
+
export declare const PrioritySchema: z.ZodEnum<{
|
|
6
|
+
p1: "p1";
|
|
7
|
+
p2: "p2";
|
|
8
|
+
p3: "p3";
|
|
9
|
+
p4: "p4";
|
|
10
|
+
}>;
|
|
11
|
+
export declare function convertPriorityToNumber(priority: Priority): number;
|
|
12
|
+
export declare function convertNumberToPriority(priority: number): Priority | undefined;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=priorities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priorities.d.ts","sourceRoot":"","sources":["../../src/utils/priorities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,QAAA,MAAM,eAAe,mCAAoC,CAAA;AACzD,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,eAAO,MAAM,0BAA0B,2JAC6G,CAAA;AAEpJ,eAAO,MAAM,cAAc;;;;;EAA+D,CAAA;AAE1F,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAIlE;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAI9E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TodoistApi } from '@doist/todoist-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve each reminder's `notifyUser` reference to a user ID.
|
|
4
|
+
*
|
|
5
|
+
* The result lines up with the input. Each entry is settled on its own, so a
|
|
6
|
+
* reference that cannot be resolved fails only the reminders that use it. A
|
|
7
|
+
* reminder with no reference resolves to `undefined`, which keeps Todoist's
|
|
8
|
+
* default of notifying its creator.
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveReminderRecipients(client: TodoistApi, notifyUsers: (string | undefined)[]): Promise<PromiseSettledResult<string | undefined>[]>;
|
|
11
|
+
/**
|
|
12
|
+
* Warn about every reminder that notifies someone other than the user it was
|
|
13
|
+
* meant for, which happens when Todoist does not apply the requested recipient.
|
|
14
|
+
* Without this, the tool would report success while the reminder silently
|
|
15
|
+
* reaches the wrong person.
|
|
16
|
+
*/
|
|
17
|
+
export declare function describeRecipientMismatches(reminders: {
|
|
18
|
+
id: string;
|
|
19
|
+
notifyUid?: string;
|
|
20
|
+
}[], requestedUserIds: (string | undefined)[]): string[];
|
|
21
|
+
//# sourceMappingURL=reminder-recipients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reminder-recipients.d.ts","sourceRoot":"","sources":["../../src/utils/reminder-recipients.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAIpD;;;;;;;GAOG;AACH,wBAAsB,yBAAyB,CAC3C,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GACpC,OAAO,CAAC,oBAAoB,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC,CA0BrD;AAMD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACvC,SAAS,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,EAC/C,gBAAgB,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GACzC,MAAM,EAAE,CAQV"}
|