@xemahq/temporal-runtime 0.6.0 → 0.7.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 (98) hide show
  1. package/README.md +154 -11
  2. package/dist/bin/controller-token-publisher.d.ts +3 -0
  3. package/dist/bin/controller-token-publisher.d.ts.map +1 -0
  4. package/dist/bin/controller-token-publisher.js +18 -0
  5. package/dist/bin/controller-token-publisher.js.map +1 -0
  6. package/dist/index.d.ts +11 -0
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +11 -0
  9. package/dist/index.js.map +1 -1
  10. package/dist/lib/access-token.d.ts +11 -0
  11. package/dist/lib/access-token.d.ts.map +1 -0
  12. package/dist/lib/access-token.js +30 -0
  13. package/dist/lib/access-token.js.map +1 -0
  14. package/dist/lib/base-temporal-client.service.d.ts +3 -2
  15. package/dist/lib/base-temporal-client.service.d.ts.map +1 -1
  16. package/dist/lib/base-temporal-client.service.js +5 -5
  17. package/dist/lib/base-temporal-client.service.js.map +1 -1
  18. package/dist/lib/biome-worker.d.ts +83 -0
  19. package/dist/lib/biome-worker.d.ts.map +1 -0
  20. package/dist/lib/biome-worker.js +253 -0
  21. package/dist/lib/biome-worker.js.map +1 -0
  22. package/dist/lib/bounded-retry.d.ts +22 -0
  23. package/dist/lib/bounded-retry.d.ts.map +1 -0
  24. package/dist/lib/bounded-retry.js +67 -0
  25. package/dist/lib/bounded-retry.js.map +1 -0
  26. package/dist/lib/client-credentials-token-source.d.ts +23 -0
  27. package/dist/lib/client-credentials-token-source.d.ts.map +1 -0
  28. package/dist/lib/client-credentials-token-source.js +108 -0
  29. package/dist/lib/client-credentials-token-source.js.map +1 -0
  30. package/dist/lib/connection.d.ts +48 -9
  31. package/dist/lib/connection.d.ts.map +1 -1
  32. package/dist/lib/connection.js +153 -41
  33. package/dist/lib/connection.js.map +1 -1
  34. package/dist/lib/controller-token-publisher.d.ts +51 -0
  35. package/dist/lib/controller-token-publisher.d.ts.map +1 -0
  36. package/dist/lib/controller-token-publisher.js +116 -0
  37. package/dist/lib/controller-token-publisher.js.map +1 -0
  38. package/dist/lib/fairness-constants.d.ts +3 -0
  39. package/dist/lib/fairness-constants.d.ts.map +1 -0
  40. package/dist/lib/fairness-constants.js +6 -0
  41. package/dist/lib/fairness-constants.js.map +1 -0
  42. package/dist/lib/fairness.d.ts +13 -0
  43. package/dist/lib/fairness.d.ts.map +1 -0
  44. package/dist/lib/fairness.js +56 -0
  45. package/dist/lib/fairness.js.map +1 -0
  46. package/dist/lib/org-erasure.d.ts +13 -0
  47. package/dist/lib/org-erasure.d.ts.map +1 -0
  48. package/dist/lib/org-erasure.js +68 -0
  49. package/dist/lib/org-erasure.js.map +1 -0
  50. package/dist/lib/proactive-token-refresher.d.ts +47 -0
  51. package/dist/lib/proactive-token-refresher.d.ts.map +1 -0
  52. package/dist/lib/proactive-token-refresher.js +147 -0
  53. package/dist/lib/proactive-token-refresher.js.map +1 -0
  54. package/dist/lib/search-attribute-constants.d.ts +3 -0
  55. package/dist/lib/search-attribute-constants.d.ts.map +1 -0
  56. package/dist/lib/search-attribute-constants.js +6 -0
  57. package/dist/lib/search-attribute-constants.js.map +1 -0
  58. package/dist/lib/search-attributes.d.ts +4 -18
  59. package/dist/lib/search-attributes.d.ts.map +1 -1
  60. package/dist/lib/search-attributes.js +33 -40
  61. package/dist/lib/search-attributes.js.map +1 -1
  62. package/dist/lib/standalone-activity.d.ts +23 -0
  63. package/dist/lib/standalone-activity.d.ts.map +1 -0
  64. package/dist/lib/standalone-activity.js +48 -0
  65. package/dist/lib/standalone-activity.js.map +1 -0
  66. package/dist/lib/versioned-worker.d.ts +26 -0
  67. package/dist/lib/versioned-worker.d.ts.map +1 -0
  68. package/dist/lib/versioned-worker.js +60 -0
  69. package/dist/lib/versioned-worker.js.map +1 -0
  70. package/dist/lib/worker-deployment-version.d.ts +8 -0
  71. package/dist/lib/worker-deployment-version.d.ts.map +1 -0
  72. package/dist/lib/worker-deployment-version.js +45 -0
  73. package/dist/lib/worker-deployment-version.js.map +1 -0
  74. package/dist/lib/worker.d.ts +7 -7
  75. package/dist/lib/worker.d.ts.map +1 -1
  76. package/dist/lib/worker.js +33 -37
  77. package/dist/lib/worker.js.map +1 -1
  78. package/dist/lib/workflow-interceptors/fairness-guard.d.ts +4 -0
  79. package/dist/lib/workflow-interceptors/fairness-guard.d.ts.map +1 -0
  80. package/dist/lib/workflow-interceptors/fairness-guard.js +65 -0
  81. package/dist/lib/workflow-interceptors/fairness-guard.js.map +1 -0
  82. package/dist/lib/workflow-interceptors/fairness-propagation.d.ts +3 -0
  83. package/dist/lib/workflow-interceptors/fairness-propagation.d.ts.map +1 -0
  84. package/dist/lib/workflow-interceptors/fairness-propagation.js +6 -0
  85. package/dist/lib/workflow-interceptors/fairness-propagation.js.map +1 -0
  86. package/dist/lib/workflow-interceptors/org-fairness-required.d.ts +3 -0
  87. package/dist/lib/workflow-interceptors/org-fairness-required.d.ts.map +1 -0
  88. package/dist/lib/workflow-interceptors/org-fairness-required.js +6 -0
  89. package/dist/lib/workflow-interceptors/org-fairness-required.js.map +1 -0
  90. package/dist/lib/workflow-interceptors/org-search-attribute.d.ts +3 -0
  91. package/dist/lib/workflow-interceptors/org-search-attribute.d.ts.map +1 -0
  92. package/dist/lib/workflow-interceptors/org-search-attribute.js +49 -0
  93. package/dist/lib/workflow-interceptors/org-search-attribute.js.map +1 -0
  94. package/dist/lib/workflow-purity.d.ts +27 -0
  95. package/dist/lib/workflow-purity.d.ts.map +1 -0
  96. package/dist/lib/workflow-purity.js +115 -0
  97. package/dist/lib/workflow-purity.js.map +1 -0
  98. package/package.json +21 -10
