@fluidgrids/workflows 2026.1028.2 → 2026.1030.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/README.md +181 -11
  2. package/dist/{activation-BBh1p82z.d.cts → activation-DqUfpHzk.d.cts} +1 -1
  3. package/dist/{activation-DnhG7SmF.d.ts → activation-xpx1oWuo.d.ts} +1 -1
  4. package/dist/{chunk-VRHHBPT6.js → chunk-2D3MYIIF.js} +1212 -128
  5. package/dist/chunk-3U2NU7YC.cjs +124 -0
  6. package/dist/{chunk-NEIUQASE.cjs → chunk-4QKB4ARC.cjs} +3 -3
  7. package/dist/{chunk-GBQ33SIZ.cjs → chunk-54FLQNUM.cjs} +12 -1
  8. package/dist/chunk-5HIVIV53.js +330 -0
  9. package/dist/chunk-5MFVJM76.js +1222 -0
  10. package/dist/{chunk-JD2VQIDZ.cjs → chunk-672KMMBK.cjs} +2 -2
  11. package/dist/{chunk-C5OLWZ42.js → chunk-6A2FGSUS.js} +22 -14
  12. package/dist/{chunk-XKJA7KX3.js → chunk-6OLN6BMB.js} +52 -3
  13. package/dist/{chunk-6FSHT5IL.js → chunk-7EZIANC7.js} +1 -1
  14. package/dist/{chunk-2J6TF7YI.cjs → chunk-A5SXCA62.cjs} +10 -3
  15. package/dist/{chunk-BO6OVILK.js → chunk-AC6ZEXVR.js} +10 -4
  16. package/dist/{chunk-ABFZWYHT.js → chunk-AE5Q6ZAJ.js} +315 -50
  17. package/dist/chunk-C4F5KJTI.js +293 -0
  18. package/dist/{chunk-IISBRUWJ.js → chunk-G5H32GIG.js} +1 -1
  19. package/dist/chunk-GEQDGUGB.cjs +2719 -0
  20. package/dist/{chunk-XHXIDVEC.js → chunk-HCM7ZC7Q.js} +1 -1
  21. package/dist/chunk-HMZUGSMU.cjs +1554 -0
  22. package/dist/{chunk-SAOBPYYJ.cjs → chunk-IQPXHQQQ.cjs} +8 -4
  23. package/dist/{chunk-P6TA5EZT.cjs → chunk-ISOIA7NV.cjs} +335 -58
  24. package/dist/chunk-JSC75O5C.cjs +167 -0
  25. package/dist/chunk-M272AHEX.js +25 -0
  26. package/dist/{chunk-BD7ZPG53.js → chunk-NWQ5WRLE.js} +10 -2
  27. package/dist/chunk-ODZ2IAR2.cjs +1247 -0
  28. package/dist/chunk-Q4MWQNJK.cjs +28 -0
  29. package/dist/{chunk-HWJZVOG7.js → chunk-SR7TR5KX.js} +6 -2
  30. package/dist/{chunk-FEW3JBYA.cjs → chunk-TCTE7DX5.cjs} +3 -3
  31. package/dist/{chunk-623FVQSN.cjs → chunk-TYF56RGB.cjs} +123 -0
  32. package/dist/chunk-VA4OFR72.cjs +324 -0
  33. package/dist/chunk-VU5S5A7V.js +150 -0
  34. package/dist/chunk-YEHR4NNE.js +1522 -0
  35. package/dist/{chunk-FMSW2HDF.cjs → chunk-ZCGKGDCL.cjs} +23 -15
  36. package/dist/codegen/index.d.cts +2 -2
  37. package/dist/codegen/index.d.ts +2 -2
  38. package/dist/collect-6NIEufHd.d.ts +103 -0
  39. package/dist/collect-CcTCKqx6.d.cts +103 -0
  40. package/dist/{file-BOoHZgoQ.d.cts → file-BxYpwjRQ.d.cts} +1007 -21
  41. package/dist/{file-yuPCFU5b.d.ts → file-CFdPQJI9.d.ts} +1007 -21
  42. package/dist/history/index.cjs +375 -86
  43. package/dist/history/index.d.cts +590 -12
  44. package/dist/history/index.d.ts +590 -12
  45. package/dist/history/index.js +50 -4
  46. package/dist/index.cjs +156 -50
  47. package/dist/index.d.cts +38 -58
  48. package/dist/index.d.ts +38 -58
  49. package/dist/index.js +6 -4
  50. package/dist/interceptors-CNcr2dlk.d.ts +159 -0
  51. package/dist/interceptors-CqkNZVfI.d.cts +159 -0
  52. package/dist/ir/index.cjs +362 -38
  53. package/dist/ir/index.d.cts +282 -7
  54. package/dist/ir/index.d.ts +282 -7
  55. package/dist/ir/index.js +329 -23
  56. package/dist/{lower-BzmUz0sq.d.cts → lower-BtRfIW2A.d.cts} +56 -8
  57. package/dist/{lower-_-iT4HYs.d.ts → lower-CpsMFOFX.d.ts} +56 -8
  58. package/dist/{manifest-C8N6HDYl.d.ts → manifest-D-I_twys.d.ts} +1 -1
  59. package/dist/{manifest-0OLw0i7k.d.cts → manifest-DahBQVM8.d.cts} +1 -1
  60. package/dist/node-evaluator-DGQDPSPI.cjs +24 -0
  61. package/dist/node-evaluator-LEEVD7H7.js +14 -0
  62. package/dist/payload-fields-BVRQn2yH.d.cts +122 -0
  63. package/dist/payload-fields-oOBWxDiG.d.ts +122 -0
  64. package/dist/quickjs/index.cjs +28 -27
  65. package/dist/quickjs/index.d.cts +6 -6
  66. package/dist/quickjs/index.d.ts +6 -6
  67. package/dist/quickjs/index.js +10 -9
  68. package/dist/roundtrip/index.cjs +259 -51
  69. package/dist/roundtrip/index.d.cts +100 -9
  70. package/dist/roundtrip/index.d.ts +100 -9
  71. package/dist/roundtrip/index.js +177 -11
  72. package/dist/runtime/index.cjs +21 -20
  73. package/dist/runtime/index.d.cts +184 -15
  74. package/dist/runtime/index.d.ts +184 -15
  75. package/dist/runtime/index.js +8 -7
  76. package/dist/testing/index.cjs +1122 -115
  77. package/dist/testing/index.d.cts +294 -13
  78. package/dist/testing/index.d.ts +294 -13
  79. package/dist/testing/index.js +1086 -84
  80. package/dist/{types-DV-HX_Gt.d.ts → types-Bv2i4cBX.d.cts} +244 -33
  81. package/dist/{types-CpBBjaGX.d.cts → types-DGx-b9eq.d.ts} +244 -33
  82. package/dist/{types-BGoPzgcl.d.ts → types-V7jEEUaL.d.cts} +20 -1
  83. package/dist/{types-BGoPzgcl.d.cts → types-V7jEEUaL.d.ts} +20 -1
  84. package/dist/{workflow-Bpr3vnA_.d.ts → workflow-B18OeF7g.d.ts} +2 -2
  85. package/dist/workflow-BGnv8SS6.d.ts +803 -0
  86. package/dist/{workflow-FXUkpIBc.d.cts → workflow-BJPFv3cp.d.cts} +2 -2
  87. package/dist/workflow-DS32Gtws.d.cts +803 -0
  88. package/fixtures/histories/activity-options-updated.history.json +159 -0
  89. package/fixtures/histories/activity-paused-unpaused.history.json +160 -0
  90. package/fixtures/histories/auto-upgrade-patched.history.json +276 -0
  91. package/fixtures/histories/benign-failure.history.json +146 -0
  92. package/fixtures/histories/cancel-activity-try-cancel.history.json +150 -0
  93. package/fixtures/histories/child-cancel-wait-requested.history.json +217 -0
  94. package/fixtures/histories/child-options-roundtrip.history.json +192 -0
  95. package/fixtures/histories/codec-opaque.history.json +229 -0
  96. package/fixtures/histories/continue-as-new-last-result.history.json +86 -0
  97. package/fixtures/histories/continue-as-new-options.history.json +99 -0
  98. package/fixtures/histories/continue-as-new-r1-long-task-queue.history.json +78 -0
  99. package/fixtures/histories/continue-as-new-r1-retry-options.history.json +83 -0
  100. package/fixtures/histories/dynamic-workflow.history.json +150 -0
  101. package/fixtures/histories/execution-timeout-chain.history.json +98 -0
  102. package/fixtures/histories/external-cancel-resolved.history.json +123 -0
  103. package/fixtures/histories/external-cancel-unknown-target.history.json +127 -0
  104. package/fixtures/histories/failure-error-types-fails-run.history.json +144 -0
  105. package/fixtures/histories/handler-drain-warn.history.json +222 -0
  106. package/fixtures/histories/heartbeat-details-on-retry.history.json +145 -0
  107. package/fixtures/histories/interceptor-headers.history.json +339 -0
  108. package/fixtures/histories/local-activity-abandoned-at-completion.history.json +73 -0
  109. package/fixtures/histories/local-activity-cancelled-in-scope.history.json +118 -0
  110. package/fixtures/histories/local-activity-completed.history.json +157 -0
  111. package/fixtures/histories/local-activity-failed.history.json +93 -0
  112. package/fixtures/histories/local-activity-retry-in-task.history.json +88 -0
  113. package/fixtures/histories/query-custom.history.json +213 -0
  114. package/fixtures/histories/query-default-handler.history.json +120 -0
  115. package/fixtures/histories/reset-forked-reapplied-signals.history.json +239 -0
  116. package/fixtures/histories/reset-reapplied-update-admitted.history.json +228 -0
  117. package/fixtures/histories/run-retry-last-failure.history.json +90 -0
  118. package/fixtures/histories/run-timeout.history.json +159 -0
  119. package/fixtures/histories/schedule-to-start-timeout.history.json +132 -0
  120. package/fixtures/histories/search-attributes-upserted.history.json +177 -0
  121. package/fixtures/histories/start-delay-signal-ends-delay.history.json +155 -0
  122. package/fixtures/histories/typeerror-task-retry-100.history.json +137 -0
  123. package/fixtures/histories/update-accepted-completed.history.json +45 -30
  124. package/fixtures/histories/update-default-handler.history.json +246 -0
  125. package/fixtures/histories/update-handler-awaits-activity.history.json +196 -0
  126. package/fixtures/histories/update-not-handled.history.json +138 -0
  127. package/fixtures/histories/update-rejected-no-event.history.json +190 -0
  128. package/fixtures/histories/update-with-start-admitted.history.json +150 -0
  129. package/fixtures/histories/user-activity-cancel.history.json +149 -0
  130. package/fixtures/histories/user-activity-retry.history.json +143 -0
  131. package/fixtures/histories/user-activity.history.json +149 -0
  132. package/package.json +1 -1
  133. package/schema/bridge-v2.schema.json +1062 -0
  134. package/schema/history-file.schema.json +538 -83
  135. package/schema/ir-v2.schema.json +290 -0
  136. package/schema/payload-fields.json +162 -0
  137. package/schema/run-event.schema.json +503 -82
  138. package/schema/workflow-command.schema.json +372 -69
  139. package/schema/workflow-task.schema.json +924 -171
  140. package/dist/assemble-BLqQ8lSu.d.cts +0 -39
  141. package/dist/assemble-DWgaXHd-.d.ts +0 -39
  142. package/dist/chunk-DHTLALBL.cjs +0 -80
  143. package/dist/chunk-DJYMDLV5.js +0 -227
  144. package/dist/chunk-I5LR3D2K.js +0 -869
  145. package/dist/chunk-M4BBAERY.cjs +0 -1635
  146. package/dist/chunk-N23SKIG4.js +0 -73
  147. package/dist/chunk-PZCVF76Q.cjs +0 -868
  148. package/dist/chunk-QQ6ULXHI.cjs +0 -885
  149. package/dist/chunk-UK3WM7YZ.cjs +0 -75
  150. package/dist/chunk-VOKMAAJP.js +0 -848
  151. package/dist/node-evaluator-4MSDKWOG.cjs +0 -22
  152. package/dist/node-evaluator-SX4LEYQC.js +0 -12
  153. package/dist/workflow-C2a05WUJ.d.ts +0 -444
  154. package/dist/workflow-J-yYixny.d.cts +0 -444
