@temporalio/core-bridge 1.13.2 → 1.14.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 (388) hide show
  1. package/Cargo.lock +135 -100
  2. package/Cargo.toml +3 -2
  3. package/{sdk-core/fsm/rustfsm_trait/LICENSE.txt → LICENSE} +5 -5
  4. package/README.md +0 -1
  5. package/bridge-macros/Cargo.toml +16 -0
  6. package/bridge-macros/src/derive_js_function.rs +126 -0
  7. package/bridge-macros/src/derive_tryfromjs.rs +138 -0
  8. package/bridge-macros/src/derive_tryintojs.rs +151 -0
  9. package/bridge-macros/src/lib.rs +42 -0
  10. package/lib/native.d.ts +13 -6
  11. package/package.json +6 -5
  12. package/releases/aarch64-apple-darwin/index.node +0 -0
  13. package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
  14. package/releases/x86_64-apple-darwin/index.node +0 -0
  15. package/releases/x86_64-pc-windows-msvc/index.node +0 -0
  16. package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
  17. package/sdk-core/.cargo/config.toml +9 -3
  18. package/sdk-core/.github/workflows/per-pr.yml +42 -5
  19. package/sdk-core/AGENTS.md +17 -19
  20. package/sdk-core/Cargo.toml +6 -7
  21. package/sdk-core/README.md +12 -15
  22. package/sdk-core/arch_docs/diagrams/deps.svg +102 -0
  23. package/sdk-core/{client → crates/client}/Cargo.toml +7 -9
  24. package/sdk-core/{client → crates/client}/src/lib.rs +110 -159
  25. package/sdk-core/{client → crates/client}/src/metrics.rs +1 -1
  26. package/sdk-core/{client → crates/client}/src/raw.rs +73 -44
  27. package/sdk-core/crates/client/src/request_extensions.rs +40 -0
  28. package/sdk-core/{client → crates/client}/src/retry.rs +24 -17
  29. package/sdk-core/crates/client/src/worker/mod.rs +1468 -0
  30. package/sdk-core/{client → crates/client}/src/workflow_handle/mod.rs +4 -4
  31. package/sdk-core/{core-api → crates/common}/Cargo.toml +17 -8
  32. package/sdk-core/crates/common/protos/api_cloud_upstream/VERSION +1 -0
  33. package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/account/v1/message.proto +18 -0
  34. package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/request_response.proto +38 -11
  35. package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/service.proto +21 -4
  36. package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/operation/v1/message.proto +6 -6
  37. package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/sink/v1/message.proto +22 -0
  38. package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/create-release.yml +5 -0
  39. package/sdk-core/{core-api → crates/common}/src/envconfig.rs +2 -2
  40. package/sdk-core/{core-api → crates/common}/src/errors.rs +8 -1
  41. package/sdk-core/{fsm/rustfsm_trait/src/lib.rs → crates/common/src/fsm_trait.rs} +1 -27
  42. package/sdk-core/{core-api → crates/common}/src/lib.rs +24 -9
  43. package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/canned_histories.rs +1 -1
  44. package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/history_builder.rs +1 -1
  45. package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/history_info.rs +2 -2
  46. package/sdk-core/{sdk-core-protos/src/lib.rs → crates/common/src/protos/mod.rs} +18 -17
  47. package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/test_utils.rs +1 -1
  48. package/sdk-core/{core-api → crates/common}/src/telemetry/metrics.rs +447 -50
  49. package/sdk-core/{core-api → crates/common}/src/telemetry.rs +3 -1
  50. package/sdk-core/{core-api → crates/common}/src/worker.rs +112 -18
  51. package/sdk-core/crates/common/tests/worker_task_types_test.rs +129 -0
  52. package/sdk-core/crates/macros/Cargo.toml +23 -0
  53. package/sdk-core/{fsm/rustfsm_procmacro → crates/macros}/src/lib.rs +6 -11
  54. package/sdk-core/{sdk → crates/sdk}/Cargo.toml +10 -10
  55. package/sdk-core/{sdk → crates/sdk}/src/activity_context.rs +8 -6
  56. package/sdk-core/{sdk → crates/sdk}/src/interceptors.rs +1 -1
  57. package/sdk-core/{sdk → crates/sdk}/src/lib.rs +42 -37
  58. package/sdk-core/{sdk → crates/sdk}/src/workflow_context/options.rs +2 -2
  59. package/sdk-core/{sdk → crates/sdk}/src/workflow_context.rs +21 -19
  60. package/sdk-core/{sdk → crates/sdk}/src/workflow_future.rs +1 -1
  61. package/sdk-core/{core → crates/sdk-core}/Cargo.toml +32 -25
  62. package/sdk-core/{tests → crates/sdk-core/benches}/workflow_replay_bench.rs +10 -10
  63. package/sdk-core/crates/sdk-core/machine_coverage/ActivityMachine_Coverage.puml +32 -0
  64. package/sdk-core/crates/sdk-core/machine_coverage/CancelExternalMachine_Coverage.puml +9 -0
  65. package/sdk-core/crates/sdk-core/machine_coverage/CancelWorkflowMachine_Coverage.puml +6 -0
  66. package/sdk-core/crates/sdk-core/machine_coverage/ChildWorkflowMachine_Coverage.puml +27 -0
  67. package/sdk-core/crates/sdk-core/machine_coverage/CompleteWorkflowMachine_Coverage.puml +6 -0
  68. package/sdk-core/crates/sdk-core/machine_coverage/ContinueAsNewWorkflowMachine_Coverage.puml +6 -0
  69. package/sdk-core/crates/sdk-core/machine_coverage/FailWorkflowMachine_Coverage.puml +6 -0
  70. package/sdk-core/crates/sdk-core/machine_coverage/LocalActivityMachine_Coverage.puml +23 -0
  71. package/sdk-core/crates/sdk-core/machine_coverage/ModifyWorkflowPropertiesMachine_Coverage.puml +5 -0
  72. package/sdk-core/crates/sdk-core/machine_coverage/PatchMachine_Coverage.puml +8 -0
  73. package/sdk-core/crates/sdk-core/machine_coverage/SignalExternalMachine_Coverage.puml +12 -0
  74. package/sdk-core/crates/sdk-core/machine_coverage/TimerMachine_Coverage.puml +13 -0
  75. package/sdk-core/crates/sdk-core/machine_coverage/UpdateMachine_Coverage.puml +19 -0
  76. package/sdk-core/crates/sdk-core/machine_coverage/UpsertSearchAttributesMachine_Coverage.puml +5 -0
  77. package/sdk-core/crates/sdk-core/machine_coverage/WorkflowTaskMachine_Coverage.puml +11 -0
  78. package/sdk-core/{core → crates/sdk-core}/src/abstractions.rs +62 -6
  79. package/sdk-core/crates/sdk-core/src/antithesis.rs +60 -0
  80. package/sdk-core/{core → crates/sdk-core}/src/core_tests/activity_tasks.rs +36 -31
  81. package/sdk-core/{core → crates/sdk-core}/src/core_tests/mod.rs +12 -9
  82. package/sdk-core/{core → crates/sdk-core}/src/core_tests/queries.rs +24 -21
  83. package/sdk-core/{core → crates/sdk-core}/src/core_tests/replay_flag.rs +10 -8
  84. package/sdk-core/{core → crates/sdk-core}/src/core_tests/updates.rs +17 -15
  85. package/sdk-core/{core → crates/sdk-core}/src/core_tests/workers.rs +242 -17
  86. package/sdk-core/{core → crates/sdk-core}/src/core_tests/workflow_cancels.rs +1 -1
  87. package/sdk-core/{core → crates/sdk-core}/src/core_tests/workflow_tasks.rs +126 -39
  88. package/sdk-core/{core → crates/sdk-core}/src/debug_client.rs +1 -1
  89. package/sdk-core/{core → crates/sdk-core}/src/ephemeral_server/mod.rs +3 -3
  90. package/sdk-core/crates/sdk-core/src/histfetch.rs +33 -0
  91. package/sdk-core/{core → crates/sdk-core}/src/internal_flags.rs +4 -3
  92. package/sdk-core/{core → crates/sdk-core}/src/lib.rs +85 -43
  93. package/sdk-core/{core → crates/sdk-core}/src/pollers/mod.rs +8 -6
  94. package/sdk-core/{core → crates/sdk-core}/src/pollers/poll_buffer.rs +51 -16
  95. package/sdk-core/{core → crates/sdk-core}/src/protosext/mod.rs +1 -1
  96. package/sdk-core/{core → crates/sdk-core}/src/protosext/protocol_messages.rs +1 -1
  97. package/sdk-core/{core → crates/sdk-core}/src/replay/mod.rs +14 -11
  98. package/sdk-core/{core → crates/sdk-core}/src/retry_logic.rs +19 -1
  99. package/sdk-core/{core → crates/sdk-core}/src/telemetry/log_export.rs +2 -2
  100. package/sdk-core/{core → crates/sdk-core}/src/telemetry/metrics.rs +80 -34
  101. package/sdk-core/{core → crates/sdk-core}/src/telemetry/mod.rs +4 -4
  102. package/sdk-core/{core → crates/sdk-core}/src/telemetry/otel.rs +1 -1
  103. package/sdk-core/{core → crates/sdk-core}/src/telemetry/prometheus_meter.rs +13 -13
  104. package/sdk-core/{core → crates/sdk-core}/src/telemetry/prometheus_server.rs +2 -2
  105. package/sdk-core/{core → crates/sdk-core}/src/test_help/integ_helpers.rs +127 -40
  106. package/sdk-core/{core → crates/sdk-core}/src/test_help/unit_helpers.rs +13 -11
  107. package/sdk-core/{core → crates/sdk-core}/src/worker/activities/activity_heartbeat_manager.rs +2 -2
  108. package/sdk-core/{core → crates/sdk-core}/src/worker/activities/local_activities.rs +14 -12
  109. package/sdk-core/{core → crates/sdk-core}/src/worker/activities.rs +21 -12
  110. package/sdk-core/{core → crates/sdk-core}/src/worker/client/mocks.rs +25 -12
  111. package/sdk-core/{core → crates/sdk-core}/src/worker/client.rs +164 -71
  112. package/sdk-core/crates/sdk-core/src/worker/heartbeat.rs +246 -0
  113. package/sdk-core/crates/sdk-core/src/worker/mod.rs +1462 -0
  114. package/sdk-core/{core → crates/sdk-core}/src/worker/nexus.rs +15 -14
  115. package/sdk-core/{core → crates/sdk-core}/src/worker/slot_provider.rs +12 -13
  116. package/sdk-core/{core → crates/sdk-core}/src/worker/tuner/fixed_size.rs +5 -1
  117. package/sdk-core/{core → crates/sdk-core}/src/worker/tuner/resource_based.rs +453 -57
  118. package/sdk-core/{core → crates/sdk-core}/src/worker/tuner.rs +21 -4
  119. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/driven_workflow.rs +1 -1
  120. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/history_update.rs +2 -2
  121. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/activity_state_machine.rs +147 -37
  122. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/cancel_external_state_machine.rs +8 -9
  123. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/cancel_nexus_op_state_machine.rs +14 -12
  124. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/cancel_workflow_state_machine.rs +6 -7
  125. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/child_workflow_state_machine.rs +31 -37
  126. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/complete_workflow_state_machine.rs +13 -8
  127. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/continue_as_new_workflow_state_machine.rs +6 -7
  128. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/fail_workflow_state_machine.rs +6 -7
  129. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/local_activity_state_machine.rs +33 -30
  130. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/mod.rs +22 -17
  131. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/modify_workflow_properties_state_machine.rs +4 -3
  132. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/nexus_operation_state_machine.rs +20 -22
  133. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/patch_state_machine.rs +12 -11
  134. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/signal_external_state_machine.rs +9 -12
  135. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/timer_state_machine.rs +26 -13
  136. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/transition_coverage.rs +1 -2
  137. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/update_state_machine.rs +19 -13
  138. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +20 -18
  139. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/workflow_machines/local_acts.rs +1 -1
  140. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/workflow_machines.rs +61 -70
  141. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/workflow_task_state_machine.rs +13 -15
  142. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/managed_run.rs +55 -37
  143. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/mod.rs +166 -60
  144. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/run_cache.rs +10 -7
  145. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/wft_extraction.rs +4 -2
  146. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/wft_poller.rs +15 -4
  147. package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/workflow_stream.rs +30 -16
  148. package/sdk-core/{tests → crates/sdk-core/tests}/c_bridge_smoke_test.c +1 -1
  149. package/sdk-core/{tests → crates/sdk-core/tests}/cloud_tests.rs +1 -1
  150. package/sdk-core/crates/sdk-core/tests/common/fake_grpc_server.rs +106 -0
  151. package/sdk-core/{tests → crates/sdk-core/tests}/common/http_proxy.rs +1 -1
  152. package/sdk-core/{tests → crates/sdk-core/tests}/common/mod.rs +93 -74
  153. package/sdk-core/{tests → crates/sdk-core/tests}/common/workflows.rs +4 -3
  154. package/sdk-core/crates/sdk-core/tests/fsm_procmacro.rs +6 -0
  155. package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/dupe_transitions_fail.rs +1 -3
  156. package/sdk-core/crates/sdk-core/tests/fsm_trybuild/dupe_transitions_fail.stderr +12 -0
  157. package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/dynamic_dest_pass.rs +2 -4
  158. package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/forgot_name_fail.rs +1 -3
  159. package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/forgot_name_fail.stderr +4 -4
  160. package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/handler_arg_pass.rs +2 -4
  161. package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/handler_pass.rs +2 -4
  162. package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/medium_complex_pass.rs +2 -4
  163. package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/no_handle_conversions_require_into_fail.rs +2 -4
  164. package/sdk-core/crates/sdk-core/tests/fsm_trybuild/no_handle_conversions_require_into_fail.stderr +15 -0
  165. package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/simple_pass.rs +2 -4
  166. package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/struct_event_variant_fail.rs +1 -3
  167. package/sdk-core/crates/sdk-core/tests/fsm_trybuild/struct_event_variant_fail.stderr +5 -0
  168. package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/tuple_more_item_event_variant_fail.rs +1 -3
  169. package/sdk-core/crates/sdk-core/tests/fsm_trybuild/tuple_more_item_event_variant_fail.stderr +5 -0
  170. package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/tuple_zero_item_event_variant_fail.rs +1 -3
  171. package/sdk-core/crates/sdk-core/tests/fsm_trybuild/tuple_zero_item_event_variant_fail.stderr +5 -0
  172. package/sdk-core/{tests → crates/sdk-core/tests}/global_metric_tests.rs +14 -15
  173. package/sdk-core/{tests → crates/sdk-core/tests/heavy_tests}/fuzzy_workflow.rs +3 -3
  174. package/sdk-core/{tests → crates/sdk-core/tests}/heavy_tests.rs +19 -12
  175. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/activity_functions.rs +1 -1
  176. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/client_tests.rs +16 -111
  177. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/ephemeral_server_tests.rs +5 -6
  178. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/heartbeat_tests.rs +23 -19
  179. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/metrics_tests.rs +134 -60
  180. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/pagination_tests.rs +4 -4
  181. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/polling_tests.rs +37 -36
  182. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/queries_tests.rs +12 -10
  183. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/update_tests.rs +41 -29
  184. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/visibility_tests.rs +24 -19
  185. package/sdk-core/crates/sdk-core/tests/integ_tests/worker_heartbeat_tests.rs +1061 -0
  186. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/worker_tests.rs +113 -51
  187. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/worker_versioning_tests.rs +19 -17
  188. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/activities.rs +35 -30
  189. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/appdata_propagation.rs +3 -3
  190. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/cancel_external.rs +14 -9
  191. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/cancel_wf.rs +13 -8
  192. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/child_workflows.rs +48 -35
  193. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/continue_as_new.rs +14 -9
  194. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/determinism.rs +24 -15
  195. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/eager.rs +9 -4
  196. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/local_activities.rs +47 -47
  197. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/modify_wf_properties.rs +16 -11
  198. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/nexus.rs +51 -23
  199. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/patches.rs +22 -10
  200. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/replay.rs +19 -17
  201. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/resets.rs +14 -5
  202. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/signals.rs +24 -15
  203. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/stickyness.rs +8 -6
  204. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/timers.rs +28 -18
  205. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/upsert_search_attrs.rs +18 -13
  206. package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests.rs +46 -41
  207. package/sdk-core/{tests → crates/sdk-core/tests}/main.rs +15 -9
  208. package/sdk-core/{tests → crates/sdk-core/tests}/manual_tests.rs +20 -14
  209. package/sdk-core/{tests → crates/sdk-core/tests}/runner.rs +2 -2
  210. package/sdk-core/{tests → crates/sdk-core/tests}/shared_tests/mod.rs +10 -5
  211. package/sdk-core/{tests → crates/sdk-core/tests}/shared_tests/priority.rs +5 -5
  212. package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/Cargo.toml +13 -10
  213. package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/include/temporal-sdk-core-c-bridge.h +32 -23
  214. package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/client.rs +55 -32
  215. package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/envconfig.rs +1 -1
  216. package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/lib.rs +1 -1
  217. package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/metric.rs +1 -1
  218. package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/runtime.rs +24 -9
  219. package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/testing.rs +1 -1
  220. package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/tests/context.rs +11 -10
  221. package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/tests/mod.rs +7 -7
  222. package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/tests/utils.rs +3 -4
  223. package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/worker.rs +111 -58
  224. package/sdk-core/docker-cgroup-tests.sh +24 -0
  225. package/sdk-core/{docker → etc/docker}/docker-compose-ci.yaml +9 -9
  226. package/sdk-core/{docker → etc/docker}/docker-compose-telem.yaml +11 -11
  227. package/sdk-core/{docker → etc/docker}/docker-compose.yaml +8 -8
  228. package/sdk-core/{integ-with-otel.sh → etc/integ-with-otel.sh} +1 -1
  229. package/sdk-core/etc/regen-depgraph.sh +2 -2
  230. package/src/client.rs +24 -33
  231. package/src/helpers/try_from_js.rs +1 -1
  232. package/src/logs.rs +1 -1
  233. package/src/metrics.rs +3 -3
  234. package/src/runtime.rs +42 -28
  235. package/src/testing.rs +3 -3
  236. package/src/worker.rs +70 -36
  237. package/ts/native.ts +13 -6
  238. package/LICENSE.md +0 -23
  239. package/sdk-core/client/src/worker_registry/mod.rs +0 -282
  240. package/sdk-core/core/src/worker/heartbeat.rs +0 -230
  241. package/sdk-core/core/src/worker/mod.rs +0 -990
  242. package/sdk-core/etc/deps.svg +0 -162
  243. package/sdk-core/fsm/Cargo.toml +0 -21
  244. package/sdk-core/fsm/README.md +0 -3
  245. package/sdk-core/fsm/rustfsm_procmacro/Cargo.toml +0 -27
  246. package/sdk-core/fsm/rustfsm_procmacro/LICENSE.txt +0 -21
  247. package/sdk-core/fsm/rustfsm_procmacro/tests/progress.rs +0 -8
  248. package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/dupe_transitions_fail.stderr +0 -12
  249. package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/no_handle_conversions_require_into_fail.stderr +0 -15
  250. package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/struct_event_variant_fail.stderr +0 -5
  251. package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/tuple_more_item_event_variant_fail.stderr +0 -5
  252. package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/tuple_zero_item_event_variant_fail.stderr +0 -5
  253. package/sdk-core/fsm/rustfsm_trait/Cargo.toml +0 -14
  254. package/sdk-core/fsm/src/lib.rs +0 -2
  255. package/sdk-core/sdk-core-protos/Cargo.toml +0 -37
  256. package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/VERSION +0 -1
  257. /package/sdk-core/{client → crates/client}/src/callback_based.rs +0 -0
  258. /package/sdk-core/{client → crates/client}/src/proxy.rs +0 -0
  259. /package/sdk-core/{client → crates/client}/src/replaceable.rs +0 -0
  260. /package/sdk-core/{sdk-core-protos → crates/common}/build.rs +0 -0
  261. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/.github/workflows/build.yaml +0 -0
  262. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/.github/workflows/push-to-buf.yml +0 -0
  263. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/CODEOWNERS +0 -0
  264. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/LICENSE +0 -0
  265. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/Makefile +0 -0
  266. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/README.md +0 -0
  267. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/buf.gen.yaml +0 -0
  268. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/buf.lock +0 -0
  269. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/buf.yaml +0 -0
  270. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/connectivityrule/v1/message.proto +0 -0
  271. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/identity/v1/message.proto +0 -0
  272. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/namespace/v1/message.proto +0 -0
  273. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/nexus/v1/message.proto +0 -0
  274. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/region/v1/message.proto +0 -0
  275. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/resource/v1/message.proto +0 -0
  276. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/usage/v1/message.proto +0 -0
  277. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/CODEOWNERS +0 -0
  278. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  279. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/ci.yml +0 -0
  280. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/publish-docs.yml +0 -0
  281. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/push-to-buf.yml +0 -0
  282. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/trigger-api-go-delete-release.yml +0 -0
  283. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/trigger-api-go-publish-release.yml +0 -0
  284. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/trigger-api-go-update.yml +0 -0
  285. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/LICENSE +0 -0
  286. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/Makefile +0 -0
  287. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/README.md +0 -0
  288. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/api-linter.yaml +0 -0
  289. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/buf.gen.yaml +0 -0
  290. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/buf.lock +0 -0
  291. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/buf.yaml +0 -0
  292. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/api/annotations.proto +0 -0
  293. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/api/http.proto +0 -0
  294. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/any.proto +0 -0
  295. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/descriptor.proto +0 -0
  296. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/duration.proto +0 -0
  297. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/empty.proto +0 -0
  298. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/struct.proto +0 -0
  299. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/timestamp.proto +0 -0
  300. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/wrappers.proto +0 -0
  301. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/openapi/openapiv2.json +0 -0
  302. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/openapi/openapiv3.yaml +0 -0
  303. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/openapi/payload_description.txt +0 -0
  304. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/activity/v1/message.proto +0 -0
  305. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/batch/v1/message.proto +0 -0
  306. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/command/v1/message.proto +0 -0
  307. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/common/v1/message.proto +0 -0
  308. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/deployment/v1/message.proto +0 -0
  309. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/batch_operation.proto +0 -0
  310. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/command_type.proto +0 -0
  311. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/common.proto +0 -0
  312. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/deployment.proto +0 -0
  313. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/event_type.proto +0 -0
  314. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +0 -0
  315. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/namespace.proto +0 -0
  316. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/nexus.proto +0 -0
  317. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/query.proto +0 -0
  318. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/reset.proto +0 -0
  319. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/schedule.proto +0 -0
  320. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/task_queue.proto +0 -0
  321. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/update.proto +0 -0
  322. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/workflow.proto +0 -0
  323. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/errordetails/v1/message.proto +0 -0
  324. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/export/v1/message.proto +0 -0
  325. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/failure/v1/message.proto +0 -0
  326. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/filter/v1/message.proto +0 -0
  327. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/history/v1/message.proto +0 -0
  328. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/namespace/v1/message.proto +0 -0
  329. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/nexus/v1/message.proto +0 -0
  330. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/operatorservice/v1/request_response.proto +0 -0
  331. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/operatorservice/v1/service.proto +0 -0
  332. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/protocol/v1/message.proto +0 -0
  333. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/query/v1/message.proto +0 -0
  334. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/replication/v1/message.proto +0 -0
  335. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/rules/v1/message.proto +0 -0
  336. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/schedule/v1/message.proto +0 -0
  337. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/enhanced_stack_trace.proto +0 -0
  338. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/task_complete_metadata.proto +0 -0
  339. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/user_metadata.proto +0 -0
  340. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/worker_config.proto +0 -0
  341. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/workflow_metadata.proto +0 -0
  342. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +0 -0
  343. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/update/v1/message.proto +0 -0
  344. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/version/v1/message.proto +0 -0
  345. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/worker/v1/message.proto +0 -0
  346. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/workflow/v1/message.proto +0 -0
  347. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +0 -0
  348. /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +0 -0
  349. /package/sdk-core/{sdk-core-protos → crates/common}/protos/google/rpc/status.proto +0 -0
  350. /package/sdk-core/{sdk-core-protos → crates/common}/protos/grpc/health/v1/health.proto +0 -0
  351. /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/activity_result/activity_result.proto +0 -0
  352. /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/activity_task/activity_task.proto +0 -0
  353. /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/child_workflow/child_workflow.proto +0 -0
  354. /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/common/common.proto +0 -0
  355. /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/core_interface.proto +0 -0
  356. /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/external_data/external_data.proto +0 -0
  357. /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/nexus/nexus.proto +0 -0
  358. /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +0 -0
  359. /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +0 -0
  360. /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/workflow_completion/workflow_completion.proto +0 -0
  361. /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/Makefile +0 -0
  362. /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/api-linter.yaml +0 -0
  363. /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/buf.yaml +0 -0
  364. /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/temporal/api/testservice/v1/request_response.proto +0 -0
  365. /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/temporal/api/testservice/v1/service.proto +0 -0
  366. /package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/constants.rs +0 -0
  367. /package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/task_token.rs +0 -0
  368. /package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/utilities.rs +0 -0
  369. /package/sdk-core/{fsm → crates/macros}/LICENSE.txt +0 -0
  370. /package/sdk-core/{sdk → crates/sdk}/src/app_data.rs +0 -0
  371. /package/sdk-core/{core → crates/sdk-core}/src/abstractions/take_cell.rs +0 -0
  372. /package/sdk-core/{core → crates/sdk-core}/src/test_help/mod.rs +0 -0
  373. /package/sdk-core/{core → crates/sdk-core}/src/worker/slot_supplier.rs +0 -0
  374. /package/sdk-core/{histories → crates/sdk-core/tests/histories}/ends_empty_wft_complete.bin +0 -0
  375. /package/sdk-core/{histories → crates/sdk-core/tests/histories}/evict_while_la_running_no_interference-16_history.bin +0 -0
  376. /package/sdk-core/{histories → crates/sdk-core/tests/histories}/evict_while_la_running_no_interference-23_history.bin +0 -0
  377. /package/sdk-core/{histories → crates/sdk-core/tests/histories}/evict_while_la_running_no_interference-85_history.bin +0 -0
  378. /package/sdk-core/{histories → crates/sdk-core/tests/histories}/fail_wf_task.bin +0 -0
  379. /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-0_history.bin +0 -0
  380. /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-1_history.bin +0 -0
  381. /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-2_history.bin +0 -0
  382. /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-3_history.bin +0 -0
  383. /package/sdk-core/{histories → crates/sdk-core/tests/histories}/old_change_marker_format.bin +0 -0
  384. /package/sdk-core/{histories → crates/sdk-core/tests/histories}/timer_workflow_history.bin +0 -0
  385. /package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/priority.rs +0 -0
  386. /package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/build.rs +0 -0
  387. /package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/random.rs +0 -0
  388. /package/sdk-core/{cargo-tokio-console.sh → etc/cargo-tokio-console.sh} +0 -0
