@treasuredata/tdx 0.9.8 → 0.10.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 (556) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/activations.js.map +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-command.js.map +1 -1
  11. package/dist/commands/api-command.js +1 -1
  12. package/dist/commands/api-command.js.map +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-command.js.map +1 -1
  15. package/dist/commands/chat-command.js +1 -1
  16. package/dist/commands/chat-command.js.map +1 -1
  17. package/dist/commands/claude-command.js +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js.map +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/claude-usage-command.js.map +1 -1
  22. package/dist/commands/command.d.ts +2 -2
  23. package/dist/commands/command.d.ts.map +1 -1
  24. package/dist/commands/command.js +1 -1
  25. package/dist/commands/command.js.map +1 -1
  26. package/dist/commands/connection-command.js +1 -1
  27. package/dist/commands/connection-command.js.map +1 -1
  28. package/dist/commands/context-command.js +1 -1
  29. package/dist/commands/databases.js +1 -1
  30. package/dist/commands/databases.js.map +1 -1
  31. package/dist/commands/describe.js +1 -1
  32. package/dist/commands/describe.js.map +1 -1
  33. package/dist/commands/engage-command.js +1 -1
  34. package/dist/commands/engage-command.js.map +1 -1
  35. package/dist/commands/job-command.js +1 -1
  36. package/dist/commands/job-command.js.map +1 -1
  37. package/dist/commands/journey-command.d.ts.map +1 -1
  38. package/dist/commands/journey-command.js +1 -1
  39. package/dist/commands/journey-command.js.map +1 -1
  40. package/dist/commands/journey-validate-command.d.ts +18 -0
  41. package/dist/commands/journey-validate-command.d.ts.map +1 -0
  42. package/dist/commands/journey-validate-command.js +1 -0
  43. package/dist/commands/journey-validate-command.js.map +1 -0
  44. package/dist/commands/llm-command.js +1 -1
  45. package/dist/commands/llm-command.js.map +1 -1
  46. package/dist/commands/llm-proxy.js +1 -1
  47. package/dist/commands/parent-segment-command.js +1 -1
  48. package/dist/commands/parent-segment-command.js.map +1 -1
  49. package/dist/commands/profiles-command.js +1 -1
  50. package/dist/commands/profiles-command.js.map +1 -1
  51. package/dist/commands/query-command.js +1 -1
  52. package/dist/commands/query-command.js.map +1 -1
  53. package/dist/commands/segment-command.js +1 -1
  54. package/dist/commands/segment-command.js.map +1 -1
  55. package/dist/commands/segment-create-command.js +1 -1
  56. package/dist/commands/segment-create-command.js.map +1 -1
  57. package/dist/commands/segment-fields-command.js +1 -1
  58. package/dist/commands/segment-fields-command.js.map +1 -1
  59. package/dist/commands/segment-pull-command.d.ts +1 -6
  60. package/dist/commands/segment-pull-command.d.ts.map +1 -1
  61. package/dist/commands/segment-pull-command.js +1 -1
  62. package/dist/commands/segment-pull-command.js.map +1 -1
  63. package/dist/commands/segment-push-command.d.ts +2 -0
  64. package/dist/commands/segment-push-command.d.ts.map +1 -1
  65. package/dist/commands/segment-push-command.js +1 -1
  66. package/dist/commands/segment-push-command.js.map +1 -1
  67. package/dist/commands/segment-update-command.js +1 -1
  68. package/dist/commands/segment-update-command.js.map +1 -1
  69. package/dist/commands/segment-use-command.js +1 -1
  70. package/dist/commands/segment-use-command.js.map +1 -1
  71. package/dist/commands/segment-validate-command.d.ts +18 -0
  72. package/dist/commands/segment-validate-command.d.ts.map +1 -0
  73. package/dist/commands/segment-validate-command.js +1 -0
  74. package/dist/commands/segment-validate-command.js.map +1 -0
  75. package/dist/commands/segments.js +1 -1
  76. package/dist/commands/segments.js.map +1 -1
  77. package/dist/commands/show.js +1 -1
  78. package/dist/commands/show.js.map +1 -1
  79. package/dist/commands/tables.js +1 -1
  80. package/dist/commands/tables.js.map +1 -1
  81. package/dist/commands/use-command.js +1 -1
  82. package/dist/commands/use-command.js.map +1 -1
  83. package/dist/commands/user-command.js +1 -1
  84. package/dist/commands/user-command.js.map +1 -1
  85. package/dist/commands/workflow-command.js +1 -1
  86. package/dist/commands/workflow-command.js.map +1 -1
  87. package/dist/core/auth.d.ts +1 -1
  88. package/dist/core/auth.d.ts.map +1 -1
  89. package/dist/core/auth.js +1 -1
  90. package/dist/{utils → core}/command-output.d.ts +1 -1
  91. package/dist/core/command-output.d.ts.map +1 -0
  92. package/dist/core/command-output.js +1 -0
  93. package/dist/core/command-output.js.map +1 -0
  94. package/dist/core/config.d.ts +1 -1
  95. package/dist/core/config.d.ts.map +1 -1
  96. package/dist/core/config.js +1 -1
  97. package/dist/core/config.js.map +1 -1
  98. package/dist/core/connection-cache.d.ts +1 -1
  99. package/dist/core/connection-cache.d.ts.map +1 -1
  100. package/dist/core/connection-cache.js +1 -1
  101. package/dist/core/constants.d.ts.map +1 -0
  102. package/dist/core/constants.js +1 -0
  103. package/dist/core/constants.js.map +1 -0
  104. package/dist/core/credential-cache.js +1 -1
  105. package/dist/core/global-context.d.ts +2 -2
  106. package/dist/core/global-context.d.ts.map +1 -1
  107. package/dist/core/global-context.js +1 -1
  108. package/dist/core/keychain.js +1 -1
  109. package/dist/core/profile.d.ts +1 -1
  110. package/dist/core/profile.d.ts.map +1 -1
  111. package/dist/core/profile.js +1 -1
  112. package/dist/core/project-config.d.ts +1 -1
  113. package/dist/core/project-config.d.ts.map +1 -1
  114. package/dist/core/project-config.js +1 -1
  115. package/dist/core/session.d.ts +1 -1
  116. package/dist/core/session.d.ts.map +1 -1
  117. package/dist/core/session.js +1 -1
  118. package/dist/core/user-cache.d.ts +1 -1
  119. package/dist/core/user-cache.d.ts.map +1 -1
  120. package/dist/core/user-cache.js +1 -1
  121. package/dist/index.d.ts +6 -6
  122. package/dist/index.d.ts.map +1 -1
  123. package/dist/index.js +1 -1
  124. package/dist/index.js.map +1 -1
  125. package/dist/proxy/anthropic-adapter.d.ts +2 -2
  126. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  127. package/dist/proxy/anthropic-adapter.js +1 -1
  128. package/dist/proxy/claude-usage-tracker.js +1 -1
  129. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  130. package/dist/proxy/context-signature.d.ts +1 -1
  131. package/dist/proxy/context-signature.d.ts.map +1 -1
  132. package/dist/proxy/context-signature.js +1 -1
  133. package/dist/proxy/context-signature.js.map +1 -1
  134. package/dist/proxy/conversation-utils.d.ts +1 -1
  135. package/dist/proxy/conversation-utils.d.ts.map +1 -1
  136. package/dist/proxy/conversation-utils.js +1 -1
  137. package/dist/proxy/server.js +1 -1
  138. package/dist/proxy/server.js.map +1 -1
  139. package/dist/proxy/session-cache.d.ts +1 -1
  140. package/dist/proxy/session-cache.d.ts.map +1 -1
  141. package/dist/proxy/session-cache.js +1 -1
  142. package/dist/sdk/agent/agent-config.d.ts.map +1 -0
  143. package/dist/sdk/agent/agent-config.js +1 -0
  144. package/dist/sdk/agent/agent-config.js.map +1 -0
  145. package/dist/sdk/agent/agent-ref-parser.d.ts.map +1 -0
  146. package/dist/sdk/agent/agent-ref-parser.js +1 -0
  147. package/dist/sdk/agent/agent-ref-parser.js.map +1 -0
  148. package/dist/sdk/agent/agent-yaml.d.ts +71 -176
  149. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  150. package/dist/sdk/agent/agent-yaml.js +1 -1
  151. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  152. package/dist/sdk/agent/types/agent-def.d.ts +182 -0
  153. package/dist/sdk/agent/types/agent-def.d.ts.map +1 -0
  154. package/dist/sdk/agent/types/agent-def.js.map +1 -0
  155. package/dist/sdk/api.d.ts +2 -2
  156. package/dist/sdk/api.d.ts.map +1 -1
  157. package/dist/sdk/api.js +1 -1
  158. package/dist/sdk/api.js.map +1 -1
  159. package/dist/{client → sdk/client}/cdp-api-client.d.ts +24 -9
  160. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -0
  161. package/dist/sdk/client/cdp-api-client.js +1 -0
  162. package/dist/sdk/client/cdp-api-client.js.map +1 -0
  163. package/dist/{types → sdk/client}/endpoints.d.ts +1 -1
  164. package/dist/sdk/client/endpoints.d.ts.map +1 -0
  165. package/dist/sdk/client/endpoints.js +1 -0
  166. package/dist/sdk/client/endpoints.js.map +1 -0
  167. package/dist/{client → sdk/client}/engage-api-client.d.ts +1 -1
  168. package/dist/sdk/client/engage-api-client.d.ts.map +1 -0
  169. package/dist/sdk/client/engage-api-client.js +1 -0
  170. package/dist/sdk/client/engage-api-client.js.map +1 -0
  171. package/dist/{client → sdk/client}/http-client.d.ts +2 -2
  172. package/dist/sdk/client/http-client.d.ts.map +1 -0
  173. package/dist/sdk/client/http-client.js +1 -0
  174. package/dist/sdk/client/http-client.js.map +1 -0
  175. package/dist/{client → sdk/client}/llm-api-client.d.ts +8 -8
  176. package/dist/sdk/client/llm-api-client.d.ts.map +1 -0
  177. package/dist/sdk/client/llm-api-client.js +1 -0
  178. package/dist/sdk/client/llm-api-client.js.map +1 -0
  179. package/dist/sdk/client/rate-limiter.d.ts.map +1 -0
  180. package/dist/sdk/client/rate-limiter.js +1 -0
  181. package/dist/sdk/client/rate-limiter.js.map +1 -0
  182. package/dist/{client → sdk/client}/td-api-client.d.ts +2 -2
  183. package/dist/sdk/client/td-api-client.d.ts.map +1 -0
  184. package/dist/sdk/client/td-api-client.js +1 -0
  185. package/dist/sdk/client/td-api-client.js.map +1 -0
  186. package/dist/{client → sdk/client}/trino-api-client.d.ts +2 -2
  187. package/dist/sdk/client/trino-api-client.d.ts.map +1 -0
  188. package/dist/sdk/client/trino-api-client.js +1 -0
  189. package/dist/sdk/client/trino-api-client.js.map +1 -0
  190. package/dist/{client → sdk/client}/workflow-client.d.ts +2 -2
  191. package/dist/sdk/client/workflow-client.d.ts.map +1 -0
  192. package/dist/sdk/client/workflow-client.js +1 -0
  193. package/dist/sdk/client/workflow-client.js.map +1 -0
  194. package/dist/sdk/connection-validator.d.ts +1 -1
  195. package/dist/sdk/connection-validator.d.ts.map +1 -1
  196. package/dist/sdk/connection-validator.js +1 -1
  197. package/dist/sdk/connection.d.ts +1 -1
  198. package/dist/sdk/connection.d.ts.map +1 -1
  199. package/dist/sdk/connection.js +1 -1
  200. package/dist/sdk/connection.js.map +1 -1
  201. package/dist/sdk/engage.d.ts +1 -1
  202. package/dist/sdk/engage.d.ts.map +1 -1
  203. package/dist/sdk/engage.js +1 -1
  204. package/dist/sdk/engage.js.map +1 -1
  205. package/dist/sdk/errors.js +1 -1
  206. package/dist/sdk/index.d.ts +18 -18
  207. package/dist/sdk/index.d.ts.map +1 -1
  208. package/dist/sdk/index.js +1 -1
  209. package/dist/sdk/index.js.map +1 -1
  210. package/dist/sdk/io/index.d.ts +9 -0
  211. package/dist/sdk/io/index.d.ts.map +1 -0
  212. package/dist/sdk/io/index.js +1 -0
  213. package/dist/sdk/io/index.js.map +1 -0
  214. package/dist/sdk/io/node-filesystem.d.ts +13 -0
  215. package/dist/sdk/io/node-filesystem.d.ts.map +1 -0
  216. package/dist/sdk/io/node-filesystem.js +1 -0
  217. package/dist/sdk/io/node-filesystem.js.map +1 -0
  218. package/dist/sdk/io/types.d.ts +39 -0
  219. package/dist/sdk/io/types.d.ts.map +1 -0
  220. package/dist/sdk/io/types.js.map +1 -0
  221. package/dist/sdk/job.d.ts +1 -1
  222. package/dist/sdk/job.d.ts.map +1 -1
  223. package/dist/sdk/job.js +1 -1
  224. package/dist/sdk/job.js.map +1 -1
  225. package/dist/sdk/journey.d.ts +23 -1
  226. package/dist/sdk/journey.d.ts.map +1 -1
  227. package/dist/sdk/journey.js +1 -1
  228. package/dist/sdk/journey.js.map +1 -1
  229. package/dist/sdk/llm/chat-cache.d.ts.map +1 -0
  230. package/dist/sdk/llm/chat-cache.js +1 -0
  231. package/dist/sdk/llm/chat-cache.js.map +1 -0
  232. package/dist/sdk/{llm.d.ts → llm/index.d.ts} +2 -2
  233. package/dist/sdk/llm/index.d.ts.map +1 -0
  234. package/dist/sdk/llm/index.js +1 -0
  235. package/dist/sdk/llm/index.js.map +1 -0
  236. package/dist/{utils → sdk/llm}/llm-backup-utils.d.ts +2 -2
  237. package/dist/sdk/llm/llm-backup-utils.d.ts.map +1 -0
  238. package/dist/sdk/llm/llm-backup-utils.js +1 -0
  239. package/dist/sdk/llm/llm-backup-utils.js.map +1 -0
  240. package/dist/sdk/llm/model-aliases.d.ts.map +1 -0
  241. package/dist/sdk/llm/model-aliases.js +1 -0
  242. package/dist/sdk/llm/model-aliases.js.map +1 -0
  243. package/dist/sdk/llm/model-factors.d.ts.map +1 -0
  244. package/dist/sdk/llm/model-factors.js +1 -0
  245. package/dist/sdk/llm/model-factors.js.map +1 -0
  246. package/dist/sdk/{query.d.ts → query/index.d.ts} +2 -2
  247. package/dist/sdk/query/index.d.ts.map +1 -0
  248. package/dist/sdk/query/index.js +1 -0
  249. package/dist/sdk/query/index.js.map +1 -0
  250. package/dist/sdk/query/sql-parser.d.ts.map +1 -0
  251. package/dist/sdk/query/sql-parser.js +1 -0
  252. package/dist/sdk/query/sql-parser.js.map +1 -0
  253. package/dist/sdk/segment/child-segment-yaml.d.ts +84 -257
  254. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  255. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  256. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  257. package/dist/{utils → sdk/segment}/fields-display.d.ts +1 -1
  258. package/dist/sdk/segment/fields-display.d.ts.map +1 -0
  259. package/dist/sdk/segment/fields-display.js +1 -0
  260. package/dist/sdk/segment/fields-display.js.map +1 -0
  261. package/dist/sdk/segment/file-discovery.d.ts +39 -0
  262. package/dist/sdk/segment/file-discovery.d.ts.map +1 -0
  263. package/dist/sdk/segment/file-discovery.js +1 -0
  264. package/dist/sdk/segment/file-discovery.js.map +1 -0
  265. package/dist/{utils → sdk/segment}/journey-utils.d.ts +62 -9
  266. package/dist/sdk/segment/journey-utils.d.ts.map +1 -0
  267. package/dist/sdk/segment/journey-utils.js +1 -0
  268. package/dist/sdk/segment/journey-utils.js.map +1 -0
  269. package/dist/sdk/segment/journey-yaml.d.ts +62 -475
  270. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  271. package/dist/sdk/segment/journey-yaml.js +1 -1
  272. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  273. package/dist/sdk/segment/parent-segment-preview.d.ts +14 -14
  274. package/dist/sdk/segment/parent-segment-preview.d.ts.map +1 -1
  275. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  276. package/dist/sdk/segment/parent-segment-preview.js.map +1 -1
  277. package/dist/sdk/segment/parent-segment-yaml.d.ts +16 -158
  278. package/dist/sdk/segment/parent-segment-yaml.d.ts.map +1 -1
  279. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  280. package/dist/sdk/segment/parent-segment-yaml.js.map +1 -1
  281. package/dist/sdk/segment/pull-workflow.d.ts +91 -0
  282. package/dist/sdk/segment/pull-workflow.d.ts.map +1 -0
  283. package/dist/sdk/segment/pull-workflow.js +1 -0
  284. package/dist/sdk/segment/pull-workflow.js.map +1 -0
  285. package/dist/sdk/segment/push-workflow.d.ts +953 -0
  286. package/dist/sdk/segment/push-workflow.d.ts.map +1 -0
  287. package/dist/sdk/segment/push-workflow.js +1 -0
  288. package/dist/sdk/segment/push-workflow.js.map +1 -0
  289. package/dist/sdk/segment/resolution-context.d.ts +43 -0
  290. package/dist/sdk/segment/resolution-context.d.ts.map +1 -0
  291. package/dist/sdk/segment/resolution-context.js +1 -0
  292. package/dist/sdk/segment/resolution-context.js.map +1 -0
  293. package/dist/{utils → sdk/segment}/segment-path-parser.d.ts +2 -1
  294. package/dist/sdk/segment/segment-path-parser.d.ts.map +1 -0
  295. package/dist/sdk/segment/segment-path-parser.js +1 -0
  296. package/dist/sdk/segment/segment-path-parser.js.map +1 -0
  297. package/dist/sdk/segment/segment-ref-parser.d.ts.map +1 -0
  298. package/dist/sdk/segment/segment-ref-parser.js +1 -0
  299. package/dist/sdk/segment/segment-ref-parser.js.map +1 -0
  300. package/dist/sdk/segment/target-resolution.d.ts +162 -0
  301. package/dist/sdk/segment/target-resolution.d.ts.map +1 -0
  302. package/dist/sdk/segment/target-resolution.js +1 -0
  303. package/dist/sdk/segment/target-resolution.js.map +1 -0
  304. package/dist/{utils → sdk/segment}/tdx-config.d.ts +8 -0
  305. package/dist/sdk/segment/tdx-config.d.ts.map +1 -0
  306. package/dist/sdk/segment/tdx-config.js +1 -0
  307. package/dist/sdk/segment/tdx-config.js.map +1 -0
  308. package/dist/sdk/segment/types/journey-def.d.ts +323 -0
  309. package/dist/sdk/segment/types/journey-def.d.ts.map +1 -0
  310. package/dist/sdk/segment/types/journey-def.js.map +1 -0
  311. package/dist/sdk/segment/types/parent-segment-def.d.ts +157 -0
  312. package/dist/sdk/segment/types/parent-segment-def.d.ts.map +1 -0
  313. package/dist/sdk/segment/types/parent-segment-def.js.map +1 -0
  314. package/dist/sdk/segment/types/segment-def.d.ts +284 -0
  315. package/dist/sdk/segment/types/segment-def.d.ts.map +1 -0
  316. package/dist/sdk/segment/types/segment-def.js.map +1 -0
  317. package/dist/sdk/segment/validate-files.d.ts +94 -0
  318. package/dist/sdk/segment/validate-files.d.ts.map +1 -0
  319. package/dist/sdk/segment/validate-files.js +1 -0
  320. package/dist/sdk/segment/validate-files.js.map +1 -0
  321. package/dist/sdk/segment/yaml-validator.d.ts +101 -0
  322. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -0
  323. package/dist/sdk/segment/yaml-validator.js +1 -0
  324. package/dist/sdk/segment/yaml-validator.js.map +1 -0
  325. package/dist/sdk/segment.d.ts +59 -15
  326. package/dist/sdk/segment.d.ts.map +1 -1
  327. package/dist/sdk/segment.js +1 -1
  328. package/dist/sdk/segment.js.map +1 -1
  329. package/dist/sdk/types/anthropic.d.ts.map +1 -0
  330. package/dist/sdk/types/anthropic.js.map +1 -0
  331. package/dist/{types → sdk/types}/cdp.d.ts +2 -2
  332. package/dist/sdk/types/cdp.d.ts.map +1 -0
  333. package/dist/sdk/types/cdp.js.map +1 -0
  334. package/dist/sdk/types/connection.d.ts.map +1 -0
  335. package/dist/sdk/types/connection.js.map +1 -0
  336. package/dist/sdk/types/connector-schema.d.ts.map +1 -0
  337. package/dist/sdk/types/connector-schema.js.map +1 -0
  338. package/dist/sdk/types/database.d.ts.map +1 -0
  339. package/dist/sdk/types/database.js.map +1 -0
  340. package/dist/sdk/types/engage.d.ts.map +1 -0
  341. package/dist/sdk/types/engage.js +1 -0
  342. package/dist/sdk/types/engage.js.map +1 -0
  343. package/dist/{types → sdk/types}/index.d.ts +6 -4
  344. package/dist/sdk/types/index.d.ts.map +1 -0
  345. package/dist/sdk/types/index.js +1 -0
  346. package/dist/sdk/types/index.js.map +1 -0
  347. package/dist/sdk/types/job.d.ts.map +1 -0
  348. package/dist/sdk/types/job.js +1 -0
  349. package/dist/sdk/types/job.js.map +1 -0
  350. package/dist/{types → sdk/types}/llm.d.ts +2 -2
  351. package/dist/sdk/types/llm.d.ts.map +1 -0
  352. package/dist/sdk/types/llm.js +1 -0
  353. package/dist/sdk/types/llm.js.map +1 -0
  354. package/dist/sdk/types/progress.d.ts +42 -0
  355. package/dist/sdk/types/progress.d.ts.map +1 -0
  356. package/dist/sdk/types/progress.js +1 -0
  357. package/dist/sdk/types/progress.js.map +1 -0
  358. package/dist/sdk/types/resolution-context.d.ts +85 -0
  359. package/dist/sdk/types/resolution-context.d.ts.map +1 -0
  360. package/dist/sdk/types/resolution-context.js +1 -0
  361. package/dist/sdk/types/resolution-context.js.map +1 -0
  362. package/dist/sdk/types/trino.d.ts.map +1 -0
  363. package/dist/sdk/types/trino.js +1 -0
  364. package/dist/sdk/types/trino.js.map +1 -0
  365. package/dist/sdk/types/workflow.d.ts.map +1 -0
  366. package/dist/sdk/types/workflow.js +1 -0
  367. package/dist/sdk/types/workflow.js.map +1 -0
  368. package/dist/sdk/user.d.ts +1 -1
  369. package/dist/sdk/user.d.ts.map +1 -1
  370. package/dist/sdk/user.js +1 -1
  371. package/dist/sdk/user.js.map +1 -1
  372. package/dist/sdk/util/format-detector.d.ts.map +1 -0
  373. package/dist/sdk/util/format-detector.js +1 -0
  374. package/dist/sdk/util/format-detector.js.map +1 -0
  375. package/dist/{utils → sdk/util}/formatters.d.ts +1 -1
  376. package/dist/sdk/util/formatters.d.ts.map +1 -0
  377. package/dist/sdk/util/formatters.js +1 -0
  378. package/dist/sdk/util/formatters.js.map +1 -0
  379. package/dist/sdk/util/index.d.ts +9 -0
  380. package/dist/sdk/util/index.d.ts.map +1 -0
  381. package/dist/sdk/util/index.js +1 -0
  382. package/dist/sdk/util/index.js.map +1 -0
  383. package/dist/sdk/util/tree-formatter.d.ts.map +1 -0
  384. package/dist/sdk/util/tree-formatter.js +1 -0
  385. package/dist/sdk/util/tree-formatter.js.map +1 -0
  386. package/dist/sdk/{workflow.d.ts → workflow/index.d.ts} +2 -2
  387. package/dist/sdk/workflow/index.d.ts.map +1 -0
  388. package/dist/sdk/workflow/index.js +1 -0
  389. package/dist/sdk/workflow/index.js.map +1 -0
  390. package/dist/sdk/workflow/workflow-utils.d.ts.map +1 -0
  391. package/dist/sdk/workflow/workflow-utils.js +1 -0
  392. package/dist/sdk/workflow/workflow-utils.js.map +1 -0
  393. package/dist/utils/async.js +1 -1
  394. package/dist/utils/colors.js +1 -1
  395. package/dist/utils/diff.js +1 -1
  396. package/dist/utils/file-permissions.js +1 -1
  397. package/dist/utils/json-loader.js +1 -1
  398. package/dist/utils/option-validation.js +1 -1
  399. package/dist/utils/port.js +1 -1
  400. package/dist/utils/process.js +1 -1
  401. package/dist/utils/prompt.js +1 -1
  402. package/dist/utils/spinner.d.ts +12 -12
  403. package/dist/utils/spinner.d.ts.map +1 -1
  404. package/dist/utils/spinner.js +1 -1
  405. package/dist/utils/spinner.js.map +1 -1
  406. package/dist/utils/sse-parser.d.ts +1 -1
  407. package/dist/utils/sse-parser.d.ts.map +1 -1
  408. package/dist/utils/sse-parser.js +1 -1
  409. package/dist/utils/string-utils.js +1 -1
  410. package/dist/utils/table-ref-parser.js +1 -1
  411. package/dist/utils/tdx-logger.js +1 -1
  412. package/dist/utils/version-check.js +1 -1
  413. package/package.json +1 -1
  414. package/dist/client/cdp-api-client.d.ts.map +0 -1
  415. package/dist/client/cdp-api-client.js +0 -1
  416. package/dist/client/cdp-api-client.js.map +0 -1
  417. package/dist/client/engage-api-client.d.ts.map +0 -1
  418. package/dist/client/engage-api-client.js +0 -1
  419. package/dist/client/engage-api-client.js.map +0 -1
  420. package/dist/client/http-client.d.ts.map +0 -1
  421. package/dist/client/http-client.js +0 -1
  422. package/dist/client/http-client.js.map +0 -1
  423. package/dist/client/llm-api-client.d.ts.map +0 -1
  424. package/dist/client/llm-api-client.js +0 -1
  425. package/dist/client/llm-api-client.js.map +0 -1
  426. package/dist/client/rate-limiter.d.ts.map +0 -1
  427. package/dist/client/rate-limiter.js +0 -1
  428. package/dist/client/rate-limiter.js.map +0 -1
  429. package/dist/client/td-api-client.d.ts.map +0 -1
  430. package/dist/client/td-api-client.js +0 -1
  431. package/dist/client/td-api-client.js.map +0 -1
  432. package/dist/client/trino-api-client.d.ts.map +0 -1
  433. package/dist/client/trino-api-client.js +0 -1
  434. package/dist/client/trino-api-client.js.map +0 -1
  435. package/dist/client/workflow-client.d.ts.map +0 -1
  436. package/dist/client/workflow-client.js +0 -1
  437. package/dist/client/workflow-client.js.map +0 -1
  438. package/dist/sdk/llm.d.ts.map +0 -1
  439. package/dist/sdk/llm.js +0 -1
  440. package/dist/sdk/llm.js.map +0 -1
  441. package/dist/sdk/query.d.ts.map +0 -1
  442. package/dist/sdk/query.js +0 -1
  443. package/dist/sdk/query.js.map +0 -1
  444. package/dist/sdk/workflow.d.ts.map +0 -1
  445. package/dist/sdk/workflow.js +0 -1
  446. package/dist/sdk/workflow.js.map +0 -1
  447. package/dist/types/anthropic.d.ts.map +0 -1
  448. package/dist/types/anthropic.js.map +0 -1
  449. package/dist/types/cdp.d.ts.map +0 -1
  450. package/dist/types/cdp.js.map +0 -1
  451. package/dist/types/connection.d.ts.map +0 -1
  452. package/dist/types/connection.js.map +0 -1
  453. package/dist/types/connector-schema.d.ts.map +0 -1
  454. package/dist/types/connector-schema.js.map +0 -1
  455. package/dist/types/database.d.ts.map +0 -1
  456. package/dist/types/database.js.map +0 -1
  457. package/dist/types/endpoints.d.ts.map +0 -1
  458. package/dist/types/endpoints.js +0 -1
  459. package/dist/types/endpoints.js.map +0 -1
  460. package/dist/types/engage.d.ts.map +0 -1
  461. package/dist/types/engage.js.map +0 -1
  462. package/dist/types/index.d.ts.map +0 -1
  463. package/dist/types/index.js +0 -1
  464. package/dist/types/index.js.map +0 -1
  465. package/dist/types/job.d.ts.map +0 -1
  466. package/dist/types/job.js.map +0 -1
  467. package/dist/types/llm.d.ts.map +0 -1
  468. package/dist/types/llm.js.map +0 -1
  469. package/dist/types/trino.d.ts.map +0 -1
  470. package/dist/types/trino.js.map +0 -1
  471. package/dist/types/workflow.d.ts.map +0 -1
  472. package/dist/types/workflow.js.map +0 -1
  473. package/dist/utils/agent-config.d.ts.map +0 -1
  474. package/dist/utils/agent-config.js +0 -1
  475. package/dist/utils/agent-config.js.map +0 -1
  476. package/dist/utils/agent-ref-parser.d.ts.map +0 -1
  477. package/dist/utils/agent-ref-parser.js +0 -1
  478. package/dist/utils/agent-ref-parser.js.map +0 -1
  479. package/dist/utils/chat-cache.d.ts.map +0 -1
  480. package/dist/utils/chat-cache.js +0 -1
  481. package/dist/utils/chat-cache.js.map +0 -1
  482. package/dist/utils/command-output.d.ts.map +0 -1
  483. package/dist/utils/command-output.js +0 -1
  484. package/dist/utils/command-output.js.map +0 -1
  485. package/dist/utils/constants.d.ts.map +0 -1
  486. package/dist/utils/constants.js +0 -1
  487. package/dist/utils/constants.js.map +0 -1
  488. package/dist/utils/fields-display.d.ts.map +0 -1
  489. package/dist/utils/fields-display.js +0 -1
  490. package/dist/utils/fields-display.js.map +0 -1
  491. package/dist/utils/format-detector.d.ts.map +0 -1
  492. package/dist/utils/format-detector.js +0 -1
  493. package/dist/utils/format-detector.js.map +0 -1
  494. package/dist/utils/formatters.d.ts.map +0 -1
  495. package/dist/utils/formatters.js +0 -1
  496. package/dist/utils/formatters.js.map +0 -1
  497. package/dist/utils/journey-utils.d.ts.map +0 -1
  498. package/dist/utils/journey-utils.js +0 -1
  499. package/dist/utils/journey-utils.js.map +0 -1
  500. package/dist/utils/llm-backup-utils.d.ts.map +0 -1
  501. package/dist/utils/llm-backup-utils.js +0 -1
  502. package/dist/utils/llm-backup-utils.js.map +0 -1
  503. package/dist/utils/model-aliases.d.ts.map +0 -1
  504. package/dist/utils/model-aliases.js +0 -1
  505. package/dist/utils/model-aliases.js.map +0 -1
  506. package/dist/utils/model-factors.d.ts.map +0 -1
  507. package/dist/utils/model-factors.js +0 -1
  508. package/dist/utils/model-factors.js.map +0 -1
  509. package/dist/utils/segment-path-parser.d.ts.map +0 -1
  510. package/dist/utils/segment-path-parser.js +0 -1
  511. package/dist/utils/segment-path-parser.js.map +0 -1
  512. package/dist/utils/segment-ref-parser.d.ts.map +0 -1
  513. package/dist/utils/segment-ref-parser.js +0 -1
  514. package/dist/utils/segment-ref-parser.js.map +0 -1
  515. package/dist/utils/sql-parser.d.ts.map +0 -1
  516. package/dist/utils/sql-parser.js +0 -1
  517. package/dist/utils/sql-parser.js.map +0 -1
  518. package/dist/utils/tdx-config.d.ts.map +0 -1
  519. package/dist/utils/tdx-config.js +0 -1
  520. package/dist/utils/tdx-config.js.map +0 -1
  521. package/dist/utils/tree-formatter.d.ts.map +0 -1
  522. package/dist/utils/tree-formatter.js +0 -1
  523. package/dist/utils/tree-formatter.js.map +0 -1
  524. package/dist/utils/workflow-utils.d.ts.map +0 -1
  525. package/dist/utils/workflow-utils.js +0 -1
  526. package/dist/utils/workflow-utils.js.map +0 -1
  527. /package/dist/{utils → core}/constants.d.ts +0 -0
  528. /package/dist/{utils → sdk/agent}/agent-config.d.ts +0 -0
  529. /package/dist/{utils → sdk/agent}/agent-ref-parser.d.ts +0 -0
  530. /package/dist/{types/anthropic.js → sdk/agent/types/agent-def.js} +0 -0
  531. /package/dist/{client → sdk/client}/rate-limiter.d.ts +0 -0
  532. /package/dist/{types/cdp.js → sdk/io/types.js} +0 -0
  533. /package/dist/{utils → sdk/llm}/chat-cache.d.ts +0 -0
  534. /package/dist/{utils → sdk/llm}/model-aliases.d.ts +0 -0
  535. /package/dist/{utils → sdk/llm}/model-factors.d.ts +0 -0
  536. /package/dist/{utils → sdk/query}/sql-parser.d.ts +0 -0
  537. /package/dist/{utils → sdk/segment}/segment-ref-parser.d.ts +0 -0
  538. /package/dist/{types/connection.js → sdk/segment/types/journey-def.js} +0 -0
  539. /package/dist/{types/connector-schema.js → sdk/segment/types/parent-segment-def.js} +0 -0
  540. /package/dist/{types/database.js → sdk/segment/types/segment-def.js} +0 -0
  541. /package/dist/{types → sdk/types}/anthropic.d.ts +0 -0
  542. /package/dist/{types/engage.js → sdk/types/anthropic.js} +0 -0
  543. /package/dist/{types/job.js → sdk/types/cdp.js} +0 -0
  544. /package/dist/{types → sdk/types}/connection.d.ts +0 -0
  545. /package/dist/{types/llm.js → sdk/types/connection.js} +0 -0
  546. /package/dist/{types → sdk/types}/connector-schema.d.ts +0 -0
  547. /package/dist/{types/trino.js → sdk/types/connector-schema.js} +0 -0
  548. /package/dist/{types → sdk/types}/database.d.ts +0 -0
  549. /package/dist/{types/workflow.js → sdk/types/database.js} +0 -0
  550. /package/dist/{types → sdk/types}/engage.d.ts +0 -0
  551. /package/dist/{types → sdk/types}/job.d.ts +0 -0
  552. /package/dist/{types → sdk/types}/trino.d.ts +0 -0
  553. /package/dist/{types → sdk/types}/workflow.d.ts +0 -0
  554. /package/dist/{utils → sdk/util}/format-detector.d.ts +0 -0
  555. /package/dist/{utils → sdk/util}/tree-formatter.d.ts +0 -0
  556. /package/dist/{utils → sdk/workflow}/workflow-utils.d.ts +0 -0
