@wenathlan/extension 1.1.56 → 1.1.58

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 (40) hide show
  1. package/README.md +5 -3
  2. package/dist/agentmailbox.d.ts +42 -0
  3. package/dist/agentmailbox.d.ts.map +1 -0
  4. package/dist/blackboard.d.ts +55 -0
  5. package/dist/blackboard.d.ts.map +1 -0
  6. package/dist/index.d.ts +8 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +4570 -3392
  9. package/dist/index.js.map +4 -4
  10. package/dist/llm.d.ts +238 -0
  11. package/dist/llm.d.ts.map +1 -0
  12. package/dist/memory.d.ts +112 -1
  13. package/dist/memory.d.ts.map +1 -1
  14. package/dist/modelroute.d.ts +43 -0
  15. package/dist/modelroute.d.ts.map +1 -0
  16. package/dist/multiagent.d.ts +151 -0
  17. package/dist/multiagent.d.ts.map +1 -0
  18. package/dist/policy.d.ts +67 -1
  19. package/dist/policy.d.ts.map +1 -1
  20. package/dist/promptlibrary.d.ts +33 -0
  21. package/dist/promptlibrary.d.ts.map +1 -0
  22. package/dist/protocol.d.ts +115 -1
  23. package/dist/protocol.d.ts.map +1 -1
  24. package/dist/taskqueue.d.ts +97 -0
  25. package/dist/taskqueue.d.ts.map +1 -0
  26. package/dist/types.d.ts +375 -2
  27. package/dist/types.d.ts.map +1 -1
  28. package/dist/version.d.ts +1 -1
  29. package/extension/dist/background.js +5421 -3808
  30. package/extension/dist/background.js.map +4 -4
  31. package/extension/dist/manifest.json +1 -1
  32. package/extension/dist/pagebridge.js.map +1 -1
  33. package/extension/dist/popup.html +1 -1
  34. package/extension/dist/popup.js +23 -0
  35. package/extension/dist/popup.js.map +2 -2
  36. package/extension/dist/sidepanel.html +3 -1
  37. package/extension/dist/sidepanel.js +713 -0
  38. package/extension/dist/sidepanel.js.map +2 -2
  39. package/extension/manifest.json +1 -1
  40. package/package.json +1 -1
