ark-runtime-kernel 1.4.0 → 1.6.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.
@@ -1,5 +1,5 @@
1
1
  import { DynamicModule, InjectionToken, OptionalFactoryDependency } from '@nestjs/common';
2
- import { Q as ArkKernel, N as CreateArkKernelOptions } from '../types-7K_KQCgS.cjs';
2
+ import { Q as ArkKernel, N as CreateArkKernelOptions } from '../types-Dr307WEm.cjs';
3
3
 
4
4
  /** Injection token for the Ark kernel instance. */
5
5
  declare const ARK_KERNEL: unique symbol;
@@ -1,5 +1,5 @@
1
1
  import { DynamicModule, InjectionToken, OptionalFactoryDependency } from '@nestjs/common';
2
- import { Q as ArkKernel, N as CreateArkKernelOptions } from '../types-7K_KQCgS.js';
2
+ import { Q as ArkKernel, N as CreateArkKernelOptions } from '../types-Dr307WEm.js';
3
3
 
4
4
  /** Injection token for the Ark kernel instance. */
5
5
  declare const ARK_KERNEL: unique symbol;
@@ -1525,7 +1525,7 @@ function createArchitectureProfile(options) {
1525
1525
  layers,
1526
1526
  rules,
1527
1527
  resolveLayer(name) {
1528
- return sortedLayers.find(
1528
+ return layers.find((layer) => layer.match?.(name))?.name ?? sortedLayers.find(
1529
1529
  (layer) => layer.prefixes.some((prefix) => name.startsWith(prefix))
1530
1530
  )?.name;
1531
1531
  }
@@ -1619,7 +1619,7 @@ var elevenLayerProfile = createArchitectureProfile({
1619
1619
  var MANIFEST_SCHEMA_VERSION = "1.0";
1620
1620
 
1621
1621
  // src/version.ts
1622
- var version = "1.4.0";
1622
+ var version = "1.6.0";
1623
1623
 
1624
1624
  // src/kernel/manifest/createArkManifest.ts
1625
1625
  function policyId(name) {
@@ -2175,6 +2175,7 @@ function createWorkflowEngine(bus, options) {
2175
2175
  }
2176
2176
 
2177
2177
  // src/kernel/runtime/createArkKernel.ts
2178
+ var DEFAULT_MAX_HISTORY_SIZE = 1e3;
2178
2179
  var kernelSequence = 0;
2179
2180
  function nextKernelInstanceId() {
2180
2181
  kernelSequence += 1;
@@ -2184,10 +2185,11 @@ function createArkKernel(options = {}) {
2184
2185
  const strict = options.strict ?? true;
2185
2186
  const instanceId = options.instanceId ?? nextKernelInstanceId();
2186
2187
  const profile = options.profile ?? elevenLayerProfile;
2188
+ const maxHistorySize = options.maxHistorySize ?? DEFAULT_MAX_HISTORY_SIZE;
2187
2189
  const registry = createIntentRegistry();
2188
2190
  const graph = createDependencyGraph();
2189
2191
  const metadata = options.metadata ?? createMetadataRegistry();
2190
- const auditTrail = options.auditTrail ?? createAuditTrail({ maxRecords: options.maxHistorySize });
2192
+ const auditTrail = options.auditTrail ?? createAuditTrail({ maxRecords: maxHistorySize });
2191
2193
  const eventContracts = options.eventContracts ?? createEventContractRegistry();
2192
2194
  const outbox = options.outbox ?? new InMemoryOutboxStore();
2193
2195
  const projections = options.projections ?? createProjectionRegistry({ auditTrail });
@@ -2212,7 +2214,7 @@ function createArkKernel(options = {}) {
2212
2214
  enforceObservedLayerFlow: options.enforceObservedLayerFlow ?? (strict ? "hard" : "off"),
2213
2215
  outbox,
2214
2216
  instanceId,
2215
- maxHistorySize: options.maxHistorySize,
2217
+ maxHistorySize,
2216
2218
  onPublish: options.autoApplyProjections === false ? void 0 : async (event) => {
2217
2219
  await projections.apply(event);
2218
2220
  }