ai-prompt-guide-mcp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +271 -0
- package/dist/__tests__/config-loading.test.d.ts +5 -0
- package/dist/__tests__/config-loading.test.d.ts.map +1 -0
- package/dist/__tests__/config-loading.test.js +127 -0
- package/dist/__tests__/config-loading.test.js.map +1 -0
- package/dist/__tests__/config-logging.test.d.ts +5 -0
- package/dist/__tests__/config-logging.test.d.ts.map +1 -0
- package/dist/__tests__/config-logging.test.js +146 -0
- package/dist/__tests__/config-logging.test.js.map +1 -0
- package/dist/__tests__/config-path-resolution.test.d.ts +5 -0
- package/dist/__tests__/config-path-resolution.test.d.ts.map +1 -0
- package/dist/__tests__/config-path-resolution.test.js +88 -0
- package/dist/__tests__/config-path-resolution.test.js.map +1 -0
- package/dist/__tests__/config-path-validation.test.d.ts +6 -0
- package/dist/__tests__/config-path-validation.test.d.ts.map +1 -0
- package/dist/__tests__/config-path-validation.test.js +203 -0
- package/dist/__tests__/config-path-validation.test.js.map +1 -0
- package/dist/__tests__/config-precedence.test.d.ts +5 -0
- package/dist/__tests__/config-precedence.test.d.ts.map +1 -0
- package/dist/__tests__/config-precedence.test.js +200 -0
- package/dist/__tests__/config-precedence.test.js.map +1 -0
- package/dist/__tests__/config-types.test.d.ts +5 -0
- package/dist/__tests__/config-types.test.d.ts.map +1 -0
- package/dist/__tests__/config-types.test.js +189 -0
- package/dist/__tests__/config-types.test.js.map +1 -0
- package/dist/__tests__/config.test.d.ts +5 -0
- package/dist/__tests__/config.test.d.ts.map +1 -0
- package/dist/__tests__/config.test.js +229 -0
- package/dist/__tests__/config.test.js.map +1 -0
- package/dist/config.d.ts +87 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +498 -0
- package/dist/config.js.map +1 -0
- package/dist/constants/defaults.d.ts +78 -0
- package/dist/constants/defaults.d.ts.map +1 -0
- package/dist/constants/defaults.js +78 -0
- package/dist/constants/defaults.js.map +1 -0
- package/dist/document-cache.d.ts +485 -0
- package/dist/document-cache.d.ts.map +1 -0
- package/dist/document-cache.hierarchical.test.d.ts +2 -0
- package/dist/document-cache.hierarchical.test.d.ts.map +1 -0
- package/dist/document-cache.hierarchical.test.js +243 -0
- package/dist/document-cache.hierarchical.test.js.map +1 -0
- package/dist/document-cache.js +965 -0
- package/dist/document-cache.js.map +1 -0
- package/dist/document-cache.test.d.ts +8 -0
- package/dist/document-cache.test.d.ts.map +1 -0
- package/dist/document-cache.test.js +624 -0
- package/dist/document-cache.test.js.map +1 -0
- package/dist/document-manager.d.ts +252 -0
- package/dist/document-manager.d.ts.map +1 -0
- package/dist/document-manager.js +760 -0
- package/dist/document-manager.js.map +1 -0
- package/dist/document-manager.race-condition.test.d.ts +8 -0
- package/dist/document-manager.race-condition.test.d.ts.map +1 -0
- package/dist/document-manager.race-condition.test.js +139 -0
- package/dist/document-manager.race-condition.test.js.map +1 -0
- package/dist/fingerprint-index.d.ts +177 -0
- package/dist/fingerprint-index.d.ts.map +1 -0
- package/dist/fingerprint-index.js +374 -0
- package/dist/fingerprint-index.js.map +1 -0
- package/dist/fingerprint-index.test.d.ts +15 -0
- package/dist/fingerprint-index.test.d.ts.map +1 -0
- package/dist/fingerprint-index.test.js +482 -0
- package/dist/fingerprint-index.test.js.map +1 -0
- package/dist/fsio.d.ts +76 -0
- package/dist/fsio.d.ts.map +1 -0
- package/dist/fsio.js +506 -0
- package/dist/fsio.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/markdown-tools.test.d.ts +5 -0
- package/dist/markdown-tools.test.d.ts.map +1 -0
- package/dist/markdown-tools.test.js +200 -0
- package/dist/markdown-tools.test.js.map +1 -0
- package/dist/parse.d.ts +19 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +144 -0
- package/dist/parse.js.map +1 -0
- package/dist/prompts/__tests__/prompt-loader.test.d.ts +5 -0
- package/dist/prompts/__tests__/prompt-loader.test.d.ts.map +1 -0
- package/dist/prompts/__tests__/prompt-loader.test.js +300 -0
- package/dist/prompts/__tests__/prompt-loader.test.js.map +1 -0
- package/dist/prompts/prompt-loader.d.ts +58 -0
- package/dist/prompts/prompt-loader.d.ts.map +1 -0
- package/dist/prompts/prompt-loader.js +215 -0
- package/dist/prompts/prompt-loader.js.map +1 -0
- package/dist/prompts/prompt-validator.d.ts +30 -0
- package/dist/prompts/prompt-validator.d.ts.map +1 -0
- package/dist/prompts/prompt-validator.js +65 -0
- package/dist/prompts/prompt-validator.js.map +1 -0
- package/dist/prompts/types.d.ts +46 -0
- package/dist/prompts/types.d.ts.map +1 -0
- package/dist/prompts/types.js +14 -0
- package/dist/prompts/types.js.map +1 -0
- package/dist/prompts/workflow-prompts.d.ts +42 -0
- package/dist/prompts/workflow-prompts.d.ts.map +1 -0
- package/dist/prompts/workflow-prompts.js +61 -0
- package/dist/prompts/workflow-prompts.js.map +1 -0
- package/dist/sections.d.ts +67 -0
- package/dist/sections.d.ts.map +1 -0
- package/dist/sections.hierarchical.test.d.ts +8 -0
- package/dist/sections.hierarchical.test.d.ts.map +1 -0
- package/dist/sections.hierarchical.test.js +397 -0
- package/dist/sections.hierarchical.test.js.map +1 -0
- package/dist/sections.js +1229 -0
- package/dist/sections.js.map +1 -0
- package/dist/server/default-dependencies.d.ts +134 -0
- package/dist/server/default-dependencies.d.ts.map +1 -0
- package/dist/server/default-dependencies.js +176 -0
- package/dist/server/default-dependencies.js.map +1 -0
- package/dist/server/dependencies.d.ts +161 -0
- package/dist/server/dependencies.d.ts.map +1 -0
- package/dist/server/dependencies.js +50 -0
- package/dist/server/dependencies.js.map +1 -0
- package/dist/server/index.d.ts +10 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +9 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/middleware/error-handling.d.ts +52 -0
- package/dist/server/middleware/error-handling.d.ts.map +1 -0
- package/dist/server/middleware/error-handling.js +76 -0
- package/dist/server/middleware/error-handling.js.map +1 -0
- package/dist/server/middleware/index.d.ts +7 -0
- package/dist/server/middleware/index.d.ts.map +1 -0
- package/dist/server/middleware/index.js +7 -0
- package/dist/server/middleware/index.js.map +1 -0
- package/dist/server/middleware/logging.d.ts +29 -0
- package/dist/server/middleware/logging.d.ts.map +1 -0
- package/dist/server/middleware/logging.js +49 -0
- package/dist/server/middleware/logging.js.map +1 -0
- package/dist/server/middleware/session-management.d.ts +38 -0
- package/dist/server/middleware/session-management.d.ts.map +1 -0
- package/dist/server/middleware/session-management.js +66 -0
- package/dist/server/middleware/session-management.js.map +1 -0
- package/dist/server/request-handlers/index.d.ts +5 -0
- package/dist/server/request-handlers/index.d.ts.map +1 -0
- package/dist/server/request-handlers/index.js +5 -0
- package/dist/server/request-handlers/index.js.map +1 -0
- package/dist/server/request-handlers/prompt-handlers.d.ts +13 -0
- package/dist/server/request-handlers/prompt-handlers.d.ts.map +1 -0
- package/dist/server/request-handlers/prompt-handlers.js +80 -0
- package/dist/server/request-handlers/prompt-handlers.js.map +1 -0
- package/dist/server/request-handlers/tool-handlers.d.ts +11 -0
- package/dist/server/request-handlers/tool-handlers.d.ts.map +1 -0
- package/dist/server/request-handlers/tool-handlers.js +85 -0
- package/dist/server/request-handlers/tool-handlers.js.map +1 -0
- package/dist/server/server-factory.d.ts +68 -0
- package/dist/server/server-factory.d.ts.map +1 -0
- package/dist/server/server-factory.js +135 -0
- package/dist/server/server-factory.js.map +1 -0
- package/dist/server/transport/stdio-transport.d.ts +9 -0
- package/dist/server/transport/stdio-transport.d.ts.map +1 -0
- package/dist/server/transport/stdio-transport.js +11 -0
- package/dist/server/transport/stdio-transport.js.map +1 -0
- package/dist/session/index.d.ts +5 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +7 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/session-store.d.ts +74 -0
- package/dist/session/session-store.d.ts.map +1 -0
- package/dist/session/session-store.js +150 -0
- package/dist/session/session-store.js.map +1 -0
- package/dist/session/types.d.ts +96 -0
- package/dist/session/types.d.ts.map +1 -0
- package/dist/session/types.js +9 -0
- package/dist/session/types.js.map +1 -0
- package/dist/shared/__tests__/addressing-system.batch-cache.test.d.ts +12 -0
- package/dist/shared/__tests__/addressing-system.batch-cache.test.d.ts.map +1 -0
- package/dist/shared/__tests__/addressing-system.batch-cache.test.js +306 -0
- package/dist/shared/__tests__/addressing-system.batch-cache.test.js.map +1 -0
- package/dist/shared/__tests__/addressing-system.hierarchical.test.d.ts +6 -0
- package/dist/shared/__tests__/addressing-system.hierarchical.test.d.ts.map +1 -0
- package/dist/shared/__tests__/addressing-system.hierarchical.test.js +205 -0
- package/dist/shared/__tests__/addressing-system.hierarchical.test.js.map +1 -0
- package/dist/shared/__tests__/addressing-system.lru.test.d.ts +6 -0
- package/dist/shared/__tests__/addressing-system.lru.test.d.ts.map +1 -0
- package/dist/shared/__tests__/addressing-system.lru.test.js +159 -0
- package/dist/shared/__tests__/addressing-system.lru.test.js.map +1 -0
- package/dist/shared/__tests__/addressing-system.relative-paths.test.d.ts +14 -0
- package/dist/shared/__tests__/addressing-system.relative-paths.test.d.ts.map +1 -0
- package/dist/shared/__tests__/addressing-system.relative-paths.test.js +249 -0
- package/dist/shared/__tests__/addressing-system.relative-paths.test.js.map +1 -0
- package/dist/shared/__tests__/document-analysis-enhanced.test.d.ts +9 -0
- package/dist/shared/__tests__/document-analysis-enhanced.test.d.ts.map +1 -0
- package/dist/shared/__tests__/document-analysis-enhanced.test.js +419 -0
- package/dist/shared/__tests__/document-analysis-enhanced.test.js.map +1 -0
- package/dist/shared/__tests__/document-analysis.test.d.ts +8 -0
- package/dist/shared/__tests__/document-analysis.test.d.ts.map +1 -0
- package/dist/shared/__tests__/document-analysis.test.js +904 -0
- package/dist/shared/__tests__/document-analysis.test.js.map +1 -0
- package/dist/shared/__tests__/keyword-utils-integration.test.d.ts +9 -0
- package/dist/shared/__tests__/keyword-utils-integration.test.d.ts.map +1 -0
- package/dist/shared/__tests__/keyword-utils-integration.test.js +317 -0
- package/dist/shared/__tests__/keyword-utils-integration.test.js.map +1 -0
- package/dist/shared/__tests__/link-utils.test.d.ts +5 -0
- package/dist/shared/__tests__/link-utils.test.d.ts.map +1 -0
- package/dist/shared/__tests__/link-utils.test.js +560 -0
- package/dist/shared/__tests__/link-utils.test.js.map +1 -0
- package/dist/shared/__tests__/link-validation.test.d.ts +5 -0
- package/dist/shared/__tests__/link-validation.test.d.ts.map +1 -0
- package/dist/shared/__tests__/link-validation.test.js +473 -0
- package/dist/shared/__tests__/link-validation.test.js.map +1 -0
- package/dist/shared/__tests__/reference-extractor.test.d.ts +8 -0
- package/dist/shared/__tests__/reference-extractor.test.d.ts.map +1 -0
- package/dist/shared/__tests__/reference-extractor.test.js +260 -0
- package/dist/shared/__tests__/reference-extractor.test.js.map +1 -0
- package/dist/shared/__tests__/reference-loader.test.d.ts +8 -0
- package/dist/shared/__tests__/reference-loader.test.d.ts.map +1 -0
- package/dist/shared/__tests__/reference-loader.test.js +622 -0
- package/dist/shared/__tests__/reference-loader.test.js.map +1 -0
- package/dist/shared/__tests__/section-operations.append.test.d.ts +8 -0
- package/dist/shared/__tests__/section-operations.append.test.d.ts.map +1 -0
- package/dist/shared/__tests__/section-operations.append.test.js +150 -0
- package/dist/shared/__tests__/section-operations.append.test.js.map +1 -0
- package/dist/shared/__tests__/section-operations.test.d.ts +7 -0
- package/dist/shared/__tests__/section-operations.test.d.ts.map +1 -0
- package/dist/shared/__tests__/section-operations.test.js +118 -0
- package/dist/shared/__tests__/section-operations.test.js.map +1 -0
- package/dist/shared/__tests__/slug-utils.test.d.ts +5 -0
- package/dist/shared/__tests__/slug-utils.test.d.ts.map +1 -0
- package/dist/shared/__tests__/slug-utils.test.js +542 -0
- package/dist/shared/__tests__/slug-utils.test.js.map +1 -0
- package/dist/shared/__tests__/task-operations.test.d.ts +9 -0
- package/dist/shared/__tests__/task-operations.test.d.ts.map +1 -0
- package/dist/shared/__tests__/task-operations.test.js +257 -0
- package/dist/shared/__tests__/task-operations.test.js.map +1 -0
- package/dist/shared/__tests__/task-validation.test.d.ts +6 -0
- package/dist/shared/__tests__/task-validation.test.d.ts.map +1 -0
- package/dist/shared/__tests__/task-validation.test.js +129 -0
- package/dist/shared/__tests__/task-validation.test.js.map +1 -0
- package/dist/shared/__tests__/task-view-utilities.test.d.ts +5 -0
- package/dist/shared/__tests__/task-view-utilities.test.d.ts.map +1 -0
- package/dist/shared/__tests__/task-view-utilities.test.js +312 -0
- package/dist/shared/__tests__/task-view-utilities.test.js.map +1 -0
- package/dist/shared/__tests__/tool-integration.array-validation.test.d.ts +7 -0
- package/dist/shared/__tests__/tool-integration.array-validation.test.d.ts.map +1 -0
- package/dist/shared/__tests__/tool-integration.array-validation.test.js +169 -0
- package/dist/shared/__tests__/tool-integration.array-validation.test.js.map +1 -0
- package/dist/shared/__tests__/tool-integration.hierarchical.test.d.ts +7 -0
- package/dist/shared/__tests__/tool-integration.hierarchical.test.d.ts.map +1 -0
- package/dist/shared/__tests__/tool-integration.hierarchical.test.js +204 -0
- package/dist/shared/__tests__/tool-integration.hierarchical.test.js.map +1 -0
- package/dist/shared/__tests__/workflow-prompt-utilities.test.d.ts +8 -0
- package/dist/shared/__tests__/workflow-prompt-utilities.test.d.ts.map +1 -0
- package/dist/shared/__tests__/workflow-prompt-utilities.test.js +722 -0
- package/dist/shared/__tests__/workflow-prompt-utilities.test.js.map +1 -0
- package/dist/shared/addressing-system.d.ts +799 -0
- package/dist/shared/addressing-system.d.ts.map +1 -0
- package/dist/shared/addressing-system.js +1074 -0
- package/dist/shared/addressing-system.js.map +1 -0
- package/dist/shared/document-analysis/__tests__/keyword-utils.test.d.ts +8 -0
- package/dist/shared/document-analysis/__tests__/keyword-utils.test.d.ts.map +1 -0
- package/dist/shared/document-analysis/__tests__/keyword-utils.test.js +601 -0
- package/dist/shared/document-analysis/__tests__/keyword-utils.test.js.map +1 -0
- package/dist/shared/document-analysis/index.d.ts +67 -0
- package/dist/shared/document-analysis/index.d.ts.map +1 -0
- package/dist/shared/document-analysis/index.js +166 -0
- package/dist/shared/document-analysis/index.js.map +1 -0
- package/dist/shared/document-analysis/keyword-utils.d.ts +405 -0
- package/dist/shared/document-analysis/keyword-utils.d.ts.map +1 -0
- package/dist/shared/document-analysis/keyword-utils.js +1147 -0
- package/dist/shared/document-analysis/keyword-utils.js.map +1 -0
- package/dist/shared/document-analysis/reference-validation.d.ts +27 -0
- package/dist/shared/document-analysis/reference-validation.d.ts.map +1 -0
- package/dist/shared/document-analysis/reference-validation.js +173 -0
- package/dist/shared/document-analysis/reference-validation.js.map +1 -0
- package/dist/shared/document-analysis/related-docs.d.ts +27 -0
- package/dist/shared/document-analysis/related-docs.d.ts.map +1 -0
- package/dist/shared/document-analysis/related-docs.js +459 -0
- package/dist/shared/document-analysis/related-docs.js.map +1 -0
- package/dist/shared/document-analysis/types.d.ts +89 -0
- package/dist/shared/document-analysis/types.d.ts.map +1 -0
- package/dist/shared/document-analysis/types.js +41 -0
- package/dist/shared/document-analysis/types.js.map +1 -0
- package/dist/shared/document-analysis.d.ts +15 -0
- package/dist/shared/document-analysis.d.ts.map +1 -0
- package/dist/shared/document-analysis.js +16 -0
- package/dist/shared/document-analysis.js.map +1 -0
- package/dist/shared/document-manager-factory.d.ts +32 -0
- package/dist/shared/document-manager-factory.d.ts.map +1 -0
- package/dist/shared/document-manager-factory.js +75 -0
- package/dist/shared/document-manager-factory.js.map +1 -0
- package/dist/shared/index.d.ts +5 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +7 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/link-analysis.d.ts +84 -0
- package/dist/shared/link-analysis.d.ts.map +1 -0
- package/dist/shared/link-analysis.js +213 -0
- package/dist/shared/link-analysis.js.map +1 -0
- package/dist/shared/link-context.d.ts +23 -0
- package/dist/shared/link-context.d.ts.map +1 -0
- package/dist/shared/link-context.js +172 -0
- package/dist/shared/link-context.js.map +1 -0
- package/dist/shared/link-utils.d.ts +33 -0
- package/dist/shared/link-utils.d.ts.map +1 -0
- package/dist/shared/link-utils.js +301 -0
- package/dist/shared/link-utils.js.map +1 -0
- package/dist/shared/link-validation.d.ts +79 -0
- package/dist/shared/link-validation.d.ts.map +1 -0
- package/dist/shared/link-validation.js +340 -0
- package/dist/shared/link-validation.js.map +1 -0
- package/dist/shared/namespace-analysis.d.ts +10 -0
- package/dist/shared/namespace-analysis.d.ts.map +1 -0
- package/dist/shared/namespace-analysis.js +100 -0
- package/dist/shared/namespace-analysis.js.map +1 -0
- package/dist/shared/namespace-constants.d.ts +69 -0
- package/dist/shared/namespace-constants.d.ts.map +1 -0
- package/dist/shared/namespace-constants.js +97 -0
- package/dist/shared/namespace-constants.js.map +1 -0
- package/dist/shared/path-utilities.d.ts +13 -0
- package/dist/shared/path-utilities.d.ts.map +1 -0
- package/dist/shared/path-utilities.js +39 -0
- package/dist/shared/path-utilities.js.map +1 -0
- package/dist/shared/reference-extractor.d.ts +121 -0
- package/dist/shared/reference-extractor.d.ts.map +1 -0
- package/dist/shared/reference-extractor.js +195 -0
- package/dist/shared/reference-extractor.js.map +1 -0
- package/dist/shared/reference-loader.d.ts +163 -0
- package/dist/shared/reference-loader.d.ts.map +1 -0
- package/dist/shared/reference-loader.js +265 -0
- package/dist/shared/reference-loader.js.map +1 -0
- package/dist/shared/section-operations.d.ts +14 -0
- package/dist/shared/section-operations.d.ts.map +1 -0
- package/dist/shared/section-operations.js +115 -0
- package/dist/shared/section-operations.js.map +1 -0
- package/dist/shared/slug-utils.d.ts +109 -0
- package/dist/shared/slug-utils.d.ts.map +1 -0
- package/dist/shared/slug-utils.js +302 -0
- package/dist/shared/slug-utils.js.map +1 -0
- package/dist/shared/task-operations.d.ts +152 -0
- package/dist/shared/task-operations.d.ts.map +1 -0
- package/dist/shared/task-operations.js +416 -0
- package/dist/shared/task-operations.js.map +1 -0
- package/dist/shared/task-utilities.d.ts +63 -0
- package/dist/shared/task-utilities.d.ts.map +1 -0
- package/dist/shared/task-utilities.js +86 -0
- package/dist/shared/task-utilities.js.map +1 -0
- package/dist/shared/task-validation.d.ts +50 -0
- package/dist/shared/task-validation.d.ts.map +1 -0
- package/dist/shared/task-validation.js +97 -0
- package/dist/shared/task-validation.js.map +1 -0
- package/dist/shared/task-view-utilities.d.ts +109 -0
- package/dist/shared/task-view-utilities.d.ts.map +1 -0
- package/dist/shared/task-view-utilities.js +255 -0
- package/dist/shared/task-view-utilities.js.map +1 -0
- package/dist/shared/utilities.d.ts +14 -0
- package/dist/shared/utilities.d.ts.map +1 -0
- package/dist/shared/utilities.js +23 -0
- package/dist/shared/utilities.js.map +1 -0
- package/dist/shared/utilities.test.d.ts +5 -0
- package/dist/shared/utilities.test.d.ts.map +1 -0
- package/dist/shared/utilities.test.js +422 -0
- package/dist/shared/utilities.test.js.map +1 -0
- package/dist/shared/validation-utils.d.ts +57 -0
- package/dist/shared/validation-utils.d.ts.map +1 -0
- package/dist/shared/validation-utils.js +63 -0
- package/dist/shared/validation-utils.js.map +1 -0
- package/dist/shared/workflow-prompt-utilities.d.ts +64 -0
- package/dist/shared/workflow-prompt-utilities.d.ts.map +1 -0
- package/dist/shared/workflow-prompt-utilities.js +163 -0
- package/dist/shared/workflow-prompt-utilities.js.map +1 -0
- package/dist/slug.d.ts +9 -0
- package/dist/slug.d.ts.map +1 -0
- package/dist/slug.js +40 -0
- package/dist/slug.js.map +1 -0
- package/dist/template-loader.d.ts +6 -0
- package/dist/template-loader.d.ts.map +1 -0
- package/dist/template-loader.js +8 -0
- package/dist/template-loader.js.map +1 -0
- package/dist/tools/__tests__/create-document-self-reference.test.d.ts +2 -0
- package/dist/tools/__tests__/create-document-self-reference.test.d.ts.map +1 -0
- package/dist/tools/__tests__/create-document-self-reference.test.js +124 -0
- package/dist/tools/__tests__/create-document-self-reference.test.js.map +1 -0
- package/dist/tools/__tests__/create-document-workflow-regression.test.d.ts +16 -0
- package/dist/tools/__tests__/create-document-workflow-regression.test.d.ts.map +1 -0
- package/dist/tools/__tests__/create-document-workflow-regression.test.js +655 -0
- package/dist/tools/__tests__/create-document-workflow-regression.test.js.map +1 -0
- package/dist/tools/__tests__/create-document.test.d.ts +2 -0
- package/dist/tools/__tests__/create-document.test.d.ts.map +1 -0
- package/dist/tools/__tests__/create-document.test.js +255 -0
- package/dist/tools/__tests__/create-document.test.js.map +1 -0
- package/dist/tools/__tests__/delete-document.test.d.ts +7 -0
- package/dist/tools/__tests__/delete-document.test.d.ts.map +1 -0
- package/dist/tools/__tests__/delete-document.test.js +311 -0
- package/dist/tools/__tests__/delete-document.test.js.map +1 -0
- package/dist/tools/__tests__/edit-document.test.d.ts +2 -0
- package/dist/tools/__tests__/edit-document.test.d.ts.map +1 -0
- package/dist/tools/__tests__/edit-document.test.js +644 -0
- package/dist/tools/__tests__/edit-document.test.js.map +1 -0
- package/dist/tools/__tests__/error-scenarios.test.d.ts +5 -0
- package/dist/tools/__tests__/error-scenarios.test.d.ts.map +1 -0
- package/dist/tools/__tests__/error-scenarios.test.js +105 -0
- package/dist/tools/__tests__/error-scenarios.test.js.map +1 -0
- package/dist/tools/__tests__/mocks/document-manager.mock.d.ts +99 -0
- package/dist/tools/__tests__/mocks/document-manager.mock.d.ts.map +1 -0
- package/dist/tools/__tests__/mocks/document-manager.mock.js +457 -0
- package/dist/tools/__tests__/mocks/document-manager.mock.js.map +1 -0
- package/dist/tools/__tests__/mocks/filesystem.mock.d.ts +103 -0
- package/dist/tools/__tests__/mocks/filesystem.mock.d.ts.map +1 -0
- package/dist/tools/__tests__/mocks/filesystem.mock.js +247 -0
- package/dist/tools/__tests__/mocks/filesystem.mock.js.map +1 -0
- package/dist/tools/__tests__/move-document.test.d.ts +12 -0
- package/dist/tools/__tests__/move-document.test.d.ts.map +1 -0
- package/dist/tools/__tests__/move-document.test.js +214 -0
- package/dist/tools/__tests__/move-document.test.js.map +1 -0
- package/dist/tools/__tests__/move.test.d.ts +13 -0
- package/dist/tools/__tests__/move.test.d.ts.map +1 -0
- package/dist/tools/__tests__/move.test.js +939 -0
- package/dist/tools/__tests__/move.test.js.map +1 -0
- package/dist/tools/__tests__/section.integration.improved.test.d.ts +5 -0
- package/dist/tools/__tests__/section.integration.improved.test.d.ts.map +1 -0
- package/dist/tools/__tests__/section.integration.improved.test.js +199 -0
- package/dist/tools/__tests__/section.integration.improved.test.js.map +1 -0
- package/dist/tools/__tests__/section.integration.test.d.ts +5 -0
- package/dist/tools/__tests__/section.integration.test.d.ts.map +1 -0
- package/dist/tools/__tests__/section.integration.test.js +637 -0
- package/dist/tools/__tests__/section.integration.test.js.map +1 -0
- package/dist/tools/__tests__/setup/test-environment.d.ts +111 -0
- package/dist/tools/__tests__/setup/test-environment.d.ts.map +1 -0
- package/dist/tools/__tests__/setup/test-environment.js +322 -0
- package/dist/tools/__tests__/setup/test-environment.js.map +1 -0
- package/dist/tools/__tests__/suggestion-generator.test.d.ts +8 -0
- package/dist/tools/__tests__/suggestion-generator.test.d.ts.map +1 -0
- package/dist/tools/__tests__/suggestion-generator.test.js +508 -0
- package/dist/tools/__tests__/suggestion-generator.test.js.map +1 -0
- package/dist/tools/__tests__/task-consistency.test.d.ts +11 -0
- package/dist/tools/__tests__/task-consistency.test.d.ts.map +1 -0
- package/dist/tools/__tests__/task-consistency.test.js +93 -0
- package/dist/tools/__tests__/task-consistency.test.js.map +1 -0
- package/dist/tools/__tests__/task-status-parsing.test.d.ts +15 -0
- package/dist/tools/__tests__/task-status-parsing.test.d.ts.map +1 -0
- package/dist/tools/__tests__/task-status-parsing.test.js +126 -0
- package/dist/tools/__tests__/task-status-parsing.test.js.map +1 -0
- package/dist/tools/__tests__/view-section-boundary.test.d.ts +2 -0
- package/dist/tools/__tests__/view-section-boundary.test.d.ts.map +1 -0
- package/dist/tools/__tests__/view-section-boundary.test.js +132 -0
- package/dist/tools/__tests__/view-section-boundary.test.js.map +1 -0
- package/dist/tools/__tests__/write-operations-integration.test.d.ts +8 -0
- package/dist/tools/__tests__/write-operations-integration.test.d.ts.map +1 -0
- package/dist/tools/__tests__/write-operations-integration.test.js +136 -0
- package/dist/tools/__tests__/write-operations-integration.test.js.map +1 -0
- package/dist/tools/browse/content-analyzer.d.ts +27 -0
- package/dist/tools/browse/content-analyzer.d.ts.map +1 -0
- package/dist/tools/browse/content-analyzer.js +150 -0
- package/dist/tools/browse/content-analyzer.js.map +1 -0
- package/dist/tools/browse/dependency-analyzer.d.ts +63 -0
- package/dist/tools/browse/dependency-analyzer.d.ts.map +1 -0
- package/dist/tools/browse/dependency-analyzer.js +261 -0
- package/dist/tools/browse/dependency-analyzer.js.map +1 -0
- package/dist/tools/browse/folder-navigator.d.ts +35 -0
- package/dist/tools/browse/folder-navigator.d.ts.map +1 -0
- package/dist/tools/browse/folder-navigator.js +154 -0
- package/dist/tools/browse/folder-navigator.js.map +1 -0
- package/dist/tools/browse/index.d.ts +10 -0
- package/dist/tools/browse/index.d.ts.map +1 -0
- package/dist/tools/browse/index.js +14 -0
- package/dist/tools/browse/index.js.map +1 -0
- package/dist/tools/browse/relationship-classifier.d.ts +9 -0
- package/dist/tools/browse/relationship-classifier.d.ts.map +1 -0
- package/dist/tools/browse/relationship-classifier.js +38 -0
- package/dist/tools/browse/relationship-classifier.js.map +1 -0
- package/dist/tools/browse/search-engine.d.ts +69 -0
- package/dist/tools/browse/search-engine.d.ts.map +1 -0
- package/dist/tools/browse/search-engine.js +197 -0
- package/dist/tools/browse/search-engine.js.map +1 -0
- package/dist/tools/create/__tests__/file-creator.test.d.ts +6 -0
- package/dist/tools/create/__tests__/file-creator.test.d.ts.map +1 -0
- package/dist/tools/create/__tests__/file-creator.test.js +138 -0
- package/dist/tools/create/__tests__/file-creator.test.js.map +1 -0
- package/dist/tools/create/__tests__/template-processor.test.d.ts +6 -0
- package/dist/tools/create/__tests__/template-processor.test.d.ts.map +1 -0
- package/dist/tools/create/__tests__/template-processor.test.js +130 -0
- package/dist/tools/create/__tests__/template-processor.test.js.map +1 -0
- package/dist/tools/create/file-creator.d.ts +35 -0
- package/dist/tools/create/file-creator.d.ts.map +1 -0
- package/dist/tools/create/file-creator.js +103 -0
- package/dist/tools/create/file-creator.js.map +1 -0
- package/dist/tools/create/index.d.ts +6 -0
- package/dist/tools/create/index.d.ts.map +1 -0
- package/dist/tools/create/index.js +7 -0
- package/dist/tools/create/index.js.map +1 -0
- package/dist/tools/create/pipeline.d.ts +39 -0
- package/dist/tools/create/pipeline.d.ts.map +1 -0
- package/dist/tools/create/pipeline.js +112 -0
- package/dist/tools/create/pipeline.js.map +1 -0
- package/dist/tools/create/suggestion-generator.d.ts +47 -0
- package/dist/tools/create/suggestion-generator.d.ts.map +1 -0
- package/dist/tools/create/suggestion-generator.js +51 -0
- package/dist/tools/create/suggestion-generator.js.map +1 -0
- package/dist/tools/create/template-processor.d.ts +27 -0
- package/dist/tools/create/template-processor.d.ts.map +1 -0
- package/dist/tools/create/template-processor.js +74 -0
- package/dist/tools/create/template-processor.js.map +1 -0
- package/dist/tools/create/validation-processor.d.ts +48 -0
- package/dist/tools/create/validation-processor.d.ts.map +1 -0
- package/dist/tools/create/validation-processor.js +107 -0
- package/dist/tools/create/validation-processor.js.map +1 -0
- package/dist/tools/executor.d.ts +19 -0
- package/dist/tools/executor.d.ts.map +1 -0
- package/dist/tools/executor.js +53 -0
- package/dist/tools/executor.js.map +1 -0
- package/dist/tools/implementations/__tests__/browse-documents.test.d.ts +8 -0
- package/dist/tools/implementations/__tests__/browse-documents.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/browse-documents.test.js +319 -0
- package/dist/tools/implementations/__tests__/browse-documents.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/complete-coordinator-task.test.d.ts +7 -0
- package/dist/tools/implementations/__tests__/complete-coordinator-task.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/complete-coordinator-task.test.js +440 -0
- package/dist/tools/implementations/__tests__/complete-coordinator-task.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/complete-subagent-task.test.d.ts +14 -0
- package/dist/tools/implementations/__tests__/complete-subagent-task.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/complete-subagent-task.test.js +851 -0
- package/dist/tools/implementations/__tests__/complete-subagent-task.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/complete-task-notes.test.d.ts +6 -0
- package/dist/tools/implementations/__tests__/complete-task-notes.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/complete-task-notes.test.js +157 -0
- package/dist/tools/implementations/__tests__/complete-task-notes.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/complete-task.test.d.ts +14 -0
- package/dist/tools/implementations/__tests__/complete-task.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/complete-task.test.js +867 -0
- package/dist/tools/implementations/__tests__/complete-task.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/continue-task.test.d.ts +11 -0
- package/dist/tools/implementations/__tests__/continue-task.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/continue-task.test.js +845 -0
- package/dist/tools/implementations/__tests__/continue-task.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/coordinator-task.test.d.ts +7 -0
- package/dist/tools/implementations/__tests__/coordinator-task.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/coordinator-task.test.js +495 -0
- package/dist/tools/implementations/__tests__/coordinator-task.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/get-guide.test.d.ts +8 -0
- package/dist/tools/implementations/__tests__/get-guide.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/get-guide.test.js +242 -0
- package/dist/tools/implementations/__tests__/get-guide.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/get-workflow.test.d.ts +8 -0
- package/dist/tools/implementations/__tests__/get-workflow.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/get-workflow.test.js +232 -0
- package/dist/tools/implementations/__tests__/get-workflow.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/search-documents.test.d.ts +8 -0
- package/dist/tools/implementations/__tests__/search-documents.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/search-documents.test.js +336 -0
- package/dist/tools/implementations/__tests__/search-documents.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/start-coordinator-task.test.d.ts +7 -0
- package/dist/tools/implementations/__tests__/start-coordinator-task.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/start-coordinator-task.test.js +177 -0
- package/dist/tools/implementations/__tests__/start-coordinator-task.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/start-subagent-task.test.d.ts +11 -0
- package/dist/tools/implementations/__tests__/start-subagent-task.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/start-subagent-task.test.js +846 -0
- package/dist/tools/implementations/__tests__/start-subagent-task.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/start-task.test.d.ts +11 -0
- package/dist/tools/implementations/__tests__/start-task.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/start-task.test.js +828 -0
- package/dist/tools/implementations/__tests__/start-task.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/subagent-task-batch-operations.test.d.ts +8 -0
- package/dist/tools/implementations/__tests__/subagent-task-batch-operations.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/subagent-task-batch-operations.test.js +199 -0
- package/dist/tools/implementations/__tests__/subagent-task-batch-operations.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/subagent-task.test.d.ts +7 -0
- package/dist/tools/implementations/__tests__/subagent-task.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/subagent-task.test.js +720 -0
- package/dist/tools/implementations/__tests__/subagent-task.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/task-batch-operations.test.d.ts +8 -0
- package/dist/tools/implementations/__tests__/task-batch-operations.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/task-batch-operations.test.js +200 -0
- package/dist/tools/implementations/__tests__/task-batch-operations.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/task.test.d.ts +7 -0
- package/dist/tools/implementations/__tests__/task.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/task.test.js +578 -0
- package/dist/tools/implementations/__tests__/task.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/view-coordinator-task.test.d.ts +13 -0
- package/dist/tools/implementations/__tests__/view-coordinator-task.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/view-coordinator-task.test.js +1404 -0
- package/dist/tools/implementations/__tests__/view-coordinator-task.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/view-document.linked-context.test.d.ts +8 -0
- package/dist/tools/implementations/__tests__/view-document.linked-context.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/view-document.linked-context.test.js +235 -0
- package/dist/tools/implementations/__tests__/view-document.linked-context.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/view-document.simplification.test.d.ts +9 -0
- package/dist/tools/implementations/__tests__/view-document.simplification.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/view-document.simplification.test.js +160 -0
- package/dist/tools/implementations/__tests__/view-document.simplification.test.js.map +1 -0
- package/dist/tools/implementations/__tests__/view-task.test.d.ts +12 -0
- package/dist/tools/implementations/__tests__/view-task.test.d.ts.map +1 -0
- package/dist/tools/implementations/__tests__/view-task.test.js +1158 -0
- package/dist/tools/implementations/__tests__/view-task.test.js.map +1 -0
- package/dist/tools/implementations/browse-documents.d.ts +36 -0
- package/dist/tools/implementations/browse-documents.d.ts.map +1 -0
- package/dist/tools/implementations/browse-documents.js +123 -0
- package/dist/tools/implementations/browse-documents.js.map +1 -0
- package/dist/tools/implementations/complete-coordinator-task.d.ts +53 -0
- package/dist/tools/implementations/complete-coordinator-task.d.ts.map +1 -0
- package/dist/tools/implementations/complete-coordinator-task.js +159 -0
- package/dist/tools/implementations/complete-coordinator-task.js.map +1 -0
- package/dist/tools/implementations/complete-subagent-task.d.ts +47 -0
- package/dist/tools/implementations/complete-subagent-task.d.ts.map +1 -0
- package/dist/tools/implementations/complete-subagent-task.js +141 -0
- package/dist/tools/implementations/complete-subagent-task.js.map +1 -0
- package/dist/tools/implementations/complete-task.d.ts +32 -0
- package/dist/tools/implementations/complete-task.d.ts.map +1 -0
- package/dist/tools/implementations/complete-task.hierarchical.test.d.ts +8 -0
- package/dist/tools/implementations/complete-task.hierarchical.test.d.ts.map +1 -0
- package/dist/tools/implementations/complete-task.hierarchical.test.js +363 -0
- package/dist/tools/implementations/complete-task.hierarchical.test.js.map +1 -0
- package/dist/tools/implementations/complete-task.js +122 -0
- package/dist/tools/implementations/complete-task.js.map +1 -0
- package/dist/tools/implementations/continue-task.d.ts +48 -0
- package/dist/tools/implementations/continue-task.d.ts.map +1 -0
- package/dist/tools/implementations/continue-task.js +167 -0
- package/dist/tools/implementations/continue-task.js.map +1 -0
- package/dist/tools/implementations/coordinator-task.d.ts +72 -0
- package/dist/tools/implementations/coordinator-task.d.ts.map +1 -0
- package/dist/tools/implementations/coordinator-task.js +169 -0
- package/dist/tools/implementations/coordinator-task.js.map +1 -0
- package/dist/tools/implementations/create-document.d.ts +12 -0
- package/dist/tools/implementations/create-document.d.ts.map +1 -0
- package/dist/tools/implementations/create-document.js +15 -0
- package/dist/tools/implementations/create-document.js.map +1 -0
- package/dist/tools/implementations/delete-document.d.ts +16 -0
- package/dist/tools/implementations/delete-document.d.ts.map +1 -0
- package/dist/tools/implementations/delete-document.js +70 -0
- package/dist/tools/implementations/delete-document.js.map +1 -0
- package/dist/tools/implementations/edit-document.d.ts +8 -0
- package/dist/tools/implementations/edit-document.d.ts.map +1 -0
- package/dist/tools/implementations/edit-document.js +118 -0
- package/dist/tools/implementations/edit-document.js.map +1 -0
- package/dist/tools/implementations/get-guide.d.ts +13 -0
- package/dist/tools/implementations/get-guide.d.ts.map +1 -0
- package/dist/tools/implementations/get-guide.js +64 -0
- package/dist/tools/implementations/get-guide.js.map +1 -0
- package/dist/tools/implementations/get-workflow.d.ts +12 -0
- package/dist/tools/implementations/get-workflow.d.ts.map +1 -0
- package/dist/tools/implementations/get-workflow.js +71 -0
- package/dist/tools/implementations/get-workflow.js.map +1 -0
- package/dist/tools/implementations/index.d.ts +24 -0
- package/dist/tools/implementations/index.d.ts.map +1 -0
- package/dist/tools/implementations/index.js +24 -0
- package/dist/tools/implementations/index.js.map +1 -0
- package/dist/tools/implementations/manage-document.d.ts +8 -0
- package/dist/tools/implementations/manage-document.d.ts.map +1 -0
- package/dist/tools/implementations/manage-document.js +180 -0
- package/dist/tools/implementations/manage-document.js.map +1 -0
- package/dist/tools/implementations/move-document.d.ts +12 -0
- package/dist/tools/implementations/move-document.d.ts.map +1 -0
- package/dist/tools/implementations/move-document.js +72 -0
- package/dist/tools/implementations/move-document.js.map +1 -0
- package/dist/tools/implementations/move.d.ts +24 -0
- package/dist/tools/implementations/move.d.ts.map +1 -0
- package/dist/tools/implementations/move.js +167 -0
- package/dist/tools/implementations/move.js.map +1 -0
- package/dist/tools/implementations/search-documents.d.ts +39 -0
- package/dist/tools/implementations/search-documents.d.ts.map +1 -0
- package/dist/tools/implementations/search-documents.js +246 -0
- package/dist/tools/implementations/search-documents.js.map +1 -0
- package/dist/tools/implementations/section.d.ts +42 -0
- package/dist/tools/implementations/section.d.ts.map +1 -0
- package/dist/tools/implementations/section.hierarchical.test.d.ts +8 -0
- package/dist/tools/implementations/section.hierarchical.test.d.ts.map +1 -0
- package/dist/tools/implementations/section.hierarchical.test.js +299 -0
- package/dist/tools/implementations/section.hierarchical.test.js.map +1 -0
- package/dist/tools/implementations/section.js +244 -0
- package/dist/tools/implementations/section.js.map +1 -0
- package/dist/tools/implementations/section.test.d.ts +5 -0
- package/dist/tools/implementations/section.test.d.ts.map +1 -0
- package/dist/tools/implementations/section.test.js +371 -0
- package/dist/tools/implementations/section.test.js.map +1 -0
- package/dist/tools/implementations/start-coordinator-task.d.ts +44 -0
- package/dist/tools/implementations/start-coordinator-task.d.ts.map +1 -0
- package/dist/tools/implementations/start-coordinator-task.js +125 -0
- package/dist/tools/implementations/start-coordinator-task.js.map +1 -0
- package/dist/tools/implementations/start-subagent-task.d.ts +53 -0
- package/dist/tools/implementations/start-subagent-task.d.ts.map +1 -0
- package/dist/tools/implementations/start-subagent-task.js +179 -0
- package/dist/tools/implementations/start-subagent-task.js.map +1 -0
- package/dist/tools/implementations/start-task.d.ts +48 -0
- package/dist/tools/implementations/start-task.d.ts.map +1 -0
- package/dist/tools/implementations/start-task.js +216 -0
- package/dist/tools/implementations/start-task.js.map +1 -0
- package/dist/tools/implementations/subagent-task.d.ts +98 -0
- package/dist/tools/implementations/subagent-task.d.ts.map +1 -0
- package/dist/tools/implementations/subagent-task.js +277 -0
- package/dist/tools/implementations/subagent-task.js.map +1 -0
- package/dist/tools/implementations/task.d.ts +97 -0
- package/dist/tools/implementations/task.d.ts.map +1 -0
- package/dist/tools/implementations/task.hierarchical.test.d.ts +8 -0
- package/dist/tools/implementations/task.hierarchical.test.d.ts.map +1 -0
- package/dist/tools/implementations/task.hierarchical.test.js +333 -0
- package/dist/tools/implementations/task.hierarchical.test.js.map +1 -0
- package/dist/tools/implementations/task.js +235 -0
- package/dist/tools/implementations/task.js.map +1 -0
- package/dist/tools/implementations/view-coordinator-task.d.ts +61 -0
- package/dist/tools/implementations/view-coordinator-task.d.ts.map +1 -0
- package/dist/tools/implementations/view-coordinator-task.js +295 -0
- package/dist/tools/implementations/view-coordinator-task.js.map +1 -0
- package/dist/tools/implementations/view-document.d.ts +84 -0
- package/dist/tools/implementations/view-document.d.ts.map +1 -0
- package/dist/tools/implementations/view-document.js +287 -0
- package/dist/tools/implementations/view-document.js.map +1 -0
- package/dist/tools/implementations/view-section.d.ts +28 -0
- package/dist/tools/implementations/view-section.d.ts.map +1 -0
- package/dist/tools/implementations/view-section.hierarchical.test.d.ts +8 -0
- package/dist/tools/implementations/view-section.hierarchical.test.d.ts.map +1 -0
- package/dist/tools/implementations/view-section.hierarchical.test.js +318 -0
- package/dist/tools/implementations/view-section.hierarchical.test.js.map +1 -0
- package/dist/tools/implementations/view-section.js +167 -0
- package/dist/tools/implementations/view-section.js.map +1 -0
- package/dist/tools/implementations/view-subagent-task.d.ts +46 -0
- package/dist/tools/implementations/view-subagent-task.d.ts.map +1 -0
- package/dist/tools/implementations/view-subagent-task.js +283 -0
- package/dist/tools/implementations/view-subagent-task.js.map +1 -0
- package/dist/tools/implementations/view-task.d.ts +43 -0
- package/dist/tools/implementations/view-task.d.ts.map +1 -0
- package/dist/tools/implementations/view-task.hierarchical.test.d.ts +8 -0
- package/dist/tools/implementations/view-task.hierarchical.test.d.ts.map +1 -0
- package/dist/tools/implementations/view-task.hierarchical.test.js +420 -0
- package/dist/tools/implementations/view-task.hierarchical.test.js.map +1 -0
- package/dist/tools/implementations/view-task.js +280 -0
- package/dist/tools/implementations/view-task.js.map +1 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +6 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/registry.d.ts +10 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +132 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/schemas/__tests__/get-guide-schemas.test.d.ts +8 -0
- package/dist/tools/schemas/__tests__/get-guide-schemas.test.d.ts.map +1 -0
- package/dist/tools/schemas/__tests__/get-guide-schemas.test.js +216 -0
- package/dist/tools/schemas/__tests__/get-guide-schemas.test.js.map +1 -0
- package/dist/tools/schemas/__tests__/get-workflow-schemas.test.d.ts +8 -0
- package/dist/tools/schemas/__tests__/get-workflow-schemas.test.d.ts.map +1 -0
- package/dist/tools/schemas/__tests__/get-workflow-schemas.test.js +229 -0
- package/dist/tools/schemas/__tests__/get-workflow-schemas.test.js.map +1 -0
- package/dist/tools/schemas/browse-documents-schemas.d.ts +47 -0
- package/dist/tools/schemas/browse-documents-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/browse-documents-schemas.js +48 -0
- package/dist/tools/schemas/browse-documents-schemas.js.map +1 -0
- package/dist/tools/schemas/complete-coordinator-task-schemas.d.ts +41 -0
- package/dist/tools/schemas/complete-coordinator-task-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/complete-coordinator-task-schemas.js +42 -0
- package/dist/tools/schemas/complete-coordinator-task-schemas.js.map +1 -0
- package/dist/tools/schemas/complete-subagent-task-schemas.d.ts +38 -0
- package/dist/tools/schemas/complete-subagent-task-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/complete-subagent-task-schemas.js +41 -0
- package/dist/tools/schemas/complete-subagent-task-schemas.js.map +1 -0
- package/dist/tools/schemas/complete-task-schemas.d.ts +33 -0
- package/dist/tools/schemas/complete-task-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/complete-task-schemas.js +36 -0
- package/dist/tools/schemas/complete-task-schemas.js.map +1 -0
- package/dist/tools/schemas/continue-task-schemas.d.ts +27 -0
- package/dist/tools/schemas/continue-task-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/continue-task-schemas.js +28 -0
- package/dist/tools/schemas/continue-task-schemas.js.map +1 -0
- package/dist/tools/schemas/coordinator-task-schemas.d.ts +87 -0
- package/dist/tools/schemas/coordinator-task-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/coordinator-task-schemas.js +80 -0
- package/dist/tools/schemas/coordinator-task-schemas.js.map +1 -0
- package/dist/tools/schemas/create-document-schemas.d.ts +61 -0
- package/dist/tools/schemas/create-document-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/create-document-schemas.js +143 -0
- package/dist/tools/schemas/create-document-schemas.js.map +1 -0
- package/dist/tools/schemas/delete-document-schemas.d.ts +24 -0
- package/dist/tools/schemas/delete-document-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/delete-document-schemas.js +25 -0
- package/dist/tools/schemas/delete-document-schemas.js.map +1 -0
- package/dist/tools/schemas/edit-document-schemas.d.ts +27 -0
- package/dist/tools/schemas/edit-document-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/edit-document-schemas.js +28 -0
- package/dist/tools/schemas/edit-document-schemas.js.map +1 -0
- package/dist/tools/schemas/get-guide-schemas.d.ts +35 -0
- package/dist/tools/schemas/get-guide-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/get-guide-schemas.js +66 -0
- package/dist/tools/schemas/get-guide-schemas.js.map +1 -0
- package/dist/tools/schemas/get-workflow-schemas.d.ts +35 -0
- package/dist/tools/schemas/get-workflow-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/get-workflow-schemas.js +67 -0
- package/dist/tools/schemas/get-workflow-schemas.js.map +1 -0
- package/dist/tools/schemas/manage-document-schemas.d.ts +59 -0
- package/dist/tools/schemas/manage-document-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/manage-document-schemas.js +83 -0
- package/dist/tools/schemas/manage-document-schemas.js.map +1 -0
- package/dist/tools/schemas/move-document-schemas.d.ts +25 -0
- package/dist/tools/schemas/move-document-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/move-document-schemas.js +26 -0
- package/dist/tools/schemas/move-document-schemas.js.map +1 -0
- package/dist/tools/schemas/move-schemas.d.ts +43 -0
- package/dist/tools/schemas/move-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/move-schemas.js +43 -0
- package/dist/tools/schemas/move-schemas.js.map +1 -0
- package/dist/tools/schemas/search-documents-schemas.d.ts +77 -0
- package/dist/tools/schemas/search-documents-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/search-documents-schemas.js +78 -0
- package/dist/tools/schemas/search-documents-schemas.js.map +1 -0
- package/dist/tools/schemas/section-schemas.d.ts +361 -0
- package/dist/tools/schemas/section-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/section-schemas.js +182 -0
- package/dist/tools/schemas/section-schemas.js.map +1 -0
- package/dist/tools/schemas/start-coordinator-task-schemas.d.ts +30 -0
- package/dist/tools/schemas/start-coordinator-task-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/start-coordinator-task-schemas.js +31 -0
- package/dist/tools/schemas/start-coordinator-task-schemas.js.map +1 -0
- package/dist/tools/schemas/start-subagent-task-schemas.d.ts +29 -0
- package/dist/tools/schemas/start-subagent-task-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/start-subagent-task-schemas.js +40 -0
- package/dist/tools/schemas/start-subagent-task-schemas.js.map +1 -0
- package/dist/tools/schemas/start-task-schemas.d.ts +23 -0
- package/dist/tools/schemas/start-task-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/start-task-schemas.js +39 -0
- package/dist/tools/schemas/start-task-schemas.js.map +1 -0
- package/dist/tools/schemas/subagent-task-schemas.d.ts +93 -0
- package/dist/tools/schemas/subagent-task-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/subagent-task-schemas.js +81 -0
- package/dist/tools/schemas/subagent-task-schemas.js.map +1 -0
- package/dist/tools/schemas/task-schemas.d.ts +88 -0
- package/dist/tools/schemas/task-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/task-schemas.js +80 -0
- package/dist/tools/schemas/task-schemas.js.map +1 -0
- package/dist/tools/schemas/view-coordinator-task-schemas.d.ts +27 -0
- package/dist/tools/schemas/view-coordinator-task-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/view-coordinator-task-schemas.js +46 -0
- package/dist/tools/schemas/view-coordinator-task-schemas.js.map +1 -0
- package/dist/tools/schemas/view-document-schemas.d.ts +152 -0
- package/dist/tools/schemas/view-document-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/view-document-schemas.js +70 -0
- package/dist/tools/schemas/view-document-schemas.js.map +1 -0
- package/dist/tools/schemas/view-section-schemas.d.ts +31 -0
- package/dist/tools/schemas/view-section-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/view-section-schemas.js +56 -0
- package/dist/tools/schemas/view-section-schemas.js.map +1 -0
- package/dist/tools/schemas/view-subagent-task-schemas.d.ts +31 -0
- package/dist/tools/schemas/view-subagent-task-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/view-subagent-task-schemas.js +65 -0
- package/dist/tools/schemas/view-subagent-task-schemas.js.map +1 -0
- package/dist/tools/schemas/view-task-schemas.d.ts +31 -0
- package/dist/tools/schemas/view-task-schemas.d.ts.map +1 -0
- package/dist/tools/schemas/view-task-schemas.js +62 -0
- package/dist/tools/schemas/view-task-schemas.js.map +1 -0
- package/dist/tools/types.d.ts +98 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +9 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/tools-manager.d.ts +8 -0
- package/dist/tools-manager.d.ts.map +1 -0
- package/dist/tools-manager.js +9 -0
- package/dist/tools-manager.js.map +1 -0
- package/dist/types/core.d.ts +71 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.js +5 -0
- package/dist/types/core.js.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/linking.d.ts +97 -0
- package/dist/types/linking.d.ts.map +1 -0
- package/dist/types/linking.js +5 -0
- package/dist/types/linking.js.map +1 -0
- package/dist/utils/__tests__/path-handler.archive.test.d.ts +8 -0
- package/dist/utils/__tests__/path-handler.archive.test.d.ts.map +1 -0
- package/dist/utils/__tests__/path-handler.archive.test.js +163 -0
- package/dist/utils/__tests__/path-handler.archive.test.js.map +1 -0
- package/dist/utils/error-formatter.d.ts +32 -0
- package/dist/utils/error-formatter.d.ts.map +1 -0
- package/dist/utils/error-formatter.js +79 -0
- package/dist/utils/error-formatter.js.map +1 -0
- package/dist/utils/logger.d.ts +21 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +154 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/path-handler.d.ts +52 -0
- package/dist/utils/path-handler.d.ts.map +1 -0
- package/dist/utils/path-handler.js +129 -0
- package/dist/utils/path-handler.js.map +1 -0
- package/dist/utils/security-audit-logger.d.ts +64 -0
- package/dist/utils/security-audit-logger.d.ts.map +1 -0
- package/dist/utils/security-audit-logger.js +56 -0
- package/dist/utils/security-audit-logger.js.map +1 -0
- package/dist/utils/virtual-path-resolver.d.ts +126 -0
- package/dist/utils/virtual-path-resolver.d.ts.map +1 -0
- package/dist/utils/virtual-path-resolver.js +171 -0
- package/dist/utils/virtual-path-resolver.js.map +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,1404 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for view_coordinator_task tool
|
|
3
|
+
*
|
|
4
|
+
* Tests the view_coordinator_task tool which provides passive task inspection for
|
|
5
|
+
* coordinator tasks in /coordinator/active.md, showing:
|
|
6
|
+
* - Task data with metadata (status, links, etc.)
|
|
7
|
+
* - Workflow metadata (names only, NOT full content)
|
|
8
|
+
* - Main workflow metadata (from first task)
|
|
9
|
+
* - Referenced documents (hierarchical @reference loading)
|
|
10
|
+
* - Summary statistics including workflow counts
|
|
11
|
+
*/
|
|
12
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
13
|
+
import { viewCoordinatorTask } from '../view-coordinator-task.js';
|
|
14
|
+
import { createDocumentManager } from '../../../shared/utilities.js';
|
|
15
|
+
import { DocumentNotFoundError, AddressingError } from '../../../shared/addressing-system.js';
|
|
16
|
+
import { promises as fs } from 'node:fs';
|
|
17
|
+
import path from 'node:path';
|
|
18
|
+
import os from 'node:os';
|
|
19
|
+
describe('view_coordinator_task tool', () => {
|
|
20
|
+
let manager;
|
|
21
|
+
let sessionState;
|
|
22
|
+
let tempDir;
|
|
23
|
+
beforeEach(async () => {
|
|
24
|
+
// Create temporary directory for test files
|
|
25
|
+
tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'view-coordinator-task-test-'));
|
|
26
|
+
// Configure MCP_WORKSPACE_PATH for fsio PathHandler to use temp directory
|
|
27
|
+
process.env['MCP_WORKSPACE_PATH'] = tempDir;
|
|
28
|
+
manager = createDocumentManager();
|
|
29
|
+
sessionState = {
|
|
30
|
+
sessionId: `test-${Date.now()}-${Math.random()}`,
|
|
31
|
+
createDocumentStage: 0
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
afterEach(async () => {
|
|
35
|
+
// Clean up temporary directory and all its contents
|
|
36
|
+
try {
|
|
37
|
+
await fs.rm(tempDir, { recursive: true, force: true });
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// Ignore if directory doesn't exist
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
describe('Parameter Validation', () => {
|
|
44
|
+
it('should accept overview mode (no slug parameter)', async () => {
|
|
45
|
+
// Overview mode - should return all tasks with minimal data
|
|
46
|
+
const mockDocument = {
|
|
47
|
+
content: '# Active Tasks\n\n## Tasks\n\n### Phase 1\n\n- Status: pending',
|
|
48
|
+
headings: [
|
|
49
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
50
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
51
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 }
|
|
52
|
+
],
|
|
53
|
+
sections: new Map([
|
|
54
|
+
['active-tasks', ''],
|
|
55
|
+
['tasks', ''],
|
|
56
|
+
['phase-1', '- Status: pending']
|
|
57
|
+
]),
|
|
58
|
+
metadata: {
|
|
59
|
+
path: '/coordinator/active.md',
|
|
60
|
+
title: 'Active Tasks',
|
|
61
|
+
lastModified: new Date(),
|
|
62
|
+
contentHash: 'mock-hash',
|
|
63
|
+
wordCount: 10
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
67
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue('- Status: pending');
|
|
68
|
+
const result = await viewCoordinatorTask({}, sessionState, manager);
|
|
69
|
+
expect(result).toHaveProperty('mode', 'overview');
|
|
70
|
+
});
|
|
71
|
+
it('should accept detail mode with single slug', async () => {
|
|
72
|
+
const taskContent = `### Phase 1
|
|
73
|
+
|
|
74
|
+
- Status: pending
|
|
75
|
+
|
|
76
|
+
Task content.`;
|
|
77
|
+
const mockDocument = {
|
|
78
|
+
content: `# Active Tasks\n\n## Tasks\n\n${taskContent}`,
|
|
79
|
+
headings: [
|
|
80
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
81
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
82
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 }
|
|
83
|
+
],
|
|
84
|
+
sections: new Map([
|
|
85
|
+
['active-tasks', ''],
|
|
86
|
+
['tasks', ''],
|
|
87
|
+
['phase-1', taskContent]
|
|
88
|
+
]),
|
|
89
|
+
metadata: {
|
|
90
|
+
path: '/coordinator/active.md',
|
|
91
|
+
title: 'Active Tasks',
|
|
92
|
+
lastModified: new Date(),
|
|
93
|
+
contentHash: 'mock-hash',
|
|
94
|
+
wordCount: 10
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
98
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue(taskContent);
|
|
99
|
+
const result = await viewCoordinatorTask({ slug: 'phase-1' }, sessionState, manager);
|
|
100
|
+
expect(result).toHaveProperty('mode', 'detail');
|
|
101
|
+
});
|
|
102
|
+
it('should throw error when slug is empty string', async () => {
|
|
103
|
+
await expect(viewCoordinatorTask({ slug: '' }, sessionState, manager))
|
|
104
|
+
.rejects.toThrow('slug parameter is required and must be a non-empty string');
|
|
105
|
+
});
|
|
106
|
+
it('should throw error when task count exceeds limit', async () => {
|
|
107
|
+
const tasks = Array.from({ length: 11 }, (_, i) => `phase-${i}`).join(',');
|
|
108
|
+
await expect(viewCoordinatorTask({
|
|
109
|
+
slug: tasks
|
|
110
|
+
}, sessionState, manager))
|
|
111
|
+
.rejects.toThrow();
|
|
112
|
+
});
|
|
113
|
+
it('should support comma-separated slugs', async () => {
|
|
114
|
+
const task1Content = `### Phase 1
|
|
115
|
+
|
|
116
|
+
- Status: pending
|
|
117
|
+
|
|
118
|
+
First phase.`;
|
|
119
|
+
const task2Content = `### Phase 2
|
|
120
|
+
|
|
121
|
+
- Status: pending
|
|
122
|
+
|
|
123
|
+
Second phase.`;
|
|
124
|
+
const mockDocument = {
|
|
125
|
+
content: `# Active Tasks\n\n## Tasks\n\n${task1Content}\n\n${task2Content}`,
|
|
126
|
+
headings: [
|
|
127
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
128
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
129
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 },
|
|
130
|
+
{ slug: 'phase-2', title: 'Phase 2', depth: 3 }
|
|
131
|
+
],
|
|
132
|
+
sections: new Map([
|
|
133
|
+
['active-tasks', ''],
|
|
134
|
+
['tasks', ''],
|
|
135
|
+
['phase-1', task1Content],
|
|
136
|
+
['phase-2', task2Content]
|
|
137
|
+
]),
|
|
138
|
+
metadata: {
|
|
139
|
+
path: '/coordinator/active.md',
|
|
140
|
+
title: 'Active Tasks',
|
|
141
|
+
lastModified: new Date(),
|
|
142
|
+
contentHash: 'mock-hash',
|
|
143
|
+
wordCount: 20
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
147
|
+
vi.spyOn(manager, 'getSectionContent').mockImplementation(async (_path, slug) => {
|
|
148
|
+
if (slug === 'phase-1')
|
|
149
|
+
return task1Content;
|
|
150
|
+
if (slug === 'phase-2')
|
|
151
|
+
return task2Content;
|
|
152
|
+
return null;
|
|
153
|
+
});
|
|
154
|
+
const result = await viewCoordinatorTask({ slug: 'phase-1,phase-2' }, sessionState, manager);
|
|
155
|
+
expect(result.tasks).toHaveLength(2);
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
describe('Overview Mode', () => {
|
|
159
|
+
it('should return overview of all tasks when no slug provided', async () => {
|
|
160
|
+
const task1Content = `### Phase 1
|
|
161
|
+
|
|
162
|
+
- Status: pending
|
|
163
|
+
- Workflow: multi-option-tradeoff
|
|
164
|
+
|
|
165
|
+
First phase content.`;
|
|
166
|
+
const task2Content = `### Phase 2
|
|
167
|
+
|
|
168
|
+
- Status: in_progress
|
|
169
|
+
|
|
170
|
+
Second phase content.`;
|
|
171
|
+
const task3Content = `### Phase 3
|
|
172
|
+
|
|
173
|
+
- Status: completed
|
|
174
|
+
- Workflow: simplicity-gate
|
|
175
|
+
|
|
176
|
+
Third phase content.`;
|
|
177
|
+
const mockDocument = {
|
|
178
|
+
content: `# Active Tasks\n\n## Tasks\n\n${task1Content}\n\n${task2Content}\n\n${task3Content}`,
|
|
179
|
+
headings: [
|
|
180
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
181
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
182
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 },
|
|
183
|
+
{ slug: 'phase-2', title: 'Phase 2', depth: 3 },
|
|
184
|
+
{ slug: 'phase-3', title: 'Phase 3', depth: 3 }
|
|
185
|
+
],
|
|
186
|
+
sections: new Map([
|
|
187
|
+
['active-tasks', ''],
|
|
188
|
+
['tasks', ''],
|
|
189
|
+
['phase-1', task1Content],
|
|
190
|
+
['phase-2', task2Content],
|
|
191
|
+
['phase-3', task3Content]
|
|
192
|
+
]),
|
|
193
|
+
metadata: {
|
|
194
|
+
path: '/coordinator/active.md',
|
|
195
|
+
title: 'Active Tasks',
|
|
196
|
+
lastModified: new Date(),
|
|
197
|
+
contentHash: 'mock-hash',
|
|
198
|
+
wordCount: 30
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
202
|
+
vi.spyOn(manager, 'getSectionContent').mockImplementation(async (_path, slug) => {
|
|
203
|
+
if (slug === 'phase-1')
|
|
204
|
+
return task1Content;
|
|
205
|
+
if (slug === 'phase-2')
|
|
206
|
+
return task2Content;
|
|
207
|
+
if (slug === 'phase-3')
|
|
208
|
+
return task3Content;
|
|
209
|
+
return null;
|
|
210
|
+
});
|
|
211
|
+
const result = await viewCoordinatorTask({}, sessionState, manager);
|
|
212
|
+
expect(result.mode).toBe('overview');
|
|
213
|
+
expect(result.tasks.length).toBe(3);
|
|
214
|
+
// Verify minimal data structure for each task
|
|
215
|
+
for (const task of result.tasks) {
|
|
216
|
+
expect(task).toHaveProperty('slug');
|
|
217
|
+
expect(task).toHaveProperty('title');
|
|
218
|
+
expect(task).toHaveProperty('status');
|
|
219
|
+
expect(task).toHaveProperty('depth');
|
|
220
|
+
expect(task).toHaveProperty('full_path');
|
|
221
|
+
expect(task).toHaveProperty('has_workflow');
|
|
222
|
+
// Should NOT have these fields in overview mode
|
|
223
|
+
expect(task.content).toBeUndefined();
|
|
224
|
+
expect(task.word_count).toBeUndefined();
|
|
225
|
+
}
|
|
226
|
+
// Verify specific task data
|
|
227
|
+
const firstTask = result.tasks[0];
|
|
228
|
+
const secondTask = result.tasks[1];
|
|
229
|
+
const thirdTask = result.tasks[2];
|
|
230
|
+
expect(firstTask).toBeDefined();
|
|
231
|
+
expect(firstTask?.slug).toBe('phase-1');
|
|
232
|
+
expect(firstTask?.status).toBe('pending');
|
|
233
|
+
expect(firstTask?.has_workflow).toBe(true);
|
|
234
|
+
expect(firstTask?.workflow_name).toBe('multi-option-tradeoff');
|
|
235
|
+
expect(secondTask).toBeDefined();
|
|
236
|
+
expect(secondTask?.slug).toBe('phase-2');
|
|
237
|
+
expect(secondTask?.status).toBe('in_progress');
|
|
238
|
+
expect(secondTask?.has_workflow).toBe(false);
|
|
239
|
+
expect(secondTask?.workflow_name).toBeUndefined();
|
|
240
|
+
expect(thirdTask).toBeDefined();
|
|
241
|
+
expect(thirdTask?.slug).toBe('phase-3');
|
|
242
|
+
expect(thirdTask?.status).toBe('completed');
|
|
243
|
+
expect(thirdTask?.has_workflow).toBe(true);
|
|
244
|
+
expect(thirdTask?.workflow_name).toBe('simplicity-gate');
|
|
245
|
+
// Verify summary
|
|
246
|
+
expect(result.summary.total_tasks).toBe(3);
|
|
247
|
+
expect(result.summary.tasks_with_workflows).toBe(2);
|
|
248
|
+
});
|
|
249
|
+
it('should handle empty tasks section', async () => {
|
|
250
|
+
const mockDocument = {
|
|
251
|
+
content: '# Active Tasks\n\n## Tasks\n\n<!-- No tasks yet -->',
|
|
252
|
+
headings: [
|
|
253
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
254
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 }
|
|
255
|
+
],
|
|
256
|
+
sections: new Map([
|
|
257
|
+
['active-tasks', ''],
|
|
258
|
+
['tasks', '<!-- No tasks yet -->']
|
|
259
|
+
]),
|
|
260
|
+
metadata: {
|
|
261
|
+
path: '/coordinator/active.md',
|
|
262
|
+
title: 'Active Tasks',
|
|
263
|
+
lastModified: new Date(),
|
|
264
|
+
contentHash: 'mock-hash',
|
|
265
|
+
wordCount: 5
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
269
|
+
const result = await viewCoordinatorTask({}, sessionState, manager);
|
|
270
|
+
expect(result.mode).toBe('overview');
|
|
271
|
+
expect(result.tasks).toHaveLength(0);
|
|
272
|
+
expect(result.summary.total_tasks).toBe(0);
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
describe('Detail Mode', () => {
|
|
276
|
+
it('should return full task content with single slug', async () => {
|
|
277
|
+
const taskContent = `### Phase 1
|
|
278
|
+
|
|
279
|
+
- Status: pending
|
|
280
|
+
- Workflow: multi-option-tradeoff
|
|
281
|
+
|
|
282
|
+
Implement the first phase of the project.`;
|
|
283
|
+
const mockDocument = {
|
|
284
|
+
content: `# Active Tasks\n\n## Tasks\n\n${taskContent}`,
|
|
285
|
+
headings: [
|
|
286
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
287
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
288
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 }
|
|
289
|
+
],
|
|
290
|
+
sections: new Map([
|
|
291
|
+
['active-tasks', ''],
|
|
292
|
+
['tasks', ''],
|
|
293
|
+
['phase-1', taskContent]
|
|
294
|
+
]),
|
|
295
|
+
metadata: {
|
|
296
|
+
path: '/coordinator/active.md',
|
|
297
|
+
title: 'Active Tasks',
|
|
298
|
+
lastModified: new Date(),
|
|
299
|
+
contentHash: 'mock-hash',
|
|
300
|
+
wordCount: 15
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
304
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue(taskContent);
|
|
305
|
+
const result = await viewCoordinatorTask({ slug: 'phase-1' }, sessionState, manager);
|
|
306
|
+
expect(result.mode).toBe('detail');
|
|
307
|
+
expect(result.tasks).toHaveLength(1);
|
|
308
|
+
const task = result.tasks[0];
|
|
309
|
+
expect(task).toHaveProperty('slug', 'phase-1');
|
|
310
|
+
expect(task).toHaveProperty('title', 'Phase 1');
|
|
311
|
+
expect(task).toHaveProperty('content');
|
|
312
|
+
expect(task).toHaveProperty('status', 'pending');
|
|
313
|
+
expect(task).toHaveProperty('workflow_name', 'multi-option-tradeoff');
|
|
314
|
+
expect(task).toHaveProperty('has_workflow', true);
|
|
315
|
+
expect(task).toHaveProperty('word_count');
|
|
316
|
+
});
|
|
317
|
+
it('should support comma-separated slugs for multiple tasks', async () => {
|
|
318
|
+
const task1Content = `### Phase 1
|
|
319
|
+
|
|
320
|
+
- Status: pending
|
|
321
|
+
- Workflow: multi-option-tradeoff
|
|
322
|
+
|
|
323
|
+
First phase.`;
|
|
324
|
+
const task2Content = `### Phase 2
|
|
325
|
+
|
|
326
|
+
- Status: in_progress
|
|
327
|
+
|
|
328
|
+
Second phase.`;
|
|
329
|
+
const mockDocument = {
|
|
330
|
+
content: `# Active Tasks\n\n## Tasks\n\n${task1Content}\n\n${task2Content}`,
|
|
331
|
+
headings: [
|
|
332
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
333
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
334
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 },
|
|
335
|
+
{ slug: 'phase-2', title: 'Phase 2', depth: 3 }
|
|
336
|
+
],
|
|
337
|
+
sections: new Map([
|
|
338
|
+
['active-tasks', ''],
|
|
339
|
+
['tasks', ''],
|
|
340
|
+
['phase-1', task1Content],
|
|
341
|
+
['phase-2', task2Content]
|
|
342
|
+
]),
|
|
343
|
+
metadata: {
|
|
344
|
+
path: '/coordinator/active.md',
|
|
345
|
+
title: 'Active Tasks',
|
|
346
|
+
lastModified: new Date(),
|
|
347
|
+
contentHash: 'mock-hash',
|
|
348
|
+
wordCount: 20
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
352
|
+
vi.spyOn(manager, 'getSectionContent').mockImplementation(async (_path, slug) => {
|
|
353
|
+
if (slug === 'phase-1')
|
|
354
|
+
return task1Content;
|
|
355
|
+
if (slug === 'phase-2')
|
|
356
|
+
return task2Content;
|
|
357
|
+
return null;
|
|
358
|
+
});
|
|
359
|
+
const result = await viewCoordinatorTask({ slug: 'phase-1,phase-2' }, sessionState, manager);
|
|
360
|
+
expect(result.mode).toBe('detail');
|
|
361
|
+
expect(result.tasks).toHaveLength(2);
|
|
362
|
+
expect(result.summary.total_tasks).toBe(2);
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
describe('Document and Task Resolution', () => {
|
|
366
|
+
it('should throw DocumentNotFoundError when document does not exist', async () => {
|
|
367
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(null);
|
|
368
|
+
await expect(viewCoordinatorTask({
|
|
369
|
+
slug: 'some-task'
|
|
370
|
+
}, sessionState, manager))
|
|
371
|
+
.rejects.toThrow(DocumentNotFoundError);
|
|
372
|
+
});
|
|
373
|
+
it('should throw error when document has no tasks section', async () => {
|
|
374
|
+
const mockDocument = {
|
|
375
|
+
content: '# Document\n\nNo tasks here',
|
|
376
|
+
headings: [
|
|
377
|
+
{ slug: 'document', title: 'Document', depth: 1 }
|
|
378
|
+
],
|
|
379
|
+
sections: new Map([
|
|
380
|
+
['document', 'No tasks here']
|
|
381
|
+
]),
|
|
382
|
+
metadata: {
|
|
383
|
+
path: '/coordinator/active.md',
|
|
384
|
+
title: 'Document',
|
|
385
|
+
lastModified: new Date(),
|
|
386
|
+
contentHash: 'mock-hash',
|
|
387
|
+
wordCount: 3
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
391
|
+
await expect(viewCoordinatorTask({
|
|
392
|
+
slug: 'some-task'
|
|
393
|
+
}, sessionState, manager))
|
|
394
|
+
.rejects.toThrow(AddressingError);
|
|
395
|
+
});
|
|
396
|
+
it('should throw error when task not found in document', async () => {
|
|
397
|
+
const mockDocument = {
|
|
398
|
+
content: '# Active Tasks\n\n## Tasks\n\n### Other Task\n\nContent',
|
|
399
|
+
headings: [
|
|
400
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
401
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
402
|
+
{ slug: 'other-task', title: 'Other Task', depth: 3 }
|
|
403
|
+
],
|
|
404
|
+
sections: new Map([
|
|
405
|
+
['active-tasks', ''],
|
|
406
|
+
['tasks', ''],
|
|
407
|
+
['other-task', 'Content']
|
|
408
|
+
]),
|
|
409
|
+
metadata: {
|
|
410
|
+
path: '/coordinator/active.md',
|
|
411
|
+
title: 'Active Tasks',
|
|
412
|
+
lastModified: new Date(),
|
|
413
|
+
contentHash: 'mock-hash',
|
|
414
|
+
wordCount: 5
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
418
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue(null);
|
|
419
|
+
await expect(viewCoordinatorTask({
|
|
420
|
+
slug: 'missing-task'
|
|
421
|
+
}, sessionState, manager))
|
|
422
|
+
.rejects.toThrow(AddressingError);
|
|
423
|
+
});
|
|
424
|
+
it('should throw error when section exists but is not a task', async () => {
|
|
425
|
+
const mockDocument = {
|
|
426
|
+
content: '# Active Tasks\n\n## Overview\n\nNot a task\n\n## Tasks\n\n### Real Task',
|
|
427
|
+
headings: [
|
|
428
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
429
|
+
{ slug: 'overview', title: 'Overview', depth: 2 },
|
|
430
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
431
|
+
{ slug: 'real-task', title: 'Real Task', depth: 3 }
|
|
432
|
+
],
|
|
433
|
+
sections: new Map([
|
|
434
|
+
['active-tasks', ''],
|
|
435
|
+
['overview', 'Not a task'],
|
|
436
|
+
['tasks', ''],
|
|
437
|
+
['real-task', 'Task content']
|
|
438
|
+
]),
|
|
439
|
+
metadata: {
|
|
440
|
+
path: '/coordinator/active.md',
|
|
441
|
+
title: 'Active Tasks',
|
|
442
|
+
lastModified: new Date(),
|
|
443
|
+
contentHash: 'mock-hash',
|
|
444
|
+
wordCount: 10
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
448
|
+
await expect(viewCoordinatorTask({
|
|
449
|
+
slug: 'overview'
|
|
450
|
+
}, sessionState, manager))
|
|
451
|
+
.rejects.toThrow(AddressingError);
|
|
452
|
+
});
|
|
453
|
+
});
|
|
454
|
+
describe('Workflow Metadata Extraction', () => {
|
|
455
|
+
it('should return workflow_name when task has Workflow field', async () => {
|
|
456
|
+
const taskContent = `### Phase 1
|
|
457
|
+
|
|
458
|
+
- Status: pending
|
|
459
|
+
- Workflow: multi-option-tradeoff
|
|
460
|
+
|
|
461
|
+
Task content here.`;
|
|
462
|
+
const mockDocument = {
|
|
463
|
+
content: `# Active Tasks\n\n## Tasks\n\n${taskContent}`,
|
|
464
|
+
headings: [
|
|
465
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
466
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
467
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 }
|
|
468
|
+
],
|
|
469
|
+
sections: new Map([
|
|
470
|
+
['active-tasks', ''],
|
|
471
|
+
['tasks', ''],
|
|
472
|
+
['phase-1', taskContent]
|
|
473
|
+
]),
|
|
474
|
+
metadata: {
|
|
475
|
+
path: '/coordinator/active.md',
|
|
476
|
+
title: 'Active Tasks',
|
|
477
|
+
lastModified: new Date(),
|
|
478
|
+
contentHash: 'hash',
|
|
479
|
+
wordCount: 10
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
483
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue(taskContent);
|
|
484
|
+
const result = await viewCoordinatorTask({
|
|
485
|
+
slug: 'phase-1'
|
|
486
|
+
}, sessionState, manager);
|
|
487
|
+
expect(result.tasks).toHaveLength(1);
|
|
488
|
+
expect(result.tasks[0]).toHaveProperty('workflow_name', 'multi-option-tradeoff');
|
|
489
|
+
expect(result.tasks[0]).toHaveProperty('has_workflow', true);
|
|
490
|
+
// Ensure NO full workflow object (that's for start_task only)
|
|
491
|
+
expect(result.tasks[0]).not.toHaveProperty('workflow');
|
|
492
|
+
});
|
|
493
|
+
it('should not return workflow_name when task has no Workflow field', async () => {
|
|
494
|
+
const taskContent = `### Simple Task
|
|
495
|
+
|
|
496
|
+
- Status: pending
|
|
497
|
+
|
|
498
|
+
No workflow here.`;
|
|
499
|
+
const mockDocument = {
|
|
500
|
+
content: `# Active Tasks\n\n## Tasks\n\n${taskContent}`,
|
|
501
|
+
headings: [
|
|
502
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
503
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
504
|
+
{ slug: 'simple-task', title: 'Simple Task', depth: 3 }
|
|
505
|
+
],
|
|
506
|
+
sections: new Map([
|
|
507
|
+
['active-tasks', ''],
|
|
508
|
+
['tasks', ''],
|
|
509
|
+
['simple-task', taskContent]
|
|
510
|
+
]),
|
|
511
|
+
metadata: {
|
|
512
|
+
path: '/coordinator/active.md',
|
|
513
|
+
title: 'Active Tasks',
|
|
514
|
+
lastModified: new Date(),
|
|
515
|
+
contentHash: 'hash',
|
|
516
|
+
wordCount: 8
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
520
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue(taskContent);
|
|
521
|
+
const result = await viewCoordinatorTask({
|
|
522
|
+
slug: 'simple-task'
|
|
523
|
+
}, sessionState, manager);
|
|
524
|
+
expect(result.tasks[0]).not.toHaveProperty('workflow_name');
|
|
525
|
+
expect(result.tasks[0]).toHaveProperty('has_workflow', false);
|
|
526
|
+
});
|
|
527
|
+
it('should not return workflow_name when Workflow field is empty', async () => {
|
|
528
|
+
const taskContent = `### Task with Empty Workflow
|
|
529
|
+
|
|
530
|
+
- Status: pending
|
|
531
|
+
- Workflow:
|
|
532
|
+
|
|
533
|
+
Empty workflow field.`;
|
|
534
|
+
const mockDocument = {
|
|
535
|
+
content: `# Active Tasks\n\n## Tasks\n\n${taskContent}`,
|
|
536
|
+
headings: [
|
|
537
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
538
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
539
|
+
{ slug: 'task-with-empty-workflow', title: 'Task with Empty Workflow', depth: 3 }
|
|
540
|
+
],
|
|
541
|
+
sections: new Map([
|
|
542
|
+
['active-tasks', ''],
|
|
543
|
+
['tasks', ''],
|
|
544
|
+
['task-with-empty-workflow', taskContent]
|
|
545
|
+
]),
|
|
546
|
+
metadata: {
|
|
547
|
+
path: '/coordinator/active.md',
|
|
548
|
+
title: 'Active Tasks',
|
|
549
|
+
lastModified: new Date(),
|
|
550
|
+
contentHash: 'hash',
|
|
551
|
+
wordCount: 9
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
555
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue(taskContent);
|
|
556
|
+
const result = await viewCoordinatorTask({
|
|
557
|
+
slug: 'task-with-empty-workflow'
|
|
558
|
+
}, sessionState, manager);
|
|
559
|
+
expect(result.tasks[0]).not.toHaveProperty('workflow_name');
|
|
560
|
+
expect(result.tasks[0]).toHaveProperty('has_workflow', false);
|
|
561
|
+
});
|
|
562
|
+
it('should handle multiple tasks with different workflow states', async () => {
|
|
563
|
+
const task1Content = `### Phase with Workflow
|
|
564
|
+
|
|
565
|
+
- Status: pending
|
|
566
|
+
- Workflow: multi-option-tradeoff
|
|
567
|
+
|
|
568
|
+
Has workflow.`;
|
|
569
|
+
const task2Content = `### Phase without Workflow
|
|
570
|
+
|
|
571
|
+
- Status: pending
|
|
572
|
+
|
|
573
|
+
No workflow.`;
|
|
574
|
+
const task3Content = `### Phase with Empty Workflow
|
|
575
|
+
|
|
576
|
+
- Status: pending
|
|
577
|
+
- Workflow:
|
|
578
|
+
|
|
579
|
+
Empty workflow.`;
|
|
580
|
+
const mockDocument = {
|
|
581
|
+
content: `# Active Tasks\n\n## Tasks\n\n${task1Content}\n\n${task2Content}\n\n${task3Content}`,
|
|
582
|
+
headings: [
|
|
583
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
584
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
585
|
+
{ slug: 'phase-with-workflow', title: 'Phase with Workflow', depth: 3 },
|
|
586
|
+
{ slug: 'phase-without-workflow', title: 'Phase without Workflow', depth: 3 },
|
|
587
|
+
{ slug: 'phase-with-empty-workflow', title: 'Phase with Empty Workflow', depth: 3 }
|
|
588
|
+
],
|
|
589
|
+
sections: new Map([
|
|
590
|
+
['active-tasks', ''],
|
|
591
|
+
['tasks', ''],
|
|
592
|
+
['phase-with-workflow', task1Content],
|
|
593
|
+
['phase-without-workflow', task2Content],
|
|
594
|
+
['phase-with-empty-workflow', task3Content]
|
|
595
|
+
]),
|
|
596
|
+
metadata: {
|
|
597
|
+
path: '/coordinator/active.md',
|
|
598
|
+
title: 'Active Tasks',
|
|
599
|
+
lastModified: new Date(),
|
|
600
|
+
contentHash: 'hash',
|
|
601
|
+
wordCount: 30
|
|
602
|
+
}
|
|
603
|
+
};
|
|
604
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
605
|
+
vi.spyOn(manager, 'getSectionContent').mockImplementation(async (_path, slug) => {
|
|
606
|
+
if (slug === 'phase-with-workflow')
|
|
607
|
+
return task1Content;
|
|
608
|
+
if (slug === 'phase-without-workflow')
|
|
609
|
+
return task2Content;
|
|
610
|
+
if (slug === 'phase-with-empty-workflow')
|
|
611
|
+
return task3Content;
|
|
612
|
+
return null;
|
|
613
|
+
});
|
|
614
|
+
const result = await viewCoordinatorTask({
|
|
615
|
+
slug: 'phase-with-workflow,phase-without-workflow,phase-with-empty-workflow'
|
|
616
|
+
}, sessionState, manager);
|
|
617
|
+
expect(result.tasks).toHaveLength(3);
|
|
618
|
+
// Task 1: Has workflow
|
|
619
|
+
expect(result.tasks[0]).toHaveProperty('workflow_name', 'multi-option-tradeoff');
|
|
620
|
+
expect(result.tasks[0]).toHaveProperty('has_workflow', true);
|
|
621
|
+
// Task 2: No workflow field
|
|
622
|
+
expect(result.tasks[1]).not.toHaveProperty('workflow_name');
|
|
623
|
+
expect(result.tasks[1]).toHaveProperty('has_workflow', false);
|
|
624
|
+
// Task 3: Empty workflow field
|
|
625
|
+
expect(result.tasks[2]).not.toHaveProperty('workflow_name');
|
|
626
|
+
expect(result.tasks[2]).toHaveProperty('has_workflow', false);
|
|
627
|
+
});
|
|
628
|
+
});
|
|
629
|
+
describe('Main Workflow Metadata', () => {
|
|
630
|
+
it('should return main_workflow_name when first task has Main-Workflow', async () => {
|
|
631
|
+
const firstTaskContent = `### Phase 1
|
|
632
|
+
|
|
633
|
+
- Status: pending
|
|
634
|
+
- Main-Workflow: spec-first-integration
|
|
635
|
+
- Workflow: multi-option-tradeoff
|
|
636
|
+
|
|
637
|
+
First phase content.`;
|
|
638
|
+
const secondTaskContent = `### Phase 2
|
|
639
|
+
|
|
640
|
+
- Status: pending
|
|
641
|
+
|
|
642
|
+
Second phase content.`;
|
|
643
|
+
const mockDocument = {
|
|
644
|
+
content: `# Active Tasks\n\n## Tasks\n\n${firstTaskContent}\n\n${secondTaskContent}`,
|
|
645
|
+
headings: [
|
|
646
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
647
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
648
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 },
|
|
649
|
+
{ slug: 'phase-2', title: 'Phase 2', depth: 3 }
|
|
650
|
+
],
|
|
651
|
+
sections: new Map([
|
|
652
|
+
['active-tasks', ''],
|
|
653
|
+
['tasks', ''],
|
|
654
|
+
['phase-1', firstTaskContent],
|
|
655
|
+
['phase-2', secondTaskContent]
|
|
656
|
+
]),
|
|
657
|
+
metadata: {
|
|
658
|
+
path: '/coordinator/active.md',
|
|
659
|
+
title: 'Active Tasks',
|
|
660
|
+
lastModified: new Date(),
|
|
661
|
+
contentHash: 'hash',
|
|
662
|
+
wordCount: 20
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
666
|
+
vi.spyOn(manager, 'getSectionContent').mockImplementation(async (_path, slug) => {
|
|
667
|
+
if (slug === 'phase-1')
|
|
668
|
+
return firstTaskContent;
|
|
669
|
+
if (slug === 'phase-2')
|
|
670
|
+
return secondTaskContent;
|
|
671
|
+
return null;
|
|
672
|
+
});
|
|
673
|
+
const result = await viewCoordinatorTask({
|
|
674
|
+
slug: 'phase-1,phase-2'
|
|
675
|
+
}, sessionState, manager);
|
|
676
|
+
// Both tasks should have main_workflow_name
|
|
677
|
+
expect(result.tasks[0]).toHaveProperty('main_workflow_name', 'spec-first-integration');
|
|
678
|
+
expect(result.tasks[1]).toHaveProperty('main_workflow_name', 'spec-first-integration');
|
|
679
|
+
// Ensure NO full main_workflow object
|
|
680
|
+
expect(result.tasks[0]).not.toHaveProperty('main_workflow');
|
|
681
|
+
expect(result.tasks[1]).not.toHaveProperty('main_workflow');
|
|
682
|
+
});
|
|
683
|
+
it('should not return main_workflow_name when first task has no Main-Workflow', async () => {
|
|
684
|
+
const firstTaskContent = `### Phase 1
|
|
685
|
+
|
|
686
|
+
- Status: pending
|
|
687
|
+
- Workflow: multi-option-tradeoff
|
|
688
|
+
|
|
689
|
+
First phase without main workflow.`;
|
|
690
|
+
const secondTaskContent = `### Phase 2
|
|
691
|
+
|
|
692
|
+
- Status: pending
|
|
693
|
+
|
|
694
|
+
Second phase.`;
|
|
695
|
+
const mockDocument = {
|
|
696
|
+
content: `# Active Tasks\n\n## Tasks\n\n${firstTaskContent}\n\n${secondTaskContent}`,
|
|
697
|
+
headings: [
|
|
698
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
699
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
700
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 },
|
|
701
|
+
{ slug: 'phase-2', title: 'Phase 2', depth: 3 }
|
|
702
|
+
],
|
|
703
|
+
sections: new Map([
|
|
704
|
+
['active-tasks', ''],
|
|
705
|
+
['tasks', ''],
|
|
706
|
+
['phase-1', firstTaskContent],
|
|
707
|
+
['phase-2', secondTaskContent]
|
|
708
|
+
]),
|
|
709
|
+
metadata: {
|
|
710
|
+
path: '/coordinator/active.md',
|
|
711
|
+
title: 'Active Tasks',
|
|
712
|
+
lastModified: new Date(),
|
|
713
|
+
contentHash: 'hash',
|
|
714
|
+
wordCount: 18
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
718
|
+
vi.spyOn(manager, 'getSectionContent').mockImplementation(async (_path, slug) => {
|
|
719
|
+
if (slug === 'phase-1')
|
|
720
|
+
return firstTaskContent;
|
|
721
|
+
if (slug === 'phase-2')
|
|
722
|
+
return secondTaskContent;
|
|
723
|
+
return null;
|
|
724
|
+
});
|
|
725
|
+
const result = await viewCoordinatorTask({
|
|
726
|
+
slug: 'phase-1,phase-2'
|
|
727
|
+
}, sessionState, manager);
|
|
728
|
+
// Neither task should have main_workflow_name
|
|
729
|
+
expect(result.tasks[0]).not.toHaveProperty('main_workflow_name');
|
|
730
|
+
expect(result.tasks[1]).not.toHaveProperty('main_workflow_name');
|
|
731
|
+
});
|
|
732
|
+
it('should not return main_workflow_name when Main-Workflow field is empty', async () => {
|
|
733
|
+
const firstTaskContent = `### Phase 1
|
|
734
|
+
|
|
735
|
+
- Status: pending
|
|
736
|
+
- Main-Workflow:
|
|
737
|
+
|
|
738
|
+
Empty main workflow field.`;
|
|
739
|
+
const mockDocument = {
|
|
740
|
+
content: `# Active Tasks\n\n## Tasks\n\n${firstTaskContent}`,
|
|
741
|
+
headings: [
|
|
742
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
743
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
744
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 }
|
|
745
|
+
],
|
|
746
|
+
sections: new Map([
|
|
747
|
+
['active-tasks', ''],
|
|
748
|
+
['tasks', ''],
|
|
749
|
+
['phase-1', firstTaskContent]
|
|
750
|
+
]),
|
|
751
|
+
metadata: {
|
|
752
|
+
path: '/coordinator/active.md',
|
|
753
|
+
title: 'Active Tasks',
|
|
754
|
+
lastModified: new Date(),
|
|
755
|
+
contentHash: 'hash',
|
|
756
|
+
wordCount: 10
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
760
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue(firstTaskContent);
|
|
761
|
+
const result = await viewCoordinatorTask({
|
|
762
|
+
slug: 'phase-1'
|
|
763
|
+
}, sessionState, manager);
|
|
764
|
+
expect(result.tasks[0]).not.toHaveProperty('main_workflow_name');
|
|
765
|
+
});
|
|
766
|
+
it('should handle viewing single task with main workflow context', async () => {
|
|
767
|
+
const firstTaskContent = `### Phase 1
|
|
768
|
+
|
|
769
|
+
- Status: pending
|
|
770
|
+
- Main-Workflow: spec-first-integration
|
|
771
|
+
|
|
772
|
+
First phase.`;
|
|
773
|
+
const secondTaskContent = `### Phase 2
|
|
774
|
+
|
|
775
|
+
- Status: pending
|
|
776
|
+
- Workflow: simplicity-gate
|
|
777
|
+
|
|
778
|
+
Second phase.`;
|
|
779
|
+
const mockDocument = {
|
|
780
|
+
content: `# Active Tasks\n\n## Tasks\n\n${firstTaskContent}\n\n${secondTaskContent}`,
|
|
781
|
+
headings: [
|
|
782
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
783
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
784
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 },
|
|
785
|
+
{ slug: 'phase-2', title: 'Phase 2', depth: 3 }
|
|
786
|
+
],
|
|
787
|
+
sections: new Map([
|
|
788
|
+
['active-tasks', ''],
|
|
789
|
+
['tasks', ''],
|
|
790
|
+
['phase-1', firstTaskContent],
|
|
791
|
+
['phase-2', secondTaskContent]
|
|
792
|
+
]),
|
|
793
|
+
metadata: {
|
|
794
|
+
path: '/coordinator/active.md',
|
|
795
|
+
title: 'Active Tasks',
|
|
796
|
+
lastModified: new Date(),
|
|
797
|
+
contentHash: 'hash',
|
|
798
|
+
wordCount: 16
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
802
|
+
vi.spyOn(manager, 'getSectionContent').mockImplementation(async (_path, slug) => {
|
|
803
|
+
if (slug === 'phase-1')
|
|
804
|
+
return firstTaskContent;
|
|
805
|
+
if (slug === 'phase-2')
|
|
806
|
+
return secondTaskContent;
|
|
807
|
+
return null;
|
|
808
|
+
});
|
|
809
|
+
// View only second task
|
|
810
|
+
const result = await viewCoordinatorTask({
|
|
811
|
+
slug: 'phase-2'
|
|
812
|
+
}, sessionState, manager);
|
|
813
|
+
// Second task should still get main_workflow_name from first task
|
|
814
|
+
expect(result.tasks[0]).toHaveProperty('main_workflow_name', 'spec-first-integration');
|
|
815
|
+
expect(result.tasks[0]).toHaveProperty('workflow_name', 'simplicity-gate');
|
|
816
|
+
});
|
|
817
|
+
});
|
|
818
|
+
describe('Summary Statistics', () => {
|
|
819
|
+
it('should count tasks_with_workflows correctly', async () => {
|
|
820
|
+
const task1Content = `### Phase 1
|
|
821
|
+
|
|
822
|
+
- Status: pending
|
|
823
|
+
- Workflow: multi-option-tradeoff
|
|
824
|
+
|
|
825
|
+
Has workflow.`;
|
|
826
|
+
const task2Content = `### Phase 2
|
|
827
|
+
|
|
828
|
+
- Status: pending
|
|
829
|
+
|
|
830
|
+
No workflow.`;
|
|
831
|
+
const mockDocument = {
|
|
832
|
+
content: `# Active Tasks\n\n## Tasks\n\n${task1Content}\n\n${task2Content}`,
|
|
833
|
+
headings: [
|
|
834
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
835
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
836
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 },
|
|
837
|
+
{ slug: 'phase-2', title: 'Phase 2', depth: 3 }
|
|
838
|
+
],
|
|
839
|
+
sections: new Map([
|
|
840
|
+
['active-tasks', ''],
|
|
841
|
+
['tasks', ''],
|
|
842
|
+
['phase-1', task1Content],
|
|
843
|
+
['phase-2', task2Content]
|
|
844
|
+
]),
|
|
845
|
+
metadata: {
|
|
846
|
+
path: '/coordinator/active.md',
|
|
847
|
+
title: 'Active Tasks',
|
|
848
|
+
lastModified: new Date(),
|
|
849
|
+
contentHash: 'hash',
|
|
850
|
+
wordCount: 15
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
854
|
+
vi.spyOn(manager, 'getSectionContent').mockImplementation(async (_path, slug) => {
|
|
855
|
+
if (slug === 'phase-1')
|
|
856
|
+
return task1Content;
|
|
857
|
+
if (slug === 'phase-2')
|
|
858
|
+
return task2Content;
|
|
859
|
+
return null;
|
|
860
|
+
});
|
|
861
|
+
const result = await viewCoordinatorTask({
|
|
862
|
+
slug: 'phase-1,phase-2'
|
|
863
|
+
}, sessionState, manager);
|
|
864
|
+
expect(result.summary).toHaveProperty('tasks_with_workflows', 1);
|
|
865
|
+
});
|
|
866
|
+
it('should count tasks_with_main_workflow correctly', async () => {
|
|
867
|
+
const firstTaskContent = `### Phase 1
|
|
868
|
+
|
|
869
|
+
- Status: pending
|
|
870
|
+
- Main-Workflow: spec-first-integration
|
|
871
|
+
|
|
872
|
+
First phase.`;
|
|
873
|
+
const secondTaskContent = `### Phase 2
|
|
874
|
+
|
|
875
|
+
- Status: pending
|
|
876
|
+
|
|
877
|
+
Second phase.`;
|
|
878
|
+
const mockDocument = {
|
|
879
|
+
content: `# Active Tasks\n\n## Tasks\n\n${firstTaskContent}\n\n${secondTaskContent}`,
|
|
880
|
+
headings: [
|
|
881
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
882
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
883
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 },
|
|
884
|
+
{ slug: 'phase-2', title: 'Phase 2', depth: 3 }
|
|
885
|
+
],
|
|
886
|
+
sections: new Map([
|
|
887
|
+
['active-tasks', ''],
|
|
888
|
+
['tasks', ''],
|
|
889
|
+
['phase-1', firstTaskContent],
|
|
890
|
+
['phase-2', secondTaskContent]
|
|
891
|
+
]),
|
|
892
|
+
metadata: {
|
|
893
|
+
path: '/coordinator/active.md',
|
|
894
|
+
title: 'Active Tasks',
|
|
895
|
+
lastModified: new Date(),
|
|
896
|
+
contentHash: 'hash',
|
|
897
|
+
wordCount: 14
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
901
|
+
vi.spyOn(manager, 'getSectionContent').mockImplementation(async (_path, slug) => {
|
|
902
|
+
if (slug === 'phase-1')
|
|
903
|
+
return firstTaskContent;
|
|
904
|
+
if (slug === 'phase-2')
|
|
905
|
+
return secondTaskContent;
|
|
906
|
+
return null;
|
|
907
|
+
});
|
|
908
|
+
const result = await viewCoordinatorTask({
|
|
909
|
+
slug: 'phase-1,phase-2'
|
|
910
|
+
}, sessionState, manager);
|
|
911
|
+
// Both tasks have access to main workflow from first task
|
|
912
|
+
expect(result.summary).toHaveProperty('tasks_with_main_workflow', 2);
|
|
913
|
+
});
|
|
914
|
+
it('should show zero workflow counts when no workflows present', async () => {
|
|
915
|
+
const task1Content = `### Phase 1
|
|
916
|
+
|
|
917
|
+
- Status: pending
|
|
918
|
+
|
|
919
|
+
No workflow.`;
|
|
920
|
+
const task2Content = `### Phase 2
|
|
921
|
+
|
|
922
|
+
- Status: pending
|
|
923
|
+
|
|
924
|
+
Also no workflow.`;
|
|
925
|
+
const mockDocument = {
|
|
926
|
+
content: `# Active Tasks\n\n## Tasks\n\n${task1Content}\n\n${task2Content}`,
|
|
927
|
+
headings: [
|
|
928
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
929
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
930
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 },
|
|
931
|
+
{ slug: 'phase-2', title: 'Phase 2', depth: 3 }
|
|
932
|
+
],
|
|
933
|
+
sections: new Map([
|
|
934
|
+
['active-tasks', ''],
|
|
935
|
+
['tasks', ''],
|
|
936
|
+
['phase-1', task1Content],
|
|
937
|
+
['phase-2', task2Content]
|
|
938
|
+
]),
|
|
939
|
+
metadata: {
|
|
940
|
+
path: '/coordinator/active.md',
|
|
941
|
+
title: 'Active Tasks',
|
|
942
|
+
lastModified: new Date(),
|
|
943
|
+
contentHash: 'hash',
|
|
944
|
+
wordCount: 12
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
948
|
+
vi.spyOn(manager, 'getSectionContent').mockImplementation(async (_path, slug) => {
|
|
949
|
+
if (slug === 'phase-1')
|
|
950
|
+
return task1Content;
|
|
951
|
+
if (slug === 'phase-2')
|
|
952
|
+
return task2Content;
|
|
953
|
+
return null;
|
|
954
|
+
});
|
|
955
|
+
const result = await viewCoordinatorTask({
|
|
956
|
+
slug: 'phase-1,phase-2'
|
|
957
|
+
}, sessionState, manager);
|
|
958
|
+
expect(result.summary).toHaveProperty('tasks_with_workflows', 0);
|
|
959
|
+
expect(result.summary).toHaveProperty('tasks_with_main_workflow', 0);
|
|
960
|
+
});
|
|
961
|
+
it('should include existing summary fields along with workflow counts', async () => {
|
|
962
|
+
const taskContent = `### Phase 1
|
|
963
|
+
|
|
964
|
+
- Status: pending
|
|
965
|
+
- Workflow: multi-option-tradeoff
|
|
966
|
+
|
|
967
|
+
Phase content.`;
|
|
968
|
+
const mockDocument = {
|
|
969
|
+
content: `# Active Tasks\n\n## Tasks\n\n${taskContent}`,
|
|
970
|
+
headings: [
|
|
971
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
972
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
973
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 }
|
|
974
|
+
],
|
|
975
|
+
sections: new Map([
|
|
976
|
+
['active-tasks', ''],
|
|
977
|
+
['tasks', ''],
|
|
978
|
+
['phase-1', taskContent]
|
|
979
|
+
]),
|
|
980
|
+
metadata: {
|
|
981
|
+
path: '/coordinator/active.md',
|
|
982
|
+
title: 'Active Tasks',
|
|
983
|
+
lastModified: new Date(),
|
|
984
|
+
contentHash: 'hash',
|
|
985
|
+
wordCount: 10
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
989
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue(taskContent);
|
|
990
|
+
const result = await viewCoordinatorTask({
|
|
991
|
+
slug: 'phase-1'
|
|
992
|
+
}, sessionState, manager);
|
|
993
|
+
// Verify existing summary fields
|
|
994
|
+
expect(result.summary).toHaveProperty('total_tasks', 1);
|
|
995
|
+
expect(result.summary).toHaveProperty('by_status');
|
|
996
|
+
expect(result.summary).toHaveProperty('with_links');
|
|
997
|
+
expect(result.summary).toHaveProperty('with_references');
|
|
998
|
+
// Verify new workflow fields
|
|
999
|
+
expect(result.summary).toHaveProperty('tasks_with_workflows', 1);
|
|
1000
|
+
expect(result.summary).toHaveProperty('tasks_with_main_workflow', 0);
|
|
1001
|
+
});
|
|
1002
|
+
});
|
|
1003
|
+
describe('No Content Injection', () => {
|
|
1004
|
+
it('should verify workflow_name is string, not object with content', async () => {
|
|
1005
|
+
const taskContent = `### Phase 1
|
|
1006
|
+
|
|
1007
|
+
- Status: pending
|
|
1008
|
+
- Workflow: multi-option-tradeoff
|
|
1009
|
+
|
|
1010
|
+
Phase content.`;
|
|
1011
|
+
const mockDocument = {
|
|
1012
|
+
content: `# Active Tasks\n\n## Tasks\n\n${taskContent}`,
|
|
1013
|
+
headings: [
|
|
1014
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
1015
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
1016
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 }
|
|
1017
|
+
],
|
|
1018
|
+
sections: new Map([
|
|
1019
|
+
['active-tasks', ''],
|
|
1020
|
+
['tasks', ''],
|
|
1021
|
+
['phase-1', taskContent]
|
|
1022
|
+
]),
|
|
1023
|
+
metadata: {
|
|
1024
|
+
path: '/coordinator/active.md',
|
|
1025
|
+
title: 'Active Tasks',
|
|
1026
|
+
lastModified: new Date(),
|
|
1027
|
+
contentHash: 'hash',
|
|
1028
|
+
wordCount: 10
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
1032
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue(taskContent);
|
|
1033
|
+
const result = await viewCoordinatorTask({
|
|
1034
|
+
slug: 'phase-1'
|
|
1035
|
+
}, sessionState, manager);
|
|
1036
|
+
// Verify workflow_name is a string
|
|
1037
|
+
const task = result.tasks[0];
|
|
1038
|
+
expect(task).toBeDefined();
|
|
1039
|
+
expect(typeof task?.workflow_name).toBe('string');
|
|
1040
|
+
expect(task?.workflow_name).toBe('multi-option-tradeoff');
|
|
1041
|
+
// Ensure it's NOT an object with content/description/etc
|
|
1042
|
+
expect(task?.workflow_name).not.toBeInstanceOf(Object);
|
|
1043
|
+
});
|
|
1044
|
+
it('should verify main_workflow_name is string, not object', async () => {
|
|
1045
|
+
const firstTaskContent = `### Phase 1
|
|
1046
|
+
|
|
1047
|
+
- Status: pending
|
|
1048
|
+
- Main-Workflow: spec-first-integration
|
|
1049
|
+
|
|
1050
|
+
First phase.`;
|
|
1051
|
+
const mockDocument = {
|
|
1052
|
+
content: `# Active Tasks\n\n## Tasks\n\n${firstTaskContent}`,
|
|
1053
|
+
headings: [
|
|
1054
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
1055
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
1056
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 }
|
|
1057
|
+
],
|
|
1058
|
+
sections: new Map([
|
|
1059
|
+
['active-tasks', ''],
|
|
1060
|
+
['tasks', ''],
|
|
1061
|
+
['phase-1', firstTaskContent]
|
|
1062
|
+
]),
|
|
1063
|
+
metadata: {
|
|
1064
|
+
path: '/coordinator/active.md',
|
|
1065
|
+
title: 'Active Tasks',
|
|
1066
|
+
lastModified: new Date(),
|
|
1067
|
+
contentHash: 'hash',
|
|
1068
|
+
wordCount: 10
|
|
1069
|
+
}
|
|
1070
|
+
};
|
|
1071
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
1072
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue(firstTaskContent);
|
|
1073
|
+
const result = await viewCoordinatorTask({
|
|
1074
|
+
slug: 'phase-1'
|
|
1075
|
+
}, sessionState, manager);
|
|
1076
|
+
// Verify main_workflow_name is a string
|
|
1077
|
+
const task = result.tasks[0];
|
|
1078
|
+
expect(task).toBeDefined();
|
|
1079
|
+
expect(typeof task?.main_workflow_name).toBe('string');
|
|
1080
|
+
expect(task?.main_workflow_name).toBe('spec-first-integration');
|
|
1081
|
+
// Ensure it's NOT an object
|
|
1082
|
+
expect(task?.main_workflow_name).not.toBeInstanceOf(Object);
|
|
1083
|
+
});
|
|
1084
|
+
it('should ensure no workflow or main_workflow objects in response', async () => {
|
|
1085
|
+
const taskContent = `### Phase 1
|
|
1086
|
+
|
|
1087
|
+
- Status: pending
|
|
1088
|
+
- Main-Workflow: spec-first-integration
|
|
1089
|
+
- Workflow: multi-option-tradeoff
|
|
1090
|
+
|
|
1091
|
+
Phase with both workflow types.`;
|
|
1092
|
+
const mockDocument = {
|
|
1093
|
+
content: `# Active Tasks\n\n## Tasks\n\n${taskContent}`,
|
|
1094
|
+
headings: [
|
|
1095
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
1096
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
1097
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 }
|
|
1098
|
+
],
|
|
1099
|
+
sections: new Map([
|
|
1100
|
+
['active-tasks', ''],
|
|
1101
|
+
['tasks', ''],
|
|
1102
|
+
['phase-1', taskContent]
|
|
1103
|
+
]),
|
|
1104
|
+
metadata: {
|
|
1105
|
+
path: '/coordinator/active.md',
|
|
1106
|
+
title: 'Active Tasks',
|
|
1107
|
+
lastModified: new Date(),
|
|
1108
|
+
contentHash: 'hash',
|
|
1109
|
+
wordCount: 12
|
|
1110
|
+
}
|
|
1111
|
+
};
|
|
1112
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
1113
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue(taskContent);
|
|
1114
|
+
const result = await viewCoordinatorTask({
|
|
1115
|
+
slug: 'phase-1'
|
|
1116
|
+
}, sessionState, manager);
|
|
1117
|
+
// Should have name fields only
|
|
1118
|
+
expect(result.tasks[0]).toHaveProperty('workflow_name', 'multi-option-tradeoff');
|
|
1119
|
+
expect(result.tasks[0]).toHaveProperty('main_workflow_name', 'spec-first-integration');
|
|
1120
|
+
// Should NOT have workflow objects (those are for start_task only)
|
|
1121
|
+
expect(result.tasks[0]).not.toHaveProperty('workflow');
|
|
1122
|
+
expect(result.tasks[0]).not.toHaveProperty('main_workflow');
|
|
1123
|
+
// Verify response structure doesn't include workflow content keys
|
|
1124
|
+
const task = result.tasks[0];
|
|
1125
|
+
expect(task).toBeDefined();
|
|
1126
|
+
if (task != null) {
|
|
1127
|
+
const taskKeys = Object.keys(task);
|
|
1128
|
+
expect(taskKeys).not.toContain('workflow');
|
|
1129
|
+
expect(taskKeys).not.toContain('main_workflow');
|
|
1130
|
+
}
|
|
1131
|
+
});
|
|
1132
|
+
});
|
|
1133
|
+
describe('Response Structure', () => {
|
|
1134
|
+
it('should return properly formatted response structure', async () => {
|
|
1135
|
+
const taskContent = `### Phase 1
|
|
1136
|
+
|
|
1137
|
+
- Status: pending
|
|
1138
|
+
- Workflow: simplicity-gate
|
|
1139
|
+
|
|
1140
|
+
Phase content.`;
|
|
1141
|
+
const mockDocument = {
|
|
1142
|
+
content: `# Active Tasks\n\n## Tasks\n\n${taskContent}`,
|
|
1143
|
+
headings: [
|
|
1144
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
1145
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
1146
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 }
|
|
1147
|
+
],
|
|
1148
|
+
sections: new Map([
|
|
1149
|
+
['active-tasks', ''],
|
|
1150
|
+
['tasks', ''],
|
|
1151
|
+
['phase-1', taskContent]
|
|
1152
|
+
]),
|
|
1153
|
+
metadata: {
|
|
1154
|
+
path: '/coordinator/active.md',
|
|
1155
|
+
title: 'Active Tasks',
|
|
1156
|
+
lastModified: new Date(),
|
|
1157
|
+
contentHash: 'mock-hash',
|
|
1158
|
+
wordCount: 10
|
|
1159
|
+
}
|
|
1160
|
+
};
|
|
1161
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
1162
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue(taskContent);
|
|
1163
|
+
const result = await viewCoordinatorTask({
|
|
1164
|
+
slug: 'phase-1'
|
|
1165
|
+
}, sessionState, manager);
|
|
1166
|
+
// Verify response structure
|
|
1167
|
+
expect(result).toHaveProperty('mode', 'detail');
|
|
1168
|
+
expect(result).toHaveProperty('document');
|
|
1169
|
+
expect(result).toHaveProperty('tasks');
|
|
1170
|
+
expect(result).toHaveProperty('summary');
|
|
1171
|
+
expect(typeof result.document).toBe('string');
|
|
1172
|
+
expect(Array.isArray(result.tasks)).toBe(true);
|
|
1173
|
+
expect(typeof result.summary).toBe('object');
|
|
1174
|
+
// Verify task structure
|
|
1175
|
+
const task = result.tasks[0];
|
|
1176
|
+
expect(task).toHaveProperty('slug');
|
|
1177
|
+
expect(task).toHaveProperty('title');
|
|
1178
|
+
expect(task).toHaveProperty('content');
|
|
1179
|
+
expect(task).toHaveProperty('status');
|
|
1180
|
+
expect(task).toHaveProperty('depth');
|
|
1181
|
+
expect(task).toHaveProperty('full_path');
|
|
1182
|
+
expect(task).toHaveProperty('word_count');
|
|
1183
|
+
expect(task).toHaveProperty('workflow_name');
|
|
1184
|
+
expect(task).toHaveProperty('has_workflow');
|
|
1185
|
+
});
|
|
1186
|
+
it('should support viewing multiple tasks in single call', async () => {
|
|
1187
|
+
const task1Content = `### Phase 1
|
|
1188
|
+
|
|
1189
|
+
- Status: pending
|
|
1190
|
+
- Workflow: multi-option-tradeoff
|
|
1191
|
+
|
|
1192
|
+
First phase.`;
|
|
1193
|
+
const task2Content = `### Phase 2
|
|
1194
|
+
|
|
1195
|
+
- Status: in_progress
|
|
1196
|
+
|
|
1197
|
+
Second phase.`;
|
|
1198
|
+
const mockDocument = {
|
|
1199
|
+
content: `# Active Tasks\n\n## Tasks\n\n${task1Content}\n\n${task2Content}`,
|
|
1200
|
+
headings: [
|
|
1201
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
1202
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
1203
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 },
|
|
1204
|
+
{ slug: 'phase-2', title: 'Phase 2', depth: 3 }
|
|
1205
|
+
],
|
|
1206
|
+
sections: new Map([
|
|
1207
|
+
['active-tasks', ''],
|
|
1208
|
+
['tasks', ''],
|
|
1209
|
+
['phase-1', task1Content],
|
|
1210
|
+
['phase-2', task2Content]
|
|
1211
|
+
]),
|
|
1212
|
+
metadata: {
|
|
1213
|
+
path: '/coordinator/active.md',
|
|
1214
|
+
title: 'Active Tasks',
|
|
1215
|
+
lastModified: new Date(),
|
|
1216
|
+
contentHash: 'hash',
|
|
1217
|
+
wordCount: 16
|
|
1218
|
+
}
|
|
1219
|
+
};
|
|
1220
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
1221
|
+
vi.spyOn(manager, 'getSectionContent').mockImplementation(async (_path, slug) => {
|
|
1222
|
+
if (slug === 'phase-1')
|
|
1223
|
+
return task1Content;
|
|
1224
|
+
if (slug === 'phase-2')
|
|
1225
|
+
return task2Content;
|
|
1226
|
+
return null;
|
|
1227
|
+
});
|
|
1228
|
+
const result = await viewCoordinatorTask({
|
|
1229
|
+
slug: 'phase-1,phase-2'
|
|
1230
|
+
}, sessionState, manager);
|
|
1231
|
+
expect(result.tasks).toHaveLength(2);
|
|
1232
|
+
expect(result.summary.total_tasks).toBe(2);
|
|
1233
|
+
});
|
|
1234
|
+
});
|
|
1235
|
+
describe('Integration with Existing Features', () => {
|
|
1236
|
+
it('should maintain existing task fields alongside workflow metadata', async () => {
|
|
1237
|
+
const taskContent = `### Complex Phase
|
|
1238
|
+
|
|
1239
|
+
- Status: in_progress
|
|
1240
|
+
- Workflow: multi-option-tradeoff
|
|
1241
|
+
→ @/specs/feature-spec.md
|
|
1242
|
+
|
|
1243
|
+
Implement feature according to specification.`;
|
|
1244
|
+
const mockDocument = {
|
|
1245
|
+
content: `# Active Tasks\n\n## Tasks\n\n${taskContent}`,
|
|
1246
|
+
headings: [
|
|
1247
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
1248
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
1249
|
+
{ slug: 'complex-phase', title: 'Complex Phase', depth: 3 }
|
|
1250
|
+
],
|
|
1251
|
+
sections: new Map([
|
|
1252
|
+
['active-tasks', ''],
|
|
1253
|
+
['tasks', ''],
|
|
1254
|
+
['complex-phase', taskContent]
|
|
1255
|
+
]),
|
|
1256
|
+
metadata: {
|
|
1257
|
+
path: '/coordinator/active.md',
|
|
1258
|
+
title: 'Active Tasks',
|
|
1259
|
+
lastModified: new Date(),
|
|
1260
|
+
contentHash: 'hash',
|
|
1261
|
+
wordCount: 13
|
|
1262
|
+
}
|
|
1263
|
+
};
|
|
1264
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
1265
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue(taskContent);
|
|
1266
|
+
const result = await viewCoordinatorTask({
|
|
1267
|
+
slug: 'complex-phase'
|
|
1268
|
+
}, sessionState, manager);
|
|
1269
|
+
const task = result.tasks[0];
|
|
1270
|
+
// Existing fields
|
|
1271
|
+
expect(task).toHaveProperty('slug', 'complex-phase');
|
|
1272
|
+
expect(task).toHaveProperty('title', 'Complex Phase');
|
|
1273
|
+
expect(task).toHaveProperty('status', 'in_progress');
|
|
1274
|
+
expect(task).toHaveProperty('linked_document', '/specs/feature-spec.md');
|
|
1275
|
+
// New workflow fields
|
|
1276
|
+
expect(task).toHaveProperty('workflow_name', 'multi-option-tradeoff');
|
|
1277
|
+
expect(task).toHaveProperty('has_workflow', true);
|
|
1278
|
+
});
|
|
1279
|
+
it('should work with hierarchical task structures', async () => {
|
|
1280
|
+
const firstTaskContent = `### Phase 1
|
|
1281
|
+
|
|
1282
|
+
- Status: pending
|
|
1283
|
+
- Main-Workflow: spec-first-integration
|
|
1284
|
+
|
|
1285
|
+
First phase with main workflow.`;
|
|
1286
|
+
const secondTaskContent = `### Phase 2
|
|
1287
|
+
|
|
1288
|
+
- Status: pending
|
|
1289
|
+
- Workflow: simplicity-gate
|
|
1290
|
+
|
|
1291
|
+
Second phase with its own workflow.`;
|
|
1292
|
+
const mockDocument = {
|
|
1293
|
+
content: `# Active Tasks\n\n## Tasks\n\n${firstTaskContent}\n\n${secondTaskContent}`,
|
|
1294
|
+
headings: [
|
|
1295
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
1296
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
1297
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 },
|
|
1298
|
+
{ slug: 'phase-2', title: 'Phase 2', depth: 3 }
|
|
1299
|
+
],
|
|
1300
|
+
sections: new Map([
|
|
1301
|
+
['active-tasks', ''],
|
|
1302
|
+
['tasks', ''],
|
|
1303
|
+
['phase-1', firstTaskContent],
|
|
1304
|
+
['phase-2', secondTaskContent]
|
|
1305
|
+
]),
|
|
1306
|
+
metadata: {
|
|
1307
|
+
path: '/coordinator/active.md',
|
|
1308
|
+
title: 'Active Tasks',
|
|
1309
|
+
lastModified: new Date(),
|
|
1310
|
+
contentHash: 'hash',
|
|
1311
|
+
wordCount: 20
|
|
1312
|
+
}
|
|
1313
|
+
};
|
|
1314
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
1315
|
+
vi.spyOn(manager, 'getSectionContent').mockImplementation(async (_path, slug) => {
|
|
1316
|
+
if (slug === 'phase-1')
|
|
1317
|
+
return firstTaskContent;
|
|
1318
|
+
if (slug === 'phase-2')
|
|
1319
|
+
return secondTaskContent;
|
|
1320
|
+
return null;
|
|
1321
|
+
});
|
|
1322
|
+
const result = await viewCoordinatorTask({
|
|
1323
|
+
slug: 'phase-1,phase-2'
|
|
1324
|
+
}, sessionState, manager);
|
|
1325
|
+
// Both should have main_workflow_name from first task
|
|
1326
|
+
expect(result.tasks[0]).toHaveProperty('main_workflow_name', 'spec-first-integration');
|
|
1327
|
+
expect(result.tasks[1]).toHaveProperty('main_workflow_name', 'spec-first-integration');
|
|
1328
|
+
// First task has no workflow field (only Main-Workflow)
|
|
1329
|
+
expect(result.tasks[0]).not.toHaveProperty('workflow_name');
|
|
1330
|
+
expect(result.tasks[0]).toHaveProperty('has_workflow', false);
|
|
1331
|
+
// Second task has its own workflow
|
|
1332
|
+
expect(result.tasks[1]).toHaveProperty('workflow_name', 'simplicity-gate');
|
|
1333
|
+
expect(result.tasks[1]).toHaveProperty('has_workflow', true);
|
|
1334
|
+
});
|
|
1335
|
+
});
|
|
1336
|
+
describe('Path Validation', () => {
|
|
1337
|
+
it('should always use /coordinator/active.md path', async () => {
|
|
1338
|
+
const taskContent = `### Phase 1
|
|
1339
|
+
|
|
1340
|
+
- Status: pending
|
|
1341
|
+
|
|
1342
|
+
Task content.`;
|
|
1343
|
+
const mockDocument = {
|
|
1344
|
+
content: `# Active Tasks\n\n## Tasks\n\n${taskContent}`,
|
|
1345
|
+
headings: [
|
|
1346
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
1347
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
1348
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 }
|
|
1349
|
+
],
|
|
1350
|
+
sections: new Map([
|
|
1351
|
+
['active-tasks', ''],
|
|
1352
|
+
['tasks', ''],
|
|
1353
|
+
['phase-1', taskContent]
|
|
1354
|
+
]),
|
|
1355
|
+
metadata: {
|
|
1356
|
+
path: '/coordinator/active.md',
|
|
1357
|
+
title: 'Active Tasks',
|
|
1358
|
+
lastModified: new Date(),
|
|
1359
|
+
contentHash: 'hash',
|
|
1360
|
+
wordCount: 10
|
|
1361
|
+
}
|
|
1362
|
+
};
|
|
1363
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
1364
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue(taskContent);
|
|
1365
|
+
const result = await viewCoordinatorTask({ slug: 'phase-1' }, sessionState, manager);
|
|
1366
|
+
// Verify correct document path
|
|
1367
|
+
expect(result.document).toBe('/coordinator/active.md');
|
|
1368
|
+
expect(result.tasks[0]?.full_path).toContain('/coordinator/active.md#');
|
|
1369
|
+
});
|
|
1370
|
+
it('should work in overview mode without any parameters', async () => {
|
|
1371
|
+
const taskContent = `### Phase 1
|
|
1372
|
+
|
|
1373
|
+
- Status: pending
|
|
1374
|
+
|
|
1375
|
+
Task content.`;
|
|
1376
|
+
const mockDocument = {
|
|
1377
|
+
content: `# Active Tasks\n\n## Tasks\n\n${taskContent}`,
|
|
1378
|
+
headings: [
|
|
1379
|
+
{ slug: 'active-tasks', title: 'Active Tasks', depth: 1 },
|
|
1380
|
+
{ slug: 'tasks', title: 'Tasks', depth: 2 },
|
|
1381
|
+
{ slug: 'phase-1', title: 'Phase 1', depth: 3 }
|
|
1382
|
+
],
|
|
1383
|
+
sections: new Map([
|
|
1384
|
+
['active-tasks', ''],
|
|
1385
|
+
['tasks', ''],
|
|
1386
|
+
['phase-1', taskContent]
|
|
1387
|
+
]),
|
|
1388
|
+
metadata: {
|
|
1389
|
+
path: '/coordinator/active.md',
|
|
1390
|
+
title: 'Active Tasks',
|
|
1391
|
+
lastModified: new Date(),
|
|
1392
|
+
contentHash: 'hash',
|
|
1393
|
+
wordCount: 10
|
|
1394
|
+
}
|
|
1395
|
+
};
|
|
1396
|
+
vi.spyOn(manager, 'getDocument').mockResolvedValue(mockDocument);
|
|
1397
|
+
vi.spyOn(manager, 'getSectionContent').mockResolvedValue(taskContent);
|
|
1398
|
+
const result = await viewCoordinatorTask({}, sessionState, manager);
|
|
1399
|
+
expect(result.mode).toBe('overview');
|
|
1400
|
+
expect(result.document).toBe('/coordinator/active.md');
|
|
1401
|
+
});
|
|
1402
|
+
});
|
|
1403
|
+
});
|
|
1404
|
+
//# sourceMappingURL=view-coordinator-task.test.js.map
|