@objectstack/trigger-schedule 17.1.0 → 17.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,434 @@
1
1
  # @objectstack/plugin-trigger-schedule
2
2
 
3
+ ## 17.3.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [809d417]
8
+ - Updated dependencies [387e231]
9
+ - Updated dependencies [f794e4e]
10
+ - Updated dependencies [cae2169]
11
+ - Updated dependencies [b812a54]
12
+ - Updated dependencies [2d4fa75]
13
+ - Updated dependencies [0e4e51b]
14
+ - Updated dependencies [e84bbf6]
15
+ - Updated dependencies [effae80]
16
+ - Updated dependencies [efb3513]
17
+ - Updated dependencies [d62f990]
18
+ - Updated dependencies [c45d8e6]
19
+ - Updated dependencies [2e3e8c7]
20
+ - Updated dependencies [e621291]
21
+ - Updated dependencies [655b106]
22
+ - Updated dependencies [40a93b5]
23
+ - Updated dependencies [d5b330d]
24
+ - Updated dependencies [dda969c]
25
+ - Updated dependencies [1f45690]
26
+ - Updated dependencies [277948f]
27
+ - Updated dependencies [8bdd955]
28
+ - Updated dependencies [f3bbbef]
29
+ - Updated dependencies [4f24e9d]
30
+ - Updated dependencies [e27583e]
31
+ - Updated dependencies [4bd6faa]
32
+ - Updated dependencies [86cbe37]
33
+ - Updated dependencies [6a180e4]
34
+ - Updated dependencies [474242f]
35
+ - Updated dependencies [63cd487]
36
+ - Updated dependencies [bd4aa4e]
37
+ - Updated dependencies [803eaab]
38
+ - Updated dependencies [f8e8f03]
39
+ - Updated dependencies [983edf1]
40
+ - Updated dependencies [eae824e]
41
+ - Updated dependencies [f6fa22c]
42
+ - Updated dependencies [8a483b3]
43
+ - Updated dependencies [97bcd99]
44
+ - Updated dependencies [df59de0]
45
+ - Updated dependencies [96e25a8]
46
+ - Updated dependencies [f75a38a]
47
+ - Updated dependencies [7a25e7d]
48
+ - Updated dependencies [1fa05a6]
49
+ - Updated dependencies [c85a265]
50
+ - Updated dependencies [dcb10a5]
51
+ - Updated dependencies [773a999]
52
+ - Updated dependencies [35dffea]
53
+ - Updated dependencies [d8024f0]
54
+ - Updated dependencies [8120808]
55
+ - Updated dependencies [776a098]
56
+ - Updated dependencies [5060877]
57
+ - Updated dependencies [4f6325d]
58
+ - Updated dependencies [52954c0]
59
+ - Updated dependencies [2aa8456]
60
+ - Updated dependencies [93809a3]
61
+ - Updated dependencies [7c0d0c3]
62
+ - Updated dependencies [daae7aa]
63
+ - Updated dependencies [8dc22d6]
64
+ - Updated dependencies [279431e]
65
+ - Updated dependencies [948dd6b]
66
+ - Updated dependencies [3b4c56c]
67
+ - Updated dependencies [ae8edd2]
68
+ - Updated dependencies [e25403c]
69
+ - Updated dependencies [64baa68]
70
+ - Updated dependencies [9fa70d7]
71
+ - Updated dependencies [09db64a]
72
+ - Updated dependencies [92916e7]
73
+ - Updated dependencies [a84f3ea]
74
+ - Updated dependencies [f2eaae8]
75
+ - Updated dependencies [c09451b]
76
+ - Updated dependencies [ba64877]
77
+ - Updated dependencies [7345308]
78
+ - Updated dependencies [79b6a22]
79
+ - Updated dependencies [30d96ab]
80
+ - Updated dependencies [f658793]
81
+ - Updated dependencies [c95ad19]
82
+ - Updated dependencies [e58ea8b]
83
+ - Updated dependencies [4a17645]
84
+ - Updated dependencies [3795c5f]
85
+ - Updated dependencies [8ab926b]
86
+ - Updated dependencies [7317cf2]
87
+ - Updated dependencies [e25e839]
88
+ - Updated dependencies [5997207]
89
+ - Updated dependencies [8b13cc8]
90
+ - Updated dependencies [4a4a35d]
91
+ - Updated dependencies [86e765a]
92
+ - Updated dependencies [1d7e76a]
93
+ - Updated dependencies [53dc739]
94
+ - Updated dependencies [fd289be]
95
+ - Updated dependencies [03bf7b1]
96
+ - Updated dependencies [f90e820]
97
+ - Updated dependencies [18d816a]
98
+ - Updated dependencies [e8bd715]
99
+ - Updated dependencies [b91c351]
100
+ - Updated dependencies [a28a3c0]
101
+ - Updated dependencies [daeaaf9]
102
+ - Updated dependencies [c459da6]
103
+ - Updated dependencies [e914733]
104
+ - Updated dependencies [f887e52]
105
+ - Updated dependencies [881f8d8]
106
+ - Updated dependencies [3bfa1e6]
107
+ - Updated dependencies [0a8ebf3]
108
+ - Updated dependencies [901355c]
109
+ - Updated dependencies [34ce8e7]
110
+ - Updated dependencies [33681ea]
111
+ - Updated dependencies [4635f3e]
112
+ - Updated dependencies [fd289be]
113
+ - Updated dependencies [ee3595c]
114
+ - Updated dependencies [b2eab95]
115
+ - Updated dependencies [93940d4]
116
+ - Updated dependencies [3a04b01]
117
+ - Updated dependencies [45b9051]
118
+ - Updated dependencies [b9e9227]
119
+ - Updated dependencies [d395692]
120
+ - Updated dependencies [5894d30]
121
+ - Updated dependencies [a3765f6]
122
+ - Updated dependencies [2d5cee3]
123
+ - Updated dependencies [e22158f]
124
+ - Updated dependencies [7404925]
125
+ - Updated dependencies [0c2334f]
126
+ - Updated dependencies [778c59f]
127
+ - Updated dependencies [d2619fd]
128
+ - Updated dependencies [af56546]
129
+ - Updated dependencies [6acb11a]
130
+ - Updated dependencies [33c5fd3]
131
+ - Updated dependencies [20b0fdb]
132
+ - Updated dependencies [905019b]
133
+ - Updated dependencies [a286411]
134
+ - Updated dependencies [98c0d33]
135
+ - Updated dependencies [368a82e]
136
+ - Updated dependencies [a3d5724]
137
+ - Updated dependencies [93ea19b]
138
+ - Updated dependencies [9ee2dcf]
139
+ - Updated dependencies [8cb96ec]
140
+ - Updated dependencies [8f10a79]
141
+ - Updated dependencies [6269a55]
142
+ - Updated dependencies [a17da05]
143
+ - Updated dependencies [a8c00e2]
144
+ - Updated dependencies [0fb8760]
145
+ - Updated dependencies [e5ce2ed]
146
+ - Updated dependencies [be21955]
147
+ - Updated dependencies [bc56e18]
148
+ - Updated dependencies [be21955]
149
+ - Updated dependencies [a9ee989]
150
+ - Updated dependencies [4d0d944]
151
+ - Updated dependencies [15d58db]
152
+ - Updated dependencies [d63b014]
153
+ - Updated dependencies [9abe4e4]
154
+ - Updated dependencies [2cc7122]
155
+ - Updated dependencies [50d6c92]
156
+ - Updated dependencies [9e0ba21]
157
+ - Updated dependencies [311433f]
158
+ - Updated dependencies [3e5ad08]
159
+ - Updated dependencies [9abe4e4]
160
+ - Updated dependencies [b7131f3]
161
+ - Updated dependencies [e5812fa]
162
+ - Updated dependencies [7085f90]
163
+ - Updated dependencies [dee4dd4]
164
+ - Updated dependencies [ce7e497]
165
+ - Updated dependencies [51ecb2f]
166
+ - Updated dependencies [9086761]
167
+ - Updated dependencies [42a117b]
168
+ - Updated dependencies [1401ae7]
169
+ - Updated dependencies [4297fe7]
170
+ - Updated dependencies [e398863]
171
+ - Updated dependencies [d16df74]
172
+ - Updated dependencies [f11fc61]
173
+ - Updated dependencies [e808890]
174
+ - Updated dependencies [8f79379]
175
+ - Updated dependencies [e6ca40e]
176
+ - Updated dependencies [0c77ea4]
177
+ - Updated dependencies [52954c0]
178
+ - Updated dependencies [89eb997]
179
+ - Updated dependencies [7131f12]
180
+ - Updated dependencies [aa5994e]
181
+ - Updated dependencies [be93457]
182
+ - Updated dependencies [a65db76]
183
+ - Updated dependencies [15eb2c9]
184
+ - Updated dependencies [5691b07]
185
+ - Updated dependencies [2a6122b]
186
+ - Updated dependencies [225e769]
187
+ - Updated dependencies [8af88dd]
188
+ - Updated dependencies [fb5fbb8]
189
+ - Updated dependencies [d7b3963]
190
+ - Updated dependencies [33184fd]
191
+ - Updated dependencies [7c41693]
192
+ - Updated dependencies [b72db01]
193
+ - Updated dependencies [dce5cd4]
194
+ - Updated dependencies [9688f58]
195
+ - Updated dependencies [556ebc1]
196
+ - Updated dependencies [177ebdc]
197
+ - Updated dependencies [8d237b4]
198
+ - Updated dependencies [2d2e6f0]
199
+ - Updated dependencies [2d8dd8d]
200
+ - Updated dependencies [22d573e]
201
+ - Updated dependencies [b5a2398]
202
+ - Updated dependencies [348860c]
203
+ - Updated dependencies [5383fa6]
204
+ - Updated dependencies [5b3ff63]
205
+ - Updated dependencies [1a6a19c]
206
+ - Updated dependencies [527e050]
207
+ - Updated dependencies [dd33bf9]
208
+ - Updated dependencies [4cb2a90]
209
+ - Updated dependencies [74a7804]
210
+ - Updated dependencies [53d3689]
211
+ - Updated dependencies [b3a63d3]
212
+ - Updated dependencies [49f0dcf]
213
+ - Updated dependencies [033a34c]
214
+ - Updated dependencies [4d25d22]
215
+ - Updated dependencies [1ffee51]
216
+ - Updated dependencies [5ae4303]
217
+ - Updated dependencies [ece4dad]
218
+ - Updated dependencies [e9b377e]
219
+ - Updated dependencies [146f448]
220
+ - Updated dependencies [735f5c7]
221
+ - Updated dependencies [a7e18de]
222
+ - Updated dependencies [366f895]
223
+ - Updated dependencies [dc75ba8]
224
+ - Updated dependencies [cce0aa9]
225
+ - Updated dependencies [e764507]
226
+ - Updated dependencies [cff17af]
227
+ - Updated dependencies [39404f3]
228
+ - Updated dependencies [ca1965f]
229
+ - Updated dependencies [8619f95]
230
+ - Updated dependencies [b706af9]
231
+ - Updated dependencies [add4360]
232
+ - Updated dependencies [fc9ba76]
233
+ - Updated dependencies [0f94cc7]
234
+ - Updated dependencies [a11c1a5]
235
+ - Updated dependencies [71f9cd1]
236
+ - Updated dependencies [ee17d86]
237
+ - Updated dependencies [cdbd920]
238
+ - Updated dependencies [18c432e]
239
+ - Updated dependencies [3c418c4]
240
+ - Updated dependencies [fa8715a]
241
+ - Updated dependencies [a933ed7]
242
+ - Updated dependencies [b3ca463]
243
+ - Updated dependencies [a933ed7]
244
+ - Updated dependencies [0d4a6a8]
245
+ - Updated dependencies [518d5e5]
246
+ - Updated dependencies [6643ba1]
247
+ - Updated dependencies [eeba2ef]
248
+ - Updated dependencies [ec4c4d2]
249
+ - Updated dependencies [424f73c]
250
+ - Updated dependencies [cccbe51]
251
+ - Updated dependencies [a8d6b1d]
252
+ - Updated dependencies [e4a7695]
253
+ - Updated dependencies [87075b1]
254
+ - Updated dependencies [fc58a99]
255
+ - Updated dependencies [14cfc00]
256
+ - Updated dependencies [1c6f7b4]
257
+ - Updated dependencies [e854a53]
258
+ - Updated dependencies [dfebfc8]
259
+ - Updated dependencies [d028b37]
260
+ - Updated dependencies [f7b25c5]
261
+ - Updated dependencies [122ef38]
262
+ - Updated dependencies [4a37870]
263
+ - Updated dependencies [428f9b2]
264
+ - Updated dependencies [aa7ff56]
265
+ - Updated dependencies [c41b42e]
266
+ - Updated dependencies [c4db311]
267
+ - Updated dependencies [750fff5]
268
+ - Updated dependencies [c19035e]
269
+ - Updated dependencies [ececf7a]
270
+ - Updated dependencies [d173125]
271
+ - Updated dependencies [8eeca27]
272
+ - Updated dependencies [8425c17]
273
+ - Updated dependencies [a5ef1d8]
274
+ - Updated dependencies [772d5de]
275
+ - Updated dependencies [ce80ec2]
276
+ - Updated dependencies [b372318]
277
+ - Updated dependencies [97a2263]
278
+ - Updated dependencies [29d0676]
279
+ - Updated dependencies [0169d49]
280
+ - Updated dependencies [6bd3231]
281
+ - Updated dependencies [d2b5ba8]
282
+ - Updated dependencies [b799ac5]
283
+ - Updated dependencies [8f74307]
284
+ - Updated dependencies [d23dc08]
285
+ - Updated dependencies [644ad50]
286
+ - Updated dependencies [0da7cd2]
287
+ - Updated dependencies [28a5c3e]
288
+ - Updated dependencies [4bc18e5]
289
+ - @objectstack/spec@17.3.0
290
+ - @objectstack/core@17.3.0
291
+
292
+ ## 17.2.0
293
+
294
+ ### Minor Changes
295
+
296
+ - 73d9795: Time-relative sweeps are now idempotent per matched window (#10220). Previously the sweep
297
+ held no cross-tick memory, so every re-scan of the same window re-dispatched the same
298
+ records — a 5s-interval flow minted 15 duplicate reminders in ~70s, and even under a daily
299
+ cron a kernel rebuild re-dispatched the day's window.
300
+
301
+ - `@objectstack/service-automation` — new platform object `sys_flow_dispatch`: a persisted
302
+ dispatch-claim ledger (ADR-0057 telemetry retention, 30 days), registered alongside
303
+ `sys_automation_run` and exposed as `AutomationEngine.claim(key): Promise<boolean>` on
304
+ the automation service surface (check-and-record; a concurrent duplicate insert re-reads
305
+ and reports the key as already claimed). When no ObjectQL engine / registration is
306
+ available the engine degrades to in-process dedup and logs the weakened guarantee once;
307
+ when the ledger errors, the claim falls back to the in-process check for that key so a
308
+ store outage never blocks a dispatch (availability over strict-once).
309
+ - `@objectstack/trigger-schedule` — the time-relative sweep computes a dispatch key from
310
+ the MATCHED WINDOW's identity and claims it before launching: offset mode keys on
311
+ `(flowName, recordId, windowDay, offset)` — so a dateField edit that moves the window
312
+ legitimately re-fires — and range mode keys on `(flowName, recordId, sweepDay,
313
+ rangeSpec)`, preserving the documented `withinDays` semantic ("fires every day the
314
+ record stays in range") while never firing twice in one day. The trigger resolves the
315
+ claim surface structurally from the automation service; without one it dedups
316
+ in-process and warns once.
317
+ - `@objectstack/spec` — `sys_flow_dispatch` added to `PLATFORM_OBJECTS_BY_PACKAGE` under
318
+ `service-automation` (registry conformance).
319
+
320
+ ### Patch Changes
321
+
322
+ - 6ceaa4b: docs: name packages that exist in seven published documents, and gate the class (#10893)
323
+
324
+ A published README ships inside the npm tarball, so an install instruction in one
325
+ reaches every reader of the package. Nine `@objectstack/` names across seven
326
+ published documents named a package that is in **no directory of this repo**, and
327
+ five of those sat on `import` lines inside runnable fences.
328
+
329
+ `check:published-readme-exports` could not see any of it, by construction. It
330
+ resolves a documented import against the package's built type surface through the
331
+ workspace member map, so a specifier that is not a member has no type entry to
332
+ compare against and the gate reads no further — strict about a member that exists,
333
+ silent about one that does not. The gate now makes the member-existence claim
334
+ first: an `@objectstack/`-scoped specifier that names no workspace member is a
335
+ finding, and the run header prints the scoped population as `N/N` so a recogniser
336
+ that stops matching shows up as a denominator that fell.
337
+
338
+ What each dead claim now says, and why:
339
+
340
+ - **`@objectstack/trigger-schedule`** and **`@objectstack/trigger-record-change`**
341
+ each misnamed **themselves**. Both READMEs — including their `# ` titles and
342
+ every fenced import — said `@objectstack/plugin-trigger-…`, a name that has
343
+ never been published. The exported class names (`ScheduleTriggerPlugin`,
344
+ `TimeRelativeTriggerPlugin`, `RecordChangeTriggerPlugin`) were correct all
345
+ along; only the package name was wrong, so this is a rename pinned by each
346
+ package's own `name` field.
347
+ - **`@objectstack/plugin-security`** told readers to `install
348
+ @objectstack/plugin-org-scoping` and register an `OrgScopingPlugin` from it. No
349
+ such package exists. The organization wall ships as the enterprise
350
+ `@objectstack/organizations` runtime, whose `OrganizationsPlugin` registers the
351
+ `org-scoping` service this plugin probes — the name `objectstack serve` and
352
+ `objectstack doctor` both print. Asking for the wall without it is a refusal to
353
+ boot (ADR-0093 D5), not a silent downgrade, and the page now says so. The
354
+ tenant-isolation bullet pointed at `@objectstack/service-tenant`, which is the
355
+ cloud control-plane runtime from the separate `cloud` repository and not where
356
+ the wall comes from either.
357
+ - **`@objectstack/service-package`** described packages being "delivered to
358
+ runtime kernels that load them through `@objectstack/service-marketplace`". That
359
+ package was never built: ADR-0003, ADR-0016 and ADR-0025 all name it as future
360
+ work. The loading half that does exist here is
361
+ `@objectstack/cloud-connection`'s `MarketplaceInstallLocalPlugin`.
362
+ - **`@objectstack/embedder-openai`** had a fenced example importing
363
+ `KnowledgeTursoPlugin` from `@objectstack/knowledge-turso` — the worst shape,
364
+ because a reader pastes it. No knowledge adapter in this repository consumes an
365
+ `IEmbedder` at all: `knowledge-memory` and `knowledge-ragflow` take no embedder
366
+ option, and the adapters the contract is written for are not here. The example
367
+ is now the `embed()` surface that does exist, with the gap stated rather than
368
+ papered over with a substitute package name.
369
+ - **`@objectstack/driver-sqlite-wasm`**'s "When to use" table compared it against
370
+ `@objectstack/driver-sqlite` and `@objectstack/driver-postgres`. Neither has
371
+ ever existed; `@objectstack/driver-sql` covers PostgreSQL, MySQL and SQLite
372
+ through Knex, choosing the client from its optional peers.
373
+ - **`@objectstack/spec`**'s published `prompts/architecture.md` instructed code
374
+ generators to write `import { User } from '@objectstack/protocol'`. The package
375
+ is `@objectstack/spec`, which the same sentence names as the path being
376
+ replaced.
377
+
378
+ Four `@objectstack/` names that are **not** in this repo are deliberately left as
379
+ they are, because prose may name a package this repo does not build and a runnable
380
+ import may not: `@objectstack/security-enterprise` (the enterprise edition, whose
381
+ install hint the CLI prints and a CLI test pins), `@objectstack/service-tenant`
382
+ (the cloud runtime), `@objectstack/framework` (the umbrella install name), and the
383
+ two names `service-datasource`'s README recalls as its own past.
384
+ - Updated dependencies [6936d07]
385
+ - Updated dependencies [59eb04d]
386
+ - Updated dependencies [9f05b7d]
387
+ - Updated dependencies [3b2af5e]
388
+ - Updated dependencies [7d2d112]
389
+ - Updated dependencies [5fa0d72]
390
+ - Updated dependencies [02b3b07]
391
+ - Updated dependencies [914c413]
392
+ - Updated dependencies [55809a0]
393
+ - Updated dependencies [ee2ff45]
394
+ - Updated dependencies [47cd3ec]
395
+ - Updated dependencies [52db1d1]
396
+ - Updated dependencies [5649efb]
397
+ - Updated dependencies [9d7d2de]
398
+ - Updated dependencies [c815c50]
399
+ - Updated dependencies [795ea05]
400
+ - Updated dependencies [2306a76]
401
+ - Updated dependencies [e5ea701]
402
+ - Updated dependencies [a40dcc1]
403
+ - Updated dependencies [def0d3e]
404
+ - Updated dependencies [8d0bb79]
405
+ - Updated dependencies [5acb58d]
406
+ - Updated dependencies [2e3cf95]
407
+ - Updated dependencies [4c93387]
408
+ - Updated dependencies [504c8d5]
409
+ - Updated dependencies [a037f7c]
410
+ - Updated dependencies [3ee8ddf]
411
+ - Updated dependencies [16cef97]
412
+ - Updated dependencies [a79bd35]
413
+ - Updated dependencies [6ceaa4b]
414
+ - Updated dependencies [15ea214]
415
+ - Updated dependencies [de19489]
416
+ - Updated dependencies [c684d00]
417
+ - Updated dependencies [923c424]
418
+ - Updated dependencies [1ec36b7]
419
+ - Updated dependencies [5f2e54c]
420
+ - Updated dependencies [189373b]
421
+ - Updated dependencies [35ad101]
422
+ - Updated dependencies [ceb33a9]
423
+ - Updated dependencies [73d9795]
424
+ - Updated dependencies [8012960]
425
+ - Updated dependencies [f34f56b]
426
+ - Updated dependencies [f399618]
427
+ - Updated dependencies [75e9301]
428
+ - Updated dependencies [2810695]
429
+ - @objectstack/spec@17.2.0
430
+ - @objectstack/core@17.2.0
431
+
3
432
  ## 17.1.0
4
433
 
5
434
  ### Patch Changes
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @objectstack/plugin-trigger-schedule
1
+ # @objectstack/trigger-schedule
2
2
 
3
3
  Auto-launch ObjectStack flows on a schedule (cron / interval / once).
4
4
 
@@ -9,7 +9,7 @@ platform `IJobService` (the `'job'` service), so it stays adapter-agnostic: the
9
9
  job service selects a cron-capable adapter (e.g. the durable `DbJobAdapter` or
10
10
  `CronJobAdapter`) for cron schedules and the interval adapter for the rest.
11
11
 
12
- This is the sibling of `@objectstack/plugin-trigger-record-change` — same
12
+ This is the sibling of `@objectstack/trigger-record-change` — same
13
13
  engine baseline, a different event source.
14
14
 
15
15
  ## What it does
@@ -48,7 +48,7 @@ in its context.
48
48
  ```ts
49
49
  import { AutomationServicePlugin } from '@objectstack/service-automation';
50
50
  import { JobServicePlugin } from '@objectstack/service-job';
51
- import { ScheduleTriggerPlugin } from '@objectstack/plugin-trigger-schedule';
51
+ import { ScheduleTriggerPlugin } from '@objectstack/trigger-schedule';
52
52
 
53
53
  kernel
54
54
  .use(new AutomationServicePlugin()) // engine + flows
@@ -110,7 +110,7 @@ It needs both the job service (sweep cadence) **and** the ObjectQL engine (the
110
110
  date-window query); register it alongside the schedule trigger:
111
111
 
112
112
  ```ts
113
- import { ScheduleTriggerPlugin, TimeRelativeTriggerPlugin } from '@objectstack/plugin-trigger-schedule';
113
+ import { ScheduleTriggerPlugin, TimeRelativeTriggerPlugin } from '@objectstack/trigger-schedule';
114
114
 
115
115
  kernel
116
116
  .use(new ScheduleTriggerPlugin()) // plain schedule flows
package/dist/index.d.mts CHANGED
@@ -23,7 +23,7 @@ import { TimeRelativeTrigger as TimeRelativeTrigger$1 } from '@objectstack/spec/
23
23
  */
24
24
  declare class ScheduleTriggerPlugin implements Plugin {
25
25
  name: string;
26
- type: string;
26
+ type: "standard";
27
27
  version: string;
28
28
  dependencies: string[];
29
29
  init(ctx: PluginContext): Promise<void>;
@@ -136,7 +136,7 @@ declare class ScheduleTrigger implements FlowTrigger {
136
136
  */
137
137
  declare class TimeRelativeTriggerPlugin implements Plugin {
138
138
  name: string;
139
- type: string;
139
+ type: "standard";
140
140
  version: string;
141
141
  dependencies: string[];
142
142
  init(ctx: PluginContext): Promise<void>;
@@ -170,6 +170,18 @@ interface TimeRelativeDataEngine {
170
170
  */
171
171
  getObject?(name: string): unknown;
172
172
  }
173
+ /**
174
+ * The slice of the automation service this trigger needs for dispatch
175
+ * idempotency (#10220): claim a dispatch key against the persisted
176
+ * `sys_flow_dispatch` ledger. `true` = this caller owns the dispatch; `false` =
177
+ * an earlier sweep (possibly in a previous process lifetime) already made it.
178
+ * Typed structurally — like {@link TimeRelativeDataEngine} — so this plugin
179
+ * never learns the ledger's table name and takes no build dependency on
180
+ * `@objectstack/service-automation`.
181
+ */
182
+ interface FlowDispatchClaimSurface {
183
+ claim(key: string): Promise<boolean>;
184
+ }
173
185
  /** A closed, inclusive instant window `[gte, lte]` as ISO-8601 strings. */
174
186
  interface DateWindow {
175
187
  /** Lower bound (inclusive), ISO-8601. */
@@ -190,6 +202,32 @@ interface DateWindow {
190
202
  * `date` field (compared as `YYYY-MM-DD` after the driver truncates) is inclusive.
191
203
  */
192
204
  declare function computeDateWindows(desc: TimeRelativeTrigger$1, now: Date): DateWindow[];
205
+ /**
206
+ * A date window paired with the **claim scope** naming its identity for the
207
+ * dispatch dedup key (#10220, maintainer ruling 2026-08-20).
208
+ */
209
+ interface WindowClaimScope {
210
+ window: DateWindow;
211
+ /**
212
+ * Window-identity fragment of the dispatch key — what makes a re-scan of
213
+ * the SAME window dedup while a genuinely new window fires again:
214
+ *
215
+ * - offset mode → `<windowDay>:offset<n>`: the window day is the date the
216
+ * record's field must fall on, so editing the field to a new day (or a
217
+ * different offset matching) yields a new key and legitimately re-fires.
218
+ * Re-scans of one window all derive the same day → deduped.
219
+ * - range mode → `<sweepDay>:within<n>`: keyed on the SWEEP day, not the
220
+ * (constant) field value, so the documented `withinDays` semantic —
221
+ * "fires every day the record stays in range" — remains true: each new
222
+ * day is a new key, but never twice in one day.
223
+ */
224
+ scope: string;
225
+ }
226
+ /**
227
+ * {@link computeDateWindows}, with each window's claim scope (#10220). One
228
+ * derivation for both so the matching rule and the dedup key can never drift.
229
+ */
230
+ declare function computeWindowClaimScopes(desc: TimeRelativeTrigger$1, now: Date): WindowClaimScope[];
193
231
  /**
194
232
  * Build the ObjectQL `where` map for one date window: the descriptor's static
195
233
  * `filter` (if any) ANDed with a `$gte`/`$lte` range on the date field. The map
@@ -229,7 +267,17 @@ declare class TimeRelativeTrigger implements FlowTrigger {
229
267
  private readonly now;
230
268
  /** flowName → job name registered for it, so stop() can cancel it. */
231
269
  private readonly bound;
232
- constructor(getJobService: () => JobServiceSurface | null, getDataEngine: () => TimeRelativeDataEngine | null, logger: TriggerLogger, now?: () => Date);
270
+ /** Dispatch-idempotency claim surface (#10220), resolved lazily per sweep. */
271
+ private readonly getClaimSurface;
272
+ /**
273
+ * In-process claim fallback when no claim surface resolves (#10220):
274
+ * key → claim time (epoch ms), TTL-pruned. Dedups re-scans within THIS
275
+ * process only — which is why falling to it is warned once, below.
276
+ */
277
+ private readonly localClaims;
278
+ /** Whether the in-process-only dedup degradation has been said (once). */
279
+ private claimDegradationWarned;
280
+ constructor(getJobService: () => JobServiceSurface | null, getDataEngine: () => TimeRelativeDataEngine | null, logger: TriggerLogger, now?: () => Date, getClaimSurface?: () => FlowDispatchClaimSurface | null);
233
281
  start(binding: FlowTriggerBinding, callback: (ctx: AutomationContext) => Promise<void>): void;
234
282
  /**
235
283
  * Run one sweep: query each date window, union the matched records (deduped
@@ -237,7 +285,23 @@ declare class TimeRelativeTrigger implements FlowTrigger {
237
285
  * per-record failure is isolated so one bad row never aborts the batch.
238
286
  */
239
287
  private sweep;
288
+ /**
289
+ * Claim one dispatch key (#10220): `true` = launch, `false` = an earlier
290
+ * sweep already dispatched this (flow, record, window).
291
+ *
292
+ * Degradation contract:
293
+ * - Claim surface resolves (the automation service's `claim()`, backed by
294
+ * the persisted `sys_flow_dispatch` ledger) → its answer is used; if the
295
+ * CALL throws, the failure is logged and the dispatch proceeds —
296
+ * availability over strict-once: a broken ledger must never silently
297
+ * swallow reminders.
298
+ * - No claim surface (automation service missing, or one predating
299
+ * `claim()`) → in-process dedup only, warned ONCE: a silent fallback
300
+ * would hide that the once-per-window guarantee no longer survives a
301
+ * kernel rebuild.
302
+ */
303
+ private claimDispatch;
240
304
  stop(flowName: string): void;
241
305
  }
242
306
 
243
- export { type DateWindow, type FlowTrigger, type FlowTriggerBinding, type JobServiceSurface, ScheduleTrigger, ScheduleTriggerPlugin, type TimeRelativeDataEngine, TimeRelativeTrigger, TimeRelativeTriggerPlugin, type TriggerLogger, buildWindowWhere, computeDateWindows, normalizeSchedule };
307
+ export { type DateWindow, type FlowDispatchClaimSurface, type FlowTrigger, type FlowTriggerBinding, type JobServiceSurface, ScheduleTrigger, ScheduleTriggerPlugin, type TimeRelativeDataEngine, TimeRelativeTrigger, TimeRelativeTriggerPlugin, type TriggerLogger, type WindowClaimScope, buildWindowWhere, computeDateWindows, computeWindowClaimScopes, normalizeSchedule };