@wenathlan/extension 1.1.58 → 1.1.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +6 -4
  2. package/dist/cli.js +19 -2
  3. package/dist/coordination.d.ts +139 -0
  4. package/dist/coordination.d.ts.map +1 -0
  5. package/dist/environments.d.ts +96 -0
  6. package/dist/environments.d.ts.map +1 -0
  7. package/dist/index.d.ts +6 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +1080 -1
  10. package/dist/index.js.map +4 -4
  11. package/dist/memory.d.ts +119 -1
  12. package/dist/memory.d.ts.map +1 -1
  13. package/dist/multiagent.d.ts +1 -1
  14. package/dist/multiagent.d.ts.map +1 -1
  15. package/dist/orchestration.d.ts +174 -0
  16. package/dist/orchestration.d.ts.map +1 -0
  17. package/dist/policy.d.ts +76 -1
  18. package/dist/policy.d.ts.map +1 -1
  19. package/dist/protocol.d.ts +82 -3
  20. package/dist/protocol.d.ts.map +1 -1
  21. package/dist/runstate.d.ts +127 -0
  22. package/dist/runstate.d.ts.map +1 -0
  23. package/dist/sandboxframe.d.ts +45 -0
  24. package/dist/sandboxframe.d.ts.map +1 -0
  25. package/dist/types.d.ts +444 -4
  26. package/dist/types.d.ts.map +1 -1
  27. package/dist/version.d.ts +1 -1
  28. package/extension/dist/background.js +1837 -58
  29. package/extension/dist/background.js.map +4 -4
  30. package/extension/dist/manifest.json +16 -2
  31. package/extension/dist/offscreen.html +7 -0
  32. package/extension/dist/offscreen.js +87 -0
  33. package/extension/dist/offscreen.js.map +7 -0
  34. package/extension/dist/pagebridge.js +7 -0
  35. package/extension/dist/pagebridge.js.map +2 -2
  36. package/extension/dist/popup.html +1 -1
  37. package/extension/dist/popup.js +39 -1
  38. package/extension/dist/popup.js.map +2 -2
  39. package/extension/dist/sandbox.html +28 -0
  40. package/extension/dist/sidepanel.html +1 -1
  41. package/extension/dist/sidepanel.js +848 -3
  42. package/extension/dist/sidepanel.js.map +4 -4
  43. package/extension/manifest.json +16 -2
  44. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export declare const protocolversion: "1.1.58";
1
+ export declare const protocolversion: "1.1.60";
2
2
  /** Every reviewed action kind. Read kinds observe, interaction kinds move focus, sensitive kinds change page or browser state. */
