@agentronics/sdk 0.6.0 → 0.7.0

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 (53) hide show
  1. package/dist/chunk-3WPDIMJP.js +18 -0
  2. package/dist/chunk-3WPDIMJP.js.map +1 -0
  3. package/dist/{chunk-X7NFMFN6.js → chunk-6QQS26AP.js} +264 -69
  4. package/dist/chunk-6QQS26AP.js.map +1 -0
  5. package/dist/chunk-BPDWJCPY.js +2 -0
  6. package/dist/chunk-BPDWJCPY.js.map +1 -0
  7. package/dist/index.cjs +8 -7
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +39 -7
  10. package/dist/index.d.ts +39 -7
  11. package/dist/index.global.js +8 -7
  12. package/dist/index.global.js.map +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/{init-only-7f8_LQAI.d.ts → init-only-C80qhujz.d.ts} +227 -30
  16. package/dist/{init-only-Cwll8MGz.d.cts → init-only-s9E9bVC0.d.cts} +227 -30
  17. package/dist/init-only.cjs +8 -7
  18. package/dist/init-only.cjs.map +1 -1
  19. package/dist/init-only.d.cts +2 -2
  20. package/dist/init-only.d.ts +2 -2
  21. package/dist/init-only.global.js +8 -7
  22. package/dist/init-only.global.js.map +1 -1
  23. package/dist/init-only.js +1 -1
  24. package/dist/lite.cjs +1 -1
  25. package/dist/lite.cjs.map +1 -1
  26. package/dist/lite.d.cts +2 -2
  27. package/dist/lite.d.ts +2 -2
  28. package/dist/lite.global.js +1 -1
  29. package/dist/lite.global.js.map +1 -1
  30. package/dist/lite.js +1 -1
  31. package/dist/middleware-Dd2T772u.d.cts +429 -0
  32. package/dist/middleware-Dd2T772u.d.ts +429 -0
  33. package/dist/next.cjs +239 -64
  34. package/dist/next.cjs.map +1 -1
  35. package/dist/next.d.cts +2 -2
  36. package/dist/next.d.ts +2 -2
  37. package/dist/next.js +2 -2
  38. package/dist/server.cjs +361 -66
  39. package/dist/server.cjs.map +1 -1
  40. package/dist/server.d.cts +103 -308
  41. package/dist/server.d.ts +103 -308
  42. package/dist/server.js +93 -1
  43. package/dist/server.js.map +1 -1
  44. package/dist/webmcp-BgKzHeQ3.d.cts +97 -0
  45. package/dist/webmcp-BgKzHeQ3.d.ts +97 -0
  46. package/package.json +4 -4
  47. package/dist/chunk-LLD3Y2LZ.js +0 -2
  48. package/dist/chunk-LLD3Y2LZ.js.map +0 -1
  49. package/dist/chunk-X7NFMFN6.js.map +0 -1
  50. package/dist/chunk-Y7JYD5RA.js +0 -17
  51. package/dist/chunk-Y7JYD5RA.js.map +0 -1
  52. package/dist/webmcp-C4ikhM4g.d.cts +0 -12
  53. package/dist/webmcp-C4ikhM4g.d.ts +0 -12
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import {h,f,V}from'./chunk-Y7JYD5RA.js';export{a as CRAWLER_SIGNATURES,G as DEFAULT_GROUP,y as WELL_KNOWN_PATH,d as bundledDetectors,m as createAgentContextStore,l as createAuthEngine,O as createConsoleExporter,T as createDashboardExporter,U as createDashboardSync,e as createDetectorRegistry,P as createGatewayExporter,i as createIdentityStore,R as createIntelExporter,S as createIntelSync,u as createMemoryCache,s as createMemoryStore,p as createPolicyCache,o as createPolicyEngine,C as createProgressionStore,n as createRateLimiter,g as createSignatureLoader,t as createSiteMemoryStore,B as createToolRegistry,M as createTraceBuffer,N as createTracer,L as createWebMcpAdapter,v as createWebMcpContextTool,Q as createWebhookExporter,D as decideSurfacing,f as declareAgent,j as deriveTrustLevel,h as detectAgent,b as detectCrawler,c as detectDom,K as estimateBudget,J as estimateToolTokens,F as explainSurfacing,z as fetchWellKnownContext,H as groupTools,k as highestTrust,V as init,r as installDomEnforcer,x as installMemoryOverlay,w as installMetaTags,I as listGroupNames,A as serializeWellKnownContext,q as showDenyOverlay,E as surfaceTools}from'./chunk-Y7JYD5RA.js';export{b as detectWebMcp}from'./chunk-LLD3Y2LZ.js';var Te={init:V,declareAgent:f,detectAgent:h},Ce="0.1.0";export{Te as Agentronics,Ce as VERSION};//# sourceMappingURL=index.js.map
1
+ import {h,f,aa}from'./chunk-3WPDIMJP.js';export{a as CRAWLER_SIGNATURES,O as DEFAULT_GROUP,C as WELL_KNOWN_PATH,d as bundledDetectors,q as createAgentContextStore,p as createAuthEngine,V as createConsoleExporter,_ as createDashboardExporter,$ as createDashboardSync,e as createDetectorRegistry,W as createGatewayExporter,k as createIdentityStore,Y as createIntelExporter,Z as createIntelSync,y as createMemoryCache,w as createMemoryStore,t as createPolicyCache,s as createPolicyEngine,K as createProgressionStore,r as createRateLimiter,S as createReviewPrompt,g as createSignatureLoader,x as createSiteMemoryStore,F as createToolRegistry,T as createTraceBuffer,U as createTracer,j as createVisionDetector,R as createWebMcpAdapter,z as createWebMcpContextTool,X as createWebhookExporter,L as decideSurfacing,f as declareAgent,n as defaultAuthMethods,l as deriveTrustLevel,H as descriptorTokens,h as detectAgent,b as detectCrawler,c as detectDom,J as estimateBudget,I as estimateToolTokens,N as explainSurfacing,D as fetchWellKnownContext,P as groupTools,m as highestTrust,aa as init,v as installDomEnforcer,B as installMemoryOverlay,A as installMetaTags,Q as listGroupNames,G as modelFacingDescriptor,o as previewAuthMethods,i as scoreVisionSignals,E as serializeWellKnownContext,u as showDenyOverlay,M as surfaceTools}from'./chunk-3WPDIMJP.js';export{a as VERSION,f as detectWebMcp,d as onWebMcpActivity,b as resolveModelContext,e as webMcpSupport}from'./chunk-BPDWJCPY.js';var ve={init:aa,declareAgent:f,detectAgent:h};export{ve as Agentronics};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["Agentronics","init","declareAgent","detectAgent","VERSION"],"mappings":"ssCA2NO,IAAMA,EAAAA,CAAc,CAAE,IAAA,CAAAC,CAAAA,CAAM,aAAAC,CAAAA,CAAc,WAAA,CAAAC,CAAY,CAAA,CAEhDC,EAAAA,CAAU","file":"index.js","sourcesContent":["import { init, type AgentronicsClient, type InitOptions } from './init.js'\nimport {\n declareAgent,\n bundledDetectors,\n createDetectorRegistry,\n createSignatureLoader,\n detectAgent,\n detectCrawler,\n detectDom,\n detectWebMcp,\n CRAWLER_SIGNATURES,\n type DeclareAgentInput,\n type DetectAgentOptions,\n type DetectCrawlerOptions,\n type CrawlerSignature,\n type CrawlerCategory,\n type DetectDomOptions,\n type DetectWebMcpOptions,\n type Detector,\n type DetectorRegistry,\n type DetectorStatus,\n type DomSignalName,\n} from './detection/index.js'\nimport {\n createIdentityStore,\n type IdentityStore,\n type PresentIdentityOptions,\n type PresentedIdentity,\n} from './auth/identity.js'\nimport { createAuthEngine, type AuthEngine, type AuthInput, type AuthMethod } from './auth/engine.js'\nimport {\n createAgentContextStore,\n type AgentContextStore,\n type AgentContextSnapshot,\n type AgentContextListener,\n} from './auth/agentContext.js'\nimport { deriveTrustLevel, highestTrust } from './auth/trustLevel.js'\nimport { createPolicyEngine, type PolicyEngine } from './authz/engine.js'\nimport { createRateLimiter, type RateLimiter } from './authz/rateLimiter.js'\nimport { createPolicyCache, type PolicyCache } from './authz/policyCache.js'\nimport { installDomEnforcer } from './authz/domEnforcer.js'\nimport { showDenyOverlay } from './authz/overlay.js'\nimport { createMemoryStore, type MemoryStore } from './memory/store.js'\nimport {\n createSiteMemoryStore,\n type SiteMemoryStore,\n type SiteMemoryListener,\n type ProvideForPageInput,\n} from './memory/siteMemory.js'\nimport { createMemoryCache, type MemoryCache } from './memory/memoryCache.js'\nimport {\n createWebMcpContextTool,\n installMetaTags,\n installMemoryOverlay,\n fetchWellKnownContext,\n serializeWellKnownContext,\n WELL_KNOWN_PATH,\n type WebMcpContextTool,\n type WebMcpContextOptions,\n} from './memory/delivery/index.js'\nimport { createToolRegistry, type GovernedTool, type ToolRegistry } from './tools/registry.js'\nimport {\n decideSurfacing,\n surfaceTools,\n explainSurfacing,\n type SurfacingContext,\n type SurfacingDecision,\n} from './tools/surfacing.js'\nimport {\n groupTools,\n listGroupNames,\n DEFAULT_GROUP,\n type ToolGroupSummary,\n} from './tools/groups.js'\nimport {\n createProgressionStore,\n type ProgressionConfig,\n type ProgressionStage,\n type ProgressionStore,\n type ProgressionTransition,\n} from './tools/progression.js'\nimport {\n estimateBudget,\n estimateToolTokens,\n type ToolTokenEstimate,\n type TokenBudgetReport,\n} from './tools/tokenEstimate.js'\nimport {\n createWebMcpAdapter,\n type WebMcpAdapter,\n type WebMcpAdapterOptions,\n type WebMcpToolDescriptor,\n type WebMcpProvider,\n} from './tools/webmcpAdapter.js'\nimport {\n createTracer,\n createTraceBuffer,\n createConsoleExporter,\n createGatewayExporter,\n createWebhookExporter,\n createIntelExporter,\n createIntelSync,\n createDashboardExporter,\n createDashboardSync,\n type TraceExporter,\n type TraceInput,\n type Tracer,\n type IntelExporterOptions,\n type IntelSync,\n type IntelSyncOptions,\n} from './observability/index.js'\n\nexport {\n init,\n declareAgent,\n detectAgent,\n detectCrawler,\n detectDom,\n detectWebMcp,\n CRAWLER_SIGNATURES,\n createDetectorRegistry,\n bundledDetectors,\n createSignatureLoader,\n createIdentityStore,\n createAuthEngine,\n createAgentContextStore,\n deriveTrustLevel,\n highestTrust,\n createPolicyEngine,\n createRateLimiter,\n createPolicyCache,\n installDomEnforcer,\n showDenyOverlay,\n createToolRegistry,\n decideSurfacing,\n surfaceTools,\n explainSurfacing,\n groupTools,\n listGroupNames,\n DEFAULT_GROUP,\n createProgressionStore,\n estimateBudget,\n estimateToolTokens,\n createWebMcpAdapter,\n createMemoryStore,\n createSiteMemoryStore,\n createMemoryCache,\n createWebMcpContextTool,\n installMetaTags,\n installMemoryOverlay,\n fetchWellKnownContext,\n serializeWellKnownContext,\n WELL_KNOWN_PATH,\n createTracer,\n createTraceBuffer,\n createConsoleExporter,\n createGatewayExporter,\n createWebhookExporter,\n createIntelExporter,\n createIntelSync,\n createDashboardExporter,\n createDashboardSync,\n}\nexport type {\n AgentronicsClient,\n AuthEngine,\n AuthInput,\n AuthMethod,\n AgentContextStore,\n AgentContextSnapshot,\n AgentContextListener,\n DeclareAgentInput,\n DetectAgentOptions,\n DetectCrawlerOptions,\n CrawlerSignature,\n CrawlerCategory,\n DetectDomOptions,\n DetectWebMcpOptions,\n DomSignalName,\n IdentityStore,\n InitOptions,\n MemoryStore,\n SiteMemoryStore,\n SiteMemoryListener,\n MemoryCache,\n ProvideForPageInput,\n WebMcpContextTool,\n WebMcpContextOptions,\n GovernedTool,\n ToolRegistry,\n SurfacingContext,\n SurfacingDecision,\n ToolGroupSummary,\n ProgressionConfig,\n ProgressionStage,\n ProgressionStore,\n ProgressionTransition,\n ToolTokenEstimate,\n TokenBudgetReport,\n WebMcpAdapter,\n WebMcpAdapterOptions,\n WebMcpToolDescriptor,\n WebMcpProvider,\n PolicyEngine,\n PolicyCache,\n RateLimiter,\n Detector,\n DetectorRegistry,\n DetectorStatus,\n PresentIdentityOptions,\n PresentedIdentity,\n TraceExporter,\n TraceInput,\n Tracer,\n IntelExporterOptions,\n IntelSync,\n IntelSyncOptions,\n}\n\nexport const Agentronics = { init, declareAgent, detectAgent }\n\nexport const VERSION = '0.1.0'\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["Agentronics","init","declareAgent","detectAgent"],"mappings":"k8CA4QO,IAAMA,GAAc,CAAE,IAAA,CAAAC,GAAM,YAAA,CAAAC,CAAAA,CAAc,YAAAC,CAAY","file":"index.js","sourcesContent":["import { init, type AgentronicsClient, type InitOptions } from './init.js'\nimport {\n declareAgent,\n bundledDetectors,\n createDetectorRegistry,\n createSignatureLoader,\n detectAgent,\n detectCrawler,\n detectDom,\n detectWebMcp,\n CRAWLER_SIGNATURES,\n type DeclareAgentInput,\n type DetectAgentOptions,\n type DetectCrawlerOptions,\n type CrawlerSignature,\n type CrawlerCategory,\n type DetectDomOptions,\n type DetectWebMcpOptions,\n type Detector,\n type DetectorRegistry,\n type DetectorStatus,\n type DomSignalName,\n} from './detection/index.js'\nimport {\n createIdentityStore,\n type IdentityStore,\n type PresentIdentityOptions,\n type PresentedIdentity,\n} from './auth/identity.js'\nimport {\n createAuthEngine,\n defaultAuthMethods,\n previewAuthMethods,\n type AuthEngine,\n type AuthInput,\n type AuthMethod,\n} from './auth/engine.js'\nimport { createReviewPrompt, type Reviewer, type ReviewRequest } from './authz/reviewPrompt.js'\nimport {\n createVisionDetector,\n scoreVisionSignals,\n type VisionDetector,\n type VisionDetectorOptions,\n type VisionSignals,\n} from './detection/vision.js'\nimport { webMcpSupport } from './detection/webmcp.js'\nimport {\n resolveModelContext,\n onWebMcpActivity,\n type ToolAnnotations,\n type ModelContextTool,\n type WebMcpActivity,\n} from './tools/modelContext.js'\nimport {\n createAgentContextStore,\n type AgentContextStore,\n type AgentContextSnapshot,\n type AgentContextListener,\n} from './auth/agentContext.js'\nimport { deriveTrustLevel, highestTrust } from './auth/trustLevel.js'\nimport { createPolicyEngine, type PolicyEngine } from './authz/engine.js'\nimport { createRateLimiter, type RateLimiter } from './authz/rateLimiter.js'\nimport { createPolicyCache, type PolicyCache } from './authz/policyCache.js'\nimport { installDomEnforcer } from './authz/domEnforcer.js'\nimport { showDenyOverlay } from './authz/overlay.js'\nimport { createMemoryStore, type MemoryStore } from './memory/store.js'\nimport {\n createSiteMemoryStore,\n type SiteMemoryStore,\n type SiteMemoryListener,\n type ProvideForPageInput,\n} from './memory/siteMemory.js'\nimport { createMemoryCache, type MemoryCache } from './memory/memoryCache.js'\nimport {\n createWebMcpContextTool,\n installMetaTags,\n installMemoryOverlay,\n fetchWellKnownContext,\n serializeWellKnownContext,\n WELL_KNOWN_PATH,\n type WebMcpContextTool,\n type WebMcpContextOptions,\n} from './memory/delivery/index.js'\nimport { createToolRegistry, type GovernedTool, type ToolRegistry } from './tools/registry.js'\nimport {\n decideSurfacing,\n surfaceTools,\n explainSurfacing,\n type SurfacingContext,\n type SurfacingDecision,\n} from './tools/surfacing.js'\nimport {\n groupTools,\n listGroupNames,\n DEFAULT_GROUP,\n type ToolGroupSummary,\n} from './tools/groups.js'\nimport {\n createProgressionStore,\n type ProgressionConfig,\n type ProgressionStage,\n type ProgressionStore,\n type ProgressionTransition,\n} from './tools/progression.js'\nimport {\n estimateBudget,\n estimateToolTokens,\n descriptorTokens,\n modelFacingDescriptor,\n type ToolTokenEstimate,\n type TokenBudgetReport,\n} from './tools/tokenEstimate.js'\nimport {\n createWebMcpAdapter,\n type WebMcpAdapter,\n type WebMcpAdapterOptions,\n type WebMcpToolDescriptor,\n type WebMcpProvider,\n type WebMcpRegistration,\n type WebMcpPublishResult,\n} from './tools/webmcpAdapter.js'\nimport {\n createTracer,\n createTraceBuffer,\n createConsoleExporter,\n createGatewayExporter,\n createWebhookExporter,\n createIntelExporter,\n createIntelSync,\n createDashboardExporter,\n createDashboardSync,\n type TraceExporter,\n type TraceInput,\n type Tracer,\n type IntelExporterOptions,\n type IntelSync,\n type IntelSyncOptions,\n type DashboardConfig,\n} from './observability/index.js'\n\nexport {\n init,\n declareAgent,\n detectAgent,\n detectCrawler,\n detectDom,\n detectWebMcp,\n CRAWLER_SIGNATURES,\n createDetectorRegistry,\n bundledDetectors,\n createSignatureLoader,\n createIdentityStore,\n createAuthEngine,\n defaultAuthMethods,\n previewAuthMethods,\n createReviewPrompt,\n createVisionDetector,\n scoreVisionSignals,\n webMcpSupport,\n resolveModelContext,\n onWebMcpActivity,\n descriptorTokens,\n modelFacingDescriptor,\n createAgentContextStore,\n deriveTrustLevel,\n highestTrust,\n createPolicyEngine,\n createRateLimiter,\n createPolicyCache,\n installDomEnforcer,\n showDenyOverlay,\n createToolRegistry,\n decideSurfacing,\n surfaceTools,\n explainSurfacing,\n groupTools,\n listGroupNames,\n DEFAULT_GROUP,\n createProgressionStore,\n estimateBudget,\n estimateToolTokens,\n createWebMcpAdapter,\n createMemoryStore,\n createSiteMemoryStore,\n createMemoryCache,\n createWebMcpContextTool,\n installMetaTags,\n installMemoryOverlay,\n fetchWellKnownContext,\n serializeWellKnownContext,\n WELL_KNOWN_PATH,\n createTracer,\n createTraceBuffer,\n createConsoleExporter,\n createGatewayExporter,\n createWebhookExporter,\n createIntelExporter,\n createIntelSync,\n createDashboardExporter,\n createDashboardSync,\n}\nexport type {\n Reviewer,\n ReviewRequest,\n VisionDetector,\n VisionDetectorOptions,\n VisionSignals,\n ToolAnnotations,\n ModelContextTool,\n WebMcpActivity,\n WebMcpRegistration,\n WebMcpPublishResult,\n DashboardConfig,\n AgentronicsClient,\n AuthEngine,\n AuthInput,\n AuthMethod,\n AgentContextStore,\n AgentContextSnapshot,\n AgentContextListener,\n DeclareAgentInput,\n DetectAgentOptions,\n DetectCrawlerOptions,\n CrawlerSignature,\n CrawlerCategory,\n DetectDomOptions,\n DetectWebMcpOptions,\n DomSignalName,\n IdentityStore,\n InitOptions,\n MemoryStore,\n SiteMemoryStore,\n SiteMemoryListener,\n MemoryCache,\n ProvideForPageInput,\n WebMcpContextTool,\n WebMcpContextOptions,\n GovernedTool,\n ToolRegistry,\n SurfacingContext,\n SurfacingDecision,\n ToolGroupSummary,\n ProgressionConfig,\n ProgressionStage,\n ProgressionStore,\n ProgressionTransition,\n ToolTokenEstimate,\n TokenBudgetReport,\n WebMcpAdapter,\n WebMcpAdapterOptions,\n WebMcpToolDescriptor,\n WebMcpProvider,\n PolicyEngine,\n PolicyCache,\n RateLimiter,\n Detector,\n DetectorRegistry,\n DetectorStatus,\n PresentIdentityOptions,\n PresentedIdentity,\n TraceExporter,\n TraceInput,\n Tracer,\n IntelExporterOptions,\n IntelSync,\n IntelSyncOptions,\n}\n\nexport const Agentronics = { init, declareAgent, detectAgent }\n\nexport { SDK_VERSION as VERSION } from './version.js'\n"]}
@@ -1,5 +1,5 @@
1
1
  import { AgentIdentity, IdentityClaim, TraceEvent, TraceEventType, VerificationResult, AgentClass, PolicyRule, PolicyEvaluation, MemoryScope, MemoryEntry, SiteMemory, SiteMemoryPageContext } from '@agentronics/protocol';
2
- import { D as DetectWebMcpOptions } from './webmcp-C4ikhM4g.js';
2
+ import { D as DetectWebMcpOptions, T as ToolAnnotations, a as ModelContextSource, b as ModelContextLike, L as LegacyProvider } from './webmcp-BgKzHeQ3.js';
3
3
 
4
4
  type CrawlerCategory = 'ai' | 'search';
5
5
  interface CrawlerSignature {
@@ -45,6 +45,7 @@ interface SignalResult {
45
45
  declare const SIGNALS: {
46
46
  readonly webdriver: () => SignalResult;
47
47
  readonly chromedriver: () => SignalResult;
48
+ readonly automationGlobals: () => SignalResult;
48
49
  readonly headlessUa: () => SignalResult;
49
50
  readonly languages: () => SignalResult;
50
51
  readonly permissions: () => SignalResult;
@@ -86,6 +87,73 @@ interface DetectAgentOptions {
86
87
  */
87
88
  declare const detectAgent: (options?: DetectAgentOptions) => Promise<AgentIdentity | null>;
88
89
 
90
+ /**
91
+ * Vision-model ("screenshot") agents — computer-use agents that look at
92
+ * screenshots and drive a real browser with synthetic mouse and keyboard
93
+ * input (ChatGPT agent, Claude computer use, Gemini computer use, …).
94
+ *
95
+ * They run in ordinary browsers, so DOM automation flags often don't fire.
96
+ * What gives them away is how they interact:
97
+ *
98
+ * - **teleport clicks** — a click with no pointer movement leading up to it
99
+ * (the cursor jumps straight to the coordinates the model picked);
100
+ * - **centre clicks** — clicks landing within a pixel or two of an element's
101
+ * exact centre, again and again;
102
+ * - **metronome typing** — key intervals with almost no variance, or text
103
+ * inserted with no key events at all;
104
+ * - **no hover or wheel** — clicks and scroll jumps without any mousemove or
105
+ * wheel activity in between;
106
+ * - **VM-shaped viewport** — exact sizes agent sandboxes use (1024×768, 1280×800…).
107
+ *
108
+ * Each signal is weak alone. The monitor scores them over a short window and
109
+ * reports a `screenshot` agent only when several agree after enough
110
+ * interactions. It reads event coordinates and timing only — never key values
111
+ * or text.
112
+ */
113
+ interface VisionDetectorOptions {
114
+ /** Score (0–1) at which to report an agent. Default 0.6. */
115
+ threshold?: number;
116
+ /** Interactions (clicks + typing bursts) needed before scoring. Default 3. */
117
+ minInteractions?: number;
118
+ documentRef?: Document;
119
+ /** Called once, when the score first crosses the threshold. */
120
+ onDetect?: (identity: AgentIdentity) => void;
121
+ /** @internal Tests only: count synthetic (isTrusted=false) events. */
122
+ acceptUntrustedEvents?: boolean;
123
+ }
124
+ interface VisionSignals {
125
+ clicks: number;
126
+ teleportClicks: number;
127
+ centreClicks: number;
128
+ keyIntervals: number;
129
+ keyIntervalCv: number | null;
130
+ insertWithoutKeys: number;
131
+ pointerMoves: number;
132
+ wheelEvents: number;
133
+ vmViewport: boolean;
134
+ }
135
+ /** 0–1 score from the collected signals (exported for tests and the console's explanation). */
136
+ declare const scoreVisionSignals: (s: VisionSignals) => number;
137
+ /**
138
+ * Watch the page for vision-agent interaction patterns. Returns a handle with
139
+ * the live signals and score; `onDetect` fires once when the threshold is met.
140
+ */
141
+ declare const createVisionDetector: (options?: VisionDetectorOptions) => {
142
+ signals: () => VisionSignals;
143
+ score: () => number;
144
+ detected: () => {
145
+ class: "webmcp" | "dom" | "screenshot" | "crawler";
146
+ trust: "detected" | "declared" | "verified" | "linked";
147
+ confidence: number;
148
+ vendor: string | null;
149
+ userAgent: string | null;
150
+ detectionVersion: string;
151
+ signals: Record<string, unknown>;
152
+ } | null;
153
+ stop: () => void;
154
+ };
155
+ type VisionDetector = ReturnType<typeof createVisionDetector>;
156
+
89
157
  interface PresentIdentityOptions extends IdentityClaim {
90
158
  /**
91
159
  * If false, accept the claim as `declared` (no remote verification).
@@ -178,8 +246,25 @@ interface AuthEngineOptions {
178
246
  methods?: AuthMethod[];
179
247
  context?: AuthContext;
180
248
  onTrace?: (input: TraceInput) => void;
249
+ /**
250
+ * `'0.6'` restores the pre-0.7 behaviour: tokens nothing has verified count
251
+ * as `verified` (or `linked` with a user id), and SSO / SPIFFE / mTLS are in
252
+ * the default methods. Insecure — for upgrading without changes; remove it
253
+ * once `auth.verifyToken` is wired. See the 0.7 upgrade guide.
254
+ */
255
+ compat?: '0.6';
256
+ /** Called once, the first time a credential arrives with no verifier configured. */
257
+ onUnverifiedToken?: (method: AuthMethodName) => void;
181
258
  }
182
- declare const createAuthEngine: ({ methods, context, onTrace, }?: AuthEngineOptions) => {
259
+ /**
260
+ * Methods on by default. SSO, SPIFFE (incl. Google Agent Identity) and mTLS are
261
+ * kept but off until they ship — pass `methods: [...defaultAuthMethods(),
262
+ * ...previewAuthMethods()]` to try them.
263
+ */
264
+ declare const defaultAuthMethods: () => AuthMethod[];
265
+ /** Coming later: enterprise agent SSO, workload identity (SPIFFE) and mTLS. */
266
+ declare const previewAuthMethods: () => AuthMethod[];
267
+ declare const createAuthEngine: ({ compat, methods, context, onTrace, onUnverifiedToken, }?: AuthEngineOptions) => {
183
268
  authenticate(input: AuthInput): Promise<AgentIdentity | null>;
184
269
  methods(): AuthMethodName[];
185
270
  };
@@ -302,11 +387,40 @@ declare const createMemoryCache: ({ gatewayUrl, siteId, publishableKey, fetcher,
302
387
  };
303
388
  type MemoryCache = ReturnType<typeof createMemoryCache>;
304
389
 
390
+ /** What a "review" decision asks the person on the page to approve. */
391
+ interface ReviewRequest {
392
+ tool: string;
393
+ title?: string;
394
+ description?: string;
395
+ input: unknown;
396
+ identity: AgentIdentity | null;
397
+ reason: string;
398
+ }
399
+ /** Return true to let the tool run, false to refuse it. */
400
+ type Reviewer = (request: ReviewRequest) => Promise<boolean>;
401
+ interface ReviewPromptOptions {
402
+ documentRef?: Document;
403
+ /** Refuse automatically if nobody answers. Default 120 s. */
404
+ timeoutMs?: number;
405
+ }
406
+ /**
407
+ * The default browser reviewer: a small modal asking the visitor to allow or
408
+ * refuse the agent's action. Resolves false without a document (server), on
409
+ * "Not now", on Escape, or after the timeout.
410
+ */
411
+ declare const createReviewPrompt: ({ documentRef, timeoutMs, }?: ReviewPromptOptions) => Reviewer;
412
+
305
413
  interface GovernedTool<Input = unknown, Output = unknown> {
306
414
  name: string;
415
+ /** Human-readable name agents and browsers may show (WebMCP `title`). */
416
+ title?: string;
307
417
  version?: string;
308
418
  group?: string;
309
419
  description?: string;
420
+ /** WebMCP hints: readOnlyHint, consequentialHint, untrustedContentHint. */
421
+ annotations?: ToolAnnotations;
422
+ /** Other origins whose agents may see this tool (WebMCP `exposedTo`). */
423
+ exposedTo?: string[];
310
424
  inputSchema?: Record<string, unknown>;
311
425
  outputSchema?: Record<string, unknown>;
312
426
  stage?: string;
@@ -314,6 +428,7 @@ interface GovernedTool<Input = unknown, Output = unknown> {
314
428
  rateLimit?: PolicyRule['rateLimit'];
315
429
  execute: (input: Input, context: {
316
430
  identity: AgentIdentity | null;
431
+ signal?: AbortSignal;
317
432
  }) => Promise<Output> | Output;
318
433
  }
319
434
  interface ToolRegistryOptions {
@@ -335,6 +450,15 @@ interface ToolRegistryOptions {
335
450
  * - `execute(name, input, identity)` → respected
336
451
  */
337
452
  identityResolver?: () => AgentIdentity | null;
453
+ /**
454
+ * Asks a person to approve a call whose policy decision is `review`. Without
455
+ * one, review calls are refused (never silently run).
456
+ */
457
+ reviewer?: Reviewer;
458
+ }
459
+ interface ExecuteOptions {
460
+ /** Aborted when the agent cancels the call (WebMCP passes one per call). */
461
+ signal?: AbortSignal;
338
462
  }
339
463
  interface ToolRegistry {
340
464
  register(tool: GovernedTool): () => void;
@@ -346,9 +470,9 @@ interface ToolRegistry {
346
470
  includeDisabled?: boolean;
347
471
  }): GovernedTool[];
348
472
  get(name: string): GovernedTool | undefined;
349
- execute<Input, Output>(name: string, input: Input, identity?: AgentIdentity | null): Promise<Output>;
473
+ execute<Input, Output>(name: string, input: Input, identity?: AgentIdentity | null, options?: ExecuteOptions): Promise<Output>;
350
474
  }
351
- declare const createToolRegistry: ({ evaluate, setPolicies, listPolicies, onTrace, identityResolver, }: ToolRegistryOptions) => ToolRegistry;
475
+ declare const createToolRegistry: ({ evaluate, setPolicies, listPolicies, onTrace, identityResolver, reviewer, }: ToolRegistryOptions) => ToolRegistry;
352
476
 
353
477
  interface ProgressionTransition {
354
478
  on: string;
@@ -417,40 +541,67 @@ interface TokenBudgetReport {
417
541
  total: number;
418
542
  perTool: ToolTokenEstimate[];
419
543
  }
544
+ /**
545
+ * What an agent actually receives for a tool — the fields registered with
546
+ * WebMCP (`name`, `title`, `description`, `inputSchema`, `annotations`).
547
+ * Policy, version and grouping stay on the site and cost the agent nothing.
548
+ */
549
+ declare const modelFacingDescriptor: (tool: Pick<GovernedTool, "name" | "title" | "description" | "inputSchema" | "annotations">) => {
550
+ annotations?: ToolAnnotations;
551
+ inputSchema?: Record<string, unknown>;
552
+ description: string;
553
+ title?: string;
554
+ name: string;
555
+ };
556
+ /** ≈ characters / 4 of the model-facing descriptor. */
557
+ declare const descriptorTokens: (tool: Parameters<typeof modelFacingDescriptor>[0]) => number;
420
558
  declare const estimateToolTokens: (tool: GovernedTool) => ToolTokenEstimate;
421
559
  declare const estimateBudget: (tools: GovernedTool[]) => TokenBudgetReport;
422
560
 
561
+ /** @deprecated The pre-2026 `provideContext()` shape; kept for old polyfills. */
562
+ type WebMcpProvider = LegacyProvider;
423
563
  interface WebMcpToolDescriptor {
424
564
  name: string;
425
565
  description?: string;
426
566
  inputSchema?: Record<string, unknown>;
427
567
  invoke(input?: unknown): Promise<unknown>;
428
568
  }
429
- interface WebMcpProvider {
430
- provideContext(payload: {
431
- tools: WebMcpToolDescriptor[];
432
- }): {
433
- revoke: () => void;
434
- };
435
- }
436
569
  interface WebMcpAdapterOptions {
437
- provider?: WebMcpProvider;
438
- doc?: {
439
- defaultView?: WindowLike | null;
570
+ /** Explicit ModelContext (tests, or a host that isn't `globalThis`). */
571
+ modelContext?: ModelContextLike | LegacyProvider;
572
+ /** @deprecated use `modelContext`. */
573
+ provider?: LegacyProvider;
574
+ /** Where to look for `document.modelContext` / `navigator.modelContext`. */
575
+ host?: {
576
+ document?: {
577
+ modelContext?: unknown;
578
+ } | null;
579
+ navigator?: {
580
+ modelContext?: unknown;
581
+ } | null;
440
582
  } | null;
441
- invoke?: (tool: GovernedTool, input: unknown) => Promise<unknown>;
583
+ invoke?: (tool: GovernedTool, input: unknown, signal?: AbortSignal) => Promise<unknown>;
442
584
  }
443
- interface WindowLike {
444
- navigator?: {
445
- modelContext?: WebMcpProvider;
446
- };
585
+ /** Per-tool result of the last publish — the "callable / failed" status the console shows. */
586
+ interface WebMcpRegistration {
587
+ name: string;
588
+ status: 'callable' | 'failed';
589
+ error?: string;
590
+ }
591
+ interface WebMcpPublishResult {
592
+ /** True when a WebMCP surface was found and the previous registrations were withdrawn. */
593
+ revoked: boolean;
594
+ /** Resolves once every tool's registerTool() settled. Empty when WebMCP is unavailable. */
595
+ registrations: Promise<WebMcpRegistration[]>;
447
596
  }
448
597
  interface WebMcpAdapter {
449
- publish(tools: GovernedTool[]): {
450
- revoked: boolean;
451
- };
598
+ publish(tools: GovernedTool[]): WebMcpPublishResult;
452
599
  revoke(): void;
453
600
  available(): boolean;
601
+ /** Which surface was used: document.modelContext, the navigator alias, or a legacy polyfill. */
602
+ source(): ModelContextSource | null;
603
+ /** Registration status from the most recent publish. */
604
+ status(): WebMcpRegistration[];
454
605
  }
455
606
  declare const createWebMcpAdapter: (options?: WebMcpAdapterOptions) => WebMcpAdapter;
456
607
 
@@ -458,14 +609,15 @@ interface InitOptions {
458
609
  publishableKey: string;
459
610
  siteId?: string;
460
611
  /**
461
- * Override the gateway URL the SDK calls. **Reserved for local development
462
- * only** — the only accepted values are `localhost` / `127.0.0.1` URLs (so
463
- * `pnpm dev` against a local gateway works). Any other value throws at
464
- * `init()` time.
612
+ * Override the Agentronics API URL the SDK calls. **Reserved for local
613
+ * development only** — the only accepted values are `localhost` /
614
+ * `127.0.0.1` URLs (so `pnpm dev` against a local API works). Any other
615
+ * value throws at `init()` time.
465
616
  *
466
- * Production deployments must omit this option. The SDK is hard-coded to
467
- * call `https://gateway.agentronics.dev`. Custom backends are not
468
- * supported, by design — see the project README + LICENSE NOTICE.
617
+ * Production deployments must omit this option. The SDK calls
618
+ * `https://api.agentronics.dev` (the retired `gateway.agentronics.dev` is
619
+ * accepted and mapped to it). Custom backends are not supported, by
620
+ * design — see the project README + LICENSE NOTICE.
469
621
  *
470
622
  * @internal — kept on the public type only so dev tooling type-checks.
471
623
  */
@@ -476,6 +628,25 @@ interface InitOptions {
476
628
  auth?: AuthContext;
477
629
  progression?: ProgressionConfig;
478
630
  tools?: GovernedTool[];
631
+ /**
632
+ * Who approves tool calls whose policy decision is `review`. Default in the
633
+ * browser: a small "Allow / Not now" dialog for the person on the page.
634
+ * Pass your own function to use your UI, or `false` to refuse every review.
635
+ */
636
+ review?: Reviewer | false;
637
+ /**
638
+ * `'0.6'` keeps the pre-0.7 behaviour while you upgrade: unverified tokens
639
+ * count as `verified`, SSO / SPIFFE / mTLS are on, and `review` rules run
640
+ * without asking. Insecure and temporary — see the 0.7 upgrade guide.
641
+ * @deprecated Remove once you've moved to the 0.7 behaviour.
642
+ */
643
+ compat?: '0.6';
644
+ /**
645
+ * Approved tool descriptions from the console's Procedural memory page
646
+ * (`createDashboardSync().pullConfig().toolDescriptions`). They replace the
647
+ * code's description when tools are published to agents.
648
+ */
649
+ toolDescriptions?: Record<string, string>;
479
650
  /**
480
651
  * Run agent detection automatically on init and keep the resulting
481
652
  * identity in agentContext so every subsequent tools.execute() call gets
@@ -489,6 +660,12 @@ interface InitOptions {
489
660
  * `ready` promise on the returned client resolves once the cycle finishes.
490
661
  */
491
662
  autoDetect?: boolean | DetectAgentOptions;
663
+ /**
664
+ * Watch interactions for vision-model ("screenshot") agents — teleport and
665
+ * centre clicks, metronome typing. On by default in the browser whenever
666
+ * `autoDetect` is on; reads timing and coordinates only, never keystrokes.
667
+ */
668
+ visionDetection?: boolean | Omit<VisionDetectorOptions, 'onDetect'>;
492
669
  trace?: {
493
670
  enabled?: boolean;
494
671
  bufferSize?: number;
@@ -516,6 +693,8 @@ interface AgentronicsClient {
516
693
  readonly tools: ToolRegistry;
517
694
  readonly progression: ProgressionStore | null;
518
695
  readonly webmcp: WebMcpAdapter;
696
+ /** The vision-agent monitor, when running. */
697
+ readonly vision: VisionDetector | null;
519
698
  /**
520
699
  * Resolves once the initial autoDetect cycle finishes. Rejects only if the
521
700
  * autoDetect configuration itself is invalid; detection failures resolve to
@@ -535,6 +714,16 @@ interface AgentronicsClient {
535
714
  }): Promise<PolicyEvaluation>;
536
715
  syncPolicies(): Promise<PolicyRule[]>;
537
716
  syncSiteMemory(): Promise<SiteMemory | null>;
717
+ /**
718
+ * Pull everything the console manages for this site with the publishable
719
+ * key alone — authorization rules, approved tool descriptions and site
720
+ * memory — and apply it (re-publishing WebMCP tools if they changed).
721
+ */
722
+ syncConfig(): Promise<{
723
+ policies: PolicyRule[];
724
+ toolDescriptions: Record<string, string>;
725
+ siteMemory: SiteMemory | null;
726
+ }>;
538
727
  provideSiteMemory(memory: Partial<SiteMemory>): SiteMemory;
539
728
  provideForPage(input: ProvideForPageInput): void;
540
729
  installMemoryDelivery(options?: {
@@ -548,6 +737,8 @@ interface AgentronicsClient {
548
737
  uninstall: () => void;
549
738
  };
550
739
  registerTool(tool: GovernedTool): () => void;
740
+ /** Replace the description overrides (see `toolDescriptions`). */
741
+ setToolDescriptions(descriptions: Record<string, string>): void;
551
742
  /** Push the full tool registry to the gateway so the dashboard can render
552
743
  * the page-wise view (schemas, per-tool tokens, context fullness). */
553
744
  syncTools(): Promise<number>;
@@ -563,11 +754,17 @@ interface AgentronicsClient {
563
754
  estimateTokens(options?: {
564
755
  identity?: AgentIdentity | null;
565
756
  }): TokenBudgetReport;
757
+ /**
758
+ * Register the surfaced tools with `document.modelContext`. `registrations`
759
+ * resolves with each tool's status (callable / failed) once the browser
760
+ * has accepted or rejected it.
761
+ */
566
762
  publishToWebMcp(options?: {
567
763
  identity?: AgentIdentity | null;
568
764
  }): {
569
765
  revoked: boolean;
570
766
  surfaced: number;
767
+ registrations: Promise<WebMcpRegistration[]>;
571
768
  };
572
769
  notifyToolInvoked(toolName: string): void;
573
770
  traces(): TraceEvent[];
@@ -590,4 +787,4 @@ interface AgentronicsClient {
590
787
  }
591
788
  declare const init: (options: InitOptions) => AgentronicsClient;
592
789
 
593
- export { createMemoryCache as $, type AgentronicsClient as A, type SurfacingContext as B, CRAWLER_SIGNATURES as C, type DetectAgentOptions as D, type SurfacingDecision as E, type TokenBudgetReport as F, type GovernedTool as G, type ToolGroupSummary as H, type InitOptions as I, type ToolRegistry as J, type ToolTokenEstimate as K, type TraceInput as L, type MemoryCache as M, type Tracer as N, type WebMcpAdapterOptions as O, type PolicyEngine as P, type WebMcpProvider as Q, type RateLimiter as R, type SiteMemoryListener as S, type TraceExporter as T, type WebMcpToolDescriptor as U, bundledDetectors as V, type WebMcpAdapter as W, createAgentContextStore as X, createAuthEngine as Y, createDetectorRegistry as Z, createIdentityStore as _, type AgentContextListener as a, createMemoryStore as a0, createPolicyCache as a1, createPolicyEngine as a2, createProgressionStore as a3, createRateLimiter as a4, createSiteMemoryStore as a5, createToolRegistry as a6, createTracer as a7, createWebMcpAdapter as a8, decideSurfacing as a9, detectAgent as aa, detectCrawler as ab, detectDom as ac, estimateBudget as ad, estimateToolTokens as ae, explainSurfacing as af, groupTools as ag, init as ah, listGroupNames as ai, surfaceTools as aj, type AgentContextSnapshot as b, type AgentContextStore as c, type AuthEngine as d, type AuthInput as e, type AuthMethod as f, type CrawlerCategory as g, type CrawlerSignature as h, DEFAULT_GROUP as i, type DetectCrawlerOptions as j, type DetectDomOptions as k, type Detector as l, type DetectorRegistry as m, type DetectorStatus as n, type DomSignalName as o, type IdentityStore as p, type MemoryStore as q, type PolicyCache as r, type PresentIdentityOptions as s, type PresentedIdentity as t, type ProgressionConfig as u, type ProgressionStage as v, type ProgressionStore as w, type ProgressionTransition as x, type ProvideForPageInput as y, type SiteMemoryStore as z };
790
+ export { type WebMcpRegistration as $, type AgentronicsClient as A, type Reviewer as B, CRAWLER_SIGNATURES as C, type DetectAgentOptions as D, type SiteMemoryStore as E, type SurfacingContext as F, type GovernedTool as G, type SurfacingDecision as H, type InitOptions as I, type TokenBudgetReport as J, type ToolGroupSummary as K, type ToolRegistry as L, type MemoryCache as M, type ToolTokenEstimate as N, type TraceInput as O, type PolicyEngine as P, type Tracer as Q, type RateLimiter as R, type SiteMemoryListener as S, type TraceExporter as T, type VisionDetectorOptions as U, type VisionDetector as V, type VisionSignals as W, type WebMcpAdapter as X, type WebMcpAdapterOptions as Y, type WebMcpProvider as Z, type WebMcpPublishResult as _, type AgentContextListener as a, type WebMcpToolDescriptor as a0, bundledDetectors as a1, createAgentContextStore as a2, createAuthEngine as a3, createDetectorRegistry as a4, createIdentityStore as a5, createMemoryCache as a6, createMemoryStore as a7, createPolicyCache as a8, createPolicyEngine as a9, createProgressionStore as aa, createRateLimiter as ab, createReviewPrompt as ac, createSiteMemoryStore as ad, createToolRegistry as ae, createTracer as af, createVisionDetector as ag, createWebMcpAdapter as ah, decideSurfacing as ai, defaultAuthMethods as aj, descriptorTokens as ak, detectAgent as al, detectCrawler as am, detectDom as an, estimateBudget as ao, estimateToolTokens as ap, explainSurfacing as aq, groupTools as ar, init as as, listGroupNames as at, modelFacingDescriptor as au, previewAuthMethods as av, scoreVisionSignals as aw, surfaceTools as ax, type AgentContextSnapshot as b, type AgentContextStore as c, type AuthEngine as d, type AuthInput as e, type AuthMethod as f, type CrawlerCategory as g, type CrawlerSignature as h, DEFAULT_GROUP as i, type DetectCrawlerOptions as j, type DetectDomOptions as k, type Detector as l, type DetectorRegistry as m, type DetectorStatus as n, type DomSignalName as o, type IdentityStore as p, type MemoryStore as q, type PolicyCache as r, type PresentIdentityOptions as s, type PresentedIdentity as t, type ProgressionConfig as u, type ProgressionStage as v, type ProgressionStore as w, type ProgressionTransition as x, type ProvideForPageInput as y, type ReviewRequest as z };