@@ -1,6 +1,6 @@
1
1
  import { S as SourceFile } from './hash-CZkTXPCX.js';
2
- import { b as WorkflowDefinition, W as WorkflowInterface } from './types-BGoPzgcl.js';
3
- import { C as ConnectionResolver } from './assemble-DWgaXHd-.js';
2
+ import { W as WorkflowDefinition, b as WorkflowInterface, k as WorkflowConfig } from './types-V7jEEUaL.js';
3
+ import { d as ConnectionResolver, a as CollectedDurableWorkflow } from './collect-6NIEufHd.js';
4
4
  import { E as EsbuildApi, L as LowerError } from './lower-types-DQNBfWQn.js';
5
5
 
6
6
  /** One vendored package: its version and its files (paths relative to the package root). */
@@ -20,6 +20,12 @@ interface BuildBundleOptions {
20
20
  maxSourceBytes?: number;
21
21
  /** Largest bundle, in UTF-8 bytes. Default 1.5 MiB (4 MiB with vendored deps). */
22
22
  maxBundleBytes?: number;
23
+ /**
24
+ * `external` also returns a source map of the bundle (C-SOURCEMAP) in
25
+ * `map`. The bundle bytes, and so `buildId`, are the same as without it:
26
+ * no `sourceMappingURL` comment is added.
27
+ */
28
+ sourcemap?: 'external';
23
29
  }