@@ -3,440 +3,31 @@
3
3
  *
4
4
  * This module provides a human-friendly YAML format for journey configuration
5
5
  * and utilities to convert between YAML and API formats.
6
- */
7
- import { type YamlRule, type YamlActivation } from './child-segment-yaml.js';
8
- export type { YamlRule, YamlCondition, YamlOperator, YamlActivation } from './child-segment-yaml.js';
9
- /**
10
- * Reentry mode for journey
11
- */
12
- export type ReentryMode = 'no_reentry' | 'reentry_unless_goal_achieved' | 'reentry_always';
13
- /**
14
- * Journey state
15
- */
16
- export type JourneyState = 'draft' | 'simulation' | 'launched';
17
- /**
18
- * Wait step time unit
19
- */
20
- export type WaitUnit = 'day' | 'week';
6
+ *
7
+ * Transformation flow:
8
+ * - PULL: ApiModel JourneyDef YAML
9
+ * - PUSH: YAML → JourneyDef → (resolve refs) → ApiModel
10
+ */
11
+ import { type ActivationDef } from './child-segment-yaml.js';
12
+ import type { ResolutionContext, DereferenceContext } from '../types/resolution-context.js';
13
+ import type { Journey } from '../types/cdp.js';
14
+ import type { JourneyDef, JourneyEntryDef, StageDef, WaitStepDef, ActivationStepDef, DecisionPointStepDef, AbTestStepDef, JumpStepDef, CriteriaDef, EmbeddedSegmentDef, JourneyStateType, ReentryModeType, WaitUnitType } from './types/journey-def.js';
15
+ export type { JourneyDef, JourneyEntryDef, StageDef, StepDef, StepBaseDef, WaitStepDef, WaitStepParamsDef, WaitConditionDef, ActivationStepDef, ActivationStepParamsDef, DecisionPointStepDef, DecisionPointStepParamsDef, DecisionBranchDef, AbTestStepDef, AbTestStepParamsDef, AbTestVariantDef, MergeStepDef, JumpStepDef, JumpStepParamsDef, JumpTargetDef, EndStepDef, CriteriaDef, EmbeddedSegmentDef, JourneyStateType, ReentryModeType, WaitUnitType, } from './types/journey-def.js';
16
+ export type { RuleDef, ActivationDef } from './child-segment-yaml.js';
17
+ /** Alias for WaitUnitType */
18
+ export type WaitUnit = WaitUnitType;
19
+ /** Alias for ReentryModeType */
20
+ export type ReentryMode = ReentryModeType;
21
21
  /**
22
22
  * Normalize wait unit to singular form for API compatibility.
23
23
  * Accepts both singular (day, week) and plural (days, weeks) forms.
24
24
  * @internal Exported for testing
25
25
  */
