@ffschrattenecker/tm1-mcp-server 6.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/CHANGELOG.md +1211 -0
- package/LICENSE +21 -0
- package/NOTICE +34 -0
- package/README.md +276 -0
- package/dist/config.d.ts +35 -0
- package/dist/config.js +238 -0
- package/dist/http-transport.d.ts +8 -0
- package/dist/http-transport.js +132 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +164 -0
- package/dist/lib/callgraph/callGraph.d.ts +124 -0
- package/dist/lib/callgraph/callGraph.js +334 -0
- package/dist/lib/callgraph/choreGraph.d.ts +23 -0
- package/dist/lib/callgraph/choreGraph.js +102 -0
- package/dist/lib/callgraph/dataFlow.d.ts +74 -0
- package/dist/lib/callgraph/dataFlow.js +271 -0
- package/dist/lib/callgraph/datasourceMembership.d.ts +31 -0
- package/dist/lib/callgraph/datasourceMembership.js +142 -0
- package/dist/lib/callgraph/lintTypes.d.ts +28 -0
- package/dist/lib/callgraph/lintTypes.js +2 -0
- package/dist/lib/callgraph/mdxMembers.d.ts +29 -0
- package/dist/lib/callgraph/mdxMembers.js +97 -0
- package/dist/lib/callgraph/referenceIndex.d.ts +179 -0
- package/dist/lib/callgraph/referenceIndex.js +584 -0
- package/dist/lib/callgraph/rulesLinter.d.ts +55 -0
- package/dist/lib/callgraph/rulesLinter.js +776 -0
- package/dist/lib/callgraph/rulesParser.d.ts +26 -0
- package/dist/lib/callgraph/rulesParser.js +71 -0
- package/dist/lib/callgraph/subsetUsage.d.ts +16 -0
- package/dist/lib/callgraph/subsetUsage.js +134 -0
- package/dist/lib/callgraph/tiParser.d.ts +21 -0
- package/dist/lib/callgraph/tiParser.js +672 -0
- package/dist/lib/callgraph/tiSignatures.d.ts +32 -0
- package/dist/lib/callgraph/tiSignatures.js +6185 -0
- package/dist/lib/callgraph/tm1-adapter.d.ts +32 -0
- package/dist/lib/callgraph/tm1-adapter.js +159 -0
- package/dist/lib/callgraph/types.d.ts +53 -0
- package/dist/lib/callgraph/types.js +2 -0
- package/dist/lib/callgraph/variableEnv.d.ts +86 -0
- package/dist/lib/callgraph/variableEnv.js +214 -0
- package/dist/lib/cell-address.d.ts +12 -0
- package/dist/lib/cell-address.js +71 -0
- package/dist/lib/complexity/antipatterns.d.ts +22 -0
- package/dist/lib/complexity/antipatterns.js +302 -0
- package/dist/lib/complexity/comment-classifier.d.ts +24 -0
- package/dist/lib/complexity/comment-classifier.js +43 -0
- package/dist/lib/complexity/cross-process.d.ts +78 -0
- package/dist/lib/complexity/cross-process.js +114 -0
- package/dist/lib/complexity/process-metrics.d.ts +78 -0
- package/dist/lib/complexity/process-metrics.js +278 -0
- package/dist/lib/complexity/rules-metrics.d.ts +31 -0
- package/dist/lib/complexity/rules-metrics.js +99 -0
- package/dist/lib/concurrency.d.ts +11 -0
- package/dist/lib/concurrency.js +27 -0
- package/dist/lib/control-name.d.ts +10 -0
- package/dist/lib/control-name.js +10 -0
- package/dist/lib/coordinate-error.d.ts +3 -0
- package/dist/lib/coordinate-error.js +29 -0
- package/dist/lib/credential-format.d.ts +23 -0
- package/dist/lib/credential-format.js +25 -0
- package/dist/lib/cube-stats/fetcher.d.ts +106 -0
- package/dist/lib/cube-stats/fetcher.js +194 -0
- package/dist/lib/feeders/brackets.d.ts +47 -0
- package/dist/lib/feeders/brackets.js +195 -0
- package/dist/lib/feeders/element-type-cache.d.ts +42 -0
- package/dist/lib/feeders/element-type-cache.js +86 -0
- package/dist/lib/feeders/static-heuristics.d.ts +101 -0
- package/dist/lib/feeders/static-heuristics.js +202 -0
- package/dist/lib/git-process.d.ts +67 -0
- package/dist/lib/git-process.js +243 -0
- package/dist/lib/mask-secrets.d.ts +10 -0
- package/dist/lib/mask-secrets.js +99 -0
- package/dist/lib/mdx.d.ts +3 -0
- package/dist/lib/mdx.js +13 -0
- package/dist/lib/naming/odata-filter.d.ts +15 -0
- package/dist/lib/naming/odata-filter.js +81 -0
- package/dist/lib/naming/rules.d.ts +34 -0
- package/dist/lib/naming/rules.js +215 -0
- package/dist/lib/pro-parser.d.ts +19 -0
- package/dist/lib/pro-parser.js +260 -0
- package/dist/lib/pro-serializer.d.ts +19 -0
- package/dist/lib/pro-serializer.js +170 -0
- package/dist/lib/process-parts-schema.d.ts +45 -0
- package/dist/lib/process-parts-schema.js +46 -0
- package/dist/lib/process-refs.d.ts +88 -0
- package/dist/lib/process-refs.js +441 -0
- package/dist/lib/rules-outline.d.ts +29 -0
- package/dist/lib/rules-outline.js +68 -0
- package/dist/lib/rules-patch.d.ts +6 -0
- package/dist/lib/rules-patch.js +59 -0
- package/dist/lib/safe-regex.d.ts +15 -0
- package/dist/lib/safe-regex.js +37 -0
- package/dist/lib/sample-cells.d.ts +48 -0
- package/dist/lib/sample-cells.js +146 -0
- package/dist/lib/slim-json-schema.d.ts +20 -0
- package/dist/lib/slim-json-schema.js +68 -0
- package/dist/lib/strip-comments.d.ts +23 -0
- package/dist/lib/strip-comments.js +61 -0
- package/dist/lib/tm1-events.d.ts +16 -0
- package/dist/lib/tm1-events.js +29 -0
- package/dist/lib/v12-compat/deprecated-ti.d.ts +17 -0
- package/dist/lib/v12-compat/deprecated-ti.js +257 -0
- package/dist/lib/v12-compat/scanner.d.ts +10 -0
- package/dist/lib/v12-compat/scanner.js +43 -0
- package/dist/lib/variables-ui-data.d.ts +26 -0
- package/dist/lib/variables-ui-data.js +77 -0
- package/dist/load-env.d.ts +2 -0
- package/dist/load-env.js +29 -0
- package/dist/logger.d.ts +4 -0
- package/dist/logger.js +60 -0
- package/dist/prompts/index.d.ts +3 -0
- package/dist/prompts/index.js +141 -0
- package/dist/resources/index.d.ts +5 -0
- package/dist/resources/index.js +237 -0
- package/dist/resources/list-handler.d.ts +40 -0
- package/dist/resources/list-handler.js +86 -0
- package/dist/resources/subscriptions.d.ts +19 -0
- package/dist/resources/subscriptions.js +80 -0
- package/dist/schemas/cells.d.ts +17 -0
- package/dist/schemas/cells.js +13 -0
- package/dist/schemas/common.d.ts +16 -0
- package/dist/schemas/common.js +14 -0
- package/dist/schemas/index.d.ts +10 -0
- package/dist/schemas/index.js +23 -0
- package/dist/schemas/metadata.d.ts +70 -0
- package/dist/schemas/metadata.js +47 -0
- package/dist/schemas/monitoring.d.ts +95 -0
- package/dist/schemas/monitoring.js +69 -0
- package/dist/schemas/processes.d.ts +74 -0
- package/dist/schemas/processes.js +66 -0
- package/dist/schemas/scheduling.d.ts +13 -0
- package/dist/schemas/scheduling.js +13 -0
- package/dist/schemas/security.d.ts +19 -0
- package/dist/schemas/security.js +16 -0
- package/dist/schemas/subsets.d.ts +12 -0
- package/dist/schemas/subsets.js +12 -0
- package/dist/schemas/views.d.ts +9 -0
- package/dist/schemas/views.js +9 -0
- package/dist/session-manager.d.ts +79 -0
- package/dist/session-manager.js +281 -0
- package/dist/tm1-client/connection/profile.d.ts +13 -0
- package/dist/tm1-client/connection/profile.js +99 -0
- package/dist/tm1-client/dispatcher.d.ts +5 -0
- package/dist/tm1-client/dispatcher.js +31 -0
- package/dist/tm1-client/http.d.ts +81 -0
- package/dist/tm1-client/http.js +547 -0
- package/dist/tm1-client/services/batch-service.d.ts +123 -0
- package/dist/tm1-client/services/batch-service.js +455 -0
- package/dist/tm1-client/services/cell-service.d.ts +71 -0
- package/dist/tm1-client/services/cell-service.js +333 -0
- package/dist/tm1-client/services/cellset-transform.d.ts +26 -0
- package/dist/tm1-client/services/cellset-transform.js +80 -0
- package/dist/tm1-client/services/chore-service.d.ts +68 -0
- package/dist/tm1-client/services/chore-service.js +179 -0
- package/dist/tm1-client/services/chore-status.d.ts +11 -0
- package/dist/tm1-client/services/chore-status.js +127 -0
- package/dist/tm1-client/services/cube-service.d.ts +134 -0
- package/dist/tm1-client/services/cube-service.js +294 -0
- package/dist/tm1-client/services/dimension-service.d.ts +118 -0
- package/dist/tm1-client/services/dimension-service.js +249 -0
- package/dist/tm1-client/services/element-service.d.ts +245 -0
- package/dist/tm1-client/services/element-service.js +809 -0
- package/dist/tm1-client/services/fallback.d.ts +44 -0
- package/dist/tm1-client/services/fallback.js +72 -0
- package/dist/tm1-client/services/file-service.d.ts +53 -0
- package/dist/tm1-client/services/file-service.js +218 -0
- package/dist/tm1-client/services/hierarchy-service.d.ts +129 -0
- package/dist/tm1-client/services/hierarchy-service.js +332 -0
- package/dist/tm1-client/services/monitoring-service.d.ts +34 -0
- package/dist/tm1-client/services/monitoring-service.js +123 -0
- package/dist/tm1-client/services/odata-page.d.ts +71 -0
- package/dist/tm1-client/services/odata-page.js +87 -0
- package/dist/tm1-client/services/process-service.d.ts +278 -0
- package/dist/tm1-client/services/process-service.js +874 -0
- package/dist/tm1-client/services/process-status.d.ts +21 -0
- package/dist/tm1-client/services/process-status.js +89 -0
- package/dist/tm1-client/services/security-service.d.ts +50 -0
- package/dist/tm1-client/services/security-service.js +93 -0
- package/dist/tm1-client/services/server-service.d.ts +116 -0
- package/dist/tm1-client/services/server-service.js +504 -0
- package/dist/tm1-client/services/subset-service.d.ts +37 -0
- package/dist/tm1-client/services/subset-service.js +122 -0
- package/dist/tm1-client/services/view-service.d.ts +46 -0
- package/dist/tm1-client/services/view-service.js +287 -0
- package/dist/tm1-client.d.ts +56 -0
- package/dist/tm1-client.js +126 -0
- package/dist/tools/analysis/analyze-callgraph.d.ts +28 -0
- package/dist/tools/analysis/analyze-callgraph.js +350 -0
- package/dist/tools/analysis/analyze-chore-graph.d.ts +2 -0
- package/dist/tools/analysis/analyze-chore-graph.js +148 -0
- package/dist/tools/analysis/analyze-object-usage.d.ts +2 -0
- package/dist/tools/analysis/analyze-object-usage.js +143 -0
- package/dist/tools/analysis/audit-complexity.d.ts +2 -0
- package/dist/tools/analysis/audit-complexity.js +255 -0
- package/dist/tools/analysis/audit-feeders.d.ts +2 -0
- package/dist/tools/analysis/audit-feeders.js +417 -0
- package/dist/tools/analysis/audit-naming.d.ts +2 -0
- package/dist/tools/analysis/audit-naming.js +379 -0
- package/dist/tools/analysis/check-v12-readiness.d.ts +2 -0
- package/dist/tools/analysis/check-v12-readiness.js +136 -0
- package/dist/tools/analysis/find-orphan-dimensions.d.ts +2 -0
- package/dist/tools/analysis/find-orphan-dimensions.js +55 -0
- package/dist/tools/analysis/invalidate-callgraph-cache.d.ts +2 -0
- package/dist/tools/analysis/invalidate-callgraph-cache.js +40 -0
- package/dist/tools/analysis/trace-data-flow.d.ts +2 -0
- package/dist/tools/analysis/trace-data-flow.js +138 -0
- package/dist/tools/annotations.d.ts +12 -0
- package/dist/tools/annotations.js +61 -0
- package/dist/tools/celldata/check-feeders.d.ts +2 -0
- package/dist/tools/celldata/check-feeders.js +48 -0
- package/dist/tools/celldata/check-writable-coords.d.ts +2 -0
- package/dist/tools/celldata/check-writable-coords.js +126 -0
- package/dist/tools/celldata/execute-mdx.d.ts +17 -0
- package/dist/tools/celldata/execute-mdx.js +126 -0
- package/dist/tools/celldata/get-cell-value.d.ts +2 -0
- package/dist/tools/celldata/get-cell-value.js +30 -0
- package/dist/tools/celldata/get-view-definition.d.ts +2 -0
- package/dist/tools/celldata/get-view-definition.js +29 -0
- package/dist/tools/celldata/get-view.d.ts +2 -0
- package/dist/tools/celldata/get-view.js +55 -0
- package/dist/tools/celldata/sample-cells.d.ts +2 -0
- package/dist/tools/celldata/sample-cells.js +101 -0
- package/dist/tools/celldata/trace-cell-calculation.d.ts +2 -0
- package/dist/tools/celldata/trace-cell-calculation.js +53 -0
- package/dist/tools/celldata/trace-feeders.d.ts +2 -0
- package/dist/tools/celldata/trace-feeders.js +44 -0
- package/dist/tools/celldata/write-cells.d.ts +2 -0
- package/dist/tools/celldata/write-cells.js +65 -0
- package/dist/tools/confirm.d.ts +10 -0
- package/dist/tools/confirm.js +64 -0
- package/dist/tools/define-tool.d.ts +51 -0
- package/dist/tools/define-tool.js +49 -0
- package/dist/tools/dimension-management/bulk-upsert-elements.d.ts +2 -0
- package/dist/tools/dimension-management/bulk-upsert-elements.js +103 -0
- package/dist/tools/dimension-management/create-dimension.d.ts +2 -0
- package/dist/tools/dimension-management/create-dimension.js +22 -0
- package/dist/tools/dimension-management/create-element-attribute.d.ts +2 -0
- package/dist/tools/dimension-management/create-element-attribute.js +26 -0
- package/dist/tools/dimension-management/create-element.d.ts +2 -0
- package/dist/tools/dimension-management/create-element.js +31 -0
- package/dist/tools/dimension-management/create-hierarchy.d.ts +2 -0
- package/dist/tools/dimension-management/create-hierarchy.js +22 -0
- package/dist/tools/dimension-management/delete-dimension.d.ts +2 -0
- package/dist/tools/dimension-management/delete-dimension.js +25 -0
- package/dist/tools/dimension-management/delete-element.d.ts +2 -0
- package/dist/tools/dimension-management/delete-element.js +26 -0
- package/dist/tools/dimension-management/delete-elements.d.ts +2 -0
- package/dist/tools/dimension-management/delete-elements.js +44 -0
- package/dist/tools/dimension-management/delete-hierarchy.d.ts +2 -0
- package/dist/tools/dimension-management/delete-hierarchy.js +35 -0
- package/dist/tools/dimension-management/get-element-attribute-values.d.ts +2 -0
- package/dist/tools/dimension-management/get-element-attribute-values.js +77 -0
- package/dist/tools/dimension-management/list-element-attributes.d.ts +2 -0
- package/dist/tools/dimension-management/list-element-attributes.js +31 -0
- package/dist/tools/dimension-management/move-element.d.ts +2 -0
- package/dist/tools/dimension-management/move-element.js +28 -0
- package/dist/tools/dimension-management/update-element-attribute-value.d.ts +2 -0
- package/dist/tools/dimension-management/update-element-attribute-value.js +80 -0
- package/dist/tools/dimension-management/update-element.d.ts +2 -0
- package/dist/tools/dimension-management/update-element.js +35 -0
- package/dist/tools/error-format.d.ts +22 -0
- package/dist/tools/error-format.js +130 -0
- package/dist/tools/fileops/delete-file.d.ts +2 -0
- package/dist/tools/fileops/delete-file.js +32 -0
- package/dist/tools/fileops/get-file-content.d.ts +2 -0
- package/dist/tools/fileops/get-file-content.js +76 -0
- package/dist/tools/fileops/list-files.d.ts +2 -0
- package/dist/tools/fileops/list-files.js +43 -0
- package/dist/tools/fileops/search-files.d.ts +2 -0
- package/dist/tools/fileops/search-files.js +76 -0
- package/dist/tools/fileops/upload-file.d.ts +2 -0
- package/dist/tools/fileops/upload-file.js +69 -0
- package/dist/tools/format.d.ts +57 -0
- package/dist/tools/format.js +157 -0
- package/dist/tools/hierarchy.d.ts +6 -0
- package/dist/tools/hierarchy.js +27 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.js +263 -0
- package/dist/tools/local-file.d.ts +16 -0
- package/dist/tools/local-file.js +88 -0
- package/dist/tools/metadata/get-ancestors.d.ts +2 -0
- package/dist/tools/metadata/get-ancestors.js +36 -0
- package/dist/tools/metadata/get-descendants.d.ts +2 -0
- package/dist/tools/metadata/get-descendants.js +64 -0
- package/dist/tools/metadata/get-hierarchy.d.ts +2 -0
- package/dist/tools/metadata/get-hierarchy.js +130 -0
- package/dist/tools/metadata/list-chores.d.ts +2 -0
- package/dist/tools/metadata/list-chores.js +62 -0
- package/dist/tools/metadata/list-cubes.d.ts +2 -0
- package/dist/tools/metadata/list-cubes.js +128 -0
- package/dist/tools/metadata/list-dimensions.d.ts +2 -0
- package/dist/tools/metadata/list-dimensions.js +131 -0
- package/dist/tools/metadata/list-processes-grouped.d.ts +2 -0
- package/dist/tools/metadata/list-processes-grouped.js +96 -0
- package/dist/tools/metadata/list-processes.d.ts +2 -0
- package/dist/tools/metadata/list-processes.js +108 -0
- package/dist/tools/metadata/resolve-default-members.d.ts +2 -0
- package/dist/tools/metadata/resolve-default-members.js +46 -0
- package/dist/tools/model-building/check-cube-rule.d.ts +2 -0
- package/dist/tools/model-building/check-cube-rule.js +51 -0
- package/dist/tools/model-building/clear-cube.d.ts +2 -0
- package/dist/tools/model-building/clear-cube.js +46 -0
- package/dist/tools/model-building/create-cube.d.ts +2 -0
- package/dist/tools/model-building/create-cube.js +34 -0
- package/dist/tools/model-building/delete-cube.d.ts +2 -0
- package/dist/tools/model-building/delete-cube.js +27 -0
- package/dist/tools/model-building/get-all-cube-rules.d.ts +2 -0
- package/dist/tools/model-building/get-all-cube-rules.js +149 -0
- package/dist/tools/model-building/get-cube-rules.d.ts +2 -0
- package/dist/tools/model-building/get-cube-rules.js +69 -0
- package/dist/tools/model-building/rules-source.d.ts +21 -0
- package/dist/tools/model-building/rules-source.js +49 -0
- package/dist/tools/model-building/search-rules.d.ts +2 -0
- package/dist/tools/model-building/search-rules.js +132 -0
- package/dist/tools/model-building/set-cube-rules.d.ts +2 -0
- package/dist/tools/model-building/set-cube-rules.js +81 -0
- package/dist/tools/model-building/unload-cube.d.ts +2 -0
- package/dist/tools/model-building/unload-cube.js +23 -0
- package/dist/tools/operations/diagnose-process-error.d.ts +2 -0
- package/dist/tools/operations/diagnose-process-error.js +178 -0
- package/dist/tools/operations/error-log-helpers.d.ts +25 -0
- package/dist/tools/operations/error-log-helpers.js +57 -0
- package/dist/tools/operations/get-audit-log.d.ts +2 -0
- package/dist/tools/operations/get-audit-log.js +70 -0
- package/dist/tools/operations/get-cube-stats.d.ts +2 -0
- package/dist/tools/operations/get-cube-stats.js +107 -0
- package/dist/tools/operations/get-error-log-content.d.ts +2 -0
- package/dist/tools/operations/get-error-log-content.js +164 -0
- package/dist/tools/operations/get-jobs.d.ts +3 -0
- package/dist/tools/operations/get-jobs.js +51 -0
- package/dist/tools/operations/get-message-log.d.ts +2 -0
- package/dist/tools/operations/get-message-log.js +63 -0
- package/dist/tools/operations/get-server-info.d.ts +2 -0
- package/dist/tools/operations/get-server-info.js +180 -0
- package/dist/tools/operations/get-server-state.d.ts +2 -0
- package/dist/tools/operations/get-server-state.js +129 -0
- package/dist/tools/operations/get-sessions.d.ts +2 -0
- package/dist/tools/operations/get-sessions.js +76 -0
- package/dist/tools/operations/get-threads.d.ts +3 -0
- package/dist/tools/operations/get-threads.js +50 -0
- package/dist/tools/operations/get-transaction-log.d.ts +2 -0
- package/dist/tools/operations/get-transaction-log.js +63 -0
- package/dist/tools/operations/list-error-logs.d.ts +8 -0
- package/dist/tools/operations/list-error-logs.js +157 -0
- package/dist/tools/operations/save-data.d.ts +2 -0
- package/dist/tools/operations/save-data.js +50 -0
- package/dist/tools/pagination.d.ts +32 -0
- package/dist/tools/pagination.js +116 -0
- package/dist/tools/scheduling/create-chore.d.ts +2 -0
- package/dist/tools/scheduling/create-chore.js +93 -0
- package/dist/tools/scheduling/delete-chore.d.ts +2 -0
- package/dist/tools/scheduling/delete-chore.js +22 -0
- package/dist/tools/scheduling/execute-chore.d.ts +2 -0
- package/dist/tools/scheduling/execute-chore.js +52 -0
- package/dist/tools/scheduling/toggle-chore.d.ts +2 -0
- package/dist/tools/scheduling/toggle-chore.js +22 -0
- package/dist/tools/scheduling/update-chore.d.ts +2 -0
- package/dist/tools/scheduling/update-chore.js +71 -0
- package/dist/tools/schemas/common.d.ts +10 -0
- package/dist/tools/schemas/common.js +23 -0
- package/dist/tools/schemas/items-analysis.d.ts +394 -0
- package/dist/tools/schemas/items-analysis.js +419 -0
- package/dist/tools/schemas/items-cells.d.ts +70 -0
- package/dist/tools/schemas/items-cells.js +65 -0
- package/dist/tools/schemas/items-common.d.ts +18 -0
- package/dist/tools/schemas/items-common.js +39 -0
- package/dist/tools/schemas/items-fileops.d.ts +11 -0
- package/dist/tools/schemas/items-fileops.js +13 -0
- package/dist/tools/schemas/items-metadata.d.ts +262 -0
- package/dist/tools/schemas/items-metadata.js +184 -0
- package/dist/tools/schemas/items-monitoring.d.ts +79 -0
- package/dist/tools/schemas/items-monitoring.js +78 -0
- package/dist/tools/schemas/items-processes.d.ts +279 -0
- package/dist/tools/schemas/items-processes.js +235 -0
- package/dist/tools/schemas/items-scheduling.d.ts +25 -0
- package/dist/tools/schemas/items-scheduling.js +26 -0
- package/dist/tools/schemas/items-security.d.ts +19 -0
- package/dist/tools/schemas/items-security.js +12 -0
- package/dist/tools/schemas/items-subsets.d.ts +2 -0
- package/dist/tools/schemas/items-subsets.js +4 -0
- package/dist/tools/schemas/items-views.d.ts +38 -0
- package/dist/tools/schemas/items-views.js +26 -0
- package/dist/tools/schemas/items.d.ts +12 -0
- package/dist/tools/schemas/items.js +23 -0
- package/dist/tools/schemas/markdown-capable.d.ts +21 -0
- package/dist/tools/schemas/markdown-capable.js +58 -0
- package/dist/tools/schemas/output-schema.d.ts +24 -0
- package/dist/tools/schemas/output-schema.js +25 -0
- package/dist/tools/security/assign-client-group.d.ts +2 -0
- package/dist/tools/security/assign-client-group.js +20 -0
- package/dist/tools/security/create-client.d.ts +2 -0
- package/dist/tools/security/create-client.js +28 -0
- package/dist/tools/security/delete-client.d.ts +2 -0
- package/dist/tools/security/delete-client.js +22 -0
- package/dist/tools/security/get-client.d.ts +2 -0
- package/dist/tools/security/get-client.js +20 -0
- package/dist/tools/security/list-clients.d.ts +2 -0
- package/dist/tools/security/list-clients.js +86 -0
- package/dist/tools/security/list-groups.d.ts +2 -0
- package/dist/tools/security/list-groups.js +43 -0
- package/dist/tools/security/remove-client-group.d.ts +2 -0
- package/dist/tools/security/remove-client-group.js +27 -0
- package/dist/tools/security/update-client.d.ts +2 -0
- package/dist/tools/security/update-client.js +22 -0
- package/dist/tools/subsets/create-subset.d.ts +2 -0
- package/dist/tools/subsets/create-subset.js +44 -0
- package/dist/tools/subsets/delete-subset.d.ts +2 -0
- package/dist/tools/subsets/delete-subset.js +26 -0
- package/dist/tools/subsets/get-subset.d.ts +2 -0
- package/dist/tools/subsets/get-subset.js +29 -0
- package/dist/tools/subsets/list-subsets.d.ts +2 -0
- package/dist/tools/subsets/list-subsets.js +36 -0
- package/dist/tools/subsets/update-subset.d.ts +2 -0
- package/dist/tools/subsets/update-subset.js +33 -0
- package/dist/tools/ti-development/check-process-code.d.ts +2 -0
- package/dist/tools/ti-development/check-process-code.js +96 -0
- package/dist/tools/ti-development/compile-process.d.ts +2 -0
- package/dist/tools/ti-development/compile-process.js +32 -0
- package/dist/tools/ti-development/copy-process.d.ts +2 -0
- package/dist/tools/ti-development/copy-process.js +32 -0
- package/dist/tools/ti-development/delete-process.d.ts +2 -0
- package/dist/tools/ti-development/delete-process.js +26 -0
- package/dist/tools/ti-development/diff-process-with-file.d.ts +2 -0
- package/dist/tools/ti-development/diff-process-with-file.js +208 -0
- package/dist/tools/ti-development/diff-processes.d.ts +2 -0
- package/dist/tools/ti-development/diff-processes.js +312 -0
- package/dist/tools/ti-development/execute-process.d.ts +8 -0
- package/dist/tools/ti-development/execute-process.js +109 -0
- package/dist/tools/ti-development/export-process-to-git.d.ts +2 -0
- package/dist/tools/ti-development/export-process-to-git.js +113 -0
- package/dist/tools/ti-development/export-process-to-pro.d.ts +2 -0
- package/dist/tools/ti-development/export-process-to-pro.js +117 -0
- package/dist/tools/ti-development/get-all-processes-code.d.ts +2 -0
- package/dist/tools/ti-development/get-all-processes-code.js +131 -0
- package/dist/tools/ti-development/get-process-code.d.ts +2 -0
- package/dist/tools/ti-development/get-process-code.js +100 -0
- package/dist/tools/ti-development/get-process-datasource.d.ts +2 -0
- package/dist/tools/ti-development/get-process-datasource.js +20 -0
- package/dist/tools/ti-development/get-process-parameters.d.ts +2 -0
- package/dist/tools/ti-development/get-process-parameters.js +25 -0
- package/dist/tools/ti-development/get-process-variables.d.ts +2 -0
- package/dist/tools/ti-development/get-process-variables.js +38 -0
- package/dist/tools/ti-development/get-process.d.ts +2 -0
- package/dist/tools/ti-development/get-process.js +163 -0
- package/dist/tools/ti-development/import-pro-file.d.ts +2 -0
- package/dist/tools/ti-development/import-pro-file.js +153 -0
- package/dist/tools/ti-development/import-process-from-git.d.ts +2 -0
- package/dist/tools/ti-development/import-process-from-git.js +198 -0
- package/dist/tools/ti-development/install-pro-bundle.d.ts +2 -0
- package/dist/tools/ti-development/install-pro-bundle.js +288 -0
- package/dist/tools/ti-development/preflight.d.ts +39 -0
- package/dist/tools/ti-development/preflight.js +56 -0
- package/dist/tools/ti-development/process-backup.d.ts +29 -0
- package/dist/tools/ti-development/process-backup.js +118 -0
- package/dist/tools/ti-development/search-code.d.ts +2 -0
- package/dist/tools/ti-development/search-code.js +208 -0
- package/dist/tools/ti-development/upsert-process.d.ts +2 -0
- package/dist/tools/ti-development/upsert-process.js +167 -0
- package/dist/tools/ti-development/validate-process-refs.d.ts +2 -0
- package/dist/tools/ti-development/validate-process-refs.js +73 -0
- package/dist/tools/views/create-mdx-view.d.ts +2 -0
- package/dist/tools/views/create-mdx-view.js +21 -0
- package/dist/tools/views/create-native-view.d.ts +2 -0
- package/dist/tools/views/create-native-view.js +81 -0
- package/dist/tools/views/delete-view.d.ts +2 -0
- package/dist/tools/views/delete-view.js +23 -0
- package/dist/tools/views/list-views.d.ts +2 -0
- package/dist/tools/views/list-views.js +32 -0
- package/dist/tools/with-annotations.d.ts +6 -0
- package/dist/tools/with-annotations.js +339 -0
- package/dist/types.d.ts +409 -0
- package/dist/types.js +91 -0
- package/dist/version.d.ts +4 -0
- package/dist/version.js +18 -0
- package/package.json +107 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type { TM1Client } from "../tm1-client.js";
|
|
3
|
+
import type { ResourceCatalog } from "./list-handler.js";
|
|
4
|
+
export declare function registerAllResources(server: McpServer, tm1: TM1Client): ResourceCatalog;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
// MCP Resources — read-only data assets exposed via URI. Complements the
|
|
2
|
+
// tool surface so IDE clients (Kiro, VSCode Copilot Chat) can:
|
|
3
|
+
// - reference TM1 objects in chat as `#tm1://process/foo/code`
|
|
4
|
+
// - browse a sidebar tree
|
|
5
|
+
// - subscribe to updates without polling
|
|
6
|
+
//
|
|
7
|
+
// Each resource maps to an existing TM1 service call — same backend logic
|
|
8
|
+
// as the get_* tools, different MCP entry point.
|
|
9
|
+
import { ResourceTemplate, } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
10
|
+
import { maskCode } from "../lib/mask-secrets.js";
|
|
11
|
+
function asJsonContent(uri, payload) {
|
|
12
|
+
return {
|
|
13
|
+
contents: [
|
|
14
|
+
{
|
|
15
|
+
uri: uri.href,
|
|
16
|
+
mimeType: "application/json",
|
|
17
|
+
text: JSON.stringify(payload, null, 2),
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function registerAllResources(server, tm1) {
|
|
23
|
+
// Build a parallel catalog as we go so installPaginatedListHandler can
|
|
24
|
+
// override SDK's default ListResourcesRequestSchema with cursor support.
|
|
25
|
+
// registerResource still wires the read callbacks; we just keep our own
|
|
26
|
+
// listing source of truth.
|
|
27
|
+
const entries = [];
|
|
28
|
+
// ── Static endpoints ────────────────────────────────────────────────
|
|
29
|
+
server.registerResource("server-info", "tm1://server/info", {
|
|
30
|
+
title: "TM1 Server Info",
|
|
31
|
+
description: "TM1 server configuration snapshot: name, version, data directory, timezone, integrated security mode.",
|
|
32
|
+
mimeType: "application/json",
|
|
33
|
+
}, async (uri) => {
|
|
34
|
+
// Project to the documented identity fields only. getInfo().extra
|
|
35
|
+
// carries the full merged /Configuration body, which can include
|
|
36
|
+
// sensitive settings — resources have no params, so unlike the
|
|
37
|
+
// curated tm1_get_server_info tool there is no place to opt in.
|
|
38
|
+
const info = await tm1.server.getInfo();
|
|
39
|
+
return asJsonContent(uri, {
|
|
40
|
+
serverName: info.serverName,
|
|
41
|
+
productVersion: info.productVersion,
|
|
42
|
+
productEdition: info.productEdition,
|
|
43
|
+
adminHost: info.adminHost,
|
|
44
|
+
dataDirectory: info.dataDirectory,
|
|
45
|
+
timeZoneId: info.timeZoneId,
|
|
46
|
+
integratedSecurityMode: info.integratedSecurityMode,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
entries.push({
|
|
50
|
+
kind: "static",
|
|
51
|
+
resource: {
|
|
52
|
+
uri: "tm1://server/info",
|
|
53
|
+
name: "server-info",
|
|
54
|
+
title: "TM1 Server Info",
|
|
55
|
+
description: "TM1 server configuration snapshot: name, version, data directory, timezone, integrated security mode.",
|
|
56
|
+
mimeType: "application/json",
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
server.registerResource("server-state", "tm1://server/state", {
|
|
60
|
+
title: "TM1 Server State",
|
|
61
|
+
description: "Health-check snapshot: connection state, version, capability flags, object counts (cubes/dimensions/processes/chores/clients).",
|
|
62
|
+
mimeType: "application/json",
|
|
63
|
+
}, async (uri) => {
|
|
64
|
+
const [info, cubes, dims, procs, chores, clients] = await Promise.all([
|
|
65
|
+
tm1.server.getInfo(),
|
|
66
|
+
tm1.cubes.list(),
|
|
67
|
+
tm1.dimensions.list(),
|
|
68
|
+
tm1.processes.list(),
|
|
69
|
+
tm1.chores.list(),
|
|
70
|
+
tm1.security.listClients(),
|
|
71
|
+
]);
|
|
72
|
+
return asJsonContent(uri, {
|
|
73
|
+
connected: tm1.isConnected(),
|
|
74
|
+
server: {
|
|
75
|
+
name: info.serverName,
|
|
76
|
+
productVersion: info.productVersion,
|
|
77
|
+
dataDirectory: info.dataDirectory,
|
|
78
|
+
timeZoneId: info.timeZoneId,
|
|
79
|
+
},
|
|
80
|
+
counts: {
|
|
81
|
+
cubes: cubes.length,
|
|
82
|
+
dimensions: dims.length,
|
|
83
|
+
processes: procs.length,
|
|
84
|
+
chores: chores.length,
|
|
85
|
+
clients: clients.length,
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
entries.push({
|
|
90
|
+
kind: "static",
|
|
91
|
+
resource: {
|
|
92
|
+
uri: "tm1://server/state",
|
|
93
|
+
name: "server-state",
|
|
94
|
+
title: "TM1 Server State",
|
|
95
|
+
description: "Health-check snapshot: connection state, version, capability flags, object counts (cubes/dimensions/processes/chores/clients).",
|
|
96
|
+
mimeType: "application/json",
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
// ── Resource templates ──────────────────────────────────────────────
|
|
100
|
+
// Process source code — `tm1://process/{name}/code`
|
|
101
|
+
server.registerResource("process-code", new ResourceTemplate("tm1://process/{name}/code", {
|
|
102
|
+
list: async () => {
|
|
103
|
+
const procs = await tm1.processes.list();
|
|
104
|
+
return {
|
|
105
|
+
resources: procs
|
|
106
|
+
.filter((p) => !p.name.startsWith("}"))
|
|
107
|
+
.map((p) => ({
|
|
108
|
+
name: `process-code-${p.name}`,
|
|
109
|
+
uri: `tm1://process/${encodeURIComponent(p.name)}/code`,
|
|
110
|
+
title: `TI: ${p.name}`,
|
|
111
|
+
description: `Source code (Prolog/Metadata/Data/Epilog) of TI process '${p.name}'.`,
|
|
112
|
+
mimeType: "application/json",
|
|
113
|
+
})),
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
complete: {
|
|
117
|
+
name: async (value) => {
|
|
118
|
+
const procs = await tm1.processes.list();
|
|
119
|
+
const lower = value.toLowerCase();
|
|
120
|
+
return procs
|
|
121
|
+
.filter((p) => !p.name.startsWith("}") && p.name.toLowerCase().includes(lower))
|
|
122
|
+
.map((p) => p.name)
|
|
123
|
+
.slice(0, 100);
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
}), {
|
|
127
|
+
title: "TI Process Source Code",
|
|
128
|
+
description: "Source code of any TurboIntegrator process by name. URI: tm1://process/{name}/code.",
|
|
129
|
+
mimeType: "application/json",
|
|
130
|
+
}, async (uri, vars) => {
|
|
131
|
+
const raw = vars.name;
|
|
132
|
+
const name = decodeURIComponent(Array.isArray(raw) ? raw[0] : (raw ?? ""));
|
|
133
|
+
const code = await tm1.processes.getCode(name);
|
|
134
|
+
// Hard-mask credential literals unconditionally: resources take no
|
|
135
|
+
// parameters, so unlike tm1_get_process_code there is no maskSecrets
|
|
136
|
+
// opt-out — returning the code verbatim would bypass the tool-path
|
|
137
|
+
// redaction (ODBCOpen passwords, credential assignments).
|
|
138
|
+
return asJsonContent(uri, {
|
|
139
|
+
prolog: maskCode(code.prolog),
|
|
140
|
+
metadata: maskCode(code.metadata),
|
|
141
|
+
data: maskCode(code.data),
|
|
142
|
+
epilog: maskCode(code.epilog),
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
entries.push({
|
|
146
|
+
kind: "template",
|
|
147
|
+
templateMetadata: {
|
|
148
|
+
title: "TI Process Source Code",
|
|
149
|
+
description: "Source code of any TurboIntegrator process by name. URI: tm1://process/{name}/code.",
|
|
150
|
+
mimeType: "application/json",
|
|
151
|
+
},
|
|
152
|
+
list: async () => {
|
|
153
|
+
const procs = await tm1.processes.list();
|
|
154
|
+
return {
|
|
155
|
+
resources: procs
|
|
156
|
+
.filter((p) => !p.name.startsWith("}"))
|
|
157
|
+
.map((p) => ({
|
|
158
|
+
name: `process-code-${p.name}`,
|
|
159
|
+
uri: `tm1://process/${encodeURIComponent(p.name)}/code`,
|
|
160
|
+
title: `TI: ${p.name}`,
|
|
161
|
+
description: `Source code (Prolog/Metadata/Data/Epilog) of TI process '${p.name}'.`,
|
|
162
|
+
mimeType: "application/json",
|
|
163
|
+
})),
|
|
164
|
+
};
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
// Cube rules — `tm1://cube/{name}/rules`
|
|
168
|
+
server.registerResource("cube-rules", new ResourceTemplate("tm1://cube/{name}/rules", {
|
|
169
|
+
list: async () => {
|
|
170
|
+
// Filter to cubes that actually carry rules — avoids cluttering
|
|
171
|
+
// the resource tree with rule-less cubes whose body is "".
|
|
172
|
+
const cubes = await tm1.cubes.list({ includeRules: true });
|
|
173
|
+
return {
|
|
174
|
+
resources: cubes
|
|
175
|
+
.filter((c) => !c.name.startsWith("}") && c.hasRules)
|
|
176
|
+
.map((c) => ({
|
|
177
|
+
name: `cube-rules-${c.name}`,
|
|
178
|
+
uri: `tm1://cube/${encodeURIComponent(c.name)}/rules`,
|
|
179
|
+
title: `Rules: ${c.name}`,
|
|
180
|
+
description: `Rules text of cube '${c.name}' (SKIPCHECK + FEEDERS sections).`,
|
|
181
|
+
mimeType: "text/plain",
|
|
182
|
+
})),
|
|
183
|
+
};
|
|
184
|
+
},
|
|
185
|
+
complete: {
|
|
186
|
+
name: async (value) => {
|
|
187
|
+
const cubes = await tm1.cubes.list();
|
|
188
|
+
const lower = value.toLowerCase();
|
|
189
|
+
return cubes
|
|
190
|
+
.filter((c) => !c.name.startsWith("}") && c.name.toLowerCase().includes(lower))
|
|
191
|
+
.map((c) => c.name)
|
|
192
|
+
.slice(0, 100);
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
}), {
|
|
196
|
+
title: "Cube Rules Text",
|
|
197
|
+
description: "Rules text of any TM1 cube by name. URI: tm1://cube/{name}/rules. Returns plain text.",
|
|
198
|
+
mimeType: "text/plain",
|
|
199
|
+
}, async (uri, vars) => {
|
|
200
|
+
const raw = vars.name;
|
|
201
|
+
const name = decodeURIComponent(Array.isArray(raw) ? raw[0] : (raw ?? ""));
|
|
202
|
+
const rules = await tm1.cubes.getRules(name);
|
|
203
|
+
return {
|
|
204
|
+
contents: [
|
|
205
|
+
{
|
|
206
|
+
uri: uri.href,
|
|
207
|
+
mimeType: "text/plain",
|
|
208
|
+
text: rules.rulesText,
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
};
|
|
212
|
+
});
|
|
213
|
+
entries.push({
|
|
214
|
+
kind: "template",
|
|
215
|
+
templateMetadata: {
|
|
216
|
+
title: "Cube Rules Text",
|
|
217
|
+
description: "Rules text of any TM1 cube by name. URI: tm1://cube/{name}/rules. Returns plain text.",
|
|
218
|
+
mimeType: "text/plain",
|
|
219
|
+
},
|
|
220
|
+
list: async () => {
|
|
221
|
+
const cubes = await tm1.cubes.list({ includeRules: true });
|
|
222
|
+
return {
|
|
223
|
+
resources: cubes
|
|
224
|
+
.filter((c) => !c.name.startsWith("}") && c.hasRules)
|
|
225
|
+
.map((c) => ({
|
|
226
|
+
name: `cube-rules-${c.name}`,
|
|
227
|
+
uri: `tm1://cube/${encodeURIComponent(c.name)}/rules`,
|
|
228
|
+
title: `Rules: ${c.name}`,
|
|
229
|
+
description: `Rules text of cube '${c.name}' (SKIPCHECK + FEEDERS sections).`,
|
|
230
|
+
mimeType: "text/plain",
|
|
231
|
+
})),
|
|
232
|
+
};
|
|
233
|
+
},
|
|
234
|
+
});
|
|
235
|
+
return { entries };
|
|
236
|
+
}
|
|
237
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type pino from "pino";
|
|
3
|
+
export interface CatalogResource {
|
|
4
|
+
uri: string;
|
|
5
|
+
name: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
mimeType?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface StaticCatalogEntry {
|
|
11
|
+
kind: "static";
|
|
12
|
+
resource: CatalogResource;
|
|
13
|
+
}
|
|
14
|
+
export interface TemplateCatalogEntry {
|
|
15
|
+
kind: "template";
|
|
16
|
+
templateMetadata: {
|
|
17
|
+
title?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
mimeType?: string;
|
|
20
|
+
};
|
|
21
|
+
list: () => Promise<{
|
|
22
|
+
resources: CatalogResource[];
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export type CatalogEntry = StaticCatalogEntry | TemplateCatalogEntry;
|
|
26
|
+
export interface ResourceCatalog {
|
|
27
|
+
entries: CatalogEntry[];
|
|
28
|
+
}
|
|
29
|
+
export declare const DEFAULT_PAGE_SIZE = 200;
|
|
30
|
+
declare function encodeCursor(offset: number): string;
|
|
31
|
+
declare function decodeCursor(cursor: string | undefined): number;
|
|
32
|
+
declare function resolveAll(catalog: ResourceCatalog, logger: pino.Logger): Promise<CatalogResource[]>;
|
|
33
|
+
export declare function installPaginatedListHandler(server: McpServer, catalog: ResourceCatalog, logger: pino.Logger, pageSize?: number): void;
|
|
34
|
+
export declare const __testing: {
|
|
35
|
+
encodeCursor: typeof encodeCursor;
|
|
36
|
+
decodeCursor: typeof decodeCursor;
|
|
37
|
+
resolveAll: typeof resolveAll;
|
|
38
|
+
};
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=list-handler.d.ts.map
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// R2-07: cursor-based pagination for resources/list.
|
|
2
|
+
//
|
|
3
|
+
// The high-level McpServer.registerResource registers a default
|
|
4
|
+
// ListResourcesRequestSchema handler that ignores `params.cursor` and strips
|
|
5
|
+
// `nextCursor` from the result (SDK 1.29.0). For TM1 servers with thousands
|
|
6
|
+
// of processes/cubes that single-shot response can overflow client buffers
|
|
7
|
+
// and is not spec-compliant.
|
|
8
|
+
//
|
|
9
|
+
// This module installs a replacement handler on the underlying Server,
|
|
10
|
+
// driven by a typed catalog populated by registerAllResources. The replaced
|
|
11
|
+
// handler still defers to template list callbacks for dynamic resources but
|
|
12
|
+
// adds opaque cursor pagination on top.
|
|
13
|
+
//
|
|
14
|
+
// Cursor format: base64url-encoded JSON `{ "o": <offset> }`. Opaque to the
|
|
15
|
+
// client by spec; we only need it to be self-contained and stable across
|
|
16
|
+
// requests so we don't need server-side state.
|
|
17
|
+
import { ListResourcesRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
18
|
+
export const DEFAULT_PAGE_SIZE = 200;
|
|
19
|
+
function encodeCursor(offset) {
|
|
20
|
+
return Buffer.from(JSON.stringify({ o: offset }), "utf8").toString("base64url");
|
|
21
|
+
}
|
|
22
|
+
// Returns offset >= 0 or 0 when the cursor is malformed / out-of-range.
|
|
23
|
+
// Per spec malformed cursors → InvalidParams; we treat them as "start over"
|
|
24
|
+
// so a stale cursor degrades to a fresh listing rather than an error storm.
|
|
25
|
+
function decodeCursor(cursor) {
|
|
26
|
+
if (!cursor)
|
|
27
|
+
return 0;
|
|
28
|
+
try {
|
|
29
|
+
const json = Buffer.from(cursor, "base64url").toString("utf8");
|
|
30
|
+
const parsed = JSON.parse(json);
|
|
31
|
+
const offset = typeof parsed.o === "number" ? parsed.o : 0;
|
|
32
|
+
return offset >= 0 ? offset : 0;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return 0;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// Resolve the full sorted resource list. Template list callbacks fire in
|
|
39
|
+
// parallel; static entries pass through. Sorting by URI gives stable paging
|
|
40
|
+
// across requests even if a template adds/removes entries between pages.
|
|
41
|
+
async function resolveAll(catalog, logger) {
|
|
42
|
+
const statics = [];
|
|
43
|
+
const templatePromises = [];
|
|
44
|
+
for (const entry of catalog.entries) {
|
|
45
|
+
if (entry.kind === "static") {
|
|
46
|
+
statics.push(entry.resource);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
templatePromises.push(entry
|
|
50
|
+
.list()
|
|
51
|
+
.then((r) => r.resources.map((res) => ({
|
|
52
|
+
...entry.templateMetadata,
|
|
53
|
+
// resource-level metadata overrides template defaults per SDK convention
|
|
54
|
+
...res,
|
|
55
|
+
})))
|
|
56
|
+
// A single failing template (e.g. TM1 briefly unreachable) must not take
|
|
57
|
+
// down the entire resources/list response — log it and omit its entries.
|
|
58
|
+
.catch((err) => {
|
|
59
|
+
logger.warn({ err, template: entry.templateMetadata }, "resource template list() failed; omitting from listing");
|
|
60
|
+
return [];
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const templateResults = await Promise.all(templatePromises);
|
|
65
|
+
const all = [...statics, ...templateResults.flat()];
|
|
66
|
+
all.sort((a, b) => a.uri.localeCompare(b.uri));
|
|
67
|
+
return all;
|
|
68
|
+
}
|
|
69
|
+
export function installPaginatedListHandler(server, catalog, logger, pageSize = DEFAULT_PAGE_SIZE) {
|
|
70
|
+
server.server.setRequestHandler(ListResourcesRequestSchema, async (request) => {
|
|
71
|
+
const cursorParam = request.params?.cursor;
|
|
72
|
+
const offset = decodeCursor(cursorParam ?? undefined);
|
|
73
|
+
const all = await resolveAll(catalog, logger);
|
|
74
|
+
const slice = all.slice(offset, offset + pageSize);
|
|
75
|
+
const next = offset + slice.length;
|
|
76
|
+
const hasMore = next < all.length;
|
|
77
|
+
logger.debug({ offset, returned: slice.length, total: all.length, hasMore }, "resources/list paginated");
|
|
78
|
+
return {
|
|
79
|
+
resources: slice,
|
|
80
|
+
...(hasMore ? { nextCursor: encodeCursor(next) } : {}),
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
// Test-only exports.
|
|
85
|
+
export const __testing = { encodeCursor, decodeCursor, resolveAll };
|
|
86
|
+
//# sourceMappingURL=list-handler.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type pino from "pino";
|
|
3
|
+
export declare class SubscriptionRegistry {
|
|
4
|
+
private readonly server;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
private readonly subscribed;
|
|
7
|
+
private mutationListener?;
|
|
8
|
+
constructor(server: McpServer, logger: pino.Logger);
|
|
9
|
+
/** Install subscribe/unsubscribe request handlers + mutation listener. */
|
|
10
|
+
install(): void;
|
|
11
|
+
/** Detach listener — used for shutdown / tests. */
|
|
12
|
+
dispose(): void;
|
|
13
|
+
/** Test introspection only. */
|
|
14
|
+
isSubscribed(uri: string): boolean;
|
|
15
|
+
/** Test introspection only. */
|
|
16
|
+
size(): number;
|
|
17
|
+
private onMutation;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=subscriptions.d.ts.map
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// R2-05: MCP resource subscription registry.
|
|
2
|
+
//
|
|
3
|
+
// Tracks which `tm1://...` URIs the client has subscribed to and, when an
|
|
4
|
+
// upstream mutation event fires, pushes `notifications/resources/updated`
|
|
5
|
+
// for the relevant URIs. Bridges the existing HTTP-layer mutation hook
|
|
6
|
+
// (tm1Events) into the MCP spec's pull-then-notify shape.
|
|
7
|
+
//
|
|
8
|
+
// Wiring:
|
|
9
|
+
// index.ts → new SubscriptionRegistry(server, logger) → install()
|
|
10
|
+
// HTTP layer → tm1Events.emit('mutation', { method, path })
|
|
11
|
+
// Registry → server.server.sendResourceUpdated({ uri }) per match
|
|
12
|
+
//
|
|
13
|
+
// Spec: https://modelcontextprotocol.io/specification (resources/subscribe,
|
|
14
|
+
// resources/unsubscribe, notifications/resources/updated).
|
|
15
|
+
import { SubscribeRequestSchema, UnsubscribeRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
16
|
+
import { tm1Events } from "../lib/tm1-events.js";
|
|
17
|
+
// URIs whose contents are sensitive to *any* mutation. The server-state
|
|
18
|
+
// resource aggregates counts across cubes/dims/processes/chores/clients —
|
|
19
|
+
// almost any non-safe call can change it.
|
|
20
|
+
const STATE_SENSITIVE_URIS = new Set(["tm1://server/state"]);
|
|
21
|
+
export class SubscriptionRegistry {
|
|
22
|
+
server;
|
|
23
|
+
logger;
|
|
24
|
+
// URIs the client has asked us to push updates for.
|
|
25
|
+
subscribed = new Set();
|
|
26
|
+
mutationListener;
|
|
27
|
+
constructor(server, logger) {
|
|
28
|
+
this.server = server;
|
|
29
|
+
this.logger = logger;
|
|
30
|
+
}
|
|
31
|
+
/** Install subscribe/unsubscribe request handlers + mutation listener. */
|
|
32
|
+
install() {
|
|
33
|
+
const lowLevel = this.server.server;
|
|
34
|
+
lowLevel.setRequestHandler(SubscribeRequestSchema, (req) => {
|
|
35
|
+
const uri = req.params.uri;
|
|
36
|
+
this.subscribed.add(uri);
|
|
37
|
+
this.logger.debug({ uri, count: this.subscribed.size }, "Resource subscribed");
|
|
38
|
+
return {};
|
|
39
|
+
});
|
|
40
|
+
lowLevel.setRequestHandler(UnsubscribeRequestSchema, (req) => {
|
|
41
|
+
const uri = req.params.uri;
|
|
42
|
+
this.subscribed.delete(uri);
|
|
43
|
+
this.logger.debug({ uri, count: this.subscribed.size }, "Resource unsubscribed");
|
|
44
|
+
return {};
|
|
45
|
+
});
|
|
46
|
+
this.mutationListener = (e) => this.onMutation(e);
|
|
47
|
+
tm1Events.on("mutation", this.mutationListener);
|
|
48
|
+
}
|
|
49
|
+
/** Detach listener — used for shutdown / tests. */
|
|
50
|
+
dispose() {
|
|
51
|
+
if (this.mutationListener) {
|
|
52
|
+
tm1Events.off("mutation", this.mutationListener);
|
|
53
|
+
this.mutationListener = undefined;
|
|
54
|
+
}
|
|
55
|
+
this.subscribed.clear();
|
|
56
|
+
}
|
|
57
|
+
/** Test introspection only. */
|
|
58
|
+
isSubscribed(uri) {
|
|
59
|
+
return this.subscribed.has(uri);
|
|
60
|
+
}
|
|
61
|
+
/** Test introspection only. */
|
|
62
|
+
size() {
|
|
63
|
+
return this.subscribed.size;
|
|
64
|
+
}
|
|
65
|
+
onMutation(_e) {
|
|
66
|
+
// Iterate subscribed URIs and notify those affected by this mutation.
|
|
67
|
+
// Currently only the aggregate state resource is mutation-sensitive;
|
|
68
|
+
// future entries can branch on e.path / e.method for finer-grained
|
|
69
|
+
// notifications (e.g. tm1://process/{name}/code on /Processes mutations).
|
|
70
|
+
for (const uri of this.subscribed) {
|
|
71
|
+
if (!STATE_SENSITIVE_URIS.has(uri))
|
|
72
|
+
continue;
|
|
73
|
+
// Fire-and-forget; missing transport (server not connected) throws.
|
|
74
|
+
this.server.server.sendResourceUpdated({ uri }).catch((err) => {
|
|
75
|
+
this.logger.warn({ err, uri }, "sendResourceUpdated failed");
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=subscriptions.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const MdxAxisSchema: z.ZodObject<{
|
|
3
|
+
tuples: z.ZodArray<z.ZodObject<{
|
|
4
|
+
members: z.ZodArray<z.ZodObject<{
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
hierarchyName: z.ZodString;
|
|
7
|
+
}, z.core.$strip>>;
|
|
8
|
+
}, z.core.$strip>>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type MdxAxis = z.infer<typeof MdxAxisSchema>;
|
|
11
|
+
export declare const FedCellDescriptorSchema: z.ZodObject<{
|
|
12
|
+
cube: z.ZodString;
|
|
13
|
+
tuple: z.ZodArray<z.ZodString>;
|
|
14
|
+
fed: z.ZodBoolean;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export type FedCellDescriptor = z.infer<typeof FedCellDescriptorSchema>;
|
|
17
|
+
//# sourceMappingURL=cells.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Cell/MDX domain: axis tuples and the feeder cell descriptor.
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const MdxAxisSchema = z.object({
|
|
4
|
+
tuples: z.array(z.object({
|
|
5
|
+
members: z.array(z.object({ name: z.string(), hierarchyName: z.string() })),
|
|
6
|
+
})),
|
|
7
|
+
});
|
|
8
|
+
export const FedCellDescriptorSchema = z.object({
|
|
9
|
+
cube: z.string(),
|
|
10
|
+
tuple: z.array(z.string()),
|
|
11
|
+
fed: z.boolean(),
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=cells.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** A TM1 cell: text, number, or empty. */
|
|
3
|
+
export declare const CellValueSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
|
|
4
|
+
export type CellValue = z.infer<typeof CellValueSchema>;
|
|
5
|
+
/** Element type as the OData surface spells it. */
|
|
6
|
+
export declare const ELEMENT_TYPE: z.ZodEnum<{
|
|
7
|
+
Numeric: "Numeric";
|
|
8
|
+
String: "String";
|
|
9
|
+
Consolidated: "Consolidated";
|
|
10
|
+
}>;
|
|
11
|
+
/** TI parameter/variable type as the OData surface spells it. */
|
|
12
|
+
export declare const PARAM_TYPE: z.ZodEnum<{
|
|
13
|
+
Numeric: "Numeric";
|
|
14
|
+
String: "String";
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Shared primitives for the domain schemas.
|
|
2
|
+
//
|
|
3
|
+
// These live below both consumers on purpose: `src/tm1-client/` (which parses
|
|
4
|
+
// them off the wire) and `src/tools/` (which publishes them as outputSchema)
|
|
5
|
+
// import from here, never from each other. Nothing in this directory may import
|
|
6
|
+
// from `../tools/` or `../types.js`.
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
/** A TM1 cell: text, number, or empty. */
|
|
9
|
+
export const CellValueSchema = z.union([z.string(), z.number(), z.null()]);
|
|
10
|
+
/** Element type as the OData surface spells it. */
|
|
11
|
+
export const ELEMENT_TYPE = z.enum(["Numeric", "String", "Consolidated"]);
|
|
12
|
+
/** TI parameter/variable type as the OData surface spells it. */
|
|
13
|
+
export const PARAM_TYPE = z.enum(["String", "Numeric"]);
|
|
14
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./common.js";
|
|
2
|
+
export * from "./cells.js";
|
|
3
|
+
export * from "./metadata.js";
|
|
4
|
+
export * from "./monitoring.js";
|
|
5
|
+
export * from "./processes.js";
|
|
6
|
+
export * from "./scheduling.js";
|
|
7
|
+
export * from "./security.js";
|
|
8
|
+
export * from "./subsets.js";
|
|
9
|
+
export * from "./views.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Canonical wire/domain schemas — the single definition of every shape that
|
|
2
|
+
// both the TM1 client and the tool layer need.
|
|
3
|
+
//
|
|
4
|
+
// Before this existed the same shapes were written twice: a hand-kept
|
|
5
|
+
// interface in src/types.ts for the client, and a hand-kept Zod object in
|
|
6
|
+
// src/tools/schemas/items-*.ts for the published outputSchema. They drifted
|
|
7
|
+
// exactly the way you would expect — `lockType` sat in the read shape for
|
|
8
|
+
// months without ever being on the wire, and removing it meant editing two
|
|
9
|
+
// files that had no link between them.
|
|
10
|
+
//
|
|
11
|
+
// Now the Zod object is the definition and the TypeScript type is `z.infer` of
|
|
12
|
+
// it. src/types.ts re-exports those types, so every existing import keeps
|
|
13
|
+
// working; src/tools/schemas/items-*.ts re-export the schemas.
|
|
14
|
+
export * from "./common.js";
|
|
15
|
+
export * from "./cells.js";
|
|
16
|
+
export * from "./metadata.js";
|
|
17
|
+
export * from "./monitoring.js";
|
|
18
|
+
export * from "./processes.js";
|
|
19
|
+
export * from "./scheduling.js";
|
|
20
|
+
export * from "./security.js";
|
|
21
|
+
export * from "./subsets.js";
|
|
22
|
+
export * from "./views.js";
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CubeSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
dimensions: z.ZodArray<z.ZodString>;
|
|
5
|
+
hasRules: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type Cube = z.infer<typeof CubeSchema>;
|
|
8
|
+
export declare const ElementStatsSchema: z.ZodObject<{
|
|
9
|
+
total: z.ZodNumber;
|
|
10
|
+
numeric: z.ZodNumber;
|
|
11
|
+
consolidated: z.ZodNumber;
|
|
12
|
+
string: z.ZodNumber;
|
|
13
|
+
maxLevel: z.ZodNumber;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type ElementStats = z.infer<typeof ElementStatsSchema>;
|
|
16
|
+
export declare const ElementAttributeValueSchema: z.ZodObject<{
|
|
17
|
+
elementName: z.ZodString;
|
|
18
|
+
attributeName: z.ZodString;
|
|
19
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type ElementAttributeValue = z.infer<typeof ElementAttributeValueSchema>;
|
|
22
|
+
export declare const DimensionSchema: z.ZodObject<{
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
hierarchies: z.ZodArray<z.ZodString>;
|
|
25
|
+
elementCounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
26
|
+
elementStats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
27
|
+
total: z.ZodNumber;
|
|
28
|
+
numeric: z.ZodNumber;
|
|
29
|
+
consolidated: z.ZodNumber;
|
|
30
|
+
string: z.ZodNumber;
|
|
31
|
+
maxLevel: z.ZodNumber;
|
|
32
|
+
}, z.core.$strip>>>;
|
|
33
|
+
lastUpdated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export type Dimension = z.infer<typeof DimensionSchema>;
|
|
36
|
+
export declare const HierarchyElementSchema: z.ZodObject<{
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
type: z.ZodEnum<{
|
|
39
|
+
Numeric: "Numeric";
|
|
40
|
+
String: "String";
|
|
41
|
+
Consolidated: "Consolidated";
|
|
42
|
+
}>;
|
|
43
|
+
level: z.ZodNumber;
|
|
44
|
+
parents: z.ZodArray<z.ZodString>;
|
|
45
|
+
children: z.ZodArray<z.ZodObject<{
|
|
46
|
+
name: z.ZodString;
|
|
47
|
+
weight: z.ZodNumber;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export type HierarchyElement = z.infer<typeof HierarchyElementSchema>;
|
|
51
|
+
export declare const HierarchySchema: z.ZodObject<{
|
|
52
|
+
name: z.ZodString;
|
|
53
|
+
dimensionName: z.ZodString;
|
|
54
|
+
elements: z.ZodArray<z.ZodObject<{
|
|
55
|
+
name: z.ZodString;
|
|
56
|
+
type: z.ZodEnum<{
|
|
57
|
+
Numeric: "Numeric";
|
|
58
|
+
String: "String";
|
|
59
|
+
Consolidated: "Consolidated";
|
|
60
|
+
}>;
|
|
61
|
+
level: z.ZodNumber;
|
|
62
|
+
parents: z.ZodArray<z.ZodString>;
|
|
63
|
+
children: z.ZodArray<z.ZodObject<{
|
|
64
|
+
name: z.ZodString;
|
|
65
|
+
weight: z.ZodNumber;
|
|
66
|
+
}, z.core.$strip>>;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export type Hierarchy = z.infer<typeof HierarchySchema>;
|
|
70
|
+
//# sourceMappingURL=metadata.d.ts.map
|