typekro 0.28.0 → 0.29.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 (674) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/advanced/index.d.ts +5 -1
  3. package/dist/advanced/index.d.ts.map +1 -1
  4. package/dist/advanced/index.js +2 -3
  5. package/dist/advanced/index.js.map +1 -1
  6. package/dist/alchemy/deployers.d.ts +6 -4
  7. package/dist/alchemy/deployers.d.ts.map +1 -1
  8. package/dist/alchemy/deployers.js +46 -9
  9. package/dist/alchemy/deployers.js.map +1 -1
  10. package/dist/alchemy/index.d.ts +2 -3
  11. package/dist/alchemy/index.d.ts.map +1 -1
  12. package/dist/alchemy/index.js +1 -1
  13. package/dist/alchemy/index.js.map +1 -1
  14. package/dist/alchemy/kro-delete.d.ts +6 -5
  15. package/dist/alchemy/kro-delete.d.ts.map +1 -1
  16. package/dist/alchemy/kro-delete.js +169 -22
  17. package/dist/alchemy/kro-delete.js.map +1 -1
  18. package/dist/alchemy/resource-registration.d.ts +24 -31
  19. package/dist/alchemy/resource-registration.d.ts.map +1 -1
  20. package/dist/alchemy/resource-registration.js +439 -75
  21. package/dist/alchemy/resource-registration.js.map +1 -1
  22. package/dist/alchemy/types.d.ts +56 -14
  23. package/dist/alchemy/types.d.ts.map +1 -1
  24. package/dist/alchemy/utilities.d.ts +2 -2
  25. package/dist/alchemy/utilities.d.ts.map +1 -1
  26. package/dist/compositions/typekro-runtime/typekro-runtime.d.ts.map +1 -1
  27. package/dist/compositions/typekro-runtime/typekro-runtime.js +31 -28
  28. package/dist/compositions/typekro-runtime/typekro-runtime.js.map +1 -1
  29. package/dist/compositions/typekro-runtime/types.d.ts +12 -0
  30. package/dist/compositions/typekro-runtime/types.d.ts.map +1 -1
  31. package/dist/core/composition/analysis-metadata.d.ts +15 -0
  32. package/dist/core/composition/analysis-metadata.d.ts.map +1 -0
  33. package/dist/core/composition/analysis-metadata.js +20 -0
  34. package/dist/core/composition/analysis-metadata.js.map +1 -0
  35. package/dist/core/composition/imperative.d.ts.map +1 -1
  36. package/dist/core/composition/imperative.js +38 -9
  37. package/dist/core/composition/imperative.js.map +1 -1
  38. package/dist/core/composition/nested-status-cel.js +3 -3
  39. package/dist/core/composition/nested-status-cel.js.map +1 -1
  40. package/dist/core/constants/brands.d.ts +1 -1
  41. package/dist/core/constants/brands.d.ts.map +1 -1
  42. package/dist/core/constants/brands.js +1 -1
  43. package/dist/core/constants/brands.js.map +1 -1
  44. package/dist/core/dependencies/resolver.d.ts +3 -1
  45. package/dist/core/dependencies/resolver.d.ts.map +1 -1
  46. package/dist/core/dependencies/resolver.js +29 -13
  47. package/dist/core/dependencies/resolver.js.map +1 -1
  48. package/dist/core/deployment/deletion-result.d.ts +22 -0
  49. package/dist/core/deployment/deletion-result.d.ts.map +1 -0
  50. package/dist/core/deployment/deletion-result.js +108 -0
  51. package/dist/core/deployment/deletion-result.js.map +1 -0
  52. package/dist/core/deployment/deployment-state-discovery.d.ts +1 -0
  53. package/dist/core/deployment/deployment-state-discovery.d.ts.map +1 -1
  54. package/dist/core/deployment/deployment-state-discovery.js +89 -9
  55. package/dist/core/deployment/deployment-state-discovery.js.map +1 -1
  56. package/dist/core/deployment/direct-factory.d.ts +46 -25
  57. package/dist/core/deployment/direct-factory.d.ts.map +1 -1
  58. package/dist/core/deployment/direct-factory.js +536 -126
  59. package/dist/core/deployment/direct-factory.js.map +1 -1
  60. package/dist/core/deployment/engine.d.ts +4 -1
  61. package/dist/core/deployment/engine.d.ts.map +1 -1
  62. package/dist/core/deployment/engine.js +105 -34
  63. package/dist/core/deployment/engine.js.map +1 -1
  64. package/dist/core/deployment/errors.d.ts +20 -1
  65. package/dist/core/deployment/errors.d.ts.map +1 -1
  66. package/dist/core/deployment/errors.js +55 -0
  67. package/dist/core/deployment/errors.js.map +1 -1
  68. package/dist/core/deployment/event-monitor.d.ts +4 -3
  69. package/dist/core/deployment/event-monitor.d.ts.map +1 -1
  70. package/dist/core/deployment/event-monitor.js +17 -5
  71. package/dist/core/deployment/event-monitor.js.map +1 -1
  72. package/dist/core/deployment/index.d.ts +1 -1
  73. package/dist/core/deployment/index.d.ts.map +1 -1
  74. package/dist/core/deployment/index.js +1 -1
  75. package/dist/core/deployment/index.js.map +1 -1
  76. package/dist/core/deployment/k8s-helpers.d.ts +1 -1
  77. package/dist/core/deployment/k8s-helpers.d.ts.map +1 -1
  78. package/dist/core/deployment/k8s-helpers.js +11 -5
  79. package/dist/core/deployment/k8s-helpers.js.map +1 -1
  80. package/dist/core/deployment/kro-factory.d.ts +54 -30
  81. package/dist/core/deployment/kro-factory.d.ts.map +1 -1
  82. package/dist/core/deployment/kro-factory.js +2002 -259
  83. package/dist/core/deployment/kro-factory.js.map +1 -1
  84. package/dist/core/deployment/kro-instance-admission.d.ts +17 -0
  85. package/dist/core/deployment/kro-instance-admission.d.ts.map +1 -0
  86. package/dist/core/deployment/kro-instance-admission.js +73 -0
  87. package/dist/core/deployment/kro-instance-admission.js.map +1 -0
  88. package/dist/core/deployment/kro-instance-safety.d.ts +0 -3
  89. package/dist/core/deployment/kro-instance-safety.d.ts.map +1 -1
  90. package/dist/core/deployment/kro-instance-safety.js +0 -11
  91. package/dist/core/deployment/kro-instance-safety.js.map +1 -1
  92. package/dist/core/deployment/kro-namespace-teardown.d.ts +63 -5
  93. package/dist/core/deployment/kro-namespace-teardown.d.ts.map +1 -1
  94. package/dist/core/deployment/kro-namespace-teardown.js +124 -12
  95. package/dist/core/deployment/kro-namespace-teardown.js.map +1 -1
  96. package/dist/core/deployment/kro-readiness.d.ts +2 -0
  97. package/dist/core/deployment/kro-readiness.d.ts.map +1 -1
  98. package/dist/core/deployment/kro-readiness.js +50 -8
  99. package/dist/core/deployment/kro-readiness.js.map +1 -1
  100. package/dist/core/deployment/poll-timeout.d.ts +45 -0
  101. package/dist/core/deployment/poll-timeout.d.ts.map +1 -0
  102. package/dist/core/deployment/poll-timeout.js +78 -0
  103. package/dist/core/deployment/poll-timeout.js.map +1 -0
  104. package/dist/core/deployment/readiness.d.ts.map +1 -1
  105. package/dist/core/deployment/readiness.js +30 -21
  106. package/dist/core/deployment/readiness.js.map +1 -1
  107. package/dist/core/deployment/resource-applier.d.ts +19 -3
  108. package/dist/core/deployment/resource-applier.d.ts.map +1 -1
  109. package/dist/core/deployment/resource-applier.js +263 -44
  110. package/dist/core/deployment/resource-applier.js.map +1 -1
  111. package/dist/core/deployment/rollback-manager.d.ts +6 -1
  112. package/dist/core/deployment/rollback-manager.d.ts.map +1 -1
  113. package/dist/core/deployment/rollback-manager.js +38 -12
  114. package/dist/core/deployment/rollback-manager.js.map +1 -1
  115. package/dist/core/deployment/schema-cel-evaluator.d.ts.map +1 -1
  116. package/dist/core/deployment/schema-cel-evaluator.js +63 -0
  117. package/dist/core/deployment/schema-cel-evaluator.js.map +1 -1
  118. package/dist/core/deployment/shared-utilities.d.ts +11 -6
  119. package/dist/core/deployment/shared-utilities.d.ts.map +1 -1
  120. package/dist/core/deployment/shared-utilities.js +169 -14
  121. package/dist/core/deployment/shared-utilities.js.map +1 -1
  122. package/dist/core/deployment/singleton-gitops.d.ts.map +1 -1
  123. package/dist/core/deployment/singleton-gitops.js +0 -2
  124. package/dist/core/deployment/singleton-gitops.js.map +1 -1
  125. package/dist/core/deployment/singleton-owner-drift.d.ts +11 -2
  126. package/dist/core/deployment/singleton-owner-drift.d.ts.map +1 -1
  127. package/dist/core/deployment/singleton-owner-drift.js +30 -13
  128. package/dist/core/deployment/singleton-owner-drift.js.map +1 -1
  129. package/dist/core/deployment/strategies/base-strategy.d.ts +2 -0
  130. package/dist/core/deployment/strategies/base-strategy.d.ts.map +1 -1
  131. package/dist/core/deployment/strategies/base-strategy.js +19 -2
  132. package/dist/core/deployment/strategies/base-strategy.js.map +1 -1
  133. package/dist/core/deployment/strategies/direct-strategy.d.ts +3 -0
  134. package/dist/core/deployment/strategies/direct-strategy.d.ts.map +1 -1
  135. package/dist/core/deployment/strategies/direct-strategy.js +31 -8
  136. package/dist/core/deployment/strategies/direct-strategy.js.map +1 -1
  137. package/dist/core/deployment/strategies/index.d.ts +1 -1
  138. package/dist/core/deployment/strategies/index.d.ts.map +1 -1
  139. package/dist/core/deployment/strategies/index.js +1 -1
  140. package/dist/core/deployment/strategies/index.js.map +1 -1
  141. package/dist/core/errors.d.ts +2 -2
  142. package/dist/core/errors.d.ts.map +1 -1
  143. package/dist/core/errors.js.map +1 -1
  144. package/dist/core/expressions/analysis/cel-emitter.d.ts.map +1 -1
  145. package/dist/core/expressions/analysis/cel-emitter.js +17 -13
  146. package/dist/core/expressions/analysis/cel-emitter.js.map +1 -1
  147. package/dist/core/expressions/analysis/expression-metadata.d.ts +15 -0
  148. package/dist/core/expressions/analysis/expression-metadata.d.ts.map +1 -0
  149. package/dist/core/expressions/analysis/expression-metadata.js +10 -0
  150. package/dist/core/expressions/analysis/expression-metadata.js.map +1 -0
  151. package/dist/core/expressions/analysis/ready-when.d.ts +3 -0
  152. package/dist/core/expressions/analysis/ready-when.d.ts.map +1 -0
  153. package/dist/core/expressions/analysis/ready-when.js +127 -0
  154. package/dist/core/expressions/analysis/ready-when.js.map +1 -0
  155. package/dist/core/expressions/composition/composition-analyzer-helpers.d.ts +3 -2
  156. package/dist/core/expressions/composition/composition-analyzer-helpers.d.ts.map +1 -1
  157. package/dist/core/expressions/composition/composition-analyzer-helpers.js +6 -4
  158. package/dist/core/expressions/composition/composition-analyzer-helpers.js.map +1 -1
  159. package/dist/core/expressions/composition/composition-analyzer-ternary.d.ts +3 -2
  160. package/dist/core/expressions/composition/composition-analyzer-ternary.d.ts.map +1 -1
  161. package/dist/core/expressions/composition/composition-analyzer-ternary.js +12 -12
  162. package/dist/core/expressions/composition/composition-analyzer-ternary.js.map +1 -1
  163. package/dist/core/expressions/composition/composition-analyzer-traversal.d.ts.map +1 -1
  164. package/dist/core/expressions/composition/composition-analyzer-traversal.js +68 -4
  165. package/dist/core/expressions/composition/composition-analyzer-traversal.js.map +1 -1
  166. package/dist/core/expressions/composition/composition-analyzer-types.d.ts +2 -0
  167. package/dist/core/expressions/composition/composition-analyzer-types.d.ts.map +1 -1
  168. package/dist/core/expressions/composition/composition-analyzer.d.ts.map +1 -1
  169. package/dist/core/expressions/composition/composition-analyzer.js +2 -0
  170. package/dist/core/expressions/composition/composition-analyzer.js.map +1 -1
  171. package/dist/core/expressions/factory/status-builder-analyzer.d.ts.map +1 -1
  172. package/dist/core/expressions/factory/status-builder-analyzer.js +14 -1
  173. package/dist/core/expressions/factory/status-builder-analyzer.js.map +1 -1
  174. package/dist/core/kubernetes/api.d.ts.map +1 -1
  175. package/dist/core/kubernetes/api.js +2 -3
  176. package/dist/core/kubernetes/api.js.map +1 -1
  177. package/dist/core/kubernetes/bun-api-client.d.ts +1 -1
  178. package/dist/core/kubernetes/bun-api-client.d.ts.map +1 -1
  179. package/dist/core/kubernetes/bun-api-client.js +17 -17
  180. package/dist/core/kubernetes/bun-api-client.js.map +1 -1
  181. package/dist/core/kubernetes/bun-http-library.d.ts +16 -0
  182. package/dist/core/kubernetes/bun-http-library.d.ts.map +1 -1
  183. package/dist/core/kubernetes/bun-http-library.js +7 -1
  184. package/dist/core/kubernetes/bun-http-library.js.map +1 -1
  185. package/dist/core/kubernetes/bun-watch.d.ts +30 -0
  186. package/dist/core/kubernetes/bun-watch.d.ts.map +1 -0
  187. package/dist/core/kubernetes/bun-watch.js +144 -0
  188. package/dist/core/kubernetes/bun-watch.js.map +1 -0
  189. package/dist/core/kubernetes/client-node-runtime.d.ts +10 -0
  190. package/dist/core/kubernetes/client-node-runtime.d.ts.map +1 -0
  191. package/dist/core/kubernetes/client-node-runtime.js +15 -0
  192. package/dist/core/kubernetes/client-node-runtime.js.map +1 -0
  193. package/dist/core/kubernetes/client-provider.d.ts +21 -1
  194. package/dist/core/kubernetes/client-provider.d.ts.map +1 -1
  195. package/dist/core/kubernetes/client-provider.js +10 -10
  196. package/dist/core/kubernetes/client-provider.js.map +1 -1
  197. package/dist/core/kubernetes/index.d.ts +1 -1
  198. package/dist/core/kubernetes/index.d.ts.map +1 -1
  199. package/dist/core/kubernetes/index.js.map +1 -1
  200. package/dist/core/metadata/resource-metadata.d.ts +24 -1
  201. package/dist/core/metadata/resource-metadata.d.ts.map +1 -1
  202. package/dist/core/metadata/resource-metadata.js +8 -4
  203. package/dist/core/metadata/resource-metadata.js.map +1 -1
  204. package/dist/core/planning/artifact-codec.d.ts +14 -0
  205. package/dist/core/planning/artifact-codec.d.ts.map +1 -0
  206. package/dist/core/planning/artifact-codec.js +329 -0
  207. package/dist/core/planning/artifact-codec.js.map +1 -0
  208. package/dist/core/planning/artifacts.d.ts +212 -0
  209. package/dist/core/planning/artifacts.d.ts.map +1 -0
  210. package/dist/core/planning/artifacts.js +5 -0
  211. package/dist/core/planning/artifacts.js.map +1 -0
  212. package/dist/core/planning/aspects.d.ts +11 -0
  213. package/dist/core/planning/aspects.d.ts.map +1 -0
  214. package/dist/core/planning/aspects.js +77 -0
  215. package/dist/core/planning/aspects.js.map +1 -0
  216. package/dist/core/planning/canonical.d.ts +10 -0
  217. package/dist/core/planning/canonical.d.ts.map +1 -0
  218. package/dist/core/planning/canonical.js +54 -0
  219. package/dist/core/planning/canonical.js.map +1 -0
  220. package/dist/core/planning/capabilities.d.ts +16 -0
  221. package/dist/core/planning/capabilities.d.ts.map +1 -0
  222. package/dist/core/planning/capabilities.js +90 -0
  223. package/dist/core/planning/capabilities.js.map +1 -0
  224. package/dist/core/planning/capture.d.ts +29 -0
  225. package/dist/core/planning/capture.d.ts.map +1 -0
  226. package/dist/core/planning/capture.js +18 -0
  227. package/dist/core/planning/capture.js.map +1 -0
  228. package/dist/core/planning/compiler.d.ts +12 -0
  229. package/dist/core/planning/compiler.d.ts.map +1 -0
  230. package/dist/core/planning/compiler.js +631 -0
  231. package/dist/core/planning/compiler.js.map +1 -0
  232. package/dist/core/planning/direct-runtime-adapter.d.ts +39 -0
  233. package/dist/core/planning/direct-runtime-adapter.d.ts.map +1 -0
  234. package/dist/core/planning/direct-runtime-adapter.js +238 -0
  235. package/dist/core/planning/direct-runtime-adapter.js.map +1 -0
  236. package/dist/core/planning/execution-record.d.ts +21 -0
  237. package/dist/core/planning/execution-record.d.ts.map +1 -0
  238. package/dist/core/planning/execution-record.js +304 -0
  239. package/dist/core/planning/execution-record.js.map +1 -0
  240. package/dist/core/planning/index.d.ts +20 -0
  241. package/dist/core/planning/index.d.ts.map +1 -0
  242. package/dist/core/planning/index.js +18 -0
  243. package/dist/core/planning/index.js.map +1 -0
  244. package/dist/core/planning/kro-bundle.d.ts +24 -0
  245. package/dist/core/planning/kro-bundle.d.ts.map +1 -0
  246. package/dist/core/planning/kro-bundle.js +314 -0
  247. package/dist/core/planning/kro-bundle.js.map +1 -0
  248. package/dist/core/planning/kro-runtime-adapter.d.ts +28 -0
  249. package/dist/core/planning/kro-runtime-adapter.d.ts.map +1 -0
  250. package/dist/core/planning/kro-runtime-adapter.js +211 -0
  251. package/dist/core/planning/kro-runtime-adapter.js.map +1 -0
  252. package/dist/core/planning/materialization.d.ts +54 -0
  253. package/dist/core/planning/materialization.d.ts.map +1 -0
  254. package/dist/core/planning/materialization.js +489 -0
  255. package/dist/core/planning/materialization.js.map +1 -0
  256. package/dist/core/planning/plan-codec.d.ts +11 -0
  257. package/dist/core/planning/plan-codec.d.ts.map +1 -0
  258. package/dist/core/planning/plan-codec.js +555 -0
  259. package/dist/core/planning/plan-codec.js.map +1 -0
  260. package/dist/core/planning/planner.d.ts +21 -0
  261. package/dist/core/planning/planner.d.ts.map +1 -0
  262. package/dist/core/planning/planner.js +1518 -0
  263. package/dist/core/planning/planner.js.map +1 -0
  264. package/dist/core/planning/schema.d.ts +10 -0
  265. package/dist/core/planning/schema.d.ts.map +1 -0
  266. package/dist/core/planning/schema.js +159 -0
  267. package/dist/core/planning/schema.js.map +1 -0
  268. package/dist/core/planning/types.d.ts +441 -0
  269. package/dist/core/planning/types.d.ts.map +1 -0
  270. package/dist/core/planning/types.js +3 -0
  271. package/dist/core/planning/types.js.map +1 -0
  272. package/dist/core/planning/values.d.ts +76 -0
  273. package/dist/core/planning/values.d.ts.map +1 -0
  274. package/dist/core/planning/values.js +852 -0
  275. package/dist/core/planning/values.js.map +1 -0
  276. package/dist/core/proxy/create-resource.d.ts +12 -0
  277. package/dist/core/proxy/create-resource.d.ts.map +1 -1
  278. package/dist/core/proxy/create-resource.js +39 -9
  279. package/dist/core/proxy/create-resource.js.map +1 -1
  280. package/dist/core/readiness/evaluator-factories.d.ts +3 -1
  281. package/dist/core/readiness/evaluator-factories.d.ts.map +1 -1
  282. package/dist/core/readiness/evaluator-factories.js +130 -5
  283. package/dist/core/readiness/evaluator-factories.js.map +1 -1
  284. package/dist/core/readiness/index.d.ts +2 -1
  285. package/dist/core/readiness/index.d.ts.map +1 -1
  286. package/dist/core/readiness/index.js +2 -1
  287. package/dist/core/readiness/index.js.map +1 -1
  288. package/dist/core/readiness/portable-strategies.d.ts +28 -0
  289. package/dist/core/readiness/portable-strategies.d.ts.map +1 -0
  290. package/dist/core/readiness/portable-strategies.js +55 -0
  291. package/dist/core/readiness/portable-strategies.js.map +1 -0
  292. package/dist/core/readiness/strategy-configuration.d.ts +12 -0
  293. package/dist/core/readiness/strategy-configuration.d.ts.map +1 -0
  294. package/dist/core/readiness/strategy-configuration.js +51 -0
  295. package/dist/core/readiness/strategy-configuration.js.map +1 -0
  296. package/dist/core/references/cel-evaluator.d.ts +5 -0
  297. package/dist/core/references/cel-evaluator.d.ts.map +1 -1
  298. package/dist/core/references/cel-evaluator.js +33 -2
  299. package/dist/core/references/cel-evaluator.js.map +1 -1
  300. package/dist/core/references/external-refs.d.ts +2 -0
  301. package/dist/core/references/external-refs.d.ts.map +1 -1
  302. package/dist/core/references/external-refs.js +3 -1
  303. package/dist/core/references/external-refs.js.map +1 -1
  304. package/dist/core/references/resolver.d.ts +7 -1
  305. package/dist/core/references/resolver.d.ts.map +1 -1
  306. package/dist/core/references/resolver.js +91 -9
  307. package/dist/core/references/resolver.js.map +1 -1
  308. package/dist/core/references/schema-proxy.d.ts.map +1 -1
  309. package/dist/core/references/schema-proxy.js +35 -21
  310. package/dist/core/references/schema-proxy.js.map +1 -1
  311. package/dist/core/resources/factory-registry.d.ts +64 -2
  312. package/dist/core/resources/factory-registry.d.ts.map +1 -1
  313. package/dist/core/resources/factory-registry.js +74 -3
  314. package/dist/core/resources/factory-registry.js.map +1 -1
  315. package/dist/core/resources/index.d.ts +3 -2
  316. package/dist/core/resources/index.d.ts.map +1 -1
  317. package/dist/core/resources/index.js +2 -1
  318. package/dist/core/resources/index.js.map +1 -1
  319. package/dist/core/resources/live-comparison.d.ts +58 -0
  320. package/dist/core/resources/live-comparison.d.ts.map +1 -0
  321. package/dist/core/resources/live-comparison.js +293 -0
  322. package/dist/core/resources/live-comparison.js.map +1 -0
  323. package/dist/core/runtime/standalone-operation.d.ts +12 -0
  324. package/dist/core/runtime/standalone-operation.d.ts.map +1 -0
  325. package/dist/core/runtime/standalone-operation.js +62 -0
  326. package/dist/core/runtime/standalone-operation.js.map +1 -0
  327. package/dist/core/serialization/cel-references.d.ts.map +1 -1
  328. package/dist/core/serialization/cel-references.js +11 -1
  329. package/dist/core/serialization/cel-references.js.map +1 -1
  330. package/dist/core/serialization/core.d.ts.map +1 -1
  331. package/dist/core/serialization/core.js +277 -182
  332. package/dist/core/serialization/core.js.map +1 -1
  333. package/dist/core/serialization/schema.d.ts.map +1 -1
  334. package/dist/core/serialization/schema.js +3 -3
  335. package/dist/core/serialization/schema.js.map +1 -1
  336. package/dist/core/serialization/status-analysis-pipeline.d.ts +1 -1
  337. package/dist/core/serialization/status-analysis-pipeline.d.ts.map +1 -1
  338. package/dist/core/serialization/status-analysis-pipeline.js +14 -11
  339. package/dist/core/serialization/status-analysis-pipeline.js.map +1 -1
  340. package/dist/core/serialization/yaml.d.ts +5 -1
  341. package/dist/core/serialization/yaml.d.ts.map +1 -1
  342. package/dist/core/serialization/yaml.js +35 -182
  343. package/dist/core/serialization/yaml.js.map +1 -1
  344. package/dist/core/types/deployment.d.ts +135 -14
  345. package/dist/core/types/deployment.d.ts.map +1 -1
  346. package/dist/core/types/kubernetes.d.ts +3 -0
  347. package/dist/core/types/kubernetes.d.ts.map +1 -1
  348. package/dist/core/types/resource-graph.d.ts +7 -1
  349. package/dist/core/types/resource-graph.d.ts.map +1 -1
  350. package/dist/core/types/serialization.d.ts +8 -1
  351. package/dist/core/types/serialization.d.ts.map +1 -1
  352. package/dist/core/validation/cel-validator.d.ts.map +1 -1
  353. package/dist/core/validation/cel-validator.js +25 -16
  354. package/dist/core/validation/cel-validator.js.map +1 -1
  355. package/dist/experimental-planning.d.ts +13 -0
  356. package/dist/experimental-planning.d.ts.map +1 -0
  357. package/dist/experimental-planning.js +12 -0
  358. package/dist/experimental-planning.js.map +1 -0
  359. package/dist/factories/apisix/compositions/apisix-bootstrap.d.ts.map +1 -1
  360. package/dist/factories/apisix/compositions/apisix-bootstrap.js +27 -22
  361. package/dist/factories/apisix/compositions/apisix-bootstrap.js.map +1 -1
  362. package/dist/factories/apisix/compositions/apisix-helm-repository.d.ts +15 -0
  363. package/dist/factories/apisix/compositions/apisix-helm-repository.d.ts.map +1 -0
  364. package/dist/factories/apisix/compositions/apisix-helm-repository.js +28 -0
  365. package/dist/factories/apisix/compositions/apisix-helm-repository.js.map +1 -0
  366. package/dist/factories/apisix/compositions/index.d.ts +1 -0
  367. package/dist/factories/apisix/compositions/index.d.ts.map +1 -1
  368. package/dist/factories/apisix/compositions/index.js +1 -0
  369. package/dist/factories/apisix/compositions/index.js.map +1 -1
  370. package/dist/factories/apisix/types.d.ts +22 -0
  371. package/dist/factories/apisix/types.d.ts.map +1 -1
  372. package/dist/factories/apisix/types.js +16 -0
  373. package/dist/factories/apisix/types.js.map +1 -1
  374. package/dist/factories/apisix/utils/admin-credentials.d.ts +1 -0
  375. package/dist/factories/apisix/utils/admin-credentials.d.ts.map +1 -1
  376. package/dist/factories/apisix/utils/admin-credentials.js +5 -4
  377. package/dist/factories/apisix/utils/admin-credentials.js.map +1 -1
  378. package/dist/factories/caddy/compositions/caddy-ingress.d.ts.map +1 -1
  379. package/dist/factories/caddy/compositions/caddy-ingress.js +9 -2
  380. package/dist/factories/caddy/compositions/caddy-ingress.js.map +1 -1
  381. package/dist/factories/cert-manager/compositions/cert-manager-bootstrap.d.ts.map +1 -1
  382. package/dist/factories/cert-manager/compositions/cert-manager-bootstrap.js +11 -25
  383. package/dist/factories/cert-manager/compositions/cert-manager-bootstrap.js.map +1 -1
  384. package/dist/factories/cert-manager/resources/certificates.d.ts.map +1 -1
  385. package/dist/factories/cert-manager/resources/certificates.js +2 -1
  386. package/dist/factories/cert-manager/resources/certificates.js.map +1 -1
  387. package/dist/factories/cert-manager/resources/challenges.d.ts.map +1 -1
  388. package/dist/factories/cert-manager/resources/challenges.js +3 -0
  389. package/dist/factories/cert-manager/resources/challenges.js.map +1 -1
  390. package/dist/factories/cilium/compositions/cilium-bootstrap.d.ts +4 -4
  391. package/dist/factories/cilium/resources/gateway.d.ts.map +1 -1
  392. package/dist/factories/cilium/resources/gateway.js +13 -12
  393. package/dist/factories/cilium/resources/gateway.js.map +1 -1
  394. package/dist/factories/cilium/resources/networking.d.ts.map +1 -1
  395. package/dist/factories/cilium/resources/networking.js +9 -0
  396. package/dist/factories/cilium/resources/networking.js.map +1 -1
  397. package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.d.ts +2 -1
  398. package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.d.ts.map +1 -1
  399. package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.js +2 -6
  400. package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.js.map +1 -1
  401. package/dist/factories/clickhouse/resources/installation.d.ts.map +1 -1
  402. package/dist/factories/clickhouse/resources/installation.js +2 -0
  403. package/dist/factories/clickhouse/resources/installation.js.map +1 -1
  404. package/dist/factories/clickhouse/resources/keeper.d.ts.map +1 -1
  405. package/dist/factories/clickhouse/resources/keeper.js +2 -0
  406. package/dist/factories/clickhouse/resources/keeper.js.map +1 -1
  407. package/dist/factories/clickhouse/types.d.ts +5 -2
  408. package/dist/factories/clickhouse/types.d.ts.map +1 -1
  409. package/dist/factories/clickhouse/types.js +2 -1
  410. package/dist/factories/clickhouse/types.js.map +1 -1
  411. package/dist/factories/clickstack/compositions/k8s-telemetry.d.ts +4 -2
  412. package/dist/factories/clickstack/compositions/k8s-telemetry.d.ts.map +1 -1
  413. package/dist/factories/clickstack/compositions/k8s-telemetry.js +2 -5
  414. package/dist/factories/clickstack/compositions/k8s-telemetry.js.map +1 -1
  415. package/dist/factories/clickstack/types.d.ts +2 -1
  416. package/dist/factories/clickstack/types.d.ts.map +1 -1
  417. package/dist/factories/clickstack/types.js +3 -1
  418. package/dist/factories/clickstack/types.js.map +1 -1
  419. package/dist/factories/cnpg/compositions/cnpg-bootstrap.d.ts +2 -1
  420. package/dist/factories/cnpg/compositions/cnpg-bootstrap.d.ts.map +1 -1
  421. package/dist/factories/cnpg/compositions/cnpg-bootstrap.js +3 -8
  422. package/dist/factories/cnpg/compositions/cnpg-bootstrap.js.map +1 -1
  423. package/dist/factories/cnpg/resources/backup.d.ts.map +1 -1
  424. package/dist/factories/cnpg/resources/backup.js +2 -0
  425. package/dist/factories/cnpg/resources/backup.js.map +1 -1
  426. package/dist/factories/cnpg/resources/cluster.d.ts.map +1 -1
  427. package/dist/factories/cnpg/resources/cluster.js +2 -1
  428. package/dist/factories/cnpg/resources/cluster.js.map +1 -1
  429. package/dist/factories/cnpg/resources/pooler.d.ts.map +1 -1
  430. package/dist/factories/cnpg/resources/pooler.js +2 -0
  431. package/dist/factories/cnpg/resources/pooler.js.map +1 -1
  432. package/dist/factories/cnpg/resources/scheduled-backup.d.ts.map +1 -1
  433. package/dist/factories/cnpg/resources/scheduled-backup.js +2 -1
  434. package/dist/factories/cnpg/resources/scheduled-backup.js.map +1 -1
  435. package/dist/factories/cnpg/types.d.ts +6 -3
  436. package/dist/factories/cnpg/types.d.ts.map +1 -1
  437. package/dist/factories/cnpg/types.js +2 -1
  438. package/dist/factories/cnpg/types.js.map +1 -1
  439. package/dist/factories/dagster/compositions/dagster-bootstrap.d.ts +2 -0
  440. package/dist/factories/dagster/compositions/dagster-bootstrap.d.ts.map +1 -1
  441. package/dist/factories/dagster/types.d.ts +5 -0
  442. package/dist/factories/dagster/types.d.ts.map +1 -1
  443. package/dist/factories/dagster/types.js +1 -0
  444. package/dist/factories/dagster/types.js.map +1 -1
  445. package/dist/factories/dagster/utils/helm-values-mapper.js +3 -0
  446. package/dist/factories/dagster/utils/helm-values-mapper.js.map +1 -1
  447. package/dist/factories/external-dns/compositions/external-dns-bootstrap.d.ts.map +1 -1
  448. package/dist/factories/external-dns/compositions/external-dns-bootstrap.js +7 -4
  449. package/dist/factories/external-dns/compositions/external-dns-bootstrap.js.map +1 -1
  450. package/dist/factories/external-dns/resources/dns-endpoint.d.ts.map +1 -1
  451. package/dist/factories/external-dns/resources/dns-endpoint.js +20 -18
  452. package/dist/factories/external-dns/resources/dns-endpoint.js.map +1 -1
  453. package/dist/factories/flux/git-repository.d.ts.map +1 -1
  454. package/dist/factories/flux/git-repository.js +41 -34
  455. package/dist/factories/flux/git-repository.js.map +1 -1
  456. package/dist/factories/flux/kustomize/readiness-evaluators.d.ts +0 -6
  457. package/dist/factories/flux/kustomize/readiness-evaluators.d.ts.map +1 -1
  458. package/dist/factories/flux/kustomize/readiness-evaluators.js +12 -2
  459. package/dist/factories/flux/kustomize/readiness-evaluators.js.map +1 -1
  460. package/dist/factories/harbor/compositions/harbor-installation.d.ts +46 -38
  461. package/dist/factories/harbor/compositions/harbor-installation.d.ts.map +1 -1
  462. package/dist/factories/harbor/compositions/harbor-installation.js +4 -2
  463. package/dist/factories/harbor/compositions/harbor-installation.js.map +1 -1
  464. package/dist/factories/harbor/types.d.ts +13 -11
  465. package/dist/factories/harbor/types.d.ts.map +1 -1
  466. package/dist/factories/harbor/types.js +11 -9
  467. package/dist/factories/harbor/types.js.map +1 -1
  468. package/dist/factories/helm/helm-repository.d.ts.map +1 -1
  469. package/dist/factories/helm/helm-repository.js +14 -1
  470. package/dist/factories/helm/helm-repository.js.map +1 -1
  471. package/dist/factories/helm/index.d.ts +2 -0
  472. package/dist/factories/helm/index.d.ts.map +1 -1
  473. package/dist/factories/helm/index.js +1 -0
  474. package/dist/factories/helm/index.js.map +1 -1
  475. package/dist/factories/helm/readiness-evaluators.d.ts.map +1 -1
  476. package/dist/factories/helm/readiness-evaluators.js +46 -7
  477. package/dist/factories/helm/readiness-evaluators.js.map +1 -1
  478. package/dist/factories/helm/status.d.ts +18 -0
  479. package/dist/factories/helm/status.d.ts.map +1 -0
  480. package/dist/factories/helm/status.js +38 -0
  481. package/dist/factories/helm/status.js.map +1 -0
  482. package/dist/factories/index.d.ts +2 -2
  483. package/dist/factories/index.d.ts.map +1 -1
  484. package/dist/factories/index.js +4 -4
  485. package/dist/factories/index.js.map +1 -1
  486. package/dist/factories/inngest/compositions/inngest-bootstrap.d.ts +1 -1
  487. package/dist/factories/inngest/compositions/inngest-bootstrap.d.ts.map +1 -1
  488. package/dist/factories/inngest/compositions/inngest-bootstrap.js +2 -4
  489. package/dist/factories/inngest/compositions/inngest-bootstrap.js.map +1 -1
  490. package/dist/factories/inngest/resources/helm.d.ts.map +1 -1
  491. package/dist/factories/inngest/resources/helm.js +12 -3
  492. package/dist/factories/inngest/resources/helm.js.map +1 -1
  493. package/dist/factories/inngest/types.d.ts +3 -7
  494. package/dist/factories/inngest/types.d.ts.map +1 -1
  495. package/dist/factories/inngest/types.js +1 -1
  496. package/dist/factories/inngest/types.js.map +1 -1
  497. package/dist/factories/kro/kro-crd.d.ts.map +1 -1
  498. package/dist/factories/kro/kro-crd.js +32 -33
  499. package/dist/factories/kro/kro-crd.js.map +1 -1
  500. package/dist/factories/kro/kro-custom-resource.d.ts.map +1 -1
  501. package/dist/factories/kro/kro-custom-resource.js +91 -85
  502. package/dist/factories/kro/kro-custom-resource.js.map +1 -1
  503. package/dist/factories/kro/resource-graph-definition.d.ts.map +1 -1
  504. package/dist/factories/kro/resource-graph-definition.js +127 -117
  505. package/dist/factories/kro/resource-graph-definition.js.map +1 -1
  506. package/dist/factories/kubernetes/autoscaling/horizontal-pod-autoscaler-v1.d.ts.map +1 -1
  507. package/dist/factories/kubernetes/autoscaling/horizontal-pod-autoscaler-v1.js +27 -26
  508. package/dist/factories/kubernetes/autoscaling/horizontal-pod-autoscaler-v1.js.map +1 -1
  509. package/dist/factories/kubernetes/autoscaling/horizontal-pod-autoscaler.d.ts.map +1 -1
  510. package/dist/factories/kubernetes/autoscaling/horizontal-pod-autoscaler.js +22 -22
  511. package/dist/factories/kubernetes/autoscaling/horizontal-pod-autoscaler.js.map +1 -1
  512. package/dist/factories/kubernetes/certificates/certificate-signing-request.d.ts.map +1 -1
  513. package/dist/factories/kubernetes/certificates/certificate-signing-request.js +41 -39
  514. package/dist/factories/kubernetes/certificates/certificate-signing-request.js.map +1 -1
  515. package/dist/factories/kubernetes/core/component-status.d.ts.map +1 -1
  516. package/dist/factories/kubernetes/core/component-status.js +14 -16
  517. package/dist/factories/kubernetes/core/component-status.js.map +1 -1
  518. package/dist/factories/kubernetes/core/namespace.d.ts.map +1 -1
  519. package/dist/factories/kubernetes/core/namespace.js +31 -38
  520. package/dist/factories/kubernetes/core/namespace.js.map +1 -1
  521. package/dist/factories/kubernetes/core/node.d.ts.map +1 -1
  522. package/dist/factories/kubernetes/core/node.js +17 -25
  523. package/dist/factories/kubernetes/core/node.js.map +1 -1
  524. package/dist/factories/kubernetes/core/pod.d.ts.map +1 -1
  525. package/dist/factories/kubernetes/core/pod.js +31 -35
  526. package/dist/factories/kubernetes/core/pod.js.map +1 -1
  527. package/dist/factories/kubernetes/extensions/custom-resource-definition.d.ts.map +1 -1
  528. package/dist/factories/kubernetes/extensions/custom-resource-definition.js +34 -36
  529. package/dist/factories/kubernetes/extensions/custom-resource-definition.js.map +1 -1
  530. package/dist/factories/kubernetes/extensions/custom-resource.d.ts.map +1 -1
  531. package/dist/factories/kubernetes/extensions/custom-resource.js +2 -4
  532. package/dist/factories/kubernetes/extensions/custom-resource.js.map +1 -1
  533. package/dist/factories/kubernetes/networking/endpoints.d.ts.map +1 -1
  534. package/dist/factories/kubernetes/networking/endpoints.js +29 -30
  535. package/dist/factories/kubernetes/networking/endpoints.js.map +1 -1
  536. package/dist/factories/kubernetes/networking/ingress.d.ts.map +1 -1
  537. package/dist/factories/kubernetes/networking/ingress.js +46 -57
  538. package/dist/factories/kubernetes/networking/ingress.js.map +1 -1
  539. package/dist/factories/kubernetes/networking/network-policy.d.ts +9 -0
  540. package/dist/factories/kubernetes/networking/network-policy.d.ts.map +1 -1
  541. package/dist/factories/kubernetes/networking/network-policy.js +51 -1
  542. package/dist/factories/kubernetes/networking/network-policy.js.map +1 -1
  543. package/dist/factories/kubernetes/networking/service.d.ts.map +1 -1
  544. package/dist/factories/kubernetes/networking/service.js +48 -40
  545. package/dist/factories/kubernetes/networking/service.js.map +1 -1
  546. package/dist/factories/kubernetes/policy/pod-disruption-budget.d.ts.map +1 -1
  547. package/dist/factories/kubernetes/policy/pod-disruption-budget.js +40 -46
  548. package/dist/factories/kubernetes/policy/pod-disruption-budget.js.map +1 -1
  549. package/dist/factories/kubernetes/policy/resource-quota.d.ts.map +1 -1
  550. package/dist/factories/kubernetes/policy/resource-quota.js +30 -34
  551. package/dist/factories/kubernetes/policy/resource-quota.js.map +1 -1
  552. package/dist/factories/kubernetes/storage/persistent-volume-claim.d.ts.map +1 -1
  553. package/dist/factories/kubernetes/storage/persistent-volume-claim.js +22 -21
  554. package/dist/factories/kubernetes/storage/persistent-volume-claim.js.map +1 -1
  555. package/dist/factories/kubernetes/storage/persistent-volume.d.ts.map +1 -1
  556. package/dist/factories/kubernetes/storage/persistent-volume.js +32 -38
  557. package/dist/factories/kubernetes/storage/persistent-volume.js.map +1 -1
  558. package/dist/factories/kubernetes/storage/volume-attachment.d.ts.map +1 -1
  559. package/dist/factories/kubernetes/storage/volume-attachment.js +12 -11
  560. package/dist/factories/kubernetes/storage/volume-attachment.js.map +1 -1
  561. package/dist/factories/kubernetes/workloads/cron-job.d.ts.map +1 -1
  562. package/dist/factories/kubernetes/workloads/cron-job.js +39 -34
  563. package/dist/factories/kubernetes/workloads/cron-job.js.map +1 -1
  564. package/dist/factories/kubernetes/workloads/daemon-set.d.ts.map +1 -1
  565. package/dist/factories/kubernetes/workloads/daemon-set.js +24 -23
  566. package/dist/factories/kubernetes/workloads/daemon-set.js.map +1 -1
  567. package/dist/factories/kubernetes/workloads/deployment.d.ts.map +1 -1
  568. package/dist/factories/kubernetes/workloads/deployment.js +45 -35
  569. package/dist/factories/kubernetes/workloads/deployment.js.map +1 -1
  570. package/dist/factories/kubernetes/workloads/job.d.ts.map +1 -1
  571. package/dist/factories/kubernetes/workloads/job.js +87 -77
  572. package/dist/factories/kubernetes/workloads/job.js.map +1 -1
  573. package/dist/factories/kubernetes/workloads/replica-set.d.ts.map +1 -1
  574. package/dist/factories/kubernetes/workloads/replica-set.js +24 -24
  575. package/dist/factories/kubernetes/workloads/replica-set.js.map +1 -1
  576. package/dist/factories/kubernetes/workloads/replication-controller.d.ts.map +1 -1
  577. package/dist/factories/kubernetes/workloads/replication-controller.js +37 -26
  578. package/dist/factories/kubernetes/workloads/replication-controller.js.map +1 -1
  579. package/dist/factories/kubernetes/workloads/stateful-set.d.ts.map +1 -1
  580. package/dist/factories/kubernetes/workloads/stateful-set.js +69 -55
  581. package/dist/factories/kubernetes/workloads/stateful-set.js.map +1 -1
  582. package/dist/factories/kubernetes/yaml/yaml-artifact-applier.d.ts +15 -0
  583. package/dist/factories/kubernetes/yaml/yaml-artifact-applier.d.ts.map +1 -0
  584. package/dist/factories/kubernetes/yaml/yaml-artifact-applier.js +69 -0
  585. package/dist/factories/kubernetes/yaml/yaml-artifact-applier.js.map +1 -0
  586. package/dist/factories/kubernetes/yaml/yaml-directory.d.ts +2 -1
  587. package/dist/factories/kubernetes/yaml/yaml-directory.d.ts.map +1 -1
  588. package/dist/factories/kubernetes/yaml/yaml-directory.js +3 -34
  589. package/dist/factories/kubernetes/yaml/yaml-directory.js.map +1 -1
  590. package/dist/factories/kubernetes/yaml/yaml-file.d.ts +13 -91
  591. package/dist/factories/kubernetes/yaml/yaml-file.d.ts.map +1 -1
  592. package/dist/factories/kubernetes/yaml/yaml-file.js +21 -311
  593. package/dist/factories/kubernetes/yaml/yaml-file.js.map +1 -1
  594. package/dist/factories/nats/compositions/nats-bootstrap.d.ts +2 -2
  595. package/dist/factories/nats/compositions/nats-bootstrap.d.ts.map +1 -1
  596. package/dist/factories/nats/compositions/nats-bootstrap.js +2 -3
  597. package/dist/factories/nats/compositions/nats-bootstrap.js.map +1 -1
  598. package/dist/factories/nats/resources/jetstream.d.ts.map +1 -1
  599. package/dist/factories/nats/resources/jetstream.js +2 -0
  600. package/dist/factories/nats/resources/jetstream.js.map +1 -1
  601. package/dist/factories/nats/types.d.ts +3 -3
  602. package/dist/factories/nats/types.js +1 -1
  603. package/dist/factories/nats/types.js.map +1 -1
  604. package/dist/factories/ory/compositions/ory-platform-stack.d.ts.map +1 -1
  605. package/dist/factories/ory/compositions/ory-platform-stack.js +35 -9
  606. package/dist/factories/ory/compositions/ory-platform-stack.js.map +1 -1
  607. package/dist/factories/ory/resources/oathkeeper-rule.d.ts.map +1 -1
  608. package/dist/factories/ory/resources/oathkeeper-rule.js +11 -8
  609. package/dist/factories/ory/resources/oathkeeper-rule.js.map +1 -1
  610. package/dist/factories/ory/resources/oauth2-client.d.ts.map +1 -1
  611. package/dist/factories/ory/resources/oauth2-client.js +12 -9
  612. package/dist/factories/ory/resources/oauth2-client.js.map +1 -1
  613. package/dist/factories/ory/types.d.ts +3 -0
  614. package/dist/factories/ory/types.d.ts.map +1 -1
  615. package/dist/factories/ory/types.js +1 -0
  616. package/dist/factories/ory/types.js.map +1 -1
  617. package/dist/factories/rook/compositions/rook-ceph-operator-installation.d.ts +2 -2
  618. package/dist/factories/rook/compositions/rook-ceph-operator-installation.d.ts.map +1 -1
  619. package/dist/factories/rook/compositions/rook-ceph-operator-installation.js +2 -3
  620. package/dist/factories/rook/compositions/rook-ceph-operator-installation.js.map +1 -1
  621. package/dist/factories/rook/resources/ceph-object-store-user.d.ts.map +1 -1
  622. package/dist/factories/rook/resources/ceph-object-store-user.js +2 -0
  623. package/dist/factories/rook/resources/ceph-object-store-user.js.map +1 -1
  624. package/dist/factories/rook/resources/ceph-object-store.d.ts.map +1 -1
  625. package/dist/factories/rook/resources/ceph-object-store.js +2 -0
  626. package/dist/factories/rook/resources/ceph-object-store.js.map +1 -1
  627. package/dist/factories/rook/resources/object-bucket-claim.d.ts.map +1 -1
  628. package/dist/factories/rook/resources/object-bucket-claim.js +2 -0
  629. package/dist/factories/rook/resources/object-bucket-claim.js.map +1 -1
  630. package/dist/factories/rook/types.d.ts +1 -1
  631. package/dist/factories/rook/types.js +1 -1
  632. package/dist/factories/rook/types.js.map +1 -1
  633. package/dist/factories/searxng/compositions/searxng-bootstrap.d.ts.map +1 -1
  634. package/dist/factories/searxng/compositions/searxng-bootstrap.js +2 -2
  635. package/dist/factories/searxng/compositions/searxng-bootstrap.js.map +1 -1
  636. package/dist/factories/searxng/resources/searxng.d.ts.map +1 -1
  637. package/dist/factories/searxng/resources/searxng.js +2 -0
  638. package/dist/factories/searxng/resources/searxng.js.map +1 -1
  639. package/dist/factories/valkey/compositions/valkey-bootstrap.d.ts +2 -2
  640. package/dist/factories/valkey/compositions/valkey-bootstrap.d.ts.map +1 -1
  641. package/dist/factories/valkey/compositions/valkey-bootstrap.js +4 -9
  642. package/dist/factories/valkey/compositions/valkey-bootstrap.js.map +1 -1
  643. package/dist/factories/valkey/resources/valkey.d.ts.map +1 -1
  644. package/dist/factories/valkey/resources/valkey.js +2 -1
  645. package/dist/factories/valkey/resources/valkey.js.map +1 -1
  646. package/dist/factories/valkey/types.d.ts +3 -7
  647. package/dist/factories/valkey/types.d.ts.map +1 -1
  648. package/dist/factories/valkey/types.js +1 -1
  649. package/dist/factories/valkey/types.js.map +1 -1
  650. package/dist/factories/webapp/compositions/web-app-with-processing.d.ts +3 -2
  651. package/dist/factories/webapp/compositions/web-app-with-processing.d.ts.map +1 -1
  652. package/dist/factories/webapp/compositions/web-app-with-processing.js +7 -6
  653. package/dist/factories/webapp/compositions/web-app-with-processing.js.map +1 -1
  654. package/dist/factories/webapp/types.d.ts +1 -0
  655. package/dist/factories/webapp/types.d.ts.map +1 -1
  656. package/dist/factories/webapp/types.js +2 -0
  657. package/dist/factories/webapp/types.js.map +1 -1
  658. package/dist/index.d.ts +2 -1
  659. package/dist/index.d.ts.map +1 -1
  660. package/dist/index.js +1 -1
  661. package/dist/index.js.map +1 -1
  662. package/dist/shared/brands.d.ts +7 -0
  663. package/dist/shared/brands.d.ts.map +1 -1
  664. package/dist/shared/brands.js +7 -0
  665. package/dist/shared/brands.js.map +1 -1
  666. package/dist/utils/index.d.ts +3 -3
  667. package/dist/utils/index.d.ts.map +1 -1
  668. package/dist/utils/index.js +3 -3
  669. package/dist/utils/index.js.map +1 -1
  670. package/package.json +20 -5
  671. package/dist/factories/kubernetes/yaml/conflict-handler.d.ts +0 -23
  672. package/dist/factories/kubernetes/yaml/conflict-handler.d.ts.map +0 -1
  673. package/dist/factories/kubernetes/yaml/conflict-handler.js +0 -83
  674. package/dist/factories/kubernetes/yaml/conflict-handler.js.map +0 -1