3
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" | "listruns" | "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" | "trigger" | "protocol" | "tool" | "model" | "swarm";
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" | "protocol" | "tool" | "model" | "swarm" | "environment" | "worker" | "sandbox";
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 {
@@ -15,6 +15,8 @@ export interface toolstep {
15
15
  options?: string;
16
16
  summary: string;
17
17
  risk: actionrisk;
18
+ /** The execution environment this step names: pagecontext, isolatedworld, offscreenworker or sandboxframe; an absent field routes to the default environment of the kind. */
19
+ environment?: environmentkind;
18
20
  }
19
21
  export interface agentplan {
20
22
  id: string;
@@ -37,6 +39,8 @@ export interface agentsession {
37
39
  pausedat?: number;
38
40
  /** Origins granted to this session; prepared for multi origin work. */
39
41
  grants?: string[];
42
+ /** Execution environments granted to this session beside the origin grants: pagecontext, isolatedworld, offscreenworker and sandboxframe; an absent list keeps the documented default posture while a configured list narrows every step to its entries. */
43
+ environmentgrants?: environmentkind[];
40
44
  }
41
45
  export interface endpointconfig {
42
46
  endpoint: string;
@@ -62,6 +66,8 @@ export interface observation {
62
66
  label: string;
63
67
  }>;
64
68
  capturedat: number;
69
+ /** The execution environment of the capture: pagecontext snapshots read the live page while offscreenworker parses hand the heavy shaping to the worker pool. */
70
+ environment?: environmentkind;
65
71
  /** Observation mode of this capture: passive, watching or diffing. */
66
72
  mode?: observationmode;
67
73
  /** Accessibility tree section captured by the page walker. */
@@ -130,6 +136,8 @@ export interface stepoutcome {
130
136
  ok: boolean;
131
137
  summary: string;
132
138
  details?: Record<string, unknown>;
139
+ /** The execution environment the step ran in, reported beside the outcome. */
140
+ environment?: environmentkind;
133
141
  at: number;
134
142
  }
135
143
  /** User chosen retention windows; an absent value keeps everything forever. */
@@ -188,6 +196,28 @@ export interface runsettings {
188
196
  claimwindow?: number;
189
197
  /** Retention window for stored agent mailbox messages; an absent window keeps every message while the unread counters always survive. */
190
198
  mailboxretention?: number;
199
+ /** User configured consensus quorum of the swarm: the number of yes votes a consensus round needs to carry; an absent value leaves the quorum to the round the user opens. */
200
+ swarmquorum?: number;
201
+ /** User configured ceiling on the worker lane of the leader worker topology; an absent value stays unbounded because the worker scale stays a user choice with no engine cap. */
202
+ swarmworkers?: number;
203
+ /** Retention window for stored progressboard snapshots; an absent window keeps every snapshot while the board itself always rebuilds from the live swarm state. */
204
+ boardretention?: number;
205
+ /** The verification methods the user allows the verifier agents to use; an empty or absent list keeps every method open as the documented user choice. */
206
+ verifiermethods?: string[];
207
+ /** True when the user turns the parse offload on: heavy parsing steps route into the offscreen worker pool instead of the page; an absent value keeps every parse inside the page. */
208
+ parseoffload?: boolean;
209
+ /** The worker pool size of the offscreen document as a user choice with no hard cap; an absent value lets the pool follow the pending parse queue alone. */
210
+ workerpoolsize?: number;
211
+ /** Retention window for stored run state records; an absent window keeps every run state while the keepalive summaries always survive. */
212
+ runstateretention?: number;
213
+ /** The origins the user allows to render untrusted markup inside the sandboxframe; an absent list keeps every origin open as the documented user choice. */
214
+ sandboxorigins?: string[];
215
+ /** The keepalive heartbeat interval in milliseconds; the roadmap documents thirty seconds while the interval stays the user's choice. */
216
+ keepaliveinterval?: number;
217
+ /** The number of silent heartbeat intervals the zombie reaper tolerates before it reaps a run; the roadmap documents three while the number stays the user's choice. */
218
+ zombieintervals?: number;
219
+ /** User configured byte ceiling for the stored run state; an absent value never prunes because the pressure response stays a user choice only. */
220
+ runstatebytes?: number;
191
221
  }
192
222
  export interface proposalrequest {
193
223
  objective: string;
@@ -210,6 +240,10 @@ export interface planprogress {
210
240
  outcomes?: stepoutcome[];
211
241
  /** Tabs assigned to the running task so progress tracks work across its tabs. */
212
242
  tasktabs?: number[];
243
+ /** The execution environment of every completed step by step id. */
244
+ environments?: Record<string, environmentkind>;
245
+ /** The worker turnaround of every offloaded step by step id, in milliseconds. */
246
+ turnarounds?: Record<string, number>;
213
247
  /** Prior progress snapshots preserved when a new plan replaces the tracked one. */
214
248
  prior?: planprogress[];
215
249
  updatedat: number;
@@ -3669,8 +3703,8 @@ export interface tokenstream {
3669
3703
  */
3670
3704
  /** The lifecycle states of one agent of the swarm: active, paused by the user or stopped. */
3671
3705
  export type agentstate = "active" | "paused" | "stopped";
3672
- /** The role an agent plays. The three internal roles carry their documented defaults while the user may attach any custom role name; a custom role grades with the worker defaults until the user narrows its scope. */
3673
- export type agentrole = "planner" | "worker" | "observer" | (string & {});
3706
+ /** The role an agent plays. The five internal roles carry their documented defaults while the user may attach any custom role name; a custom role grades with the worker defaults until the user narrows its scope. */
3707
+ export type agentrole = "planner" | "worker" | "observer" | "critic" | "verifier" | (string & {});
3674
3708
  /** One agent identity of the swarm: the id, the user chosen name for dashboards and audit, the role, the bound tab and session, the parent of a sub agent with its depth, the lifecycle state and the per agent budget and scope the user configured. */
3675
3709
  export interface agentidentity {
3676
3710
  id: string;
@@ -3841,4 +3875,410 @@ export interface swarmstate {
3841
3875
  mailboxes: agentmailbox[];
3842
3876
  killswitch: killswitch;
3843
3877
  }
3878
+ /**
3879
+ * Multi agent part two contracts of the 1.1.59 family: the leader worker topology with worker assignments, critic reviews and verifier checks over agent outputs, the planner executor split, tab handoffs between agents mid run, resource locks keyed by origin and selector with conflict scans, result merging with provenance into one report, the progressboard layout, review requests between agents, escalations that lift an agent decision to the user, arbitration rules that order competing resource claims and consensus rounds with quorum.
3880
+ * Every value here stays a user choice: the election rule, the worker scale bound, the quorum, the lock kinds and the merge rules carry no code default, and coordination never bypasses the human review.
3881
+ */
3882
+ /** The verdict of one critic review: approve passes the output, changes demands the listed rework and reject refuses the output. */
3883
+ export type reviewverdict = "approve" | "changes" | "reject";
3884
+ /** The leader worker topology of one swarm: the leader agent id, the worker, critic and verifier lanes and every worker assignment; the rule names how the leader was elected. */
3885
+ export interface leaderworker {
3886
+ id: string;
3887
+ leaderid: string;
3888
+ workerids: string[];
3889
+ criticids: string[];
3890
+ verifierids: string[];
3891
+ assignments: workerassignment[];
3892
+ /** The user configured election rule that picked the leader: `first` takes the first registration while `named` takes the agent the user named. */
3893
+ rule: {
3894
+ kind: "first" | "named";
3895
+ agentid?: string;
3896
+ };
3897
+ electedat: number;
3898
+ }
3899
+ /** One assignment linking a worker to a task slice: the worker id, the task id, the slice description in plain language and the assignment time. */
3900
+ export interface workerassignment {
3901
+ workerid: string;
3902
+ taskid: string;
3903
+ /** The slice of the task this worker owns, in plain language; the review reads it exactly as typed. */
3904
+ slice: string;
3905
+ assignedat: number;
3906
+ }
3907
+ /** One critic review of an agent output: the critic agent, the reviewed agent and task, the verdict, the issues found and the changes the output requires. */
3908
+ export interface criticreview {
3909
+ id: string;
3910
+ reviewerid: string;
3911
+ subjectagentid: string;
3912
+ taskid?: string;
3913
+ verdict: reviewverdict;
3914
+ issues: string[];
3915
+ requiredchanges: string[];
3916
+ reviewedat: number;
3917
+ }
3918
+ /** The outcome of one verifier check: pass confirms the claim against the page while fail refutes it. */
3919
+ export type verifieroutcome = "pass" | "fail";
3920
+ /** One verifier check of a result claim: the verifier agent, the agent whose claim is checked, the claim in plain language, the method the verifier used and the pass or fail outcome with its evidence. */
3921
+ export interface verifiercheck {
3922
+ id: string;
3923
+ verifierid: string;
3924
+ claimagentid: string;
3925
+ taskid?: string;
3926
+ claim: string;
3927
+ /** The verification method the verifier used, named by the user; the method grade reads it. */
3928
+ method: string;
3929
+ outcome: verifieroutcome;
3930
+ evidence?: string;
3931
+ checkedat: number;
3932
+ }
3933
+ /** The planner executor split of one task: the plan owner agent drafts while the run owner agent executes, and the executor reports every step outcome back to the planner. */
3934
+ export interface plannerexecutor {
3935
+ id: string;
3936
+ planownerid: string;
3937
+ runownerid: string;
3938
+ taskid?: string;
3939
+ stepreports: executorreport[];
3940
+ splitat: number;
3941
+ }
3942
+ /** One step outcome an executor reports back to the planner agent: the step id, the outcome, the detail in plain language and the report time. */
3943
+ export interface executorreport {
3944
+ stepid: string;
3945
+ outcome: "done" | "failed";
3946
+ detail: string;
3947
+ reportedat: number;
3948
+ }
3949
+ /** The states of one tab handoff: prepared packages the transfer, transferred moved the tab binding and resumed continued the task from the packaged state. */
3950
+ export type handoffstate = "prepared" | "transferred" | "resumed";
3951
+ /** One handoff request: the transferring agent, the receiving agent, the tab id and the packaged task state with the reason; the transfer preserves the original session grants. */
3952
+ export interface handoffrequest {
3953
+ id: string;
3954
+ fromagentid: string;
3955
+ toagentid: string;
3956
+ tabid?: number;
3957
+ /** The packaged task state in plain language; the resume continues exactly from it. */
3958
+ taskstate: string;
3959
+ reason?: string;
3960
+ createdat: number;
3961
+ }
3962
+ /** One handoff record: from and to agents, the tab, the packaged task state, the handoff state and the transfer and resume times. */
3963
+ export interface handoffrecord {
3964
+ id: string;
3965
+ fromagentid: string;
3966
+ toagentid: string;
3967
+ tabid?: number;
3968
+ taskstate: string;
3969
+ state: handoffstate;
3970
+ reason?: string;
3971
+ createdat: number;
3972
+ transferredat?: number;
3973
+ resumedat?: number;
3974
+ }
3975
+ /** The kinds of one resource lock: exclusive holds the resource alone while shared admits further shared holders only. */
3976
+ export type lockkind = "exclusive" | "shared";
3977
+ /** One resource lock of the swarm: the key composed of exactly one origin and one selector so a lock never spans unrelated origins, the holder agent, the kind and the expiry. */
3978
+ export interface resourcelock {
3979
+ /** The lock key composed of the origin and the selector; the scope gate refuses keys that span more than one origin. */
3980
+ key: string;
3981
+ holder: string;
3982
+ kind: lockkind;
3983
+ origin: string;
3984
+ selector: string;
3985
+ acquiredat: number;
3986
+ /** User configured expiry time; a lock past its expiry returns to the pool on the sweep. */
3987
+ expiresat?: number;
3988
+ }
3989
+ /** One writer of a conflict scan: the agent, the origin and selector it targets and its task. */
3990
+ export interface conflictwriter {
3991
+ agentid: string;
3992
+ origin: string;
3993
+ selector: string;
3994
+ taskid?: string;
3995
+ }
3996
+ /** One conflict scan result: the writers examined, the overlapping targets with their writers, the suggested ordering and the clean marker when no writes overlap. */
3997
+ export interface conflictscan {
3998
+ id: string;
3999
+ writers: conflictwriter[];
4000
+ overlaps: Array<{
4001
+ origin: string;
4002
+ selector: string;
4003
+ writers: string[];
4004
+ }>;
4005
+ /** The suggested ordering of the writers for the overlapping targets, by agent id so the suggestion stays deterministic. */
4006
+ suggestedorder: string[];
4007
+ clean: boolean;
4008
+ scannedat: number;
4009
+ }
4010
+ /** The merge rules for duplicate rows and conflicting values: first keeps the earliest value, last keeps the latest, preferagent keeps the value of the agent the user named and fail refuses the merge. */
4011
+ export type mergerule = "first" | "last" | "preferagent" | "fail";
4012
+ /** One merge entry mapping a parallel result into the final report: the agent, its task, the key and value and the conflict resolution note when other agents wrote the same key. */
4013
+ export interface mergeentry {
4014
+ id: string;
4015
+ agentid: string;
4016
+ taskid?: string;
4017
+ key: string;
4018
+ value: string;
4019
+ /** The conflict resolution note in plain language; an entry without a conflict carries none. */
4020
+ conflict?: string;
4021
+ mergedat: number;
4022
+ }
4023
+ /** One section of a result report: the title, the merged entries and the agents that sourced them. */
4024
+ export interface reportsection {
4025
+ title: string;
4026
+ entries: mergeentry[];
4027
+ sources: string[];
4028
+ }
4029
+ /** One result report across agents: the sections, the contributing agent sources and the confidence the user reviews; every merged value keeps its provenance. */
4030
+ export interface resultreport {
4031
+ id: string;
4032
+ title: string;
4033
+ sections: reportsection[];
4034
+ sources: string[];
4035
+ /** The confidence in the report stated in plain language; the value stays what the agents reported, never an engine score. */
4036
+ confidence?: string;
4037
+ createdat: number;
4038
+ }
4039
+ /** One milestone of a progressboard lane: the label, the done marker and the time the milestone completed. */
4040
+ export interface boardmilestone {
4041
+ label: string;
4042
+ done: boolean;
4043
+ at?: number;
4044
+ }
4045
+ /** One lane of the progressboard: the agent, its role, its lifecycle state, its lane name, the current task and the milestones of its run. */
4046
+ export interface boardlane {
4047
+ agentid: string;
4048
+ name: string;
4049
+ role: string;
4050
+ state: string;
4051
+ lane: string;
4052
+ currenttask?: string;
4053
+ milestones: boardmilestone[];
4054
+ }
4055
+ /** The progressboard layout of one swarm: one lane per agent so the user reads every agent at once, with the milestones each agent reported. */
4056
+ export interface progressboard {
4057
+ id: string;
4058
+ lanes: boardlane[];
4059
+ builtat: number;
4060
+ }
4061
+ /** The states of one review request between agents: open waits, acked confirms receipt, answered carries the verdict and timeout expired unanswered. */
4062
+ export type reviewrequeststate = "open" | "acked" | "answered" | "timeout";
4063
+ /** One review request routed between agents: the requesting agent, the reviewing agent, the subject and payload and the ack, answer and timeout times. */
4064
+ export interface reviewrequest {
4065
+ id: string;
4066
+ fromagentid: string;
4067
+ toagentid: string;
4068
+ subject: string;
4069
+ payload: string;
4070
+ state: reviewrequeststate;
4071
+ requestedat: number;
4072
+ ackedat?: number;
4073
+ answeredat?: number;
4074
+ /** The user configured answer deadline; a request past it without an answer times out on the sweep. */
4075
+ timeoutat?: number;
4076
+ }
4077
+ /** One escalation that lifts an agent decision to the user: the agent, the subject, the full context and the decision only the user writes. */
4078
+ export interface escalationrecord {
4079
+ id: string;
4080
+ agentid: string;
4081
+ subject: string;
4082
+ context: string;
4083
+ state: "open" | "decided";
4084
+ /** The decision the user wrote; an open escalation carries none because escalations stay human decided. */
4085
+ decision?: string;
4086
+ raisedat: number;
4087
+ decidedat?: number;
4088
+ }
4089
+ /** The arbitration strategies that order competing resource claims: priority follows the user ordered agent list, age gives the oldest claim the resource and leader lets the elected leader decide. */
4090
+ export type arbitrationstrategy = "priority" | "age" | "leader";
4091
+ /** One arbitration rule the user configures: the strategy and, for the priority strategy, the agent order that wins competing claims. */
4092
+ export interface arbitrationrule {
4093
+ id: string;
4094
+ strategy: arbitrationstrategy;
4095
+ /** The user ordered agent ids of the priority strategy; the first named agent wins a competing claim. */
4096
+ priorityorder: string[];
4097
+ configuredat: number;
4098
+ }
4099
+ /** One vote of a consensus round: yes, no or abstain with the voting agent and the time. */
4100
+ export type consensusvote = "yes" | "no" | "abstain";
4101
+ /** One consensus round: the subject, the collected votes, the user configured quorum and the state the votes resolve. */
4102
+ export interface consensusround {
4103
+ id: string;
4104
+ subject: string;
4105
+ votes: Array<{
4106
+ agentid: string;
4107
+ vote: consensusvote;
4108
+ votedat: number;
4109
+ }>;
4110
+ /** The number of yes votes the round needs to carry; a user configured value with no engine default. */
4111
+ quorum: number;
4112
+ state: "open" | "carried" | "failed";
4113
+ openedat: number;
4114
+ closedat?: number;
4115
+ }
4116
+ /** One interleaved action of the swarm timeline: the kind, the agent it names, the summary in plain language and the time. */
4117
+ export interface swarmaction {
4118
+ id: string;
4119
+ kind: string;
4120
+ agentid?: string;
4121
+ summary: string;
4122
+ at: number;
4123
+ }
4124
+ /** The shared cost accounting of one swarm: the per agent usage summed into the swarm totals of tokens, cost and steps. */
4125
+ export interface swarmcost {
4126
+ agents: number;
4127
+ tokens: number;
4128
+ cost: number;
4129
+ steps: number;
4130
+ currency?: string;
4131
+ computedat: number;
4132
+ }
4133
+ /** One comparison of competing agent outputs for the user: the subject, the outputs per agent and the differences the comparison names. */
4134
+ export interface outputcomparison {
4135
+ id: string;
4136
+ subject: string;
4137
+ outputs: Array<{
4138
+ agentid: string;
4139
+ value: string;
4140
+ }>;
4141
+ differences: string[];
4142
+ comparedat: number;
4143
+ }
4144
+ /**
4145
+ * Execution environment contracts of the 1.1.60 family.
4146
+ * Every reviewed step names the concrete environment it executes in: pagecontext runs inside the live page, isolatedworld runs injected logic that page scripts cannot touch, offscreenworker moves heavy parsing into an offscreen document worker pool and sandboxframe renders untrusted markup inside a sandboxed page with no extension privileges.
4147
+ * The consent gates do not move: every environment executes only reviewed steps against granted origins, and no environment ever bypasses the human review.
4148
+ */
4149
+ /** The execution environments of the 1.1.60 family: the live page, the isolated world of the scripting api, the offscreen document worker pool and the sandboxed frame. */
4150
+ export type environmentkind = "pagecontext" | "isolatedworld" | "offscreenworker" | "sandboxframe";
4151
+ /** The per kind environment profile the policy exposes: the environments the kind may run in and the default the executor routes to. */
4152
+ export interface environmentrequirement {
4153
+ kind: actionkind;
4154
+ environments: environmentkind[];
4155
+ defaultenvironment: environmentkind;
4156
+ }
4157
+ /** One executor traffic envelope for the offscreen worker pool: the parse family, the payload reference and the keys the executor moves as transferable buffers. */
4158
+ export interface workerrequest {
4159
+ id: string;
4160
+ runid: string;
4161
+ stepid: string;
4162
+ /** The parse family the worker executes such as htmlsnapshot, jsonpayload, tablerows, a11ytree, complexselector or stitchshots. */
4163
+ task: string;
4164
+ payload: string;
4165
+ /** The payload keys the executor moves as transferable buffers where the payload carries them. */
4166
+ transferables: string[];
4167
+ sentat: number;
4168
+ }
4169
+ /** One worker answer to the executor: the finished result or one streamed partial chunk with its sequence number. */
4170
+ export interface workerresponse {
4171
+ id: string;
4172
+ requestid: string;
4173
+ ok: boolean;
4174
+ /** The finished result payload; a partial answer carries its chunk in the partial field instead. */
4175
+ result?: string;
4176
+ /** The sequence number of one streamed partial result; the final answer carries none. */
4177
+ partial?: number;
4178
+ summary: string;
4179
+ receivedat: number;
4180
+ }
4181
+ /** One sandbox render descriptor: the sanitized markup, the per render nonce and the source origin of the untrusted markup. */
4182
+ export interface sandboxrender {
4183
+ id: string;
4184
+ nonce: string;
4185
+ markup: string;
4186
+ sourceorigin: string;
4187
+ stepid: string;
4188
+ renderedat: number;
4189
+ }
4190
+ /** The result of one sandbox render posted back through postmessage: the nonce it answers, the sanitized text and the render facts. */
4191
+ export interface sandboxrenderresult {
4192
+ nonce: string;
4193
+ ok: boolean;
4194
+ text: string;
4195
+ summary: string;
4196
+ at: number;
4197
+ }
4198
+ /** One keepalive run state with start and stop events: the typed run state that holds a runtime port open while a run stays active and emits a heartbeat on every interval. */
4199
+ export interface keepalivestate {
4200
+ runid: string;
4201
+ sessionid: string;
4202
+ state: "active" | "stopped";
4203
+ startedat: number;
4204
+ stoppedat?: number;
4205
+ /** The user configured heartbeat interval in milliseconds; the roadmap documents thirty seconds while the interval stays the user's choice. */
4206
+ interval: number;
4207
+ beats: number;
4208
+ lastbeatat: number;
4209
+ portopen: boolean;
4210
+ events: keepaliveevent[];
4211
+ }
4212
+ /** One keepalive lifecycle event: the start, a heartbeat, the stop or the reattach after a service worker restart. */
4213
+ export interface keepaliveevent {
4214
+ kind: "start" | "heartbeat" | "stop" | "reattach";
4215
+ at: number;
4216
+ detail?: string;
4217
+ }
4218
+ /** One url history entry of a run: the url, the step that navigated and the time it landed in the run record. */
4219
+ export interface urlhistoryentry {
4220
+ url: string;
4221
+ stepid: string;
4222
+ at: number;
4223
+ }
4224
+ /** The provenance attached to every persisted environment event: the origin, the step and the environment it names. */
4225
+ export interface environmentprovenance {
4226
+ origin: string;
4227
+ stepid: string;
4228
+ environment: environmentkind;
4229
+ }
4230
+ /** The persisted run state of one run: the pending step for restart recovery, the url history, the environment and worker turnaround of every step, the keepalive trail and the zombie view. */
4231
+ export interface runstaterecord {
4232
+ runid: string;
4233
+ sessionid: string;
4234
+ planid: string;
4235
+ profileid: string;
4236
+ state: "active" | "recovered" | "reaped" | "completed" | "expired";
4237
+ /** The step that waits when a service worker restart interrupts the run; the executor resumes exactly it. */
4238
+ pendingstepid?: string;
4239
+ urlhistory: urlhistoryentry[];
4240
+ /** The execution environment of every executed step by step id. */
4241
+ environments: Record<string, environmentkind>;
4242
+ /** The worker turnaround of every offloaded step by step id, in milliseconds. */
4243
+ turnarounds: Record<string, number>;
4244
+ keepalive: keepalivestate;
4245
+ /** The provenance of the last persisted environment event. */
4246
+ lastprovenance?: environmentprovenance;
4247
+ updatedat: number;
4248
+ }
4249
+ /** One worker spawn or teardown event recorded beside step outcomes: the worker count of the pool and the reason of the change. */
4250
+ export interface workerevent {
4251
+ id: string;
4252
+ runid: string;
4253
+ kind: "spawn" | "teardown";
4254
+ workers: number;
4255
+ reason: string;
4256
+ provenance: environmentprovenance;
4257
+ at: number;
4258
+ }
4259
+ /** One spawned offscreen document registry entry: the document, its reasons, its justification and its close time. */
4260
+ export interface offscreenregistryentry {
4261
+ document: string;
4262
+ runid: string;
4263
+ reasons: string[];
4264
+ justification: string;
4265
+ createdat: number;
4266
+ closedat?: number;
4267
+ }
4268
+ /** One storage level run lock that holds a session against concurrent runs. */
4269
+ export interface runlock {
4270
+ sessionid: string;
4271
+ runid: string;
4272
+ holder: string;
4273
+ acquiredat: number;
4274
+ /** The user configured lock expiry; an absent expiry keeps the lock until its run releases it. */
4275
+ expiresat?: number;
4276
+ }
4277
+ /** The sealed persistence envelope of one run state: the payload beside its sha-256 integrity digest so tampering with the persisted run state stays detectable at rest. */
4278
+ export interface sealedrunstate {
4279
+ payload: string;
4280
+ algorithm: "sha-256";
4281
+ digest: string;
4282
+ sealedat: number;
4283
+ }
3844
4284
  //# sourceMappingURL=types.d.ts.map