@treasuredata/tdx 0.9.8 → 0.10.1

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 +7 -4
  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
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Target Resolution for Segment/Journey Push and Pull Commands
3
+ *
4
+ * This module provides a unified function to resolve command arguments to target information
5
+ * needed for push/pull operations. It handles:
6
+ * - YAML file paths (e.g., "segments/my-project/segment.yml")
7
+ * - Directories with tdx.json (e.g., "segments/my-project")
8
+ * - Parent segment names (e.g., "My Parent Segment")
9
+ * - Current directory with tdx.json or context fallback
10
+ */
11
+ import type { FileSystem } from '../io/types.js';
12
+ import { type YamlResourceType } from './segment-path-parser.js';
13
+ /**
14
+ * Options for resolving a push/pull target argument
15
+ */
16
+ export interface ResolveTargetOptions {
17
+ /** The argument from command line (file, directory, or parent name) */
18
+ arg?: string;
19
+ /** Parent segment from context (--parent-segment or session) */
20
+ contextParent?: string;
21
+ /** Current working directory (defaults to process.cwd()) */
22
+ cwd?: string;
23
+ /** File system abstraction for testability */
24
+ fs?: FileSystem;
25
+ }
26
+ /**
27
+ * Base result fields present in all successful resolutions
28
+ */
29
+ interface BaseResolutionResult {
30
+ /** Resolved parent segment name */
31
+ parentName: string;
32
+ /** Target directory path (for operations needing a directory) */
33
+ targetDir: string;
34
+ /** Directory containing tdx.json (may differ from targetDir in scoped operations) */
35
+ configRoot: string;
36
+ }
37
+ /**
38
+ * Resolution from a parent segment name (creates new directory for pull)
39
+ */
40
+ export interface ParentNameResolution extends BaseResolutionResult {
41
+ type: 'parent_name';
42
+ }
43
+ /**
44
+ * Resolution from an existing directory with tdx.json
45
+ */
46
+ export interface DirectoryResolution extends BaseResolutionResult {
47
+ type: 'directory';
48
+ /** Whether this is a scoped operation (targetDir is subdirectory of configRoot) */
49
+ isScoped: boolean;
50
+ /** Scoped folder path relative to configRoot (empty if not scoped) */
51
+ scopedFolderPath: string;
52
+ }
53
+ /**
54
+ * Resolution from a YAML file path
55
+ */
56
+ export interface FileResolution extends BaseResolutionResult {
57
+ type: 'file';
58
+ /** Absolute path to the YAML file */
59
+ filePath: string;
60
+ /** Resource name from YAML (segment or journey name) */
61
+ resourceName: string;
62
+ /** Folder path within parent (empty if at root) */
63
+ folderPath: string;
64
+ /** Resource type: 'segment' or 'journey' */
65
+ resourceType: YamlResourceType;
66
+ /** Whether this is a scoped operation */
67
+ isScoped: boolean;
68
+ /** Scoped folder path relative to configRoot */
69
+ scopedFolderPath: string;
70
+ }
71
+ /**
72
+ * Resolution from current directory or context
73
+ */
74
+ export interface ContextResolution extends BaseResolutionResult {
75
+ type: 'context';
76
+ /** Whether this is a scoped operation */
77
+ isScoped: boolean;
78
+ /** Scoped folder path relative to configRoot (empty if not scoped) */
79
+ scopedFolderPath: string;
80
+ }
81
+ /**
82
+ * Error codes for resolution failures
83
+ */
84
+ export type TargetResolutionErrorCode = 'no_config' | 'no_parent' | 'file_not_found' | 'invalid_yaml' | 'invalid_config';
85
+ /**
86
+ * Resolution error
87
+ */
88
+ export interface ErrorResolution {
89
+ type: 'error';
90
+ /** Error code for programmatic handling */
91
+ errorCode: TargetResolutionErrorCode;
92
+ /** Human-readable error message */
93
+ message: string;
94
+ /** The argument that failed resolution */
95
+ arg?: string;
96
+ /** Suggested help text */
97
+ helpText?: string;
98
+ }
99
+ /**
100
+ * Union of all resolution result types
101
+ */
102
+ export type TargetResolutionResult = ParentNameResolution | DirectoryResolution | FileResolution | ContextResolution | ErrorResolution;
103
+ /**
104
+ * Type guard to check if resolution was successful
105
+ */
106
+ export declare function isSuccessfulResolution(result: TargetResolutionResult): result is ParentNameResolution | DirectoryResolution | FileResolution | ContextResolution;
107
+ /**
108
+ * Type guard to check if resolution has scoped operation info
109
+ */
110
+ export declare function isScopedResolution(result: TargetResolutionResult): result is DirectoryResolution | FileResolution | ContextResolution;
111
+ /**
112
+ * Get scoped operation details from a resolution result
113
+ */
114
+ export declare function getScopedDetails(result: TargetResolutionResult): {
115
+ isScoped: boolean;
116
+ scopedFolderPath: string;
117
+ } | undefined;
118
+ /**
119
+ * Resolve a push/pull target argument to a standardized result.
120
+ *
121
+ * This function handles the common argument resolution logic shared by
122
+ * segment push, segment pull, and journey pull commands.
123
+ *
124
+ * Resolution order:
125
+ * 1. If argument is a YAML file path -> resolve file details
126
+ * 2. If argument is an existing directory -> find tdx.json, resolve parent
127
+ * 3. If argument doesn't exist -> treat as parent segment name
128
+ * 4. No argument -> check current directory for tdx.json, fall back to context
129
+ *
130
+ * @param options - Resolution options
131
+ * @returns Resolution result (success or error)
132
+ *
133
+ * @example
134
+ * ```typescript
135
+ * // Resolve file path
136
+ * const result = await resolveTarget({ arg: 'segments/my-project/segment.yml' });
137
+ * if (result.type === 'file') {
138
+ * console.log(result.filePath, result.parentName);
139
+ * }
140
+ *
141
+ * // Resolve directory
142
+ * const result = await resolveTarget({ arg: 'segments/my-project' });
143
+ * if (result.type === 'directory') {
144
+ * console.log(result.parentName, result.isScoped);
145
+ * }
146
+ *
147
+ * // Resolve parent name (new)
148
+ * const result = await resolveTarget({ arg: 'My Parent Segment' });
149
+ * if (result.type === 'parent_name') {
150
+ * console.log(result.parentName, result.targetDir);
151
+ * }
152
+ *
153
+ * // Use context
154
+ * const result = await resolveTarget({ contextParent: 'My Parent' });
155
+ * if (result.type === 'context') {
156
+ * console.log(result.parentName);
157
+ * }
158
+ * ```
159
+ */
160
+ export declare function resolveTarget(options: ResolveTargetOptions): Promise<TargetResolutionResult>;
161
+ export {};
162
+ //# sourceMappingURL=target-resolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"target-resolution.d.ts","sourceRoot":"","sources":["../../../src/sdk/segment/target-resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,gBAAgB,CAAC;AAE5D,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAOlC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,uEAAuE;IACvE,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,4DAA4D;IA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;IAC9B,IAAI,EAAE,OAAO,CAAC;IAEd,2CAA2C;IAC3C,SAAS,EAAE,yBAAyB,CAAC;IAErC,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAEhB,0CAA0C;IAC1C,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAC9B,oBAAoB,GACpB,mBAAmB,GACnB,cAAc,GACd,iBAAiB,GACjB,eAAe,CAAC;AAMpB;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,GAC7B,MAAM,IACL,oBAAoB,GACpB,mBAAmB,GACnB,cAAc,GACd,iBAAiB,CAEpB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,sBAAsB,GAC7B,MAAM,IAAI,mBAAmB,GAAG,cAAc,GAAG,iBAAiB,CAMpE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,sBAAsB,GAC7B;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAK7D;AA2DD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,sBAAsB,CAAC,CAsNjC"}
@@ -0,0 +1 @@
1
+ (function(_0x411a16,_0x527f4c){const _0x49c3c5=a101_0x4cb6,_0x1fc023=_0x411a16();while(!![]){try{const _0x390e4a=-parseInt(_0x49c3c5(0x1a2))/0x1*(parseInt(_0x49c3c5(0x1cb))/0x2)+-parseInt(_0x49c3c5(0x1a9))/0x3+parseInt(_0x49c3c5(0x1c2))/0x4+-parseInt(_0x49c3c5(0x1c3))/0x5*(-parseInt(_0x49c3c5(0x198))/0x6)+parseInt(_0x49c3c5(0x1af))/0x7*(parseInt(_0x49c3c5(0x196))/0x8)+parseInt(_0x49c3c5(0x1bf))/0x9*(-parseInt(_0x49c3c5(0x197))/0xa)+parseInt(_0x49c3c5(0x1a0))/0xb*(parseInt(_0x49c3c5(0x195))/0xc);if(_0x390e4a===_0x527f4c)break;else _0x1fc023['push'](_0x1fc023['shift']());}catch(_0x6f833){_0x1fc023['push'](_0x1fc023['shift']());}}}(a101_0x1117,0x1a95f));import a101_0x202399 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x1e6c95){const _0x3d95b2=a101_0x4cb6;return _0x1e6c95[_0x3d95b2(0x1cc)]!==_0x3d95b2(0x1c1);}function a101_0x1117(){const _0x51ad22=['segment','resourceType','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','517spygpo','no_config','4yEsYWl','basename','file','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','root','message','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','631503tEmNqI','string','folderPath','isFile','segmentName','stat','282359aShDfR','trim','isScoped','configDir','dirname','journey','File\x20not\x20found:\x20','parse','file_not_found','relative','includes','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','No\x20tdx.json\x20found\x20for\x20file:\x20','isDirectory','Not\x20a\x20YAML\x20file:\x20','directory','7218tvgAge','readFile','error','341712buowOm','335rNuwIj','startsWith','replace','parentSegment','No\x20tdx.json\x20found','invalid_yaml','exists','File\x20not\x20found','9298xibkjJ','type','44748DOODNp','16dBZbYY','2230bmNsST','15714EdpeQu','context','parent_segment','resolve','scopedFolderPath'];a101_0x1117=function(){return _0x51ad22;};return a101_0x1117();}export function isScopedResolution(_0xae2b4a){const _0x2271f1=a101_0x4cb6;return _0xae2b4a[_0x2271f1(0x1cc)]===_0x2271f1(0x1be)||_0xae2b4a[_0x2271f1(0x1cc)]===_0x2271f1(0x1a4)||_0xae2b4a[_0x2271f1(0x1cc)]===_0x2271f1(0x199);}function a101_0x4cb6(_0x1de822,_0x4e80ab){_0x1de822=_0x1de822-0x195;const _0x11179a=a101_0x1117();let _0x4cb6f9=_0x11179a[_0x1de822];return _0x4cb6f9;}export function getScopedDetails(_0x5f1af2){const _0x461737=a101_0x4cb6;if(isScopedResolution(_0x5f1af2))return{'isScoped':_0x5f1af2[_0x461737(0x1b1)],'scopedFolderPath':_0x5f1af2['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x537fd2,_0x4c74c6){const _0xf1e7c0=a101_0x4cb6;let _0x538bc1=a101_0x202399[_0xf1e7c0(0x19b)](_0x537fd2);const _0x15f962=a101_0x202399[_0xf1e7c0(0x1b6)](_0x538bc1)[_0xf1e7c0(0x1a6)];while(_0x538bc1!==_0x15f962){const _0x44cf58=a101_0x202399['join'](_0x538bc1,'tdx.json');if(await _0x4c74c6['exists'](_0x44cf58))try{const _0x1e0342=await _0x4c74c6[_0xf1e7c0(0x1c0)](_0x44cf58),_0x4b6e06=JSON[_0xf1e7c0(0x1b6)](_0x1e0342);if(_0x4b6e06[_0xf1e7c0(0x19a)]&&typeof _0x4b6e06[_0xf1e7c0(0x19a)]===_0xf1e7c0(0x1aa))return{'configPath':_0x44cf58,'configDir':_0x538bc1,'parentSegment':_0x4b6e06[_0xf1e7c0(0x19a)]};}catch{}_0x538bc1=a101_0x202399['dirname'](_0x538bc1);}return null;}function calculateScopedPath(_0x12594a,_0xa6cbb1){const _0x11aed7=a101_0x4cb6,_0x386e86=a101_0x202399[_0x11aed7(0x1b8)](_0xa6cbb1,_0x12594a),_0x5cb568=_0x386e86!==''&&_0x386e86!=='.'&&!_0x386e86[_0x11aed7(0x1c4)]('..');return{'isScoped':_0x5cb568,'scopedFolderPath':_0x5cb568?_0x386e86[_0x11aed7(0x1c5)](/\\/g,'/'):''};}export async function resolveTarget(_0xf9f508){const _0x2952cf=a101_0x4cb6,{arg:_0x4ad69d,contextParent:_0x1affc1,cwd:cwd=process['cwd'](),fs:fs=nodeFileSystem}=_0xf9f508;if(_0x4ad69d&&isYamlFilePath(_0x4ad69d))try{const _0x5e70a2=await resolveYamlFilePath(_0x4ad69d,fs),_0xf7f9ed=a101_0x202399[_0x2952cf(0x19b)](_0x4ad69d),_0x1be086=a101_0x202399[_0x2952cf(0x1b3)](_0xf7f9ed),_0x2f0c85=await findTdxConfigAsync(_0x1be086,fs);if(!_0x2f0c85){if(_0x1affc1){const _0x240ad8=a101_0x202399['dirname'](_0xf7f9ed);return{'type':_0x2952cf(0x1a4),'parentName':_0x1affc1,'targetDir':_0x240ad8,'configRoot':_0x240ad8,'filePath':_0xf7f9ed,'resourceName':_0x5e70a2[_0x2952cf(0x1ad)],'folderPath':_0x5e70a2[_0x2952cf(0x1ab)],'resourceType':_0x5e70a2[_0x2952cf(0x19e)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x2952cf(0x1c1),'errorCode':'no_config','message':_0x2952cf(0x1bb)+_0x4ad69d,'arg':_0x4ad69d,'helpText':_0x2952cf(0x1ba)};}const _0x581ec8=calculateScopedPath(_0x1be086,_0x2f0c85[_0x2952cf(0x1b2)]);return{'type':_0x2952cf(0x1a4),'parentName':_0x2f0c85['parentSegment'],'targetDir':_0x2f0c85['configDir'],'configRoot':_0x2f0c85[_0x2952cf(0x1b2)],'filePath':_0xf7f9ed,'resourceName':_0x5e70a2[_0x2952cf(0x1ad)],'folderPath':_0x5e70a2[_0x2952cf(0x1ab)],'resourceType':_0x5e70a2[_0x2952cf(0x19e)],'isScoped':_0x581ec8[_0x2952cf(0x1b1)],'scopedFolderPath':_0x581ec8[_0x2952cf(0x19c)]};}catch(_0xd3dc66){const _0x2d232e=_0xd3dc66 instanceof Error?_0xd3dc66[_0x2952cf(0x1a7)]:String(_0xd3dc66);if(_0x2d232e[_0x2952cf(0x1b9)](_0x2952cf(0x1ca)))return{'type':_0x2952cf(0x1c1),'errorCode':_0x2952cf(0x1b7),'message':_0x2952cf(0x1b5)+_0x4ad69d,'arg':_0x4ad69d};if(_0x2d232e[_0x2952cf(0x1b9)](_0x2952cf(0x1c7))){if(_0x1affc1){const _0x5a0743=a101_0x202399['resolve'](_0x4ad69d);if(await fs[_0x2952cf(0x1c9)](_0x5a0743)){const _0x4ed090=a101_0x202399[_0x2952cf(0x1b3)](_0x5a0743),_0x5d4c88=await fs['readFile'](_0x5a0743),_0x53ab85=_0x5d4c88['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x15a460=_0x5d4c88['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x55a364=_0x53ab85?_0x53ab85[0x1][_0x2952cf(0x1b0)]():a101_0x202399[_0x2952cf(0x1a3)](_0x4ad69d,a101_0x202399['extname'](_0x4ad69d)),_0xd78b00=_0x15a460&&_0x15a460[0x1][_0x2952cf(0x1b0)]()===_0x2952cf(0x1b4)?_0x2952cf(0x1b4):_0x2952cf(0x19d);return{'type':'file','parentName':_0x1affc1,'targetDir':_0x4ed090,'configRoot':_0x4ed090,'filePath':_0x5a0743,'resourceName':_0x55a364,'folderPath':'','resourceType':_0xd78b00,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':'no_config','message':_0x2952cf(0x1bb)+_0x4ad69d,'arg':_0x4ad69d,'helpText':_0x2952cf(0x1ba)};}return{'type':_0x2952cf(0x1c1),'errorCode':_0x2952cf(0x1c8),'message':_0x2d232e,'arg':_0x4ad69d};}if(_0x4ad69d){const _0x2f5227=a101_0x202399[_0x2952cf(0x19b)](cwd,_0x4ad69d);let _0x53b54f=null;try{_0x53b54f=await fs[_0x2952cf(0x1ae)](_0x2f5227);}catch{}if(_0x53b54f?.[_0x2952cf(0x1bc)]()){const _0xc9b8d2=await findTdxConfigAsync(_0x2f5227,fs);if(_0xc9b8d2){const _0x111449=calculateScopedPath(_0x2f5227,_0xc9b8d2[_0x2952cf(0x1b2)]);return{'type':_0x2952cf(0x1be),'parentName':_0xc9b8d2[_0x2952cf(0x1c6)],'targetDir':_0x2f5227,'configRoot':_0xc9b8d2[_0x2952cf(0x1b2)],'isScoped':_0x111449['isScoped'],'scopedFolderPath':_0x111449[_0x2952cf(0x19c)]};}if(_0x1affc1)return{'type':_0x2952cf(0x1be),'parentName':_0x1affc1,'targetDir':_0x2f5227,'configRoot':_0x2f5227,'isScoped':![],'scopedFolderPath':''};return{'type':_0x2952cf(0x1c1),'errorCode':_0x2952cf(0x1a1),'message':_0x2952cf(0x19f)+_0x4ad69d,'arg':_0x4ad69d,'helpText':_0x2952cf(0x1ba)};}if(_0x53b54f?.[_0x2952cf(0x1ac)]())return{'type':'error','errorCode':'invalid_yaml','message':_0x2952cf(0x1bd)+_0x4ad69d,'arg':_0x4ad69d,'helpText':_0x2952cf(0x1a8)};const _0xfb4975=sanitizeFileName(_0x4ad69d),_0x5bd50a=getSegmentRootDir(_0xfb4975,cwd);return{'type':'parent_name','parentName':_0x4ad69d,'targetDir':_0x5bd50a,'configRoot':_0x5bd50a};}const _0x57ffcf=await findTdxConfigAsync(cwd,fs);if(_0x57ffcf){const _0x593440=calculateScopedPath(cwd,_0x57ffcf['configDir']);return{'type':'context','parentName':_0x57ffcf['parentSegment'],'targetDir':cwd,'configRoot':_0x57ffcf[_0x2952cf(0x1b2)],'isScoped':_0x593440[_0x2952cf(0x1b1)],'scopedFolderPath':_0x593440[_0x2952cf(0x19c)]};}if(_0x1affc1){const _0x4eb181=sanitizeFileName(_0x1affc1),_0x4de1ed=getSegmentRootDir(_0x4eb181,cwd);return{'type':_0x2952cf(0x199),'parentName':_0x1affc1,'targetDir':_0x4de1ed,'configRoot':_0x4de1ed,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x2952cf(0x1c1),'errorCode':'no_parent','message':'Parent\x20segment\x20not\x20specified','helpText':_0x2952cf(0x1a5)};}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"target-resolution.js","sourceRoot":"","sources":["../../../src/sdk/segment/target-resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,cAAc,EACd,mBAAmB,GAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAsIpD,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAA8B;IAM9B,OAAO,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAA8B;IAE9B,OAAO,CACL,MAAM,CAAC,IAAI,KAAK,WAAW;QAC3B,MAAM,CAAC,IAAI,KAAK,MAAM;QACtB,MAAM,CAAC,IAAI,KAAK,SAAS,CAC1B,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAA8B;IAE9B,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAClF,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;GAEG;AACH,KAAK,UAAU,kBAAkB,CAC/B,QAAgB,EAChB,EAAc;IAEd,IAAI,UAAU,GAAG,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WAAW;QACtB,OAAO,EAAE,8BAA8B;QACvC,QAAQ,EAAE,kHAAkH;KAC7H,CAAC;AACJ,CAAC"}
@@ -52,6 +52,14 @@ export declare function loadTdxConfig(configPath: string): TdxConfig;
52
52
  * @throws Error if tdx.json is not found or invalid
53
53
  */
54
54
  export declare function findTdxConfig(startDir?: string): TdxConfigResult;
55
+ /**
56
+ * Try to find tdx.json without throwing.
57
+ * Returns null if not found instead of throwing an error.
58
+ *
59
+ * @param startDir - Directory to start searching from
60
+ * @returns Configuration result or null if not found
61
+ */
62
+ export declare function tryFindTdxConfig(startDir: string): TdxConfigResult | null;
55
63
  /**
56
64
  * Get the segments directory path for a root folder
57
65
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tdx-config.d.ts","sourceRoot":"","sources":["../../../src/sdk/segment/tdx-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,6CAA6C;IAC7C,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,MAAM,EAAE,SAAS,CAAC;IAClB,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;CACnB;AAKD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,GAAG,IAAI,CAajF;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAuB3D;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,QAAQ,GAAE,MAAsB,GAAG,eAAe,CAiB/E;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAMzE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,MAAsB,GAAG,MAAM,CAE7F;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,MAAsB,GAAG,MAAM,CAE5F;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAUvF;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAUhE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAKvF;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAKxE"}
@@ -0,0 +1 @@
1
+ const a102_0x2c3147=a102_0x3588;(function(_0x3fb225,_0x5b66e8){const _0x26d5d9=a102_0x3588,_0x38e9ec=_0x3fb225();while(!![]){try{const _0x12977b=-parseInt(_0x26d5d9(0x89))/0x1+-parseInt(_0x26d5d9(0x7f))/0x2+parseInt(_0x26d5d9(0x7e))/0x3+-parseInt(_0x26d5d9(0x7d))/0x4*(parseInt(_0x26d5d9(0x85))/0x5)+-parseInt(_0x26d5d9(0x90))/0x6+-parseInt(_0x26d5d9(0x82))/0x7*(parseInt(_0x26d5d9(0x81))/0x8)+parseInt(_0x26d5d9(0x7a))/0x9;if(_0x12977b===_0x5b66e8)break;else _0x38e9ec['push'](_0x38e9ec['shift']());}catch(_0x4f86b5){_0x38e9ec['push'](_0x38e9ec['shift']());}}}(a102_0x2f29,0xa999e));import{existsSync,readFileSync}from'fs';import a102_0x18c5e5 from'path';const TDX_CONFIG_FILE=a102_0x2c3147(0x8a),SEGMENTS_DIR=a102_0x2c3147(0x8b);function a102_0x3588(_0x357b12,_0x55e62f){_0x357b12=_0x357b12-0x79;const _0x2f2951=a102_0x2f29();let _0x358836=_0x2f2951[_0x357b12];return _0x358836;}export function findTdxConfigPath(_0x3c2020=process[a102_0x2c3147(0x79)]()){const _0x313baa=a102_0x2c3147;let _0x4e9c24=a102_0x18c5e5['resolve'](_0x3c2020);const _0xedb6df=a102_0x18c5e5['parse'](_0x4e9c24)['root'];while(_0x4e9c24!==_0xedb6df){const _0x112f70=a102_0x18c5e5[_0x313baa(0x8d)](_0x4e9c24,TDX_CONFIG_FILE);if(existsSync(_0x112f70))return _0x112f70;_0x4e9c24=a102_0x18c5e5[_0x313baa(0x91)](_0x4e9c24);}return null;}export function loadTdxConfig(_0xad41c6){const _0x3eba9f=a102_0x2c3147,_0x22ce22=readFileSync(_0xad41c6,_0x3eba9f(0x87));let _0x22eaa5;try{_0x22eaa5=JSON[_0x3eba9f(0x8e)](_0x22ce22);}catch{throw new Error(_0x3eba9f(0x83)+_0xad41c6);}if(!_0x22eaa5||typeof _0x22eaa5!==_0x3eba9f(0x8c))throw new Error(_0x3eba9f(0x84));const _0x74a8a3=_0x22eaa5;if(!_0x74a8a3[_0x3eba9f(0x8f)]||typeof _0x74a8a3['parent_segment']!=='string')throw new Error(_0x3eba9f(0x88));return{'parent_segment':_0x74a8a3['parent_segment']};}export function findTdxConfig(_0x98d9d4=process[a102_0x2c3147(0x79)]()){const _0x477761=a102_0x2c3147,_0x2e507c=findTdxConfigPath(_0x98d9d4);if(!_0x2e507c)throw new Error(_0x477761(0x80));const _0x3fdb72=loadTdxConfig(_0x2e507c),_0x35799a=a102_0x18c5e5[_0x477761(0x91)](_0x2e507c);return{'config':_0x3fdb72,'configPath':_0x2e507c,'configDir':_0x35799a};}export function tryFindTdxConfig(_0x18c293){try{return findTdxConfig(_0x18c293);}catch{return null;}}function a102_0x2f29(){const _0x365be0=['tdx.json','segments','object','join','parse','parent_segment','2541852PhBjsa','dirname','cwd','28756548mXnlpD','replace','stringify','644RpziHe','642870rQJtLl','903196KjjPpT','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','32YcjhIj','17710HkbwKL','Invalid\x20JSON\x20in\x20','Invalid\x20tdx.json:\x20expected\x20object','15920JHrQGp','relative','utf-8','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','1316792UZhwRf'];a102_0x2f29=function(){return _0x365be0;};return a102_0x2f29();}export function getSegmentRootDir(_0xfbc21b,_0x18e0de=process[a102_0x2c3147(0x79)]()){const _0x24be61=a102_0x2c3147;return a102_0x18c5e5[_0x24be61(0x8d)](_0x18e0de,SEGMENTS_DIR,_0xfbc21b);}export function getTdxConfigPath(_0x416d82,_0x29cbb1=process['cwd']()){const _0x50f3b2=a102_0x2c3147;return a102_0x18c5e5[_0x50f3b2(0x8d)](getSegmentRootDir(_0x416d82,_0x29cbb1),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x3ae8f3,_0x4002c0){const _0x332a7d=a102_0x2c3147,_0x36972e=a102_0x18c5e5['resolve'](_0x3ae8f3),_0x325182=a102_0x18c5e5[_0x332a7d(0x86)](_0x4002c0,_0x36972e);if(_0x325182['startsWith']('..'))return'';return _0x325182;}export function localPathToTdFolderPath(_0x531a63){const _0x37b1b0=a102_0x2c3147,_0x227f20=a102_0x18c5e5[_0x37b1b0(0x91)](_0x531a63);if(_0x227f20==='.'||_0x227f20==='')return'';return _0x227f20[_0x37b1b0(0x7b)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0xe4f79d,_0x2fecea){const _0x4067de=a102_0x2c3147;if(!_0xe4f79d)return _0x2fecea;return a102_0x18c5e5[_0x4067de(0x8d)](_0x2fecea,_0xe4f79d);}export function createTdxConfigContent(_0x509349){const _0x6f1392=a102_0x2c3147,_0x5447d1={'parent_segment':_0x509349};return JSON[_0x6f1392(0x7c)](_0x5447d1,null,0x2)+'\x0a';}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tdx-config.js","sourceRoot":"","sources":["../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+ * These types represent the portable, human-readable format for journey configurations.
5
+ * They use names instead of IDs where possible for human readability.
6
+ *
7
+ * @module
8
+ */
9
+ import type { RuleDef, ActivationDef } from './segment-def.js';
10
+ /**
11
+ * Journey state
12
+ */
13
+ export type JourneyStateType = 'draft' | 'simulation' | 'launched';
14
+ /**
15
+ * Reentry mode for journeys
16
+ */
17
+ export type ReentryModeType = 'no_reentry' | 'reentry_unless_goal_achieved' | 'reentry_always';
18
+ /**
19
+ * Wait unit for timing
20
+ */
21
+ export type WaitUnitType = 'day' | 'week';
22
+ /**
23
+ * Step type
24
+ */
25
+ export type StepTypeValue = 'wait' | 'activation' | 'decision_point' | 'ab_test' | 'merge' | 'jump' | 'end';
26
+ /**
27
+ * Base step definition
28
+ */
29
+ export interface StepBaseDef {
30
+ /** Step type - always comes first */
31
+ type: StepTypeValue;
32
+ /** Step name - used as identifier (human-readable) */
33
+ name: string;
34
+ /** UUID for step (internal, used during API conversion) */
35
+ uuid?: string;
36
+ /** Next step name or UUID (omitted for 'end' type) */
37
+ next?: string;
38
+ }
39
+ /**
40
+ * Wait condition timeout definition
41
+ */
42
+ export interface WaitConditionTimeoutDef {
43
+ duration: number;
44
+ unit: WaitUnitType;
45
+ next?: string;
46
+ }
47
+ /**
48
+ * Wait condition definition
49
+ */
50
+ export interface WaitConditionDef {
51
+ /** Segment name or ref:name for the condition */
52
+ segment: string;
53
+ /** Next step on condition match */
54
+ next?: string;
55
+ /** Timeout configuration */
56
+ timeout?: WaitConditionTimeoutDef;
57
+ }
58
+ /**
59
+ * Wait step parameters
60
+ */
61
+ export interface WaitStepParamsDef {
62
+ /** Duration to wait */
63
+ duration?: number;
64
+ /** Time unit (day or week) */
65
+ unit?: WaitUnitType;
66
+ /** Wait until specific date */
67
+ wait_until?: string;
68
+ /** Wait until condition is met */
69
+ condition?: WaitConditionDef;
70
+ /** Days of the week to wait for */
71
+ days_of_week?: string[];
72
+ }
73
+ /**
74
+ * Wait step definition
75
+ */
76
+ export interface WaitStepDef extends StepBaseDef {
77
+ type: 'wait';
78
+ /** Step-specific parameters */
79
+ with: WaitStepParamsDef;
80
+ }
81
+ /**
82
+ * Activation step parameters
83
+ */
84
+ export interface ActivationStepParamsDef {
85
+ /** Activation name or reference */
86
+ activation: string;
87
+ }
88
+ /**
89
+ * Activation step definition
90
+ */
91
+ export interface ActivationStepDef extends StepBaseDef {
92
+ type: 'activation';
93
+ /** Step-specific parameters */
94
+ with: ActivationStepParamsDef;
95
+ }
96
+ /**
97
+ * Decision branch definition
98
+ */
99
+ export interface DecisionBranchDef {
100
+ name: string;
101
+ /** Segment name or ref:name */
102
+ segment?: string;
103
+ /** Internal segment ID (resolved) */
104
+ segment_id?: string;
105
+ /** Whether this is the excluded/else branch */
106
+ excluded?: boolean;
107
+ next?: string;
108
+ }
109
+ /**
110
+ * Decision point step parameters
111
+ */
112
+ export interface DecisionPointStepParamsDef {
113
+ branches: DecisionBranchDef[];
114
+ }
115
+ /**
116
+ * Decision point step definition
117
+ */
118
+ export interface DecisionPointStepDef extends StepBaseDef {
119
+ type: 'decision_point';
120
+ /** Step-specific parameters */
121
+ with: DecisionPointStepParamsDef;
122
+ }
123
+ /**
124
+ * A/B test variant definition
125
+ */
126
+ export interface AbTestVariantDef {
127
+ id?: string;
128
+ name: string;
129
+ percentage: number;
130
+ next?: string;
131
+ }
132
+ /**
133
+ * A/B test step parameters
134
+ */
135
+ export interface AbTestStepParamsDef {
136
+ variants: AbTestVariantDef[];
137
+ /** Unique ID for consistent test assignment */
138
+ unique_id?: string;
139
+ /** Whether splits are customized vs equal */
140
+ customized_split?: boolean;
141
+ }
142
+ /**
143
+ * A/B test step definition
144
+ */
145
+ export interface AbTestStepDef extends StepBaseDef {
146
+ type: 'ab_test';
147
+ /** Step-specific parameters */
148
+ with: AbTestStepParamsDef;
149
+ }
150
+ /**
151
+ * Merge step definition
152
+ */
153
+ export interface MergeStepDef extends StepBaseDef {
154
+ type: 'merge';
155
+ }
156
+ /**
157
+ * Jump target definition
158
+ */
159
+ export interface JumpTargetDef {
160
+ /** Target journey name or ID */
161
+ journey: string;
162
+ /** Target stage name */
163
+ stage: string;
164
+ /** Journey bundle ID (optional, for versioned journeys) */
165
+ bundle_id?: string;
166
+ }
167
+ /**
168
+ * Jump step parameters
169
+ */
170
+ export interface JumpStepParamsDef {
171
+ target: JumpTargetDef;
172
+ }
173
+ /**
174
+ * Jump step definition
175
+ */
176
+ export interface JumpStepDef extends StepBaseDef {
177
+ type: 'jump';
178
+ /** Step-specific parameters */
179
+ with: JumpStepParamsDef;
180
+ }
181
+ /**
182
+ * End step definition
183
+ */
184
+ export interface EndStepDef extends StepBaseDef {
185
+ type: 'end';
186
+ }
187
+ /**
188
+ * Union of all step types
189
+ */
190
+ export type StepDef = WaitStepDef | ActivationStepDef | DecisionPointStepDef | AbTestStepDef | MergeStepDef | JumpStepDef | EndStepDef;
191
+ /**
192
+ * Journey criteria definition (entry/exit/goal/milestone)
193
+ */
194
+ export interface CriteriaDef {
195
+ /** Display name */
196
+ name: string;
197
+ /** Description */
198
+ description?: string;
199
+ /**
200
+ * Segment reference - can be:
201
+ * - Name of embedded segment (defined in journey's `segments` section)
202
+ * - "ref:Segment Name" to reference an existing child segment
203
+ * - Segment ID (internal, for API compatibility)
204
+ */
205
+ segment: string;
206
+ /** Optional jump target when criteria is met */
207
+ target?: JumpTargetDef;
208
+ }
209
+ /**
210
+ * Journey stage definition
211
+ */
212
+ export interface StageDef {
213
+ /** Stage name */
214
+ name: string;
215
+ /** Stage description */
216
+ description?: string;
217
+ /**
218
+ * Stage ID (from API, used for updates)
219
+ * @internal Not included in user-facing YAML output
220
+ */
221
+ id?: string;
222
+ /** Entry criteria - who enters this stage */
223
+ entry_criteria?: CriteriaDef;
224
+ /** Exit criteria - when to remove from stage */
225
+ exit_criteria?: CriteriaDef[];
226
+ /** Milestone - tracking point */
227
+ milestone?: CriteriaDef;
228
+ /** Root step UUID (entry point) */
229
+ root_step?: string;
230
+ /** Steps in this stage */
231
+ steps?: StepDef[];
232
+ }
233
+ /**
234
+ * Embedded segment definition for journey-local segments.
235
+ * These segments are created when the journey is launched and are scoped to the journey.
236
+ *
237
+ * Segment names should be kebab-case identifiers (e.g., "high-value-customers").
238
+ */
239
+ export interface EmbeddedSegmentDef {
240
+ /** Segment description */
241
+ description?: string;
242
+ /** Filtering rule that defines the segment criteria */
243
+ rule: RuleDef;
244
+ }
245
+ /**
246
+ * Journey entry definition for the unified 'journeys' array format.
247
+ * Each entry represents a version of the journey with its own stages.
248
+ * Shared properties (goal, reentry, segments) can be inherited from top-level
249
+ * or overridden per-entry.
250
+ */
251
+ export interface JourneyEntryDef {
252
+ /**
253
+ * Version name (e.g., "v1", "v2") - used in YamlJourneyVersion (legacy format).
254
+ * For unified format, use `version` instead.
255
+ */
256
+ name?: string;
257
+ /**
258
+ * Version identifier (e.g., "v1", "v2").
259
+ * Optional - defaults to "v1" for single-version journeys.
260
+ */
261
+ version?: string;
262
+ /** Version state */
263
+ state?: JourneyStateType;
264
+ /**
265
+ * Whether this is the currently active (latest) version.
266
+ * Only one entry should have latest=true.
267
+ * Default: false (omit if false)
268
+ */
269
+ latest?: boolean;
270
+ /** Version-specific stages (1-8) */
271
+ stages: StageDef[];
272
+ /**
273
+ * Journey ID for this entry (from API, used for updates)
274
+ * @internal Not included in user-facing YAML output
275
+ */
276
+ id?: string;
277
+ /** Version number from API */
278
+ version_number?: number;
279
+ /** Override goal for this version */
280
+ goal?: CriteriaDef;
281
+ /** Override reentry mode for this version */
282
+ reentry?: ReentryModeType;
283
+ }
284
+ /**
285
+ * Complete journey definition - portable format
286
+ */
287
+ export interface JourneyDef {
288
+ /** Resource type discriminator - always 'journey' */
289
+ type: 'journey';
290
+ /** Journey bundle name */
291
+ name: string;
292
+ /** Journey description */
293
+ description?: string;
294
+ /** Journey bundle ID (internal use) */
295
+ bundle_id?: string;
296
+ /** Journey bundle name (alternative to name) */
297
+ bundle_name?: string;
298
+ /** Folder ID (internal use) */
299
+ folder_id?: string;
300
+ /** Reentry mode (top-level default) */
301
+ reentry?: ReentryModeType;
302
+ /** Allow reentry (legacy field) */
303
+ allow_reentry?: boolean;
304
+ /** Goal criteria (top-level default) */
305
+ goal?: CriteriaDef;
306
+ /** Single-version mode: journey ID */
307
+ id?: string;
308
+ /** Single-version mode: version name */
309
+ version?: string;
310
+ /** Single-version mode: version number */
311
+ version_number?: number;
312
+ /** Single-version mode: stages directly */
313
+ stages?: StageDef[];
314
+ /** Multi-version mode: legacy format */
315
+ versions?: JourneyEntryDef[];
316
+ /** Multi-version mode: unified format (recommended) */
317
+ journeys?: JourneyEntryDef[];
318
+ /** Embedded segments (journey-local) */
319
+ segments?: Record<string, EmbeddedSegmentDef>;
320
+ /** Embedded activations (journey-local) */
321
+ activations?: Record<string, ActivationDef>;
322
+ }
323
+ //# sourceMappingURL=journey-def.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journey-def.d.ts","sourceRoot":"","sources":["../../../../src/sdk/segment/types/journey-def.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAM/D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,YAAY,GAAG,UAAU,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,8BAA8B,GAAG,gBAAgB,CAAC;AAE/F;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,MAAM,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,YAAY,GACZ,gBAAgB,GAChB,SAAS,GACT,OAAO,GACP,MAAM,GACN,KAAK,CAAC;AAMV;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,qCAAqC;IACrC,IAAI,EAAE,aAAa,CAAC;IACpB,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,IAAI,CAAC,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