@@ -15,13 +15,16 @@ import { DEFAULT_DELETE_TIMEOUT, DEFAULT_FAST_POLL_INTERVAL, DEFAULT_MAX_RECURSI
15
15
  import { KUBERNETES_REF_SCHEMA_MARKER_SOURCE } from '../constants/brands.js';
16
16
  import { DependencyResolver } from '../dependencies/index.js';
17
17
  import { ensureError, ResourceGraphFactoryError, TypeKroError, ValidationError, } from '../errors.js';
18
- import { extractResourceReferencesFromExpression } from '../expressions/analysis/scope-resolver.js';
19
18
  import { createBunCompatibleCoreV1Api } from '../kubernetes/index.js';
20
19
  import { getComponentLogger } from '../logging/index.js';
21
- import { copyResourceMetadata, getIncludeWhen, getMetadataField, getResourceId, setResourceId, } from '../metadata/index.js';
20
+ import { copyResourceMetadata, getIncludeWhen, getMetadataField, getReadinessEvaluator, getResourceId, setResourceId, } from '../metadata/index.js';
21
+ import { assertAdapterCapabilitiesSupported, collectArtifactOutputUses, collectPlanValueSensitiveBindings, compileDirectArtifactPlan, createDirectArtifactExecutionMaterialization, directArtifactPlanToResourceGraph, encodeDirectArtifactExecutionRecord, materializeDirectArtifactManifest, planValueContainsSensitiveValue, planValueSensitiveBindingNames, resolveStaticYamlSensitiveBindings, } from '../planning/index.js';
22
22
  import { ensureReadinessEvaluator } from '../readiness/evaluator.js';
23
- import { getSingletonResourceId } from '../singleton/singleton.js';
23
+ import { resolvePortableReadinessStrategy } from '../readiness/portable-strategies.js';
24
+ import { runStandaloneOperation } from '../runtime/standalone-operation.js';
25
+ import { getSingletonResourceId, singletonInstanceTypeMeta } from '../singleton/singleton.js';
24
26
  import { KubernetesClientManager } from './client-provider-manager.js';
27
+ import { createDeletionResultState, deletionTarget, finishDeletionResult, } from './deletion-result.js';
25
28
  import { BUILT_IN_GVKS } from './deployment-state-discovery.js';
26
29
  import { DirectDeploymentEngine } from './engine.js';
27
30
  import { logHandleSnapshot } from './handle-tracing.js';
@@ -31,6 +34,36 @@ import { ResourceReadinessChecker } from './readiness.js';
31
34
  import { extractSerializableKubeConfigOptions, generateInstanceName, getSingletonInstanceName, validateSpec, } from './shared-utilities.js';
32
35
  import { assertNoDeployedSingletonSpecDrift, assertNoDiscoveredSingletonSpecDrift, singletonSpecFingerprintAnnotationValue, } from './singleton-owner-drift.js';
33
36
  import { DirectDeploymentStrategy } from './strategies/index.js';
37
+ function deployedResourceDeletionIdentity(resource) {
38
+ const clusterScoped = getMetadataField(resource.manifest, 'scope') === 'cluster';
39
+ return deletionTarget(resource.manifest.apiVersion, resource.kind, resource.name, clusterScoped ? undefined : resource.namespace);
40
+ }
41
+ function directArtifactPlanValues(artifact) {
42
+ const values = [
43
+ ...artifact.readiness.activation,
44
+ ...artifact.readiness.readyWhen,
45
+ ...(artifact.iteration ?? []).map((dimension) => dimension.collection),
46
+ ...(artifact.templateOverrides ?? []).map((override) => override.value),
47
+ ];
48
+ if (artifact.identity) {
49
+ values.push(artifact.identity.name);
50
+ if (artifact.identity.namespace)
51
+ values.push(artifact.identity.namespace);
52
+ }
53
+ if (artifact.desired)
54
+ values.push(artifact.desired);
55
+ if (artifact.lifecycle.instancing.kind === 'per-scope') {
56
+ values.push(artifact.lifecycle.instancing.key);
57
+ }
58
+ if (artifact.lifecycle.unusedEvidence)
59
+ values.push(artifact.lifecycle.unusedEvidence.inputs);
60
+ if (artifact.readiness.strategy?.kind === 'registered') {
61
+ const configuration = artifact.readiness.strategy.configuration;
62
+ if (configuration)
63
+ values.push(configuration);
64
+ }
65
+ return values;
66
+ }
34
67
  /**
35
68
  * DirectResourceFactory implementation
36
69
  *
@@ -50,6 +83,7 @@ export class DirectResourceFactoryImpl {
50
83
  factoryOptions;
51
84
  singletonDefinitions;
52
85
  singletonOwnerStatuses = new Map();
86
+ singletonOwnerReferenceSeeds = new Map();
53
87
  deployedInstances = new Map();
54
88
  resolvedResourceKeysForHydration;
55
89
  resolvedClosuresForDeployment;
@@ -120,6 +154,12 @@ export class DirectResourceFactoryImpl {
120
154
  * Deploy a new instance with the given spec
121
155
  */
122
156
  async deploy(spec, opts) {
157
+ if (opts?.operationSignal) {
158
+ return this.deployWithinOperation(spec, opts, opts.operationSignal);
159
+ }
160
+ return runStandaloneOperation((abortSignal) => this.deployWithinOperation(spec, { ...opts, operationSignal: abortSignal }, abortSignal), { abortSignals: [this.factoryOptions.abortSignal, opts?.abortSignal] });
161
+ }
162
+ async deployWithinOperation(spec, opts, abortSignal) {
123
163
  this.logger.debug('DirectResourceFactory deploy called', {
124
164
  factoryName: this.name,
125
165
  hasStatusBuilder: !!this.statusBuilder,
@@ -133,8 +173,8 @@ export class DirectResourceFactoryImpl {
133
173
  this.logger.debug('Got deployment strategy', {
134
174
  strategyType: strategy.constructor.name,
135
175
  });
136
- await this.ensureSingletonOwners(spec);
137
- const instance = await strategy.deploy(spec, opts);
176
+ await this.ensureSingletonOwners(spec, abortSignal);
177
+ const instance = await strategy.deploy(spec, { ...opts, abortSignal });
138
178
  // Check if deployment failed and throw for user-facing error handling
139
179
  if (instance.metadata?.annotations?.['typekro.io/deployment-status'] === 'failed') {
140
180
  const errorMessage = instance.metadata?.annotations?.['typekro.io/deployment-error'] ||
@@ -161,7 +201,9 @@ export class DirectResourceFactoryImpl {
161
201
  * fully typed Enhanced instances from live tagged resources is intentionally
162
202
  * not attempted here.
163
203
  */
164
- async getInstances() {
204
+ async getInstances(opts) {
205
+ const abortSignal = opts?.operationSignal ?? opts?.abortSignal;
206
+ abortSignal?.throwIfAborted();
165
207
  return Array.from(this.deployedInstances.values());
166
208
  }
167
209
  /**
@@ -191,24 +233,55 @@ export class DirectResourceFactoryImpl {
191
233
  * ```
192
234
  */
193
235
  async deleteInstance(name, opts) {
236
+ return runStandaloneOperation((abortSignal) => this.deleteInstanceWithinOperation(name, opts, abortSignal), { abortSignals: [this.factoryOptions.abortSignal, opts?.abortSignal] });
237
+ }
238
+ async deleteInstanceWithinOperation(name, opts, abortSignal) {
239
+ const deletion = createDeletionResultState('direct', this.name, name);
194
240
  try {
195
- const rollbackResult = await this.rollbackInstanceWithNamespaceCompletion(name, opts);
241
+ const rollbackResult = await this.rollbackInstanceWithNamespaceCompletion(name, opts, abortSignal);
242
+ deletion.deleted.push(...(rollbackResult.deletedResources ?? []).map(deployedResourceDeletionIdentity));
243
+ for (const resource of rollbackResult.retainedResources ?? []) {
244
+ const identity = deployedResourceDeletionIdentity(resource);
245
+ deletion.retained.push({
246
+ resource: identity,
247
+ policy: 'scope-filter',
248
+ reason: 'The resource scope is outside the requested deletion scope and was retained intentionally.',
249
+ });
250
+ }
196
251
  if (rollbackResult.status !== 'success' || rollbackResult.errors.length > 0) {
197
- const errorSummary = rollbackResult.errors
198
- .map((error) => `${error.resourceId}: ${ensureError(error.error).message}`)
199
- .join('; ');
200
- throw new Error(`Cleanup incomplete for instance ${name}: rollback ${rollbackResult.status}${errorSummary ? ` (${errorSummary})` : ''}`);
252
+ for (const error of rollbackResult.errors) {
253
+ deletion.blockers.push({
254
+ code: 'CLEANUP_ERROR',
255
+ message: `${error.resourceId}: ${ensureError(error.error).message}`,
256
+ retryable: true,
257
+ retryGuidance: 'Inspect the referenced resource and retry deletion after its controller or finalizers can make progress.',
258
+ });
259
+ }
260
+ return finishDeletionResult(deletion, 'blocked', {
261
+ safe: true,
262
+ guidance: 'Retry after resolving the listed resource cleanup errors.',
263
+ });
201
264
  }
202
265
  // Remove from tracking
203
266
  this.deployedInstances.delete(name);
267
+ return finishDeletionResult(deletion, 'complete', {
268
+ safe: true,
269
+ guidance: deletion.retained.length > 0
270
+ ? 'The instance-private graph is gone. Resources outside the requested scopes were retained explicitly.'
271
+ : 'The requested direct-mode instance graph is gone.',
272
+ });
204
273
  }
205
274
  catch (error) {
206
- // INSTANCE_NOT_FOUND bubbles up — the caller asked us to delete
207
- // an instance that has neither in-memory state nor a persisted
208
- // record. That's a legitimate error (wrong name, already cleaned
209
- // up) and the caller needs to see it.
275
+ if (abortSignal.aborted) {
276
+ throw abortSignal.reason ?? error;
277
+ }
278
+ // Deletion is idempotent: no in-memory state and no tagged live
279
+ // resources is positive evidence that the requested graph is gone.
210
280
  if (error instanceof TypeKroError && error.code === 'INSTANCE_NOT_FOUND') {
211
- throw error;
281
+ return finishDeletionResult(deletion, 'complete', {
282
+ safe: true,
283
+ guidance: 'No tagged or in-memory resources remain for this instance; deletion is already complete.',
284
+ });
212
285
  }
213
286
  // Soft-swallow "Cannot rollback" errors from the engine —
214
287
  // they indicate the engine's in-memory deployment state has
@@ -217,9 +290,21 @@ export class DirectResourceFactoryImpl {
217
290
  const errorMessage = ensureError(error).message;
218
291
  if (errorMessage.includes('Cannot rollback')) {
219
292
  this.deployedInstances.delete(name);
220
- return;
293
+ return finishDeletionResult(deletion, 'complete', {
294
+ safe: true,
295
+ guidance: 'The deployment record was already removed; no remaining instance was found.',
296
+ });
221
297
  }
222
- throw new ResourceGraphFactoryError(`Failed to delete instance ${name}: ${errorMessage}`, this.name, 'cleanup');
298
+ deletion.blockers.push({
299
+ code: 'CLEANUP_ERROR',
300
+ message: `Failed to delete instance ${name}: ${errorMessage}`,
301
+ retryable: true,
302
+ retryGuidance: 'Inspect the reported Kubernetes error and retry. TypeKro does not report deletion complete while cleanup is unproven.',
303
+ });
304
+ return finishDeletionResult(deletion, 'blocked', {
305
+ safe: true,
306
+ guidance: 'Retry after resolving the reported cleanup error.',
307
+ });
223
308
  }
224
309
  }
225
310
  buildKnownGvks() {
@@ -239,7 +324,7 @@ export class DirectResourceFactoryImpl {
239
324
  }
240
325
  return [...BUILT_IN_GVKS, ...crdHints.values()];
241
326
  }
242
- async rollbackInstanceResources(name, opts) {
327
+ async rollbackInstanceResources(name, opts, abortSignal) {
243
328
  const engine = this.getDeploymentEngine();
244
329
  const instance = this.deployedInstances.get(name);
245
330
  if (instance) {
@@ -249,9 +334,12 @@ export class DirectResourceFactoryImpl {
249
334
  return await engine.rollback(deploymentId, {
250
335
  ...(opts?.scopes && { scopes: opts.scopes }),
251
336
  ...(opts?.includeUnscopedResources === false && { includeUnscopedResources: false }),
252
- ...(this.factoryOptions.timeout !== undefined && {
253
- timeout: this.factoryOptions.timeout,
254
- }),
337
+ ...(opts?.timeout !== undefined || this.factoryOptions.timeout !== undefined
338
+ ? {
339
+ timeout: opts?.timeout ?? this.factoryOptions.timeout,
340
+ }
341
+ : {}),
342
+ ...(abortSignal ? { abortSignal } : {}),
255
343
  });
256
344
  }
257
345
  catch (error) {
@@ -265,6 +353,7 @@ export class DirectResourceFactoryImpl {
265
353
  const record = await engine.loadDeploymentByInstance({
266
354
  factoryName: this.name,
267
355
  instanceName: name,
356
+ factoryNamespace: this.namespace,
268
357
  knownGvks: this.buildKnownGvks(),
269
358
  });
270
359
  if (!record) {
@@ -279,7 +368,10 @@ export class DirectResourceFactoryImpl {
279
368
  return engine.rollbackRecord(record, {
280
369
  ...(opts?.scopes && { scopes: opts.scopes }),
281
370
  ...(opts?.includeUnscopedResources === false && { includeUnscopedResources: false }),
282
- ...(this.factoryOptions.timeout !== undefined && { timeout: this.factoryOptions.timeout }),
371
+ ...(opts?.timeout !== undefined || this.factoryOptions.timeout !== undefined
372
+ ? { timeout: opts?.timeout ?? this.factoryOptions.timeout }
373
+ : {}),
374
+ ...(abortSignal ? { abortSignal } : {}),
283
375
  });
284
376
  }
285
377
  /**
@@ -287,14 +379,14 @@ export class DirectResourceFactoryImpl {
287
379
  * A successful rollback is not complete while an owned Namespace remains
288
380
  * terminating, because an immediate redeploy can otherwise race that deletion.
289
381
  */
290
- async rollbackInstanceWithNamespaceCompletion(name, opts) {
291
- const rollbackResult = await this.rollbackInstanceResources(name, opts);
382
+ async rollbackInstanceWithNamespaceCompletion(name, opts, abortSignal) {
383
+ const rollbackResult = await this.rollbackInstanceResources(name, opts, abortSignal);
292
384
  if (rollbackResult.status === 'success' && rollbackResult.errors.length === 0) {
293
- await this.completeNamespaceDeletion(rollbackResult);
385
+ await this.completeNamespaceDeletion(rollbackResult, opts?.timeout, abortSignal);
294
386
  }
295
387
  return rollbackResult;
296
388
  }
297
- async completeNamespaceDeletion(rollbackResult) {
389
+ async completeNamespaceDeletion(rollbackResult, timeout, abortSignal) {
298
390
  const deletedNamespaces = rollbackResult.rolledBackResources
299
391
  .filter((resource) => resource.startsWith('Namespace/'))
300
392
  .map((resource) => resource.split('/')[1])
@@ -306,6 +398,7 @@ export class DirectResourceFactoryImpl {
306
398
  const kubeConfig = this.getClientProvider().getKubeConfig();
307
399
  const coreApi = createBunCompatibleCoreV1Api(kubeConfig, this.factoryOptions.httpTimeouts);
308
400
  for (const namespace of deletedNamespaces) {
401
+ abortSignal?.throwIfAborted();
309
402
  let pvcs;
310
403
  try {
311
404
  pvcs = await coreApi.listNamespacedPersistentVolumeClaim({ namespace });
@@ -322,6 +415,7 @@ export class DirectResourceFactoryImpl {
322
415
  });
323
416
  }
324
417
  for (const pvc of pvcs.items) {
418
+ abortSignal?.throwIfAborted();
325
419
  const pvcName = pvc.metadata?.name;
326
420
  if (!pvcName)
327
421
  continue;
@@ -337,8 +431,8 @@ export class DirectResourceFactoryImpl {
337
431
  }
338
432
  }
339
433
  }
340
- const deleteTimeout = this.factoryOptions.timeout ?? DEFAULT_DELETE_TIMEOUT;
341
- await this.waitForNamespaceDeletion(this.getDeploymentEngine().getKubernetesApi(), deletedNamespaces, deleteTimeout);
434
+ const deleteTimeout = timeout ?? this.factoryOptions.timeout ?? DEFAULT_DELETE_TIMEOUT;
435
+ await this.waitForNamespaceDeletion(this.getDeploymentEngine().getKubernetesApi(), deletedNamespaces, deleteTimeout, abortSignal);
342
436
  }
343
437
  /**
344
438
  * Poll until the given namespaces no longer exist (HTTP 404).
@@ -346,13 +440,14 @@ export class DirectResourceFactoryImpl {
346
440
  * to fully disappear, especially when finalizers or remaining resources
347
441
  * are involved.
348
442
  */
349
- async waitForNamespaceDeletion(k8sApi, namespaces, timeout) {
443
+ async waitForNamespaceDeletion(k8sApi, namespaces, timeout, abortSignal) {
350
444
  const pollInterval = DEFAULT_FAST_POLL_INTERVAL;
351
445
  for (const ns of namespaces) {
352
446
  // Each namespace gets its own timeout budget
353
447
  const nsStartTime = Date.now();
354
448
  let deleted = false;
355
449
  while (Date.now() - nsStartTime < timeout) {
450
+ abortSignal?.throwIfAborted();
356
451
  try {
357
452
  await k8sApi.read({
358
453
  apiVersion: 'v1',
@@ -360,7 +455,25 @@ export class DirectResourceFactoryImpl {
360
455
  metadata: { name: ns },
361
456
  });
362
457
  // Namespace still exists (likely "Terminating"), keep polling
363
- await new Promise((resolve) => setTimeout(resolve, pollInterval));
458
+ await new Promise((resolve, reject) => {
459
+ if (!abortSignal) {
460
+ setTimeout(resolve, pollInterval);
461
+ return;
462
+ }
463
+ const onAbort = () => {
464
+ clearTimeout(delay);
465
+ reject(abortSignal.reason ?? new DOMException('The operation was aborted', 'AbortError'));
466
+ };
467
+ const delay = setTimeout(() => {
468
+ abortSignal.removeEventListener('abort', onAbort);
469
+ resolve();
470
+ }, pollInterval);
471
+ if (abortSignal.aborted) {
472
+ onAbort();
473
+ return;
474
+ }
475
+ abortSignal.addEventListener('abort', onAbort, { once: true });
476
+ });
364
477
  }
365
478
  catch (error) {
366
479
  // 404 means the namespace is fully gone
@@ -390,13 +503,21 @@ export class DirectResourceFactoryImpl {
390
503
  * `getInstances()`. Use `deleteInstance(name)` for cross-process cleanup;
391
504
  * status reconstruction from tagged live resources is not currently exposed.
392
505
  */
393
- async getStatus() {
394
- const instances = await this.getInstances();
506
+ async getStatus(opts) {
507
+ if (opts?.operationSignal) {
508
+ return this.getStatusWithinOperation(opts.operationSignal);
509
+ }
510
+ return runStandaloneOperation((abortSignal) => this.getStatusWithinOperation(abortSignal), {
511
+ abortSignals: [this.factoryOptions.abortSignal, opts?.abortSignal],
512
+ });
513
+ }
514
+ async getStatusWithinOperation(abortSignal) {
515
+ const instances = await this.getInstances({ operationSignal: abortSignal });
395
516
  // If no instances, we're healthy by definition
396
517
  let health = 'healthy';
397
518
  if (instances.length > 0) {
398
519
  // Only perform cluster health checking if we have deployed instances
399
- health = await this.checkFactoryHealth();
520
+ health = await this.checkFactoryHealth(abortSignal);
400
521
  }
401
522
  return {
402
523
  name: this.name,
@@ -409,9 +530,10 @@ export class DirectResourceFactoryImpl {
409
530
  /**
410
531
  * Check the overall health of the factory by leveraging existing ResourceReadinessChecker
411
532
  */
412
- async checkFactoryHealth() {
533
+ async checkFactoryHealth(abortSignal) {
413
534
  const healthLogger = this.logger.child({ method: 'checkFactoryHealth' });
414
535
  try {
536
+ abortSignal.throwIfAborted();
415
537
  const engine = this.getDeploymentEngine();
416
538
  // Get all deployment states from the engine
417
539
  const deploymentStates = engine.getAllDeploymentStates();
@@ -429,9 +551,11 @@ export class DirectResourceFactoryImpl {
429
551
  for (const deployedResource of deploymentState.resources) {
430
552
  totalResources++;
431
553
  try {
554
+ abortSignal.throwIfAborted();
432
555
  // Use the deployment engine's readiness logic (includes custom evaluators + fallback)
433
556
  const engine = this.getDeploymentEngine();
434
557
  const isReady = await engine.isDeployedResourceReady(deployedResource);
558
+ abortSignal.throwIfAborted();
435
559
  if (isReady) {
436
560
  healthyCount++;
437
561
  }
@@ -447,6 +571,7 @@ export class DirectResourceFactoryImpl {
447
571
  }
448
572
  }
449
573
  catch (error) {
574
+ abortSignal.throwIfAborted();
450
575
  // Resource not found or API error - consider it failed
451
576
  failedCount++;
452
577
  const healthError = {
@@ -504,6 +629,7 @@ export class DirectResourceFactoryImpl {
504
629
  }
505
630
  }
506
631
  catch (error) {
632
+ abortSignal.throwIfAborted();
507
633
  healthLogger.error('Error checking factory health', ensureError(error));
508
634
  return 'failed';
509
635
  }
@@ -512,10 +638,16 @@ export class DirectResourceFactoryImpl {
512
638
  * Get detailed health information including any errors encountered
513
639
  * Useful for debugging and monitoring
514
640
  */
515
- async getHealthDetails() {
641
+ async getHealthDetails(opts) {
642
+ if (opts?.operationSignal) {
643
+ return this.getHealthDetailsWithinOperation(opts.operationSignal);
644
+ }
645
+ return runStandaloneOperation((abortSignal) => this.getHealthDetailsWithinOperation(abortSignal), { abortSignals: [this.factoryOptions.abortSignal, opts?.abortSignal] });
646
+ }
647
+ async getHealthDetailsWithinOperation(abortSignal) {
516
648
  const healthLogger = this.logger.child({ method: 'getHealthDetails' });
517
649
  // Check if we have any instances first to avoid initializing engine unnecessarily
518
- const instances = await this.getInstances();
650
+ const instances = await this.getInstances({ operationSignal: abortSignal });
519
651
  if (instances.length === 0) {
520
652
  return {
521
653
  health: 'healthy',
@@ -545,6 +677,7 @@ export class DirectResourceFactoryImpl {
545
677
  for (const deployedResource of deploymentState.resources) {
546
678
  totalResources++;
547
679
  try {
680
+ abortSignal.throwIfAborted();
548
681
  const resourceRef = {
549
682
  apiVersion: deployedResource.manifest.apiVersion || '',
550
683
  kind: deployedResource.kind,
@@ -555,6 +688,7 @@ export class DirectResourceFactoryImpl {
555
688
  };
556
689
  // In the new API, methods return objects directly (no .body wrapper)
557
690
  const liveResource = await k8sApi.read(resourceRef);
691
+ abortSignal.throwIfAborted();
558
692
  const isReady = readinessChecker.isResourceReady(liveResource);
559
693
  if (isReady) {
560
694
  healthyCount++;
@@ -564,6 +698,7 @@ export class DirectResourceFactoryImpl {
564
698
  }
565
699
  }
566
700
  catch (error) {
701
+ abortSignal.throwIfAborted();
567
702
  failedCount++;
568
703
  const healthError = {
569
704
  resourceId: deployedResource.id,
@@ -588,6 +723,7 @@ export class DirectResourceFactoryImpl {
588
723
  };
589
724
  }
590
725
  catch (error) {
726
+ abortSignal.throwIfAborted();
591
727
  healthLogger.error('Error getting health details', ensureError(error));
592
728
  return {
593
729
  health: 'failed',
@@ -610,7 +746,13 @@ export class DirectResourceFactoryImpl {
610
746
  * For cross-process cleanup, call `deleteInstance(name)` with the known
611
747
  * instance name so TypeKro can discover tagged resources from the cluster.
612
748
  */
613
- async rollback() {
749
+ async rollback(opts) {
750
+ return runStandaloneOperation((abortSignal) => this.rollbackWithinOperation(abortSignal), {
751
+ abortSignals: [this.factoryOptions.abortSignal, opts?.abortSignal],
752
+ });
753
+ }
754
+ async rollbackWithinOperation(abortSignal) {
755
+ abortSignal.throwIfAborted();
614
756
  this.logger.debug('Starting rollback for all deployed instances');
615
757
  const startedAt = Date.now();
616
758
  const instanceNames = Array.from(this.deployedInstances.keys());
@@ -623,7 +765,8 @@ export class DirectResourceFactoryImpl {
623
765
  let status = 'success';
624
766
  for (const instanceName of instanceNames) {
625
767
  try {
626
- const result = await this.rollbackInstanceWithNamespaceCompletion(instanceName);
768
+ abortSignal.throwIfAborted();
769
+ const result = await this.rollbackInstanceWithNamespaceCompletion(instanceName, undefined, abortSignal);
627
770
  rolledBackResources.push(...result.rolledBackResources);
628
771
  errors.push(...result.errors);
629
772
  if (result.status === 'failed') {
@@ -637,6 +780,7 @@ export class DirectResourceFactoryImpl {
637
780
  }
638
781
  }
639
782
  catch (error) {
783
+ abortSignal.throwIfAborted();
640
784
  status = 'failed';
641
785
  errors.push({
642
786
  resourceId: instanceName,
@@ -668,7 +812,11 @@ export class DirectResourceFactoryImpl {
668
812
  /**
669
813
  * Perform a dry run deployment
670
814
  */
671
- async toDryRun(spec) {
815
+ async toDryRun(spec, opts) {
816
+ return runStandaloneOperation((abortSignal) => this.toDryRunWithinOperation(spec, abortSignal), { abortSignals: [this.factoryOptions.abortSignal, opts?.abortSignal] });
817
+ }
818
+ async toDryRunWithinOperation(spec, abortSignal) {
819
+ abortSignal.throwIfAborted();
672
820
  const resourceGraph = this.createResourceGraphForInstance(spec);
673
821
  const deploymentOptions = {
674
822
  mode: 'direct',
@@ -676,6 +824,7 @@ export class DirectResourceFactoryImpl {
676
824
  ...(this.factoryOptions.timeout && { timeout: this.factoryOptions.timeout }),
677
825
  waitForReady: false, // Don't wait for readiness in dry run
678
826
  dryRun: true,
827
+ abortSignal,
679
828
  ...(this.factoryOptions.retryPolicy && { retryPolicy: this.factoryOptions.retryPolicy }),
680
829
  ...(this.factoryOptions.progressCallback && {
681
830
  progressCallback: this.factoryOptions.progressCallback,
@@ -693,11 +842,17 @@ export class DirectResourceFactoryImpl {
693
842
  * ValidationError is thrown — those constructs require the Kro controller
694
843
  * or runtime deployment via deploy().
695
844
  */
696
- toYaml(spec) {
697
- // Resolve references with the actual spec values
698
- const resolvedResources = applyAspects(this.resolveResourcesForSpec(spec), {
699
- mode: 'direct',
700
- aspects: this.factoryOptions.aspects ?? [],
845
+ toYaml(spec, options) {
846
+ // Serialize the same artifact-derived graph used by deploy/dry-run/Alchemy.
847
+ // The compatibility facade still rejects runtime-only references below.
848
+ const execution = this.createArtifactExecutionForInstance(spec, undefined, {
849
+ staticYamlOptions: options ?? {},
850
+ });
851
+ this.assertExecutionCapabilities(execution, { host: null, output: 'static' });
852
+ const resolvedResources = Object.fromEntries(execution.graph.resources.map(({ id, manifest }) => [id, manifest]));
853
+ const orderedResources = execution.graph.dependencyGraph.getTopologicalOrder().flatMap((id) => {
854
+ const resource = resolvedResources[id];
855
+ return resource ? [resource] : [];
701
856
  });
702
857
  // Validate that all values are fully resolved — no KubernetesRef or
703
858
  // CelExpression objects should remain in direct-mode YAML output.
@@ -718,7 +873,7 @@ export class DirectResourceFactoryImpl {
718
873
  }
719
874
  // Generate individual Kubernetes resource YAML manifests (not RGD).
720
875
  // Uses js-yaml for safe serialization — avoids YAML injection via string interpolation.
721
- const yamlParts = Object.values(resolvedResources).map((resource) => {
876
+ const yamlParts = orderedResources.map((resource) => {
722
877
  // Remove TypeKro-specific fields and generate clean Kubernetes YAML
723
878
  const cleanResource = { ...resource };
724
879
  delete cleanResource.id; // Remove TypeKro id field
@@ -766,6 +921,167 @@ export class DirectResourceFactoryImpl {
766
921
  * Create a resource graph for a specific instance
767
922
  */
768
923
  createResourceGraphForInstance(spec, instanceNameOverride) {
924
+ const execution = this.createArtifactExecutionForInstance(spec, instanceNameOverride);
925
+ this.assertExecutionCapabilities(execution, { host: 'standalone', output: 'live' });
926
+ return execution.graph;
927
+ }
928
+ assertExecutionCapabilities(execution, context) {
929
+ const compatibilityRequirements = execution.artifacts?.requiredCapabilities ??
930
+ (Object.keys(this.closures).length > 0
931
+ ? [
932
+ {
933
+ id: 'typekro.runtime-closure',
934
+ version: 1,
935
+ host: 'standalone',
936
+ output: 'live',
937
+ },
938
+ ]
939
+ : []);
940
+ assertAdapterCapabilitiesSupported(compatibilityRequirements, {
941
+ target: 'direct',
942
+ ...context,
943
+ });
944
+ }
945
+ createArtifactExecutionForInstance(spec, instanceNameOverride, options = {}) {
946
+ const legacyGraph = this.createLegacyResourceGraphForInstance(spec, instanceNameOverride);
947
+ const capture = this.factoryOptions.semanticCapture;
948
+ if (!capture)
949
+ return { graph: legacyGraph };
950
+ const configuredPlan = this.factoryOptions.plan ?? {};
951
+ const planOptions = {
952
+ ...configuredPlan,
953
+ aspects: configuredPlan.aspects ?? this.factoryOptions.aspects ?? [],
954
+ };
955
+ const materializedSourceIds = legacyGraph.resources
956
+ .map(({ manifest }) => getResourceId(manifest))
957
+ .filter((id) => !!id);
958
+ const containsExpandedIteration = new Set(materializedSourceIds).size !== materializedSourceIds.length;
959
+ // Re-execution expands collection bodies into concrete resources that
960
+ // intentionally share one authoring id. A materialized node map cannot
961
+ // represent those repetitions without losing their iteration identity, so
962
+ // retain the analyzer-proven PlanIterationDimension and let the direct
963
+ // runtime adapter expand it. Non-collection graphs keep their concrete
964
+ // materialized desired state, including nested composition resolution.
965
+ const plan = containsExpandedIteration
966
+ ? capture.plan(spec, planOptions)
967
+ : capture.planMaterialized(spec, legacyGraph, planOptions);
968
+ const artifacts = compileDirectArtifactPlan(plan, {
969
+ strict: true,
970
+ applyPolicy: this.getArtifactApplyPolicy(),
971
+ });
972
+ const placeholderArtifactOutputs = options.preserveArtifactOutputs
973
+ ? Object.fromEntries(artifacts.artifactRequirements.map((requirement) => [
974
+ requirement.id,
975
+ Object.fromEntries(requirement.outputs.map((output) => [
976
+ output,
977
+ `__typekro_artifact_${encodeURIComponent(requirement.id)}_${encodeURIComponent(output)}__`,
978
+ ])),
979
+ ]))
980
+ : undefined;
981
+ const runtimeResources = Object.fromEntries(legacyGraph.resources.flatMap((resource) => {
982
+ const logicalId = getResourceId(resource.manifest);
983
+ return logicalId ? [[logicalId, resource.manifest]] : [];
984
+ }));
985
+ const capturedSensitiveBindings = {};
986
+ const mergeSensitiveBindings = (incoming, context) => {
987
+ for (const [binding, bindingValue] of Object.entries(incoming)) {
988
+ if (Object.hasOwn(capturedSensitiveBindings, binding) &&
989
+ !Object.is(capturedSensitiveBindings[binding], bindingValue)) {
990
+ throw new TypeKroError(`Sensitive binding ${binding} resolved to conflicting values while ${context}.`, 'DIRECT_SENSITIVE_BINDING_CONFLICT', { binding });
991
+ }
992
+ capturedSensitiveBindings[binding] = bindingValue;
993
+ }
994
+ };
995
+ for (const artifact of artifacts.resources) {
996
+ if (!artifact.desired)
997
+ continue;
998
+ const sourceNodeId = artifact.sourceNodeId ?? artifact.id;
999
+ const concrete = runtimeResources[sourceNodeId];
1000
+ if (!concrete)
1001
+ continue;
1002
+ mergeSensitiveBindings(collectPlanValueSensitiveBindings(artifact.desired, concrete, `$.resources.${artifact.id}.desired`), `capturing direct artifact ${artifact.id}`);
1003
+ }
1004
+ let effectiveSensitiveBindings = {
1005
+ ...capturedSensitiveBindings,
1006
+ };
1007
+ if (options.sensitiveBindings) {
1008
+ mergeSensitiveBindings(options.sensitiveBindings, 'applying direct materialization inputs');
1009
+ effectiveSensitiveBindings = { ...capturedSensitiveBindings };
1010
+ }
1011
+ if (options.staticYamlOptions) {
1012
+ const requiredBindings = new Set();
1013
+ let containsSensitiveValue = false;
1014
+ for (const artifact of artifacts.resources) {
1015
+ for (const value of directArtifactPlanValues(artifact)) {
1016
+ planValueSensitiveBindingNames(value).forEach((binding) => requiredBindings.add(binding));
1017
+ containsSensitiveValue ||= planValueContainsSensitiveValue(value);
1018
+ }
1019
+ }
1020
+ effectiveSensitiveBindings = resolveStaticYamlSensitiveBindings([...requiredBindings], capturedSensitiveBindings, options.staticYamlOptions, `Direct factory ${this.name} YAML`, containsSensitiveValue);
1021
+ }
1022
+ const legacyGraphIdBySourceNodeId = new Map(legacyGraph.resources.flatMap(({ id, manifest }) => {
1023
+ const sourceNodeId = getResourceId(manifest);
1024
+ return sourceNodeId ? [[sourceNodeId, id]] : [];
1025
+ }));
1026
+ const graphIdsByArtifactId = Object.fromEntries(artifacts.resources.flatMap((artifact) => {
1027
+ const graphId = legacyGraphIdBySourceNodeId.get(artifact.sourceNodeId ?? artifact.id);
1028
+ return graphId ? [[artifact.id, graphId]] : [];
1029
+ }));
1030
+ const readinessEvaluators = Object.fromEntries([
1031
+ ...legacyGraph.resources.flatMap(({ id, manifest }) => {
1032
+ const evaluator = getReadinessEvaluator(manifest);
1033
+ const resourceId = getResourceId(manifest);
1034
+ if (!evaluator)
1035
+ return [];
1036
+ return [...new Set([id, resourceId].filter((value) => !!value))].map((value) => [`readiness:${value}`, evaluator]);
1037
+ }),
1038
+ ...Object.entries(capture.ir.resources).flatMap(([logicalId, manifest]) => {
1039
+ const evaluator = getReadinessEvaluator(manifest);
1040
+ const resourceId = getResourceId(manifest);
1041
+ if (!evaluator)
1042
+ return [];
1043
+ return [
1044
+ ...new Set([logicalId, resourceId].filter((value) => !!value)),
1045
+ ].map((value) => [`readiness:${value}`, evaluator]);
1046
+ }),
1047
+ ]);
1048
+ return {
1049
+ artifacts,
1050
+ graph: directArtifactPlanToResourceGraph(artifacts, {
1051
+ instanceName: instanceNameOverride ?? this.generateInstanceName(spec),
1052
+ graphName: legacyGraph.name,
1053
+ graphIdsByArtifactId,
1054
+ spec,
1055
+ ...(Object.keys(effectiveSensitiveBindings).length > 0
1056
+ ? { sensitive: effectiveSensitiveBindings }
1057
+ : {}),
1058
+ ...(placeholderArtifactOutputs ? { artifactOutputs: placeholderArtifactOutputs } : {}),
1059
+ runtimeResources,
1060
+ readinessEvaluators,
1061
+ resolveReadinessStrategy: resolvePortableReadinessStrategy,
1062
+ // Existing singleton ownership is already reconciled before this graph
1063
+ // executes. Keep compiler-generated owner operations out of the app graph.
1064
+ includeSupportingArtifacts: false,
1065
+ }),
1066
+ };
1067
+ }
1068
+ getArtifactApplyPolicy() {
1069
+ if (this.factoryOptions.applyPolicy)
1070
+ return this.factoryOptions.applyPolicy;
1071
+ return {
1072
+ strategy: 'create-or-patch',
1073
+ existingResource: 'patch',
1074
+ immutableFieldPolicy: 'fail',
1075
+ };
1076
+ }
1077
+ /**
1078
+ * Legacy composition materializer retained as the capture frontend while the
1079
+ * semantic planner is built from current authoring machinery. Executors must
1080
+ * call createResourceGraphForInstance(), not this method.
1081
+ *
1082
+ * @internal
1083
+ */
1084
+ createLegacyResourceGraphForInstance(spec, instanceNameOverride) {
769
1085
  const dependencyResolver = new DependencyResolver();
770
1086
  const resolvedResources = applyAspects(this.resolveResourcesForSpec(spec), {
771
1087
  mode: 'direct',
@@ -818,7 +1134,12 @@ export class DirectResourceFactoryImpl {
818
1134
  });
819
1135
  // Convert to DeployableK8sResource format expected by dependency resolver
820
1136
  const deployableResources = resourceArray;
821
- const dependencyGraph = dependencyResolver.buildDependencyGraph(deployableResources);
1137
+ const knownExternalResourceIds = new Set(Object.entries(this.resolvedResourceKeysForHydration ?? {}).flatMap(([captureId, resource]) => Reflect.get(resource, '__externalRef') === true
1138
+ ? [captureId, getResourceId(resource)].filter((id) => !!id)
1139
+ : []));
1140
+ const dependencyGraph = dependencyResolver.buildDependencyGraph(deployableResources, {
1141
+ knownExternalResourceIds,
1142
+ });
822
1143
  // Create resources in the format expected by DirectDeploymentEngine
823
1144
  const formattedResources = deployableResources.map((resource) => ({
824
1145
  id: resource.id, // Already prefixed with instance name above
@@ -841,59 +1162,132 @@ export class DirectResourceFactoryImpl {
841
1162
  * dependencies' live state before applying.
842
1163
  */
843
1164
  async toAlchemyResources(spec, opts) {
844
- const graph = this.createResourceGraphForInstance(spec, opts?.instanceNameOverride);
845
- const kubeConfigOptions = extractSerializableKubeConfigOptions(this.getClientProvider().getKubeConfig(), this.factoryOptions.skipTLSVerify === true ? true : undefined);
1165
+ const execution = this.createArtifactExecutionForInstance(spec, opts?.instanceNameOverride, {
1166
+ preserveArtifactOutputs: true,
1167
+ });
1168
+ this.assertExecutionCapabilities(execution, { host: 'alchemy', output: 'live' });
1169
+ const graph = execution.graph;
1170
+ const persistence = this.factoryOptions.alchemyKubeConfig ??
1171
+ (this.factoryOptions.kubeConfig === undefined
1172
+ ? { source: { kind: 'default' } }
1173
+ : undefined);
1174
+ const kubeConfig = this.factoryOptions.kubeConfig ??
1175
+ (persistence?.source ? undefined : this.getClientProvider().getKubeConfig());
1176
+ const kubeConfigOptions = extractSerializableKubeConfigOptions(kubeConfig, {
1177
+ ...(this.factoryOptions.skipTLSVerify === true ? { skipTLSVerifyOverride: true } : {}),
1178
+ ...(persistence ? { persistence } : {}),
1179
+ });
846
1180
  const byGraphId = new Map();
1181
+ const artifactByLogicalId = new Map(execution.artifacts?.resources.map((artifact) => [
1182
+ artifact.sourceNodeId ?? artifact.id,
1183
+ artifact,
1184
+ ]) ?? []);
1185
+ const executionArtifacts = execution.artifacts;
1186
+ const materializationByArtifactId = new Map(executionArtifacts?.resources.map((artifact) => [
1187
+ artifact.id,
1188
+ createDirectArtifactExecutionMaterialization(executionArtifacts, artifact.id, { spec }),
1189
+ ]) ?? []);
1190
+ const hasSensitiveBindings = [...materializationByArtifactId.values()].some((materialization) => Object.keys(materialization.sensitiveBindings).length > 0);
1191
+ const hasSecretPayload = graph.resources.some(({ manifest }) => manifest.kind === 'Secret' &&
1192
+ (Reflect.has(manifest, 'data') || Reflect.has(manifest, 'stringData')));
1193
+ const Redacted = hasSensitiveBindings || hasSecretPayload ? await import('effect/Redacted') : undefined;
847
1194
  for (const { id: graphId, manifest } of graph.resources) {
848
1195
  const resource = ensureReadinessEvaluator(manifest);
849
1196
  byGraphId.set(graphId, {
850
1197
  resource,
851
1198
  alchemyId: createAlchemyResourceId(resource, this.namespace),
852
1199
  logicalId: getResourceId(manifest) ?? graphId,
853
- serialized: JSON.stringify(manifest),
854
1200
  });
855
1201
  }
856
- const nodeByLogicalId = new Map(Array.from(byGraphId.values(), (n) => [n.logicalId, n]));
857
- const logicalIds = new Set(nodeByLogicalId.keys());
858
- const alchemyIdByLogicalId = new Map(Array.from(byGraphId.values(), (n) => [n.logicalId, n.alchemyId]));
859
- // Compute each node's dependency logical-ids. The dependency graph captures `KubernetesRef`
860
- // OBJECT references, but by the time the instance is resolved most cross-resource references
861
- // have been serialized to CEL strings (`${otherResource.status.field}`) that the graph no
862
- // longer sees — so we ALSO scan each manifest's serialized form for references to sibling
863
- // logical ids. Union of both is the complete dependency set.
864
- const depsByLogicalId = new Map();
865
- for (const [graphId, node] of byGraphId) {
866
- const deps = new Set();
867
- for (const depGraphId of graph.dependencyGraph.getDependencies(graphId)) {
868
- const dep = byGraphId.get(depGraphId);
869
- if (dep)
870
- deps.add(dep.logicalId);
871
- }
872
- for (const ref of extractResourceReferencesFromExpression(node.serialized)) {
873
- const head = ref.split(/[.[]/, 1)[0];
874
- if (head && head !== node.logicalId && logicalIds.has(head))
875
- deps.add(head);
876
- }
877
- depsByLogicalId.set(node.logicalId, deps);
878
- }
879
1202
  const waitForReady = this.factoryOptions.waitForReady ?? false;
880
1203
  const timeout = this.factoryOptions.timeout;
881
- // Topologically sort by the COMPLETE dependency set (Kahn) so each declaration precedes its
882
- // dependents `getTopologicalOrder` alone would miss the CEL-string edges recovered above.
883
- const ordered = topoSortLogicalIds(logicalIds, depsByLogicalId);
884
- return ordered.flatMap((logicalId) => {
885
- const node = nodeByLogicalId.get(logicalId);
1204
+ // The semantic planner records typed output/existence/readiness/ownership edges, and the
1205
+ // direct artifact adapter lowers those edges into this graph. Alchemy must consume that
1206
+ // authoritative ordering rather than reinterpreting serialized manifest strings.
1207
+ const ordered = graph.dependencyGraph.getTopologicalOrder();
1208
+ return ordered.flatMap((graphId) => {
1209
+ const node = byGraphId.get(graphId);
886
1210
  if (!node)
887
1211
  return [];
888
- const dependsOn = Array.from(depsByLogicalId.get(logicalId) ?? [])
889
- .map((depLogicalId) => alchemyIdByLogicalId.get(depLogicalId))
1212
+ const artifact = artifactByLogicalId.get(node.logicalId);
1213
+ const materialization = artifact ? materializationByArtifactId.get(artifact.id) : undefined;
1214
+ const artifactOutputUses = materialization
1215
+ ? collectArtifactOutputUses(materialization.record.artifact)
1216
+ : [];
1217
+ const artifactRequirementIds = new Set(artifactOutputUses.map((use) => use.requirementId));
1218
+ const artifactRequirements = executionArtifacts?.artifactRequirements.filter((requirement) => artifactRequirementIds.has(requirement.id)) ?? [];
1219
+ const declarationArtifactOutputs = Object.fromEntries(artifactRequirements.map((requirement) => [
1220
+ requirement.id,
1221
+ Object.fromEntries(requirement.outputs.map((output) => [
1222
+ output,
1223
+ `__typekro_artifact_${encodeURIComponent(requirement.id)}_${encodeURIComponent(output)}__`,
1224
+ ])),
1225
+ ]));
1226
+ const sensitiveBindings = materialization && Redacted
1227
+ ? Object.fromEntries(Object.entries(materialization.sensitiveBindings).map(([binding, value]) => [
1228
+ binding,
1229
+ Redacted.make(value),
1230
+ ]))
1231
+ : undefined;
1232
+ const strategy = materialization?.record.artifact.readiness.strategy;
1233
+ const evaluator = getReadinessEvaluator(node.resource);
1234
+ const readinessEvaluators = strategy?.kind === 'runtime-binding' && evaluator
1235
+ ? { [strategy.binding]: evaluator }
1236
+ : undefined;
1237
+ const declarationResource = materialization &&
1238
+ ((sensitiveBindings && Object.keys(sensitiveBindings).length > 0) ||
1239
+ artifactOutputUses.length > 0)
1240
+ ? materializeDirectArtifactManifest(materialization.record.artifact, {
1241
+ instanceName: opts?.instanceNameOverride ?? this.generateInstanceName(spec),
1242
+ ...(sensitiveBindings ? { sensitive: sensitiveBindings } : {}),
1243
+ ...(artifactOutputUses.length > 0
1244
+ ? { artifactOutputs: declarationArtifactOutputs }
1245
+ : {}),
1246
+ runtimeResources: { [node.logicalId]: node.resource },
1247
+ ...(readinessEvaluators ? { readinessEvaluators } : {}),
1248
+ resolveReadinessStrategy: resolvePortableReadinessStrategy,
1249
+ }, getResourceId(node.resource) ?? node.logicalId, node.logicalId)
1250
+ : Redacted && node.resource.kind === 'Secret'
1251
+ ? {
1252
+ ...node.resource,
1253
+ ...(Reflect.has(node.resource, 'data')
1254
+ ? {
1255
+ data: Object.fromEntries(Object.entries(Reflect.get(node.resource, 'data') ?? {}).map(([key, value]) => [key, Redacted.make(value)])),
1256
+ }
1257
+ : {}),
1258
+ ...(Reflect.has(node.resource, 'stringData')
1259
+ ? {
1260
+ stringData: Object.fromEntries(Object.entries(Reflect.get(node.resource, 'stringData') ??
1261
+ {}).map(([key, value]) => [key, Redacted.make(value)])),
1262
+ }
1263
+ : {}),
1264
+ }
1265
+ : node.resource;
1266
+ if (declarationResource !== node.resource) {
1267
+ copyResourceMetadata(node.resource, declarationResource);
1268
+ }
1269
+ const dependsOn = graph.dependencyGraph
1270
+ .getDependencies(graphId)
1271
+ .map((dependencyGraphId) => byGraphId.get(dependencyGraphId)?.alchemyId)
890
1272
  .filter((id) => id !== undefined);
891
1273
  return {
892
1274
  id: node.alchemyId,
893
1275
  dependsOn,
1276
+ ...(artifactRequirements.length > 0 ? { artifactRequirements } : {}),
1277
+ ...(artifactOutputUses.length > 0 ? { artifactOutputUses } : {}),
894
1278
  props: {
895
- resource: node.resource,
1279
+ resource: declarationResource,
896
1280
  resourceId: node.logicalId,
1281
+ ...(materialization
1282
+ ? {
1283
+ artifactExecutionRecord: encodeDirectArtifactExecutionRecord(materialization.record),
1284
+ ...(sensitiveBindings && Object.keys(sensitiveBindings).length > 0
1285
+ ? { sensitiveBindings }
1286
+ : {}),
1287
+ ...(artifactRequirements.length > 0 ? { artifactRequirements } : {}),
1288
+ ...(artifactOutputUses.length > 0 ? { artifactOutputUses } : {}),
1289
+ }
1290
+ : {}),
897
1291
  namespace: this.namespace,
898
1292
  deploymentStrategy: 'direct',
899
1293
  kubeConfigOptions,
@@ -1414,13 +1808,15 @@ export class DirectResourceFactoryImpl {
1414
1808
  // Use the imported shared utility
1415
1809
  return generateInstanceName(spec);
1416
1810
  }
1417
- async ensureTargetNamespace(namespace = this.namespace) {
1811
+ async ensureTargetNamespace(namespace = this.namespace, abortSignal) {
1418
1812
  try {
1813
+ abortSignal?.throwIfAborted();
1419
1814
  const { createBunCompatibleKubernetesObjectApi } = await import('../kubernetes/bun-api-client.js');
1420
1815
  const k8sApi = createBunCompatibleKubernetesObjectApi(this.getClientProvider().getKubeConfig());
1421
1816
  const waitForNamespaceDeletion = async () => {
1422
1817
  const start = Date.now();
1423
1818
  while (Date.now() - start < 120000) {
1819
+ abortSignal?.throwIfAborted();
1424
1820
  try {
1425
1821
  const existing = (await k8sApi.read({
1426
1822
  apiVersion: 'v1',
@@ -1439,7 +1835,25 @@ export class DirectResourceFactoryImpl {
1439
1835
  }
1440
1836
  throw pollError;
1441
1837
  }
1442
- await new Promise((resolve) => setTimeout(resolve, 1000));
1838
+ await new Promise((resolve, reject) => {
1839
+ if (!abortSignal) {
1840
+ setTimeout(resolve, 1000);
1841
+ return;
1842
+ }
1843
+ const onAbort = () => {
1844
+ clearTimeout(delay);
1845
+ reject(abortSignal.reason ?? new DOMException('The operation was aborted', 'AbortError'));
1846
+ };
1847
+ const delay = setTimeout(() => {
1848
+ abortSignal.removeEventListener('abort', onAbort);
1849
+ resolve();
1850
+ }, 1000);
1851
+ if (abortSignal.aborted) {
1852
+ onAbort();
1853
+ return;
1854
+ }
1855
+ abortSignal.addEventListener('abort', onAbort, { once: true });
1856
+ });
1443
1857
  }
1444
1858
  throw new Error(`Namespace ${namespace} is still terminating after 120000ms`);
1445
1859
  };
@@ -1502,7 +1916,7 @@ export class DirectResourceFactoryImpl {
1502
1916
  throw new ResourceGraphFactoryError(`Failed to ensure target namespace "${namespace}" exists: ${ensureError(error).message}`, this.name, 'deployment', ensureError(error));
1503
1917
  }
1504
1918
  }
1505
- async ensureSingletonOwners(spec) {
1919
+ async ensureSingletonOwners(spec, operationSignal) {
1506
1920
  const discoveredSingletons = new Map();
1507
1921
  if (this.factoryOptions.compositionFn) {
1508
1922
  const singletonContext = createCompositionContext('singleton-owner-discovery');
@@ -1521,7 +1935,7 @@ export class DirectResourceFactoryImpl {
1521
1935
  if (discoveredSingletons.size === 0)
1522
1936
  return;
1523
1937
  for (const definition of discoveredSingletons.values()) {
1524
- await this.ensureTargetNamespace(definition.registryNamespace);
1938
+ await this.ensureTargetNamespace(definition.registryNamespace, operationSignal);
1525
1939
  const singletonInstanceName = getSingletonInstanceName(definition.id);
1526
1940
  const singletonFactory = definition.composition.factory('direct', {
1527
1941
  namespace: definition.registryNamespace,
@@ -1554,7 +1968,7 @@ export class DirectResourceFactoryImpl {
1554
1968
  const hasHelmReleaseResources = expectedGraph.resources.some((resource) => resource.manifest.kind === 'HelmRelease');
1555
1969
  const legacyStatus = this.reExecuteSingletonStatusFromDiscoveredResources(definition, discoveredResources);
1556
1970
  if (legacyStatus) {
1557
- this.singletonOwnerStatuses.set(getSingletonResourceId(definition.key), legacyStatus);
1971
+ this.rememberSingletonOwnerStatus(definition, legacyStatus);
1558
1972
  }
1559
1973
  if (hasAllExpectedResources && !hasHelmReleaseResources) {
1560
1974
  this.logger.warn('Skipping direct singleton owner reconciliation for legacy resources without a spec fingerprint', {
@@ -1580,13 +1994,14 @@ export class DirectResourceFactoryImpl {
1580
1994
  const singletonDeployOptions = {
1581
1995
  instanceNameOverride: singletonInstanceName,
1582
1996
  singletonSpecFingerprint: singletonSpecFingerprintAnnotationValue(definition.specFingerprint),
1997
+ ...(operationSignal ? { operationSignal } : {}),
1583
1998
  };
1584
1999
  const deployedSingleton = await singletonFactory.deploy(definition.spec, singletonDeployOptions);
1585
2000
  const singletonStatus = deployedSingleton.status;
1586
2001
  if (singletonStatus &&
1587
2002
  typeof singletonStatus === 'object' &&
1588
2003
  !Array.isArray(singletonStatus)) {
1589
- this.singletonOwnerStatuses.set(getSingletonResourceId(definition.key), singletonStatus);
2004
+ this.rememberSingletonOwnerStatus(definition, singletonStatus);
1590
2005
  }
1591
2006
  }
1592
2007
  finally {
@@ -1594,6 +2009,40 @@ export class DirectResourceFactoryImpl {
1594
2009
  }
1595
2010
  }
1596
2011
  }
2012
+ /**
2013
+ * Expose already-reconciled singleton owners as reference seeds for the consumer graph.
2014
+ * Direct mode owns the physical singleton resources directly; the logical KRO owner CR exists
2015
+ * only as a composition boundary and must not be read from the Kubernetes API.
2016
+ */
2017
+ getExternalReferenceSeeds() {
2018
+ return [...this.singletonOwnerReferenceSeeds.values()];
2019
+ }
2020
+ rememberSingletonOwnerStatus(definition, status) {
2021
+ const id = getSingletonResourceId(definition.key);
2022
+ const { apiVersion, kind } = singletonInstanceTypeMeta(definition.composition);
2023
+ const name = getSingletonInstanceName(definition.id);
2024
+ const manifest = {
2025
+ apiVersion,
2026
+ kind,
2027
+ metadata: {
2028
+ name,
2029
+ namespace: definition.registryNamespace,
2030
+ },
2031
+ status,
2032
+ };
2033
+ this.singletonOwnerStatuses.set(id, status);
2034
+ this.singletonOwnerReferenceSeeds.set(id, {
2035
+ id,
2036
+ kind,
2037
+ name,
2038
+ namespace: definition.registryNamespace,
2039
+ manifest,
2040
+ liveManifest: manifest,
2041
+ status: 'ready',
2042
+ applied: false,
2043
+ deployedAt: new Date(),
2044
+ });
2045
+ }
1597
2046
  reExecuteSingletonStatusFromDiscoveredResources(definition, resources) {
1598
2047
  if (resources.length === 0)
1599
2048
  return null;
@@ -1680,45 +2129,6 @@ export class DirectResourceFactoryImpl {
1680
2129
  return `${kind}/${namespace ?? ''}/${name}`;
1681
2130
  }
1682
2131
  }
1683
- /**
1684
- * Kahn topological sort of `ids` by their dependency set (`deps`: id → set of ids it depends on),
1685
- * returning dependencies-first order. Edges to ids outside the set are ignored; if a cycle leaves
1686
- * nodes unprocessed they're appended in stable order (best effort) rather than throwing.
1687
- */
1688
- function topoSortLogicalIds(ids, deps) {
1689
- const inDegree = new Map();
1690
- const dependents = new Map();
1691
- for (const id of ids) {
1692
- inDegree.set(id, 0);
1693
- dependents.set(id, []);
1694
- }
1695
- for (const id of ids) {
1696
- for (const dep of deps.get(id) ?? []) {
1697
- if (!ids.has(dep))
1698
- continue;
1699
- inDegree.set(id, (inDegree.get(id) ?? 0) + 1);
1700
- dependents.get(dep)?.push(id);
1701
- }
1702
- }
1703
- const queue = Array.from(ids).filter((id) => (inDegree.get(id) ?? 0) === 0);
1704
- const result = [];
1705
- while (queue.length > 0) {
1706
- const id = queue.shift();
1707
- result.push(id);
1708
- for (const dependent of dependents.get(id) ?? []) {
1709
- const next = (inDegree.get(dependent) ?? 0) - 1;
1710
- inDegree.set(dependent, next);
1711
- if (next === 0)
1712
- queue.push(dependent);
1713
- }
1714
- }
1715
- if (result.length < ids.size) {
1716
- for (const id of ids)
1717
- if (!result.includes(id))
1718
- result.push(id);
1719
- }
1720
- return result;
1721
- }
1722
2132
  /**
1723
2133
  * Recursively walk a resolved resource tree and collect any remaining
1724
2134
  * KubernetesRef or CelExpression objects. These cannot be serialized