@langadventurellc/task-trellis-mcp 1.0.1 → 1.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.
Files changed (207) hide show
  1. package/README.md +47 -67
  2. package/dist/__tests__/e2e/crud/createObject.e2e.test.js +64 -12
  3. package/dist/__tests__/e2e/crud/createObject.e2e.test.js.map +1 -1
  4. package/dist/__tests__/e2e/crud/listObjects.e2e.test.js +260 -90
  5. package/dist/__tests__/e2e/crud/listObjects.e2e.test.js.map +1 -1
  6. package/dist/__tests__/e2e/utils/extractObjectIds.d.ts +5 -0
  7. package/dist/__tests__/e2e/utils/extractObjectIds.d.ts.map +1 -0
  8. package/dist/__tests__/e2e/utils/extractObjectIds.js +12 -0
  9. package/dist/__tests__/e2e/utils/extractObjectIds.js.map +1 -0
  10. package/dist/__tests__/e2e/utils/index.d.ts +1 -0
  11. package/dist/__tests__/e2e/utils/index.d.ts.map +1 -1
  12. package/dist/__tests__/e2e/utils/index.js +3 -1
  13. package/dist/__tests__/e2e/utils/index.js.map +1 -1
  14. package/dist/__tests__/e2e/utils/mcpTestClient.d.ts +2 -1
  15. package/dist/__tests__/e2e/utils/mcpTestClient.d.ts.map +1 -1
  16. package/dist/__tests__/e2e/utils/mcpTestClient.js +14 -8
  17. package/dist/__tests__/e2e/utils/mcpTestClient.js.map +1 -1
  18. package/dist/__tests__/e2e/utils/parseListObjectsResponse.d.ts +3 -1
  19. package/dist/__tests__/e2e/utils/parseListObjectsResponse.d.ts.map +1 -1
  20. package/dist/__tests__/e2e/utils/parseListObjectsResponse.js +1 -0
  21. package/dist/__tests__/e2e/utils/parseListObjectsResponse.js.map +1 -1
  22. package/dist/__tests__/e2e/workflow/appendModifiedFiles.e2e.test.d.ts +2 -0
  23. package/dist/__tests__/e2e/workflow/appendModifiedFiles.e2e.test.d.ts.map +1 -0
  24. package/dist/__tests__/e2e/workflow/appendModifiedFiles.e2e.test.js +597 -0
  25. package/dist/__tests__/e2e/workflow/appendModifiedFiles.e2e.test.js.map +1 -0
  26. package/dist/__tests__/e2e/workflow/claimTask.e2e.test.js +189 -0
  27. package/dist/__tests__/e2e/workflow/claimTask.e2e.test.js.map +1 -1
  28. package/dist/__tests__/e2e/workflow/completeTask.e2e.test.js +446 -0
  29. package/dist/__tests__/e2e/workflow/completeTask.e2e.test.js.map +1 -1
  30. package/dist/__tests__/e2e/workflow/taskLifecycle.e2e.test.js +3 -7
  31. package/dist/__tests__/e2e/workflow/taskLifecycle.e2e.test.js.map +1 -1
  32. package/dist/configuration/ServerConfig.d.ts +1 -0
  33. package/dist/configuration/ServerConfig.d.ts.map +1 -1
  34. package/dist/models/TrellisObjectSummary.d.ts +16 -0
  35. package/dist/models/TrellisObjectSummary.d.ts.map +1 -0
  36. package/dist/models/TrellisObjectSummary.js +3 -0
  37. package/dist/models/TrellisObjectSummary.js.map +1 -0
  38. package/dist/models/index.d.ts +1 -0
  39. package/dist/models/index.d.ts.map +1 -1
  40. package/dist/models/index.js.map +1 -1
  41. package/dist/repositories/local/__tests__/getObjectFilePath.test.js +9 -6
  42. package/dist/repositories/local/__tests__/getObjectFilePath.test.js.map +1 -1
  43. package/dist/repositories/local/__tests__/getObjects.test.js +40 -10
  44. package/dist/repositories/local/__tests__/getObjects.test.js.map +1 -1
  45. package/dist/repositories/local/getObjectFilePath.d.ts.map +1 -1
  46. package/dist/repositories/local/getObjectFilePath.js +8 -4
  47. package/dist/repositories/local/getObjectFilePath.js.map +1 -1
  48. package/dist/repositories/local/getObjects.d.ts.map +1 -1
  49. package/dist/repositories/local/getObjects.js +6 -1
  50. package/dist/repositories/local/getObjects.js.map +1 -1
  51. package/dist/server.js +23 -9
  52. package/dist/server.js.map +1 -1
  53. package/dist/services/TaskTrellisService.d.ts +87 -0
  54. package/dist/services/TaskTrellisService.d.ts.map +1 -0
  55. package/dist/services/TaskTrellisService.js +3 -0
  56. package/dist/services/TaskTrellisService.js.map +1 -0
  57. package/dist/services/local/LocalTaskTrellisService.d.ts +61 -0
  58. package/dist/services/local/LocalTaskTrellisService.d.ts.map +1 -0
  59. package/dist/services/local/LocalTaskTrellisService.js +77 -0
  60. package/dist/services/local/LocalTaskTrellisService.js.map +1 -0
  61. package/dist/services/local/__tests__/appendAffectedFiles.test.d.ts +2 -0
  62. package/dist/services/local/__tests__/appendAffectedFiles.test.d.ts.map +1 -0
  63. package/dist/services/local/__tests__/appendAffectedFiles.test.js +202 -0
  64. package/dist/services/local/__tests__/appendAffectedFiles.test.js.map +1 -0
  65. package/dist/services/local/__tests__/appendModifiedFiles.test.d.ts +2 -0
  66. package/dist/services/local/__tests__/appendModifiedFiles.test.d.ts.map +1 -0
  67. package/dist/services/local/__tests__/appendModifiedFiles.test.js +161 -0
  68. package/dist/services/local/__tests__/appendModifiedFiles.test.js.map +1 -0
  69. package/dist/services/local/__tests__/appendObjectLog.test.d.ts +2 -0
  70. package/dist/services/local/__tests__/appendObjectLog.test.d.ts.map +1 -0
  71. package/dist/services/local/__tests__/appendObjectLog.test.js +104 -0
  72. package/dist/services/local/__tests__/appendObjectLog.test.js.map +1 -0
  73. package/dist/services/local/__tests__/claimTask.test.d.ts +2 -0
  74. package/dist/services/local/__tests__/claimTask.test.d.ts.map +1 -0
  75. package/dist/services/local/__tests__/claimTask.test.js +463 -0
  76. package/dist/services/local/__tests__/claimTask.test.js.map +1 -0
  77. package/dist/services/local/__tests__/completeTask.test.d.ts +2 -0
  78. package/dist/services/local/__tests__/completeTask.test.d.ts.map +1 -0
  79. package/dist/services/local/__tests__/completeTask.test.js +468 -0
  80. package/dist/services/local/__tests__/completeTask.test.js.map +1 -0
  81. package/dist/services/local/__tests__/createObject.test.d.ts +2 -0
  82. package/dist/services/local/__tests__/createObject.test.d.ts.map +1 -0
  83. package/dist/services/local/__tests__/createObject.test.js +332 -0
  84. package/dist/services/local/__tests__/createObject.test.js.map +1 -0
  85. package/dist/services/local/__tests__/listObjects.test.d.ts +2 -0
  86. package/dist/services/local/__tests__/listObjects.test.d.ts.map +1 -0
  87. package/dist/services/local/__tests__/listObjects.test.js +226 -0
  88. package/dist/services/local/__tests__/listObjects.test.js.map +1 -0
  89. package/dist/services/local/__tests__/pruneClosed.test.d.ts +2 -0
  90. package/dist/services/local/__tests__/pruneClosed.test.d.ts.map +1 -0
  91. package/dist/services/local/__tests__/pruneClosed.test.js +213 -0
  92. package/dist/services/local/__tests__/pruneClosed.test.js.map +1 -0
  93. package/dist/services/local/__tests__/replaceObjectBodyRegex.test.d.ts +2 -0
  94. package/dist/services/local/__tests__/replaceObjectBodyRegex.test.d.ts.map +1 -0
  95. package/dist/services/local/__tests__/replaceObjectBodyRegex.test.js +283 -0
  96. package/dist/services/local/__tests__/replaceObjectBodyRegex.test.js.map +1 -0
  97. package/dist/services/local/__tests__/updateObject.test.d.ts +2 -0
  98. package/dist/services/local/__tests__/updateObject.test.d.ts.map +1 -0
  99. package/dist/services/local/__tests__/updateObject.test.js +314 -0
  100. package/dist/services/local/__tests__/updateObject.test.js.map +1 -0
  101. package/dist/services/local/appendAffectedFiles.d.ts +12 -0
  102. package/dist/services/local/appendAffectedFiles.d.ts.map +1 -0
  103. package/dist/services/local/appendAffectedFiles.js +34 -0
  104. package/dist/services/local/appendAffectedFiles.js.map +1 -0
  105. package/dist/services/local/appendModifiedFiles.d.ts +15 -0
  106. package/dist/services/local/appendModifiedFiles.d.ts.map +1 -0
  107. package/dist/services/local/appendModifiedFiles.js +39 -0
  108. package/dist/services/local/appendModifiedFiles.js.map +1 -0
  109. package/dist/services/local/appendObjectLog.d.ts +8 -0
  110. package/dist/services/local/appendObjectLog.d.ts.map +1 -0
  111. package/dist/services/local/appendObjectLog.js +45 -0
  112. package/dist/services/local/appendObjectLog.js.map +1 -0
  113. package/dist/services/local/claimTask.d.ts +8 -0
  114. package/dist/services/local/claimTask.d.ts.map +1 -0
  115. package/dist/services/local/claimTask.js +118 -0
  116. package/dist/services/local/claimTask.js.map +1 -0
  117. package/dist/services/local/completeTask.d.ts +9 -0
  118. package/dist/services/local/completeTask.d.ts.map +1 -0
  119. package/dist/services/local/completeTask.js +74 -0
  120. package/dist/services/local/completeTask.js.map +1 -0
  121. package/dist/services/local/createObject.d.ts +9 -0
  122. package/dist/services/local/createObject.d.ts.map +1 -0
  123. package/dist/services/local/createObject.js +44 -0
  124. package/dist/services/local/createObject.js.map +1 -0
  125. package/dist/services/local/listObjects.d.ts +9 -0
  126. package/dist/services/local/listObjects.d.ts.map +1 -0
  127. package/dist/services/local/listObjects.js +43 -0
  128. package/dist/services/local/listObjects.js.map +1 -0
  129. package/dist/services/local/pruneClosed.d.ts +8 -0
  130. package/dist/services/local/pruneClosed.d.ts.map +1 -0
  131. package/dist/services/local/pruneClosed.js +55 -0
  132. package/dist/services/local/pruneClosed.js.map +1 -0
  133. package/dist/services/local/replaceObjectBodyRegex.d.ts +8 -0
  134. package/dist/services/local/replaceObjectBodyRegex.d.ts.map +1 -0
  135. package/dist/services/local/replaceObjectBodyRegex.js +85 -0
  136. package/dist/services/local/replaceObjectBodyRegex.js.map +1 -0
  137. package/dist/services/local/updateObject.d.ts +9 -0
  138. package/dist/services/local/updateObject.d.ts.map +1 -0
  139. package/dist/services/local/updateObject.js +53 -0
  140. package/dist/services/local/updateObject.js.map +1 -0
  141. package/dist/tools/__tests__/appendModifiedFilesTool.test.d.ts +2 -0
  142. package/dist/tools/__tests__/appendModifiedFilesTool.test.d.ts.map +1 -0
  143. package/dist/tools/__tests__/appendModifiedFilesTool.test.js +177 -0
  144. package/dist/tools/__tests__/appendModifiedFilesTool.test.js.map +1 -0
  145. package/dist/tools/__tests__/appendObjectLogTool.test.js +33 -101
  146. package/dist/tools/__tests__/appendObjectLogTool.test.js.map +1 -1
  147. package/dist/tools/__tests__/claimTaskTool.test.js +98 -311
  148. package/dist/tools/__tests__/claimTaskTool.test.js.map +1 -1
  149. package/dist/tools/__tests__/completeTaskTool.test.js +134 -184
  150. package/dist/tools/__tests__/completeTaskTool.test.js.map +1 -1
  151. package/dist/tools/__tests__/createObjectTool.test.js +61 -325
  152. package/dist/tools/__tests__/createObjectTool.test.js.map +1 -1
  153. package/dist/tools/__tests__/listObjectsTool.test.js +70 -109
  154. package/dist/tools/__tests__/listObjectsTool.test.js.map +1 -1
  155. package/dist/tools/__tests__/pruneClosedTool.test.js +87 -146
  156. package/dist/tools/__tests__/pruneClosedTool.test.js.map +1 -1
  157. package/dist/tools/__tests__/replaceObjectBodyRegexTool.test.js +56 -225
  158. package/dist/tools/__tests__/replaceObjectBodyRegexTool.test.js.map +1 -1
  159. package/dist/tools/__tests__/updateObjectTool.test.js +48 -166
  160. package/dist/tools/__tests__/updateObjectTool.test.js.map +1 -1
  161. package/dist/tools/appendModifiedFilesTool.d.ts +30 -0
  162. package/dist/tools/appendModifiedFilesTool.d.ts.map +1 -0
  163. package/dist/tools/appendModifiedFilesTool.js +55 -0
  164. package/dist/tools/appendModifiedFilesTool.js.map +1 -0
  165. package/dist/tools/appendObjectLogTool.d.ts +4 -3
  166. package/dist/tools/appendObjectLogTool.d.ts.map +1 -1
  167. package/dist/tools/appendObjectLogTool.js +2 -40
  168. package/dist/tools/appendObjectLogTool.js.map +1 -1
  169. package/dist/tools/claimTaskTool.d.ts +4 -3
  170. package/dist/tools/claimTaskTool.d.ts.map +1 -1
  171. package/dist/tools/claimTaskTool.js +2 -80
  172. package/dist/tools/claimTaskTool.js.map +1 -1
  173. package/dist/tools/completeTaskTool.d.ts +5 -3
  174. package/dist/tools/completeTaskTool.d.ts.map +1 -1
  175. package/dist/tools/completeTaskTool.js +3 -29
  176. package/dist/tools/completeTaskTool.js.map +1 -1
  177. package/dist/tools/createObjectTool.d.ts +7 -6
  178. package/dist/tools/createObjectTool.d.ts.map +1 -1
  179. package/dist/tools/createObjectTool.js +11 -44
  180. package/dist/tools/createObjectTool.js.map +1 -1
  181. package/dist/tools/index.d.ts +1 -0
  182. package/dist/tools/index.d.ts.map +1 -1
  183. package/dist/tools/index.js +4 -1
  184. package/dist/tools/index.js.map +1 -1
  185. package/dist/tools/listObjectsTool.d.ts +5 -4
  186. package/dist/tools/listObjectsTool.d.ts.map +1 -1
  187. package/dist/tools/listObjectsTool.js +5 -13
  188. package/dist/tools/listObjectsTool.js.map +1 -1
  189. package/dist/tools/pruneClosedTool.d.ts +4 -3
  190. package/dist/tools/pruneClosedTool.d.ts.map +1 -1
  191. package/dist/tools/pruneClosedTool.js +2 -51
  192. package/dist/tools/pruneClosedTool.js.map +1 -1
  193. package/dist/tools/replaceObjectBodyRegexTool.d.ts +4 -3
  194. package/dist/tools/replaceObjectBodyRegexTool.d.ts.map +1 -1
  195. package/dist/tools/replaceObjectBodyRegexTool.js +2 -80
  196. package/dist/tools/replaceObjectBodyRegexTool.js.map +1 -1
  197. package/dist/tools/updateObjectTool.d.ts +5 -4
  198. package/dist/tools/updateObjectTool.d.ts.map +1 -1
  199. package/dist/tools/updateObjectTool.js +3 -49
  200. package/dist/tools/updateObjectTool.js.map +1 -1
  201. package/dist/validation/__tests__/validateParentType.test.js +5 -5
  202. package/dist/validation/__tests__/validateParentType.test.js.map +1 -1
  203. package/dist/validation/validateParentType.d.ts +1 -1
  204. package/dist/validation/validateParentType.d.ts.map +1 -1
  205. package/dist/validation/validateParentType.js +2 -5
  206. package/dist/validation/validateParentType.js.map +1 -1
  207. package/package.json +1 -1
