@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,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { actionResponse } from "../format.js";
|
|
3
|
+
import { DESTRUCTIVE } from "../annotations.js";
|
|
4
|
+
import { MutationResultSchema } from "../schemas/items.js";
|
|
5
|
+
import { defineTool } from "../define-tool.js";
|
|
6
|
+
export const registerUnloadCube = defineTool({
|
|
7
|
+
name: "tm1_unload_cube",
|
|
8
|
+
description: "Unload a cube from memory. TM1 discards the in-memory fed-cell index and reloads from disk on next access. Required after feeder corrections, since the fed-cell index is cumulative — changes to existing feeders only take effect after an unload. Safe to call: data is preserved (read from .cub on next access). TM1 v11 only.",
|
|
9
|
+
annotations: DESTRUCTIVE,
|
|
10
|
+
// v11 only. v12 answers tm1.Unload with "Demand load, loading and unloading
|
|
11
|
+
// of cubes is no longer supported." — the feature is gone, with no successor
|
|
12
|
+
// endpoint, so the tool is withheld rather than offered and refused.
|
|
13
|
+
enabled: (tm1Client) => tm1Client.version === 11,
|
|
14
|
+
output: MutationResultSchema,
|
|
15
|
+
input: {
|
|
16
|
+
cubeName: z.string().describe("Name of the cube to unload"),
|
|
17
|
+
},
|
|
18
|
+
handler: async ({ cubeName }, tm1Client) => {
|
|
19
|
+
await tm1Client.cubes.unload(cubeName);
|
|
20
|
+
return actionResponse({ success: true, cubeName });
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=unload-cube.js.map
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { matchesProcessName, tsFromFilename, truncateTail, tailLines, } from "./error-log-helpers.js";
|
|
3
|
+
import { DiagnoseProcessErrorResultSchema } from "../schemas/items.js";
|
|
4
|
+
import { READ_ONLY } from "../annotations.js";
|
|
5
|
+
import { defineTool } from "../define-tool.js";
|
|
6
|
+
const DEFAULT_TAIL_LINES = 60;
|
|
7
|
+
const DEFAULT_MAX_LOGS = 3;
|
|
8
|
+
const DEFAULT_RELATED_WINDOW_SEC = 10;
|
|
9
|
+
const DEFAULT_RELATED_MAX_FILES = 5;
|
|
10
|
+
const DEFAULT_RELATED_MAX_BYTES = 16 * 1024;
|
|
11
|
+
export const registerDiagnoseProcessError = defineTool({
|
|
12
|
+
name: "tm1_diagnose_process_error",
|
|
13
|
+
description: [
|
|
14
|
+
"One-call error diagnosis for a failed TI process: lists matching error logs, fetches their content,",
|
|
15
|
+
"and optionally includes cascade-related sibling logs (same timestamp window) in a single response.",
|
|
16
|
+
"Replaces the manual sequence tm1_list_error_logs → tm1_get_error_log_content (× N). Returns logs newest-first.",
|
|
17
|
+
],
|
|
18
|
+
annotations: READ_ONLY,
|
|
19
|
+
output: DiagnoseProcessErrorResultSchema,
|
|
20
|
+
input: {
|
|
21
|
+
processName: z
|
|
22
|
+
.string()
|
|
23
|
+
.describe("Process name to diagnose. Matches both TM1 filename conventions: modern 'TM1ProcessError_<ts>_<id>_<processName>.log' and legacy '<processName>_<ts>.log'."),
|
|
24
|
+
since: z
|
|
25
|
+
.string()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Only consider logs with LastUpdated >= this ISO timestamp, e.g. '2026-05-04T00:00:00'."),
|
|
28
|
+
maxLogs: z
|
|
29
|
+
.number()
|
|
30
|
+
.int()
|
|
31
|
+
.min(1)
|
|
32
|
+
.max(20)
|
|
33
|
+
.optional()
|
|
34
|
+
.default(DEFAULT_MAX_LOGS)
|
|
35
|
+
.describe(`Max number of log files to fetch (newest first, default ${DEFAULT_MAX_LOGS}).`),
|
|
36
|
+
tail: z
|
|
37
|
+
.number()
|
|
38
|
+
.int()
|
|
39
|
+
.min(1)
|
|
40
|
+
.max(10000)
|
|
41
|
+
.optional()
|
|
42
|
+
.default(DEFAULT_TAIL_LINES)
|
|
43
|
+
.describe(`Lines to return from the end of each log (default ${DEFAULT_TAIL_LINES}).`),
|
|
44
|
+
includeRelated: z
|
|
45
|
+
.boolean()
|
|
46
|
+
.optional()
|
|
47
|
+
.default(true)
|
|
48
|
+
.describe("Also fetch sibling logs within ±relatedWindowSec of each log's timestamp (cascade failure tracing). Default: true."),
|
|
49
|
+
relatedWindowSec: z
|
|
50
|
+
.number()
|
|
51
|
+
.int()
|
|
52
|
+
.min(1)
|
|
53
|
+
.max(300)
|
|
54
|
+
.optional()
|
|
55
|
+
.default(DEFAULT_RELATED_WINDOW_SEC)
|
|
56
|
+
.describe(`Time window in seconds for cascade log discovery (default ${DEFAULT_RELATED_WINDOW_SEC}).`),
|
|
57
|
+
relatedMaxFiles: z
|
|
58
|
+
.number()
|
|
59
|
+
.int()
|
|
60
|
+
.min(1)
|
|
61
|
+
.max(20)
|
|
62
|
+
.optional()
|
|
63
|
+
.default(DEFAULT_RELATED_MAX_FILES)
|
|
64
|
+
.describe(`Max related logs per primary log (default ${DEFAULT_RELATED_MAX_FILES}).`),
|
|
65
|
+
},
|
|
66
|
+
handler: async ({ processName, since, maxLogs, tail, includeRelated, relatedWindowSec, relatedMaxFiles, }, tm1Client) => {
|
|
67
|
+
const allFiles = await tm1Client.server.listErrorLogFiles({ top: 500 });
|
|
68
|
+
const matching = allFiles
|
|
69
|
+
.filter((f) => matchesProcessName(f.filename, processName))
|
|
70
|
+
.filter((f) => {
|
|
71
|
+
if (!since)
|
|
72
|
+
return true;
|
|
73
|
+
return !f.lastUpdated || f.lastUpdated >= since;
|
|
74
|
+
})
|
|
75
|
+
.slice(0, maxLogs);
|
|
76
|
+
if (matching.length === 0) {
|
|
77
|
+
return {
|
|
78
|
+
content: [
|
|
79
|
+
{
|
|
80
|
+
type: "text",
|
|
81
|
+
text: JSON.stringify({
|
|
82
|
+
processName,
|
|
83
|
+
since: since ?? null,
|
|
84
|
+
logsFound: 0,
|
|
85
|
+
logsReturned: 0,
|
|
86
|
+
logs: [],
|
|
87
|
+
}),
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
const windowMs = relatedWindowSec * 1000;
|
|
93
|
+
const logs = await Promise.all(matching.map(async (f) => {
|
|
94
|
+
let content = "";
|
|
95
|
+
let fetchError;
|
|
96
|
+
let truncated = false;
|
|
97
|
+
let totalLines = 0;
|
|
98
|
+
try {
|
|
99
|
+
const raw = await tm1Client.server.getErrorLogContent(f.filename);
|
|
100
|
+
const result = tailLines(raw, tail);
|
|
101
|
+
content = result.body;
|
|
102
|
+
truncated = result.truncated;
|
|
103
|
+
totalLines = result.totalLines;
|
|
104
|
+
}
|
|
105
|
+
catch (e) {
|
|
106
|
+
fetchError = e.message;
|
|
107
|
+
}
|
|
108
|
+
const entry = {
|
|
109
|
+
filename: f.filename,
|
|
110
|
+
lastUpdated: f.lastUpdated,
|
|
111
|
+
totalLines,
|
|
112
|
+
truncated,
|
|
113
|
+
...(fetchError ? { fetchError } : { content }),
|
|
114
|
+
};
|
|
115
|
+
if (includeRelated) {
|
|
116
|
+
const sourceTs = tsFromFilename(f.filename);
|
|
117
|
+
if (sourceTs === null) {
|
|
118
|
+
entry.related = {
|
|
119
|
+
note: "No embedded timestamp — cascade lookup skipped.",
|
|
120
|
+
files: [],
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
const candidates = allFiles
|
|
125
|
+
.filter((r) => r.filename !== f.filename)
|
|
126
|
+
.map((r) => ({
|
|
127
|
+
filename: r.filename,
|
|
128
|
+
ts: tsFromFilename(r.filename),
|
|
129
|
+
}))
|
|
130
|
+
.filter((r) => r.ts !== null)
|
|
131
|
+
.filter((r) => Math.abs(r.ts - sourceTs) <= windowMs)
|
|
132
|
+
.sort((a, b) => Math.abs(a.ts - sourceTs) - Math.abs(b.ts - sourceTs))
|
|
133
|
+
.slice(0, relatedMaxFiles);
|
|
134
|
+
const related = await Promise.all(candidates.map(async ({ filename: rf, ts }) => {
|
|
135
|
+
try {
|
|
136
|
+
const raw = await tm1Client.server.getErrorLogContent(rf);
|
|
137
|
+
const { body, truncated: rt } = truncateTail(raw, DEFAULT_RELATED_MAX_BYTES);
|
|
138
|
+
return {
|
|
139
|
+
filename: rf,
|
|
140
|
+
deltaSec: Math.round((ts - sourceTs) / 1000),
|
|
141
|
+
truncated: rt,
|
|
142
|
+
content: body,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
catch (e) {
|
|
146
|
+
return {
|
|
147
|
+
filename: rf,
|
|
148
|
+
deltaSec: Math.round((ts - sourceTs) / 1000),
|
|
149
|
+
fetchError: e.message,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}));
|
|
153
|
+
entry.related = {
|
|
154
|
+
windowSec: relatedWindowSec,
|
|
155
|
+
found: candidates.length,
|
|
156
|
+
files: related,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return entry;
|
|
161
|
+
}));
|
|
162
|
+
return {
|
|
163
|
+
content: [
|
|
164
|
+
{
|
|
165
|
+
type: "text",
|
|
166
|
+
text: JSON.stringify({
|
|
167
|
+
processName,
|
|
168
|
+
since: since ?? null,
|
|
169
|
+
logsFound: matching.length,
|
|
170
|
+
logsReturned: logs.length,
|
|
171
|
+
logs,
|
|
172
|
+
}),
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
};
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
//# sourceMappingURL=diagnose-process-error.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Match a TI error log filename against a process name.
|
|
3
|
+
*
|
|
4
|
+
* Handles TM1 filename conventions:
|
|
5
|
+
* - Modern with session hash: TM1ProcessError_<ts>_<id>_<proc>_<hash>.log → `_<proc>_` contained
|
|
6
|
+
* - Modern without hash: TM1ProcessError_<ts>_<id>_<proc>.log → ends with `_<proc>.log`
|
|
7
|
+
* - Legacy/manual: <proc>_<ts>.log → starts with `<proc>_`
|
|
8
|
+
* - Bare: <proc> → exact match
|
|
9
|
+
*
|
|
10
|
+
* Substring-based match accepts a theoretical false positive when one process
|
|
11
|
+
* name is delimited by underscores inside another (e.g. "Import" vs "Re_Import_X").
|
|
12
|
+
* Acceptable trade for correctness on real-world v11 filenames.
|
|
13
|
+
*/
|
|
14
|
+
export declare function matchesProcessName(filename: string, processName: string): boolean;
|
|
15
|
+
export declare function tsFromFilename(filename: string): number | null;
|
|
16
|
+
export declare function truncateTail(content: string, maxBytes: number): {
|
|
17
|
+
body: string;
|
|
18
|
+
truncated: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare function tailLines(content: string, n: number): {
|
|
21
|
+
body: string;
|
|
22
|
+
truncated: boolean;
|
|
23
|
+
totalLines: number;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=error-log-helpers.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const TS_RE = /(\d{14})/;
|
|
2
|
+
/**
|
|
3
|
+
* Match a TI error log filename against a process name.
|
|
4
|
+
*
|
|
5
|
+
* Handles TM1 filename conventions:
|
|
6
|
+
* - Modern with session hash: TM1ProcessError_<ts>_<id>_<proc>_<hash>.log → `_<proc>_` contained
|
|
7
|
+
* - Modern without hash: TM1ProcessError_<ts>_<id>_<proc>.log → ends with `_<proc>.log`
|
|
8
|
+
* - Legacy/manual: <proc>_<ts>.log → starts with `<proc>_`
|
|
9
|
+
* - Bare: <proc> → exact match
|
|
10
|
+
*
|
|
11
|
+
* Substring-based match accepts a theoretical false positive when one process
|
|
12
|
+
* name is delimited by underscores inside another (e.g. "Import" vs "Re_Import_X").
|
|
13
|
+
* Acceptable trade for correctness on real-world v11 filenames.
|
|
14
|
+
*/
|
|
15
|
+
export function matchesProcessName(filename, processName) {
|
|
16
|
+
const f = filename.toLowerCase();
|
|
17
|
+
const p = processName.toLowerCase();
|
|
18
|
+
return (f === p ||
|
|
19
|
+
f.startsWith(`${p}_`) ||
|
|
20
|
+
f.endsWith(`_${p}.log`) ||
|
|
21
|
+
f.includes(`_${p}_`));
|
|
22
|
+
}
|
|
23
|
+
export function tsFromFilename(filename) {
|
|
24
|
+
const m = filename.match(TS_RE);
|
|
25
|
+
if (!m)
|
|
26
|
+
return null;
|
|
27
|
+
const s = m[1];
|
|
28
|
+
const y = Number(s.slice(0, 4));
|
|
29
|
+
const mo = Number(s.slice(4, 6)) - 1;
|
|
30
|
+
const d = Number(s.slice(6, 8));
|
|
31
|
+
const h = Number(s.slice(8, 10));
|
|
32
|
+
const mi = Number(s.slice(10, 12));
|
|
33
|
+
const se = Number(s.slice(12, 14));
|
|
34
|
+
const ms = Date.UTC(y, mo, d, h, mi, se);
|
|
35
|
+
return Number.isFinite(ms) ? ms : null;
|
|
36
|
+
}
|
|
37
|
+
export function truncateTail(content, maxBytes) {
|
|
38
|
+
const totalBytes = Buffer.byteLength(content, "utf8");
|
|
39
|
+
if (totalBytes <= maxBytes)
|
|
40
|
+
return { body: content, truncated: false };
|
|
41
|
+
return {
|
|
42
|
+
body: Buffer.from(content, "utf8").subarray(-maxBytes).toString("utf8"),
|
|
43
|
+
truncated: true,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export function tailLines(content, n) {
|
|
47
|
+
const trimmed = content.replace(/[\r\n]+$/, "");
|
|
48
|
+
const lines = trimmed.split(/\r?\n/);
|
|
49
|
+
if (lines.length <= n)
|
|
50
|
+
return { body: trimmed, truncated: false, totalLines: lines.length };
|
|
51
|
+
return {
|
|
52
|
+
body: lines.slice(-n).join("\n"),
|
|
53
|
+
truncated: true,
|
|
54
|
+
totalLines: lines.length,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=error-log-helpers.js.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { FORMAT_SCHEMA, payloadResponse, renderTable, columnsOf, } from "../format.js";
|
|
3
|
+
import { AuditLogEntrySchema } from "../schemas/items.js";
|
|
4
|
+
import { READ_ONLY, withVersion } from "../annotations.js";
|
|
5
|
+
import { defineTool } from "../define-tool.js";
|
|
6
|
+
export const registerGetAuditLog = defineTool({
|
|
7
|
+
name: "tm1_get_audit_log",
|
|
8
|
+
description: "Fetch recent TM1 audit log entries (metadata/security changes: who changed what, when), newest first. " +
|
|
9
|
+
"Requires AuditLogOn=T in tm1s.cfg — an empty result on an active server usually means auditing is disabled " +
|
|
10
|
+
"(check auditLogEnabled in tm1_get_server_info). (v11 only)",
|
|
11
|
+
annotations: withVersion(READ_ONLY, "v11"),
|
|
12
|
+
// v12 deprecated AuditLogEntry/AuditLogEntries in 12.0.0 and serves an empty
|
|
13
|
+
// collection with no successor endpoint, so the tool can only mislead there.
|
|
14
|
+
enabled: (tm1Client) => tm1Client.version === 11,
|
|
15
|
+
output: {
|
|
16
|
+
count: z.number().int(),
|
|
17
|
+
entries: z.array(AuditLogEntrySchema),
|
|
18
|
+
},
|
|
19
|
+
input: {
|
|
20
|
+
top: z
|
|
21
|
+
.number()
|
|
22
|
+
.int()
|
|
23
|
+
.min(1)
|
|
24
|
+
.max(1000)
|
|
25
|
+
.optional()
|
|
26
|
+
.default(100)
|
|
27
|
+
.describe("Max entries to return (default: 100, max: 1000)"),
|
|
28
|
+
user: z.string().optional().describe("Filter to one user name"),
|
|
29
|
+
objectType: z
|
|
30
|
+
.string()
|
|
31
|
+
.optional()
|
|
32
|
+
.describe("Filter to one object type, e.g. 'Cube', 'Dimension', 'Process', 'User', 'Chore', 'Server'"),
|
|
33
|
+
objectName: z.string().optional().describe("Filter to one object name"),
|
|
34
|
+
since: z
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Only entries on or after this ISO timestamp, e.g. '2026-06-01T00:00:00Z'"),
|
|
38
|
+
until: z
|
|
39
|
+
.string()
|
|
40
|
+
.optional()
|
|
41
|
+
.describe("Only entries on or before this ISO timestamp"),
|
|
42
|
+
includeDetails: z
|
|
43
|
+
.boolean()
|
|
44
|
+
.optional()
|
|
45
|
+
.default(false)
|
|
46
|
+
.describe("Expand per-entry audit details (nested change records)"),
|
|
47
|
+
...FORMAT_SCHEMA,
|
|
48
|
+
},
|
|
49
|
+
handler: async ({ top, user, objectType, objectName, since, until, includeDetails, format }, tm1Client) => {
|
|
50
|
+
const entries = await tm1Client.server.getAuditLog({
|
|
51
|
+
top,
|
|
52
|
+
user,
|
|
53
|
+
objectType,
|
|
54
|
+
objectName,
|
|
55
|
+
since,
|
|
56
|
+
until,
|
|
57
|
+
includeDetails,
|
|
58
|
+
});
|
|
59
|
+
const payload = { count: entries.length, entries };
|
|
60
|
+
const columns = columnsOf([
|
|
61
|
+
"timestamp",
|
|
62
|
+
"user",
|
|
63
|
+
"objectType",
|
|
64
|
+
"objectName",
|
|
65
|
+
"description",
|
|
66
|
+
]);
|
|
67
|
+
return payloadResponse(payload, format, (p) => `## Audit log\n\n${p.count} entries\n\n${renderTable(p.entries, columns)}`);
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=get-audit-log.js.map
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TM1Error, TM1ErrorCode } from "../../types.js";
|
|
3
|
+
import { mapSettledWithConcurrency } from "../../lib/concurrency.js";
|
|
4
|
+
import { FORMAT_SCHEMA, payloadResponse, renderTable, columnsOf, } from "../format.js";
|
|
5
|
+
import { fetchCubeStats, CubeStatsUnavailableError, } from "../../lib/cube-stats/fetcher.js";
|
|
6
|
+
import { CubeStatsResultSchema } from "../schemas/items.js";
|
|
7
|
+
import { READ_ONLY } from "../annotations.js";
|
|
8
|
+
import { defineTool } from "../define-tool.js";
|
|
9
|
+
export const registerGetCubeStats = defineTool({
|
|
10
|
+
name: "tm1_get_cube_stats",
|
|
11
|
+
description: [
|
|
12
|
+
"Read }StatsByCube metrics for one or more cubes (memory, populated cells, fed cells, feeder efficiency).",
|
|
13
|
+
"Well-known metrics are mapped to typed fields; the full element-name → value map is also returned under `raw` so server-side renames don't break the tool.",
|
|
14
|
+
"Per-cube errors are reported as items[].error without failing the whole call.",
|
|
15
|
+
"Servers with no }Stats* control cubes (TM1 v12), or accounts not allowed to read them, return `statsUnavailable` {reason: absent|denied} instead of a raw error.",
|
|
16
|
+
],
|
|
17
|
+
annotations: READ_ONLY,
|
|
18
|
+
output: CubeStatsResultSchema,
|
|
19
|
+
input: {
|
|
20
|
+
cubeName: z
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("Single cube name. Mutually exclusive with cubeNames."),
|
|
24
|
+
cubeNames: z
|
|
25
|
+
.array(z.string())
|
|
26
|
+
.min(1)
|
|
27
|
+
.max(500)
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("Batch mode — list of cube names (max 500). Mutually exclusive with cubeName."),
|
|
30
|
+
...FORMAT_SCHEMA,
|
|
31
|
+
},
|
|
32
|
+
handler: async ({ cubeName, cubeNames, format }, tm1Client) => {
|
|
33
|
+
if (cubeName !== undefined && cubeNames !== undefined) {
|
|
34
|
+
throw new TM1Error({
|
|
35
|
+
code: TM1ErrorCode.VALIDATION_ERROR,
|
|
36
|
+
message: "cubeName and cubeNames are mutually exclusive — pass only one.",
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
const targets = cubeNames ?? (cubeName !== undefined ? [cubeName] : []);
|
|
40
|
+
if (targets.length === 0) {
|
|
41
|
+
throw new TM1Error({
|
|
42
|
+
code: TM1ErrorCode.VALIDATION_ERROR,
|
|
43
|
+
message: "Specify exactly one of cubeName or cubeNames.",
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
// One }StatsByCube MDX per target, capped in flight. Unbounded, a batch
|
|
47
|
+
// of a few hundred cubes hands TM1's worker pool that many simultaneous
|
|
48
|
+
// queries — the same reason tm1_audit_feeders caps its runtime pass at
|
|
49
|
+
// the same width.
|
|
50
|
+
const settled = await mapSettledWithConcurrency(targets, 10, (name) => fetchCubeStats(tm1Client, name));
|
|
51
|
+
const items = settled.map((r, i) => {
|
|
52
|
+
if (r.status === "fulfilled")
|
|
53
|
+
return r.value;
|
|
54
|
+
const err = r.reason;
|
|
55
|
+
// `}StatsByCube` missing or unreadable is a property of the server or
|
|
56
|
+
// the account, not of this cube — its message is already plain prose.
|
|
57
|
+
if (err instanceof CubeStatsUnavailableError)
|
|
58
|
+
return { cubeName: targets[i], raw: {}, error: err.message };
|
|
59
|
+
const msg = err instanceof TM1Error ? `${err.code}: ${err.message}` : String(err);
|
|
60
|
+
return { cubeName: targets[i], raw: {}, error: msg };
|
|
61
|
+
});
|
|
62
|
+
// Success envelope, not isError: "this server does not keep these
|
|
63
|
+
// statistics" is an answer, and the tool already reports per-cube
|
|
64
|
+
// failures inside a successful payload. The top-level annotation is set
|
|
65
|
+
// only when EVERY target failed for the same server-wide reason, so a
|
|
66
|
+
// one-off per-cube failure never gets generalised into a claim about
|
|
67
|
+
// the server.
|
|
68
|
+
const statsUnavailable = serverWideUnavailability(settled);
|
|
69
|
+
const payload = {
|
|
70
|
+
count: items.length,
|
|
71
|
+
items,
|
|
72
|
+
...(statsUnavailable ? { statsUnavailable } : {}),
|
|
73
|
+
};
|
|
74
|
+
const columns = columnsOf([
|
|
75
|
+
{ header: "cube", get: (i) => i.cubeName },
|
|
76
|
+
"memoryTotal",
|
|
77
|
+
"populatedNumeric",
|
|
78
|
+
"fedCells",
|
|
79
|
+
"feederEfficiency",
|
|
80
|
+
"error",
|
|
81
|
+
]);
|
|
82
|
+
return payloadResponse(payload, format, (p) => `## Cube stats\n\n${p.count} cubes\n\n` +
|
|
83
|
+
(statsUnavailable ? `> ${statsUnavailable.message}\n\n` : "") +
|
|
84
|
+
renderTable(p.items, columns));
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
/**
|
|
88
|
+
* Collapse per-cube failures into one server-wide verdict — but only when
|
|
89
|
+
* every requested cube failed the same way. A mixed result stays per-cube.
|
|
90
|
+
*/
|
|
91
|
+
function serverWideUnavailability(settled) {
|
|
92
|
+
if (settled.length === 0)
|
|
93
|
+
return undefined;
|
|
94
|
+
let first;
|
|
95
|
+
for (const r of settled) {
|
|
96
|
+
if (r.status !== "rejected")
|
|
97
|
+
return undefined;
|
|
98
|
+
const err = r.reason;
|
|
99
|
+
if (!(err instanceof CubeStatsUnavailableError))
|
|
100
|
+
return undefined;
|
|
101
|
+
first ??= err;
|
|
102
|
+
if (err.reason !== first.reason)
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
return first ? { reason: first.reason, message: first.message } : undefined;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=get-cube-stats.js.map
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { tsFromFilename, truncateTail } from "./error-log-helpers.js";
|
|
3
|
+
import { ErrorLogContentResultSchema } from "../schemas/items.js";
|
|
4
|
+
import { READ_ONLY } from "../annotations.js";
|
|
5
|
+
import { defineTool } from "../define-tool.js";
|
|
6
|
+
const DEFAULT_MAX_BYTES = 64 * 1024;
|
|
7
|
+
const HARD_MAX_BYTES = 4 * 1024 * 1024;
|
|
8
|
+
const DEFAULT_RELATED_WINDOW_SEC = 10;
|
|
9
|
+
const HARD_MAX_RELATED_WINDOW_SEC = 300;
|
|
10
|
+
const DEFAULT_RELATED_MAX_FILES = 5;
|
|
11
|
+
const HARD_MAX_RELATED_FILES = 20;
|
|
12
|
+
const DEFAULT_RELATED_MAX_BYTES = 16 * 1024;
|
|
13
|
+
export const registerGetErrorLogContent = defineTool({
|
|
14
|
+
name: "tm1_get_error_log_content",
|
|
15
|
+
description: [
|
|
16
|
+
"Fetch the raw text of one TI error log file produced by a failed process run.",
|
|
17
|
+
"Use tm1_list_error_logs first to discover available filenames; response is tail/byte-truncated to protect the MCP context.",
|
|
18
|
+
"includeRelated also pulls sibling logs within a timestamp window — useful for tracing cascade failures in chained TI processes.",
|
|
19
|
+
],
|
|
20
|
+
annotations: READ_ONLY,
|
|
21
|
+
output: ErrorLogContentResultSchema,
|
|
22
|
+
input: {
|
|
23
|
+
filename: z
|
|
24
|
+
.string()
|
|
25
|
+
.describe("Exact filename returned by tm1_list_error_logs, e.g. 'MyProc_20260504_123045.log'"),
|
|
26
|
+
tail: z
|
|
27
|
+
.number()
|
|
28
|
+
.int()
|
|
29
|
+
.positive()
|
|
30
|
+
.max(10000)
|
|
31
|
+
.optional()
|
|
32
|
+
.describe("If set, return only the last N lines (overrides maxBytes byte truncation)."),
|
|
33
|
+
maxBytes: z
|
|
34
|
+
.number()
|
|
35
|
+
.int()
|
|
36
|
+
.positive()
|
|
37
|
+
.max(HARD_MAX_BYTES)
|
|
38
|
+
.optional()
|
|
39
|
+
.default(DEFAULT_MAX_BYTES)
|
|
40
|
+
.describe(`Truncate to last N bytes if no tail is given (default ${DEFAULT_MAX_BYTES}, hard max ${HARD_MAX_BYTES}).`),
|
|
41
|
+
includeRelated: z
|
|
42
|
+
.boolean()
|
|
43
|
+
.optional()
|
|
44
|
+
.default(false)
|
|
45
|
+
.describe("If true, also fetch sibling error logs whose embedded YYYYMMDDHHMMSS timestamp is within ±relatedWindowSec of the source log."),
|
|
46
|
+
relatedWindowSec: z
|
|
47
|
+
.number()
|
|
48
|
+
.int()
|
|
49
|
+
.positive()
|
|
50
|
+
.max(HARD_MAX_RELATED_WINDOW_SEC)
|
|
51
|
+
.optional()
|
|
52
|
+
.default(DEFAULT_RELATED_WINDOW_SEC)
|
|
53
|
+
.describe(`Time window in seconds for related-log discovery (default ${DEFAULT_RELATED_WINDOW_SEC}, max ${HARD_MAX_RELATED_WINDOW_SEC}).`),
|
|
54
|
+
relatedMaxFiles: z
|
|
55
|
+
.number()
|
|
56
|
+
.int()
|
|
57
|
+
.positive()
|
|
58
|
+
.max(HARD_MAX_RELATED_FILES)
|
|
59
|
+
.optional()
|
|
60
|
+
.default(DEFAULT_RELATED_MAX_FILES)
|
|
61
|
+
.describe(`Cap on number of related logs returned (default ${DEFAULT_RELATED_MAX_FILES}, max ${HARD_MAX_RELATED_FILES}).`),
|
|
62
|
+
relatedMaxBytes: z
|
|
63
|
+
.number()
|
|
64
|
+
.int()
|
|
65
|
+
.positive()
|
|
66
|
+
.max(HARD_MAX_BYTES)
|
|
67
|
+
.optional()
|
|
68
|
+
.default(DEFAULT_RELATED_MAX_BYTES)
|
|
69
|
+
.describe(`Per-related-log byte cap (tail-truncated, default ${DEFAULT_RELATED_MAX_BYTES}).`),
|
|
70
|
+
},
|
|
71
|
+
handler: async ({ filename, tail, maxBytes, includeRelated, relatedWindowSec, relatedMaxFiles, relatedMaxBytes, }, tm1Client) => {
|
|
72
|
+
const content = await tm1Client.server.getErrorLogContent(filename);
|
|
73
|
+
const totalBytes = Buffer.byteLength(content, "utf8");
|
|
74
|
+
let body;
|
|
75
|
+
let truncated = false;
|
|
76
|
+
let truncationReason;
|
|
77
|
+
if (tail !== undefined) {
|
|
78
|
+
// Strip trailing CR/LF so a file ending in '\n' doesn't yield a phantom empty last line.
|
|
79
|
+
const trimmed = content.replace(/[\r\n]+$/, "");
|
|
80
|
+
const allLines = trimmed.split(/\r?\n/);
|
|
81
|
+
if (allLines.length > tail) {
|
|
82
|
+
body = allLines.slice(-tail).join("\n");
|
|
83
|
+
truncated = true;
|
|
84
|
+
truncationReason = `tail=${tail} (of ${allLines.length} lines)`;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
body = trimmed;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else if (totalBytes > maxBytes) {
|
|
91
|
+
body = Buffer.from(content, "utf8").subarray(-maxBytes).toString("utf8");
|
|
92
|
+
truncated = true;
|
|
93
|
+
truncationReason = `maxBytes=${maxBytes} (tail-truncated)`;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
body = content;
|
|
97
|
+
}
|
|
98
|
+
const payload = {
|
|
99
|
+
filename,
|
|
100
|
+
totalBytes,
|
|
101
|
+
returnedBytes: Buffer.byteLength(body, "utf8"),
|
|
102
|
+
truncated,
|
|
103
|
+
...(truncationReason ? { truncationReason } : {}),
|
|
104
|
+
content: body,
|
|
105
|
+
};
|
|
106
|
+
if (includeRelated) {
|
|
107
|
+
const sourceTs = tsFromFilename(filename);
|
|
108
|
+
if (sourceTs === null) {
|
|
109
|
+
payload.related = {
|
|
110
|
+
note: "Source filename has no embedded YYYYMMDDHHMMSS timestamp — relation lookup skipped.",
|
|
111
|
+
files: [],
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
const allFiles = await tm1Client.server.listErrorLogFiles({
|
|
116
|
+
top: 500,
|
|
117
|
+
});
|
|
118
|
+
const windowMs = relatedWindowSec * 1000;
|
|
119
|
+
const candidates = allFiles
|
|
120
|
+
.filter((f) => f.filename !== filename)
|
|
121
|
+
.map((f) => ({
|
|
122
|
+
filename: f.filename,
|
|
123
|
+
ts: tsFromFilename(f.filename),
|
|
124
|
+
}))
|
|
125
|
+
.filter((f) => f.ts !== null)
|
|
126
|
+
.filter((f) => Math.abs(f.ts - sourceTs) <= windowMs)
|
|
127
|
+
.sort((a, b) => Math.abs(a.ts - sourceTs) - Math.abs(b.ts - sourceTs))
|
|
128
|
+
.slice(0, relatedMaxFiles);
|
|
129
|
+
const fetched = await Promise.all(candidates.map(async ({ filename: rf, ts }) => {
|
|
130
|
+
try {
|
|
131
|
+
const raw = await tm1Client.server.getErrorLogContent(rf);
|
|
132
|
+
const rawBytes = Buffer.byteLength(raw, "utf8");
|
|
133
|
+
const { body: rb, truncated: rt } = truncateTail(raw, relatedMaxBytes);
|
|
134
|
+
return {
|
|
135
|
+
filename: rf,
|
|
136
|
+
deltaSec: Math.round((ts - sourceTs) / 1000),
|
|
137
|
+
totalBytes: rawBytes,
|
|
138
|
+
returnedBytes: Buffer.byteLength(rb, "utf8"),
|
|
139
|
+
truncated: rt,
|
|
140
|
+
content: rb,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
catch (e) {
|
|
144
|
+
return {
|
|
145
|
+
filename: rf,
|
|
146
|
+
deltaSec: Math.round((ts - sourceTs) / 1000),
|
|
147
|
+
error: e.message,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}));
|
|
151
|
+
payload.related = {
|
|
152
|
+
windowSec: relatedWindowSec,
|
|
153
|
+
found: candidates.length,
|
|
154
|
+
maxFiles: relatedMaxFiles,
|
|
155
|
+
files: fetched,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
content: [{ type: "text", text: JSON.stringify(payload) }],
|
|
161
|
+
};
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
//# sourceMappingURL=get-error-log-content.js.map
|