package/README.md CHANGED
@@ -28,16 +28,17 @@
28
28
 
29
29
  ## Overview
30
30
 
31
- Shared runtime glue for services that run Temporal workflow workers or start
32
- workflows. It provides one battle-tested setup so services do not drift:
33
- connection handling, an on-behalf-of activity-auth context, a worker factory
34
- that wires the interceptor and payload codec, an authenticated service HTTP
35
- client for activities, idempotent schedule reconciliation, and a closed set of
36
- visibility search attributes.
31
+ Shared runtime glue for services that run Temporal workers or start
32
+ workflows: connection handling, an on-behalf-of activity-auth context, biome
33
+ worker components on Worker Deployment versioning, org fairness, Standalone
34
+ Activities, an authenticated service HTTP client for activities, idempotent
35
+ schedule reconciliation, and a closed set of visibility search attributes.
37
36
 
38
37
  ## When to use it
39
38
 
40
- - Use it in any service that runs a Temporal worker or starts a workflow.
39
+ - A biome ships a `kind: worker` component and needs to run its workflows,
40
+ activities or Nexus handlers.
41
+ - A service starts a workflow or a one-shot durable activity for an org.
41
42
 
42
43
  ## Installation
43
44
 
@@ -47,17 +48,159 @@ pnpm add @xemahq/temporal-runtime
47
48
 
48
49
  ## Usage
49
50
 
