@agentronics/sdk 0.3.0 → 0.5.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.
- package/dist/chunk-77VJ65X2.js +17 -0
- package/dist/chunk-77VJ65X2.js.map +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -3
- package/dist/index.d.ts +48 -3
- package/dist/index.global.js +3 -3
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/init-only.cjs +2 -2
- package/dist/init-only.global.js +2 -2
- package/dist/init-only.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-4FJRAPA6.js +0 -17
- package/dist/chunk-4FJRAPA6.js.map +0 -1
package/dist/index.global.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js","../../protocol/src/apiKey.ts","../../protocol/src/agent.ts","../../protocol/src/auth.ts","../../protocol/src/policy.ts","../../protocol/src/memory.ts","../../protocol/src/tools.ts","../../protocol/src/trace.ts","../../protocol/src/errors.ts","../src/version.ts","../src/detection/webmcp.ts","../src/detection/crawler.ts","../src/detection/dom.ts","../src/detection/detectors/registry.ts","../src/detection/declare.ts","../src/detection/detectors/signatureLoader.ts","../src/detection/index.ts","../src/auth/identity.ts","../src/auth/trustLevel.ts","../src/auth/methods/bearer.ts","../src/auth/methods/detectionAsAuth.ts","../src/auth/methods/extensionToken.ts","../src/auth/methods/mtls.ts","../src/auth/methods/oauth2.ts","../src/auth/methods/selfDeclaration.ts","../src/auth/methods/sessionLink.ts","../src/auth/methods/sso.ts","../src/auth/methods/spiffe.ts","../src/auth/methods/xAgentHeader.ts","../src/auth/engine.ts","../src/auth/agentContext.ts","../src/authz/rateLimiter.ts","../src/authz/engine.ts","../src/authz/policyCache.ts","../src/authz/overlay.ts","../src/authz/domEnforcer.ts","../src/memory/storage.ts","../src/memory/store.ts","../src/memory/siteMemory.ts","../src/memory/memoryCache.ts","../src/memory/delivery/webmcpContext.ts","../src/memory/delivery/metaTags.ts","../src/memory/delivery/overlay.ts","../src/memory/delivery/wellKnownClient.ts","../src/tools/registry.ts","../src/tools/toolSync.ts","../src/tools/progression.ts","../src/tools/surfacing.ts","../src/tools/groups.ts","../src/tools/tokenEstimate.ts","../src/tools/webmcpAdapter.ts","../src/observability/buffer.ts","../src/observability/sampler.ts","../src/observability/scrub.ts","../src/observability/tracer.ts","../src/observability/exporters/console.ts","../src/observability/exporters/gateway.ts","../src/observability/exporters/webhook.ts","../src/init.ts","../src/index.ts"],"names":["external_exports","__export","BRAND","DIRTY","EMPTY_PATH","INVALID","NEVER","OK","ParseStatus","ZodType","ZodAny","ZodArray","ZodBigInt","ZodBoolean","ZodBranded","ZodCatch","ZodDate","ZodDefault","ZodDiscriminatedUnion","ZodEffects","ZodEnum","ZodError","ZodFirstPartyTypeKind","ZodFunction","ZodIntersection","ZodIssueCode","ZodLazy","ZodLiteral","ZodMap","ZodNaN","ZodNativeEnum","ZodNever","ZodNull","ZodNullable","ZodNumber","ZodObject","ZodOptional","ZodParsedType","ZodPipeline","ZodPromise","ZodReadonly","ZodRecord","ZodSet","ZodString","ZodSymbol","ZodTuple","ZodUndefined","ZodUnion","ZodUnknown","ZodVoid","addIssueToContext","anyType","arrayType","bigIntType","booleanType","coerce","custom","dateType","datetimeRegex","en_default","discriminatedUnionType","effectsType","enumType","functionType","getErrorMap","getParsedType","instanceOfType","intersectionType","isAborted","isAsync","isDirty","isValid","late","lazyType","literalType","makeIssue","mapType","nanType","nativeEnumType","neverType","nullType","nullableType","numberType","objectType","objectUtil","oboolean","onumber","optionalType","ostring","pipelineType","preprocessType","promiseType","quotelessJson","recordType","setType","setErrorMap","strictObjectType","stringType","symbolType","tupleType","undefinedType","unionType","unknownType","util","voidType","_","assertIs","_arg","assertNever","_x","items","obj","item","validKeys","k","filtered","e","object","keys","key","arr","checker","val","joinValues","array","separator","value","first","second","data","_ZodError","issues","sub","subs","actualProto","_mapper","mapper","issue","fieldErrors","processError","error","curr","el","formErrors","firstEl","errorMap","_ctx","message","overrideErrorMap","map","params","path","errorMaps","issueData","fullPath","fullIssue","errorMessage","maps","m","ctx","overrideMap","x","_ParseStatus","status","results","arrayValue","s","pairs","syncPairs","pair","finalObject","errorUtil","ParseInputLazyPath","parent","handleResult","result","processCreateParams","invalid_type_error","required_error","description","iss","input","err","maybeAsyncResult","check","getIssueProperties","setError","refinementData","refinement","def","option","incoming","transform","defaultValueFunc","catchValueFunc","This","target","cuidRegex","cuid2Regex","ulidRegex","uuidRegex","nanoidRegex","jwtRegex","durationRegex","emailRegex","_emojiRegex","emojiRegex","ipv4Regex","ipv4CidrRegex","ipv6Regex","ipv6CidrRegex","base64Regex","base64urlRegex","dateRegexSource","dateRegex","timeRegexSource","args","secondsRegexSource","secondsQuantifier","timeRegex","regex","opts","isValidIP","ip","version","isValidJWT","jwt","alg","header","base64","decoded","isValidCidr","_ZodString","tooBig","tooSmall","validation","options","minLength","maxLength","len","ch","min","max","floatSafeRemainder","step","valDecCount","stepDecCount","decCount","valInt","stepInt","_ZodNumber","kind","inclusive","_ZodBigInt","_ZodDate","minDate","maxDate","_ZodArray","i","schema","deepPartialify","newShape","fieldSchema","_ZodObject","shape","shapeKeys","extraKeys","keyValidator","unknownKeys","catchall","defaultError","augmentation","merging","index","mask","newField","createZodEnum","handleResults","unionErrors","childCtx","dirty","types","getDiscriminator","type","_ZodDiscriminatedUnion","discriminator","discriminatorValue","optionsMap","discriminatorValues","mergeValues","a","b","aType","bType","bKeys","sharedKeys","newObj","sharedValue","newArray","itemA","itemB","handleParsed","parsedLeft","parsedRight","merged","left","right","_ZodTuple","itemIndex","rest","schemas","_ZodRecord","keyType","valueType","third","finalMap","_ZodSet","finalizeSet","elements","parsedSet","element","minSize","maxSize","size","_ZodFunction","makeArgsIssue","makeReturnsIssue","returns","fn","me","parsedArgs","parsedReturns","returnType","func","getter","values","_ZodEnum","expectedValues","enumValues","newDef","opt","nativeEnumValues","promisified","effect","checkCtx","arg","processed","executeRefinement","acc","inner","base","preprocess","newCtx","_ZodPipeline","inResult","freeze","cleanParams","p","_params","fatal","r","_fatal","cls","PUBLISHABLE_KEY_PREFIX","SECRET_KEY_PREFIX","z","classifyApiKey","AgentClass","TrustLevel","AgentIdentity","AuthProtocol","IdentityClaim","TRUST_RANK","isHigherTrust","candidate","current","PolicyDecision","PolicyRule","PolicyEvaluation","MemoryScope","MemoryEntry","SiteMemoryPage","SiteMemoryNavigation","SiteMemorySiteMap","SiteMemoryWorkflowStep","SiteMemoryWorkflow","SiteMemoryUiHint","SiteMemoryCatalog","SiteMemoryPageContext","SiteMemory","SITE_MEMORY_DEFAULT","ToolDescriptor","ToolRegistry","TraceEventType","TraceEvent","AgentronicsError","code","SDK_VERSION","readModelContext","detectWebMcp","pollMs","start","buildIdentity","resolve","CRAWLER_SIGNATURES","detectCrawler","signatures","disable","confidence","ua","sig","HEADLESS_UA_PATTERNS","checkWebdriver","checkChromedriver","checkPlugins","desktop","empty","checkHeadlessUa","hit","re","checkLanguages","langs","checkPermissions","hasChrome","SIGNALS","detectDom","threshold","signals","totalWeight","hitWeight","name","bundledDetectors","createDetectorRegistry","initial","detectors","detector","all","includeResearch","identity","declareAgent","parsedClass","trust","createSignatureLoader","gatewayUrl","fetcher","etag","response","detectAgent","webmcp","crawler","dom","claim","createIdentityStore","presented","parsed","h","next","detected","J","deriveTrustLevel","declared","verified","linked","highestTrust","identities","best","bearer","context","detectionAsAuth","extensionToken","mtls","oauth2","identityFromClaim","selfDeclaration","sessionLink","sso","spiffe","isGoogleFlavor","xAgentHeader","vendor","rawClass","proof","defaultAuthMethods","METHOD_TO_PROTOCOL","resolveTraceProtocol","methodName","createAuthEngine","methods","onTrace","methodResults","method","winner","entry","winnerEntry","protocol","subject","trace","INITIAL","createAgentContextStore","state","listeners","notify","listener","source","memoryStorage","browserStorage","decode","raw","createRateLimiter","storage","rule","now","storageKey","existing","resetAt","count","matchTool","pattern","tool","meetsTrust","have","need","meetsClass","DEFAULT_DECISION","rateLimitKey","classPart","vendorPart","trustPart","createPolicyEngine","rules","et","rateLimiter","rate","createPolicyCache","siteId","publishableKey","snapshot","body","showDenyOverlay","durationMs","documentRef","node","installDomEnforcer","policyEngine","getIdentity","selector","handler","event","evaluation","inMemoryBackend","store","webStorageBackend","prefix","out","PREFIX","createBackends","hasWindow","session","user","isExpired","record","encode","createMemoryStore","backends","emit","scope","backend","ttl","nt","cloneSiteMemory","memory","w","stamp","createSiteMemoryStore","it","cachedSnapshot","invalidate","snap","provide","update","parts","cursor","provideForPage","P","found","createMemoryCache","createWebMcpContextTool","toolName","getSnapshot","onAccess","META_PREFIX","JSONLD_ID","safeJson","setMeta","doc","content","tag","removeByName","installMetaTags","schemaType","script","OVERLAY_ID","styles","hidden","summarize","pages","workflows","ui","installMemoryOverlay","host","WELL_KNOWN_PATH","fetchWellKnownContext","origin","signal","fetchInit","payload","serializeWellKnownContext","createToolRegistry","evaluate","setPolicies","listPolicies","identityResolver","tools","disabled","writePolicyFor","includeDisabled","resolvedIdentity","policy","output","toToolDescriptor","descriptor","createToolSync","descriptors","createProgressionStore","config","stageMap","stage","enabled","transitionTo","trigger","from","transition","t","previous","passesTrust","minTrust","passesClass","allowed","passesStage","decideSurfacing","surfaceTools","explainSurfacing","DEFAULT_GROUP","groupTools","bucket","list","listGroupNames","stableStringify","estimateToolTokens","characters","estimateBudget","perTool","sum","resolveProvider","toDescriptor","invoke","createWebMcpAdapter","handle","provider","createTraceBuffer","limit","events","clampRate","fallback","createSampler","traceRate","errorRate","random","REDACTED","cloneJson","redactPath","head","scrubValue","paths","cloned","DEFAULT_SCRUB_PATHS","defaultPageProvider","randomId","cryptoApi","createTracer","bufferSize","sessionId","scrubPaths","exporters","onExporterError","pageProvider","samplerOptions","buffer","sampler","readPage","metadata","page","R","exporter","createConsoleExporter","createGatewayExporter","batch","sleep","ms","createWebhookExporter","url","maxRetries","queueLimit","readQueue","attempt","writeQueue","queueKey","DEFAULT_GATEWAY_URL","resolveGatewayUrl","provided","init","debug","policies","V","l","traceEnabled","tracerOptions","tracer","emitTrace","identityStore","authOptions","auth","agentContext","policyCache","siteMemoryOptions","siteMemory","memoryCache","toolSync","detect","detectOptions","progression","surfacingContext","surfaceFor","handleToolInvoked","fallbackWebMcpIdentity","autoDetectOption","ready","detectOpts","metaTags","overlay","handles","wellKnownOptions","memorySnapshot","surfaced","Agentronics","VERSION"],"mappings":"gDAAA,IAAA,EAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,IAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA,IAAAA,CAAAA,CAAA,EAAA,CAAAC,EAAAA,CAAAD,CAAAA,CAAA,WAAAE,EAAAA,CAAA,KAAA,CAAA,IAAAC,EAAAA,CAAA,UAAA,CAAA,IAAAC,EAAAA,CAAA,OAAA,CAAA,IAAAC,CAAAA,CAAA,KAAA,CAAA,IAAAC,GAAA,EAAA,CAAA,IAAAC,CAAAA,CAAA,WAAA,CAAA,IAAAC,CAAAA,CAAA,MAAA,CAAA,IA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AA,CAEhDoT,EAAAA,CAAU","file":"index.global.js","sourcesContent":["export * from \"./errors.js\";\nexport * from \"./helpers/parseUtil.js\";\nexport * from \"./helpers/typeAliases.js\";\nexport * from \"./helpers/util.js\";\nexport * from \"./types.js\";\nexport * from \"./ZodError.js\";\n","export var util;\n(function (util) {\n util.assertEqual = (_) => { };\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && Number.isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array.map((val) => (typeof val === \"string\" ? `'${val}'` : val)).join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (util = {}));\nexport var objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (objectUtil = {}));\nexport const ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return ZodParsedType.undefined;\n case \"string\":\n return ZodParsedType.string;\n case \"number\":\n return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n case \"boolean\":\n return ZodParsedType.boolean;\n case \"function\":\n return ZodParsedType.function;\n case \"bigint\":\n return ZodParsedType.bigint;\n case \"symbol\":\n return ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return ZodParsedType.array;\n }\n if (data === null) {\n return ZodParsedType.null;\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return ZodParsedType.date;\n }\n return ZodParsedType.object;\n default:\n return ZodParsedType.unknown;\n }\n};\n","import { util } from \"./helpers/util.js\";\nexport const ZodIssueCode = util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nexport const quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nexport class ZodError extends Error {\n get errors() {\n return this.issues;\n }\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n static assert(value) {\n if (!(value instanceof ZodError)) {\n throw new Error(`Not a ZodError: ${value}`);\n }\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n const firstEl = sub.path[0];\n fieldErrors[firstEl] = fieldErrors[firstEl] || [];\n fieldErrors[firstEl].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n","import { ZodIssueCode } from \"../ZodError.js\";\nimport { util, ZodParsedType } from \"../helpers/util.js\";\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n if (issue.received === ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n break;\n case ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n break;\n case ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"bigint\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util.assertNever(issue);\n }\n return { message };\n};\nexport default errorMap;\n","import defaultErrorMap from \"./locales/en.js\";\nlet overrideErrorMap = defaultErrorMap;\nexport { defaultErrorMap };\nexport function setErrorMap(map) {\n overrideErrorMap = map;\n}\nexport function getErrorMap() {\n return overrideErrorMap;\n}\n","import { getErrorMap } from \"../errors.js\";\nimport defaultErrorMap from \"../locales/en.js\";\nexport const makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n if (issueData.message !== undefined) {\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message,\n };\n }\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: errorMessage,\n };\n};\nexport const EMPTY_PATH = [];\nexport function addIssueToContext(ctx, issueData) {\n const overrideMap = getErrorMap();\n const issue = makeIssue({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap, // contextual error map is first priority\n ctx.schemaErrorMap, // then schema-bound map if available\n overrideMap, // then global override map\n overrideMap === defaultErrorMap ? undefined : defaultErrorMap, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nexport class ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return INVALID;\n if (value.status === \"aborted\")\n return INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" && (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nexport const INVALID = Object.freeze({\n status: \"aborted\",\n});\nexport const DIRTY = (value) => ({ status: \"dirty\", value });\nexport const OK = (value) => ({ status: \"valid\", value });\nexport const isAborted = (x) => x.status === \"aborted\";\nexport const isDirty = (x) => x.status === \"dirty\";\nexport const isValid = (x) => x.status === \"valid\";\nexport const isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n","export var errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n // biome-ignore lint:\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message?.message;\n})(errorUtil || (errorUtil = {}));\n","import { ZodError, ZodIssueCode, } from \"./ZodError.js\";\nimport { defaultErrorMap, getErrorMap } from \"./errors.js\";\nimport { errorUtil } from \"./helpers/errorUtil.js\";\nimport { DIRTY, INVALID, OK, ParseStatus, addIssueToContext, isAborted, isAsync, isDirty, isValid, makeIssue, } from \"./helpers/parseUtil.js\";\nimport { util, ZodParsedType, getParsedType } from \"./helpers/util.js\";\nclass ParseInputLazyPath {\n constructor(parent, value, path, key) {\n this._cachedPath = [];\n this.parent = parent;\n this.data = value;\n this._path = path;\n this._key = key;\n }\n get path() {\n if (!this._cachedPath.length) {\n if (Array.isArray(this._key)) {\n this._cachedPath.push(...this._path, ...this._key);\n }\n else {\n this._cachedPath.push(...this._path, this._key);\n }\n }\n return this._cachedPath;\n }\n}\nconst handleResult = (ctx, result) => {\n if (isValid(result)) {\n return { success: true, data: result.value };\n }\n else {\n if (!ctx.common.issues.length) {\n throw new Error(\"Validation failed but no issues detected.\");\n }\n return {\n success: false,\n get error() {\n if (this._error)\n return this._error;\n const error = new ZodError(ctx.common.issues);\n this._error = error;\n return this._error;\n },\n };\n }\n};\nfunction processCreateParams(params) {\n if (!params)\n return {};\n const { errorMap, invalid_type_error, required_error, description } = params;\n if (errorMap && (invalid_type_error || required_error)) {\n throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n }\n if (errorMap)\n return { errorMap: errorMap, description };\n const customMap = (iss, ctx) => {\n const { message } = params;\n if (iss.code === \"invalid_enum_value\") {\n return { message: message ?? ctx.defaultError };\n }\n if (typeof ctx.data === \"undefined\") {\n return { message: message ?? required_error ?? ctx.defaultError };\n }\n if (iss.code !== \"invalid_type\")\n return { message: ctx.defaultError };\n return { message: message ?? invalid_type_error ?? ctx.defaultError };\n };\n return { errorMap: customMap, description };\n}\nexport class ZodType {\n get description() {\n return this._def.description;\n }\n _getType(input) {\n return getParsedType(input.data);\n }\n _getOrReturnCtx(input, ctx) {\n return (ctx || {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n });\n }\n _processInputParams(input) {\n return {\n status: new ParseStatus(),\n ctx: {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n },\n };\n }\n _parseSync(input) {\n const result = this._parse(input);\n if (isAsync(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }\n _parseAsync(input) {\n const result = this._parse(input);\n return Promise.resolve(result);\n }\n parse(data, params) {\n const result = this.safeParse(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n safeParse(data, params) {\n const ctx = {\n common: {\n issues: [],\n async: params?.async ?? false,\n contextualErrorMap: params?.errorMap,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n return handleResult(ctx, result);\n }\n \"~validate\"(data) {\n const ctx = {\n common: {\n issues: [],\n async: !!this[\"~standard\"].async,\n },\n path: [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n if (!this[\"~standard\"].async) {\n try {\n const result = this._parseSync({ data, path: [], parent: ctx });\n return isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n };\n }\n catch (err) {\n if (err?.message?.toLowerCase()?.includes(\"encountered\")) {\n this[\"~standard\"].async = true;\n }\n ctx.common = {\n issues: [],\n async: true,\n };\n }\n }\n return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n });\n }\n async parseAsync(data, params) {\n const result = await this.safeParseAsync(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n async safeParseAsync(data, params) {\n const ctx = {\n common: {\n issues: [],\n contextualErrorMap: params?.errorMap,\n async: true,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });\n const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));\n return handleResult(ctx, result);\n }\n refine(check, message) {\n const getIssueProperties = (val) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n }\n else if (typeof message === \"function\") {\n return message(val);\n }\n else {\n return message;\n }\n };\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = () => ctx.addIssue({\n code: ZodIssueCode.custom,\n ...getIssueProperties(val),\n });\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n refinement(check, refinementData) {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\" ? refinementData(val, ctx) : refinementData);\n return false;\n }\n else {\n return true;\n }\n });\n }\n _refinement(refinement) {\n return new ZodEffects({\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"refinement\", refinement },\n });\n }\n superRefine(refinement) {\n return this._refinement(refinement);\n }\n constructor(def) {\n /** Alias of safeParseAsync */\n this.spa = this.safeParseAsync;\n this._def = def;\n this.parse = this.parse.bind(this);\n this.safeParse = this.safeParse.bind(this);\n this.parseAsync = this.parseAsync.bind(this);\n this.safeParseAsync = this.safeParseAsync.bind(this);\n this.spa = this.spa.bind(this);\n this.refine = this.refine.bind(this);\n this.refinement = this.refinement.bind(this);\n this.superRefine = this.superRefine.bind(this);\n this.optional = this.optional.bind(this);\n this.nullable = this.nullable.bind(this);\n this.nullish = this.nullish.bind(this);\n this.array = this.array.bind(this);\n this.promise = this.promise.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n this.transform = this.transform.bind(this);\n this.brand = this.brand.bind(this);\n this.default = this.default.bind(this);\n this.catch = this.catch.bind(this);\n this.describe = this.describe.bind(this);\n this.pipe = this.pipe.bind(this);\n this.readonly = this.readonly.bind(this);\n this.isNullable = this.isNullable.bind(this);\n this.isOptional = this.isOptional.bind(this);\n this[\"~standard\"] = {\n version: 1,\n vendor: \"zod\",\n validate: (data) => this[\"~validate\"](data),\n };\n }\n optional() {\n return ZodOptional.create(this, this._def);\n }\n nullable() {\n return ZodNullable.create(this, this._def);\n }\n nullish() {\n return this.nullable().optional();\n }\n array() {\n return ZodArray.create(this);\n }\n promise() {\n return ZodPromise.create(this, this._def);\n }\n or(option) {\n return ZodUnion.create([this, option], this._def);\n }\n and(incoming) {\n return ZodIntersection.create(this, incoming, this._def);\n }\n transform(transform) {\n return new ZodEffects({\n ...processCreateParams(this._def),\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"transform\", transform },\n });\n }\n default(def) {\n const defaultValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodDefault({\n ...processCreateParams(this._def),\n innerType: this,\n defaultValue: defaultValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n });\n }\n brand() {\n return new ZodBranded({\n typeName: ZodFirstPartyTypeKind.ZodBranded,\n type: this,\n ...processCreateParams(this._def),\n });\n }\n catch(def) {\n const catchValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodCatch({\n ...processCreateParams(this._def),\n innerType: this,\n catchValue: catchValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n });\n }\n describe(description) {\n const This = this.constructor;\n return new This({\n ...this._def,\n description,\n });\n }\n pipe(target) {\n return ZodPipeline.create(this, target);\n }\n readonly() {\n return ZodReadonly.create(this);\n }\n isOptional() {\n return this.safeParse(undefined).success;\n }\n isNullable() {\n return this.safeParse(null).success;\n }\n}\nconst cuidRegex = /^c[^\\s-]{8,}$/i;\nconst cuid2Regex = /^[0-9a-z]+$/;\nconst ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;\n// const uuidRegex =\n// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;\nconst uuidRegex = /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/i;\nconst nanoidRegex = /^[a-z0-9_-]{21}$/i;\nconst jwtRegex = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\nconst durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n// from https://stackoverflow.com/a/46181/1550155\n// old version: too slow, didn't support unicode\n// const emailRegex = /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i;\n//old email regex\n// const emailRegex = /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@((?!-)([^<>()[\\].,;:\\s@\"]+\\.)+[^<>()[\\].,;:\\s@\"]{1,})[^-<>()[\\].,;:\\s@\"]$/i;\n// eslint-disable-next-line\n// const emailRegex =\n// /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\])|(\\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\\.[A-Za-z]{2,})+))$/;\n// const emailRegex =\n// /^[a-zA-Z0-9\\.\\!\\#\\$\\%\\&\\'\\*\\+\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~\\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// const emailRegex =\n// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i;\nconst emailRegex = /^(?!\\.)(?!.*\\.\\.)([A-Z0-9_'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;\n// const emailRegex =\n// /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\\.[a-z0-9\\-]+)*$/i;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emojiRegex = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nlet emojiRegex;\n// faster, simpler, safer\nconst ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nconst ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/(3[0-2]|[12]?[0-9])$/;\n// const ipv6Regex =\n// /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;\nconst ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\nconst ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nconst base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;\n// https://base64.guru/standards/base64url\nconst base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;\n// simple\n// const dateRegexSource = `\\\\d{4}-\\\\d{2}-\\\\d{2}`;\n// no leap year validation\n// const dateRegexSource = `\\\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\\\d|2\\\\d))`;\n// with leap year validation\nconst dateRegexSource = `((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))`;\nconst dateRegex = new RegExp(`^${dateRegexSource}$`);\nfunction timeRegexSource(args) {\n let secondsRegexSource = `[0-5]\\\\d`;\n if (args.precision) {\n secondsRegexSource = `${secondsRegexSource}\\\\.\\\\d{${args.precision}}`;\n }\n else if (args.precision == null) {\n secondsRegexSource = `${secondsRegexSource}(\\\\.\\\\d+)?`;\n }\n const secondsQuantifier = args.precision ? \"+\" : \"?\"; // require seconds if precision is nonzero\n return `([01]\\\\d|2[0-3]):[0-5]\\\\d(:${secondsRegexSource})${secondsQuantifier}`;\n}\nfunction timeRegex(args) {\n return new RegExp(`^${timeRegexSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetimeRegex(args) {\n let regex = `${dateRegexSource}T${timeRegexSource(args)}`;\n const opts = [];\n opts.push(args.local ? `Z?` : `Z`);\n if (args.offset)\n opts.push(`([+-]\\\\d{2}:?\\\\d{2})`);\n regex = `${regex}(${opts.join(\"|\")})`;\n return new RegExp(`^${regex}$`);\n}\nfunction isValidIP(ip, version) {\n if ((version === \"v4\" || !version) && ipv4Regex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6Regex.test(ip)) {\n return true;\n }\n return false;\n}\nfunction isValidJWT(jwt, alg) {\n if (!jwtRegex.test(jwt))\n return false;\n try {\n const [header] = jwt.split(\".\");\n if (!header)\n return false;\n // Convert base64url to base64\n const base64 = header\n .replace(/-/g, \"+\")\n .replace(/_/g, \"/\")\n .padEnd(header.length + ((4 - (header.length % 4)) % 4), \"=\");\n const decoded = JSON.parse(atob(base64));\n if (typeof decoded !== \"object\" || decoded === null)\n return false;\n if (\"typ\" in decoded && decoded?.typ !== \"JWT\")\n return false;\n if (!decoded.alg)\n return false;\n if (alg && decoded.alg !== alg)\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nfunction isValidCidr(ip, version) {\n if ((version === \"v4\" || !version) && ipv4CidrRegex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6CidrRegex.test(ip)) {\n return true;\n }\n return false;\n}\nexport class ZodString extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.string) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.string,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n else if (tooSmall) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n status.dirty();\n }\n }\n else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"email\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"emoji\") {\n if (!emojiRegex) {\n emojiRegex = new RegExp(_emojiRegex, \"u\");\n }\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"emoji\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"uuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"nanoid\") {\n if (!nanoidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"nanoid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid2\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ulid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"url\") {\n try {\n new URL(input.data);\n }\n catch {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"regex\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n }\n else if (check.kind === \"includes\") {\n if (!input.data.includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n }\n else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n }\n else if (check.kind === \"startsWith\") {\n if (!input.data.startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"endsWith\") {\n if (!input.data.endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"date\") {\n const regex = dateRegex;\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"date\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"time\") {\n const regex = timeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"time\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"duration\") {\n if (!durationRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"duration\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ip\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"jwt\") {\n if (!isValidJWT(input.data, check.alg)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"jwt\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cidr\") {\n if (!isValidCidr(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cidr\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64\") {\n if (!base64Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64url\") {\n if (!base64urlRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _regex(regex, validation, message) {\n return this.refinement((data) => regex.test(data), {\n validation,\n code: ZodIssueCode.invalid_string,\n ...errorUtil.errToObj(message),\n });\n }\n _addCheck(check) {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n email(message) {\n return this._addCheck({ kind: \"email\", ...errorUtil.errToObj(message) });\n }\n url(message) {\n return this._addCheck({ kind: \"url\", ...errorUtil.errToObj(message) });\n }\n emoji(message) {\n return this._addCheck({ kind: \"emoji\", ...errorUtil.errToObj(message) });\n }\n uuid(message) {\n return this._addCheck({ kind: \"uuid\", ...errorUtil.errToObj(message) });\n }\n nanoid(message) {\n return this._addCheck({ kind: \"nanoid\", ...errorUtil.errToObj(message) });\n }\n cuid(message) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil.errToObj(message) });\n }\n cuid2(message) {\n return this._addCheck({ kind: \"cuid2\", ...errorUtil.errToObj(message) });\n }\n ulid(message) {\n return this._addCheck({ kind: \"ulid\", ...errorUtil.errToObj(message) });\n }\n base64(message) {\n return this._addCheck({ kind: \"base64\", ...errorUtil.errToObj(message) });\n }\n base64url(message) {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return this._addCheck({\n kind: \"base64url\",\n ...errorUtil.errToObj(message),\n });\n }\n jwt(options) {\n return this._addCheck({ kind: \"jwt\", ...errorUtil.errToObj(options) });\n }\n ip(options) {\n return this._addCheck({ kind: \"ip\", ...errorUtil.errToObj(options) });\n }\n cidr(options) {\n return this._addCheck({ kind: \"cidr\", ...errorUtil.errToObj(options) });\n }\n datetime(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"datetime\",\n precision: null,\n offset: false,\n local: false,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"datetime\",\n precision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n offset: options?.offset ?? false,\n local: options?.local ?? false,\n ...errorUtil.errToObj(options?.message),\n });\n }\n date(message) {\n return this._addCheck({ kind: \"date\", message });\n }\n time(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"time\",\n precision: null,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"time\",\n precision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n ...errorUtil.errToObj(options?.message),\n });\n }\n duration(message) {\n return this._addCheck({ kind: \"duration\", ...errorUtil.errToObj(message) });\n }\n regex(regex, message) {\n return this._addCheck({\n kind: \"regex\",\n regex: regex,\n ...errorUtil.errToObj(message),\n });\n }\n includes(value, options) {\n return this._addCheck({\n kind: \"includes\",\n value: value,\n position: options?.position,\n ...errorUtil.errToObj(options?.message),\n });\n }\n startsWith(value, message) {\n return this._addCheck({\n kind: \"startsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n endsWith(value, message) {\n return this._addCheck({\n kind: \"endsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n min(minLength, message) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil.errToObj(message),\n });\n }\n max(maxLength, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxLength,\n ...errorUtil.errToObj(message),\n });\n }\n length(len, message) {\n return this._addCheck({\n kind: \"length\",\n value: len,\n ...errorUtil.errToObj(message),\n });\n }\n /**\n * Equivalent to `.min(1)`\n */\n nonempty(message) {\n return this.min(1, errorUtil.errToObj(message));\n }\n trim() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"trim\" }],\n });\n }\n toLowerCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toLowerCase\" }],\n });\n }\n toUpperCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toUpperCase\" }],\n });\n }\n get isDatetime() {\n return !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n }\n get isDate() {\n return !!this._def.checks.find((ch) => ch.kind === \"date\");\n }\n get isTime() {\n return !!this._def.checks.find((ch) => ch.kind === \"time\");\n }\n get isDuration() {\n return !!this._def.checks.find((ch) => ch.kind === \"duration\");\n }\n get isEmail() {\n return !!this._def.checks.find((ch) => ch.kind === \"email\");\n }\n get isURL() {\n return !!this._def.checks.find((ch) => ch.kind === \"url\");\n }\n get isEmoji() {\n return !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n }\n get isUUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n }\n get isNANOID() {\n return !!this._def.checks.find((ch) => ch.kind === \"nanoid\");\n }\n get isCUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n }\n get isCUID2() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n }\n get isULID() {\n return !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n }\n get isIP() {\n return !!this._def.checks.find((ch) => ch.kind === \"ip\");\n }\n get isCIDR() {\n return !!this._def.checks.find((ch) => ch.kind === \"cidr\");\n }\n get isBase64() {\n return !!this._def.checks.find((ch) => ch.kind === \"base64\");\n }\n get isBase64url() {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return !!this._def.checks.find((ch) => ch.kind === \"base64url\");\n }\n get minLength() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxLength() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodString.create = (params) => {\n return new ZodString({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodString,\n coerce: params?.coerce ?? false,\n ...processCreateParams(params),\n });\n};\n// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034\nfunction floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nexport class ZodNumber extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n this.step = this.multipleOf;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Number(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.number) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.number,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"int\") {\n if (!util.isInteger(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: \"integer\",\n received: \"float\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (floatSafeRemainder(input.data, check.value) !== 0) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"finite\") {\n if (!Number.isFinite(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_finite,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodNumber({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodNumber({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n int(message) {\n return this._addCheck({\n kind: \"int\",\n message: errorUtil.toString(message),\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value: value,\n message: errorUtil.toString(message),\n });\n }\n finite(message) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil.toString(message),\n });\n }\n safe(message) {\n return this._addCheck({\n kind: \"min\",\n inclusive: true,\n value: Number.MIN_SAFE_INTEGER,\n message: errorUtil.toString(message),\n })._addCheck({\n kind: \"max\",\n inclusive: true,\n value: Number.MAX_SAFE_INTEGER,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n get isInt() {\n return !!this._def.checks.find((ch) => ch.kind === \"int\" || (ch.kind === \"multipleOf\" && util.isInteger(ch.value)));\n }\n get isFinite() {\n let max = null;\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"finite\" || ch.kind === \"int\" || ch.kind === \"multipleOf\") {\n return true;\n }\n else if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n else if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return Number.isFinite(min) && Number.isFinite(max);\n }\n}\nZodNumber.create = (params) => {\n return new ZodNumber({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodNumber,\n coerce: params?.coerce || false,\n ...processCreateParams(params),\n });\n};\nexport class ZodBigInt extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n }\n _parse(input) {\n if (this._def.coerce) {\n try {\n input.data = BigInt(input.data);\n }\n catch {\n return this._getInvalidInput(input);\n }\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.bigint) {\n return this._getInvalidInput(input);\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _getInvalidInput(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.bigint,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodBigInt({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodBigInt({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodBigInt.create = (params) => {\n return new ZodBigInt({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodBigInt,\n coerce: params?.coerce ?? false,\n ...processCreateParams(params),\n });\n};\nexport class ZodBoolean extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = Boolean(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.boolean) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.boolean,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodBoolean.create = (params) => {\n return new ZodBoolean({\n typeName: ZodFirstPartyTypeKind.ZodBoolean,\n coerce: params?.coerce || false,\n ...processCreateParams(params),\n });\n};\nexport class ZodDate extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = new Date(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.date) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (Number.isNaN(input.data.getTime())) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_date,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.getTime() < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n message: check.message,\n inclusive: true,\n exact: false,\n minimum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.getTime() > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n message: check.message,\n inclusive: true,\n exact: false,\n maximum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return {\n status: status.value,\n value: new Date(input.data.getTime()),\n };\n }\n _addCheck(check) {\n return new ZodDate({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n min(minDate, message) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n max(maxDate, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n get minDate() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min != null ? new Date(min) : null;\n }\n get maxDate() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max != null ? new Date(max) : null;\n }\n}\nZodDate.create = (params) => {\n return new ZodDate({\n checks: [],\n coerce: params?.coerce || false,\n typeName: ZodFirstPartyTypeKind.ZodDate,\n ...processCreateParams(params),\n });\n};\nexport class ZodSymbol extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.symbol) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.symbol,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodSymbol.create = (params) => {\n return new ZodSymbol({\n typeName: ZodFirstPartyTypeKind.ZodSymbol,\n ...processCreateParams(params),\n });\n};\nexport class ZodUndefined extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.undefined,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodUndefined.create = (params) => {\n return new ZodUndefined({\n typeName: ZodFirstPartyTypeKind.ZodUndefined,\n ...processCreateParams(params),\n });\n};\nexport class ZodNull extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.null) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.null,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodNull.create = (params) => {\n return new ZodNull({\n typeName: ZodFirstPartyTypeKind.ZodNull,\n ...processCreateParams(params),\n });\n};\nexport class ZodAny extends ZodType {\n constructor() {\n super(...arguments);\n // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.\n this._any = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodAny.create = (params) => {\n return new ZodAny({\n typeName: ZodFirstPartyTypeKind.ZodAny,\n ...processCreateParams(params),\n });\n};\nexport class ZodUnknown extends ZodType {\n constructor() {\n super(...arguments);\n // required\n this._unknown = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodUnknown.create = (params) => {\n return new ZodUnknown({\n typeName: ZodFirstPartyTypeKind.ZodUnknown,\n ...processCreateParams(params),\n });\n};\nexport class ZodNever extends ZodType {\n _parse(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.never,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n}\nZodNever.create = (params) => {\n return new ZodNever({\n typeName: ZodFirstPartyTypeKind.ZodNever,\n ...processCreateParams(params),\n });\n};\nexport class ZodVoid extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.void,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodVoid.create = (params) => {\n return new ZodVoid({\n typeName: ZodFirstPartyTypeKind.ZodVoid,\n ...processCreateParams(params),\n });\n};\nexport class ZodArray extends ZodType {\n _parse(input) {\n const { ctx, status } = this._processInputParams(input);\n const def = this._def;\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (def.exactLength !== null) {\n const tooBig = ctx.data.length > def.exactLength.value;\n const tooSmall = ctx.data.length < def.exactLength.value;\n if (tooBig || tooSmall) {\n addIssueToContext(ctx, {\n code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,\n minimum: (tooSmall ? def.exactLength.value : undefined),\n maximum: (tooBig ? def.exactLength.value : undefined),\n type: \"array\",\n inclusive: true,\n exact: true,\n message: def.exactLength.message,\n });\n status.dirty();\n }\n }\n if (def.minLength !== null) {\n if (ctx.data.length < def.minLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.minLength.message,\n });\n status.dirty();\n }\n }\n if (def.maxLength !== null) {\n if (ctx.data.length > def.maxLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.maxLength.message,\n });\n status.dirty();\n }\n }\n if (ctx.common.async) {\n return Promise.all([...ctx.data].map((item, i) => {\n return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n })).then((result) => {\n return ParseStatus.mergeArray(status, result);\n });\n }\n const result = [...ctx.data].map((item, i) => {\n return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n });\n return ParseStatus.mergeArray(status, result);\n }\n get element() {\n return this._def.type;\n }\n min(minLength, message) {\n return new ZodArray({\n ...this._def,\n minLength: { value: minLength, message: errorUtil.toString(message) },\n });\n }\n max(maxLength, message) {\n return new ZodArray({\n ...this._def,\n maxLength: { value: maxLength, message: errorUtil.toString(message) },\n });\n }\n length(len, message) {\n return new ZodArray({\n ...this._def,\n exactLength: { value: len, message: errorUtil.toString(message) },\n });\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodArray.create = (schema, params) => {\n return new ZodArray({\n type: schema,\n minLength: null,\n maxLength: null,\n exactLength: null,\n typeName: ZodFirstPartyTypeKind.ZodArray,\n ...processCreateParams(params),\n });\n};\nfunction deepPartialify(schema) {\n if (schema instanceof ZodObject) {\n const newShape = {};\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: () => newShape,\n });\n }\n else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element),\n });\n }\n else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n }\n else {\n return schema;\n }\n}\nexport class ZodObject extends ZodType {\n constructor() {\n super(...arguments);\n this._cached = null;\n /**\n * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n * If you want to pass through unknown properties, use `.passthrough()` instead.\n */\n this.nonstrict = this.passthrough;\n // extend<\n // Augmentation extends ZodRawShape,\n // NewOutput extends util.flatten<{\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // }>,\n // NewInput extends util.flatten<{\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }>\n // >(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<T, Augmentation>,\n // UnknownKeys,\n // Catchall,\n // NewOutput,\n // NewInput\n // > {\n // return new ZodObject({\n // ...this._def,\n // shape: () => ({\n // ...this._def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // }\n /**\n * @deprecated Use `.extend` instead\n * */\n this.augment = this.extend;\n }\n _getCached() {\n if (this._cached !== null)\n return this._cached;\n const shape = this._def.shape();\n const keys = util.objectKeys(shape);\n this._cached = { shape, keys };\n return this._cached;\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.object) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const { status, ctx } = this._processInputParams(input);\n const { shape, keys: shapeKeys } = this._getCached();\n const extraKeys = [];\n if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === \"strip\")) {\n for (const key in ctx.data) {\n if (!shapeKeys.includes(key)) {\n extraKeys.push(key);\n }\n }\n }\n const pairs = [];\n for (const key of shapeKeys) {\n const keyValidator = shape[key];\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (this._def.catchall instanceof ZodNever) {\n const unknownKeys = this._def.unknownKeys;\n if (unknownKeys === \"passthrough\") {\n for (const key of extraKeys) {\n pairs.push({\n key: { status: \"valid\", value: key },\n value: { status: \"valid\", value: ctx.data[key] },\n });\n }\n }\n else if (unknownKeys === \"strict\") {\n if (extraKeys.length > 0) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.unrecognized_keys,\n keys: extraKeys,\n });\n status.dirty();\n }\n }\n else if (unknownKeys === \"strip\") {\n }\n else {\n throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n }\n }\n else {\n // run catchall validation\n const catchall = this._def.catchall;\n for (const key of extraKeys) {\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)\n ),\n alwaysSet: key in ctx.data,\n });\n }\n }\n if (ctx.common.async) {\n return Promise.resolve()\n .then(async () => {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n alwaysSet: pair.alwaysSet,\n });\n }\n return syncPairs;\n })\n .then((syncPairs) => {\n return ParseStatus.mergeObjectSync(status, syncPairs);\n });\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get shape() {\n return this._def.shape();\n }\n strict(message) {\n errorUtil.errToObj;\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strict\",\n ...(message !== undefined\n ? {\n errorMap: (issue, ctx) => {\n const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;\n if (issue.code === \"unrecognized_keys\")\n return {\n message: errorUtil.errToObj(message).message ?? defaultError,\n };\n return {\n message: defaultError,\n };\n },\n }\n : {}),\n });\n }\n strip() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strip\",\n });\n }\n passthrough() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"passthrough\",\n });\n }\n // const AugmentFactory =\n // <Def extends ZodObjectDef>(def: Def) =>\n // <Augmentation extends ZodRawShape>(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<ReturnType<Def[\"shape\"]>, Augmentation>,\n // Def[\"unknownKeys\"],\n // Def[\"catchall\"]\n // > => {\n // return new ZodObject({\n // ...def,\n // shape: () => ({\n // ...def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // };\n extend(augmentation) {\n return new ZodObject({\n ...this._def,\n shape: () => ({\n ...this._def.shape(),\n ...augmentation,\n }),\n });\n }\n /**\n * Prior to zod@1.0.12 there was a bug in the\n * inferred type of merged objects. Please\n * upgrade if you are experiencing issues.\n */\n merge(merging) {\n const merged = new ZodObject({\n unknownKeys: merging._def.unknownKeys,\n catchall: merging._def.catchall,\n shape: () => ({\n ...this._def.shape(),\n ...merging._def.shape(),\n }),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n });\n return merged;\n }\n // merge<\n // Incoming extends AnyZodObject,\n // Augmentation extends Incoming[\"shape\"],\n // NewOutput extends {\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // },\n // NewInput extends {\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }\n // >(\n // merging: Incoming\n // ): ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"],\n // NewOutput,\n // NewInput\n // > {\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n setKey(key, schema) {\n return this.augment({ [key]: schema });\n }\n // merge<Incoming extends AnyZodObject>(\n // merging: Incoming\n // ): //ZodObject<T & Incoming[\"_shape\"], UnknownKeys, Catchall> = (merging) => {\n // ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"]\n // > {\n // // const mergedShape = objectUtil.mergeShapes(\n // // this._def.shape(),\n // // merging._def.shape()\n // // );\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n catchall(index) {\n return new ZodObject({\n ...this._def,\n catchall: index,\n });\n }\n pick(mask) {\n const shape = {};\n for (const key of util.objectKeys(mask)) {\n if (mask[key] && this.shape[key]) {\n shape[key] = this.shape[key];\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n omit(mask) {\n const shape = {};\n for (const key of util.objectKeys(this.shape)) {\n if (!mask[key]) {\n shape[key] = this.shape[key];\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n /**\n * @deprecated\n */\n deepPartial() {\n return deepPartialify(this);\n }\n partial(mask) {\n const newShape = {};\n for (const key of util.objectKeys(this.shape)) {\n const fieldSchema = this.shape[key];\n if (mask && !mask[key]) {\n newShape[key] = fieldSchema;\n }\n else {\n newShape[key] = fieldSchema.optional();\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n required(mask) {\n const newShape = {};\n for (const key of util.objectKeys(this.shape)) {\n if (mask && !mask[key]) {\n newShape[key] = this.shape[key];\n }\n else {\n const fieldSchema = this.shape[key];\n let newField = fieldSchema;\n while (newField instanceof ZodOptional) {\n newField = newField._def.innerType;\n }\n newShape[key] = newField;\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n keyof() {\n return createZodEnum(util.objectKeys(this.shape));\n }\n}\nZodObject.create = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.strictCreate = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strict\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.lazycreate = (shape, params) => {\n return new ZodObject({\n shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nexport class ZodUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const options = this._def.options;\n function handleResults(results) {\n // return first issue-free validation if it exists\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n // add issues from dirty option\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n // return invalid\n const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return Promise.all(options.map(async (option) => {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n return {\n result: await option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n }),\n ctx: childCtx,\n };\n })).then(handleResults);\n }\n else {\n let dirty = undefined;\n const issues = [];\n for (const option of options) {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n const result = option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n });\n if (result.status === \"valid\") {\n return result;\n }\n else if (result.status === \"dirty\" && !dirty) {\n dirty = { result, ctx: childCtx };\n }\n if (childCtx.common.issues.length) {\n issues.push(childCtx.common.issues);\n }\n }\n if (dirty) {\n ctx.common.issues.push(...dirty.ctx.common.issues);\n return dirty.result;\n }\n const unionErrors = issues.map((issues) => new ZodError(issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n }\n get options() {\n return this._def.options;\n }\n}\nZodUnion.create = (types, params) => {\n return new ZodUnion({\n options: types,\n typeName: ZodFirstPartyTypeKind.ZodUnion,\n ...processCreateParams(params),\n });\n};\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\n////////// //////////\n////////// ZodDiscriminatedUnion //////////\n////////// //////////\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\nconst getDiscriminator = (type) => {\n if (type instanceof ZodLazy) {\n return getDiscriminator(type.schema);\n }\n else if (type instanceof ZodEffects) {\n return getDiscriminator(type.innerType());\n }\n else if (type instanceof ZodLiteral) {\n return [type.value];\n }\n else if (type instanceof ZodEnum) {\n return type.options;\n }\n else if (type instanceof ZodNativeEnum) {\n // eslint-disable-next-line ban/ban\n return util.objectValues(type.enum);\n }\n else if (type instanceof ZodDefault) {\n return getDiscriminator(type._def.innerType);\n }\n else if (type instanceof ZodUndefined) {\n return [undefined];\n }\n else if (type instanceof ZodNull) {\n return [null];\n }\n else if (type instanceof ZodOptional) {\n return [undefined, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodNullable) {\n return [null, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodBranded) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodReadonly) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodCatch) {\n return getDiscriminator(type._def.innerType);\n }\n else {\n return [];\n }\n};\nexport class ZodDiscriminatedUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const discriminator = this.discriminator;\n const discriminatorValue = ctx.data[discriminator];\n const option = this.optionsMap.get(discriminatorValue);\n if (!option) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union_discriminator,\n options: Array.from(this.optionsMap.keys()),\n path: [discriminator],\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n else {\n return option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n get discriminator() {\n return this._def.discriminator;\n }\n get options() {\n return this._def.options;\n }\n get optionsMap() {\n return this._def.optionsMap;\n }\n /**\n * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n * However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n * have a different value for each object in the union.\n * @param discriminator the name of the discriminator property\n * @param types an array of object schemas\n * @param params\n */\n static create(discriminator, options, params) {\n // Get all the valid discriminator values\n const optionsMap = new Map();\n // try {\n for (const type of options) {\n const discriminatorValues = getDiscriminator(type.shape[discriminator]);\n if (!discriminatorValues.length) {\n throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n }\n for (const value of discriminatorValues) {\n if (optionsMap.has(value)) {\n throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n }\n optionsMap.set(value, type);\n }\n }\n return new ZodDiscriminatedUnion({\n typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n discriminator,\n options,\n optionsMap,\n ...processCreateParams(params),\n });\n }\n}\nfunction mergeValues(a, b) {\n const aType = getParsedType(a);\n const bType = getParsedType(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {\n const bKeys = util.objectKeys(b);\n const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {\n if (a.length !== b.length) {\n return { valid: false };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {\n return { valid: true, data: a };\n }\n else {\n return { valid: false };\n }\n}\nexport class ZodIntersection extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = (parsedLeft, parsedRight) => {\n if (isAborted(parsedLeft) || isAborted(parsedRight)) {\n return INVALID;\n }\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n if (!merged.valid) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_intersection_types,\n });\n return INVALID;\n }\n if (isDirty(parsedLeft) || isDirty(parsedRight)) {\n status.dirty();\n }\n return { status: status.value, value: merged.data };\n };\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n ]).then(([left, right]) => handleParsed(left, right));\n }\n else {\n return handleParsed(this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }), this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }));\n }\n }\n}\nZodIntersection.create = (left, right, params) => {\n return new ZodIntersection({\n left: left,\n right: right,\n typeName: ZodFirstPartyTypeKind.ZodIntersection,\n ...processCreateParams(params),\n });\n};\n// type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];\nexport class ZodTuple extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (ctx.data.length < this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n return INVALID;\n }\n const rest = this._def.rest;\n if (!rest && ctx.data.length > this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n status.dirty();\n }\n const items = [...ctx.data]\n .map((item, itemIndex) => {\n const schema = this._def.items[itemIndex] || this._def.rest;\n if (!schema)\n return null;\n return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n })\n .filter((x) => !!x); // filter nulls\n if (ctx.common.async) {\n return Promise.all(items).then((results) => {\n return ParseStatus.mergeArray(status, results);\n });\n }\n else {\n return ParseStatus.mergeArray(status, items);\n }\n }\n get items() {\n return this._def.items;\n }\n rest(rest) {\n return new ZodTuple({\n ...this._def,\n rest,\n });\n }\n}\nZodTuple.create = (schemas, params) => {\n if (!Array.isArray(schemas)) {\n throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n }\n return new ZodTuple({\n items: schemas,\n typeName: ZodFirstPartyTypeKind.ZodTuple,\n rest: null,\n ...processCreateParams(params),\n });\n};\nexport class ZodRecord extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const pairs = [];\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (ctx.common.async) {\n return ParseStatus.mergeObjectAsync(status, pairs);\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get element() {\n return this._def.valueType;\n }\n static create(first, second, third) {\n if (second instanceof ZodType) {\n return new ZodRecord({\n keyType: first,\n valueType: second,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(third),\n });\n }\n return new ZodRecord({\n keyType: ZodString.create(),\n valueType: first,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(second),\n });\n }\n}\nexport class ZodMap extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.map) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.map,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n const pairs = [...ctx.data.entries()].map(([key, value], index) => {\n return {\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"])),\n };\n });\n if (ctx.common.async) {\n const finalMap = new Map();\n return Promise.resolve().then(async () => {\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n });\n }\n else {\n const finalMap = new Map();\n for (const pair of pairs) {\n const key = pair.key;\n const value = pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n }\n }\n}\nZodMap.create = (keyType, valueType, params) => {\n return new ZodMap({\n valueType,\n keyType,\n typeName: ZodFirstPartyTypeKind.ZodMap,\n ...processCreateParams(params),\n });\n};\nexport class ZodSet extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.set) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.set,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const def = this._def;\n if (def.minSize !== null) {\n if (ctx.data.size < def.minSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.minSize.message,\n });\n status.dirty();\n }\n }\n if (def.maxSize !== null) {\n if (ctx.data.size > def.maxSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.maxSize.message,\n });\n status.dirty();\n }\n }\n const valueType = this._def.valueType;\n function finalizeSet(elements) {\n const parsedSet = new Set();\n for (const element of elements) {\n if (element.status === \"aborted\")\n return INVALID;\n if (element.status === \"dirty\")\n status.dirty();\n parsedSet.add(element.value);\n }\n return { status: status.value, value: parsedSet };\n }\n const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n if (ctx.common.async) {\n return Promise.all(elements).then((elements) => finalizeSet(elements));\n }\n else {\n return finalizeSet(elements);\n }\n }\n min(minSize, message) {\n return new ZodSet({\n ...this._def,\n minSize: { value: minSize, message: errorUtil.toString(message) },\n });\n }\n max(maxSize, message) {\n return new ZodSet({\n ...this._def,\n maxSize: { value: maxSize, message: errorUtil.toString(message) },\n });\n }\n size(size, message) {\n return this.min(size, message).max(size, message);\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodSet.create = (valueType, params) => {\n return new ZodSet({\n valueType,\n minSize: null,\n maxSize: null,\n typeName: ZodFirstPartyTypeKind.ZodSet,\n ...processCreateParams(params),\n });\n};\nexport class ZodFunction extends ZodType {\n constructor() {\n super(...arguments);\n this.validate = this.implement;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.function) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.function,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n function makeArgsIssue(args, error) {\n return makeIssue({\n data: args,\n path: ctx.path,\n errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), defaultErrorMap].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_arguments,\n argumentsError: error,\n },\n });\n }\n function makeReturnsIssue(returns, error) {\n return makeIssue({\n data: returns,\n path: ctx.path,\n errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), defaultErrorMap].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_return_type,\n returnTypeError: error,\n },\n });\n }\n const params = { errorMap: ctx.common.contextualErrorMap };\n const fn = ctx.data;\n if (this._def.returns instanceof ZodPromise) {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(async function (...args) {\n const error = new ZodError([]);\n const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {\n error.addIssue(makeArgsIssue(args, e));\n throw error;\n });\n const result = await Reflect.apply(fn, this, parsedArgs);\n const parsedReturns = await me._def.returns._def.type\n .parseAsync(result, params)\n .catch((e) => {\n error.addIssue(makeReturnsIssue(result, e));\n throw error;\n });\n return parsedReturns;\n });\n }\n else {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(function (...args) {\n const parsedArgs = me._def.args.safeParse(args, params);\n if (!parsedArgs.success) {\n throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);\n }\n const result = Reflect.apply(fn, this, parsedArgs.data);\n const parsedReturns = me._def.returns.safeParse(result, params);\n if (!parsedReturns.success) {\n throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n }\n return parsedReturns.data;\n });\n }\n }\n parameters() {\n return this._def.args;\n }\n returnType() {\n return this._def.returns;\n }\n args(...items) {\n return new ZodFunction({\n ...this._def,\n args: ZodTuple.create(items).rest(ZodUnknown.create()),\n });\n }\n returns(returnType) {\n return new ZodFunction({\n ...this._def,\n returns: returnType,\n });\n }\n implement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n strictImplement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n static create(args, returns, params) {\n return new ZodFunction({\n args: (args ? args : ZodTuple.create([]).rest(ZodUnknown.create())),\n returns: returns || ZodUnknown.create(),\n typeName: ZodFirstPartyTypeKind.ZodFunction,\n ...processCreateParams(params),\n });\n }\n}\nexport class ZodLazy extends ZodType {\n get schema() {\n return this._def.getter();\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const lazySchema = this._def.getter();\n return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });\n }\n}\nZodLazy.create = (getter, params) => {\n return new ZodLazy({\n getter: getter,\n typeName: ZodFirstPartyTypeKind.ZodLazy,\n ...processCreateParams(params),\n });\n};\nexport class ZodLiteral extends ZodType {\n _parse(input) {\n if (input.data !== this._def.value) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_literal,\n expected: this._def.value,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n get value() {\n return this._def.value;\n }\n}\nZodLiteral.create = (value, params) => {\n return new ZodLiteral({\n value: value,\n typeName: ZodFirstPartyTypeKind.ZodLiteral,\n ...processCreateParams(params),\n });\n};\nfunction createZodEnum(values, params) {\n return new ZodEnum({\n values,\n typeName: ZodFirstPartyTypeKind.ZodEnum,\n ...processCreateParams(params),\n });\n}\nexport class ZodEnum extends ZodType {\n _parse(input) {\n if (typeof input.data !== \"string\") {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (!this._cache) {\n this._cache = new Set(this._def.values);\n }\n if (!this._cache.has(input.data)) {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get options() {\n return this._def.values;\n }\n get enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Values() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n extract(values, newDef = this._def) {\n return ZodEnum.create(values, {\n ...this._def,\n ...newDef,\n });\n }\n exclude(values, newDef = this._def) {\n return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {\n ...this._def,\n ...newDef,\n });\n }\n}\nZodEnum.create = createZodEnum;\nexport class ZodNativeEnum extends ZodType {\n _parse(input) {\n const nativeEnumValues = util.getValidEnumValues(this._def.values);\n const ctx = this._getOrReturnCtx(input);\n if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (!this._cache) {\n this._cache = new Set(util.getValidEnumValues(this._def.values));\n }\n if (!this._cache.has(input.data)) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get enum() {\n return this._def.values;\n }\n}\nZodNativeEnum.create = (values, params) => {\n return new ZodNativeEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n ...processCreateParams(params),\n });\n};\nexport class ZodPromise extends ZodType {\n unwrap() {\n return this._def.type;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.promise,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);\n return OK(promisified.then((data) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap,\n });\n }));\n }\n}\nZodPromise.create = (schema, params) => {\n return new ZodPromise({\n type: schema,\n typeName: ZodFirstPartyTypeKind.ZodPromise,\n ...processCreateParams(params),\n });\n};\nexport class ZodEffects extends ZodType {\n innerType() {\n return this._def.schema;\n }\n sourceType() {\n return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects\n ? this._def.schema.sourceType()\n : this._def.schema;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const effect = this._def.effect || null;\n const checkCtx = {\n addIssue: (arg) => {\n addIssueToContext(ctx, arg);\n if (arg.fatal) {\n status.abort();\n }\n else {\n status.dirty();\n }\n },\n get path() {\n return ctx.path;\n },\n };\n checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n if (effect.type === \"preprocess\") {\n const processed = effect.transform(ctx.data, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(processed).then(async (processed) => {\n if (status.value === \"aborted\")\n return INVALID;\n const result = await this._def.schema._parseAsync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return INVALID;\n if (result.status === \"dirty\")\n return DIRTY(result.value);\n if (status.value === \"dirty\")\n return DIRTY(result.value);\n return result;\n });\n }\n else {\n if (status.value === \"aborted\")\n return INVALID;\n const result = this._def.schema._parseSync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return INVALID;\n if (result.status === \"dirty\")\n return DIRTY(result.value);\n if (status.value === \"dirty\")\n return DIRTY(result.value);\n return result;\n }\n }\n if (effect.type === \"refinement\") {\n const executeRefinement = (acc) => {\n const result = effect.refinement(acc, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(result);\n }\n if (result instanceof Promise) {\n throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n }\n return acc;\n };\n if (ctx.common.async === false) {\n const inner = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n // return value is ignored\n executeRefinement(inner.value);\n return { status: status.value, value: inner.value };\n }\n else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n return executeRefinement(inner.value).then(() => {\n return { status: status.value, value: inner.value };\n });\n });\n }\n }\n if (effect.type === \"transform\") {\n if (ctx.common.async === false) {\n const base = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (!isValid(base))\n return INVALID;\n const result = effect.transform(base.value, checkCtx);\n if (result instanceof Promise) {\n throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n }\n return { status: status.value, value: result };\n }\n else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {\n if (!isValid(base))\n return INVALID;\n return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({\n status: status.value,\n value: result,\n }));\n });\n }\n }\n util.assertNever(effect);\n }\n}\nZodEffects.create = (schema, effect, params) => {\n return new ZodEffects({\n schema,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect,\n ...processCreateParams(params),\n });\n};\nZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n return new ZodEffects({\n schema,\n effect: { type: \"preprocess\", transform: preprocess },\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n ...processCreateParams(params),\n });\n};\nexport { ZodEffects as ZodTransformer };\nexport class ZodOptional extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.undefined) {\n return OK(undefined);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodOptional.create = (type, params) => {\n return new ZodOptional({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodOptional,\n ...processCreateParams(params),\n });\n};\nexport class ZodNullable extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.null) {\n return OK(null);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodNullable.create = (type, params) => {\n return new ZodNullable({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodNullable,\n ...processCreateParams(params),\n });\n};\nexport class ZodDefault extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n removeDefault() {\n return this._def.innerType;\n }\n}\nZodDefault.create = (type, params) => {\n return new ZodDefault({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n defaultValue: typeof params.default === \"function\" ? params.default : () => params.default,\n ...processCreateParams(params),\n });\n};\nexport class ZodCatch extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n // newCtx is used to not collect issues from inner types in ctx\n const newCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n };\n const result = this._def.innerType._parse({\n data: newCtx.data,\n path: newCtx.path,\n parent: {\n ...newCtx,\n },\n });\n if (isAsync(result)) {\n return result.then((result) => {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n });\n }\n else {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n }\n }\n removeCatch() {\n return this._def.innerType;\n }\n}\nZodCatch.create = (type, params) => {\n return new ZodCatch({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n catchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n ...processCreateParams(params),\n });\n};\nexport class ZodNaN extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.nan) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.nan,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n}\nZodNaN.create = (params) => {\n return new ZodNaN({\n typeName: ZodFirstPartyTypeKind.ZodNaN,\n ...processCreateParams(params),\n });\n};\nexport const BRAND = Symbol(\"zod_brand\");\nexport class ZodBranded extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const data = ctx.data;\n return this._def.type._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n unwrap() {\n return this._def.type;\n }\n}\nexport class ZodPipeline extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.common.async) {\n const handleAsync = async () => {\n const inResult = await this._def.in._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return DIRTY(inResult.value);\n }\n else {\n return this._def.out._parseAsync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n };\n return handleAsync();\n }\n else {\n const inResult = this._def.in._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return {\n status: \"dirty\",\n value: inResult.value,\n };\n }\n else {\n return this._def.out._parseSync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n }\n static create(a, b) {\n return new ZodPipeline({\n in: a,\n out: b,\n typeName: ZodFirstPartyTypeKind.ZodPipeline,\n });\n }\n}\nexport class ZodReadonly extends ZodType {\n _parse(input) {\n const result = this._def.innerType._parse(input);\n const freeze = (data) => {\n if (isValid(data)) {\n data.value = Object.freeze(data.value);\n }\n return data;\n };\n return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodReadonly.create = (type, params) => {\n return new ZodReadonly({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodReadonly,\n ...processCreateParams(params),\n });\n};\n////////////////////////////////////////\n////////////////////////////////////////\n////////// //////////\n////////// z.custom //////////\n////////// //////////\n////////////////////////////////////////\n////////////////////////////////////////\nfunction cleanParams(params, data) {\n const p = typeof params === \"function\" ? params(data) : typeof params === \"string\" ? { message: params } : params;\n const p2 = typeof p === \"string\" ? { message: p } : p;\n return p2;\n}\nexport function custom(check, _params = {}, \n/**\n * @deprecated\n *\n * Pass `fatal` into the params object instead:\n *\n * ```ts\n * z.string().custom((val) => val.length > 5, { fatal: false })\n * ```\n *\n */\nfatal) {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n const r = check(data);\n if (r instanceof Promise) {\n return r.then((r) => {\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n });\n }\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n return;\n });\n return ZodAny.create();\n}\nexport { ZodType as Schema, ZodType as ZodSchema };\nexport const late = {\n object: ZodObject.lazycreate,\n};\nexport var ZodFirstPartyTypeKind;\n(function (ZodFirstPartyTypeKind) {\n ZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n ZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n ZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n ZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n ZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n ZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n ZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n ZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n ZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n ZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n ZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n ZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n ZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n ZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n ZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n ZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n ZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n ZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n ZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n ZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n ZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n ZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n ZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n ZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n ZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n ZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n ZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n ZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n ZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n ZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n ZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n ZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n ZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n ZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n ZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n ZodFirstPartyTypeKind[\"ZodReadonly\"] = \"ZodReadonly\";\n})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));\n// requires TS 4.4+\nclass Class {\n constructor(..._) { }\n}\nconst instanceOfType = (\n// const instanceOfType = <T extends new (...args: any[]) => any>(\ncls, params = {\n message: `Input not instance of ${cls.name}`,\n}) => custom((data) => data instanceof cls, params);\nconst stringType = ZodString.create;\nconst numberType = ZodNumber.create;\nconst nanType = ZodNaN.create;\nconst bigIntType = ZodBigInt.create;\nconst booleanType = ZodBoolean.create;\nconst dateType = ZodDate.create;\nconst symbolType = ZodSymbol.create;\nconst undefinedType = ZodUndefined.create;\nconst nullType = ZodNull.create;\nconst anyType = ZodAny.create;\nconst unknownType = ZodUnknown.create;\nconst neverType = ZodNever.create;\nconst voidType = ZodVoid.create;\nconst arrayType = ZodArray.create;\nconst objectType = ZodObject.create;\nconst strictObjectType = ZodObject.strictCreate;\nconst unionType = ZodUnion.create;\nconst discriminatedUnionType = ZodDiscriminatedUnion.create;\nconst intersectionType = ZodIntersection.create;\nconst tupleType = ZodTuple.create;\nconst recordType = ZodRecord.create;\nconst mapType = ZodMap.create;\nconst setType = ZodSet.create;\nconst functionType = ZodFunction.create;\nconst lazyType = ZodLazy.create;\nconst literalType = ZodLiteral.create;\nconst enumType = ZodEnum.create;\nconst nativeEnumType = ZodNativeEnum.create;\nconst promiseType = ZodPromise.create;\nconst effectsType = ZodEffects.create;\nconst optionalType = ZodOptional.create;\nconst nullableType = ZodNullable.create;\nconst preprocessType = ZodEffects.createWithPreprocess;\nconst pipelineType = ZodPipeline.create;\nconst ostring = () => stringType().optional();\nconst onumber = () => numberType().optional();\nconst oboolean = () => booleanType().optional();\nexport const coerce = {\n string: ((arg) => ZodString.create({ ...arg, coerce: true })),\n number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),\n boolean: ((arg) => ZodBoolean.create({\n ...arg,\n coerce: true,\n })),\n bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),\n date: ((arg) => ZodDate.create({ ...arg, coerce: true })),\n};\nexport { anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, dateType as date, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, instanceOfType as instanceof, intersectionType as intersection, lazyType as lazy, literalType as literal, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, recordType as record, setType as set, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, voidType as void, };\nexport const NEVER = INVALID;\n","import { z } from 'zod'\n\nexport const PUBLISHABLE_KEY_PREFIX = 'agtx_pk_'\nexport const SECRET_KEY_PREFIX = 'agtx_sk_'\n\nexport type ApiKeyKind = 'publishable' | 'secret'\n\nexport const PublishableApiKey = z\n .string()\n .min(PUBLISHABLE_KEY_PREFIX.length + 8)\n .startsWith(PUBLISHABLE_KEY_PREFIX, {\n message: `Publishable keys must start with \"${PUBLISHABLE_KEY_PREFIX}\".`,\n })\n\nexport const SecretApiKey = z\n .string()\n .min(SECRET_KEY_PREFIX.length + 8)\n .startsWith(SECRET_KEY_PREFIX, {\n message: `Secret keys must start with \"${SECRET_KEY_PREFIX}\".`,\n })\n\nexport const classifyApiKey = (key: string): ApiKeyKind | 'unknown' => {\n if (key.startsWith(PUBLISHABLE_KEY_PREFIX)) return 'publishable'\n if (key.startsWith(SECRET_KEY_PREFIX)) return 'secret'\n return 'unknown'\n}\n","import { z } from 'zod'\n\nexport const AgentClass = z.enum(['webmcp', 'dom', 'screenshot', 'crawler'])\nexport type AgentClass = z.infer<typeof AgentClass>\n\nexport const TrustLevel = z.enum(['detected', 'declared', 'verified', 'linked'])\nexport type TrustLevel = z.infer<typeof TrustLevel>\n\nexport const AgentIdentity = z.object({\n class: AgentClass,\n trust: TrustLevel,\n confidence: z.number().min(0).max(1).default(1),\n vendor: z.string().nullable(),\n userAgent: z.string().nullable(),\n detectionVersion: z.string().default('2026.04'),\n signals: z.record(z.unknown()).default({}),\n})\nexport type AgentIdentity = z.infer<typeof AgentIdentity>\n","import { z } from 'zod'\nimport { AgentClass, TrustLevel } from './agent.js'\n\nexport const AuthProtocol = z.enum([\n 'bearer',\n 'oauth2',\n 'sso',\n 'spiffe',\n 'google-agent',\n 'mtls',\n 'detection',\n 'declaration',\n 'extension',\n 'session-link',\n 'x-agent-header',\n])\nexport type AuthProtocol = z.infer<typeof AuthProtocol>\n\nexport const IdentityClaim = z.object({\n class: AgentClass,\n vendor: z.string().min(1),\n token: z.string().min(8),\n expiresAt: z.string().datetime().optional(),\n})\nexport type IdentityClaim = z.infer<typeof IdentityClaim>\n\nexport const VerificationChallenge = z.object({\n publishableKey: z.string(),\n claim: IdentityClaim,\n nonce: z.string().min(8),\n origin: z.string().url(),\n})\nexport type VerificationChallenge = z.infer<typeof VerificationChallenge>\n\nexport const VerificationResult = z.object({\n trust: TrustLevel,\n vendor: z.string(),\n validUntil: z.string().datetime(),\n reason: z.string().optional(),\n // Canonical principal returned by the verifier (OIDC sub, SPIFFE ID,\n // cert subject). Optional so existing verifiers keep compiling.\n subject: z.string().optional(),\n // Which protocol the gateway actually verified against. Lets the SDK\n // route SPIFFE → 'google-agent' trace labels when the trust domain\n // matches a Google enrichment match.\n protocol: AuthProtocol.optional(),\n // Free-form per-protocol enrichment (e.g. google agent_id, SPIFFE\n // trust domain). Lifted into AgentIdentity.signals at trace time.\n signals: z.record(z.unknown()).optional(),\n})\nexport type VerificationResult = z.infer<typeof VerificationResult>\n\n// Per-site verifier config — shared with the dashboard so it can validate\n// forms before submitting and so the gateway accepts only well-formed\n// PUTs. These mirror the `*Config` interfaces in\n// packages/gateway/src/storage/types.ts but live here because the\n// dashboard already imports from @agentronics/protocol.\nexport const SsoConfigInput = z.object({\n issuer: z.string().url(),\n audiences: z.array(z.string().min(1)).min(1),\n})\nexport type SsoConfigInput = z.infer<typeof SsoConfigInput>\n\nexport const SpiffeConfigInput = z.object({\n trustDomain: z.string().min(1),\n bundleEndpoint: z.string().url(),\n audiences: z.array(z.string().min(1)).min(1),\n googleTrustDomains: z.array(z.string().min(1)).optional(),\n})\nexport type SpiffeConfigInput = z.infer<typeof SpiffeConfigInput>\n\nexport const MtlsConfigInput = z.object({\n // PEM blocks are >20 chars even when empty-bodied; rejects obvious junk.\n rootCerts: z.array(z.string().min(20)).min(1),\n spiffeTrustDomain: z.string().min(1).optional(),\n xfccEntryPolicy: z.enum(['last', 'first', 'only']).default('last'),\n})\nexport type MtlsConfigInput = z.infer<typeof MtlsConfigInput>\n\nexport const SiteProtocolName = z.enum(['sso', 'spiffe', 'mtls'])\nexport type SiteProtocolName = z.infer<typeof SiteProtocolName>\n\n// Body shape for POST /v1/verify/:protocol. Authentication is via the\n// standard Authorization: Bearer <publishable_or_secret_key> header\n// (same middleware as the other authenticated routes). The protocol\n// comes from the URL param. `token` carries JWT-shaped creds (OIDC ID\n// tokens, SPIFFE JWT-SVIDs, Google agent tokens). `xfcc` carries the\n// raw x-forwarded-client-cert header for mTLS verification. Exactly one\n// of `token` or `xfcc` is required; the route handler enforces per\n// protocol. `siteId` selects which per-site verifier config to load.\nexport const VerificationRequest = z.object({\n siteId: z.string().min(1),\n token: z.string().min(8).optional(),\n xfcc: z.string().min(1).optional(),\n headers: z.record(z.string()).optional(),\n origin: z.string().url().optional(),\n})\nexport type VerificationRequest = z.infer<typeof VerificationRequest>\n\nexport const TRUST_RANK: Record<z.infer<typeof TrustLevel>, number> = {\n detected: 0,\n declared: 1,\n verified: 2,\n linked: 3,\n}\n\nexport const isHigherTrust = (\n candidate: z.infer<typeof TrustLevel>,\n current: z.infer<typeof TrustLevel>\n) => TRUST_RANK[candidate] > TRUST_RANK[current]\n","import { z } from 'zod'\nimport { AgentClass, TrustLevel } from './agent.js'\n\nexport const PolicyDecision = z.enum(['allow', 'deny', 'review'])\nexport type PolicyDecision = z.infer<typeof PolicyDecision>\n\nexport const PolicyRule = z.object({\n id: z.string(),\n tool: z.string(),\n minTrust: TrustLevel,\n allowedClasses: z.array(AgentClass).default([]),\n decision: PolicyDecision,\n rateLimit: z\n .object({\n max: z.number().int().positive(),\n windowSeconds: z.number().int().positive(),\n })\n .optional(),\n})\nexport type PolicyRule = z.infer<typeof PolicyRule>\n\nexport const PolicyEvaluation = z.object({\n decision: PolicyDecision,\n ruleId: z.string().nullable(),\n reason: z.string(),\n})\nexport type PolicyEvaluation = z.infer<typeof PolicyEvaluation>\n","import { z } from 'zod'\n\n// ---- Key-value memory (existing surface) -------------------------------------\n\nexport const MemoryScope = z.enum(['session', 'user', 'org'])\nexport type MemoryScope = z.infer<typeof MemoryScope>\n\nexport const MemoryEntry = z.object({\n key: z.string().min(1),\n value: z.unknown(),\n scope: MemoryScope.default('session'),\n ttlSeconds: z.number().int().positive().nullable().default(null),\n updatedAt: z.string().datetime().optional(),\n})\nexport type MemoryEntry = z.infer<typeof MemoryEntry>\n\n// ---- Site memory (Phase 5: enterprise-provided context for agents) ----------\n\nexport const SiteMemoryPage = z.object({\n path: z.string().min(1),\n name: z.string().optional(),\n purpose: z.string().optional(),\n availableActions: z.array(z.string()).optional(),\n prerequisites: z.array(z.string()).optional(),\n queryParams: z.record(z.string()).optional(),\n notes: z.string().optional(),\n})\nexport type SiteMemoryPage = z.infer<typeof SiteMemoryPage>\n\nexport const SiteMemoryNavigation = z.object({\n pattern: z.string().optional(),\n flow: z.string().optional(),\n})\n\nexport const SiteMemorySiteMap = z.object({\n pages: z.array(SiteMemoryPage).default([]),\n navigation: SiteMemoryNavigation.optional(),\n})\n\nexport const SiteMemoryWorkflowStep = z.object({\n step: z.number().int().positive(),\n action: z.string().min(1),\n})\n\nexport const SiteMemoryWorkflow = z.object({\n steps: z.array(SiteMemoryWorkflowStep).default([]),\n notes: z.string().optional(),\n policy: z.string().optional(),\n})\nexport type SiteMemoryWorkflow = z.infer<typeof SiteMemoryWorkflow>\n\nexport const SiteMemoryUiHint = z.object({\n selector: z.string().min(1),\n behavior: z.string().optional(),\n location: z.string().optional(),\n showsCount: z.boolean().optional(),\n})\nexport type SiteMemoryUiHint = z.infer<typeof SiteMemoryUiHint>\n\nexport const SiteMemoryCatalog = z.object({\n categories: z.array(z.string()).optional(),\n productSchema: z\n .object({\n fields: z.array(z.string()).optional(),\n idFormat: z.string().optional(),\n })\n .optional(),\n searchBehavior: z.string().optional(),\n})\n\nexport const SiteMemoryPageContext = z\n .object({\n path: z.string().min(1),\n payload: z.record(z.unknown()).default({}),\n updatedAt: z.string().datetime().optional(),\n })\n .strict()\nexport type SiteMemoryPageContext = z.infer<typeof SiteMemoryPageContext>\n\nexport const SiteMemory = z.object({\n version: z.string().default('1'),\n siteMap: SiteMemorySiteMap.optional(),\n workflows: z.record(SiteMemoryWorkflow).default({}),\n policies: z.record(z.union([z.string(), z.array(z.string())])).default({}),\n catalog: SiteMemoryCatalog.optional(),\n uiGuidance: z.record(SiteMemoryUiHint).default({}),\n pageContexts: z.record(SiteMemoryPageContext).default({}),\n updatedAt: z.string().datetime().optional(),\n})\nexport type SiteMemory = z.infer<typeof SiteMemory>\n\nexport const SITE_MEMORY_DEFAULT: SiteMemory = SiteMemory.parse({})\n","import { z } from 'zod'\n\n/**\n * A single governed tool as surfaced to agents — the wire shape the SDK pushes\n * to the gateway and the dashboard renders. `tokens` is the SDK's estimate of\n * how much of an agent's context the descriptor occupies; `page` is the\n * progression stage / page the tool belongs to (used for page-wise grouping).\n */\nexport const ToolDescriptor = z.object({\n name: z.string().min(1),\n group: z.string().optional(),\n page: z.string().optional(),\n description: z.string().default(''),\n inputSchema: z.record(z.unknown()).default({}),\n outputSchema: z.record(z.unknown()).optional(),\n tokens: z.number().int().nonnegative().default(0),\n})\nexport type ToolDescriptor = z.infer<typeof ToolDescriptor>\n\n/** The full registry the SDK syncs for a site. */\nexport const ToolRegistry = z.object({\n tools: z.array(ToolDescriptor).default([]),\n})\nexport type ToolRegistry = z.infer<typeof ToolRegistry>\n\nexport const TOOL_REGISTRY_DEFAULT: ToolRegistry = ToolRegistry.parse({})\n","import { z } from 'zod'\nimport { AgentIdentity } from './agent.js'\nimport { PolicyEvaluation } from './policy.js'\n\nexport const TraceEventType = z.enum([\n 'agent.detected',\n 'agent.missed',\n 'auth.identity_presented',\n 'auth.identity_cleared',\n 'authz.policies_set',\n 'authz.evaluated',\n 'memory.accessed',\n 'memory.updated',\n 'tool.registered',\n 'tool.executed',\n 'tool.surfaced',\n 'tool.progressed',\n 'sdk.error',\n])\nexport type TraceEventType = z.infer<typeof TraceEventType>\n\nexport const TraceEvent = z.object({\n id: z.string(),\n siteId: z.string(),\n sessionId: z.string(),\n occurredAt: z.string().datetime(),\n type: TraceEventType,\n tool: z.string().optional(),\n agent: AgentIdentity.nullable().optional(),\n policy: PolicyEvaluation.optional(),\n durationMs: z.number().int().nonnegative().optional(),\n outcome: z.enum(['success', 'error', 'blocked']),\n error: z.string().optional(),\n /**\n * Free-form per-event metadata. Reserved keys the gateway and dashboard\n * treat as well-known:\n * - `protocol` — the auth protocol that produced the event (sso, spiffe, …).\n * - `subject` — the verified identity subject string.\n * - `page` — the page path the event occurred on; the dashboard groups\n * WebMCP tools and agent activity by this (SDK ≥ 0.1.2).\n */\n metadata: z.record(z.unknown()).default({}),\n})\nexport type TraceEvent = z.infer<typeof TraceEvent>\n\nexport const TraceBatch = z.object({\n // Optional and never trusted by the gateway — auth is always via the\n // Bearer header. The field stays in the schema for SDK back-compat\n // (older SDKs still send it). Newer SDKs may omit it.\n publishableKey: z.string().optional(),\n events: z.array(TraceEvent).min(1).max(100),\n})\nexport type TraceBatch = z.infer<typeof TraceBatch>\n","export type AgentronicsErrorCode =\n | 'invalid_api_key'\n | 'wrong_key_kind'\n | 'policy_denied'\n | 'tool_unknown'\n | 'rate_limited'\n | 'internal_error'\n\nexport class AgentronicsError extends Error {\n readonly code: AgentronicsErrorCode\n\n constructor(code: AgentronicsErrorCode, message: string) {\n super(message)\n this.name = 'AgentronicsError'\n this.code = code\n }\n}\n","// Single source of truth for the SDK build version, surfaced on every\n// AgentIdentity as `detectionVersion` so traces can be filtered by SDK\n// generation. tsup inlines a pkg-version replacement at build time;\n// the literal here is the dev/test fallback. Bump this when you cut a\n// new SDK release.\nexport const SDK_VERSION = '0.1.2'\n","import type { AgentIdentity } from '@agentronics/protocol'\nimport { SDK_VERSION } from \"../version.js\"\n\ninterface ModelContextLike {\n client?: string\n vendor?: string\n tools?: unknown[]\n}\n\nconst readModelContext = (): ModelContextLike | null => {\n if (typeof navigator === 'undefined') return null\n const value = (navigator as unknown as { modelContext?: ModelContextLike }).modelContext\n return value && typeof value === 'object' ? value : null\n}\n\nexport interface DetectWebMcpOptions {\n /**\n * Some extensions inject `navigator.modelContext` after first paint. Poll for this many\n * milliseconds before giving up. Set to 0 to read synchronously and return immediately.\n */\n pollMs?: number\n}\n\nexport const detectWebMcp = async (\n options: DetectWebMcpOptions = {}\n): Promise<AgentIdentity | null> => {\n const { pollMs = 500 } = options\n const start = Date.now()\n\n while (true) {\n const ctx = readModelContext()\n if (ctx) return buildIdentity(ctx)\n if (Date.now() - start >= pollMs) return null\n await new Promise((resolve) => setTimeout(resolve, 50))\n }\n}\n\nconst buildIdentity = (ctx: ModelContextLike): AgentIdentity => ({\n class: 'webmcp',\n trust: 'detected',\n confidence: 1,\n vendor: ctx.vendor ?? ctx.client ?? null,\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n webmcp: true,\n toolCount: Array.isArray(ctx.tools) ? ctx.tools.length : 0,\n },\n})\n","import type { AgentIdentity } from '@agentronics/protocol'\nimport { SDK_VERSION } from '../version.js'\n\nexport type CrawlerCategory = 'ai' | 'search'\n\nexport interface CrawlerSignature {\n /** Stable vendor id, reported as identity.vendor. */\n name: string\n category: CrawlerCategory\n /** Tested against navigator.userAgent. */\n pattern: RegExp\n}\n\n/**\n * Known AI + search crawlers, matched by User-Agent token.\n *\n * Caveats baked into the design:\n * - UA is self-reported and trivially spoofable, so a match is high-confidence\n * but never certain — we report `confidence: 0.9`, not `1`.\n * - This is client-side detection: it only sees crawlers that actually execute\n * JavaScript on the page. The majority of crawlers fetch HTML and never run\n * the SDK, so full coverage needs server/edge UA inspection (a future product).\n *\n * Order matters: more specific tokens (e.g. `Google-Extended`, `Applebot-Extended`)\n * are listed before their broader siblings so the first match wins correctly.\n */\nexport const CRAWLER_SIGNATURES: CrawlerSignature[] = [\n // AI / LLM crawlers\n { name: 'GPTBot', category: 'ai', pattern: /GPTBot/i },\n { name: 'OAI-SearchBot', category: 'ai', pattern: /OAI-SearchBot/i },\n { name: 'ChatGPT-User', category: 'ai', pattern: /ChatGPT-User/i },\n { name: 'ClaudeBot', category: 'ai', pattern: /ClaudeBot/i },\n { name: 'Claude-Web', category: 'ai', pattern: /Claude-Web/i },\n { name: 'anthropic-ai', category: 'ai', pattern: /anthropic-ai/i },\n { name: 'PerplexityBot', category: 'ai', pattern: /PerplexityBot/i },\n { name: 'Google-Extended', category: 'ai', pattern: /Google-Extended/i },\n { name: 'Applebot-Extended', category: 'ai', pattern: /Applebot-Extended/i },\n { name: 'Amazonbot', category: 'ai', pattern: /Amazonbot/i },\n { name: 'Bytespider', category: 'ai', pattern: /Bytespider/i },\n { name: 'CCBot', category: 'ai', pattern: /CCBot/i },\n { name: 'Meta-ExternalAgent', category: 'ai', pattern: /Meta-ExternalAgent/i },\n { name: 'cohere-ai', category: 'ai', pattern: /cohere-ai/i },\n // Search crawlers\n { name: 'Googlebot', category: 'search', pattern: /Googlebot/i },\n { name: 'Bingbot', category: 'search', pattern: /bingbot/i },\n { name: 'DuckDuckBot', category: 'search', pattern: /DuckDuckBot/i },\n { name: 'YandexBot', category: 'search', pattern: /YandexBot/i },\n { name: 'Baiduspider', category: 'search', pattern: /Baiduspider/i },\n { name: 'Applebot', category: 'search', pattern: /Applebot/i },\n]\n\nexport interface DetectCrawlerOptions {\n /** Override the signature table (e.g. to add private/first-party crawlers). */\n signatures?: CrawlerSignature[]\n /** Skip crawler detection entirely. */\n disable?: boolean\n /** Confidence reported on a UA match. Default 0.9 (UA is spoofable). */\n confidence?: number\n}\n\n/**\n * Identify known AI/search crawlers by their User-Agent token. Returns `null`\n * when no signature matches or when there is no `navigator` (server-side).\n */\nexport const detectCrawler = (options: DetectCrawlerOptions = {}): AgentIdentity | null => {\n const { signatures = CRAWLER_SIGNATURES, disable = false, confidence = 0.9 } = options\n if (disable) return null\n if (typeof navigator === 'undefined') return null\n\n const ua = navigator.userAgent ?? ''\n if (!ua) return null\n\n for (const sig of signatures) {\n if (sig.pattern.test(ua)) {\n return {\n class: 'crawler',\n trust: 'detected',\n confidence,\n vendor: sig.name,\n userAgent: ua,\n detectionVersion: SDK_VERSION,\n signals: { matched: sig.name, category: sig.category, ua },\n }\n }\n }\n\n return null\n}\n","import type { AgentIdentity } from '@agentronics/protocol'\nimport { SDK_VERSION } from \"../version.js\"\n\ninterface SignalResult {\n hit: boolean\n weight: number\n detail?: string\n}\n\nconst HEADLESS_UA_PATTERNS = [/HeadlessChrome/i, /Headless/i, /PhantomJS/i, /SlimerJS/i]\n\nconst checkWebdriver = (): SignalResult => {\n const value =\n typeof navigator !== 'undefined' && (navigator as Navigator & { webdriver?: boolean }).webdriver\n return { hit: value === true, weight: 0.6, detail: 'navigator.webdriver === true' }\n}\n\nconst checkChromedriver = (): SignalResult => {\n if (typeof window === 'undefined') return { hit: false, weight: 0.5 }\n const keys = Object.keys(window).filter((k) => k.startsWith('cdc_'))\n return { hit: keys.length > 0, weight: 0.5, detail: `window.${keys[0] ?? 'cdc_*'}` }\n}\n\nconst checkPlugins = (): SignalResult => {\n if (typeof navigator === 'undefined' || !navigator.plugins) return { hit: false, weight: 0.2 }\n const desktop = /Win|Mac|Linux/.test(navigator.userAgent ?? '')\n const empty = navigator.plugins.length === 0\n return { hit: desktop && empty, weight: 0.2, detail: 'desktop UA with no plugins' }\n}\n\nconst checkHeadlessUa = (): SignalResult => {\n if (typeof navigator === 'undefined') return { hit: false, weight: 0.7 }\n const ua = navigator.userAgent ?? ''\n const hit = HEADLESS_UA_PATTERNS.some((re) => re.test(ua))\n return hit ? { hit, weight: 0.7, detail: `headless UA: ${ua}` } : { hit, weight: 0.7 }\n}\n\nconst checkLanguages = (): SignalResult => {\n if (typeof navigator === 'undefined') return { hit: false, weight: 0.15 }\n const langs = navigator.languages\n return {\n hit: !langs || langs.length === 0,\n weight: 0.15,\n detail: 'navigator.languages empty',\n }\n}\n\nconst checkPermissions = (): SignalResult => {\n if (typeof navigator === 'undefined') return { hit: false, weight: 0.1 }\n const hasChrome = 'chrome' in window\n const ua = navigator.userAgent ?? ''\n const looksChrome = /Chrome\\//.test(ua) && !/Edg\\//.test(ua)\n return {\n hit: looksChrome && !hasChrome,\n weight: 0.2,\n detail: 'Chrome UA without window.chrome',\n }\n}\n\nconst SIGNALS = {\n webdriver: checkWebdriver,\n chromedriver: checkChromedriver,\n headlessUa: checkHeadlessUa,\n languages: checkLanguages,\n permissions: checkPermissions,\n plugins: checkPlugins,\n} as const\n\nexport type DomSignalName = keyof typeof SIGNALS\n\nexport interface DetectDomOptions {\n /** Floor below which we report no DOM agent. Defaults to 0.4. */\n threshold?: number\n}\n\nexport const detectDom = (options: DetectDomOptions = {}): AgentIdentity | null => {\n const { threshold = 0.4 } = options\n\n const signals: Record<string, unknown> = {}\n let totalWeight = 0\n let hitWeight = 0\n\n for (const [name, check] of Object.entries(SIGNALS)) {\n const result = check()\n totalWeight += result.weight\n signals[name] = { hit: result.hit, weight: result.weight, detail: result.detail }\n if (result.hit) hitWeight += result.weight\n }\n\n const confidence = totalWeight === 0 ? 0 : hitWeight / totalWeight\n if (confidence < threshold) return null\n\n return {\n class: 'dom',\n trust: 'detected',\n confidence,\n vendor: null,\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals,\n }\n}\n","import type { AgentIdentity } from '@agentronics/protocol'\nimport { detectDom } from '../dom.js'\nimport { detectCrawler } from '../crawler.js'\nimport { detectWebMcp } from '../webmcp.js'\n\nexport type DetectorStatus = 'stable' | 'beta' | 'research'\n\nexport interface Detector {\n id: string\n status: DetectorStatus\n detect(): AgentIdentity | null | Promise<AgentIdentity | null>\n}\n\nexport const bundledDetectors = (): Detector[] => [\n {\n id: 'webmcp.model-context',\n status: 'stable',\n detect: () => detectWebMcp({ pollMs: 0 }),\n },\n {\n id: 'crawler.user-agent',\n status: 'beta',\n detect: () => detectCrawler(),\n },\n {\n id: 'dom.automation-heuristics',\n status: 'beta',\n detect: () => detectDom(),\n },\n]\n\nexport const createDetectorRegistry = (initial: Detector[] = bundledDetectors()) => {\n const detectors = new Map(initial.map((detector) => [detector.id, detector]))\n\n return {\n register(detector: Detector) {\n detectors.set(detector.id, detector)\n },\n list(status?: DetectorStatus): Detector[] {\n const all = [...detectors.values()]\n return status ? all.filter((detector) => detector.status === status) : all\n },\n async detectAll(includeResearch = false): Promise<AgentIdentity | null> {\n for (const detector of detectors.values()) {\n if (detector.status === 'research' && !includeResearch) continue\n const identity = await detector.detect()\n if (identity) return identity\n }\n return null\n },\n }\n}\n\nexport type DetectorRegistry = ReturnType<typeof createDetectorRegistry>\n","import { AgentClass, type AgentIdentity, type TrustLevel } from '@agentronics/protocol'\nimport { SDK_VERSION } from \"../version.js\"\n\nexport interface DeclareAgentInput {\n class: 'webmcp' | 'dom' | 'screenshot' | 'crawler'\n vendor: string\n /** Optional bearer token returned by the customer's verification endpoint. */\n verificationToken?: string\n}\n\nexport const declareAgent = (input: DeclareAgentInput): AgentIdentity => {\n const parsedClass = AgentClass.parse(input.class)\n const trust: TrustLevel = input.verificationToken ? 'verified' : 'declared'\n\n return {\n class: parsedClass,\n trust,\n confidence: 1,\n vendor: input.vendor,\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n declared: true,\n hasVerificationToken: Boolean(input.verificationToken),\n },\n }\n}\n","export interface DetectorSignature {\n id: string\n status: 'stable' | 'beta' | 'research'\n version: string\n signals: Record<string, unknown>\n}\n\nexport interface SignatureLoaderOptions {\n gatewayUrl: string\n fetcher?: typeof fetch\n}\n\nexport const createSignatureLoader = ({ gatewayUrl, fetcher = fetch }: SignatureLoaderOptions) => {\n let etag: string | null = null\n let signatures: DetectorSignature[] = []\n\n return {\n snapshot(): DetectorSignature[] {\n return [...signatures]\n },\n async sync(): Promise<DetectorSignature[]> {\n const response = await fetcher(`${gatewayUrl.replace(/\\/$/, '')}/v1/detector-signatures`, {\n headers: etag ? { 'if-none-match': etag } : {},\n })\n if (response.status === 304) return this.snapshot()\n if (!response.ok) throw new Error(`Detector signature sync failed with status ${response.status}.`)\n\n const body = (await response.json()) as { signatures?: DetectorSignature[] }\n signatures = body.signatures ?? []\n etag = response.headers.get('etag')\n return this.snapshot()\n },\n }\n}\n\nexport type SignatureLoader = ReturnType<typeof createSignatureLoader>\n","import type { AgentIdentity } from '@agentronics/protocol'\nimport { detectWebMcp, type DetectWebMcpOptions } from './webmcp.js'\nimport { detectCrawler, type DetectCrawlerOptions } from './crawler.js'\nimport { detectDom, type DetectDomOptions } from './dom.js'\nimport { createDetectorRegistry, type Detector } from './detectors/registry.js'\n\nexport interface DetectAgentOptions {\n webmcp?: DetectWebMcpOptions | false\n crawler?: DetectCrawlerOptions | false\n dom?: DetectDomOptions | false\n customDetectors?: Detector[]\n experimental?: boolean\n}\n\n/**\n * Run the full detection pipeline. WebMCP wins if present (exact match), then a\n * known-crawler User-Agent match, then DOM automation heuristics. Returns `null`\n * if no agent class fires above its threshold — caller should treat as \"human or\n * undetectable agent.\"\n */\nexport const detectAgent = async (\n options: DetectAgentOptions = {}\n): Promise<AgentIdentity | null> => {\n if (options.customDetectors?.length) {\n const custom = await createDetectorRegistry(options.customDetectors).detectAll(Boolean(options.experimental))\n if (custom) return custom\n }\n if (options.webmcp !== false) {\n const webmcp = await detectWebMcp(options.webmcp ?? {})\n if (webmcp) return webmcp\n }\n if (options.crawler !== false) {\n const crawler = detectCrawler(options.crawler ?? {})\n if (crawler) return crawler\n }\n if (options.dom !== false) {\n const dom = detectDom(options.dom ?? {})\n if (dom) return dom\n }\n return null\n}\n\nexport { detectWebMcp } from './webmcp.js'\nexport type { DetectWebMcpOptions } from './webmcp.js'\nexport { detectDom } from './dom.js'\nexport type { DetectDomOptions, DomSignalName } from './dom.js'\nexport { detectCrawler, CRAWLER_SIGNATURES } from './crawler.js'\nexport type { DetectCrawlerOptions, CrawlerSignature, CrawlerCategory } from './crawler.js'\nexport { declareAgent } from './declare.js'\nexport type { DeclareAgentInput } from './declare.js'\nexport { createDetectorRegistry, bundledDetectors } from './detectors/registry.js'\nexport type { Detector, DetectorRegistry, DetectorStatus } from './detectors/registry.js'\nexport { createSignatureLoader } from './detectors/signatureLoader.js'\nexport type { DetectorSignature, SignatureLoader } from './detectors/signatureLoader.js'\n","import {\n AgentronicsError,\n IdentityClaim,\n isHigherTrust,\n type AgentIdentity,\n type IdentityClaim as IdentityClaimType,\n} from '@agentronics/protocol'\nimport { SDK_VERSION } from '../version.js'\n\nexport interface PresentIdentityOptions extends IdentityClaimType {\n /**\n * If false, accept the claim as `declared` (no remote verification).\n * If true, the claim is staged for the gateway to verify; trust is `declared` until then.\n */\n verifyRemotely?: boolean\n}\n\nexport interface PresentedIdentity {\n identity: AgentIdentity\n claim: IdentityClaimType\n}\n\nconst buildIdentity = (claim: IdentityClaimType): AgentIdentity => ({\n class: claim.class,\n trust: 'declared',\n confidence: 1,\n vendor: claim.vendor,\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n declared: true,\n hasToken: true,\n tokenExpiresAt: claim.expiresAt ?? null,\n },\n})\n\nexport const createIdentityStore = () => {\n let presented: PresentedIdentity | null = null\n\n return {\n present(input: PresentIdentityOptions): PresentedIdentity {\n const parsed = IdentityClaim.safeParse(input)\n if (!parsed.success) {\n throw new AgentronicsError(\n 'invalid_api_key',\n `Invalid identity claim: ${parsed.error.issues[0]?.message ?? 'unknown'}`\n )\n }\n const next: PresentedIdentity = {\n claim: parsed.data,\n identity: buildIdentity(parsed.data),\n }\n presented = next\n return next\n },\n\n clear() {\n presented = null\n },\n\n /** Return the presented identity if it outranks the supplied detection. */\n preferOver(detected: AgentIdentity | null): AgentIdentity | null {\n if (!presented) return detected\n if (!detected) return presented.identity\n return isHigherTrust(presented.identity.trust, detected.trust)\n ? presented.identity\n : detected\n },\n\n snapshot(): PresentedIdentity | null {\n return presented\n },\n }\n}\n\nexport type IdentityStore = ReturnType<typeof createIdentityStore>\n","import { TRUST_RANK, type TrustLevel } from '@agentronics/protocol'\n\nexport interface TrustDerivationInput {\n detected?: boolean\n declared?: boolean\n verified?: boolean\n linked?: boolean\n}\n\nexport const deriveTrustLevel = ({\n detected,\n declared,\n verified,\n linked,\n}: TrustDerivationInput): TrustLevel => {\n if (linked) return 'linked'\n if (verified) return 'verified'\n if (declared) return 'declared'\n if (detected) return 'detected'\n return 'detected'\n}\n\nexport const highestTrust = <T extends { trust: TrustLevel }>(identities: T[]): T | null => {\n let best: T | null = null\n for (const identity of identities) {\n if (!best || TRUST_RANK[identity.trust] > TRUST_RANK[best.trust]) best = identity\n }\n return best\n}\n","import type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from \"../../version.js\"\n\nexport const bearer = (): AuthMethod => ({\n name: 'bearer',\n async authenticate(input, context) {\n if (!input.bearerToken) return null\n const verified = await context.verifyToken?.('bearer', input.bearerToken)\n return {\n class: input.classHint ?? 'dom',\n trust: verified?.trust ?? 'verified',\n confidence: 1,\n vendor: verified?.vendor ?? input.vendorHint ?? 'bearer',\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: { bearer: true, verifiedRemotely: Boolean(verified) },\n }\n },\n})\n","import type { AgentIdentity } from '@agentronics/protocol'\nimport type { AuthMethod } from '../engine.js'\n\nexport const detectionAsAuth = (): AuthMethod => ({\n name: 'detection',\n async authenticate(input) {\n return input.detected ?? null\n },\n})\n\nexport const cloneDetectedIdentity = (identity: AgentIdentity): AgentIdentity => ({\n ...identity,\n signals: { ...identity.signals },\n})\n","import type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from \"../../version.js\"\n\nexport const extensionToken = (): AuthMethod => ({\n name: 'extensionToken',\n async authenticate(input, context) {\n if (!input.extensionToken) return null\n const verified = await context.verifyToken?.('extensionToken', input.extensionToken)\n return {\n class: 'dom',\n trust: verified?.trust ?? 'verified',\n confidence: 1,\n vendor: verified?.vendor ?? input.vendorHint ?? 'browser-extension',\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: { extensionToken: true, verifiedRemotely: Boolean(verified) },\n }\n },\n})\n","import type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from \"../../version.js\"\n\n// mTLS via x-forwarded-client-cert (XFCC). Browser builds never trigger\n// this — JavaScript cannot inspect its own TLS state. Node companions\n// forward the XFCC header value verbatim and the gateway parses + chain-\n// validates against the site's registered roots (D2 policy applies for\n// multi-entry headers). If the XFCC URI SAN carries a `spiffe://` value\n// it is lifted into `signals.spiffeId` so dashboard pivots can correlate\n// X.509-SVID traffic with JWT-SVID traffic from the same workload.\nexport const mtls = (): AuthMethod => ({\n name: 'mtls',\n async authenticate(input, context) {\n if (!input.xfccHeader) return null\n const verified = await context.verifyToken?.('mtls', input.xfccHeader)\n return {\n class: input.classHint ?? 'webmcp',\n trust: verified?.trust ?? 'verified',\n confidence: 1,\n vendor: verified?.vendor ?? input.vendorHint ?? 'mtls',\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n mtls: true,\n subject: verified?.subject ?? null,\n verifiedRemotely: Boolean(verified),\n ...(verified?.signals ?? {}),\n },\n }\n },\n})\n","import type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from \"../../version.js\"\n\nexport const oauth2 = (): AuthMethod => ({\n name: 'oauth2',\n async authenticate(input, context) {\n if (!input.oauth2AccessToken) return null\n const verified = await context.verifyToken?.('oauth2', input.oauth2AccessToken)\n return {\n class: input.classHint ?? 'webmcp',\n trust: input.oauth2Subject ? 'linked' : verified?.trust ?? 'verified',\n confidence: 1,\n vendor: verified?.vendor ?? input.vendorHint ?? 'oauth2',\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n oauth2: true,\n subject: input.oauth2Subject ?? null,\n verifiedRemotely: Boolean(verified),\n },\n }\n },\n})\n","import {\n IdentityClaim,\n type AgentIdentity,\n type IdentityClaim as IdentityClaimRecord,\n} from '@agentronics/protocol'\nimport type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from '../../version.js'\n\nconst identityFromClaim = (claim: IdentityClaimRecord): AgentIdentity => ({\n class: claim.class,\n trust: 'declared',\n confidence: 1,\n vendor: claim.vendor,\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n declared: true,\n hasToken: true,\n tokenExpiresAt: claim.expiresAt ?? null,\n },\n})\n\nexport const selfDeclaration = (): AuthMethod => ({\n name: 'selfDeclaration',\n async authenticate(input) {\n if (!input.declaration) return null\n return identityFromClaim(IdentityClaim.parse(input.declaration))\n },\n})\n","import type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from \"../../version.js\"\n\nexport const sessionLink = (): AuthMethod => ({\n name: 'sessionLink',\n async authenticate(input, context) {\n if (!input.sessionLinkToken) return null\n const verified = await context.verifyToken?.('sessionLink', input.sessionLinkToken)\n return {\n class: input.classHint ?? 'screenshot',\n trust: input.linkedUserId ? 'linked' : verified?.trust ?? 'verified',\n confidence: 1,\n vendor: verified?.vendor ?? input.vendorHint ?? 'session-link',\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n sessionLink: true,\n linkedUserId: input.linkedUserId ?? null,\n verifiedRemotely: Boolean(verified),\n },\n }\n },\n})\n","import type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from \"../../version.js\"\n\n// Workforce SSO via OIDC ID tokens. Browser/Node SDKs forward the ID\n// token to the gateway's POST /v1/verify/sso route, which validates the\n// JWT signature + claims against the customer-configured IdP discovery\n// document. SAML is intentionally out of scope for v1.\nexport const sso = (): AuthMethod => ({\n name: 'sso',\n async authenticate(input, context) {\n if (!input.ssoIdToken) return null\n const verified = await context.verifyToken?.('sso', input.ssoIdToken)\n return {\n class: input.classHint ?? 'dom',\n trust: verified?.trust ?? 'verified',\n confidence: 1,\n vendor: verified?.vendor ?? input.vendorHint ?? 'sso',\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n sso: true,\n subject: verified?.subject ?? null,\n verifiedRemotely: Boolean(verified),\n ...(verified?.signals ?? {}),\n },\n }\n },\n})\n","import type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from \"../../version.js\"\n\n// SPIFFE JWT-SVID verification. The gateway validates against the site's\n// configured SPIFFE Bundle (JWKS with `use: \"jwt-svid\"`) and returns the\n// SPIFFE ID as `verified.subject`. When the trust domain matches one of\n// the customer-configured Google trust domains (D1), the verifier sets\n// `vendor: 'google'` so we surface `googleAgent: true` and the engine\n// emits `protocol: 'google-agent'` on the trace instead of 'spiffe'.\nexport const spiffe = (): AuthMethod => ({\n name: 'spiffe',\n async authenticate(input, context) {\n if (!input.spiffeJwt) return null\n const verified = await context.verifyToken?.('spiffe', input.spiffeJwt)\n const isGoogleFlavor = verified?.vendor === 'google'\n return {\n class: input.classHint ?? 'webmcp',\n trust: verified?.trust ?? 'verified',\n confidence: 1,\n vendor: verified?.vendor ?? input.vendorHint ?? 'spiffe',\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n spiffe: true,\n spiffeId: verified?.subject ?? null,\n subject: verified?.subject ?? null,\n verifiedRemotely: Boolean(verified),\n ...(isGoogleFlavor ? { googleAgent: true } : {}),\n ...(verified?.signals ?? {}),\n },\n }\n },\n})\n","import { AgentClass } from '@agentronics/protocol'\nimport { SDK_VERSION } from \"../../version.js\"\nimport type { AuthMethod } from '../engine.js'\n\nexport const xAgentHeader = (): AuthMethod => ({\n name: 'xAgentHeader',\n async authenticate(input) {\n if (!input.xAgentHeader) return null\n const [vendor = 'x-agent', rawClass = 'dom', proof] = input.xAgentHeader.split(';')\n const parsedClass = AgentClass.safeParse(rawClass)\n\n return {\n class: parsedClass.success ? parsedClass.data : 'dom',\n trust: proof ? 'verified' : 'declared',\n confidence: proof ? 1 : 0.8,\n vendor,\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: { xAgentHeader: true, hasProof: Boolean(proof) },\n }\n },\n})\n","import type {\n AgentClass,\n AgentIdentity,\n AuthProtocol,\n IdentityClaim,\n VerificationResult,\n} from '@agentronics/protocol'\nimport type { TraceInput } from '../observability/tracer.js'\nimport { highestTrust } from './trustLevel.js'\nimport { bearer } from './methods/bearer.js'\nimport { detectionAsAuth } from './methods/detectionAsAuth.js'\nimport { extensionToken } from './methods/extensionToken.js'\nimport { mtls } from './methods/mtls.js'\nimport { oauth2 } from './methods/oauth2.js'\nimport { selfDeclaration } from './methods/selfDeclaration.js'\nimport { sessionLink } from './methods/sessionLink.js'\nimport { sso } from './methods/sso.js'\nimport { spiffe } from './methods/spiffe.js'\nimport { xAgentHeader } from './methods/xAgentHeader.js'\n\nexport type AuthMethodName =\n | 'detection'\n | 'selfDeclaration'\n | 'bearer'\n | 'xAgentHeader'\n | 'extensionToken'\n | 'sessionLink'\n | 'oauth2'\n | 'sso'\n | 'spiffe'\n | 'mtls'\n\nexport interface AuthInput {\n detected?: AgentIdentity | null\n declaration?: IdentityClaim\n bearerToken?: string\n xAgentHeader?: string\n extensionToken?: string\n sessionLinkToken?: string\n linkedUserId?: string\n oauth2AccessToken?: string\n oauth2Subject?: string\n ssoIdToken?: string\n spiffeJwt?: string\n xfccHeader?: string\n vendorHint?: string\n classHint?: AgentClass\n}\n\nexport interface AuthContext {\n verifyToken?: (\n method: Exclude<AuthMethodName, 'detection' | 'selfDeclaration' | 'xAgentHeader'>,\n token: string\n ) => Promise<VerificationResult | null>\n}\n\nexport interface AuthMethod {\n name: AuthMethodName\n authenticate(input: AuthInput, context: AuthContext): Promise<AgentIdentity | null>\n}\n\nexport interface AuthEngineOptions {\n methods?: AuthMethod[]\n context?: AuthContext\n onTrace?: (input: TraceInput) => void\n}\n\nexport const defaultAuthMethods = (): AuthMethod[] => [\n detectionAsAuth(),\n selfDeclaration(),\n bearer(),\n xAgentHeader(),\n extensionToken(),\n sessionLink(),\n oauth2(),\n sso(),\n spiffe(),\n mtls(),\n]\n\n// Method-name → dashboard-facing AuthProtocol label. The spiffe method\n// can override its emitted label to 'google-agent' by setting\n// `signals.googleAgent = true` (see methods/spiffe.ts) — that branch is\n// handled in resolveTraceProtocol() below.\nconst METHOD_TO_PROTOCOL: Record<AuthMethodName, AuthProtocol> = {\n detection: 'detection',\n selfDeclaration: 'declaration',\n bearer: 'bearer',\n xAgentHeader: 'x-agent-header',\n extensionToken: 'extension',\n sessionLink: 'session-link',\n oauth2: 'oauth2',\n sso: 'sso',\n spiffe: 'spiffe',\n mtls: 'mtls',\n}\n\nconst resolveTraceProtocol = (\n methodName: AuthMethodName,\n identity: AgentIdentity\n): AuthProtocol => {\n if (methodName === 'spiffe' && identity.signals?.googleAgent === true) {\n return 'google-agent'\n }\n return METHOD_TO_PROTOCOL[methodName]\n}\n\nexport const createAuthEngine = ({\n methods = defaultAuthMethods(),\n context = {},\n onTrace,\n}: AuthEngineOptions = {}) => ({\n async authenticate(input: AuthInput): Promise<AgentIdentity | null> {\n const identities: Array<{ method: AuthMethodName; identity: AgentIdentity }> = []\n const methodResults: Record<string, boolean> = {}\n\n for (const method of methods) {\n const identity = await method.authenticate(input, context)\n methodResults[method.name] = Boolean(identity)\n if (identity) identities.push({ method: method.name, identity })\n }\n\n const winner = highestTrust(identities.map((entry) => entry.identity))\n const winnerEntry = winner\n ? identities.find((entry) => entry.identity === winner)\n : undefined\n const protocol = winnerEntry\n ? resolveTraceProtocol(winnerEntry.method, winnerEntry.identity)\n : undefined\n const subject =\n typeof winner?.signals?.subject === 'string' ? winner.signals.subject : undefined\n\n const trace: TraceInput = {\n type: winner ? 'auth.identity_presented' : 'sdk.error',\n agent: winner,\n outcome: winner ? 'success' : 'error',\n metadata: {\n methods: methodResults,\n ...(protocol ? { protocol } : {}),\n ...(subject ? { subject } : {}),\n },\n }\n if (!winner) trace.error = 'No auth method produced an identity.'\n onTrace?.(trace)\n return winner\n },\n\n methods(): AuthMethodName[] {\n return methods.map((method) => method.name)\n },\n})\n\nexport type AuthEngine = ReturnType<typeof createAuthEngine>\n","import type { AgentIdentity } from '@agentronics/protocol'\n\nexport interface AgentContextSnapshot {\n identity: AgentIdentity | null\n source: 'detect' | 'declare' | 'authenticate' | 'cleared' | 'initial'\n updatedAt: string | null\n}\n\nexport type AgentContextListener = (snapshot: AgentContextSnapshot) => void\n\nconst INITIAL: AgentContextSnapshot = {\n identity: null,\n source: 'initial',\n updatedAt: null,\n}\n\nexport const createAgentContextStore = () => {\n let state: AgentContextSnapshot = INITIAL\n const listeners = new Set<AgentContextListener>()\n\n const notify = () => {\n if (listeners.size === 0) return\n listeners.forEach((listener) => listener(state))\n }\n\n return {\n snapshot(): AgentContextSnapshot {\n return state\n },\n set(identity: AgentIdentity | null, source: AgentContextSnapshot['source']) {\n state = { identity, source, updatedAt: new Date().toISOString() }\n notify()\n },\n subscribe(listener: AgentContextListener): () => void {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n }\n}\n\nexport type AgentContextStore = ReturnType<typeof createAgentContextStore>\n","export interface RateLimitRule {\n max: number\n windowSeconds: number\n}\n\nexport interface RateLimitResult {\n allowed: boolean\n remaining: number\n resetAt: number\n}\n\ninterface Bucket {\n count: number\n resetAt: number\n}\n\nexport interface RateLimiterStorage {\n read(key: string): string | null\n write(key: string, value: string): void\n}\n\nconst memoryStorage = (): RateLimiterStorage => {\n const map = new Map<string, string>()\n return {\n read: (key) => map.get(key) ?? null,\n write: (key, value) => {\n map.set(key, value)\n },\n }\n}\n\nconst browserStorage = (): RateLimiterStorage => {\n if (typeof window === 'undefined' || !window.localStorage) return memoryStorage()\n return {\n read: (key) => {\n try {\n return window.localStorage.getItem(key)\n } catch {\n return null\n }\n },\n write: (key, value) => {\n try {\n window.localStorage.setItem(key, value)\n } catch {\n // Quota/storage failures should not crash policy evaluation.\n }\n },\n }\n}\n\nconst decode = (raw: string | null): Bucket | null => {\n if (!raw) return null\n try {\n const parsed = JSON.parse(raw) as Bucket\n if (\n typeof parsed === 'object' &&\n parsed !== null &&\n Number.isFinite(parsed.count) &&\n Number.isFinite(parsed.resetAt)\n ) {\n return parsed\n }\n } catch {\n return null\n }\n return null\n}\n\nexport const createRateLimiter = (storage: RateLimiterStorage = browserStorage()) => ({\n consume(key: string, rule: RateLimitRule, now = Date.now()): RateLimitResult {\n const storageKey = `agtx:rate:${key}`\n const existing = decode(storage.read(storageKey))\n const resetAt =\n existing && existing.resetAt > now ? existing.resetAt : now + rule.windowSeconds * 1000\n const count = existing && existing.resetAt > now ? existing.count + 1 : 1\n storage.write(storageKey, JSON.stringify({ count, resetAt }))\n\n return {\n allowed: count <= rule.max,\n remaining: Math.max(0, rule.max - count),\n resetAt,\n }\n },\n})\n\nexport type RateLimiter = ReturnType<typeof createRateLimiter>\n","import {\n PolicyRule,\n TRUST_RANK,\n type AgentIdentity,\n type PolicyDecision,\n type PolicyEvaluation,\n type PolicyRule as PolicyRuleType,\n} from '@agentronics/protocol'\nimport { createRateLimiter, type RateLimiter } from './rateLimiter.js'\n\nconst matchTool = (pattern: string, tool: string): boolean => {\n if (pattern === '*' || pattern === tool) return true\n if (!pattern.includes('*')) return false\n const regex = new RegExp('^' + pattern.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&').replace(/\\*/g, '.*') + '$')\n return regex.test(tool)\n}\n\nconst meetsTrust = (identity: AgentIdentity | null, rule: PolicyRuleType): boolean => {\n const have = identity ? TRUST_RANK[identity.trust] : -1\n const need = TRUST_RANK[rule.minTrust]\n return have >= need\n}\n\nconst meetsClass = (identity: AgentIdentity | null, rule: PolicyRuleType): boolean => {\n if (rule.allowedClasses.length === 0) return true\n if (!identity) return false\n return rule.allowedClasses.includes(identity.class)\n}\n\nconst DEFAULT_DECISION: PolicyDecision = 'review'\n\nexport interface EvaluateInput {\n tool: string\n identity: AgentIdentity | null\n}\n\nconst rateLimitKey = (tool: string, identity: AgentIdentity | null): string => {\n const classPart = identity?.class ?? 'unknown'\n const vendorPart = identity?.vendor ?? 'unknown'\n const trustPart = identity?.trust ?? 'none'\n return `${tool}:${classPart}:${vendorPart}:${trustPart}`\n}\n\nexport interface PolicyEngineOptions {\n rateLimiter?: RateLimiter\n}\n\nexport const createPolicyEngine = (\n initial: PolicyRuleType[] = [],\n options: PolicyEngineOptions = {}\n) => {\n let rules: PolicyRuleType[] = initial.map((rule) => PolicyRule.parse(rule))\n const rateLimiter = options.rateLimiter ?? createRateLimiter()\n\n return {\n set(next: PolicyRuleType[]) {\n rules = next.map((rule) => PolicyRule.parse(rule))\n },\n\n list(): PolicyRuleType[] {\n return [...rules]\n },\n\n evaluate({ tool, identity }: EvaluateInput): PolicyEvaluation {\n for (const rule of rules) {\n if (!matchTool(rule.tool, tool)) continue\n if (!meetsTrust(identity, rule)) {\n return {\n decision: 'deny',\n ruleId: rule.id,\n reason: `Rule \"${rule.id}\" requires trust >= ${rule.minTrust}.`,\n }\n }\n if (!meetsClass(identity, rule)) {\n return {\n decision: 'deny',\n ruleId: rule.id,\n reason: `Rule \"${rule.id}\" restricts to classes: ${rule.allowedClasses.join(', ')}.`,\n }\n }\n if (rule.rateLimit) {\n const rate = rateLimiter.consume(rateLimitKey(tool, identity), rule.rateLimit)\n if (!rate.allowed) {\n return {\n decision: 'deny',\n ruleId: rule.id,\n reason: `Rule \"${rule.id}\" rate limit exceeded. Resets at ${new Date(rate.resetAt).toISOString()}.`,\n }\n }\n }\n return {\n decision: rule.decision,\n ruleId: rule.id,\n reason: `Matched rule \"${rule.id}\".`,\n }\n }\n return {\n decision: DEFAULT_DECISION,\n ruleId: null,\n reason: `No rule matched tool \"${tool}\". Falling back to \"${DEFAULT_DECISION}\".`,\n }\n },\n }\n}\n\nexport type PolicyEngine = ReturnType<typeof createPolicyEngine>\n","import { PolicyRule, type PolicyRule as PolicyRuleRecord } from '@agentronics/protocol'\n\nexport interface PolicyCacheOptions {\n gatewayUrl: string\n siteId: string\n publishableKey: string\n fetcher?: typeof fetch\n}\n\nexport interface PolicyCacheSnapshot {\n policies: PolicyRuleRecord[]\n etag: string | null\n}\n\nexport const createPolicyCache = ({\n gatewayUrl,\n siteId,\n publishableKey,\n fetcher = fetch,\n}: PolicyCacheOptions) => {\n let snapshot: PolicyCacheSnapshot = { policies: [], etag: null }\n\n return {\n snapshot(): PolicyCacheSnapshot {\n return {\n policies: [...snapshot.policies],\n etag: snapshot.etag,\n }\n },\n\n async sync(): Promise<PolicyCacheSnapshot> {\n const response = await fetcher(\n `${gatewayUrl.replace(/\\/$/, '')}/v1/sites/${encodeURIComponent(siteId)}/policies`,\n {\n headers: {\n authorization: `Bearer ${publishableKey}`,\n ...(snapshot.etag ? { 'if-none-match': snapshot.etag } : {}),\n },\n }\n )\n if (response.status === 304) return this.snapshot()\n if (!response.ok) throw new Error(`Policy sync failed with status ${response.status}.`)\n\n const body = (await response.json()) as { policies?: unknown }\n const policies = PolicyRule.array().parse(body.policies ?? [])\n snapshot = {\n policies,\n etag: response.headers.get('etag'),\n }\n return this.snapshot()\n },\n }\n}\n\nexport type PolicyCache = ReturnType<typeof createPolicyCache>\n","export interface DenyOverlayOptions {\n message?: string\n durationMs?: number\n documentRef?: Document\n}\n\nexport const showDenyOverlay = ({\n message = 'Agent action blocked by site policy.',\n durationMs = 2400,\n documentRef = typeof document === 'undefined' ? undefined : document,\n}: DenyOverlayOptions = {}) => {\n if (!documentRef?.body) return null\n\n const node = documentRef.createElement('div')\n node.setAttribute('role', 'status')\n node.setAttribute('data-agentronics-deny-overlay', 'true')\n node.textContent = message\n Object.assign(node.style, {\n position: 'fixed',\n zIndex: '2147483647',\n left: '50%',\n bottom: '24px',\n transform: 'translateX(-50%)',\n maxWidth: 'min(520px, calc(100vw - 32px))',\n padding: '12px 16px',\n borderRadius: '8px',\n background: '#07091A',\n color: '#F4F4F5',\n border: '1px solid #6366F1',\n boxShadow: '0 20px 48px -16px rgba(7,9,26,0.55)',\n font: \"13px/1.45 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace\",\n })\n\n documentRef.body.appendChild(node)\n window.setTimeout(() => node.remove(), durationMs)\n return node\n}\n","import type { AgentIdentity } from '@agentronics/protocol'\nimport { showDenyOverlay } from './overlay.js'\nimport type { PolicyEngine } from './engine.js'\n\nexport interface DomEnforcerOptions {\n policyEngine: PolicyEngine\n getIdentity: () => AgentIdentity | null | Promise<AgentIdentity | null>\n documentRef?: Document\n selector?: string\n}\n\nexport const installDomEnforcer = ({\n policyEngine,\n getIdentity,\n documentRef = typeof document === 'undefined' ? undefined : document,\n selector = '[data-agentronics-tool]',\n}: DomEnforcerOptions) => {\n if (!documentRef) return { uninstall: () => undefined }\n\n const handler = (event: Event) => {\n const target = event.target instanceof Element ? event.target.closest(selector) : null\n if (!(target instanceof HTMLElement)) return\n const tool = target.dataset.agentronicsTool\n if (!tool) return\n\n void Promise.resolve(getIdentity()).then((identity) => {\n const evaluation = policyEngine.evaluate({ tool, identity })\n if (evaluation.decision !== 'deny') return\n event.preventDefault()\n event.stopPropagation()\n showDenyOverlay({ message: evaluation.reason, documentRef })\n })\n }\n\n documentRef.addEventListener('click', handler, true)\n return {\n uninstall: () => documentRef.removeEventListener('click', handler, true),\n }\n}\n","import type { MemoryScope } from '@agentronics/protocol'\n\nexport interface ScopeBackend {\n read(key: string): string | null\n write(key: string, value: string): void\n remove(key: string): void\n keys(): string[]\n}\n\nconst inMemoryBackend = (): ScopeBackend => {\n const store = new Map<string, string>()\n return {\n read: (key) => store.get(key) ?? null,\n write: (key, value) => {\n store.set(key, value)\n },\n remove: (key) => {\n store.delete(key)\n },\n keys: () => [...store.keys()],\n }\n}\n\nconst webStorageBackend = (storage: Storage, prefix: string): ScopeBackend => ({\n read: (key) => {\n try {\n return storage.getItem(prefix + key)\n } catch {\n return null\n }\n },\n write: (key, value) => {\n try {\n storage.setItem(prefix + key, value)\n } catch {\n // quota exceeded or storage disabled — fail silently, the in-memory fallback is acceptable\n }\n },\n remove: (key) => {\n try {\n storage.removeItem(prefix + key)\n } catch {\n // ignore\n }\n },\n keys: () => {\n const out: string[] = []\n try {\n for (let i = 0; i < storage.length; i++) {\n const k = storage.key(i)\n if (k && k.startsWith(prefix)) out.push(k.slice(prefix.length))\n }\n } catch {\n // ignore\n }\n return out\n },\n})\n\nconst PREFIX = 'agtx:'\n\nexport const createBackends = (): Record<MemoryScope, ScopeBackend> => {\n const hasWindow = typeof window !== 'undefined'\n const session =\n hasWindow && typeof window.sessionStorage !== 'undefined'\n ? webStorageBackend(window.sessionStorage, PREFIX + 'session:')\n : inMemoryBackend()\n const user =\n hasWindow && typeof window.localStorage !== 'undefined'\n ? webStorageBackend(window.localStorage, PREFIX + 'user:')\n : inMemoryBackend()\n return {\n session,\n user,\n org: inMemoryBackend(),\n }\n}\n","import { MemoryEntry, type MemoryScope } from '@agentronics/protocol'\nimport type { TraceInput } from '../observability/tracer.js'\nimport { createBackends, type ScopeBackend } from './storage.js'\n\ninterface StoredRecord {\n value: unknown\n expiresAt: number | null\n updatedAt: string\n}\n\nconst isExpired = (record: StoredRecord, now: number): boolean =>\n record.expiresAt !== null && record.expiresAt <= now\n\nconst decode = (raw: string | null): StoredRecord | null => {\n if (!raw) return null\n try {\n const parsed = JSON.parse(raw) as StoredRecord\n if (typeof parsed !== 'object' || parsed === null) return null\n return parsed\n } catch {\n return null\n }\n}\n\nconst encode = (record: StoredRecord): string => JSON.stringify(record)\n\nexport interface MemoryGetOptions {\n scope?: MemoryScope\n}\n\nexport interface MemorySetOptions {\n scope?: MemoryScope\n ttlSeconds?: number\n}\n\nexport interface MemoryStoreOptions {\n onTrace?: (input: TraceInput) => void\n}\n\nexport const createMemoryStore = (options: MemoryStoreOptions = {}) => {\n const backends: Record<MemoryScope, ScopeBackend> = createBackends()\n const emit = (input: TraceInput) => {\n options.onTrace?.(input)\n }\n\n const get = (key: string, options: MemoryGetOptions = {}): unknown => {\n const scope = options.scope ?? 'session'\n const backend = backends[scope]\n const record = decode(backend.read(key))\n if (!record) {\n emit({ type: 'memory.accessed', metadata: { operation: 'get', key, scope, hit: false } })\n return undefined\n }\n if (isExpired(record, Date.now())) {\n backend.remove(key)\n emit({ type: 'memory.accessed', metadata: { operation: 'get', key, scope, hit: false, expired: true } })\n return undefined\n }\n emit({ type: 'memory.accessed', metadata: { operation: 'get', key, scope, hit: true } })\n return record.value\n }\n\n const set = (key: string, value: unknown, options: MemorySetOptions = {}): MemoryEntry => {\n const scope = options.scope ?? 'session'\n const ttl = options.ttlSeconds ?? null\n const now = Date.now()\n const record: StoredRecord = {\n value,\n expiresAt: ttl === null ? null : now + ttl * 1000,\n updatedAt: new Date(now).toISOString(),\n }\n backends[scope].write(key, encode(record))\n emit({ type: 'memory.updated', metadata: { operation: 'set', key, scope, ttlSeconds: ttl } })\n return MemoryEntry.parse({\n key,\n value,\n scope,\n ttlSeconds: ttl,\n updatedAt: record.updatedAt,\n })\n }\n\n const remove = (key: string, options: MemoryGetOptions = {}) => {\n const scope = options.scope ?? 'session'\n backends[scope].remove(key)\n emit({ type: 'memory.updated', metadata: { operation: 'remove', key, scope } })\n }\n\n const list = (options: MemoryGetOptions = {}): MemoryEntry[] => {\n const scope = options.scope ?? 'session'\n const backend = backends[scope]\n const now = Date.now()\n const out: MemoryEntry[] = []\n for (const key of backend.keys()) {\n const record = decode(backend.read(key))\n if (!record) continue\n if (isExpired(record, now)) {\n backend.remove(key)\n continue\n }\n out.push(\n MemoryEntry.parse({\n key,\n value: record.value,\n scope,\n ttlSeconds:\n record.expiresAt === null ? null : Math.max(0, Math.round((record.expiresAt - now) / 1000)),\n updatedAt: record.updatedAt,\n })\n )\n }\n emit({ type: 'memory.accessed', metadata: { operation: 'list', scope, count: out.length } })\n return out\n }\n\n const clear = (options: MemoryGetOptions = {}) => {\n const scope = options.scope ?? 'session'\n const backend = backends[scope]\n const count = backend.keys().length\n for (const key of backend.keys()) backend.remove(key)\n emit({ type: 'memory.updated', metadata: { operation: 'clear', scope, count } })\n }\n\n return { get, set, remove, list, clear }\n}\n\nexport type MemoryStore = ReturnType<typeof createMemoryStore>\n","import {\n SITE_MEMORY_DEFAULT,\n SiteMemory as SiteMemorySchema,\n SiteMemoryPageContext,\n type SiteMemory,\n} from '@agentronics/protocol'\nimport type { TraceInput } from '../observability/tracer.js'\n\nexport interface SiteMemoryStoreOptions {\n initial?: Partial<SiteMemory>\n onTrace?: (input: TraceInput) => void\n}\n\nexport interface ProvideForPageInput {\n path: string\n payload: Record<string, unknown>\n}\n\nconst cloneSiteMemory = (memory: SiteMemory): SiteMemory =>\n // Round-trip via the schema so callers always receive a validated, defaulted snapshot.\n SiteMemorySchema.parse(JSON.parse(JSON.stringify(memory)))\n\nconst stamp = (memory: SiteMemory): SiteMemory => ({\n ...memory,\n updatedAt: new Date().toISOString(),\n})\n\nexport type SiteMemoryListener = (snapshot: SiteMemory) => void\n\nexport const createSiteMemoryStore = (options: SiteMemoryStoreOptions = {}) => {\n let state: SiteMemory = SiteMemorySchema.parse({\n ...SITE_MEMORY_DEFAULT,\n ...(options.initial ?? {}),\n })\n let cachedSnapshot: SiteMemory | null = null\n const listeners = new Set<SiteMemoryListener>()\n const emit = (input: TraceInput) => {\n options.onTrace?.(input)\n }\n const invalidate = () => {\n cachedSnapshot = null\n }\n const notify = () => {\n if (listeners.size === 0) return\n const snap = cloneSiteMemory(state)\n cachedSnapshot = snap\n listeners.forEach((listener) => listener(snap))\n }\n\n const provide = (next: Partial<SiteMemory>): SiteMemory => {\n const merged = SiteMemorySchema.parse({\n ...state,\n ...next,\n // Workflows/policies/uiGuidance/pageContexts merge by key so partial provides do not nuke siblings.\n workflows: { ...state.workflows, ...(next.workflows ?? {}) },\n policies: { ...state.policies, ...(next.policies ?? {}) },\n uiGuidance: { ...state.uiGuidance, ...(next.uiGuidance ?? {}) },\n pageContexts: { ...state.pageContexts, ...(next.pageContexts ?? {}) },\n })\n state = stamp(merged)\n invalidate()\n emit({\n type: 'memory.updated',\n metadata: { kind: 'site', operation: 'provide', keys: Object.keys(next) },\n })\n notify()\n return snapshot()\n }\n\n const update = (path: string, value: unknown): SiteMemory => {\n const parts = path.split('.').filter(Boolean)\n if (parts.length === 0) {\n throw new Error('siteMemory.update() requires a non-empty dot-path.')\n }\n const next = JSON.parse(JSON.stringify(state)) as Record<string, unknown>\n let cursor: Record<string, unknown> = next\n for (let i = 0; i < parts.length - 1; i++) {\n const key = parts[i]!\n const existing = cursor[key]\n if (typeof existing !== 'object' || existing === null || Array.isArray(existing)) {\n cursor[key] = {}\n }\n cursor = cursor[key] as Record<string, unknown>\n }\n cursor[parts[parts.length - 1]!] = value\n state = stamp(SiteMemorySchema.parse(next))\n invalidate()\n emit({ type: 'memory.updated', metadata: { kind: 'site', operation: 'update', path } })\n notify()\n return snapshot()\n }\n\n const provideForPage = (input: ProvideForPageInput): SiteMemoryPageContext => {\n const context = SiteMemoryPageContext.parse({\n path: input.path,\n payload: input.payload,\n updatedAt: new Date().toISOString(),\n })\n state = stamp({\n ...state,\n pageContexts: { ...state.pageContexts, [input.path]: context },\n })\n invalidate()\n emit({\n type: 'memory.updated',\n metadata: { kind: 'site', operation: 'provideForPage', path: input.path },\n })\n notify()\n return { ...context, payload: { ...context.payload } }\n }\n\n const snapshot = (): SiteMemory => {\n if (!cachedSnapshot) cachedSnapshot = cloneSiteMemory(state)\n return cachedSnapshot\n }\n\n const get = (path?: string): unknown => {\n emit({\n type: 'memory.accessed',\n metadata: { kind: 'site', operation: path ? 'get' : 'snapshot', path: path ?? null },\n })\n if (!path) return cloneSiteMemory(state)\n const parts = path.split('.').filter(Boolean)\n let cursor: unknown = state\n for (const key of parts) {\n if (typeof cursor !== 'object' || cursor === null) return undefined\n cursor = (cursor as Record<string, unknown>)[key]\n }\n return cursor\n }\n\n const getForPage = (path: string): SiteMemoryPageContext | null => {\n emit({\n type: 'memory.accessed',\n metadata: { kind: 'site', operation: 'getForPage', path },\n })\n const found = state.pageContexts[path]\n return found ? { ...found, payload: { ...found.payload } } : null\n }\n\n const replace = (next: SiteMemory): SiteMemory => {\n state = stamp(SiteMemorySchema.parse(next))\n invalidate()\n notify()\n return snapshot()\n }\n\n const subscribe = (listener: SiteMemoryListener): (() => void) => {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n }\n\n return { provide, update, provideForPage, snapshot, get, getForPage, replace, subscribe }\n}\n\nexport type SiteMemoryStore = ReturnType<typeof createSiteMemoryStore>\n","import { SiteMemory as SiteMemorySchema, type SiteMemory } from '@agentronics/protocol'\n\nexport interface MemoryCacheOptions {\n gatewayUrl: string\n siteId: string\n publishableKey: string\n fetcher?: typeof fetch\n}\n\nexport interface MemoryCacheSnapshot {\n memory: SiteMemory | null\n etag: string | null\n}\n\nexport const createMemoryCache = ({\n gatewayUrl,\n siteId,\n publishableKey,\n fetcher = fetch,\n}: MemoryCacheOptions) => {\n let snapshot: MemoryCacheSnapshot = { memory: null, etag: null }\n\n return {\n snapshot(): MemoryCacheSnapshot {\n return {\n memory: snapshot.memory ? SiteMemorySchema.parse(snapshot.memory) : null,\n etag: snapshot.etag,\n }\n },\n\n async sync(): Promise<MemoryCacheSnapshot> {\n const response = await fetcher(\n `${gatewayUrl.replace(/\\/$/, '')}/v1/sites/${encodeURIComponent(siteId)}/memory`,\n {\n headers: {\n authorization: `Bearer ${publishableKey}`,\n ...(snapshot.etag ? { 'if-none-match': snapshot.etag } : {}),\n },\n }\n )\n if (response.status === 304) return this.snapshot()\n if (!response.ok) throw new Error(`Memory sync failed with status ${response.status}.`)\n\n const body = (await response.json()) as { memory?: unknown }\n const memory = SiteMemorySchema.parse(body.memory ?? {})\n snapshot = {\n memory,\n etag: response.headers.get('etag'),\n }\n return this.snapshot()\n },\n }\n}\n\nexport type MemoryCache = ReturnType<typeof createMemoryCache>\n","import type { SiteMemory } from '@agentronics/protocol'\n\nexport interface WebMcpContextTool {\n name: string\n description: string\n inputSchema: { type: 'object'; properties: Record<string, unknown>; required: string[] }\n invoke(input?: { path?: string }): { content: SiteMemory | unknown }\n}\n\nexport interface WebMcpContextOptions {\n toolName?: string\n description?: string\n getSnapshot: () => SiteMemory\n onAccess?: (path: string | null) => void\n}\n\nexport const createWebMcpContextTool = ({\n toolName = 'getSiteContext',\n description = 'Returns Agentronics site memory: page map, workflows, policies, UI guidance.',\n getSnapshot,\n onAccess,\n}: WebMcpContextOptions): WebMcpContextTool => ({\n name: toolName,\n description,\n inputSchema: {\n type: 'object',\n properties: {\n path: {\n type: 'string',\n description: 'Optional dot-path into the site memory (e.g. \"workflows.purchase\").',\n },\n },\n required: [],\n },\n invoke(input = {}) {\n const snapshot = getSnapshot()\n const path = input.path ?? null\n onAccess?.(path)\n if (!path) return { content: snapshot }\n const parts = path.split('.').filter(Boolean)\n let cursor: unknown = snapshot\n for (const key of parts) {\n if (typeof cursor !== 'object' || cursor === null) return { content: undefined }\n cursor = (cursor as Record<string, unknown>)[key]\n }\n return { content: cursor }\n },\n})\n","import type { SiteMemory } from '@agentronics/protocol'\n\nconst META_PREFIX = 'agent-context-'\nconst JSONLD_ID = 'agentronics-site-context'\n\nexport interface MetaTagsOptions {\n doc?: Document\n snapshot: SiteMemory\n schemaType?: string\n}\n\nconst safeJson = (value: unknown): string => {\n try {\n return JSON.stringify(value)\n } catch {\n return '{}'\n }\n}\n\nconst setMeta = (doc: Document, name: string, content: string) => {\n let tag = doc.querySelector<HTMLMetaElement>(`meta[name=\"${name}\"]`)\n if (!tag) {\n tag = doc.createElement('meta')\n tag.setAttribute('name', name)\n doc.head.appendChild(tag)\n }\n tag.setAttribute('content', content)\n}\n\nconst removeByName = (doc: Document, name: string) => {\n doc.querySelectorAll(`meta[name=\"${name}\"]`).forEach((node) => node.remove())\n}\n\nexport const installMetaTags = ({\n doc = typeof document === 'undefined' ? (null as unknown as Document) : document,\n snapshot,\n schemaType = 'WebSite',\n}: MetaTagsOptions): { uninstall: () => void } => {\n if (!doc) return { uninstall: () => {} }\n\n setMeta(doc, `${META_PREFIX}version`, snapshot.version)\n setMeta(doc, `${META_PREFIX}updated-at`, snapshot.updatedAt ?? new Date().toISOString())\n if (snapshot.siteMap?.navigation?.flow) {\n setMeta(doc, `${META_PREFIX}flow`, snapshot.siteMap.navigation.flow)\n }\n setMeta(doc, `${META_PREFIX}workflows`, Object.keys(snapshot.workflows).join(','))\n\n let script = doc.getElementById(JSONLD_ID) as HTMLScriptElement | null\n if (!script) {\n script = doc.createElement('script')\n script.type = 'application/ld+json'\n script.id = JSONLD_ID\n doc.head.appendChild(script)\n }\n script.textContent = safeJson({\n '@context': 'https://schema.org',\n '@type': schemaType,\n name: 'Agentronics Site Memory',\n agentronics: snapshot,\n })\n\n return {\n uninstall: () => {\n removeByName(doc, `${META_PREFIX}version`)\n removeByName(doc, `${META_PREFIX}updated-at`)\n removeByName(doc, `${META_PREFIX}flow`)\n removeByName(doc, `${META_PREFIX}workflows`)\n doc.getElementById(JSONLD_ID)?.remove()\n },\n }\n}\n","import type { SiteMemory } from '@agentronics/protocol'\n\nconst OVERLAY_ID = 'agentronics-memory-overlay'\n\nexport interface MemoryOverlayOptions {\n doc?: Document\n snapshot: SiteMemory\n hidden?: boolean\n}\n\nconst styles = (hidden: boolean): string => `\nposition: fixed;\nbottom: 16px;\nright: 16px;\nmax-width: 320px;\npadding: 10px 12px;\nbackground: rgba(17, 24, 39, 0.92);\ncolor: #f9fafb;\nfont: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;\nborder-radius: 8px;\nz-index: 2147483647;\nopacity: ${hidden ? '0' : '1'};\npointer-events: ${hidden ? 'none' : 'auto'};\nbox-shadow: 0 12px 32px rgba(15, 23, 42, 0.35);\n`\n\nconst summarize = (snapshot: SiteMemory): string => {\n const pages = snapshot.siteMap?.pages?.length ?? 0\n const workflows = Object.keys(snapshot.workflows).length\n const ui = Object.keys(snapshot.uiGuidance).length\n return `Agentronics site memory · pages:${pages} · workflows:${workflows} · ui-hints:${ui}`\n}\n\nexport const installMemoryOverlay = ({\n doc = typeof document === 'undefined' ? (null as unknown as Document) : document,\n snapshot,\n hidden = false,\n}: MemoryOverlayOptions): { uninstall: () => void; refresh: (next: SiteMemory) => void } => {\n if (!doc) return { uninstall: () => {}, refresh: () => {} }\n\n let host = doc.getElementById(OVERLAY_ID) as HTMLDivElement | null\n if (!host) {\n host = doc.createElement('div')\n host.id = OVERLAY_ID\n host.setAttribute('role', 'note')\n host.setAttribute('aria-label', 'Agentronics site memory summary')\n host.setAttribute('data-agent-context', 'overlay')\n doc.body.appendChild(host)\n }\n host.setAttribute('style', styles(hidden))\n host.textContent = summarize(snapshot)\n\n return {\n uninstall: () => {\n host?.remove()\n },\n refresh: (next: SiteMemory) => {\n if (!host) return\n host.textContent = summarize(next)\n },\n }\n}\n","import { SiteMemory as SiteMemorySchema, type SiteMemory } from '@agentronics/protocol'\n\nexport const WELL_KNOWN_PATH = '/.well-known/agent-context.json'\n\nexport interface WellKnownClientOptions {\n origin?: string\n fetcher?: typeof fetch\n signal?: AbortSignal\n}\n\nexport const fetchWellKnownContext = async ({\n origin,\n fetcher = fetch,\n signal,\n}: WellKnownClientOptions = {}): Promise<SiteMemory | null> => {\n const target =\n (origin ? origin.replace(/\\/$/, '') : typeof window !== 'undefined' ? window.location.origin : '') +\n WELL_KNOWN_PATH\n if (!target.startsWith('http')) {\n return null\n }\n const fetchInit: RequestInit = { headers: { accept: 'application/json' } }\n if (signal !== undefined) fetchInit.signal = signal\n const response = await fetcher(target, fetchInit)\n if (!response.ok) {\n if (response.status === 404) return null\n throw new Error(`well-known agent-context fetch failed with status ${response.status}.`)\n }\n const payload = (await response.json()) as unknown\n return SiteMemorySchema.parse(payload)\n}\n\nexport interface ServeWellKnownOptions {\n snapshot: SiteMemory\n}\n\n/**\n * Returns a JSON string suitable for /.well-known/agent-context.json. Hosts proxy this\n * through their CDN/edge so any agent can fetch it with no SDK installed.\n */\nexport const serializeWellKnownContext = ({ snapshot }: ServeWellKnownOptions): string =>\n JSON.stringify(SiteMemorySchema.parse(snapshot))\n","import type { AgentIdentity, PolicyEvaluation, PolicyRule } from '@agentronics/protocol'\nimport type { TraceInput } from '../observability/tracer.js'\n\nexport interface GovernedTool<Input = unknown, Output = unknown> {\n name: string\n version?: string\n group?: string\n description?: string\n inputSchema?: Record<string, unknown>\n outputSchema?: Record<string, unknown>\n stage?: string\n authz?: Omit<PolicyRule, 'id' | 'tool'>\n rateLimit?: PolicyRule['rateLimit']\n execute: (input: Input, context: { identity: AgentIdentity | null }) => Promise<Output> | Output\n}\n\nexport interface ToolRegistryOptions {\n evaluate: (tool: string, options?: { identity?: AgentIdentity | null }) => Promise<PolicyEvaluation>\n setPolicies?: (rules: PolicyRule[]) => void\n listPolicies?: () => PolicyRule[]\n onTrace?: (input: TraceInput) => void\n /**\n * Resolves the ambient agent identity for `execute()` calls that don't pass\n * one explicitly. The SDK wires this to the agentContext snapshot so a\n * button-bound tool fires with the detected agent attached — without\n * forcing every consumer to thread identity through their click handlers.\n *\n * Semantics:\n * - `execute(name, input)` or `execute(name, input, undefined)` → resolver\n * - `execute(name, input, null)` → respected (caller wants anonymous attribution)\n * - `execute(name, input, identity)` → respected\n */\n identityResolver?: () => AgentIdentity | null\n}\n\nexport interface ToolRegistry {\n register(tool: GovernedTool): () => void\n unregister(name: string): void\n enable(name: string): void\n disable(name: string): void\n isEnabled(name: string): boolean\n list(options?: { includeDisabled?: boolean }): GovernedTool[]\n get(name: string): GovernedTool | undefined\n execute<Input, Output>(\n name: string,\n input: Input,\n identity?: AgentIdentity | null\n ): Promise<Output>\n}\n\nexport const createToolRegistry = ({\n evaluate,\n setPolicies,\n listPolicies,\n onTrace,\n identityResolver,\n}: ToolRegistryOptions): ToolRegistry => {\n const tools = new Map<string, GovernedTool>()\n const disabled = new Set<string>()\n\n const writePolicyFor = (tool: GovernedTool) => {\n if (!tool.authz || !setPolicies || !listPolicies) return\n const rule: PolicyRule = {\n id: `tool:${tool.name}`,\n tool: tool.name,\n ...tool.authz,\n rateLimit: tool.rateLimit ?? tool.authz.rateLimit,\n }\n setPolicies([...listPolicies().filter((item) => item.id !== rule.id), rule])\n }\n\n return {\n register(tool) {\n tools.set(tool.name, tool)\n disabled.delete(tool.name)\n writePolicyFor(tool)\n onTrace?.({\n type: 'tool.registered',\n tool: tool.name,\n metadata: {\n version: tool.version ?? null,\n group: tool.group ?? null,\n stage: tool.stage ?? null,\n },\n })\n return () => {\n tools.delete(tool.name)\n disabled.delete(tool.name)\n }\n },\n unregister(name) {\n tools.delete(name)\n disabled.delete(name)\n },\n enable(name) {\n if (!tools.has(name) || !disabled.has(name)) return\n disabled.delete(name)\n onTrace?.({\n type: 'tool.surfaced',\n tool: name,\n metadata: { state: 'enabled' },\n })\n },\n disable(name) {\n if (!tools.has(name) || disabled.has(name)) return\n disabled.add(name)\n onTrace?.({\n type: 'tool.surfaced',\n tool: name,\n metadata: { state: 'disabled' },\n })\n },\n isEnabled: (name) => tools.has(name) && !disabled.has(name),\n list({ includeDisabled = false } = {}) {\n const all = [...tools.values()]\n return includeDisabled ? all : all.filter((tool) => !disabled.has(tool.name))\n },\n get: (name) => tools.get(name),\n async execute<Input, Output>(\n name: string,\n input: Input,\n identity?: AgentIdentity | null\n ): Promise<Output> {\n // `undefined` means \"use the ambient identity\"; explicit `null` means\n // \"anonymous\". This lets button handlers stay as `tools.execute(name,\n // input)` while still being attributed to whatever detect()/declare()\n // resolved into agentContext.\n const resolvedIdentity =\n identity === undefined ? (identityResolver?.() ?? null) : identity\n const tool = tools.get(name) as GovernedTool<Input, Output> | undefined\n if (!tool) throw new Error(`Tool \"${name}\" is not registered.`)\n if (disabled.has(name)) {\n const policy: PolicyEvaluation = {\n decision: 'deny',\n ruleId: `tool:${name}`,\n reason: 'Tool is disabled.',\n }\n onTrace?.({ type: 'tool.executed', tool: name, agent: resolvedIdentity, policy, outcome: 'blocked' })\n throw new Error(policy.reason)\n }\n const policy = await evaluate(name, { identity: resolvedIdentity })\n if (policy.decision === 'deny') {\n onTrace?.({ type: 'tool.executed', tool: name, agent: resolvedIdentity, policy, outcome: 'blocked' })\n throw new Error(policy.reason)\n }\n // Time the execution and trace the outcome either way — a tool that\n // throws is still something the agent did, and the observability /\n // analytics surfaces need both the latency and the error.\n const start = Date.now()\n try {\n const output = await tool.execute(input, { identity: resolvedIdentity })\n onTrace?.({\n type: 'tool.executed',\n tool: name,\n agent: resolvedIdentity,\n policy,\n outcome: 'success',\n durationMs: Date.now() - start,\n })\n return output\n } catch (error) {\n onTrace?.({\n type: 'tool.executed',\n tool: name,\n agent: resolvedIdentity,\n policy,\n outcome: 'error',\n durationMs: Date.now() - start,\n error: error instanceof Error ? error.message : String(error),\n })\n throw error\n }\n },\n }\n}\n","import type { ToolDescriptor } from '@agentronics/protocol'\nimport type { GovernedTool } from './registry.js'\n\n/**\n * Map a registered tool to the wire descriptor the gateway/dashboard consume.\n * `tokens` uses the same rough OpenAI-style rule of thumb the SDK's token\n * budget uses (≈ characters / 4) so the dashboard's per-tool cost matches.\n */\nexport const toToolDescriptor = (tool: GovernedTool): ToolDescriptor => {\n const descriptor: ToolDescriptor = {\n name: tool.name,\n description: tool.description ?? '',\n inputSchema: tool.inputSchema ?? {},\n tokens: 0,\n }\n if (tool.group) descriptor.group = tool.group\n if (tool.stage) descriptor.page = tool.stage\n if (tool.outputSchema) descriptor.outputSchema = tool.outputSchema\n descriptor.tokens = Math.ceil(\n JSON.stringify({\n name: descriptor.name,\n description: descriptor.description,\n inputSchema: descriptor.inputSchema,\n ...(descriptor.outputSchema ? { outputSchema: descriptor.outputSchema } : {}),\n }).length / 4\n )\n return descriptor\n}\n\nexport interface ToolSyncOptions {\n gatewayUrl: string\n siteId: string\n publishableKey: string\n fetcher?: typeof fetch\n}\n\n/** Pushes the full tool registry to the gateway for dashboard display. */\nexport const createToolSync = ({\n gatewayUrl,\n siteId,\n publishableKey,\n fetcher = fetch,\n}: ToolSyncOptions) => ({\n async push(tools: GovernedTool[]): Promise<number> {\n const descriptors = tools.map(toToolDescriptor)\n const response = await fetcher(\n `${gatewayUrl.replace(/\\/$/, '')}/v1/sites/${encodeURIComponent(siteId)}/tools`,\n {\n method: 'PUT',\n headers: {\n authorization: `Bearer ${publishableKey}`,\n 'content-type': 'application/json',\n },\n body: JSON.stringify({ registry: { tools: descriptors } }),\n }\n )\n if (!response.ok) {\n throw new Error(`Tool sync failed with status ${response.status}.`)\n }\n return descriptors.length\n },\n})\n\nexport type ToolSync = ReturnType<typeof createToolSync>\n","import type { TraceInput } from '../observability/tracer.js'\n\nexport interface ProgressionTransition {\n on: string\n to: string\n}\n\nexport interface ProgressionStage {\n name: string\n enables?: string[]\n transitions?: ProgressionTransition[]\n}\n\nexport interface ProgressionConfig {\n initial: string\n stages: ProgressionStage[]\n}\n\nexport interface ProgressionStore {\n current(): string\n enabledStages(): string[]\n notify(toolName: string): { changed: boolean; from: string; to: string }\n set(stage: string): { changed: boolean; from: string; to: string }\n reset(): void\n snapshot(): { current: string; enabled: string[] }\n}\n\nexport const createProgressionStore = (\n config: ProgressionConfig,\n options: { onTrace?: (input: TraceInput) => void } = {}\n): ProgressionStore => {\n const stageMap = new Map<string, ProgressionStage>()\n for (const stage of config.stages) stageMap.set(stage.name, stage)\n if (!stageMap.has(config.initial)) {\n throw new Error(`Initial stage \"${config.initial}\" is not declared in progression stages.`)\n }\n\n let current = config.initial\n\n const enabled = (): string[] => {\n const stage = stageMap.get(current)\n return stage?.enables ? [current, ...stage.enables] : [current]\n }\n\n const transitionTo = (next: string, trigger: string): { changed: boolean; from: string; to: string } => {\n const from = current\n if (!stageMap.has(next)) {\n throw new Error(`Cannot transition to unknown stage \"${next}\".`)\n }\n if (next === current) return { changed: false, from, to: next }\n current = next\n options.onTrace?.({\n type: 'tool.progressed',\n metadata: { from, to: next, trigger },\n })\n return { changed: true, from, to: next }\n }\n\n return {\n current: () => current,\n enabledStages: () => enabled(),\n notify(toolName) {\n const stage = stageMap.get(current)\n const transition = stage?.transitions?.find((t) => t.on === toolName)\n if (!transition) return { changed: false, from: current, to: current }\n return transitionTo(transition.to, toolName)\n },\n set(stage) {\n return transitionTo(stage, 'manual')\n },\n reset() {\n const previous = current\n current = config.initial\n if (previous !== current) {\n options.onTrace?.({\n type: 'tool.progressed',\n metadata: { from: previous, to: current, trigger: 'reset' },\n })\n }\n },\n snapshot: () => ({ current, enabled: enabled() }),\n }\n}\n","import type { AgentIdentity, TrustLevel } from '@agentronics/protocol'\nimport { TRUST_RANK } from '@agentronics/protocol'\nimport type { GovernedTool } from './registry.js'\n\nexport interface SurfacingContext {\n identity: AgentIdentity | null\n stage?: string | null\n enabledStages?: string[]\n}\n\nexport interface SurfacingDecision {\n tool: GovernedTool\n visible: boolean\n reason: string\n}\n\nconst passesTrust = (tool: GovernedTool, identity: AgentIdentity | null): { ok: boolean; reason: string } => {\n const minTrust = tool.authz?.minTrust as TrustLevel | undefined\n if (!minTrust) return { ok: true, reason: 'no-trust-floor' }\n if (!identity) return { ok: false, reason: `requires-trust:${minTrust}` }\n if (TRUST_RANK[identity.trust] < TRUST_RANK[minTrust]) {\n return { ok: false, reason: `trust-too-low:${identity.trust}<${minTrust}` }\n }\n return { ok: true, reason: 'trust-ok' }\n}\n\nconst passesClass = (tool: GovernedTool, identity: AgentIdentity | null): { ok: boolean; reason: string } => {\n const allowed = tool.authz?.allowedClasses ?? []\n if (allowed.length === 0) return { ok: true, reason: 'no-class-restriction' }\n if (!identity) return { ok: false, reason: `requires-class:${allowed.join('|')}` }\n if (!allowed.includes(identity.class)) {\n return { ok: false, reason: `class-not-allowed:${identity.class}` }\n }\n return { ok: true, reason: 'class-ok' }\n}\n\nconst passesStage = (tool: GovernedTool, context: SurfacingContext): { ok: boolean; reason: string } => {\n if (!tool.stage) return { ok: true, reason: 'no-stage' }\n if (context.enabledStages && context.enabledStages.includes(tool.stage)) {\n return { ok: true, reason: `stage-enabled:${tool.stage}` }\n }\n if (context.stage === tool.stage) return { ok: true, reason: `stage-active:${tool.stage}` }\n return { ok: false, reason: `stage-locked:${tool.stage}` }\n}\n\nexport const decideSurfacing = (\n tool: GovernedTool,\n context: SurfacingContext\n): SurfacingDecision => {\n const trust = passesTrust(tool, context.identity)\n if (!trust.ok) return { tool, visible: false, reason: trust.reason }\n const cls = passesClass(tool, context.identity)\n if (!cls.ok) return { tool, visible: false, reason: cls.reason }\n const stage = passesStage(tool, context)\n if (!stage.ok) return { tool, visible: false, reason: stage.reason }\n if (tool.authz?.decision === 'deny') {\n return { tool, visible: false, reason: 'authz-deny' }\n }\n return { tool, visible: true, reason: 'visible' }\n}\n\nexport const surfaceTools = (\n tools: GovernedTool[],\n context: SurfacingContext\n): GovernedTool[] => tools.filter((tool) => decideSurfacing(tool, context).visible)\n\nexport const explainSurfacing = (\n tools: GovernedTool[],\n context: SurfacingContext\n): SurfacingDecision[] => tools.map((tool) => decideSurfacing(tool, context))\n","import type { GovernedTool } from './registry.js'\n\nexport const DEFAULT_GROUP = 'default'\n\nexport interface ToolGroupSummary {\n name: string\n tools: GovernedTool[]\n}\n\nexport const groupTools = (tools: GovernedTool[]): ToolGroupSummary[] => {\n const map = new Map<string, GovernedTool[]>()\n for (const tool of tools) {\n const key = tool.group ?? DEFAULT_GROUP\n const bucket = map.get(key) ?? []\n bucket.push(tool)\n map.set(key, bucket)\n }\n return [...map.entries()]\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([name, list]) => ({ name, tools: list }))\n}\n\nexport const listGroupNames = (tools: GovernedTool[]): string[] =>\n [...new Set(tools.map((tool) => tool.group ?? DEFAULT_GROUP))].sort()\n","import type { GovernedTool } from './registry.js'\n\nconst APPROX_CHARS_PER_TOKEN = 4\n\nconst stableStringify = (value: unknown): string => {\n if (value === null || typeof value !== 'object') return JSON.stringify(value)\n if (Array.isArray(value)) return `[${value.map(stableStringify).join(',')}]`\n const keys = Object.keys(value as Record<string, unknown>).sort()\n return `{${keys\n .map((key) => `${JSON.stringify(key)}:${stableStringify((value as Record<string, unknown>)[key])}`)\n .join(',')}}`\n}\n\nexport interface ToolTokenEstimate {\n name: string\n characters: number\n tokens: number\n}\n\nexport interface TokenBudgetReport {\n total: number\n perTool: ToolTokenEstimate[]\n}\n\nexport const estimateToolTokens = (tool: GovernedTool): ToolTokenEstimate => {\n const descriptor = {\n name: tool.name,\n version: tool.version ?? null,\n group: tool.group ?? null,\n description: tool.description ?? null,\n inputSchema: tool.inputSchema ?? null,\n authz: tool.authz ?? null,\n rateLimit: tool.rateLimit ?? null,\n }\n const characters = stableStringify(descriptor).length\n return { name: tool.name, characters, tokens: Math.ceil(characters / APPROX_CHARS_PER_TOKEN) }\n}\n\nexport const estimateBudget = (tools: GovernedTool[]): TokenBudgetReport => {\n const perTool = tools.map(estimateToolTokens)\n const total = perTool.reduce((sum, entry) => sum + entry.tokens, 0)\n return { total, perTool }\n}\n","import type { GovernedTool } from './registry.js'\n\nexport interface WebMcpToolDescriptor {\n name: string\n description?: string\n inputSchema?: Record<string, unknown>\n invoke(input?: unknown): Promise<unknown>\n}\n\nexport interface WebMcpProvider {\n provideContext(payload: { tools: WebMcpToolDescriptor[] }): { revoke: () => void }\n}\n\nexport interface WebMcpAdapterOptions {\n provider?: WebMcpProvider\n doc?: { defaultView?: WindowLike | null } | null\n invoke?: (tool: GovernedTool, input: unknown) => Promise<unknown>\n}\n\ninterface WindowLike {\n navigator?: { modelContext?: WebMcpProvider }\n}\n\nconst resolveProvider = (options: WebMcpAdapterOptions): WebMcpProvider | null => {\n if (options.provider) return options.provider\n const win = options.doc?.defaultView ?? (typeof globalThis !== 'undefined' ? (globalThis as WindowLike) : null)\n const candidate = win?.navigator?.modelContext\n if (!candidate) return null\n // Some polyfills / browser extensions patch `navigator.modelContext` with a\n // different shape (e.g. `setTools` instead of `provideContext`). Only accept\n // the object as a provider when it exposes the method we actually call;\n // otherwise the rest of the SDK falls back to no-op publishing instead of\n // throwing `provideContext is not a function` at runtime.\n if (typeof (candidate as Partial<WebMcpProvider>).provideContext !== 'function') {\n return null\n }\n return candidate\n}\n\nconst toDescriptor = (\n tool: GovernedTool,\n invoke: (tool: GovernedTool, input: unknown) => Promise<unknown>\n): WebMcpToolDescriptor => {\n const descriptor: WebMcpToolDescriptor = {\n name: tool.name,\n invoke: (input) => invoke(tool, input),\n }\n if (tool.description !== undefined) descriptor.description = tool.description\n if (tool.inputSchema !== undefined) descriptor.inputSchema = tool.inputSchema\n return descriptor\n}\n\nexport interface WebMcpAdapter {\n publish(tools: GovernedTool[]): { revoked: boolean }\n revoke(): void\n available(): boolean\n}\n\nexport const createWebMcpAdapter = (options: WebMcpAdapterOptions = {}): WebMcpAdapter => {\n const invoke = options.invoke ?? (async (tool, input) => tool.execute(input as never, { identity: null }))\n let handle: { revoke: () => void } | null = null\n\n return {\n publish(tools) {\n const provider = resolveProvider(options)\n if (!provider) return { revoked: false }\n handle?.revoke()\n handle = provider.provideContext({ tools: tools.map((tool) => toDescriptor(tool, invoke)) })\n return { revoked: true }\n },\n revoke() {\n handle?.revoke()\n handle = null\n },\n available: () => Boolean(resolveProvider(options)),\n }\n}\n","import type { TraceEvent as TraceEventRecord } from '@agentronics/protocol'\n\nexport interface TraceBuffer {\n add(event: TraceEventRecord): void\n list(): TraceEventRecord[]\n clear(): void\n}\n\nexport const createTraceBuffer = (limit = 500): TraceBuffer => {\n const events: TraceEventRecord[] = []\n\n return {\n add(event) {\n events.push(event)\n if (events.length > limit) events.splice(0, events.length - limit)\n },\n list() {\n return [...events]\n },\n clear() {\n events.length = 0\n },\n }\n}\n","import type { TraceEvent as TraceEventRecord } from '@agentronics/protocol'\n\nexport interface SamplerOptions {\n traceRate?: number\n errorRate?: number\n random?: () => number\n}\n\nconst clampRate = (value: number | undefined, fallback: number): number => {\n if (value === undefined) return fallback\n return Math.max(0, Math.min(1, value))\n}\n\nexport const createSampler = (options: SamplerOptions = {}) => {\n const traceRate = clampRate(options.traceRate, 1)\n const errorRate = clampRate(options.errorRate, 1)\n const random = options.random ?? Math.random\n\n return {\n shouldKeep(event: Pick<TraceEventRecord, 'outcome'>): boolean {\n const rate = event.outcome === 'error' ? errorRate : traceRate\n return random() < rate\n },\n }\n}\n\nexport type TraceSampler = ReturnType<typeof createSampler>\n","const REDACTED = '[REDACTED]'\n\nconst cloneJson = (value: unknown): unknown => {\n if (value === undefined) return undefined\n return JSON.parse(JSON.stringify(value)) as unknown\n}\n\nconst redactPath = (target: unknown, parts: string[]): void => {\n if (parts.length === 0 || typeof target !== 'object' || target === null) return\n const [head, ...rest] = parts\n if (!head) return\n\n if (Array.isArray(target)) {\n for (const item of target) redactPath(item, parts)\n return\n }\n\n const record = target as Record<string, unknown>\n if (!(head in record)) return\n if (rest.length === 0) {\n record[head] = REDACTED\n return\n }\n redactPath(record[head], rest)\n}\n\nexport const scrubValue = <T>(value: T, paths: string[] = []): T => {\n if (paths.length === 0) return value\n const cloned = cloneJson(value) as T\n for (const path of paths) redactPath(cloned, path.split('.').filter(Boolean))\n return cloned\n}\n\nexport const DEFAULT_SCRUB_PATHS = [\n 'metadata.password',\n 'metadata.token',\n 'metadata.authorization',\n 'metadata.cookie',\n]\n","import {\n TraceEvent,\n type TraceEvent as TraceEventRecord,\n type TraceEventType,\n} from '@agentronics/protocol'\nimport { createTraceBuffer, type TraceBuffer } from './buffer.js'\nimport { createSampler, type SamplerOptions } from './sampler.js'\nimport { DEFAULT_SCRUB_PATHS, scrubValue } from './scrub.js'\n\nexport interface TraceExporter {\n name: string\n export(events: TraceEventRecord[]): Promise<void> | void\n}\n\nexport interface TraceInput {\n type: TraceEventType\n outcome?: TraceEventRecord['outcome']\n tool?: string\n agent?: TraceEventRecord['agent']\n policy?: TraceEventRecord['policy']\n durationMs?: number\n error?: string\n metadata?: Record<string, unknown>\n}\n\nexport interface TracerOptions extends SamplerOptions {\n siteId: string\n bufferSize?: number\n sessionId?: string\n scrubPaths?: string[]\n exporters?: TraceExporter[]\n onExporterError?: (error: unknown, exporter: TraceExporter, event: TraceEventRecord) => void\n /**\n * Resolves the page each emitted event belongs to — stamped into\n * `metadata.page` (a reserved trace metadata key) unless the caller already\n * set it. The dashboard groups WebMCP tools and agent activity by this.\n * Defaults to `location.pathname`; returns `undefined` outside a browser\n * (SSR / Node tests), in which case no `page` key is written.\n */\n pageProvider?: () => string | undefined\n}\n\nconst defaultPageProvider = (): string | undefined =>\n typeof location !== 'undefined' && typeof location.pathname === 'string'\n ? location.pathname\n : undefined\n\nexport interface Tracer {\n readonly sessionId: string\n emit(input: TraceInput): Promise<TraceEventRecord | null>\n list(): TraceEventRecord[]\n clear(): void\n}\n\nconst randomId = (prefix: string): string => {\n const cryptoApi = globalThis.crypto\n if (cryptoApi && 'randomUUID' in cryptoApi) return `${prefix}_${cryptoApi.randomUUID()}`\n return `${prefix}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2)}`\n}\n\nexport const createTracer = ({\n siteId,\n bufferSize,\n sessionId = randomId('ses'),\n scrubPaths = DEFAULT_SCRUB_PATHS,\n exporters = [],\n onExporterError,\n pageProvider = defaultPageProvider,\n ...samplerOptions\n}: TracerOptions): Tracer => {\n const buffer: TraceBuffer = createTraceBuffer(bufferSize)\n const sampler = createSampler(samplerOptions)\n\n // A host-supplied provider must never break tracing — swallow throws.\n const readPage = (): string | undefined => {\n try {\n return pageProvider()\n } catch {\n return undefined\n }\n }\n\n return {\n sessionId,\n async emit(input) {\n const metadata: Record<string, unknown> = { ...input.metadata }\n if (metadata.page === undefined) {\n const page = readPage()\n if (page !== undefined) metadata.page = page\n }\n const event = TraceEvent.parse(\n scrubValue(\n {\n id: randomId('trc'),\n siteId,\n sessionId,\n occurredAt: new Date().toISOString(),\n outcome: input.outcome ?? 'success',\n ...input,\n metadata,\n },\n scrubPaths\n )\n )\n\n if (!sampler.shouldKeep(event)) return null\n buffer.add(event)\n\n await Promise.all(\n exporters.map(async (exporter) => {\n try {\n await exporter.export([event])\n } catch (error) {\n onExporterError?.(error, exporter, event)\n }\n })\n )\n\n return event\n },\n list: () => buffer.list(),\n clear: () => buffer.clear(),\n }\n}\n","import type { TraceEvent as TraceEventRecord } from '@agentronics/protocol'\nimport type { TraceExporter } from '../tracer.js'\n\nexport const createConsoleExporter = (): TraceExporter => ({\n name: 'console',\n export(events: TraceEventRecord[]) {\n for (const event of events) {\n console.info('[agentronics:trace]', event.type, event)\n }\n },\n})\n","import type { TraceBatch, TraceEvent as TraceEventRecord } from '@agentronics/protocol'\nimport type { TraceExporter } from '../tracer.js'\n\nexport interface GatewayExporterOptions {\n gatewayUrl: string\n publishableKey: string\n fetcher?: typeof fetch\n}\n\nexport const createGatewayExporter = ({\n gatewayUrl,\n publishableKey,\n fetcher = fetch,\n}: GatewayExporterOptions): TraceExporter => ({\n name: 'gateway',\n async export(events: TraceEventRecord[]) {\n const batch: TraceBatch = { publishableKey, events }\n await fetcher(`${gatewayUrl.replace(/\\/$/, '')}/v1/traces`, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n authorization: `Bearer ${publishableKey}`,\n },\n body: JSON.stringify(batch),\n })\n },\n})\n","import type { TraceEvent as TraceEventRecord } from '@agentronics/protocol'\nimport type { TraceExporter } from '../tracer.js'\n\nexport interface WebhookExporterOptions {\n url: string\n fetcher?: typeof fetch\n maxRetries?: number\n queueLimit?: number\n}\n\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))\n\nexport const createWebhookExporter = ({\n url,\n fetcher = fetch,\n maxRetries = 2,\n queueLimit = 500,\n}: WebhookExporterOptions): TraceExporter => ({\n name: 'webhook',\n async export(events: TraceEventRecord[]) {\n const queued = readQueue(url)\n const batch = [...queued, ...events].slice(-queueLimit)\n let attempt = 0\n while (true) {\n const response = await fetcher(url, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ events: batch }),\n })\n if (response.ok) {\n writeQueue(url, [])\n return\n }\n if (attempt >= maxRetries) {\n writeQueue(url, batch)\n throw new Error(`Webhook exporter failed with status ${response.status}.`)\n }\n attempt += 1\n await sleep(100 * attempt)\n }\n },\n})\n\nconst queueKey = (url: string) => `agtx:webhook:${url}`\n\nconst readQueue = (url: string): TraceEventRecord[] => {\n if (typeof window === 'undefined' || !window.localStorage) return []\n try {\n const raw = window.localStorage.getItem(queueKey(url))\n return raw ? (JSON.parse(raw) as TraceEventRecord[]) : []\n } catch {\n return []\n }\n}\n\nconst writeQueue = (url: string, events: TraceEventRecord[]): void => {\n if (typeof window === 'undefined' || !window.localStorage) return\n try {\n if (events.length === 0) {\n window.localStorage.removeItem(queueKey(url))\n return\n }\n window.localStorage.setItem(queueKey(url), JSON.stringify(events))\n } catch {\n // If storage is unavailable, webhook export failure still surfaces via the thrown error.\n }\n}\n","import {\n AgentronicsError,\n classifyApiKey,\n PUBLISHABLE_KEY_PREFIX,\n type AgentIdentity,\n type PolicyEvaluation,\n type PolicyRule,\n type TraceEvent,\n} from '@agentronics/protocol'\nimport { detectAgent, type DetectAgentOptions } from './detection/index.js'\nimport { SDK_VERSION } from './version.js'\nimport {\n createIdentityStore,\n type PresentedIdentity,\n type PresentIdentityOptions,\n} from './auth/identity.js'\nimport { createAuthEngine, type AuthContext, type AuthEngine, type AuthInput } from './auth/engine.js'\nimport { createAgentContextStore, type AgentContextStore } from './auth/agentContext.js'\nimport { createPolicyEngine, type PolicyEngine } from './authz/engine.js'\nimport { createPolicyCache, type PolicyCache } from './authz/policyCache.js'\nimport { installDomEnforcer } from './authz/domEnforcer.js'\nimport { createMemoryStore, type MemoryStore } from './memory/store.js'\nimport {\n createSiteMemoryStore,\n type SiteMemoryStore,\n type ProvideForPageInput,\n} from './memory/siteMemory.js'\nimport { createMemoryCache, type MemoryCache } from './memory/memoryCache.js'\nimport {\n installMetaTags,\n installMemoryOverlay,\n fetchWellKnownContext,\n} from './memory/delivery/index.js'\nimport { createToolRegistry, type GovernedTool, type ToolRegistry } from './tools/registry.js'\nimport { createToolSync } from './tools/toolSync.js'\nimport {\n createProgressionStore,\n type ProgressionConfig,\n type ProgressionStore,\n} from './tools/progression.js'\nimport { surfaceTools, explainSurfacing, type SurfacingDecision } from './tools/surfacing.js'\nimport { groupTools, type ToolGroupSummary } from './tools/groups.js'\nimport { estimateBudget, type TokenBudgetReport } from './tools/tokenEstimate.js'\nimport { createWebMcpAdapter, type WebMcpAdapter } from './tools/webmcpAdapter.js'\nimport type { SiteMemory } from '@agentronics/protocol'\nimport {\n createConsoleExporter,\n createGatewayExporter,\n createTracer,\n createWebhookExporter,\n type TraceExporter,\n type Tracer,\n} from './observability/index.js'\n\nexport interface InitOptions {\n publishableKey: string\n siteId?: string\n /**\n * Override the gateway URL the SDK calls. **Reserved for local development\n * only** — the only accepted values are `localhost` / `127.0.0.1` URLs (so\n * `pnpm dev` against a local gateway works). Any other value throws at\n * `init()` time.\n *\n * Production deployments must omit this option. The SDK is hard-coded to\n * call `https://gateway.agentronics.dev`. Custom backends are not\n * supported, by design — see the project README + LICENSE NOTICE.\n *\n * @internal — kept on the public type only so dev tooling type-checks.\n */\n gatewayUrl?: string\n debug?: boolean\n policies?: PolicyRule[]\n siteMemory?: Partial<SiteMemory>\n auth?: AuthContext\n progression?: ProgressionConfig\n tools?: GovernedTool[]\n /**\n * Run agent detection automatically on init and keep the resulting\n * identity in agentContext so every subsequent tools.execute() call gets\n * attributed without the host page passing identity through. Default\n * `true` — opt out with `false` for privacy-mode hosts, or pass\n * DetectAgentOptions to tune the detectors (e.g. raise the DOM threshold).\n *\n * The first detection cycle runs synchronously where possible (DOM\n * heuristics) and continues asynchronously for WebMCP polling, so very\n * early click handlers may see identity=null for a single frame; the\n * `ready` promise on the returned client resolves once the cycle finishes.\n */\n autoDetect?: boolean | DetectAgentOptions\n trace?: {\n enabled?: boolean\n bufferSize?: number\n traceRate?: number\n errorRate?: number\n scrubPaths?: string[]\n exporters?: TraceExporter[]\n gateway?: boolean\n webhookUrl?: string\n }\n}\n\nexport interface AgentronicsClient {\n readonly publishableKey: string\n readonly siteId: string\n readonly gatewayUrl: string\n readonly debug: boolean\n readonly memory: MemoryStore\n readonly siteMemory: SiteMemoryStore\n readonly memoryCache: MemoryCache\n readonly tracer: Tracer\n readonly auth: AuthEngine\n readonly agentContext: AgentContextStore\n readonly authz: PolicyEngine\n readonly policyCache: PolicyCache\n readonly tools: ToolRegistry\n readonly progression: ProgressionStore | null\n readonly webmcp: WebMcpAdapter\n /**\n * Resolves once the initial autoDetect cycle finishes. Rejects only if the\n * autoDetect configuration itself is invalid; detection failures resolve to\n * `null` (treated as \"human or undetectable agent\"). When `autoDetect` was\n * disabled the promise resolves immediately to `null`.\n */\n readonly ready: Promise<AgentIdentity | null>\n detect(options?: DetectAgentOptions): Promise<AgentIdentity | null>\n authenticate(input: AuthInput): Promise<AgentIdentity | null>\n presentIdentity(input: PresentIdentityOptions): PresentedIdentity\n clearIdentity(): void\n presentedIdentity(): PresentedIdentity | null\n setPolicies(rules: PolicyRule[]): void\n listPolicies(): PolicyRule[]\n evaluate(tool: string, options?: { identity?: AgentIdentity | null }): Promise<PolicyEvaluation>\n syncPolicies(): Promise<PolicyRule[]>\n syncSiteMemory(): Promise<SiteMemory | null>\n provideSiteMemory(memory: Partial<SiteMemory>): SiteMemory\n provideForPage(input: ProvideForPageInput): void\n installMemoryDelivery(options?: {\n metaTags?: boolean\n overlay?: boolean\n }): { uninstall: () => void }\n fetchWellKnown(origin?: string): Promise<SiteMemory | null>\n installDomEnforcer(): { uninstall: () => void }\n registerTool(tool: GovernedTool): () => void\n /** Push the full tool registry to the gateway so the dashboard can render\n * the page-wise view (schemas, per-tool tokens, context fullness). */\n syncTools(): Promise<number>\n surfaceTools(options?: { identity?: AgentIdentity | null }): GovernedTool[]\n explainSurfacing(options?: { identity?: AgentIdentity | null }): SurfacingDecision[]\n groupedTools(options?: { identity?: AgentIdentity | null }): ToolGroupSummary[]\n estimateTokens(options?: { identity?: AgentIdentity | null }): TokenBudgetReport\n publishToWebMcp(options?: { identity?: AgentIdentity | null }): { revoked: boolean; surfaced: number }\n notifyToolInvoked(toolName: string): void\n traces(): TraceEvent[]\n clearTraces(): void\n /**\n * Sanity-check the publishable key + gateway URL. Hits `GET /v1/health` and\n * resolves to `{ ok: true, ... }` on 2xx, `{ ok: false, status, error }`\n * otherwise. Doesn't throw — designed for \"did my key wire up correctly?\"\n * UX without forcing the host page into a try/catch.\n */\n ping(): Promise<{ ok: true; status: number; body: unknown } | { ok: false; status: number; error: string }>\n}\n\nconst DEFAULT_GATEWAY_URL = 'https://gateway.agentronics.dev'\n\n/**\n * Lock the SDK to the canonical Agentronics gateway. The only override\n * accepted is a localhost / 127.0.0.1 URL — purely so contributors running\n * `pnpm dev` can hit a local gateway. Any other value (a competing host, a\n * proxy, an MITM target) throws synchronously, before any traces are\n * emitted.\n *\n * The Agentronics SDK is licensed under Apache 2.0 but is designed to\n * operate exclusively against the Agentronics service. Self-hosted /\n * third-party backends are not supported.\n */\nconst resolveGatewayUrl = (provided: string | undefined): string => {\n if (provided === undefined) return DEFAULT_GATEWAY_URL\n if (provided === DEFAULT_GATEWAY_URL) return provided\n let parsed: URL\n try {\n parsed = new URL(provided)\n } catch {\n throw new Error(\n `Agentronics SDK: \\`gatewayUrl\\` is not a valid URL: ${provided}`\n )\n }\n if (parsed.hostname === 'localhost' || parsed.hostname === '127.0.0.1') {\n return provided\n }\n throw new Error(\n `Agentronics SDK does not support custom gateway URLs. ` +\n `Omit \\`gatewayUrl\\` to use the canonical https://gateway.agentronics.dev. ` +\n `The only accepted override is a localhost / 127.0.0.1 URL for local development. ` +\n `Got: ${provided}`\n )\n}\n\nexport const init = (options: InitOptions): AgentronicsClient => {\n const {\n publishableKey,\n siteId = 'default',\n debug = false,\n policies = [],\n trace = {},\n } = options\n const gatewayUrl = resolveGatewayUrl(options.gatewayUrl)\n\n const kind = classifyApiKey(publishableKey)\n if (kind === 'secret') {\n throw new AgentronicsError(\n 'wrong_key_kind',\n 'A secret key was passed to Agentronics.init(). Browser code must use a publishable key (agtx_pk_*).'\n )\n }\n if (kind !== 'publishable') {\n throw new AgentronicsError(\n 'invalid_api_key',\n `Agentronics.init() expected a key starting with \"${PUBLISHABLE_KEY_PREFIX}\".`\n )\n }\n\n const traceEnabled = trace.enabled ?? true\n const exporters = [\n ...(debug ? [createConsoleExporter()] : []),\n ...(trace.gateway ? [createGatewayExporter({ gatewayUrl, publishableKey })] : []),\n ...(trace.webhookUrl ? [createWebhookExporter({ url: trace.webhookUrl })] : []),\n ...(trace.exporters ?? []),\n ]\n const tracerOptions: Parameters<typeof createTracer>[0] = {\n siteId,\n exporters: traceEnabled ? exporters : [],\n onExporterError: (error, exporter) => {\n if (debug) console.warn(`[agentronics] trace exporter \"${exporter.name}\" failed`, error)\n },\n }\n if (trace.bufferSize !== undefined) tracerOptions.bufferSize = trace.bufferSize\n if (trace.traceRate !== undefined) tracerOptions.traceRate = trace.traceRate\n if (trace.errorRate !== undefined) tracerOptions.errorRate = trace.errorRate\n if (trace.scrubPaths !== undefined) tracerOptions.scrubPaths = trace.scrubPaths\n const tracer = createTracer(tracerOptions)\n const emitTrace = (input: Parameters<Tracer['emit']>[0]) => {\n if (!traceEnabled) return\n void tracer.emit(input)\n }\n const identityStore = createIdentityStore()\n const authOptions: Parameters<typeof createAuthEngine>[0] = {\n onTrace: emitTrace,\n }\n if (options.auth !== undefined) authOptions.context = options.auth\n const auth = createAuthEngine(authOptions)\n const agentContext = createAgentContextStore()\n const policyEngine = createPolicyEngine(policies)\n const policyCache = createPolicyCache({ gatewayUrl, siteId, publishableKey })\n const memory = createMemoryStore({ onTrace: emitTrace })\n const siteMemoryOptions: Parameters<typeof createSiteMemoryStore>[0] = {\n onTrace: emitTrace,\n }\n if (options.siteMemory !== undefined) siteMemoryOptions.initial = options.siteMemory\n const siteMemory = createSiteMemoryStore(siteMemoryOptions)\n const memoryCache = createMemoryCache({ gatewayUrl, siteId, publishableKey })\n const toolSync = createToolSync({ gatewayUrl, siteId, publishableKey })\n\n const detect = async (detectOptions?: DetectAgentOptions) => {\n const start = Date.now()\n const detected = await detectAgent(detectOptions)\n const identity = identityStore.preferOver(detected)\n if (traceEnabled) {\n await tracer.emit({\n type: identity ? 'agent.detected' : 'agent.missed',\n agent: identity,\n durationMs: Date.now() - start,\n metadata: {\n detectedClass: detected?.class ?? null,\n presented: identityStore.snapshot() !== null,\n },\n })\n }\n agentContext.set(identity, 'detect')\n return identity\n }\n const evaluate = async (tool: string, opts: { identity?: AgentIdentity | null } = {}) => {\n const start = Date.now()\n const identity = opts.identity !== undefined ? opts.identity : await detect()\n const policy = policyEngine.evaluate({ tool, identity })\n if (traceEnabled) {\n await tracer.emit({\n type: 'authz.evaluated',\n tool,\n agent: identity,\n policy,\n outcome: policy.decision === 'deny' ? 'blocked' : 'success',\n durationMs: Date.now() - start,\n })\n }\n return policy\n }\n const tools = createToolRegistry({\n evaluate,\n setPolicies: (rules) => policyEngine.set(rules),\n listPolicies: () => policyEngine.list(),\n onTrace: emitTrace,\n // Every tools.execute() call without an explicit identity gets the\n // current detected/declared/authenticated agent. Button-bound tools\n // become attributable without their handlers having to know about\n // agents.\n identityResolver: () => agentContext.snapshot().identity,\n })\n for (const tool of options.tools ?? []) tools.register(tool)\n\n const progression = options.progression\n ? createProgressionStore(options.progression, { onTrace: emitTrace })\n : null\n\n const surfacingContext = (identity: AgentIdentity | null) => {\n const ctx: { identity: AgentIdentity | null; stage?: string; enabledStages?: string[] } = {\n identity,\n }\n if (progression) {\n ctx.stage = progression.current()\n ctx.enabledStages = progression.enabledStages()\n }\n return ctx\n }\n\n const surfaceFor = (identity: AgentIdentity | null) =>\n surfaceTools(tools.list(), surfacingContext(identity))\n\n const handleToolInvoked = (toolName: string) => {\n if (!progression) return\n const transition = progression.notify(toolName)\n if (transition.changed) webmcp.publish(surfaceFor(agentContext.snapshot().identity))\n }\n\n // Fallback identity used only when no detection has fired yet AND the call\n // arrives through navigator.modelContext — a call through that channel is\n // by definition an agent call, even if the specific vendor wasn't matched.\n const fallbackWebMcpIdentity: AgentIdentity = {\n class: 'webmcp',\n trust: 'detected',\n confidence: 1,\n vendor: null,\n userAgent: typeof navigator !== 'undefined' ? navigator.userAgent : null,\n detectionVersion: SDK_VERSION,\n signals: { source: 'navigator.modelContext' },\n }\n\n const webmcp = createWebMcpAdapter({\n invoke: async (tool, input) => {\n const identity = agentContext.snapshot().identity ?? fallbackWebMcpIdentity\n const result = await tools.execute(tool.name, input, identity)\n handleToolInvoked(tool.name)\n return result\n },\n })\n\n // When the ambient identity changes (late WebMCP polyfill, declared\n // identity, successful authenticate()), re-publish the WebMCP surface so\n // any agent currently bound to navigator.modelContext sees the\n // identity-gated tool set rather than the stale anonymous one.\n agentContext.subscribe((snapshot) => {\n if (!webmcp.available()) return\n webmcp.publish(surfaceFor(snapshot.identity))\n })\n\n // Kick off the initial detection cycle if the host opted in. Default is\n // on so /traces is populated with class/trust/signals without the host\n // page having to call detect() manually before each interaction.\n const autoDetectOption = options.autoDetect ?? true\n const ready: Promise<AgentIdentity | null> = autoDetectOption === false\n ? Promise.resolve(null)\n : (async () => {\n const detectOpts: DetectAgentOptions =\n autoDetectOption === true ? {} : autoDetectOption\n try {\n return await detect(detectOpts)\n } catch (err) {\n // Detection problems shouldn't crash the host's init() — log when\n // debug is on, otherwise swallow and treat as \"human or\n // undetectable agent.\"\n if (debug) console.warn('[agentronics] autoDetect failed:', err)\n return null\n }\n })()\n\n return Object.freeze({\n publishableKey,\n siteId,\n gatewayUrl,\n debug,\n memory,\n siteMemory,\n memoryCache,\n tracer,\n auth,\n agentContext,\n authz: policyEngine,\n policyCache,\n tools,\n progression,\n webmcp,\n ready,\n detect,\n authenticate: async (input: AuthInput) => {\n const identity = await auth.authenticate(input)\n agentContext.set(identity, 'authenticate')\n return identity\n },\n presentIdentity: (input: PresentIdentityOptions) => {\n const presented = identityStore.present(input)\n emitTrace({\n type: 'auth.identity_presented',\n agent: presented.identity,\n metadata: { vendor: presented.identity.vendor, class: presented.identity.class },\n })\n agentContext.set(presented.identity, 'declare')\n return presented\n },\n clearIdentity: () => {\n identityStore.clear()\n emitTrace({ type: 'auth.identity_cleared' })\n agentContext.set(null, 'cleared')\n },\n presentedIdentity: () => identityStore.snapshot(),\n setPolicies: (rules: PolicyRule[]) => {\n policyEngine.set(rules)\n emitTrace({ type: 'authz.policies_set', metadata: { count: rules.length } })\n },\n listPolicies: () => policyEngine.list(),\n syncPolicies: async () => {\n const snapshot = await policyCache.sync()\n policyEngine.set(snapshot.policies)\n emitTrace({ type: 'authz.policies_set', metadata: { count: snapshot.policies.length, synced: true } })\n return snapshot.policies\n },\n syncSiteMemory: async () => {\n const snapshot = await memoryCache.sync()\n if (snapshot.memory) {\n siteMemory.replace(snapshot.memory)\n emitTrace({\n type: 'memory.updated',\n metadata: { kind: 'site', operation: 'sync', etag: snapshot.etag },\n })\n }\n return snapshot.memory\n },\n provideSiteMemory: (next: Partial<SiteMemory>) => siteMemory.provide(next),\n provideForPage: (input: ProvideForPageInput) => {\n siteMemory.provideForPage(input)\n },\n installMemoryDelivery: ({ metaTags = true, overlay = false } = {}) => {\n const handles: Array<{ uninstall: () => void }> = []\n if (metaTags) handles.push(installMetaTags({ snapshot: siteMemory.snapshot() }))\n if (overlay) handles.push(installMemoryOverlay({ snapshot: siteMemory.snapshot() }))\n return {\n uninstall: () => {\n handles.forEach((handle) => handle.uninstall())\n },\n }\n },\n fetchWellKnown: async (origin?: string) => {\n const wellKnownOptions: Parameters<typeof fetchWellKnownContext>[0] = {}\n if (origin !== undefined) wellKnownOptions.origin = origin\n const memorySnapshot = await fetchWellKnownContext(wellKnownOptions)\n if (memorySnapshot) {\n siteMemory.replace(memorySnapshot)\n emitTrace({\n type: 'memory.updated',\n metadata: { kind: 'site', operation: 'wellKnown', origin: origin ?? null },\n })\n }\n return memorySnapshot\n },\n installDomEnforcer: () =>\n installDomEnforcer({\n policyEngine,\n getIdentity: () => detect({ webmcp: { pollMs: 0 } }),\n }),\n registerTool: (tool: GovernedTool) => tools.register(tool),\n syncTools: async () => {\n const all = tools.list({ includeDisabled: true })\n const count = await toolSync.push(all)\n emitTrace({ type: 'tool.registered', metadata: { operation: 'sync', count } })\n return count\n },\n surfaceTools: ({ identity = null }: { identity?: AgentIdentity | null } = {}) => surfaceFor(identity),\n explainSurfacing: ({ identity = null }: { identity?: AgentIdentity | null } = {}) =>\n explainSurfacing(tools.list(), surfacingContext(identity)),\n groupedTools: ({ identity = null }: { identity?: AgentIdentity | null } = {}) => groupTools(surfaceFor(identity)),\n estimateTokens: ({ identity = null }: { identity?: AgentIdentity | null } = {}) => estimateBudget(surfaceFor(identity)),\n publishToWebMcp: ({ identity = null }: { identity?: AgentIdentity | null } = {}) => {\n const surfaced = surfaceFor(identity)\n const result = webmcp.publish(surfaced)\n surfaced.forEach((tool) => {\n emitTrace({\n type: 'tool.surfaced',\n tool: tool.name,\n metadata: { state: 'published', trust: identity?.trust ?? null, group: tool.group ?? null },\n })\n })\n return { revoked: result.revoked, surfaced: surfaced.length }\n },\n notifyToolInvoked: (toolName: string) => handleToolInvoked(toolName),\n evaluate,\n traces: () => tracer.list(),\n clearTraces: () => tracer.clear(),\n async ping() {\n try {\n const response = await fetch(`${gatewayUrl.replace(/\\/$/, '')}/v1/health`, {\n method: 'GET',\n headers: { authorization: `Bearer ${publishableKey}` },\n })\n if (!response.ok) {\n return { ok: false as const, status: response.status, error: `gateway returned ${response.status}` }\n }\n const body = (await response.json().catch(() => null)) ?? {}\n return { ok: true as const, status: response.status, body }\n } catch (error) {\n return {\n ok: false as const,\n status: 0,\n error: error instanceof Error ? error.message : String(error),\n }\n }\n },\n })\n}\n","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 type TraceExporter,\n type TraceInput,\n type Tracer,\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}\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}\n\nexport const Agentronics = { init, declareAgent, detectAgent }\n\nexport const VERSION = '0.1.0'\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js","../../protocol/src/apiKey.ts","../../protocol/src/agent.ts","../../protocol/src/auth.ts","../../protocol/src/policy.ts","../../protocol/src/memory.ts","../../protocol/src/tools.ts","../../protocol/src/trace.ts","../../protocol/src/errors.ts","../src/version.ts","../src/detection/webmcp.ts","../src/detection/crawler.ts","../src/detection/dom.ts","../src/detection/detectors/registry.ts","../src/detection/declare.ts","../src/detection/detectors/signatureLoader.ts","../src/detection/index.ts","../src/auth/identity.ts","../src/auth/trustLevel.ts","../src/auth/methods/bearer.ts","../src/auth/methods/detectionAsAuth.ts","../src/auth/methods/extensionToken.ts","../src/auth/methods/mtls.ts","../src/auth/methods/oauth2.ts","../src/auth/methods/selfDeclaration.ts","../src/auth/methods/sessionLink.ts","../src/auth/methods/sso.ts","../src/auth/methods/spiffe.ts","../src/auth/methods/xAgentHeader.ts","../src/auth/engine.ts","../src/auth/agentContext.ts","../src/authz/rateLimiter.ts","../src/authz/engine.ts","../src/authz/policyCache.ts","../src/authz/overlay.ts","../src/authz/domEnforcer.ts","../src/memory/storage.ts","../src/memory/store.ts","../src/memory/siteMemory.ts","../src/memory/memoryCache.ts","../src/memory/delivery/webmcpContext.ts","../src/memory/delivery/metaTags.ts","../src/memory/delivery/overlay.ts","../src/memory/delivery/wellKnownClient.ts","../src/tools/registry.ts","../src/tools/toolSync.ts","../src/tools/progression.ts","../src/tools/surfacing.ts","../src/tools/groups.ts","../src/tools/tokenEstimate.ts","../src/tools/webmcpAdapter.ts","../src/observability/buffer.ts","../src/observability/sampler.ts","../src/observability/scrub.ts","../src/observability/tracer.ts","../src/observability/exporters/console.ts","../src/observability/exporters/gateway.ts","../src/observability/exporters/webhook.ts","../src/observability/exporters/intel.ts","../src/init.ts","../src/index.ts"],"names":["external_exports","__export","BRAND","DIRTY","EMPTY_PATH","INVALID","NEVER","OK","ParseStatus","ZodType","ZodAny","ZodArray","ZodBigInt","ZodBoolean","ZodBranded","ZodCatch","ZodDate","ZodDefault","ZodDiscriminatedUnion","ZodEffects","ZodEnum","ZodError","ZodFirstPartyTypeKind","ZodFunction","ZodIntersection","ZodIssueCode","ZodLazy","ZodLiteral","ZodMap","ZodNaN","ZodNativeEnum","ZodNever","ZodNull","ZodNullable","ZodNumber","ZodObject","ZodOptional","ZodParsedType","ZodPipeline","ZodPromise","ZodReadonly","ZodRecord","ZodSet","ZodString","ZodSymbol","ZodTuple","ZodUndefined","ZodUnion","ZodUnknown","ZodVoid","addIssueToContext","anyType","arrayType","bigIntType","booleanType","coerce","custom","dateType","datetimeRegex","en_default","discriminatedUnionType","effectsType","enumType","functionType","getErrorMap","getParsedType","instanceOfType","intersectionType","isAborted","isAsync","isDirty","isValid","late","lazyType","literalType","makeIssue","mapType","nanType","nativeEnumType","neverType","nullType","nullableType","numberType","objectType","objectUtil","oboolean","onumber","optionalType","ostring","pipelineType","preprocessType","promiseType","quotelessJson","recordType","setType","setErrorMap","strictObjectType","stringType","symbolType","tupleType","undefinedType","unionType","unknownType","util","voidType","_","assertIs","_arg","assertNever","_x","items","obj","item","validKeys","k","filtered","e","object","keys","key","arr","checker","val","joinValues","array","separator","value","first","second","data","_ZodError","issues","sub","subs","actualProto","_mapper","mapper","issue","fieldErrors","processError","error","curr","i","el","formErrors","firstEl","errorMap","_ctx","message","overrideErrorMap","map","params","path","errorMaps","issueData","fullPath","fullIssue","errorMessage","maps","m","ctx","overrideMap","x","_ParseStatus","status","results","arrayValue","s","pairs","syncPairs","pair","finalObject","errorUtil","ParseInputLazyPath","parent","handleResult","result","processCreateParams","invalid_type_error","required_error","description","iss","input","err","maybeAsyncResult","check","getIssueProperties","setError","refinementData","refinement","def","option","incoming","transform","defaultValueFunc","catchValueFunc","This","target","cuidRegex","cuid2Regex","ulidRegex","uuidRegex","nanoidRegex","jwtRegex","durationRegex","emailRegex","_emojiRegex","emojiRegex","ipv4Regex","ipv4CidrRegex","ipv6Regex","ipv6CidrRegex","base64Regex","base64urlRegex","dateRegexSource","dateRegex","timeRegexSource","args","secondsRegexSource","secondsQuantifier","timeRegex","regex","opts","isValidIP","ip","version","isValidJWT","jwt","alg","header","base64","decoded","isValidCidr","_ZodString","tooBig","tooSmall","validation","options","minLength","maxLength","len","ch","min","max","floatSafeRemainder","step","valDecCount","stepDecCount","decCount","valInt","stepInt","_ZodNumber","kind","inclusive","_ZodBigInt","_ZodDate","minDate","maxDate","_ZodArray","schema","deepPartialify","newShape","fieldSchema","_ZodObject","shape","shapeKeys","extraKeys","keyValidator","unknownKeys","catchall","defaultError","augmentation","merging","index","mask","newField","createZodEnum","handleResults","unionErrors","childCtx","dirty","types","getDiscriminator","type","_ZodDiscriminatedUnion","discriminator","discriminatorValue","optionsMap","discriminatorValues","mergeValues","a","b","aType","bType","bKeys","sharedKeys","newObj","sharedValue","newArray","itemA","itemB","handleParsed","parsedLeft","parsedRight","merged","left","right","_ZodTuple","itemIndex","rest","schemas","_ZodRecord","keyType","valueType","third","finalMap","_ZodSet","finalizeSet","elements","parsedSet","element","minSize","maxSize","size","_ZodFunction","makeArgsIssue","makeReturnsIssue","returns","fn","me","parsedArgs","parsedReturns","returnType","func","getter","values","_ZodEnum","expectedValues","enumValues","newDef","opt","nativeEnumValues","promisified","effect","checkCtx","arg","processed","executeRefinement","acc","inner","base","preprocess","newCtx","_ZodPipeline","inResult","freeze","cleanParams","p","_params","fatal","r","_fatal","cls","PUBLISHABLE_KEY_PREFIX","SECRET_KEY_PREFIX","z","classifyApiKey","AgentClass","TrustLevel","AgentIdentity","AuthProtocol","IdentityClaim","TRUST_RANK","isHigherTrust","candidate","current","PolicyDecision","PolicyRule","PolicyEvaluation","MemoryScope","MemoryEntry","SiteMemoryPage","SiteMemoryNavigation","SiteMemorySiteMap","SiteMemoryWorkflowStep","SiteMemoryWorkflow","SiteMemoryUiHint","SiteMemoryCatalog","SiteMemoryPageContext","SiteMemory","SITE_MEMORY_DEFAULT","ToolDescriptor","ToolRegistry","TraceEventType","TraceEvent","AgentronicsError","code","SDK_VERSION","readModelContext","detectWebMcp","pollMs","start","buildIdentity","resolve","CRAWLER_SIGNATURES","detectCrawler","signatures","disable","confidence","ua","sig","HEADLESS_UA_PATTERNS","checkWebdriver","checkChromedriver","checkPlugins","desktop","empty","checkHeadlessUa","hit","re","checkLanguages","langs","checkPermissions","hasChrome","SIGNALS","detectDom","threshold","signals","totalWeight","hitWeight","name","bundledDetectors","createDetectorRegistry","initial","detectors","detector","all","includeResearch","identity","declareAgent","parsedClass","trust","createSignatureLoader","gatewayUrl","fetcher","etag","response","detectAgent","webmcp","crawler","dom","claim","createIdentityStore","presented","parsed","h","next","detected","J","deriveTrustLevel","declared","verified","linked","highestTrust","identities","best","bearer","context","detectionAsAuth","extensionToken","mtls","oauth2","identityFromClaim","selfDeclaration","sessionLink","sso","spiffe","isGoogleFlavor","xAgentHeader","vendor","rawClass","proof","defaultAuthMethods","METHOD_TO_PROTOCOL","resolveTraceProtocol","methodName","createAuthEngine","methods","onTrace","methodResults","method","winner","entry","winnerEntry","protocol","subject","trace","INITIAL","createAgentContextStore","state","listeners","notify","listener","source","memoryStorage","browserStorage","decode","raw","createRateLimiter","storage","rule","now","storageKey","existing","resetAt","count","matchTool","pattern","tool","meetsTrust","have","need","meetsClass","DEFAULT_DECISION","rateLimitKey","classPart","vendorPart","trustPart","createPolicyEngine","rules","et","rateLimiter","rate","createPolicyCache","siteId","publishableKey","snapshot","body","showDenyOverlay","durationMs","documentRef","node","installDomEnforcer","policyEngine","getIdentity","selector","handler","event","evaluation","inMemoryBackend","store","webStorageBackend","prefix","out","PREFIX","createBackends","hasWindow","session","user","isExpired","record","encode","createMemoryStore","backends","emit","scope","backend","ttl","nt","cloneSiteMemory","memory","w","stamp","createSiteMemoryStore","it","cachedSnapshot","invalidate","snap","provide","update","parts","cursor","provideForPage","P","found","createMemoryCache","createWebMcpContextTool","toolName","getSnapshot","onAccess","META_PREFIX","JSONLD_ID","safeJson","setMeta","doc","content","tag","removeByName","installMetaTags","schemaType","script","OVERLAY_ID","styles","hidden","summarize","pages","workflows","ui","installMemoryOverlay","host","WELL_KNOWN_PATH","fetchWellKnownContext","origin","signal","fetchInit","payload","serializeWellKnownContext","createToolRegistry","evaluate","setPolicies","listPolicies","identityResolver","tools","disabled","writePolicyFor","includeDisabled","resolvedIdentity","policy","output","toToolDescriptor","descriptor","createToolSync","descriptors","createProgressionStore","config","stageMap","stage","enabled","transitionTo","trigger","from","transition","t","previous","passesTrust","minTrust","passesClass","allowed","passesStage","decideSurfacing","surfaceTools","explainSurfacing","DEFAULT_GROUP","groupTools","bucket","list","listGroupNames","stableStringify","estimateToolTokens","characters","estimateBudget","perTool","sum","resolveProvider","toDescriptor","invoke","createWebMcpAdapter","handle","provider","createTraceBuffer","limit","events","clampRate","fallback","createSampler","traceRate","errorRate","random","REDACTED","cloneJson","redactPath","head","scrubValue","paths","cloned","DEFAULT_SCRUB_PATHS","defaultPageProvider","randomId","cryptoApi","createTracer","bufferSize","sessionId","scrubPaths","exporters","onExporterError","pageProvider","samplerOptions","buffer","sampler","readPage","metadata","page","R","exporter","createConsoleExporter","createGatewayExporter","batch","sleep","ms","createWebhookExporter","url","maxRetries","queueLimit","readQueue","attempt","writeQueue","queueKey","INGEST_PATH","createIntelExporter","ingestKey","endpoint","createIntelSync","post","score","DEFAULT_GATEWAY_URL","resolveGatewayUrl","provided","init","debug","policies","V","l","traceEnabled","tracerOptions","tracer","emitTrace","identityStore","authOptions","auth","agentContext","policyCache","siteMemoryOptions","siteMemory","memoryCache","toolSync","detect","detectOptions","progression","surfacingContext","surfaceFor","handleToolInvoked","fallbackWebMcpIdentity","autoDetectOption","ready","detectOpts","metaTags","overlay","handles","wellKnownOptions","memorySnapshot","surfaced","Agentronics","VERSION"],"mappings":"gDAAA,IAAA,EAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,IAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA,IAAAA,CAAAA,CAAA,EAAA,CAAAC,EAAAA,CAAAD,CAAAA,CAAA,WAAAE,EAAAA,CAAA,KAAA,CAAA,IAAAC,EAAAA,CAAA,UAAA,CAAA,IAAAC,EAAAA,CAAA,OAAA,CAAA,IAAAC,CAAAA,CAAA,KAAA,CAAA,IAAAC,GAAA,EAAA,CAAA,IAAAC,CAAAA,CAAA,WAAA,CAAA,IAAAC,CAAAA,CAAA,MAAA,CAAA,IAAAC,CAAAA,CAAA,MAAA,CAAA,IAAAC,CAAAA,CAAA,aAAAC,CAAAA,CAAA,SAAA,CAAA,IAAAC,EAAAA,CAAA,UAAA,CAAA,IAAAC,EAAAA,CAAA,UAAA,CAAA,IAAAC,EAAAA,CAAA,QAAA,CAAA,IAAAC,GAAA,OAAA,CAAA,IAAAC,EAAAA,CAAA,UAAA,CAAA,IAAAC,EAAAA,CAAA,qBAAA,CAAA,IAAAC,EAAAA,CAAA,UAAA,CAAA,IAAAC,CAAAA,CAAA,YAAAC,EAAAA,CAAA,QAAA,CAAA,IAAAC,CAAAA,CAAA,qBAAA,CAAA,IAAAC,CAAAA,CAAA,WAAA,CAAA,IAAAC,EAAAA,CAAA,eAAA,CAAA,IAAAC,GAAA,YAAA,CAAA,IAAAC,CAAAA,CAAA,OAAA,CAAA,IAAAC,EAAAA,CA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,CACR,KAAA,CAAOA,CAAAA,YAAiB,KAAA,CAAQA,CAAAA,CAAM,OAAA,CAAU,MAAA,CAAOA,CAAK,CAC9D,CACF,CACF,CACF,CAAC,CACH,ECvTO,IAAM6mB,EAAAA,CAAc,CAAE,IAAA,CAAAlC,EAAAA,CAAM,YAAA,CAAAhS,EAAAA,CAAc,WAAA,CAAAQ,EAAY,CAAA,CAEhD2T,EAAAA,CAAU","file":"index.global.js","sourcesContent":["export * from \"./errors.js\";\nexport * from \"./helpers/parseUtil.js\";\nexport * from \"./helpers/typeAliases.js\";\nexport * from \"./helpers/util.js\";\nexport * from \"./types.js\";\nexport * from \"./ZodError.js\";\n","export var util;\n(function (util) {\n util.assertEqual = (_) => { };\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && Number.isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array.map((val) => (typeof val === \"string\" ? `'${val}'` : val)).join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (util = {}));\nexport var objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (objectUtil = {}));\nexport const ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return ZodParsedType.undefined;\n case \"string\":\n return ZodParsedType.string;\n case \"number\":\n return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n case \"boolean\":\n return ZodParsedType.boolean;\n case \"function\":\n return ZodParsedType.function;\n case \"bigint\":\n return ZodParsedType.bigint;\n case \"symbol\":\n return ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return ZodParsedType.array;\n }\n if (data === null) {\n return ZodParsedType.null;\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return ZodParsedType.date;\n }\n return ZodParsedType.object;\n default:\n return ZodParsedType.unknown;\n }\n};\n","import { util } from \"./helpers/util.js\";\nexport const ZodIssueCode = util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nexport const quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nexport class ZodError extends Error {\n get errors() {\n return this.issues;\n }\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n static assert(value) {\n if (!(value instanceof ZodError)) {\n throw new Error(`Not a ZodError: ${value}`);\n }\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n const firstEl = sub.path[0];\n fieldErrors[firstEl] = fieldErrors[firstEl] || [];\n fieldErrors[firstEl].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n","import { ZodIssueCode } from \"../ZodError.js\";\nimport { util, ZodParsedType } from \"../helpers/util.js\";\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n if (issue.received === ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n break;\n case ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n break;\n case ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"bigint\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util.assertNever(issue);\n }\n return { message };\n};\nexport default errorMap;\n","import defaultErrorMap from \"./locales/en.js\";\nlet overrideErrorMap = defaultErrorMap;\nexport { defaultErrorMap };\nexport function setErrorMap(map) {\n overrideErrorMap = map;\n}\nexport function getErrorMap() {\n return overrideErrorMap;\n}\n","import { getErrorMap } from \"../errors.js\";\nimport defaultErrorMap from \"../locales/en.js\";\nexport const makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n if (issueData.message !== undefined) {\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message,\n };\n }\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: errorMessage,\n };\n};\nexport const EMPTY_PATH = [];\nexport function addIssueToContext(ctx, issueData) {\n const overrideMap = getErrorMap();\n const issue = makeIssue({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap, // contextual error map is first priority\n ctx.schemaErrorMap, // then schema-bound map if available\n overrideMap, // then global override map\n overrideMap === defaultErrorMap ? undefined : defaultErrorMap, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nexport class ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return INVALID;\n if (value.status === \"aborted\")\n return INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" && (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nexport const INVALID = Object.freeze({\n status: \"aborted\",\n});\nexport const DIRTY = (value) => ({ status: \"dirty\", value });\nexport const OK = (value) => ({ status: \"valid\", value });\nexport const isAborted = (x) => x.status === \"aborted\";\nexport const isDirty = (x) => x.status === \"dirty\";\nexport const isValid = (x) => x.status === \"valid\";\nexport const isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n","export var errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n // biome-ignore lint:\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message?.message;\n})(errorUtil || (errorUtil = {}));\n","import { ZodError, ZodIssueCode, } from \"./ZodError.js\";\nimport { defaultErrorMap, getErrorMap } from \"./errors.js\";\nimport { errorUtil } from \"./helpers/errorUtil.js\";\nimport { DIRTY, INVALID, OK, ParseStatus, addIssueToContext, isAborted, isAsync, isDirty, isValid, makeIssue, } from \"./helpers/parseUtil.js\";\nimport { util, ZodParsedType, getParsedType } from \"./helpers/util.js\";\nclass ParseInputLazyPath {\n constructor(parent, value, path, key) {\n this._cachedPath = [];\n this.parent = parent;\n this.data = value;\n this._path = path;\n this._key = key;\n }\n get path() {\n if (!this._cachedPath.length) {\n if (Array.isArray(this._key)) {\n this._cachedPath.push(...this._path, ...this._key);\n }\n else {\n this._cachedPath.push(...this._path, this._key);\n }\n }\n return this._cachedPath;\n }\n}\nconst handleResult = (ctx, result) => {\n if (isValid(result)) {\n return { success: true, data: result.value };\n }\n else {\n if (!ctx.common.issues.length) {\n throw new Error(\"Validation failed but no issues detected.\");\n }\n return {\n success: false,\n get error() {\n if (this._error)\n return this._error;\n const error = new ZodError(ctx.common.issues);\n this._error = error;\n return this._error;\n },\n };\n }\n};\nfunction processCreateParams(params) {\n if (!params)\n return {};\n const { errorMap, invalid_type_error, required_error, description } = params;\n if (errorMap && (invalid_type_error || required_error)) {\n throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n }\n if (errorMap)\n return { errorMap: errorMap, description };\n const customMap = (iss, ctx) => {\n const { message } = params;\n if (iss.code === \"invalid_enum_value\") {\n return { message: message ?? ctx.defaultError };\n }\n if (typeof ctx.data === \"undefined\") {\n return { message: message ?? required_error ?? ctx.defaultError };\n }\n if (iss.code !== \"invalid_type\")\n return { message: ctx.defaultError };\n return { message: message ?? invalid_type_error ?? ctx.defaultError };\n };\n return { errorMap: customMap, description };\n}\nexport class ZodType {\n get description() {\n return this._def.description;\n }\n _getType(input) {\n return getParsedType(input.data);\n }\n _getOrReturnCtx(input, ctx) {\n return (ctx || {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n });\n }\n _processInputParams(input) {\n return {\n status: new ParseStatus(),\n ctx: {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n },\n };\n }\n _parseSync(input) {\n const result = this._parse(input);\n if (isAsync(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }\n _parseAsync(input) {\n const result = this._parse(input);\n return Promise.resolve(result);\n }\n parse(data, params) {\n const result = this.safeParse(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n safeParse(data, params) {\n const ctx = {\n common: {\n issues: [],\n async: params?.async ?? false,\n contextualErrorMap: params?.errorMap,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n return handleResult(ctx, result);\n }\n \"~validate\"(data) {\n const ctx = {\n common: {\n issues: [],\n async: !!this[\"~standard\"].async,\n },\n path: [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n if (!this[\"~standard\"].async) {\n try {\n const result = this._parseSync({ data, path: [], parent: ctx });\n return isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n };\n }\n catch (err) {\n if (err?.message?.toLowerCase()?.includes(\"encountered\")) {\n this[\"~standard\"].async = true;\n }\n ctx.common = {\n issues: [],\n async: true,\n };\n }\n }\n return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n });\n }\n async parseAsync(data, params) {\n const result = await this.safeParseAsync(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n async safeParseAsync(data, params) {\n const ctx = {\n common: {\n issues: [],\n contextualErrorMap: params?.errorMap,\n async: true,\n },\n path: params?.path || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });\n const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));\n return handleResult(ctx, result);\n }\n refine(check, message) {\n const getIssueProperties = (val) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n }\n else if (typeof message === \"function\") {\n return message(val);\n }\n else {\n return message;\n }\n };\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = () => ctx.addIssue({\n code: ZodIssueCode.custom,\n ...getIssueProperties(val),\n });\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n refinement(check, refinementData) {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\" ? refinementData(val, ctx) : refinementData);\n return false;\n }\n else {\n return true;\n }\n });\n }\n _refinement(refinement) {\n return new ZodEffects({\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"refinement\", refinement },\n });\n }\n superRefine(refinement) {\n return this._refinement(refinement);\n }\n constructor(def) {\n /** Alias of safeParseAsync */\n this.spa = this.safeParseAsync;\n this._def = def;\n this.parse = this.parse.bind(this);\n this.safeParse = this.safeParse.bind(this);\n this.parseAsync = this.parseAsync.bind(this);\n this.safeParseAsync = this.safeParseAsync.bind(this);\n this.spa = this.spa.bind(this);\n this.refine = this.refine.bind(this);\n this.refinement = this.refinement.bind(this);\n this.superRefine = this.superRefine.bind(this);\n this.optional = this.optional.bind(this);\n this.nullable = this.nullable.bind(this);\n this.nullish = this.nullish.bind(this);\n this.array = this.array.bind(this);\n this.promise = this.promise.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n this.transform = this.transform.bind(this);\n this.brand = this.brand.bind(this);\n this.default = this.default.bind(this);\n this.catch = this.catch.bind(this);\n this.describe = this.describe.bind(this);\n this.pipe = this.pipe.bind(this);\n this.readonly = this.readonly.bind(this);\n this.isNullable = this.isNullable.bind(this);\n this.isOptional = this.isOptional.bind(this);\n this[\"~standard\"] = {\n version: 1,\n vendor: \"zod\",\n validate: (data) => this[\"~validate\"](data),\n };\n }\n optional() {\n return ZodOptional.create(this, this._def);\n }\n nullable() {\n return ZodNullable.create(this, this._def);\n }\n nullish() {\n return this.nullable().optional();\n }\n array() {\n return ZodArray.create(this);\n }\n promise() {\n return ZodPromise.create(this, this._def);\n }\n or(option) {\n return ZodUnion.create([this, option], this._def);\n }\n and(incoming) {\n return ZodIntersection.create(this, incoming, this._def);\n }\n transform(transform) {\n return new ZodEffects({\n ...processCreateParams(this._def),\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"transform\", transform },\n });\n }\n default(def) {\n const defaultValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodDefault({\n ...processCreateParams(this._def),\n innerType: this,\n defaultValue: defaultValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n });\n }\n brand() {\n return new ZodBranded({\n typeName: ZodFirstPartyTypeKind.ZodBranded,\n type: this,\n ...processCreateParams(this._def),\n });\n }\n catch(def) {\n const catchValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodCatch({\n ...processCreateParams(this._def),\n innerType: this,\n catchValue: catchValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n });\n }\n describe(description) {\n const This = this.constructor;\n return new This({\n ...this._def,\n description,\n });\n }\n pipe(target) {\n return ZodPipeline.create(this, target);\n }\n readonly() {\n return ZodReadonly.create(this);\n }\n isOptional() {\n return this.safeParse(undefined).success;\n }\n isNullable() {\n return this.safeParse(null).success;\n }\n}\nconst cuidRegex = /^c[^\\s-]{8,}$/i;\nconst cuid2Regex = /^[0-9a-z]+$/;\nconst ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;\n// const uuidRegex =\n// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;\nconst uuidRegex = /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/i;\nconst nanoidRegex = /^[a-z0-9_-]{21}$/i;\nconst jwtRegex = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\nconst durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n// from https://stackoverflow.com/a/46181/1550155\n// old version: too slow, didn't support unicode\n// const emailRegex = /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i;\n//old email regex\n// const emailRegex = /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@((?!-)([^<>()[\\].,;:\\s@\"]+\\.)+[^<>()[\\].,;:\\s@\"]{1,})[^-<>()[\\].,;:\\s@\"]$/i;\n// eslint-disable-next-line\n// const emailRegex =\n// /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\])|(\\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\\.[A-Za-z]{2,})+))$/;\n// const emailRegex =\n// /^[a-zA-Z0-9\\.\\!\\#\\$\\%\\&\\'\\*\\+\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~\\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// const emailRegex =\n// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i;\nconst emailRegex = /^(?!\\.)(?!.*\\.\\.)([A-Z0-9_'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;\n// const emailRegex =\n// /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\\.[a-z0-9\\-]+)*$/i;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emojiRegex = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nlet emojiRegex;\n// faster, simpler, safer\nconst ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nconst ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/(3[0-2]|[12]?[0-9])$/;\n// const ipv6Regex =\n// /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;\nconst ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;\nconst ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nconst base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;\n// https://base64.guru/standards/base64url\nconst base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;\n// simple\n// const dateRegexSource = `\\\\d{4}-\\\\d{2}-\\\\d{2}`;\n// no leap year validation\n// const dateRegexSource = `\\\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\\\d|2\\\\d))`;\n// with leap year validation\nconst dateRegexSource = `((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))`;\nconst dateRegex = new RegExp(`^${dateRegexSource}$`);\nfunction timeRegexSource(args) {\n let secondsRegexSource = `[0-5]\\\\d`;\n if (args.precision) {\n secondsRegexSource = `${secondsRegexSource}\\\\.\\\\d{${args.precision}}`;\n }\n else if (args.precision == null) {\n secondsRegexSource = `${secondsRegexSource}(\\\\.\\\\d+)?`;\n }\n const secondsQuantifier = args.precision ? \"+\" : \"?\"; // require seconds if precision is nonzero\n return `([01]\\\\d|2[0-3]):[0-5]\\\\d(:${secondsRegexSource})${secondsQuantifier}`;\n}\nfunction timeRegex(args) {\n return new RegExp(`^${timeRegexSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetimeRegex(args) {\n let regex = `${dateRegexSource}T${timeRegexSource(args)}`;\n const opts = [];\n opts.push(args.local ? `Z?` : `Z`);\n if (args.offset)\n opts.push(`([+-]\\\\d{2}:?\\\\d{2})`);\n regex = `${regex}(${opts.join(\"|\")})`;\n return new RegExp(`^${regex}$`);\n}\nfunction isValidIP(ip, version) {\n if ((version === \"v4\" || !version) && ipv4Regex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6Regex.test(ip)) {\n return true;\n }\n return false;\n}\nfunction isValidJWT(jwt, alg) {\n if (!jwtRegex.test(jwt))\n return false;\n try {\n const [header] = jwt.split(\".\");\n if (!header)\n return false;\n // Convert base64url to base64\n const base64 = header\n .replace(/-/g, \"+\")\n .replace(/_/g, \"/\")\n .padEnd(header.length + ((4 - (header.length % 4)) % 4), \"=\");\n const decoded = JSON.parse(atob(base64));\n if (typeof decoded !== \"object\" || decoded === null)\n return false;\n if (\"typ\" in decoded && decoded?.typ !== \"JWT\")\n return false;\n if (!decoded.alg)\n return false;\n if (alg && decoded.alg !== alg)\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nfunction isValidCidr(ip, version) {\n if ((version === \"v4\" || !version) && ipv4CidrRegex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6CidrRegex.test(ip)) {\n return true;\n }\n return false;\n}\nexport class ZodString extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.string) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.string,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n else if (tooSmall) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n status.dirty();\n }\n }\n else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"email\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"emoji\") {\n if (!emojiRegex) {\n emojiRegex = new RegExp(_emojiRegex, \"u\");\n }\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"emoji\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"uuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"nanoid\") {\n if (!nanoidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"nanoid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid2\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ulid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"url\") {\n try {\n new URL(input.data);\n }\n catch {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"regex\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n }\n else if (check.kind === \"includes\") {\n if (!input.data.includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n }\n else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n }\n else if (check.kind === \"startsWith\") {\n if (!input.data.startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"endsWith\") {\n if (!input.data.endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"date\") {\n const regex = dateRegex;\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"date\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"time\") {\n const regex = timeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"time\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"duration\") {\n if (!durationRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"duration\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ip\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"jwt\") {\n if (!isValidJWT(input.data, check.alg)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"jwt\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cidr\") {\n if (!isValidCidr(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cidr\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64\") {\n if (!base64Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64url\") {\n if (!base64urlRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _regex(regex, validation, message) {\n return this.refinement((data) => regex.test(data), {\n validation,\n code: ZodIssueCode.invalid_string,\n ...errorUtil.errToObj(message),\n });\n }\n _addCheck(check) {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n email(message) {\n return this._addCheck({ kind: \"email\", ...errorUtil.errToObj(message) });\n }\n url(message) {\n return this._addCheck({ kind: \"url\", ...errorUtil.errToObj(message) });\n }\n emoji(message) {\n return this._addCheck({ kind: \"emoji\", ...errorUtil.errToObj(message) });\n }\n uuid(message) {\n return this._addCheck({ kind: \"uuid\", ...errorUtil.errToObj(message) });\n }\n nanoid(message) {\n return this._addCheck({ kind: \"nanoid\", ...errorUtil.errToObj(message) });\n }\n cuid(message) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil.errToObj(message) });\n }\n cuid2(message) {\n return this._addCheck({ kind: \"cuid2\", ...errorUtil.errToObj(message) });\n }\n ulid(message) {\n return this._addCheck({ kind: \"ulid\", ...errorUtil.errToObj(message) });\n }\n base64(message) {\n return this._addCheck({ kind: \"base64\", ...errorUtil.errToObj(message) });\n }\n base64url(message) {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return this._addCheck({\n kind: \"base64url\",\n ...errorUtil.errToObj(message),\n });\n }\n jwt(options) {\n return this._addCheck({ kind: \"jwt\", ...errorUtil.errToObj(options) });\n }\n ip(options) {\n return this._addCheck({ kind: \"ip\", ...errorUtil.errToObj(options) });\n }\n cidr(options) {\n return this._addCheck({ kind: \"cidr\", ...errorUtil.errToObj(options) });\n }\n datetime(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"datetime\",\n precision: null,\n offset: false,\n local: false,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"datetime\",\n precision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n offset: options?.offset ?? false,\n local: options?.local ?? false,\n ...errorUtil.errToObj(options?.message),\n });\n }\n date(message) {\n return this._addCheck({ kind: \"date\", message });\n }\n time(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"time\",\n precision: null,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"time\",\n precision: typeof options?.precision === \"undefined\" ? null : options?.precision,\n ...errorUtil.errToObj(options?.message),\n });\n }\n duration(message) {\n return this._addCheck({ kind: \"duration\", ...errorUtil.errToObj(message) });\n }\n regex(regex, message) {\n return this._addCheck({\n kind: \"regex\",\n regex: regex,\n ...errorUtil.errToObj(message),\n });\n }\n includes(value, options) {\n return this._addCheck({\n kind: \"includes\",\n value: value,\n position: options?.position,\n ...errorUtil.errToObj(options?.message),\n });\n }\n startsWith(value, message) {\n return this._addCheck({\n kind: \"startsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n endsWith(value, message) {\n return this._addCheck({\n kind: \"endsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n min(minLength, message) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil.errToObj(message),\n });\n }\n max(maxLength, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxLength,\n ...errorUtil.errToObj(message),\n });\n }\n length(len, message) {\n return this._addCheck({\n kind: \"length\",\n value: len,\n ...errorUtil.errToObj(message),\n });\n }\n /**\n * Equivalent to `.min(1)`\n */\n nonempty(message) {\n return this.min(1, errorUtil.errToObj(message));\n }\n trim() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"trim\" }],\n });\n }\n toLowerCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toLowerCase\" }],\n });\n }\n toUpperCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toUpperCase\" }],\n });\n }\n get isDatetime() {\n return !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n }\n get isDate() {\n return !!this._def.checks.find((ch) => ch.kind === \"date\");\n }\n get isTime() {\n return !!this._def.checks.find((ch) => ch.kind === \"time\");\n }\n get isDuration() {\n return !!this._def.checks.find((ch) => ch.kind === \"duration\");\n }\n get isEmail() {\n return !!this._def.checks.find((ch) => ch.kind === \"email\");\n }\n get isURL() {\n return !!this._def.checks.find((ch) => ch.kind === \"url\");\n }\n get isEmoji() {\n return !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n }\n get isUUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n }\n get isNANOID() {\n return !!this._def.checks.find((ch) => ch.kind === \"nanoid\");\n }\n get isCUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n }\n get isCUID2() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n }\n get isULID() {\n return !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n }\n get isIP() {\n return !!this._def.checks.find((ch) => ch.kind === \"ip\");\n }\n get isCIDR() {\n return !!this._def.checks.find((ch) => ch.kind === \"cidr\");\n }\n get isBase64() {\n return !!this._def.checks.find((ch) => ch.kind === \"base64\");\n }\n get isBase64url() {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return !!this._def.checks.find((ch) => ch.kind === \"base64url\");\n }\n get minLength() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxLength() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodString.create = (params) => {\n return new ZodString({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodString,\n coerce: params?.coerce ?? false,\n ...processCreateParams(params),\n });\n};\n// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034\nfunction floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nexport class ZodNumber extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n this.step = this.multipleOf;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Number(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.number) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.number,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"int\") {\n if (!util.isInteger(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: \"integer\",\n received: \"float\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (floatSafeRemainder(input.data, check.value) !== 0) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"finite\") {\n if (!Number.isFinite(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_finite,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodNumber({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodNumber({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n int(message) {\n return this._addCheck({\n kind: \"int\",\n message: errorUtil.toString(message),\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value: value,\n message: errorUtil.toString(message),\n });\n }\n finite(message) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil.toString(message),\n });\n }\n safe(message) {\n return this._addCheck({\n kind: \"min\",\n inclusive: true,\n value: Number.MIN_SAFE_INTEGER,\n message: errorUtil.toString(message),\n })._addCheck({\n kind: \"max\",\n inclusive: true,\n value: Number.MAX_SAFE_INTEGER,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n get isInt() {\n return !!this._def.checks.find((ch) => ch.kind === \"int\" || (ch.kind === \"multipleOf\" && util.isInteger(ch.value)));\n }\n get isFinite() {\n let max = null;\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"finite\" || ch.kind === \"int\" || ch.kind === \"multipleOf\") {\n return true;\n }\n else if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n else if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return Number.isFinite(min) && Number.isFinite(max);\n }\n}\nZodNumber.create = (params) => {\n return new ZodNumber({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodNumber,\n coerce: params?.coerce || false,\n ...processCreateParams(params),\n });\n};\nexport class ZodBigInt extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n }\n _parse(input) {\n if (this._def.coerce) {\n try {\n input.data = BigInt(input.data);\n }\n catch {\n return this._getInvalidInput(input);\n }\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.bigint) {\n return this._getInvalidInput(input);\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _getInvalidInput(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.bigint,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodBigInt({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodBigInt({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodBigInt.create = (params) => {\n return new ZodBigInt({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodBigInt,\n coerce: params?.coerce ?? false,\n ...processCreateParams(params),\n });\n};\nexport class ZodBoolean extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = Boolean(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.boolean) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.boolean,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodBoolean.create = (params) => {\n return new ZodBoolean({\n typeName: ZodFirstPartyTypeKind.ZodBoolean,\n coerce: params?.coerce || false,\n ...processCreateParams(params),\n });\n};\nexport class ZodDate extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = new Date(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.date) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (Number.isNaN(input.data.getTime())) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_date,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.getTime() < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n message: check.message,\n inclusive: true,\n exact: false,\n minimum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.getTime() > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n message: check.message,\n inclusive: true,\n exact: false,\n maximum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return {\n status: status.value,\n value: new Date(input.data.getTime()),\n };\n }\n _addCheck(check) {\n return new ZodDate({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n min(minDate, message) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n max(maxDate, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n get minDate() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min != null ? new Date(min) : null;\n }\n get maxDate() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max != null ? new Date(max) : null;\n }\n}\nZodDate.create = (params) => {\n return new ZodDate({\n checks: [],\n coerce: params?.coerce || false,\n typeName: ZodFirstPartyTypeKind.ZodDate,\n ...processCreateParams(params),\n });\n};\nexport class ZodSymbol extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.symbol) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.symbol,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodSymbol.create = (params) => {\n return new ZodSymbol({\n typeName: ZodFirstPartyTypeKind.ZodSymbol,\n ...processCreateParams(params),\n });\n};\nexport class ZodUndefined extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.undefined,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodUndefined.create = (params) => {\n return new ZodUndefined({\n typeName: ZodFirstPartyTypeKind.ZodUndefined,\n ...processCreateParams(params),\n });\n};\nexport class ZodNull extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.null) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.null,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodNull.create = (params) => {\n return new ZodNull({\n typeName: ZodFirstPartyTypeKind.ZodNull,\n ...processCreateParams(params),\n });\n};\nexport class ZodAny extends ZodType {\n constructor() {\n super(...arguments);\n // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.\n this._any = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodAny.create = (params) => {\n return new ZodAny({\n typeName: ZodFirstPartyTypeKind.ZodAny,\n ...processCreateParams(params),\n });\n};\nexport class ZodUnknown extends ZodType {\n constructor() {\n super(...arguments);\n // required\n this._unknown = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodUnknown.create = (params) => {\n return new ZodUnknown({\n typeName: ZodFirstPartyTypeKind.ZodUnknown,\n ...processCreateParams(params),\n });\n};\nexport class ZodNever extends ZodType {\n _parse(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.never,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n}\nZodNever.create = (params) => {\n return new ZodNever({\n typeName: ZodFirstPartyTypeKind.ZodNever,\n ...processCreateParams(params),\n });\n};\nexport class ZodVoid extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.void,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodVoid.create = (params) => {\n return new ZodVoid({\n typeName: ZodFirstPartyTypeKind.ZodVoid,\n ...processCreateParams(params),\n });\n};\nexport class ZodArray extends ZodType {\n _parse(input) {\n const { ctx, status } = this._processInputParams(input);\n const def = this._def;\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (def.exactLength !== null) {\n const tooBig = ctx.data.length > def.exactLength.value;\n const tooSmall = ctx.data.length < def.exactLength.value;\n if (tooBig || tooSmall) {\n addIssueToContext(ctx, {\n code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,\n minimum: (tooSmall ? def.exactLength.value : undefined),\n maximum: (tooBig ? def.exactLength.value : undefined),\n type: \"array\",\n inclusive: true,\n exact: true,\n message: def.exactLength.message,\n });\n status.dirty();\n }\n }\n if (def.minLength !== null) {\n if (ctx.data.length < def.minLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.minLength.message,\n });\n status.dirty();\n }\n }\n if (def.maxLength !== null) {\n if (ctx.data.length > def.maxLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.maxLength.message,\n });\n status.dirty();\n }\n }\n if (ctx.common.async) {\n return Promise.all([...ctx.data].map((item, i) => {\n return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n })).then((result) => {\n return ParseStatus.mergeArray(status, result);\n });\n }\n const result = [...ctx.data].map((item, i) => {\n return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n });\n return ParseStatus.mergeArray(status, result);\n }\n get element() {\n return this._def.type;\n }\n min(minLength, message) {\n return new ZodArray({\n ...this._def,\n minLength: { value: minLength, message: errorUtil.toString(message) },\n });\n }\n max(maxLength, message) {\n return new ZodArray({\n ...this._def,\n maxLength: { value: maxLength, message: errorUtil.toString(message) },\n });\n }\n length(len, message) {\n return new ZodArray({\n ...this._def,\n exactLength: { value: len, message: errorUtil.toString(message) },\n });\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodArray.create = (schema, params) => {\n return new ZodArray({\n type: schema,\n minLength: null,\n maxLength: null,\n exactLength: null,\n typeName: ZodFirstPartyTypeKind.ZodArray,\n ...processCreateParams(params),\n });\n};\nfunction deepPartialify(schema) {\n if (schema instanceof ZodObject) {\n const newShape = {};\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: () => newShape,\n });\n }\n else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element),\n });\n }\n else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n }\n else {\n return schema;\n }\n}\nexport class ZodObject extends ZodType {\n constructor() {\n super(...arguments);\n this._cached = null;\n /**\n * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n * If you want to pass through unknown properties, use `.passthrough()` instead.\n */\n this.nonstrict = this.passthrough;\n // extend<\n // Augmentation extends ZodRawShape,\n // NewOutput extends util.flatten<{\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // }>,\n // NewInput extends util.flatten<{\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }>\n // >(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<T, Augmentation>,\n // UnknownKeys,\n // Catchall,\n // NewOutput,\n // NewInput\n // > {\n // return new ZodObject({\n // ...this._def,\n // shape: () => ({\n // ...this._def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // }\n /**\n * @deprecated Use `.extend` instead\n * */\n this.augment = this.extend;\n }\n _getCached() {\n if (this._cached !== null)\n return this._cached;\n const shape = this._def.shape();\n const keys = util.objectKeys(shape);\n this._cached = { shape, keys };\n return this._cached;\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.object) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const { status, ctx } = this._processInputParams(input);\n const { shape, keys: shapeKeys } = this._getCached();\n const extraKeys = [];\n if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === \"strip\")) {\n for (const key in ctx.data) {\n if (!shapeKeys.includes(key)) {\n extraKeys.push(key);\n }\n }\n }\n const pairs = [];\n for (const key of shapeKeys) {\n const keyValidator = shape[key];\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (this._def.catchall instanceof ZodNever) {\n const unknownKeys = this._def.unknownKeys;\n if (unknownKeys === \"passthrough\") {\n for (const key of extraKeys) {\n pairs.push({\n key: { status: \"valid\", value: key },\n value: { status: \"valid\", value: ctx.data[key] },\n });\n }\n }\n else if (unknownKeys === \"strict\") {\n if (extraKeys.length > 0) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.unrecognized_keys,\n keys: extraKeys,\n });\n status.dirty();\n }\n }\n else if (unknownKeys === \"strip\") {\n }\n else {\n throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n }\n }\n else {\n // run catchall validation\n const catchall = this._def.catchall;\n for (const key of extraKeys) {\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)\n ),\n alwaysSet: key in ctx.data,\n });\n }\n }\n if (ctx.common.async) {\n return Promise.resolve()\n .then(async () => {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n alwaysSet: pair.alwaysSet,\n });\n }\n return syncPairs;\n })\n .then((syncPairs) => {\n return ParseStatus.mergeObjectSync(status, syncPairs);\n });\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get shape() {\n return this._def.shape();\n }\n strict(message) {\n errorUtil.errToObj;\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strict\",\n ...(message !== undefined\n ? {\n errorMap: (issue, ctx) => {\n const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;\n if (issue.code === \"unrecognized_keys\")\n return {\n message: errorUtil.errToObj(message).message ?? defaultError,\n };\n return {\n message: defaultError,\n };\n },\n }\n : {}),\n });\n }\n strip() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strip\",\n });\n }\n passthrough() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"passthrough\",\n });\n }\n // const AugmentFactory =\n // <Def extends ZodObjectDef>(def: Def) =>\n // <Augmentation extends ZodRawShape>(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<ReturnType<Def[\"shape\"]>, Augmentation>,\n // Def[\"unknownKeys\"],\n // Def[\"catchall\"]\n // > => {\n // return new ZodObject({\n // ...def,\n // shape: () => ({\n // ...def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // };\n extend(augmentation) {\n return new ZodObject({\n ...this._def,\n shape: () => ({\n ...this._def.shape(),\n ...augmentation,\n }),\n });\n }\n /**\n * Prior to zod@1.0.12 there was a bug in the\n * inferred type of merged objects. Please\n * upgrade if you are experiencing issues.\n */\n merge(merging) {\n const merged = new ZodObject({\n unknownKeys: merging._def.unknownKeys,\n catchall: merging._def.catchall,\n shape: () => ({\n ...this._def.shape(),\n ...merging._def.shape(),\n }),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n });\n return merged;\n }\n // merge<\n // Incoming extends AnyZodObject,\n // Augmentation extends Incoming[\"shape\"],\n // NewOutput extends {\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // },\n // NewInput extends {\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }\n // >(\n // merging: Incoming\n // ): ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"],\n // NewOutput,\n // NewInput\n // > {\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n setKey(key, schema) {\n return this.augment({ [key]: schema });\n }\n // merge<Incoming extends AnyZodObject>(\n // merging: Incoming\n // ): //ZodObject<T & Incoming[\"_shape\"], UnknownKeys, Catchall> = (merging) => {\n // ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"]\n // > {\n // // const mergedShape = objectUtil.mergeShapes(\n // // this._def.shape(),\n // // merging._def.shape()\n // // );\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n catchall(index) {\n return new ZodObject({\n ...this._def,\n catchall: index,\n });\n }\n pick(mask) {\n const shape = {};\n for (const key of util.objectKeys(mask)) {\n if (mask[key] && this.shape[key]) {\n shape[key] = this.shape[key];\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n omit(mask) {\n const shape = {};\n for (const key of util.objectKeys(this.shape)) {\n if (!mask[key]) {\n shape[key] = this.shape[key];\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n /**\n * @deprecated\n */\n deepPartial() {\n return deepPartialify(this);\n }\n partial(mask) {\n const newShape = {};\n for (const key of util.objectKeys(this.shape)) {\n const fieldSchema = this.shape[key];\n if (mask && !mask[key]) {\n newShape[key] = fieldSchema;\n }\n else {\n newShape[key] = fieldSchema.optional();\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n required(mask) {\n const newShape = {};\n for (const key of util.objectKeys(this.shape)) {\n if (mask && !mask[key]) {\n newShape[key] = this.shape[key];\n }\n else {\n const fieldSchema = this.shape[key];\n let newField = fieldSchema;\n while (newField instanceof ZodOptional) {\n newField = newField._def.innerType;\n }\n newShape[key] = newField;\n }\n }\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n keyof() {\n return createZodEnum(util.objectKeys(this.shape));\n }\n}\nZodObject.create = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.strictCreate = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strict\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.lazycreate = (shape, params) => {\n return new ZodObject({\n shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nexport class ZodUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const options = this._def.options;\n function handleResults(results) {\n // return first issue-free validation if it exists\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n // add issues from dirty option\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n // return invalid\n const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return Promise.all(options.map(async (option) => {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n return {\n result: await option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n }),\n ctx: childCtx,\n };\n })).then(handleResults);\n }\n else {\n let dirty = undefined;\n const issues = [];\n for (const option of options) {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n const result = option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n });\n if (result.status === \"valid\") {\n return result;\n }\n else if (result.status === \"dirty\" && !dirty) {\n dirty = { result, ctx: childCtx };\n }\n if (childCtx.common.issues.length) {\n issues.push(childCtx.common.issues);\n }\n }\n if (dirty) {\n ctx.common.issues.push(...dirty.ctx.common.issues);\n return dirty.result;\n }\n const unionErrors = issues.map((issues) => new ZodError(issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n }\n get options() {\n return this._def.options;\n }\n}\nZodUnion.create = (types, params) => {\n return new ZodUnion({\n options: types,\n typeName: ZodFirstPartyTypeKind.ZodUnion,\n ...processCreateParams(params),\n });\n};\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\n////////// //////////\n////////// ZodDiscriminatedUnion //////////\n////////// //////////\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\nconst getDiscriminator = (type) => {\n if (type instanceof ZodLazy) {\n return getDiscriminator(type.schema);\n }\n else if (type instanceof ZodEffects) {\n return getDiscriminator(type.innerType());\n }\n else if (type instanceof ZodLiteral) {\n return [type.value];\n }\n else if (type instanceof ZodEnum) {\n return type.options;\n }\n else if (type instanceof ZodNativeEnum) {\n // eslint-disable-next-line ban/ban\n return util.objectValues(type.enum);\n }\n else if (type instanceof ZodDefault) {\n return getDiscriminator(type._def.innerType);\n }\n else if (type instanceof ZodUndefined) {\n return [undefined];\n }\n else if (type instanceof ZodNull) {\n return [null];\n }\n else if (type instanceof ZodOptional) {\n return [undefined, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodNullable) {\n return [null, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodBranded) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodReadonly) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodCatch) {\n return getDiscriminator(type._def.innerType);\n }\n else {\n return [];\n }\n};\nexport class ZodDiscriminatedUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const discriminator = this.discriminator;\n const discriminatorValue = ctx.data[discriminator];\n const option = this.optionsMap.get(discriminatorValue);\n if (!option) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union_discriminator,\n options: Array.from(this.optionsMap.keys()),\n path: [discriminator],\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n else {\n return option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n get discriminator() {\n return this._def.discriminator;\n }\n get options() {\n return this._def.options;\n }\n get optionsMap() {\n return this._def.optionsMap;\n }\n /**\n * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n * However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n * have a different value for each object in the union.\n * @param discriminator the name of the discriminator property\n * @param types an array of object schemas\n * @param params\n */\n static create(discriminator, options, params) {\n // Get all the valid discriminator values\n const optionsMap = new Map();\n // try {\n for (const type of options) {\n const discriminatorValues = getDiscriminator(type.shape[discriminator]);\n if (!discriminatorValues.length) {\n throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n }\n for (const value of discriminatorValues) {\n if (optionsMap.has(value)) {\n throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n }\n optionsMap.set(value, type);\n }\n }\n return new ZodDiscriminatedUnion({\n typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n discriminator,\n options,\n optionsMap,\n ...processCreateParams(params),\n });\n }\n}\nfunction mergeValues(a, b) {\n const aType = getParsedType(a);\n const bType = getParsedType(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {\n const bKeys = util.objectKeys(b);\n const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {\n if (a.length !== b.length) {\n return { valid: false };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {\n return { valid: true, data: a };\n }\n else {\n return { valid: false };\n }\n}\nexport class ZodIntersection extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = (parsedLeft, parsedRight) => {\n if (isAborted(parsedLeft) || isAborted(parsedRight)) {\n return INVALID;\n }\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n if (!merged.valid) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_intersection_types,\n });\n return INVALID;\n }\n if (isDirty(parsedLeft) || isDirty(parsedRight)) {\n status.dirty();\n }\n return { status: status.value, value: merged.data };\n };\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n ]).then(([left, right]) => handleParsed(left, right));\n }\n else {\n return handleParsed(this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }), this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }));\n }\n }\n}\nZodIntersection.create = (left, right, params) => {\n return new ZodIntersection({\n left: left,\n right: right,\n typeName: ZodFirstPartyTypeKind.ZodIntersection,\n ...processCreateParams(params),\n });\n};\n// type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];\nexport class ZodTuple extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (ctx.data.length < this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n return INVALID;\n }\n const rest = this._def.rest;\n if (!rest && ctx.data.length > this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n status.dirty();\n }\n const items = [...ctx.data]\n .map((item, itemIndex) => {\n const schema = this._def.items[itemIndex] || this._def.rest;\n if (!schema)\n return null;\n return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n })\n .filter((x) => !!x); // filter nulls\n if (ctx.common.async) {\n return Promise.all(items).then((results) => {\n return ParseStatus.mergeArray(status, results);\n });\n }\n else {\n return ParseStatus.mergeArray(status, items);\n }\n }\n get items() {\n return this._def.items;\n }\n rest(rest) {\n return new ZodTuple({\n ...this._def,\n rest,\n });\n }\n}\nZodTuple.create = (schemas, params) => {\n if (!Array.isArray(schemas)) {\n throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n }\n return new ZodTuple({\n items: schemas,\n typeName: ZodFirstPartyTypeKind.ZodTuple,\n rest: null,\n ...processCreateParams(params),\n });\n};\nexport class ZodRecord extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const pairs = [];\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (ctx.common.async) {\n return ParseStatus.mergeObjectAsync(status, pairs);\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get element() {\n return this._def.valueType;\n }\n static create(first, second, third) {\n if (second instanceof ZodType) {\n return new ZodRecord({\n keyType: first,\n valueType: second,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(third),\n });\n }\n return new ZodRecord({\n keyType: ZodString.create(),\n valueType: first,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(second),\n });\n }\n}\nexport class ZodMap extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.map) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.map,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n const pairs = [...ctx.data.entries()].map(([key, value], index) => {\n return {\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"])),\n };\n });\n if (ctx.common.async) {\n const finalMap = new Map();\n return Promise.resolve().then(async () => {\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n });\n }\n else {\n const finalMap = new Map();\n for (const pair of pairs) {\n const key = pair.key;\n const value = pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n }\n }\n}\nZodMap.create = (keyType, valueType, params) => {\n return new ZodMap({\n valueType,\n keyType,\n typeName: ZodFirstPartyTypeKind.ZodMap,\n ...processCreateParams(params),\n });\n};\nexport class ZodSet extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.set) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.set,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const def = this._def;\n if (def.minSize !== null) {\n if (ctx.data.size < def.minSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.minSize.message,\n });\n status.dirty();\n }\n }\n if (def.maxSize !== null) {\n if (ctx.data.size > def.maxSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.maxSize.message,\n });\n status.dirty();\n }\n }\n const valueType = this._def.valueType;\n function finalizeSet(elements) {\n const parsedSet = new Set();\n for (const element of elements) {\n if (element.status === \"aborted\")\n return INVALID;\n if (element.status === \"dirty\")\n status.dirty();\n parsedSet.add(element.value);\n }\n return { status: status.value, value: parsedSet };\n }\n const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n if (ctx.common.async) {\n return Promise.all(elements).then((elements) => finalizeSet(elements));\n }\n else {\n return finalizeSet(elements);\n }\n }\n min(minSize, message) {\n return new ZodSet({\n ...this._def,\n minSize: { value: minSize, message: errorUtil.toString(message) },\n });\n }\n max(maxSize, message) {\n return new ZodSet({\n ...this._def,\n maxSize: { value: maxSize, message: errorUtil.toString(message) },\n });\n }\n size(size, message) {\n return this.min(size, message).max(size, message);\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodSet.create = (valueType, params) => {\n return new ZodSet({\n valueType,\n minSize: null,\n maxSize: null,\n typeName: ZodFirstPartyTypeKind.ZodSet,\n ...processCreateParams(params),\n });\n};\nexport class ZodFunction extends ZodType {\n constructor() {\n super(...arguments);\n this.validate = this.implement;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.function) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.function,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n function makeArgsIssue(args, error) {\n return makeIssue({\n data: args,\n path: ctx.path,\n errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), defaultErrorMap].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_arguments,\n argumentsError: error,\n },\n });\n }\n function makeReturnsIssue(returns, error) {\n return makeIssue({\n data: returns,\n path: ctx.path,\n errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), defaultErrorMap].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_return_type,\n returnTypeError: error,\n },\n });\n }\n const params = { errorMap: ctx.common.contextualErrorMap };\n const fn = ctx.data;\n if (this._def.returns instanceof ZodPromise) {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(async function (...args) {\n const error = new ZodError([]);\n const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {\n error.addIssue(makeArgsIssue(args, e));\n throw error;\n });\n const result = await Reflect.apply(fn, this, parsedArgs);\n const parsedReturns = await me._def.returns._def.type\n .parseAsync(result, params)\n .catch((e) => {\n error.addIssue(makeReturnsIssue(result, e));\n throw error;\n });\n return parsedReturns;\n });\n }\n else {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(function (...args) {\n const parsedArgs = me._def.args.safeParse(args, params);\n if (!parsedArgs.success) {\n throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);\n }\n const result = Reflect.apply(fn, this, parsedArgs.data);\n const parsedReturns = me._def.returns.safeParse(result, params);\n if (!parsedReturns.success) {\n throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n }\n return parsedReturns.data;\n });\n }\n }\n parameters() {\n return this._def.args;\n }\n returnType() {\n return this._def.returns;\n }\n args(...items) {\n return new ZodFunction({\n ...this._def,\n args: ZodTuple.create(items).rest(ZodUnknown.create()),\n });\n }\n returns(returnType) {\n return new ZodFunction({\n ...this._def,\n returns: returnType,\n });\n }\n implement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n strictImplement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n static create(args, returns, params) {\n return new ZodFunction({\n args: (args ? args : ZodTuple.create([]).rest(ZodUnknown.create())),\n returns: returns || ZodUnknown.create(),\n typeName: ZodFirstPartyTypeKind.ZodFunction,\n ...processCreateParams(params),\n });\n }\n}\nexport class ZodLazy extends ZodType {\n get schema() {\n return this._def.getter();\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const lazySchema = this._def.getter();\n return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });\n }\n}\nZodLazy.create = (getter, params) => {\n return new ZodLazy({\n getter: getter,\n typeName: ZodFirstPartyTypeKind.ZodLazy,\n ...processCreateParams(params),\n });\n};\nexport class ZodLiteral extends ZodType {\n _parse(input) {\n if (input.data !== this._def.value) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_literal,\n expected: this._def.value,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n get value() {\n return this._def.value;\n }\n}\nZodLiteral.create = (value, params) => {\n return new ZodLiteral({\n value: value,\n typeName: ZodFirstPartyTypeKind.ZodLiteral,\n ...processCreateParams(params),\n });\n};\nfunction createZodEnum(values, params) {\n return new ZodEnum({\n values,\n typeName: ZodFirstPartyTypeKind.ZodEnum,\n ...processCreateParams(params),\n });\n}\nexport class ZodEnum extends ZodType {\n _parse(input) {\n if (typeof input.data !== \"string\") {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (!this._cache) {\n this._cache = new Set(this._def.values);\n }\n if (!this._cache.has(input.data)) {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get options() {\n return this._def.values;\n }\n get enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Values() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n extract(values, newDef = this._def) {\n return ZodEnum.create(values, {\n ...this._def,\n ...newDef,\n });\n }\n exclude(values, newDef = this._def) {\n return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {\n ...this._def,\n ...newDef,\n });\n }\n}\nZodEnum.create = createZodEnum;\nexport class ZodNativeEnum extends ZodType {\n _parse(input) {\n const nativeEnumValues = util.getValidEnumValues(this._def.values);\n const ctx = this._getOrReturnCtx(input);\n if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (!this._cache) {\n this._cache = new Set(util.getValidEnumValues(this._def.values));\n }\n if (!this._cache.has(input.data)) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get enum() {\n return this._def.values;\n }\n}\nZodNativeEnum.create = (values, params) => {\n return new ZodNativeEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n ...processCreateParams(params),\n });\n};\nexport class ZodPromise extends ZodType {\n unwrap() {\n return this._def.type;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.promise,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);\n return OK(promisified.then((data) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap,\n });\n }));\n }\n}\nZodPromise.create = (schema, params) => {\n return new ZodPromise({\n type: schema,\n typeName: ZodFirstPartyTypeKind.ZodPromise,\n ...processCreateParams(params),\n });\n};\nexport class ZodEffects extends ZodType {\n innerType() {\n return this._def.schema;\n }\n sourceType() {\n return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects\n ? this._def.schema.sourceType()\n : this._def.schema;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const effect = this._def.effect || null;\n const checkCtx = {\n addIssue: (arg) => {\n addIssueToContext(ctx, arg);\n if (arg.fatal) {\n status.abort();\n }\n else {\n status.dirty();\n }\n },\n get path() {\n return ctx.path;\n },\n };\n checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n if (effect.type === \"preprocess\") {\n const processed = effect.transform(ctx.data, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(processed).then(async (processed) => {\n if (status.value === \"aborted\")\n return INVALID;\n const result = await this._def.schema._parseAsync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return INVALID;\n if (result.status === \"dirty\")\n return DIRTY(result.value);\n if (status.value === \"dirty\")\n return DIRTY(result.value);\n return result;\n });\n }\n else {\n if (status.value === \"aborted\")\n return INVALID;\n const result = this._def.schema._parseSync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return INVALID;\n if (result.status === \"dirty\")\n return DIRTY(result.value);\n if (status.value === \"dirty\")\n return DIRTY(result.value);\n return result;\n }\n }\n if (effect.type === \"refinement\") {\n const executeRefinement = (acc) => {\n const result = effect.refinement(acc, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(result);\n }\n if (result instanceof Promise) {\n throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n }\n return acc;\n };\n if (ctx.common.async === false) {\n const inner = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n // return value is ignored\n executeRefinement(inner.value);\n return { status: status.value, value: inner.value };\n }\n else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n return executeRefinement(inner.value).then(() => {\n return { status: status.value, value: inner.value };\n });\n });\n }\n }\n if (effect.type === \"transform\") {\n if (ctx.common.async === false) {\n const base = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (!isValid(base))\n return INVALID;\n const result = effect.transform(base.value, checkCtx);\n if (result instanceof Promise) {\n throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n }\n return { status: status.value, value: result };\n }\n else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {\n if (!isValid(base))\n return INVALID;\n return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({\n status: status.value,\n value: result,\n }));\n });\n }\n }\n util.assertNever(effect);\n }\n}\nZodEffects.create = (schema, effect, params) => {\n return new ZodEffects({\n schema,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect,\n ...processCreateParams(params),\n });\n};\nZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n return new ZodEffects({\n schema,\n effect: { type: \"preprocess\", transform: preprocess },\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n ...processCreateParams(params),\n });\n};\nexport { ZodEffects as ZodTransformer };\nexport class ZodOptional extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.undefined) {\n return OK(undefined);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodOptional.create = (type, params) => {\n return new ZodOptional({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodOptional,\n ...processCreateParams(params),\n });\n};\nexport class ZodNullable extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.null) {\n return OK(null);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodNullable.create = (type, params) => {\n return new ZodNullable({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodNullable,\n ...processCreateParams(params),\n });\n};\nexport class ZodDefault extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n removeDefault() {\n return this._def.innerType;\n }\n}\nZodDefault.create = (type, params) => {\n return new ZodDefault({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n defaultValue: typeof params.default === \"function\" ? params.default : () => params.default,\n ...processCreateParams(params),\n });\n};\nexport class ZodCatch extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n // newCtx is used to not collect issues from inner types in ctx\n const newCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n };\n const result = this._def.innerType._parse({\n data: newCtx.data,\n path: newCtx.path,\n parent: {\n ...newCtx,\n },\n });\n if (isAsync(result)) {\n return result.then((result) => {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n });\n }\n else {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n }\n }\n removeCatch() {\n return this._def.innerType;\n }\n}\nZodCatch.create = (type, params) => {\n return new ZodCatch({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n catchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n ...processCreateParams(params),\n });\n};\nexport class ZodNaN extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.nan) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.nan,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n}\nZodNaN.create = (params) => {\n return new ZodNaN({\n typeName: ZodFirstPartyTypeKind.ZodNaN,\n ...processCreateParams(params),\n });\n};\nexport const BRAND = Symbol(\"zod_brand\");\nexport class ZodBranded extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const data = ctx.data;\n return this._def.type._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n unwrap() {\n return this._def.type;\n }\n}\nexport class ZodPipeline extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.common.async) {\n const handleAsync = async () => {\n const inResult = await this._def.in._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return DIRTY(inResult.value);\n }\n else {\n return this._def.out._parseAsync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n };\n return handleAsync();\n }\n else {\n const inResult = this._def.in._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return {\n status: \"dirty\",\n value: inResult.value,\n };\n }\n else {\n return this._def.out._parseSync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n }\n static create(a, b) {\n return new ZodPipeline({\n in: a,\n out: b,\n typeName: ZodFirstPartyTypeKind.ZodPipeline,\n });\n }\n}\nexport class ZodReadonly extends ZodType {\n _parse(input) {\n const result = this._def.innerType._parse(input);\n const freeze = (data) => {\n if (isValid(data)) {\n data.value = Object.freeze(data.value);\n }\n return data;\n };\n return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodReadonly.create = (type, params) => {\n return new ZodReadonly({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodReadonly,\n ...processCreateParams(params),\n });\n};\n////////////////////////////////////////\n////////////////////////////////////////\n////////// //////////\n////////// z.custom //////////\n////////// //////////\n////////////////////////////////////////\n////////////////////////////////////////\nfunction cleanParams(params, data) {\n const p = typeof params === \"function\" ? params(data) : typeof params === \"string\" ? { message: params } : params;\n const p2 = typeof p === \"string\" ? { message: p } : p;\n return p2;\n}\nexport function custom(check, _params = {}, \n/**\n * @deprecated\n *\n * Pass `fatal` into the params object instead:\n *\n * ```ts\n * z.string().custom((val) => val.length > 5, { fatal: false })\n * ```\n *\n */\nfatal) {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n const r = check(data);\n if (r instanceof Promise) {\n return r.then((r) => {\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n });\n }\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = params.fatal ?? fatal ?? true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n return;\n });\n return ZodAny.create();\n}\nexport { ZodType as Schema, ZodType as ZodSchema };\nexport const late = {\n object: ZodObject.lazycreate,\n};\nexport var ZodFirstPartyTypeKind;\n(function (ZodFirstPartyTypeKind) {\n ZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n ZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n ZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n ZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n ZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n ZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n ZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n ZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n ZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n ZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n ZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n ZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n ZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n ZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n ZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n ZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n ZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n ZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n ZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n ZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n ZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n ZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n ZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n ZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n ZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n ZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n ZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n ZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n ZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n ZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n ZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n ZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n ZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n ZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n ZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n ZodFirstPartyTypeKind[\"ZodReadonly\"] = \"ZodReadonly\";\n})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));\n// requires TS 4.4+\nclass Class {\n constructor(..._) { }\n}\nconst instanceOfType = (\n// const instanceOfType = <T extends new (...args: any[]) => any>(\ncls, params = {\n message: `Input not instance of ${cls.name}`,\n}) => custom((data) => data instanceof cls, params);\nconst stringType = ZodString.create;\nconst numberType = ZodNumber.create;\nconst nanType = ZodNaN.create;\nconst bigIntType = ZodBigInt.create;\nconst booleanType = ZodBoolean.create;\nconst dateType = ZodDate.create;\nconst symbolType = ZodSymbol.create;\nconst undefinedType = ZodUndefined.create;\nconst nullType = ZodNull.create;\nconst anyType = ZodAny.create;\nconst unknownType = ZodUnknown.create;\nconst neverType = ZodNever.create;\nconst voidType = ZodVoid.create;\nconst arrayType = ZodArray.create;\nconst objectType = ZodObject.create;\nconst strictObjectType = ZodObject.strictCreate;\nconst unionType = ZodUnion.create;\nconst discriminatedUnionType = ZodDiscriminatedUnion.create;\nconst intersectionType = ZodIntersection.create;\nconst tupleType = ZodTuple.create;\nconst recordType = ZodRecord.create;\nconst mapType = ZodMap.create;\nconst setType = ZodSet.create;\nconst functionType = ZodFunction.create;\nconst lazyType = ZodLazy.create;\nconst literalType = ZodLiteral.create;\nconst enumType = ZodEnum.create;\nconst nativeEnumType = ZodNativeEnum.create;\nconst promiseType = ZodPromise.create;\nconst effectsType = ZodEffects.create;\nconst optionalType = ZodOptional.create;\nconst nullableType = ZodNullable.create;\nconst preprocessType = ZodEffects.createWithPreprocess;\nconst pipelineType = ZodPipeline.create;\nconst ostring = () => stringType().optional();\nconst onumber = () => numberType().optional();\nconst oboolean = () => booleanType().optional();\nexport const coerce = {\n string: ((arg) => ZodString.create({ ...arg, coerce: true })),\n number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),\n boolean: ((arg) => ZodBoolean.create({\n ...arg,\n coerce: true,\n })),\n bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),\n date: ((arg) => ZodDate.create({ ...arg, coerce: true })),\n};\nexport { anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, dateType as date, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, instanceOfType as instanceof, intersectionType as intersection, lazyType as lazy, literalType as literal, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, recordType as record, setType as set, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, voidType as void, };\nexport const NEVER = INVALID;\n","import { z } from 'zod'\n\nexport const PUBLISHABLE_KEY_PREFIX = 'agtx_pk_'\nexport const SECRET_KEY_PREFIX = 'agtx_sk_'\n\nexport type ApiKeyKind = 'publishable' | 'secret'\n\nexport const PublishableApiKey = z\n .string()\n .min(PUBLISHABLE_KEY_PREFIX.length + 8)\n .startsWith(PUBLISHABLE_KEY_PREFIX, {\n message: `Publishable keys must start with \"${PUBLISHABLE_KEY_PREFIX}\".`,\n })\n\nexport const SecretApiKey = z\n .string()\n .min(SECRET_KEY_PREFIX.length + 8)\n .startsWith(SECRET_KEY_PREFIX, {\n message: `Secret keys must start with \"${SECRET_KEY_PREFIX}\".`,\n })\n\nexport const classifyApiKey = (key: string): ApiKeyKind | 'unknown' => {\n if (key.startsWith(PUBLISHABLE_KEY_PREFIX)) return 'publishable'\n if (key.startsWith(SECRET_KEY_PREFIX)) return 'secret'\n return 'unknown'\n}\n","import { z } from 'zod'\n\nexport const AgentClass = z.enum(['webmcp', 'dom', 'screenshot', 'crawler'])\nexport type AgentClass = z.infer<typeof AgentClass>\n\nexport const TrustLevel = z.enum(['detected', 'declared', 'verified', 'linked'])\nexport type TrustLevel = z.infer<typeof TrustLevel>\n\nexport const AgentIdentity = z.object({\n class: AgentClass,\n trust: TrustLevel,\n confidence: z.number().min(0).max(1).default(1),\n vendor: z.string().nullable(),\n userAgent: z.string().nullable(),\n detectionVersion: z.string().default('2026.04'),\n signals: z.record(z.unknown()).default({}),\n})\nexport type AgentIdentity = z.infer<typeof AgentIdentity>\n","import { z } from 'zod'\nimport { AgentClass, TrustLevel } from './agent.js'\n\nexport const AuthProtocol = z.enum([\n 'bearer',\n 'oauth2',\n 'sso',\n 'spiffe',\n 'google-agent',\n 'mtls',\n 'detection',\n 'declaration',\n 'extension',\n 'session-link',\n 'x-agent-header',\n])\nexport type AuthProtocol = z.infer<typeof AuthProtocol>\n\nexport const IdentityClaim = z.object({\n class: AgentClass,\n vendor: z.string().min(1),\n token: z.string().min(8),\n expiresAt: z.string().datetime().optional(),\n})\nexport type IdentityClaim = z.infer<typeof IdentityClaim>\n\nexport const VerificationChallenge = z.object({\n publishableKey: z.string(),\n claim: IdentityClaim,\n nonce: z.string().min(8),\n origin: z.string().url(),\n})\nexport type VerificationChallenge = z.infer<typeof VerificationChallenge>\n\nexport const VerificationResult = z.object({\n trust: TrustLevel,\n vendor: z.string(),\n validUntil: z.string().datetime(),\n reason: z.string().optional(),\n // Canonical principal returned by the verifier (OIDC sub, SPIFFE ID,\n // cert subject). Optional so existing verifiers keep compiling.\n subject: z.string().optional(),\n // Which protocol the gateway actually verified against. Lets the SDK\n // route SPIFFE → 'google-agent' trace labels when the trust domain\n // matches a Google enrichment match.\n protocol: AuthProtocol.optional(),\n // Free-form per-protocol enrichment (e.g. google agent_id, SPIFFE\n // trust domain). Lifted into AgentIdentity.signals at trace time.\n signals: z.record(z.unknown()).optional(),\n})\nexport type VerificationResult = z.infer<typeof VerificationResult>\n\n// Per-site verifier config — shared with the dashboard so it can validate\n// forms before submitting and so the gateway accepts only well-formed\n// PUTs. These mirror the `*Config` interfaces in\n// packages/gateway/src/storage/types.ts but live here because the\n// dashboard already imports from @agentronics/protocol.\nexport const SsoConfigInput = z.object({\n issuer: z.string().url(),\n audiences: z.array(z.string().min(1)).min(1),\n})\nexport type SsoConfigInput = z.infer<typeof SsoConfigInput>\n\nexport const SpiffeConfigInput = z.object({\n trustDomain: z.string().min(1),\n bundleEndpoint: z.string().url(),\n audiences: z.array(z.string().min(1)).min(1),\n googleTrustDomains: z.array(z.string().min(1)).optional(),\n})\nexport type SpiffeConfigInput = z.infer<typeof SpiffeConfigInput>\n\nexport const MtlsConfigInput = z.object({\n // PEM blocks are >20 chars even when empty-bodied; rejects obvious junk.\n rootCerts: z.array(z.string().min(20)).min(1),\n spiffeTrustDomain: z.string().min(1).optional(),\n xfccEntryPolicy: z.enum(['last', 'first', 'only']).default('last'),\n})\nexport type MtlsConfigInput = z.infer<typeof MtlsConfigInput>\n\nexport const SiteProtocolName = z.enum(['sso', 'spiffe', 'mtls'])\nexport type SiteProtocolName = z.infer<typeof SiteProtocolName>\n\n// Body shape for POST /v1/verify/:protocol. Authentication is via the\n// standard Authorization: Bearer <publishable_or_secret_key> header\n// (same middleware as the other authenticated routes). The protocol\n// comes from the URL param. `token` carries JWT-shaped creds (OIDC ID\n// tokens, SPIFFE JWT-SVIDs, Google agent tokens). `xfcc` carries the\n// raw x-forwarded-client-cert header for mTLS verification. Exactly one\n// of `token` or `xfcc` is required; the route handler enforces per\n// protocol. `siteId` selects which per-site verifier config to load.\nexport const VerificationRequest = z.object({\n siteId: z.string().min(1),\n token: z.string().min(8).optional(),\n xfcc: z.string().min(1).optional(),\n headers: z.record(z.string()).optional(),\n origin: z.string().url().optional(),\n})\nexport type VerificationRequest = z.infer<typeof VerificationRequest>\n\nexport const TRUST_RANK: Record<z.infer<typeof TrustLevel>, number> = {\n detected: 0,\n declared: 1,\n verified: 2,\n linked: 3,\n}\n\nexport const isHigherTrust = (\n candidate: z.infer<typeof TrustLevel>,\n current: z.infer<typeof TrustLevel>\n) => TRUST_RANK[candidate] > TRUST_RANK[current]\n","import { z } from 'zod'\nimport { AgentClass, TrustLevel } from './agent.js'\n\nexport const PolicyDecision = z.enum(['allow', 'deny', 'review'])\nexport type PolicyDecision = z.infer<typeof PolicyDecision>\n\nexport const PolicyRule = z.object({\n id: z.string(),\n tool: z.string(),\n minTrust: TrustLevel,\n allowedClasses: z.array(AgentClass).default([]),\n decision: PolicyDecision,\n rateLimit: z\n .object({\n max: z.number().int().positive(),\n windowSeconds: z.number().int().positive(),\n })\n .optional(),\n})\nexport type PolicyRule = z.infer<typeof PolicyRule>\n\nexport const PolicyEvaluation = z.object({\n decision: PolicyDecision,\n ruleId: z.string().nullable(),\n reason: z.string(),\n})\nexport type PolicyEvaluation = z.infer<typeof PolicyEvaluation>\n","import { z } from 'zod'\n\n// ---- Key-value memory (existing surface) -------------------------------------\n\nexport const MemoryScope = z.enum(['session', 'user', 'org'])\nexport type MemoryScope = z.infer<typeof MemoryScope>\n\nexport const MemoryEntry = z.object({\n key: z.string().min(1),\n value: z.unknown(),\n scope: MemoryScope.default('session'),\n ttlSeconds: z.number().int().positive().nullable().default(null),\n updatedAt: z.string().datetime().optional(),\n})\nexport type MemoryEntry = z.infer<typeof MemoryEntry>\n\n// ---- Site memory (Phase 5: enterprise-provided context for agents) ----------\n\nexport const SiteMemoryPage = z.object({\n path: z.string().min(1),\n name: z.string().optional(),\n purpose: z.string().optional(),\n availableActions: z.array(z.string()).optional(),\n prerequisites: z.array(z.string()).optional(),\n queryParams: z.record(z.string()).optional(),\n notes: z.string().optional(),\n})\nexport type SiteMemoryPage = z.infer<typeof SiteMemoryPage>\n\nexport const SiteMemoryNavigation = z.object({\n pattern: z.string().optional(),\n flow: z.string().optional(),\n})\n\nexport const SiteMemorySiteMap = z.object({\n pages: z.array(SiteMemoryPage).default([]),\n navigation: SiteMemoryNavigation.optional(),\n})\n\nexport const SiteMemoryWorkflowStep = z.object({\n step: z.number().int().positive(),\n action: z.string().min(1),\n})\n\nexport const SiteMemoryWorkflow = z.object({\n steps: z.array(SiteMemoryWorkflowStep).default([]),\n notes: z.string().optional(),\n policy: z.string().optional(),\n})\nexport type SiteMemoryWorkflow = z.infer<typeof SiteMemoryWorkflow>\n\nexport const SiteMemoryUiHint = z.object({\n selector: z.string().min(1),\n behavior: z.string().optional(),\n location: z.string().optional(),\n showsCount: z.boolean().optional(),\n})\nexport type SiteMemoryUiHint = z.infer<typeof SiteMemoryUiHint>\n\nexport const SiteMemoryCatalog = z.object({\n categories: z.array(z.string()).optional(),\n productSchema: z\n .object({\n fields: z.array(z.string()).optional(),\n idFormat: z.string().optional(),\n })\n .optional(),\n searchBehavior: z.string().optional(),\n})\n\nexport const SiteMemoryPageContext = z\n .object({\n path: z.string().min(1),\n payload: z.record(z.unknown()).default({}),\n updatedAt: z.string().datetime().optional(),\n })\n .strict()\nexport type SiteMemoryPageContext = z.infer<typeof SiteMemoryPageContext>\n\nexport const SiteMemory = z.object({\n version: z.string().default('1'),\n siteMap: SiteMemorySiteMap.optional(),\n workflows: z.record(SiteMemoryWorkflow).default({}),\n policies: z.record(z.union([z.string(), z.array(z.string())])).default({}),\n catalog: SiteMemoryCatalog.optional(),\n uiGuidance: z.record(SiteMemoryUiHint).default({}),\n pageContexts: z.record(SiteMemoryPageContext).default({}),\n updatedAt: z.string().datetime().optional(),\n})\nexport type SiteMemory = z.infer<typeof SiteMemory>\n\nexport const SITE_MEMORY_DEFAULT: SiteMemory = SiteMemory.parse({})\n","import { z } from 'zod'\n\n/**\n * A single governed tool as surfaced to agents — the wire shape the SDK pushes\n * to the gateway and the dashboard renders. `tokens` is the SDK's estimate of\n * how much of an agent's context the descriptor occupies; `page` is the\n * progression stage / page the tool belongs to (used for page-wise grouping).\n */\nexport const ToolDescriptor = z.object({\n name: z.string().min(1),\n group: z.string().optional(),\n page: z.string().optional(),\n description: z.string().default(''),\n inputSchema: z.record(z.unknown()).default({}),\n outputSchema: z.record(z.unknown()).optional(),\n tokens: z.number().int().nonnegative().default(0),\n})\nexport type ToolDescriptor = z.infer<typeof ToolDescriptor>\n\n/** The full registry the SDK syncs for a site. */\nexport const ToolRegistry = z.object({\n tools: z.array(ToolDescriptor).default([]),\n})\nexport type ToolRegistry = z.infer<typeof ToolRegistry>\n\nexport const TOOL_REGISTRY_DEFAULT: ToolRegistry = ToolRegistry.parse({})\n","import { z } from 'zod'\nimport { AgentIdentity } from './agent.js'\nimport { PolicyEvaluation } from './policy.js'\n\nexport const TraceEventType = z.enum([\n 'agent.detected',\n 'agent.missed',\n 'auth.identity_presented',\n 'auth.identity_cleared',\n 'authz.policies_set',\n 'authz.evaluated',\n 'memory.accessed',\n 'memory.updated',\n 'tool.registered',\n 'tool.executed',\n 'tool.surfaced',\n 'tool.progressed',\n 'sdk.error',\n])\nexport type TraceEventType = z.infer<typeof TraceEventType>\n\nexport const TraceEvent = z.object({\n id: z.string(),\n siteId: z.string(),\n sessionId: z.string(),\n occurredAt: z.string().datetime(),\n type: TraceEventType,\n tool: z.string().optional(),\n agent: AgentIdentity.nullable().optional(),\n policy: PolicyEvaluation.optional(),\n durationMs: z.number().int().nonnegative().optional(),\n outcome: z.enum(['success', 'error', 'blocked']),\n error: z.string().optional(),\n /**\n * Free-form per-event metadata. Reserved keys the gateway and dashboard\n * treat as well-known:\n * - `protocol` — the auth protocol that produced the event (sso, spiffe, …).\n * - `subject` — the verified identity subject string.\n * - `page` — the page path the event occurred on; the dashboard groups\n * WebMCP tools and agent activity by this (SDK ≥ 0.1.2).\n */\n metadata: z.record(z.unknown()).default({}),\n})\nexport type TraceEvent = z.infer<typeof TraceEvent>\n\nexport const TraceBatch = z.object({\n // Optional and never trusted by the gateway — auth is always via the\n // Bearer header. The field stays in the schema for SDK back-compat\n // (older SDKs still send it). Newer SDKs may omit it.\n publishableKey: z.string().optional(),\n events: z.array(TraceEvent).min(1).max(100),\n})\nexport type TraceBatch = z.infer<typeof TraceBatch>\n","export type AgentronicsErrorCode =\n | 'invalid_api_key'\n | 'wrong_key_kind'\n | 'policy_denied'\n | 'tool_unknown'\n | 'rate_limited'\n | 'internal_error'\n\nexport class AgentronicsError extends Error {\n readonly code: AgentronicsErrorCode\n\n constructor(code: AgentronicsErrorCode, message: string) {\n super(message)\n this.name = 'AgentronicsError'\n this.code = code\n }\n}\n","// Single source of truth for the SDK build version, surfaced on every\n// AgentIdentity as `detectionVersion` so traces can be filtered by SDK\n// generation. tsup inlines a pkg-version replacement at build time;\n// the literal here is the dev/test fallback. Bump this when you cut a\n// new SDK release.\nexport const SDK_VERSION = '0.1.2'\n","import type { AgentIdentity } from '@agentronics/protocol'\nimport { SDK_VERSION } from \"../version.js\"\n\ninterface ModelContextLike {\n client?: string\n vendor?: string\n tools?: unknown[]\n}\n\nconst readModelContext = (): ModelContextLike | null => {\n if (typeof navigator === 'undefined') return null\n const value = (navigator as unknown as { modelContext?: ModelContextLike }).modelContext\n return value && typeof value === 'object' ? value : null\n}\n\nexport interface DetectWebMcpOptions {\n /**\n * Some extensions inject `navigator.modelContext` after first paint. Poll for this many\n * milliseconds before giving up. Set to 0 to read synchronously and return immediately.\n */\n pollMs?: number\n}\n\nexport const detectWebMcp = async (\n options: DetectWebMcpOptions = {}\n): Promise<AgentIdentity | null> => {\n const { pollMs = 500 } = options\n const start = Date.now()\n\n while (true) {\n const ctx = readModelContext()\n if (ctx) return buildIdentity(ctx)\n if (Date.now() - start >= pollMs) return null\n await new Promise((resolve) => setTimeout(resolve, 50))\n }\n}\n\nconst buildIdentity = (ctx: ModelContextLike): AgentIdentity => ({\n class: 'webmcp',\n trust: 'detected',\n confidence: 1,\n vendor: ctx.vendor ?? ctx.client ?? null,\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n webmcp: true,\n toolCount: Array.isArray(ctx.tools) ? ctx.tools.length : 0,\n },\n})\n","import type { AgentIdentity } from '@agentronics/protocol'\nimport { SDK_VERSION } from '../version.js'\n\nexport type CrawlerCategory = 'ai' | 'search'\n\nexport interface CrawlerSignature {\n /** Stable vendor id, reported as identity.vendor. */\n name: string\n category: CrawlerCategory\n /** Tested against navigator.userAgent. */\n pattern: RegExp\n}\n\n/**\n * Known AI + search crawlers, matched by User-Agent token.\n *\n * Caveats baked into the design:\n * - UA is self-reported and trivially spoofable, so a match is high-confidence\n * but never certain — we report `confidence: 0.9`, not `1`.\n * - This is client-side detection: it only sees crawlers that actually execute\n * JavaScript on the page. The majority of crawlers fetch HTML and never run\n * the SDK, so full coverage needs server/edge UA inspection (a future product).\n *\n * Order matters: more specific tokens (e.g. `Google-Extended`, `Applebot-Extended`)\n * are listed before their broader siblings so the first match wins correctly.\n */\nexport const CRAWLER_SIGNATURES: CrawlerSignature[] = [\n // AI / LLM crawlers\n { name: 'GPTBot', category: 'ai', pattern: /GPTBot/i },\n { name: 'OAI-SearchBot', category: 'ai', pattern: /OAI-SearchBot/i },\n { name: 'ChatGPT-User', category: 'ai', pattern: /ChatGPT-User/i },\n { name: 'ClaudeBot', category: 'ai', pattern: /ClaudeBot/i },\n { name: 'Claude-Web', category: 'ai', pattern: /Claude-Web/i },\n { name: 'anthropic-ai', category: 'ai', pattern: /anthropic-ai/i },\n { name: 'PerplexityBot', category: 'ai', pattern: /PerplexityBot/i },\n { name: 'Google-Extended', category: 'ai', pattern: /Google-Extended/i },\n { name: 'Applebot-Extended', category: 'ai', pattern: /Applebot-Extended/i },\n { name: 'Amazonbot', category: 'ai', pattern: /Amazonbot/i },\n { name: 'Bytespider', category: 'ai', pattern: /Bytespider/i },\n { name: 'CCBot', category: 'ai', pattern: /CCBot/i },\n { name: 'Meta-ExternalAgent', category: 'ai', pattern: /Meta-ExternalAgent/i },\n { name: 'cohere-ai', category: 'ai', pattern: /cohere-ai/i },\n // Search crawlers\n { name: 'Googlebot', category: 'search', pattern: /Googlebot/i },\n { name: 'Bingbot', category: 'search', pattern: /bingbot/i },\n { name: 'DuckDuckBot', category: 'search', pattern: /DuckDuckBot/i },\n { name: 'YandexBot', category: 'search', pattern: /YandexBot/i },\n { name: 'Baiduspider', category: 'search', pattern: /Baiduspider/i },\n { name: 'Applebot', category: 'search', pattern: /Applebot/i },\n]\n\nexport interface DetectCrawlerOptions {\n /** Override the signature table (e.g. to add private/first-party crawlers). */\n signatures?: CrawlerSignature[]\n /** Skip crawler detection entirely. */\n disable?: boolean\n /** Confidence reported on a UA match. Default 0.9 (UA is spoofable). */\n confidence?: number\n}\n\n/**\n * Identify known AI/search crawlers by their User-Agent token. Returns `null`\n * when no signature matches or when there is no `navigator` (server-side).\n */\nexport const detectCrawler = (options: DetectCrawlerOptions = {}): AgentIdentity | null => {\n const { signatures = CRAWLER_SIGNATURES, disable = false, confidence = 0.9 } = options\n if (disable) return null\n if (typeof navigator === 'undefined') return null\n\n const ua = navigator.userAgent ?? ''\n if (!ua) return null\n\n for (const sig of signatures) {\n if (sig.pattern.test(ua)) {\n return {\n class: 'crawler',\n trust: 'detected',\n confidence,\n vendor: sig.name,\n userAgent: ua,\n detectionVersion: SDK_VERSION,\n signals: { matched: sig.name, category: sig.category, ua },\n }\n }\n }\n\n return null\n}\n","import type { AgentIdentity } from '@agentronics/protocol'\nimport { SDK_VERSION } from \"../version.js\"\n\ninterface SignalResult {\n hit: boolean\n weight: number\n detail?: string\n}\n\nconst HEADLESS_UA_PATTERNS = [/HeadlessChrome/i, /Headless/i, /PhantomJS/i, /SlimerJS/i]\n\nconst checkWebdriver = (): SignalResult => {\n const value =\n typeof navigator !== 'undefined' && (navigator as Navigator & { webdriver?: boolean }).webdriver\n return { hit: value === true, weight: 0.6, detail: 'navigator.webdriver === true' }\n}\n\nconst checkChromedriver = (): SignalResult => {\n if (typeof window === 'undefined') return { hit: false, weight: 0.5 }\n const keys = Object.keys(window).filter((k) => k.startsWith('cdc_'))\n return { hit: keys.length > 0, weight: 0.5, detail: `window.${keys[0] ?? 'cdc_*'}` }\n}\n\nconst checkPlugins = (): SignalResult => {\n if (typeof navigator === 'undefined' || !navigator.plugins) return { hit: false, weight: 0.2 }\n const desktop = /Win|Mac|Linux/.test(navigator.userAgent ?? '')\n const empty = navigator.plugins.length === 0\n return { hit: desktop && empty, weight: 0.2, detail: 'desktop UA with no plugins' }\n}\n\nconst checkHeadlessUa = (): SignalResult => {\n if (typeof navigator === 'undefined') return { hit: false, weight: 0.7 }\n const ua = navigator.userAgent ?? ''\n const hit = HEADLESS_UA_PATTERNS.some((re) => re.test(ua))\n return hit ? { hit, weight: 0.7, detail: `headless UA: ${ua}` } : { hit, weight: 0.7 }\n}\n\nconst checkLanguages = (): SignalResult => {\n if (typeof navigator === 'undefined') return { hit: false, weight: 0.15 }\n const langs = navigator.languages\n return {\n hit: !langs || langs.length === 0,\n weight: 0.15,\n detail: 'navigator.languages empty',\n }\n}\n\nconst checkPermissions = (): SignalResult => {\n if (typeof navigator === 'undefined') return { hit: false, weight: 0.1 }\n const hasChrome = 'chrome' in window\n const ua = navigator.userAgent ?? ''\n const looksChrome = /Chrome\\//.test(ua) && !/Edg\\//.test(ua)\n return {\n hit: looksChrome && !hasChrome,\n weight: 0.2,\n detail: 'Chrome UA without window.chrome',\n }\n}\n\nconst SIGNALS = {\n webdriver: checkWebdriver,\n chromedriver: checkChromedriver,\n headlessUa: checkHeadlessUa,\n languages: checkLanguages,\n permissions: checkPermissions,\n plugins: checkPlugins,\n} as const\n\nexport type DomSignalName = keyof typeof SIGNALS\n\nexport interface DetectDomOptions {\n /** Floor below which we report no DOM agent. Defaults to 0.4. */\n threshold?: number\n}\n\nexport const detectDom = (options: DetectDomOptions = {}): AgentIdentity | null => {\n const { threshold = 0.4 } = options\n\n const signals: Record<string, unknown> = {}\n let totalWeight = 0\n let hitWeight = 0\n\n for (const [name, check] of Object.entries(SIGNALS)) {\n const result = check()\n totalWeight += result.weight\n signals[name] = { hit: result.hit, weight: result.weight, detail: result.detail }\n if (result.hit) hitWeight += result.weight\n }\n\n const confidence = totalWeight === 0 ? 0 : hitWeight / totalWeight\n if (confidence < threshold) return null\n\n return {\n class: 'dom',\n trust: 'detected',\n confidence,\n vendor: null,\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals,\n }\n}\n","import type { AgentIdentity } from '@agentronics/protocol'\nimport { detectDom } from '../dom.js'\nimport { detectCrawler } from '../crawler.js'\nimport { detectWebMcp } from '../webmcp.js'\n\nexport type DetectorStatus = 'stable' | 'beta' | 'research'\n\nexport interface Detector {\n id: string\n status: DetectorStatus\n detect(): AgentIdentity | null | Promise<AgentIdentity | null>\n}\n\nexport const bundledDetectors = (): Detector[] => [\n {\n id: 'webmcp.model-context',\n status: 'stable',\n detect: () => detectWebMcp({ pollMs: 0 }),\n },\n {\n id: 'crawler.user-agent',\n status: 'beta',\n detect: () => detectCrawler(),\n },\n {\n id: 'dom.automation-heuristics',\n status: 'beta',\n detect: () => detectDom(),\n },\n]\n\nexport const createDetectorRegistry = (initial: Detector[] = bundledDetectors()) => {\n const detectors = new Map(initial.map((detector) => [detector.id, detector]))\n\n return {\n register(detector: Detector) {\n detectors.set(detector.id, detector)\n },\n list(status?: DetectorStatus): Detector[] {\n const all = [...detectors.values()]\n return status ? all.filter((detector) => detector.status === status) : all\n },\n async detectAll(includeResearch = false): Promise<AgentIdentity | null> {\n for (const detector of detectors.values()) {\n if (detector.status === 'research' && !includeResearch) continue\n const identity = await detector.detect()\n if (identity) return identity\n }\n return null\n },\n }\n}\n\nexport type DetectorRegistry = ReturnType<typeof createDetectorRegistry>\n","import { AgentClass, type AgentIdentity, type TrustLevel } from '@agentronics/protocol'\nimport { SDK_VERSION } from \"../version.js\"\n\nexport interface DeclareAgentInput {\n class: 'webmcp' | 'dom' | 'screenshot' | 'crawler'\n vendor: string\n /** Optional bearer token returned by the customer's verification endpoint. */\n verificationToken?: string\n}\n\nexport const declareAgent = (input: DeclareAgentInput): AgentIdentity => {\n const parsedClass = AgentClass.parse(input.class)\n const trust: TrustLevel = input.verificationToken ? 'verified' : 'declared'\n\n return {\n class: parsedClass,\n trust,\n confidence: 1,\n vendor: input.vendor,\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n declared: true,\n hasVerificationToken: Boolean(input.verificationToken),\n },\n }\n}\n","export interface DetectorSignature {\n id: string\n status: 'stable' | 'beta' | 'research'\n version: string\n signals: Record<string, unknown>\n}\n\nexport interface SignatureLoaderOptions {\n gatewayUrl: string\n fetcher?: typeof fetch\n}\n\nexport const createSignatureLoader = ({ gatewayUrl, fetcher = fetch }: SignatureLoaderOptions) => {\n let etag: string | null = null\n let signatures: DetectorSignature[] = []\n\n return {\n snapshot(): DetectorSignature[] {\n return [...signatures]\n },\n async sync(): Promise<DetectorSignature[]> {\n const response = await fetcher(`${gatewayUrl.replace(/\\/$/, '')}/v1/detector-signatures`, {\n headers: etag ? { 'if-none-match': etag } : {},\n })\n if (response.status === 304) return this.snapshot()\n if (!response.ok) throw new Error(`Detector signature sync failed with status ${response.status}.`)\n\n const body = (await response.json()) as { signatures?: DetectorSignature[] }\n signatures = body.signatures ?? []\n etag = response.headers.get('etag')\n return this.snapshot()\n },\n }\n}\n\nexport type SignatureLoader = ReturnType<typeof createSignatureLoader>\n","import type { AgentIdentity } from '@agentronics/protocol'\nimport { detectWebMcp, type DetectWebMcpOptions } from './webmcp.js'\nimport { detectCrawler, type DetectCrawlerOptions } from './crawler.js'\nimport { detectDom, type DetectDomOptions } from './dom.js'\nimport { createDetectorRegistry, type Detector } from './detectors/registry.js'\n\nexport interface DetectAgentOptions {\n webmcp?: DetectWebMcpOptions | false\n crawler?: DetectCrawlerOptions | false\n dom?: DetectDomOptions | false\n customDetectors?: Detector[]\n experimental?: boolean\n}\n\n/**\n * Run the full detection pipeline. WebMCP wins if present (exact match), then a\n * known-crawler User-Agent match, then DOM automation heuristics. Returns `null`\n * if no agent class fires above its threshold — caller should treat as \"human or\n * undetectable agent.\"\n */\nexport const detectAgent = async (\n options: DetectAgentOptions = {}\n): Promise<AgentIdentity | null> => {\n if (options.customDetectors?.length) {\n const custom = await createDetectorRegistry(options.customDetectors).detectAll(Boolean(options.experimental))\n if (custom) return custom\n }\n if (options.webmcp !== false) {\n const webmcp = await detectWebMcp(options.webmcp ?? {})\n if (webmcp) return webmcp\n }\n if (options.crawler !== false) {\n const crawler = detectCrawler(options.crawler ?? {})\n if (crawler) return crawler\n }\n if (options.dom !== false) {\n const dom = detectDom(options.dom ?? {})\n if (dom) return dom\n }\n return null\n}\n\nexport { detectWebMcp } from './webmcp.js'\nexport type { DetectWebMcpOptions } from './webmcp.js'\nexport { detectDom } from './dom.js'\nexport type { DetectDomOptions, DomSignalName } from './dom.js'\nexport { detectCrawler, CRAWLER_SIGNATURES } from './crawler.js'\nexport type { DetectCrawlerOptions, CrawlerSignature, CrawlerCategory } from './crawler.js'\nexport { declareAgent } from './declare.js'\nexport type { DeclareAgentInput } from './declare.js'\nexport { createDetectorRegistry, bundledDetectors } from './detectors/registry.js'\nexport type { Detector, DetectorRegistry, DetectorStatus } from './detectors/registry.js'\nexport { createSignatureLoader } from './detectors/signatureLoader.js'\nexport type { DetectorSignature, SignatureLoader } from './detectors/signatureLoader.js'\n","import {\n AgentronicsError,\n IdentityClaim,\n isHigherTrust,\n type AgentIdentity,\n type IdentityClaim as IdentityClaimType,\n} from '@agentronics/protocol'\nimport { SDK_VERSION } from '../version.js'\n\nexport interface PresentIdentityOptions extends IdentityClaimType {\n /**\n * If false, accept the claim as `declared` (no remote verification).\n * If true, the claim is staged for the gateway to verify; trust is `declared` until then.\n */\n verifyRemotely?: boolean\n}\n\nexport interface PresentedIdentity {\n identity: AgentIdentity\n claim: IdentityClaimType\n}\n\nconst buildIdentity = (claim: IdentityClaimType): AgentIdentity => ({\n class: claim.class,\n trust: 'declared',\n confidence: 1,\n vendor: claim.vendor,\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n declared: true,\n hasToken: true,\n tokenExpiresAt: claim.expiresAt ?? null,\n },\n})\n\nexport const createIdentityStore = () => {\n let presented: PresentedIdentity | null = null\n\n return {\n present(input: PresentIdentityOptions): PresentedIdentity {\n const parsed = IdentityClaim.safeParse(input)\n if (!parsed.success) {\n throw new AgentronicsError(\n 'invalid_api_key',\n `Invalid identity claim: ${parsed.error.issues[0]?.message ?? 'unknown'}`\n )\n }\n const next: PresentedIdentity = {\n claim: parsed.data,\n identity: buildIdentity(parsed.data),\n }\n presented = next\n return next\n },\n\n clear() {\n presented = null\n },\n\n /** Return the presented identity if it outranks the supplied detection. */\n preferOver(detected: AgentIdentity | null): AgentIdentity | null {\n if (!presented) return detected\n if (!detected) return presented.identity\n return isHigherTrust(presented.identity.trust, detected.trust)\n ? presented.identity\n : detected\n },\n\n snapshot(): PresentedIdentity | null {\n return presented\n },\n }\n}\n\nexport type IdentityStore = ReturnType<typeof createIdentityStore>\n","import { TRUST_RANK, type TrustLevel } from '@agentronics/protocol'\n\nexport interface TrustDerivationInput {\n detected?: boolean\n declared?: boolean\n verified?: boolean\n linked?: boolean\n}\n\nexport const deriveTrustLevel = ({\n detected,\n declared,\n verified,\n linked,\n}: TrustDerivationInput): TrustLevel => {\n if (linked) return 'linked'\n if (verified) return 'verified'\n if (declared) return 'declared'\n if (detected) return 'detected'\n return 'detected'\n}\n\nexport const highestTrust = <T extends { trust: TrustLevel }>(identities: T[]): T | null => {\n let best: T | null = null\n for (const identity of identities) {\n if (!best || TRUST_RANK[identity.trust] > TRUST_RANK[best.trust]) best = identity\n }\n return best\n}\n","import type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from \"../../version.js\"\n\nexport const bearer = (): AuthMethod => ({\n name: 'bearer',\n async authenticate(input, context) {\n if (!input.bearerToken) return null\n const verified = await context.verifyToken?.('bearer', input.bearerToken)\n return {\n class: input.classHint ?? 'dom',\n trust: verified?.trust ?? 'verified',\n confidence: 1,\n vendor: verified?.vendor ?? input.vendorHint ?? 'bearer',\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: { bearer: true, verifiedRemotely: Boolean(verified) },\n }\n },\n})\n","import type { AgentIdentity } from '@agentronics/protocol'\nimport type { AuthMethod } from '../engine.js'\n\nexport const detectionAsAuth = (): AuthMethod => ({\n name: 'detection',\n async authenticate(input) {\n return input.detected ?? null\n },\n})\n\nexport const cloneDetectedIdentity = (identity: AgentIdentity): AgentIdentity => ({\n ...identity,\n signals: { ...identity.signals },\n})\n","import type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from \"../../version.js\"\n\nexport const extensionToken = (): AuthMethod => ({\n name: 'extensionToken',\n async authenticate(input, context) {\n if (!input.extensionToken) return null\n const verified = await context.verifyToken?.('extensionToken', input.extensionToken)\n return {\n class: 'dom',\n trust: verified?.trust ?? 'verified',\n confidence: 1,\n vendor: verified?.vendor ?? input.vendorHint ?? 'browser-extension',\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: { extensionToken: true, verifiedRemotely: Boolean(verified) },\n }\n },\n})\n","import type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from \"../../version.js\"\n\n// mTLS via x-forwarded-client-cert (XFCC). Browser builds never trigger\n// this — JavaScript cannot inspect its own TLS state. Node companions\n// forward the XFCC header value verbatim and the gateway parses + chain-\n// validates against the site's registered roots (D2 policy applies for\n// multi-entry headers). If the XFCC URI SAN carries a `spiffe://` value\n// it is lifted into `signals.spiffeId` so dashboard pivots can correlate\n// X.509-SVID traffic with JWT-SVID traffic from the same workload.\nexport const mtls = (): AuthMethod => ({\n name: 'mtls',\n async authenticate(input, context) {\n if (!input.xfccHeader) return null\n const verified = await context.verifyToken?.('mtls', input.xfccHeader)\n return {\n class: input.classHint ?? 'webmcp',\n trust: verified?.trust ?? 'verified',\n confidence: 1,\n vendor: verified?.vendor ?? input.vendorHint ?? 'mtls',\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n mtls: true,\n subject: verified?.subject ?? null,\n verifiedRemotely: Boolean(verified),\n ...(verified?.signals ?? {}),\n },\n }\n },\n})\n","import type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from \"../../version.js\"\n\nexport const oauth2 = (): AuthMethod => ({\n name: 'oauth2',\n async authenticate(input, context) {\n if (!input.oauth2AccessToken) return null\n const verified = await context.verifyToken?.('oauth2', input.oauth2AccessToken)\n return {\n class: input.classHint ?? 'webmcp',\n trust: input.oauth2Subject ? 'linked' : verified?.trust ?? 'verified',\n confidence: 1,\n vendor: verified?.vendor ?? input.vendorHint ?? 'oauth2',\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n oauth2: true,\n subject: input.oauth2Subject ?? null,\n verifiedRemotely: Boolean(verified),\n },\n }\n },\n})\n","import {\n IdentityClaim,\n type AgentIdentity,\n type IdentityClaim as IdentityClaimRecord,\n} from '@agentronics/protocol'\nimport type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from '../../version.js'\n\nconst identityFromClaim = (claim: IdentityClaimRecord): AgentIdentity => ({\n class: claim.class,\n trust: 'declared',\n confidence: 1,\n vendor: claim.vendor,\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n declared: true,\n hasToken: true,\n tokenExpiresAt: claim.expiresAt ?? null,\n },\n})\n\nexport const selfDeclaration = (): AuthMethod => ({\n name: 'selfDeclaration',\n async authenticate(input) {\n if (!input.declaration) return null\n return identityFromClaim(IdentityClaim.parse(input.declaration))\n },\n})\n","import type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from \"../../version.js\"\n\nexport const sessionLink = (): AuthMethod => ({\n name: 'sessionLink',\n async authenticate(input, context) {\n if (!input.sessionLinkToken) return null\n const verified = await context.verifyToken?.('sessionLink', input.sessionLinkToken)\n return {\n class: input.classHint ?? 'screenshot',\n trust: input.linkedUserId ? 'linked' : verified?.trust ?? 'verified',\n confidence: 1,\n vendor: verified?.vendor ?? input.vendorHint ?? 'session-link',\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n sessionLink: true,\n linkedUserId: input.linkedUserId ?? null,\n verifiedRemotely: Boolean(verified),\n },\n }\n },\n})\n","import type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from \"../../version.js\"\n\n// Workforce SSO via OIDC ID tokens. Browser/Node SDKs forward the ID\n// token to the gateway's POST /v1/verify/sso route, which validates the\n// JWT signature + claims against the customer-configured IdP discovery\n// document. SAML is intentionally out of scope for v1.\nexport const sso = (): AuthMethod => ({\n name: 'sso',\n async authenticate(input, context) {\n if (!input.ssoIdToken) return null\n const verified = await context.verifyToken?.('sso', input.ssoIdToken)\n return {\n class: input.classHint ?? 'dom',\n trust: verified?.trust ?? 'verified',\n confidence: 1,\n vendor: verified?.vendor ?? input.vendorHint ?? 'sso',\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n sso: true,\n subject: verified?.subject ?? null,\n verifiedRemotely: Boolean(verified),\n ...(verified?.signals ?? {}),\n },\n }\n },\n})\n","import type { AuthMethod } from '../engine.js'\nimport { SDK_VERSION } from \"../../version.js\"\n\n// SPIFFE JWT-SVID verification. The gateway validates against the site's\n// configured SPIFFE Bundle (JWKS with `use: \"jwt-svid\"`) and returns the\n// SPIFFE ID as `verified.subject`. When the trust domain matches one of\n// the customer-configured Google trust domains (D1), the verifier sets\n// `vendor: 'google'` so we surface `googleAgent: true` and the engine\n// emits `protocol: 'google-agent'` on the trace instead of 'spiffe'.\nexport const spiffe = (): AuthMethod => ({\n name: 'spiffe',\n async authenticate(input, context) {\n if (!input.spiffeJwt) return null\n const verified = await context.verifyToken?.('spiffe', input.spiffeJwt)\n const isGoogleFlavor = verified?.vendor === 'google'\n return {\n class: input.classHint ?? 'webmcp',\n trust: verified?.trust ?? 'verified',\n confidence: 1,\n vendor: verified?.vendor ?? input.vendorHint ?? 'spiffe',\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: {\n spiffe: true,\n spiffeId: verified?.subject ?? null,\n subject: verified?.subject ?? null,\n verifiedRemotely: Boolean(verified),\n ...(isGoogleFlavor ? { googleAgent: true } : {}),\n ...(verified?.signals ?? {}),\n },\n }\n },\n})\n","import { AgentClass } from '@agentronics/protocol'\nimport { SDK_VERSION } from \"../../version.js\"\nimport type { AuthMethod } from '../engine.js'\n\nexport const xAgentHeader = (): AuthMethod => ({\n name: 'xAgentHeader',\n async authenticate(input) {\n if (!input.xAgentHeader) return null\n const [vendor = 'x-agent', rawClass = 'dom', proof] = input.xAgentHeader.split(';')\n const parsedClass = AgentClass.safeParse(rawClass)\n\n return {\n class: parsedClass.success ? parsedClass.data : 'dom',\n trust: proof ? 'verified' : 'declared',\n confidence: proof ? 1 : 0.8,\n vendor,\n userAgent: typeof navigator === 'undefined' ? null : navigator.userAgent,\n detectionVersion: SDK_VERSION,\n signals: { xAgentHeader: true, hasProof: Boolean(proof) },\n }\n },\n})\n","import type {\n AgentClass,\n AgentIdentity,\n AuthProtocol,\n IdentityClaim,\n VerificationResult,\n} from '@agentronics/protocol'\nimport type { TraceInput } from '../observability/tracer.js'\nimport { highestTrust } from './trustLevel.js'\nimport { bearer } from './methods/bearer.js'\nimport { detectionAsAuth } from './methods/detectionAsAuth.js'\nimport { extensionToken } from './methods/extensionToken.js'\nimport { mtls } from './methods/mtls.js'\nimport { oauth2 } from './methods/oauth2.js'\nimport { selfDeclaration } from './methods/selfDeclaration.js'\nimport { sessionLink } from './methods/sessionLink.js'\nimport { sso } from './methods/sso.js'\nimport { spiffe } from './methods/spiffe.js'\nimport { xAgentHeader } from './methods/xAgentHeader.js'\n\nexport type AuthMethodName =\n | 'detection'\n | 'selfDeclaration'\n | 'bearer'\n | 'xAgentHeader'\n | 'extensionToken'\n | 'sessionLink'\n | 'oauth2'\n | 'sso'\n | 'spiffe'\n | 'mtls'\n\nexport interface AuthInput {\n detected?: AgentIdentity | null\n declaration?: IdentityClaim\n bearerToken?: string\n xAgentHeader?: string\n extensionToken?: string\n sessionLinkToken?: string\n linkedUserId?: string\n oauth2AccessToken?: string\n oauth2Subject?: string\n ssoIdToken?: string\n spiffeJwt?: string\n xfccHeader?: string\n vendorHint?: string\n classHint?: AgentClass\n}\n\nexport interface AuthContext {\n verifyToken?: (\n method: Exclude<AuthMethodName, 'detection' | 'selfDeclaration' | 'xAgentHeader'>,\n token: string\n ) => Promise<VerificationResult | null>\n}\n\nexport interface AuthMethod {\n name: AuthMethodName\n authenticate(input: AuthInput, context: AuthContext): Promise<AgentIdentity | null>\n}\n\nexport interface AuthEngineOptions {\n methods?: AuthMethod[]\n context?: AuthContext\n onTrace?: (input: TraceInput) => void\n}\n\nexport const defaultAuthMethods = (): AuthMethod[] => [\n detectionAsAuth(),\n selfDeclaration(),\n bearer(),\n xAgentHeader(),\n extensionToken(),\n sessionLink(),\n oauth2(),\n sso(),\n spiffe(),\n mtls(),\n]\n\n// Method-name → dashboard-facing AuthProtocol label. The spiffe method\n// can override its emitted label to 'google-agent' by setting\n// `signals.googleAgent = true` (see methods/spiffe.ts) — that branch is\n// handled in resolveTraceProtocol() below.\nconst METHOD_TO_PROTOCOL: Record<AuthMethodName, AuthProtocol> = {\n detection: 'detection',\n selfDeclaration: 'declaration',\n bearer: 'bearer',\n xAgentHeader: 'x-agent-header',\n extensionToken: 'extension',\n sessionLink: 'session-link',\n oauth2: 'oauth2',\n sso: 'sso',\n spiffe: 'spiffe',\n mtls: 'mtls',\n}\n\nconst resolveTraceProtocol = (\n methodName: AuthMethodName,\n identity: AgentIdentity\n): AuthProtocol => {\n if (methodName === 'spiffe' && identity.signals?.googleAgent === true) {\n return 'google-agent'\n }\n return METHOD_TO_PROTOCOL[methodName]\n}\n\nexport const createAuthEngine = ({\n methods = defaultAuthMethods(),\n context = {},\n onTrace,\n}: AuthEngineOptions = {}) => ({\n async authenticate(input: AuthInput): Promise<AgentIdentity | null> {\n const identities: Array<{ method: AuthMethodName; identity: AgentIdentity }> = []\n const methodResults: Record<string, boolean> = {}\n\n for (const method of methods) {\n const identity = await method.authenticate(input, context)\n methodResults[method.name] = Boolean(identity)\n if (identity) identities.push({ method: method.name, identity })\n }\n\n const winner = highestTrust(identities.map((entry) => entry.identity))\n const winnerEntry = winner\n ? identities.find((entry) => entry.identity === winner)\n : undefined\n const protocol = winnerEntry\n ? resolveTraceProtocol(winnerEntry.method, winnerEntry.identity)\n : undefined\n const subject =\n typeof winner?.signals?.subject === 'string' ? winner.signals.subject : undefined\n\n const trace: TraceInput = {\n type: winner ? 'auth.identity_presented' : 'sdk.error',\n agent: winner,\n outcome: winner ? 'success' : 'error',\n metadata: {\n methods: methodResults,\n ...(protocol ? { protocol } : {}),\n ...(subject ? { subject } : {}),\n },\n }\n if (!winner) trace.error = 'No auth method produced an identity.'\n onTrace?.(trace)\n return winner\n },\n\n methods(): AuthMethodName[] {\n return methods.map((method) => method.name)\n },\n})\n\nexport type AuthEngine = ReturnType<typeof createAuthEngine>\n","import type { AgentIdentity } from '@agentronics/protocol'\n\nexport interface AgentContextSnapshot {\n identity: AgentIdentity | null\n source: 'detect' | 'declare' | 'authenticate' | 'cleared' | 'initial'\n updatedAt: string | null\n}\n\nexport type AgentContextListener = (snapshot: AgentContextSnapshot) => void\n\nconst INITIAL: AgentContextSnapshot = {\n identity: null,\n source: 'initial',\n updatedAt: null,\n}\n\nexport const createAgentContextStore = () => {\n let state: AgentContextSnapshot = INITIAL\n const listeners = new Set<AgentContextListener>()\n\n const notify = () => {\n if (listeners.size === 0) return\n listeners.forEach((listener) => listener(state))\n }\n\n return {\n snapshot(): AgentContextSnapshot {\n return state\n },\n set(identity: AgentIdentity | null, source: AgentContextSnapshot['source']) {\n state = { identity, source, updatedAt: new Date().toISOString() }\n notify()\n },\n subscribe(listener: AgentContextListener): () => void {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n }\n}\n\nexport type AgentContextStore = ReturnType<typeof createAgentContextStore>\n","export interface RateLimitRule {\n max: number\n windowSeconds: number\n}\n\nexport interface RateLimitResult {\n allowed: boolean\n remaining: number\n resetAt: number\n}\n\ninterface Bucket {\n count: number\n resetAt: number\n}\n\nexport interface RateLimiterStorage {\n read(key: string): string | null\n write(key: string, value: string): void\n}\n\nconst memoryStorage = (): RateLimiterStorage => {\n const map = new Map<string, string>()\n return {\n read: (key) => map.get(key) ?? null,\n write: (key, value) => {\n map.set(key, value)\n },\n }\n}\n\nconst browserStorage = (): RateLimiterStorage => {\n if (typeof window === 'undefined' || !window.localStorage) return memoryStorage()\n return {\n read: (key) => {\n try {\n return window.localStorage.getItem(key)\n } catch {\n return null\n }\n },\n write: (key, value) => {\n try {\n window.localStorage.setItem(key, value)\n } catch {\n // Quota/storage failures should not crash policy evaluation.\n }\n },\n }\n}\n\nconst decode = (raw: string | null): Bucket | null => {\n if (!raw) return null\n try {\n const parsed = JSON.parse(raw) as Bucket\n if (\n typeof parsed === 'object' &&\n parsed !== null &&\n Number.isFinite(parsed.count) &&\n Number.isFinite(parsed.resetAt)\n ) {\n return parsed\n }\n } catch {\n return null\n }\n return null\n}\n\nexport const createRateLimiter = (storage: RateLimiterStorage = browserStorage()) => ({\n consume(key: string, rule: RateLimitRule, now = Date.now()): RateLimitResult {\n const storageKey = `agtx:rate:${key}`\n const existing = decode(storage.read(storageKey))\n const resetAt =\n existing && existing.resetAt > now ? existing.resetAt : now + rule.windowSeconds * 1000\n const count = existing && existing.resetAt > now ? existing.count + 1 : 1\n storage.write(storageKey, JSON.stringify({ count, resetAt }))\n\n return {\n allowed: count <= rule.max,\n remaining: Math.max(0, rule.max - count),\n resetAt,\n }\n },\n})\n\nexport type RateLimiter = ReturnType<typeof createRateLimiter>\n","import {\n PolicyRule,\n TRUST_RANK,\n type AgentIdentity,\n type PolicyDecision,\n type PolicyEvaluation,\n type PolicyRule as PolicyRuleType,\n} from '@agentronics/protocol'\nimport { createRateLimiter, type RateLimiter } from './rateLimiter.js'\n\nconst matchTool = (pattern: string, tool: string): boolean => {\n if (pattern === '*' || pattern === tool) return true\n if (!pattern.includes('*')) return false\n const regex = new RegExp('^' + pattern.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&').replace(/\\*/g, '.*') + '$')\n return regex.test(tool)\n}\n\nconst meetsTrust = (identity: AgentIdentity | null, rule: PolicyRuleType): boolean => {\n const have = identity ? TRUST_RANK[identity.trust] : -1\n const need = TRUST_RANK[rule.minTrust]\n return have >= need\n}\n\nconst meetsClass = (identity: AgentIdentity | null, rule: PolicyRuleType): boolean => {\n if (rule.allowedClasses.length === 0) return true\n if (!identity) return false\n return rule.allowedClasses.includes(identity.class)\n}\n\nconst DEFAULT_DECISION: PolicyDecision = 'review'\n\nexport interface EvaluateInput {\n tool: string\n identity: AgentIdentity | null\n}\n\nconst rateLimitKey = (tool: string, identity: AgentIdentity | null): string => {\n const classPart = identity?.class ?? 'unknown'\n const vendorPart = identity?.vendor ?? 'unknown'\n const trustPart = identity?.trust ?? 'none'\n return `${tool}:${classPart}:${vendorPart}:${trustPart}`\n}\n\nexport interface PolicyEngineOptions {\n rateLimiter?: RateLimiter\n}\n\nexport const createPolicyEngine = (\n initial: PolicyRuleType[] = [],\n options: PolicyEngineOptions = {}\n) => {\n let rules: PolicyRuleType[] = initial.map((rule) => PolicyRule.parse(rule))\n const rateLimiter = options.rateLimiter ?? createRateLimiter()\n\n return {\n set(next: PolicyRuleType[]) {\n rules = next.map((rule) => PolicyRule.parse(rule))\n },\n\n list(): PolicyRuleType[] {\n return [...rules]\n },\n\n evaluate({ tool, identity }: EvaluateInput): PolicyEvaluation {\n for (const rule of rules) {\n if (!matchTool(rule.tool, tool)) continue\n if (!meetsTrust(identity, rule)) {\n return {\n decision: 'deny',\n ruleId: rule.id,\n reason: `Rule \"${rule.id}\" requires trust >= ${rule.minTrust}.`,\n }\n }\n if (!meetsClass(identity, rule)) {\n return {\n decision: 'deny',\n ruleId: rule.id,\n reason: `Rule \"${rule.id}\" restricts to classes: ${rule.allowedClasses.join(', ')}.`,\n }\n }\n if (rule.rateLimit) {\n const rate = rateLimiter.consume(rateLimitKey(tool, identity), rule.rateLimit)\n if (!rate.allowed) {\n return {\n decision: 'deny',\n ruleId: rule.id,\n reason: `Rule \"${rule.id}\" rate limit exceeded. Resets at ${new Date(rate.resetAt).toISOString()}.`,\n }\n }\n }\n return {\n decision: rule.decision,\n ruleId: rule.id,\n reason: `Matched rule \"${rule.id}\".`,\n }\n }\n return {\n decision: DEFAULT_DECISION,\n ruleId: null,\n reason: `No rule matched tool \"${tool}\". Falling back to \"${DEFAULT_DECISION}\".`,\n }\n },\n }\n}\n\nexport type PolicyEngine = ReturnType<typeof createPolicyEngine>\n","import { PolicyRule, type PolicyRule as PolicyRuleRecord } from '@agentronics/protocol'\n\nexport interface PolicyCacheOptions {\n gatewayUrl: string\n siteId: string\n publishableKey: string\n fetcher?: typeof fetch\n}\n\nexport interface PolicyCacheSnapshot {\n policies: PolicyRuleRecord[]\n etag: string | null\n}\n\nexport const createPolicyCache = ({\n gatewayUrl,\n siteId,\n publishableKey,\n fetcher = fetch,\n}: PolicyCacheOptions) => {\n let snapshot: PolicyCacheSnapshot = { policies: [], etag: null }\n\n return {\n snapshot(): PolicyCacheSnapshot {\n return {\n policies: [...snapshot.policies],\n etag: snapshot.etag,\n }\n },\n\n async sync(): Promise<PolicyCacheSnapshot> {\n const response = await fetcher(\n `${gatewayUrl.replace(/\\/$/, '')}/v1/sites/${encodeURIComponent(siteId)}/policies`,\n {\n headers: {\n authorization: `Bearer ${publishableKey}`,\n ...(snapshot.etag ? { 'if-none-match': snapshot.etag } : {}),\n },\n }\n )\n if (response.status === 304) return this.snapshot()\n if (!response.ok) throw new Error(`Policy sync failed with status ${response.status}.`)\n\n const body = (await response.json()) as { policies?: unknown }\n const policies = PolicyRule.array().parse(body.policies ?? [])\n snapshot = {\n policies,\n etag: response.headers.get('etag'),\n }\n return this.snapshot()\n },\n }\n}\n\nexport type PolicyCache = ReturnType<typeof createPolicyCache>\n","export interface DenyOverlayOptions {\n message?: string\n durationMs?: number\n documentRef?: Document\n}\n\nexport const showDenyOverlay = ({\n message = 'Agent action blocked by site policy.',\n durationMs = 2400,\n documentRef = typeof document === 'undefined' ? undefined : document,\n}: DenyOverlayOptions = {}) => {\n if (!documentRef?.body) return null\n\n const node = documentRef.createElement('div')\n node.setAttribute('role', 'status')\n node.setAttribute('data-agentronics-deny-overlay', 'true')\n node.textContent = message\n Object.assign(node.style, {\n position: 'fixed',\n zIndex: '2147483647',\n left: '50%',\n bottom: '24px',\n transform: 'translateX(-50%)',\n maxWidth: 'min(520px, calc(100vw - 32px))',\n padding: '12px 16px',\n borderRadius: '8px',\n background: '#07091A',\n color: '#F4F4F5',\n border: '1px solid #6366F1',\n boxShadow: '0 20px 48px -16px rgba(7,9,26,0.55)',\n font: \"13px/1.45 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace\",\n })\n\n documentRef.body.appendChild(node)\n window.setTimeout(() => node.remove(), durationMs)\n return node\n}\n","import type { AgentIdentity } from '@agentronics/protocol'\nimport { showDenyOverlay } from './overlay.js'\nimport type { PolicyEngine } from './engine.js'\n\nexport interface DomEnforcerOptions {\n policyEngine: PolicyEngine\n getIdentity: () => AgentIdentity | null | Promise<AgentIdentity | null>\n documentRef?: Document\n selector?: string\n}\n\nexport const installDomEnforcer = ({\n policyEngine,\n getIdentity,\n documentRef = typeof document === 'undefined' ? undefined : document,\n selector = '[data-agentronics-tool]',\n}: DomEnforcerOptions) => {\n if (!documentRef) return { uninstall: () => undefined }\n\n const handler = (event: Event) => {\n const target = event.target instanceof Element ? event.target.closest(selector) : null\n if (!(target instanceof HTMLElement)) return\n const tool = target.dataset.agentronicsTool\n if (!tool) return\n\n void Promise.resolve(getIdentity()).then((identity) => {\n const evaluation = policyEngine.evaluate({ tool, identity })\n if (evaluation.decision !== 'deny') return\n event.preventDefault()\n event.stopPropagation()\n showDenyOverlay({ message: evaluation.reason, documentRef })\n })\n }\n\n documentRef.addEventListener('click', handler, true)\n return {\n uninstall: () => documentRef.removeEventListener('click', handler, true),\n }\n}\n","import type { MemoryScope } from '@agentronics/protocol'\n\nexport interface ScopeBackend {\n read(key: string): string | null\n write(key: string, value: string): void\n remove(key: string): void\n keys(): string[]\n}\n\nconst inMemoryBackend = (): ScopeBackend => {\n const store = new Map<string, string>()\n return {\n read: (key) => store.get(key) ?? null,\n write: (key, value) => {\n store.set(key, value)\n },\n remove: (key) => {\n store.delete(key)\n },\n keys: () => [...store.keys()],\n }\n}\n\nconst webStorageBackend = (storage: Storage, prefix: string): ScopeBackend => ({\n read: (key) => {\n try {\n return storage.getItem(prefix + key)\n } catch {\n return null\n }\n },\n write: (key, value) => {\n try {\n storage.setItem(prefix + key, value)\n } catch {\n // quota exceeded or storage disabled — fail silently, the in-memory fallback is acceptable\n }\n },\n remove: (key) => {\n try {\n storage.removeItem(prefix + key)\n } catch {\n // ignore\n }\n },\n keys: () => {\n const out: string[] = []\n try {\n for (let i = 0; i < storage.length; i++) {\n const k = storage.key(i)\n if (k && k.startsWith(prefix)) out.push(k.slice(prefix.length))\n }\n } catch {\n // ignore\n }\n return out\n },\n})\n\nconst PREFIX = 'agtx:'\n\nexport const createBackends = (): Record<MemoryScope, ScopeBackend> => {\n const hasWindow = typeof window !== 'undefined'\n const session =\n hasWindow && typeof window.sessionStorage !== 'undefined'\n ? webStorageBackend(window.sessionStorage, PREFIX + 'session:')\n : inMemoryBackend()\n const user =\n hasWindow && typeof window.localStorage !== 'undefined'\n ? webStorageBackend(window.localStorage, PREFIX + 'user:')\n : inMemoryBackend()\n return {\n session,\n user,\n org: inMemoryBackend(),\n }\n}\n","import { MemoryEntry, type MemoryScope } from '@agentronics/protocol'\nimport type { TraceInput } from '../observability/tracer.js'\nimport { createBackends, type ScopeBackend } from './storage.js'\n\ninterface StoredRecord {\n value: unknown\n expiresAt: number | null\n updatedAt: string\n}\n\nconst isExpired = (record: StoredRecord, now: number): boolean =>\n record.expiresAt !== null && record.expiresAt <= now\n\nconst decode = (raw: string | null): StoredRecord | null => {\n if (!raw) return null\n try {\n const parsed = JSON.parse(raw) as StoredRecord\n if (typeof parsed !== 'object' || parsed === null) return null\n return parsed\n } catch {\n return null\n }\n}\n\nconst encode = (record: StoredRecord): string => JSON.stringify(record)\n\nexport interface MemoryGetOptions {\n scope?: MemoryScope\n}\n\nexport interface MemorySetOptions {\n scope?: MemoryScope\n ttlSeconds?: number\n}\n\nexport interface MemoryStoreOptions {\n onTrace?: (input: TraceInput) => void\n}\n\nexport const createMemoryStore = (options: MemoryStoreOptions = {}) => {\n const backends: Record<MemoryScope, ScopeBackend> = createBackends()\n const emit = (input: TraceInput) => {\n options.onTrace?.(input)\n }\n\n const get = (key: string, options: MemoryGetOptions = {}): unknown => {\n const scope = options.scope ?? 'session'\n const backend = backends[scope]\n const record = decode(backend.read(key))\n if (!record) {\n emit({ type: 'memory.accessed', metadata: { operation: 'get', key, scope, hit: false } })\n return undefined\n }\n if (isExpired(record, Date.now())) {\n backend.remove(key)\n emit({ type: 'memory.accessed', metadata: { operation: 'get', key, scope, hit: false, expired: true } })\n return undefined\n }\n emit({ type: 'memory.accessed', metadata: { operation: 'get', key, scope, hit: true } })\n return record.value\n }\n\n const set = (key: string, value: unknown, options: MemorySetOptions = {}): MemoryEntry => {\n const scope = options.scope ?? 'session'\n const ttl = options.ttlSeconds ?? null\n const now = Date.now()\n const record: StoredRecord = {\n value,\n expiresAt: ttl === null ? null : now + ttl * 1000,\n updatedAt: new Date(now).toISOString(),\n }\n backends[scope].write(key, encode(record))\n emit({ type: 'memory.updated', metadata: { operation: 'set', key, scope, ttlSeconds: ttl } })\n return MemoryEntry.parse({\n key,\n value,\n scope,\n ttlSeconds: ttl,\n updatedAt: record.updatedAt,\n })\n }\n\n const remove = (key: string, options: MemoryGetOptions = {}) => {\n const scope = options.scope ?? 'session'\n backends[scope].remove(key)\n emit({ type: 'memory.updated', metadata: { operation: 'remove', key, scope } })\n }\n\n const list = (options: MemoryGetOptions = {}): MemoryEntry[] => {\n const scope = options.scope ?? 'session'\n const backend = backends[scope]\n const now = Date.now()\n const out: MemoryEntry[] = []\n for (const key of backend.keys()) {\n const record = decode(backend.read(key))\n if (!record) continue\n if (isExpired(record, now)) {\n backend.remove(key)\n continue\n }\n out.push(\n MemoryEntry.parse({\n key,\n value: record.value,\n scope,\n ttlSeconds:\n record.expiresAt === null ? null : Math.max(0, Math.round((record.expiresAt - now) / 1000)),\n updatedAt: record.updatedAt,\n })\n )\n }\n emit({ type: 'memory.accessed', metadata: { operation: 'list', scope, count: out.length } })\n return out\n }\n\n const clear = (options: MemoryGetOptions = {}) => {\n const scope = options.scope ?? 'session'\n const backend = backends[scope]\n const count = backend.keys().length\n for (const key of backend.keys()) backend.remove(key)\n emit({ type: 'memory.updated', metadata: { operation: 'clear', scope, count } })\n }\n\n return { get, set, remove, list, clear }\n}\n\nexport type MemoryStore = ReturnType<typeof createMemoryStore>\n","import {\n SITE_MEMORY_DEFAULT,\n SiteMemory as SiteMemorySchema,\n SiteMemoryPageContext,\n type SiteMemory,\n} from '@agentronics/protocol'\nimport type { TraceInput } from '../observability/tracer.js'\n\nexport interface SiteMemoryStoreOptions {\n initial?: Partial<SiteMemory>\n onTrace?: (input: TraceInput) => void\n}\n\nexport interface ProvideForPageInput {\n path: string\n payload: Record<string, unknown>\n}\n\nconst cloneSiteMemory = (memory: SiteMemory): SiteMemory =>\n // Round-trip via the schema so callers always receive a validated, defaulted snapshot.\n SiteMemorySchema.parse(JSON.parse(JSON.stringify(memory)))\n\nconst stamp = (memory: SiteMemory): SiteMemory => ({\n ...memory,\n updatedAt: new Date().toISOString(),\n})\n\nexport type SiteMemoryListener = (snapshot: SiteMemory) => void\n\nexport const createSiteMemoryStore = (options: SiteMemoryStoreOptions = {}) => {\n let state: SiteMemory = SiteMemorySchema.parse({\n ...SITE_MEMORY_DEFAULT,\n ...(options.initial ?? {}),\n })\n let cachedSnapshot: SiteMemory | null = null\n const listeners = new Set<SiteMemoryListener>()\n const emit = (input: TraceInput) => {\n options.onTrace?.(input)\n }\n const invalidate = () => {\n cachedSnapshot = null\n }\n const notify = () => {\n if (listeners.size === 0) return\n const snap = cloneSiteMemory(state)\n cachedSnapshot = snap\n listeners.forEach((listener) => listener(snap))\n }\n\n const provide = (next: Partial<SiteMemory>): SiteMemory => {\n const merged = SiteMemorySchema.parse({\n ...state,\n ...next,\n // Workflows/policies/uiGuidance/pageContexts merge by key so partial provides do not nuke siblings.\n workflows: { ...state.workflows, ...(next.workflows ?? {}) },\n policies: { ...state.policies, ...(next.policies ?? {}) },\n uiGuidance: { ...state.uiGuidance, ...(next.uiGuidance ?? {}) },\n pageContexts: { ...state.pageContexts, ...(next.pageContexts ?? {}) },\n })\n state = stamp(merged)\n invalidate()\n emit({\n type: 'memory.updated',\n metadata: { kind: 'site', operation: 'provide', keys: Object.keys(next) },\n })\n notify()\n return snapshot()\n }\n\n const update = (path: string, value: unknown): SiteMemory => {\n const parts = path.split('.').filter(Boolean)\n if (parts.length === 0) {\n throw new Error('siteMemory.update() requires a non-empty dot-path.')\n }\n const next = JSON.parse(JSON.stringify(state)) as Record<string, unknown>\n let cursor: Record<string, unknown> = next\n for (let i = 0; i < parts.length - 1; i++) {\n const key = parts[i]!\n const existing = cursor[key]\n if (typeof existing !== 'object' || existing === null || Array.isArray(existing)) {\n cursor[key] = {}\n }\n cursor = cursor[key] as Record<string, unknown>\n }\n cursor[parts[parts.length - 1]!] = value\n state = stamp(SiteMemorySchema.parse(next))\n invalidate()\n emit({ type: 'memory.updated', metadata: { kind: 'site', operation: 'update', path } })\n notify()\n return snapshot()\n }\n\n const provideForPage = (input: ProvideForPageInput): SiteMemoryPageContext => {\n const context = SiteMemoryPageContext.parse({\n path: input.path,\n payload: input.payload,\n updatedAt: new Date().toISOString(),\n })\n state = stamp({\n ...state,\n pageContexts: { ...state.pageContexts, [input.path]: context },\n })\n invalidate()\n emit({\n type: 'memory.updated',\n metadata: { kind: 'site', operation: 'provideForPage', path: input.path },\n })\n notify()\n return { ...context, payload: { ...context.payload } }\n }\n\n const snapshot = (): SiteMemory => {\n if (!cachedSnapshot) cachedSnapshot = cloneSiteMemory(state)\n return cachedSnapshot\n }\n\n const get = (path?: string): unknown => {\n emit({\n type: 'memory.accessed',\n metadata: { kind: 'site', operation: path ? 'get' : 'snapshot', path: path ?? null },\n })\n if (!path) return cloneSiteMemory(state)\n const parts = path.split('.').filter(Boolean)\n let cursor: unknown = state\n for (const key of parts) {\n if (typeof cursor !== 'object' || cursor === null) return undefined\n cursor = (cursor as Record<string, unknown>)[key]\n }\n return cursor\n }\n\n const getForPage = (path: string): SiteMemoryPageContext | null => {\n emit({\n type: 'memory.accessed',\n metadata: { kind: 'site', operation: 'getForPage', path },\n })\n const found = state.pageContexts[path]\n return found ? { ...found, payload: { ...found.payload } } : null\n }\n\n const replace = (next: SiteMemory): SiteMemory => {\n state = stamp(SiteMemorySchema.parse(next))\n invalidate()\n notify()\n return snapshot()\n }\n\n const subscribe = (listener: SiteMemoryListener): (() => void) => {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n }\n\n return { provide, update, provideForPage, snapshot, get, getForPage, replace, subscribe }\n}\n\nexport type SiteMemoryStore = ReturnType<typeof createSiteMemoryStore>\n","import { SiteMemory as SiteMemorySchema, type SiteMemory } from '@agentronics/protocol'\n\nexport interface MemoryCacheOptions {\n gatewayUrl: string\n siteId: string\n publishableKey: string\n fetcher?: typeof fetch\n}\n\nexport interface MemoryCacheSnapshot {\n memory: SiteMemory | null\n etag: string | null\n}\n\nexport const createMemoryCache = ({\n gatewayUrl,\n siteId,\n publishableKey,\n fetcher = fetch,\n}: MemoryCacheOptions) => {\n let snapshot: MemoryCacheSnapshot = { memory: null, etag: null }\n\n return {\n snapshot(): MemoryCacheSnapshot {\n return {\n memory: snapshot.memory ? SiteMemorySchema.parse(snapshot.memory) : null,\n etag: snapshot.etag,\n }\n },\n\n async sync(): Promise<MemoryCacheSnapshot> {\n const response = await fetcher(\n `${gatewayUrl.replace(/\\/$/, '')}/v1/sites/${encodeURIComponent(siteId)}/memory`,\n {\n headers: {\n authorization: `Bearer ${publishableKey}`,\n ...(snapshot.etag ? { 'if-none-match': snapshot.etag } : {}),\n },\n }\n )\n if (response.status === 304) return this.snapshot()\n if (!response.ok) throw new Error(`Memory sync failed with status ${response.status}.`)\n\n const body = (await response.json()) as { memory?: unknown }\n const memory = SiteMemorySchema.parse(body.memory ?? {})\n snapshot = {\n memory,\n etag: response.headers.get('etag'),\n }\n return this.snapshot()\n },\n }\n}\n\nexport type MemoryCache = ReturnType<typeof createMemoryCache>\n","import type { SiteMemory } from '@agentronics/protocol'\n\nexport interface WebMcpContextTool {\n name: string\n description: string\n inputSchema: { type: 'object'; properties: Record<string, unknown>; required: string[] }\n invoke(input?: { path?: string }): { content: SiteMemory | unknown }\n}\n\nexport interface WebMcpContextOptions {\n toolName?: string\n description?: string\n getSnapshot: () => SiteMemory\n onAccess?: (path: string | null) => void\n}\n\nexport const createWebMcpContextTool = ({\n toolName = 'getSiteContext',\n description = 'Returns Agentronics site memory: page map, workflows, policies, UI guidance.',\n getSnapshot,\n onAccess,\n}: WebMcpContextOptions): WebMcpContextTool => ({\n name: toolName,\n description,\n inputSchema: {\n type: 'object',\n properties: {\n path: {\n type: 'string',\n description: 'Optional dot-path into the site memory (e.g. \"workflows.purchase\").',\n },\n },\n required: [],\n },\n invoke(input = {}) {\n const snapshot = getSnapshot()\n const path = input.path ?? null\n onAccess?.(path)\n if (!path) return { content: snapshot }\n const parts = path.split('.').filter(Boolean)\n let cursor: unknown = snapshot\n for (const key of parts) {\n if (typeof cursor !== 'object' || cursor === null) return { content: undefined }\n cursor = (cursor as Record<string, unknown>)[key]\n }\n return { content: cursor }\n },\n})\n","import type { SiteMemory } from '@agentronics/protocol'\n\nconst META_PREFIX = 'agent-context-'\nconst JSONLD_ID = 'agentronics-site-context'\n\nexport interface MetaTagsOptions {\n doc?: Document\n snapshot: SiteMemory\n schemaType?: string\n}\n\nconst safeJson = (value: unknown): string => {\n try {\n return JSON.stringify(value)\n } catch {\n return '{}'\n }\n}\n\nconst setMeta = (doc: Document, name: string, content: string) => {\n let tag = doc.querySelector<HTMLMetaElement>(`meta[name=\"${name}\"]`)\n if (!tag) {\n tag = doc.createElement('meta')\n tag.setAttribute('name', name)\n doc.head.appendChild(tag)\n }\n tag.setAttribute('content', content)\n}\n\nconst removeByName = (doc: Document, name: string) => {\n doc.querySelectorAll(`meta[name=\"${name}\"]`).forEach((node) => node.remove())\n}\n\nexport const installMetaTags = ({\n doc = typeof document === 'undefined' ? (null as unknown as Document) : document,\n snapshot,\n schemaType = 'WebSite',\n}: MetaTagsOptions): { uninstall: () => void } => {\n if (!doc) return { uninstall: () => {} }\n\n setMeta(doc, `${META_PREFIX}version`, snapshot.version)\n setMeta(doc, `${META_PREFIX}updated-at`, snapshot.updatedAt ?? new Date().toISOString())\n if (snapshot.siteMap?.navigation?.flow) {\n setMeta(doc, `${META_PREFIX}flow`, snapshot.siteMap.navigation.flow)\n }\n setMeta(doc, `${META_PREFIX}workflows`, Object.keys(snapshot.workflows).join(','))\n\n let script = doc.getElementById(JSONLD_ID) as HTMLScriptElement | null\n if (!script) {\n script = doc.createElement('script')\n script.type = 'application/ld+json'\n script.id = JSONLD_ID\n doc.head.appendChild(script)\n }\n script.textContent = safeJson({\n '@context': 'https://schema.org',\n '@type': schemaType,\n name: 'Agentronics Site Memory',\n agentronics: snapshot,\n })\n\n return {\n uninstall: () => {\n removeByName(doc, `${META_PREFIX}version`)\n removeByName(doc, `${META_PREFIX}updated-at`)\n removeByName(doc, `${META_PREFIX}flow`)\n removeByName(doc, `${META_PREFIX}workflows`)\n doc.getElementById(JSONLD_ID)?.remove()\n },\n }\n}\n","import type { SiteMemory } from '@agentronics/protocol'\n\nconst OVERLAY_ID = 'agentronics-memory-overlay'\n\nexport interface MemoryOverlayOptions {\n doc?: Document\n snapshot: SiteMemory\n hidden?: boolean\n}\n\nconst styles = (hidden: boolean): string => `\nposition: fixed;\nbottom: 16px;\nright: 16px;\nmax-width: 320px;\npadding: 10px 12px;\nbackground: rgba(17, 24, 39, 0.92);\ncolor: #f9fafb;\nfont: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;\nborder-radius: 8px;\nz-index: 2147483647;\nopacity: ${hidden ? '0' : '1'};\npointer-events: ${hidden ? 'none' : 'auto'};\nbox-shadow: 0 12px 32px rgba(15, 23, 42, 0.35);\n`\n\nconst summarize = (snapshot: SiteMemory): string => {\n const pages = snapshot.siteMap?.pages?.length ?? 0\n const workflows = Object.keys(snapshot.workflows).length\n const ui = Object.keys(snapshot.uiGuidance).length\n return `Agentronics site memory · pages:${pages} · workflows:${workflows} · ui-hints:${ui}`\n}\n\nexport const installMemoryOverlay = ({\n doc = typeof document === 'undefined' ? (null as unknown as Document) : document,\n snapshot,\n hidden = false,\n}: MemoryOverlayOptions): { uninstall: () => void; refresh: (next: SiteMemory) => void } => {\n if (!doc) return { uninstall: () => {}, refresh: () => {} }\n\n let host = doc.getElementById(OVERLAY_ID) as HTMLDivElement | null\n if (!host) {\n host = doc.createElement('div')\n host.id = OVERLAY_ID\n host.setAttribute('role', 'note')\n host.setAttribute('aria-label', 'Agentronics site memory summary')\n host.setAttribute('data-agent-context', 'overlay')\n doc.body.appendChild(host)\n }\n host.setAttribute('style', styles(hidden))\n host.textContent = summarize(snapshot)\n\n return {\n uninstall: () => {\n host?.remove()\n },\n refresh: (next: SiteMemory) => {\n if (!host) return\n host.textContent = summarize(next)\n },\n }\n}\n","import { SiteMemory as SiteMemorySchema, type SiteMemory } from '@agentronics/protocol'\n\nexport const WELL_KNOWN_PATH = '/.well-known/agent-context.json'\n\nexport interface WellKnownClientOptions {\n origin?: string\n fetcher?: typeof fetch\n signal?: AbortSignal\n}\n\nexport const fetchWellKnownContext = async ({\n origin,\n fetcher = fetch,\n signal,\n}: WellKnownClientOptions = {}): Promise<SiteMemory | null> => {\n const target =\n (origin ? origin.replace(/\\/$/, '') : typeof window !== 'undefined' ? window.location.origin : '') +\n WELL_KNOWN_PATH\n if (!target.startsWith('http')) {\n return null\n }\n const fetchInit: RequestInit = { headers: { accept: 'application/json' } }\n if (signal !== undefined) fetchInit.signal = signal\n const response = await fetcher(target, fetchInit)\n if (!response.ok) {\n if (response.status === 404) return null\n throw new Error(`well-known agent-context fetch failed with status ${response.status}.`)\n }\n const payload = (await response.json()) as unknown\n return SiteMemorySchema.parse(payload)\n}\n\nexport interface ServeWellKnownOptions {\n snapshot: SiteMemory\n}\n\n/**\n * Returns a JSON string suitable for /.well-known/agent-context.json. Hosts proxy this\n * through their CDN/edge so any agent can fetch it with no SDK installed.\n */\nexport const serializeWellKnownContext = ({ snapshot }: ServeWellKnownOptions): string =>\n JSON.stringify(SiteMemorySchema.parse(snapshot))\n","import type { AgentIdentity, PolicyEvaluation, PolicyRule } from '@agentronics/protocol'\nimport type { TraceInput } from '../observability/tracer.js'\n\nexport interface GovernedTool<Input = unknown, Output = unknown> {\n name: string\n version?: string\n group?: string\n description?: string\n inputSchema?: Record<string, unknown>\n outputSchema?: Record<string, unknown>\n stage?: string\n authz?: Omit<PolicyRule, 'id' | 'tool'>\n rateLimit?: PolicyRule['rateLimit']\n execute: (input: Input, context: { identity: AgentIdentity | null }) => Promise<Output> | Output\n}\n\nexport interface ToolRegistryOptions {\n evaluate: (tool: string, options?: { identity?: AgentIdentity | null }) => Promise<PolicyEvaluation>\n setPolicies?: (rules: PolicyRule[]) => void\n listPolicies?: () => PolicyRule[]\n onTrace?: (input: TraceInput) => void\n /**\n * Resolves the ambient agent identity for `execute()` calls that don't pass\n * one explicitly. The SDK wires this to the agentContext snapshot so a\n * button-bound tool fires with the detected agent attached — without\n * forcing every consumer to thread identity through their click handlers.\n *\n * Semantics:\n * - `execute(name, input)` or `execute(name, input, undefined)` → resolver\n * - `execute(name, input, null)` → respected (caller wants anonymous attribution)\n * - `execute(name, input, identity)` → respected\n */\n identityResolver?: () => AgentIdentity | null\n}\n\nexport interface ToolRegistry {\n register(tool: GovernedTool): () => void\n unregister(name: string): void\n enable(name: string): void\n disable(name: string): void\n isEnabled(name: string): boolean\n list(options?: { includeDisabled?: boolean }): GovernedTool[]\n get(name: string): GovernedTool | undefined\n execute<Input, Output>(\n name: string,\n input: Input,\n identity?: AgentIdentity | null\n ): Promise<Output>\n}\n\nexport const createToolRegistry = ({\n evaluate,\n setPolicies,\n listPolicies,\n onTrace,\n identityResolver,\n}: ToolRegistryOptions): ToolRegistry => {\n const tools = new Map<string, GovernedTool>()\n const disabled = new Set<string>()\n\n const writePolicyFor = (tool: GovernedTool) => {\n if (!tool.authz || !setPolicies || !listPolicies) return\n const rule: PolicyRule = {\n id: `tool:${tool.name}`,\n tool: tool.name,\n ...tool.authz,\n rateLimit: tool.rateLimit ?? tool.authz.rateLimit,\n }\n setPolicies([...listPolicies().filter((item) => item.id !== rule.id), rule])\n }\n\n return {\n register(tool) {\n tools.set(tool.name, tool)\n disabled.delete(tool.name)\n writePolicyFor(tool)\n onTrace?.({\n type: 'tool.registered',\n tool: tool.name,\n metadata: {\n version: tool.version ?? null,\n group: tool.group ?? null,\n stage: tool.stage ?? null,\n },\n })\n return () => {\n tools.delete(tool.name)\n disabled.delete(tool.name)\n }\n },\n unregister(name) {\n tools.delete(name)\n disabled.delete(name)\n },\n enable(name) {\n if (!tools.has(name) || !disabled.has(name)) return\n disabled.delete(name)\n onTrace?.({\n type: 'tool.surfaced',\n tool: name,\n metadata: { state: 'enabled' },\n })\n },\n disable(name) {\n if (!tools.has(name) || disabled.has(name)) return\n disabled.add(name)\n onTrace?.({\n type: 'tool.surfaced',\n tool: name,\n metadata: { state: 'disabled' },\n })\n },\n isEnabled: (name) => tools.has(name) && !disabled.has(name),\n list({ includeDisabled = false } = {}) {\n const all = [...tools.values()]\n return includeDisabled ? all : all.filter((tool) => !disabled.has(tool.name))\n },\n get: (name) => tools.get(name),\n async execute<Input, Output>(\n name: string,\n input: Input,\n identity?: AgentIdentity | null\n ): Promise<Output> {\n // `undefined` means \"use the ambient identity\"; explicit `null` means\n // \"anonymous\". This lets button handlers stay as `tools.execute(name,\n // input)` while still being attributed to whatever detect()/declare()\n // resolved into agentContext.\n const resolvedIdentity =\n identity === undefined ? (identityResolver?.() ?? null) : identity\n const tool = tools.get(name) as GovernedTool<Input, Output> | undefined\n if (!tool) throw new Error(`Tool \"${name}\" is not registered.`)\n if (disabled.has(name)) {\n const policy: PolicyEvaluation = {\n decision: 'deny',\n ruleId: `tool:${name}`,\n reason: 'Tool is disabled.',\n }\n onTrace?.({ type: 'tool.executed', tool: name, agent: resolvedIdentity, policy, outcome: 'blocked' })\n throw new Error(policy.reason)\n }\n const policy = await evaluate(name, { identity: resolvedIdentity })\n if (policy.decision === 'deny') {\n onTrace?.({ type: 'tool.executed', tool: name, agent: resolvedIdentity, policy, outcome: 'blocked' })\n throw new Error(policy.reason)\n }\n // Time the execution and trace the outcome either way — a tool that\n // throws is still something the agent did, and the observability /\n // analytics surfaces need both the latency and the error.\n const start = Date.now()\n try {\n const output = await tool.execute(input, { identity: resolvedIdentity })\n onTrace?.({\n type: 'tool.executed',\n tool: name,\n agent: resolvedIdentity,\n policy,\n outcome: 'success',\n durationMs: Date.now() - start,\n })\n return output\n } catch (error) {\n onTrace?.({\n type: 'tool.executed',\n tool: name,\n agent: resolvedIdentity,\n policy,\n outcome: 'error',\n durationMs: Date.now() - start,\n error: error instanceof Error ? error.message : String(error),\n })\n throw error\n }\n },\n }\n}\n","import type { ToolDescriptor } from '@agentronics/protocol'\nimport type { GovernedTool } from './registry.js'\n\n/**\n * Map a registered tool to the wire descriptor the gateway/dashboard consume.\n * `tokens` uses the same rough OpenAI-style rule of thumb the SDK's token\n * budget uses (≈ characters / 4) so the dashboard's per-tool cost matches.\n */\nexport const toToolDescriptor = (tool: GovernedTool): ToolDescriptor => {\n const descriptor: ToolDescriptor = {\n name: tool.name,\n description: tool.description ?? '',\n inputSchema: tool.inputSchema ?? {},\n tokens: 0,\n }\n if (tool.group) descriptor.group = tool.group\n if (tool.stage) descriptor.page = tool.stage\n if (tool.outputSchema) descriptor.outputSchema = tool.outputSchema\n descriptor.tokens = Math.ceil(\n JSON.stringify({\n name: descriptor.name,\n description: descriptor.description,\n inputSchema: descriptor.inputSchema,\n ...(descriptor.outputSchema ? { outputSchema: descriptor.outputSchema } : {}),\n }).length / 4\n )\n return descriptor\n}\n\nexport interface ToolSyncOptions {\n gatewayUrl: string\n siteId: string\n publishableKey: string\n fetcher?: typeof fetch\n}\n\n/** Pushes the full tool registry to the gateway for dashboard display. */\nexport const createToolSync = ({\n gatewayUrl,\n siteId,\n publishableKey,\n fetcher = fetch,\n}: ToolSyncOptions) => ({\n async push(tools: GovernedTool[]): Promise<number> {\n const descriptors = tools.map(toToolDescriptor)\n const response = await fetcher(\n `${gatewayUrl.replace(/\\/$/, '')}/v1/sites/${encodeURIComponent(siteId)}/tools`,\n {\n method: 'PUT',\n headers: {\n authorization: `Bearer ${publishableKey}`,\n 'content-type': 'application/json',\n },\n body: JSON.stringify({ registry: { tools: descriptors } }),\n }\n )\n if (!response.ok) {\n throw new Error(`Tool sync failed with status ${response.status}.`)\n }\n return descriptors.length\n },\n})\n\nexport type ToolSync = ReturnType<typeof createToolSync>\n","import type { TraceInput } from '../observability/tracer.js'\n\nexport interface ProgressionTransition {\n on: string\n to: string\n}\n\nexport interface ProgressionStage {\n name: string\n enables?: string[]\n transitions?: ProgressionTransition[]\n}\n\nexport interface ProgressionConfig {\n initial: string\n stages: ProgressionStage[]\n}\n\nexport interface ProgressionStore {\n current(): string\n enabledStages(): string[]\n notify(toolName: string): { changed: boolean; from: string; to: string }\n set(stage: string): { changed: boolean; from: string; to: string }\n reset(): void\n snapshot(): { current: string; enabled: string[] }\n}\n\nexport const createProgressionStore = (\n config: ProgressionConfig,\n options: { onTrace?: (input: TraceInput) => void } = {}\n): ProgressionStore => {\n const stageMap = new Map<string, ProgressionStage>()\n for (const stage of config.stages) stageMap.set(stage.name, stage)\n if (!stageMap.has(config.initial)) {\n throw new Error(`Initial stage \"${config.initial}\" is not declared in progression stages.`)\n }\n\n let current = config.initial\n\n const enabled = (): string[] => {\n const stage = stageMap.get(current)\n return stage?.enables ? [current, ...stage.enables] : [current]\n }\n\n const transitionTo = (next: string, trigger: string): { changed: boolean; from: string; to: string } => {\n const from = current\n if (!stageMap.has(next)) {\n throw new Error(`Cannot transition to unknown stage \"${next}\".`)\n }\n if (next === current) return { changed: false, from, to: next }\n current = next\n options.onTrace?.({\n type: 'tool.progressed',\n metadata: { from, to: next, trigger },\n })\n return { changed: true, from, to: next }\n }\n\n return {\n current: () => current,\n enabledStages: () => enabled(),\n notify(toolName) {\n const stage = stageMap.get(current)\n const transition = stage?.transitions?.find((t) => t.on === toolName)\n if (!transition) return { changed: false, from: current, to: current }\n return transitionTo(transition.to, toolName)\n },\n set(stage) {\n return transitionTo(stage, 'manual')\n },\n reset() {\n const previous = current\n current = config.initial\n if (previous !== current) {\n options.onTrace?.({\n type: 'tool.progressed',\n metadata: { from: previous, to: current, trigger: 'reset' },\n })\n }\n },\n snapshot: () => ({ current, enabled: enabled() }),\n }\n}\n","import type { AgentIdentity, TrustLevel } from '@agentronics/protocol'\nimport { TRUST_RANK } from '@agentronics/protocol'\nimport type { GovernedTool } from './registry.js'\n\nexport interface SurfacingContext {\n identity: AgentIdentity | null\n stage?: string | null\n enabledStages?: string[]\n}\n\nexport interface SurfacingDecision {\n tool: GovernedTool\n visible: boolean\n reason: string\n}\n\nconst passesTrust = (tool: GovernedTool, identity: AgentIdentity | null): { ok: boolean; reason: string } => {\n const minTrust = tool.authz?.minTrust as TrustLevel | undefined\n if (!minTrust) return { ok: true, reason: 'no-trust-floor' }\n if (!identity) return { ok: false, reason: `requires-trust:${minTrust}` }\n if (TRUST_RANK[identity.trust] < TRUST_RANK[minTrust]) {\n return { ok: false, reason: `trust-too-low:${identity.trust}<${minTrust}` }\n }\n return { ok: true, reason: 'trust-ok' }\n}\n\nconst passesClass = (tool: GovernedTool, identity: AgentIdentity | null): { ok: boolean; reason: string } => {\n const allowed = tool.authz?.allowedClasses ?? []\n if (allowed.length === 0) return { ok: true, reason: 'no-class-restriction' }\n if (!identity) return { ok: false, reason: `requires-class:${allowed.join('|')}` }\n if (!allowed.includes(identity.class)) {\n return { ok: false, reason: `class-not-allowed:${identity.class}` }\n }\n return { ok: true, reason: 'class-ok' }\n}\n\nconst passesStage = (tool: GovernedTool, context: SurfacingContext): { ok: boolean; reason: string } => {\n if (!tool.stage) return { ok: true, reason: 'no-stage' }\n if (context.enabledStages && context.enabledStages.includes(tool.stage)) {\n return { ok: true, reason: `stage-enabled:${tool.stage}` }\n }\n if (context.stage === tool.stage) return { ok: true, reason: `stage-active:${tool.stage}` }\n return { ok: false, reason: `stage-locked:${tool.stage}` }\n}\n\nexport const decideSurfacing = (\n tool: GovernedTool,\n context: SurfacingContext\n): SurfacingDecision => {\n const trust = passesTrust(tool, context.identity)\n if (!trust.ok) return { tool, visible: false, reason: trust.reason }\n const cls = passesClass(tool, context.identity)\n if (!cls.ok) return { tool, visible: false, reason: cls.reason }\n const stage = passesStage(tool, context)\n if (!stage.ok) return { tool, visible: false, reason: stage.reason }\n if (tool.authz?.decision === 'deny') {\n return { tool, visible: false, reason: 'authz-deny' }\n }\n return { tool, visible: true, reason: 'visible' }\n}\n\nexport const surfaceTools = (\n tools: GovernedTool[],\n context: SurfacingContext\n): GovernedTool[] => tools.filter((tool) => decideSurfacing(tool, context).visible)\n\nexport const explainSurfacing = (\n tools: GovernedTool[],\n context: SurfacingContext\n): SurfacingDecision[] => tools.map((tool) => decideSurfacing(tool, context))\n","import type { GovernedTool } from './registry.js'\n\nexport const DEFAULT_GROUP = 'default'\n\nexport interface ToolGroupSummary {\n name: string\n tools: GovernedTool[]\n}\n\nexport const groupTools = (tools: GovernedTool[]): ToolGroupSummary[] => {\n const map = new Map<string, GovernedTool[]>()\n for (const tool of tools) {\n const key = tool.group ?? DEFAULT_GROUP\n const bucket = map.get(key) ?? []\n bucket.push(tool)\n map.set(key, bucket)\n }\n return [...map.entries()]\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([name, list]) => ({ name, tools: list }))\n}\n\nexport const listGroupNames = (tools: GovernedTool[]): string[] =>\n [...new Set(tools.map((tool) => tool.group ?? DEFAULT_GROUP))].sort()\n","import type { GovernedTool } from './registry.js'\n\nconst APPROX_CHARS_PER_TOKEN = 4\n\nconst stableStringify = (value: unknown): string => {\n if (value === null || typeof value !== 'object') return JSON.stringify(value)\n if (Array.isArray(value)) return `[${value.map(stableStringify).join(',')}]`\n const keys = Object.keys(value as Record<string, unknown>).sort()\n return `{${keys\n .map((key) => `${JSON.stringify(key)}:${stableStringify((value as Record<string, unknown>)[key])}`)\n .join(',')}}`\n}\n\nexport interface ToolTokenEstimate {\n name: string\n characters: number\n tokens: number\n}\n\nexport interface TokenBudgetReport {\n total: number\n perTool: ToolTokenEstimate[]\n}\n\nexport const estimateToolTokens = (tool: GovernedTool): ToolTokenEstimate => {\n const descriptor = {\n name: tool.name,\n version: tool.version ?? null,\n group: tool.group ?? null,\n description: tool.description ?? null,\n inputSchema: tool.inputSchema ?? null,\n authz: tool.authz ?? null,\n rateLimit: tool.rateLimit ?? null,\n }\n const characters = stableStringify(descriptor).length\n return { name: tool.name, characters, tokens: Math.ceil(characters / APPROX_CHARS_PER_TOKEN) }\n}\n\nexport const estimateBudget = (tools: GovernedTool[]): TokenBudgetReport => {\n const perTool = tools.map(estimateToolTokens)\n const total = perTool.reduce((sum, entry) => sum + entry.tokens, 0)\n return { total, perTool }\n}\n","import type { GovernedTool } from './registry.js'\n\nexport interface WebMcpToolDescriptor {\n name: string\n description?: string\n inputSchema?: Record<string, unknown>\n invoke(input?: unknown): Promise<unknown>\n}\n\nexport interface WebMcpProvider {\n provideContext(payload: { tools: WebMcpToolDescriptor[] }): { revoke: () => void }\n}\n\nexport interface WebMcpAdapterOptions {\n provider?: WebMcpProvider\n doc?: { defaultView?: WindowLike | null } | null\n invoke?: (tool: GovernedTool, input: unknown) => Promise<unknown>\n}\n\ninterface WindowLike {\n navigator?: { modelContext?: WebMcpProvider }\n}\n\nconst resolveProvider = (options: WebMcpAdapterOptions): WebMcpProvider | null => {\n if (options.provider) return options.provider\n const win = options.doc?.defaultView ?? (typeof globalThis !== 'undefined' ? (globalThis as WindowLike) : null)\n const candidate = win?.navigator?.modelContext\n if (!candidate) return null\n // Some polyfills / browser extensions patch `navigator.modelContext` with a\n // different shape (e.g. `setTools` instead of `provideContext`). Only accept\n // the object as a provider when it exposes the method we actually call;\n // otherwise the rest of the SDK falls back to no-op publishing instead of\n // throwing `provideContext is not a function` at runtime.\n if (typeof (candidate as Partial<WebMcpProvider>).provideContext !== 'function') {\n return null\n }\n return candidate\n}\n\nconst toDescriptor = (\n tool: GovernedTool,\n invoke: (tool: GovernedTool, input: unknown) => Promise<unknown>\n): WebMcpToolDescriptor => {\n const descriptor: WebMcpToolDescriptor = {\n name: tool.name,\n invoke: (input) => invoke(tool, input),\n }\n if (tool.description !== undefined) descriptor.description = tool.description\n if (tool.inputSchema !== undefined) descriptor.inputSchema = tool.inputSchema\n return descriptor\n}\n\nexport interface WebMcpAdapter {\n publish(tools: GovernedTool[]): { revoked: boolean }\n revoke(): void\n available(): boolean\n}\n\nexport const createWebMcpAdapter = (options: WebMcpAdapterOptions = {}): WebMcpAdapter => {\n const invoke = options.invoke ?? (async (tool, input) => tool.execute(input as never, { identity: null }))\n let handle: { revoke: () => void } | null = null\n\n return {\n publish(tools) {\n const provider = resolveProvider(options)\n if (!provider) return { revoked: false }\n handle?.revoke()\n handle = provider.provideContext({ tools: tools.map((tool) => toDescriptor(tool, invoke)) })\n return { revoked: true }\n },\n revoke() {\n handle?.revoke()\n handle = null\n },\n available: () => Boolean(resolveProvider(options)),\n }\n}\n","import type { TraceEvent as TraceEventRecord } from '@agentronics/protocol'\n\nexport interface TraceBuffer {\n add(event: TraceEventRecord): void\n list(): TraceEventRecord[]\n clear(): void\n}\n\nexport const createTraceBuffer = (limit = 500): TraceBuffer => {\n const events: TraceEventRecord[] = []\n\n return {\n add(event) {\n events.push(event)\n if (events.length > limit) events.splice(0, events.length - limit)\n },\n list() {\n return [...events]\n },\n clear() {\n events.length = 0\n },\n }\n}\n","import type { TraceEvent as TraceEventRecord } from '@agentronics/protocol'\n\nexport interface SamplerOptions {\n traceRate?: number\n errorRate?: number\n random?: () => number\n}\n\nconst clampRate = (value: number | undefined, fallback: number): number => {\n if (value === undefined) return fallback\n return Math.max(0, Math.min(1, value))\n}\n\nexport const createSampler = (options: SamplerOptions = {}) => {\n const traceRate = clampRate(options.traceRate, 1)\n const errorRate = clampRate(options.errorRate, 1)\n const random = options.random ?? Math.random\n\n return {\n shouldKeep(event: Pick<TraceEventRecord, 'outcome'>): boolean {\n const rate = event.outcome === 'error' ? errorRate : traceRate\n return random() < rate\n },\n }\n}\n\nexport type TraceSampler = ReturnType<typeof createSampler>\n","const REDACTED = '[REDACTED]'\n\nconst cloneJson = (value: unknown): unknown => {\n if (value === undefined) return undefined\n return JSON.parse(JSON.stringify(value)) as unknown\n}\n\nconst redactPath = (target: unknown, parts: string[]): void => {\n if (parts.length === 0 || typeof target !== 'object' || target === null) return\n const [head, ...rest] = parts\n if (!head) return\n\n if (Array.isArray(target)) {\n for (const item of target) redactPath(item, parts)\n return\n }\n\n const record = target as Record<string, unknown>\n if (!(head in record)) return\n if (rest.length === 0) {\n record[head] = REDACTED\n return\n }\n redactPath(record[head], rest)\n}\n\nexport const scrubValue = <T>(value: T, paths: string[] = []): T => {\n if (paths.length === 0) return value\n const cloned = cloneJson(value) as T\n for (const path of paths) redactPath(cloned, path.split('.').filter(Boolean))\n return cloned\n}\n\nexport const DEFAULT_SCRUB_PATHS = [\n 'metadata.password',\n 'metadata.token',\n 'metadata.authorization',\n 'metadata.cookie',\n]\n","import {\n TraceEvent,\n type TraceEvent as TraceEventRecord,\n type TraceEventType,\n} from '@agentronics/protocol'\nimport { createTraceBuffer, type TraceBuffer } from './buffer.js'\nimport { createSampler, type SamplerOptions } from './sampler.js'\nimport { DEFAULT_SCRUB_PATHS, scrubValue } from './scrub.js'\n\nexport interface TraceExporter {\n name: string\n export(events: TraceEventRecord[]): Promise<void> | void\n}\n\nexport interface TraceInput {\n type: TraceEventType\n outcome?: TraceEventRecord['outcome']\n tool?: string\n agent?: TraceEventRecord['agent']\n policy?: TraceEventRecord['policy']\n durationMs?: number\n error?: string\n metadata?: Record<string, unknown>\n}\n\nexport interface TracerOptions extends SamplerOptions {\n siteId: string\n bufferSize?: number\n sessionId?: string\n scrubPaths?: string[]\n exporters?: TraceExporter[]\n onExporterError?: (error: unknown, exporter: TraceExporter, event: TraceEventRecord) => void\n /**\n * Resolves the page each emitted event belongs to — stamped into\n * `metadata.page` (a reserved trace metadata key) unless the caller already\n * set it. The dashboard groups WebMCP tools and agent activity by this.\n * Defaults to `location.pathname`; returns `undefined` outside a browser\n * (SSR / Node tests), in which case no `page` key is written.\n */\n pageProvider?: () => string | undefined\n}\n\nconst defaultPageProvider = (): string | undefined =>\n typeof location !== 'undefined' && typeof location.pathname === 'string'\n ? location.pathname\n : undefined\n\nexport interface Tracer {\n readonly sessionId: string\n emit(input: TraceInput): Promise<TraceEventRecord | null>\n list(): TraceEventRecord[]\n clear(): void\n}\n\nconst randomId = (prefix: string): string => {\n const cryptoApi = globalThis.crypto\n if (cryptoApi && 'randomUUID' in cryptoApi) return `${prefix}_${cryptoApi.randomUUID()}`\n return `${prefix}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2)}`\n}\n\nexport const createTracer = ({\n siteId,\n bufferSize,\n sessionId = randomId('ses'),\n scrubPaths = DEFAULT_SCRUB_PATHS,\n exporters = [],\n onExporterError,\n pageProvider = defaultPageProvider,\n ...samplerOptions\n}: TracerOptions): Tracer => {\n const buffer: TraceBuffer = createTraceBuffer(bufferSize)\n const sampler = createSampler(samplerOptions)\n\n // A host-supplied provider must never break tracing — swallow throws.\n const readPage = (): string | undefined => {\n try {\n return pageProvider()\n } catch {\n return undefined\n }\n }\n\n return {\n sessionId,\n async emit(input) {\n const metadata: Record<string, unknown> = { ...input.metadata }\n if (metadata.page === undefined) {\n const page = readPage()\n if (page !== undefined) metadata.page = page\n }\n const event = TraceEvent.parse(\n scrubValue(\n {\n id: randomId('trc'),\n siteId,\n sessionId,\n occurredAt: new Date().toISOString(),\n outcome: input.outcome ?? 'success',\n ...input,\n metadata,\n },\n scrubPaths\n )\n )\n\n if (!sampler.shouldKeep(event)) return null\n buffer.add(event)\n\n await Promise.all(\n exporters.map(async (exporter) => {\n try {\n await exporter.export([event])\n } catch (error) {\n onExporterError?.(error, exporter, event)\n }\n })\n )\n\n return event\n },\n list: () => buffer.list(),\n clear: () => buffer.clear(),\n }\n}\n","import type { TraceEvent as TraceEventRecord } from '@agentronics/protocol'\nimport type { TraceExporter } from '../tracer.js'\n\nexport const createConsoleExporter = (): TraceExporter => ({\n name: 'console',\n export(events: TraceEventRecord[]) {\n for (const event of events) {\n console.info('[agentronics:trace]', event.type, event)\n }\n },\n})\n","import type { TraceBatch, TraceEvent as TraceEventRecord } from '@agentronics/protocol'\nimport type { TraceExporter } from '../tracer.js'\n\nexport interface GatewayExporterOptions {\n gatewayUrl: string\n publishableKey: string\n fetcher?: typeof fetch\n}\n\nexport const createGatewayExporter = ({\n gatewayUrl,\n publishableKey,\n fetcher = fetch,\n}: GatewayExporterOptions): TraceExporter => ({\n name: 'gateway',\n async export(events: TraceEventRecord[]) {\n const batch: TraceBatch = { publishableKey, events }\n await fetcher(`${gatewayUrl.replace(/\\/$/, '')}/v1/traces`, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n authorization: `Bearer ${publishableKey}`,\n },\n body: JSON.stringify(batch),\n })\n },\n})\n","import type { TraceEvent as TraceEventRecord } from '@agentronics/protocol'\nimport type { TraceExporter } from '../tracer.js'\n\nexport interface WebhookExporterOptions {\n url: string\n fetcher?: typeof fetch\n maxRetries?: number\n queueLimit?: number\n}\n\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))\n\nexport const createWebhookExporter = ({\n url,\n fetcher = fetch,\n maxRetries = 2,\n queueLimit = 500,\n}: WebhookExporterOptions): TraceExporter => ({\n name: 'webhook',\n async export(events: TraceEventRecord[]) {\n const queued = readQueue(url)\n const batch = [...queued, ...events].slice(-queueLimit)\n let attempt = 0\n while (true) {\n const response = await fetcher(url, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ events: batch }),\n })\n if (response.ok) {\n writeQueue(url, [])\n return\n }\n if (attempt >= maxRetries) {\n writeQueue(url, batch)\n throw new Error(`Webhook exporter failed with status ${response.status}.`)\n }\n attempt += 1\n await sleep(100 * attempt)\n }\n },\n})\n\nconst queueKey = (url: string) => `agtx:webhook:${url}`\n\nconst readQueue = (url: string): TraceEventRecord[] => {\n if (typeof window === 'undefined' || !window.localStorage) return []\n try {\n const raw = window.localStorage.getItem(queueKey(url))\n return raw ? (JSON.parse(raw) as TraceEventRecord[]) : []\n } catch {\n return []\n }\n}\n\nconst writeQueue = (url: string, events: TraceEventRecord[]): void => {\n if (typeof window === 'undefined' || !window.localStorage) return\n try {\n if (events.length === 0) {\n window.localStorage.removeItem(queueKey(url))\n return\n }\n window.localStorage.setItem(queueKey(url), JSON.stringify(events))\n } catch {\n // If storage is unavailable, webhook export failure still surfaces via the thrown error.\n }\n}\n","import type { TraceBatch, TraceEvent as TraceEventRecord } from '@agentronics/protocol'\nimport type { TraceExporter } from '../tracer.js'\nimport type { GovernedTool } from '../../tools/registry.js'\nimport { toToolDescriptor } from '../../tools/toolSync.js'\n\nexport interface IntelExporterOptions {\n /**\n * Intelligence API base URL (e.g. `https://intel-api-….run.app`) — the\n * `/v1/sdk/events` path is appended automatically — or the full ingest URL.\n */\n url: string\n /**\n * Per-tenant SDK ingest key (`agtx_ik_…`), minted in the dashboard Settings.\n * This is a **secret**: use this exporter in your backend only, never in the\n * browser. (The browser SDK should forward traces to your backend, which\n * relays them with the key.)\n */\n ingestKey: string\n fetcher?: typeof fetch\n}\n\nconst INGEST_PATH = '/v1/sdk/events'\n\n/**\n * Stream governed-action traces to the Agentronics Intelligence dashboard.\n * POSTs a `TraceBatch` to the intel-api ingest endpoint with the ingest key.\n * Intended for Node/server use (the existing webhook exporter is browser-bound\n * and can't send an auth header).\n */\nexport const createIntelExporter = ({\n url,\n ingestKey,\n fetcher = fetch,\n}: IntelExporterOptions): TraceExporter => {\n const base = url.replace(/\\/$/, '')\n const endpoint = base.endsWith(INGEST_PATH) ? base : `${base}${INGEST_PATH}`\n return {\n name: 'intel',\n async export(events: TraceEventRecord[]) {\n const batch: TraceBatch = { events }\n const response = await fetcher(endpoint, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n authorization: `Bearer ${ingestKey}`,\n },\n body: JSON.stringify(batch),\n })\n if (!response.ok) {\n throw new Error(`Intel exporter failed with status ${response.status}.`)\n }\n },\n }\n}\n\nexport interface IntelSyncOptions {\n /** Intelligence API base URL (e.g. `https://intel-api-….run.app`). */\n url: string\n /** Per-tenant SDK ingest key (`agtx_ik_…`). Backend-only — never the browser. */\n ingestKey: string\n /** The site these tools/memory belong to (matches your SDK `siteId`). */\n siteId: string\n fetcher?: typeof fetch\n}\n\n/**\n * Push the authoritative tool registry + site-memory snapshot to the\n * Intelligence dashboard — the full data the WebMCP Tools + Knaph pages need,\n * which is too large for the lightweight trace stream. Call after `syncTools()`\n * / `provideSiteMemory(...)`. Backend/server use only (the key is secret).\n */\nexport interface IntelSync {\n /** POST the registry to /v1/sdk/tools. Returns the number of tools sent. */\n pushTools(tools: GovernedTool[]): Promise<number>\n /** POST the site-memory snapshot (+ optional quality score) to /v1/sdk/memory. */\n pushMemory(snapshot: object, score?: number): Promise<void>\n}\n\nexport const createIntelSync = ({\n url,\n ingestKey,\n siteId,\n fetcher = fetch,\n}: IntelSyncOptions): IntelSync => {\n const base = url.replace(/\\/$/, '')\n const post = async (path: string, body: unknown): Promise<void> => {\n const response = await fetcher(`${base}${path}`, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n authorization: `Bearer ${ingestKey}`,\n },\n body: JSON.stringify(body),\n })\n if (!response.ok) {\n throw new Error(`Intel sync ${path} failed with status ${response.status}.`)\n }\n }\n\n return {\n async pushTools(tools: GovernedTool[]) {\n const descriptors = tools.map(toToolDescriptor)\n await post('/v1/sdk/tools', { siteId, tools: descriptors })\n return descriptors.length\n },\n async pushMemory(snapshot: object, score?: number) {\n await post('/v1/sdk/memory', {\n siteId,\n snapshot,\n ...(typeof score === 'number' ? { score } : {}),\n })\n },\n }\n}\n","import {\n AgentronicsError,\n classifyApiKey,\n PUBLISHABLE_KEY_PREFIX,\n type AgentIdentity,\n type PolicyEvaluation,\n type PolicyRule,\n type TraceEvent,\n} from '@agentronics/protocol'\nimport { detectAgent, type DetectAgentOptions } from './detection/index.js'\nimport { SDK_VERSION } from './version.js'\nimport {\n createIdentityStore,\n type PresentedIdentity,\n type PresentIdentityOptions,\n} from './auth/identity.js'\nimport { createAuthEngine, type AuthContext, type AuthEngine, type AuthInput } from './auth/engine.js'\nimport { createAgentContextStore, type AgentContextStore } from './auth/agentContext.js'\nimport { createPolicyEngine, type PolicyEngine } from './authz/engine.js'\nimport { createPolicyCache, type PolicyCache } from './authz/policyCache.js'\nimport { installDomEnforcer } from './authz/domEnforcer.js'\nimport { createMemoryStore, type MemoryStore } from './memory/store.js'\nimport {\n createSiteMemoryStore,\n type SiteMemoryStore,\n type ProvideForPageInput,\n} from './memory/siteMemory.js'\nimport { createMemoryCache, type MemoryCache } from './memory/memoryCache.js'\nimport {\n installMetaTags,\n installMemoryOverlay,\n fetchWellKnownContext,\n} from './memory/delivery/index.js'\nimport { createToolRegistry, type GovernedTool, type ToolRegistry } from './tools/registry.js'\nimport { createToolSync } from './tools/toolSync.js'\nimport {\n createProgressionStore,\n type ProgressionConfig,\n type ProgressionStore,\n} from './tools/progression.js'\nimport { surfaceTools, explainSurfacing, type SurfacingDecision } from './tools/surfacing.js'\nimport { groupTools, type ToolGroupSummary } from './tools/groups.js'\nimport { estimateBudget, type TokenBudgetReport } from './tools/tokenEstimate.js'\nimport { createWebMcpAdapter, type WebMcpAdapter } from './tools/webmcpAdapter.js'\nimport type { SiteMemory } from '@agentronics/protocol'\nimport {\n createConsoleExporter,\n createGatewayExporter,\n createTracer,\n createWebhookExporter,\n type TraceExporter,\n type Tracer,\n} from './observability/index.js'\n\nexport interface InitOptions {\n publishableKey: string\n siteId?: string\n /**\n * Override the gateway URL the SDK calls. **Reserved for local development\n * only** — the only accepted values are `localhost` / `127.0.0.1` URLs (so\n * `pnpm dev` against a local gateway works). Any other value throws at\n * `init()` time.\n *\n * Production deployments must omit this option. The SDK is hard-coded to\n * call `https://gateway.agentronics.dev`. Custom backends are not\n * supported, by design — see the project README + LICENSE NOTICE.\n *\n * @internal — kept on the public type only so dev tooling type-checks.\n */\n gatewayUrl?: string\n debug?: boolean\n policies?: PolicyRule[]\n siteMemory?: Partial<SiteMemory>\n auth?: AuthContext\n progression?: ProgressionConfig\n tools?: GovernedTool[]\n /**\n * Run agent detection automatically on init and keep the resulting\n * identity in agentContext so every subsequent tools.execute() call gets\n * attributed without the host page passing identity through. Default\n * `true` — opt out with `false` for privacy-mode hosts, or pass\n * DetectAgentOptions to tune the detectors (e.g. raise the DOM threshold).\n *\n * The first detection cycle runs synchronously where possible (DOM\n * heuristics) and continues asynchronously for WebMCP polling, so very\n * early click handlers may see identity=null for a single frame; the\n * `ready` promise on the returned client resolves once the cycle finishes.\n */\n autoDetect?: boolean | DetectAgentOptions\n trace?: {\n enabled?: boolean\n bufferSize?: number\n traceRate?: number\n errorRate?: number\n scrubPaths?: string[]\n exporters?: TraceExporter[]\n gateway?: boolean\n webhookUrl?: string\n }\n}\n\nexport interface AgentronicsClient {\n readonly publishableKey: string\n readonly siteId: string\n readonly gatewayUrl: string\n readonly debug: boolean\n readonly memory: MemoryStore\n readonly siteMemory: SiteMemoryStore\n readonly memoryCache: MemoryCache\n readonly tracer: Tracer\n readonly auth: AuthEngine\n readonly agentContext: AgentContextStore\n readonly authz: PolicyEngine\n readonly policyCache: PolicyCache\n readonly tools: ToolRegistry\n readonly progression: ProgressionStore | null\n readonly webmcp: WebMcpAdapter\n /**\n * Resolves once the initial autoDetect cycle finishes. Rejects only if the\n * autoDetect configuration itself is invalid; detection failures resolve to\n * `null` (treated as \"human or undetectable agent\"). When `autoDetect` was\n * disabled the promise resolves immediately to `null`.\n */\n readonly ready: Promise<AgentIdentity | null>\n detect(options?: DetectAgentOptions): Promise<AgentIdentity | null>\n authenticate(input: AuthInput): Promise<AgentIdentity | null>\n presentIdentity(input: PresentIdentityOptions): PresentedIdentity\n clearIdentity(): void\n presentedIdentity(): PresentedIdentity | null\n setPolicies(rules: PolicyRule[]): void\n listPolicies(): PolicyRule[]\n evaluate(tool: string, options?: { identity?: AgentIdentity | null }): Promise<PolicyEvaluation>\n syncPolicies(): Promise<PolicyRule[]>\n syncSiteMemory(): Promise<SiteMemory | null>\n provideSiteMemory(memory: Partial<SiteMemory>): SiteMemory\n provideForPage(input: ProvideForPageInput): void\n installMemoryDelivery(options?: {\n metaTags?: boolean\n overlay?: boolean\n }): { uninstall: () => void }\n fetchWellKnown(origin?: string): Promise<SiteMemory | null>\n installDomEnforcer(): { uninstall: () => void }\n registerTool(tool: GovernedTool): () => void\n /** Push the full tool registry to the gateway so the dashboard can render\n * the page-wise view (schemas, per-tool tokens, context fullness). */\n syncTools(): Promise<number>\n surfaceTools(options?: { identity?: AgentIdentity | null }): GovernedTool[]\n explainSurfacing(options?: { identity?: AgentIdentity | null }): SurfacingDecision[]\n groupedTools(options?: { identity?: AgentIdentity | null }): ToolGroupSummary[]\n estimateTokens(options?: { identity?: AgentIdentity | null }): TokenBudgetReport\n publishToWebMcp(options?: { identity?: AgentIdentity | null }): { revoked: boolean; surfaced: number }\n notifyToolInvoked(toolName: string): void\n traces(): TraceEvent[]\n clearTraces(): void\n /**\n * Sanity-check the publishable key + gateway URL. Hits `GET /v1/health` and\n * resolves to `{ ok: true, ... }` on 2xx, `{ ok: false, status, error }`\n * otherwise. Doesn't throw — designed for \"did my key wire up correctly?\"\n * UX without forcing the host page into a try/catch.\n */\n ping(): Promise<{ ok: true; status: number; body: unknown } | { ok: false; status: number; error: string }>\n}\n\nconst DEFAULT_GATEWAY_URL = 'https://gateway.agentronics.dev'\n\n/**\n * Lock the SDK to the canonical Agentronics gateway. The only override\n * accepted is a localhost / 127.0.0.1 URL — purely so contributors running\n * `pnpm dev` can hit a local gateway. Any other value (a competing host, a\n * proxy, an MITM target) throws synchronously, before any traces are\n * emitted.\n *\n * The Agentronics SDK is licensed under Apache 2.0 but is designed to\n * operate exclusively against the Agentronics service. Self-hosted /\n * third-party backends are not supported.\n */\nconst resolveGatewayUrl = (provided: string | undefined): string => {\n if (provided === undefined) return DEFAULT_GATEWAY_URL\n if (provided === DEFAULT_GATEWAY_URL) return provided\n let parsed: URL\n try {\n parsed = new URL(provided)\n } catch {\n throw new Error(\n `Agentronics SDK: \\`gatewayUrl\\` is not a valid URL: ${provided}`\n )\n }\n if (parsed.hostname === 'localhost' || parsed.hostname === '127.0.0.1') {\n return provided\n }\n throw new Error(\n `Agentronics SDK does not support custom gateway URLs. ` +\n `Omit \\`gatewayUrl\\` to use the canonical https://gateway.agentronics.dev. ` +\n `The only accepted override is a localhost / 127.0.0.1 URL for local development. ` +\n `Got: ${provided}`\n )\n}\n\nexport const init = (options: InitOptions): AgentronicsClient => {\n const {\n publishableKey,\n siteId = 'default',\n debug = false,\n policies = [],\n trace = {},\n } = options\n const gatewayUrl = resolveGatewayUrl(options.gatewayUrl)\n\n const kind = classifyApiKey(publishableKey)\n if (kind === 'secret') {\n throw new AgentronicsError(\n 'wrong_key_kind',\n 'A secret key was passed to Agentronics.init(). Browser code must use a publishable key (agtx_pk_*).'\n )\n }\n if (kind !== 'publishable') {\n throw new AgentronicsError(\n 'invalid_api_key',\n `Agentronics.init() expected a key starting with \"${PUBLISHABLE_KEY_PREFIX}\".`\n )\n }\n\n const traceEnabled = trace.enabled ?? true\n const exporters = [\n ...(debug ? [createConsoleExporter()] : []),\n ...(trace.gateway ? [createGatewayExporter({ gatewayUrl, publishableKey })] : []),\n ...(trace.webhookUrl ? [createWebhookExporter({ url: trace.webhookUrl })] : []),\n ...(trace.exporters ?? []),\n ]\n const tracerOptions: Parameters<typeof createTracer>[0] = {\n siteId,\n exporters: traceEnabled ? exporters : [],\n onExporterError: (error, exporter) => {\n if (debug) console.warn(`[agentronics] trace exporter \"${exporter.name}\" failed`, error)\n },\n }\n if (trace.bufferSize !== undefined) tracerOptions.bufferSize = trace.bufferSize\n if (trace.traceRate !== undefined) tracerOptions.traceRate = trace.traceRate\n if (trace.errorRate !== undefined) tracerOptions.errorRate = trace.errorRate\n if (trace.scrubPaths !== undefined) tracerOptions.scrubPaths = trace.scrubPaths\n const tracer = createTracer(tracerOptions)\n const emitTrace = (input: Parameters<Tracer['emit']>[0]) => {\n if (!traceEnabled) return\n void tracer.emit(input)\n }\n const identityStore = createIdentityStore()\n const authOptions: Parameters<typeof createAuthEngine>[0] = {\n onTrace: emitTrace,\n }\n if (options.auth !== undefined) authOptions.context = options.auth\n const auth = createAuthEngine(authOptions)\n const agentContext = createAgentContextStore()\n const policyEngine = createPolicyEngine(policies)\n const policyCache = createPolicyCache({ gatewayUrl, siteId, publishableKey })\n const memory = createMemoryStore({ onTrace: emitTrace })\n const siteMemoryOptions: Parameters<typeof createSiteMemoryStore>[0] = {\n onTrace: emitTrace,\n }\n if (options.siteMemory !== undefined) siteMemoryOptions.initial = options.siteMemory\n const siteMemory = createSiteMemoryStore(siteMemoryOptions)\n const memoryCache = createMemoryCache({ gatewayUrl, siteId, publishableKey })\n const toolSync = createToolSync({ gatewayUrl, siteId, publishableKey })\n\n const detect = async (detectOptions?: DetectAgentOptions) => {\n const start = Date.now()\n const detected = await detectAgent(detectOptions)\n const identity = identityStore.preferOver(detected)\n if (traceEnabled) {\n await tracer.emit({\n type: identity ? 'agent.detected' : 'agent.missed',\n agent: identity,\n durationMs: Date.now() - start,\n metadata: {\n detectedClass: detected?.class ?? null,\n presented: identityStore.snapshot() !== null,\n },\n })\n }\n agentContext.set(identity, 'detect')\n return identity\n }\n const evaluate = async (tool: string, opts: { identity?: AgentIdentity | null } = {}) => {\n const start = Date.now()\n const identity = opts.identity !== undefined ? opts.identity : await detect()\n const policy = policyEngine.evaluate({ tool, identity })\n if (traceEnabled) {\n await tracer.emit({\n type: 'authz.evaluated',\n tool,\n agent: identity,\n policy,\n outcome: policy.decision === 'deny' ? 'blocked' : 'success',\n durationMs: Date.now() - start,\n })\n }\n return policy\n }\n const tools = createToolRegistry({\n evaluate,\n setPolicies: (rules) => policyEngine.set(rules),\n listPolicies: () => policyEngine.list(),\n onTrace: emitTrace,\n // Every tools.execute() call without an explicit identity gets the\n // current detected/declared/authenticated agent. Button-bound tools\n // become attributable without their handlers having to know about\n // agents.\n identityResolver: () => agentContext.snapshot().identity,\n })\n for (const tool of options.tools ?? []) tools.register(tool)\n\n const progression = options.progression\n ? createProgressionStore(options.progression, { onTrace: emitTrace })\n : null\n\n const surfacingContext = (identity: AgentIdentity | null) => {\n const ctx: { identity: AgentIdentity | null; stage?: string; enabledStages?: string[] } = {\n identity,\n }\n if (progression) {\n ctx.stage = progression.current()\n ctx.enabledStages = progression.enabledStages()\n }\n return ctx\n }\n\n const surfaceFor = (identity: AgentIdentity | null) =>\n surfaceTools(tools.list(), surfacingContext(identity))\n\n const handleToolInvoked = (toolName: string) => {\n if (!progression) return\n const transition = progression.notify(toolName)\n if (transition.changed) webmcp.publish(surfaceFor(agentContext.snapshot().identity))\n }\n\n // Fallback identity used only when no detection has fired yet AND the call\n // arrives through navigator.modelContext — a call through that channel is\n // by definition an agent call, even if the specific vendor wasn't matched.\n const fallbackWebMcpIdentity: AgentIdentity = {\n class: 'webmcp',\n trust: 'detected',\n confidence: 1,\n vendor: null,\n userAgent: typeof navigator !== 'undefined' ? navigator.userAgent : null,\n detectionVersion: SDK_VERSION,\n signals: { source: 'navigator.modelContext' },\n }\n\n const webmcp = createWebMcpAdapter({\n invoke: async (tool, input) => {\n const identity = agentContext.snapshot().identity ?? fallbackWebMcpIdentity\n const result = await tools.execute(tool.name, input, identity)\n handleToolInvoked(tool.name)\n return result\n },\n })\n\n // When the ambient identity changes (late WebMCP polyfill, declared\n // identity, successful authenticate()), re-publish the WebMCP surface so\n // any agent currently bound to navigator.modelContext sees the\n // identity-gated tool set rather than the stale anonymous one.\n agentContext.subscribe((snapshot) => {\n if (!webmcp.available()) return\n webmcp.publish(surfaceFor(snapshot.identity))\n })\n\n // Kick off the initial detection cycle if the host opted in. Default is\n // on so /traces is populated with class/trust/signals without the host\n // page having to call detect() manually before each interaction.\n const autoDetectOption = options.autoDetect ?? true\n const ready: Promise<AgentIdentity | null> = autoDetectOption === false\n ? Promise.resolve(null)\n : (async () => {\n const detectOpts: DetectAgentOptions =\n autoDetectOption === true ? {} : autoDetectOption\n try {\n return await detect(detectOpts)\n } catch (err) {\n // Detection problems shouldn't crash the host's init() — log when\n // debug is on, otherwise swallow and treat as \"human or\n // undetectable agent.\"\n if (debug) console.warn('[agentronics] autoDetect failed:', err)\n return null\n }\n })()\n\n return Object.freeze({\n publishableKey,\n siteId,\n gatewayUrl,\n debug,\n memory,\n siteMemory,\n memoryCache,\n tracer,\n auth,\n agentContext,\n authz: policyEngine,\n policyCache,\n tools,\n progression,\n webmcp,\n ready,\n detect,\n authenticate: async (input: AuthInput) => {\n const identity = await auth.authenticate(input)\n agentContext.set(identity, 'authenticate')\n return identity\n },\n presentIdentity: (input: PresentIdentityOptions) => {\n const presented = identityStore.present(input)\n emitTrace({\n type: 'auth.identity_presented',\n agent: presented.identity,\n metadata: { vendor: presented.identity.vendor, class: presented.identity.class },\n })\n agentContext.set(presented.identity, 'declare')\n return presented\n },\n clearIdentity: () => {\n identityStore.clear()\n emitTrace({ type: 'auth.identity_cleared' })\n agentContext.set(null, 'cleared')\n },\n presentedIdentity: () => identityStore.snapshot(),\n setPolicies: (rules: PolicyRule[]) => {\n policyEngine.set(rules)\n emitTrace({ type: 'authz.policies_set', metadata: { count: rules.length } })\n },\n listPolicies: () => policyEngine.list(),\n syncPolicies: async () => {\n const snapshot = await policyCache.sync()\n policyEngine.set(snapshot.policies)\n emitTrace({ type: 'authz.policies_set', metadata: { count: snapshot.policies.length, synced: true } })\n return snapshot.policies\n },\n syncSiteMemory: async () => {\n const snapshot = await memoryCache.sync()\n if (snapshot.memory) {\n siteMemory.replace(snapshot.memory)\n emitTrace({\n type: 'memory.updated',\n metadata: { kind: 'site', operation: 'sync', etag: snapshot.etag },\n })\n }\n return snapshot.memory\n },\n provideSiteMemory: (next: Partial<SiteMemory>) => siteMemory.provide(next),\n provideForPage: (input: ProvideForPageInput) => {\n siteMemory.provideForPage(input)\n },\n installMemoryDelivery: ({ metaTags = true, overlay = false } = {}) => {\n const handles: Array<{ uninstall: () => void }> = []\n if (metaTags) handles.push(installMetaTags({ snapshot: siteMemory.snapshot() }))\n if (overlay) handles.push(installMemoryOverlay({ snapshot: siteMemory.snapshot() }))\n return {\n uninstall: () => {\n handles.forEach((handle) => handle.uninstall())\n },\n }\n },\n fetchWellKnown: async (origin?: string) => {\n const wellKnownOptions: Parameters<typeof fetchWellKnownContext>[0] = {}\n if (origin !== undefined) wellKnownOptions.origin = origin\n const memorySnapshot = await fetchWellKnownContext(wellKnownOptions)\n if (memorySnapshot) {\n siteMemory.replace(memorySnapshot)\n emitTrace({\n type: 'memory.updated',\n metadata: { kind: 'site', operation: 'wellKnown', origin: origin ?? null },\n })\n }\n return memorySnapshot\n },\n installDomEnforcer: () =>\n installDomEnforcer({\n policyEngine,\n getIdentity: () => detect({ webmcp: { pollMs: 0 } }),\n }),\n registerTool: (tool: GovernedTool) => tools.register(tool),\n syncTools: async () => {\n const all = tools.list({ includeDisabled: true })\n const count = await toolSync.push(all)\n emitTrace({ type: 'tool.registered', metadata: { operation: 'sync', count } })\n return count\n },\n surfaceTools: ({ identity = null }: { identity?: AgentIdentity | null } = {}) => surfaceFor(identity),\n explainSurfacing: ({ identity = null }: { identity?: AgentIdentity | null } = {}) =>\n explainSurfacing(tools.list(), surfacingContext(identity)),\n groupedTools: ({ identity = null }: { identity?: AgentIdentity | null } = {}) => groupTools(surfaceFor(identity)),\n estimateTokens: ({ identity = null }: { identity?: AgentIdentity | null } = {}) => estimateBudget(surfaceFor(identity)),\n publishToWebMcp: ({ identity = null }: { identity?: AgentIdentity | null } = {}) => {\n const surfaced = surfaceFor(identity)\n const result = webmcp.publish(surfaced)\n surfaced.forEach((tool) => {\n emitTrace({\n type: 'tool.surfaced',\n tool: tool.name,\n metadata: { state: 'published', trust: identity?.trust ?? null, group: tool.group ?? null },\n })\n })\n return { revoked: result.revoked, surfaced: surfaced.length }\n },\n notifyToolInvoked: (toolName: string) => handleToolInvoked(toolName),\n evaluate,\n traces: () => tracer.list(),\n clearTraces: () => tracer.clear(),\n async ping() {\n try {\n const response = await fetch(`${gatewayUrl.replace(/\\/$/, '')}/v1/health`, {\n method: 'GET',\n headers: { authorization: `Bearer ${publishableKey}` },\n })\n if (!response.ok) {\n return { ok: false as const, status: response.status, error: `gateway returned ${response.status}` }\n }\n const body = (await response.json().catch(() => null)) ?? {}\n return { ok: true as const, status: response.status, body }\n } catch (error) {\n return {\n ok: false as const,\n status: 0,\n error: error instanceof Error ? error.message : String(error),\n }\n }\n },\n })\n}\n","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 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}\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"]}
|