@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.
Files changed (475) hide show
  1. package/CHANGELOG.md +1211 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE +34 -0
  4. package/README.md +276 -0
  5. package/dist/config.d.ts +35 -0
  6. package/dist/config.js +238 -0
  7. package/dist/http-transport.d.ts +8 -0
  8. package/dist/http-transport.js +132 -0
  9. package/dist/index.d.ts +18 -0
  10. package/dist/index.js +164 -0
  11. package/dist/lib/callgraph/callGraph.d.ts +124 -0
  12. package/dist/lib/callgraph/callGraph.js +334 -0
  13. package/dist/lib/callgraph/choreGraph.d.ts +23 -0
  14. package/dist/lib/callgraph/choreGraph.js +102 -0
  15. package/dist/lib/callgraph/dataFlow.d.ts +74 -0
  16. package/dist/lib/callgraph/dataFlow.js +271 -0
  17. package/dist/lib/callgraph/datasourceMembership.d.ts +31 -0
  18. package/dist/lib/callgraph/datasourceMembership.js +142 -0
  19. package/dist/lib/callgraph/lintTypes.d.ts +28 -0
  20. package/dist/lib/callgraph/lintTypes.js +2 -0
  21. package/dist/lib/callgraph/mdxMembers.d.ts +29 -0
  22. package/dist/lib/callgraph/mdxMembers.js +97 -0
  23. package/dist/lib/callgraph/referenceIndex.d.ts +179 -0
  24. package/dist/lib/callgraph/referenceIndex.js +584 -0
  25. package/dist/lib/callgraph/rulesLinter.d.ts +55 -0
  26. package/dist/lib/callgraph/rulesLinter.js +776 -0
  27. package/dist/lib/callgraph/rulesParser.d.ts +26 -0
  28. package/dist/lib/callgraph/rulesParser.js +71 -0
  29. package/dist/lib/callgraph/subsetUsage.d.ts +16 -0
  30. package/dist/lib/callgraph/subsetUsage.js +134 -0
  31. package/dist/lib/callgraph/tiParser.d.ts +21 -0
  32. package/dist/lib/callgraph/tiParser.js +672 -0
  33. package/dist/lib/callgraph/tiSignatures.d.ts +32 -0
  34. package/dist/lib/callgraph/tiSignatures.js +6185 -0
  35. package/dist/lib/callgraph/tm1-adapter.d.ts +32 -0
  36. package/dist/lib/callgraph/tm1-adapter.js +159 -0
  37. package/dist/lib/callgraph/types.d.ts +53 -0
  38. package/dist/lib/callgraph/types.js +2 -0
  39. package/dist/lib/callgraph/variableEnv.d.ts +86 -0
  40. package/dist/lib/callgraph/variableEnv.js +214 -0
  41. package/dist/lib/cell-address.d.ts +12 -0
  42. package/dist/lib/cell-address.js +71 -0
  43. package/dist/lib/complexity/antipatterns.d.ts +22 -0
  44. package/dist/lib/complexity/antipatterns.js +302 -0
  45. package/dist/lib/complexity/comment-classifier.d.ts +24 -0
  46. package/dist/lib/complexity/comment-classifier.js +43 -0
  47. package/dist/lib/complexity/cross-process.d.ts +78 -0
  48. package/dist/lib/complexity/cross-process.js +114 -0
  49. package/dist/lib/complexity/process-metrics.d.ts +78 -0
  50. package/dist/lib/complexity/process-metrics.js +278 -0
  51. package/dist/lib/complexity/rules-metrics.d.ts +31 -0
  52. package/dist/lib/complexity/rules-metrics.js +99 -0
  53. package/dist/lib/concurrency.d.ts +11 -0
  54. package/dist/lib/concurrency.js +27 -0
  55. package/dist/lib/control-name.d.ts +10 -0
  56. package/dist/lib/control-name.js +10 -0
  57. package/dist/lib/coordinate-error.d.ts +3 -0
  58. package/dist/lib/coordinate-error.js +29 -0
  59. package/dist/lib/credential-format.d.ts +23 -0
  60. package/dist/lib/credential-format.js +25 -0
  61. package/dist/lib/cube-stats/fetcher.d.ts +106 -0
  62. package/dist/lib/cube-stats/fetcher.js +194 -0
  63. package/dist/lib/feeders/brackets.d.ts +47 -0
  64. package/dist/lib/feeders/brackets.js +195 -0
  65. package/dist/lib/feeders/element-type-cache.d.ts +42 -0
  66. package/dist/lib/feeders/element-type-cache.js +86 -0
  67. package/dist/lib/feeders/static-heuristics.d.ts +101 -0
  68. package/dist/lib/feeders/static-heuristics.js +202 -0
  69. package/dist/lib/git-process.d.ts +67 -0
  70. package/dist/lib/git-process.js +243 -0
  71. package/dist/lib/mask-secrets.d.ts +10 -0
  72. package/dist/lib/mask-secrets.js +99 -0
  73. package/dist/lib/mdx.d.ts +3 -0
  74. package/dist/lib/mdx.js +13 -0
  75. package/dist/lib/naming/odata-filter.d.ts +15 -0
  76. package/dist/lib/naming/odata-filter.js +81 -0
  77. package/dist/lib/naming/rules.d.ts +34 -0
  78. package/dist/lib/naming/rules.js +215 -0
  79. package/dist/lib/pro-parser.d.ts +19 -0
  80. package/dist/lib/pro-parser.js +260 -0
  81. package/dist/lib/pro-serializer.d.ts +19 -0
  82. package/dist/lib/pro-serializer.js +170 -0
  83. package/dist/lib/process-parts-schema.d.ts +45 -0
  84. package/dist/lib/process-parts-schema.js +46 -0
  85. package/dist/lib/process-refs.d.ts +88 -0
  86. package/dist/lib/process-refs.js +441 -0
  87. package/dist/lib/rules-outline.d.ts +29 -0
  88. package/dist/lib/rules-outline.js +68 -0
  89. package/dist/lib/rules-patch.d.ts +6 -0
  90. package/dist/lib/rules-patch.js +59 -0
  91. package/dist/lib/safe-regex.d.ts +15 -0
  92. package/dist/lib/safe-regex.js +37 -0
  93. package/dist/lib/sample-cells.d.ts +48 -0
  94. package/dist/lib/sample-cells.js +146 -0
  95. package/dist/lib/slim-json-schema.d.ts +20 -0
  96. package/dist/lib/slim-json-schema.js +68 -0
  97. package/dist/lib/strip-comments.d.ts +23 -0
  98. package/dist/lib/strip-comments.js +61 -0
  99. package/dist/lib/tm1-events.d.ts +16 -0
  100. package/dist/lib/tm1-events.js +29 -0
  101. package/dist/lib/v12-compat/deprecated-ti.d.ts +17 -0
  102. package/dist/lib/v12-compat/deprecated-ti.js +257 -0
  103. package/dist/lib/v12-compat/scanner.d.ts +10 -0
  104. package/dist/lib/v12-compat/scanner.js +43 -0
  105. package/dist/lib/variables-ui-data.d.ts +26 -0
  106. package/dist/lib/variables-ui-data.js +77 -0
  107. package/dist/load-env.d.ts +2 -0
  108. package/dist/load-env.js +29 -0
  109. package/dist/logger.d.ts +4 -0
  110. package/dist/logger.js +60 -0
  111. package/dist/prompts/index.d.ts +3 -0
  112. package/dist/prompts/index.js +141 -0
  113. package/dist/resources/index.d.ts +5 -0
  114. package/dist/resources/index.js +237 -0
  115. package/dist/resources/list-handler.d.ts +40 -0
  116. package/dist/resources/list-handler.js +86 -0
  117. package/dist/resources/subscriptions.d.ts +19 -0
  118. package/dist/resources/subscriptions.js +80 -0
  119. package/dist/schemas/cells.d.ts +17 -0
  120. package/dist/schemas/cells.js +13 -0
  121. package/dist/schemas/common.d.ts +16 -0
  122. package/dist/schemas/common.js +14 -0
  123. package/dist/schemas/index.d.ts +10 -0
  124. package/dist/schemas/index.js +23 -0
  125. package/dist/schemas/metadata.d.ts +70 -0
  126. package/dist/schemas/metadata.js +47 -0
  127. package/dist/schemas/monitoring.d.ts +95 -0
  128. package/dist/schemas/monitoring.js +69 -0
  129. package/dist/schemas/processes.d.ts +74 -0
  130. package/dist/schemas/processes.js +66 -0
  131. package/dist/schemas/scheduling.d.ts +13 -0
  132. package/dist/schemas/scheduling.js +13 -0
  133. package/dist/schemas/security.d.ts +19 -0
  134. package/dist/schemas/security.js +16 -0
  135. package/dist/schemas/subsets.d.ts +12 -0
  136. package/dist/schemas/subsets.js +12 -0
  137. package/dist/schemas/views.d.ts +9 -0
  138. package/dist/schemas/views.js +9 -0
  139. package/dist/session-manager.d.ts +79 -0
  140. package/dist/session-manager.js +281 -0
  141. package/dist/tm1-client/connection/profile.d.ts +13 -0
  142. package/dist/tm1-client/connection/profile.js +99 -0
  143. package/dist/tm1-client/dispatcher.d.ts +5 -0
  144. package/dist/tm1-client/dispatcher.js +31 -0
  145. package/dist/tm1-client/http.d.ts +81 -0
  146. package/dist/tm1-client/http.js +547 -0
  147. package/dist/tm1-client/services/batch-service.d.ts +123 -0
  148. package/dist/tm1-client/services/batch-service.js +455 -0
  149. package/dist/tm1-client/services/cell-service.d.ts +71 -0
  150. package/dist/tm1-client/services/cell-service.js +333 -0
  151. package/dist/tm1-client/services/cellset-transform.d.ts +26 -0
  152. package/dist/tm1-client/services/cellset-transform.js +80 -0
  153. package/dist/tm1-client/services/chore-service.d.ts +68 -0
  154. package/dist/tm1-client/services/chore-service.js +179 -0
  155. package/dist/tm1-client/services/chore-status.d.ts +11 -0
  156. package/dist/tm1-client/services/chore-status.js +127 -0
  157. package/dist/tm1-client/services/cube-service.d.ts +134 -0
  158. package/dist/tm1-client/services/cube-service.js +294 -0
  159. package/dist/tm1-client/services/dimension-service.d.ts +118 -0
  160. package/dist/tm1-client/services/dimension-service.js +249 -0
  161. package/dist/tm1-client/services/element-service.d.ts +245 -0
  162. package/dist/tm1-client/services/element-service.js +809 -0
  163. package/dist/tm1-client/services/fallback.d.ts +44 -0
  164. package/dist/tm1-client/services/fallback.js +72 -0
  165. package/dist/tm1-client/services/file-service.d.ts +53 -0
  166. package/dist/tm1-client/services/file-service.js +218 -0
  167. package/dist/tm1-client/services/hierarchy-service.d.ts +129 -0
  168. package/dist/tm1-client/services/hierarchy-service.js +332 -0
  169. package/dist/tm1-client/services/monitoring-service.d.ts +34 -0
  170. package/dist/tm1-client/services/monitoring-service.js +123 -0
  171. package/dist/tm1-client/services/odata-page.d.ts +71 -0
  172. package/dist/tm1-client/services/odata-page.js +87 -0
  173. package/dist/tm1-client/services/process-service.d.ts +278 -0
  174. package/dist/tm1-client/services/process-service.js +874 -0
  175. package/dist/tm1-client/services/process-status.d.ts +21 -0
  176. package/dist/tm1-client/services/process-status.js +89 -0
  177. package/dist/tm1-client/services/security-service.d.ts +50 -0
  178. package/dist/tm1-client/services/security-service.js +93 -0
  179. package/dist/tm1-client/services/server-service.d.ts +116 -0
  180. package/dist/tm1-client/services/server-service.js +504 -0
  181. package/dist/tm1-client/services/subset-service.d.ts +37 -0
  182. package/dist/tm1-client/services/subset-service.js +122 -0
  183. package/dist/tm1-client/services/view-service.d.ts +46 -0
  184. package/dist/tm1-client/services/view-service.js +287 -0
  185. package/dist/tm1-client.d.ts +56 -0
  186. package/dist/tm1-client.js +126 -0
  187. package/dist/tools/analysis/analyze-callgraph.d.ts +28 -0
  188. package/dist/tools/analysis/analyze-callgraph.js +350 -0
  189. package/dist/tools/analysis/analyze-chore-graph.d.ts +2 -0
  190. package/dist/tools/analysis/analyze-chore-graph.js +148 -0
  191. package/dist/tools/analysis/analyze-object-usage.d.ts +2 -0
  192. package/dist/tools/analysis/analyze-object-usage.js +143 -0
  193. package/dist/tools/analysis/audit-complexity.d.ts +2 -0
  194. package/dist/tools/analysis/audit-complexity.js +255 -0
  195. package/dist/tools/analysis/audit-feeders.d.ts +2 -0
  196. package/dist/tools/analysis/audit-feeders.js +417 -0
  197. package/dist/tools/analysis/audit-naming.d.ts +2 -0
  198. package/dist/tools/analysis/audit-naming.js +379 -0
  199. package/dist/tools/analysis/check-v12-readiness.d.ts +2 -0
  200. package/dist/tools/analysis/check-v12-readiness.js +136 -0
  201. package/dist/tools/analysis/find-orphan-dimensions.d.ts +2 -0
  202. package/dist/tools/analysis/find-orphan-dimensions.js +55 -0
  203. package/dist/tools/analysis/invalidate-callgraph-cache.d.ts +2 -0
  204. package/dist/tools/analysis/invalidate-callgraph-cache.js +40 -0
  205. package/dist/tools/analysis/trace-data-flow.d.ts +2 -0
  206. package/dist/tools/analysis/trace-data-flow.js +138 -0
  207. package/dist/tools/annotations.d.ts +12 -0
  208. package/dist/tools/annotations.js +61 -0
  209. package/dist/tools/celldata/check-feeders.d.ts +2 -0
  210. package/dist/tools/celldata/check-feeders.js +48 -0
  211. package/dist/tools/celldata/check-writable-coords.d.ts +2 -0
  212. package/dist/tools/celldata/check-writable-coords.js +126 -0
  213. package/dist/tools/celldata/execute-mdx.d.ts +17 -0
  214. package/dist/tools/celldata/execute-mdx.js +126 -0
  215. package/dist/tools/celldata/get-cell-value.d.ts +2 -0
  216. package/dist/tools/celldata/get-cell-value.js +30 -0
  217. package/dist/tools/celldata/get-view-definition.d.ts +2 -0
  218. package/dist/tools/celldata/get-view-definition.js +29 -0
  219. package/dist/tools/celldata/get-view.d.ts +2 -0
  220. package/dist/tools/celldata/get-view.js +55 -0
  221. package/dist/tools/celldata/sample-cells.d.ts +2 -0
  222. package/dist/tools/celldata/sample-cells.js +101 -0
  223. package/dist/tools/celldata/trace-cell-calculation.d.ts +2 -0
  224. package/dist/tools/celldata/trace-cell-calculation.js +53 -0
  225. package/dist/tools/celldata/trace-feeders.d.ts +2 -0
  226. package/dist/tools/celldata/trace-feeders.js +44 -0
  227. package/dist/tools/celldata/write-cells.d.ts +2 -0
  228. package/dist/tools/celldata/write-cells.js +65 -0
  229. package/dist/tools/confirm.d.ts +10 -0
  230. package/dist/tools/confirm.js +64 -0
  231. package/dist/tools/define-tool.d.ts +51 -0
  232. package/dist/tools/define-tool.js +49 -0
  233. package/dist/tools/dimension-management/bulk-upsert-elements.d.ts +2 -0
  234. package/dist/tools/dimension-management/bulk-upsert-elements.js +103 -0
  235. package/dist/tools/dimension-management/create-dimension.d.ts +2 -0
  236. package/dist/tools/dimension-management/create-dimension.js +22 -0
  237. package/dist/tools/dimension-management/create-element-attribute.d.ts +2 -0
  238. package/dist/tools/dimension-management/create-element-attribute.js +26 -0
  239. package/dist/tools/dimension-management/create-element.d.ts +2 -0
  240. package/dist/tools/dimension-management/create-element.js +31 -0
  241. package/dist/tools/dimension-management/create-hierarchy.d.ts +2 -0
  242. package/dist/tools/dimension-management/create-hierarchy.js +22 -0
  243. package/dist/tools/dimension-management/delete-dimension.d.ts +2 -0
  244. package/dist/tools/dimension-management/delete-dimension.js +25 -0
  245. package/dist/tools/dimension-management/delete-element.d.ts +2 -0
  246. package/dist/tools/dimension-management/delete-element.js +26 -0
  247. package/dist/tools/dimension-management/delete-elements.d.ts +2 -0
  248. package/dist/tools/dimension-management/delete-elements.js +44 -0
  249. package/dist/tools/dimension-management/delete-hierarchy.d.ts +2 -0
  250. package/dist/tools/dimension-management/delete-hierarchy.js +35 -0
  251. package/dist/tools/dimension-management/get-element-attribute-values.d.ts +2 -0
  252. package/dist/tools/dimension-management/get-element-attribute-values.js +77 -0
  253. package/dist/tools/dimension-management/list-element-attributes.d.ts +2 -0
  254. package/dist/tools/dimension-management/list-element-attributes.js +31 -0
  255. package/dist/tools/dimension-management/move-element.d.ts +2 -0
  256. package/dist/tools/dimension-management/move-element.js +28 -0
  257. package/dist/tools/dimension-management/update-element-attribute-value.d.ts +2 -0
  258. package/dist/tools/dimension-management/update-element-attribute-value.js +80 -0
  259. package/dist/tools/dimension-management/update-element.d.ts +2 -0
  260. package/dist/tools/dimension-management/update-element.js +35 -0
  261. package/dist/tools/error-format.d.ts +22 -0
  262. package/dist/tools/error-format.js +130 -0
  263. package/dist/tools/fileops/delete-file.d.ts +2 -0
  264. package/dist/tools/fileops/delete-file.js +32 -0
  265. package/dist/tools/fileops/get-file-content.d.ts +2 -0
  266. package/dist/tools/fileops/get-file-content.js +76 -0
  267. package/dist/tools/fileops/list-files.d.ts +2 -0
  268. package/dist/tools/fileops/list-files.js +43 -0
  269. package/dist/tools/fileops/search-files.d.ts +2 -0
  270. package/dist/tools/fileops/search-files.js +76 -0
  271. package/dist/tools/fileops/upload-file.d.ts +2 -0
  272. package/dist/tools/fileops/upload-file.js +69 -0
  273. package/dist/tools/format.d.ts +57 -0
  274. package/dist/tools/format.js +157 -0
  275. package/dist/tools/hierarchy.d.ts +6 -0
  276. package/dist/tools/hierarchy.js +27 -0
  277. package/dist/tools/index.d.ts +4 -0
  278. package/dist/tools/index.js +263 -0
  279. package/dist/tools/local-file.d.ts +16 -0
  280. package/dist/tools/local-file.js +88 -0
  281. package/dist/tools/metadata/get-ancestors.d.ts +2 -0
  282. package/dist/tools/metadata/get-ancestors.js +36 -0
  283. package/dist/tools/metadata/get-descendants.d.ts +2 -0
  284. package/dist/tools/metadata/get-descendants.js +64 -0
  285. package/dist/tools/metadata/get-hierarchy.d.ts +2 -0
  286. package/dist/tools/metadata/get-hierarchy.js +130 -0
  287. package/dist/tools/metadata/list-chores.d.ts +2 -0
  288. package/dist/tools/metadata/list-chores.js +62 -0
  289. package/dist/tools/metadata/list-cubes.d.ts +2 -0
  290. package/dist/tools/metadata/list-cubes.js +128 -0
  291. package/dist/tools/metadata/list-dimensions.d.ts +2 -0
  292. package/dist/tools/metadata/list-dimensions.js +131 -0
  293. package/dist/tools/metadata/list-processes-grouped.d.ts +2 -0
  294. package/dist/tools/metadata/list-processes-grouped.js +96 -0
  295. package/dist/tools/metadata/list-processes.d.ts +2 -0
  296. package/dist/tools/metadata/list-processes.js +108 -0
  297. package/dist/tools/metadata/resolve-default-members.d.ts +2 -0
  298. package/dist/tools/metadata/resolve-default-members.js +46 -0
  299. package/dist/tools/model-building/check-cube-rule.d.ts +2 -0
  300. package/dist/tools/model-building/check-cube-rule.js +51 -0
  301. package/dist/tools/model-building/clear-cube.d.ts +2 -0
  302. package/dist/tools/model-building/clear-cube.js +46 -0
  303. package/dist/tools/model-building/create-cube.d.ts +2 -0
  304. package/dist/tools/model-building/create-cube.js +34 -0
  305. package/dist/tools/model-building/delete-cube.d.ts +2 -0
  306. package/dist/tools/model-building/delete-cube.js +27 -0
  307. package/dist/tools/model-building/get-all-cube-rules.d.ts +2 -0
  308. package/dist/tools/model-building/get-all-cube-rules.js +149 -0
  309. package/dist/tools/model-building/get-cube-rules.d.ts +2 -0
  310. package/dist/tools/model-building/get-cube-rules.js +69 -0
  311. package/dist/tools/model-building/rules-source.d.ts +21 -0
  312. package/dist/tools/model-building/rules-source.js +49 -0
  313. package/dist/tools/model-building/search-rules.d.ts +2 -0
  314. package/dist/tools/model-building/search-rules.js +132 -0
  315. package/dist/tools/model-building/set-cube-rules.d.ts +2 -0
  316. package/dist/tools/model-building/set-cube-rules.js +81 -0
  317. package/dist/tools/model-building/unload-cube.d.ts +2 -0
  318. package/dist/tools/model-building/unload-cube.js +23 -0
  319. package/dist/tools/operations/diagnose-process-error.d.ts +2 -0
  320. package/dist/tools/operations/diagnose-process-error.js +178 -0
  321. package/dist/tools/operations/error-log-helpers.d.ts +25 -0
  322. package/dist/tools/operations/error-log-helpers.js +57 -0
  323. package/dist/tools/operations/get-audit-log.d.ts +2 -0
  324. package/dist/tools/operations/get-audit-log.js +70 -0
  325. package/dist/tools/operations/get-cube-stats.d.ts +2 -0
  326. package/dist/tools/operations/get-cube-stats.js +107 -0
  327. package/dist/tools/operations/get-error-log-content.d.ts +2 -0
  328. package/dist/tools/operations/get-error-log-content.js +164 -0
  329. package/dist/tools/operations/get-jobs.d.ts +3 -0
  330. package/dist/tools/operations/get-jobs.js +51 -0
  331. package/dist/tools/operations/get-message-log.d.ts +2 -0
  332. package/dist/tools/operations/get-message-log.js +63 -0
  333. package/dist/tools/operations/get-server-info.d.ts +2 -0
  334. package/dist/tools/operations/get-server-info.js +180 -0
  335. package/dist/tools/operations/get-server-state.d.ts +2 -0
  336. package/dist/tools/operations/get-server-state.js +129 -0
  337. package/dist/tools/operations/get-sessions.d.ts +2 -0
  338. package/dist/tools/operations/get-sessions.js +76 -0
  339. package/dist/tools/operations/get-threads.d.ts +3 -0
  340. package/dist/tools/operations/get-threads.js +50 -0
  341. package/dist/tools/operations/get-transaction-log.d.ts +2 -0
  342. package/dist/tools/operations/get-transaction-log.js +63 -0
  343. package/dist/tools/operations/list-error-logs.d.ts +8 -0
  344. package/dist/tools/operations/list-error-logs.js +157 -0
  345. package/dist/tools/operations/save-data.d.ts +2 -0
  346. package/dist/tools/operations/save-data.js +50 -0
  347. package/dist/tools/pagination.d.ts +32 -0
  348. package/dist/tools/pagination.js +116 -0
  349. package/dist/tools/scheduling/create-chore.d.ts +2 -0
  350. package/dist/tools/scheduling/create-chore.js +93 -0
  351. package/dist/tools/scheduling/delete-chore.d.ts +2 -0
  352. package/dist/tools/scheduling/delete-chore.js +22 -0
  353. package/dist/tools/scheduling/execute-chore.d.ts +2 -0
  354. package/dist/tools/scheduling/execute-chore.js +52 -0
  355. package/dist/tools/scheduling/toggle-chore.d.ts +2 -0
  356. package/dist/tools/scheduling/toggle-chore.js +22 -0
  357. package/dist/tools/scheduling/update-chore.d.ts +2 -0
  358. package/dist/tools/scheduling/update-chore.js +71 -0
  359. package/dist/tools/schemas/common.d.ts +10 -0
  360. package/dist/tools/schemas/common.js +23 -0
  361. package/dist/tools/schemas/items-analysis.d.ts +394 -0
  362. package/dist/tools/schemas/items-analysis.js +419 -0
  363. package/dist/tools/schemas/items-cells.d.ts +70 -0
  364. package/dist/tools/schemas/items-cells.js +65 -0
  365. package/dist/tools/schemas/items-common.d.ts +18 -0
  366. package/dist/tools/schemas/items-common.js +39 -0
  367. package/dist/tools/schemas/items-fileops.d.ts +11 -0
  368. package/dist/tools/schemas/items-fileops.js +13 -0
  369. package/dist/tools/schemas/items-metadata.d.ts +262 -0
  370. package/dist/tools/schemas/items-metadata.js +184 -0
  371. package/dist/tools/schemas/items-monitoring.d.ts +79 -0
  372. package/dist/tools/schemas/items-monitoring.js +78 -0
  373. package/dist/tools/schemas/items-processes.d.ts +279 -0
  374. package/dist/tools/schemas/items-processes.js +235 -0
  375. package/dist/tools/schemas/items-scheduling.d.ts +25 -0
  376. package/dist/tools/schemas/items-scheduling.js +26 -0
  377. package/dist/tools/schemas/items-security.d.ts +19 -0
  378. package/dist/tools/schemas/items-security.js +12 -0
  379. package/dist/tools/schemas/items-subsets.d.ts +2 -0
  380. package/dist/tools/schemas/items-subsets.js +4 -0
  381. package/dist/tools/schemas/items-views.d.ts +38 -0
  382. package/dist/tools/schemas/items-views.js +26 -0
  383. package/dist/tools/schemas/items.d.ts +12 -0
  384. package/dist/tools/schemas/items.js +23 -0
  385. package/dist/tools/schemas/markdown-capable.d.ts +21 -0
  386. package/dist/tools/schemas/markdown-capable.js +58 -0
  387. package/dist/tools/schemas/output-schema.d.ts +24 -0
  388. package/dist/tools/schemas/output-schema.js +25 -0
  389. package/dist/tools/security/assign-client-group.d.ts +2 -0
  390. package/dist/tools/security/assign-client-group.js +20 -0
  391. package/dist/tools/security/create-client.d.ts +2 -0
  392. package/dist/tools/security/create-client.js +28 -0
  393. package/dist/tools/security/delete-client.d.ts +2 -0
  394. package/dist/tools/security/delete-client.js +22 -0
  395. package/dist/tools/security/get-client.d.ts +2 -0
  396. package/dist/tools/security/get-client.js +20 -0
  397. package/dist/tools/security/list-clients.d.ts +2 -0
  398. package/dist/tools/security/list-clients.js +86 -0
  399. package/dist/tools/security/list-groups.d.ts +2 -0
  400. package/dist/tools/security/list-groups.js +43 -0
  401. package/dist/tools/security/remove-client-group.d.ts +2 -0
  402. package/dist/tools/security/remove-client-group.js +27 -0
  403. package/dist/tools/security/update-client.d.ts +2 -0
  404. package/dist/tools/security/update-client.js +22 -0
  405. package/dist/tools/subsets/create-subset.d.ts +2 -0
  406. package/dist/tools/subsets/create-subset.js +44 -0
  407. package/dist/tools/subsets/delete-subset.d.ts +2 -0
  408. package/dist/tools/subsets/delete-subset.js +26 -0
  409. package/dist/tools/subsets/get-subset.d.ts +2 -0
  410. package/dist/tools/subsets/get-subset.js +29 -0
  411. package/dist/tools/subsets/list-subsets.d.ts +2 -0
  412. package/dist/tools/subsets/list-subsets.js +36 -0
  413. package/dist/tools/subsets/update-subset.d.ts +2 -0
  414. package/dist/tools/subsets/update-subset.js +33 -0
  415. package/dist/tools/ti-development/check-process-code.d.ts +2 -0
  416. package/dist/tools/ti-development/check-process-code.js +96 -0
  417. package/dist/tools/ti-development/compile-process.d.ts +2 -0
  418. package/dist/tools/ti-development/compile-process.js +32 -0
  419. package/dist/tools/ti-development/copy-process.d.ts +2 -0
  420. package/dist/tools/ti-development/copy-process.js +32 -0
  421. package/dist/tools/ti-development/delete-process.d.ts +2 -0
  422. package/dist/tools/ti-development/delete-process.js +26 -0
  423. package/dist/tools/ti-development/diff-process-with-file.d.ts +2 -0
  424. package/dist/tools/ti-development/diff-process-with-file.js +208 -0
  425. package/dist/tools/ti-development/diff-processes.d.ts +2 -0
  426. package/dist/tools/ti-development/diff-processes.js +312 -0
  427. package/dist/tools/ti-development/execute-process.d.ts +8 -0
  428. package/dist/tools/ti-development/execute-process.js +109 -0
  429. package/dist/tools/ti-development/export-process-to-git.d.ts +2 -0
  430. package/dist/tools/ti-development/export-process-to-git.js +113 -0
  431. package/dist/tools/ti-development/export-process-to-pro.d.ts +2 -0
  432. package/dist/tools/ti-development/export-process-to-pro.js +117 -0
  433. package/dist/tools/ti-development/get-all-processes-code.d.ts +2 -0
  434. package/dist/tools/ti-development/get-all-processes-code.js +131 -0
  435. package/dist/tools/ti-development/get-process-code.d.ts +2 -0
  436. package/dist/tools/ti-development/get-process-code.js +100 -0
  437. package/dist/tools/ti-development/get-process-datasource.d.ts +2 -0
  438. package/dist/tools/ti-development/get-process-datasource.js +20 -0
  439. package/dist/tools/ti-development/get-process-parameters.d.ts +2 -0
  440. package/dist/tools/ti-development/get-process-parameters.js +25 -0
  441. package/dist/tools/ti-development/get-process-variables.d.ts +2 -0
  442. package/dist/tools/ti-development/get-process-variables.js +38 -0
  443. package/dist/tools/ti-development/get-process.d.ts +2 -0
  444. package/dist/tools/ti-development/get-process.js +163 -0
  445. package/dist/tools/ti-development/import-pro-file.d.ts +2 -0
  446. package/dist/tools/ti-development/import-pro-file.js +153 -0
  447. package/dist/tools/ti-development/import-process-from-git.d.ts +2 -0
  448. package/dist/tools/ti-development/import-process-from-git.js +198 -0
  449. package/dist/tools/ti-development/install-pro-bundle.d.ts +2 -0
  450. package/dist/tools/ti-development/install-pro-bundle.js +288 -0
  451. package/dist/tools/ti-development/preflight.d.ts +39 -0
  452. package/dist/tools/ti-development/preflight.js +56 -0
  453. package/dist/tools/ti-development/process-backup.d.ts +29 -0
  454. package/dist/tools/ti-development/process-backup.js +118 -0
  455. package/dist/tools/ti-development/search-code.d.ts +2 -0
  456. package/dist/tools/ti-development/search-code.js +208 -0
  457. package/dist/tools/ti-development/upsert-process.d.ts +2 -0
  458. package/dist/tools/ti-development/upsert-process.js +167 -0
  459. package/dist/tools/ti-development/validate-process-refs.d.ts +2 -0
  460. package/dist/tools/ti-development/validate-process-refs.js +73 -0
  461. package/dist/tools/views/create-mdx-view.d.ts +2 -0
  462. package/dist/tools/views/create-mdx-view.js +21 -0
  463. package/dist/tools/views/create-native-view.d.ts +2 -0
  464. package/dist/tools/views/create-native-view.js +81 -0
  465. package/dist/tools/views/delete-view.d.ts +2 -0
  466. package/dist/tools/views/delete-view.js +23 -0
  467. package/dist/tools/views/list-views.d.ts +2 -0
  468. package/dist/tools/views/list-views.js +32 -0
  469. package/dist/tools/with-annotations.d.ts +6 -0
  470. package/dist/tools/with-annotations.js +339 -0
  471. package/dist/types.d.ts +409 -0
  472. package/dist/types.js +91 -0
  473. package/dist/version.d.ts +4 -0
  474. package/dist/version.js +18 -0
  475. package/package.json +107 -0