51
+ ### A biome worker component
52
+
53
+ Define the component from its manifest's worker protocol (revision `v2`), then
54
+ compose one or more definitions into a process. The process connects once,
55
+ derives its namespace from the deployment id and trust domain, and polls every
56
+ declared task queue (`<biomeId>:<name>`) with a versioned worker.
57
+
58
+ ```ts
59
+ import {
60
+ composeBiomeWorkers,
61
+ defineBiomeWorker,
62
+ resolveWorkerDeploymentVersionFromEnv,
63
+ } from '@xemahq/temporal-runtime';
64
+
65
+ const translation = defineBiomeWorker({
66
+ biomeId: 'pai-core',
67
+ componentKey: 'translation-worker',
68
+ origin: BiomeOrigin.FirstParty,
69
+ protocol: manifest.components[i].protocol, // as declared, parsed here
70
+ workflowsPath: require.resolve('./workflows'),
71
+ activities,
72
+ nexusServices: [{ service: 'agent-session', version: 'v1', handler }],
73
+ });
74
+
75
+ const process = await composeBiomeWorkers({
76
+ connection, // a NativeConnection you own
77
+ deploymentId: env('XEMA_DEPLOYMENT_ID'),
78
+ version: resolveWorkerDeploymentVersionFromEnv(env),
79
+ definitions: [translation],
80
+ });
81
+ await process.run(); // process.shutdown() on SIGTERM
82
+ ```
83
+
84
+ The implementations must match the manifest: `workflowsPath` iff a queue
85
+ serves `workflows`, `activities` iff a queue serves `activities`, and exactly
86
+ one handler per `nexus.provides` entry. A mismatch, mixed trust domains, or a
87
+ task queue polled twice refuses at boot with a `BiomeWorkerError`.
88
+
89
+ ### Versioning
90
+
91
+ Every worker polls as one Worker Deployment version, and every workflow it
92
+ starts is PINNED to that version. In a cluster the version comes from the
93
+ Temporal Worker Controller (`TEMPORAL_DEPLOYMENT_NAME`,
94
+ `TEMPORAL_WORKER_BUILD_ID`); there is no default and no unversioned mode. So a
95
+ run started on an old version finishes there, new runs go to the current
96
+ version, and an old version drains only when its pinned runs end. Biomes
97
+ composed into one process share that process's version; a biome that releases
98
+ on its own cadence runs in its own process.
99
+
100
+ ### Org fairness
101
+
102
+ ```ts
103
+ await startWorkflowForOrg(client, 'translationWorkflow', {
104
+ orgId, taskQueue, workflowId, args: [input],
105
+ });
106
+ ```
107
+
108
+ The org id is the fairness key. The run's activities and child workflows carry
109
+ it, scheduling work under a different key fails the run, and a
110
+ `fairness: 'org'` queue refuses work that arrives without one. Nexus
111
+ operations do not carry a priority in SDK 1.24, so a Nexus handler sets the
112
+ fairness key of the work it starts from the caller's org.
113
+
114
+ ### Standalone Activities
115
+
116
+ ```ts
117
+ await startStandaloneActivity(client, {
118
+ id: `outbox:${table}:${rowId}`,
119
+ type: 'relayOutboxRow',
120
+ taskQueue,
121
+ orgId, // or null: stated, never omitted
122
+ idConflict: StandaloneActivityIdConflict.UseExisting,
123
+ startToCloseTimeout: '1m',
124
+ });
125
+ ```
126
+
127
+ ### Search attributes and org erasure
128
+
129
+ A deployment namespace declares ONE custom search attribute, `OrgId` (Keyword),
130
+ and the shared-infra provisioning Job declares it, not a workload: adding
131
+ search attributes is an admin call the workload role cannot make. At boot a
132
+ starter calls `verifyPlatformSearchAttributes(connection, namespace)`, which
133
+ reads the namespace and refuses to boot, naming what is missing.
134
+
135
+ Every org-scoped run carries `OrgId`. `startWorkflowForOrg` sets it, and so does
136
+ `buildPlatformSearchAttributes({ orgId })`; a child workflow inherits it from its
137
+ parent, since every bundle compiles in the propagation interceptor. Org erasure
138
+ then deletes that org's executions from the shared namespace:
139
+
50
140
  ```ts
51
- import { createPlatformWorker } from '@xemahq/temporal-runtime';
141
+ await eraseOrgWorkflowExecutions(client, { orgId, reason: 'org erased' });
142
+ ```
143
+
144
+ Running executions are terminated, then every one is deleted. Other orgs'
145
+ executions, and cluster-wide runs with no `OrgId`, are untouched. If the
146
+ erasure does not finish before its deadline, the call throws.
52
147
 
53
- const worker = await createPlatformWorker(workerOptions);
54
- await worker.run();
148
+ ### Connecting
149
+
150
+ Every worker and client connects to the frontend over TLS, verified against the
151
+ server CA, with a JWT bearer from the infra realm. There is no plaintext or
152
+ unauthenticated mode. The bearer comes from OAuth client-credentials for the
153
+ process's workload trust identity, and it is replaced before it expires.
154
+
155
+ ```ts
156
+ import {
157
+ connectTemporalClient,
158
+ connectTemporalWorker,
159
+ temporalConnectionOptionsFromEnv,
160
+ } from '@xemahq/temporal-runtime';
161
+
162
+ const options = temporalConnectionOptionsFromEnv((name) => config.get(name));
163
+ const worker = await connectTemporalWorker(options);
164
+ const client = await connectTemporalClient(options);
165
+ // worker.connection / client.connection go to the SDK; close() stops refreshing.
55
166
  ```
56
167
 