24
30
  interface BuiltBundle {
25
31
  /** The ES module. */
@@ -33,6 +39,18 @@ interface BuiltBundle {
33
39
  */
34
40
  sourceHash: string;
35
41
  entries: string[];
42
+ /**
43
+ * The project modules (`workflows/order.ts`) and vendored files
44
+ * (`node_modules/<package>/<path>`) the bundle contains, sorted.
45
+ */
46
+ modules: string[];
47
+ /**
48
+ * With `sourcemap: 'external'`: the source map (version 3 JSON) of the
49
+ * bundle. Sources are named like build messages (`workflows/order.ts`,
50
+ * `node_modules/<package>/<path>`, `@fluidgrids/workflows`); the map holds
51
+ * no source contents, which the source archive already has.
52
+ */
53
+ map?: string;
36
54
  }
37
55
  /** Node built-in module names (without the `node:` prefix). */
38
56
  declare const NODE_BUILTINS: ReadonlySet<string>;
@@ -87,7 +105,7 @@ interface LowerOptions {
87
105
  }
88
106
  /** A problem `lower()` found in tier-2 sources without running them. */
89
107
  interface LowerIssue {
90
- code: 'durable.phaseC' | 'durable.activityTypeNotAllowed';
108
+ code: 'durable.phaseC' | 'durable.activityTypeNotAllowed' | 'durable.localActivityTimeout' | 'durable.activityImplInBundle';
91
109
  message: string;
92
110
  module: string;
93
111
  }
@@ -108,22 +126,52 @@ interface LowerResult {
108
126
  durableExports: Record<string, {
109
127
  interface: WorkflowInterface;
110
128
  taskQueue: string;
129
+ config?: WorkflowConfig;
111
130
  }>;
112
131
  /** Findings in tier-2 sources (Phase C features, refused activity node types). */
113
132
  issues: LowerIssue[];
133
+ /**
134
+ * Runtime features the bundle uses (C-FEATURES), sorted; written as
135
+ * `code.features` when not empty. The service refuses a feature its
136
+ * workspace flags do not enable.
137
+ */
138
+ features: string[];
114
139
  }
115
140
  /**
116
141
  * Bundle a project. Exported so services can compute `buildId` without
117
142
  * evaluating; `buildBundle()` is the full form (vendored packages, limits).
118
143
  */
119
144
  declare function bundleProject(files: ReadonlyMap<string, string>, entries: readonly string[], esbuild: EsbuildApi): Promise<string>;
145
+ /** The `code.exports.workflows` key of a dynamic workflow (11 §2.29). */
146
+ declare const DYNAMIC_EXPORT = "*";
147
+ /**
148
+ * Find user local activities (not run yet), refused activity node types and
149
+ * local-activity timeouts over the cap in the modules a tier-2 workflow may
150
+ * run (see {@link durableScanModules}), without running them. The runtime and
151
+ * the service refuse them as well; this reports them before a push. The
152
+ * Phase C features (queries, updates, user activities, search attributes,
153
+ * dynamic workflows, interceptors and sinks) are no longer findings: they are
154
+ * written to `code.features` and gated by the service (C-FEATURES).
155
+ *
156
+ * With `bundled` (the modules `buildBundle` put into the bundle), a
157
+ * user-activity implementation in one of them is reported as
158
+ * `durable.activityImplInBundle`: it belongs on a worker (CWD9).
159
+ */
160
+ declare function scanDurableSources(files: ReadonlyMap<string, string>, modules: Iterable<string>, bundled?: readonly string[]): LowerIssue[];
161
+ /**
162
+ * The modules a tier-2 workflow may run code from: every source module of a
163
+ * project that declares one (the declaring modules and every helper they may
164
+ * import), sorted. A project without tier-2 workflows has none.
165
+ */
166
+ declare function durableScanModules(files: ReadonlyMap<string, string>, durable: readonly Pick<CollectedDurableWorkflow, 'module'>[]): string[];
120
167
  /**
121
- * Find Phase C features and refused activity node types in the modules that
122
- * declare tier-2 functions, without running them. The runtime and the service
123
- * refuse both as well; this reports them before a push.
168
+ * The runtime features (C-FEATURES) of a bundle: what the call sites of every
169
+ * module a tier-2 workflow may run show (project helpers and vendored
170
+ * packages included), and what its declarations' options use, sorted and
171
+ * without duplicates.
124
172
  */
125
- declare function scanDurableSources(files: ReadonlyMap<string, string>, modules: Iterable<string>): LowerIssue[];
173
+ declare function durableFeatures(files: ReadonlyMap<string, string>, durable: readonly CollectedDurableWorkflow[], deps?: VendoredDeps): string[];
126
174
  /** Lower TypeScript sources (tier 1 and tier 2) to IR v2. */
127
175
  declare function lower(files: readonly SourceFile[] | Readonly<Record<string, string>>, options?: LowerOptions): Promise<LowerResult>;
128
176
 
129
- export { type BuildBundleOptions as B, DeterminismViolationError as D, type Evaluator as E, type LowerIssue as L, NODE_BUILTINS as N, type VendoredDeps as V, type VendoredPackage as a, type BuiltBundle as b, ESBUILD_VERSION as c, EVALUATION_GLOBAL as d, type LowerOptions as e, type LowerResult as f, type LoweredWorkflow as g, buildBundle as h, bundleProject as i, bundleSourceHash as j, defaultEntries as k, lower as l, splitSpecifier as m, resolvePackageEntry as r, scanDurableSources as s };
177
+ export { type BuildBundleOptions as B, DYNAMIC_EXPORT as D, type Evaluator as E, type LowerIssue as L, NODE_BUILTINS as N, type VendoredDeps as V, type VendoredPackage as a, type BuiltBundle as b, DeterminismViolationError as c, ESBUILD_VERSION as d, EVALUATION_GLOBAL as e, type LowerOptions as f, type LowerResult as g, type LoweredWorkflow as h, buildBundle as i, bundleProject as j, bundleSourceHash as k, defaultEntries as l, durableFeatures as m, durableScanModules as n, lower as o, splitSpecifier as p, resolvePackageEntry as r, scanDurableSources as s };
@@ -1,4 +1,4 @@
1
- import { J as JsonObject } from './types-BGoPzgcl.js';
1
+ import { J as JsonObject } from './types-V7jEEUaL.js';
2
2
 
3
3
  /** One input or output field. Output fields may also be a bare type name. */
4
4
  interface ManifestField {
@@ -1,4 +1,4 @@
1
- import { J as JsonObject } from './types-BGoPzgcl.cjs';
1
+ import { J as JsonObject } from './types-V7jEEUaL.cjs';
2
2
 
3
3
  /** One input or output field. Output fields may also be a bare type name. */
4
4
  interface ManifestField {
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ var chunkTCTE7DX5_cjs = require('./chunk-TCTE7DX5.cjs');
4
+ require('./chunk-ODZ2IAR2.cjs');
5
+ require('./chunk-3U2NU7YC.cjs');
6
+ require('./chunk-IQPXHQQQ.cjs');
7
+ require('./chunk-54FLQNUM.cjs');
8
+ require('./chunk-G4UEPUGO.cjs');
9
+ require('./chunk-GVTZMA5C.cjs');
10
+ require('./chunk-QKZL3ONM.cjs');
11
+ require('./chunk-TBDXTV22.cjs');
12
+ require('./chunk-SAENRNBJ.cjs');
13
+ require('./chunk-VA4OFR72.cjs');
14
+ require('./chunk-FR7KYWRO.cjs');
15
+ require('./chunk-A5SXCA62.cjs');
16
+ require('./chunk-TYF56RGB.cjs');
17
+ require('./chunk-Z2Y65YOY.cjs');
18
+
19
+
20
+
21
+ Object.defineProperty(exports, "createNodeVmEvaluator", {
22
+ enumerable: true,
23
+ get: function () { return chunkTCTE7DX5_cjs.createNodeVmEvaluator; }
24
+ });
@@ -0,0 +1,14 @@
1
+ export { createNodeVmEvaluator } from './chunk-HCM7ZC7Q.js';
2
+ import './chunk-5MFVJM76.js';
3
+ import './chunk-6OLN6BMB.js';
4
+ import './chunk-SR7TR5KX.js';
5
+ import './chunk-NWQ5WRLE.js';
6
+ import './chunk-5LUIDMF4.js';
7
+ import './chunk-JZ4TOOLN.js';
8
+ import './chunk-E2VK7J2C.js';
9
+ import './chunk-7AAZGVKD.js';
10
+ import './chunk-PMCM2OH4.js';
11
+ import './chunk-C4F5KJTI.js';
12
+ import './chunk-LNUQE6D6.js';
13
+ import './chunk-AC6ZEXVR.js';
14
+ import './chunk-5HIVIV53.js';
@@ -0,0 +1,122 @@
1
+ import { a as Json } from './types-V7jEEUaL.cjs';
2
+ import { s as CommandType, ac as RunEventType } from './types-Bv2i4cBX.cjs';
3
+
4
+ /**
5
+ * Payload fields and the encoded payload form (C-CMD-C, PLAN-C §3.2, 11 §2.9,
6
+ * §2.30). Pure data, no I/O: it runs inside the isolate as well.
7
+ *
8
+ * `PAYLOAD_FIELDS` names, per event type and per command type, the JSON
9
+ * pointers (relative to the event payload or the command) whose values are
10
+ * user payloads: activity args and results, workflow input and output, signal
11
+ * and update payloads, the memo and side-effect values. Two mechanisms use
12
+ * exactly these pointers and nothing else (CWD14):
13
+ *
14
+ * - a self-hosted worker's payload codec encodes them before anything
15
+ * crosses the bridge, and decodes them on the way back;
16
+ * - the service's at-rest KMS envelope (`kms/envelope`) encrypts them in
17
+ * stored events.
18
+ *
19
+ * Failures nest through `cause` (11 §2.30), so they are not listed as plain
20
+ * pointers: `FAILURE_FIELDS` and `COMMAND_FAILURE_FIELDS` point at failure
21
+ * objects, and the user payload of a failure is its `details` at every level
22
+ * of the `cause` chain. {@link mapEventPayloads} and
23
+ * {@link mapCommandPayloads} apply both lists and are what codecs and the
24
+ * envelope should call.
25
+ *
26
+ * Identifiers (ids, names, node types, task queues), failures other than
27
+ * their `details`, and search attributes stay in clear text, so the service can
28
+ * still match, index and query them. The lists are published as
29
+ * `schema/payload-fields.json` for the Python SDK.
30
+ */
31
+
32
+ /** The key that marks an encoded payload (`{"$fgp":1, encoding, metadata, data}`). */
33
+ declare const ENCODED_PAYLOAD_MARKER = "$fgp";
34
+ /** The version of the encoded payload form. */
35
+ declare const ENCODED_PAYLOAD_VERSION = 1;
36
+ /**
37
+ * Payload encodings (11 §2.30). `json/plain` values are never wrapped; every
38
+ * other encoding is carried as an {@link EncodedPayload}. A worker's payload
39
+ * converter may name its own encoding (for example `binary/protobuf`); the
40
+ * engine treats any encoding other than `json/plain` as opaque.
41
+ */
42
+ declare const PAYLOAD_ENCODINGS: readonly ["json/plain", "binary/plain", "binary/encrypted", "kms/envelope"];
43
+ type KnownPayloadEncoding = (typeof PAYLOAD_ENCODINGS)[number];
44
+ /**
45
+ * A payload that is not plain JSON: bytes in base64 with their encoding and
46
+ * string metadata (content type, key id, codec name). The engine, the canvas
47
+ * and workflow code treat it as an opaque JSON value; only the codec that wrote
48
+ * it (a worker's codec or the codec server, or the service for `kms/envelope`)
49
+ * reads `data`.
50
+ */
51
+ interface EncodedPayload {
52
+ $fgp: 1;
53
+ encoding: string;
54
+ metadata?: Record<string, string>;
55
+ /** Base64 (RFC 4648, with padding). */
56
+ data: string;
57
+ }
58
+ /** True when `value` is an {@link EncodedPayload}: exactly its keys, each well formed. */
59
+ declare function isEncodedPayload(value: unknown): value is EncodedPayload;
60
+ /** The encoding of a payload value: its own for an encoded payload, else `json/plain`. */
61
+ declare function payloadEncodingOf(value: Json | undefined): string;
62
+ /**
63
+ * Plain payload pointers per event type (relative to the event payload).
64
+ * Types not listed carry none. Failures are in {@link FAILURE_FIELDS}.
65
+ */
66
+ declare const PAYLOAD_FIELDS: Readonly<Partial<Record<RunEventType, readonly string[]>>>;
67
+ /**
68
+ * Failure pointers per event type (relative to the event payload): every
69
+ * property of the run-event schema that holds a failure. The payload of a
70
+ * failure is its `details`, and the `details` of each `cause` below it.
71
+ */
72
+ declare const FAILURE_FIELDS: Readonly<Partial<Record<RunEventType, readonly string[]>>>;
73
+ /** Plain payload pointers per command type (relative to the command). Types not listed carry none. */
74
+ declare const COMMAND_PAYLOAD_FIELDS: Readonly<Partial<Record<CommandType, readonly string[]>>>;
75
+ /** Failure pointers per command type (relative to the command); see {@link FAILURE_FIELDS}. */
76
+ declare const COMMAND_FAILURE_FIELDS: Readonly<Partial<Record<CommandType, readonly string[]>>>;
77
+ /** The payload pointers of a failure object (relative to it), at every level of its cause chain. */
78
+ declare const FAILURE_PAYLOAD_FIELDS: readonly string[];
79
+ /** The pointer of a failure's cause (relative to the failure); the rule applies to it again. */
80
+ declare const FAILURE_CAUSE_FIELD = "/cause";
81
+ /** The format tag of `schema/payload-fields.json`. */
82
+ declare const PAYLOAD_FIELDS_FORMAT = "fluidgrids.payload-fields";
83
+ /** `schema/payload-fields.json`: the pointers and the encoded form, for other SDKs. */
84
+ declare const PAYLOAD_FIELDS_DOCUMENT: {
85
+ readonly format: "fluidgrids.payload-fields";
86
+ readonly formatVersion: 2;
87
+ readonly description: "JSON pointers of user payloads per event type (relative to the payload) and per command type (relative to the command). `events` and `commands` are plain payload pointers. `eventFailures` and `commandFailures` point at failure objects: the payloads of a failure are the `failure.payloads` pointers relative to it, and the same rule applies again to the failure at `failure.cause` (recursively, to the end of the cause chain). Payload codecs and the at-rest envelope apply to these pointers only; everything else stays in clear text. A value that is not plain JSON is carried as {\"$fgp\": 1, \"encoding\", \"metadata\"?, \"data\" (base64)}.";
88
+ readonly encodedMarker: "$fgp";
89
+ readonly encodedVersion: 1;
90
+ readonly encodings: readonly ["json/plain", "binary/plain", "binary/encrypted", "kms/envelope"];
91
+ readonly events: Readonly<Partial<Record<"WORKFLOW_STARTED" | "WORKFLOW_TASK_SCHEDULED" | "WORKFLOW_TASK_STARTED" | "WORKFLOW_TASK_COMPLETED" | "WORKFLOW_TASK_FAILED" | "WORKFLOW_TASK_TIMED_OUT" | "ACTIVITY_SCHEDULED" | "ACTIVITY_STARTED" | "ACTIVITY_HEARTBEAT" | "ACTIVITY_COMPLETED" | "ACTIVITY_FAILED" | "ACTIVITY_TIMED_OUT" | "ACTIVITY_CANCEL_REQUESTED" | "ACTIVITY_CANCELLED" | "ACTIVITY_PAUSED" | "ACTIVITY_UNPAUSED" | "ACTIVITY_RESET" | "ACTIVITY_OPTIONS_UPDATED" | "TIMER_STARTED" | "TIMER_FIRED" | "TIMER_CANCELLED" | "SIGNAL_RECEIVED" | "UPDATE_ADMITTED" | "UPDATE_ACCEPTED" | "UPDATE_COMPLETED" | "CHILD_RUN_INITIATED" | "CHILD_RUN_STARTED" | "CHILD_RUN_COMPLETED" | "CHILD_RUN_FAILED" | "CHILD_RUN_CANCELLED" | "CHILD_RUN_TERMINATED" | "CHILD_RUN_TIMED_OUT" | "EXTERNAL_RUN_CANCEL_REQUESTED" | "EXTERNAL_RUN_CANCEL_RESOLVED" | "EXTERNAL_RUN_SIGNALED" | "SIDE_EFFECT_RECORDED" | "LOCAL_ACTIVITY_COMPLETED" | "LOCAL_ACTIVITY_FAILED" | "SEARCH_ATTRIBUTES_UPSERTED" | "CONTEXT_UPSERTED" | "MARKER_RECORDED" | "WORKFLOW_CANCEL_REQUESTED" | "WORKFLOW_RESET" | "VERSIONING_OVERRIDE_SET" | "WORKFLOW_COMPLETED" | "WORKFLOW_FAILED" | "WORKFLOW_CANCELLED" | "WORKFLOW_TERMINATED" | "WORKFLOW_TIMED_OUT" | "WORKFLOW_CONTINUED_AS_NEW", readonly string[]>>>;
92
+ readonly commands: Readonly<Partial<Record<"SCHEDULE_ACTIVITY" | "REQUEST_CANCEL_ACTIVITY" | "START_TIMER" | "CANCEL_TIMER" | "START_CHILD_RUN" | "SIGNAL_RUN" | "RECORD_SIDE_EFFECT" | "RECORD_MARKER" | "COMPLETE_WORKFLOW" | "FAIL_WORKFLOW" | "CANCEL_WORKFLOW" | "UPSERT_CONTEXT" | "RECORD_LOCAL_ACTIVITY" | "CONTINUE_AS_NEW" | "REQUEST_CANCEL_EXTERNAL_RUN" | "UPSERT_SEARCH_ATTRIBUTES" | "ACCEPT_UPDATE" | "REJECT_UPDATE" | "COMPLETE_UPDATE", readonly string[]>>>;
93
+ readonly eventFailures: Readonly<Partial<Record<"WORKFLOW_STARTED" | "WORKFLOW_TASK_SCHEDULED" | "WORKFLOW_TASK_STARTED" | "WORKFLOW_TASK_COMPLETED" | "WORKFLOW_TASK_FAILED" | "WORKFLOW_TASK_TIMED_OUT" | "ACTIVITY_SCHEDULED" | "ACTIVITY_STARTED" | "ACTIVITY_HEARTBEAT" | "ACTIVITY_COMPLETED" | "ACTIVITY_FAILED" | "ACTIVITY_TIMED_OUT" | "ACTIVITY_CANCEL_REQUESTED" | "ACTIVITY_CANCELLED" | "ACTIVITY_PAUSED" | "ACTIVITY_UNPAUSED" | "ACTIVITY_RESET" | "ACTIVITY_OPTIONS_UPDATED" | "TIMER_STARTED" | "TIMER_FIRED" | "TIMER_CANCELLED" | "SIGNAL_RECEIVED" | "UPDATE_ADMITTED" | "UPDATE_ACCEPTED" | "UPDATE_COMPLETED" | "CHILD_RUN_INITIATED" | "CHILD_RUN_STARTED" | "CHILD_RUN_COMPLETED" | "CHILD_RUN_FAILED" | "CHILD_RUN_CANCELLED" | "CHILD_RUN_TERMINATED" | "CHILD_RUN_TIMED_OUT" | "EXTERNAL_RUN_CANCEL_REQUESTED" | "EXTERNAL_RUN_CANCEL_RESOLVED" | "EXTERNAL_RUN_SIGNALED" | "SIDE_EFFECT_RECORDED" | "LOCAL_ACTIVITY_COMPLETED" | "LOCAL_ACTIVITY_FAILED" | "SEARCH_ATTRIBUTES_UPSERTED" | "CONTEXT_UPSERTED" | "MARKER_RECORDED" | "WORKFLOW_CANCEL_REQUESTED" | "WORKFLOW_RESET" | "VERSIONING_OVERRIDE_SET" | "WORKFLOW_COMPLETED" | "WORKFLOW_FAILED" | "WORKFLOW_CANCELLED" | "WORKFLOW_TERMINATED" | "WORKFLOW_TIMED_OUT" | "WORKFLOW_CONTINUED_AS_NEW", readonly string[]>>>;
94
+ readonly commandFailures: Readonly<Partial<Record<"SCHEDULE_ACTIVITY" | "REQUEST_CANCEL_ACTIVITY" | "START_TIMER" | "CANCEL_TIMER" | "START_CHILD_RUN" | "SIGNAL_RUN" | "RECORD_SIDE_EFFECT" | "RECORD_MARKER" | "COMPLETE_WORKFLOW" | "FAIL_WORKFLOW" | "CANCEL_WORKFLOW" | "UPSERT_CONTEXT" | "RECORD_LOCAL_ACTIVITY" | "CONTINUE_AS_NEW" | "REQUEST_CANCEL_EXTERNAL_RUN" | "UPSERT_SEARCH_ATTRIBUTES" | "ACCEPT_UPDATE" | "REJECT_UPDATE" | "COMPLETE_UPDATE", readonly string[]>>>;
95
+ readonly failure: {
96
+ readonly payloads: readonly string[];
97
+ readonly cause: "/cause";
98
+ };
99
+ };
100
+ /**
101
+ * Apply `fn` to the value at each payload pointer of `record` that is present,
102
+ * and to the payloads of each failure at `failures` (its `details` at every
103
+ * level of its `cause` chain), returning a copy (the input is not changed).
104
+ * `fn` receives the pointer of the value it is given.
105
+ */
106
+ declare function mapPayloadFields<T extends Record<string, Json | undefined>>(record: T, pointers: readonly string[], fn: (value: Json, pointer: string) => Json, failures?: readonly string[]): T;
107
+ /**
108
+ * Apply `fn` to every user payload of an event payload of type `type`: the
109
+ * {@link PAYLOAD_FIELDS} pointers and the failures of {@link FAILURE_FIELDS}.
110
+ * This is the call a payload codec or the at-rest envelope makes per event.
111
+ */
112
+ declare function mapEventPayloads<T extends Record<string, Json | undefined>>(type: RunEventType, payload: T, fn: (value: Json, pointer: string) => Json): T;
113
+ /**
114
+ * Apply `fn` to every user payload of a command: the
115
+ * {@link COMMAND_PAYLOAD_FIELDS} pointers and the failures of
116
+ * {@link COMMAND_FAILURE_FIELDS}.
117
+ */
118
+ declare function mapCommandPayloads<T extends {
119
+ type: CommandType;
120
+ }>(command: T, fn: (value: Json, pointer: string) => Json): T;
121
+
122
+ export { COMMAND_FAILURE_FIELDS as C, ENCODED_PAYLOAD_MARKER as E, FAILURE_CAUSE_FIELD as F, type KnownPayloadEncoding as K, PAYLOAD_ENCODINGS as P, COMMAND_PAYLOAD_FIELDS as a, ENCODED_PAYLOAD_VERSION as b, type EncodedPayload as c, FAILURE_FIELDS as d, FAILURE_PAYLOAD_FIELDS as e, PAYLOAD_FIELDS as f, PAYLOAD_FIELDS_DOCUMENT as g, PAYLOAD_FIELDS_FORMAT as h, isEncodedPayload as i, mapEventPayloads as j, mapPayloadFields as k, mapCommandPayloads as m, payloadEncodingOf as p };
@@ -0,0 +1,122 @@
1
+ import { a as Json } from './types-V7jEEUaL.js';
2
+ import { s as CommandType, ac as RunEventType } from './types-DGx-b9eq.js';
3
+
4
+ /**
5
+ * Payload fields and the encoded payload form (C-CMD-C, PLAN-C §3.2, 11 §2.9,
6
+ * §2.30). Pure data, no I/O: it runs inside the isolate as well.
7
+ *
8
+ * `PAYLOAD_FIELDS` names, per event type and per command type, the JSON
9
+ * pointers (relative to the event payload or the command) whose values are
10
+ * user payloads: activity args and results, workflow input and output, signal
11
+ * and update payloads, the memo and side-effect values. Two mechanisms use
12
+ * exactly these pointers and nothing else (CWD14):
13
+ *
14
+ * - a self-hosted worker's payload codec encodes them before anything
15
+ * crosses the bridge, and decodes them on the way back;
16
+ * - the service's at-rest KMS envelope (`kms/envelope`) encrypts them in
17
+ * stored events.
18
+ *
19
+ * Failures nest through `cause` (11 §2.30), so they are not listed as plain
20
+ * pointers: `FAILURE_FIELDS` and `COMMAND_FAILURE_FIELDS` point at failure
21
+ * objects, and the user payload of a failure is its `details` at every level
22
+ * of the `cause` chain. {@link mapEventPayloads} and
23
+ * {@link mapCommandPayloads} apply both lists and are what codecs and the
24
+ * envelope should call.
25
+ *
26
+ * Identifiers (ids, names, node types, task queues), failures other than
27
+ * their `details`, and search attributes stay in clear text, so the service can
28
+ * still match, index and query them. The lists are published as
29
+ * `schema/payload-fields.json` for the Python SDK.
30
+ */
31
+
32
+ /** The key that marks an encoded payload (`{"$fgp":1, encoding, metadata, data}`). */
33
+ declare const ENCODED_PAYLOAD_MARKER = "$fgp";
34
+ /** The version of the encoded payload form. */
35
+ declare const ENCODED_PAYLOAD_VERSION = 1;
36
+ /**
37
+ * Payload encodings (11 §2.30). `json/plain` values are never wrapped; every
38
+ * other encoding is carried as an {@link EncodedPayload}. A worker's payload
39
+ * converter may name its own encoding (for example `binary/protobuf`); the
40
+ * engine treats any encoding other than `json/plain` as opaque.
41
+ */
42
+ declare const PAYLOAD_ENCODINGS: readonly ["json/plain", "binary/plain", "binary/encrypted", "kms/envelope"];
43
+ type KnownPayloadEncoding = (typeof PAYLOAD_ENCODINGS)[number];
44
+ /**
45
+ * A payload that is not plain JSON: bytes in base64 with their encoding and
46
+ * string metadata (content type, key id, codec name). The engine, the canvas
47
+ * and workflow code treat it as an opaque JSON value; only the codec that wrote
48
+ * it (a worker's codec or the codec server, or the service for `kms/envelope`)
49
+ * reads `data`.
50
+ */
51
+ interface EncodedPayload {
52
+ $fgp: 1;
53
+ encoding: string;
54
+ metadata?: Record<string, string>;
55
+ /** Base64 (RFC 4648, with padding). */
56
+ data: string;
57
+ }
58
+ /** True when `value` is an {@link EncodedPayload}: exactly its keys, each well formed. */
59
+ declare function isEncodedPayload(value: unknown): value is EncodedPayload;
60
+ /** The encoding of a payload value: its own for an encoded payload, else `json/plain`. */
61
+ declare function payloadEncodingOf(value: Json | undefined): string;
62
+ /**
63
+ * Plain payload pointers per event type (relative to the event payload).
64
+ * Types not listed carry none. Failures are in {@link FAILURE_FIELDS}.
65
+ */
66
+ declare const PAYLOAD_FIELDS: Readonly<Partial<Record<RunEventType, readonly string[]>>>;
67
+ /**
68
+ * Failure pointers per event type (relative to the event payload): every
69
+ * property of the run-event schema that holds a failure. The payload of a
70
+ * failure is its `details`, and the `details` of each `cause` below it.
71
+ */
72
+ declare const FAILURE_FIELDS: Readonly<Partial<Record<RunEventType, readonly string[]>>>;
73
+ /** Plain payload pointers per command type (relative to the command). Types not listed carry none. */
74
+ declare const COMMAND_PAYLOAD_FIELDS: Readonly<Partial<Record<CommandType, readonly string[]>>>;
75
+ /** Failure pointers per command type (relative to the command); see {@link FAILURE_FIELDS}. */
76
+ declare const COMMAND_FAILURE_FIELDS: Readonly<Partial<Record<CommandType, readonly string[]>>>;
77
+ /** The payload pointers of a failure object (relative to it), at every level of its cause chain. */
78
+ declare const FAILURE_PAYLOAD_FIELDS: readonly string[];
79
+ /** The pointer of a failure's cause (relative to the failure); the rule applies to it again. */
80
+ declare const FAILURE_CAUSE_FIELD = "/cause";
81
+ /** The format tag of `schema/payload-fields.json`. */
82
+ declare const PAYLOAD_FIELDS_FORMAT = "fluidgrids.payload-fields";
83
+ /** `schema/payload-fields.json`: the pointers and the encoded form, for other SDKs. */
84
+ declare const PAYLOAD_FIELDS_DOCUMENT: {
85
+ readonly format: "fluidgrids.payload-fields";
86
+ readonly formatVersion: 2;
87
+ readonly description: "JSON pointers of user payloads per event type (relative to the payload) and per command type (relative to the command). `events` and `commands` are plain payload pointers. `eventFailures` and `commandFailures` point at failure objects: the payloads of a failure are the `failure.payloads` pointers relative to it, and the same rule applies again to the failure at `failure.cause` (recursively, to the end of the cause chain). Payload codecs and the at-rest envelope apply to these pointers only; everything else stays in clear text. A value that is not plain JSON is carried as {\"$fgp\": 1, \"encoding\", \"metadata\"?, \"data\" (base64)}.";
88
+ readonly encodedMarker: "$fgp";
89
+ readonly encodedVersion: 1;
90
+ readonly encodings: readonly ["json/plain", "binary/plain", "binary/encrypted", "kms/envelope"];
91
+ readonly events: Readonly<Partial<Record<"WORKFLOW_STARTED" | "WORKFLOW_TASK_SCHEDULED" | "WORKFLOW_TASK_STARTED" | "WORKFLOW_TASK_COMPLETED" | "WORKFLOW_TASK_FAILED" | "WORKFLOW_TASK_TIMED_OUT" | "ACTIVITY_SCHEDULED" | "ACTIVITY_STARTED" | "ACTIVITY_HEARTBEAT" | "ACTIVITY_COMPLETED" | "ACTIVITY_FAILED" | "ACTIVITY_TIMED_OUT" | "ACTIVITY_CANCEL_REQUESTED" | "ACTIVITY_CANCELLED" | "ACTIVITY_PAUSED" | "ACTIVITY_UNPAUSED" | "ACTIVITY_RESET" | "ACTIVITY_OPTIONS_UPDATED" | "TIMER_STARTED" | "TIMER_FIRED" | "TIMER_CANCELLED" | "SIGNAL_RECEIVED" | "UPDATE_ADMITTED" | "UPDATE_ACCEPTED" | "UPDATE_COMPLETED" | "CHILD_RUN_INITIATED" | "CHILD_RUN_STARTED" | "CHILD_RUN_COMPLETED" | "CHILD_RUN_FAILED" | "CHILD_RUN_CANCELLED" | "CHILD_RUN_TERMINATED" | "CHILD_RUN_TIMED_OUT" | "EXTERNAL_RUN_CANCEL_REQUESTED" | "EXTERNAL_RUN_CANCEL_RESOLVED" | "EXTERNAL_RUN_SIGNALED" | "SIDE_EFFECT_RECORDED" | "LOCAL_ACTIVITY_COMPLETED" | "LOCAL_ACTIVITY_FAILED" | "SEARCH_ATTRIBUTES_UPSERTED" | "CONTEXT_UPSERTED" | "MARKER_RECORDED" | "WORKFLOW_CANCEL_REQUESTED" | "WORKFLOW_RESET" | "VERSIONING_OVERRIDE_SET" | "WORKFLOW_COMPLETED" | "WORKFLOW_FAILED" | "WORKFLOW_CANCELLED" | "WORKFLOW_TERMINATED" | "WORKFLOW_TIMED_OUT" | "WORKFLOW_CONTINUED_AS_NEW", readonly string[]>>>;
92
+ readonly commands: Readonly<Partial<Record<"SCHEDULE_ACTIVITY" | "REQUEST_CANCEL_ACTIVITY" | "START_TIMER" | "CANCEL_TIMER" | "START_CHILD_RUN" | "SIGNAL_RUN" | "RECORD_SIDE_EFFECT" | "RECORD_MARKER" | "COMPLETE_WORKFLOW" | "FAIL_WORKFLOW" | "CANCEL_WORKFLOW" | "UPSERT_CONTEXT" | "RECORD_LOCAL_ACTIVITY" | "CONTINUE_AS_NEW" | "REQUEST_CANCEL_EXTERNAL_RUN" | "UPSERT_SEARCH_ATTRIBUTES" | "ACCEPT_UPDATE" | "REJECT_UPDATE" | "COMPLETE_UPDATE", readonly string[]>>>;
93
+ readonly eventFailures: Readonly<Partial<Record<"WORKFLOW_STARTED" | "WORKFLOW_TASK_SCHEDULED" | "WORKFLOW_TASK_STARTED" | "WORKFLOW_TASK_COMPLETED" | "WORKFLOW_TASK_FAILED" | "WORKFLOW_TASK_TIMED_OUT" | "ACTIVITY_SCHEDULED" | "ACTIVITY_STARTED" | "ACTIVITY_HEARTBEAT" | "ACTIVITY_COMPLETED" | "ACTIVITY_FAILED" | "ACTIVITY_TIMED_OUT" | "ACTIVITY_CANCEL_REQUESTED" | "ACTIVITY_CANCELLED" | "ACTIVITY_PAUSED" | "ACTIVITY_UNPAUSED" | "ACTIVITY_RESET" | "ACTIVITY_OPTIONS_UPDATED" | "TIMER_STARTED" | "TIMER_FIRED" | "TIMER_CANCELLED" | "SIGNAL_RECEIVED" | "UPDATE_ADMITTED" | "UPDATE_ACCEPTED" | "UPDATE_COMPLETED" | "CHILD_RUN_INITIATED" | "CHILD_RUN_STARTED" | "CHILD_RUN_COMPLETED" | "CHILD_RUN_FAILED" | "CHILD_RUN_CANCELLED" | "CHILD_RUN_TERMINATED" | "CHILD_RUN_TIMED_OUT" | "EXTERNAL_RUN_CANCEL_REQUESTED" | "EXTERNAL_RUN_CANCEL_RESOLVED" | "EXTERNAL_RUN_SIGNALED" | "SIDE_EFFECT_RECORDED" | "LOCAL_ACTIVITY_COMPLETED" | "LOCAL_ACTIVITY_FAILED" | "SEARCH_ATTRIBUTES_UPSERTED" | "CONTEXT_UPSERTED" | "MARKER_RECORDED" | "WORKFLOW_CANCEL_REQUESTED" | "WORKFLOW_RESET" | "VERSIONING_OVERRIDE_SET" | "WORKFLOW_COMPLETED" | "WORKFLOW_FAILED" | "WORKFLOW_CANCELLED" | "WORKFLOW_TERMINATED" | "WORKFLOW_TIMED_OUT" | "WORKFLOW_CONTINUED_AS_NEW", readonly string[]>>>;
94
+ readonly commandFailures: Readonly<Partial<Record<"SCHEDULE_ACTIVITY" | "REQUEST_CANCEL_ACTIVITY" | "START_TIMER" | "CANCEL_TIMER" | "START_CHILD_RUN" | "SIGNAL_RUN" | "RECORD_SIDE_EFFECT" | "RECORD_MARKER" | "COMPLETE_WORKFLOW" | "FAIL_WORKFLOW" | "CANCEL_WORKFLOW" | "UPSERT_CONTEXT" | "RECORD_LOCAL_ACTIVITY" | "CONTINUE_AS_NEW" | "REQUEST_CANCEL_EXTERNAL_RUN" | "UPSERT_SEARCH_ATTRIBUTES" | "ACCEPT_UPDATE" | "REJECT_UPDATE" | "COMPLETE_UPDATE", readonly string[]>>>;
95
+ readonly failure: {
96
+ readonly payloads: readonly string[];
97
+ readonly cause: "/cause";
98
+ };
99
+ };
100
+ /**
101
+ * Apply `fn` to the value at each payload pointer of `record` that is present,
102
+ * and to the payloads of each failure at `failures` (its `details` at every
103
+ * level of its `cause` chain), returning a copy (the input is not changed).
104
+ * `fn` receives the pointer of the value it is given.
105
+ */
106
+ declare function mapPayloadFields<T extends Record<string, Json | undefined>>(record: T, pointers: readonly string[], fn: (value: Json, pointer: string) => Json, failures?: readonly string[]): T;
107
+ /**
108
+ * Apply `fn` to every user payload of an event payload of type `type`: the
109
+ * {@link PAYLOAD_FIELDS} pointers and the failures of {@link FAILURE_FIELDS}.
110
+ * This is the call a payload codec or the at-rest envelope makes per event.
111
+ */
112
+ declare function mapEventPayloads<T extends Record<string, Json | undefined>>(type: RunEventType, payload: T, fn: (value: Json, pointer: string) => Json): T;
113
+ /**
114
+ * Apply `fn` to every user payload of a command: the
115
+ * {@link COMMAND_PAYLOAD_FIELDS} pointers and the failures of
116
+ * {@link COMMAND_FAILURE_FIELDS}.
117
+ */
118
+ declare function mapCommandPayloads<T extends {
119
+ type: CommandType;
120
+ }>(command: T, fn: (value: Json, pointer: string) => Json): T;
121
+
122
+ export { COMMAND_FAILURE_FIELDS as C, ENCODED_PAYLOAD_MARKER as E, FAILURE_CAUSE_FIELD as F, type KnownPayloadEncoding as K, PAYLOAD_ENCODINGS as P, COMMAND_PAYLOAD_FIELDS as a, ENCODED_PAYLOAD_VERSION as b, type EncodedPayload as c, FAILURE_FIELDS as d, FAILURE_PAYLOAD_FIELDS as e, PAYLOAD_FIELDS as f, PAYLOAD_FIELDS_DOCUMENT as g, PAYLOAD_FIELDS_FORMAT as h, isEncodedPayload as i, mapEventPayloads as j, mapPayloadFields as k, mapCommandPayloads as m, payloadEncodingOf as p };