@reventlessdev/reventless-core 3.0.0-alpha.169 → 3.0.0-alpha.170

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 (44) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/package.json +14 -14
  3. package/src/admin/Platform_Admin.res +5 -2
  4. package/src/admin/Platform_Admin.res.mjs +4 -4
  5. package/src/components/Aggregate/Aggregate.res +5 -1
  6. package/src/components/Aggregate/Aggregate_Builder.res +21 -6
  7. package/src/components/Aggregate/Aggregate_Builder.res.mjs +10 -7
  8. package/src/components/AutomationSlice/AutomationSlice.res +1 -0
  9. package/src/components/AutomationSlice/AutomationSlice_Builder.res +13 -2
  10. package/src/components/AutomationSlice/AutomationSlice_Builder.res.mjs +5 -2
  11. package/src/components/Builder_Helpers.res +16 -2
  12. package/src/components/Builder_Helpers.res.mjs +6 -6
  13. package/src/components/Dcb/Dcb_Builder.res +46 -4
  14. package/src/components/Dcb/Dcb_Builder.res.mjs +13 -9
  15. package/src/components/ExtensionPoint/ExtensionPoint.res +2 -0
  16. package/src/components/ExtensionPoint/ExtensionPoint_Builder.res +7 -0
  17. package/src/components/ExtensionPoint/ExtensionPoint_Builder.res.mjs +4 -2
  18. package/src/components/InboundTranslationSlice/InboundTranslationSlice.res +1 -0
  19. package/src/components/InboundTranslationSlice/InboundTranslationSlice_Builder.res +8 -1
  20. package/src/components/InboundTranslationSlice/InboundTranslationSlice_Builder.res.mjs +1 -1
  21. package/src/components/OutboundTranslationSlice/OutboundTranslationSlice.res +1 -0
  22. package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Builder.res +12 -3
  23. package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Builder.res.mjs +5 -2
  24. package/src/components/ReadModel/ReadModel.res +1 -0
  25. package/src/components/ReadModel/ReadModel_Builder.res +9 -1
  26. package/src/components/ReadModel/ReadModel_Builder.res.mjs +5 -2
  27. package/src/components/StateChangeSlice/StateChangeSlice.res +1 -0
  28. package/src/components/StateChangeSlice/StateChangeSlice_Builder.res +6 -0
  29. package/src/components/StateChangeSlice/StateChangeSlice_Builder.res.mjs +1 -1
  30. package/src/components/StateViewSlice/StateViewSlice.res +1 -0
  31. package/src/components/StateViewSlice/StateViewSlice_Builder.res +11 -3
  32. package/src/components/StateViewSlice/StateViewSlice_Builder.res.mjs +5 -2
  33. package/src/components/Task/Task.res +1 -0
  34. package/src/components/Task/Task_Builder.res +9 -2
  35. package/src/components/Task/Task_Builder.res.mjs +5 -2
  36. package/src/plugin/component/Plugin.res +5 -0
  37. package/src/plugin/component/Plugin_Builder.res +10 -2
  38. package/src/plugin/component/Plugin_Builder.res.mjs +7 -6
  39. package/src/plugin/component/Plugin_Helpers.res +2 -0
  40. package/src/plugin/component/Plugin_Helpers.res.mjs +2 -2
  41. package/tests/plugin/ManifestVisibilityTest.res +2 -2
  42. package/tests/plugin/ManifestVisibilityTest.res.mjs +2 -2
  43. package/tests/plugin/PluginStructureTest.res +6 -6
  44. package/tests/plugin/PluginStructureTest.res.mjs +6 -6