26
26
  export declare function normalizeWaitUnit(unit: string): WaitUnit;
27
- /**
28
- * Step type enumeration
29
- */
30
- export type StepType = 'wait' | 'activation' | 'decision_point' | 'ab_test' | 'merge' | 'jump' | 'end';
31
- /**
32
- * Reference to a child segment (by name or ID)
33
- * @deprecated Use segment name directly in criteria/branches
34
- */
35
- export interface YamlSegmentRef {
36
- /** Segment name (resolved to ID during push) */
37
- segment?: string;
38
- /** Segment ID (used directly) - internal only, not in user-facing YAML */
39
- segment_id?: string;
40
- }
41
- /**
42
- * Embedded segment definition for journey-local segments.
43
- * These segments are created when the journey is launched and are scoped to the journey.
44
- *
45
- * Segment names should be kebab-case identifiers (e.g., "high-value-customers").
46
- */
47
- export interface YamlEmbeddedSegment {
48
- /** Segment description */
49
- description?: string;
50
- /** Filtering rule that defines the segment criteria */
51
- rule: YamlRule;
52
- }
53
- /**
54
- * Journey goal/milestone/criteria definition
55
- */
56
- export interface YamlJourneyCriteria {
57
- /** Display name */
58
- name: string;
59
- /** Description */
60
- description?: string;
61
- /**
62
- * Segment reference - can be:
63
- * - Name of embedded segment (defined in journey's `segments` section)
64
- * - "ref:Segment Name" to reference an existing child segment
65
- * - Segment ID (internal, for API compatibility)
66
- */
67
- segment: string;
68
- /** Optional jump target when criteria is met */
69
- target?: YamlJumpTarget;
70
- }
71
- /**
72
- * Jump target to another journey/stage
73
- */
74
- export interface YamlJumpTarget {
75
- /** Target journey name or ID */
76
- journey: string;
77
- /** Target stage name */
78
- stage: string;
79
- /** Journey bundle ID (optional, for versioned journeys) */
80
- bundle_id?: string;
81
- }
82
- /**
83
- * Base step interface.
84
- * Follows GitHub Actions-like format where type-specific parameters are nested under 'with'.
85
- */
86
- export interface YamlStepBase {
87
- /** Step type - always comes first */
88
- type: StepType;
89
- /** Step name - used as identifier (human-readable) */
90
- name: string;
91
- /** UUID for step (internal, used during API conversion) */
92
- uuid?: string;
93
- /** Next step name or UUID (omitted for 'end' type) */
94
- next?: string;
95
- }
96
- /** Timeout configuration for wait condition */
97
- export interface YamlWaitConditionTimeout {
98
- duration: number;
99
- unit: WaitUnit;
100
- /** Next step when timeout occurs (max wait duration exceeded) */
101
- next?: string;
102
- }
103
- /** Wait condition configuration */
104
- export interface YamlWaitCondition {
105
- /** Segment reference for the condition */
106
- segment: string;
107
- /** Next step when condition is matched */
108
- next?: string;
109
- /** Timeout configuration */
110
- timeout?: YamlWaitConditionTimeout;
111
- }
112
- /**
113
- * Wait step parameters (nested under 'with')
114
- */
115
- export interface YamlWaitStepParams {
116
- /** Duration to wait */
117
- duration?: number;
118
- /** Time unit (day or week) */
119
- unit?: WaitUnit;
120
- /** Wait until specific date */
121
- wait_until?: string;
122
- /** Wait until condition is met */
123
- condition?: YamlWaitCondition;
124
- /** Days of the week to wait for */
125
- days_of_week?: string[];
126
- }
127
- /**
128
- * Wait step - pause execution
129
- */
130
- export interface YamlWaitStep extends YamlStepBase {
131
- type: 'wait';
132
- /** Step-specific parameters */
133
- with: YamlWaitStepParams;
134
- }
135
- /**
136
- * Activation step parameters (nested under 'with')
137
- */
138
- export interface YamlActivationStepParams {
139
- /** Activation name (resolved to ID during push) */
140
- activation: string;
141
- }
142
- /**
143
- * Activation step - send to external system
144
- */
145
- export interface YamlActivationStep extends YamlStepBase {
146
- type: 'activation';
147
- /** Step-specific parameters */
148
- with: YamlActivationStepParams;
149
- }
150
- /**
151
- * Decision point branch
152
- */
153
- export interface YamlDecisionBranch {
154
- /** Branch name */
155
- name: string;
156
- /**
157
- * Segment reference - can be:
158
- * - Name of embedded segment (defined in journey's `segments` section)
159
- * - "ref:Segment Name" to reference an existing child segment
160
- * - Segment ID (internal, for API compatibility)
161
- */
162
- segment?: string;
163
- /**
164
- * Segment ID (alternative to segment name)
165
- * @deprecated Use `segment` name instead - IDs are internal only
166
- * @internal
167
- */
168
- segment_id?: string;
169
- /** Is this the excluded/else path? */
170
- excluded?: boolean;
171
- /** Next step for this branch */
172
- next?: string;
173
- }
174
- /**
175
- * Decision point step parameters (nested under 'with')
176
- */
177
- export interface YamlDecisionPointStepParams {
178
- /** Branches for the decision */
179
- branches: YamlDecisionBranch[];
180
- }
181
- /**
182
- * Decision point step - branch based on segment
183
- */
184
- export interface YamlDecisionPointStep extends YamlStepBase {
185
- type: 'decision_point';
186
- /** Step-specific parameters */
187
- with: YamlDecisionPointStepParams;
188
- }
189
- /**
190
- * A/B test variant
191
- */
192
- export interface YamlAbTestVariant {
193
- /** Variant ID */
194
- id?: string;
195
- /** Variant name */
196
- name: string;
197
- /** Percentage of traffic (0-100) */
198
- percentage: number;
199
- /** Next step for this variant */
200
- next?: string;
201
- }
202
- /**
203
- * A/B test step parameters (nested under 'with')
204
- */
205
- export interface YamlAbTestStepParams {
206
- /** Use custom split percentages (vs equal distribution) */
207
- customized_split?: boolean;
208
- /** Unique ID for the test */
209
- unique_id?: string;
210
- /** Test variants */
211
- variants: YamlAbTestVariant[];
212
- }
213
- /**
214
- * A/B test step - split traffic for testing
215
- */
216
- export interface YamlAbTestStep extends YamlStepBase {
217
- type: 'ab_test';
218
- /** Step-specific parameters */
219
- with: YamlAbTestStepParams;
220
- }
221
- /**
222
- * Merge step - rejoin branched paths (no additional parameters)
223
- */
224
- export interface YamlMergeStep extends YamlStepBase {
225
- type: 'merge';
226
- }
227
- /**
228
- * Jump step parameters (nested under 'with')
229
- */
230
- export interface YamlJumpStepParams {
231
- /** Jump target */
232
- target: YamlJumpTarget;
233
- }
234
- /**
235
- * Jump step - go to another journey/stage
236
- */
237
- export interface YamlJumpStep extends YamlStepBase {
238
- type: 'jump';
239
- /** Step-specific parameters */
240
- with: YamlJumpStepParams;
241
- }
242
- /**
243
- * End step - exit the stage (no next, no additional parameters)
244
- */
245
- export interface YamlEndStep extends YamlStepBase {
246
- type: 'end';
247
- }
248
27
  /**
249
28
  * Helper type to check if a step has 'with' params
250
29
  */
