@keystrokehq/keystroke 0.1.90 → 0.1.92
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/agent-types.cjs +1 -1
- package/dist/agent-types.d.cts +2 -2
- package/dist/agent-types.d.mts +2 -2
- package/dist/agent-types.mjs +1 -1
- package/dist/agent.cjs +81 -11
- package/dist/agent.cjs.map +1 -1
- package/dist/agent.d.cts +3 -3
- package/dist/agent.d.mts +3 -3
- package/dist/agent.mjs +81 -11
- package/dist/agent.mjs.map +1 -1
- package/dist/{context-compaction-D2_B1nky-BZ0Nxnlz.cjs → context-compaction-D2_B1nky-BGm3K1E7.cjs} +2 -2
- package/dist/{context-compaction-D2_B1nky-BZ0Nxnlz.cjs.map → context-compaction-D2_B1nky-BGm3K1E7.cjs.map} +1 -1
- package/dist/{context-compaction-D2_B1nky-Z-RHprX6.mjs → context-compaction-D2_B1nky-_2obJBC9.mjs} +2 -2
- package/dist/{context-compaction-D2_B1nky-Z-RHprX6.mjs.map → context-compaction-D2_B1nky-_2obJBC9.mjs.map} +1 -1
- package/dist/{dist-BquLTvmJ.cjs → dist-CSveenjr.cjs} +2 -11
- package/dist/{dist-BquLTvmJ.cjs.map → dist-CSveenjr.cjs.map} +1 -1
- package/dist/{dist-CBMAwfqk.mjs → dist-CUpLAhRj.mjs} +3 -6
- package/dist/{dist-CBMAwfqk.mjs.map → dist-CUpLAhRj.mjs.map} +1 -1
- package/dist/{dist-DV-u1dSU.cjs → dist-Ca7vInBw.cjs} +3 -20
- package/dist/dist-Ca7vInBw.cjs.map +1 -0
- package/dist/{dist-D5LMFsGS.mjs → dist-K7JjYweY.mjs} +3 -20
- package/dist/{dist-D5LMFsGS.mjs.map → dist-K7JjYweY.mjs.map} +1 -1
- package/dist/{index-IsjwL1qE.d.cts → index-BAERW4m3.d.mts} +4 -4
- package/dist/{index-IsjwL1qE.d.cts.map → index-BAERW4m3.d.mts.map} +1 -1
- package/dist/{index-C1LkEWsV.d.mts → index-BNptJCCC.d.mts} +4 -4
- package/dist/{index-C1LkEWsV.d.mts.map → index-BNptJCCC.d.mts.map} +1 -1
- package/dist/{index-XtUIsmsf.d.mts → index-C614Tmd_.d.cts} +4 -4
- package/dist/{index-XtUIsmsf.d.mts.map → index-C614Tmd_.d.cts.map} +1 -1
- package/dist/{index-DnlzDIsv.d.mts → index-CIz44roq.d.mts} +2 -2
- package/dist/{index-DnlzDIsv.d.mts.map → index-CIz44roq.d.mts.map} +1 -1
- package/dist/{index-BYUo1T9j.d.cts → index-DFkYFZEw.d.cts} +2 -2
- package/dist/{index-BYUo1T9j.d.cts.map → index-DFkYFZEw.d.cts.map} +1 -1
- package/dist/{index-CE-pKU-3.d.cts → index-N9Wzbx7A.d.cts} +4 -4
- package/dist/{index-CE-pKU-3.d.cts.map → index-N9Wzbx7A.d.cts.map} +1 -1
- package/dist/{schemas-lSbMfQRy-XXpvG020.d.mts → schemas-lSbMfQRy-CIfs2xv6.d.mts} +2 -2
- package/dist/{schemas-lSbMfQRy-EZTAAsXz.d.cts.map → schemas-lSbMfQRy-CIfs2xv6.d.mts.map} +1 -1
- package/dist/{schemas-lSbMfQRy-EZTAAsXz.d.cts → schemas-lSbMfQRy-YsonGA_B.d.cts} +2 -2
- package/dist/{schemas-lSbMfQRy-XXpvG020.d.mts.map → schemas-lSbMfQRy-YsonGA_B.d.cts.map} +1 -1
- package/dist/{token-CiaIOCoy.cjs → token-C3FIUHfv.cjs} +2 -2
- package/dist/{token-CiaIOCoy.cjs.map → token-C3FIUHfv.cjs.map} +1 -1
- package/dist/{token-BFGvC19A.mjs → token-FDWSsULw.mjs} +2 -2
- package/dist/{token-BFGvC19A.mjs.map → token-FDWSsULw.mjs.map} +1 -1
- package/dist/trigger.cjs +1 -1
- package/dist/trigger.d.cts +1 -1
- package/dist/trigger.d.mts +1 -1
- package/dist/trigger.mjs +1 -1
- package/dist/workflow.cjs +1 -1
- package/dist/workflow.mjs +1 -1
- package/package.json +1 -1
- package/dist/dist-DV-u1dSU.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dist-Ca7vInBw.cjs","names":["storage","AsyncLocalStorage","eq$1","requireOrganizationScopeId","and$1","getDb","oauthApps","oauthConnections","secretValues","decryptCredentialPayload","encryptCredentialPayload","listCredentialAssignmentsByTarget","selectCredentialInstanceById","selectCredentialInstancesForScope","touchCredentialInstanceLastUsed","getOrganizationScopeId","crypto","marker","symbol","_a","_b","MCPClientError","AISDKError","ToolMetaSchema","z","ClientOrServerImplementationSchema","BaseParamsSchema","ResultSchema","RequestSchema","ElicitationCapabilitySchema","ServerCapabilitiesSchema","InitializeResultSchema","PaginatedResultSchema","ToolSchema","ListToolsResultSchema","TextContentSchema","ImageContentSchema","ResourceSchema","ListResourcesResultSchema","ResourceContentsSchema","TextResourceContentsSchema","BlobResourceContentsSchema","EmbeddedResourceSchema","ResourceLinkContentSchema","CallToolResultSchema","ResourceTemplateSchema","ListResourceTemplatesResultSchema","ReadResourceResultSchema","PromptReferenceSchema","ResourceReferenceSchema","CompletionArgumentSchema","CompleteResultSchema","PromptArgumentSchema","PromptSchema","ListPromptsResultSchema","PromptMessageSchema","GetPromptResultSchema","ElicitationRequestParamsSchema","ElicitResultSchema","JSONRPC_VERSION","JSONRPCRequestSchema","z2","JSONRPCResponseSchema","JSONRPCErrorSchema","JSONRPCNotificationSchema","JSONRPCMessageSchema","parseJSONRPCMessage","parseJSON","SafeUrlSchema","z3","OAuthTokensSchema","OAuthProtectedResourceMetadataSchema","OAuthMetadataSchema","OpenIdProviderDiscoveryMetadataSchema","OAuthClientInformationSchema","OAuthClientMetadataSchema","OAuthErrorResponseSchema","OAuthClientInformationFullSchema","AISDKError2","ServerError","InvalidClientError","InvalidGrantError","UnauthorizedClientError","OAUTH_ERRORS","parseJSON2","withUserAgentSuffix","getRuntimeEnvironmentUserAgent","EventSourceParserStream","withUserAgentSuffix2","getRuntimeEnvironmentUserAgent2","EventSourceParserStream2","isJSONObject","dynamicTool","jsonSchema","tool","safeValidateTypes","asSchema","safeParseJSON","z","ResultSchema","RequestSchema","ElicitationCapabilitySchema","ServerCapabilitiesSchema","PaginatedResultSchema","ToolSchema","TextContentSchema","ImageContentSchema","ResourceSchema","ResourceContentsSchema","TextResourceContentsSchema","BlobResourceContentsSchema","EmbeddedResourceSchema","ResourceTemplateSchema","PromptReferenceSchema","PromptArgumentSchema","PromptSchema","PromptMessageSchema","JSONRPC_VERSION","JSONRPCRequestSchema","z2","JSONRPCResponseSchema","JSONRPCNotificationSchema","JSONRPCMessageSchema","parseJSON","AISDKError","z","z","Experimental_StdioMCPTransport","node_process","node_process","buildConnectDeeplink","selectCredentialInstanceById","decryptCredentialPayload","getBoundProjectScopeId","selectProjectById","selectOrganizationById","isDatabaseInitialized","selectCredentialInstanceById$2","selectCredentialInstancesForScope$2","getServerTenantScopeId","mcpEntityId","normalizeCredentialList","tool","jsonSchema","getWorkflowRunHandle","z","requiredDisplayTextSchema","AsyncLocalStorage","withSpan","captureConsole","normalizeCredentialList","getActionCredentialRequirements","runWithMcpCredentialContext","executeAction","registerWorkflowRunGetter","getRunSignal","defineTool","getRegisteredProjectScopeId","chatAttachmentExtension","CHAT_ATTACHMENT_MAX_BYTES","chatAttachmentServePath","FilePartSchema"],"sources":["../../platform-database/dist/index.mjs","../../credentials/dist/store-C6DRzb2o.mjs","../../secrets/dist/index.mjs","../../../node_modules/.pnpm/pkce-challenge@5.0.1/node_modules/pkce-challenge/dist/index.node.js","../../../node_modules/.pnpm/@ai-sdk+mcp@2.0.3_zod@4.4.3/node_modules/@ai-sdk/mcp/dist/index.js","../../../node_modules/.pnpm/@ai-sdk+mcp@2.0.3_zod@4.4.3/node_modules/@ai-sdk/mcp/dist/mcp-stdio/index.js","../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js","../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js","../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js","../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js","../../../node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.json","../../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js","../../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js","../../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft7.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-draft-07.json","../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/ajv.js","../../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/formats.js","../../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/limit.js","../../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/index.js","../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js","../../mcp/dist/index.mjs","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/identity.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/visit.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/directives.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/anchors.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/applyReviver.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/toJS.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Node.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Alias.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Scalar.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/createNode.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Collection.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyComment.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/foldFlowLines.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyString.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringify.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyPair.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/log.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/merge.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/addPairToJSMap.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Pair.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyCollection.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLMap.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/map.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLSeq.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/seq.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/string.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/null.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/bool.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyNumber.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/float.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/int.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/schema.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/json/schema.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/binary.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/pairs.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/omap.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/bool.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/float.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/int.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/set.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/schema.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/tags.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/Schema.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyDocument.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/Document.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/errors.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-props.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-contains-newline.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-flow-indent-check.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-map-includes.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-map.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-seq.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-end.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-collection.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-collection.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-scalar.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-scalar.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-scalar.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-empty-scalar-position.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-node.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-doc.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/composer.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-scalar.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-stringify.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-visit.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/lexer.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/line-counter.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/parser.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/public-api.js","../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/index.js","../../credentials/dist/index.mjs","../../workflow/dist/index.mjs"],"sourcesContent":["import { S as setDatabaseHandle, _ as users, x as isDatabaseInitialized, y as getDatabaseHandle } from \"./mcp-oauth-SRTcHMWZ.mjs\";\nimport { $ as updateOrganizationSidebarBranding, $n as requireOrganizationScopeId, $t as createPgConnection, A as upsertProjectMember, An as organizationBilling, B as isOrganizationStorageBucketInUse, Bn as organizationInvitationStatuses, C as backfillProjectUsers, Ct as provisionOrgDatabase, D as selectProjectMembers, Dn as billingLedger, Dt as orgRedisUsername, E as selectProjectIdsForUser, En as usageEvents, Et as orgRedisQueueSegment, F as selectUsersByIds, Fn as projectArtifactStatuses, G as selectUserOrganization, Gn as oauthApps, Gt as encryptCredentialPayload, H as selectActiveOrganizationIds, Hn as organizationUserRoles, I as updateUserById, In as projectArtifacts, J as updateOrganizationActive, Jn as organizationsSqlite, K as selectUserOrganizationMembership, Kn as apps, Kt as runMigrations, L as normalizeUserEmail, Ln as projectStatuses, M as selectUserByEmail, Mn as secretValues, N as selectUserById, Nn as publishedForms, O as selectUserProjectMembership, On as billingWallet, P as selectUserByNormalizedEmail, Pn as publishedFormsSqlite, Q as organizationRowToSidebarBranding, Qn as getOrganizationScopeId, Qt as createSqliteConnection, R as OrganizationSlugTakenError, Rn as projects, S as ProjectMemberNotFoundError, St as deprovisionOrgDatabase, T as removeProjectMember, Tn as managedServiceCredentialsSqlite, Tt as orgDbSchemaName, U as selectOrganizationById, Un as organizationUsers, V as resolveNewOrganizationIdentity, Vn as organizationInvitations, W as selectOrganizationBySlug, Wn as oauthConnections, Wt as decryptCredentialPayload, X as updateOrganizationName, Xn as authApiKeysSqlite, Y as updateOrganizationFailed, Yn as authApiKeys, Z as updateOrganizationSlug, Zn as bindOrganizationScope, Zt as createConnection, _ as selectProjectsByOrganizationId, _t as isSqliteDialect, a as DEFAULT_STANDALONE_PROJECT_SLUG, ar as qualifyConnectionUser, at as checkProjectSlugAvailability, b as updateProjectForOrganization, bt as orgRedisAclSetUserArgs, c as ensureDefaultProject, ct as desc$1, d as countActiveProjectsForOrganization, dt as inArray$1, en as resolveSearchPath, er as runWithOrganizationScope, et as checkOrganizationSlugAvailability, f as createProjectForOrganization, ft as isNull$1, g as selectProjectForOrganizationBySlug, gt as getSqliteDb, h as selectProjectForOrganization, ht as getDb, i as DEFAULT_STANDALONE_PROJECT_NAME, ir as parsePostgresUrl, it as ProjectSlugTakenError, j as findOrCreateUserByEmail, jn as organizationBillingSqlite, k as updateProjectMemberRole, kn as billingEvents, l as isStandaloneMode, lt as eq$1, m as selectProjectById, mt as or, n as DEFAULT_STANDALONE_ORGANIZATION_NAME, nr as resolvePlatformPostgresConfig, nt as buildDefaultOrgProjectName, o as ensureDefaultOrganization, or as inferDialect, ot as and$1, p as deleteProjectForOrganization, pt as lt, q as selectUserOrganizations, qn as organizations, qt as resolveMigrationsFolder, r as DEFAULT_STANDALONE_ORGANIZATION_SLUG, rr as buildPostgresUrl, rt as ensureDefaultOrgProjectInTransaction, s as ensureDefaultOrganizationAndProject, sr as DEFAULT_PLATFORM_DATABASE_URL, st as count$1, t as DEFAULT_STANDALONE_ORGANIZATION_ID, tn as createPgDb, tr as resolvePlatformDatabaseUrl, tt as addUserToDefaultOrgProjectInTransaction, u as runWithStandaloneScope, ut as gt, v as updateProjectActive, vt as buildOrgRedisUrl, w as inviteProjectMembers, wn as managedServiceCredentials, wt as orgDbRoleName, x as updateProjectSettings, xt as provisionOrgRedis, y as updateProjectFailed, yt as deprovisionOrgRedis, z as createOrganizationForUser, zn as projectsSqlite } from \"./default-org-BQdjsXc8.mjs\";\nimport { AsyncLocalStorage } from \"node:async_hooks\";\nimport { and, desc, eq, gte, inArray, isNull, lte, max, notInArray, sql } from \"drizzle-orm\";\nimport { createHash, randomBytes, timingSafeEqual } from \"node:crypto\";\nimport { AppSlugSchema, DEFAULT_PLAN_KEY, qualifyOrgSlug, slugifyAppName } from \"@keystrokehq/shared\";\nimport { containerPresignEndpointFromEnv, createContainerPresignStorage, createStorage, orgAgentBucketName } from \"@keystrokehq/storage\";\n//#region src/client/close.ts\nasync function closeDatabase() {\n\tif (!isDatabaseInitialized()) return;\n\tawait getDatabaseHandle().close();\n\tsetDatabaseHandle(void 0);\n}\n//#endregion\n//#region src/connection/pg/public-scoped-pool.ts\nconst PUBLIC_SEARCH_PATH = \"public\";\nfunction queryText(args) {\n\tconst first = args[0];\n\tif (typeof first === \"string\") return first;\n\treturn first.text;\n}\nfunction normalizeSqlCommand(text) {\n\treturn text?.trim().split(/\\s+/)[0]?.toUpperCase();\n}\nfunction isFullRollback(text) {\n\treturn text?.trim().toUpperCase() === \"ROLLBACK\";\n}\n/** Single multi-statement round trip: BEGIN + SET LOCAL search_path. */\nconst PUBLIC_SCOPE_BEGIN = `BEGIN; SET LOCAL search_path TO ${PUBLIC_SEARCH_PATH}`;\nfunction bindQuery(originalQuery) {\n\treturn (...args) => Promise.resolve(originalQuery(...args));\n}\nfunction createPublicScopedClient(client) {\n\tconst originalQuery = bindQuery(client.query.bind(client));\n\tlet prologueApplied = false;\n\tclient.query = ((...args) => {\n\t\tconst sql = queryText(args);\n\t\tconst command = normalizeSqlCommand(sql);\n\t\tif (command === \"BEGIN\") {\n\t\t\tif (!prologueApplied) {\n\t\t\t\tprologueApplied = true;\n\t\t\t\treturn originalQuery(PUBLIC_SCOPE_BEGIN);\n\t\t\t}\n\t\t\treturn originalQuery(...args);\n\t\t}\n\t\tif (command === \"COMMIT\") {\n\t\t\tprologueApplied = false;\n\t\t\treturn originalQuery(...args);\n\t\t}\n\t\tif (command === \"ROLLBACK\" && isFullRollback(sql)) {\n\t\t\tprologueApplied = false;\n\t\t\treturn originalQuery(...args);\n\t\t}\n\t\tif (command === \"ROLLBACK\") return originalQuery(...args);\n\t\treturn originalQuery(...args);\n\t});\n\treturn client;\n}\nfunction createPublicScopedPool(pool) {\n\tconst scopedPool = Object.create(pool);\n\tscopedPool.query = (async (...args) => {\n\t\tconst client = await pool.connect();\n\t\tconst query = bindQuery(client.query.bind(client));\n\t\ttry {\n\t\t\tawait query(PUBLIC_SCOPE_BEGIN);\n\t\t\tconst result = await query(...args);\n\t\t\tawait query(\"COMMIT\");\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tawait query(\"ROLLBACK\").catch(() => void 0);\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tclient.release();\n\t\t}\n\t});\n\tscopedPool.connect = ((callback) => {\n\t\tif (callback) return pool.connect((error, client, release) => {\n\t\t\tif (error || !client) {\n\t\t\t\tcallback(error ?? /* @__PURE__ */ new Error(\"failed to connect\"), client, release);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcallback(null, createPublicScopedClient(client), release);\n\t\t});\n\t\treturn pool.connect().then((client) => createPublicScopedClient(client));\n\t});\n\treturn scopedPool;\n}\n//#endregion\n//#region src/tenant-claim/upsert-secret.ts\n/** Upsert the HMAC secret used by `keystroke.current_organization_id()`. */\nasync function upsertOrganizationClaimSecret(pool, secret = process.env.DATABASE_RLS_CLAIM_SECRET ?? \"\") {\n\tconst trimmed = secret.trim();\n\tif (!trimmed) throw new Error(\"DATABASE_RLS_CLAIM_SECRET is required to configure claim verification\");\n\tawait pool.query(`INSERT INTO keystroke_private.claim_secret (singleton, secret, updated_at)\n VALUES (true, $1, now())\n ON CONFLICT (singleton) DO UPDATE\n SET secret = EXCLUDED.secret, updated_at = now()`, [trimmed]);\n}\n//#endregion\n//#region src/client/init.ts\nfunction resolveUrl(url) {\n\treturn url ?? resolvePlatformDatabaseUrl();\n}\nfunction wrapPlatformPostgresHandle(base) {\n\tconst pool = createPublicScopedPool(base.pool);\n\treturn {\n\t\tdialect: \"postgres\",\n\t\tdb: createPgDb(pool),\n\t\tpool,\n\t\tsearchPath: \"public\",\n\t\tclose: base.close\n\t};\n}\nasync function initDatabase(options = {}) {\n\tif (isDatabaseInitialized()) return;\n\tconst url = resolveUrl(options.url);\n\tconst dialect = options.dialect ?? inferDialect(url);\n\tconst searchPath = dialect === \"postgres\" ? resolveSearchPath(url, options.searchPath) : void 0;\n\tconst base = createConnection({\n\t\turl,\n\t\tdialect,\n\t\tmax: options.max,\n\t\tsearchPath\n\t});\n\tconst next = base.dialect === \"postgres\" ? wrapPlatformPostgresHandle(base) : base;\n\tsetDatabaseHandle(next);\n\tif (options.migrate ?? true) await runMigrations(next, resolveMigrationsFolder(dialect, options.migrationsFolder));\n\tif (next.dialect === \"postgres\" && process.env.DATABASE_RLS_CLAIM_SECRET?.trim()) await upsertOrganizationClaimSecret(next.pool);\n}\n//#endregion\n//#region src/tenant-claim/ensure-runtime-role.ts\n/** Shared login for claim-scoped tenant SQL. Must not be superuser / BYPASSRLS / table owner. */\nconst TENANT_RUNTIME_ROLE = \"keystroke_runtime\";\nconst TENANT_TABLES = [\n\t\"agent_events\",\n\t\"agent_sessions\",\n\t\"agents\",\n\t\"credential_assignments\",\n\t\"credential_instances\",\n\t\"gateway_attachments\",\n\t\"gateway_thread_sessions\",\n\t\"jobs\",\n\t\"resource_activity\",\n\t\"skills\",\n\t\"trace_logs\",\n\t\"trace_spans\",\n\t\"trigger_attachments\",\n\t\"trigger_runs\",\n\t\"triggers\",\n\t\"workflow_events\",\n\t\"workflow_hooks\",\n\t\"workflow_runs\",\n\t\"workflow_subscriptions\",\n\t\"workflows\"\n];\nfunction quoteLiteral(value) {\n\treturn `'${value.replace(/'/g, \"''\")}'`;\n}\n/**\n* Create (or reset) the unprivileged runtime role used by claim-scoped pools.\n* Superusers bypass RLS even with FORCE — tenant traffic must authenticate as this role.\n*/\nasync function ensureTenantRuntimeRole(pool, password) {\n\tif (!password.trim()) throw new Error(\"Tenant runtime role password is required\");\n\tconst quotedPassword = quoteLiteral(password);\n\tawait pool.query(`\n DO $role$\n BEGIN\n CREATE ROLE ${TENANT_RUNTIME_ROLE} WITH LOGIN PASSWORD ${quotedPassword}\n NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT NOBYPASSRLS;\n EXCEPTION\n WHEN duplicate_object THEN\n ALTER ROLE ${TENANT_RUNTIME_ROLE} WITH LOGIN PASSWORD ${quotedPassword}\n NOSUPERUSER NOBYPASSRLS;\n END\n $role$;\n `);\n\tawait pool.query(`GRANT USAGE ON SCHEMA public TO ${TENANT_RUNTIME_ROLE}`);\n\tawait pool.query(`GRANT USAGE ON SCHEMA keystroke TO ${TENANT_RUNTIME_ROLE}`);\n\tawait pool.query(`GRANT SELECT, INSERT, UPDATE, DELETE ON ${TENANT_TABLES.map((t) => `public.${t}`).join(\", \")} TO ${TENANT_RUNTIME_ROLE}`);\n}\n/** Rewrite a postgres URL to authenticate as the tenant runtime role. */\nfunction buildTenantRuntimeDatabaseUrl(adminUrl, password) {\n\treturn buildPostgresUrl({\n\t\t...parsePostgresUrl(adminUrl),\n\t\tuser: TENANT_RUNTIME_ROLE,\n\t\tpassword\n\t});\n}\n//#endregion\n//#region src/queries/billing/index.ts\n/**\n* Platform billing authority: `organization_billing` (Stripe/plan),\n* `billing_wallet` / `billing_ledger` / `usage_events`, plus `billing_events`\n* (best-effort webhook audit). Grant idempotency is `billing_ledger`\n* `(organization_id, idempotency_key)`.\n*/\n/**\n* Postgres uses a real transaction and row locks. SQLite is only used for local\n* dev/tests here; better-sqlite3 does not support async transaction callbacks.\n*/\nasync function withBillingTx(fn) {\n\tconst db = getDb();\n\tif (getDatabaseHandle().dialect === \"postgres\") return db.transaction(fn);\n\treturn fn(db);\n}\nfunction balancesOf(wallet, deltaPlan, deltaPrepaid) {\n\treturn {\n\t\tplanCreditMicroCredits: wallet.planCreditMicroCredits + deltaPlan,\n\t\tprepaidCreditMicroCredits: wallet.prepaidCreditMicroCredits + deltaPrepaid\n\t};\n}\nfunction storedJson(value) {\n\tif (value == null) return null;\n\treturn getDatabaseHandle().dialect === \"sqlite\" ? JSON.stringify(value) : value;\n}\nasync function lockWallet(tx, organizationId) {\n\tawait tx.insert(billingWallet).values({\n\t\torganizationId,\n\t\tupdatedAt: /* @__PURE__ */ new Date()\n\t}).onConflictDoNothing();\n\tconst query = tx.select().from(billingWallet).where(eq(billingWallet.organizationId, organizationId));\n\tconst wallet = (getDatabaseHandle().dialect === \"postgres\" ? await query.for(\"update\") : await query)[0];\n\tif (!wallet) throw new Error(`billing wallet missing for organization ${organizationId}`);\n\treturn wallet;\n}\nfunction splitDebit(wallet, chargeMicroCredits) {\n\tconst fromPlan = Math.min(Math.max(wallet.planCreditMicroCredits, 0), chargeMicroCredits);\n\treturn {\n\t\tplanCreditMicroCredits: fromPlan,\n\t\tprepaidCreditMicroCredits: chargeMicroCredits - fromPlan\n\t};\n}\nasync function getOrCreateBillingWallet(organizationId) {\n\tconst db = getDb();\n\tawait db.insert(billingWallet).values({\n\t\torganizationId,\n\t\tupdatedAt: /* @__PURE__ */ new Date()\n\t}).onConflictDoNothing();\n\tconst row = (await db.select().from(billingWallet).where(eq(billingWallet.organizationId, organizationId)).limit(1))[0];\n\tif (!row) throw new Error(`billing wallet missing for organization ${organizationId}`);\n\treturn row;\n}\nasync function getBillingWallet(organizationId) {\n\treturn (await getDb().select().from(billingWallet).where(eq(billingWallet.organizationId, organizationId)).limit(1))[0];\n}\nasync function applyLedgerCredit(input) {\n\treturn withBillingTx(async (tx) => {\n\t\tconst wallet = await lockWallet(tx, input.organizationId);\n\t\tconst planDelta = input.planDeltaMicroCredits ?? 0;\n\t\tconst prepaidDelta = input.prepaidDeltaMicroCredits ?? 0;\n\t\tconst createdAt = input.createdAt ?? /* @__PURE__ */ new Date();\n\t\tconst ledgerEntryId = (await tx.insert(billingLedger).values({\n\t\t\tid: crypto.randomUUID(),\n\t\t\torganizationId: input.organizationId,\n\t\t\tentryType: input.entryType,\n\t\t\tplanDeltaMicroCredits: planDelta,\n\t\t\tprepaidDeltaMicroCredits: prepaidDelta,\n\t\t\tsource: input.source,\n\t\t\tidempotencyKey: input.idempotencyKey,\n\t\t\trunId: input.runId ?? null,\n\t\t\tprojectId: input.projectId ?? null,\n\t\t\tproviderReference: input.providerReference ?? null,\n\t\t\tmetadata: storedJson(input.metadata),\n\t\t\tcreatedAt\n\t\t}).onConflictDoNothing().returning({ id: billingLedger.id }))[0]?.id ?? null;\n\t\tif (!ledgerEntryId) return {\n\t\t\tapplied: false,\n\t\t\tledgerEntryId: null,\n\t\t\tbalances: balancesOf(wallet, 0, 0)\n\t\t};\n\t\tawait tx.update(billingWallet).set({\n\t\t\tplanCreditMicroCredits: wallet.planCreditMicroCredits + planDelta,\n\t\t\tprepaidCreditMicroCredits: wallet.prepaidCreditMicroCredits + prepaidDelta,\n\t\t\t...input.periodStart === void 0 ? {} : { periodStart: input.periodStart },\n\t\t\t...input.periodEnd === void 0 ? {} : { periodEnd: input.periodEnd },\n\t\t\tupdatedAt: /* @__PURE__ */ new Date()\n\t\t}).where(eq(billingWallet.organizationId, input.organizationId));\n\t\treturn {\n\t\t\tapplied: true,\n\t\t\tledgerEntryId,\n\t\t\tbalances: balancesOf(wallet, planDelta, prepaidDelta)\n\t\t};\n\t});\n}\nasync function applyLedgerDebit(input) {\n\tif (input.chargeMicroCredits < 0) throw new Error(\"chargeMicroCredits must be >= 0; use applyLedgerCredit for credits\");\n\treturn withBillingTx(async (tx) => {\n\t\tconst wallet = await lockWallet(tx, input.organizationId);\n\t\tconst split = splitDebit(wallet, input.chargeMicroCredits);\n\t\tconst createdAt = input.createdAt ?? /* @__PURE__ */ new Date();\n\t\tconst ledgerEntryId = (await tx.insert(billingLedger).values({\n\t\t\tid: crypto.randomUUID(),\n\t\t\torganizationId: input.organizationId,\n\t\t\tentryType: \"debit\",\n\t\t\tplanDeltaMicroCredits: -split.planCreditMicroCredits,\n\t\t\tprepaidDeltaMicroCredits: -split.prepaidCreditMicroCredits,\n\t\t\tsource: input.source,\n\t\t\tidempotencyKey: input.idempotencyKey,\n\t\t\trunId: input.runId ?? null,\n\t\t\tprojectId: input.projectId ?? null,\n\t\t\tproviderReference: input.providerReference ?? null,\n\t\t\tmetadata: storedJson(input.metadata),\n\t\t\tcreatedAt\n\t\t}).onConflictDoNothing().returning({ id: billingLedger.id }))[0]?.id ?? null;\n\t\tif (!ledgerEntryId) return {\n\t\t\tapplied: false,\n\t\t\tledgerEntryId: null,\n\t\t\tfromPlanMicroCredits: 0,\n\t\t\tfromPrepaidMicroCredits: 0,\n\t\t\tbalances: balancesOf(wallet, 0, 0)\n\t\t};\n\t\tif (input.chargeMicroCredits > 0) await tx.update(billingWallet).set({\n\t\t\tplanCreditMicroCredits: wallet.planCreditMicroCredits - split.planCreditMicroCredits,\n\t\t\tprepaidCreditMicroCredits: wallet.prepaidCreditMicroCredits - split.prepaidCreditMicroCredits,\n\t\t\tupdatedAt: /* @__PURE__ */ new Date()\n\t\t}).where(eq(billingWallet.organizationId, input.organizationId));\n\t\treturn {\n\t\t\tapplied: true,\n\t\t\tledgerEntryId,\n\t\t\tfromPlanMicroCredits: split.planCreditMicroCredits,\n\t\t\tfromPrepaidMicroCredits: split.prepaidCreditMicroCredits,\n\t\t\tbalances: balancesOf(wallet, -split.planCreditMicroCredits, -split.prepaidCreditMicroCredits)\n\t\t};\n\t});\n}\n/**\n* Plan period reset in one wallet-locked transaction: expire any positive\n* plan leftover (debt carries into the new period), grant the new monthly\n* amount, and advance the period. Idempotent on the grant key — a duplicate\n* grant applies nothing, including the expiry, and the expire delta is read\n* under the lock so concurrent debits cannot leave residual plan credit.\n*/\nasync function resetWalletPlanPeriod(input) {\n\treturn withBillingTx(async (tx) => {\n\t\tconst wallet = await lockWallet(tx, input.organizationId);\n\t\tconst createdAt = input.createdAt ?? /* @__PURE__ */ new Date();\n\t\tif (!(await tx.insert(billingLedger).values({\n\t\t\tid: crypto.randomUUID(),\n\t\t\torganizationId: input.organizationId,\n\t\t\tentryType: \"grant_plan\",\n\t\t\tplanDeltaMicroCredits: input.grantMicroCredits,\n\t\t\tprepaidDeltaMicroCredits: 0,\n\t\t\tsource: input.source,\n\t\t\tidempotencyKey: input.idempotencyKey,\n\t\t\tproviderReference: input.providerReference ?? null,\n\t\t\tmetadata: storedJson(input.metadata),\n\t\t\tcreatedAt\n\t\t}).onConflictDoNothing().returning({ id: billingLedger.id }))[0]) return {\n\t\t\tapplied: false,\n\t\t\tbalances: balancesOf(wallet, 0, 0)\n\t\t};\n\t\tconst expireDelta = -Math.max(wallet.planCreditMicroCredits, 0);\n\t\tif (expireDelta !== 0) await tx.insert(billingLedger).values({\n\t\t\tid: crypto.randomUUID(),\n\t\t\torganizationId: input.organizationId,\n\t\t\tentryType: \"expire_plan\",\n\t\t\tplanDeltaMicroCredits: expireDelta,\n\t\t\tprepaidDeltaMicroCredits: 0,\n\t\t\tsource: input.source,\n\t\t\tidempotencyKey: `expire:${input.idempotencyKey}`,\n\t\t\tproviderReference: input.providerReference ?? null,\n\t\t\tmetadata: storedJson(input.metadata),\n\t\t\tcreatedAt\n\t\t});\n\t\tconst planDelta = expireDelta + input.grantMicroCredits;\n\t\tawait tx.update(billingWallet).set({\n\t\t\tplanCreditMicroCredits: wallet.planCreditMicroCredits + planDelta,\n\t\t\tperiodStart: input.periodStart,\n\t\t\tperiodEnd: input.periodEnd,\n\t\t\tupdatedAt: /* @__PURE__ */ new Date()\n\t\t}).where(eq(billingWallet.organizationId, input.organizationId));\n\t\treturn {\n\t\t\tapplied: true,\n\t\t\tbalances: balancesOf(wallet, planDelta, 0)\n\t\t};\n\t});\n}\n/**\n* Read-or-create the org's billing row. New rows default to\n* {@link DEFAULT_PLAN_KEY}; pass `defaults.planKey` to override on first\n* creation only. An existing row is returned untouched.\n*/\nasync function getOrCreateOrganizationBilling(organizationId, defaults) {\n\tconst db = getDb();\n\tconst now = /* @__PURE__ */ new Date();\n\tconst values = {\n\t\torganizationId,\n\t\tplanKey: defaults?.planKey ?? DEFAULT_PLAN_KEY,\n\t\tcreatedAt: now,\n\t\tupdatedAt: now\n\t};\n\tif (isSqliteDialect()) await getSqliteDb().insert(organizationBillingSqlite).values(values).onConflictDoNothing();\n\telse await db.insert(organizationBilling).values(values).onConflictDoNothing();\n\tconst row = (await db.select().from(organizationBilling).where(eq(organizationBilling.organizationId, organizationId)).limit(1))[0];\n\tif (!row) throw new Error(`organization_billing row missing for organization ${organizationId}`);\n\treturn row;\n}\nasync function selectOrganizationBillingByStripeCustomerId(stripeCustomerId) {\n\treturn (await getDb().select().from(organizationBilling).where(eq(organizationBilling.stripeCustomerId, stripeCustomerId)).limit(1))[0];\n}\nasync function updateOrganizationBilling(organizationId, values) {\n\tconst row = (await getDb().update(organizationBilling).set({\n\t\t...values,\n\t\tupdatedAt: /* @__PURE__ */ new Date()\n\t}).where(eq(organizationBilling.organizationId, organizationId)).returning())[0];\n\tif (!row) throw new Error(`organization_billing row missing for organization ${organizationId}`);\n\treturn row;\n}\n/**\n* Atomically claim the auto-top-up in-flight slot: set the marker only when no\n* intent is pending (`WHERE auto_topup_pending_intent_id IS NULL`). Concurrent\n* top-up triggers race here and exactly one wins; the losers no-op.\n*/\nasync function claimAutoTopupPendingIntent(organizationId, claimId) {\n\treturn (await getDb().update(organizationBilling).set({\n\t\tautoTopupPendingIntentId: claimId,\n\t\tupdatedAt: /* @__PURE__ */ new Date()\n\t}).where(and(eq(organizationBilling.organizationId, organizationId), isNull(organizationBilling.autoTopupPendingIntentId))).returning({ organizationId: organizationBilling.organizationId })).length > 0;\n}\n/**\n* Clear the auto-top-up in-flight marker only if it still matches the given\n* claim — a newer claim is never clobbered by a stale webhook.\n*/\nasync function clearAutoTopupPendingIntent(organizationId, claimId) {\n\tawait getDb().update(organizationBilling).set({\n\t\tautoTopupPendingIntentId: null,\n\t\tupdatedAt: /* @__PURE__ */ new Date()\n\t}).where(and(eq(organizationBilling.organizationId, organizationId), eq(organizationBilling.autoTopupPendingIntentId, claimId)));\n}\n/**\n* Newest audit-event timestamp for the org across the given types, or null.\n* Powers the billing page's failed-payment notice (failure newer than the\n* latest success).\n*/\nasync function selectLatestBillingEventAt(organizationId, types) {\n\treturn (await getDb().select({ createdAt: billingEvents.createdAt }).from(billingEvents).where(and(eq(billingEvents.organizationId, organizationId), inArray(billingEvents.type, types))).orderBy(desc(billingEvents.createdAt)).limit(1))[0]?.createdAt ?? null;\n}\n/** Best-effort audit insert; duplicate Stripe event ids no-op. */\nasync function insertBillingEvent(values) {\n\tawait getDb().insert(billingEvents).values({\n\t\tid: crypto.randomUUID(),\n\t\tstripeEventId: values.stripeEventId,\n\t\torganizationId: values.organizationId,\n\t\ttype: values.type,\n\t\tstatus: values.status,\n\t\tamountMicroCredits: values.amountMicroCredits ?? null,\n\t\tcreditsGrantedMicroCredits: values.creditsGrantedMicroCredits ?? null,\n\t\tbucket: values.bucket ?? null,\n\t\tstripeObjectId: values.stripeObjectId ?? null,\n\t\tmetadata: storedJson(values.metadata),\n\t\tcreatedAt: /* @__PURE__ */ new Date()\n\t}).onConflictDoNothing();\n}\nfunction usageEventKey(event) {\n\treturn `${event.source}\\0${event.sourceEventId}`;\n}\n/** First occurrence of each `(source, sourceEventId)` wins within a batch. */\nfunction normalizeUsageEvents(events) {\n\tconst byKey = /* @__PURE__ */ new Map();\n\tfor (const event of events) {\n\t\tconst key = usageEventKey(event);\n\t\tif (!byKey.has(key)) byKey.set(key, {\n\t\t\t...event,\n\t\t\tkey\n\t\t});\n\t}\n\treturn [...byKey.values()];\n}\n/**\n* Insert priced usage events and settle their total as one wallet debit,\n* atomically. Idempotency is the `(organizationId, source, sourceEventId)`\n* unique index — first write wins, a replay (e.g. a retried dispatch fee or a\n* same-day storage re-sample) is a `duplicate` no-op regardless of payload,\n* matching the old org-DB `(entryType, reference)` semantics.\n*/\nasync function insertUsageEventsAndSettle(organizationId, events) {\n\tconst normalized = normalizeUsageEvents(events);\n\treturn withBillingTx(async (tx) => {\n\t\tconst wallet = await lockWallet(tx, organizationId);\n\t\tconst acceptedAt = /* @__PURE__ */ new Date();\n\t\tconst inserted = normalized.length === 0 ? [] : await tx.insert(usageEvents).values(normalized.map((event) => ({\n\t\t\tid: crypto.randomUUID(),\n\t\t\torganizationId,\n\t\t\tprojectId: event.projectId ?? null,\n\t\t\trunId: event.runId ?? null,\n\t\t\trunKind: event.runKind ?? null,\n\t\t\tsource: event.source,\n\t\t\tsourceEventId: event.sourceEventId,\n\t\t\tmeterKey: event.meterKey,\n\t\t\tquantity: event.quantity,\n\t\t\tunit: event.unit,\n\t\t\tproviderCostUsd: event.providerCostUsd ?? null,\n\t\t\tkeySource: event.keySource ?? null,\n\t\t\tpriceVersion: event.priceVersion,\n\t\t\tchargeMicroCredits: event.chargeMicroCredits,\n\t\t\tsettledLedgerId: null,\n\t\t\toccurredAt: event.occurredAt,\n\t\t\tacceptedAt,\n\t\t\tmetadata: storedJson(event.metadata)\n\t\t}))).onConflictDoNothing().returning({\n\t\t\tid: usageEvents.id,\n\t\t\tsource: usageEvents.source,\n\t\t\tsourceEventId: usageEvents.sourceEventId,\n\t\t\trunId: usageEvents.runId,\n\t\t\tprojectId: usageEvents.projectId,\n\t\t\tchargeMicroCredits: usageEvents.chargeMicroCredits,\n\t\t\toccurredAt: usageEvents.occurredAt\n\t\t});\n\t\tconst insertedKeys = new Set(inserted.map((event) => usageEventKey(event)));\n\t\tconst duplicateCount = normalized.length - insertedKeys.size;\n\t\tconst chargeable = inserted.filter((event) => event.chargeMicroCredits > 0);\n\t\tconst totalChargeMicroCredits = chargeable.reduce((total, event) => total + event.chargeMicroCredits, 0);\n\t\tif (totalChargeMicroCredits === 0) return {\n\t\t\tinserted: inserted.length,\n\t\t\tduplicate: duplicateCount,\n\t\t\tsettledLedgerId: null,\n\t\t\tchargeMicroCredits: 0,\n\t\t\tbalances: balancesOf(wallet, 0, 0)\n\t\t};\n\t\tconst split = splitDebit(wallet, totalChargeMicroCredits);\n\t\tconst ledgerEntryId = crypto.randomUUID();\n\t\tawait tx.insert(billingLedger).values({\n\t\t\tid: ledgerEntryId,\n\t\t\torganizationId,\n\t\t\tentryType: \"debit\",\n\t\t\tplanDeltaMicroCredits: -split.planCreditMicroCredits,\n\t\t\tprepaidDeltaMicroCredits: -split.prepaidCreditMicroCredits,\n\t\t\tsource: \"usage_events\",\n\t\t\tidempotencyKey: `usage_settle:${chargeable.map((event) => event.id).sort().join(\",\")}`,\n\t\t\trunId: chargeable.length === 1 ? chargeable[0]?.runId ?? null : null,\n\t\t\tprojectId: chargeable.length === 1 ? chargeable[0]?.projectId ?? null : null,\n\t\t\tproviderReference: null,\n\t\t\tmetadata: storedJson({\n\t\t\t\tusageEventIds: chargeable.map((event) => event.id),\n\t\t\t\teventCount: chargeable.length,\n\t\t\t\tsplit: {\n\t\t\t\t\tfromPlan: split.planCreditMicroCredits,\n\t\t\t\t\tfromPrepaid: split.prepaidCreditMicroCredits\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcreatedAt: acceptedAt\n\t\t});\n\t\tawait tx.update(billingWallet).set({\n\t\t\tplanCreditMicroCredits: wallet.planCreditMicroCredits - split.planCreditMicroCredits,\n\t\t\tprepaidCreditMicroCredits: wallet.prepaidCreditMicroCredits - split.prepaidCreditMicroCredits,\n\t\t\tupdatedAt: /* @__PURE__ */ new Date()\n\t\t}).where(eq(billingWallet.organizationId, organizationId));\n\t\tawait tx.update(usageEvents).set({ settledLedgerId: ledgerEntryId }).where(inArray(usageEvents.id, chargeable.map((event) => event.id)));\n\t\treturn {\n\t\t\tinserted: inserted.length,\n\t\t\tduplicate: duplicateCount,\n\t\t\tsettledLedgerId: ledgerEntryId,\n\t\t\tchargeMicroCredits: totalChargeMicroCredits,\n\t\t\tbalances: balancesOf(wallet, -split.planCreditMicroCredits, -split.prepaidCreditMicroCredits)\n\t\t};\n\t});\n}\nasync function listUsageEventsForRuns(input) {\n\tif (input.runIds.length === 0) return [];\n\tconst conditions = [eq(usageEvents.organizationId, input.organizationId), inArray(usageEvents.runId, input.runIds)];\n\tif (input.runKind) conditions.push(eq(usageEvents.runKind, input.runKind));\n\treturn getDb().select().from(usageEvents).where(and(...conditions)).orderBy(desc(usageEvents.occurredAt), desc(usageEvents.id)).limit(input.limit ?? 100);\n}\n/**\n* Per-run usage rollup for the history list: one row per distinct\n* (run, meter, label) instead of raw events. The detail view loads full rows\n* via {@link listUsageEventsForRuns} only when a run is opened.\n*/\nasync function summarizeUsageForRuns(input) {\n\tif (input.runIds.length === 0) return [];\n\tconst sqlite = getDatabaseHandle().dialect === \"sqlite\";\n\tconst model = sqlite ? sql`json_extract(json_extract(${usageEvents.metadata}, '$'), '$.model')` : sql`${usageEvents.metadata}->>'model'`;\n\tconst legacyLabel = sqlite ? sql`json_extract(json_extract(${usageEvents.metadata}, '$'), '$.legacy.label')` : sql`${usageEvents.metadata}->'legacy'->>'label'`;\n\tconst legacyKind = sqlite ? sql`json_extract(json_extract(${usageEvents.metadata}, '$'), '$.legacy.kind')` : sql`${usageEvents.metadata}->'legacy'->>'kind'`;\n\treturn (await getDb().select({\n\t\trunId: usageEvents.runId,\n\t\tmeterKey: usageEvents.meterKey,\n\t\tmodel,\n\t\tlegacyLabel,\n\t\tlegacyKind,\n\t\tchargeMicroCredits: sql`coalesce(sum(${usageEvents.chargeMicroCredits}), 0)`.mapWith(Number)\n\t}).from(usageEvents).where(and(eq(usageEvents.organizationId, input.organizationId), inArray(usageEvents.runId, input.runIds))).groupBy(usageEvents.runId, usageEvents.meterKey, model, legacyLabel, legacyKind)).filter((row) => row.runId !== null);\n}\nasync function summarizeUsageByMeter(input) {\n\tconst conditions = [eq(usageEvents.organizationId, input.organizationId)];\n\tif (input.since) conditions.push(gte(usageEvents.occurredAt, input.since));\n\tif (input.until) conditions.push(lte(usageEvents.occurredAt, input.until));\n\treturn getDb().select({\n\t\tmeterKey: usageEvents.meterKey,\n\t\tquantity: sql`coalesce(sum(${usageEvents.quantity}), 0)`.mapWith(Number),\n\t\tchargeMicroCredits: sql`coalesce(sum(${usageEvents.chargeMicroCredits}), 0)`.mapWith(Number),\n\t\tunchargedProviderCostUsd: sql`coalesce(sum(\n case when ${usageEvents.chargeMicroCredits} = 0 then ${usageEvents.providerCostUsd} else 0 end\n ), 0)`.mapWith(Number)\n\t}).from(usageEvents).where(and(...conditions)).groupBy(usageEvents.meterKey);\n}\nasync function listBillingLedgerEntries(input) {\n\tconst db = getDb();\n\tconst conditions = [eq(billingLedger.organizationId, input.organizationId)];\n\tif (input.excludeEntryTypes && input.excludeEntryTypes.length > 0) conditions.push(notInArray(billingLedger.entryType, input.excludeEntryTypes));\n\treturn db.select().from(billingLedger).where(and(...conditions)).orderBy(desc(billingLedger.createdAt), desc(billingLedger.id)).limit(input.limit ?? 50);\n}\nasync function reconcileWalletAgainstLedger(organizationId) {\n\tconst row = (await getDb().select({\n\t\tplanLedgerMicroCredits: sql`(\n select coalesce(sum(${billingLedger.planDeltaMicroCredits}), 0)\n from ${billingLedger}\n where ${billingLedger.organizationId} = ${billingWallet.organizationId}\n )`.mapWith(Number),\n\t\tprepaidLedgerMicroCredits: sql`(\n select coalesce(sum(${billingLedger.prepaidDeltaMicroCredits}), 0)\n from ${billingLedger}\n where ${billingLedger.organizationId} = ${billingWallet.organizationId}\n )`.mapWith(Number),\n\t\twalletPlanMicroCredits: billingWallet.planCreditMicroCredits,\n\t\twalletPrepaidMicroCredits: billingWallet.prepaidCreditMicroCredits\n\t}).from(billingWallet).where(eq(billingWallet.organizationId, organizationId)).limit(1))[0];\n\tif (!row) return;\n\treturn {\n\t\t...row,\n\t\tbalanced: row.planLedgerMicroCredits === row.walletPlanMicroCredits && row.prepaidLedgerMicroCredits === row.walletPrepaidMicroCredits\n\t};\n}\n//#endregion\n//#region src/queries/api-keys/index.ts\nasync function selectApiKeyByConfigName(configId, name) {\n\treturn (await getDb().select().from(authApiKeys).where(and$1(eq$1(authApiKeys.configId, configId), eq$1(authApiKeys.name, name))).limit(1))[0];\n}\nasync function selectApiKeyById(id) {\n\treturn (await getDb().select().from(authApiKeys).where(eq$1(authApiKeys.id, id)).limit(1))[0];\n}\nasync function selectApiKeyByConfigAndHash(configId, keyHash) {\n\treturn (await getDb().select().from(authApiKeys).where(and$1(eq$1(authApiKeys.configId, configId), eq$1(authApiKeys.key, keyHash))).limit(1))[0];\n}\nasync function listApiKeysByConfigId(configId) {\n\treturn getDb().select().from(authApiKeys).where(eq$1(authApiKeys.configId, configId));\n}\nasync function listApiKeysByConfigReferenceId(configId, referenceId) {\n\treturn getDb().select().from(authApiKeys).where(and$1(eq$1(authApiKeys.configId, configId), eq$1(authApiKeys.referenceId, referenceId)));\n}\nasync function listApiKeysByConfigReferenceIds(configId, referenceIds) {\n\tif (referenceIds.length === 0) return [];\n\treturn getDb().select().from(authApiKeys).where(and$1(eq$1(authApiKeys.configId, configId), inArray$1(authApiKeys.referenceId, referenceIds)));\n}\nasync function insertApiKey(values) {\n\tif (isSqliteDialect()) {\n\t\tawait getSqliteDb().insert(authApiKeysSqlite).values(values);\n\t\treturn;\n\t}\n\tawait getDb().insert(authApiKeys).values(values);\n}\nasync function deleteApiKeyById(id) {\n\tawait getDb().delete(authApiKeys).where(eq$1(authApiKeys.id, id));\n}\n//#endregion\n//#region src/queries/list-cursor.ts\nfunction encodeCreatedAtIdCursor(cursor) {\n\treturn Buffer.from(JSON.stringify({\n\t\tcreatedAt: cursor.createdAt.toISOString(),\n\t\tid: cursor.id\n\t})).toString(\"base64url\");\n}\nfunction decodeCreatedAtIdCursor(value) {\n\ttry {\n\t\tconst parsed = JSON.parse(Buffer.from(value, \"base64url\").toString(\"utf8\"));\n\t\tif (typeof parsed.createdAt !== \"string\" || typeof parsed.id !== \"string\") return null;\n\t\tconst createdAt = new Date(parsed.createdAt);\n\t\tif (Number.isNaN(createdAt.getTime())) return null;\n\t\treturn {\n\t\t\tcreatedAt,\n\t\t\tid: parsed.id\n\t\t};\n\t} catch {\n\t\treturn null;\n\t}\n}\n//#endregion\n//#region src/queries/members/errors.ts\nvar OrganizationMemberMutationError = class extends Error {\n\tcode;\n\tconstructor(code, message) {\n\t\tsuper(message);\n\t\tthis.name = \"OrganizationMemberMutationError\";\n\t\tthis.code = code;\n\t}\n};\nvar CannotModifyOwnerError = class extends OrganizationMemberMutationError {\n\tconstructor(message = \"Organization owners cannot be modified this way\") {\n\t\tsuper(\"cannot_modify_owner\", message);\n\t}\n};\nvar LastOwnerError = class extends OrganizationMemberMutationError {\n\tconstructor(message = \"The organization must have at least one owner\") {\n\t\tsuper(\"last_owner\", message);\n\t}\n};\nvar OrganizationMemberNotFoundError = class extends OrganizationMemberMutationError {\n\tconstructor(message = \"Member not found\") {\n\t\tsuper(\"member_not_found\", message);\n\t}\n};\n//#endregion\n//#region src/queries/members/index.ts\nconst INVITATION_TTL_MS = 336 * 60 * 60 * 1e3;\n/** Active (non-deleted) members in the org — used for group analytics. */\nasync function countActiveMembersForOrganization(organizationId) {\n\tconst rows = await getDb().select({ total: count$1() }).from(organizationUsers).where(and$1(eq$1(organizationUsers.organizationId, organizationId), eq$1(organizationUsers.status, \"active\"), isNull$1(organizationUsers.deletedAt)));\n\treturn Number(rows[0]?.total ?? 0);\n}\nasync function selectOrganizationMembers(organizationId, options) {\n\tconst db = getDb();\n\tconst limit = options?.limit ?? 200;\n\tconst conditions = [eq$1(organizationUsers.organizationId, organizationId), isNull$1(organizationUsers.deletedAt)];\n\tif (options?.cursor) {\n\t\tconst decoded = decodeCreatedAtIdCursor(options.cursor);\n\t\tif (!decoded) throw new Error(\"Invalid cursor\");\n\t\tconditions.push(or(lt(organizationUsers.createdAt, decoded.createdAt), and$1(eq$1(organizationUsers.createdAt, decoded.createdAt), lt(users.id, decoded.id))));\n\t}\n\tconst rows = await db.select({\n\t\tid: users.id,\n\t\tname: users.name,\n\t\temail: users.email,\n\t\trole: organizationUsers.role,\n\t\tstatus: organizationUsers.status,\n\t\timage: users.image,\n\t\tcreatedAt: organizationUsers.createdAt\n\t}).from(organizationUsers).innerJoin(users, eq$1(organizationUsers.userId, users.id)).where(and$1(...conditions)).orderBy(desc$1(organizationUsers.createdAt), desc$1(users.id)).limit(limit + 1);\n\tconst hasMore = rows.length > limit;\n\tconst items = hasMore ? rows.slice(0, limit) : rows;\n\tconst last = items[items.length - 1];\n\treturn {\n\t\titems,\n\t\tnextCursor: hasMore && last ? encodeCreatedAtIdCursor({\n\t\t\tcreatedAt: last.createdAt,\n\t\t\tid: last.id\n\t\t}) : null\n\t};\n}\nasync function selectOrganizationMembership(organizationId, userId) {\n\treturn (await getDb().select().from(organizationUsers).where(and$1(eq$1(organizationUsers.organizationId, organizationId), eq$1(organizationUsers.userId, userId), isNull$1(organizationUsers.deletedAt))).limit(1))[0];\n}\nasync function selectPendingInvitation(organizationId, userId) {\n\treturn (await getDb().select().from(organizationInvitations).where(and$1(eq$1(organizationInvitations.organizationId, organizationId), eq$1(organizationInvitations.userId, userId), eq$1(organizationInvitations.status, \"pending\"))).limit(1))[0];\n}\nfunction isValidInviteEmail(email) {\n\treturn /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email);\n}\nasync function inviteOrganizationMembers(input) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst results = [];\n\tfor (const rawEmail of input.emails) {\n\t\tconst normalized = normalizeUserEmail(rawEmail);\n\t\tif (seen.has(normalized)) continue;\n\t\tseen.add(normalized);\n\t\tif (!isValidInviteEmail(normalized)) {\n\t\t\tresults.push({\n\t\t\t\temail: rawEmail.trim(),\n\t\t\t\tstatus: \"invalid\"\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst user = await findOrCreateUserByEmail(normalized);\n\t\tif ((await selectOrganizationMembership(input.organizationId, user.id))?.status === \"active\") {\n\t\t\tresults.push({\n\t\t\t\temail: normalized,\n\t\t\t\tstatus: \"already_member\"\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst pending = await selectPendingInvitation(input.organizationId, user.id);\n\t\tif (pending) {\n\t\t\tresults.push({\n\t\t\t\temail: normalized,\n\t\t\t\tstatus: \"pending\",\n\t\t\t\tinvitationId: pending.id\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst now = /* @__PURE__ */ new Date();\n\t\tconst db = getDb();\n\t\tconst invitationId = crypto.randomUUID();\n\t\ttry {\n\t\t\tawait db.transaction(async (tx) => {\n\t\t\t\tawait tx.insert(organizationInvitations).values({\n\t\t\t\t\tid: invitationId,\n\t\t\t\t\torganizationId: input.organizationId,\n\t\t\t\t\tuserId: user.id,\n\t\t\t\t\temail: normalized,\n\t\t\t\t\trole: input.role,\n\t\t\t\t\tstatus: \"pending\",\n\t\t\t\t\tinvitedByUserId: input.invitedByUserId,\n\t\t\t\t\tcreatedAt: now,\n\t\t\t\t\tupdatedAt: now,\n\t\t\t\t\texpiresAt: new Date(now.getTime() + INVITATION_TTL_MS)\n\t\t\t\t});\n\t\t\t\tconst [existing] = await tx.select().from(organizationUsers).where(and$1(eq$1(organizationUsers.organizationId, input.organizationId), eq$1(organizationUsers.userId, user.id))).limit(1);\n\t\t\t\tif (!existing) await tx.insert(organizationUsers).values({\n\t\t\t\t\torganizationId: input.organizationId,\n\t\t\t\t\tuserId: user.id,\n\t\t\t\t\trole: input.role,\n\t\t\t\t\tstatus: \"invited\",\n\t\t\t\t\tcreatedAt: now,\n\t\t\t\t\tupdatedAt: now\n\t\t\t\t});\n\t\t\t\telse await tx.update(organizationUsers).set({\n\t\t\t\t\trole: input.role,\n\t\t\t\t\tstatus: \"invited\",\n\t\t\t\t\tupdatedAt: now,\n\t\t\t\t\tdeletedAt: null\n\t\t\t\t}).where(and$1(eq$1(organizationUsers.organizationId, input.organizationId), eq$1(organizationUsers.userId, user.id)));\n\t\t\t});\n\t\t\tresults.push({\n\t\t\t\temail: normalized,\n\t\t\t\tstatus: \"sent\",\n\t\t\t\tinvitationId\n\t\t\t});\n\t\t} catch {\n\t\t\tconst raced = await selectPendingInvitation(input.organizationId, user.id);\n\t\t\tresults.push({\n\t\t\t\temail: normalized,\n\t\t\t\tstatus: raced ? \"pending\" : \"sent\",\n\t\t\t\tinvitationId: raced?.id ?? invitationId\n\t\t\t});\n\t\t}\n\t}\n\treturn results;\n}\nfunction isEditableOrganizationMemberStatus(status) {\n\treturn status === \"active\" || status === \"invited\";\n}\nasync function updateOrganizationMemberRole(organizationId, userId, role) {\n\tconst membership = await selectOrganizationMembership(organizationId, userId);\n\tif (!membership || !isEditableOrganizationMemberStatus(membership.status)) throw new OrganizationMemberNotFoundError();\n\tif (membership.role === \"owner\") throw new CannotModifyOwnerError();\n\tconst now = /* @__PURE__ */ new Date();\n\tawait getDb().transaction(async (tx) => {\n\t\tawait tx.update(organizationUsers).set({\n\t\t\trole,\n\t\t\tupdatedAt: now\n\t\t}).where(and$1(eq$1(organizationUsers.organizationId, organizationId), eq$1(organizationUsers.userId, userId), isNull$1(organizationUsers.deletedAt)));\n\t\tif (membership.status === \"invited\") await tx.update(organizationInvitations).set({\n\t\t\trole,\n\t\t\tupdatedAt: now\n\t\t}).where(and$1(eq$1(organizationInvitations.organizationId, organizationId), eq$1(organizationInvitations.userId, userId), eq$1(organizationInvitations.status, \"pending\")));\n\t});\n\tconst [member] = await selectOrganizationMembers(organizationId).then((page) => page.items.filter((row) => row.id === userId));\n\tif (!member) throw new OrganizationMemberNotFoundError();\n\treturn member;\n}\nasync function removeOrganizationMember(organizationId, userId) {\n\tconst membership = await selectOrganizationMembership(organizationId, userId);\n\tif (!membership) throw new OrganizationMemberNotFoundError();\n\tif (membership.role === \"owner\" && membership.status === \"active\") throw new CannotModifyOwnerError(\"Organization owners cannot be removed\");\n\tif (membership.status === \"suspended\") return;\n\tconst now = /* @__PURE__ */ new Date();\n\tawait getDb().transaction(async (tx) => {\n\t\tif (membership.status === \"invited\") await tx.update(organizationInvitations).set({\n\t\t\tstatus: \"declined\",\n\t\t\tupdatedAt: now\n\t\t}).where(and$1(eq$1(organizationInvitations.organizationId, organizationId), eq$1(organizationInvitations.userId, userId), eq$1(organizationInvitations.status, \"pending\")));\n\t\tawait tx.update(organizationUsers).set({\n\t\t\tstatus: \"suspended\",\n\t\t\tupdatedAt: now,\n\t\t\tdeletedAt: null\n\t\t}).where(and$1(eq$1(organizationUsers.organizationId, organizationId), eq$1(organizationUsers.userId, userId), isNull$1(organizationUsers.deletedAt)));\n\t});\n}\n//#endregion\n//#region src/queries/invitations/index.ts\nvar OrganizationInvitationNotFoundError = class extends Error {\n\tconstructor(message = \"Invitation not found\") {\n\t\tsuper(message);\n\t\tthis.name = \"OrganizationInvitationNotFoundError\";\n\t}\n};\nvar OrganizationInvitationForbiddenError = class extends Error {\n\tconstructor(message = \"Forbidden\") {\n\t\tsuper(message);\n\t\tthis.name = \"OrganizationInvitationForbiddenError\";\n\t}\n};\nvar OrganizationInvitationExpiredError = class extends Error {\n\tconstructor(message = \"Invitation has expired\") {\n\t\tsuper(message);\n\t\tthis.name = \"OrganizationInvitationExpiredError\";\n\t}\n};\nasync function selectInvitationById(invitationId) {\n\treturn (await getDb().select().from(organizationInvitations).where(eq$1(organizationInvitations.id, invitationId)).limit(1))[0];\n}\nfunction isInvitationExpired(invitation, now = /* @__PURE__ */ new Date()) {\n\treturn invitation.expiresAt !== null && invitation.expiresAt.getTime() <= now.getTime();\n}\nasync function selectPendingInvitationsForUser(userId) {\n\tconst db = getDb();\n\tconst now = /* @__PURE__ */ new Date();\n\treturn db.select({\n\t\tid: organizationInvitations.id,\n\t\torganizationName: organizations.name,\n\t\torganizationSlug: organizations.slug,\n\t\trole: organizationInvitations.role,\n\t\tinvitedByName: users.name,\n\t\tinvitedByEmail: users.email\n\t}).from(organizationInvitations).innerJoin(organizations, eq$1(organizationInvitations.organizationId, organizations.id)).innerJoin(users, eq$1(organizationInvitations.invitedByUserId, users.id)).where(and$1(eq$1(organizationInvitations.userId, userId), eq$1(organizationInvitations.status, \"pending\"), or(isNull$1(organizationInvitations.expiresAt), gt(organizationInvitations.expiresAt, now))));\n}\nasync function acceptInvitation(invitationId, userId) {\n\tconst invitation = await selectInvitationById(invitationId);\n\tif (!invitation || invitation.status !== \"pending\") throw new OrganizationInvitationNotFoundError();\n\tif (invitation.userId !== userId) throw new OrganizationInvitationForbiddenError();\n\tif (isInvitationExpired(invitation)) throw new OrganizationInvitationExpiredError();\n\tconst db = getDb();\n\tconst now = /* @__PURE__ */ new Date();\n\tawait db.transaction(async (tx) => {\n\t\tconst [existing] = await tx.select().from(organizationUsers).where(and$1(eq$1(organizationUsers.organizationId, invitation.organizationId), eq$1(organizationUsers.userId, userId))).limit(1);\n\t\tif (!existing) await tx.insert(organizationUsers).values({\n\t\t\torganizationId: invitation.organizationId,\n\t\t\tuserId,\n\t\t\trole: invitation.role,\n\t\t\tstatus: \"active\",\n\t\t\tcreatedAt: now,\n\t\t\tupdatedAt: now\n\t\t});\n\t\telse await tx.update(organizationUsers).set({\n\t\t\trole: existing.role === \"owner\" ? \"owner\" : invitation.role,\n\t\t\tstatus: \"active\",\n\t\t\tupdatedAt: now,\n\t\t\tdeletedAt: null\n\t\t}).where(and$1(eq$1(organizationUsers.organizationId, invitation.organizationId), eq$1(organizationUsers.userId, userId)));\n\t\tawait addUserToDefaultOrgProjectInTransaction(tx, invitation.organizationId, userId);\n\t\tawait tx.update(organizationInvitations).set({\n\t\t\tstatus: \"accepted\",\n\t\t\tupdatedAt: now\n\t\t}).where(eq$1(organizationInvitations.id, invitationId));\n\t});\n\tconst membership = await selectUserOrganizationMembership(userId, invitation.organizationId);\n\tif (!membership) throw new OrganizationMemberNotFoundError(\"Failed to load membership after accept\");\n\treturn membership;\n}\nasync function declineInvitation(invitationId, userId) {\n\tconst invitation = await selectInvitationById(invitationId);\n\tif (!invitation || invitation.status !== \"pending\") throw new OrganizationInvitationNotFoundError();\n\tif (invitation.userId !== userId) throw new OrganizationInvitationForbiddenError();\n\tconst now = /* @__PURE__ */ new Date();\n\tawait getDb().transaction(async (tx) => {\n\t\tawait tx.update(organizationUsers).set({\n\t\t\tstatus: \"rejected\",\n\t\t\tupdatedAt: now\n\t\t}).where(and$1(eq$1(organizationUsers.organizationId, invitation.organizationId), eq$1(organizationUsers.userId, userId), isNull$1(organizationUsers.deletedAt)));\n\t\tawait tx.update(organizationInvitations).set({\n\t\t\tstatus: \"declined\",\n\t\t\tupdatedAt: now\n\t\t}).where(eq$1(organizationInvitations.id, invitationId));\n\t});\n}\n//#endregion\n//#region src/queries/organization-users/index.ts\nasync function selectOrganizationUsersByUserId(userId) {\n\treturn getDb().select().from(organizationUsers).where(eq(organizationUsers.userId, userId));\n}\n//#endregion\n//#region src/queries/project-artifacts/complete-promote.ts\n/** Mark artifact ready and stage it as pending — does not flip activeArtifactId or sync registry. */\nasync function completeProjectArtifact(input) {\n\tconst db = getDb();\n\tconst now = /* @__PURE__ */ new Date();\n\tif (isSqliteDialect()) {\n\t\tconst [artifact] = await db.update(projectArtifacts).set({\n\t\t\tstatus: \"ready\",\n\t\t\tmanifestJson: input.manifestJson ?? null,\n\t\t\tupdatedAt: now\n\t\t}).where(and(eq(projectArtifacts.id, input.artifactId), eq(projectArtifacts.projectId, input.projectId), eq(projectArtifacts.status, \"pending\"))).returning();\n\t\tif (!artifact) throw new Error(\"Artifact not found or already completed\");\n\t\tconst [project] = await db.update(projects).set({\n\t\t\tpendingArtifactId: artifact.id,\n\t\t\tstatus: \"starting\",\n\t\t\tlastError: null,\n\t\t\tupdatedAt: now\n\t\t}).where(eq(projects.id, input.projectId)).returning();\n\t\tif (!project) throw new Error(\"Project not found\");\n\t\treturn {\n\t\t\tartifact,\n\t\t\tproject\n\t\t};\n\t}\n\treturn db.transaction(async (tx) => {\n\t\tconst [artifact] = await tx.update(projectArtifacts).set({\n\t\t\tstatus: \"ready\",\n\t\t\tmanifestJson: input.manifestJson ?? null,\n\t\t\tupdatedAt: now\n\t\t}).where(and(eq(projectArtifacts.id, input.artifactId), eq(projectArtifacts.projectId, input.projectId), eq(projectArtifacts.status, \"pending\"))).returning();\n\t\tif (!artifact) throw new Error(\"Artifact not found or already completed\");\n\t\tconst [project] = await tx.update(projects).set({\n\t\t\tpendingArtifactId: artifact.id,\n\t\t\tstatus: \"starting\",\n\t\t\tlastError: null,\n\t\t\tupdatedAt: now\n\t\t}).where(eq(projects.id, input.projectId)).returning();\n\t\tif (!project) throw new Error(\"Project not found\");\n\t\treturn {\n\t\t\tartifact,\n\t\t\tproject\n\t\t};\n\t});\n}\n/** Cut over live deploy to a staged artifact after the new runtime is healthy. */\nasync function promoteProjectArtifact(input) {\n\tconst db = getDb();\n\tconst now = /* @__PURE__ */ new Date();\n\tif (isSqliteDialect()) {\n\t\tconst [project] = await db.select().from(projects).where(eq(projects.id, input.projectId)).limit(1);\n\t\tif (!project) throw new Error(\"Project not found\");\n\t\tif (project.pendingArtifactId !== input.artifactId) throw new Error(\"Artifact is not the pending deploy for this project\");\n\t\tconst [artifact] = await db.select().from(projectArtifacts).where(and(eq(projectArtifacts.id, input.artifactId), eq(projectArtifacts.projectId, input.projectId), eq(projectArtifacts.status, \"ready\"))).limit(1);\n\t\tif (!artifact) throw new Error(\"Pending artifact not found or not ready\");\n\t\tconst [updatedProject] = await db.update(projects).set({\n\t\t\tactiveArtifactId: artifact.id,\n\t\t\tpendingArtifactId: null,\n\t\t\tupdatedAt: now\n\t\t}).where(eq(projects.id, input.projectId)).returning();\n\t\tif (!updatedProject) throw new Error(\"Project not found\");\n\t\treturn {\n\t\t\tartifact,\n\t\t\tproject: updatedProject\n\t\t};\n\t}\n\treturn db.transaction(async (tx) => {\n\t\tconst [project] = await tx.select().from(projects).where(eq(projects.id, input.projectId)).limit(1);\n\t\tif (!project) throw new Error(\"Project not found\");\n\t\tif (project.pendingArtifactId !== input.artifactId) throw new Error(\"Artifact is not the pending deploy for this project\");\n\t\tconst [artifact] = await tx.select().from(projectArtifacts).where(and(eq(projectArtifacts.id, input.artifactId), eq(projectArtifacts.projectId, input.projectId), eq(projectArtifacts.status, \"ready\"))).limit(1);\n\t\tif (!artifact) throw new Error(\"Pending artifact not found or not ready\");\n\t\tconst [updatedProject] = await tx.update(projects).set({\n\t\t\tactiveArtifactId: artifact.id,\n\t\t\tpendingArtifactId: null,\n\t\t\tupdatedAt: now\n\t\t}).where(eq(projects.id, input.projectId)).returning();\n\t\tif (!updatedProject) throw new Error(\"Project not found\");\n\t\treturn {\n\t\t\tartifact,\n\t\t\tproject: updatedProject\n\t\t};\n\t});\n}\nasync function updateProjectArtifactManifest(input) {\n\tconst db = getDb();\n\tconst now = /* @__PURE__ */ new Date();\n\tconst [artifact] = await db.update(projectArtifacts).set({\n\t\tmanifestJson: input.manifestJson,\n\t\tupdatedAt: now\n\t}).where(eq(projectArtifacts.id, input.artifactId)).returning();\n\tif (!artifact) throw new Error(\"Artifact not found\");\n\treturn artifact;\n}\n/** Attach a deploy's source manifest (file tree) to its artifact. */\nasync function updateProjectArtifactSourceManifest(input) {\n\tconst db = getDb();\n\tconst now = /* @__PURE__ */ new Date();\n\tconst [artifact] = await db.update(projectArtifacts).set({\n\t\tsourceManifestJson: input.sourceManifestJson,\n\t\tupdatedAt: now\n\t}).where(and(eq(projectArtifacts.id, input.artifactId), eq(projectArtifacts.projectId, input.projectId))).returning();\n\tif (!artifact) throw new Error(\"Artifact not found\");\n\treturn artifact;\n}\n//#endregion\n//#region src/queries/project-artifacts/last-deployment.ts\n/** Latest ready artifact timestamp per project for an organization. */\nasync function selectLastDeploymentAtByProject(organizationId) {\n\tconst rows = await getDb().select({\n\t\tprojectId: projectArtifacts.projectId,\n\t\tlastDeploymentAt: max(projectArtifacts.updatedAt)\n\t}).from(projectArtifacts).innerJoin(projects, eq(projects.id, projectArtifacts.projectId)).where(and(eq(projects.organizationId, organizationId), isNull(projects.deletedAt), eq(projectArtifacts.status, \"ready\"))).groupBy(projectArtifacts.projectId);\n\tconst result = {};\n\tfor (const row of rows) if (row.lastDeploymentAt) result[row.projectId] = row.lastDeploymentAt;\n\treturn result;\n}\n//#endregion\n//#region src/queries/project-artifacts/deployments.ts\n/** Ready artifact deploy history for a project, newest first. */\nasync function selectProjectDeployments(projectId) {\n\treturn (await getDb().select({\n\t\tid: projectArtifacts.id,\n\t\tprojectId: projectArtifacts.projectId,\n\t\tversion: projectArtifacts.version,\n\t\tcreatedAt: projectArtifacts.createdAt,\n\t\tactiveArtifactId: projects.activeArtifactId,\n\t\tdeployedByName: users.name,\n\t\tdeployedByEmail: users.email,\n\t\tdeployedByAvatarUrl: users.image\n\t}).from(projectArtifacts).innerJoin(projects, eq(projects.id, projectArtifacts.projectId)).leftJoin(users, eq(users.id, projectArtifacts.createdByUserId)).where(and(eq(projectArtifacts.projectId, projectId), eq(projectArtifacts.status, \"ready\"))).orderBy(desc(projectArtifacts.createdAt))).map((row) => ({\n\t\tid: row.id,\n\t\tprojectId: row.projectId,\n\t\tversion: row.version,\n\t\tcreatedAt: row.createdAt,\n\t\tactive: row.activeArtifactId === row.id,\n\t\tdeployedByName: row.deployedByName,\n\t\tdeployedByEmail: row.deployedByEmail,\n\t\tdeployedByAvatarUrl: row.deployedByAvatarUrl\n\t}));\n}\n//#endregion\n//#region src/queries/project-artifacts/index.ts\nasync function insertProjectArtifact(input) {\n\tconst db = getDb();\n\tconst now = /* @__PURE__ */ new Date();\n\tconst [versionRow] = await db.select({ maxVersion: max(projectArtifacts.version) }).from(projectArtifacts).where(eq(projectArtifacts.projectId, input.projectId));\n\tconst version = (versionRow?.maxVersion ?? 0) + 1;\n\tconst [row] = await db.insert(projectArtifacts).values({\n\t\tid: input.id,\n\t\tprojectId: input.projectId,\n\t\tstorageKey: input.storageKey,\n\t\tversion,\n\t\tcreatedByUserId: input.createdByUserId ?? null,\n\t\tstatus: \"pending\",\n\t\tcreatedAt: now,\n\t\tupdatedAt: now\n\t}).returning();\n\tif (!row) throw new Error(\"Failed to create project artifact\");\n\treturn row;\n}\nasync function selectProjectArtifactById(artifactId) {\n\treturn (await getDb().select().from(projectArtifacts).where(eq(projectArtifacts.id, artifactId)).limit(1))[0];\n}\nasync function selectProjectArtifactForProject(artifactId, projectId) {\n\treturn (await getDb().select().from(projectArtifacts).where(and(eq(projectArtifacts.id, artifactId), eq(projectArtifacts.projectId, projectId))).limit(1))[0];\n}\n/** Source manifest only — avoids loading the runtime `manifestJson` blob. */\nasync function selectProjectArtifactSourceManifestForProject(artifactId, projectId) {\n\treturn (await getDb().select({ sourceManifestJson: projectArtifacts.sourceManifestJson }).from(projectArtifacts).where(and(eq(projectArtifacts.id, artifactId), eq(projectArtifacts.projectId, projectId))).limit(1))[0];\n}\nasync function selectActiveProjectArtifactForProject(projectId) {\n\tconst activeArtifactId = (await getDb().select({ activeArtifactId: projects.activeArtifactId }).from(projects).where(eq(projects.id, projectId)).limit(1))[0]?.activeArtifactId;\n\tif (!activeArtifactId) return;\n\treturn selectProjectArtifactForProject(activeArtifactId, projectId);\n}\nasync function selectActiveArtifactManifestForProject(projectId) {\n\treturn (await getDb().select({ manifestJson: projectArtifacts.manifestJson }).from(projects).innerJoin(projectArtifacts, eq(projects.activeArtifactId, projectArtifacts.id)).where(eq(projects.id, projectId)).limit(1))[0]?.manifestJson ?? void 0;\n}\n/** Source manifest (file tree) for the project's currently active deploy. */\nasync function selectActiveArtifactSourceManifestForProject(projectId) {\n\treturn (await getDb().select({\n\t\tartifactId: projectArtifacts.id,\n\t\tsourceManifestJson: projectArtifacts.sourceManifestJson\n\t}).from(projects).innerJoin(projectArtifacts, eq(projects.activeArtifactId, projectArtifacts.id)).where(eq(projects.id, projectId)).limit(1))[0];\n}\n/** Runtime and source manifests for active deploys in an organization. */\nasync function selectActiveArtifactManifestsByOrganizationId(organizationId) {\n\treturn getDb().select({\n\t\tprojectId: projects.id,\n\t\tprojectUpdatedAt: projects.updatedAt,\n\t\tartifactId: projectArtifacts.id,\n\t\tartifactUpdatedAt: projectArtifacts.updatedAt,\n\t\tmanifestJson: projectArtifacts.manifestJson,\n\t\tsourceManifestJson: projectArtifacts.sourceManifestJson\n\t}).from(projects).innerJoin(projectArtifacts, eq(projects.activeArtifactId, projectArtifacts.id)).where(and(eq(projects.organizationId, organizationId), isNull(projects.deletedAt)));\n}\n//#endregion\n//#region src/queries/published-forms/index.ts\nfunction createPublishedFormToken() {\n\treturn randomBytes(32).toString(\"base64url\");\n}\nasync function selectPublishedFormForWorkflow(organizationId, projectId, workflowSlug) {\n\tif (isSqliteDialect()) return (await getSqliteDb().select().from(publishedFormsSqlite).where(and$1(eq$1(publishedFormsSqlite.organizationId, organizationId), eq$1(publishedFormsSqlite.projectId, projectId), eq$1(publishedFormsSqlite.workflowSlug, workflowSlug))).limit(1))[0];\n\treturn (await getDb().select().from(publishedForms).where(and$1(eq$1(publishedForms.organizationId, organizationId), eq$1(publishedForms.projectId, projectId), eq$1(publishedForms.workflowSlug, workflowSlug))).limit(1))[0];\n}\nasync function selectEnabledPublishedFormByToken(token) {\n\tif (isSqliteDialect()) return (await getSqliteDb().select({\n\t\tform: publishedFormsSqlite,\n\t\torganization: {\n\t\t\tid: organizationsSqlite.id,\n\t\t\tname: organizationsSqlite.name,\n\t\t\tcustomLogoEnabled: organizationsSqlite.customLogoEnabled,\n\t\t\tlogoLightUrl: organizationsSqlite.logoLightUrl,\n\t\t\tlogoDarkUrl: organizationsSqlite.logoDarkUrl,\n\t\t\tlogoHeightPx: organizationsSqlite.logoHeightPx\n\t\t},\n\t\tproject: {\n\t\t\tid: projectsSqlite.id,\n\t\t\tname: projectsSqlite.name\n\t\t}\n\t}).from(publishedFormsSqlite).innerJoin(organizationsSqlite, eq$1(publishedFormsSqlite.organizationId, organizationsSqlite.id)).innerJoin(projectsSqlite, eq$1(publishedFormsSqlite.projectId, projectsSqlite.id)).where(and$1(eq$1(publishedFormsSqlite.token, token), eq$1(publishedFormsSqlite.enabled, true), isNull$1(organizationsSqlite.deletedAt), isNull$1(projectsSqlite.deletedAt))).limit(1))[0];\n\treturn (await getDb().select({\n\t\tform: publishedForms,\n\t\torganization: {\n\t\t\tid: organizations.id,\n\t\t\tname: organizations.name,\n\t\t\tcustomLogoEnabled: organizations.customLogoEnabled,\n\t\t\tlogoLightUrl: organizations.logoLightUrl,\n\t\t\tlogoDarkUrl: organizations.logoDarkUrl,\n\t\t\tlogoHeightPx: organizations.logoHeightPx\n\t\t},\n\t\tproject: {\n\t\t\tid: projects.id,\n\t\t\tname: projects.name\n\t\t}\n\t}).from(publishedForms).innerJoin(organizations, eq$1(publishedForms.organizationId, organizations.id)).innerJoin(projects, eq$1(publishedForms.projectId, projects.id)).where(and$1(eq$1(publishedForms.token, token), eq$1(publishedForms.enabled, true), isNull$1(organizations.deletedAt), isNull$1(projects.deletedAt))).limit(1))[0];\n}\nasync function upsertPublishedForm(input) {\n\tconst existing = await selectPublishedFormForWorkflow(input.organizationId, input.projectId, input.workflowSlug);\n\tconst now = /* @__PURE__ */ new Date();\n\tif (existing) {\n\t\tif (isSqliteDialect()) {\n\t\t\tconst [updated] = await getSqliteDb().update(publishedFormsSqlite).set({\n\t\t\t\t...input.enabled !== void 0 ? { enabled: input.enabled } : {},\n\t\t\t\t...input.title !== void 0 ? { title: input.title } : {},\n\t\t\t\t...input.description !== void 0 ? { description: input.description } : {},\n\t\t\t\t...input.fieldConfig !== void 0 ? { fieldConfig: input.fieldConfig } : {},\n\t\t\t\tupdatedAt: now\n\t\t\t}).where(eq$1(publishedFormsSqlite.id, existing.id)).returning();\n\t\t\treturn updated;\n\t\t}\n\t\tconst [updated] = await getDb().update(publishedForms).set({\n\t\t\t...input.enabled !== void 0 ? { enabled: input.enabled } : {},\n\t\t\t...input.title !== void 0 ? { title: input.title } : {},\n\t\t\t...input.description !== void 0 ? { description: input.description } : {},\n\t\t\t...input.fieldConfig !== void 0 ? { fieldConfig: input.fieldConfig } : {},\n\t\t\tupdatedAt: now\n\t\t}).where(eq$1(publishedForms.id, existing.id)).returning();\n\t\treturn updated;\n\t}\n\tif (isSqliteDialect()) {\n\t\tconst [created] = await getSqliteDb().insert(publishedFormsSqlite).values({\n\t\t\tid: crypto.randomUUID(),\n\t\t\torganizationId: input.organizationId,\n\t\t\tprojectId: input.projectId,\n\t\t\tworkflowSlug: input.workflowSlug,\n\t\t\ttoken: createPublishedFormToken(),\n\t\t\tenabled: input.enabled ?? true,\n\t\t\ttitle: input.title ?? null,\n\t\t\tdescription: input.description ?? null,\n\t\t\tfieldConfig: input.fieldConfig ?? {},\n\t\t\tcreatedByUserId: input.createdByUserId,\n\t\t\tcreatedAt: now,\n\t\t\tupdatedAt: now\n\t\t}).returning();\n\t\treturn created;\n\t}\n\tconst [created] = await getDb().insert(publishedForms).values({\n\t\tid: crypto.randomUUID(),\n\t\torganizationId: input.organizationId,\n\t\tprojectId: input.projectId,\n\t\tworkflowSlug: input.workflowSlug,\n\t\ttoken: createPublishedFormToken(),\n\t\tenabled: input.enabled ?? true,\n\t\ttitle: input.title ?? null,\n\t\tdescription: input.description ?? null,\n\t\tfieldConfig: input.fieldConfig ?? {},\n\t\tcreatedByUserId: input.createdByUserId,\n\t\tcreatedAt: now,\n\t\tupdatedAt: now\n\t}).returning();\n\treturn created;\n}\nasync function unpublishFormForWorkflow(organizationId, projectId, workflowSlug) {\n\tif (isSqliteDialect()) {\n\t\tconst [updated] = await getSqliteDb().update(publishedFormsSqlite).set({\n\t\t\tenabled: false,\n\t\t\tupdatedAt: /* @__PURE__ */ new Date()\n\t\t}).where(and$1(eq$1(publishedFormsSqlite.organizationId, organizationId), eq$1(publishedFormsSqlite.projectId, projectId), eq$1(publishedFormsSqlite.workflowSlug, workflowSlug))).returning();\n\t\treturn updated;\n\t}\n\tconst [updated] = await getDb().update(publishedForms).set({\n\t\tenabled: false,\n\t\tupdatedAt: /* @__PURE__ */ new Date()\n\t}).where(and$1(eq$1(publishedForms.organizationId, organizationId), eq$1(publishedForms.projectId, projectId), eq$1(publishedForms.workflowSlug, workflowSlug))).returning();\n\treturn updated;\n}\nasync function rotatePublishedFormToken(organizationId, projectId, workflowSlug) {\n\tif (isSqliteDialect()) {\n\t\tconst [updated] = await getSqliteDb().update(publishedFormsSqlite).set({\n\t\t\ttoken: createPublishedFormToken(),\n\t\t\tupdatedAt: /* @__PURE__ */ new Date()\n\t\t}).where(and$1(eq$1(publishedFormsSqlite.organizationId, organizationId), eq$1(publishedFormsSqlite.projectId, projectId), eq$1(publishedFormsSqlite.workflowSlug, workflowSlug))).returning();\n\t\treturn updated;\n\t}\n\tconst [updated] = await getDb().update(publishedForms).set({\n\t\ttoken: createPublishedFormToken(),\n\t\tupdatedAt: /* @__PURE__ */ new Date()\n\t}).where(and$1(eq$1(publishedForms.organizationId, organizationId), eq$1(publishedForms.projectId, projectId), eq$1(publishedForms.workflowSlug, workflowSlug))).returning();\n\treturn updated;\n}\n//#endregion\n//#region src/queries/managed-service-credentials/index.ts\nasync function insertManagedServiceCredential(values) {\n\tif (isSqliteDialect()) {\n\t\tawait getSqliteDb().insert(managedServiceCredentialsSqlite).values(values);\n\t\treturn;\n\t}\n\tawait getDb().insert(managedServiceCredentials).values(values);\n}\nasync function updateManagedServiceCredentialValue(id, values) {\n\tif (isSqliteDialect()) {\n\t\tawait getSqliteDb().update(managedServiceCredentialsSqlite).set(values).where(eq$1(managedServiceCredentialsSqlite.id, id));\n\t\treturn;\n\t}\n\tawait getDb().update(managedServiceCredentials).set(values).where(eq$1(managedServiceCredentials.id, id));\n}\nasync function listManagedServiceCredentialsForOrganization(organizationId, kind) {\n\tconst db = getDb();\n\tconst conditions = kind ? and$1(eq$1(managedServiceCredentials.organizationId, organizationId), eq$1(managedServiceCredentials.kind, kind)) : eq$1(managedServiceCredentials.organizationId, organizationId);\n\treturn db.select().from(managedServiceCredentials).where(conditions);\n}\nasync function getManagedServiceCredential(organizationId, kind, provider) {\n\treturn (await getDb().select().from(managedServiceCredentials).where(and$1(eq$1(managedServiceCredentials.organizationId, organizationId), eq$1(managedServiceCredentials.kind, kind), eq$1(managedServiceCredentials.provider, provider))).limit(1))[0];\n}\nasync function selectManagedServiceCredentialById(id) {\n\treturn (await getDb().select().from(managedServiceCredentials).where(eq$1(managedServiceCredentials.id, id)).limit(1))[0];\n}\nasync function deleteManagedServiceCredential(id) {\n\tif (isSqliteDialect()) {\n\t\tawait getSqliteDb().delete(managedServiceCredentialsSqlite).where(eq$1(managedServiceCredentialsSqlite.id, id));\n\t\treturn;\n\t}\n\tawait getDb().delete(managedServiceCredentials).where(eq$1(managedServiceCredentials.id, id));\n}\n//#endregion\n//#region src/api-keys/constants.ts\nconst WEBHOOK_API_KEY_CONFIG_ID = \"webhook\";\nconst ORG_PLATFORM_API_KEY_CONFIG_ID = \"org-platform\";\nfunction generateApiKeySecret(prefix = \"wh_\") {\n\treturn `${prefix}${randomBytes(32).toString(\"base64url\")}`;\n}\nfunction apiKeyStart(secret, length = 8) {\n\treturn secret.slice(0, length);\n}\nfunction encryptApiKeySecret(secret) {\n\treturn encryptCredentialPayload(secret);\n}\nfunction decryptApiKeySecret(ciphertext) {\n\treturn decryptCredentialPayload(ciphertext);\n}\nfunction hashApiKeySecret(secret) {\n\treturn createHash(\"sha256\").update(secret).digest(\"base64\");\n}\nfunction verifyApiKeySecret(secret, storedHash) {\n\tconst actual = Buffer.from(hashApiKeySecret(secret));\n\tconst expected = Buffer.from(storedHash);\n\tif (actual.length !== expected.length) return false;\n\treturn timingSafeEqual(actual, expected);\n}\n//#endregion\n//#region src/api-keys/metadata.ts\nfunction parseWebhookApiKeyMetadata(metadata) {\n\tif (!metadata) return null;\n\ttry {\n\t\tconst value = JSON.parse(metadata);\n\t\tif (value.kind !== \"trigger-webhook\" || typeof value.route !== \"string\" || typeof value.projectId !== \"string\") return null;\n\t\tconst rawSlugs = value.attachmentSlugs ?? value.attachmentKeys;\n\t\tconst attachmentSlugs = Array.isArray(rawSlugs) ? rawSlugs.filter((slug) => typeof slug === \"string\") : [];\n\t\treturn {\n\t\t\tkind: \"trigger-webhook\",\n\t\t\tprojectId: value.projectId,\n\t\t\troute: value.route,\n\t\t\tattachmentSlugs\n\t\t};\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction serializeWebhookApiKeyMetadata(metadata) {\n\treturn JSON.stringify(metadata);\n}\n//#endregion\n//#region src/api-keys/list.ts\nfunction toWebhookApiKeyViews(rows) {\n\tconst views = [];\n\tfor (const row of rows) {\n\t\tconst parsed = parseWebhookApiKeyMetadata(row.metadata);\n\t\tif (!parsed || !row.keyCiphertext) continue;\n\t\tviews.push({\n\t\t\tid: row.id,\n\t\t\tprojectId: parsed.projectId,\n\t\t\troute: parsed.route,\n\t\t\tname: row.name,\n\t\t\tstart: row.start,\n\t\t\tprefix: row.prefix,\n\t\t\ttoken: decryptApiKeySecret(row.keyCiphertext),\n\t\t\tattachmentSlugs: parsed.attachmentSlugs,\n\t\t\tcreatedAt: row.createdAt,\n\t\t\tupdatedAt: row.updatedAt\n\t\t});\n\t}\n\treturn views;\n}\nasync function listWebhookApiKeys() {\n\treturn toWebhookApiKeyViews(await listApiKeysByConfigId(WEBHOOK_API_KEY_CONFIG_ID));\n}\nasync function listWebhookApiKeysForProject(projectId) {\n\treturn toWebhookApiKeyViews(await listApiKeysByConfigReferenceId(WEBHOOK_API_KEY_CONFIG_ID, projectId));\n}\n/** Webhook keys for the given projects only (decrypts only those rows). */\nasync function listWebhookApiKeysForProjects(projectIds) {\n\tif (projectIds.length === 0) return [];\n\treturn toWebhookApiKeyViews(await listApiKeysByConfigReferenceIds(WEBHOOK_API_KEY_CONFIG_ID, projectIds));\n}\n//#endregion\n//#region src/api-keys/ensure.ts\nfunction webhookEndpointSuffix(route) {\n\treturn route.startsWith(\"/triggers/\") ? route.slice(10) : route;\n}\nfunction webhookApiKeyName(projectId, route) {\n\treturn `${projectId}:${webhookEndpointSuffix(route)}`;\n}\nasync function ensureWebhookApiKeys(projectId, routes, referenceId) {\n\tconst created = [];\n\tconst existing = [];\n\tfor (const { route, attachmentSlugs } of routes) {\n\t\tconst name = webhookApiKeyName(projectId, route);\n\t\tif (await selectApiKeyByConfigName(\"webhook\", name)) {\n\t\t\texisting.push(route);\n\t\t\tcontinue;\n\t\t}\n\t\tconst secret = generateApiKeySecret();\n\t\tconst now = /* @__PURE__ */ new Date();\n\t\tconst metadata = {\n\t\t\tkind: \"trigger-webhook\",\n\t\t\tprojectId,\n\t\t\troute,\n\t\t\tattachmentSlugs\n\t\t};\n\t\tawait insertApiKey({\n\t\t\tid: crypto.randomUUID(),\n\t\t\tconfigId: WEBHOOK_API_KEY_CONFIG_ID,\n\t\t\tname,\n\t\t\tstart: apiKeyStart(secret),\n\t\t\tprefix: \"wh_\",\n\t\t\tkey: hashApiKeySecret(secret),\n\t\t\tkeyCiphertext: encryptApiKeySecret(secret),\n\t\t\treferenceId,\n\t\t\tmetadata: serializeWebhookApiKeyMetadata(metadata),\n\t\t\tpermissions: JSON.stringify({ triggers: [\"invoke\"] }),\n\t\t\tcreatedAt: now,\n\t\t\tupdatedAt: now\n\t\t});\n\t\tcreated.push({\n\t\t\troute,\n\t\t\ttoken: secret\n\t\t});\n\t}\n\treturn {\n\t\tcreated,\n\t\texisting\n\t};\n}\n/** Idempotently ensures a webhook API key exists and returns the plaintext token. */\nasync function ensureWebhookApiKeyForRoute(projectId, route, attachmentSlugs) {\n\tconst created = (await ensureWebhookApiKeys(projectId, [{\n\t\troute,\n\t\tattachmentSlugs\n\t}], projectId)).created.find((entry) => entry.route === route);\n\tif (created) return created.token;\n\tconst existing = (await listWebhookApiKeysForProject(projectId)).find((entry) => entry.route === route);\n\tif (!existing?.token) throw new Error(`Webhook API key not found for route ${route}`);\n\treturn existing.token;\n}\n//#endregion\n//#region src/api-keys/verify.ts\nasync function verifyWebhookApiKeyForRoute(projectId, route, secret) {\n\tconst row = await selectApiKeyByConfigName(WEBHOOK_API_KEY_CONFIG_ID, webhookApiKeyName(projectId, route));\n\tif (!row) return false;\n\treturn verifyApiKeySecret(secret, row.key);\n}\n//#endregion\n//#region src/api-keys/org-platform-metadata.ts\nfunction parseOrgPlatformApiKeyMetadata(metadata) {\n\tif (!metadata) return null;\n\ttry {\n\t\tconst value = JSON.parse(metadata);\n\t\tif (value.kind !== \"org-platform\" || typeof value.organizationId !== \"string\" || typeof value.createdByUserId !== \"string\" || typeof value.keyPreview !== \"string\") return null;\n\t\treturn {\n\t\t\tkind: \"org-platform\",\n\t\t\torganizationId: value.organizationId,\n\t\t\tcreatedByUserId: value.createdByUserId,\n\t\t\tkeyPreview: value.keyPreview\n\t\t};\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction serializeOrgPlatformApiKeyMetadata(metadata) {\n\treturn JSON.stringify(metadata);\n}\n//#endregion\n//#region src/api-keys/org-platform.ts\nvar OrgPlatformApiKeyNotFoundError = class extends Error {\n\tconstructor() {\n\t\tsuper(\"API key not found\");\n\t\tthis.name = \"OrgPlatformApiKeyNotFoundError\";\n\t}\n};\nfunction keyPreviewFromSecret(secret) {\n\treturn `******${secret.slice(-4)}`;\n}\nfunction parseOrgPlatformRow(row) {\n\tconst metadata = parseOrgPlatformApiKeyMetadata(row.metadata);\n\tif (!metadata || row.name == null) return null;\n\treturn {\n\t\tid: row.id,\n\t\tname: row.name,\n\t\tkeyPreview: metadata.keyPreview,\n\t\tcreatedAt: row.createdAt,\n\t\tcreatedByUserId: metadata.createdByUserId\n\t};\n}\nfunction isActiveApiKey(row) {\n\tif (row.enabled === false) return false;\n\tif (row.expiresAt && row.expiresAt.getTime() <= Date.now()) return false;\n\treturn true;\n}\nasync function listOrgPlatformApiKeysForUser(organizationId, userId) {\n\tconst rows = await listApiKeysByConfigReferenceId(ORG_PLATFORM_API_KEY_CONFIG_ID, userId);\n\tconst records = [];\n\tfor (const row of rows) {\n\t\tconst metadata = parseOrgPlatformApiKeyMetadata(row.metadata);\n\t\tif (!metadata || metadata.organizationId !== organizationId || metadata.createdByUserId !== userId) continue;\n\t\tconst record = parseOrgPlatformRow(row);\n\t\tif (record) records.push(record);\n\t}\n\treturn records;\n}\nasync function listOrgPlatformApiKeysForOrganization(organizationId) {\n\tconst rows = await listApiKeysByConfigId(ORG_PLATFORM_API_KEY_CONFIG_ID);\n\tconst records = [];\n\tfor (const row of rows) {\n\t\tconst metadata = parseOrgPlatformApiKeyMetadata(row.metadata);\n\t\tif (!metadata || metadata.organizationId !== organizationId) continue;\n\t\tconst record = parseOrgPlatformRow(row);\n\t\tif (record) records.push(record);\n\t}\n\treturn records;\n}\nasync function createOrgPlatformApiKey(input) {\n\tconst secret = generateApiKeySecret(\"sk_\");\n\tconst now = /* @__PURE__ */ new Date();\n\tconst metadata = serializeOrgPlatformApiKeyMetadata({\n\t\tkind: \"org-platform\",\n\t\torganizationId: input.organizationId,\n\t\tcreatedByUserId: input.userId,\n\t\tkeyPreview: keyPreviewFromSecret(secret)\n\t});\n\tconst record = {\n\t\tid: crypto.randomUUID(),\n\t\tname: input.name,\n\t\tkeyPreview: keyPreviewFromSecret(secret),\n\t\tcreatedAt: now,\n\t\tcreatedByUserId: input.userId,\n\t\tsecret\n\t};\n\tawait insertApiKey({\n\t\tid: record.id,\n\t\tconfigId: ORG_PLATFORM_API_KEY_CONFIG_ID,\n\t\tname: input.name,\n\t\tstart: apiKeyStart(secret),\n\t\tprefix: \"sk_\",\n\t\tkey: hashApiKeySecret(secret),\n\t\tkeyCiphertext: encryptApiKeySecret(secret),\n\t\treferenceId: input.userId,\n\t\tmetadata,\n\t\tcreatedAt: now,\n\t\tupdatedAt: now\n\t});\n\treturn record;\n}\n/** Returns an existing org-platform key secret or creates one when missing. */\nasync function ensureOrgPlatformApiKey(input) {\n\tconst row = await selectApiKeyByConfigName(ORG_PLATFORM_API_KEY_CONFIG_ID, input.name);\n\tif (row?.keyCiphertext && isActiveApiKey(row)) {\n\t\tif (parseOrgPlatformApiKeyMetadata(row.metadata)?.organizationId === input.organizationId) return decryptApiKeySecret(row.keyCiphertext);\n\t}\n\treturn (await createOrgPlatformApiKey(input)).secret;\n}\nfunction mcpProjectApiKeyName(organizationId, projectSlug) {\n\treturn `mcp:${organizationId}:${projectSlug}`;\n}\nasync function selectOrgPlatformApiKeyForOrganization(apiKeyId, organizationId) {\n\tconst row = await selectApiKeyById(apiKeyId);\n\tif (!row || row.configId !== \"org-platform\") return null;\n\tconst record = parseOrgPlatformRow(row);\n\tif (!record) return null;\n\tif (parseOrgPlatformApiKeyMetadata(row.metadata)?.organizationId !== organizationId) return null;\n\treturn record;\n}\nasync function revokeOrgPlatformApiKey(apiKeyId, organizationId) {\n\tif (!await selectOrgPlatformApiKeyForOrganization(apiKeyId, organizationId)) throw new OrgPlatformApiKeyNotFoundError();\n\tawait deleteApiKeyById(apiKeyId);\n}\nasync function verifyOrgPlatformApiKeySecret(secret) {\n\tif (!secret.startsWith(\"sk_\")) return null;\n\tconst row = await selectApiKeyByConfigAndHash(ORG_PLATFORM_API_KEY_CONFIG_ID, hashApiKeySecret(secret));\n\tif (!row || !isActiveApiKey(row)) return null;\n\tconst metadata = parseOrgPlatformApiKeyMetadata(row.metadata);\n\tif (!metadata) return null;\n\treturn {\n\t\tapiKeyId: row.id,\n\t\torganizationId: metadata.organizationId,\n\t\tuserId: metadata.createdByUserId\n\t};\n}\nasync function loadOrgPlatformApiKeyUser(userId) {\n\treturn await selectUserById(userId) ?? null;\n}\nfunction mapOrgPlatformApiKeyCreator(user) {\n\treturn {\n\t\tid: user.id,\n\t\tname: user.name,\n\t\temail: user.email,\n\t\tavatarUrl: user.image ?? void 0\n\t};\n}\nfunction mapOrgPlatformApiKeyCreatorOrDeleted(userId, user) {\n\tif (user) return mapOrgPlatformApiKeyCreator(user);\n\treturn {\n\t\tid: userId,\n\t\tname: \"Deleted user\",\n\t\tdeleted: true\n\t};\n}\n//#endregion\n//#region src/client/workspace-context.ts\nconst storage = new AsyncLocalStorage();\nfunction runWithWorkspaceContext(context, fn) {\n\treturn storage.run(context, fn);\n}\nfunction getWorkspaceContext() {\n\treturn storage.getStore();\n}\nfunction requireWorkspaceContext() {\n\tconst context = getWorkspaceContext();\n\tif (!context) throw new Error(\"Workspace context is not set\");\n\treturn context;\n}\n//#endregion\n//#region src/project-database/build-url.ts\n/**\n* Org DB connection options for tenant scope.\n*\n* Postgres: shared platform `DATABASE_URL` + signed organization claim (RLS).\n* Sqlite: per-org file path (standalone).\n*/\nfunction resolveOrgProjectDatabaseOptions(organization, env = process.env) {\n\tconst platformUrl = resolvePlatformDatabaseUrl(env);\n\tif (inferDialect(platformUrl) === \"postgres\") return {\n\t\turl: platformUrl,\n\t\torganizationId: organization.id\n\t};\n\treturn { url: organization.dbSchema.startsWith(\"file:\") ? organization.dbSchema : `file:${organization.dbSchema}` };\n}\nfunction buildOrgDatabaseUrl(user, password, env = process.env) {\n\treturn buildPostgresUrl({\n\t\t...resolvePlatformPostgresConfig(env),\n\t\tuser: qualifyConnectionUser(user, env),\n\t\tpassword\n\t});\n}\nfunction resolveOrgDatabaseUrl(organization, env = process.env) {\n\tconst platformUrl = resolvePlatformDatabaseUrl(env);\n\tif (inferDialect(platformUrl) === \"sqlite\") return organization.dbSchema.startsWith(\"file:\") ? organization.dbSchema : `file:${organization.dbSchema}`;\n\treturn platformUrl;\n}\n//#endregion\n//#region src/project-database/runtime-env.ts\nasync function resolveOrgRuntimeDatabase(organizationId) {\n\tconst organization = await selectOrganizationById(organizationId);\n\tif (!organization) throw new Error(`Organization not found: ${organizationId}`);\n\tif (inferDialect(resolvePlatformDatabaseUrl()) === \"sqlite\") {\n\t\tconst url = organization.dbSchema.startsWith(\"file:\") ? organization.dbSchema : `file:${organization.dbSchema}`;\n\t\treturn {\n\t\t\thost: \"\",\n\t\t\tport: 0,\n\t\t\tdatabase: organization.dbSchema,\n\t\t\tuser: \"\",\n\t\t\tpassword: \"\",\n\t\t\tsearchPath: \"\",\n\t\t\turl\n\t\t};\n\t}\n\tconst platform = resolvePlatformPostgresConfig();\n\treturn {\n\t\thost: platform.host,\n\t\tport: platform.port,\n\t\tdatabase: platform.database,\n\t\tuser: platform.user,\n\t\tpassword: platform.password,\n\t\tsearchPath: \"public\"\n\t};\n}\n//#endregion\n//#region src/project-database/ensure-pgboss-grants.ts\n/**\n* Historical: granted every org login role access to `pgboss`.\n* Org roles are retired (public + RLS); the platform DB role owns pg-boss.\n*/\nasync function ensureOrgPgBossGrants() {}\n/** @deprecated Use {@link ensureOrgPgBossGrants}. */\nconst ensureProjectPgBossGrants = ensureOrgPgBossGrants;\n//#endregion\n//#region src/org-storage/resolve-config.ts\nfunction hasOrgStorageConfig(organization) {\n\treturn !!organization.storageBucket && !!organization.storageEndpoint && !!organization.storageAccessKeyIdCiphertext && !!organization.storageSecretAccessKeyCiphertext;\n}\nfunction resolveOrgStorageConfig(organization) {\n\tif (!hasOrgStorageConfig(organization)) throw new Error(\"Organization storage is not configured\");\n\treturn {\n\t\tbucket: organization.storageBucket,\n\t\tendpoint: organization.storageEndpoint,\n\t\taccessKeyId: decryptCredentialPayload(organization.storageAccessKeyIdCiphertext),\n\t\tsecretAccessKey: decryptCredentialPayload(organization.storageSecretAccessKeyCiphertext),\n\t\tregion: organization.storageRegion ?? \"us-east-1\",\n\t\tforcePathStyle: organization.storageForcePathStyle ?? true\n\t};\n}\n//#endregion\n//#region src/org-storage/client.ts\nfunction createOrgStorageClient(organization) {\n\treturn createStorage(resolveOrgStorageConfig(organization));\n}\nfunction createOrgAgentStorageClient(organization, agentId) {\n\tconst config = resolveOrgStorageConfig(organization);\n\tconst bucket = orgAgentBucketName({\n\t\torgBucket: config.bucket,\n\t\tagentId\n\t});\n\treturn createStorage({\n\t\t...config,\n\t\tbucket\n\t});\n}\nfunction createOrgContainerPresign(organization) {\n\treturn createContainerPresignStorage(resolveOrgStorageConfig(organization));\n}\n//#endregion\n//#region src/org-storage/runtime-env.ts\nfunction orgStorageRuntimeEnv(config, containerEnv) {\n\treturn {\n\t\tSTORAGE_ACCESS_KEY_ID: config.accessKeyId,\n\t\tSTORAGE_SECRET_ACCESS_KEY: config.secretAccessKey,\n\t\tSTORAGE_ENDPOINT: containerEnv ? containerPresignEndpointFromEnv(config.endpoint, containerEnv) : config.endpoint,\n\t\tSTORAGE_REGION: config.region,\n\t\tSTORAGE_FORCE_PATH_STYLE: String(config.forcePathStyle),\n\t\tKEYSTROKE_WORKSPACES_BUCKET: config.bucket\n\t};\n}\nfunction orgWorkspacesRuntimeEnv(organization, options) {\n\tif (!hasOrgStorageConfig(organization)) return {};\n\treturn orgStorageRuntimeEnv(resolveOrgStorageConfig(organization), options?.containerEnv);\n}\n//#endregion\n//#region src/org-redis/runtime-env.ts\n/**\n* Per-org Redis env for org machines. Uses the restricted ACL connection string\n* when provisioned; otherwise falls back to the platform admin URL (pre-backfill).\n*/\nfunction orgSchedulerRuntimeEnv(organization, platformEnv = process.env) {\n\tconst orgUrl = organization.redisUrlCiphertext?.trim();\n\tif (orgUrl) {\n\t\tconst result = { REDIS_URL: decryptCredentialPayload(orgUrl) };\n\t\tconst prefix = platformEnv.KEYSTROKE_QUEUE_PREFIX?.trim();\n\t\tif (prefix) result.KEYSTROKE_QUEUE_PREFIX = prefix;\n\t\treturn result;\n\t}\n\tconst adminUrl = platformEnv.UPSTASH_REDIS_URL?.trim() || platformEnv.REDIS_URL?.trim() || void 0;\n\tif (!adminUrl) return {};\n\tconst fallback = { REDIS_URL: adminUrl };\n\tconst prefix = platformEnv.KEYSTROKE_QUEUE_PREFIX?.trim();\n\tif (prefix) fallback.KEYSTROKE_QUEUE_PREFIX = prefix;\n\treturn fallback;\n}\n//#endregion\n//#region src/queries/_internal/organization-scope.ts\nfunction eqOrganizationScope(table) {\n\treturn eq$1(table.organizationId, requireOrganizationScopeId());\n}\nfunction scopedAnd(table, ...conditions) {\n\treturn and$1(eqOrganizationScope(table), ...conditions);\n}\nfunction organizationScopeId() {\n\treturn requireOrganizationScopeId();\n}\n//#endregion\n//#region src/queries/oauth-apps/index.ts\nasync function selectOAuthAppBySlug(slug) {\n\treturn (await getDb().select().from(oauthApps).where(scopedAnd(oauthApps, eq$1(oauthApps.slug, slug))).limit(1))[0];\n}\nasync function selectOAuthAppById(id) {\n\treturn (await getDb().select().from(oauthApps).where(scopedAnd(oauthApps, eq$1(oauthApps.id, id))).limit(1))[0];\n}\nasync function insertOAuthApp(values) {\n\tawait getDb().insert(oauthApps).values({\n\t\t...values,\n\t\torganizationId: organizationScopeId()\n\t});\n}\nasync function updateOAuthAppBySlug(slug, values) {\n\tawait getDb().update(oauthApps).set(values).where(scopedAnd(oauthApps, eq$1(oauthApps.slug, slug)));\n}\n//#endregion\n//#region src/queries/oauth-apps/global.ts\n/** Org-unscoped lookup — used before organization scope is known (e.g. inbound Slack webhooks). */\nasync function listOAuthAppsBySlugUnscoped(slug) {\n\treturn getDb().select().from(oauthApps).where(eq$1(oauthApps.slug, slug));\n}\n//#endregion\n//#region src/queries/oauth-connections/index.ts\nasync function selectOAuthConnectionById(id) {\n\treturn (await getDb().select({ connection: oauthConnections }).from(oauthConnections).innerJoin(oauthApps, eq$1(oauthApps.id, oauthConnections.appId)).where(scopedAnd(oauthApps, eq$1(oauthConnections.id, id))).limit(1))[0]?.connection;\n}\nasync function selectOAuthConnectionsByIds(ids) {\n\tif (ids.length === 0) return [];\n\treturn (await getDb().select({ connection: oauthConnections }).from(oauthConnections).innerJoin(oauthApps, eq$1(oauthApps.id, oauthConnections.appId)).where(scopedAnd(oauthApps, inArray$1(oauthConnections.id, ids)))).map((row) => row.connection);\n}\nasync function selectOAuthConnectionByAppAndExternalId(appId, externalId) {\n\treturn (await getDb().select({ connection: oauthConnections }).from(oauthConnections).innerJoin(oauthApps, eq$1(oauthApps.id, oauthConnections.appId)).where(scopedAnd(oauthApps, eq$1(oauthConnections.appId, appId), eq$1(oauthConnections.externalId, externalId))).limit(1))[0]?.connection;\n}\nasync function listOAuthConnectionsByAppId(appId) {\n\treturn (await getDb().select({ connection: oauthConnections }).from(oauthConnections).innerJoin(oauthApps, eq$1(oauthApps.id, oauthConnections.appId)).where(scopedAnd(oauthApps, eq$1(oauthConnections.appId, appId)))).map((row) => row.connection);\n}\nasync function deleteOAuthConnectionById(id) {\n\tif (!await selectOAuthConnectionById(id)) return false;\n\tawait getDb().delete(oauthConnections).where(eq$1(oauthConnections.id, id));\n\treturn true;\n}\nasync function insertOAuthConnection(values) {\n\tawait getDb().insert(oauthConnections).values(values);\n}\n/** Returns the id of the persisted row: the existing row's id on update, `values.id` on insert. */\nasync function upsertOAuthConnection(values) {\n\tconst existing = await selectOAuthConnectionByAppAndExternalId(values.appId, values.externalId);\n\tif (existing) {\n\t\tawait getDb().update(oauthConnections).set({\n\t\t\taccessTokenCiphertext: values.accessTokenCiphertext,\n\t\t\trefreshTokenCiphertext: values.refreshTokenCiphertext,\n\t\t\taccessTokenExpiresAt: values.accessTokenExpiresAt,\n\t\t\tgrantedScopes: values.grantedScopes && values.grantedScopes.length > 0 ? values.grantedScopes : existing.grantedScopes,\n\t\t\tmetadata: values.metadata,\n\t\t\tupdatedAt: values.updatedAt\n\t\t}).where(eq$1(oauthConnections.id, existing.id));\n\t\treturn existing.id;\n\t}\n\tawait insertOAuthConnection(values);\n\treturn values.id;\n}\n//#endregion\n//#region src/queries/oauth-connections/global.ts\n/** Org-unscoped lookup — resolves a Slack team_id (externalId) to org + connection via oauth_apps.slug. */\nasync function selectOAuthInstallationsByAppSlugAndExternalId(appSlug, externalId) {\n\treturn getDb().select({\n\t\torganizationId: oauthApps.organizationId,\n\t\tconnectionId: oauthConnections.id,\n\t\tappId: oauthApps.id,\n\t\texternalId: oauthConnections.externalId\n\t}).from(oauthConnections).innerJoin(oauthApps, eq$1(oauthApps.id, oauthConnections.appId)).where(and$1(eq$1(oauthApps.slug, appSlug), eq$1(oauthConnections.externalId, externalId)));\n}\n//#endregion\n//#region src/queries/secret-values/index.ts\nasync function selectSecretValue(refKind, refId, field) {\n\treturn (await getDb().select().from(secretValues).where(scopedAnd(secretValues, eq$1(secretValues.refKind, refKind), eq$1(secretValues.refId, refId), eq$1(secretValues.field, field))).limit(1))[0];\n}\nasync function upsertSecretValue(values) {\n\tconst db = getDb();\n\tconst existing = await selectSecretValue(values.refKind, values.refId, values.field);\n\tif (existing) {\n\t\tawait db.update(secretValues).set({\n\t\t\tciphertext: values.ciphertext,\n\t\t\tupdatedAt: values.updatedAt\n\t\t}).where(eq$1(secretValues.id, existing.id));\n\t\treturn;\n\t}\n\tawait db.insert(secretValues).values({\n\t\t...values,\n\t\torganizationId: organizationScopeId()\n\t});\n}\nasync function deleteSecretValuesForRef(refKind, refId) {\n\tawait getDb().delete(secretValues).where(scopedAnd(secretValues, eq$1(secretValues.refKind, refKind), eq$1(secretValues.refId, refId)));\n}\n//#endregion\n//#region src/oauth/app.ts\nfunction metadataMatches(existing, next) {\n\treturn JSON.stringify(existing ?? null) === JSON.stringify(next ?? null);\n}\nfunction oauthAppValuesDiffer(existing, options) {\n\tconst nextSigningSecret = options.signingSecret ?? \"\";\n\treturn existing.clientId !== options.clientId || existing.clientSecret !== options.clientSecret || existing.signingSecret !== nextSigningSecret || !metadataMatches(existing.metadata, options.metadata ?? null);\n}\nfunction encryptOAuthAppValues(options) {\n\treturn {\n\t\tclientIdCiphertext: encryptCredentialPayload(options.clientId),\n\t\tclientSecretCiphertext: encryptCredentialPayload(options.clientSecret),\n\t\tsigningSecretCiphertext: options.signingSecret ? encryptCredentialPayload(options.signingSecret) : null,\n\t\tmetadata: options.metadata ?? null\n\t};\n}\nfunction decryptOAuthAppRow(row) {\n\treturn {\n\t\tid: row.id,\n\t\tprovider: row.provider,\n\t\tslug: row.slug,\n\t\ttokenStrategy: row.tokenStrategy,\n\t\tclientId: decryptCredentialPayload(row.clientIdCiphertext),\n\t\tclientSecret: decryptCredentialPayload(row.clientSecretCiphertext),\n\t\tsigningSecret: row.signingSecretCiphertext ? decryptCredentialPayload(row.signingSecretCiphertext) : \"\",\n\t\tredirectUri: row.redirectUri,\n\t\tmetadata: row.metadata ?? null\n\t};\n}\nasync function getDecryptedOAuthAppBySlug(slug) {\n\tconst row = await selectOAuthAppBySlug(slug);\n\tif (!row) return null;\n\treturn decryptOAuthAppRow(row);\n}\nasync function getDecryptedOAuthAppById(id) {\n\tconst row = await selectOAuthAppById(id);\n\tif (!row) return null;\n\treturn decryptOAuthAppRow(row);\n}\nasync function ensureOAuthApp(options) {\n\tconst existing = await selectOAuthAppBySlug(options.slug);\n\tif (existing) {\n\t\tif (!oauthAppValuesDiffer(decryptOAuthAppRow(existing), options)) return {\n\t\t\tid: existing.id,\n\t\t\tcreated: false,\n\t\t\tupdated: false\n\t\t};\n\t\tawait updateOAuthAppBySlug(options.slug, {\n\t\t\t...encryptOAuthAppValues(options),\n\t\t\tupdatedAt: /* @__PURE__ */ new Date()\n\t\t});\n\t\treturn {\n\t\t\tid: existing.id,\n\t\t\tcreated: false,\n\t\t\tupdated: true\n\t\t};\n\t}\n\tconst now = /* @__PURE__ */ new Date();\n\tconst id = crypto.randomUUID();\n\tawait insertOAuthApp({\n\t\tid,\n\t\tprovider: options.provider,\n\t\tslug: options.slug,\n\t\ttokenStrategy: options.tokenStrategy,\n\t\t...encryptOAuthAppValues(options),\n\t\tredirectUri: null,\n\t\tcreatedAt: now,\n\t\tupdatedAt: now\n\t});\n\treturn {\n\t\tid,\n\t\tcreated: true,\n\t\tupdated: false\n\t};\n}\n//#endregion\n//#region src/oauth/connection.ts\nfunction decryptOAuthConnectionRow(row) {\n\treturn {\n\t\tid: row.id,\n\t\tappId: row.appId,\n\t\texternalId: row.externalId,\n\t\taccessToken: decryptCredentialPayload(row.accessTokenCiphertext),\n\t\trefreshToken: row.refreshTokenCiphertext ? decryptCredentialPayload(row.refreshTokenCiphertext) : null,\n\t\taccessTokenExpiresAt: row.accessTokenExpiresAt ?? null,\n\t\tgrantedScopes: row.grantedScopes ?? null,\n\t\tmetadata: row.metadata ?? null\n\t};\n}\nasync function getDecryptedOAuthConnectionById(id) {\n\tconst row = await selectOAuthConnectionById(id);\n\tif (!row) return null;\n\treturn decryptOAuthConnectionRow(row);\n}\nasync function getDecryptedOAuthConnectionsByAppSlug(appSlug) {\n\tconst app = await selectOAuthAppBySlug(appSlug);\n\tif (!app) return [];\n\treturn (await listOAuthConnectionsByAppId(app.id)).map(decryptOAuthConnectionRow);\n}\nasync function getDecryptedOAuthConnectionByAppSlugAndExternalId(appSlug, externalId) {\n\tconst app = await selectOAuthAppBySlug(appSlug);\n\tif (!app) return null;\n\tconst row = await selectOAuthConnectionByAppAndExternalId(app.id, externalId);\n\tif (!row) return null;\n\treturn decryptOAuthConnectionRow(row);\n}\nasync function saveOAuthConnection(options) {\n\tconst now = /* @__PURE__ */ new Date();\n\treturn upsertOAuthConnection({\n\t\tid: options.connectionId ?? crypto.randomUUID(),\n\t\tappId: options.appId,\n\t\texternalId: options.externalId,\n\t\taccessTokenCiphertext: encryptCredentialPayload(options.accessToken),\n\t\trefreshTokenCiphertext: options.refreshToken ? encryptCredentialPayload(options.refreshToken) : null,\n\t\taccessTokenExpiresAt: options.accessTokenExpiresAt ?? null,\n\t\tgrantedScopes: options.grantedScopes ?? null,\n\t\tmetadata: options.metadata ?? null,\n\t\tconnectedAt: now,\n\t\tupdatedAt: now\n\t});\n}\n//#endregion\n//#region src/oauth/mcp-refresh.ts\nasync function refreshMcpOAuthToken(params) {\n\tconst tokenEndpoint = params.tokenEndpoint?.trim();\n\tif (!tokenEndpoint) throw new Error(\"MCP OAuth refresh requires tokenEndpoint in app metadata\");\n\tconst body = new URLSearchParams({\n\t\tgrant_type: \"refresh_token\",\n\t\trefresh_token: params.refreshToken,\n\t\tclient_id: params.clientId\n\t});\n\tif (params.clientSecret) body.set(\"client_secret\", params.clientSecret);\n\tconst response = await fetch(tokenEndpoint, {\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/x-www-form-urlencoded\",\n\t\t\tAccept: \"application/json\"\n\t\t},\n\t\tbody\n\t});\n\tif (!response.ok) {\n\t\tconst text = await response.text().catch(() => \"\");\n\t\tthrow new Error(`MCP OAuth refresh failed (${response.status}): ${text}`);\n\t}\n\tconst payload = await response.json();\n\treturn {\n\t\taccessToken: payload.access_token,\n\t\trefreshToken: payload.refresh_token,\n\t\taccessTokenExpiresAt: payload.expires_in && payload.expires_in > 0 ? new Date(Date.now() + payload.expires_in * 1e3) : void 0\n\t};\n}\nfunction readMcpTokenEndpoint(metadata) {\n\treturn metadata?.tokenEndpoint?.trim() || void 0;\n}\n//#endregion\n//#region src/oauth/refresh-token.ts\nconst TOKEN_EXPIRY_BUFFER_MS = 6e4;\nfunction oauthClientSecretForRefresh(app) {\n\tif (app.metadata?.tokenEndpointAuthMethod === \"none\") return \"\";\n\treturn app.clientSecret?.trim() ?? \"\";\n}\nfunction accessTokenIsStale(expiresAt) {\n\tif (!expiresAt) return true;\n\treturn expiresAt.getTime() <= Date.now() + TOKEN_EXPIRY_BUFFER_MS;\n}\nasync function resolveOAuthAccessToken(connection, app, tokenRefresh) {\n\tif (app.tokenStrategy === \"installation\" || app.tokenStrategy === \"app_installation\") return connection.accessToken;\n\tif (!accessTokenIsStale(connection.accessTokenExpiresAt)) return connection.accessToken;\n\tif (!connection.refreshToken) {\n\t\tif (!connection.accessTokenExpiresAt) return connection.accessToken;\n\t\tthrow new Error(`OAuth connection \"${connection.id}\" is missing a refresh token.`);\n\t}\n\tconst refresh = tokenRefresh?.get(app.slug) ?? (app.provider === \"mcp\" ? refreshMcpOAuthToken : void 0);\n\tif (!refresh) throw new Error(`OAuth refresh is not registered for app \"${app.slug}\".`);\n\tconst refreshed = await refresh({\n\t\tclientId: app.clientId,\n\t\tclientSecret: oauthClientSecretForRefresh(app),\n\t\trefreshToken: connection.refreshToken,\n\t\ttokenEndpoint: readMcpTokenEndpoint(app.metadata)\n\t});\n\tawait saveOAuthConnection({\n\t\tappId: connection.appId,\n\t\texternalId: connection.externalId,\n\t\taccessToken: refreshed.accessToken,\n\t\trefreshToken: refreshed.refreshToken ?? connection.refreshToken,\n\t\taccessTokenExpiresAt: refreshed.accessTokenExpiresAt,\n\t\tgrantedScopes: connection.grantedScopes ?? void 0,\n\t\tmetadata: connection.metadata ?? void 0,\n\t\tconnectionId: connection.id\n\t});\n\treturn refreshed.accessToken;\n}\n//#endregion\n//#region src/oauth/global-lookup.ts\n/** Signing secret for inbound webhooks before org scope is known (shared managed Slack app). */\nasync function getOAuthAppSigningSecretBySlugGlobal(appSlug) {\n\tconst fromEnv = process.env.SLACK_SIGNING_SECRET?.trim();\n\tif (fromEnv) return fromEnv;\n\tconst apps = await listOAuthAppsBySlugUnscoped(appSlug);\n\tfor (const app of apps) if (app.signingSecretCiphertext) return decryptCredentialPayload(app.signingSecretCiphertext);\n\treturn null;\n}\n/** All orgs connected to a Slack workspace (team_id). */\nasync function listOAuthInstallationsByAppSlugAndExternalId(appSlug, externalId) {\n\treturn (await selectOAuthInstallationsByAppSlugAndExternalId(appSlug, externalId)).map((row) => ({\n\t\torganizationId: row.organizationId,\n\t\tconnectionId: row.connectionId\n\t}));\n}\n/**\n* Bot token for a team from any org's connection (same Slack app + team → same token).\n* Safe to call before organization scope is set (e.g. platform Slack gateway).\n*/\nasync function getGlobalOAuthAccessTokenByAppSlugAndExternalId(appSlug, externalId) {\n\tconst first = (await selectOAuthInstallationsByAppSlugAndExternalId(appSlug, externalId))[0];\n\tif (!first) return null;\n\tconst connection = await runWithOrganizationScope(first.organizationId, () => selectOAuthConnectionById(first.connectionId));\n\tif (!connection) return null;\n\treturn decryptCredentialPayload(connection.accessTokenCiphertext);\n}\n//#endregion\n//#region src/queries/apps/slug.ts\nasync function isOrgAppSlugTaken(orgSlug, slugPart) {\n\tconst qualified = qualifyOrgSlug(orgSlug, slugPart);\n\treturn (await getDb().select({ id: apps.id }).from(apps).where(eq$1(apps.slug, qualified)).limit(1)).length > 0;\n}\nasync function resolveAvailableOrgAppSlug(orgSlug, nameOrSlug) {\n\tconst base = slugifyAppName(nameOrSlug);\n\tif (!await isOrgAppSlugTaken(orgSlug, base)) return base;\n\tfor (let suffix = 2; suffix < 1e4; suffix += 1) {\n\t\tconst candidate = AppSlugSchema.parse(`${base}-${suffix}`);\n\t\tif (!await isOrgAppSlugTaken(orgSlug, candidate)) return candidate;\n\t}\n\tthrow new Error(\"Unable to allocate a unique app slug\");\n}\nasync function checkOrgAppSlugAvailability(orgSlug, slugPart) {\n\tconst normalized = slugPart.trim().toLowerCase();\n\tconst format = AppSlugSchema.safeParse(normalized);\n\tif (!format.success) return {\n\t\tslug: normalized,\n\t\tavailable: false,\n\t\treason: \"invalid\"\n\t};\n\tconst parsed = format.data;\n\tif (await isOrgAppSlugTaken(orgSlug, parsed)) return {\n\t\tslug: parsed,\n\t\tavailable: false,\n\t\treason: \"taken\",\n\t\tsuggestion: await resolveAvailableOrgAppSlug(orgSlug, parsed)\n\t};\n\treturn {\n\t\tslug: parsed,\n\t\tavailable: true\n\t};\n}\n//#endregion\n//#region src/queries/apps/index.ts\nvar OrgAppSlugTakenError = class extends Error {\n\tslug;\n\tconstructor(slug) {\n\t\tsuper(`App slug already exists: ${slug}`);\n\t\tthis.name = \"OrgAppSlugTakenError\";\n\t\tthis.slug = slug;\n\t}\n};\nasync function selectAppBySlug(slug) {\n\treturn (await getDb().select().from(apps).where(eq$1(apps.slug, slug)).limit(1))[0];\n}\nasync function listOfficialApps() {\n\treturn getDb().select().from(apps).where(isNull$1(apps.organizationId));\n}\nasync function listAppsForOrganization(organizationId) {\n\treturn getDb().select().from(apps).where(or(isNull$1(apps.organizationId), eq$1(apps.organizationId, organizationId)));\n}\nasync function selectAppForOrganization(organizationId, slug) {\n\tconst row = await selectAppBySlug(slug);\n\tif (!row) return;\n\tif (row.organizationId === null || row.organizationId === organizationId) return row;\n}\nasync function createOrgApp(values) {\n\tconst db = getDb();\n\tconst slug = qualifyOrgSlug(values.orgSlug, values.slug);\n\tif (await selectAppBySlug(slug)) throw new OrgAppSlugTakenError(slug);\n\tconst now = /* @__PURE__ */ new Date();\n\treturn (await db.insert(apps).values({\n\t\tid: crypto.randomUUID(),\n\t\torganizationId: values.organizationId,\n\t\tslug,\n\t\tname: values.name,\n\t\tdescription: values.description,\n\t\tcategory: \"Custom\",\n\t\tlogo: null,\n\t\tauthKind: values.authKind,\n\t\toauthScopes: values.oauthScopes ?? [],\n\t\tcredentialFields: values.credentialFields ?? {},\n\t\tcredentialScheme: values.credentialScheme ?? null,\n\t\turl: values.url ?? null,\n\t\tsource: values.source,\n\t\tcreatedAt: now,\n\t\tupdatedAt: now\n\t}).returning())[0];\n}\nasync function upsertOfficialApp(values) {\n\tconst db = getDb();\n\tconst now = /* @__PURE__ */ new Date();\n\tif (await selectAppBySlug(values.slug)) return (await db.update(apps).set({\n\t\tname: values.name,\n\t\tdescription: values.description,\n\t\tcategory: values.category,\n\t\t...values.logo !== void 0 ? { logo: values.logo } : {},\n\t\tauthKind: values.authKind,\n\t\toauthScopes: values.oauthScopes,\n\t\tsource: values.source,\n\t\t...values.credentialFields !== void 0 ? { credentialFields: values.credentialFields } : {},\n\t\t...values.credentialScheme !== void 0 ? { credentialScheme: values.credentialScheme } : {},\n\t\tupdatedAt: now\n\t}).where(eq$1(apps.slug, values.slug)).returning())[0];\n\treturn (await db.insert(apps).values({\n\t\tid: crypto.randomUUID(),\n\t\torganizationId: null,\n\t\tcredentialFields: values.credentialFields ?? {},\n\t\tcredentialScheme: values.credentialScheme ?? null,\n\t\t...values,\n\t\tcreatedAt: now,\n\t\tupdatedAt: now\n\t}).returning())[0];\n}\nfunction hasCredentialFieldTemplate(row) {\n\treturn Object.keys(row.credentialFields).length > 0;\n}\nasync function selectOrgAppBySlug(organizationId, slug) {\n\treturn (await getDb().select().from(apps).where(and$1(eq$1(apps.slug, slug), eq$1(apps.organizationId, organizationId))).limit(1))[0];\n}\n//#endregion\n//#region src/apps/seed.ts\n/** Upsert official apps from a hosted manifest. Idempotent — safe to run on a schedule. */\nasync function seedOfficialApps(entries) {\n\tfor (const entry of entries) await upsertOfficialApp({\n\t\tslug: entry.slug,\n\t\tname: entry.name,\n\t\tdescription: entry.description,\n\t\tcategory: entry.category,\n\t\t...entry.logo !== void 0 ? { logo: entry.logo } : {},\n\t\tauthKind: entry.authKind,\n\t\toauthScopes: entry.oauthScopes,\n\t\tsource: entry.source\n\t});\n}\n//#endregion\nexport { CannotModifyOwnerError, DEFAULT_PLATFORM_DATABASE_URL, DEFAULT_STANDALONE_ORGANIZATION_ID, DEFAULT_STANDALONE_ORGANIZATION_NAME, DEFAULT_STANDALONE_ORGANIZATION_SLUG, DEFAULT_STANDALONE_PROJECT_NAME, DEFAULT_STANDALONE_PROJECT_SLUG, LastOwnerError, ORG_PLATFORM_API_KEY_CONFIG_ID, OrgAppSlugTakenError, OrgPlatformApiKeyNotFoundError, OrganizationInvitationExpiredError, OrganizationInvitationForbiddenError, OrganizationInvitationNotFoundError, OrganizationMemberNotFoundError, OrganizationSlugTakenError, ProjectMemberNotFoundError, ProjectSlugTakenError, TENANT_RUNTIME_ROLE, WEBHOOK_API_KEY_CONFIG_ID, acceptInvitation, addUserToDefaultOrgProjectInTransaction, applyLedgerCredit, applyLedgerDebit, apps, backfillProjectUsers, bindOrganizationScope, buildDefaultOrgProjectName, buildOrgDatabaseUrl, buildOrgRedisUrl, buildTenantRuntimeDatabaseUrl, checkOrgAppSlugAvailability, checkOrganizationSlugAvailability, checkProjectSlugAvailability, claimAutoTopupPendingIntent, clearAutoTopupPendingIntent, closeDatabase, completeProjectArtifact, countActiveMembersForOrganization, countActiveProjectsForOrganization, createConnection, createOrgAgentStorageClient, createOrgApp, createOrgContainerPresign, createOrgPlatformApiKey, createOrgStorageClient, createOrganizationForUser, createPgConnection, createProjectForOrganization, createPublishedFormToken, createSqliteConnection, declineInvitation, decryptCredentialPayload, deleteManagedServiceCredential, deleteOAuthConnectionById, deleteProjectForOrganization, deleteSecretValuesForRef, deprovisionOrgDatabase, deprovisionOrgRedis, encryptCredentialPayload, ensureDefaultOrgProjectInTransaction, ensureDefaultOrganization, ensureDefaultOrganizationAndProject, ensureDefaultProject, ensureOAuthApp, ensureOrgPgBossGrants, ensureOrgPlatformApiKey, ensureProjectPgBossGrants, ensureTenantRuntimeRole, ensureWebhookApiKeyForRoute, ensureWebhookApiKeys, findOrCreateUserByEmail, getBillingWallet, getDatabaseHandle, getDecryptedOAuthAppById, getDecryptedOAuthAppBySlug, getDecryptedOAuthConnectionByAppSlugAndExternalId, getDecryptedOAuthConnectionById, getDecryptedOAuthConnectionsByAppSlug, getGlobalOAuthAccessTokenByAppSlugAndExternalId, getManagedServiceCredential, getOAuthAppSigningSecretBySlugGlobal, getOrCreateBillingWallet, getOrCreateOrganizationBilling, getOrganizationScopeId, getWorkspaceContext, hasCredentialFieldTemplate, initDatabase, insertBillingEvent, insertManagedServiceCredential, insertOAuthApp, insertProjectArtifact, insertUsageEventsAndSettle, inviteOrganizationMembers, inviteProjectMembers, isDatabaseInitialized, isOrganizationStorageBucketInUse, isStandaloneMode, listAppsForOrganization, listBillingLedgerEntries, listManagedServiceCredentialsForOrganization, listOAuthAppsBySlugUnscoped, listOAuthConnectionsByAppId, listOAuthInstallationsByAppSlugAndExternalId, listOfficialApps, listOrgPlatformApiKeysForOrganization, listOrgPlatformApiKeysForUser, listUsageEventsForRuns, listWebhookApiKeys, listWebhookApiKeysForProject, listWebhookApiKeysForProjects, loadOrgPlatformApiKeyUser, mapOrgPlatformApiKeyCreator, mapOrgPlatformApiKeyCreatorOrDeleted, mcpProjectApiKeyName, normalizeUserEmail, orgDbRoleName, orgDbSchemaName, orgRedisAclSetUserArgs, orgRedisQueueSegment, orgRedisUsername, orgSchedulerRuntimeEnv, orgWorkspacesRuntimeEnv, organizationInvitationStatuses, organizationRowToSidebarBranding, organizationUserRoles, projectArtifactStatuses, projectStatuses, promoteProjectArtifact, provisionOrgDatabase, provisionOrgRedis, reconcileWalletAgainstLedger, removeOrganizationMember, removeProjectMember, requireOrganizationScopeId, requireWorkspaceContext, resetWalletPlanPeriod, resolveMigrationsFolder, resolveNewOrganizationIdentity, resolveOAuthAccessToken, resolveOrgDatabaseUrl, resolveOrgProjectDatabaseOptions, resolveOrgRuntimeDatabase, resolveOrgStorageConfig, resolvePlatformDatabaseUrl, resolvePlatformPostgresConfig, revokeOrgPlatformApiKey, rotatePublishedFormToken, runMigrations, runWithOrganizationScope, runWithStandaloneScope, runWithWorkspaceContext, saveOAuthConnection, seedOfficialApps, selectActiveArtifactManifestForProject, selectActiveArtifactManifestsByOrganizationId, selectActiveArtifactSourceManifestForProject, selectActiveOrganizationIds, selectActiveProjectArtifactForProject, selectAppBySlug, selectAppForOrganization, selectEnabledPublishedFormByToken, selectLastDeploymentAtByProject, selectLatestBillingEventAt, selectManagedServiceCredentialById, selectOAuthAppById, selectOAuthAppBySlug, selectOAuthConnectionByAppAndExternalId, selectOAuthConnectionById, selectOAuthConnectionsByIds, selectOAuthInstallationsByAppSlugAndExternalId, selectOrgAppBySlug, selectOrgPlatformApiKeyForOrganization, selectOrganizationBillingByStripeCustomerId, selectOrganizationById, selectOrganizationBySlug, selectOrganizationMembers, selectOrganizationUsersByUserId, selectPendingInvitationsForUser, selectProjectArtifactById, selectProjectArtifactForProject, selectProjectArtifactSourceManifestForProject, selectProjectById, selectProjectDeployments, selectProjectForOrganization, selectProjectForOrganizationBySlug, selectProjectIdsForUser, selectProjectMembers, selectProjectsByOrganizationId, selectPublishedFormForWorkflow, selectSecretValue, selectUserByEmail, selectUserById, selectUserByNormalizedEmail, selectUserOrganization, selectUserOrganizationMembership, selectUserOrganizations, selectUserProjectMembership, selectUsersByIds, summarizeUsageByMeter, summarizeUsageForRuns, unpublishFormForWorkflow, updateManagedServiceCredentialValue, updateOAuthAppBySlug, updateOrganizationActive, updateOrganizationBilling, updateOrganizationFailed, updateOrganizationMemberRole, updateOrganizationName, updateOrganizationSidebarBranding, updateOrganizationSlug, updateProjectActive, updateProjectArtifactManifest, updateProjectArtifactSourceManifest, updateProjectFailed, updateProjectForOrganization, updateProjectMemberRole, updateProjectSettings, updateUserById, upsertOAuthConnection, upsertOfficialApp, upsertOrganizationClaimSecret, upsertProjectMember, upsertPublishedForm, upsertSecretValue, verifyOrgPlatformApiKeySecret, verifyWebhookApiKeyForRoute, webhookApiKeyName, webhookEndpointSuffix };\n\n//# sourceMappingURL=index.mjs.map","import { clearCredentialInstanceDefaults, deleteCredentialAssignmentById, deleteCredentialInstanceById, ensureKeystrokeCredentialInstance, ensureOAuthCredentialInstance as ensureOAuthCredentialInstance$1, getProjectScopeId, getServerTenantScopeId, listCredentialAssignmentsByTarget, listCredentialInstancesByScope, listRecentWorkflowStepConsumers, selectCredentialAssignmentById, selectCredentialInstanceById, selectCredentialInstancesByIds, selectCredentialInstancesForScope, selectCredentialInstancesForScopes, touchCredentialInstanceLastUsed, upsertCredentialAssignment, upsertCredentialInstance } from \"@keystrokehq/database\";\nimport { ensureOAuthApp as ensureOAuthApp$1, getDecryptedOAuthAppById as getDecryptedOAuthAppById$1, getDecryptedOAuthAppBySlug, getDecryptedOAuthConnectionByAppSlugAndExternalId, getDecryptedOAuthConnectionById as getDecryptedOAuthConnectionById$1, getDecryptedOAuthConnectionsByAppSlug, resolveOAuthAccessToken, saveOAuthConnection as saveOAuthConnection$1 } from \"@keystrokehq/platform-database\";\n//#region src/store/credential-assignments.ts\nfunction normalizeRow(row) {\n\tconst { projectId: _projectId, ...rest } = row;\n\treturn rest;\n}\nasync function listCredentialAssignmentsByTarget$1(options) {\n\treturn (await listCredentialAssignmentsByTarget(options)).map(normalizeRow);\n}\nasync function selectCredentialAssignmentById$1(id) {\n\tconst row = await selectCredentialAssignmentById(id);\n\treturn row ? normalizeRow(row) : void 0;\n}\nasync function upsertCredentialAssignment$1(values) {\n\treturn normalizeRow(await upsertCredentialAssignment(values));\n}\nasync function deleteCredentialAssignmentById$1(id) {\n\treturn deleteCredentialAssignmentById(id);\n}\nasync function listRecentWorkflowStepConsumers$1(workflowSlug, runLimit) {\n\treturn listRecentWorkflowStepConsumers(workflowSlug, runLimit);\n}\n//#endregion\n//#region src/store/credential-instances.ts\nfunction normalizeLocalRow(row) {\n\tconst { projectId: _projectId, ...rest } = row;\n\treturn rest;\n}\nasync function selectCredentialInstanceById$1(id) {\n\tconst row = await selectCredentialInstanceById(id);\n\treturn row ? normalizeLocalRow(row) : void 0;\n}\nasync function selectCredentialInstancesForScope$1(appSlug, scopeType, scopeId) {\n\treturn (await selectCredentialInstancesForScope(appSlug, scopeType, scopeId)).map(normalizeLocalRow);\n}\nasync function selectCredentialInstancesForScopes$1(scopes) {\n\treturn (await selectCredentialInstancesForScopes(scopes)).map(normalizeLocalRow);\n}\nasync function selectCredentialInstancesByIds$1(ids) {\n\treturn (await selectCredentialInstancesByIds(ids)).map(normalizeLocalRow);\n}\nasync function listCredentialInstancesByScope$1(options) {\n\treturn (await listCredentialInstancesByScope(options)).map(normalizeLocalRow);\n}\nasync function upsertCredentialInstance$1(values) {\n\tawait upsertCredentialInstance(values);\n}\nasync function deleteCredentialInstanceById$1(id) {\n\treturn deleteCredentialInstanceById(id);\n}\nasync function touchCredentialInstanceLastUsed$1(id) {\n\tawait touchCredentialInstanceLastUsed(id);\n}\nasync function clearCredentialInstanceDefaults$1(options) {\n\tawait clearCredentialInstanceDefaults(options);\n}\nasync function listCredentialInstancesForAssignment(options) {\n\tconst tenantScopeId = getServerTenantScopeId();\n\tconst projectId = getProjectScopeId();\n\tconst rows = [];\n\tconst appendScope = async (scopeType, scopeId) => {\n\t\trows.push(...await listCredentialInstancesByScope$1({\n\t\t\t...options.appSlug ? { appSlug: options.appSlug } : {},\n\t\t\tscopeType,\n\t\t\tscopeId\n\t\t}));\n\t};\n\tif (options.appSlug) {\n\t\tawait appendScope(\"organization\", tenantScopeId);\n\t\tawait appendScope(\"project\", projectId);\n\t\tif (options.userId) await appendScope(\"user\", options.userId);\n\t\treturn rows;\n\t}\n\tawait appendScope(\"organization\", tenantScopeId);\n\tawait appendScope(\"project\", projectId);\n\tif (options.userId) await appendScope(\"user\", options.userId);\n\treturn rows;\n}\n//#endregion\n//#region src/store/oauth.ts\nasync function resolveOAuthAccessTokenForStore(connection, app, tokenRefresh) {\n\treturn resolveOAuthAccessToken(connection, app, tokenRefresh);\n}\n//#endregion\nexport { listRecentWorkflowStepConsumers$1 as C, listCredentialAssignmentsByTarget$1 as S, upsertCredentialAssignment$1 as T, selectCredentialInstancesForScope$1 as _, getDecryptedOAuthAppBySlug as a, upsertCredentialInstance$1 as b, getDecryptedOAuthConnectionsByAppSlug as c, clearCredentialInstanceDefaults$1 as d, deleteCredentialInstanceById$1 as f, selectCredentialInstancesByIds$1 as g, selectCredentialInstanceById$1 as h, getDecryptedOAuthAppById$1 as i, resolveOAuthAccessTokenForStore as l, listCredentialInstancesForAssignment as m, ensureOAuthApp$1 as n, getDecryptedOAuthConnectionByAppSlugAndExternalId as o, listCredentialInstancesByScope$1 as p, ensureOAuthCredentialInstance$1 as r, getDecryptedOAuthConnectionById$1 as s, ensureKeystrokeCredentialInstance as t, saveOAuthConnection$1 as u, selectCredentialInstancesForScopes$1 as v, selectCredentialAssignmentById$1 as w, deleteCredentialAssignmentById$1 as x, touchCredentialInstanceLastUsed$1 as y };\n\n//# sourceMappingURL=store-C6DRzb2o.mjs.map","import { deriveCredentialInstanceSlug } from \"@keystrokehq/shared\";\nimport { clearCredentialInstanceDefaults, encryptCredentialPayload, selectCredentialInstancesForScope, upsertCredentialInstance } from \"@keystrokehq/database\";\nimport { deleteManagedServiceCredential as deleteManagedServiceCredential$1, deleteSecretValuesForRef, getManagedServiceCredential, getOrganizationScopeId, insertManagedServiceCredential, selectSecretValue, updateManagedServiceCredentialValue, upsertSecretValue } from \"@keystrokehq/platform-database\";\nimport { createCipheriv, createDecipheriv, createHash, randomBytes } from \"node:crypto\";\n//#region src/crypto.ts\nconst ALGORITHM = \"aes-256-gcm\";\nconst IV_LENGTH = 12;\nfunction resolveEncryptionKey() {\n\tconst secret = process.env.PLATFORM_SECRETS_ENCRYPTION_KEY?.trim() ?? process.env.CREDENTIALS_ENCRYPTION_KEY?.trim();\n\tif (!secret) throw new Error(\"CREDENTIALS_ENCRYPTION_KEY is required\");\n\treturn createHash(\"sha256\").update(secret).digest();\n}\nfunction encryptSecretPayload(plaintext) {\n\tconst iv = randomBytes(IV_LENGTH);\n\tconst cipher = createCipheriv(ALGORITHM, resolveEncryptionKey(), iv);\n\tconst encrypted = Buffer.concat([cipher.update(plaintext, \"utf8\"), cipher.final()]);\n\tconst tag = cipher.getAuthTag();\n\treturn Buffer.concat([\n\t\tiv,\n\t\ttag,\n\t\tencrypted\n\t]).toString(\"base64\");\n}\nfunction decryptSecretPayload(ciphertext) {\n\tconst buffer = Buffer.from(ciphertext, \"base64\");\n\tconst iv = buffer.subarray(0, IV_LENGTH);\n\tconst tag = buffer.subarray(IV_LENGTH, 28);\n\tconst encrypted = buffer.subarray(28);\n\tconst decipher = createDecipheriv(ALGORITHM, resolveEncryptionKey(), iv);\n\tdecipher.setAuthTag(tag);\n\treturn Buffer.concat([decipher.update(encrypted), decipher.final()]).toString(\"utf8\");\n}\n//#endregion\n//#region src/store.ts\nfunction usePlatformStore() {\n\treturn getOrganizationScopeId() !== void 0;\n}\nfunction assertOrganizationScope() {\n\tif (!usePlatformStore()) throw new Error(\"Secret store requires organization scope\");\n}\nfunction createSecretStore() {\n\treturn {\n\t\tasync get(ref) {\n\t\t\tassertOrganizationScope();\n\t\t\tconst row = await selectSecretValue(ref.kind, ref.id, ref.field);\n\t\t\tif (!row) return null;\n\t\t\treturn decryptSecretPayload(row.ciphertext);\n\t\t},\n\t\tasync set(ref, plaintext) {\n\t\t\tassertOrganizationScope();\n\t\t\tconst now = /* @__PURE__ */ new Date();\n\t\t\tconst ciphertext = encryptSecretPayload(plaintext);\n\t\t\tawait upsertSecretValue({\n\t\t\t\tid: crypto.randomUUID(),\n\t\t\t\trefKind: ref.kind,\n\t\t\t\trefId: ref.id,\n\t\t\t\tfield: ref.field,\n\t\t\t\tciphertext,\n\t\t\t\tcreatedAt: now,\n\t\t\t\tupdatedAt: now\n\t\t\t});\n\t\t},\n\t\tasync deleteRef(kind, id) {\n\t\t\tassertOrganizationScope();\n\t\t\tawait deleteSecretValuesForRef(kind, id);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/credential-instance.ts\nasync function setCredentialInstanceSecret(options) {\n\tconst now = /* @__PURE__ */ new Date();\n\tconst siblings = await selectCredentialInstancesForScope(options.key, options.scopeType, options.scopeId);\n\tconst isDefault = options.isDefault ?? siblings.length === 0;\n\tconst name = options.name ?? options.label ?? null;\n\tconst slug = options.slug ?? deriveCredentialInstanceSlug({\n\t\tappSlug: options.key,\n\t\tname,\n\t\ttakenSlugs: siblings.map((row) => row.slug)\n\t});\n\tif (isDefault) await clearCredentialInstanceDefaults({\n\t\tappSlug: options.key,\n\t\tscopeType: options.scopeType,\n\t\tscopeId: options.scopeId,\n\t\texceptId: options.id\n\t});\n\tif (getOrganizationScopeId() !== void 0) {\n\t\tawait upsertCredentialInstance({\n\t\t\tid: options.id,\n\t\t\tappSlug: options.key,\n\t\t\tslug,\n\t\t\tname,\n\t\t\tscopeType: options.scopeType,\n\t\t\tscopeId: options.scopeId,\n\t\t\tlabel: name,\n\t\t\tisDefault,\n\t\t\tauthKind: \"api_key\",\n\t\t\tciphertext: null,\n\t\t\tconnectionId: null,\n\t\t\tcreatedAt: now,\n\t\t\tupdatedAt: now\n\t\t});\n\t\tawait createSecretStore().set({\n\t\t\tkind: \"credential_instance\",\n\t\t\tid: options.id,\n\t\t\tfield: \"payload\"\n\t\t}, JSON.stringify(options.value));\n\t\treturn;\n\t}\n\tawait upsertCredentialInstance({\n\t\tid: options.id,\n\t\tappSlug: options.key,\n\t\tslug,\n\t\tname,\n\t\tscopeType: options.scopeType,\n\t\tscopeId: options.scopeId,\n\t\tlabel: name,\n\t\tisDefault,\n\t\tauthKind: \"api_key\",\n\t\tciphertext: encryptCredentialPayload(JSON.stringify(options.value)),\n\t\tconnectionId: null,\n\t\tcreatedAt: now,\n\t\tupdatedAt: now\n\t});\n}\nasync function readCredentialInstanceSecret(instanceId) {\n\tif (getOrganizationScopeId() === void 0) return null;\n\treturn createSecretStore().get({\n\t\tkind: \"credential_instance\",\n\t\tid: instanceId,\n\t\tfield: \"payload\"\n\t});\n}\nasync function deleteCredentialInstanceSecret(instanceId) {\n\tif (getOrganizationScopeId() === void 0) return;\n\tawait createSecretStore().deleteRef(\"credential_instance\", instanceId);\n}\n//#endregion\n//#region src/managed-service-credentials.ts\nfunction keyPreviewFromSecret(secret) {\n\treturn `******${secret.slice(-4)}`;\n}\nfunction encryptManagedServiceCredentialValue(value) {\n\treturn encryptSecretPayload(JSON.stringify(value));\n}\nfunction decryptManagedServiceCredentialValue(ciphertext) {\n\tconst parsed = JSON.parse(decryptSecretPayload(ciphertext));\n\tif (typeof parsed.apiKey !== \"string\" || parsed.apiKey.length === 0) throw new Error(\"Invalid managed service credential payload\");\n\treturn { apiKey: parsed.apiKey };\n}\nasync function setManagedServiceCredential(options) {\n\tconst now = /* @__PURE__ */ new Date();\n\tconst valueCiphertext = encryptManagedServiceCredentialValue({ apiKey: options.apiKey });\n\tconst keyPreview = keyPreviewFromSecret(options.apiKey);\n\tconst existing = await getManagedServiceCredential(options.organizationId, options.kind, options.provider);\n\tif (existing) {\n\t\tawait updateManagedServiceCredentialValue(existing.id, {\n\t\t\tvalueCiphertext,\n\t\t\tkeyPreview,\n\t\t\tupdatedAt: now\n\t\t});\n\t\treturn {\n\t\t\tid: existing.id,\n\t\t\tcreated: false\n\t\t};\n\t}\n\tconst id = crypto.randomUUID();\n\tawait insertManagedServiceCredential({\n\t\tid,\n\t\torganizationId: options.organizationId,\n\t\tkind: options.kind,\n\t\tprovider: options.provider,\n\t\tvalueCiphertext,\n\t\tkeyPreview,\n\t\tcreatedByUserId: options.createdByUserId,\n\t\tcreatedAt: now,\n\t\tupdatedAt: now\n\t});\n\treturn {\n\t\tid,\n\t\tcreated: true\n\t};\n}\nasync function readManagedServiceCredentialValue(organizationId, kind, provider) {\n\tconst row = await getManagedServiceCredential(organizationId, kind, provider);\n\tif (!row) return;\n\ttry {\n\t\treturn decryptManagedServiceCredentialValue(row.valueCiphertext);\n\t} catch {\n\t\treturn;\n\t}\n}\nasync function deleteManagedServiceCredential(id) {\n\tawait deleteManagedServiceCredential$1(id);\n}\n//#endregion\nexport { createSecretStore, decryptSecretPayload, deleteCredentialInstanceSecret, deleteManagedServiceCredential, encryptSecretPayload, readCredentialInstanceSecret, readManagedServiceCredentialValue, setCredentialInstanceSecret, setManagedServiceCredential };\n\n//# sourceMappingURL=index.mjs.map","let crypto;\ncrypto =\n globalThis.crypto?.webcrypto ?? // Node.js [18-16] REPL\n globalThis.crypto ?? // Node.js >18\n import(\"node:crypto\").then(m => m.webcrypto); // Node.js <18 Non-REPL\n/**\n * Creates an array of length `size` of random bytes\n * @param size\n * @returns Array of random ints (0 to 255)\n */\nasync function getRandomValues(size) {\n return (await crypto).getRandomValues(new Uint8Array(size));\n}\n/** Generate cryptographically strong random string\n * @param size The desired length of the string\n * @returns The random string\n */\nasync function random(size) {\n const mask = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~\";\n const evenDistCutoff = Math.pow(2, 8) - Math.pow(2, 8) % mask.length;\n let result = \"\";\n while (result.length < size) {\n const randomBytes = await getRandomValues(size - result.length);\n for (const randomByte of randomBytes) {\n if (randomByte < evenDistCutoff) {\n result += mask[randomByte % mask.length];\n }\n }\n }\n return result;\n}\n/** Generate a PKCE challenge verifier\n * @param length Length of the verifier\n * @returns A random verifier `length` characters long\n */\nasync function generateVerifier(length) {\n return await random(length);\n}\n/** Generate a PKCE code challenge from a code verifier\n * @param code_verifier\n * @returns The base64 url encoded code challenge\n */\nexport async function generateChallenge(code_verifier) {\n const buffer = await (await crypto).subtle.digest(\"SHA-256\", new TextEncoder().encode(code_verifier));\n // Generate base64url string\n // btoa is deprecated in Node.js but is used here for web browser compatibility\n // (which has no good replacement yet, see also https://github.com/whatwg/html/issues/6811)\n return btoa(String.fromCharCode(...new Uint8Array(buffer)))\n .replace(/\\//g, '_')\n .replace(/\\+/g, '-')\n .replace(/=/g, '');\n}\n/** Generate a PKCE challenge pair\n * @param length Length of the verifer (between 43-128). Defaults to 43.\n * @returns PKCE challenge pair\n */\nexport default async function pkceChallenge(length) {\n if (!length)\n length = 43;\n if (length < 43 || length > 128) {\n throw `Expected a length between 43 and 128. Received ${length}.`;\n }\n const verifier = await generateVerifier(length);\n const challenge = await generateChallenge(verifier);\n return {\n code_verifier: verifier,\n code_challenge: challenge,\n };\n}\n/** Verify that a code_verifier produces the expected code challenge\n * @param code_verifier\n * @param expectedChallenge The code challenge to verify\n * @returns True if challenges are equal. False otherwise.\n */\nexport async function verifyChallenge(code_verifier, expectedChallenge) {\n const actualChallenge = await generateChallenge(code_verifier);\n return actualChallenge === expectedChallenge;\n}\n","// src/tool/mcp-client.ts\nimport {\n asSchema,\n dynamicTool,\n jsonSchema,\n safeParseJSON,\n safeValidateTypes,\n tool\n} from \"@ai-sdk/provider-utils\";\n\n// src/error/mcp-client-error.ts\nimport { AISDKError } from \"@ai-sdk/provider\";\nvar name = \"AI_MCPClientError\";\nvar marker = `vercel.ai.error.${name}`;\nvar symbol = Symbol.for(marker);\nvar _a, _b;\nvar MCPClientError = class extends (_b = AISDKError, _a = symbol, _b) {\n constructor({\n name: name3 = \"MCPClientError\",\n message,\n cause,\n data,\n code,\n statusCode,\n url,\n responseBody\n }) {\n super({ name: name3, message, cause });\n this[_a] = true;\n this.data = data;\n this.code = code;\n this.statusCode = statusCode;\n this.url = url;\n this.responseBody = responseBody;\n }\n static isInstance(error) {\n return AISDKError.hasMarker(error, marker);\n }\n};\n\n// src/tool/mcp-sse-transport.ts\nimport {\n EventSourceParserStream,\n withUserAgentSuffix,\n getRuntimeEnvironmentUserAgent\n} from \"@ai-sdk/provider-utils\";\n\n// src/tool/json-rpc-message.ts\nimport { parseJSON } from \"@ai-sdk/provider-utils\";\nimport { z as z2 } from \"zod/v4\";\n\n// src/tool/types.ts\nimport { z } from \"zod/v4\";\nvar LATEST_PROTOCOL_VERSION = \"2025-11-25\";\nvar SUPPORTED_PROTOCOL_VERSIONS = [\n LATEST_PROTOCOL_VERSION,\n \"2025-06-18\",\n \"2025-03-26\",\n \"2024-11-05\"\n];\nvar ToolMetaSchema = z.optional(z.record(z.string(), z.unknown()));\nvar ClientOrServerImplementationSchema = z.looseObject({\n name: z.string(),\n version: z.string(),\n title: z.optional(z.string())\n});\nvar BaseParamsSchema = z.looseObject({\n _meta: z.optional(z.object({}).loose())\n});\nvar ResultSchema = BaseParamsSchema;\nvar RequestSchema = z.object({\n method: z.string(),\n params: z.optional(BaseParamsSchema)\n});\nvar ElicitationCapabilitySchema = z.object({\n applyDefaults: z.optional(z.boolean())\n}).loose();\nvar ServerCapabilitiesSchema = z.looseObject({\n experimental: z.optional(z.object({}).loose()),\n logging: z.optional(z.object({}).loose()),\n completions: z.optional(z.object({}).loose()),\n prompts: z.optional(\n z.looseObject({\n listChanged: z.optional(z.boolean())\n })\n ),\n resources: z.optional(\n z.looseObject({\n subscribe: z.optional(z.boolean()),\n listChanged: z.optional(z.boolean())\n })\n ),\n tools: z.optional(\n z.looseObject({\n listChanged: z.optional(z.boolean())\n })\n ),\n elicitation: z.optional(ElicitationCapabilitySchema)\n});\nvar ClientCapabilitiesSchema = z.object({\n elicitation: z.optional(ElicitationCapabilitySchema)\n}).loose();\nvar InitializeResultSchema = ResultSchema.extend({\n protocolVersion: z.string(),\n capabilities: ServerCapabilitiesSchema,\n serverInfo: ClientOrServerImplementationSchema,\n instructions: z.optional(z.string())\n});\nvar PaginatedResultSchema = ResultSchema.extend({\n nextCursor: z.optional(z.string())\n});\nvar ToolSchema = z.object({\n name: z.string(),\n /**\n * @see https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool\n */\n title: z.optional(z.string()),\n description: z.optional(z.string()),\n inputSchema: z.object({\n type: z.literal(\"object\"),\n properties: z.optional(z.object({}).loose())\n }).loose(),\n /**\n * @see https://modelcontextprotocol.io/specification/2025-06-18/server/tools#output-schema\n */\n outputSchema: z.optional(z.object({}).loose()),\n annotations: z.optional(\n z.object({\n title: z.optional(z.string())\n }).loose()\n ),\n _meta: ToolMetaSchema\n}).loose();\nvar ListToolsResultSchema = PaginatedResultSchema.extend({\n tools: z.array(ToolSchema)\n});\nvar TextContentSchema = z.object({\n type: z.literal(\"text\"),\n text: z.string()\n}).loose();\nvar ImageContentSchema = z.object({\n type: z.literal(\"image\"),\n data: z.base64(),\n mimeType: z.string()\n}).loose();\nvar ResourceSchema = z.object({\n uri: z.string(),\n name: z.string(),\n title: z.optional(z.string()),\n description: z.optional(z.string()),\n mimeType: z.optional(z.string()),\n size: z.optional(z.number())\n}).loose();\nvar ListResourcesResultSchema = PaginatedResultSchema.extend({\n resources: z.array(ResourceSchema)\n});\nvar ResourceContentsSchema = z.object({\n /**\n * The URI of this resource.\n */\n uri: z.string(),\n /**\n * Optional display name of the resource content.\n */\n name: z.optional(z.string()),\n /**\n * Optional human readable title.\n */\n title: z.optional(z.string()),\n /**\n * The MIME type of this resource, if known.\n */\n mimeType: z.optional(z.string())\n}).loose();\nvar TextResourceContentsSchema = ResourceContentsSchema.extend({\n text: z.string()\n});\nvar BlobResourceContentsSchema = ResourceContentsSchema.extend({\n blob: z.base64()\n});\nvar EmbeddedResourceSchema = z.object({\n type: z.literal(\"resource\"),\n resource: z.union([TextResourceContentsSchema, BlobResourceContentsSchema])\n}).loose();\nvar ResourceLinkContentSchema = z.object({\n type: z.literal(\"resource_link\"),\n uri: z.string(),\n name: z.string(),\n description: z.optional(z.string()),\n mimeType: z.optional(z.string())\n}).loose();\nvar CallToolResultSchema = ResultSchema.extend({\n content: z.array(\n z.union([\n TextContentSchema,\n ImageContentSchema,\n EmbeddedResourceSchema,\n ResourceLinkContentSchema\n ])\n ),\n /**\n * @see https://modelcontextprotocol.io/specification/2025-06-18/server/tools#structured-content\n */\n structuredContent: z.optional(z.unknown()),\n isError: z.boolean().default(false).optional()\n}).or(\n ResultSchema.extend({\n toolResult: z.unknown()\n })\n);\nvar ResourceTemplateSchema = z.object({\n uriTemplate: z.string(),\n name: z.string(),\n title: z.optional(z.string()),\n description: z.optional(z.string()),\n mimeType: z.optional(z.string())\n}).loose();\nvar ListResourceTemplatesResultSchema = ResultSchema.extend({\n resourceTemplates: z.array(ResourceTemplateSchema)\n});\nvar ReadResourceResultSchema = ResultSchema.extend({\n contents: z.array(\n z.union([TextResourceContentsSchema, BlobResourceContentsSchema])\n )\n});\nvar PromptReferenceSchema = z.object({\n type: z.literal(\"ref/prompt\"),\n name: z.string()\n}).loose();\nvar ResourceReferenceSchema = z.object({\n type: z.literal(\"ref/resource\"),\n uri: z.string()\n}).loose();\nvar CompletionArgumentSchema = z.object({\n name: z.string(),\n value: z.string()\n}).loose();\nvar CompleteRequestParamsSchema = BaseParamsSchema.extend({\n ref: z.union([PromptReferenceSchema, ResourceReferenceSchema]),\n argument: CompletionArgumentSchema,\n context: z.optional(\n z.object({\n arguments: z.record(z.string(), z.string())\n }).loose()\n )\n});\nvar CompleteResultSchema = ResultSchema.extend({\n completion: z.object({\n values: z.array(z.string()).max(100),\n total: z.optional(z.number().int()),\n hasMore: z.optional(z.boolean())\n }).loose()\n});\nvar PromptArgumentSchema = z.object({\n name: z.string(),\n description: z.optional(z.string()),\n required: z.optional(z.boolean())\n}).loose();\nvar PromptSchema = z.object({\n name: z.string(),\n title: z.optional(z.string()),\n description: z.optional(z.string()),\n arguments: z.optional(z.array(PromptArgumentSchema))\n}).loose();\nvar ListPromptsResultSchema = PaginatedResultSchema.extend({\n prompts: z.array(PromptSchema)\n});\nvar PromptMessageSchema = z.object({\n role: z.union([z.literal(\"user\"), z.literal(\"assistant\")]),\n content: z.union([\n TextContentSchema,\n ImageContentSchema,\n EmbeddedResourceSchema,\n ResourceLinkContentSchema\n ])\n}).loose();\nvar GetPromptResultSchema = ResultSchema.extend({\n description: z.optional(z.string()),\n messages: z.array(PromptMessageSchema)\n});\nvar ElicitationRequestParamsSchema = BaseParamsSchema.extend({\n message: z.string(),\n requestedSchema: z.unknown()\n});\nvar ElicitationRequestSchema = RequestSchema.extend({\n method: z.literal(\"elicitation/create\"),\n params: ElicitationRequestParamsSchema\n});\nvar ElicitResultSchema = ResultSchema.extend({\n action: z.union([\n z.literal(\"accept\"),\n z.literal(\"decline\"),\n z.literal(\"cancel\")\n ]),\n content: z.optional(z.record(z.string(), z.unknown()))\n});\n\n// src/tool/json-rpc-message.ts\nvar JSONRPC_VERSION = \"2.0\";\nvar JSONRPCRequestSchema = z2.object({\n jsonrpc: z2.literal(JSONRPC_VERSION),\n id: z2.union([z2.string(), z2.number().int()])\n}).merge(RequestSchema).strict();\nvar JSONRPCResponseSchema = z2.object({\n jsonrpc: z2.literal(JSONRPC_VERSION),\n id: z2.union([z2.string(), z2.number().int()]),\n result: ResultSchema\n}).strict();\nvar JSONRPCErrorSchema = z2.object({\n jsonrpc: z2.literal(JSONRPC_VERSION),\n id: z2.union([z2.string(), z2.number().int()]),\n error: z2.object({\n code: z2.number().int(),\n message: z2.string(),\n data: z2.optional(z2.unknown())\n })\n}).strict();\nvar JSONRPCNotificationSchema = z2.object({\n jsonrpc: z2.literal(JSONRPC_VERSION)\n}).merge(\n z2.object({\n method: z2.string(),\n params: z2.optional(BaseParamsSchema)\n })\n).strict();\nvar JSONRPCMessageSchema = z2.union([\n JSONRPCRequestSchema,\n JSONRPCNotificationSchema,\n JSONRPCResponseSchema,\n JSONRPCErrorSchema\n]);\nasync function parseJSONRPCMessage(text) {\n return JSONRPCMessageSchema.parse(await parseJSON({ text }));\n}\n\n// src/version.ts\nvar VERSION = typeof __PACKAGE_VERSION__ !== \"undefined\" ? __PACKAGE_VERSION__ : \"0.0.0-test\";\n\n// src/tool/oauth.ts\nimport pkceChallenge from \"pkce-challenge\";\n\n// src/tool/oauth-types.ts\nimport { z as z3 } from \"zod/v4\";\nvar SafeUrlSchema = z3.string().url().superRefine((val, ctx) => {\n if (!URL.canParse(val)) {\n ctx.addIssue({\n code: z3.ZodIssueCode.custom,\n message: \"URL must be parseable\",\n fatal: true\n });\n return z3.NEVER;\n }\n}).refine(\n (url) => {\n const parsedUrl = new URL(url);\n return parsedUrl.protocol !== \"javascript:\" && parsedUrl.protocol !== \"data:\" && parsedUrl.protocol !== \"vbscript:\";\n },\n { message: \"URL cannot use javascript:, data:, or vbscript: scheme\" }\n);\nvar OAuthTokensSchema = z3.object({\n access_token: z3.string(),\n id_token: z3.string().optional(),\n // Optional for OAuth 2.1, but necessary in OpenID Connect\n token_type: z3.string(),\n expires_in: z3.number().optional(),\n scope: z3.string().optional(),\n refresh_token: z3.string().optional(),\n authorization_server: SafeUrlSchema.optional(),\n token_endpoint: SafeUrlSchema.optional()\n}).strip();\nvar OAuthProtectedResourceMetadataSchema = z3.looseObject({\n resource: z3.string().url(),\n authorization_servers: z3.array(SafeUrlSchema).optional(),\n jwks_uri: z3.string().url().optional(),\n scopes_supported: z3.array(z3.string()).optional(),\n bearer_methods_supported: z3.array(z3.string()).optional(),\n resource_signing_alg_values_supported: z3.array(z3.string()).optional(),\n resource_name: z3.string().optional(),\n resource_documentation: z3.string().optional(),\n resource_policy_uri: z3.string().url().optional(),\n resource_tos_uri: z3.string().url().optional(),\n tls_client_certificate_bound_access_tokens: z3.boolean().optional(),\n authorization_details_types_supported: z3.array(z3.string()).optional(),\n dpop_signing_alg_values_supported: z3.array(z3.string()).optional(),\n dpop_bound_access_tokens_required: z3.boolean().optional()\n});\nvar OAuthMetadataSchema = z3.looseObject({\n issuer: z3.string(),\n authorization_endpoint: SafeUrlSchema,\n token_endpoint: SafeUrlSchema,\n registration_endpoint: SafeUrlSchema.optional(),\n scopes_supported: z3.array(z3.string()).optional(),\n response_types_supported: z3.array(z3.string()),\n grant_types_supported: z3.array(z3.string()).optional(),\n code_challenge_methods_supported: z3.array(z3.string()),\n token_endpoint_auth_methods_supported: z3.array(z3.string()).optional(),\n token_endpoint_auth_signing_alg_values_supported: z3.array(z3.string()).optional()\n});\nvar OpenIdProviderMetadataSchema = z3.looseObject({\n issuer: z3.string(),\n authorization_endpoint: SafeUrlSchema,\n token_endpoint: SafeUrlSchema,\n userinfo_endpoint: SafeUrlSchema.optional(),\n jwks_uri: SafeUrlSchema,\n registration_endpoint: SafeUrlSchema.optional(),\n scopes_supported: z3.array(z3.string()).optional(),\n response_types_supported: z3.array(z3.string()),\n grant_types_supported: z3.array(z3.string()).optional(),\n subject_types_supported: z3.array(z3.string()),\n id_token_signing_alg_values_supported: z3.array(z3.string()),\n claims_supported: z3.array(z3.string()).optional(),\n token_endpoint_auth_methods_supported: z3.array(z3.string()).optional()\n});\nvar OpenIdProviderDiscoveryMetadataSchema = OpenIdProviderMetadataSchema.merge(\n OAuthMetadataSchema.pick({\n code_challenge_methods_supported: true\n })\n);\nvar OAuthClientInformationSchema = z3.object({\n client_id: z3.string(),\n client_secret: z3.string().optional(),\n client_id_issued_at: z3.number().optional(),\n client_secret_expires_at: z3.number().optional(),\n authorization_server: SafeUrlSchema.optional(),\n token_endpoint: SafeUrlSchema.optional()\n}).strip();\nvar OAuthClientMetadataSchema = z3.object({\n redirect_uris: z3.array(SafeUrlSchema),\n token_endpoint_auth_method: z3.string().optional(),\n grant_types: z3.array(z3.string()).optional(),\n response_types: z3.array(z3.string()).optional(),\n client_name: z3.string().optional(),\n client_uri: SafeUrlSchema.optional(),\n logo_uri: SafeUrlSchema.optional(),\n scope: z3.string().optional(),\n contacts: z3.array(z3.string()).optional(),\n tos_uri: SafeUrlSchema.optional(),\n policy_uri: z3.string().optional(),\n jwks_uri: SafeUrlSchema.optional(),\n jwks: z3.any().optional(),\n software_id: z3.string().optional(),\n software_version: z3.string().optional(),\n software_statement: z3.string().optional()\n}).strip();\nvar OAuthErrorResponseSchema = z3.object({\n error: z3.string(),\n error_description: z3.string().optional(),\n error_uri: z3.string().optional()\n});\nvar OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(\n OAuthClientInformationSchema\n);\n\n// src/error/oauth-error.ts\nimport { AISDKError as AISDKError2 } from \"@ai-sdk/provider\";\nvar name2 = \"AI_MCPClientOAuthError\";\nvar marker2 = `vercel.ai.error.${name2}`;\nvar symbol2 = Symbol.for(marker2);\nvar _a2, _b2;\nvar MCPClientOAuthError = class extends (_b2 = AISDKError2, _a2 = symbol2, _b2) {\n constructor({\n name: name3 = \"MCPClientOAuthError\",\n message,\n cause\n }) {\n super({ name: name3, message, cause });\n this[_a2] = true;\n }\n static isInstance(error) {\n return AISDKError2.hasMarker(error, marker2);\n }\n};\nvar ServerError = class extends MCPClientOAuthError {\n};\nServerError.errorCode = \"server_error\";\nvar InvalidClientError = class extends MCPClientOAuthError {\n};\nInvalidClientError.errorCode = \"invalid_client\";\nvar InvalidGrantError = class extends MCPClientOAuthError {\n};\nInvalidGrantError.errorCode = \"invalid_grant\";\nvar UnauthorizedClientError = class extends MCPClientOAuthError {\n};\nUnauthorizedClientError.errorCode = \"unauthorized_client\";\nvar OAUTH_ERRORS = {\n [ServerError.errorCode]: ServerError,\n [InvalidClientError.errorCode]: InvalidClientError,\n [InvalidGrantError.errorCode]: InvalidGrantError,\n [UnauthorizedClientError.errorCode]: UnauthorizedClientError\n};\n\n// src/util/oauth-util.ts\nfunction resourceUrlFromServerUrl(url) {\n const resourceURL = typeof url === \"string\" ? new URL(url) : new URL(url.href);\n resourceURL.hash = \"\";\n return resourceURL;\n}\nfunction resourceUrlStripSlash(resource) {\n const href = resource.href;\n if (resource.pathname === \"/\" && href.endsWith(\"/\")) {\n return href.slice(0, -1);\n }\n return href;\n}\nfunction checkResourceAllowed({\n requestedResource,\n configuredResource\n}) {\n const requested = typeof requestedResource === \"string\" ? new URL(requestedResource) : new URL(requestedResource.href);\n const configured = typeof configuredResource === \"string\" ? new URL(configuredResource) : new URL(configuredResource.href);\n if (requested.origin !== configured.origin) {\n return false;\n }\n if (requested.pathname.length < configured.pathname.length) {\n return false;\n }\n const requestedPath = requested.pathname.endsWith(\"/\") ? requested.pathname : requested.pathname + \"/\";\n const configuredPath = configured.pathname.endsWith(\"/\") ? configured.pathname : configured.pathname + \"/\";\n return requestedPath.startsWith(configuredPath);\n}\n\n// src/tool/oauth.ts\nimport { parseJSON as parseJSON2 } from \"@ai-sdk/provider-utils\";\nvar UnauthorizedError = class extends Error {\n constructor(message = \"Unauthorized\") {\n super(message);\n this.name = \"UnauthorizedError\";\n }\n};\nfunction normalizeUrl(url) {\n return new URL(url).href;\n}\nfunction createAuthorizationServerInformation(authorizationServerUrl, metadata) {\n return {\n authorizationServerUrl: normalizeUrl(authorizationServerUrl),\n tokenEndpoint: normalizeUrl(\n (metadata == null ? void 0 : metadata.token_endpoint) ? new URL(metadata.token_endpoint) : new URL(\"/token\", authorizationServerUrl)\n )\n };\n}\nfunction addAuthorizationServerInformationToTokens(tokens, authorizationServerInformation) {\n return {\n ...tokens,\n authorization_server: authorizationServerInformation.authorizationServerUrl,\n token_endpoint: authorizationServerInformation.tokenEndpoint\n };\n}\nfunction addAuthorizationServerInformationToClientInformation(clientInformation, authorizationServerInformation) {\n return {\n ...clientInformation,\n authorization_server: authorizationServerInformation.authorizationServerUrl,\n token_endpoint: authorizationServerInformation.tokenEndpoint\n };\n}\nfunction getAuthorizationServerInformationFromCredentials(credentials) {\n if (!(credentials == null ? void 0 : credentials.authorization_server) || !credentials.token_endpoint) {\n return void 0;\n }\n return {\n authorizationServerUrl: normalizeUrl(credentials.authorization_server),\n tokenEndpoint: normalizeUrl(credentials.token_endpoint)\n };\n}\nasync function getStoredAuthorizationServerInformation({\n provider,\n clientInformation,\n tokens\n}) {\n var _a3;\n const tokenAuthorizationServerInformation = getAuthorizationServerInformationFromCredentials(tokens);\n if (tokenAuthorizationServerInformation) {\n return tokenAuthorizationServerInformation;\n }\n const providerAuthorizationServerInformation = await ((_a3 = provider.authorizationServerInformation) == null ? void 0 : _a3.call(provider));\n if (providerAuthorizationServerInformation) {\n return {\n authorizationServerUrl: normalizeUrl(\n providerAuthorizationServerInformation.authorizationServerUrl\n ),\n tokenEndpoint: normalizeUrl(\n providerAuthorizationServerInformation.tokenEndpoint\n )\n };\n }\n return getAuthorizationServerInformationFromCredentials(clientInformation);\n}\nasync function saveAuthorizationServerInformation({\n provider,\n clientInformation,\n authorizationServerInformation\n}) {\n if (provider.saveAuthorizationServerInformation) {\n await provider.saveAuthorizationServerInformation(\n authorizationServerInformation\n );\n return true;\n }\n if (provider.saveClientInformation) {\n await provider.saveClientInformation(\n addAuthorizationServerInformationToClientInformation(\n clientInformation,\n authorizationServerInformation\n )\n );\n return true;\n }\n return false;\n}\nfunction assertResourceMetadataUrlSameOrigin(serverUrl, resourceMetadataUrl) {\n if (!resourceMetadataUrl) {\n return;\n }\n const expectedOrigin = new URL(serverUrl).origin;\n if (resourceMetadataUrl.origin !== expectedOrigin) {\n throw new MCPClientOAuthError({\n message: `OAuth protected resource metadata URL ${resourceMetadataUrl.href} must have the same origin as the MCP server URL ${expectedOrigin}`\n });\n }\n}\nfunction assertAuthorizationServerInformationMatches({\n storedAuthorizationServerInformation,\n currentAuthorizationServerInformation\n}) {\n if (storedAuthorizationServerInformation.authorizationServerUrl !== currentAuthorizationServerInformation.authorizationServerUrl || storedAuthorizationServerInformation.tokenEndpoint !== currentAuthorizationServerInformation.tokenEndpoint) {\n throw new MCPClientOAuthError({\n message: \"OAuth authorization server metadata does not match the metadata that issued the stored credentials\"\n });\n }\n}\nfunction extractResourceMetadataUrl(response) {\n var _a3;\n const header = (_a3 = response.headers.get(\"www-authenticate\")) != null ? _a3 : response.headers.get(\"WWW-Authenticate\");\n if (!header) {\n return void 0;\n }\n const [type, scheme] = header.split(\" \");\n if (type.toLowerCase() !== \"bearer\" || !scheme) {\n return void 0;\n }\n const regex = /resource_metadata=\"([^\"]*)\"/;\n const match = header.match(regex);\n if (!match) {\n return void 0;\n }\n try {\n return new URL(match[1]);\n } catch (e) {\n return void 0;\n }\n}\nfunction buildWellKnownPath(wellKnownPrefix, pathname = \"\", options = {}) {\n if (pathname.endsWith(\"/\")) {\n pathname = pathname.slice(0, -1);\n }\n return options.prependPathname ? `${pathname}/.well-known/${wellKnownPrefix}` : `/.well-known/${wellKnownPrefix}${pathname}`;\n}\nasync function fetchWithCorsRetry(url, headers, fetchFn = fetch) {\n try {\n return await fetchFn(url, { headers });\n } catch (error) {\n if (error instanceof TypeError) {\n if (headers) {\n return fetchWithCorsRetry(url, void 0, fetchFn);\n } else {\n return void 0;\n }\n }\n throw error;\n }\n}\nasync function tryMetadataDiscovery(url, protocolVersion, fetchFn = fetch) {\n const headers = {\n \"MCP-Protocol-Version\": protocolVersion\n };\n return await fetchWithCorsRetry(url, headers, fetchFn);\n}\nfunction shouldAttemptFallback(response, pathname) {\n return !response || response.status >= 400 && response.status < 500 && pathname !== \"/\";\n}\nasync function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, opts) {\n var _a3, _b3;\n const issuer = new URL(serverUrl);\n const protocolVersion = (_a3 = opts == null ? void 0 : opts.protocolVersion) != null ? _a3 : LATEST_PROTOCOL_VERSION;\n let url;\n if (opts == null ? void 0 : opts.metadataUrl) {\n url = new URL(opts.metadataUrl);\n } else {\n const wellKnownPath = buildWellKnownPath(wellKnownType, issuer.pathname);\n url = new URL(wellKnownPath, (_b3 = opts == null ? void 0 : opts.metadataServerUrl) != null ? _b3 : issuer);\n url.search = issuer.search;\n }\n let response = await tryMetadataDiscovery(url, protocolVersion, fetchFn);\n if (!(opts == null ? void 0 : opts.metadataUrl) && shouldAttemptFallback(response, issuer.pathname)) {\n const rootUrl = new URL(`/.well-known/${wellKnownType}`, issuer);\n response = await tryMetadataDiscovery(rootUrl, protocolVersion, fetchFn);\n }\n return response;\n}\nasync function discoverOAuthProtectedResourceMetadata(serverUrl, opts, fetchFn = fetch) {\n const response = await discoverMetadataWithFallback(\n serverUrl,\n \"oauth-protected-resource\",\n fetchFn,\n {\n protocolVersion: opts == null ? void 0 : opts.protocolVersion,\n metadataUrl: opts == null ? void 0 : opts.resourceMetadataUrl\n }\n );\n if (!response || response.status === 404) {\n throw new Error(\n `Resource server does not implement OAuth 2.0 Protected Resource Metadata.`\n );\n }\n if (!response.ok) {\n throw new Error(\n `HTTP ${response.status} trying to load well-known OAuth protected resource metadata.`\n );\n }\n return OAuthProtectedResourceMetadataSchema.parse(await response.json());\n}\nfunction buildDiscoveryUrls(authorizationServerUrl) {\n const url = typeof authorizationServerUrl === \"string\" ? new URL(authorizationServerUrl) : authorizationServerUrl;\n const hasPath = url.pathname !== \"/\";\n const rootIssuer = url.origin;\n const urlsToTry = [];\n if (!hasPath) {\n urlsToTry.push({\n url: new URL(\"/.well-known/oauth-authorization-server\", url.origin),\n type: \"oauth\",\n expectedIssuer: rootIssuer\n });\n urlsToTry.push({\n url: new URL(\"/.well-known/openid-configuration\", url.origin),\n type: \"oidc\",\n expectedIssuer: rootIssuer\n });\n return urlsToTry;\n }\n let pathname = url.pathname;\n if (pathname.endsWith(\"/\")) {\n pathname = pathname.slice(0, -1);\n }\n const pathIssuer = `${url.origin}${pathname}`;\n urlsToTry.push({\n url: new URL(\n `/.well-known/oauth-authorization-server${pathname}`,\n url.origin\n ),\n type: \"oauth\",\n expectedIssuer: pathIssuer\n });\n urlsToTry.push({\n url: new URL(\"/.well-known/oauth-authorization-server\", url.origin),\n type: \"oauth\",\n expectedIssuer: rootIssuer\n });\n urlsToTry.push({\n url: new URL(`/.well-known/openid-configuration${pathname}`, url.origin),\n type: \"oidc\",\n expectedIssuer: pathIssuer\n });\n urlsToTry.push({\n url: new URL(`${pathname}/.well-known/openid-configuration`, url.origin),\n type: \"oidc\",\n expectedIssuer: pathIssuer\n });\n return urlsToTry;\n}\nfunction assertMetadataIssuerMatches(metadata, expectedIssuer) {\n if (metadata.issuer !== expectedIssuer) {\n throw new MCPClientOAuthError({\n message: `OAuth authorization server metadata issuer ${metadata.issuer} does not match expected issuer ${expectedIssuer}`\n });\n }\n}\nasync function discoverAuthorizationServerMetadata(authorizationServerUrl, {\n fetchFn = fetch,\n protocolVersion = LATEST_PROTOCOL_VERSION\n} = {}) {\n var _a3;\n const headers = { \"MCP-Protocol-Version\": protocolVersion };\n const urlsToTry = buildDiscoveryUrls(authorizationServerUrl);\n for (const { url: endpointUrl, type, expectedIssuer } of urlsToTry) {\n const response = await fetchWithCorsRetry(endpointUrl, headers, fetchFn);\n if (!response) {\n continue;\n }\n if (!response.ok) {\n if (response.status >= 400 && response.status < 500) {\n continue;\n }\n throw new Error(\n `HTTP ${response.status} trying to load ${type === \"oauth\" ? \"OAuth\" : \"OpenID provider\"} metadata from ${endpointUrl}`\n );\n }\n if (type === \"oauth\") {\n const metadata = OAuthMetadataSchema.parse(await response.json());\n assertMetadataIssuerMatches(metadata, expectedIssuer);\n return metadata;\n } else {\n const metadata = OpenIdProviderDiscoveryMetadataSchema.parse(\n await response.json()\n );\n assertMetadataIssuerMatches(metadata, expectedIssuer);\n if (!((_a3 = metadata.code_challenge_methods_supported) == null ? void 0 : _a3.includes(\"S256\"))) {\n throw new Error(\n `Incompatible OIDC provider at ${endpointUrl}: does not support S256 code challenge method required by MCP specification`\n );\n }\n return metadata;\n }\n }\n return void 0;\n}\nasync function startAuthorization(authorizationServerUrl, {\n metadata,\n clientInformation,\n redirectUrl,\n scope,\n state,\n resource\n}) {\n const responseType = \"code\";\n const codeChallengeMethod = \"S256\";\n let authorizationUrl;\n if (metadata) {\n authorizationUrl = new URL(metadata.authorization_endpoint);\n if (!metadata.response_types_supported.includes(responseType)) {\n throw new Error(\n `Incompatible auth server: does not support response type ${responseType}`\n );\n }\n if (!metadata.code_challenge_methods_supported || !metadata.code_challenge_methods_supported.includes(codeChallengeMethod)) {\n throw new Error(\n `Incompatible auth server: does not support code challenge method ${codeChallengeMethod}`\n );\n }\n } else {\n authorizationUrl = new URL(\"/authorize\", authorizationServerUrl);\n }\n const challenge = await pkceChallenge();\n const codeVerifier = challenge.code_verifier;\n const codeChallenge = challenge.code_challenge;\n authorizationUrl.searchParams.set(\"response_type\", responseType);\n authorizationUrl.searchParams.set(\"client_id\", clientInformation.client_id);\n authorizationUrl.searchParams.set(\"code_challenge\", codeChallenge);\n authorizationUrl.searchParams.set(\n \"code_challenge_method\",\n codeChallengeMethod\n );\n authorizationUrl.searchParams.set(\"redirect_uri\", String(redirectUrl));\n if (state) {\n authorizationUrl.searchParams.set(\"state\", state);\n }\n if (scope) {\n authorizationUrl.searchParams.set(\"scope\", scope);\n }\n if (scope == null ? void 0 : scope.includes(\"offline_access\")) {\n authorizationUrl.searchParams.append(\"prompt\", \"consent\");\n }\n if (resource) {\n authorizationUrl.searchParams.set(\n \"resource\",\n resourceUrlStripSlash(resource)\n );\n }\n return { authorizationUrl, codeVerifier };\n}\nfunction selectClientAuthMethod(clientInformation, supportedMethods) {\n const hasClientSecret = clientInformation.client_secret !== void 0;\n if (supportedMethods.length === 0) {\n return hasClientSecret ? \"client_secret_post\" : \"none\";\n }\n if (hasClientSecret && supportedMethods.includes(\"client_secret_basic\")) {\n return \"client_secret_basic\";\n }\n if (hasClientSecret && supportedMethods.includes(\"client_secret_post\")) {\n return \"client_secret_post\";\n }\n if (supportedMethods.includes(\"none\")) {\n return \"none\";\n }\n return hasClientSecret ? \"client_secret_post\" : \"none\";\n}\nfunction applyClientAuthentication(method, clientInformation, headers, params) {\n const { client_id, client_secret } = clientInformation;\n switch (method) {\n case \"client_secret_basic\":\n applyBasicAuth(client_id, client_secret, headers);\n return;\n case \"client_secret_post\":\n applyPostAuth(client_id, client_secret, params);\n return;\n case \"none\":\n applyPublicAuth(client_id, params);\n return;\n default:\n throw new Error(`Unsupported client authentication method: ${method}`);\n }\n}\nfunction applyBasicAuth(clientId, clientSecret, headers) {\n if (!clientSecret) {\n throw new Error(\n \"client_secret_basic authentication requires a client_secret\"\n );\n }\n const credentials = btoa(`${clientId}:${clientSecret}`);\n headers.set(\"Authorization\", `Basic ${credentials}`);\n}\nfunction applyPostAuth(clientId, clientSecret, params) {\n params.set(\"client_id\", clientId);\n if (clientSecret) {\n params.set(\"client_secret\", clientSecret);\n }\n}\nfunction applyPublicAuth(clientId, params) {\n params.set(\"client_id\", clientId);\n}\nasync function parseErrorResponse(input) {\n const statusCode = input instanceof Response ? input.status : void 0;\n const body = input instanceof Response ? await input.text() : input;\n try {\n const result = OAuthErrorResponseSchema.parse(\n await parseJSON2({ text: body })\n );\n const { error, error_description, error_uri } = result;\n const errorClass = OAUTH_ERRORS[error] || ServerError;\n return new errorClass({\n message: error_description || \"\",\n cause: error_uri\n });\n } catch (error) {\n const errorMessage = `${statusCode ? `HTTP ${statusCode}: ` : \"\"}Invalid OAuth error response: ${error}. Raw body: ${body}`;\n return new ServerError({ message: errorMessage });\n }\n}\nasync function exchangeAuthorization(authorizationServerUrl, {\n metadata,\n clientInformation,\n authorizationCode,\n codeVerifier,\n redirectUri,\n resource,\n addClientAuthentication,\n fetchFn\n}) {\n var _a3;\n const grantType = \"authorization_code\";\n const tokenUrl = (metadata == null ? void 0 : metadata.token_endpoint) ? new URL(metadata.token_endpoint) : new URL(\"/token\", authorizationServerUrl);\n if ((metadata == null ? void 0 : metadata.grant_types_supported) && !metadata.grant_types_supported.includes(grantType)) {\n throw new Error(\n `Incompatible auth server: does not support grant type ${grantType}`\n );\n }\n const headers = new Headers({\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n Accept: \"application/json\"\n });\n const params = new URLSearchParams({\n grant_type: grantType,\n code: authorizationCode,\n code_verifier: codeVerifier,\n redirect_uri: String(redirectUri)\n });\n if (addClientAuthentication) {\n await addClientAuthentication(\n headers,\n params,\n authorizationServerUrl,\n metadata\n );\n } else {\n const supportedMethods = (_a3 = metadata == null ? void 0 : metadata.token_endpoint_auth_methods_supported) != null ? _a3 : [];\n const authMethod = selectClientAuthMethod(\n clientInformation,\n supportedMethods\n );\n applyClientAuthentication(authMethod, clientInformation, headers, params);\n }\n if (resource) {\n params.set(\"resource\", resourceUrlStripSlash(resource));\n }\n const response = await (fetchFn != null ? fetchFn : fetch)(tokenUrl, {\n method: \"POST\",\n headers,\n body: params\n });\n if (!response.ok) {\n throw await parseErrorResponse(response);\n }\n return OAuthTokensSchema.parse(await response.json());\n}\nasync function refreshAuthorization(authorizationServerUrl, {\n metadata,\n clientInformation,\n refreshToken,\n resource,\n addClientAuthentication,\n fetchFn\n}) {\n var _a3;\n const grantType = \"refresh_token\";\n let tokenUrl;\n if (metadata) {\n tokenUrl = new URL(metadata.token_endpoint);\n if (metadata.grant_types_supported && !metadata.grant_types_supported.includes(grantType)) {\n throw new Error(\n `Incompatible auth server: does not support grant type ${grantType}`\n );\n }\n } else {\n tokenUrl = new URL(\"/token\", authorizationServerUrl);\n }\n const headers = new Headers({\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n Accept: \"application/json\"\n });\n const params = new URLSearchParams({\n grant_type: grantType,\n refresh_token: refreshToken\n });\n if (addClientAuthentication) {\n await addClientAuthentication(\n headers,\n params,\n authorizationServerUrl,\n metadata\n );\n } else {\n const supportedMethods = (_a3 = metadata == null ? void 0 : metadata.token_endpoint_auth_methods_supported) != null ? _a3 : [];\n const authMethod = selectClientAuthMethod(\n clientInformation,\n supportedMethods\n );\n applyClientAuthentication(authMethod, clientInformation, headers, params);\n }\n if (resource) {\n params.set(\"resource\", resourceUrlStripSlash(resource));\n }\n const response = await (fetchFn != null ? fetchFn : fetch)(tokenUrl, {\n method: \"POST\",\n headers,\n body: params\n });\n if (!response.ok) {\n throw await parseErrorResponse(response);\n }\n return OAuthTokensSchema.parse({\n refresh_token: refreshToken,\n ...await response.json()\n });\n}\nasync function registerClient(authorizationServerUrl, {\n metadata,\n clientMetadata,\n fetchFn\n}) {\n let registrationUrl;\n if (metadata) {\n if (!metadata.registration_endpoint) {\n throw new Error(\n \"Incompatible auth server: does not support dynamic client registration\"\n );\n }\n registrationUrl = new URL(metadata.registration_endpoint);\n } else {\n registrationUrl = new URL(\"/register\", authorizationServerUrl);\n }\n const response = await (fetchFn != null ? fetchFn : fetch)(registrationUrl, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(clientMetadata)\n });\n if (!response.ok) {\n throw await parseErrorResponse(response);\n }\n return OAuthClientInformationFullSchema.parse(await response.json());\n}\nasync function auth(provider, options) {\n var _a3, _b3;\n try {\n return await authInternal(provider, options);\n } catch (error) {\n if (error instanceof InvalidClientError || error instanceof UnauthorizedClientError) {\n await ((_a3 = provider.invalidateCredentials) == null ? void 0 : _a3.call(provider, \"all\"));\n return await authInternal(provider, options);\n } else if (error instanceof InvalidGrantError) {\n await ((_b3 = provider.invalidateCredentials) == null ? void 0 : _b3.call(provider, \"tokens\"));\n return await authInternal(provider, options);\n }\n throw error;\n }\n}\nasync function selectResourceURL(serverUrl, provider, resourceMetadata) {\n const defaultResource = resourceUrlFromServerUrl(serverUrl);\n if (provider.validateResourceURL) {\n return await provider.validateResourceURL(\n defaultResource,\n resourceMetadata == null ? void 0 : resourceMetadata.resource\n );\n }\n if (!resourceMetadata) {\n return void 0;\n }\n if (!checkResourceAllowed({\n requestedResource: defaultResource,\n configuredResource: resourceMetadata.resource\n })) {\n throw new Error(\n `Protected resource ${resourceMetadata.resource} does not match expected ${defaultResource} (or origin)`\n );\n }\n return new URL(resourceMetadata.resource);\n}\nasync function authInternal(provider, {\n serverUrl,\n authorizationCode,\n callbackState,\n scope,\n resourceMetadataUrl,\n fetchFn\n}) {\n var _a3, _b3;\n let resourceMetadata;\n let authorizationServerUrl;\n assertResourceMetadataUrlSameOrigin(serverUrl, resourceMetadataUrl);\n try {\n resourceMetadata = await discoverOAuthProtectedResourceMetadata(\n serverUrl,\n { resourceMetadataUrl },\n fetchFn\n );\n if (resourceMetadata.authorization_servers && resourceMetadata.authorization_servers.length > 0) {\n authorizationServerUrl = resourceMetadata.authorization_servers[0];\n }\n } catch (e) {\n }\n if (!authorizationServerUrl) {\n authorizationServerUrl = serverUrl;\n }\n const resource = await selectResourceURL(\n serverUrl,\n provider,\n resourceMetadata\n );\n await ((_a3 = provider.validateAuthorizationServerURL) == null ? void 0 : _a3.call(\n provider,\n serverUrl,\n authorizationServerUrl\n ));\n const metadata = await discoverAuthorizationServerMetadata(\n authorizationServerUrl,\n {\n fetchFn\n }\n );\n const currentAuthorizationServerInformation = createAuthorizationServerInformation(authorizationServerUrl, metadata);\n let clientInformation = await Promise.resolve(provider.clientInformation());\n if (!clientInformation) {\n if (authorizationCode !== void 0) {\n throw new Error(\n \"Existing OAuth client information is required when exchanging an authorization code\"\n );\n }\n if (!provider.saveClientInformation) {\n throw new Error(\n \"OAuth client information must be saveable for dynamic registration\"\n );\n }\n const fullInformation = await registerClient(authorizationServerUrl, {\n metadata,\n clientMetadata: provider.clientMetadata,\n fetchFn\n });\n clientInformation = addAuthorizationServerInformationToClientInformation(\n fullInformation,\n currentAuthorizationServerInformation\n );\n await provider.saveClientInformation(clientInformation);\n }\n if (authorizationCode !== void 0) {\n if (provider.storedState) {\n const expectedState = await provider.storedState();\n if (expectedState !== void 0 && expectedState !== callbackState) {\n throw new Error(\n \"OAuth state parameter mismatch - possible CSRF attack\"\n );\n }\n }\n const storedAuthorizationServerInformation = await getStoredAuthorizationServerInformation({\n provider,\n clientInformation\n });\n if (!storedAuthorizationServerInformation) {\n throw new MCPClientOAuthError({\n message: \"Stored OAuth authorization server metadata is required when exchanging an authorization code\"\n });\n }\n assertAuthorizationServerInformationMatches({\n storedAuthorizationServerInformation,\n currentAuthorizationServerInformation\n });\n const codeVerifier2 = await provider.codeVerifier();\n const tokens2 = await exchangeAuthorization(authorizationServerUrl, {\n metadata,\n clientInformation,\n authorizationCode,\n codeVerifier: codeVerifier2,\n redirectUri: provider.redirectUrl,\n resource,\n addClientAuthentication: provider.addClientAuthentication,\n fetchFn\n });\n await provider.saveTokens(\n addAuthorizationServerInformationToTokens(\n tokens2,\n currentAuthorizationServerInformation\n )\n );\n return \"AUTHORIZED\";\n }\n const tokens = await provider.tokens();\n if (tokens == null ? void 0 : tokens.refresh_token) {\n const storedAuthorizationServerInformation = await getStoredAuthorizationServerInformation({\n provider,\n clientInformation,\n tokens\n });\n if (storedAuthorizationServerInformation) {\n assertAuthorizationServerInformationMatches({\n storedAuthorizationServerInformation,\n currentAuthorizationServerInformation\n });\n } else {\n await ((_b3 = provider.invalidateCredentials) == null ? void 0 : _b3.call(provider, \"tokens\"));\n }\n try {\n if (storedAuthorizationServerInformation) {\n const newTokens = await refreshAuthorization(authorizationServerUrl, {\n metadata,\n clientInformation,\n refreshToken: tokens.refresh_token,\n resource,\n addClientAuthentication: provider.addClientAuthentication,\n fetchFn\n });\n await provider.saveTokens(\n addAuthorizationServerInformationToTokens(\n newTokens,\n currentAuthorizationServerInformation\n )\n );\n return \"AUTHORIZED\";\n }\n } catch (error) {\n if (\n // If this is a ServerError, or an unknown type, log it out and try to continue. Otherwise, escalate so we can fix things and retry.\n !(error instanceof MCPClientOAuthError) || error instanceof ServerError\n ) {\n } else {\n throw error;\n }\n }\n }\n const state = provider.state ? await provider.state() : void 0;\n if (state && provider.saveState) {\n await provider.saveState(state);\n }\n const { authorizationUrl, codeVerifier } = await startAuthorization(\n authorizationServerUrl,\n {\n metadata,\n clientInformation,\n state,\n redirectUrl: provider.redirectUrl,\n scope: scope || provider.clientMetadata.scope,\n resource\n }\n );\n const savedAuthorizationServerInformation = await saveAuthorizationServerInformation({\n provider,\n clientInformation,\n authorizationServerInformation: currentAuthorizationServerInformation\n });\n if (!savedAuthorizationServerInformation) {\n throw new MCPClientOAuthError({\n message: \"OAuth authorization server metadata must be saveable before starting authorization\"\n });\n }\n await provider.saveCodeVerifier(codeVerifier);\n await provider.redirectToAuthorization(authorizationUrl);\n return \"REDIRECT\";\n}\n\n// src/tool/mcp-sse-transport.ts\nfunction isMessageEvent(event) {\n return event === void 0 || event === \"message\";\n}\nvar SseMCPTransport = class {\n constructor({\n url,\n headers,\n authProvider,\n redirect = \"error\",\n fetch: fetchFn\n }) {\n this.connected = false;\n this.url = new URL(url);\n this.headers = headers;\n this.authProvider = authProvider;\n this.redirectMode = redirect;\n this.fetchFn = fetchFn != null ? fetchFn : globalThis.fetch;\n }\n setProtocolVersion(version) {\n this.protocolVersion = version;\n }\n async commonHeaders(base) {\n var _a3;\n const headers = {\n ...this.headers,\n ...base,\n \"mcp-protocol-version\": (_a3 = this.protocolVersion) != null ? _a3 : LATEST_PROTOCOL_VERSION\n };\n if (this.authProvider) {\n const tokens = await this.authProvider.tokens();\n if (tokens == null ? void 0 : tokens.access_token) {\n headers[\"Authorization\"] = `Bearer ${tokens.access_token}`;\n }\n }\n return withUserAgentSuffix(\n headers,\n `ai-sdk/${VERSION}`,\n getRuntimeEnvironmentUserAgent()\n );\n }\n async start() {\n return new Promise((resolve, reject) => {\n if (this.connected) {\n return resolve();\n }\n this.abortController = new AbortController();\n const establishConnection = async (triedAuth = false) => {\n var _a3, _b3, _c, _d, _e;\n try {\n const headers = await this.commonHeaders({\n Accept: \"text/event-stream\"\n });\n const response = await this.fetchFn(this.url.href, {\n headers,\n signal: (_a3 = this.abortController) == null ? void 0 : _a3.signal,\n redirect: this.redirectMode\n });\n if (response.status === 401 && this.authProvider && !triedAuth) {\n this.resourceMetadataUrl = extractResourceMetadataUrl(response);\n try {\n const result = await auth(this.authProvider, {\n serverUrl: this.url,\n resourceMetadataUrl: this.resourceMetadataUrl,\n fetchFn: this.fetchFn\n });\n if (result !== \"AUTHORIZED\") {\n const error = new UnauthorizedError();\n (_b3 = this.onerror) == null ? void 0 : _b3.call(this, error);\n return reject(error);\n }\n } catch (error) {\n (_c = this.onerror) == null ? void 0 : _c.call(this, error);\n return reject(error);\n }\n return establishConnection(true);\n }\n if (!response.ok || !response.body) {\n let errorMessage = `MCP SSE Transport Error: ${response.status} ${response.statusText}`;\n if (response.status === 405) {\n errorMessage += \". This server does not support SSE transport. Try using `http` transport instead\";\n }\n const error = new MCPClientError({\n message: errorMessage\n });\n (_d = this.onerror) == null ? void 0 : _d.call(this, error);\n return reject(error);\n }\n const stream = response.body.pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream());\n const reader = stream.getReader();\n const processEvents = async () => {\n var _a4, _b4, _c2, _d2, _e2;\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n if (this.connected) {\n this.connected = false;\n throw new MCPClientError({\n message: \"MCP SSE Transport Error: Connection closed unexpectedly\"\n });\n }\n return;\n }\n const { event, data } = value;\n if (event === \"endpoint\") {\n if (this.endpoint) {\n continue;\n }\n const endpoint = new URL(data, this.url);\n if (endpoint.origin !== this.url.origin) {\n this.connected = false;\n this.endpoint = void 0;\n (_a4 = this.sseConnection) == null ? void 0 : _a4.close();\n (_b4 = this.abortController) == null ? void 0 : _b4.abort();\n throw new MCPClientError({\n message: `MCP SSE Transport Error: Endpoint origin does not match connection origin: ${endpoint.origin}`\n });\n }\n this.endpoint = endpoint;\n this.connected = true;\n resolve();\n } else if (isMessageEvent(event)) {\n try {\n const message = await parseJSONRPCMessage(data);\n (_c2 = this.onmessage) == null ? void 0 : _c2.call(this, message);\n } catch (error) {\n const e = new MCPClientError({\n message: \"MCP SSE Transport Error: Failed to parse message\",\n cause: error\n });\n (_d2 = this.onerror) == null ? void 0 : _d2.call(this, e);\n }\n }\n }\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n return;\n }\n (_e2 = this.onerror) == null ? void 0 : _e2.call(this, error);\n reject(error);\n }\n };\n this.sseConnection = {\n close: () => reader.cancel()\n };\n processEvents();\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n return;\n }\n (_e = this.onerror) == null ? void 0 : _e.call(this, error);\n reject(error);\n }\n };\n void establishConnection();\n });\n }\n async close() {\n var _a3, _b3, _c;\n this.connected = false;\n this.endpoint = void 0;\n (_a3 = this.sseConnection) == null ? void 0 : _a3.close();\n (_b3 = this.abortController) == null ? void 0 : _b3.abort();\n (_c = this.onclose) == null ? void 0 : _c.call(this);\n }\n async send(message) {\n if (!this.endpoint || !this.connected) {\n throw new MCPClientError({\n message: \"MCP SSE Transport Error: Not connected\"\n });\n }\n const endpoint = this.endpoint;\n const attempt = async (triedAuth = false) => {\n var _a3, _b3, _c, _d, _e;\n try {\n const headers = await this.commonHeaders({\n \"Content-Type\": \"application/json\"\n });\n const init = {\n method: \"POST\",\n headers,\n body: JSON.stringify(message),\n signal: (_a3 = this.abortController) == null ? void 0 : _a3.signal,\n redirect: this.redirectMode\n };\n const response = await this.fetchFn(endpoint.href, init);\n if (response.status === 401 && this.authProvider && !triedAuth) {\n this.resourceMetadataUrl = extractResourceMetadataUrl(response);\n try {\n const result = await auth(this.authProvider, {\n serverUrl: this.url,\n resourceMetadataUrl: this.resourceMetadataUrl,\n fetchFn: this.fetchFn\n });\n if (result !== \"AUTHORIZED\") {\n const error = new UnauthorizedError();\n (_b3 = this.onerror) == null ? void 0 : _b3.call(this, error);\n return;\n }\n } catch (error) {\n (_c = this.onerror) == null ? void 0 : _c.call(this, error);\n return;\n }\n return attempt(true);\n }\n if (!response.ok) {\n const text = await response.text().catch(() => null);\n const error = new MCPClientError({\n message: `MCP SSE Transport Error: POSTing to endpoint (HTTP ${response.status}): ${text}`\n });\n (_d = this.onerror) == null ? void 0 : _d.call(this, error);\n return;\n }\n } catch (error) {\n (_e = this.onerror) == null ? void 0 : _e.call(this, error);\n return;\n }\n };\n await attempt();\n }\n};\n\n// src/tool/mcp-http-transport.ts\nimport {\n EventSourceParserStream as EventSourceParserStream2,\n withUserAgentSuffix as withUserAgentSuffix2,\n getRuntimeEnvironmentUserAgent as getRuntimeEnvironmentUserAgent2\n} from \"@ai-sdk/provider-utils\";\nfunction isMessageEvent2(event) {\n return event === void 0 || event === \"message\";\n}\nvar HttpMCPTransport = class {\n constructor({\n url,\n headers,\n authProvider,\n redirect = \"error\",\n initialSessionId,\n initialProtocolVersion,\n onSessionIdChange,\n onSessionExpired,\n terminateSessionOnClose = true,\n fetch: fetchFn\n }) {\n this.inboundReconnectAttempts = 0;\n this.reconnectionOptions = {\n initialReconnectionDelay: 1e3,\n maxReconnectionDelay: 3e4,\n reconnectionDelayGrowFactor: 1.5,\n maxRetries: 2\n };\n this.url = new URL(url);\n this.headers = headers;\n this.authProvider = authProvider;\n this.redirectMode = redirect;\n this.sessionId = initialSessionId;\n this.protocolVersion = initialProtocolVersion;\n this.onSessionIdChange = onSessionIdChange;\n this.onSessionExpired = onSessionExpired;\n this.terminateSessionOnClose = terminateSessionOnClose;\n this.fetchFn = fetchFn != null ? fetchFn : globalThis.fetch;\n }\n setProtocolVersion(version) {\n this.protocolVersion = version;\n }\n async commonHeaders({\n base,\n includeSessionId = true\n }) {\n var _a3;\n const headers = {\n ...this.headers,\n ...base,\n \"mcp-protocol-version\": (_a3 = this.protocolVersion) != null ? _a3 : LATEST_PROTOCOL_VERSION\n };\n if (includeSessionId && this.sessionId) {\n headers[\"mcp-session-id\"] = this.sessionId;\n }\n if (this.authProvider) {\n const tokens = await this.authProvider.tokens();\n if (tokens == null ? void 0 : tokens.access_token) {\n headers[\"Authorization\"] = `Bearer ${tokens.access_token}`;\n }\n }\n return withUserAgentSuffix2(\n headers,\n `ai-sdk/${VERSION}`,\n getRuntimeEnvironmentUserAgent2()\n );\n }\n setSessionId(sessionId) {\n var _a3;\n if (this.sessionId === sessionId) {\n return;\n }\n this.sessionId = sessionId;\n (_a3 = this.onSessionIdChange) == null ? void 0 : _a3.call(this, sessionId);\n }\n applySessionIdFromResponse(response) {\n const sessionId = response.headers.get(\"mcp-session-id\");\n if (sessionId) {\n this.setSessionId(sessionId);\n }\n }\n expireSessionId(sessionId) {\n var _a3;\n if (this.sessionId === sessionId) {\n this.setSessionId(void 0);\n }\n (_a3 = this.onSessionExpired) == null ? void 0 : _a3.call(this, sessionId);\n }\n /**\n * Runs a single OAuth recovery flow for concurrent 401 responses.\n */\n authorizeOnce(resourceMetadataUrl) {\n if (!this.authProvider) {\n return Promise.resolve(\"REDIRECT\");\n }\n if (!this.authPromise) {\n this.authPromise = auth(this.authProvider, {\n serverUrl: this.url,\n resourceMetadataUrl,\n fetchFn: this.fetchFn\n }).finally(() => {\n this.authPromise = void 0;\n });\n }\n return this.authPromise;\n }\n async start() {\n if (this.abortController) {\n throw new MCPClientError({\n message: \"MCP HTTP Transport Error: Transport already started. Note: client.connect() calls start() automatically.\"\n });\n }\n this.abortController = new AbortController();\n void this.openInboundSse();\n }\n async close() {\n var _a3, _b3, _c;\n (_a3 = this.inboundSseConnection) == null ? void 0 : _a3.close();\n try {\n if (this.sessionId && this.terminateSessionOnClose && this.abortController && !this.abortController.signal.aborted) {\n const headers = await this.commonHeaders({ base: {} });\n await this.fetchFn(this.url.href, {\n method: \"DELETE\",\n headers,\n signal: this.abortController.signal,\n redirect: this.redirectMode\n }).catch(() => void 0);\n }\n } catch (e) {\n }\n (_b3 = this.abortController) == null ? void 0 : _b3.abort();\n (_c = this.onclose) == null ? void 0 : _c.call(this);\n }\n async send(message) {\n const attempt = async (triedAuth = false) => {\n var _a3, _b3, _c, _d, _e, _f, _g;\n try {\n const isInitializeRequest = \"method\" in message && message.method === \"initialize\";\n const sessionIdForRequest = isInitializeRequest ? void 0 : this.sessionId;\n const headers = await this.commonHeaders({\n base: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json, text/event-stream\"\n },\n includeSessionId: !isInitializeRequest\n });\n const init = {\n method: \"POST\",\n headers,\n body: JSON.stringify(message),\n signal: (_a3 = this.abortController) == null ? void 0 : _a3.signal,\n redirect: this.redirectMode\n };\n const response = await this.fetchFn(this.url.href, init);\n this.applySessionIdFromResponse(response);\n if (response.status === 401 && this.authProvider && !triedAuth) {\n this.resourceMetadataUrl = extractResourceMetadataUrl(response);\n try {\n const result = await this.authorizeOnce(this.resourceMetadataUrl);\n if (result !== \"AUTHORIZED\") {\n const error2 = new UnauthorizedError();\n throw error2;\n }\n } catch (error2) {\n (_b3 = this.onerror) == null ? void 0 : _b3.call(this, error2);\n throw error2;\n }\n return attempt(true);\n }\n if (response.status === 202) {\n if (!this.inboundSseConnection) {\n void this.openInboundSse();\n }\n return;\n }\n if (!response.ok) {\n const text = await response.text().catch(() => null);\n let errorMessage = `MCP HTTP Transport Error: POSTing to endpoint (HTTP ${response.status}): ${text}`;\n if (response.status === 404) {\n if (sessionIdForRequest) {\n this.expireSessionId(sessionIdForRequest);\n errorMessage += \". The MCP session expired. Create a new client without `initialSessionId` to start a fresh session\";\n } else {\n errorMessage += \". This server does not support HTTP transport. Try using `sse` transport instead\";\n }\n }\n const error2 = new MCPClientError({\n message: errorMessage,\n statusCode: response.status,\n url: this.url.href,\n responseBody: text != null ? text : void 0\n });\n (_c = this.onerror) == null ? void 0 : _c.call(this, error2);\n throw error2;\n }\n const isNotification = !(\"id\" in message);\n if (isNotification) {\n return;\n }\n const contentType = response.headers.get(\"content-type\") || \"\";\n if (contentType.includes(\"application/json\")) {\n const data = await response.json();\n const messages = Array.isArray(data) ? data.map(\n (message2) => JSONRPCMessageSchema.parse(message2)\n ) : [JSONRPCMessageSchema.parse(data)];\n for (const jsonRpcMessage of messages) {\n (_d = this.onmessage) == null ? void 0 : _d.call(this, jsonRpcMessage);\n }\n return;\n }\n if (contentType.includes(\"text/event-stream\")) {\n if (!response.body) {\n const error2 = new MCPClientError({\n message: \"MCP HTTP Transport Error: text/event-stream response without body\",\n statusCode: response.status,\n url: this.url.href\n });\n (_e = this.onerror) == null ? void 0 : _e.call(this, error2);\n throw error2;\n }\n const stream = response.body.pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream2());\n const reader = stream.getReader();\n const processEvents = async () => {\n var _a4, _b4, _c2;\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) return;\n const { event, data } = value;\n if (isMessageEvent2(event)) {\n try {\n const jsonRpcMessage = await parseJSONRPCMessage(data);\n (_a4 = this.onmessage) == null ? void 0 : _a4.call(this, jsonRpcMessage);\n } catch (error2) {\n const e = new MCPClientError({\n message: \"MCP HTTP Transport Error: Failed to parse message\",\n cause: error2\n });\n (_b4 = this.onerror) == null ? void 0 : _b4.call(this, e);\n }\n }\n }\n } catch (error2) {\n if (error2 instanceof Error && error2.name === \"AbortError\") {\n return;\n }\n (_c2 = this.onerror) == null ? void 0 : _c2.call(this, error2);\n }\n };\n processEvents();\n return;\n }\n const error = new MCPClientError({\n message: `MCP HTTP Transport Error: Unexpected content type: ${contentType}`,\n statusCode: response.status,\n url: this.url.href\n });\n (_f = this.onerror) == null ? void 0 : _f.call(this, error);\n throw error;\n } catch (error) {\n (_g = this.onerror) == null ? void 0 : _g.call(this, error);\n throw error;\n }\n };\n await attempt();\n }\n getNextReconnectionDelay(attempt) {\n const {\n initialReconnectionDelay,\n reconnectionDelayGrowFactor,\n maxReconnectionDelay\n } = this.reconnectionOptions;\n return Math.min(\n initialReconnectionDelay * Math.pow(reconnectionDelayGrowFactor, attempt),\n maxReconnectionDelay\n );\n }\n scheduleInboundSseReconnection() {\n var _a3;\n const { maxRetries } = this.reconnectionOptions;\n if (maxRetries > 0 && this.inboundReconnectAttempts >= maxRetries) {\n (_a3 = this.onerror) == null ? void 0 : _a3.call(\n this,\n new MCPClientError({\n message: `MCP HTTP Transport Error: Maximum reconnection attempts (${maxRetries}) exceeded.`\n })\n );\n return;\n }\n const delay = this.getNextReconnectionDelay(this.inboundReconnectAttempts);\n this.inboundReconnectAttempts += 1;\n setTimeout(async () => {\n var _a4;\n if ((_a4 = this.abortController) == null ? void 0 : _a4.signal.aborted) return;\n await this.openInboundSse(false, this.lastInboundEventId);\n }, delay);\n }\n // Open optional inbound SSE stream; best-effort and resumable\n async openInboundSse(triedAuth = false, resumeToken) {\n var _a3, _b3, _c, _d, _e, _f;\n try {\n const sessionIdForRequest = this.sessionId;\n const headers = await this.commonHeaders({\n base: {\n Accept: \"text/event-stream\"\n }\n });\n if (resumeToken) {\n headers[\"last-event-id\"] = resumeToken;\n }\n const response = await this.fetchFn(this.url.href, {\n method: \"GET\",\n headers,\n signal: (_a3 = this.abortController) == null ? void 0 : _a3.signal,\n redirect: this.redirectMode\n });\n this.applySessionIdFromResponse(response);\n if (response.status === 401 && this.authProvider && !triedAuth) {\n this.resourceMetadataUrl = extractResourceMetadataUrl(response);\n try {\n const result = await this.authorizeOnce(this.resourceMetadataUrl);\n if (result !== \"AUTHORIZED\") {\n const error = new UnauthorizedError();\n (_b3 = this.onerror) == null ? void 0 : _b3.call(this, error);\n return;\n }\n } catch (error) {\n (_c = this.onerror) == null ? void 0 : _c.call(this, error);\n return;\n }\n return this.openInboundSse(true, resumeToken);\n }\n if (response.status === 405) {\n return;\n }\n if (!response.ok || !response.body) {\n if (response.status === 404 && sessionIdForRequest) {\n this.expireSessionId(sessionIdForRequest);\n }\n const error = new MCPClientError({\n message: `MCP HTTP Transport Error: GET SSE failed: ${response.status} ${response.statusText}`,\n statusCode: response.status,\n url: this.url.href\n });\n (_d = this.onerror) == null ? void 0 : _d.call(this, error);\n return;\n }\n const stream = response.body.pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream2());\n const reader = stream.getReader();\n const processEvents = async () => {\n var _a4, _b4, _c2, _d2;\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) return;\n const { event, data, id } = value;\n if (id) {\n this.lastInboundEventId = id;\n }\n if (isMessageEvent2(event)) {\n try {\n const jsonRpcMessage = await parseJSONRPCMessage(data);\n (_a4 = this.onmessage) == null ? void 0 : _a4.call(this, jsonRpcMessage);\n } catch (error) {\n const e = new MCPClientError({\n message: \"MCP HTTP Transport Error: Failed to parse message\",\n cause: error\n });\n (_b4 = this.onerror) == null ? void 0 : _b4.call(this, e);\n }\n }\n }\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n return;\n }\n (_c2 = this.onerror) == null ? void 0 : _c2.call(this, error);\n if (!((_d2 = this.abortController) == null ? void 0 : _d2.signal.aborted)) {\n this.scheduleInboundSseReconnection();\n }\n }\n };\n this.inboundSseConnection = {\n close: () => reader.cancel()\n };\n this.inboundReconnectAttempts = 0;\n processEvents();\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n return;\n }\n (_e = this.onerror) == null ? void 0 : _e.call(this, error);\n if (!((_f = this.abortController) == null ? void 0 : _f.signal.aborted)) {\n this.scheduleInboundSseReconnection();\n }\n }\n }\n};\n\n// src/tool/mcp-transport.ts\nfunction createMcpTransport(config) {\n switch (config.type) {\n case \"sse\":\n return new SseMCPTransport(config);\n case \"http\":\n return new HttpMCPTransport(config);\n default:\n throw new MCPClientError({\n message: \"Unsupported or invalid transport configuration. If you are using a custom transport, make sure it implements the MCPTransport interface.\"\n });\n }\n}\nfunction isCustomMcpTransport(transport) {\n return \"start\" in transport && typeof transport.start === \"function\" && \"send\" in transport && typeof transport.send === \"function\" && \"close\" in transport && typeof transport.close === \"function\";\n}\n\n// src/tool/mcp-apps.ts\nimport { isJSONObject } from \"@ai-sdk/provider\";\nimport { convertBase64ToUint8Array } from \"@ai-sdk/provider-utils\";\nvar MCP_APP_EXTENSION_NAME = \"io.modelcontextprotocol/ui\";\nvar MCP_APP_MIME_TYPE = \"text/html;profile=mcp-app\";\nvar MCP_APP_LEGACY_RESOURCE_URI_META_KEY = \"ui/resourceUri\";\nvar mcpAppClientCapabilities = {\n extensions: {\n [MCP_APP_EXTENSION_NAME]: {\n mimeTypes: [MCP_APP_MIME_TYPE]\n }\n }\n};\nfunction getToolUiMeta(meta) {\n const uiMeta = meta == null ? void 0 : meta.ui;\n return isJSONObject(uiMeta) ? uiMeta : void 0;\n}\nfunction getResourceUiMeta(meta) {\n const resourceMeta = isJSONObject(meta) ? meta : void 0;\n const rawUiMeta = resourceMeta == null ? void 0 : resourceMeta.ui;\n const uiMeta = isJSONObject(rawUiMeta) ? rawUiMeta : void 0;\n return uiMeta;\n}\nfunction parseVisibility(value) {\n return Array.isArray(value) ? value.filter(\n (v) => v === \"model\" || v === \"app\"\n ) : void 0;\n}\nfunction getMCPAppToolMeta(tool2) {\n var _a3, _b3;\n const uiMeta = getToolUiMeta(tool2._meta);\n const resourceUri = (_b3 = uiMeta == null ? void 0 : uiMeta.resourceUri) != null ? _b3 : (_a3 = tool2._meta) == null ? void 0 : _a3[MCP_APP_LEGACY_RESOURCE_URI_META_KEY];\n const visibility = parseVisibility(uiMeta == null ? void 0 : uiMeta.visibility);\n if (resourceUri !== void 0) {\n if (typeof resourceUri !== \"string\" || !resourceUri.startsWith(\"ui://\")) {\n throw new Error(\n `Invalid MCP App resource URI: ${JSON.stringify(resourceUri)}`\n );\n }\n } else if (uiMeta == null) {\n return void 0;\n }\n return {\n ...uiMeta,\n ...resourceUri != null ? { resourceUri } : {},\n ...visibility != null ? { visibility } : {}\n };\n}\nfunction splitMCPAppTools(definitions) {\n var _a3;\n const modelVisibleTools = [];\n const appVisibleTools = [];\n for (const tool2 of definitions.tools) {\n const visibility = (_a3 = getMCPAppToolMeta(tool2)) == null ? void 0 : _a3.visibility;\n if (visibility == null || visibility.includes(\"model\")) {\n modelVisibleTools.push(tool2);\n }\n if ((visibility == null ? void 0 : visibility.includes(\"app\")) === true) {\n appVisibleTools.push(tool2);\n }\n }\n return {\n modelVisible: {\n ...definitions,\n tools: modelVisibleTools\n },\n appVisible: {\n ...definitions,\n tools: appVisibleTools\n }\n };\n}\nfunction getMCPAppResourceFromReadResult({\n uri,\n resource\n}) {\n const content = resource.contents.find((content2) => content2.uri === uri);\n if (content == null) {\n throw new Error(`MCP App resource not found in read result: ${uri}`);\n }\n if (content.mimeType !== MCP_APP_MIME_TYPE) {\n throw new Error(\n `Unsupported MCP App resource MIME type: ${content.mimeType}`\n );\n }\n const html = \"text\" in content && typeof content.text === \"string\" ? content.text : \"blob\" in content && typeof content.blob === \"string\" ? new TextDecoder().decode(convertBase64ToUint8Array(content.blob)) : void 0;\n if (html == null) {\n throw new Error(`Unsupported MCP App resource content format: ${uri}`);\n }\n const meta = getResourceUiMeta(content._meta);\n return { uri, mimeType: MCP_APP_MIME_TYPE, html, meta };\n}\nasync function readMCPAppResource({\n client,\n uri,\n options\n}) {\n if (!uri.startsWith(\"ui://\")) {\n throw new Error(`Unsupported MCP App resource URI: ${uri}`);\n }\n return getMCPAppResourceFromReadResult({\n uri,\n resource: await client.readResource({ uri, options })\n });\n}\n\n// src/tool/mcp-client.ts\nvar CLIENT_VERSION = \"1.0.0\";\nfunction mcpToModelOutput({\n output\n}) {\n const result = output;\n if (!(\"content\" in result) || !Array.isArray(result.content)) {\n return { type: \"json\", value: result };\n }\n const convertedContent = result.content.map(\n (part) => {\n if (part.type === \"text\" && \"text\" in part) {\n return { type: \"text\", text: part.text };\n }\n if (part.type === \"image\" && \"data\" in part && \"mimeType\" in part) {\n return {\n type: \"file\",\n mediaType: part.mimeType,\n data: { type: \"data\", data: part.data }\n };\n }\n return { type: \"text\", text: JSON.stringify(part) };\n }\n );\n return { type: \"content\", value: convertedContent };\n}\nasync function createMCPClient(config) {\n const client = new DefaultMCPClient(config);\n await client.init();\n return client;\n}\nvar DefaultMCPClient = class {\n constructor({\n transport: transportConfig,\n name: name3,\n clientName = name3 != null ? name3 : \"ai-sdk-mcp-client\",\n version = CLIENT_VERSION,\n onUncaughtError,\n capabilities,\n initialInitializeResult\n }) {\n this.requestMessageId = 0;\n this.responseHandlers = /* @__PURE__ */ new Map();\n this.serverCapabilities = {};\n this._serverInfo = { name: \"\", version: \"\" };\n this._initializeResult = {\n protocolVersion: LATEST_PROTOCOL_VERSION,\n capabilities: {},\n serverInfo: this._serverInfo\n };\n this.isClosed = true;\n this.onUncaughtError = onUncaughtError;\n this.clientCapabilities = capabilities != null ? capabilities : {};\n this.initialInitializeResult = initialInitializeResult;\n if (isCustomMcpTransport(transportConfig)) {\n this.transport = transportConfig;\n } else {\n this.transport = createMcpTransport(transportConfig);\n }\n this.transport.onclose = () => this.onClose();\n this.transport.onerror = (error) => this.onError(error);\n this.transport.onmessage = (message) => {\n if (\"method\" in message) {\n if (\"id\" in message) {\n this.onRequestMessage(message);\n } else {\n this.onError(\n new MCPClientError({\n message: \"Unsupported message type\"\n })\n );\n }\n return;\n }\n this.onResponse(message);\n };\n this.clientInfo = {\n name: clientName,\n version\n };\n }\n get serverInfo() {\n return this._serverInfo;\n }\n get initializeResult() {\n return this._initializeResult;\n }\n get instructions() {\n return this._serverInstructions;\n }\n async init() {\n try {\n await this.transport.start();\n this.isClosed = false;\n if (this.initialInitializeResult) {\n const result2 = InitializeResultSchema.parse(\n this.initialInitializeResult\n );\n this.applyInitializeResult(result2);\n return this;\n }\n const result = await this.request({\n request: {\n method: \"initialize\",\n params: {\n protocolVersion: LATEST_PROTOCOL_VERSION,\n capabilities: this.clientCapabilities,\n clientInfo: this.clientInfo\n }\n },\n resultSchema: InitializeResultSchema\n });\n if (result === void 0) {\n throw new MCPClientError({\n message: \"Server sent invalid initialize result\"\n });\n }\n this.applyInitializeResult(result);\n await this.notification({\n method: \"notifications/initialized\"\n });\n return this;\n } catch (error) {\n await this.close();\n throw error;\n }\n }\n applyInitializeResult(result) {\n if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) {\n throw new MCPClientError({\n message: `Server's protocol version is not supported: ${result.protocolVersion}`\n });\n }\n this.serverCapabilities = result.capabilities;\n this._serverInfo = result.serverInfo;\n this._initializeResult = result;\n if (this.transport.setProtocolVersion) {\n this.transport.setProtocolVersion(result.protocolVersion);\n } else {\n this.transport.protocolVersion = result.protocolVersion;\n }\n this._serverInstructions = result.instructions;\n }\n async close() {\n var _a3;\n if (this.isClosed) return;\n await ((_a3 = this.transport) == null ? void 0 : _a3.close());\n this.onClose();\n }\n assertCapability(method) {\n switch (method) {\n case \"initialize\":\n break;\n case \"completion/complete\":\n if (!this.serverCapabilities.completions) {\n throw new MCPClientError({\n message: `Server does not support completions`\n });\n }\n break;\n case \"tools/list\":\n case \"tools/call\":\n if (!this.serverCapabilities.tools) {\n throw new MCPClientError({\n message: `Server does not support tools`\n });\n }\n break;\n case \"resources/list\":\n case \"resources/read\":\n case \"resources/templates/list\":\n if (!this.serverCapabilities.resources) {\n throw new MCPClientError({\n message: `Server does not support resources`\n });\n }\n break;\n case \"prompts/list\":\n case \"prompts/get\":\n if (!this.serverCapabilities.prompts) {\n throw new MCPClientError({\n message: `Server does not support prompts`\n });\n }\n break;\n default:\n throw new MCPClientError({\n message: `Unsupported method: ${method}`\n });\n }\n }\n async request({\n request,\n resultSchema,\n options\n }) {\n return new Promise((resolve, reject) => {\n if (this.isClosed) {\n return reject(\n new MCPClientError({\n message: \"Attempted to send a request from a closed client\"\n })\n );\n }\n this.assertCapability(request.method);\n const signal = options == null ? void 0 : options.signal;\n signal == null ? void 0 : signal.throwIfAborted();\n const messageId = this.requestMessageId++;\n const jsonrpcRequest = {\n ...request,\n jsonrpc: \"2.0\",\n id: messageId\n };\n const cleanup = () => {\n this.responseHandlers.delete(messageId);\n };\n this.responseHandlers.set(messageId, (response) => {\n if (signal == null ? void 0 : signal.aborted) {\n return reject(\n new MCPClientError({\n message: \"Request was aborted\",\n cause: signal.reason\n })\n );\n }\n if (response instanceof Error) {\n return reject(response);\n }\n try {\n const result = resultSchema.parse(response.result);\n resolve(result);\n } catch (error) {\n const parseError = new MCPClientError({\n message: \"Failed to parse server response\",\n cause: error\n });\n reject(parseError);\n }\n });\n this.transport.send(jsonrpcRequest).catch((error) => {\n cleanup();\n reject(error);\n });\n });\n }\n async listTools({\n params,\n options\n } = {}) {\n return this.request({\n request: { method: \"tools/list\", params },\n resultSchema: ListToolsResultSchema,\n options\n });\n }\n async callTool({\n name: name3,\n arguments: args = {},\n options\n }) {\n try {\n return this.request({\n request: { method: \"tools/call\", params: { name: name3, arguments: args } },\n resultSchema: CallToolResultSchema,\n options\n });\n } catch (error) {\n throw error;\n }\n }\n async listResourcesInternal({\n params,\n options\n } = {}) {\n try {\n return this.request({\n request: { method: \"resources/list\", params },\n resultSchema: ListResourcesResultSchema,\n options\n });\n } catch (error) {\n throw error;\n }\n }\n async readResourceInternal({\n uri,\n options\n }) {\n try {\n return this.request({\n request: { method: \"resources/read\", params: { uri } },\n resultSchema: ReadResourceResultSchema,\n options\n });\n } catch (error) {\n throw error;\n }\n }\n async listResourceTemplatesInternal({\n options\n } = {}) {\n try {\n return this.request({\n request: { method: \"resources/templates/list\" },\n resultSchema: ListResourceTemplatesResultSchema,\n options\n });\n } catch (error) {\n throw error;\n }\n }\n async listPromptsInternal({\n params,\n options\n } = {}) {\n try {\n return this.request({\n request: { method: \"prompts/list\", params },\n resultSchema: ListPromptsResultSchema,\n options\n });\n } catch (error) {\n throw error;\n }\n }\n async getPromptInternal({\n name: name3,\n args,\n options\n }) {\n try {\n return this.request({\n request: { method: \"prompts/get\", params: { name: name3, arguments: args } },\n resultSchema: GetPromptResultSchema,\n options\n });\n } catch (error) {\n throw error;\n }\n }\n async completeInternal({\n options,\n ...params\n }) {\n return this.request({\n request: { method: \"completion/complete\", params },\n resultSchema: CompleteResultSchema,\n options\n });\n }\n async notification(notification) {\n const jsonrpcNotification = {\n ...notification,\n jsonrpc: \"2.0\"\n };\n await this.transport.send(jsonrpcNotification);\n }\n /**\n * Returns a set of AI SDK tools from the MCP server.\n * This fetches tool definitions and wraps them with execute functions.\n * @returns A record of tool names to their implementations\n */\n async tools({\n schemas = \"automatic\"\n } = {}) {\n const definitions = await this.listTools();\n return this.toolsFromDefinitions(definitions, {\n schemas\n });\n }\n /**\n * Creates AI SDK tools from tool definitions without fetching from the server.\n */\n toolsFromDefinitions(definitions, { schemas = \"automatic\" } = {}) {\n var _a3, _b3;\n const tools = {};\n for (const {\n name: name3,\n title,\n description,\n inputSchema,\n annotations,\n _meta\n } of definitions.tools) {\n const resolvedTitle = title != null ? title : annotations == null ? void 0 : annotations.title;\n if (schemas !== \"automatic\" && !Object.prototype.hasOwnProperty.call(schemas, name3)) {\n continue;\n }\n const self = this;\n const outputSchema = schemas !== \"automatic\" ? (_a3 = schemas[name3]) == null ? void 0 : _a3.outputSchema : void 0;\n const appMeta = getMCPAppToolMeta({ _meta });\n const metadata = {\n clientName: this.clientInfo.name,\n toolName: name3,\n ...resolvedTitle != null ? { title: resolvedTitle } : {},\n ...(appMeta == null ? void 0 : appMeta.resourceUri) != null ? {\n app: {\n ...appMeta,\n mimeType: MCP_APP_MIME_TYPE\n }\n } : {}\n };\n const execute = async (args, options) => {\n var _a4;\n (_a4 = options == null ? void 0 : options.abortSignal) == null ? void 0 : _a4.throwIfAborted();\n const result = await self.callTool({\n name: name3,\n arguments: args,\n options: { signal: options == null ? void 0 : options.abortSignal }\n });\n if (result.isError) {\n return result;\n }\n if (outputSchema != null) {\n return self.extractStructuredContent(result, outputSchema, name3);\n }\n return result;\n };\n const toolWithExecute = schemas === \"automatic\" ? dynamicTool({\n description,\n title: resolvedTitle,\n metadata,\n inputSchema: jsonSchema({\n ...inputSchema,\n properties: (_b3 = inputSchema.properties) != null ? _b3 : {},\n additionalProperties: false\n }),\n execute,\n toModelOutput: mcpToModelOutput\n }) : tool({\n description,\n title: resolvedTitle,\n metadata,\n inputSchema: schemas[name3].inputSchema,\n ...outputSchema != null ? { outputSchema } : {},\n execute,\n toModelOutput: mcpToModelOutput\n });\n tools[name3] = { ...toolWithExecute, _meta };\n }\n return tools;\n }\n /**\n * Extracts and validates structuredContent from a tool result.\n */\n async extractStructuredContent(result, outputSchema, toolName) {\n if (\"structuredContent\" in result && result.structuredContent != null) {\n const validationResult = await safeValidateTypes({\n value: result.structuredContent,\n schema: asSchema(outputSchema)\n });\n if (!validationResult.success) {\n throw new MCPClientError({\n message: `Tool \"${toolName}\" returned structuredContent that does not match the expected outputSchema`,\n cause: validationResult.error\n });\n }\n return validationResult.value;\n }\n if (\"content\" in result && Array.isArray(result.content)) {\n const textContent = result.content.find((c) => c.type === \"text\");\n if (textContent && \"text\" in textContent) {\n const parseResult = await safeParseJSON({\n text: textContent.text,\n schema: outputSchema\n });\n if (!parseResult.success) {\n throw new MCPClientError({\n message: `Tool \"${toolName}\" returned content that does not match the expected outputSchema`,\n cause: parseResult.error\n });\n }\n return parseResult.value;\n }\n }\n throw new MCPClientError({\n message: `Tool \"${toolName}\" did not return structuredContent or parseable text content`\n });\n }\n listResources({\n params,\n options\n } = {}) {\n return this.listResourcesInternal({ params, options });\n }\n readResource({\n uri,\n options\n }) {\n return this.readResourceInternal({ uri, options });\n }\n listResourceTemplates({\n options\n } = {}) {\n return this.listResourceTemplatesInternal({ options });\n }\n experimental_listPrompts({\n params,\n options\n } = {}) {\n return this.listPromptsInternal({ params, options });\n }\n experimental_getPrompt({\n name: name3,\n arguments: args,\n options\n }) {\n return this.getPromptInternal({ name: name3, args, options });\n }\n complete(args) {\n return this.completeInternal(args);\n }\n onElicitationRequest(schema, handler) {\n if (schema !== ElicitationRequestSchema) {\n throw new MCPClientError({\n message: \"Unsupported request schema. Only ElicitationRequestSchema is supported.\"\n });\n }\n this.elicitationRequestHandler = handler;\n }\n async onRequestMessage(request) {\n try {\n if (request.method === \"ping\") {\n await this.transport.send({\n jsonrpc: \"2.0\",\n id: request.id,\n result: {}\n });\n return;\n }\n if (request.method !== \"elicitation/create\") {\n await this.transport.send({\n jsonrpc: \"2.0\",\n id: request.id,\n error: {\n code: -32601,\n message: `Unsupported request method: ${request.method}`\n }\n });\n return;\n }\n if (!this.elicitationRequestHandler) {\n await this.transport.send({\n jsonrpc: \"2.0\",\n id: request.id,\n error: {\n code: -32601,\n message: \"No elicitation handler registered on client\"\n }\n });\n return;\n }\n const parsedRequest = ElicitationRequestSchema.safeParse({\n method: request.method,\n params: request.params\n });\n if (!parsedRequest.success) {\n await this.transport.send({\n jsonrpc: \"2.0\",\n id: request.id,\n error: {\n code: -32602,\n message: `Invalid elicitation request: ${parsedRequest.error.message}`,\n data: parsedRequest.error.issues\n }\n });\n return;\n }\n try {\n const result = await this.elicitationRequestHandler(parsedRequest.data);\n const validatedResult = ElicitResultSchema.parse(result);\n await this.transport.send({\n jsonrpc: \"2.0\",\n id: request.id,\n result: validatedResult\n });\n } catch (error) {\n await this.transport.send({\n jsonrpc: \"2.0\",\n id: request.id,\n error: {\n code: -32603,\n message: error instanceof Error ? error.message : \"Failed to handle elicitation request\"\n }\n });\n this.onError(error);\n }\n } catch (error) {\n this.onError(error);\n }\n }\n onClose() {\n if (this.isClosed) return;\n this.isClosed = true;\n const error = new MCPClientError({\n message: \"Connection closed\"\n });\n for (const handler of this.responseHandlers.values()) {\n handler(error);\n }\n this.responseHandlers.clear();\n }\n onError(error) {\n if (this.onUncaughtError) {\n this.onUncaughtError(error);\n }\n }\n onResponse(response) {\n const messageId = Number(response.id);\n const handler = this.responseHandlers.get(messageId);\n if (handler === void 0) {\n throw new MCPClientError({\n message: `Protocol error: Received a response for an unknown message ID: ${JSON.stringify(\n response\n )}`\n });\n }\n this.responseHandlers.delete(messageId);\n handler(\n \"result\" in response ? response : new MCPClientError({\n message: response.error.message,\n code: response.error.code,\n data: response.error.data,\n cause: response.error\n })\n );\n }\n};\nexport {\n ElicitResultSchema,\n ElicitationRequestSchema,\n MCP_APP_MIME_TYPE,\n UnauthorizedError,\n auth,\n createMCPClient,\n createMCPClient as experimental_createMCPClient,\n mcpAppClientCapabilities,\n readMCPAppResource,\n splitMCPAppTools\n};\n//# sourceMappingURL=index.js.map","// src/tool/json-rpc-message.ts\nimport { parseJSON } from \"@ai-sdk/provider-utils\";\nimport { z as z2 } from \"zod/v4\";\n\n// src/tool/types.ts\nimport { z } from \"zod/v4\";\nvar ToolMetaSchema = z.optional(z.record(z.string(), z.unknown()));\nvar ClientOrServerImplementationSchema = z.looseObject({\n name: z.string(),\n version: z.string(),\n title: z.optional(z.string())\n});\nvar BaseParamsSchema = z.looseObject({\n _meta: z.optional(z.object({}).loose())\n});\nvar ResultSchema = BaseParamsSchema;\nvar RequestSchema = z.object({\n method: z.string(),\n params: z.optional(BaseParamsSchema)\n});\nvar ElicitationCapabilitySchema = z.object({\n applyDefaults: z.optional(z.boolean())\n}).loose();\nvar ServerCapabilitiesSchema = z.looseObject({\n experimental: z.optional(z.object({}).loose()),\n logging: z.optional(z.object({}).loose()),\n completions: z.optional(z.object({}).loose()),\n prompts: z.optional(\n z.looseObject({\n listChanged: z.optional(z.boolean())\n })\n ),\n resources: z.optional(\n z.looseObject({\n subscribe: z.optional(z.boolean()),\n listChanged: z.optional(z.boolean())\n })\n ),\n tools: z.optional(\n z.looseObject({\n listChanged: z.optional(z.boolean())\n })\n ),\n elicitation: z.optional(ElicitationCapabilitySchema)\n});\nvar ClientCapabilitiesSchema = z.object({\n elicitation: z.optional(ElicitationCapabilitySchema)\n}).loose();\nvar InitializeResultSchema = ResultSchema.extend({\n protocolVersion: z.string(),\n capabilities: ServerCapabilitiesSchema,\n serverInfo: ClientOrServerImplementationSchema,\n instructions: z.optional(z.string())\n});\nvar PaginatedResultSchema = ResultSchema.extend({\n nextCursor: z.optional(z.string())\n});\nvar ToolSchema = z.object({\n name: z.string(),\n /**\n * @see https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool\n */\n title: z.optional(z.string()),\n description: z.optional(z.string()),\n inputSchema: z.object({\n type: z.literal(\"object\"),\n properties: z.optional(z.object({}).loose())\n }).loose(),\n /**\n * @see https://modelcontextprotocol.io/specification/2025-06-18/server/tools#output-schema\n */\n outputSchema: z.optional(z.object({}).loose()),\n annotations: z.optional(\n z.object({\n title: z.optional(z.string())\n }).loose()\n ),\n _meta: ToolMetaSchema\n}).loose();\nvar ListToolsResultSchema = PaginatedResultSchema.extend({\n tools: z.array(ToolSchema)\n});\nvar TextContentSchema = z.object({\n type: z.literal(\"text\"),\n text: z.string()\n}).loose();\nvar ImageContentSchema = z.object({\n type: z.literal(\"image\"),\n data: z.base64(),\n mimeType: z.string()\n}).loose();\nvar ResourceSchema = z.object({\n uri: z.string(),\n name: z.string(),\n title: z.optional(z.string()),\n description: z.optional(z.string()),\n mimeType: z.optional(z.string()),\n size: z.optional(z.number())\n}).loose();\nvar ListResourcesResultSchema = PaginatedResultSchema.extend({\n resources: z.array(ResourceSchema)\n});\nvar ResourceContentsSchema = z.object({\n /**\n * The URI of this resource.\n */\n uri: z.string(),\n /**\n * Optional display name of the resource content.\n */\n name: z.optional(z.string()),\n /**\n * Optional human readable title.\n */\n title: z.optional(z.string()),\n /**\n * The MIME type of this resource, if known.\n */\n mimeType: z.optional(z.string())\n}).loose();\nvar TextResourceContentsSchema = ResourceContentsSchema.extend({\n text: z.string()\n});\nvar BlobResourceContentsSchema = ResourceContentsSchema.extend({\n blob: z.base64()\n});\nvar EmbeddedResourceSchema = z.object({\n type: z.literal(\"resource\"),\n resource: z.union([TextResourceContentsSchema, BlobResourceContentsSchema])\n}).loose();\nvar ResourceLinkContentSchema = z.object({\n type: z.literal(\"resource_link\"),\n uri: z.string(),\n name: z.string(),\n description: z.optional(z.string()),\n mimeType: z.optional(z.string())\n}).loose();\nvar CallToolResultSchema = ResultSchema.extend({\n content: z.array(\n z.union([\n TextContentSchema,\n ImageContentSchema,\n EmbeddedResourceSchema,\n ResourceLinkContentSchema\n ])\n ),\n /**\n * @see https://modelcontextprotocol.io/specification/2025-06-18/server/tools#structured-content\n */\n structuredContent: z.optional(z.unknown()),\n isError: z.boolean().default(false).optional()\n}).or(\n ResultSchema.extend({\n toolResult: z.unknown()\n })\n);\nvar ResourceTemplateSchema = z.object({\n uriTemplate: z.string(),\n name: z.string(),\n title: z.optional(z.string()),\n description: z.optional(z.string()),\n mimeType: z.optional(z.string())\n}).loose();\nvar ListResourceTemplatesResultSchema = ResultSchema.extend({\n resourceTemplates: z.array(ResourceTemplateSchema)\n});\nvar ReadResourceResultSchema = ResultSchema.extend({\n contents: z.array(\n z.union([TextResourceContentsSchema, BlobResourceContentsSchema])\n )\n});\nvar PromptReferenceSchema = z.object({\n type: z.literal(\"ref/prompt\"),\n name: z.string()\n}).loose();\nvar ResourceReferenceSchema = z.object({\n type: z.literal(\"ref/resource\"),\n uri: z.string()\n}).loose();\nvar CompletionArgumentSchema = z.object({\n name: z.string(),\n value: z.string()\n}).loose();\nvar CompleteRequestParamsSchema = BaseParamsSchema.extend({\n ref: z.union([PromptReferenceSchema, ResourceReferenceSchema]),\n argument: CompletionArgumentSchema,\n context: z.optional(\n z.object({\n arguments: z.record(z.string(), z.string())\n }).loose()\n )\n});\nvar CompleteResultSchema = ResultSchema.extend({\n completion: z.object({\n values: z.array(z.string()).max(100),\n total: z.optional(z.number().int()),\n hasMore: z.optional(z.boolean())\n }).loose()\n});\nvar PromptArgumentSchema = z.object({\n name: z.string(),\n description: z.optional(z.string()),\n required: z.optional(z.boolean())\n}).loose();\nvar PromptSchema = z.object({\n name: z.string(),\n title: z.optional(z.string()),\n description: z.optional(z.string()),\n arguments: z.optional(z.array(PromptArgumentSchema))\n}).loose();\nvar ListPromptsResultSchema = PaginatedResultSchema.extend({\n prompts: z.array(PromptSchema)\n});\nvar PromptMessageSchema = z.object({\n role: z.union([z.literal(\"user\"), z.literal(\"assistant\")]),\n content: z.union([\n TextContentSchema,\n ImageContentSchema,\n EmbeddedResourceSchema,\n ResourceLinkContentSchema\n ])\n}).loose();\nvar GetPromptResultSchema = ResultSchema.extend({\n description: z.optional(z.string()),\n messages: z.array(PromptMessageSchema)\n});\nvar ElicitationRequestParamsSchema = BaseParamsSchema.extend({\n message: z.string(),\n requestedSchema: z.unknown()\n});\nvar ElicitationRequestSchema = RequestSchema.extend({\n method: z.literal(\"elicitation/create\"),\n params: ElicitationRequestParamsSchema\n});\nvar ElicitResultSchema = ResultSchema.extend({\n action: z.union([\n z.literal(\"accept\"),\n z.literal(\"decline\"),\n z.literal(\"cancel\")\n ]),\n content: z.optional(z.record(z.string(), z.unknown()))\n});\n\n// src/tool/json-rpc-message.ts\nvar JSONRPC_VERSION = \"2.0\";\nvar JSONRPCRequestSchema = z2.object({\n jsonrpc: z2.literal(JSONRPC_VERSION),\n id: z2.union([z2.string(), z2.number().int()])\n}).merge(RequestSchema).strict();\nvar JSONRPCResponseSchema = z2.object({\n jsonrpc: z2.literal(JSONRPC_VERSION),\n id: z2.union([z2.string(), z2.number().int()]),\n result: ResultSchema\n}).strict();\nvar JSONRPCErrorSchema = z2.object({\n jsonrpc: z2.literal(JSONRPC_VERSION),\n id: z2.union([z2.string(), z2.number().int()]),\n error: z2.object({\n code: z2.number().int(),\n message: z2.string(),\n data: z2.optional(z2.unknown())\n })\n}).strict();\nvar JSONRPCNotificationSchema = z2.object({\n jsonrpc: z2.literal(JSONRPC_VERSION)\n}).merge(\n z2.object({\n method: z2.string(),\n params: z2.optional(BaseParamsSchema)\n })\n).strict();\nvar JSONRPCMessageSchema = z2.union([\n JSONRPCRequestSchema,\n JSONRPCNotificationSchema,\n JSONRPCResponseSchema,\n JSONRPCErrorSchema\n]);\nasync function parseJSONRPCMessage(text) {\n return JSONRPCMessageSchema.parse(await parseJSON({ text }));\n}\n\n// src/error/mcp-client-error.ts\nimport { AISDKError } from \"@ai-sdk/provider\";\nvar name = \"AI_MCPClientError\";\nvar marker = `vercel.ai.error.${name}`;\nvar symbol = Symbol.for(marker);\nvar _a, _b;\nvar MCPClientError = class extends (_b = AISDKError, _a = symbol, _b) {\n constructor({\n name: name2 = \"MCPClientError\",\n message,\n cause,\n data,\n code,\n statusCode,\n url,\n responseBody\n }) {\n super({ name: name2, message, cause });\n this[_a] = true;\n this.data = data;\n this.code = code;\n this.statusCode = statusCode;\n this.url = url;\n this.responseBody = responseBody;\n }\n static isInstance(error) {\n return AISDKError.hasMarker(error, marker);\n }\n};\n\n// src/tool/mcp-stdio/create-child-process.ts\nimport { spawn } from \"child_process\";\n\n// src/tool/mcp-stdio/get-environment.ts\nfunction getEnvironment(customEnv) {\n const DEFAULT_INHERITED_ENV_VARS = globalThis.process.platform === \"win32\" ? [\n \"APPDATA\",\n \"HOMEDRIVE\",\n \"HOMEPATH\",\n \"LOCALAPPDATA\",\n \"PATH\",\n \"PROCESSOR_ARCHITECTURE\",\n \"SYSTEMDRIVE\",\n \"SYSTEMROOT\",\n \"TEMP\",\n \"USERNAME\",\n \"USERPROFILE\"\n ] : [\"HOME\", \"LOGNAME\", \"PATH\", \"SHELL\", \"TERM\", \"USER\"];\n const env = customEnv ? { ...customEnv } : {};\n for (const key of DEFAULT_INHERITED_ENV_VARS) {\n const value = globalThis.process.env[key];\n if (value === void 0) {\n continue;\n }\n if (value.startsWith(\"()\")) {\n continue;\n }\n env[key] = value;\n }\n return env;\n}\n\n// src/tool/mcp-stdio/create-child-process.ts\nfunction createChildProcess(config, signal) {\n var _a2, _b2;\n return spawn(config.command, (_a2 = config.args) != null ? _a2 : [], {\n env: getEnvironment(config.env),\n stdio: [\"pipe\", \"pipe\", (_b2 = config.stderr) != null ? _b2 : \"inherit\"],\n shell: false,\n signal,\n windowsHide: globalThis.process.platform === \"win32\" && isElectron(),\n cwd: config.cwd\n });\n}\nfunction isElectron() {\n return \"type\" in globalThis.process;\n}\n\n// src/tool/mcp-stdio/mcp-stdio-transport.ts\nvar StdioMCPTransport = class {\n constructor(server) {\n this.abortController = new AbortController();\n this.readBuffer = new ReadBuffer();\n this.serverParams = server;\n }\n async start() {\n if (this.process) {\n throw new MCPClientError({\n message: \"StdioMCPTransport already started.\"\n });\n }\n return new Promise((resolve, reject) => {\n var _a2, _b2, _c, _d;\n try {\n const process = createChildProcess(\n this.serverParams,\n this.abortController.signal\n );\n this.process = process;\n this.process.on(\"error\", (error) => {\n var _a3, _b3;\n if (error.name === \"AbortError\") {\n (_a3 = this.onclose) == null ? void 0 : _a3.call(this);\n return;\n }\n reject(error);\n (_b3 = this.onerror) == null ? void 0 : _b3.call(this, error);\n });\n this.process.on(\"spawn\", () => {\n resolve();\n });\n this.process.on(\"close\", (_code) => {\n var _a3;\n this.process = void 0;\n (_a3 = this.onclose) == null ? void 0 : _a3.call(this);\n });\n (_a2 = this.process.stdin) == null ? void 0 : _a2.on(\"error\", (error) => {\n var _a3;\n (_a3 = this.onerror) == null ? void 0 : _a3.call(this, error);\n });\n (_b2 = this.process.stdout) == null ? void 0 : _b2.on(\"data\", (chunk) => {\n this.readBuffer.append(chunk);\n void this.processReadBuffer();\n });\n (_c = this.process.stdout) == null ? void 0 : _c.on(\"error\", (error) => {\n var _a3;\n (_a3 = this.onerror) == null ? void 0 : _a3.call(this, error);\n });\n } catch (error) {\n reject(error);\n (_d = this.onerror) == null ? void 0 : _d.call(this, error);\n }\n });\n }\n async processReadBuffer() {\n var _a2, _b2;\n while (true) {\n const line = this.readBuffer.readLine();\n if (line === null) {\n break;\n }\n try {\n const message = await deserializeMessage(line);\n (_a2 = this.onmessage) == null ? void 0 : _a2.call(this, message);\n } catch (error) {\n (_b2 = this.onerror) == null ? void 0 : _b2.call(this, error);\n }\n }\n }\n async close() {\n this.abortController.abort();\n this.process = void 0;\n this.readBuffer.clear();\n }\n send(message) {\n return new Promise((resolve) => {\n var _a2;\n if (!((_a2 = this.process) == null ? void 0 : _a2.stdin)) {\n throw new MCPClientError({\n message: \"StdioClientTransport not connected\"\n });\n }\n const json = serializeMessage(message);\n if (this.process.stdin.write(json)) {\n resolve();\n } else {\n this.process.stdin.once(\"drain\", resolve);\n }\n });\n }\n};\nvar ReadBuffer = class {\n append(chunk) {\n this.buffer = this.buffer ? Buffer.concat([this.buffer, chunk]) : chunk;\n }\n readLine() {\n if (!this.buffer) return null;\n const index = this.buffer.indexOf(\"\\n\");\n if (index === -1) {\n return null;\n }\n const line = this.buffer.toString(\"utf8\", 0, index);\n this.buffer = this.buffer.subarray(index + 1);\n return line;\n }\n clear() {\n this.buffer = void 0;\n }\n};\nfunction serializeMessage(message) {\n return JSON.stringify(message) + \"\\n\";\n}\nasync function deserializeMessage(line) {\n return parseJSONRPCMessage(line);\n}\nexport {\n StdioMCPTransport as Experimental_StdioMCPTransport\n};\n//# sourceMappingURL=index.js.map","import * as z from 'zod/v4';\nexport const LATEST_PROTOCOL_VERSION = '2025-11-25';\nexport const DEFAULT_NEGOTIATED_PROTOCOL_VERSION = '2025-03-26';\nexport const SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, '2025-06-18', '2025-03-26', '2024-11-05', '2024-10-07'];\nexport const RELATED_TASK_META_KEY = 'io.modelcontextprotocol/related-task';\n/* JSON-RPC types */\nexport const JSONRPC_VERSION = '2.0';\n/**\n * Assert 'object' type schema.\n *\n * @internal\n */\nconst AssertObjectSchema = z.custom((v) => v !== null && (typeof v === 'object' || typeof v === 'function'));\n/**\n * A progress token, used to associate progress notifications with the original request.\n */\nexport const ProgressTokenSchema = z.union([z.string(), z.number().int()]);\n/**\n * An opaque token used to represent a cursor for pagination.\n */\nexport const CursorSchema = z.string();\n/**\n * Task creation parameters, used to ask that the server create a task to represent a request.\n */\nexport const TaskCreationParamsSchema = z.looseObject({\n /**\n * Requested duration in milliseconds to retain task from creation.\n */\n ttl: z.number().optional(),\n /**\n * Time in milliseconds to wait between task status requests.\n */\n pollInterval: z.number().optional()\n});\nexport const TaskMetadataSchema = z.object({\n ttl: z.number().optional()\n});\n/**\n * Metadata for associating messages with a task.\n * Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`.\n */\nexport const RelatedTaskMetadataSchema = z.object({\n taskId: z.string()\n});\nconst RequestMetaSchema = z.looseObject({\n /**\n * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.\n */\n progressToken: ProgressTokenSchema.optional(),\n /**\n * If specified, this request is related to the provided task.\n */\n [RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()\n});\n/**\n * Common params for any request.\n */\nconst BaseRequestParamsSchema = z.object({\n /**\n * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.\n */\n _meta: RequestMetaSchema.optional()\n});\n/**\n * Common params for any task-augmented request.\n */\nexport const TaskAugmentedRequestParamsSchema = BaseRequestParamsSchema.extend({\n /**\n * If specified, the caller is requesting task-augmented execution for this request.\n * The request will return a CreateTaskResult immediately, and the actual result can be\n * retrieved later via tasks/result.\n *\n * Task augmentation is subject to capability negotiation - receivers MUST declare support\n * for task augmentation of specific request types in their capabilities.\n */\n task: TaskMetadataSchema.optional()\n});\n/**\n * Checks if a value is a valid TaskAugmentedRequestParams.\n * @param value - The value to check.\n *\n * @returns True if the value is a valid TaskAugmentedRequestParams, false otherwise.\n */\nexport const isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;\nexport const RequestSchema = z.object({\n method: z.string(),\n params: BaseRequestParamsSchema.loose().optional()\n});\nconst NotificationsParamsSchema = z.object({\n /**\n * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)\n * for notes on _meta usage.\n */\n _meta: RequestMetaSchema.optional()\n});\nexport const NotificationSchema = z.object({\n method: z.string(),\n params: NotificationsParamsSchema.loose().optional()\n});\nexport const ResultSchema = z.looseObject({\n /**\n * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)\n * for notes on _meta usage.\n */\n _meta: RequestMetaSchema.optional()\n});\n/**\n * A uniquely identifying ID for a request in JSON-RPC.\n */\nexport const RequestIdSchema = z.union([z.string(), z.number().int()]);\n/**\n * A request that expects a response.\n */\nexport const JSONRPCRequestSchema = z\n .object({\n jsonrpc: z.literal(JSONRPC_VERSION),\n id: RequestIdSchema,\n ...RequestSchema.shape\n})\n .strict();\nexport const isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;\n/**\n * A notification which does not expect a response.\n */\nexport const JSONRPCNotificationSchema = z\n .object({\n jsonrpc: z.literal(JSONRPC_VERSION),\n ...NotificationSchema.shape\n})\n .strict();\nexport const isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;\n/**\n * A successful (non-error) response to a request.\n */\nexport const JSONRPCResultResponseSchema = z\n .object({\n jsonrpc: z.literal(JSONRPC_VERSION),\n id: RequestIdSchema,\n result: ResultSchema\n})\n .strict();\n/**\n * Checks if a value is a valid JSONRPCResultResponse.\n * @param value - The value to check.\n *\n * @returns True if the value is a valid JSONRPCResultResponse, false otherwise.\n */\nexport const isJSONRPCResultResponse = (value) => JSONRPCResultResponseSchema.safeParse(value).success;\n/**\n * @deprecated Use {@link isJSONRPCResultResponse} instead.\n *\n * Please note that {@link JSONRPCResponse} is a union of {@link JSONRPCResultResponse} and {@link JSONRPCErrorResponse} as per the updated JSON-RPC specification. (was previously just {@link JSONRPCResultResponse})\n */\nexport const isJSONRPCResponse = isJSONRPCResultResponse;\n/**\n * Error codes defined by the JSON-RPC specification.\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n // SDK error codes\n ErrorCode[ErrorCode[\"ConnectionClosed\"] = -32000] = \"ConnectionClosed\";\n ErrorCode[ErrorCode[\"RequestTimeout\"] = -32001] = \"RequestTimeout\";\n // Standard JSON-RPC error codes\n ErrorCode[ErrorCode[\"ParseError\"] = -32700] = \"ParseError\";\n ErrorCode[ErrorCode[\"InvalidRequest\"] = -32600] = \"InvalidRequest\";\n ErrorCode[ErrorCode[\"MethodNotFound\"] = -32601] = \"MethodNotFound\";\n ErrorCode[ErrorCode[\"InvalidParams\"] = -32602] = \"InvalidParams\";\n ErrorCode[ErrorCode[\"InternalError\"] = -32603] = \"InternalError\";\n // MCP-specific error codes\n ErrorCode[ErrorCode[\"UrlElicitationRequired\"] = -32042] = \"UrlElicitationRequired\";\n})(ErrorCode || (ErrorCode = {}));\n/**\n * A response to a request that indicates an error occurred.\n */\nexport const JSONRPCErrorResponseSchema = z\n .object({\n jsonrpc: z.literal(JSONRPC_VERSION),\n id: RequestIdSchema.optional(),\n error: z.object({\n /**\n * The error type that occurred.\n */\n code: z.number().int(),\n /**\n * A short description of the error. The message SHOULD be limited to a concise single sentence.\n */\n message: z.string(),\n /**\n * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).\n */\n data: z.unknown().optional()\n })\n})\n .strict();\n/**\n * @deprecated Use {@link JSONRPCErrorResponseSchema} instead.\n */\nexport const JSONRPCErrorSchema = JSONRPCErrorResponseSchema;\n/**\n * Checks if a value is a valid JSONRPCErrorResponse.\n * @param value - The value to check.\n *\n * @returns True if the value is a valid JSONRPCErrorResponse, false otherwise.\n */\nexport const isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;\n/**\n * @deprecated Use {@link isJSONRPCErrorResponse} instead.\n */\nexport const isJSONRPCError = isJSONRPCErrorResponse;\nexport const JSONRPCMessageSchema = z.union([\n JSONRPCRequestSchema,\n JSONRPCNotificationSchema,\n JSONRPCResultResponseSchema,\n JSONRPCErrorResponseSchema\n]);\nexport const JSONRPCResponseSchema = z.union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);\n/* Empty result */\n/**\n * A response that indicates success but carries no data.\n */\nexport const EmptyResultSchema = ResultSchema.strict();\nexport const CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({\n /**\n * The ID of the request to cancel.\n *\n * This MUST correspond to the ID of a request previously issued in the same direction.\n */\n requestId: RequestIdSchema.optional(),\n /**\n * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.\n */\n reason: z.string().optional()\n});\n/* Cancellation */\n/**\n * This notification can be sent by either side to indicate that it is cancelling a previously-issued request.\n *\n * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.\n *\n * This notification indicates that the result will be unused, so any associated processing SHOULD cease.\n *\n * A client MUST NOT attempt to cancel its `initialize` request.\n */\nexport const CancelledNotificationSchema = NotificationSchema.extend({\n method: z.literal('notifications/cancelled'),\n params: CancelledNotificationParamsSchema\n});\n/* Base Metadata */\n/**\n * Icon schema for use in tools, prompts, resources, and implementations.\n */\nexport const IconSchema = z.object({\n /**\n * URL or data URI for the icon.\n */\n src: z.string(),\n /**\n * Optional MIME type for the icon.\n */\n mimeType: z.string().optional(),\n /**\n * Optional array of strings that specify sizes at which the icon can be used.\n * Each string should be in WxH format (e.g., `\"48x48\"`, `\"96x96\"`) or `\"any\"` for scalable formats like SVG.\n *\n * If not provided, the client should assume that the icon can be used at any size.\n */\n sizes: z.array(z.string()).optional(),\n /**\n * Optional specifier for the theme this icon is designed for. `light` indicates\n * the icon is designed to be used with a light background, and `dark` indicates\n * the icon is designed to be used with a dark background.\n *\n * If not provided, the client should assume the icon can be used with any theme.\n */\n theme: z.enum(['light', 'dark']).optional()\n});\n/**\n * Base schema to add `icons` property.\n *\n */\nexport const IconsSchema = z.object({\n /**\n * Optional set of sized icons that the client can display in a user interface.\n *\n * Clients that support rendering icons MUST support at least the following MIME types:\n * - `image/png` - PNG images (safe, universal compatibility)\n * - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)\n *\n * Clients that support rendering icons SHOULD also support:\n * - `image/svg+xml` - SVG images (scalable but requires security precautions)\n * - `image/webp` - WebP images (modern, efficient format)\n */\n icons: z.array(IconSchema).optional()\n});\n/**\n * Base metadata interface for common properties across resources, tools, prompts, and implementations.\n */\nexport const BaseMetadataSchema = z.object({\n /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */\n name: z.string(),\n /**\n * Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\n * even by those unfamiliar with domain-specific terminology.\n *\n * If not provided, the name should be used for display (except for Tool,\n * where `annotations.title` should be given precedence over using `name`,\n * if present).\n */\n title: z.string().optional()\n});\n/* Initialization */\n/**\n * Describes the name and version of an MCP implementation.\n */\nexport const ImplementationSchema = BaseMetadataSchema.extend({\n ...BaseMetadataSchema.shape,\n ...IconsSchema.shape,\n version: z.string(),\n /**\n * An optional URL of the website for this implementation.\n */\n websiteUrl: z.string().optional(),\n /**\n * An optional human-readable description of what this implementation does.\n *\n * This can be used by clients or servers to provide context about their purpose\n * and capabilities. For example, a server might describe the types of resources\n * or tools it provides, while a client might describe its intended use case.\n */\n description: z.string().optional()\n});\nconst FormElicitationCapabilitySchema = z.intersection(z.object({\n applyDefaults: z.boolean().optional()\n}), z.record(z.string(), z.unknown()));\nconst ElicitationCapabilitySchema = z.preprocess(value => {\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n if (Object.keys(value).length === 0) {\n return { form: {} };\n }\n }\n return value;\n}, z.intersection(z.object({\n form: FormElicitationCapabilitySchema.optional(),\n url: AssertObjectSchema.optional()\n}), z.record(z.string(), z.unknown()).optional()));\n/**\n * Task capabilities for clients, indicating which request types support task creation.\n */\nexport const ClientTasksCapabilitySchema = z.looseObject({\n /**\n * Present if the client supports listing tasks.\n */\n list: AssertObjectSchema.optional(),\n /**\n * Present if the client supports cancelling tasks.\n */\n cancel: AssertObjectSchema.optional(),\n /**\n * Capabilities for task creation on specific request types.\n */\n requests: z\n .looseObject({\n /**\n * Task support for sampling requests.\n */\n sampling: z\n .looseObject({\n createMessage: AssertObjectSchema.optional()\n })\n .optional(),\n /**\n * Task support for elicitation requests.\n */\n elicitation: z\n .looseObject({\n create: AssertObjectSchema.optional()\n })\n .optional()\n })\n .optional()\n});\n/**\n * Task capabilities for servers, indicating which request types support task creation.\n */\nexport const ServerTasksCapabilitySchema = z.looseObject({\n /**\n * Present if the server supports listing tasks.\n */\n list: AssertObjectSchema.optional(),\n /**\n * Present if the server supports cancelling tasks.\n */\n cancel: AssertObjectSchema.optional(),\n /**\n * Capabilities for task creation on specific request types.\n */\n requests: z\n .looseObject({\n /**\n * Task support for tool requests.\n */\n tools: z\n .looseObject({\n call: AssertObjectSchema.optional()\n })\n .optional()\n })\n .optional()\n});\n/**\n * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.\n */\nexport const ClientCapabilitiesSchema = z.object({\n /**\n * Experimental, non-standard capabilities that the client supports.\n */\n experimental: z.record(z.string(), AssertObjectSchema).optional(),\n /**\n * Present if the client supports sampling from an LLM.\n */\n sampling: z\n .object({\n /**\n * Present if the client supports context inclusion via includeContext parameter.\n * If not declared, servers SHOULD only use `includeContext: \"none\"` (or omit it).\n */\n context: AssertObjectSchema.optional(),\n /**\n * Present if the client supports tool use via tools and toolChoice parameters.\n */\n tools: AssertObjectSchema.optional()\n })\n .optional(),\n /**\n * Present if the client supports eliciting user input.\n */\n elicitation: ElicitationCapabilitySchema.optional(),\n /**\n * Present if the client supports listing roots.\n */\n roots: z\n .object({\n /**\n * Whether the client supports issuing notifications for changes to the roots list.\n */\n listChanged: z.boolean().optional()\n })\n .optional(),\n /**\n * Present if the client supports task creation.\n */\n tasks: ClientTasksCapabilitySchema.optional(),\n /**\n * Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).\n */\n extensions: z.record(z.string(), AssertObjectSchema).optional()\n});\nexport const InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({\n /**\n * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.\n */\n protocolVersion: z.string(),\n capabilities: ClientCapabilitiesSchema,\n clientInfo: ImplementationSchema\n});\n/**\n * This request is sent from the client to the server when it first connects, asking it to begin initialization.\n */\nexport const InitializeRequestSchema = RequestSchema.extend({\n method: z.literal('initialize'),\n params: InitializeRequestParamsSchema\n});\nexport const isInitializeRequest = (value) => InitializeRequestSchema.safeParse(value).success;\n/**\n * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.\n */\nexport const ServerCapabilitiesSchema = z.object({\n /**\n * Experimental, non-standard capabilities that the server supports.\n */\n experimental: z.record(z.string(), AssertObjectSchema).optional(),\n /**\n * Present if the server supports sending log messages to the client.\n */\n logging: AssertObjectSchema.optional(),\n /**\n * Present if the server supports sending completions to the client.\n */\n completions: AssertObjectSchema.optional(),\n /**\n * Present if the server offers any prompt templates.\n */\n prompts: z\n .object({\n /**\n * Whether this server supports issuing notifications for changes to the prompt list.\n */\n listChanged: z.boolean().optional()\n })\n .optional(),\n /**\n * Present if the server offers any resources to read.\n */\n resources: z\n .object({\n /**\n * Whether this server supports clients subscribing to resource updates.\n */\n subscribe: z.boolean().optional(),\n /**\n * Whether this server supports issuing notifications for changes to the resource list.\n */\n listChanged: z.boolean().optional()\n })\n .optional(),\n /**\n * Present if the server offers any tools to call.\n */\n tools: z\n .object({\n /**\n * Whether this server supports issuing notifications for changes to the tool list.\n */\n listChanged: z.boolean().optional()\n })\n .optional(),\n /**\n * Present if the server supports task creation.\n */\n tasks: ServerTasksCapabilitySchema.optional(),\n /**\n * Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).\n */\n extensions: z.record(z.string(), AssertObjectSchema).optional()\n});\n/**\n * After receiving an initialize request from the client, the server sends this response.\n */\nexport const InitializeResultSchema = ResultSchema.extend({\n /**\n * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.\n */\n protocolVersion: z.string(),\n capabilities: ServerCapabilitiesSchema,\n serverInfo: ImplementationSchema,\n /**\n * Instructions describing how to use the server and its features.\n *\n * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a \"hint\" to the model. For example, this information MAY be added to the system prompt.\n */\n instructions: z.string().optional()\n});\n/**\n * This notification is sent from the client to the server after initialization has finished.\n */\nexport const InitializedNotificationSchema = NotificationSchema.extend({\n method: z.literal('notifications/initialized'),\n params: NotificationsParamsSchema.optional()\n});\nexport const isInitializedNotification = (value) => InitializedNotificationSchema.safeParse(value).success;\n/* Ping */\n/**\n * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.\n */\nexport const PingRequestSchema = RequestSchema.extend({\n method: z.literal('ping'),\n params: BaseRequestParamsSchema.optional()\n});\n/* Progress notifications */\nexport const ProgressSchema = z.object({\n /**\n * The progress thus far. This should increase every time progress is made, even if the total is unknown.\n */\n progress: z.number(),\n /**\n * Total number of items to process (or total progress required), if known.\n */\n total: z.optional(z.number()),\n /**\n * An optional message describing the current progress.\n */\n message: z.optional(z.string())\n});\nexport const ProgressNotificationParamsSchema = z.object({\n ...NotificationsParamsSchema.shape,\n ...ProgressSchema.shape,\n /**\n * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.\n */\n progressToken: ProgressTokenSchema\n});\n/**\n * An out-of-band notification used to inform the receiver of a progress update for a long-running request.\n *\n * @category notifications/progress\n */\nexport const ProgressNotificationSchema = NotificationSchema.extend({\n method: z.literal('notifications/progress'),\n params: ProgressNotificationParamsSchema\n});\nexport const PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({\n /**\n * An opaque token representing the current pagination position.\n * If provided, the server should return results starting after this cursor.\n */\n cursor: CursorSchema.optional()\n});\n/* Pagination */\nexport const PaginatedRequestSchema = RequestSchema.extend({\n params: PaginatedRequestParamsSchema.optional()\n});\nexport const PaginatedResultSchema = ResultSchema.extend({\n /**\n * An opaque token representing the pagination position after the last returned result.\n * If present, there may be more results available.\n */\n nextCursor: CursorSchema.optional()\n});\n/**\n * The status of a task.\n * */\nexport const TaskStatusSchema = z.enum(['working', 'input_required', 'completed', 'failed', 'cancelled']);\n/* Tasks */\n/**\n * A pollable state object associated with a request.\n */\nexport const TaskSchema = z.object({\n taskId: z.string(),\n status: TaskStatusSchema,\n /**\n * Time in milliseconds to keep task results available after completion.\n * If null, the task has unlimited lifetime until manually cleaned up.\n */\n ttl: z.union([z.number(), z.null()]),\n /**\n * ISO 8601 timestamp when the task was created.\n */\n createdAt: z.string(),\n /**\n * ISO 8601 timestamp when the task was last updated.\n */\n lastUpdatedAt: z.string(),\n pollInterval: z.optional(z.number()),\n /**\n * Optional diagnostic message for failed tasks or other status information.\n */\n statusMessage: z.optional(z.string())\n});\n/**\n * Result returned when a task is created, containing the task data wrapped in a task field.\n */\nexport const CreateTaskResultSchema = ResultSchema.extend({\n task: TaskSchema\n});\n/**\n * Parameters for task status notification.\n */\nexport const TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);\n/**\n * A notification sent when a task's status changes.\n */\nexport const TaskStatusNotificationSchema = NotificationSchema.extend({\n method: z.literal('notifications/tasks/status'),\n params: TaskStatusNotificationParamsSchema\n});\n/**\n * A request to get the state of a specific task.\n */\nexport const GetTaskRequestSchema = RequestSchema.extend({\n method: z.literal('tasks/get'),\n params: BaseRequestParamsSchema.extend({\n taskId: z.string()\n })\n});\n/**\n * The response to a tasks/get request.\n */\nexport const GetTaskResultSchema = ResultSchema.merge(TaskSchema);\n/**\n * A request to get the result of a specific task.\n */\nexport const GetTaskPayloadRequestSchema = RequestSchema.extend({\n method: z.literal('tasks/result'),\n params: BaseRequestParamsSchema.extend({\n taskId: z.string()\n })\n});\n/**\n * The response to a tasks/result request.\n * The structure matches the result type of the original request.\n * For example, a tools/call task would return the CallToolResult structure.\n *\n */\nexport const GetTaskPayloadResultSchema = ResultSchema.loose();\n/**\n * A request to list tasks.\n */\nexport const ListTasksRequestSchema = PaginatedRequestSchema.extend({\n method: z.literal('tasks/list')\n});\n/**\n * The response to a tasks/list request.\n */\nexport const ListTasksResultSchema = PaginatedResultSchema.extend({\n tasks: z.array(TaskSchema)\n});\n/**\n * A request to cancel a specific task.\n */\nexport const CancelTaskRequestSchema = RequestSchema.extend({\n method: z.literal('tasks/cancel'),\n params: BaseRequestParamsSchema.extend({\n taskId: z.string()\n })\n});\n/**\n * The response to a tasks/cancel request.\n */\nexport const CancelTaskResultSchema = ResultSchema.merge(TaskSchema);\n/* Resources */\n/**\n * The contents of a specific resource or sub-resource.\n */\nexport const ResourceContentsSchema = z.object({\n /**\n * The URI of this resource.\n */\n uri: z.string(),\n /**\n * The MIME type of this resource, if known.\n */\n mimeType: z.optional(z.string()),\n /**\n * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)\n * for notes on _meta usage.\n */\n _meta: z.record(z.string(), z.unknown()).optional()\n});\nexport const TextResourceContentsSchema = ResourceContentsSchema.extend({\n /**\n * The text of the item. This must only be set if the item can actually be represented as text (not binary data).\n */\n text: z.string()\n});\n/**\n * A Zod schema for validating Base64 strings that is more performant and\n * robust for very large inputs than the default regex-based check. It avoids\n * stack overflows by using the native `atob` function for validation.\n */\nconst Base64Schema = z.string().refine(val => {\n try {\n // atob throws a DOMException if the string contains characters\n // that are not part of the Base64 character set.\n atob(val);\n return true;\n }\n catch {\n return false;\n }\n}, { message: 'Invalid Base64 string' });\nexport const BlobResourceContentsSchema = ResourceContentsSchema.extend({\n /**\n * A base64-encoded string representing the binary data of the item.\n */\n blob: Base64Schema\n});\n/**\n * The sender or recipient of messages and data in a conversation.\n */\nexport const RoleSchema = z.enum(['user', 'assistant']);\n/**\n * Optional annotations providing clients additional context about a resource.\n */\nexport const AnnotationsSchema = z.object({\n /**\n * Intended audience(s) for the resource.\n */\n audience: z.array(RoleSchema).optional(),\n /**\n * Importance hint for the resource, from 0 (least) to 1 (most).\n */\n priority: z.number().min(0).max(1).optional(),\n /**\n * ISO 8601 timestamp for the most recent modification.\n */\n lastModified: z.iso.datetime({ offset: true }).optional()\n});\n/**\n * A known resource that the server is capable of reading.\n */\nexport const ResourceSchema = z.object({\n ...BaseMetadataSchema.shape,\n ...IconsSchema.shape,\n /**\n * The URI of this resource.\n */\n uri: z.string(),\n /**\n * A description of what this resource represents.\n *\n * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.\n */\n description: z.optional(z.string()),\n /**\n * The MIME type of this resource, if known.\n */\n mimeType: z.optional(z.string()),\n /**\n * The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.\n *\n * This can be used by Hosts to display file sizes and estimate context window usage.\n */\n size: z.optional(z.number()),\n /**\n * Optional annotations for the client.\n */\n annotations: AnnotationsSchema.optional(),\n /**\n * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)\n * for notes on _meta usage.\n */\n _meta: z.optional(z.looseObject({}))\n});\n/**\n * A template description for resources available on the server.\n */\nexport const ResourceTemplateSchema = z.object({\n ...BaseMetadataSchema.shape,\n ...IconsSchema.shape,\n /**\n * A URI template (according to RFC 6570) that can be used to construct resource URIs.\n */\n uriTemplate: z.string(),\n /**\n * A description of what this template is for.\n *\n * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.\n */\n description: z.optional(z.string()),\n /**\n * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.\n */\n mimeType: z.optional(z.string()),\n /**\n * Optional annotations for the client.\n */\n annotations: AnnotationsSchema.optional(),\n /**\n * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)\n * for notes on _meta usage.\n */\n _meta: z.optional(z.looseObject({}))\n});\n/**\n * Sent from the client to request a list of resources the server has.\n */\nexport const ListResourcesRequestSchema = PaginatedRequestSchema.extend({\n method: z.literal('resources/list')\n});\n/**\n * The server's response to a resources/list request from the client.\n */\nexport const ListResourcesResultSchema = PaginatedResultSchema.extend({\n resources: z.array(ResourceSchema)\n});\n/**\n * Sent from the client to request a list of resource templates the server has.\n */\nexport const ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({\n method: z.literal('resources/templates/list')\n});\n/**\n * The server's response to a resources/templates/list request from the client.\n */\nexport const ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({\n resourceTemplates: z.array(ResourceTemplateSchema)\n});\nexport const ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({\n /**\n * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.\n *\n * @format uri\n */\n uri: z.string()\n});\n/**\n * Parameters for a `resources/read` request.\n */\nexport const ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;\n/**\n * Sent from the client to the server, to read a specific resource URI.\n */\nexport const ReadResourceRequestSchema = RequestSchema.extend({\n method: z.literal('resources/read'),\n params: ReadResourceRequestParamsSchema\n});\n/**\n * The server's response to a resources/read request from the client.\n */\nexport const ReadResourceResultSchema = ResultSchema.extend({\n contents: z.array(z.union([TextResourceContentsSchema, BlobResourceContentsSchema]))\n});\n/**\n * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.\n */\nexport const ResourceListChangedNotificationSchema = NotificationSchema.extend({\n method: z.literal('notifications/resources/list_changed'),\n params: NotificationsParamsSchema.optional()\n});\nexport const SubscribeRequestParamsSchema = ResourceRequestParamsSchema;\n/**\n * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.\n */\nexport const SubscribeRequestSchema = RequestSchema.extend({\n method: z.literal('resources/subscribe'),\n params: SubscribeRequestParamsSchema\n});\nexport const UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;\n/**\n * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.\n */\nexport const UnsubscribeRequestSchema = RequestSchema.extend({\n method: z.literal('resources/unsubscribe'),\n params: UnsubscribeRequestParamsSchema\n});\n/**\n * Parameters for a `notifications/resources/updated` notification.\n */\nexport const ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({\n /**\n * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.\n */\n uri: z.string()\n});\n/**\n * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.\n */\nexport const ResourceUpdatedNotificationSchema = NotificationSchema.extend({\n method: z.literal('notifications/resources/updated'),\n params: ResourceUpdatedNotificationParamsSchema\n});\n/* Prompts */\n/**\n * Describes an argument that a prompt can accept.\n */\nexport const PromptArgumentSchema = z.object({\n /**\n * The name of the argument.\n */\n name: z.string(),\n /**\n * A human-readable description of the argument.\n */\n description: z.optional(z.string()),\n /**\n * Whether this argument must be provided.\n */\n required: z.optional(z.boolean())\n});\n/**\n * A prompt or prompt template that the server offers.\n */\nexport const PromptSchema = z.object({\n ...BaseMetadataSchema.shape,\n ...IconsSchema.shape,\n /**\n * An optional description of what this prompt provides\n */\n description: z.optional(z.string()),\n /**\n * A list of arguments to use for templating the prompt.\n */\n arguments: z.optional(z.array(PromptArgumentSchema)),\n /**\n * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)\n * for notes on _meta usage.\n */\n _meta: z.optional(z.looseObject({}))\n});\n/**\n * Sent from the client to request a list of prompts and prompt templates the server has.\n */\nexport const ListPromptsRequestSchema = PaginatedRequestSchema.extend({\n method: z.literal('prompts/list')\n});\n/**\n * The server's response to a prompts/list request from the client.\n */\nexport const ListPromptsResultSchema = PaginatedResultSchema.extend({\n prompts: z.array(PromptSchema)\n});\n/**\n * Parameters for a `prompts/get` request.\n */\nexport const GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({\n /**\n * The name of the prompt or prompt template.\n */\n name: z.string(),\n /**\n * Arguments to use for templating the prompt.\n */\n arguments: z.record(z.string(), z.string()).optional()\n});\n/**\n * Used by the client to get a prompt provided by the server.\n */\nexport const GetPromptRequestSchema = RequestSchema.extend({\n method: z.literal('prompts/get'),\n params: GetPromptRequestParamsSchema\n});\n/**\n * Text provided to or from an LLM.\n */\nexport const TextContentSchema = z.object({\n type: z.literal('text'),\n /**\n * The text content of the message.\n */\n text: z.string(),\n /**\n * Optional annotations for the client.\n */\n annotations: AnnotationsSchema.optional(),\n /**\n * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)\n * for notes on _meta usage.\n */\n _meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n * An image provided to or from an LLM.\n */\nexport const ImageContentSchema = z.object({\n type: z.literal('image'),\n /**\n * The base64-encoded image data.\n */\n data: Base64Schema,\n /**\n * The MIME type of the image. Different providers may support different image types.\n */\n mimeType: z.string(),\n /**\n * Optional annotations for the client.\n */\n annotations: AnnotationsSchema.optional(),\n /**\n * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)\n * for notes on _meta usage.\n */\n _meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n * An Audio provided to or from an LLM.\n */\nexport const AudioContentSchema = z.object({\n type: z.literal('audio'),\n /**\n * The base64-encoded audio data.\n */\n data: Base64Schema,\n /**\n * The MIME type of the audio. Different providers may support different audio types.\n */\n mimeType: z.string(),\n /**\n * Optional annotations for the client.\n */\n annotations: AnnotationsSchema.optional(),\n /**\n * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)\n * for notes on _meta usage.\n */\n _meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n * A tool call request from an assistant (LLM).\n * Represents the assistant's request to use a tool.\n */\nexport const ToolUseContentSchema = z.object({\n type: z.literal('tool_use'),\n /**\n * The name of the tool to invoke.\n * Must match a tool name from the request's tools array.\n */\n name: z.string(),\n /**\n * Unique identifier for this tool call.\n * Used to correlate with ToolResultContent in subsequent messages.\n */\n id: z.string(),\n /**\n * Arguments to pass to the tool.\n * Must conform to the tool's inputSchema.\n */\n input: z.record(z.string(), z.unknown()),\n /**\n * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)\n * for notes on _meta usage.\n */\n _meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n * The contents of a resource, embedded into a prompt or tool call result.\n */\nexport const EmbeddedResourceSchema = z.object({\n type: z.literal('resource'),\n resource: z.union([TextResourceContentsSchema, BlobResourceContentsSchema]),\n /**\n * Optional annotations for the client.\n */\n annotations: AnnotationsSchema.optional(),\n /**\n * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)\n * for notes on _meta usage.\n */\n _meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n * A resource that the server is capable of reading, included in a prompt or tool call result.\n *\n * Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests.\n */\nexport const ResourceLinkSchema = ResourceSchema.extend({\n type: z.literal('resource_link')\n});\n/**\n * A content block that can be used in prompts and tool results.\n */\nexport const ContentBlockSchema = z.union([\n TextContentSchema,\n ImageContentSchema,\n AudioContentSchema,\n ResourceLinkSchema,\n EmbeddedResourceSchema\n]);\n/**\n * Describes a message returned as part of a prompt.\n */\nexport const PromptMessageSchema = z.object({\n role: RoleSchema,\n content: ContentBlockSchema\n});\n/**\n * The server's response to a prompts/get request from the client.\n */\nexport const GetPromptResultSchema = ResultSchema.extend({\n /**\n * An optional description for the prompt.\n */\n description: z.string().optional(),\n messages: z.array(PromptMessageSchema)\n});\n/**\n * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.\n */\nexport const PromptListChangedNotificationSchema = NotificationSchema.extend({\n method: z.literal('notifications/prompts/list_changed'),\n params: NotificationsParamsSchema.optional()\n});\n/* Tools */\n/**\n * Additional properties describing a Tool to clients.\n *\n * NOTE: all properties in ToolAnnotations are **hints**.\n * They are not guaranteed to provide a faithful description of\n * tool behavior (including descriptive properties like `title`).\n *\n * Clients should never make tool use decisions based on ToolAnnotations\n * received from untrusted servers.\n */\nexport const ToolAnnotationsSchema = z.object({\n /**\n * A human-readable title for the tool.\n */\n title: z.string().optional(),\n /**\n * If true, the tool does not modify its environment.\n *\n * Default: false\n */\n readOnlyHint: z.boolean().optional(),\n /**\n * If true, the tool may perform destructive updates to its environment.\n * If false, the tool performs only additive updates.\n *\n * (This property is meaningful only when `readOnlyHint == false`)\n *\n * Default: true\n */\n destructiveHint: z.boolean().optional(),\n /**\n * If true, calling the tool repeatedly with the same arguments\n * will have no additional effect on the its environment.\n *\n * (This property is meaningful only when `readOnlyHint == false`)\n *\n * Default: false\n */\n idempotentHint: z.boolean().optional(),\n /**\n * If true, this tool may interact with an \"open world\" of external\n * entities. If false, the tool's domain of interaction is closed.\n * For example, the world of a web search tool is open, whereas that\n * of a memory tool is not.\n *\n * Default: true\n */\n openWorldHint: z.boolean().optional()\n});\n/**\n * Execution-related properties for a tool.\n */\nexport const ToolExecutionSchema = z.object({\n /**\n * Indicates the tool's preference for task-augmented execution.\n * - \"required\": Clients MUST invoke the tool as a task\n * - \"optional\": Clients MAY invoke the tool as a task or normal request\n * - \"forbidden\": Clients MUST NOT attempt to invoke the tool as a task\n *\n * If not present, defaults to \"forbidden\".\n */\n taskSupport: z.enum(['required', 'optional', 'forbidden']).optional()\n});\n/**\n * Definition for a tool the client can call.\n */\nexport const ToolSchema = z.object({\n ...BaseMetadataSchema.shape,\n ...IconsSchema.shape,\n /**\n * A human-readable description of the tool.\n */\n description: z.string().optional(),\n /**\n * A JSON Schema 2020-12 object defining the expected parameters for the tool.\n * Must have type: 'object' at the root level per MCP spec.\n */\n inputSchema: z\n .object({\n type: z.literal('object'),\n properties: z.record(z.string(), AssertObjectSchema).optional(),\n required: z.array(z.string()).optional()\n })\n .catchall(z.unknown()),\n /**\n * An optional JSON Schema 2020-12 object defining the structure of the tool's output\n * returned in the structuredContent field of a CallToolResult.\n * Must have type: 'object' at the root level per MCP spec.\n */\n outputSchema: z\n .object({\n type: z.literal('object'),\n properties: z.record(z.string(), AssertObjectSchema).optional(),\n required: z.array(z.string()).optional()\n })\n .catchall(z.unknown())\n .optional(),\n /**\n * Optional additional tool information.\n */\n annotations: ToolAnnotationsSchema.optional(),\n /**\n * Execution-related properties for this tool.\n */\n execution: ToolExecutionSchema.optional(),\n /**\n * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)\n * for notes on _meta usage.\n */\n _meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n * Sent from the client to request a list of tools the server has.\n */\nexport const ListToolsRequestSchema = PaginatedRequestSchema.extend({\n method: z.literal('tools/list')\n});\n/**\n * The server's response to a tools/list request from the client.\n */\nexport const ListToolsResultSchema = PaginatedResultSchema.extend({\n tools: z.array(ToolSchema)\n});\n/**\n * The server's response to a tool call.\n */\nexport const CallToolResultSchema = ResultSchema.extend({\n /**\n * A list of content objects that represent the result of the tool call.\n *\n * If the Tool does not define an outputSchema, this field MUST be present in the result.\n * For backwards compatibility, this field is always present, but it may be empty.\n */\n content: z.array(ContentBlockSchema).default([]),\n /**\n * An object containing structured tool output.\n *\n * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.\n */\n structuredContent: z.record(z.string(), z.unknown()).optional(),\n /**\n * Whether the tool call ended in an error.\n *\n * If not set, this is assumed to be false (the call was successful).\n *\n * Any errors that originate from the tool SHOULD be reported inside the result\n * object, with `isError` set to true, _not_ as an MCP protocol-level error\n * response. Otherwise, the LLM would not be able to see that an error occurred\n * and self-correct.\n *\n * However, any errors in _finding_ the tool, an error indicating that the\n * server does not support tool calls, or any other exceptional conditions,\n * should be reported as an MCP error response.\n */\n isError: z.boolean().optional()\n});\n/**\n * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07.\n */\nexport const CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({\n toolResult: z.unknown()\n}));\n/**\n * Parameters for a `tools/call` request.\n */\nexport const CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({\n /**\n * The name of the tool to call.\n */\n name: z.string(),\n /**\n * Arguments to pass to the tool.\n */\n arguments: z.record(z.string(), z.unknown()).optional()\n});\n/**\n * Used by the client to invoke a tool provided by the server.\n */\nexport const CallToolRequestSchema = RequestSchema.extend({\n method: z.literal('tools/call'),\n params: CallToolRequestParamsSchema\n});\n/**\n * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.\n */\nexport const ToolListChangedNotificationSchema = NotificationSchema.extend({\n method: z.literal('notifications/tools/list_changed'),\n params: NotificationsParamsSchema.optional()\n});\n/**\n * Base schema for list changed subscription options (without callback).\n * Used internally for Zod validation of autoRefresh and debounceMs.\n */\nexport const ListChangedOptionsBaseSchema = z.object({\n /**\n * If true, the list will be refreshed automatically when a list changed notification is received.\n * The callback will be called with the updated list.\n *\n * If false, the callback will be called with null items, allowing manual refresh.\n *\n * @default true\n */\n autoRefresh: z.boolean().default(true),\n /**\n * Debounce time in milliseconds for list changed notification processing.\n *\n * Multiple notifications received within this timeframe will only trigger one refresh.\n * Set to 0 to disable debouncing.\n *\n * @default 300\n */\n debounceMs: z.number().int().nonnegative().default(300)\n});\n/* Logging */\n/**\n * The severity of a log message.\n */\nexport const LoggingLevelSchema = z.enum(['debug', 'info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency']);\n/**\n * Parameters for a `logging/setLevel` request.\n */\nexport const SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({\n /**\n * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.\n */\n level: LoggingLevelSchema\n});\n/**\n * A request from the client to the server, to enable or adjust logging.\n */\nexport const SetLevelRequestSchema = RequestSchema.extend({\n method: z.literal('logging/setLevel'),\n params: SetLevelRequestParamsSchema\n});\n/**\n * Parameters for a `notifications/message` notification.\n */\nexport const LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({\n /**\n * The severity of this log message.\n */\n level: LoggingLevelSchema,\n /**\n * An optional name of the logger issuing this message.\n */\n logger: z.string().optional(),\n /**\n * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.\n */\n data: z.unknown()\n});\n/**\n * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.\n */\nexport const LoggingMessageNotificationSchema = NotificationSchema.extend({\n method: z.literal('notifications/message'),\n params: LoggingMessageNotificationParamsSchema\n});\n/* Sampling */\n/**\n * Hints to use for model selection.\n */\nexport const ModelHintSchema = z.object({\n /**\n * A hint for a model name.\n */\n name: z.string().optional()\n});\n/**\n * The server's preferences for model selection, requested of the client during sampling.\n */\nexport const ModelPreferencesSchema = z.object({\n /**\n * Optional hints to use for model selection.\n */\n hints: z.array(ModelHintSchema).optional(),\n /**\n * How much to prioritize cost when selecting a model.\n */\n costPriority: z.number().min(0).max(1).optional(),\n /**\n * How much to prioritize sampling speed (latency) when selecting a model.\n */\n speedPriority: z.number().min(0).max(1).optional(),\n /**\n * How much to prioritize intelligence and capabilities when selecting a model.\n */\n intelligencePriority: z.number().min(0).max(1).optional()\n});\n/**\n * Controls tool usage behavior in sampling requests.\n */\nexport const ToolChoiceSchema = z.object({\n /**\n * Controls when tools are used:\n * - \"auto\": Model decides whether to use tools (default)\n * - \"required\": Model MUST use at least one tool before completing\n * - \"none\": Model MUST NOT use any tools\n */\n mode: z.enum(['auto', 'required', 'none']).optional()\n});\n/**\n * The result of a tool execution, provided by the user (server).\n * Represents the outcome of invoking a tool requested via ToolUseContent.\n */\nexport const ToolResultContentSchema = z.object({\n type: z.literal('tool_result'),\n toolUseId: z.string().describe('The unique identifier for the corresponding tool call.'),\n content: z.array(ContentBlockSchema).default([]),\n structuredContent: z.object({}).loose().optional(),\n isError: z.boolean().optional(),\n /**\n * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)\n * for notes on _meta usage.\n */\n _meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n * Basic content types for sampling responses (without tool use).\n * Used for backwards-compatible CreateMessageResult when tools are not used.\n */\nexport const SamplingContentSchema = z.discriminatedUnion('type', [TextContentSchema, ImageContentSchema, AudioContentSchema]);\n/**\n * Content block types allowed in sampling messages.\n * This includes text, image, audio, tool use requests, and tool results.\n */\nexport const SamplingMessageContentBlockSchema = z.discriminatedUnion('type', [\n TextContentSchema,\n ImageContentSchema,\n AudioContentSchema,\n ToolUseContentSchema,\n ToolResultContentSchema\n]);\n/**\n * Describes a message issued to or received from an LLM API.\n */\nexport const SamplingMessageSchema = z.object({\n role: RoleSchema,\n content: z.union([SamplingMessageContentBlockSchema, z.array(SamplingMessageContentBlockSchema)]),\n /**\n * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)\n * for notes on _meta usage.\n */\n _meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n * Parameters for a `sampling/createMessage` request.\n */\nexport const CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({\n messages: z.array(SamplingMessageSchema),\n /**\n * The server's preferences for which model to select. The client MAY modify or omit this request.\n */\n modelPreferences: ModelPreferencesSchema.optional(),\n /**\n * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.\n */\n systemPrompt: z.string().optional(),\n /**\n * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.\n * The client MAY ignore this request.\n *\n * Default is \"none\". Values \"thisServer\" and \"allServers\" are soft-deprecated. Servers SHOULD only use these values if the client\n * declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.\n */\n includeContext: z.enum(['none', 'thisServer', 'allServers']).optional(),\n temperature: z.number().optional(),\n /**\n * The requested maximum number of tokens to sample (to prevent runaway completions).\n *\n * The client MAY choose to sample fewer tokens than the requested maximum.\n */\n maxTokens: z.number().int(),\n stopSequences: z.array(z.string()).optional(),\n /**\n * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.\n */\n metadata: AssertObjectSchema.optional(),\n /**\n * Tools that the model may use during generation.\n * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.\n */\n tools: z.array(ToolSchema).optional(),\n /**\n * Controls how the model uses tools.\n * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.\n * Default is `{ mode: \"auto\" }`.\n */\n toolChoice: ToolChoiceSchema.optional()\n});\n/**\n * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.\n */\nexport const CreateMessageRequestSchema = RequestSchema.extend({\n method: z.literal('sampling/createMessage'),\n params: CreateMessageRequestParamsSchema\n});\n/**\n * The client's response to a sampling/create_message request from the server.\n * This is the backwards-compatible version that returns single content (no arrays).\n * Used when the request does not include tools.\n */\nexport const CreateMessageResultSchema = ResultSchema.extend({\n /**\n * The name of the model that generated the message.\n */\n model: z.string(),\n /**\n * The reason why sampling stopped, if known.\n *\n * Standard values:\n * - \"endTurn\": Natural end of the assistant's turn\n * - \"stopSequence\": A stop sequence was encountered\n * - \"maxTokens\": Maximum token limit was reached\n *\n * This field is an open string to allow for provider-specific stop reasons.\n */\n stopReason: z.optional(z.enum(['endTurn', 'stopSequence', 'maxTokens']).or(z.string())),\n role: RoleSchema,\n /**\n * Response content. Single content block (text, image, or audio).\n */\n content: SamplingContentSchema\n});\n/**\n * The client's response to a sampling/create_message request when tools were provided.\n * This version supports array content for tool use flows.\n */\nexport const CreateMessageResultWithToolsSchema = ResultSchema.extend({\n /**\n * The name of the model that generated the message.\n */\n model: z.string(),\n /**\n * The reason why sampling stopped, if known.\n *\n * Standard values:\n * - \"endTurn\": Natural end of the assistant's turn\n * - \"stopSequence\": A stop sequence was encountered\n * - \"maxTokens\": Maximum token limit was reached\n * - \"toolUse\": The model wants to use one or more tools\n *\n * This field is an open string to allow for provider-specific stop reasons.\n */\n stopReason: z.optional(z.enum(['endTurn', 'stopSequence', 'maxTokens', 'toolUse']).or(z.string())),\n role: RoleSchema,\n /**\n * Response content. May be a single block or array. May include ToolUseContent if stopReason is \"toolUse\".\n */\n content: z.union([SamplingMessageContentBlockSchema, z.array(SamplingMessageContentBlockSchema)])\n});\n/* Elicitation */\n/**\n * Primitive schema definition for boolean fields.\n */\nexport const BooleanSchemaSchema = z.object({\n type: z.literal('boolean'),\n title: z.string().optional(),\n description: z.string().optional(),\n default: z.boolean().optional()\n});\n/**\n * Primitive schema definition for string fields.\n */\nexport const StringSchemaSchema = z.object({\n type: z.literal('string'),\n title: z.string().optional(),\n description: z.string().optional(),\n minLength: z.number().optional(),\n maxLength: z.number().optional(),\n format: z.enum(['email', 'uri', 'date', 'date-time']).optional(),\n default: z.string().optional()\n});\n/**\n * Primitive schema definition for number fields.\n */\nexport const NumberSchemaSchema = z.object({\n type: z.enum(['number', 'integer']),\n title: z.string().optional(),\n description: z.string().optional(),\n minimum: z.number().optional(),\n maximum: z.number().optional(),\n default: z.number().optional()\n});\n/**\n * Schema for single-selection enumeration without display titles for options.\n */\nexport const UntitledSingleSelectEnumSchemaSchema = z.object({\n type: z.literal('string'),\n title: z.string().optional(),\n description: z.string().optional(),\n enum: z.array(z.string()),\n default: z.string().optional()\n});\n/**\n * Schema for single-selection enumeration with display titles for each option.\n */\nexport const TitledSingleSelectEnumSchemaSchema = z.object({\n type: z.literal('string'),\n title: z.string().optional(),\n description: z.string().optional(),\n oneOf: z.array(z.object({\n const: z.string(),\n title: z.string()\n })),\n default: z.string().optional()\n});\n/**\n * Use TitledSingleSelectEnumSchema instead.\n * This interface will be removed in a future version.\n */\nexport const LegacyTitledEnumSchemaSchema = z.object({\n type: z.literal('string'),\n title: z.string().optional(),\n description: z.string().optional(),\n enum: z.array(z.string()),\n enumNames: z.array(z.string()).optional(),\n default: z.string().optional()\n});\n// Combined single selection enumeration\nexport const SingleSelectEnumSchemaSchema = z.union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);\n/**\n * Schema for multiple-selection enumeration without display titles for options.\n */\nexport const UntitledMultiSelectEnumSchemaSchema = z.object({\n type: z.literal('array'),\n title: z.string().optional(),\n description: z.string().optional(),\n minItems: z.number().optional(),\n maxItems: z.number().optional(),\n items: z.object({\n type: z.literal('string'),\n enum: z.array(z.string())\n }),\n default: z.array(z.string()).optional()\n});\n/**\n * Schema for multiple-selection enumeration with display titles for each option.\n */\nexport const TitledMultiSelectEnumSchemaSchema = z.object({\n type: z.literal('array'),\n title: z.string().optional(),\n description: z.string().optional(),\n minItems: z.number().optional(),\n maxItems: z.number().optional(),\n items: z.object({\n anyOf: z.array(z.object({\n const: z.string(),\n title: z.string()\n }))\n }),\n default: z.array(z.string()).optional()\n});\n/**\n * Combined schema for multiple-selection enumeration\n */\nexport const MultiSelectEnumSchemaSchema = z.union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);\n/**\n * Primitive schema definition for enum fields.\n */\nexport const EnumSchemaSchema = z.union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);\n/**\n * Union of all primitive schema definitions.\n */\nexport const PrimitiveSchemaDefinitionSchema = z.union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);\n/**\n * Parameters for an `elicitation/create` request for form-based elicitation.\n */\nexport const ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({\n /**\n * The elicitation mode.\n *\n * Optional for backward compatibility. Clients MUST treat missing mode as \"form\".\n */\n mode: z.literal('form').optional(),\n /**\n * The message to present to the user describing what information is being requested.\n */\n message: z.string(),\n /**\n * A restricted subset of JSON Schema.\n * Only top-level properties are allowed, without nesting.\n */\n requestedSchema: z.object({\n type: z.literal('object'),\n properties: z.record(z.string(), PrimitiveSchemaDefinitionSchema),\n required: z.array(z.string()).optional()\n })\n});\n/**\n * Parameters for an `elicitation/create` request for URL-based elicitation.\n */\nexport const ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({\n /**\n * The elicitation mode.\n */\n mode: z.literal('url'),\n /**\n * The message to present to the user explaining why the interaction is needed.\n */\n message: z.string(),\n /**\n * The ID of the elicitation, which must be unique within the context of the server.\n * The client MUST treat this ID as an opaque value.\n */\n elicitationId: z.string(),\n /**\n * The URL that the user should navigate to.\n */\n url: z.string().url()\n});\n/**\n * The parameters for a request to elicit additional information from the user via the client.\n */\nexport const ElicitRequestParamsSchema = z.union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);\n/**\n * A request from the server to elicit user input via the client.\n * The client should present the message and form fields to the user (form mode)\n * or navigate to a URL (URL mode).\n */\nexport const ElicitRequestSchema = RequestSchema.extend({\n method: z.literal('elicitation/create'),\n params: ElicitRequestParamsSchema\n});\n/**\n * Parameters for a `notifications/elicitation/complete` notification.\n *\n * @category notifications/elicitation/complete\n */\nexport const ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({\n /**\n * The ID of the elicitation that completed.\n */\n elicitationId: z.string()\n});\n/**\n * A notification from the server to the client, informing it of a completion of an out-of-band elicitation request.\n *\n * @category notifications/elicitation/complete\n */\nexport const ElicitationCompleteNotificationSchema = NotificationSchema.extend({\n method: z.literal('notifications/elicitation/complete'),\n params: ElicitationCompleteNotificationParamsSchema\n});\n/**\n * The client's response to an elicitation/create request from the server.\n */\nexport const ElicitResultSchema = ResultSchema.extend({\n /**\n * The user action in response to the elicitation.\n * - \"accept\": User submitted the form/confirmed the action\n * - \"decline\": User explicitly decline the action\n * - \"cancel\": User dismissed without making an explicit choice\n */\n action: z.enum(['accept', 'decline', 'cancel']),\n /**\n * The submitted form data, only present when action is \"accept\".\n * Contains values matching the requested schema.\n * Per MCP spec, content is \"typically omitted\" for decline/cancel actions.\n * We normalize null to undefined for leniency while maintaining type compatibility.\n */\n content: z.preprocess(val => (val === null ? undefined : val), z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])).optional())\n});\n/* Autocomplete */\n/**\n * A reference to a resource or resource template definition.\n */\nexport const ResourceTemplateReferenceSchema = z.object({\n type: z.literal('ref/resource'),\n /**\n * The URI or URI template of the resource.\n */\n uri: z.string()\n});\n/**\n * @deprecated Use ResourceTemplateReferenceSchema instead\n */\nexport const ResourceReferenceSchema = ResourceTemplateReferenceSchema;\n/**\n * Identifies a prompt.\n */\nexport const PromptReferenceSchema = z.object({\n type: z.literal('ref/prompt'),\n /**\n * The name of the prompt or prompt template\n */\n name: z.string()\n});\n/**\n * Parameters for a `completion/complete` request.\n */\nexport const CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({\n ref: z.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),\n /**\n * The argument's information\n */\n argument: z.object({\n /**\n * The name of the argument\n */\n name: z.string(),\n /**\n * The value of the argument to use for completion matching.\n */\n value: z.string()\n }),\n context: z\n .object({\n /**\n * Previously-resolved variables in a URI template or prompt.\n */\n arguments: z.record(z.string(), z.string()).optional()\n })\n .optional()\n});\n/**\n * A request from the client to the server, to ask for completion options.\n */\nexport const CompleteRequestSchema = RequestSchema.extend({\n method: z.literal('completion/complete'),\n params: CompleteRequestParamsSchema\n});\nexport function assertCompleteRequestPrompt(request) {\n if (request.params.ref.type !== 'ref/prompt') {\n throw new TypeError(`Expected CompleteRequestPrompt, but got ${request.params.ref.type}`);\n }\n void request;\n}\nexport function assertCompleteRequestResourceTemplate(request) {\n if (request.params.ref.type !== 'ref/resource') {\n throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${request.params.ref.type}`);\n }\n void request;\n}\n/**\n * The server's response to a completion/complete request\n */\nexport const CompleteResultSchema = ResultSchema.extend({\n completion: z.looseObject({\n /**\n * An array of completion values. Must not exceed 100 items.\n */\n values: z.array(z.string()).max(100),\n /**\n * The total number of completion options available. This can exceed the number of values actually sent in the response.\n */\n total: z.optional(z.number().int()),\n /**\n * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.\n */\n hasMore: z.optional(z.boolean())\n })\n});\n/* Roots */\n/**\n * Represents a root directory or file that the server can operate on.\n */\nexport const RootSchema = z.object({\n /**\n * The URI identifying the root. This *must* start with file:// for now.\n */\n uri: z.string().startsWith('file://'),\n /**\n * An optional name for the root.\n */\n name: z.string().optional(),\n /**\n * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)\n * for notes on _meta usage.\n */\n _meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n * Sent from the server to request a list of root URIs from the client.\n */\nexport const ListRootsRequestSchema = RequestSchema.extend({\n method: z.literal('roots/list'),\n params: BaseRequestParamsSchema.optional()\n});\n/**\n * The client's response to a roots/list request from the server.\n */\nexport const ListRootsResultSchema = ResultSchema.extend({\n roots: z.array(RootSchema)\n});\n/**\n * A notification from the client to the server, informing it that the list of roots has changed.\n */\nexport const RootsListChangedNotificationSchema = NotificationSchema.extend({\n method: z.literal('notifications/roots/list_changed'),\n params: NotificationsParamsSchema.optional()\n});\n/* Client messages */\nexport const ClientRequestSchema = z.union([\n PingRequestSchema,\n InitializeRequestSchema,\n CompleteRequestSchema,\n SetLevelRequestSchema,\n GetPromptRequestSchema,\n ListPromptsRequestSchema,\n ListResourcesRequestSchema,\n ListResourceTemplatesRequestSchema,\n ReadResourceRequestSchema,\n SubscribeRequestSchema,\n UnsubscribeRequestSchema,\n CallToolRequestSchema,\n ListToolsRequestSchema,\n GetTaskRequestSchema,\n GetTaskPayloadRequestSchema,\n ListTasksRequestSchema,\n CancelTaskRequestSchema\n]);\nexport const ClientNotificationSchema = z.union([\n CancelledNotificationSchema,\n ProgressNotificationSchema,\n InitializedNotificationSchema,\n RootsListChangedNotificationSchema,\n TaskStatusNotificationSchema\n]);\nexport const ClientResultSchema = z.union([\n EmptyResultSchema,\n CreateMessageResultSchema,\n CreateMessageResultWithToolsSchema,\n ElicitResultSchema,\n ListRootsResultSchema,\n GetTaskResultSchema,\n ListTasksResultSchema,\n CreateTaskResultSchema\n]);\n/* Server messages */\nexport const ServerRequestSchema = z.union([\n PingRequestSchema,\n CreateMessageRequestSchema,\n ElicitRequestSchema,\n ListRootsRequestSchema,\n GetTaskRequestSchema,\n GetTaskPayloadRequestSchema,\n ListTasksRequestSchema,\n CancelTaskRequestSchema\n]);\nexport const ServerNotificationSchema = z.union([\n CancelledNotificationSchema,\n ProgressNotificationSchema,\n LoggingMessageNotificationSchema,\n ResourceUpdatedNotificationSchema,\n ResourceListChangedNotificationSchema,\n ToolListChangedNotificationSchema,\n PromptListChangedNotificationSchema,\n TaskStatusNotificationSchema,\n ElicitationCompleteNotificationSchema\n]);\nexport const ServerResultSchema = z.union([\n EmptyResultSchema,\n InitializeResultSchema,\n CompleteResultSchema,\n GetPromptResultSchema,\n ListPromptsResultSchema,\n ListResourcesResultSchema,\n ListResourceTemplatesResultSchema,\n ReadResourceResultSchema,\n CallToolResultSchema,\n ListToolsResultSchema,\n GetTaskResultSchema,\n ListTasksResultSchema,\n CreateTaskResultSchema\n]);\nexport class McpError extends Error {\n constructor(code, message, data) {\n super(`MCP error ${code}: ${message}`);\n this.code = code;\n this.data = data;\n this.name = 'McpError';\n }\n /**\n * Factory method to create the appropriate error type based on the error code and data\n */\n static fromError(code, message, data) {\n // Check for specific error types\n if (code === ErrorCode.UrlElicitationRequired && data) {\n const errorData = data;\n if (errorData.elicitations) {\n return new UrlElicitationRequiredError(errorData.elicitations, message);\n }\n }\n // Default to generic McpError\n return new McpError(code, message, data);\n }\n}\n/**\n * Specialized error type when a tool requires a URL mode elicitation.\n * This makes it nicer for the client to handle since there is specific data to work with instead of just a code to check against.\n */\nexport class UrlElicitationRequiredError extends McpError {\n constructor(elicitations, message = `URL elicitation${elicitations.length > 1 ? 's' : ''} required`) {\n super(ErrorCode.UrlElicitationRequired, message, {\n elicitations: elicitations\n });\n }\n get elicitations() {\n return this.data?.elicitations ?? [];\n }\n}\n//# sourceMappingURL=types.js.map","import * as z from 'zod/v4';\n/**\n * Reusable URL validation that disallows javascript: scheme\n */\nexport const SafeUrlSchema = z\n .url()\n .superRefine((val, ctx) => {\n if (!URL.canParse(val)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'URL must be parseable',\n fatal: true\n });\n return z.NEVER;\n }\n})\n .refine(url => {\n const u = new URL(url);\n return u.protocol !== 'javascript:' && u.protocol !== 'data:' && u.protocol !== 'vbscript:';\n}, { message: 'URL cannot use javascript:, data:, or vbscript: scheme' });\n/**\n * RFC 9728 OAuth Protected Resource Metadata\n */\nexport const OAuthProtectedResourceMetadataSchema = z.looseObject({\n resource: z.string().url(),\n authorization_servers: z.array(SafeUrlSchema).optional(),\n jwks_uri: z.string().url().optional(),\n scopes_supported: z.array(z.string()).optional(),\n bearer_methods_supported: z.array(z.string()).optional(),\n resource_signing_alg_values_supported: z.array(z.string()).optional(),\n resource_name: z.string().optional(),\n resource_documentation: z.string().optional(),\n resource_policy_uri: z.string().url().optional(),\n resource_tos_uri: z.string().url().optional(),\n tls_client_certificate_bound_access_tokens: z.boolean().optional(),\n authorization_details_types_supported: z.array(z.string()).optional(),\n dpop_signing_alg_values_supported: z.array(z.string()).optional(),\n dpop_bound_access_tokens_required: z.boolean().optional()\n});\n/**\n * RFC 8414 OAuth 2.0 Authorization Server Metadata\n */\nexport const OAuthMetadataSchema = z.looseObject({\n issuer: z.string(),\n authorization_endpoint: SafeUrlSchema,\n token_endpoint: SafeUrlSchema,\n registration_endpoint: SafeUrlSchema.optional(),\n scopes_supported: z.array(z.string()).optional(),\n response_types_supported: z.array(z.string()),\n response_modes_supported: z.array(z.string()).optional(),\n grant_types_supported: z.array(z.string()).optional(),\n token_endpoint_auth_methods_supported: z.array(z.string()).optional(),\n token_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),\n service_documentation: SafeUrlSchema.optional(),\n revocation_endpoint: SafeUrlSchema.optional(),\n revocation_endpoint_auth_methods_supported: z.array(z.string()).optional(),\n revocation_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),\n introspection_endpoint: z.string().optional(),\n introspection_endpoint_auth_methods_supported: z.array(z.string()).optional(),\n introspection_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),\n code_challenge_methods_supported: z.array(z.string()).optional(),\n client_id_metadata_document_supported: z.boolean().optional()\n});\n/**\n * OpenID Connect Discovery 1.0 Provider Metadata\n * see: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata\n */\nexport const OpenIdProviderMetadataSchema = z.looseObject({\n issuer: z.string(),\n authorization_endpoint: SafeUrlSchema,\n token_endpoint: SafeUrlSchema,\n userinfo_endpoint: SafeUrlSchema.optional(),\n jwks_uri: SafeUrlSchema,\n registration_endpoint: SafeUrlSchema.optional(),\n scopes_supported: z.array(z.string()).optional(),\n response_types_supported: z.array(z.string()),\n response_modes_supported: z.array(z.string()).optional(),\n grant_types_supported: z.array(z.string()).optional(),\n acr_values_supported: z.array(z.string()).optional(),\n subject_types_supported: z.array(z.string()),\n id_token_signing_alg_values_supported: z.array(z.string()),\n id_token_encryption_alg_values_supported: z.array(z.string()).optional(),\n id_token_encryption_enc_values_supported: z.array(z.string()).optional(),\n userinfo_signing_alg_values_supported: z.array(z.string()).optional(),\n userinfo_encryption_alg_values_supported: z.array(z.string()).optional(),\n userinfo_encryption_enc_values_supported: z.array(z.string()).optional(),\n request_object_signing_alg_values_supported: z.array(z.string()).optional(),\n request_object_encryption_alg_values_supported: z.array(z.string()).optional(),\n request_object_encryption_enc_values_supported: z.array(z.string()).optional(),\n token_endpoint_auth_methods_supported: z.array(z.string()).optional(),\n token_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),\n display_values_supported: z.array(z.string()).optional(),\n claim_types_supported: z.array(z.string()).optional(),\n claims_supported: z.array(z.string()).optional(),\n service_documentation: z.string().optional(),\n claims_locales_supported: z.array(z.string()).optional(),\n ui_locales_supported: z.array(z.string()).optional(),\n claims_parameter_supported: z.boolean().optional(),\n request_parameter_supported: z.boolean().optional(),\n request_uri_parameter_supported: z.boolean().optional(),\n require_request_uri_registration: z.boolean().optional(),\n op_policy_uri: SafeUrlSchema.optional(),\n op_tos_uri: SafeUrlSchema.optional(),\n client_id_metadata_document_supported: z.boolean().optional()\n});\n/**\n * OpenID Connect Discovery metadata that may include OAuth 2.0 fields\n * This schema represents the real-world scenario where OIDC providers\n * return a mix of OpenID Connect and OAuth 2.0 metadata fields\n */\nexport const OpenIdProviderDiscoveryMetadataSchema = z.object({\n ...OpenIdProviderMetadataSchema.shape,\n ...OAuthMetadataSchema.pick({\n code_challenge_methods_supported: true\n }).shape\n});\n/**\n * OAuth 2.1 token response\n */\nexport const OAuthTokensSchema = z\n .object({\n access_token: z.string(),\n id_token: z.string().optional(), // Optional for OAuth 2.1, but necessary in OpenID Connect\n token_type: z.string(),\n expires_in: z.coerce.number().optional(),\n scope: z.string().optional(),\n refresh_token: z.string().optional()\n})\n .strip();\n/**\n * OAuth 2.1 error response\n */\nexport const OAuthErrorResponseSchema = z.object({\n error: z.string(),\n error_description: z.string().optional(),\n error_uri: z.string().optional()\n});\n/**\n * Optional version of SafeUrlSchema that allows empty string for retrocompatibility on tos_uri and logo_uri\n */\nexport const OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z.literal('').transform(() => undefined));\n/**\n * RFC 7591 OAuth 2.0 Dynamic Client Registration metadata\n */\nexport const OAuthClientMetadataSchema = z\n .object({\n redirect_uris: z.array(SafeUrlSchema),\n token_endpoint_auth_method: z.string().optional(),\n grant_types: z.array(z.string()).optional(),\n response_types: z.array(z.string()).optional(),\n client_name: z.string().optional(),\n client_uri: SafeUrlSchema.optional(),\n logo_uri: OptionalSafeUrlSchema,\n scope: z.string().optional(),\n contacts: z.array(z.string()).optional(),\n tos_uri: OptionalSafeUrlSchema,\n policy_uri: z.string().optional(),\n jwks_uri: SafeUrlSchema.optional(),\n jwks: z.any().optional(),\n software_id: z.string().optional(),\n software_version: z.string().optional(),\n software_statement: z.string().optional()\n})\n .strip();\n/**\n * RFC 7591 OAuth 2.0 Dynamic Client Registration client information\n */\nexport const OAuthClientInformationSchema = z\n .object({\n client_id: z.string(),\n client_secret: z.string().optional(),\n client_id_issued_at: z.number().optional(),\n client_secret_expires_at: z.number().optional()\n})\n .strip();\n/**\n * RFC 7591 OAuth 2.0 Dynamic Client Registration full response (client information plus metadata)\n */\nexport const OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);\n/**\n * RFC 7591 OAuth 2.0 Dynamic Client Registration error response\n */\nexport const OAuthClientRegistrationErrorSchema = z\n .object({\n error: z.string(),\n error_description: z.string().optional()\n})\n .strip();\n/**\n * RFC 7009 OAuth 2.0 Token Revocation request\n */\nexport const OAuthTokenRevocationRequestSchema = z\n .object({\n token: z.string(),\n token_type_hint: z.string().optional()\n})\n .strip();\n//# sourceMappingURL=auth.js.map","/**\n * Base class for all OAuth errors\n */\nexport class OAuthError extends Error {\n constructor(message, errorUri) {\n super(message);\n this.errorUri = errorUri;\n this.name = this.constructor.name;\n }\n /**\n * Converts the error to a standard OAuth error response object\n */\n toResponseObject() {\n const response = {\n error: this.errorCode,\n error_description: this.message\n };\n if (this.errorUri) {\n response.error_uri = this.errorUri;\n }\n return response;\n }\n get errorCode() {\n return this.constructor.errorCode;\n }\n}\n/**\n * Invalid request error - The request is missing a required parameter,\n * includes an invalid parameter value, includes a parameter more than once,\n * or is otherwise malformed.\n */\nexport class InvalidRequestError extends OAuthError {\n}\nInvalidRequestError.errorCode = 'invalid_request';\n/**\n * Invalid client error - Client authentication failed (e.g., unknown client, no client\n * authentication included, or unsupported authentication method).\n */\nexport class InvalidClientError extends OAuthError {\n}\nInvalidClientError.errorCode = 'invalid_client';\n/**\n * Invalid grant error - The provided authorization grant or refresh token is\n * invalid, expired, revoked, does not match the redirection URI used in the\n * authorization request, or was issued to another client.\n */\nexport class InvalidGrantError extends OAuthError {\n}\nInvalidGrantError.errorCode = 'invalid_grant';\n/**\n * Unauthorized client error - The authenticated client is not authorized to use\n * this authorization grant type.\n */\nexport class UnauthorizedClientError extends OAuthError {\n}\nUnauthorizedClientError.errorCode = 'unauthorized_client';\n/**\n * Unsupported grant type error - The authorization grant type is not supported\n * by the authorization server.\n */\nexport class UnsupportedGrantTypeError extends OAuthError {\n}\nUnsupportedGrantTypeError.errorCode = 'unsupported_grant_type';\n/**\n * Invalid scope error - The requested scope is invalid, unknown, malformed, or\n * exceeds the scope granted by the resource owner.\n */\nexport class InvalidScopeError extends OAuthError {\n}\nInvalidScopeError.errorCode = 'invalid_scope';\n/**\n * Access denied error - The resource owner or authorization server denied the request.\n */\nexport class AccessDeniedError extends OAuthError {\n}\nAccessDeniedError.errorCode = 'access_denied';\n/**\n * Server error - The authorization server encountered an unexpected condition\n * that prevented it from fulfilling the request.\n */\nexport class ServerError extends OAuthError {\n}\nServerError.errorCode = 'server_error';\n/**\n * Temporarily unavailable error - The authorization server is currently unable to\n * handle the request due to a temporary overloading or maintenance of the server.\n */\nexport class TemporarilyUnavailableError extends OAuthError {\n}\nTemporarilyUnavailableError.errorCode = 'temporarily_unavailable';\n/**\n * Unsupported response type error - The authorization server does not support\n * obtaining an authorization code using this method.\n */\nexport class UnsupportedResponseTypeError extends OAuthError {\n}\nUnsupportedResponseTypeError.errorCode = 'unsupported_response_type';\n/**\n * Unsupported token type error - The authorization server does not support\n * the requested token type.\n */\nexport class UnsupportedTokenTypeError extends OAuthError {\n}\nUnsupportedTokenTypeError.errorCode = 'unsupported_token_type';\n/**\n * Invalid token error - The access token provided is expired, revoked, malformed,\n * or invalid for other reasons.\n */\nexport class InvalidTokenError extends OAuthError {\n}\nInvalidTokenError.errorCode = 'invalid_token';\n/**\n * Method not allowed error - The HTTP method used is not allowed for this endpoint.\n * (Custom, non-standard error)\n */\nexport class MethodNotAllowedError extends OAuthError {\n}\nMethodNotAllowedError.errorCode = 'method_not_allowed';\n/**\n * Too many requests error - Rate limit exceeded.\n * (Custom, non-standard error based on RFC 6585)\n */\nexport class TooManyRequestsError extends OAuthError {\n}\nTooManyRequestsError.errorCode = 'too_many_requests';\n/**\n * Invalid client metadata error - The client metadata is invalid.\n * (Custom error for dynamic client registration - RFC 7591)\n */\nexport class InvalidClientMetadataError extends OAuthError {\n}\nInvalidClientMetadataError.errorCode = 'invalid_client_metadata';\n/**\n * Insufficient scope error - The request requires higher privileges than provided by the access token.\n */\nexport class InsufficientScopeError extends OAuthError {\n}\nInsufficientScopeError.errorCode = 'insufficient_scope';\n/**\n * Invalid target error - The requested resource is invalid, missing, unknown, or malformed.\n * (Custom error for resource indicators - RFC 8707)\n */\nexport class InvalidTargetError extends OAuthError {\n}\nInvalidTargetError.errorCode = 'invalid_target';\n/**\n * A utility class for defining one-off error codes\n */\nexport class CustomOAuthError extends OAuthError {\n constructor(customErrorCode, message, errorUri) {\n super(message, errorUri);\n this.customErrorCode = customErrorCode;\n }\n get errorCode() {\n return this.customErrorCode;\n }\n}\n/**\n * A full list of all OAuthErrors, enabling parsing from error responses\n */\nexport const OAUTH_ERRORS = {\n [InvalidRequestError.errorCode]: InvalidRequestError,\n [InvalidClientError.errorCode]: InvalidClientError,\n [InvalidGrantError.errorCode]: InvalidGrantError,\n [UnauthorizedClientError.errorCode]: UnauthorizedClientError,\n [UnsupportedGrantTypeError.errorCode]: UnsupportedGrantTypeError,\n [InvalidScopeError.errorCode]: InvalidScopeError,\n [AccessDeniedError.errorCode]: AccessDeniedError,\n [ServerError.errorCode]: ServerError,\n [TemporarilyUnavailableError.errorCode]: TemporarilyUnavailableError,\n [UnsupportedResponseTypeError.errorCode]: UnsupportedResponseTypeError,\n [UnsupportedTokenTypeError.errorCode]: UnsupportedTokenTypeError,\n [InvalidTokenError.errorCode]: InvalidTokenError,\n [MethodNotAllowedError.errorCode]: MethodNotAllowedError,\n [TooManyRequestsError.errorCode]: TooManyRequestsError,\n [InvalidClientMetadataError.errorCode]: InvalidClientMetadataError,\n [InsufficientScopeError.errorCode]: InsufficientScopeError,\n [InvalidTargetError.errorCode]: InvalidTargetError\n};\n//# sourceMappingURL=errors.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nclass _CodeOrName {\n}\nexports._CodeOrName = _CodeOrName;\nexports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;\nclass Name extends _CodeOrName {\n constructor(s) {\n super();\n if (!exports.IDENTIFIER.test(s))\n throw new Error(\"CodeGen: name must be a valid identifier\");\n this.str = s;\n }\n toString() {\n return this.str;\n }\n emptyStr() {\n return false;\n }\n get names() {\n return { [this.str]: 1 };\n }\n}\nexports.Name = Name;\nclass _Code extends _CodeOrName {\n constructor(code) {\n super();\n this._items = typeof code === \"string\" ? [code] : code;\n }\n toString() {\n return this.str;\n }\n emptyStr() {\n if (this._items.length > 1)\n return false;\n const item = this._items[0];\n return item === \"\" || item === '\"\"';\n }\n get str() {\n var _a;\n return ((_a = this._str) !== null && _a !== void 0 ? _a : (this._str = this._items.reduce((s, c) => `${s}${c}`, \"\")));\n }\n get names() {\n var _a;\n return ((_a = this._names) !== null && _a !== void 0 ? _a : (this._names = this._items.reduce((names, c) => {\n if (c instanceof Name)\n names[c.str] = (names[c.str] || 0) + 1;\n return names;\n }, {})));\n }\n}\nexports._Code = _Code;\nexports.nil = new _Code(\"\");\nfunction _(strs, ...args) {\n const code = [strs[0]];\n let i = 0;\n while (i < args.length) {\n addCodeArg(code, args[i]);\n code.push(strs[++i]);\n }\n return new _Code(code);\n}\nexports._ = _;\nconst plus = new _Code(\"+\");\nfunction str(strs, ...args) {\n const expr = [safeStringify(strs[0])];\n let i = 0;\n while (i < args.length) {\n expr.push(plus);\n addCodeArg(expr, args[i]);\n expr.push(plus, safeStringify(strs[++i]));\n }\n optimize(expr);\n return new _Code(expr);\n}\nexports.str = str;\nfunction addCodeArg(code, arg) {\n if (arg instanceof _Code)\n code.push(...arg._items);\n else if (arg instanceof Name)\n code.push(arg);\n else\n code.push(interpolate(arg));\n}\nexports.addCodeArg = addCodeArg;\nfunction optimize(expr) {\n let i = 1;\n while (i < expr.length - 1) {\n if (expr[i] === plus) {\n const res = mergeExprItems(expr[i - 1], expr[i + 1]);\n if (res !== undefined) {\n expr.splice(i - 1, 3, res);\n continue;\n }\n expr[i++] = \"+\";\n }\n i++;\n }\n}\nfunction mergeExprItems(a, b) {\n if (b === '\"\"')\n return a;\n if (a === '\"\"')\n return b;\n if (typeof a == \"string\") {\n if (b instanceof Name || a[a.length - 1] !== '\"')\n return;\n if (typeof b != \"string\")\n return `${a.slice(0, -1)}${b}\"`;\n if (b[0] === '\"')\n return a.slice(0, -1) + b.slice(1);\n return;\n }\n if (typeof b == \"string\" && b[0] === '\"' && !(a instanceof Name))\n return `\"${a}${b.slice(1)}`;\n return;\n}\nfunction strConcat(c1, c2) {\n return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str `${c1}${c2}`;\n}\nexports.strConcat = strConcat;\n// TODO do not allow arrays here\nfunction interpolate(x) {\n return typeof x == \"number\" || typeof x == \"boolean\" || x === null\n ? x\n : safeStringify(Array.isArray(x) ? x.join(\",\") : x);\n}\nfunction stringify(x) {\n return new _Code(safeStringify(x));\n}\nexports.stringify = stringify;\nfunction safeStringify(x) {\n return JSON.stringify(x)\n .replace(/\\u2028/g, \"\\\\u2028\")\n .replace(/\\u2029/g, \"\\\\u2029\");\n}\nexports.safeStringify = safeStringify;\nfunction getProperty(key) {\n return typeof key == \"string\" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`;\n}\nexports.getProperty = getProperty;\n//Does best effort to format the name properly\nfunction getEsmExportName(key) {\n if (typeof key == \"string\" && exports.IDENTIFIER.test(key)) {\n return new _Code(`${key}`);\n }\n throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);\n}\nexports.getEsmExportName = getEsmExportName;\nfunction regexpCode(rx) {\n return new _Code(rx.toString());\n}\nexports.regexpCode = regexpCode;\n//# sourceMappingURL=code.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;\nconst code_1 = require(\"./code\");\nclass ValueError extends Error {\n constructor(name) {\n super(`CodeGen: \"code\" for ${name} not defined`);\n this.value = name.value;\n }\n}\nvar UsedValueState;\n(function (UsedValueState) {\n UsedValueState[UsedValueState[\"Started\"] = 0] = \"Started\";\n UsedValueState[UsedValueState[\"Completed\"] = 1] = \"Completed\";\n})(UsedValueState || (exports.UsedValueState = UsedValueState = {}));\nexports.varKinds = {\n const: new code_1.Name(\"const\"),\n let: new code_1.Name(\"let\"),\n var: new code_1.Name(\"var\"),\n};\nclass Scope {\n constructor({ prefixes, parent } = {}) {\n this._names = {};\n this._prefixes = prefixes;\n this._parent = parent;\n }\n toName(nameOrPrefix) {\n return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix);\n }\n name(prefix) {\n return new code_1.Name(this._newName(prefix));\n }\n _newName(prefix) {\n const ng = this._names[prefix] || this._nameGroup(prefix);\n return `${prefix}${ng.index++}`;\n }\n _nameGroup(prefix) {\n var _a, _b;\n if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || (this._prefixes && !this._prefixes.has(prefix))) {\n throw new Error(`CodeGen: prefix \"${prefix}\" is not allowed in this scope`);\n }\n return (this._names[prefix] = { prefix, index: 0 });\n }\n}\nexports.Scope = Scope;\nclass ValueScopeName extends code_1.Name {\n constructor(prefix, nameStr) {\n super(nameStr);\n this.prefix = prefix;\n }\n setValue(value, { property, itemIndex }) {\n this.value = value;\n this.scopePath = (0, code_1._) `.${new code_1.Name(property)}[${itemIndex}]`;\n }\n}\nexports.ValueScopeName = ValueScopeName;\nconst line = (0, code_1._) `\\n`;\nclass ValueScope extends Scope {\n constructor(opts) {\n super(opts);\n this._values = {};\n this._scope = opts.scope;\n this.opts = { ...opts, _n: opts.lines ? line : code_1.nil };\n }\n get() {\n return this._scope;\n }\n name(prefix) {\n return new ValueScopeName(prefix, this._newName(prefix));\n }\n value(nameOrPrefix, value) {\n var _a;\n if (value.ref === undefined)\n throw new Error(\"CodeGen: ref must be passed in value\");\n const name = this.toName(nameOrPrefix);\n const { prefix } = name;\n const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref;\n let vs = this._values[prefix];\n if (vs) {\n const _name = vs.get(valueKey);\n if (_name)\n return _name;\n }\n else {\n vs = this._values[prefix] = new Map();\n }\n vs.set(valueKey, name);\n const s = this._scope[prefix] || (this._scope[prefix] = []);\n const itemIndex = s.length;\n s[itemIndex] = value.ref;\n name.setValue(value, { property: prefix, itemIndex });\n return name;\n }\n getValue(prefix, keyOrRef) {\n const vs = this._values[prefix];\n if (!vs)\n return;\n return vs.get(keyOrRef);\n }\n scopeRefs(scopeName, values = this._values) {\n return this._reduceValues(values, (name) => {\n if (name.scopePath === undefined)\n throw new Error(`CodeGen: name \"${name}\" has no value`);\n return (0, code_1._) `${scopeName}${name.scopePath}`;\n });\n }\n scopeCode(values = this._values, usedValues, getCode) {\n return this._reduceValues(values, (name) => {\n if (name.value === undefined)\n throw new Error(`CodeGen: name \"${name}\" has no value`);\n return name.value.code;\n }, usedValues, getCode);\n }\n _reduceValues(values, valueCode, usedValues = {}, getCode) {\n let code = code_1.nil;\n for (const prefix in values) {\n const vs = values[prefix];\n if (!vs)\n continue;\n const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map());\n vs.forEach((name) => {\n if (nameSet.has(name))\n return;\n nameSet.set(name, UsedValueState.Started);\n let c = valueCode(name);\n if (c) {\n const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;\n code = (0, code_1._) `${code}${def} ${name} = ${c};${this.opts._n}`;\n }\n else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) {\n code = (0, code_1._) `${code}${c}${this.opts._n}`;\n }\n else {\n throw new ValueError(name);\n }\n nameSet.set(name, UsedValueState.Completed);\n });\n }\n return code;\n }\n}\nexports.ValueScope = ValueScope;\n//# sourceMappingURL=scope.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0;\nconst code_1 = require(\"./code\");\nconst scope_1 = require(\"./scope\");\nvar code_2 = require(\"./code\");\nObject.defineProperty(exports, \"_\", { enumerable: true, get: function () { return code_2._; } });\nObject.defineProperty(exports, \"str\", { enumerable: true, get: function () { return code_2.str; } });\nObject.defineProperty(exports, \"strConcat\", { enumerable: true, get: function () { return code_2.strConcat; } });\nObject.defineProperty(exports, \"nil\", { enumerable: true, get: function () { return code_2.nil; } });\nObject.defineProperty(exports, \"getProperty\", { enumerable: true, get: function () { return code_2.getProperty; } });\nObject.defineProperty(exports, \"stringify\", { enumerable: true, get: function () { return code_2.stringify; } });\nObject.defineProperty(exports, \"regexpCode\", { enumerable: true, get: function () { return code_2.regexpCode; } });\nObject.defineProperty(exports, \"Name\", { enumerable: true, get: function () { return code_2.Name; } });\nvar scope_2 = require(\"./scope\");\nObject.defineProperty(exports, \"Scope\", { enumerable: true, get: function () { return scope_2.Scope; } });\nObject.defineProperty(exports, \"ValueScope\", { enumerable: true, get: function () { return scope_2.ValueScope; } });\nObject.defineProperty(exports, \"ValueScopeName\", { enumerable: true, get: function () { return scope_2.ValueScopeName; } });\nObject.defineProperty(exports, \"varKinds\", { enumerable: true, get: function () { return scope_2.varKinds; } });\nexports.operators = {\n GT: new code_1._Code(\">\"),\n GTE: new code_1._Code(\">=\"),\n LT: new code_1._Code(\"<\"),\n LTE: new code_1._Code(\"<=\"),\n EQ: new code_1._Code(\"===\"),\n NEQ: new code_1._Code(\"!==\"),\n NOT: new code_1._Code(\"!\"),\n OR: new code_1._Code(\"||\"),\n AND: new code_1._Code(\"&&\"),\n ADD: new code_1._Code(\"+\"),\n};\nclass Node {\n optimizeNodes() {\n return this;\n }\n optimizeNames(_names, _constants) {\n return this;\n }\n}\nclass Def extends Node {\n constructor(varKind, name, rhs) {\n super();\n this.varKind = varKind;\n this.name = name;\n this.rhs = rhs;\n }\n render({ es5, _n }) {\n const varKind = es5 ? scope_1.varKinds.var : this.varKind;\n const rhs = this.rhs === undefined ? \"\" : ` = ${this.rhs}`;\n return `${varKind} ${this.name}${rhs};` + _n;\n }\n optimizeNames(names, constants) {\n if (!names[this.name.str])\n return;\n if (this.rhs)\n this.rhs = optimizeExpr(this.rhs, names, constants);\n return this;\n }\n get names() {\n return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};\n }\n}\nclass Assign extends Node {\n constructor(lhs, rhs, sideEffects) {\n super();\n this.lhs = lhs;\n this.rhs = rhs;\n this.sideEffects = sideEffects;\n }\n render({ _n }) {\n return `${this.lhs} = ${this.rhs};` + _n;\n }\n optimizeNames(names, constants) {\n if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)\n return;\n this.rhs = optimizeExpr(this.rhs, names, constants);\n return this;\n }\n get names() {\n const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names };\n return addExprNames(names, this.rhs);\n }\n}\nclass AssignOp extends Assign {\n constructor(lhs, op, rhs, sideEffects) {\n super(lhs, rhs, sideEffects);\n this.op = op;\n }\n render({ _n }) {\n return `${this.lhs} ${this.op}= ${this.rhs};` + _n;\n }\n}\nclass Label extends Node {\n constructor(label) {\n super();\n this.label = label;\n this.names = {};\n }\n render({ _n }) {\n return `${this.label}:` + _n;\n }\n}\nclass Break extends Node {\n constructor(label) {\n super();\n this.label = label;\n this.names = {};\n }\n render({ _n }) {\n const label = this.label ? ` ${this.label}` : \"\";\n return `break${label};` + _n;\n }\n}\nclass Throw extends Node {\n constructor(error) {\n super();\n this.error = error;\n }\n render({ _n }) {\n return `throw ${this.error};` + _n;\n }\n get names() {\n return this.error.names;\n }\n}\nclass AnyCode extends Node {\n constructor(code) {\n super();\n this.code = code;\n }\n render({ _n }) {\n return `${this.code};` + _n;\n }\n optimizeNodes() {\n return `${this.code}` ? this : undefined;\n }\n optimizeNames(names, constants) {\n this.code = optimizeExpr(this.code, names, constants);\n return this;\n }\n get names() {\n return this.code instanceof code_1._CodeOrName ? this.code.names : {};\n }\n}\nclass ParentNode extends Node {\n constructor(nodes = []) {\n super();\n this.nodes = nodes;\n }\n render(opts) {\n return this.nodes.reduce((code, n) => code + n.render(opts), \"\");\n }\n optimizeNodes() {\n const { nodes } = this;\n let i = nodes.length;\n while (i--) {\n const n = nodes[i].optimizeNodes();\n if (Array.isArray(n))\n nodes.splice(i, 1, ...n);\n else if (n)\n nodes[i] = n;\n else\n nodes.splice(i, 1);\n }\n return nodes.length > 0 ? this : undefined;\n }\n optimizeNames(names, constants) {\n const { nodes } = this;\n let i = nodes.length;\n while (i--) {\n // iterating backwards improves 1-pass optimization\n const n = nodes[i];\n if (n.optimizeNames(names, constants))\n continue;\n subtractNames(names, n.names);\n nodes.splice(i, 1);\n }\n return nodes.length > 0 ? this : undefined;\n }\n get names() {\n return this.nodes.reduce((names, n) => addNames(names, n.names), {});\n }\n}\nclass BlockNode extends ParentNode {\n render(opts) {\n return \"{\" + opts._n + super.render(opts) + \"}\" + opts._n;\n }\n}\nclass Root extends ParentNode {\n}\nclass Else extends BlockNode {\n}\nElse.kind = \"else\";\nclass If extends BlockNode {\n constructor(condition, nodes) {\n super(nodes);\n this.condition = condition;\n }\n render(opts) {\n let code = `if(${this.condition})` + super.render(opts);\n if (this.else)\n code += \"else \" + this.else.render(opts);\n return code;\n }\n optimizeNodes() {\n super.optimizeNodes();\n const cond = this.condition;\n if (cond === true)\n return this.nodes; // else is ignored here\n let e = this.else;\n if (e) {\n const ns = e.optimizeNodes();\n e = this.else = Array.isArray(ns) ? new Else(ns) : ns;\n }\n if (e) {\n if (cond === false)\n return e instanceof If ? e : e.nodes;\n if (this.nodes.length)\n return this;\n return new If(not(cond), e instanceof If ? [e] : e.nodes);\n }\n if (cond === false || !this.nodes.length)\n return undefined;\n return this;\n }\n optimizeNames(names, constants) {\n var _a;\n this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);\n if (!(super.optimizeNames(names, constants) || this.else))\n return;\n this.condition = optimizeExpr(this.condition, names, constants);\n return this;\n }\n get names() {\n const names = super.names;\n addExprNames(names, this.condition);\n if (this.else)\n addNames(names, this.else.names);\n return names;\n }\n}\nIf.kind = \"if\";\nclass For extends BlockNode {\n}\nFor.kind = \"for\";\nclass ForLoop extends For {\n constructor(iteration) {\n super();\n this.iteration = iteration;\n }\n render(opts) {\n return `for(${this.iteration})` + super.render(opts);\n }\n optimizeNames(names, constants) {\n if (!super.optimizeNames(names, constants))\n return;\n this.iteration = optimizeExpr(this.iteration, names, constants);\n return this;\n }\n get names() {\n return addNames(super.names, this.iteration.names);\n }\n}\nclass ForRange extends For {\n constructor(varKind, name, from, to) {\n super();\n this.varKind = varKind;\n this.name = name;\n this.from = from;\n this.to = to;\n }\n render(opts) {\n const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind;\n const { name, from, to } = this;\n return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);\n }\n get names() {\n const names = addExprNames(super.names, this.from);\n return addExprNames(names, this.to);\n }\n}\nclass ForIter extends For {\n constructor(loop, varKind, name, iterable) {\n super();\n this.loop = loop;\n this.varKind = varKind;\n this.name = name;\n this.iterable = iterable;\n }\n render(opts) {\n return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);\n }\n optimizeNames(names, constants) {\n if (!super.optimizeNames(names, constants))\n return;\n this.iterable = optimizeExpr(this.iterable, names, constants);\n return this;\n }\n get names() {\n return addNames(super.names, this.iterable.names);\n }\n}\nclass Func extends BlockNode {\n constructor(name, args, async) {\n super();\n this.name = name;\n this.args = args;\n this.async = async;\n }\n render(opts) {\n const _async = this.async ? \"async \" : \"\";\n return `${_async}function ${this.name}(${this.args})` + super.render(opts);\n }\n}\nFunc.kind = \"func\";\nclass Return extends ParentNode {\n render(opts) {\n return \"return \" + super.render(opts);\n }\n}\nReturn.kind = \"return\";\nclass Try extends BlockNode {\n render(opts) {\n let code = \"try\" + super.render(opts);\n if (this.catch)\n code += this.catch.render(opts);\n if (this.finally)\n code += this.finally.render(opts);\n return code;\n }\n optimizeNodes() {\n var _a, _b;\n super.optimizeNodes();\n (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes();\n (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();\n return this;\n }\n optimizeNames(names, constants) {\n var _a, _b;\n super.optimizeNames(names, constants);\n (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);\n (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);\n return this;\n }\n get names() {\n const names = super.names;\n if (this.catch)\n addNames(names, this.catch.names);\n if (this.finally)\n addNames(names, this.finally.names);\n return names;\n }\n}\nclass Catch extends BlockNode {\n constructor(error) {\n super();\n this.error = error;\n }\n render(opts) {\n return `catch(${this.error})` + super.render(opts);\n }\n}\nCatch.kind = \"catch\";\nclass Finally extends BlockNode {\n render(opts) {\n return \"finally\" + super.render(opts);\n }\n}\nFinally.kind = \"finally\";\nclass CodeGen {\n constructor(extScope, opts = {}) {\n this._values = {};\n this._blockStarts = [];\n this._constants = {};\n this.opts = { ...opts, _n: opts.lines ? \"\\n\" : \"\" };\n this._extScope = extScope;\n this._scope = new scope_1.Scope({ parent: extScope });\n this._nodes = [new Root()];\n }\n toString() {\n return this._root.render(this.opts);\n }\n // returns unique name in the internal scope\n name(prefix) {\n return this._scope.name(prefix);\n }\n // reserves unique name in the external scope\n scopeName(prefix) {\n return this._extScope.name(prefix);\n }\n // reserves unique name in the external scope and assigns value to it\n scopeValue(prefixOrName, value) {\n const name = this._extScope.value(prefixOrName, value);\n const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set());\n vs.add(name);\n return name;\n }\n getScopeValue(prefix, keyOrRef) {\n return this._extScope.getValue(prefix, keyOrRef);\n }\n // return code that assigns values in the external scope to the names that are used internally\n // (same names that were returned by gen.scopeName or gen.scopeValue)\n scopeRefs(scopeName) {\n return this._extScope.scopeRefs(scopeName, this._values);\n }\n scopeCode() {\n return this._extScope.scopeCode(this._values);\n }\n _def(varKind, nameOrPrefix, rhs, constant) {\n const name = this._scope.toName(nameOrPrefix);\n if (rhs !== undefined && constant)\n this._constants[name.str] = rhs;\n this._leafNode(new Def(varKind, name, rhs));\n return name;\n }\n // `const` declaration (`var` in es5 mode)\n const(nameOrPrefix, rhs, _constant) {\n return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant);\n }\n // `let` declaration with optional assignment (`var` in es5 mode)\n let(nameOrPrefix, rhs, _constant) {\n return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant);\n }\n // `var` declaration with optional assignment\n var(nameOrPrefix, rhs, _constant) {\n return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant);\n }\n // assignment code\n assign(lhs, rhs, sideEffects) {\n return this._leafNode(new Assign(lhs, rhs, sideEffects));\n }\n // `+=` code\n add(lhs, rhs) {\n return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs));\n }\n // appends passed SafeExpr to code or executes Block\n code(c) {\n if (typeof c == \"function\")\n c();\n else if (c !== code_1.nil)\n this._leafNode(new AnyCode(c));\n return this;\n }\n // returns code for object literal for the passed argument list of key-value pairs\n object(...keyValues) {\n const code = [\"{\"];\n for (const [key, value] of keyValues) {\n if (code.length > 1)\n code.push(\",\");\n code.push(key);\n if (key !== value || this.opts.es5) {\n code.push(\":\");\n (0, code_1.addCodeArg)(code, value);\n }\n }\n code.push(\"}\");\n return new code_1._Code(code);\n }\n // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)\n if(condition, thenBody, elseBody) {\n this._blockNode(new If(condition));\n if (thenBody && elseBody) {\n this.code(thenBody).else().code(elseBody).endIf();\n }\n else if (thenBody) {\n this.code(thenBody).endIf();\n }\n else if (elseBody) {\n throw new Error('CodeGen: \"else\" body without \"then\" body');\n }\n return this;\n }\n // `else if` clause - invalid without `if` or after `else` clauses\n elseIf(condition) {\n return this._elseNode(new If(condition));\n }\n // `else` clause - only valid after `if` or `else if` clauses\n else() {\n return this._elseNode(new Else());\n }\n // end `if` statement (needed if gen.if was used only with condition)\n endIf() {\n return this._endBlockNode(If, Else);\n }\n _for(node, forBody) {\n this._blockNode(node);\n if (forBody)\n this.code(forBody).endFor();\n return this;\n }\n // a generic `for` clause (or statement if `forBody` is passed)\n for(iteration, forBody) {\n return this._for(new ForLoop(iteration), forBody);\n }\n // `for` statement for a range of values\n forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {\n const name = this._scope.toName(nameOrPrefix);\n return this._for(new ForRange(varKind, name, from, to), () => forBody(name));\n }\n // `for-of` statement (in es5 mode replace with a normal for loop)\n forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) {\n const name = this._scope.toName(nameOrPrefix);\n if (this.opts.es5) {\n const arr = iterable instanceof code_1.Name ? iterable : this.var(\"_arr\", iterable);\n return this.forRange(\"_i\", 0, (0, code_1._) `${arr}.length`, (i) => {\n this.var(name, (0, code_1._) `${arr}[${i}]`);\n forBody(name);\n });\n }\n return this._for(new ForIter(\"of\", varKind, name, iterable), () => forBody(name));\n }\n // `for-in` statement.\n // With option `ownProperties` replaced with a `for-of` loop for object keys\n forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {\n if (this.opts.ownProperties) {\n return this.forOf(nameOrPrefix, (0, code_1._) `Object.keys(${obj})`, forBody);\n }\n const name = this._scope.toName(nameOrPrefix);\n return this._for(new ForIter(\"in\", varKind, name, obj), () => forBody(name));\n }\n // end `for` loop\n endFor() {\n return this._endBlockNode(For);\n }\n // `label` statement\n label(label) {\n return this._leafNode(new Label(label));\n }\n // `break` statement\n break(label) {\n return this._leafNode(new Break(label));\n }\n // `return` statement\n return(value) {\n const node = new Return();\n this._blockNode(node);\n this.code(value);\n if (node.nodes.length !== 1)\n throw new Error('CodeGen: \"return\" should have one node');\n return this._endBlockNode(Return);\n }\n // `try` statement\n try(tryBody, catchCode, finallyCode) {\n if (!catchCode && !finallyCode)\n throw new Error('CodeGen: \"try\" without \"catch\" and \"finally\"');\n const node = new Try();\n this._blockNode(node);\n this.code(tryBody);\n if (catchCode) {\n const error = this.name(\"e\");\n this._currNode = node.catch = new Catch(error);\n catchCode(error);\n }\n if (finallyCode) {\n this._currNode = node.finally = new Finally();\n this.code(finallyCode);\n }\n return this._endBlockNode(Catch, Finally);\n }\n // `throw` statement\n throw(error) {\n return this._leafNode(new Throw(error));\n }\n // start self-balancing block\n block(body, nodeCount) {\n this._blockStarts.push(this._nodes.length);\n if (body)\n this.code(body).endBlock(nodeCount);\n return this;\n }\n // end the current self-balancing block\n endBlock(nodeCount) {\n const len = this._blockStarts.pop();\n if (len === undefined)\n throw new Error(\"CodeGen: not in self-balancing block\");\n const toClose = this._nodes.length - len;\n if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) {\n throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);\n }\n this._nodes.length = len;\n return this;\n }\n // `function` heading (or definition if funcBody is passed)\n func(name, args = code_1.nil, async, funcBody) {\n this._blockNode(new Func(name, args, async));\n if (funcBody)\n this.code(funcBody).endFunc();\n return this;\n }\n // end function definition\n endFunc() {\n return this._endBlockNode(Func);\n }\n optimize(n = 1) {\n while (n-- > 0) {\n this._root.optimizeNodes();\n this._root.optimizeNames(this._root.names, this._constants);\n }\n }\n _leafNode(node) {\n this._currNode.nodes.push(node);\n return this;\n }\n _blockNode(node) {\n this._currNode.nodes.push(node);\n this._nodes.push(node);\n }\n _endBlockNode(N1, N2) {\n const n = this._currNode;\n if (n instanceof N1 || (N2 && n instanceof N2)) {\n this._nodes.pop();\n return this;\n }\n throw new Error(`CodeGen: not in block \"${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}\"`);\n }\n _elseNode(node) {\n const n = this._currNode;\n if (!(n instanceof If)) {\n throw new Error('CodeGen: \"else\" without \"if\"');\n }\n this._currNode = n.else = node;\n return this;\n }\n get _root() {\n return this._nodes[0];\n }\n get _currNode() {\n const ns = this._nodes;\n return ns[ns.length - 1];\n }\n set _currNode(node) {\n const ns = this._nodes;\n ns[ns.length - 1] = node;\n }\n}\nexports.CodeGen = CodeGen;\nfunction addNames(names, from) {\n for (const n in from)\n names[n] = (names[n] || 0) + (from[n] || 0);\n return names;\n}\nfunction addExprNames(names, from) {\n return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;\n}\nfunction optimizeExpr(expr, names, constants) {\n if (expr instanceof code_1.Name)\n return replaceName(expr);\n if (!canOptimize(expr))\n return expr;\n return new code_1._Code(expr._items.reduce((items, c) => {\n if (c instanceof code_1.Name)\n c = replaceName(c);\n if (c instanceof code_1._Code)\n items.push(...c._items);\n else\n items.push(c);\n return items;\n }, []));\n function replaceName(n) {\n const c = constants[n.str];\n if (c === undefined || names[n.str] !== 1)\n return n;\n delete names[n.str];\n return c;\n }\n function canOptimize(e) {\n return (e instanceof code_1._Code &&\n e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined));\n }\n}\nfunction subtractNames(names, from) {\n for (const n in from)\n names[n] = (names[n] || 0) - (from[n] || 0);\n}\nfunction not(x) {\n return typeof x == \"boolean\" || typeof x == \"number\" || x === null ? !x : (0, code_1._) `!${par(x)}`;\n}\nexports.not = not;\nconst andCode = mappend(exports.operators.AND);\n// boolean AND (&&) expression with the passed arguments\nfunction and(...args) {\n return args.reduce(andCode);\n}\nexports.and = and;\nconst orCode = mappend(exports.operators.OR);\n// boolean OR (||) expression with the passed arguments\nfunction or(...args) {\n return args.reduce(orCode);\n}\nexports.or = or;\nfunction mappend(op) {\n return (x, y) => (x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._) `${par(x)} ${op} ${par(y)}`);\n}\nfunction par(x) {\n return x instanceof code_1.Name ? x : (0, code_1._) `(${x})`;\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0;\nconst codegen_1 = require(\"./codegen\");\nconst code_1 = require(\"./codegen/code\");\n// TODO refactor to use Set\nfunction toHash(arr) {\n const hash = {};\n for (const item of arr)\n hash[item] = true;\n return hash;\n}\nexports.toHash = toHash;\nfunction alwaysValidSchema(it, schema) {\n if (typeof schema == \"boolean\")\n return schema;\n if (Object.keys(schema).length === 0)\n return true;\n checkUnknownRules(it, schema);\n return !schemaHasRules(schema, it.self.RULES.all);\n}\nexports.alwaysValidSchema = alwaysValidSchema;\nfunction checkUnknownRules(it, schema = it.schema) {\n const { opts, self } = it;\n if (!opts.strictSchema)\n return;\n if (typeof schema === \"boolean\")\n return;\n const rules = self.RULES.keywords;\n for (const key in schema) {\n if (!rules[key])\n checkStrictMode(it, `unknown keyword: \"${key}\"`);\n }\n}\nexports.checkUnknownRules = checkUnknownRules;\nfunction schemaHasRules(schema, rules) {\n if (typeof schema == \"boolean\")\n return !schema;\n for (const key in schema)\n if (rules[key])\n return true;\n return false;\n}\nexports.schemaHasRules = schemaHasRules;\nfunction schemaHasRulesButRef(schema, RULES) {\n if (typeof schema == \"boolean\")\n return !schema;\n for (const key in schema)\n if (key !== \"$ref\" && RULES.all[key])\n return true;\n return false;\n}\nexports.schemaHasRulesButRef = schemaHasRulesButRef;\nfunction schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {\n if (!$data) {\n if (typeof schema == \"number\" || typeof schema == \"boolean\")\n return schema;\n if (typeof schema == \"string\")\n return (0, codegen_1._) `${schema}`;\n }\n return (0, codegen_1._) `${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;\n}\nexports.schemaRefOrVal = schemaRefOrVal;\nfunction unescapeFragment(str) {\n return unescapeJsonPointer(decodeURIComponent(str));\n}\nexports.unescapeFragment = unescapeFragment;\nfunction escapeFragment(str) {\n return encodeURIComponent(escapeJsonPointer(str));\n}\nexports.escapeFragment = escapeFragment;\nfunction escapeJsonPointer(str) {\n if (typeof str == \"number\")\n return `${str}`;\n return str.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\nexports.escapeJsonPointer = escapeJsonPointer;\nfunction unescapeJsonPointer(str) {\n return str.replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n}\nexports.unescapeJsonPointer = unescapeJsonPointer;\nfunction eachItem(xs, f) {\n if (Array.isArray(xs)) {\n for (const x of xs)\n f(x);\n }\n else {\n f(xs);\n }\n}\nexports.eachItem = eachItem;\nfunction makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName, }) {\n return (gen, from, to, toName) => {\n const res = to === undefined\n ? from\n : to instanceof codegen_1.Name\n ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to)\n : from instanceof codegen_1.Name\n ? (mergeToName(gen, to, from), from)\n : mergeValues(from, to);\n return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;\n };\n}\nexports.mergeEvaluated = {\n props: makeMergeEvaluated({\n mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => {\n gen.if((0, codegen_1._) `${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._) `${to} || {}`).code((0, codegen_1._) `Object.assign(${to}, ${from})`));\n }),\n mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => {\n if (from === true) {\n gen.assign(to, true);\n }\n else {\n gen.assign(to, (0, codegen_1._) `${to} || {}`);\n setEvaluated(gen, to, from);\n }\n }),\n mergeValues: (from, to) => (from === true ? true : { ...from, ...to }),\n resultToName: evaluatedPropsToName,\n }),\n items: makeMergeEvaluated({\n mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._) `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),\n mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._) `${to} > ${from} ? ${to} : ${from}`)),\n mergeValues: (from, to) => (from === true ? true : Math.max(from, to)),\n resultToName: (gen, items) => gen.var(\"items\", items),\n }),\n};\nfunction evaluatedPropsToName(gen, ps) {\n if (ps === true)\n return gen.var(\"props\", true);\n const props = gen.var(\"props\", (0, codegen_1._) `{}`);\n if (ps !== undefined)\n setEvaluated(gen, props, ps);\n return props;\n}\nexports.evaluatedPropsToName = evaluatedPropsToName;\nfunction setEvaluated(gen, props, ps) {\n Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._) `${props}${(0, codegen_1.getProperty)(p)}`, true));\n}\nexports.setEvaluated = setEvaluated;\nconst snippets = {};\nfunction useFunc(gen, f) {\n return gen.scopeValue(\"func\", {\n ref: f,\n code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)),\n });\n}\nexports.useFunc = useFunc;\nvar Type;\n(function (Type) {\n Type[Type[\"Num\"] = 0] = \"Num\";\n Type[Type[\"Str\"] = 1] = \"Str\";\n})(Type || (exports.Type = Type = {}));\nfunction getErrorPath(dataProp, dataPropType, jsPropertySyntax) {\n // let path\n if (dataProp instanceof codegen_1.Name) {\n const isNumber = dataPropType === Type.Num;\n return jsPropertySyntax\n ? isNumber\n ? (0, codegen_1._) `\"[\" + ${dataProp} + \"]\"`\n : (0, codegen_1._) `\"['\" + ${dataProp} + \"']\"`\n : isNumber\n ? (0, codegen_1._) `\"/\" + ${dataProp}`\n : (0, codegen_1._) `\"/\" + ${dataProp}.replace(/~/g, \"~0\").replace(/\\\\//g, \"~1\")`; // TODO maybe use global escapePointer\n }\n return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : \"/\" + escapeJsonPointer(dataProp);\n}\nexports.getErrorPath = getErrorPath;\nfunction checkStrictMode(it, msg, mode = it.opts.strictSchema) {\n if (!mode)\n return;\n msg = `strict mode: ${msg}`;\n if (mode === true)\n throw new Error(msg);\n it.self.logger.warn(msg);\n}\nexports.checkStrictMode = checkStrictMode;\n//# sourceMappingURL=util.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"./codegen\");\nconst names = {\n // validation function arguments\n data: new codegen_1.Name(\"data\"), // data passed to validation function\n // args passed from referencing schema\n valCxt: new codegen_1.Name(\"valCxt\"), // validation/data context - should not be used directly, it is destructured to the names below\n instancePath: new codegen_1.Name(\"instancePath\"),\n parentData: new codegen_1.Name(\"parentData\"),\n parentDataProperty: new codegen_1.Name(\"parentDataProperty\"),\n rootData: new codegen_1.Name(\"rootData\"), // root data - same as the data passed to the first/top validation function\n dynamicAnchors: new codegen_1.Name(\"dynamicAnchors\"), // used to support recursiveRef and dynamicRef\n // function scoped variables\n vErrors: new codegen_1.Name(\"vErrors\"), // null or array of validation errors\n errors: new codegen_1.Name(\"errors\"), // counter of validation errors\n this: new codegen_1.Name(\"this\"),\n // \"globals\"\n self: new codegen_1.Name(\"self\"),\n scope: new codegen_1.Name(\"scope\"),\n // JTD serialize/parse name for JSON string and position\n json: new codegen_1.Name(\"json\"),\n jsonPos: new codegen_1.Name(\"jsonPos\"),\n jsonLen: new codegen_1.Name(\"jsonLen\"),\n jsonPart: new codegen_1.Name(\"jsonPart\"),\n};\nexports.default = names;\n//# sourceMappingURL=names.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;\nconst codegen_1 = require(\"./codegen\");\nconst util_1 = require(\"./util\");\nconst names_1 = require(\"./names\");\nexports.keywordError = {\n message: ({ keyword }) => (0, codegen_1.str) `must pass \"${keyword}\" keyword validation`,\n};\nexports.keyword$DataError = {\n message: ({ keyword, schemaType }) => schemaType\n ? (0, codegen_1.str) `\"${keyword}\" keyword must be ${schemaType} ($data)`\n : (0, codegen_1.str) `\"${keyword}\" keyword is invalid ($data)`,\n};\nfunction reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) {\n const { it } = cxt;\n const { gen, compositeRule, allErrors } = it;\n const errObj = errorObjectCode(cxt, error, errorPaths);\n if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) {\n addError(gen, errObj);\n }\n else {\n returnErrors(it, (0, codegen_1._) `[${errObj}]`);\n }\n}\nexports.reportError = reportError;\nfunction reportExtraError(cxt, error = exports.keywordError, errorPaths) {\n const { it } = cxt;\n const { gen, compositeRule, allErrors } = it;\n const errObj = errorObjectCode(cxt, error, errorPaths);\n addError(gen, errObj);\n if (!(compositeRule || allErrors)) {\n returnErrors(it, names_1.default.vErrors);\n }\n}\nexports.reportExtraError = reportExtraError;\nfunction resetErrorsCount(gen, errsCount) {\n gen.assign(names_1.default.errors, errsCount);\n gen.if((0, codegen_1._) `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._) `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));\n}\nexports.resetErrorsCount = resetErrorsCount;\nfunction extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) {\n /* istanbul ignore if */\n if (errsCount === undefined)\n throw new Error(\"ajv implementation error\");\n const err = gen.name(\"err\");\n gen.forRange(\"i\", errsCount, names_1.default.errors, (i) => {\n gen.const(err, (0, codegen_1._) `${names_1.default.vErrors}[${i}]`);\n gen.if((0, codegen_1._) `${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._) `${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath)));\n gen.assign((0, codegen_1._) `${err}.schemaPath`, (0, codegen_1.str) `${it.errSchemaPath}/${keyword}`);\n if (it.opts.verbose) {\n gen.assign((0, codegen_1._) `${err}.schema`, schemaValue);\n gen.assign((0, codegen_1._) `${err}.data`, data);\n }\n });\n}\nexports.extendErrors = extendErrors;\nfunction addError(gen, errObj) {\n const err = gen.const(\"err\", errObj);\n gen.if((0, codegen_1._) `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._) `[${err}]`), (0, codegen_1._) `${names_1.default.vErrors}.push(${err})`);\n gen.code((0, codegen_1._) `${names_1.default.errors}++`);\n}\nfunction returnErrors(it, errs) {\n const { gen, validateName, schemaEnv } = it;\n if (schemaEnv.$async) {\n gen.throw((0, codegen_1._) `new ${it.ValidationError}(${errs})`);\n }\n else {\n gen.assign((0, codegen_1._) `${validateName}.errors`, errs);\n gen.return(false);\n }\n}\nconst E = {\n keyword: new codegen_1.Name(\"keyword\"),\n schemaPath: new codegen_1.Name(\"schemaPath\"), // also used in JTD errors\n params: new codegen_1.Name(\"params\"),\n propertyName: new codegen_1.Name(\"propertyName\"),\n message: new codegen_1.Name(\"message\"),\n schema: new codegen_1.Name(\"schema\"),\n parentSchema: new codegen_1.Name(\"parentSchema\"),\n};\nfunction errorObjectCode(cxt, error, errorPaths) {\n const { createErrors } = cxt.it;\n if (createErrors === false)\n return (0, codegen_1._) `{}`;\n return errorObject(cxt, error, errorPaths);\n}\nfunction errorObject(cxt, error, errorPaths = {}) {\n const { gen, it } = cxt;\n const keyValues = [\n errorInstancePath(it, errorPaths),\n errorSchemaPath(cxt, errorPaths),\n ];\n extraErrorProps(cxt, error, keyValues);\n return gen.object(...keyValues);\n}\nfunction errorInstancePath({ errorPath }, { instancePath }) {\n const instPath = instancePath\n ? (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}`\n : errorPath;\n return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];\n}\nfunction errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {\n let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str) `${errSchemaPath}/${keyword}`;\n if (schemaPath) {\n schPath = (0, codegen_1.str) `${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;\n }\n return [E.schemaPath, schPath];\n}\nfunction extraErrorProps(cxt, { params, message }, keyValues) {\n const { keyword, data, schemaValue, it } = cxt;\n const { opts, propertyName, topSchemaRef, schemaPath } = it;\n keyValues.push([E.keyword, keyword], [E.params, typeof params == \"function\" ? params(cxt) : params || (0, codegen_1._) `{}`]);\n if (opts.messages) {\n keyValues.push([E.message, typeof message == \"function\" ? message(cxt) : message]);\n }\n if (opts.verbose) {\n keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._) `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);\n }\n if (propertyName)\n keyValues.push([E.propertyName, propertyName]);\n}\n//# sourceMappingURL=errors.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0;\nconst errors_1 = require(\"../errors\");\nconst codegen_1 = require(\"../codegen\");\nconst names_1 = require(\"../names\");\nconst boolError = {\n message: \"boolean schema is false\",\n};\nfunction topBoolOrEmptySchema(it) {\n const { gen, schema, validateName } = it;\n if (schema === false) {\n falseSchemaError(it, false);\n }\n else if (typeof schema == \"object\" && schema.$async === true) {\n gen.return(names_1.default.data);\n }\n else {\n gen.assign((0, codegen_1._) `${validateName}.errors`, null);\n gen.return(true);\n }\n}\nexports.topBoolOrEmptySchema = topBoolOrEmptySchema;\nfunction boolOrEmptySchema(it, valid) {\n const { gen, schema } = it;\n if (schema === false) {\n gen.var(valid, false); // TODO var\n falseSchemaError(it);\n }\n else {\n gen.var(valid, true); // TODO var\n }\n}\nexports.boolOrEmptySchema = boolOrEmptySchema;\nfunction falseSchemaError(it, overrideAllErrors) {\n const { gen, data } = it;\n // TODO maybe some other interface should be used for non-keyword validation errors...\n const cxt = {\n gen,\n keyword: \"false schema\",\n data,\n schema: false,\n schemaCode: false,\n schemaValue: false,\n params: {},\n it,\n };\n (0, errors_1.reportError)(cxt, boolError, undefined, overrideAllErrors);\n}\n//# sourceMappingURL=boolSchema.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRules = exports.isJSONType = void 0;\nconst _jsonTypes = [\"string\", \"number\", \"integer\", \"boolean\", \"null\", \"object\", \"array\"];\nconst jsonTypes = new Set(_jsonTypes);\nfunction isJSONType(x) {\n return typeof x == \"string\" && jsonTypes.has(x);\n}\nexports.isJSONType = isJSONType;\nfunction getRules() {\n const groups = {\n number: { type: \"number\", rules: [] },\n string: { type: \"string\", rules: [] },\n array: { type: \"array\", rules: [] },\n object: { type: \"object\", rules: [] },\n };\n return {\n types: { ...groups, integer: true, boolean: true, null: true },\n rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object],\n post: { rules: [] },\n all: {},\n keywords: {},\n };\n}\nexports.getRules = getRules;\n//# sourceMappingURL=rules.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;\nfunction schemaHasRulesForType({ schema, self }, type) {\n const group = self.RULES.types[type];\n return group && group !== true && shouldUseGroup(schema, group);\n}\nexports.schemaHasRulesForType = schemaHasRulesForType;\nfunction shouldUseGroup(schema, group) {\n return group.rules.some((rule) => shouldUseRule(schema, rule));\n}\nexports.shouldUseGroup = shouldUseGroup;\nfunction shouldUseRule(schema, rule) {\n var _a;\n return (schema[rule.keyword] !== undefined ||\n ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined)));\n}\nexports.shouldUseRule = shouldUseRule;\n//# sourceMappingURL=applicability.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;\nconst rules_1 = require(\"../rules\");\nconst applicability_1 = require(\"./applicability\");\nconst errors_1 = require(\"../errors\");\nconst codegen_1 = require(\"../codegen\");\nconst util_1 = require(\"../util\");\nvar DataType;\n(function (DataType) {\n DataType[DataType[\"Correct\"] = 0] = \"Correct\";\n DataType[DataType[\"Wrong\"] = 1] = \"Wrong\";\n})(DataType || (exports.DataType = DataType = {}));\nfunction getSchemaTypes(schema) {\n const types = getJSONTypes(schema.type);\n const hasNull = types.includes(\"null\");\n if (hasNull) {\n if (schema.nullable === false)\n throw new Error(\"type: null contradicts nullable: false\");\n }\n else {\n if (!types.length && schema.nullable !== undefined) {\n throw new Error('\"nullable\" cannot be used without \"type\"');\n }\n if (schema.nullable === true)\n types.push(\"null\");\n }\n return types;\n}\nexports.getSchemaTypes = getSchemaTypes;\n// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\nfunction getJSONTypes(ts) {\n const types = Array.isArray(ts) ? ts : ts ? [ts] : [];\n if (types.every(rules_1.isJSONType))\n return types;\n throw new Error(\"type must be JSONType or JSONType[]: \" + types.join(\",\"));\n}\nexports.getJSONTypes = getJSONTypes;\nfunction coerceAndCheckDataType(it, types) {\n const { gen, data, opts } = it;\n const coerceTo = coerceToTypes(types, opts.coerceTypes);\n const checkTypes = types.length > 0 &&\n !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0]));\n if (checkTypes) {\n const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong);\n gen.if(wrongType, () => {\n if (coerceTo.length)\n coerceData(it, types, coerceTo);\n else\n reportTypeError(it);\n });\n }\n return checkTypes;\n}\nexports.coerceAndCheckDataType = coerceAndCheckDataType;\nconst COERCIBLE = new Set([\"string\", \"number\", \"integer\", \"boolean\", \"null\"]);\nfunction coerceToTypes(types, coerceTypes) {\n return coerceTypes\n ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === \"array\" && t === \"array\"))\n : [];\n}\nfunction coerceData(it, types, coerceTo) {\n const { gen, data, opts } = it;\n const dataType = gen.let(\"dataType\", (0, codegen_1._) `typeof ${data}`);\n const coerced = gen.let(\"coerced\", (0, codegen_1._) `undefined`);\n if (opts.coerceTypes === \"array\") {\n gen.if((0, codegen_1._) `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen\n .assign(data, (0, codegen_1._) `${data}[0]`)\n .assign(dataType, (0, codegen_1._) `typeof ${data}`)\n .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));\n }\n gen.if((0, codegen_1._) `${coerced} !== undefined`);\n for (const t of coerceTo) {\n if (COERCIBLE.has(t) || (t === \"array\" && opts.coerceTypes === \"array\")) {\n coerceSpecificType(t);\n }\n }\n gen.else();\n reportTypeError(it);\n gen.endIf();\n gen.if((0, codegen_1._) `${coerced} !== undefined`, () => {\n gen.assign(data, coerced);\n assignParentData(it, coerced);\n });\n function coerceSpecificType(t) {\n switch (t) {\n case \"string\":\n gen\n .elseIf((0, codegen_1._) `${dataType} == \"number\" || ${dataType} == \"boolean\"`)\n .assign(coerced, (0, codegen_1._) `\"\" + ${data}`)\n .elseIf((0, codegen_1._) `${data} === null`)\n .assign(coerced, (0, codegen_1._) `\"\"`);\n return;\n case \"number\":\n gen\n .elseIf((0, codegen_1._) `${dataType} == \"boolean\" || ${data} === null\n || (${dataType} == \"string\" && ${data} && ${data} == +${data})`)\n .assign(coerced, (0, codegen_1._) `+${data}`);\n return;\n case \"integer\":\n gen\n .elseIf((0, codegen_1._) `${dataType} === \"boolean\" || ${data} === null\n || (${dataType} === \"string\" && ${data} && ${data} == +${data} && !(${data} % 1))`)\n .assign(coerced, (0, codegen_1._) `+${data}`);\n return;\n case \"boolean\":\n gen\n .elseIf((0, codegen_1._) `${data} === \"false\" || ${data} === 0 || ${data} === null`)\n .assign(coerced, false)\n .elseIf((0, codegen_1._) `${data} === \"true\" || ${data} === 1`)\n .assign(coerced, true);\n return;\n case \"null\":\n gen.elseIf((0, codegen_1._) `${data} === \"\" || ${data} === 0 || ${data} === false`);\n gen.assign(coerced, null);\n return;\n case \"array\":\n gen\n .elseIf((0, codegen_1._) `${dataType} === \"string\" || ${dataType} === \"number\"\n || ${dataType} === \"boolean\" || ${data} === null`)\n .assign(coerced, (0, codegen_1._) `[${data}]`);\n }\n }\n}\nfunction assignParentData({ gen, parentData, parentDataProperty }, expr) {\n // TODO use gen.property\n gen.if((0, codegen_1._) `${parentData} !== undefined`, () => gen.assign((0, codegen_1._) `${parentData}[${parentDataProperty}]`, expr));\n}\nfunction checkDataType(dataType, data, strictNums, correct = DataType.Correct) {\n const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;\n let cond;\n switch (dataType) {\n case \"null\":\n return (0, codegen_1._) `${data} ${EQ} null`;\n case \"array\":\n cond = (0, codegen_1._) `Array.isArray(${data})`;\n break;\n case \"object\":\n cond = (0, codegen_1._) `${data} && typeof ${data} == \"object\" && !Array.isArray(${data})`;\n break;\n case \"integer\":\n cond = numCond((0, codegen_1._) `!(${data} % 1) && !isNaN(${data})`);\n break;\n case \"number\":\n cond = numCond();\n break;\n default:\n return (0, codegen_1._) `typeof ${data} ${EQ} ${dataType}`;\n }\n return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);\n function numCond(_cond = codegen_1.nil) {\n return (0, codegen_1.and)((0, codegen_1._) `typeof ${data} == \"number\"`, _cond, strictNums ? (0, codegen_1._) `isFinite(${data})` : codegen_1.nil);\n }\n}\nexports.checkDataType = checkDataType;\nfunction checkDataTypes(dataTypes, data, strictNums, correct) {\n if (dataTypes.length === 1) {\n return checkDataType(dataTypes[0], data, strictNums, correct);\n }\n let cond;\n const types = (0, util_1.toHash)(dataTypes);\n if (types.array && types.object) {\n const notObj = (0, codegen_1._) `typeof ${data} != \"object\"`;\n cond = types.null ? notObj : (0, codegen_1._) `!${data} || ${notObj}`;\n delete types.null;\n delete types.array;\n delete types.object;\n }\n else {\n cond = codegen_1.nil;\n }\n if (types.number)\n delete types.integer;\n for (const t in types)\n cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));\n return cond;\n}\nexports.checkDataTypes = checkDataTypes;\nconst typeError = {\n message: ({ schema }) => `must be ${schema}`,\n params: ({ schema, schemaValue }) => typeof schema == \"string\" ? (0, codegen_1._) `{type: ${schema}}` : (0, codegen_1._) `{type: ${schemaValue}}`,\n};\nfunction reportTypeError(it) {\n const cxt = getTypeErrorContext(it);\n (0, errors_1.reportError)(cxt, typeError);\n}\nexports.reportTypeError = reportTypeError;\nfunction getTypeErrorContext(it) {\n const { gen, data, schema } = it;\n const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, \"type\");\n return {\n gen,\n keyword: \"type\",\n data,\n schema: schema.type,\n schemaCode,\n schemaValue: schemaCode,\n parentSchema: schema,\n params: {},\n it,\n };\n}\n//# sourceMappingURL=dataType.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assignDefaults = void 0;\nconst codegen_1 = require(\"../codegen\");\nconst util_1 = require(\"../util\");\nfunction assignDefaults(it, ty) {\n const { properties, items } = it.schema;\n if (ty === \"object\" && properties) {\n for (const key in properties) {\n assignDefault(it, key, properties[key].default);\n }\n }\n else if (ty === \"array\" && Array.isArray(items)) {\n items.forEach((sch, i) => assignDefault(it, i, sch.default));\n }\n}\nexports.assignDefaults = assignDefaults;\nfunction assignDefault(it, prop, defaultValue) {\n const { gen, compositeRule, data, opts } = it;\n if (defaultValue === undefined)\n return;\n const childData = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(prop)}`;\n if (compositeRule) {\n (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);\n return;\n }\n let condition = (0, codegen_1._) `${childData} === undefined`;\n if (opts.useDefaults === \"empty\") {\n condition = (0, codegen_1._) `${condition} || ${childData} === null || ${childData} === \"\"`;\n }\n // `${childData} === undefined` +\n // (opts.useDefaults === \"empty\" ? ` || ${childData} === null || ${childData} === \"\"` : \"\")\n gen.if(condition, (0, codegen_1._) `${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);\n}\n//# sourceMappingURL=defaults.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0;\nconst codegen_1 = require(\"../compile/codegen\");\nconst util_1 = require(\"../compile/util\");\nconst names_1 = require(\"../compile/names\");\nconst util_2 = require(\"../compile/util\");\nfunction checkReportMissingProp(cxt, prop) {\n const { gen, data, it } = cxt;\n gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {\n cxt.setParams({ missingProperty: (0, codegen_1._) `${prop}` }, true);\n cxt.error();\n });\n}\nexports.checkReportMissingProp = checkReportMissingProp;\nfunction checkMissingProp({ gen, data, it: { opts } }, properties, missing) {\n return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._) `${missing} = ${prop}`)));\n}\nexports.checkMissingProp = checkMissingProp;\nfunction reportMissingProp(cxt, missing) {\n cxt.setParams({ missingProperty: missing }, true);\n cxt.error();\n}\nexports.reportMissingProp = reportMissingProp;\nfunction hasPropFunc(gen) {\n return gen.scopeValue(\"func\", {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n ref: Object.prototype.hasOwnProperty,\n code: (0, codegen_1._) `Object.prototype.hasOwnProperty`,\n });\n}\nexports.hasPropFunc = hasPropFunc;\nfunction isOwnProperty(gen, data, property) {\n return (0, codegen_1._) `${hasPropFunc(gen)}.call(${data}, ${property})`;\n}\nexports.isOwnProperty = isOwnProperty;\nfunction propertyInData(gen, data, property, ownProperties) {\n const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} !== undefined`;\n return ownProperties ? (0, codegen_1._) `${cond} && ${isOwnProperty(gen, data, property)}` : cond;\n}\nexports.propertyInData = propertyInData;\nfunction noPropertyInData(gen, data, property, ownProperties) {\n const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} === undefined`;\n return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;\n}\nexports.noPropertyInData = noPropertyInData;\nfunction allSchemaProperties(schemaMap) {\n return schemaMap ? Object.keys(schemaMap).filter((p) => p !== \"__proto__\") : [];\n}\nexports.allSchemaProperties = allSchemaProperties;\nfunction schemaProperties(it, schemaMap) {\n return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));\n}\nexports.schemaProperties = schemaProperties;\nfunction callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {\n const dataAndSchema = passSchema ? (0, codegen_1._) `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;\n const valCxt = [\n [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],\n [names_1.default.parentData, it.parentData],\n [names_1.default.parentDataProperty, it.parentDataProperty],\n [names_1.default.rootData, names_1.default.rootData],\n ];\n if (it.opts.dynamicRef)\n valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);\n const args = (0, codegen_1._) `${dataAndSchema}, ${gen.object(...valCxt)}`;\n return context !== codegen_1.nil ? (0, codegen_1._) `${func}.call(${context}, ${args})` : (0, codegen_1._) `${func}(${args})`;\n}\nexports.callValidateCode = callValidateCode;\nconst newRegExp = (0, codegen_1._) `new RegExp`;\nfunction usePattern({ gen, it: { opts } }, pattern) {\n const u = opts.unicodeRegExp ? \"u\" : \"\";\n const { regExp } = opts.code;\n const rx = regExp(pattern, u);\n return gen.scopeValue(\"pattern\", {\n key: rx.toString(),\n ref: rx,\n code: (0, codegen_1._) `${regExp.code === \"new RegExp\" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`,\n });\n}\nexports.usePattern = usePattern;\nfunction validateArray(cxt) {\n const { gen, data, keyword, it } = cxt;\n const valid = gen.name(\"valid\");\n if (it.allErrors) {\n const validArr = gen.let(\"valid\", true);\n validateItems(() => gen.assign(validArr, false));\n return validArr;\n }\n gen.var(valid, true);\n validateItems(() => gen.break());\n return valid;\n function validateItems(notValid) {\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n gen.forRange(\"i\", 0, len, (i) => {\n cxt.subschema({\n keyword,\n dataProp: i,\n dataPropType: util_1.Type.Num,\n }, valid);\n gen.if((0, codegen_1.not)(valid), notValid);\n });\n }\n}\nexports.validateArray = validateArray;\nfunction validateUnion(cxt) {\n const { gen, schema, keyword, it } = cxt;\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n const alwaysValid = schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch));\n if (alwaysValid && !it.opts.unevaluated)\n return;\n const valid = gen.let(\"valid\", false);\n const schValid = gen.name(\"_valid\");\n gen.block(() => schema.forEach((_sch, i) => {\n const schCxt = cxt.subschema({\n keyword,\n schemaProp: i,\n compositeRule: true,\n }, schValid);\n gen.assign(valid, (0, codegen_1._) `${valid} || ${schValid}`);\n const merged = cxt.mergeValidEvaluated(schCxt, schValid);\n // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true)\n // or if all properties and items were evaluated (it.props === true && it.items === true)\n if (!merged)\n gen.if((0, codegen_1.not)(valid));\n }));\n cxt.result(valid, () => cxt.reset(), () => cxt.error(true));\n}\nexports.validateUnion = validateUnion;\n//# sourceMappingURL=code.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0;\nconst codegen_1 = require(\"../codegen\");\nconst names_1 = require(\"../names\");\nconst code_1 = require(\"../../vocabularies/code\");\nconst errors_1 = require(\"../errors\");\nfunction macroKeywordCode(cxt, def) {\n const { gen, keyword, schema, parentSchema, it } = cxt;\n const macroSchema = def.macro.call(it.self, schema, parentSchema, it);\n const schemaRef = useKeyword(gen, keyword, macroSchema);\n if (it.opts.validateSchema !== false)\n it.self.validateSchema(macroSchema, true);\n const valid = gen.name(\"valid\");\n cxt.subschema({\n schema: macroSchema,\n schemaPath: codegen_1.nil,\n errSchemaPath: `${it.errSchemaPath}/${keyword}`,\n topSchemaRef: schemaRef,\n compositeRule: true,\n }, valid);\n cxt.pass(valid, () => cxt.error(true));\n}\nexports.macroKeywordCode = macroKeywordCode;\nfunction funcKeywordCode(cxt, def) {\n var _a;\n const { gen, keyword, schema, parentSchema, $data, it } = cxt;\n checkAsyncKeyword(it, def);\n const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate;\n const validateRef = useKeyword(gen, keyword, validate);\n const valid = gen.let(\"valid\");\n cxt.block$data(valid, validateKeyword);\n cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid);\n function validateKeyword() {\n if (def.errors === false) {\n assignValid();\n if (def.modifying)\n modifyData(cxt);\n reportErrs(() => cxt.error());\n }\n else {\n const ruleErrs = def.async ? validateAsync() : validateSync();\n if (def.modifying)\n modifyData(cxt);\n reportErrs(() => addErrs(cxt, ruleErrs));\n }\n }\n function validateAsync() {\n const ruleErrs = gen.let(\"ruleErrs\", null);\n gen.try(() => assignValid((0, codegen_1._) `await `), (e) => gen.assign(valid, false).if((0, codegen_1._) `${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._) `${e}.errors`), () => gen.throw(e)));\n return ruleErrs;\n }\n function validateSync() {\n const validateErrs = (0, codegen_1._) `${validateRef}.errors`;\n gen.assign(validateErrs, null);\n assignValid(codegen_1.nil);\n return validateErrs;\n }\n function assignValid(_await = def.async ? (0, codegen_1._) `await ` : codegen_1.nil) {\n const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;\n const passSchema = !((\"compile\" in def && !$data) || def.schema === false);\n gen.assign(valid, (0, codegen_1._) `${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);\n }\n function reportErrs(errors) {\n var _a;\n gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors);\n }\n}\nexports.funcKeywordCode = funcKeywordCode;\nfunction modifyData(cxt) {\n const { gen, data, it } = cxt;\n gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._) `${it.parentData}[${it.parentDataProperty}]`));\n}\nfunction addErrs(cxt, errs) {\n const { gen } = cxt;\n gen.if((0, codegen_1._) `Array.isArray(${errs})`, () => {\n gen\n .assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`)\n .assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`);\n (0, errors_1.extendErrors)(cxt);\n }, () => cxt.error());\n}\nfunction checkAsyncKeyword({ schemaEnv }, def) {\n if (def.async && !schemaEnv.$async)\n throw new Error(\"async keyword in sync schema\");\n}\nfunction useKeyword(gen, keyword, result) {\n if (result === undefined)\n throw new Error(`keyword \"${keyword}\" failed to compile`);\n return gen.scopeValue(\"keyword\", typeof result == \"function\" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });\n}\nfunction validSchemaType(schema, schemaType, allowUndefined = false) {\n // TODO add tests\n return (!schemaType.length ||\n schemaType.some((st) => st === \"array\"\n ? Array.isArray(schema)\n : st === \"object\"\n ? schema && typeof schema == \"object\" && !Array.isArray(schema)\n : typeof schema == st || (allowUndefined && typeof schema == \"undefined\")));\n}\nexports.validSchemaType = validSchemaType;\nfunction validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) {\n /* istanbul ignore if */\n if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {\n throw new Error(\"ajv implementation error\");\n }\n const deps = def.dependencies;\n if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) {\n throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(\",\")}`);\n }\n if (def.validateSchema) {\n const valid = def.validateSchema(schema[keyword]);\n if (!valid) {\n const msg = `keyword \"${keyword}\" value is invalid at path \"${errSchemaPath}\": ` +\n self.errorsText(def.validateSchema.errors);\n if (opts.validateSchema === \"log\")\n self.logger.error(msg);\n else\n throw new Error(msg);\n }\n }\n}\nexports.validateKeywordUsage = validateKeywordUsage;\n//# sourceMappingURL=keyword.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0;\nconst codegen_1 = require(\"../codegen\");\nconst util_1 = require(\"../util\");\nfunction getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) {\n if (keyword !== undefined && schema !== undefined) {\n throw new Error('both \"keyword\" and \"schema\" passed, only one allowed');\n }\n if (keyword !== undefined) {\n const sch = it.schema[keyword];\n return schemaProp === undefined\n ? {\n schema: sch,\n schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`,\n errSchemaPath: `${it.errSchemaPath}/${keyword}`,\n }\n : {\n schema: sch[schemaProp],\n schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`,\n errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`,\n };\n }\n if (schema !== undefined) {\n if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) {\n throw new Error('\"schemaPath\", \"errSchemaPath\" and \"topSchemaRef\" are required with \"schema\"');\n }\n return {\n schema,\n schemaPath,\n topSchemaRef,\n errSchemaPath,\n };\n }\n throw new Error('either \"keyword\" or \"schema\" must be passed');\n}\nexports.getSubschema = getSubschema;\nfunction extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {\n if (data !== undefined && dataProp !== undefined) {\n throw new Error('both \"data\" and \"dataProp\" passed, only one allowed');\n }\n const { gen } = it;\n if (dataProp !== undefined) {\n const { errorPath, dataPathArr, opts } = it;\n const nextData = gen.let(\"data\", (0, codegen_1._) `${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true);\n dataContextProps(nextData);\n subschema.errorPath = (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;\n subschema.parentDataProperty = (0, codegen_1._) `${dataProp}`;\n subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty];\n }\n if (data !== undefined) {\n const nextData = data instanceof codegen_1.Name ? data : gen.let(\"data\", data, true); // replaceable if used once?\n dataContextProps(nextData);\n if (propertyName !== undefined)\n subschema.propertyName = propertyName;\n // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr\n }\n if (dataTypes)\n subschema.dataTypes = dataTypes;\n function dataContextProps(_nextData) {\n subschema.data = _nextData;\n subschema.dataLevel = it.dataLevel + 1;\n subschema.dataTypes = [];\n it.definedProperties = new Set();\n subschema.parentData = it.data;\n subschema.dataNames = [...it.dataNames, _nextData];\n }\n}\nexports.extendSubschemaData = extendSubschemaData;\nfunction extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {\n if (compositeRule !== undefined)\n subschema.compositeRule = compositeRule;\n if (createErrors !== undefined)\n subschema.createErrors = createErrors;\n if (allErrors !== undefined)\n subschema.allErrors = allErrors;\n subschema.jtdDiscriminator = jtdDiscriminator; // not inherited\n subschema.jtdMetadata = jtdMetadata; // not inherited\n}\nexports.extendSubschemaMode = extendSubschemaMode;\n//# sourceMappingURL=subschema.js.map","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","'use strict';\n\nvar traverse = module.exports = function (schema, opts, cb) {\n // Legacy support for v0.3.1 and earlier.\n if (typeof opts == 'function') {\n cb = opts;\n opts = {};\n }\n\n cb = opts.cb || cb;\n var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};\n var post = cb.post || function() {};\n\n _traverse(opts, pre, post, schema, '', schema);\n};\n\n\ntraverse.keywords = {\n additionalItems: true,\n items: true,\n contains: true,\n additionalProperties: true,\n propertyNames: true,\n not: true,\n if: true,\n then: true,\n else: true\n};\n\ntraverse.arrayKeywords = {\n items: true,\n allOf: true,\n anyOf: true,\n oneOf: true\n};\n\ntraverse.propsKeywords = {\n $defs: true,\n definitions: true,\n properties: true,\n patternProperties: true,\n dependencies: true\n};\n\ntraverse.skipKeywords = {\n default: true,\n enum: true,\n const: true,\n required: true,\n maximum: true,\n minimum: true,\n exclusiveMaximum: true,\n exclusiveMinimum: true,\n multipleOf: true,\n maxLength: true,\n minLength: true,\n pattern: true,\n format: true,\n maxItems: true,\n minItems: true,\n uniqueItems: true,\n maxProperties: true,\n minProperties: true\n};\n\n\nfunction _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n if (schema && typeof schema == 'object' && !Array.isArray(schema)) {\n pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n for (var key in schema) {\n var sch = schema[key];\n if (Array.isArray(sch)) {\n if (key in traverse.arrayKeywords) {\n for (var i=0; i<sch.length; i++)\n _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);\n }\n } else if (key in traverse.propsKeywords) {\n if (sch && typeof sch == 'object') {\n for (var prop in sch)\n _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);\n }\n } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {\n _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);\n }\n }\n post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n }\n}\n\n\nfunction escapeJsonPtr(str) {\n return str.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0;\nconst util_1 = require(\"./util\");\nconst equal = require(\"fast-deep-equal\");\nconst traverse = require(\"json-schema-traverse\");\n// TODO refactor to use keyword definitions\nconst SIMPLE_INLINED = new Set([\n \"type\",\n \"format\",\n \"pattern\",\n \"maxLength\",\n \"minLength\",\n \"maxProperties\",\n \"minProperties\",\n \"maxItems\",\n \"minItems\",\n \"maximum\",\n \"minimum\",\n \"uniqueItems\",\n \"multipleOf\",\n \"required\",\n \"enum\",\n \"const\",\n]);\nfunction inlineRef(schema, limit = true) {\n if (typeof schema == \"boolean\")\n return true;\n if (limit === true)\n return !hasRef(schema);\n if (!limit)\n return false;\n return countKeys(schema) <= limit;\n}\nexports.inlineRef = inlineRef;\nconst REF_KEYWORDS = new Set([\n \"$ref\",\n \"$recursiveRef\",\n \"$recursiveAnchor\",\n \"$dynamicRef\",\n \"$dynamicAnchor\",\n]);\nfunction hasRef(schema) {\n for (const key in schema) {\n if (REF_KEYWORDS.has(key))\n return true;\n const sch = schema[key];\n if (Array.isArray(sch) && sch.some(hasRef))\n return true;\n if (typeof sch == \"object\" && hasRef(sch))\n return true;\n }\n return false;\n}\nfunction countKeys(schema) {\n let count = 0;\n for (const key in schema) {\n if (key === \"$ref\")\n return Infinity;\n count++;\n if (SIMPLE_INLINED.has(key))\n continue;\n if (typeof schema[key] == \"object\") {\n (0, util_1.eachItem)(schema[key], (sch) => (count += countKeys(sch)));\n }\n if (count === Infinity)\n return Infinity;\n }\n return count;\n}\nfunction getFullPath(resolver, id = \"\", normalize) {\n if (normalize !== false)\n id = normalizeId(id);\n const p = resolver.parse(id);\n return _getFullPath(resolver, p);\n}\nexports.getFullPath = getFullPath;\nfunction _getFullPath(resolver, p) {\n const serialized = resolver.serialize(p);\n return serialized.split(\"#\")[0] + \"#\";\n}\nexports._getFullPath = _getFullPath;\nconst TRAILING_SLASH_HASH = /#\\/?$/;\nfunction normalizeId(id) {\n return id ? id.replace(TRAILING_SLASH_HASH, \"\") : \"\";\n}\nexports.normalizeId = normalizeId;\nfunction resolveUrl(resolver, baseId, id) {\n id = normalizeId(id);\n return resolver.resolve(baseId, id);\n}\nexports.resolveUrl = resolveUrl;\nconst ANCHOR = /^[a-z_][-a-z0-9._]*$/i;\nfunction getSchemaRefs(schema, baseId) {\n if (typeof schema == \"boolean\")\n return {};\n const { schemaId, uriResolver } = this.opts;\n const schId = normalizeId(schema[schemaId] || baseId);\n const baseIds = { \"\": schId };\n const pathPrefix = getFullPath(uriResolver, schId, false);\n const localRefs = {};\n const schemaRefs = new Set();\n traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {\n if (parentJsonPtr === undefined)\n return;\n const fullPath = pathPrefix + jsonPtr;\n let innerBaseId = baseIds[parentJsonPtr];\n if (typeof sch[schemaId] == \"string\")\n innerBaseId = addRef.call(this, sch[schemaId]);\n addAnchor.call(this, sch.$anchor);\n addAnchor.call(this, sch.$dynamicAnchor);\n baseIds[jsonPtr] = innerBaseId;\n function addRef(ref) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const _resolve = this.opts.uriResolver.resolve;\n ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref);\n if (schemaRefs.has(ref))\n throw ambiguos(ref);\n schemaRefs.add(ref);\n let schOrRef = this.refs[ref];\n if (typeof schOrRef == \"string\")\n schOrRef = this.refs[schOrRef];\n if (typeof schOrRef == \"object\") {\n checkAmbiguosRef(sch, schOrRef.schema, ref);\n }\n else if (ref !== normalizeId(fullPath)) {\n if (ref[0] === \"#\") {\n checkAmbiguosRef(sch, localRefs[ref], ref);\n localRefs[ref] = sch;\n }\n else {\n this.refs[ref] = fullPath;\n }\n }\n return ref;\n }\n function addAnchor(anchor) {\n if (typeof anchor == \"string\") {\n if (!ANCHOR.test(anchor))\n throw new Error(`invalid anchor \"${anchor}\"`);\n addRef.call(this, `#${anchor}`);\n }\n }\n });\n return localRefs;\n function checkAmbiguosRef(sch1, sch2, ref) {\n if (sch2 !== undefined && !equal(sch1, sch2))\n throw ambiguos(ref);\n }\n function ambiguos(ref) {\n return new Error(`reference \"${ref}\" resolves to more than one schema`);\n }\n}\nexports.getSchemaRefs = getSchemaRefs;\n//# sourceMappingURL=resolve.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0;\nconst boolSchema_1 = require(\"./boolSchema\");\nconst dataType_1 = require(\"./dataType\");\nconst applicability_1 = require(\"./applicability\");\nconst dataType_2 = require(\"./dataType\");\nconst defaults_1 = require(\"./defaults\");\nconst keyword_1 = require(\"./keyword\");\nconst subschema_1 = require(\"./subschema\");\nconst codegen_1 = require(\"../codegen\");\nconst names_1 = require(\"../names\");\nconst resolve_1 = require(\"../resolve\");\nconst util_1 = require(\"../util\");\nconst errors_1 = require(\"../errors\");\n// schema compilation - generates validation function, subschemaCode (below) is used for subschemas\nfunction validateFunctionCode(it) {\n if (isSchemaObj(it)) {\n checkKeywords(it);\n if (schemaCxtHasRules(it)) {\n topSchemaObjCode(it);\n return;\n }\n }\n validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));\n}\nexports.validateFunctionCode = validateFunctionCode;\nfunction validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {\n if (opts.code.es5) {\n gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {\n gen.code((0, codegen_1._) `\"use strict\"; ${funcSourceUrl(schema, opts)}`);\n destructureValCxtES5(gen, opts);\n gen.code(body);\n });\n }\n else {\n gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));\n }\n}\nfunction destructureValCxt(opts) {\n return (0, codegen_1._) `{${names_1.default.instancePath}=\"\", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._) `, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;\n}\nfunction destructureValCxtES5(gen, opts) {\n gen.if(names_1.default.valCxt, () => {\n gen.var(names_1.default.instancePath, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.instancePath}`);\n gen.var(names_1.default.parentData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentData}`);\n gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentDataProperty}`);\n gen.var(names_1.default.rootData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.rootData}`);\n if (opts.dynamicRef)\n gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`);\n }, () => {\n gen.var(names_1.default.instancePath, (0, codegen_1._) `\"\"`);\n gen.var(names_1.default.parentData, (0, codegen_1._) `undefined`);\n gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `undefined`);\n gen.var(names_1.default.rootData, names_1.default.data);\n if (opts.dynamicRef)\n gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `{}`);\n });\n}\nfunction topSchemaObjCode(it) {\n const { schema, opts, gen } = it;\n validateFunction(it, () => {\n if (opts.$comment && schema.$comment)\n commentKeyword(it);\n checkNoDefault(it);\n gen.let(names_1.default.vErrors, null);\n gen.let(names_1.default.errors, 0);\n if (opts.unevaluated)\n resetEvaluated(it);\n typeAndKeywords(it);\n returnResults(it);\n });\n return;\n}\nfunction resetEvaluated(it) {\n // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated\n const { gen, validateName } = it;\n it.evaluated = gen.const(\"evaluated\", (0, codegen_1._) `${validateName}.evaluated`);\n gen.if((0, codegen_1._) `${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._) `${it.evaluated}.props`, (0, codegen_1._) `undefined`));\n gen.if((0, codegen_1._) `${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._) `${it.evaluated}.items`, (0, codegen_1._) `undefined`));\n}\nfunction funcSourceUrl(schema, opts) {\n const schId = typeof schema == \"object\" && schema[opts.schemaId];\n return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._) `/*# sourceURL=${schId} */` : codegen_1.nil;\n}\n// schema compilation - this function is used recursively to generate code for sub-schemas\nfunction subschemaCode(it, valid) {\n if (isSchemaObj(it)) {\n checkKeywords(it);\n if (schemaCxtHasRules(it)) {\n subSchemaObjCode(it, valid);\n return;\n }\n }\n (0, boolSchema_1.boolOrEmptySchema)(it, valid);\n}\nfunction schemaCxtHasRules({ schema, self }) {\n if (typeof schema == \"boolean\")\n return !schema;\n for (const key in schema)\n if (self.RULES.all[key])\n return true;\n return false;\n}\nfunction isSchemaObj(it) {\n return typeof it.schema != \"boolean\";\n}\nfunction subSchemaObjCode(it, valid) {\n const { schema, gen, opts } = it;\n if (opts.$comment && schema.$comment)\n commentKeyword(it);\n updateContext(it);\n checkAsyncSchema(it);\n const errsCount = gen.const(\"_errs\", names_1.default.errors);\n typeAndKeywords(it, errsCount);\n // TODO var\n gen.var(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);\n}\nfunction checkKeywords(it) {\n (0, util_1.checkUnknownRules)(it);\n checkRefsAndKeywords(it);\n}\nfunction typeAndKeywords(it, errsCount) {\n if (it.opts.jtd)\n return schemaKeywords(it, [], false, errsCount);\n const types = (0, dataType_1.getSchemaTypes)(it.schema);\n const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types);\n schemaKeywords(it, types, !checkedTypes, errsCount);\n}\nfunction checkRefsAndKeywords(it) {\n const { schema, errSchemaPath, opts, self } = it;\n if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) {\n self.logger.warn(`$ref: keywords ignored in schema at path \"${errSchemaPath}\"`);\n }\n}\nfunction checkNoDefault(it) {\n const { schema, opts } = it;\n if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) {\n (0, util_1.checkStrictMode)(it, \"default is ignored in the schema root\");\n }\n}\nfunction updateContext(it) {\n const schId = it.schema[it.opts.schemaId];\n if (schId)\n it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);\n}\nfunction checkAsyncSchema(it) {\n if (it.schema.$async && !it.schemaEnv.$async)\n throw new Error(\"async schema in sync schema\");\n}\nfunction commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {\n const msg = schema.$comment;\n if (opts.$comment === true) {\n gen.code((0, codegen_1._) `${names_1.default.self}.logger.log(${msg})`);\n }\n else if (typeof opts.$comment == \"function\") {\n const schemaPath = (0, codegen_1.str) `${errSchemaPath}/$comment`;\n const rootName = gen.scopeValue(\"root\", { ref: schemaEnv.root });\n gen.code((0, codegen_1._) `${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);\n }\n}\nfunction returnResults(it) {\n const { gen, schemaEnv, validateName, ValidationError, opts } = it;\n if (schemaEnv.$async) {\n // TODO assign unevaluated\n gen.if((0, codegen_1._) `${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._) `new ${ValidationError}(${names_1.default.vErrors})`));\n }\n else {\n gen.assign((0, codegen_1._) `${validateName}.errors`, names_1.default.vErrors);\n if (opts.unevaluated)\n assignEvaluated(it);\n gen.return((0, codegen_1._) `${names_1.default.errors} === 0`);\n }\n}\nfunction assignEvaluated({ gen, evaluated, props, items }) {\n if (props instanceof codegen_1.Name)\n gen.assign((0, codegen_1._) `${evaluated}.props`, props);\n if (items instanceof codegen_1.Name)\n gen.assign((0, codegen_1._) `${evaluated}.items`, items);\n}\nfunction schemaKeywords(it, types, typeErrors, errsCount) {\n const { gen, schema, data, allErrors, opts, self } = it;\n const { RULES } = self;\n if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) {\n gen.block(() => keywordCode(it, \"$ref\", RULES.all.$ref.definition)); // TODO typecast\n return;\n }\n if (!opts.jtd)\n checkStrictTypes(it, types);\n gen.block(() => {\n for (const group of RULES.rules)\n groupKeywords(group);\n groupKeywords(RULES.post);\n });\n function groupKeywords(group) {\n if (!(0, applicability_1.shouldUseGroup)(schema, group))\n return;\n if (group.type) {\n gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));\n iterateKeywords(it, group);\n if (types.length === 1 && types[0] === group.type && typeErrors) {\n gen.else();\n (0, dataType_2.reportTypeError)(it);\n }\n gen.endIf();\n }\n else {\n iterateKeywords(it, group);\n }\n // TODO make it \"ok\" call?\n if (!allErrors)\n gen.if((0, codegen_1._) `${names_1.default.errors} === ${errsCount || 0}`);\n }\n}\nfunction iterateKeywords(it, group) {\n const { gen, schema, opts: { useDefaults }, } = it;\n if (useDefaults)\n (0, defaults_1.assignDefaults)(it, group.type);\n gen.block(() => {\n for (const rule of group.rules) {\n if ((0, applicability_1.shouldUseRule)(schema, rule)) {\n keywordCode(it, rule.keyword, rule.definition, group.type);\n }\n }\n });\n}\nfunction checkStrictTypes(it, types) {\n if (it.schemaEnv.meta || !it.opts.strictTypes)\n return;\n checkContextTypes(it, types);\n if (!it.opts.allowUnionTypes)\n checkMultipleTypes(it, types);\n checkKeywordTypes(it, it.dataTypes);\n}\nfunction checkContextTypes(it, types) {\n if (!types.length)\n return;\n if (!it.dataTypes.length) {\n it.dataTypes = types;\n return;\n }\n types.forEach((t) => {\n if (!includesType(it.dataTypes, t)) {\n strictTypesError(it, `type \"${t}\" not allowed by context \"${it.dataTypes.join(\",\")}\"`);\n }\n });\n narrowSchemaTypes(it, types);\n}\nfunction checkMultipleTypes(it, ts) {\n if (ts.length > 1 && !(ts.length === 2 && ts.includes(\"null\"))) {\n strictTypesError(it, \"use allowUnionTypes to allow union type keyword\");\n }\n}\nfunction checkKeywordTypes(it, ts) {\n const rules = it.self.RULES.all;\n for (const keyword in rules) {\n const rule = rules[keyword];\n if (typeof rule == \"object\" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {\n const { type } = rule.definition;\n if (type.length && !type.some((t) => hasApplicableType(ts, t))) {\n strictTypesError(it, `missing type \"${type.join(\",\")}\" for keyword \"${keyword}\"`);\n }\n }\n }\n}\nfunction hasApplicableType(schTs, kwdT) {\n return schTs.includes(kwdT) || (kwdT === \"number\" && schTs.includes(\"integer\"));\n}\nfunction includesType(ts, t) {\n return ts.includes(t) || (t === \"integer\" && ts.includes(\"number\"));\n}\nfunction narrowSchemaTypes(it, withTypes) {\n const ts = [];\n for (const t of it.dataTypes) {\n if (includesType(withTypes, t))\n ts.push(t);\n else if (withTypes.includes(\"integer\") && t === \"number\")\n ts.push(\"integer\");\n }\n it.dataTypes = ts;\n}\nfunction strictTypesError(it, msg) {\n const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;\n msg += ` at \"${schemaPath}\" (strictTypes)`;\n (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);\n}\nclass KeywordCxt {\n constructor(it, def, keyword) {\n (0, keyword_1.validateKeywordUsage)(it, def, keyword);\n this.gen = it.gen;\n this.allErrors = it.allErrors;\n this.keyword = keyword;\n this.data = it.data;\n this.schema = it.schema[keyword];\n this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data;\n this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data);\n this.schemaType = def.schemaType;\n this.parentSchema = it.schema;\n this.params = {};\n this.it = it;\n this.def = def;\n if (this.$data) {\n this.schemaCode = it.gen.const(\"vSchema\", getData(this.$data, it));\n }\n else {\n this.schemaCode = this.schemaValue;\n if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) {\n throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`);\n }\n }\n if (\"code\" in def ? def.trackErrors : def.errors !== false) {\n this.errsCount = it.gen.const(\"_errs\", names_1.default.errors);\n }\n }\n result(condition, successAction, failAction) {\n this.failResult((0, codegen_1.not)(condition), successAction, failAction);\n }\n failResult(condition, successAction, failAction) {\n this.gen.if(condition);\n if (failAction)\n failAction();\n else\n this.error();\n if (successAction) {\n this.gen.else();\n successAction();\n if (this.allErrors)\n this.gen.endIf();\n }\n else {\n if (this.allErrors)\n this.gen.endIf();\n else\n this.gen.else();\n }\n }\n pass(condition, failAction) {\n this.failResult((0, codegen_1.not)(condition), undefined, failAction);\n }\n fail(condition) {\n if (condition === undefined) {\n this.error();\n if (!this.allErrors)\n this.gen.if(false); // this branch will be removed by gen.optimize\n return;\n }\n this.gen.if(condition);\n this.error();\n if (this.allErrors)\n this.gen.endIf();\n else\n this.gen.else();\n }\n fail$data(condition) {\n if (!this.$data)\n return this.fail(condition);\n const { schemaCode } = this;\n this.fail((0, codegen_1._) `${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`);\n }\n error(append, errorParams, errorPaths) {\n if (errorParams) {\n this.setParams(errorParams);\n this._error(append, errorPaths);\n this.setParams({});\n return;\n }\n this._error(append, errorPaths);\n }\n _error(append, errorPaths) {\n ;\n (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths);\n }\n $dataError() {\n (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError);\n }\n reset() {\n if (this.errsCount === undefined)\n throw new Error('add \"trackErrors\" to keyword definition');\n (0, errors_1.resetErrorsCount)(this.gen, this.errsCount);\n }\n ok(cond) {\n if (!this.allErrors)\n this.gen.if(cond);\n }\n setParams(obj, assign) {\n if (assign)\n Object.assign(this.params, obj);\n else\n this.params = obj;\n }\n block$data(valid, codeBlock, $dataValid = codegen_1.nil) {\n this.gen.block(() => {\n this.check$data(valid, $dataValid);\n codeBlock();\n });\n }\n check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {\n if (!this.$data)\n return;\n const { gen, schemaCode, schemaType, def } = this;\n gen.if((0, codegen_1.or)((0, codegen_1._) `${schemaCode} === undefined`, $dataValid));\n if (valid !== codegen_1.nil)\n gen.assign(valid, true);\n if (schemaType.length || def.validateSchema) {\n gen.elseIf(this.invalid$data());\n this.$dataError();\n if (valid !== codegen_1.nil)\n gen.assign(valid, false);\n }\n gen.else();\n }\n invalid$data() {\n const { gen, schemaCode, schemaType, def, it } = this;\n return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema());\n function wrong$DataType() {\n if (schemaType.length) {\n /* istanbul ignore if */\n if (!(schemaCode instanceof codegen_1.Name))\n throw new Error(\"ajv implementation error\");\n const st = Array.isArray(schemaType) ? schemaType : [schemaType];\n return (0, codegen_1._) `${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;\n }\n return codegen_1.nil;\n }\n function invalid$DataSchema() {\n if (def.validateSchema) {\n const validateSchemaRef = gen.scopeValue(\"validate$data\", { ref: def.validateSchema }); // TODO value.code for standalone\n return (0, codegen_1._) `!${validateSchemaRef}(${schemaCode})`;\n }\n return codegen_1.nil;\n }\n }\n subschema(appl, valid) {\n const subschema = (0, subschema_1.getSubschema)(this.it, appl);\n (0, subschema_1.extendSubschemaData)(subschema, this.it, appl);\n (0, subschema_1.extendSubschemaMode)(subschema, appl);\n const nextContext = { ...this.it, ...subschema, items: undefined, props: undefined };\n subschemaCode(nextContext, valid);\n return nextContext;\n }\n mergeEvaluated(schemaCxt, toName) {\n const { it, gen } = this;\n if (!it.opts.unevaluated)\n return;\n if (it.props !== true && schemaCxt.props !== undefined) {\n it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName);\n }\n if (it.items !== true && schemaCxt.items !== undefined) {\n it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName);\n }\n }\n mergeValidEvaluated(schemaCxt, valid) {\n const { it, gen } = this;\n if (it.opts.unevaluated && (it.props !== true || it.items !== true)) {\n gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name));\n return true;\n }\n }\n}\nexports.KeywordCxt = KeywordCxt;\nfunction keywordCode(it, keyword, def, ruleType) {\n const cxt = new KeywordCxt(it, def, keyword);\n if (\"code\" in def) {\n def.code(cxt, ruleType);\n }\n else if (cxt.$data && def.validate) {\n (0, keyword_1.funcKeywordCode)(cxt, def);\n }\n else if (\"macro\" in def) {\n (0, keyword_1.macroKeywordCode)(cxt, def);\n }\n else if (def.compile || def.validate) {\n (0, keyword_1.funcKeywordCode)(cxt, def);\n }\n}\nconst JSON_POINTER = /^\\/(?:[^~]|~0|~1)*$/;\nconst RELATIVE_JSON_POINTER = /^([0-9]+)(#|\\/(?:[^~]|~0|~1)*)?$/;\nfunction getData($data, { dataLevel, dataNames, dataPathArr }) {\n let jsonPointer;\n let data;\n if ($data === \"\")\n return names_1.default.rootData;\n if ($data[0] === \"/\") {\n if (!JSON_POINTER.test($data))\n throw new Error(`Invalid JSON-pointer: ${$data}`);\n jsonPointer = $data;\n data = names_1.default.rootData;\n }\n else {\n const matches = RELATIVE_JSON_POINTER.exec($data);\n if (!matches)\n throw new Error(`Invalid JSON-pointer: ${$data}`);\n const up = +matches[1];\n jsonPointer = matches[2];\n if (jsonPointer === \"#\") {\n if (up >= dataLevel)\n throw new Error(errorMsg(\"property/index\", up));\n return dataPathArr[dataLevel - up];\n }\n if (up > dataLevel)\n throw new Error(errorMsg(\"data\", up));\n data = dataNames[dataLevel - up];\n if (!jsonPointer)\n return data;\n }\n let expr = data;\n const segments = jsonPointer.split(\"/\");\n for (const segment of segments) {\n if (segment) {\n data = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`;\n expr = (0, codegen_1._) `${expr} && ${data}`;\n }\n }\n return expr;\n function errorMsg(pointerType, up) {\n return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;\n }\n}\nexports.getData = getData;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass ValidationError extends Error {\n constructor(errors) {\n super(\"validation failed\");\n this.errors = errors;\n this.ajv = this.validation = true;\n }\n}\nexports.default = ValidationError;\n//# sourceMappingURL=validation_error.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst resolve_1 = require(\"./resolve\");\nclass MissingRefError extends Error {\n constructor(resolver, baseId, ref, msg) {\n super(msg || `can't resolve reference ${ref} from id ${baseId}`);\n this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);\n this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));\n }\n}\nexports.default = MissingRefError;\n//# sourceMappingURL=ref_error.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0;\nconst codegen_1 = require(\"./codegen\");\nconst validation_error_1 = require(\"../runtime/validation_error\");\nconst names_1 = require(\"./names\");\nconst resolve_1 = require(\"./resolve\");\nconst util_1 = require(\"./util\");\nconst validate_1 = require(\"./validate\");\nclass SchemaEnv {\n constructor(env) {\n var _a;\n this.refs = {};\n this.dynamicAnchors = {};\n let schema;\n if (typeof env.schema == \"object\")\n schema = env.schema;\n this.schema = env.schema;\n this.schemaId = env.schemaId;\n this.root = env.root || this;\n this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || \"$id\"]);\n this.schemaPath = env.schemaPath;\n this.localRefs = env.localRefs;\n this.meta = env.meta;\n this.$async = schema === null || schema === void 0 ? void 0 : schema.$async;\n this.refs = {};\n }\n}\nexports.SchemaEnv = SchemaEnv;\n// let codeSize = 0\n// let nodeCount = 0\n// Compiles schema in SchemaEnv\nfunction compileSchema(sch) {\n // TODO refactor - remove compilations\n const _sch = getCompilingSchema.call(this, sch);\n if (_sch)\n return _sch;\n const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); // TODO if getFullPath removed 1 tests fails\n const { es5, lines } = this.opts.code;\n const { ownProperties } = this.opts;\n const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });\n let _ValidationError;\n if (sch.$async) {\n _ValidationError = gen.scopeValue(\"Error\", {\n ref: validation_error_1.default,\n code: (0, codegen_1._) `require(\"ajv/dist/runtime/validation_error\").default`,\n });\n }\n const validateName = gen.scopeName(\"validate\");\n sch.validateName = validateName;\n const schemaCxt = {\n gen,\n allErrors: this.opts.allErrors,\n data: names_1.default.data,\n parentData: names_1.default.parentData,\n parentDataProperty: names_1.default.parentDataProperty,\n dataNames: [names_1.default.data],\n dataPathArr: [codegen_1.nil], // TODO can its length be used as dataLevel if nil is removed?\n dataLevel: 0,\n dataTypes: [],\n definedProperties: new Set(),\n topSchemaRef: gen.scopeValue(\"schema\", this.opts.code.source === true\n ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) }\n : { ref: sch.schema }),\n validateName,\n ValidationError: _ValidationError,\n schema: sch.schema,\n schemaEnv: sch,\n rootId,\n baseId: sch.baseId || rootId,\n schemaPath: codegen_1.nil,\n errSchemaPath: sch.schemaPath || (this.opts.jtd ? \"\" : \"#\"),\n errorPath: (0, codegen_1._) `\"\"`,\n opts: this.opts,\n self: this,\n };\n let sourceCode;\n try {\n this._compilations.add(sch);\n (0, validate_1.validateFunctionCode)(schemaCxt);\n gen.optimize(this.opts.code.optimize);\n // gen.optimize(1)\n const validateCode = gen.toString();\n sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;\n // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount))\n if (this.opts.code.process)\n sourceCode = this.opts.code.process(sourceCode, sch);\n // console.log(\"\\n\\n\\n *** \\n\", sourceCode)\n const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);\n const validate = makeValidate(this, this.scope.get());\n this.scope.value(validateName, { ref: validate });\n validate.errors = null;\n validate.schema = sch.schema;\n validate.schemaEnv = sch;\n if (sch.$async)\n validate.$async = true;\n if (this.opts.code.source === true) {\n validate.source = { validateName, validateCode, scopeValues: gen._values };\n }\n if (this.opts.unevaluated) {\n const { props, items } = schemaCxt;\n validate.evaluated = {\n props: props instanceof codegen_1.Name ? undefined : props,\n items: items instanceof codegen_1.Name ? undefined : items,\n dynamicProps: props instanceof codegen_1.Name,\n dynamicItems: items instanceof codegen_1.Name,\n };\n if (validate.source)\n validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated);\n }\n sch.validate = validate;\n return sch;\n }\n catch (e) {\n delete sch.validate;\n delete sch.validateName;\n if (sourceCode)\n this.logger.error(\"Error compiling schema, function code:\", sourceCode);\n // console.log(\"\\n\\n\\n *** \\n\", sourceCode, this.opts)\n throw e;\n }\n finally {\n this._compilations.delete(sch);\n }\n}\nexports.compileSchema = compileSchema;\nfunction resolveRef(root, baseId, ref) {\n var _a;\n ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);\n const schOrFunc = root.refs[ref];\n if (schOrFunc)\n return schOrFunc;\n let _sch = resolve.call(this, root, ref);\n if (_sch === undefined) {\n const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv\n const { schemaId } = this.opts;\n if (schema)\n _sch = new SchemaEnv({ schema, schemaId, root, baseId });\n }\n if (_sch === undefined)\n return;\n return (root.refs[ref] = inlineOrCompile.call(this, _sch));\n}\nexports.resolveRef = resolveRef;\nfunction inlineOrCompile(sch) {\n if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))\n return sch.schema;\n return sch.validate ? sch : compileSchema.call(this, sch);\n}\n// Index of schema compilation in the currently compiled list\nfunction getCompilingSchema(schEnv) {\n for (const sch of this._compilations) {\n if (sameSchemaEnv(sch, schEnv))\n return sch;\n }\n}\nexports.getCompilingSchema = getCompilingSchema;\nfunction sameSchemaEnv(s1, s2) {\n return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;\n}\n// resolve and compile the references ($ref)\n// TODO returns AnySchemaObject (if the schema can be inlined) or validation function\nfunction resolve(root, // information about the root schema for the current schema\nref // reference to resolve\n) {\n let sch;\n while (typeof (sch = this.refs[ref]) == \"string\")\n ref = sch;\n return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);\n}\n// Resolve schema, its root and baseId\nfunction resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it\nref // reference to resolve\n) {\n const p = this.opts.uriResolver.parse(ref);\n const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);\n let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined);\n // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests\n if (Object.keys(root.schema).length > 0 && refPath === baseId) {\n return getJsonPointer.call(this, p, root);\n }\n const id = (0, resolve_1.normalizeId)(refPath);\n const schOrRef = this.refs[id] || this.schemas[id];\n if (typeof schOrRef == \"string\") {\n const sch = resolveSchema.call(this, root, schOrRef);\n if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== \"object\")\n return;\n return getJsonPointer.call(this, p, sch);\n }\n if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== \"object\")\n return;\n if (!schOrRef.validate)\n compileSchema.call(this, schOrRef);\n if (id === (0, resolve_1.normalizeId)(ref)) {\n const { schema } = schOrRef;\n const { schemaId } = this.opts;\n const schId = schema[schemaId];\n if (schId)\n baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);\n return new SchemaEnv({ schema, schemaId, root, baseId });\n }\n return getJsonPointer.call(this, p, schOrRef);\n}\nexports.resolveSchema = resolveSchema;\nconst PREVENT_SCOPE_CHANGE = new Set([\n \"properties\",\n \"patternProperties\",\n \"enum\",\n \"dependencies\",\n \"definitions\",\n]);\nfunction getJsonPointer(parsedRef, { baseId, schema, root }) {\n var _a;\n if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== \"/\")\n return;\n for (const part of parsedRef.fragment.slice(1).split(\"/\")) {\n if (typeof schema === \"boolean\")\n return;\n const partSchema = schema[(0, util_1.unescapeFragment)(part)];\n if (partSchema === undefined)\n return;\n schema = partSchema;\n // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def?\n const schId = typeof schema === \"object\" && schema[this.opts.schemaId];\n if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {\n baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);\n }\n }\n let env;\n if (typeof schema != \"boolean\" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) {\n const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref);\n env = resolveSchema.call(this, root, $ref);\n }\n // even though resolution failed we need to return SchemaEnv to throw exception\n // so that compileAsync loads missing schema.\n const { schemaId } = this.opts;\n env = env || new SchemaEnv({ schema, schemaId, root, baseId });\n if (env.schema !== env.root.schema)\n return env;\n return undefined;\n}\n//# sourceMappingURL=index.js.map","","'use strict'\n\n/** @type {(value: string) => boolean} */\nconst isUUID = RegExp.prototype.test.bind(/^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$/u)\n\n/** @type {(value: string) => boolean} */\nconst isHexPair = RegExp.prototype.test.bind(/^[\\da-f]{2}$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isUnreserved = RegExp.prototype.test.bind(/^[\\da-z\\-._~]$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isPathCharacter = RegExp.prototype.test.bind(/^[\\da-z\\-._~!$&'()*+,;=:@/]$/iu)\n\n/**\n * @param {Array<string>} input\n * @returns {string}\n */\nfunction stringArrayToHexStripped (input) {\n let acc = ''\n let code = 0\n let i = 0\n\n for (i = 0; i < input.length; i++) {\n code = input[i].charCodeAt(0)\n if (code === 48) {\n continue\n }\n if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {\n return ''\n }\n acc += input[i]\n break\n }\n\n for (i += 1; i < input.length; i++) {\n code = input[i].charCodeAt(0)\n if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {\n return ''\n }\n acc += input[i]\n }\n return acc\n}\n\n/**\n * @typedef {Object} GetIPV6Result\n * @property {boolean} error - Indicates if there was an error parsing the IPv6 address.\n * @property {string} address - The parsed IPv6 address.\n * @property {string} [zone] - The zone identifier, if present.\n */\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nconst nonSimpleDomain = RegExp.prototype.test.bind(/[^!\"$&'()*+,\\-.;=_`a-z{}~]/u)\n\n/**\n * @param {Array<string>} buffer\n * @returns {boolean}\n */\nfunction consumeIsZone (buffer) {\n buffer.length = 0\n return true\n}\n\n/**\n * @param {Array<string>} buffer\n * @param {Array<string>} address\n * @param {GetIPV6Result} output\n * @returns {boolean}\n */\nfunction consumeHextets (buffer, address, output) {\n if (buffer.length) {\n const hex = stringArrayToHexStripped(buffer)\n if (hex !== '') {\n address.push(hex)\n } else {\n output.error = true\n return false\n }\n buffer.length = 0\n }\n return true\n}\n\n/**\n * @param {string} input\n * @returns {GetIPV6Result}\n */\nfunction getIPV6 (input) {\n let tokenCount = 0\n const output = { error: false, address: '', zone: '' }\n /** @type {Array<string>} */\n const address = []\n /** @type {Array<string>} */\n const buffer = []\n let endipv6Encountered = false\n let endIpv6 = false\n\n let consume = consumeHextets\n\n for (let i = 0; i < input.length; i++) {\n const cursor = input[i]\n if (cursor === '[' || cursor === ']') { continue }\n if (cursor === ':') {\n if (endipv6Encountered === true) {\n endIpv6 = true\n }\n if (!consume(buffer, address, output)) { break }\n if (++tokenCount > 7) {\n // not valid\n output.error = true\n break\n }\n if (i > 0 && input[i - 1] === ':') {\n endipv6Encountered = true\n }\n address.push(':')\n continue\n } else if (cursor === '%') {\n if (!consume(buffer, address, output)) { break }\n // switch to zone detection\n consume = consumeIsZone\n } else {\n buffer.push(cursor)\n continue\n }\n }\n if (buffer.length) {\n if (consume === consumeIsZone) {\n output.zone = buffer.join('')\n } else if (endIpv6) {\n address.push(buffer.join(''))\n } else {\n address.push(stringArrayToHexStripped(buffer))\n }\n }\n output.address = address.join('')\n return output\n}\n\n/**\n * @typedef {Object} NormalizeIPv6Result\n * @property {string} host - The normalized host.\n * @property {string} [escapedHost] - The escaped host.\n * @property {boolean} isIPV6 - Indicates if the host is an IPv6 address.\n */\n\n/**\n * @param {string} host\n * @returns {NormalizeIPv6Result}\n */\nfunction normalizeIPv6 (host) {\n if (findToken(host, ':') < 2) { return { host, isIPV6: false } }\n const ipv6 = getIPV6(host)\n\n if (!ipv6.error) {\n let newHost = ipv6.address\n let escapedHost = ipv6.address\n if (ipv6.zone) {\n newHost += '%' + ipv6.zone\n escapedHost += '%25' + ipv6.zone\n }\n return { host: newHost, isIPV6: true, escapedHost }\n } else {\n return { host, isIPV6: false }\n }\n}\n\n/**\n * @param {string} str\n * @param {string} token\n * @returns {number}\n */\nfunction findToken (str, token) {\n let ind = 0\n for (let i = 0; i < str.length; i++) {\n if (str[i] === token) ind++\n }\n return ind\n}\n\n/**\n * @param {string} path\n * @returns {string}\n *\n * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n */\nfunction removeDotSegments (path) {\n let input = path\n const output = []\n let nextSlash = -1\n let len = 0\n\n // eslint-disable-next-line no-cond-assign\n while (len = input.length) {\n if (len === 1) {\n if (input === '.') {\n break\n } else if (input === '/') {\n output.push('/')\n break\n } else {\n output.push(input)\n break\n }\n } else if (len === 2) {\n if (input[0] === '.') {\n if (input[1] === '.') {\n break\n } else if (input[1] === '/') {\n input = input.slice(2)\n continue\n }\n } else if (input[0] === '/') {\n if (input[1] === '.' || input[1] === '/') {\n output.push('/')\n break\n }\n }\n } else if (len === 3) {\n if (input === '/..') {\n if (output.length !== 0) {\n output.pop()\n }\n output.push('/')\n break\n }\n }\n if (input[0] === '.') {\n if (input[1] === '.') {\n if (input[2] === '/') {\n input = input.slice(3)\n continue\n }\n } else if (input[1] === '/') {\n input = input.slice(2)\n continue\n }\n } else if (input[0] === '/') {\n if (input[1] === '.') {\n if (input[2] === '/') {\n input = input.slice(2)\n continue\n } else if (input[2] === '.') {\n if (input[3] === '/') {\n input = input.slice(3)\n if (output.length !== 0) {\n output.pop()\n }\n continue\n }\n }\n }\n }\n\n // Rule 2E: Move normal path segment to output\n if ((nextSlash = input.indexOf('/', 1)) === -1) {\n output.push(input)\n break\n } else {\n output.push(input.slice(0, nextSlash))\n input = input.slice(nextSlash)\n }\n }\n\n return output.join('')\n}\n\n/**\n * Re-escape RFC 3986 gen-delims that must not appear literally in the host.\n * After the URI regex parses, these characters cannot be literal in the host\n * field, so any that appear after decoding came from percent-encoding and\n * must be restored to prevent authority structure changes.\n *\n * @param {string} host\n * @param {boolean} isIP - true for IPv4/IPv6 hosts (skip colon re-escaping)\n * @returns {string}\n */\nconst HOST_DELIMS = { '@': '%40', '/': '%2F', '?': '%3F', '#': '%23', ':': '%3A' }\nconst HOST_DELIM_RE = /[@/?#:]/g\nconst HOST_DELIM_NO_COLON_RE = /[@/?#]/g\n\nfunction reescapeHostDelimiters (host, isIP) {\n const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE\n re.lastIndex = 0\n return host.replace(re, (ch) => HOST_DELIMS[ch])\n}\n\n/**\n * Normalizes percent escapes and optionally decodes only unreserved ASCII bytes.\n * Reserved delimiters such as `%2F` and `%2E` stay escaped.\n *\n * @param {string} input\n * @param {boolean} [decodeUnreserved=false]\n * @returns {string}\n */\nfunction normalizePercentEncoding (input, decodeUnreserved = false) {\n if (input.indexOf('%') === -1) {\n return input\n }\n\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (decodeUnreserved && isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n output += input[i]\n }\n\n return output\n}\n\n/**\n * Normalizes path data without turning reserved escapes into live path syntax.\n * Valid escapes are uppercased, raw unsafe characters are escaped, and only\n * unreserved bytes that are not `.` are decoded.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction normalizePathEncoding (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (decoded !== '.' && isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n if (isPathCharacter(input[i])) {\n output += input[i]\n } else {\n output += escape(input[i])\n }\n }\n\n return output\n}\n\n/**\n * Escapes a component while preserving existing valid percent escapes.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction escapePreservingEscapes (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n output += '%' + hex.toUpperCase()\n i += 2\n continue\n }\n }\n\n output += escape(input[i])\n }\n\n return output\n}\n\n/**\n * @param {import('../types/index').URIComponent} component\n * @returns {string|undefined}\n */\nfunction recomposeAuthority (component) {\n const uriTokens = []\n\n if (component.userinfo !== undefined) {\n uriTokens.push(component.userinfo)\n uriTokens.push('@')\n }\n\n if (component.host !== undefined) {\n let host = unescape(component.host)\n if (!isIPv4(host)) {\n const ipV6res = normalizeIPv6(host)\n if (ipV6res.isIPV6 === true) {\n host = `[${ipV6res.escapedHost}]`\n } else {\n host = reescapeHostDelimiters(host, false)\n }\n }\n uriTokens.push(host)\n }\n\n if (typeof component.port === 'number' || typeof component.port === 'string') {\n uriTokens.push(':')\n uriTokens.push(String(component.port))\n }\n\n return uriTokens.length ? uriTokens.join('') : undefined\n};\n\nmodule.exports = {\n nonSimpleDomain,\n recomposeAuthority,\n reescapeHostDelimiters,\n normalizePercentEncoding,\n normalizePathEncoding,\n escapePreservingEscapes,\n removeDotSegments,\n isIPv4,\n isUUID,\n normalizeIPv6,\n stringArrayToHexStripped\n}\n","'use strict'\n\nconst { isUUID } = require('./utils')\nconst URN_REG = /([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)/iu\n\nconst supportedSchemeNames = /** @type {const} */ (['http', 'https', 'ws',\n 'wss', 'urn', 'urn:uuid'])\n\n/** @typedef {supportedSchemeNames[number]} SchemeName */\n\n/**\n * @param {string} name\n * @returns {name is SchemeName}\n */\nfunction isValidSchemeName (name) {\n return supportedSchemeNames.indexOf(/** @type {*} */ (name)) !== -1\n}\n\n/**\n * @callback SchemeFn\n * @param {import('../types/index').URIComponent} component\n * @param {import('../types/index').Options} options\n * @returns {import('../types/index').URIComponent}\n */\n\n/**\n * @typedef {Object} SchemeHandler\n * @property {SchemeName} scheme - The scheme name.\n * @property {boolean} [domainHost] - Indicates if the scheme supports domain hosts.\n * @property {SchemeFn} parse - Function to parse the URI component for this scheme.\n * @property {SchemeFn} serialize - Function to serialize the URI component for this scheme.\n * @property {boolean} [skipNormalize] - Indicates if normalization should be skipped for this scheme.\n * @property {boolean} [absolutePath] - Indicates if the scheme uses absolute paths.\n * @property {boolean} [unicodeSupport] - Indicates if the scheme supports Unicode.\n */\n\n/**\n * @param {import('../types/index').URIComponent} wsComponent\n * @returns {boolean}\n */\nfunction wsIsSecure (wsComponent) {\n if (wsComponent.secure === true) {\n return true\n } else if (wsComponent.secure === false) {\n return false\n } else if (wsComponent.scheme) {\n return (\n wsComponent.scheme.length === 3 &&\n (wsComponent.scheme[0] === 'w' || wsComponent.scheme[0] === 'W') &&\n (wsComponent.scheme[1] === 's' || wsComponent.scheme[1] === 'S') &&\n (wsComponent.scheme[2] === 's' || wsComponent.scheme[2] === 'S')\n )\n } else {\n return false\n }\n}\n\n/** @type {SchemeFn} */\nfunction httpParse (component) {\n if (!component.host) {\n component.error = component.error || 'HTTP URIs must have a host.'\n }\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction httpSerialize (component) {\n const secure = String(component.scheme).toLowerCase() === 'https'\n\n // normalize the default port\n if (component.port === (secure ? 443 : 80) || component.port === '') {\n component.port = undefined\n }\n\n // normalize the empty path\n if (!component.path) {\n component.path = '/'\n }\n\n // NOTE: We do not parse query strings for HTTP URIs\n // as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n // and not the HTTP spec.\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction wsParse (wsComponent) {\n// indicate if the secure flag is set\n wsComponent.secure = wsIsSecure(wsComponent)\n\n // construct resouce name\n wsComponent.resourceName = (wsComponent.path || '/') + (wsComponent.query ? '?' + wsComponent.query : '')\n wsComponent.path = undefined\n wsComponent.query = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction wsSerialize (wsComponent) {\n// normalize the default port\n if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === '') {\n wsComponent.port = undefined\n }\n\n // ensure scheme matches secure flag\n if (typeof wsComponent.secure === 'boolean') {\n wsComponent.scheme = (wsComponent.secure ? 'wss' : 'ws')\n wsComponent.secure = undefined\n }\n\n // reconstruct path from resource name\n if (wsComponent.resourceName) {\n const [path, query] = wsComponent.resourceName.split('?')\n wsComponent.path = (path && path !== '/' ? path : undefined)\n wsComponent.query = query\n wsComponent.resourceName = undefined\n }\n\n // forbid fragment component\n wsComponent.fragment = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnParse (urnComponent, options) {\n if (!urnComponent.path) {\n urnComponent.error = 'URN can not be parsed'\n return urnComponent\n }\n const matches = urnComponent.path.match(URN_REG)\n if (matches) {\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n urnComponent.nid = matches[1].toLowerCase()\n urnComponent.nss = matches[2]\n const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n urnComponent.path = undefined\n\n if (schemeHandler) {\n urnComponent = schemeHandler.parse(urnComponent, options)\n }\n } else {\n urnComponent.error = urnComponent.error || 'URN can not be parsed.'\n }\n\n return urnComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnSerialize (urnComponent, options) {\n if (urnComponent.nid === undefined) {\n throw new Error('URN without nid cannot be serialized')\n }\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n const nid = urnComponent.nid.toLowerCase()\n const urnScheme = `${scheme}:${options.nid || nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n\n if (schemeHandler) {\n urnComponent = schemeHandler.serialize(urnComponent, options)\n }\n\n const uriComponent = urnComponent\n const nss = urnComponent.nss\n uriComponent.path = `${nid || options.nid}:${nss}`\n\n options.skipEscape = true\n return uriComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidParse (urnComponent, options) {\n const uuidComponent = urnComponent\n uuidComponent.uuid = uuidComponent.nss\n uuidComponent.nss = undefined\n\n if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {\n uuidComponent.error = uuidComponent.error || 'UUID is not valid.'\n }\n\n return uuidComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidSerialize (uuidComponent) {\n const urnComponent = uuidComponent\n // normalize UUID\n urnComponent.nss = (uuidComponent.uuid || '').toLowerCase()\n return urnComponent\n}\n\nconst http = /** @type {SchemeHandler} */ ({\n scheme: 'http',\n domainHost: true,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst https = /** @type {SchemeHandler} */ ({\n scheme: 'https',\n domainHost: http.domainHost,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst ws = /** @type {SchemeHandler} */ ({\n scheme: 'ws',\n domainHost: true,\n parse: wsParse,\n serialize: wsSerialize\n})\n\nconst wss = /** @type {SchemeHandler} */ ({\n scheme: 'wss',\n domainHost: ws.domainHost,\n parse: ws.parse,\n serialize: ws.serialize\n})\n\nconst urn = /** @type {SchemeHandler} */ ({\n scheme: 'urn',\n parse: urnParse,\n serialize: urnSerialize,\n skipNormalize: true\n})\n\nconst urnuuid = /** @type {SchemeHandler} */ ({\n scheme: 'urn:uuid',\n parse: urnuuidParse,\n serialize: urnuuidSerialize,\n skipNormalize: true\n})\n\nconst SCHEMES = /** @type {Record<SchemeName, SchemeHandler>} */ ({\n http,\n https,\n ws,\n wss,\n urn,\n 'urn:uuid': urnuuid\n})\n\nObject.setPrototypeOf(SCHEMES, null)\n\n/**\n * @param {string|undefined} scheme\n * @returns {SchemeHandler|undefined}\n */\nfunction getSchemeHandler (scheme) {\n return (\n scheme && (\n SCHEMES[/** @type {SchemeName} */ (scheme)] ||\n SCHEMES[/** @type {SchemeName} */(scheme.toLowerCase())])\n ) ||\n undefined\n}\n\nmodule.exports = {\n wsIsSecure,\n SCHEMES,\n isValidSchemeName,\n getSchemeHandler,\n}\n","'use strict'\n\nconst { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require('./lib/utils')\nconst { SCHEMES, getSchemeHandler } = require('./lib/schemes')\n\n/**\n * @template {import('./types/index').URIComponent|string} T\n * @param {T} uri\n * @param {import('./types/index').Options} [options]\n * @returns {T}\n */\nfunction normalize (uri, options) {\n if (typeof uri === 'string') {\n uri = /** @type {T} */ (normalizeString(uri, options))\n } else if (typeof uri === 'object') {\n uri = /** @type {T} */ (parse(serialize(uri, options), options))\n }\n return uri\n}\n\n/**\n * @param {string} baseURI\n * @param {string} relativeURI\n * @param {import('./types/index').Options} [options]\n * @returns {string}\n */\nfunction resolve (baseURI, relativeURI, options) {\n const schemelessOptions = options ? Object.assign({ scheme: 'null' }, options) : { scheme: 'null' }\n const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true)\n schemelessOptions.skipEscape = true\n return serialize(resolved, schemelessOptions)\n}\n\n/**\n * @param {import ('./types/index').URIComponent} base\n * @param {import ('./types/index').URIComponent} relative\n * @param {import('./types/index').Options} [options]\n * @param {boolean} [skipNormalization=false]\n * @returns {import ('./types/index').URIComponent}\n */\nfunction resolveComponent (base, relative, options, skipNormalization) {\n /** @type {import('./types/index').URIComponent} */\n const target = {}\n if (!skipNormalization) {\n base = parse(serialize(base, options), options) // normalize base component\n relative = parse(serialize(relative, options), options) // normalize relative component\n }\n options = options || {}\n\n if (!options.tolerant && relative.scheme) {\n target.scheme = relative.scheme\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (!relative.path) {\n target.path = base.path\n if (relative.query !== undefined) {\n target.query = relative.query\n } else {\n target.query = base.query\n }\n } else {\n if (relative.path[0] === '/') {\n target.path = removeDotSegments(relative.path)\n } else {\n if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n target.path = '/' + relative.path\n } else if (!base.path) {\n target.path = relative.path\n } else {\n target.path = base.path.slice(0, base.path.lastIndexOf('/') + 1) + relative.path\n }\n target.path = removeDotSegments(target.path)\n }\n target.query = relative.query\n }\n // target.authority = base.authority;\n target.userinfo = base.userinfo\n target.host = base.host\n target.port = base.port\n }\n target.scheme = base.scheme\n }\n\n target.fragment = relative.fragment\n\n return target\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uriA\n * @param {import ('./types/index').URIComponent|string} uriB\n * @param {import ('./types/index').Options} options\n * @returns {boolean}\n */\nfunction equal (uriA, uriB, options) {\n const normalizedA = normalizeComparableURI(uriA, options)\n const normalizedB = normalizeComparableURI(uriB, options)\n\n return normalizedA !== undefined && normalizedB !== undefined && normalizedA.toLowerCase() === normalizedB.toLowerCase()\n}\n\n/**\n * @param {Readonly<import('./types/index').URIComponent>} cmpts\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction serialize (cmpts, opts) {\n const component = {\n host: cmpts.host,\n scheme: cmpts.scheme,\n userinfo: cmpts.userinfo,\n port: cmpts.port,\n path: cmpts.path,\n query: cmpts.query,\n nid: cmpts.nid,\n nss: cmpts.nss,\n uuid: cmpts.uuid,\n fragment: cmpts.fragment,\n reference: cmpts.reference,\n resourceName: cmpts.resourceName,\n secure: cmpts.secure,\n error: ''\n }\n const options = Object.assign({}, opts)\n const uriTokens = []\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || component.scheme)\n\n // perform scheme specific serialization\n if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options)\n\n if (component.path !== undefined) {\n if (!options.skipEscape) {\n component.path = escapePreservingEscapes(component.path)\n\n if (component.scheme !== undefined) {\n component.path = component.path.split('%3A').join(':')\n }\n } else {\n component.path = normalizePercentEncoding(component.path)\n }\n }\n\n if (options.reference !== 'suffix' && component.scheme) {\n uriTokens.push(component.scheme, ':')\n }\n\n const authority = recomposeAuthority(component)\n if (authority !== undefined) {\n if (options.reference !== 'suffix') {\n uriTokens.push('//')\n }\n\n uriTokens.push(authority)\n\n if (component.path && component.path[0] !== '/') {\n uriTokens.push('/')\n }\n }\n if (component.path !== undefined) {\n let s = component.path\n\n if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n s = removeDotSegments(s)\n }\n\n if (\n authority === undefined &&\n s[0] === '/' &&\n s[1] === '/'\n ) {\n // don't allow the path to start with \"//\"\n s = '/%2F' + s.slice(2)\n }\n\n uriTokens.push(s)\n }\n\n if (component.query !== undefined) {\n uriTokens.push('?', component.query)\n }\n\n if (component.fragment !== undefined) {\n uriTokens.push('#', component.fragment)\n }\n return uriTokens.join('')\n}\n\nconst URI_PARSE = /^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?/u\n\n/**\n * @param {import('./types/index').URIComponent} parsed\n * @param {RegExpMatchArray} matches\n * @returns {string|undefined}\n */\nfunction getParseError (parsed, matches) {\n if (matches[2] !== undefined && parsed.path && parsed.path[0] !== '/') {\n return 'URI path must start with \"/\" when authority is present.'\n }\n\n if (typeof parsed.port === 'number' && (parsed.port < 0 || parsed.port > 65535)) {\n return 'URI port is malformed.'\n }\n\n return undefined\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ parsed: import('./types/index').URIComponent, malformedAuthorityOrPort: boolean }}\n */\nfunction parseWithStatus (uri, opts) {\n const options = Object.assign({}, opts)\n /** @type {import('./types/index').URIComponent} */\n const parsed = {\n scheme: undefined,\n userinfo: undefined,\n host: '',\n port: undefined,\n path: '',\n query: undefined,\n fragment: undefined\n }\n\n let malformedAuthorityOrPort = false\n\n let isIP = false\n if (options.reference === 'suffix') {\n if (options.scheme) {\n uri = options.scheme + ':' + uri\n } else {\n uri = '//' + uri\n }\n }\n\n const matches = uri.match(URI_PARSE)\n\n if (matches) {\n // store each component\n parsed.scheme = matches[1]\n parsed.userinfo = matches[3]\n parsed.host = matches[4]\n parsed.port = parseInt(matches[5], 10)\n parsed.path = matches[6] || ''\n parsed.query = matches[7]\n parsed.fragment = matches[8]\n\n // fix port number\n if (isNaN(parsed.port)) {\n parsed.port = matches[5]\n }\n\n const parseError = getParseError(parsed, matches)\n if (parseError !== undefined) {\n parsed.error = parsed.error || parseError\n malformedAuthorityOrPort = true\n }\n\n if (parsed.host) {\n const ipv4result = isIPv4(parsed.host)\n if (ipv4result === false) {\n const ipv6result = normalizeIPv6(parsed.host)\n parsed.host = ipv6result.host.toLowerCase()\n isIP = ipv6result.isIPV6\n } else {\n isIP = true\n }\n }\n if (parsed.scheme === undefined && parsed.userinfo === undefined && parsed.host === undefined && parsed.port === undefined && parsed.query === undefined && !parsed.path) {\n parsed.reference = 'same-document'\n } else if (parsed.scheme === undefined) {\n parsed.reference = 'relative'\n } else if (parsed.fragment === undefined) {\n parsed.reference = 'absolute'\n } else {\n parsed.reference = 'uri'\n }\n\n // check for reference errors\n if (options.reference && options.reference !== 'suffix' && options.reference !== parsed.reference) {\n parsed.error = parsed.error || 'URI is not a ' + options.reference + ' reference.'\n }\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme)\n\n // check if scheme can't handle IRIs\n if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n // if host component is a domain name\n if (parsed.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost)) && isIP === false && nonSimpleDomain(parsed.host)) {\n // convert Unicode IDN -> ASCII IDN\n try {\n parsed.host = URL.domainToASCII(parsed.host.toLowerCase())\n } catch (e) {\n parsed.error = parsed.error || \"Host's domain name can not be converted to ASCII: \" + e\n }\n }\n // convert IRI -> URI\n }\n\n if (!schemeHandler || (schemeHandler && !schemeHandler.skipNormalize)) {\n if (uri.indexOf('%') !== -1) {\n if (parsed.scheme !== undefined) {\n parsed.scheme = unescape(parsed.scheme)\n }\n if (parsed.host !== undefined) {\n parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP)\n }\n }\n if (parsed.path) {\n parsed.path = normalizePathEncoding(parsed.path)\n }\n if (parsed.fragment) {\n try {\n parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment))\n } catch {\n parsed.error = parsed.error || 'URI malformed'\n }\n }\n }\n\n // perform scheme specific parsing\n if (schemeHandler && schemeHandler.parse) {\n schemeHandler.parse(parsed, options)\n }\n } else {\n parsed.error = parsed.error || 'URI can not be parsed.'\n }\n return { parsed, malformedAuthorityOrPort }\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns\n */\nfunction parse (uri, opts) {\n return parseWithStatus(uri, opts).parsed\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction normalizeString (uri, opts) {\n return normalizeStringWithStatus(uri, opts).normalized\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ normalized: string, malformedAuthorityOrPort: boolean }}\n */\nfunction normalizeStringWithStatus (uri, opts) {\n const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts)\n return {\n normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),\n malformedAuthorityOrPort\n }\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string|undefined}\n */\nfunction normalizeComparableURI (uri, opts) {\n if (typeof uri === 'string') {\n const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts)\n return malformedAuthorityOrPort ? undefined : normalized\n }\n\n if (typeof uri === 'object') {\n return serialize(uri, opts)\n }\n}\n\nconst fastUri = {\n SCHEMES,\n normalize,\n resolve,\n resolveComponent,\n equal,\n serialize,\n parse\n}\n\nmodule.exports = fastUri\nmodule.exports.default = fastUri\nmodule.exports.fastUri = fastUri\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst uri = require(\"fast-uri\");\nuri.code = 'require(\"ajv/dist/runtime/uri\").default';\nexports.default = uri;\n//# sourceMappingURL=uri.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;\nvar validate_1 = require(\"./compile/validate\");\nObject.defineProperty(exports, \"KeywordCxt\", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });\nvar codegen_1 = require(\"./compile/codegen\");\nObject.defineProperty(exports, \"_\", { enumerable: true, get: function () { return codegen_1._; } });\nObject.defineProperty(exports, \"str\", { enumerable: true, get: function () { return codegen_1.str; } });\nObject.defineProperty(exports, \"stringify\", { enumerable: true, get: function () { return codegen_1.stringify; } });\nObject.defineProperty(exports, \"nil\", { enumerable: true, get: function () { return codegen_1.nil; } });\nObject.defineProperty(exports, \"Name\", { enumerable: true, get: function () { return codegen_1.Name; } });\nObject.defineProperty(exports, \"CodeGen\", { enumerable: true, get: function () { return codegen_1.CodeGen; } });\nconst validation_error_1 = require(\"./runtime/validation_error\");\nconst ref_error_1 = require(\"./compile/ref_error\");\nconst rules_1 = require(\"./compile/rules\");\nconst compile_1 = require(\"./compile\");\nconst codegen_2 = require(\"./compile/codegen\");\nconst resolve_1 = require(\"./compile/resolve\");\nconst dataType_1 = require(\"./compile/validate/dataType\");\nconst util_1 = require(\"./compile/util\");\nconst $dataRefSchema = require(\"./refs/data.json\");\nconst uri_1 = require(\"./runtime/uri\");\nconst defaultRegExp = (str, flags) => new RegExp(str, flags);\ndefaultRegExp.code = \"new RegExp\";\nconst META_IGNORE_OPTIONS = [\"removeAdditional\", \"useDefaults\", \"coerceTypes\"];\nconst EXT_SCOPE_NAMES = new Set([\n \"validate\",\n \"serialize\",\n \"parse\",\n \"wrapper\",\n \"root\",\n \"schema\",\n \"keyword\",\n \"pattern\",\n \"formats\",\n \"validate$data\",\n \"func\",\n \"obj\",\n \"Error\",\n]);\nconst removedOptions = {\n errorDataPath: \"\",\n format: \"`validateFormats: false` can be used instead.\",\n nullable: '\"nullable\" keyword is supported by default.',\n jsonPointers: \"Deprecated jsPropertySyntax can be used instead.\",\n extendRefs: \"Deprecated ignoreKeywordsWithRef can be used instead.\",\n missingRefs: \"Pass empty schema with $id that should be ignored to ajv.addSchema.\",\n processCode: \"Use option `code: {process: (code, schemaEnv: object) => string}`\",\n sourceCode: \"Use option `code: {source: true}`\",\n strictDefaults: \"It is default now, see option `strict`.\",\n strictKeywords: \"It is default now, see option `strict`.\",\n uniqueItems: '\"uniqueItems\" keyword is always validated.',\n unknownFormats: \"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).\",\n cache: \"Map is used as cache, schema object as key.\",\n serialize: \"Map is used as cache, schema object as key.\",\n ajvErrors: \"It is default now.\",\n};\nconst deprecatedOptions = {\n ignoreKeywordsWithRef: \"\",\n jsPropertySyntax: \"\",\n unicode: '\"minLength\"/\"maxLength\" account for unicode characters by default.',\n};\nconst MAX_EXPRESSION = 200;\n// eslint-disable-next-line complexity\nfunction requiredOptions(o) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;\n const s = o.strict;\n const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;\n const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0;\n const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;\n const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;\n return {\n strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,\n strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,\n strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : \"log\",\n strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : \"log\",\n strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,\n code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp },\n loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,\n loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,\n meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,\n messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,\n inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,\n schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : \"$id\",\n addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,\n validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,\n validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,\n unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,\n int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,\n uriResolver: uriResolver,\n };\n}\nclass Ajv {\n constructor(opts = {}) {\n this.schemas = {};\n this.refs = {};\n this.formats = Object.create(null);\n this._compilations = new Set();\n this._loading = {};\n this._cache = new Map();\n opts = this.opts = { ...opts, ...requiredOptions(opts) };\n const { es5, lines } = this.opts.code;\n this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines });\n this.logger = getLogger(opts.logger);\n const formatOpt = opts.validateFormats;\n opts.validateFormats = false;\n this.RULES = (0, rules_1.getRules)();\n checkOptions.call(this, removedOptions, opts, \"NOT SUPPORTED\");\n checkOptions.call(this, deprecatedOptions, opts, \"DEPRECATED\", \"warn\");\n this._metaOpts = getMetaSchemaOptions.call(this);\n if (opts.formats)\n addInitialFormats.call(this);\n this._addVocabularies();\n this._addDefaultMetaSchema();\n if (opts.keywords)\n addInitialKeywords.call(this, opts.keywords);\n if (typeof opts.meta == \"object\")\n this.addMetaSchema(opts.meta);\n addInitialSchemas.call(this);\n opts.validateFormats = formatOpt;\n }\n _addVocabularies() {\n this.addKeyword(\"$async\");\n }\n _addDefaultMetaSchema() {\n const { $data, meta, schemaId } = this.opts;\n let _dataRefSchema = $dataRefSchema;\n if (schemaId === \"id\") {\n _dataRefSchema = { ...$dataRefSchema };\n _dataRefSchema.id = _dataRefSchema.$id;\n delete _dataRefSchema.$id;\n }\n if (meta && $data)\n this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);\n }\n defaultMeta() {\n const { meta, schemaId } = this.opts;\n return (this.opts.defaultMeta = typeof meta == \"object\" ? meta[schemaId] || meta : undefined);\n }\n validate(schemaKeyRef, // key, ref or schema object\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n data // to be validated\n ) {\n let v;\n if (typeof schemaKeyRef == \"string\") {\n v = this.getSchema(schemaKeyRef);\n if (!v)\n throw new Error(`no schema with key or ref \"${schemaKeyRef}\"`);\n }\n else {\n v = this.compile(schemaKeyRef);\n }\n const valid = v(data);\n if (!(\"$async\" in v))\n this.errors = v.errors;\n return valid;\n }\n compile(schema, _meta) {\n const sch = this._addSchema(schema, _meta);\n return (sch.validate || this._compileSchemaEnv(sch));\n }\n compileAsync(schema, meta) {\n if (typeof this.opts.loadSchema != \"function\") {\n throw new Error(\"options.loadSchema should be a function\");\n }\n const { loadSchema } = this.opts;\n return runCompileAsync.call(this, schema, meta);\n async function runCompileAsync(_schema, _meta) {\n await loadMetaSchema.call(this, _schema.$schema);\n const sch = this._addSchema(_schema, _meta);\n return sch.validate || _compileAsync.call(this, sch);\n }\n async function loadMetaSchema($ref) {\n if ($ref && !this.getSchema($ref)) {\n await runCompileAsync.call(this, { $ref }, true);\n }\n }\n async function _compileAsync(sch) {\n try {\n return this._compileSchemaEnv(sch);\n }\n catch (e) {\n if (!(e instanceof ref_error_1.default))\n throw e;\n checkLoaded.call(this, e);\n await loadMissingSchema.call(this, e.missingSchema);\n return _compileAsync.call(this, sch);\n }\n }\n function checkLoaded({ missingSchema: ref, missingRef }) {\n if (this.refs[ref]) {\n throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);\n }\n }\n async function loadMissingSchema(ref) {\n const _schema = await _loadSchema.call(this, ref);\n if (!this.refs[ref])\n await loadMetaSchema.call(this, _schema.$schema);\n if (!this.refs[ref])\n this.addSchema(_schema, ref, meta);\n }\n async function _loadSchema(ref) {\n const p = this._loading[ref];\n if (p)\n return p;\n try {\n return await (this._loading[ref] = loadSchema(ref));\n }\n finally {\n delete this._loading[ref];\n }\n }\n }\n // Adds schema to the instance\n addSchema(schema, // If array is passed, `key` will be ignored\n key, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.\n _meta, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.\n _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead.\n ) {\n if (Array.isArray(schema)) {\n for (const sch of schema)\n this.addSchema(sch, undefined, _meta, _validateSchema);\n return this;\n }\n let id;\n if (typeof schema === \"object\") {\n const { schemaId } = this.opts;\n id = schema[schemaId];\n if (id !== undefined && typeof id != \"string\") {\n throw new Error(`schema ${schemaId} must be string`);\n }\n }\n key = (0, resolve_1.normalizeId)(key || id);\n this._checkUnique(key);\n this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);\n return this;\n }\n // Add schema that will be used to validate other schemas\n // options in META_IGNORE_OPTIONS are alway set to false\n addMetaSchema(schema, key, // schema key\n _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema\n ) {\n this.addSchema(schema, key, true, _validateSchema);\n return this;\n }\n // Validate schema against its meta-schema\n validateSchema(schema, throwOrLogError) {\n if (typeof schema == \"boolean\")\n return true;\n let $schema;\n $schema = schema.$schema;\n if ($schema !== undefined && typeof $schema != \"string\") {\n throw new Error(\"$schema must be a string\");\n }\n $schema = $schema || this.opts.defaultMeta || this.defaultMeta();\n if (!$schema) {\n this.logger.warn(\"meta-schema not available\");\n this.errors = null;\n return true;\n }\n const valid = this.validate($schema, schema);\n if (!valid && throwOrLogError) {\n const message = \"schema is invalid: \" + this.errorsText();\n if (this.opts.validateSchema === \"log\")\n this.logger.error(message);\n else\n throw new Error(message);\n }\n return valid;\n }\n // Get compiled schema by `key` or `ref`.\n // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)\n getSchema(keyRef) {\n let sch;\n while (typeof (sch = getSchEnv.call(this, keyRef)) == \"string\")\n keyRef = sch;\n if (sch === undefined) {\n const { schemaId } = this.opts;\n const root = new compile_1.SchemaEnv({ schema: {}, schemaId });\n sch = compile_1.resolveSchema.call(this, root, keyRef);\n if (!sch)\n return;\n this.refs[keyRef] = sch;\n }\n return (sch.validate || this._compileSchemaEnv(sch));\n }\n // Remove cached schema(s).\n // If no parameter is passed all schemas but meta-schemas are removed.\n // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.\n // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.\n removeSchema(schemaKeyRef) {\n if (schemaKeyRef instanceof RegExp) {\n this._removeAllSchemas(this.schemas, schemaKeyRef);\n this._removeAllSchemas(this.refs, schemaKeyRef);\n return this;\n }\n switch (typeof schemaKeyRef) {\n case \"undefined\":\n this._removeAllSchemas(this.schemas);\n this._removeAllSchemas(this.refs);\n this._cache.clear();\n return this;\n case \"string\": {\n const sch = getSchEnv.call(this, schemaKeyRef);\n if (typeof sch == \"object\")\n this._cache.delete(sch.schema);\n delete this.schemas[schemaKeyRef];\n delete this.refs[schemaKeyRef];\n return this;\n }\n case \"object\": {\n const cacheKey = schemaKeyRef;\n this._cache.delete(cacheKey);\n let id = schemaKeyRef[this.opts.schemaId];\n if (id) {\n id = (0, resolve_1.normalizeId)(id);\n delete this.schemas[id];\n delete this.refs[id];\n }\n return this;\n }\n default:\n throw new Error(\"ajv.removeSchema: invalid parameter\");\n }\n }\n // add \"vocabulary\" - a collection of keywords\n addVocabulary(definitions) {\n for (const def of definitions)\n this.addKeyword(def);\n return this;\n }\n addKeyword(kwdOrDef, def // deprecated\n ) {\n let keyword;\n if (typeof kwdOrDef == \"string\") {\n keyword = kwdOrDef;\n if (typeof def == \"object\") {\n this.logger.warn(\"these parameters are deprecated, see docs for addKeyword\");\n def.keyword = keyword;\n }\n }\n else if (typeof kwdOrDef == \"object\" && def === undefined) {\n def = kwdOrDef;\n keyword = def.keyword;\n if (Array.isArray(keyword) && !keyword.length) {\n throw new Error(\"addKeywords: keyword must be string or non-empty array\");\n }\n }\n else {\n throw new Error(\"invalid addKeywords parameters\");\n }\n checkKeyword.call(this, keyword, def);\n if (!def) {\n (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd));\n return this;\n }\n keywordMetaschema.call(this, def);\n const definition = {\n ...def,\n type: (0, dataType_1.getJSONTypes)(def.type),\n schemaType: (0, dataType_1.getJSONTypes)(def.schemaType),\n };\n (0, util_1.eachItem)(keyword, definition.type.length === 0\n ? (k) => addRule.call(this, k, definition)\n : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));\n return this;\n }\n getKeyword(keyword) {\n const rule = this.RULES.all[keyword];\n return typeof rule == \"object\" ? rule.definition : !!rule;\n }\n // Remove keyword\n removeKeyword(keyword) {\n // TODO return type should be Ajv\n const { RULES } = this;\n delete RULES.keywords[keyword];\n delete RULES.all[keyword];\n for (const group of RULES.rules) {\n const i = group.rules.findIndex((rule) => rule.keyword === keyword);\n if (i >= 0)\n group.rules.splice(i, 1);\n }\n return this;\n }\n // Add format\n addFormat(name, format) {\n if (typeof format == \"string\")\n format = new RegExp(format);\n this.formats[name] = format;\n return this;\n }\n errorsText(errors = this.errors, // optional array of validation errors\n { separator = \", \", dataVar = \"data\" } = {} // optional options with properties `separator` and `dataVar`\n ) {\n if (!errors || errors.length === 0)\n return \"No errors\";\n return errors\n .map((e) => `${dataVar}${e.instancePath} ${e.message}`)\n .reduce((text, msg) => text + separator + msg);\n }\n $dataMetaSchema(metaSchema, keywordsJsonPointers) {\n const rules = this.RULES.all;\n metaSchema = JSON.parse(JSON.stringify(metaSchema));\n for (const jsonPointer of keywordsJsonPointers) {\n const segments = jsonPointer.split(\"/\").slice(1); // first segment is an empty string\n let keywords = metaSchema;\n for (const seg of segments)\n keywords = keywords[seg];\n for (const key in rules) {\n const rule = rules[key];\n if (typeof rule != \"object\")\n continue;\n const { $data } = rule.definition;\n const schema = keywords[key];\n if ($data && schema)\n keywords[key] = schemaOrData(schema);\n }\n }\n return metaSchema;\n }\n _removeAllSchemas(schemas, regex) {\n for (const keyRef in schemas) {\n const sch = schemas[keyRef];\n if (!regex || regex.test(keyRef)) {\n if (typeof sch == \"string\") {\n delete schemas[keyRef];\n }\n else if (sch && !sch.meta) {\n this._cache.delete(sch.schema);\n delete schemas[keyRef];\n }\n }\n }\n }\n _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {\n let id;\n const { schemaId } = this.opts;\n if (typeof schema == \"object\") {\n id = schema[schemaId];\n }\n else {\n if (this.opts.jtd)\n throw new Error(\"schema must be object\");\n else if (typeof schema != \"boolean\")\n throw new Error(\"schema must be object or boolean\");\n }\n let sch = this._cache.get(schema);\n if (sch !== undefined)\n return sch;\n baseId = (0, resolve_1.normalizeId)(id || baseId);\n const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);\n sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs });\n this._cache.set(sch.schema, sch);\n if (addSchema && !baseId.startsWith(\"#\")) {\n // TODO atm it is allowed to overwrite schemas without id (instead of not adding them)\n if (baseId)\n this._checkUnique(baseId);\n this.refs[baseId] = sch;\n }\n if (validateSchema)\n this.validateSchema(schema, true);\n return sch;\n }\n _checkUnique(id) {\n if (this.schemas[id] || this.refs[id]) {\n throw new Error(`schema with key or id \"${id}\" already exists`);\n }\n }\n _compileSchemaEnv(sch) {\n if (sch.meta)\n this._compileMetaSchema(sch);\n else\n compile_1.compileSchema.call(this, sch);\n /* istanbul ignore if */\n if (!sch.validate)\n throw new Error(\"ajv implementation error\");\n return sch.validate;\n }\n _compileMetaSchema(sch) {\n const currentOpts = this.opts;\n this.opts = this._metaOpts;\n try {\n compile_1.compileSchema.call(this, sch);\n }\n finally {\n this.opts = currentOpts;\n }\n }\n}\nAjv.ValidationError = validation_error_1.default;\nAjv.MissingRefError = ref_error_1.default;\nexports.default = Ajv;\nfunction checkOptions(checkOpts, options, msg, log = \"error\") {\n for (const key in checkOpts) {\n const opt = key;\n if (opt in options)\n this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);\n }\n}\nfunction getSchEnv(keyRef) {\n keyRef = (0, resolve_1.normalizeId)(keyRef); // TODO tests fail without this line\n return this.schemas[keyRef] || this.refs[keyRef];\n}\nfunction addInitialSchemas() {\n const optsSchemas = this.opts.schemas;\n if (!optsSchemas)\n return;\n if (Array.isArray(optsSchemas))\n this.addSchema(optsSchemas);\n else\n for (const key in optsSchemas)\n this.addSchema(optsSchemas[key], key);\n}\nfunction addInitialFormats() {\n for (const name in this.opts.formats) {\n const format = this.opts.formats[name];\n if (format)\n this.addFormat(name, format);\n }\n}\nfunction addInitialKeywords(defs) {\n if (Array.isArray(defs)) {\n this.addVocabulary(defs);\n return;\n }\n this.logger.warn(\"keywords option as map is deprecated, pass array\");\n for (const keyword in defs) {\n const def = defs[keyword];\n if (!def.keyword)\n def.keyword = keyword;\n this.addKeyword(def);\n }\n}\nfunction getMetaSchemaOptions() {\n const metaOpts = { ...this.opts };\n for (const opt of META_IGNORE_OPTIONS)\n delete metaOpts[opt];\n return metaOpts;\n}\nconst noLogs = { log() { }, warn() { }, error() { } };\nfunction getLogger(logger) {\n if (logger === false)\n return noLogs;\n if (logger === undefined)\n return console;\n if (logger.log && logger.warn && logger.error)\n return logger;\n throw new Error(\"logger must implement log, warn and error methods\");\n}\nconst KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;\nfunction checkKeyword(keyword, def) {\n const { RULES } = this;\n (0, util_1.eachItem)(keyword, (kwd) => {\n if (RULES.keywords[kwd])\n throw new Error(`Keyword ${kwd} is already defined`);\n if (!KEYWORD_NAME.test(kwd))\n throw new Error(`Keyword ${kwd} has invalid name`);\n });\n if (!def)\n return;\n if (def.$data && !(\"code\" in def || \"validate\" in def)) {\n throw new Error('$data keyword must have \"code\" or \"validate\" function');\n }\n}\nfunction addRule(keyword, definition, dataType) {\n var _a;\n const post = definition === null || definition === void 0 ? void 0 : definition.post;\n if (dataType && post)\n throw new Error('keyword with \"post\" flag cannot have \"type\"');\n const { RULES } = this;\n let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType);\n if (!ruleGroup) {\n ruleGroup = { type: dataType, rules: [] };\n RULES.rules.push(ruleGroup);\n }\n RULES.keywords[keyword] = true;\n if (!definition)\n return;\n const rule = {\n keyword,\n definition: {\n ...definition,\n type: (0, dataType_1.getJSONTypes)(definition.type),\n schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType),\n },\n };\n if (definition.before)\n addBeforeRule.call(this, ruleGroup, rule, definition.before);\n else\n ruleGroup.rules.push(rule);\n RULES.all[keyword] = rule;\n (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd));\n}\nfunction addBeforeRule(ruleGroup, rule, before) {\n const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);\n if (i >= 0) {\n ruleGroup.rules.splice(i, 0, rule);\n }\n else {\n ruleGroup.rules.push(rule);\n this.logger.warn(`rule ${before} is not defined`);\n }\n}\nfunction keywordMetaschema(def) {\n let { metaSchema } = def;\n if (metaSchema === undefined)\n return;\n if (def.$data && this.opts.$data)\n metaSchema = schemaOrData(metaSchema);\n def.validateSchema = this.compile(metaSchema, true);\n}\nconst $dataRef = {\n $ref: \"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#\",\n};\nfunction schemaOrData(schema) {\n return { anyOf: [schema, $dataRef] };\n}\n//# sourceMappingURL=core.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst def = {\n keyword: \"id\",\n code() {\n throw new Error('NOT SUPPORTED: keyword \"id\", use \"$id\" for schema ID');\n },\n};\nexports.default = def;\n//# sourceMappingURL=id.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.callRef = exports.getValidate = void 0;\nconst ref_error_1 = require(\"../../compile/ref_error\");\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst names_1 = require(\"../../compile/names\");\nconst compile_1 = require(\"../../compile\");\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: \"$ref\",\n schemaType: \"string\",\n code(cxt) {\n const { gen, schema: $ref, it } = cxt;\n const { baseId, schemaEnv: env, validateName, opts, self } = it;\n const { root } = env;\n if (($ref === \"#\" || $ref === \"#/\") && baseId === root.baseId)\n return callRootRef();\n const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref);\n if (schOrEnv === undefined)\n throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);\n if (schOrEnv instanceof compile_1.SchemaEnv)\n return callValidate(schOrEnv);\n return inlineRefSchema(schOrEnv);\n function callRootRef() {\n if (env === root)\n return callRef(cxt, validateName, env, env.$async);\n const rootName = gen.scopeValue(\"root\", { ref: root });\n return callRef(cxt, (0, codegen_1._) `${rootName}.validate`, root, root.$async);\n }\n function callValidate(sch) {\n const v = getValidate(cxt, sch);\n callRef(cxt, v, sch, sch.$async);\n }\n function inlineRefSchema(sch) {\n const schName = gen.scopeValue(\"schema\", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });\n const valid = gen.name(\"valid\");\n const schCxt = cxt.subschema({\n schema: sch,\n dataTypes: [],\n schemaPath: codegen_1.nil,\n topSchemaRef: schName,\n errSchemaPath: $ref,\n }, valid);\n cxt.mergeEvaluated(schCxt);\n cxt.ok(valid);\n }\n },\n};\nfunction getValidate(cxt, sch) {\n const { gen } = cxt;\n return sch.validate\n ? gen.scopeValue(\"validate\", { ref: sch.validate })\n : (0, codegen_1._) `${gen.scopeValue(\"wrapper\", { ref: sch })}.validate`;\n}\nexports.getValidate = getValidate;\nfunction callRef(cxt, v, sch, $async) {\n const { gen, it } = cxt;\n const { allErrors, schemaEnv: env, opts } = it;\n const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;\n if ($async)\n callAsyncRef();\n else\n callSyncRef();\n function callAsyncRef() {\n if (!env.$async)\n throw new Error(\"async schema referenced by sync schema\");\n const valid = gen.let(\"valid\");\n gen.try(() => {\n gen.code((0, codegen_1._) `await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);\n addEvaluatedFrom(v); // TODO will not work with async, it has to be returned with the result\n if (!allErrors)\n gen.assign(valid, true);\n }, (e) => {\n gen.if((0, codegen_1._) `!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));\n addErrorsFrom(e);\n if (!allErrors)\n gen.assign(valid, false);\n });\n cxt.ok(valid);\n }\n function callSyncRef() {\n cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));\n }\n function addErrorsFrom(source) {\n const errs = (0, codegen_1._) `${source}.errors`;\n gen.assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged\n gen.assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`);\n }\n function addEvaluatedFrom(source) {\n var _a;\n if (!it.opts.unevaluated)\n return;\n const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;\n // TODO refactor\n if (it.props !== true) {\n if (schEvaluated && !schEvaluated.dynamicProps) {\n if (schEvaluated.props !== undefined) {\n it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);\n }\n }\n else {\n const props = gen.var(\"props\", (0, codegen_1._) `${source}.evaluated.props`);\n it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);\n }\n }\n if (it.items !== true) {\n if (schEvaluated && !schEvaluated.dynamicItems) {\n if (schEvaluated.items !== undefined) {\n it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);\n }\n }\n else {\n const items = gen.var(\"items\", (0, codegen_1._) `${source}.evaluated.items`);\n it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);\n }\n }\n }\n}\nexports.callRef = callRef;\nexports.default = def;\n//# sourceMappingURL=ref.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst id_1 = require(\"./id\");\nconst ref_1 = require(\"./ref\");\nconst core = [\n \"$schema\",\n \"$id\",\n \"$defs\",\n \"$vocabulary\",\n { keyword: \"$comment\" },\n \"definitions\",\n id_1.default,\n ref_1.default,\n];\nexports.default = core;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst ops = codegen_1.operators;\nconst KWDs = {\n maximum: { okStr: \"<=\", ok: ops.LTE, fail: ops.GT },\n minimum: { okStr: \">=\", ok: ops.GTE, fail: ops.LT },\n exclusiveMaximum: { okStr: \"<\", ok: ops.LT, fail: ops.GTE },\n exclusiveMinimum: { okStr: \">\", ok: ops.GT, fail: ops.LTE },\n};\nconst error = {\n message: ({ keyword, schemaCode }) => (0, codegen_1.str) `must be ${KWDs[keyword].okStr} ${schemaCode}`,\n params: ({ keyword, schemaCode }) => (0, codegen_1._) `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: Object.keys(KWDs),\n type: \"number\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode } = cxt;\n cxt.fail$data((0, codegen_1._) `${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitNumber.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message: ({ schemaCode }) => (0, codegen_1.str) `must be multiple of ${schemaCode}`,\n params: ({ schemaCode }) => (0, codegen_1._) `{multipleOf: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"multipleOf\",\n type: \"number\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, schemaCode, it } = cxt;\n // const bdt = bad$DataType(schemaCode, <string>def.schemaType, $data)\n const prec = it.opts.multipleOfPrecision;\n const res = gen.let(\"res\");\n const invalid = prec\n ? (0, codegen_1._) `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}`\n : (0, codegen_1._) `${res} !== parseInt(${res})`;\n cxt.fail$data((0, codegen_1._) `(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=multipleOf.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// https://mathiasbynens.be/notes/javascript-encoding\n// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode\nfunction ucs2length(str) {\n const len = str.length;\n let length = 0;\n let pos = 0;\n let value;\n while (pos < len) {\n length++;\n value = str.charCodeAt(pos++);\n if (value >= 0xd800 && value <= 0xdbff && pos < len) {\n // high surrogate, and there is a next character\n value = str.charCodeAt(pos);\n if ((value & 0xfc00) === 0xdc00)\n pos++; // low surrogate\n }\n }\n return length;\n}\nexports.default = ucs2length;\nucs2length.code = 'require(\"ajv/dist/runtime/ucs2length\").default';\n//# sourceMappingURL=ucs2length.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst ucs2length_1 = require(\"../../runtime/ucs2length\");\nconst error = {\n message({ keyword, schemaCode }) {\n const comp = keyword === \"maxLength\" ? \"more\" : \"fewer\";\n return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} characters`;\n },\n params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: [\"maxLength\", \"minLength\"],\n type: \"string\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode, it } = cxt;\n const op = keyword === \"maxLength\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n const len = it.opts.unicode === false ? (0, codegen_1._) `${data}.length` : (0, codegen_1._) `${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`;\n cxt.fail$data((0, codegen_1._) `${len} ${op} ${schemaCode}`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitLength.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst util_1 = require(\"../../compile/util\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message: ({ schemaCode }) => (0, codegen_1.str) `must match pattern \"${schemaCode}\"`,\n params: ({ schemaCode }) => (0, codegen_1._) `{pattern: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"pattern\",\n type: \"string\",\n schemaType: \"string\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, $data, schema, schemaCode, it } = cxt;\n const u = it.opts.unicodeRegExp ? \"u\" : \"\";\n if ($data) {\n const { regExp } = it.opts.code;\n const regExpCode = regExp.code === \"new RegExp\" ? (0, codegen_1._) `new RegExp` : (0, util_1.useFunc)(gen, regExp);\n const valid = gen.let(\"valid\");\n gen.try(() => gen.assign(valid, (0, codegen_1._) `${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));\n cxt.fail$data((0, codegen_1._) `!${valid}`);\n }\n else {\n const regExp = (0, code_1.usePattern)(cxt, schema);\n cxt.fail$data((0, codegen_1._) `!${regExp}.test(${data})`);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=pattern.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message({ keyword, schemaCode }) {\n const comp = keyword === \"maxProperties\" ? \"more\" : \"fewer\";\n return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} properties`;\n },\n params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: [\"maxProperties\", \"minProperties\"],\n type: \"object\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode } = cxt;\n const op = keyword === \"maxProperties\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n cxt.fail$data((0, codegen_1._) `Object.keys(${data}).length ${op} ${schemaCode}`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitProperties.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { missingProperty } }) => (0, codegen_1.str) `must have required property '${missingProperty}'`,\n params: ({ params: { missingProperty } }) => (0, codegen_1._) `{missingProperty: ${missingProperty}}`,\n};\nconst def = {\n keyword: \"required\",\n type: \"object\",\n schemaType: \"array\",\n $data: true,\n error,\n code(cxt) {\n const { gen, schema, schemaCode, data, $data, it } = cxt;\n const { opts } = it;\n if (!$data && schema.length === 0)\n return;\n const useLoop = schema.length >= opts.loopRequired;\n if (it.allErrors)\n allErrorsMode();\n else\n exitOnErrorMode();\n if (opts.strictRequired) {\n const props = cxt.parentSchema.properties;\n const { definedProperties } = cxt.it;\n for (const requiredKey of schema) {\n if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) {\n const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;\n const msg = `required property \"${requiredKey}\" is not defined at \"${schemaPath}\" (strictRequired)`;\n (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired);\n }\n }\n }\n function allErrorsMode() {\n if (useLoop || $data) {\n cxt.block$data(codegen_1.nil, loopAllRequired);\n }\n else {\n for (const prop of schema) {\n (0, code_1.checkReportMissingProp)(cxt, prop);\n }\n }\n }\n function exitOnErrorMode() {\n const missing = gen.let(\"missing\");\n if (useLoop || $data) {\n const valid = gen.let(\"valid\", true);\n cxt.block$data(valid, () => loopUntilMissing(missing, valid));\n cxt.ok(valid);\n }\n else {\n gen.if((0, code_1.checkMissingProp)(cxt, schema, missing));\n (0, code_1.reportMissingProp)(cxt, missing);\n gen.else();\n }\n }\n function loopAllRequired() {\n gen.forOf(\"prop\", schemaCode, (prop) => {\n cxt.setParams({ missingProperty: prop });\n gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());\n });\n }\n function loopUntilMissing(missing, valid) {\n cxt.setParams({ missingProperty: missing });\n gen.forOf(missing, schemaCode, () => {\n gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties));\n gen.if((0, codegen_1.not)(valid), () => {\n cxt.error();\n gen.break();\n });\n }, codegen_1.nil);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=required.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message({ keyword, schemaCode }) {\n const comp = keyword === \"maxItems\" ? \"more\" : \"fewer\";\n return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} items`;\n },\n params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,\n};\nconst def = {\n keyword: [\"maxItems\", \"minItems\"],\n type: \"array\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt) {\n const { keyword, data, schemaCode } = cxt;\n const op = keyword === \"maxItems\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n cxt.fail$data((0, codegen_1._) `${data}.length ${op} ${schemaCode}`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=limitItems.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// https://github.com/ajv-validator/ajv/issues/889\nconst equal = require(\"fast-deep-equal\");\nequal.code = 'require(\"ajv/dist/runtime/equal\").default';\nexports.default = equal;\n//# sourceMappingURL=equal.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst dataType_1 = require(\"../../compile/validate/dataType\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst equal_1 = require(\"../../runtime/equal\");\nconst error = {\n message: ({ params: { i, j } }) => (0, codegen_1.str) `must NOT have duplicate items (items ## ${j} and ${i} are identical)`,\n params: ({ params: { i, j } }) => (0, codegen_1._) `{i: ${i}, j: ${j}}`,\n};\nconst def = {\n keyword: \"uniqueItems\",\n type: \"array\",\n schemaType: \"boolean\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;\n if (!$data && !schema)\n return;\n const valid = gen.let(\"valid\");\n const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : [];\n cxt.block$data(valid, validateUniqueItems, (0, codegen_1._) `${schemaCode} === false`);\n cxt.ok(valid);\n function validateUniqueItems() {\n const i = gen.let(\"i\", (0, codegen_1._) `${data}.length`);\n const j = gen.let(\"j\");\n cxt.setParams({ i, j });\n gen.assign(valid, true);\n gen.if((0, codegen_1._) `${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));\n }\n function canOptimize() {\n return itemTypes.length > 0 && !itemTypes.some((t) => t === \"object\" || t === \"array\");\n }\n function loopN(i, j) {\n const item = gen.name(\"item\");\n const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);\n const indices = gen.const(\"indices\", (0, codegen_1._) `{}`);\n gen.for((0, codegen_1._) `;${i}--;`, () => {\n gen.let(item, (0, codegen_1._) `${data}[${i}]`);\n gen.if(wrongType, (0, codegen_1._) `continue`);\n if (itemTypes.length > 1)\n gen.if((0, codegen_1._) `typeof ${item} == \"string\"`, (0, codegen_1._) `${item} += \"_\"`);\n gen\n .if((0, codegen_1._) `typeof ${indices}[${item}] == \"number\"`, () => {\n gen.assign(j, (0, codegen_1._) `${indices}[${item}]`);\n cxt.error();\n gen.assign(valid, false).break();\n })\n .code((0, codegen_1._) `${indices}[${item}] = ${i}`);\n });\n }\n function loopN2(i, j) {\n const eql = (0, util_1.useFunc)(gen, equal_1.default);\n const outer = gen.name(\"outer\");\n gen.label(outer).for((0, codegen_1._) `;${i}--;`, () => gen.for((0, codegen_1._) `${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._) `${eql}(${data}[${i}], ${data}[${j}])`, () => {\n cxt.error();\n gen.assign(valid, false).break(outer);\n })));\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=uniqueItems.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst equal_1 = require(\"../../runtime/equal\");\nconst error = {\n message: \"must be equal to constant\",\n params: ({ schemaCode }) => (0, codegen_1._) `{allowedValue: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"const\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, $data, schemaCode, schema } = cxt;\n if ($data || (schema && typeof schema == \"object\")) {\n cxt.fail$data((0, codegen_1._) `!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);\n }\n else {\n cxt.fail((0, codegen_1._) `${schema} !== ${data}`);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=const.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst equal_1 = require(\"../../runtime/equal\");\nconst error = {\n message: \"must be equal to one of the allowed values\",\n params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"enum\",\n schemaType: \"array\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, $data, schema, schemaCode, it } = cxt;\n if (!$data && schema.length === 0)\n throw new Error(\"enum must have non-empty array\");\n const useLoop = schema.length >= it.opts.loopEnum;\n let eql;\n const getEql = () => (eql !== null && eql !== void 0 ? eql : (eql = (0, util_1.useFunc)(gen, equal_1.default)));\n let valid;\n if (useLoop || $data) {\n valid = gen.let(\"valid\");\n cxt.block$data(valid, loopEnum);\n }\n else {\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n const vSchema = gen.const(\"vSchema\", schemaCode);\n valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i)));\n }\n cxt.pass(valid);\n function loopEnum() {\n gen.assign(valid, false);\n gen.forOf(\"v\", schemaCode, (v) => gen.if((0, codegen_1._) `${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));\n }\n function equalCode(vSchema, i) {\n const sch = schema[i];\n return typeof sch === \"object\" && sch !== null\n ? (0, codegen_1._) `${getEql()}(${data}, ${vSchema}[${i}])`\n : (0, codegen_1._) `${data} === ${sch}`;\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=enum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst limitNumber_1 = require(\"./limitNumber\");\nconst multipleOf_1 = require(\"./multipleOf\");\nconst limitLength_1 = require(\"./limitLength\");\nconst pattern_1 = require(\"./pattern\");\nconst limitProperties_1 = require(\"./limitProperties\");\nconst required_1 = require(\"./required\");\nconst limitItems_1 = require(\"./limitItems\");\nconst uniqueItems_1 = require(\"./uniqueItems\");\nconst const_1 = require(\"./const\");\nconst enum_1 = require(\"./enum\");\nconst validation = [\n // number\n limitNumber_1.default,\n multipleOf_1.default,\n // string\n limitLength_1.default,\n pattern_1.default,\n // object\n limitProperties_1.default,\n required_1.default,\n // array\n limitItems_1.default,\n uniqueItems_1.default,\n // any\n { keyword: \"type\", schemaType: [\"string\", \"array\"] },\n { keyword: \"nullable\", schemaType: \"boolean\" },\n const_1.default,\n enum_1.default,\n];\nexports.default = validation;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateAdditionalItems = void 0;\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,\n params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,\n};\nconst def = {\n keyword: \"additionalItems\",\n type: \"array\",\n schemaType: [\"boolean\", \"object\"],\n before: \"uniqueItems\",\n error,\n code(cxt) {\n const { parentSchema, it } = cxt;\n const { items } = parentSchema;\n if (!Array.isArray(items)) {\n (0, util_1.checkStrictMode)(it, '\"additionalItems\" is ignored when \"items\" is not an array of schemas');\n return;\n }\n validateAdditionalItems(cxt, items);\n },\n};\nfunction validateAdditionalItems(cxt, items) {\n const { gen, schema, data, keyword, it } = cxt;\n it.items = true;\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n if (schema === false) {\n cxt.setParams({ len: items.length });\n cxt.pass((0, codegen_1._) `${len} <= ${items.length}`);\n }\n else if (typeof schema == \"object\" && !(0, util_1.alwaysValidSchema)(it, schema)) {\n const valid = gen.var(\"valid\", (0, codegen_1._) `${len} <= ${items.length}`); // TODO var\n gen.if((0, codegen_1.not)(valid), () => validateItems(valid));\n cxt.ok(valid);\n }\n function validateItems(valid) {\n gen.forRange(\"i\", items.length, len, (i) => {\n cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid);\n if (!it.allErrors)\n gen.if((0, codegen_1.not)(valid), () => gen.break());\n });\n }\n}\nexports.validateAdditionalItems = validateAdditionalItems;\nexports.default = def;\n//# sourceMappingURL=additionalItems.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateTuple = void 0;\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst code_1 = require(\"../code\");\nconst def = {\n keyword: \"items\",\n type: \"array\",\n schemaType: [\"object\", \"array\", \"boolean\"],\n before: \"uniqueItems\",\n code(cxt) {\n const { schema, it } = cxt;\n if (Array.isArray(schema))\n return validateTuple(cxt, \"additionalItems\", schema);\n it.items = true;\n if ((0, util_1.alwaysValidSchema)(it, schema))\n return;\n cxt.ok((0, code_1.validateArray)(cxt));\n },\n};\nfunction validateTuple(cxt, extraItems, schArr = cxt.schema) {\n const { gen, parentSchema, data, keyword, it } = cxt;\n checkStrictTuple(parentSchema);\n if (it.opts.unevaluated && schArr.length && it.items !== true) {\n it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items);\n }\n const valid = gen.name(\"valid\");\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n schArr.forEach((sch, i) => {\n if ((0, util_1.alwaysValidSchema)(it, sch))\n return;\n gen.if((0, codegen_1._) `${len} > ${i}`, () => cxt.subschema({\n keyword,\n schemaProp: i,\n dataProp: i,\n }, valid));\n cxt.ok(valid);\n });\n function checkStrictTuple(sch) {\n const { opts, errSchemaPath } = it;\n const l = schArr.length;\n const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);\n if (opts.strictTuples && !fullTuple) {\n const msg = `\"${keyword}\" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path \"${errSchemaPath}\"`;\n (0, util_1.checkStrictMode)(it, msg, opts.strictTuples);\n }\n }\n}\nexports.validateTuple = validateTuple;\nexports.default = def;\n//# sourceMappingURL=items.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst items_1 = require(\"./items\");\nconst def = {\n keyword: \"prefixItems\",\n type: \"array\",\n schemaType: [\"array\"],\n before: \"uniqueItems\",\n code: (cxt) => (0, items_1.validateTuple)(cxt, \"items\"),\n};\nexports.default = def;\n//# sourceMappingURL=prefixItems.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst code_1 = require(\"../code\");\nconst additionalItems_1 = require(\"./additionalItems\");\nconst error = {\n message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,\n params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,\n};\nconst def = {\n keyword: \"items\",\n type: \"array\",\n schemaType: [\"object\", \"boolean\"],\n before: \"uniqueItems\",\n error,\n code(cxt) {\n const { schema, parentSchema, it } = cxt;\n const { prefixItems } = parentSchema;\n it.items = true;\n if ((0, util_1.alwaysValidSchema)(it, schema))\n return;\n if (prefixItems)\n (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);\n else\n cxt.ok((0, code_1.validateArray)(cxt));\n },\n};\nexports.default = def;\n//# sourceMappingURL=items2020.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { min, max } }) => max === undefined\n ? (0, codegen_1.str) `must contain at least ${min} valid item(s)`\n : (0, codegen_1.str) `must contain at least ${min} and no more than ${max} valid item(s)`,\n params: ({ params: { min, max } }) => max === undefined ? (0, codegen_1._) `{minContains: ${min}}` : (0, codegen_1._) `{minContains: ${min}, maxContains: ${max}}`,\n};\nconst def = {\n keyword: \"contains\",\n type: \"array\",\n schemaType: [\"object\", \"boolean\"],\n before: \"uniqueItems\",\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, schema, parentSchema, data, it } = cxt;\n let min;\n let max;\n const { minContains, maxContains } = parentSchema;\n if (it.opts.next) {\n min = minContains === undefined ? 1 : minContains;\n max = maxContains;\n }\n else {\n min = 1;\n }\n const len = gen.const(\"len\", (0, codegen_1._) `${data}.length`);\n cxt.setParams({ min, max });\n if (max === undefined && min === 0) {\n (0, util_1.checkStrictMode)(it, `\"minContains\" == 0 without \"maxContains\": \"contains\" keyword ignored`);\n return;\n }\n if (max !== undefined && min > max) {\n (0, util_1.checkStrictMode)(it, `\"minContains\" > \"maxContains\" is always invalid`);\n cxt.fail();\n return;\n }\n if ((0, util_1.alwaysValidSchema)(it, schema)) {\n let cond = (0, codegen_1._) `${len} >= ${min}`;\n if (max !== undefined)\n cond = (0, codegen_1._) `${cond} && ${len} <= ${max}`;\n cxt.pass(cond);\n return;\n }\n it.items = true;\n const valid = gen.name(\"valid\");\n if (max === undefined && min === 1) {\n validateItems(valid, () => gen.if(valid, () => gen.break()));\n }\n else if (min === 0) {\n gen.let(valid, true);\n if (max !== undefined)\n gen.if((0, codegen_1._) `${data}.length > 0`, validateItemsWithCount);\n }\n else {\n gen.let(valid, false);\n validateItemsWithCount();\n }\n cxt.result(valid, () => cxt.reset());\n function validateItemsWithCount() {\n const schValid = gen.name(\"_valid\");\n const count = gen.let(\"count\", 0);\n validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));\n }\n function validateItems(_valid, block) {\n gen.forRange(\"i\", 0, len, (i) => {\n cxt.subschema({\n keyword: \"contains\",\n dataProp: i,\n dataPropType: util_1.Type.Num,\n compositeRule: true,\n }, _valid);\n block();\n });\n }\n function checkLimits(count) {\n gen.code((0, codegen_1._) `${count}++`);\n if (max === undefined) {\n gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true).break());\n }\n else {\n gen.if((0, codegen_1._) `${count} > ${max}`, () => gen.assign(valid, false).break());\n if (min === 1)\n gen.assign(valid, true);\n else\n gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true));\n }\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=contains.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst code_1 = require(\"../code\");\nexports.error = {\n message: ({ params: { property, depsCount, deps } }) => {\n const property_ies = depsCount === 1 ? \"property\" : \"properties\";\n return (0, codegen_1.str) `must have ${property_ies} ${deps} when property ${property} is present`;\n },\n params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._) `{property: ${property},\n missingProperty: ${missingProperty},\n depsCount: ${depsCount},\n deps: ${deps}}`, // TODO change to reference\n};\nconst def = {\n keyword: \"dependencies\",\n type: \"object\",\n schemaType: \"object\",\n error: exports.error,\n code(cxt) {\n const [propDeps, schDeps] = splitDependencies(cxt);\n validatePropertyDeps(cxt, propDeps);\n validateSchemaDeps(cxt, schDeps);\n },\n};\nfunction splitDependencies({ schema }) {\n const propertyDeps = {};\n const schemaDeps = {};\n for (const key in schema) {\n if (key === \"__proto__\")\n continue;\n const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;\n deps[key] = schema[key];\n }\n return [propertyDeps, schemaDeps];\n}\nfunction validatePropertyDeps(cxt, propertyDeps = cxt.schema) {\n const { gen, data, it } = cxt;\n if (Object.keys(propertyDeps).length === 0)\n return;\n const missing = gen.let(\"missing\");\n for (const prop in propertyDeps) {\n const deps = propertyDeps[prop];\n if (deps.length === 0)\n continue;\n const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties);\n cxt.setParams({\n property: prop,\n depsCount: deps.length,\n deps: deps.join(\", \"),\n });\n if (it.allErrors) {\n gen.if(hasProperty, () => {\n for (const depProp of deps) {\n (0, code_1.checkReportMissingProp)(cxt, depProp);\n }\n });\n }\n else {\n gen.if((0, codegen_1._) `${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`);\n (0, code_1.reportMissingProp)(cxt, missing);\n gen.else();\n }\n }\n}\nexports.validatePropertyDeps = validatePropertyDeps;\nfunction validateSchemaDeps(cxt, schemaDeps = cxt.schema) {\n const { gen, data, keyword, it } = cxt;\n const valid = gen.name(\"valid\");\n for (const prop in schemaDeps) {\n if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop]))\n continue;\n gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => {\n const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid);\n cxt.mergeValidEvaluated(schCxt, valid);\n }, () => gen.var(valid, true) // TODO var\n );\n cxt.ok(valid);\n }\n}\nexports.validateSchemaDeps = validateSchemaDeps;\nexports.default = def;\n//# sourceMappingURL=dependencies.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: \"property name must be valid\",\n params: ({ params }) => (0, codegen_1._) `{propertyName: ${params.propertyName}}`,\n};\nconst def = {\n keyword: \"propertyNames\",\n type: \"object\",\n schemaType: [\"object\", \"boolean\"],\n error,\n code(cxt) {\n const { gen, schema, data, it } = cxt;\n if ((0, util_1.alwaysValidSchema)(it, schema))\n return;\n const valid = gen.name(\"valid\");\n gen.forIn(\"key\", data, (key) => {\n cxt.setParams({ propertyName: key });\n cxt.subschema({\n keyword: \"propertyNames\",\n data: key,\n dataTypes: [\"string\"],\n propertyName: key,\n compositeRule: true,\n }, valid);\n gen.if((0, codegen_1.not)(valid), () => {\n cxt.error(true);\n if (!it.allErrors)\n gen.break();\n });\n });\n cxt.ok(valid);\n },\n};\nexports.default = def;\n//# sourceMappingURL=propertyNames.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst names_1 = require(\"../../compile/names\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: \"must NOT have additional properties\",\n params: ({ params }) => (0, codegen_1._) `{additionalProperty: ${params.additionalProperty}}`,\n};\nconst def = {\n keyword: \"additionalProperties\",\n type: [\"object\"],\n schemaType: [\"boolean\", \"object\"],\n allowUndefined: true,\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, schema, parentSchema, data, errsCount, it } = cxt;\n /* istanbul ignore if */\n if (!errsCount)\n throw new Error(\"ajv implementation error\");\n const { allErrors, opts } = it;\n it.props = true;\n if (opts.removeAdditional !== \"all\" && (0, util_1.alwaysValidSchema)(it, schema))\n return;\n const props = (0, code_1.allSchemaProperties)(parentSchema.properties);\n const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);\n checkAdditionalProperties();\n cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);\n function checkAdditionalProperties() {\n gen.forIn(\"key\", data, (key) => {\n if (!props.length && !patProps.length)\n additionalPropertyCode(key);\n else\n gen.if(isAdditional(key), () => additionalPropertyCode(key));\n });\n }\n function isAdditional(key) {\n let definedProp;\n if (props.length > 8) {\n // TODO maybe an option instead of hard-coded 8?\n const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, \"properties\");\n definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);\n }\n else if (props.length) {\n definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._) `${key} === ${p}`));\n }\n else {\n definedProp = codegen_1.nil;\n }\n if (patProps.length) {\n definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._) `${(0, code_1.usePattern)(cxt, p)}.test(${key})`));\n }\n return (0, codegen_1.not)(definedProp);\n }\n function deleteAdditional(key) {\n gen.code((0, codegen_1._) `delete ${data}[${key}]`);\n }\n function additionalPropertyCode(key) {\n if (opts.removeAdditional === \"all\" || (opts.removeAdditional && schema === false)) {\n deleteAdditional(key);\n return;\n }\n if (schema === false) {\n cxt.setParams({ additionalProperty: key });\n cxt.error();\n if (!allErrors)\n gen.break();\n return;\n }\n if (typeof schema == \"object\" && !(0, util_1.alwaysValidSchema)(it, schema)) {\n const valid = gen.name(\"valid\");\n if (opts.removeAdditional === \"failing\") {\n applyAdditionalSchema(key, valid, false);\n gen.if((0, codegen_1.not)(valid), () => {\n cxt.reset();\n deleteAdditional(key);\n });\n }\n else {\n applyAdditionalSchema(key, valid);\n if (!allErrors)\n gen.if((0, codegen_1.not)(valid), () => gen.break());\n }\n }\n }\n function applyAdditionalSchema(key, valid, errors) {\n const subschema = {\n keyword: \"additionalProperties\",\n dataProp: key,\n dataPropType: util_1.Type.Str,\n };\n if (errors === false) {\n Object.assign(subschema, {\n compositeRule: true,\n createErrors: false,\n allErrors: false,\n });\n }\n cxt.subschema(subschema, valid);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=additionalProperties.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst validate_1 = require(\"../../compile/validate\");\nconst code_1 = require(\"../code\");\nconst util_1 = require(\"../../compile/util\");\nconst additionalProperties_1 = require(\"./additionalProperties\");\nconst def = {\n keyword: \"properties\",\n type: \"object\",\n schemaType: \"object\",\n code(cxt) {\n const { gen, schema, parentSchema, data, it } = cxt;\n if (it.opts.removeAdditional === \"all\" && parentSchema.additionalProperties === undefined) {\n additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, \"additionalProperties\"));\n }\n const allProps = (0, code_1.allSchemaProperties)(schema);\n for (const prop of allProps) {\n it.definedProperties.add(prop);\n }\n if (it.opts.unevaluated && allProps.length && it.props !== true) {\n it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);\n }\n const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));\n if (properties.length === 0)\n return;\n const valid = gen.name(\"valid\");\n for (const prop of properties) {\n if (hasDefault(prop)) {\n applyPropertySchema(prop);\n }\n else {\n gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties));\n applyPropertySchema(prop);\n if (!it.allErrors)\n gen.else().var(valid, true);\n gen.endIf();\n }\n cxt.it.definedProperties.add(prop);\n cxt.ok(valid);\n }\n function hasDefault(prop) {\n return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined;\n }\n function applyPropertySchema(prop) {\n cxt.subschema({\n keyword: \"properties\",\n schemaProp: prop,\n dataProp: prop,\n }, valid);\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=properties.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst util_2 = require(\"../../compile/util\");\nconst def = {\n keyword: \"patternProperties\",\n type: \"object\",\n schemaType: \"object\",\n code(cxt) {\n const { gen, schema, data, parentSchema, it } = cxt;\n const { opts } = it;\n const patterns = (0, code_1.allSchemaProperties)(schema);\n const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p]));\n if (patterns.length === 0 ||\n (alwaysValidPatterns.length === patterns.length &&\n (!it.opts.unevaluated || it.props === true))) {\n return;\n }\n const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties;\n const valid = gen.name(\"valid\");\n if (it.props !== true && !(it.props instanceof codegen_1.Name)) {\n it.props = (0, util_2.evaluatedPropsToName)(gen, it.props);\n }\n const { props } = it;\n validatePatternProperties();\n function validatePatternProperties() {\n for (const pat of patterns) {\n if (checkProperties)\n checkMatchingProperties(pat);\n if (it.allErrors) {\n validateProperties(pat);\n }\n else {\n gen.var(valid, true); // TODO var\n validateProperties(pat);\n gen.if(valid);\n }\n }\n }\n function checkMatchingProperties(pat) {\n for (const prop in checkProperties) {\n if (new RegExp(pat).test(prop)) {\n (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`);\n }\n }\n }\n function validateProperties(pat) {\n gen.forIn(\"key\", data, (key) => {\n gen.if((0, codegen_1._) `${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {\n const alwaysValid = alwaysValidPatterns.includes(pat);\n if (!alwaysValid) {\n cxt.subschema({\n keyword: \"patternProperties\",\n schemaProp: pat,\n dataProp: key,\n dataPropType: util_2.Type.Str,\n }, valid);\n }\n if (it.opts.unevaluated && props !== true) {\n gen.assign((0, codegen_1._) `${props}[${key}]`, true);\n }\n else if (!alwaysValid && !it.allErrors) {\n // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false)\n // or if all properties were evaluated (props === true)\n gen.if((0, codegen_1.not)(valid), () => gen.break());\n }\n });\n });\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=patternProperties.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: \"not\",\n schemaType: [\"object\", \"boolean\"],\n trackErrors: true,\n code(cxt) {\n const { gen, schema, it } = cxt;\n if ((0, util_1.alwaysValidSchema)(it, schema)) {\n cxt.fail();\n return;\n }\n const valid = gen.name(\"valid\");\n cxt.subschema({\n keyword: \"not\",\n compositeRule: true,\n createErrors: false,\n allErrors: false,\n }, valid);\n cxt.failResult(valid, () => cxt.reset(), () => cxt.error());\n },\n error: { message: \"must NOT be valid\" },\n};\nexports.default = def;\n//# sourceMappingURL=not.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code_1 = require(\"../code\");\nconst def = {\n keyword: \"anyOf\",\n schemaType: \"array\",\n trackErrors: true,\n code: code_1.validateUnion,\n error: { message: \"must match a schema in anyOf\" },\n};\nexports.default = def;\n//# sourceMappingURL=anyOf.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: \"must match exactly one schema in oneOf\",\n params: ({ params }) => (0, codegen_1._) `{passingSchemas: ${params.passing}}`,\n};\nconst def = {\n keyword: \"oneOf\",\n schemaType: \"array\",\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, schema, parentSchema, it } = cxt;\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n if (it.opts.discriminator && parentSchema.discriminator)\n return;\n const schArr = schema;\n const valid = gen.let(\"valid\", false);\n const passing = gen.let(\"passing\", null);\n const schValid = gen.name(\"_valid\");\n cxt.setParams({ passing });\n // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas\n gen.block(validateOneOf);\n cxt.result(valid, () => cxt.reset(), () => cxt.error(true));\n function validateOneOf() {\n schArr.forEach((sch, i) => {\n let schCxt;\n if ((0, util_1.alwaysValidSchema)(it, sch)) {\n gen.var(schValid, true);\n }\n else {\n schCxt = cxt.subschema({\n keyword: \"oneOf\",\n schemaProp: i,\n compositeRule: true,\n }, schValid);\n }\n if (i > 0) {\n gen\n .if((0, codegen_1._) `${schValid} && ${valid}`)\n .assign(valid, false)\n .assign(passing, (0, codegen_1._) `[${passing}, ${i}]`)\n .else();\n }\n gen.if(schValid, () => {\n gen.assign(valid, true);\n gen.assign(passing, i);\n if (schCxt)\n cxt.mergeEvaluated(schCxt, codegen_1.Name);\n });\n });\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=oneOf.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: \"allOf\",\n schemaType: \"array\",\n code(cxt) {\n const { gen, schema, it } = cxt;\n /* istanbul ignore if */\n if (!Array.isArray(schema))\n throw new Error(\"ajv implementation error\");\n const valid = gen.name(\"valid\");\n schema.forEach((sch, i) => {\n if ((0, util_1.alwaysValidSchema)(it, sch))\n return;\n const schCxt = cxt.subschema({ keyword: \"allOf\", schemaProp: i }, valid);\n cxt.ok(valid);\n cxt.mergeEvaluated(schCxt);\n });\n },\n};\nexports.default = def;\n//# sourceMappingURL=allOf.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params }) => (0, codegen_1.str) `must match \"${params.ifClause}\" schema`,\n params: ({ params }) => (0, codegen_1._) `{failingKeyword: ${params.ifClause}}`,\n};\nconst def = {\n keyword: \"if\",\n schemaType: [\"object\", \"boolean\"],\n trackErrors: true,\n error,\n code(cxt) {\n const { gen, parentSchema, it } = cxt;\n if (parentSchema.then === undefined && parentSchema.else === undefined) {\n (0, util_1.checkStrictMode)(it, '\"if\" without \"then\" and \"else\" is ignored');\n }\n const hasThen = hasSchema(it, \"then\");\n const hasElse = hasSchema(it, \"else\");\n if (!hasThen && !hasElse)\n return;\n const valid = gen.let(\"valid\", true);\n const schValid = gen.name(\"_valid\");\n validateIf();\n cxt.reset();\n if (hasThen && hasElse) {\n const ifClause = gen.let(\"ifClause\");\n cxt.setParams({ ifClause });\n gen.if(schValid, validateClause(\"then\", ifClause), validateClause(\"else\", ifClause));\n }\n else if (hasThen) {\n gen.if(schValid, validateClause(\"then\"));\n }\n else {\n gen.if((0, codegen_1.not)(schValid), validateClause(\"else\"));\n }\n cxt.pass(valid, () => cxt.error(true));\n function validateIf() {\n const schCxt = cxt.subschema({\n keyword: \"if\",\n compositeRule: true,\n createErrors: false,\n allErrors: false,\n }, schValid);\n cxt.mergeEvaluated(schCxt);\n }\n function validateClause(keyword, ifClause) {\n return () => {\n const schCxt = cxt.subschema({ keyword }, schValid);\n gen.assign(valid, schValid);\n cxt.mergeValidEvaluated(schCxt, valid);\n if (ifClause)\n gen.assign(ifClause, (0, codegen_1._) `${keyword}`);\n else\n cxt.setParams({ ifClause: keyword });\n };\n }\n },\n};\nfunction hasSchema(it, keyword) {\n const schema = it.schema[keyword];\n return schema !== undefined && !(0, util_1.alwaysValidSchema)(it, schema);\n}\nexports.default = def;\n//# sourceMappingURL=if.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"../../compile/util\");\nconst def = {\n keyword: [\"then\", \"else\"],\n schemaType: [\"object\", \"boolean\"],\n code({ keyword, parentSchema, it }) {\n if (parentSchema.if === undefined)\n (0, util_1.checkStrictMode)(it, `\"${keyword}\" without \"if\" is ignored`);\n },\n};\nexports.default = def;\n//# sourceMappingURL=thenElse.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst additionalItems_1 = require(\"./additionalItems\");\nconst prefixItems_1 = require(\"./prefixItems\");\nconst items_1 = require(\"./items\");\nconst items2020_1 = require(\"./items2020\");\nconst contains_1 = require(\"./contains\");\nconst dependencies_1 = require(\"./dependencies\");\nconst propertyNames_1 = require(\"./propertyNames\");\nconst additionalProperties_1 = require(\"./additionalProperties\");\nconst properties_1 = require(\"./properties\");\nconst patternProperties_1 = require(\"./patternProperties\");\nconst not_1 = require(\"./not\");\nconst anyOf_1 = require(\"./anyOf\");\nconst oneOf_1 = require(\"./oneOf\");\nconst allOf_1 = require(\"./allOf\");\nconst if_1 = require(\"./if\");\nconst thenElse_1 = require(\"./thenElse\");\nfunction getApplicator(draft2020 = false) {\n const applicator = [\n // any\n not_1.default,\n anyOf_1.default,\n oneOf_1.default,\n allOf_1.default,\n if_1.default,\n thenElse_1.default,\n // object\n propertyNames_1.default,\n additionalProperties_1.default,\n dependencies_1.default,\n properties_1.default,\n patternProperties_1.default,\n ];\n // array\n if (draft2020)\n applicator.push(prefixItems_1.default, items2020_1.default);\n else\n applicator.push(additionalItems_1.default, items_1.default);\n applicator.push(contains_1.default);\n return applicator;\n}\nexports.default = getApplicator;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst error = {\n message: ({ schemaCode }) => (0, codegen_1.str) `must match format \"${schemaCode}\"`,\n params: ({ schemaCode }) => (0, codegen_1._) `{format: ${schemaCode}}`,\n};\nconst def = {\n keyword: \"format\",\n type: [\"number\", \"string\"],\n schemaType: \"string\",\n $data: true,\n error,\n code(cxt, ruleType) {\n const { gen, data, $data, schema, schemaCode, it } = cxt;\n const { opts, errSchemaPath, schemaEnv, self } = it;\n if (!opts.validateFormats)\n return;\n if ($data)\n validate$DataFormat();\n else\n validateFormat();\n function validate$DataFormat() {\n const fmts = gen.scopeValue(\"formats\", {\n ref: self.formats,\n code: opts.code.formats,\n });\n const fDef = gen.const(\"fDef\", (0, codegen_1._) `${fmts}[${schemaCode}]`);\n const fType = gen.let(\"fType\");\n const format = gen.let(\"format\");\n // TODO simplify\n gen.if((0, codegen_1._) `typeof ${fDef} == \"object\" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._) `${fDef}.type || \"string\"`).assign(format, (0, codegen_1._) `${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._) `\"string\"`).assign(format, fDef));\n cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));\n function unknownFmt() {\n if (opts.strictSchema === false)\n return codegen_1.nil;\n return (0, codegen_1._) `${schemaCode} && !${format}`;\n }\n function invalidFmt() {\n const callFormat = schemaEnv.$async\n ? (0, codegen_1._) `(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))`\n : (0, codegen_1._) `${format}(${data})`;\n const validData = (0, codegen_1._) `(typeof ${format} == \"function\" ? ${callFormat} : ${format}.test(${data}))`;\n return (0, codegen_1._) `${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;\n }\n }\n function validateFormat() {\n const formatDef = self.formats[schema];\n if (!formatDef) {\n unknownFormat();\n return;\n }\n if (formatDef === true)\n return;\n const [fmtType, format, fmtRef] = getFormat(formatDef);\n if (fmtType === ruleType)\n cxt.pass(validCondition());\n function unknownFormat() {\n if (opts.strictSchema === false) {\n self.logger.warn(unknownMsg());\n return;\n }\n throw new Error(unknownMsg());\n function unknownMsg() {\n return `unknown format \"${schema}\" ignored in schema at path \"${errSchemaPath}\"`;\n }\n }\n function getFormat(fmtDef) {\n const code = fmtDef instanceof RegExp\n ? (0, codegen_1.regexpCode)(fmtDef)\n : opts.code.formats\n ? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(schema)}`\n : undefined;\n const fmt = gen.scopeValue(\"formats\", { key: schema, ref: fmtDef, code });\n if (typeof fmtDef == \"object\" && !(fmtDef instanceof RegExp)) {\n return [fmtDef.type || \"string\", fmtDef.validate, (0, codegen_1._) `${fmt}.validate`];\n }\n return [\"string\", fmtDef, fmt];\n }\n function validCondition() {\n if (typeof formatDef == \"object\" && !(formatDef instanceof RegExp) && formatDef.async) {\n if (!schemaEnv.$async)\n throw new Error(\"async format in sync schema\");\n return (0, codegen_1._) `await ${fmtRef}(${data})`;\n }\n return typeof format == \"function\" ? (0, codegen_1._) `${fmtRef}(${data})` : (0, codegen_1._) `${fmtRef}.test(${data})`;\n }\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=format.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst format_1 = require(\"./format\");\nconst format = [format_1.default];\nexports.default = format;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.contentVocabulary = exports.metadataVocabulary = void 0;\nexports.metadataVocabulary = [\n \"title\",\n \"description\",\n \"default\",\n \"deprecated\",\n \"readOnly\",\n \"writeOnly\",\n \"examples\",\n];\nexports.contentVocabulary = [\n \"contentMediaType\",\n \"contentEncoding\",\n \"contentSchema\",\n];\n//# sourceMappingURL=metadata.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core_1 = require(\"./core\");\nconst validation_1 = require(\"./validation\");\nconst applicator_1 = require(\"./applicator\");\nconst format_1 = require(\"./format\");\nconst metadata_1 = require(\"./metadata\");\nconst draft7Vocabularies = [\n core_1.default,\n validation_1.default,\n (0, applicator_1.default)(),\n format_1.default,\n metadata_1.metadataVocabulary,\n metadata_1.contentVocabulary,\n];\nexports.default = draft7Vocabularies;\n//# sourceMappingURL=draft7.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiscrError = void 0;\nvar DiscrError;\n(function (DiscrError) {\n DiscrError[\"Tag\"] = \"tag\";\n DiscrError[\"Mapping\"] = \"mapping\";\n})(DiscrError || (exports.DiscrError = DiscrError = {}));\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst codegen_1 = require(\"../../compile/codegen\");\nconst types_1 = require(\"../discriminator/types\");\nconst compile_1 = require(\"../../compile\");\nconst ref_error_1 = require(\"../../compile/ref_error\");\nconst util_1 = require(\"../../compile/util\");\nconst error = {\n message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag\n ? `tag \"${tagName}\" must be string`\n : `value of tag \"${tagName}\" must be in oneOf`,\n params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._) `{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`,\n};\nconst def = {\n keyword: \"discriminator\",\n type: \"object\",\n schemaType: \"object\",\n error,\n code(cxt) {\n const { gen, data, schema, parentSchema, it } = cxt;\n const { oneOf } = parentSchema;\n if (!it.opts.discriminator) {\n throw new Error(\"discriminator: requires discriminator option\");\n }\n const tagName = schema.propertyName;\n if (typeof tagName != \"string\")\n throw new Error(\"discriminator: requires propertyName\");\n if (schema.mapping)\n throw new Error(\"discriminator: mapping is not supported\");\n if (!oneOf)\n throw new Error(\"discriminator: requires oneOf keyword\");\n const valid = gen.let(\"valid\", false);\n const tag = gen.const(\"tag\", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(tagName)}`);\n gen.if((0, codegen_1._) `typeof ${tag} == \"string\"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName }));\n cxt.ok(valid);\n function validateMapping() {\n const mapping = getMapping();\n gen.if(false);\n for (const tagValue in mapping) {\n gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`);\n gen.assign(valid, applyTagSchema(mapping[tagValue]));\n }\n gen.else();\n cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });\n gen.endIf();\n }\n function applyTagSchema(schemaProp) {\n const _valid = gen.name(\"valid\");\n const schCxt = cxt.subschema({ keyword: \"oneOf\", schemaProp }, _valid);\n cxt.mergeEvaluated(schCxt, codegen_1.Name);\n return _valid;\n }\n function getMapping() {\n var _a;\n const oneOfMapping = {};\n const topRequired = hasRequired(parentSchema);\n let tagRequired = true;\n for (let i = 0; i < oneOf.length; i++) {\n let sch = oneOf[i];\n if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {\n const ref = sch.$ref;\n sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);\n if (sch instanceof compile_1.SchemaEnv)\n sch = sch.schema;\n if (sch === undefined)\n throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);\n }\n const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];\n if (typeof propSch != \"object\") {\n throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have \"properties/${tagName}\"`);\n }\n tagRequired = tagRequired && (topRequired || hasRequired(sch));\n addMappings(propSch, i);\n }\n if (!tagRequired)\n throw new Error(`discriminator: \"${tagName}\" must be required`);\n return oneOfMapping;\n function hasRequired({ required }) {\n return Array.isArray(required) && required.includes(tagName);\n }\n function addMappings(sch, i) {\n if (sch.const) {\n addMapping(sch.const, i);\n }\n else if (sch.enum) {\n for (const tagValue of sch.enum) {\n addMapping(tagValue, i);\n }\n }\n else {\n throw new Error(`discriminator: \"properties/${tagName}\" must have \"const\" or \"enum\"`);\n }\n }\n function addMapping(tagValue, i) {\n if (typeof tagValue != \"string\" || tagValue in oneOfMapping) {\n throw new Error(`discriminator: \"${tagName}\" values must be unique strings`);\n }\n oneOfMapping[tagValue] = i;\n }\n }\n },\n};\nexports.default = def;\n//# sourceMappingURL=index.js.map","","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0;\nconst core_1 = require(\"./core\");\nconst draft7_1 = require(\"./vocabularies/draft7\");\nconst discriminator_1 = require(\"./vocabularies/discriminator\");\nconst draft7MetaSchema = require(\"./refs/json-schema-draft-07.json\");\nconst META_SUPPORT_DATA = [\"/properties\"];\nconst META_SCHEMA_ID = \"http://json-schema.org/draft-07/schema\";\nclass Ajv extends core_1.default {\n _addVocabularies() {\n super._addVocabularies();\n draft7_1.default.forEach((v) => this.addVocabulary(v));\n if (this.opts.discriminator)\n this.addKeyword(discriminator_1.default);\n }\n _addDefaultMetaSchema() {\n super._addDefaultMetaSchema();\n if (!this.opts.meta)\n return;\n const metaSchema = this.opts.$data\n ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA)\n : draft7MetaSchema;\n this.addMetaSchema(metaSchema, META_SCHEMA_ID, false);\n this.refs[\"http://json-schema.org/schema\"] = META_SCHEMA_ID;\n }\n defaultMeta() {\n return (this.opts.defaultMeta =\n super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));\n }\n}\nexports.Ajv = Ajv;\nmodule.exports = exports = Ajv;\nmodule.exports.Ajv = Ajv;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Ajv;\nvar validate_1 = require(\"./compile/validate\");\nObject.defineProperty(exports, \"KeywordCxt\", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });\nvar codegen_1 = require(\"./compile/codegen\");\nObject.defineProperty(exports, \"_\", { enumerable: true, get: function () { return codegen_1._; } });\nObject.defineProperty(exports, \"str\", { enumerable: true, get: function () { return codegen_1.str; } });\nObject.defineProperty(exports, \"stringify\", { enumerable: true, get: function () { return codegen_1.stringify; } });\nObject.defineProperty(exports, \"nil\", { enumerable: true, get: function () { return codegen_1.nil; } });\nObject.defineProperty(exports, \"Name\", { enumerable: true, get: function () { return codegen_1.Name; } });\nObject.defineProperty(exports, \"CodeGen\", { enumerable: true, get: function () { return codegen_1.CodeGen; } });\nvar validation_error_1 = require(\"./runtime/validation_error\");\nObject.defineProperty(exports, \"ValidationError\", { enumerable: true, get: function () { return validation_error_1.default; } });\nvar ref_error_1 = require(\"./compile/ref_error\");\nObject.defineProperty(exports, \"MissingRefError\", { enumerable: true, get: function () { return ref_error_1.default; } });\n//# sourceMappingURL=ajv.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.formatNames = exports.fastFormats = exports.fullFormats = void 0;\nfunction fmtDef(validate, compare) {\n return { validate, compare };\n}\nexports.fullFormats = {\n // date: http://tools.ietf.org/html/rfc3339#section-5.6\n date: fmtDef(date, compareDate),\n // date-time: http://tools.ietf.org/html/rfc3339#section-5.6\n time: fmtDef(getTime(true), compareTime),\n \"date-time\": fmtDef(getDateTime(true), compareDateTime),\n \"iso-time\": fmtDef(getTime(), compareIsoTime),\n \"iso-date-time\": fmtDef(getDateTime(), compareIsoDateTime),\n // duration: https://tools.ietf.org/html/rfc3339#appendix-A\n duration: /^P(?!$)((\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?|(\\d+W)?)$/,\n uri,\n \"uri-reference\": /^(?:[a-z][a-z0-9+\\-.]*:)?(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?: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9a-f]{2})*)?$/i,\n // uri-template: https://tools.ietf.org/html/rfc6570\n \"uri-template\": /^(?:(?:[^\\x00-\\x20\"'<>%\\\\^`{|}]|%[0-9a-f]{2})|\\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?)*\\})*$/i,\n // For the source: https://gist.github.com/dperini/729294\n // For test cases: https://mathiasbynens.be/demo/url-regex\n url: /^(?:https?|ftp):\\/\\/(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)(?:\\.(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$/iu,\n email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,\n hostname: /^(?=.{1,253}\\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\\.?$/i,\n // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n ipv4: /^(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)$/,\n ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))$/i,\n regex,\n // uuid: http://tools.ietf.org/html/rfc4122\n uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,\n // JSON-pointer: https://tools.ietf.org/html/rfc6901\n // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A\n \"json-pointer\": /^(?:\\/(?:[^~/]|~0|~1)*)*$/,\n \"json-pointer-uri-fragment\": /^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,\n // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00\n \"relative-json-pointer\": /^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/,\n // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types\n // byte: https://github.com/miguelmota/is-base64\n byte,\n // signed 32 bit integer\n int32: { type: \"number\", validate: validateInt32 },\n // signed 64 bit integer\n int64: { type: \"number\", validate: validateInt64 },\n // C-type float\n float: { type: \"number\", validate: validateNumber },\n // C-type double\n double: { type: \"number\", validate: validateNumber },\n // hint to the UI to hide input strings\n password: true,\n // unchecked string payload\n binary: true,\n};\nexports.fastFormats = {\n ...exports.fullFormats,\n date: fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/, compareDate),\n time: fmtDef(/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i, compareTime),\n \"date-time\": fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i, compareDateTime),\n \"iso-time\": fmtDef(/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i, compareIsoTime),\n \"iso-date-time\": fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s](?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i, compareIsoDateTime),\n // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js\n uri: /^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/)?[^\\s]*$/i,\n \"uri-reference\": /^(?:(?:[a-z][a-z0-9+\\-.]*:)?\\/?\\/)?(?:[^\\\\\\s#][^\\s#]*)?(?:#[^\\\\\\s]*)?$/i,\n // email (sources from jsen validator):\n // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')\n email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,\n};\nexports.formatNames = Object.keys(exports.fullFormats);\nfunction isLeapYear(year) {\n // https://tools.ietf.org/html/rfc3339#appendix-C\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\nconst DATE = /^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/;\nconst DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nfunction date(str) {\n // full-date from http://tools.ietf.org/html/rfc3339#section-5.6\n const matches = DATE.exec(str);\n if (!matches)\n return false;\n const year = +matches[1];\n const month = +matches[2];\n const day = +matches[3];\n return (month >= 1 &&\n month <= 12 &&\n day >= 1 &&\n day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]));\n}\nfunction compareDate(d1, d2) {\n if (!(d1 && d2))\n return undefined;\n if (d1 > d2)\n return 1;\n if (d1 < d2)\n return -1;\n return 0;\n}\nconst TIME = /^(\\d\\d):(\\d\\d):(\\d\\d(?:\\.\\d+)?)(z|([+-])(\\d\\d)(?::?(\\d\\d))?)?$/i;\nfunction getTime(strictTimeZone) {\n return function time(str) {\n const matches = TIME.exec(str);\n if (!matches)\n return false;\n const hr = +matches[1];\n const min = +matches[2];\n const sec = +matches[3];\n const tz = matches[4];\n const tzSign = matches[5] === \"-\" ? -1 : 1;\n const tzH = +(matches[6] || 0);\n const tzM = +(matches[7] || 0);\n if (tzH > 23 || tzM > 59 || (strictTimeZone && !tz))\n return false;\n if (hr <= 23 && min <= 59 && sec < 60)\n return true;\n // leap second\n const utcMin = min - tzM * tzSign;\n const utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0);\n return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61;\n };\n}\nfunction compareTime(s1, s2) {\n if (!(s1 && s2))\n return undefined;\n const t1 = new Date(\"2020-01-01T\" + s1).valueOf();\n const t2 = new Date(\"2020-01-01T\" + s2).valueOf();\n if (!(t1 && t2))\n return undefined;\n return t1 - t2;\n}\nfunction compareIsoTime(t1, t2) {\n if (!(t1 && t2))\n return undefined;\n const a1 = TIME.exec(t1);\n const a2 = TIME.exec(t2);\n if (!(a1 && a2))\n return undefined;\n t1 = a1[1] + a1[2] + a1[3];\n t2 = a2[1] + a2[2] + a2[3];\n if (t1 > t2)\n return 1;\n if (t1 < t2)\n return -1;\n return 0;\n}\nconst DATE_TIME_SEPARATOR = /t|\\s/i;\nfunction getDateTime(strictTimeZone) {\n const time = getTime(strictTimeZone);\n return function date_time(str) {\n // http://tools.ietf.org/html/rfc3339#section-5.6\n const dateTime = str.split(DATE_TIME_SEPARATOR);\n return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1]);\n };\n}\nfunction compareDateTime(dt1, dt2) {\n if (!(dt1 && dt2))\n return undefined;\n const d1 = new Date(dt1).valueOf();\n const d2 = new Date(dt2).valueOf();\n if (!(d1 && d2))\n return undefined;\n return d1 - d2;\n}\nfunction compareIsoDateTime(dt1, dt2) {\n if (!(dt1 && dt2))\n return undefined;\n const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR);\n const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR);\n const res = compareDate(d1, d2);\n if (res === undefined)\n return undefined;\n return res || compareTime(t1, t2);\n}\nconst NOT_URI_FRAGMENT = /\\/|:/;\nconst URI = /^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\\.[a-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)|(?:[a-z0-9\\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\\?(?:[a-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;\nfunction uri(str) {\n // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required \".\"\n return NOT_URI_FRAGMENT.test(str) && URI.test(str);\n}\nconst BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;\nfunction byte(str) {\n BYTE.lastIndex = 0;\n return BYTE.test(str);\n}\nconst MIN_INT32 = -(2 ** 31);\nconst MAX_INT32 = 2 ** 31 - 1;\nfunction validateInt32(value) {\n return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;\n}\nfunction validateInt64(value) {\n // JSON and javascript max Int is 2**53, so any int that passes isInteger is valid for Int64\n return Number.isInteger(value);\n}\nfunction validateNumber() {\n return true;\n}\nconst Z_ANCHOR = /[^\\\\]\\\\Z/;\nfunction regex(str) {\n if (Z_ANCHOR.test(str))\n return false;\n try {\n new RegExp(str);\n return true;\n }\n catch (e) {\n return false;\n }\n}\n//# sourceMappingURL=formats.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.formatLimitDefinition = void 0;\nconst ajv_1 = require(\"ajv\");\nconst codegen_1 = require(\"ajv/dist/compile/codegen\");\nconst ops = codegen_1.operators;\nconst KWDs = {\n formatMaximum: { okStr: \"<=\", ok: ops.LTE, fail: ops.GT },\n formatMinimum: { okStr: \">=\", ok: ops.GTE, fail: ops.LT },\n formatExclusiveMaximum: { okStr: \"<\", ok: ops.LT, fail: ops.GTE },\n formatExclusiveMinimum: { okStr: \">\", ok: ops.GT, fail: ops.LTE },\n};\nconst error = {\n message: ({ keyword, schemaCode }) => (0, codegen_1.str) `should be ${KWDs[keyword].okStr} ${schemaCode}`,\n params: ({ keyword, schemaCode }) => (0, codegen_1._) `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`,\n};\nexports.formatLimitDefinition = {\n keyword: Object.keys(KWDs),\n type: \"string\",\n schemaType: \"string\",\n $data: true,\n error,\n code(cxt) {\n const { gen, data, schemaCode, keyword, it } = cxt;\n const { opts, self } = it;\n if (!opts.validateFormats)\n return;\n const fCxt = new ajv_1.KeywordCxt(it, self.RULES.all.format.definition, \"format\");\n if (fCxt.$data)\n validate$DataFormat();\n else\n validateFormat();\n function validate$DataFormat() {\n const fmts = gen.scopeValue(\"formats\", {\n ref: self.formats,\n code: opts.code.formats,\n });\n const fmt = gen.const(\"fmt\", (0, codegen_1._) `${fmts}[${fCxt.schemaCode}]`);\n cxt.fail$data((0, codegen_1.or)((0, codegen_1._) `typeof ${fmt} != \"object\"`, (0, codegen_1._) `${fmt} instanceof RegExp`, (0, codegen_1._) `typeof ${fmt}.compare != \"function\"`, compareCode(fmt)));\n }\n function validateFormat() {\n const format = fCxt.schema;\n const fmtDef = self.formats[format];\n if (!fmtDef || fmtDef === true)\n return;\n if (typeof fmtDef != \"object\" ||\n fmtDef instanceof RegExp ||\n typeof fmtDef.compare != \"function\") {\n throw new Error(`\"${keyword}\": format \"${format}\" does not define \"compare\" function`);\n }\n const fmt = gen.scopeValue(\"formats\", {\n key: format,\n ref: fmtDef,\n code: opts.code.formats ? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(format)}` : undefined,\n });\n cxt.fail$data(compareCode(fmt));\n }\n function compareCode(fmt) {\n return (0, codegen_1._) `${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`;\n }\n },\n dependencies: [\"format\"],\n};\nconst formatLimitPlugin = (ajv) => {\n ajv.addKeyword(exports.formatLimitDefinition);\n return ajv;\n};\nexports.default = formatLimitPlugin;\n//# sourceMappingURL=limit.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst formats_1 = require(\"./formats\");\nconst limit_1 = require(\"./limit\");\nconst codegen_1 = require(\"ajv/dist/compile/codegen\");\nconst fullName = new codegen_1.Name(\"fullFormats\");\nconst fastName = new codegen_1.Name(\"fastFormats\");\nconst formatsPlugin = (ajv, opts = { keywords: true }) => {\n if (Array.isArray(opts)) {\n addFormats(ajv, opts, formats_1.fullFormats, fullName);\n return ajv;\n }\n const [formats, exportName] = opts.mode === \"fast\" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];\n const list = opts.formats || formats_1.formatNames;\n addFormats(ajv, list, formats, exportName);\n if (opts.keywords)\n (0, limit_1.default)(ajv);\n return ajv;\n};\nformatsPlugin.get = (name, mode = \"full\") => {\n const formats = mode === \"fast\" ? formats_1.fastFormats : formats_1.fullFormats;\n const f = formats[name];\n if (!f)\n throw new Error(`Unknown format \"${name}\"`);\n return f;\n};\nfunction addFormats(ajv, list, fs, exportName) {\n var _a;\n var _b;\n (_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : (_b.formats = (0, codegen_1._) `require(\"ajv-formats/dist/formats\").${exportName}`);\n for (const f of list)\n ajv.addFormat(f, fs[f]);\n}\nmodule.exports = exports = formatsPlugin;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = formatsPlugin;\n//# sourceMappingURL=index.js.map","/**\n * AJV-based JSON Schema validator provider\n */\nimport Ajv from 'ajv';\nimport _addFormats from 'ajv-formats';\nfunction createDefaultAjvInstance() {\n const ajv = new Ajv({\n strict: false,\n validateFormats: true,\n validateSchema: false,\n allErrors: true\n });\n const addFormats = _addFormats;\n addFormats(ajv);\n return ajv;\n}\n/**\n * @example\n * ```typescript\n * // Use with default AJV instance (recommended)\n * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';\n * const validator = new AjvJsonSchemaValidator();\n *\n * // Use with custom AJV instance\n * import { Ajv } from 'ajv';\n * const ajv = new Ajv({ strict: true, allErrors: true });\n * const validator = new AjvJsonSchemaValidator(ajv);\n * ```\n */\nexport class AjvJsonSchemaValidator {\n /**\n * Create an AJV validator\n *\n * @param ajv - Optional pre-configured AJV instance. If not provided, a default instance will be created.\n *\n * @example\n * ```typescript\n * // Use default configuration (recommended for most cases)\n * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';\n * const validator = new AjvJsonSchemaValidator();\n *\n * // Or provide custom AJV instance for advanced configuration\n * import { Ajv } from 'ajv';\n * import addFormats from 'ajv-formats';\n *\n * const ajv = new Ajv({ validateFormats: true });\n * addFormats(ajv);\n * const validator = new AjvJsonSchemaValidator(ajv);\n * ```\n */\n constructor(ajv) {\n this._ajv = ajv ?? createDefaultAjvInstance();\n }\n /**\n * Create a validator for the given JSON Schema\n *\n * The validator is compiled once and can be reused multiple times.\n * If the schema has an $id, it will be cached by AJV automatically.\n *\n * @param schema - Standard JSON Schema object\n * @returns A validator function that validates input data\n */\n getValidator(schema) {\n // Check if schema has $id and is already compiled/cached\n const ajvValidator = '$id' in schema && typeof schema.$id === 'string'\n ? (this._ajv.getSchema(schema.$id) ?? this._ajv.compile(schema))\n : this._ajv.compile(schema);\n return (input) => {\n const valid = ajvValidator(input);\n if (valid) {\n return {\n valid: true,\n data: input,\n errorMessage: undefined\n };\n }\n else {\n return {\n valid: false,\n data: undefined,\n errorMessage: this._ajv.errorsText(ajvValidator.errors)\n };\n }\n };\n }\n}\n//# sourceMappingURL=ajv-provider.js.map","import { createMCPClient } from \"@ai-sdk/mcp\";\nimport { Experimental_StdioMCPTransport } from \"@ai-sdk/mcp/mcp-stdio\";\nimport { discoverAuthorizationServerMetadata, discoverAuthorizationServerMetadata as discoverAuthorizationServerMetadata$1, discoverOAuthProtectedResourceMetadata, discoverOAuthProtectedResourceMetadata as discoverOAuthProtectedResourceMetadata$1, discoverOAuthServerInfo, discoverOAuthServerInfo as discoverOAuthServerInfo$1, exchangeAuthorization, extractWWWAuthenticateParams, isHttpsUrl, refreshAuthorization, registerClient, startAuthorization } from \"@modelcontextprotocol/sdk/client/auth.js\";\nimport { Client } from \"@modelcontextprotocol/sdk/client/index.js\";\nimport { StreamableHTTPClientTransport } from \"@modelcontextprotocol/sdk/client/streamableHttp.js\";\n//#region src/types.ts\nconst MCP = Symbol.for(\"keystroke.mcp\");\n//#endregion\n//#region src/define-mcp.ts\nfunction defineMcp(def) {\n\tconst key = def.key?.trim();\n\tif (!key) throw new Error(\"defineMcp requires key (e.g. defineMcp({ key: \\\"exa\\\", ... }))\");\n\tif (def.credentials?.length && !def.auth) throw new Error(`defineMcp(\"${key}\") declares credentials but no auth mapper`);\n\treturn {\n\t\t...def,\n\t\tkey,\n\t\t[MCP]: true\n\t};\n}\n//#endregion\n//#region src/is-mcp.ts\nfunction isMcp(value) {\n\treturn typeof value === \"object\" && value !== null && MCP in value && value[MCP] === true;\n}\n//#endregion\n//#region src/adapter.ts\nfunction createToolName(serverName, toolName) {\n\treturn `mcp__${sanitizeToolNamePart(serverName)}__${sanitizeToolNamePart(toolName)}`;\n}\nfunction sanitizeToolNamePart(value) {\n\treturn value.replace(/[^A-Za-z0-9_-]/g, \"_\").replace(/^_+|_+$/g, \"\") || \"unnamed\";\n}\nfunction normalizeInputSchema(schema) {\n\treturn {\n\t\t...schema,\n\t\ttype: schema.type ?? \"object\",\n\t\tproperties: schema.properties ?? {},\n\t\t...schema.required !== void 0 ? { required: schema.required } : {}\n\t};\n}\n/**\n* Re-key a native AI SDK {@link ToolSet} returned by `client.tools()` so every\n* tool is namespaced as `mcp__{server}__{tool}`. Prevents collisions across\n* servers and keeps tool names stable for prompts, filters, and tests.\n*/\nfunction prefixServerToolSet(serverName, toolSet) {\n\tconst prefixed = {};\n\tfor (const [name, tool] of Object.entries(toolSet)) {\n\t\tconst toolName = createToolName(serverName, name);\n\t\tif (prefixed[toolName]) throw new Error(`MCP tools from server \"${serverName}\" produced duplicate tool name \"${toolName}\".`);\n\t\tprefixed[toolName] = tool;\n\t}\n\treturn prefixed;\n}\n//#endregion\n//#region src/connect.ts\nasync function connectMcpServer(name, options) {\n\tconst url = options.url instanceof URL ? options.url : new URL(options.url);\n\tconst client = await createMCPClient({\n\t\ttransport: {\n\t\t\ttype: options.transport === \"sse\" ? \"sse\" : \"http\",\n\t\t\turl: url.toString(),\n\t\t\t...options.headers ? { headers: options.headers } : {},\n\t\t\t...options.fetch ? { fetch: options.fetch } : {}\n\t\t},\n\t\tclientName: options.clientName ?? \"keystroke\",\n\t\t...options.clientVersion ? { version: options.clientVersion } : {}\n\t});\n\ttry {\n\t\treturn {\n\t\t\tname,\n\t\t\ttoolSet: prefixServerToolSet(name, await client.tools()),\n\t\t\tclient,\n\t\t\tclose: () => client.close()\n\t\t};\n\t} catch (error) {\n\t\tawait client.close().catch(() => void 0);\n\t\tthrow error;\n\t}\n}\n//#endregion\n//#region src/connect-stdio.ts\nasync function connectMcpStdio(name, options) {\n\tconst client = await createMCPClient({\n\t\ttransport: new Experimental_StdioMCPTransport({\n\t\t\tcommand: options.command,\n\t\t\targs: options.args,\n\t\t\tenv: options.env,\n\t\t\tcwd: options.cwd,\n\t\t\tstderr: options.stderr\n\t\t}),\n\t\tclientName: options.clientName ?? \"keystroke\",\n\t\t...options.clientVersion ? { version: options.clientVersion } : {}\n\t});\n\ttry {\n\t\treturn {\n\t\t\tname,\n\t\t\ttoolSet: prefixServerToolSet(name, await client.tools()),\n\t\t\tclient,\n\t\t\tclose: () => client.close()\n\t\t};\n\t} catch (error) {\n\t\tawait client.close().catch(() => void 0);\n\t\tthrow error;\n\t}\n}\n//#endregion\n//#region src/connect-definition.ts\nasync function connectMcpDefinition(def, auth) {\n\tconst common = {\n\t\tclientName: def.clientName,\n\t\tclientVersion: def.clientVersion\n\t};\n\tif (def.transport.type === \"http\") return connectMcpServer(def.key, {\n\t\turl: applyAuthSearchParams(def.transport.url, auth?.searchParams),\n\t\ttransport: def.transport.transport,\n\t\theaders: auth?.headers,\n\t\trequestInit: def.requestInit,\n\t\tfetch: def.fetch,\n\t\t...common\n\t});\n\treturn connectMcpStdio(def.key, {\n\t\tcommand: def.transport.command,\n\t\targs: def.transport.args,\n\t\tcwd: def.transport.cwd,\n\t\tstderr: def.transport.stderr,\n\t\tenv: auth?.env,\n\t\t...common\n\t});\n}\nfunction applyAuthSearchParams(url, searchParams) {\n\tif (!searchParams) return url;\n\tconst resolved = url instanceof URL ? new URL(url) : new URL(url);\n\tfor (const [key, value] of Object.entries(searchParams)) resolved.searchParams.set(key, value);\n\treturn resolved;\n}\n//#endregion\n//#region src/oauth-scopes.ts\n/** Union OAuth scope names from metadata sources, preserving first-seen order. */\nfunction mergeOAuthScopes(...lists) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst result = [];\n\tfor (const list of lists) {\n\t\tif (!list?.length) continue;\n\t\tfor (const scope of list) {\n\t\t\tconst trimmed = scope.trim();\n\t\t\tif (trimmed && !seen.has(trimmed)) {\n\t\t\t\tseen.add(trimmed);\n\t\t\t\tresult.push(trimmed);\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}\n//#endregion\n//#region src/public-http-url.ts\n/** Thrown when a URL is not safe for server-side outbound fetch (SSRF guard). */\nvar PublicHttpUrlError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"PublicHttpUrlError\";\n\t}\n};\nconst BLOCKED_HOSTNAMES = new Set([\n\t\"localhost\",\n\t\"metadata.google.internal\",\n\t\"metadata.goog\"\n]);\nfunction normalizeHostname(hostname) {\n\tconst trimmed = hostname.trim().toLowerCase();\n\tif (trimmed.startsWith(\"[\") && trimmed.endsWith(\"]\")) return trimmed.slice(1, -1);\n\treturn trimmed;\n}\nfunction parseIpv4Octets(hostname) {\n\tconst parts = hostname.split(\".\");\n\tif (parts.length !== 4) return null;\n\tconst octets = [];\n\tfor (const part of parts) {\n\t\tif (!/^\\d+$/.test(part)) return null;\n\t\tconst value = Number(part);\n\t\tif (value > 255) return null;\n\t\toctets.push(value);\n\t}\n\treturn octets;\n}\nfunction isPrivateIpv4(octets) {\n\tconst a = octets[0];\n\tconst b = octets[1];\n\tif (a === void 0 || b === void 0) return true;\n\tif (a === 0 || a === 10 || a === 127) return true;\n\tif (a === 169 && b === 254) return true;\n\tif (a === 172 && b >= 16 && b <= 31) return true;\n\tif (a === 192 && b === 168) return true;\n\treturn false;\n}\nfunction isPrivateIpv6(hostname) {\n\tif (hostname === \"::1\") return true;\n\tif (hostname.startsWith(\"fe80:\")) return true;\n\tif (hostname.startsWith(\"fc\") || hostname.startsWith(\"fd\")) return true;\n\treturn false;\n}\nfunction isBlockedHost(hostname) {\n\tif (BLOCKED_HOSTNAMES.has(hostname)) return true;\n\tif (hostname.endsWith(\".localhost\")) return true;\n\tconst ipv4 = parseIpv4Octets(hostname);\n\tif (ipv4) return isPrivateIpv4(ipv4);\n\tif (hostname.includes(\":\")) return isPrivateIpv6(hostname);\n\treturn false;\n}\n/** Validate that a URL is safe to fetch from the platform (http/https, public hosts only). */\nfunction assertPublicHttpUrl(urlString) {\n\tlet url;\n\ttry {\n\t\turl = new URL(urlString.trim());\n\t} catch {\n\t\tthrow new PublicHttpUrlError(\"Invalid URL\");\n\t}\n\tif (url.protocol !== \"http:\" && url.protocol !== \"https:\") throw new PublicHttpUrlError(\"URL must use http or https\");\n\tif (isBlockedHost(normalizeHostname(url.hostname))) throw new PublicHttpUrlError(\"URL host is not allowed\");\n\treturn url;\n}\n//#endregion\n//#region src/fetch-public-http.ts\nconst DEFAULT_MAX_REDIRECTS = 5;\n/**\n* Fetch a URL that must remain on public http(s) hosts.\n* Validates the initial URL and every redirect Location (no private/metadata hosts).\n*/\nasync function fetchPublicHttp(urlString, options = {}) {\n\tconst { maxRedirects = DEFAULT_MAX_REDIRECTS, fetchFn = fetch, ...init } = options;\n\tlet current = assertPublicHttpUrl(urlString).toString();\n\tlet hopInit = { ...init };\n\tfor (let hop = 0; hop <= maxRedirects; hop++) {\n\t\tconst response = await fetchFn(current, {\n\t\t\t...hopInit,\n\t\t\tredirect: \"manual\"\n\t\t});\n\t\tif (response.status < 300 || response.status >= 400) return response;\n\t\tconst location = response.headers.get(\"location\");\n\t\tawait response.body?.cancel().catch(() => void 0);\n\t\tif (!location) throw new PublicHttpUrlError(\"Redirect missing Location\");\n\t\tlet next;\n\t\ttry {\n\t\t\tnext = new URL(location, current);\n\t\t} catch {\n\t\t\tthrow new PublicHttpUrlError(\"Invalid redirect Location\");\n\t\t}\n\t\tcurrent = assertPublicHttpUrl(next.toString()).toString();\n\t\tif (response.status === 301 || response.status === 302 || response.status === 303) {\n\t\t\tconst { body: _body, ...rest } = hopInit;\n\t\t\thopInit = {\n\t\t\t\t...rest,\n\t\t\t\tmethod: \"GET\"\n\t\t\t};\n\t\t}\n\t}\n\tthrow new PublicHttpUrlError(\"Too many redirects\");\n}\n/** Wrap `fetch` so every outbound URL (including SDK follow-ups) passes `assertPublicHttpUrl`. */\nfunction createPublicHttpFetch(fetchFn = fetch) {\n\treturn async (input, init) => {\n\t\tconst url = typeof input === \"string\" ? input : input instanceof URL ? input.href : input.url;\n\t\tassertPublicHttpUrl(url);\n\t\treturn fetchPublicHttp(url, {\n\t\t\t...init,\n\t\t\tfetchFn\n\t\t});\n\t};\n}\n//#endregion\n//#region src/probe.ts\nfunction resourceNameFromMetadata(metadata) {\n\treturn metadata?.resource_name?.trim() || void 0;\n}\nasync function probeUnauthenticatedStatus(url, fetchFn) {\n\ttry {\n\t\tconst response = await fetchFn(url, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: \"application/json, text/event-stream\" }\n\t\t});\n\t\tconst wwwAuthenticate = response.headers.get(\"www-authenticate\");\n\t\tawait response.body?.cancel();\n\t\treturn {\n\t\t\tstatus: response.status,\n\t\t\twwwAuthenticate\n\t\t};\n\t} catch {\n\t\treturn {};\n\t}\n}\nfunction scopesFromMetadata(metadata) {\n\tif (!metadata?.scopes_supported?.length) return [];\n\treturn metadata.scopes_supported;\n}\nfunction logProbeFallback(phase, error) {\n\tif (process.env.NODE_ENV === \"test\" || process.env.VITEST) return;\n\tconst detail = error instanceof Error ? error.message : String(error);\n\tconsole.warn(`[mcp-probe] ${phase} failed: ${detail}`);\n}\nasync function probeMcpAuth(url, fetchFn = fetch) {\n\tassertPublicHttpUrl(url);\n\tconst safeFetch = createPublicHttpFetch(fetchFn);\n\tconst serverUrl = new URL(url);\n\tconst { status, wwwAuthenticate } = await probeUnauthenticatedStatus(url, safeFetch);\n\tlet resourceMetadataUrl;\n\tif (wwwAuthenticate) {\n\t\tresourceMetadataUrl = extractWWWAuthenticateParams(new Response(null, { headers: { \"www-authenticate\": wwwAuthenticate } })).resourceMetadataUrl?.toString();\n\t\tif (resourceMetadataUrl) assertPublicHttpUrl(resourceMetadataUrl);\n\t}\n\ttry {\n\t\tconst discovered = await discoverOAuthServerInfo$1(serverUrl, {\n\t\t\tfetchFn: safeFetch,\n\t\t\t...resourceMetadataUrl ? { resourceMetadataUrl: new URL(resourceMetadataUrl) } : {}\n\t\t});\n\t\tconst metadata = discovered.authorizationServerMetadata;\n\t\tif (metadata?.authorization_endpoint && metadata.token_endpoint) return {\n\t\t\turl,\n\t\t\tmode: \"oauth\",\n\t\t\tunauthenticatedStatus: status,\n\t\t\toauth: {\n\t\t\t\tissuer: metadata.issuer,\n\t\t\t\tauthorizationEndpoint: metadata.authorization_endpoint,\n\t\t\t\ttokenEndpoint: metadata.token_endpoint,\n\t\t\t\tregistrationEndpoint: metadata.registration_endpoint,\n\t\t\t\tscopes: mergeOAuthScopes(scopesFromMetadata(metadata), scopesFromMetadata(discovered.resourceMetadata)),\n\t\t\t\tresource: discovered.resourceMetadata?.resource,\n\t\t\t\tresourceName: resourceNameFromMetadata(discovered.resourceMetadata)\n\t\t\t}\n\t\t};\n\t} catch (error) {\n\t\tlogProbeFallback(\"discoverOAuthServerInfo\", error);\n\t}\n\ttry {\n\t\tconst protectedResource = await discoverOAuthProtectedResourceMetadata$1(serverUrl, {}, safeFetch);\n\t\tconst authorizationServerUrl = protectedResource.authorization_servers?.[0] ?? serverUrl.origin;\n\t\tassertPublicHttpUrl(authorizationServerUrl);\n\t\tconst metadata = await discoverAuthorizationServerMetadata$1(authorizationServerUrl, { fetchFn: safeFetch });\n\t\tif (metadata?.authorization_endpoint && metadata.token_endpoint) return {\n\t\t\turl,\n\t\t\tmode: \"oauth\",\n\t\t\tunauthenticatedStatus: status,\n\t\t\toauth: {\n\t\t\t\tissuer: metadata.issuer,\n\t\t\t\tauthorizationEndpoint: metadata.authorization_endpoint,\n\t\t\t\ttokenEndpoint: metadata.token_endpoint,\n\t\t\t\tregistrationEndpoint: metadata.registration_endpoint,\n\t\t\t\tscopes: mergeOAuthScopes(scopesFromMetadata(metadata), scopesFromMetadata(protectedResource)),\n\t\t\t\tresource: protectedResource.resource,\n\t\t\t\tresourceName: resourceNameFromMetadata(protectedResource)\n\t\t\t}\n\t\t};\n\t} catch (error) {\n\t\tlogProbeFallback(\"discoverOAuthProtectedResourceMetadata\", error);\n\t}\n\tif (status === 401 || status === 403) return {\n\t\turl,\n\t\tmode: \"token\",\n\t\tunauthenticatedStatus: status,\n\t\tscheme: \"BEARER_TOKEN\"\n\t};\n\treturn {\n\t\turl,\n\t\tmode: \"none\",\n\t\tunauthenticatedStatus: status\n\t};\n}\n//#endregion\n//#region src/probe-server-info.ts\n/** Best-effort server metadata for no-auth MCP servers (initialize handshake). */\nasync function probeMcpServerInfo(url, fetchFn = fetch) {\n\tassertPublicHttpUrl(url);\n\tconst safeFetch = createPublicHttpFetch(fetchFn);\n\tconst client = new Client({\n\t\tname: \"keystroke\",\n\t\tversion: \"0.0.0\"\n\t});\n\tconst transport = new StreamableHTTPClientTransport(new URL(url), { fetch: safeFetch });\n\ttry {\n\t\tawait client.connect(transport);\n\t\tconst info = client.getServerVersion();\n\t\tif (!info) return;\n\t\treturn {\n\t\t\tname: info.name,\n\t\t\ttitle: info.title,\n\t\t\tdescription: info.description,\n\t\t\tversion: info.version\n\t\t};\n\t} catch {\n\t\treturn;\n\t} finally {\n\t\tawait client.close().catch(() => void 0);\n\t}\n}\n//#endregion\n//#region src/read-client.ts\n/**\n* Connect a read-only MCP client over Streamable HTTP, run `fn`, and always close.\n*\n* For public, no-auth MCP servers (e.g. the Mintlify docs search server). Mirrors\n* `probeMcpServerInfo`: the SDK client drives the `initialize` handshake, so callers\n* just `callTool` / `readResource`.\n*/\nasync function withMcpReadClient(url, fn) {\n\tconst client = new Client({\n\t\tname: \"keystroke-cli\",\n\t\tversion: \"0.0.0\"\n\t});\n\tconst transport = new StreamableHTTPClientTransport(url instanceof URL ? url : new URL(url));\n\ttry {\n\t\tawait client.connect(transport);\n\t\treturn await fn(client);\n\t} finally {\n\t\tawait client.close().catch(() => void 0);\n\t}\n}\n//#endregion\nexport { MCP, PublicHttpUrlError, assertPublicHttpUrl, connectMcpDefinition, connectMcpServer, connectMcpStdio, createPublicHttpFetch, createToolName, defineMcp, discoverAuthorizationServerMetadata, discoverOAuthProtectedResourceMetadata, discoverOAuthServerInfo, exchangeAuthorization, fetchPublicHttp, isHttpsUrl, isMcp, mergeOAuthScopes, normalizeInputSchema, prefixServerToolSet, probeMcpAuth, probeMcpServerInfo, refreshAuthorization, registerClient, startAuthorization, withMcpReadClient };\n\n//# sourceMappingURL=index.mjs.map","'use strict';\n\nconst ALIAS = Symbol.for('yaml.alias');\nconst DOC = Symbol.for('yaml.document');\nconst MAP = Symbol.for('yaml.map');\nconst PAIR = Symbol.for('yaml.pair');\nconst SCALAR = Symbol.for('yaml.scalar');\nconst SEQ = Symbol.for('yaml.seq');\nconst NODE_TYPE = Symbol.for('yaml.node.type');\nconst isAlias = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === ALIAS;\nconst isDocument = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === DOC;\nconst isMap = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === MAP;\nconst isPair = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === PAIR;\nconst isScalar = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SCALAR;\nconst isSeq = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SEQ;\nfunction isCollection(node) {\n if (node && typeof node === 'object')\n switch (node[NODE_TYPE]) {\n case MAP:\n case SEQ:\n return true;\n }\n return false;\n}\nfunction isNode(node) {\n if (node && typeof node === 'object')\n switch (node[NODE_TYPE]) {\n case ALIAS:\n case MAP:\n case SCALAR:\n case SEQ:\n return true;\n }\n return false;\n}\nconst hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor;\n\nexports.ALIAS = ALIAS;\nexports.DOC = DOC;\nexports.MAP = MAP;\nexports.NODE_TYPE = NODE_TYPE;\nexports.PAIR = PAIR;\nexports.SCALAR = SCALAR;\nexports.SEQ = SEQ;\nexports.hasAnchor = hasAnchor;\nexports.isAlias = isAlias;\nexports.isCollection = isCollection;\nexports.isDocument = isDocument;\nexports.isMap = isMap;\nexports.isNode = isNode;\nexports.isPair = isPair;\nexports.isScalar = isScalar;\nexports.isSeq = isSeq;\n","'use strict';\n\nvar identity = require('./nodes/identity.js');\n\nconst BREAK = Symbol('break visit');\nconst SKIP = Symbol('skip children');\nconst REMOVE = Symbol('remove node');\n/**\n * Apply a visitor to an AST node or document.\n *\n * Walks through the tree (depth-first) starting from `node`, calling a\n * `visitor` function with three arguments:\n * - `key`: For sequence values and map `Pair`, the node's index in the\n * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.\n * `null` for the root node.\n * - `node`: The current node.\n * - `path`: The ancestry of the current node.\n *\n * The return value of the visitor may be used to control the traversal:\n * - `undefined` (default): Do nothing and continue\n * - `visit.SKIP`: Do not visit the children of this node, continue with next\n * sibling\n * - `visit.BREAK`: Terminate traversal completely\n * - `visit.REMOVE`: Remove the current node, then continue with the next one\n * - `Node`: Replace the current node, then continue by visiting it\n * - `number`: While iterating the items of a sequence or map, set the index\n * of the next step. This is useful especially if the index of the current\n * node has changed.\n *\n * If `visitor` is a single function, it will be called with all values\n * encountered in the tree, including e.g. `null` values. Alternatively,\n * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,\n * `Alias` and `Scalar` node. To define the same visitor function for more than\n * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)\n * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most\n * specific defined one will be used for each node.\n */\nfunction visit(node, visitor) {\n const visitor_ = initVisitor(visitor);\n if (identity.isDocument(node)) {\n const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));\n if (cd === REMOVE)\n node.contents = null;\n }\n else\n visit_(null, node, visitor_, Object.freeze([]));\n}\n// Without the `as symbol` casts, TS declares these in the `visit`\n// namespace using `var`, but then complains about that because\n// `unique symbol` must be `const`.\n/** Terminate visit traversal completely */\nvisit.BREAK = BREAK;\n/** Do not visit the children of the current node */\nvisit.SKIP = SKIP;\n/** Remove the current node */\nvisit.REMOVE = REMOVE;\nfunction visit_(key, node, visitor, path) {\n const ctrl = callVisitor(key, node, visitor, path);\n if (identity.isNode(ctrl) || identity.isPair(ctrl)) {\n replaceNode(key, path, ctrl);\n return visit_(key, ctrl, visitor, path);\n }\n if (typeof ctrl !== 'symbol') {\n if (identity.isCollection(node)) {\n path = Object.freeze(path.concat(node));\n for (let i = 0; i < node.items.length; ++i) {\n const ci = visit_(i, node.items[i], visitor, path);\n if (typeof ci === 'number')\n i = ci - 1;\n else if (ci === BREAK)\n return BREAK;\n else if (ci === REMOVE) {\n node.items.splice(i, 1);\n i -= 1;\n }\n }\n }\n else if (identity.isPair(node)) {\n path = Object.freeze(path.concat(node));\n const ck = visit_('key', node.key, visitor, path);\n if (ck === BREAK)\n return BREAK;\n else if (ck === REMOVE)\n node.key = null;\n const cv = visit_('value', node.value, visitor, path);\n if (cv === BREAK)\n return BREAK;\n else if (cv === REMOVE)\n node.value = null;\n }\n }\n return ctrl;\n}\n/**\n * Apply an async visitor to an AST node or document.\n *\n * Walks through the tree (depth-first) starting from `node`, calling a\n * `visitor` function with three arguments:\n * - `key`: For sequence values and map `Pair`, the node's index in the\n * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.\n * `null` for the root node.\n * - `node`: The current node.\n * - `path`: The ancestry of the current node.\n *\n * The return value of the visitor may be used to control the traversal:\n * - `Promise`: Must resolve to one of the following values\n * - `undefined` (default): Do nothing and continue\n * - `visit.SKIP`: Do not visit the children of this node, continue with next\n * sibling\n * - `visit.BREAK`: Terminate traversal completely\n * - `visit.REMOVE`: Remove the current node, then continue with the next one\n * - `Node`: Replace the current node, then continue by visiting it\n * - `number`: While iterating the items of a sequence or map, set the index\n * of the next step. This is useful especially if the index of the current\n * node has changed.\n *\n * If `visitor` is a single function, it will be called with all values\n * encountered in the tree, including e.g. `null` values. Alternatively,\n * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,\n * `Alias` and `Scalar` node. To define the same visitor function for more than\n * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)\n * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most\n * specific defined one will be used for each node.\n */\nasync function visitAsync(node, visitor) {\n const visitor_ = initVisitor(visitor);\n if (identity.isDocument(node)) {\n const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node]));\n if (cd === REMOVE)\n node.contents = null;\n }\n else\n await visitAsync_(null, node, visitor_, Object.freeze([]));\n}\n// Without the `as symbol` casts, TS declares these in the `visit`\n// namespace using `var`, but then complains about that because\n// `unique symbol` must be `const`.\n/** Terminate visit traversal completely */\nvisitAsync.BREAK = BREAK;\n/** Do not visit the children of the current node */\nvisitAsync.SKIP = SKIP;\n/** Remove the current node */\nvisitAsync.REMOVE = REMOVE;\nasync function visitAsync_(key, node, visitor, path) {\n const ctrl = await callVisitor(key, node, visitor, path);\n if (identity.isNode(ctrl) || identity.isPair(ctrl)) {\n replaceNode(key, path, ctrl);\n return visitAsync_(key, ctrl, visitor, path);\n }\n if (typeof ctrl !== 'symbol') {\n if (identity.isCollection(node)) {\n path = Object.freeze(path.concat(node));\n for (let i = 0; i < node.items.length; ++i) {\n const ci = await visitAsync_(i, node.items[i], visitor, path);\n if (typeof ci === 'number')\n i = ci - 1;\n else if (ci === BREAK)\n return BREAK;\n else if (ci === REMOVE) {\n node.items.splice(i, 1);\n i -= 1;\n }\n }\n }\n else if (identity.isPair(node)) {\n path = Object.freeze(path.concat(node));\n const ck = await visitAsync_('key', node.key, visitor, path);\n if (ck === BREAK)\n return BREAK;\n else if (ck === REMOVE)\n node.key = null;\n const cv = await visitAsync_('value', node.value, visitor, path);\n if (cv === BREAK)\n return BREAK;\n else if (cv === REMOVE)\n node.value = null;\n }\n }\n return ctrl;\n}\nfunction initVisitor(visitor) {\n if (typeof visitor === 'object' &&\n (visitor.Collection || visitor.Node || visitor.Value)) {\n return Object.assign({\n Alias: visitor.Node,\n Map: visitor.Node,\n Scalar: visitor.Node,\n Seq: visitor.Node\n }, visitor.Value && {\n Map: visitor.Value,\n Scalar: visitor.Value,\n Seq: visitor.Value\n }, visitor.Collection && {\n Map: visitor.Collection,\n Seq: visitor.Collection\n }, visitor);\n }\n return visitor;\n}\nfunction callVisitor(key, node, visitor, path) {\n if (typeof visitor === 'function')\n return visitor(key, node, path);\n if (identity.isMap(node))\n return visitor.Map?.(key, node, path);\n if (identity.isSeq(node))\n return visitor.Seq?.(key, node, path);\n if (identity.isPair(node))\n return visitor.Pair?.(key, node, path);\n if (identity.isScalar(node))\n return visitor.Scalar?.(key, node, path);\n if (identity.isAlias(node))\n return visitor.Alias?.(key, node, path);\n return undefined;\n}\nfunction replaceNode(key, path, node) {\n const parent = path[path.length - 1];\n if (identity.isCollection(parent)) {\n parent.items[key] = node;\n }\n else if (identity.isPair(parent)) {\n if (key === 'key')\n parent.key = node;\n else\n parent.value = node;\n }\n else if (identity.isDocument(parent)) {\n parent.contents = node;\n }\n else {\n const pt = identity.isAlias(parent) ? 'alias' : 'scalar';\n throw new Error(`Cannot replace node with ${pt} parent`);\n }\n}\n\nexports.visit = visit;\nexports.visitAsync = visitAsync;\n","'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar visit = require('../visit.js');\n\nconst escapeChars = {\n '!': '%21',\n ',': '%2C',\n '[': '%5B',\n ']': '%5D',\n '{': '%7B',\n '}': '%7D'\n};\nconst escapeTagName = (tn) => tn.replace(/[!,[\\]{}]/g, ch => escapeChars[ch]);\nclass Directives {\n constructor(yaml, tags) {\n /**\n * The directives-end/doc-start marker `---`. If `null`, a marker may still be\n * included in the document's stringified representation.\n */\n this.docStart = null;\n /** The doc-end marker `...`. */\n this.docEnd = false;\n this.yaml = Object.assign({}, Directives.defaultYaml, yaml);\n this.tags = Object.assign({}, Directives.defaultTags, tags);\n }\n clone() {\n const copy = new Directives(this.yaml, this.tags);\n copy.docStart = this.docStart;\n return copy;\n }\n /**\n * During parsing, get a Directives instance for the current document and\n * update the stream state according to the current version's spec.\n */\n atDocument() {\n const res = new Directives(this.yaml, this.tags);\n switch (this.yaml.version) {\n case '1.1':\n this.atNextDocument = true;\n break;\n case '1.2':\n this.atNextDocument = false;\n this.yaml = {\n explicit: Directives.defaultYaml.explicit,\n version: '1.2'\n };\n this.tags = Object.assign({}, Directives.defaultTags);\n break;\n }\n return res;\n }\n /**\n * @param onError - May be called even if the action was successful\n * @returns `true` on success\n */\n add(line, onError) {\n if (this.atNextDocument) {\n this.yaml = { explicit: Directives.defaultYaml.explicit, version: '1.1' };\n this.tags = Object.assign({}, Directives.defaultTags);\n this.atNextDocument = false;\n }\n const parts = line.trim().split(/[ \\t]+/);\n const name = parts.shift();\n switch (name) {\n case '%TAG': {\n if (parts.length !== 2) {\n onError(0, '%TAG directive should contain exactly two parts');\n if (parts.length < 2)\n return false;\n }\n const [handle, prefix] = parts;\n this.tags[handle] = prefix;\n return true;\n }\n case '%YAML': {\n this.yaml.explicit = true;\n if (parts.length !== 1) {\n onError(0, '%YAML directive should contain exactly one part');\n return false;\n }\n const [version] = parts;\n if (version === '1.1' || version === '1.2') {\n this.yaml.version = version;\n return true;\n }\n else {\n const isValid = /^\\d+\\.\\d+$/.test(version);\n onError(6, `Unsupported YAML version ${version}`, isValid);\n return false;\n }\n }\n default:\n onError(0, `Unknown directive ${name}`, true);\n return false;\n }\n }\n /**\n * Resolves a tag, matching handles to those defined in %TAG directives.\n *\n * @returns Resolved tag, which may also be the non-specific tag `'!'` or a\n * `'!local'` tag, or `null` if unresolvable.\n */\n tagName(source, onError) {\n if (source === '!')\n return '!'; // non-specific tag\n if (source[0] !== '!') {\n onError(`Not a valid tag: ${source}`);\n return null;\n }\n if (source[1] === '<') {\n const verbatim = source.slice(2, -1);\n if (verbatim === '!' || verbatim === '!!') {\n onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);\n return null;\n }\n if (source[source.length - 1] !== '>')\n onError('Verbatim tags must end with a >');\n return verbatim;\n }\n const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);\n if (!suffix)\n onError(`The ${source} tag has no suffix`);\n const prefix = this.tags[handle];\n if (prefix) {\n try {\n return prefix + decodeURIComponent(suffix);\n }\n catch (error) {\n onError(String(error));\n return null;\n }\n }\n if (handle === '!')\n return source; // local tag\n onError(`Could not resolve tag: ${source}`);\n return null;\n }\n /**\n * Given a fully resolved tag, returns its printable string form,\n * taking into account current tag prefixes and defaults.\n */\n tagString(tag) {\n for (const [handle, prefix] of Object.entries(this.tags)) {\n if (tag.startsWith(prefix))\n return handle + escapeTagName(tag.substring(prefix.length));\n }\n return tag[0] === '!' ? tag : `!<${tag}>`;\n }\n toString(doc) {\n const lines = this.yaml.explicit\n ? [`%YAML ${this.yaml.version || '1.2'}`]\n : [];\n const tagEntries = Object.entries(this.tags);\n let tagNames;\n if (doc && tagEntries.length > 0 && identity.isNode(doc.contents)) {\n const tags = {};\n visit.visit(doc.contents, (_key, node) => {\n if (identity.isNode(node) && node.tag)\n tags[node.tag] = true;\n });\n tagNames = Object.keys(tags);\n }\n else\n tagNames = [];\n for (const [handle, prefix] of tagEntries) {\n if (handle === '!!' && prefix === 'tag:yaml.org,2002:')\n continue;\n if (!doc || tagNames.some(tn => tn.startsWith(prefix)))\n lines.push(`%TAG ${handle} ${prefix}`);\n }\n return lines.join('\\n');\n }\n}\nDirectives.defaultYaml = { explicit: false, version: '1.2' };\nDirectives.defaultTags = { '!!': 'tag:yaml.org,2002:' };\n\nexports.Directives = Directives;\n","'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar visit = require('../visit.js');\n\n/**\n * Verify that the input string is a valid anchor.\n *\n * Will throw on errors.\n */\nfunction anchorIsValid(anchor) {\n if (/[\\x00-\\x19\\s,[\\]{}]/.test(anchor)) {\n const sa = JSON.stringify(anchor);\n const msg = `Anchor must not contain whitespace or control characters: ${sa}`;\n throw new Error(msg);\n }\n return true;\n}\nfunction anchorNames(root) {\n const anchors = new Set();\n visit.visit(root, {\n Value(_key, node) {\n if (node.anchor)\n anchors.add(node.anchor);\n }\n });\n return anchors;\n}\n/** Find a new anchor name with the given `prefix` and a one-indexed suffix. */\nfunction findNewAnchor(prefix, exclude) {\n for (let i = 1; true; ++i) {\n const name = `${prefix}${i}`;\n if (!exclude.has(name))\n return name;\n }\n}\nfunction createNodeAnchors(doc, prefix) {\n const aliasObjects = [];\n const sourceObjects = new Map();\n let prevAnchors = null;\n return {\n onAnchor: (source) => {\n aliasObjects.push(source);\n prevAnchors ?? (prevAnchors = anchorNames(doc));\n const anchor = findNewAnchor(prefix, prevAnchors);\n prevAnchors.add(anchor);\n return anchor;\n },\n /**\n * With circular references, the source node is only resolved after all\n * of its child nodes are. This is why anchors are set only after all of\n * the nodes have been created.\n */\n setAnchors: () => {\n for (const source of aliasObjects) {\n const ref = sourceObjects.get(source);\n if (typeof ref === 'object' &&\n ref.anchor &&\n (identity.isScalar(ref.node) || identity.isCollection(ref.node))) {\n ref.node.anchor = ref.anchor;\n }\n else {\n const error = new Error('Failed to resolve repeated object (this should not happen)');\n error.source = source;\n throw error;\n }\n }\n },\n sourceObjects\n };\n}\n\nexports.anchorIsValid = anchorIsValid;\nexports.anchorNames = anchorNames;\nexports.createNodeAnchors = createNodeAnchors;\nexports.findNewAnchor = findNewAnchor;\n","'use strict';\n\n/**\n * Applies the JSON.parse reviver algorithm as defined in the ECMA-262 spec,\n * in section 24.5.1.1 \"Runtime Semantics: InternalizeJSONProperty\" of the\n * 2021 edition: https://tc39.es/ecma262/#sec-json.parse\n *\n * Includes extensions for handling Map and Set objects.\n */\nfunction applyReviver(reviver, obj, key, val) {\n if (val && typeof val === 'object') {\n if (Array.isArray(val)) {\n for (let i = 0, len = val.length; i < len; ++i) {\n const v0 = val[i];\n const v1 = applyReviver(reviver, val, String(i), v0);\n // eslint-disable-next-line @typescript-eslint/no-array-delete\n if (v1 === undefined)\n delete val[i];\n else if (v1 !== v0)\n val[i] = v1;\n }\n }\n else if (val instanceof Map) {\n for (const k of Array.from(val.keys())) {\n const v0 = val.get(k);\n const v1 = applyReviver(reviver, val, k, v0);\n if (v1 === undefined)\n val.delete(k);\n else if (v1 !== v0)\n val.set(k, v1);\n }\n }\n else if (val instanceof Set) {\n for (const v0 of Array.from(val)) {\n const v1 = applyReviver(reviver, val, v0, v0);\n if (v1 === undefined)\n val.delete(v0);\n else if (v1 !== v0) {\n val.delete(v0);\n val.add(v1);\n }\n }\n }\n else {\n for (const [k, v0] of Object.entries(val)) {\n const v1 = applyReviver(reviver, val, k, v0);\n if (v1 === undefined)\n delete val[k];\n else if (v1 !== v0)\n val[k] = v1;\n }\n }\n }\n return reviver.call(obj, key, val);\n}\n\nexports.applyReviver = applyReviver;\n","'use strict';\n\nvar identity = require('./identity.js');\n\n/**\n * Recursively convert any node or its contents to native JavaScript\n *\n * @param value - The input value\n * @param arg - If `value` defines a `toJSON()` method, use this\n * as its first argument\n * @param ctx - Conversion context, originally set in Document#toJS(). If\n * `{ keep: true }` is not set, output should be suitable for JSON\n * stringification.\n */\nfunction toJS(value, arg, ctx) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n if (Array.isArray(value))\n return value.map((v, i) => toJS(v, String(i), ctx));\n if (value && typeof value.toJSON === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n if (!ctx || !identity.hasAnchor(value))\n return value.toJSON(arg, ctx);\n const data = { aliasCount: 0, count: 1, res: undefined };\n ctx.anchors.set(value, data);\n ctx.onCreate = res => {\n data.res = res;\n delete ctx.onCreate;\n };\n const res = value.toJSON(arg, ctx);\n if (ctx.onCreate)\n ctx.onCreate(res);\n return res;\n }\n if (typeof value === 'bigint' && !ctx?.keep)\n return Number(value);\n return value;\n}\n\nexports.toJS = toJS;\n","'use strict';\n\nvar applyReviver = require('../doc/applyReviver.js');\nvar identity = require('./identity.js');\nvar toJS = require('./toJS.js');\n\nclass NodeBase {\n constructor(type) {\n Object.defineProperty(this, identity.NODE_TYPE, { value: type });\n }\n /** Create a copy of this node. */\n clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }\n /** A plain JavaScript representation of this node. */\n toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {\n if (!identity.isDocument(doc))\n throw new TypeError('A document argument is required');\n const ctx = {\n anchors: new Map(),\n doc,\n keep: true,\n mapAsMap: mapAsMap === true,\n mapKeyWarned: false,\n maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100\n };\n const res = toJS.toJS(this, '', ctx);\n if (typeof onAnchor === 'function')\n for (const { count, res } of ctx.anchors.values())\n onAnchor(res, count);\n return typeof reviver === 'function'\n ? applyReviver.applyReviver(reviver, { '': res }, '', res)\n : res;\n }\n}\n\nexports.NodeBase = NodeBase;\n","'use strict';\n\nvar anchors = require('../doc/anchors.js');\nvar visit = require('../visit.js');\nvar identity = require('./identity.js');\nvar Node = require('./Node.js');\nvar toJS = require('./toJS.js');\n\nclass Alias extends Node.NodeBase {\n constructor(source) {\n super(identity.ALIAS);\n this.source = source;\n Object.defineProperty(this, 'tag', {\n set() {\n throw new Error('Alias nodes cannot have tags');\n }\n });\n }\n /**\n * Resolve the value of this alias within `doc`, finding the last\n * instance of the `source` anchor before this node.\n */\n resolve(doc, ctx) {\n if (ctx?.maxAliasCount === 0)\n throw new ReferenceError('Alias resolution is disabled');\n let nodes;\n if (ctx?.aliasResolveCache) {\n nodes = ctx.aliasResolveCache;\n }\n else {\n nodes = [];\n visit.visit(doc, {\n Node: (_key, node) => {\n if (identity.isAlias(node) || identity.hasAnchor(node))\n nodes.push(node);\n }\n });\n if (ctx)\n ctx.aliasResolveCache = nodes;\n }\n let found = undefined;\n for (const node of nodes) {\n if (node === this)\n break;\n if (node.anchor === this.source)\n found = node;\n }\n return found;\n }\n toJSON(_arg, ctx) {\n if (!ctx)\n return { source: this.source };\n const { anchors, doc, maxAliasCount } = ctx;\n const source = this.resolve(doc, ctx);\n if (!source) {\n const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;\n throw new ReferenceError(msg);\n }\n let data = anchors.get(source);\n if (!data) {\n // Resolve anchors for Node.prototype.toJS()\n toJS.toJS(source, null, ctx);\n data = anchors.get(source);\n }\n /* istanbul ignore if */\n if (data?.res === undefined) {\n const msg = 'This should not happen: Alias anchor was not resolved?';\n throw new ReferenceError(msg);\n }\n if (maxAliasCount >= 0) {\n data.count += 1;\n if (data.aliasCount === 0)\n data.aliasCount = getAliasCount(doc, source, anchors);\n if (data.count * data.aliasCount > maxAliasCount) {\n const msg = 'Excessive alias count indicates a resource exhaustion attack';\n throw new ReferenceError(msg);\n }\n }\n return data.res;\n }\n toString(ctx, _onComment, _onChompKeep) {\n const src = `*${this.source}`;\n if (ctx) {\n anchors.anchorIsValid(this.source);\n if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) {\n const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;\n throw new Error(msg);\n }\n if (ctx.implicitKey)\n return `${src} `;\n }\n return src;\n }\n}\nfunction getAliasCount(doc, node, anchors) {\n if (identity.isAlias(node)) {\n const source = node.resolve(doc);\n const anchor = anchors && source && anchors.get(source);\n return anchor ? anchor.count * anchor.aliasCount : 0;\n }\n else if (identity.isCollection(node)) {\n let count = 0;\n for (const item of node.items) {\n const c = getAliasCount(doc, item, anchors);\n if (c > count)\n count = c;\n }\n return count;\n }\n else if (identity.isPair(node)) {\n const kc = getAliasCount(doc, node.key, anchors);\n const vc = getAliasCount(doc, node.value, anchors);\n return Math.max(kc, vc);\n }\n return 1;\n}\n\nexports.Alias = Alias;\n","'use strict';\n\nvar identity = require('./identity.js');\nvar Node = require('./Node.js');\nvar toJS = require('./toJS.js');\n\nconst isScalarValue = (value) => !value || (typeof value !== 'function' && typeof value !== 'object');\nclass Scalar extends Node.NodeBase {\n constructor(value) {\n super(identity.SCALAR);\n this.value = value;\n }\n toJSON(arg, ctx) {\n return ctx?.keep ? this.value : toJS.toJS(this.value, arg, ctx);\n }\n toString() {\n return String(this.value);\n }\n}\nScalar.BLOCK_FOLDED = 'BLOCK_FOLDED';\nScalar.BLOCK_LITERAL = 'BLOCK_LITERAL';\nScalar.PLAIN = 'PLAIN';\nScalar.QUOTE_DOUBLE = 'QUOTE_DOUBLE';\nScalar.QUOTE_SINGLE = 'QUOTE_SINGLE';\n\nexports.Scalar = Scalar;\nexports.isScalarValue = isScalarValue;\n","'use strict';\n\nvar Alias = require('../nodes/Alias.js');\nvar identity = require('../nodes/identity.js');\nvar Scalar = require('../nodes/Scalar.js');\n\nconst defaultTagPrefix = 'tag:yaml.org,2002:';\nfunction findTagObject(value, tagName, tags) {\n if (tagName) {\n const match = tags.filter(t => t.tag === tagName);\n const tagObj = match.find(t => !t.format) ?? match[0];\n if (!tagObj)\n throw new Error(`Tag ${tagName} not found`);\n return tagObj;\n }\n return tags.find(t => t.identify?.(value) && !t.format);\n}\nfunction createNode(value, tagName, ctx) {\n if (identity.isDocument(value))\n value = value.contents;\n if (identity.isNode(value))\n return value;\n if (identity.isPair(value)) {\n const map = ctx.schema[identity.MAP].createNode?.(ctx.schema, null, ctx);\n map.items.push(value);\n return map;\n }\n if (value instanceof String ||\n value instanceof Number ||\n value instanceof Boolean ||\n (typeof BigInt !== 'undefined' && value instanceof BigInt) // not supported everywhere\n ) {\n // https://tc39.es/ecma262/#sec-serializejsonproperty\n value = value.valueOf();\n }\n const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx;\n // Detect duplicate references to the same object & use Alias nodes for all\n // after first. The `ref` wrapper allows for circular references to resolve.\n let ref = undefined;\n if (aliasDuplicateObjects && value && typeof value === 'object') {\n ref = sourceObjects.get(value);\n if (ref) {\n ref.anchor ?? (ref.anchor = onAnchor(value));\n return new Alias.Alias(ref.anchor);\n }\n else {\n ref = { anchor: null, node: null };\n sourceObjects.set(value, ref);\n }\n }\n if (tagName?.startsWith('!!'))\n tagName = defaultTagPrefix + tagName.slice(2);\n let tagObj = findTagObject(value, tagName, schema.tags);\n if (!tagObj) {\n if (value && typeof value.toJSON === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n value = value.toJSON();\n }\n if (!value || typeof value !== 'object') {\n const node = new Scalar.Scalar(value);\n if (ref)\n ref.node = node;\n return node;\n }\n tagObj =\n value instanceof Map\n ? schema[identity.MAP]\n : Symbol.iterator in Object(value)\n ? schema[identity.SEQ]\n : schema[identity.MAP];\n }\n if (onTagObj) {\n onTagObj(tagObj);\n delete ctx.onTagObj;\n }\n const node = tagObj?.createNode\n ? tagObj.createNode(ctx.schema, value, ctx)\n : typeof tagObj?.nodeClass?.from === 'function'\n ? tagObj.nodeClass.from(ctx.schema, value, ctx)\n : new Scalar.Scalar(value);\n if (tagName)\n node.tag = tagName;\n else if (!tagObj.default)\n node.tag = tagObj.tag;\n if (ref)\n ref.node = node;\n return node;\n}\n\nexports.createNode = createNode;\n","'use strict';\n\nvar createNode = require('../doc/createNode.js');\nvar identity = require('./identity.js');\nvar Node = require('./Node.js');\n\nfunction collectionFromPath(schema, path, value) {\n let v = value;\n for (let i = path.length - 1; i >= 0; --i) {\n const k = path[i];\n if (typeof k === 'number' && Number.isInteger(k) && k >= 0) {\n const a = [];\n a[k] = v;\n v = a;\n }\n else {\n v = new Map([[k, v]]);\n }\n }\n return createNode.createNode(v, undefined, {\n aliasDuplicateObjects: false,\n keepUndefined: false,\n onAnchor: () => {\n throw new Error('This should not happen, please report a bug.');\n },\n schema,\n sourceObjects: new Map()\n });\n}\n// Type guard is intentionally a little wrong so as to be more useful,\n// as it does not cover untypable empty non-string iterables (e.g. []).\nconst isEmptyPath = (path) => path == null ||\n (typeof path === 'object' && !!path[Symbol.iterator]().next().done);\nclass Collection extends Node.NodeBase {\n constructor(type, schema) {\n super(type);\n Object.defineProperty(this, 'schema', {\n value: schema,\n configurable: true,\n enumerable: false,\n writable: true\n });\n }\n /**\n * Create a copy of this collection.\n *\n * @param schema - If defined, overwrites the original's schema\n */\n clone(schema) {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (schema)\n copy.schema = schema;\n copy.items = copy.items.map(it => identity.isNode(it) || identity.isPair(it) ? it.clone(schema) : it);\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }\n /**\n * Adds a value to the collection. For `!!map` and `!!omap` the value must\n * be a Pair instance or a `{ key, value }` object, which may not have a key\n * that already exists in the map.\n */\n addIn(path, value) {\n if (isEmptyPath(path))\n this.add(value);\n else {\n const [key, ...rest] = path;\n const node = this.get(key, true);\n if (identity.isCollection(node))\n node.addIn(rest, value);\n else if (node === undefined && this.schema)\n this.set(key, collectionFromPath(this.schema, rest, value));\n else\n throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);\n }\n }\n /**\n * Removes a value from the collection.\n * @returns `true` if the item was found and removed.\n */\n deleteIn(path) {\n const [key, ...rest] = path;\n if (rest.length === 0)\n return this.delete(key);\n const node = this.get(key, true);\n if (identity.isCollection(node))\n return node.deleteIn(rest);\n else\n throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);\n }\n /**\n * Returns item at `key`, or `undefined` if not found. By default unwraps\n * scalar values from their surrounding node; to disable set `keepScalar` to\n * `true` (collections are always returned intact).\n */\n getIn(path, keepScalar) {\n const [key, ...rest] = path;\n const node = this.get(key, true);\n if (rest.length === 0)\n return !keepScalar && identity.isScalar(node) ? node.value : node;\n else\n return identity.isCollection(node) ? node.getIn(rest, keepScalar) : undefined;\n }\n hasAllNullValues(allowScalar) {\n return this.items.every(node => {\n if (!identity.isPair(node))\n return false;\n const n = node.value;\n return (n == null ||\n (allowScalar &&\n identity.isScalar(n) &&\n n.value == null &&\n !n.commentBefore &&\n !n.comment &&\n !n.tag));\n });\n }\n /**\n * Checks if the collection includes a value with the key `key`.\n */\n hasIn(path) {\n const [key, ...rest] = path;\n if (rest.length === 0)\n return this.has(key);\n const node = this.get(key, true);\n return identity.isCollection(node) ? node.hasIn(rest) : false;\n }\n /**\n * Sets a value in this collection. For `!!set`, `value` needs to be a\n * boolean to add/remove the item from the set.\n */\n setIn(path, value) {\n const [key, ...rest] = path;\n if (rest.length === 0) {\n this.set(key, value);\n }\n else {\n const node = this.get(key, true);\n if (identity.isCollection(node))\n node.setIn(rest, value);\n else if (node === undefined && this.schema)\n this.set(key, collectionFromPath(this.schema, rest, value));\n else\n throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);\n }\n }\n}\n\nexports.Collection = Collection;\nexports.collectionFromPath = collectionFromPath;\nexports.isEmptyPath = isEmptyPath;\n","'use strict';\n\n/**\n * Stringifies a comment.\n *\n * Empty comment lines are left empty,\n * lines consisting of a single space are replaced by `#`,\n * and all other lines are prefixed with a `#`.\n */\nconst stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, '#');\nfunction indentComment(comment, indent) {\n if (/^\\n+$/.test(comment))\n return comment.substring(1);\n return indent ? comment.replace(/^(?! *$)/gm, indent) : comment;\n}\nconst lineComment = (str, indent, comment) => str.endsWith('\\n')\n ? indentComment(comment, indent)\n : comment.includes('\\n')\n ? '\\n' + indentComment(comment, indent)\n : (str.endsWith(' ') ? '' : ' ') + comment;\n\nexports.indentComment = indentComment;\nexports.lineComment = lineComment;\nexports.stringifyComment = stringifyComment;\n","'use strict';\n\nconst FOLD_FLOW = 'flow';\nconst FOLD_BLOCK = 'block';\nconst FOLD_QUOTED = 'quoted';\n/**\n * Tries to keep input at up to `lineWidth` characters, splitting only on spaces\n * not followed by newlines or spaces unless `mode` is `'quoted'`. Lines are\n * terminated with `\\n` and started with `indent`.\n */\nfunction foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {\n if (!lineWidth || lineWidth < 0)\n return text;\n if (lineWidth < minContentWidth)\n minContentWidth = 0;\n const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);\n if (text.length <= endStep)\n return text;\n const folds = [];\n const escapedFolds = {};\n let end = lineWidth - indent.length;\n if (typeof indentAtStart === 'number') {\n if (indentAtStart > lineWidth - Math.max(2, minContentWidth))\n folds.push(0);\n else\n end = lineWidth - indentAtStart;\n }\n let split = undefined;\n let prev = undefined;\n let overflow = false;\n let i = -1;\n let escStart = -1;\n let escEnd = -1;\n if (mode === FOLD_BLOCK) {\n i = consumeMoreIndentedLines(text, i, indent.length);\n if (i !== -1)\n end = i + endStep;\n }\n for (let ch; (ch = text[(i += 1)]);) {\n if (mode === FOLD_QUOTED && ch === '\\\\') {\n escStart = i;\n switch (text[i + 1]) {\n case 'x':\n i += 3;\n break;\n case 'u':\n i += 5;\n break;\n case 'U':\n i += 9;\n break;\n default:\n i += 1;\n }\n escEnd = i;\n }\n if (ch === '\\n') {\n if (mode === FOLD_BLOCK)\n i = consumeMoreIndentedLines(text, i, indent.length);\n end = i + indent.length + endStep;\n split = undefined;\n }\n else {\n if (ch === ' ' &&\n prev &&\n prev !== ' ' &&\n prev !== '\\n' &&\n prev !== '\\t') {\n // space surrounded by non-space can be replaced with newline + indent\n const next = text[i + 1];\n if (next && next !== ' ' && next !== '\\n' && next !== '\\t')\n split = i;\n }\n if (i >= end) {\n if (split) {\n folds.push(split);\n end = split + endStep;\n split = undefined;\n }\n else if (mode === FOLD_QUOTED) {\n // white-space collected at end may stretch past lineWidth\n while (prev === ' ' || prev === '\\t') {\n prev = ch;\n ch = text[(i += 1)];\n overflow = true;\n }\n // Account for newline escape, but don't break preceding escape\n const j = i > escEnd + 1 ? i - 2 : escStart - 1;\n // Bail out if lineWidth & minContentWidth are shorter than an escape string\n if (escapedFolds[j])\n return text;\n folds.push(j);\n escapedFolds[j] = true;\n end = j + endStep;\n split = undefined;\n }\n else {\n overflow = true;\n }\n }\n }\n prev = ch;\n }\n if (overflow && onOverflow)\n onOverflow();\n if (folds.length === 0)\n return text;\n if (onFold)\n onFold();\n let res = text.slice(0, folds[0]);\n for (let i = 0; i < folds.length; ++i) {\n const fold = folds[i];\n const end = folds[i + 1] || text.length;\n if (fold === 0)\n res = `\\n${indent}${text.slice(0, end)}`;\n else {\n if (mode === FOLD_QUOTED && escapedFolds[fold])\n res += `${text[fold]}\\\\`;\n res += `\\n${indent}${text.slice(fold + 1, end)}`;\n }\n }\n return res;\n}\n/**\n * Presumes `i + 1` is at the start of a line\n * @returns index of last newline in more-indented block\n */\nfunction consumeMoreIndentedLines(text, i, indent) {\n let end = i;\n let start = i + 1;\n let ch = text[start];\n while (ch === ' ' || ch === '\\t') {\n if (i < start + indent) {\n ch = text[++i];\n }\n else {\n do {\n ch = text[++i];\n } while (ch && ch !== '\\n');\n end = i;\n start = i + 1;\n ch = text[start];\n }\n }\n return end;\n}\n\nexports.FOLD_BLOCK = FOLD_BLOCK;\nexports.FOLD_FLOW = FOLD_FLOW;\nexports.FOLD_QUOTED = FOLD_QUOTED;\nexports.foldFlowLines = foldFlowLines;\n","'use strict';\n\nvar Scalar = require('../nodes/Scalar.js');\nvar foldFlowLines = require('./foldFlowLines.js');\n\nconst getFoldOptions = (ctx, isBlock) => ({\n indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,\n lineWidth: ctx.options.lineWidth,\n minContentWidth: ctx.options.minContentWidth\n});\n// Also checks for lines starting with %, as parsing the output as YAML 1.1 will\n// presume that's starting a new document.\nconst containsDocumentMarker = (str) => /^(%|---|\\.\\.\\.)/m.test(str);\nfunction lineLengthOverLimit(str, lineWidth, indentLength) {\n if (!lineWidth || lineWidth < 0)\n return false;\n const limit = lineWidth - indentLength;\n const strLen = str.length;\n if (strLen <= limit)\n return false;\n for (let i = 0, start = 0; i < strLen; ++i) {\n if (str[i] === '\\n') {\n if (i - start > limit)\n return true;\n start = i + 1;\n if (strLen - start <= limit)\n return false;\n }\n }\n return true;\n}\nfunction doubleQuotedString(value, ctx) {\n const json = JSON.stringify(value);\n if (ctx.options.doubleQuotedAsJSON)\n return json;\n const { implicitKey } = ctx;\n const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;\n const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');\n let str = '';\n let start = 0;\n for (let i = 0, ch = json[i]; ch; ch = json[++i]) {\n if (ch === ' ' && json[i + 1] === '\\\\' && json[i + 2] === 'n') {\n // space before newline needs to be escaped to not be folded\n str += json.slice(start, i) + '\\\\ ';\n i += 1;\n start = i;\n ch = '\\\\';\n }\n if (ch === '\\\\')\n switch (json[i + 1]) {\n case 'u':\n {\n str += json.slice(start, i);\n const code = json.substr(i + 2, 4);\n switch (code) {\n case '0000':\n str += '\\\\0';\n break;\n case '0007':\n str += '\\\\a';\n break;\n case '000b':\n str += '\\\\v';\n break;\n case '001b':\n str += '\\\\e';\n break;\n case '0085':\n str += '\\\\N';\n break;\n case '00a0':\n str += '\\\\_';\n break;\n case '2028':\n str += '\\\\L';\n break;\n case '2029':\n str += '\\\\P';\n break;\n default:\n if (code.substr(0, 2) === '00')\n str += '\\\\x' + code.substr(2);\n else\n str += json.substr(i, 6);\n }\n i += 5;\n start = i + 1;\n }\n break;\n case 'n':\n if (implicitKey ||\n json[i + 2] === '\"' ||\n json.length < minMultiLineLength) {\n i += 1;\n }\n else {\n // folding will eat first newline\n str += json.slice(start, i) + '\\n\\n';\n while (json[i + 2] === '\\\\' &&\n json[i + 3] === 'n' &&\n json[i + 4] !== '\"') {\n str += '\\n';\n i += 2;\n }\n str += indent;\n // space after newline needs to be escaped to not be folded\n if (json[i + 2] === ' ')\n str += '\\\\';\n i += 1;\n start = i + 1;\n }\n break;\n default:\n i += 1;\n }\n }\n str = start ? str + json.slice(start) : json;\n return implicitKey\n ? str\n : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));\n}\nfunction singleQuotedString(value, ctx) {\n if (ctx.options.singleQuote === false ||\n (ctx.implicitKey && value.includes('\\n')) ||\n /[ \\t]\\n|\\n[ \\t]/.test(value) // single quoted string can't have leading or trailing whitespace around newline\n )\n return doubleQuotedString(value, ctx);\n const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');\n const res = \"'\" + value.replace(/'/g, \"''\").replace(/\\n+/g, `$&\\n${indent}`) + \"'\";\n return ctx.implicitKey\n ? res\n : foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));\n}\nfunction quotedString(value, ctx) {\n const { singleQuote } = ctx.options;\n let qs;\n if (singleQuote === false)\n qs = doubleQuotedString;\n else {\n const hasDouble = value.includes('\"');\n const hasSingle = value.includes(\"'\");\n if (hasDouble && !hasSingle)\n qs = singleQuotedString;\n else if (hasSingle && !hasDouble)\n qs = doubleQuotedString;\n else\n qs = singleQuote ? singleQuotedString : doubleQuotedString;\n }\n return qs(value, ctx);\n}\n// The negative lookbehind avoids a polynomial search,\n// but isn't supported yet on Safari: https://caniuse.com/js-regexp-lookbehind\nlet blockEndNewlines;\ntry {\n blockEndNewlines = new RegExp('(^|(?<!\\n))\\n+(?!\\n|$)', 'g');\n}\ncatch {\n blockEndNewlines = /\\n+(?!\\n|$)/g;\n}\nfunction blockString({ comment, type, value }, ctx, onComment, onChompKeep) {\n const { blockQuote, commentString, lineWidth } = ctx.options;\n // 1. Block can't end in whitespace unless the last line is non-empty.\n // 2. Strings consisting of only whitespace are best rendered explicitly.\n if (!blockQuote || /\\n[\\t ]+$/.test(value)) {\n return quotedString(value, ctx);\n }\n const indent = ctx.indent ||\n (ctx.forceBlockIndent || containsDocumentMarker(value) ? ' ' : '');\n const literal = blockQuote === 'literal'\n ? true\n : blockQuote === 'folded' || type === Scalar.Scalar.BLOCK_FOLDED\n ? false\n : type === Scalar.Scalar.BLOCK_LITERAL\n ? true\n : !lineLengthOverLimit(value, lineWidth, indent.length);\n if (!value)\n return literal ? '|\\n' : '>\\n';\n // determine chomping from whitespace at value end\n let chomp;\n let endStart;\n for (endStart = value.length; endStart > 0; --endStart) {\n const ch = value[endStart - 1];\n if (ch !== '\\n' && ch !== '\\t' && ch !== ' ')\n break;\n }\n let end = value.substring(endStart);\n const endNlPos = end.indexOf('\\n');\n if (endNlPos === -1) {\n chomp = '-'; // strip\n }\n else if (value === end || endNlPos !== end.length - 1) {\n chomp = '+'; // keep\n if (onChompKeep)\n onChompKeep();\n }\n else {\n chomp = ''; // clip\n }\n if (end) {\n value = value.slice(0, -end.length);\n if (end[end.length - 1] === '\\n')\n end = end.slice(0, -1);\n end = end.replace(blockEndNewlines, `$&${indent}`);\n }\n // determine indent indicator from whitespace at value start\n let startWithSpace = false;\n let startEnd;\n let startNlPos = -1;\n for (startEnd = 0; startEnd < value.length; ++startEnd) {\n const ch = value[startEnd];\n if (ch === ' ')\n startWithSpace = true;\n else if (ch === '\\n')\n startNlPos = startEnd;\n else\n break;\n }\n let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);\n if (start) {\n value = value.substring(start.length);\n start = start.replace(/\\n+/g, `$&${indent}`);\n }\n const indentSize = indent ? '2' : '1'; // root is at -1\n // Leading | or > is added later\n let header = (startWithSpace ? indentSize : '') + chomp;\n if (comment) {\n header += ' ' + commentString(comment.replace(/ ?[\\r\\n]+/g, ' '));\n if (onComment)\n onComment();\n }\n if (!literal) {\n const foldedValue = value\n .replace(/\\n+/g, '\\n$&')\n .replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g, '$1$2') // more-indented lines aren't folded\n // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent\n .replace(/\\n+/g, `$&${indent}`);\n let literalFallback = false;\n const foldOptions = getFoldOptions(ctx, true);\n if (blockQuote !== 'folded' && type !== Scalar.Scalar.BLOCK_FOLDED) {\n foldOptions.onOverflow = () => {\n literalFallback = true;\n };\n }\n const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);\n if (!literalFallback)\n return `>${header}\\n${indent}${body}`;\n }\n value = value.replace(/\\n+/g, `$&${indent}`);\n return `|${header}\\n${indent}${start}${value}${end}`;\n}\nfunction plainString(item, ctx, onComment, onChompKeep) {\n const { type, value } = item;\n const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;\n if ((implicitKey && value.includes('\\n')) ||\n (inFlow && /[[\\]{},]/.test(value))) {\n return quotedString(value, ctx);\n }\n if (/^[\\n\\t ,[\\]{}#&*!|>'\"%@`]|^[?-]$|^[?-][ \\t]|[\\n:][ \\t]|[ \\t]\\n|[\\n\\t ]#|[\\n\\t :]$/.test(value)) {\n // not allowed:\n // - '-' or '?'\n // - start with an indicator character (except [?:-]) or /[?-] /\n // - '\\n ', ': ' or ' \\n' anywhere\n // - '#' not preceded by a non-space char\n // - end with ' ' or ':'\n return implicitKey || inFlow || !value.includes('\\n')\n ? quotedString(value, ctx)\n : blockString(item, ctx, onComment, onChompKeep);\n }\n if (!implicitKey &&\n !inFlow &&\n type !== Scalar.Scalar.PLAIN &&\n value.includes('\\n')) {\n // Where allowed & type not set explicitly, prefer block style for multiline strings\n return blockString(item, ctx, onComment, onChompKeep);\n }\n if (containsDocumentMarker(value)) {\n if (indent === '') {\n ctx.forceBlockIndent = true;\n return blockString(item, ctx, onComment, onChompKeep);\n }\n else if (implicitKey && indent === indentStep) {\n return quotedString(value, ctx);\n }\n }\n const str = value.replace(/\\n+/g, `$&\\n${indent}`);\n // Verify that output will be parsed as a string, as e.g. plain numbers and\n // booleans get parsed with those types in v1.2 (e.g. '42', 'true' & '0.9e-3'),\n // and others in v1.1.\n if (actualString) {\n const test = (tag) => tag.default && tag.tag !== 'tag:yaml.org,2002:str' && tag.test?.test(str);\n const { compat, tags } = ctx.doc.schema;\n if (tags.some(test) || compat?.some(test))\n return quotedString(value, ctx);\n }\n return implicitKey\n ? str\n : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));\n}\nfunction stringifyString(item, ctx, onComment, onChompKeep) {\n const { implicitKey, inFlow } = ctx;\n const ss = typeof item.value === 'string'\n ? item\n : Object.assign({}, item, { value: String(item.value) });\n let { type } = item;\n if (type !== Scalar.Scalar.QUOTE_DOUBLE) {\n // force double quotes on control characters & unpaired surrogates\n if (/[\\x00-\\x08\\x0b-\\x1f\\x7f-\\x9f\\u{D800}-\\u{DFFF}]/u.test(ss.value))\n type = Scalar.Scalar.QUOTE_DOUBLE;\n }\n const _stringify = (_type) => {\n switch (_type) {\n case Scalar.Scalar.BLOCK_FOLDED:\n case Scalar.Scalar.BLOCK_LITERAL:\n return implicitKey || inFlow\n ? quotedString(ss.value, ctx) // blocks are not valid inside flow containers\n : blockString(ss, ctx, onComment, onChompKeep);\n case Scalar.Scalar.QUOTE_DOUBLE:\n return doubleQuotedString(ss.value, ctx);\n case Scalar.Scalar.QUOTE_SINGLE:\n return singleQuotedString(ss.value, ctx);\n case Scalar.Scalar.PLAIN:\n return plainString(ss, ctx, onComment, onChompKeep);\n default:\n return null;\n }\n };\n let res = _stringify(type);\n if (res === null) {\n const { defaultKeyType, defaultStringType } = ctx.options;\n const t = (implicitKey && defaultKeyType) || defaultStringType;\n res = _stringify(t);\n if (res === null)\n throw new Error(`Unsupported default string type ${t}`);\n }\n return res;\n}\n\nexports.stringifyString = stringifyString;\n","'use strict';\n\nvar anchors = require('../doc/anchors.js');\nvar identity = require('../nodes/identity.js');\nvar stringifyComment = require('./stringifyComment.js');\nvar stringifyString = require('./stringifyString.js');\n\nfunction createStringifyContext(doc, options) {\n const opt = Object.assign({\n blockQuote: true,\n commentString: stringifyComment.stringifyComment,\n defaultKeyType: null,\n defaultStringType: 'PLAIN',\n directives: null,\n doubleQuotedAsJSON: false,\n doubleQuotedMinMultiLineLength: 40,\n falseStr: 'false',\n flowCollectionPadding: true,\n indentSeq: true,\n lineWidth: 80,\n minContentWidth: 20,\n nullStr: 'null',\n simpleKeys: false,\n singleQuote: null,\n trailingComma: false,\n trueStr: 'true',\n verifyAliasOrder: true\n }, doc.schema.toStringOptions, options);\n let inFlow;\n switch (opt.collectionStyle) {\n case 'block':\n inFlow = false;\n break;\n case 'flow':\n inFlow = true;\n break;\n default:\n inFlow = null;\n }\n return {\n anchors: new Set(),\n doc,\n flowCollectionPadding: opt.flowCollectionPadding ? ' ' : '',\n indent: '',\n indentStep: typeof opt.indent === 'number' ? ' '.repeat(opt.indent) : ' ',\n inFlow,\n options: opt\n };\n}\nfunction getTagObject(tags, item) {\n if (item.tag) {\n const match = tags.filter(t => t.tag === item.tag);\n if (match.length > 0)\n return match.find(t => t.format === item.format) ?? match[0];\n }\n let tagObj = undefined;\n let obj;\n if (identity.isScalar(item)) {\n obj = item.value;\n let match = tags.filter(t => t.identify?.(obj));\n if (match.length > 1) {\n const testMatch = match.filter(t => t.test);\n if (testMatch.length > 0)\n match = testMatch;\n }\n tagObj =\n match.find(t => t.format === item.format) ?? match.find(t => !t.format);\n }\n else {\n obj = item;\n tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);\n }\n if (!tagObj) {\n const name = obj?.constructor?.name ?? (obj === null ? 'null' : typeof obj);\n throw new Error(`Tag not resolved for ${name} value`);\n }\n return tagObj;\n}\n// needs to be called before value stringifier to allow for circular anchor refs\nfunction stringifyProps(node, tagObj, { anchors: anchors$1, doc }) {\n if (!doc.directives)\n return '';\n const props = [];\n const anchor = (identity.isScalar(node) || identity.isCollection(node)) && node.anchor;\n if (anchor && anchors.anchorIsValid(anchor)) {\n anchors$1.add(anchor);\n props.push(`&${anchor}`);\n }\n const tag = node.tag ?? (tagObj.default ? null : tagObj.tag);\n if (tag)\n props.push(doc.directives.tagString(tag));\n return props.join(' ');\n}\nfunction stringify(item, ctx, onComment, onChompKeep) {\n if (identity.isPair(item))\n return item.toString(ctx, onComment, onChompKeep);\n if (identity.isAlias(item)) {\n if (ctx.doc.directives)\n return item.toString(ctx);\n if (ctx.resolvedAliases?.has(item)) {\n throw new TypeError(`Cannot stringify circular structure without alias nodes`);\n }\n else {\n if (ctx.resolvedAliases)\n ctx.resolvedAliases.add(item);\n else\n ctx.resolvedAliases = new Set([item]);\n item = item.resolve(ctx.doc);\n }\n }\n let tagObj = undefined;\n const node = identity.isNode(item)\n ? item\n : ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });\n tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));\n const props = stringifyProps(node, tagObj, ctx);\n if (props.length > 0)\n ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;\n const str = typeof tagObj.stringify === 'function'\n ? tagObj.stringify(node, ctx, onComment, onChompKeep)\n : identity.isScalar(node)\n ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep)\n : node.toString(ctx, onComment, onChompKeep);\n if (!props)\n return str;\n return identity.isScalar(node) || str[0] === '{' || str[0] === '['\n ? `${props} ${str}`\n : `${props}\\n${ctx.indent}${str}`;\n}\n\nexports.createStringifyContext = createStringifyContext;\nexports.stringify = stringify;\n","'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar Scalar = require('../nodes/Scalar.js');\nvar stringify = require('./stringify.js');\nvar stringifyComment = require('./stringifyComment.js');\n\nfunction stringifyPair({ key, value }, ctx, onComment, onChompKeep) {\n const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;\n let keyComment = (identity.isNode(key) && key.comment) || null;\n if (simpleKeys) {\n if (keyComment) {\n throw new Error('With simple keys, key nodes cannot have comments');\n }\n if (identity.isCollection(key) || (!identity.isNode(key) && typeof key === 'object')) {\n const msg = 'With simple keys, collection cannot be used as a key value';\n throw new Error(msg);\n }\n }\n let explicitKey = !simpleKeys &&\n (!key ||\n (keyComment && value == null && !ctx.inFlow) ||\n identity.isCollection(key) ||\n (identity.isScalar(key)\n ? key.type === Scalar.Scalar.BLOCK_FOLDED || key.type === Scalar.Scalar.BLOCK_LITERAL\n : typeof key === 'object'));\n ctx = Object.assign({}, ctx, {\n allNullValues: false,\n implicitKey: !explicitKey && (simpleKeys || !allNullValues),\n indent: indent + indentStep\n });\n let keyCommentDone = false;\n let chompKeep = false;\n let str = stringify.stringify(key, ctx, () => (keyCommentDone = true), () => (chompKeep = true));\n if (!explicitKey && !ctx.inFlow && str.length > 1024) {\n if (simpleKeys)\n throw new Error('With simple keys, single line scalar must not span more than 1024 characters');\n explicitKey = true;\n }\n if (ctx.inFlow) {\n if (allNullValues || value == null) {\n if (keyCommentDone && onComment)\n onComment();\n return str === '' ? '?' : explicitKey ? `? ${str}` : str;\n }\n }\n else if ((allNullValues && !simpleKeys) || (value == null && explicitKey)) {\n str = `? ${str}`;\n if (keyComment && !keyCommentDone) {\n str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));\n }\n else if (chompKeep && onChompKeep)\n onChompKeep();\n return str;\n }\n if (keyCommentDone)\n keyComment = null;\n if (explicitKey) {\n if (keyComment)\n str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));\n str = `? ${str}\\n${indent}:`;\n }\n else {\n str = `${str}:`;\n if (keyComment)\n str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));\n }\n let vsb, vcb, valueComment;\n if (identity.isNode(value)) {\n vsb = !!value.spaceBefore;\n vcb = value.commentBefore;\n valueComment = value.comment;\n }\n else {\n vsb = false;\n vcb = null;\n valueComment = null;\n if (value && typeof value === 'object')\n value = doc.createNode(value);\n }\n ctx.implicitKey = false;\n if (!explicitKey && !keyComment && identity.isScalar(value))\n ctx.indentAtStart = str.length + 1;\n chompKeep = false;\n if (!indentSeq &&\n indentStep.length >= 2 &&\n !ctx.inFlow &&\n !explicitKey &&\n identity.isSeq(value) &&\n !value.flow &&\n !value.tag &&\n !value.anchor) {\n // If indentSeq === false, consider '- ' as part of indentation where possible\n ctx.indent = ctx.indent.substring(2);\n }\n let valueCommentDone = false;\n const valueStr = stringify.stringify(value, ctx, () => (valueCommentDone = true), () => (chompKeep = true));\n let ws = ' ';\n if (keyComment || vsb || vcb) {\n ws = vsb ? '\\n' : '';\n if (vcb) {\n const cs = commentString(vcb);\n ws += `\\n${stringifyComment.indentComment(cs, ctx.indent)}`;\n }\n if (valueStr === '' && !ctx.inFlow) {\n if (ws === '\\n' && valueComment)\n ws = '\\n\\n';\n }\n else {\n ws += `\\n${ctx.indent}`;\n }\n }\n else if (!explicitKey && identity.isCollection(value)) {\n const vs0 = valueStr[0];\n const nl0 = valueStr.indexOf('\\n');\n const hasNewline = nl0 !== -1;\n const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0;\n if (hasNewline || !flow) {\n let hasPropsLine = false;\n if (hasNewline && (vs0 === '&' || vs0 === '!')) {\n let sp0 = valueStr.indexOf(' ');\n if (vs0 === '&' &&\n sp0 !== -1 &&\n sp0 < nl0 &&\n valueStr[sp0 + 1] === '!') {\n sp0 = valueStr.indexOf(' ', sp0 + 1);\n }\n if (sp0 === -1 || nl0 < sp0)\n hasPropsLine = true;\n }\n if (!hasPropsLine)\n ws = `\\n${ctx.indent}`;\n }\n }\n else if (valueStr === '' || valueStr[0] === '\\n') {\n ws = '';\n }\n str += ws + valueStr;\n if (ctx.inFlow) {\n if (valueCommentDone && onComment)\n onComment();\n }\n else if (valueComment && !valueCommentDone) {\n str += stringifyComment.lineComment(str, ctx.indent, commentString(valueComment));\n }\n else if (chompKeep && onChompKeep) {\n onChompKeep();\n }\n return str;\n}\n\nexports.stringifyPair = stringifyPair;\n","'use strict';\n\nvar node_process = require('process');\n\nfunction debug(logLevel, ...messages) {\n if (logLevel === 'debug')\n console.log(...messages);\n}\nfunction warn(logLevel, warning) {\n if (logLevel === 'debug' || logLevel === 'warn') {\n if (typeof node_process.emitWarning === 'function')\n node_process.emitWarning(warning);\n else\n console.warn(warning);\n }\n}\n\nexports.debug = debug;\nexports.warn = warn;\n","'use strict';\n\nvar identity = require('../../nodes/identity.js');\nvar Scalar = require('../../nodes/Scalar.js');\n\n// If the value associated with a merge key is a single mapping node, each of\n// its key/value pairs is inserted into the current mapping, unless the key\n// already exists in it. If the value associated with the merge key is a\n// sequence, then this sequence is expected to contain mapping nodes and each\n// of these nodes is merged in turn according to its order in the sequence.\n// Keys in mapping nodes earlier in the sequence override keys specified in\n// later mapping nodes. -- http://yaml.org/type/merge.html\nconst MERGE_KEY = '<<';\nconst merge = {\n identify: value => value === MERGE_KEY ||\n (typeof value === 'symbol' && value.description === MERGE_KEY),\n default: 'key',\n tag: 'tag:yaml.org,2002:merge',\n test: /^<<$/,\n resolve: () => Object.assign(new Scalar.Scalar(Symbol(MERGE_KEY)), {\n addToJSMap: addMergeToJSMap\n }),\n stringify: () => MERGE_KEY\n};\nconst isMergeKey = (ctx, key) => (merge.identify(key) ||\n (identity.isScalar(key) &&\n (!key.type || key.type === Scalar.Scalar.PLAIN) &&\n merge.identify(key.value))) &&\n ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);\nfunction addMergeToJSMap(ctx, map, value) {\n const source = resolveAliasValue(ctx, value);\n if (identity.isSeq(source))\n for (const it of source.items)\n mergeValue(ctx, map, it);\n else if (Array.isArray(source))\n for (const it of source)\n mergeValue(ctx, map, it);\n else\n mergeValue(ctx, map, source);\n}\nfunction mergeValue(ctx, map, value) {\n const source = resolveAliasValue(ctx, value);\n if (!identity.isMap(source))\n throw new Error('Merge sources must be maps or map aliases');\n const srcMap = source.toJSON(null, ctx, Map);\n for (const [key, value] of srcMap) {\n if (map instanceof Map) {\n if (!map.has(key))\n map.set(key, value);\n }\n else if (map instanceof Set) {\n map.add(key);\n }\n else if (!Object.prototype.hasOwnProperty.call(map, key)) {\n Object.defineProperty(map, key, {\n value,\n writable: true,\n enumerable: true,\n configurable: true\n });\n }\n }\n return map;\n}\nfunction resolveAliasValue(ctx, value) {\n return ctx && identity.isAlias(value) ? value.resolve(ctx.doc, ctx) : value;\n}\n\nexports.addMergeToJSMap = addMergeToJSMap;\nexports.isMergeKey = isMergeKey;\nexports.merge = merge;\n","'use strict';\n\nvar log = require('../log.js');\nvar merge = require('../schema/yaml-1.1/merge.js');\nvar stringify = require('../stringify/stringify.js');\nvar identity = require('./identity.js');\nvar toJS = require('./toJS.js');\n\nfunction addPairToJSMap(ctx, map, { key, value }) {\n if (identity.isNode(key) && key.addToJSMap)\n key.addToJSMap(ctx, map, value);\n // TODO: Should drop this special case for bare << handling\n else if (merge.isMergeKey(ctx, key))\n merge.addMergeToJSMap(ctx, map, value);\n else {\n const jsKey = toJS.toJS(key, '', ctx);\n if (map instanceof Map) {\n map.set(jsKey, toJS.toJS(value, jsKey, ctx));\n }\n else if (map instanceof Set) {\n map.add(jsKey);\n }\n else {\n const stringKey = stringifyKey(key, jsKey, ctx);\n const jsValue = toJS.toJS(value, stringKey, ctx);\n if (stringKey in map)\n Object.defineProperty(map, stringKey, {\n value: jsValue,\n writable: true,\n enumerable: true,\n configurable: true\n });\n else\n map[stringKey] = jsValue;\n }\n }\n return map;\n}\nfunction stringifyKey(key, jsKey, ctx) {\n if (jsKey === null)\n return '';\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n if (typeof jsKey !== 'object')\n return String(jsKey);\n if (identity.isNode(key) && ctx?.doc) {\n const strCtx = stringify.createStringifyContext(ctx.doc, {});\n strCtx.anchors = new Set();\n for (const node of ctx.anchors.keys())\n strCtx.anchors.add(node.anchor);\n strCtx.inFlow = true;\n strCtx.inStringifyKey = true;\n const strKey = key.toString(strCtx);\n if (!ctx.mapKeyWarned) {\n let jsonStr = JSON.stringify(strKey);\n if (jsonStr.length > 40)\n jsonStr = jsonStr.substring(0, 36) + '...\"';\n log.warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`);\n ctx.mapKeyWarned = true;\n }\n return strKey;\n }\n return JSON.stringify(jsKey);\n}\n\nexports.addPairToJSMap = addPairToJSMap;\n","'use strict';\n\nvar createNode = require('../doc/createNode.js');\nvar stringifyPair = require('../stringify/stringifyPair.js');\nvar addPairToJSMap = require('./addPairToJSMap.js');\nvar identity = require('./identity.js');\n\nfunction createPair(key, value, ctx) {\n const k = createNode.createNode(key, undefined, ctx);\n const v = createNode.createNode(value, undefined, ctx);\n return new Pair(k, v);\n}\nclass Pair {\n constructor(key, value = null) {\n Object.defineProperty(this, identity.NODE_TYPE, { value: identity.PAIR });\n this.key = key;\n this.value = value;\n }\n clone(schema) {\n let { key, value } = this;\n if (identity.isNode(key))\n key = key.clone(schema);\n if (identity.isNode(value))\n value = value.clone(schema);\n return new Pair(key, value);\n }\n toJSON(_, ctx) {\n const pair = ctx?.mapAsMap ? new Map() : {};\n return addPairToJSMap.addPairToJSMap(ctx, pair, this);\n }\n toString(ctx, onComment, onChompKeep) {\n return ctx?.doc\n ? stringifyPair.stringifyPair(this, ctx, onComment, onChompKeep)\n : JSON.stringify(this);\n }\n}\n\nexports.Pair = Pair;\nexports.createPair = createPair;\n","'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar stringify = require('./stringify.js');\nvar stringifyComment = require('./stringifyComment.js');\n\nfunction stringifyCollection(collection, ctx, options) {\n const flow = ctx.inFlow ?? collection.flow;\n const stringify = flow ? stringifyFlowCollection : stringifyBlockCollection;\n return stringify(collection, ctx, options);\n}\nfunction stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {\n const { indent, options: { commentString } } = ctx;\n const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null });\n let chompKeep = false; // flag for the preceding node's status\n const lines = [];\n for (let i = 0; i < items.length; ++i) {\n const item = items[i];\n let comment = null;\n if (identity.isNode(item)) {\n if (!chompKeep && item.spaceBefore)\n lines.push('');\n addCommentBefore(ctx, lines, item.commentBefore, chompKeep);\n if (item.comment)\n comment = item.comment;\n }\n else if (identity.isPair(item)) {\n const ik = identity.isNode(item.key) ? item.key : null;\n if (ik) {\n if (!chompKeep && ik.spaceBefore)\n lines.push('');\n addCommentBefore(ctx, lines, ik.commentBefore, chompKeep);\n }\n }\n chompKeep = false;\n let str = stringify.stringify(item, itemCtx, () => (comment = null), () => (chompKeep = true));\n if (comment)\n str += stringifyComment.lineComment(str, itemIndent, commentString(comment));\n if (chompKeep && comment)\n chompKeep = false;\n lines.push(blockItemPrefix + str);\n }\n let str;\n if (lines.length === 0) {\n str = flowChars.start + flowChars.end;\n }\n else {\n str = lines[0];\n for (let i = 1; i < lines.length; ++i) {\n const line = lines[i];\n str += line ? `\\n${indent}${line}` : '\\n';\n }\n }\n if (comment) {\n str += '\\n' + stringifyComment.indentComment(commentString(comment), indent);\n if (onComment)\n onComment();\n }\n else if (chompKeep && onChompKeep)\n onChompKeep();\n return str;\n}\nfunction stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {\n const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;\n itemIndent += indentStep;\n const itemCtx = Object.assign({}, ctx, {\n indent: itemIndent,\n inFlow: true,\n type: null\n });\n let reqNewline = false;\n let linesAtValue = 0;\n const lines = [];\n for (let i = 0; i < items.length; ++i) {\n const item = items[i];\n let comment = null;\n if (identity.isNode(item)) {\n if (item.spaceBefore)\n lines.push('');\n addCommentBefore(ctx, lines, item.commentBefore, false);\n if (item.comment)\n comment = item.comment;\n }\n else if (identity.isPair(item)) {\n const ik = identity.isNode(item.key) ? item.key : null;\n if (ik) {\n if (ik.spaceBefore)\n lines.push('');\n addCommentBefore(ctx, lines, ik.commentBefore, false);\n if (ik.comment)\n reqNewline = true;\n }\n const iv = identity.isNode(item.value) ? item.value : null;\n if (iv) {\n if (iv.comment)\n comment = iv.comment;\n if (iv.commentBefore)\n reqNewline = true;\n }\n else if (item.value == null && ik?.comment) {\n comment = ik.comment;\n }\n }\n if (comment)\n reqNewline = true;\n let str = stringify.stringify(item, itemCtx, () => (comment = null));\n reqNewline || (reqNewline = lines.length > linesAtValue || str.includes('\\n'));\n if (i < items.length - 1) {\n str += ',';\n }\n else if (ctx.options.trailingComma) {\n if (ctx.options.lineWidth > 0) {\n reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) +\n (str.length + 2) >\n ctx.options.lineWidth);\n }\n if (reqNewline) {\n str += ',';\n }\n }\n if (comment)\n str += stringifyComment.lineComment(str, itemIndent, commentString(comment));\n lines.push(str);\n linesAtValue = lines.length;\n }\n const { start, end } = flowChars;\n if (lines.length === 0) {\n return start + end;\n }\n else {\n if (!reqNewline) {\n const len = lines.reduce((sum, line) => sum + line.length + 2, 2);\n reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;\n }\n if (reqNewline) {\n let str = start;\n for (const line of lines)\n str += line ? `\\n${indentStep}${indent}${line}` : '\\n';\n return `${str}\\n${indent}${end}`;\n }\n else {\n return `${start}${fcPadding}${lines.join(' ')}${fcPadding}${end}`;\n }\n }\n}\nfunction addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) {\n if (comment && chompKeep)\n comment = comment.replace(/^\\n+/, '');\n if (comment) {\n const ic = stringifyComment.indentComment(commentString(comment), indent);\n lines.push(ic.trimStart()); // Avoid double indent on first line\n }\n}\n\nexports.stringifyCollection = stringifyCollection;\n","'use strict';\n\nvar stringifyCollection = require('../stringify/stringifyCollection.js');\nvar addPairToJSMap = require('./addPairToJSMap.js');\nvar Collection = require('./Collection.js');\nvar identity = require('./identity.js');\nvar Pair = require('./Pair.js');\nvar Scalar = require('./Scalar.js');\n\nfunction findPair(items, key) {\n const k = identity.isScalar(key) ? key.value : key;\n for (const it of items) {\n if (identity.isPair(it)) {\n if (it.key === key || it.key === k)\n return it;\n if (identity.isScalar(it.key) && it.key.value === k)\n return it;\n }\n }\n return undefined;\n}\nclass YAMLMap extends Collection.Collection {\n static get tagName() {\n return 'tag:yaml.org,2002:map';\n }\n constructor(schema) {\n super(identity.MAP, schema);\n this.items = [];\n }\n /**\n * A generic collection parsing method that can be extended\n * to other node classes that inherit from YAMLMap\n */\n static from(schema, obj, ctx) {\n const { keepUndefined, replacer } = ctx;\n const map = new this(schema);\n const add = (key, value) => {\n if (typeof replacer === 'function')\n value = replacer.call(obj, key, value);\n else if (Array.isArray(replacer) && !replacer.includes(key))\n return;\n if (value !== undefined || keepUndefined)\n map.items.push(Pair.createPair(key, value, ctx));\n };\n if (obj instanceof Map) {\n for (const [key, value] of obj)\n add(key, value);\n }\n else if (obj && typeof obj === 'object') {\n for (const key of Object.keys(obj))\n add(key, obj[key]);\n }\n if (typeof schema.sortMapEntries === 'function') {\n map.items.sort(schema.sortMapEntries);\n }\n return map;\n }\n /**\n * Adds a value to the collection.\n *\n * @param overwrite - If not set `true`, using a key that is already in the\n * collection will throw. Otherwise, overwrites the previous value.\n */\n add(pair, overwrite) {\n let _pair;\n if (identity.isPair(pair))\n _pair = pair;\n else if (!pair || typeof pair !== 'object' || !('key' in pair)) {\n // In TypeScript, this never happens.\n _pair = new Pair.Pair(pair, pair?.value);\n }\n else\n _pair = new Pair.Pair(pair.key, pair.value);\n const prev = findPair(this.items, _pair.key);\n const sortEntries = this.schema?.sortMapEntries;\n if (prev) {\n if (!overwrite)\n throw new Error(`Key ${_pair.key} already set`);\n // For scalars, keep the old node & its comments and anchors\n if (identity.isScalar(prev.value) && Scalar.isScalarValue(_pair.value))\n prev.value.value = _pair.value;\n else\n prev.value = _pair.value;\n }\n else if (sortEntries) {\n const i = this.items.findIndex(item => sortEntries(_pair, item) < 0);\n if (i === -1)\n this.items.push(_pair);\n else\n this.items.splice(i, 0, _pair);\n }\n else {\n this.items.push(_pair);\n }\n }\n delete(key) {\n const it = findPair(this.items, key);\n if (!it)\n return false;\n const del = this.items.splice(this.items.indexOf(it), 1);\n return del.length > 0;\n }\n get(key, keepScalar) {\n const it = findPair(this.items, key);\n const node = it?.value;\n return (!keepScalar && identity.isScalar(node) ? node.value : node) ?? undefined;\n }\n has(key) {\n return !!findPair(this.items, key);\n }\n set(key, value) {\n this.add(new Pair.Pair(key, value), true);\n }\n /**\n * @param ctx - Conversion context, originally set in Document#toJS()\n * @param {Class} Type - If set, forces the returned collection type\n * @returns Instance of Type, Map, or Object\n */\n toJSON(_, ctx, Type) {\n const map = Type ? new Type() : ctx?.mapAsMap ? new Map() : {};\n if (ctx?.onCreate)\n ctx.onCreate(map);\n for (const item of this.items)\n addPairToJSMap.addPairToJSMap(ctx, map, item);\n return map;\n }\n toString(ctx, onComment, onChompKeep) {\n if (!ctx)\n return JSON.stringify(this);\n for (const item of this.items) {\n if (!identity.isPair(item))\n throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`);\n }\n if (!ctx.allNullValues && this.hasAllNullValues(false))\n ctx = Object.assign({}, ctx, { allNullValues: true });\n return stringifyCollection.stringifyCollection(this, ctx, {\n blockItemPrefix: '',\n flowChars: { start: '{', end: '}' },\n itemIndent: ctx.indent || '',\n onChompKeep,\n onComment\n });\n }\n}\n\nexports.YAMLMap = YAMLMap;\nexports.findPair = findPair;\n","'use strict';\n\nvar identity = require('../../nodes/identity.js');\nvar YAMLMap = require('../../nodes/YAMLMap.js');\n\nconst map = {\n collection: 'map',\n default: true,\n nodeClass: YAMLMap.YAMLMap,\n tag: 'tag:yaml.org,2002:map',\n resolve(map, onError) {\n if (!identity.isMap(map))\n onError('Expected a mapping for this tag');\n return map;\n },\n createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx)\n};\n\nexports.map = map;\n","'use strict';\n\nvar createNode = require('../doc/createNode.js');\nvar stringifyCollection = require('../stringify/stringifyCollection.js');\nvar Collection = require('./Collection.js');\nvar identity = require('./identity.js');\nvar Scalar = require('./Scalar.js');\nvar toJS = require('./toJS.js');\n\nclass YAMLSeq extends Collection.Collection {\n static get tagName() {\n return 'tag:yaml.org,2002:seq';\n }\n constructor(schema) {\n super(identity.SEQ, schema);\n this.items = [];\n }\n add(value) {\n this.items.push(value);\n }\n /**\n * Removes a value from the collection.\n *\n * `key` must contain a representation of an integer for this to succeed.\n * It may be wrapped in a `Scalar`.\n *\n * @returns `true` if the item was found and removed.\n */\n delete(key) {\n const idx = asItemIndex(key);\n if (typeof idx !== 'number')\n return false;\n const del = this.items.splice(idx, 1);\n return del.length > 0;\n }\n get(key, keepScalar) {\n const idx = asItemIndex(key);\n if (typeof idx !== 'number')\n return undefined;\n const it = this.items[idx];\n return !keepScalar && identity.isScalar(it) ? it.value : it;\n }\n /**\n * Checks if the collection includes a value with the key `key`.\n *\n * `key` must contain a representation of an integer for this to succeed.\n * It may be wrapped in a `Scalar`.\n */\n has(key) {\n const idx = asItemIndex(key);\n return typeof idx === 'number' && idx < this.items.length;\n }\n /**\n * Sets a value in this collection. For `!!set`, `value` needs to be a\n * boolean to add/remove the item from the set.\n *\n * If `key` does not contain a representation of an integer, this will throw.\n * It may be wrapped in a `Scalar`.\n */\n set(key, value) {\n const idx = asItemIndex(key);\n if (typeof idx !== 'number')\n throw new Error(`Expected a valid index, not ${key}.`);\n const prev = this.items[idx];\n if (identity.isScalar(prev) && Scalar.isScalarValue(value))\n prev.value = value;\n else\n this.items[idx] = value;\n }\n toJSON(_, ctx) {\n const seq = [];\n if (ctx?.onCreate)\n ctx.onCreate(seq);\n let i = 0;\n for (const item of this.items)\n seq.push(toJS.toJS(item, String(i++), ctx));\n return seq;\n }\n toString(ctx, onComment, onChompKeep) {\n if (!ctx)\n return JSON.stringify(this);\n return stringifyCollection.stringifyCollection(this, ctx, {\n blockItemPrefix: '- ',\n flowChars: { start: '[', end: ']' },\n itemIndent: (ctx.indent || '') + ' ',\n onChompKeep,\n onComment\n });\n }\n static from(schema, obj, ctx) {\n const { replacer } = ctx;\n const seq = new this(schema);\n if (obj && Symbol.iterator in Object(obj)) {\n let i = 0;\n for (let it of obj) {\n if (typeof replacer === 'function') {\n const key = obj instanceof Set ? it : String(i++);\n it = replacer.call(obj, key, it);\n }\n seq.items.push(createNode.createNode(it, undefined, ctx));\n }\n }\n return seq;\n }\n}\nfunction asItemIndex(key) {\n let idx = identity.isScalar(key) ? key.value : key;\n if (idx && typeof idx === 'string')\n idx = Number(idx);\n return typeof idx === 'number' && Number.isInteger(idx) && idx >= 0\n ? idx\n : null;\n}\n\nexports.YAMLSeq = YAMLSeq;\n","'use strict';\n\nvar identity = require('../../nodes/identity.js');\nvar YAMLSeq = require('../../nodes/YAMLSeq.js');\n\nconst seq = {\n collection: 'seq',\n default: true,\n nodeClass: YAMLSeq.YAMLSeq,\n tag: 'tag:yaml.org,2002:seq',\n resolve(seq, onError) {\n if (!identity.isSeq(seq))\n onError('Expected a sequence for this tag');\n return seq;\n },\n createNode: (schema, obj, ctx) => YAMLSeq.YAMLSeq.from(schema, obj, ctx)\n};\n\nexports.seq = seq;\n","'use strict';\n\nvar stringifyString = require('../../stringify/stringifyString.js');\n\nconst string = {\n identify: value => typeof value === 'string',\n default: true,\n tag: 'tag:yaml.org,2002:str',\n resolve: str => str,\n stringify(item, ctx, onComment, onChompKeep) {\n ctx = Object.assign({ actualString: true }, ctx);\n return stringifyString.stringifyString(item, ctx, onComment, onChompKeep);\n }\n};\n\nexports.string = string;\n","'use strict';\n\nvar Scalar = require('../../nodes/Scalar.js');\n\nconst nullTag = {\n identify: value => value == null,\n createNode: () => new Scalar.Scalar(null),\n default: true,\n tag: 'tag:yaml.org,2002:null',\n test: /^(?:~|[Nn]ull|NULL)?$/,\n resolve: () => new Scalar.Scalar(null),\n stringify: ({ source }, ctx) => typeof source === 'string' && nullTag.test.test(source)\n ? source\n : ctx.options.nullStr\n};\n\nexports.nullTag = nullTag;\n","'use strict';\n\nvar Scalar = require('../../nodes/Scalar.js');\n\nconst boolTag = {\n identify: value => typeof value === 'boolean',\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,\n resolve: str => new Scalar.Scalar(str[0] === 't' || str[0] === 'T'),\n stringify({ source, value }, ctx) {\n if (source && boolTag.test.test(source)) {\n const sv = source[0] === 't' || source[0] === 'T';\n if (value === sv)\n return source;\n }\n return value ? ctx.options.trueStr : ctx.options.falseStr;\n }\n};\n\nexports.boolTag = boolTag;\n","'use strict';\n\nfunction stringifyNumber({ format, minFractionDigits, tag, value }) {\n if (typeof value === 'bigint')\n return String(value);\n const num = typeof value === 'number' ? value : Number(value);\n if (!isFinite(num))\n return isNaN(num) ? '.nan' : num < 0 ? '-.inf' : '.inf';\n let n = Object.is(value, -0) ? '-0' : JSON.stringify(value);\n if (!format &&\n minFractionDigits &&\n (!tag || tag === 'tag:yaml.org,2002:float') &&\n /^-?\\d/.test(n) &&\n !n.includes('e')) {\n let i = n.indexOf('.');\n if (i < 0) {\n i = n.length;\n n += '.';\n }\n let d = minFractionDigits - (n.length - i - 1);\n while (d-- > 0)\n n += '0';\n }\n return n;\n}\n\nexports.stringifyNumber = stringifyNumber;\n","'use strict';\n\nvar Scalar = require('../../nodes/Scalar.js');\nvar stringifyNumber = require('../../stringify/stringifyNumber.js');\n\nconst floatNaN = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^(?:[-+]?\\.(?:inf|Inf|INF)|\\.nan|\\.NaN|\\.NAN)$/,\n resolve: str => str.slice(-3).toLowerCase() === 'nan'\n ? NaN\n : str[0] === '-'\n ? Number.NEGATIVE_INFINITY\n : Number.POSITIVE_INFINITY,\n stringify: stringifyNumber.stringifyNumber\n};\nconst floatExp = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n format: 'EXP',\n test: /^[-+]?(?:\\.[0-9]+|[0-9]+(?:\\.[0-9]*)?)[eE][-+]?[0-9]+$/,\n resolve: str => parseFloat(str),\n stringify(node) {\n const num = Number(node.value);\n return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);\n }\n};\nconst float = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^[-+]?(?:\\.[0-9]+|[0-9]+\\.[0-9]*)$/,\n resolve(str) {\n const node = new Scalar.Scalar(parseFloat(str));\n const dot = str.indexOf('.');\n if (dot !== -1 && str[str.length - 1] === '0')\n node.minFractionDigits = str.length - dot - 1;\n return node;\n },\n stringify: stringifyNumber.stringifyNumber\n};\n\nexports.float = float;\nexports.floatExp = floatExp;\nexports.floatNaN = floatNaN;\n","'use strict';\n\nvar stringifyNumber = require('../../stringify/stringifyNumber.js');\n\nconst intIdentify = (value) => typeof value === 'bigint' || Number.isInteger(value);\nconst intResolve = (str, offset, radix, { intAsBigInt }) => (intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix));\nfunction intStringify(node, radix, prefix) {\n const { value } = node;\n if (intIdentify(value) && value >= 0)\n return prefix + value.toString(radix);\n return stringifyNumber.stringifyNumber(node);\n}\nconst intOct = {\n identify: value => intIdentify(value) && value >= 0,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'OCT',\n test: /^0o[0-7]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 2, 8, opt),\n stringify: node => intStringify(node, 8, '0o')\n};\nconst int = {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n test: /^[-+]?[0-9]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),\n stringify: stringifyNumber.stringifyNumber\n};\nconst intHex = {\n identify: value => intIdentify(value) && value >= 0,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'HEX',\n test: /^0x[0-9a-fA-F]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),\n stringify: node => intStringify(node, 16, '0x')\n};\n\nexports.int = int;\nexports.intHex = intHex;\nexports.intOct = intOct;\n","'use strict';\n\nvar map = require('../common/map.js');\nvar _null = require('../common/null.js');\nvar seq = require('../common/seq.js');\nvar string = require('../common/string.js');\nvar bool = require('./bool.js');\nvar float = require('./float.js');\nvar int = require('./int.js');\n\nconst schema = [\n map.map,\n seq.seq,\n string.string,\n _null.nullTag,\n bool.boolTag,\n int.intOct,\n int.int,\n int.intHex,\n float.floatNaN,\n float.floatExp,\n float.float\n];\n\nexports.schema = schema;\n","'use strict';\n\nvar Scalar = require('../../nodes/Scalar.js');\nvar map = require('../common/map.js');\nvar seq = require('../common/seq.js');\n\nfunction intIdentify(value) {\n return typeof value === 'bigint' || Number.isInteger(value);\n}\nconst stringifyJSON = ({ value }) => JSON.stringify(value);\nconst jsonScalars = [\n {\n identify: value => typeof value === 'string',\n default: true,\n tag: 'tag:yaml.org,2002:str',\n resolve: str => str,\n stringify: stringifyJSON\n },\n {\n identify: value => value == null,\n createNode: () => new Scalar.Scalar(null),\n default: true,\n tag: 'tag:yaml.org,2002:null',\n test: /^null$/,\n resolve: () => null,\n stringify: stringifyJSON\n },\n {\n identify: value => typeof value === 'boolean',\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^true$|^false$/,\n resolve: str => str === 'true',\n stringify: stringifyJSON\n },\n {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n test: /^-?(?:0|[1-9][0-9]*)$/,\n resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10),\n stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value)\n },\n {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,\n resolve: str => parseFloat(str),\n stringify: stringifyJSON\n }\n];\nconst jsonError = {\n default: true,\n tag: '',\n test: /^/,\n resolve(str, onError) {\n onError(`Unresolved plain scalar ${JSON.stringify(str)}`);\n return str;\n }\n};\nconst schema = [map.map, seq.seq].concat(jsonScalars, jsonError);\n\nexports.schema = schema;\n","'use strict';\n\nvar node_buffer = require('buffer');\nvar Scalar = require('../../nodes/Scalar.js');\nvar stringifyString = require('../../stringify/stringifyString.js');\n\nconst binary = {\n identify: value => value instanceof Uint8Array, // Buffer inherits from Uint8Array\n default: false,\n tag: 'tag:yaml.org,2002:binary',\n /**\n * Returns a Buffer in node and an Uint8Array in browsers\n *\n * To use the resulting buffer as an image, you'll want to do something like:\n *\n * const blob = new Blob([buffer], { type: 'image/jpeg' })\n * document.querySelector('#photo').src = URL.createObjectURL(blob)\n */\n resolve(src, onError) {\n if (typeof node_buffer.Buffer === 'function') {\n return node_buffer.Buffer.from(src, 'base64');\n }\n else if (typeof atob === 'function') {\n // On IE 11, atob() can't handle newlines\n const str = atob(src.replace(/[\\n\\r]/g, ''));\n const buffer = new Uint8Array(str.length);\n for (let i = 0; i < str.length; ++i)\n buffer[i] = str.charCodeAt(i);\n return buffer;\n }\n else {\n onError('This environment does not support reading binary tags; either Buffer or atob is required');\n return src;\n }\n },\n stringify({ comment, type, value }, ctx, onComment, onChompKeep) {\n if (!value)\n return '';\n const buf = value; // checked earlier by binary.identify()\n let str;\n if (typeof node_buffer.Buffer === 'function') {\n str =\n buf instanceof node_buffer.Buffer\n ? buf.toString('base64')\n : node_buffer.Buffer.from(buf.buffer).toString('base64');\n }\n else if (typeof btoa === 'function') {\n let s = '';\n for (let i = 0; i < buf.length; ++i)\n s += String.fromCharCode(buf[i]);\n str = btoa(s);\n }\n else {\n throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');\n }\n type ?? (type = Scalar.Scalar.BLOCK_LITERAL);\n if (type !== Scalar.Scalar.QUOTE_DOUBLE) {\n const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);\n const n = Math.ceil(str.length / lineWidth);\n const lines = new Array(n);\n for (let i = 0, o = 0; i < n; ++i, o += lineWidth) {\n lines[i] = str.substr(o, lineWidth);\n }\n str = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? '\\n' : ' ');\n }\n return stringifyString.stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);\n }\n};\n\nexports.binary = binary;\n","'use strict';\n\nvar identity = require('../../nodes/identity.js');\nvar Pair = require('../../nodes/Pair.js');\nvar Scalar = require('../../nodes/Scalar.js');\nvar YAMLSeq = require('../../nodes/YAMLSeq.js');\n\nfunction resolvePairs(seq, onError) {\n if (identity.isSeq(seq)) {\n for (let i = 0; i < seq.items.length; ++i) {\n let item = seq.items[i];\n if (identity.isPair(item))\n continue;\n else if (identity.isMap(item)) {\n if (item.items.length > 1)\n onError('Each pair must have its own sequence indicator');\n const pair = item.items[0] || new Pair.Pair(new Scalar.Scalar(null));\n if (item.commentBefore)\n pair.key.commentBefore = pair.key.commentBefore\n ? `${item.commentBefore}\\n${pair.key.commentBefore}`\n : item.commentBefore;\n if (item.comment) {\n const cn = pair.value ?? pair.key;\n cn.comment = cn.comment\n ? `${item.comment}\\n${cn.comment}`\n : item.comment;\n }\n item = pair;\n }\n seq.items[i] = identity.isPair(item) ? item : new Pair.Pair(item);\n }\n }\n else\n onError('Expected a sequence for this tag');\n return seq;\n}\nfunction createPairs(schema, iterable, ctx) {\n const { replacer } = ctx;\n const pairs = new YAMLSeq.YAMLSeq(schema);\n pairs.tag = 'tag:yaml.org,2002:pairs';\n let i = 0;\n if (iterable && Symbol.iterator in Object(iterable))\n for (let it of iterable) {\n if (typeof replacer === 'function')\n it = replacer.call(iterable, String(i++), it);\n let key, value;\n if (Array.isArray(it)) {\n if (it.length === 2) {\n key = it[0];\n value = it[1];\n }\n else\n throw new TypeError(`Expected [key, value] tuple: ${it}`);\n }\n else if (it && it instanceof Object) {\n const keys = Object.keys(it);\n if (keys.length === 1) {\n key = keys[0];\n value = it[key];\n }\n else {\n throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);\n }\n }\n else {\n key = it;\n }\n pairs.items.push(Pair.createPair(key, value, ctx));\n }\n return pairs;\n}\nconst pairs = {\n collection: 'seq',\n default: false,\n tag: 'tag:yaml.org,2002:pairs',\n resolve: resolvePairs,\n createNode: createPairs\n};\n\nexports.createPairs = createPairs;\nexports.pairs = pairs;\nexports.resolvePairs = resolvePairs;\n","'use strict';\n\nvar identity = require('../../nodes/identity.js');\nvar toJS = require('../../nodes/toJS.js');\nvar YAMLMap = require('../../nodes/YAMLMap.js');\nvar YAMLSeq = require('../../nodes/YAMLSeq.js');\nvar pairs = require('./pairs.js');\n\nclass YAMLOMap extends YAMLSeq.YAMLSeq {\n constructor() {\n super();\n this.add = YAMLMap.YAMLMap.prototype.add.bind(this);\n this.delete = YAMLMap.YAMLMap.prototype.delete.bind(this);\n this.get = YAMLMap.YAMLMap.prototype.get.bind(this);\n this.has = YAMLMap.YAMLMap.prototype.has.bind(this);\n this.set = YAMLMap.YAMLMap.prototype.set.bind(this);\n this.tag = YAMLOMap.tag;\n }\n /**\n * If `ctx` is given, the return type is actually `Map<unknown, unknown>`,\n * but TypeScript won't allow widening the signature of a child method.\n */\n toJSON(_, ctx) {\n if (!ctx)\n return super.toJSON(_);\n const map = new Map();\n if (ctx?.onCreate)\n ctx.onCreate(map);\n for (const pair of this.items) {\n let key, value;\n if (identity.isPair(pair)) {\n key = toJS.toJS(pair.key, '', ctx);\n value = toJS.toJS(pair.value, key, ctx);\n }\n else {\n key = toJS.toJS(pair, '', ctx);\n }\n if (map.has(key))\n throw new Error('Ordered maps must not include duplicate keys');\n map.set(key, value);\n }\n return map;\n }\n static from(schema, iterable, ctx) {\n const pairs$1 = pairs.createPairs(schema, iterable, ctx);\n const omap = new this();\n omap.items = pairs$1.items;\n return omap;\n }\n}\nYAMLOMap.tag = 'tag:yaml.org,2002:omap';\nconst omap = {\n collection: 'seq',\n identify: value => value instanceof Map,\n nodeClass: YAMLOMap,\n default: false,\n tag: 'tag:yaml.org,2002:omap',\n resolve(seq, onError) {\n const pairs$1 = pairs.resolvePairs(seq, onError);\n const seenKeys = [];\n for (const { key } of pairs$1.items) {\n if (identity.isScalar(key)) {\n if (seenKeys.includes(key.value)) {\n onError(`Ordered maps must not include duplicate keys: ${key.value}`);\n }\n else {\n seenKeys.push(key.value);\n }\n }\n }\n return Object.assign(new YAMLOMap(), pairs$1);\n },\n createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx)\n};\n\nexports.YAMLOMap = YAMLOMap;\nexports.omap = omap;\n","'use strict';\n\nvar Scalar = require('../../nodes/Scalar.js');\n\nfunction boolStringify({ value, source }, ctx) {\n const boolObj = value ? trueTag : falseTag;\n if (source && boolObj.test.test(source))\n return source;\n return value ? ctx.options.trueStr : ctx.options.falseStr;\n}\nconst trueTag = {\n identify: value => value === true,\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,\n resolve: () => new Scalar.Scalar(true),\n stringify: boolStringify\n};\nconst falseTag = {\n identify: value => value === false,\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,\n resolve: () => new Scalar.Scalar(false),\n stringify: boolStringify\n};\n\nexports.falseTag = falseTag;\nexports.trueTag = trueTag;\n","'use strict';\n\nvar Scalar = require('../../nodes/Scalar.js');\nvar stringifyNumber = require('../../stringify/stringifyNumber.js');\n\nconst floatNaN = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^(?:[-+]?\\.(?:inf|Inf|INF)|\\.nan|\\.NaN|\\.NAN)$/,\n resolve: (str) => str.slice(-3).toLowerCase() === 'nan'\n ? NaN\n : str[0] === '-'\n ? Number.NEGATIVE_INFINITY\n : Number.POSITIVE_INFINITY,\n stringify: stringifyNumber.stringifyNumber\n};\nconst floatExp = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n format: 'EXP',\n test: /^[-+]?(?:[0-9][0-9_]*)?(?:\\.[0-9_]*)?[eE][-+]?[0-9]+$/,\n resolve: (str) => parseFloat(str.replace(/_/g, '')),\n stringify(node) {\n const num = Number(node.value);\n return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);\n }\n};\nconst float = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^[-+]?(?:[0-9][0-9_]*)?\\.[0-9_]*$/,\n resolve(str) {\n const node = new Scalar.Scalar(parseFloat(str.replace(/_/g, '')));\n const dot = str.indexOf('.');\n if (dot !== -1) {\n const f = str.substring(dot + 1).replace(/_/g, '');\n if (f[f.length - 1] === '0')\n node.minFractionDigits = f.length;\n }\n return node;\n },\n stringify: stringifyNumber.stringifyNumber\n};\n\nexports.float = float;\nexports.floatExp = floatExp;\nexports.floatNaN = floatNaN;\n","'use strict';\n\nvar stringifyNumber = require('../../stringify/stringifyNumber.js');\n\nconst intIdentify = (value) => typeof value === 'bigint' || Number.isInteger(value);\nfunction intResolve(str, offset, radix, { intAsBigInt }) {\n const sign = str[0];\n if (sign === '-' || sign === '+')\n offset += 1;\n str = str.substring(offset).replace(/_/g, '');\n if (intAsBigInt) {\n switch (radix) {\n case 2:\n str = `0b${str}`;\n break;\n case 8:\n str = `0o${str}`;\n break;\n case 16:\n str = `0x${str}`;\n break;\n }\n const n = BigInt(str);\n return sign === '-' ? BigInt(-1) * n : n;\n }\n const n = parseInt(str, radix);\n return sign === '-' ? -1 * n : n;\n}\nfunction intStringify(node, radix, prefix) {\n const { value } = node;\n if (intIdentify(value)) {\n const str = value.toString(radix);\n return value < 0 ? '-' + prefix + str.substr(1) : prefix + str;\n }\n return stringifyNumber.stringifyNumber(node);\n}\nconst intBin = {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'BIN',\n test: /^[-+]?0b[0-1_]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 2, 2, opt),\n stringify: node => intStringify(node, 2, '0b')\n};\nconst intOct = {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'OCT',\n test: /^[-+]?0[0-7_]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 1, 8, opt),\n stringify: node => intStringify(node, 8, '0')\n};\nconst int = {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n test: /^[-+]?[0-9][0-9_]*$/,\n resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),\n stringify: stringifyNumber.stringifyNumber\n};\nconst intHex = {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'HEX',\n test: /^[-+]?0x[0-9a-fA-F_]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),\n stringify: node => intStringify(node, 16, '0x')\n};\n\nexports.int = int;\nexports.intBin = intBin;\nexports.intHex = intHex;\nexports.intOct = intOct;\n","'use strict';\n\nvar identity = require('../../nodes/identity.js');\nvar Pair = require('../../nodes/Pair.js');\nvar YAMLMap = require('../../nodes/YAMLMap.js');\n\nclass YAMLSet extends YAMLMap.YAMLMap {\n constructor(schema) {\n super(schema);\n this.tag = YAMLSet.tag;\n }\n add(key) {\n let pair;\n if (identity.isPair(key))\n pair = key;\n else if (key &&\n typeof key === 'object' &&\n 'key' in key &&\n 'value' in key &&\n key.value === null)\n pair = new Pair.Pair(key.key, null);\n else\n pair = new Pair.Pair(key, null);\n const prev = YAMLMap.findPair(this.items, pair.key);\n if (!prev)\n this.items.push(pair);\n }\n /**\n * If `keepPair` is `true`, returns the Pair matching `key`.\n * Otherwise, returns the value of that Pair's key.\n */\n get(key, keepPair) {\n const pair = YAMLMap.findPair(this.items, key);\n return !keepPair && identity.isPair(pair)\n ? identity.isScalar(pair.key)\n ? pair.key.value\n : pair.key\n : pair;\n }\n set(key, value) {\n if (typeof value !== 'boolean')\n throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`);\n const prev = YAMLMap.findPair(this.items, key);\n if (prev && !value) {\n this.items.splice(this.items.indexOf(prev), 1);\n }\n else if (!prev && value) {\n this.items.push(new Pair.Pair(key));\n }\n }\n toJSON(_, ctx) {\n return super.toJSON(_, ctx, Set);\n }\n toString(ctx, onComment, onChompKeep) {\n if (!ctx)\n return JSON.stringify(this);\n if (this.hasAllNullValues(true))\n return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep);\n else\n throw new Error('Set items must all have null values');\n }\n static from(schema, iterable, ctx) {\n const { replacer } = ctx;\n const set = new this(schema);\n if (iterable && Symbol.iterator in Object(iterable))\n for (let value of iterable) {\n if (typeof replacer === 'function')\n value = replacer.call(iterable, value, value);\n set.items.push(Pair.createPair(value, null, ctx));\n }\n return set;\n }\n}\nYAMLSet.tag = 'tag:yaml.org,2002:set';\nconst set = {\n collection: 'map',\n identify: value => value instanceof Set,\n nodeClass: YAMLSet,\n default: false,\n tag: 'tag:yaml.org,2002:set',\n createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx),\n resolve(map, onError) {\n if (identity.isMap(map)) {\n if (map.hasAllNullValues(true))\n return Object.assign(new YAMLSet(), map);\n else\n onError('Set items must all have null values');\n }\n else\n onError('Expected a mapping for this tag');\n return map;\n }\n};\n\nexports.YAMLSet = YAMLSet;\nexports.set = set;\n","'use strict';\n\nvar stringifyNumber = require('../../stringify/stringifyNumber.js');\n\n/** Internal types handle bigint as number, because TS can't figure it out. */\nfunction parseSexagesimal(str, asBigInt) {\n const sign = str[0];\n const parts = sign === '-' || sign === '+' ? str.substring(1) : str;\n const num = (n) => asBigInt ? BigInt(n) : Number(n);\n const res = parts\n .replace(/_/g, '')\n .split(':')\n .reduce((res, p) => res * num(60) + num(p), num(0));\n return (sign === '-' ? num(-1) * res : res);\n}\n/**\n * hhhh:mm:ss.sss\n *\n * Internal types handle bigint as number, because TS can't figure it out.\n */\nfunction stringifySexagesimal(node) {\n let { value } = node;\n let num = (n) => n;\n if (typeof value === 'bigint')\n num = n => BigInt(n);\n else if (isNaN(value) || !isFinite(value))\n return stringifyNumber.stringifyNumber(node);\n let sign = '';\n if (value < 0) {\n sign = '-';\n value *= num(-1);\n }\n const _60 = num(60);\n const parts = [value % _60]; // seconds, including ms\n if (value < 60) {\n parts.unshift(0); // at least one : is required\n }\n else {\n value = (value - parts[0]) / _60;\n parts.unshift(value % _60); // minutes\n if (value >= 60) {\n value = (value - parts[0]) / _60;\n parts.unshift(value); // hours\n }\n }\n return (sign +\n parts\n .map(n => String(n).padStart(2, '0'))\n .join(':')\n .replace(/000000\\d*$/, '') // % 60 may introduce error\n );\n}\nconst intTime = {\n identify: value => typeof value === 'bigint' || Number.isInteger(value),\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'TIME',\n test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,\n resolve: (str, _onError, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt),\n stringify: stringifySexagesimal\n};\nconst floatTime = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n format: 'TIME',\n test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*$/,\n resolve: str => parseSexagesimal(str, false),\n stringify: stringifySexagesimal\n};\nconst timestamp = {\n identify: value => value instanceof Date,\n default: true,\n tag: 'tag:yaml.org,2002:timestamp',\n // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part\n // may be omitted altogether, resulting in a date format. In such a case, the time part is\n // assumed to be 00:00:00Z (start of day, UTC).\n test: RegExp('^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})' + // YYYY-Mm-Dd\n '(?:' + // time is optional\n '(?:t|T|[ \\\\t]+)' + // t | T | whitespace\n '([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\\\.[0-9]+)?)' + // Hh:Mm:Ss(.ss)?\n '(?:[ \\\\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?' + // Z | +5 | -03:30\n ')?$'),\n resolve(str) {\n const match = str.match(timestamp.test);\n if (!match)\n throw new Error('!!timestamp expects a date, starting with yyyy-mm-dd');\n const [, year, month, day, hour, minute, second] = match.map(Number);\n const millisec = match[7] ? Number((match[7] + '00').substr(1, 3)) : 0;\n let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);\n const tz = match[8];\n if (tz && tz !== 'Z') {\n let d = parseSexagesimal(tz, false);\n if (Math.abs(d) < 30)\n d *= 60;\n date -= 60000 * d;\n }\n return new Date(date);\n },\n stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\\.000Z$/, '') ?? ''\n};\n\nexports.floatTime = floatTime;\nexports.intTime = intTime;\nexports.timestamp = timestamp;\n","'use strict';\n\nvar map = require('../common/map.js');\nvar _null = require('../common/null.js');\nvar seq = require('../common/seq.js');\nvar string = require('../common/string.js');\nvar binary = require('./binary.js');\nvar bool = require('./bool.js');\nvar float = require('./float.js');\nvar int = require('./int.js');\nvar merge = require('./merge.js');\nvar omap = require('./omap.js');\nvar pairs = require('./pairs.js');\nvar set = require('./set.js');\nvar timestamp = require('./timestamp.js');\n\nconst schema = [\n map.map,\n seq.seq,\n string.string,\n _null.nullTag,\n bool.trueTag,\n bool.falseTag,\n int.intBin,\n int.intOct,\n int.int,\n int.intHex,\n float.floatNaN,\n float.floatExp,\n float.float,\n binary.binary,\n merge.merge,\n omap.omap,\n pairs.pairs,\n set.set,\n timestamp.intTime,\n timestamp.floatTime,\n timestamp.timestamp\n];\n\nexports.schema = schema;\n","'use strict';\n\nvar map = require('./common/map.js');\nvar _null = require('./common/null.js');\nvar seq = require('./common/seq.js');\nvar string = require('./common/string.js');\nvar bool = require('./core/bool.js');\nvar float = require('./core/float.js');\nvar int = require('./core/int.js');\nvar schema = require('./core/schema.js');\nvar schema$1 = require('./json/schema.js');\nvar binary = require('./yaml-1.1/binary.js');\nvar merge = require('./yaml-1.1/merge.js');\nvar omap = require('./yaml-1.1/omap.js');\nvar pairs = require('./yaml-1.1/pairs.js');\nvar schema$2 = require('./yaml-1.1/schema.js');\nvar set = require('./yaml-1.1/set.js');\nvar timestamp = require('./yaml-1.1/timestamp.js');\n\nconst schemas = new Map([\n ['core', schema.schema],\n ['failsafe', [map.map, seq.seq, string.string]],\n ['json', schema$1.schema],\n ['yaml11', schema$2.schema],\n ['yaml-1.1', schema$2.schema]\n]);\nconst tagsByName = {\n binary: binary.binary,\n bool: bool.boolTag,\n float: float.float,\n floatExp: float.floatExp,\n floatNaN: float.floatNaN,\n floatTime: timestamp.floatTime,\n int: int.int,\n intHex: int.intHex,\n intOct: int.intOct,\n intTime: timestamp.intTime,\n map: map.map,\n merge: merge.merge,\n null: _null.nullTag,\n omap: omap.omap,\n pairs: pairs.pairs,\n seq: seq.seq,\n set: set.set,\n timestamp: timestamp.timestamp\n};\nconst coreKnownTags = {\n 'tag:yaml.org,2002:binary': binary.binary,\n 'tag:yaml.org,2002:merge': merge.merge,\n 'tag:yaml.org,2002:omap': omap.omap,\n 'tag:yaml.org,2002:pairs': pairs.pairs,\n 'tag:yaml.org,2002:set': set.set,\n 'tag:yaml.org,2002:timestamp': timestamp.timestamp\n};\nfunction getTags(customTags, schemaName, addMergeTag) {\n const schemaTags = schemas.get(schemaName);\n if (schemaTags && !customTags) {\n return addMergeTag && !schemaTags.includes(merge.merge)\n ? schemaTags.concat(merge.merge)\n : schemaTags.slice();\n }\n let tags = schemaTags;\n if (!tags) {\n if (Array.isArray(customTags))\n tags = [];\n else {\n const keys = Array.from(schemas.keys())\n .filter(key => key !== 'yaml11')\n .map(key => JSON.stringify(key))\n .join(', ');\n throw new Error(`Unknown schema \"${schemaName}\"; use one of ${keys} or define customTags array`);\n }\n }\n if (Array.isArray(customTags)) {\n for (const tag of customTags)\n tags = tags.concat(tag);\n }\n else if (typeof customTags === 'function') {\n tags = customTags(tags.slice());\n }\n if (addMergeTag)\n tags = tags.concat(merge.merge);\n return tags.reduce((tags, tag) => {\n const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;\n if (!tagObj) {\n const tagName = JSON.stringify(tag);\n const keys = Object.keys(tagsByName)\n .map(key => JSON.stringify(key))\n .join(', ');\n throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);\n }\n if (!tags.includes(tagObj))\n tags.push(tagObj);\n return tags;\n }, []);\n}\n\nexports.coreKnownTags = coreKnownTags;\nexports.getTags = getTags;\n","'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar map = require('./common/map.js');\nvar seq = require('./common/seq.js');\nvar string = require('./common/string.js');\nvar tags = require('./tags.js');\n\nconst sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;\nclass Schema {\n constructor({ compat, customTags, merge, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) {\n this.compat = Array.isArray(compat)\n ? tags.getTags(compat, 'compat')\n : compat\n ? tags.getTags(null, compat)\n : null;\n this.name = (typeof schema === 'string' && schema) || 'core';\n this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};\n this.tags = tags.getTags(customTags, this.name, merge);\n this.toStringOptions = toStringDefaults ?? null;\n Object.defineProperty(this, identity.MAP, { value: map.map });\n Object.defineProperty(this, identity.SCALAR, { value: string.string });\n Object.defineProperty(this, identity.SEQ, { value: seq.seq });\n // Used by createMap()\n this.sortMapEntries =\n typeof sortMapEntries === 'function'\n ? sortMapEntries\n : sortMapEntries === true\n ? sortMapEntriesByKey\n : null;\n }\n clone() {\n const copy = Object.create(Schema.prototype, Object.getOwnPropertyDescriptors(this));\n copy.tags = this.tags.slice();\n return copy;\n }\n}\n\nexports.Schema = Schema;\n","'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar stringify = require('./stringify.js');\nvar stringifyComment = require('./stringifyComment.js');\n\nfunction stringifyDocument(doc, options) {\n const lines = [];\n let hasDirectives = options.directives === true;\n if (options.directives !== false && doc.directives) {\n const dir = doc.directives.toString(doc);\n if (dir) {\n lines.push(dir);\n hasDirectives = true;\n }\n else if (doc.directives.docStart)\n hasDirectives = true;\n }\n if (hasDirectives)\n lines.push('---');\n const ctx = stringify.createStringifyContext(doc, options);\n const { commentString } = ctx.options;\n if (doc.commentBefore) {\n if (lines.length !== 1)\n lines.unshift('');\n const cs = commentString(doc.commentBefore);\n lines.unshift(stringifyComment.indentComment(cs, ''));\n }\n let chompKeep = false;\n let contentComment = null;\n if (doc.contents) {\n if (identity.isNode(doc.contents)) {\n if (doc.contents.spaceBefore && hasDirectives)\n lines.push('');\n if (doc.contents.commentBefore) {\n const cs = commentString(doc.contents.commentBefore);\n lines.push(stringifyComment.indentComment(cs, ''));\n }\n // top-level block scalars need to be indented if followed by a comment\n ctx.forceBlockIndent = !!doc.comment;\n contentComment = doc.contents.comment;\n }\n const onChompKeep = contentComment ? undefined : () => (chompKeep = true);\n let body = stringify.stringify(doc.contents, ctx, () => (contentComment = null), onChompKeep);\n if (contentComment)\n body += stringifyComment.lineComment(body, '', commentString(contentComment));\n if ((body[0] === '|' || body[0] === '>') &&\n lines[lines.length - 1] === '---') {\n // Top-level block scalars with a preceding doc marker ought to use the\n // same line for their header.\n lines[lines.length - 1] = `--- ${body}`;\n }\n else\n lines.push(body);\n }\n else {\n lines.push(stringify.stringify(doc.contents, ctx));\n }\n if (doc.directives?.docEnd) {\n if (doc.comment) {\n const cs = commentString(doc.comment);\n if (cs.includes('\\n')) {\n lines.push('...');\n lines.push(stringifyComment.indentComment(cs, ''));\n }\n else {\n lines.push(`... ${cs}`);\n }\n }\n else {\n lines.push('...');\n }\n }\n else {\n let dc = doc.comment;\n if (dc && chompKeep)\n dc = dc.replace(/^\\n+/, '');\n if (dc) {\n if ((!chompKeep || contentComment) && lines[lines.length - 1] !== '')\n lines.push('');\n lines.push(stringifyComment.indentComment(commentString(dc), ''));\n }\n }\n return lines.join('\\n') + '\\n';\n}\n\nexports.stringifyDocument = stringifyDocument;\n","'use strict';\n\nvar Alias = require('../nodes/Alias.js');\nvar Collection = require('../nodes/Collection.js');\nvar identity = require('../nodes/identity.js');\nvar Pair = require('../nodes/Pair.js');\nvar toJS = require('../nodes/toJS.js');\nvar Schema = require('../schema/Schema.js');\nvar stringifyDocument = require('../stringify/stringifyDocument.js');\nvar anchors = require('./anchors.js');\nvar applyReviver = require('./applyReviver.js');\nvar createNode = require('./createNode.js');\nvar directives = require('./directives.js');\n\nclass Document {\n constructor(value, replacer, options) {\n /** A comment before this Document */\n this.commentBefore = null;\n /** A comment immediately after this Document */\n this.comment = null;\n /** Errors encountered during parsing. */\n this.errors = [];\n /** Warnings encountered during parsing. */\n this.warnings = [];\n Object.defineProperty(this, identity.NODE_TYPE, { value: identity.DOC });\n let _replacer = null;\n if (typeof replacer === 'function' || Array.isArray(replacer)) {\n _replacer = replacer;\n }\n else if (options === undefined && replacer) {\n options = replacer;\n replacer = undefined;\n }\n const opt = Object.assign({\n intAsBigInt: false,\n keepSourceTokens: false,\n logLevel: 'warn',\n prettyErrors: true,\n strict: true,\n stringKeys: false,\n uniqueKeys: true,\n version: '1.2'\n }, options);\n this.options = opt;\n let { version } = opt;\n if (options?._directives) {\n this.directives = options._directives.atDocument();\n if (this.directives.yaml.explicit)\n version = this.directives.yaml.version;\n }\n else\n this.directives = new directives.Directives({ version });\n this.setSchema(version, options);\n // @ts-expect-error We can't really know that this matches Contents.\n this.contents =\n value === undefined ? null : this.createNode(value, _replacer, options);\n }\n /**\n * Create a deep copy of this Document and its contents.\n *\n * Custom Node values that inherit from `Object` still refer to their original instances.\n */\n clone() {\n const copy = Object.create(Document.prototype, {\n [identity.NODE_TYPE]: { value: identity.DOC }\n });\n copy.commentBefore = this.commentBefore;\n copy.comment = this.comment;\n copy.errors = this.errors.slice();\n copy.warnings = this.warnings.slice();\n copy.options = Object.assign({}, this.options);\n if (this.directives)\n copy.directives = this.directives.clone();\n copy.schema = this.schema.clone();\n // @ts-expect-error We can't really know that this matches Contents.\n copy.contents = identity.isNode(this.contents)\n ? this.contents.clone(copy.schema)\n : this.contents;\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }\n /** Adds a value to the document. */\n add(value) {\n if (assertCollection(this.contents))\n this.contents.add(value);\n }\n /** Adds a value to the document. */\n addIn(path, value) {\n if (assertCollection(this.contents))\n this.contents.addIn(path, value);\n }\n /**\n * Create a new `Alias` node, ensuring that the target `node` has the required anchor.\n *\n * If `node` already has an anchor, `name` is ignored.\n * Otherwise, the `node.anchor` value will be set to `name`,\n * or if an anchor with that name is already present in the document,\n * `name` will be used as a prefix for a new unique anchor.\n * If `name` is undefined, the generated anchor will use 'a' as a prefix.\n */\n createAlias(node, name) {\n if (!node.anchor) {\n const prev = anchors.anchorNames(this);\n node.anchor =\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n !name || prev.has(name) ? anchors.findNewAnchor(name || 'a', prev) : name;\n }\n return new Alias.Alias(node.anchor);\n }\n createNode(value, replacer, options) {\n let _replacer = undefined;\n if (typeof replacer === 'function') {\n value = replacer.call({ '': value }, '', value);\n _replacer = replacer;\n }\n else if (Array.isArray(replacer)) {\n const keyToStr = (v) => typeof v === 'number' || v instanceof String || v instanceof Number;\n const asStr = replacer.filter(keyToStr).map(String);\n if (asStr.length > 0)\n replacer = replacer.concat(asStr);\n _replacer = replacer;\n }\n else if (options === undefined && replacer) {\n options = replacer;\n replacer = undefined;\n }\n const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options ?? {};\n const { onAnchor, setAnchors, sourceObjects } = anchors.createNodeAnchors(this, \n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n anchorPrefix || 'a');\n const ctx = {\n aliasDuplicateObjects: aliasDuplicateObjects ?? true,\n keepUndefined: keepUndefined ?? false,\n onAnchor,\n onTagObj,\n replacer: _replacer,\n schema: this.schema,\n sourceObjects\n };\n const node = createNode.createNode(value, tag, ctx);\n if (flow && identity.isCollection(node))\n node.flow = true;\n setAnchors();\n return node;\n }\n /**\n * Convert a key and a value into a `Pair` using the current schema,\n * recursively wrapping all values as `Scalar` or `Collection` nodes.\n */\n createPair(key, value, options = {}) {\n const k = this.createNode(key, null, options);\n const v = this.createNode(value, null, options);\n return new Pair.Pair(k, v);\n }\n /**\n * Removes a value from the document.\n * @returns `true` if the item was found and removed.\n */\n delete(key) {\n return assertCollection(this.contents) ? this.contents.delete(key) : false;\n }\n /**\n * Removes a value from the document.\n * @returns `true` if the item was found and removed.\n */\n deleteIn(path) {\n if (Collection.isEmptyPath(path)) {\n if (this.contents == null)\n return false;\n // @ts-expect-error Presumed impossible if Strict extends false\n this.contents = null;\n return true;\n }\n return assertCollection(this.contents)\n ? this.contents.deleteIn(path)\n : false;\n }\n /**\n * Returns item at `key`, or `undefined` if not found. By default unwraps\n * scalar values from their surrounding node; to disable set `keepScalar` to\n * `true` (collections are always returned intact).\n */\n get(key, keepScalar) {\n return identity.isCollection(this.contents)\n ? this.contents.get(key, keepScalar)\n : undefined;\n }\n /**\n * Returns item at `path`, or `undefined` if not found. By default unwraps\n * scalar values from their surrounding node; to disable set `keepScalar` to\n * `true` (collections are always returned intact).\n */\n getIn(path, keepScalar) {\n if (Collection.isEmptyPath(path))\n return !keepScalar && identity.isScalar(this.contents)\n ? this.contents.value\n : this.contents;\n return identity.isCollection(this.contents)\n ? this.contents.getIn(path, keepScalar)\n : undefined;\n }\n /**\n * Checks if the document includes a value with the key `key`.\n */\n has(key) {\n return identity.isCollection(this.contents) ? this.contents.has(key) : false;\n }\n /**\n * Checks if the document includes a value at `path`.\n */\n hasIn(path) {\n if (Collection.isEmptyPath(path))\n return this.contents !== undefined;\n return identity.isCollection(this.contents) ? this.contents.hasIn(path) : false;\n }\n /**\n * Sets a value in this document. For `!!set`, `value` needs to be a\n * boolean to add/remove the item from the set.\n */\n set(key, value) {\n if (this.contents == null) {\n // @ts-expect-error We can't really know that this matches Contents.\n this.contents = Collection.collectionFromPath(this.schema, [key], value);\n }\n else if (assertCollection(this.contents)) {\n this.contents.set(key, value);\n }\n }\n /**\n * Sets a value in this document. For `!!set`, `value` needs to be a\n * boolean to add/remove the item from the set.\n */\n setIn(path, value) {\n if (Collection.isEmptyPath(path)) {\n // @ts-expect-error We can't really know that this matches Contents.\n this.contents = value;\n }\n else if (this.contents == null) {\n // @ts-expect-error We can't really know that this matches Contents.\n this.contents = Collection.collectionFromPath(this.schema, Array.from(path), value);\n }\n else if (assertCollection(this.contents)) {\n this.contents.setIn(path, value);\n }\n }\n /**\n * Change the YAML version and schema used by the document.\n * A `null` version disables support for directives, explicit tags, anchors, and aliases.\n * It also requires the `schema` option to be given as a `Schema` instance value.\n *\n * Overrides all previously set schema options.\n */\n setSchema(version, options = {}) {\n if (typeof version === 'number')\n version = String(version);\n let opt;\n switch (version) {\n case '1.1':\n if (this.directives)\n this.directives.yaml.version = '1.1';\n else\n this.directives = new directives.Directives({ version: '1.1' });\n opt = { resolveKnownTags: false, schema: 'yaml-1.1' };\n break;\n case '1.2':\n case 'next':\n if (this.directives)\n this.directives.yaml.version = version;\n else\n this.directives = new directives.Directives({ version });\n opt = { resolveKnownTags: true, schema: 'core' };\n break;\n case null:\n if (this.directives)\n delete this.directives;\n opt = null;\n break;\n default: {\n const sv = JSON.stringify(version);\n throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`);\n }\n }\n // Not using `instanceof Schema` to allow for duck typing\n if (options.schema instanceof Object)\n this.schema = options.schema;\n else if (opt)\n this.schema = new Schema.Schema(Object.assign(opt, options));\n else\n throw new Error(`With a null YAML version, the { schema: Schema } option is required`);\n }\n // json & jsonArg are only used from toJSON()\n toJS({ json, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {\n const ctx = {\n anchors: new Map(),\n doc: this,\n keep: !json,\n mapAsMap: mapAsMap === true,\n mapKeyWarned: false,\n maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100\n };\n const res = toJS.toJS(this.contents, jsonArg ?? '', ctx);\n if (typeof onAnchor === 'function')\n for (const { count, res } of ctx.anchors.values())\n onAnchor(res, count);\n return typeof reviver === 'function'\n ? applyReviver.applyReviver(reviver, { '': res }, '', res)\n : res;\n }\n /**\n * A JSON representation of the document `contents`.\n *\n * @param jsonArg Used by `JSON.stringify` to indicate the array index or\n * property name.\n */\n toJSON(jsonArg, onAnchor) {\n return this.toJS({ json: true, jsonArg, mapAsMap: false, onAnchor });\n }\n /** A YAML representation of the document. */\n toString(options = {}) {\n if (this.errors.length > 0)\n throw new Error('Document with errors cannot be stringified');\n if ('indent' in options &&\n (!Number.isInteger(options.indent) || Number(options.indent) <= 0)) {\n const s = JSON.stringify(options.indent);\n throw new Error(`\"indent\" option must be a positive integer, not ${s}`);\n }\n return stringifyDocument.stringifyDocument(this, options);\n }\n}\nfunction assertCollection(contents) {\n if (identity.isCollection(contents))\n return true;\n throw new Error('Expected a YAML collection as document contents');\n}\n\nexports.Document = Document;\n","'use strict';\n\nclass YAMLError extends Error {\n constructor(name, pos, code, message) {\n super();\n this.name = name;\n this.code = code;\n this.message = message;\n this.pos = pos;\n }\n}\nclass YAMLParseError extends YAMLError {\n constructor(pos, code, message) {\n super('YAMLParseError', pos, code, message);\n }\n}\nclass YAMLWarning extends YAMLError {\n constructor(pos, code, message) {\n super('YAMLWarning', pos, code, message);\n }\n}\nconst prettifyError = (src, lc) => (error) => {\n if (error.pos[0] === -1)\n return;\n error.linePos = error.pos.map(pos => lc.linePos(pos));\n const { line, col } = error.linePos[0];\n error.message += ` at line ${line}, column ${col}`;\n let ci = col - 1;\n let lineStr = src\n .substring(lc.lineStarts[line - 1], lc.lineStarts[line])\n .replace(/[\\n\\r]+$/, '');\n // Trim to max 80 chars, keeping col position near the middle\n if (ci >= 60 && lineStr.length > 80) {\n const trimStart = Math.min(ci - 39, lineStr.length - 79);\n lineStr = '…' + lineStr.substring(trimStart);\n ci -= trimStart - 1;\n }\n if (lineStr.length > 80)\n lineStr = lineStr.substring(0, 79) + '…';\n // Include previous line in context if pointing at line start\n if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) {\n // Regexp won't match if start is trimmed\n let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]);\n if (prev.length > 80)\n prev = prev.substring(0, 79) + '…\\n';\n lineStr = prev + lineStr;\n }\n if (/[^ ]/.test(lineStr)) {\n let count = 1;\n const end = error.linePos[1];\n if (end?.line === line && end.col > col) {\n count = Math.max(1, Math.min(end.col - col, 80 - ci));\n }\n const pointer = ' '.repeat(ci) + '^'.repeat(count);\n error.message += `:\\n\\n${lineStr}\\n${pointer}\\n`;\n }\n};\n\nexports.YAMLError = YAMLError;\nexports.YAMLParseError = YAMLParseError;\nexports.YAMLWarning = YAMLWarning;\nexports.prettifyError = prettifyError;\n","'use strict';\n\nfunction resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {\n let spaceBefore = false;\n let atNewline = startOnNewline;\n let hasSpace = startOnNewline;\n let comment = '';\n let commentSep = '';\n let hasNewline = false;\n let reqSpace = false;\n let tab = null;\n let anchor = null;\n let tag = null;\n let newlineAfterProp = null;\n let comma = null;\n let found = null;\n let start = null;\n for (const token of tokens) {\n if (reqSpace) {\n if (token.type !== 'space' &&\n token.type !== 'newline' &&\n token.type !== 'comma')\n onError(token.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');\n reqSpace = false;\n }\n if (tab) {\n if (atNewline && token.type !== 'comment' && token.type !== 'newline') {\n onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');\n }\n tab = null;\n }\n switch (token.type) {\n case 'space':\n // At the doc level, tabs at line start may be parsed\n // as leading white space rather than indentation.\n // In a flow collection, only the parser handles indent.\n if (!flow &&\n (indicator !== 'doc-start' || next?.type !== 'flow-collection') &&\n token.source.includes('\\t')) {\n tab = token;\n }\n hasSpace = true;\n break;\n case 'comment': {\n if (!hasSpace)\n onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters');\n const cb = token.source.substring(1) || ' ';\n if (!comment)\n comment = cb;\n else\n comment += commentSep + cb;\n commentSep = '';\n atNewline = false;\n break;\n }\n case 'newline':\n if (atNewline) {\n if (comment)\n comment += token.source;\n else if (!found || indicator !== 'seq-item-ind')\n spaceBefore = true;\n }\n else\n commentSep += token.source;\n atNewline = true;\n hasNewline = true;\n if (anchor || tag)\n newlineAfterProp = token;\n hasSpace = true;\n break;\n case 'anchor':\n if (anchor)\n onError(token, 'MULTIPLE_ANCHORS', 'A node can have at most one anchor');\n if (token.source.endsWith(':'))\n onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);\n anchor = token;\n start ?? (start = token.offset);\n atNewline = false;\n hasSpace = false;\n reqSpace = true;\n break;\n case 'tag': {\n if (tag)\n onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');\n tag = token;\n start ?? (start = token.offset);\n atNewline = false;\n hasSpace = false;\n reqSpace = true;\n break;\n }\n case indicator:\n // Could here handle preceding comments differently\n if (anchor || tag)\n onError(token, 'BAD_PROP_ORDER', `Anchors and tags must be after the ${token.source} indicator`);\n if (found)\n onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.source} in ${flow ?? 'collection'}`);\n found = token;\n atNewline =\n indicator === 'seq-item-ind' || indicator === 'explicit-key-ind';\n hasSpace = false;\n break;\n case 'comma':\n if (flow) {\n if (comma)\n onError(token, 'UNEXPECTED_TOKEN', `Unexpected , in ${flow}`);\n comma = token;\n atNewline = false;\n hasSpace = false;\n break;\n }\n // else fallthrough\n default:\n onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.type} token`);\n atNewline = false;\n hasSpace = false;\n }\n }\n const last = tokens[tokens.length - 1];\n const end = last ? last.offset + last.source.length : offset;\n if (reqSpace &&\n next &&\n next.type !== 'space' &&\n next.type !== 'newline' &&\n next.type !== 'comma' &&\n (next.type !== 'scalar' || next.source !== '')) {\n onError(next.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');\n }\n if (tab &&\n ((atNewline && tab.indent <= parentIndent) ||\n next?.type === 'block-map' ||\n next?.type === 'block-seq'))\n onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');\n return {\n comma,\n found,\n spaceBefore,\n comment,\n hasNewline,\n anchor,\n tag,\n newlineAfterProp,\n end,\n start: start ?? end\n };\n}\n\nexports.resolveProps = resolveProps;\n","'use strict';\n\nfunction containsNewline(key) {\n if (!key)\n return null;\n switch (key.type) {\n case 'alias':\n case 'scalar':\n case 'double-quoted-scalar':\n case 'single-quoted-scalar':\n if (key.source.includes('\\n'))\n return true;\n if (key.end)\n for (const st of key.end)\n if (st.type === 'newline')\n return true;\n return false;\n case 'flow-collection':\n for (const it of key.items) {\n for (const st of it.start)\n if (st.type === 'newline')\n return true;\n if (it.sep)\n for (const st of it.sep)\n if (st.type === 'newline')\n return true;\n if (containsNewline(it.key) || containsNewline(it.value))\n return true;\n }\n return false;\n default:\n return true;\n }\n}\n\nexports.containsNewline = containsNewline;\n","'use strict';\n\nvar utilContainsNewline = require('./util-contains-newline.js');\n\nfunction flowIndentCheck(indent, fc, onError) {\n if (fc?.type === 'flow-collection') {\n const end = fc.end[0];\n if (end.indent === indent &&\n (end.source === ']' || end.source === '}') &&\n utilContainsNewline.containsNewline(fc)) {\n const msg = 'Flow end indicator should be more indented than parent';\n onError(end, 'BAD_INDENT', msg, true);\n }\n }\n}\n\nexports.flowIndentCheck = flowIndentCheck;\n","'use strict';\n\nvar identity = require('../nodes/identity.js');\n\nfunction mapIncludes(ctx, items, search) {\n const { uniqueKeys } = ctx.options;\n if (uniqueKeys === false)\n return false;\n const isEqual = typeof uniqueKeys === 'function'\n ? uniqueKeys\n : (a, b) => a === b || (identity.isScalar(a) && identity.isScalar(b) && a.value === b.value);\n return items.some(pair => isEqual(pair.key, search));\n}\n\nexports.mapIncludes = mapIncludes;\n","'use strict';\n\nvar Pair = require('../nodes/Pair.js');\nvar YAMLMap = require('../nodes/YAMLMap.js');\nvar resolveProps = require('./resolve-props.js');\nvar utilContainsNewline = require('./util-contains-newline.js');\nvar utilFlowIndentCheck = require('./util-flow-indent-check.js');\nvar utilMapIncludes = require('./util-map-includes.js');\n\nconst startColMsg = 'All mapping items must start at the same column';\nfunction resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) {\n const NodeClass = tag?.nodeClass ?? YAMLMap.YAMLMap;\n const map = new NodeClass(ctx.schema);\n if (ctx.atRoot)\n ctx.atRoot = false;\n let offset = bm.offset;\n let commentEnd = null;\n for (const collItem of bm.items) {\n const { start, key, sep, value } = collItem;\n // key properties\n const keyProps = resolveProps.resolveProps(start, {\n indicator: 'explicit-key-ind',\n next: key ?? sep?.[0],\n offset,\n onError,\n parentIndent: bm.indent,\n startOnNewline: true\n });\n const implicitKey = !keyProps.found;\n if (implicitKey) {\n if (key) {\n if (key.type === 'block-seq')\n onError(offset, 'BLOCK_AS_IMPLICIT_KEY', 'A block sequence may not be used as an implicit map key');\n else if ('indent' in key && key.indent !== bm.indent)\n onError(offset, 'BAD_INDENT', startColMsg);\n }\n if (!keyProps.anchor && !keyProps.tag && !sep) {\n commentEnd = keyProps.end;\n if (keyProps.comment) {\n if (map.comment)\n map.comment += '\\n' + keyProps.comment;\n else\n map.comment = keyProps.comment;\n }\n continue;\n }\n if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) {\n onError(key ?? start[start.length - 1], 'MULTILINE_IMPLICIT_KEY', 'Implicit keys need to be on a single line');\n }\n }\n else if (keyProps.found?.indent !== bm.indent) {\n onError(offset, 'BAD_INDENT', startColMsg);\n }\n // key value\n ctx.atKey = true;\n const keyStart = keyProps.end;\n const keyNode = key\n ? composeNode(ctx, key, keyProps, onError)\n : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);\n if (ctx.schema.compat)\n utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError);\n ctx.atKey = false;\n if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))\n onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');\n // value properties\n const valueProps = resolveProps.resolveProps(sep ?? [], {\n indicator: 'map-value-ind',\n next: value,\n offset: keyNode.range[2],\n onError,\n parentIndent: bm.indent,\n startOnNewline: !key || key.type === 'block-scalar'\n });\n offset = valueProps.end;\n if (valueProps.found) {\n if (implicitKey) {\n if (value?.type === 'block-map' && !valueProps.hasNewline)\n onError(offset, 'BLOCK_AS_IMPLICIT_KEY', 'Nested mappings are not allowed in compact mappings');\n if (ctx.options.strict &&\n keyProps.start < valueProps.found.offset - 1024)\n onError(keyNode.range, 'KEY_OVER_1024_CHARS', 'The : indicator must be at most 1024 chars after the start of an implicit block mapping key');\n }\n // value value\n const valueNode = value\n ? composeNode(ctx, value, valueProps, onError)\n : composeEmptyNode(ctx, offset, sep, null, valueProps, onError);\n if (ctx.schema.compat)\n utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);\n offset = valueNode.range[2];\n const pair = new Pair.Pair(keyNode, valueNode);\n if (ctx.options.keepSourceTokens)\n pair.srcToken = collItem;\n map.items.push(pair);\n }\n else {\n // key with no value\n if (implicitKey)\n onError(keyNode.range, 'MISSING_CHAR', 'Implicit map keys need to be followed by map values');\n if (valueProps.comment) {\n if (keyNode.comment)\n keyNode.comment += '\\n' + valueProps.comment;\n else\n keyNode.comment = valueProps.comment;\n }\n const pair = new Pair.Pair(keyNode);\n if (ctx.options.keepSourceTokens)\n pair.srcToken = collItem;\n map.items.push(pair);\n }\n }\n if (commentEnd && commentEnd < offset)\n onError(commentEnd, 'IMPOSSIBLE', 'Map comment with trailing content');\n map.range = [bm.offset, offset, commentEnd ?? offset];\n return map;\n}\n\nexports.resolveBlockMap = resolveBlockMap;\n","'use strict';\n\nvar YAMLSeq = require('../nodes/YAMLSeq.js');\nvar resolveProps = require('./resolve-props.js');\nvar utilFlowIndentCheck = require('./util-flow-indent-check.js');\n\nfunction resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) {\n const NodeClass = tag?.nodeClass ?? YAMLSeq.YAMLSeq;\n const seq = new NodeClass(ctx.schema);\n if (ctx.atRoot)\n ctx.atRoot = false;\n if (ctx.atKey)\n ctx.atKey = false;\n let offset = bs.offset;\n let commentEnd = null;\n for (const { start, value } of bs.items) {\n const props = resolveProps.resolveProps(start, {\n indicator: 'seq-item-ind',\n next: value,\n offset,\n onError,\n parentIndent: bs.indent,\n startOnNewline: true\n });\n if (!props.found) {\n if (props.anchor || props.tag || value) {\n if (value?.type === 'block-seq')\n onError(props.end, 'BAD_INDENT', 'All sequence items must start at the same column');\n else\n onError(offset, 'MISSING_CHAR', 'Sequence item without - indicator');\n }\n else {\n commentEnd = props.end;\n if (props.comment)\n seq.comment = props.comment;\n continue;\n }\n }\n const node = value\n ? composeNode(ctx, value, props, onError)\n : composeEmptyNode(ctx, props.end, start, null, props, onError);\n if (ctx.schema.compat)\n utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError);\n offset = node.range[2];\n seq.items.push(node);\n }\n seq.range = [bs.offset, offset, commentEnd ?? offset];\n return seq;\n}\n\nexports.resolveBlockSeq = resolveBlockSeq;\n","'use strict';\n\nfunction resolveEnd(end, offset, reqSpace, onError) {\n let comment = '';\n if (end) {\n let hasSpace = false;\n let sep = '';\n for (const token of end) {\n const { source, type } = token;\n switch (type) {\n case 'space':\n hasSpace = true;\n break;\n case 'comment': {\n if (reqSpace && !hasSpace)\n onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters');\n const cb = source.substring(1) || ' ';\n if (!comment)\n comment = cb;\n else\n comment += sep + cb;\n sep = '';\n break;\n }\n case 'newline':\n if (comment)\n sep += source;\n hasSpace = true;\n break;\n default:\n onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${type} at node end`);\n }\n offset += source.length;\n }\n }\n return { comment, offset };\n}\n\nexports.resolveEnd = resolveEnd;\n","'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar Pair = require('../nodes/Pair.js');\nvar YAMLMap = require('../nodes/YAMLMap.js');\nvar YAMLSeq = require('../nodes/YAMLSeq.js');\nvar resolveEnd = require('./resolve-end.js');\nvar resolveProps = require('./resolve-props.js');\nvar utilContainsNewline = require('./util-contains-newline.js');\nvar utilMapIncludes = require('./util-map-includes.js');\n\nconst blockMsg = 'Block collections are not allowed within flow collections';\nconst isBlock = (token) => token && (token.type === 'block-map' || token.type === 'block-seq');\nfunction resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) {\n const isMap = fc.start.source === '{';\n const fcName = isMap ? 'flow map' : 'flow sequence';\n const NodeClass = (tag?.nodeClass ?? (isMap ? YAMLMap.YAMLMap : YAMLSeq.YAMLSeq));\n const coll = new NodeClass(ctx.schema);\n coll.flow = true;\n const atRoot = ctx.atRoot;\n if (atRoot)\n ctx.atRoot = false;\n if (ctx.atKey)\n ctx.atKey = false;\n let offset = fc.offset + fc.start.source.length;\n for (let i = 0; i < fc.items.length; ++i) {\n const collItem = fc.items[i];\n const { start, key, sep, value } = collItem;\n const props = resolveProps.resolveProps(start, {\n flow: fcName,\n indicator: 'explicit-key-ind',\n next: key ?? sep?.[0],\n offset,\n onError,\n parentIndent: fc.indent,\n startOnNewline: false\n });\n if (!props.found) {\n if (!props.anchor && !props.tag && !sep && !value) {\n if (i === 0 && props.comma)\n onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`);\n else if (i < fc.items.length - 1)\n onError(props.start, 'UNEXPECTED_TOKEN', `Unexpected empty item in ${fcName}`);\n if (props.comment) {\n if (coll.comment)\n coll.comment += '\\n' + props.comment;\n else\n coll.comment = props.comment;\n }\n offset = props.end;\n continue;\n }\n if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(key))\n onError(key, // checked by containsNewline()\n 'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line');\n }\n if (i === 0) {\n if (props.comma)\n onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`);\n }\n else {\n if (!props.comma)\n onError(props.start, 'MISSING_CHAR', `Missing , between ${fcName} items`);\n if (props.comment) {\n let prevItemComment = '';\n loop: for (const st of start) {\n switch (st.type) {\n case 'comma':\n case 'space':\n break;\n case 'comment':\n prevItemComment = st.source.substring(1);\n break loop;\n default:\n break loop;\n }\n }\n if (prevItemComment) {\n let prev = coll.items[coll.items.length - 1];\n if (identity.isPair(prev))\n prev = prev.value ?? prev.key;\n if (prev.comment)\n prev.comment += '\\n' + prevItemComment;\n else\n prev.comment = prevItemComment;\n props.comment = props.comment.substring(prevItemComment.length + 1);\n }\n }\n }\n if (!isMap && !sep && !props.found) {\n // item is a value in a seq\n // → key & sep are empty, start does not include ? or :\n const valueNode = value\n ? composeNode(ctx, value, props, onError)\n : composeEmptyNode(ctx, props.end, sep, null, props, onError);\n coll.items.push(valueNode);\n offset = valueNode.range[2];\n if (isBlock(value))\n onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);\n }\n else {\n // item is a key+value pair\n // key value\n ctx.atKey = true;\n const keyStart = props.end;\n const keyNode = key\n ? composeNode(ctx, key, props, onError)\n : composeEmptyNode(ctx, keyStart, start, null, props, onError);\n if (isBlock(key))\n onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);\n ctx.atKey = false;\n // value properties\n const valueProps = resolveProps.resolveProps(sep ?? [], {\n flow: fcName,\n indicator: 'map-value-ind',\n next: value,\n offset: keyNode.range[2],\n onError,\n parentIndent: fc.indent,\n startOnNewline: false\n });\n if (valueProps.found) {\n if (!isMap && !props.found && ctx.options.strict) {\n if (sep)\n for (const st of sep) {\n if (st === valueProps.found)\n break;\n if (st.type === 'newline') {\n onError(st, 'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line');\n break;\n }\n }\n if (props.start < valueProps.found.offset - 1024)\n onError(valueProps.found, 'KEY_OVER_1024_CHARS', 'The : indicator must be at most 1024 chars after the start of an implicit flow sequence key');\n }\n }\n else if (value) {\n if ('source' in value && value.source?.[0] === ':')\n onError(value, 'MISSING_CHAR', `Missing space after : in ${fcName}`);\n else\n onError(valueProps.start, 'MISSING_CHAR', `Missing , or : between ${fcName} items`);\n }\n // value value\n const valueNode = value\n ? composeNode(ctx, value, valueProps, onError)\n : valueProps.found\n ? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError)\n : null;\n if (valueNode) {\n if (isBlock(value))\n onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);\n }\n else if (valueProps.comment) {\n if (keyNode.comment)\n keyNode.comment += '\\n' + valueProps.comment;\n else\n keyNode.comment = valueProps.comment;\n }\n const pair = new Pair.Pair(keyNode, valueNode);\n if (ctx.options.keepSourceTokens)\n pair.srcToken = collItem;\n if (isMap) {\n const map = coll;\n if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))\n onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');\n map.items.push(pair);\n }\n else {\n const map = new YAMLMap.YAMLMap(ctx.schema);\n map.flow = true;\n map.items.push(pair);\n const endRange = (valueNode ?? keyNode).range;\n map.range = [keyNode.range[0], endRange[1], endRange[2]];\n coll.items.push(map);\n }\n offset = valueNode ? valueNode.range[2] : valueProps.end;\n }\n }\n const expectedEnd = isMap ? '}' : ']';\n const [ce, ...ee] = fc.end;\n let cePos = offset;\n if (ce?.source === expectedEnd)\n cePos = ce.offset + ce.source.length;\n else {\n const name = fcName[0].toUpperCase() + fcName.substring(1);\n const msg = atRoot\n ? `${name} must end with a ${expectedEnd}`\n : `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`;\n onError(offset, atRoot ? 'MISSING_CHAR' : 'BAD_INDENT', msg);\n if (ce && ce.source.length !== 1)\n ee.unshift(ce);\n }\n if (ee.length > 0) {\n const end = resolveEnd.resolveEnd(ee, cePos, ctx.options.strict, onError);\n if (end.comment) {\n if (coll.comment)\n coll.comment += '\\n' + end.comment;\n else\n coll.comment = end.comment;\n }\n coll.range = [fc.offset, cePos, end.offset];\n }\n else {\n coll.range = [fc.offset, cePos, cePos];\n }\n return coll;\n}\n\nexports.resolveFlowCollection = resolveFlowCollection;\n","'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar Scalar = require('../nodes/Scalar.js');\nvar YAMLMap = require('../nodes/YAMLMap.js');\nvar YAMLSeq = require('../nodes/YAMLSeq.js');\nvar resolveBlockMap = require('./resolve-block-map.js');\nvar resolveBlockSeq = require('./resolve-block-seq.js');\nvar resolveFlowCollection = require('./resolve-flow-collection.js');\n\nfunction resolveCollection(CN, ctx, token, onError, tagName, tag) {\n const coll = token.type === 'block-map'\n ? resolveBlockMap.resolveBlockMap(CN, ctx, token, onError, tag)\n : token.type === 'block-seq'\n ? resolveBlockSeq.resolveBlockSeq(CN, ctx, token, onError, tag)\n : resolveFlowCollection.resolveFlowCollection(CN, ctx, token, onError, tag);\n const Coll = coll.constructor;\n // If we got a tagName matching the class, or the tag name is '!',\n // then use the tagName from the node class used to create it.\n if (tagName === '!' || tagName === Coll.tagName) {\n coll.tag = Coll.tagName;\n return coll;\n }\n if (tagName)\n coll.tag = tagName;\n return coll;\n}\nfunction composeCollection(CN, ctx, token, props, onError) {\n const tagToken = props.tag;\n const tagName = !tagToken\n ? null\n : ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg));\n if (token.type === 'block-seq') {\n const { anchor, newlineAfterProp: nl } = props;\n const lastProp = anchor && tagToken\n ? anchor.offset > tagToken.offset\n ? anchor\n : tagToken\n : (anchor ?? tagToken);\n if (lastProp && (!nl || nl.offset < lastProp.offset)) {\n const message = 'Missing newline after block sequence props';\n onError(lastProp, 'MISSING_CHAR', message);\n }\n }\n const expType = token.type === 'block-map'\n ? 'map'\n : token.type === 'block-seq'\n ? 'seq'\n : token.start.source === '{'\n ? 'map'\n : 'seq';\n // shortcut: check if it's a generic YAMLMap or YAMLSeq\n // before jumping into the custom tag logic.\n if (!tagToken ||\n !tagName ||\n tagName === '!' ||\n (tagName === YAMLMap.YAMLMap.tagName && expType === 'map') ||\n (tagName === YAMLSeq.YAMLSeq.tagName && expType === 'seq')) {\n return resolveCollection(CN, ctx, token, onError, tagName);\n }\n let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType);\n if (!tag) {\n const kt = ctx.schema.knownTags[tagName];\n if (kt?.collection === expType) {\n ctx.schema.tags.push(Object.assign({}, kt, { default: false }));\n tag = kt;\n }\n else {\n if (kt) {\n onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);\n }\n else {\n onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);\n }\n return resolveCollection(CN, ctx, token, onError, tagName);\n }\n }\n const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);\n const res = tag.resolve?.(coll, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg), ctx.options) ?? coll;\n const node = identity.isNode(res)\n ? res\n : new Scalar.Scalar(res);\n node.range = coll.range;\n node.tag = tagName;\n if (tag?.format)\n node.format = tag.format;\n return node;\n}\n\nexports.composeCollection = composeCollection;\n","'use strict';\n\nvar Scalar = require('../nodes/Scalar.js');\n\nfunction resolveBlockScalar(ctx, scalar, onError) {\n const start = scalar.offset;\n const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);\n if (!header)\n return { value: '', type: null, comment: '', range: [start, start, start] };\n const type = header.mode === '>' ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL;\n const lines = scalar.source ? splitLines(scalar.source) : [];\n // determine the end of content & start of chomping\n let chompStart = lines.length;\n for (let i = lines.length - 1; i >= 0; --i) {\n const content = lines[i][1];\n if (content === '' || content === '\\r')\n chompStart = i;\n else\n break;\n }\n // shortcut for empty contents\n if (chompStart === 0) {\n const value = header.chomp === '+' && lines.length > 0\n ? '\\n'.repeat(Math.max(1, lines.length - 1))\n : '';\n let end = start + header.length;\n if (scalar.source)\n end += scalar.source.length;\n return { value, type, comment: header.comment, range: [start, end, end] };\n }\n // find the indentation level to trim from start\n let trimIndent = scalar.indent + header.indent;\n let offset = scalar.offset + header.length;\n let contentStart = 0;\n for (let i = 0; i < chompStart; ++i) {\n const [indent, content] = lines[i];\n if (content === '' || content === '\\r') {\n if (header.indent === 0 && indent.length > trimIndent)\n trimIndent = indent.length;\n }\n else {\n if (indent.length < trimIndent) {\n const message = 'Block scalars with more-indented leading empty lines must use an explicit indentation indicator';\n onError(offset + indent.length, 'MISSING_CHAR', message);\n }\n if (header.indent === 0)\n trimIndent = indent.length;\n contentStart = i;\n if (trimIndent === 0 && !ctx.atRoot) {\n const message = 'Block scalar values in collections must be indented';\n onError(offset, 'BAD_INDENT', message);\n }\n break;\n }\n offset += indent.length + content.length + 1;\n }\n // include trailing more-indented empty lines in content\n for (let i = lines.length - 1; i >= chompStart; --i) {\n if (lines[i][0].length > trimIndent)\n chompStart = i + 1;\n }\n let value = '';\n let sep = '';\n let prevMoreIndented = false;\n // leading whitespace is kept intact\n for (let i = 0; i < contentStart; ++i)\n value += lines[i][0].slice(trimIndent) + '\\n';\n for (let i = contentStart; i < chompStart; ++i) {\n let [indent, content] = lines[i];\n offset += indent.length + content.length + 1;\n const crlf = content[content.length - 1] === '\\r';\n if (crlf)\n content = content.slice(0, -1);\n /* istanbul ignore if already caught in lexer */\n if (content && indent.length < trimIndent) {\n const src = header.indent\n ? 'explicit indentation indicator'\n : 'first line';\n const message = `Block scalar lines must not be less indented than their ${src}`;\n onError(offset - content.length - (crlf ? 2 : 1), 'BAD_INDENT', message);\n indent = '';\n }\n if (type === Scalar.Scalar.BLOCK_LITERAL) {\n value += sep + indent.slice(trimIndent) + content;\n sep = '\\n';\n }\n else if (indent.length > trimIndent || content[0] === '\\t') {\n // more-indented content within a folded block\n if (sep === ' ')\n sep = '\\n';\n else if (!prevMoreIndented && sep === '\\n')\n sep = '\\n\\n';\n value += sep + indent.slice(trimIndent) + content;\n sep = '\\n';\n prevMoreIndented = true;\n }\n else if (content === '') {\n // empty line\n if (sep === '\\n')\n value += '\\n';\n else\n sep = '\\n';\n }\n else {\n value += sep + content;\n sep = ' ';\n prevMoreIndented = false;\n }\n }\n switch (header.chomp) {\n case '-':\n break;\n case '+':\n for (let i = chompStart; i < lines.length; ++i)\n value += '\\n' + lines[i][0].slice(trimIndent);\n if (value[value.length - 1] !== '\\n')\n value += '\\n';\n break;\n default:\n value += '\\n';\n }\n const end = start + header.length + scalar.source.length;\n return { value, type, comment: header.comment, range: [start, end, end] };\n}\nfunction parseBlockScalarHeader({ offset, props }, strict, onError) {\n /* istanbul ignore if should not happen */\n if (props[0].type !== 'block-scalar-header') {\n onError(props[0], 'IMPOSSIBLE', 'Block scalar header not found');\n return null;\n }\n const { source } = props[0];\n const mode = source[0];\n let indent = 0;\n let chomp = '';\n let error = -1;\n for (let i = 1; i < source.length; ++i) {\n const ch = source[i];\n if (!chomp && (ch === '-' || ch === '+'))\n chomp = ch;\n else {\n const n = Number(ch);\n if (!indent && n)\n indent = n;\n else if (error === -1)\n error = offset + i;\n }\n }\n if (error !== -1)\n onError(error, 'UNEXPECTED_TOKEN', `Block scalar header includes extra characters: ${source}`);\n let hasSpace = false;\n let comment = '';\n let length = source.length;\n for (let i = 1; i < props.length; ++i) {\n const token = props[i];\n switch (token.type) {\n case 'space':\n hasSpace = true;\n // fallthrough\n case 'newline':\n length += token.source.length;\n break;\n case 'comment':\n if (strict && !hasSpace) {\n const message = 'Comments must be separated from other tokens by white space characters';\n onError(token, 'MISSING_CHAR', message);\n }\n length += token.source.length;\n comment = token.source.substring(1);\n break;\n case 'error':\n onError(token, 'UNEXPECTED_TOKEN', token.message);\n length += token.source.length;\n break;\n /* istanbul ignore next should not happen */\n default: {\n const message = `Unexpected token in block scalar header: ${token.type}`;\n onError(token, 'UNEXPECTED_TOKEN', message);\n const ts = token.source;\n if (ts && typeof ts === 'string')\n length += ts.length;\n }\n }\n }\n return { mode, indent, chomp, comment, length };\n}\n/** @returns Array of lines split up as `[indent, content]` */\nfunction splitLines(source) {\n const split = source.split(/\\n( *)/);\n const first = split[0];\n const m = first.match(/^( *)/);\n const line0 = m?.[1]\n ? [m[1], first.slice(m[1].length)]\n : ['', first];\n const lines = [line0];\n for (let i = 1; i < split.length; i += 2)\n lines.push([split[i], split[i + 1]]);\n return lines;\n}\n\nexports.resolveBlockScalar = resolveBlockScalar;\n","'use strict';\n\nvar Scalar = require('../nodes/Scalar.js');\nvar resolveEnd = require('./resolve-end.js');\n\nfunction resolveFlowScalar(scalar, strict, onError) {\n const { offset, type, source, end } = scalar;\n let _type;\n let value;\n const _onError = (rel, code, msg) => onError(offset + rel, code, msg);\n switch (type) {\n case 'scalar':\n _type = Scalar.Scalar.PLAIN;\n value = plainValue(source, _onError);\n break;\n case 'single-quoted-scalar':\n _type = Scalar.Scalar.QUOTE_SINGLE;\n value = singleQuotedValue(source, _onError);\n break;\n case 'double-quoted-scalar':\n _type = Scalar.Scalar.QUOTE_DOUBLE;\n value = doubleQuotedValue(source, _onError);\n break;\n /* istanbul ignore next should not happen */\n default:\n onError(scalar, 'UNEXPECTED_TOKEN', `Expected a flow scalar value, but found: ${type}`);\n return {\n value: '',\n type: null,\n comment: '',\n range: [offset, offset + source.length, offset + source.length]\n };\n }\n const valueEnd = offset + source.length;\n const re = resolveEnd.resolveEnd(end, valueEnd, strict, onError);\n return {\n value,\n type: _type,\n comment: re.comment,\n range: [offset, valueEnd, re.offset]\n };\n}\nfunction plainValue(source, onError) {\n let badChar = '';\n switch (source[0]) {\n /* istanbul ignore next should not happen */\n case '\\t':\n badChar = 'a tab character';\n break;\n case ',':\n badChar = 'flow indicator character ,';\n break;\n case '%':\n badChar = 'directive indicator character %';\n break;\n case '|':\n case '>': {\n badChar = `block scalar indicator ${source[0]}`;\n break;\n }\n case '@':\n case '`': {\n badChar = `reserved character ${source[0]}`;\n break;\n }\n }\n if (badChar)\n onError(0, 'BAD_SCALAR_START', `Plain value cannot start with ${badChar}`);\n return foldLines(source);\n}\nfunction singleQuotedValue(source, onError) {\n if (source[source.length - 1] !== \"'\" || source.length === 1)\n onError(source.length, 'MISSING_CHAR', \"Missing closing 'quote\");\n return foldLines(source.slice(1, -1)).replace(/''/g, \"'\");\n}\nfunction foldLines(source) {\n /**\n * The negative lookbehind here and in the `re` RegExp is to\n * prevent causing a polynomial search time in certain cases.\n *\n * The try-catch is for Safari, which doesn't support this yet:\n * https://caniuse.com/js-regexp-lookbehind\n */\n let first, line;\n try {\n first = new RegExp('(.*?)(?<![ \\t])[ \\t]*\\r?\\n', 'sy');\n line = new RegExp('[ \\t]*(.*?)(?:(?<![ \\t])[ \\t]*)?\\r?\\n', 'sy');\n }\n catch {\n first = /(.*?)[ \\t]*\\r?\\n/sy;\n line = /[ \\t]*(.*?)[ \\t]*\\r?\\n/sy;\n }\n let match = first.exec(source);\n if (!match)\n return source;\n let res = match[1];\n let sep = ' ';\n let pos = first.lastIndex;\n line.lastIndex = pos;\n while ((match = line.exec(source))) {\n if (match[1] === '') {\n if (sep === '\\n')\n res += sep;\n else\n sep = '\\n';\n }\n else {\n res += sep + match[1];\n sep = ' ';\n }\n pos = line.lastIndex;\n }\n const last = /[ \\t]*(.*)/sy;\n last.lastIndex = pos;\n match = last.exec(source);\n return res + sep + (match?.[1] ?? '');\n}\nfunction doubleQuotedValue(source, onError) {\n let res = '';\n for (let i = 1; i < source.length - 1; ++i) {\n const ch = source[i];\n if (ch === '\\r' && source[i + 1] === '\\n')\n continue;\n if (ch === '\\n') {\n const { fold, offset } = foldNewline(source, i);\n res += fold;\n i = offset;\n }\n else if (ch === '\\\\') {\n let next = source[++i];\n const cc = escapeCodes[next];\n if (cc)\n res += cc;\n else if (next === '\\n') {\n // skip escaped newlines, but still trim the following line\n next = source[i + 1];\n while (next === ' ' || next === '\\t')\n next = source[++i + 1];\n }\n else if (next === '\\r' && source[i + 1] === '\\n') {\n // skip escaped CRLF newlines, but still trim the following line\n next = source[++i + 1];\n while (next === ' ' || next === '\\t')\n next = source[++i + 1];\n }\n else if (next === 'x' || next === 'u' || next === 'U') {\n const length = next === 'x' ? 2 : next === 'u' ? 4 : 8;\n res += parseCharCode(source, i + 1, length, onError);\n i += length;\n }\n else {\n const raw = source.substr(i - 1, 2);\n onError(i - 1, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);\n res += raw;\n }\n }\n else if (ch === ' ' || ch === '\\t') {\n // trim trailing whitespace\n const wsStart = i;\n let next = source[i + 1];\n while (next === ' ' || next === '\\t')\n next = source[++i + 1];\n if (next !== '\\n' && !(next === '\\r' && source[i + 2] === '\\n'))\n res += i > wsStart ? source.slice(wsStart, i + 1) : ch;\n }\n else {\n res += ch;\n }\n }\n if (source[source.length - 1] !== '\"' || source.length === 1)\n onError(source.length, 'MISSING_CHAR', 'Missing closing \"quote');\n return res;\n}\n/**\n * Fold a single newline into a space, multiple newlines to N - 1 newlines.\n * Presumes `source[offset] === '\\n'`\n */\nfunction foldNewline(source, offset) {\n let fold = '';\n let ch = source[offset + 1];\n while (ch === ' ' || ch === '\\t' || ch === '\\n' || ch === '\\r') {\n if (ch === '\\r' && source[offset + 2] !== '\\n')\n break;\n if (ch === '\\n')\n fold += '\\n';\n offset += 1;\n ch = source[offset + 1];\n }\n if (!fold)\n fold = ' ';\n return { fold, offset };\n}\nconst escapeCodes = {\n '0': '\\0', // null character\n a: '\\x07', // bell character\n b: '\\b', // backspace\n e: '\\x1b', // escape character\n f: '\\f', // form feed\n n: '\\n', // line feed\n r: '\\r', // carriage return\n t: '\\t', // horizontal tab\n v: '\\v', // vertical tab\n N: '\\u0085', // Unicode next line\n _: '\\u00a0', // Unicode non-breaking space\n L: '\\u2028', // Unicode line separator\n P: '\\u2029', // Unicode paragraph separator\n ' ': ' ',\n '\"': '\"',\n '/': '/',\n '\\\\': '\\\\',\n '\\t': '\\t'\n};\nfunction parseCharCode(source, offset, length, onError) {\n const cc = source.substr(offset, length);\n const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);\n const code = ok ? parseInt(cc, 16) : NaN;\n try {\n return String.fromCodePoint(code);\n }\n catch {\n const raw = source.substr(offset - 2, length + 2);\n onError(offset - 2, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);\n return raw;\n }\n}\n\nexports.resolveFlowScalar = resolveFlowScalar;\n","'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar Scalar = require('../nodes/Scalar.js');\nvar resolveBlockScalar = require('./resolve-block-scalar.js');\nvar resolveFlowScalar = require('./resolve-flow-scalar.js');\n\nfunction composeScalar(ctx, token, tagToken, onError) {\n const { value, type, comment, range } = token.type === 'block-scalar'\n ? resolveBlockScalar.resolveBlockScalar(ctx, token, onError)\n : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError);\n const tagName = tagToken\n ? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))\n : null;\n let tag;\n if (ctx.options.stringKeys && ctx.atKey) {\n tag = ctx.schema[identity.SCALAR];\n }\n else if (tagName)\n tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);\n else if (token.type === 'scalar')\n tag = findScalarTagByTest(ctx, value, token, onError);\n else\n tag = ctx.schema[identity.SCALAR];\n let scalar;\n try {\n const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);\n scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res);\n }\n catch (error) {\n const msg = error instanceof Error ? error.message : String(error);\n onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg);\n scalar = new Scalar.Scalar(value);\n }\n scalar.range = range;\n scalar.source = value;\n if (type)\n scalar.type = type;\n if (tagName)\n scalar.tag = tagName;\n if (tag.format)\n scalar.format = tag.format;\n if (comment)\n scalar.comment = comment;\n return scalar;\n}\nfunction findScalarTagByName(schema, value, tagName, tagToken, onError) {\n if (tagName === '!')\n return schema[identity.SCALAR]; // non-specific tag\n const matchWithTest = [];\n for (const tag of schema.tags) {\n if (!tag.collection && tag.tag === tagName) {\n if (tag.default && tag.test)\n matchWithTest.push(tag);\n else\n return tag;\n }\n }\n for (const tag of matchWithTest)\n if (tag.test?.test(value))\n return tag;\n const kt = schema.knownTags[tagName];\n if (kt && !kt.collection) {\n // Ensure that the known tag is available for stringifying,\n // but does not get used by default.\n schema.tags.push(Object.assign({}, kt, { default: false, test: undefined }));\n return kt;\n }\n onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');\n return schema[identity.SCALAR];\n}\nfunction findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {\n const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&\n tag.test?.test(value)) || schema[identity.SCALAR];\n if (schema.compat) {\n const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??\n schema[identity.SCALAR];\n if (tag.tag !== compat.tag) {\n const ts = directives.tagString(tag.tag);\n const cs = directives.tagString(compat.tag);\n const msg = `Value may be parsed as either ${ts} or ${cs}`;\n onError(token, 'TAG_RESOLVE_FAILED', msg, true);\n }\n }\n return tag;\n}\n\nexports.composeScalar = composeScalar;\n","'use strict';\n\nfunction emptyScalarPosition(offset, before, pos) {\n if (before) {\n pos ?? (pos = before.length);\n for (let i = pos - 1; i >= 0; --i) {\n let st = before[i];\n switch (st.type) {\n case 'space':\n case 'comment':\n case 'newline':\n offset -= st.source.length;\n continue;\n }\n // Technically, an empty scalar is immediately after the last non-empty\n // node, but it's more useful to place it after any whitespace.\n st = before[++i];\n while (st?.type === 'space') {\n offset += st.source.length;\n st = before[++i];\n }\n break;\n }\n }\n return offset;\n}\n\nexports.emptyScalarPosition = emptyScalarPosition;\n","'use strict';\n\nvar Alias = require('../nodes/Alias.js');\nvar identity = require('../nodes/identity.js');\nvar composeCollection = require('./compose-collection.js');\nvar composeScalar = require('./compose-scalar.js');\nvar resolveEnd = require('./resolve-end.js');\nvar utilEmptyScalarPosition = require('./util-empty-scalar-position.js');\n\nconst CN = { composeNode, composeEmptyNode };\nfunction composeNode(ctx, token, props, onError) {\n const atKey = ctx.atKey;\n const { spaceBefore, comment, anchor, tag } = props;\n let node;\n let isSrcToken = true;\n switch (token.type) {\n case 'alias':\n node = composeAlias(ctx, token, onError);\n if (anchor || tag)\n onError(token, 'ALIAS_PROPS', 'An alias node must not specify any properties');\n break;\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar':\n case 'block-scalar':\n node = composeScalar.composeScalar(ctx, token, tag, onError);\n if (anchor)\n node.anchor = anchor.source.substring(1);\n break;\n case 'block-map':\n case 'block-seq':\n case 'flow-collection':\n try {\n node = composeCollection.composeCollection(CN, ctx, token, props, onError);\n if (anchor)\n node.anchor = anchor.source.substring(1);\n }\n catch (error) {\n // Almost certainly here due to a stack overflow\n const message = error instanceof Error ? error.message : String(error);\n onError(token, 'RESOURCE_EXHAUSTION', message);\n }\n break;\n default: {\n const message = token.type === 'error'\n ? token.message\n : `Unsupported token (type: ${token.type})`;\n onError(token, 'UNEXPECTED_TOKEN', message);\n isSrcToken = false;\n }\n }\n node ?? (node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError));\n if (anchor && node.anchor === '')\n onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');\n if (atKey &&\n ctx.options.stringKeys &&\n (!identity.isScalar(node) ||\n typeof node.value !== 'string' ||\n (node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {\n const msg = 'With stringKeys, all keys must be strings';\n onError(tag ?? token, 'NON_STRING_KEY', msg);\n }\n if (spaceBefore)\n node.spaceBefore = true;\n if (comment) {\n if (token.type === 'scalar' && token.source === '')\n node.comment = comment;\n else\n node.commentBefore = comment;\n }\n // @ts-expect-error Type checking misses meaning of isSrcToken\n if (ctx.options.keepSourceTokens && isSrcToken)\n node.srcToken = token;\n return node;\n}\nfunction composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {\n const token = {\n type: 'scalar',\n offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos),\n indent: -1,\n source: ''\n };\n const node = composeScalar.composeScalar(ctx, token, tag, onError);\n if (anchor) {\n node.anchor = anchor.source.substring(1);\n if (node.anchor === '')\n onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');\n }\n if (spaceBefore)\n node.spaceBefore = true;\n if (comment) {\n node.comment = comment;\n node.range[2] = end;\n }\n return node;\n}\nfunction composeAlias({ options }, { offset, source, end }, onError) {\n const alias = new Alias.Alias(source.substring(1));\n if (alias.source === '')\n onError(offset, 'BAD_ALIAS', 'Alias cannot be an empty string');\n if (alias.source.endsWith(':'))\n onError(offset + source.length - 1, 'BAD_ALIAS', 'Alias ending in : is ambiguous', true);\n const valueEnd = offset + source.length;\n const re = resolveEnd.resolveEnd(end, valueEnd, options.strict, onError);\n alias.range = [offset, valueEnd, re.offset];\n if (re.comment)\n alias.comment = re.comment;\n return alias;\n}\n\nexports.composeEmptyNode = composeEmptyNode;\nexports.composeNode = composeNode;\n","'use strict';\n\nvar Document = require('../doc/Document.js');\nvar composeNode = require('./compose-node.js');\nvar resolveEnd = require('./resolve-end.js');\nvar resolveProps = require('./resolve-props.js');\n\nfunction composeDoc(options, directives, { offset, start, value, end }, onError) {\n const opts = Object.assign({ _directives: directives }, options);\n const doc = new Document.Document(undefined, opts);\n const ctx = {\n atKey: false,\n atRoot: true,\n directives: doc.directives,\n options: doc.options,\n schema: doc.schema\n };\n const props = resolveProps.resolveProps(start, {\n indicator: 'doc-start',\n next: value ?? end?.[0],\n offset,\n onError,\n parentIndent: 0,\n startOnNewline: true\n });\n if (props.found) {\n doc.directives.docStart = true;\n if (value &&\n (value.type === 'block-map' || value.type === 'block-seq') &&\n !props.hasNewline)\n onError(props.end, 'MISSING_CHAR', 'Block collection cannot start on same line with directives-end marker');\n }\n // @ts-expect-error If Contents is set, let's trust the user\n doc.contents = value\n ? composeNode.composeNode(ctx, value, props, onError)\n : composeNode.composeEmptyNode(ctx, props.end, start, null, props, onError);\n const contentEnd = doc.contents.range[2];\n const re = resolveEnd.resolveEnd(end, contentEnd, false, onError);\n if (re.comment)\n doc.comment = re.comment;\n doc.range = [offset, contentEnd, re.offset];\n return doc;\n}\n\nexports.composeDoc = composeDoc;\n","'use strict';\n\nvar node_process = require('process');\nvar directives = require('../doc/directives.js');\nvar Document = require('../doc/Document.js');\nvar errors = require('../errors.js');\nvar identity = require('../nodes/identity.js');\nvar composeDoc = require('./compose-doc.js');\nvar resolveEnd = require('./resolve-end.js');\n\nfunction getErrorPos(src) {\n if (typeof src === 'number')\n return [src, src + 1];\n if (Array.isArray(src))\n return src.length === 2 ? src : [src[0], src[1]];\n const { offset, source } = src;\n return [offset, offset + (typeof source === 'string' ? source.length : 1)];\n}\nfunction parsePrelude(prelude) {\n let comment = '';\n let atComment = false;\n let afterEmptyLine = false;\n for (let i = 0; i < prelude.length; ++i) {\n const source = prelude[i];\n switch (source[0]) {\n case '#':\n comment +=\n (comment === '' ? '' : afterEmptyLine ? '\\n\\n' : '\\n') +\n (source.substring(1) || ' ');\n atComment = true;\n afterEmptyLine = false;\n break;\n case '%':\n if (prelude[i + 1]?.[0] !== '#')\n i += 1;\n atComment = false;\n break;\n default:\n // This may be wrong after doc-end, but in that case it doesn't matter\n if (!atComment)\n afterEmptyLine = true;\n atComment = false;\n }\n }\n return { comment, afterEmptyLine };\n}\n/**\n * Compose a stream of CST nodes into a stream of YAML Documents.\n *\n * ```ts\n * import { Composer, Parser } from 'yaml'\n *\n * const src: string = ...\n * const tokens = new Parser().parse(src)\n * const docs = new Composer().compose(tokens)\n * ```\n */\nclass Composer {\n constructor(options = {}) {\n this.doc = null;\n this.atDirectives = false;\n this.prelude = [];\n this.errors = [];\n this.warnings = [];\n this.onError = (source, code, message, warning) => {\n const pos = getErrorPos(source);\n if (warning)\n this.warnings.push(new errors.YAMLWarning(pos, code, message));\n else\n this.errors.push(new errors.YAMLParseError(pos, code, message));\n };\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n this.directives = new directives.Directives({ version: options.version || '1.2' });\n this.options = options;\n }\n decorate(doc, afterDoc) {\n const { comment, afterEmptyLine } = parsePrelude(this.prelude);\n //console.log({ dc: doc.comment, prelude, comment })\n if (comment) {\n const dc = doc.contents;\n if (afterDoc) {\n doc.comment = doc.comment ? `${doc.comment}\\n${comment}` : comment;\n }\n else if (afterEmptyLine || doc.directives.docStart || !dc) {\n doc.commentBefore = comment;\n }\n else if (identity.isCollection(dc) && !dc.flow && dc.items.length > 0) {\n let it = dc.items[0];\n if (identity.isPair(it))\n it = it.key;\n const cb = it.commentBefore;\n it.commentBefore = cb ? `${comment}\\n${cb}` : comment;\n }\n else {\n const cb = dc.commentBefore;\n dc.commentBefore = cb ? `${comment}\\n${cb}` : comment;\n }\n }\n if (afterDoc) {\n for (let i = 0; i < this.errors.length; ++i)\n doc.errors.push(this.errors[i]);\n for (let i = 0; i < this.warnings.length; ++i)\n doc.warnings.push(this.warnings[i]);\n }\n else {\n doc.errors = this.errors;\n doc.warnings = this.warnings;\n }\n this.prelude = [];\n this.errors = [];\n this.warnings = [];\n }\n /**\n * Current stream status information.\n *\n * Mostly useful at the end of input for an empty stream.\n */\n streamInfo() {\n return {\n comment: parsePrelude(this.prelude).comment,\n directives: this.directives,\n errors: this.errors,\n warnings: this.warnings\n };\n }\n /**\n * Compose tokens into documents.\n *\n * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.\n * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.\n */\n *compose(tokens, forceDoc = false, endOffset = -1) {\n for (const token of tokens)\n yield* this.next(token);\n yield* this.end(forceDoc, endOffset);\n }\n /** Advance the composer by one CST token. */\n *next(token) {\n if (node_process.env.LOG_STREAM)\n console.dir(token, { depth: null });\n switch (token.type) {\n case 'directive':\n this.directives.add(token.source, (offset, message, warning) => {\n const pos = getErrorPos(token);\n pos[0] += offset;\n this.onError(pos, 'BAD_DIRECTIVE', message, warning);\n });\n this.prelude.push(token.source);\n this.atDirectives = true;\n break;\n case 'document': {\n const doc = composeDoc.composeDoc(this.options, this.directives, token, this.onError);\n if (this.atDirectives && !doc.directives.docStart)\n this.onError(token, 'MISSING_CHAR', 'Missing directives-end/doc-start indicator line');\n this.decorate(doc, false);\n if (this.doc)\n yield this.doc;\n this.doc = doc;\n this.atDirectives = false;\n break;\n }\n case 'byte-order-mark':\n case 'space':\n break;\n case 'comment':\n case 'newline':\n this.prelude.push(token.source);\n break;\n case 'error': {\n const msg = token.source\n ? `${token.message}: ${JSON.stringify(token.source)}`\n : token.message;\n const error = new errors.YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg);\n if (this.atDirectives || !this.doc)\n this.errors.push(error);\n else\n this.doc.errors.push(error);\n break;\n }\n case 'doc-end': {\n if (!this.doc) {\n const msg = 'Unexpected doc-end without preceding document';\n this.errors.push(new errors.YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg));\n break;\n }\n this.doc.directives.docEnd = true;\n const end = resolveEnd.resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError);\n this.decorate(this.doc, true);\n if (end.comment) {\n const dc = this.doc.comment;\n this.doc.comment = dc ? `${dc}\\n${end.comment}` : end.comment;\n }\n this.doc.range[2] = end.offset;\n break;\n }\n default:\n this.errors.push(new errors.YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', `Unsupported token ${token.type}`));\n }\n }\n /**\n * Call at end of input to yield any remaining document.\n *\n * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.\n * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.\n */\n *end(forceDoc = false, endOffset = -1) {\n if (this.doc) {\n this.decorate(this.doc, true);\n yield this.doc;\n this.doc = null;\n }\n else if (forceDoc) {\n const opts = Object.assign({ _directives: this.directives }, this.options);\n const doc = new Document.Document(undefined, opts);\n if (this.atDirectives)\n this.onError(endOffset, 'MISSING_CHAR', 'Missing directives-end indicator line');\n doc.range = [0, endOffset, endOffset];\n this.decorate(doc, false);\n yield doc;\n }\n }\n}\n\nexports.Composer = Composer;\n","'use strict';\n\nvar resolveBlockScalar = require('../compose/resolve-block-scalar.js');\nvar resolveFlowScalar = require('../compose/resolve-flow-scalar.js');\nvar errors = require('../errors.js');\nvar stringifyString = require('../stringify/stringifyString.js');\n\nfunction resolveAsScalar(token, strict = true, onError) {\n if (token) {\n const _onError = (pos, code, message) => {\n const offset = typeof pos === 'number' ? pos : Array.isArray(pos) ? pos[0] : pos.offset;\n if (onError)\n onError(offset, code, message);\n else\n throw new errors.YAMLParseError([offset, offset + 1], code, message);\n };\n switch (token.type) {\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar':\n return resolveFlowScalar.resolveFlowScalar(token, strict, _onError);\n case 'block-scalar':\n return resolveBlockScalar.resolveBlockScalar({ options: { strict } }, token, _onError);\n }\n }\n return null;\n}\n/**\n * Create a new scalar token with `value`\n *\n * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,\n * as this function does not support any schema operations and won't check for such conflicts.\n *\n * @param value The string representation of the value, which will have its content properly indented.\n * @param context.end Comments and whitespace after the end of the value, or after the block scalar header. If undefined, a newline will be added.\n * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.\n * @param context.indent The indent level of the token.\n * @param context.inFlow Is this scalar within a flow collection? This may affect the resolved type of the token's value.\n * @param context.offset The offset position of the token.\n * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.\n */\nfunction createScalarToken(value, context) {\n const { implicitKey = false, indent, inFlow = false, offset = -1, type = 'PLAIN' } = context;\n const source = stringifyString.stringifyString({ type, value }, {\n implicitKey,\n indent: indent > 0 ? ' '.repeat(indent) : '',\n inFlow,\n options: { blockQuote: true, lineWidth: -1 }\n });\n const end = context.end ?? [\n { type: 'newline', offset: -1, indent, source: '\\n' }\n ];\n switch (source[0]) {\n case '|':\n case '>': {\n const he = source.indexOf('\\n');\n const head = source.substring(0, he);\n const body = source.substring(he + 1) + '\\n';\n const props = [\n { type: 'block-scalar-header', offset, indent, source: head }\n ];\n if (!addEndtoBlockProps(props, end))\n props.push({ type: 'newline', offset: -1, indent, source: '\\n' });\n return { type: 'block-scalar', offset, indent, props, source: body };\n }\n case '\"':\n return { type: 'double-quoted-scalar', offset, indent, source, end };\n case \"'\":\n return { type: 'single-quoted-scalar', offset, indent, source, end };\n default:\n return { type: 'scalar', offset, indent, source, end };\n }\n}\n/**\n * Set the value of `token` to the given string `value`, overwriting any previous contents and type that it may have.\n *\n * Best efforts are made to retain any comments previously associated with the `token`,\n * though all contents within a collection's `items` will be overwritten.\n *\n * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,\n * as this function does not support any schema operations and won't check for such conflicts.\n *\n * @param token Any token. If it does not include an `indent` value, the value will be stringified as if it were an implicit key.\n * @param value The string representation of the value, which will have its content properly indented.\n * @param context.afterKey In most cases, values after a key should have an additional level of indentation.\n * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.\n * @param context.inFlow Being within a flow collection may affect the resolved type of the token's value.\n * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.\n */\nfunction setScalarValue(token, value, context = {}) {\n let { afterKey = false, implicitKey = false, inFlow = false, type } = context;\n let indent = 'indent' in token ? token.indent : null;\n if (afterKey && typeof indent === 'number')\n indent += 2;\n if (!type)\n switch (token.type) {\n case 'single-quoted-scalar':\n type = 'QUOTE_SINGLE';\n break;\n case 'double-quoted-scalar':\n type = 'QUOTE_DOUBLE';\n break;\n case 'block-scalar': {\n const header = token.props[0];\n if (header.type !== 'block-scalar-header')\n throw new Error('Invalid block scalar header');\n type = header.source[0] === '>' ? 'BLOCK_FOLDED' : 'BLOCK_LITERAL';\n break;\n }\n default:\n type = 'PLAIN';\n }\n const source = stringifyString.stringifyString({ type, value }, {\n implicitKey: implicitKey || indent === null,\n indent: indent !== null && indent > 0 ? ' '.repeat(indent) : '',\n inFlow,\n options: { blockQuote: true, lineWidth: -1 }\n });\n switch (source[0]) {\n case '|':\n case '>':\n setBlockScalarValue(token, source);\n break;\n case '\"':\n setFlowScalarValue(token, source, 'double-quoted-scalar');\n break;\n case \"'\":\n setFlowScalarValue(token, source, 'single-quoted-scalar');\n break;\n default:\n setFlowScalarValue(token, source, 'scalar');\n }\n}\nfunction setBlockScalarValue(token, source) {\n const he = source.indexOf('\\n');\n const head = source.substring(0, he);\n const body = source.substring(he + 1) + '\\n';\n if (token.type === 'block-scalar') {\n const header = token.props[0];\n if (header.type !== 'block-scalar-header')\n throw new Error('Invalid block scalar header');\n header.source = head;\n token.source = body;\n }\n else {\n const { offset } = token;\n const indent = 'indent' in token ? token.indent : -1;\n const props = [\n { type: 'block-scalar-header', offset, indent, source: head }\n ];\n if (!addEndtoBlockProps(props, 'end' in token ? token.end : undefined))\n props.push({ type: 'newline', offset: -1, indent, source: '\\n' });\n for (const key of Object.keys(token))\n if (key !== 'type' && key !== 'offset')\n delete token[key];\n Object.assign(token, { type: 'block-scalar', indent, props, source: body });\n }\n}\n/** @returns `true` if last token is a newline */\nfunction addEndtoBlockProps(props, end) {\n if (end)\n for (const st of end)\n switch (st.type) {\n case 'space':\n case 'comment':\n props.push(st);\n break;\n case 'newline':\n props.push(st);\n return true;\n }\n return false;\n}\nfunction setFlowScalarValue(token, source, type) {\n switch (token.type) {\n case 'scalar':\n case 'double-quoted-scalar':\n case 'single-quoted-scalar':\n token.type = type;\n token.source = source;\n break;\n case 'block-scalar': {\n const end = token.props.slice(1);\n let oa = source.length;\n if (token.props[0].type === 'block-scalar-header')\n oa -= token.props[0].source.length;\n for (const tok of end)\n tok.offset += oa;\n delete token.props;\n Object.assign(token, { type, source, end });\n break;\n }\n case 'block-map':\n case 'block-seq': {\n const offset = token.offset + source.length;\n const nl = { type: 'newline', offset, indent: token.indent, source: '\\n' };\n delete token.items;\n Object.assign(token, { type, source, end: [nl] });\n break;\n }\n default: {\n const indent = 'indent' in token ? token.indent : -1;\n const end = 'end' in token && Array.isArray(token.end)\n ? token.end.filter(st => st.type === 'space' ||\n st.type === 'comment' ||\n st.type === 'newline')\n : [];\n for (const key of Object.keys(token))\n if (key !== 'type' && key !== 'offset')\n delete token[key];\n Object.assign(token, { type, indent, source, end });\n }\n }\n}\n\nexports.createScalarToken = createScalarToken;\nexports.resolveAsScalar = resolveAsScalar;\nexports.setScalarValue = setScalarValue;\n","'use strict';\n\n/**\n * Stringify a CST document, token, or collection item\n *\n * Fair warning: This applies no validation whatsoever, and\n * simply concatenates the sources in their logical order.\n */\nconst stringify = (cst) => 'type' in cst ? stringifyToken(cst) : stringifyItem(cst);\nfunction stringifyToken(token) {\n switch (token.type) {\n case 'block-scalar': {\n let res = '';\n for (const tok of token.props)\n res += stringifyToken(tok);\n return res + token.source;\n }\n case 'block-map':\n case 'block-seq': {\n let res = '';\n for (const item of token.items)\n res += stringifyItem(item);\n return res;\n }\n case 'flow-collection': {\n let res = token.start.source;\n for (const item of token.items)\n res += stringifyItem(item);\n for (const st of token.end)\n res += st.source;\n return res;\n }\n case 'document': {\n let res = stringifyItem(token);\n if (token.end)\n for (const st of token.end)\n res += st.source;\n return res;\n }\n default: {\n let res = token.source;\n if ('end' in token && token.end)\n for (const st of token.end)\n res += st.source;\n return res;\n }\n }\n}\nfunction stringifyItem({ start, key, sep, value }) {\n let res = '';\n for (const st of start)\n res += st.source;\n if (key)\n res += stringifyToken(key);\n if (sep)\n for (const st of sep)\n res += st.source;\n if (value)\n res += stringifyToken(value);\n return res;\n}\n\nexports.stringify = stringify;\n","'use strict';\n\nconst BREAK = Symbol('break visit');\nconst SKIP = Symbol('skip children');\nconst REMOVE = Symbol('remove item');\n/**\n * Apply a visitor to a CST document or item.\n *\n * Walks through the tree (depth-first) starting from the root, calling a\n * `visitor` function with two arguments when entering each item:\n * - `item`: The current item, which included the following members:\n * - `start: SourceToken[]` – Source tokens before the key or value,\n * possibly including its anchor or tag.\n * - `key?: Token | null` – Set for pair values. May then be `null`, if\n * the key before the `:` separator is empty.\n * - `sep?: SourceToken[]` – Source tokens between the key and the value,\n * which should include the `:` map value indicator if `value` is set.\n * - `value?: Token` – The value of a sequence item, or of a map pair.\n * - `path`: The steps from the root to the current node, as an array of\n * `['key' | 'value', number]` tuples.\n *\n * The return value of the visitor may be used to control the traversal:\n * - `undefined` (default): Do nothing and continue\n * - `visit.SKIP`: Do not visit the children of this token, continue with\n * next sibling\n * - `visit.BREAK`: Terminate traversal completely\n * - `visit.REMOVE`: Remove the current item, then continue with the next one\n * - `number`: Set the index of the next step. This is useful especially if\n * the index of the current token has changed.\n * - `function`: Define the next visitor for this item. After the original\n * visitor is called on item entry, next visitors are called after handling\n * a non-empty `key` and when exiting the item.\n */\nfunction visit(cst, visitor) {\n if ('type' in cst && cst.type === 'document')\n cst = { start: cst.start, value: cst.value };\n _visit(Object.freeze([]), cst, visitor);\n}\n// Without the `as symbol` casts, TS declares these in the `visit`\n// namespace using `var`, but then complains about that because\n// `unique symbol` must be `const`.\n/** Terminate visit traversal completely */\nvisit.BREAK = BREAK;\n/** Do not visit the children of the current item */\nvisit.SKIP = SKIP;\n/** Remove the current item */\nvisit.REMOVE = REMOVE;\n/** Find the item at `path` from `cst` as the root */\nvisit.itemAtPath = (cst, path) => {\n let item = cst;\n for (const [field, index] of path) {\n const tok = item?.[field];\n if (tok && 'items' in tok) {\n item = tok.items[index];\n }\n else\n return undefined;\n }\n return item;\n};\n/**\n * Get the immediate parent collection of the item at `path` from `cst` as the root.\n *\n * Throws an error if the collection is not found, which should never happen if the item itself exists.\n */\nvisit.parentCollection = (cst, path) => {\n const parent = visit.itemAtPath(cst, path.slice(0, -1));\n const field = path[path.length - 1][0];\n const coll = parent?.[field];\n if (coll && 'items' in coll)\n return coll;\n throw new Error('Parent collection not found');\n};\nfunction _visit(path, item, visitor) {\n let ctrl = visitor(item, path);\n if (typeof ctrl === 'symbol')\n return ctrl;\n for (const field of ['key', 'value']) {\n const token = item[field];\n if (token && 'items' in token) {\n for (let i = 0; i < token.items.length; ++i) {\n const ci = _visit(Object.freeze(path.concat([[field, i]])), token.items[i], visitor);\n if (typeof ci === 'number')\n i = ci - 1;\n else if (ci === BREAK)\n return BREAK;\n else if (ci === REMOVE) {\n token.items.splice(i, 1);\n i -= 1;\n }\n }\n if (typeof ctrl === 'function' && field === 'key')\n ctrl = ctrl(item, path);\n }\n }\n return typeof ctrl === 'function' ? ctrl(item, path) : ctrl;\n}\n\nexports.visit = visit;\n","'use strict';\n\nvar cstScalar = require('./cst-scalar.js');\nvar cstStringify = require('./cst-stringify.js');\nvar cstVisit = require('./cst-visit.js');\n\n/** The byte order mark */\nconst BOM = '\\u{FEFF}';\n/** Start of doc-mode */\nconst DOCUMENT = '\\x02'; // C0: Start of Text\n/** Unexpected end of flow-mode */\nconst FLOW_END = '\\x18'; // C0: Cancel\n/** Next token is a scalar value */\nconst SCALAR = '\\x1f'; // C0: Unit Separator\n/** @returns `true` if `token` is a flow or block collection */\nconst isCollection = (token) => !!token && 'items' in token;\n/** @returns `true` if `token` is a flow or block scalar; not an alias */\nconst isScalar = (token) => !!token &&\n (token.type === 'scalar' ||\n token.type === 'single-quoted-scalar' ||\n token.type === 'double-quoted-scalar' ||\n token.type === 'block-scalar');\n/* istanbul ignore next */\n/** Get a printable representation of a lexer token */\nfunction prettyToken(token) {\n switch (token) {\n case BOM:\n return '<BOM>';\n case DOCUMENT:\n return '<DOC>';\n case FLOW_END:\n return '<FLOW_END>';\n case SCALAR:\n return '<SCALAR>';\n default:\n return JSON.stringify(token);\n }\n}\n/** Identify the type of a lexer token. May return `null` for unknown tokens. */\nfunction tokenType(source) {\n switch (source) {\n case BOM:\n return 'byte-order-mark';\n case DOCUMENT:\n return 'doc-mode';\n case FLOW_END:\n return 'flow-error-end';\n case SCALAR:\n return 'scalar';\n case '---':\n return 'doc-start';\n case '...':\n return 'doc-end';\n case '':\n case '\\n':\n case '\\r\\n':\n return 'newline';\n case '-':\n return 'seq-item-ind';\n case '?':\n return 'explicit-key-ind';\n case ':':\n return 'map-value-ind';\n case '{':\n return 'flow-map-start';\n case '}':\n return 'flow-map-end';\n case '[':\n return 'flow-seq-start';\n case ']':\n return 'flow-seq-end';\n case ',':\n return 'comma';\n }\n switch (source[0]) {\n case ' ':\n case '\\t':\n return 'space';\n case '#':\n return 'comment';\n case '%':\n return 'directive-line';\n case '*':\n return 'alias';\n case '&':\n return 'anchor';\n case '!':\n return 'tag';\n case \"'\":\n return 'single-quoted-scalar';\n case '\"':\n return 'double-quoted-scalar';\n case '|':\n case '>':\n return 'block-scalar-header';\n }\n return null;\n}\n\nexports.createScalarToken = cstScalar.createScalarToken;\nexports.resolveAsScalar = cstScalar.resolveAsScalar;\nexports.setScalarValue = cstScalar.setScalarValue;\nexports.stringify = cstStringify.stringify;\nexports.visit = cstVisit.visit;\nexports.BOM = BOM;\nexports.DOCUMENT = DOCUMENT;\nexports.FLOW_END = FLOW_END;\nexports.SCALAR = SCALAR;\nexports.isCollection = isCollection;\nexports.isScalar = isScalar;\nexports.prettyToken = prettyToken;\nexports.tokenType = tokenType;\n","'use strict';\n\nvar cst = require('./cst.js');\n\n/*\nSTART -> stream\n\nstream\n directive -> line-end -> stream\n indent + line-end -> stream\n [else] -> line-start\n\nline-end\n comment -> line-end\n newline -> .\n input-end -> END\n\nline-start\n doc-start -> doc\n doc-end -> stream\n [else] -> indent -> block-start\n\nblock-start\n seq-item-start -> block-start\n explicit-key-start -> block-start\n map-value-start -> block-start\n [else] -> doc\n\ndoc\n line-end -> line-start\n spaces -> doc\n anchor -> doc\n tag -> doc\n flow-start -> flow -> doc\n flow-end -> error -> doc\n seq-item-start -> error -> doc\n explicit-key-start -> error -> doc\n map-value-start -> doc\n alias -> doc\n quote-start -> quoted-scalar -> doc\n block-scalar-header -> line-end -> block-scalar(min) -> line-start\n [else] -> plain-scalar(false, min) -> doc\n\nflow\n line-end -> flow\n spaces -> flow\n anchor -> flow\n tag -> flow\n flow-start -> flow -> flow\n flow-end -> .\n seq-item-start -> error -> flow\n explicit-key-start -> flow\n map-value-start -> flow\n alias -> flow\n quote-start -> quoted-scalar -> flow\n comma -> flow\n [else] -> plain-scalar(true, 0) -> flow\n\nquoted-scalar\n quote-end -> .\n [else] -> quoted-scalar\n\nblock-scalar(min)\n newline + peek(indent < min) -> .\n [else] -> block-scalar(min)\n\nplain-scalar(is-flow, min)\n scalar-end(is-flow) -> .\n peek(newline + (indent < min)) -> .\n [else] -> plain-scalar(min)\n*/\nfunction isEmpty(ch) {\n switch (ch) {\n case undefined:\n case ' ':\n case '\\n':\n case '\\r':\n case '\\t':\n return true;\n default:\n return false;\n }\n}\nconst hexDigits = new Set('0123456789ABCDEFabcdef');\nconst tagChars = new Set(\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()\");\nconst flowIndicatorChars = new Set(',[]{}');\nconst invalidAnchorChars = new Set(' ,[]{}\\n\\r\\t');\nconst isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch);\n/**\n * Splits an input string into lexical tokens, i.e. smaller strings that are\n * easily identifiable by `tokens.tokenType()`.\n *\n * Lexing starts always in a \"stream\" context. Incomplete input may be buffered\n * until a complete token can be emitted.\n *\n * In addition to slices of the original input, the following control characters\n * may also be emitted:\n *\n * - `\\x02` (Start of Text): A document starts with the next token\n * - `\\x18` (Cancel): Unexpected end of flow-mode (indicates an error)\n * - `\\x1f` (Unit Separator): Next token is a scalar value\n * - `\\u{FEFF}` (Byte order mark): Emitted separately outside documents\n */\nclass Lexer {\n constructor() {\n /**\n * Flag indicating whether the end of the current buffer marks the end of\n * all input\n */\n this.atEnd = false;\n /**\n * Explicit indent set in block scalar header, as an offset from the current\n * minimum indent, so e.g. set to 1 from a header `|2+`. Set to -1 if not\n * explicitly set.\n */\n this.blockScalarIndent = -1;\n /**\n * Block scalars that include a + (keep) chomping indicator in their header\n * include trailing empty lines, which are otherwise excluded from the\n * scalar's contents.\n */\n this.blockScalarKeep = false;\n /** Current input */\n this.buffer = '';\n /**\n * Flag noting whether the map value indicator : can immediately follow this\n * node within a flow context.\n */\n this.flowKey = false;\n /** Count of surrounding flow collection levels. */\n this.flowLevel = 0;\n /**\n * Minimum level of indentation required for next lines to be parsed as a\n * part of the current scalar value.\n */\n this.indentNext = 0;\n /** Indentation level of the current line. */\n this.indentValue = 0;\n /** Position of the next \\n character. */\n this.lineEndPos = null;\n /** Stores the state of the lexer if reaching the end of incpomplete input */\n this.next = null;\n /** A pointer to `buffer`; the current position of the lexer. */\n this.pos = 0;\n }\n /**\n * Generate YAML tokens from the `source` string. If `incomplete`,\n * a part of the last line may be left as a buffer for the next call.\n *\n * @returns A generator of lexical tokens\n */\n *lex(source, incomplete = false) {\n if (source) {\n if (typeof source !== 'string')\n throw TypeError('source is not a string');\n this.buffer = this.buffer ? this.buffer + source : source;\n this.lineEndPos = null;\n }\n this.atEnd = !incomplete;\n let next = this.next ?? 'stream';\n while (next && (incomplete || this.hasChars(1)))\n next = yield* this.parseNext(next);\n }\n atLineEnd() {\n let i = this.pos;\n let ch = this.buffer[i];\n while (ch === ' ' || ch === '\\t')\n ch = this.buffer[++i];\n if (!ch || ch === '#' || ch === '\\n')\n return true;\n if (ch === '\\r')\n return this.buffer[i + 1] === '\\n';\n return false;\n }\n charAt(n) {\n return this.buffer[this.pos + n];\n }\n continueScalar(offset) {\n let ch = this.buffer[offset];\n if (this.indentNext > 0) {\n let indent = 0;\n while (ch === ' ')\n ch = this.buffer[++indent + offset];\n if (ch === '\\r') {\n const next = this.buffer[indent + offset + 1];\n if (next === '\\n' || (!next && !this.atEnd))\n return offset + indent + 1;\n }\n return ch === '\\n' || indent >= this.indentNext || (!ch && !this.atEnd)\n ? offset + indent\n : -1;\n }\n if (ch === '-' || ch === '.') {\n const dt = this.buffer.substr(offset, 3);\n if ((dt === '---' || dt === '...') && isEmpty(this.buffer[offset + 3]))\n return -1;\n }\n return offset;\n }\n getLine() {\n let end = this.lineEndPos;\n if (typeof end !== 'number' || (end !== -1 && end < this.pos)) {\n end = this.buffer.indexOf('\\n', this.pos);\n this.lineEndPos = end;\n }\n if (end === -1)\n return this.atEnd ? this.buffer.substring(this.pos) : null;\n if (this.buffer[end - 1] === '\\r')\n end -= 1;\n return this.buffer.substring(this.pos, end);\n }\n hasChars(n) {\n return this.pos + n <= this.buffer.length;\n }\n setNext(state) {\n this.buffer = this.buffer.substring(this.pos);\n this.pos = 0;\n this.lineEndPos = null;\n this.next = state;\n return null;\n }\n peek(n) {\n return this.buffer.substr(this.pos, n);\n }\n *parseNext(next) {\n switch (next) {\n case 'stream':\n return yield* this.parseStream();\n case 'line-start':\n return yield* this.parseLineStart();\n case 'block-start':\n return yield* this.parseBlockStart();\n case 'doc':\n return yield* this.parseDocument();\n case 'flow':\n return yield* this.parseFlowCollection();\n case 'quoted-scalar':\n return yield* this.parseQuotedScalar();\n case 'block-scalar':\n return yield* this.parseBlockScalar();\n case 'plain-scalar':\n return yield* this.parsePlainScalar();\n }\n }\n *parseStream() {\n let line = this.getLine();\n if (line === null)\n return this.setNext('stream');\n if (line[0] === cst.BOM) {\n yield* this.pushCount(1);\n line = line.substring(1);\n }\n if (line[0] === '%') {\n let dirEnd = line.length;\n let cs = line.indexOf('#');\n while (cs !== -1) {\n const ch = line[cs - 1];\n if (ch === ' ' || ch === '\\t') {\n dirEnd = cs - 1;\n break;\n }\n else {\n cs = line.indexOf('#', cs + 1);\n }\n }\n while (true) {\n const ch = line[dirEnd - 1];\n if (ch === ' ' || ch === '\\t')\n dirEnd -= 1;\n else\n break;\n }\n const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true));\n yield* this.pushCount(line.length - n); // possible comment\n this.pushNewline();\n return 'stream';\n }\n if (this.atLineEnd()) {\n const sp = yield* this.pushSpaces(true);\n yield* this.pushCount(line.length - sp);\n yield* this.pushNewline();\n return 'stream';\n }\n yield cst.DOCUMENT;\n return yield* this.parseLineStart();\n }\n *parseLineStart() {\n const ch = this.charAt(0);\n if (!ch && !this.atEnd)\n return this.setNext('line-start');\n if (ch === '-' || ch === '.') {\n if (!this.atEnd && !this.hasChars(4))\n return this.setNext('line-start');\n const s = this.peek(3);\n if ((s === '---' || s === '...') && isEmpty(this.charAt(3))) {\n yield* this.pushCount(3);\n this.indentValue = 0;\n this.indentNext = 0;\n return s === '---' ? 'doc' : 'stream';\n }\n }\n this.indentValue = yield* this.pushSpaces(false);\n if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1)))\n this.indentNext = this.indentValue;\n return yield* this.parseBlockStart();\n }\n *parseBlockStart() {\n const [ch0, ch1] = this.peek(2);\n if (!ch1 && !this.atEnd)\n return this.setNext('block-start');\n if ((ch0 === '-' || ch0 === '?' || ch0 === ':') && isEmpty(ch1)) {\n const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));\n this.indentNext = this.indentValue + 1;\n this.indentValue += n;\n return 'block-start';\n }\n return 'doc';\n }\n *parseDocument() {\n yield* this.pushSpaces(true);\n const line = this.getLine();\n if (line === null)\n return this.setNext('doc');\n let n = yield* this.pushIndicators();\n switch (line[n]) {\n case '#':\n yield* this.pushCount(line.length - n);\n // fallthrough\n case undefined:\n yield* this.pushNewline();\n return yield* this.parseLineStart();\n case '{':\n case '[':\n yield* this.pushCount(1);\n this.flowKey = false;\n this.flowLevel = 1;\n return 'flow';\n case '}':\n case ']':\n // this is an error\n yield* this.pushCount(1);\n return 'doc';\n case '*':\n yield* this.pushUntil(isNotAnchorChar);\n return 'doc';\n case '\"':\n case \"'\":\n return yield* this.parseQuotedScalar();\n case '|':\n case '>':\n n += yield* this.parseBlockScalarHeader();\n n += yield* this.pushSpaces(true);\n yield* this.pushCount(line.length - n);\n yield* this.pushNewline();\n return yield* this.parseBlockScalar();\n default:\n return yield* this.parsePlainScalar();\n }\n }\n *parseFlowCollection() {\n let nl, sp;\n let indent = -1;\n do {\n nl = yield* this.pushNewline();\n if (nl > 0) {\n sp = yield* this.pushSpaces(false);\n this.indentValue = indent = sp;\n }\n else {\n sp = 0;\n }\n sp += yield* this.pushSpaces(true);\n } while (nl + sp > 0);\n const line = this.getLine();\n if (line === null)\n return this.setNext('flow');\n if ((indent !== -1 && indent < this.indentNext && line[0] !== '#') ||\n (indent === 0 &&\n (line.startsWith('---') || line.startsWith('...')) &&\n isEmpty(line[3]))) {\n // Allowing for the terminal ] or } at the same (rather than greater)\n // indent level as the initial [ or { is technically invalid, but\n // failing here would be surprising to users.\n const atFlowEndMarker = indent === this.indentNext - 1 &&\n this.flowLevel === 1 &&\n (line[0] === ']' || line[0] === '}');\n if (!atFlowEndMarker) {\n // this is an error\n this.flowLevel = 0;\n yield cst.FLOW_END;\n return yield* this.parseLineStart();\n }\n }\n let n = 0;\n while (line[n] === ',') {\n n += yield* this.pushCount(1);\n n += yield* this.pushSpaces(true);\n this.flowKey = false;\n }\n n += yield* this.pushIndicators();\n switch (line[n]) {\n case undefined:\n return 'flow';\n case '#':\n yield* this.pushCount(line.length - n);\n return 'flow';\n case '{':\n case '[':\n yield* this.pushCount(1);\n this.flowKey = false;\n this.flowLevel += 1;\n return 'flow';\n case '}':\n case ']':\n yield* this.pushCount(1);\n this.flowKey = true;\n this.flowLevel -= 1;\n return this.flowLevel ? 'flow' : 'doc';\n case '*':\n yield* this.pushUntil(isNotAnchorChar);\n return 'flow';\n case '\"':\n case \"'\":\n this.flowKey = true;\n return yield* this.parseQuotedScalar();\n case ':': {\n const next = this.charAt(1);\n if (this.flowKey || isEmpty(next) || next === ',') {\n this.flowKey = false;\n yield* this.pushCount(1);\n yield* this.pushSpaces(true);\n return 'flow';\n }\n }\n // fallthrough\n default:\n this.flowKey = false;\n return yield* this.parsePlainScalar();\n }\n }\n *parseQuotedScalar() {\n const quote = this.charAt(0);\n let end = this.buffer.indexOf(quote, this.pos + 1);\n if (quote === \"'\") {\n while (end !== -1 && this.buffer[end + 1] === \"'\")\n end = this.buffer.indexOf(\"'\", end + 2);\n }\n else {\n // double-quote\n while (end !== -1) {\n let n = 0;\n while (this.buffer[end - 1 - n] === '\\\\')\n n += 1;\n if (n % 2 === 0)\n break;\n end = this.buffer.indexOf('\"', end + 1);\n }\n }\n // Only looking for newlines within the quotes\n const qb = this.buffer.substring(0, end);\n let nl = qb.indexOf('\\n', this.pos);\n if (nl !== -1) {\n while (nl !== -1) {\n const cs = this.continueScalar(nl + 1);\n if (cs === -1)\n break;\n nl = qb.indexOf('\\n', cs);\n }\n if (nl !== -1) {\n // this is an error caused by an unexpected unindent\n end = nl - (qb[nl - 1] === '\\r' ? 2 : 1);\n }\n }\n if (end === -1) {\n if (!this.atEnd)\n return this.setNext('quoted-scalar');\n end = this.buffer.length;\n }\n yield* this.pushToIndex(end + 1, false);\n return this.flowLevel ? 'flow' : 'doc';\n }\n *parseBlockScalarHeader() {\n this.blockScalarIndent = -1;\n this.blockScalarKeep = false;\n let i = this.pos;\n while (true) {\n const ch = this.buffer[++i];\n if (ch === '+')\n this.blockScalarKeep = true;\n else if (ch > '0' && ch <= '9')\n this.blockScalarIndent = Number(ch) - 1;\n else if (ch !== '-')\n break;\n }\n return yield* this.pushUntil(ch => isEmpty(ch) || ch === '#');\n }\n *parseBlockScalar() {\n let nl = this.pos - 1; // may be -1 if this.pos === 0\n let indent = 0;\n let ch;\n loop: for (let i = this.pos; (ch = this.buffer[i]); ++i) {\n switch (ch) {\n case ' ':\n indent += 1;\n break;\n case '\\n':\n nl = i;\n indent = 0;\n break;\n case '\\r': {\n const next = this.buffer[i + 1];\n if (!next && !this.atEnd)\n return this.setNext('block-scalar');\n if (next === '\\n')\n break;\n } // fallthrough\n default:\n break loop;\n }\n }\n if (!ch && !this.atEnd)\n return this.setNext('block-scalar');\n if (indent >= this.indentNext) {\n if (this.blockScalarIndent === -1)\n this.indentNext = indent;\n else {\n this.indentNext =\n this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);\n }\n do {\n const cs = this.continueScalar(nl + 1);\n if (cs === -1)\n break;\n nl = this.buffer.indexOf('\\n', cs);\n } while (nl !== -1);\n if (nl === -1) {\n if (!this.atEnd)\n return this.setNext('block-scalar');\n nl = this.buffer.length;\n }\n }\n // Trailing insufficiently indented tabs are invalid.\n // To catch that during parsing, we include them in the block scalar value.\n let i = nl + 1;\n ch = this.buffer[i];\n while (ch === ' ')\n ch = this.buffer[++i];\n if (ch === '\\t') {\n while (ch === '\\t' || ch === ' ' || ch === '\\r' || ch === '\\n')\n ch = this.buffer[++i];\n nl = i - 1;\n }\n else if (!this.blockScalarKeep) {\n do {\n let i = nl - 1;\n let ch = this.buffer[i];\n if (ch === '\\r')\n ch = this.buffer[--i];\n const lastChar = i; // Drop the line if last char not more indented\n while (ch === ' ')\n ch = this.buffer[--i];\n if (ch === '\\n' && i >= this.pos && i + 1 + indent > lastChar)\n nl = i;\n else\n break;\n } while (true);\n }\n yield cst.SCALAR;\n yield* this.pushToIndex(nl + 1, true);\n return yield* this.parseLineStart();\n }\n *parsePlainScalar() {\n const inFlow = this.flowLevel > 0;\n let end = this.pos - 1;\n let i = this.pos - 1;\n let ch;\n while ((ch = this.buffer[++i])) {\n if (ch === ':') {\n const next = this.buffer[i + 1];\n if (isEmpty(next) || (inFlow && flowIndicatorChars.has(next)))\n break;\n end = i;\n }\n else if (isEmpty(ch)) {\n let next = this.buffer[i + 1];\n if (ch === '\\r') {\n if (next === '\\n') {\n i += 1;\n ch = '\\n';\n next = this.buffer[i + 1];\n }\n else\n end = i;\n }\n if (next === '#' || (inFlow && flowIndicatorChars.has(next)))\n break;\n if (ch === '\\n') {\n const cs = this.continueScalar(i + 1);\n if (cs === -1)\n break;\n i = Math.max(i, cs - 2); // to advance, but still account for ' #'\n }\n }\n else {\n if (inFlow && flowIndicatorChars.has(ch))\n break;\n end = i;\n }\n }\n if (!ch && !this.atEnd)\n return this.setNext('plain-scalar');\n yield cst.SCALAR;\n yield* this.pushToIndex(end + 1, true);\n return inFlow ? 'flow' : 'doc';\n }\n *pushCount(n) {\n if (n > 0) {\n yield this.buffer.substr(this.pos, n);\n this.pos += n;\n return n;\n }\n return 0;\n }\n *pushToIndex(i, allowEmpty) {\n const s = this.buffer.slice(this.pos, i);\n if (s) {\n yield s;\n this.pos += s.length;\n return s.length;\n }\n else if (allowEmpty)\n yield '';\n return 0;\n }\n *pushIndicators() {\n let n = 0;\n loop: while (true) {\n switch (this.charAt(0)) {\n case '!':\n n += yield* this.pushTag();\n n += yield* this.pushSpaces(true);\n continue loop;\n case '&':\n n += yield* this.pushUntil(isNotAnchorChar);\n n += yield* this.pushSpaces(true);\n continue loop;\n case '-': // this is an error\n case '?': // this is an error outside flow collections\n case ':': {\n const inFlow = this.flowLevel > 0;\n const ch1 = this.charAt(1);\n if (isEmpty(ch1) || (inFlow && flowIndicatorChars.has(ch1))) {\n if (!inFlow)\n this.indentNext = this.indentValue + 1;\n else if (this.flowKey)\n this.flowKey = false;\n n += yield* this.pushCount(1);\n n += yield* this.pushSpaces(true);\n continue loop;\n }\n }\n }\n break loop;\n }\n return n;\n }\n *pushTag() {\n if (this.charAt(1) === '<') {\n let i = this.pos + 2;\n let ch = this.buffer[i];\n while (!isEmpty(ch) && ch !== '>')\n ch = this.buffer[++i];\n return yield* this.pushToIndex(ch === '>' ? i + 1 : i, false);\n }\n else {\n let i = this.pos + 1;\n let ch = this.buffer[i];\n while (ch) {\n if (tagChars.has(ch))\n ch = this.buffer[++i];\n else if (ch === '%' &&\n hexDigits.has(this.buffer[i + 1]) &&\n hexDigits.has(this.buffer[i + 2])) {\n ch = this.buffer[(i += 3)];\n }\n else\n break;\n }\n return yield* this.pushToIndex(i, false);\n }\n }\n *pushNewline() {\n const ch = this.buffer[this.pos];\n if (ch === '\\n')\n return yield* this.pushCount(1);\n else if (ch === '\\r' && this.charAt(1) === '\\n')\n return yield* this.pushCount(2);\n else\n return 0;\n }\n *pushSpaces(allowTabs) {\n let i = this.pos - 1;\n let ch;\n do {\n ch = this.buffer[++i];\n } while (ch === ' ' || (allowTabs && ch === '\\t'));\n const n = i - this.pos;\n if (n > 0) {\n yield this.buffer.substr(this.pos, n);\n this.pos = i;\n }\n return n;\n }\n *pushUntil(test) {\n let i = this.pos;\n let ch = this.buffer[i];\n while (!test(ch))\n ch = this.buffer[++i];\n return yield* this.pushToIndex(i, false);\n }\n}\n\nexports.Lexer = Lexer;\n","'use strict';\n\n/**\n * Tracks newlines during parsing in order to provide an efficient API for\n * determining the one-indexed `{ line, col }` position for any offset\n * within the input.\n */\nclass LineCounter {\n constructor() {\n this.lineStarts = [];\n /**\n * Should be called in ascending order. Otherwise, call\n * `lineCounter.lineStarts.sort()` before calling `linePos()`.\n */\n this.addNewLine = (offset) => this.lineStarts.push(offset);\n /**\n * Performs a binary search and returns the 1-indexed { line, col }\n * position of `offset`. If `line === 0`, `addNewLine` has never been\n * called or `offset` is before the first known newline.\n */\n this.linePos = (offset) => {\n let low = 0;\n let high = this.lineStarts.length;\n while (low < high) {\n const mid = (low + high) >> 1; // Math.floor((low + high) / 2)\n if (this.lineStarts[mid] < offset)\n low = mid + 1;\n else\n high = mid;\n }\n if (this.lineStarts[low] === offset)\n return { line: low + 1, col: 1 };\n if (low === 0)\n return { line: 0, col: offset };\n const start = this.lineStarts[low - 1];\n return { line: low, col: offset - start + 1 };\n };\n }\n}\n\nexports.LineCounter = LineCounter;\n","'use strict';\n\nvar node_process = require('process');\nvar cst = require('./cst.js');\nvar lexer = require('./lexer.js');\n\nfunction includesToken(list, type) {\n for (let i = 0; i < list.length; ++i)\n if (list[i].type === type)\n return true;\n return false;\n}\nfunction findNonEmptyIndex(list) {\n for (let i = 0; i < list.length; ++i) {\n switch (list[i].type) {\n case 'space':\n case 'comment':\n case 'newline':\n break;\n default:\n return i;\n }\n }\n return -1;\n}\nfunction isFlowToken(token) {\n switch (token?.type) {\n case 'alias':\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar':\n case 'flow-collection':\n return true;\n default:\n return false;\n }\n}\nfunction getPrevProps(parent) {\n switch (parent.type) {\n case 'document':\n return parent.start;\n case 'block-map': {\n const it = parent.items[parent.items.length - 1];\n return it.sep ?? it.start;\n }\n case 'block-seq':\n return parent.items[parent.items.length - 1].start;\n /* istanbul ignore next should not happen */\n default:\n return [];\n }\n}\n/** Note: May modify input array */\nfunction getFirstKeyStartProps(prev) {\n if (prev.length === 0)\n return [];\n let i = prev.length;\n loop: while (--i >= 0) {\n switch (prev[i].type) {\n case 'doc-start':\n case 'explicit-key-ind':\n case 'map-value-ind':\n case 'seq-item-ind':\n case 'newline':\n break loop;\n }\n }\n while (prev[++i]?.type === 'space') {\n /* loop */\n }\n return prev.splice(i, prev.length);\n}\nfunction arrayPushArray(target, source) {\n // May exhaust call stack with large `source` array\n if (source.length < 1e5)\n Array.prototype.push.apply(target, source);\n else\n for (let i = 0; i < source.length; ++i)\n target.push(source[i]);\n}\nfunction fixFlowSeqItems(fc) {\n if (fc.start.type === 'flow-seq-start') {\n for (const it of fc.items) {\n if (it.sep &&\n !it.value &&\n !includesToken(it.start, 'explicit-key-ind') &&\n !includesToken(it.sep, 'map-value-ind')) {\n if (it.key)\n it.value = it.key;\n delete it.key;\n if (isFlowToken(it.value)) {\n if (it.value.end)\n arrayPushArray(it.value.end, it.sep);\n else\n it.value.end = it.sep;\n }\n else\n arrayPushArray(it.start, it.sep);\n delete it.sep;\n }\n }\n }\n}\n/**\n * A YAML concrete syntax tree (CST) parser\n *\n * ```ts\n * const src: string = ...\n * for (const token of new Parser().parse(src)) {\n * // token: Token\n * }\n * ```\n *\n * To use the parser with a user-provided lexer:\n *\n * ```ts\n * function* parse(source: string, lexer: Lexer) {\n * const parser = new Parser()\n * for (const lexeme of lexer.lex(source))\n * yield* parser.next(lexeme)\n * yield* parser.end()\n * }\n *\n * const src: string = ...\n * const lexer = new Lexer()\n * for (const token of parse(src, lexer)) {\n * // token: Token\n * }\n * ```\n */\nclass Parser {\n /**\n * @param onNewLine - If defined, called separately with the start position of\n * each new line (in `parse()`, including the start of input).\n */\n constructor(onNewLine) {\n /** If true, space and sequence indicators count as indentation */\n this.atNewLine = true;\n /** If true, next token is a scalar value */\n this.atScalar = false;\n /** Current indentation level */\n this.indent = 0;\n /** Current offset since the start of parsing */\n this.offset = 0;\n /** On the same line with a block map key */\n this.onKeyLine = false;\n /** Top indicates the node that's currently being built */\n this.stack = [];\n /** The source of the current token, set in parse() */\n this.source = '';\n /** The type of the current token, set in parse() */\n this.type = '';\n // Must be defined after `next()`\n this.lexer = new lexer.Lexer();\n this.onNewLine = onNewLine;\n }\n /**\n * Parse `source` as a YAML stream.\n * If `incomplete`, a part of the last line may be left as a buffer for the next call.\n *\n * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens.\n *\n * @returns A generator of tokens representing each directive, document, and other structure.\n */\n *parse(source, incomplete = false) {\n if (this.onNewLine && this.offset === 0)\n this.onNewLine(0);\n for (const lexeme of this.lexer.lex(source, incomplete))\n yield* this.next(lexeme);\n if (!incomplete)\n yield* this.end();\n }\n /**\n * Advance the parser by the `source` of one lexical token.\n */\n *next(source) {\n this.source = source;\n if (node_process.env.LOG_TOKENS)\n console.log('|', cst.prettyToken(source));\n if (this.atScalar) {\n this.atScalar = false;\n yield* this.step();\n this.offset += source.length;\n return;\n }\n const type = cst.tokenType(source);\n if (!type) {\n const message = `Not a YAML token: ${source}`;\n yield* this.pop({ type: 'error', offset: this.offset, message, source });\n this.offset += source.length;\n }\n else if (type === 'scalar') {\n this.atNewLine = false;\n this.atScalar = true;\n this.type = 'scalar';\n }\n else {\n this.type = type;\n yield* this.step();\n switch (type) {\n case 'newline':\n this.atNewLine = true;\n this.indent = 0;\n if (this.onNewLine)\n this.onNewLine(this.offset + source.length);\n break;\n case 'space':\n if (this.atNewLine && source[0] === ' ')\n this.indent += source.length;\n break;\n case 'explicit-key-ind':\n case 'map-value-ind':\n case 'seq-item-ind':\n if (this.atNewLine)\n this.indent += source.length;\n break;\n case 'doc-mode':\n case 'flow-error-end':\n return;\n default:\n this.atNewLine = false;\n }\n this.offset += source.length;\n }\n }\n /** Call at end of input to push out any remaining constructions */\n *end() {\n while (this.stack.length > 0)\n yield* this.pop();\n }\n get sourceToken() {\n const st = {\n type: this.type,\n offset: this.offset,\n indent: this.indent,\n source: this.source\n };\n return st;\n }\n *step() {\n const top = this.peek(1);\n if (this.type === 'doc-end' && top?.type !== 'doc-end') {\n while (this.stack.length > 0)\n yield* this.pop();\n this.stack.push({\n type: 'doc-end',\n offset: this.offset,\n source: this.source\n });\n return;\n }\n if (!top)\n return yield* this.stream();\n switch (top.type) {\n case 'document':\n return yield* this.document(top);\n case 'alias':\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar':\n return yield* this.scalar(top);\n case 'block-scalar':\n return yield* this.blockScalar(top);\n case 'block-map':\n return yield* this.blockMap(top);\n case 'block-seq':\n return yield* this.blockSequence(top);\n case 'flow-collection':\n return yield* this.flowCollection(top);\n case 'doc-end':\n return yield* this.documentEnd(top);\n }\n /* istanbul ignore next should not happen */\n yield* this.pop();\n }\n peek(n) {\n return this.stack[this.stack.length - n];\n }\n *pop(error) {\n const token = error ?? this.stack.pop();\n /* istanbul ignore if should not happen */\n if (!token) {\n const message = 'Tried to pop an empty stack';\n yield { type: 'error', offset: this.offset, source: '', message };\n }\n else if (this.stack.length === 0) {\n yield token;\n }\n else {\n const top = this.peek(1);\n if (token.type === 'block-scalar') {\n // Block scalars use their parent rather than header indent\n token.indent = 'indent' in top ? top.indent : 0;\n }\n else if (token.type === 'flow-collection' && top.type === 'document') {\n // Ignore all indent for top-level flow collections\n token.indent = 0;\n }\n if (token.type === 'flow-collection')\n fixFlowSeqItems(token);\n switch (top.type) {\n case 'document':\n top.value = token;\n break;\n case 'block-scalar':\n top.props.push(token); // error\n break;\n case 'block-map': {\n const it = top.items[top.items.length - 1];\n if (it.value) {\n top.items.push({ start: [], key: token, sep: [] });\n this.onKeyLine = true;\n return;\n }\n else if (it.sep) {\n it.value = token;\n }\n else {\n Object.assign(it, { key: token, sep: [] });\n this.onKeyLine = !it.explicitKey;\n return;\n }\n break;\n }\n case 'block-seq': {\n const it = top.items[top.items.length - 1];\n if (it.value)\n top.items.push({ start: [], value: token });\n else\n it.value = token;\n break;\n }\n case 'flow-collection': {\n const it = top.items[top.items.length - 1];\n if (!it || it.value)\n top.items.push({ start: [], key: token, sep: [] });\n else if (it.sep)\n it.value = token;\n else\n Object.assign(it, { key: token, sep: [] });\n return;\n }\n /* istanbul ignore next should not happen */\n default:\n yield* this.pop();\n yield* this.pop(token);\n }\n if ((top.type === 'document' ||\n top.type === 'block-map' ||\n top.type === 'block-seq') &&\n (token.type === 'block-map' || token.type === 'block-seq')) {\n const last = token.items[token.items.length - 1];\n if (last &&\n !last.sep &&\n !last.value &&\n last.start.length > 0 &&\n findNonEmptyIndex(last.start) === -1 &&\n (token.indent === 0 ||\n last.start.every(st => st.type !== 'comment' || st.indent < token.indent))) {\n if (top.type === 'document')\n top.end = last.start;\n else\n top.items.push({ start: last.start });\n token.items.splice(-1, 1);\n }\n }\n }\n }\n *stream() {\n switch (this.type) {\n case 'directive-line':\n yield { type: 'directive', offset: this.offset, source: this.source };\n return;\n case 'byte-order-mark':\n case 'space':\n case 'comment':\n case 'newline':\n yield this.sourceToken;\n return;\n case 'doc-mode':\n case 'doc-start': {\n const doc = {\n type: 'document',\n offset: this.offset,\n start: []\n };\n if (this.type === 'doc-start')\n doc.start.push(this.sourceToken);\n this.stack.push(doc);\n return;\n }\n }\n yield {\n type: 'error',\n offset: this.offset,\n message: `Unexpected ${this.type} token in YAML stream`,\n source: this.source\n };\n }\n *document(doc) {\n if (doc.value)\n return yield* this.lineEnd(doc);\n switch (this.type) {\n case 'doc-start': {\n if (findNonEmptyIndex(doc.start) !== -1) {\n yield* this.pop();\n yield* this.step();\n }\n else\n doc.start.push(this.sourceToken);\n return;\n }\n case 'anchor':\n case 'tag':\n case 'space':\n case 'comment':\n case 'newline':\n doc.start.push(this.sourceToken);\n return;\n }\n const bv = this.startBlockValue(doc);\n if (bv)\n this.stack.push(bv);\n else {\n yield {\n type: 'error',\n offset: this.offset,\n message: `Unexpected ${this.type} token in YAML document`,\n source: this.source\n };\n }\n }\n *scalar(scalar) {\n if (this.type === 'map-value-ind') {\n const prev = getPrevProps(this.peek(2));\n const start = getFirstKeyStartProps(prev);\n let sep;\n if (scalar.end) {\n sep = scalar.end;\n sep.push(this.sourceToken);\n delete scalar.end;\n }\n else\n sep = [this.sourceToken];\n const map = {\n type: 'block-map',\n offset: scalar.offset,\n indent: scalar.indent,\n items: [{ start, key: scalar, sep }]\n };\n this.onKeyLine = true;\n this.stack[this.stack.length - 1] = map;\n }\n else\n yield* this.lineEnd(scalar);\n }\n *blockScalar(scalar) {\n switch (this.type) {\n case 'space':\n case 'comment':\n case 'newline':\n scalar.props.push(this.sourceToken);\n return;\n case 'scalar':\n scalar.source = this.source;\n // block-scalar source includes trailing newline\n this.atNewLine = true;\n this.indent = 0;\n if (this.onNewLine) {\n let nl = this.source.indexOf('\\n') + 1;\n while (nl !== 0) {\n this.onNewLine(this.offset + nl);\n nl = this.source.indexOf('\\n', nl) + 1;\n }\n }\n yield* this.pop();\n break;\n /* istanbul ignore next should not happen */\n default:\n yield* this.pop();\n yield* this.step();\n }\n }\n *blockMap(map) {\n const it = map.items[map.items.length - 1];\n // it.sep is true-ish if pair already has key or : separator\n switch (this.type) {\n case 'newline':\n this.onKeyLine = false;\n if (it.value) {\n const end = 'end' in it.value ? it.value.end : undefined;\n const last = Array.isArray(end) ? end[end.length - 1] : undefined;\n if (last?.type === 'comment')\n end?.push(this.sourceToken);\n else\n map.items.push({ start: [this.sourceToken] });\n }\n else if (it.sep) {\n it.sep.push(this.sourceToken);\n }\n else {\n it.start.push(this.sourceToken);\n }\n return;\n case 'space':\n case 'comment':\n if (it.value) {\n map.items.push({ start: [this.sourceToken] });\n }\n else if (it.sep) {\n it.sep.push(this.sourceToken);\n }\n else {\n if (this.atIndentedComment(it.start, map.indent)) {\n const prev = map.items[map.items.length - 2];\n const end = prev?.value?.end;\n if (Array.isArray(end)) {\n arrayPushArray(end, it.start);\n end.push(this.sourceToken);\n map.items.pop();\n return;\n }\n }\n it.start.push(this.sourceToken);\n }\n return;\n }\n if (this.indent >= map.indent) {\n const atMapIndent = !this.onKeyLine && this.indent === map.indent;\n const atNextItem = atMapIndent &&\n (it.sep || it.explicitKey) &&\n this.type !== 'seq-item-ind';\n // For empty nodes, assign newline-separated not indented empty tokens to following node\n let start = [];\n if (atNextItem && it.sep && !it.value) {\n const nl = [];\n for (let i = 0; i < it.sep.length; ++i) {\n const st = it.sep[i];\n switch (st.type) {\n case 'newline':\n nl.push(i);\n break;\n case 'space':\n break;\n case 'comment':\n if (st.indent > map.indent)\n nl.length = 0;\n break;\n default:\n nl.length = 0;\n }\n }\n if (nl.length >= 2)\n start = it.sep.splice(nl[1]);\n }\n switch (this.type) {\n case 'anchor':\n case 'tag':\n if (atNextItem || it.value) {\n start.push(this.sourceToken);\n map.items.push({ start });\n this.onKeyLine = true;\n }\n else if (it.sep) {\n it.sep.push(this.sourceToken);\n }\n else {\n it.start.push(this.sourceToken);\n }\n return;\n case 'explicit-key-ind':\n if (!it.sep && !it.explicitKey) {\n it.start.push(this.sourceToken);\n it.explicitKey = true;\n }\n else if (atNextItem || it.value) {\n start.push(this.sourceToken);\n map.items.push({ start, explicitKey: true });\n }\n else {\n this.stack.push({\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start: [this.sourceToken], explicitKey: true }]\n });\n }\n this.onKeyLine = true;\n return;\n case 'map-value-ind':\n if (it.explicitKey) {\n if (!it.sep) {\n if (includesToken(it.start, 'newline')) {\n Object.assign(it, { key: null, sep: [this.sourceToken] });\n }\n else {\n const start = getFirstKeyStartProps(it.start);\n this.stack.push({\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start, key: null, sep: [this.sourceToken] }]\n });\n }\n }\n else if (it.value) {\n map.items.push({ start: [], key: null, sep: [this.sourceToken] });\n }\n else if (includesToken(it.sep, 'map-value-ind')) {\n this.stack.push({\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start, key: null, sep: [this.sourceToken] }]\n });\n }\n else if (isFlowToken(it.key) &&\n !includesToken(it.sep, 'newline')) {\n const start = getFirstKeyStartProps(it.start);\n const key = it.key;\n const sep = it.sep;\n sep.push(this.sourceToken);\n // @ts-expect-error type guard is wrong here\n delete it.key;\n // @ts-expect-error type guard is wrong here\n delete it.sep;\n this.stack.push({\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start, key, sep }]\n });\n }\n else if (start.length > 0) {\n // Not actually at next item\n it.sep = it.sep.concat(start, this.sourceToken);\n }\n else {\n it.sep.push(this.sourceToken);\n }\n }\n else {\n if (!it.sep) {\n Object.assign(it, { key: null, sep: [this.sourceToken] });\n }\n else if (it.value || atNextItem) {\n map.items.push({ start, key: null, sep: [this.sourceToken] });\n }\n else if (includesToken(it.sep, 'map-value-ind')) {\n this.stack.push({\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start: [], key: null, sep: [this.sourceToken] }]\n });\n }\n else {\n it.sep.push(this.sourceToken);\n }\n }\n this.onKeyLine = true;\n return;\n case 'alias':\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar': {\n const fs = this.flowScalar(this.type);\n if (atNextItem || it.value) {\n map.items.push({ start, key: fs, sep: [] });\n this.onKeyLine = true;\n }\n else if (it.sep) {\n this.stack.push(fs);\n }\n else {\n Object.assign(it, { key: fs, sep: [] });\n this.onKeyLine = true;\n }\n return;\n }\n default: {\n const bv = this.startBlockValue(map);\n if (bv) {\n if (bv.type === 'block-seq') {\n if (!it.explicitKey &&\n it.sep &&\n !includesToken(it.sep, 'newline')) {\n yield* this.pop({\n type: 'error',\n offset: this.offset,\n message: 'Unexpected block-seq-ind on same line with key',\n source: this.source\n });\n return;\n }\n }\n else if (atMapIndent) {\n map.items.push({ start });\n }\n this.stack.push(bv);\n return;\n }\n }\n }\n }\n yield* this.pop();\n yield* this.step();\n }\n *blockSequence(seq) {\n const it = seq.items[seq.items.length - 1];\n switch (this.type) {\n case 'newline':\n if (it.value) {\n const end = 'end' in it.value ? it.value.end : undefined;\n const last = Array.isArray(end) ? end[end.length - 1] : undefined;\n if (last?.type === 'comment')\n end?.push(this.sourceToken);\n else\n seq.items.push({ start: [this.sourceToken] });\n }\n else\n it.start.push(this.sourceToken);\n return;\n case 'space':\n case 'comment':\n if (it.value)\n seq.items.push({ start: [this.sourceToken] });\n else {\n if (this.atIndentedComment(it.start, seq.indent)) {\n const prev = seq.items[seq.items.length - 2];\n const end = prev?.value?.end;\n if (Array.isArray(end)) {\n arrayPushArray(end, it.start);\n end.push(this.sourceToken);\n seq.items.pop();\n return;\n }\n }\n it.start.push(this.sourceToken);\n }\n return;\n case 'anchor':\n case 'tag':\n if (it.value || this.indent <= seq.indent)\n break;\n it.start.push(this.sourceToken);\n return;\n case 'seq-item-ind':\n if (this.indent !== seq.indent)\n break;\n if (it.value || includesToken(it.start, 'seq-item-ind'))\n seq.items.push({ start: [this.sourceToken] });\n else\n it.start.push(this.sourceToken);\n return;\n }\n if (this.indent > seq.indent) {\n const bv = this.startBlockValue(seq);\n if (bv) {\n this.stack.push(bv);\n return;\n }\n }\n yield* this.pop();\n yield* this.step();\n }\n *flowCollection(fc) {\n const it = fc.items[fc.items.length - 1];\n if (this.type === 'flow-error-end') {\n let top;\n do {\n yield* this.pop();\n top = this.peek(1);\n } while (top?.type === 'flow-collection');\n }\n else if (fc.end.length === 0) {\n switch (this.type) {\n case 'comma':\n case 'explicit-key-ind':\n if (!it || it.sep)\n fc.items.push({ start: [this.sourceToken] });\n else\n it.start.push(this.sourceToken);\n return;\n case 'map-value-ind':\n if (!it || it.value)\n fc.items.push({ start: [], key: null, sep: [this.sourceToken] });\n else if (it.sep)\n it.sep.push(this.sourceToken);\n else\n Object.assign(it, { key: null, sep: [this.sourceToken] });\n return;\n case 'space':\n case 'comment':\n case 'newline':\n case 'anchor':\n case 'tag':\n if (!it || it.value)\n fc.items.push({ start: [this.sourceToken] });\n else if (it.sep)\n it.sep.push(this.sourceToken);\n else\n it.start.push(this.sourceToken);\n return;\n case 'alias':\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar': {\n const fs = this.flowScalar(this.type);\n if (!it || it.value)\n fc.items.push({ start: [], key: fs, sep: [] });\n else if (it.sep)\n this.stack.push(fs);\n else\n Object.assign(it, { key: fs, sep: [] });\n return;\n }\n case 'flow-map-end':\n case 'flow-seq-end':\n fc.end.push(this.sourceToken);\n return;\n }\n const bv = this.startBlockValue(fc);\n /* istanbul ignore else should not happen */\n if (bv)\n this.stack.push(bv);\n else {\n yield* this.pop();\n yield* this.step();\n }\n }\n else {\n const parent = this.peek(2);\n if (parent.type === 'block-map' &&\n ((this.type === 'map-value-ind' && parent.indent === fc.indent) ||\n (this.type === 'newline' &&\n !parent.items[parent.items.length - 1].sep))) {\n yield* this.pop();\n yield* this.step();\n }\n else if (this.type === 'map-value-ind' &&\n parent.type !== 'flow-collection') {\n const prev = getPrevProps(parent);\n const start = getFirstKeyStartProps(prev);\n fixFlowSeqItems(fc);\n const sep = fc.end.splice(1, fc.end.length);\n sep.push(this.sourceToken);\n const map = {\n type: 'block-map',\n offset: fc.offset,\n indent: fc.indent,\n items: [{ start, key: fc, sep }]\n };\n this.onKeyLine = true;\n this.stack[this.stack.length - 1] = map;\n }\n else {\n yield* this.lineEnd(fc);\n }\n }\n }\n flowScalar(type) {\n if (this.onNewLine) {\n let nl = this.source.indexOf('\\n') + 1;\n while (nl !== 0) {\n this.onNewLine(this.offset + nl);\n nl = this.source.indexOf('\\n', nl) + 1;\n }\n }\n return {\n type,\n offset: this.offset,\n indent: this.indent,\n source: this.source\n };\n }\n startBlockValue(parent) {\n switch (this.type) {\n case 'alias':\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar':\n return this.flowScalar(this.type);\n case 'block-scalar-header':\n return {\n type: 'block-scalar',\n offset: this.offset,\n indent: this.indent,\n props: [this.sourceToken],\n source: ''\n };\n case 'flow-map-start':\n case 'flow-seq-start':\n return {\n type: 'flow-collection',\n offset: this.offset,\n indent: this.indent,\n start: this.sourceToken,\n items: [],\n end: []\n };\n case 'seq-item-ind':\n return {\n type: 'block-seq',\n offset: this.offset,\n indent: this.indent,\n items: [{ start: [this.sourceToken] }]\n };\n case 'explicit-key-ind': {\n this.onKeyLine = true;\n const prev = getPrevProps(parent);\n const start = getFirstKeyStartProps(prev);\n start.push(this.sourceToken);\n return {\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start, explicitKey: true }]\n };\n }\n case 'map-value-ind': {\n this.onKeyLine = true;\n const prev = getPrevProps(parent);\n const start = getFirstKeyStartProps(prev);\n return {\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start, key: null, sep: [this.sourceToken] }]\n };\n }\n }\n return null;\n }\n atIndentedComment(start, indent) {\n if (this.type !== 'comment')\n return false;\n if (this.indent <= indent)\n return false;\n return start.every(st => st.type === 'newline' || st.type === 'space');\n }\n *documentEnd(docEnd) {\n if (this.type !== 'doc-mode') {\n if (docEnd.end)\n docEnd.end.push(this.sourceToken);\n else\n docEnd.end = [this.sourceToken];\n if (this.type === 'newline')\n yield* this.pop();\n }\n }\n *lineEnd(token) {\n switch (this.type) {\n case 'comma':\n case 'doc-start':\n case 'doc-end':\n case 'flow-seq-end':\n case 'flow-map-end':\n case 'map-value-ind':\n yield* this.pop();\n yield* this.step();\n break;\n case 'newline':\n this.onKeyLine = false;\n // fallthrough\n case 'space':\n case 'comment':\n default:\n // all other values are errors\n if (token.end)\n token.end.push(this.sourceToken);\n else\n token.end = [this.sourceToken];\n if (this.type === 'newline')\n yield* this.pop();\n }\n }\n}\n\nexports.Parser = Parser;\n","'use strict';\n\nvar composer = require('./compose/composer.js');\nvar Document = require('./doc/Document.js');\nvar errors = require('./errors.js');\nvar log = require('./log.js');\nvar identity = require('./nodes/identity.js');\nvar lineCounter = require('./parse/line-counter.js');\nvar parser = require('./parse/parser.js');\n\nfunction parseOptions(options) {\n const prettyErrors = options.prettyErrors !== false;\n const lineCounter$1 = options.lineCounter || (prettyErrors && new lineCounter.LineCounter()) || null;\n return { lineCounter: lineCounter$1, prettyErrors };\n}\n/**\n * Parse the input as a stream of YAML documents.\n *\n * Documents should be separated from each other by `...` or `---` marker lines.\n *\n * @returns If an empty `docs` array is returned, it will be of type\n * EmptyStream and contain additional stream information. In\n * TypeScript, you should use `'empty' in docs` as a type guard for it.\n */\nfunction parseAllDocuments(source, options = {}) {\n const { lineCounter, prettyErrors } = parseOptions(options);\n const parser$1 = new parser.Parser(lineCounter?.addNewLine);\n const composer$1 = new composer.Composer(options);\n const docs = Array.from(composer$1.compose(parser$1.parse(source)));\n if (prettyErrors && lineCounter)\n for (const doc of docs) {\n doc.errors.forEach(errors.prettifyError(source, lineCounter));\n doc.warnings.forEach(errors.prettifyError(source, lineCounter));\n }\n if (docs.length > 0)\n return docs;\n return Object.assign([], { empty: true }, composer$1.streamInfo());\n}\n/** Parse an input string into a single YAML.Document */\nfunction parseDocument(source, options = {}) {\n const { lineCounter, prettyErrors } = parseOptions(options);\n const parser$1 = new parser.Parser(lineCounter?.addNewLine);\n const composer$1 = new composer.Composer(options);\n // `doc` is always set by compose.end(true) at the very latest\n let doc = null;\n for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) {\n if (!doc)\n doc = _doc;\n else if (doc.options.logLevel !== 'silent') {\n doc.errors.push(new errors.YAMLParseError(_doc.range.slice(0, 2), 'MULTIPLE_DOCS', 'Source contains multiple documents; please use YAML.parseAllDocuments()'));\n break;\n }\n }\n if (prettyErrors && lineCounter) {\n doc.errors.forEach(errors.prettifyError(source, lineCounter));\n doc.warnings.forEach(errors.prettifyError(source, lineCounter));\n }\n return doc;\n}\nfunction parse(src, reviver, options) {\n let _reviver = undefined;\n if (typeof reviver === 'function') {\n _reviver = reviver;\n }\n else if (options === undefined && reviver && typeof reviver === 'object') {\n options = reviver;\n }\n const doc = parseDocument(src, options);\n if (!doc)\n return null;\n doc.warnings.forEach(warning => log.warn(doc.options.logLevel, warning));\n if (doc.errors.length > 0) {\n if (doc.options.logLevel !== 'silent')\n throw doc.errors[0];\n else\n doc.errors = [];\n }\n return doc.toJS(Object.assign({ reviver: _reviver }, options));\n}\nfunction stringify(value, replacer, options) {\n let _replacer = null;\n if (typeof replacer === 'function' || Array.isArray(replacer)) {\n _replacer = replacer;\n }\n else if (options === undefined && replacer) {\n options = replacer;\n }\n if (typeof options === 'string')\n options = options.length;\n if (typeof options === 'number') {\n const indent = Math.round(options);\n options = indent < 1 ? undefined : indent > 8 ? { indent: 8 } : { indent };\n }\n if (value === undefined) {\n const { keepUndefined } = options ?? replacer ?? {};\n if (!keepUndefined)\n return undefined;\n }\n if (identity.isDocument(value) && !_replacer)\n return value.toString(options);\n return new Document.Document(value, _replacer, options).toString(options);\n}\n\nexports.parse = parse;\nexports.parseAllDocuments = parseAllDocuments;\nexports.parseDocument = parseDocument;\nexports.stringify = stringify;\n","'use strict';\n\nvar composer = require('./compose/composer.js');\nvar Document = require('./doc/Document.js');\nvar Schema = require('./schema/Schema.js');\nvar errors = require('./errors.js');\nvar Alias = require('./nodes/Alias.js');\nvar identity = require('./nodes/identity.js');\nvar Pair = require('./nodes/Pair.js');\nvar Scalar = require('./nodes/Scalar.js');\nvar YAMLMap = require('./nodes/YAMLMap.js');\nvar YAMLSeq = require('./nodes/YAMLSeq.js');\nvar cst = require('./parse/cst.js');\nvar lexer = require('./parse/lexer.js');\nvar lineCounter = require('./parse/line-counter.js');\nvar parser = require('./parse/parser.js');\nvar publicApi = require('./public-api.js');\nvar visit = require('./visit.js');\n\n\n\nexports.Composer = composer.Composer;\nexports.Document = Document.Document;\nexports.Schema = Schema.Schema;\nexports.YAMLError = errors.YAMLError;\nexports.YAMLParseError = errors.YAMLParseError;\nexports.YAMLWarning = errors.YAMLWarning;\nexports.Alias = Alias.Alias;\nexports.isAlias = identity.isAlias;\nexports.isCollection = identity.isCollection;\nexports.isDocument = identity.isDocument;\nexports.isMap = identity.isMap;\nexports.isNode = identity.isNode;\nexports.isPair = identity.isPair;\nexports.isScalar = identity.isScalar;\nexports.isSeq = identity.isSeq;\nexports.Pair = Pair.Pair;\nexports.Scalar = Scalar.Scalar;\nexports.YAMLMap = YAMLMap.YAMLMap;\nexports.YAMLSeq = YAMLSeq.YAMLSeq;\nexports.CST = cst;\nexports.Lexer = lexer.Lexer;\nexports.LineCounter = lineCounter.LineCounter;\nexports.Parser = parser.Parser;\nexports.parse = publicApi.parse;\nexports.parseAllDocuments = publicApi.parseAllDocuments;\nexports.parseDocument = publicApi.parseDocument;\nexports.stringify = publicApi.stringify;\nexports.visit = visit.visit;\nexports.visitAsync = visit.visitAsync;\n","import { S as listCredentialAssignmentsByTarget$1, _ as selectCredentialInstancesForScope$2, g as selectCredentialInstancesByIds$1, h as selectCredentialInstanceById$2, m as listCredentialInstancesForAssignment, v as selectCredentialInstancesForScopes$1 } from \"./store-C6DRzb2o.mjs\";\nimport { CREDENTIAL_SCOPE_TYPES, buildConnectDeeplink, graphqlIntrospectionToAppTemplate, inferGraphqlAuthFromProbe, isRecord, mcpEntityId, mcpProbeToAppTemplate, normalizeCredentialList, openApiSpecToAppTemplate } from \"@keystrokehq/shared\";\nimport { decryptCredentialPayload, encryptCredentialPayload, ensureOAuthCredentialInstance, getBoundProjectScopeId, getServerTenantScopeId, isDatabaseInitialized, selectCredentialInstanceById } from \"@keystrokehq/database\";\nimport { ensureOAuthApp, getDecryptedOAuthAppById, getDecryptedOAuthConnectionById, resolveOAuthAccessToken, saveOAuthConnection, selectOrganizationById, selectProjectById } from \"@keystrokehq/platform-database\";\nimport { readCredentialInstanceSecret } from \"@keystrokehq/secrets\";\nimport { selectCredentialInstanceById as selectCredentialInstanceById$1, selectCredentialInstancesForScope as selectCredentialInstancesForScope$1, touchCredentialInstanceLastUsed as touchCredentialInstanceLastUsed$1 } from \"@keystrokehq/credentials/store\";\nimport { jsonSchema, tool } from \"ai\";\nimport { PublicHttpUrlError, PublicHttpUrlError as PublicHttpUrlError$1, connectMcpDefinition, createToolName, defineMcp as defineMcp$1, discoverOAuthServerInfo, exchangeAuthorization, fetchPublicHttp, isHttpsUrl, mergeOAuthScopes, normalizeInputSchema, probeMcpAuth, probeMcpServerInfo, registerClient, startAuthorization } from \"@keystrokehq/mcp\";\nimport YAML from \"yaml\";\n//#region src/format-error.ts\nfunction formatCredentialErrorMessage(error, connect) {\n\tswitch (error.code) {\n\t\tcase \"missing_credentials\":\n\t\t\tif (connect) {\n\t\t\t\tconst connectUrl = buildConnectDeeplink({\n\t\t\t\t\twebUrl: connect.webUrl,\n\t\t\t\t\torgSlug: connect.orgSlug,\n\t\t\t\t\tappSlug: error.key\n\t\t\t\t});\n\t\t\t\treturn `This agent needs the \\`${error.key}\\` credential. Connect it here: ${connectUrl}`;\n\t\t\t}\n\t\t\treturn `This agent needs the \\`${error.key}\\` credential. Run \\`keystroke connect ${error.key}\\` or \\`keystroke credentials set ${error.key}\\` to configure it.`;\n\t\tcase \"needs_selection\":\n\t\t\tif (connect) {\n\t\t\t\tconst connectUrl = buildConnectDeeplink({\n\t\t\t\t\twebUrl: connect.webUrl,\n\t\t\t\t\torgSlug: connect.orgSlug,\n\t\t\t\t\tappSlug: error.key\n\t\t\t\t});\n\t\t\t\treturn `Multiple \\`${error.key}\\` credentials are available. Pick one here: ${connectUrl}`;\n\t\t\t}\n\t\t\treturn `Multiple \\`${error.key}\\` credentials are available. Pick one in the Keystroke dashboard before running this agent.`;\n\t\tcase \"oauth_not_configured\": return error.message;\n\t}\n}\n//#endregion\n//#region src/errors.ts\nvar MissingCredentialsError = class extends Error {\n\tcode = \"missing_credentials\";\n\tkey;\n\tchainAttempted;\n\tconsumer;\n\tconstructor(options) {\n\t\tsuper(`Missing credential \"${options.key}\"`);\n\t\tthis.name = \"MissingCredentialsError\";\n\t\tthis.key = options.key;\n\t\tthis.chainAttempted = options.chainAttempted;\n\t\tthis.consumer = options.consumer;\n\t}\n};\nvar NeedsSelectionError = class extends Error {\n\tcode = \"needs_selection\";\n\tkey;\n\toptions;\n\tconsumer;\n\tconstructor(options) {\n\t\tsuper(`Credential selection required for \"${options.key}\"`);\n\t\tthis.name = \"NeedsSelectionError\";\n\t\tthis.key = options.key;\n\t\tthis.options = options.options;\n\t\tthis.consumer = options.consumer;\n\t}\n};\nvar OAuthNotConfiguredError = class extends Error {\n\tcode = \"oauth_not_configured\";\n\tconstructor(message = \"OAuth token adapter is not configured\") {\n\t\tsuper(message);\n\t\tthis.name = \"OAuthNotConfiguredError\";\n\t}\n};\nvar CredentialAccessDeniedError = class extends Error {\n\tcode = \"credential_access_denied\";\n\tinstanceId;\n\tconstructor(instanceId) {\n\t\tsuper(`Credential instance \"${instanceId}\" is not accessible in this run context`);\n\t\tthis.name = \"CredentialAccessDeniedError\";\n\t\tthis.instanceId = instanceId;\n\t}\n};\nfunction isCredentialError(error) {\n\treturn error instanceof MissingCredentialsError || error instanceof NeedsSelectionError || error instanceof OAuthNotConfiguredError;\n}\nfunction credentialScopeMatchesContext(scopeType, scopeId, context) {\n\tswitch (scopeType) {\n\t\tcase \"organization\": return scopeId === context.orgId;\n\t\tcase \"project\": return scopeId === context.projectId;\n\t\tcase \"user\": return scopeId === context.userId;\n\t}\n}\n//#endregion\n//#region src/backend/local.ts\nfunction createLocalCredentialBackend(options = {}) {\n\tconst { tokenRefresh } = options;\n\treturn {\n\t\tasync resolveApiKey(instanceId, schema) {\n\t\t\tconst row = await selectCredentialInstanceById(instanceId);\n\t\t\tif (!row) throw new MissingCredentialsError({\n\t\t\t\tkey: instanceId,\n\t\t\t\tchainAttempted: [\"api_key\"]\n\t\t\t});\n\t\t\tif (row.ciphertext) {\n\t\t\t\tconst plaintext = decryptCredentialPayload(row.ciphertext);\n\t\t\t\treturn schema.parse(JSON.parse(plaintext));\n\t\t\t}\n\t\t\tconst secret = await readCredentialInstanceSecret(instanceId);\n\t\t\tif (secret) return schema.parse(JSON.parse(secret));\n\t\t\tthrow new MissingCredentialsError({\n\t\t\t\tkey: row.appSlug,\n\t\t\t\tchainAttempted: [\"api_key\"]\n\t\t\t});\n\t\t},\n\t\tasync getOAuthAccessToken(connectionId) {\n\t\t\tconst connection = await getDecryptedOAuthConnectionById(connectionId);\n\t\t\tif (!connection) throw new Error(`OAuth connection not found: ${connectionId}`);\n\t\t\tconst app = await getDecryptedOAuthAppById(connection.appId);\n\t\t\tif (!app) throw new Error(`OAuth app not found for connection: ${connectionId}`);\n\t\t\treturn { accessToken: await resolveOAuthAccessToken(connection, app, tokenRefresh) };\n\t\t}\n\t};\n}\n//#endregion\n//#region src/backend/platform.ts\nfunction materializeUrl(baseUrl, projectId) {\n\treturn `${baseUrl}/internal/projects/${encodeURIComponent(projectId)}/credentials/materialize`;\n}\nfunction requireProjectScopeId() {\n\tconst projectId = getBoundProjectScopeId();\n\tif (!projectId) throw new Error(\"Credential backend requires project scope\");\n\treturn projectId;\n}\nfunction createPlatformCredentialBackend(options) {\n\tconst baseUrl = options.platformUrl.replace(/\\/+$/, \"\");\n\tasync function materialize(body) {\n\t\tconst response = await fetch(materializeUrl(baseUrl, requireProjectScopeId()), {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\tAuthorization: `Bearer ${options.workerToken}`,\n\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(body)\n\t\t});\n\t\tif (!response.ok) {\n\t\t\tconst payload = await response.json().catch(() => null);\n\t\t\tthrow new Error(payload?.message ?? `Platform credential materialize failed (${response.status})`);\n\t\t}\n\t\tconst payload = await response.json();\n\t\tif (payload.kind === \"api_key\") return { value: payload.value };\n\t\treturn { accessToken: payload.accessToken };\n\t}\n\treturn {\n\t\tasync resolveApiKey(instanceId, schema) {\n\t\t\tconst { value } = await materialize({\n\t\t\t\tkind: \"api_key\",\n\t\t\t\tinstanceId\n\t\t\t});\n\t\t\treturn schema.parse(value);\n\t\t},\n\t\tasync getOAuthAccessToken(connectionId) {\n\t\t\tconst { accessToken } = await materialize({\n\t\t\t\tkind: \"oauth\",\n\t\t\t\tconnectionId\n\t\t\t});\n\t\t\tif (!accessToken) throw new Error(`Platform did not return an access token for connection: ${connectionId}`);\n\t\t\treturn { accessToken };\n\t\t}\n\t};\n}\n//#endregion\n//#region src/backend/create-backend.ts\n/**\n* A hosted worker is identified by the platform connection it must route through:\n* `PLATFORM_URL` + `WORKER_INTERNAL_TOKEN`. Workers never hold the decryption key, so\n* they always materialize secrets over the platform internal API; everything else\n* (platform process, standalone CLI) resolves locally against its own database.\n*\n* Org workers share one platform backend; project id comes from async job scope at\n* resolve time, not from env.\n*/\nfunction isWorkerRuntime(env = process.env) {\n\treturn Boolean(env.WORKER_INTERNAL_TOKEN?.trim() && env.PLATFORM_URL?.trim());\n}\nfunction createCredentialBackend(options = {}) {\n\tif (isWorkerRuntime()) return createPlatformCredentialBackend({\n\t\tplatformUrl: process.env.PLATFORM_URL.trim(),\n\t\tworkerToken: process.env.WORKER_INTERNAL_TOKEN.trim()\n\t});\n\treturn createLocalCredentialBackend(options);\n}\n//#endregion\n//#region src/resolve-agent-connect-context.ts\n/**\n* Web connect context (org slug + web URL) for the current project scope, or\n* `null` when unavailable — standalone, no bound project scope, or no\n* `PUBLIC_WEB_URL`. Org slug comes from the platform internal API on workers\n* (no decryption key, so no direct DB), otherwise the platform DB.\n*/\nasync function resolveAgentConnectContext() {\n\tconst projectId = getBoundProjectScopeId();\n\tif (!projectId) return null;\n\tconst webUrl = process.env.PUBLIC_WEB_URL?.trim();\n\tif (!webUrl) return null;\n\tconst orgSlug = await resolveOrgSlug(projectId);\n\tif (!orgSlug) return null;\n\treturn {\n\t\torgSlug,\n\t\twebUrl\n\t};\n}\nasync function resolveOrgSlug(projectId) {\n\tif (isWorkerRuntime()) return fetchOrgSlugFromPlatform(projectId);\n\tconst project = await selectProjectById(projectId);\n\tif (!project) return null;\n\treturn (await selectOrganizationById(project.organizationId))?.slug.trim() || null;\n}\nasync function fetchOrgSlugFromPlatform(projectId) {\n\tconst platformUrl = process.env.PLATFORM_URL?.trim();\n\tconst workerToken = process.env.WORKER_INTERNAL_TOKEN?.trim();\n\tif (!platformUrl || !workerToken) return null;\n\tconst baseUrl = platformUrl.replace(/\\/+$/, \"\");\n\tconst response = await fetch(`${baseUrl}/internal/projects/${encodeURIComponent(projectId)}/connect-context`, { headers: { Authorization: `Bearer ${workerToken}` } });\n\tif (!response.ok) return null;\n\treturn (await response.json()).orgSlug?.trim() || null;\n}\n//#endregion\n//#region src/enrich-credential-error.ts\n/** Rewrite a credential error message with a web connect deeplink when context is available. */\nasync function enrichCredentialError(error) {\n\ttry {\n\t\terror.message = formatCredentialErrorMessage(error, await resolveAgentConnectContext() ?? void 0);\n\t} catch {}\n}\n//#endregion\n//#region src/capture-credential-tool-errors.ts\n/**\n* Wrap tool `execute`s so a thrown credential error is captured (and enriched\n* with a connect deeplink) before propagating. Covers both keystroke\n* {@link AgentTool}s and native AI SDK MCP tools — MCP tools resolve credentials\n* lazily inside their own `execute`, so they need the same wrapper to surface\n* missing-credential failures for workflow retry.\n*/\nfunction captureCredentialToolErrors(tools, toolSet = {}) {\n\tlet captured;\n\tconst onError = async (error) => {\n\t\tif (isCredentialError(error)) {\n\t\t\tcaptured = error;\n\t\t\tawait enrichCredentialError(error);\n\t\t}\n\t};\n\tconst wrapped = tools.map((tool) => {\n\t\tif (!tool.execute) return tool;\n\t\tconst execute = tool.execute.bind(tool);\n\t\treturn {\n\t\t\t...tool,\n\t\t\tasync execute(...args) {\n\t\t\t\ttry {\n\t\t\t\t\treturn await execute(...args);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tawait onError(error);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t});\n\tconst wrappedToolSet = {};\n\tfor (const [name, mcpTool] of Object.entries(toolSet)) {\n\t\tconst execute = mcpTool.execute;\n\t\tif (!execute) {\n\t\t\twrappedToolSet[name] = mcpTool;\n\t\t\tcontinue;\n\t\t}\n\t\twrappedToolSet[name] = {\n\t\t\t...mcpTool,\n\t\t\texecute: async (input, options) => {\n\t\t\t\ttry {\n\t\t\t\t\treturn await execute(input, options);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tawait onError(error);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\treturn {\n\t\ttools: wrapped,\n\t\ttoolSet: wrappedToolSet,\n\t\ttakeCredentialError: () => {\n\t\t\tconst error = captured;\n\t\t\tcaptured = void 0;\n\t\t\treturn error;\n\t\t}\n\t};\n}\n//#endregion\n//#region src/assignments.ts\nconst EMPTY_ASSIGNMENT_SET = {\n\tbyConsumer: {},\n\twildcard: {}\n};\nfunction selectAssignedInstanceId(assignments, consumerId, credentialSlug) {\n\tif (!assignments) return;\n\tif (consumerId) {\n\t\tconst specific = assignments.byConsumer[consumerId]?.[credentialSlug];\n\t\tif (specific) return specific;\n\t}\n\treturn assignments.wildcard[credentialSlug];\n}\nfunction buildAssignmentSet(rows) {\n\tconst byConsumer = {};\n\tconst wildcard = {};\n\tfor (const row of rows) {\n\t\tif (row.consumerId === \"*\") {\n\t\t\twildcard[row.credentialSlug] = row.instanceId;\n\t\t\tcontinue;\n\t\t}\n\t\tconst bucket = byConsumer[row.consumerId] ?? {};\n\t\tbucket[row.credentialSlug] = row.instanceId;\n\t\tbyConsumer[row.consumerId] = bucket;\n\t}\n\treturn {\n\t\tbyConsumer,\n\t\twildcard\n\t};\n}\nasync function loadCredentialAssignments(options) {\n\tif (!isDatabaseInitialized()) return EMPTY_ASSIGNMENT_SET;\n\treturn buildAssignmentSet(await listCredentialAssignmentsByTarget$1(options));\n}\nasync function withCredentialAssignments(context, options) {\n\tconst assignments = await loadCredentialAssignments(options);\n\treturn {\n\t\t...context,\n\t\tassignments\n\t};\n}\n//#endregion\n//#region src/resolve-keystroke-instance.ts\nfunction pickKeystrokeInstanceRow(rows, key, consumer) {\n\tif (rows.length === 0) return;\n\tif (rows.length === 1) return rows[0];\n\tconst defaults = rows.filter((row) => row.isDefault);\n\tif (defaults.length === 1) return defaults[0];\n\tif (consumer !== void 0) throw new NeedsSelectionError({\n\t\tkey,\n\t\toptions: rows.map((row) => ({\n\t\t\tid: row.id,\n\t\t\tlabel: row.name ?? row.label,\n\t\t\tscopeType: row.scopeType,\n\t\t\tscopeId: row.scopeId\n\t\t})),\n\t\tconsumer\n\t});\n\treturn rows.find((row) => row.isDefault) ?? rows[0];\n}\nasync function resolveAssignedKeystrokeInstance(app, assignments, consumerId) {\n\tconst assignedId = selectAssignedInstanceId(assignments, consumerId, app);\n\tif (!assignedId) return;\n\tconst row = await selectCredentialInstanceById$2(assignedId);\n\tif (!row || row.authKind !== \"keystroke\" || !row.connectionId || row.appSlug !== app) return;\n\treturn {\n\t\tinstanceId: assignedId,\n\t\tscopeType: row.scopeType,\n\t\tscopeId: row.scopeId\n\t};\n}\n/** Assignment lookup (when assignments provided) then ordered scope walk. User scope only when included in scopes. */\nasync function resolveKeystrokeInstanceId(options) {\n\tif (options.credentialSlug) {\n\t\tfor (const [scopeType, scopeId] of options.scopes) {\n\t\t\tconst match = (await selectCredentialInstancesForScope$2(options.app, scopeType, scopeId)).filter((row) => row.authKind === \"keystroke\" && row.connectionId).find((row) => row.slug === options.credentialSlug);\n\t\t\tif (match) return {\n\t\t\t\tinstanceId: match.id,\n\t\t\t\tscopeType: match.scopeType,\n\t\t\t\tscopeId: match.scopeId\n\t\t\t};\n\t\t}\n\t\treturn;\n\t}\n\tconst assignments = options.assignments ?? (options.assignmentTarget ? await loadCredentialAssignments({\n\t\ttargetType: options.assignmentTarget.type,\n\t\ttargetKey: options.assignmentTarget.key\n\t}) : void 0);\n\tif (assignments) {\n\t\tconst assigned = await resolveAssignedKeystrokeInstance(options.app, assignments, options.consumerId);\n\t\tif (assigned) return assigned;\n\t}\n\tfor (const [scopeType, scopeId] of options.scopes) {\n\t\tconst row = pickKeystrokeInstanceRow((await selectCredentialInstancesForScope$2(options.app, scopeType, scopeId)).filter((row) => row.authKind === \"keystroke\" && row.connectionId), options.app, options.consumer);\n\t\tif (row) return {\n\t\t\tinstanceId: row.id,\n\t\t\tscopeType: row.scopeType,\n\t\t\tscopeId: row.scopeId\n\t\t};\n\t}\n}\n//#endregion\n//#region src/describe-credential-binding.ts\nfunction toSummary(row) {\n\treturn {\n\t\tid: row.id,\n\t\tappSlug: row.appSlug,\n\t\tname: row.name,\n\t\tlabel: row.label,\n\t\tscopeType: row.scopeType,\n\t\tscopeId: row.scopeId,\n\t\tisDefault: row.isDefault\n\t};\n}\nfunction scopeCacheKey(appSlug, scopeType, scopeId) {\n\treturn `${appSlug}\\0${scopeType}\\0${scopeId}`;\n}\n/** Pick the single instance for a scope: the only one, or the unique default; else ambiguous. */\nfunction pickInstance$1(rows) {\n\tif (rows.length === 0) return { kind: \"none\" };\n\tif (rows.length === 1) return {\n\t\tkind: \"row\",\n\t\trow: rows[0]\n\t};\n\tconst defaults = rows.filter((row) => row.isDefault);\n\tif (defaults.length === 1) return {\n\t\tkind: \"row\",\n\t\trow: defaults[0]\n\t};\n\treturn { kind: \"needs-selection\" };\n}\nfunction scopeIdFor(scope, context, orgId) {\n\tswitch (scope) {\n\t\tcase \"organization\": return orgId;\n\t\tcase \"project\": return context.projectId;\n\t\tcase \"user\": return context.userId;\n\t}\n}\nfunction describeFromPreload(options, preload) {\n\tconst { key, scope, consumerId, context } = options;\n\tconst orgId = context.orgId ?? getServerTenantScopeId();\n\tconst assignedId = selectAssignedInstanceId(context.assignments, consumerId, key);\n\tif (assignedId) {\n\t\tconst row = preload.byId.get(assignedId);\n\t\tif (row && row.appSlug === key) return {\n\t\t\tpolicy: \"assigned\",\n\t\t\trow: toSummary(row)\n\t\t};\n\t}\n\tif (scope) {\n\t\tconst scopeId = scopeIdFor(scope, context, orgId);\n\t\tconst picked = scopeId ? pickInstance$1(preload.byScope.get(scopeCacheKey(key, scope, scopeId)) ?? []) : { kind: \"none\" };\n\t\tif (picked.kind === \"row\") return {\n\t\t\tpolicy: \"scope-pinned\",\n\t\t\tpinnedScope: scope,\n\t\t\trow: toSummary(picked.row)\n\t\t};\n\t\treturn {\n\t\t\tpolicy: \"unresolved\",\n\t\t\treason: picked.kind === \"needs-selection\" ? \"needs-selection\" : \"missing\",\n\t\t\tpinnedScope: scope\n\t\t};\n\t}\n\tif (context.projectId) {\n\t\tconst picked = pickInstance$1(preload.byScope.get(scopeCacheKey(key, \"project\", context.projectId)) ?? []);\n\t\tif (picked.kind === \"row\") return {\n\t\t\tpolicy: \"project-default\",\n\t\t\trow: toSummary(picked.row)\n\t\t};\n\t\tif (picked.kind === \"needs-selection\") return {\n\t\t\tpolicy: \"unresolved\",\n\t\t\treason: \"needs-selection\"\n\t\t};\n\t}\n\tif (orgId) {\n\t\tconst picked = pickInstance$1(preload.byScope.get(scopeCacheKey(key, \"organization\", orgId)) ?? []);\n\t\tif (picked.kind === \"row\") return {\n\t\t\tpolicy: \"org-default\",\n\t\t\trow: toSummary(picked.row)\n\t\t};\n\t\tif (picked.kind === \"needs-selection\") return {\n\t\t\tpolicy: \"unresolved\",\n\t\t\treason: \"needs-selection\"\n\t\t};\n\t}\n\treturn {\n\t\tpolicy: \"unresolved\",\n\t\treason: \"missing\"\n\t};\n}\nasync function describeCredentialBinding(options) {\n\tif (options.preload) return describeFromPreload(options, options.preload);\n\tconst { key, scope, consumerId, context } = options;\n\tconst orgId = context.orgId ?? getServerTenantScopeId();\n\tconst assignedId = selectAssignedInstanceId(context.assignments, consumerId, key);\n\tif (assignedId) {\n\t\tconst row = await selectCredentialInstanceById$2(assignedId);\n\t\tif (row && row.appSlug === key) return {\n\t\t\tpolicy: \"assigned\",\n\t\t\trow: toSummary(row)\n\t\t};\n\t}\n\tif (scope) {\n\t\tconst scopeId = scopeIdFor(scope, context, orgId);\n\t\tconst picked = scopeId ? pickInstance$1(await selectCredentialInstancesForScope$2(key, scope, scopeId)) : { kind: \"none\" };\n\t\tif (picked.kind === \"row\") return {\n\t\t\tpolicy: \"scope-pinned\",\n\t\t\tpinnedScope: scope,\n\t\t\trow: toSummary(picked.row)\n\t\t};\n\t\treturn {\n\t\t\tpolicy: \"unresolved\",\n\t\t\treason: picked.kind === \"needs-selection\" ? \"needs-selection\" : \"missing\",\n\t\t\tpinnedScope: scope\n\t\t};\n\t}\n\tif (context.projectId) {\n\t\tconst picked = pickInstance$1(await selectCredentialInstancesForScope$2(key, \"project\", context.projectId));\n\t\tif (picked.kind === \"row\") return {\n\t\t\tpolicy: \"project-default\",\n\t\t\trow: toSummary(picked.row)\n\t\t};\n\t\tif (picked.kind === \"needs-selection\") return {\n\t\t\tpolicy: \"unresolved\",\n\t\t\treason: \"needs-selection\"\n\t\t};\n\t}\n\tif (orgId) {\n\t\tconst picked = pickInstance$1(await selectCredentialInstancesForScope$2(key, \"organization\", orgId));\n\t\tif (picked.kind === \"row\") return {\n\t\t\tpolicy: \"org-default\",\n\t\t\trow: toSummary(picked.row)\n\t\t};\n\t\tif (picked.kind === \"needs-selection\") return {\n\t\t\tpolicy: \"unresolved\",\n\t\t\treason: \"needs-selection\"\n\t\t};\n\t}\n\treturn {\n\t\tpolicy: \"unresolved\",\n\t\treason: \"missing\"\n\t};\n}\n/**\n* Prefetch every instance needed to resolve `requirements` against `context`,\n* then describe each binding in memory (2 DB round trips total).\n*/\nasync function describeCredentialBindings(requirements, context) {\n\tif (requirements.length === 0) return [];\n\tconst orgId = context.orgId ?? getServerTenantScopeId();\n\tconst assignedIds = /* @__PURE__ */ new Set();\n\tconst scopeKeys = /* @__PURE__ */ new Map();\n\tfor (const requirement of requirements) {\n\t\tconst assignedId = selectAssignedInstanceId(context.assignments, requirement.consumerId, requirement.key);\n\t\tif (assignedId) assignedIds.add(assignedId);\n\t\tconst addScope = (scopeType, scopeId) => {\n\t\t\tif (!scopeId) return;\n\t\t\tconst key = scopeCacheKey(requirement.key, scopeType, scopeId);\n\t\t\tif (!scopeKeys.has(key)) scopeKeys.set(key, {\n\t\t\t\tappSlug: requirement.key,\n\t\t\t\tscopeType,\n\t\t\t\tscopeId\n\t\t\t});\n\t\t};\n\t\tif (requirement.scope) addScope(requirement.scope, scopeIdFor(requirement.scope, context, orgId));\n\t\telse {\n\t\t\taddScope(\"project\", context.projectId);\n\t\t\taddScope(\"organization\", orgId);\n\t\t}\n\t}\n\tconst [assignedRows, scopeRows] = await Promise.all([selectCredentialInstancesByIds$1([...assignedIds]), selectCredentialInstancesForScopes$1([...scopeKeys.values()])]);\n\tconst byId = new Map(assignedRows.map((row) => [row.id, row]));\n\tconst byScope = /* @__PURE__ */ new Map();\n\tfor (const row of scopeRows) {\n\t\tif (!row.scopeId) continue;\n\t\tconst key = scopeCacheKey(row.appSlug, row.scopeType, row.scopeId);\n\t\tconst existing = byScope.get(key) ?? [];\n\t\texisting.push(row);\n\t\tbyScope.set(key, existing);\n\t}\n\tconst preload = {\n\t\tbyId,\n\t\tbyScope\n\t};\n\treturn requirements.map((requirement) => describeFromPreload({\n\t\tkey: requirement.key,\n\t\t...requirement.scope ? { scope: requirement.scope } : {},\n\t\tconsumerId: requirement.consumerId,\n\t\tcontext,\n\t\tpreload\n\t}, preload));\n}\n//#endregion\n//#region src/parse-credential-ref.ts\nconst UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\nconst SCOPE_PREFIXES = {\n\torg: \"organization\",\n\torganization: \"organization\",\n\tproject: \"project\",\n\tuser: \"user\"\n};\nfunction credentialScopePrefix(scopeType) {\n\tswitch (scopeType) {\n\t\tcase \"organization\": return \"org\";\n\t\tcase \"project\": return \"project\";\n\t\tcase \"user\": return \"user\";\n\t}\n}\nfunction formatCredentialRef(row) {\n\treturn `${credentialScopePrefix(row.scopeType)}/${row.slug}`;\n}\nfunction formatCredentialRefSuggestion(row) {\n\treturn `${formatCredentialRef(row)} (${row.appSlug})`;\n}\nfunction parseCredentialRef(ref) {\n\tconst trimmed = ref.trim();\n\tif (UUID_PATTERN.test(trimmed)) return {\n\t\tkind: \"uuid\",\n\t\tid: trimmed\n\t};\n\tconst parts = trimmed.split(\"/\").filter(Boolean);\n\tif (parts.length === 2) {\n\t\tconst scopeType = SCOPE_PREFIXES[parts[0].toLowerCase()];\n\t\tif (scopeType) return {\n\t\t\tkind: \"scope\",\n\t\t\tscopeType,\n\t\t\tslug: parts[1]\n\t\t};\n\t\treturn {\n\t\t\tkind: \"app\",\n\t\t\tappSlug: parts[0],\n\t\t\tslug: parts[1]\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"bare\",\n\t\tslug: trimmed\n\t};\n}\nfunction matchesCredentialRef(row, parsed) {\n\tswitch (parsed.kind) {\n\t\tcase \"uuid\": return row.id === parsed.id;\n\t\tcase \"scope\": return row.scopeType === parsed.scopeType && row.slug === parsed.slug;\n\t\tcase \"app\": return row.appSlug === parsed.appSlug && row.slug === parsed.slug;\n\t\tcase \"bare\": return row.slug === parsed.slug;\n\t}\n}\n//#endregion\n//#region src/resolve-credential-ref.ts\nfunction defaultCanAccess(_row) {\n\treturn true;\n}\n/** Resolve a friendly credential ref (uuid, bare slug, scope/slug, or app/slug). */\nasync function resolveCredentialRef(options) {\n\tconst parsed = parseCredentialRef(options.ref);\n\tconst canAccess = options.canAccess ?? defaultCanAccess;\n\tif (parsed.kind === \"uuid\") {\n\t\tconst row = await selectCredentialInstanceById$2(parsed.id);\n\t\tif (!row) return {\n\t\t\terror: \"Credential instance not found\",\n\t\t\tstatus: 404\n\t\t};\n\t\tif (!canAccess(row)) return {\n\t\t\terror: \"Forbidden\",\n\t\t\tstatus: 403\n\t\t};\n\t\treturn { row };\n\t}\n\tconst candidates = (await listCredentialInstancesForAssignment({ userId: options.userId })).filter((row) => canAccess(row) && matchesCredentialRef(row, parsed));\n\tif (candidates.length === 1) return { row: candidates[0] };\n\tif (candidates.length === 0) return {\n\t\terror: \"Credential instance not found\",\n\t\tstatus: 404\n\t};\n\tconst suggestions = candidates.map((row) => formatCredentialRefSuggestion(row)).join(\", \");\n\treturn {\n\t\terror: `Ambiguous credential \"${options.ref}\". Multiple instances match: ${suggestions}`,\n\t\tstatus: 400\n\t};\n}\nfunction canAssignCredentialInstance(row, userId, projectId) {\n\tswitch (row.scopeType) {\n\t\tcase \"user\": return userId !== void 0 && row.scopeId === userId;\n\t\tcase \"project\": return row.scopeId === projectId;\n\t\tcase \"organization\": return true;\n\t}\n}\nfunction canManageCredentialInstance(row, userId) {\n\tif (row.scopeType === \"user\") return userId !== void 0 && row.scopeId === userId;\n\treturn true;\n}\n//#endregion\n//#region src/context.ts\nfunction buildCredentialRunContext(input = {}) {\n\tconst subscription = input.subscription;\n\tconst request = input.request ?? {};\n\tconst userId = request.userId ?? subscription?.userId ?? input.actor?.userId;\n\treturn {\n\t\torgId: request.orgId ?? subscription?.orgId,\n\t\tprojectId: request.projectId ?? subscription?.projectId,\n\t\tuserId,\n\t\tuserIds: request.userIds,\n\t\tselection: {\n\t\t\t...subscription?.credentialSelection,\n\t\t\t...request.selection\n\t\t}\n\t};\n}\n//#endregion\n//#region src/project-credential-backend.ts\nlet projectCredentialBackend;\n/** Set during server bootstrap so credential resolution reuses the plugin token-refresh registry. */\nfunction setProjectCredentialBackend(backend) {\n\tprojectCredentialBackend = backend;\n}\nfunction getProjectCredentialBackend() {\n\treturn projectCredentialBackend;\n}\n//#endregion\n//#region src/resolve-vault.ts\nfunction toSelectionOption(row) {\n\treturn {\n\t\tid: row.id,\n\t\tlabel: row.name ?? row.label,\n\t\tscopeType: row.scopeType,\n\t\tscopeId: row.scopeId\n\t};\n}\nfunction resolveUserId(key, context) {\n\treturn context.userIds?.[key] ?? context.userId;\n}\nfunction pickInstance(rows, key, consumer) {\n\tif (rows.length === 0) throw new MissingCredentialsError({\n\t\tkey,\n\t\tchainAttempted: [],\n\t\tconsumer\n\t});\n\tif (rows.length === 1) return rows[0];\n\tconst defaults = rows.filter((row) => row.isDefault);\n\tif (defaults.length === 1) return defaults[0];\n\tthrow new NeedsSelectionError({\n\t\tkey,\n\t\toptions: rows.map(toSelectionOption),\n\t\tconsumer\n\t});\n}\n/** Throttle window for last-used writes so bursty runs don't hammer the same row. */\nconst LAST_USED_THROTTLE_MS = 6e4;\n/**\n* Record that a credential was just resolved. Throttled (skip when touched within\n* {@link LAST_USED_THROTTLE_MS}) and best-effort: a write failure must never break resolution.\n*/\nasync function touchLastUsed(row) {\n\tconst last = row.lastUsedAt?.getTime();\n\tif (last !== void 0 && Date.now() - last < LAST_USED_THROTTLE_MS) return;\n\ttry {\n\t\tawait touchCredentialInstanceLastUsed$1(row.id);\n\t} catch {}\n}\nasync function resolveInstanceValue(row, requirement, backend) {\n\tconst value = await materializeInstanceValue(row, requirement, backend);\n\tawait touchLastUsed(row);\n\treturn value;\n}\nasync function materializeInstanceValue(row, requirement, backend) {\n\tif (row.authKind === \"keystroke\") {\n\t\tif (!row.connectionId) throw new MissingCredentialsError({\n\t\t\tkey: row.appSlug,\n\t\t\tchainAttempted: [\"keystroke\"]\n\t\t});\n\t\tconst scopeId = row.scopeType === \"organization\" ? getServerTenantScopeId() : row.scopeId ?? \"\";\n\t\tif (!scopeId) throw new MissingCredentialsError({\n\t\t\tkey: row.appSlug,\n\t\t\tchainAttempted: [\"keystroke\"]\n\t\t});\n\t\tconst value = {\n\t\t\tconnectionId: row.connectionId,\n\t\t\tentityId: row.sharedConnectionId ?? mcpEntityId(row.scopeType, scopeId),\n\t\t\tinstanceId: row.id\n\t\t};\n\t\treturn requirement.schema.parse(value);\n\t}\n\tif (row.authKind === \"oauth_managed\") {\n\t\tif (!row.connectionId) throw new MissingCredentialsError({\n\t\t\tkey: row.appSlug,\n\t\t\tchainAttempted: [\"oauth_managed\"]\n\t\t});\n\t\tconst token = await backend.getOAuthAccessToken(row.connectionId);\n\t\tconst tokenField = requirement.tokenField ?? \"accessToken\";\n\t\tconst value = tokenField === \"accessToken\" ? token : { [tokenField]: token.accessToken };\n\t\treturn requirement.schema.parse(value);\n\t}\n\treturn backend.resolveApiKey(row.id, requirement.schema);\n}\nasync function resolveSelectedInstance(key, instanceId, context, consumer) {\n\tconst row = await selectCredentialInstanceById$1(instanceId);\n\tif (!row || row.appSlug !== key) throw new MissingCredentialsError({\n\t\tkey,\n\t\tchainAttempted: [\"selection\"],\n\t\tconsumer\n\t});\n\tif (!credentialScopeMatchesContext(row.scopeType, row.scopeId, context)) throw new CredentialAccessDeniedError(instanceId);\n\treturn row;\n}\nfunction withTenantScope(context) {\n\treturn context.orgId ? context : {\n\t\t...context,\n\t\torgId: getServerTenantScopeId()\n\t};\n}\nfunction scopeIdForScope(scope, key, context) {\n\tswitch (scope) {\n\t\tcase \"organization\": return context.orgId;\n\t\tcase \"project\": return context.projectId;\n\t\tcase \"user\": return resolveUserId(key, context);\n\t}\n}\nasync function resolveAtScope(key, scopeType, scopeId, consumer) {\n\tconst rows = await selectCredentialInstancesForScope$1(key, scopeType, scopeId);\n\tif (rows.length === 0) return;\n\treturn pickInstance(rows, key, consumer);\n}\nasync function resolveBoundInstance(instanceId, requirement, context, consumer, backend) {\n\tconst row = await selectCredentialInstanceById$1(instanceId);\n\tif (!row || row.appSlug !== requirement.key) throw new MissingCredentialsError({\n\t\tkey: requirement.key,\n\t\tchainAttempted: [\"binding\"],\n\t\tconsumer\n\t});\n\tif (!bindingTenantReachable(row, context)) throw new CredentialAccessDeniedError(instanceId);\n\treturn resolveInstanceValue(row, requirement, backend ?? createCredentialBackend());\n}\nfunction bindingTenantReachable(row, context) {\n\tswitch (row.scopeType) {\n\t\tcase \"organization\": return row.scopeId === context.orgId;\n\t\tcase \"project\": return row.scopeId === context.projectId;\n\t\tcase \"user\": return Boolean(row.scopeId);\n\t\tdefault: return false;\n\t}\n}\n/**\n* Resolution order:\n* 1. Platform assignment (consumer-specific, then wildcard).\n* 2. Client selection in `context.selection`.\n* 3. Scope pinned on the requirement (`.scope(\"user\")`).\n* 4. Project default, then org default.\n*/\nasync function resolvePolicy(requirement, context, consumer, backend) {\n\tconst attempted = [];\n\tconst materialBackend = backend ?? createCredentialBackend();\n\tconst scoped = withTenantScope(context);\n\tconst boundId = requirement.kind !== \"keystroke\" ? selectAssignedInstanceId(scoped.assignments, consumer?.id, requirement.key) : void 0;\n\tif (boundId) return resolveBoundInstance(boundId, requirement, scoped, consumer, materialBackend);\n\tif (requirement.kind === \"keystroke\") {\n\t\tconst bound = await resolveKeystrokeInstanceId({\n\t\t\tapp: requirement.key,\n\t\t\tscopes: [],\n\t\t\tassignments: scoped.assignments,\n\t\t\tconsumerId: consumer?.id\n\t\t});\n\t\tif (bound) {\n\t\t\tconst row = await selectCredentialInstanceById$1(bound.instanceId);\n\t\t\tif (!row) throw new MissingCredentialsError({\n\t\t\t\tkey: requirement.key,\n\t\t\t\tchainAttempted: [\"binding\"],\n\t\t\t\tconsumer\n\t\t\t});\n\t\t\treturn resolveInstanceValue(row, requirement, materialBackend);\n\t\t}\n\t}\n\tconst selectionId = context.selection?.[requirement.key];\n\tif (selectionId) return resolveInstanceValue(await resolveSelectedInstance(requirement.key, selectionId, scoped, consumer), requirement, materialBackend);\n\tif (requirement.scope) {\n\t\tconst scopeId = scopeIdForScope(requirement.scope, requirement.key, scoped);\n\t\tif (scopeId) {\n\t\t\tattempted.push(requirement.scope);\n\t\t\tconst row = await resolveAtScope(requirement.key, requirement.scope, scopeId, consumer);\n\t\t\tif (row) return resolveInstanceValue(row, requirement, materialBackend);\n\t\t}\n\t\tthrow new MissingCredentialsError({\n\t\t\tkey: requirement.key,\n\t\t\tchainAttempted: attempted.length > 0 ? attempted : [requirement.scope],\n\t\t\tconsumer\n\t\t});\n\t}\n\tif (requirement.kind === \"keystroke\") {\n\t\tconst scopes = [];\n\t\tif (scoped.projectId) {\n\t\t\tattempted.push(\"project\");\n\t\t\tscopes.push([\"project\", scoped.projectId]);\n\t\t}\n\t\tif (scoped.orgId) {\n\t\t\tattempted.push(\"organization\");\n\t\t\tscopes.push([\"organization\", scoped.orgId]);\n\t\t}\n\t\tconst resolved = await resolveKeystrokeInstanceId({\n\t\t\tapp: requirement.key,\n\t\t\tscopes,\n\t\t\tconsumerId: consumer?.id,\n\t\t\tconsumer\n\t\t});\n\t\tif (resolved) {\n\t\t\tconst row = await selectCredentialInstanceById$1(resolved.instanceId);\n\t\t\tif (row) return resolveInstanceValue(row, requirement, materialBackend);\n\t\t}\n\t\tthrow new MissingCredentialsError({\n\t\t\tkey: requirement.key,\n\t\t\tchainAttempted: attempted,\n\t\t\tconsumer\n\t\t});\n\t}\n\tif (scoped.projectId) {\n\t\tattempted.push(\"project\");\n\t\tconst row = await resolveAtScope(requirement.key, \"project\", scoped.projectId, consumer);\n\t\tif (row) return resolveInstanceValue(row, requirement, materialBackend);\n\t}\n\tif (scoped.orgId) {\n\t\tattempted.push(\"organization\");\n\t\tconst row = await resolveAtScope(requirement.key, \"organization\", scoped.orgId, consumer);\n\t\tif (row) return resolveInstanceValue(row, requirement, materialBackend);\n\t}\n\tthrow new MissingCredentialsError({\n\t\tkey: requirement.key,\n\t\tchainAttempted: attempted,\n\t\tconsumer\n\t});\n}\nasync function resolveCredentialRequirements(options) {\n\tconst resolved = {};\n\tconst requirements = normalizeCredentialList(options.requirements);\n\tconst backend = options.credentialBackend ?? createCredentialBackend();\n\tfor (const requirement of requirements) resolved[requirement.key] = await resolvePolicy(requirement, options.context, options.consumer, backend);\n\treturn resolved;\n}\n//#endregion\n//#region src/create-credential-resolver.ts\nfunction createCredentialResolver(options) {\n\tconst credentialBackend = options.credentialBackend ?? getProjectCredentialBackend() ?? createCredentialBackend();\n\treturn { async resolve(requirements, consumer, contextOverride) {\n\t\treturn resolveCredentialRequirements({\n\t\t\trequirements,\n\t\t\tconsumer,\n\t\t\tcredentialBackend,\n\t\t\tcontext: {\n\t\t\t\t...options.context,\n\t\t\t\t...contextOverride,\n\t\t\t\tselection: {\n\t\t\t\t\t...options.context.selection,\n\t\t\t\t\t...contextOverride?.selection\n\t\t\t\t},\n\t\t\t\tuserIds: {\n\t\t\t\t\t...options.context.userIds,\n\t\t\t\t\t...contextOverride?.userIds\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t} };\n}\n//#endregion\n//#region src/mcp/resolve-mcp-tools.ts\nasync function resolveMcpAuth(def, resolver) {\n\tif (!def.credentials?.length) return;\n\tconst credentials = await resolver.resolve(def.credentials, {\n\t\tkind: \"tool\",\n\t\tname: def.key\n\t});\n\treturn def.auth(credentials);\n}\nasync function resolveMcpTools(def, resolver) {\n\tif (!def.declaredTools?.length) {\n\t\tconst connection = await connectMcpDefinition(def, await resolveMcpAuth(def, resolver));\n\t\treturn {\n\t\t\ttoolSet: connection.toolSet,\n\t\t\tclose: connection.close\n\t\t};\n\t}\n\tlet connectionPromise;\n\tconst ensureConnected = () => {\n\t\tconnectionPromise ??= (async () => connectMcpDefinition(def, await resolveMcpAuth(def, resolver)))();\n\t\treturn connectionPromise;\n\t};\n\tconst toolSet = {};\n\tfor (const declared of def.declaredTools) {\n\t\tconst toolName = createToolName(def.key, declared.name);\n\t\ttoolSet[toolName] = tool({\n\t\t\tdescription: declared.description ?? declared.title ?? declared.name,\n\t\t\tinputSchema: jsonSchema(normalizeInputSchema({\n\t\t\t\ttype: \"object\",\n\t\t\t\tproperties: {},\n\t\t\t\t...declared.inputSchema\n\t\t\t})),\n\t\t\texecute: async (input, options) => {\n\t\t\t\tconst nativeTool = (await ensureConnected()).toolSet[toolName];\n\t\t\t\tif (!nativeTool?.execute) throw new Error(`MCP tool \"${declared.name}\" not found on server \"${def.key}\".`);\n\t\t\t\treturn nativeTool.execute(input, options);\n\t\t\t},\n\t\t\ttoModelOutput: async (options) => {\n\t\t\t\tconst nativeTool = (await ensureConnected()).toolSet[toolName];\n\t\t\t\tif (nativeTool?.toModelOutput) return nativeTool.toModelOutput(options);\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"json\",\n\t\t\t\t\tvalue: options.output\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t}\n\treturn {\n\t\ttoolSet,\n\t\tclose: async () => {\n\t\t\tif (connectionPromise) await (await connectionPromise).close();\n\t\t}\n\t};\n}\n//#endregion\n//#region src/mcp-provider.ts\nfunction encodeOAuthState(payload) {\n\treturn encryptCredentialPayload(JSON.stringify(payload));\n}\nfunction decodeOAuthState(state) {\n\treturn JSON.parse(decryptCredentialPayload(state));\n}\nfunction oauthAppMetadata(oauth, mcpUrl, options) {\n\treturn {\n\t\tmcpUrl,\n\t\tauthorizationEndpoint: oauth.authorizationEndpoint,\n\t\ttokenEndpoint: oauth.tokenEndpoint,\n\t\tregistrationEndpoint: oauth.registrationEndpoint,\n\t\tresource: oauth.resource,\n\t\tissuer: oauth.issuer,\n\t\tscopes: oauth.scopes,\n\t\t...options?.tokenEndpointAuthMethod ? { tokenEndpointAuthMethod: options.tokenEndpointAuthMethod } : {}\n\t};\n}\nfunction oauthClientSecretForStorage(clientSecret) {\n\treturn clientSecret?.trim() ? clientSecret : \"\";\n}\nfunction grantedScopesFromToken(scope, fallbackScopes) {\n\tconst trimmed = scope?.trim();\n\tif (!trimmed) return fallbackScopes;\n\treturn trimmed.split(/\\s+/).filter(Boolean);\n}\nfunction accessTokenExpiresAt(expiresIn) {\n\tif (!expiresIn || expiresIn <= 0) return;\n\treturn new Date(Date.now() + expiresIn * 1e3);\n}\nasync function discoverMcpApp(url) {\n\tconst probe = await probeMcpAuth(url);\n\tconst template = mcpProbeToAppTemplate(probe);\n\tconst serverInfo = await probeMcpServerInfo(url);\n\tconst serverName = probe.oauth?.resourceName?.trim() || serverInfo?.title?.trim() || serverInfo?.name?.trim() || void 0;\n\tconst serverDescription = serverInfo?.description?.trim() || void 0;\n\treturn {\n\t\tdetected: probe.mode === \"oauth\" ? Boolean(probe.oauth) : probe.unauthenticatedStatus !== void 0,\n\t\ttemplate: {\n\t\t\t...template,\n\t\t\t...serverName ? { serverName } : {},\n\t\t\t...serverDescription ? { serverDescription } : {}\n\t\t}\n\t};\n}\n/**\n* Prefer CIMD (URL client_id) when the AS advertises support and we have an\n* HTTPS metadata URL; otherwise DCR. Localhost HTTP cannot be a CIMD client_id\n* (Notion and other ASes must fetch it), so local/dev without a tunnel falls\n* back to DCR when available.\n*\n* Spec order: pre-registered → CIMD → DCR → manual.\n*/\nasync function resolveMcpOAuthClientInformation(options) {\n\tconst supportsCimd = options.metadata.client_id_metadata_document_supported === true;\n\tif (supportsCimd && Boolean(options.clientMetadataUrl) && isHttpsUrl(options.clientMetadataUrl) && options.clientMetadataUrl) return {\n\t\tclient_id: options.clientMetadataUrl,\n\t\ttoken_endpoint_auth_method: \"none\"\n\t};\n\tif (options.metadata.registration_endpoint) return registerClient(options.authorizationServerUrl, {\n\t\tmetadata: options.metadata,\n\t\tclientMetadata: {\n\t\t\tclient_name: \"Keystroke\",\n\t\t\tredirect_uris: [options.redirectUri],\n\t\t\tgrant_types: [\"authorization_code\", \"refresh_token\"],\n\t\t\tresponse_types: [\"code\"],\n\t\t\ttoken_endpoint_auth_method: \"client_secret_post\"\n\t\t},\n\t\tscope: options.scope\n\t});\n\tif (supportsCimd) throw new Error(\"Authorization server requires Client ID Metadata Documents, but Keystroke has no HTTPS client metadata URL configured (set PUBLIC_PLATFORM_URL or PUBLIC_PLATFORM_PROXY_URL to an HTTPS origin)\");\n\tthrow new Error(\"MCP authorization server does not support Client ID Metadata Documents or Dynamic Client Registration\");\n}\nasync function beginMcpOAuthConnect(options) {\n\tconst appUrl = options.app.url?.trim();\n\tif (!appUrl || options.app.source !== \"mcp\" || options.app.authKind !== \"oauth\") throw new Error(\"App is not a direct MCP OAuth app\");\n\tconst discovered = await discoverOAuthServerInfo(new URL(appUrl), {});\n\tconst metadata = discovered.authorizationServerMetadata;\n\tif (!metadata?.authorization_endpoint || !metadata.token_endpoint) throw new Error(\"MCP server does not expose OAuth authorization metadata\");\n\tconst oauth = {\n\t\tissuer: metadata.issuer,\n\t\tauthorizationEndpoint: metadata.authorization_endpoint,\n\t\ttokenEndpoint: metadata.token_endpoint,\n\t\tregistrationEndpoint: metadata.registration_endpoint,\n\t\tscopes: mergeOAuthScopes(metadata.scopes_supported, discovered.resourceMetadata?.scopes_supported, options.app.oauthScopes.map((scope) => scope.name)),\n\t\tresource: discovered.resourceMetadata?.resource,\n\t\tresourceName: discovered.resourceMetadata?.resource_name?.trim() || void 0\n\t};\n\tconst defaultScopeNames = options.app.oauthScopes.flatMap((entry) => entry.defaultSelected !== false ? [entry.name] : []);\n\tconst scope = options.input.scopes?.join(\" \") || (defaultScopeNames.length > 0 ? defaultScopeNames.join(\" \") : oauth.scopes.join(\" \"));\n\tconst clientInformation = await resolveMcpOAuthClientInformation({\n\t\tauthorizationServerUrl: discovered.authorizationServerUrl,\n\t\tmetadata,\n\t\tredirectUri: options.redirectUri,\n\t\tscope: scope || void 0,\n\t\tclientMetadataUrl: options.clientMetadataUrl\n\t});\n\tawait ensureOAuthApp({\n\t\tslug: options.app.slug,\n\t\tprovider: \"mcp\",\n\t\ttokenStrategy: \"refresh\",\n\t\tclientId: clientInformation.client_id,\n\t\tclientSecret: oauthClientSecretForStorage(clientInformation.client_secret),\n\t\tmetadata: oauthAppMetadata(oauth, appUrl, { tokenEndpointAuthMethod: clientInformation.token_endpoint_auth_method })\n\t});\n\tconst resourceUrl = oauth.resource ? new URL(oauth.resource) : new URL(appUrl);\n\tconst statePayload = {\n\t\tcodeVerifier: \"\",\n\t\tappSlug: options.app.slug,\n\t\torganizationId: options.organizationId,\n\t\tuserId: options.userId,\n\t\tscopeTargets: {\n\t\t\t...options.scopeTargets,\n\t\t\tprojectNamesById: options.projectNamesById\n\t\t},\n\t\tauthorizationServerUrl: discovered.authorizationServerUrl,\n\t\tresource: oauth.resource,\n\t\toauthMetadata: oauth,\n\t\tmcpUrl: appUrl,\n\t\tredirectUri: options.redirectUri,\n\t\tclientId: clientInformation.client_id,\n\t\tclientSecret: clientInformation.client_secret,\n\t\ttokenEndpointAuthMethod: clientInformation.token_endpoint_auth_method,\n\t\tlabel: options.input.label,\n\t\tcredentialInstanceId: options.input.credentialInstanceId\n\t};\n\tconst { authorizationUrl, codeVerifier } = await startAuthorization(discovered.authorizationServerUrl, {\n\t\tmetadata,\n\t\tclientInformation,\n\t\tredirectUrl: options.redirectUri,\n\t\tscope: scope || void 0,\n\t\tresource: resourceUrl\n\t});\n\tstatePayload.codeVerifier = codeVerifier;\n\tconst state = encodeOAuthState(statePayload);\n\tauthorizationUrl.searchParams.set(\"state\", state);\n\treturn { authorizeUrl: authorizationUrl.toString() };\n}\nasync function completeMcpOAuthConnect(options) {\n\tconst payload = decodeOAuthState(options.state);\n\tconst metadata = {\n\t\tissuer: payload.oauthMetadata.issuer ?? payload.authorizationServerUrl,\n\t\tauthorization_endpoint: payload.oauthMetadata.authorizationEndpoint,\n\t\ttoken_endpoint: payload.oauthMetadata.tokenEndpoint,\n\t\tregistration_endpoint: payload.oauthMetadata.registrationEndpoint,\n\t\tscopes_supported: payload.oauthMetadata.scopes,\n\t\tresponse_types_supported: [\"code\"],\n\t\tcode_challenge_methods_supported: [\"S256\"]\n\t};\n\tconst resourceUrl = payload.resource ? new URL(payload.resource) : void 0;\n\tconst tokens = await exchangeAuthorization(payload.authorizationServerUrl, {\n\t\tmetadata,\n\t\tclientInformation: {\n\t\t\tclient_id: payload.clientId,\n\t\t\t...payload.clientSecret ? { client_secret: payload.clientSecret } : {},\n\t\t\t...payload.tokenEndpointAuthMethod ? { token_endpoint_auth_method: payload.tokenEndpointAuthMethod } : {}\n\t\t},\n\t\tauthorizationCode: options.code,\n\t\tcodeVerifier: payload.codeVerifier,\n\t\tredirectUri: payload.redirectUri,\n\t\tresource: resourceUrl\n\t});\n\tconst { id: oauthAppId } = await ensureOAuthApp({\n\t\tslug: payload.appSlug,\n\t\tprovider: \"mcp\",\n\t\ttokenStrategy: \"refresh\",\n\t\tclientId: payload.clientId,\n\t\tclientSecret: oauthClientSecretForStorage(payload.clientSecret),\n\t\tmetadata: oauthAppMetadata(payload.oauthMetadata, payload.mcpUrl, { tokenEndpointAuthMethod: payload.tokenEndpointAuthMethod })\n\t});\n\tconst connectionId = await saveOAuthConnection({\n\t\tappId: oauthAppId,\n\t\texternalId: payload.userId,\n\t\taccessToken: tokens.access_token,\n\t\trefreshToken: tokens.refresh_token,\n\t\taccessTokenExpiresAt: accessTokenExpiresAt(tokens.expires_in),\n\t\tgrantedScopes: grantedScopesFromToken(tokens.scope, payload.oauthMetadata.scopes),\n\t\tmetadata: { mcpUrl: payload.oauthMetadata.resource }\n\t});\n\tawait ensureOAuthCredentialInstance({\n\t\tcredentialKey: payload.appSlug,\n\t\tconnectionId,\n\t\taccountLabel: payload.label,\n\t\texternalId: payload.userId,\n\t\tuserLabel: payload.label,\n\t\ttargets: payload.scopeTargets,\n\t\tcredentialInstanceId: payload.credentialInstanceId\n\t});\n\treturn {\n\t\tappSlug: payload.appSlug,\n\t\tconnectionId,\n\t\torganizationId: payload.organizationId\n\t};\n}\n//#endregion\n//#region src/discovery-error.ts\nvar DiscoveryError = class extends Error {\n\tcode;\n\tstatus;\n\tconstructor(message, code, status) {\n\t\tsuper(message);\n\t\tthis.name = \"DiscoveryError\";\n\t\tthis.code = code;\n\t\tthis.status = status;\n\t}\n};\nfunction isDiscoveryError(error) {\n\treturn error instanceof DiscoveryError;\n}\nfunction discoveryErrorFromPublicHttpUrl(error) {\n\tconst message = error.message;\n\tif (/host is not allowed|URL host is not allowed/i.test(message)) return new DiscoveryError(message, \"url_not_allowed\", 400);\n\treturn new DiscoveryError(message, \"invalid_url\", 400);\n}\nfunction discoveryErrorFromFetchFailure(error, fallback) {\n\tconst message = error instanceof Error ? error.message : fallback;\n\tif (/ENOTFOUND|ECONNREFUSED|ECONNRESET|ETIMEDOUT|ENETUNREACH|fetch failed|network error|certificate|SSL|TLS/i.test(message)) return new DiscoveryError(`Could not reach the public URL (${message})`, \"url_unreachable\", 422);\n\treturn new DiscoveryError(message, \"url_unreachable\", 422);\n}\n//#endregion\n//#region src/openapi-provider.ts\nconst MAX_SPEC_BYTES = 5 * 1024 * 1024;\nfunction isRecord$1(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction isOpenApiSpec(value) {\n\treturn isRecord$1(value) && (typeof value.openapi === \"string\" || typeof value.swagger === \"string\");\n}\nasync function discoverOpenApiApp(url) {\n\tlet response;\n\ttry {\n\t\tresponse = await fetchPublicHttp(url);\n\t} catch (error) {\n\t\tif (error instanceof PublicHttpUrlError$1) throw discoveryErrorFromPublicHttpUrl(error);\n\t\tthrow discoveryErrorFromFetchFailure(error, \"Failed to fetch OpenAPI spec\");\n\t}\n\tif (!response.ok) throw new DiscoveryError(`Failed to fetch OpenAPI spec (${response.status})`, \"upstream_http_error\", 422);\n\tconst contentLength = response.headers.get(\"content-length\");\n\tif (contentLength && Number(contentLength) > MAX_SPEC_BYTES) throw new DiscoveryError(\"OpenAPI spec is too large\", \"spec_too_large\", 422);\n\tconst text = await response.text();\n\tif (text.length > MAX_SPEC_BYTES) throw new DiscoveryError(\"OpenAPI spec is too large\", \"spec_too_large\", 422);\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(text);\n\t} catch {\n\t\ttry {\n\t\t\tparsed = YAML.parse(text);\n\t\t} catch {\n\t\t\tthrow new DiscoveryError(\"Failed to parse OpenAPI spec as JSON or YAML\", \"spec_parse_error\", 422);\n\t\t}\n\t}\n\tif (!isOpenApiSpec(parsed)) throw new DiscoveryError(\"URL does not contain a valid OpenAPI or Swagger spec\", \"invalid_openapi\", 422);\n\treturn {\n\t\tdetected: true,\n\t\ttemplate: openApiSpecToAppTemplate(parsed, url)\n\t};\n}\n//#endregion\n//#region src/graphql-provider.ts\nconst MAX_RESPONSE_BYTES = 5 * 1024 * 1024;\nconst INTROSPECTION_QUERY = `query IntrospectionQuery {\n __schema {\n queryType { name description }\n mutationType { name description }\n }\n}`;\nconst USAGE_AUTH_PROBE_QUERY = \"query { __typename }\";\nasync function postGraphql(endpointUrl, query) {\n\tlet response;\n\ttry {\n\t\tresponse = await fetchPublicHttp(endpointUrl, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\t\"content-type\": \"application/json\",\n\t\t\t\taccept: \"application/json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify({ query })\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof PublicHttpUrlError$1) throw discoveryErrorFromPublicHttpUrl(error);\n\t\tthrow discoveryErrorFromFetchFailure(error, \"Failed to reach GraphQL endpoint\");\n\t}\n\tconst contentLength = response.headers.get(\"content-length\");\n\tif (contentLength && Number(contentLength) > MAX_RESPONSE_BYTES) throw new DiscoveryError(\"GraphQL introspection response is too large\", \"spec_too_large\", 422);\n\tconst text = await response.text();\n\tif (text.length > MAX_RESPONSE_BYTES) throw new DiscoveryError(\"GraphQL introspection response is too large\", \"spec_too_large\", 422);\n\tlet body;\n\ttry {\n\t\tbody = JSON.parse(text);\n\t} catch {\n\t\tthrow new DiscoveryError(\"GraphQL endpoint did not return JSON\", \"spec_parse_error\", 422);\n\t}\n\treturn {\n\t\tresponse,\n\t\tbody,\n\t\ttext\n\t};\n}\nfunction introspectionDisabled(body) {\n\tif (!isRecord(body) || !Array.isArray(body.errors)) return false;\n\treturn body.errors.some((error) => {\n\t\tif (!isRecord(error)) return false;\n\t\treturn (typeof error.message === \"string\" ? error.message.toLowerCase() : \"\").includes(\"introspection\");\n\t});\n}\nasync function discoverGraphqlApp(url) {\n\tconst endpointUrl = url.trim();\n\tconst { response, body } = await postGraphql(endpointUrl, INTROSPECTION_QUERY);\n\tconst authProbe = inferGraphqlAuthFromProbe(response.status, response.headers.get(\"www-authenticate\"), body);\n\tif (!(isRecord(body) && isRecord(body.data) && isRecord(body.data.__schema))) {\n\t\tif (response.status === 401 || response.status === 403) return {\n\t\t\tdetected: true,\n\t\t\ttemplate: graphqlIntrospectionToAppTemplate({ data: {} }, endpointUrl, authProbe)\n\t\t};\n\t\tif (response.ok && introspectionDisabled(body)) throw new DiscoveryError(\"Introspection is disabled on this endpoint\", \"invalid_openapi\", 422);\n\t\tthrow new DiscoveryError(`Failed to introspect GraphQL endpoint (${response.status})`, \"upstream_http_error\", 422);\n\t}\n\tlet resolvedAuthProbe = authProbe;\n\tif (resolvedAuthProbe === \"none\") {\n\t\tconst usageProbe = await postGraphql(endpointUrl, USAGE_AUTH_PROBE_QUERY);\n\t\tconst usageAuth = inferGraphqlAuthFromProbe(usageProbe.response.status, usageProbe.response.headers.get(\"www-authenticate\"), usageProbe.body);\n\t\tif (usageAuth !== \"none\") resolvedAuthProbe = usageAuth;\n\t}\n\treturn {\n\t\tdetected: true,\n\t\ttemplate: graphqlIntrospectionToAppTemplate(body, endpointUrl, resolvedAuthProbe)\n\t};\n}\n//#endregion\n//#region src/define-mcp.ts\nfunction defineMcp(def) {\n\treturn defineMcp$1(def);\n}\n//#endregion\n//#region src/parse-resolved-credentials.ts\nfunction parseResolvedCredentials(requirements, credentials) {\n\tif (requirements.length === 0) return {};\n\tconst normalized = normalizeCredentialList(requirements);\n\tconst record = credentials !== null && typeof credentials === \"object\" ? credentials : void 0;\n\tconst resolved = {};\n\tfor (const requirement of normalized) {\n\t\tconst value = record?.[requirement.key];\n\t\tif (value === void 0 || value === null) throw new MissingCredentialsError({\n\t\t\tkey: requirement.key,\n\t\t\tchainAttempted: []\n\t\t});\n\t\tconst parsed = requirement.schema.safeParse(value);\n\t\tif (!parsed.success) throw new MissingCredentialsError({\n\t\t\tkey: requirement.key,\n\t\t\tchainAttempted: []\n\t\t});\n\t\tresolved[requirement.key] = parsed.data;\n\t}\n\treturn resolved;\n}\n//#endregion\n//#region src/resolve-action-credentials.ts\n/** Requirement types from contracts — not @keystrokehq/action (avoids credentials → action). */\nasync function resolveActionCredentials(requirements, options) {\n\tif (!requirements.length) return {};\n\tconst resolveCredentials = options.resolveCredentials ?? (options.context ? createCredentialResolver({\n\t\tcontext: options.context,\n\t\toauthAdapter: options.oauthAdapter\n\t}).resolve : void 0);\n\tif (!resolveCredentials) throw new MissingCredentialsError({\n\t\tkey: normalizeCredentialList(requirements)[0].key,\n\t\tchainAttempted: [],\n\t\tconsumer: options.consumer\n\t});\n\treturn parseResolvedCredentials(requirements, await resolveCredentials(requirements, options.consumer, options.contextOverride));\n}\n//#endregion\n//#region src/oauth.ts\nconst stubOAuthTokenAdapter = { async getAccessToken() {\n\tthrow new OAuthNotConfiguredError();\n} };\nfunction createOAuthTokenRefreshRegistry() {\n\tconst handlers = /* @__PURE__ */ new Map();\n\treturn {\n\t\tregister(appKey, refresher) {\n\t\t\thandlers.set(appKey, refresher);\n\t\t},\n\t\tget(appKey) {\n\t\t\treturn handlers.get(appKey);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/backend/oauth-adapter.ts\nfunction createOAuthTokenAdapterFromBackend(backend) {\n\treturn { getAccessToken(connectionId) {\n\t\treturn backend.getOAuthAccessToken(connectionId);\n\t} };\n}\n//#endregion\nexport { CREDENTIAL_SCOPE_TYPES, CredentialAccessDeniedError, DiscoveryError, MissingCredentialsError, NeedsSelectionError, OAuthNotConfiguredError, PublicHttpUrlError, beginMcpOAuthConnect, buildAssignmentSet, buildCredentialRunContext, canAssignCredentialInstance, canManageCredentialInstance, captureCredentialToolErrors, completeMcpOAuthConnect, createCredentialBackend, createCredentialResolver, createLocalCredentialBackend, createOAuthTokenAdapterFromBackend, createOAuthTokenRefreshRegistry, createPlatformCredentialBackend, credentialScopeMatchesContext, credentialScopePrefix, decodeOAuthState, defineMcp, describeCredentialBinding, describeCredentialBindings, discoverGraphqlApp, discoverMcpApp, discoverOpenApiApp, encodeOAuthState, enrichCredentialError, formatCredentialErrorMessage, formatCredentialRef, formatCredentialRefSuggestion, getProjectCredentialBackend, isCredentialError, isDiscoveryError, isWorkerRuntime, loadCredentialAssignments, parseCredentialRef, parseResolvedCredentials, resolveActionCredentials, resolveAgentConnectContext, resolveCredentialRef, resolveCredentialRequirements, resolveKeystrokeInstanceId, resolveMcpTools, selectAssignedInstanceId, setProjectCredentialBackend, stubOAuthTokenAdapter, withCredentialAssignments };\n\n//# sourceMappingURL=index.mjs.map","import { z } from \"zod\";\nimport { executeAction, getActionCredentialRequirements, getRegisteredProjectScopeId, getRunSignal, getWorkflowRunHandle, normalizeCredentialList, registerWorkflowRunGetter, runWithMcpCredentialContext } from \"@keystrokehq/action\";\nimport { CHAT_ATTACHMENT_MAX_BYTES, FilePartSchema, chatAttachmentExtension, chatAttachmentServePath, defineTool, requiredDisplayTextSchema } from \"@keystrokehq/shared\";\nimport { captureConsole, withSpan } from \"@keystrokehq/tracing\";\nimport { resolveActionCredentials } from \"@keystrokehq/credentials\";\nimport { AsyncLocalStorage } from \"node:async_hooks\";\n//#region src/run-canceled-error.ts\nvar RunCanceledError = class extends Error {\n\tconstructor(runId) {\n\t\tsuper(runId ? `Workflow run ${runId} was canceled` : \"Workflow run was canceled\");\n\t\tthis.name = \"RunCanceledError\";\n\t}\n};\nfunction isRunCanceledError(error) {\n\treturn error instanceof RunCanceledError;\n}\n//#endregion\n//#region src/run-timeout-error.ts\nfunction formatTimeoutMs(ms) {\n\tif (ms % 6e4 === 0) {\n\t\tconst minutes = ms / 6e4;\n\t\treturn `${minutes} minute${minutes === 1 ? \"\" : \"s\"}`;\n\t}\n\tif (ms % 1e3 === 0) {\n\t\tconst seconds = ms / 1e3;\n\t\treturn `${seconds} second${seconds === 1 ? \"\" : \"s\"}`;\n\t}\n\treturn `${ms}ms`;\n}\nvar RunTimeoutError = class extends Error {\n\tkind;\n\ttimeoutMs;\n\tconstructor(kind, timeoutMs) {\n\t\tsuper(`${kind} run exceeded ${formatTimeoutMs(timeoutMs)} limit`);\n\t\tthis.name = \"RunTimeoutError\";\n\t\tthis.kind = kind;\n\t\tthis.timeoutMs = timeoutMs;\n\t}\n};\nfunction isRunTimeoutError(error) {\n\treturn error instanceof RunTimeoutError;\n}\n//#endregion\n//#region src/workflow-step-invocation.ts\nfunction executeWorkflowStep(state) {\n\tconst handle = getWorkflowRunHandle();\n\tif (!handle?.workflowRunner) throw new Error(`Workflow \"${state.workflow.slug}\" can only be called as a step inside a running workflow. Run it standalone with executeWorkflow(...).`);\n\treturn handle.workflowRunner(state.workflow, state.input, { callSiteId: state.callSiteId });\n}\nfunction createWorkflowStepInvocation(state) {\n\treturn {\n\t\t__site(callSiteId) {\n\t\t\treturn createWorkflowStepInvocation({\n\t\t\t\t...state,\n\t\t\t\tcallSiteId\n\t\t\t});\n\t\t},\n\t\tthen(onfulfilled, onrejected) {\n\t\t\treturn executeWorkflowStep(state).then(onfulfilled, onrejected);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/workflow-definition.ts\nconst zodSchema = z.custom((v) => v instanceof z.ZodType, \"must be a Zod schema\");\n/** Runtime validation for an unbranded workflow definition. */\nconst workflowCoreSchema = z.object({\n\tslug: z.string().trim().min(1),\n\tname: requiredDisplayTextSchema,\n\tdescription: requiredDisplayTextSchema,\n\tsubscription: z.object({ mode: z.enum([\"system\", \"subscribable\"]).optional() }).optional(),\n\tinput: zodSchema,\n\toutput: zodSchema,\n\trun: z.function()\n});\nconst WORKFLOW = Symbol.for(\"keystroke.workflow\");\n/**\n* Validates brand + shape via `workflowCoreSchema` so discovery and guards\n* reject malformed definitions.\n*/\nfunction isWorkflow(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tif (!(WORKFLOW in value) || value[WORKFLOW] !== true) return false;\n\treturn workflowCoreSchema.safeParse(value).success;\n}\n//#endregion\n//#region src/define-workflow.ts\nfunction defineWorkflow(def) {\n\tconst result = workflowCoreSchema.safeParse(def);\n\tif (!result.success) throw new Error(`Invalid workflow definition: ${formatIssues(result.error.issues)}`);\n\tconst body = def.run;\n\tconst workflow = {\n\t\t...result.data,\n\t\t[WORKFLOW]: true\n\t};\n\tworkflow.run = ((input, ctx) => {\n\t\tif (ctx !== void 0) return body(input, ctx);\n\t\treturn createWorkflowStepInvocation({\n\t\t\tworkflow,\n\t\t\tinput\n\t\t});\n\t});\n\treturn workflow;\n}\nfunction formatIssues(issues) {\n\treturn issues.map((issue) => {\n\t\treturn `${issue.path.length > 0 ? `${issue.path.join(\".\")}: ` : \"\"}${issue.message}`;\n\t}).join(\"; \");\n}\n//#endregion\n//#region src/replay/duration.ts\nconst UNIT_MS = {\n\tms: 1,\n\ts: 1e3,\n\tm: 6e4,\n\th: 36e5,\n\td: 864e5\n};\n/** Resolve a sleep duration to an absolute resume time. */\nfunction resolveResumeAt(duration, now = /* @__PURE__ */ new Date()) {\n\tif (duration instanceof Date) return duration;\n\tif (typeof duration === \"number\") return new Date(now.getTime() + Math.max(0, duration));\n\treturn new Date(now.getTime() + parseDurationToMs(duration));\n}\nfunction parseDurationToMs(value) {\n\tconst match = /^(\\d+(?:\\.\\d+)?)\\s*(ms|s|m|h|d)$/.exec(value.trim());\n\tif (!match) throw new Error(`Invalid sleep duration \"${value}\". Use a number of ms, a Date, or a string like \"5s\", \"10m\", \"1h\".`);\n\tconst amount = Number(match[1]);\n\tconst unit = match[2];\n\treturn Math.round(amount * UNIT_MS[unit]);\n}\n//#endregion\n//#region src/replay/error.ts\nfunction serializeWorkflowError(error) {\n\tif (error instanceof Error) return {\n\t\tname: error.name,\n\t\tmessage: error.message\n\t};\n\treturn { message: String(error) };\n}\n/** Rebuild an Error from a recorded error so replay re-raises the same failure. */\nfunction deserializeWorkflowError(data) {\n\tconst serialized = data;\n\tconst error = new Error(serialized?.message ?? \"Workflow step failed\");\n\tif (serialized?.name) error.name = serialized.name;\n\treturn error;\n}\n//#endregion\n//#region src/replay/events-consumer.ts\n/** Indexes replay events by correlationId for O(1) cache-hit checks during replay. */\nvar EventsConsumer = class {\n\tbyCorrelationId = /* @__PURE__ */ new Map();\n\tconstructor(events) {\n\t\tfor (const event of events) {\n\t\t\tif (!event.correlationId) continue;\n\t\t\tconst list = this.byCorrelationId.get(event.correlationId);\n\t\t\tif (list) list.push(event);\n\t\t\telse this.byCorrelationId.set(event.correlationId, [event]);\n\t\t}\n\t}\n\tevents(correlationId) {\n\t\treturn this.byCorrelationId.get(correlationId) ?? [];\n\t}\n\thasEventType(correlationId, type) {\n\t\treturn this.events(correlationId).some((event) => event.type === type);\n\t}\n\t/**\n\t* Cache lookup for a step. Returns the recorded output on a `step_completed`,\n\t* re-raises the recorded error on a terminal `step_failed` (so a permanently\n\t* failed step is not re-executed), and otherwise reports a miss — including\n\t* when only `step_retrying` events exist (the step re-runs on the next pass).\n\t*/\n\tgetStepResult(correlationId) {\n\t\tconst events = this.events(correlationId);\n\t\tconst failed = events.find((event) => event.type === \"step_failed\");\n\t\tif (failed) throw deserializeWorkflowError(failed.data);\n\t\tconst completed = events.find((event) => event.type === \"step_completed\");\n\t\tif (completed) return {\n\t\t\tcompleted: true,\n\t\t\tresult: completed.data\n\t\t};\n\t\treturn { completed: false };\n\t}\n\t/** Number of prior `step_retrying` events recorded for a step (= failed attempts so far). */\n\tcountRetrying(correlationId) {\n\t\treturn this.events(correlationId).filter((event) => event.type === \"step_retrying\").length;\n\t}\n\tisSleepCompleted(correlationId) {\n\t\treturn this.hasEventType(correlationId, \"sleep_completed\");\n\t}\n\t/** Returns the persisted resumeAt for a scheduled-but-not-completed sleep, if any. */\n\tgetSleepResumeAt(correlationId) {\n\t\tconst scheduled = this.events(correlationId).find((event) => event.type === \"sleep_scheduled\");\n\t\tif (!scheduled) return;\n\t\tconst data = scheduled.data;\n\t\treturn data?.resumeAt ? new Date(data.resumeAt) : void 0;\n\t}\n\tgetHookToken(correlationId) {\n\t\treturn (this.events(correlationId).find((event) => event.type === \"hook_created\")?.data)?.token;\n\t}\n\tgetHookResult(correlationId) {\n\t\tconst resumed = this.events(correlationId).find((event) => event.type === \"hook_resumed\");\n\t\tif (!resumed) return { resolved: false };\n\t\treturn {\n\t\t\tresolved: true,\n\t\t\tpayload: resumed.data?.payload\n\t\t};\n\t}\n};\n//#endregion\n//#region src/replay/suspension.ts\n/** A promise that never settles — returned by a suspending primitive so the body parks. */\nfunction createPendingPromise() {\n\treturn new Promise(() => {});\n}\n/**\n* Collects pending items requested within a single tick and resolves once, so\n* parallel suspensions (e.g. Promise.all of two sleeps) batch into one suspension.\n*/\nvar SuspensionCoordinator = class {\n\titems = /* @__PURE__ */ new Map();\n\tscheduled = false;\n\tresolve;\n\tpromise;\n\tconstructor() {\n\t\tthis.promise = new Promise((resolve) => {\n\t\t\tthis.resolve = resolve;\n\t\t});\n\t}\n\trequest(item) {\n\t\tthis.items.set(item.correlationId, item);\n\t\tif (!this.scheduled) {\n\t\t\tthis.scheduled = true;\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tthis.resolve([...this.items.values()]);\n\t\t\t});\n\t\t}\n\t}\n\twaitForSuspension() {\n\t\treturn this.promise;\n\t}\n};\n//#endregion\n//#region src/replay/replay-context.ts\nfunction createReplayState(params) {\n\treturn {\n\t\trunId: params.runId,\n\t\tconsumer: params.consumer,\n\t\tcoordinator: params.coordinator,\n\t\teventLog: params.eventLog,\n\t\tnewEvents: [],\n\t\tnow: params.now ?? /* @__PURE__ */ new Date(),\n\t\thookBaseUrl: params.hookBaseUrl,\n\t\tsleepCounter: 0,\n\t\thookCounter: 0,\n\t\tstepOccurrences: /* @__PURE__ */ new Map()\n\t};\n}\n/**\n* Correlation-id scope for a sub-workflow body. A sub-workflow runs inline in\n* its parent's replay state, so its steps' structural `callSiteId`s (which are\n* hashed per-file and therefore collide across composed workflows) must be\n* namespaced under the parent step. We push the parent step's correlation key\n* as a path segment; keys become `<parentSegment>/<childKey>`. Held in async\n* context (not on `ReplayState`) so parallel sub-workflows (`Promise.all`) each\n* see their own scope without a shared mutable stack racing.\n*/\nconst stepScopeStorage = new AsyncLocalStorage();\n/** Run `fn` with `segment` appended to the current correlation-id scope. */\nfunction runInStepScope(segment, fn) {\n\tconst parent = stepScopeStorage.getStore() ?? [];\n\treturn stepScopeStorage.run([...parent, segment], fn);\n}\n/** Prefix the active scope onto a step key (`<scope>/<key>`, or `<key>` at top level). */\nfunction scopedKey(key) {\n\tconst scope = stepScopeStorage.getStore();\n\treturn scope && scope.length > 0 ? `${scope.join(\"/\")}/${key}` : key;\n}\n/**\n* Occurrence-independent consumer id (`step:<scopedKey>`) for credential binding,\n* so one assignment covers every execution of a step (loops included) and, unlike\n* the raw `callSiteId`, never collides with a same-positioned step in a parent or\n* sibling sub-workflow.\n*/\nfunction stepConsumerId(callSiteId) {\n\treturn `step:${scopedKey(callSiteId)}`;\n}\n/**\n* Allocate the correlation id for a step: `step:<scopedKey>#<occurrence>`. `key` is\n* the build-injected structural `callSiteId` (so the id matches the canvas graph\n* node 1:1), falling back to the action/agent slug for un-built/test runs, and is\n* prefixed by any active sub-workflow scope. The per-key `#<occurrence>` suffix\n* gives two calls to the same site (e.g. loop iterations) distinct, replay-stable\n* ids, and inserting an unrelated call never shifts the ids of later calls (unlike\n* a single global ordinal). User-authored step ids no longer exist — ids are\n* entirely internal.\n*/\nfunction nextStepCorrelationId(state, key) {\n\tconst effectiveKey = scopedKey(key);\n\tconst occurrence = state.stepOccurrences.get(effectiveKey) ?? 0;\n\tstate.stepOccurrences.set(effectiveKey, occurrence + 1);\n\treturn `step:${effectiveKey}#${occurrence}`;\n}\nfunction createSleep(state) {\n\treturn function sleep(duration, options) {\n\t\tconst correlationId = options?.__site ? nextStepCorrelationId(state, options.__site) : `sleep#${state.sleepCounter++}`;\n\t\tif (state.consumer.isSleepCompleted(correlationId)) return Promise.resolve();\n\t\tconst scheduledResumeAt = state.consumer.getSleepResumeAt(correlationId);\n\t\tconst resumeAt = scheduledResumeAt ?? resolveResumeAt(duration, state.now);\n\t\tif (scheduledResumeAt && resumeAt.getTime() <= state.now.getTime()) {\n\t\t\tstate.newEvents.push({\n\t\t\t\tid: `sleep_completed:${state.runId}:${correlationId}`,\n\t\t\t\trunId: state.runId,\n\t\t\t\ttype: \"sleep_completed\",\n\t\t\t\tcorrelationId\n\t\t\t});\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\tif (!scheduledResumeAt) state.newEvents.push({\n\t\t\tid: `sleep_scheduled:${state.runId}:${correlationId}`,\n\t\t\trunId: state.runId,\n\t\t\ttype: \"sleep_scheduled\",\n\t\t\tcorrelationId,\n\t\t\tdata: { resumeAt: resumeAt.toISOString() }\n\t\t});\n\t\tstate.coordinator.request({\n\t\t\tkind: \"sleep\",\n\t\t\tcorrelationId,\n\t\t\tresumeAt\n\t\t});\n\t\treturn createPendingPromise();\n\t};\n}\nfunction createHook(state) {\n\treturn function hook(options) {\n\t\tconst correlationId = options?.__site ? nextStepCorrelationId(state, options.__site) : `hook#${state.hookCounter++}`;\n\t\tconst token = options?.token ?? state.consumer.getHookToken(correlationId) ?? `hook_${crypto.randomUUID()}`;\n\t\tconst resumeUrl = state.hookBaseUrl ? `${state.hookBaseUrl}/hooks/${token}/resume` : `/hooks/${token}/resume`;\n\t\tconst schema = options?.schema ? z.toJSONSchema(options.schema) : void 0;\n\t\treturn {\n\t\t\ttoken,\n\t\t\tresumeUrl,\n\t\t\tthen(onFulfilled, onRejected) {\n\t\t\t\tconst result = state.consumer.getHookResult(correlationId);\n\t\t\t\tif (result.resolved) {\n\t\t\t\t\tconst payload = options?.schema ? options.schema.parse(result.payload) : result.payload;\n\t\t\t\t\treturn Promise.resolve(payload).then(onFulfilled, onRejected);\n\t\t\t\t}\n\t\t\t\tif (!state.consumer.hasEventType(correlationId, \"hook_created\")) state.newEvents.push({\n\t\t\t\t\tid: `hook_created:${state.runId}:${correlationId}`,\n\t\t\t\t\trunId: state.runId,\n\t\t\t\t\ttype: \"hook_created\",\n\t\t\t\t\tcorrelationId,\n\t\t\t\t\tdata: schema ? {\n\t\t\t\t\t\ttoken,\n\t\t\t\t\t\tschema\n\t\t\t\t\t} : { token }\n\t\t\t\t});\n\t\t\t\tstate.coordinator.request({\n\t\t\t\t\tkind: \"hook\",\n\t\t\t\t\tcorrelationId,\n\t\t\t\t\ttoken,\n\t\t\t\t\t...schema ? { schema } : {}\n\t\t\t\t});\n\t\t\t\treturn createPendingPromise().then(onFulfilled, onRejected);\n\t\t\t}\n\t\t};\n\t};\n}\n//#endregion\n//#region src/run-durable-step.ts\n/**\n* Shared durable-step shell: resolve a stable `correlation_id`, short-circuit\n* from the event log on a cache hit, otherwise execute and append\n* `step_completed` immediately (per-step crash durability). A thrown step\n* appends `step_retrying` (non-fatal, re-run on the next attempt) and\n* rethrows; the terminal `step_failed` is written by the job handler once the\n* queue exhausts retries.\n*/\nasync function runDurableStep(state, options) {\n\tconst { runId, consumer, eventLog } = state;\n\tgetRunSignal().throwIfAborted();\n\tconst correlationId = nextStepCorrelationId(state, options.correlationKey ?? options.key);\n\tconst cached = consumer.getStepResult(correlationId);\n\tconst metadata = {\n\t\trunId,\n\t\t[options.metadataKey]: options.key,\n\t\tcorrelationId\n\t};\n\tif (cached.completed) return options.parseCached ? options.parseCached(cached.result) : cached.result;\n\treturn withSpan({\n\t\tkind: options.kind,\n\t\tname: options.key,\n\t\trefId: `${runId}:${correlationId}`,\n\t\tmetadata\n\t}, async () => captureConsole(async () => {\n\t\ttry {\n\t\t\tconst result = await options.execute(correlationId);\n\t\t\tawait eventLog.append({\n\t\t\t\tid: `step_completed:${runId}:${correlationId}`,\n\t\t\t\trunId,\n\t\t\t\ttype: \"step_completed\",\n\t\t\t\tcorrelationId,\n\t\t\t\tdata: result\n\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tconst attempt = consumer.countRetrying(correlationId);\n\t\t\tawait eventLog.append({\n\t\t\t\tid: `step_retrying:${runId}:${correlationId}:${attempt}`,\n\t\t\t\trunId,\n\t\t\t\ttype: \"step_retrying\",\n\t\t\t\tcorrelationId,\n\t\t\t\tdata: serializeWorkflowError(error)\n\t\t\t});\n\t\t\tstate.failedCorrelationId = correlationId;\n\t\t\tthrow error;\n\t\t}\n\t}));\n}\n//#endregion\n//#region src/create-action-runner.ts\nfunction withCredentialScopeOverride(requirements, scope) {\n\tif (!requirements || !scope) return requirements;\n\treturn normalizeCredentialList(requirements).map((requirement) => ({\n\t\t...requirement,\n\t\tscope\n\t}));\n}\nasync function executeActionWithResolvedCredentials(action, input, options, runOptions, consumerId) {\n\tconst requirements = withCredentialScopeOverride(getActionCredentialRequirements(action), runOptions?.credentialScope);\n\tconst credentials = requirements?.length ? await resolveActionCredentials(requirements, {\n\t\tresolveCredentials: options.resolveCredentials,\n\t\tcontext: options.credentialContext,\n\t\toauthAdapter: options.oauthAdapter,\n\t\tconsumer: {\n\t\t\tkind: \"action\",\n\t\t\tname: action.slug,\n\t\t\tid: consumerId\n\t\t}\n\t}) : {};\n\treturn runWithMcpCredentialContext({\n\t\t...options.mcpCredentialContext,\n\t\tconsumerId\n\t}, () => executeAction(action, input, credentials));\n}\n/** Non-durable action runner for poll sources and other ephemeral orchestration. */\nfunction createDirectActionRunner(options = {}) {\n\treturn (action, input, runOptions) => {\n\t\treturn executeActionWithResolvedCredentials(action, input, options, runOptions, runOptions?.callSiteId ? stepConsumerId(runOptions.callSiteId) : action.slug);\n\t};\n}\n/** Builds the per-run action runner; durability lives in {@link runDurableStep}. */\nfunction createActionRunner(state, options = {}) {\n\treturn (action, input, runOptions) => runDurableStep(state, {\n\t\tkind: \"action\",\n\t\tkey: action.slug,\n\t\tcorrelationKey: runOptions?.callSiteId,\n\t\tmetadataKey: \"actionKey\",\n\t\tparseCached: (cached) => action.output.parse(cached),\n\t\texecute: async (correlationId) => {\n\t\t\treturn executeActionWithResolvedCredentials(action, input, options, runOptions, runOptions?.callSiteId ? stepConsumerId(runOptions.callSiteId) : correlationId);\n\t\t}\n\t});\n}\n//#endregion\n//#region src/run-child-step.ts\n/**\n* Suspends the parent workflow until a queued child reports its terminal\n* outcome. The runtime records `child_dispatched` and later completes or fails\n* this step in the parent's event log; this primitive only owns replay and\n* suspension mechanics.\n*/\nfunction runChildStep(state, options) {\n\tgetRunSignal().throwIfAborted();\n\tconst correlationId = nextStepCorrelationId(state, options.correlationKey ?? options.key);\n\tconst cached = state.consumer.getStepResult(correlationId);\n\tif (cached.completed) return Promise.resolve(options.parseCached(cached.result));\n\tstate.coordinator.request({\n\t\tkind: \"child\",\n\t\tcorrelationId,\n\t\tdispatched: state.consumer.hasEventType(correlationId, \"child_dispatched\"),\n\t\t...options.child\n\t});\n\treturn createPendingPromise();\n}\n//#endregion\n//#region src/create-agent-step-runner.ts\n/**\n* Builds the per-run agent runner: each `agent.prompt()` in a workflow body\n* becomes a durable step keyed `step:<agentKey>#<occurrence>` (same scheme as\n* actions). The actual prompt execution is delegated to `runAgent`, supplied\n* by the host (server) via `executeWorkflow({ runAgent })`.\n*/\nfunction createAgentStepRunner(state, runAgent, queueChildren = false) {\n\treturn (agent, input, options) => {\n\t\tconst slug = agent.slug;\n\t\tif (queueChildren) return runChildStep(state, {\n\t\t\tkey: slug,\n\t\t\tcorrelationKey: options?.callSiteId,\n\t\t\tparseCached: (cached) => cached,\n\t\t\tchild: {\n\t\t\t\tchildKind: \"agent\",\n\t\t\t\ttargetId: slug,\n\t\t\t\tinput,\n\t\t\t\t...options?.runPrompt ? { runPrompt: options.runPrompt } : {}\n\t\t\t}\n\t\t});\n\t\treturn runDurableStep(state, {\n\t\t\tkind: \"agent_session\",\n\t\t\tkey: slug,\n\t\t\tcorrelationKey: options?.callSiteId,\n\t\t\tmetadataKey: \"agentKey\",\n\t\t\texecute: (_correlationId) => runAgent(agent, input, options?.runPrompt)\n\t\t});\n\t};\n}\n//#endregion\n//#region src/create-llm-step-runner.ts\n/**\n* Builds the per-run LLM runner: each `promptLlm()` in a workflow body becomes a\n* durable step keyed `step:promptLlm#<occurrence>`. The actual LLM call is\n* delegated to `runLlm`, supplied by the host (server) via `executeWorkflow({ runLlm })`.\n*/\nfunction createLlmStepRunner(state, runLlm) {\n\treturn (opts) => runDurableStep(state, {\n\t\tkind: \"llm\",\n\t\tkey: \"promptLlm\",\n\t\tcorrelationKey: opts.callSiteId,\n\t\tmetadataKey: \"llmKey\",\n\t\tparseCached: (cached) => opts.outputSchema ? opts.outputSchema.parse(cached) : cached,\n\t\texecute: (_correlationId) => runLlm(opts)\n\t});\n}\n//#endregion\n//#region src/create-workflow-step-runner.ts\n/**\n* Builds the per-run sub-workflow runner: each `workflow.run(input)` inside a\n* workflow body becomes a durable step keyed by its build-injected `callSiteId`\n* (`step:<callSiteId>#<occurrence>`), falling back to the slug for un-built runs.\n* The sub-workflow's body runs inline in the same replay state (its action/agent/\n* LLM steps and `ctx.sleep`/`ctx.hook` stay durable) but under a correlation-id\n* scope named after this step, so the child's steps never collide with equally\n* positioned steps in the parent. Its validated output is checkpointed so a\n* replay skips the whole sub-workflow once it completes.\n*/\nfunction createWorkflowStepRunner(state, ctx, queueChildren = false) {\n\treturn (workflowUnknown, input, options) => {\n\t\tconst workflow = workflowUnknown;\n\t\tconst parsedInput = workflow.input.parse(input);\n\t\tif (queueChildren) return runChildStep(state, {\n\t\t\tkey: workflow.slug,\n\t\t\tcorrelationKey: options?.callSiteId,\n\t\t\tparseCached: (cached) => workflow.output.parse(cached),\n\t\t\tchild: {\n\t\t\t\tchildKind: \"workflow\",\n\t\t\t\ttargetId: workflow.slug,\n\t\t\t\tinput: parsedInput\n\t\t\t}\n\t\t});\n\t\treturn runDurableStep(state, {\n\t\t\tkind: \"workflow_run\",\n\t\t\tkey: workflow.slug,\n\t\t\tcorrelationKey: options?.callSiteId,\n\t\t\tmetadataKey: \"workflowKey\",\n\t\t\tparseCached: (cached) => workflow.output.parse(cached),\n\t\t\texecute: async () => {\n\t\t\t\treturn runInStepScope(options?.callSiteId ?? workflow.slug, async () => {\n\t\t\t\t\tconst output = await workflow.run(parsedInput, ctx);\n\t\t\t\t\treturn workflow.output.parse(output);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t};\n}\n//#endregion\n//#region src/run-context.ts\nconst storage = new AsyncLocalStorage();\nregisterWorkflowRunGetter(() => {\n\tconst store = storage.getStore();\n\tif (!store) return;\n\treturn {\n\t\tactionRunner: store.actionRunner,\n\t\tagentRunner: store.agentRunner,\n\t\tllmRunner: store.llmRunner,\n\t\tworkflowRunner: store.workflowRunner\n\t};\n});\nfunction runWithWorkflowContext(store, fn) {\n\treturn storage.run(store, fn);\n}\n//#endregion\n//#region src/replay/memory-event-log.ts\n/** In-memory durable log for inline execution and tests. */\nvar MemoryEventLog = class {\n\tevents = [];\n\tids = /* @__PURE__ */ new Set();\n\tasync append(event) {\n\t\tconst id = event.id ?? crypto.randomUUID();\n\t\tif (this.ids.has(id)) return false;\n\t\tthis.ids.add(id);\n\t\tthis.events.push({\n\t\t\tid,\n\t\t\trunId: event.runId,\n\t\t\tseq: this.events.length,\n\t\t\ttype: event.type,\n\t\t\tcorrelationId: event.correlationId ?? null,\n\t\t\tdata: event.data ?? null\n\t\t});\n\t\treturn true;\n\t}\n\tasync listReplay(runId) {\n\t\treturn this.events.filter((event) => event.runId === runId).map((event) => ({ ...event }));\n\t}\n};\n//#endregion\n//#region src/execute-workflow.ts\n/**\n* The single way to run a workflow: replay its event log from the top, execute\n* un-cached primitives, and either complete/fail or suspend at the first\n* un-satisfied sleep/hook. New events (sleep_scheduled/sleep_completed/\n* hook_created/run_completed/run_failed) are flushed before returning.\n*\n* Durability comes entirely from the log — a suspended run resumes by calling\n* this again with the same `runId` and event log once the sleep is due or the\n* hook is resumed.\n*/\nasync function executeWorkflow(workflow, input, options = {}) {\n\tconst runId = options.runId ?? crypto.randomUUID();\n\tconst eventLog = options.eventLog ?? new MemoryEventLog();\n\tconst signal = getRunSignal();\n\tconst consumer = new EventsConsumer(await eventLog.listReplay(runId));\n\tconst coordinator = new SuspensionCoordinator();\n\tconst state = createReplayState({\n\t\trunId,\n\t\tconsumer,\n\t\tcoordinator,\n\t\teventLog,\n\t\thookBaseUrl: options.hookBaseUrl,\n\t\tnow: options.now\n\t});\n\tconst actionRunner = createActionRunner(state, {\n\t\tresolveCredentials: options.resolveCredentials,\n\t\tcredentialContext: options.credentialContext,\n\t\toauthAdapter: options.oauthAdapter,\n\t\tmcpCredentialContext: { assignmentTarget: {\n\t\t\ttype: \"workflow\",\n\t\t\tkey: workflow.slug\n\t\t} }\n\t});\n\tconst ctx = {\n\t\trunId,\n\t\tsleep: createSleep(state),\n\t\thook: createHook(state),\n\t\t...options.context\n\t};\n\tconst agentRunner = options.runAgent ? createAgentStepRunner(state, options.runAgent, options.queueChildSteps) : void 0;\n\tconst llmRunner = options.runLlm ? createLlmStepRunner(state, options.runLlm) : void 0;\n\tconst workflowRunner = createWorkflowStepRunner(state, ctx, options.queueChildSteps);\n\tconst validatedInput = workflow.input.parse(input);\n\tconst bodyPromise = runWithWorkflowContext({\n\t\tactionRunner,\n\t\tagentRunner,\n\t\tllmRunner,\n\t\tworkflowRunner,\n\t\trunId\n\t}, () => captureConsole(async () => workflow.run(validatedInput, ctx)));\n\tlet onAbort;\n\tfunction abortRaceOutcome() {\n\t\tif (isRunTimeoutError(signal.reason)) return {\n\t\t\ttype: \"timeout\",\n\t\t\terror: signal.reason\n\t\t};\n\t\treturn { type: \"canceled\" };\n\t}\n\tconst waitForAbort = signal.aborted ? Promise.resolve(abortRaceOutcome()) : new Promise((resolve) => {\n\t\tonAbort = () => resolve(abortRaceOutcome());\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n\tconst outcome = await Promise.race([\n\t\tbodyPromise.then((output) => ({\n\t\t\ttype: \"done\",\n\t\t\toutput\n\t\t}), (error) => ({\n\t\t\ttype: \"error\",\n\t\t\terror\n\t\t})),\n\t\tcoordinator.waitForSuspension().then((items) => ({\n\t\t\ttype: \"suspended\",\n\t\t\titems\n\t\t})),\n\t\twaitForAbort\n\t]);\n\tif (onAbort) signal.removeEventListener(\"abort\", onAbort);\n\tlet result;\n\tif (outcome.type === \"suspended\") {\n\t\tbodyPromise.catch(() => {});\n\t\tresult = {\n\t\t\tstatus: \"suspended\",\n\t\t\titems: outcome.items\n\t\t};\n\t} else if (outcome.type === \"done\") {\n\t\tconst output = workflow.output.parse(outcome.output);\n\t\tstate.newEvents.push({\n\t\t\tid: `run_completed:${runId}`,\n\t\t\trunId,\n\t\t\ttype: \"run_completed\",\n\t\t\tdata: { output }\n\t\t});\n\t\tresult = {\n\t\t\tstatus: \"completed\",\n\t\t\toutput\n\t\t};\n\t} else if (outcome.type === \"canceled\" || isRunCanceledError(outcome.error)) {\n\t\tbodyPromise.catch(() => {});\n\t\tstate.newEvents.push({\n\t\t\tid: `run_canceled:${runId}`,\n\t\t\trunId,\n\t\t\ttype: \"run_canceled\"\n\t\t});\n\t\tresult = { status: \"canceled\" };\n\t} else if (outcome.type === \"timeout\") {\n\t\tbodyPromise.catch(() => {});\n\t\tresult = {\n\t\t\tstatus: \"failed\",\n\t\t\terror: outcome.error,\n\t\t\tfailedCorrelationId: state.failedCorrelationId\n\t\t};\n\t} else result = {\n\t\tstatus: \"failed\",\n\t\terror: outcome.error,\n\t\tfailedCorrelationId: state.failedCorrelationId\n\t};\n\tfor (const event of state.newEvents) await eventLog.append(event);\n\treturn result;\n}\n//#endregion\n//#region src/prompt-llm.ts\nfunction promptLlm(prompt, opts) {\n\tconst handle = getWorkflowRunHandle();\n\tif (!handle?.llmRunner) throw new Error(\"promptLlm must run inside a workflow with an injected llm executor (executeWorkflow({ runLlm })).\");\n\tconst { __site, ...rest } = opts;\n\treturn handle.llmRunner({\n\t\tprompt,\n\t\t...rest,\n\t\t...typeof __site === \"string\" ? { callSiteId: __site } : {}\n\t});\n}\n//#endregion\n//#region src/workflow-tool.ts\nlet executor;\nfunction registerWorkflowToolExecutor(fn) {\n\tif (executor) throw new Error(\"workflow tool executor already registered\");\n\texecutor = fn;\n}\nfunction getWorkflowToolExecutor() {\n\tif (!executor) throw new Error(\"workflow tool executor not registered\");\n\treturn executor;\n}\nfunction assertWorkflowToolInput(workflow) {\n\tif (!(\"shape\" in workflow.input) || typeof workflow.input.shape !== \"object\") throw new Error(`Workflow \"${workflow.slug}\" cannot be used as an agent tool: input schema must be a Zod object.`);\n}\nfunction resolveWorkflowTool(workflow, context = {}) {\n\tassertWorkflowToolInput(workflow);\n\tconst key = workflow.slug;\n\tconst description = workflow.description;\n\treturn defineTool({\n\t\tname: key,\n\t\tlabel: key,\n\t\tdescription,\n\t\tparameters: workflow.input,\n\t\tasync execute(toolCallId, params, signal) {\n\t\t\tconst output = await withSpan({\n\t\t\t\tkind: \"tool_call\",\n\t\t\t\tname: key,\n\t\t\t\trefId: toolCallId,\n\t\t\t\tmetadata: {\n\t\t\t\t\ttool: key,\n\t\t\t\t\ttype: \"workflow\"\n\t\t\t\t}\n\t\t\t}, () => getWorkflowToolExecutor()(workflow, params, {\n\t\t\t\tworkflowKey: key,\n\t\t\t\t...context,\n\t\t\t\t...signal ? { signal } : {}\n\t\t\t}));\n\t\t\treturn {\n\t\t\t\tcontent: [{\n\t\t\t\t\ttype: \"text\",\n\t\t\t\t\ttext: JSON.stringify(output)\n\t\t\t\t}],\n\t\t\t\tdetails: output\n\t\t\t};\n\t\t}\n\t});\n}\n//#endregion\n//#region src/file-store-registry.ts\n/**\n* Cross-module bridge for workflow file storage. The project runtime registers\n* a putObject backed by worker storage; `storeFile` reads it without importing\n* `@keystrokehq/storage` clients from authoring code. Keyed by a global\n* `Symbol.for` so a single slot is shared across bundled copies.\n*/\nconst REGISTRY_KEY = Symbol.for(\"keystroke.fileStore\");\nfunction registry() {\n\tconst globalScope = globalThis;\n\tif (!globalScope[REGISTRY_KEY]) globalScope[REGISTRY_KEY] = {};\n\treturn globalScope[REGISTRY_KEY];\n}\nfunction registerFileStore(store) {\n\tregistry().store = store;\n}\nfunction getRegisteredFileStore() {\n\treturn registry().store;\n}\n//#endregion\n//#region src/store-file.ts\nconst ATTACHMENT_EXT = /^[a-z0-9]+$/;\n/** Same key shape as `chatAttachmentStorageKey` in `@keystrokehq/storage`. */\nfunction chatAttachmentStorageKey(projectId, id, ext) {\n\tconst normalizedExt = ext.replace(/^\\./, \"\").toLowerCase();\n\tif (!ATTACHMENT_EXT.test(normalizedExt)) throw new Error(\"Invalid chat attachment extension\");\n\treturn `chat-attachments/${projectId}/${id}.${normalizedExt}`;\n}\n/**\n* Persist raw bytes into org chat-attachment storage and return a `FilePart` ref\n* that can travel through workflow input / step checkpoints / `agent.prompt({ files })`.\n*\n* Requires worker storage (`registerFileStore`) and a bound project scope.\n* Serve path uses a `workflow` agent-slug placeholder — hydration ignores it.\n* ponytail: web serving of workflow-stored files via the per-agent GET route is not wired.\n*/\nasync function storeFile(data, options) {\n\tconst store = getRegisteredFileStore();\n\tif (!store) throw new Error(\"storeFile requires worker storage (STORAGE_* / KEYSTROKE_WORKSPACES_BUCKET)\");\n\tconst projectId = getRegisteredProjectScopeId() ?? store.projectId;\n\tif (!projectId) throw new Error(\"storeFile requires a bound project scope\");\n\tconst ext = chatAttachmentExtension(options.mediaType);\n\tif (!ext) throw new Error(`Unsupported media type: ${options.mediaType}`);\n\tif (data.byteLength === 0) throw new Error(\"storeFile requires non-empty data\");\n\tif (data.byteLength > CHAT_ATTACHMENT_MAX_BYTES) throw new Error(`File exceeds size limit (${CHAT_ATTACHMENT_MAX_BYTES} bytes): ${data.byteLength}`);\n\tconst storageKey = chatAttachmentStorageKey(projectId, crypto.randomUUID(), ext);\n\tconst url = chatAttachmentServePath(projectId, \"workflow\", storageKey);\n\tawait store.putObject({\n\t\tkey: storageKey,\n\t\tbody: data,\n\t\tcontentType: options.mediaType\n\t});\n\tconst part = {\n\t\ttype: \"file\",\n\t\tmediaType: options.mediaType,\n\t\turl,\n\t\t...options.filename ? { filename: options.filename } : {}\n\t};\n\treturn FilePartSchema.parse(part);\n}\n//#endregion\nexport { MemoryEventLog, RunCanceledError, RunTimeoutError, createActionRunner, createDirectActionRunner, defineWorkflow, deserializeWorkflowError, executeWorkflow, isRunCanceledError, isRunTimeoutError, isWorkflow, promptLlm, registerFileStore, registerWorkflowToolExecutor, resolveWorkflowTool, runWithWorkflowContext, serializeWorkflowError, storeFile };\n\n//# sourceMappingURL=index.mjs.map"],"x_google_ignoreList":[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153],"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