package/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 3.0.0-alpha.170 (2026-07-16)
7
+
8
+ ### Features
9
+
10
+ * **aws:** consume per-component runtime hints; fold into shared command Lambdas ([7ba2485](https://github.com/ReventlessDev/reventless-core/commit/7ba248579f2472f2fc847b26033927199353f3e6))
11
+ * **core:** honor per-component runtime hints for ExtensionPoints ([72d0218](https://github.com/ReventlessDev/reventless-core/commit/72d0218ec4f73d6a59230640c9ee4a538e6b8688))
12
+ * **core:** thread per-component runtime hints from plugin.json (spec/infra/core/local) ([a94f419](https://github.com/ReventlessDev/reventless-core/commit/a94f4199c4ac7eeeb24dd0a71d58fb73c1e514e6))
13
+
14
+
6
15
  # 3.0.0-alpha.169 (2026-07-15)
7
16
 
8
17
  **Note:** Version bump only for package @reventlessdev/reventless-core
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-core",
3
- "version": "3.0.0-alpha.169",
3
+ "version": "3.0.0-alpha.170",
4
4
  "description": "Core package for Reventless framework",
5
5
  "license": "Apache-2.0",
6
6
  "jest": {
@@ -28,25 +28,25 @@
28
28
  "dependencies": {
29
29
  "sury": "11.0.0-alpha.4",
30
30
  "uuid": "^13.0.0",
31
- "@reventlessdev/rescript-fast-csv": "1.2.0-alpha.12",
32
- "@reventlessdev/rescript-hash-object": "1.2.0-alpha.11",
33
- "@reventlessdev/rescript-node-streams": "1.1.0-alpha.11",
34
- "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.15",
35
- "@reventlessdev/rescript-jest": "1.0.0-alpha.7",
36
- "@reventlessdev/rescript-effect": "0.1.0-alpha.27",
37
- "@reventlessdev/rescript-ssh2": "1.1.0-alpha.12",
38
- "@reventlessdev/rescript-uuid": "1.1.0-alpha.15",
39
- "@reventlessdev/reventless-infra": "3.0.0-alpha.100",
40
- "@reventlessdev/reventless-interop": "3.0.0-alpha.26",
41
- "@reventlessdev/reventless-spec": "3.0.0-alpha.77"
31
+ "@reventlessdev/rescript-effect": "0.1.0-alpha.28",
32
+ "@reventlessdev/rescript-hash-object": "1.2.0-alpha.12",
33
+ "@reventlessdev/rescript-fast-csv": "1.2.0-alpha.13",
34
+ "@reventlessdev/rescript-jest": "1.0.0-alpha.8",
35
+ "@reventlessdev/rescript-node-streams": "1.1.0-alpha.12",
36
+ "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.16",
37
+ "@reventlessdev/rescript-uuid": "1.1.0-alpha.16",
38
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.78",
39
+ "@reventlessdev/reventless-interop": "3.0.0-alpha.27",
40
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.101",
41
+ "@reventlessdev/rescript-ssh2": "1.1.0-alpha.13"
42
42
  },
43
43
  "devDependencies": {
44
- "rescript": "^12.3.0",
44
+ "rescript": "12.3.0",
45
45
  "sury-ppx": "11.0.0-alpha.2",
46
46
  "@reventlessdev/reventless-ppx": "1.0.0-alpha.53"
47
47
  },
48
48
  "peerDependencies": {
49
- "rescript": "^12.3.0"
49
+ "rescript": "12.3.0"
50
50
  },
51
51
  "gitHead": "ddea51534dc210635d7b11968089627b3b697ce2",
52
52
  "publishConfig": {
@@ -134,7 +134,8 @@ module Make = (
134
134
  )
135
135
  // Aggregates constructed early so multi-source AutomationSlices created
136
136
  // inside DcbBuilder can subscribe to Aggregate event topics.
137
- let aggregatesWithoutEventMappers = aggregates->createAggregatesWithoutEventMappers(~api, opts)
137
+ let aggregatesWithoutEventMappers =
138
+ aggregates->createAggregatesWithoutEventMappers(~api, ~componentRuntime=Dict.make(), opts)
138
139
  let aggregateEventTopics = Aggregate.allEventTopics(aggregatesWithoutEventMappers)
139
140
 
140
141
  // Wire CommandGenerator → AppSync / in-memory GraphQL resolvers via
@@ -267,7 +268,8 @@ module Make = (
267
268
  Plugin_Helpers.stateSchemaRegistry->Dict.set(registryKey, entry.stateSchema)
268
269
  })
269
270
 
270
- let readModelsOutputs = readModels->createReadModels(~api, ~apiRole, allEventTopics, opts)
271
+ let readModelsOutputs =
272
+ readModels->createReadModels(~api, ~apiRole, ~componentRuntime=Dict.make(), allEventTopics, opts)
271
273
 
272
274
  let allQueryDbs = readModelsOutputs->ReadModel.allQueryDbs
273
275
  // Merge DCB StateViewSlice / InboundTranslation QueryDbs into allQueryDbs so the
@@ -376,6 +378,7 @@ module Make = (
376
378
  ~scheduler,
377
379
  ~queryEngine,
378
380
  ~resourceNaming,
381
+ ~componentRuntime=Dict.make(),
379
382
  ~opts,
380
383
  )
381
384
 
@@ -68,10 +68,10 @@ function Make(RuntimeEnvironment) {
68
68
  let DcbBuilder = Dcb_Builder$ReventlessCore.Make(DcbEventLogStorage)(DcbEventTopicPublisher)(DcbCommandTopicChannel)(DcbCommandTopicChannelAsync)(AdminRuntimeBuilder)({
69
69
  hooks: Config.hooks
70
70
  });
71
- let aggregatesWithoutEventMappers = Builder_Helpers$ReventlessCore.createAggregatesWithoutEventMappers(aggregates, api, opts);
71
+ let aggregatesWithoutEventMappers = Builder_Helpers$ReventlessCore.createAggregatesWithoutEventMappers(aggregates, api, {}, opts);
72
72
  let aggregateEventTopics = Aggregate$ReventlessCore.allEventTopics(aggregatesWithoutEventMappers);
73
73
  Plugin_Helpers$ReventlessCore.registerAdminAggregateMutations(aggregates, Config.hooks);
74
- let dcbResult = DcbBuilder.construct(name, name, "Platform", true, undefined, undefined, aggregateEventTopics, stateChangeSlices, stateViewSlices, automationSlices, outboundTranslationSlices, inboundTranslationSlices, undefined, undefined, opts);
74
+ let dcbResult = DcbBuilder.construct(name, name, "Platform", true, undefined, undefined, aggregateEventTopics, stateChangeSlices, stateViewSlices, automationSlices, outboundTranslationSlices, inboundTranslationSlices, undefined, undefined, undefined, opts);
75
75
  let slicePublishJsons = dcbResult.dcbPublishJsons;
76
76
  if (slicePublishJsons !== undefined) {
77
77
  stateChangeSlices.forEach(Sc => {
@@ -129,7 +129,7 @@ function Make(RuntimeEnvironment) {
129
129
  Plugin_Helpers$ReventlessCore.queryFieldNamesRegistry[registryKey] = qn;
130
130
  Plugin_Helpers$ReventlessCore.stateSchemaRegistry[registryKey] = entry.stateSchema;
131
131
  });
132
- let readModelsOutputs = Builder_Helpers$ReventlessCore.createReadModels(readModels, api, apiRole, aggregateEventTopics, opts);
132
+ let readModelsOutputs = Builder_Helpers$ReventlessCore.createReadModels(readModels, api, apiRole, {}, aggregateEventTopics, opts);
133
133
  let allQueryDbs = ReadModel$ReventlessCore.allQueryDbs(readModelsOutputs);
134
134
  let staticSchemaPush = Stdlib_Option.isSome(Config.hooks.preAdminResolversSchemaHook);
135
135
  if (!staticSchemaPush) {
@@ -167,7 +167,7 @@ function Make(RuntimeEnvironment) {
167
167
  ]).apply(param => {
168
168
  let queryEngine = param[2];
169
169
  Builder_Helpers$ReventlessCore.addEventMappers(aggregateEventTopics, queryEngine);
170
- let match = Builder_Helpers$ReventlessCore.createExtensionPoints(extensionPoints, param[0], param[1], param[3], queryEngine, resourceNaming, opts);
170
+ let match = Builder_Helpers$ReventlessCore.createExtensionPoints(extensionPoints, param[0], param[1], param[3], queryEngine, resourceNaming, {}, opts);
171
171
  let extensionPointsOutputs = match[0];
172
172
  let aggregateNames = Stdlib_Array.reduce(extensionPointsOutputs.map(extensionPointOutputs => Belt_SetString.fromArray(extensionPointOutputs.aggregateNames)), undefined, Belt_SetString.union);
173
173
  let aggregatesOutputs = Builder_Helpers$ReventlessCore.addEventMappers(aggregateEventTopics, queryEngine);
@@ -89,7 +89,11 @@ module type T = {
89
89
 
90
90
  type api
91
91
  type component = Component.t<t, outputs, operations>
92
- let make: (~api: api, ~opts: Pulumi.ComponentResource.options=?) => component
92
+ let make: (
93
+ ~api: api,
94
+ ~runtime: ReventlessInfra.RuntimeHints.t=?,
95
+ ~opts: Pulumi.ComponentResource.options=?,
96
+ ) => component
93
97
  let outputs: component => outputs
94
98
  let operations: component => Pulumi.Output.t<operations>
95
99
  let finish: unit => unit
@@ -66,7 +66,7 @@ module Make = (
66
66
  }
67
67
  }
68
68
 
69
- let createCommandTopic = (eventLog: SpecificEventLog.component, name, opts) =>
69
+ let createCommandTopic = (eventLog: SpecificEventLog.component, name, opts, ~memorySize, ~timeout) =>
70
70
  eventLog
71
71
  ->Component.operations
72
72
  ->Pulumi.Output.apply(eventLogOps => {
@@ -88,6 +88,8 @@ module Make = (
88
88
  let resources = [eventLog.resources, eventLog.eventTopic.resources]->Array.flat
89
89
  commandTopic->AggregateRuntimeBuilder.forCommandTopic(
90
90
  ~handler,
91
+ ~memorySize,
92
+ ~timeout,
91
93
  ~connect=SpecificCommandTopic.connect(commandTopic, ~resources, ...),
92
94
  )
93
95
  commandTopic
@@ -98,6 +100,8 @@ module Make = (
98
100
  ~api: CommandGeneratorResolvers.api,
99
101
  name,
100
102
  opts,
103
+ ~memorySize,
104
+ ~timeout,
101
105
  ) =>
102
106
  commandTopic->Pulumi.Output.flatMap(commandTopic =>
103
107
  commandTopic
@@ -126,6 +130,8 @@ module Make = (
126
130
  let resources = (commandTopic->Component.outputs).resources
127
131
  commandGenerator->AggregateRuntimeBuilder.forCommandGenerator(
128
132
  ~handler=SpecificCommandGenerator.makeHandler(~publishJsons, ~publishJsonsAndWait),
133
+ ~memorySize,
134
+ ~timeout,
129
135
  ~connect=SpecificCommandGenerator.connect(commandGenerator, ~api, ~resources, ...),
130
136
  )
131
137
  }
@@ -133,13 +139,18 @@ module Make = (
133
139
  })
134
140
  )
135
141
 
136
- let construct = (~api: CommandGeneratorResolvers.api, self, name) => {
142
+ let construct = (~api: CommandGeneratorResolvers.api, ~runtime, self, name) => {
137
143
  let opts = {Pulumi.ComponentResource.parent: self->Component.toPulumiResource}
138
144
  let name = name->ComponentType.name(Aggregate.componentType)
139
145
 
146
+ // Per-component runtime hint (plugin.json) raises the per-kind memory floor
147
+ // and overrides the timeout; absent hint keeps the builder defaults.
148
+ let memorySize = ReventlessInfra.RuntimeHints.resolveMemory(runtime, ~default=1024)
149
+ let timeout = ReventlessInfra.RuntimeHints.resolveTimeout(runtime, ~default=30)
150
+
140
151
  let eventLog = SpecificEventLog.make(~name, ~opts)
141
- let commandTopic = eventLog->createCommandTopic(name, opts)
142
- let commandGenerator = commandTopic->createCommandGenerator(~api, name, opts)
152
+ let commandTopic = eventLog->createCommandTopic(name, opts, ~memorySize, ~timeout)
153
+ let commandGenerator = commandTopic->createCommandGenerator(~api, name, opts, ~memorySize, ~timeout)
143
154
 
144
155
  self->Component.setOperations(
145
156
  commandTopic->Pulumi.Output.flatMap(commandTopic =>
@@ -161,11 +172,15 @@ module Make = (
161
172
  self->Component.setOutputs(aggOutputs)
162
173
  }
163
174
 
164
- let make = (~api: CommandGeneratorResolvers.api, ~opts=?): Aggregate.component =>
175
+ let make = (
176
+ ~api: CommandGeneratorResolvers.api,
177
+ ~runtime=?,
178
+ ~opts=?,
179
+ ): Aggregate.component =>
165
180
  Component.make(
166
181
  ~componentType=Aggregate.componentType->ComponentType.toString,
167
182
  ~name=Spec.name,
168
- ~construct=construct(~api, ...),
183
+ ~construct=construct(~api, ~runtime, ...),
169
184
  ~opts,
170
185
  )
171
186
 
@@ -5,6 +5,7 @@ import * as Pulumi from "@pulumi/pulumi";
5
5
  import * as Aggregate$ReventlessCore from "./Aggregate.res.mjs";
6
6
  import * as Component$ReventlessCore from "../Component.res.mjs";
7
7
  import * as ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
8
+ import * as RuntimeHints$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/RuntimeHints.res.mjs";
8
9
  import * as Plugin_Helpers$ReventlessCore from "../../plugin/component/Plugin_Helpers.res.mjs";
9
10
  import * as EventLog_Builder$ReventlessCore from "../EventLog/EventLog_Builder.res.mjs";
10
11
  import * as Aggregate_Callback$ReventlessCore from "./Aggregate_Callback.res.mjs";
@@ -29,7 +30,7 @@ function Make(Spec) {
29
30
  Id: Spec.Id,
30
31
  commandSchema: Spec.commandSchema
31
32
  })(SpecificEventCollector)(EventMappings)(AggregateRuntimeBuilder);
32
- let createCommandTopic = (eventLog, name, opts) => Component$ReventlessCore.operations(eventLog).apply(eventLogOps => {
33
+ let createCommandTopic = (eventLog, name, opts, memorySize, timeout) => Component$ReventlessCore.operations(eventLog).apply(eventLogOps => {
33
34
  let AggregateCallback = Aggregate_Callback$ReventlessCore.Make(Spec)(Behavior)({
34
35
  Spec: Spec,
35
36
  EventLog: SpecificEventLog,
@@ -42,10 +43,10 @@ function Make(Spec) {
42
43
  eventLog$1.resources,
43
44
  eventLog$1.eventTopic.resources
44
45
  ].flat();
45
- AggregateRuntimeBuilder.forCommandTopic(handler, none => SpecificCommandTopic.connect(none, resources, commandTopic), undefined, undefined, commandTopic);
46
+ AggregateRuntimeBuilder.forCommandTopic(handler, none => SpecificCommandTopic.connect(none, resources, commandTopic), memorySize, timeout, commandTopic);
46
47
  return commandTopic;
47
48
  });
48
- let createCommandGenerator = (commandTopic, api, name, opts) => Output$Pulumi.flatMap(commandTopic, commandTopic => Component$ReventlessCore.operations(commandTopic).apply(param => {
49
+ let createCommandGenerator = (commandTopic, api, name, opts, memorySize, timeout) => Output$Pulumi.flatMap(commandTopic, commandTopic => Component$ReventlessCore.operations(commandTopic).apply(param => {
49
50
  let publishJsonsAndWait = param.publishJsonsAndWait;
50
51
  let publishJsons = param.publishJsons;
51
52
  let commandGenerator = SpecificCommandGenerator.make(name, opts);
@@ -59,19 +60,21 @@ function Make(Spec) {
59
60
  fields.forEach(field => bindHandler(field, generateCommand));
60
61
  } else {
61
62
  let resources = Component$ReventlessCore.outputs(commandTopic).resources;
62
- AggregateRuntimeBuilder.forCommandGenerator(SpecificCommandGenerator.makeHandler(publishJsons, publishJsonsAndWait), none => SpecificCommandGenerator.connect(api, resources, none, commandGenerator), undefined, undefined, commandGenerator);
63
+ AggregateRuntimeBuilder.forCommandGenerator(SpecificCommandGenerator.makeHandler(publishJsons, publishJsonsAndWait), none => SpecificCommandGenerator.connect(api, resources, none, commandGenerator), memorySize, timeout, commandGenerator);
63
64
  }
64
65
  return commandGenerator;
65
66
  }));
66
- let make = (api, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(Aggregate$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
67
+ let make = (api, runtime, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(Aggregate$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
67
68
  let opts_parent = Component$ReventlessCore.toPulumiResource(extra);
68
69
  let opts = {
69
70
  parent: opts_parent
70
71
  };
71
72
  let name = ComponentType$ReventlessCore.name(extra$1, Aggregate$ReventlessCore.componentType);
73
+ let memorySize = RuntimeHints$ReventlessInfra.resolveMemory(runtime, 1024);
74
+ let timeout = RuntimeHints$ReventlessInfra.resolveTimeout(runtime, 30);
72
75
  let eventLog = SpecificEventLog.make(name, opts);
73
- let commandTopic = createCommandTopic(eventLog, name, opts);
74
- let commandGenerator = createCommandGenerator(commandTopic, api, name, opts);
76
+ let commandTopic = createCommandTopic(eventLog, name, opts, memorySize, timeout);
77
+ let commandGenerator = createCommandGenerator(commandTopic, api, name, opts, memorySize, timeout);
75
78
  Component$ReventlessCore.setOperations(extra, Output$Pulumi.flatMap(commandTopic, commandTopic => Component$ReventlessCore.operations(commandTopic).apply(param => ({
76
79
  publishJsons: param.publishJsons,
77
80
  publishJsonsStream: param.publishJsonsStream
@@ -34,6 +34,7 @@ module type T = {
34
34
  ~allEventTopics: EventTopic.allOutputs,
35
35
  ~publishJsons: Pulumi.Output.t<CommandTopic.publishJsons>,
36
36
  ~context: Reventless.AutomationSlice.context,
37
+ ~runtime: ReventlessInfra.RuntimeHints.t=?,
37
38
  ~opts: Pulumi.ComponentResource.options=?,
38
39
  ) => component
39
40
  }
@@ -81,10 +81,13 @@ module Make = (
81
81
  ~allEventTopics: EventTopic.allOutputs,
82
82
  ~publishJsons,
83
83
  ~context: Reventless.AutomationSlice.context,
84
+ ~runtime,
84
85
  self,
85
86
  _name,
86
87
  ) => {
87
88
  let opts = {Pulumi.ComponentResource.parent: self->Component.toPulumiResource}
89
+ let memorySize = ReventlessInfra.RuntimeHints.resolveMemory(runtime, ~default=1024)
90
+ let timeout = ReventlessInfra.RuntimeHints.resolveTimeout(runtime, ~default=30)
88
91
 
89
92
  let queryDb = SpecificQueryDb.make(~api=Api.api(), ~apiRole=Api.apiRole(), ~opts)
90
93
 
@@ -168,6 +171,8 @@ module Make = (
168
171
  ~handler,
169
172
  ~eventTopics,
170
173
  ~resources,
174
+ ~memorySize,
175
+ ~timeout,
171
176
  )
172
177
  ec
173
178
  })
@@ -196,11 +201,17 @@ module Make = (
196
201
  self->Component.setOutputs(outputs)
197
202
  }
198
203
 
199
- let make = (~allEventTopics, ~publishJsons, ~context, ~opts=?): AutomationSlice.component =>
204
+ let make = (
205
+ ~allEventTopics,
206
+ ~publishJsons,
207
+ ~context,
208
+ ~runtime=?,
209
+ ~opts=?,
210
+ ): AutomationSlice.component =>
200
211
  Component.make(
201
212
  ~componentType=AutomationSlice.componentType->ComponentType.toString,
202
213
  ~name=Spec.name,
203
- ~construct=construct(~allEventTopics, ~publishJsons, ~context, ...),
214
+ ~construct=construct(~allEventTopics, ~publishJsons, ~context, ~runtime, ...),
204
215
  ~opts,
205
216
  )
206
217
  }
@@ -17,6 +17,7 @@ import * as Component$ReventlessCore from "../Component.res.mjs";
17
17
  import * as EventTopic$ReventlessCore from "../EventTopic/EventTopic.res.mjs";
18
18
  import * as EffectLogger$ReventlessCore from "../../util/EffectLogger.res.mjs";
19
19
  import * as ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
20
+ import * as RuntimeHints$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/RuntimeHints.res.mjs";
20
21
  import * as AutomationSlice$ReventlessCore from "./AutomationSlice.res.mjs";
21
22
  import * as QueryDb_Builder$ReventlessCore from "../QueryDb/QueryDb_Builder.res.mjs";
22
23
  import * as EventCollector_Builder$ReventlessCore from "../EventCollector/EventCollector_Builder.res.mjs";
@@ -48,11 +49,13 @@ function Make(RuntimeEnvironment) {
48
49
  await queryDbOps.save(Id$Reventless.$$String.makeFromString(param[0]), param[1], "Overwrite", undefined);
49
50
  });
50
51
  };
51
- let make = (allEventTopics, publishJsons, context, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(AutomationSlice$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
52
+ let make = (allEventTopics, publishJsons, context, runtime, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(AutomationSlice$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
52
53
  let opts_parent = Component$ReventlessCore.toPulumiResource(extra);
53
54
  let opts = {
54
55
  parent: opts_parent
55
56
  };
57
+ let memorySize = RuntimeHints$ReventlessInfra.resolveMemory(runtime, 1024);
58
+ let timeout = RuntimeHints$ReventlessInfra.resolveTimeout(runtime, 30);
56
59
  let queryDb = SpecificQueryDb.make(Api.api(), Api.apiRole(), undefined, opts);
57
60
  sourceNames.forEach(sourceName => {
58
61
  if (sourceName in allEventTopics) {
@@ -81,7 +84,7 @@ function Make(RuntimeEnvironment) {
81
84
  }));
82
85
  let handler = SpecificEventCollector.makeHandler(ec, jsonEventsHandler);
83
86
  let resources = Component$ReventlessCore.outputs(queryDb).resources;
84
- EventCollectorRuntimeBuilder.forEventCollector(handler, eventTopics, resources, undefined, undefined, ec);
87
+ EventCollectorRuntimeBuilder.forEventCollector(handler, eventTopics, resources, memorySize, timeout, ec);
85
88
  return ec;
86
89
  });
87
90
  Component$ReventlessCore.setOperations(extra, Pulumi.all([
@@ -19,11 +19,16 @@ let createAggregatesWithoutEventMappers = (
19
19
  type a,
20
20
  aggregates: array<module(ReventlessInfra.Aggregate.T with type api = a)>,
21
21
  ~api: a,
22
+ ~componentRuntime: dict<ReventlessInfra.RuntimeHints.t>,
22
23
  opts,
23
24
  ) =>
24
25
  aggregates
25
26
  ->Array.map((module(SpecificAggregate: ReventlessInfra.Aggregate.T with type api = a)) => {
26
- let aggregate = SpecificAggregate.make(~api, ~opts)
27
+ let aggregate = SpecificAggregate.make(
28
+ ~api,
29
+ ~runtime=?componentRuntime->Dict.get(SpecificAggregate.Spec.name),
30
+ ~opts,
31
+ )
27
32
  let aggOutputs = SpecificAggregate.outputs(aggregate)
28
33
  addEventMapperFns->Dict.set(
29
34
  SpecificAggregate.Spec.name,
@@ -112,11 +117,18 @@ let createReadModels = (
112
117
  readModels: array<module(ReventlessInfra.ReadModel.T with type api = a and type role = r)>,
113
118
  ~api: a,
114
119
  ~apiRole: r,
120
+ ~componentRuntime: dict<ReventlessInfra.RuntimeHints.t>,
115
121
  allEventTopics,
116
122
  opts,
117
123
  ) => {
118
124
  let readModels = readModels->Array.map((module(SpecificReadModel: ReventlessInfra.ReadModel.T with type api = a and type role = r)) => {
119
- let readModel = SpecificReadModel.make(~api, ~apiRole, ~allEventTopics, ~opts)
125
+ let readModel = SpecificReadModel.make(
126
+ ~api,
127
+ ~apiRole,
128
+ ~allEventTopics,
129
+ ~runtime=?componentRuntime->Dict.get(SpecificReadModel.Spec.name),
130
+ ~opts,
131
+ )
120
132
  let rmOutputs = SpecificReadModel.outputs(readModel)
121
133
  let rmOperations = SpecificReadModel.operations(readModel)
122
134
  rmOutputs.sourceNames->Array.forEach(sourceName =>
@@ -155,6 +167,7 @@ let createExtensionPoints = (
155
167
  ~scheduler,
156
168
  ~queryEngine,
157
169
  ~resourceNaming,
170
+ ~componentRuntime: dict<ReventlessInfra.RuntimeHints.t>,
158
171
  ~opts,
159
172
  ) => {
160
173
  let triples =
@@ -166,6 +179,7 @@ let createExtensionPoints = (
166
179
  ~scheduler,
167
180
  ~queryEngine,
168
181
  ~resourceNaming,
182
+ ~runtime=?componentRuntime->Dict.get(SpecificExtensionPoint.name),
169
183
  ~opts=Some(opts),
170
184
  )
171
185
  // operations() returns abstract type from ReventlessInfra.ExtensionPoint.T;
@@ -13,9 +13,9 @@ let publishToAggregates = {};
13
13
 
14
14
  let aggregateFinishFns = {};
15
15
 
16
- function createAggregatesWithoutEventMappers(aggregates, api, opts) {
16
+ function createAggregatesWithoutEventMappers(aggregates, api, componentRuntime, opts) {
17
17
  return Object.fromEntries(aggregates.map(SpecificAggregate => {
18
- let aggregate = SpecificAggregate.make(api, opts);
18
+ let aggregate = SpecificAggregate.make(api, componentRuntime[SpecificAggregate.Spec.name], opts);
19
19
  let aggOutputs = SpecificAggregate.outputs(aggregate);
20
20
  addEventMapperFns[SpecificAggregate.Spec.name] = aggOutputs.addEventMapper;
21
21
  let resources = aggOutputs.commandTopic.apply(commandTopic => commandTopic.resources);
@@ -65,9 +65,9 @@ function extractReadModelsOutputs(readModels) {
65
65
  ]));
66
66
  }
67
67
 
68
- function createReadModels(readModels, api, apiRole, allEventTopics, opts) {
68
+ function createReadModels(readModels, api, apiRole, componentRuntime, allEventTopics, opts) {
69
69
  let readModels$1 = readModels.map(SpecificReadModel => {
70
- let readModel = SpecificReadModel.make(api, apiRole, allEventTopics, opts);
70
+ let readModel = SpecificReadModel.make(api, apiRole, allEventTopics, componentRuntime[SpecificReadModel.Spec.name], opts);
71
71
  let rmOutputs = SpecificReadModel.outputs(readModel);
72
72
  let rmOperations = SpecificReadModel.operations(readModel);
73
73
  rmOutputs.sourceNames.forEach(sourceName => {
@@ -92,9 +92,9 @@ function createReadModels(readModels, api, apiRole, allEventTopics, opts) {
92
92
  return extractReadModelsOutputs(readModels$1);
93
93
  }
94
94
 
95
- function createExtensionPoints(extensionPoints, aggregateResources, publishToAggregates, scheduler, queryEngine, resourceNaming, opts) {
95
+ function createExtensionPoints(extensionPoints, aggregateResources, publishToAggregates, scheduler, queryEngine, resourceNaming, componentRuntime, opts) {
96
96
  let triples = extensionPoints.map(SpecificExtensionPoint => {
97
- let extensionPoint = SpecificExtensionPoint.make(aggregateResources, publishToAggregates, scheduler, queryEngine, resourceNaming, opts);
97
+ let extensionPoint = SpecificExtensionPoint.make(aggregateResources, publishToAggregates, scheduler, queryEngine, resourceNaming, componentRuntime[SpecificExtensionPoint.name], opts);
98
98
  let ops = SpecificExtensionPoint.operations(extensionPoint);
99
99
  let outputs = SpecificExtensionPoint.outputs(extensionPoint);
100
100
  let registryInfo_specModule = outputs.specModule;
@@ -96,6 +96,9 @@ module Make = (
96
96
  // (machine credentials — IAM/SigV4 on AWS) must invoke — sets
97
97
  // `systemCallable` on the matching mutation / state-view query schema entries.
98
98
  ~systemCallableComponents: array<string>=[],
99
+ // Per-component runtime hints keyed by slice `Spec.name`; forwarded into each
100
+ // slice's `make`. Empty for admin/legacy callers.
101
+ ~componentRuntime: dict<ReventlessInfra.RuntimeHints.t>=Dict.make(),
99
102
  ~pluginStructure: option<Reventless.Plugin.pluginStructure>=?,
100
103
  ~opts: Pulumi.ComponentResource.options,
101
104
  ): dcbResult => {
@@ -389,6 +392,7 @@ module Make = (
389
392
  ~publishJsons,
390
393
  ~tagKeysByEventType=effectiveTagKeysByEventType,
391
394
  ~crossPartitionTagKeys=effectiveCrossPartitionTagKeys,
395
+ ~runtime=?componentRuntime->Dict.get(StateChangeSlice.Spec.name),
392
396
  ~opts,
393
397
  )
394
398
  (StateChangeSlice.Spec.name, ch->Component.outputs)
@@ -409,6 +413,7 @@ module Make = (
409
413
  ~publishJsons=asyncPublishJsons,
410
414
  ~tagKeysByEventType=effectiveTagKeysByEventType,
411
415
  ~crossPartitionTagKeys=effectiveCrossPartitionTagKeys,
416
+ ~runtime=?componentRuntime->Dict.get(StateChangeSlice.Spec.name),
412
417
  ~opts,
413
418
  )
414
419
  (StateChangeSlice.Spec.name, ch->Component.outputs)
@@ -571,7 +576,11 @@ module Make = (
571
576
  let stateViewSlicesOutputs =
572
577
  stateViewSlices
573
578
  ->Array.map((module(StateViewSlice: StateViewSlice.T)) => {
574
- let sv = StateViewSlice.make(~dcbEventLog, ~opts)
579
+ let sv = StateViewSlice.make(
580
+ ~dcbEventLog,
581
+ ~runtime=?componentRuntime->Dict.get(StateViewSlice.Spec.name),
582
+ ~opts,
583
+ )
575
584
  (StateViewSlice.Spec.name, sv->Component.outputs)
576
585
  })
577
586
  ->Dict.fromArray
@@ -595,7 +604,13 @@ module Make = (
595
604
  pluginName: name,
596
605
  sliceName: AutoSlice.Spec.name,
597
606
  }
598
- let as_ = AutoSlice.make(~allEventTopics, ~publishJsons, ~context, ~opts)
607
+ let as_ = AutoSlice.make(
608
+ ~allEventTopics,
609
+ ~publishJsons,
610
+ ~context,
611
+ ~runtime=?componentRuntime->Dict.get(AutoSlice.Spec.name),
612
+ ~opts,
613
+ )
599
614
  (AutoSlice.Spec.name, as_->Component.outputs)
600
615
  })
601
616
  ->Dict.fromArray
@@ -604,7 +619,12 @@ module Make = (
604
619
  let outboundTranslationSlicesOutputs =
605
620
  outboundTranslationSlices
606
621
  ->Array.map((module(OTS: OutboundTranslationSlice.T)) => {
607
- let ots = OTS.make(~dcbEventLog, ~publishJsons, ~opts)
622
+ let ots = OTS.make(
623
+ ~dcbEventLog,
624
+ ~publishJsons,
625
+ ~runtime=?componentRuntime->Dict.get(OTS.Spec.name),
626
+ ~opts,
627
+ )
608
628
  (OTS.Spec.name, ots->Component.outputs)
609
629
  })
610
630
  ->Dict.fromArray
@@ -614,7 +634,11 @@ module Make = (
614
634
  inboundTranslationSlices->Array.map((
615
635
  module(ITS: InboundTranslationSlice.T),
616
636
  ) => {
617
- let its = ITS.make(~publishJsons, ~opts)
637
+ let its = ITS.make(
638
+ ~publishJsons,
639
+ ~runtime=?componentRuntime->Dict.get(ITS.Spec.name),
640
+ ~opts,
641
+ )
618
642
  let fieldName = Api_Naming.sliceMutationField(~plugin=name, ~slice=ITS.Spec.name)
619
643
 
620
644
  switch HooksConfig.hooks.inboundMutationResolverHook {
@@ -789,10 +813,26 @@ module Make = (
789
813
  hook(dcbEventLog->Obj.magic)
790
814
  )
791
815
 
816
+ // Per-component runtime overrides (plugin.json `runtime`) for the
817
+ // StateChangeSlices hosted on each shared DCB command Lambda. Only
818
+ // explicit overrides contribute (default 0); the platform folds them
819
+ // with the per-flavor commandHandlerConfig floor. Sync slices land on
820
+ // `<Plugin>DcbCmdHandler`, async on `<Plugin>DcbAsyncCmdHandler`.
821
+ let sliceMemoryFloor = slices =>
822
+ slices->Array.reduce(0, (acc, module(M: StateChangeSlice.T)) =>
823
+ Math.Int.max(acc, ReventlessInfra.RuntimeHints.resolveMemory(componentRuntime->Dict.get(M.Spec.name), ~default=0))
824
+ )
825
+ let sliceTimeoutFloor = slices =>
826
+ slices->Array.reduce(0, (acc, module(M: StateChangeSlice.T)) =>
827
+ Math.Int.max(acc, ReventlessInfra.RuntimeHints.resolveTimeout(componentRuntime->Dict.get(M.Spec.name), ~default=0))
828
+ )
829
+
792
830
  let dcbRuntimeSetup = () => {
793
831
  dcbCommandTopic->RuntimeBuilder.forDcbCommandTopic(
794
832
  ~handler=dcbHandler,
795
833
  ~connect=dcbConnectFn,
834
+ ~memorySize=sliceMemoryFloor(syncSlices),
835
+ ~timeout=sliceTimeoutFloor(syncSlices),
796
836
  )
797
837
  // Set up async CommandTopic Lambda if any async slices are configured
798
838
  asyncDcbCommandTopicOpt->Option.forEach(asyncDcbCommandTopic => {
@@ -806,6 +846,8 @@ module Make = (
806
846
  asyncDcbCommandTopic->RuntimeBuilder.forDcbCommandTopic(
807
847
  ~handler=asyncDcbHandler->Obj.magic,
808
848
  ~connect=asyncDcbConnectFn,
849
+ ~memorySize=sliceMemoryFloor(asyncSlices),
850
+ ~timeout=sliceTimeoutFloor(asyncSlices),
809
851
  )
810
852
  })
811
853
  }