251
- export type YamlStepWithParams = YamlWaitStep | YamlActivationStep | YamlDecisionPointStep | YamlAbTestStep | YamlJumpStep;
252
- /**
253
- * Union of all step types
254
- */
255
- export type YamlStep = YamlWaitStep | YamlActivationStep | YamlDecisionPointStep | YamlAbTestStep | YamlMergeStep | YamlJumpStep | YamlEndStep;
256
- /**
257
- * Journey stage definition
258
- */
259
- export interface YamlJourneyStage {
260
- /** Stage name */
261
- name: string;
262
- /** Stage description */
263
- description?: string;
264
- /**
265
- * Stage ID (from API, used for updates)
266
- * @internal Not included in user-facing YAML output
267
- */
268
- id?: string;
269
- /** Entry criteria - who enters this stage */
270
- entry_criteria?: YamlJourneyCriteria;
271
- /** Exit criteria - when to remove from stage */
272
- exit_criteria?: YamlJourneyCriteria[];
273
- /** Milestone - tracking point */
274
- milestone?: YamlJourneyCriteria;
275
- /** Root step UUID (entry point) */
276
- root_step?: string;
277
- /** Steps in this stage */
278
- steps?: YamlStep[];
279
- }
280
- /**
281
- * Resource type discriminator for YAML files
282
- */
283
- export type YamlResourceType = 'segment' | 'journey';
284
- /**
285
- * Journey version definition for multi-version YAML files.
286
- * Each version has its own stages but shares segment definitions with other versions.
287
- * @deprecated Use YamlJourneyEntry with the 'journeys' array format instead
288
- */
289
- export interface YamlJourneyVersion {
290
- /** Version name (e.g., "v1", "v2") */
291
- name: string;
292
- /** Version state */
293
- state: 'draft' | 'launched';
294
- /**
295
- * Whether this is the currently active (latest) version.
296
- * Only one version should have latest=true.
297
- * Default: false (omit if false)
298
- */
299
- latest?: boolean;
300
- /** Version-specific stages (1-8) */
301
- stages: YamlJourneyStage[];
302
- /**
303
- * Journey ID for this version (from API, used for updates)
304
- * @internal Not included in user-facing YAML output
305
- */
306
- id?: string;
307
- /** Version number */
308
- version_number?: number;
309
- }
310
- /**
311
- * Journey entry definition for the unified 'journeys' array format.
312
- * Each entry represents a version of the journey with its own stages.
313
- * Shared properties (goal, reentry, segments) can be inherited from top-level
314
- * or overridden per-entry.
315
- */
316
- export interface YamlJourneyEntry {
317
- /**
318
- * Version identifier (e.g., "v1", "v2").
319
- * Optional - defaults to "v1" for single-version journeys.
320
- */
321
- version?: string;
322
- /** Version state */
323
- state?: 'draft' | 'launched';
324
- /**
325
- * Whether this is the currently active (latest) version.
326
- * Only one entry should have latest=true.
327
- * Default: false (omit if false)
328
- */
329
- latest?: boolean;
330
- /** Version-specific stages (1-8) */
331
- stages: YamlJourneyStage[];
332
- /**
333
- * Journey ID for this entry (from API, used for updates)
334
- * @internal Not included in user-facing YAML output
335
- */
336
- id?: string;
337
- /** Version number from API */
338
- version_number?: number;
339
- /** Override goal for this version */
340
- goal?: YamlJourneyCriteria;
341
- /** Override reentry mode for this version */
342
- reentry?: ReentryMode;
343
- }
344
- /**
345
- * Complete journey YAML configuration.
346
- *
347
- * Supports three modes (in order of preference):
348
- * 1. **Unified format (recommended)**: Use `journeys` array - each entry is a version
349
- * 2. Legacy multi-version mode: Use `versions` array (deprecated)
350
- * 3. Legacy single-version mode: Use `stages` at top level (deprecated)
351
- *
352
- * The unified format (`journeys` array) is the recommended format for new journeys.
353
- * Legacy formats are supported for backward compatibility during push.
354
- *
355
- * Folder is NOT stored in YAML - it's inferred from the local file path structure.
356
- */
357
- export interface JourneyYaml {
358
- /** Resource type - must be 'journey' to distinguish from segments */
359
- type: 'journey';
360
- /** Journey name (the actual journey name, same as bundle_name) */
361
- name: string;
362
- /** Journey description */
363
- description?: string;
364
- /**
365
- * Embedded segment definitions local to this journey.
366
- * These segments are created when the journey is launched.
367
- *
368
- * Keys are segment names (kebab-case, e.g., "high-value-customers").
369
- * Reference these names in criteria/branches using the segment field.
370
- * To reference an existing child segment, use "ref:Segment Name" prefix.
371
- */
372
- segments?: Record<string, YamlEmbeddedSegment>;
373
- /**
374
- * Embedded activation definitions local to this journey.
375
- * These activations are created/updated when the journey is launched.
376
- *
377
- * Keys are activation names used in activation steps.
378
- * Reference these names in steps using the activation field.
379
- * To reference an existing activation, use "ref:Activation Name" prefix.
380
- */
381
- activations?: Record<string, YamlActivation>;
382
- /** Journey goal (shared across all versions, can be overridden per-version in journeys array) */
383
- goal?: YamlJourneyCriteria;
384
- /** Reentry mode (shared across all versions, can be overridden per-version in journeys array) */
385
- reentry?: ReentryMode;
386
- /**
387
- * Journey versions using unified format.
388
- * Each entry has `version` (optional, defaults to "v1"), `state`, `stages`,
389
- * and optionally `goal`/`reentry` overrides.
390
- *
391
- * This is the recommended format for all journeys (single or multi-version).
392
- */
393
- journeys?: YamlJourneyEntry[];
394
- /**
395
- * Journey stages for legacy single-version mode (1-8).
396
- * @deprecated Use `journeys` array instead
397
- */
398
- stages?: YamlJourneyStage[];
399
- /**
400
- * Journey versions for legacy multi-version mode.
401
- * @deprecated Use `journeys` array instead
402
- */
403
- versions?: YamlJourneyVersion[];
404
- /**
405
- * Journey ID (from API, used for updates)
406
- * @internal Not included in user-facing YAML output
407
- */
408
- id?: string;
409
- /**
410
- * Version name (e.g., "v11") - the API name field
411
- * @internal Used for single-version mode API compatibility
412
- */
413
- version?: string;
414
- /**
415
- * Version number
416
- * @internal Used for single-version mode API compatibility
417
- */
418
- version_number?: number;
419
- /**
420
- * Folder ID (from API)
421
- * @internal Folder is inferred from file path, not stored in YAML
422
- */
423
- folder_id?: string;
424
- /**
425
- * Journey bundle ID (for versioned journeys)
426
- * @internal Not included in user-facing YAML output
427
- */
428
- bundle_id?: string;
429
- /**
430
- * Bundle name (same as name, kept for compatibility)
431
- * @internal Not included in user-facing YAML output
432
- */
433
- bundle_name?: string;
434
- /**
435
- * Allow reentry (legacy, use reentry instead)
436
- * @deprecated Use `reentry` instead
437
- */
438
- allow_reentry?: boolean;
439
- }
30
+ export type StepWithParams = WaitStepDef | ActivationStepDef | DecisionPointStepDef | AbTestStepDef | JumpStepDef;
440
31
  /**
441
32
  * Jump target from API (used in jump steps and exit criteria)
442
33
  * Format of journeyName: "Stage Name (Journey Name/Subfolder/Root folders)"
@@ -526,16 +117,16 @@ export interface ApiJourneyStage {
526
117
  steps?: Record<string, ApiJourneyStep>;
527
118
  }
528
119
  /**
529
- * Full journey from API
120
+ * Full journey response from API
530
121
  */