@@ -1,4 +1,6 @@
1
+ import { ServerConfig } from "../configuration";
1
2
  import { Repository } from "../repositories";
3
+ import { TaskTrellisService } from "../services/TaskTrellisService";
2
4
  export declare const completeTaskTool: {
3
5
  readonly name: "complete_task";
4
6
  readonly description: "Completes a task in the task trellis system\n\nUse this tool to mark a task as finished and record completion details. Critical for task lifecycle management and maintaining accurate project status.\n\nRequired completion data:\n- 'taskId': Unique identifier of the task being completed\n- 'summary': Concise description of what was accomplished\n- 'filesChanged': Map of modified files with descriptions of changes made\n\nCompletion process:\n1. Validates task is in a completable state ('in-progress')\n2. Updates task status to 'done'\n3. Records completion timestamp and summary\n4. Associates file changes with the task for traceability\n5. Updates parent-child relationships and dependency chains\n6. Triggers any dependent tasks that were waiting for this completion\n\nFile change tracking:\n- Key: relative file path from project root\n- Value: description of changes made to that file\n- Example: {'src/api/users.ts': 'Added user authentication endpoints', 'tests/auth.test.ts': 'Added comprehensive auth test coverage'}\n\nBest practices:\n- Provide clear, actionable summaries that explain the outcome\n- Document all meaningful file changes for future reference \n- Complete tasks only when all acceptance criteria are met\n- Verify dependent tasks can now proceed before completion\n- Include any important notes or lessons learned in the summary\n\nTask completion automatically notifies dependent tasks and may trigger workflow progression for related work items.";
@@ -24,10 +26,10 @@ export declare const completeTaskTool: {
24
26
  readonly required: readonly ["taskId", "summary", "filesChanged"];
25
27
  };
26
28
  };
