@happyvertical/smrt-jobs 0.61.2 → 0.61.4

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.
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
- import { A as SmrtJob, B as backgroundEligible, C as DEFAULT_JOB_RETENTION, D as registerJobRetentionTasks, E as JOB_EVENTS_RETENTION_TASK, F as SmrtJobDedupeSlot, H as getBackgroundEligibleMethods, I as DEFAULT_TENANT_JOB_CAP, L as MAX_JOB_RETRIES, M as countScheduleJobs, N as SmrtJobEvent, O as startRetentionSweeper, P as SmrtJobEventCollection, R as TenantJobCapExceededError, S as redactErrorMessage, T as JOBS_RETENTION_TASK, U as isBackgroundEligibleMethod, V as clampRetries, W as markBackgroundEligible, _ as requestMcpTaskContinuation, a as getActiveJobExecutionContext, b as JobContextLogger, c as SmrtWorker, d as McpTaskCancelledError, f as McpTaskNotFoundError, g as getMcpTaskMarker, h as createMcpTaskResult, i as createTaskRunner, j as SmrtJobCollection, k as unregisterJobRetentionTasks, l as SmrtWorkerCollection, m as McpTaskSuspendedError, n as JobTimeoutError, o as isRunnerExecutionContext, p as McpTaskStore, r as TaskRunner, s as DEFAULT_TASK_HEARTBEAT_INTERVAL_MS, t as JobCancelledError, u as MCP_TASKS_EXTENSION, v as requestMcpTaskInput, w as DEFAULT_RETENTION_SWEEP_INTERVAL_MS, x as redactErrorForPersistence, y as taskFromJob, z as assertWithinTenantCreationCap } from "./chunks/runner-BUlKrA4Z.js";
2
- import { c as unregisterLiveWorker, i as registerLiveWorker, n as isWorkerAlive, t as createWorkerKey } from "./chunks/worker-liveness-C1Gjnhax.js";
3
- import { ObjectRegistry, SmrtCollection, SmrtObject, detectEngine, field, smrt } from "@happyvertical/smrt-core";
1
+ import { A as JOB_EVENTS_RETENTION_TASK, B as DEFAULT_TENANT_JOB_CAP, C as taskFromJob, D as DEFAULT_JOB_RETENTION, E as redactErrorMessage, F as SmrtJobCollection, G as clampRetries, H as TenantJobCapExceededError, I as countScheduleJobs, J as markBackgroundEligible, K as getBackgroundEligibleMethods, L as SmrtJobEvent, M as startRetentionSweeper, N as unregisterJobRetentionTasks, O as DEFAULT_RETENTION_SWEEP_INTERVAL_MS, P as SmrtJob, R as SmrtJobEventCollection, S as requestMcpTaskInput, T as redactErrorForPersistence, U as assertWithinTenantCreationCap, V as MAX_JOB_RETRIES, W as backgroundEligible, _ as McpTaskStore, a as getActiveJobExecutionContext, b as getMcpTaskMarker, c as isWorkerAlive, d as DEFAULT_TASK_HEARTBEAT_INTERVAL_MS, f as SmrtWorker, g as McpTaskNotFoundError, h as McpTaskCancelledError, i as createTaskRunner, j as registerJobRetentionTasks, k as JOBS_RETENTION_TASK, l as registerLiveWorker, m as MCP_TASKS_EXTENSION, n as JobTimeoutError, o as isRunnerExecutionContext, p as SmrtWorkerCollection, q as isBackgroundEligibleMethod, r as TaskRunner, s as createWorkerKey, t as JobCancelledError, u as unregisterLiveWorker, v as McpTaskSuspendedError, w as JobContextLogger, x as requestMcpTaskContinuation, y as createMcpTaskResult, z as SmrtJobDedupeSlot } from "./chunks/runner-BRwm00s-.js";
2
+ import { ObjectRegistry, SmrtCollection, SmrtObject, assertDatabaseMigratedForBuild, detectEngine, field, smrt } from "@happyvertical/smrt-core";
4
3
  import { createLogger } from "@happyvertical/logger";
5
4
  import { createHmac, randomUUID, timingSafeEqual } from "node:crypto";
6
5
  import { TenantScoped, requireTenant, tenantId, withTenant } from "@happyvertical/smrt-tenancy";
@@ -102,11 +101,13 @@ __publicField(ForgeDelivery, "__smrtPackage__", "@happyvertical/smrt-jobs");
102
101
  __decorateClass([tenantId()], ForgeDelivery.prototype, "tenantId", 2);
103
102
  __decorateClass([field({
104
103
  type: "text",
105
- required: true
104
+ required: true,
105
+ requiredFor: "identity"
106
106
  })], ForgeDelivery.prototype, "provider", 2);
107
107
  __decorateClass([field({
108
108
  type: "text",
109
- required: true
109
+ required: true,
110
+ requiredFor: "identity"
110
111
  })], ForgeDelivery.prototype, "deliveryId", 2);
111
112
  __decorateClass([field({
112
113
  type: "text",
@@ -116,10 +117,7 @@ __decorateClass([field({
116
117
  type: "text",
117
118
  nullable: true
118
119
  })], ForgeDelivery.prototype, "repositoryKey", 2);
119
- __decorateClass([field({
120
- type: "text",
121
- required: true
122
- })], ForgeDelivery.prototype, "eventName", 2);
120
+ __decorateClass([field({ type: "text" })], ForgeDelivery.prototype, "eventName", 2);
123
121
  __decorateClass([field({ type: "json" })], ForgeDelivery.prototype, "payload", 2);
124
122
  __decorateClass([field({
125
123
  type: "text",
@@ -199,20 +197,19 @@ __publicField(ForgeProjectionCheckpoint, "__smrtPackage__", "@happyvertical/smrt
199
197
  __decorateClass([tenantId()], ForgeProjectionCheckpoint.prototype, "tenantId", 2);
200
198
  __decorateClass([field({
201
199
  type: "text",
202
- required: true
200
+ required: true,
201
+ requiredFor: "identity"
203
202
  })], ForgeProjectionCheckpoint.prototype, "projection", 2);
204
203
  __decorateClass([field({
205
204
  type: "text",
206
- required: true
205
+ required: true,
206
+ requiredFor: "identity"
207
207
  })], ForgeProjectionCheckpoint.prototype, "subjectKey", 2);
208
208
  __decorateClass([field({
209
209
  type: "integer",
210
210
  required: true
211
211
  })], ForgeProjectionCheckpoint.prototype, "observationVersion", 2);
212
- __decorateClass([field({
213
- type: "text",
214
- required: true
215
- })], ForgeProjectionCheckpoint.prototype, "deliveryId", 2);
212
+ __decorateClass([field({ type: "text" })], ForgeProjectionCheckpoint.prototype, "deliveryId", 2);
216
213
  __decorateClass([field({
217
214
  type: "datetime",
218
215
  required: true
@@ -1025,6 +1022,7 @@ var ScheduleRunner = class extends EventEmitter {
1025
1022
  if (this.running) return;
1026
1023
  if (!this.db) throw new Error("ScheduleRunner not initialized. Call initialize() first.");
1027
1024
  if (!this.db.transaction) throw new Error("ScheduleRunner requires transaction support");
1025
+ await assertDatabaseMigratedForBuild(this.db);
1028
1026
  this.running = true;
1029
1027
  this.startPolling();
1030
1028
  this.emit("runner:started");