@@ -1,7 +1,7 @@
1
1
  use crate::WorkflowService;
2
2
  use anyhow::{anyhow, bail};
3
3
  use std::{fmt::Debug, marker::PhantomData};
4
- use temporal_sdk_core_protos::{
4
+ use temporalio_common::protos::{
5
5
  coresdk::FromPayloadsExt,
6
6
  temporal::api::{
7
7
  common::v1::{Payload, WorkflowExecution},
@@ -47,12 +47,12 @@ where
47
47
 
48
48
  /// Options for fetching workflow results
49
49
  #[derive(Debug, Clone, Copy)]
50
- pub struct GetWorkflowResultOpts {
50
+ pub struct GetWorkflowResultOptions {
51
51
  /// If true (the default), follows to the next workflow run in the execution chain while
52
52
  /// retrieving results.
53
53
  pub follow_runs: bool,
54
54
  }
55
- impl Default for GetWorkflowResultOpts {
55
+ impl Default for GetWorkflowResultOptions {
56
56
  fn default() -> Self {
57
57
  Self { follow_runs: true }
58
58
  }
@@ -118,7 +118,7 @@ where
118
118
  /// Await the result of the workflow execution
119
119
  pub async fn get_workflow_result(
120
120
  &self,
121
- opts: GetWorkflowResultOpts,
121
+ opts: GetWorkflowResultOptions,
122
122
  ) -> Result<WorkflowExecutionResult<RT>, anyhow::Error> {
123
123
  let mut next_page_tok = vec![];
124
124
  let mut run_id = self.info.run_id.clone().unwrap_or_default();
@@ -1,10 +1,10 @@
1
1
  [package]
2
- name = "temporal-sdk-core-api"
2
+ name = "temporalio-common"
3
3
  version = "0.1.0"
4
4
  edition = "2024"
5
- authors = ["Spencer Judge <spencer@temporal.io>"]
5
+ authors = ["Temporal Technologies Inc. <sdk@temporal.io>"]
6
6
  license-file = { workspace = true }
7
- description = "Interface definitions for the Temporal Core SDK"
7
+ description = "Common functionality for the Temporal SDK Core, Client, and Rust SDK"
8
8
  homepage = "https://temporal.io/"
9
9
  repository = "https://github.com/temporalio/sdk-core"
10
10
  keywords = ["temporal", "workflow"]
@@ -13,28 +13,37 @@ categories = ["development-tools"]
13
13
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
14
14
 
15
15
  [features]
16
+ history_builders = ["rand"]
16
17
  otel_impls = ["dep:opentelemetry"]
17
- envconfig = ["dep:toml", "dep:serde", "dep:dirs"]
18
+ envconfig = ["dep:toml", "dep:dirs"]
19
+ serde_serialize = []
20
+ test-utilities = ["history_builders"]
18
21
 
19
22
  [dependencies]
23
+ anyhow = "1.0"
20
24
  async-trait = "0.1"
25
+ base64 = "0.22"
21
26
  dirs = { version = "6.0", optional = true }
22
27
  derive_builder = { workspace = true }
23
28
  derive_more = { workspace = true }
24
29
  opentelemetry = { workspace = true, optional = true }
25
30
  prost = { workspace = true }
26
- serde = { version = "1.0", features = ["derive"], optional = true }
31
+ prost-wkt = "0.7"
32
+ prost-types = { workspace = true }
33
+ rand = { version = "0.9", optional = true }
34
+ serde = { version = "1.0", features = ["derive"] }
27
35
  serde_json = "1.0"
28
36
  thiserror = { workspace = true }
29
37
  toml = { version = "0.9", optional = true }
30
38
  tonic = { workspace = true }
39
+ tonic-prost = { workspace = true }
31
40
  tracing = "0.1"
32
41
  tracing-core = "0.1"
33
42
  url = "2.5"
43
+ uuid = { version = "1.18", features = ["v4"] }
34
44
 
35
- [dependencies.temporal-sdk-core-protos]
36
- path = "../sdk-core-protos"
37
- version = "0.1"
45
+ [build-dependencies]
46
+ tonic-prost-build = { workspace = true }
38
47
 
39
48
  [lints]
40
49
  workspace = true
@@ -10,6 +10,7 @@ option ruby_package = "Temporalio::Api::Cloud::Account::V1";
10
10
  option csharp_namespace = "Temporalio.Api.Cloud.Account.V1";
11
11
 
12
12
  import "temporal/api/cloud/resource/v1/message.proto";
13
+ import "temporal/api/cloud/sink/v1/message.proto";
13
14
 
14
15
  message MetricsSpec {
15
16
  // The ca cert(s) in PEM format that clients connecting to the metrics endpoint can use for authentication.
@@ -44,3 +45,20 @@ message Account {
44
45
  // Information related to metrics.
45
46
  Metrics metrics = 6;
46
47
  }
48
+
49
+ // AuditLogSinkSpec is only used by Audit Log
50
+ message AuditLogSinkSpec {
51
+ // Name of the sink e.g. "audit_log_01"
52
+ string name = 1;
53
+
54
+ oneof sink_type {
55
+ // The KinesisSpec when destination_type is Kinesis
56
+ api.cloud.sink.v1.KinesisSpec kinesis_sink = 2;
57
+
58
+ // The PubSubSpec when destination_type is PubSub
59
+ api.cloud.sink.v1.PubSubSpec pub_sub_sink = 3;
60
+ }
61
+
62
+ // Enabled indicates whether the sink is enabled or not.
63
+ bool enabled = 4;
64
+ }
@@ -22,7 +22,7 @@ import "temporal/api/cloud/connectivityrule/v1/message.proto";
22
22
 
23
23
  message GetUsersRequest {
24
24
  // The requested size of the page to retrieve - optional.
25
- // Cannot exceed 1000. Defaults to 100.
25
+ // Cannot exceed 1000. Defaults to 100.
26
26
  int32 page_size = 1;
27
27
  // The page token if this is continuing from another response - optional.
28
28
  string page_token = 2;
@@ -144,8 +144,8 @@ message CreateNamespaceResponse {
144
144
 
145
145
  message GetNamespacesRequest {
146
146
  // The requested size of the page to retrieve.
147
- // Cannot exceed 1000.
148
- // Optional, defaults to 100.
147
+ // Cannot exceed 1000.
148
+ // Optional, defaults to 100.
149
149
  int32 page_size = 1;
150
150
  // The page token if this is continuing from another response.
151
151
  // Optional, defaults to empty.
@@ -387,7 +387,7 @@ message DeleteApiKeyResponse {
387
387
 
388
388
  message GetNexusEndpointsRequest {
389
389
  // The requested size of the page to retrieve - optional.
390
- // Cannot exceed 1000. Defaults to 100.
390
+ // Cannot exceed 1000. Defaults to 100.
391
391
  int32 page_size = 1;
392
392
 
393
393
  // The page token if this is continuing from another response - optional.
@@ -694,6 +694,25 @@ message UpdateServiceAccountResponse {
694
694
  temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
695
695
  }
696
696
 
697
+ message SetServiceAccountNamespaceAccessRequest {
698
+ // The ID of the service account to update.
699
+ string service_account_id = 1;
700
+ // The namespace to set permissions for.
701
+ string namespace = 2;
702
+ // The namespace access to assign the service account.
703
+ temporal.api.cloud.identity.v1.NamespaceAccess access = 3;
704
+ // The version of the service account for which this update is intended for.
705
+ // The latest version can be found in the GetServiceAccount response.
706
+ string resource_version = 4;
707
+ // The ID to use for this async operation - optional.
708
+ string async_operation_id = 5;
709
+ }
710
+
711
+ message SetServiceAccountNamespaceAccessResponse {
712
+ // The async operation.
713
+ temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
714
+ }
715
+
697
716
  message DeleteServiceAccountRequest {
698
717
  // The ID of the service account to delete;
699
718
  string service_account_id = 1;
@@ -715,18 +734,18 @@ message GetUsageRequest {
715
734
  // Must be: within the last 90 days from the current date.
716
735
  // Must be: midnight UTC time.
717
736
  google.protobuf.Timestamp start_time_inclusive = 1;
718
-
737
+
719
738
  // Filter for UTC time < - optional.
720
739
  // Defaults to: start of the next UTC day.
721
740
  // Must be: within the last 90 days from the current date.
722
741
  // Must be: midnight UTC time.
723
742
  google.protobuf.Timestamp end_time_exclusive = 2;
724
-
743
+
725
744
  // The requested size of the page to retrieve - optional.
726
745
  // Each count corresponds to a single object - per day per namespace
727
746
  // Cannot exceed 1000. Defaults to 100.
728
747
  int32 page_size = 3;
729
-
748
+
730
749
  // The page token if this is continuing from another response - optional.
731
750
  string page_token = 4;
732
751
  }
@@ -853,11 +872,11 @@ message ValidateNamespaceExportSinkResponse {
853
872
  message UpdateNamespaceTagsRequest {
854
873
  // The namespace to set tags for.
855
874
  string namespace = 1;
856
- // A list of tags to add or update.
857
- // If a key of an existing tag is added, the tag's value is updated.
875
+ // A list of tags to add or update.
876
+ // If a key of an existing tag is added, the tag's value is updated.
858
877
  // At least one of tags_to_upsert or tags_to_remove must be specified.
859
878
  map<string, string> tags_to_upsert = 2;
860
- // A list of tag keys to remove.
879
+ // A list of tag keys to remove.
861
880
  // If a tag key doesn't exist, it is silently ignored.
862
881
  // At least one of tags_to_upsert or tags_to_remove must be specified.
863
882
  repeated string tags_to_remove = 3;
@@ -868,7 +887,7 @@ message UpdateNamespaceTagsRequest {
868
887
  message UpdateNamespaceTagsResponse {
869
888
  // The async operation.
870
889
  temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
871
- }
890
+ }
872
891
 
873
892
  message CreateConnectivityRuleRequest {
874
893
  // The connectivity rule specification.
@@ -928,3 +947,11 @@ message DeleteConnectivityRuleResponse {
928
947
  // The async operation
929
948
  temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
930
949
  }
950
+
951
+ message ValidateAccountAuditLogSinkRequest {
952
+ // The audit log sink spec that will be validated
953
+ temporal.api.cloud.account.v1.AuditLogSinkSpec spec = 1;
954
+ }
955
+
956
+ message ValidateAccountAuditLogSinkResponse {
957
+ }
@@ -21,7 +21,7 @@ service CloudService {
21
21
  get: "/cloud/users",
22
22
  };
23
23
  }
24
-
24
+
25
25
  // Get a user
26
26
  rpc GetUser(GetUserRequest) returns (GetUserResponse) {
27
27
  option (google.api.http) = {
@@ -192,7 +192,7 @@ service CloudService {
192
192
  get: "/cloud/nexus/endpoints",
193
193
  };
194
194
  }
195
-
195
+
196
196
  // Get a nexus endpoint
197
197
  rpc GetNexusEndpoint(GetNexusEndpointRequest) returns (GetNexusEndpointResponse) {
198
198
  option (google.api.http) = {
@@ -320,6 +320,14 @@ service CloudService {
320
320
  };
321
321
  }
322
322
 
323
+ // Set a service account's access to a namespace.
324
+ rpc SetServiceAccountNamespaceAccess(SetServiceAccountNamespaceAccessRequest) returns (SetServiceAccountNamespaceAccessResponse) {
325
+ option (google.api.http) = {
326
+ post: "/cloud/namespaces/{namespace}/service-accounts/{service_account_id}/access",
327
+ body: "*"
328
+ };
329
+ }
330
+
323
331
  // Delete a service account.
324
332
  rpc DeleteServiceAccount(DeleteServiceAccountRequest) returns (DeleteServiceAccountResponse) {
325
333
  option (google.api.http) = {
@@ -358,7 +366,7 @@ service CloudService {
358
366
  };
359
367
  }
360
368
 
361
- // Get an export sink
369
+ // Get an export sink
362
370
  rpc GetNamespaceExportSink(GetNamespaceExportSinkRequest) returns (GetNamespaceExportSinkResponse) {
363
371
  option (google.api.http) = {
364
372
  get: "/cloud/namespaces/{namespace}/export-sinks/{name}"
@@ -432,4 +440,13 @@ service CloudService {
432
440
  delete: "/cloud/connectivity-rules/{connectivity_rule_id}"
433
441
  };
434
442
  }
435
- }
443
+
444
+ // Validate customer audit log sink is accessible from Temporal's workflow by delivering an empty file to the specified sink.
445
+ // The operation verifies that the sink is correctly configured, accessible and ready to receive audit logs.
446
+ rpc ValidateAccountAuditLogSink(ValidateAccountAuditLogSinkRequest) returns (ValidateAccountAuditLogSinkResponse) {
447
+ option (google.api.http) = {
448
+ post: "/cloud/account/audit-logs/sink/validate",
449
+ body: "*"
450
+ };
451
+ }
452
+ }
@@ -41,12 +41,12 @@ message AsyncOperation {
41
41
  google.protobuf.Timestamp finished_time = 8;
42
42
 
43
43
  enum State {
44
- STATE_UNSPECIFIED = 0;
45
- STATE_PENDING = 1; // The operation is pending.
46
- STATE_IN_PROGRESS = 2; // The operation is in progress.
47
- STATE_FAILED = 3; // The operation failed, check failure_reason for more details.
48
- STATE_CANCELLED = 4; // The operation was cancelled.
49
- STATE_FULFILLED = 5; // The operation was fulfilled.
44
+ STATE_UNSPECIFIED = 0;
45
+ STATE_PENDING = 1; // The operation is pending.
46
+ STATE_IN_PROGRESS = 2; // The operation is in progress.
47
+ STATE_FAILED = 3; // The operation failed, check failure_reason for more details.
48
+ STATE_CANCELLED = 4; // The operation was cancelled.
49
+ STATE_FULFILLED = 5; // The operation was fulfilled.
50
50
  STATE_REJECTED = 6; // The operation was rejected.
51
51
  }
52
52
  }
@@ -38,4 +38,26 @@ message GCSSpec {
38
38
 
39
39
  // The region of the gcs bucket
40
40
  string region = 4;
41
+ }
42
+
43
+ message KinesisSpec {
44
+ // The role Temporal Cloud assumes when writing records to Kinesis
45
+ string role_name = 1;
46
+
47
+ // Destination Kinesis endpoint arn for temporal to send data to.
48
+ string destination_uri = 2;
49
+
50
+ // The sink's region.
51
+ string region = 3;
52
+ }
53
+
54
+ message PubSubSpec{
55
+ // The customer service account id that Temporal Cloud impersonates for writing records to customer's pubsub topic
56
+ string service_account_id = 1;
57
+
58
+ // Destination pubsub topic name for us
59
+ string topic_name = 2;
60
+
61
+ // The gcp project id of pubsub topic and service account
62
+ string gcp_project_id = 3;
41
63
  }
@@ -20,6 +20,9 @@ on:
20
20
  description: An ID used by external tools to identify workflow runs(can be left empty when running manually)
21
21
  default: "none"
22
22
  type: string
23
+
24
+ permissions:
25
+ contents: read
23
26
  jobs:
24
27
  dispatch:
25
28
  runs-on: ubuntu-latest
@@ -130,6 +133,8 @@ jobs:
130
133
  gh release create "$TAG" --target "$REF" --latest --generate-notes --notes-start-tag "$BASE_TAG" --draft
131
134
 
132
135
  release-api-go:
136
+ permissions:
137
+ contents: write
133
138
  needs: [prepare-inputs, create-release]
134
139
  if: |
135
140
  !cancelled() &&
@@ -8,7 +8,7 @@
8
8
  //!
9
9
  //! The following environment variables are supported:
10
10
  //! - `TEMPORAL_CONFIG_FILE`: Path to the TOML configuration file
11
- //! - `TEMPORAL_PROFILE`: Profile name to use from the configuration file
11
+ //! - `TEMPORAL_PROFILE`: Profile name to use from the configuration file
12
12
  //! - `TEMPORAL_ADDRESS`: Temporal server address
13
13
  //! - `TEMPORAL_NAMESPACE`: Temporal namespace
14
14
  //! - `TEMPORAL_API_KEY`: API key for authentication
@@ -131,7 +131,7 @@ pub struct ClientConfigProfile {
131
131
 
132
132
  /// Client gRPC metadata (aka headers). When loading from TOML and env var, or writing to TOML, the keys are
133
133
  /// lowercased and underscores are replaced with hyphens. This is used for deduplicating/overriding too, so manually
134
- /// set values that are not normalized may not get overridden with [ClientConfigProfile::apply_env_vars].
134
+ /// set values that are not normalized may not get overridden when applying environment variables.
135
135
  pub grpc_meta: HashMap<String, String>,
136
136
  }
137
137
 
@@ -1,6 +1,6 @@
1
1
  //! Error types exposed by public APIs
2
2
 
3
- use temporal_sdk_core_protos::coresdk::activity_result::ActivityExecutionResult;
3
+ use crate::protos::coresdk::activity_result::ActivityExecutionResult;
4
4
 
5
5
  /// Errors thrown by [crate::Worker::validate]
6
6
  #[derive(thiserror::Error, Debug)]
@@ -40,10 +40,14 @@ pub enum CompleteWfError {
40
40
  /// The run associated with the completion
41
41
  run_id: String,
42
42
  },
43
+ /// Workflows have not been enabled on this worker.
44
+ #[error("Workflows are not enabled on this worker")]
45
+ WorkflowNotEnabled,
43
46
  }
44
47
 
45
48
  /// Errors thrown by [crate::Worker::complete_activity_task]
46
49
  #[derive(thiserror::Error, Debug)]
50
+ #[allow(clippy::large_enum_variant)]
47
51
  pub enum CompleteActivityError {
48
52
  /// Lang SDK sent us a malformed activity completion. This likely means a bug in the lang sdk.
49
53
  #[error("Lang SDK sent us a malformed activity completion ({reason}): {completion:?}")]
@@ -53,6 +57,9 @@ pub enum CompleteActivityError {
53
57
  /// The completion, which may not be included to avoid unnecessary copies.
54
58
  completion: Option<ActivityExecutionResult>,
55
59
  },
60
+ /// Activities have not been enabled on this worker.
61
+ #[error("Activities are not enabled on this worker")]
62
+ ActivityNotEnabled,
56
63
  }
57
64
 
58
65
  /// Errors thrown by [crate::Worker::complete_nexus_task]
@@ -30,7 +30,6 @@ pub trait StateMachine: Sized {
30
30
 
31
31
  /// Returns the current state of the machine
32
32
  fn state(&self) -> &Self::State;
33
- fn set_state(&mut self, new_state: Self::State);
34
33
 
35
34
  /// Returns the current shared state of the machine
36
35
  fn shared_state(&self) -> &Self::SharedState;
@@ -41,6 +40,7 @@ pub trait StateMachine: Sized {
41
40
  /// Given the shared data and new state, create a new instance.
42
41
  fn from_parts(state: Self::State, shared: Self::SharedState) -> Self;
43
42
 
43
+ #[allow(dead_code)]
44
44
  /// Return a PlantUML definition of the fsm that can be used to visualize it
45
45
  fn visualizer() -> &'static str;
46
46
  }
@@ -70,36 +70,12 @@ impl<E: Error> Display for MachineError<E> {
70
70
  }
71
71
  impl<E: Error> Error for MachineError<E> {}
72
72
 
73
- pub enum MachineUpdate<Machine>
74
- where
75
- Machine: StateMachine,
76
- {
77
- InvalidTransition,
78
- Ok { commands: Vec<Machine::Command> },
79
- }
80
-
81
- impl<M> MachineUpdate<M>
82
- where
83
- M: StateMachine,
84
- {
85
- /// Unwraps the machine update, panicking if the transition was invalid.
86
- pub fn unwrap(self) -> Vec<M::Command> {
87
- match self {
88
- Self::Ok { commands } => commands,
89
- Self::InvalidTransition => panic!("Transition was not successful!"),
90
- }
91
- }
92
- }
93
-
94
73
  /// A transition result is emitted every time the [StateMachine] handles an event.
95
74
  pub enum TransitionResult<Machine, DestinationState>
96
75
  where
97
76
  Machine: StateMachine,
98
77
  DestinationState: Into<Machine::State>,
99
78
  {
100
- /// This state does not define a transition for this event from this state. All other errors
101
- /// should use the [Err](enum.TransitionResult.html#variant.Err) variant.
102
- InvalidTransition,
103
79
  /// The transition was successful
104
80
  Ok {
105
81
  commands: Vec<Machine::Command>,
@@ -178,7 +154,6 @@ where
178
154
  /// Turns more-specific (struct) transition result into more-general (enum) transition result
179
155
  pub fn into_general(self) -> TransitionResult<Sm, Sm::State> {
180
156
  match self {
181
- TransitionResult::InvalidTransition => TransitionResult::InvalidTransition,
182
157
  TransitionResult::Ok {
183
158
  commands,
184
159
  new_state,
@@ -200,7 +175,6 @@ where
200
175
  new_state,
201
176
  commands,
202
177
  } => Ok((commands, new_state)),
203
- TransitionResult::InvalidTransition => Err(MachineError::InvalidTransition),
204
178
  TransitionResult::Err(e) => Err(MachineError::Underlying(e)),
205
179
  }
206
180
  }
@@ -1,6 +1,12 @@
1
+ //! This crate contains base-level functionality needed by the other crates in the Temporal Core and
2
+ //! Rust SDK.
3
+
1
4
  #[cfg(feature = "envconfig")]
2
5
  pub mod envconfig;
3
6
  pub mod errors;
7
+ #[doc(hidden)]
8
+ pub mod fsm_trait;
9
+ pub mod protos;
4
10
  pub mod telemetry;
5
11
  pub mod worker;
6
12
 
@@ -9,16 +15,17 @@ use crate::{
9
15
  CompleteActivityError, CompleteNexusError, CompleteWfError, PollError,
10
16
  WorkerValidationError,
11
17
  },
18
+ protos::coresdk::{
19
+ ActivityHeartbeat, ActivityTaskCompletion,
20
+ activity_task::ActivityTask,
21
+ nexus::{NexusTask, NexusTaskCompletion},
22
+ workflow_activation::WorkflowActivation,
23
+ workflow_completion::WorkflowActivationCompletion,
24
+ },
12
25
  worker::WorkerConfig,
13
26
  };
14
27
  use std::sync::Arc;
15
- use temporal_sdk_core_protos::coresdk::{
16
- ActivityHeartbeat, ActivityTaskCompletion,
17
- activity_task::ActivityTask,
18
- nexus::{NexusTask, NexusTaskCompletion},
19
- workflow_activation::WorkflowActivation,
20
- workflow_completion::WorkflowActivationCompletion,
21
- };
28
+ use uuid::Uuid;
22
29
 
23
30
  /// This trait is the primary way by which language specific SDKs interact with the core SDK.
24
31
  /// It represents one worker, which has a (potentially shared) client for connecting to the service
@@ -125,8 +132,8 @@ pub trait Worker: Send + Sync {
125
132
  /// [Worker::complete_workflow_activation] and [Worker::complete_activity_task] for those
126
133
  /// workflows & activities until they are done. At that point, the lang SDK can end the process,
127
134
  /// or drop the [Worker] instance via [Worker::finalize_shutdown], which will close the
128
- /// connection and free resources. If you have set [WorkerConfig::no_remote_activities], you may
129
- /// skip calling [Worker::poll_activity_task].
135
+ /// connection and free resources. If you have set [WorkerConfig::task_types] to exclude
136
+ /// [worker::WorkerTaskTypes::activity_only()], you may skip calling [Worker::poll_activity_task].
130
137
  ///
131
138
  /// Lang implementations should use [Worker::initiate_shutdown] followed by
132
139
  /// [Worker::finalize_shutdown].
@@ -138,6 +145,10 @@ pub trait Worker: Send + Sync {
138
145
  /// This should be called only after [Worker::shutdown] has resolved and/or both polling
139
146
  /// functions have returned `ShutDown` errors.
140
147
  async fn finalize_shutdown(self);
148
+
149
+ /// Unique identifier for this worker instance.
150
+ /// This must be stable across the worker's lifetime and unique per instance.
151
+ fn worker_instance_key(&self) -> Uuid;
141
152
  }
142
153
 
143
154
  #[async_trait::async_trait]
@@ -205,6 +216,10 @@ where
205
216
  async fn finalize_shutdown(self) {
206
217
  panic!("Can't finalize shutdown on Arc'd worker")
207
218
  }
219
+
220
+ fn worker_instance_key(&self) -> Uuid {
221
+ (**self).worker_instance_key()
222
+ }
208
223
  }
209
224
 
210
225
  macro_rules! dbg_panic {
@@ -1,4 +1,4 @@
1
- use crate::{
1
+ use crate::protos::{
2
2
  TestHistoryBuilder,
3
3
  coresdk::common::NamespacedWorkflowExecution,
4
4
  temporal::api::{
@@ -1,4 +1,4 @@
1
- use crate::{
1
+ use crate::protos::{
2
2
  HistoryInfo,
3
3
  constants::{LOCAL_ACTIVITY_MARKER_NAME, PATCH_MARKER_NAME},
4
4
  coresdk::{
@@ -1,4 +1,4 @@
1
- use crate::temporal::api::{
1
+ use crate::protos::temporal::api::{
2
2
  common::v1::WorkflowType,
3
3
  enums::v1::{EventType, TaskQueueKind},
4
4
  history::v1::{History, HistoryEvent, WorkflowExecutionStartedEventAttributes, history_event},
@@ -207,7 +207,7 @@ impl From<HistoryInfo> for GetWorkflowExecutionHistoryResponse {
207
207
 
208
208
  #[cfg(test)]
209
209
  mod tests {
210
- use crate::{TestHistoryBuilder, temporal::api::enums::v1::EventType};
210
+ use crate::protos::{TestHistoryBuilder, temporal::api::enums::v1::EventType};
211
211
 
212
212
  fn single_timer(timer_id: &str) -> TestHistoryBuilder {
213
213
  let mut t = TestHistoryBuilder::default();