things-api 0.16.0 → 0.17.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/README.md +1 -1
- package/dist/cli/commands/repeat-flags.d.ts +3 -3
- package/dist/cli/commands/repeat-flags.js +90 -33
- package/dist/cli/commands/repeat-flags.js.map +1 -1
- package/dist/cli/commands/writes.js +59 -5
- package/dist/cli/commands/writes.js.map +1 -1
- package/dist/cli/help.js +9 -2
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/interrupt.d.ts +42 -0
- package/dist/cli/interrupt.js +105 -0
- package/dist/cli/interrupt.js.map +1 -0
- package/dist/cli/main.js +5 -0
- package/dist/cli/main.js.map +1 -1
- package/dist/client.js +3 -0
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +39 -0
- package/dist/config.js +16 -1
- package/dist/config.js.map +1 -1
- package/dist/contracts.d.ts +9 -2
- package/dist/contracts.js +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/model/occurrences.d.ts +14 -1
- package/dist/model/occurrences.js +20 -4
- package/dist/model/occurrences.js.map +1 -1
- package/dist/model/recurrence.d.ts +60 -9
- package/dist/model/recurrence.js +76 -19
- package/dist/model/recurrence.js.map +1 -1
- package/dist/paths.d.ts +8 -0
- package/dist/paths.js +10 -0
- package/dist/paths.js.map +1 -1
- package/dist/sync-health.js +2 -1
- package/dist/sync-health.js.map +1 -1
- package/dist/trace/tracer.d.ts +87 -0
- package/dist/trace/tracer.js +167 -0
- package/dist/trace/tracer.js.map +1 -0
- package/dist/write/clear-reminder.js +24 -21
- package/dist/write/clear-reminder.js.map +1 -1
- package/dist/write/commands.js +50 -45
- package/dist/write/commands.js.map +1 -1
- package/dist/write/completion-context.d.ts +57 -0
- package/dist/write/completion-context.js +49 -0
- package/dist/write/completion-context.js.map +1 -0
- package/dist/write/failure-hints.d.ts +10 -1
- package/dist/write/failure-hints.js +8 -0
- package/dist/write/failure-hints.js.map +1 -1
- package/dist/write/guards.d.ts +1 -1
- package/dist/write/guards.js +10 -0
- package/dist/write/guards.js.map +1 -1
- package/dist/write/operations.d.ts +12 -3
- package/dist/write/pipeline.d.ts +39 -0
- package/dist/write/pipeline.js +230 -17
- package/dist/write/pipeline.js.map +1 -1
- package/dist/write/pre-state.d.ts +1 -1
- package/dist/write/pre-state.js +2 -2
- package/dist/write/pre-state.js.map +1 -1
- package/dist/write/promote-clone.js +260 -13
- package/dist/write/promote-clone.js.map +1 -1
- package/dist/write/repeat-anchor.d.ts +110 -0
- package/dist/write/repeat-anchor.js +238 -0
- package/dist/write/repeat-anchor.js.map +1 -0
- package/dist/write/repeat-asserts.d.ts +28 -0
- package/dist/write/repeat-asserts.js +169 -0
- package/dist/write/repeat-asserts.js.map +1 -0
- package/dist/write/repeat-rule.js +27 -12
- package/dist/write/repeat-rule.js.map +1 -1
- package/dist/write/vectors/session-reachability.d.ts +78 -0
- package/dist/write/vectors/session-reachability.js +103 -0
- package/dist/write/vectors/session-reachability.js.map +1 -0
- package/dist/write/vectors/simulator.js +68 -29
- package/dist/write/vectors/simulator.js.map +1 -1
- package/dist/write/vectors/types.d.ts +117 -10
- package/dist/write/vectors/ui-recipes.d.ts +8 -0
- package/dist/write/vectors/ui-recipes.js +120 -22
- package/dist/write/vectors/ui-recipes.js.map +1 -1
- package/dist/write/vectors/ui.d.ts +79 -13
- package/dist/write/vectors/ui.js +415 -59
- package/dist/write/vectors/ui.js.map +1 -1
- package/dist/write/verify/delta.d.ts +12 -14
- package/dist/write/verify/delta.js +35 -34
- package/dist/write/verify/delta.js.map +1 -1
- package/package.json +1 -1
- package/schema/envelope.schema.json +22 -0
- package/skills/things-cli/SKILL.md +5 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracer.js","sourceRoot":"","sources":["../../src/trace/tracer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;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AAG,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -8,13 +8,10 @@ const SET_DETAIL_PROXY = "things-proxy-set-detail";
|
|
|
8
8
|
export async function runClearReminder(deps, params, options = {}) {
|
|
9
9
|
const uuid = resolveTaskUuidPrefix(deps.db, params.uuid);
|
|
10
10
|
const forced = options.vector;
|
|
11
|
-
// Dry-run previews the primary (atomic Shortcuts) plan unless the caller
|
|
12
|
-
// forces the URL bounce — cheap and host-independent (no proxy probe).
|
|
13
|
-
if (options.dryRun === true && forced !== "url-scheme") {
|
|
14
|
-
return runMutation(deps, "todo.clear-dated-reminder", { uuid }, { ...options, vector: "shortcuts" });
|
|
15
|
-
}
|
|
16
11
|
// Uniform pre-checks (no reminder to clear / wrong target type) via the op's
|
|
17
|
-
// own hazard set — identical result whichever path we'd pick
|
|
12
|
+
// own hazard set — identical result whichever path we'd pick, and evaluated
|
|
13
|
+
// for dry-run too so a preview surfaces the same block. Host-independent (DB
|
|
14
|
+
// reads only; no proxy probe).
|
|
18
15
|
const target = loadTarget(deps.db, uuid);
|
|
19
16
|
const pre = emptyPreState();
|
|
20
17
|
pre.target = target;
|
|
@@ -39,8 +36,17 @@ export async function runClearReminder(deps, params, options = {}) {
|
|
|
39
36
|
remediation: block.remediation,
|
|
40
37
|
};
|
|
41
38
|
}
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
// A repeating TEMPLATE's reminder is a repeat-RULE property. On 3.22.12 (RRX1)
|
|
40
|
+
// it IS stored in the `reminderTime` column on the template AND its spawned
|
|
41
|
+
// instances, but NO automation surface can clear it in place: the Shortcuts
|
|
42
|
+
// `set-detail Reminder Time=""` is a silent no-op (proxy exits 0, the column is
|
|
43
|
+
// unchanged), the AppleScript de-schedule is refused (error 301), and a URL
|
|
44
|
+
// when= bounce CRASHES Things (§1). Earlier (RCLEAR / 3.22.11) the template's
|
|
45
|
+
// reminderTime was NULL, so H-NO-REMINDER caught this; now that the column
|
|
46
|
+
// carries a real value the op must refuse EXPLICITLY, else the Shortcuts path
|
|
47
|
+
// no-ops and the op verify-fails. (A reminderLESS template was already caught
|
|
48
|
+
// by H-NO-REMINDER above; this only fires when the template has a reminder.)
|
|
49
|
+
if (isRepeatingTemplate(target)) {
|
|
44
50
|
appendClearAudit(deps, {
|
|
45
51
|
uuid,
|
|
46
52
|
startedAt: deps.now?.() ?? new Date(),
|
|
@@ -51,21 +57,18 @@ export async function runClearReminder(deps, params, options = {}) {
|
|
|
51
57
|
op: "todo.clear-dated-reminder",
|
|
52
58
|
reason: "hazard",
|
|
53
59
|
hazard: "H-REPEAT-SCHEDULE",
|
|
54
|
-
detail: "
|
|
55
|
-
"
|
|
56
|
-
|
|
60
|
+
detail: "this is a repeating series — its reminder is part of the repeat rule, and no automation " +
|
|
61
|
+
"surface can clear it in place (the Shortcuts clear silently does nothing, the AppleScript " +
|
|
62
|
+
"de-schedule is refused, and a URL re-schedule crashes the app)",
|
|
63
|
+
remediation: "change the reminder in the app's repeat editor",
|
|
57
64
|
};
|
|
58
65
|
}
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
? false
|
|
66
|
-
: repeating
|
|
67
|
-
? true
|
|
68
|
-
: proxiesInstalled(deps);
|
|
66
|
+
// Dry-run previews the atomic Shortcuts plan unless the caller forces the URL
|
|
67
|
+
// bounce — host-independent (no proxy probe).
|
|
68
|
+
if (options.dryRun === true && forced !== "url-scheme") {
|
|
69
|
+
return runMutation(deps, "todo.clear-dated-reminder", { uuid }, { ...options, vector: "shortcuts" });
|
|
70
|
+
}
|
|
71
|
+
const useShortcuts = forced === "shortcuts" ? true : forced === "url-scheme" ? false : proxiesInstalled(deps);
|
|
69
72
|
if (useShortcuts) {
|
|
70
73
|
return runMutation(deps, "todo.clear-dated-reminder", { uuid }, { ...options, vector: "shortcuts" });
|
|
71
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear-reminder.js","sourceRoot":"","sources":["../../src/write/clear-reminder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clear-reminder.js","sourceRoot":"","sources":["../../src/write/clear-reminder.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACL,gBAAgB,EAChB,WAAW,GAIZ,MAAM,eAAe,CAAC;AAEvB,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;AAEnD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,IAAe,EACf,MAAkB,EAClB,UAAwB,EAAE;IAE1B,MAAM,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAE9B,6EAA6E;IAC7E,4EAA4E;IAC5E,6EAA6E;IAC7E,+BAA+B;IAC/B,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACzC,MAAM,GAAG,GAAG,aAAa,EAAE,CAAC;IAC5B,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC,OAAO,EAAE;QAC1E,EAAE,EAAE,2BAA2B;QAC/B,MAAM,EAAE,EAAE,IAAI,EAAE;QAChB,GAAG;QACH,IAAI,EAAE,EAAE;KACT,CAAC,CAAC;IACH,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,gBAAgB,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8
8
|
import { PRIVATE_REORDER_COMMAND } from "./experimental.js";
|
|
9
9
|
import { assertRepeatRule } from "./repeat-rule.js";
|
|
10
|
+
import { deadlineDriveNext } from "./repeat-anchor.js";
|
|
11
|
+
import { expectedRuleAssertions } from "./repeat-asserts.js";
|
|
10
12
|
import { escapeAppleScript } from "./vectors/applescript.js";
|
|
11
13
|
import { areaReorderSidebarRecipe, convertToProjectRecipe, dissolveHeadingRecipe, headingConvertToProjectRecipe, moveHeadingToProjectRecipe, makeRepeatingRecipe, pauseRepeatRecipe, projectMakeRepeatingRecipe, projectPauseRepeatRecipe, projectRescheduleRepeatRecipe, projectResumeRepeatRecipe, rescheduleRepeatRecipe, resumeRepeatRecipe, } from "./vectors/ui-recipes.js";
|
|
12
14
|
import { buildRepeatingFingerprint } from "./verify/delta.js";
|
|
@@ -455,9 +457,12 @@ function statusSpec(op, urlParam, asStatus, scriptStatus) {
|
|
|
455
457
|
return {
|
|
456
458
|
op,
|
|
457
459
|
hazards: ["H-UNKNOWN-DESTINATION", "H-REPEAT-SCHEDULE"],
|
|
458
|
-
preRead(db, params) {
|
|
460
|
+
preRead(db, params, now, zone) {
|
|
459
461
|
const pre = emptyPreState();
|
|
460
|
-
|
|
462
|
+
// Load under the response clock so the target's Today marker (read by the
|
|
463
|
+
// HINTS1 completion-context) reflects the same calendar day the pipeline
|
|
464
|
+
// verifies under, not the host wall clock.
|
|
465
|
+
pre.target = loadTarget(db, params.uuid, now, zone);
|
|
461
466
|
return pre;
|
|
462
467
|
},
|
|
463
468
|
expectedDelta(_pre, params) {
|
|
@@ -1912,8 +1917,23 @@ function ruleExtras(params) {
|
|
|
1912
1917
|
...(params.reminder !== undefined && { reminder: params.reminder }),
|
|
1913
1918
|
...(params.deadline !== undefined && { deadline: params.deadline }),
|
|
1914
1919
|
...(params.startDaysEarlier !== undefined && { startDaysEarlier: params.startDaysEarlier }),
|
|
1920
|
+
...(params.next !== undefined && { next: params.next }),
|
|
1915
1921
|
};
|
|
1916
1922
|
}
|
|
1923
|
+
/**
|
|
1924
|
+
* Recipe extras for a RESCHEDULE, with the "Next:" drive date deadline-adjusted
|
|
1925
|
+
* (YANCH1 #493): `--when` is the scheduled START, but a deadlined rule anchors on
|
|
1926
|
+
* the DEADLINE, so the dialog's "Next:" field is driven with `when +
|
|
1927
|
+
* startDaysEarlier` and the app back-shifts the instance start to `--when`. The
|
|
1928
|
+
* expectedDelta keeps the RAW `params.next` (the cursor asserts the START).
|
|
1929
|
+
* make/add-repeating apply this shift upstream (promote-clone.ts) and pass an
|
|
1930
|
+
* already-adjusted rule, so only the reschedule compile needs it here.
|
|
1931
|
+
*/
|
|
1932
|
+
function reschedRuleExtras(params) {
|
|
1933
|
+
const base = ruleExtras(params);
|
|
1934
|
+
const drive = deadlineDriveNext(params);
|
|
1935
|
+
return drive !== undefined ? { ...base, next: drive } : base;
|
|
1936
|
+
}
|
|
1917
1937
|
/** ui ops all guard existence/type + the H-UI-DRIVE acknowledgement. */
|
|
1918
1938
|
const UI_HAZARDS = ["H-UNKNOWN-DESTINATION", "H-UI-DRIVE"];
|
|
1919
1939
|
const todoMakeRepeating = {
|
|
@@ -1934,9 +1954,12 @@ const todoMakeRepeating = {
|
|
|
1934
1954
|
// rows), pick it by asserting it IS a template, then the `repeating` context
|
|
1935
1955
|
// hardens discovery (restored time-bound, source-fingerprint tiebreak) and
|
|
1936
1956
|
// derives instance + source fate for the enriched result. `expectedRule`
|
|
1937
|
-
// makes the LANDED rule verifiable: a template minted
|
|
1938
|
-
// frequency/interval (the interval-field race, oddities §8l)
|
|
1939
|
-
// verify-failed:mismatch instead
|
|
1957
|
+
// makes the LANDED rule verifiable at FULL fidelity (#491): a template minted
|
|
1958
|
+
// with the wrong frequency/interval (the interval-field race, oddities §8l) OR
|
|
1959
|
+
// a dropped anchor / ends / deadline becomes a verify-failed:mismatch instead
|
|
1960
|
+
// of a silent ok. includeCursor:false — the fresh template's cursor follows
|
|
1961
|
+
// the app's spawn law (ANCH1), not the raw --when, so make verifies the rule
|
|
1962
|
+
// BLOB + deadline, not the cursor.
|
|
1940
1963
|
return {
|
|
1941
1964
|
mode: "create",
|
|
1942
1965
|
probe: {
|
|
@@ -1948,11 +1971,7 @@ const todoMakeRepeating = {
|
|
|
1948
1971
|
repeating: {
|
|
1949
1972
|
sourceUuid: pre.target.uuid,
|
|
1950
1973
|
fingerprint: buildRepeatingFingerprint(pre.target),
|
|
1951
|
-
expectedRule: {
|
|
1952
|
-
type: params.afterCompletion === true ? "after-completion" : "fixed",
|
|
1953
|
-
unit: params.frequency,
|
|
1954
|
-
interval: params.interval,
|
|
1955
|
-
},
|
|
1974
|
+
expectedRule: expectedRuleAssertions(params, { includeCursor: false }),
|
|
1956
1975
|
},
|
|
1957
1976
|
}),
|
|
1958
1977
|
},
|
|
@@ -1975,33 +1994,26 @@ const todoRescheduleRepeat = {
|
|
|
1975
1994
|
return pre;
|
|
1976
1995
|
},
|
|
1977
1996
|
expectedDelta(_pre, params) {
|
|
1978
|
-
// Identity PRESERVED (UI2-b): the same template uuid, rule mutated in
|
|
1979
|
-
//
|
|
1980
|
-
//
|
|
1981
|
-
//
|
|
1982
|
-
//
|
|
1983
|
-
//
|
|
1984
|
-
//
|
|
1985
|
-
//
|
|
1986
|
-
//
|
|
1997
|
+
// Identity PRESERVED (UI2-b): the same template uuid, rule mutated in place.
|
|
1998
|
+
// Assert the FULL requested rule (#491) — type + unit + interval + calendar
|
|
1999
|
+
// anchor + ends bound + deadline offset + the ANCH2 first-occurrence cursor —
|
|
2000
|
+
// built from the complete vocabulary by expectedRuleAssertions so the pre-drive
|
|
2001
|
+
// idempotency check skips ONLY when EVERY requested field already holds, and
|
|
2002
|
+
// the post-drive verify catches a wrong-anchor landing. A shallow unit+interval
|
|
2003
|
+
// subset false-noop'd a reschedule that changed only the monthly anchor /
|
|
2004
|
+
// deadline / ends (#491). ALSO capture the whole prior rule (+ deadline flag)
|
|
2005
|
+
// so the undo can re-drive it faithfully.
|
|
1987
2006
|
return {
|
|
1988
2007
|
mode: "update",
|
|
1989
2008
|
uuid: params.uuid,
|
|
1990
|
-
assert:
|
|
1991
|
-
{
|
|
1992
|
-
field: "repeating.rule.type",
|
|
1993
|
-
equals: params.afterCompletion === true ? "after-completion" : "fixed",
|
|
1994
|
-
},
|
|
1995
|
-
{ field: "repeating.rule.unit", equals: params.frequency },
|
|
1996
|
-
{ field: "repeating.rule.interval", equals: params.interval },
|
|
1997
|
-
],
|
|
2009
|
+
assert: expectedRuleAssertions(params, { includeCursor: true }),
|
|
1998
2010
|
capture: [{ field: "repeating.rule" }, { field: "repeating.deadlined" }],
|
|
1999
2011
|
};
|
|
2000
2012
|
},
|
|
2001
2013
|
compile(params, vector) {
|
|
2002
2014
|
if (vector !== "ui")
|
|
2003
2015
|
unsupportedVector(this.op, vector);
|
|
2004
|
-
return uiDrive(rescheduleRepeatRecipe(params.uuid, params.frequency, params.interval,
|
|
2016
|
+
return uiDrive(rescheduleRepeatRecipe(params.uuid, params.frequency, params.interval, reschedRuleExtras(params)));
|
|
2005
2017
|
},
|
|
2006
2018
|
};
|
|
2007
2019
|
const todoPauseRepeat = {
|
|
@@ -2066,26 +2078,20 @@ const projectRescheduleRepeat = {
|
|
|
2066
2078
|
expectedDelta(_pre, params) {
|
|
2067
2079
|
// Identity PRESERVED (UIC2-a): same project uuid, rule mutated in place;
|
|
2068
2080
|
// capture the prior rule (+ deadline flag) for the faithful undo. Assert the
|
|
2069
|
-
//
|
|
2070
|
-
// unit+interval
|
|
2081
|
+
// FULL requested rule (#491) via expectedRuleAssertions — same completeness as
|
|
2082
|
+
// todo.reschedule-repeat (a shallow unit+interval subset false-noop'd an
|
|
2083
|
+
// anchor/deadline/ends-only reschedule).
|
|
2071
2084
|
return {
|
|
2072
2085
|
mode: "update",
|
|
2073
2086
|
uuid: params.uuid,
|
|
2074
|
-
assert:
|
|
2075
|
-
{
|
|
2076
|
-
field: "repeating.rule.type",
|
|
2077
|
-
equals: params.afterCompletion === true ? "after-completion" : "fixed",
|
|
2078
|
-
},
|
|
2079
|
-
{ field: "repeating.rule.unit", equals: params.frequency },
|
|
2080
|
-
{ field: "repeating.rule.interval", equals: params.interval },
|
|
2081
|
-
],
|
|
2087
|
+
assert: expectedRuleAssertions(params, { includeCursor: true }),
|
|
2082
2088
|
capture: [{ field: "repeating.rule" }, { field: "repeating.deadlined" }],
|
|
2083
2089
|
};
|
|
2084
2090
|
},
|
|
2085
2091
|
compile(params, vector) {
|
|
2086
2092
|
if (vector !== "ui")
|
|
2087
2093
|
unsupportedVector(this.op, vector);
|
|
2088
|
-
return uiDrive(projectRescheduleRepeatRecipe(params.uuid, params.frequency, params.interval,
|
|
2094
|
+
return uiDrive(projectRescheduleRepeatRecipe(params.uuid, params.frequency, params.interval, reschedRuleExtras(params)));
|
|
2089
2095
|
},
|
|
2090
2096
|
};
|
|
2091
2097
|
const projectPauseRepeat = {
|
|
@@ -2158,7 +2164,10 @@ const projectMakeRepeating = {
|
|
|
2158
2164
|
// the current-occurrence instance. Pick the TEMPLATE by asserting it IS one,
|
|
2159
2165
|
// excluding pre-existing same-title rows; the `repeating` context hardens
|
|
2160
2166
|
// discovery and derives instance + source fate + childrenReplaced.
|
|
2161
|
-
// `expectedRule` makes the landed rule verifiable
|
|
2167
|
+
// `expectedRule` makes the landed rule verifiable at FULL fidelity (#491):
|
|
2168
|
+
// a wrong frequency/interval (interval-race §8l) OR a dropped anchor/ends/
|
|
2169
|
+
// deadline is a mismatch, not a silent ok. includeCursor:false — the fresh
|
|
2170
|
+
// template's cursor follows the ANCH1 spawn law, not the raw --when.
|
|
2162
2171
|
return {
|
|
2163
2172
|
mode: "create",
|
|
2164
2173
|
probe: {
|
|
@@ -2171,11 +2180,7 @@ const projectMakeRepeating = {
|
|
|
2171
2180
|
sourceUuid: pre.target.uuid,
|
|
2172
2181
|
fingerprint: buildRepeatingFingerprint(pre.target),
|
|
2173
2182
|
subtreeUuids: pre.repeatSubtreeUuids ?? [],
|
|
2174
|
-
expectedRule: {
|
|
2175
|
-
type: params.afterCompletion === true ? "after-completion" : "fixed",
|
|
2176
|
-
unit: params.frequency,
|
|
2177
|
-
interval: params.interval,
|
|
2178
|
-
},
|
|
2183
|
+
expectedRule: expectedRuleAssertions(params, { includeCursor: false }),
|
|
2179
2184
|
},
|
|
2180
2185
|
}),
|
|
2181
2186
|
},
|