@wenathlan/extension 1.1.62 → 1.1.63

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.
@@ -0,0 +1,213 @@
1
+ import type { agentplan, cancelrunaction, consentmemoryentry, correctionentry, emptystatesurface, errorsurface, errorcause, historyindexentry, historysearchhit, historysearchquery, planprogress, recallindexentry, recallmatch, recallquery, rollbackdescriptor, runsummary, scratchpadentry, sessiongridrow, sitenote, stepoutcome, storedrunlog, tabsessionref } from "./types.js";
2
+ /** Seals one sensitive note body at rest with a local keystream; the sealed text persists while the plain body never does. */
3
+ export declare function sealnotebody(id: string, body: string): string;
4
+ /** Opens one sealed note body for the reading surface; the plain body leaves storage only through this reader. */
5
+ export declare function opennotebody(id: string, sealedbody: string): string;
6
+ /** Builds one site note record per origin: the title, the body, the author provenance and the timestamps; a sensitive note seals its body at rest while a plain note keeps its body readable. */
7
+ export declare function sitenoteof(input: {
8
+ origin: string;
9
+ title: string;
10
+ body: string;
11
+ author: string;
12
+ sensitive?: boolean;
13
+ now: number;
14
+ id?: string;
15
+ }): sitenote;
16
+ /** Reads the display body of one site note: a sensitive note opens its sealed body for the reader while a plain note returns its body. */
17
+ export declare function notebodyof(note: sitenote): string;
18
+ /** Applies one edit to a site note: the edit keeps the author provenance of the writer and the updated timestamp while the created timestamp stays. */
19
+ export declare function editnote(note: sitenote, input: {
20
+ title: string;
21
+ body: string;
22
+ author: string;
23
+ now: number;
24
+ }): sitenote;
25
+ /** Expires the site notes past the user configured window: an absent window keeps every note while the expired notes leave the store at the user boundary only. */
26
+ export declare function expirnotes(notes: sitenote[], retention: number | undefined, now: number): sitenote[];
27
+ /** Builds one append only scratchpad entry of one task with its step provenance; the scratchpad never rewrites a written entry. */
28
+ export declare function scratchentryof(input: {
29
+ taskid: string;
30
+ sessionid: string;
31
+ text: string;
32
+ stepid?: string;
33
+ author: string;
34
+ now: number;
35
+ id?: string;
36
+ }): scratchpadentry;
37
+ /** Reads the scratchpad of one task only: entries of another task never cross the owning task session boundary. */
38
+ export declare function scratchpadof(entries: scratchpadentry[], taskid: string, sessionid: string): scratchpadentry[];
39
+ /** Prunes the scratchpad entries past the user configured window: an absent window keeps every entry while the pruned entries leave the pad only at the user boundary. */
40
+ export declare function prunescratchpad(entries: scratchpadentry[], window: number | undefined, now: number): scratchpadentry[];
41
+ /** Distills one run summary from the completed run: the origins visited, the kinds executed and the per step outcomes inside the user configured window with no fixed cap; the distillation names its provenance. */
42
+ export declare function distillrunsummary(input: {
43
+ plan: agentplan;
44
+ outcomes: stepoutcome[];
45
+ origins: string[];
46
+ sessionid: string;
47
+ window?: number;
48
+ provenance: "offscreenworker" | "inline";
49
+ now: number;
50
+ }): runsummary;
51
+ /** Builds the runsummary search corpus entry of one distilled summary so historysearch indexes every summary beside the notes and the session metadata. */
52
+ export declare function summaryhistoryentry(summary: runsummary): historyindexentry;
53
+ /** Builds the sitenote search corpus entry of one note; a sensitive note indexes its title and origin only so the sealed body never enters the corpus. */
54
+ export declare function notehistoryentry(note: sitenote): historyindexentry;
55
+ /** Builds one recall index entry from a past extraction record: the fingerprint deduplicates repeated extractions while the run and step provenance stays readable. */
56
+ export declare function recallentryof(input: {
57
+ origin: string;
58
+ runid: string;
59
+ stepid: string;
60
+ text: string;
61
+ at: number;
62
+ }): recallindexentry;
63
+ /** Adds one recall index entry with fingerprint deduplication: a repeated extraction keeps its first index entry while later duplicates never double rank. */
64
+ export declare function addrecallentry(index: recallindexentry[], entry: recallindexentry): recallindexentry[];
65
+ /** Ranks the indexed extractions by local text similarity inside the worker: the jaccard overlap of the query terms and the entry terms, scoped to the origins of the run scope, with the provenance of every match. */
66
+ export declare function rankrecall(index: recallindexentry[], query: recallquery, scope: {
67
+ origins: string[];
68
+ }): recallmatch[];
69
+ /** Expires the recall index entries past the user configured window: the live index keeps the window while the extraction records themselves stay for the audit trail. */
70
+ export declare function expirerecallindex(index: recallindexentry[], window: number | undefined, now: number): recallindexentry[];
71
+ /** Builds one correction memory entry from a plan review edit: the step shape before and after the edit with the reason in plain language. */
72
+ export declare function editedcorrectionof(input: {
73
+ origin: string;
74
+ kind: string;
75
+ stepid: string;
76
+ original: string;
77
+ corrected: string;
78
+ reason: string;
79
+ now: number;
80
+ id?: string;
81
+ }): correctionentry;
82
+ /** Builds one correction memory entry from a rejected step: the step shape it refused with the rejection reason. */
83
+ export declare function rejectedcorrectionof(input: {
84
+ origin: string;
85
+ kind: string;
86
+ stepid: string;
87
+ original: string;
88
+ reason: string;
89
+ now: number;
90
+ id?: string;
91
+ }): correctionentry;
92
+ /** Reads the past corrections that match a proposed step by origin and kind so proposal requests feed the matching history in. */
93
+ export declare function matchingcorrections(corrections: correctionentry[], proposal: {
94
+ origin: string;
95
+ kind: string;
96
+ }): correctionentry[];
97
+ /** Expires the correction memory entries past the user configured window: an absent window keeps every correction. */
98
+ export declare function expirecorrections(corrections: correctionentry[], window: number | undefined, now: number): correctionentry[];
99
+ /** Builds one consent memory entry per origin: every grant, denial, expiry and revocation lands with its boundary and kinds while the record stays advisory. */
100
+ export declare function consentmemoryof(input: {
101
+ origin: string;
102
+ decision: "grant" | "deny" | "expire" | "revoke";
103
+ boundary: string;
104
+ kinds: string[];
105
+ expiresat?: number;
106
+ now: number;
107
+ id?: string;
108
+ }): consentmemoryentry;
109
+ /** Reads the prior consent decisions of one origin for the prompt surface: the history stays advisory, the denial records carry the same weight as the grants and no entry ever auto grants. */
110
+ export declare function consentadvisory(entries: consentmemoryentry[], origin: string, now: number): consentmemoryentry[];
111
+ /** Reads the advisory verdict of the consent memory for a new prompt: the latest decision names itself, a refusal keeps its refusal and no history widens a boundary. */
112
+ export declare function consentadvisoryverdict(entries: consentmemoryentry[], origin: string, kind: string): {
113
+ advisory: boolean;
114
+ reason: string;
115
+ };
116
+ /** Computes the queued and the executed steps of one run from the plan and its progress: the queued steps never executed while the executed steps stay in the sealed log. */
117
+ export declare function rollbacksplit(plan: agentplan | undefined, progress: planprogress | undefined): {
118
+ executedstepids: string[];
119
+ queuedstepids: string[];
120
+ };
121
+ /** Builds the rollback option descriptor of one cancelrun: the queued scope rolls the queued steps back only while the executed steps stay untouched in the immutable log. */
122
+ export declare function rollbackof(plan: agentplan | undefined, progress: planprogress | undefined, preference: "queued" | "none" | undefined): rollbackdescriptor;
123
+ /** Builds one cancelrun action with its rollback option descriptor; the action never touches the sealed log of the executed steps. */
124
+ export declare function cancelrunactionof(input: {
125
+ runid: string;
126
+ sessionid: string;
127
+ plan: agentplan | undefined;
128
+ progress: planprogress | undefined;
129
+ preference: "queued" | "none" | undefined;
130
+ }): cancelrunaction;
131
+ /** Builds one error surface payload of a failed step: the cause class, the message, the retry hint with the policy verdict and the context facts. */
132
+ export declare function errorsurfaceof(input: {
133
+ stepid: string;
134
+ runid: string;
135
+ message: string;
136
+ cause: errorcause;
137
+ retryallowed: boolean;
138
+ retryreason: string;
139
+ context: Record<string, string>;
140
+ now: number;
141
+ }): errorsurface;
142
+ /** Classifies the cause of one failed step: a policy refusal and a gate wait carry their own classes, a network shaped message names the network and every other failure stays with the page. */
143
+ export declare function classifyfailure(input: {
144
+ message: string;
145
+ policyrefused: boolean;
146
+ gatewait: boolean;
147
+ }): errorcause;
148
+ /** Reads the retry hint of one error surface: a retry passes only through a new reviewed dispatch, so the verdict names the reviewed path instead of an automatic one. */
149
+ export declare function retryhintof(surface: errorsurface): {
150
+ allowed: boolean;
151
+ reason: string;
152
+ };
153
+ /** Derives the session grid rows from the existing session stores with no new state: the live run derives from the session, the plan and its progress, the saved runs derive from the sealed logs and their summaries, and the per tab lock state names the concurrent holder. */
154
+ export declare function sessiongridrows(input: {
155
+ session?: {
156
+ id: string;
157
+ tabid: number;
158
+ origin: string;
159
+ stoppedat?: number;
160
+ pausedat?: number;
161
+ grants?: string[];
162
+ };
163
+ plan?: agentplan;
164
+ progress?: planprogress;
165
+ logs: storedrunlog[];
166
+ summaries: runsummary[];
167
+ locks: Array<{
168
+ runid: string;
169
+ }>;
170
+ tabsessions: tabsessionref[];
171
+ }): sessiongridrow[];
172
+ /** Normalizes one history search query: the non empty text with the optional origin, time range and outcome filters. */
173
+ export declare function historyqueryof(value: unknown): historysearchquery | undefined;
174
+ /** Adds one corpus entry to the incremental history index: each store write lands in the index at once so the search reads a growing corpus with no rebuild. */
175
+ export declare function addhistoryentry(corpus: historyindexentry[], entry: historyindexentry): historyindexentry[];
176
+ /** Extracts the matched terms of one query inside one text, case insensitive, for the result highlighting. */
177
+ export declare function highlightterms(text: string, query: string): string[];
178
+ /** Searches the one corpus of session metadata, notes and run summaries: the text matches with the matched terms highlighted, filtered by origin, time range and outcome. */
179
+ export declare function historysearch(corpus: historyindexentry[], query: historysearchquery): historysearchhit[];
180
+ /** Serves the empty state guidance of one session interface surface in plain language: the grid explains the first run, the search box suggests a first query, the notes explain the note flow and the scratchpad explains how the agent writes. */
181
+ export declare function emptystatemessage(surface: emptystatesurface, origin?: string): string;
182
+ /** Builds the per tab isolation key of one tab so parallel tabs never collide inside the session stores. */
183
+ export declare function tabsessionkey(tabid: number): string;
184
+ /** Builds one per tab session reference that isolates the session state per tab: parallel tabs keep their own session, run and origin references. */
185
+ export declare function tabsessionrefof(input: {
186
+ tabid: number;
187
+ sessionid: string;
188
+ runid?: string;
189
+ origin: string;
190
+ now: number;
191
+ }): tabsessionref;
192
+ /** Exports the site notes, the run summaries and the correction memory as one audit bundle: every record carries its provenance while sensitive note bodies stay sealed. */
193
+ export declare function sessionbundleof(input: {
194
+ notes: sitenote[];
195
+ summaries: runsummary[];
196
+ corrections: correctionentry[];
197
+ exportedat: number;
198
+ }): {
199
+ kind: "sessionbundle";
200
+ notes: sitenote[];
201
+ summaries: runsummary[];
202
+ corrections: correctionentry[];
203
+ exportedat: number;
204
+ };
205
+ /**
206
+ * The recall seam the memory adapter documents for the future remote recall backend: today the local fingerprint index answers every semanticrecall query inside the extension, and the seam keeps the query and answer shapes stable so a reviewed remote backend can take the calls later without touching the callers.
207
+ */
208
+ export interface recallseam {
209
+ recall(query: recallquery, scope: {
210
+ origins: string[];
211
+ }): Promise<recallmatch[]>;
212
+ }
213
+ //# sourceMappingURL=sessioninterface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessioninterface.d.ts","sourceRoot":"","sources":["../sessioninterface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAE,iBAAiB,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA8BvX,8HAA8H;AAC9H,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7D;AAED,kHAAkH;AAClH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAMnE;AAED,iMAAiM;AACjM,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,QAAQ,CAO1J;AAED,0IAA0I;AAC1I,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAGjD;AAED,uJAAuJ;AACvJ,wBAAgB,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAA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,GAAG,MAAM,CAEnD;AAED,qJAAqJ;AACrJ,wBAAgB,eAAe,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,aAAa,CAIvI;AAED,4KAA4K;AAC5K,wBAAgB,eAAe,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAAC,SAAS,EAAE,UAAU,EAAE,CAAC;IAAC,WAAW,EAAE,eAAe,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAAC,SAAS,EAAE,UAAU,EAAE,CAAC;IAAC,WAAW,EAAE,eAAe,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAEpQ;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;CAClF"}
package/dist/types.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export declare const protocolversion: "1.1.62";
1
+ export declare const protocolversion: "1.1.63";
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" | "environment" | "worker" | "sandbox" | "grant" | "expiry" | "revoke" | "deny" | "seal" | "mask" | "vault" | "gate" | "phish" | "defer" | "schema" | "inbound" | "transparency";
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" | "grant" | "expiry" | "revoke" | "deny" | "seal" | "mask" | "vault" | "gate" | "phish" | "defer" | "schema" | "inbound" | "transparency" | "notes" | "scratchpad" | "summary" | "recall" | "correction" | "consentmemory" | "cancel" | "search";
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 {
@@ -228,6 +228,22 @@ export interface runsettings {
228
228
  phishfreshness?: number;
229
229
  /** User configured mask shapes for sensitive field shapes beyond the documented password, token, card and secret families; per origin mask rules extend this list. */
230
230
  maskshapes?: string[];
231
+ /** Retention window for stored site notes; an absent window keeps every note. */
232
+ noteretention?: number;
233
+ /** Retention window for scratchpad entries; an absent window keeps every entry. */
234
+ scratchpadretention?: number;
235
+ /** Retention window for stored run summaries; an absent window keeps every summary. */
236
+ summaryretention?: number;
237
+ /** Retention window for stored correction memory entries; an absent window keeps every correction. */
238
+ correctionretention?: number;
239
+ /** The semantic recall index window in milliseconds; an entry older than the window leaves the live index while its records stay. */
240
+ recallwindow?: number;
241
+ /** True when historysearch index building stays on; an absent value keeps the incremental index on. */
242
+ historyindex?: boolean;
243
+ /** The user cancelrun rollback preference: queued rolls the queued steps back while none stops the run without a rollback. */
244
+ cancelrollback?: "queued" | "none";
245
+ /** The runsummary length window in steps the distillation keeps; an absent window keeps every step with no fixed cap. */
246
+ summarywindow?: number;
231
247
  }
232
248
  export interface proposalrequest {
233
249
  objective: string;
@@ -4305,7 +4321,7 @@ export interface sealedrunstate {
4305
4321
  /** The sensitive classes of the 1.1.61 family: payment, credential, delete and publish steps each need one fresh consent prompt per class per origin. */
4306
4322
  export type sensitiveclass = "payment" | "credential" | "delete" | "publish";
4307
4323
  /** The event kinds of the immutable run log: step transitions, grants, window expiries, revocations, denials, suspensions, resumes and the completion seal. */
4308
- export type logeventkind = "step" | "grant" | "expiry" | "revoke" | "deny" | "suspend" | "resume" | "seal" | "gate" | "phish" | "schema" | "inbound";
4324
+ export type logeventkind = "step" | "grant" | "expiry" | "revoke" | "deny" | "suspend" | "resume" | "seal" | "gate" | "phish" | "schema" | "inbound" | "cancel";
4309
4325
  /** The hash chain fields of one immutable log entry: the hash of its predecessor, the entry hash written at append time and the algorithm that derives both. */
4310
4326
  export interface loghash {
4311
4327
  previous: string;
@@ -4595,4 +4611,183 @@ export interface transparencygrant {
4595
4611
  boundary: string;
4596
4612
  grantedat: number;
4597
4613
  }
4614
+ /**
4615
+ * Session interface contracts of the 1.1.63 family.
4616
+ * The session becomes the primary interface here: sitenotes keep one note record per origin with title, body and author provenance while sensitive bodies seal at rest, the scratchpad holds append only entries per task with step provenance, runsummary distills a completed run into the origins visited, the kinds executed and the per step outcomes inside the user configured window, semanticrecall embeds past extraction records into a local fingerprint indexed corpus ranked by text similarity with run and step provenance, correctionmemory captures every plan review edit and rejection per origin and kind, consentmemory keeps every grant, denial, expiry and revocation per origin as advisory history that never auto grants, sessiongrid rows derive from the existing session stores with no new state, historysearch indexes session metadata, notes and summaries into one incremental corpus, errorsurface classifies every failed step cause as page, network, policy or gate with a retry hint carrying the policy verdict, and cancelrun rolls the queued steps back only while the executed steps stay untouched in the sealed log.
4617
+ * The consent gates do not move: every interface action rides the same session, plan and origin review, and no interface surface ever bypasses the human review.
4618
+ */
4619
+ /** One site note per origin: the title, the plain or sealed body, the author provenance and the timestamps; a sensitive note seals its body at rest so the plain text never persists. */
4620
+ export interface sitenote {
4621
+ id: string;
4622
+ origin: string;
4623
+ title: string;
4624
+ /** The plain body of a non sensitive note; a sensitive note carries its sealedbody instead. */
4625
+ body?: string;
4626
+ /** The locally sealed body of a sensitive note; the sealing stays an at rest measure and never replaces the user keychain. */
4627
+ sealedbody?: string;
4628
+ author: string;
4629
+ sensitive: boolean;
4630
+ createdat: number;
4631
+ updatedat: number;
4632
+ }
4633
+ /** One append only scratchpad entry of one task: the text, its optional step provenance and the timestamp. */
4634
+ export interface scratchpadentry {
4635
+ id: string;
4636
+ taskid: string;
4637
+ sessionid: string;
4638
+ text: string;
4639
+ /** The step the entry was written beside; an entry the user writes carries none. */
4640
+ stepid?: string;
4641
+ author: string;
4642
+ at: number;
4643
+ }
4644
+ /** One distilled run summary of a completed run: the origins visited, the kinds executed, the per step outcomes inside the user configured window and the distillation provenance that names the offscreen worker task. */
4645
+ export interface runsummary {
4646
+ runid: string;
4647
+ sessionid: string;
4648
+ origins: string[];
4649
+ kinds: string[];
4650
+ steps: Array<{
4651
+ stepid: string;
4652
+ kind: string;
4653
+ ok: boolean;
4654
+ summary: string;
4655
+ }>;
4656
+ /** The user configured step window the summary keeps; an absent window keeps every step with no fixed cap. */
4657
+ window?: number;
4658
+ task: "runsummary";
4659
+ /** The distillation provenance: the offscreen worker pool or the inline fallback beside the page. */
4660
+ provenance: "offscreenworker" | "inline";
4661
+ distilledat: number;
4662
+ }
4663
+ /** One semantic recall query: the text to recall and the optional origin scope that stays inside the run scope. */
4664
+ export interface recallquery {
4665
+ text: string;
4666
+ origin?: string;
4667
+ /** The user chosen match limit; an absent limit keeps every ranked match. */
4668
+ limit?: number;
4669
+ }
4670
+ /** One semantic recall index entry: the extraction fingerprint, the origin, the run and step provenance and the indexed text. */
4671
+ export interface recallindexentry {
4672
+ fingerprint: string;
4673
+ origin: string;
4674
+ runid: string;
4675
+ stepid: string;
4676
+ text: string;
4677
+ at: number;
4678
+ }
4679
+ /** One ranked semantic recall match: the indexed entry, the text similarity score and the plain language reason. */
4680
+ export interface recallmatch {
4681
+ entry: recallindexentry;
4682
+ score: number;
4683
+ reason: string;
4684
+ }
4685
+ /** One correction memory entry: the plan review edit or rejection captured per origin and kind, linking the step to its correction. */
4686
+ export interface correctionentry {
4687
+ id: string;
4688
+ origin: string;
4689
+ kind: string;
4690
+ stepid: string;
4691
+ source: "edited" | "rejected";
4692
+ /** The step shape before the correction. */
4693
+ original: string;
4694
+ /** The corrected step shape; a rejected step carries none. */
4695
+ corrected?: string;
4696
+ reason: string;
4697
+ at: number;
4698
+ }
4699
+ /** One consent memory entry per origin: the grant, denial, expiry or revocation decision with its boundary, its kinds and its optional expiry; the record stays advisory and never auto grants. */
4700
+ export interface consentmemoryentry {
4701
+ id: string;
4702
+ origin: string;
4703
+ decision: "grant" | "deny" | "expire" | "revoke";
4704
+ boundary: string;
4705
+ kinds: string[];
4706
+ at: number;
4707
+ /** The expiry the decision carried; an absent expiry keeps the record as history only. */
4708
+ expiresat?: number;
4709
+ }
4710
+ /** One session grid row derived from the session stores with no new state: the session and run ids, the origin set, the live or saved state, the outcome, the step counts, the per tab lock state, the seal hash link of the sealed log chain and the actions the row offers. */
4711
+ export interface sessiongridrow {
4712
+ sessionid: string;
4713
+ runid: string;
4714
+ origins: string[];
4715
+ state: "live" | "saved";
4716
+ outcome: string;
4717
+ steps: number;
4718
+ completed: number;
4719
+ lock: "held" | "free";
4720
+ tabid?: number;
4721
+ sealhash?: string;
4722
+ updatedat: number;
4723
+ actions: Array<"resume" | "cancelrun" | "reopen">;
4724
+ }
4725
+ /** One history search query: the text with the optional origin, time range and outcome filters. */
4726
+ export interface historysearchquery {
4727
+ text: string;
4728
+ origin?: string;
4729
+ from?: number;
4730
+ to?: number;
4731
+ outcome?: string;
4732
+ }
4733
+ /** The corpus sources historysearch indexes: session metadata, site notes and run summaries in one corpus. */
4734
+ export type historysource = "session" | "note" | "summary";
4735
+ /** One history search corpus entry written incrementally on each store write. */
4736
+ export interface historyindexentry {
4737
+ source: historysource;
4738
+ id: string;
4739
+ origin?: string;
4740
+ title: string;
4741
+ text: string;
4742
+ outcome?: string;
4743
+ at: number;
4744
+ }
4745
+ /** One history search hit with the matched terms highlighted and the sealed run link. */
4746
+ export interface historysearchhit {
4747
+ source: historysource;
4748
+ id: string;
4749
+ title: string;
4750
+ excerpt: string;
4751
+ highlights: string[];
4752
+ origin?: string;
4753
+ outcome?: string;
4754
+ at: number;
4755
+ }
4756
+ /** The cause classes of one error surface: the page, the network, the policy or a confirm gate. */
4757
+ export type errorcause = "page" | "network" | "policy" | "gate";
4758
+ /** One error surface payload of a failed step: the cause class, the message in plain language, the retry hint with its policy verdict and the context facts. */
4759
+ export interface errorsurface {
4760
+ stepid: string;
4761
+ runid: string;
4762
+ cause: errorcause;
4763
+ message: string;
4764
+ retry: {
4765
+ allowed: boolean;
4766
+ reason: string;
4767
+ };
4768
+ context: Record<string, string>;
4769
+ at: number;
4770
+ }
4771
+ /** The rollback option descriptor of a cancelrun action: the queued steps it rolls back while the executed steps stay untouched. */
4772
+ export interface rollbackdescriptor {
4773
+ scope: "queued" | "none";
4774
+ label: string;
4775
+ queuedstepids: string[];
4776
+ }
4777
+ /** The cancelrun action of one run: the run and the session it stops with its rollback option descriptor. */
4778
+ export interface cancelrunaction {
4779
+ runid: string;
4780
+ sessionid: string;
4781
+ rollback: rollbackdescriptor;
4782
+ }
4783
+ /** The empty state surfaces of the session interface: the session grid, the history search box, the site notes and the scratchpad. */
4784
+ export type emptystatesurface = "sessiongrid" | "historysearch" | "sitenotes" | "scratchpad";
4785
+ /** One per tab session reference that isolates parallel tabs: the tab, its session, its optional run and its origin. */
4786
+ export interface tabsessionref {
4787
+ tabid: number;
4788
+ sessionid: string;
4789
+ runid?: string;
4790
+ origin: string;
4791
+ updatedat: number;
4792
+ }
4598
4793
  //# sourceMappingURL=types.d.ts.map