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,799 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Central addressing system for consistent document/section/task addressing
|
|
3
|
+
*
|
|
4
|
+
* This module provides unified addressing patterns to prevent inconsistencies
|
|
5
|
+
* across the codebase in how documents, sections, and tasks are referenced.
|
|
6
|
+
*
|
|
7
|
+
* Key Features:
|
|
8
|
+
* - Type-safe addressing with validation
|
|
9
|
+
* - Flexible input format support (#slug, slug, /doc.md#slug)
|
|
10
|
+
* - Relative path structure (user-facing paths are relative to base folders)
|
|
11
|
+
* - Performance caching for repeated operations
|
|
12
|
+
* - Comparison utilities for address equality
|
|
13
|
+
* - Standard tool integration patterns
|
|
14
|
+
* - Comprehensive error handling
|
|
15
|
+
*
|
|
16
|
+
* Path Structure:
|
|
17
|
+
* - User-facing: /api/auth.md (relative to docs/ folder)
|
|
18
|
+
* - Internal: May include namespace prefixes for file operations
|
|
19
|
+
* - Archives: /archived/docs/... (explicit prefix per requirements)
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Custom error types for addressing system
|
|
23
|
+
*
|
|
24
|
+
* These error classes provide consistent error handling throughout the addressing system
|
|
25
|
+
* with standardized error codes and contextual information for debugging and recovery.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Base error class for all addressing system errors
|
|
29
|
+
*
|
|
30
|
+
* Provides structured error information with error codes and contextual data
|
|
31
|
+
* for programmatic error handling and debugging.
|
|
32
|
+
*
|
|
33
|
+
* @param message - Human-readable error message
|
|
34
|
+
* @param code - Machine-readable error code for programmatic handling
|
|
35
|
+
* @param context - Additional context about the error for debugging
|
|
36
|
+
*
|
|
37
|
+
* @example Basic error handling
|
|
38
|
+
* ```typescript
|
|
39
|
+
* try {
|
|
40
|
+
* // Some addressing operation
|
|
41
|
+
* } catch (error) {
|
|
42
|
+
* if (error instanceof AddressingError) {
|
|
43
|
+
* console.error('Error code:', error.code);
|
|
44
|
+
* console.error('Context:', error.context);
|
|
45
|
+
* }
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Error code checking
|
|
50
|
+
* ```typescript
|
|
51
|
+
* try {
|
|
52
|
+
* parseDocumentAddress('/invalid/path');
|
|
53
|
+
* } catch (error) {
|
|
54
|
+
* if (error instanceof AddressingError && error.code === 'DOCUMENT_NOT_FOUND') {
|
|
55
|
+
* // Handle missing document specifically
|
|
56
|
+
* }
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare class AddressingError extends Error {
|
|
61
|
+
code: string;
|
|
62
|
+
context?: Record<string, unknown> | undefined;
|
|
63
|
+
constructor(message: string, code: string, context?: Record<string, unknown> | undefined);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Error thrown when a document cannot be found at the specified path
|
|
67
|
+
*
|
|
68
|
+
* This error indicates that the document path is valid but the document
|
|
69
|
+
* does not exist in the file system or document cache.
|
|
70
|
+
*
|
|
71
|
+
* @param path - The document path that was not found
|
|
72
|
+
*
|
|
73
|
+
* @example Handling missing documents
|
|
74
|
+
* ```typescript
|
|
75
|
+
* try {
|
|
76
|
+
* const doc = parseDocumentAddress('/missing/document.md');
|
|
77
|
+
* } catch (error) {
|
|
78
|
+
* if (error instanceof DocumentNotFoundError) {
|
|
79
|
+
* console.error('Document not found:', error.context.path);
|
|
80
|
+
* // Suggest creating the document or checking the path
|
|
81
|
+
* }
|
|
82
|
+
* }
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* @example Recovery strategy
|
|
86
|
+
* ```typescript
|
|
87
|
+
* try {
|
|
88
|
+
* return parseDocumentAddress(documentPath);
|
|
89
|
+
* } catch (error) {
|
|
90
|
+
* if (error instanceof DocumentNotFoundError) {
|
|
91
|
+
* // Try alternative paths or suggest creation
|
|
92
|
+
* return suggestAlternativeDocuments(error.context.path);
|
|
93
|
+
* }
|
|
94
|
+
* throw error;
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare class DocumentNotFoundError extends AddressingError {
|
|
99
|
+
constructor(path: string);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Error thrown when a section cannot be found within a document
|
|
103
|
+
*
|
|
104
|
+
* This error indicates that the document exists but the specified section
|
|
105
|
+
* slug does not match any section in the document.
|
|
106
|
+
*
|
|
107
|
+
* @param slug - The section slug that was not found
|
|
108
|
+
* @param documentPath - The document path where the section was searched
|
|
109
|
+
*
|
|
110
|
+
* @example Handling missing sections
|
|
111
|
+
* ```typescript
|
|
112
|
+
* try {
|
|
113
|
+
* const section = parseSectionAddress('missing-section', '/api/auth.md');
|
|
114
|
+
* } catch (error) {
|
|
115
|
+
* if (error instanceof SectionNotFoundError) {
|
|
116
|
+
* console.error('Section not found:', error.context.slug);
|
|
117
|
+
* console.error('In document:', error.context.documentPath);
|
|
118
|
+
* // Suggest available sections or check section name
|
|
119
|
+
* }
|
|
120
|
+
* }
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @example Hierarchical section recovery
|
|
124
|
+
* ```typescript
|
|
125
|
+
* try {
|
|
126
|
+
* return parseSectionAddress(sectionSlug, documentPath);
|
|
127
|
+
* } catch (error) {
|
|
128
|
+
* if (error instanceof SectionNotFoundError) {
|
|
129
|
+
* const slug = error.context.slug;
|
|
130
|
+
* if (slug.includes('/')) {
|
|
131
|
+
* // Try parent section for hierarchical addresses
|
|
132
|
+
* const parentSlug = slug.split('/').slice(0, -1).join('/');
|
|
133
|
+
* console.log(`Section not found. Try parent section: ${parentSlug}`);
|
|
134
|
+
* }
|
|
135
|
+
* }
|
|
136
|
+
* throw error;
|
|
137
|
+
* }
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
export declare class SectionNotFoundError extends AddressingError {
|
|
141
|
+
constructor(slug: string, documentPath: string);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Error thrown when an address format is invalid or malformed
|
|
145
|
+
*
|
|
146
|
+
* This error indicates that the provided address string does not conform
|
|
147
|
+
* to expected patterns or contains invalid characters or structure.
|
|
148
|
+
*
|
|
149
|
+
* @param address - The invalid address that was provided
|
|
150
|
+
* @param reason - Specific reason why the address is invalid
|
|
151
|
+
*
|
|
152
|
+
* @example Handling invalid addresses
|
|
153
|
+
* ```typescript
|
|
154
|
+
* try {
|
|
155
|
+
* const doc = parseDocumentAddress('invalid-path');
|
|
156
|
+
* } catch (error) {
|
|
157
|
+
* if (error instanceof InvalidAddressError) {
|
|
158
|
+
* console.error('Invalid address:', error.context.address);
|
|
159
|
+
* console.error('Reason:', error.context.reason);
|
|
160
|
+
* // Provide guidance on correct address format
|
|
161
|
+
* }
|
|
162
|
+
* }
|
|
163
|
+
* ```
|
|
164
|
+
*
|
|
165
|
+
* @example Address format validation
|
|
166
|
+
* ```typescript
|
|
167
|
+
* function validateAndParseAddress(address: string) {
|
|
168
|
+
* try {
|
|
169
|
+
* return parseDocumentAddress(address);
|
|
170
|
+
* } catch (error) {
|
|
171
|
+
* if (error instanceof InvalidAddressError) {
|
|
172
|
+
* switch (error.context.reason) {
|
|
173
|
+
* case 'Document path must end with .md':
|
|
174
|
+
* return parseDocumentAddress(address + '.md');
|
|
175
|
+
* case 'Document path cannot be empty':
|
|
176
|
+
* throw new Error('Please provide a document path');
|
|
177
|
+
* default:
|
|
178
|
+
* throw error;
|
|
179
|
+
* }
|
|
180
|
+
* }
|
|
181
|
+
* throw error;
|
|
182
|
+
* }
|
|
183
|
+
* }
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
export declare class InvalidAddressError extends AddressingError {
|
|
187
|
+
constructor(address: string, reason: string);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Batch cache statistics for debugging and monitoring
|
|
191
|
+
*/
|
|
192
|
+
export interface BatchCacheStats {
|
|
193
|
+
readonly size: number;
|
|
194
|
+
readonly keys: string[];
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Address parsing cache optimized for batch operations
|
|
198
|
+
*
|
|
199
|
+
* This cache uses a simple Map for batch-scoped caching instead of persistent LRU caching.
|
|
200
|
+
* Cache entries are only valid for the current batch operation and are cleared after each batch.
|
|
201
|
+
*
|
|
202
|
+
* Benefits of batch-scoped caching:
|
|
203
|
+
* - Simpler implementation (no LRU logic needed)
|
|
204
|
+
* - Lower memory footprint (no persistent 1000-entry cache)
|
|
205
|
+
* - Same performance for batch operations (addresses cached within batch)
|
|
206
|
+
* - Clearer memory model (cache lifecycle tied to batch lifecycle)
|
|
207
|
+
*/
|
|
208
|
+
declare class AddressCache {
|
|
209
|
+
private readonly batchCache;
|
|
210
|
+
private batchStartTime;
|
|
211
|
+
private readonly BATCH_TIMEOUT_MS;
|
|
212
|
+
/**
|
|
213
|
+
* Check if batch cache has timed out and clear if needed
|
|
214
|
+
*/
|
|
215
|
+
private checkBatchTimeout;
|
|
216
|
+
/**
|
|
217
|
+
* Get document address from batch cache
|
|
218
|
+
*/
|
|
219
|
+
getDocument(path: string): DocumentAddress | undefined;
|
|
220
|
+
/**
|
|
221
|
+
* Set document address in batch cache
|
|
222
|
+
*/
|
|
223
|
+
setDocument(path: string, address: DocumentAddress): void;
|
|
224
|
+
/**
|
|
225
|
+
* Get section address from batch cache
|
|
226
|
+
*/
|
|
227
|
+
getSection(key: string): SectionAddress | undefined;
|
|
228
|
+
/**
|
|
229
|
+
* Set section address in batch cache
|
|
230
|
+
*/
|
|
231
|
+
setSection(key: string, address: SectionAddress): void;
|
|
232
|
+
/**
|
|
233
|
+
* Clear all batch cache entries
|
|
234
|
+
*
|
|
235
|
+
* This should be called after completing a batch operation to free memory
|
|
236
|
+
* and ensure fresh parsing for the next batch.
|
|
237
|
+
*/
|
|
238
|
+
clearBatch(): void;
|
|
239
|
+
/**
|
|
240
|
+
* Get batch cache statistics for debugging
|
|
241
|
+
*
|
|
242
|
+
* Returns the current size and all cache keys for monitoring and debugging
|
|
243
|
+
* batch caching behavior.
|
|
244
|
+
*/
|
|
245
|
+
getBatchStats(): BatchCacheStats;
|
|
246
|
+
/**
|
|
247
|
+
* Invalidate all cached addresses for a specific document
|
|
248
|
+
*
|
|
249
|
+
* This clears the batch cache entries for a document and its sections.
|
|
250
|
+
* Called when a document changes to ensure cache consistency.
|
|
251
|
+
*/
|
|
252
|
+
invalidateDocument(docPath: string): void;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Get global address cache instance for testing and batch management
|
|
256
|
+
*
|
|
257
|
+
* This allows external code to clear the batch cache and access statistics.
|
|
258
|
+
* Primarily used for:
|
|
259
|
+
* - Testing batch cache behavior
|
|
260
|
+
* - Clearing cache after batch operations
|
|
261
|
+
* - Monitoring cache statistics
|
|
262
|
+
*/
|
|
263
|
+
export declare function getGlobalAddressCache(): AddressCache;
|
|
264
|
+
/**
|
|
265
|
+
* Invalidate addressing cache entries for a specific document
|
|
266
|
+
*
|
|
267
|
+
* This should be called when a document changes to maintain cache consistency.
|
|
268
|
+
* Clears both the document entry and all section entries for that document.
|
|
269
|
+
*/
|
|
270
|
+
export declare function invalidateAddressCache(docPath: string): void;
|
|
271
|
+
/**
|
|
272
|
+
* Core addressing interfaces
|
|
273
|
+
*/
|
|
274
|
+
export interface DocumentAddress {
|
|
275
|
+
/**
|
|
276
|
+
* Full document path starting with /
|
|
277
|
+
* User-facing paths are relative to base folders:
|
|
278
|
+
* - /api/auth.md (relative to docs/)
|
|
279
|
+
* - /active.md (relative to coordinator/)
|
|
280
|
+
* - /archived/docs/api/auth.md (explicit archive prefix)
|
|
281
|
+
*/
|
|
282
|
+
readonly path: string;
|
|
283
|
+
/** Document slug (filename without extension) */
|
|
284
|
+
readonly slug: string;
|
|
285
|
+
/**
|
|
286
|
+
* Document namespace (folder path or 'root')
|
|
287
|
+
* Extracted from the path structure:
|
|
288
|
+
* - /api/auth.md → 'api'
|
|
289
|
+
* - /api/specs/auth.md → 'api/specs'
|
|
290
|
+
* - /active.md → 'root'
|
|
291
|
+
*/
|
|
292
|
+
readonly namespace: string;
|
|
293
|
+
/** Normalized path for internal use */
|
|
294
|
+
readonly normalizedPath: string;
|
|
295
|
+
/** Cache key for this address */
|
|
296
|
+
readonly cacheKey: string;
|
|
297
|
+
}
|
|
298
|
+
export interface SectionAddress {
|
|
299
|
+
/** Parent document address */
|
|
300
|
+
readonly document: DocumentAddress;
|
|
301
|
+
/** Section slug (normalized, no # prefix) */
|
|
302
|
+
readonly slug: string;
|
|
303
|
+
/** Full section path for referencing (document#section) */
|
|
304
|
+
readonly fullPath: string;
|
|
305
|
+
/** Cache key for this address */
|
|
306
|
+
readonly cacheKey: string;
|
|
307
|
+
}
|
|
308
|
+
export interface TaskAddress {
|
|
309
|
+
/** Parent document address */
|
|
310
|
+
readonly document: DocumentAddress;
|
|
311
|
+
/** Task slug (normalized, no # prefix) */
|
|
312
|
+
readonly slug: string;
|
|
313
|
+
/** Full task path for referencing */
|
|
314
|
+
readonly fullPath: string;
|
|
315
|
+
/** Flag indicating this is a task (always true) */
|
|
316
|
+
readonly isTask: true;
|
|
317
|
+
/** Cache key for this address */
|
|
318
|
+
readonly cacheKey: string;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Parse and normalize a document path with caching
|
|
322
|
+
*
|
|
323
|
+
* Accepts user-facing relative paths:
|
|
324
|
+
* - /api/auth.md (relative to docs/)
|
|
325
|
+
* - /active.md (relative to coordinator/)
|
|
326
|
+
* - /archived/docs/api/auth.md (explicit archive prefix)
|
|
327
|
+
*
|
|
328
|
+
* The system does NOT require or validate namespace prefixes like /docs/ or /coordinator/.
|
|
329
|
+
* Paths are relative to their base folders for cleaner user experience.
|
|
330
|
+
*
|
|
331
|
+
* @param docPath - Document path (relative to base folder)
|
|
332
|
+
* @returns Parsed and cached document address
|
|
333
|
+
* @throws {InvalidAddressError} When path format is invalid
|
|
334
|
+
*
|
|
335
|
+
* @example Regular document
|
|
336
|
+
* ```typescript
|
|
337
|
+
* const addr = parseDocumentAddress('/api/auth.md');
|
|
338
|
+
* // { path: '/api/auth.md', namespace: 'api', slug: 'auth' }
|
|
339
|
+
* ```
|
|
340
|
+
*
|
|
341
|
+
* @example Coordinator document
|
|
342
|
+
* ```typescript
|
|
343
|
+
* const addr = parseDocumentAddress('/active.md');
|
|
344
|
+
* // { path: '/active.md', namespace: 'root', slug: 'active' }
|
|
345
|
+
* ```
|
|
346
|
+
*
|
|
347
|
+
* @example Archived document
|
|
348
|
+
* ```typescript
|
|
349
|
+
* const addr = parseDocumentAddress('/archived/docs/api/auth.md');
|
|
350
|
+
* // { path: '/archived/docs/api/auth.md', namespace: 'archived/docs/api', slug: 'auth' }
|
|
351
|
+
* ```
|
|
352
|
+
*/
|
|
353
|
+
export declare function parseDocumentAddress(docPath: string): DocumentAddress;
|
|
354
|
+
/**
|
|
355
|
+
* Parse and normalize a section reference with caching
|
|
356
|
+
* Supports formats: "section", "#section", "/doc.md#section"
|
|
357
|
+
*/
|
|
358
|
+
export declare function parseSectionAddress(sectionRef: string, contextDoc?: string): SectionAddress;
|
|
359
|
+
/**
|
|
360
|
+
* Parse and normalize a task reference with caching
|
|
361
|
+
* Tasks are special sections that live under a "Tasks" parent section
|
|
362
|
+
*/
|
|
363
|
+
export declare function parseTaskAddress(taskRef: string, contextDoc?: string): TaskAddress;
|
|
364
|
+
/**
|
|
365
|
+
* Check if a section is a task by looking at document structure
|
|
366
|
+
*/
|
|
367
|
+
export declare function isTaskSection(sectionSlug: string, document: {
|
|
368
|
+
headings: ReadonlyArray<{
|
|
369
|
+
slug: string;
|
|
370
|
+
title: string;
|
|
371
|
+
depth: number;
|
|
372
|
+
}>;
|
|
373
|
+
}): Promise<boolean>;
|
|
374
|
+
/**
|
|
375
|
+
* Standardize addressing parameters for tool operations
|
|
376
|
+
*/
|
|
377
|
+
export interface StandardizedParams {
|
|
378
|
+
document: DocumentAddress;
|
|
379
|
+
section?: SectionAddress;
|
|
380
|
+
task?: TaskAddress;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Hierarchical context information for section addresses
|
|
384
|
+
*/
|
|
385
|
+
export interface HierarchicalContext {
|
|
386
|
+
full_path: string;
|
|
387
|
+
parent_path: string;
|
|
388
|
+
section_name: string;
|
|
389
|
+
depth: number;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Tool integration helpers - standard patterns for adopting the addressing system
|
|
393
|
+
*
|
|
394
|
+
* This class provides standardized methods for tools to consistently handle addressing,
|
|
395
|
+
* validation, formatting, and error handling across the MCP server.
|
|
396
|
+
*/
|
|
397
|
+
export declare class ToolIntegration {
|
|
398
|
+
/**
|
|
399
|
+
* Standard parameter validation and parsing for document-based tools
|
|
400
|
+
*
|
|
401
|
+
* Validates and parses document/section/task addresses into standardized format.
|
|
402
|
+
* Throws AddressingError for validation failures with appropriate error codes.
|
|
403
|
+
*
|
|
404
|
+
* @param params - Parameters containing document and optional section/task references
|
|
405
|
+
* @returns Object with validated addresses and original params
|
|
406
|
+
* @throws {DocumentNotFoundError} When document path is invalid
|
|
407
|
+
* @throws {SectionNotFoundError} When section reference is invalid
|
|
408
|
+
* @throws {InvalidAddressError} When address format is malformed
|
|
409
|
+
* @throws {AddressingError} For general parameter validation failures
|
|
410
|
+
*
|
|
411
|
+
* @example Basic document validation (relative path)
|
|
412
|
+
* ```typescript
|
|
413
|
+
* const { addresses } = ToolIntegration.validateAndParse({
|
|
414
|
+
* document: '/api/auth.md' // Relative to docs/
|
|
415
|
+
* });
|
|
416
|
+
* // Returns: { addresses: { document: DocumentAddress }, params: {...} }
|
|
417
|
+
* ```
|
|
418
|
+
*
|
|
419
|
+
* @example Coordinator document
|
|
420
|
+
* ```typescript
|
|
421
|
+
* const { addresses } = ToolIntegration.validateAndParse({
|
|
422
|
+
* document: '/active.md' // Relative to coordinator/
|
|
423
|
+
* });
|
|
424
|
+
* ```
|
|
425
|
+
*
|
|
426
|
+
* @example Document with section
|
|
427
|
+
* ```typescript
|
|
428
|
+
* const { addresses } = ToolIntegration.validateAndParse({
|
|
429
|
+
* document: '/api/auth.md',
|
|
430
|
+
* section: 'jwt-tokens'
|
|
431
|
+
* });
|
|
432
|
+
* // Returns: { addresses: { document: DocumentAddress, section: SectionAddress }, params: {...} }
|
|
433
|
+
* ```
|
|
434
|
+
*
|
|
435
|
+
* @example Hierarchical section addressing
|
|
436
|
+
* ```typescript
|
|
437
|
+
* const { addresses } = ToolIntegration.validateAndParse({
|
|
438
|
+
* document: '/api/auth.md',
|
|
439
|
+
* section: 'authentication/jwt-tokens'
|
|
440
|
+
* });
|
|
441
|
+
* // Handles hierarchical paths automatically
|
|
442
|
+
* ```
|
|
443
|
+
*/
|
|
444
|
+
static validateAndParse<T extends Record<string, unknown>>(params: T & {
|
|
445
|
+
document: string;
|
|
446
|
+
section?: string;
|
|
447
|
+
task?: string;
|
|
448
|
+
}): {
|
|
449
|
+
addresses: StandardizedParams;
|
|
450
|
+
params: T;
|
|
451
|
+
};
|
|
452
|
+
/**
|
|
453
|
+
* Standard document info response format
|
|
454
|
+
*
|
|
455
|
+
* Provides consistent document information structure across all tools.
|
|
456
|
+
* Returns only the human-readable title, as slug and namespace can be
|
|
457
|
+
* derived from the document path in the response.
|
|
458
|
+
*
|
|
459
|
+
* @param document - Document address object
|
|
460
|
+
* @param metadata - Optional metadata containing document title
|
|
461
|
+
* @returns Standardized document info object with title only
|
|
462
|
+
*
|
|
463
|
+
* @example Basic document info
|
|
464
|
+
* ```typescript
|
|
465
|
+
* const docInfo = ToolIntegration.formatDocumentInfo(document);
|
|
466
|
+
* // Returns: { title: 'auth' }
|
|
467
|
+
* ```
|
|
468
|
+
*
|
|
469
|
+
* @example With metadata title
|
|
470
|
+
* ```typescript
|
|
471
|
+
* const docInfo = ToolIntegration.formatDocumentInfo(document, { title: 'Authentication Guide' });
|
|
472
|
+
* // Returns: { title: 'Authentication Guide' }
|
|
473
|
+
* ```
|
|
474
|
+
*/
|
|
475
|
+
static formatDocumentInfo(document: DocumentAddress, metadata?: {
|
|
476
|
+
title: string;
|
|
477
|
+
}): {
|
|
478
|
+
title: string;
|
|
479
|
+
};
|
|
480
|
+
/**
|
|
481
|
+
* Standard section path formatting for responses with hierarchical indicator
|
|
482
|
+
*
|
|
483
|
+
* Formats section paths consistently with hierarchical indicators when applicable.
|
|
484
|
+
* Adds "(hierarchical)" suffix for sections containing forward slashes.
|
|
485
|
+
*
|
|
486
|
+
* @param section - Section address object
|
|
487
|
+
* @returns Formatted section path with hierarchical indicator if applicable
|
|
488
|
+
*
|
|
489
|
+
* @example Flat section
|
|
490
|
+
* ```typescript
|
|
491
|
+
* const path = ToolIntegration.formatSectionPath(flatSection);
|
|
492
|
+
* // Returns: '/api/auth.md#overview'
|
|
493
|
+
* ```
|
|
494
|
+
*
|
|
495
|
+
* @example Hierarchical section
|
|
496
|
+
* ```typescript
|
|
497
|
+
* const path = ToolIntegration.formatSectionPath(hierarchicalSection);
|
|
498
|
+
* // Returns: '/api/auth.md#authentication/jwt-tokens (hierarchical)'
|
|
499
|
+
* ```
|
|
500
|
+
*/
|
|
501
|
+
static formatSectionPath(section: SectionAddress): string;
|
|
502
|
+
/**
|
|
503
|
+
* Standard task path formatting for responses
|
|
504
|
+
*
|
|
505
|
+
* Formats task paths with consistent "(task)" indicator.
|
|
506
|
+
*
|
|
507
|
+
* @param task - Task address object
|
|
508
|
+
* @returns Formatted task path with task indicator
|
|
509
|
+
*
|
|
510
|
+
* @example Task path formatting
|
|
511
|
+
* ```typescript
|
|
512
|
+
* const path = ToolIntegration.formatTaskPath(taskAddress);
|
|
513
|
+
* // Returns: '/project/setup.md#initialize-project (task)'
|
|
514
|
+
* ```
|
|
515
|
+
*/
|
|
516
|
+
static formatTaskPath(task: TaskAddress): string;
|
|
517
|
+
/**
|
|
518
|
+
* Format hierarchical context for section addresses
|
|
519
|
+
*
|
|
520
|
+
* Provides detailed hierarchical information for sections with forward slashes.
|
|
521
|
+
* Returns null for flat sections to indicate no hierarchical structure.
|
|
522
|
+
*
|
|
523
|
+
* @param section - Section address object
|
|
524
|
+
* @returns Hierarchical context object or null for flat sections
|
|
525
|
+
*
|
|
526
|
+
* @example Flat section (returns null)
|
|
527
|
+
* ```typescript
|
|
528
|
+
* const context = ToolIntegration.formatHierarchicalContext(flatSection);
|
|
529
|
+
* // Returns: null
|
|
530
|
+
* ```
|
|
531
|
+
*
|
|
532
|
+
* @example Hierarchical section
|
|
533
|
+
* ```typescript
|
|
534
|
+
* const context = ToolIntegration.formatHierarchicalContext(hierarchicalSection);
|
|
535
|
+
* // Returns: {
|
|
536
|
+
* // full_path: 'authentication/jwt-tokens',
|
|
537
|
+
* // parent_path: 'authentication',
|
|
538
|
+
* // section_name: 'jwt-tokens',
|
|
539
|
+
* // depth: 2
|
|
540
|
+
* // }
|
|
541
|
+
* ```
|
|
542
|
+
*/
|
|
543
|
+
static formatHierarchicalContext(section: SectionAddress): HierarchicalContext | null;
|
|
544
|
+
/**
|
|
545
|
+
* Enhanced error formatting with hierarchical context
|
|
546
|
+
*
|
|
547
|
+
* Provides standardized error formatting with hierarchical-aware suggestions.
|
|
548
|
+
* Automatically adds helpful suggestions for hierarchical section errors.
|
|
549
|
+
*
|
|
550
|
+
* @param error - AddressingError to format
|
|
551
|
+
* @param suggestion - Optional custom suggestion to override defaults
|
|
552
|
+
* @returns Formatted error object with context and suggestions
|
|
553
|
+
*
|
|
554
|
+
* @example Basic error formatting
|
|
555
|
+
* ```typescript
|
|
556
|
+
* try {
|
|
557
|
+
* parseDocumentAddress('/invalid/path');
|
|
558
|
+
* } catch (error) {
|
|
559
|
+
* const formatted = ToolIntegration.formatHierarchicalError(error);
|
|
560
|
+
* // Returns: { error: 'Document not found: /invalid/path', context: { path: '/invalid/path' } }
|
|
561
|
+
* }
|
|
562
|
+
* ```
|
|
563
|
+
*
|
|
564
|
+
* @example Hierarchical section error with auto-suggestion
|
|
565
|
+
* ```typescript
|
|
566
|
+
* try {
|
|
567
|
+
* parseSectionAddress('auth/missing-section', '/api/guide.md');
|
|
568
|
+
* } catch (error) {
|
|
569
|
+
* const formatted = ToolIntegration.formatHierarchicalError(error);
|
|
570
|
+
* // Returns: {
|
|
571
|
+
* // error: 'Section not found: auth/missing-section',
|
|
572
|
+
* // context: { slug: 'auth/missing-section', documentPath: '/api/guide.md' },
|
|
573
|
+
* // suggestion: 'Section not found. Try checking parent section: auth'
|
|
574
|
+
* // }
|
|
575
|
+
* }
|
|
576
|
+
* ```
|
|
577
|
+
*
|
|
578
|
+
* @example Custom suggestion
|
|
579
|
+
* ```typescript
|
|
580
|
+
* const formatted = ToolIntegration.formatHierarchicalError(error, 'Check the document exists first');
|
|
581
|
+
* // Uses provided suggestion instead of auto-generated one
|
|
582
|
+
* ```
|
|
583
|
+
*/
|
|
584
|
+
static formatHierarchicalError(error: AddressingError, suggestion?: string): {
|
|
585
|
+
error: string;
|
|
586
|
+
context?: unknown;
|
|
587
|
+
suggestion?: string;
|
|
588
|
+
};
|
|
589
|
+
/**
|
|
590
|
+
* Type guard to safely check if error context has section-specific properties
|
|
591
|
+
*
|
|
592
|
+
* Provides type-safe validation for error context structure before accessing properties.
|
|
593
|
+
* Used internally by formatHierarchicalError for safe property access.
|
|
594
|
+
*
|
|
595
|
+
* @param context - Unknown context object to validate
|
|
596
|
+
* @returns True if context has required section properties
|
|
597
|
+
*
|
|
598
|
+
* @example Type guard usage
|
|
599
|
+
* ```typescript
|
|
600
|
+
* if (ToolIntegration.hasSectionContext(error.context)) {
|
|
601
|
+
* // TypeScript now knows context has slug and documentPath properties
|
|
602
|
+
* const slug = error.context.slug;
|
|
603
|
+
* const docPath = error.context.documentPath;
|
|
604
|
+
* }
|
|
605
|
+
* ```
|
|
606
|
+
*/
|
|
607
|
+
static hasSectionContext(context: unknown): context is {
|
|
608
|
+
slug: string;
|
|
609
|
+
documentPath: string;
|
|
610
|
+
};
|
|
611
|
+
/**
|
|
612
|
+
* Clear batch cache after batch operations
|
|
613
|
+
*
|
|
614
|
+
* This helper provides a standardized way for tools to clear the batch cache
|
|
615
|
+
* after completing multi-item operations. Clearing the cache frees memory
|
|
616
|
+
* and ensures fresh parsing for the next batch.
|
|
617
|
+
*
|
|
618
|
+
* @example Clearing cache after batch section operations
|
|
619
|
+
* ```typescript
|
|
620
|
+
* // Process multiple section operations
|
|
621
|
+
* for (const op of operations) {
|
|
622
|
+
* const { addresses } = ToolIntegration.validateAndParse({
|
|
623
|
+
* document: op.document,
|
|
624
|
+
* section: op.section
|
|
625
|
+
* });
|
|
626
|
+
* // ... process operation
|
|
627
|
+
* }
|
|
628
|
+
*
|
|
629
|
+
* // Clear batch cache after all operations complete
|
|
630
|
+
* ToolIntegration.clearBatchCache();
|
|
631
|
+
* ```
|
|
632
|
+
*/
|
|
633
|
+
static clearBatchCache(): void;
|
|
634
|
+
/**
|
|
635
|
+
* Common validation utilities to eliminate copy-paste patterns
|
|
636
|
+
*/
|
|
637
|
+
/**
|
|
638
|
+
* Validate document parameter - standard pattern used across tools
|
|
639
|
+
*
|
|
640
|
+
* Ensures document parameter is a non-empty string with consistent error messaging.
|
|
641
|
+
*
|
|
642
|
+
* @param document - Document parameter to validate
|
|
643
|
+
* @returns Validated document string
|
|
644
|
+
* @throws {AddressingError} When document is not a non-empty string
|
|
645
|
+
*
|
|
646
|
+
* @example Valid document
|
|
647
|
+
* ```typescript
|
|
648
|
+
* const doc = ToolIntegration.validateDocumentParameter('/api/auth.md');
|
|
649
|
+
* // Returns: '/api/auth.md'
|
|
650
|
+
* ```
|
|
651
|
+
*
|
|
652
|
+
* @example Invalid document
|
|
653
|
+
* ```typescript
|
|
654
|
+
* try {
|
|
655
|
+
* ToolIntegration.validateDocumentParameter('');
|
|
656
|
+
* } catch (error) {
|
|
657
|
+
* // Throws: AddressingError with code 'INVALID_PARAMETER'
|
|
658
|
+
* }
|
|
659
|
+
* ```
|
|
660
|
+
*/
|
|
661
|
+
static validateDocumentParameter(document: unknown): string;
|
|
662
|
+
/**
|
|
663
|
+
* Validate count limits with consistent error messages
|
|
664
|
+
*
|
|
665
|
+
* Validates that arrays don't exceed specified limits with standardized error messages.
|
|
666
|
+
*
|
|
667
|
+
* @param items - Array to validate count for
|
|
668
|
+
* @param maxCount - Maximum allowed count
|
|
669
|
+
* @param itemType - Type name for error messages
|
|
670
|
+
* @throws {AddressingError} When count exceeds limit
|
|
671
|
+
*
|
|
672
|
+
* @example Valid count
|
|
673
|
+
* ```typescript
|
|
674
|
+
* ToolIntegration.validateCountLimit(['a', 'b'], 5, 'documents');
|
|
675
|
+
* // Passes validation
|
|
676
|
+
* ```
|
|
677
|
+
*
|
|
678
|
+
* @example Count limit exceeded
|
|
679
|
+
* ```typescript
|
|
680
|
+
* try {
|
|
681
|
+
* ToolIntegration.validateCountLimit(['a', 'b', 'c'], 2, 'documents');
|
|
682
|
+
* } catch (error) {
|
|
683
|
+
* // Throws: AddressingError 'Too many documents. Maximum 2 documents allowed, got 3'
|
|
684
|
+
* }
|
|
685
|
+
* ```
|
|
686
|
+
*/
|
|
687
|
+
static validateCountLimit(items: unknown[], maxCount: number, itemType: string): void;
|
|
688
|
+
/**
|
|
689
|
+
* Validate array parameter with type checking
|
|
690
|
+
*
|
|
691
|
+
* Validates and normalizes array parameters that can be strings or arrays.
|
|
692
|
+
* Converts single strings to single-element arrays for consistent handling.
|
|
693
|
+
*
|
|
694
|
+
* @param param - Parameter to validate (string or array of strings)
|
|
695
|
+
* @param paramName - Parameter name for error messages
|
|
696
|
+
* @returns Normalized array of strings
|
|
697
|
+
* @throws {AddressingError} When parameter is not string or array
|
|
698
|
+
*
|
|
699
|
+
* @example String parameter
|
|
700
|
+
* ```typescript
|
|
701
|
+
* const result = ToolIntegration.validateArrayParameter('single', 'documents');
|
|
702
|
+
* // Returns: ['single']
|
|
703
|
+
* ```
|
|
704
|
+
*
|
|
705
|
+
* @example Array parameter
|
|
706
|
+
* ```typescript
|
|
707
|
+
* const result = ToolIntegration.validateArrayParameter(['a', 'b'], 'documents');
|
|
708
|
+
* // Returns: ['a', 'b']
|
|
709
|
+
* ```
|
|
710
|
+
*
|
|
711
|
+
* @example Invalid parameter
|
|
712
|
+
* ```typescript
|
|
713
|
+
* try {
|
|
714
|
+
* ToolIntegration.validateArrayParameter(null, 'documents');
|
|
715
|
+
* } catch (error) {
|
|
716
|
+
* // Throws: AddressingError 'documents parameter is required and must be a string or array of strings'
|
|
717
|
+
* }
|
|
718
|
+
* ```
|
|
719
|
+
*/
|
|
720
|
+
static validateArrayParameter(param: unknown, paramName: string): string[];
|
|
721
|
+
/**
|
|
722
|
+
* Validate string parameter with consistent error handling
|
|
723
|
+
*
|
|
724
|
+
* Ensures parameter is a non-empty string with standardized error messages.
|
|
725
|
+
* Prevents common validation inconsistencies across tools.
|
|
726
|
+
*
|
|
727
|
+
* @param param - Parameter to validate
|
|
728
|
+
* @param paramName - Parameter name for error messages
|
|
729
|
+
* @returns Validated string parameter
|
|
730
|
+
* @throws {AddressingError} When parameter is not a non-empty string
|
|
731
|
+
*
|
|
732
|
+
* @example Valid string parameter
|
|
733
|
+
* ```typescript
|
|
734
|
+
* const operation = ToolIntegration.validateStringParameter('edit', 'operation');
|
|
735
|
+
* // Returns: 'edit'
|
|
736
|
+
* ```
|
|
737
|
+
*
|
|
738
|
+
* @example Invalid string parameter
|
|
739
|
+
* ```typescript
|
|
740
|
+
* try {
|
|
741
|
+
* ToolIntegration.validateStringParameter('', 'operation');
|
|
742
|
+
* } catch (error) {
|
|
743
|
+
* // Throws: AddressingError with code 'INVALID_PARAMETER'
|
|
744
|
+
* }
|
|
745
|
+
* ```
|
|
746
|
+
*/
|
|
747
|
+
static validateStringParameter(param: unknown, paramName: string): string;
|
|
748
|
+
/**
|
|
749
|
+
* Validate optional string parameter with consistent error handling
|
|
750
|
+
*
|
|
751
|
+
* Validates optional string parameters, returning undefined for null/undefined inputs.
|
|
752
|
+
* Ensures non-empty strings when provided.
|
|
753
|
+
*
|
|
754
|
+
* @param param - Optional parameter to validate
|
|
755
|
+
* @param paramName - Parameter name for error messages
|
|
756
|
+
* @returns Validated string or undefined
|
|
757
|
+
* @throws {AddressingError} When parameter is empty string or invalid type
|
|
758
|
+
*
|
|
759
|
+
* @example Valid optional parameter
|
|
760
|
+
* ```typescript
|
|
761
|
+
* const content = ToolIntegration.validateOptionalStringParameter('hello', 'content');
|
|
762
|
+
* // Returns: 'hello'
|
|
763
|
+
*
|
|
764
|
+
* const content2 = ToolIntegration.validateOptionalStringParameter(undefined, 'content');
|
|
765
|
+
* // Returns: undefined
|
|
766
|
+
* ```
|
|
767
|
+
*/
|
|
768
|
+
static validateOptionalStringParameter(param: unknown, paramName: string): string | undefined;
|
|
769
|
+
/**
|
|
770
|
+
* Validate operation parameter against allowed values
|
|
771
|
+
*
|
|
772
|
+
* Ensures operation parameter is one of the allowed values with consistent error messaging.
|
|
773
|
+
* Prevents duplicate validation logic across tools.
|
|
774
|
+
*
|
|
775
|
+
* @param operation - Operation to validate
|
|
776
|
+
* @param allowedOperations - Array of allowed operation values
|
|
777
|
+
* @param toolName - Tool name for error context
|
|
778
|
+
* @returns Validated operation string
|
|
779
|
+
* @throws {AddressingError} When operation is not in allowed list
|
|
780
|
+
*
|
|
781
|
+
* @example Valid operation
|
|
782
|
+
* ```typescript
|
|
783
|
+
* const op = ToolIntegration.validateOperation('edit', ['list', 'create', 'edit'], 'task');
|
|
784
|
+
* // Returns: 'edit'
|
|
785
|
+
* ```
|
|
786
|
+
*
|
|
787
|
+
* @example Invalid operation
|
|
788
|
+
* ```typescript
|
|
789
|
+
* try {
|
|
790
|
+
* ToolIntegration.validateOperation('invalid', ['list', 'create'], 'task');
|
|
791
|
+
* } catch (error) {
|
|
792
|
+
* // Throws: AddressingError 'Invalid operation: invalid. Must be one of: list, create'
|
|
793
|
+
* }
|
|
794
|
+
* ```
|
|
795
|
+
*/
|
|
796
|
+
static validateOperation(operation: unknown, allowedOperations: readonly string[], toolName: string): string;
|
|
797
|
+
}
|
|
798
|
+
export {};
|
|
799
|
+
//# sourceMappingURL=addressing-system.d.ts.map
|