@wenathlan/extension 1.1.51 → 1.1.53
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 +7 -5
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1908 -200
- package/dist/index.js.map +4 -4
- package/dist/memory.d.ts +85 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/policy.d.ts +37 -1
- package/dist/policy.d.ts.map +1 -1
- package/dist/protocol.d.ts +139 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/trigger.d.ts +151 -0
- package/dist/trigger.d.ts.map +1 -0
- package/dist/types.d.ts +289 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/workflow.d.ts +19 -3
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workfloweditor.d.ts +108 -0
- package/dist/workfloweditor.d.ts.map +1 -0
- package/extension/dist/background.js +2306 -20
- package/extension/dist/background.js.map +4 -4
- package/extension/dist/manifest.json +1 -1
- package/extension/dist/pagebridge.js +1 -1
- package/extension/dist/pagebridge.js.map +2 -2
- package/extension/dist/popup.html +1 -1
- package/extension/dist/popup.js +24 -1
- package/extension/dist/popup.js.map +2 -2
- package/extension/dist/sidepanel.html +1 -1
- package/extension/dist/sidepanel.js +1442 -1
- package/extension/dist/sidepanel.js.map +4 -4
- package/extension/dist/style.css +2 -0
- package/extension/manifest.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import type { manualrun, rulestats, triggerfamily, triggerfire, triggerstate, triggerule, workflowrecord } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Trigger and scheduling engine for the 1.1.52 family.
|
|
4
|
+
* Every correlated rule of the trigger phase lives in this file: the trigger family and kind lists, the family payload normalizers, the five field cron parser with named weekdays and months and its timezone aware next fire computation, the interval scheduler that spreads repeated fires with the configured seeded jitter, the glob url matcher with ports, the visit origin matcher, the cooldown suppressor, the dedupe and queue discipline that keeps one pending fire per rule while a run is active, the url list planner that starts one run per url, the webhook verifier of the shared secret and payload schema, the observed event catalog matcher, the pause and resume suspension with the resume drain, the trigger evaluation that skips disabled, paused, unreviewed or cooled down rules, the manual run step preview with its confirmation outcome and the rule summaries the review panel renders.
|
|
5
|
+
* The engine stays pure: the launch of a run flows through the injected launch seam so tests run on plain fixtures, and no trigger fires outside the consent gates — every rule is reviewed before it arms and every launch re-passes the session, plan and origin gates.
|
|
6
|
+
*/
|
|
7
|
+
/** The trigger kinds of the 1.1.52 family: one kind per trigger rule family, each arming its rule behind the explicit arm review. */
|
|
8
|
+
export declare const triggerkinds: string[];
|
|
9
|
+
/** The trigger rule families the engine matches, schedules and observes. */
|
|
10
|
+
export declare const triggerfamilies: triggerfamily[];
|
|
11
|
+
/** The observed page event catalog event rules subscribe to: the mutation, focus, banner, console, error and navigation observations the extension already watches. */
|
|
12
|
+
export declare const triggereventcatalog: string[];
|
|
13
|
+
/** The documented default cooldown window of the webhook and event families when the review configures none; it is a documented default, never a cap, and any user configured window wins. */
|
|
14
|
+
export declare const defaulttriggercooldown = 10000;
|
|
15
|
+
/** True when the kind belongs to the trigger family of the 1.1.52 release. */
|
|
16
|
+
export declare function istriggerkind(kind: string): boolean;
|
|
17
|
+
/** Maps one trigger action kind to its rule family. */
|
|
18
|
+
export declare function triggerfamilyof(kind: string): triggerfamily | undefined;
|
|
19
|
+
/** Normalizes one family payload of a trigger rule and returns the family specific fields; the shared workflowid, cooldown and review flag stay with the caller. */
|
|
20
|
+
export declare function triggerpayloadof(family: triggerfamily, value: unknown): Partial<triggerule> | undefined;
|
|
21
|
+
/** True when a webhook shared secret clears the documented entropy floor: at least twenty four characters mixing letters and digits; the floor is a floor, not a cap, and any longer secret wins. */
|
|
22
|
+
export declare function webhooksecretok(secret: string): boolean;
|
|
23
|
+
/** True when the timezone name resolves through the runtime timezone database. */
|
|
24
|
+
export declare function timezonevalid(timezone: string): boolean;
|
|
25
|
+
/** Builds one armed trigger rule from the reviewed arm payload: the family normalizer validates the match fields, the effective cooldown applies the documented default of the webhook and event families and the rule starts enabled with zeroed counters. */
|
|
26
|
+
export declare function armrule(input: {
|
|
27
|
+
id?: string;
|
|
28
|
+
family: triggerfamily;
|
|
29
|
+
workflowid: string;
|
|
30
|
+
label?: string;
|
|
31
|
+
payload: unknown;
|
|
32
|
+
cooldown?: number;
|
|
33
|
+
now: number;
|
|
34
|
+
}): triggerule | undefined;
|
|
35
|
+
/** The shared state of one rule update so enable, disable, pause, resume and fire bookkeeping stay immutable. */
|
|
36
|
+
export declare function updaterule(rule: triggerule, patch: {
|
|
37
|
+
state?: Partial<triggerstate>;
|
|
38
|
+
stats?: Partial<rulestats>;
|
|
39
|
+
}): triggerule;
|
|
40
|
+
/** Matches one glob url pattern against one navigation url: the schemes and hostnames must agree, an explicit pattern port must match while an absent port matches any port, and the path plus query glob accepts `*` inside one segment and `**` across segments. */
|
|
41
|
+
export declare function matchurl(pattern: string, url: string): boolean;
|
|
42
|
+
/** True when a navigation url lands on one of the reviewed origins of a visit rule. */
|
|
43
|
+
export declare function visitmatch(origins: string[], url: string): boolean;
|
|
44
|
+
/** The five field cron parser: minute, hour, day of month, month and day of week accept `*`, lists, ranges and steps, and named weekdays (sun to sat) and months (jan to dec); day of week accepts zero and seven as sunday. */
|
|
45
|
+
export declare function cronparse(expression: string): {
|
|
46
|
+
minutes: number[];
|
|
47
|
+
hours: number[];
|
|
48
|
+
daysofmonth: number[];
|
|
49
|
+
months: number[];
|
|
50
|
+
daysofweek: number[];
|
|
51
|
+
} | undefined;
|
|
52
|
+
/** Computes the next fire time of a five field cron expression strictly after the given time: minute boundaries in UTC or the reviewed timezone; a schedule that never fires inside the four year horizon returns undefined so the honest no fire outcome travels on. */
|
|
53
|
+
export declare function cronnext(expression: string, from: number, timezone?: string): number | undefined;
|
|
54
|
+
/** Computes the next fire time of a cron rule strictly after the given time. */
|
|
55
|
+
export declare function schedulecron(rule: {
|
|
56
|
+
cron: string;
|
|
57
|
+
timezone?: string;
|
|
58
|
+
}, from: number): number | undefined;
|
|
59
|
+
/** Computes the next fire time of an interval rule: the reviewed period after the last fire (or the arm time of the first pass) spread with the seeded jitter window so repeated fires never bunch at the minimum. */
|
|
60
|
+
export declare function scheduleinterval(rule: {
|
|
61
|
+
period: number;
|
|
62
|
+
jitter?: number;
|
|
63
|
+
}, lastfire: number | undefined, armedat: number, seed: number): number;
|
|
64
|
+
/** Returns every scheduled rule whose next fire time has passed; the alarm wake and the opportunistic service worker wakes drain this list. */
|
|
65
|
+
export declare function listdue(rules: triggerule[], now: number): Array<{
|
|
66
|
+
rule: triggerule;
|
|
67
|
+
overdueby: number;
|
|
68
|
+
}>;
|
|
69
|
+
/** Applies the cooldown window of one rule: a fire inside the window after the last fire is suppressed with the remaining window, a fire at or after it passes. */
|
|
70
|
+
export declare function applycooldown(rule: triggerule, now: number): {
|
|
71
|
+
suppressed: boolean;
|
|
72
|
+
remaining: number;
|
|
73
|
+
};
|
|
74
|
+
/** The outcome of one trigger evaluation: the launch plan when the rule fires or the honest suppression reason. */
|
|
75
|
+
export interface triggerdecision {
|
|
76
|
+
fired: boolean;
|
|
77
|
+
suppressed?: string;
|
|
78
|
+
remaining?: number;
|
|
79
|
+
fire?: triggerfire;
|
|
80
|
+
}
|
|
81
|
+
/** Evaluates one armed rule against one observation: disabled, paused and rules whose workflow lost its approved review never fire, a run of the same workflow already active dedupes, the cooldown window suppresses and every passing fire carries the triggering url, title and payload into the run context. */
|
|
82
|
+
export declare function evaluatetrigger(input: {
|
|
83
|
+
rule: triggerule;
|
|
84
|
+
now: number;
|
|
85
|
+
cause: string;
|
|
86
|
+
url?: string;
|
|
87
|
+
title?: string;
|
|
88
|
+
payload?: Record<string, unknown>;
|
|
89
|
+
runactive: boolean;
|
|
90
|
+
workflowreviewed: boolean;
|
|
91
|
+
}): triggerdecision;
|
|
92
|
+
/** Queues one fire that arrived while the target run or tab was busy; the queue keeps one pending fire per rule so repeated observations dedupe instead of piling up. */
|
|
93
|
+
export declare function queuefire(queue: triggerfire[], fire: triggerfire): {
|
|
94
|
+
queue: triggerfire[];
|
|
95
|
+
queued: boolean;
|
|
96
|
+
deduped: boolean;
|
|
97
|
+
};
|
|
98
|
+
/** Drains the queued fires in arrival order through the injected launch seam; a launch that throws leaves the failed fire and the remaining queue intact so the next wake retries it. */
|
|
99
|
+
export declare function drainqueue(queue: triggerfire[], launch: (fire: triggerfire) => Promise<void>): Promise<{
|
|
100
|
+
launched: number;
|
|
101
|
+
remaining: triggerfire[];
|
|
102
|
+
}>;
|
|
103
|
+
/** Plans one run per url of a url list rule: every url becomes its own trigger fire carrying the url into the run context; nothing is capped in code. */
|
|
104
|
+
export declare function runurllist(rule: triggerule, now: number): triggerfire[];
|
|
105
|
+
/** Verifies one webhook delivery: the shared secret must equal the reviewed secret compared character by character without early exit and the payload must satisfy every required schema field of its reviewed kind; only verified payloads persist. */
|
|
106
|
+
export declare function verifywebhook(input: {
|
|
107
|
+
rule: triggerule;
|
|
108
|
+
secret: string;
|
|
109
|
+
payload: unknown;
|
|
110
|
+
}): {
|
|
111
|
+
verified: boolean;
|
|
112
|
+
reason?: string;
|
|
113
|
+
};
|
|
114
|
+
/** True when one observed page event name matches an event rule subscription of the observed event catalog. */
|
|
115
|
+
export declare function eventrulematches(rule: triggerule, event: string): boolean;
|
|
116
|
+
/** Subscribes the armed event rules to one observed page event: returns every enabled, unpaused event rule whose subscription list names the event of the observed catalog, so the page observation seam (watched mutations, focus shifts, banners, console output, captured errors and navigations) can fire exactly those rules. */
|
|
117
|
+
export declare function observeevents(rules: triggerule[], event: string): triggerule[];
|
|
118
|
+
/** Suspends every enabled rule by setting its pause marker so session pauses hold fires instead of losing them. */
|
|
119
|
+
export declare function pauseall(rules: triggerule[], now: number): triggerule[];
|
|
120
|
+
/** Clears the pause marker of every rule so the resume drains the queued fires through the same gates. */
|
|
121
|
+
export declare function resumeall(rules: triggerule[]): triggerule[];
|
|
122
|
+
/** Builds the manual run step preview of one composed workflow: every expanded step with its kind, label, block and control summary so a human always sees what a run will do before confirming it. */
|
|
123
|
+
export declare function manualpreview(record: workflowrecord, now: number): manualrun;
|
|
124
|
+
/** Records the confirmation outcome of one manual run preview; an undecided preview keeps its confirmation open. */
|
|
125
|
+
export declare function confirmmanualrun(preview: manualrun, confirmed: boolean, now: number): manualrun;
|
|
126
|
+
/** Builds the review summary of one armed rule for the trigger list: the family, the match fields, the workflow reference, the effective cooldown and the schedule. */
|
|
127
|
+
export declare function triggersummary(rule: triggerule): {
|
|
128
|
+
kind: triggerfamily;
|
|
129
|
+
workflowid: string;
|
|
130
|
+
label: string;
|
|
131
|
+
origins?: string[];
|
|
132
|
+
pattern?: string;
|
|
133
|
+
title?: string;
|
|
134
|
+
command?: string;
|
|
135
|
+
key?: string;
|
|
136
|
+
cron?: string;
|
|
137
|
+
timezone?: string;
|
|
138
|
+
period?: number;
|
|
139
|
+
jitter?: number;
|
|
140
|
+
urls?: string[];
|
|
141
|
+
events?: string[];
|
|
142
|
+
fields?: number;
|
|
143
|
+
cooldown: number;
|
|
144
|
+
enabled: boolean;
|
|
145
|
+
nextfireat?: number;
|
|
146
|
+
};
|
|
147
|
+
/** Returns every origin a rule touches so the arm review and the fire gates can check them against the workflow grants: visit origins, the url pattern origin, the url list origins and the webhook delivery origin stay inside the workflow grant list. */
|
|
148
|
+
export declare function ruleorigins(rule: triggerule): string[];
|
|
149
|
+
/** True when every origin a rule touches stays inside the granted origin list of its workflow. */
|
|
150
|
+
export declare function ruleoriginsgranted(rule: triggerule, workfloworigins: string[]): boolean;
|
|
151
|
+
//# sourceMappingURL=trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../trigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAgB,cAAc,EAAE,MA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AAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAmBnX;AAED,4PAA4P;AAC5P,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,CAMtD;AAED,kGAAkG;AAClG,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,OAAO,CAGvF"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare const protocolversion: "1.1.
|
|
1
|
+
export declare const protocolversion: "1.1.53";
|
|
2
2
|
/** Every reviewed action kind. Read kinds observe, interaction kinds move focus, sensitive kinds change page or browser state. */
|
|
3
|
-
export type actionkind = "observe" | "inspect" | "extract" | "wait" | "waitfor" | "waittext" | "readattribute" | "readstyle" | "readgeometry" | "readvalue" | "readtext" | "readhtml" | "countelements" | "readtable" | "readlinks" | "readimages" | "readmeta" | "readforms" | "readstorage" | "highlight" | "tablist" | "windowlist" | "tabsnapshot" | "focus" | "scroll" | "hover" | "clickdeep" | "rightclick" | "doubleclick" | "scrollpage" | "scrollby" | "scrollend" | "scrolltop" | "fullscreen" | "zoomset" | "click" | "type" | "navigate" | "select" | "presskey" | "drag" | "drop" | "upload" | "clear" | "check" | "uncheck" | "toggle" | "submit" | "reload" | "back" | "forward" | "writestorage" | "setattribute" | "removeattribute" | "evaluate" | "tabcreate" | "tabactivate" | "tabclose" | "tabreload" | "windowcreate" | "windowclose" | "windowresize" | "downloadfile" | "movepointer" | "clickpoint" | "shiftclick" | "clicktext" | "clickaria" | "clickname" | "resolvexpath" | "typetime" | "appendtext" | "setvalue" | "typeedit" | "keyhold" | "keyrelease" | "submitsearch" | "selectmulti" | "chooseradio" | "setslider" | "setdate" | "setcolor" | "expanddetails" | "dismissdialog" | "pierceshadow" | "enterframe" | "retryaction" | "mapclicks" | "verifyvisible" | "verifyenabled" | "a11ytree" | "readvisible" | "readertree" | "detectlists" | "detecttables" | "readjson" | "watchmutate" | "waitquiet" | "watchbanner" | "detectinfinitescroll" | "detectvirtual" | "detectlazy" | "readscrollpos" | "readlang" | "readoutline" | "countpages" | "listshadow" | "listframes" | "classifypage" | "fingerprintsection" | "diffsnapshots" | "readselection" | "watchfocus" | "detectsticky" | "detectscrolllock" | "readopengraph" | "detectlanguage" | "deriveselector" | "openlink" | "openprivate" | "reloadcache" | "stopnav" | "waitload" | "waiturl" | "followlink" | "spanav" | "spawait" | "rewritequery" | "setfragment" | "navlist" | "navprofile" | "detecthttp" | "readredirects" | "readfinalurl" | "handleauth" | "printpdf" | "prefetch" | "preconnect" | "deeplink" | "reopentab" | "trailaudit" | "pausenav" | "navintent" | "navrate" | "openclipboard" | "checksafe" | "batchopen" | "querytabs" | "duplicatetab" | "closepattern" | "pintab" | "mutetab" | "movetab" | "movetabwindow" | "grouptabs" | "colorgroup" | "collapsegroup" | "discardtab" | "reloadtabs" | "zoomin" | "zoomout" | "watchtab" | "switchtab" | "maximizewindow" | "minimizewindow" | "restorewindow" | "focuswindow" | "scratchwindow" | "incognitowindow" | "restoretab" | "savelayout" | "restorelayout" | "findclones" | "searchtabs" | "badgetab" | "attachmeta" | "listaudio" | "reopenrun" | "snapshotsession" | "fillform" | "filllabel" | "fillplaceholder" | "detectfields" | "generatevalues" | "saveprofiles" | "asksubmit" | "submitform" | "readerrors" | "retryform" | "runwizard" | "selectchain" | "picktypeahead" | "pickdate" | "attachfile" | "handoffcaptcha" | "fillcard" | "fillcode" | "consentpassword" | "skiphoneypot" | "detectlogin" | "detecttemplate" | "scrapetable" | "exportcsv" | "exportjson" | "exportexcel" | "copytable" | "pushsheets" | "importcsv" | "looprows" | "transformvalues" | "deduperows" | "paginateextract" | "mergepages" | "stamplerows" | "previewgrid" | "streamdisk" | "resumeextract" | "logprovenance" | "batchdownload" | "pausedownload" | "resumedownload" | "verifydownload" | "interceptmime" | "exportnetlog" | "readclipboard" | "writeclipboard" | "copyscreen" | "quarantinedownload" | "scanvirus" | "namecaptures" | "cleanupartifacts" | "shotview" | "shotfullpage" | "shotelement" | "shotregion" | "contactsheet" | "capturepdf" | "recordscreen" | "captureaudio" | "captureframe" | "downloadimages" | "shotcanvas" | "probestream" | "readmedia" | "readassets" | "timelapse" | "convertimage" | "makethumbs" | "fetchurl" | "parsejson" | "parsehtml" | "callrest" | "callgraphql" | "opensocket" | "sendmessage" | "waitmessage" | "watchrequests" | "readheaders" | "capturebodies" | "subscribesse" | "longpoll" | "mapapi" | "extractapi" | "blockrequest" | "mockresponse" | "rewriteheaders" | "setcookies" | "readcookies" | "clearcookies" | "authflow" | "saveapikey" | "routeproxy" | "postform" | "postfiles" | "watchconsole" | "watcherrors" | "watchtasks" | "attachcdp" | "detachcdp" | "cdpcmd" | "watchcdp" | "setbreakpoint" | "stepcode" | "watchexpr" | "overridescript" | "measureflow" | "heapshot" | "trackmemory" | "profilecpu" | "watchshifts" | "traceload" | "annotatetrace" | "replaytrace" | "capturesourcemaps" | "emulatedevice" | "emulatenetwork" | "emulatelocate" | "setuseragent" | "overridepermission" | "blackboxscripts" | "persiststate" | "capturesession" | "restoresession" | "namedsessions" | "diffsessions" | "searchsessions" | "exportsessions" | "importsessions" | "composeworkflow" | "savetemplate" | "runworkflow" | "dryrun" | "delay" | "waitelement" | "compute" | "extractvars" | "condition" | "branch" | "loop" | "repeatuntil" | "whileloop" | "foreach" | "parallel" | "trycatch";
|
|
3
|
+
export type actionkind = "observe" | "inspect" | "extract" | "wait" | "waitfor" | "waittext" | "readattribute" | "readstyle" | "readgeometry" | "readvalue" | "readtext" | "readhtml" | "countelements" | "readtable" | "readlinks" | "readimages" | "readmeta" | "readforms" | "readstorage" | "highlight" | "tablist" | "windowlist" | "tabsnapshot" | "focus" | "scroll" | "hover" | "clickdeep" | "rightclick" | "doubleclick" | "scrollpage" | "scrollby" | "scrollend" | "scrolltop" | "fullscreen" | "zoomset" | "click" | "type" | "navigate" | "select" | "presskey" | "drag" | "drop" | "upload" | "clear" | "check" | "uncheck" | "toggle" | "submit" | "reload" | "back" | "forward" | "writestorage" | "setattribute" | "removeattribute" | "evaluate" | "tabcreate" | "tabactivate" | "tabclose" | "tabreload" | "windowcreate" | "windowclose" | "windowresize" | "downloadfile" | "movepointer" | "clickpoint" | "shiftclick" | "clicktext" | "clickaria" | "clickname" | "resolvexpath" | "typetime" | "appendtext" | "setvalue" | "typeedit" | "keyhold" | "keyrelease" | "submitsearch" | "selectmulti" | "chooseradio" | "setslider" | "setdate" | "setcolor" | "expanddetails" | "dismissdialog" | "pierceshadow" | "enterframe" | "retryaction" | "mapclicks" | "verifyvisible" | "verifyenabled" | "a11ytree" | "readvisible" | "readertree" | "detectlists" | "detecttables" | "readjson" | "watchmutate" | "waitquiet" | "watchbanner" | "detectinfinitescroll" | "detectvirtual" | "detectlazy" | "readscrollpos" | "readlang" | "readoutline" | "countpages" | "listshadow" | "listframes" | "classifypage" | "fingerprintsection" | "diffsnapshots" | "readselection" | "watchfocus" | "detectsticky" | "detectscrolllock" | "readopengraph" | "detectlanguage" | "deriveselector" | "openlink" | "openprivate" | "reloadcache" | "stopnav" | "waitload" | "waiturl" | "followlink" | "spanav" | "spawait" | "rewritequery" | "setfragment" | "navlist" | "navprofile" | "detecthttp" | "readredirects" | "readfinalurl" | "handleauth" | "printpdf" | "prefetch" | "preconnect" | "deeplink" | "reopentab" | "trailaudit" | "pausenav" | "navintent" | "navrate" | "openclipboard" | "checksafe" | "batchopen" | "querytabs" | "duplicatetab" | "closepattern" | "pintab" | "mutetab" | "movetab" | "movetabwindow" | "grouptabs" | "colorgroup" | "collapsegroup" | "discardtab" | "reloadtabs" | "zoomin" | "zoomout" | "watchtab" | "switchtab" | "maximizewindow" | "minimizewindow" | "restorewindow" | "focuswindow" | "scratchwindow" | "incognitowindow" | "restoretab" | "savelayout" | "restorelayout" | "findclones" | "searchtabs" | "badgetab" | "attachmeta" | "listaudio" | "reopenrun" | "snapshotsession" | "fillform" | "filllabel" | "fillplaceholder" | "detectfields" | "generatevalues" | "saveprofiles" | "asksubmit" | "submitform" | "readerrors" | "retryform" | "runwizard" | "selectchain" | "picktypeahead" | "pickdate" | "attachfile" | "handoffcaptcha" | "fillcard" | "fillcode" | "consentpassword" | "skiphoneypot" | "detectlogin" | "detecttemplate" | "scrapetable" | "exportcsv" | "exportjson" | "exportexcel" | "copytable" | "pushsheets" | "importcsv" | "looprows" | "transformvalues" | "deduperows" | "paginateextract" | "mergepages" | "stamplerows" | "previewgrid" | "streamdisk" | "resumeextract" | "logprovenance" | "batchdownload" | "pausedownload" | "resumedownload" | "verifydownload" | "interceptmime" | "exportnetlog" | "readclipboard" | "writeclipboard" | "copyscreen" | "quarantinedownload" | "scanvirus" | "namecaptures" | "cleanupartifacts" | "shotview" | "shotfullpage" | "shotelement" | "shotregion" | "contactsheet" | "capturepdf" | "recordscreen" | "captureaudio" | "captureframe" | "downloadimages" | "shotcanvas" | "probestream" | "readmedia" | "readassets" | "timelapse" | "convertimage" | "makethumbs" | "fetchurl" | "parsejson" | "parsehtml" | "callrest" | "callgraphql" | "opensocket" | "sendmessage" | "waitmessage" | "watchrequests" | "readheaders" | "capturebodies" | "subscribesse" | "longpoll" | "mapapi" | "extractapi" | "blockrequest" | "mockresponse" | "rewriteheaders" | "setcookies" | "readcookies" | "clearcookies" | "authflow" | "saveapikey" | "routeproxy" | "postform" | "postfiles" | "watchconsole" | "watcherrors" | "watchtasks" | "attachcdp" | "detachcdp" | "cdpcmd" | "watchcdp" | "setbreakpoint" | "stepcode" | "watchexpr" | "overridescript" | "measureflow" | "heapshot" | "trackmemory" | "profilecpu" | "watchshifts" | "traceload" | "annotatetrace" | "replaytrace" | "capturesourcemaps" | "emulatedevice" | "emulatenetwork" | "emulatelocate" | "setuseragent" | "overridepermission" | "blackboxscripts" | "persiststate" | "capturesession" | "restoresession" | "namedsessions" | "diffsessions" | "searchsessions" | "exportsessions" | "importsessions" | "composeworkflow" | "savetemplate" | "runworkflow" | "dryrun" | "delay" | "waitelement" | "compute" | "extractvars" | "condition" | "branch" | "loop" | "repeatuntil" | "whileloop" | "foreach" | "parallel" | "trycatch" | "visitrule" | "urlrule" | "menurule" | "keyrule" | "buttonrule" | "cronrule" | "intervalrule" | "urllistrule" | "webhookrule" | "eventrule";
|
|
4
4
|
export type actionrisk = "read" | "interaction" | "sensitive";
|
|
5
5
|
export type planstate = "draft" | "pending" | "approved" | "rejected" | "expired" | "completed" | "cancelled";
|
|
6
|
-
export type auditkind = "configure" | "session" | "observe" | "proposal" | "approval" | "action" | "error" | "stop" | "pause" | "resume" | "complete" | "capability" | "tab" | "window" | "download" | "pointer" | "dialog" | "hold" | "retry" | "observation" | "watch" | "diff" | "navigation" | "redirect" | "auth" | "prefetch" | "rate" | "group" | "layout" | "discard" | "badge" | "fill" | "submit" | "consent" | "handoff" | "scrape" | "export" | "stream" | "provenance" | "resume" | "intercept" | "clipboard" | "quarantine" | "cleanup" | "capture" | "media" | "call" | "socket" | "replay" | "control" | "timeline" | "debugger" | "profile" | "emulation" | "workflow";
|
|
6
|
+
export type auditkind = "configure" | "session" | "observe" | "proposal" | "approval" | "action" | "error" | "stop" | "pause" | "resume" | "complete" | "capability" | "tab" | "window" | "download" | "pointer" | "dialog" | "hold" | "retry" | "observation" | "watch" | "diff" | "navigation" | "redirect" | "auth" | "prefetch" | "rate" | "group" | "layout" | "discard" | "badge" | "fill" | "submit" | "consent" | "handoff" | "scrape" | "export" | "stream" | "provenance" | "resume" | "intercept" | "clipboard" | "quarantine" | "cleanup" | "capture" | "media" | "call" | "socket" | "replay" | "control" | "timeline" | "debugger" | "profile" | "emulation" | "workflow" | "trigger";
|
|
7
7
|
/** Observation mode classes: passive capture, watched lifetimes and diffing passes. */
|
|
8
8
|
export type observationmode = "passive" | "watching" | "diffing";
|
|
9
9
|
export interface toolstep {
|
|
@@ -174,8 +174,14 @@ export interface runsettings {
|
|
|
174
174
|
emulationretention?: number;
|
|
175
175
|
/** Retention window for stored session record sections such as tab form state, local storage and cookies; an absent window keeps every section while the record metadata always survives and the value stays a user choice with no code ceiling. */
|
|
176
176
|
sessionretention?: number;
|
|
177
|
+
/** Retention window for stored trigger fire records; an absent window keeps every fire record and the rule counters always survive. */
|
|
178
|
+
triggerretention?: number;
|
|
177
179
|
/** Retention window for stored workflow runlog entries; an absent window keeps every entry while the run summaries always survive for the audit trail. */
|
|
178
180
|
runlogretention?: number;
|
|
181
|
+
/** Retention window for stored run history entries; an absent window keeps every entry of every execution. */
|
|
182
|
+
runhistoryretention?: number;
|
|
183
|
+
/** Watchdog configuration of the workflow editor: the stall threshold and the recovery action stay user configured values with no code ceiling. */
|
|
184
|
+
watchdog?: watchdogconfig;
|
|
179
185
|
}
|
|
180
186
|
export interface proposalrequest {
|
|
181
187
|
objective: string;
|
|
@@ -2399,6 +2405,8 @@ export interface workflowrecord {
|
|
|
2399
2405
|
blocks: workflowblock[];
|
|
2400
2406
|
/** Derived review grade: a workflow that writes, submits or navigates is sensitive for review. */
|
|
2401
2407
|
risk: actionrisk;
|
|
2408
|
+
/** Review state of an imported workflow or a version rollback: pending stays unrunnable until the user approves the reviewed step list. */
|
|
2409
|
+
reviewstate?: "pending" | "approved";
|
|
2402
2410
|
createdat: number;
|
|
2403
2411
|
}
|
|
2404
2412
|
/** One workflow step: the action kind, the optional target and value, the reviewed JSON options, the output bindings and the human readable label. */
|
|
@@ -2417,6 +2425,10 @@ export interface workflowstep {
|
|
|
2417
2425
|
extract?: regexrule;
|
|
2418
2426
|
/** Innermost reusable block the step expanded from so runs highlight the active block during nested execution. */
|
|
2419
2427
|
block?: string;
|
|
2428
|
+
/** Breakpoint marker of editor debugging: a debug run pauses before this step. */
|
|
2429
|
+
breakpoint?: boolean;
|
|
2430
|
+
/** Nested parameters the enclosing block invocation binds into the block scope; expansion stamps them on the first step of the invocation region. */
|
|
2431
|
+
params?: nestedparam[];
|
|
2420
2432
|
}
|
|
2421
2433
|
/** One reusable workflow block that nests child steps and further block invocations under a reusable name. */
|
|
2422
2434
|
export interface workflowblock {
|
|
@@ -2429,6 +2441,8 @@ export interface workflowblock {
|
|
|
2429
2441
|
export interface blockinvocation {
|
|
2430
2442
|
block: string;
|
|
2431
2443
|
label: string;
|
|
2444
|
+
/** Nested parameters the invocation binds into the block scope before its first step runs. */
|
|
2445
|
+
params?: nestedparam[];
|
|
2432
2446
|
}
|
|
2433
2447
|
/** One shareable step template: a named workflow step marked as shareable across workflows. */
|
|
2434
2448
|
export interface steptemplate {
|
|
@@ -2509,6 +2523,10 @@ export interface workflowrun {
|
|
|
2509
2523
|
pausedat?: number;
|
|
2510
2524
|
cancelreason?: string;
|
|
2511
2525
|
failreason?: string;
|
|
2526
|
+
/** True when the run keeps executing in the service worker with no panel open; checkpoints restore it on every worker wake. */
|
|
2527
|
+
background?: boolean;
|
|
2528
|
+
/** Why the run paused: a user pause, a watchdog recovery or a browser interruption the startup hook marked. */
|
|
2529
|
+
pausekind?: "user" | "watchdog" | "interrupt";
|
|
2512
2530
|
}
|
|
2513
2531
|
/** One runlog entry: the step id, its label, the state, the duration and the outcome details with the bindings produced and consumed. */
|
|
2514
2532
|
export interface runlogentry {
|
|
@@ -2680,4 +2698,272 @@ export interface controlflowdecision {
|
|
|
2680
2698
|
rerun: boolean;
|
|
2681
2699
|
};
|
|
2682
2700
|
}
|
|
2701
|
+
/** The trigger rule families of the 1.1.52 release: page visits, url patterns, context menu entries, keyboard shortcuts, the toolbar button, cron schedules, intervals, url lists, webhooks and page events. */
|
|
2702
|
+
export type triggerfamily = "visit" | "url" | "menu" | "key" | "button" | "cron" | "interval" | "urllist" | "webhook" | "event";
|
|
2703
|
+
/** One armed trigger rule: the family, the reviewed match payload, the workflow reference, the runtime state with its cooldown and the per rule counters; every rule passes the arm review before it can fire. */
|
|
2704
|
+
export interface triggerule {
|
|
2705
|
+
id: string;
|
|
2706
|
+
kind: triggerfamily;
|
|
2707
|
+
/** The composed workflow this rule launches; evaluation skips the rule when the workflow is no longer composed. */
|
|
2708
|
+
workflowid: string;
|
|
2709
|
+
/** Human readable label of the rule shown in the trigger list. */
|
|
2710
|
+
label: string;
|
|
2711
|
+
/** Visited HTTPS origins a visit rule fires on. */
|
|
2712
|
+
origins?: string[];
|
|
2713
|
+
/** Glob url pattern a url rule matches against navigations. */
|
|
2714
|
+
pattern?: string;
|
|
2715
|
+
/** Context menu entry title of a menu rule. */
|
|
2716
|
+
title?: string;
|
|
2717
|
+
/** Command name of a keyboard shortcut rule plus the suggested key binding. */
|
|
2718
|
+
command?: string;
|
|
2719
|
+
key?: string;
|
|
2720
|
+
/** Five field cron expression of a cron rule with its optional timezone name. */
|
|
2721
|
+
cron?: string;
|
|
2722
|
+
timezone?: string;
|
|
2723
|
+
/** Interval period in milliseconds with the optional jitter window of an interval rule. */
|
|
2724
|
+
period?: number;
|
|
2725
|
+
jitter?: number;
|
|
2726
|
+
/** Url list a urllist rule runs its workflow across. */
|
|
2727
|
+
urls?: string[];
|
|
2728
|
+
/** Shared secret of a webhook rule; it never leaves the store and only its verified payloads persist. */
|
|
2729
|
+
secret?: string;
|
|
2730
|
+
/** Payload schema of a webhook rule: named fields of reviewed primitive kinds, required ones enforced at verification. */
|
|
2731
|
+
schema?: webhookfield[];
|
|
2732
|
+
/** Observed page event names an event rule subscribes to, drawn from the observed event catalog. */
|
|
2733
|
+
events?: string[];
|
|
2734
|
+
/** User configured cooldown window in milliseconds; an absent value keeps the documented family default. */
|
|
2735
|
+
cooldown?: number;
|
|
2736
|
+
state: triggerstate;
|
|
2737
|
+
stats: rulestats;
|
|
2738
|
+
createdat: number;
|
|
2739
|
+
}
|
|
2740
|
+
/** One webhook payload schema field of a webhook rule: the field name, its primitive kind and whether verification requires it. */
|
|
2741
|
+
export interface webhookfield {
|
|
2742
|
+
name: string;
|
|
2743
|
+
kind: "string" | "number" | "boolean";
|
|
2744
|
+
required?: boolean;
|
|
2745
|
+
}
|
|
2746
|
+
/** The runtime state of one armed trigger rule: the enabled flag, the effective cooldown window, the pause marker, the last and next fire times. */
|
|
2747
|
+
export interface triggerstate {
|
|
2748
|
+
enabled: boolean;
|
|
2749
|
+
/** Effective cooldown window in milliseconds between two fires of the rule. */
|
|
2750
|
+
cooldown: number;
|
|
2751
|
+
/** Time of the last fire; fires inside the cooldown window after it are suppressed. */
|
|
2752
|
+
lastfireat?: number;
|
|
2753
|
+
/** Next scheduled fire time of a cron or interval rule. */
|
|
2754
|
+
nextfireat?: number;
|
|
2755
|
+
/** Pause marker set while the session pauses; queued fires drain on resume. */
|
|
2756
|
+
pausedat?: number;
|
|
2757
|
+
}
|
|
2758
|
+
/** The per rule counters of the trigger history view: fires, launches and cooldown or dedupe suppressions. */
|
|
2759
|
+
export interface rulestats {
|
|
2760
|
+
fires: number;
|
|
2761
|
+
launches: number;
|
|
2762
|
+
suppressions: number;
|
|
2763
|
+
}
|
|
2764
|
+
/** One trigger fire record: the rule, the time, the cause, the triggering url, title and payload carried into the run context. */
|
|
2765
|
+
export interface triggerfire {
|
|
2766
|
+
id: string;
|
|
2767
|
+
ruleid: string;
|
|
2768
|
+
at: number;
|
|
2769
|
+
cause: string;
|
|
2770
|
+
/** Triggering url of a visit, url, urllist or navigation driven fire. */
|
|
2771
|
+
url?: string;
|
|
2772
|
+
/** Triggering page title carried into the run context. */
|
|
2773
|
+
title?: string;
|
|
2774
|
+
/** Trigger payload such as the verified webhook body or the observed event name. */
|
|
2775
|
+
payload?: Record<string, unknown>;
|
|
2776
|
+
}
|
|
2777
|
+
/** One manual run request with its step preview: the expanded step list rendered before confirmation so a human always sees what a run will do. */
|
|
2778
|
+
export interface manualrun {
|
|
2779
|
+
id: string;
|
|
2780
|
+
workflowid: string;
|
|
2781
|
+
/** The rendered step preview shown before confirmation. */
|
|
2782
|
+
preview: Array<{
|
|
2783
|
+
stepid: string;
|
|
2784
|
+
kind: string;
|
|
2785
|
+
label: string;
|
|
2786
|
+
block?: string;
|
|
2787
|
+
control?: Record<string, unknown>;
|
|
2788
|
+
}>;
|
|
2789
|
+
/** The confirmation outcome after the user approved or cancelled; an undecided preview stays open. */
|
|
2790
|
+
confirmed?: boolean;
|
|
2791
|
+
decidedat?: number;
|
|
2792
|
+
at: number;
|
|
2793
|
+
}
|
|
2794
|
+
/** One canvas node of the workflow editor: the workflow step or the block invocation it renders with its canvas position. */
|
|
2795
|
+
export interface editornode {
|
|
2796
|
+
/** The canvas node id: the step id, or the invocation id of a loaded block invocation which stays unique even when one block is invoked many times. */
|
|
2797
|
+
id?: string;
|
|
2798
|
+
/** The workflow step this node renders; absent on a block invocation node. */
|
|
2799
|
+
step?: workflowstep;
|
|
2800
|
+
/** The block invocation this node renders; absent on a plain step node. */
|
|
2801
|
+
invocation?: blockinvocation;
|
|
2802
|
+
x: number;
|
|
2803
|
+
y: number;
|
|
2804
|
+
}
|
|
2805
|
+
/** One canvas edge of the workflow editor: a typed binding socket that links the output of one step into the input of a later step. */
|
|
2806
|
+
export interface editoredge {
|
|
2807
|
+
from: string;
|
|
2808
|
+
to: string;
|
|
2809
|
+
variable: string;
|
|
2810
|
+
kind: variablekind;
|
|
2811
|
+
/** Dotted path into the source step outcome details; an absent path binds the summary. */
|
|
2812
|
+
path?: string;
|
|
2813
|
+
}
|
|
2814
|
+
/** The layout state of the canvas: the canvas size, the viewport origin and the zoom factor. */
|
|
2815
|
+
export interface editorlayout {
|
|
2816
|
+
width: number;
|
|
2817
|
+
height: number;
|
|
2818
|
+
viewportx: number;
|
|
2819
|
+
viewporty: number;
|
|
2820
|
+
zoom: number;
|
|
2821
|
+
}
|
|
2822
|
+
/** The mini map state: the mini canvas size, the projection scale from canvas coordinates and the viewport rectangle inside it. */
|
|
2823
|
+
export interface minimapstate {
|
|
2824
|
+
width: number;
|
|
2825
|
+
height: number;
|
|
2826
|
+
/** Projection scale from canvas coordinates to mini map coordinates. */
|
|
2827
|
+
scale: number;
|
|
2828
|
+
zoom: number;
|
|
2829
|
+
/** The viewport rectangle in mini map coordinates. */
|
|
2830
|
+
viewport: {
|
|
2831
|
+
x: number;
|
|
2832
|
+
y: number;
|
|
2833
|
+
width: number;
|
|
2834
|
+
height: number;
|
|
2835
|
+
};
|
|
2836
|
+
}
|
|
2837
|
+
/** The full canvas model the editor edits: the nodes, the typed edges, the block definitions, the layout, the mini map, the undo and redo stacks and the dirty marker. */
|
|
2838
|
+
export interface editormodel {
|
|
2839
|
+
workflowid: string;
|
|
2840
|
+
name: string;
|
|
2841
|
+
version: number;
|
|
2842
|
+
origins: string[];
|
|
2843
|
+
nodes: editornode[];
|
|
2844
|
+
edges: editoredge[];
|
|
2845
|
+
blocks: workflowblock[];
|
|
2846
|
+
layout: editorlayout;
|
|
2847
|
+
minimap: minimapstate;
|
|
2848
|
+
/** Undo snapshots, newest last; a snapshot never carries its own nested history. */
|
|
2849
|
+
undo?: editormodel[];
|
|
2850
|
+
/** Redo snapshots, newest last; a new edit clears them. */
|
|
2851
|
+
redo?: editormodel[];
|
|
2852
|
+
dirty: boolean;
|
|
2853
|
+
}
|
|
2854
|
+
/** The five categories of the block palette: actions, control flow, waits, variables and triggers. */
|
|
2855
|
+
export type palettecategory = "actions" | "controlflow" | "waits" | "variables" | "triggers";
|
|
2856
|
+
/** One palette descriptor of the block palette: the drop kind, its label, its category and its description. */
|
|
2857
|
+
export interface palettenode {
|
|
2858
|
+
kind: string;
|
|
2859
|
+
label: string;
|
|
2860
|
+
category: palettecategory;
|
|
2861
|
+
description: string;
|
|
2862
|
+
}
|
|
2863
|
+
/** One step library entry: the action kind, its palette category and its reviewed option schema. */
|
|
2864
|
+
export interface steplibraryentry {
|
|
2865
|
+
kind: string;
|
|
2866
|
+
category: palettecategory;
|
|
2867
|
+
optionschema: Array<{
|
|
2868
|
+
name: string;
|
|
2869
|
+
kind: "string" | "number" | "boolean";
|
|
2870
|
+
required?: boolean;
|
|
2871
|
+
}>;
|
|
2872
|
+
}
|
|
2873
|
+
/** One local workflow version: the version number, its timestamp and the change note beside the step count and risk grade. */
|
|
2874
|
+
export interface workflowversion {
|
|
2875
|
+
workflowid: string;
|
|
2876
|
+
version: number;
|
|
2877
|
+
createdat: number;
|
|
2878
|
+
note: string;
|
|
2879
|
+
steps: number;
|
|
2880
|
+
risk?: actionrisk;
|
|
2881
|
+
/** True when the version was created by rolling an older version back; the rollback review gates its first run. */
|
|
2882
|
+
rollback?: boolean;
|
|
2883
|
+
}
|
|
2884
|
+
/** One version diff result: the added, removed and changed steps between two workflow versions. */
|
|
2885
|
+
export interface versiondiff {
|
|
2886
|
+
workflowid: string;
|
|
2887
|
+
from: number;
|
|
2888
|
+
to: number;
|
|
2889
|
+
added: Array<{
|
|
2890
|
+
stepid: string;
|
|
2891
|
+
kind: string;
|
|
2892
|
+
label: string;
|
|
2893
|
+
}>;
|
|
2894
|
+
removed: Array<{
|
|
2895
|
+
stepid: string;
|
|
2896
|
+
kind: string;
|
|
2897
|
+
label: string;
|
|
2898
|
+
}>;
|
|
2899
|
+
changed: Array<{
|
|
2900
|
+
stepid: string;
|
|
2901
|
+
kind: string;
|
|
2902
|
+
label: string;
|
|
2903
|
+
changes: string[];
|
|
2904
|
+
}>;
|
|
2905
|
+
at: number;
|
|
2906
|
+
}
|
|
2907
|
+
/** One run history entry: the outcome, the executed step count, the duration and the trigger cause of one execution. */
|
|
2908
|
+
export interface runhistoryentry {
|
|
2909
|
+
runid: string;
|
|
2910
|
+
workflowid: string;
|
|
2911
|
+
outcome: string;
|
|
2912
|
+
steps: number;
|
|
2913
|
+
total: number;
|
|
2914
|
+
duration: number;
|
|
2915
|
+
cause: string;
|
|
2916
|
+
startedat: number;
|
|
2917
|
+
endedat: number;
|
|
2918
|
+
dryrun?: boolean;
|
|
2919
|
+
}
|
|
2920
|
+
/** The export formats of a workflow file: json or yaml. */
|
|
2921
|
+
export type exportformat = "json" | "yaml";
|
|
2922
|
+
/** One exported workflow file: the file format version, the export time, the workflow record, the change note and the packed step templates. */
|
|
2923
|
+
export interface workflowfile {
|
|
2924
|
+
format: 1;
|
|
2925
|
+
exportedat: number;
|
|
2926
|
+
workflow: workflowrecord;
|
|
2927
|
+
note?: string;
|
|
2928
|
+
templates: steptemplate[];
|
|
2929
|
+
}
|
|
2930
|
+
/** One nested parameter of a block invocation: the name, the variable kind and the default value bound into the block scope. */
|
|
2931
|
+
export interface nestedparam {
|
|
2932
|
+
name: string;
|
|
2933
|
+
kind: variablekind;
|
|
2934
|
+
default?: string | number | boolean | string[];
|
|
2935
|
+
}
|
|
2936
|
+
/** One pending workflow import held for review: the parsed record stays unrunnable until the user approves it. */
|
|
2937
|
+
export interface workflowimport {
|
|
2938
|
+
id: string;
|
|
2939
|
+
record: workflowrecord;
|
|
2940
|
+
importedat: number;
|
|
2941
|
+
filename?: string;
|
|
2942
|
+
}
|
|
2943
|
+
/** One per site policy override of a workflow: the origin pattern and the reviewed policy knobs it adjusts. */
|
|
2944
|
+
export interface siteoverride {
|
|
2945
|
+
id: string;
|
|
2946
|
+
workflowid: string;
|
|
2947
|
+
pattern: string;
|
|
2948
|
+
deltas: Record<string, number>;
|
|
2949
|
+
createdat: number;
|
|
2950
|
+
}
|
|
2951
|
+
/** The watchdog configuration: the stall threshold and the recovery action, both user configured values with no code ceiling. */
|
|
2952
|
+
export interface watchdogconfig {
|
|
2953
|
+
enabled: boolean;
|
|
2954
|
+
/** Milliseconds without a completed step after which a running run grades stalled. */
|
|
2955
|
+
stallthreshold: number;
|
|
2956
|
+
action: "retry" | "pause" | "cancel";
|
|
2957
|
+
/** Window after which a running run with no live executor reaps as a zombie of a browser shutdown. */
|
|
2958
|
+
zombiewindow?: number;
|
|
2959
|
+
}
|
|
2960
|
+
/** One watchdog event: the run it touched, the verdict and the recovery outcome. */
|
|
2961
|
+
export interface watchdogrecord {
|
|
2962
|
+
id: string;
|
|
2963
|
+
runid: string;
|
|
2964
|
+
verdict: "stalled" | "zombie" | "healthy";
|
|
2965
|
+
action: "retry" | "pause" | "cancel" | "reap" | "none";
|
|
2966
|
+
outcome: string;
|
|
2967
|
+
at: number;
|
|
2968
|
+
}
|
|
2683
2969
|
//# sourceMappingURL=types.d.ts.map
|