@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
package/Cargo.lock CHANGED
@@ -159,6 +159,31 @@ version = "2.9.1"
159
159
  source = "registry+https://github.com/rust-lang/crates.io-index"
160
160
  checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
161
161
 
162
+ [[package]]
163
+ name = "bon"
164
+ version = "3.8.1"
165
+ source = "registry+https://github.com/rust-lang/crates.io-index"
166
+ checksum = "ebeb9aaf9329dff6ceb65c689ca3db33dbf15f324909c60e4e5eef5701ce31b1"
167
+ dependencies = [
168
+ "bon-macros",
169
+ "rustversion",
170
+ ]
171
+
172
+ [[package]]
173
+ name = "bon-macros"
174
+ version = "3.8.1"
175
+ source = "registry+https://github.com/rust-lang/crates.io-index"
176
+ checksum = "77e9d642a7e3a318e37c2c9427b5a6a48aa1ad55dcd986f3034ab2239045a645"
177
+ dependencies = [
178
+ "darling 0.21.3",
179
+ "ident_case",
180
+ "prettyplease",
181
+ "proc-macro2",
182
+ "quote",
183
+ "rustversion",
184
+ "syn",
185
+ ]
186
+
162
187
  [[package]]
163
188
  name = "bridge-macros"
164
189
  version = "0.1.0"
@@ -287,8 +312,18 @@ version = "0.20.11"
287
312
  source = "registry+https://github.com/rust-lang/crates.io-index"
288
313
  checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee"
289
314
  dependencies = [
290
- "darling_core",
291
- "darling_macro",
315
+ "darling_core 0.20.11",
316
+ "darling_macro 0.20.11",
317
+ ]
318
+
319
+ [[package]]
320
+ name = "darling"
321
+ version = "0.21.3"
322
+ source = "registry+https://github.com/rust-lang/crates.io-index"
323
+ checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0"
324
+ dependencies = [
325
+ "darling_core 0.21.3",
326
+ "darling_macro 0.21.3",
292
327
  ]
293
328
 
294
329
  [[package]]
@@ -305,13 +340,38 @@ dependencies = [
305
340
  "syn",
306
341
  ]
307
342
 
343
+ [[package]]
344
+ name = "darling_core"
345
+ version = "0.21.3"
346
+ source = "registry+https://github.com/rust-lang/crates.io-index"
347
+ checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4"
348
+ dependencies = [
349
+ "fnv",
350
+ "ident_case",
351
+ "proc-macro2",
352
+ "quote",
353
+ "strsim",
354
+ "syn",
355
+ ]
356
+
308
357
  [[package]]
309
358
  name = "darling_macro"
310
359
  version = "0.20.11"
311
360
  source = "registry+https://github.com/rust-lang/crates.io-index"
312
361
  checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead"
313
362
  dependencies = [
314
- "darling_core",
363
+ "darling_core 0.20.11",
364
+ "quote",
365
+ "syn",
366
+ ]
367
+
368
+ [[package]]
369
+ name = "darling_macro"
370
+ version = "0.21.3"
371
+ source = "registry+https://github.com/rust-lang/crates.io-index"
372
+ checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81"
373
+ dependencies = [
374
+ "darling_core 0.21.3",
315
375
  "quote",
316
376
  "syn",
317
377
  ]
@@ -356,7 +416,7 @@ version = "0.20.2"
356
416
  source = "registry+https://github.com/rust-lang/crates.io-index"
357
417
  checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8"