168
+ `temporalConnectionOptionsFromEnv` takes an injected reader and reads
169
+ `TEMPORAL_ADDRESS`, `TEMPORAL_TLS_CA_PATH`, `TEMPORAL_AUTH_TOKEN_ENDPOINT`,
170
+ `TEMPORAL_AUTH_CLIENT_ID`, `TEMPORAL_AUTH_CLIENT_SECRET_FILE` and
171
+ `TEMPORAL_AUTH_AUDIENCE` (all required). It also reads
172
+ `TEMPORAL_TLS_SERVER_NAME` and the `TEMPORAL_TLS_CLIENT_CERT_PATH` /
173
+ `TEMPORAL_TLS_CLIENT_KEY_PATH` pair, which are optional.
174
+
175
+ ### Keeping any client-credentials token current
176
+
177
+ `ProactiveTokenRefresher` is the one refresh mechanism. The connections use it,
178
+ and so can any other holder of an infra-realm token:
179
+
180
+ ```ts
181
+ const tokens = await ProactiveTokenRefresher.start({
182
+ source: createClientCredentialsTokenSource(temporalClientCredentialsFromEnv(env)),
183
+ description: 'controller client',
184
+ });
185
+ await tokens.subscribe((token) => writeSecret(token.value));
186
+ ```
187
+
188
+ It refreshes at 75% of the issuer's lifetime and retries with backoff while the
189
+ current token is still valid. If the token expires with no replacement, it
190
+ crashes the process (or calls the `onFatal` you pass instead).
191
+
192
+ ### Tests
193
+
194
+ `pnpm test` runs the unit suite. `pnpm test:integration` starts one Temporal
195
+ 1.32 server per run, in Docker, with frontend TLS and the JWT authorizer, and
196
+ runs the connection suite against it.
197
+
57
198
  ## Peer requirements
58
199
 
59
- - `@nestjs/common` ^10 || ^11
200
+ - `@nestjs/common` ^11
60
201
  - `reflect-metadata` ^0.2
202
+ - `@xemahq/contracts` >=0.52.0
203
+ - `@xemahq/identity-client` >=0.9.0
61
204
 
62
205
  ## License
63
206
 
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=controller-token-publisher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller-token-publisher.d.ts","sourceRoot":"","sources":["../../src/bin/controller-token-publisher.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const controller_token_publisher_1 = require("../lib/controller-token-publisher");
5
+ const logger = {
6
+ log: (message) => {
7
+ process.stdout.write(`${message}\n`);
8
+ },
9
+ warn: (message) => console.warn(message),
10
+ error: (message) => console.error(message),
11
+ };
12
+ async function main() {
13
+ const options = await (0, controller_token_publisher_1.controllerTokenPublisherOptionsFromEnv)((name) => process.env[name]);
14
+ await (0, controller_token_publisher_1.startControllerTokenPublisher)(options, { logger });
15
+ logger.log(`Worker Controller token publisher: ${options.clientId} → ${options.target.namespace}/${options.target.secretName}#${options.target.secretKey}`);
16
+ }
17
+ void main();
18
+ //# sourceMappingURL=controller-token-publisher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller-token-publisher.js","sourceRoot":"","sources":["../../src/bin/controller-token-publisher.ts"],"names":[],"mappings":";;;AAUA,kFAG2C;AAE3C,MAAM,MAAM,GAAG;IACb,GAAG,EAAE,CAAC,OAAe,EAAE,EAAE;QACvB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;IAChD,KAAK,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;CACnD,CAAC;AAEF,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAG,MAAM,IAAA,mEAAsC,EAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1F,MAAM,IAAA,0DAA6B,EAAC,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACzD,MAAM,CAAC,GAAG,CAAC,sCAAsC,OAAO,CAAC,QAAQ,MAAM,OAAO,CAAC,MAAM,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;AAC9J,CAAC;AAKD,KAAK,IAAI,EAAE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,12 +1,23 @@
1
1
  export * from './lib/connection';
2
+ export * from './lib/controller-token-publisher';
3
+ export * from './lib/access-token';
4
+ export * from './lib/bounded-retry';
5
+ export * from './lib/client-credentials-token-source';
6
+ export * from './lib/proactive-token-refresher';
2
7
  export * from './lib/namespace';
3
8
  export * from './lib/base-temporal-client.service';
4
9
  export * from './lib/activity-auth-context';
5
10
  export * from './lib/on-behalf-of-interceptor';
6
11
  export * from './lib/worker';
12
+ export * from './lib/workflow-purity';
13
+ export * from './lib/worker-deployment-version';
14
+ export * from './lib/biome-worker';
15
+ export * from './lib/fairness';
16
+ export * from './lib/standalone-activity';
7
17
  export * from './lib/auth-kind';
