@waymakeros/cli 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +158 -0
- package/dist/cli/cli.d.ts +7 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.js +703 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/commands/auth.d.ts +14 -0
- package/dist/cli/commands/auth.d.ts.map +1 -0
- package/dist/cli/commands/auth.js +507 -0
- package/dist/cli/commands/auth.js.map +1 -0
- package/dist/cli/commands/init.d.ts +13 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +297 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/kanban.d.ts +12 -0
- package/dist/cli/commands/kanban.d.ts.map +1 -0
- package/dist/cli/commands/kanban.js +71 -0
- package/dist/cli/commands/kanban.js.map +1 -0
- package/dist/cli/commands/serve.d.ts +12 -0
- package/dist/cli/commands/serve.d.ts.map +1 -0
- package/dist/cli/commands/serve.js +170 -0
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/sync.d.ts +12 -0
- package/dist/cli/commands/sync.d.ts.map +1 -0
- package/dist/cli/commands/sync.js +222 -0
- package/dist/cli/commands/sync.js.map +1 -0
- package/dist/cli/daemon.d.ts +106 -0
- package/dist/cli/daemon.d.ts.map +1 -0
- package/dist/cli/daemon.js +393 -0
- package/dist/cli/daemon.js.map +1 -0
- package/dist/cli/index.d.ts +13 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +90 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +238 -0
- package/dist/index.js.map +1 -0
- package/dist/simple-server.d.ts +7 -0
- package/dist/simple-server.d.ts.map +1 -0
- package/dist/simple-server.js +157 -0
- package/dist/simple-server.js.map +1 -0
- package/dist/sync/commander-client.d.ts +161 -0
- package/dist/sync/commander-client.d.ts.map +1 -0
- package/dist/sync/commander-client.js +405 -0
- package/dist/sync/commander-client.js.map +1 -0
- package/dist/sync/config-manager.d.ts +48 -0
- package/dist/sync/config-manager.d.ts.map +1 -0
- package/dist/sync/config-manager.js +169 -0
- package/dist/sync/config-manager.js.map +1 -0
- package/dist/sync/file-watcher.d.ts +53 -0
- package/dist/sync/file-watcher.d.ts.map +1 -0
- package/dist/sync/file-watcher.js +228 -0
- package/dist/sync/file-watcher.js.map +1 -0
- package/dist/sync/folder-service.d.ts +110 -0
- package/dist/sync/folder-service.d.ts.map +1 -0
- package/dist/sync/folder-service.js +298 -0
- package/dist/sync/folder-service.js.map +1 -0
- package/dist/sync/folder-status-mapper.d.ts +106 -0
- package/dist/sync/folder-status-mapper.d.ts.map +1 -0
- package/dist/sync/folder-status-mapper.js +235 -0
- package/dist/sync/folder-status-mapper.js.map +1 -0
- package/dist/sync/layer-resolver.d.ts +54 -0
- package/dist/sync/layer-resolver.d.ts.map +1 -0
- package/dist/sync/layer-resolver.js +206 -0
- package/dist/sync/layer-resolver.js.map +1 -0
- package/dist/sync/markdown-parser.d.ts +49 -0
- package/dist/sync/markdown-parser.d.ts.map +1 -0
- package/dist/sync/markdown-parser.js +202 -0
- package/dist/sync/markdown-parser.js.map +1 -0
- package/dist/sync/reverse-sync.d.ts +139 -0
- package/dist/sync/reverse-sync.d.ts.map +1 -0
- package/dist/sync/reverse-sync.js +773 -0
- package/dist/sync/reverse-sync.js.map +1 -0
- package/dist/sync/sync-engine.d.ts +157 -0
- package/dist/sync/sync-engine.d.ts.map +1 -0
- package/dist/sync/sync-engine.js +875 -0
- package/dist/sync/sync-engine.js.map +1 -0
- package/dist/sync/sync-index.d.ts +150 -0
- package/dist/sync/sync-index.d.ts.map +1 -0
- package/dist/sync/sync-index.js +287 -0
- package/dist/sync/sync-index.js.map +1 -0
- package/dist/sync/trinity-mapper.d.ts +62 -0
- package/dist/sync/trinity-mapper.d.ts.map +1 -0
- package/dist/sync/trinity-mapper.js +548 -0
- package/dist/sync/trinity-mapper.js.map +1 -0
- package/dist/sync/types.d.ts +176 -0
- package/dist/sync/types.d.ts.map +1 -0
- package/dist/sync/types.js +6 -0
- package/dist/sync/types.js.map +1 -0
- package/dist/tools/apply-framework.d.ts +7 -0
- package/dist/tools/apply-framework.d.ts.map +1 -0
- package/dist/tools/apply-framework.js +30 -0
- package/dist/tools/apply-framework.js.map +1 -0
- package/dist/tools/commander-comment-create.d.ts +7 -0
- package/dist/tools/commander-comment-create.d.ts.map +1 -0
- package/dist/tools/commander-comment-create.js +100 -0
- package/dist/tools/commander-comment-create.js.map +1 -0
- package/dist/tools/commander-comment-list.d.ts +7 -0
- package/dist/tools/commander-comment-list.d.ts.map +1 -0
- package/dist/tools/commander-comment-list.js +110 -0
- package/dist/tools/commander-comment-list.js.map +1 -0
- package/dist/tools/commander-document-create.d.ts +7 -0
- package/dist/tools/commander-document-create.d.ts.map +1 -0
- package/dist/tools/commander-document-create.js +168 -0
- package/dist/tools/commander-document-create.js.map +1 -0
- package/dist/tools/commander-document-get.d.ts +7 -0
- package/dist/tools/commander-document-get.d.ts.map +1 -0
- package/dist/tools/commander-document-get.js +104 -0
- package/dist/tools/commander-document-get.js.map +1 -0
- package/dist/tools/commander-document-list.d.ts +7 -0
- package/dist/tools/commander-document-list.d.ts.map +1 -0
- package/dist/tools/commander-document-list.js +117 -0
- package/dist/tools/commander-document-list.js.map +1 -0
- package/dist/tools/commander-document-update.d.ts +7 -0
- package/dist/tools/commander-document-update.d.ts.map +1 -0
- package/dist/tools/commander-document-update.js +133 -0
- package/dist/tools/commander-document-update.js.map +1 -0
- package/dist/tools/commander-folder-create.d.ts +7 -0
- package/dist/tools/commander-folder-create.d.ts.map +1 -0
- package/dist/tools/commander-folder-create.js +157 -0
- package/dist/tools/commander-folder-create.js.map +1 -0
- package/dist/tools/commander-folder-delete.d.ts +7 -0
- package/dist/tools/commander-folder-delete.d.ts.map +1 -0
- package/dist/tools/commander-folder-delete.js +85 -0
- package/dist/tools/commander-folder-delete.js.map +1 -0
- package/dist/tools/commander-folder-get.d.ts +7 -0
- package/dist/tools/commander-folder-get.d.ts.map +1 -0
- package/dist/tools/commander-folder-get.js +94 -0
- package/dist/tools/commander-folder-get.js.map +1 -0
- package/dist/tools/commander-folder-list.d.ts +7 -0
- package/dist/tools/commander-folder-list.d.ts.map +1 -0
- package/dist/tools/commander-folder-list.js +96 -0
- package/dist/tools/commander-folder-list.js.map +1 -0
- package/dist/tools/commander-folder-update.d.ts +7 -0
- package/dist/tools/commander-folder-update.d.ts.map +1 -0
- package/dist/tools/commander-folder-update.js +120 -0
- package/dist/tools/commander-folder-update.js.map +1 -0
- package/dist/tools/commander-framework-apply.d.ts +7 -0
- package/dist/tools/commander-framework-apply.d.ts.map +1 -0
- package/dist/tools/commander-framework-apply.js +110 -0
- package/dist/tools/commander-framework-apply.js.map +1 -0
- package/dist/tools/commander-framework-categories.d.ts +7 -0
- package/dist/tools/commander-framework-categories.d.ts.map +1 -0
- package/dist/tools/commander-framework-categories.js +90 -0
- package/dist/tools/commander-framework-categories.js.map +1 -0
- package/dist/tools/commander-framework-get.d.ts +7 -0
- package/dist/tools/commander-framework-get.d.ts.map +1 -0
- package/dist/tools/commander-framework-get.js +124 -0
- package/dist/tools/commander-framework-get.js.map +1 -0
- package/dist/tools/commander-framework-list.d.ts +7 -0
- package/dist/tools/commander-framework-list.d.ts.map +1 -0
- package/dist/tools/commander-framework-list.js +103 -0
- package/dist/tools/commander-framework-list.js.map +1 -0
- package/dist/tools/commander-goal-create.d.ts +7 -0
- package/dist/tools/commander-goal-create.d.ts.map +1 -0
- package/dist/tools/commander-goal-create.js +130 -0
- package/dist/tools/commander-goal-create.js.map +1 -0
- package/dist/tools/commander-goal-get.d.ts +7 -0
- package/dist/tools/commander-goal-get.d.ts.map +1 -0
- package/dist/tools/commander-goal-get.js +83 -0
- package/dist/tools/commander-goal-get.js.map +1 -0
- package/dist/tools/commander-goal-list.d.ts +7 -0
- package/dist/tools/commander-goal-list.d.ts.map +1 -0
- package/dist/tools/commander-goal-list.js +111 -0
- package/dist/tools/commander-goal-list.js.map +1 -0
- package/dist/tools/commander-goal-update.d.ts +7 -0
- package/dist/tools/commander-goal-update.d.ts.map +1 -0
- package/dist/tools/commander-goal-update.js +110 -0
- package/dist/tools/commander-goal-update.js.map +1 -0
- package/dist/tools/commander-key-result-create.d.ts +7 -0
- package/dist/tools/commander-key-result-create.d.ts.map +1 -0
- package/dist/tools/commander-key-result-create.js +134 -0
- package/dist/tools/commander-key-result-create.js.map +1 -0
- package/dist/tools/commander-key-result-update.d.ts +7 -0
- package/dist/tools/commander-key-result-update.d.ts.map +1 -0
- package/dist/tools/commander-key-result-update.js +119 -0
- package/dist/tools/commander-key-result-update.js.map +1 -0
- package/dist/tools/commander-layer-create.d.ts +7 -0
- package/dist/tools/commander-layer-create.d.ts.map +1 -0
- package/dist/tools/commander-layer-create.js +167 -0
- package/dist/tools/commander-layer-create.js.map +1 -0
- package/dist/tools/commander-layer-delete.d.ts +7 -0
- package/dist/tools/commander-layer-delete.d.ts.map +1 -0
- package/dist/tools/commander-layer-delete.js +141 -0
- package/dist/tools/commander-layer-delete.js.map +1 -0
- package/dist/tools/commander-layer-list.d.ts +7 -0
- package/dist/tools/commander-layer-list.d.ts.map +1 -0
- package/dist/tools/commander-layer-list.js +102 -0
- package/dist/tools/commander-layer-list.js.map +1 -0
- package/dist/tools/commander-presentation.d.ts +7 -0
- package/dist/tools/commander-presentation.d.ts.map +1 -0
- package/dist/tools/commander-presentation.js +185 -0
- package/dist/tools/commander-presentation.js.map +1 -0
- package/dist/tools/commander-project-create.d.ts +7 -0
- package/dist/tools/commander-project-create.d.ts.map +1 -0
- package/dist/tools/commander-project-create.js +130 -0
- package/dist/tools/commander-project-create.js.map +1 -0
- package/dist/tools/commander-project-get.d.ts +7 -0
- package/dist/tools/commander-project-get.d.ts.map +1 -0
- package/dist/tools/commander-project-get.js +107 -0
- package/dist/tools/commander-project-get.js.map +1 -0
- package/dist/tools/commander-project-list.d.ts +7 -0
- package/dist/tools/commander-project-list.d.ts.map +1 -0
- package/dist/tools/commander-project-list.js +104 -0
- package/dist/tools/commander-project-list.js.map +1 -0
- package/dist/tools/commander-project-update.d.ts +7 -0
- package/dist/tools/commander-project-update.d.ts.map +1 -0
- package/dist/tools/commander-project-update.js +126 -0
- package/dist/tools/commander-project-update.js.map +1 -0
- package/dist/tools/commander-project.d.ts +7 -0
- package/dist/tools/commander-project.d.ts.map +1 -0
- package/dist/tools/commander-project.js +144 -0
- package/dist/tools/commander-project.js.map +1 -0
- package/dist/tools/commander-role-assign.d.ts +7 -0
- package/dist/tools/commander-role-assign.d.ts.map +1 -0
- package/dist/tools/commander-role-assign.js +115 -0
- package/dist/tools/commander-role-assign.js.map +1 -0
- package/dist/tools/commander-role-create.d.ts +7 -0
- package/dist/tools/commander-role-create.d.ts.map +1 -0
- package/dist/tools/commander-role-create.js +130 -0
- package/dist/tools/commander-role-create.js.map +1 -0
- package/dist/tools/commander-role-get.d.ts +7 -0
- package/dist/tools/commander-role-get.d.ts.map +1 -0
- package/dist/tools/commander-role-get.js +108 -0
- package/dist/tools/commander-role-get.js.map +1 -0
- package/dist/tools/commander-role-list.d.ts +7 -0
- package/dist/tools/commander-role-list.d.ts.map +1 -0
- package/dist/tools/commander-role-list.js +106 -0
- package/dist/tools/commander-role-list.js.map +1 -0
- package/dist/tools/commander-role-update.d.ts +7 -0
- package/dist/tools/commander-role-update.d.ts.map +1 -0
- package/dist/tools/commander-role-update.js +126 -0
- package/dist/tools/commander-role-update.js.map +1 -0
- package/dist/tools/commander-search.d.ts +7 -0
- package/dist/tools/commander-search.d.ts.map +1 -0
- package/dist/tools/commander-search.js +146 -0
- package/dist/tools/commander-search.js.map +1 -0
- package/dist/tools/commander-sheet-create.d.ts +7 -0
- package/dist/tools/commander-sheet-create.d.ts.map +1 -0
- package/dist/tools/commander-sheet-create.js +160 -0
- package/dist/tools/commander-sheet-create.js.map +1 -0
- package/dist/tools/commander-sheet-get.d.ts +7 -0
- package/dist/tools/commander-sheet-get.d.ts.map +1 -0
- package/dist/tools/commander-sheet-get.js +128 -0
- package/dist/tools/commander-sheet-get.js.map +1 -0
- package/dist/tools/commander-sheet-list.d.ts +7 -0
- package/dist/tools/commander-sheet-list.d.ts.map +1 -0
- package/dist/tools/commander-sheet-list.js +108 -0
- package/dist/tools/commander-sheet-list.js.map +1 -0
- package/dist/tools/commander-sheet-update.d.ts +7 -0
- package/dist/tools/commander-sheet-update.d.ts.map +1 -0
- package/dist/tools/commander-sheet-update.js +163 -0
- package/dist/tools/commander-sheet-update.js.map +1 -0
- package/dist/tools/commander-status-list.d.ts +7 -0
- package/dist/tools/commander-status-list.d.ts.map +1 -0
- package/dist/tools/commander-status-list.js +103 -0
- package/dist/tools/commander-status-list.js.map +1 -0
- package/dist/tools/commander-task-assign.d.ts +7 -0
- package/dist/tools/commander-task-assign.d.ts.map +1 -0
- package/dist/tools/commander-task-assign.js +91 -0
- package/dist/tools/commander-task-assign.js.map +1 -0
- package/dist/tools/commander-task-create.d.ts +7 -0
- package/dist/tools/commander-task-create.d.ts.map +1 -0
- package/dist/tools/commander-task-create.js +142 -0
- package/dist/tools/commander-task-create.js.map +1 -0
- package/dist/tools/commander-task-delete.d.ts +7 -0
- package/dist/tools/commander-task-delete.d.ts.map +1 -0
- package/dist/tools/commander-task-delete.js +88 -0
- package/dist/tools/commander-task-delete.js.map +1 -0
- package/dist/tools/commander-task-list-mine.d.ts +7 -0
- package/dist/tools/commander-task-list-mine.d.ts.map +1 -0
- package/dist/tools/commander-task-list-mine.js +109 -0
- package/dist/tools/commander-task-list-mine.js.map +1 -0
- package/dist/tools/commander-task-read.d.ts +10 -0
- package/dist/tools/commander-task-read.d.ts.map +1 -0
- package/dist/tools/commander-task-read.js +96 -0
- package/dist/tools/commander-task-read.js.map +1 -0
- package/dist/tools/commander-task-update.d.ts +7 -0
- package/dist/tools/commander-task-update.d.ts.map +1 -0
- package/dist/tools/commander-task-update.js +159 -0
- package/dist/tools/commander-task-update.js.map +1 -0
- package/dist/tools/commander-taskboard-tasks.d.ts +7 -0
- package/dist/tools/commander-taskboard-tasks.d.ts.map +1 -0
- package/dist/tools/commander-taskboard-tasks.js +97 -0
- package/dist/tools/commander-taskboard-tasks.js.map +1 -0
- package/dist/tools/commander-team-add-member.d.ts +7 -0
- package/dist/tools/commander-team-add-member.d.ts.map +1 -0
- package/dist/tools/commander-team-add-member.js +104 -0
- package/dist/tools/commander-team-add-member.js.map +1 -0
- package/dist/tools/commander-team-create.d.ts +7 -0
- package/dist/tools/commander-team-create.d.ts.map +1 -0
- package/dist/tools/commander-team-create.js +117 -0
- package/dist/tools/commander-team-create.js.map +1 -0
- package/dist/tools/commander-team-list.d.ts +7 -0
- package/dist/tools/commander-team-list.d.ts.map +1 -0
- package/dist/tools/commander-team-list.js +94 -0
- package/dist/tools/commander-team-list.js.map +1 -0
- package/dist/tools/commander-team-remove-member.d.ts +7 -0
- package/dist/tools/commander-team-remove-member.d.ts.map +1 -0
- package/dist/tools/commander-team-remove-member.js +98 -0
- package/dist/tools/commander-team-remove-member.js.map +1 -0
- package/dist/tools/commander-user-get.d.ts +7 -0
- package/dist/tools/commander-user-get.d.ts.map +1 -0
- package/dist/tools/commander-user-get.js +101 -0
- package/dist/tools/commander-user-get.js.map +1 -0
- package/dist/tools/commander-user-invite.d.ts +7 -0
- package/dist/tools/commander-user-invite.d.ts.map +1 -0
- package/dist/tools/commander-user-invite.js +119 -0
- package/dist/tools/commander-user-invite.js.map +1 -0
- package/dist/tools/commander-user-list.d.ts +7 -0
- package/dist/tools/commander-user-list.d.ts.map +1 -0
- package/dist/tools/commander-user-list.js +108 -0
- package/dist/tools/commander-user-list.js.map +1 -0
- package/dist/tools/commander-workspace-create.d.ts +7 -0
- package/dist/tools/commander-workspace-create.d.ts.map +1 -0
- package/dist/tools/commander-workspace-create.js +124 -0
- package/dist/tools/commander-workspace-create.js.map +1 -0
- package/dist/tools/commander-workspace-list.d.ts +7 -0
- package/dist/tools/commander-workspace-list.d.ts.map +1 -0
- package/dist/tools/commander-workspace-list.js +95 -0
- package/dist/tools/commander-workspace-list.js.map +1 -0
- package/dist/tools/commander-workspace-update.d.ts +7 -0
- package/dist/tools/commander-workspace-update.d.ts.map +1 -0
- package/dist/tools/commander-workspace-update.js +118 -0
- package/dist/tools/commander-workspace-update.js.map +1 -0
- package/dist/tools/commander-workspace.d.ts +7 -0
- package/dist/tools/commander-workspace.d.ts.map +1 -0
- package/dist/tools/commander-workspace.js +131 -0
- package/dist/tools/commander-workspace.js.map +1 -0
- package/dist/tools/create-kanban.d.ts +7 -0
- package/dist/tools/create-kanban.d.ts.map +1 -0
- package/dist/tools/create-kanban.js +32 -0
- package/dist/tools/create-kanban.js.map +1 -0
- package/dist/tools/create-table.d.ts +7 -0
- package/dist/tools/create-table.d.ts.map +1 -0
- package/dist/tools/create-table.js +188 -0
- package/dist/tools/create-table.js.map +1 -0
- package/dist/tools/search-knowledge.d.ts +7 -0
- package/dist/tools/search-knowledge.d.ts.map +1 -0
- package/dist/tools/search-knowledge.js +33 -0
- package/dist/tools/search-knowledge.js.map +1 -0
- package/dist/tools/waymaker-kanban-view.d.ts +7 -0
- package/dist/tools/waymaker-kanban-view.d.ts.map +1 -0
- package/dist/tools/waymaker-kanban-view.js +255 -0
- package/dist/tools/waymaker-kanban-view.js.map +1 -0
- package/dist/tools/waymaker-sync-configure.d.ts +13 -0
- package/dist/tools/waymaker-sync-configure.d.ts.map +1 -0
- package/dist/tools/waymaker-sync-configure.js +291 -0
- package/dist/tools/waymaker-sync-configure.js.map +1 -0
- package/dist/tools/waymaker-sync-file.d.ts +7 -0
- package/dist/tools/waymaker-sync-file.d.ts.map +1 -0
- package/dist/tools/waymaker-sync-file.js +79 -0
- package/dist/tools/waymaker-sync-file.js.map +1 -0
- package/dist/tools/waymaker-sync-poll.d.ts +8 -0
- package/dist/tools/waymaker-sync-poll.d.ts.map +1 -0
- package/dist/tools/waymaker-sync-poll.js +398 -0
- package/dist/tools/waymaker-sync-poll.js.map +1 -0
- package/dist/tools/waymaker-sync-start.d.ts +7 -0
- package/dist/tools/waymaker-sync-start.d.ts.map +1 -0
- package/dist/tools/waymaker-sync-start.js +56 -0
- package/dist/tools/waymaker-sync-start.js.map +1 -0
- package/dist/tools/waymaker-sync-status.d.ts +7 -0
- package/dist/tools/waymaker-sync-status.d.ts.map +1 -0
- package/dist/tools/waymaker-sync-status.js +45 -0
- package/dist/tools/waymaker-sync-status.js.map +1 -0
- package/dist/tools/waymaker-sync-stop.d.ts +7 -0
- package/dist/tools/waymaker-sync-stop.d.ts.map +1 -0
- package/dist/tools/waymaker-sync-stop.js +56 -0
- package/dist/tools/waymaker-sync-stop.js.map +1 -0
- package/dist/tools/waymaker-sync-workspace.d.ts +26 -0
- package/dist/tools/waymaker-sync-workspace.d.ts.map +1 -0
- package/dist/tools/waymaker-sync-workspace.js +148 -0
- package/dist/tools/waymaker-sync-workspace.js.map +1 -0
- package/dist/tools/waymaker-sync-workspace.tool.d.ts +9 -0
- package/dist/tools/waymaker-sync-workspace.tool.d.ts.map +1 -0
- package/dist/tools/waymaker-sync-workspace.tool.js +68 -0
- package/dist/tools/waymaker-sync-workspace.tool.js.map +1 -0
- package/dist/types/tool.d.ts +13 -0
- package/dist/types/tool.d.ts.map +1 -0
- package/dist/types/tool.js +2 -0
- package/dist/types/tool.js.map +1 -0
- package/dist/utils/daemon-health.d.ts +21 -0
- package/dist/utils/daemon-health.d.ts.map +1 -0
- package/dist/utils/daemon-health.js +40 -0
- package/dist/utils/daemon-health.js.map +1 -0
- package/dist/utils/fetch-ipv4.d.ts +36 -0
- package/dist/utils/fetch-ipv4.d.ts.map +1 -0
- package/dist/utils/fetch-ipv4.js +91 -0
- package/dist/utils/fetch-ipv4.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Waymaker Sync - Core Type Definitions
|
|
3
|
+
* Types for Trinity Architecture sync engine
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Configuration structure for .commander/config.json
|
|
7
|
+
*/
|
|
8
|
+
export interface WaymakerSyncConfig {
|
|
9
|
+
workspace_id: string;
|
|
10
|
+
project_id: string;
|
|
11
|
+
organization_id: string;
|
|
12
|
+
sync: {
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
mode: 'bidirectional' | 'ide-to-commander' | 'commander-to-ide';
|
|
15
|
+
watch_patterns: string[];
|
|
16
|
+
ignore_patterns: string[];
|
|
17
|
+
taskboard_id: string | null;
|
|
18
|
+
sync_interval_ms: number;
|
|
19
|
+
};
|
|
20
|
+
app: {
|
|
21
|
+
app_id: string | null;
|
|
22
|
+
framework: string | null;
|
|
23
|
+
build_command: string | null;
|
|
24
|
+
output_dir: string | null;
|
|
25
|
+
};
|
|
26
|
+
created_at: string;
|
|
27
|
+
updated_at: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Document types in Trinity Architecture
|
|
31
|
+
*/
|
|
32
|
+
export type DocumentType = 'epic' | 'task' | 'session' | 'pattern' | 'document';
|
|
33
|
+
/**
|
|
34
|
+
* Parsed markdown frontmatter for sync
|
|
35
|
+
*/
|
|
36
|
+
export interface MarkdownFrontmatter {
|
|
37
|
+
sync?: {
|
|
38
|
+
enabled?: boolean;
|
|
39
|
+
type?: DocumentType;
|
|
40
|
+
project?: string;
|
|
41
|
+
taskboard?: string;
|
|
42
|
+
organization_id?: string;
|
|
43
|
+
workspace_id?: string;
|
|
44
|
+
layer?: string;
|
|
45
|
+
layer_name?: string;
|
|
46
|
+
parent_layer?: string | null;
|
|
47
|
+
layer_type?: 'simple' | 'project';
|
|
48
|
+
methodology?: 'agile' | 'waterfall' | 'hybrid';
|
|
49
|
+
layer_id?: string | null;
|
|
50
|
+
board_id?: string | null;
|
|
51
|
+
task_id?: string | null;
|
|
52
|
+
document_id?: string | null;
|
|
53
|
+
last_synced?: string | null;
|
|
54
|
+
status?: string;
|
|
55
|
+
priority?: string;
|
|
56
|
+
owner?: string;
|
|
57
|
+
assignee?: string;
|
|
58
|
+
tags?: string[];
|
|
59
|
+
};
|
|
60
|
+
[key: string]: any;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Parsed markdown document
|
|
64
|
+
*/
|
|
65
|
+
export interface ParsedMarkdown {
|
|
66
|
+
frontmatter: MarkdownFrontmatter;
|
|
67
|
+
content: string;
|
|
68
|
+
checklistItems: ChecklistItem[];
|
|
69
|
+
headings: HeadingStructure[];
|
|
70
|
+
rawFrontmatter: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Checklist item extracted from markdown
|
|
74
|
+
*/
|
|
75
|
+
export interface ChecklistItem {
|
|
76
|
+
text: string;
|
|
77
|
+
completed: boolean;
|
|
78
|
+
level: number;
|
|
79
|
+
line: number;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Heading structure from markdown
|
|
83
|
+
*/
|
|
84
|
+
export interface HeadingStructure {
|
|
85
|
+
level: number;
|
|
86
|
+
text: string;
|
|
87
|
+
line: number;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* File change event from watcher
|
|
91
|
+
*/
|
|
92
|
+
export interface FileChangeEvent {
|
|
93
|
+
type: 'add' | 'change' | 'unlink' | 'move';
|
|
94
|
+
path: string;
|
|
95
|
+
oldPath?: string;
|
|
96
|
+
timestamp: Date;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Sync operation result
|
|
100
|
+
*/
|
|
101
|
+
export interface SyncResult {
|
|
102
|
+
success: boolean;
|
|
103
|
+
operation: 'create' | 'update' | 'delete' | 'skip';
|
|
104
|
+
documentType: DocumentType;
|
|
105
|
+
filePath: string;
|
|
106
|
+
commanderId?: string;
|
|
107
|
+
message: string;
|
|
108
|
+
error?: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Commander task data
|
|
112
|
+
*/
|
|
113
|
+
export interface CommanderTask {
|
|
114
|
+
id: string;
|
|
115
|
+
title: string;
|
|
116
|
+
content: string;
|
|
117
|
+
status: string;
|
|
118
|
+
priority: string | null;
|
|
119
|
+
assignee: string | null;
|
|
120
|
+
taskboard_id: string;
|
|
121
|
+
section_id: string | null;
|
|
122
|
+
metadata: Record<string, any>;
|
|
123
|
+
created_at: string;
|
|
124
|
+
updated_at: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Commander document data
|
|
128
|
+
*/
|
|
129
|
+
export interface CommanderDocument {
|
|
130
|
+
id: string;
|
|
131
|
+
title: string;
|
|
132
|
+
content: string;
|
|
133
|
+
metadata: Record<string, any>;
|
|
134
|
+
created_at: string;
|
|
135
|
+
updated_at: string;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Commander layer data
|
|
139
|
+
*/
|
|
140
|
+
export interface CommanderLayer {
|
|
141
|
+
id: string;
|
|
142
|
+
name: string;
|
|
143
|
+
description: string | null;
|
|
144
|
+
taskboard_id: string;
|
|
145
|
+
metadata: Record<string, any>;
|
|
146
|
+
created_at: string;
|
|
147
|
+
updated_at: string;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Sync state tracking
|
|
151
|
+
*/
|
|
152
|
+
export interface SyncState {
|
|
153
|
+
filePath: string;
|
|
154
|
+
lastSyncedAt: Date;
|
|
155
|
+
lastModifiedAt: Date;
|
|
156
|
+
commanderId: string | null;
|
|
157
|
+
documentType: DocumentType;
|
|
158
|
+
checksum: string;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Sync daemon status
|
|
162
|
+
*/
|
|
163
|
+
export interface SyncDaemonStatus {
|
|
164
|
+
running: boolean;
|
|
165
|
+
startedAt: Date | null;
|
|
166
|
+
filesWatched: number;
|
|
167
|
+
lastSyncAt: Date | null;
|
|
168
|
+
syncCount: number;
|
|
169
|
+
errorCount: number;
|
|
170
|
+
recentErrors: Array<{
|
|
171
|
+
timestamp: Date;
|
|
172
|
+
error: string;
|
|
173
|
+
filePath: string;
|
|
174
|
+
}>;
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAEjC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IAGxB,IAAI,EAAE;QACJ,OAAO,EAAE,OAAO,CAAC;QACjB,IAAI,EAAE,eAAe,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;QAChE,cAAc,EAAE,MAAM,EAAE,CAAC;QACzB,eAAe,EAAE,MAAM,EAAE,CAAC;QAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;IAGF,GAAG,EAAE;QACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;QAC7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;KAC3B,CAAC;IAGF,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAElC,IAAI,CAAC,EAAE;QAGL,OAAO,CAAC,EAAE,OAAO,CAAC;QAGlB,IAAI,CAAC,EAAE,YAAY,CAAC;QAEpB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,eAAe,CAAC,EAAE,MAAM,CAA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AAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,IAAI,CAAC;IACnB,cAAc,EAAE,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,KAAK,CAAC;QAClB,SAAS,EAAE,IAAI,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-framework.d.ts","sourceRoot":"","sources":["../../src/tools/apply-framework.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,kBAAkB,CAAC;AAEzD,eAAO,MAAM,kBAAkB,EAAE,IAyBhC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply Framework Tool
|
|
3
|
+
* Applies Waymaker frameworks using RAG embeddings
|
|
4
|
+
*/
|
|
5
|
+
export const applyFrameworkTool = {
|
|
6
|
+
name: 'apply_framework',
|
|
7
|
+
description: 'Apply a Waymaker framework to solve a business challenge',
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: 'object',
|
|
10
|
+
properties: {
|
|
11
|
+
frameworkType: { type: 'string' },
|
|
12
|
+
businessContext: { type: 'string' },
|
|
13
|
+
challenge: { type: 'string' },
|
|
14
|
+
},
|
|
15
|
+
required: ['frameworkType', 'challenge'],
|
|
16
|
+
},
|
|
17
|
+
async execute(args) {
|
|
18
|
+
// Placeholder - will integrate with RAG search
|
|
19
|
+
return {
|
|
20
|
+
success: true,
|
|
21
|
+
message: `Applied ${args.frameworkType} framework`,
|
|
22
|
+
data: {
|
|
23
|
+
framework: args.frameworkType,
|
|
24
|
+
challenge: args.challenge,
|
|
25
|
+
recommendations: ['Step 1', 'Step 2', 'Step 3'],
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=apply-framework.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-framework.js","sourceRoot":"","sources":["../../src/tools/apply-framework.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,kBAAkB,GAAS;IACtC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,0DAA0D;IACvE,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACjC,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACnC,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC9B;QACD,QAAQ,EAAE,CAAC,eAAe,EAAE,WAAW,CAAC;KACzC;IAED,KAAK,CAAC,OAAO,CAAC,IAAS;QACrB,+CAA+C;QAC/C,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,WAAW,IAAI,CAAC,aAAa,YAAY;YAClD,IAAI,EAAE;gBACJ,SAAS,EAAE,IAAI,CAAC,aAAa;gBAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,eAAe,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC;aAChD;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commander-comment-create.d.ts","sourceRoot":"","sources":["../../src/tools/commander-comment-create.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,kBAAkB,CAAC;AAKzD,eAAO,MAAM,0BAA0B,EAAE,IAyGxC,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commander Comment Create Tool
|
|
3
|
+
* Adds a comment to a Commander task
|
|
4
|
+
*/
|
|
5
|
+
const WAYMAKER_APPS_URL = process.env.WAYMAKER_APPS_URL || 'https://apps.waymakerone.com';
|
|
6
|
+
const WAYMAKER_API_KEY = process.env.WAYMAKER_API_KEY;
|
|
7
|
+
export const commanderCommentCreateTool = {
|
|
8
|
+
name: 'commander_comment_create',
|
|
9
|
+
description: 'Add a comment to a Commander task. Supports markdown formatting.',
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
task_id: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
description: 'The UUID of the task to comment on',
|
|
16
|
+
},
|
|
17
|
+
content: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'The comment content (supports markdown)',
|
|
20
|
+
},
|
|
21
|
+
parent_comment_id: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'Optional: ID of parent comment for threading/replies',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
required: ['task_id', 'content'],
|
|
27
|
+
},
|
|
28
|
+
async execute(args) {
|
|
29
|
+
try {
|
|
30
|
+
const { task_id, content, parent_comment_id } = args;
|
|
31
|
+
console.error('[commander_comment_create] Adding comment to task:', task_id);
|
|
32
|
+
if (!WAYMAKER_API_KEY) {
|
|
33
|
+
return {
|
|
34
|
+
success: false,
|
|
35
|
+
message: 'WAYMAKER_API_KEY environment variable not set',
|
|
36
|
+
error: 'MISSING_API_KEY',
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
if (!content || content.trim().length === 0) {
|
|
40
|
+
return {
|
|
41
|
+
success: false,
|
|
42
|
+
message: 'Comment content cannot be empty',
|
|
43
|
+
error: 'EMPTY_CONTENT',
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const response = await fetch(`${WAYMAKER_APPS_URL}/functions/v1/commander-comment-operations`, {
|
|
47
|
+
method: 'POST',
|
|
48
|
+
headers: {
|
|
49
|
+
'Authorization': `Bearer ${WAYMAKER_API_KEY}`,
|
|
50
|
+
'Content-Type': 'application/json',
|
|
51
|
+
},
|
|
52
|
+
body: JSON.stringify({
|
|
53
|
+
action: 'create',
|
|
54
|
+
task_id,
|
|
55
|
+
content,
|
|
56
|
+
parent_comment_id: parent_comment_id || null,
|
|
57
|
+
}),
|
|
58
|
+
});
|
|
59
|
+
if (!response.ok) {
|
|
60
|
+
const errorText = await response.text();
|
|
61
|
+
console.error('[commander_comment_create] Error:', response.status, errorText);
|
|
62
|
+
return {
|
|
63
|
+
success: false,
|
|
64
|
+
message: `Failed to create comment: ${response.status} ${response.statusText}`,
|
|
65
|
+
error: errorText,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const result = await response.json();
|
|
69
|
+
if (!result.success) {
|
|
70
|
+
return {
|
|
71
|
+
success: false,
|
|
72
|
+
message: result.message || 'Failed to create comment',
|
|
73
|
+
error: result.error,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
const comment = result.data?.comment;
|
|
77
|
+
console.error('[commander_comment_create] Comment created:', comment?.id);
|
|
78
|
+
return {
|
|
79
|
+
success: true,
|
|
80
|
+
message: 'Comment added successfully',
|
|
81
|
+
data: {
|
|
82
|
+
comment_id: comment?.id,
|
|
83
|
+
task_id,
|
|
84
|
+
content: comment?.content,
|
|
85
|
+
created_at: comment?.created_at,
|
|
86
|
+
is_reply: !!parent_comment_id,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
console.error('[commander_comment_create] Error:', error);
|
|
92
|
+
return {
|
|
93
|
+
success: false,
|
|
94
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
95
|
+
error: error instanceof Error ? error.stack : String(error),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=commander-comment-create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commander-comment-create.js","sourceRoot":"","sources":["../../src/tools/commander-comment-create.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,8BAA8B,CAAC;AAC1F,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,0BAA0B,GAAS;IAC9C,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,kEAAkE;IAC/E,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oCAAoC;aAClD;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yCAAyC;aACv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F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commander-comment-list.d.ts","sourceRoot":"","sources":["../../src/tools/commander-comment-list.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,kBAAkB,CAAC;AAKzD,eAAO,MAAM,wBAAwB,EAAE,IAoHtC,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commander Comment List Tool
|
|
3
|
+
* Lists all comments on a Commander task
|
|
4
|
+
*/
|
|
5
|
+
const WAYMAKER_APPS_URL = process.env.WAYMAKER_APPS_URL || 'https://apps.waymakerone.com';
|
|
6
|
+
const WAYMAKER_API_KEY = process.env.WAYMAKER_API_KEY;
|
|
7
|
+
export const commanderCommentListTool = {
|
|
8
|
+
name: 'commander_comment_list',
|
|
9
|
+
description: 'List all comments on a Commander task. Returns comments with threading structure.',
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
task_id: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
description: 'The UUID of the task to get comments for',
|
|
16
|
+
},
|
|
17
|
+
include_replies: {
|
|
18
|
+
type: 'boolean',
|
|
19
|
+
description: 'Include threaded replies (default: true)',
|
|
20
|
+
},
|
|
21
|
+
limit: {
|
|
22
|
+
type: 'number',
|
|
23
|
+
description: 'Maximum number of comments to return (default: 50)',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
required: ['task_id'],
|
|
27
|
+
},
|
|
28
|
+
async execute(args) {
|
|
29
|
+
try {
|
|
30
|
+
const { task_id, include_replies = true, limit = 50 } = args;
|
|
31
|
+
console.error('[commander_comment_list] Fetching comments for task:', task_id);
|
|
32
|
+
if (!WAYMAKER_API_KEY) {
|
|
33
|
+
return {
|
|
34
|
+
success: false,
|
|
35
|
+
message: 'WAYMAKER_API_KEY environment variable not set',
|
|
36
|
+
error: 'MISSING_API_KEY',
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const response = await fetch(`${WAYMAKER_APPS_URL}/functions/v1/commander-comment-operations`, {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
headers: {
|
|
42
|
+
'Authorization': `Bearer ${WAYMAKER_API_KEY}`,
|
|
43
|
+
'Content-Type': 'application/json',
|
|
44
|
+
},
|
|
45
|
+
body: JSON.stringify({
|
|
46
|
+
action: 'list',
|
|
47
|
+
task_id,
|
|
48
|
+
include_replies,
|
|
49
|
+
limit,
|
|
50
|
+
}),
|
|
51
|
+
});
|
|
52
|
+
if (!response.ok) {
|
|
53
|
+
const errorText = await response.text();
|
|
54
|
+
console.error('[commander_comment_list] Error:', response.status, errorText);
|
|
55
|
+
return {
|
|
56
|
+
success: false,
|
|
57
|
+
message: `Failed to fetch comments: ${response.status} ${response.statusText}`,
|
|
58
|
+
error: errorText,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const result = await response.json();
|
|
62
|
+
if (!result.success) {
|
|
63
|
+
return {
|
|
64
|
+
success: false,
|
|
65
|
+
message: result.message || 'Failed to fetch comments',
|
|
66
|
+
error: result.error,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const comments = result.data?.comments || [];
|
|
70
|
+
// Build thread hierarchy
|
|
71
|
+
const rootComments = [];
|
|
72
|
+
const commentMap = new Map();
|
|
73
|
+
// First pass: index all comments
|
|
74
|
+
for (const comment of comments) {
|
|
75
|
+
comment.replies = [];
|
|
76
|
+
commentMap.set(comment.id, comment);
|
|
77
|
+
}
|
|
78
|
+
// Second pass: build tree
|
|
79
|
+
for (const comment of comments) {
|
|
80
|
+
if (comment.parent_comment_id && commentMap.has(comment.parent_comment_id)) {
|
|
81
|
+
commentMap.get(comment.parent_comment_id).replies.push(comment);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
rootComments.push(comment);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
console.error(`[commander_comment_list] Found ${comments.length} comments`);
|
|
88
|
+
return {
|
|
89
|
+
success: true,
|
|
90
|
+
message: `Found ${comments.length} comments`,
|
|
91
|
+
data: {
|
|
92
|
+
task_id,
|
|
93
|
+
total: comments.length,
|
|
94
|
+
root_comments: rootComments.length,
|
|
95
|
+
comments: include_replies ? rootComments : comments,
|
|
96
|
+
flat_list: comments,
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
console.error('[commander_comment_list] Error:', error);
|
|
102
|
+
return {
|
|
103
|
+
success: false,
|
|
104
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
105
|
+
error: error instanceof Error ? error.stack : String(error),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=commander-comment-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commander-comment-list.js","sourceRoot":"","sources":["../../src/tools/commander-comment-list.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,8BAA8B,CAAC;AAC1F,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,wBAAwB,GAAS;IAC5C,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,mFAAmF;IAChG,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0CAA0C;aACxD;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,0CAA0C;aACxD;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oDAAoD;aAClE;SACF;QACD,QAAQ,EAAE,CAAC,SAAS,CAAC;KACtB;IAED,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AO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;YACxD,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;gBACjE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC5D,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commander-document-create.d.ts","sourceRoot":"","sources":["../../src/tools/commander-document-create.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,kBAAkB,CAAC;AAKzD,eAAO,MAAM,2BAA2B,EAAE,IAsLzC,CAAC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commander Document Create Tool
|
|
3
|
+
* Creates a new document in a Commander workspace
|
|
4
|
+
*/
|
|
5
|
+
const WAYMAKER_APPS_URL = process.env.WAYMAKER_APPS_URL || 'https://apps.waymakerone.com';
|
|
6
|
+
const WAYMAKER_API_KEY = process.env.WAYMAKER_API_KEY;
|
|
7
|
+
export const commanderDocumentCreateTool = {
|
|
8
|
+
name: 'commander_document_create',
|
|
9
|
+
description: 'Create a new document in a Commander workspace. Supports rich text content (Tiptap JSON) or plain text/markdown.',
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
workspace_id: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
description: 'The UUID of the workspace (required)',
|
|
16
|
+
},
|
|
17
|
+
title: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'Document title (required)',
|
|
20
|
+
},
|
|
21
|
+
content: {
|
|
22
|
+
type: 'object',
|
|
23
|
+
description: 'Tiptap JSON content structure (optional). Use for rich text documents.',
|
|
24
|
+
},
|
|
25
|
+
text_content: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: 'Plain text or markdown content (optional). Use for simple text documents.',
|
|
28
|
+
},
|
|
29
|
+
document_type: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
enum: ['general', 'session-brief', 'prd', 'pattern', 'runbook', 'api-doc'],
|
|
32
|
+
description: 'Document type (default: general)',
|
|
33
|
+
},
|
|
34
|
+
project_id: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: 'Project UUID to associate the document with (optional)',
|
|
37
|
+
},
|
|
38
|
+
folder_id: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'Folder UUID for placement within a project (optional)',
|
|
41
|
+
},
|
|
42
|
+
organization_id: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'Organization UUID (optional, will use workspace org if not provided)',
|
|
45
|
+
},
|
|
46
|
+
status: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
enum: ['draft', 'published'],
|
|
49
|
+
description: 'Document status (default: draft)',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
required: ['workspace_id', 'title'],
|
|
53
|
+
},
|
|
54
|
+
async execute(args) {
|
|
55
|
+
try {
|
|
56
|
+
const { workspace_id, title, content, text_content, document_type = 'general', project_id, folder_id, organization_id, status = 'draft', } = args;
|
|
57
|
+
console.error('[commander_document_create] Creating document:', title, 'in workspace:', workspace_id);
|
|
58
|
+
// Validation
|
|
59
|
+
if (!workspace_id) {
|
|
60
|
+
return {
|
|
61
|
+
success: false,
|
|
62
|
+
message: 'workspace_id is required',
|
|
63
|
+
error: 'MISSING_WORKSPACE_ID',
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (!title) {
|
|
67
|
+
return {
|
|
68
|
+
success: false,
|
|
69
|
+
message: 'title is required',
|
|
70
|
+
error: 'MISSING_TITLE',
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (!WAYMAKER_API_KEY) {
|
|
74
|
+
return {
|
|
75
|
+
success: false,
|
|
76
|
+
message: 'WAYMAKER_API_KEY environment variable not set',
|
|
77
|
+
error: 'MISSING_API_KEY',
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
// Build document data
|
|
81
|
+
const documentData = {
|
|
82
|
+
workspace_id,
|
|
83
|
+
title,
|
|
84
|
+
document_type,
|
|
85
|
+
status,
|
|
86
|
+
};
|
|
87
|
+
// Add content - prefer Tiptap JSON, fall back to text_content
|
|
88
|
+
if (content) {
|
|
89
|
+
documentData.content = content;
|
|
90
|
+
}
|
|
91
|
+
else if (text_content) {
|
|
92
|
+
// Convert plain text to Tiptap JSON structure
|
|
93
|
+
documentData.content = {
|
|
94
|
+
type: 'doc',
|
|
95
|
+
content: [
|
|
96
|
+
{
|
|
97
|
+
type: 'paragraph',
|
|
98
|
+
content: [{ type: 'text', text: text_content }],
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
};
|
|
102
|
+
documentData.text_content = text_content;
|
|
103
|
+
}
|
|
104
|
+
// Add optional fields
|
|
105
|
+
if (project_id)
|
|
106
|
+
documentData.project_id = project_id;
|
|
107
|
+
if (folder_id)
|
|
108
|
+
documentData.folder_id = folder_id;
|
|
109
|
+
if (organization_id)
|
|
110
|
+
documentData.organization_id = organization_id;
|
|
111
|
+
const response = await fetch(`${WAYMAKER_APPS_URL}/functions/v1/commander-document-operations`, {
|
|
112
|
+
method: 'POST',
|
|
113
|
+
headers: {
|
|
114
|
+
'Authorization': `Bearer ${WAYMAKER_API_KEY}`,
|
|
115
|
+
'Content-Type': 'application/json',
|
|
116
|
+
},
|
|
117
|
+
body: JSON.stringify({
|
|
118
|
+
action: 'create',
|
|
119
|
+
data: documentData,
|
|
120
|
+
}),
|
|
121
|
+
});
|
|
122
|
+
if (!response.ok) {
|
|
123
|
+
const errorText = await response.text();
|
|
124
|
+
console.error('[commander_document_create] Error:', response.status, errorText);
|
|
125
|
+
return {
|
|
126
|
+
success: false,
|
|
127
|
+
message: `Failed to create document: ${response.status} ${response.statusText}`,
|
|
128
|
+
error: errorText,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
const result = await response.json();
|
|
132
|
+
if (result.error) {
|
|
133
|
+
return {
|
|
134
|
+
success: false,
|
|
135
|
+
message: result.error || 'Failed to create document',
|
|
136
|
+
error: result.error,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
const document = result.data;
|
|
140
|
+
console.error('[commander_document_create] Document created successfully:', document?.id);
|
|
141
|
+
return {
|
|
142
|
+
success: true,
|
|
143
|
+
message: `Document "${title}" created successfully`,
|
|
144
|
+
data: {
|
|
145
|
+
document: {
|
|
146
|
+
id: document?.id,
|
|
147
|
+
title: document?.title,
|
|
148
|
+
workspace_id: document?.workspace_id,
|
|
149
|
+
project_id: document?.project_id,
|
|
150
|
+
folder_id: document?.folder_id,
|
|
151
|
+
document_type: document?.document_type,
|
|
152
|
+
status: document?.status,
|
|
153
|
+
created_at: document?.created_at,
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
console.error('[commander_document_create] Error:', error);
|
|
160
|
+
return {
|
|
161
|
+
success: false,
|
|
162
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
163
|
+
error: error instanceof Error ? error.stack : String(error),
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
//# sourceMappingURL=commander-document-create.js.map
|