@scardis/omnifocus-mcp 0.1.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/.claude/commands/opsx/apply.md +152 -0
- package/.claude/commands/opsx/archive.md +157 -0
- package/.claude/commands/opsx/bulk-archive.md +242 -0
- package/.claude/commands/opsx/continue.md +114 -0
- package/.claude/commands/opsx/explore.md +173 -0
- package/.claude/commands/opsx/ff.md +97 -0
- package/.claude/commands/opsx/new.md +69 -0
- package/.claude/commands/opsx/onboard.md +550 -0
- package/.claude/commands/opsx/propose.md +106 -0
- package/.claude/commands/opsx/sync.md +134 -0
- package/.claude/commands/opsx/verify.md +164 -0
- package/.claude/skills/openspec-apply-change/SKILL.md +156 -0
- package/.claude/skills/openspec-archive-change/SKILL.md +114 -0
- package/.claude/skills/openspec-bulk-archive-change/SKILL.md +246 -0
- package/.claude/skills/openspec-continue-change/SKILL.md +118 -0
- package/.claude/skills/openspec-explore/SKILL.md +288 -0
- package/.claude/skills/openspec-ff-change/SKILL.md +101 -0
- package/.claude/skills/openspec-new-change/SKILL.md +74 -0
- package/.claude/skills/openspec-onboard/SKILL.md +554 -0
- package/.claude/skills/openspec-propose/SKILL.md +110 -0
- package/.claude/skills/openspec-sync-specs/SKILL.md +138 -0
- package/.claude/skills/openspec-verify-change/SKILL.md +168 -0
- package/CONTRIBUTING.md +83 -0
- package/LICENSE +21 -0
- package/README.md +198 -0
- package/dist/runtime/bridge.d.ts +16 -0
- package/dist/runtime/bridge.d.ts.map +1 -0
- package/dist/runtime/bridge.js +76 -0
- package/dist/runtime/bridge.js.map +1 -0
- package/dist/runtime/index.d.ts +5 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +5 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/jxaShim.d.ts +21 -0
- package/dist/runtime/jxaShim.d.ts.map +1 -0
- package/dist/runtime/jxaShim.js +55 -0
- package/dist/runtime/jxaShim.js.map +1 -0
- package/dist/runtime/resultProtocol.d.ts +66 -0
- package/dist/runtime/resultProtocol.d.ts.map +1 -0
- package/dist/runtime/resultProtocol.js +52 -0
- package/dist/runtime/resultProtocol.js.map +1 -0
- package/dist/runtime/snippetLoader.d.ts +4 -0
- package/dist/runtime/snippetLoader.d.ts.map +1 -0
- package/dist/runtime/snippetLoader.js +68 -0
- package/dist/runtime/snippetLoader.js.map +1 -0
- package/dist/schemas/enums.d.ts +9 -0
- package/dist/schemas/enums.d.ts.map +1 -0
- package/dist/schemas/enums.js +26 -0
- package/dist/schemas/enums.js.map +1 -0
- package/dist/schemas/index.d.ts +3 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +3 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/shapes.d.ts +726 -0
- package/dist/schemas/shapes.d.ts.map +1 -0
- package/dist/schemas/shapes.js +221 -0
- package/dist/schemas/shapes.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +50 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/completeProject.d.ts +24 -0
- package/dist/tools/completeProject.d.ts.map +1 -0
- package/dist/tools/completeProject.js +17 -0
- package/dist/tools/completeProject.js.map +1 -0
- package/dist/tools/completeTask.d.ts +25 -0
- package/dist/tools/completeTask.d.ts.map +1 -0
- package/dist/tools/completeTask.js +17 -0
- package/dist/tools/completeTask.js.map +1 -0
- package/dist/tools/createFolder.d.ts +20 -0
- package/dist/tools/createFolder.d.ts.map +1 -0
- package/dist/tools/createFolder.js +13 -0
- package/dist/tools/createFolder.js.map +1 -0
- package/dist/tools/createProject.d.ts +59 -0
- package/dist/tools/createProject.d.ts.map +1 -0
- package/dist/tools/createProject.js +13 -0
- package/dist/tools/createProject.js.map +1 -0
- package/dist/tools/createTag.d.ts +20 -0
- package/dist/tools/createTag.d.ts.map +1 -0
- package/dist/tools/createTag.js +13 -0
- package/dist/tools/createTag.js.map +1 -0
- package/dist/tools/createTask.d.ts +116 -0
- package/dist/tools/createTask.d.ts.map +1 -0
- package/dist/tools/createTask.js +13 -0
- package/dist/tools/createTask.js.map +1 -0
- package/dist/tools/deleteFolder.d.ts +30 -0
- package/dist/tools/deleteFolder.d.ts.map +1 -0
- package/dist/tools/deleteFolder.js +18 -0
- package/dist/tools/deleteFolder.js.map +1 -0
- package/dist/tools/deleteProject.d.ts +30 -0
- package/dist/tools/deleteProject.d.ts.map +1 -0
- package/dist/tools/deleteProject.js +18 -0
- package/dist/tools/deleteProject.js.map +1 -0
- package/dist/tools/deleteTag.d.ts +30 -0
- package/dist/tools/deleteTag.d.ts.map +1 -0
- package/dist/tools/deleteTag.js +18 -0
- package/dist/tools/deleteTag.js.map +1 -0
- package/dist/tools/deleteTask.d.ts +31 -0
- package/dist/tools/deleteTask.d.ts.map +1 -0
- package/dist/tools/deleteTask.js +18 -0
- package/dist/tools/deleteTask.js.map +1 -0
- package/dist/tools/dropProject.d.ts +24 -0
- package/dist/tools/dropProject.d.ts.map +1 -0
- package/dist/tools/dropProject.js +17 -0
- package/dist/tools/dropProject.js.map +1 -0
- package/dist/tools/dropTask.d.ts +25 -0
- package/dist/tools/dropTask.d.ts.map +1 -0
- package/dist/tools/dropTask.js +17 -0
- package/dist/tools/dropTask.js.map +1 -0
- package/dist/tools/editFolder.d.ts +20 -0
- package/dist/tools/editFolder.d.ts.map +1 -0
- package/dist/tools/editFolder.js +13 -0
- package/dist/tools/editFolder.js.map +1 -0
- package/dist/tools/editProject.d.ts +59 -0
- package/dist/tools/editProject.d.ts.map +1 -0
- package/dist/tools/editProject.js +13 -0
- package/dist/tools/editProject.js.map +1 -0
- package/dist/tools/editTag.d.ts +31 -0
- package/dist/tools/editTag.d.ts.map +1 -0
- package/dist/tools/editTag.js +13 -0
- package/dist/tools/editTag.js.map +1 -0
- package/dist/tools/editTask.d.ts +79 -0
- package/dist/tools/editTask.d.ts.map +1 -0
- package/dist/tools/editTask.js +13 -0
- package/dist/tools/editTask.js.map +1 -0
- package/dist/tools/getFolder.d.ts +24 -0
- package/dist/tools/getFolder.d.ts.map +1 -0
- package/dist/tools/getFolder.js +17 -0
- package/dist/tools/getFolder.js.map +1 -0
- package/dist/tools/getProject.d.ts +24 -0
- package/dist/tools/getProject.d.ts.map +1 -0
- package/dist/tools/getProject.js +17 -0
- package/dist/tools/getProject.js.map +1 -0
- package/dist/tools/getTag.d.ts +24 -0
- package/dist/tools/getTag.d.ts.map +1 -0
- package/dist/tools/getTag.js +17 -0
- package/dist/tools/getTag.js.map +1 -0
- package/dist/tools/getTask.d.ts +24 -0
- package/dist/tools/getTask.d.ts.map +1 -0
- package/dist/tools/getTask.js +17 -0
- package/dist/tools/getTask.js.map +1 -0
- package/dist/tools/index.d.ts +732 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +84 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/listFolders.d.ts +50 -0
- package/dist/tools/listFolders.d.ts.map +1 -0
- package/dist/tools/listFolders.js +21 -0
- package/dist/tools/listFolders.js.map +1 -0
- package/dist/tools/listProjects.d.ts +70 -0
- package/dist/tools/listProjects.d.ts.map +1 -0
- package/dist/tools/listProjects.js +21 -0
- package/dist/tools/listProjects.js.map +1 -0
- package/dist/tools/listTags.d.ts +50 -0
- package/dist/tools/listTags.d.ts.map +1 -0
- package/dist/tools/listTags.js +21 -0
- package/dist/tools/listTags.js.map +1 -0
- package/dist/tools/listTasks.d.ts +156 -0
- package/dist/tools/listTasks.d.ts.map +1 -0
- package/dist/tools/listTasks.js +36 -0
- package/dist/tools/listTasks.js.map +1 -0
- package/dist/tools/moveProject.d.ts +20 -0
- package/dist/tools/moveProject.d.ts.map +1 -0
- package/dist/tools/moveProject.js +13 -0
- package/dist/tools/moveProject.js.map +1 -0
- package/dist/tools/moveTask.d.ts +31 -0
- package/dist/tools/moveTask.d.ts.map +1 -0
- package/dist/tools/moveTask.js +13 -0
- package/dist/tools/moveTask.js.map +1 -0
- package/dist/tools/resolveName.d.ts +36 -0
- package/dist/tools/resolveName.d.ts.map +1 -0
- package/dist/tools/resolveName.js +26 -0
- package/dist/tools/resolveName.js.map +1 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/design.md +162 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/proposal.md +49 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/specs/attachments/spec.md +9 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/specs/batch-operations/spec.md +9 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/specs/database-inspection/spec.md +9 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/specs/execution-runtime/spec.md +69 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/specs/folder-management/spec.md +25 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/specs/forecast/spec.md +9 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/specs/identity-resolution/spec.md +45 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/specs/perspective-management/spec.md +9 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/specs/project-management/spec.md +25 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/specs/recurrence/spec.md +9 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/specs/settings/spec.md +9 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/specs/tag-management/spec.md +25 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/specs/task-management/spec.md +29 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/specs/url-automation/spec.md +9 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/specs/window-state/spec.md +9 -0
- package/openspec/changes/archive/2026-04-09-bootstrap-omnifocus-mcp/tasks.md +84 -0
- package/openspec/changes/archive/2026-04-09-folder-crud/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-09-folder-crud/design.md +58 -0
- package/openspec/changes/archive/2026-04-09-folder-crud/proposal.md +28 -0
- package/openspec/changes/archive/2026-04-09-folder-crud/specs/folder-write/spec.md +45 -0
- package/openspec/changes/archive/2026-04-09-folder-crud/tasks.md +41 -0
- package/openspec/changes/archive/2026-04-09-folder-tag-list-filtering/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-09-folder-tag-list-filtering/design.md +38 -0
- package/openspec/changes/archive/2026-04-09-folder-tag-list-filtering/proposal.md +30 -0
- package/openspec/changes/archive/2026-04-09-folder-tag-list-filtering/specs/folder-management/spec.md +21 -0
- package/openspec/changes/archive/2026-04-09-folder-tag-list-filtering/specs/tag-management/spec.md +21 -0
- package/openspec/changes/archive/2026-04-09-folder-tag-list-filtering/tasks.md +35 -0
- package/openspec/changes/archive/2026-04-09-move-operations/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-09-move-operations/design.md +43 -0
- package/openspec/changes/archive/2026-04-09-move-operations/proposal.md +25 -0
- package/openspec/changes/archive/2026-04-09-move-operations/specs/move-operations/spec.md +41 -0
- package/openspec/changes/archive/2026-04-09-move-operations/tasks.md +40 -0
- package/openspec/changes/archive/2026-04-09-project-crud/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-09-project-crud/design.md +60 -0
- package/openspec/changes/archive/2026-04-09-project-crud/proposal.md +29 -0
- package/openspec/changes/archive/2026-04-09-project-crud/specs/project-write/spec.md +74 -0
- package/openspec/changes/archive/2026-04-09-project-crud/tasks.md +48 -0
- package/openspec/changes/archive/2026-04-09-project-filtering/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-09-project-filtering/design.md +52 -0
- package/openspec/changes/archive/2026-04-09-project-filtering/proposal.md +26 -0
- package/openspec/changes/archive/2026-04-09-project-filtering/specs/project-filtering/spec.md +66 -0
- package/openspec/changes/archive/2026-04-09-project-filtering/specs/project-management/spec.md +13 -0
- package/openspec/changes/archive/2026-04-09-project-filtering/tasks.md +41 -0
- package/openspec/changes/archive/2026-04-09-tag-crud/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-09-tag-crud/design.md +45 -0
- package/openspec/changes/archive/2026-04-09-tag-crud/proposal.md +28 -0
- package/openspec/changes/archive/2026-04-09-tag-crud/specs/tag-write/spec.md +49 -0
- package/openspec/changes/archive/2026-04-09-tag-crud/tasks.md +41 -0
- package/openspec/changes/archive/2026-04-09-task-crud/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-09-task-crud/design.md +62 -0
- package/openspec/changes/archive/2026-04-09-task-crud/proposal.md +29 -0
- package/openspec/changes/archive/2026-04-09-task-crud/specs/task-management/spec.md +17 -0
- package/openspec/changes/archive/2026-04-09-task-crud/specs/task-write/spec.md +89 -0
- package/openspec/changes/archive/2026-04-09-task-crud/tasks.md +55 -0
- package/openspec/changes/archive/2026-04-09-task-filtering/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-09-task-filtering/design.md +61 -0
- package/openspec/changes/archive/2026-04-09-task-filtering/proposal.md +26 -0
- package/openspec/changes/archive/2026-04-09-task-filtering/specs/task-filtering/spec.md +63 -0
- package/openspec/changes/archive/2026-04-09-task-filtering/specs/task-management/spec.md +17 -0
- package/openspec/changes/archive/2026-04-09-task-filtering/tasks.md +42 -0
- package/openspec/changes/archive/2026-04-10-planned-date/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-10-planned-date/design.md +27 -0
- package/openspec/changes/archive/2026-04-10-planned-date/proposal.md +29 -0
- package/openspec/changes/archive/2026-04-10-planned-date/specs/task-management/spec.md +29 -0
- package/openspec/changes/archive/2026-04-10-planned-date/specs/task-write/spec.md +69 -0
- package/openspec/changes/archive/2026-04-10-planned-date/tasks.md +26 -0
- package/openspec/changes/archive/2026-04-10-task-recurrence/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-10-task-recurrence/design.md +81 -0
- package/openspec/changes/archive/2026-04-10-task-recurrence/proposal.md +28 -0
- package/openspec/changes/archive/2026-04-10-task-recurrence/specs/recurrence/spec.md +47 -0
- package/openspec/changes/archive/2026-04-10-task-recurrence/specs/task-management/spec.md +25 -0
- package/openspec/changes/archive/2026-04-10-task-recurrence/specs/task-write/spec.md +61 -0
- package/openspec/changes/archive/2026-04-10-task-recurrence/tasks.md +39 -0
- package/openspec/config.yaml +20 -0
- package/openspec/specs/attachments/spec.md +15 -0
- package/openspec/specs/batch-operations/spec.md +15 -0
- package/openspec/specs/database-inspection/spec.md +15 -0
- package/openspec/specs/execution-runtime/spec.md +75 -0
- package/openspec/specs/folder-management/spec.md +39 -0
- package/openspec/specs/folder-write/spec.md +45 -0
- package/openspec/specs/forecast/spec.md +15 -0
- package/openspec/specs/identity-resolution/spec.md +51 -0
- package/openspec/specs/move-operations/spec.md +41 -0
- package/openspec/specs/perspective-management/spec.md +15 -0
- package/openspec/specs/project-filtering/spec.md +72 -0
- package/openspec/specs/project-management/spec.md +31 -0
- package/openspec/specs/project-write/spec.md +79 -0
- package/openspec/specs/recurrence/spec.md +51 -0
- package/openspec/specs/settings/spec.md +15 -0
- package/openspec/specs/tag-management/spec.md +39 -0
- package/openspec/specs/tag-write/spec.md +49 -0
- package/openspec/specs/task-filtering/spec.md +63 -0
- package/openspec/specs/task-management/spec.md +51 -0
- package/openspec/specs/task-write/spec.md +115 -0
- package/openspec/specs/url-automation/spec.md +15 -0
- package/openspec/specs/window-state/spec.md +15 -0
- package/package.json +32 -0
- package/scripts/cleanup-fixtures.ts +89 -0
- package/server.json +21 -0
- package/src/runtime/bridge.ts +97 -0
- package/src/runtime/index.ts +4 -0
- package/src/runtime/jxaShim.ts +55 -0
- package/src/runtime/resultProtocol.ts +62 -0
- package/src/runtime/snippetLoader.ts +79 -0
- package/src/schemas/enums.ts +32 -0
- package/src/schemas/index.ts +38 -0
- package/src/schemas/shapes.ts +267 -0
- package/src/server.ts +58 -0
- package/src/snippets/complete_project.js +73 -0
- package/src/snippets/complete_task.js +85 -0
- package/src/snippets/create_folder.js +52 -0
- package/src/snippets/create_project.js +107 -0
- package/src/snippets/create_tag.js +55 -0
- package/src/snippets/create_task.js +159 -0
- package/src/snippets/delete_folder.js +26 -0
- package/src/snippets/delete_project.js +20 -0
- package/src/snippets/delete_tag.js +20 -0
- package/src/snippets/delete_task.js +20 -0
- package/src/snippets/drop_project.js +73 -0
- package/src/snippets/drop_task.js +85 -0
- package/src/snippets/edit_folder.js +46 -0
- package/src/snippets/edit_project.js +106 -0
- package/src/snippets/edit_tag.js +56 -0
- package/src/snippets/edit_task.js +146 -0
- package/src/snippets/get_folder.js +48 -0
- package/src/snippets/get_project.js +77 -0
- package/src/snippets/get_tag.js +51 -0
- package/src/snippets/get_task.js +96 -0
- package/src/snippets/list_folders.js +50 -0
- package/src/snippets/list_projects.js +98 -0
- package/src/snippets/list_tags.js +54 -0
- package/src/snippets/list_tasks.js +127 -0
- package/src/snippets/move_project.js +79 -0
- package/src/snippets/move_task.js +113 -0
- package/src/snippets/resolve_name.js +83 -0
- package/src/tools/completeProject.ts +21 -0
- package/src/tools/completeTask.ts +23 -0
- package/src/tools/createFolder.ts +20 -0
- package/src/tools/createProject.ts +20 -0
- package/src/tools/createTag.ts +20 -0
- package/src/tools/createTask.ts +20 -0
- package/src/tools/deleteFolder.ts +24 -0
- package/src/tools/deleteProject.ts +24 -0
- package/src/tools/deleteTag.ts +24 -0
- package/src/tools/deleteTask.ts +26 -0
- package/src/tools/dropProject.ts +21 -0
- package/src/tools/dropTask.ts +23 -0
- package/src/tools/editFolder.ts +19 -0
- package/src/tools/editProject.ts +20 -0
- package/src/tools/editTag.ts +20 -0
- package/src/tools/editTask.ts +20 -0
- package/src/tools/getFolder.ts +24 -0
- package/src/tools/getProject.ts +24 -0
- package/src/tools/getTag.ts +24 -0
- package/src/tools/getTask.ts +24 -0
- package/src/tools/index.ts +85 -0
- package/src/tools/listFolders.ts +32 -0
- package/src/tools/listProjects.ts +32 -0
- package/src/tools/listTags.ts +32 -0
- package/src/tools/listTasks.ts +56 -0
- package/src/tools/moveProject.ts +20 -0
- package/src/tools/moveTask.ts +20 -0
- package/src/tools/resolveName.ts +37 -0
- package/test/integration/.gitkeep +0 -0
- package/test/integration/completeProject.int.test.ts +25 -0
- package/test/integration/completeTask.int.test.ts +30 -0
- package/test/integration/createFolder.int.test.ts +50 -0
- package/test/integration/createProject.int.test.ts +49 -0
- package/test/integration/createTag.int.test.ts +52 -0
- package/test/integration/createTask.int.test.ts +55 -0
- package/test/integration/deleteFolder.int.test.ts +64 -0
- package/test/integration/deleteProject.int.test.ts +31 -0
- package/test/integration/deleteTag.int.test.ts +61 -0
- package/test/integration/deleteTask.int.test.ts +36 -0
- package/test/integration/dropProject.int.test.ts +24 -0
- package/test/integration/dropTask.int.test.ts +29 -0
- package/test/integration/editFolder.int.test.ts +43 -0
- package/test/integration/editProject.int.test.ts +39 -0
- package/test/integration/editTag.int.test.ts +43 -0
- package/test/integration/editTask.int.test.ts +56 -0
- package/test/integration/fixtures.ts +219 -0
- package/test/integration/getTask.int.test.ts +64 -0
- package/test/integration/listFoldersFiltered.int.test.ts +98 -0
- package/test/integration/listProjects.int.test.ts +73 -0
- package/test/integration/listProjectsFiltered.int.test.ts +96 -0
- package/test/integration/listTagsFiltered.int.test.ts +54 -0
- package/test/integration/listTasksFiltered.int.test.ts +141 -0
- package/test/integration/moveProject.int.test.ts +57 -0
- package/test/integration/moveTask.int.test.ts +61 -0
- package/test/integration/plannedDate.int.test.ts +72 -0
- package/test/integration/preflight.ts +60 -0
- package/test/integration/resolveName.int.test.ts +86 -0
- package/test/integration/taskRecurrence.int.test.ts +106 -0
- package/test/unit/.gitkeep +0 -0
- package/test/unit/bridge.injection.test.ts +66 -0
- package/test/unit/resultProtocol.test.ts +71 -0
- package/test/unit/schemas.createFolder.test.ts +38 -0
- package/test/unit/schemas.createProject.test.ts +115 -0
- package/test/unit/schemas.createTask.test.ts +87 -0
- package/test/unit/schemas.editTag.test.ts +64 -0
- package/test/unit/schemas.folderTagFiltering.test.ts +42 -0
- package/test/unit/schemas.listProjects.test.ts +44 -0
- package/test/unit/schemas.moveOperations.test.ts +60 -0
- package/test/unit/schemas.recurrence.test.ts +120 -0
- package/test/unit/schemas.test.ts +126 -0
- package/test/unit/snippetLoader.test.ts +56 -0
- package/test/unit/tools.deleteTask.test.ts +19 -0
- package/test/unit/tools.listTasks.test.ts +126 -0
- package/tsconfig.json +19 -0
- package/vitest.config.ts +8 -0
- package/vitest.integration.config.ts +18 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { parseResultLine, ExecutionError } from "../../src/runtime/resultProtocol.js";
|
|
3
|
+
|
|
4
|
+
describe("parseResultLine", () => {
|
|
5
|
+
it("parses a well-formed success envelope", () => {
|
|
6
|
+
const stdout = JSON.stringify({ ok: true, data: { id: "abc" } });
|
|
7
|
+
const result = parseResultLine(stdout);
|
|
8
|
+
expect(result.ok).toBe(true);
|
|
9
|
+
if (result.ok) {
|
|
10
|
+
expect(result.data).toEqual({ id: "abc" });
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("parses a well-formed error envelope", () => {
|
|
15
|
+
const stdout = JSON.stringify({
|
|
16
|
+
ok: false,
|
|
17
|
+
error: { name: "NotFoundError", message: "Not found", stack: "..." },
|
|
18
|
+
});
|
|
19
|
+
const result = parseResultLine(stdout);
|
|
20
|
+
expect(result.ok).toBe(false);
|
|
21
|
+
if (!result.ok) {
|
|
22
|
+
expect(result.error.name).toBe("NotFoundError");
|
|
23
|
+
expect(result.error.message).toBe("Not found");
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("selects first parseable JSON line when preceded by chatter", () => {
|
|
28
|
+
const stdout =
|
|
29
|
+
"osascript warning: something\nnot json at all\n" +
|
|
30
|
+
JSON.stringify({ ok: true, data: [1, 2, 3] }) +
|
|
31
|
+
"\n";
|
|
32
|
+
const result = parseResultLine(stdout);
|
|
33
|
+
expect(result.ok).toBe(true);
|
|
34
|
+
if (result.ok) {
|
|
35
|
+
expect(result.data).toEqual([1, 2, 3]);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("throws on empty stdout", () => {
|
|
40
|
+
expect(() => parseResultLine("")).toThrow(/No valid JSON result envelope/);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("throws on non-envelope JSON", () => {
|
|
44
|
+
expect(() => parseResultLine('{"foo":"bar"}')).toThrow(/not a valid result envelope/);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("throws on malformed-only stdout with no parseable lines", () => {
|
|
48
|
+
expect(() => parseResultLine("not json\nalso not json\n")).toThrow(
|
|
49
|
+
/No valid JSON result envelope/
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
describe("ExecutionError", () => {
|
|
55
|
+
it("carries name, message, and stack from the error detail", () => {
|
|
56
|
+
const err = new ExecutionError({
|
|
57
|
+
name: "TypeError",
|
|
58
|
+
message: "cannot read property",
|
|
59
|
+
stack: "TypeError: cannot...\n at line 1",
|
|
60
|
+
});
|
|
61
|
+
expect(err.message).toBe("cannot read property");
|
|
62
|
+
expect(err.errorName).toBe("TypeError");
|
|
63
|
+
expect(err.remoteStack).toContain("TypeError:");
|
|
64
|
+
expect(err.name).toBe("ExecutionError");
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("works without a stack field", () => {
|
|
68
|
+
const err = new ExecutionError({ name: "Error", message: "boom" });
|
|
69
|
+
expect(err.remoteStack).toBeUndefined();
|
|
70
|
+
});
|
|
71
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { CreateFolderInput, EditFolderInput } from "../../src/schemas/index.js";
|
|
3
|
+
|
|
4
|
+
describe("CreateFolderInput schema", () => {
|
|
5
|
+
it("accepts name only (top-level)", () => {
|
|
6
|
+
expect(() => CreateFolderInput.parse({ name: "My Folder" })).not.toThrow();
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it("accepts name with parentFolderId", () => {
|
|
10
|
+
expect(() =>
|
|
11
|
+
CreateFolderInput.parse({ name: "Nested", parentFolderId: "abc123" })
|
|
12
|
+
).not.toThrow();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("rejects missing name", () => {
|
|
16
|
+
expect(() => CreateFolderInput.parse({})).toThrow();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("rejects empty name", () => {
|
|
20
|
+
expect(() => CreateFolderInput.parse({ name: "" })).toThrow();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
describe("EditFolderInput schema", () => {
|
|
25
|
+
it("accepts id and name", () => {
|
|
26
|
+
expect(() =>
|
|
27
|
+
EditFolderInput.parse({ id: "abc123", name: "Renamed" })
|
|
28
|
+
).not.toThrow();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("rejects missing id", () => {
|
|
32
|
+
expect(() => EditFolderInput.parse({ name: "Renamed" })).toThrow();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("rejects empty name", () => {
|
|
36
|
+
expect(() => EditFolderInput.parse({ id: "abc123", name: "" })).toThrow();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { CreateProjectInput, EditProjectInput, ReviewIntervalInput } from "../../src/schemas/index.js";
|
|
3
|
+
|
|
4
|
+
describe("ReviewIntervalInput schema", () => {
|
|
5
|
+
it("accepts valid steps and unit", () => {
|
|
6
|
+
expect(() =>
|
|
7
|
+
ReviewIntervalInput.parse({ steps: 2, unit: "weeks" })
|
|
8
|
+
).not.toThrow();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it("rejects invalid unit", () => {
|
|
12
|
+
expect(() =>
|
|
13
|
+
ReviewIntervalInput.parse({ steps: 2, unit: "fortnights" })
|
|
14
|
+
).toThrow();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("rejects non-positive steps", () => {
|
|
18
|
+
expect(() =>
|
|
19
|
+
ReviewIntervalInput.parse({ steps: 0, unit: "weeks" })
|
|
20
|
+
).toThrow();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
describe("CreateProjectInput schema", () => {
|
|
25
|
+
it("accepts name only (top-level)", () => {
|
|
26
|
+
expect(() => CreateProjectInput.parse({ name: "My Project" })).not.toThrow();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("accepts name with folderId", () => {
|
|
30
|
+
expect(() =>
|
|
31
|
+
CreateProjectInput.parse({ name: "My Project", folderId: "abc123" })
|
|
32
|
+
).not.toThrow();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("accepts valid type enum values", () => {
|
|
36
|
+
for (const type of ["parallel", "sequential", "singleActions"] as const) {
|
|
37
|
+
expect(() =>
|
|
38
|
+
CreateProjectInput.parse({ name: "P", type })
|
|
39
|
+
).not.toThrow();
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("rejects invalid type", () => {
|
|
44
|
+
expect(() =>
|
|
45
|
+
CreateProjectInput.parse({ name: "P", type: "waterfall" })
|
|
46
|
+
).toThrow();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("accepts valid status values", () => {
|
|
50
|
+
for (const status of ["active", "onHold"] as const) {
|
|
51
|
+
expect(() =>
|
|
52
|
+
CreateProjectInput.parse({ name: "P", status })
|
|
53
|
+
).not.toThrow();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("accepts reviewInterval", () => {
|
|
58
|
+
expect(() =>
|
|
59
|
+
CreateProjectInput.parse({
|
|
60
|
+
name: "P",
|
|
61
|
+
reviewInterval: { steps: 1, unit: "months" },
|
|
62
|
+
})
|
|
63
|
+
).not.toThrow();
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("rejects missing name", () => {
|
|
67
|
+
expect(() => CreateProjectInput.parse({})).toThrow();
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("rejects empty name", () => {
|
|
71
|
+
expect(() => CreateProjectInput.parse({ name: "" })).toThrow();
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
describe("EditProjectInput schema", () => {
|
|
76
|
+
it("accepts id with a single field", () => {
|
|
77
|
+
expect(() =>
|
|
78
|
+
EditProjectInput.parse({ id: "abc123", status: "onHold" })
|
|
79
|
+
).not.toThrow();
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it("accepts null deferDate to clear the field", () => {
|
|
83
|
+
expect(() =>
|
|
84
|
+
EditProjectInput.parse({ id: "abc123", deferDate: null })
|
|
85
|
+
).not.toThrow();
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("accepts null dueDate", () => {
|
|
89
|
+
expect(() =>
|
|
90
|
+
EditProjectInput.parse({ id: "abc123", dueDate: null })
|
|
91
|
+
).not.toThrow();
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("accepts structured reviewInterval", () => {
|
|
95
|
+
expect(() =>
|
|
96
|
+
EditProjectInput.parse({
|
|
97
|
+
id: "abc123",
|
|
98
|
+
reviewInterval: { steps: 2, unit: "weeks" },
|
|
99
|
+
})
|
|
100
|
+
).not.toThrow();
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("rejects invalid reviewInterval unit", () => {
|
|
104
|
+
expect(() =>
|
|
105
|
+
EditProjectInput.parse({
|
|
106
|
+
id: "abc123",
|
|
107
|
+
reviewInterval: { steps: 2, unit: "fortnights" },
|
|
108
|
+
})
|
|
109
|
+
).toThrow();
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it("rejects missing id", () => {
|
|
113
|
+
expect(() => EditProjectInput.parse({ name: "Updated" })).toThrow();
|
|
114
|
+
});
|
|
115
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { CreateTaskInput, EditTaskInput } from "../../src/schemas/index.js";
|
|
3
|
+
|
|
4
|
+
describe("CreateTaskInput schema", () => {
|
|
5
|
+
it("accepts name only (inbox placement)", () => {
|
|
6
|
+
expect(() => CreateTaskInput.parse({ name: "Buy milk" })).not.toThrow();
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it("accepts name with projectId", () => {
|
|
10
|
+
expect(() =>
|
|
11
|
+
CreateTaskInput.parse({ name: "Write tests", projectId: "abc123" })
|
|
12
|
+
).not.toThrow();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("accepts name with parentTaskId", () => {
|
|
16
|
+
expect(() =>
|
|
17
|
+
CreateTaskInput.parse({ name: "Review PR", parentTaskId: "xyz789" })
|
|
18
|
+
).not.toThrow();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("accepts all optional fields", () => {
|
|
22
|
+
expect(() =>
|
|
23
|
+
CreateTaskInput.parse({
|
|
24
|
+
name: "Full task",
|
|
25
|
+
note: "some note",
|
|
26
|
+
flagged: true,
|
|
27
|
+
deferDate: "2026-04-10T00:00:00.000Z",
|
|
28
|
+
dueDate: "2026-04-15T00:00:00.000Z",
|
|
29
|
+
estimatedMinutes: 30,
|
|
30
|
+
projectId: "proj1",
|
|
31
|
+
tagIds: ["tag1", "tag2"],
|
|
32
|
+
})
|
|
33
|
+
).not.toThrow();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("rejects both projectId and parentTaskId", () => {
|
|
37
|
+
expect(() =>
|
|
38
|
+
CreateTaskInput.parse({
|
|
39
|
+
name: "Ambiguous",
|
|
40
|
+
projectId: "proj1",
|
|
41
|
+
parentTaskId: "task1",
|
|
42
|
+
})
|
|
43
|
+
).toThrow();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("rejects missing name", () => {
|
|
47
|
+
expect(() => CreateTaskInput.parse({})).toThrow();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("rejects empty name", () => {
|
|
51
|
+
expect(() => CreateTaskInput.parse({ name: "" })).toThrow();
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
describe("EditTaskInput schema", () => {
|
|
56
|
+
it("accepts id with a single field", () => {
|
|
57
|
+
expect(() =>
|
|
58
|
+
EditTaskInput.parse({ id: "abc123", flagged: true })
|
|
59
|
+
).not.toThrow();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("accepts null deferDate to clear the field", () => {
|
|
63
|
+
expect(() =>
|
|
64
|
+
EditTaskInput.parse({ id: "abc123", deferDate: null })
|
|
65
|
+
).not.toThrow();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("accepts null dueDate", () => {
|
|
69
|
+
expect(() =>
|
|
70
|
+
EditTaskInput.parse({ id: "abc123", dueDate: null })
|
|
71
|
+
).not.toThrow();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("accepts null estimatedMinutes", () => {
|
|
75
|
+
expect(() =>
|
|
76
|
+
EditTaskInput.parse({ id: "abc123", estimatedMinutes: null })
|
|
77
|
+
).not.toThrow();
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it("rejects missing id", () => {
|
|
81
|
+
expect(() => EditTaskInput.parse({ name: "Updated" })).toThrow();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("rejects empty id", () => {
|
|
85
|
+
expect(() => EditTaskInput.parse({ id: "", name: "Updated" })).toThrow();
|
|
86
|
+
});
|
|
87
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { CreateTagInput, EditTagInput } from "../../src/schemas/index.js";
|
|
3
|
+
|
|
4
|
+
describe("CreateTagInput schema", () => {
|
|
5
|
+
it("accepts name only (top-level)", () => {
|
|
6
|
+
expect(() => CreateTagInput.parse({ name: "Waiting" })).not.toThrow();
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it("accepts name with parentTagId", () => {
|
|
10
|
+
expect(() =>
|
|
11
|
+
CreateTagInput.parse({ name: "Email", parentTagId: "abc123" })
|
|
12
|
+
).not.toThrow();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("rejects missing name", () => {
|
|
16
|
+
expect(() => CreateTagInput.parse({})).toThrow();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("rejects empty name", () => {
|
|
20
|
+
expect(() => CreateTagInput.parse({ name: "" })).toThrow();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
describe("EditTagInput schema", () => {
|
|
25
|
+
it("accepts id with name only", () => {
|
|
26
|
+
expect(() =>
|
|
27
|
+
EditTagInput.parse({ id: "abc123", name: "Renamed" })
|
|
28
|
+
).not.toThrow();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("accepts id with status only", () => {
|
|
32
|
+
expect(() =>
|
|
33
|
+
EditTagInput.parse({ id: "abc123", status: "onHold" })
|
|
34
|
+
).not.toThrow();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("accepts id with both name and status", () => {
|
|
38
|
+
expect(() =>
|
|
39
|
+
EditTagInput.parse({ id: "abc123", name: "New", status: "active" })
|
|
40
|
+
).not.toThrow();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("accepts all valid status values", () => {
|
|
44
|
+
for (const status of ["active", "onHold", "dropped"] as const) {
|
|
45
|
+
expect(() =>
|
|
46
|
+
EditTagInput.parse({ id: "abc123", status })
|
|
47
|
+
).not.toThrow();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("rejects neither name nor status (refine)", () => {
|
|
52
|
+
expect(() => EditTagInput.parse({ id: "abc123" })).toThrow();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("rejects invalid status enum", () => {
|
|
56
|
+
expect(() =>
|
|
57
|
+
EditTagInput.parse({ id: "abc123", status: "paused" })
|
|
58
|
+
).toThrow();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("rejects missing id", () => {
|
|
62
|
+
expect(() => EditTagInput.parse({ name: "X" })).toThrow();
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { ListFoldersFilter, ListTagsFilter } from "../../src/schemas/index.js";
|
|
3
|
+
|
|
4
|
+
describe("ListFoldersFilter schema", () => {
|
|
5
|
+
it("accepts empty filter object", () => {
|
|
6
|
+
expect(() => ListFoldersFilter.parse({})).not.toThrow();
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it("accepts status 'active'", () => {
|
|
10
|
+
expect(() => ListFoldersFilter.parse({ status: "active" })).not.toThrow();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("accepts status 'dropped'", () => {
|
|
14
|
+
expect(() => ListFoldersFilter.parse({ status: "dropped" })).not.toThrow();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("rejects invalid status value", () => {
|
|
18
|
+
expect(() => ListFoldersFilter.parse({ status: "pending" })).toThrow();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe("ListTagsFilter schema", () => {
|
|
23
|
+
it("accepts empty filter object", () => {
|
|
24
|
+
expect(() => ListTagsFilter.parse({})).not.toThrow();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("accepts status 'active'", () => {
|
|
28
|
+
expect(() => ListTagsFilter.parse({ status: "active" })).not.toThrow();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("accepts status 'onHold'", () => {
|
|
32
|
+
expect(() => ListTagsFilter.parse({ status: "onHold" })).not.toThrow();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("accepts status 'dropped'", () => {
|
|
36
|
+
expect(() => ListTagsFilter.parse({ status: "dropped" })).not.toThrow();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("rejects invalid status value", () => {
|
|
40
|
+
expect(() => ListTagsFilter.parse({ status: "unknown" })).toThrow();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { ListProjectsFilter } from "../../src/schemas/index.js";
|
|
3
|
+
|
|
4
|
+
describe("ListProjectsFilter schema", () => {
|
|
5
|
+
it("accepts empty filter object", () => {
|
|
6
|
+
expect(() => ListProjectsFilter.parse({})).not.toThrow();
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it("accepts status array", () => {
|
|
10
|
+
expect(() =>
|
|
11
|
+
ListProjectsFilter.parse({ status: ["active", "onHold"] })
|
|
12
|
+
).not.toThrow();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("accepts folderId", () => {
|
|
16
|
+
expect(() =>
|
|
17
|
+
ListProjectsFilter.parse({ folderId: "folder123" })
|
|
18
|
+
).not.toThrow();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("accepts flagged: true", () => {
|
|
22
|
+
expect(() =>
|
|
23
|
+
ListProjectsFilter.parse({ flagged: true })
|
|
24
|
+
).not.toThrow();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("accepts all fields together", () => {
|
|
28
|
+
expect(() =>
|
|
29
|
+
ListProjectsFilter.parse({ status: ["active"], folderId: "f1", flagged: true })
|
|
30
|
+
).not.toThrow();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("rejects invalid status enum in array", () => {
|
|
34
|
+
expect(() =>
|
|
35
|
+
ListProjectsFilter.parse({ status: ["active", "flying"] })
|
|
36
|
+
).toThrow();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("rejects flagged: false (must be literal true or absent)", () => {
|
|
40
|
+
expect(() =>
|
|
41
|
+
ListProjectsFilter.parse({ flagged: false })
|
|
42
|
+
).toThrow();
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { MoveTaskInput, MoveProjectInput } from "../../src/schemas/index.js";
|
|
3
|
+
|
|
4
|
+
describe("MoveTaskInput schema", () => {
|
|
5
|
+
it("accepts projectId only", () => {
|
|
6
|
+
expect(() =>
|
|
7
|
+
MoveTaskInput.parse({ id: "t1", projectId: "p1" })
|
|
8
|
+
).not.toThrow();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it("accepts parentTaskId only", () => {
|
|
12
|
+
expect(() =>
|
|
13
|
+
MoveTaskInput.parse({ id: "t1", parentTaskId: "t2" })
|
|
14
|
+
).not.toThrow();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("rejects both projectId and parentTaskId", () => {
|
|
18
|
+
expect(() =>
|
|
19
|
+
MoveTaskInput.parse({ id: "t1", projectId: "p1", parentTaskId: "t2" })
|
|
20
|
+
).toThrow();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("rejects neither projectId nor parentTaskId", () => {
|
|
24
|
+
expect(() =>
|
|
25
|
+
MoveTaskInput.parse({ id: "t1" })
|
|
26
|
+
).toThrow();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("rejects missing id", () => {
|
|
30
|
+
expect(() =>
|
|
31
|
+
MoveTaskInput.parse({ projectId: "p1" })
|
|
32
|
+
).toThrow();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe("MoveProjectInput schema", () => {
|
|
37
|
+
it("accepts folderId as string", () => {
|
|
38
|
+
expect(() =>
|
|
39
|
+
MoveProjectInput.parse({ id: "p1", folderId: "f1" })
|
|
40
|
+
).not.toThrow();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("accepts folderId as null", () => {
|
|
44
|
+
expect(() =>
|
|
45
|
+
MoveProjectInput.parse({ id: "p1", folderId: null })
|
|
46
|
+
).not.toThrow();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("rejects missing id", () => {
|
|
50
|
+
expect(() =>
|
|
51
|
+
MoveProjectInput.parse({ folderId: "f1" })
|
|
52
|
+
).toThrow();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("rejects missing folderId (undefined not same as null)", () => {
|
|
56
|
+
expect(() =>
|
|
57
|
+
MoveProjectInput.parse({ id: "p1" })
|
|
58
|
+
).toThrow();
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { RepetitionRuleInput, CreateTaskInput, EditTaskInput } from "../../src/schemas/index.js";
|
|
3
|
+
|
|
4
|
+
describe("RepetitionRuleInput schema", () => {
|
|
5
|
+
it("accepts daily repetition", () => {
|
|
6
|
+
expect(() =>
|
|
7
|
+
RepetitionRuleInput.parse({ frequency: "daily", interval: 1, method: "fixed" })
|
|
8
|
+
).not.toThrow();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it("accepts weekly repetition with daysOfWeek", () => {
|
|
12
|
+
expect(() =>
|
|
13
|
+
RepetitionRuleInput.parse({
|
|
14
|
+
frequency: "weekly",
|
|
15
|
+
interval: 2,
|
|
16
|
+
daysOfWeek: ["monday", "wednesday", "friday"],
|
|
17
|
+
method: "start",
|
|
18
|
+
})
|
|
19
|
+
).not.toThrow();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("accepts monthly repetition", () => {
|
|
23
|
+
expect(() =>
|
|
24
|
+
RepetitionRuleInput.parse({ frequency: "monthly", interval: 1, method: "dueDate" })
|
|
25
|
+
).not.toThrow();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("accepts yearly repetition", () => {
|
|
29
|
+
expect(() =>
|
|
30
|
+
RepetitionRuleInput.parse({ frequency: "yearly", interval: 1, method: "fixed" })
|
|
31
|
+
).not.toThrow();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("defaults interval to 1 when omitted", () => {
|
|
35
|
+
const result = RepetitionRuleInput.parse({ frequency: "daily", method: "fixed" });
|
|
36
|
+
expect(result.interval).toBe(1);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("rejects daysOfWeek on non-weekly frequency", () => {
|
|
40
|
+
expect(() =>
|
|
41
|
+
RepetitionRuleInput.parse({
|
|
42
|
+
frequency: "daily",
|
|
43
|
+
interval: 1,
|
|
44
|
+
daysOfWeek: ["monday"],
|
|
45
|
+
method: "fixed",
|
|
46
|
+
})
|
|
47
|
+
).toThrow();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("rejects daysOfWeek on monthly frequency", () => {
|
|
51
|
+
expect(() =>
|
|
52
|
+
RepetitionRuleInput.parse({
|
|
53
|
+
frequency: "monthly",
|
|
54
|
+
interval: 1,
|
|
55
|
+
daysOfWeek: ["tuesday"],
|
|
56
|
+
method: "fixed",
|
|
57
|
+
})
|
|
58
|
+
).toThrow();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("rejects interval of zero", () => {
|
|
62
|
+
expect(() =>
|
|
63
|
+
RepetitionRuleInput.parse({ frequency: "daily", interval: 0, method: "fixed" })
|
|
64
|
+
).toThrow();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("rejects negative interval", () => {
|
|
68
|
+
expect(() =>
|
|
69
|
+
RepetitionRuleInput.parse({ frequency: "weekly", interval: -1, method: "fixed" })
|
|
70
|
+
).toThrow();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("rejects invalid frequency", () => {
|
|
74
|
+
expect(() =>
|
|
75
|
+
RepetitionRuleInput.parse({ frequency: "hourly", interval: 1, method: "fixed" })
|
|
76
|
+
).toThrow();
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("rejects invalid method", () => {
|
|
80
|
+
expect(() =>
|
|
81
|
+
RepetitionRuleInput.parse({ frequency: "daily", interval: 1, method: "completion" })
|
|
82
|
+
).toThrow();
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
describe("CreateTaskInput with repetitionRule", () => {
|
|
87
|
+
it("accepts task without repetitionRule (backward compat)", () => {
|
|
88
|
+
expect(() => CreateTaskInput.parse({ name: "Buy milk" })).not.toThrow();
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("accepts task with repetitionRule", () => {
|
|
92
|
+
expect(() =>
|
|
93
|
+
CreateTaskInput.parse({
|
|
94
|
+
name: "Stand-up",
|
|
95
|
+
repetitionRule: { frequency: "daily", interval: 1, method: "fixed" },
|
|
96
|
+
})
|
|
97
|
+
).not.toThrow();
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
describe("EditTaskInput with repetitionRule", () => {
|
|
102
|
+
it("accepts edit without repetitionRule (leave unchanged)", () => {
|
|
103
|
+
expect(() => EditTaskInput.parse({ id: "abc", flagged: true })).not.toThrow();
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it("accepts edit with repetitionRule object (set rule)", () => {
|
|
107
|
+
expect(() =>
|
|
108
|
+
EditTaskInput.parse({
|
|
109
|
+
id: "abc",
|
|
110
|
+
repetitionRule: { frequency: "weekly", interval: 1, method: "start" },
|
|
111
|
+
})
|
|
112
|
+
).not.toThrow();
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("accepts edit with repetitionRule null (clear rule)", () => {
|
|
116
|
+
expect(() =>
|
|
117
|
+
EditTaskInput.parse({ id: "abc", repetitionRule: null })
|
|
118
|
+
).not.toThrow();
|
|
119
|
+
});
|
|
120
|
+
});
|