@wenathlan/extension 1.1.54 → 1.1.56
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 +4 -4
- package/dist/agentstream.d.ts +155 -0
- package/dist/agentstream.d.ts.map +1 -0
- package/dist/approvalgate.d.ts +39 -0
- package/dist/approvalgate.d.ts.map +1 -0
- package/dist/clientauth.d.ts +114 -0
- package/dist/clientauth.d.ts.map +1 -0
- package/dist/httpstream.d.ts +92 -0
- package/dist/httpstream.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4892 -4304
- package/dist/index.js.map +4 -4
- package/dist/mcpserver.d.ts +29 -9
- package/dist/mcpserver.d.ts.map +1 -1
- package/dist/memory.d.ts +93 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/policy.d.ts +44 -1
- package/dist/policy.d.ts.map +1 -1
- package/dist/protocol.d.ts +278 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/toolcatalog.d.ts +2 -2
- package/dist/types.d.ts +347 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/extension/dist/background.js +1310 -155
- package/extension/dist/background.js.map +4 -4
- package/extension/dist/manifest.json +1 -1
- package/extension/dist/pagebridge.js.map +1 -1
- package/extension/dist/popup.html +1 -1
- package/extension/dist/popup.js +4 -1
- package/extension/dist/popup.js.map +2 -2
- package/extension/dist/sidepanel.js +397 -7
- package/extension/dist/sidepanel.js.map +3 -3
- package/extension/manifest.json +1 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const protocolversion: "1.1.
|
|
1
|
+
export declare const protocolversion: "1.1.56";
|
|
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";
|
|
@@ -3007,9 +3007,15 @@ export interface toolschema {
|
|
|
3007
3007
|
properties: Record<string, toolschemaproperty>;
|
|
3008
3008
|
required: string[];
|
|
3009
3009
|
}
|
|
3010
|
-
/** The consent metadata of a sensitive tool: the plain language review requirement the panel renders before the tool may run. */
|
|
3010
|
+
/** The consent metadata of a sensitive tool: the plain language review requirement the panel renders before the tool may run, the policy derived risk class, the approval gate requirement and the origin scope the tool executes under. */
|
|
3011
3011
|
export interface consentmeta {
|
|
3012
3012
|
review: string;
|
|
3013
|
+
/** Risk class policy derives from the wrapped action kind; read tools carry no gate metadata. */
|
|
3014
|
+
riskclass?: actionrisk;
|
|
3015
|
+
/** True when the tool requires an explicit approval gate before a remote client may call it. */
|
|
3016
|
+
approvalrequired?: boolean;
|
|
3017
|
+
/** Origin scope the tool executes under: the session grants restrict every call. */
|
|
3018
|
+
originscope?: "session";
|
|
3013
3019
|
}
|
|
3014
3020
|
/** One mcp tool definition: the namespaced name, the version appended for compatibility checks, the description that states the consent class and side effects in plain language, the json schema of its inputs, the reviewed action kind it wraps, its risk grade and the consent metadata of tools with side effects. */
|
|
3015
3021
|
export interface tooldef {
|
|
@@ -3041,7 +3047,7 @@ export interface toolresult {
|
|
|
3041
3047
|
payload?: Record<string, unknown>;
|
|
3042
3048
|
iserror: boolean;
|
|
3043
3049
|
}
|
|
3044
|
-
/** The capability set exchanged during negotiation: the protocol version, the server identity, the tool compatibility floor, the offered tool count, the namespaces and the allowed transports. */
|
|
3050
|
+
/** The capability set exchanged during negotiation: the protocol version, the server identity, the tool compatibility floor, the offered tool count, the namespaces and the allowed transports; the 1.1.56 family adds the client declared model capabilities of sampling, prompt rendering and streaming. */
|
|
3045
3051
|
export interface capabilityset {
|
|
3046
3052
|
protocolversion: string;
|
|
3047
3053
|
name: string;
|
|
@@ -3051,6 +3057,12 @@ export interface capabilityset {
|
|
|
3051
3057
|
tools: number;
|
|
3052
3058
|
namespaces: toolnamespace[];
|
|
3053
3059
|
transports: transportkind[];
|
|
3060
|
+
/** True when the client model accepts sampling callbacks. */
|
|
3061
|
+
sampling?: boolean;
|
|
3062
|
+
/** True when the client renders prompt tools. */
|
|
3063
|
+
prompts?: boolean;
|
|
3064
|
+
/** True when the client consumes streamed result chunks. */
|
|
3065
|
+
streaming?: boolean;
|
|
3054
3066
|
}
|
|
3055
3067
|
/** One connected mcp client: the id, the transport it rides, the negotiated capability set, the pairing state the user approves and the connection timestamps. */
|
|
3056
3068
|
export interface clientrecord {
|
|
@@ -3058,6 +3070,10 @@ export interface clientrecord {
|
|
|
3058
3070
|
transport: transportkind;
|
|
3059
3071
|
/** The capability set negotiated with this client. */
|
|
3060
3072
|
capabilities?: capabilityset;
|
|
3073
|
+
/** Tool compatibility floor this client negotiated; tools with a version below it are refused. */
|
|
3074
|
+
toolfloor?: number;
|
|
3075
|
+
/** Fingerprint of the remote client identity; local stdio clients carry none. */
|
|
3076
|
+
fingerprint?: string;
|
|
3061
3077
|
/** True once the user approved the session for this client; unpaired clients never dispatch tools. */
|
|
3062
3078
|
paired: boolean;
|
|
3063
3079
|
connectedat: number;
|
|
@@ -3069,7 +3085,7 @@ export interface clientrecord {
|
|
|
3069
3085
|
/** One entry of the mcp server routing table: the json rpc method name, the plain language description and the internal handler the server routes matching frames to. */
|
|
3070
3086
|
export interface methodentry {
|
|
3071
3087
|
method: string;
|
|
3072
|
-
handler: "initialize" | "ping" | "listtools" | "negotiate" | "dispatch";
|
|
3088
|
+
handler: "initialize" | "ping" | "listtools" | "negotiate" | "dispatch" | "listprompts" | "callprompt" | "cancel";
|
|
3073
3089
|
description: string;
|
|
3074
3090
|
}
|
|
3075
3091
|
/** The user configured mcp server state: the bind address with localhost as the documented default, the port, the allowed transports, the user configured frame size and queue depth with no code ceiling, the explicit user enablement flag and the reviewed flag a remote bind requires. */
|
|
@@ -3087,12 +3103,18 @@ export interface mcpserverconfig {
|
|
|
3087
3103
|
enabled: boolean;
|
|
3088
3104
|
/** True once the user reviewed the remote bind; a bind outside localhost is refused without it. */
|
|
3089
3105
|
remote?: boolean;
|
|
3106
|
+
/** The http stream transport config of the 1.1.55 family: the posted endpoint path, the stream channel path, tls termination and the heartbeat rhythm. */
|
|
3107
|
+
httpstream?: httpstreamconfig;
|
|
3108
|
+
/** The remote access policy of the 1.1.55 family: the advertised endpoint, the required tls mode, the client ceiling and the token and approval windows. */
|
|
3109
|
+
remoteaccess?: remoteconfig;
|
|
3090
3110
|
}
|
|
3091
|
-
/** The persisted runtime state of the mcp server: the server state, the stdio bridge status and the last transition times. */
|
|
3111
|
+
/** The persisted runtime state of the mcp server: the server state, the stdio bridge status, the auth challenge of the pending remote handshake and the last transition times. */
|
|
3092
3112
|
export interface mcpserverstate {
|
|
3093
3113
|
state: serverstate;
|
|
3094
3114
|
/** The stdio bridge status while the server runs. */
|
|
3095
3115
|
bridge?: stdiobridge;
|
|
3116
|
+
/** The auth challenge issued to the newest remote client; the handshake verifies its nonce before the pairing exchange. */
|
|
3117
|
+
challenge?: authchallenge;
|
|
3096
3118
|
startedat?: number;
|
|
3097
3119
|
stoppedat?: number;
|
|
3098
3120
|
}
|
|
@@ -3117,7 +3139,7 @@ export interface bridgelaunch {
|
|
|
3117
3139
|
restart: boolean;
|
|
3118
3140
|
at: number;
|
|
3119
3141
|
}
|
|
3120
|
-
/** One mcp tool call record: the calling client, the namespaced tool name, the origin the call ran under, the outcome flag, the json rpc error code when the call was refused and the time. */
|
|
3142
|
+
/** One mcp tool call record: the calling client, the namespaced tool name, the origin the call ran under, the outcome flag, the json rpc error code when the call was refused and the time; the 1.1.56 family adds the call id, the idempotency key, the dry run, mock and batch markers and the replay marker so the audit trail names every call without exception. */
|
|
3121
3143
|
export interface toolcallrecord {
|
|
3122
3144
|
id: string;
|
|
3123
3145
|
clientid: string;
|
|
@@ -3126,5 +3148,324 @@ export interface toolcallrecord {
|
|
|
3126
3148
|
ok: boolean;
|
|
3127
3149
|
code?: rpcerrorcode;
|
|
3128
3150
|
at: number;
|
|
3151
|
+
/** The call context id of the 1.1.56 family when the call ran through the call runtime. */
|
|
3152
|
+
callid?: string;
|
|
3153
|
+
/** The idempotency key the client attached; a repeated key replays the stored result. */
|
|
3154
|
+
idempotencykey?: idempotencykey;
|
|
3155
|
+
/** True when the call ran as a tool dry run with no side effects. */
|
|
3156
|
+
dryrun?: boolean;
|
|
3157
|
+
/** True when a tool mock answered the call without touching the browser. */
|
|
3158
|
+
mocked?: boolean;
|
|
3159
|
+
/** The batch call id when the call ran as a batch member. */
|
|
3160
|
+
batchid?: string;
|
|
3161
|
+
/** True when the answer replayed a stored idempotent result instead of executing. */
|
|
3162
|
+
replayed?: boolean;
|
|
3163
|
+
}
|
|
3164
|
+
/**
|
|
3165
|
+
* Agent protocol part two contracts of the 1.1.55 family: the http stream transport with tls, session tokens, pairing codes, client allowlists, approval gates and the auth handshake for remote clients.
|
|
3166
|
+
* Nothing remote runs without a paired, allowed and authenticated client, and no certificate, endpoint, provider or key is ever hardcoded — every endpoint, window and ceiling stays a user choice.
|
|
3167
|
+
*/
|
|
3168
|
+
/** The stored form of a session token: the sha-256 hex digest of the raw token value under the `sha256:` prefix; the raw token itself never persists. */
|
|
3169
|
+
export type tokenhash = string;
|
|
3170
|
+
/** The lifecycle states of a pairing code: pending until redeemed while a used or expired code never pairs a second client. */
|
|
3171
|
+
export type pairingstate = "pending" | "used" | "expired";
|
|
3172
|
+
/** The lifecycle states of an approval gate: pending until the user decides while refused and expired gates never execute. */
|
|
3173
|
+
export type approvalstate = "pending" | "approved" | "refused" | "expired";
|
|
3174
|
+
/** The tls modes of the remote transport: off keeps the documented localhost default, on negotiates and required refuses any unverified peer. */
|
|
3175
|
+
export type tlsmode = "off" | "on" | "required";
|
|
3176
|
+
/** The auth methods of the handshake: the one time pairing code exchange, the stored session token and the client certificate. */
|
|
3177
|
+
export type authmethod = "pairingcode" | "token" | "certificate";
|
|
3178
|
+
/** The tls termination settings of a transport: the user chosen mode, the sha-256 fingerprint of the user installed certificate and the time the peer was last verified. */
|
|
3179
|
+
export interface tlsconfig {
|
|
3180
|
+
mode: tlsmode;
|
|
3181
|
+
/** Sha-256 fingerprint of the user installed certificate; remote traffic requires a match when set. */
|
|
3182
|
+
certificatefingerprint?: string;
|
|
3183
|
+
verifiedat?: number;
|
|
3184
|
+
}
|
|
3185
|
+
/** The http stream transport config: the json rpc endpoint path remote clients post frames to, the server sent event channel path streams flow through, the tls termination settings and the user configured heartbeat rhythm. */
|
|
3186
|
+
export interface httpstreamconfig {
|
|
3187
|
+
endpoint: string;
|
|
3188
|
+
streampath: string;
|
|
3189
|
+
tls: tlsconfig;
|
|
3190
|
+
/** User configured heartbeat interval of the event channels; an absent value keeps the documented default. */
|
|
3191
|
+
heartbeatms?: number;
|
|
3192
|
+
/** User configured idle window after which a silent channel counts as dead; an absent value keeps the documented default. */
|
|
3193
|
+
idlewindowms?: number;
|
|
3194
|
+
}
|
|
3195
|
+
/** One remote client identity: the fingerprint the allowlist matches and the display name the approval prompts carry. */
|
|
3196
|
+
export interface clientidentity {
|
|
3197
|
+
fingerprint: string;
|
|
3198
|
+
displayname: string;
|
|
3199
|
+
}
|
|
3200
|
+
/** One session token of a paired remote client: the client it belongs to, its stored tokenhash form (never the raw token), the tool namespaces its scopes grant, the issue and expiry times and the revocation time. */
|
|
3201
|
+
export interface sessiontoken {
|
|
3202
|
+
id: string;
|
|
3203
|
+
clientid: string;
|
|
3204
|
+
hash: tokenhash;
|
|
3205
|
+
scopes: toolnamespace[];
|
|
3206
|
+
issuedat: number;
|
|
3207
|
+
expiresat: number;
|
|
3208
|
+
revokedat?: number;
|
|
3209
|
+
}
|
|
3210
|
+
/** One pairing code for a one time client pairing: the human copied code, the tool namespaces it grants, the issue and expiry times and the single use state. */
|
|
3211
|
+
export interface pairingcode {
|
|
3212
|
+
code: string;
|
|
3213
|
+
scopes: toolnamespace[];
|
|
3214
|
+
issuedat: number;
|
|
3215
|
+
expiresat: number;
|
|
3216
|
+
usedat?: number;
|
|
3217
|
+
}
|
|
3218
|
+
/** One client allowlist entry: the client identity fingerprint, the granted tool namespaces and the grant history of every scope change. */
|
|
3219
|
+
export interface allowlistentry {
|
|
3220
|
+
fingerprint: string;
|
|
3221
|
+
displayname: string;
|
|
3222
|
+
namespaces: toolnamespace[];
|
|
3223
|
+
grantedat: number;
|
|
3224
|
+
/** Grant history: every scope change lands with its actor, time and plain language change. */
|
|
3225
|
+
history: Array<{
|
|
3226
|
+
at: number;
|
|
3227
|
+
actor: string;
|
|
3228
|
+
change: string;
|
|
3229
|
+
}>;
|
|
3230
|
+
}
|
|
3231
|
+
/** One approval gate raised for a sensitive tool call: the calling client, the tool, the reason in plain language, the full call arguments, the fields the user marked secret, the pending state and the timeout that refuses by default. */
|
|
3232
|
+
export interface approvalrequest {
|
|
3233
|
+
id: string;
|
|
3234
|
+
clientid: string;
|
|
3235
|
+
tool: string;
|
|
3236
|
+
reason: string;
|
|
3237
|
+
params: Record<string, unknown>;
|
|
3238
|
+
/** Fields the user marked secret; their values are redacted in prompts and audit records. */
|
|
3239
|
+
secretfields?: string[];
|
|
3240
|
+
state: approvalstate;
|
|
3241
|
+
raisedat: number;
|
|
3242
|
+
/** Configurable refusal window; a gate left unanswered past this time refuses by default. */
|
|
3243
|
+
timeoutat?: number;
|
|
3244
|
+
decidedat?: number;
|
|
3245
|
+
actor?: string;
|
|
3246
|
+
}
|
|
3247
|
+
/** One approval execution record: the gate it closes, the decision, the acting user, the time and the latency from the raise to the decision. */
|
|
3248
|
+
export interface approvalexec {
|
|
3249
|
+
requestid: string;
|
|
3250
|
+
decision: approvalstate;
|
|
3251
|
+
actor: string;
|
|
3252
|
+
at: number;
|
|
3253
|
+
/** Latency in milliseconds from the gate raise to the decision. */
|
|
3254
|
+
latencyms: number;
|
|
3255
|
+
}
|
|
3256
|
+
/** One auth challenge of the remote handshake: the method it authenticates, the single use nonce and the expiry. */
|
|
3257
|
+
export interface authchallenge {
|
|
3258
|
+
nonce: string;
|
|
3259
|
+
method: authmethod;
|
|
3260
|
+
issuedat: number;
|
|
3261
|
+
expiresat: number;
|
|
3262
|
+
}
|
|
3263
|
+
/** One auth handshake event with its outcome: the client, the method, the issued, verified or refused outcome and the time. */
|
|
3264
|
+
export interface authhandshakeevent {
|
|
3265
|
+
id: string;
|
|
3266
|
+
clientid: string;
|
|
3267
|
+
method: authmethod;
|
|
3268
|
+
outcome: "issued" | "verified" | "refused";
|
|
3269
|
+
at: number;
|
|
3270
|
+
}
|
|
3271
|
+
/** The approval gate timeout: the user configured pending window in milliseconds and the documented default disposition of an unanswered gate — refusal. */
|
|
3272
|
+
export interface approvaltimeout {
|
|
3273
|
+
windowms: number;
|
|
3274
|
+
ontimeout: "refuse";
|
|
3275
|
+
}
|
|
3276
|
+
/** The remote access policy of the mcp server: the advertised endpoint, the required tls mode, the user configured client ceiling and the token and approval windows; an absent ceiling keeps the client count unbounded. */
|
|
3277
|
+
export interface remoteconfig {
|
|
3278
|
+
endpoint: string;
|
|
3279
|
+
tls: tlsconfig;
|
|
3280
|
+
/** User configured maximum paired remote clients; an absent value keeps the count unbounded. */
|
|
3281
|
+
maxclients?: number;
|
|
3282
|
+
/** User configured session token lifetime; an absent value keeps the documented default. */
|
|
3283
|
+
tokenlifetimems?: number;
|
|
3284
|
+
approvaltimeout?: approvaltimeout;
|
|
3285
|
+
}
|
|
3286
|
+
/** One server sent event channel of the http stream transport: the client it streams to, the open and heartbeat times, the last event time and the close time. */
|
|
3287
|
+
export interface streamchannel {
|
|
3288
|
+
id: string;
|
|
3289
|
+
clientid: string;
|
|
3290
|
+
openedat: number;
|
|
3291
|
+
lastbeatat: number;
|
|
3292
|
+
lasteventat?: number;
|
|
3293
|
+
closedat?: number;
|
|
3294
|
+
}
|
|
3295
|
+
/**
|
|
3296
|
+
* Agent protocol part three contracts of the 1.1.56 family: event subscriptions, resource watchers, sampling callbacks, prompt tools, streaming chunks, progress notices, in flight cancellation, per client rate limits, structured errors with retry hints, idempotency keys, batch calls, tool dry runs, tool mocks and the call contexts that isolate concurrent clients.
|
|
3297
|
+
* Every frame still passes the same consent gates — the protocol layer never bypasses review — and every window, budget and ceiling stays a user choice with no code ceiling and no hardcoded endpoint, provider or key.
|
|
3298
|
+
*/
|
|
3299
|
+
/** The protocol event kinds a client may subscribe to: callstarted mirrors every tool call including calls with side effects while the rest stay observation kinds. */
|
|
3300
|
+
export type eventkind = "callstarted" | "callresult" | "streamchunk" | "progress" | "resourcedelta" | "sampling" | "cancellation";
|
|
3301
|
+
/** One event subscription of a paired client: the event kinds it listens to, the optional origin and tool filters that narrow delivery and the lifecycle times. */
|
|
3302
|
+
export interface protocoleventsubscription {
|
|
3303
|
+
id: string;
|
|
3304
|
+
clientid: string;
|
|
3305
|
+
kinds: eventkind[];
|
|
3306
|
+
/** Optional origin filter: only events of this origin reach the subscriber. */
|
|
3307
|
+
origin?: string;
|
|
3308
|
+
/** Optional tool name filter: only events of this namespaced tool reach the subscriber. */
|
|
3309
|
+
tool?: string;
|
|
3310
|
+
createdat: number;
|
|
3311
|
+
lastdeliveredat?: number;
|
|
3312
|
+
canceledat?: number;
|
|
3313
|
+
}
|
|
3314
|
+
/** One resource watcher of a paired client: the watched page state resource, the page state baseline at watch time and the lifecycle times. */
|
|
3315
|
+
export interface resourcewatch {
|
|
3316
|
+
id: string;
|
|
3317
|
+
clientid: string;
|
|
3318
|
+
/** The watched resource name of the page state, for example the page snapshot resource of the session tab. */
|
|
3319
|
+
resource: string;
|
|
3320
|
+
/** The page state baseline captured at watch time; deltas compare against it. */
|
|
3321
|
+
baseline: Record<string, unknown>;
|
|
3322
|
+
createdat: number;
|
|
3323
|
+
lastdeliveredat?: number;
|
|
3324
|
+
canceledat?: number;
|
|
3325
|
+
}
|
|
3326
|
+
/** One sampling callback to a client model: the prompt that leaves the browser, the optional system text, the page content the user granted, the lifecycle state and the provenance times. */
|
|
3327
|
+
export interface samplingrequest {
|
|
3328
|
+
id: string;
|
|
3329
|
+
clientid: string;
|
|
3330
|
+
prompt: string;
|
|
3331
|
+
system?: string;
|
|
3332
|
+
/** Page content the user granted for this callback; stripped before the prompt leaves when the user granted none. */
|
|
3333
|
+
pagecontent?: string;
|
|
3334
|
+
/** User granted maximum tokens of the callback completion; an absent value leaves the size to the client. */
|
|
3335
|
+
maxtokens?: number;
|
|
3336
|
+
state: "pending" | "answered" | "refused";
|
|
3337
|
+
requestedat: number;
|
|
3338
|
+
answeredat?: number;
|
|
3339
|
+
/** The client answer once it arrives; the provenance records the client and the times. */
|
|
3340
|
+
answer?: string;
|
|
3341
|
+
}
|
|
3342
|
+
/** One prompt def exposed as a callable tool: the prompt name, the plain language description, the declared arguments and the render template. */
|
|
3343
|
+
export interface promptdef {
|
|
3344
|
+
name: string;
|
|
3345
|
+
description: string;
|
|
3346
|
+
/** Declared arguments of the prompt with their descriptions, required markers and reviewed defaults. */
|
|
3347
|
+
arguments: Array<{
|
|
3348
|
+
name: string;
|
|
3349
|
+
description: string;
|
|
3350
|
+
required?: boolean;
|
|
3351
|
+
default?: string;
|
|
3352
|
+
}>;
|
|
3353
|
+
/** The render template; every double braced argument placeholder substitutes its value. */
|
|
3354
|
+
template: string;
|
|
3355
|
+
}
|
|
3356
|
+
/** One stream chunk of a progressive tool result: the call it belongs to, the sequence number, the content slice, the done marker and the time. */
|
|
3357
|
+
export interface streamchunk {
|
|
3358
|
+
callid: string;
|
|
3359
|
+
seq: number;
|
|
3360
|
+
content: string;
|
|
3361
|
+
done: boolean;
|
|
3362
|
+
at: number;
|
|
3363
|
+
}
|
|
3364
|
+
/** One progress notice of a long tool call: the call it belongs to, the optional percent, the plain language message, the cancellable hint and the time. */
|
|
3365
|
+
export interface progressnotice {
|
|
3366
|
+
callid: string;
|
|
3367
|
+
percent?: number;
|
|
3368
|
+
message: string;
|
|
3369
|
+
/** True when the user may cancel the in flight call. */
|
|
3370
|
+
cancellable: boolean;
|
|
3371
|
+
at: number;
|
|
3372
|
+
}
|
|
3373
|
+
/** One cancellation frame that aborts an in flight tool call: the call id, the reason in plain language and the time. */
|
|
3374
|
+
export interface cancelframe {
|
|
3375
|
+
callid: string;
|
|
3376
|
+
reason?: string;
|
|
3377
|
+
at: number;
|
|
3378
|
+
}
|
|
3379
|
+
/** One per client rate limit of tool calls: the counting window, the user configured call budget inside it and the live counters; an absent budget keeps the client unbounded. */
|
|
3380
|
+
export interface callratelimit {
|
|
3381
|
+
clientid: string;
|
|
3382
|
+
windowms: number;
|
|
3383
|
+
/** User configured call budget per window; an absent value documents the unbounded choice instead of a silent default. */
|
|
3384
|
+
budget?: number;
|
|
3385
|
+
windowstartedat: number;
|
|
3386
|
+
used: number;
|
|
3387
|
+
}
|
|
3388
|
+
/** The retry hints of a structured error: retry marks retryable failures, wait marks busy windows with their retry after and none marks consent refusals that never retry. */
|
|
3389
|
+
export type retryhint = "retry" | "wait" | "none";
|
|
3390
|
+
/** One structured error answer of a tool call: the error code, the message in plain language, the retry hint and the optional retry after window. */
|
|
3391
|
+
export interface structurederror {
|
|
3392
|
+
code: string;
|
|
3393
|
+
message: string;
|
|
3394
|
+
retryhint: retryhint;
|
|
3395
|
+
retryafter?: number;
|
|
3396
|
+
}
|
|
3397
|
+
/** The idempotency key of a tool call: the client chosen key that replays the stored result for a repeated call. */
|
|
3398
|
+
export type idempotencykey = string;
|
|
3399
|
+
/** One stored idempotency record: the key, the calling client, the tool, the stored result for replay and the expiry of the user configured window. */
|
|
3400
|
+
export interface idempotencyrecord {
|
|
3401
|
+
key: idempotencykey;
|
|
3402
|
+
clientid: string;
|
|
3403
|
+
tool: string;
|
|
3404
|
+
result: toolresult;
|
|
3405
|
+
createdat: number;
|
|
3406
|
+
expiresat: number;
|
|
3407
|
+
}
|
|
3408
|
+
/** One member of a batch call: the member id, the namespaced tool name and the call arguments. */
|
|
3409
|
+
export interface batchmember {
|
|
3410
|
+
id: string;
|
|
3411
|
+
name: string;
|
|
3412
|
+
params: Record<string, unknown>;
|
|
3413
|
+
}
|
|
3414
|
+
/** One batch call of a paired client: the ordered tool calls, the stop on first error flag, the per call outcomes and the lifecycle times. */
|
|
3415
|
+
export interface batchcall {
|
|
3416
|
+
id: string;
|
|
3417
|
+
clientid: string;
|
|
3418
|
+
calls: batchmember[];
|
|
3419
|
+
stoponerror: boolean;
|
|
3420
|
+
state: "pending" | "running" | "done" | "stopped";
|
|
3421
|
+
createdat: number;
|
|
3422
|
+
finishedat?: number;
|
|
3423
|
+
outcomes: batchoutcome[];
|
|
3424
|
+
}
|
|
3425
|
+
/** One outcome of a batch member: the member id, the tool, the outcome flag, the result or the structured error and the time. */
|
|
3426
|
+
export interface batchoutcome {
|
|
3427
|
+
callid: string;
|
|
3428
|
+
tool: string;
|
|
3429
|
+
ok: boolean;
|
|
3430
|
+
result?: toolresult;
|
|
3431
|
+
error?: structurederror;
|
|
3432
|
+
at: number;
|
|
3433
|
+
}
|
|
3434
|
+
/** One tool dry run result: the tool, the argument validation findings, the consent evaluation, the executed marker that stays false and the mutation list that stays empty. */
|
|
3435
|
+
export interface tooldryrun {
|
|
3436
|
+
callid: string;
|
|
3437
|
+
tool: string;
|
|
3438
|
+
argsvalid: boolean;
|
|
3439
|
+
consentok: boolean;
|
|
3440
|
+
findings: string[];
|
|
3441
|
+
/** A dry run never executes anything; the purity gate refuses any record that claims otherwise. */
|
|
3442
|
+
executed: boolean;
|
|
3443
|
+
/** A dry run leaves no page mutation; the purity gate refuses any record that claims one. */
|
|
3444
|
+
mutations: string[];
|
|
3445
|
+
at: number;
|
|
3446
|
+
}
|
|
3447
|
+
/** One tool mock for client testing: the namespaced tool it stands in for, the canned result it returns, the test context flag and the creation time. */
|
|
3448
|
+
export interface toolmock {
|
|
3449
|
+
tool: string;
|
|
3450
|
+
result: toolresult;
|
|
3451
|
+
/** True only in test contexts; policy refuses mocks outside them. */
|
|
3452
|
+
testcontext: boolean;
|
|
3453
|
+
createdat: number;
|
|
3454
|
+
}
|
|
3455
|
+
/** One call context that isolates concurrent client state: the call id, the client, the tool, the lifecycle state, the idempotency key, the dry run and batch markers, the chunk counter and the partial result a cancellation preserves. */
|
|
3456
|
+
export interface callcontext {
|
|
3457
|
+
callid: string;
|
|
3458
|
+
clientid: string;
|
|
3459
|
+
tool: string;
|
|
3460
|
+
state: "inflight" | "done" | "cancelled" | "failed";
|
|
3461
|
+
startedat: number;
|
|
3462
|
+
endedat?: number;
|
|
3463
|
+
idempotencykey?: idempotencykey;
|
|
3464
|
+
dryrun?: boolean;
|
|
3465
|
+
batchid?: string;
|
|
3466
|
+
chunks: number;
|
|
3467
|
+
errorcode?: string;
|
|
3468
|
+
/** The partial result preserved when a cancellation aborts the call in flight. */
|
|
3469
|
+
partial?: toolresult;
|
|
3129
3470
|
}
|
|
3130
3471
|
//# sourceMappingURL=types.d.ts.map
|