358
418
  dependencies = [
359
- "darling",
419
+ "darling 0.20.11",
360
420
  "proc-macro2",
361
421
  "quote",
362
422
  "syn",
@@ -2048,29 +2108,6 @@ version = "2.1.1"
2048
2108
  source = "registry+https://github.com/rust-lang/crates.io-index"
2049
2109
  checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
2050
2110
 
2051
- [[package]]
2052
- name = "rustfsm"
2053
- version = "0.1.0"
2054
- dependencies = [
2055
- "rustfsm_procmacro",
2056
- "rustfsm_trait",
2057
- ]
2058
-
2059
- [[package]]
2060
- name = "rustfsm_procmacro"
2061
- version = "0.1.0"
2062
- dependencies = [
2063
- "derive_more",
2064
- "proc-macro2",
2065
- "quote",
2066
- "rustfsm_trait",
2067
- "syn",
2068
- ]
2069
-
2070
- [[package]]
2071
- name = "rustfsm_trait"
2072
- version = "0.1.0"
2073
-
2074
2111
  [[package]]
2075
2112
  name = "rustix"
2076
2113
  version = "1.0.8"
@@ -2412,15 +2449,42 @@ dependencies = [
2412
2449
  ]
2413
2450
 
2414
2451
  [[package]]
2415
- name = "temporal-client"
2452
+ name = "temporal-sdk-typescript-bridge"
2453
+ version = "0.1.0"
2454
+ dependencies = [
2455
+ "anyhow",
2456
+ "async-trait",
2457
+ "bridge-macros",
2458
+ "futures",
2459
+ "neon",
2460
+ "opentelemetry",
2461
+ "os_pipe",
2462
+ "parking_lot",
2463
+ "prost",
2464
+ "prost-types",
2465
+ "serde",
2466
+ "serde_json",
2467
+ "temporalio-client",
2468
+ "temporalio-common",
2469
+ "temporalio-sdk-core",
2470
+ "thiserror 2.0.14",
2471
+ "tokio",
2472
+ "tokio-stream",
2473
+ "tonic",
2474
+ "tracing",
2475
+ "tracing-subscriber",
2476
+ ]
2477
+
2478
+ [[package]]
2479
+ name = "temporalio-client"
2416
2480
  version = "0.1.0"
2417
2481
  dependencies = [
2418
2482
  "anyhow",
2419
2483
  "async-trait",
2420
2484
  "backoff",
2421
2485
  "base64",
2486
+ "bon",
2422
2487
  "bytes",
2423
- "derive_builder",
2424
2488
  "derive_more",
2425
2489
  "dyn-clone",
2426
2490
  "futures-retry",
@@ -2430,9 +2494,9 @@ dependencies = [
2430
2494
  "hyper",
2431
2495
  "hyper-util",
2432
2496
  "parking_lot",
2497
+ "rand 0.9.2",
2433
2498
  "slotmap",
2434
- "temporal-sdk-core-api",
2435
- "temporal-sdk-core-protos",
2499
+ "temporalio-common",
2436
2500
  "thiserror 2.0.14",
2437
2501
  "tokio",
2438
2502
  "tonic",
@@ -2443,7 +2507,43 @@ dependencies = [
2443
2507
  ]
2444
2508
 
2445
2509
  [[package]]
2446
- name = "temporal-sdk-core"
2510
+ name = "temporalio-common"
2511
+ version = "0.1.0"
2512
+ dependencies = [
2513
+ "anyhow",
2514
+ "async-trait",
2515
+ "base64",
2516
+ "derive_builder",
2517
+ "derive_more",
2518
+ "opentelemetry",
2519
+ "prost",
2520
+ "prost-wkt",
2521
+ "prost-wkt-types",
2522
+ "rand 0.9.2",
2523
+ "serde",
2524
+ "serde_json",
2525
+ "thiserror 2.0.14",
2526
+ "tonic",
2527
+ "tonic-prost",
2528
+ "tonic-prost-build",
2529
+ "tracing",
2530
+ "tracing-core",
2531
+ "url",
2532
+ "uuid",
2533
+ ]
2534
+
2535
+ [[package]]
2536
+ name = "temporalio-macros"
2537
+ version = "0.1.0"
2538
+ dependencies = [
2539
+ "derive_more",
2540
+ "proc-macro2",
2541
+ "quote",
2542
+ "syn",
2543
+ ]
2544
+
2545
+ [[package]]
2546
+ name = "temporalio-sdk-core"
2447
2547
  version = "0.1.0"
2448
2548
  dependencies = [
2449
2549
  "anyhow",
@@ -2479,16 +2579,15 @@ dependencies = [
2479
2579
  "rand 0.9.2",
2480
2580
  "reqwest",
2481
2581
  "ringbuf",
2482
- "rustfsm",
2483
2582
  "serde",
2484
2583
  "serde_json",
2485
2584
  "siphasher",
2486
2585
  "slotmap",
2487
2586
  "sysinfo",
2488
2587
  "tar",
2489
- "temporal-client",
2490
- "temporal-sdk-core-api",
2491
- "temporal-sdk-core-protos",
2588
+ "temporalio-client",
2589
+ "temporalio-common",
2590
+ "temporalio-macros",
2492
2591
  "thiserror 2.0.14",
2493
2592
  "tokio",
2494
2593
  "tokio-stream",
@@ -2501,70 +2600,6 @@ dependencies = [
2501
2600
  "zip",
2502
2601
  ]
2503
2602
 
2504
- [[package]]
2505
- name = "temporal-sdk-core-api"
2506
- version = "0.1.0"
2507
- dependencies = [
2508
- "async-trait",
2509
- "derive_builder",
2510
- "derive_more",
2511
- "opentelemetry",
2512
- "prost",
2513
- "serde_json",
2514
- "temporal-sdk-core-protos",
2515
- "thiserror 2.0.14",
2516
- "tonic",
2517
- "tracing",
2518
- "tracing-core",
2519
- "url",
2520
- ]
2521
-
2522
- [[package]]
2523
- name = "temporal-sdk-core-protos"
2524
- version = "0.1.0"
2525
- dependencies = [
2526
- "anyhow",
2527
- "base64",
2528
- "derive_more",
2529
- "prost",
2530
- "prost-wkt",
2531
- "prost-wkt-types",
2532
- "rand 0.9.2",
2533
- "serde",
2534
- "serde_json",
2535
- "thiserror 2.0.14",
2536
- "tonic",
2537
- "tonic-prost",
2538
- "tonic-prost-build",
2539
- "uuid",
2540
- ]
2541
-
2542
- [[package]]
2543
- name = "temporal-sdk-typescript-bridge"
2544
- version = "0.1.0"
2545
- dependencies = [
2546
- "anyhow",
2547
- "async-trait",
2548
- "bridge-macros",
2549
- "futures",
2550
- "neon",
2551
- "opentelemetry",
2552
- "os_pipe",
2553
- "parking_lot",
2554
- "prost",
2555
- "prost-types",
2556
- "serde",
2557
- "serde_json",
2558
- "temporal-client",
2559
- "temporal-sdk-core",
2560
- "thiserror 2.0.14",
2561
- "tokio",
2562
- "tokio-stream",
2563
- "tonic",
2564
- "tracing",
2565
- "tracing-subscriber",
2566
- ]
2567
-
2568
2603
  [[package]]
2569
2604
  name = "termtree"
2570
2605
  version = "0.5.1"
package/Cargo.toml CHANGED
@@ -35,10 +35,11 @@ prost = "0.14"
35
35
  prost-types = "0.14"
36
36
  serde = { version = "1.0", features = ["derive"] }
37
37
  serde_json = "1.0"
38
- temporal-sdk-core = { version = "*", path = "./sdk-core/core", features = [
38
+ temporalio-sdk-core = { version = "*", path = "./sdk-core/crates/sdk-core", features = [
39
39
  "ephemeral-server",
40
40
  ] }
41
- temporal-client = { version = "*", path = "./sdk-core/client" }
41
+ temporalio-client = { version = "*", path = "./sdk-core/crates/client" }
42
+ temporalio-common = { version = "*", path = "./sdk-core/crates/common" }
42
43
  thiserror = "2"
43
44
  tokio = "1.13"
44
45
  tokio-stream = "0.1"
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2021 Temporal Technologies, Inc. All Rights Reserved
3
+ Copyright (c) 2021-2025 Temporal Technologies Inc. All rights reserved.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
9
  copies of the Software, and to permit persons to whom the Software is
10
10
  furnished to do so, subject to the following conditions:
11
11
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
14
 
15
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  [![NPM](https://img.shields.io/npm/v/@temporalio/core-bridge?style=for-the-badge)](https://www.npmjs.com/package/@temporalio/core-bridge)
4
4
 
5
-
6
5
  Part of [Temporal](https://temporal.io)'s [TypeScript SDK](https://docs.temporal.io/typescript/introduction/).
7
6
 
8
7
  > [!CAUTION]
@@ -0,0 +1,16 @@
1
+ [package]
2
+ name = "bridge-macros"
3
+ version = "0.1.0"
4
+ edition = "2024"
5
+
6
+ [lib]
7
+ proc-macro = true
8
+
9
+ [dependencies]
10
+ syn = { version = "2.0", features = ["full", "extra-traits"] }
11
+ quote = "1.0"
12
+ proc-macro2 = "1.0"
13
+ convert_case = "0.6"
14
+
15
+ [dev-dependencies]
16
+ temporal-sdk-typescript-bridge = { path = ".." }
@@ -0,0 +1,126 @@
1
+ use quote::format_ident;
2
+ use quote::quote;
3
+ use syn::GenericArgument;
4
+ use syn::Pat;
5
+ use syn::PathArguments;
6
+ use syn::Type;
7
+ use syn::{FnArg, ItemFn, PatType, ReturnType, parse_macro_input};
8
+
9
+ pub fn js_function_impl(
10
+ _attr: proc_macro::TokenStream,
11
+ item: proc_macro::TokenStream,
12
+ ) -> proc_macro::TokenStream {
13
+ let input = parse_macro_input!(item as ItemFn);
14
+
15
+ let vis = &input.vis;
16
+ let fn_name = &input.sig.ident;
17
+ let generics = &input.sig.generics; // Is this still pertinent?
18
+ let args = &input.sig.inputs;
19
+ let return_type = &input.sig.output; // Can we avoid in some cases?
20
+ let fn_block = &input.block;
21
+ let attrs = &input.attrs;
22
+
23
+ let fn_impl_name = format_ident!("{}_impl", fn_name);
24
+
25
+ // Extract function arguments
26
+ let args = args
27
+ .iter()
28
+ .filter_map(|arg| {
29
+ if let FnArg::Typed(PatType { pat, ty, .. }) = arg {
30
+ if let Pat::Ident(pat_ident) = &**pat {
31
+ Some((pat_ident.ident.clone(), (*ty).clone()))
32
+ } else {
33
+ None
34
+ }
35
+ } else {
36
+ None
37
+ }
38
+ })
39
+ .collect::<Vec<_>>();
40
+
41
+ // Extract return type
42
+ let (result_return_type, inner_return_type) = match return_type {
43
+ ReturnType::Type(_, ty) => match extract_bridge_result_type(ty) {
44
+ Some(inner_type) => (ty, inner_type),
45
+ None => panic!("Return type must be a BridgeResult"),
46
+ },
47
+ ReturnType::Default => panic!("Return type must be a BridgeResult"),
48
+ };
49
+
50
+ // Generate argument conversions
51
+ let arg_conversions = args.iter().enumerate().map(|(i, (name, ty))| {
52
+ quote! {
53
+ use crate::helpers::*;
54
+ let #name = cx.argument_into::<#ty>(#i).field(format!("fn {}", stringify!(#fn_name)).as_str()).into_throw(&mut cx)?;
55
+ }
56
+ });
57
+
58
+ // Generate implementation function arguments
59
+ let impl_args = args.iter().map(|(name, ty)| {
60
+ quote! { #name: #ty }
61
+ });
62
+
63
+ // Generate argument names for impl function call
64
+ let arg_names = args.iter().map(|(name, _)| quote! { #name });
65
+
66
+ let expanded = if args.is_empty() {
67
+ // No arguments case
68
+ quote! {
69
+ // Bridge function
70
+ #[allow(clippy::significant_drop_tightening, clippy::unnecessary_wraps)]
71
+ #vis fn #fn_name #generics(
72
+ mut cx: FunctionContext #generics
73
+ ) -> JsResult<<#inner_return_type as crate::helpers::TryIntoJs>::Output> {
74
+ let result = #fn_impl_name().into_throw(&mut cx)?;
75
+ result.try_into_js(&mut cx)
76
+ }
77
+
78
+ // Implementation function
79
+ #(#attrs)*
80
+ #[allow(clippy::unnecessary_wraps)]
81
+ #vis fn #fn_impl_name #generics() -> #result_return_type {
82
+ #fn_block
83
+ }
84
+ }
85
+ } else {
86
+ // With arguments case
87
+ quote! {
88
+ // Bridge function
89
+ #[allow(clippy::significant_drop_tightening, clippy::unnecessary_wraps)]
90
+ #vis fn #fn_name #generics(
91
+ mut cx: FunctionContext #generics
92
+ ) -> JsResult<<#inner_return_type as crate::helpers::TryIntoJs>::Output> {
93
+ #(#arg_conversions)*
94
+
95
+ let result = #fn_impl_name(#(#arg_names),*).into_throw(&mut cx)?;
96
+ result.try_into_js(&mut cx)
97
+ }
98
+
99
+ // Implementation function
100
+ #(#attrs)*
101
+ #[allow(clippy::unnecessary_wraps)]
102
+ #vis fn #fn_impl_name #generics(#(#impl_args),*) -> #result_return_type {
103
+ #fn_block
104
+ }
105
+ }
106
+ };
107
+
108
+ proc_macro::TokenStream::from(expanded)
109
+ }
110
+
111
+ fn extract_bridge_result_type(ty: &Type) -> Option<&Type> {
112
+ if let Type::Path(type_path) = ty {
113
+ if let Some(last_segment) = type_path.path.segments.last() {
114
+ // Check if it's BridgeResult
115
+ if last_segment.ident == "BridgeResult" {
116
+ // Extract the type parameter T from BridgeResult<T>
117
+ if let PathArguments::AngleBracketed(generic_args) = &last_segment.arguments {
118
+ if let Some(GenericArgument::Type(inner_type)) = generic_args.args.first() {
119
+ return Some(inner_type);
120
+ }
121
+ }
122
+ }
123
+ }
124
+ }
125
+ None
126
+ }
@@ -0,0 +1,138 @@
1
+ use convert_case::{Case, Casing};
2
+ use proc_macro2::TokenStream;
3
+ use quote::quote;
4
+ use syn::{DeriveInput, FieldsNamed, FieldsUnnamed};
5
+
6
+ pub fn derive_tryfromjs_struct(input: &DeriveInput, data: &syn::DataStruct) -> TokenStream {
7
+ let struct_ident = &input.ident;
8
+ let generics = &input.generics;
9
+ let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
10
+
11
+ let field_conversions = if let syn::Fields::Named(ref fields) = data.fields {
12
+ field_conversions_for_named_fields(fields)
13
+ } else {
14
+ panic!("Only named fields are supported")
15
+ };
16
+
17
+ let expanded = quote! {
18
+ impl #impl_generics crate::helpers::TryFromJs for #struct_ident #ty_generics #where_clause {
19
+ fn try_from_js<'cx, 'b>(cx: &mut impl neon::prelude::Context<'cx>, js_value: neon::prelude::Handle<'b, neon::prelude::JsValue>) -> crate::helpers::BridgeResult<Self> {
20
+ use crate::helpers::*;
21
+
22
+ let obj = js_value.downcast::<neon::prelude::JsObject, _>(cx)?;
23
+ Ok(Self {
24
+ #(#field_conversions),*
25
+ })
26
+ }
27
+ }
28
+ };
29
+
30
+ TokenStream::from(expanded)
31
+ }
32
+
33
+ pub fn derive_tryfromjs_enum(input: &DeriveInput, data: &syn::DataEnum) -> TokenStream {
34
+ let enum_ident = &input.ident;
35
+ let enum_name = enum_ident.to_string();
36
+ let variants = &data.variants;
37
+ let generics = &input.generics;
38
+ let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
39
+
40
+ let variant_conversions = variants.iter().map(|v| {
41
+ let variant_ident = &v.ident;
42
+ let discriminant = variant_ident.to_string().to_case(Case::Kebab);
43
+ let js_discriminant = variant_ident.to_string().to_case(Case::Camel);
44
+
45
+ match &v.fields {
46
+ syn::Fields::Unit => {
47
+ // e.g. "otel" => Ok(MetricsExporter::Otel)
48
+ quote! {
49
+ #discriminant => Ok(#enum_ident::#variant_ident),
50
+ }
51
+ }
52
+ syn::Fields::Unnamed(FieldsUnnamed { unnamed, .. }) => {
53
+ if unnamed.len() != 1 {
54
+ panic!("Enum variant must have a single unnamed field that implements the TryFromJs trait");
55
+ }
56
+ let ty = unnamed.first().map(|f| f.ty.clone()).unwrap();
57
+ match ty {
58
+ syn::Type::Path(path) => {
59
+ // Example output:
60
+ //
61
+ // "otel" => {
62
+ // <OtelConfig>::try_from_js(cx, js_value).field("otel").map(MetricsExporter::Otel)
63
+ // }
64
+ quote! {
65
+ #discriminant => {
66
+ <#path>::try_from_js(cx, js_value).field(&#js_discriminant).map(#enum_ident::#variant_ident)
67
+ },
68
+ }
69
+ },
70
+ _ => panic!("Enum variant must have a single unnamed field that implements the TryFromJs trait"),
71
+ }
72
+ }
73
+ syn::Fields::Named(fields) => {
74
+ // Example output:
75
+ //
76
+ // "console" => Ok((|| {
77
+ // Ok::<LogExporter, BridgeError>(LogExporter::Console {
78
+ // filter: { obj.get_property_into(cx, "filter")? },
79
+ // })
80
+ // })()
81
+ // .field(format!("type={}", type_str).as_str())?),
82
+ //
83
+ // The inner closure is required so that we can use the `field` method on the result.
84
+ // An alternative would be to do that at the field level, but then that concern would
85
+ // spill into the field_conversions_for_named_fields function, which is used in
86
+ // other places.
87
+ let field_conversions = field_conversions_for_named_fields(fields);
88
+ quote! {
89
+ #discriminant => Ok(( || {
90
+ Ok::<#enum_ident #ty_generics, crate::helpers::BridgeError>(#enum_ident::#variant_ident {
91
+ #(#field_conversions),*
92
+ })
93
+ })()
94
+ .field(&#js_discriminant)?),
95
+ }
96
+ }
97
+ }
98
+ });
99
+
100
+ let expanded = quote! {
101
+ impl #impl_generics crate::helpers::TryFromJs for #enum_ident #ty_generics #where_clause {
102
+ fn try_from_js<'cx, 'b>(cx: &mut impl neon::prelude::Context<'cx>, js_value: neon::prelude::Handle<'b, neon::prelude::JsValue>) -> crate::helpers::BridgeResult<Self> {
103
+ use crate::helpers::*;
104
+
105
+ let obj = js_value.downcast::<neon::prelude::JsObject, _>(cx)?;
106
+ let type_str: String = obj.get_property_into(cx, "type")?;
107
+
108
+ match type_str.as_str() {
109
+ #(#variant_conversions)*
110
+ _ => Err(crate::helpers::BridgeError::InvalidVariant {
111
+ enum_name: #enum_name.to_string(),
112
+ variant: type_str,
113
+ }),
114
+ }
115
+ }
116
+ }
117
+ };
118
+
119
+ TokenStream::from(expanded)
120
+ }
121
+
122
+ fn field_conversions_for_named_fields(
123
+ fields: &FieldsNamed,
124
+ ) -> impl Iterator<Item = TokenStream> + '_ {
125
+ fields.named.iter().map(|f| {
126
+ let field_ident = f
127
+ .ident
128
+ .as_ref()
129
+ .expect("FieldsNamed.named must have an identifier");
130
+ let js_name = field_ident.to_string().to_case(Case::Camel);
131
+
132
+ quote! {
133
+ #field_ident: {
134
+ obj.get_property_into(cx, #js_name)?
135
+ }
136
+ }
137
+ })
138
+ }