@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,55 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PAGINATION_SCHEMA } from "../pagination.js";
|
|
3
|
+
import { FORMAT_SCHEMA, payloadResponse } from "../format.js";
|
|
4
|
+
import { renderMdxMarkdown } from "./execute-mdx.js";
|
|
5
|
+
import { clipAxesToWindow } from "../../tm1-client/services/cellset-transform.js";
|
|
6
|
+
import { READ_ONLY } from "../annotations.js";
|
|
7
|
+
import { ViewResultSchema } from "../schemas/items.js";
|
|
8
|
+
import { defineTool } from "../define-tool.js";
|
|
9
|
+
export const registerGetView = defineTool({
|
|
10
|
+
name: "tm1_get_view",
|
|
11
|
+
description: [
|
|
12
|
+
"Execute a named cube view and return structured cell data with axes (page-envelope shape consistent with tm1_execute_mdx).",
|
|
13
|
+
"Cells paginate by default so wide/tall views don't flood context; fetchAll=true for the full cellset.",
|
|
14
|
+
"format='markdown' renders a pivot grid (2 axes, full result) or a flat coordinate table; 'json' (default) returns the structured envelope.",
|
|
15
|
+
],
|
|
16
|
+
annotations: READ_ONLY,
|
|
17
|
+
output: ViewResultSchema,
|
|
18
|
+
input: {
|
|
19
|
+
cubeName: z.string().describe("Name of the TM1 cube"),
|
|
20
|
+
viewName: z.string().describe("Name of the view to execute"),
|
|
21
|
+
...PAGINATION_SCHEMA,
|
|
22
|
+
...FORMAT_SCHEMA,
|
|
23
|
+
},
|
|
24
|
+
handler: async ({ cubeName, viewName, limit, offset, fetchAll, format }, tm1Client, extra) => {
|
|
25
|
+
const all = fetchAll === true || limit === 0;
|
|
26
|
+
const top = all ? undefined : limit;
|
|
27
|
+
const skip = all ? undefined : offset;
|
|
28
|
+
const result = await tm1Client.views.getView(cubeName, viewName, top, skip, {
|
|
29
|
+
signal: extra?.signal,
|
|
30
|
+
});
|
|
31
|
+
const total = result.totalCellCount;
|
|
32
|
+
const count = result.cells.length;
|
|
33
|
+
const off = all ? 0 : offset;
|
|
34
|
+
const has_more = !all && off + count < total;
|
|
35
|
+
// Clip axes to the returned cell page so a capped read over a tall view
|
|
36
|
+
// doesn't ship the full tuple list. fetchAll keeps the whole cellset.
|
|
37
|
+
const { axes, clipped } = all
|
|
38
|
+
? { axes: result.axes, clipped: false }
|
|
39
|
+
: clipAxesToWindow(result.axes, count, off);
|
|
40
|
+
const envelope = {
|
|
41
|
+
cubeName,
|
|
42
|
+
viewName,
|
|
43
|
+
axes,
|
|
44
|
+
total,
|
|
45
|
+
count,
|
|
46
|
+
offset: off,
|
|
47
|
+
has_more,
|
|
48
|
+
next_offset: has_more ? off + count : null,
|
|
49
|
+
...(clipped ? { axes_clipped: true } : {}),
|
|
50
|
+
items: result.cells,
|
|
51
|
+
};
|
|
52
|
+
return payloadResponse(envelope, format, renderMdxMarkdown);
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=get-view.js.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { buildSampleCellsMdx, transformSampleCells, } from "../../lib/sample-cells.js";
|
|
3
|
+
import { READ_ONLY } from "../annotations.js";
|
|
4
|
+
import { SampleCellsResultSchema } from "../schemas/items.js";
|
|
5
|
+
import { defineTool } from "../define-tool.js";
|
|
6
|
+
const FilterValueSchema = z.union([
|
|
7
|
+
z.string(),
|
|
8
|
+
z.array(z.string()).min(1),
|
|
9
|
+
]);
|
|
10
|
+
export const registerSampleCells = defineTool({
|
|
11
|
+
name: "tm1_sample_cells",
|
|
12
|
+
description: [
|
|
13
|
+
"Return up to maxCells populated cells from a cube without guessing coordinates — builds a NON EMPTY CROSSJOIN MDX over the cube's dimensions and HEAD-limits it.",
|
|
14
|
+
"For sanity-checks after a clone, finding non-zero cells, or debugging empty views. maxCells=0 means unlimited (WARNING: large cubes may return millions — filter first).",
|
|
15
|
+
"NON EMPTY targets numeric cells; set includeStrings=true for String value fields.",
|
|
16
|
+
],
|
|
17
|
+
annotations: READ_ONLY,
|
|
18
|
+
output: SampleCellsResultSchema,
|
|
19
|
+
input: {
|
|
20
|
+
cubeName: z.string().describe("Cube to sample"),
|
|
21
|
+
maxCells: z
|
|
22
|
+
.number()
|
|
23
|
+
.int()
|
|
24
|
+
.min(0)
|
|
25
|
+
.optional()
|
|
26
|
+
.default(5)
|
|
27
|
+
.describe("Max cells to return (default 5). 0 = no limit (unbounded; combine with filters)."),
|
|
28
|
+
filters: z
|
|
29
|
+
.record(z.string(), FilterValueSchema)
|
|
30
|
+
.optional()
|
|
31
|
+
.describe("Per-dimension filters. Single string → WHERE pin. Array of strings → axis member set. Keys must match cube dimension names."),
|
|
32
|
+
axisDimension: z
|
|
33
|
+
.string()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe("Dimension placed on COLUMNS (default: last dimension of the cube). Useful when the cube has a 'Measures'/'Account' dim that should drive columns."),
|
|
36
|
+
leavesOnly: z
|
|
37
|
+
.boolean()
|
|
38
|
+
.optional()
|
|
39
|
+
.default(true)
|
|
40
|
+
.describe("If true (default), unfiltered dims are restricted to leaf members via TM1FILTERBYLEVEL([dim],0). Set false to include consolidations."),
|
|
41
|
+
includeStrings: z
|
|
42
|
+
.boolean()
|
|
43
|
+
.optional()
|
|
44
|
+
.default(false)
|
|
45
|
+
.describe('Set true to sample String value fields. Swaps NON EMPTY for a `<> ""` FILTER and scans all members incl. consolidations (string values don\'t roll up, so they can sit on C). Requires the column/measure to resolve to a single element — pin it via filters or axisDimension.'),
|
|
46
|
+
},
|
|
47
|
+
handler: async ({ cubeName, maxCells, filters, axisDimension, leavesOnly, includeStrings }, tm1Client) => {
|
|
48
|
+
const startedAt = Date.now();
|
|
49
|
+
const dimensions = await tm1Client.cubes.getDimensionNames(cubeName);
|
|
50
|
+
// Sentinel row: ask TM1 for one cell MORE than requested, so `truncated`
|
|
51
|
+
// is decided by evidence instead of inferred from a full page.
|
|
52
|
+
// `cells.length >= maxCells` cannot tell "exactly maxCells cells exist"
|
|
53
|
+
// apart from "more exist" and reported truncation for both. The extra row
|
|
54
|
+
// is dropped below, so the response contract is unchanged.
|
|
55
|
+
// maxCells=0 means unlimited — no sentinel, nothing to truncate.
|
|
56
|
+
const requested = maxCells ?? 5;
|
|
57
|
+
const built = buildSampleCellsMdx({
|
|
58
|
+
cubeName,
|
|
59
|
+
dimensions,
|
|
60
|
+
maxCells: requested > 0 ? requested + 1 : 0,
|
|
61
|
+
filters,
|
|
62
|
+
axisDimension,
|
|
63
|
+
leavesOnly: leavesOnly ?? true,
|
|
64
|
+
includeStrings: includeStrings ?? false,
|
|
65
|
+
});
|
|
66
|
+
const result = await tm1Client.cells.executeMdx(built.mdx);
|
|
67
|
+
const whereCoords = {};
|
|
68
|
+
if (filters) {
|
|
69
|
+
for (const [dim, val] of Object.entries(filters)) {
|
|
70
|
+
if (typeof val === "string")
|
|
71
|
+
whereCoords[dim] = val;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const sampled = transformSampleCells({ result, whereCoords });
|
|
75
|
+
const truncated = requested > 0 && sampled.length > requested;
|
|
76
|
+
const cells = truncated ? sampled.slice(0, requested) : sampled;
|
|
77
|
+
const hint = cells.length === 0
|
|
78
|
+
? includeStrings
|
|
79
|
+
? "No populated cells found — cube may be empty or current filters exclude data."
|
|
80
|
+
: "No populated cells found — cube may be empty, all-consolidated, or current filters exclude data. If the value field is a String type, NON EMPTY cannot detect it: retry with includeStrings=true."
|
|
81
|
+
: undefined;
|
|
82
|
+
const elapsedMs = Date.now() - startedAt;
|
|
83
|
+
const payload = {
|
|
84
|
+
cubeName,
|
|
85
|
+
count: cells.length,
|
|
86
|
+
truncated,
|
|
87
|
+
cells,
|
|
88
|
+
filtersApplied: filters ?? {},
|
|
89
|
+
axisDimension: built.columnDim,
|
|
90
|
+
rowDims: built.rowDims,
|
|
91
|
+
whereDims: built.whereDims,
|
|
92
|
+
mdxUsed: built.mdx,
|
|
93
|
+
elapsedMs,
|
|
94
|
+
...(hint ? { hint } : {}),
|
|
95
|
+
};
|
|
96
|
+
return {
|
|
97
|
+
content: [{ type: "text", text: JSON.stringify(payload) }],
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=sample-cells.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { withToolHint } from "../error-format.js";
|
|
3
|
+
import { CalculationTraceResultSchema } from "../schemas/items.js";
|
|
4
|
+
import { READ_ONLY, withVersion } from "../annotations.js";
|
|
5
|
+
import { defineTool } from "../define-tool.js";
|
|
6
|
+
export const registerTraceCellCalculation = defineTool({
|
|
7
|
+
name: "tm1_trace_cell_calculation",
|
|
8
|
+
description: [
|
|
9
|
+
"Trace how a cell value is calculated: recursive component tree with per-component type (Consolidation/Rule/Simple), status (Null/Data/Error), value, and the rule statements that populate it — answers 'why is this cell X / empty?'.",
|
|
10
|
+
"The tree is truncated client-side via maxDepth/maxComponents; truncated=true marks cut branches (re-run with the branch tuple as new start cell to drill deeper).",
|
|
11
|
+
"Elements address the default hierarchy, in cube dimension order (discover with tm1_list_cubes).",
|
|
12
|
+
"v11 only. Related: tm1_check_feeders / tm1_trace_feeders for feeder issues, tm1_get_cube_rules for the full rule text.",
|
|
13
|
+
],
|
|
14
|
+
annotations: withVersion(READ_ONLY, "v11"),
|
|
15
|
+
output: CalculationTraceResultSchema,
|
|
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
|
+
maxDepth: z
|
|
22
|
+
.number()
|
|
23
|
+
.int()
|
|
24
|
+
.min(1)
|
|
25
|
+
.max(10)
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Maximum component-tree depth to return (default 3). Deep consolidations explode quickly."),
|
|
28
|
+
maxComponents: z
|
|
29
|
+
.number()
|
|
30
|
+
.int()
|
|
31
|
+
.min(1)
|
|
32
|
+
.max(200)
|
|
33
|
+
.optional()
|
|
34
|
+
.describe("Maximum components per node (default 20). Excess children are dropped and the node marked truncated."),
|
|
35
|
+
timeoutMs: z
|
|
36
|
+
.number()
|
|
37
|
+
.int()
|
|
38
|
+
.min(1000)
|
|
39
|
+
.max(3600000)
|
|
40
|
+
.optional()
|
|
41
|
+
.describe("Override the default request timeout (ms, 1000–3600000). Traces over deep consolidations can be slow."),
|
|
42
|
+
},
|
|
43
|
+
handler: async ({ cubeName, elements, maxDepth, maxComponents, timeoutMs }, tm1Client, extra) => {
|
|
44
|
+
const tree = await withToolHint(tm1Client.cells.traceCellCalculation(cubeName, elements, maxDepth, maxComponents, {
|
|
45
|
+
signal: extra?.signal,
|
|
46
|
+
...(timeoutMs ? { timeoutMs } : {}),
|
|
47
|
+
}), `TraceCellCalculation failed for cube '${cubeName}'. Verify dimension order/elements via tm1_list_cubes; alternate hierarchies are not supported. On v12 this action is unavailable.`);
|
|
48
|
+
return {
|
|
49
|
+
content: [{ type: "text", text: JSON.stringify(tree) }],
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=trace-cell-calculation.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { withToolHint } from "../error-format.js";
|
|
3
|
+
import { READ_ONLY, withVersion } from "../annotations.js";
|
|
4
|
+
import { TraceFeedersResultSchema } from "../schemas/items.js";
|
|
5
|
+
import { defineTool } from "../define-tool.js";
|
|
6
|
+
export const registerTraceFeeders = defineTool({
|
|
7
|
+
name: "tm1_trace_feeders",
|
|
8
|
+
description: [
|
|
9
|
+
"Trace the feeders of a cell: returns the cells this cell feeds plus the feeder statements involved — answers 'which feeder statement fires from this cell, and where to'.",
|
|
10
|
+
"Use when a rule cell stays empty under SKIPCHECK: trace the source cell to see whether its feeder reaches the target.",
|
|
11
|
+
"Elements address the default hierarchy, in cube dimension order (discover with tm1_list_cubes).",
|
|
12
|
+
"v11 only. Related: tm1_check_feeders (fed/unfed flags), tm1_audit_feeders (static analysis).",
|
|
13
|
+
],
|
|
14
|
+
annotations: withVersion(READ_ONLY, "v11"),
|
|
15
|
+
output: TraceFeedersResultSchema,
|
|
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). Traces over deep consolidations can be slow."),
|
|
28
|
+
},
|
|
29
|
+
handler: async ({ cubeName, elements, timeoutMs }, tm1Client, extra) => {
|
|
30
|
+
const result = await withToolHint(tm1Client.cells.traceFeeders(cubeName, elements, {
|
|
31
|
+
signal: extra?.signal,
|
|
32
|
+
...(timeoutMs ? { timeoutMs } : {}),
|
|
33
|
+
}), `TraceFeeders 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({ count: result.fedCells.length, ...result }),
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=trace-feeders.js.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { actionResponse } from "../format.js";
|
|
3
|
+
import { CONFIRM_SCHEMA, requireConfirm } from "../confirm.js";
|
|
4
|
+
import { DESTRUCTIVE } from "../annotations.js";
|
|
5
|
+
import { MutationResultSchema } 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 registerWriteCells = defineTool({
|
|
10
|
+
name: "tm1_write_cells",
|
|
11
|
+
description: [
|
|
12
|
+
"Write one or more cell values directly to a TM1 cube via REST.",
|
|
13
|
+
"IMPORTANT: TI processes are the standard path for data loads — use this tool only for ad-hoc writes or when explicitly requested.",
|
|
14
|
+
"Writes to consolidated cells are rejected by TM1.",
|
|
15
|
+
"Every cube dimension must be named (any order) — a dimension left out would land on its default member, so the call is refused. Only Sandboxes may be left out: it is bound to Base and echoed as sandboxDefaulted. A named sandbox is addressable only once its IncludeInSandboxDimension is true.",
|
|
16
|
+
"Before: tm1_check_writable_coords to validate that target coordinates are leaf-level and addressable.",
|
|
17
|
+
"Related: tm1_clear_cube for bulk wipe, tm1_get_cell_value to read back, tm1_execute_process for production data loads.",
|
|
18
|
+
],
|
|
19
|
+
annotations: DESTRUCTIVE,
|
|
20
|
+
output: MutationResultSchema,
|
|
21
|
+
input: {
|
|
22
|
+
cubeName: z.string().describe("Name of the TM1 cube"),
|
|
23
|
+
dimensions: z
|
|
24
|
+
.array(z.string())
|
|
25
|
+
.min(2)
|
|
26
|
+
.describe("Cube dimension names, any order; each cell's elements follow this order. Must cover every cube dimension except Sandboxes."),
|
|
27
|
+
cells: z
|
|
28
|
+
.array(z.object({
|
|
29
|
+
elements: z
|
|
30
|
+
.array(z.string())
|
|
31
|
+
.describe("Element names, one per entry in dimensions, in that order"),
|
|
32
|
+
value: z
|
|
33
|
+
.union([z.number(), z.string()])
|
|
34
|
+
.describe("Cell value (number for Numeric cubes, string for String cells)"),
|
|
35
|
+
}))
|
|
36
|
+
.min(1)
|
|
37
|
+
.describe("Cells to write"),
|
|
38
|
+
...CONFIRM_SCHEMA,
|
|
39
|
+
},
|
|
40
|
+
handler: async ({ cubeName, dimensions, cells, confirm }, tm1Client) => {
|
|
41
|
+
// Overwrites prior cell values with no undo. Guards against an
|
|
42
|
+
// auto-approve client firing this without intent — NOT a security
|
|
43
|
+
// control: anything that can call the tool can also supply `confirm`.
|
|
44
|
+
requireConfirm(confirm, cubeName, "cube");
|
|
45
|
+
for (const c of cells) {
|
|
46
|
+
if (c.elements.length !== dimensions.length) {
|
|
47
|
+
throw dimensionCountMismatch(cubeName, dimensions, c.elements);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// writeCells throws a TM1Error carrying its own partial-commit accounting
|
|
51
|
+
// (written / failed / notAttempted) + a targeted hint, so we let it
|
|
52
|
+
// propagate to the index.ts Proxy unwrapped — wrapping it here would
|
|
53
|
+
// clobber that hint with a generic one.
|
|
54
|
+
const address = resolveCellAddress(cubeName, await tm1Client.cubes.getDimensionNames(cubeName), dimensions);
|
|
55
|
+
await tm1Client.cells.writeCells(cubeName, address.dimensions, cells.map((c) => ({ ...c, elements: address.toCubeOrder(c.elements) })));
|
|
56
|
+
return actionResponse({
|
|
57
|
+
success: true,
|
|
58
|
+
cellsWritten: cells.length,
|
|
59
|
+
...(address.sandboxDefaulted
|
|
60
|
+
? { sandboxDefaulted: address.sandboxDefaulted }
|
|
61
|
+
: {}),
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=write-cells.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CONFIRM_SCHEMA: {
|
|
3
|
+
confirm: z.ZodString;
|
|
4
|
+
};
|
|
5
|
+
export declare function requireConfirm(provided: string, target: string, kind: string): void;
|
|
6
|
+
export declare const OVERWRITE_CONFIRM_SCHEMA: {
|
|
7
|
+
confirm: z.ZodOptional<z.ZodString>;
|
|
8
|
+
};
|
|
9
|
+
export declare function requireOverwriteConfirm(provided: string | undefined, target: string, kind: string): void;
|
|
10
|
+
//# sourceMappingURL=confirm.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Confirmation guard for destructive tool calls (R2-10 from MCP best-
|
|
2
|
+
// practices review). LLMs occasionally fire delete_* / clear_* tools
|
|
3
|
+
// without sufficient evidence the action is intended. Requiring the
|
|
4
|
+
// caller to repeat the target name as a second argument forces explicit
|
|
5
|
+
// intent and makes "auto-approve all" clients safer.
|
|
6
|
+
//
|
|
7
|
+
// Pattern in a tool registration:
|
|
8
|
+
//
|
|
9
|
+
// const CONFIRM_SCHEMA = {
|
|
10
|
+
// confirm: z
|
|
11
|
+
// .string()
|
|
12
|
+
// .describe(
|
|
13
|
+
// "Repeat the target name verbatim to confirm this irreversible action.",
|
|
14
|
+
// ),
|
|
15
|
+
// };
|
|
16
|
+
//
|
|
17
|
+
// async ({ name, confirm }) => {
|
|
18
|
+
// requireConfirm(confirm, name, "cube");
|
|
19
|
+
// await tm1Client.cubes.delete(name);
|
|
20
|
+
// ...
|
|
21
|
+
// }
|
|
22
|
+
//
|
|
23
|
+
// requireConfirm throws TM1Error(VALIDATION_ERROR) on mismatch; the
|
|
24
|
+
// Proxy in src/index.ts catches and reformats to the uniform error shape.
|
|
25
|
+
import { z } from "zod";
|
|
26
|
+
import { TM1Error, TM1ErrorCode } from "../types.js";
|
|
27
|
+
export const CONFIRM_SCHEMA = {
|
|
28
|
+
confirm: z
|
|
29
|
+
.string()
|
|
30
|
+
.describe("Safety check: repeat the target identifier verbatim (e.g. cube/dimension/process name) to confirm this irreversible action. Mismatched values reject the call."),
|
|
31
|
+
};
|
|
32
|
+
export function requireConfirm(provided, target, kind) {
|
|
33
|
+
if (provided !== target) {
|
|
34
|
+
throw new TM1Error({
|
|
35
|
+
code: TM1ErrorCode.VALIDATION_ERROR,
|
|
36
|
+
message: `confirm mismatch — expected ${kind} name "${target}", got "${provided}".`,
|
|
37
|
+
hint: `Re-issue the call with confirm="${target}" verbatim. This safety check prevents accidental destructive operations.`,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Overwrite guard for create-or-update tools (upsert_process, the import tools,
|
|
42
|
+
// install_pro_bundle). Creating a new object needs no confirmation; replacing
|
|
43
|
+
// an existing one does, because the previous version is not recoverable
|
|
44
|
+
// through the API (the tools save a local backup, see process-backup.ts, but
|
|
45
|
+
// that is a file on the MCP host, not an undo). Hence optional in the schema, required at runtime once the
|
|
46
|
+
// target is known to exist.
|
|
47
|
+
export const OVERWRITE_CONFIRM_SCHEMA = {
|
|
48
|
+
confirm: z
|
|
49
|
+
.string()
|
|
50
|
+
.optional()
|
|
51
|
+
.describe("Required only when the target already exists (an overwrite): repeat its name verbatim. Not needed to create. The replaced version is saved first; result.backup names the .json/.ti pair (restore: tm1_import_process_from_git)."),
|
|
52
|
+
};
|
|
53
|
+
export function requireOverwriteConfirm(provided, target, kind) {
|
|
54
|
+
if (provided === target)
|
|
55
|
+
return;
|
|
56
|
+
throw new TM1Error({
|
|
57
|
+
code: TM1ErrorCode.VALIDATION_ERROR,
|
|
58
|
+
message: provided === undefined
|
|
59
|
+
? `${kind} "${target}" already exists; overwriting it needs confirm="${target}". Nothing was written.`
|
|
60
|
+
: `confirm mismatch — expected ${kind} name "${target}", got "${provided}". Nothing was written.`,
|
|
61
|
+
hint: `Show the user what will be replaced (e.g. tm1_diff_process_with_file), then re-issue with confirm="${target}" verbatim, or use mode="create" to refuse overwrites outright.`,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=confirm.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { McpServer, ToolCallback } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type { ZodObject, ZodRawShape, ZodTypeAny } from "zod";
|
|
3
|
+
import type { TM1Client } from "../tm1-client.js";
|
|
4
|
+
import type { Tm1ToolAnnotations } from "./annotations.js";
|
|
5
|
+
/** Registrar shape expected by the REGISTRARS array in ./index.ts. */
|
|
6
|
+
export type ToolRegistrar = (server: McpServer, tm1Client: TM1Client) => void;
|
|
7
|
+
export interface ToolSpec<I extends ZodRawShape> {
|
|
8
|
+
/** Wire name, `tm1_*`. */
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Tool description. An array is joined with a single space — the same shape
|
|
12
|
+
* the hand-written registrations use, and what scripts/lib/scan-tools.mjs
|
|
13
|
+
* parses for docs/TOOLS.md.
|
|
14
|
+
*/
|
|
15
|
+
description: string | readonly string[];
|
|
16
|
+
/** Zod raw shape for the tool's arguments. */
|
|
17
|
+
input: I;
|
|
18
|
+
/**
|
|
19
|
+
* Output payload schema, pre-widening. Pass the plain schema or raw shape;
|
|
20
|
+
* `asOutputSchema()` and `markdownCapable()` are applied here as needed.
|
|
21
|
+
* Omit for tools that answer with unstructured text.
|
|
22
|
+
*/
|
|
23
|
+
output?: ZodObject<ZodRawShape> | ZodRawShape;
|
|
24
|
+
/** MCP behavior hints — one of the presets in ./annotations.js. */
|
|
25
|
+
annotations: Tm1ToolAnnotations;
|
|
26
|
+
/**
|
|
27
|
+
* Registration gate for tools that exist on one TM1 generation only (v11
|
|
28
|
+
* threads vs v12 jobs, v11-only save_data). Returning false skips the tool
|
|
29
|
+
* entirely — it never appears in tools/list. This is deliberately separate
|
|
30
|
+
* from the `requiresVersion` annotation, which is a client-facing HINT and
|
|
31
|
+
* is also carried by tools that stay registered on both generations.
|
|
32
|
+
*/
|
|
33
|
+
enabled?: (tm1Client: TM1Client) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Handler. Receives the parsed args, the shared TM1 client, and the SDK's
|
|
36
|
+
* per-call extra (abort signal, request metadata).
|
|
37
|
+
*/
|
|
38
|
+
handler: (args: Parameters<ToolCallback<I>>[0], tm1Client: TM1Client, extra: Parameters<ToolCallback<I>>[1]) => ReturnType<ToolCallback<I>>;
|
|
39
|
+
}
|
|
40
|
+
/** What ./with-annotations.ts needs at registration time. */
|
|
41
|
+
export interface ResolvedSpec {
|
|
42
|
+
name: string;
|
|
43
|
+
annotations: Tm1ToolAnnotations;
|
|
44
|
+
/** Already widened — hand straight to the SDK. */
|
|
45
|
+
outputSchema?: ZodRawShape | ZodTypeAny;
|
|
46
|
+
}
|
|
47
|
+
export declare function specFor(name: string): ResolvedSpec | undefined;
|
|
48
|
+
/** Every spec defined so far. Used by the lint gates and by tests. */
|
|
49
|
+
export declare function allSpecs(): ReadonlyMap<string, ResolvedSpec>;
|
|
50
|
+
export declare function defineTool<I extends ZodRawShape>(spec: ToolSpec<I>): ToolRegistrar;
|
|
51
|
+
//# sourceMappingURL=define-tool.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { asOutputSchema } from "./schemas/output-schema.js";
|
|
2
|
+
import { markdownCapable } from "./schemas/markdown-capable.js";
|
|
3
|
+
// Populated at module-load time, when a tool file's top-level defineTool()
|
|
4
|
+
// call runs. That is strictly before registerAllTools() executes, because the
|
|
5
|
+
// import graph resolves first — so the Proxy always finds the spec.
|
|
6
|
+
const SPECS = new Map();
|
|
7
|
+
export function specFor(name) {
|
|
8
|
+
return SPECS.get(name);
|
|
9
|
+
}
|
|
10
|
+
/** Every spec defined so far. Used by the lint gates and by tests. */
|
|
11
|
+
export function allSpecs() {
|
|
12
|
+
return SPECS;
|
|
13
|
+
}
|
|
14
|
+
function isZodObject(output) {
|
|
15
|
+
return "_def" in output;
|
|
16
|
+
}
|
|
17
|
+
function resolveOutput(output, formatCapable) {
|
|
18
|
+
if (output === undefined)
|
|
19
|
+
return undefined;
|
|
20
|
+
const normalized = isZodObject(output) ? asOutputSchema(output) : output;
|
|
21
|
+
return formatCapable ? markdownCapable(normalized) : normalized;
|
|
22
|
+
}
|
|
23
|
+
export function defineTool(spec) {
|
|
24
|
+
const description = Array.isArray(spec.description)
|
|
25
|
+
? spec.description.join(" ")
|
|
26
|
+
: spec.description;
|
|
27
|
+
const existing = SPECS.get(spec.name);
|
|
28
|
+
if (existing) {
|
|
29
|
+
throw new Error(`defineTool: duplicate tool name "${spec.name}" — each tool may be defined once.`);
|
|
30
|
+
}
|
|
31
|
+
const outputSchema = resolveOutput(spec.output, "format" in spec.input);
|
|
32
|
+
SPECS.set(spec.name, {
|
|
33
|
+
name: spec.name,
|
|
34
|
+
annotations: spec.annotations,
|
|
35
|
+
// Built conditionally: exactOptionalPropertyTypes rejects an explicit
|
|
36
|
+
// `outputSchema: undefined` for an optional property.
|
|
37
|
+
...(outputSchema === undefined ? {} : { outputSchema }),
|
|
38
|
+
});
|
|
39
|
+
return (server, tm1Client) => {
|
|
40
|
+
if (spec.enabled && !spec.enabled(tm1Client))
|
|
41
|
+
return;
|
|
42
|
+
// ToolCallback<I> is a conditional type over an unresolved generic, so TS
|
|
43
|
+
// cannot check the lambda against it — the cast asserts what the
|
|
44
|
+
// ToolSpec.handler signature already pins down (same args, same return).
|
|
45
|
+
const cb = ((args, extra) => spec.handler(args, tm1Client, extra));
|
|
46
|
+
server.tool(spec.name, description, spec.input, cb);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=define-tool.js.map
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { withToolHint } from "../error-format.js";
|
|
3
|
+
import { actionResponse } from "../format.js";
|
|
4
|
+
import { IDEMPOTENT_DESTRUCTIVE } from "../annotations.js";
|
|
5
|
+
import { MutationResultSchema } from "../schemas/items.js";
|
|
6
|
+
import { defineTool } from "../define-tool.js";
|
|
7
|
+
import { HIERARCHY_NAME_OPTIONAL, resolveHierarchy } from "../hierarchy.js";
|
|
8
|
+
import { TM1Error, TM1ErrorCode } from "../../types.js";
|
|
9
|
+
const ElementSchema = z.object({
|
|
10
|
+
name: z.string().describe("Element name"),
|
|
11
|
+
type: z
|
|
12
|
+
.enum(["Numeric", "String", "Consolidated"])
|
|
13
|
+
.describe("N=numeric leaf, C=consolidated/parent, S=string"),
|
|
14
|
+
components: z
|
|
15
|
+
.array(z.object({
|
|
16
|
+
name: z.string().describe("Child element name"),
|
|
17
|
+
weight: z
|
|
18
|
+
.number()
|
|
19
|
+
.default(1)
|
|
20
|
+
.describe("Consolidation weight (default: 1)"),
|
|
21
|
+
}))
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("Child elements for a Consolidated element. REPLACES the full existing child set (verified live: passing [X,Y] drops any current children not in the list — it does not append). Omit or pass an empty array to leave existing children unchanged. To add one child, list the complete intended set."),
|
|
24
|
+
});
|
|
25
|
+
export const registerBulkUpsertElements = defineTool({
|
|
26
|
+
name: "tm1_bulk_upsert_elements",
|
|
27
|
+
description: [
|
|
28
|
+
"Create or update multiple elements in a TM1 hierarchy in bulk (two-pass: leafs first, then consolidations).",
|
|
29
|
+
"Existing elements are updated; new elements are created.",
|
|
30
|
+
"IMPORTANT: List all Numeric/String leaf elements BEFORE Consolidated elements to avoid reference errors.",
|
|
31
|
+
"For a Consolidated element, a non-empty components list REPLACES its full child set (existing children not listed are dropped); omit components to leave children unchanged.",
|
|
32
|
+
"When that would drop existing children, the call needs confirm=<dimension name>; dryRun=true returns the plan (creates, updates, typeChanges, removals) without writing.",
|
|
33
|
+
],
|
|
34
|
+
annotations: IDEMPOTENT_DESTRUCTIVE,
|
|
35
|
+
output: MutationResultSchema,
|
|
36
|
+
input: {
|
|
37
|
+
dimensionName: z.string().describe("Dimension name"),
|
|
38
|
+
...HIERARCHY_NAME_OPTIONAL,
|
|
39
|
+
elements: z
|
|
40
|
+
.array(ElementSchema)
|
|
41
|
+
.min(1)
|
|
42
|
+
.describe("Elements to create or update"),
|
|
43
|
+
dryRun: z
|
|
44
|
+
.boolean()
|
|
45
|
+
.optional()
|
|
46
|
+
.default(false)
|
|
47
|
+
.describe("Return the plan (creates, updates, typeChanges, removals) and write nothing."),
|
|
48
|
+
confirm: z
|
|
49
|
+
.string()
|
|
50
|
+
.optional()
|
|
51
|
+
.describe("Required only when components would remove existing children: the dimension name verbatim."),
|
|
52
|
+
},
|
|
53
|
+
handler: async ({ dimensionName, hierarchyName, elements, dryRun, confirm }, tm1Client) => {
|
|
54
|
+
const hier = resolveHierarchy(dimensionName, hierarchyName);
|
|
55
|
+
// Only a components list can drop children, so only then (or for a
|
|
56
|
+
// dryRun) is the plan worth its read. It must run before bulkUpsert: the
|
|
57
|
+
// $batch create pass commits as it goes.
|
|
58
|
+
const replacesChildren = elements.some((e) => e.type === "Consolidated" && (e.components?.length ?? 0) > 0);
|
|
59
|
+
if (dryRun || replacesChildren) {
|
|
60
|
+
const plan = await tm1Client.elements.planBulkUpsert(dimensionName, hier, elements);
|
|
61
|
+
if (dryRun) {
|
|
62
|
+
return actionResponse({
|
|
63
|
+
success: true,
|
|
64
|
+
dryRun: true,
|
|
65
|
+
dimensionName,
|
|
66
|
+
hierarchyName: hier,
|
|
67
|
+
...plan,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
if (plan.removals.length > 0 && confirm !== dimensionName) {
|
|
71
|
+
const dropped = plan.removals.reduce((n, r) => n + r.children.length, 0);
|
|
72
|
+
throw new TM1Error({
|
|
73
|
+
code: TM1ErrorCode.VALIDATION_ERROR,
|
|
74
|
+
message: `components would remove ${dropped} existing child link(s) under ${plan.removals.map((r) => r.parent).join(", ")}. Nothing was written.`,
|
|
75
|
+
hint: `components REPLACE a consolidation's children. Show the user details.removals; to proceed re-issue with confirm="${dimensionName}", or list the complete intended child set.`,
|
|
76
|
+
details: JSON.stringify({ removals: plan.removals }),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const { typeChanges } = await withToolHint(tm1Client.elements.bulkUpsert(dimensionName, hier, elements), "Bulk upsert failed. Common causes: Consolidated element references a child that is not in this batch and does not exist yet (list leafs first), dimension/hierarchy name mismatch (tm1_list_dimensions to verify), or attempt to change an element's type (delete + recreate instead).");
|
|
81
|
+
const counts = {
|
|
82
|
+
N: elements.filter((e) => e.type === "Numeric").length,
|
|
83
|
+
C: elements.filter((e) => e.type === "Consolidated").length,
|
|
84
|
+
S: elements.filter((e) => e.type === "String").length,
|
|
85
|
+
};
|
|
86
|
+
return actionResponse({
|
|
87
|
+
success: true,
|
|
88
|
+
dimensionName,
|
|
89
|
+
hierarchyName: hier,
|
|
90
|
+
total: elements.length,
|
|
91
|
+
counts,
|
|
92
|
+
// Existing elements whose Type was changed in place. A
|
|
93
|
+
// Numeric->Consolidated/String conversion discards the element's
|
|
94
|
+
// leaf cell values, so surface it instead of letting it happen
|
|
95
|
+
// silently.
|
|
96
|
+
typeChanges,
|
|
97
|
+
...(typeChanges.length > 0 && {
|
|
98
|
+
warning: `${typeChanges.length} element(s) had their type changed in place; any existing leaf cell values for those elements were discarded.`,
|
|
99
|
+
}),
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
//# sourceMappingURL=bulk-upsert-elements.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { actionResponse } from "../format.js";
|
|
3
|
+
import { MutationResultSchema } from "../schemas/items.js";
|
|
4
|
+
import { WRITE } from "../annotations.js";
|
|
5
|
+
import { defineTool } from "../define-tool.js";
|
|
6
|
+
export const registerCreateDimension = defineTool({
|
|
7
|
+
name: "tm1_create_dimension",
|
|
8
|
+
description: [
|
|
9
|
+
"Create a new TM1 dimension with a default hierarchy of the same name.",
|
|
10
|
+
"Fails if the dimension already exists. After: tm1_create_element / tm1_bulk_upsert_elements to populate, tm1_create_hierarchy for alternate hierarchies.",
|
|
11
|
+
],
|
|
12
|
+
annotations: WRITE,
|
|
13
|
+
output: MutationResultSchema,
|
|
14
|
+
input: {
|
|
15
|
+
dimensionName: z.string().describe("Dimension name"),
|
|
16
|
+
},
|
|
17
|
+
handler: async ({ dimensionName }, tm1Client) => {
|
|
18
|
+
await tm1Client.dimensions.create(dimensionName);
|
|
19
|
+
return actionResponse({ success: true, dimensionName });
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=create-dimension.js.map
|