27
- export declare function handleCompleteTask(repository: Repository, args: unknown): Promise<{
28
- content: {
29
+ export declare function handleCompleteTask(service: TaskTrellisService, repository: Repository, args: unknown, serverConfig?: ServerConfig): Promise<{
30
+ content: Array<{
29
31
  type: string;
30
32
  text: string;
31
- }[];
33
+ }>;
32
34
  }>;
33
35
  //# sourceMappingURL=completeTaskTool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"completeTaskTool.d.ts","sourceRoot":"","sources":["../../src/tools/completeTaskTool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;CAqDnB,CAAC;AAEX,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,OAAO;;;;;GA2Cd"}
1
+ {"version":3,"file":"completeTaskTool.d.ts","sourceRoot":"","sources":["../../src/tools/completeTaskTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;CAqDnB,CAAC;AAEX,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,kBAAkB,EAC3B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,OAAO,EACb,YAAY,CAAC,EAAE,YAAY;;;;;GAgB5B"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.completeTaskTool = void 0;
4
4
  exports.handleCompleteTask = handleCompleteTask;
5
- const models_1 = require("../models");
6
5
  exports.completeTaskTool = {
7
6
  name: "complete_task",
8
7
  description: `Completes a task in the task trellis system
@@ -57,34 +56,9 @@ Task completion automatically notifies dependent tasks and may trigger workflow
57
56
  required: ["taskId", "summary", "filesChanged"],
58
57
  },
59
58
  };
60
- async function handleCompleteTask(repository, args) {
59
+ function handleCompleteTask(service, repository, args, serverConfig) {
61
60
  const { taskId, summary, filesChanged } = args;
62
- // Get the task object from repository
63
- const task = await repository.getObjectById(taskId);
64
- if (!task) {
65
- throw new Error(`Task with ID "${taskId}" not found`);
66
- }
67
- // Check if task is in progress
68
- if (task.status !== models_1.TrellisObjectStatus.IN_PROGRESS) {
69
- throw new Error(`Task "${taskId}" is not in progress (current status: ${task.status})`);
70
- }
71
- // Update task status to done
72
- task.status = models_1.TrellisObjectStatus.DONE;
73
- // Append to affected files map
74
- Object.entries(filesChanged).forEach(([filePath, description]) => {
75
- task.affectedFiles.set(filePath, description);
76
- });
77
- // Append summary to log
78
- task.log.push(summary);
79
- // Save the updated task
80
- await repository.saveObject(task);
81
- return {
82
- content: [
83
- {
84
- type: "text",
85
- text: `Task "${taskId}" completed successfully. Updated ${Object.keys(filesChanged).length} affected files.`,
86
- },
87
- ],
88
- };
61
+ // Delegate to service.completeTask
62
+ return service.completeTask(repository, taskId, summary, filesChanged, serverConfig);
89
63
  }
90
64
  //# sourceMappingURL=completeTaskTool.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"completeTaskTool.js","sourceRoot":"","sources":["../../src/tools/completeTaskTool.ts"],"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,EAAE,YAAY,EAAE,GAAG,IAIzC,CAAC;IAEF,mCAAmC;IACnC,OAAO,OAAO,CAAC,YAAY,CACzB,UAAU,EACV,MAAM,EACN,OAAO,EACP,YAAY,EACZ,YAAY,CACb,CAAC;AACJ,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import { Repository } from "../repositories";
2
+ import { TaskTrellisService } from "../services/TaskTrellisService";
2
3
  export declare const createObjectTool: {
3
4
  readonly name: "create_object";
4
- readonly description: "Creates a new object in the task trellis system\n\nUse this tool to create new objects such as tasks, projects, or other work items within the task management hierarchy. Objects can have parent-child relationships and dependencies through prerequisites.\n\nAvailable object types and hierarchy requirements:\n- 'project': Top-level containers, cannot have a parent\n- 'epic': Must have a project as a parent\n- 'feature': Can have no parent or an epic as a parent\n- 'task': Can have no parent or a feature as a parent\n\nSupported hierarchy structures:\n- Full hierarchy: project → epic → feature → task\n- Simplified: feature → task \n- Standalone: task\n\nAvailable status values:\n- 'draft': Initial state for new objects (default)\n- 'open': Ready to begin work\n- 'in-progress': Currently being worked on\n- 'done': Completed successfully\n- 'wont-do': Cancelled or decided against\n\nAvailable priority values:\n- 'high': Critical or urgent work\n- 'medium': Standard priority (default)\n- 'low': Nice-to-have or future work\n\nKey aspects:\n- Objects support hierarchical organization via parent relationships\n- Prerequisites define execution order dependencies between objects\n- Parent-child relationships must follow the hierarchy rules above\n- The system validates parent types during creation\n\nBest practices:\n- Use descriptive titles that clearly indicate the work to be done\n- Follow the hierarchy constraints for proper organization\n- Set appropriate status based on current work state\n- Define prerequisites to ensure proper task ordering\n- Include detailed descriptions to provide context for the work";
5
+ readonly description: "Creates a new object in the task trellis system\n\nUse this tool to create new objects such as tasks, projects, or other work items within the task management hierarchy. Objects can have parent-child relationships and dependencies through prerequisites.\n\nAvailable object types and hierarchy requirements:\n- 'project': Top-level containers, cannot have a parent\n- 'epic': Can have no parent or a project as a parent\n- 'feature': Can have no parent or an epic as a parent\n- 'task': Can have no parent or a feature as a parent\n\nSupported hierarchy structures:\n- Full hierarchy: project → epic → feature → task\n- Simplified: epic → feature → task\n- Simplified: feature → task \n- Standalone: epic\n- Standalone: task\n\nAvailable status values:\n- 'draft': Initial state for new objects\n- 'open': Ready to begin work (default)\n- 'open': Ready to begin work\n- 'in-progress': Currently being worked on\n- 'done': Completed successfully\n- 'wont-do': Cancelled or decided against\n\nAvailable priority values:\n- 'high': Critical or urgent work\n- 'medium': Standard priority (default)\n- 'low': Nice-to-have or future work\n\nKey aspects:\n- Objects support hierarchical organization via parent relationships\n- Prerequisites define execution order dependencies between objects\n- Parent-child relationships must follow the hierarchy rules above\n- The system validates parent types during creation\n\nBest practices:\n- Use descriptive titles that clearly indicate the work to be done\n- Follow the hierarchy constraints for proper organization\n- Set appropriate status based on current work state\n- Define prerequisites to ensure proper task ordering\n- Include detailed descriptions to provide context for the work";
5
6
  readonly inputSchema: {
6
7
  readonly type: "object";
7
8
  readonly properties: {
@@ -24,8 +25,8 @@ export declare const createObjectTool: {
24
25
  };
25
26
  readonly status: {
26
27
  readonly type: "string";
27
- readonly description: "Status of the object (defaults to 'draft')";
28
- readonly default: "draft";
28
+ readonly description: "Status of the object (defaults to 'open')";
29
+ readonly default: "open";
29
30
  };
30
31
  readonly prerequisites: {
31
32
  readonly type: "array";
@@ -43,10 +44,10 @@ export declare const createObjectTool: {
43
44
  readonly required: readonly ["type", "title"];
44
45
  };
45
46
  };
46
- export declare function handleCreateObject(repository: Repository, args: unknown): Promise<{
47
- content: {
47
+ export declare function handleCreateObject(service: TaskTrellisService, repository: Repository, args: unknown): Promise<{
48
+ content: Array<{
48
49
  type: string;
49
50
  text: string;
50
- }[];
51
+ }>;
51
52
  }>;
52
53
  //# sourceMappingURL=createObjectTool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createObjectTool.d.ts","sourceRoot":"","sources":["../../src/tools/createObjectTool.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFnB,CAAC;AAEX,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,OAAO;;;;;GA6Dd"}
1
+ {"version":3,"file":"createObjectTool.d.ts","sourceRoot":"","sources":["../../src/tools/createObjectTool.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFnB,CAAC;AAEX,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,kBAAkB,EAC3B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,OAAO;;;;;GA+Bd"}
@@ -2,8 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createObjectTool = void 0;
4
4
  exports.handleCreateObject = handleCreateObject;
5
- const utils_1 = require("../utils");
6
- const validateObjectCreation_js_1 = require("../validation/validateObjectCreation.js");
7
5
  exports.createObjectTool = {
8
6
  name: "create_object",
9
7
  description: `Creates a new object in the task trellis system
@@ -12,17 +10,20 @@ Use this tool to create new objects such as tasks, projects, or other work items
12
10
 
13
11
  Available object types and hierarchy requirements:
14
12
  - 'project': Top-level containers, cannot have a parent
15
- - 'epic': Must have a project as a parent
13
+ - 'epic': Can have no parent or a project as a parent
16
14
  - 'feature': Can have no parent or an epic as a parent
17
15
  - 'task': Can have no parent or a feature as a parent
18
16
 
19
17
  Supported hierarchy structures:
20
18
  - Full hierarchy: project → epic → feature → task
19
+ - Simplified: epic → feature → task
21
20
  - Simplified: feature → task
21
+ - Standalone: epic
22
22
  - Standalone: task
23
23
 
24
24
  Available status values:
25
- - 'draft': Initial state for new objects (default)
25
+ - 'draft': Initial state for new objects
26
+ - 'open': Ready to begin work (default)
26
27
  - 'open': Ready to begin work
27
28
  - 'in-progress': Currently being worked on
28
29
  - 'done': Completed successfully
@@ -67,8 +68,8 @@ Best practices:
67
68
  },
68
69
  status: {
69
70
  type: "string",
70
- description: "Status of the object (defaults to 'draft')",
71
- default: "draft",
71
+ description: "Status of the object (defaults to 'open')",
72
+ default: "open",
72
73
  },
73
74
  prerequisites: {
74
75
  type: "array",
@@ -86,43 +87,9 @@ Best practices:
86
87
  required: ["type", "title"],
87
88
  },
88
89
  };
89
- async function handleCreateObject(repository, args) {
90
- const { type, title, parent, priority = "medium", status = "draft", prerequisites = [], description = "", } = args;
91
- // Get existing objects to generate unique ID
92
- const existingObjects = await repository.getObjects(true);
93
- const existingIds = existingObjects.map((obj) => obj.id);
94
- // Generate unique ID
95
- const objectType = type;
96
- const id = (0, utils_1.generateUniqueId)(title, objectType, existingIds);
97
- // Create TrellisObject with current timestamp
98
- const now = new Date().toISOString();
99
- const trellisObject = {
100
- id,
101
- type: objectType,
102
- title,
103
- status: status,
104
- priority: priority,
105
- parent,
106
- prerequisites,
107
- affectedFiles: new Map(),
108
- log: [],
109
- schema: "v1.0",
110
- childrenIds: [],
111
- created: now,
112
- updated: now,
113
- body: description,
114
- };
115
- // Validate object before saving
116
- await (0, validateObjectCreation_js_1.validateObjectCreation)(trellisObject, repository);
117
- // Save through repository
118
- await repository.saveObject(trellisObject);
119
- return {
120
- content: [
121
- {
122
- type: "text",
123
- text: `Created object with ID: ${id}`,
124
- },
125
- ],
126
- };
90
+ async function handleCreateObject(service, repository, args) {
91
+ const { type, title, parent, priority = "medium", status = "open", prerequisites = [], description = "", } = args;
92
+ // Delegate to service layer
93
+ return service.createObject(repository, type, title, parent, priority, status, prerequisites, description);
127
94
  }
128
95
  //# sourceMappingURL=createObjectTool.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createObjectTool.js","sourceRoot":"","sources":["../../src/tools/createObjectTool.ts"],"names":[],"mappings":";;;AA8FA,gDA+DC;AAtJD,oCAA4C;AAC5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V,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0BAA0B;aACxC;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qBAAqB;aACnC;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6BAA6B;aAC3C;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uCAAuC;gBACpD,OAAO,EAAE,QAAQ;aAClB;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,2CAA2C;gBACxD,OAAO,EAAE,MAAM;aAChB;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;gBACD,WAAW,EACT,4DAA4D;gBAC9D,OAAO,EAAE,EAAE;aACZ;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,2BAA2B;aACzC;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;KAC5B;CACO,CAAC;AAEJ,KAAK,UAAU,kBAAkB,CACtC,OAA2B,EAC3B,UAAsB,EACtB,IAAa;IAEb,MAAM,EACJ,IAAI,EACJ,KAAK,EACL,MAAM,EACN,QAAQ,GAAG,QAAQ,EACnB,MAAM,GAAG,MAAM,EACf,aAAa,GAAG,EAAE,EAClB,WAAW,GAAG,EAAE,GACjB,GAAG,IAQH,CAAC;IAEF,4BAA4B;IAC5B,OAAO,OAAO,CAAC,YAAY,CACzB,UAAU,EACV,IAAyB,EACzB,KAAK,EACL,MAAM,EACN,QAAiC,EACjC,MAA6B,EAC7B,aAAa,EACb,WAAW,CACZ,CAAC;AACJ,CAAC"}
@@ -9,4 +9,5 @@ export { completeTaskTool, handleCompleteTask } from "./completeTaskTool.js";
9
9
  export { pruneClosedTool, handlePruneClosed } from "./pruneClosedTool.js";
10
10
  export { activateTool, handleActivate } from "./activateTool.js";
11
11
  export { replaceObjectBodyRegexTool, handleReplaceObjectBodyRegex, } from "./replaceObjectBodyRegexTool.js";
12
+ export { appendModifiedFilesTool, handleAppendModifiedFiles, } from "./appendModifiedFilesTool.js";
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,8BAA8B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleReplaceObjectBodyRegex = exports.replaceObjectBodyRegexTool = exports.handleActivate = exports.activateTool = exports.handlePruneClosed = exports.pruneClosedTool = exports.handleCompleteTask = exports.completeTaskTool = exports.handleClaimTask = exports.claimTaskTool = exports.handleAppendObjectLog = exports.appendObjectLogTool = exports.handleListObjects = exports.listObjectsTool = exports.handleDeleteObject = exports.deleteObjectTool = exports.handleGetObject = exports.getObjectTool = exports.handleUpdateObject = exports.updateObjectTool = exports.handleCreateObject = exports.createObjectTool = void 0;
3
+ exports.handleAppendModifiedFiles = exports.appendModifiedFilesTool = exports.handleReplaceObjectBodyRegex = exports.replaceObjectBodyRegexTool = exports.handleActivate = exports.activateTool = exports.handlePruneClosed = exports.pruneClosedTool = exports.handleCompleteTask = exports.completeTaskTool = exports.handleClaimTask = exports.claimTaskTool = exports.handleAppendObjectLog = exports.appendObjectLogTool = exports.handleListObjects = exports.listObjectsTool = exports.handleDeleteObject = exports.deleteObjectTool = exports.handleGetObject = exports.getObjectTool = exports.handleUpdateObject = exports.updateObjectTool = exports.handleCreateObject = exports.createObjectTool = void 0;
4
4
  var createObjectTool_js_1 = require("./createObjectTool.js");
5
5
  Object.defineProperty(exports, "createObjectTool", { enumerable: true, get: function () { return createObjectTool_js_1.createObjectTool; } });
6
6
  Object.defineProperty(exports, "handleCreateObject", { enumerable: true, get: function () { return createObjectTool_js_1.handleCreateObject; } });
@@ -34,4 +34,7 @@ Object.defineProperty(exports, "handleActivate", { enumerable: true, get: functi
34
34
  var replaceObjectBodyRegexTool_js_1 = require("./replaceObjectBodyRegexTool.js");
35
35
  Object.defineProperty(exports, "replaceObjectBodyRegexTool", { enumerable: true, get: function () { return replaceObjectBodyRegexTool_js_1.replaceObjectBodyRegexTool; } });
36
36
  Object.defineProperty(exports, "handleReplaceObjectBodyRegex", { enumerable: true, get: function () { return replaceObjectBodyRegexTool_js_1.handleReplaceObjectBodyRegex; } });
37
+ var appendModifiedFilesTool_js_1 = require("./appendModifiedFilesTool.js");
38
+ Object.defineProperty(exports, "appendModifiedFilesTool", { enumerable: true, get: function () { return appendModifiedFilesTool_js_1.appendModifiedFilesTool; } });
39
+ Object.defineProperty(exports, "handleAppendModifiedFiles", { enumerable: true, get: function () { return appendModifiedFilesTool_js_1.handleAppendModifiedFiles; } });
37
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;;AAAA,6DAA6E;AAApE,uHAAA,gBAAgB,OAAA;AAAE,yHAAA,kBAAkB,OAAA;AAC7C,6DAA6E;AAApE,uHAAA,gBAAgB,OAAA;AAAE,yHAAA,kBAAkB,OAAA;AAC7C,uDAAoE;AAA3D,iHAAA,aAAa,OAAA;AAAE,mHAAA,eAAe,OAAA;AACvC,6DAA6E;AAApE,u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A;AAC3C,qDAAiE;AAAxD,+GAAA,YAAY,OAAA;AAAE,iHAAA,cAAc,OAAA;AACrC,iFAGyC;AAFvC,2IAAA,0BAA0B,OAAA;AAC1B,6IAAA,4BAA4B,OAAA;AAE9B,2EAGsC;AAFpC,qIAAA,uBAAuB,OAAA;AACvB,uIAAA,yBAAyB,OAAA"}
@@ -1,7 +1,8 @@
1
1
  import { Repository } from "../repositories";
2
+ import { TaskTrellisService } from "../services/TaskTrellisService";
2
3
  export declare const listObjectsTool: {
3
4
  readonly name: "list_objects";
4
- readonly description: "Lists objects from the task trellis system\n\nUse this tool to retrieve and filter objects based on various criteria. Essential for discovering existing work items, understanding project structure, and finding objects that need attention.\n\nAvailable object types:\n- 'project': Top-level containers\n- 'epic': Large features within projects \n- 'feature': Specific functionality within epics\n- 'task': Individual work items\n\nAvailable status values:\n- 'draft': Initial state for new objects\n- 'open': Ready to begin work\n- 'in-progress': Currently being worked on\n- 'done': Completed successfully\n- 'wont-do': Cancelled or decided against\n\nAvailable priority values:\n- 'high': Critical or urgent work\n- 'medium': Standard priority\n- 'low': Nice-to-have or future work\n\nKey filtering options:\n- 'type': Filter by object category (project, epic, feature, task)\n- 'scope': Limit results to a specific project or area of work\n- 'status': Find objects in particular states (draft, open, in-progress, done, wont-do)\n- 'priority': Filter by importance level (high, medium, low)\n- 'includeClosed': Whether to show completed/archived objects (defaults to false)\n\nUsage patterns:\n- List all tasks in progress: type='task', status='in-progress'\n- Find high priority work: priority='high', includeClosed=false\n- Review project scope: type='project', scope='specific-project'\n- Audit completed work: includeClosed=true, status='done'\n- Find cancelled items: status='wont-do', includeClosed=true\n\nThe results provide object metadata including IDs, titles, relationships, and current status to help navigate the work hierarchy effectively.";
5
+ readonly description: "Lists objects from the task trellis system\n\nUse this tool to retrieve and filter objects based on various criteria. Essential for discovering existing work items, understanding project structure, and finding objects that need attention.\n\nAvailable object types:\n- 'project': Top-level containers\n- 'epic': Large features within projects \n- 'feature': Specific functionality within epics\n- 'task': Individual work items\n\nAvailable status values:\n- 'draft': Initial state for new objects\n- 'open': Ready to begin work (default for new objects)\n- 'in-progress': Currently being worked on\n- 'done': Completed successfully\n- 'wont-do': Cancelled or decided against\n\nAvailable priority values:\n- 'high': Critical or urgent work\n- 'medium': Standard priority\n- 'low': Nice-to-have or future work\n\nKey filtering options:\n- 'type': Filter by object category (project, epic, feature, task)\n- 'scope': Limit results to a specific project or area of work\n- 'status': Find objects in particular states (draft, open, in-progress, done, wont-do)\n- 'priority': Filter by importance level (high, medium, low)\n- 'includeClosed': Whether to show completed/archived objects (defaults to false)\n\nUsage patterns:\n- List all tasks in progress: type='task', status='in-progress'\n- Find high priority work: priority='high', includeClosed=false\n- Review project scope: type='project', scope='specific-project'\n- Audit completed work: includeClosed=true, status='done'\n- Find cancelled items: status='wont-do', includeClosed=true\n\nThe results provide object summaries (TrellisObjectSummary instances) containing id, type, title, status, priority, parent, prerequisites, childrenIds, created, and updated fields to enable efficient filtering and further operations.";
5
6
  readonly inputSchema: {
6
7
  readonly type: "object";
7
8
  readonly properties: {
@@ -30,10 +31,10 @@ export declare const listObjectsTool: {
30
31
  readonly required: readonly ["type"];
31
32
  };
32
33
  };
33
- export declare function handleListObjects(repository: Repository, args: unknown): Promise<{
34
- content: {
34
+ export declare function handleListObjects(service: TaskTrellisService, repository: Repository, args: unknown): Promise<{
35
+ content: Array<{
35
36
  type: string;
36
37
  text: string;
37
- }[];
38
+ }>;
38
39
  }>;
39
40
  //# sourceMappingURL=listObjectsTool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"listObjectsTool.d.ts","sourceRoot":"","sources":["../../src/tools/listObjectsTool.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkElB,CAAC;AAEX,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO;;;;;GAkF5E"}
1
+ {"version":3,"file":"listObjectsTool.d.ts","sourceRoot":"","sources":["../../src/tools/listObjectsTool.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkElB,CAAC;AAEX,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,kBAAkB,EAC3B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,OAAO;;;;;GA2Ed"}
@@ -17,7 +17,7 @@ Available object types:
17
17
 
18
18
  Available status values:
19
19
  - 'draft': Initial state for new objects
20
- - 'open': Ready to begin work
20
+ - 'open': Ready to begin work (default for new objects)
21
21
  - 'in-progress': Currently being worked on
22
22
  - 'done': Completed successfully
23
23
  - 'wont-do': Cancelled or decided against
@@ -41,7 +41,7 @@ Usage patterns:
41
41
  - Audit completed work: includeClosed=true, status='done'
42
42
  - Find cancelled items: status='wont-do', includeClosed=true
43
43
 
44
- The results provide object metadata including IDs, titles, relationships, and current status to help navigate the work hierarchy effectively.`,
44
+ The results provide object summaries (TrellisObjectSummary instances) containing id, type, title, status, priority, parent, prerequisites, childrenIds, created, and updated fields to enable efficient filtering and further operations.`,
45
45
  inputSchema: {
46
46
  type: "object",
47
47
  properties: {
@@ -70,7 +70,7 @@ The results provide object metadata including IDs, titles, relationships, and cu
70
70
  required: ["type"],
71
71
  },
72
72
  };
73
- async function handleListObjects(repository, args) {
73
+ async function handleListObjects(service, repository, args) {
74
74
  const { type, scope, status, priority, includeClosed = false, } = args;
75
75
  // Helper function to convert type string to enum
76
76
  const toType = (typeString) => {
@@ -98,16 +98,8 @@ async function handleListObjects(repository, args) {
98
98
  const typeEnum = toType(type);
99
99
  const statusEnum = status ? toStatus(status) : undefined;
100
100
  const priorityEnum = priority ? toPriority(priority) : undefined;
101
- // Get objects from repository
102
- const objects = await repository.getObjects(includeClosed, scope, typeEnum, statusEnum, priorityEnum);
103
- return {
104
- content: [
105
- {
106
- type: "text",
107
- text: JSON.stringify(objects, null, 2),
108
- },
109
- ],
110
- };
101
+ // Delegate to service
102
+ return await service.listObjects(repository, typeEnum, scope, statusEnum, priorityEnum, includeClosed);
111
103
  }
112
104
  catch (error) {
113
105
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"listObjectsTool.js","sourceRoot":"","sources":["../../src/tools/listObjectsTool.ts"],"names":[],"mappings":";;;AA2EA,8CAkFC;AA7JD,sCAImB;AAGN,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8IAoC+H;IAC5I,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yBAAyB;aACvC;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oCAAoC;aAClD;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qCAAqC;aACnD;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uCAAuC;aACrD;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,4CAA4C;gBACzD,OAAO,EAAE,KAAK;aACf;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB;CACO,CAAC;AAEJ,KAAK,UAAU,iBAAiB,CAAC,UAAsB,EAAE,IAAa;IAC3E,MAAM,EACJ,IAAI,EACJ,KAAK,EACL,MAAM,EACN,QAAQ,EACR,aAAa,GAAG,KAAK,GACtB,GAAG,IAMH,CAAC;IAEF,iDAAiD;IACjD,MAAM,MAAM,GAAG,CAAC,UAAkB,EAAqB,EAAE;QACvD,IACE,MAAM,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OAAO,CAAC,WAAW,CAC9B,UAAU,EACV,QAAQ,EACR,KAAK,EACL,UAAU,EACV,YAAY,EACZ,aAAa,CACd,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,0BAA0B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;iBACzF;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { Repository } from "../repositories";
2
+ import { TaskTrellisService } from "../services/TaskTrellisService";
2
3
  export declare const pruneClosedTool: {
3
4
  readonly name: "prune_closed";
4
5
  readonly description: "Prunes closed objects from the task trellis system\n\nUse this tool for maintenance and cleanup of completed, cancelled, or otherwise closed objects that are no longer needed. Essential for system hygiene and performance optimization.\n\nPruning criteria:\n- 'age': Minimum age in minutes since object closure (required)\n- 'scope': Limit pruning to specific project or area (optional)\n- Objects must be in closed states (completed, cancelled, archived)\n- Objects must not have active dependencies or relationships\n\nSafety mechanisms:\n- Only removes truly closed objects (completed, cancelled, etc.)\n- Validates no active objects depend on pruned items\n- Preserves objects referenced by active work\n- Maintains referential integrity of remaining system\n\nCommon usage patterns:\n- Daily cleanup: age=1440 (24 hours)\n- Weekly maintenance: age=10080 (7 days) \n- Project closure: scope='project-name', age=4320 (3 days)\n- System cleanup: age=43200 (30 days)\n\nPruning benefits:\n- Reduces database size and improves query performance\n- Removes clutter from active task views\n- Prevents accumulation of obsolete work items\n- Maintains focus on current and relevant tasks\n\nUse regularly as part of system maintenance to keep the task trellis clean and performant. Consider project lifecycles and audit requirements when setting age thresholds.\n\nThis operation is permanent - pruned objects cannot be recovered.";
@@ -17,10 +18,10 @@ export declare const pruneClosedTool: {
17
18
  readonly required: readonly ["age"];
18
19
  };
19
20
  };
20
- export declare function handlePruneClosed(repository: Repository, args: unknown): Promise<{
21
- content: {
21
+ export declare function handlePruneClosed(service: TaskTrellisService, repository: Repository, args: unknown): Promise<{
22
+ content: Array<{
22
23
  type: string;
23
24
  text: string;
24
- }[];
25
+ }>;
25
26
  }>;
26
27
  //# sourceMappingURL=pruneClosedTool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pruneClosedTool.d.ts","sourceRoot":"","sources":["../../src/tools/pruneClosedTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;CA+ClB,CAAC;AAEX,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO;;;;;GA6D5E"}
1
+ {"version":3,"file":"pruneClosedTool.d.ts","sourceRoot":"","sources":["../../src/tools/pruneClosedTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;CA+ClB,CAAC;AAEX,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,kBAAkB,EAC3B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,OAAO;;;;;GAQd"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.pruneClosedTool = void 0;
4
4
  exports.handlePruneClosed = handlePruneClosed;
5
- const isClosed_1 = require("../models/isClosed");
6
5
  exports.pruneClosedTool = {
7
6
  name: "prune_closed",
8
7
  description: `Prunes closed objects from the task trellis system
@@ -51,56 +50,8 @@ This operation is permanent - pruned objects cannot be recovered.`,
51
50
  required: ["age"],
52
51
  },
53
52
  };
54
- async function handlePruneClosed(repository, args) {
53
+ async function handlePruneClosed(service, repository, args) {
55
54
  const { scope, age } = args;
56
- try {
57
- // Get all objects including closed ones
58
- const objects = await repository.getObjects(true, scope);
59
- // Filter to only closed objects
60
- const closedObjects = objects.filter(isClosed_1.isClosed);
61
- // Calculate cutoff time (age in minutes ago)
62
- const cutoffTime = new Date(Date.now() - age * 60 * 1000);
63
- // Filter to objects older than cutoff
64
- const objectsToDelete = closedObjects.filter((obj) => {
65
- const updatedTime = new Date(obj.updated);
66
- return updatedTime < cutoffTime;
67
- });
68
- // Delete each object
69
- const deletedIds = [];
70
- for (const obj of objectsToDelete) {
71
- try {
72
- await repository.deleteObject(obj.id, true);
73
- deletedIds.push(obj.id);
74
- }
75
- catch (error) {
76
- // Continue with other objects even if one fails
77
- console.error(`Failed to delete object ${obj.id}:`, error);
78
- }
79
- }
80
- const message = scope
81
- ? `Pruned ${deletedIds.length} closed objects older than ${age} minutes in scope ${scope}`
82
- : `Pruned ${deletedIds.length} closed objects older than ${age} minutes`;
83
- return {
84
- content: [
85
- {
86
- type: "text",
87
- text: `${message}${deletedIds.length > 0
88
- ? `
89
- Deleted objects: ${deletedIds.join(", ")}`
90
- : ""}`,
91
- },
92
- ],
93
- };
94
- }
95
- catch (error) {
96
- return {
97
- content: [
98
- {
99
- type: "text",
100
- text: `Error pruning closed objects: ${error instanceof Error ? error.message : String(error)}`,
101
- },
102
- ],
103
- };
104
- }
55
+ return service.pruneClosed(repository, age, scope);
105
56
  }
106
57
  //# sourceMappingURL=pruneClosedTool.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pruneClosedTool.js","sourceRoot":"","sources":["../../src/tools/pruneClosedTool.ts"],"names":[],"mappings":";;;AAoDA,8CA6DC;AAhHD,iDAA8C;AAEjC,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEA8BmD;IAChE,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,W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,OAA2B,EAC3B,UAAsB,EACtB,IAAa;IAEb,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,IAGtB,CAAC;IAEF,OAAO,OAAO,CAAC,WAAW,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AACrD,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { Repository } from "../repositories";
2
+ import { TaskTrellisService } from "../services/TaskTrellisService";
2
3
  export declare const replaceObjectBodyRegexTool: {
3
4
  readonly name: "replace_object_body_regex";
4
5
  readonly description: "Replaces portions of an object's body using regular expressions\n\nUse this tool to make targeted edits to specific sections of an object's body content without recreating the entire text. This is safer and more efficient than wholesale body replacement for surgical text modifications.\n\nThe tool uses regex pattern matching with multiline and global capabilities, similar to Python's re.sub(). When allowMultipleOccurrences is false (default), it prevents unintended bulk replacements by throwing an error if multiple matches are found.\n\nRegex Features:\n- Multiline matching: patterns can span multiple lines\n- Dot-all mode: . matches newlines \n- Backreferences: use \\1, \\2, etc. in replacement text\n- Case-sensitive matching (use (?i) flag in pattern for case-insensitive)\n\nCommon use cases:\n- Update specific sections of documentation\n- Modify code snippets within object descriptions\n- Replace outdated information while preserving structure\n- Update specific parameters or values\n- Fix formatting or content errors in targeted areas\n\nSafety features:\n- Single-match enforcement (unless explicitly allowed)\n- Pattern validation before execution\n- Graceful error handling with detailed messages\n- Original content preservation on pattern mismatch\n\nExample patterns:\n- Simple text: \"old text\" → \"new text\"\n- With context: \"(section:\\s*)old content(\\s*end)\" → \"\\1new content\\2\" \n- Multi-line: \"BEGIN.*?END\" → \"BEGIN\\nnew content\\nEND\"\n- Backreferences: \"(\\w+) (\\w+)\" → \"\\2, \\1\"\n\nThe replacement preserves all object metadata and relationships while only modifying the body content that matches your pattern.";
@@ -26,10 +27,10 @@ export declare const replaceObjectBodyRegexTool: {
26
27
  readonly required: readonly ["id", "regex", "replacement"];
27
28
  };
28
29
  };
29
- export declare function handleReplaceObjectBodyRegex(repository: Repository, args: unknown): Promise<{
30
- content: {
30
+ export declare function handleReplaceObjectBodyRegex(service: TaskTrellisService, repository: Repository, args: unknown): Promise<{
31
+ content: Array<{
31
32
  type: string;
32
33
  text: string;
33
- }[];
34
+ }>;
34
35
  }>;
35
36
  //# sourceMappingURL=replaceObjectBodyRegexTool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"replaceObjectBodyRegexTool.d.ts","sourceRoot":"","sources":["../../src/tools/replaceObjectBodyRegexTool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;CA2D7B,CAAC;AAEX,wBAAsB,4BAA4B,CAChD,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,OAAO;;;;;GAiGd"}
1
+ {"version":3,"file":"replaceObjectBodyRegexTool.d.ts","sourceRoot":"","sources":["../../src/tools/replaceObjectBodyRegexTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;CA2D7B,CAAC;AAEX,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,kBAAkB,EAC3B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,OAAO;;;;;GAqBd"}
@@ -2,8 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.replaceObjectBodyRegexTool = void 0;
4
4
  exports.handleReplaceObjectBodyRegex = handleReplaceObjectBodyRegex;
5
- const replaceStringWithRegex_1 = require("../utils/replaceStringWithRegex");
6
- const MultipleMatchesError_1 = require("../utils/MultipleMatchesError");
7
5
  exports.replaceObjectBodyRegexTool = {
8
6
  name: "replace_object_body_regex",
9
7
  description: `Replaces portions of an object's body using regular expressions
@@ -62,84 +60,8 @@ The replacement preserves all object metadata and relationships while only modif
62
60
  required: ["id", "regex", "replacement"],
63
61
  },
64
62
  };
65
- async function handleReplaceObjectBodyRegex(repository, args) {
63
+ async function handleReplaceObjectBodyRegex(service, repository, args) {
66
64
  const { id, regex, replacement, allowMultipleOccurrences = false, } = args;
67
- try {
68
- // Load the existing object
69
- const existingObject = await repository.getObjectById(id);
70
- if (!existingObject) {
71
- return {
72
- content: [
73
- {
74
- type: "text",
75
- text: `Error: Object with ID '${id}' not found`,
76
- },
77
- ],
78
- };
79
- }
80
- // Check if the object has a body to replace
81
- if (!existingObject.body) {
82
- return {
83
- content: [
84
- {
85
- type: "text",
86
- text: `Error: Object with ID '${id}' has no body content to replace`,
87
- },
88
- ],
89
- };
90
- }
91
- // Perform the regex replacement on the body
92
- const updatedBody = (0, replaceStringWithRegex_1.replaceStringWithRegex)(existingObject.body, {
93
- regex,
94
- replacement,
95
- allowMultipleOccurrences,
96
- });
97
- // If the body didn't change, inform the user
98
- if (updatedBody === existingObject.body) {
99
- return {
100
- content: [
101
- {
102
- type: "text",
103
- text: `No matches found for pattern "${regex}" in object body. Body remains unchanged.`,
104
- },
105
- ],
106
- };
107
- }
108
- // Create updated object with the new body
109
- const updatedObject = {
110
- ...existingObject,
111
- body: updatedBody,
112
- };
113
- // Save the updated object
114
- await repository.saveObject(updatedObject);
115
- return {
116
- content: [
117
- {
118
- type: "text",
119
- text: `Successfully replaced content in object body using pattern "${regex}". Object ID: ${id}`,
120
- },
121
- ],
122
- };
123
- }
124
- catch (error) {
125
- if (error instanceof MultipleMatchesError_1.MultipleMatchesError) {
126
- return {
127
- content: [
128
- {
129
- type: "text",
130
- text: `Error: ${error.message}`,
131
- },
132
- ],
133
- };
134
- }
135
- return {
136
- content: [
137
- {
138
- type: "text",
139
- text: `Error replacing object body: ${error instanceof Error ? error.message : String(error)}`,
140
- },
141
- ],
142
- };
143
- }
65
+ return service.replaceObjectBodyRegex(repository, id, regex, replacement, allowMultipleOccurrences);
144
66
  }
145
67
  //# sourceMappingURL=replaceObjectBodyRegexTool.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"replaceObjectBodyRegexTool.js","sourceRoot":"","sources":["../../src/tools/replaceObjectBodyRegexTool.ts"],"names":[],"mappings":";;;AAkEA,oEAmGC;AAnKD,4EAAyE;AACzE,wEAAqE;AAExD,QAAA,0BAA0B,GAAG;IACxC,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iIA+BkH;IAC/H,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,EAAE,EAAE;gBACF,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gDAAgD;aAC9D;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yDAAyD;aACvE;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,mEAAmE;aACtE;YACD,wBAAwB,EAAE;gBACxB,IAAI,EAAE,SAAS;gBACf,WAAW,EACT,8DAA8D;gBAChE,OAAO,EAAE,KAAK;aACf;SACF;QACD,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,aAAa,CAAC;KACzC;CACO,CAAC;AAEJ,KAAK,UAAU,4BAA4B,CAChD,UAAsB,EACtB,IAAa;IAEb,MAAM,EACJ,EAAE,EACF,KAAK,EACL,WAAW,EACX,wBAAwB,GAAG,KAAK,GACjC,GAAG,IAKH,CAAC;IAEF,IAAI,CAAC;QACH,2BAA2B;QAC3B,MAAM,cAAc,GAAG,MAAM,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QAC1D,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,0BAA0B,EAAE,aAAa;qBAChD;iBACF;aACF,CAAC;QACJ,CAAC;QAED,4CAA4C;QAC5C,IAAI,CAAC,c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E;iBAC/F;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"replaceObjectBodyRegexTool.js","sourceRoot":"","sources":["../../src/tools/replaceObjectBodyRegexTool.ts"],"names":[],"mappings":";;;AAgEA,oEAwBC;AArFY,QAAA,0BAA0B,GAAG;IACxC,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iIA+BkH;IAC/H,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,EAAE,EAAE;gBACF,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gDAAgD;aAC9D;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yDAAyD;aACvE;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,mEAAmE;aACtE;YACD,wBAAwB,EAAE;gBACxB,IAAI,EAAE,SAAS;gBACf,WAAW,EACT,8DAA8D;gBAChE,OAAO,EAAE,KAAK;aACf;SACF;QACD,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,aAAa,CAAC;KACzC;CACO,CAAC;AAEJ,KAAK,UAAU,4BAA4B,CAChD,OAA2B,EAC3B,UAAsB,EACtB,IAAa;IAEb,MAAM,EACJ,EAAE,EACF,KAAK,EACL,WAAW,EACX,wBAAwB,GAAG,KAAK,GACjC,GAAG,IAKH,CAAC;IAEF,OAAO,OAAO,CAAC,sBAAsB,CACnC,UAAU,EACV,EAAE,EACF,KAAK,EACL,WAAW,EACX,wBAAwB,CACzB,CAAC;AACJ,CAAC"}