8
18
  export * from './lib/service-http-client';
9
19
  export * from './lib/schedule';
10
20
  export * from './lib/search-attributes';
21
+ export * from './lib/org-erasure';
11
22
  export * from './lib/temporal-sdk';
12
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAwBA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAyCA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kCAAkC,CAAC;AACjD,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iBAAiB,CAAC;AAChC,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -15,14 +15,25 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./lib/connection"), exports);
18
+ __exportStar(require("./lib/controller-token-publisher"), exports);
19
+ __exportStar(require("./lib/access-token"), exports);
20
+ __exportStar(require("./lib/bounded-retry"), exports);
21
+ __exportStar(require("./lib/client-credentials-token-source"), exports);
22
+ __exportStar(require("./lib/proactive-token-refresher"), exports);
18
23
  __exportStar(require("./lib/namespace"), exports);
19
24
  __exportStar(require("./lib/base-temporal-client.service"), exports);
20
25
  __exportStar(require("./lib/activity-auth-context"), exports);
21
26
  __exportStar(require("./lib/on-behalf-of-interceptor"), exports);
22
27
  __exportStar(require("./lib/worker"), exports);
28
+ __exportStar(require("./lib/workflow-purity"), exports);
29
+ __exportStar(require("./lib/worker-deployment-version"), exports);
30
+ __exportStar(require("./lib/biome-worker"), exports);
31
+ __exportStar(require("./lib/fairness"), exports);
32
+ __exportStar(require("./lib/standalone-activity"), exports);
23
33
  __exportStar(require("./lib/auth-kind"), exports);
24
34
  __exportStar(require("./lib/service-http-client"), exports);
25
35
  __exportStar(require("./lib/schedule"), exports);
26
36
  __exportStar(require("./lib/search-attributes"), exports);
37
+ __exportStar(require("./lib/org-erasure"), exports);
27
38
  __exportStar(require("./lib/temporal-sdk"), exports);
28
39
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAwBA,mDAAiC;AACjC,kDAAgC;AAChC,qEAAmD;AACnD,8DAA4C;AAC5C,iEAA+C;AAC/C,+CAA6B;AAC7B,kDAAgC;AAChC,4DAA0C;AAC1C,iDAA+B;AAC/B,0DAAwC;AACxC,qDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAyCA,mDAAiC;AACjC,mEAAiD;AACjD,qDAAmC;AACnC,sDAAoC;AACpC,wEAAsD;AACtD,kEAAgD;AAChD,kDAAgC;AAChC,qEAAmD;AACnD,8DAA4C;AAC5C,iEAA+C;AAC/C,+CAA6B;AAC7B,wDAAsC;AACtC,kEAAgD;AAChD,qDAAmC;AACnC,iDAA+B;AAC/B,4DAA0C;AAC1C,kDAAgC;AAChC,4DAA0C;AAC1C,iDAA+B;AAC/B,0DAAwC;AACxC,oDAAkC;AAClC,qDAAmC"}
@@ -0,0 +1,11 @@
1
+ export interface AccessToken {
2
+ readonly value: string;
3
+ readonly expiresAt: number;
4
+ }
5
+ export type AccessTokenSource = () => Promise<AccessToken>;
6
+ export interface AccessTokenClaims {
7
+ readonly aud: readonly string[];
8
+ readonly exp: number | undefined;
9
+ }
10
+ export declare function decodeAccessTokenClaims(token: string): AccessTokenClaims;
11
+ //# sourceMappingURL=access-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-token.d.ts","sourceRoot":"","sources":["../../src/lib/access-token.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAQD,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;AAG3D,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAQD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAyBxE"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decodeAccessTokenClaims = decodeAccessTokenClaims;
4
+ function decodeAccessTokenClaims(token) {
5
+ const parts = token.split('.');
6
+ const payloadSegment = parts[1];
7
+ if (parts.length !== 3 || payloadSegment === undefined) {
8
+ throw new Error('Temporal access token is not a JWT (expected three dot-separated segments).');
9
+ }
10
+ let payload;
11
+ try {
12
+ payload = JSON.parse(Buffer.from(payloadSegment, 'base64url').toString('utf8'));
13
+ }
14
+ catch (cause) {
15
+ throw new Error('Temporal access token payload is not valid base64url JSON.', { cause });
16
+ }
17
+ if (typeof payload !== 'object' || payload === null) {
18
+ throw new Error('Temporal access token payload is not a JSON object.');
19
+ }
20
+ const record = payload;
21
+ const rawAud = record['aud'];
22
+ const aud = typeof rawAud === 'string'
23
+ ? [rawAud]
24
+ : Array.isArray(rawAud)
25
+ ? rawAud.filter((entry) => typeof entry === 'string')
26
+ : [];
27
+ const rawExp = record['exp'];
28
+ return { aud, exp: typeof rawExp === 'number' ? rawExp : undefined };
29
+ }
30
+ //# sourceMappingURL=access-token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-token.js","sourceRoot":"","sources":["../../src/lib/access-token.ts"],"names":[],"mappings":";;AAgCA,0DAyBC;AAzBD,SAAgB,uBAAuB,CAAC,KAAa;IACnD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/B,MAAM,cAAc,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAChC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC;IACjG,CAAC;IACD,IAAI,OAAgB,CAAC;IACrB,IAAI,CAAC;QACH,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAClF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,4DAA4D,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3F,CAAC;IACD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IACD,MAAM,MAAM,GAAG,OAAkC,CAAC;IAClD,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,MAAM,GAAG,GACP,OAAO,MAAM,KAAK,QAAQ;QACxB,CAAC,CAAC,CAAC,MAAM,CAAC;QACV,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YACrB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC;YACtE,CAAC,CAAC,EAAE,CAAC;IACX,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AACvE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { Logger, type OnApplicationBootstrap, type OnModuleDestroy } from '@nestjs/common';
2
- import { type TemporalConnectionOptions } from './connection';
2
+ import { type TemporalConnectionDeps, type TemporalConnectionOptions } from './connection';
3
3
  import { Client, Connection, type ClientOptions } from './temporal-sdk';
