@aikirun/worker 0.9.2 → 0.10.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 (2) hide show
  1. package/dist/index.js +6 -4
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -165,7 +165,9 @@ var WorkerHandleImpl = class {
165
165
  if (!this.subscriberStrategy) {
166
166
  throw new Error("Subscriber strategy not initialized");
167
167
  }
168
- this.logger.info("Worker started");
168
+ this.logger.info("Worker started", {
169
+ "aiki.registeredWorkflows": this.params.workflows.map((w) => `${w.name}/${w.versionId}`)
170
+ });
169
171
  const maxConcurrentWorkflowRuns = this.params.opts?.maxConcurrentWorkflowRuns ?? 1;
170
172
  let nextDelayMs = this.subscriberStrategy.getNextDelay({ type: "polled", foundWork: false });
171
173
  let subscriberFailedAttempts = 0;
@@ -229,7 +231,7 @@ var WorkerHandleImpl = class {
229
231
  const { run: workflowRun } = await this.client.api.workflowRun.getByIdV1({ id: workflowRunId });
230
232
  if (!workflowRun) {
231
233
  if (meta && this.subscriberStrategy?.acknowledge) {
232
- await this.subscriberStrategy.acknowledge(workflowRunId, meta).catch(() => {
234
+ await this.subscriberStrategy.acknowledge(this.id, workflowRunId, meta).catch(() => {
233
235
  });
234
236
  }
235
237
  continue;
@@ -245,7 +247,7 @@ var WorkerHandleImpl = class {
245
247
  "aiki.workflowRunId": workflowRun.id
246
248
  });
247
249
  if (meta && this.subscriberStrategy?.acknowledge) {
248
- await this.subscriberStrategy.acknowledge(workflowRunId, meta).catch(() => {
250
+ await this.subscriberStrategy.acknowledge(this.id, workflowRunId, meta).catch(() => {
249
251
  });
250
252
  }
251
253
  continue;
@@ -316,7 +318,7 @@ var WorkerHandleImpl = class {
316
318
  if (meta && this.subscriberStrategy?.acknowledge) {
317
319
  if (shouldAcknowledge) {
318
320
  try {
319
- await this.subscriberStrategy.acknowledge(workflowRun.id, meta);
321
+ await this.subscriberStrategy.acknowledge(this.id, workflowRun.id, meta);
320
322
  } catch (error) {
321
323
  logger.error("Failed to acknowledge message, it may be reprocessed", {
322
324
  "aiki.errorType": "MESSAGE_ACK_FAILED",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aikirun/worker",
3
- "version": "0.9.2",
3
+ "version": "0.10.0",
4
4
  "description": "Worker SDK for Aiki - execute workflows and tasks with durable state management and automatic recovery",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -18,9 +18,9 @@
18
18
  "build": "tsup"
19
19
  },
20
20
  "dependencies": {
21
- "@aikirun/types": "0.9.2",
22
- "@aikirun/client": "0.9.2",
23
- "@aikirun/workflow": "0.9.2"
21
+ "@aikirun/types": "0.10.0",
22
+ "@aikirun/client": "0.10.0",
23
+ "@aikirun/workflow": "0.10.0"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public"