@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,138 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { buildIndexFromTM1 } from "../../lib/callgraph/tm1-adapter.js";
|
|
3
|
+
import { traceDataFlow } from "../../lib/callgraph/dataFlow.js";
|
|
4
|
+
import { buildDatasourceMembership, } from "../../lib/callgraph/datasourceMembership.js";
|
|
5
|
+
import { membersFromAxis } from "../../lib/callgraph/mdxMembers.js";
|
|
6
|
+
import { DataFlowResultSchema } from "../schemas/items.js";
|
|
7
|
+
import { READ_ONLY } from "../annotations.js";
|
|
8
|
+
import { defineTool } from "../define-tool.js";
|
|
9
|
+
// Per-direction ceiling. Flow rows carry a process name plus cube/element
|
|
10
|
+
// arrays, so they are heavier than a list row — this sits well below the
|
|
11
|
+
// list-tool cap on purpose.
|
|
12
|
+
const FLOW_MAX_ITEMS = 500;
|
|
13
|
+
export const registerTraceDataFlow = defineTool({
|
|
14
|
+
name: "tm1_trace_data_flow",
|
|
15
|
+
description: [
|
|
16
|
+
"Trace data flow into and out of a cube in one call, instead of analyze_object_usage + N× get_process_code.",
|
|
17
|
+
"downstream: processes that READ the cube and which cubes they WRITE to (where the data flows next).",
|
|
18
|
+
"upstream: processes that WRITE the cube and where they SOURCE data (read cubes + datasource).",
|
|
19
|
+
"Combines code-level CellGet/CellPut/DB access with each process's datasource, so view-sourced reads",
|
|
20
|
+
"(a TM1CubeView datasource with no CellGet in the code) are caught too. Read-only.",
|
|
21
|
+
"Pass element+dimension to also get which processes touch that element via in-code subset-membership calls.",
|
|
22
|
+
"Each touching process is tagged access=source|write|zero-out|indeterminate so a zero-out is not mistaken for a read-source.",
|
|
23
|
+
"Element tracing also resolves stored view/subset datasources (native-view titles + static subsets exactly; MDX views/subsets by literal member; computed selectors are flagged, not resolved).",
|
|
24
|
+
"With resolveComputed=true, computed native-view axis selectors are resolved to exact members (via 'view-native-computed'); otherwise they stay flagged in computedInProcesses.",
|
|
25
|
+
],
|
|
26
|
+
annotations: READ_ONLY,
|
|
27
|
+
output: DataFlowResultSchema,
|
|
28
|
+
input: {
|
|
29
|
+
cubeName: z.string().describe("Cube to trace (case-insensitive)"),
|
|
30
|
+
direction: z
|
|
31
|
+
.enum(["upstream", "downstream", "both"])
|
|
32
|
+
.optional()
|
|
33
|
+
.default("both")
|
|
34
|
+
.describe("'downstream': readers → their write targets. 'upstream': writers → their data sources. 'both' (default)."),
|
|
35
|
+
includeControl: z
|
|
36
|
+
.boolean()
|
|
37
|
+
.optional()
|
|
38
|
+
.default(false)
|
|
39
|
+
.describe("Include control processes (names starting with '}') when building the index. Default: false."),
|
|
40
|
+
element: z
|
|
41
|
+
.string()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe("Element name to trace. With 'dimension', results add which processes touch this element via in-code subset-membership calls (SubsetElementInsert/Add/Delete)."),
|
|
44
|
+
dimension: z
|
|
45
|
+
.string()
|
|
46
|
+
.optional()
|
|
47
|
+
.describe("Owning dimension of 'element' (required when 'element' is set)."),
|
|
48
|
+
resolveDatasourceMembership: z
|
|
49
|
+
.boolean()
|
|
50
|
+
.optional()
|
|
51
|
+
.default(true)
|
|
52
|
+
.describe("When tracing an element, also resolve server-side view/subset datasources (extra fetches). Default true; set false to skip for speed."),
|
|
53
|
+
resolveComputed: z
|
|
54
|
+
.boolean()
|
|
55
|
+
.optional()
|
|
56
|
+
.default(false)
|
|
57
|
+
.describe("When tracing an element, additionally RESOLVE computed native-view axis selectors (e.g. TM1FILTERBYLEVEL/DESCENDANTS) by live-evaluating just that dimension's set against the view's cube (read-only). Off by default (extra queries). Only affects native-view axis expressions; stored subsets are already resolved exactly."),
|
|
58
|
+
elementAccess: z
|
|
59
|
+
.array(z.enum(["source", "write", "zero-out", "indeterminate"]))
|
|
60
|
+
.optional()
|
|
61
|
+
.describe("Element roles to include (default source+write+zero-out). Add 'indeterminate' to also list processes that build the subset but whose use we could not classify (NOT proof of no use)."),
|
|
62
|
+
limit: z
|
|
63
|
+
.number()
|
|
64
|
+
.int()
|
|
65
|
+
.positive()
|
|
66
|
+
.max(FLOW_MAX_ITEMS)
|
|
67
|
+
.optional()
|
|
68
|
+
.default(FLOW_MAX_ITEMS)
|
|
69
|
+
.describe(`Max entries per direction (default ${FLOW_MAX_ITEMS}). counts stay unclipped; truncated=true says the cap bit.`),
|
|
70
|
+
},
|
|
71
|
+
handler: async ({ cubeName, direction, includeControl, element, dimension, resolveDatasourceMembership, resolveComputed, elementAccess, limit, }, tm1Client) => {
|
|
72
|
+
if (element && !dimension) {
|
|
73
|
+
return {
|
|
74
|
+
isError: true,
|
|
75
|
+
content: [
|
|
76
|
+
{
|
|
77
|
+
type: "text",
|
|
78
|
+
text: "When 'element' is set, 'dimension' is required (element names are only unique within a dimension).",
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const [index, dsList] = await Promise.all([
|
|
84
|
+
buildIndexFromTM1(tm1Client, { includeControl }),
|
|
85
|
+
tm1Client.processes.listDataSources(includeControl),
|
|
86
|
+
]);
|
|
87
|
+
let datasourceMembership;
|
|
88
|
+
if (element && dimension && resolveDatasourceMembership) {
|
|
89
|
+
datasourceMembership = await buildDatasourceMembership({
|
|
90
|
+
getViewDefinition: (cube, view) => tm1Client.views.getDefinition(cube, view),
|
|
91
|
+
getSubset: (dim, hier, sub) => tm1Client.subsets.get(dim, hier, sub),
|
|
92
|
+
...(resolveComputed
|
|
93
|
+
? {
|
|
94
|
+
evaluateSetExpression: async (cube, dim, mdxSet) => {
|
|
95
|
+
const res = await tm1Client.cells.executeMdx(`SELECT {${mdxSet}} ON 0 FROM [${cube.replace(/\]/g, "]]")}]`, 1);
|
|
96
|
+
return membersFromAxis(res, dim);
|
|
97
|
+
},
|
|
98
|
+
}
|
|
99
|
+
: {}),
|
|
100
|
+
}, dsList);
|
|
101
|
+
}
|
|
102
|
+
const flow = traceDataFlow(index, dsList, cubeName, direction, element && dimension
|
|
103
|
+
? {
|
|
104
|
+
element: { dimension, name: element },
|
|
105
|
+
...(elementAccess ? { elementAccess } : {}),
|
|
106
|
+
...(datasourceMembership ? { datasourceMembership } : {}),
|
|
107
|
+
}
|
|
108
|
+
: undefined);
|
|
109
|
+
// An element filter that found hits is meaningful output on its own — don't let
|
|
110
|
+
// a cube with no up/downstream flow overwrite it with a contradictory "not found" hint.
|
|
111
|
+
const elementHasHits = (flow.element?.processes.length ?? 0) > 0;
|
|
112
|
+
const empty = !elementHasHits &&
|
|
113
|
+
(flow.counts.upstream ?? 0) === 0 &&
|
|
114
|
+
(flow.counts.downstream ?? 0) === 0;
|
|
115
|
+
const hint = empty
|
|
116
|
+
? `No data flow found for '${cubeName}'. Check the cube name, or set includeControl=true if it is touched only by control (}) processes.`
|
|
117
|
+
: undefined;
|
|
118
|
+
// This tool had no limit, offset or summary mode at all — on a large
|
|
119
|
+
// model it returned every reader and every writer of a cube in one
|
|
120
|
+
// response. Clip the two arrays but leave `counts` alone: the caller
|
|
121
|
+
// still sees the true totals, so a clipped answer is visibly partial
|
|
122
|
+
// rather than quietly wrong.
|
|
123
|
+
const clip = (rows) => rows && rows.length > limit ? rows.slice(0, limit) : rows;
|
|
124
|
+
const truncated = (flow.upstream?.length ?? 0) > limit ||
|
|
125
|
+
(flow.downstream?.length ?? 0) > limit;
|
|
126
|
+
const payload = {
|
|
127
|
+
...flow,
|
|
128
|
+
...(flow.upstream ? { upstream: clip(flow.upstream) } : {}),
|
|
129
|
+
...(flow.downstream ? { downstream: clip(flow.downstream) } : {}),
|
|
130
|
+
...(truncated ? { truncated } : {}),
|
|
131
|
+
...(hint ? { hint } : {}),
|
|
132
|
+
};
|
|
133
|
+
return {
|
|
134
|
+
content: [{ type: "text", text: JSON.stringify(payload) }],
|
|
135
|
+
};
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
//# sourceMappingURL=trace-data-flow.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ToolAnnotations } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
export type Tm1RequiresVersion = "v11" | "v12" | "v11+" | "v12+";
|
|
3
|
+
export interface Tm1ToolAnnotations extends ToolAnnotations {
|
|
4
|
+
requiresVersion?: Tm1RequiresVersion;
|
|
5
|
+
}
|
|
6
|
+
export declare function withVersion(base: ToolAnnotations, version: Tm1RequiresVersion): Tm1ToolAnnotations;
|
|
7
|
+
export declare const READ_ONLY: ToolAnnotations;
|
|
8
|
+
export declare const IDEMPOTENT_WRITE: ToolAnnotations;
|
|
9
|
+
export declare const WRITE: ToolAnnotations;
|
|
10
|
+
export declare const IDEMPOTENT_DESTRUCTIVE: ToolAnnotations;
|
|
11
|
+
export declare const DESTRUCTIVE: ToolAnnotations;
|
|
12
|
+
//# sourceMappingURL=annotations.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Apply requiresVersion to a base annotation preset without mutating it.
|
|
2
|
+
export function withVersion(base, version) {
|
|
3
|
+
return { ...base, requiresVersion: version };
|
|
4
|
+
}
|
|
5
|
+
// GET / list / search / analyze / validate / compile / diff — no server-side state change.
|
|
6
|
+
// No idempotentHint: per MCP spec it is only meaningful when readOnlyHint=false.
|
|
7
|
+
export const READ_ONLY = {
|
|
8
|
+
readOnlyHint: true,
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
};
|
|
12
|
+
// PUT-style updates: same input -> same end state. update_*, upsert_*, bulk_upsert_*.
|
|
13
|
+
export const IDEMPOTENT_WRITE = {
|
|
14
|
+
readOnlyHint: false,
|
|
15
|
+
destructiveHint: false,
|
|
16
|
+
idempotentHint: true,
|
|
17
|
+
openWorldHint: true,
|
|
18
|
+
};
|
|
19
|
+
// POST-style creates / non-idempotent writes: create_*, copy_*, toggle_*, write_cells.
|
|
20
|
+
export const WRITE = {
|
|
21
|
+
readOnlyHint: false,
|
|
22
|
+
destructiveHint: false,
|
|
23
|
+
idempotentHint: false,
|
|
24
|
+
openWorldHint: true,
|
|
25
|
+
};
|
|
26
|
+
// Idempotent, but overwrites something that re-running the call cannot bring
|
|
27
|
+
// back: set_cube_rules replaces the whole rule file, write_cells replaces the
|
|
28
|
+
// prior cell values, bulk_upsert_elements' component lists replace a
|
|
29
|
+
// consolidation's entire child set.
|
|
30
|
+
//
|
|
31
|
+
// Splitting this out closes a real taxonomy hole: "destructive" had come to mean
|
|
32
|
+
// "deletes an object", so full-replacement writes advertised
|
|
33
|
+
// destructiveHint:false and a client's confirm-before-destructive prompt never
|
|
34
|
+
// fired for them. Per MCP spec destructiveHint asks whether the tool "may
|
|
35
|
+
// perform destructive updates to its environment" — an irreversible overwrite
|
|
36
|
+
// qualifies. Idempotence is orthogonal (same input, same end state; it says
|
|
37
|
+
// nothing about what the first call overwrote).
|
|
38
|
+
export const IDEMPOTENT_DESTRUCTIVE = {
|
|
39
|
+
readOnlyHint: false,
|
|
40
|
+
destructiveHint: true,
|
|
41
|
+
idempotentHint: true,
|
|
42
|
+
openWorldHint: true,
|
|
43
|
+
};
|
|
44
|
+
// delete_*, clear_*, unload_*, cancel_*, remove_*, execute_* (TI side effects).
|
|
45
|
+
// Note: "destructive" per MCP spec = "may perform destructive updates to its
|
|
46
|
+
// environment". This covers two distinct shapes in TM1:
|
|
47
|
+
// 1. Irreversible object/data removal (delete_*, clear_*) — true destructive
|
|
48
|
+
// 2. Irreversible data mutation via side-effects (execute_process,
|
|
49
|
+
// execute_chore) — process runs and writes through to cubes; output is
|
|
50
|
+
// not recoverable by undoing the tool call.
|
|
51
|
+
// Both surface to the client as a single destructiveHint=true so prompts
|
|
52
|
+
// before invocation warn either way. tm1_invalidate_callgraph_cache was
|
|
53
|
+
// previously here but is in fact recoverable (cache rebuilds on next read)
|
|
54
|
+
// and is now classified IDEMPOTENT_WRITE.
|
|
55
|
+
export const DESTRUCTIVE = {
|
|
56
|
+
readOnlyHint: false,
|
|
57
|
+
destructiveHint: true,
|
|
58
|
+
idempotentHint: false,
|
|
59
|
+
openWorldHint: true,
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=annotations.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { withToolHint } from "../error-format.js";
|
|
3
|
+
import { CheckFeedersResultSchema } from "../schemas/items.js";
|
|
4
|
+
import { READ_ONLY, withVersion } from "../annotations.js";
|
|
5
|
+
import { defineTool } from "../define-tool.js";
|
|
6
|
+
export const registerCheckFeeders = defineTool({
|
|
7
|
+
name: "tm1_check_feeders",
|
|
8
|
+
description: [
|
|
9
|
+
"Check the feeders of a cell: verifies feeder coverage for the cells underlying this cell and returns the problematic ones with a fed flag — fed=false marks a broken or missing feeder (the classic cause of empty consolidated/rule cells). An empty result means no feeder problems were detected (live-verified on 11.8: fully-fed areas return []).",
|
|
10
|
+
"Per-cell runtime check; complements tm1_audit_feeders (static rule analysis).",
|
|
11
|
+
"Elements address the default hierarchy, in cube dimension order (discover with tm1_list_cubes).",
|
|
12
|
+
"v11 only. Related: tm1_trace_feeders (statements involved), tm1_trace_cell_calculation (why has this cell value X).",
|
|
13
|
+
],
|
|
14
|
+
annotations: withVersion(READ_ONLY, "v11"),
|
|
15
|
+
output: CheckFeedersResultSchema,
|
|
16
|
+
input: {
|
|
17
|
+
cubeName: z.string().describe("Name of the TM1 cube"),
|
|
18
|
+
elements: z
|
|
19
|
+
.array(z.string())
|
|
20
|
+
.describe("Element names for each dimension of the cube, in cube dimension order"),
|
|
21
|
+
timeoutMs: z
|
|
22
|
+
.number()
|
|
23
|
+
.int()
|
|
24
|
+
.min(1000)
|
|
25
|
+
.max(3600000)
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Override the default request timeout (ms, 1000–3600000). Checks over deep consolidations can be slow."),
|
|
28
|
+
},
|
|
29
|
+
handler: async ({ cubeName, elements, timeoutMs }, tm1Client, extra) => {
|
|
30
|
+
const fedCells = await withToolHint(tm1Client.cells.checkFeeders(cubeName, elements, {
|
|
31
|
+
signal: extra?.signal,
|
|
32
|
+
...(timeoutMs ? { timeoutMs } : {}),
|
|
33
|
+
}), `CheckFeeders failed for cube '${cubeName}'. Verify dimension order/elements via tm1_list_cubes; alternate hierarchies are not supported. On v12 this action is unavailable.`);
|
|
34
|
+
return {
|
|
35
|
+
content: [
|
|
36
|
+
{
|
|
37
|
+
type: "text",
|
|
38
|
+
text: JSON.stringify({
|
|
39
|
+
count: fedCells.length,
|
|
40
|
+
unfedCount: fedCells.filter((c) => !c.fed).length,
|
|
41
|
+
fedCells,
|
|
42
|
+
}, null, 2),
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=check-feeders.js.map
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TM1Error, TM1ErrorCode } from "../../types.js";
|
|
3
|
+
import { rethrowIfSystemic } from "../../tm1-client/services/fallback.js";
|
|
4
|
+
import { READ_ONLY } from "../annotations.js";
|
|
5
|
+
import { WritableCoordsResultSchema } from "../schemas/items.js";
|
|
6
|
+
import { defineTool } from "../define-tool.js";
|
|
7
|
+
import { dimensionCountMismatch } from "../../lib/coordinate-error.js";
|
|
8
|
+
import { resolveCellAddress } from "../../lib/cell-address.js";
|
|
9
|
+
export const registerCheckWritableCoords = defineTool({
|
|
10
|
+
name: "tm1_check_writable_coords",
|
|
11
|
+
description: "Pre-flight check before CellPutN/CellPutS. Verifies (1) every coord element exists, (2) every element is N-Level (writes to Consolidated elements silent-fail), and (3) whether the target cube has rules that may overlap the coord. Returns per-coord status + a rule-overlap warning. Use before writing cells in a TI process or via tm1_write_cells; pass the same dimensions list as the write to check exactly the cell it will address.",
|
|
12
|
+
annotations: READ_ONLY,
|
|
13
|
+
output: WritableCoordsResultSchema,
|
|
14
|
+
input: {
|
|
15
|
+
cubeName: z.string().describe("Target cube name"),
|
|
16
|
+
coords: z
|
|
17
|
+
.array(z.string())
|
|
18
|
+
.describe("Element name per dimension: in cube dimension order, or in the order of dimensions when given."),
|
|
19
|
+
dimensions: z
|
|
20
|
+
.array(z.string())
|
|
21
|
+
.optional()
|
|
22
|
+
.describe("Dimension names for coords, any order — as passed to tm1_write_cells. Every cube dimension except Sandboxes (bound to Base) must be named."),
|
|
23
|
+
},
|
|
24
|
+
handler: async ({ cubeName, coords: given, dimensions }, tm1Client) => {
|
|
25
|
+
const cubes = await tm1Client.cubes.list();
|
|
26
|
+
const cubeMeta = cubes.find((c) => c.name.toLowerCase() === cubeName.toLowerCase());
|
|
27
|
+
if (!cubeMeta) {
|
|
28
|
+
throw new TM1Error({
|
|
29
|
+
code: TM1ErrorCode.NOT_FOUND,
|
|
30
|
+
message: `Cube '${cubeName}' not found`,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const dims = cubeMeta.dimensions;
|
|
34
|
+
let coords = given;
|
|
35
|
+
let sandboxDefaulted;
|
|
36
|
+
if (dimensions !== undefined) {
|
|
37
|
+
if (given.length !== dimensions.length) {
|
|
38
|
+
throw dimensionCountMismatch(cubeName, dimensions, given);
|
|
39
|
+
}
|
|
40
|
+
const address = resolveCellAddress(cubeName, dims, dimensions);
|
|
41
|
+
coords = address.toCubeOrder(given);
|
|
42
|
+
sandboxDefaulted = address.sandboxDefaulted;
|
|
43
|
+
}
|
|
44
|
+
else if (coords.length !== dims.length) {
|
|
45
|
+
throw dimensionCountMismatch(cubeName, dims, coords);
|
|
46
|
+
}
|
|
47
|
+
const checks = await Promise.all(dims.map(async (dim, idx) => {
|
|
48
|
+
// coords.length === dims.length is guarded above
|
|
49
|
+
const element = coords[idx];
|
|
50
|
+
try {
|
|
51
|
+
const hier = await tm1Client.hierarchies.get(dim, dim);
|
|
52
|
+
const el = hier.elements.find((e) => e.name.toLowerCase() === element.toLowerCase());
|
|
53
|
+
if (!el) {
|
|
54
|
+
return {
|
|
55
|
+
dimension: dim,
|
|
56
|
+
element,
|
|
57
|
+
exists: false,
|
|
58
|
+
type: "(missing)",
|
|
59
|
+
isNLevel: false,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
dimension: dim,
|
|
64
|
+
element: el.name,
|
|
65
|
+
exists: true,
|
|
66
|
+
type: el.type,
|
|
67
|
+
isNLevel: el.type !== "Consolidated",
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
// A transport/auth outage must not masquerade as a missing element —
|
|
72
|
+
// that would tell the agent to "repair" coordinates that are actually
|
|
73
|
+
// fine. Only genuine lookup failures (NOT_FOUND) fall through.
|
|
74
|
+
rethrowIfSystemic(e);
|
|
75
|
+
return {
|
|
76
|
+
dimension: dim,
|
|
77
|
+
element,
|
|
78
|
+
exists: false,
|
|
79
|
+
type: "(missing)",
|
|
80
|
+
isNLevel: false,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}));
|
|
84
|
+
let ruleOverlapWarn = {
|
|
85
|
+
hasRules: false,
|
|
86
|
+
ruleLines: 0,
|
|
87
|
+
note: "",
|
|
88
|
+
};
|
|
89
|
+
try {
|
|
90
|
+
const rules = await tm1Client.cubes.getRules(cubeName);
|
|
91
|
+
const ruleText = (rules.rulesText ?? "").trim();
|
|
92
|
+
if (ruleText) {
|
|
93
|
+
ruleOverlapWarn = {
|
|
94
|
+
hasRules: true,
|
|
95
|
+
ruleLines: ruleText.split(/\r?\n/).length,
|
|
96
|
+
note: "Cube has rules. CellPutN/S to a coord that the rule computes will be silently overridden by the rule. Inspect the rules manually for LHS pattern overlap with this coord.",
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
catch (e) {
|
|
101
|
+
// A missing/rule-less cube legitimately leaves the default; a systemic
|
|
102
|
+
// outage must surface rather than silently claim the cube has no rules.
|
|
103
|
+
rethrowIfSystemic(e);
|
|
104
|
+
}
|
|
105
|
+
const allExist = checks.every((c) => c.exists);
|
|
106
|
+
const allNLevel = checks.every((c) => c.isNLevel);
|
|
107
|
+
const writable = allExist && allNLevel;
|
|
108
|
+
return {
|
|
109
|
+
content: [
|
|
110
|
+
{
|
|
111
|
+
type: "text",
|
|
112
|
+
text: JSON.stringify({
|
|
113
|
+
cube: cubeName,
|
|
114
|
+
writable,
|
|
115
|
+
allElementsExist: allExist,
|
|
116
|
+
allElementsNLevel: allNLevel,
|
|
117
|
+
coords: checks,
|
|
118
|
+
ruleOverlapWarn,
|
|
119
|
+
...(sandboxDefaulted ? { sandboxDefaulted } : {}),
|
|
120
|
+
}, null, 2),
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
//# sourceMappingURL=check-writable-coords.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MdxAxis, CellValue } from "../../types.js";
|
|
2
|
+
export interface MdxEnvelope {
|
|
3
|
+
axes: MdxAxis[];
|
|
4
|
+
total: number | null;
|
|
5
|
+
count: number;
|
|
6
|
+
offset: number;
|
|
7
|
+
has_more: boolean;
|
|
8
|
+
next_offset: number | null;
|
|
9
|
+
axes_clipped?: boolean;
|
|
10
|
+
items: Array<{
|
|
11
|
+
value: CellValue;
|
|
12
|
+
formattedValue: string;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
export declare function renderMdxMarkdown(env: MdxEnvelope): string;
|
|
16
|
+
export declare const registerExecuteMdx: import("../define-tool.js").ToolRegistrar;
|
|
17
|
+
//# sourceMappingURL=execute-mdx.d.ts.map
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PAGINATION_SCHEMA } from "../pagination.js";
|
|
3
|
+
import { FORMAT_SCHEMA, payloadResponse } from "../format.js";
|
|
4
|
+
import { withToolHint } from "../error-format.js";
|
|
5
|
+
import { clipAxesToWindow } from "../../tm1-client/services/cellset-transform.js";
|
|
6
|
+
import { MdxResultSchema } from "../schemas/items.js";
|
|
7
|
+
import { READ_ONLY } from "../annotations.js";
|
|
8
|
+
import { defineTool } from "../define-tool.js";
|
|
9
|
+
function mdCell(v) {
|
|
10
|
+
if (v === null || v === undefined)
|
|
11
|
+
return "";
|
|
12
|
+
return String(v).replace(/\|/g, "\\|").replace(/\n/g, " ");
|
|
13
|
+
}
|
|
14
|
+
const tupleLabel = (tuple) => tuple.members.map((m) => m.name).join(" / ");
|
|
15
|
+
const axisHeader = (axis) => axis.tuples[0]?.members.map((m) => m.hierarchyName).join(" / ") || "Axis";
|
|
16
|
+
const cellText = (c) => c.formattedValue !== "" ? c.formattedValue : mdCell(c.value);
|
|
17
|
+
// Render an MDX cellset envelope as Markdown.
|
|
18
|
+
//
|
|
19
|
+
// Pivot grid when axis[0] (ON COLUMNS) and axis[1] (ON ROWS) drive the result
|
|
20
|
+
// and every remaining axis is a single-tuple slicer/context (TM1 surfaces the
|
|
21
|
+
// WHERE clause as a trailing single-tuple axis). Requires the full result
|
|
22
|
+
// (offset 0, all cells). TM1 orders cells with axis[0] varying fastest and the
|
|
23
|
+
// single-tuple context axes contribute index 0 (×1), so cell(r,c) still maps
|
|
24
|
+
// to items[r*colCount + c]. Context tuples are noted above the grid.
|
|
25
|
+
//
|
|
26
|
+
// Anything else (0/1 axis, a genuine 3-D result, or a paginated slice where the
|
|
27
|
+
// grid can't be reconstructed) → a flat table: one row per cell, coordinates
|
|
28
|
+
// decoded from the global ordinal (offset + i), value last.
|
|
29
|
+
export function renderMdxMarkdown(env) {
|
|
30
|
+
const { axes, items, total, count, offset, has_more } = env;
|
|
31
|
+
const meta = `_MDX cellset — ${count}${total !== null ? ` of ${total}` : ""} cells` +
|
|
32
|
+
`${offset > 0 ? `, offset ${offset}` : ""}${has_more ? ", more available" : ""}._`;
|
|
33
|
+
if (axes.length === 0 || items.length === 0) {
|
|
34
|
+
const scalar = items.length > 0 ? cellText(items[0]) : "(no cells)";
|
|
35
|
+
return `${meta}\n\n**Value:** ${scalar}`;
|
|
36
|
+
}
|
|
37
|
+
const contextAxes = axes.slice(2);
|
|
38
|
+
const fullSet = items.length === axes.reduce((a, ax) => a * ax.tuples.length, 1);
|
|
39
|
+
const isGrid = axes.length >= 2 &&
|
|
40
|
+
offset === 0 &&
|
|
41
|
+
fullSet &&
|
|
42
|
+
contextAxes.every((ax) => ax.tuples.length === 1);
|
|
43
|
+
if (isGrid) {
|
|
44
|
+
const cols = axes[0].tuples;
|
|
45
|
+
const rows = axes[1].tuples;
|
|
46
|
+
const colCount = cols.length;
|
|
47
|
+
const context = contextAxes
|
|
48
|
+
.map((ax) => mdCell(tupleLabel(ax.tuples[0])))
|
|
49
|
+
.filter((s) => s.length > 0)
|
|
50
|
+
.join(" · ");
|
|
51
|
+
const head = context ? [meta, "", `**Context:** ${context}`] : [meta];
|
|
52
|
+
const header = `| ${mdCell(axisHeader(axes[1]))} | ${cols.map((t) => mdCell(tupleLabel(t))).join(" | ")} |`;
|
|
53
|
+
const sep = `| ${["---", ...cols.map(() => "---")].join(" | ")} |`;
|
|
54
|
+
const body = rows.map((rt, r) => {
|
|
55
|
+
const vals = cols.map((_, c) => mdCell(cellText(items[r * colCount + c])));
|
|
56
|
+
return `| ${mdCell(tupleLabel(rt))} | ${vals.join(" | ")} |`;
|
|
57
|
+
});
|
|
58
|
+
return [...head, "", header, sep, ...body].join("\n");
|
|
59
|
+
}
|
|
60
|
+
// Flat fallback: decode each cell's coordinate from its global ordinal.
|
|
61
|
+
const radices = axes.map((a) => a.tuples.length);
|
|
62
|
+
const header = `| ${[...axes.map((a) => mdCell(axisHeader(a))), "Value"].join(" | ")} |`;
|
|
63
|
+
const sep = `| ${[...axes.map(() => "---"), "---"].join(" | ")} |`;
|
|
64
|
+
const body = items.map((cell, i) => {
|
|
65
|
+
let ord = offset + i;
|
|
66
|
+
const coords = radices.map((n, k) => {
|
|
67
|
+
const idx = ord % n;
|
|
68
|
+
ord = Math.floor(ord / n);
|
|
69
|
+
return mdCell(tupleLabel(axes[k].tuples[idx]));
|
|
70
|
+
});
|
|
71
|
+
return `| ${[...coords, mdCell(cellText(cell))].join(" | ")} |`;
|
|
72
|
+
});
|
|
73
|
+
return [meta, "", header, sep, ...body].join("\n");
|
|
74
|
+
}
|
|
75
|
+
export const registerExecuteMdx = defineTool({
|
|
76
|
+
name: "tm1_execute_mdx",
|
|
77
|
+
description: [
|
|
78
|
+
"Execute an MDX query against the TM1 server and return structured cell data with axes (page-envelope shape consistent with list_*).",
|
|
79
|
+
"format='markdown' renders a pivot grid (2 axes, full result — set fetchAll=true to avoid a partial grid) or a flat coordinate table; 'json' (default) returns the structured envelope.",
|
|
80
|
+
"Related: tm1_create_mdx_view to persist a query as a public view, tm1_sample_cells for cheap sparsity probe, tm1_get_cell_value for a single coordinate.",
|
|
81
|
+
],
|
|
82
|
+
annotations: READ_ONLY,
|
|
83
|
+
output: MdxResultSchema,
|
|
84
|
+
input: {
|
|
85
|
+
mdx: z.string().describe("The MDX query string to execute"),
|
|
86
|
+
...PAGINATION_SCHEMA,
|
|
87
|
+
...FORMAT_SCHEMA,
|
|
88
|
+
timeoutMs: z
|
|
89
|
+
.number()
|
|
90
|
+
.int()
|
|
91
|
+
.min(1000)
|
|
92
|
+
.max(3600000)
|
|
93
|
+
.optional()
|
|
94
|
+
.describe("Override the default 30s request timeout for this call (ms, 1000–3600000). Use for heavy MDX over wide views."),
|
|
95
|
+
},
|
|
96
|
+
handler: async ({ mdx, limit, offset, fetchAll, format, timeoutMs }, tm1Client, extra) => {
|
|
97
|
+
const all = fetchAll === true || limit === 0;
|
|
98
|
+
const top = all ? undefined : limit;
|
|
99
|
+
const skip = all ? undefined : offset;
|
|
100
|
+
const result = await withToolHint(tm1Client.cells.executeMdx(mdx, top, skip, {
|
|
101
|
+
signal: extra?.signal,
|
|
102
|
+
...(timeoutMs ? { timeoutMs } : {}),
|
|
103
|
+
}), "MDX execution failed. Common causes: missing brackets around member names ([Dim].[Hier].[Member]), unbalanced FROM/SELECT, unknown cube. Inspect details; cross-check member names with tm1_get_hierarchy or tm1_list_cubes.");
|
|
104
|
+
const total = result.totalCellCount;
|
|
105
|
+
const count = result.cells.length;
|
|
106
|
+
const off = all ? 0 : offset;
|
|
107
|
+
const has_more = !all && off + count < total;
|
|
108
|
+
// Clip axes to the returned cell page so a capped read over a huge view
|
|
109
|
+
// doesn't ship the full tuple list. fetchAll keeps the whole cellset.
|
|
110
|
+
const { axes, clipped } = all
|
|
111
|
+
? { axes: result.axes, clipped: false }
|
|
112
|
+
: clipAxesToWindow(result.axes, count, off);
|
|
113
|
+
const envelope = {
|
|
114
|
+
axes,
|
|
115
|
+
total,
|
|
116
|
+
count,
|
|
117
|
+
offset: off,
|
|
118
|
+
has_more,
|
|
119
|
+
next_offset: has_more ? off + count : null,
|
|
120
|
+
...(clipped ? { axes_clipped: true } : {}),
|
|
121
|
+
items: result.cells,
|
|
122
|
+
};
|
|
123
|
+
return payloadResponse(envelope, format, renderMdxMarkdown);
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
//# sourceMappingURL=execute-mdx.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CellValueSchema } from "../schemas/items.js";
|
|
3
|
+
import { READ_ONLY } from "../annotations.js";
|
|
4
|
+
import { defineTool } from "../define-tool.js";
|
|
5
|
+
export const registerGetCellValue = defineTool({
|
|
6
|
+
name: "tm1_get_cell_value",
|
|
7
|
+
description: [
|
|
8
|
+
"Get a single cell value from a TM1 cube by specifying element coordinates.",
|
|
9
|
+
"Discover dimension order with tm1_list_cubes (cube.dimensions).",
|
|
10
|
+
"Reading more than a few cells? One tm1_execute_mdx (slices/grids) or tm1_sample_cells (populated cells) call replaces a loop of get_cell_value calls.",
|
|
11
|
+
"Related: tm1_write_cells for the inverse operation.",
|
|
12
|
+
],
|
|
13
|
+
annotations: READ_ONLY,
|
|
14
|
+
output: {
|
|
15
|
+
value: CellValueSchema.describe("Cell value (string, number, or null)"),
|
|
16
|
+
},
|
|
17
|
+
input: {
|
|
18
|
+
cubeName: z.string().describe("Name of the TM1 cube"),
|
|
19
|
+
elements: z
|
|
20
|
+
.array(z.string())
|
|
21
|
+
.describe("Element names for each dimension of the cube"),
|
|
22
|
+
},
|
|
23
|
+
handler: async ({ cubeName, elements }, tm1Client) => {
|
|
24
|
+
const value = await tm1Client.cells.getValue(cubeName, elements);
|
|
25
|
+
return {
|
|
26
|
+
content: [{ type: "text", text: JSON.stringify({ value }) }],
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=get-cell-value.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { READ_ONLY } from "../annotations.js";
|
|
3
|
+
import { ViewDefinitionResultSchema } from "../schemas/items.js";
|
|
4
|
+
import { defineTool } from "../define-tool.js";
|
|
5
|
+
export const registerGetViewDefinition = defineTool({
|
|
6
|
+
name: "tm1_get_view_definition",
|
|
7
|
+
description: [
|
|
8
|
+
"Return the structural definition of a cube view (MDX expression OR NativeView axes)",
|
|
9
|
+
"WITHOUT executing it. Use tm1_get_view to execute and read cells.",
|
|
10
|
+
"Auto-detects public vs private when isPrivate is omitted (public tried first).",
|
|
11
|
+
],
|
|
12
|
+
annotations: READ_ONLY,
|
|
13
|
+
output: ViewDefinitionResultSchema,
|
|
14
|
+
input: {
|
|
15
|
+
cubeName: z.string().describe("Name of the TM1 cube"),
|
|
16
|
+
viewName: z.string().describe("Name of the view"),
|
|
17
|
+
isPrivate: z
|
|
18
|
+
.boolean()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("If true, look only in PrivateViews. If false, only in Views. If omitted, public is tried first then private."),
|
|
21
|
+
},
|
|
22
|
+
handler: async ({ cubeName, viewName, isPrivate }, tm1Client) => {
|
|
23
|
+
const result = await tm1Client.views.getDefinition(cubeName, viewName, isPrivate);
|
|
24
|
+
return {
|
|
25
|
+
content: [{ type: "text", text: JSON.stringify(result) }],
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=get-view-definition.js.map
|