531
- export interface ApiJourney {
122
+ export interface JourneyResponse {
532
123
  id: string;
533
124
  type: 'journey';
534
125
  attributes: {
535
126
  name: string;
536
127
  description?: string;
537
128
  audienceId: string;
538
- state: JourneyState;
129
+ state: JourneyStateType;
539
130
  goal?: ApiJourneyCriteria;
540
131
  allowReentry?: boolean;
541
132
  reentryMode?: ReentryMode;
@@ -573,7 +164,7 @@ export interface ResolvedSegment {
573
164
  /** Whether this is a journey-local segment (true) or external child segment (false) */
574
165
  isJourneyLocal: boolean;
575
166
  /** Segment rule definition (only for journey-local segments) */
576
- definition?: YamlEmbeddedSegment;
167
+ definition?: EmbeddedSegmentDef;
577
168
  }
578
169
  /**
579
170
  * Result of resolving an activation ID during API to YAML conversion
@@ -584,7 +175,7 @@ export interface ResolvedActivation {
584
175
  /** Whether this activation should be embedded in the journey YAML */
585
176
  isJourneyLocal: boolean;
586
177
  /** Full activation definition (for embedding) */
587
- definition?: YamlActivation;
178
+ definition?: ActivationDef;
588
179
  }
589
180
  /**
590
181
  * Resolved jump target information
@@ -596,35 +187,26 @@ export interface ResolvedJumpTarget {
596
187
  stageName: string;
597
188
  }
598
189
  /**
599
- * Context for resolving IDs to names during API → YAML conversion (pull).
190
+ * Context for converting API response to portable definition (pull).
600
191
  *
601
- * When pulling from API, references are stored as IDs. To make YAML human-readable,
602
- * these IDs can be resolved to names using the context functions.
192
+ * When pulling from API, references are stored as IDs. To make the definition
193
+ * human-readable, these IDs can be resolved to names using the context functions.
603
194
  *
604
- * If no context is provided, IDs are stored as-is in the YAML output.
195
+ * If no context is provided, IDs are stored as-is in the output.
605
196
  */
606
- export interface ApiToYamlContext {
197
+ export interface JourneyResponseToDefContext extends DereferenceContext {
607
198
  /**
608
199
  * Resolve segment ID to its definition and metadata.
609
200
  * Returns name and whether it's journey-local or an external ref.
610
201
  * For journey-local segments, also returns the rule definition for embedding.
611
202
  */
612
203
  resolveSegment?: (id: string) => Promise<ResolvedSegment>;
613
- /**
614
- * Resolve segment ID to name (simple version, for backward compatibility)
615
- * @deprecated Use resolveSegment for full segment resolution
616
- */
617
- resolveSegmentName?: (id: string) => Promise<string>;
618
204
  /**
619
205
  * Resolve activation ID to its definition and metadata.
620
- * Returns name and whether it should be embedded in the journey YAML.
206
+ * Returns name and whether it should be embedded in the journey definition.
621
207
  * For journey-local activations, also returns the full definition for embedding.
622
208
  */
623
209
  resolveActivation?: (id: string) => Promise<ResolvedActivation>;
624
- /** Resolve activation ID to name (simple version, for backward compatibility) */
625
- resolveActivationName?: (id: string) => Promise<string>;
626
- /** Resolve journey ID to name */
627
- resolveJourneyName?: (id: string) => Promise<string>;
628
210
  /**
629
211
  * Resolve jump target IDs (journey ID and stage ID) to their names.
630
212
  * Used for human-readable jump step targets.
@@ -639,7 +221,7 @@ export interface ApiToYamlContext {
639
221
  *
640
222
  * @internal Use apiToYamlAsync for user-facing YAML
641
223
  */
642
- export declare function apiToYaml(api: ApiJourney): JourneyYaml;
224
+ export declare function journeyResponseToDefSync(api: JourneyResponse): JourneyDef;
643
225
  /**
644
226
  * Convert API journey to YAML format with segment resolution.
645
227
  *
@@ -650,17 +232,11 @@ export declare function apiToYaml(api: ApiJourney): JourneyYaml;
650
232
  * @param context - Resolution context for IDs to names
651
233
  * @returns Journey YAML with embedded segments and name references
652
234
  */
653
- export declare function apiToYamlAsync(api: ApiJourney, context?: ApiToYamlContext): Promise<JourneyYaml>;
235
+ export declare function journeyResponseToDef(api: JourneyResponse, context?: JourneyResponseToDefContext): Promise<JourneyDef>;
654
236
  /**
655
- * Context for resolving references during YAML API conversion
237
+ * Context for converting portable definition to API request (push).
656
238
  */
657
- export interface YamlToApiContext {
658
- /** Resolve segment name to ID */
659
- resolveSegmentId?: (name: string) => Promise<string>;
660
- /** Resolve activation name to ID */
661
- resolveActivationId?: (name: string) => Promise<string>;
662
- /** Resolve journey name to ID */
663
- resolveJourneyId?: (name: string) => Promise<string>;
239
+ export interface JourneyDefToRequestContext extends ResolutionContext {
664
240
  /**
665
241
  * Resolve stage name to ID within a journey.
666
242
  * Used for jump step target stage resolution.
@@ -673,12 +249,12 @@ export interface YamlToApiContext {
673
249
  * Resolve embedded segment definition to ID.
674
250
  * Used when an embedded segment needs to be created/matched in the API.
675
251
  */
676
- resolveEmbeddedSegmentId?: (name: string, definition: YamlEmbeddedSegment) => Promise<string>;
252
+ resolveEmbeddedSegmentId?: (name: string, definition: EmbeddedSegmentDef) => Promise<string>;
677
253
  /**
678
254
  * Resolve embedded activation definition to ID.
679
255
  * Used when an embedded activation needs to be created/matched in the API.
680
256
  */
681
- resolveEmbeddedActivationId?: (name: string, definition: YamlActivation) => Promise<string>;
257
+ resolveEmbeddedActivationId?: (name: string, definition: ActivationDef) => Promise<string>;
682
258
  }
683
259
  /**
684
260
  * API request format for creating/updating a journey
@@ -711,12 +287,12 @@ export interface ApiJourneyRequest {
711
287
  * @param audienceId - Parent segment ID (from context, not stored in YAML)
712
288
  * @param context - Resolution context for references
713
289
  */
714
- export declare function yamlToApi(yamlConfig: JourneyYaml, audienceId: string, context?: YamlToApiContext): Promise<ApiJourneyRequest>;
290
+ export declare function journeyDefToRequest(yamlConfig: JourneyDef, audienceId: string, context?: JourneyDefToRequestContext): Promise<ApiJourneyRequest>;
715
291
  /**
716
292
  * Serialize journey config to YAML string.
717
293
  * Strips internal fields (IDs, folder_id, etc.) from output for clean, portable YAML.
718
294
  */
719
- export declare function toYamlString(config: JourneyYaml): string;
295
+ export declare function toYamlString(config: JourneyDef): string;
720
296
  /**
721
297
  * Parse YAML string to journey config.
722
298
  * Supports three formats:
@@ -724,11 +300,11 @@ export declare function toYamlString(config: JourneyYaml): string;
724
300
  * 2. Legacy single-version mode: stages at top level
725
301
  * 3. Legacy multi-version mode: versions array
726
302
  */
727
- export declare function parseYamlString(yamlString: string): JourneyYaml;
303
+ export declare function parseYamlString(yamlString: string): JourneyDef;
728
304
  /**
729
305
  * Check if a YAML object represents a journey (vs segment)
730
306
  */
731
- export declare function isJourneyYaml(parsed: unknown): parsed is JourneyYaml;
307
+ export declare function isJourneyDef(parsed: unknown): parsed is JourneyDef;
732
308
  /**
733
309
  * Generate a sample YAML template for a new journey
734
310
  */
@@ -762,31 +338,31 @@ export declare function isExternalSegmentRef(ref: string): boolean;
762
338
  * Check if a journey YAML uses the unified 'journeys' array format.
763
339
  * This is the recommended format for all journeys.
764
340
  */
765
- export declare function isJourneysArrayMode(config: JourneyYaml): boolean;
341
+ export declare function isJourneysArrayMode(config: JourneyDef): boolean;
766
342
  /**
767
343
  * Check if a journey YAML is in legacy multi-version mode (using 'versions' array).
768
344
  * @deprecated Use isJourneysArrayMode instead
769
345
  */
770
- export declare function isMultiVersionMode(config: JourneyYaml): boolean;
346
+ export declare function isMultiVersionMode(config: JourneyDef): boolean;
771
347
  /**
772
348
  * Check if a journey YAML is in legacy single-version mode (using 'stages' at top level).
773
349
  * @deprecated Use isJourneysArrayMode instead
774
350
  */
775
- export declare function isSingleVersionMode(config: JourneyYaml): boolean;
351
+ export declare function isSingleVersionMode(config: JourneyDef): boolean;
776
352
  /**
777
353
  * Check if a journey YAML has multiple versions defined (in any format).
778
354
  * Works with unified journeys array, legacy versions array, or legacy single-version mode.
779
355
  */
780
- export declare function hasMultipleVersions(config: JourneyYaml): boolean;
356
+ export declare function hasMultipleVersions(config: JourneyDef): boolean;
781
357
  /**
782
358
  * Normalize a journey YAML config to the unified journeys array format.
783
359
  * This is useful for comparing journeys across different format versions.
784
360
  * Converts legacy single-version (stages at top) and multi-version (versions array)
785
361
  * formats to the unified journeys array format.
786
362
  */
787
- export declare function normalizeToJourneysFormat(config: JourneyYaml): JourneyYaml;
363
+ export declare function normalizeToJourneysFormat(config: JourneyDef): JourneyDef;
788
364
  /**
789
- * Normalize a JourneyYaml to have consistent field ordering.
365
+ * Normalize a JourneyDef to have consistent field ordering.
790
366
  * This ensures that local YAML files and server-converted YAML have the same field order,
791
367
  * avoiding spurious diffs in `tdx journey push` that are just reordering changes.
792
368
  *
@@ -796,7 +372,7 @@ export declare function normalizeToJourneysFormat(config: JourneyYaml): JourneyY
796
372
  * - Stage: name, description, entry_criteria, exit_criteria, milestone, steps
797
373
  * - Step: type, name, next, with
798
374
  */
799
- export declare function normalizeJourneyYaml(config: JourneyYaml, existingYaml?: JourneyYaml): JourneyYaml;
375
+ export declare function normalizeJourneyDef(config: JourneyDef, existingYaml?: JourneyDef): JourneyDef;
800
376
  /**
801
377
  * Get all stages from a journey YAML, regardless of mode.
802
378
  * Returns stages from the latest/active version.
@@ -806,7 +382,7 @@ export declare function normalizeJourneyYaml(config: JourneyYaml, existingYaml?:
806
382
  * 2. stages (legacy single-version) - returns stages directly
807
383
  * 3. versions (legacy multi-version) - returns stages from latest version
808
384
  */
809
- export declare function getActiveStages(config: JourneyYaml): YamlJourneyStage[];
385
+ export declare function getActiveStages(config: JourneyDef): StageDef[];
810
386
  /**
811
387
  * Get the latest/active journey entry from a journey YAML.
812
388
  * Works with all three formats (unified, legacy multi-version, legacy single-version).
@@ -814,7 +390,7 @@ export declare function getActiveStages(config: JourneyYaml): YamlJourneyStage[]
814
390
  * Returns the entry/version marked with `latest: true`, or the first one as fallback.
815
391
  * For legacy single-version mode, returns a synthetic entry created from top-level fields.
816
392
  */
817
- export declare function getLatestJourneyEntry(config: JourneyYaml): YamlJourneyEntry | undefined;
393
+ export declare function getLatestJourneyEntry(config: JourneyDef): JourneyEntryDef | undefined;
818
394
  /**
819
395
  * Get the latest/active version from a legacy multi-version journey.
820
396
  * Returns the version marked with `latest: true`, or the first version as fallback.
@@ -822,25 +398,36 @@ export declare function getLatestJourneyEntry(config: JourneyYaml): YamlJourneyE
822
398
  *
823
399
  * @deprecated Use getLatestJourneyEntry instead
824
400
  */
825
- export declare function getLatestVersion(config: JourneyYaml): YamlJourneyVersion | undefined;
401
+ export declare function getLatestVersion(config: JourneyDef): JourneyEntryDef | undefined;
826
402
  /**
827
403
  * Get effective goal for a journey, considering per-version overrides.
828
404
  * For unified format, checks the active journey entry first, then falls back to top-level.
829
405
  */
830
- export declare function getEffectiveGoal(config: JourneyYaml): YamlJourneyCriteria | undefined;
406
+ export declare function getEffectiveGoal(config: JourneyDef): CriteriaDef | undefined;
831
407
  /**
832
408
  * Get effective reentry mode for a journey, considering per-version overrides.
833
409
  * For unified format, checks the active journey entry first, then falls back to top-level.
834
410
  */
835
- export declare function getEffectiveReentry(config: JourneyYaml): ReentryMode | undefined;
411
+ export declare function getEffectiveReentry(config: JourneyDef): ReentryMode | undefined;
836
412
  /**
837
413
  * Collect all segment references from a journey YAML.
838
414
  * Returns a set of unique segment reference strings.
839
415
  */
840
- export declare function collectSegmentRefs(config: JourneyYaml): Set<string>;
416
+ export declare function collectSegmentRefs(config: JourneyDef): Set<string>;
841
417
  /**
842
418
  * Validate that all segment references in a journey YAML are resolvable.
843
419
  * Returns an array of validation errors (empty if all valid).
844
420
  */
845
- export declare function validateSegmentRefs(config: JourneyYaml): string[];
421
+ export declare function validateSegmentRefs(config: JourneyDef): string[];
422
+ /**
423
+ * Collect segment IDs referenced in a Journey API response.
424
+ * This is the API-format counterpart to collectSegmentIdsFromJourney (which works with JourneyDef).
425
+ *
426
+ * Used during push operations to understand which segments are referenced by a journey
427
+ * for determining expanded rule comparisons and segment ordering.
428
+ *
429
+ * @param journey - Journey API response object
430
+ * @returns Set of segment IDs referenced in the journey
431
+ */
432
+ export declare function collectSegmentIdsFromJourneyApi(journey: Journey): Set<string>;
846
433
  //# sourceMappingURL=journey-yaml.d.ts.map