@@ -0,0 +1,419 @@
1
+ // Analysis-domain schemas: callgraph, chore-graph, object-usage, data-flow,
2
+ // feeder/calc tracing, code/rule search, audits, v12-readiness and the
3
+ // callgraph-cache invalidation result.
4
+ import { z } from "zod";
5
+ export { FedCellDescriptorSchema } from "../../schemas/cells.js";
6
+ import { FedCellDescriptorSchema } from "../../schemas/cells.js";
7
+ import { CellValueSchema } from "./items-common.js";
8
+ // Bespoke shapes for mutations whose payload is rich enough to type explicitly.
9
+ export const InvalidateCallgraphCacheResultSchema = z.object({
10
+ cleared: z.number().int(),
11
+ entriesBefore: z.array(z.object({
12
+ key: z.string(),
13
+ ageMs: z.number(),
14
+ ttlRemainingMs: z.number(),
15
+ buildMs: z.number(),
16
+ })),
17
+ });
18
+ // ── Phase 2e: analysis tools ─────────────────────────────────────────────────
19
+ // analyze_callgraph emits one of:
20
+ // - warning shape {warning, indexedProcessCount}
21
+ // - tree shape {start, direction, mode, tree}
22
+ // - summary shape {start, direction, mode, summary}
23
+ // - global rank {mode:'globalRanking', rankBy, ranking[], ...} (start omitted)
24
+ // Modeled as one passthrough schema with all fields optional except none.
25
+ // ── Feeder / calculation tracing (v11 cell diagnostics) ─────────────────────
26
+ export const CheckFeedersResultSchema = z.object({
27
+ count: z.number().int(),
28
+ unfedCount: z.number().int(),
29
+ fedCells: z.array(FedCellDescriptorSchema),
30
+ });
31
+ export const TraceFeedersResultSchema = z.object({
32
+ count: z.number().int(),
33
+ fedCells: z.array(FedCellDescriptorSchema),
34
+ statements: z.array(z.string()),
35
+ });
36
+ // Recursive component tree — children typed as unknown to avoid recursive
37
+ // JSON-schema emission (kept permissive; unlike CallgraphResultSchema this
38
+ // one is not yet fully typed).
39
+ export const CalculationTraceResultSchema = z
40
+ .object({
41
+ type: z.string().optional(),
42
+ status: z.string().optional(),
43
+ value: CellValueSchema,
44
+ cube: z.string().optional(),
45
+ tuple: z.array(z.string()).optional(),
46
+ statements: z.array(z.string()).optional(),
47
+ components: z.array(z.unknown()).optional(),
48
+ truncated: z.boolean().optional(),
49
+ })
50
+ .passthrough();
51
+ // ─── Callgraph output schema (typed, recursive) ──────────────────────────────
52
+ // Faithfully mirrors what src/tools/analysis/analyze-callgraph.ts emits so the
53
+ // output-schema drift-guard (with-annotations.ts) actually validates the tree
54
+ // instead of being blind (`z.unknown()` + `.passthrough()`). One response is
55
+ // exactly one of 5 shapes: warning | full tree | compact tree | summary |
56
+ // globalRanking. Fields the serializers emit as `undefined` are dropped by the
57
+ // JSON round-trip the guard performs, so they are modelled `.optional()`.
58
+ // Wire-size note (this is by far the largest published outputSchema): the SDK
59
+ // serializes outputSchemas with Zod 4's `toJSONSchema` (draft-7), which INLINES
60
+ // a reused sub-schema at every use site — except when the sub-schema carries a
61
+ // registry id via `.meta({ id })`, in which case it is emitted once under
62
+ // `definitions` and referenced by `$ref`. `$ref`/`definitions` already ship in
63
+ // this schema regardless (the recursive `children` cycle is emitted as
64
+ // `#/definitions/__schema0`), so named ids add no new client requirement.
65
+ // Ids only pay off for sub-schemas used MORE THAN ONCE — a single-use id makes
66
+ // the payload bigger (def + ref > inline). Validation is untouched: `.meta()`
67
+ // only annotates, it never changes parsing.
68
+ // Zod 4 emits `z.number().int()` as {type:integer, minimum:-2^53+1, maximum:2^53-1}.
69
+ // Those sentinel bounds no longer reach the wire — `slimJsonSchema()` strips them
70
+ // at tools/list time — so an inlined int costs 18 bytes, LESS than the 28-byte
71
+ // `$ref` a shared id would cost. Hence no id here (measured on the shipped,
72
+ // slimmed payload: id-off 4770 vs id-on 5043 bytes). Re-add the id only if that
73
+ // slimmer is ever removed. The EffectiveValue id below pays off either way.
74
+ const IntSchema = z.number().int();
75
+ // EffectiveValue: {kind:'literal';value}|{kind:'unknown';viaParam}|{kind:'dynamic'}
76
+ // Used twice (edge.effectiveParams[].effective and node.env values) → id it.
77
+ const EffectiveValueSchema = z
78
+ .discriminatedUnion("kind", [
79
+ z.object({ kind: z.literal("literal"), value: z.string() }),
80
+ z.object({ kind: z.literal("unknown"), viaParam: z.string() }),
81
+ z.object({ kind: z.literal("dynamic") }),
82
+ ])
83
+ .meta({ id: "EffectiveValue" });
84
+ // CallParamResolution: {kind:'literal';value}|{kind:'passthrough';paramName}|{kind:'dynamic'}
85
+ const CallParamResolutionSchema = z.discriminatedUnion("kind", [
86
+ z.object({ kind: z.literal("literal"), value: z.string() }),
87
+ z.object({ kind: z.literal("passthrough"), paramName: z.string() }),
88
+ z.object({ kind: z.literal("dynamic") }),
89
+ ]);
90
+ // CallParam = {name, resolution, valueRaw}
91
+ const CallParamSchema = z.object({
92
+ name: z.string(),
93
+ resolution: CallParamResolutionSchema,
94
+ valueRaw: z.string(),
95
+ });
96
+ // effectiveParams entry = {name, effective, valueRaw}
97
+ const EffectiveParamSchema = z.object({
98
+ name: z.string(),
99
+ effective: EffectiveValueSchema,
100
+ valueRaw: z.string(),
101
+ });
102
+ // incomingEdge object (serializeNode) — null on the root node.
103
+ const CallgraphEdgeSchema = z.object({
104
+ caller: z.string(),
105
+ callee: z.string(),
106
+ section: z.string(),
107
+ line: IntSchema,
108
+ funcName: z.string(),
109
+ snippet: z.string(),
110
+ params: z.array(CallParamSchema),
111
+ effectiveParams: z.array(EffectiveParamSchema).optional(),
112
+ });
113
+ // unresolvedCalls entry — full mode carries `snippet`, compact mode does not.
114
+ // Kept as two shapes on purpose: merging them behind one `snippet?` schema
115
+ // would save ~180 bytes but stop the guard noticing if full mode ever dropped
116
+ // `snippet`, which is exactly the drift this schema exists to catch.
117
+ const UnresolvedFullSchema = z.object({
118
+ section: z.string(),
119
+ line: IntSchema,
120
+ funcName: z.string(),
121
+ expr: z.string(),
122
+ snippet: z.string(),
123
+ reason: z.string(),
124
+ });
125
+ const UnresolvedCompactSchema = z.object({
126
+ section: z.string(),
127
+ line: IntSchema,
128
+ funcName: z.string(),
129
+ expr: z.string(),
130
+ reason: z.string(),
131
+ });
132
+ // Full-mode node (serializeNode). Recursive via z.lazy on `children`.
133
+ const FullNodeBase = z.object({
134
+ process: z.string(),
135
+ cycle: z.boolean(),
136
+ depthLimitReached: z.boolean().optional(),
137
+ incomingEdge: CallgraphEdgeSchema.nullable(),
138
+ env: z.record(z.string(), EffectiveValueSchema).optional(),
139
+ unresolvedCalls: z.array(UnresolvedFullSchema).optional(),
140
+ });
141
+ // `.strict()` is load-bearing, not cosmetic: `tree` below is a union of this and
142
+ // CompactNodeSchema, and a non-strict Zod object STRIPS unknown keys instead of
143
+ // rejecting them. Without it a full-mode node carrying a corrupt `incomingEdge`
144
+ // or `env` simply matched the compact variant with those keys thrown away, so
145
+ // the drift guard this schema exists for never fired. Safe because serializeNode
146
+ // / serializeCompact build fixed object literals (analyze-callgraph.ts) and
147
+ // undefined-valued keys are dropped before structuredContent is parsed.
148
+ const FullNodeSchema = FullNodeBase.extend({
149
+ children: z.lazy(() => z.array(FullNodeSchema)),
150
+ }).strict();
151
+ // Compact-mode node (serializeCompact). Recursive via z.lazy on `children`.
152
+ const CompactNodeBase = z.object({
153
+ process: z.string(),
154
+ cycle: z.boolean().optional(),
155
+ depthLimitReached: z.boolean().optional(),
156
+ unresolvedCalls: z.array(UnresolvedCompactSchema).optional(),
157
+ });
158
+ // Strict for the same reason as FullNodeSchema above — this is the variant that
159
+ // used to swallow every stray key in the union.
160
+ const CompactNodeSchema = CompactNodeBase.extend({
161
+ children: z.lazy(() => z.array(CompactNodeSchema)),
162
+ }).strict();
163
+ // summarize() result.
164
+ const SummaryEntrySchema = z.object({
165
+ process: z.string(),
166
+ depthMin: IntSchema,
167
+ depthMax: IntSchema,
168
+ occurrences: IntSchema,
169
+ cycle: z.boolean(),
170
+ depthLimitReached: z.boolean(),
171
+ unresolvedCount: IntSchema,
172
+ });
173
+ const CallgraphSummarySchema = z.object({
174
+ root: z.string(),
175
+ totalNodes: IntSchema,
176
+ uniqueProcesses: IntSchema,
177
+ maxDepth: IntSchema,
178
+ cyclesDetected: IntSchema,
179
+ depthLimitsHit: IntSchema,
180
+ processes: z.array(SummaryEntrySchema),
181
+ });
182
+ // globalRanking() RankEntry.
183
+ const RankEntrySchema = z.object({
184
+ process: z.string(),
185
+ outgoingCalls: IntSchema,
186
+ outgoingDistinct: IntSchema,
187
+ incomingCalls: IntSchema,
188
+ incomingDistinct: IntSchema,
189
+ });
190
+ // One permissive top-level object whose optional fields are now precisely
191
+ // typed — every real payload validates, and the typed fields are enforced.
192
+ // `tree` accepts both full and compact nodes (full is tried first; a compact
193
+ // node fails FullNode because `cycle`/`incomingEdge` are required there).
194
+ // No `.passthrough()` — that is what made the guard structurally blind.
195
+ export const CallgraphResultSchema = z.object({
196
+ // shape 1: warning (process not found)
197
+ warning: z.string().optional(),
198
+ indexedProcessCount: IntSchema.optional(),
199
+ // shared across the traversal shapes
200
+ start: z.string().optional(),
201
+ direction: z.string().optional(),
202
+ mode: z.string().optional(),
203
+ maskSecrets: z.boolean().optional(),
204
+ // shape 4: summary
205
+ summary: CallgraphSummarySchema.optional(),
206
+ // shapes 2 & 3: full / compact tree
207
+ tree: z.union([FullNodeSchema, CompactNodeSchema]).optional(),
208
+ // shape 5: global-ranking (start omitted)
209
+ rankBy: z.string().optional(),
210
+ totalProcessesIndexed: IntSchema.optional(),
211
+ processesWithEdges: IntSchema.optional(),
212
+ totalCallEdges: IntSchema.optional(),
213
+ truncated: z.boolean().optional(),
214
+ ranking: z.array(RankEntrySchema).optional(),
215
+ });
216
+ export const ChoreGraphResultSchema = z.object({
217
+ choreName: z.string(),
218
+ maskSecrets: z.boolean().optional(),
219
+ tasks: z.array(z
220
+ .object({
221
+ step: z.number().int(),
222
+ processName: z.string(),
223
+ choreParams: z.unknown(),
224
+ tree: z.unknown(),
225
+ })
226
+ .passthrough()),
227
+ // Not-found branch: tasks is empty and these two explain why.
228
+ warning: z.string().optional(),
229
+ indexedChoreCount: z.number().int().optional(),
230
+ });
231
+ // `usages` is present in full mode; `sources`/`sourceCount`/`mode` are present
232
+ // in mode='summary'. Both shapes validate against this one schema.
233
+ export const ObjectUsageResultSchema = z.object({
234
+ kind: z.string(),
235
+ name: z.string(),
236
+ accessMode: z.string(),
237
+ count: z.number().int(),
238
+ returned: z.number().int(),
239
+ truncated: z.boolean(),
240
+ usages: z.array(z.unknown()).optional(),
241
+ mode: z.string().optional(),
242
+ sourceCount: z.number().int().optional(),
243
+ sources: z.array(z.unknown()).optional(),
244
+ });
245
+ // ── tm1_trace_data_flow result schema ────────────────────────────────────────
246
+ export const DataFlowResultSchema = z.object({
247
+ cube: z.string(),
248
+ direction: z.enum(["upstream", "downstream", "both"]),
249
+ upstream: z
250
+ .array(z.object({
251
+ process: z.string(),
252
+ sourceCubes: z.array(z.string()),
253
+ datasourceType: z.string(),
254
+ externalSource: z.string().optional(),
255
+ elements: z.array(z.string()).optional(),
256
+ }))
257
+ .optional(),
258
+ downstream: z
259
+ .array(z.object({
260
+ process: z.string(),
261
+ targetCubes: z.array(z.string()),
262
+ readsVia: z.enum(["code", "datasource", "both"]),
263
+ elements: z.array(z.string()).optional(),
264
+ }))
265
+ .optional(),
266
+ counts: z.object({
267
+ upstream: z.number().int().optional(),
268
+ downstream: z.number().int().optional(),
269
+ }),
270
+ element: z
271
+ .object({
272
+ dimension: z.string(),
273
+ name: z.string(),
274
+ processes: z.array(z.object({
275
+ process: z.string(),
276
+ funcNames: z.array(z.string()),
277
+ access: z.array(z.enum(["source", "write", "zero-out", "indeterminate"])),
278
+ via: z.array(z.string()).optional(),
279
+ })),
280
+ unresolvedInProcesses: z.array(z.string()).optional(),
281
+ suppressedIndeterminate: z.number().int().optional(),
282
+ computedInProcesses: z.array(z.string()).optional(),
283
+ resolution: z.string(),
284
+ })
285
+ .optional(),
286
+ // True when `limit` clipped the upstream/downstream arrays. `counts` keeps
287
+ // the unclipped totals, so the caller can always see how much was left out.
288
+ truncated: z.boolean().optional(),
289
+ hint: z.string().optional(),
290
+ });
291
+ export const SearchCodeMatchSchema = z.object({
292
+ process: z.string(),
293
+ tab: z.string(),
294
+ line: z.number().int(),
295
+ text: z.string(),
296
+ // Present only when deduplicateByLine=true and ≥1 other process shared this
297
+ // (tab, line-text): the first-seen process is kept, the rest land here.
298
+ alsoFoundIn: z.array(z.string()).optional(),
299
+ });
300
+ // groupBy mode item: one row per process/tab with its match count.
301
+ export const SearchCodeGroupSchema = z.object({
302
+ process: z.string().optional(),
303
+ tab: z.string().optional(),
304
+ matchCount: z.number().int(),
305
+ });
306
+ // Wrapper around the paginated `items` array — keeps summary fields the agent
307
+ // uses to interpret the search (pattern echo, totals, truncation flag).
308
+ // Fields that only apply in the default (non-grouped) mode are optional so the
309
+ // groupBy='process'|'tab' aggregation shape validates against the same schema.
310
+ export const SearchCodeResultSchema = z.object({
311
+ pattern: z.string(),
312
+ caseSensitive: z.boolean(),
313
+ tabsSearched: z.array(z.string()),
314
+ processesScanned: z.number().int(),
315
+ matchCount: z.number().int(),
316
+ truncated: z.boolean().optional(),
317
+ maskSecrets: z.boolean().optional(),
318
+ excludeCommented: z.boolean().optional(),
319
+ // Present only in groupBy mode.
320
+ groupBy: z.enum(["process", "tab"]).optional(),
321
+ groupCount: z.number().int().optional(),
322
+ total: z.number().int(),
323
+ count: z.number().int(),
324
+ offset: z.number().int(),
325
+ has_more: z.boolean(),
326
+ next_offset: z.number().int().nullable(),
327
+ items: z.array(z.union([SearchCodeMatchSchema, SearchCodeGroupSchema])),
328
+ // Present only when deduplicateByLine=true: rawMatchCount is the pre-collapse
329
+ // total, deduplicated flags that the collapse ran.
330
+ rawMatchCount: z.number().int().optional(),
331
+ deduplicated: z.boolean().optional(),
332
+ });
333
+ // ── Audit / analysis + diff tool results ─────────────────────────────────────
334
+ // Passthrough: these payloads are deep and evolve (nested summary objects,
335
+ // conditional findings vs findingsByGroup). We pin the stable discriminator
336
+ // fields and let the rest through so structuredContent is emitted without the
337
+ // strict additionalProperties:false footgun rejecting valid responses.
338
+ export const AuditComplexityResultSchema = z
339
+ .object({
340
+ status: z.string(),
341
+ productVersion: z.string().optional(),
342
+ scope: z.unknown().optional(),
343
+ scanned: z.unknown().optional(),
344
+ summary: z.unknown().optional(),
345
+ })
346
+ .passthrough();
347
+ export const AuditFeedersResultSchema = z
348
+ .object({
349
+ status: z.string(),
350
+ productVersion: z.string().optional(),
351
+ mode: z.string().optional(),
352
+ scanned: z.unknown().optional(),
353
+ // Runtime half could not run at all: `absent` = this server has no
354
+ // }Stats* control cubes (TM1 v12), `denied` = this account may not read
355
+ // them. Static findings are still returned in mode 'both'.
356
+ runtimeUnavailable: z
357
+ .object({
358
+ reason: z.enum(["absent", "denied"]),
359
+ message: z.string(),
360
+ cubes: z.number().int(),
361
+ })
362
+ .optional(),
363
+ })
364
+ .passthrough();
365
+ export const AuditNamingResultSchema = z
366
+ .object({
367
+ status: z.string(),
368
+ productVersion: z.string().optional(),
369
+ scope: z.unknown().optional(),
370
+ scanned: z.unknown().optional(),
371
+ summary: z.unknown().optional(),
372
+ })
373
+ .passthrough();
374
+ export const SearchRulesResultSchema = z
375
+ .object({
376
+ pattern: z.string(),
377
+ caseSensitive: z.boolean(),
378
+ cubesScanned: z.number().int(),
379
+ matchCount: z.number().int(),
380
+ truncated: z.boolean(),
381
+ includeFeeders: z.boolean(),
382
+ total: z.number().int(),
383
+ count: z.number().int(),
384
+ offset: z.number().int(),
385
+ has_more: z.boolean(),
386
+ next_offset: z.number().int().nullable(),
387
+ items: z.array(z
388
+ .object({ cube: z.string(), line: z.number().int(), text: z.string() })
389
+ .passthrough()),
390
+ })
391
+ .passthrough();
392
+ export const V12FindingSchema = z.object({
393
+ severity: z.enum(["error", "warning"]),
394
+ category: z.enum(["deprecated_ti_function"]),
395
+ objectKind: z.enum(["process", "cube"]),
396
+ objectName: z.string(),
397
+ section: z.enum(["prolog", "metadata", "data", "epilog", "rules"]),
398
+ line: z.number().int(),
399
+ function: z.string(),
400
+ snippet: z.string(),
401
+ issue: z.string(),
402
+ suggestion: z.string(),
403
+ });
404
+ export const V12ReadinessResultSchema = z.object({
405
+ scope: z.enum(["processes", "rules", "all"]),
406
+ includeControl: z.boolean(),
407
+ scannedProcesses: z.number().int(),
408
+ scannedCubes: z.number().int(),
409
+ findingsCount: z.number().int(),
410
+ readinessScore: z.enum(["ready", "needs-work", "blocked"]),
411
+ summary: z.object({
412
+ byCategory: z.record(z.string(), z.number().int()),
413
+ bySeverity: z.record(z.string(), z.number().int()),
414
+ topFunctions: z.array(z.object({ function: z.string(), count: z.number().int() })),
415
+ }),
416
+ findings: z.array(V12FindingSchema),
417
+ rulesetSource: z.string(),
418
+ });
419
+ //# sourceMappingURL=items-analysis.js.map
@@ -0,0 +1,70 @@
1
+ import { z } from "zod";
2
+ export { MdxAxisSchema } from "../../schemas/cells.js";
3
+ export declare const ViewResultSchema: z.ZodObject<{
4
+ cubeName: z.ZodString;
5
+ viewName: z.ZodString;
6
+ axes: z.ZodArray<z.ZodObject<{
7
+ tuples: z.ZodArray<z.ZodObject<{
8
+ members: z.ZodArray<z.ZodObject<{
9
+ name: z.ZodString;
10
+ hierarchyName: z.ZodString;
11
+ }, z.core.$strip>>;
12
+ }, z.core.$strip>>;
13
+ }, z.core.$strip>>;
14
+ total: z.ZodNullable<z.ZodNumber>;
15
+ count: z.ZodNumber;
16
+ offset: z.ZodNumber;
17
+ has_more: z.ZodBoolean;
18
+ next_offset: z.ZodNullable<z.ZodNumber>;
19
+ axes_clipped: z.ZodOptional<z.ZodBoolean>;
20
+ items: z.ZodArray<z.ZodObject<{
21
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
22
+ formattedValue: z.ZodString;
23
+ }, z.core.$strip>>;
24
+ }, z.core.$strip>;
25
+ export declare const SampleCellsResultSchema: z.ZodObject<{
26
+ cubeName: z.ZodString;
27
+ count: z.ZodNumber;
28
+ truncated: z.ZodBoolean;
29
+ cells: z.ZodArray<z.ZodObject<{
30
+ coordinates: z.ZodRecord<z.ZodString, z.ZodString>;
31
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
32
+ formattedValue: z.ZodString;
33
+ }, z.core.$strip>>;
34
+ filtersApplied: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
35
+ axisDimension: z.ZodString;
36
+ rowDims: z.ZodArray<z.ZodString>;
37
+ whereDims: z.ZodArray<z.ZodString>;
38
+ mdxUsed: z.ZodString;
39
+ elapsedMs: z.ZodNumber;
40
+ hint: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$strip>;
42
+ export declare const WritableCoordsResultSchema: z.ZodObject<{
43
+ cube: z.ZodString;
44
+ writable: z.ZodBoolean;
45
+ allElementsExist: z.ZodBoolean;
46
+ allElementsNLevel: z.ZodBoolean;
47
+ coords: z.ZodArray<z.ZodUnknown>;
48
+ ruleOverlapWarn: z.ZodOptional<z.ZodUnknown>;
49
+ }, z.core.$loose>;
50
+ export declare const MdxResultSchema: z.ZodObject<{
51
+ axes: z.ZodArray<z.ZodObject<{
52
+ tuples: z.ZodArray<z.ZodObject<{
53
+ members: z.ZodArray<z.ZodObject<{
54
+ name: z.ZodString;
55
+ hierarchyName: z.ZodString;
56
+ }, z.core.$strip>>;
57
+ }, z.core.$strip>>;
58
+ }, z.core.$strip>>;
59
+ total: z.ZodNullable<z.ZodNumber>;
60
+ count: z.ZodNumber;
61
+ offset: z.ZodNumber;
62
+ has_more: z.ZodBoolean;
63
+ next_offset: z.ZodNullable<z.ZodNumber>;
64
+ axes_clipped: z.ZodOptional<z.ZodBoolean>;
65
+ items: z.ZodArray<z.ZodObject<{
66
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
67
+ formattedValue: z.ZodString;
68
+ }, z.core.$strip>>;
69
+ }, z.core.$strip>;
70
+ //# sourceMappingURL=items-cells.d.ts.map
@@ -0,0 +1,65 @@
1
+ // Cell-data schemas: MDX axes, execute_mdx / get_view page envelopes,
2
+ // sample_cells and check_writable_coords results.
3
+ import { z } from "zod";
4
+ import { CellValueSchema } from "./items-common.js";
5
+ export { MdxAxisSchema } from "../../schemas/cells.js";
6
+ import { MdxAxisSchema } from "../../schemas/cells.js";
7
+ // tm1_get_view returns the same page-envelope shape as tm1_execute_mdx
8
+ // (axes + paginated cell `items`), plus the cube/view it executed. Cells
9
+ // paginate server-side so wide/tall views can't dump their whole cellset.
10
+ export const ViewResultSchema = z.object({
11
+ cubeName: z.string(),
12
+ viewName: z.string(),
13
+ axes: z.array(MdxAxisSchema),
14
+ total: z.number().int().nullable(),
15
+ count: z.number().int(),
16
+ offset: z.number().int(),
17
+ has_more: z.boolean(),
18
+ next_offset: z.number().int().nullable(),
19
+ // Set only when axes were clipped to the returned cell page (see MdxResultSchema).
20
+ axes_clipped: z.boolean().optional(),
21
+ items: z.array(z.object({ value: CellValueSchema, formattedValue: z.string() })),
22
+ });
23
+ export const SampleCellsResultSchema = z.object({
24
+ cubeName: z.string(),
25
+ count: z.number().int(),
26
+ truncated: z.boolean(),
27
+ cells: z.array(z.object({
28
+ coordinates: z.record(z.string(), z.string()),
29
+ value: CellValueSchema,
30
+ formattedValue: z.string(),
31
+ })),
32
+ filtersApplied: z.record(z.string(), z.union([z.string(), z.array(z.string())])),
33
+ axisDimension: z.string(),
34
+ rowDims: z.array(z.string()),
35
+ whereDims: z.array(z.string()),
36
+ mdxUsed: z.string(),
37
+ elapsedMs: z.number().int(),
38
+ hint: z.string().optional(),
39
+ });
40
+ // Composite results emitted by validation/check tools.
41
+ export const WritableCoordsResultSchema = z
42
+ .object({
43
+ cube: z.string(),
44
+ writable: z.boolean(),
45
+ allElementsExist: z.boolean(),
46
+ allElementsNLevel: z.boolean(),
47
+ coords: z.array(z.unknown()),
48
+ ruleOverlapWarn: z.unknown().optional(),
49
+ })
50
+ .passthrough();
51
+ // Page-envelope shape consistent with list_* tools (Page<T>).
52
+ // `total` derives from axes (product of tuple counts) — null only when
53
+ // axes are absent and we cannot infer cell count cheaply.
54
+ export const MdxResultSchema = z.object({
55
+ axes: z.array(MdxAxisSchema),
56
+ total: z.number().int().nullable(),
57
+ count: z.number().int(),
58
+ offset: z.number().int(),
59
+ has_more: z.boolean(),
60
+ next_offset: z.number().int().nullable(),
61
+ // True only when `axes` were clipped to this page's cells; `total` stays full.
62
+ axes_clipped: z.boolean().optional(),
63
+ items: z.array(z.object({ value: CellValueSchema, formattedValue: z.string() })),
64
+ });
65
+ //# sourceMappingURL=items-cells.js.map
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
2
+ export { CellValueSchema, ELEMENT_TYPE, PARAM_TYPE, } from "../../schemas/common.js";
3
+ export declare const PROCESS_OUTCOME: z.ZodEnum<{
4
+ succeeded: "succeeded";
5
+ completed_with_errors: "completed_with_errors";
6
+ rolled_back: "rolled_back";
7
+ indeterminate: "indeterminate";
8
+ }>;
9
+ export declare const CHORE_OUTCOME: z.ZodEnum<{
10
+ succeeded: "succeeded";
11
+ completed_with_errors: "completed_with_errors";
12
+ rolled_back: "rolled_back";
13
+ indeterminate: "indeterminate";
14
+ }>;
15
+ export declare const MutationResultSchema: z.ZodObject<{
16
+ success: z.ZodBoolean;
17
+ }, z.core.$loose>;
18
+ //# sourceMappingURL=items-common.d.ts.map
@@ -0,0 +1,39 @@
1
+ // Shared primitives referenced across the per-category item schemas.
2
+ // Split out of items.ts so every category file can import the same
3
+ // enums/unions and the uniform mutation envelope without a cycle.
4
+ import { z } from "zod";
5
+ // Canonical domain primitives — defined once in src/schemas/ and re-exported
6
+ // here so the per-category item schemas keep their existing import path.
7
+ export { CellValueSchema, ELEMENT_TYPE, PARAM_TYPE, } from "../../schemas/common.js";
8
+ // Outcome axis of a TI run — mirrors `ProcessOutcome` in src/types.ts, where
9
+ // the measured status-code mapping is documented. All three non-success values
10
+ // travel alongside `success: false` (fail-closed); they differ on the question
11
+ // the caller actually has, which is whether anything was committed:
12
+ // "completed_with_errors" = the run's changes WERE committed (retrying is
13
+ // unsafe), "rolled_back" = nothing was, "indeterminate" = unknown.
14
+ export const PROCESS_OUTCOME = z.enum([
15
+ "succeeded",
16
+ "completed_with_errors",
17
+ "rolled_back",
18
+ "indeterminate",
19
+ ]);
20
+ // Same four words for a chore, and a DIFFERENT mapping behind them — see
21
+ // tm1-client/services/chore-status.ts for the measured table. Kept as its own
22
+ // enum rather than an alias so nobody can wire a chore status through the
23
+ // process classifier by autocomplete.
24
+ export const CHORE_OUTCOME = z.enum([
25
+ "succeeded",
26
+ "completed_with_errors",
27
+ "rolled_back",
28
+ "indeterminate",
29
+ ]);
30
+ // ── Phase 2h: uniform mutation envelope ──────────────────────────────────────
31
+ // Every create/update/delete/execute tool returns {success: true, ...identifying fields}
32
+ // on success. Passthrough so per-tool extras (cellsWritten, parameterCount,
33
+ // updatedTabs etc.) flow through without bespoke schemas.
34
+ export const MutationResultSchema = z
35
+ .object({
36
+ success: z.boolean(),
37
+ })
38
+ .passthrough();
39
+ //# sourceMappingURL=items-common.js.map
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ export declare const FileContentResultSchema: z.ZodObject<{
3
+ fileName: z.ZodString;
4
+ totalBytes: z.ZodNumber;
5
+ returnedBytes: z.ZodNumber;
6
+ truncated: z.ZodBoolean;
7
+ truncationReason: z.ZodOptional<z.ZodString>;
8
+ content: z.ZodString;
9
+ }, z.core.$strip>;
10
+ export declare const FilenameItemSchema: z.ZodString;
11
+ //# sourceMappingURL=items-fileops.d.ts.map
@@ -0,0 +1,13 @@
1
+ // File-operation schemas: file-content result and bare filename list item.
2
+ import { z } from "zod";
3
+ export const FileContentResultSchema = z.object({
4
+ fileName: z.string(),
5
+ totalBytes: z.number().int(),
6
+ returnedBytes: z.number().int(),
7
+ truncated: z.boolean(),
8
+ truncationReason: z.string().optional(),
9
+ content: z.string(),
10
+ });
11
+ // listFiles returns bare strings (file/folder names).
12
+ export const FilenameItemSchema = z.string();
13
+ //# sourceMappingURL=items-fileops.js.map