@@ -0,0 +1,97 @@
1
+ import type { taskitem, taskqueue } from "./types.js";
2
+ /**
3
+ * Shared task queue logic of the 1.1.58 multi agent family.
4
+ * Every correlated rule for lanes, priorities, claims, work stealing with lane ownership, completion, heartbeats and the requeue of orphaned tasks lives in this file.
5
+ * The queue never executes anything: a claimed task only names the work whose proposal still passes the same human review every single agent proposal passes.
6
+ */
7
+ /** One lane ownership rule the user configures: the lane name and the roles allowed to steal from it; a lane without a rule stays open to every agent of the approved swarm. */
8
+ export interface laneownership {
9
+ lane: string;
10
+ roles: string[];
11
+ }
12
+ /** Builds one empty queue with the user configured lanes, priority scale and completion policy; the empty set of lanes accepts any lane name the user enqueues. */
13
+ export declare function emptyqueue(input?: {
14
+ lanes?: string[];
15
+ priorities?: number[];
16
+ completionpolicy?: "all" | "any";
17
+ }): taskqueue;
18
+ /** Enqueues one task item into a lane with its priority; a configured lane list refuses unknown lanes and the payload stays the plain language text the user typed. */
19
+ export declare function enqueue(input: {
20
+ queue: taskqueue;
21
+ id: string;
22
+ lane: string;
23
+ priority: number;
24
+ payload: string;
25
+ now: number;
26
+ }): taskqueue;
27
+ /** Lets one agent claim the highest priority queued task; the claim carries the heartbeat time that keeps it alive and an agent holds one task at a time. */
28
+ export declare function claim(input: {
29
+ queue: taskqueue;
30
+ agentid: string;
31
+ now: number;
32
+ }): {
33
+ queue: taskqueue;
34
+ task?: taskitem;
35
+ };
36
+ /** Lets one idle agent steal a queued task from a named lane; the lane ownership rules the user configures refuse agents whose role holds no grant for the lane. */
37
+ export declare function steal(input: {
38
+ queue: taskqueue;
39
+ agentid: string;
40
+ role: string;
41
+ fromlane: string;
42
+ ownership?: laneownership[];
43
+ now: number;
44
+ }): {
45
+ queue: taskqueue;
46
+ task?: taskitem;
47
+ };
48
+ /** Marks one task done and releases the claim of the agent that held it. */
49
+ export declare function complete(input: {
50
+ queue: taskqueue;
51
+ taskid: string;
52
+ now: number;
53
+ }): taskqueue;
54
+ /** Cancels one queued or claimed task; the cancelled task releases its claim and leaves the queue. */
55
+ export declare function canceltask(input: {
56
+ queue: taskqueue;
57
+ taskid: string;
58
+ now: number;
59
+ }): taskqueue;
60
+ /** Refreshes the heartbeats of every live claim of one agent so a working agent keeps its tasks. */
61
+ export declare function claimheartbeat(input: {
62
+ queue: taskqueue;
63
+ agentid: string;
64
+ now: number;
65
+ }): taskqueue;
66
+ /** Returns the orphaned tasks to their lane: a claim whose heartbeat stayed silent past the user configured expiry window releases and the task waits as queued again; an absent window never expires a claim. */
67
+ export declare function requeue(input: {
68
+ queue: taskqueue;
69
+ now: number;
70
+ window?: number;
71
+ }): {
72
+ queue: taskqueue;
73
+ requeued: string[];
74
+ };
75
+ /** Reports every lane with its queued, claimed, done and cancelled task counts and the live claims, so the queue view reads the lanes at a glance. */
76
+ export declare function lanereport(queue: taskqueue): Array<{
77
+ lane: string;
78
+ queued: number;
79
+ claimed: number;
80
+ done: number;
81
+ cancelled: number;
82
+ claims: Array<{
83
+ agentid: string;
84
+ taskid: string;
85
+ heartbeatat: number;
86
+ }>;
87
+ }>;
88
+ /** Evaluates the completion policy of the queue: all completes only when every task is done while any completes with the first done task. */
89
+ export declare function queuecomplete(queue: taskqueue): boolean;
90
+ /** Counts the tasks by claim state for the popup gauge: the claimed tasks are the active work of the swarm. */
91
+ export declare function taskcounts(queue: taskqueue): {
92
+ queued: number;
93
+ claimed: number;
94
+ done: number;
95
+ cancelled: number;
96
+ };
97
+ //# sourceMappingURL=taskqueue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taskqueue.d.ts","sourceRoot":"","sources":["../taskqueue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEnE;;;;GAIG;AAEH,gLAAgL;AAChL,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,mKAAmK;AACnK,wBAAgB,UAAU,CAAC,KAAK,GAAE;IAAE,KAAK,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protocolversion: "1.1.58";
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";
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";
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 {
@@ -182,6 +182,12 @@ export interface runsettings {
182
182
  runhistoryretention?: number;
183
183
  /** Watchdog configuration of the workflow editor: the stall threshold and the recovery action stay user configured values with no code ceiling. */
184
184
  watchdog?: watchdogconfig;
185
+ /** User configured ceiling on sub agent recursion depth of the swarm; an absent value stays unbounded because the cap stays a user choice only. */
186
+ swarmdepth?: number;
187
+ /** User configured claim expiry window in milliseconds: a queue claim whose heartbeat stays silent past the window releases and its task requeues; an absent window never expires a claim. */
188
+ claimwindow?: number;
189
+ /** Retention window for stored agent mailbox messages; an absent window keeps every message while the unread counters always survive. */
190
+ mailboxretention?: number;
185
191
  }
186
192
  export interface proposalrequest {
187
193
  objective: string;
@@ -3468,4 +3474,371 @@ export interface callcontext {
3468
3474
  /** The partial result preserved when a cancellation aborts the call in flight. */
3469
3475
  partial?: toolresult;
3470
3476
  }
3477
+ /**
3478
+ * Llm integration contracts of the 1.1.57 family: provider configs with endpoint url, auth reference and model list, model routes that map task kinds to provider models, local model endpoints, openapi style tool briefs, natural language command parsing with intents, model drafted plans with replans and reflection, cost budgets with usage records, the prompt template library and the parse guardrails that keep model output honest.
3479
+ * Nothing here hardcodes a provider, an endpoint, a model or a key: every gateway url, base url, model name and parameter is a user configured value, the protocol styles are wire shapes the user picks for interoperability, api keys live behind storage id references and every model drafted plan still passes the same human review the local plans pass.
3480
+ */
3481
+ /** The protocol request shapes a user may pick for a provider endpoint: the openai compatible chat completions shape, the openai responses shape, the anthropic messages shape and the google gemini shape. These are wire shapes for interoperability, never provider names, and any gateway speaking one of them works. */
3482
+ export type protocolstyle = "chatcompletions" | "responses" | "messages" | "gemini";
3483
+ /** One message of a model conversation: the system, user or assistant role with its content. */
3484
+ export interface modelmessage {
3485
+ role: "system" | "user" | "assistant";
3486
+ content: string;
3487
+ }
3488
+ /** One user configured provider of model completions: the endpoint url the user typed, the protocol shape it speaks, the model list the user maintains, the api key reference (never the key material), the extra headers the user reviewed and the availability status of the last test call. */
3489
+ export interface providerconfig {
3490
+ id: string;
3491
+ name: string;
3492
+ /** The user configured endpoint url; no default and no built-in provider endpoint ever applies. */
3493
+ endpoint: string;
3494
+ style: protocolstyle;
3495
+ /** The user configured model list; every entry is a free text model name. */
3496
+ models: string[];
3497
+ /** Reference to the stored api key record; the key material lives in the browser credential store behind its storage id, never in memory files or audit trails. */
3498
+ authref?: apikeyref;
3499
+ /** Extra headers the user reviewed for gateways that need them; merged over the protocol shape headers. */
3500
+ headers?: Record<string, string>;
3501
+ status: "available" | "unavailable";
3502
+ lastcheckedat?: number;
3503
+ /** Optional user configured price per million tokens and its currency unit for the cost accounting of the usage records; absent pricing keeps the recorded cost at zero. */
3504
+ costpermilliontokens?: number;
3505
+ currency?: string;
3506
+ createdat: number;
3507
+ }
3508
+ /** One model route entry: the task kind it routes, the provider and model it prefers and the user configured fallback pair for refusals and outages; the revision history tracks every change. */
3509
+ export interface modelroute {
3510
+ id: string;
3511
+ /** The task kind of the route: the internal kinds parsecommand, classifyintent, draftplan, replan, reflect and summarize plus any user defined task kind. */
3512
+ kind: string;
3513
+ providerid: string;
3514
+ model: string;
3515
+ fallbackproviderid?: string;
3516
+ fallbackmodel?: string;
3517
+ revision: number;
3518
+ updatedat: number;
3519
+ }
3520
+ /** One browser reachable local model endpoint: the endpoint url, the model name, the protocol shape and the optional key reference of gateways that ask one; the health block carries the last check. */
3521
+ export interface localmodelconfig {
3522
+ endpoint: string;
3523
+ model: string;
3524
+ style: protocolstyle;
3525
+ authref?: apikeyref;
3526
+ health?: {
3527
+ checkedat: number;
3528
+ ok: boolean;
3529
+ detail?: string;
3530
+ };
3531
+ }
3532
+ /** One openapi style tool brief for model consumption: the tool name, the summary, the description, the risk class and the typed parameter list. */
3533
+ export interface toolbrief {
3534
+ tool: string;
3535
+ summary: string;
3536
+ description: string;
3537
+ risk: string;
3538
+ parameters: Array<{
3539
+ name: string;
3540
+ type: string;
3541
+ description: string;
3542
+ required: boolean;
3543
+ }>;
3544
+ }
3545
+ /** The intent kinds a natural language command may carry: navigate, extract, fill, monitor, automate and ask. */
3546
+ export type intentkind = "navigate" | "extract" | "fill" | "monitor" | "automate" | "ask";
3547
+ /** One entity of a parsed command: the entity name and its value. */
3548
+ export interface commandentity {
3549
+ name: string;
3550
+ value: string;
3551
+ }
3552
+ /** One parsed natural language command: the source text, the classified intent, the extracted entities, the confidence between zero and one, the model that parsed it and the parse time. */
3553
+ export interface commandparse {
3554
+ text: string;
3555
+ intent: intentkind;
3556
+ entities: commandentity[];
3557
+ confidence: number;
3558
+ model?: string;
3559
+ providerid?: string;
3560
+ parsedat: number;
3561
+ }
3562
+ /** One model drafted step: the action kind, the optional target and value, the summary and the fresh review marker a replan sets on revised steps. */
3563
+ export interface draftstep {
3564
+ id: string;
3565
+ kind: string;
3566
+ target?: string;
3567
+ value?: string;
3568
+ summary: string;
3569
+ /** True on the revised steps of a replan; every marked step needs the fresh human review before it executes. */
3570
+ freshreview?: boolean;
3571
+ }
3572
+ /** One model drafted plan: the goal, the drafted steps, the open questions the model could not resolve, the lint findings of the grammar check, the model provenance and the review state. A draft never executes until the human review approves it and the plan review approves the plan it produces. */
3573
+ export interface plandraft {
3574
+ id: string;
3575
+ goal: string;
3576
+ steps: draftstep[];
3577
+ openquestions: string[];
3578
+ providerid: string;
3579
+ model: string;
3580
+ state: "draft" | "approved" | "rejected";
3581
+ lintfindings: string[];
3582
+ createdat: number;
3583
+ }
3584
+ /** One replan record of a failed run: the draft it revises, the completed steps it keeps, the failed steps it replaces, the revised tail that needs fresh review, the failure reason and the model provenance. */
3585
+ export interface replanrecord {
3586
+ id: string;
3587
+ draftid: string;
3588
+ completedstepids: string[];
3589
+ failedstepids: string[];
3590
+ tail: draftstep[];
3591
+ reason: string;
3592
+ providerid: string;
3593
+ model: string;
3594
+ state: "pending" | "approved" | "rejected";
3595
+ createdat: number;
3596
+ }
3597
+ /** One reflection note of an executed step: the step outcome, the lesson learned, the advice for the next step and the model provenance; the running lessons feed the next prompt. */
3598
+ export interface reflectnote {
3599
+ id: string;
3600
+ runid: string;
3601
+ stepid: string;
3602
+ outcome: string;
3603
+ lesson: string;
3604
+ advice: string;
3605
+ providerid: string;
3606
+ model: string;
3607
+ createdat: number;
3608
+ }
3609
+ /** One cost budget of a run: the optional token ceiling, the optional currency ceiling with its currency and the configuration time; every ceiling is a user choice and an absent ceiling stays unbounded. */
3610
+ export interface costbudget {
3611
+ runid?: string;
3612
+ maxtokens?: number;
3613
+ maxcost?: number;
3614
+ currency?: string;
3615
+ configuredat: number;
3616
+ }
3617
+ /** One usage record of a model call: the run and step it belongs to, the provider, the endpoint and the model called, the prompt, completion and total token counts, the cost in the user configured currency and the local marker. */
3618
+ export interface usagerecord {
3619
+ id: string;
3620
+ runid?: string;
3621
+ stepid?: string;
3622
+ providerid: string;
3623
+ endpoint: string;
3624
+ model: string;
3625
+ prompttokens: number;
3626
+ completiontokens: number;
3627
+ totaltokens: number;
3628
+ cost: number;
3629
+ /** True when the call went to the local model endpoint. */
3630
+ local?: boolean;
3631
+ at: number;
3632
+ }
3633
+ /** One prompt template of the library: the name, the body with double braced variables, the declared variable list, the version and the change notes of the version. */
3634
+ export interface prompttemplate {
3635
+ id: string;
3636
+ name: string;
3637
+ body: string;
3638
+ variables: string[];
3639
+ version: number;
3640
+ notes?: string;
3641
+ createdat: number;
3642
+ }
3643
+ /** One parse guard of model output: the expected schema of the parsed payload, the retry count before refusal and the refusal markers the user reviews. */
3644
+ export interface parseguard {
3645
+ schema: Record<string, {
3646
+ type: "string" | "number" | "boolean" | "object" | "array";
3647
+ required?: boolean;
3648
+ }>;
3649
+ retries: number;
3650
+ refusalmarkers?: string[];
3651
+ }
3652
+ /** One model output after the guardrails: the raw text, the parsed payload when it validated, the guard verdict of valid, invalid or refused, the verdict reason and the attempt count. */
3653
+ export interface modeloutput {
3654
+ raw: string;
3655
+ parsed?: Record<string, unknown>;
3656
+ verdict: "valid" | "invalid" | "refused";
3657
+ reason?: string;
3658
+ attempts: number;
3659
+ }
3660
+ /** One token of a streamed model answer: the sequence number, the token text and the done marker. */
3661
+ export interface tokenstream {
3662
+ seq: number;
3663
+ text: string;
3664
+ done: boolean;
3665
+ }
3666
+ /**
3667
+ * Multi agent part one contracts of the 1.1.58 family: agent identities bound to tabs with user named roles, the shared task queue with lanes, priorities, claims and work stealing, agent mailboxes with direct, broadcast and role addressed routing, the blackboard shared memory with its sections and entry kinds, per agent budgets and permission scopes, sub agent spawn requests with depth limits and the killswitch that halts every agent at once.
3668
+ * Every value here stays a user choice: the agent count, the role names, the lane names, the priority scale, the freshness windows and the depth ceilings carry no code default and no hardcoded cap, and every agent proposal still passes the same human review the single agent passed.
3669
+ */
3670
+ /** The lifecycle states of one agent of the swarm: active, paused by the user or stopped. */
3671
+ 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 & {});
3674
+ /** 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
+ export interface agentidentity {
3676
+ id: string;
3677
+ /** User chosen display name; the naming stays a user choice so dashboards and audit read the names the user typed. */
3678
+ name: string;
3679
+ role: agentrole;
3680
+ /** The tab this agent is bound to; one tab holds at most one agent. */
3681
+ tabid?: number;
3682
+ /** The session the bound tab runs under when one is active. */
3683
+ sessionid?: string;
3684
+ /** The parent agent id of a sub agent; a root agent carries none. */
3685
+ parentid?: string;
3686
+ /** The recursion depth of this agent; root agents sit at zero and every spawn adds one. */
3687
+ depth: number;
3688
+ state: agentstate;
3689
+ /** Per agent budget ceilings the user configured; absent ceilings stay unbounded. */
3690
+ budget?: agentbudget;
3691
+ /** Per agent permission scope; absent scope fields stay unbounded inside the session grants. */
3692
+ scope?: agentscope;
3693
+ /** Free form metadata the user attached for dashboards and audit. */
3694
+ metadata?: Record<string, unknown>;
3695
+ registeredat: number;
3696
+ heartbeatat?: number;
3697
+ }
3698
+ /** The claim states of one task item: queued waits for a claim, claimed runs under one agent, done completed and cancelled left the queue. */
3699
+ export type taskstatekind = "queued" | "claimed" | "done" | "cancelled";
3700
+ /** One task of the shared queue: the id, the lane it waits in, the user configured priority, the payload in plain language and the claim state. */
3701
+ export interface taskitem {
3702
+ id: string;
3703
+ lane: string;
3704
+ /** User configured priority; a higher number runs first inside the lane. */
3705
+ priority: number;
3706
+ /** The task payload in plain language; the review reads it exactly as typed. */
3707
+ payload: string;
3708
+ state: taskstatekind;
3709
+ enqueuedat: number;
3710
+ }
3711
+ /** One claim of a task by an agent: the agent id, the task id and the heartbeat time that keeps the claim alive. */
3712
+ export interface claimrecord {
3713
+ agentid: string;
3714
+ taskid: string;
3715
+ claimedat: number;
3716
+ heartbeatat: number;
3717
+ }
3718
+ /** The completion policy of a queue: all requires every task to complete while any completes with the first finished task. */
3719
+ export type queuecompletionpolicy = "all" | "any";
3720
+ /** The shared task queue of the swarm: the user configured lane names, the user configured priority scale, the completion policy, the task items and the live claims. */
3721
+ export interface taskqueue {
3722
+ /** Lane names the user configures; work stealing may cross lanes inside one approved swarm. */
3723
+ lanes: string[];
3724
+ /** The priority values the user configures; the scale itself stays a user choice. */
3725
+ priorities: number[];
3726
+ completionpolicy: queuecompletionpolicy;
3727
+ items: taskitem[];
3728
+ claims: claimrecord[];
3729
+ }
3730
+ /** The routing kinds of one agent message: direct to one agent, broadcast to every agent or addressed to a role. */
3731
+ export type messagerouting = "direct" | "broadcast" | "role";
3732
+ /** One message between agents: the sender id, the recipient (an agent id, the broadcast marker or a role name), the routing kind, the payload and the read tracking. */
3733
+ export interface agentmessage {
3734
+ id: string;
3735
+ senderid: string;
3736
+ /** The agent id of a direct message, the role name of a role addressed message or the broadcast marker `*`. */
3737
+ recipient: string;
3738
+ routing: messagerouting;
3739
+ payload: string;
3740
+ sentat: number;
3741
+ readat?: number;
3742
+ }
3743
+ /** One agent mailbox: the inbox of received messages, the outbox of sent messages and the unread count. */
3744
+ export interface agentmailbox {
3745
+ agentid: string;
3746
+ inbox: agentmessage[];
3747
+ outbox: agentmessage[];
3748
+ unread: number;
3749
+ }
3750
+ /** The blackboard sections the swarm shares: goals, facts, findings and scratch. */
3751
+ export type blackboardsection = "goals" | "facts" | "findings" | "scratch";
3752
+ /** The value kinds of one blackboard entry: plain text or a json payload. */
3753
+ export type blackboardvaluekind = "text" | "json";
3754
+ /** One blackboard entry: the key, the value kind and value, the author agent id or the user marker, the section, the consent class inherited from the source extraction and the retirement time. */
3755
+ export interface blackboardentry {
3756
+ id: string;
3757
+ key: string;
3758
+ valuekind: blackboardvaluekind;
3759
+ value: string;
3760
+ /** The author agent id or `user` for entries the human posted. */
3761
+ author: string;
3762
+ section: blackboardsection;
3763
+ /** The consent class of the source extraction this entry carries; every reader sees the class. */
3764
+ consentclass: actionrisk;
3765
+ postedat: number;
3766
+ retiredat?: number;
3767
+ }
3768
+ /** The blackboard shared memory of one swarm: the sections in use, every entry and the user configured retirement window; an absent window keeps every entry. */
3769
+ export interface blackboard {
3770
+ sections: blackboardsection[];
3771
+ entries: blackboardentry[];
3772
+ /** User configured freshness window in milliseconds; entries older than the window retire on the pass. */
3773
+ retirementwindow?: number;
3774
+ }
3775
+ /** One per agent budget: the token, cost and step ceilings the user configured; every ceiling is a user choice and an absent ceiling stays unbounded. */
3776
+ export interface agentbudget {
3777
+ agentid: string;
3778
+ maxtokens?: number;
3779
+ maxcost?: number;
3780
+ /** Ceiling on executed steps; an absent value never refuses a step. */
3781
+ maxsteps?: number;
3782
+ currency?: string;
3783
+ configuredat: number;
3784
+ }
3785
+ /** One per agent permission scope: the origins and the tool namespaces granted to the agent; the grants stay inside the session grant list. */
3786
+ export interface agentscope {
3787
+ agentid: string;
3788
+ origins: string[];
3789
+ toolnamespaces: toolnamespace[];
3790
+ }
3791
+ /** One spawn request of a sub agent: the parent id, the requested role, the task in plain language and the depth of the child. */
3792
+ export interface spawnrequest {
3793
+ parentid: string;
3794
+ role: agentrole;
3795
+ task: string;
3796
+ depth: number;
3797
+ }
3798
+ /** The depth limit of sub agent recursion the user configures; the killswitch and the refusal message read it exactly. */
3799
+ export interface depthlimit {
3800
+ /** User configured ceiling on sub agent recursion depth; an absent limit stays unbounded. */
3801
+ maxdepth?: number;
3802
+ }
3803
+ /** The killswitch state: engaged halts every agent of the swarm at once; the switch stays available with no configuration barrier. */
3804
+ export interface killswitch {
3805
+ engaged: boolean;
3806
+ engagedat?: number;
3807
+ reason?: string;
3808
+ }
3809
+ /** One recorded spawn of a sub agent with its depth for the audit history. */
3810
+ export interface spawnrecord {
3811
+ id: string;
3812
+ parentid: string;
3813
+ childid: string;
3814
+ role: agentrole;
3815
+ depth: number;
3816
+ at: number;
3817
+ }
3818
+ /** The per agent usage counters held against the agent budget: the accumulated tokens, cost and executed steps. */
3819
+ export interface agentusage {
3820
+ agentid: string;
3821
+ tokens: number;
3822
+ cost: number;
3823
+ steps: number;
3824
+ updatedat: number;
3825
+ }
3826
+ /** The lifecycle event kinds of the swarm: registration, role assignment, tab binding, spawn, pause, resume, stop, the killswitch, the queue events, the mailbox delivery and the blackboard writes. */
3827
+ export type agenteventkind = "register" | "assign" | "bind" | "spawn" | "pause" | "resume" | "stop" | "killall" | "enqueued" | "claimed" | "stole" | "completed" | "requeued" | "cancelled" | "delivered" | "posted" | "retired";
3828
+ /** One agent lifecycle event notification: the event kind, the agent and task it names, the summary in plain language and the time. */
3829
+ export interface agentevent {
3830
+ id: string;
3831
+ kind: agenteventkind;
3832
+ agentid?: string;
3833
+ taskid?: string;
3834
+ summary: string;
3835
+ at: number;
3836
+ }
3837
+ /** One swarm state snapshot: every agent identity, the shared task queue with its items and claims, every mailbox and the killswitch state. */
3838
+ export interface swarmstate {
3839
+ agents: agentidentity[];
3840
+ queue: taskqueue;
3841
+ mailboxes: agentmailbox[];
3842
+ killswitch: killswitch;
3843
+ }
3471
3844
  //# sourceMappingURL=types.d.ts.map