4
4
  export declare abstract class BaseTemporalClientService implements OnApplicationBootstrap, OnModuleDestroy {
5
5
  protected readonly logger: Logger;
@@ -7,7 +7,8 @@ export declare abstract class BaseTemporalClientService implements OnApplication
7
7
  private client;
8
8
  private resolvedNamespace;
9
9
  protected abstract resolveNamespace(): string;
10
- protected resolveConnectionOptions(): TemporalConnectionOptions;
10
+ protected abstract resolveConnectionOptions(): TemporalConnectionOptions;
11
+ protected resolveConnectionDeps(): TemporalConnectionDeps;
11
12
  protected resolveClientOptions(): Omit<ClientOptions, 'connection' | 'namespace'> | undefined;
12
13
  onApplicationBootstrap(): Promise<void>;
13
14
  onModuleDestroy(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"base-temporal-client.service.d.ts","sourceRoot":"","sources":["../../src/lib/base-temporal-client.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EACN,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA6CxE,8BACsB,yBACpB,YAAW,sBAAsB,EAAE,eAAe;IAElD,SAAS,CAAC,QAAQ,CAAC,MAAM,SAAqC;IAE9D,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,iBAAiB,CAAuB;IAMhD,SAAS,CAAC,QAAQ,CAAC,gBAAgB,IAAI,MAAM;IAO7C,SAAS,CAAC,wBAAwB,IAAI,yBAAyB;IAS/D,SAAS,CAAC,oBAAoB,IAC1B,IAAI,CAAC,aAAa,EAAE,YAAY,GAAG,WAAW,CAAC,GAC/C,SAAS;IAIP,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAcvC,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IActC,SAAS,CAAC,SAAS,IAAI,MAAM;IAW7B,SAAS,CAAC,aAAa,IAAI,UAAU;IAWrC,SAAS,CAAC,YAAY,IAAI,MAAM;CASjC"}
1
+ {"version":3,"file":"base-temporal-client.service.d.ts","sourceRoot":"","sources":["../../src/lib/base-temporal-client.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EACN,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC/B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAqDxE,8BACsB,yBACpB,YAAW,sBAAsB,EAAE,eAAe;IAElD,SAAS,CAAC,QAAQ,CAAC,MAAM,SAAqC;IAE9D,OAAO,CAAC,UAAU,CAAyC;IAC3D,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,iBAAiB,CAAuB;IAMhD,SAAS,CAAC,QAAQ,CAAC,gBAAgB,IAAI,MAAM;IAO7C,SAAS,CAAC,QAAQ,CAAC,wBAAwB,IAAI,yBAAyB;IAOxE,SAAS,CAAC,qBAAqB,IAAI,sBAAsB;IASzD,SAAS,CAAC,oBAAoB,IAC1B,IAAI,CAAC,aAAa,EAAE,YAAY,GAAG,WAAW,CAAC,GAC/C,SAAS;IAIP,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAevC,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IActC,SAAS,CAAC,SAAS,IAAI,MAAM;IAW7B,SAAS,CAAC,aAAa,IAAI,UAAU;IAWrC,SAAS,CAAC,YAAY,IAAI,MAAM;CASjC"}
@@ -15,18 +15,18 @@ let BaseTemporalClientService = class BaseTemporalClientService {
15
15
  connection = null;
16
16
  client = null;
17
17
  resolvedNamespace = null;
18
- resolveConnectionOptions() {
19
- return (0, connection_1.resolveTemporalConnectionOptionsFromEnv)();
18
+ resolveConnectionDeps() {
19
+ return { logger: this.logger };
20
20
  }
21
21
  resolveClientOptions() {
22
22
  return undefined;
23
23
  }
24
24
  async onApplicationBootstrap() {
25
25
  const namespace = this.resolveNamespace();
26
- this.connection = await (0, connection_1.connectTemporalClient)(this.resolveConnectionOptions());
26
+ this.connection = await (0, connection_1.connectTemporalClient)(this.resolveConnectionOptions(), this.resolveConnectionDeps());
27
27
  this.resolvedNamespace = namespace;
28
28
  this.client = new temporal_sdk_1.Client({
29
- connection: this.connection,
29
+ connection: this.connection.connection,
30
30
  namespace,
31
31
  ...this.resolveClientOptions(),
32
32
  });
@@ -53,7 +53,7 @@ let BaseTemporalClientService = class BaseTemporalClientService {
53
53
  throw new Error(`${this.constructor.name} is not initialized — getConnection() called ` +
54
54
  'before onApplicationBootstrap or after onModuleDestroy.');
55
55
  }
56
- return this.connection;
56
+ return this.connection.connection;
57
57
  }
58
58
  getNamespace() {
59
59
  if (!this.resolvedNamespace) {
@@ -1 +1 @@
1
- {"version":3,"file":"base-temporal-client.service.js","sourceRoot":"","sources":["../../src/lib/base-temporal-client.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAKwB;AAExB,6CAIsB;AACtB,iDAAwE;AA8CjE,IAAe,yBAAyB,GAAxC,MAAe,yBAAyB;IAG1B,MAAM,GAAG,IAAI,eAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAEtD,UAAU,GAAsB,IAAI,CAAC;IACrC,MAAM,GAAkB,IAAI,CAAC;IAC7B,iBAAiB,GAAkB,IAAI,CAAC;IAatC,wBAAwB;QAChC,OAAO,IAAA,oDAAuC,GAAE,CAAC;IACnD,CAAC;IAOS,oBAAoB;QAG5B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,sBAAsB;QAC1B,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,MAAM,IAAA,kCAAqB,EAC3C,IAAI,CAAC,wBAAwB,EAAE,CAChC,CAAC;QACF,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,IAAI,qBAAM,CAAC;YACvB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,SAAS;YACT,GAAG,IAAI,CAAC,oBAAoB,EAAE;SAC/B,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,wCAAwC,SAAS,IAAI,CAAC,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;YAC9B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YACnB,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;YAC9B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAMS,SAAS;QACjB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CACb,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,2CAA2C;gBACjE,yDAAyD,CAC5D,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGS,aAAa;QACrB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACb,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,+CAA+C;gBACrE,yDAAyD,CAC5D,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAGS,YAAY;QACpB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CACb,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,8CAA8C;gBACpE,yDAAyD,CAC5D,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;CACF,CAAA;AA9FqB,8DAAyB;oCAAzB,yBAAyB;IAD9C,IAAA,mBAAU,GAAE;GACS,yBAAyB,CA8F9C"}
1
+ {"version":3,"file":"base-temporal-client.service.js","sourceRoot":"","sources":["../../src/lib/base-temporal-client.service.ts"],"names":[],"mappings":";;;;;;;;;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ACxD,CAAC;IACH,CAAC;IAMS,SAAS;QACjB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CACb,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,2CAA2C;gBACjE,yDAAyD,CAC5D,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGS,aAAa;QACrB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACb,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,+CAA+C;gBACrE,yDAAyD,CAC5D,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IACpC,CAAC;IAGS,YAAY;QACpB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CACb,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,8CAA8C;gBACpE,yDAAyD,CAC5D,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;CACF,CAAA;AAtGqB,8DAAyB;oCAAzB,yBAAyB;IAD9C,IAAA,mBAAU,GAAE;GACS,yBAAyB,CAsG9C"}
@@ -0,0 +1,83 @@
1
+ import { BiomeWorkerTaskQueueFairness, BiomeWorkerTaskQueueServes, type BiomeOrigin } from '@xemahq/contracts/biome';
2
+ import { type ProcessTrustPolicy } from '@xemahq/contracts/process-topology';
3
+ import { type PlatformNexusServiceHandler, type PlatformWorkerSinks, type PlatformWorkerTuning } from './versioned-worker';
4
+ import { type WorkerDeploymentVersion } from './worker-deployment-version';
5
+ import type { PayloadCodec } from '@temporalio/common';
6
+ import type { ActivityInterceptorsFactory, NativeConnection, Worker } from '@temporalio/worker';
7
+ export declare enum BiomeWorkerErrorCode {
8
+ ProtocolNotWorkerV2 = "protocol-not-worker-v2",
9
+ ImplementationMismatch = "implementation-mismatch",
10
+ NexusMismatch = "nexus-mismatch",
11
+ InvalidComponentKey = "invalid-component-key",
12
+ DuplicateComponent = "duplicate-component",
13
+ DuplicateTaskQueue = "duplicate-task-queue",
14
+ MixedTrustDomains = "mixed-trust-domains",
15
+ EmptyComposition = "empty-composition"
16
+ }
17
+ export declare class BiomeWorkerError extends Error {
18
+ readonly code: BiomeWorkerErrorCode;
19
+ constructor(code: BiomeWorkerErrorCode, message: string);
20
+ }
21
+ export interface BiomeNexusServiceImplementation {
22
+ readonly service: string;
23
+ readonly version: string;
24
+ readonly handler: PlatformNexusServiceHandler;
25
+ }
26
+ export interface DefineBiomeWorkerOptions {
27
+ readonly biomeId: string;
28
+ readonly componentKey: string;
29
+ readonly origin: BiomeOrigin;
30
+ readonly protocol: unknown;
31
+ readonly workflowsPath?: string;
32
+ readonly activities?: object;
33
+ readonly nexusServices?: readonly BiomeNexusServiceImplementation[];
34
+ readonly workflowInterceptorModules?: readonly string[];
35
+ readonly activityInterceptors?: readonly ActivityInterceptorsFactory[];
36
+ readonly payloadCodec?: PayloadCodec;
37
+ readonly sinks?: PlatformWorkerSinks;
38
+ readonly tuning?: PlatformWorkerTuning;
39
+ }
40
+ export interface BiomeWorkerQueue {
41
+ readonly name: string;
42
+ readonly taskQueue: string;
43
+ readonly serves: readonly BiomeWorkerTaskQueueServes[];
44
+ readonly fairness: BiomeWorkerTaskQueueFairness;
45
+ readonly nexusServices: readonly BiomeNexusServiceImplementation[];
46
+ }
47
+ export interface BiomeWorkerDefinition {
48
+ readonly biomeId: string;
49
+ readonly componentKey: string;
50
+ readonly origin: BiomeOrigin;
51
+ readonly queues: readonly BiomeWorkerQueue[];
52
+ readonly workflowsPath?: string;
53
+ readonly activities?: object;
54
+ readonly workflowInterceptorModules: readonly string[];
55
+ readonly activityInterceptors: readonly ActivityInterceptorsFactory[];
56
+ readonly payloadCodec?: PayloadCodec;
57
+ readonly sinks?: PlatformWorkerSinks;
58
+ readonly tuning: PlatformWorkerTuning;
59
+ }
60
+ export declare function defineBiomeWorker(options: DefineBiomeWorkerOptions): BiomeWorkerDefinition;
61
+ export interface ComposeBiomeWorkersOptions {
62
+ readonly connection: NativeConnection;
63
+ readonly deploymentId: string;
64
+ readonly version: WorkerDeploymentVersion;
65
+ readonly trustPolicy?: ProcessTrustPolicy;
66
+ readonly definitions: readonly BiomeWorkerDefinition[];
67
+ }
68
+ export interface ComposedBiomeWorker {
69
+ readonly biomeId: string;
70
+ readonly componentKey: string;
71
+ readonly taskQueue: string;
72
+ readonly worker: Worker;
73
+ }
74
+ export interface ComposedBiomeWorkers {
75
+ readonly trustDomain: string;
76
+ readonly namespace: string;
77
+ readonly version: WorkerDeploymentVersion;
78
+ readonly workers: readonly ComposedBiomeWorker[];
79
+ run(): Promise<void>;
80
+ shutdown(): void;
81
+ }
82
+ export declare function composeBiomeWorkers(options: ComposeBiomeWorkersOptions): Promise<ComposedBiomeWorkers>;
83
+ //# sourceMappingURL=biome-worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biome-worker.d.ts","sourceRoot":"","sources":["../../src/lib/biome-worker.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,4BAA4B,EAC5B,0BAA0B,EAC1B,KAAK,WAAW,EAEjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,oCAAoC,CAAC;AAO5C,OAAO,EAGL,KAAK,2BAA2B,EAChC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EACV,2BAA2B,EAC3B,gBAAgB,EAChB,MAAM,EAEP,MAAM,oBAAoB,CAAC;AAG5B,oBAAY,oBAAoB;IAE9B,mBAAmB,2BAA2B;IAE9C,sBAAsB,4BAA4B;IAElD,aAAa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