@agentconnect.md/daemon 2.19.0-rc.14 → 2.19.0-rc.15
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/release.json +1 -1
- package/dist/render-Dazz4Vk5.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-Dazz4Vk5.js","names":["z.enum","z.string","z.object","z\n .object","z.literal","z\n .object","z.number","z\n .string","z.boolean","z.array","z.object","z.enum","z.string","z\n .string","z.number","z.array","z.literal","z.boolean","z.discriminatedUnion","z\n .object","z.guid","z.union","z\n .object","z.unknown","z.record","z\n .array","own","content","document","flow","string","text","resolveText","defaultConstructs","content","document","flow","string","text","point","splitIntoSections","splitTextIntoSections"],"sources":["../../protocol/dist/frames/codehost-feedback.js","../../protocol/dist/frames/relay-cp.js","../src/messages/attribution.ts","../../../node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.js","../../../node_modules/.pnpm/character-entities@2.0.2/node_modules/character-entities/index.js","../../../node_modules/.pnpm/decode-named-character-reference@1.3.0/node_modules/decode-named-character-reference/index.js","../../../node_modules/.pnpm/micromark-util-chunked@2.0.1/node_modules/micromark-util-chunked/index.js","../../../node_modules/.pnpm/micromark-util-combine-extensions@2.0.1/node_modules/micromark-util-combine-extensions/index.js","../../../node_modules/.pnpm/micromark-util-decode-numeric-character-reference@2.0.2/node_modules/micromark-util-decode-numeric-character-reference/index.js","../../../node_modules/.pnpm/micromark-util-normalize-identifier@2.0.1/node_modules/micromark-util-normalize-identifier/index.js","../../../node_modules/.pnpm/micromark-util-character@2.1.1/node_modules/micromark-util-character/index.js","../../../node_modules/.pnpm/micromark-factory-space@2.1.0/node_modules/micromark-factory-space/index.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/initialize/content.js","../../../node_modules/.pnpm/micromark-util-edit-map@1.0.0/node_modules/micromark-util-edit-map/index.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/initialize/document.js","../../../node_modules/.pnpm/micromark-util-classify-character@2.0.1/node_modules/micromark-util-classify-character/index.js","../../../node_modules/.pnpm/micromark-util-resolve-all@2.0.1/node_modules/micromark-util-resolve-all/index.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/attention.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/autolink.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/blank-line.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/block-quote.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/character-escape.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/character-reference.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/code-fenced.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/code-indented.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/code-text.js","../../../node_modules/.pnpm/micromark-util-subtokenize@2.1.0/node_modules/micromark-util-subtokenize/lib/splice-buffer.js","../../../node_modules/.pnpm/micromark-util-subtokenize@2.1.0/node_modules/micromark-util-subtokenize/index.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/content.js","../../../node_modules/.pnpm/micromark-factory-destination@2.0.1/node_modules/micromark-factory-destination/index.js","../../../node_modules/.pnpm/micromark-factory-label@2.0.1/node_modules/micromark-factory-label/index.js","../../../node_modules/.pnpm/micromark-factory-title@2.0.1/node_modules/micromark-factory-title/index.js","../../../node_modules/.pnpm/micromark-factory-whitespace@2.0.1/node_modules/micromark-factory-whitespace/index.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/definition.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/hard-break-escape.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/heading-atx.js","../../../node_modules/.pnpm/micromark-util-html-tag-name@2.0.1/node_modules/micromark-util-html-tag-name/index.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/html-flow.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/html-text.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/label-end.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/label-start-image.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/label-start-link.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/line-ending.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/thematic-break.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/list.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/setext-underline.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/initialize/flow.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/initialize/text.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/constructs.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/create-tokenizer.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/parse.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/postprocess.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/preprocess.js","../../../node_modules/.pnpm/micromark-util-decode-string@2.0.1/node_modules/micromark-util-decode-string/index.js","../../../node_modules/.pnpm/unist-util-stringify-position@4.0.0/node_modules/unist-util-stringify-position/lib/index.js","../../../node_modules/.pnpm/mdast-util-from-markdown@2.1.0_supports-color@7.2.0/node_modules/mdast-util-from-markdown/lib/index.js","../src/messages/agent-links.ts","../src/session/no-response.ts","../src/messages/message-boundary.ts","../src/messages/stream-boundary.ts","../src/acp/permission-modes.ts","../src/messages/split-sections.ts","../src/slack/formatter.ts","../src/platforms/approval-card.ts","../src/session/tool-output.ts","../src/slack/render.ts"],"sourcesContent":["import { z } from 'zod';\nimport { FollowUpEventKind, FollowUpWatchSubject } from './follow-up-watch.js';\nexport const CODEHOST_FEEDBACK_FEATURE = 'codehost-feedback-v1';\nconst Provider = z.enum(['gitlab', 'gitea']);\nconst RepoId = z.string().regex(/^[1-9]\\d*$/);\n// A repository subscription has no trigger, agent, prompt, or review authority; never log its signing keys.\nexport const RcCodeHostFeedbackWatch = z.object({\n provider: Provider,\n repoId: RepoId,\n watch: z\n .object({\n orgId: z.string().min(1),\n bindingId: z.string().uuid(),\n host: z.string().url(),\n signingKey: z.string().min(1),\n nextSigningKey: z.string().min(1).optional(),\n // Follow-ups watch objects here (assistant-mode.md §5.14), so the relay also sends their wake-only events.\n followUps: z.literal(true).optional()\n })\n .optional()\n});\n// Only verified event coordinates cross this boundary; the daemon reads feedback bodies and logs.\nexport const RcCodeHostFeedback = z\n .object({\n provider: Provider,\n orgId: z.string().min(1),\n bindingId: z.string().uuid(),\n host: z.string().url(),\n repoId: RepoId,\n deliveryKey: z.string().min(1).max(200),\n pullNumber: z.number().int().positive().optional(),\n headSha: z\n .string()\n .regex(/^[a-fA-F0-9]{40,64}$/)\n .optional(),\n actorId: RepoId.optional(),\n actorUsername: z.string().min(1).max(255).optional(),\n // `event` is any other change on an object, sent wake-only (assistant-mode.md §5.14).\n kind: z.enum(['comment', 'ci', 'event']),\n // What happened and on which kind of object; a `wakeOnly` signal wakes follow-ups alone.\n subject: FollowUpWatchSubject.optional(),\n event: FollowUpEventKind.optional(),\n wakeOnly: z.literal(true).optional()\n})\n .refine((value) => (value.kind === 'ci' ? value.headSha !== undefined : value.pullNumber !== undefined))\n .refine((value) => value.wakeOnly === true || (value.kind !== 'event' && value.subject !== 'issue'), {\n message: 'an issue or other object event wakes follow-ups only'\n});\nexport const RcCodeHostFeedbackResult = z.object({\n accepted: z.boolean(),\n authorAgentIds: z.array(z.string().uuid())\n});\n//# sourceMappingURL=codehost-feedback.js.map","import { RcCodeHostFeedback, RcCodeHostFeedbackResult, RcCodeHostFeedbackWatch } from './codehost-feedback.js';\nimport { z } from 'zod';\nimport { AhpGrant } from '../ahp.js';\nimport { frameSchema } from '../envelope.js';\nimport { CodeHostExternalId, CodeHostProviderString, HOOK_KINDS } from '../code-host.js';\nimport { COMPUTER_TURN_URLS_MAX, ComputerStunUrl, ComputerTurnUrl } from '../computer-viewer.js';\nimport { ErrorFrame } from './error.js';\nimport { BindMatch, ChannelBlockedBotSenders, ChannelBotSender, IntegrationChannel } from './integration.js';\nimport { CronTarget } from './cron.js';\nimport { Platform } from './route.js';\nimport { CollabRoutesSnapshot } from './collab.js';\nimport { FrameFragment } from './fragment.js';\nimport { AzureDevOpsDeliveryKind, AzureDevOpsHookMetadata, GiteaHookMetadata, GithubHookMetadata, GitlabHookMetadata, HookBigIntString, HookInstructions, OptionalHookConfigSnapshot } from './hook.js';\nimport { WebchatRemoteMcpEntitlement } from './remote-mcp.js';\nimport { PullRequestFeedbackSignal } from './session.js';\nimport { FollowUpEventKind, FollowUpWatchSubject, RcFollowUpWatch } from './follow-up-watch.js';\nimport { AzureDevOpsRepoRouting, ChatCallerRole } from './agent.js';\nimport { buildEnvelopeRaw, decodeEnvelopeWith } from '../wire.js';\n/**\n * relay↔CP control frames (`rc/*`) — shared-bot-relay.md §7.1 / §8.\n *\n * The relay dials OUT to the CP (`/api/v1/relays/ws`) and this wire carries\n * ONLY control signaling: registration, heartbeat, delegated credential\n * verification, and revocation. Message content NEVER crosses it — content\n * flows browser/platform → relay → daemon on the `rd/*` wire.\n *\n * This is a SEPARATE frame union from the daemon↔CP protocol (`frame.ts`) and\n * from the relay↔daemon wire (`relay-daemon.ts`): each socket decodes against\n * its own schema map, so a frame from the wrong family is `UNKNOWN_FRAME`.\n *\n * Milestone A carried the skeleton subset (register / heartbeat / verify /\n * daemon-revoke); milestone B-github adds the hook frames (`rc/hook-assign`,\n * `rc/hook-remove`, `rc/run-report` — webhook-triggers-and-github-events.md).\n * Shared-bot (`rc/bot-assign`…) frames land with milestone B-slack.\n */\n/** Subprotocol negotiated on the relay↔CP socket. */\nexport const RELAY_CP_SUBPROTOCOL = 'agentconnect.rc.v1';\n// ── auth (first frame; §8 dual-mode) ─────────────────────────────────────────\n// R→C REQ → rc/auth/ok. `token` = deployment-shared secret (`RELAY_TOKEN`, or a\n// JWT signed with it — the credential FORM is discriminated by the presence of\n// dots, not here); `apikey` = a per-relay ApiKey (kind 'relay', org-less).\n// The credential is secret material — NEVER log this frame.\nexport const RcAuth = z.object({\n method: z.enum(['token', 'apikey']),\n credential: z.string().min(1)\n});\n// The deployment Google Chat app's anchor (google-chat-integration.md §10.4): its project number and the console's claim page.\nexport const RcGoogleChatAnchor = z.object({\n projectNumber: z.string().regex(/^[1-9]\\d{0,19}$/),\n claimUrl: z.string().url({ protocol: /^https$/ })\n});\n/** The deployment Google Chat app the relay sends its customer rows' Chat API calls with (google-chat-integration.md §10.10). */\nexport const RcGoogleChatDeploymentApp = z.object({\n projectNumber: z.string().regex(/^[1-9]\\d{0,19}$/),\n /** Service-account key JSON; secret material, never logged. */\n serviceAccountKey: z.string().min(1)\n});\n// The deployment Teams app's anchor (teams-integration.md §8.4): it answers a tenant no organization connected, so it carries the app's secret.\nexport const RcMsTeamsAnchor = z.object({\n appId: z.string().uuid(),\n /** The app's home tenant, which issues every Bot Framework token the anchor sends with. */\n tenantId: z.string().uuid(),\n /** Secret material, never logged. */\n clientSecret: z.string().min(1),\n connectUrl: z.string().url({ protocol: /^https$/ })\n});\n/** The agent identity blueprint whose secret obtains every agent bot's Bot Connector token (teams-integration.md §8.6.7). */\nexport const RcMsTeamsBlueprint = z.object({\n appId: z.string().uuid(),\n /** Secret material, never logged. */\n clientSecret: z.string().min(1)\n});\n/** The deployment Teams app the relay sends its customer rows' Bot Connector calls and mints their Graph tokens with (teams-integration.md §8.5). */\nexport const RcMsTeamsDeploymentApp = z.object({\n appId: z.string().uuid(),\n /** The app's home tenant, which issues every Bot Connector token. */\n tenantId: z.string().uuid(),\n /** Secret material, never logged. */\n clientSecret: z.string().min(1),\n /** The base64url key every relay signs and checks conversation tickets with; derived from the CP's pepper, never logged. */\n ticketKey: z.string().min(43),\n /** Present when the deployment configures agent bots; absent, the relay serves none. */\n blueprint: RcMsTeamsBlueprint.optional()\n});\n/** The deployment's mail domain as the relay receives and sends for it (email-integration.md §7): the provider account and its sending token, the ingress Worker's secret, and the key reply tickets are signed with. */\nexport const RcEmailDeployment = z.object({\n /** The domain every agent address is on, lower-cased. */\n mailDomain: z\n .string()\n .max(253)\n .regex(/^[a-z0-9-]+(?:\\.[a-z0-9-]+)+$/),\n /** The provider account the sending token belongs to. */\n accountId: z.string().regex(/^[0-9a-f]{32}$/),\n /** The API token that sends as any address on the mail domain; secret material, never logged, and never sent to a daemon. */\n apiToken: z.string().min(1),\n /** The secret the ingress Worker signs each inbound post with; never logged. */\n ingressSecret: z.string().min(32),\n /** The authserv-id whose `Authentication-Results` the relay reads a sender's verdict from (§4 step 2). */\n authservId: z.string().min(1).max(253),\n /** The most messages the whole deployment sends in a day (§6.3); absent, only the per-address and per-organization budgets apply. */\n dailySendLimit: z.number().int().positive().optional(),\n /** The base64url key every relay signs and checks reply tickets with (§6.2); derived from the CP's pepper, never logged. */\n ticketKey: z.string().min(43)\n});\n// C→R REP (corr = rc/auth id). Rejection is a `error` REP + close, not a reply.\n// The CP's deployment snapshot, sent on every authentication; the GitHub secret is applied once per relay process, the Google Chat anchor on every registration.\nexport const RcDeploymentConfig = z.object({\n revision: z.number().int().nonnegative(),\n githubWebhookSecret: z.string().min(1).optional(),\n googleChatAnchor: RcGoogleChatAnchor.optional(),\n googleChatApp: RcGoogleChatDeploymentApp.optional(),\n msTeamsAnchor: RcMsTeamsAnchor.optional(),\n msTeamsApp: RcMsTeamsDeploymentApp.optional(),\n // Present once Setup holds the whole Email configuration; absent, the relay serves no mail.\n email: RcEmailDeployment.optional(),\n // Console links in provider-owned onboarding use the configured origin, without an organization path.\n webAppUrl: z\n .string()\n .url({ protocol: /^https?$/ })\n .optional(),\n // The relay pool's public origin (the CP's PUBLIC_RELAY_URL): a provider that signs for its callback URL is checked against it.\n publicRelayUrl: z\n .string()\n .url({ protocol: /^https?$/ })\n .optional()\n});\nexport const RcAuthOk = z.object({\n heartbeatSec: z.number().int(), // cadence the relay must emit rc/heartbeat at\n serverTime: z.string().datetime(),\n deploymentConfig: RcDeploymentConfig.optional(),\n // The secret the CP mints viewer TURN credentials from, so a relay serving TURN can check them; secret, never logged.\n computerTurnSecret: z.string().min(32).max(256).optional(),\n // CP-derived HMAC secret for verifying Mattermost interactive action button callbacks; secret, never logged.\n mattermostActionSecret: z.string().min(32).max(256).optional()\n});\n// ── registration ─────────────────────────────────────────────────────────────\n// R→C REQ → rc/registered. Announces this relay instance and where daemons can\n// dial it. Re-sent on every (re)connect; the CP upserts and re-issues the id.\n// `daemonUrl` MUST route to THIS instance (per-pod DNS or a relay-id-sticky\n// path) — a pool-level random LB breaks the no-cross-pod-forwarding topology\n// (design §5). The pool-level public ingress is env-level PUBLIC_RELAY_URL and\n// is never registered here.\nexport const RcRegister = z.object({\n name: z.string().min(1), // deployment-side identity (pod name etc.)\n daemonUrl: z.string().min(1), // per-instance-routable WSS origin daemons dial\n // Relay feature advertisement (e.g. webchat_session_continuation_v1). The\n // default keeps old relays register-compatible; absent ⇒ no features.\n features: z.array(z.string()).default([]),\n // This instance's public STUN address (`stun:<host>:<port>`) for viewer hole punching; absent when it serves none.\n stunUrl: ComputerStunUrl.optional(),\n // This instance's public TURN addresses for viewer media without a punched path; sent only once it holds the TURN secret.\n turnUrls: z.array(ComputerTurnUrl).min(1).max(COMPUTER_TURN_URLS_MAX).optional()\n});\n// C→R REP (corr = rc/register id).\nexport const RcRegistered = z.object({\n relayId: z.string().uuid(),\n // Optional compatibility discovery for a new relay connected to an older CP.\n serverFeatures: z.array(z.string()).default([])\n});\n// `event` names what happened; a `wakeOnly` signal wakes follow-ups alone and resumes no session, and an issue's always is one.\nexport const RcPullRequestFeedback = PullRequestFeedbackSignal.extend({\n subject: FollowUpWatchSubject.optional(),\n event: FollowUpEventKind.optional(),\n wakeOnly: z.literal(true).optional()\n}).refine((signal) => signal.subject !== 'issue' || signal.wakeOnly === true, {\n message: 'an issue signal wakes follow-ups only'\n});\nexport const RcPullRequestFeedbackResult = z.object({\n deliveryKey: z.string().min(1).max(200),\n accepted: z.boolean()\n});\n// R→C EVT — liveness; drives `relay.lastSeenAt` and the failover sweeper.\nexport const RcHeartbeat = z.object({});\n// ── delegated verification (§9 / §10) ────────────────────────────────────────\n/** The longest chat id the agent chat API accepts; `useChat` generates far shorter ones. */\nexport const AGENT_CHAT_ID_MAX_CHARS = 128;\n/** Why the CP refused an agent chat key, each of which the relay answers with its own status. */\nexport const AGENT_CHAT_KEY_REFUSAL = {\n invalidKey: 'invalid key',\n notPermitted: 'key not permitted',\n agentNotFound: 'agent not found',\n agentMoved: 'agent moved',\n agentUnavailable: 'agent unavailable'\n};\n// R→C REQ → rc/verify/ok. The relay holds no database, so it delegates credential\n// checks to the CP: a daemon's API key on `rd/hello`, or a browser's CP-minted\n// short-lived webchat token. The credential is secret material — NEVER log.\n// `conversationBinding` is optional on the wire so a new CP can reject one old\n// relay's webchat dial without closing the relay's shared control connection.\nexport const RcVerify = z.discriminatedUnion('kind', [\n z.object({\n kind: z.literal('ahp-client-key'),\n credential: z.string().min(1),\n agentId: z.string().uuid(),\n // The endpoint the relay advertised as the protected resource; an OAuth token's grant must name it.\n resource: z.string().url().max(2048).optional()\n }),\n z.object({\n kind: z.literal('daemon-key'),\n credential: z.string().min(1)\n }),\n // An in-cluster daemon's projected ServiceAccount token, reviewed against its cluster.\n z.object({\n kind: z.literal('daemon-token'),\n credential: z.string().min(1),\n // The daemonId claimed on `rd/hello`, forwarded unverified. CP binds a pool member token's\n // reviewed Pod UID to one member record and refuses any different claim.\n daemonId: z.string().uuid().optional()\n }),\n z.object({\n kind: z.literal('webchat-token'),\n credential: z.string().min(1),\n conversationBinding: z.literal('v1').optional(),\n protocol: z.literal('ahp').optional(),\n agentId: z.string().uuid().optional()\n }),\n // A desktop daemon's relay-audience channel token on `cr/hello` (computer-use.md §3.7): signed with its live channel key.\n z.object({\n kind: z.literal('computer-relay-token'),\n credential: z.string().min(1).max(2048),\n computerId: z.string().uuid()\n }),\n // An API key on the agent chat API (shared-bot-relay.md §10.4): the CP maps (key owner, agent, chat id) to its conversation.\n z.object({\n kind: z.literal('agent-chat-key'),\n credential: z.string().min(1),\n agentId: z.string().uuid(),\n chatId: z.string().min(1).max(AGENT_CHAT_ID_MAX_CHARS)\n }),\n // An open webchat socket, re-checked by the principal its dial verified: no credential, and the answer is `ok` alone.\n z.object({\n kind: z.literal('webchat-access'),\n orgId: z.string().min(1),\n userId: z.string().min(1),\n agentId: z.string().uuid(),\n conversationId: z.string().uuid()\n })\n]);\n// C→R REP (corr = rc/verify id). `ok:false` carries no detail beyond `reason`\n// (no existence oracle). On success the identity fields depend on `kind`:\n// - daemon-key → daemonId + orgId\n// - daemon-token → daemonId + orgId (same shape; a different credential)\n// - webchat-token → userId (+ display `user`) + agentId + daemonId + orgId +\n// conversationId, where daemonId is the agent's CURRENT placement and the\n// conversation id is the CP-authorized binding carried by the token.\n// One conversation participant, as resolved at verification time. `daemonId` is\n// the agent's CURRENT placement; absent when the agent is unplaced or its daemon\n// is not READY (the relay then refuses turns targeting it with `no_agent`).\nexport const RcWebchatParticipant = z.object({\n agentId: z.string().uuid(),\n daemonId: z.string().uuid().optional(),\n // The member that recorded this participant's current session, which is where its content is unless a shared store holds it. The relay carries it on every op so a member that reached the turn another way can refuse it (#2218).\n recordedDaemonId: z.string().uuid().optional(),\n primary: z.boolean().optional(),\n // This participant's own CP-selected continuation target, stamped on its rd/msg only; set on the peers a hook target's conversation brings (#2500).\n targetSessionId: z.string().min(1).optional(),\n // Who the token's user is to this participant; the relay stamps it on the turns and runtime changes it sends there.\n callerRole: ChatCallerRole.optional()\n});\nexport const RcVerifyResult = z.object({\n ahpGrant: AhpGrant.optional(),\n callerRole: ChatCallerRole.optional(),\n ok: z.boolean(),\n reason: z.string().optional(),\n orgId: z.string().optional(),\n daemonId: z.string().uuid().optional(),\n // computer-relay-token → the Computer the desktop proved it holds a live channel key for.\n computerId: z.string().uuid().optional(),\n userId: z.string().optional(),\n user: z.string().optional(), // display handle for the transcript author line\n // The author's public avatar URL, for a platform mirror that renders a per-message identity.\n userPicture: z.string().url().max(2_048).optional(),\n // A session continuation's author on the target session's platform (`<platform>:<tenant>:<memberId>`), from their linked accounts.\n userIdentities: z.array(z.string().min(1).max(512)).max(8).optional(),\n agentId: z.string().uuid().optional(),\n conversationId: z.string().uuid().optional(),\n // The conversation's full roster (multi-agent webchat). Singular agentId/daemonId\n // above stay the PRIMARY's values for rolling compatibility; `participants`\n // always includes the primary. Absent ⇒ single-agent conversation on an older CP.\n participants: z.array(RcWebchatParticipant).max(16).optional(),\n // Session-targeted continuation (webchat-cross-integration-continuation.md):\n // the CP-selected target session, by its outward id (§1.1). The relay copies it verbatim onto\n // every rd/msg for this conversation; it never originates in the browser and\n // is deliberately the only cross-system coordinate on the wire — every local\n // coordinate comes from the daemon's own session row.\n targetSessionId: z.string().min(1).optional(),\n remoteMcp: WebchatRemoteMcpEntitlement.optional(),\n // The primary agent's enabled chat APIs; the relay's chat API refuses a protocol absent here. Plain strings, so a newer CP's protocol never fails an older relay's parse.\n apiProtocols: z.array(z.string().min(1)).max(16).optional(),\n // The API key's owner could decide this agent's approvals in the console, so its calls may decide them too.\n callerApproves: z.boolean().optional()\n});\n// R→C REQ → rc/github-comment-authz/ok. The relay asks the CP (which owns the\n// App installation) for a current repository-permission verdict instead of\n// treating webhook `author_association` as authority. This frame is deliberately\n// metadata-only: authored content must never cross the relay↔CP control plane.\nexport const RcGithubHookFence = z\n .object({\n hookId: z.string().uuid(),\n configRevision: HookBigIntString,\n dispatchRevision: HookBigIntString\n})\n .strict();\nexport const RcGithubCommentAuthz = z\n .object({\n hookId: z.string().uuid(),\n installationId: z.string().regex(/^[1-9]\\d*$/),\n repoId: z.string().regex(/^[1-9]\\d*$/),\n repoFullName: z.string().regex(/^[^/\\s]+\\/[^/\\s]+$/),\n // Legacy field name: comment deliveries carry `comment.user.login`, not\n // the top-level webhook action sender. Maintainer controls carry the actor.\n senderLogin: z.string().min(1),\n // An unmentioned thread comment may continue automatically only when both\n // its commenter and the issue/PR author still have write authority. An\n // explicit maintainer summon omits this second actor.\n subjectAuthorLogin: z.string().min(1).optional(),\n // Fence authorization to the exact compiled rule that accepted the\n // delivery. A stale relay copy cannot authorize after retarget/reassign.\n configRevision: HookBigIntString,\n dispatchRevision: HookBigIntString,\n // Thread-actor authorization is repository-wide, but every matching sibling\n // must still be fenced against current CP state before one allow verdict\n // can authorize the complete fan-out.\n siblingFences: z.array(RcGithubHookFence).min(1).optional()\n})\n .strict();\n// C→R REP (corr = rc/github-comment-authz id). Do not disclose the user's\n// effective permission or which validation failed; the relay needs one bit.\nexport const RcGithubCommentAuthzResult = z.object({ allowed: z.boolean() }).strict();\n/** Neutral alias: the fence shape was never GitHub-specific. */\nexport const RcHookFence = RcGithubHookFence;\n// R→C REQ → rc/codehost-membership-authz/ok — metadata-only live membership (gitlab-com-integration.md §12.2), not `.strict()` so it can grow; an older CP fails closed.\nexport const RcCodeHostMembershipAuthz = z\n .object({\n hookId: z.string().uuid(),\n provider: z.string().min(1), // 'gitlab' today; open string so a new host degrades per-value\n repoExternalId: z.string().regex(/^[1-9]\\d*$/), // numeric project/repository id — the match key\n // Sender/actor numeric user id; an Azure DevOps actor is named by `actorIdentityId` instead, exactly one of the two.\n actorExternalId: z\n .string()\n .regex(/^[1-9]\\d*$/)\n .optional(),\n // The actor's Azure DevOps identity id (azure-devops-integration.md §11.4); an older CP refuses the frame and the relay fails closed.\n actorIdentityId: z.guid().toLowerCase().optional(),\n // The actor's login for a provider that looks permission up by name (Gitea §8); the CP re-resolves it against the id.\n actorUsername: z.string().min(1).optional(),\n // An unmentioned thread continuation also gates the subject author; an explicit summon omits it.\n subjectAuthorExternalId: z\n .string()\n .regex(/^[1-9]\\d*$/)\n .optional(),\n subjectAuthorUsername: z.string().min(1).optional(),\n // Fence authorization to the exact compiled rule that accepted the delivery.\n configRevision: HookBigIntString,\n dispatchRevision: HookBigIntString,\n siblingFences: z.array(RcHookFence).min(1).optional()\n})\n .superRefine((request, ctx) => {\n if ((request.actorExternalId === undefined) === (request.actorIdentityId === undefined)) {\n ctx.addIssue({\n code: 'custom',\n path: ['actorExternalId'],\n message: 'exactly one of actorExternalId and actorIdentityId is required'\n });\n }\n});\n// C→R REP (corr = rc/codehost-membership-authz id). One bit, same as GitHub.\nexport const RcCodeHostMembershipAuthzResult = z.object({ allowed: z.boolean() });\n// R→C REQ — signature-verified Check identity, suite identity, or waiting external-PR workflow control.\nconst GithubNumericId = z.string().regex(/^[1-9]\\d*$/);\nexport const RcGithubRerequest = z.union([\n z\n .object({\n checkRunId: GithubNumericId,\n repoId: GithubNumericId,\n headSha: z.string().min(1),\n deliveryKey: z.string().min(1).max(200),\n // Rolling opt-in: a new CP includes baseSha only when a new relay asks.\n // This keeps replies to older strict-schema relays byte-compatible.\n includeBaseSha: z.literal(true).optional(),\n // An organization App delivered it: the Check must be that App's.\n appId: GithubNumericId.optional()\n })\n .strict(),\n z\n .object({\n scope: z.literal('suite'),\n appId: GithubNumericId,\n installationId: GithubNumericId,\n repoId: GithubNumericId,\n headSha: z.string().min(1),\n deliveryKey: z.string().min(1).max(200)\n })\n .strict(),\n z\n .object({\n scope: z.literal('workflow'),\n installationId: GithubNumericId,\n repoId: GithubNumericId,\n headSha: z.string().min(1),\n pullNumber: z.number().int().positive().optional(),\n deliveryKey: z.string().min(1).max(200)\n })\n .strict()\n]);\n// C→R REP — a bare denial or durable run targets that relay re-fences against current compiled rules.\nconst RcGithubRerequestTarget = z\n .object({\n hookId: z.string().uuid(),\n pullNumber: z.number().int().positive(),\n baseSha: z.string().min(1),\n configRevision: HookBigIntString,\n dispatchRevision: HookBigIntString\n})\n .strict();\nexport const RcGithubRerequestResult = z.union([\n z.object({ allowed: z.literal(false) }).strict(),\n z\n .object({\n allowed: z.literal(true),\n hookId: z.string().uuid(),\n pullNumber: z.number().int().positive(),\n baseSha: z.string().min(1).optional(),\n configRevision: HookBigIntString,\n dispatchRevision: HookBigIntString\n })\n .strict(),\n z\n .object({\n allowed: z.literal(true),\n targets: z.array(RcGithubRerequestTarget).min(1)\n })\n .strict()\n]);\n// ── hooks (webhook-triggers-and-github-events.md; pool-wide broadcast) ──────\n/** The github member of a compiled rule (P2). */\nexport const RcGithubHookRule = z.object({\n repoId: z.string(), // GitHub numeric repo id (BigInt as string) — the match key\n repoFullName: z.string(), // display/logs only; never matched on\n // Immutable per-thread session namespace; optional for a CP that predates rename-stable affinity.\n sessionKeyPrefix: z.string().min(1).optional(),\n events: z.array(z.string()), // 'issues:opened' / 'pull_request:*' / …\n labelFilter: z.array(z.string()),\n // Draft PR revisions do not fire; `ready_for_review` reviews the head instead. Absent on a CP that predates it.\n skipDrafts: z.boolean().optional(),\n // Scopes GitHub's shared issue_comment event to the console-selected thread families; absent or empty keeps the legacy repo-wide meaning.\n commentFamilies: z.array(z.enum(['issues', 'pull_request'])).optional(),\n // P3 summon mode: authored text must @-mention this agent or the App; thread events still pass the live maintainer gate.\n mentionOnly: z.boolean(),\n // The broadcast handle: `@<appSlug>` keeps every matching rule in the repo fan-out (compiled from GITHUB_APP_SLUG).\n appSlug: z.string().optional(),\n // The org's other GitHub Apps (the built-in one included): their same-repository pull request revisions are the internal CI lane too.\n internalAppSlugs: z.array(z.string()).optional(),\n // The targeted handle: `@<agentName>` keeps only this agent's rules; optional for a CP that predates targeted mentions.\n agentName: z.string().optional(),\n // The org's valid installation ids (BigInt as string): an event fires only if payload.installation.id is in the set.\n installationIds: z.array(z.string())\n});\n/** Relays that fill an installation rule's repository in from each event advertise this (webhook-triggers-and-github-events.md, Installation-Wide Rows). */\nexport const HOOK_GITHUB_INSTALLATION_V1_FEATURE = 'hook-github-installation-v1';\n/** A relay that forwards a generic rule's `webhook.instructions` on each delivery, so the CP may send it one. */\nexport const HOOK_INSTRUCTIONS_V1_FEATURE = 'hook-instructions-v1';\n/** An installation-wide github rule: every repository of one App installation, the event naming the repository; its session prefix is `github:<repoId>`. */\nexport const RcGithubInstallationHookRule = RcGithubHookRule.omit({\n repoId: true,\n repoFullName: true,\n sessionKeyPrefix: true\n}).extend({\n installationId: z.string().regex(/^[1-9]\\d*$/), // the covered installation (BigInt as string) — the match key\n accountLogin: z.string().min(1) // display/logs only; never matched on\n});\n/** The gitlab member of a compiled rule (gitlab-com-integration.md §11.3); it carries the signing token inline, so the rule is NEVER logged. */\nexport const RcGitlabHookRule = z.object({\n projectId: z.string().regex(/^[1-9]\\d*$/), // numeric project id — the match key\n projectPath: z.string().min(1), // display/logs only; never matched on\n sessionKeyPrefix: z.string().min(1), // rename-stable per-thread namespace: gitlab:<projectId>\n events: z.array(z.string()), // 'issues:*' / 'merge_request:*' / 'push:*' …\n // Non-empty ⇒ the subject's CURRENT labels must intersect it (case-insensitive); optional for a CP predating the filter.\n labelFilter: z.array(z.string()).optional(),\n commentFamilies: z.array(z.enum(['issues', 'merge_request'])).optional(),\n mentionOnly: z.boolean(),\n agentName: z.string().optional(),\n // The binding's runtime identity: loop prevention (§12.1) and the mention/reviewer targets.\n serviceAccountUserId: z.string().regex(/^[1-9]\\d*$/),\n serviceAccountUsername: z.string().min(1),\n // §12.1 veto set: every managed account bound to the project; additive optional (§17.3), a rule without it vetoes only the account above.\n boundServiceAccountUserIds: z.array(z.string().regex(/^[1-9]\\d*$/)).optional(),\n // whsec_ Standard Webhooks signing key for §11.2 verification.\n signingToken: z.string().min(1),\n // The instance this rule addresses (§24.4), copied opaquely onto forwarded metadata as the turn-time host fence; absent means GitLab.com.\n host: z.string().optional()\n});\n/** The gitea member of a compiled rule (gitea-integration.md §7); it carries the signing key inline, so the rule is NEVER logged. */\nexport const RcGiteaHookRule = z.object({\n repoId: z.string().regex(/^[1-9]\\d*$/), // numeric repository id — the match key\n repoPath: z.string().min(1), // display/logs only; never matched on\n sessionKeyPrefix: z.string().min(1), // rename-stable per-thread namespace: gitea:<repoId>\n events: z.array(z.string()), // 'issues:*' / 'merge_request:*' / 'push:*' …\n // Non-empty ⇒ the subject's CURRENT labels must intersect it (case-insensitive); additive optional, an older relay ignores it.\n labelFilter: z.array(z.string()).optional(),\n // The comment SUBJECT vocabulary (`is_pull`), not the event family: the CP maps a stored `merge_request` scope here.\n commentFamilies: z.array(z.enum(['issues', 'pull_request'])).optional(),\n mentionOnly: z.boolean(),\n agentName: z.string().optional(),\n // The connection's single bot user: the §8 veto set and the mention/reviewer target. Gitea's\n // permission lookup is by username, so the relay forwards the login beside the numeric id.\n botUserId: z.string().regex(/^[1-9]\\d*$/),\n botUsername: z.string().min(1),\n // Hex HMAC-SHA256 key for the `X-Gitea-Signature` verification of §7.\n signingKey: z.string().min(1),\n // The successor key mid-rotation (§7): the relay accepts either until the CP promotes it.\n nextSigningKey: z.string().min(1).optional(),\n // The instance this rule addresses (§3), copied opaquely onto forwarded metadata as the turn-time host fence; absent means gitea.com.\n host: z.string().optional()\n});\n/** The fixed Basic user name every Azure DevOps subscription is created with (azure-devops-integration.md §11.2); the password is the signing key. */\nexport const AZURE_DEVOPS_HOOK_BASIC_USER = 'agentconnect';\n/** One recorded service hook subscription of the binding and the delivery kind it was created for. */\nexport const RcAzureDevOpsHookSubscription = z.object({\n subscriptionId: z.guid().toLowerCase(),\n kind: AzureDevOpsDeliveryKind\n});\n/** The azureDevOps member of a compiled rule (azure-devops-integration.md §11.3); it carries the signing keys inline, so the rule is NEVER logged. */\nexport const RcAzureDevOpsHookRule = z\n .object({\n repoId: z.string().regex(/^[1-9]\\d*$/), // the surrogate repository id\n repoPath: z.string().min(1), // organization/project/repository — display/logs only; never matched on\n sessionKeyPrefix: z.string().min(1), // rename-stable per-thread namespace: azure-devops:<repoId>\n ...AzureDevOpsRepoRouting.shape,\n // The organization's collection id, which every delivery names in `resourceContainers.collection`.\n instanceId: z.guid().toLowerCase(),\n // Every subscription the binding records: the relay's lookup key, each with the one kind it delivers.\n subscriptions: z.array(RcAzureDevOpsHookSubscription).min(1).max(16),\n events: z.array(z.string()), // 'merge_request:*' / 'push:*' …; no issues, releases or labels\n commentFamilies: z.array(z.enum(['pull_request'])).optional(),\n mentionOnly: z.boolean(),\n agentName: z.string().optional(),\n // The connection's identity: the §11.4 veto set and the broadcast mention.\n identityId: z.guid().toLowerCase(),\n // The Basic password each subscription sends; mid-rotation the next one verifies too.\n signingKey: z.string().min(1),\n nextSigningKey: z.string().min(1).optional(),\n // The key a promotion replaced, still accepted until its expiry so a queued retry is not refused.\n previousSigningKey: z.string().min(1).optional(),\n previousSigningKeyExpiresAt: z.string().datetime().optional()\n})\n .superRefine((rule, ctx) => {\n if ((rule.previousSigningKey === undefined) !== (rule.previousSigningKeyExpiresAt === undefined)) {\n ctx.addIssue({\n code: 'custom',\n path: ['previousSigningKeyExpiresAt'],\n message: 'previousSigningKey and previousSigningKeyExpiresAt go together'\n });\n }\n const ids = rule.subscriptions.map((subscription) => subscription.subscriptionId);\n if (new Set(ids).size !== ids.length) {\n ctx.addIssue({ code: 'custom', path: ['subscriptions'], message: 'a subscription is recorded once' });\n }\n});\n/** A code-host rule's routing scope: one routing per organization, repository and subject family, hosted by one watching agent. */\nexport const RcHookRouting = z.object({\n routingId: z.string().uuid(),\n decisionId: z.string().uuid(),\n // The watching agent whose daemon evaluates, and that daemon, so every relay names the same host.\n evaluationAgentId: z.string().uuid(),\n evaluationDaemonId: z.string().uuid()\n});\n// C→R EVT — one enabled hook's compiled rule, broadcast to the WHOLE pool\n// (webhook-type ingress is pool-served, shared-bot-relay.md §5). Upsert\n// semantics: the CP re-sends the full frame on hook create/update/enable, on\n// agent placement moves, and (github kind) when the org's installation set\n// changes; disable/delete send `rc/hook-remove`. After a relay (re)registers\n// the CP replays every enabled hook — the relay's table is a memory copy.\n// `hmacSecret` is secret material — NEVER log this frame.\nexport const RcHookAssign = z\n .object({\n hookId: z.string().uuid(),\n kind: z.enum(HOOK_KINDS),\n agentId: z.string().uuid(),\n daemonId: z.string().uuid(), // the agent's CURRENT placement; re-sent on moves\n // R1/R2a rolling fields. Partial/absent remains decodable, but the relay\n // propagates an incomplete tuple with review/reporting forced off.\n ...OptionalHookConfigSnapshot.shape,\n sessionMode: z.enum(['perDelivery', 'perThread', 'perSubject', 'shared']),\n target: CronTarget.optional(), // output anchoring; absent ⇒ headless\n // The repository scope's Decision routing this rule belongs to; its events go once to the evaluation host (code-host-decisions.md §4).\n routing: RcHookRouting.optional(),\n // kind=webhook — required for that kind (enforced at the CP compile site)\n webhook: z\n .object({\n urlToken: z.string().min(1), // ingress routing key (capability URL)\n hmacSecret: z.string().optional(), // optional X-AC-Signature key\n // Only to relays advertising HOOK_INSTRUCTIONS_V1_FEATURE: an older one would drop it and run the payload as the instruction.\n instructions: HookInstructions.optional()\n })\n .optional(),\n // kind=github (P2) — required for that kind, unless the rule is installation-wide\n github: RcGithubHookRule.optional(),\n // kind=github installation row — only to relays advertising HOOK_GITHUB_INSTALLATION_V1_FEATURE\n githubInstallation: RcGithubInstallationHookRule.optional(),\n // kind=gitlab (gitlab-com-integration.md §11.3) — required for that kind\n gitlab: RcGitlabHookRule.optional(),\n // kind=gitea (gitea-integration.md §7) — required for that kind\n gitea: RcGiteaHookRule.optional(),\n // kind=azure-devops (azure-devops-integration.md §11.3) — required for that kind, only to relays advertising azure-devops-hooks-v1\n azureDevOps: RcAzureDevOpsHookRule.optional()\n})\n .superRefine((rule, ctx) => {\n if (rule.github !== undefined && rule.githubInstallation !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['githubInstallation'],\n message: 'a rule watches a repository or an installation, not both'\n });\n }\n if (rule.dispatchDaemonId !== undefined && rule.dispatchDaemonId !== rule.daemonId) {\n ctx.addIssue({\n code: 'custom',\n path: ['dispatchDaemonId'],\n message: 'dispatchDaemonId must equal daemonId on a compiled rule'\n });\n }\n});\n/** The code-host rule a compiled rule carries; undefined for the generic kind or a kind missing its member. */\nexport function codeHostHookRuleOf(rule) {\n if (rule.kind === 'github' && rule.github) {\n const { repoId: externalId, repoFullName: path } = rule.github;\n return { provider: 'github', repo: { provider: 'github', externalId, path }, rule: rule.github };\n }\n if (rule.kind === 'gitlab' && rule.gitlab) {\n const { projectId: externalId, projectPath: path } = rule.gitlab;\n return { provider: 'gitlab', repo: { provider: 'gitlab', externalId, path }, rule: rule.gitlab };\n }\n if (rule.kind === 'gitea' && rule.gitea) {\n const { repoId: externalId, repoPath: path } = rule.gitea;\n return { provider: 'gitea', repo: { provider: 'gitea', externalId, path }, rule: rule.gitea };\n }\n if (rule.kind === 'azure-devops' && rule.azureDevOps) {\n const { repoId: externalId, repoPath: path } = rule.azureDevOps;\n const repo = { provider: 'azure-devops', externalId, path };\n return { provider: 'azure-devops', repo, rule: rule.azureDevOps };\n }\n return undefined;\n}\n// C→R EVT — drop one rule (hook disabled / deleted / agent unplaced).\nexport const RcHookRemove = z.object({\n hookId: z.string().uuid()\n});\n/** Definite pre-dispatch unavailability: the relay found no live connection for\n * the assigned daemon, so no agent turn or external review effect could start. */\nexport const HOOK_DELIVERY_REASON_DAEMON_OFFLINE = 'daemon_offline';\n/** Definite pre-admission refusal while the selected daemon is draining. */\nexport const HOOK_DELIVERY_REASON_DAEMON_DRAINING = 'rejected:draining';\n/** Definite pre-admission refusal after no routed daemon acquired the agent duty. */\nexport const HOOK_DELIVERY_REASON_DAEMON_NOT_HOLDER = 'rejected:not_holder';\n/** Ambiguous delivery: the daemon may have admitted the message before the ACK\n * was lost. Record it consistently, but do not automatically redeliver it\n * without cross-daemon idempotency or an end-to-end admission fence. */\nexport const HOOK_DELIVERY_REASON_DISPATCH_TIMEOUT = 'dispatch_timeout';\n/** A PR authored outside the repository's write boundary is intentionally not\n * dispatched until a maintainer explicitly requests review. The failed\n * delivery-stage row is a metadata-only durable anchor for the actionable\n * informational Check; it does not represent an attempted agent turn. */\nexport const HOOK_DELIVERY_REASON_REVIEW_REQUEST_REQUIRED = 'review_request_required';\n/** Identifier returned by GitHub when a maintainer clicks the Check action that\n * opens the first review generation for an external PR. */\nexport const GITHUB_REQUEST_REVIEW_ACTION = 'request_review';\n/** Closed set of delivery failures proven to occur before durable daemon admission. */\nexport const RETRYABLE_HOOK_DELIVERY_REASONS = [\n HOOK_DELIVERY_REASON_DAEMON_OFFLINE,\n HOOK_DELIVERY_REASON_DAEMON_DRAINING,\n HOOK_DELIVERY_REASON_DAEMON_NOT_HOLDER\n];\nconst retryableHookDeliveryReasons = new Set(RETRYABLE_HOOK_DELIVERY_REASONS);\nexport function isRetryableHookDeliveryReason(reason) {\n return typeof reason === 'string' && retryableHookDeliveryReasons.has(reason);\n}\n// R→C EVT (fire-and-forget) — delivery-stage bookkeeping, pure metadata (no\n// payload ever). `accepted` opens the HookRun row (running); `failed` records a\n// failed row outright. The daemon's `hook/report` completion EVT (frames/hook.ts,\n// the control WS) later closes accepted rows; the HookRunReaper harvests the\n// rest. Duplicate reports collapse on the CP's (hookId, deliveryKey) unique key.\nexport const RcRunReport = z\n .object({\n hookId: z.string().uuid(),\n deliveryKey: z.string().min(1),\n firedAt: z.string().datetime(), // relay ingest time == HookRun.startedAt\n agentId: z.string().uuid(),\n daemonId: z.string().uuid().optional(),\n ...OptionalHookConfigSnapshot.shape,\n event: z.string().min(1).optional(), // 'issues:opened' etc (github); absent for webhook kind\n github: GithubHookMetadata.optional(),\n gitlab: GitlabHookMetadata.optional(),\n gitea: GiteaHookMetadata.optional(),\n azureDevOps: AzureDevOpsHookMetadata.optional(),\n status: z.enum(['accepted', 'failed']),\n reason: z.string().optional() // delivery-stage reason; use isRetryableHookDeliveryReason before redelivery\n})\n .superRefine((report, ctx) => {\n if (report.daemonId !== undefined &&\n report.dispatchDaemonId !== undefined &&\n report.daemonId !== report.dispatchDaemonId) {\n ctx.addIssue({\n code: 'custom',\n path: ['dispatchDaemonId'],\n message: 'dispatchDaemonId must equal daemonId on a delivery report'\n });\n }\n});\n// R→C EVT (fire-and-forget) — installation doorbell (webhook-triggers decision 11):\n// the relay forwards a verified `installation`/`installation_repositories`\n// event as a minimal poke; the CP re-pulls `GET /app/installations/{id}` as the\n// source of truth (`action` is observational — the CP never writes from it).\n// Emitted ONLY after X-Hub-Signature-256 verification. A dropped doorbell is\n// safe for a durable claim: the setup callback / scoped manual Sync /\n// mint-failure refresh paths converge eventually.\nexport const RcGithubInstallation = z.object({\n installationId: z.string().min(1), // GitHub numeric id (BigInt as string)\n action: z.string().min(1), // created|deleted|suspend|…|added|removed\n // Set when an organization App delivered it (its GitHub App id): the CP re-pulls that App's roster.\n appId: GithubNumericId.optional()\n});\n// R→C EVT — one verified, body-free code-host delivery, matched or not (gitea-integration.md §6, §7): it verifies the binding and promotes a rotated key; a drop is never an error.\nexport const RcCodeHostDelivery = z.object({\n provider: CodeHostProviderString,\n repoExternalId: CodeHostExternalId,\n deliveryKey: z.string().min(1),\n receivedAt: z.string().datetime(),\n // Which of the rule's signing keys verified the body; absent means the current one. `previous` is Azure DevOps's retry window.\n verifiedWith: z.enum(['current', 'next', 'previous']).optional()\n});\n// ── revocation (§9 revocation loop) ─────────────────────────────────────────\n// C→R EVT — the daemon's credential was revoked / membership removed: the relay\n// must immediately drop that daemon's connection and stop routing to it.\nexport const RcDaemonRevoke = z.object({\n daemonId: z.string().uuid()\n});\n// The Block Kit `action_id` on a shared bot's 👤 switch-agent button (§10.1; older\n// posted messages may still carry the same action on their footer). The DAEMON renders\n// the button (send-only) and the RELAY receives the click over HTTP interactivity — they're\n// different processes, so the id is pinned here as the single source. The `callback_id`\n// on the relay-owned default-agent modal shares the same string. Session configuration\n// uses `SLACK_STATUS_ACTION.manage` (⚙️) instead.\nexport const SHARED_CONFIG_ACTION_ID = 'ac_shared_channel_config';\n/** The Block Kit `action_id` on a shared status bar's inline agent selector.\n * The relay owns the shared app's HTTP interaction edge and answers both the\n * external-select suggestions and the resulting channel-default selection. Keep\n * this separate from {@link SHARED_CONFIG_ACTION_ID}: older posted messages still\n * use that id for the legacy 👤 button + modal flow. */\nexport const SHARED_AGENT_SELECT_ACTION_ID = 'ac_shared_agent_select';\n// `SLACK_MANAGE_SESSION_SHORTCUT_CALLBACK_ID` is declared in the app manifest, so\n// it lives in `../slack-app-manifest.ts` and is re-exported from the package root\n// alongside the ids below. See that file for why it cannot import back into here.\n/** Slack action ids shared by the daemon-owned status modal and the relay-owned\n * HTTP interaction edge. Dedicated bots handle them in the daemon directly; shared bots\n * forward them from the relay to the target daemon. */\nexport const SLACK_STATUS_ACTION = {\n more: 'ac_more',\n manage: 'ac_manage',\n setModel: 'ac_set_model',\n setEffort: 'ac_set_effort',\n setPermissionMode: 'ac_set_permission_mode',\n setFast: 'ac_set_fast',\n setOutput: 'ac_set_output',\n cancel: 'ac_cancel',\n view: 'ac_view'\n};\n/** Slack action ids/codecs shared by the daemon-rendered human-input cards and\n * the relay-owned HTTP interaction edge. Keeping them on the wire package prevents\n * direct Socket Mode and HTTP relay mode from interpreting the same card differently. */\nexport const PERMISSION_ACTION_PREFIX = 'ac_perm';\nexport const ELICIT_ACTION_PREFIX = 'ac_elicit';\nexport const ELICIT_DISMISS_ACTION = 'ac_elicit_dismiss';\n/** The Confirm button on an elicitation card whose fields are `input` blocks — a select, a\n * checkbox list or a typed box never submits on its own. Nothing is tracked between the two:\n * Confirm reads every field out of its OWN payload's message state, so what it submits is the\n * state that card was in when this reader tapped it. Its `value` is the bare request id. */\nexport const ELICIT_CONFIRM_ACTION = 'ac_elicit_confirm';\n/** The `action_id` every one of those `input` elements carries. One input per block, because\n * Slack keys the submitted state by BLOCK id — {@link elicitFormBlockId} is that key. */\nexport const ELICIT_FORM_INPUT_ACTION = 'ac_elicit_input';\nconst ELICIT_FORM_BLOCK_PREFIX = 'ac_elicit_f';\n/** The block id of the card's Nth field. The INDEX rather than the property name: a property\n * name can outrun Slack's own id length, and the daemon re-derives the field list from the\n * card's params anyway (#1815), so an index is all the wire has to carry. */\nexport function elicitFormBlockId(index) {\n return `${ELICIT_FORM_BLOCK_PREFIX}${index}`;\n}\n/** The field index one of those block ids names, or null when the id is not one of ours. */\nexport function elicitFormBlockIndex(blockId) {\n if (!blockId.startsWith(ELICIT_FORM_BLOCK_PREFIX))\n return null;\n const digits = blockId.slice(ELICIT_FORM_BLOCK_PREFIX.length);\n return /^\\d+$/.test(digits) ? Number(digits) : null;\n}\n/** What the reader typed and picked on a form card, keyed by the field's BLOCK id so a per-field\n * verdict can name the very same key. A blank input and a cleared select are OMITTED rather than\n * reported as empty: an untouched optional field is absent from the answer, which is what the\n * schema means by optional, and the daemon's own accept check is what decides whether a required\n * one may be missing. Pure. */\nexport function elicitFormViewValues(state) {\n const out = {};\n for (const [blockId, block] of Object.entries(state?.values ?? {})) {\n if (elicitFormBlockIndex(blockId) === null)\n continue;\n const input = block?.[ELICIT_FORM_INPUT_ACTION];\n if (!input)\n continue;\n if (Array.isArray(input.selected_options)) {\n const values = input.selected_options.map((o) => o.value);\n if (values.every((v) => typeof v === 'string'))\n out[blockId] = values;\n continue;\n }\n const picked = input.selected_option?.value;\n if (typeof picked === 'string')\n out[blockId] = picked;\n else if (typeof input.value === 'string' && input.value.length)\n out[blockId] = input.value;\n }\n return out;\n}\n/** Encode/decode the choice carried by permission and elicitation buttons. The\n * daemon-generated request id is `|`-free; runtime-owned option values may contain it. */\nexport function encodePermValue(requestId, optionId) {\n return `${requestId}|${optionId}`;\n}\nexport function decodePermValue(value) {\n const i = value.indexOf('|');\n return i < 0 ? null : { requestId: value.slice(0, i), optionId: value.slice(i + 1) };\n}\n/** One short choice from the compact Slack status overflow. Slack caps option\n * values at 150 characters; the longer session target rides in `block_id`. */\nexport const SlackStatusOverflowAction = z.enum(['switch-agent', 'manage', 'cancel']);\nconst LegacySlackStatusOverflowValue = z\n .object({\n v: z.literal(1),\n action: SlackStatusOverflowAction,\n target: z.string().min(1)\n})\n .strict();\nexport function encodeSlackStatusOverflowValue(action) {\n return action;\n}\nexport function decodeSlackStatusOverflowValue(value) {\n const compact = SlackStatusOverflowAction.safeParse(value);\n if (compact.success)\n return { action: compact.data };\n try {\n const legacy = LegacySlackStatusOverflowValue.safeParse(JSON.parse(value));\n return legacy.success ? { action: legacy.data.action, target: legacy.data.target } : null;\n }\n catch {\n return null;\n }\n}\n/** Opaque routing target carried by a shared bot's session-config button and modal.\n * Slack returns it unchanged in `action.value` / `view.private_metadata`; the relay\n * validates the agent against its current bot assignment before forwarding. */\nexport const SharedSlackStatusTarget = z\n .object({\n v: z.literal(1),\n agentId: z.string().min(1),\n integrationId: z.string().min(1),\n sessionKey: z.string().min(1)\n})\n .strict();\nexport function encodeSharedSlackStatusTarget(target) {\n return JSON.stringify({ v: 1, ...target });\n}\nexport function decodeSharedSlackStatusTarget(value) {\n try {\n const parsed = SharedSlackStatusTarget.safeParse(JSON.parse(value));\n return parsed.success ? parsed.data : null;\n }\n catch {\n return null;\n }\n}\n// ── shared-bot assignment + routing (§7.1 / §10) ─────────────────────────────\n// One attributed routing rule the relay arbitrates inbound against. Unlike the\n// daemon's local BindRule this ALREADY carries its target (agentId + the daemon\n// to forward to + the integration id to send the reply back through) — the\n// CP→relay protocol is new, so the v1 \"owner side can't express attribution\"\n// blocker is fixed by attaching attribution here (§3). `scope` narrows the rule\n// to a channel/thread (channel ownership → per-channel default agent, §10).\nexport const AttributedRoute = z.object({\n agentId: z.string().uuid(),\n daemonId: z.string().uuid(),\n integrationId: z.string().uuid(),\n scope: z.object({ channel: z.string().optional(), thread: z.string().optional() }).optional(),\n match: BindMatch,\n decisionId: z.string().min(1).max(128).optional() // present exactly when match.kind === 'decision'\n});\n// Ingress-only credentials handed to the relay. Slack currently keeps its bot\n// token here for the existing HTTP interaction/channel APIs. Feishu deliberately\n// sends only callback verification material: its app secret and all provider API\n// egress stay on the daemon. Secret — NEVER log this frame.\nexport const RcBotSecrets = z.union([\n // The typed variants keep full validation for today's platforms AND pass unknown\n // keys through (`catchall`): a bag that satisfies a typed prefix may still carry\n // additional credential fields a newer platform module needs — stripping them\n // here would hand the §6.7 platform-module boundary less than what was on the\n // wire. Ordered first so validation still applies during the window.\n z\n .object({\n botToken: z.string(),\n signingSecret: z.string()\n })\n .catchall(z.unknown()),\n z\n .object({\n verificationToken: z.string(),\n encryptKey: z.string().optional()\n })\n .catchall(z.unknown()),\n // §6.7 open reader: a platform this build predates ships an opaque secret bag;\n // the relay's platform module (S3) validates its shape.\n z.record(z.string(), z.unknown())\n]);\n// One member agent's display info — the relay holds no DB, so it can't resolve a\n// name from an id. Carried so the relay can label the per-channel \"default agent\"\n// picker modal (§10.1 config button). Ids alone aren't enough for a human list.\nexport const RcAgentDirEntry = z.object({\n agentId: z.string().uuid(),\n name: z.string(), // the slug; the modal shows it (displayName folded in by the CP if set)\n daemonId: z.string().uuid(),\n // Rolling optional: new CPs include the install id so a receive-only relay can\n // hand an unroutable gated callback to the daemon that owns provider egress.\n integrationId: z.string().uuid().optional()\n});\n// One conversation's DEFAULT agent — the ladder rung consulted after keyword and\n// thread continuity and before the group's `defaultAgentId` (linear-integration.md\n// §6.2). It is what a conversation row's owner compiles to on a platform whose every\n// event already addresses the bot, where a channel-scoped route would instead outrank\n// the keyword and continuity rungs. Empty on every platform without that axis.\nexport const RcConversationDefault = z.object({\n channel: z.string().min(1),\n agentId: z.string().uuid(),\n daemonId: z.string().uuid(),\n integrationId: z.string().uuid()\n});\n// One executable By decision routing conversation and the one daemon that evaluates it (message-intake.md §6).\nexport const RcRoutedConversation = z.object({\n channel: z.string().min(1),\n decisionId: z.string().min(1).max(128),\n evaluationDaemonId: z.string().uuid(),\n // The agents its routing can select. Saving the routing needs edit rights on each, so it enables a gated (§14)\n // one in this conversation as a channel-scoped route does; absent ⇒ an older CP, only routes enable one\n targetAgentIds: z.array(z.string().uuid()).max(64).optional()\n});\n// C→R EVT — load a shared bot's INBOUND routing + credentials onto this relay:\n// inbound arrives over the shared HTTP Events API endpoints (`/slack/events`,\n// `/slack/interactions`) and is arbitrated against `routes`. Whole-pool: the CP\n// BROADCASTS this to EVERY connected relay (any pod may receive an event via the\n// stable `PUBLIC_RELAY_URL` LB); there is no per-bot relay placement. `members`\n// lists which daemons/agents this bot serves (drives which daemon connections the\n// relay expects). NEVER log.\nexport const RcBotAssign = z.object({\n botId: z.string().uuid(),\n // Console organization path for provider-owned management links; absent from older CPs.\n orgSlug: z.string().min(1).optional(),\n // Bindings outlive daemon availability; an empty array means the installation is disconnected.\n installedAgentIds: z.array(z.string().uuid()).optional(),\n // S1a open reader (route.ts Platform policy). The CP only emits ids the\n // relay build supports; the relay's assign handler already refuses an\n // unsupported platform gracefully (\"not yet supported\"), never the socket.\n platform: Platform,\n // §6.1: the platform's origin kind, so an older relay can classify an id a\n // newer CP introduces (always 'chat' for a bot assignment today). Overlaid on\n // the relay's built-in seed; absent (older CP) ⇒ the seed answers, and an id\n // neither classifies defaults to 'chat' (fail-closed in coordsDecision).\n originKind: z.string().min(1).optional(),\n // Install GENERATION of the credentials below — advanced by the CP every time a\n // fresh credential lands on this bot. The relay echoes it back in\n // `rc/bot-revoked` so the CP can refuse a revocation observed under a credential\n // that has since been replaced (Slack does not order lifecycle events). Absent\n // ⇒ the CP applies revocations without the revision arm of the fence.\n credentialRevision: z.number().int().nonnegative().optional(),\n secrets: RcBotSecrets,\n // §6.7 opaque INGRESS bag — the ONE carrier of the per-platform demux identity\n // (Slack: apiAppId \"A…\" + the distributed-install teamId \"T…\" + botUserId;\n // Feishu: appId \"cli_…\"). Shape validation belongs to the platform module on\n // both ends (S3): the CP provider's `projectBotAssign` produces it, the\n // relay's `toBotAssignment` / platform ingress plugin consume it. The legacy\n // named top-level twins (`apiAppId`/`teamId`/`botUserId`) left the schema with\n // the S3 protocol cleanup — emission stopped when the bag landed (#556) and\n // the bag-preferring reader shipped before that (#545), so nothing deployed\n // reads or writes them.\n ingress: z.unknown().optional(),\n members: z.array(z.object({ daemonId: z.string().uuid(), agentIds: z.array(z.string().uuid()) })),\n agents: z.array(RcAgentDirEntry).default([]), // member directory (id→name) for the config modal\n routes: z.array(AttributedRoute),\n defaultAgentId: z.string().uuid().optional(), // bare @bot / DM fallback within the group (§10.3)\n defaultDaemonId: z.string().uuid().optional(),\n // Conversation gating (resource-visibility.md §14): member agents whose ingress is\n // fail-closed. The relay's thread-affinity rung honours a binding to a gated agent\n // only while that agent still has a channel-scoped route in the conversation —\n // otherwise a thread bound before the gate was applied would keep routing forever.\n gatedAgentIds: z.array(z.string().uuid()).default([]),\n // Channels switched OFF for this bot. The relay's ladder has rungs no\n // channel-scoped route can suppress — unscoped keyword, the group's\n // `defaultAgentId`, thread continuity — so an Off channel needs a subtractive\n // fence rather than the mere absence of a route. A muted channel resolves to no\n // target at all. Bot-scoped, matching how an HTTP bot's channels converge on one\n // owner, and how the trigger is replicated across its membership rows. Defaults empty.\n mutedChannels: z.array(z.string()).default([]),\n // The muted channels that are Off rather than a held decision: an addressed message there gets the §14.3 notice.\n offChannels: z.array(z.string()).default([]),\n // Per conversation, the bot senders whose posts activate no agent of this bot there.\n blockedBotSenders: z.array(ChannelBlockedBotSenders).optional(),\n // §14.3 gating notice in a CHANNEL: the relay that posts it, since a channel mention's two event copies may land on different pods; absent ⇒ no relay posts.\n noticeAuthority: z.string().uuid().optional(),\n // §14.10: ms left in which a gated member's own new room may still be opening, so an unrouted message in a room this bot owns is retried rather than refused.\n roomOpeningMs: z.number().int().positive().max(120_000).optional(),\n // linear-integration.md §6.2 — the per-conversation default rung's table, keyed by\n // channel id, and the fact the thread-affinity gate reads for a gated agent on an\n // `ownerAsDefault` platform (its grant is the default seat it holds). Empty elsewhere.\n conversationDefaults: z.array(RcConversationDefault).default([]),\n // §9.1's platform axis, projected so the relay can pick the terminal `grant-withdrawn`\n // affinity refusal over Slack's fall-through without ever reading a platform name.\n ownerAsDefault: z.boolean().default(false),\n // Executable routed conversations only (held ones are muted); absent means none, as from an older CP.\n routedConversations: z.array(RcRoutedConversation).default([])\n});\n// C→R EVT — release a shared bot from this relay (bot un-shared, uninstalled, or\n// re-placed onto another relay): close the ingest, drop the routing table.\nexport const RcBotUnassign = z.object({\n botId: z.string().uuid(),\n // The install GENERATION this release describes. A revocation decides and\n // commits, then broadcasts — and a re-install can land in that gap, commit\n // N+1, and broadcast its own assign FIRST. An unfenced unassign arriving after\n // it would tear down the live ingest of a credential it never described. The\n // relay therefore ignores an unassign whose revision is older than the\n // assignment it currently holds. Absent ⇒ unconditional release (a transport\n // flip, an un-share, the last install removed — none of which race a\n // credential).\n credentialRevision: z.number().int().nonnegative().optional()\n});\n// C→R EVT — hot-update the routing table for an already-assigned bot (channel\n// ownership / membership / default-agent change) WITHOUT re-opening the ingest.\nexport const RcRoutes = z.object({\n botId: z.string().uuid(),\n members: z.array(z.object({ daemonId: z.string().uuid(), agentIds: z.array(z.string().uuid()) })),\n agents: z.array(RcAgentDirEntry).default([]),\n routes: z.array(AttributedRoute),\n defaultAgentId: z.string().uuid().optional(),\n defaultDaemonId: z.string().uuid().optional(),\n gatedAgentIds: z.array(z.string().uuid()).default([]), // §14 — see RcBotAssign.gatedAgentIds\n mutedChannels: z.array(z.string()).default([]), // Off channels — see RcBotAssign.mutedChannels\n offChannels: z.array(z.string()).default([]), // see RcBotAssign.offChannels\n blockedBotSenders: z.array(ChannelBlockedBotSenders).optional(), // see RcBotAssign.blockedBotSenders\n noticeAuthority: z.string().uuid().optional(), // §14.3 — see RcBotAssign.noticeAuthority\n roomOpeningMs: z.number().int().positive().max(120_000).optional(), // §14.10 — see RcBotAssign.roomOpeningMs\n // Rides the hot update too: an owner edit converges through `syncRoutes` without a\n // re-assign, so an already-connected relay would otherwise keep the old default —\n // and with it the old grant fact — after exactly the edit this rung exists for.\n // The immutable `ownerAsDefault` axis stays assignment-scoped.\n conversationDefaults: z.array(RcConversationDefault).default([]),\n routedConversations: z.array(RcRoutedConversation).default([]) // see RcBotAssign.routedConversations\n});\n// C→R EVT — durable per-sessionKey thread affinity BROADCAST leg (§10 step 3): the\n// CP persists a (botId, sessionKey)→{agentId, daemonId} binding reported by a relay\n// via `rc/thread-assign` and broadcasts it to EVERY connected relay, so any pool pod\n// that later receives an un-mentioned follow-up routes it to the same agent. A relay\n// also learns affinity live from its own routing; this is the authoritative sync +\n// the answer to a `rc/thread-lookup` miss.\nexport const RcAssign = z.object({\n botId: z.string().uuid(),\n sessionKey: z.string().min(1),\n agentId: z.string().uuid(),\n daemonId: z.string().uuid()\n});\n// C→R EVT — one durable conversation member. Kept as a distinct frame from\n// `rc/assign` so an older relay can never strip a discriminator and accidentally\n// replace legacy single-owner affinity with an arbitrary participant.\nexport const RcParticipantAssign = z.object({\n botId: z.string().uuid(),\n sessionKey: z.string().min(1),\n agentId: z.string().uuid(),\n daemonId: z.string().uuid()\n});\n// R→C EVT (fire-and-forget) — the operator picked a channel's default agent in the\n// in-Slack config modal (§10.1). The CP persists it as the channel's owner\n// (IntegrationChannel.agentId on the chosen agent's install for this bot, clearing\n// any other install's row for the same channel) and re-compiles the bot's routes\n// (rc/routes). A shared channel always has one owner. The relay acks the modal\n// immediately; this rides best-effort like other rc EVTs.\nexport const RcSetChannelAgent = z.object({\n botId: z.string().uuid(),\n channelId: z.string().min(1),\n agentId: z.string().uuid()\n});\n// R→C EVT (fire-and-forget) — the relay received an HTTP-mode Slack membership\n// event for the bot itself, re-listed the bot's complete channel membership via\n// users.conversations, and reports that authoritative snapshot to the CP. The CP\n// fans it across every active integration of this bot and recompiles channel routes.\n// Channel names are control metadata; no message content crosses this wire.\nexport const RcBotChannels = z.object({\n botId: z.string().uuid(),\n channels: z.array(IntegrationChannel)\n});\n// A platform's own answer code, recorded beside a revocation or a rejection; bounded so it stays a code, never prose.\nexport const BotCredentialCode = z.string().min(1).max(64);\n// How a relay learned a credential is dead: a platform lifecycle `event`, or a `probe` of the credential answering definitively.\nexport const BotRevocationEvidence = z.enum(['event', 'probe']);\n// R→C REQ → rc/bot-revoked/ok — the bot's credential is definitively dead: revoke it, flip its installs, release it; kept queued until acknowledged and fenced against a replaced credential (preset-agents.md §5.3).\nexport const RcBotRevoked = z.object({\n botId: z.string().uuid(),\n reason: z.enum(['app_uninstalled', 'tokens_revoked']),\n // The generation this relay held when it observed the event (from `rc/bot-assign`); a mismatch refuses the report.\n credentialRevision: z.number().int().nonnegative().optional(),\n // The platform's event time in ms; refuses an event that predates the current credential even when the revision matches.\n eventAtMs: z.number().int().nonnegative().optional(),\n // Recorded with the revocation for the console; absent (an older relay) ⇒ `event`.\n evidence: BotRevocationEvidence.optional(),\n // The platform's own code behind a probe's verdict (e.g. `token_revoked`); absent ⇒ none recorded.\n code: BotCredentialCode.optional()\n});\n// C→R REP (corr = rc/bot-revoked id) — the committed verdict, `applied: false` meaning the fence refused it; both are terminal, only a missing reply is retried.\nexport const RcBotRevokedOk = z.object({\n botId: z.string().uuid(),\n applied: z.boolean()\n});\n// Fields every credential check carries, whatever its result.\nconst RcBotCredentialCheckBase = z.object({\n botId: z.string().uuid(),\n // The generation the relay probed; the CP applies the check only while it is still the bot's current one.\n credentialRevision: z.number().int().nonnegative(),\n // When the relay observed the answer, in ms: a rejection's first-seen time, and the order this relay's checks apply in (older ones are ignored).\n observedAtMs: z.number().int().nonnegative()\n});\n// R→C REQ → rc/bot-credential-check/ok — this relay's probe answer that is not a revocation (`rejected` is ambiguous, e.g. an IP allowlist); the CP keeps each relay's latest and marks the bot while any is rejected; sent only to a CP advertising `bot-credential-check-v2`.\nexport const RcBotCredentialCheck = z.discriminatedUnion('result', [\n RcBotCredentialCheckBase.extend({ result: z.literal('ok') }),\n RcBotCredentialCheckBase.extend({ result: z.literal('rejected'), code: BotCredentialCode })\n]);\n// C→R REP (corr = rc/bot-credential-check id) — committed; `applied: false` means a replaced credential, an unknown bot or relay, or an observation no newer than this relay's last, and nothing was written.\nexport const RcBotCredentialCheckOk = z.object({\n botId: z.string().uuid(),\n applied: z.boolean()\n});\n// R→C REQ → rc/bot-tenant/ok — the tenant key a single-tenant row's own traffic named (google-chat-integration.md §10.3); at-least-once, so the CP deduplicates; sent only to a CP advertising `bot-tenant-v1`.\nexport const RcBotTenant = z.object({\n botId: z.string().uuid(),\n // The platform's tenant key as the event named it (`customers/…`, `domains/…`); the platform module decides what it records.\n tenantId: z.string().min(1).max(256)\n});\n// C→R REP (corr = rc/bot-tenant id) — committed and pushed; `applied: false` means the row already knew the key (re-synced all the same), refused it, or is not one that learns, and nothing was written.\nexport const RcBotTenantOk = z.object({\n botId: z.string().uuid(),\n applied: z.boolean()\n});\n// R→C EVT (fire-and-forget) — INCREMENTAL conversation report (resource-visibility\n// §14.3): the relay saw an inbound direct conversation to a shared bot. The CP fans\n// a per-install row across every member, using each agent's visibility-appropriate\n// default. Incremental on purpose — unlike `rc/bot-channels` this must never\n// carry full-set semantics (DM rows are never dropped by snapshots). Conversation\n// id/name are control metadata; no message content crosses this wire. Loss is\n// self-healing: the counterpart's next DM re-reports.\nexport const RcBotConversation = z.object({\n botId: z.string().uuid(),\n conversation: IntegrationChannel\n});\n// R→C EVT (fire-and-forget): another bot posted in a conversation of a shared bot. A lost report heals on that bot's next post.\nexport const RcBotSender = z.object({\n botId: z.string().uuid(),\n channel: z.string().min(1),\n sender: ChannelBotSender\n});\n// R→C EVT (fire-and-forget) — durable thread-affinity REPORT leg (§10 step 3, the\n// 3-leg affinity dance). The relay tells the CP which agent now owns a (channel,\n// thread) `sessionKey` the first time it routes that thread, and again on a\n// Switch-agent. The CP is the single writer: it persists the (botId, sessionKey)→\n// {agentId, daemonId} binding and BROADCASTS it back to every relay via `rc/assign`.\n// Sibling of `rc/set-channel-agent`; rides best-effort like other rc EVTs.\nexport const RcThreadAssign = z.object({\n botId: z.string().uuid(),\n sessionKey: z.string().min(1),\n agentId: z.string().uuid(),\n daemonId: z.string().uuid()\n});\n// R→C EVT — add one durable participant without changing affinity. A distinct\n// frame fails closed against an older CP instead of being decoded as owner assignment.\nexport const RcThreadParticipant = z.object({\n botId: z.string().uuid(),\n sessionKey: z.string().min(1),\n agentId: z.string().uuid(),\n daemonId: z.string().uuid()\n});\n// R→C REQ → rc/thread-lookup/ok — pull-on-miss BACKSTOP leg. When an un-mentioned\n// follow-up arrives for a (channel, thread) the relay has no cached affinity for\n// (missed the broadcast, or (re)started before it), the relay asks the CP for the\n// persisted owner rather than dropping the message. The relay caches the result.\nexport const RcThreadLookup = z.object({\n botId: z.string().uuid(),\n sessionKey: z.string().min(1),\n // `stop` makes the answer GRANT-BLIND (linear-integration.md §9.3): a stop can only\n // end work, so it must reach the runtime that holds the session even after the\n // conversation's default moved off a gated holder. Absent ⇒ the ordinary gated mode.\n mode: z.literal('stop').optional()\n});\n// C→R REP (corr = rc/thread-lookup id). `target: null` ⇒ the CP holds no binding\n// for this (botId, sessionKey) — the relay falls back to normal arbitration.\nexport const RcThreadLookupOk = z.object({\n botId: z.string().uuid(),\n sessionKey: z.string().min(1),\n // `integrationId` is the holder's install ON THIS BOT — carried so a pre-addressed\n // interaction (the Stop-mode lookup, §9.3) needs no second resolution. Optional:\n // an older CP omits it and the relay backfills from its own member directory.\n target: z\n .object({ agentId: z.string().uuid(), daemonId: z.string().uuid(), integrationId: z.string().uuid().optional() })\n .nullable(),\n // Durable room membership is independent of the compatibility owner. Default\n // keeps new relays able to read replies from an older CP during rollout.\n participants: z.array(z.object({ agentId: z.string().uuid(), daemonId: z.string().uuid() })).default([])\n});\n// C→R EVT — the bot-AGNOSTIC agent-collaboration routing snapshot (agent-collaboration\n// §2.3 / §6.2 / §6.5). FULL-REPLACE: the relay swaps its whole `(orgId,platform,channel)\n// → agents` table. Unlike `rc/bot-assign` (keyed by botId, can't address cross-bot), this\n// lets the relay resolve a cross-daemon `rd/agentmsg` `toAgentId` → owning daemonId and\n// authorize caller/target call policy. Bodiless routing/policy metadata only.\nexport const RcCollabRoutes = CollabRoutesSnapshot;\n// C→R EVT — pool-wide MCP proxy binding (centralized-tool-management.md §5.2); `headers` carry the UPSTREAM credential — NEVER log this frame.\n/** The longest MCP tool name a decision table or catalog carries. */\nexport const MCP_TOOL_NAME_MAX = 256;\n/** The most tools one decision list or one catalog carries. */\nexport const MCP_TOOL_LIST_MAX = 1_000;\nconst McpToolNames = z.array(z.string().min(1).max(MCP_TOOL_NAME_MAX)).max(MCP_TOOL_LIST_MAX).default([]);\n/** One restricted grant's per-tool decisions (mcp-tool-permissions.md §6.1); a name in no list is Blocked. */\nexport const McpToolPolicy = z.object({\n allow: McpToolNames,\n approval: McpToolNames,\n ask: McpToolNames\n});\n/** The relay enforces per-agent tool tables and answers `rc/mcp-catalog` (mcp-tool-permissions.md §6). */\nexport const MCP_TOOL_POLICY_V1_FEATURE = 'mcp-tool-policy-v1';\nexport const RcMcpAssign = z\n .object({\n providerId: z.string().uuid(),\n upstreamUrl: z.string(),\n headers: z.array(z.object({ name: z.string(), value: z.string() })).default([]),\n // sha256 of the active unrestricted grant keys; never empty, because an empty allowlist must not read as \"unrestricted\".\n grantKeyHashes: z.array(z.string().min(1)).min(1),\n // Deduplicated decision tables, sent only to a relay advertising MCP_TOOL_POLICY_V1_FEATURE.\n toolPolicies: z.array(McpToolPolicy).max(MCP_TOOL_LIST_MAX).optional(),\n // Restricted agent grants: each hash is judged by its table, never treated as unrestricted.\n restrictedGrants: z\n .array(z.object({ grantKeyHash: z.string().min(1), policy: z.number().int().nonnegative() }))\n .max(10_000)\n .optional()\n})\n .superRefine((assign, ctx) => {\n const unrestricted = new Set(assign.grantKeyHashes);\n for (const [i, grant] of (assign.restrictedGrants ?? []).entries()) {\n if (grant.policy >= (assign.toolPolicies?.length ?? 0))\n ctx.addIssue({ code: 'custom', path: ['restrictedGrants', i, 'policy'], message: 'unknown tool policy' });\n if (unrestricted.has(grant.grantKeyHash))\n ctx.addIssue({\n code: 'custom',\n path: ['restrictedGrants', i],\n message: 'a grant is restricted or not, never both'\n });\n }\n});\n// C→R EVT — drop an MCP proxy binding: whole provider (`{providerId}`, deleted/revoked)\n// or a single grant hash (`{providerId, grantKeyHash}`, rotation — old key retired).\nexport const RcMcpUnassign = z.object({\n providerId: z.string().uuid(),\n grantKeyHash: z.string().optional()\n});\n// C→R REQ → rc/mcp-catalog/ok — list a provider's tools through the relay's own binding and egress (mcp-tool-permissions.md §4).\nexport const RcMcpCatalog = z.object({ providerId: z.string().uuid() });\n/** The longest tool description a catalog carries. */\nexport const MCP_CATALOG_DESCRIPTION_MAX = 1_000;\n/** One tool as the console groups it: its name, display text, annotation hints, and whether it renders an interface. */\nexport const McpCatalogTool = z.object({\n name: z.string().min(1).max(MCP_TOOL_NAME_MAX),\n title: z.string().max(256).optional(),\n description: z.string().max(MCP_CATALOG_DESCRIPTION_MAX).optional(),\n readOnlyHint: z.boolean().optional(),\n destructiveHint: z.boolean().optional(),\n idempotentHint: z.boolean().optional(),\n openWorldHint: z.boolean().optional(),\n interactive: z.boolean()\n});\n/** Why a catalog fetch failed; a closed set that never carries a host or a secret. */\nexport const McpCatalogFailure = z.enum([\n 'unknown_provider',\n 'misconfigured',\n 'blocked_address',\n 'unreachable',\n 'upstream_rejected',\n 'timeout',\n 'too_large',\n 'invalid_response'\n]);\nexport const RcMcpCatalogOk = z\n .object({ tools: z.array(McpCatalogTool).max(MCP_TOOL_LIST_MAX).optional(), failure: McpCatalogFailure.optional() })\n .refine((ok) => (ok.tools === undefined) !== (ok.failure === undefined), {\n message: 'exactly one of tools or failure'\n});\n// C→R EVT — purpose-separated external-memory proxy binding. It deliberately\n// does not reuse rc/mcp-assign: memory plugin traffic is daemon-private and must\n// never enter an agent/model MCP enable-list. Secret header values are relay-only.\nexport const RcMemoryConnectionAssign = z.object({\n orgId: z.string().min(1).max(64).optional(),\n connectionId: z.string().uuid(),\n // Monotonic durable connection revision. Relays ignore stale assignments so\n // concurrent HTTP mutations cannot roll credentials/config back out of order.\n revision: z.number().int().positive(),\n upstreamUrl: z.string().url().max(2_048),\n headers: z\n .array(z.object({ name: z.string().min(1).max(128), value: z.string().max(16 * 1024) }))\n .max(64)\n .default([]),\n grantKeyHashes: z\n .array(z.string().regex(/^[a-f0-9]{64}$/))\n .min(1)\n .max(64)\n});\nexport const RcMemoryConnectionUnassign = z.object({\n connectionId: z.string().uuid(),\n // Whole-connection delete uses the next revision as a tombstone; a\n // grant-specific retirement uses the revision of the preceding assign.\n revision: z.number().int().positive(),\n grantKeyHash: z\n .string()\n .regex(/^[a-f0-9]{64}$/)\n .optional()\n});\n/** This relay verifies organization GitHub Apps' webhooks, so the CP may send it `rc/github-app-assign`. */\nexport const GITHUB_APP_WEBHOOK_V1_FEATURE = 'github-app-webhook-v1';\n// C→R EVT — one organization App's webhook secret (github-app-git-credentials.md §Organization GitHub Apps); NEVER log this frame.\nexport const RcGithubAppAssign = z.object({\n githubAppId: z.string().uuid(),\n appId: GithubNumericId,\n webhookSecret: z.string().min(1).max(256)\n});\n// C→R EVT — the App is gone: its deliveries no longer verify.\nexport const RcGithubAppUnassign = z.object({ githubAppId: z.string().uuid() });\n/** Both ends frame a full reconnect replay as one snapshot, so the relay prunes what the replay no longer names. */\nexport const RELAY_PROJECTION_SNAPSHOT_V1_FEATURE = 'relay-projection-snapshot-v1';\n/** At most this many ids ride one `rc/snapshot-end`; a CP that failed on more sends no end, and the relay keeps its copy. */\nexport const RC_SNAPSHOT_MAX_WITHHELD = 1_000;\n/** The relay projections a CP replays in full after the relay (re)registers. */\nexport const RcSnapshotKind = z.enum(['mcp', 'hook', 'memory', 'follow-up-watch', 'github-app']);\n/** C→R EVT: a full replay of one projection starts; the relay keeps serving its current copy meanwhile. */\nexport const RcSnapshotBegin = z.object({ kind: RcSnapshotKind, snapshotId: z.string().uuid() });\n/** C→R EVT: the replay is complete; the relay drops each entry it neither received nor finds `withheld` (items the CP failed to produce). */\nexport const RcSnapshotEnd = z.object({\n kind: RcSnapshotKind,\n snapshotId: z.string().uuid(),\n withheld: z.array(z.string().uuid()).max(RC_SNAPSHOT_MAX_WITHHELD)\n});\n// ── computer viewer media metering (computer-use.md §15.5) ───────────────────\n/** CP takes `rc/computer-media-usage`; a relay sends it only when the CP advertised this. */\nexport const COMPUTER_MEDIA_USAGE_FEATURE = 'computer-media-usage-v1';\nexport const RC_COMPUTER_MEDIA_USAGE_MAX = 1000;\n// R→C EVT: TURN bytes this relay forwarded per Computer since its last report; best effort, a lost report is lost usage.\nexport const RcComputerMediaUsage = z.object({\n from: z.string().datetime(),\n to: z.string().datetime(),\n entries: z\n .array(z.object({ computerId: z.string().uuid(), bytes: z.number().int().positive().max(Number.MAX_SAFE_INTEGER) }))\n .min(1)\n .max(RC_COMPUTER_MEDIA_USAGE_MAX)\n});\n// ── the wire union ───────────────────────────────────────────────────────────\n/** `type` string → payload schema for the relay↔CP wire. */\nexport const RELAY_CP_SCHEMAS = {\n 'rc/auth': RcAuth,\n 'rc/auth/ok': RcAuthOk,\n 'rc/register': RcRegister,\n 'rc/registered': RcRegistered,\n 'rc/heartbeat': RcHeartbeat,\n 'rc/verify': RcVerify,\n 'rc/verify/ok': RcVerifyResult,\n 'rc/github-comment-authz': RcGithubCommentAuthz,\n 'rc/github-comment-authz/ok': RcGithubCommentAuthzResult,\n 'rc/codehost-membership-authz': RcCodeHostMembershipAuthz,\n 'rc/codehost-membership-authz/ok': RcCodeHostMembershipAuthzResult,\n 'rc/github-rerequest': RcGithubRerequest,\n 'rc/github-rerequest/ok': RcGithubRerequestResult,\n 'rc/codehost-feedback-watch': RcCodeHostFeedbackWatch,\n 'rc/codehost-feedback': RcCodeHostFeedback,\n 'rc/codehost-feedback/ok': RcCodeHostFeedbackResult,\n 'rc/pull-request-feedback': RcPullRequestFeedback,\n 'rc/pull-request-feedback/ok': RcPullRequestFeedbackResult,\n 'rc/follow-up-watch': RcFollowUpWatch,\n 'rc/hook-assign': RcHookAssign,\n 'rc/hook-remove': RcHookRemove,\n 'rc/run-report': RcRunReport,\n 'rc/github-installation': RcGithubInstallation,\n 'rc/codehost-delivery': RcCodeHostDelivery,\n 'rc/daemon-revoke': RcDaemonRevoke,\n 'rc/bot-assign': RcBotAssign,\n 'rc/bot-unassign': RcBotUnassign,\n 'rc/routes': RcRoutes,\n 'rc/assign': RcAssign,\n 'rc/participant-assign': RcParticipantAssign,\n 'rc/set-channel-agent': RcSetChannelAgent,\n 'rc/bot-channels': RcBotChannels,\n 'rc/bot-conversation': RcBotConversation,\n 'rc/bot-sender': RcBotSender,\n 'rc/bot-revoked': RcBotRevoked,\n 'rc/bot-revoked/ok': RcBotRevokedOk,\n 'rc/bot-credential-check': RcBotCredentialCheck,\n 'rc/bot-credential-check/ok': RcBotCredentialCheckOk,\n 'rc/bot-tenant': RcBotTenant,\n 'rc/bot-tenant/ok': RcBotTenantOk,\n 'rc/thread-assign': RcThreadAssign,\n 'rc/thread-participant': RcThreadParticipant,\n 'rc/thread-lookup': RcThreadLookup,\n 'rc/thread-lookup/ok': RcThreadLookupOk,\n 'rc/collab-routes': RcCollabRoutes,\n 'rc/mcp-assign': RcMcpAssign,\n 'rc/mcp-unassign': RcMcpUnassign,\n 'rc/mcp-catalog': RcMcpCatalog,\n 'rc/mcp-catalog/ok': RcMcpCatalogOk,\n 'rc/memoryconnection-assign': RcMemoryConnectionAssign,\n 'rc/memoryconnection-unassign': RcMemoryConnectionUnassign,\n 'rc/github-app-assign': RcGithubAppAssign,\n 'rc/github-app-unassign': RcGithubAppUnassign,\n 'rc/snapshot-begin': RcSnapshotBegin,\n 'rc/snapshot-end': RcSnapshotEnd,\n 'rc/fragment': FrameFragment,\n 'rc/computer-media-usage': RcComputerMediaUsage,\n error: ErrorFrame\n};\n/** All relay↔CP frame `type` strings, as a runtime array (guards / tests). */\nexport const RELAY_CP_FRAME_TYPES = Object.keys(RELAY_CP_SCHEMAS);\n/** The discriminated union of every fully-validated relay↔CP frame. */\nexport const RelayCpFrame = z.discriminatedUnion('type', [\n frameSchema('rc/auth', RELAY_CP_SCHEMAS['rc/auth']),\n frameSchema('rc/auth/ok', RELAY_CP_SCHEMAS['rc/auth/ok']),\n frameSchema('rc/register', RELAY_CP_SCHEMAS['rc/register']),\n frameSchema('rc/registered', RELAY_CP_SCHEMAS['rc/registered']),\n frameSchema('rc/heartbeat', RELAY_CP_SCHEMAS['rc/heartbeat']),\n frameSchema('rc/verify', RELAY_CP_SCHEMAS['rc/verify']),\n frameSchema('rc/verify/ok', RELAY_CP_SCHEMAS['rc/verify/ok']),\n frameSchema('rc/github-comment-authz', RELAY_CP_SCHEMAS['rc/github-comment-authz']),\n frameSchema('rc/github-comment-authz/ok', RELAY_CP_SCHEMAS['rc/github-comment-authz/ok']),\n frameSchema('rc/codehost-membership-authz', RELAY_CP_SCHEMAS['rc/codehost-membership-authz']),\n frameSchema('rc/codehost-membership-authz/ok', RELAY_CP_SCHEMAS['rc/codehost-membership-authz/ok']),\n frameSchema('rc/github-rerequest', RELAY_CP_SCHEMAS['rc/github-rerequest']),\n frameSchema('rc/github-rerequest/ok', RELAY_CP_SCHEMAS['rc/github-rerequest/ok']),\n frameSchema('rc/codehost-feedback', RELAY_CP_SCHEMAS['rc/codehost-feedback']),\n frameSchema('rc/codehost-feedback/ok', RELAY_CP_SCHEMAS['rc/codehost-feedback/ok']),\n frameSchema('rc/codehost-feedback-watch', RELAY_CP_SCHEMAS['rc/codehost-feedback-watch']),\n frameSchema('rc/pull-request-feedback', RELAY_CP_SCHEMAS['rc/pull-request-feedback']),\n frameSchema('rc/pull-request-feedback/ok', RELAY_CP_SCHEMAS['rc/pull-request-feedback/ok']),\n frameSchema('rc/follow-up-watch', RELAY_CP_SCHEMAS['rc/follow-up-watch']),\n frameSchema('rc/hook-assign', RELAY_CP_SCHEMAS['rc/hook-assign']),\n frameSchema('rc/hook-remove', RELAY_CP_SCHEMAS['rc/hook-remove']),\n frameSchema('rc/run-report', RELAY_CP_SCHEMAS['rc/run-report']),\n frameSchema('rc/github-installation', RELAY_CP_SCHEMAS['rc/github-installation']),\n frameSchema('rc/codehost-delivery', RELAY_CP_SCHEMAS['rc/codehost-delivery']),\n frameSchema('rc/daemon-revoke', RELAY_CP_SCHEMAS['rc/daemon-revoke']),\n frameSchema('rc/bot-assign', RELAY_CP_SCHEMAS['rc/bot-assign']),\n frameSchema('rc/bot-unassign', RELAY_CP_SCHEMAS['rc/bot-unassign']),\n frameSchema('rc/routes', RELAY_CP_SCHEMAS['rc/routes']),\n frameSchema('rc/assign', RELAY_CP_SCHEMAS['rc/assign']),\n frameSchema('rc/participant-assign', RELAY_CP_SCHEMAS['rc/participant-assign']),\n frameSchema('rc/set-channel-agent', RELAY_CP_SCHEMAS['rc/set-channel-agent']),\n frameSchema('rc/bot-channels', RELAY_CP_SCHEMAS['rc/bot-channels']),\n frameSchema('rc/bot-conversation', RELAY_CP_SCHEMAS['rc/bot-conversation']),\n frameSchema('rc/bot-sender', RELAY_CP_SCHEMAS['rc/bot-sender']),\n frameSchema('rc/bot-revoked', RELAY_CP_SCHEMAS['rc/bot-revoked']),\n frameSchema('rc/bot-revoked/ok', RELAY_CP_SCHEMAS['rc/bot-revoked/ok']),\n frameSchema('rc/bot-credential-check', RELAY_CP_SCHEMAS['rc/bot-credential-check']),\n frameSchema('rc/bot-credential-check/ok', RELAY_CP_SCHEMAS['rc/bot-credential-check/ok']),\n frameSchema('rc/bot-tenant', RELAY_CP_SCHEMAS['rc/bot-tenant']),\n frameSchema('rc/bot-tenant/ok', RELAY_CP_SCHEMAS['rc/bot-tenant/ok']),\n frameSchema('rc/thread-assign', RELAY_CP_SCHEMAS['rc/thread-assign']),\n frameSchema('rc/thread-participant', RELAY_CP_SCHEMAS['rc/thread-participant']),\n frameSchema('rc/thread-lookup', RELAY_CP_SCHEMAS['rc/thread-lookup']),\n frameSchema('rc/thread-lookup/ok', RELAY_CP_SCHEMAS['rc/thread-lookup/ok']),\n frameSchema('rc/collab-routes', RELAY_CP_SCHEMAS['rc/collab-routes']),\n frameSchema('rc/mcp-assign', RELAY_CP_SCHEMAS['rc/mcp-assign']),\n frameSchema('rc/mcp-unassign', RELAY_CP_SCHEMAS['rc/mcp-unassign']),\n frameSchema('rc/mcp-catalog', RELAY_CP_SCHEMAS['rc/mcp-catalog']),\n frameSchema('rc/mcp-catalog/ok', RELAY_CP_SCHEMAS['rc/mcp-catalog/ok']),\n frameSchema('rc/memoryconnection-assign', RELAY_CP_SCHEMAS['rc/memoryconnection-assign']),\n frameSchema('rc/memoryconnection-unassign', RELAY_CP_SCHEMAS['rc/memoryconnection-unassign']),\n frameSchema('rc/github-app-assign', RELAY_CP_SCHEMAS['rc/github-app-assign']),\n frameSchema('rc/github-app-unassign', RELAY_CP_SCHEMAS['rc/github-app-unassign']),\n frameSchema('rc/snapshot-begin', RELAY_CP_SCHEMAS['rc/snapshot-begin']),\n frameSchema('rc/snapshot-end', RELAY_CP_SCHEMAS['rc/snapshot-end']),\n frameSchema('rc/fragment', RELAY_CP_SCHEMAS['rc/fragment']),\n frameSchema('rc/computer-media-usage', RELAY_CP_SCHEMAS['rc/computer-media-usage']),\n frameSchema('error', RELAY_CP_SCHEMAS['error'])\n]);\n/** Runtime guard: is `t` a known relay↔CP frame `type`? */\nexport function isRelayCpFrameType(t) {\n return Object.prototype.hasOwnProperty.call(RELAY_CP_SCHEMAS, t);\n}\n/** Decode one relay↔CP wire frame (envelope + typed payload). */\nexport function decodeRelayCpFrame(text, opts = {}) {\n return decodeEnvelopeWith(RELAY_CP_SCHEMAS, text, opts);\n}\n/** Build a relay↔CP frame with a compile-time-typed payload. */\nexport function buildRelayCpFrame(type, payload, opts = {}) {\n return buildEnvelopeRaw(type, payload, opts);\n}\n//# sourceMappingURL=relay-cp.js.map","/**\n * Platform-neutral attribution sentence. Callers render and escape each part\n * before passing it here so GitHub Markdown, Slack mrkdwn, and Slack fallback\n * text can keep their own link syntax.\n */\nexport interface AttributionMessageParts {\n agent: string\n runtime?: string\n model?: string\n renderSession?: (label: string) => string | undefined\n notice?: string\n}\n\n/** Raw reply identity shared by platform renderers before each platform applies\n * its own escaping and link syntax. */\nexport interface ReplyAttributionInfo {\n botName: string\n botUrl: string\n runtime: string\n model: string\n sessionUrl: string\n notice?: string\n}\n\nconst OPEN_IN_SESSION_LABEL = 'open in session'\n\nfunction present(value: string | undefined): value is string {\n return value !== undefined && value.trim().length > 0\n}\n\n/** Canonical visible order: sender, optional runtime/model identity, session link. */\nexport function renderAttributionMessage({\n agent,\n runtime,\n model,\n renderSession,\n notice\n}: AttributionMessageParts): string {\n const identity = [runtime, model].filter(present)\n const sender = identity.length > 0 ? `sent by ${agent} (${identity.join(' · ')})` : `sent by ${agent}`\n const session = renderSession?.(OPEN_IN_SESSION_LABEL)\n return [sender, session, notice].filter(present).join(' · ')\n}\n","/**\n * @typedef {import('mdast').Nodes} Nodes\n *\n * @typedef Options\n * Configuration (optional).\n * @property {boolean | null | undefined} [includeImageAlt=true]\n * Whether to use `alt` for `image`s (default: `true`).\n * @property {boolean | null | undefined} [includeHtml=true]\n * Whether to use `value` of HTML (default: `true`).\n */\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Get the text content of a node or list of nodes.\n *\n * Prefers the node’s plain-text fields, otherwise serializes its children,\n * and if the given value is an array, serialize the nodes in it.\n *\n * @param {unknown} [value]\n * Thing to serialize, typically `Node`.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {string}\n * Serialized `value`.\n */\nexport function toString(value, options) {\n const settings = options || emptyOptions\n const includeImageAlt =\n typeof settings.includeImageAlt === 'boolean'\n ? settings.includeImageAlt\n : true\n const includeHtml =\n typeof settings.includeHtml === 'boolean' ? settings.includeHtml : true\n\n return one(value, includeImageAlt, includeHtml)\n}\n\n/**\n * One node or several nodes.\n *\n * @param {unknown} value\n * Thing to serialize.\n * @param {boolean} includeImageAlt\n * Include image `alt`s.\n * @param {boolean} includeHtml\n * Include HTML.\n * @returns {string}\n * Serialized node.\n */\nfunction one(value, includeImageAlt, includeHtml) {\n if (node(value)) {\n if ('value' in value) {\n return value.type === 'html' && !includeHtml ? '' : value.value\n }\n\n if (includeImageAlt && 'alt' in value && value.alt) {\n return value.alt\n }\n\n if ('children' in value) {\n return all(value.children, includeImageAlt, includeHtml)\n }\n }\n\n if (Array.isArray(value)) {\n return all(value, includeImageAlt, includeHtml)\n }\n\n return ''\n}\n\n/**\n * Serialize a list of nodes.\n *\n * @param {Array<unknown>} values\n * Thing to serialize.\n * @param {boolean} includeImageAlt\n * Include image `alt`s.\n * @param {boolean} includeHtml\n * Include HTML.\n * @returns {string}\n * Serialized nodes.\n */\nfunction all(values, includeImageAlt, includeHtml) {\n /** @type {Array<string>} */\n const result = []\n let index = -1\n\n while (++index < values.length) {\n result[index] = one(values[index], includeImageAlt, includeHtml)\n }\n\n return result.join('')\n}\n\n/**\n * Check if `value` looks like a node.\n *\n * @param {unknown} value\n * Thing.\n * @returns {value is Nodes}\n * Whether `value` is a node.\n */\nfunction node(value) {\n return Boolean(value && typeof value === 'object')\n}\n","/**\n * Map of named character references.\n *\n * @type {Record<string, string>}\n */\nexport const characterEntities = {\n AElig: 'Æ',\n AMP: '&',\n Aacute: 'Á',\n Abreve: 'Ă',\n Acirc: 'Â',\n Acy: 'А',\n Afr: '𝔄',\n Agrave: 'À',\n Alpha: 'Α',\n Amacr: 'Ā',\n And: '⩓',\n Aogon: 'Ą',\n Aopf: '𝔸',\n ApplyFunction: '',\n Aring: 'Å',\n Ascr: '𝒜',\n Assign: '≔',\n Atilde: 'Ã',\n Auml: 'Ä',\n Backslash: '∖',\n Barv: '⫧',\n Barwed: '⌆',\n Bcy: 'Б',\n Because: '∵',\n Bernoullis: 'ℬ',\n Beta: 'Β',\n Bfr: '𝔅',\n Bopf: '𝔹',\n Breve: '˘',\n Bscr: 'ℬ',\n Bumpeq: '≎',\n CHcy: 'Ч',\n COPY: '©',\n Cacute: 'Ć',\n Cap: '⋒',\n CapitalDifferentialD: 'ⅅ',\n Cayleys: 'ℭ',\n Ccaron: 'Č',\n Ccedil: 'Ç',\n Ccirc: 'Ĉ',\n Cconint: '∰',\n Cdot: 'Ċ',\n Cedilla: '¸',\n CenterDot: '·',\n Cfr: 'ℭ',\n Chi: 'Χ',\n CircleDot: '⊙',\n CircleMinus: '⊖',\n CirclePlus: '⊕',\n CircleTimes: '⊗',\n ClockwiseContourIntegral: '∲',\n CloseCurlyDoubleQuote: '”',\n CloseCurlyQuote: '’',\n Colon: '∷',\n Colone: '⩴',\n Congruent: '≡',\n Conint: '∯',\n ContourIntegral: '∮',\n Copf: 'ℂ',\n Coproduct: '∐',\n CounterClockwiseContourIntegral: '∳',\n Cross: '⨯',\n Cscr: '𝒞',\n Cup: '⋓',\n CupCap: '≍',\n DD: 'ⅅ',\n DDotrahd: '⤑',\n DJcy: 'Ђ',\n DScy: 'Ѕ',\n DZcy: 'Џ',\n Dagger: '‡',\n Darr: '↡',\n Dashv: '⫤',\n Dcaron: 'Ď',\n Dcy: 'Д',\n Del: '∇',\n Delta: 'Δ',\n Dfr: '𝔇',\n DiacriticalAcute: '´',\n DiacriticalDot: '˙',\n DiacriticalDoubleAcute: '˝',\n DiacriticalGrave: '`',\n DiacriticalTilde: '˜',\n Diamond: '⋄',\n DifferentialD: 'ⅆ',\n Dopf: '𝔻',\n Dot: '¨',\n DotDot: '⃜',\n DotEqual: '≐',\n DoubleContourIntegral: '∯',\n DoubleDot: '¨',\n DoubleDownArrow: '⇓',\n DoubleLeftArrow: '⇐',\n DoubleLeftRightArrow: '⇔',\n DoubleLeftTee: '⫤',\n DoubleLongLeftArrow: '⟸',\n DoubleLongLeftRightArrow: '⟺',\n DoubleLongRightArrow: '⟹',\n DoubleRightArrow: '⇒',\n DoubleRightTee: '⊨',\n DoubleUpArrow: '⇑',\n DoubleUpDownArrow: '⇕',\n DoubleVerticalBar: '∥',\n DownArrow: '↓',\n DownArrowBar: '⤓',\n DownArrowUpArrow: '⇵',\n DownBreve: '̑',\n DownLeftRightVector: '⥐',\n DownLeftTeeVector: '⥞',\n DownLeftVector: '↽',\n DownLeftVectorBar: '⥖',\n DownRightTeeVector: '⥟',\n DownRightVector: '⇁',\n DownRightVectorBar: '⥗',\n DownTee: '⊤',\n DownTeeArrow: '↧',\n Downarrow: '⇓',\n Dscr: '𝒟',\n Dstrok: 'Đ',\n ENG: 'Ŋ',\n ETH: 'Ð',\n Eacute: 'É',\n Ecaron: 'Ě',\n Ecirc: 'Ê',\n Ecy: 'Э',\n Edot: 'Ė',\n Efr: '𝔈',\n Egrave: 'È',\n Element: '∈',\n Emacr: 'Ē',\n EmptySmallSquare: '◻',\n EmptyVerySmallSquare: '▫',\n Eogon: 'Ę',\n Eopf: '𝔼',\n Epsilon: 'Ε',\n Equal: '⩵',\n EqualTilde: '≂',\n Equilibrium: '⇌',\n Escr: 'ℰ',\n Esim: '⩳',\n Eta: 'Η',\n Euml: 'Ë',\n Exists: '∃',\n ExponentialE: 'ⅇ',\n Fcy: 'Ф',\n Ffr: '𝔉',\n FilledSmallSquare: '◼',\n FilledVerySmallSquare: '▪',\n Fopf: '𝔽',\n ForAll: '∀',\n Fouriertrf: 'ℱ',\n Fscr: 'ℱ',\n GJcy: 'Ѓ',\n GT: '>',\n Gamma: 'Γ',\n Gammad: 'Ϝ',\n Gbreve: 'Ğ',\n Gcedil: 'Ģ',\n Gcirc: 'Ĝ',\n Gcy: 'Г',\n Gdot: 'Ġ',\n Gfr: '𝔊',\n Gg: '⋙',\n Gopf: '𝔾',\n GreaterEqual: '≥',\n GreaterEqualLess: '⋛',\n GreaterFullEqual: '≧',\n GreaterGreater: '⪢',\n GreaterLess: '≷',\n GreaterSlantEqual: '⩾',\n GreaterTilde: '≳',\n Gscr: '𝒢',\n Gt: '≫',\n HARDcy: 'Ъ',\n Hacek: 'ˇ',\n Hat: '^',\n Hcirc: 'Ĥ',\n Hfr: 'ℌ',\n HilbertSpace: 'ℋ',\n Hopf: 'ℍ',\n HorizontalLine: '─',\n Hscr: 'ℋ',\n Hstrok: 'Ħ',\n HumpDownHump: '≎',\n HumpEqual: '≏',\n IEcy: 'Е',\n IJlig: 'IJ',\n IOcy: 'Ё',\n Iacute: 'Í',\n Icirc: 'Î',\n Icy: 'И',\n Idot: 'İ',\n Ifr: 'ℑ',\n Igrave: 'Ì',\n Im: 'ℑ',\n Imacr: 'Ī',\n ImaginaryI: 'ⅈ',\n Implies: '⇒',\n Int: '∬',\n Integral: '∫',\n Intersection: '⋂',\n InvisibleComma: '',\n InvisibleTimes: '',\n Iogon: 'Į',\n Iopf: '𝕀',\n Iota: 'Ι',\n Iscr: 'ℐ',\n Itilde: 'Ĩ',\n Iukcy: 'І',\n Iuml: 'Ï',\n Jcirc: 'Ĵ',\n Jcy: 'Й',\n Jfr: '𝔍',\n Jopf: '𝕁',\n Jscr: '𝒥',\n Jsercy: 'Ј',\n Jukcy: 'Є',\n KHcy: 'Х',\n KJcy: 'Ќ',\n Kappa: 'Κ',\n Kcedil: 'Ķ',\n Kcy: 'К',\n Kfr: '𝔎',\n Kopf: '𝕂',\n Kscr: '𝒦',\n LJcy: 'Љ',\n LT: '<',\n Lacute: 'Ĺ',\n Lambda: 'Λ',\n Lang: '⟪',\n Laplacetrf: 'ℒ',\n Larr: '↞',\n Lcaron: 'Ľ',\n Lcedil: 'Ļ',\n Lcy: 'Л',\n LeftAngleBracket: '⟨',\n LeftArrow: '←',\n LeftArrowBar: '⇤',\n LeftArrowRightArrow: '⇆',\n LeftCeiling: '⌈',\n LeftDoubleBracket: '⟦',\n LeftDownTeeVector: '⥡',\n LeftDownVector: '⇃',\n LeftDownVectorBar: '⥙',\n LeftFloor: '⌊',\n LeftRightArrow: '↔',\n LeftRightVector: '⥎',\n LeftTee: '⊣',\n LeftTeeArrow: '↤',\n LeftTeeVector: '⥚',\n LeftTriangle: '⊲',\n LeftTriangleBar: '⧏',\n LeftTriangleEqual: '⊴',\n LeftUpDownVector: '⥑',\n LeftUpTeeVector: '⥠',\n LeftUpVector: '↿',\n LeftUpVectorBar: '⥘',\n LeftVector: '↼',\n LeftVectorBar: '⥒',\n Leftarrow: '⇐',\n Leftrightarrow: '⇔',\n LessEqualGreater: '⋚',\n LessFullEqual: '≦',\n LessGreater: '≶',\n LessLess: '⪡',\n LessSlantEqual: '⩽',\n LessTilde: '≲',\n Lfr: '𝔏',\n Ll: '⋘',\n Lleftarrow: '⇚',\n Lmidot: 'Ŀ',\n LongLeftArrow: '⟵',\n LongLeftRightArrow: '⟷',\n LongRightArrow: '⟶',\n Longleftarrow: '⟸',\n Longleftrightarrow: '⟺',\n Longrightarrow: '⟹',\n Lopf: '𝕃',\n LowerLeftArrow: '↙',\n LowerRightArrow: '↘',\n Lscr: 'ℒ',\n Lsh: '↰',\n Lstrok: 'Ł',\n Lt: '≪',\n Map: '⤅',\n Mcy: 'М',\n MediumSpace: ' ',\n Mellintrf: 'ℳ',\n Mfr: '𝔐',\n MinusPlus: '∓',\n Mopf: '𝕄',\n Mscr: 'ℳ',\n Mu: 'Μ',\n NJcy: 'Њ',\n Nacute: 'Ń',\n Ncaron: 'Ň',\n Ncedil: 'Ņ',\n Ncy: 'Н',\n NegativeMediumSpace: '',\n NegativeThickSpace: '',\n NegativeThinSpace: '',\n NegativeVeryThinSpace: '',\n NestedGreaterGreater: '≫',\n NestedLessLess: '≪',\n NewLine: '\\n',\n Nfr: '𝔑',\n NoBreak: '',\n NonBreakingSpace: ' ',\n Nopf: 'ℕ',\n Not: '⫬',\n NotCongruent: '≢',\n NotCupCap: '≭',\n NotDoubleVerticalBar: '∦',\n NotElement: '∉',\n NotEqual: '≠',\n NotEqualTilde: '≂̸',\n NotExists: '∄',\n NotGreater: '≯',\n NotGreaterEqual: '≱',\n NotGreaterFullEqual: '≧̸',\n NotGreaterGreater: '≫̸',\n NotGreaterLess: '≹',\n NotGreaterSlantEqual: '⩾̸',\n NotGreaterTilde: '≵',\n NotHumpDownHump: '≎̸',\n NotHumpEqual: '≏̸',\n NotLeftTriangle: '⋪',\n NotLeftTriangleBar: '⧏̸',\n NotLeftTriangleEqual: '⋬',\n NotLess: '≮',\n NotLessEqual: '≰',\n NotLessGreater: '≸',\n NotLessLess: '≪̸',\n NotLessSlantEqual: '⩽̸',\n NotLessTilde: '≴',\n NotNestedGreaterGreater: '⪢̸',\n NotNestedLessLess: '⪡̸',\n NotPrecedes: '⊀',\n NotPrecedesEqual: '⪯̸',\n NotPrecedesSlantEqual: '⋠',\n NotReverseElement: '∌',\n NotRightTriangle: '⋫',\n NotRightTriangleBar: '⧐̸',\n NotRightTriangleEqual: '⋭',\n NotSquareSubset: '⊏̸',\n NotSquareSubsetEqual: '⋢',\n NotSquareSuperset: '⊐̸',\n NotSquareSupersetEqual: '⋣',\n NotSubset: '⊂⃒',\n NotSubsetEqual: '⊈',\n NotSucceeds: '⊁',\n NotSucceedsEqual: '⪰̸',\n NotSucceedsSlantEqual: '⋡',\n NotSucceedsTilde: '≿̸',\n NotSuperset: '⊃⃒',\n NotSupersetEqual: '⊉',\n NotTilde: '≁',\n NotTildeEqual: '≄',\n NotTildeFullEqual: '≇',\n NotTildeTilde: '≉',\n NotVerticalBar: '∤',\n Nscr: '𝒩',\n Ntilde: 'Ñ',\n Nu: 'Ν',\n OElig: 'Œ',\n Oacute: 'Ó',\n Ocirc: 'Ô',\n Ocy: 'О',\n Odblac: 'Ő',\n Ofr: '𝔒',\n Ograve: 'Ò',\n Omacr: 'Ō',\n Omega: 'Ω',\n Omicron: 'Ο',\n Oopf: '𝕆',\n OpenCurlyDoubleQuote: '“',\n OpenCurlyQuote: '‘',\n Or: '⩔',\n Oscr: '𝒪',\n Oslash: 'Ø',\n Otilde: 'Õ',\n Otimes: '⨷',\n Ouml: 'Ö',\n OverBar: '‾',\n OverBrace: '⏞',\n OverBracket: '⎴',\n OverParenthesis: '⏜',\n PartialD: '∂',\n Pcy: 'П',\n Pfr: '𝔓',\n Phi: 'Φ',\n Pi: 'Π',\n PlusMinus: '±',\n Poincareplane: 'ℌ',\n Popf: 'ℙ',\n Pr: '⪻',\n Precedes: '≺',\n PrecedesEqual: '⪯',\n PrecedesSlantEqual: '≼',\n PrecedesTilde: '≾',\n Prime: '″',\n Product: '∏',\n Proportion: '∷',\n Proportional: '∝',\n Pscr: '𝒫',\n Psi: 'Ψ',\n QUOT: '\"',\n Qfr: '𝔔',\n Qopf: 'ℚ',\n Qscr: '𝒬',\n RBarr: '⤐',\n REG: '®',\n Racute: 'Ŕ',\n Rang: '⟫',\n Rarr: '↠',\n Rarrtl: '⤖',\n Rcaron: 'Ř',\n Rcedil: 'Ŗ',\n Rcy: 'Р',\n Re: 'ℜ',\n ReverseElement: '∋',\n ReverseEquilibrium: '⇋',\n ReverseUpEquilibrium: '⥯',\n Rfr: 'ℜ',\n Rho: 'Ρ',\n RightAngleBracket: '⟩',\n RightArrow: '→',\n RightArrowBar: '⇥',\n RightArrowLeftArrow: '⇄',\n RightCeiling: '⌉',\n RightDoubleBracket: '⟧',\n RightDownTeeVector: '⥝',\n RightDownVector: '⇂',\n RightDownVectorBar: '⥕',\n RightFloor: '⌋',\n RightTee: '⊢',\n RightTeeArrow: '↦',\n RightTeeVector: '⥛',\n RightTriangle: '⊳',\n RightTriangleBar: '⧐',\n RightTriangleEqual: '⊵',\n RightUpDownVector: '⥏',\n RightUpTeeVector: '⥜',\n RightUpVector: '↾',\n RightUpVectorBar: '⥔',\n RightVector: '⇀',\n RightVectorBar: '⥓',\n Rightarrow: '⇒',\n Ropf: 'ℝ',\n RoundImplies: '⥰',\n Rrightarrow: '⇛',\n Rscr: 'ℛ',\n Rsh: '↱',\n RuleDelayed: '⧴',\n SHCHcy: 'Щ',\n SHcy: 'Ш',\n SOFTcy: 'Ь',\n Sacute: 'Ś',\n Sc: '⪼',\n Scaron: 'Š',\n Scedil: 'Ş',\n Scirc: 'Ŝ',\n Scy: 'С',\n Sfr: '𝔖',\n ShortDownArrow: '↓',\n ShortLeftArrow: '←',\n ShortRightArrow: '→',\n ShortUpArrow: '↑',\n Sigma: 'Σ',\n SmallCircle: '∘',\n Sopf: '𝕊',\n Sqrt: '√',\n Square: '□',\n SquareIntersection: '⊓',\n SquareSubset: '⊏',\n SquareSubsetEqual: '⊑',\n SquareSuperset: '⊐',\n SquareSupersetEqual: '⊒',\n SquareUnion: '⊔',\n Sscr: '𝒮',\n Star: '⋆',\n Sub: '⋐',\n Subset: '⋐',\n SubsetEqual: '⊆',\n Succeeds: '≻',\n SucceedsEqual: '⪰',\n SucceedsSlantEqual: '≽',\n SucceedsTilde: '≿',\n SuchThat: '∋',\n Sum: '∑',\n Sup: '⋑',\n Superset: '⊃',\n SupersetEqual: '⊇',\n Supset: '⋑',\n THORN: 'Þ',\n TRADE: '™',\n TSHcy: 'Ћ',\n TScy: 'Ц',\n Tab: '\\t',\n Tau: 'Τ',\n Tcaron: 'Ť',\n Tcedil: 'Ţ',\n Tcy: 'Т',\n Tfr: '𝔗',\n Therefore: '∴',\n Theta: 'Θ',\n ThickSpace: ' ',\n ThinSpace: ' ',\n Tilde: '∼',\n TildeEqual: '≃',\n TildeFullEqual: '≅',\n TildeTilde: '≈',\n Topf: '𝕋',\n TripleDot: '⃛',\n Tscr: '𝒯',\n Tstrok: 'Ŧ',\n Uacute: 'Ú',\n Uarr: '↟',\n Uarrocir: '⥉',\n Ubrcy: 'Ў',\n Ubreve: 'Ŭ',\n Ucirc: 'Û',\n Ucy: 'У',\n Udblac: 'Ű',\n Ufr: '𝔘',\n Ugrave: 'Ù',\n Umacr: 'Ū',\n UnderBar: '_',\n UnderBrace: '⏟',\n UnderBracket: '⎵',\n UnderParenthesis: '⏝',\n Union: '⋃',\n UnionPlus: '⊎',\n Uogon: 'Ų',\n Uopf: '𝕌',\n UpArrow: '↑',\n UpArrowBar: '⤒',\n UpArrowDownArrow: '⇅',\n UpDownArrow: '↕',\n UpEquilibrium: '⥮',\n UpTee: '⊥',\n UpTeeArrow: '↥',\n Uparrow: '⇑',\n Updownarrow: '⇕',\n UpperLeftArrow: '↖',\n UpperRightArrow: '↗',\n Upsi: 'ϒ',\n Upsilon: 'Υ',\n Uring: 'Ů',\n Uscr: '𝒰',\n Utilde: 'Ũ',\n Uuml: 'Ü',\n VDash: '⊫',\n Vbar: '⫫',\n Vcy: 'В',\n Vdash: '⊩',\n Vdashl: '⫦',\n Vee: '⋁',\n Verbar: '‖',\n Vert: '‖',\n VerticalBar: '∣',\n VerticalLine: '|',\n VerticalSeparator: '❘',\n VerticalTilde: '≀',\n VeryThinSpace: ' ',\n Vfr: '𝔙',\n Vopf: '𝕍',\n Vscr: '𝒱',\n Vvdash: '⊪',\n Wcirc: 'Ŵ',\n Wedge: '⋀',\n Wfr: '𝔚',\n Wopf: '𝕎',\n Wscr: '𝒲',\n Xfr: '𝔛',\n Xi: 'Ξ',\n Xopf: '𝕏',\n Xscr: '𝒳',\n YAcy: 'Я',\n YIcy: 'Ї',\n YUcy: 'Ю',\n Yacute: 'Ý',\n Ycirc: 'Ŷ',\n Ycy: 'Ы',\n Yfr: '𝔜',\n Yopf: '𝕐',\n Yscr: '𝒴',\n Yuml: 'Ÿ',\n ZHcy: 'Ж',\n Zacute: 'Ź',\n Zcaron: 'Ž',\n Zcy: 'З',\n Zdot: 'Ż',\n ZeroWidthSpace: '',\n Zeta: 'Ζ',\n Zfr: 'ℨ',\n Zopf: 'ℤ',\n Zscr: '𝒵',\n aacute: 'á',\n abreve: 'ă',\n ac: '∾',\n acE: '∾̳',\n acd: '∿',\n acirc: 'â',\n acute: '´',\n acy: 'а',\n aelig: 'æ',\n af: '',\n afr: '𝔞',\n agrave: 'à',\n alefsym: 'ℵ',\n aleph: 'ℵ',\n alpha: 'α',\n amacr: 'ā',\n amalg: '⨿',\n amp: '&',\n and: '∧',\n andand: '⩕',\n andd: '⩜',\n andslope: '⩘',\n andv: '⩚',\n ang: '∠',\n ange: '⦤',\n angle: '∠',\n angmsd: '∡',\n angmsdaa: '⦨',\n angmsdab: '⦩',\n angmsdac: '⦪',\n angmsdad: '⦫',\n angmsdae: '⦬',\n angmsdaf: '⦭',\n angmsdag: '⦮',\n angmsdah: '⦯',\n angrt: '∟',\n angrtvb: '⊾',\n angrtvbd: '⦝',\n angsph: '∢',\n angst: 'Å',\n angzarr: '⍼',\n aogon: 'ą',\n aopf: '𝕒',\n ap: '≈',\n apE: '⩰',\n apacir: '⩯',\n ape: '≊',\n apid: '≋',\n apos: \"'\",\n approx: '≈',\n approxeq: '≊',\n aring: 'å',\n ascr: '𝒶',\n ast: '*',\n asymp: '≈',\n asympeq: '≍',\n atilde: 'ã',\n auml: 'ä',\n awconint: '∳',\n awint: '⨑',\n bNot: '⫭',\n backcong: '≌',\n backepsilon: '϶',\n backprime: '‵',\n backsim: '∽',\n backsimeq: '⋍',\n barvee: '⊽',\n barwed: '⌅',\n barwedge: '⌅',\n bbrk: '⎵',\n bbrktbrk: '⎶',\n bcong: '≌',\n bcy: 'б',\n bdquo: '„',\n becaus: '∵',\n because: '∵',\n bemptyv: '⦰',\n bepsi: '϶',\n bernou: 'ℬ',\n beta: 'β',\n beth: 'ℶ',\n between: '≬',\n bfr: '𝔟',\n bigcap: '⋂',\n bigcirc: '◯',\n bigcup: '⋃',\n bigodot: '⨀',\n bigoplus: '⨁',\n bigotimes: '⨂',\n bigsqcup: '⨆',\n bigstar: '★',\n bigtriangledown: '▽',\n bigtriangleup: '△',\n biguplus: '⨄',\n bigvee: '⋁',\n bigwedge: '⋀',\n bkarow: '⤍',\n blacklozenge: '⧫',\n blacksquare: '▪',\n blacktriangle: '▴',\n blacktriangledown: '▾',\n blacktriangleleft: '◂',\n blacktriangleright: '▸',\n blank: '␣',\n blk12: '▒',\n blk14: '░',\n blk34: '▓',\n block: '█',\n bne: '=⃥',\n bnequiv: '≡⃥',\n bnot: '⌐',\n bopf: '𝕓',\n bot: '⊥',\n bottom: '⊥',\n bowtie: '⋈',\n boxDL: '╗',\n boxDR: '╔',\n boxDl: '╖',\n boxDr: '╓',\n boxH: '═',\n boxHD: '╦',\n boxHU: '╩',\n boxHd: '╤',\n boxHu: '╧',\n boxUL: '╝',\n boxUR: '╚',\n boxUl: '╜',\n boxUr: '╙',\n boxV: '║',\n boxVH: '╬',\n boxVL: '╣',\n boxVR: '╠',\n boxVh: '╫',\n boxVl: '╢',\n boxVr: '╟',\n boxbox: '⧉',\n boxdL: '╕',\n boxdR: '╒',\n boxdl: '┐',\n boxdr: '┌',\n boxh: '─',\n boxhD: '╥',\n boxhU: '╨',\n boxhd: '┬',\n boxhu: '┴',\n boxminus: '⊟',\n boxplus: '⊞',\n boxtimes: '⊠',\n boxuL: '╛',\n boxuR: '╘',\n boxul: '┘',\n boxur: '└',\n boxv: '│',\n boxvH: '╪',\n boxvL: '╡',\n boxvR: '╞',\n boxvh: '┼',\n boxvl: '┤',\n boxvr: '├',\n bprime: '‵',\n breve: '˘',\n brvbar: '¦',\n bscr: '𝒷',\n bsemi: '⁏',\n bsim: '∽',\n bsime: '⋍',\n bsol: '\\\\',\n bsolb: '⧅',\n bsolhsub: '⟈',\n bull: '•',\n bullet: '•',\n bump: '≎',\n bumpE: '⪮',\n bumpe: '≏',\n bumpeq: '≏',\n cacute: 'ć',\n cap: '∩',\n capand: '⩄',\n capbrcup: '⩉',\n capcap: '⩋',\n capcup: '⩇',\n capdot: '⩀',\n caps: '∩︀',\n caret: '⁁',\n caron: 'ˇ',\n ccaps: '⩍',\n ccaron: 'č',\n ccedil: 'ç',\n ccirc: 'ĉ',\n ccups: '⩌',\n ccupssm: '⩐',\n cdot: 'ċ',\n cedil: '¸',\n cemptyv: '⦲',\n cent: '¢',\n centerdot: '·',\n cfr: '𝔠',\n chcy: 'ч',\n check: '✓',\n checkmark: '✓',\n chi: 'χ',\n cir: '○',\n cirE: '⧃',\n circ: 'ˆ',\n circeq: '≗',\n circlearrowleft: '↺',\n circlearrowright: '↻',\n circledR: '®',\n circledS: 'Ⓢ',\n circledast: '⊛',\n circledcirc: '⊚',\n circleddash: '⊝',\n cire: '≗',\n cirfnint: '⨐',\n cirmid: '⫯',\n cirscir: '⧂',\n clubs: '♣',\n clubsuit: '♣',\n colon: ':',\n colone: '≔',\n coloneq: '≔',\n comma: ',',\n commat: '@',\n comp: '∁',\n compfn: '∘',\n complement: '∁',\n complexes: 'ℂ',\n cong: '≅',\n congdot: '⩭',\n conint: '∮',\n copf: '𝕔',\n coprod: '∐',\n copy: '©',\n copysr: '℗',\n crarr: '↵',\n cross: '✗',\n cscr: '𝒸',\n csub: '⫏',\n csube: '⫑',\n csup: '⫐',\n csupe: '⫒',\n ctdot: '⋯',\n cudarrl: '⤸',\n cudarrr: '⤵',\n cuepr: '⋞',\n cuesc: '⋟',\n cularr: '↶',\n cularrp: '⤽',\n cup: '∪',\n cupbrcap: '⩈',\n cupcap: '⩆',\n cupcup: '⩊',\n cupdot: '⊍',\n cupor: '⩅',\n cups: '∪︀',\n curarr: '↷',\n curarrm: '⤼',\n curlyeqprec: '⋞',\n curlyeqsucc: '⋟',\n curlyvee: '⋎',\n curlywedge: '⋏',\n curren: '¤',\n curvearrowleft: '↶',\n curvearrowright: '↷',\n cuvee: '⋎',\n cuwed: '⋏',\n cwconint: '∲',\n cwint: '∱',\n cylcty: '⌭',\n dArr: '⇓',\n dHar: '⥥',\n dagger: '†',\n daleth: 'ℸ',\n darr: '↓',\n dash: '‐',\n dashv: '⊣',\n dbkarow: '⤏',\n dblac: '˝',\n dcaron: 'ď',\n dcy: 'д',\n dd: 'ⅆ',\n ddagger: '‡',\n ddarr: '⇊',\n ddotseq: '⩷',\n deg: '°',\n delta: 'δ',\n demptyv: '⦱',\n dfisht: '⥿',\n dfr: '𝔡',\n dharl: '⇃',\n dharr: '⇂',\n diam: '⋄',\n diamond: '⋄',\n diamondsuit: '♦',\n diams: '♦',\n die: '¨',\n digamma: 'ϝ',\n disin: '⋲',\n div: '÷',\n divide: '÷',\n divideontimes: '⋇',\n divonx: '⋇',\n djcy: 'ђ',\n dlcorn: '⌞',\n dlcrop: '⌍',\n dollar: '$',\n dopf: '𝕕',\n dot: '˙',\n doteq: '≐',\n doteqdot: '≑',\n dotminus: '∸',\n dotplus: '∔',\n dotsquare: '⊡',\n doublebarwedge: '⌆',\n downarrow: '↓',\n downdownarrows: '⇊',\n downharpoonleft: '⇃',\n downharpoonright: '⇂',\n drbkarow: '⤐',\n drcorn: '⌟',\n drcrop: '⌌',\n dscr: '𝒹',\n dscy: 'ѕ',\n dsol: '⧶',\n dstrok: 'đ',\n dtdot: '⋱',\n dtri: '▿',\n dtrif: '▾',\n duarr: '⇵',\n duhar: '⥯',\n dwangle: '⦦',\n dzcy: 'џ',\n dzigrarr: '⟿',\n eDDot: '⩷',\n eDot: '≑',\n eacute: 'é',\n easter: '⩮',\n ecaron: 'ě',\n ecir: '≖',\n ecirc: 'ê',\n ecolon: '≕',\n ecy: 'э',\n edot: 'ė',\n ee: 'ⅇ',\n efDot: '≒',\n efr: '𝔢',\n eg: '⪚',\n egrave: 'è',\n egs: '⪖',\n egsdot: '⪘',\n el: '⪙',\n elinters: '⏧',\n ell: 'ℓ',\n els: '⪕',\n elsdot: '⪗',\n emacr: 'ē',\n empty: '∅',\n emptyset: '∅',\n emptyv: '∅',\n emsp13: ' ',\n emsp14: ' ',\n emsp: ' ',\n eng: 'ŋ',\n ensp: ' ',\n eogon: 'ę',\n eopf: '𝕖',\n epar: '⋕',\n eparsl: '⧣',\n eplus: '⩱',\n epsi: 'ε',\n epsilon: 'ε',\n epsiv: 'ϵ',\n eqcirc: '≖',\n eqcolon: '≕',\n eqsim: '≂',\n eqslantgtr: '⪖',\n eqslantless: '⪕',\n equals: '=',\n equest: '≟',\n equiv: '≡',\n equivDD: '⩸',\n eqvparsl: '⧥',\n erDot: '≓',\n erarr: '⥱',\n escr: 'ℯ',\n esdot: '≐',\n esim: '≂',\n eta: 'η',\n eth: 'ð',\n euml: 'ë',\n euro: '€',\n excl: '!',\n exist: '∃',\n expectation: 'ℰ',\n exponentiale: 'ⅇ',\n fallingdotseq: '≒',\n fcy: 'ф',\n female: '♀',\n ffilig: 'ffi',\n fflig: 'ff',\n ffllig: 'ffl',\n ffr: '𝔣',\n filig: 'fi',\n fjlig: 'fj',\n flat: '♭',\n fllig: 'fl',\n fltns: '▱',\n fnof: 'ƒ',\n fopf: '𝕗',\n forall: '∀',\n fork: '⋔',\n forkv: '⫙',\n fpartint: '⨍',\n frac12: '½',\n frac13: '⅓',\n frac14: '¼',\n frac15: '⅕',\n frac16: '⅙',\n frac18: '⅛',\n frac23: '⅔',\n frac25: '⅖',\n frac34: '¾',\n frac35: '⅗',\n frac38: '⅜',\n frac45: '⅘',\n frac56: '⅚',\n frac58: '⅝',\n frac78: '⅞',\n frasl: '⁄',\n frown: '⌢',\n fscr: '𝒻',\n gE: '≧',\n gEl: '⪌',\n gacute: 'ǵ',\n gamma: 'γ',\n gammad: 'ϝ',\n gap: '⪆',\n gbreve: 'ğ',\n gcirc: 'ĝ',\n gcy: 'г',\n gdot: 'ġ',\n ge: '≥',\n gel: '⋛',\n geq: '≥',\n geqq: '≧',\n geqslant: '⩾',\n ges: '⩾',\n gescc: '⪩',\n gesdot: '⪀',\n gesdoto: '⪂',\n gesdotol: '⪄',\n gesl: '⋛︀',\n gesles: '⪔',\n gfr: '𝔤',\n gg: '≫',\n ggg: '⋙',\n gimel: 'ℷ',\n gjcy: 'ѓ',\n gl: '≷',\n glE: '⪒',\n gla: '⪥',\n glj: '⪤',\n gnE: '≩',\n gnap: '⪊',\n gnapprox: '⪊',\n gne: '⪈',\n gneq: '⪈',\n gneqq: '≩',\n gnsim: '⋧',\n gopf: '𝕘',\n grave: '`',\n gscr: 'ℊ',\n gsim: '≳',\n gsime: '⪎',\n gsiml: '⪐',\n gt: '>',\n gtcc: '⪧',\n gtcir: '⩺',\n gtdot: '⋗',\n gtlPar: '⦕',\n gtquest: '⩼',\n gtrapprox: '⪆',\n gtrarr: '⥸',\n gtrdot: '⋗',\n gtreqless: '⋛',\n gtreqqless: '⪌',\n gtrless: '≷',\n gtrsim: '≳',\n gvertneqq: '≩︀',\n gvnE: '≩︀',\n hArr: '⇔',\n hairsp: ' ',\n half: '½',\n hamilt: 'ℋ',\n hardcy: 'ъ',\n harr: '↔',\n harrcir: '⥈',\n harrw: '↭',\n hbar: 'ℏ',\n hcirc: 'ĥ',\n hearts: '♥',\n heartsuit: '♥',\n hellip: '…',\n hercon: '⊹',\n hfr: '𝔥',\n hksearow: '⤥',\n hkswarow: '⤦',\n hoarr: '⇿',\n homtht: '∻',\n hookleftarrow: '↩',\n hookrightarrow: '↪',\n hopf: '𝕙',\n horbar: '―',\n hscr: '𝒽',\n hslash: 'ℏ',\n hstrok: 'ħ',\n hybull: '⁃',\n hyphen: '‐',\n iacute: 'í',\n ic: '',\n icirc: 'î',\n icy: 'и',\n iecy: 'е',\n iexcl: '¡',\n iff: '⇔',\n ifr: '𝔦',\n igrave: 'ì',\n ii: 'ⅈ',\n iiiint: '⨌',\n iiint: '∭',\n iinfin: '⧜',\n iiota: '℩',\n ijlig: 'ij',\n imacr: 'ī',\n image: 'ℑ',\n imagline: 'ℐ',\n imagpart: 'ℑ',\n imath: 'ı',\n imof: '⊷',\n imped: 'Ƶ',\n in: '∈',\n incare: '℅',\n infin: '∞',\n infintie: '⧝',\n inodot: 'ı',\n int: '∫',\n intcal: '⊺',\n integers: 'ℤ',\n intercal: '⊺',\n intlarhk: '⨗',\n intprod: '⨼',\n iocy: 'ё',\n iogon: 'į',\n iopf: '𝕚',\n iota: 'ι',\n iprod: '⨼',\n iquest: '¿',\n iscr: '𝒾',\n isin: '∈',\n isinE: '⋹',\n isindot: '⋵',\n isins: '⋴',\n isinsv: '⋳',\n isinv: '∈',\n it: '',\n itilde: 'ĩ',\n iukcy: 'і',\n iuml: 'ï',\n jcirc: 'ĵ',\n jcy: 'й',\n jfr: '𝔧',\n jmath: 'ȷ',\n jopf: '𝕛',\n jscr: '𝒿',\n jsercy: 'ј',\n jukcy: 'є',\n kappa: 'κ',\n kappav: 'ϰ',\n kcedil: 'ķ',\n kcy: 'к',\n kfr: '𝔨',\n kgreen: 'ĸ',\n khcy: 'х',\n kjcy: 'ќ',\n kopf: '𝕜',\n kscr: '𝓀',\n lAarr: '⇚',\n lArr: '⇐',\n lAtail: '⤛',\n lBarr: '⤎',\n lE: '≦',\n lEg: '⪋',\n lHar: '⥢',\n lacute: 'ĺ',\n laemptyv: '⦴',\n lagran: 'ℒ',\n lambda: 'λ',\n lang: '⟨',\n langd: '⦑',\n langle: '⟨',\n lap: '⪅',\n laquo: '«',\n larr: '←',\n larrb: '⇤',\n larrbfs: '⤟',\n larrfs: '⤝',\n larrhk: '↩',\n larrlp: '↫',\n larrpl: '⤹',\n larrsim: '⥳',\n larrtl: '↢',\n lat: '⪫',\n latail: '⤙',\n late: '⪭',\n lates: '⪭︀',\n lbarr: '⤌',\n lbbrk: '❲',\n lbrace: '{',\n lbrack: '[',\n lbrke: '⦋',\n lbrksld: '⦏',\n lbrkslu: '⦍',\n lcaron: 'ľ',\n lcedil: 'ļ',\n lceil: '⌈',\n lcub: '{',\n lcy: 'л',\n ldca: '⤶',\n ldquo: '“',\n ldquor: '„',\n ldrdhar: '⥧',\n ldrushar: '⥋',\n ldsh: '↲',\n le: '≤',\n leftarrow: '←',\n leftarrowtail: '↢',\n leftharpoondown: '↽',\n leftharpoonup: '↼',\n leftleftarrows: '⇇',\n leftrightarrow: '↔',\n leftrightarrows: '⇆',\n leftrightharpoons: '⇋',\n leftrightsquigarrow: '↭',\n leftthreetimes: '⋋',\n leg: '⋚',\n leq: '≤',\n leqq: '≦',\n leqslant: '⩽',\n les: '⩽',\n lescc: '⪨',\n lesdot: '⩿',\n lesdoto: '⪁',\n lesdotor: '⪃',\n lesg: '⋚︀',\n lesges: '⪓',\n lessapprox: '⪅',\n lessdot: '⋖',\n lesseqgtr: '⋚',\n lesseqqgtr: '⪋',\n lessgtr: '≶',\n lesssim: '≲',\n lfisht: '⥼',\n lfloor: '⌊',\n lfr: '𝔩',\n lg: '≶',\n lgE: '⪑',\n lhard: '↽',\n lharu: '↼',\n lharul: '⥪',\n lhblk: '▄',\n ljcy: 'љ',\n ll: '≪',\n llarr: '⇇',\n llcorner: '⌞',\n llhard: '⥫',\n lltri: '◺',\n lmidot: 'ŀ',\n lmoust: '⎰',\n lmoustache: '⎰',\n lnE: '≨',\n lnap: '⪉',\n lnapprox: '⪉',\n lne: '⪇',\n lneq: '⪇',\n lneqq: '≨',\n lnsim: '⋦',\n loang: '⟬',\n loarr: '⇽',\n lobrk: '⟦',\n longleftarrow: '⟵',\n longleftrightarrow: '⟷',\n longmapsto: '⟼',\n longrightarrow: '⟶',\n looparrowleft: '↫',\n looparrowright: '↬',\n lopar: '⦅',\n lopf: '𝕝',\n loplus: '⨭',\n lotimes: '⨴',\n lowast: '∗',\n lowbar: '_',\n loz: '◊',\n lozenge: '◊',\n lozf: '⧫',\n lpar: '(',\n lparlt: '⦓',\n lrarr: '⇆',\n lrcorner: '⌟',\n lrhar: '⇋',\n lrhard: '⥭',\n lrm: '',\n lrtri: '⊿',\n lsaquo: '‹',\n lscr: '𝓁',\n lsh: '↰',\n lsim: '≲',\n lsime: '⪍',\n lsimg: '⪏',\n lsqb: '[',\n lsquo: '‘',\n lsquor: '‚',\n lstrok: 'ł',\n lt: '<',\n ltcc: '⪦',\n ltcir: '⩹',\n ltdot: '⋖',\n lthree: '⋋',\n ltimes: '⋉',\n ltlarr: '⥶',\n ltquest: '⩻',\n ltrPar: '⦖',\n ltri: '◃',\n ltrie: '⊴',\n ltrif: '◂',\n lurdshar: '⥊',\n luruhar: '⥦',\n lvertneqq: '≨︀',\n lvnE: '≨︀',\n mDDot: '∺',\n macr: '¯',\n male: '♂',\n malt: '✠',\n maltese: '✠',\n map: '↦',\n mapsto: '↦',\n mapstodown: '↧',\n mapstoleft: '↤',\n mapstoup: '↥',\n marker: '▮',\n mcomma: '⨩',\n mcy: 'м',\n mdash: '—',\n measuredangle: '∡',\n mfr: '𝔪',\n mho: '℧',\n micro: 'µ',\n mid: '∣',\n midast: '*',\n midcir: '⫰',\n middot: '·',\n minus: '−',\n minusb: '⊟',\n minusd: '∸',\n minusdu: '⨪',\n mlcp: '⫛',\n mldr: '…',\n mnplus: '∓',\n models: '⊧',\n mopf: '𝕞',\n mp: '∓',\n mscr: '𝓂',\n mstpos: '∾',\n mu: 'μ',\n multimap: '⊸',\n mumap: '⊸',\n nGg: '⋙̸',\n nGt: '≫⃒',\n nGtv: '≫̸',\n nLeftarrow: '⇍',\n nLeftrightarrow: '⇎',\n nLl: '⋘̸',\n nLt: '≪⃒',\n nLtv: '≪̸',\n nRightarrow: '⇏',\n nVDash: '⊯',\n nVdash: '⊮',\n nabla: '∇',\n nacute: 'ń',\n nang: '∠⃒',\n nap: '≉',\n napE: '⩰̸',\n napid: '≋̸',\n napos: 'ʼn',\n napprox: '≉',\n natur: '♮',\n natural: '♮',\n naturals: 'ℕ',\n nbsp: ' ',\n nbump: '≎̸',\n nbumpe: '≏̸',\n ncap: '⩃',\n ncaron: 'ň',\n ncedil: 'ņ',\n ncong: '≇',\n ncongdot: '⩭̸',\n ncup: '⩂',\n ncy: 'н',\n ndash: '–',\n ne: '≠',\n neArr: '⇗',\n nearhk: '⤤',\n nearr: '↗',\n nearrow: '↗',\n nedot: '≐̸',\n nequiv: '≢',\n nesear: '⤨',\n nesim: '≂̸',\n nexist: '∄',\n nexists: '∄',\n nfr: '𝔫',\n ngE: '≧̸',\n nge: '≱',\n ngeq: '≱',\n ngeqq: '≧̸',\n ngeqslant: '⩾̸',\n nges: '⩾̸',\n ngsim: '≵',\n ngt: '≯',\n ngtr: '≯',\n nhArr: '⇎',\n nharr: '↮',\n nhpar: '⫲',\n ni: '∋',\n nis: '⋼',\n nisd: '⋺',\n niv: '∋',\n njcy: 'њ',\n nlArr: '⇍',\n nlE: '≦̸',\n nlarr: '↚',\n nldr: '‥',\n nle: '≰',\n nleftarrow: '↚',\n nleftrightarrow: '↮',\n nleq: '≰',\n nleqq: '≦̸',\n nleqslant: '⩽̸',\n nles: '⩽̸',\n nless: '≮',\n nlsim: '≴',\n nlt: '≮',\n nltri: '⋪',\n nltrie: '⋬',\n nmid: '∤',\n nopf: '𝕟',\n not: '¬',\n notin: '∉',\n notinE: '⋹̸',\n notindot: '⋵̸',\n notinva: '∉',\n notinvb: '⋷',\n notinvc: '⋶',\n notni: '∌',\n notniva: '∌',\n notnivb: '⋾',\n notnivc: '⋽',\n npar: '∦',\n nparallel: '∦',\n nparsl: '⫽⃥',\n npart: '∂̸',\n npolint: '⨔',\n npr: '⊀',\n nprcue: '⋠',\n npre: '⪯̸',\n nprec: '⊀',\n npreceq: '⪯̸',\n nrArr: '⇏',\n nrarr: '↛',\n nrarrc: '⤳̸',\n nrarrw: '↝̸',\n nrightarrow: '↛',\n nrtri: '⋫',\n nrtrie: '⋭',\n nsc: '⊁',\n nsccue: '⋡',\n nsce: '⪰̸',\n nscr: '𝓃',\n nshortmid: '∤',\n nshortparallel: '∦',\n nsim: '≁',\n nsime: '≄',\n nsimeq: '≄',\n nsmid: '∤',\n nspar: '∦',\n nsqsube: '⋢',\n nsqsupe: '⋣',\n nsub: '⊄',\n nsubE: '⫅̸',\n nsube: '⊈',\n nsubset: '⊂⃒',\n nsubseteq: '⊈',\n nsubseteqq: '⫅̸',\n nsucc: '⊁',\n nsucceq: '⪰̸',\n nsup: '⊅',\n nsupE: '⫆̸',\n nsupe: '⊉',\n nsupset: '⊃⃒',\n nsupseteq: '⊉',\n nsupseteqq: '⫆̸',\n ntgl: '≹',\n ntilde: 'ñ',\n ntlg: '≸',\n ntriangleleft: '⋪',\n ntrianglelefteq: '⋬',\n ntriangleright: '⋫',\n ntrianglerighteq: '⋭',\n nu: 'ν',\n num: '#',\n numero: '№',\n numsp: ' ',\n nvDash: '⊭',\n nvHarr: '⤄',\n nvap: '≍⃒',\n nvdash: '⊬',\n nvge: '≥⃒',\n nvgt: '>⃒',\n nvinfin: '⧞',\n nvlArr: '⤂',\n nvle: '≤⃒',\n nvlt: '<⃒',\n nvltrie: '⊴⃒',\n nvrArr: '⤃',\n nvrtrie: '⊵⃒',\n nvsim: '∼⃒',\n nwArr: '⇖',\n nwarhk: '⤣',\n nwarr: '↖',\n nwarrow: '↖',\n nwnear: '⤧',\n oS: 'Ⓢ',\n oacute: 'ó',\n oast: '⊛',\n ocir: '⊚',\n ocirc: 'ô',\n ocy: 'о',\n odash: '⊝',\n odblac: 'ő',\n odiv: '⨸',\n odot: '⊙',\n odsold: '⦼',\n oelig: 'œ',\n ofcir: '⦿',\n ofr: '𝔬',\n ogon: '˛',\n ograve: 'ò',\n ogt: '⧁',\n ohbar: '⦵',\n ohm: 'Ω',\n oint: '∮',\n olarr: '↺',\n olcir: '⦾',\n olcross: '⦻',\n oline: '‾',\n olt: '⧀',\n omacr: 'ō',\n omega: 'ω',\n omicron: 'ο',\n omid: '⦶',\n ominus: '⊖',\n oopf: '𝕠',\n opar: '⦷',\n operp: '⦹',\n oplus: '⊕',\n or: '∨',\n orarr: '↻',\n ord: '⩝',\n order: 'ℴ',\n orderof: 'ℴ',\n ordf: 'ª',\n ordm: 'º',\n origof: '⊶',\n oror: '⩖',\n orslope: '⩗',\n orv: '⩛',\n oscr: 'ℴ',\n oslash: 'ø',\n osol: '⊘',\n otilde: 'õ',\n otimes: '⊗',\n otimesas: '⨶',\n ouml: 'ö',\n ovbar: '⌽',\n par: '∥',\n para: '¶',\n parallel: '∥',\n parsim: '⫳',\n parsl: '⫽',\n part: '∂',\n pcy: 'п',\n percnt: '%',\n period: '.',\n permil: '‰',\n perp: '⊥',\n pertenk: '‱',\n pfr: '𝔭',\n phi: 'φ',\n phiv: 'ϕ',\n phmmat: 'ℳ',\n phone: '☎',\n pi: 'π',\n pitchfork: '⋔',\n piv: 'ϖ',\n planck: 'ℏ',\n planckh: 'ℎ',\n plankv: 'ℏ',\n plus: '+',\n plusacir: '⨣',\n plusb: '⊞',\n pluscir: '⨢',\n plusdo: '∔',\n plusdu: '⨥',\n pluse: '⩲',\n plusmn: '±',\n plussim: '⨦',\n plustwo: '⨧',\n pm: '±',\n pointint: '⨕',\n popf: '𝕡',\n pound: '£',\n pr: '≺',\n prE: '⪳',\n prap: '⪷',\n prcue: '≼',\n pre: '⪯',\n prec: '≺',\n precapprox: '⪷',\n preccurlyeq: '≼',\n preceq: '⪯',\n precnapprox: '⪹',\n precneqq: '⪵',\n precnsim: '⋨',\n precsim: '≾',\n prime: '′',\n primes: 'ℙ',\n prnE: '⪵',\n prnap: '⪹',\n prnsim: '⋨',\n prod: '∏',\n profalar: '⌮',\n profline: '⌒',\n profsurf: '⌓',\n prop: '∝',\n propto: '∝',\n prsim: '≾',\n prurel: '⊰',\n pscr: '𝓅',\n psi: 'ψ',\n puncsp: ' ',\n qfr: '𝔮',\n qint: '⨌',\n qopf: '𝕢',\n qprime: '⁗',\n qscr: '𝓆',\n quaternions: 'ℍ',\n quatint: '⨖',\n quest: '?',\n questeq: '≟',\n quot: '\"',\n rAarr: '⇛',\n rArr: '⇒',\n rAtail: '⤜',\n rBarr: '⤏',\n rHar: '⥤',\n race: '∽̱',\n racute: 'ŕ',\n radic: '√',\n raemptyv: '⦳',\n rang: '⟩',\n rangd: '⦒',\n range: '⦥',\n rangle: '⟩',\n raquo: '»',\n rarr: '→',\n rarrap: '⥵',\n rarrb: '⇥',\n rarrbfs: '⤠',\n rarrc: '⤳',\n rarrfs: '⤞',\n rarrhk: '↪',\n rarrlp: '↬',\n rarrpl: '⥅',\n rarrsim: '⥴',\n rarrtl: '↣',\n rarrw: '↝',\n ratail: '⤚',\n ratio: '∶',\n rationals: 'ℚ',\n rbarr: '⤍',\n rbbrk: '❳',\n rbrace: '}',\n rbrack: ']',\n rbrke: '⦌',\n rbrksld: '⦎',\n rbrkslu: '⦐',\n rcaron: 'ř',\n rcedil: 'ŗ',\n rceil: '⌉',\n rcub: '}',\n rcy: 'р',\n rdca: '⤷',\n rdldhar: '⥩',\n rdquo: '”',\n rdquor: '”',\n rdsh: '↳',\n real: 'ℜ',\n realine: 'ℛ',\n realpart: 'ℜ',\n reals: 'ℝ',\n rect: '▭',\n reg: '®',\n rfisht: '⥽',\n rfloor: '⌋',\n rfr: '𝔯',\n rhard: '⇁',\n rharu: '⇀',\n rharul: '⥬',\n rho: 'ρ',\n rhov: 'ϱ',\n rightarrow: '→',\n rightarrowtail: '↣',\n rightharpoondown: '⇁',\n rightharpoonup: '⇀',\n rightleftarrows: '⇄',\n rightleftharpoons: '⇌',\n rightrightarrows: '⇉',\n rightsquigarrow: '↝',\n rightthreetimes: '⋌',\n ring: '˚',\n risingdotseq: '≓',\n rlarr: '⇄',\n rlhar: '⇌',\n rlm: '',\n rmoust: '⎱',\n rmoustache: '⎱',\n rnmid: '⫮',\n roang: '⟭',\n roarr: '⇾',\n robrk: '⟧',\n ropar: '⦆',\n ropf: '𝕣',\n roplus: '⨮',\n rotimes: '⨵',\n rpar: ')',\n rpargt: '⦔',\n rppolint: '⨒',\n rrarr: '⇉',\n rsaquo: '›',\n rscr: '𝓇',\n rsh: '↱',\n rsqb: ']',\n rsquo: '’',\n rsquor: '’',\n rthree: '⋌',\n rtimes: '⋊',\n rtri: '▹',\n rtrie: '⊵',\n rtrif: '▸',\n rtriltri: '⧎',\n ruluhar: '⥨',\n rx: '℞',\n sacute: 'ś',\n sbquo: '‚',\n sc: '≻',\n scE: '⪴',\n scap: '⪸',\n scaron: 'š',\n sccue: '≽',\n sce: '⪰',\n scedil: 'ş',\n scirc: 'ŝ',\n scnE: '⪶',\n scnap: '⪺',\n scnsim: '⋩',\n scpolint: '⨓',\n scsim: '≿',\n scy: 'с',\n sdot: '⋅',\n sdotb: '⊡',\n sdote: '⩦',\n seArr: '⇘',\n searhk: '⤥',\n searr: '↘',\n searrow: '↘',\n sect: '§',\n semi: ';',\n seswar: '⤩',\n setminus: '∖',\n setmn: '∖',\n sext: '✶',\n sfr: '𝔰',\n sfrown: '⌢',\n sharp: '♯',\n shchcy: 'щ',\n shcy: 'ш',\n shortmid: '∣',\n shortparallel: '∥',\n shy: '',\n sigma: 'σ',\n sigmaf: 'ς',\n sigmav: 'ς',\n sim: '∼',\n simdot: '⩪',\n sime: '≃',\n simeq: '≃',\n simg: '⪞',\n simgE: '⪠',\n siml: '⪝',\n simlE: '⪟',\n simne: '≆',\n simplus: '⨤',\n simrarr: '⥲',\n slarr: '←',\n smallsetminus: '∖',\n smashp: '⨳',\n smeparsl: '⧤',\n smid: '∣',\n smile: '⌣',\n smt: '⪪',\n smte: '⪬',\n smtes: '⪬︀',\n softcy: 'ь',\n sol: '/',\n solb: '⧄',\n solbar: '⌿',\n sopf: '𝕤',\n spades: '♠',\n spadesuit: '♠',\n spar: '∥',\n sqcap: '⊓',\n sqcaps: '⊓︀',\n sqcup: '⊔',\n sqcups: '⊔︀',\n sqsub: '⊏',\n sqsube: '⊑',\n sqsubset: '⊏',\n sqsubseteq: '⊑',\n sqsup: '⊐',\n sqsupe: '⊒',\n sqsupset: '⊐',\n sqsupseteq: '⊒',\n squ: '□',\n square: '□',\n squarf: '▪',\n squf: '▪',\n srarr: '→',\n sscr: '𝓈',\n ssetmn: '∖',\n ssmile: '⌣',\n sstarf: '⋆',\n star: '☆',\n starf: '★',\n straightepsilon: 'ϵ',\n straightphi: 'ϕ',\n strns: '¯',\n sub: '⊂',\n subE: '⫅',\n subdot: '⪽',\n sube: '⊆',\n subedot: '⫃',\n submult: '⫁',\n subnE: '⫋',\n subne: '⊊',\n subplus: '⪿',\n subrarr: '⥹',\n subset: '⊂',\n subseteq: '⊆',\n subseteqq: '⫅',\n subsetneq: '⊊',\n subsetneqq: '⫋',\n subsim: '⫇',\n subsub: '⫕',\n subsup: '⫓',\n succ: '≻',\n succapprox: '⪸',\n succcurlyeq: '≽',\n succeq: '⪰',\n succnapprox: '⪺',\n succneqq: '⪶',\n succnsim: '⋩',\n succsim: '≿',\n sum: '∑',\n sung: '♪',\n sup1: '¹',\n sup2: '²',\n sup3: '³',\n sup: '⊃',\n supE: '⫆',\n supdot: '⪾',\n supdsub: '⫘',\n supe: '⊇',\n supedot: '⫄',\n suphsol: '⟉',\n suphsub: '⫗',\n suplarr: '⥻',\n supmult: '⫂',\n supnE: '⫌',\n supne: '⊋',\n supplus: '⫀',\n supset: '⊃',\n supseteq: '⊇',\n supseteqq: '⫆',\n supsetneq: '⊋',\n supsetneqq: '⫌',\n supsim: '⫈',\n supsub: '⫔',\n supsup: '⫖',\n swArr: '⇙',\n swarhk: '⤦',\n swarr: '↙',\n swarrow: '↙',\n swnwar: '⤪',\n szlig: 'ß',\n target: '⌖',\n tau: 'τ',\n tbrk: '⎴',\n tcaron: 'ť',\n tcedil: 'ţ',\n tcy: 'т',\n tdot: '⃛',\n telrec: '⌕',\n tfr: '𝔱',\n there4: '∴',\n therefore: '∴',\n theta: 'θ',\n thetasym: 'ϑ',\n thetav: 'ϑ',\n thickapprox: '≈',\n thicksim: '∼',\n thinsp: ' ',\n thkap: '≈',\n thksim: '∼',\n thorn: 'þ',\n tilde: '˜',\n times: '×',\n timesb: '⊠',\n timesbar: '⨱',\n timesd: '⨰',\n tint: '∭',\n toea: '⤨',\n top: '⊤',\n topbot: '⌶',\n topcir: '⫱',\n topf: '𝕥',\n topfork: '⫚',\n tosa: '⤩',\n tprime: '‴',\n trade: '™',\n triangle: '▵',\n triangledown: '▿',\n triangleleft: '◃',\n trianglelefteq: '⊴',\n triangleq: '≜',\n triangleright: '▹',\n trianglerighteq: '⊵',\n tridot: '◬',\n trie: '≜',\n triminus: '⨺',\n triplus: '⨹',\n trisb: '⧍',\n tritime: '⨻',\n trpezium: '⏢',\n tscr: '𝓉',\n tscy: 'ц',\n tshcy: 'ћ',\n tstrok: 'ŧ',\n twixt: '≬',\n twoheadleftarrow: '↞',\n twoheadrightarrow: '↠',\n uArr: '⇑',\n uHar: '⥣',\n uacute: 'ú',\n uarr: '↑',\n ubrcy: 'ў',\n ubreve: 'ŭ',\n ucirc: 'û',\n ucy: 'у',\n udarr: '⇅',\n udblac: 'ű',\n udhar: '⥮',\n ufisht: '⥾',\n ufr: '𝔲',\n ugrave: 'ù',\n uharl: '↿',\n uharr: '↾',\n uhblk: '▀',\n ulcorn: '⌜',\n ulcorner: '⌜',\n ulcrop: '⌏',\n ultri: '◸',\n umacr: 'ū',\n uml: '¨',\n uogon: 'ų',\n uopf: '𝕦',\n uparrow: '↑',\n updownarrow: '↕',\n upharpoonleft: '↿',\n upharpoonright: '↾',\n uplus: '⊎',\n upsi: 'υ',\n upsih: 'ϒ',\n upsilon: 'υ',\n upuparrows: '⇈',\n urcorn: '⌝',\n urcorner: '⌝',\n urcrop: '⌎',\n uring: 'ů',\n urtri: '◹',\n uscr: '𝓊',\n utdot: '⋰',\n utilde: 'ũ',\n utri: '▵',\n utrif: '▴',\n uuarr: '⇈',\n uuml: 'ü',\n uwangle: '⦧',\n vArr: '⇕',\n vBar: '⫨',\n vBarv: '⫩',\n vDash: '⊨',\n vangrt: '⦜',\n varepsilon: 'ϵ',\n varkappa: 'ϰ',\n varnothing: '∅',\n varphi: 'ϕ',\n varpi: 'ϖ',\n varpropto: '∝',\n varr: '↕',\n varrho: 'ϱ',\n varsigma: 'ς',\n varsubsetneq: '⊊︀',\n varsubsetneqq: '⫋︀',\n varsupsetneq: '⊋︀',\n varsupsetneqq: '⫌︀',\n vartheta: 'ϑ',\n vartriangleleft: '⊲',\n vartriangleright: '⊳',\n vcy: 'в',\n vdash: '⊢',\n vee: '∨',\n veebar: '⊻',\n veeeq: '≚',\n vellip: '⋮',\n verbar: '|',\n vert: '|',\n vfr: '𝔳',\n vltri: '⊲',\n vnsub: '⊂⃒',\n vnsup: '⊃⃒',\n vopf: '𝕧',\n vprop: '∝',\n vrtri: '⊳',\n vscr: '𝓋',\n vsubnE: '⫋︀',\n vsubne: '⊊︀',\n vsupnE: '⫌︀',\n vsupne: '⊋︀',\n vzigzag: '⦚',\n wcirc: 'ŵ',\n wedbar: '⩟',\n wedge: '∧',\n wedgeq: '≙',\n weierp: '℘',\n wfr: '𝔴',\n wopf: '𝕨',\n wp: '℘',\n wr: '≀',\n wreath: '≀',\n wscr: '𝓌',\n xcap: '⋂',\n xcirc: '◯',\n xcup: '⋃',\n xdtri: '▽',\n xfr: '𝔵',\n xhArr: '⟺',\n xharr: '⟷',\n xi: 'ξ',\n xlArr: '⟸',\n xlarr: '⟵',\n xmap: '⟼',\n xnis: '⋻',\n xodot: '⨀',\n xopf: '𝕩',\n xoplus: '⨁',\n xotime: '⨂',\n xrArr: '⟹',\n xrarr: '⟶',\n xscr: '𝓍',\n xsqcup: '⨆',\n xuplus: '⨄',\n xutri: '△',\n xvee: '⋁',\n xwedge: '⋀',\n yacute: 'ý',\n yacy: 'я',\n ycirc: 'ŷ',\n ycy: 'ы',\n yen: '¥',\n yfr: '𝔶',\n yicy: 'ї',\n yopf: '𝕪',\n yscr: '𝓎',\n yucy: 'ю',\n yuml: 'ÿ',\n zacute: 'ź',\n zcaron: 'ž',\n zcy: 'з',\n zdot: 'ż',\n zeetrf: 'ℨ',\n zeta: 'ζ',\n zfr: '𝔷',\n zhcy: 'ж',\n zigrarr: '⇝',\n zopf: '𝕫',\n zscr: '𝓏',\n zwj: '',\n zwnj: ''\n}\n","import {characterEntities} from 'character-entities'\n\n// To do: next major: use `Object.hasOwn`.\nconst own = {}.hasOwnProperty\n\n/**\n * Decode a single character reference (without the `&` or `;`).\n * You probably only need this when you’re building parsers yourself that follow\n * different rules compared to HTML.\n * This is optimized to be tiny in browsers.\n *\n * @param {string} value\n * `notin` (named), `#123` (deci), `#x123` (hexa).\n * @returns {string|false}\n * Decoded reference.\n */\nexport function decodeNamedCharacterReference(value) {\n return own.call(characterEntities, value) ? characterEntities[value] : false\n}\n","/**\n * Like `Array#splice`, but smarter for giant arrays.\n *\n * `Array#splice` takes all items to be inserted as individual argument which\n * causes a stack overflow in V8 when trying to insert 100k items for instance.\n *\n * Otherwise, this does not return the removed items, and takes `items` as an\n * array instead of rest parameters.\n *\n * @template {unknown} T\n * Item type.\n * @param {Array<T>} list\n * List to operate on.\n * @param {number} start\n * Index to remove/insert at (can be negative).\n * @param {number} remove\n * Number of items to remove.\n * @param {Array<T>} items\n * Items to inject into `list`.\n * @returns {undefined}\n * Nothing.\n */\nexport function splice(list, start, remove, items) {\n const end = list.length;\n let chunkStart = 0;\n /** @type {Array<unknown>} */\n let parameters;\n\n // Make start between zero and `end` (included).\n if (start < 0) {\n start = -start > end ? 0 : end + start;\n } else {\n start = start > end ? end : start;\n }\n remove = remove > 0 ? remove : 0;\n\n // No need to chunk the items if there’s only a couple (10k) items.\n if (items.length < 10000) {\n parameters = Array.from(items);\n parameters.unshift(start, remove);\n // @ts-expect-error Hush, it’s fine.\n list.splice(...parameters);\n } else {\n // Delete `remove` items starting from `start`\n if (remove) list.splice(start, remove);\n\n // Insert the items in chunks to not cause stack overflows.\n while (chunkStart < items.length) {\n parameters = items.slice(chunkStart, chunkStart + 10000);\n parameters.unshift(start, 0);\n // @ts-expect-error Hush, it’s fine.\n list.splice(...parameters);\n chunkStart += 10000;\n start += 10000;\n }\n }\n}\n\n/**\n * Append `items` (an array) at the end of `list` (another array).\n * When `list` was empty, returns `items` instead.\n *\n * This prevents a potentially expensive operation when `list` is empty,\n * and adds items in batches to prevent V8 from hanging.\n *\n * @template {unknown} T\n * Item type.\n * @param {Array<T>} list\n * List to operate on.\n * @param {Array<T>} items\n * Items to add to `list`.\n * @returns {Array<T>}\n * Either `list` or `items`.\n */\nexport function push(list, items) {\n if (list.length > 0) {\n splice(list, list.length, 0, items);\n return list;\n }\n return items;\n}","/**\n * @import {\n * Extension,\n * Handles,\n * HtmlExtension,\n * NormalizedExtension\n * } from 'micromark-util-types'\n */\n\nimport {splice} from 'micromark-util-chunked'\n\nconst hasOwnProperty = {}.hasOwnProperty\n\n/**\n * Combine multiple syntax extensions into one.\n *\n * @param {ReadonlyArray<Extension>} extensions\n * List of syntax extensions.\n * @returns {NormalizedExtension}\n * A single combined extension.\n */\nexport function combineExtensions(extensions) {\n /** @type {NormalizedExtension} */\n const all = {}\n let index = -1\n\n while (++index < extensions.length) {\n syntaxExtension(all, extensions[index])\n }\n\n return all\n}\n\n/**\n * Merge `extension` into `all`.\n *\n * @param {NormalizedExtension} all\n * Extension to merge into.\n * @param {Extension} extension\n * Extension to merge.\n * @returns {undefined}\n * Nothing.\n */\nfunction syntaxExtension(all, extension) {\n /** @type {keyof Extension} */\n let hook\n\n for (hook in extension) {\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined\n /** @type {Record<string, unknown>} */\n const left = maybe || (all[hook] = {})\n /** @type {Record<string, unknown> | undefined} */\n const right = extension[hook]\n /** @type {string} */\n let code\n\n if (right) {\n for (code in right) {\n if (!hasOwnProperty.call(left, code)) left[code] = []\n const value = right[code]\n constructs(\n // @ts-expect-error Looks like a list.\n left[code],\n Array.isArray(value) ? value : value ? [value] : []\n )\n }\n }\n }\n}\n\n/**\n * Merge `list` into `existing` (both lists of constructs).\n * Mutates `existing`.\n *\n * @param {Array<unknown>} existing\n * List of constructs to merge into.\n * @param {Array<unknown>} list\n * List of constructs to merge.\n * @returns {undefined}\n * Nothing.\n */\nfunction constructs(existing, list) {\n let index = -1\n /** @type {Array<unknown>} */\n const before = []\n\n while (++index < list.length) {\n // @ts-expect-error Looks like an object.\n ;(list[index].add === 'after' ? existing : before).push(list[index])\n }\n\n splice(existing, 0, 0, before)\n}\n\n/**\n * Combine multiple HTML extensions into one.\n *\n * @param {ReadonlyArray<HtmlExtension>} htmlExtensions\n * List of HTML extensions.\n * @returns {HtmlExtension}\n * Single combined HTML extension.\n */\nexport function combineHtmlExtensions(htmlExtensions) {\n /** @type {HtmlExtension} */\n const handlers = {}\n let index = -1\n\n while (++index < htmlExtensions.length) {\n htmlExtension(handlers, htmlExtensions[index])\n }\n\n return handlers\n}\n\n/**\n * Merge `extension` into `all`.\n *\n * @param {HtmlExtension} all\n * Extension to merge into.\n * @param {HtmlExtension} extension\n * Extension to merge.\n * @returns {undefined}\n * Nothing.\n */\nfunction htmlExtension(all, extension) {\n /** @type {keyof HtmlExtension} */\n let hook\n\n for (hook in extension) {\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined\n const left = maybe || (all[hook] = {})\n const right = extension[hook]\n /** @type {keyof Handles} */\n let type\n\n if (right) {\n for (type in right) {\n // @ts-expect-error assume document vs regular handler are managed correctly.\n left[type] = right[type]\n }\n }\n }\n}\n","/**\n * Turn the number (in string form as either hexa- or plain decimal) coming from\n * a numeric character reference into a character.\n *\n * Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes\n * non-characters and control characters safe.\n *\n * @param {string} value\n * Value to decode.\n * @param {number} base\n * Numeric base.\n * @returns {string}\n * Character.\n */\nexport function decodeNumericCharacterReference(value, base) {\n const code = Number.parseInt(value, base);\n if (\n // C0 except for HT, LF, FF, CR, space.\n code < 9 || code === 11 || code > 13 && code < 32 ||\n // Control character (DEL) of C0, and C1 controls.\n code > 126 && code < 160 ||\n // Lone high surrogates and low surrogates.\n code > 55_295 && code < 57_344 ||\n // Noncharacters.\n code > 64_975 && code < 65_008 || /* eslint-disable no-bitwise */\n (code & 65_535) === 65_535 || (code & 65_535) === 65_534 || /* eslint-enable no-bitwise */\n // Out of range\n code > 1_114_111) {\n return \"\\uFFFD\";\n }\n return String.fromCodePoint(code);\n}","/**\n * Normalize an identifier (as found in references, definitions).\n *\n * Collapses markdown whitespace, trim, and then lower- and uppercase.\n *\n * Some characters are considered “uppercase”, such as U+03F4 (`ϴ`), but if their\n * lowercase counterpart (U+03B8 (`θ`)) is uppercased will result in a different\n * uppercase character (U+0398 (`Θ`)).\n * So, to get a canonical form, we perform both lower- and uppercase.\n *\n * Using uppercase last makes sure keys will never interact with default\n * prototypal values (such as `constructor`): nothing in the prototype of\n * `Object` is uppercase.\n *\n * @param {string} value\n * Identifier to normalize.\n * @returns {string}\n * Normalized identifier.\n */\nexport function normalizeIdentifier(value) {\n return value\n // Collapse markdown whitespace.\n .replace(/[\\t\\n\\r ]+/g, \" \")\n // Trim.\n .replace(/^ | $/g, '')\n // Some characters are considered “uppercase”, but if their lowercase\n // counterpart is uppercased will result in a different uppercase\n // character.\n // Hence, to get that form, we perform both lower- and uppercase.\n // Upper case makes sure keys will not interact with default prototypal\n // methods: no method is uppercase.\n .toLowerCase().toUpperCase();\n}","/**\n * @import {Code} from 'micromark-util-types'\n */\n\n/**\n * Check whether the character code represents an ASCII alpha (`a` through `z`,\n * case insensitive).\n *\n * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.\n *\n * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)\n * to U+005A (`Z`).\n *\n * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)\n * to U+007A (`z`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAlpha = regexCheck(/[A-Za-z]/);\n\n/**\n * Check whether the character code represents an ASCII alphanumeric (`a`\n * through `z`, case insensitive, or `0` through `9`).\n *\n * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha\n * (see `asciiAlpha`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAlphanumeric = regexCheck(/[\\dA-Za-z]/);\n\n/**\n * Check whether the character code represents an ASCII atext.\n *\n * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in\n * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),\n * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F\n * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E\n * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE\n * (`{`) to U+007E TILDE (`~`).\n *\n * See:\n * **\\[RFC5322]**:\n * [Internet Message Format](https://tools.ietf.org/html/rfc5322).\n * P. Resnick.\n * IETF.\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAtext = regexCheck(/[#-'*+\\--9=?A-Z^-~]/);\n\n/**\n * Check whether a character code is an ASCII control character.\n *\n * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)\n * to U+001F (US), or U+007F (DEL).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function asciiControl(code) {\n return (\n // Special whitespace codes (which have negative values), C0 and Control\n // character DEL\n code !== null && (code < 32 || code === 127)\n );\n}\n\n/**\n * Check whether the character code represents an ASCII digit (`0` through `9`).\n *\n * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to\n * U+0039 (`9`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiDigit = regexCheck(/\\d/);\n\n/**\n * Check whether the character code represents an ASCII hex digit (`a` through\n * `f`, case insensitive, or `0` through `9`).\n *\n * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex\n * digit, or an ASCII lower hex digit.\n *\n * An **ASCII upper hex digit** is a character in the inclusive range U+0041\n * (`A`) to U+0046 (`F`).\n *\n * An **ASCII lower hex digit** is a character in the inclusive range U+0061\n * (`a`) to U+0066 (`f`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiHexDigit = regexCheck(/[\\dA-Fa-f]/);\n\n/**\n * Check whether the character code represents ASCII punctuation.\n *\n * An **ASCII punctuation** is a character in the inclusive ranges U+0021\n * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT\n * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT\n * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);\n\n/**\n * Check whether a character code is a markdown line ending.\n *\n * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN\n * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).\n *\n * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE\n * RETURN (CR) are replaced by these virtual characters depending on whether\n * they occurred together.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEnding(code) {\n return code !== null && code < -2;\n}\n\n/**\n * Check whether a character code is a markdown line ending (see\n * `markdownLineEnding`) or markdown space (see `markdownSpace`).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEndingOrSpace(code) {\n return code !== null && (code < 0 || code === 32);\n}\n\n/**\n * Check whether a character code is a markdown space.\n *\n * A **markdown space** is the concrete character U+0020 SPACE (SP) and the\n * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).\n *\n * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is\n * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL\n * SPACE (VS) characters, depending on the column at which the tab occurred.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownSpace(code) {\n return code === -2 || code === -1 || code === 32;\n}\n\n// Size note: removing ASCII from the regex and using `asciiPunctuation` here\n// In fact adds to the bundle size.\n/**\n * Check whether the character code represents Unicode punctuation.\n *\n * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,\n * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`\n * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`\n * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII\n * punctuation (see `asciiPunctuation`).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const unicodePunctuation = regexCheck(/\\p{P}|\\p{S}/u);\n\n/**\n * Check whether the character code represents Unicode whitespace.\n *\n * Note that this does handle micromark specific markdown whitespace characters.\n * See `markdownLineEndingOrSpace` to check that.\n *\n * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,\n * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),\n * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\\[UNICODE]**).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const unicodeWhitespace = regexCheck(/\\s/);\n\n/**\n * Create a code check from a regex.\n *\n * @param {RegExp} regex\n * Expression.\n * @returns {(code: Code) => boolean}\n * Check.\n */\nfunction regexCheck(regex) {\n return check;\n\n /**\n * Check whether a code matches the bound regex.\n *\n * @param {Code} code\n * Character code.\n * @returns {boolean}\n * Whether the character code matches the bound regex.\n */\n function check(code) {\n return code !== null && code > -1 && regex.test(String.fromCharCode(code));\n }\n}","/**\n * @import {Effects, State, TokenType} from 'micromark-util-types'\n */\n\nimport { markdownSpace } from 'micromark-util-character';\n\n// To do: implement `spaceOrTabWithOptions` (`connect`, `content`).\n\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * spaces in markdown are often optional, in which case this factory can be\n * used and `ok` will be switched to whether spaces were found or not\n * * one line ending or space can be detected with `markdownSpace(code)` right\n * before using `factorySpace`\n *\n * ###### Examples\n *\n * Where `␉` represents a tab (plus how much it expands) and `␠` represents a\n * single space.\n *\n * ```markdown\n * ␉\n * ␠␠␠␠\n * ␉␠\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {TokenType} type\n * Type of the whole whitespace.\n * @param {number | undefined} [max=Infinity]\n * Max (exclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpace(effects, ok, type, max) {\n const limit = max ? max - 1 : Infinity;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return ok(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size++ < limit) {\n effects.consume(code);\n return prefix;\n }\n effects.exit(type);\n return ok(code);\n }\n}\n\n/**\n * Parse spaces and tabs, with a required minimum and maximum, matching\n * `markdown-rs`’s `space_or_tab_min_max`.\n *\n * Unlike `factorySpace`, this can fail: `nok` is used when fewer than\n * `min` spaces or tabs are found.\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole whitespace.\n * @param {number} min\n * Minimum allowed characters (inclusive).\n * @param {number} max\n * Maximum allowed characters (inclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpaceMinMax(effects, ok, nok, type, min, max) {\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (max > 0 && markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return after(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size < max) {\n effects.consume(code);\n size++;\n return prefix;\n }\n effects.exit(type);\n return after(code);\n }\n\n /** @type {State} */\n function after(code) {\n return size >= min ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * InitialConstruct,\n * Initializer,\n * State,\n * TokenizeContext,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {InitialConstruct} */\nexport const content = {\n tokenize: initializeContent\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Initializer}\n * Content.\n */\nfunction initializeContent(effects) {\n const contentStart = effects.attempt(this.parser.constructs.contentInitial, afterContentStartConstruct, paragraphInitial);\n /** @type {Token} */\n let previous;\n return contentStart;\n\n /** @type {State} */\n function afterContentStartConstruct(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, contentStart, \"linePrefix\");\n }\n\n /** @type {State} */\n function paragraphInitial(code) {\n effects.enter(\"paragraph\");\n return lineStart(code);\n }\n\n /** @type {State} */\n function lineStart(code) {\n const token = effects.enter(\"chunkText\", {\n contentType: \"text\",\n previous\n });\n if (previous) {\n previous.next = token;\n }\n previous = token;\n return data(code);\n }\n\n /** @type {State} */\n function data(code) {\n if (code === null) {\n effects.exit(\"chunkText\");\n effects.exit(\"paragraph\");\n effects.consume(code);\n return;\n }\n if (markdownLineEnding(code)) {\n effects.consume(code);\n effects.exit(\"chunkText\");\n return lineStart;\n }\n\n // Data.\n effects.consume(code);\n return data;\n }\n}","/**\n * @import {Event} from 'micromark-util-types'\n */\n\n/**\n * @typedef {[number, number, Array<Event>]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n *\n * Port of `edit_map.rs` from `markdown-rs`:\n * <https://github.com/wooorm/markdown-rs/blob/1506572f/src/util/edit_map.rs>.\n *\n * Deal with several changes in events, batching them together.\n *\n * Preferably, changes should be kept to a minimum.\n * Sometimes, it’s needed to change the list of events, because parsing can be\n * messy, and it helps to expose a cleaner interface of events to the compiler\n * and other users.\n * It can also help to merge many adjacent similar events.\n * And, in other cases, it’s needed to parse subcontent: pass some events\n * through another tokenizer and inject the result.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n *\n * @returns\n * New instance.\n */\n constructor() {\n /**\n * Changes by index, so `add` does not need to scan `map` (which is\n * quadratic for documents with many edits at different places).\n *\n * @type {Map<number, Change>}\n */\n this.index = new Map();\n\n /**\n * Record of changes.\n *\n * @type {Array<Change>}\n */\n this.map = [];\n }\n\n /**\n * Create an edit: a remove and/or add at a certain place.\n *\n * @param {number} index\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @returns {undefined}\n * Nothing.\n */\n add(index, remove, add) {\n addImplementation(this, index, remove, add, false);\n }\n\n /**\n * Create an edit: but insert `add` before existing additions, instead of\n * after them.\n *\n * @param {number} index\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @returns {undefined}\n * Nothing.\n */\n addBefore(index, remove, add) {\n addImplementation(this, index, remove, add, true);\n }\n\n /**\n * Done, change the events.\n *\n * @param {Array<Event>} events\n * List of events to apply the edits to.\n * @returns {undefined}\n * Nothing.\n */\n consume(events) {\n this.map.sort(function (a, b) {\n return a[0] - b[0];\n });\n if (this.map.length === 0) {\n return;\n }\n\n // To do: if links are added in events, like they are in `markdown-rs`,\n // this is needed.\n // // Calculate jumps: where items in the current list move to.\n // /** @type {Array<Jump>} */\n // const jumps = []\n // let index = 0\n // let addAcc = 0\n // let removeAcc = 0\n // while (index < this.map.length) {\n // const [at, remove, add] = this.map[index]\n // removeAcc += remove\n // addAcc += add.length\n // jumps.push([at, removeAcc, addAcc])\n // index += 1\n // }\n //\n // shiftLinks(events, jumps)\n\n let index = this.map.length;\n /** @type {Array<Array<Event>>} */\n const vecs = [];\n while (index > 0) {\n index -= 1;\n vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);\n\n // Truncate rest.\n events.length = this.map[index][0];\n }\n vecs.push(events.slice());\n events.length = 0;\n let slice = vecs.pop();\n while (slice) {\n for (const element of slice) {\n events.push(element);\n }\n slice = vecs.pop();\n }\n\n // Truncate everything.\n this.map.length = 0;\n this.index.clear();\n }\n}\n\n/**\n * Create an edit.\n *\n * @param {EditMap} editMap\n * Edit map to apply to.\n * @param {number} at\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @param {boolean} before\n * Insert `add` before existing additions at `at`, instead of after them.\n * @returns {undefined}\n * Nothing.\n */\nfunction addImplementation(editMap, at, remove, add, before) {\n if (remove === 0 && add.length === 0) {\n return;\n }\n const existing = editMap.index.get(at);\n if (existing) {\n existing[1] += remove;\n if (before) {\n add.push(...existing[2]);\n existing[2] = add;\n } else {\n existing[2].push(...add);\n }\n return;\n }\n\n /** @type {Change} */\n const change = [at, remove, add];\n editMap.map.push(change);\n editMap.index.set(at, change);\n}\n\n// /**\n// * Shift `previous` and `next` links according to `jumps`.\n// *\n// * This fixes links in case there are events removed or added between them.\n// *\n// * @param {Array<Event>} events\n// * @param {Array<Jump>} jumps\n// */\n// function shiftLinks(events, jumps) {\n// let jumpIndex = 0\n// let index = 0\n// let add = 0\n// let rm = 0\n\n// while (index < events.length) {\n// const rmCurr = rm\n\n// while (jumpIndex < jumps.length && jumps[jumpIndex][0] <= index) {\n// add = jumps[jumpIndex][2]\n// rm = jumps[jumpIndex][1]\n// jumpIndex += 1\n// }\n\n// // Ignore items that will be removed.\n// if (rm > rmCurr) {\n// index += rm - rmCurr\n// } else {\n// // ?\n// // if let Some(link) = &events[index].link {\n// // if let Some(next) = link.next {\n// // events[next].link.as_mut().unwrap().previous = Some(index + add - rm);\n// // while jumpIndex < jumps.len() && jumps[jumpIndex].0 <= next {\n// // add = jumps[jumpIndex].2;\n// // rm = jumps[jumpIndex].1;\n// // jumpIndex += 1;\n// // }\n// // events[index].link.as_mut().unwrap().next = Some(next + add - rm);\n// // index = next;\n// // continue;\n// // }\n// // }\n// index += 1\n// }\n// }\n// }","/**\n * @import {\n * Construct,\n * ContainerState,\n * InitialConstruct,\n * Initializer,\n * Point,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\n/**\n * @typedef {[Construct, ContainerState]} StackItem\n * Construct and its state.\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { EditMap } from 'micromark-util-edit-map';\n/** @type {InitialConstruct} */\nexport const document = {\n tokenize: initializeDocument\n};\n\n/** @type {Construct} */\nconst containerConstruct = {\n tokenize: tokenizeContainer\n};\n\n/**\n * @this {TokenizeContext}\n * Self.\n * @type {Initializer}\n * Initializer.\n */\nfunction initializeDocument(effects) {\n const self = this;\n /** @type {Array<StackItem>} */\n const stack = [];\n let continued = 0;\n /** @type {TokenizeContext | undefined} */\n let childFlow;\n /** @type {Token | undefined} */\n let childToken;\n /** @type {number} */\n let lineStartOffset;\n return start;\n\n /** @type {State} */\n function start(code) {\n // First we iterate through the open blocks, starting with the root\n // document, and descending through last children down to the last open\n // block.\n // Each block imposes a condition that the line must satisfy if the block is\n // to remain open.\n // For example, a block quote requires a `>` character.\n // A paragraph requires a non-blank line.\n // In this phase we may match all or just some of the open blocks.\n // But we cannot close unmatched blocks yet, because we may have a lazy\n // continuation line.\n if (continued < stack.length) {\n const item = stack[continued];\n self.containerState = item[1];\n return effects.attempt(item[0].continuation, documentContinue, checkNewContainers)(code);\n }\n\n // Done.\n return checkNewContainers(code);\n }\n\n /** @type {State} */\n function documentContinue(code) {\n continued++;\n\n // Note: this field is called `_closeFlow` but it also closes containers.\n // Perhaps a good idea to rename it but it’s already used in the wild by\n // extensions.\n if (self.containerState._closeFlow) {\n self.containerState._closeFlow = undefined;\n if (childFlow) {\n closeFlow();\n }\n\n // Note: this algorithm for moving events around is similar to the\n // algorithm when dealing with lazy lines in `writeToChild`.\n const indexBeforeExits = self.events.length;\n let indexBeforeFlow = indexBeforeExits;\n /** @type {Point | undefined} */\n let point;\n\n // Find the flow chunk.\n while (indexBeforeFlow--) {\n if (self.events[indexBeforeFlow][0] === 'exit' && self.events[indexBeforeFlow][1].type === \"chunkFlow\") {\n point = self.events[indexBeforeFlow][1].end;\n break;\n }\n }\n exitContainers(continued);\n\n // Fix positions.\n let index = indexBeforeExits;\n while (index < self.events.length) {\n self.events[index][1].end = {\n ...point\n };\n index++;\n }\n const editMap = new EditMap();\n // Inject the exits earlier (they’re still also at the end).\n editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));\n // Discard the duplicate exits.\n editMap.add(indexBeforeExits, index - indexBeforeExits, []);\n editMap.consume(self.events);\n return checkNewContainers(code);\n }\n return start(code);\n }\n\n /** @type {State} */\n function checkNewContainers(code) {\n // Next, after consuming the continuation markers for existing blocks, we\n // look for new block starts (e.g. `>` for a block quote).\n // If we encounter a new block start, we close any blocks unmatched in\n // step 1 before creating the new block as a child of the last matched\n // block.\n if (continued === stack.length) {\n // No need to `check` whether there’s a container, of `exitContainers`\n // would be moot.\n // We can instead immediately `attempt` to parse one.\n if (!childFlow) {\n return documentContinued(code);\n }\n\n // If we have concrete content, such as block HTML or fenced code,\n // we can’t have containers “pierce” into them, so we can immediately\n // start.\n if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {\n return flowStart(code);\n }\n\n // If we do have flow, it could still be a blank line,\n // but we’d be interrupting it w/ a new container if there’s a current\n // construct.\n // To do: next major: remove `_gfmTableDynamicInterruptHack` (no longer\n // needed in micromark-extension-gfm-table@1.0.6).\n self.interrupt = Boolean(childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack);\n }\n\n // Check if there is a new container.\n self.containerState = {};\n return effects.check(containerConstruct, thereIsANewContainer, thereIsNoNewContainer)(code);\n }\n\n /** @type {State} */\n function thereIsANewContainer(code) {\n if (childFlow) {\n closeFlow();\n }\n exitContainers(continued);\n return documentContinued(code);\n }\n\n /** @type {State} */\n function thereIsNoNewContainer(code) {\n self.parser.lazy[self.now().line] = continued !== stack.length;\n lineStartOffset = self.now().offset;\n return flowStart(code);\n }\n\n /** @type {State} */\n function documentContinued(code) {\n // Try new containers.\n self.containerState = {};\n return effects.attempt(containerConstruct, containerContinue, flowStart)(code);\n }\n\n /** @type {State} */\n function containerContinue(code) {\n continued++;\n stack.push([self.currentConstruct, self.containerState]);\n // Try another.\n return documentContinued(code);\n }\n\n /** @type {State} */\n function flowStart(code) {\n if (code === null) {\n if (childFlow) {\n closeFlow();\n }\n exitContainers(0);\n effects.consume(code);\n return;\n }\n childFlow = childFlow || self.parser.flow(self.now());\n effects.enter(\"chunkFlow\", {\n _tokenizer: childFlow,\n contentType: \"flow\",\n previous: childToken\n });\n return flowContinue(code);\n }\n\n /** @type {State} */\n function flowContinue(code) {\n if (code === null) {\n writeToChild(effects.exit(\"chunkFlow\"), true);\n exitContainers(0);\n effects.consume(code);\n return;\n }\n if (markdownLineEnding(code)) {\n effects.consume(code);\n writeToChild(effects.exit(\"chunkFlow\"));\n // Get ready for the next line.\n continued = 0;\n self.interrupt = undefined;\n return start;\n }\n effects.consume(code);\n return flowContinue;\n }\n\n /**\n * @param {Token} token\n * Token.\n * @param {boolean | undefined} [endOfFile]\n * Whether the token is at the end of the file (default: `false`).\n * @returns {undefined}\n * Nothing.\n */\n function writeToChild(token, endOfFile) {\n const stream = self.sliceStream(token);\n if (endOfFile) {\n stream.push(null);\n }\n token.previous = childToken;\n if (childToken) {\n childToken.next = token;\n }\n childToken = token;\n childFlow.defineSkip(token.start);\n childFlow.write(stream);\n\n // Alright, so we just added a lazy line:\n //\n // ```markdown\n // > a\n // b.\n //\n // Or:\n //\n // > ~~~c\n // d\n //\n // Or:\n //\n // > | e |\n // f\n // ```\n //\n // The construct in the second example (fenced code) does not accept lazy\n // lines, so it marked itself as done at the end of its first line, and\n // then the content construct parses `d`.\n // Most constructs in markdown match on the first line: if the first line\n // forms a construct, a non-lazy line can’t “unmake” it.\n //\n // The construct in the third example is potentially a GFM table, and\n // those are *weird*.\n // It *could* be a table, from the first line, if the following line\n // matches a condition.\n // In this case, that second line is lazy, which “unmakes” the first line\n // and turns the whole into one content block.\n //\n // We’ve now parsed the non-lazy and the lazy line, and can figure out\n // whether the lazy line started a new flow block.\n // If it did, we exit the current containers between the two flow blocks.\n if (self.parser.lazy[token.start.line]) {\n let index = childFlow.events.length;\n while (index--) {\n if (\n // The token starts before the line ending…\n childFlow.events[index][1].start.offset < lineStartOffset && (\n // …and either is not ended yet…\n !childFlow.events[index][1].end ||\n // …or ends after it.\n childFlow.events[index][1].end.offset > lineStartOffset)) {\n // Exit: there’s still something open, which means it’s a lazy line\n // part of something.\n return;\n }\n }\n\n // Note: this algorithm for moving events around is similar to the\n // algorithm when closing flow in `documentContinue`.\n const indexBeforeExits = self.events.length;\n let indexBeforeFlow = indexBeforeExits;\n /** @type {boolean | undefined} */\n let seen;\n /** @type {Point | undefined} */\n let point;\n\n // Find the previous chunk (the one before the lazy line).\n while (indexBeforeFlow--) {\n if (self.events[indexBeforeFlow][0] === 'exit' && self.events[indexBeforeFlow][1].type === \"chunkFlow\") {\n if (seen) {\n point = self.events[indexBeforeFlow][1].end;\n break;\n }\n seen = true;\n }\n }\n exitContainers(continued);\n\n // Fix positions.\n index = indexBeforeExits;\n while (index < self.events.length) {\n self.events[index][1].end = {\n ...point\n };\n index++;\n }\n const editMap = new EditMap();\n // Inject the exits earlier (they’re still also at the end).\n editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));\n // Discard the duplicate exits.\n editMap.add(indexBeforeExits, index - indexBeforeExits, []);\n editMap.consume(self.events);\n }\n }\n\n /**\n * @param {number} size\n * Size.\n * @returns {undefined}\n * Nothing.\n */\n function exitContainers(size) {\n let index = stack.length;\n\n // Exit open containers.\n while (index-- > size) {\n const entry = stack[index];\n self.containerState = entry[1];\n entry[0].exit.call(self, effects);\n }\n stack.length = size;\n }\n function closeFlow() {\n childFlow.write([null]);\n childToken = undefined;\n childFlow = undefined;\n self.containerState._closeFlow = undefined;\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n * Tokenizer.\n */\nfunction tokenizeContainer(effects, ok, nok) {\n // Always populated by defaults.\n\n return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok, nok), \"linePrefix\", this.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4);\n}","/**\n * @import {Code} from 'micromark-util-types'\n */\n\nimport { markdownLineEndingOrSpace, unicodePunctuation, unicodeWhitespace } from 'micromark-util-character';\n/**\n * Classify whether a code represents whitespace, punctuation, or something\n * else.\n *\n * Used for attention (emphasis, strong), whose sequences can open or close\n * based on the class of surrounding characters.\n *\n * > 👉 **Note**: eof (`null`) is seen as whitespace.\n *\n * @param {Code} code\n * Code.\n * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}\n * Group.\n */\nexport function classifyCharacter(code) {\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return 1;\n }\n if (unicodePunctuation(code)) {\n return 2;\n }\n}","/**\n * @import {Event, Resolver, TokenizeContext} from 'micromark-util-types'\n */\n\n/**\n * Call all `resolveAll`s.\n *\n * @param {ReadonlyArray<{resolveAll?: Resolver | undefined}>} constructs\n * List of constructs, optionally with `resolveAll`s.\n * @param {Array<Event>} events\n * List of events.\n * @param {TokenizeContext} context\n * Context used by `tokenize`.\n * @returns {Array<Event>}\n * Changed events.\n */\nexport function resolveAll(constructs, events, context) {\n /** @type {Array<Resolver>} */\n const called = []\n let index = -1\n\n while (++index < constructs.length) {\n const resolve = constructs[index].resolveAll\n\n if (resolve && !called.includes(resolve)) {\n events = resolve(events, context)\n called.push(resolve)\n }\n }\n\n return events\n}\n","/**\n * @import {\n * Code,\n * Construct,\n * Event,\n * Point,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { push, splice } from 'micromark-util-chunked';\nimport { classifyCharacter } from 'micromark-util-classify-character';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const attention = {\n name: 'attention',\n resolveAll: resolveAllAttention,\n tokenize: tokenizeAttention\n};\n\n/**\n * Take all events and resolve attention to emphasis or strong.\n *\n * @type {Resolver}\n */\n// eslint-disable-next-line complexity\nfunction resolveAllAttention(events, context) {\n let index = -1;\n /** @type {Array<Event>} */\n let nextEvents;\n\n // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n while (++index < events.length) {\n // Find a token that can close.\n if (events[index][0] === 'enter' && events[index][1].type === 'attentionSequence' && events[index][1]._close) {\n let open = index;\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (events[open][0] === 'exit' && events[open][1].type === 'attentionSequence' && events[open][1]._open &&\n // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0)) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if ((events[open][1]._close || events[index][1]._open) && (events[index][1].end.offset - events[index][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index][1].end.offset - events[index][1].start.offset) % 3)) {\n continue;\n }\n\n // Number of markers to use from the sequence.\n const use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;\n const start = {\n ...events[open][1].end\n };\n const end = {\n ...events[index][1].start\n };\n movePoint(start, -use);\n movePoint(end, use);\n const openingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start,\n end: {\n ...events[open][1].end\n }\n };\n const closingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start: {\n ...events[index][1].start\n },\n end\n };\n const text = {\n type: use > 1 ? \"strongText\" : \"emphasisText\",\n start: {\n ...events[open][1].end\n },\n end: {\n ...events[index][1].start\n }\n };\n const group = {\n type: use > 1 ? \"strong\" : \"emphasis\",\n start: {\n ...openingSequence.start\n },\n end: {\n ...closingSequence.end\n }\n };\n events[open][1].end = {\n ...openingSequence.start\n };\n events[index][1].start = {\n ...closingSequence.end\n };\n nextEvents = [];\n\n // If there are more markers in the opening, add them before.\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [['enter', events[open][1], context], ['exit', events[open][1], context]]);\n }\n\n // Opening.\n nextEvents = push(nextEvents, [['enter', group, context], ['enter', openingSequence, context], ['exit', openingSequence, context], ['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n nextEvents = push(nextEvents, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + 1, index), context));\n\n // Closing.\n nextEvents = push(nextEvents, [['exit', text, context], ['enter', closingSequence, context], ['exit', closingSequence, context], ['exit', group, context]]);\n\n /** @type {number} */\n let offset = 0;\n\n // If there are more markers in the closing, add them after.\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2;\n nextEvents = push(nextEvents, [['enter', events[index][1], context], ['exit', events[index][1], context]]);\n }\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - offset - 2;\n break;\n }\n }\n }\n }\n\n // Remove remaining sequences.\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data';\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeAttention(effects, ok) {\n const attentionMarkers = this.parser.constructs.attentionMarkers.null;\n const previous = this.previous;\n const before = classifyCharacter(previous);\n\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Before a sequence.\n *\n * ```markdown\n * > | **\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n marker = code;\n effects.enter('attentionSequence');\n return inside(code);\n }\n\n /**\n * In a sequence.\n *\n * ```markdown\n * > | **\n * ^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n const token = effects.exit('attentionSequence');\n\n // To do: next major: move this to resolver, just like `markdown-rs`.\n const after = classifyCharacter(code);\n\n // Always populated by defaults.\n\n // Note: `*` and `_` are in `attentionMarkers` through core.\n // They are excluded here as the loosening is meant for markers registered\n // by *other* constructs (such as GFM strikethrough’s `~`).\n const open = !after || after === 2 && before || attentionMarkers.includes(code) && code !== 42 && code !== 95;\n const close = !before || before === 2 && after || attentionMarkers.includes(previous) && previous !== 42 && previous !== 95;\n token._open = Boolean(marker === 42 ? open : open && (before || !close));\n token._close = Boolean(marker === 42 ? close : close && (after || !open));\n return ok(code);\n }\n}\n\n/**\n * Move a point a bit.\n *\n * Note: `move` only works inside lines! It’s not possible to move past other\n * chunks (replacement characters, tabs, or line endings).\n *\n * @param {Point} point\n * Point.\n * @param {number} offset\n * Amount to move.\n * @returns {undefined}\n * Nothing.\n */\nfunction movePoint(point, offset) {\n point.column += offset;\n point.offset += offset;\n point._bufferIndex += offset;\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { asciiAlphanumeric, asciiAlpha, asciiAtext, asciiControl } from 'micromark-util-character';\n/** @type {Construct} */\nexport const autolink = {\n name: 'autolink',\n tokenize: tokenizeAutolink\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeAutolink(effects, ok, nok) {\n let size = 0;\n return start;\n\n /**\n * Start of an autolink.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"autolink\");\n effects.enter(\"autolinkMarker\");\n effects.consume(code);\n effects.exit(\"autolinkMarker\");\n effects.enter(\"autolinkProtocol\");\n return open;\n }\n\n /**\n * After `<`, at protocol or atext.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (asciiAlpha(code)) {\n effects.consume(code);\n return schemeOrEmailAtext;\n }\n if (code === 64) {\n return nok(code);\n }\n return emailAtext(code);\n }\n\n /**\n * At second byte of protocol or atext.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeOrEmailAtext(code) {\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) {\n // Count the previous alphabetical from `open` too.\n size = 1;\n return schemeInsideOrEmailAtext(code);\n }\n return emailAtext(code);\n }\n\n /**\n * In ambiguous protocol or atext.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeInsideOrEmailAtext(code) {\n if (code === 58) {\n effects.consume(code);\n size = 0;\n return urlInside;\n }\n\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if ((code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) && size++ < 32) {\n effects.consume(code);\n return schemeInsideOrEmailAtext;\n }\n size = 0;\n return emailAtext(code);\n }\n\n /**\n * After protocol, in URL.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function urlInside(code) {\n if (code === 62) {\n effects.exit(\"autolinkProtocol\");\n effects.enter(\"autolinkMarker\");\n effects.consume(code);\n effects.exit(\"autolinkMarker\");\n effects.exit(\"autolink\");\n return ok;\n }\n\n // ASCII control, space, or `<`.\n if (code === null || code === 32 || code === 60 || asciiControl(code)) {\n return nok(code);\n }\n effects.consume(code);\n return urlInside;\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | a<user.name@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailAtext(code) {\n if (code === 64) {\n effects.consume(code);\n return emailAtSignOrDot;\n }\n if (asciiAtext(code)) {\n effects.consume(code);\n return emailAtext;\n }\n return nok(code);\n }\n\n /**\n * In label, after at-sign or dot.\n *\n * ```markdown\n * > | a<user.name@example.com>b\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function emailAtSignOrDot(code) {\n return asciiAlphanumeric(code) ? emailLabel(code) : nok(code);\n }\n\n /**\n * In label, where `.` and `>` are allowed.\n *\n * ```markdown\n * > | a<user.name@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailLabel(code) {\n if (code === 46) {\n effects.consume(code);\n size = 0;\n return emailAtSignOrDot;\n }\n if (code === 62) {\n // Exit, then change the token type.\n effects.exit(\"autolinkProtocol\").type = \"autolinkEmail\";\n effects.enter(\"autolinkMarker\");\n effects.consume(code);\n effects.exit(\"autolinkMarker\");\n effects.exit(\"autolink\");\n return ok;\n }\n return emailValue(code);\n }\n\n /**\n * In label, where `.` and `>` are *not* allowed.\n *\n * Though, this is also used in `emailLabel` to parse other values.\n *\n * ```markdown\n * > | a<user.name@ex-ample.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailValue(code) {\n // ASCII alphanumeric or `-`.\n if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) {\n const next = code === 45 ? emailValue : emailLabel;\n effects.consume(code);\n return next;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const blankLine = {\n partial: true,\n tokenize: tokenizeBlankLine\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLine(effects, ok, nok) {\n return start;\n\n /**\n * Start of blank line.\n *\n * > 👉 **Note**: `␠` represents a space character.\n *\n * ```markdown\n * > | ␠␠␊\n * ^\n * > | ␊\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n return markdownSpace(code) ? factorySpace(effects, after, \"linePrefix\")(code) : after(code);\n }\n\n /**\n * At eof/eol, after optional whitespace.\n *\n * > 👉 **Note**: `␠` represents a space character.\n *\n * ```markdown\n * > | ␠␠␊\n * ^\n * > | ␊\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * Exiter,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const blockQuote = {\n continuation: {\n tokenize: tokenizeBlockQuoteContinuation\n },\n exit,\n name: 'blockQuote',\n tokenize: tokenizeBlockQuoteStart\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlockQuoteStart(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * Start of block quote.\n *\n * ```markdown\n * > | > a\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 62) {\n const state = self.containerState;\n if (!state.open) {\n effects.enter(\"blockQuote\", {\n _container: true\n });\n state.open = true;\n }\n effects.enter(\"blockQuotePrefix\");\n effects.enter(\"blockQuoteMarker\");\n effects.consume(code);\n effects.exit(\"blockQuoteMarker\");\n return after;\n }\n return nok(code);\n }\n\n /**\n * After `>`, before optional whitespace.\n *\n * ```markdown\n * > | > a\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (markdownSpace(code)) {\n effects.enter(\"blockQuotePrefixWhitespace\");\n effects.consume(code);\n effects.exit(\"blockQuotePrefixWhitespace\");\n effects.exit(\"blockQuotePrefix\");\n return ok;\n }\n effects.exit(\"blockQuotePrefix\");\n return ok(code);\n }\n}\n\n/**\n * Start of block quote continuation.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlockQuoteContinuation(effects, ok, nok) {\n const self = this;\n return contStart;\n\n /**\n * Start of block quote continuation.\n *\n * Also used to parse the first block quote opening.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @type {State}\n */\n function contStart(code) {\n if (markdownSpace(code)) {\n // Always populated by defaults.\n\n return factorySpace(effects, contBefore, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n return contBefore(code);\n }\n\n /**\n * At `>`, after optional whitespace.\n *\n * Also used to parse the first block quote opening.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @type {State}\n */\n function contBefore(code) {\n return effects.attempt(blockQuote, ok, nok)(code);\n }\n}\n\n/** @type {Exiter} */\nfunction exit(effects) {\n effects.exit(\"blockQuote\");\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { asciiPunctuation } from 'micromark-util-character';\n/** @type {Construct} */\nexport const characterEscape = {\n name: 'characterEscape',\n tokenize: tokenizeCharacterEscape\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterEscape(effects, ok, nok) {\n return start;\n\n /**\n * Start of character escape.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"characterEscape\");\n effects.enter(\"escapeMarker\");\n effects.consume(code);\n effects.exit(\"escapeMarker\");\n return inside;\n }\n\n /**\n * After `\\`, at punctuation.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // ASCII punctuation.\n if (asciiPunctuation(code)) {\n effects.enter(\"characterEscapeValue\");\n effects.consume(code);\n effects.exit(\"characterEscapeValue\");\n effects.exit(\"characterEscape\");\n return ok;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { asciiAlphanumeric, asciiDigit, asciiHexDigit } from 'micromark-util-character';\n/** @type {Construct} */\nexport const characterReference = {\n name: 'characterReference',\n tokenize: tokenizeCharacterReference\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterReference(effects, ok, nok) {\n const self = this;\n let size = 0;\n /** @type {number} */\n let max;\n /** @type {(code: Code) => boolean} */\n let test;\n return start;\n\n /**\n * Start of character reference.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a	b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"characterReference\");\n effects.enter(\"characterReferenceMarker\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarker\");\n return open;\n }\n\n /**\n * After `&`, at `#` for numeric references or alphanumeric for named\n * references.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a	b\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 35) {\n effects.enter(\"characterReferenceMarkerNumeric\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarkerNumeric\");\n return numeric;\n }\n effects.enter(\"characterReferenceValue\");\n max = 31;\n test = asciiAlphanumeric;\n return value(code);\n }\n\n /**\n * After `#`, at `x` for hexadecimals or digit for decimals.\n *\n * ```markdown\n * > | a{b\n * ^\n * > | a	b\n * ^\n * ```\n *\n * @type {State}\n */\n function numeric(code) {\n if (code === 88 || code === 120) {\n effects.enter(\"characterReferenceMarkerHexadecimal\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarkerHexadecimal\");\n effects.enter(\"characterReferenceValue\");\n max = 6;\n test = asciiHexDigit;\n return value;\n }\n effects.enter(\"characterReferenceValue\");\n max = 7;\n test = asciiDigit;\n return value(code);\n }\n\n /**\n * After markers (`&#x`, `&#`, or `&`), in value, before `;`.\n *\n * The character reference kind defines what and how many characters are\n * allowed.\n *\n * ```markdown\n * > | a&b\n * ^^^\n * > | a{b\n * ^^^\n * > | a	b\n * ^\n * ```\n *\n * @type {State}\n */\n function value(code) {\n if (code === 59 && size) {\n const token = effects.exit(\"characterReferenceValue\");\n if (test === asciiAlphanumeric && !decodeNamedCharacterReference(self.sliceSerialize(token))) {\n return nok(code);\n }\n\n // To do: `markdown-rs` uses a different name:\n // `CharacterReferenceMarkerSemi`.\n effects.enter(\"characterReferenceMarker\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarker\");\n effects.exit(\"characterReference\");\n return ok;\n }\n if (test(code) && size++ < max) {\n effects.consume(code);\n return value;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const nonLazyContinuation = {\n partial: true,\n tokenize: tokenizeNonLazyContinuation\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuation(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * At eol, before continuation.\n *\n * ```markdown\n * > | * ```js\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === null) {\n return nok(code);\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return after;\n }\n\n /**\n * A continuation.\n *\n * ```markdown\n * | * ```js\n * > | b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { nonLazyContinuation } from './partial-non-lazy-continuation.js';\n\n/** @type {Construct} */\nexport const codeFenced = {\n concrete: true,\n name: 'codeFenced',\n tokenize: tokenizeCodeFenced\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeFenced(effects, ok, nok) {\n const self = this;\n /** @type {Construct} */\n const closeStart = {\n partial: true,\n tokenize: tokenizeCloseStart\n };\n let initialPrefix = 0;\n let sizeOpen = 0;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of code.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse whitespace like `markdown-rs`.\n return beforeSequenceOpen(code);\n }\n\n /**\n * In opening fence, after prefix, at sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeSequenceOpen(code) {\n const tail = self.events[self.events.length - 1];\n initialPrefix = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n marker = code;\n effects.enter(\"codeFenced\");\n effects.enter(\"codeFencedFence\");\n effects.enter(\"codeFencedFenceSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening fence sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === marker) {\n sizeOpen++;\n effects.consume(code);\n return sequenceOpen;\n }\n if (sizeOpen < 3) {\n return nok(code);\n }\n effects.exit(\"codeFencedFenceSequence\");\n return markdownSpace(code) ? factorySpace(effects, infoBefore, \"whitespace\")(code) : infoBefore(code);\n }\n\n /**\n * In opening fence, after the sequence (and optional whitespace), before info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function infoBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFencedFence\");\n return self.interrupt ? ok(code) : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code);\n }\n effects.enter(\"codeFencedFenceInfo\");\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return info(code);\n }\n\n /**\n * In info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function info(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceInfo\");\n return infoBefore(code);\n }\n if (markdownSpace(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceInfo\");\n return factorySpace(effects, metaBefore, \"whitespace\")(code);\n }\n if (code === 96 && code === marker) {\n return nok(code);\n }\n effects.consume(code);\n return info;\n }\n\n /**\n * In opening fence, after info and whitespace, before meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function metaBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return infoBefore(code);\n }\n effects.enter(\"codeFencedFenceMeta\");\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return meta(code);\n }\n\n /**\n * In meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceMeta\");\n return infoBefore(code);\n }\n if (code === 96 && code === marker) {\n return nok(code);\n }\n effects.consume(code);\n return meta;\n }\n\n /**\n * At eol/eof in code, before a non-lazy closing fence or content.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function atNonLazyBreak(code) {\n return effects.attempt(closeStart, after, contentBefore)(code);\n }\n\n /**\n * Before code content, not a closing fence, at eol.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentBefore(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return contentStart;\n }\n\n /**\n * Before code content, not a closing fence.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentStart(code) {\n return initialPrefix > 0 && markdownSpace(code) ? factorySpace(effects, beforeContentChunk, \"linePrefix\", initialPrefix + 1)(code) : beforeContentChunk(code);\n }\n\n /**\n * Before code content, after optional prefix.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeContentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code);\n }\n effects.enter(\"codeFlowValue\");\n return contentChunk(code);\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^^^^^^^^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFlowValue\");\n return beforeContentChunk(code);\n }\n effects.consume(code);\n return contentChunk;\n }\n\n /**\n * After code.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n effects.exit(\"codeFenced\");\n return ok(code);\n }\n\n /**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\n function tokenizeCloseStart(effects, ok, nok) {\n let size = 0;\n return startBefore;\n\n /**\n *\n *\n * @type {State}\n */\n function startBefore(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return start;\n }\n\n /**\n * Before closing fence, at optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Always populated by defaults.\n\n // To do: `enter` here or in next state?\n effects.enter(\"codeFencedFence\");\n return markdownSpace(code) ? factorySpace(effects, beforeSequenceClose, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code) : beforeSequenceClose(code);\n }\n\n /**\n * In closing fence, after optional whitespace, at sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeSequenceClose(code) {\n if (code === marker) {\n effects.enter(\"codeFencedFenceSequence\");\n return sequenceClose(code);\n }\n return nok(code);\n }\n\n /**\n * In closing fence sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n if (code === marker) {\n size++;\n effects.consume(code);\n return sequenceClose;\n }\n if (size >= sizeOpen) {\n effects.exit(\"codeFencedFenceSequence\");\n return markdownSpace(code) ? factorySpace(effects, sequenceCloseAfter, \"whitespace\")(code) : sequenceCloseAfter(code);\n }\n return nok(code);\n }\n\n /**\n * After closing fence sequence, after optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceCloseAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFencedFence\");\n return ok(code);\n }\n return nok(code);\n }\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpaceMinMax } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const codeIndented = {\n name: 'codeIndented',\n tokenize: tokenizeCodeIndented\n};\n\n/** @type {Construct} */\nconst furtherStart = {\n partial: true,\n tokenize: tokenizeFurtherStart\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeIndented(effects, ok, nok) {\n return start;\n\n /**\n * Start of code (indented).\n *\n * > **Parsing note**: it is not needed to check if this first line is a\n * > filled line (that it has a non-whitespace character), because blank lines\n * > are parsed already, so we never run into that.\n *\n * ```markdown\n * > | aaa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: manually check if interrupting like `markdown-rs`.\n\n effects.enter(\"codeIndented\");\n return factorySpaceMinMax(effects, atBreak, nok, \"linePrefix\", 4, 4)(code);\n }\n\n /**\n * At a break.\n *\n * ```markdown\n * > | aaa\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === null) {\n return after(code);\n }\n if (markdownLineEnding(code)) {\n return effects.attempt(furtherStart, atBreak, after)(code);\n }\n effects.enter(\"codeFlowValue\");\n return inside(code);\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * > | aaa\n * ^^^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFlowValue\");\n return atBreak(code);\n }\n effects.consume(code);\n return inside;\n }\n\n /** @type {State} */\n function after(code) {\n effects.exit(\"codeIndented\");\n // To do: allow interrupting like `markdown-rs`.\n // Feel free to interrupt.\n // tokenizer.interrupt = false\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeFurtherStart(effects, ok, nok) {\n const self = this;\n return furtherStart;\n\n /**\n * At eol, trying to parse another indent.\n *\n * ```markdown\n * > | aaa\n * ^\n * | bbb\n * ```\n *\n * @type {State}\n */\n function furtherStart(code) {\n // To do: improve `lazy` / `pierce` handling.\n // If this is a lazy line, it can’t be code.\n if (self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return furtherStart;\n }\n\n // To do: the code here in `micromark-js` is a bit different from\n // `markdown-rs` because there it can attempt spaces.\n // We can’t yet.\n return factorySpaceMinMax(effects, ok, onNotEnoughPrefix, \"linePrefix\", 4, 4)(code);\n }\n\n /**\n * After not enough of a prefix.\n *\n * A following line ending is another (potentially blank) line to try,\n * anything else means this isn’t a continuation.\n *\n * ```markdown\n * > | aaa\n *\n * | bbb\n * ```\n *\n * @type {State}\n */\n function onNotEnoughPrefix(code) {\n return markdownLineEnding(code) ? furtherStart(code) : nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * Previous,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const codeText = {\n name: 'codeText',\n previous,\n resolve: resolveCodeText,\n tokenize: tokenizeCodeText\n};\n\n// To do: next major: don’t resolve, like `markdown-rs`.\n/** @type {Resolver} */\nfunction resolveCodeText(events) {\n let tailExitIndex = events.length - 4;\n let headEnterIndex = 3;\n /** @type {number} */\n let index;\n /** @type {number | undefined} */\n let enter;\n\n // If we start and end with an EOL or a space.\n if ((events[headEnterIndex][1].type === \"lineEnding\" || events[headEnterIndex][1].type === 'space') && (events[tailExitIndex][1].type === \"lineEnding\" || events[tailExitIndex][1].type === 'space')) {\n index = headEnterIndex;\n\n // And we have data.\n while (++index < tailExitIndex) {\n if (events[index][1].type === \"codeTextData\") {\n // Then we have padding.\n events[headEnterIndex][1].type = \"codeTextPadding\";\n events[tailExitIndex][1].type = \"codeTextPadding\";\n headEnterIndex += 2;\n tailExitIndex -= 2;\n break;\n }\n }\n }\n\n // Merge adjacent spaces and data.\n index = headEnterIndex - 1;\n tailExitIndex++;\n while (++index <= tailExitIndex) {\n if (enter === undefined) {\n if (index !== tailExitIndex && events[index][1].type !== \"lineEnding\") {\n enter = index;\n }\n } else if (index === tailExitIndex || events[index][1].type === \"lineEnding\") {\n events[enter][1].type = \"codeTextData\";\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n tailExitIndex -= index - enter - 2;\n index = enter + 2;\n }\n enter = undefined;\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Previous}\n */\nfunction previous(code) {\n // If there is a previous code, there will always be a tail.\n return code !== 96 || this.events[this.events.length - 1][1].type === \"characterEscape\";\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeText(effects, ok, nok) {\n const self = this;\n let sizeOpen = 0;\n /** @type {number} */\n let size;\n /** @type {Token} */\n let token;\n return start;\n\n /**\n * Start of code (text).\n *\n * ```markdown\n * > | `a`\n * ^\n * > | \\`a`\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"codeText\");\n effects.enter(\"codeTextSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 96) {\n effects.consume(code);\n sizeOpen++;\n return sequenceOpen;\n }\n effects.exit(\"codeTextSequence\");\n return between(code);\n }\n\n /**\n * Between something and something else.\n *\n * ```markdown\n * > | `a`\n * ^^\n * ```\n *\n * @type {State}\n */\n function between(code) {\n // EOF.\n if (code === null) {\n return nok(code);\n }\n\n // To do: next major: don’t do spaces in resolve, but when compiling,\n // like `markdown-rs`.\n // Tabs don’t work, and virtual spaces don’t make sense.\n if (code === 32) {\n effects.enter('space');\n effects.consume(code);\n effects.exit('space');\n return between;\n }\n\n // Closing fence? Could also be data.\n if (code === 96) {\n token = effects.enter(\"codeTextSequence\");\n size = 0;\n return sequenceClose(code);\n }\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return between;\n }\n\n // Data.\n effects.enter(\"codeTextData\");\n return data(code);\n }\n\n /**\n * In data.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (code === null || code === 32 || code === 96 || markdownLineEnding(code)) {\n effects.exit(\"codeTextData\");\n return between(code);\n }\n effects.consume(code);\n return data;\n }\n\n /**\n * In closing sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n // More.\n if (code === 96) {\n effects.consume(code);\n size++;\n return sequenceClose;\n }\n\n // Done!\n if (size === sizeOpen) {\n effects.exit(\"codeTextSequence\");\n effects.exit(\"codeText\");\n return ok(code);\n }\n\n // More or less accents: mark as data.\n token.type = \"codeTextData\";\n return data(code);\n }\n}","/**\n * Some of the internal operations of micromark do lots of editing\n * operations on very large arrays. This runs into problems with two\n * properties of most circa-2020 JavaScript interpreters:\n *\n * - Array-length modifications at the high end of an array (push/pop) are\n * expected to be common and are implemented in (amortized) time\n * proportional to the number of elements added or removed, whereas\n * other operations (shift/unshift and splice) are much less efficient.\n * - Function arguments are passed on the stack, so adding tens of thousands\n * of elements to an array with `arr.push(...newElements)` will frequently\n * cause stack overflows. (see <https://stackoverflow.com/questions/22123769/rangeerror-maximum-call-stack-size-exceeded-why>)\n *\n * SpliceBuffers are an implementation of gap buffers, which are a\n * generalization of the \"queue made of two stacks\" idea. The splice buffer\n * maintains a cursor, and moving the cursor has cost proportional to the\n * distance the cursor moves, but inserting, deleting, or splicing in\n * new information at the cursor is as efficient as the push/pop operation.\n * This allows for an efficient sequence of splices (or pushes, pops, shifts,\n * or unshifts) as long such edits happen at the same part of the array or\n * generally sweep through the array from the beginning to the end.\n *\n * The interface for splice buffers also supports large numbers of inputs by\n * passing a single array argument rather passing multiple arguments on the\n * function call stack.\n *\n * @template T\n * Item type.\n */\nexport class SpliceBuffer {\n /**\n * @param {ReadonlyArray<T> | null | undefined} [initial]\n * Initial items (optional).\n * @returns\n * Splice buffer.\n */\n constructor(initial) {\n /** @type {Array<T>} */\n this.left = initial ? [...initial] : [];\n /** @type {Array<T>} */\n this.right = [];\n }\n\n /**\n * Array access;\n * does not move the cursor.\n *\n * @param {number} index\n * Index.\n * @return {T}\n * Item.\n */\n get(index) {\n if (index < 0 || index >= this.left.length + this.right.length) {\n throw new RangeError('Cannot access index `' + index + '` in a splice buffer of size `' + (this.left.length + this.right.length) + '`');\n }\n if (index < this.left.length) return this.left[index];\n return this.right[this.right.length - index + this.left.length - 1];\n }\n\n /**\n * The length of the splice buffer, one greater than the largest index in the\n * array.\n */\n get length() {\n return this.left.length + this.right.length;\n }\n\n /**\n * Remove and return `list[0]`;\n * moves the cursor to `0`.\n *\n * @returns {T | undefined}\n * Item, optional.\n */\n shift() {\n this.setCursor(0);\n return this.right.pop();\n }\n\n /**\n * Slice the buffer to get an array;\n * does not move the cursor.\n *\n * @param {number} start\n * Start.\n * @param {number | null | undefined} [end]\n * End (optional).\n * @returns {Array<T>}\n * Array of items.\n */\n slice(start, end) {\n /** @type {number} */\n const stop = end === null || end === undefined ? Number.POSITIVE_INFINITY : end;\n if (stop < this.left.length) {\n return this.left.slice(start, stop);\n }\n if (start > this.left.length) {\n return this.right.slice(this.right.length - stop + this.left.length, this.right.length - start + this.left.length).reverse();\n }\n return this.left.slice(start).concat(this.right.slice(this.right.length - stop + this.left.length).reverse());\n }\n\n /**\n * Mimics the behavior of Array.prototype.splice() except for the change of\n * interface necessary to avoid segfaults when patching in very large arrays.\n *\n * This operation moves cursor is moved to `start` and results in the cursor\n * placed after any inserted items.\n *\n * @param {number} start\n * Start;\n * zero-based index at which to start changing the array;\n * negative numbers count backwards from the end of the array and values\n * that are out-of bounds are clamped to the appropriate end of the array.\n * @param {number | null | undefined} [deleteCount=0]\n * Delete count (default: `0`);\n * maximum number of elements to delete, starting from start.\n * @param {Array<T> | null | undefined} [items=[]]\n * Items to include in place of the deleted items (default: `[]`).\n * @return {Array<T>}\n * Any removed items.\n */\n splice(start, deleteCount, items) {\n /** @type {number} */\n const count = deleteCount || 0;\n this.setCursor(Math.trunc(start));\n const removed = this.right.splice(this.right.length - count, Number.POSITIVE_INFINITY);\n if (items) chunkedPush(this.left, items);\n return removed.reverse();\n }\n\n /**\n * Remove and return the highest-numbered item in the array, so\n * `list[list.length - 1]`;\n * Moves the cursor to `length`.\n *\n * @returns {T | undefined}\n * Item, optional.\n */\n pop() {\n this.setCursor(Number.POSITIVE_INFINITY);\n return this.left.pop();\n }\n\n /**\n * Inserts a single item to the high-numbered side of the array;\n * moves the cursor to `length`.\n *\n * @param {T} item\n * Item.\n * @returns {undefined}\n * Nothing.\n */\n push(item) {\n this.setCursor(Number.POSITIVE_INFINITY);\n this.left.push(item);\n }\n\n /**\n * Inserts many items to the high-numbered side of the array.\n * Moves the cursor to `length`.\n *\n * @param {Array<T>} items\n * Items.\n * @returns {undefined}\n * Nothing.\n */\n pushMany(items) {\n this.setCursor(Number.POSITIVE_INFINITY);\n chunkedPush(this.left, items);\n }\n\n /**\n * Inserts a single item to the low-numbered side of the array;\n * Moves the cursor to `0`.\n *\n * @param {T} item\n * Item.\n * @returns {undefined}\n * Nothing.\n */\n unshift(item) {\n this.setCursor(0);\n this.right.push(item);\n }\n\n /**\n * Inserts many items to the low-numbered side of the array;\n * moves the cursor to `0`.\n *\n * @param {Array<T>} items\n * Items.\n * @returns {undefined}\n * Nothing.\n */\n unshiftMany(items) {\n this.setCursor(0);\n chunkedPush(this.right, items.reverse());\n }\n\n /**\n * Move the cursor to a specific position in the array. Requires\n * time proportional to the distance moved.\n *\n * If `n < 0`, the cursor will end up at the beginning.\n * If `n > length`, the cursor will end up at the end.\n *\n * @param {number} n\n * Position.\n * @return {undefined}\n * Nothing.\n */\n setCursor(n) {\n if (n === this.left.length || n > this.left.length && this.right.length === 0 || n < 0 && this.left.length === 0) return;\n if (n < this.left.length) {\n // Move cursor to the this.left\n const removed = this.left.splice(n, Number.POSITIVE_INFINITY);\n chunkedPush(this.right, removed.reverse());\n } else {\n // Move cursor to the this.right\n const removed = this.right.splice(this.left.length + this.right.length - n, Number.POSITIVE_INFINITY);\n chunkedPush(this.left, removed.reverse());\n }\n }\n}\n\n/**\n * Avoid stack overflow by pushing items onto the stack in segments\n *\n * @template T\n * Item type.\n * @param {Array<T>} list\n * List to inject into.\n * @param {ReadonlyArray<T>} right\n * Items to inject.\n * @return {undefined}\n * Nothing.\n */\nfunction chunkedPush(list, right) {\n /** @type {number} */\n let chunkStart = 0;\n if (right.length < 10000) {\n list.push(...right);\n } else {\n while (chunkStart < right.length) {\n list.push(...right.slice(chunkStart, chunkStart + 10000));\n chunkStart += 10000;\n }\n }\n}","/**\n * @import {Chunk, Event, Token} from 'micromark-util-types'\n */\n\nimport { splice } from 'micromark-util-chunked';\nimport { SpliceBuffer } from './lib/splice-buffer.js';\n\n// Hidden API exposed for testing.\nexport { SpliceBuffer } from './lib/splice-buffer.js';\n\n/**\n * Tokenize subcontent.\n *\n * @param {Array<Event>} eventsArray\n * List of events.\n * @returns {boolean}\n * Whether subtokens were found.\n */\n// eslint-disable-next-line complexity\nexport function subtokenize(eventsArray) {\n /** @type {Record<string, number>} */\n const jumps = {};\n let index = -1;\n /** @type {Event} */\n let event;\n /** @type {number | undefined} */\n let lineIndex;\n /** @type {number} */\n let otherIndex;\n /** @type {Event} */\n let otherEvent;\n /** @type {Array<Event>} */\n let parameters;\n /** @type {Array<Event>} */\n let subevents;\n /** @type {boolean | undefined} */\n let more;\n const events = new SpliceBuffer(eventsArray);\n while (++index < events.length) {\n while (index in jumps) {\n index = jumps[index];\n }\n event = events.get(index);\n\n // Add a hook for the GFM tasklist extension, which needs to know if text\n // is in the first content of a list item.\n if (index && event[1].type === \"chunkFlow\" && events.get(index - 1)[1].type === \"listItemPrefix\") {\n subevents = event[1]._tokenizer.events;\n otherIndex = 0;\n if (otherIndex < subevents.length && subevents[otherIndex][1].type === \"lineEndingBlank\") {\n otherIndex += 2;\n }\n if (otherIndex < subevents.length && subevents[otherIndex][1].type === \"content\") {\n while (++otherIndex < subevents.length) {\n if (subevents[otherIndex][1].type === \"content\") {\n break;\n }\n if (subevents[otherIndex][1].type === \"chunkText\") {\n subevents[otherIndex][1]._isInFirstContentOfListItem = true;\n otherIndex++;\n }\n }\n }\n }\n\n // Enter.\n if (event[0] === 'enter') {\n if (event[1].contentType) {\n Object.assign(jumps, subcontent(events, index));\n index = jumps[index];\n more = true;\n }\n }\n // Exit.\n else if (event[1]._container) {\n otherIndex = index;\n lineIndex = undefined;\n while (otherIndex--) {\n otherEvent = events.get(otherIndex);\n if (otherEvent[1].type === \"lineEnding\" || otherEvent[1].type === \"lineEndingBlank\") {\n if (otherEvent[0] === 'enter') {\n if (lineIndex) {\n events.get(lineIndex)[1].type = \"lineEndingBlank\";\n }\n otherEvent[1].type = \"lineEnding\";\n lineIndex = otherIndex;\n }\n } else if (otherEvent[1].type === \"linePrefix\" || otherEvent[1].type === \"listItemIndent\") {\n // Move past.\n } else {\n break;\n }\n }\n if (lineIndex) {\n // Fix position.\n event[1].end = {\n ...events.get(lineIndex)[1].start\n };\n\n // Switch container exit w/ line endings.\n parameters = events.slice(lineIndex, index);\n parameters.unshift(event);\n events.splice(lineIndex, index - lineIndex + 1, parameters);\n }\n }\n }\n\n // The changes to the `events` buffer must be copied back into the eventsArray\n splice(eventsArray, 0, Number.POSITIVE_INFINITY, events.slice(0));\n return !more;\n}\n\n/**\n * Tokenize embedded tokens.\n *\n * @param {SpliceBuffer<Event>} events\n * Events.\n * @param {number} eventIndex\n * Index.\n * @returns {Record<string, number>}\n * Gaps.\n */\nfunction subcontent(events, eventIndex) {\n const token = events.get(eventIndex)[1];\n const context = events.get(eventIndex)[2];\n let startPosition = eventIndex - 1;\n /** @type {Array<number>} */\n const startPositions = [];\n let tokenizer = token._tokenizer;\n if (!tokenizer) {\n tokenizer = context.parser[token.contentType](token.start);\n if (token._contentTypeTextTrailing) {\n tokenizer._contentTypeTextTrailing = true;\n }\n }\n const childEvents = tokenizer.events;\n /** @type {Array<[number, number]>} */\n const jumps = [];\n /** @type {Record<string, number>} */\n const gaps = {};\n /** @type {Array<Chunk>} */\n let stream;\n /** @type {Token | undefined} */\n let previous;\n let index = -1;\n /** @type {Token | undefined} */\n let current = token;\n let adjust = 0;\n let start = 0;\n const breaks = [start];\n\n // Loop forward through the linked tokens to pass them in order to the\n // subtokenizer.\n while (current) {\n // Find the position of the event for this token.\n while (events.get(++startPosition)[1] !== current) {\n // Empty.\n }\n startPositions.push(startPosition);\n if (!current._tokenizer) {\n stream = context.sliceStream(current);\n if (!current.next) {\n stream.push(null);\n }\n if (previous) {\n tokenizer.defineSkip(current.start);\n }\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = true;\n }\n tokenizer.write(stream);\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = undefined;\n }\n }\n\n // Unravel the next token.\n previous = current;\n current = current.next;\n }\n\n // Now, loop back through all events (and linked tokens), to figure out which\n // parts belong where.\n current = token;\n while (++index < childEvents.length) {\n if (\n // Find a void token that includes a break.\n childEvents[index][0] === 'exit' && childEvents[index - 1][0] === 'enter' && childEvents[index][1].type === childEvents[index - 1][1].type && childEvents[index][1].start.line !== childEvents[index][1].end.line) {\n start = index + 1;\n breaks.push(start);\n // Help GC.\n current._tokenizer = undefined;\n current.previous = undefined;\n current = current.next;\n }\n }\n\n // Help GC.\n tokenizer.events = [];\n\n // If there’s one more token (which is the cases for lines that end in an\n // EOF), that’s perfect: the last point we found starts it.\n // If there isn’t then make sure any remaining content is added to it.\n if (current) {\n // Help GC.\n current._tokenizer = undefined;\n current.previous = undefined;\n } else {\n breaks.pop();\n }\n\n // Now splice the events from the subtokenizer into the current events,\n // moving back to front so that splice indices aren’t affected.\n index = breaks.length;\n while (index--) {\n const slice = childEvents.slice(breaks[index], breaks[index + 1]);\n const start = startPositions.pop();\n jumps.push([start, start + slice.length - 1]);\n events.splice(start, 2, slice);\n }\n jumps.reverse();\n index = -1;\n while (++index < jumps.length) {\n gaps[adjust + jumps[index][0]] = adjust + jumps[index][1];\n adjust += jumps[index][1] - jumps[index][0] - 1;\n }\n return gaps;\n}","/**\n * @import {\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { subtokenize } from 'micromark-util-subtokenize';\n/**\n * No name because it must not be turned off.\n * @type {Construct}\n */\nexport const content = {\n resolve: resolveContent,\n tokenize: tokenizeContent\n};\n\n/** @type {Construct} */\nconst continuationConstruct = {\n partial: true,\n tokenize: tokenizeContinuation\n};\n\n/**\n * Content is transparent: it’s parsed right now. That way, definitions are also\n * parsed right now: before text in paragraphs (specifically, media) are parsed.\n *\n * @type {Resolver}\n */\nfunction resolveContent(events) {\n subtokenize(events);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeContent(effects, ok) {\n /** @type {Token | undefined} */\n let previous;\n return chunkStart;\n\n /**\n * Before a content chunk.\n *\n * ```markdown\n * > | abc\n * ^\n * ```\n *\n * @type {State}\n */\n function chunkStart(code) {\n effects.enter(\"content\");\n previous = effects.enter(\"chunkContent\", {\n contentType: \"content\"\n });\n return chunkInside(code);\n }\n\n /**\n * In a content chunk.\n *\n * ```markdown\n * > | abc\n * ^^^\n * ```\n *\n * @type {State}\n */\n function chunkInside(code) {\n if (code === null) {\n return contentEnd(code);\n }\n\n // To do: in `markdown-rs`, each line is parsed on its own, and everything\n // is stitched together resolving.\n if (markdownLineEnding(code)) {\n return effects.check(continuationConstruct, contentContinue, contentEnd)(code);\n }\n\n // Data.\n effects.consume(code);\n return chunkInside;\n }\n\n /**\n *\n *\n * @type {State}\n */\n function contentEnd(code) {\n effects.exit(\"chunkContent\");\n effects.exit(\"content\");\n return ok(code);\n }\n\n /**\n *\n *\n * @type {State}\n */\n function contentContinue(code) {\n effects.consume(code);\n effects.exit(\"chunkContent\");\n previous.next = effects.enter(\"chunkContent\", {\n contentType: \"content\",\n previous\n });\n previous = previous.next;\n return chunkInside;\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeContinuation(effects, ok, nok) {\n const self = this;\n return startLookahead;\n\n /**\n *\n *\n * @type {State}\n */\n function startLookahead(code) {\n effects.exit(\"chunkContent\");\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, prefixed, \"linePrefix\");\n }\n\n /**\n *\n *\n * @type {State}\n */\n function prefixed(code) {\n if (code === null || markdownLineEnding(code)) {\n return nok(code);\n }\n\n // Always populated by defaults.\n\n const tail = self.events[self.events.length - 1];\n if (!self.parser.constructs.disable.null.includes('codeIndented') && tail && tail[1].type === \"linePrefix\" && tail[2].sliceSerialize(tail[1], true).length >= 4) {\n return ok(code);\n }\n return effects.interrupt(self.parser.constructs.flow, nok, ok)(code);\n }\n}","/**\n * @import {Effects, State, TokenType} from 'micromark-util-types'\n */\n\nimport { asciiControl, markdownLineEndingOrSpace, markdownLineEnding } from 'micromark-util-character';\n/**\n * Parse destinations.\n *\n * ###### Examples\n *\n * ```markdown\n * <a>\n * <a\\>b>\n * <a b>\n * <a)>\n * a\n * a\\)b\n * a(b)c\n * a(b)\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type for whole (`<a>` or `b`).\n * @param {TokenType} literalType\n * Type when enclosed (`<a>`).\n * @param {TokenType} literalMarkerType\n * Type for enclosing (`<` and `>`).\n * @param {TokenType} rawType\n * Type when not enclosed (`b`).\n * @param {TokenType} stringType\n * Type for the value (`a` or `b`).\n * @param {number | undefined} [max=Infinity]\n * Depth of nested parens (inclusive).\n * @returns {State}\n * Start state.\n */\nexport function factoryDestination(effects, ok, nok, type, literalType, literalMarkerType, rawType, stringType, max) {\n const limit = max || Number.POSITIVE_INFINITY;\n let balance = 0;\n return start;\n\n /**\n * Start of destination.\n *\n * ```markdown\n * > | <aa>\n * ^\n * > | aa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 60) {\n effects.enter(type);\n effects.enter(literalType);\n effects.enter(literalMarkerType);\n effects.consume(code);\n effects.exit(literalMarkerType);\n return enclosedBefore;\n }\n\n // ASCII control, space, closing paren.\n if (code === null || code === 32 || code === 41 || asciiControl(code)) {\n return nok(code);\n }\n effects.enter(type);\n effects.enter(rawType);\n effects.enter(stringType);\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return raw(code);\n }\n\n /**\n * After `<`, at an enclosed destination.\n *\n * ```markdown\n * > | <aa>\n * ^\n * ```\n *\n * @type {State}\n */\n function enclosedBefore(code) {\n if (code === 62) {\n effects.enter(literalMarkerType);\n effects.consume(code);\n effects.exit(literalMarkerType);\n effects.exit(literalType);\n effects.exit(type);\n return ok;\n }\n effects.enter(stringType);\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return enclosed(code);\n }\n\n /**\n * In enclosed destination.\n *\n * ```markdown\n * > | <aa>\n * ^\n * ```\n *\n * @type {State}\n */\n function enclosed(code) {\n if (code === 62) {\n effects.exit(\"chunkString\");\n effects.exit(stringType);\n return enclosedBefore(code);\n }\n if (code === null || code === 60 || markdownLineEnding(code)) {\n return nok(code);\n }\n effects.consume(code);\n return code === 92 ? enclosedEscape : enclosed;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | <a\\*a>\n * ^\n * ```\n *\n * @type {State}\n */\n function enclosedEscape(code) {\n if (code === 60 || code === 62 || code === 92) {\n effects.consume(code);\n return enclosed;\n }\n return enclosed(code);\n }\n\n /**\n * In raw destination.\n *\n * ```markdown\n * > | aa\n * ^\n * ```\n *\n * @type {State}\n */\n function raw(code) {\n if (!balance && (code === null || code === 41 || markdownLineEndingOrSpace(code))) {\n effects.exit(\"chunkString\");\n effects.exit(stringType);\n effects.exit(rawType);\n effects.exit(type);\n return ok(code);\n }\n if (balance < limit && code === 40) {\n effects.consume(code);\n balance++;\n return raw;\n }\n if (code === 41) {\n effects.consume(code);\n balance--;\n return raw;\n }\n\n // ASCII control (but *not* `\\0`) and space and `(`.\n // Note: in `markdown-rs`, `\\0` exists in codes, in `micromark-js` it\n // doesn’t.\n if (code === null || code === 32 || code === 40 || asciiControl(code)) {\n return nok(code);\n }\n effects.consume(code);\n return code === 92 ? rawEscape : raw;\n }\n\n /**\n * After `\\`, at special character.\n *\n * ```markdown\n * > | a\\*a\n * ^\n * ```\n *\n * @type {State}\n */\n function rawEscape(code) {\n if (code === 40 || code === 41 || code === 92) {\n effects.consume(code);\n return raw;\n }\n return raw(code);\n }\n}","/**\n * @import {\n * Effects,\n * State,\n * TokenizeContext,\n * TokenType\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/**\n * Parse labels.\n *\n * > 👉 **Note**: labels in markdown are capped at 999 characters in the string.\n *\n * ###### Examples\n *\n * ```markdown\n * [a]\n * [a\n * b]\n * [a\\]b]\n * ```\n *\n * @this {TokenizeContext}\n * Tokenize context.\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole label (`[a]`).\n * @param {TokenType} markerType\n * Type for the markers (`[` and `]`).\n * @param {TokenType} stringType\n * Type for the identifier (`a`).\n * @returns {State}\n * Start state.\n */\nexport function factoryLabel(effects, ok, nok, type, markerType, stringType) {\n const self = this;\n let size = 0;\n /** @type {boolean} */\n let seen;\n return start;\n\n /**\n * Start of label.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(type);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.enter(stringType);\n return atBreak;\n }\n\n /**\n * In label, at something, before something else.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (size > 999 || code === null || code === 91 || code === 93 && !seen ||\n // To do: remove in the future once we’ve switched from\n // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,\n // which doesn’t need this.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n code === 94 && !size && '_hiddenFootnoteSupport' in self.parser.constructs) {\n return nok(code);\n }\n if (code === 93) {\n effects.exit(stringType);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.exit(type);\n return ok;\n }\n\n // To do: indent? Link chunks and EOLs together?\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return atBreak;\n }\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return labelInside(code);\n }\n\n /**\n * In label, in text.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function labelInside(code) {\n if (code === null || code === 91 || code === 93 || markdownLineEnding(code) || size++ > 999) {\n effects.exit(\"chunkString\");\n return atBreak(code);\n }\n effects.consume(code);\n if (!seen) seen = !markdownSpace(code);\n return code === 92 ? labelEscape : labelInside;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | [a\\*a]\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return labelInside;\n }\n return labelInside(code);\n }\n}","/**\n * @import {\n * Code,\n * Effects,\n * State,\n * TokenType\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/**\n * Parse titles.\n *\n * ###### Examples\n *\n * ```markdown\n * \"a\"\n * 'b'\n * (c)\n * \"a\n * b\"\n * 'a\n * b'\n * (a\\)b)\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole title (`\"a\"`, `'b'`, `(c)`).\n * @param {TokenType} markerType\n * Type for the markers (`\"`, `'`, `(`, and `)`).\n * @param {TokenType} stringType\n * Type for the value (`a`).\n * @returns {State}\n * Start state.\n */\nexport function factoryTitle(effects, ok, nok, type, markerType, stringType) {\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of title.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 34 || code === 39 || code === 40) {\n effects.enter(type);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n marker = code === 40 ? 41 : code;\n return begin;\n }\n return nok(code);\n }\n\n /**\n * After opening marker.\n *\n * This is also used at the closing marker.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function begin(code) {\n if (code === marker) {\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.exit(type);\n return ok;\n }\n effects.enter(stringType);\n return atBreak(code);\n }\n\n /**\n * At something, before something else.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === marker) {\n effects.exit(stringType);\n return begin(marker);\n }\n if (code === null) {\n return nok(code);\n }\n\n // Note: blank lines can’t exist in content.\n if (markdownLineEnding(code)) {\n // To do: use `space_or_tab_eol_with_options`, connect.\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, atBreak, \"linePrefix\");\n }\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return inside(code);\n }\n\n /**\n *\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker || code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n return atBreak(code);\n }\n effects.consume(code);\n return code === 92 ? escape : inside;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | \"a\\*b\"\n * ^\n * ```\n *\n * @type {State}\n */\n function escape(code) {\n if (code === marker || code === 92) {\n effects.consume(code);\n return inside;\n }\n return inside(code);\n }\n}","/**\n * @import {Effects, State} from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * line endings or spaces in markdown are often optional, in which case this\n * factory can be used and `ok` will be switched to whether spaces were found\n * or not\n * * one line ending or space can be detected with\n * `markdownLineEndingOrSpace(code)` right before using `factoryWhitespace`\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @returns {State}\n * Start state.\n */\nexport function factoryWhitespace(effects, ok) {\n /** @type {boolean} */\n let seen;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n seen = true;\n return start;\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, start, seen ? \"linePrefix\" : \"lineSuffix\")(code);\n }\n return ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factoryDestination } from 'micromark-factory-destination';\nimport { factoryLabel } from 'micromark-factory-label';\nimport { factorySpace } from 'micromark-factory-space';\nimport { factoryTitle } from 'micromark-factory-title';\nimport { factoryWhitespace } from 'micromark-factory-whitespace';\nimport { markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\n/** @type {Construct} */\nexport const definition = {\n name: 'definition',\n tokenize: tokenizeDefinition\n};\n\n/** @type {Construct} */\nconst titleBefore = {\n partial: true,\n tokenize: tokenizeTitleBefore\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeDefinition(effects, ok, nok) {\n const self = this;\n /** @type {string} */\n let identifier;\n return start;\n\n /**\n * At start of a definition.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Do not interrupt paragraphs (but do follow definitions).\n // To do: do `interrupt` the way `markdown-rs` does.\n // To do: parse whitespace the way `markdown-rs` does.\n effects.enter(\"definition\");\n return before(code);\n }\n\n /**\n * After optional whitespace, at `[`.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n // To do: parse whitespace the way `markdown-rs` does.\n\n return factoryLabel.call(self, effects, labelAfter,\n // Note: we don’t need to reset the way `markdown-rs` does.\n nok, \"definitionLabel\", \"definitionLabelMarker\", \"definitionLabelString\")(code);\n }\n\n /**\n * After label.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAfter(code) {\n identifier = normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1));\n if (code === 58) {\n effects.enter(\"definitionMarker\");\n effects.consume(code);\n effects.exit(\"definitionMarker\");\n return markerAfter;\n }\n return nok(code);\n }\n\n /**\n * After marker.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function markerAfter(code) {\n // Note: whitespace is optional.\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, destinationBefore)(code) : destinationBefore(code);\n }\n\n /**\n * Before destination.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function destinationBefore(code) {\n return factoryDestination(effects, destinationAfter,\n // Note: we don’t need to reset the way `markdown-rs` does.\n nok, \"definitionDestination\", \"definitionDestinationLiteral\", \"definitionDestinationLiteralMarker\", \"definitionDestinationRaw\", \"definitionDestinationString\")(code);\n }\n\n /**\n * After destination.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function destinationAfter(code) {\n return effects.attempt(titleBefore, after, after)(code);\n }\n\n /**\n * After definition.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return markdownSpace(code) ? factorySpace(effects, afterWhitespace, \"whitespace\")(code) : afterWhitespace(code);\n }\n\n /**\n * After definition, after optional whitespace.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function afterWhitespace(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"definition\");\n\n // Note: we don’t care about uniqueness.\n // It’s likely that that doesn’t happen very frequently.\n // It is more likely that it wastes precious time.\n self.parser.defined.push(identifier);\n\n // To do: `markdown-rs` interrupt.\n // // You’d be interrupting.\n // tokenizer.interrupt = true\n return ok(code);\n }\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeTitleBefore(effects, ok, nok) {\n return titleBefore;\n\n /**\n * After destination, at whitespace.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleBefore(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, beforeMarker)(code) : nok(code);\n }\n\n /**\n * At title.\n *\n * ```markdown\n * | [a]: b\n * > | \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeMarker(code) {\n return factoryTitle(effects, titleAfter, nok, \"definitionTitle\", \"definitionTitleMarker\", \"definitionTitleString\")(code);\n }\n\n /**\n * After title.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleAfter(code) {\n return markdownSpace(code) ? factorySpace(effects, titleAfterOptionalWhitespace, \"whitespace\")(code) : titleAfterOptionalWhitespace(code);\n }\n\n /**\n * After title, after optional whitespace.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleAfterOptionalWhitespace(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const hardBreakEscape = {\n name: 'hardBreakEscape',\n tokenize: tokenizeHardBreakEscape\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHardBreakEscape(effects, ok, nok) {\n return start;\n\n /**\n * Start of a hard break (escape).\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"hardBreakEscape\");\n effects.consume(code);\n return after;\n }\n\n /**\n * After `\\`, at eol.\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (markdownLineEnding(code)) {\n effects.exit(\"hardBreakEscape\");\n return ok(code);\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { splice } from 'micromark-util-chunked';\n/** @type {Construct} */\nexport const headingAtx = {\n name: 'headingAtx',\n resolve: resolveHeadingAtx,\n tokenize: tokenizeHeadingAtx\n};\n\n/** @type {Resolver} */\nfunction resolveHeadingAtx(events, context) {\n let contentEnd = events.length - 2;\n let contentStart = 3;\n\n // Prefix whitespace, part of the opening.\n if (events[contentStart][1].type === \"whitespace\") {\n contentStart += 2;\n }\n\n // Suffix whitespace, part of the closing.\n if (contentEnd - 2 > contentStart && events[contentEnd][1].type === \"whitespace\") {\n contentEnd -= 2;\n }\n if (events[contentEnd][1].type === \"atxHeadingSequence\" && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === \"whitespace\")) {\n contentEnd -= contentStart + 1 === contentEnd ? 2 : 4;\n }\n if (contentEnd > contentStart) {\n const content = {\n type: \"atxHeadingText\",\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end\n };\n const text = {\n type: \"chunkText\",\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end,\n contentType: \"text\"\n };\n splice(events, contentStart, contentEnd - contentStart + 1, [['enter', content, context], ['enter', text, context], ['exit', text, context], ['exit', content, context]]);\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHeadingAtx(effects, ok, nok) {\n let size = 0;\n return start;\n\n /**\n * Start of a heading (atx).\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse indent like `markdown-rs`.\n effects.enter(\"atxHeading\");\n return before(code);\n }\n\n /**\n * After optional whitespace, at `#`.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"atxHeadingSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 35 && size++ < 6) {\n effects.consume(code);\n return sequenceOpen;\n }\n\n // Always at least one `#`.\n if (code === null || markdownLineEndingOrSpace(code)) {\n effects.exit(\"atxHeadingSequence\");\n return atBreak(code);\n }\n return nok(code);\n }\n\n /**\n * After something, before something else.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === 35) {\n effects.enter(\"atxHeadingSequence\");\n return sequenceFurther(code);\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"atxHeading\");\n // To do: interrupt like `markdown-rs`.\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n return ok(code);\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, atBreak, \"whitespace\")(code);\n }\n\n // To do: generate `data` tokens, add the `text` token later.\n // Needs edit map, see: `markdown.rs`.\n effects.enter(\"atxHeadingText\");\n return data(code);\n }\n\n /**\n * In further sequence (after whitespace).\n *\n * Could be normal “visible” hashes in the heading or a final sequence.\n *\n * ```markdown\n * > | ## aa ##\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceFurther(code) {\n if (code === 35) {\n effects.consume(code);\n return sequenceFurther;\n }\n effects.exit(\"atxHeadingSequence\");\n return atBreak(code);\n }\n\n /**\n * In text.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (code === null || code === 35 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"atxHeadingText\");\n return atBreak(code);\n }\n effects.consume(code);\n return data;\n }\n}","/**\n * List of lowercase HTML “block” tag names.\n *\n * The list, when parsing HTML (flow), results in more relaxed rules (condition\n * 6).\n * Because they are known blocks, the HTML-like syntax doesn’t have to be\n * strictly parsed.\n * For tag names not in this list, a more strict algorithm (condition 7) is used\n * to detect whether the HTML-like syntax is seen as HTML (flow) or not.\n *\n * This is copied from:\n * <https://spec.commonmark.org/0.30/#html-blocks>.\n *\n * > 👉 **Note**: `search` was added in `CommonMark@0.31`.\n */\nexport const htmlBlockNames = [\n 'address',\n 'article',\n 'aside',\n 'base',\n 'basefont',\n 'blockquote',\n 'body',\n 'caption',\n 'center',\n 'col',\n 'colgroup',\n 'dd',\n 'details',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'iframe',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'menu',\n 'menuitem',\n 'nav',\n 'noframes',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'param',\n 'search',\n 'section',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'track',\n 'ul'\n]\n\n/**\n * List of lowercase HTML “raw” tag names.\n *\n * The list, when parsing HTML (flow), results in HTML that can include lines\n * without exiting, until a closing tag also in this list is found (condition\n * 1).\n *\n * This module is copied from:\n * <https://spec.commonmark.org/0.30/#html-blocks>.\n *\n * > 👉 **Note**: `textarea` was added in `CommonMark@0.30`.\n */\nexport const htmlRawNames = ['pre', 'script', 'style', 'textarea']\n","/**\n * @import {\n * Code,\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { asciiAlphanumeric, asciiAlpha, markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { htmlBlockNames, htmlRawNames } from 'micromark-util-html-tag-name';\nimport { blankLine } from './blank-line.js';\nimport { nonLazyContinuation } from './partial-non-lazy-continuation.js';\n\n/** @type {Construct} */\nexport const htmlFlow = {\n concrete: true,\n name: 'htmlFlow',\n resolveTo: resolveToHtmlFlow,\n tokenize: tokenizeHtmlFlow\n};\n\n/** @type {Construct} */\nconst blankLineBefore = {\n partial: true,\n tokenize: tokenizeBlankLineBefore\n};\n\n/** @type {Resolver} */\nfunction resolveToHtmlFlow(events) {\n let index = events.length;\n while (index--) {\n if (events[index][0] === 'enter' && events[index][1].type === \"htmlFlow\") {\n break;\n }\n }\n if (index > 1 && events[index - 2][1].type === \"linePrefix\") {\n // Add the prefix start to the HTML token.\n events[index][1].start = events[index - 2][1].start;\n // Add the prefix start to the HTML line token.\n events[index + 1][1].start = events[index - 2][1].start;\n // Remove the line prefix.\n events.splice(index - 2, 2);\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlFlow(effects, ok, nok) {\n const self = this;\n /** @type {number} */\n let marker;\n /** @type {boolean} */\n let closingTag;\n /** @type {string} */\n let buffer;\n /** @type {number} */\n let index;\n /** @type {Code} */\n let markerB;\n return start;\n\n /**\n * Start of HTML (flow).\n *\n * ```markdown\n * > | <x />\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse indent like `markdown-rs`.\n return before(code);\n }\n\n /**\n * At `<`, after optional whitespace.\n *\n * ```markdown\n * > | <x />\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"htmlFlow\");\n effects.enter(\"htmlFlowData\");\n effects.consume(code);\n return open;\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | <x />\n * ^\n * > | <!doctype>\n * ^\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code);\n return declarationOpen;\n }\n if (code === 47) {\n effects.consume(code);\n closingTag = true;\n return tagCloseStart;\n }\n if (code === 63) {\n effects.consume(code);\n marker = 3;\n // To do:\n // tokenizer.concrete = true\n // To do: use `markdown-rs` style interrupt.\n // While we’re in an instruction instead of a declaration, we’re on a `?`\n // right now, so we do need to search for `>`, similar to declarations.\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n // Always the case.\n effects.consume(code);\n buffer = String.fromCharCode(code);\n return tagName;\n }\n return nok(code);\n }\n\n /**\n * After `<!`, at declaration, comment, or CDATA.\n *\n * ```markdown\n * > | <!doctype>\n * ^\n * > | <!--xxx-->\n * ^\n * > | <![CDATA[>&<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code);\n marker = 2;\n return commentOpenInside;\n }\n if (code === 91) {\n effects.consume(code);\n marker = 5;\n index = 0;\n return cdataOpenInside;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n marker = 4;\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n return nok(code);\n }\n\n /**\n * After `<!-`, inside a comment, at another `-`.\n *\n * ```markdown\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code);\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n return nok(code);\n }\n\n /**\n * After `<![`, inside CDATA, expecting `CDATA[`.\n *\n * ```markdown\n * > | <![CDATA[>&<]]>\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = \"CDATA[\";\n if (code === value.charCodeAt(index++)) {\n effects.consume(code);\n if (index === value.length) {\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuation;\n }\n return cdataOpenInside;\n }\n return nok(code);\n }\n\n /**\n * After `</`, in closing tag, at tag name.\n *\n * ```markdown\n * > | </x>\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n if (asciiAlpha(code)) {\n // Always the case.\n effects.consume(code);\n buffer = String.fromCharCode(code);\n return tagName;\n }\n return nok(code);\n }\n\n /**\n * In tag name.\n *\n * ```markdown\n * > | <ab>\n * ^^\n * > | </ab>\n * ^^\n * ```\n *\n * @type {State}\n */\n function tagName(code) {\n if (code === null || code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n const slash = code === 47;\n const name = buffer.toLowerCase();\n if (!slash && !closingTag && htmlRawNames.includes(name)) {\n marker = 1;\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok(code) : continuation(code);\n }\n if (htmlBlockNames.includes(buffer.toLowerCase())) {\n marker = 6;\n if (slash) {\n effects.consume(code);\n return basicSelfClosing;\n }\n\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok(code) : continuation(code);\n }\n marker = 7;\n // Do not support complete HTML when interrupting.\n return self.interrupt && !self.parser.lazy[self.now().line] ? nok(code) : closingTag ? completeClosingTagAfter(code) : completeAttributeNameBefore(code);\n }\n\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n buffer += String.fromCharCode(code);\n return tagName;\n }\n return nok(code);\n }\n\n /**\n * After closing slash of a basic tag name.\n *\n * ```markdown\n * > | <div/>\n * ^\n * ```\n *\n * @type {State}\n */\n function basicSelfClosing(code) {\n if (code === 62) {\n effects.consume(code);\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuation;\n }\n return nok(code);\n }\n\n /**\n * After closing slash of a complete tag name.\n *\n * ```markdown\n * > | <x/>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeClosingTagAfter(code) {\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeClosingTagAfter;\n }\n return completeEnd(code);\n }\n\n /**\n * At an attribute name.\n *\n * At first, this state is used after a complete tag name, after whitespace,\n * where it expects optional attributes or the end of the tag.\n * It is also reused after attributes, when expecting more optional\n * attributes.\n *\n * ```markdown\n * > | <a />\n * ^\n * > | <a :b>\n * ^\n * > | <a _b>\n * ^\n * > | <a b>\n * ^\n * > | <a >\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeNameBefore(code) {\n if (code === 47) {\n effects.consume(code);\n return completeEnd;\n }\n\n // ASCII alphanumerical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code);\n return completeAttributeName;\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeNameBefore;\n }\n return completeEnd(code);\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | <a :b>\n * ^\n * > | <a _b>\n * ^\n * > | <a b>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeName(code) {\n // ASCII alphanumerical and `-`, `.`, `:`, and `_`.\n if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return completeAttributeName;\n }\n return completeAttributeNameAfter(code);\n }\n\n /**\n * After attribute name, at an optional initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | <a b>\n * ^\n * > | <a b=c>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code);\n return completeAttributeValueBefore;\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeNameAfter;\n }\n return completeAttributeNameBefore(code);\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | <a b=c>\n * ^\n * > | <a b=\"c\">\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueBefore(code) {\n if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {\n return nok(code);\n }\n if (code === 34 || code === 39) {\n effects.consume(code);\n markerB = code;\n return completeAttributeValueQuoted;\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeValueBefore;\n }\n return completeAttributeValueUnquoted(code);\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | <a b=\"c\">\n * ^\n * > | <a b='c'>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueQuoted(code) {\n if (code === markerB) {\n effects.consume(code);\n markerB = null;\n return completeAttributeValueQuotedAfter;\n }\n if (code === null || markdownLineEnding(code)) {\n return nok(code);\n }\n effects.consume(code);\n return completeAttributeValueQuoted;\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | <a b=c>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueUnquoted(code) {\n if (code === null || code === 34 || code === 39 || code === 47 || code === 60 || code === 61 || code === 62 || code === 96 || markdownLineEndingOrSpace(code)) {\n return completeAttributeNameAfter(code);\n }\n effects.consume(code);\n return completeAttributeValueUnquoted;\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the\n * end of the tag.\n *\n * ```markdown\n * > | <a b=\"c\">\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownSpace(code)) {\n return completeAttributeNameBefore(code);\n }\n return nok(code);\n }\n\n /**\n * In certain circumstances of a complete tag where only an `>` is allowed.\n *\n * ```markdown\n * > | <a b=\"c\">\n * ^\n * ```\n *\n * @type {State}\n */\n function completeEnd(code) {\n if (code === 62) {\n effects.consume(code);\n return completeAfter;\n }\n return nok(code);\n }\n\n /**\n * After `>` in a complete tag.\n *\n * ```markdown\n * > | <x>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n // // Do not form containers.\n // tokenizer.concrete = true\n return continuation(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAfter;\n }\n return nok(code);\n }\n\n /**\n * In continuation of any HTML kind.\n *\n * ```markdown\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function continuation(code) {\n if (code === 45 && marker === 2) {\n effects.consume(code);\n return continuationCommentInside;\n }\n if (code === 60 && marker === 1) {\n effects.consume(code);\n return continuationRawTagOpen;\n }\n if (code === 62 && marker === 4) {\n effects.consume(code);\n return continuationClose;\n }\n if (code === 63 && marker === 3) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n if (code === 93 && marker === 5) {\n effects.consume(code);\n return continuationCdataInside;\n }\n if (markdownLineEnding(code) && (marker === 6 || marker === 7)) {\n effects.exit(\"htmlFlowData\");\n return effects.check(blankLineBefore, continuationAfter, continuationStart)(code);\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"htmlFlowData\");\n return continuationStart(code);\n }\n effects.consume(code);\n return continuation;\n }\n\n /**\n * In continuation, at eol.\n *\n * ```markdown\n * > | <x>\n * ^\n * | asd\n * ```\n *\n * @type {State}\n */\n function continuationStart(code) {\n return effects.check(nonLazyContinuation, continuationStartNonLazy, continuationAfter)(code);\n }\n\n /**\n * In continuation, at eol, before non-lazy content.\n *\n * ```markdown\n * > | <x>\n * ^\n * | asd\n * ```\n *\n * @type {State}\n */\n function continuationStartNonLazy(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return continuationBefore;\n }\n\n /**\n * In continuation, before non-lazy content.\n *\n * ```markdown\n * | <x>\n * > | asd\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return continuationStart(code);\n }\n effects.enter(\"htmlFlowData\");\n return continuation(code);\n }\n\n /**\n * In comment continuation, after one `-`, expecting another.\n *\n * ```markdown\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCommentInside(code) {\n if (code === 45) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In raw continuation, after `<`, at `/`.\n *\n * ```markdown\n * > | <script>console.log(1)</script>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationRawTagOpen(code) {\n if (code === 47) {\n effects.consume(code);\n buffer = '';\n return continuationRawEndTag;\n }\n return continuation(code);\n }\n\n /**\n * In raw continuation, after `</`, in a raw tag name.\n *\n * ```markdown\n * > | <script>console.log(1)</script>\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function continuationRawEndTag(code) {\n if (code === 62) {\n const name = buffer.toLowerCase();\n if (htmlRawNames.includes(name)) {\n effects.consume(code);\n return continuationClose;\n }\n return continuation(code);\n }\n if (asciiAlpha(code) && buffer.length < 8) {\n // Always the case.\n effects.consume(code);\n buffer += String.fromCharCode(code);\n return continuationRawEndTag;\n }\n return continuation(code);\n }\n\n /**\n * In cdata continuation, after `]`, expecting `]>`.\n *\n * ```markdown\n * > | <![CDATA[>&<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCdataInside(code) {\n if (code === 93) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In declaration or instruction continuation, at `>`.\n *\n * ```markdown\n * > | <!-->\n * ^\n * > | <?>\n * ^\n * > | <!q>\n * ^\n * > | <!--ab-->\n * ^\n * > | <![CDATA[>&<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationDeclarationInside(code) {\n if (code === 62) {\n effects.consume(code);\n return continuationClose;\n }\n\n // More dashes.\n if (code === 45 && marker === 2) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In closed continuation: everything we get until the eol/eof is part of it.\n *\n * ```markdown\n * > | <!doctype>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"htmlFlowData\");\n return continuationAfter(code);\n }\n effects.consume(code);\n return continuationClose;\n }\n\n /**\n * Done.\n *\n * ```markdown\n * > | <!doctype>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationAfter(code) {\n effects.exit(\"htmlFlow\");\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n // // No longer concrete.\n // tokenizer.concrete = false\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLineBefore(effects, ok, nok) {\n return start;\n\n /**\n * Before eol, expecting blank line.\n *\n * ```markdown\n * > | <div>\n * ^\n * |\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return effects.attempt(blankLine, ok, nok);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiAlphanumeric, asciiAlpha, markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const htmlText = {\n name: 'htmlText',\n tokenize: tokenizeHtmlText\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlText(effects, ok, nok) {\n const self = this;\n /** @type {NonNullable<Code> | undefined} */\n let marker;\n /** @type {number} */\n let index;\n /** @type {State} */\n let returnState;\n return start;\n\n /**\n * Start of HTML (text).\n *\n * ```markdown\n * > | a <b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"htmlText\");\n effects.enter(\"htmlTextData\");\n effects.consume(code);\n return open;\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | a <b> c\n * ^\n * > | a <!doctype> c\n * ^\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code);\n return declarationOpen;\n }\n if (code === 47) {\n effects.consume(code);\n return tagCloseStart;\n }\n if (code === 63) {\n effects.consume(code);\n return instruction;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagOpen;\n }\n return nok(code);\n }\n\n /**\n * After `<!`, at declaration, comment, or CDATA.\n *\n * ```markdown\n * > | a <!doctype> c\n * ^\n * > | a <!--b--> c\n * ^\n * > | a <![CDATA[>&<]]> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code);\n return commentOpenInside;\n }\n if (code === 91) {\n effects.consume(code);\n index = 0;\n return cdataOpenInside;\n }\n if (asciiAlpha(code)) {\n effects.consume(code);\n return declaration;\n }\n return nok(code);\n }\n\n /**\n * In a comment, after `<!-`, at another `-`.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code);\n return commentEnd;\n }\n return nok(code);\n }\n\n /**\n * In comment.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function comment(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 45) {\n effects.consume(code);\n return commentClose;\n }\n if (markdownLineEnding(code)) {\n returnState = comment;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return comment;\n }\n\n /**\n * In comment, after `-`.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentClose(code) {\n if (code === 45) {\n effects.consume(code);\n return commentEnd;\n }\n return comment(code);\n }\n\n /**\n * In comment, after `--`.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentEnd(code) {\n return code === 62 ? end(code) : code === 45 ? commentClose(code) : comment(code);\n }\n\n /**\n * After `<![`, in CDATA, expecting `CDATA[`.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = \"CDATA[\";\n if (code === value.charCodeAt(index++)) {\n effects.consume(code);\n return index === value.length ? cdata : cdataOpenInside;\n }\n return nok(code);\n }\n\n /**\n * In CDATA.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^^^\n * ```\n *\n * @type {State}\n */\n function cdata(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 93) {\n effects.consume(code);\n return cdataClose;\n }\n if (markdownLineEnding(code)) {\n returnState = cdata;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return cdata;\n }\n\n /**\n * In CDATA, after `]`, at another `]`.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataClose(code) {\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n return cdata(code);\n }\n\n /**\n * In CDATA, after `]]`, at `>`.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataEnd(code) {\n if (code === 62) {\n return end(code);\n }\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n return cdata(code);\n }\n\n /**\n * In declaration.\n *\n * ```markdown\n * > | a <!b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declaration(code) {\n if (code === null || code === 62) {\n return end(code);\n }\n if (markdownLineEnding(code)) {\n returnState = declaration;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return declaration;\n }\n\n /**\n * In instruction.\n *\n * ```markdown\n * > | a <?b?> c\n * ^\n * ```\n *\n * @type {State}\n */\n function instruction(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 63) {\n effects.consume(code);\n return instructionClose;\n }\n if (markdownLineEnding(code)) {\n returnState = instruction;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return instruction;\n }\n\n /**\n * In instruction, after `?`, at `>`.\n *\n * ```markdown\n * > | a <?b?> c\n * ^\n * ```\n *\n * @type {State}\n */\n function instructionClose(code) {\n return code === 62 ? end(code) : instruction(code);\n }\n\n /**\n * After `</`, in closing tag, at tag name.\n *\n * ```markdown\n * > | a </b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagClose;\n }\n return nok(code);\n }\n\n /**\n * After `</x`, in a tag name.\n *\n * ```markdown\n * > | a </b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagClose(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagClose;\n }\n return tagCloseBetween(code);\n }\n\n /**\n * In closing tag, after tag name.\n *\n * ```markdown\n * > | a </b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseBetween(code) {\n if (markdownLineEnding(code)) {\n returnState = tagCloseBetween;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagCloseBetween;\n }\n return end(code);\n }\n\n /**\n * After `<x`, in opening tag name.\n *\n * ```markdown\n * > | a <b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpen(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpen;\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n return nok(code);\n }\n\n /**\n * In opening tag, after tag name.\n *\n * ```markdown\n * > | a <b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenBetween(code) {\n if (code === 47) {\n effects.consume(code);\n return end;\n }\n\n // ASCII alphabetical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenBetween;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenBetween;\n }\n return end(code);\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | a <b c> d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeName(code) {\n // ASCII alphabetical and `-`, `.`, `:`, and `_`.\n if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n return tagOpenAttributeNameAfter(code);\n }\n\n /**\n * After attribute name, before initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | a <b c> d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeNameAfter;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeNameAfter;\n }\n return tagOpenBetween(code);\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | a <b c=d> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueBefore(code) {\n if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {\n return nok(code);\n }\n if (code === 34 || code === 39) {\n effects.consume(code);\n marker = code;\n return tagOpenAttributeValueQuoted;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueBefore;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n effects.consume(code);\n return tagOpenAttributeValueUnquoted;\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | a <b c=\"d\"> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuoted(code) {\n if (code === marker) {\n effects.consume(code);\n marker = undefined;\n return tagOpenAttributeValueQuotedAfter;\n }\n if (code === null) {\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueQuoted;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return tagOpenAttributeValueQuoted;\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | a <b c=d> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueUnquoted(code) {\n if (code === null || code === 34 || code === 39 || code === 60 || code === 61 || code === 96) {\n return nok(code);\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n effects.consume(code);\n return tagOpenAttributeValueUnquoted;\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the end\n * of the tag.\n *\n * ```markdown\n * > | a <b c=\"d\"> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n return nok(code);\n }\n\n /**\n * In certain circumstances of a tag where only an `>` is allowed.\n *\n * ```markdown\n * > | a <b c=\"d\"> e\n * ^\n * ```\n *\n * @type {State}\n */\n function end(code) {\n if (code === 62) {\n effects.consume(code);\n effects.exit(\"htmlTextData\");\n effects.exit(\"htmlText\");\n return ok;\n }\n return nok(code);\n }\n\n /**\n * At eol.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * > | a <!--a\n * ^\n * | b-->\n * ```\n *\n * @type {State}\n */\n function lineEndingBefore(code) {\n effects.exit(\"htmlTextData\");\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return lineEndingAfter;\n }\n\n /**\n * After eol, at optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a <!--a\n * > | b-->\n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfter(code) {\n // Always populated by defaults.\n\n return markdownSpace(code) ? factorySpace(effects, lineEndingAfterPrefix, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code) : lineEndingAfterPrefix(code);\n }\n\n /**\n * After eol, after optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a <!--a\n * > | b-->\n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfterPrefix(code) {\n effects.enter(\"htmlTextData\");\n return returnState(code);\n }\n}","/**\n * @import {\n * Construct,\n * Event,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factoryDestination } from 'micromark-factory-destination';\nimport { factoryLabel } from 'micromark-factory-label';\nimport { factoryTitle } from 'micromark-factory-title';\nimport { factoryWhitespace } from 'micromark-factory-whitespace';\nimport { markdownLineEndingOrSpace } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const labelEnd = {\n name: 'labelEnd',\n resolveAll: resolveAllLabelEnd,\n resolveTo: resolveToLabelEnd,\n tokenize: tokenizeLabelEnd\n};\n\n/** @type {Construct} */\nconst resourceConstruct = {\n tokenize: tokenizeResource\n};\n/** @type {Construct} */\nconst referenceFullConstruct = {\n tokenize: tokenizeReferenceFull\n};\n/** @type {Construct} */\nconst referenceCollapsedConstruct = {\n tokenize: tokenizeReferenceCollapsed\n};\n\n/** @type {Resolver} */\nfunction resolveAllLabelEnd(events) {\n let index = -1;\n /** @type {Array<Event>} */\n const newEvents = [];\n while (++index < events.length) {\n const token = events[index][1];\n newEvents.push(events[index]);\n if (token.type === \"labelImage\" || token.type === \"labelLink\" || token.type === \"labelEnd\") {\n // Remove the marker.\n const offset = token.type === \"labelImage\" ? 4 : 2;\n token.type = \"data\";\n index += offset;\n }\n }\n\n // If the events are equal, we don't have to copy newEvents to events\n if (events.length !== newEvents.length) {\n splice(events, 0, events.length, newEvents);\n }\n return events;\n}\n\n/** @type {Resolver} */\nfunction resolveToLabelEnd(events, context) {\n let index = events.length;\n let offset = 0;\n /** @type {number | undefined} */\n let open;\n /** @type {number | undefined} */\n let close;\n /** @type {Array<Event>} */\n let media;\n\n // Find an opening.\n while (index--) {\n const token = events[index][1];\n if (open) {\n // If we see another link, or inactive link label, we’ve been here before.\n if (token.type === \"link\" || token.type === \"labelLink\" && token._inactive) {\n break;\n }\n\n // Mark other link openings as inactive, as we can’t have links in\n // links.\n if (events[index][0] === 'enter' && token.type === \"labelLink\") {\n token._inactive = true;\n }\n } else if (close) {\n if (events[index][0] === 'enter' && (token.type === \"labelImage\" || token.type === \"labelLink\") && !token._balanced) {\n open = index;\n if (token.type !== \"labelLink\") {\n offset = 2;\n break;\n }\n }\n } else if (token.type === \"labelEnd\") {\n close = index;\n }\n }\n const group = {\n type: events[open][1].type === \"labelLink\" ? \"link\" : \"image\",\n start: {\n ...events[open][1].start\n },\n end: {\n ...events[events.length - 1][1].end\n }\n };\n const label = {\n type: \"label\",\n start: {\n ...events[open][1].start\n },\n end: {\n ...events[close][1].end\n }\n };\n const text = {\n type: \"labelText\",\n start: {\n ...events[open + offset + 2][1].end\n },\n end: {\n ...events[close - 2][1].start\n }\n };\n media = [['enter', group, context], ['enter', label, context]];\n\n // Opening marker.\n media = push(media, events.slice(open + 1, open + offset + 3));\n\n // Text open.\n media = push(media, [['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n media = push(media, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + offset + 4, close - 3), context));\n\n // Text close, marker close, label close.\n media = push(media, [['exit', text, context], events[close - 2], events[close - 1], ['exit', label, context]]);\n\n // Reference, resource, or so.\n media = push(media, events.slice(close + 1));\n\n // Media close.\n media = push(media, [['exit', group, context]]);\n splice(events, open, events.length, media);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelEnd(effects, ok, nok) {\n const self = this;\n const labelStarts = self._labelStarts;\n /** @type {Token} */\n let labelStart;\n /** @type {boolean} */\n let defined;\n if (labelStarts) {\n // Discard ones that failed to close,\n // they’re not needed anymore.\n while (labelStarts.length > 0 && labelStarts[labelStarts.length - 1]._balanced) {\n labelStarts.pop();\n }\n labelStart = labelStarts[labelStarts.length - 1];\n }\n return start;\n\n /**\n * Start of label end.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // If there is not an okay opening.\n if (!labelStart) {\n return nok(code);\n }\n\n // If the corresponding label (link) start is marked as inactive,\n // it means we’d be wrapping a link, like this:\n //\n // ```markdown\n // > | a [b [c](d) e](f) g.\n // ^\n // ```\n //\n // We can’t have that, so it’s just balanced brackets.\n if (labelStart._inactive) {\n return labelEndNok(code);\n }\n defined = self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })));\n effects.enter(\"labelEnd\");\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n effects.exit(\"labelEnd\");\n return after;\n }\n\n /**\n * After `]`.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Note: `markdown-rs` also parses GFM footnotes here, which for us is in\n // an extension.\n\n // Resource (`[asd](fgh)`)?\n if (code === 40) {\n return effects.attempt(resourceConstruct, labelEndOk, defined ? labelEndOk : labelEndNok)(code);\n }\n\n // Full (`[asd][fgh]`) or collapsed (`[asd][]`) reference?\n if (code === 91) {\n return effects.attempt(referenceFullConstruct, labelEndOk, defined ? referenceNotFull : labelEndNok)(code);\n }\n\n // Shortcut (`[asd]`) reference?\n return defined ? labelEndOk(code) : labelEndNok(code);\n }\n\n /**\n * After `]`, at `[`, but not at a full reference.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceNotFull(code) {\n return effects.attempt(referenceCollapsedConstruct, labelEndOk, labelEndNok)(code);\n }\n\n /**\n * Done, we found something.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndOk(code) {\n // Note: `markdown-rs` does a bunch of stuff here.\n // This label start is now used up: discard it so it’s never found again.\n\n labelStarts.pop();\n return ok(code);\n }\n\n /**\n * Done, it’s nothing.\n *\n * There was an okay opening, but we didn’t match anything.\n *\n * ```markdown\n * > | [a](b c\n * ^\n * > | [a][b c\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndNok(code) {\n labelStart._balanced = true;\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeResource(effects, ok, nok) {\n return resourceStart;\n\n /**\n * At a resource.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceStart(code) {\n effects.enter(\"resource\");\n effects.enter(\"resourceMarker\");\n effects.consume(code);\n effects.exit(\"resourceMarker\");\n return resourceBefore;\n }\n\n /**\n * In resource, after `(`, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBefore(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceOpen)(code) : resourceOpen(code);\n }\n\n /**\n * In resource, after optional whitespace, at `)` or a destination.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceOpen(code) {\n if (code === 41) {\n return resourceEnd(code);\n }\n return factoryDestination(effects, resourceDestinationAfter, resourceDestinationMissing, \"resourceDestination\", \"resourceDestinationLiteral\", \"resourceDestinationLiteralMarker\", \"resourceDestinationRaw\", \"resourceDestinationString\", 32)(code);\n }\n\n /**\n * In resource, after destination, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationAfter(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceBetween)(code) : resourceEnd(code);\n }\n\n /**\n * At invalid destination.\n *\n * ```markdown\n * > | [a](<<) b\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationMissing(code) {\n return nok(code);\n }\n\n /**\n * In resource, after destination and whitespace, at `(` or title.\n *\n * ```markdown\n * > | [a](b ) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBetween(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(effects, resourceTitleAfter, nok, \"resourceTitle\", \"resourceTitleMarker\", \"resourceTitleString\")(code);\n }\n return resourceEnd(code);\n }\n\n /**\n * In resource, after title, at optional whitespace.\n *\n * ```markdown\n * > | [a](b \"c\") d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceTitleAfter(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceEnd)(code) : resourceEnd(code);\n }\n\n /**\n * In resource, at `)`.\n *\n * ```markdown\n * > | [a](b) d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceEnd(code) {\n if (code === 41) {\n effects.enter(\"resourceMarker\");\n effects.consume(code);\n effects.exit(\"resourceMarker\");\n effects.exit(\"resource\");\n return ok;\n }\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceFull(effects, ok, nok) {\n const self = this;\n return referenceFull;\n\n /**\n * In a reference (full), at the `[`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFull(code) {\n return factoryLabel.call(self, effects, referenceFullAfter, referenceFullMissing, \"reference\", \"referenceMarker\", \"referenceString\")(code);\n }\n\n /**\n * In a reference (full), after `]`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullAfter(code) {\n return self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1))) ? ok(code) : nok(code);\n }\n\n /**\n * In reference (full) that was missing.\n *\n * ```markdown\n * > | [a][b d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullMissing(code) {\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceCollapsed(effects, ok, nok) {\n return referenceCollapsedStart;\n\n /**\n * In reference (collapsed), at `[`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedStart(code) {\n // We only attempt a collapsed label if there’s a `[`.\n\n effects.enter(\"reference\");\n effects.enter(\"referenceMarker\");\n effects.consume(code);\n effects.exit(\"referenceMarker\");\n return referenceCollapsedOpen;\n }\n\n /**\n * In reference (collapsed), at `]`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedOpen(code) {\n if (code === 93) {\n effects.enter(\"referenceMarker\");\n effects.consume(code);\n effects.exit(\"referenceMarker\");\n effects.exit(\"reference\");\n return ok;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * Token,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { labelEnd } from './label-end.js';\n\n/** @type {Construct} */\nexport const labelStartImage = {\n name: 'labelStartImage',\n resolveAll: labelEnd.resolveAll,\n tokenize: tokenizeLabelStartImage\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartImage(effects, ok, nok) {\n const self = this;\n /** @type {Token} */\n let labelImage;\n return start;\n\n /**\n * Start of label (image) start.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"labelImage\");\n effects.enter(\"labelImageMarker\");\n effects.consume(code);\n effects.exit(\"labelImageMarker\");\n return open;\n }\n\n /**\n * After `!`, at `[`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 91) {\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n labelImage = effects.exit(\"labelImage\");\n return after;\n }\n return nok(code);\n }\n\n /**\n * After `![`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * This is needed in because, when GFM footnotes are enabled, images never\n * form when started with a `^`.\n * Instead, links form:\n *\n * ```markdown\n * \n *\n * ![^a][b]\n *\n * [b]: c\n * ```\n *\n * ```html\n * <p>!<a href=\\\"b\\\">^a</a></p>\n * <p>!<a href=\\\"c\\\">^a</a></p>\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // To do: use a new field to do this, this is still needed for\n // `micromark-extension-gfm-footnote`, but the `label-start-link`\n // behavior isn’t.\n // Hidden footnotes hook.\n /* c8 ignore next 6 */\n if (code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs) {\n return nok(code);\n }\n self._labelStarts = self._labelStarts || [];\n self._labelStarts.push(labelImage);\n return ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * Token,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { labelEnd } from './label-end.js';\n\n/** @type {Construct} */\nexport const labelStartLink = {\n name: 'labelStartLink',\n resolveAll: labelEnd.resolveAll,\n tokenize: tokenizeLabelStartLink\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartLink(effects, ok, nok) {\n const self = this;\n /** @type {Token} */\n let labelLink;\n return start;\n\n /**\n * Start of label (link) start.\n *\n * ```markdown\n * > | a [b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"labelLink\");\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n labelLink = effects.exit(\"labelLink\");\n return after;\n }\n\n /** @type {State} */\n function after(code) {\n // To do: this isn’t needed in `micromark-extension-gfm-footnote`,\n // remove.\n // Hidden footnotes hook.\n /* c8 ignore next 6 */\n if (code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs) {\n return nok(code);\n }\n self._labelStarts = self._labelStarts || [];\n self._labelStarts.push(labelLink);\n return ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const lineEnding = {\n name: 'lineEnding',\n tokenize: tokenizeLineEnding\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLineEnding(effects, ok) {\n return start;\n\n /** @type {State} */\n function start(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, ok, \"linePrefix\");\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const thematicBreak = {\n name: 'thematicBreak',\n tokenize: tokenizeThematicBreak\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeThematicBreak(effects, ok, nok) {\n let size = 0;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of thematic break.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"thematicBreak\");\n // To do: parse indent like `markdown-rs`.\n return before(code);\n }\n\n /**\n * After optional whitespace, at marker.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n marker = code;\n return atBreak(code);\n }\n\n /**\n * After something, before something else.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === marker) {\n effects.enter(\"thematicBreakSequence\");\n return sequence(code);\n }\n if (size >= 3 && (code === null || markdownLineEnding(code))) {\n effects.exit(\"thematicBreak\");\n return ok(code);\n }\n return nok(code);\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function sequence(code) {\n if (code === marker) {\n effects.consume(code);\n size++;\n return sequence;\n }\n effects.exit(\"thematicBreakSequence\");\n return markdownSpace(code) ? factorySpace(effects, atBreak, \"whitespace\")(code) : atBreak(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * Exiter,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiDigit, markdownSpace } from 'micromark-util-character';\nimport { blankLine } from './blank-line.js';\nimport { thematicBreak } from './thematic-break.js';\n\n/** @type {Construct} */\nexport const list = {\n continuation: {\n tokenize: tokenizeListContinuation\n },\n exit: tokenizeListEnd,\n name: 'list',\n tokenize: tokenizeListStart\n};\n\n/** @type {Construct} */\nconst listItemPrefixWhitespaceConstruct = {\n partial: true,\n tokenize: tokenizeListItemPrefixWhitespace\n};\n\n/** @type {Construct} */\nconst indentConstruct = {\n partial: true,\n tokenize: tokenizeIndent\n};\n\n// To do: `markdown-rs` parses list items on their own and later stitches them\n// together.\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListStart(effects, ok, nok) {\n const self = this;\n const tail = self.events[self.events.length - 1];\n let initialSize = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n const kind = self.containerState.type || (code === 42 || code === 43 || code === 45 ? \"listUnordered\" : \"listOrdered\");\n if (kind === \"listUnordered\" ? !self.containerState.marker || code === self.containerState.marker : asciiDigit(code)) {\n if (!self.containerState.type) {\n self.containerState.type = kind;\n effects.enter(kind, {\n _container: true\n });\n }\n if (kind === \"listUnordered\") {\n effects.enter(\"listItemPrefix\");\n return code === 42 || code === 45 ? effects.check(thematicBreak, nok, atMarker)(code) : atMarker(code);\n }\n if (!self.interrupt || code === 49) {\n effects.enter(\"listItemPrefix\");\n effects.enter(\"listItemValue\");\n return inside(code);\n }\n }\n return nok(code);\n }\n\n /** @type {State} */\n function inside(code) {\n if (asciiDigit(code) && ++size < 10) {\n effects.consume(code);\n return inside;\n }\n if ((!self.interrupt || size < 2) && (self.containerState.marker ? code === self.containerState.marker : code === 41 || code === 46)) {\n effects.exit(\"listItemValue\");\n return atMarker(code);\n }\n return nok(code);\n }\n\n /**\n * @type {State}\n **/\n function atMarker(code) {\n effects.enter(\"listItemMarker\");\n effects.consume(code);\n effects.exit(\"listItemMarker\");\n self.containerState.marker = self.containerState.marker || code;\n return effects.check(blankLine,\n // Can’t be empty when interrupting.\n self.interrupt ? nok : onBlank, effects.attempt(listItemPrefixWhitespaceConstruct, endOfPrefix, otherPrefix));\n }\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.initialBlankLine = true;\n initialSize++;\n return endOfPrefix(code);\n }\n\n /** @type {State} */\n function otherPrefix(code) {\n if (markdownSpace(code)) {\n effects.enter(\"listItemPrefixWhitespace\");\n effects.consume(code);\n effects.exit(\"listItemPrefixWhitespace\");\n return endOfPrefix;\n }\n return nok(code);\n }\n\n /** @type {State} */\n function endOfPrefix(code) {\n self.containerState.size = initialSize + self.sliceSerialize(effects.exit(\"listItemPrefix\"), true).length;\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListContinuation(effects, ok, nok) {\n const self = this;\n self.containerState._closeFlow = undefined;\n return effects.check(blankLine, onBlank, notBlank);\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.furtherBlankLines = self.containerState.furtherBlankLines || self.containerState.initialBlankLine;\n\n // We have a blank line.\n // Still, try to consume at most the items size.\n return factorySpace(effects, ok, \"listItemIndent\", self.containerState.size + 1)(code);\n }\n\n /** @type {State} */\n function notBlank(code) {\n if (self.containerState.furtherBlankLines || !markdownSpace(code)) {\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return notInCurrentItem(code);\n }\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return effects.attempt(indentConstruct, ok, notInCurrentItem)(code);\n }\n\n /** @type {State} */\n function notInCurrentItem(code) {\n // While we do continue, we signal that the flow should be closed.\n self.containerState._closeFlow = true;\n // As we’re closing flow, we’re no longer interrupting.\n self.interrupt = undefined;\n // Always populated by defaults.\n\n return factorySpace(effects, effects.attempt(list, ok, nok), \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this;\n return factorySpace(effects, afterPrefix, \"listItemIndent\", self.containerState.size + 1);\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return tail && tail[1].type === \"listItemIndent\" && tail[2].sliceSerialize(tail[1], true).length === self.containerState.size ? ok(code) : nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Exiter}\n */\nfunction tokenizeListEnd(effects) {\n effects.exit(this.containerState.type);\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListItemPrefixWhitespace(effects, ok, nok) {\n const self = this;\n\n // Always populated by defaults.\n\n return factorySpace(effects, afterPrefix, \"listItemPrefixWhitespace\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4 + 1);\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return !markdownSpace(code) && tail && tail[1].type === \"listItemPrefixWhitespace\" ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { EditMap } from 'micromark-util-edit-map';\n/** @type {Construct} */\nexport const setextUnderline = {\n name: 'setextUnderline',\n resolveTo: resolveToSetextUnderline,\n tokenize: tokenizeSetextUnderline\n};\n\n/** @type {Resolver} */\nfunction resolveToSetextUnderline(events, context) {\n const editMap = new EditMap();\n let index = events.length;\n /** @type {number | undefined} */\n let content;\n /** @type {number | undefined} */\n let text;\n /** @type {number | undefined} */\n let definition;\n\n // Find the opening of the content.\n // It’ll always exist: we don’t tokenize if it isn’t there.\n while (index--) {\n if (events[index][0] === 'enter') {\n if (events[index][1].type === \"content\") {\n content = index;\n break;\n }\n if (events[index][1].type === \"paragraph\") {\n text = index;\n }\n }\n // Exit\n else {\n if (events[index][1].type === \"content\") {\n // Remove the content end (if needed we’ll add it later)\n editMap.add(index, 1, []);\n }\n if (!definition && events[index][1].type === \"definition\") {\n definition = index;\n }\n }\n }\n const heading = {\n type: \"setextHeading\",\n start: {\n ...events[content][1].start\n },\n end: {\n ...events[events.length - 1][1].end\n }\n };\n\n // Change the paragraph to setext heading text.\n events[text][1].type = \"setextHeadingText\";\n\n // If we have definitions in the content, we’ll keep on having content,\n // but we need move it.\n if (definition) {\n editMap.add(text, 0, [['enter', heading, context]]);\n editMap.add(definition + 1, 0, [['exit', events[content][1], context]]);\n events[content][1].end = {\n ...events[definition][1].end\n };\n } else {\n events[content][1] = heading;\n }\n\n // Add the heading exit at the end.\n editMap.add(events.length, 0, [['exit', heading, context]]);\n editMap.consume(events);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeSetextUnderline(effects, ok, nok) {\n const self = this;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * At start of heading (setext) underline.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n let index = self.events.length;\n /** @type {boolean | undefined} */\n let paragraph;\n // Find an opening.\n while (index--) {\n // Skip enter/exit of line ending, line prefix, and content.\n // We can now either have a definition or a paragraph.\n if (self.events[index][1].type !== \"lineEnding\" && self.events[index][1].type !== \"linePrefix\" && self.events[index][1].type !== \"content\") {\n paragraph = self.events[index][1].type === \"paragraph\";\n break;\n }\n }\n\n // To do: handle lazy/pierce like `markdown-rs`.\n // To do: parse indent like `markdown-rs`.\n if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) {\n effects.enter(\"setextHeadingLine\");\n marker = code;\n return before(code);\n }\n return nok(code);\n }\n\n /**\n * After optional whitespace, at `-` or `=`.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"setextHeadingLineSequence\");\n return inside(code);\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n effects.exit(\"setextHeadingLineSequence\");\n return markdownSpace(code) ? factorySpace(effects, after, \"lineSuffix\")(code) : after(code);\n }\n\n /**\n * After sequence, after optional whitespace.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"setextHeadingLine\");\n return ok(code);\n }\n return nok(code);\n }\n}","/**\n * @import {\n * InitialConstruct,\n * Initializer,\n * State,\n * TokenizeContext\n * } from 'micromark-util-types'\n */\n\nimport { blankLine, content } from 'micromark-core-commonmark';\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {InitialConstruct} */\nexport const flow = {\n tokenize: initializeFlow\n};\n\n/**\n * @this {TokenizeContext}\n * Self.\n * @type {Initializer}\n * Initializer.\n */\nfunction initializeFlow(effects) {\n const self = this;\n const initial = effects.attempt(\n // Try to parse a blank line.\n blankLine, atBlankEnding,\n // Try to parse initial flow (essentially, only code).\n effects.attempt(this.parser.constructs.flowInitial, afterConstruct, factorySpace(effects, effects.attempt(this.parser.constructs.flow, afterConstruct, effects.attempt(content, afterConstruct)), \"linePrefix\")));\n return initial;\n\n /** @type {State} */\n function atBlankEnding(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEndingBlank\");\n effects.consume(code);\n effects.exit(\"lineEndingBlank\");\n self.currentConstruct = undefined;\n return initial;\n }\n\n /** @type {State} */\n function afterConstruct(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n self.currentConstruct = undefined;\n return initial;\n }\n}","/**\n * @import {\n * Code,\n * InitialConstruct,\n * Initializer,\n * Resolver,\n * State,\n * TokenizeContext\n * } from 'micromark-util-types'\n */\n\nimport { EditMap } from 'micromark-util-edit-map';\nexport const resolver = {\n resolveAll: createResolver()\n};\nexport const string = initializeFactory('string');\nexport const text = initializeFactory('text');\n\n/**\n * @param {'string' | 'text'} field\n * Field.\n * @returns {InitialConstruct}\n * Construct.\n */\nfunction initializeFactory(field) {\n return {\n resolveAll: createResolver(field === 'text' ? resolveAllLineSuffixes : undefined),\n tokenize: initializeText\n };\n\n /**\n * @this {TokenizeContext}\n * Context.\n * @type {Initializer}\n */\n function initializeText(effects) {\n const self = this;\n const constructs = this.parser.constructs[field];\n const text = effects.attempt(constructs, start, notText);\n return start;\n\n /** @type {State} */\n function start(code) {\n return atBreak(code) ? text(code) : notText(code);\n }\n\n /** @type {State} */\n function notText(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"data\");\n effects.consume(code);\n return data;\n }\n\n /** @type {State} */\n function data(code) {\n if (atBreak(code)) {\n effects.exit(\"data\");\n return text(code);\n }\n\n // Data.\n effects.consume(code);\n return data;\n }\n\n /**\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether the code is a break.\n */\n function atBreak(code) {\n if (code === null) {\n return true;\n }\n const list = constructs[code];\n let index = -1;\n if (list) {\n // Always populated by defaults.\n\n while (++index < list.length) {\n const item = list[index];\n if (!item.previous || item.previous.call(self, self.previous)) {\n return true;\n }\n }\n }\n return false;\n }\n }\n}\n\n/**\n * @param {Resolver | undefined} [extraResolver]\n * Resolver.\n * @returns {Resolver}\n * Resolver.\n */\nfunction createResolver(extraResolver) {\n return resolveAllText;\n\n /** @type {Resolver} */\n function resolveAllText(events, context) {\n let index = -1;\n /** @type {number | undefined} */\n let enter;\n\n // A rather boring computation (to merge adjacent `data` events) which\n // improves mm performance by 29%.\n while (++index <= events.length) {\n if (enter === undefined) {\n if (events[index] && events[index][1].type === \"data\") {\n enter = index;\n index++;\n }\n } else if (!events[index] || events[index][1].type !== \"data\") {\n // Don’t do anything if there is one data token.\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n index = enter + 2;\n }\n enter = undefined;\n }\n }\n return extraResolver ? extraResolver(events, context) : events;\n }\n}\n\n/**\n * A rather ugly set of instructions which again looks at chunks in the input\n * stream.\n * The reason to do this here is that it is *much* faster to parse in reverse.\n * And that we can’t hook into `null` to split the line suffix before an EOF.\n * To do: figure out if we can make this into a clean utility, or even in core.\n * As it will be useful for GFMs literal autolink extension (and maybe even\n * tables?)\n *\n * @type {Resolver}\n */\nfunction resolveAllLineSuffixes(events, context) {\n const editMap = new EditMap();\n let eventIndex = 0; // Skip first.\n\n while (++eventIndex <= events.length) {\n if ((eventIndex === events.length || events[eventIndex][1].type === \"lineEnding\") && events[eventIndex - 1][1].type === \"data\") {\n const data = events[eventIndex - 1][1];\n const chunks = context.sliceStream(data);\n let index = chunks.length;\n let bufferIndex = -1;\n let size = 0;\n /** @type {boolean | undefined} */\n let tabs;\n while (index--) {\n const chunk = chunks[index];\n if (typeof chunk === 'string') {\n bufferIndex = chunk.length;\n while (chunk.charCodeAt(bufferIndex - 1) === 32) {\n size++;\n bufferIndex--;\n }\n if (bufferIndex) {\n break;\n }\n bufferIndex = -1;\n }\n // Number\n else if (chunk === -2) {\n tabs = true;\n size++;\n } else if (chunk === -1) {\n // Empty\n } else {\n // Replacement character, exit.\n index++;\n break;\n }\n }\n\n // Allow final trailing whitespace.\n if (context._contentTypeTextTrailing && eventIndex === events.length) {\n size = 0;\n }\n if (size) {\n const token = {\n type: eventIndex === events.length || tabs || size < 2 ? \"lineSuffix\" : \"hardBreakTrailing\",\n start: {\n _bufferIndex: index ? bufferIndex : data.start._bufferIndex + bufferIndex,\n _index: data.start._index + index,\n line: data.end.line,\n column: data.end.column - size,\n offset: data.end.offset - size\n },\n end: {\n ...data.end\n }\n };\n data.end = {\n ...token.start\n };\n if (data.start.offset === data.end.offset) {\n Object.assign(data, token);\n } else {\n editMap.add(eventIndex, 0, [['enter', token, context], ['exit', token, context]]);\n }\n }\n eventIndex++;\n }\n }\n editMap.consume(events);\n return events;\n}","/**\n * @import {Extension} from 'micromark-util-types'\n */\n\nimport { attention, autolink, blockQuote, characterEscape, characterReference, codeFenced, codeIndented, codeText, definition, hardBreakEscape, headingAtx, htmlFlow, htmlText, labelEnd, labelStartImage, labelStartLink, lineEnding, list, setextUnderline, thematicBreak } from 'micromark-core-commonmark';\nimport { resolver as resolveText } from './initialize/text.js';\n\n/** @satisfies {Extension['document']} */\nexport const document = {\n [42]: list,\n [43]: list,\n [45]: list,\n [48]: list,\n [49]: list,\n [50]: list,\n [51]: list,\n [52]: list,\n [53]: list,\n [54]: list,\n [55]: list,\n [56]: list,\n [57]: list,\n [62]: blockQuote\n};\n\n/** @satisfies {Extension['contentInitial']} */\nexport const contentInitial = {\n [91]: definition\n};\n\n/** @satisfies {Extension['flowInitial']} */\nexport const flowInitial = {\n [-2]: codeIndented,\n [-1]: codeIndented,\n [32]: codeIndented\n};\n\n/** @satisfies {Extension['flow']} */\nexport const flow = {\n [35]: headingAtx,\n [42]: thematicBreak,\n [45]: [setextUnderline, thematicBreak],\n [60]: htmlFlow,\n [61]: setextUnderline,\n [95]: thematicBreak,\n [96]: codeFenced,\n [126]: codeFenced\n};\n\n/** @satisfies {Extension['string']} */\nexport const string = {\n [38]: characterReference,\n [92]: characterEscape\n};\n\n/** @satisfies {Extension['text']} */\nexport const text = {\n [-5]: lineEnding,\n [-4]: lineEnding,\n [-3]: lineEnding,\n [33]: labelStartImage,\n [38]: characterReference,\n [42]: attention,\n [60]: [autolink, htmlText],\n [91]: labelStartLink,\n [92]: [hardBreakEscape, characterEscape],\n [93]: labelEnd,\n [95]: attention,\n [96]: codeText\n};\n\n/** @satisfies {Extension['insideSpan']} */\nexport const insideSpan = {\n null: [attention, resolveText]\n};\n\n/** @satisfies {Extension['attentionMarkers']} */\nexport const attentionMarkers = {\n null: [42, 95]\n};\n\n/** @satisfies {Extension['disable']} */\nexport const disable = {\n null: []\n};","/**\n * @import {\n * Chunk,\n * Code,\n * ConstructRecord,\n * Construct,\n * Effects,\n * InitialConstruct,\n * ParseContext,\n * Point,\n * State,\n * TokenizeContext,\n * Token\n * } from 'micromark-util-types'\n */\n\n/**\n * @callback Restore\n * Restore the state.\n * @returns {undefined}\n * Nothing.\n *\n * @typedef Info\n * Info.\n * @property {Restore} restore\n * Restore.\n * @property {number} from\n * From.\n *\n * @callback ReturnHandle\n * Handle a successful run.\n * @param {Construct} construct\n * Construct.\n * @param {Info} info\n * Info.\n * @returns {undefined}\n * Nothing.\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/**\n * Create a tokenizer.\n * Tokenizers deal with one type of data (e.g., containers, flow, text).\n * The parser is the object dealing with it all.\n * `initialize` works like other constructs, except that only its `tokenize`\n * function is used, in which case it doesn’t receive an `ok` or `nok`.\n * `from` can be given to set the point before the first character, although\n * when further lines are indented, they must be set with `defineSkip`.\n *\n * @param {ParseContext} parser\n * Parser.\n * @param {InitialConstruct} initialize\n * Construct.\n * @param {Omit<Point, '_bufferIndex' | '_index'> | undefined} [from]\n * Point (optional).\n * @returns {TokenizeContext}\n * Context.\n */\nexport function createTokenizer(parser, initialize, from) {\n /** @type {Point} */\n let point = {\n _bufferIndex: -1,\n _index: 0,\n line: from && from.line || 1,\n column: from && from.column || 1,\n offset: from && from.offset || 0\n };\n /** @type {Record<string, number>} */\n const columnStart = {};\n /** @type {Array<Construct>} */\n const resolveAllConstructs = [];\n /** @type {Array<Chunk>} */\n let chunks = [];\n /** @type {Array<Token>} */\n let stack = [];\n /** @type {boolean | undefined} */\n let consumed = true;\n\n /**\n * Tools used for tokenizing.\n *\n * @type {Effects}\n */\n const effects = {\n attempt: constructFactory(onsuccessfulconstruct),\n check: constructFactory(onsuccessfulcheck),\n consume,\n enter,\n exit,\n interrupt: constructFactory(onsuccessfulcheck, {\n interrupt: true\n })\n };\n\n /**\n * State and tools for resolving and serializing.\n *\n * @type {TokenizeContext}\n */\n const context = {\n code: null,\n containerState: {},\n defineSkip,\n events: [],\n now,\n parser,\n previous: null,\n sliceSerialize,\n sliceStream,\n write\n };\n\n /**\n * The state function.\n *\n * @type {State | undefined}\n */\n let state = initialize.tokenize.call(context, effects);\n\n /**\n * Track which character we expect to be consumed, to catch bugs.\n *\n * @type {Code}\n */\n let expectedCode;\n if (initialize.resolveAll) {\n resolveAllConstructs.push(initialize);\n }\n return context;\n\n /** @type {TokenizeContext['write']} */\n function write(slice) {\n chunks = push(chunks, slice);\n main();\n\n // Exit if we’re not done, resolve might change stuff.\n if (chunks[chunks.length - 1] !== null) {\n return [];\n }\n addResult(initialize, 0);\n\n // Otherwise, resolve, and exit.\n context.events = resolveAll(resolveAllConstructs, context.events, context);\n return context.events;\n }\n\n //\n // Tools.\n //\n\n /** @type {TokenizeContext['sliceSerialize']} */\n function sliceSerialize(token, expandTabs) {\n return serializeChunks(sliceStream(token), expandTabs);\n }\n\n /** @type {TokenizeContext['sliceStream']} */\n function sliceStream(token) {\n return sliceChunks(chunks, token);\n }\n\n /** @type {TokenizeContext['now']} */\n function now() {\n // This is a hot path, so we clone manually instead of `Object.assign({}, point)`\n const {\n _bufferIndex,\n _index,\n line,\n column,\n offset\n } = point;\n return {\n _bufferIndex,\n _index,\n line,\n column,\n offset\n };\n }\n\n /** @type {TokenizeContext['defineSkip']} */\n function defineSkip(value) {\n columnStart[value.line] = value.column;\n accountForPotentialSkip();\n }\n\n //\n // State management.\n //\n\n /**\n * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by\n * `consume`).\n * Here is where we walk through the chunks, which either include strings of\n * several characters, or numerical character codes.\n * The reason to do this in a loop instead of a call is so the stack can\n * drain.\n *\n * @returns {undefined}\n * Nothing.\n */\n function main() {\n while (point._index < chunks.length) {\n const chunk = chunks[point._index];\n\n // If we’re in a buffer chunk, loop through it.\n if (typeof chunk === 'string') {\n const chunkIndex = point._index;\n if (point._bufferIndex < 0) {\n point._bufferIndex = 0;\n }\n while (point._index === chunkIndex && point._bufferIndex < chunk.length) {\n go(chunk.charCodeAt(point._bufferIndex));\n }\n } else {\n go(chunk);\n }\n }\n }\n\n /**\n * Deal with one code.\n *\n * @param {Code} code\n * Code.\n * @returns {undefined}\n * Nothing.\n */\n function go(code) {\n consumed = undefined;\n expectedCode = code;\n state = state(code);\n }\n\n /** @type {Effects['consume']} */\n function consume(code) {\n if (markdownLineEnding(code)) {\n point.line++;\n point.column = 1;\n point.offset += code === -3 ? 2 : 1;\n accountForPotentialSkip();\n } else if (code !== -1) {\n point.column++;\n point.offset++;\n }\n\n // Not in a string chunk.\n if (point._bufferIndex < 0) {\n point._index++;\n } else {\n point._bufferIndex++;\n\n // At end of string chunk.\n if (point._bufferIndex ===\n // Points w/ non-negative `_bufferIndex` reference\n // strings.\n /** @type {string} */\n chunks[point._index].length) {\n point._bufferIndex = -1;\n point._index++;\n }\n }\n\n // Expose the previous character.\n context.previous = code;\n\n // Mark as consumed.\n consumed = true;\n }\n\n /** @type {Effects['enter']} */\n function enter(type, fields) {\n /** @type {Token} */\n // @ts-expect-error Patch instead of assign required fields to help GC.\n const token = fields || {};\n token.type = type;\n token.start = now();\n context.events.push(['enter', token, context]);\n stack.push(token);\n return token;\n }\n\n /** @type {Effects['exit']} */\n function exit(type) {\n const token = stack.pop();\n token.end = now();\n context.events.push(['exit', token, context]);\n return token;\n }\n\n /**\n * Use results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulconstruct(construct, info) {\n addResult(construct, info.from);\n }\n\n /**\n * Discard results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulcheck(_, info) {\n info.restore();\n }\n\n /**\n * Factory to attempt/check/interrupt.\n *\n * @param {ReturnHandle} onreturn\n * Callback.\n * @param {{interrupt?: boolean | undefined} | undefined} [fields]\n * Fields.\n */\n function constructFactory(onreturn, fields) {\n return hook;\n\n /**\n * Handle either an object mapping codes to constructs, a list of\n * constructs, or a single construct.\n *\n * @param {Array<Construct> | ConstructRecord | Construct} constructs\n * Constructs.\n * @param {State} returnState\n * State.\n * @param {State | undefined} [bogusState]\n * State.\n * @returns {State}\n * State.\n */\n function hook(constructs, returnState, bogusState) {\n /** @type {ReadonlyArray<Construct>} */\n let listOfConstructs;\n /** @type {number} */\n let constructIndex;\n /** @type {Construct} */\n let currentConstruct;\n /** @type {Info} */\n let info;\n return Array.isArray(constructs) ? /* c8 ignore next 1 */\n handleListOfConstructs(constructs) : 'tokenize' in constructs ?\n // Looks like a construct.\n handleListOfConstructs([(/** @type {Construct} */constructs)]) : handleMapOfConstructs(constructs);\n\n /**\n * Handle a list of construct.\n *\n * @param {ConstructRecord} map\n * Constructs.\n * @returns {State}\n * State.\n */\n function handleMapOfConstructs(map) {\n return start;\n\n /** @type {State} */\n function start(code) {\n const left = code !== null && map[code];\n const all = code !== null && map.null;\n const list = [\n // To do: add more extension tests.\n /* c8 ignore next 2 */\n ...(Array.isArray(left) ? left : left ? [left] : []), ...(Array.isArray(all) ? all : all ? [all] : [])];\n return handleListOfConstructs(list)(code);\n }\n }\n\n /**\n * Handle a list of construct.\n *\n * @param {ReadonlyArray<Construct>} list\n * Constructs.\n * @returns {State}\n * State.\n */\n function handleListOfConstructs(list) {\n listOfConstructs = list;\n constructIndex = 0;\n if (list.length === 0) {\n return bogusState;\n }\n return handleConstruct(list[constructIndex]);\n }\n\n /**\n * Handle a single construct.\n *\n * @param {Construct} construct\n * Construct.\n * @returns {State}\n * State.\n */\n function handleConstruct(construct) {\n return start;\n\n /** @type {State} */\n function start(code) {\n // To do: not needed to store if there is no bogus state, probably?\n // Currently doesn’t work because `inspect` in document does a check\n // w/o a bogus, which doesn’t make sense. But it does seem to help perf\n // by not storing.\n info = store();\n currentConstruct = construct;\n if (!construct.partial) {\n context.currentConstruct = construct;\n }\n\n // Always populated by defaults.\n\n if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) {\n return nok(code);\n }\n return construct.tokenize.call(\n // If we do have fields, create an object w/ `context` as its\n // prototype.\n // This allows a “live binding”, which is needed for `interrupt`.\n fields ? Object.assign(Object.create(context), fields) : context, effects, ok, nok)(code);\n }\n }\n\n /** @type {State} */\n function ok(code) {\n consumed = true;\n onreturn(currentConstruct, info);\n return returnState;\n }\n\n /** @type {State} */\n function nok(code) {\n consumed = true;\n info.restore();\n if (++constructIndex < listOfConstructs.length) {\n return handleConstruct(listOfConstructs[constructIndex]);\n }\n return bogusState;\n }\n }\n }\n\n /**\n * @param {Construct} construct\n * Construct.\n * @param {number} from\n * From.\n * @returns {undefined}\n * Nothing.\n */\n function addResult(construct, from) {\n if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {\n resolveAllConstructs.push(construct);\n }\n if (construct.resolve) {\n splice(context.events, from, context.events.length - from, construct.resolve(context.events.slice(from), context));\n }\n if (construct.resolveTo) {\n context.events = construct.resolveTo(context.events, context);\n }\n }\n\n /**\n * Store state.\n *\n * @returns {Info}\n * Info.\n */\n function store() {\n const startPoint = now();\n const startPrevious = context.previous;\n const startCurrentConstruct = context.currentConstruct;\n const startEventsIndex = context.events.length;\n const startStack = Array.from(stack);\n return {\n from: startEventsIndex,\n restore\n };\n\n /**\n * Restore state.\n *\n * @returns {undefined}\n * Nothing.\n */\n function restore() {\n point = startPoint;\n context.previous = startPrevious;\n context.currentConstruct = startCurrentConstruct;\n context.events.length = startEventsIndex;\n stack = startStack;\n accountForPotentialSkip();\n }\n }\n\n /**\n * Move the current point a bit forward in the line when it’s on a column\n * skip.\n *\n * @returns {undefined}\n * Nothing.\n */\n function accountForPotentialSkip() {\n if (point.line in columnStart && point.column < 2) {\n point.column = columnStart[point.line];\n point.offset += columnStart[point.line] - 1;\n }\n }\n}\n\n/**\n * Get the chunks from a slice of chunks in the range of a token.\n *\n * @param {ReadonlyArray<Chunk>} chunks\n * Chunks.\n * @param {Pick<Token, 'end' | 'start'>} token\n * Token.\n * @returns {Array<Chunk>}\n * Chunks.\n */\nfunction sliceChunks(chunks, token) {\n const startIndex = token.start._index;\n const startBufferIndex = token.start._bufferIndex;\n const endIndex = token.end._index;\n const endBufferIndex = token.end._bufferIndex;\n /** @type {Array<Chunk>} */\n let view;\n if (startIndex === endIndex) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)];\n } else {\n view = chunks.slice(startIndex, endIndex);\n if (startBufferIndex > -1) {\n const head = view[0];\n if (typeof head === 'string') {\n view[0] = head.slice(startBufferIndex);\n /* c8 ignore next 4 -- used to be used, no longer */\n } else {\n view.shift();\n }\n }\n if (endBufferIndex > 0) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view.push(chunks[endIndex].slice(0, endBufferIndex));\n }\n }\n return view;\n}\n\n/**\n * Get the string value of a slice of chunks.\n *\n * @param {ReadonlyArray<Chunk>} chunks\n * Chunks.\n * @param {boolean | undefined} [expandTabs=false]\n * Whether to expand tabs (default: `false`).\n * @returns {string}\n * Result.\n */\nfunction serializeChunks(chunks, expandTabs) {\n let index = -1;\n /** @type {Array<string>} */\n const result = [];\n /** @type {boolean | undefined} */\n let atTab;\n while (++index < chunks.length) {\n const chunk = chunks[index];\n /** @type {string} */\n let value;\n if (typeof chunk === 'string') {\n value = chunk;\n } else {\n switch (chunk) {\n case -5:\n {\n value = \"\\r\";\n break;\n }\n case -4:\n {\n value = \"\\n\";\n break;\n }\n case -3:\n {\n value = \"\\r\" + \"\\n\";\n break;\n }\n case -2:\n {\n value = expandTabs ? \" \" : \"\\t\";\n break;\n }\n case -1:\n {\n if (!expandTabs && atTab) {\n continue;\n }\n value = \" \";\n break;\n }\n default:\n {\n // Currently only replacement character.\n value = String.fromCharCode(chunk);\n }\n }\n }\n atTab = chunk === -2;\n result.push(value);\n }\n return result.join('');\n}","/**\n * @import {\n * Create,\n * FullNormalizedExtension,\n * InitialConstruct,\n * ParseContext,\n * ParseOptions\n * } from 'micromark-util-types'\n */\n\nimport { combineExtensions } from 'micromark-util-combine-extensions';\nimport { content } from './initialize/content.js';\nimport { document } from './initialize/document.js';\nimport { flow } from './initialize/flow.js';\nimport { string, text } from './initialize/text.js';\nimport * as defaultConstructs from './constructs.js';\nimport { createTokenizer } from './create-tokenizer.js';\n\n/**\n * @param {ParseOptions | null | undefined} [options]\n * Configuration (optional).\n * @returns {ParseContext}\n * Parser.\n */\nexport function parse(options) {\n const settings = options || {};\n const constructs = /** @type {FullNormalizedExtension} */\n combineExtensions([defaultConstructs, ...(settings.extensions || [])]);\n\n /** @type {ParseContext} */\n const parser = {\n constructs,\n content: create(content),\n defined: [],\n document: create(document),\n flow: create(flow),\n lazy: {},\n string: create(string),\n text: create(text)\n };\n return parser;\n\n /**\n * @param {InitialConstruct} initial\n * Construct to start with.\n * @returns {Create}\n * Create a tokenizer.\n */\n function create(initial) {\n return creator;\n /** @type {Create} */\n function creator(from) {\n return createTokenizer(parser, initial, from);\n }\n }\n}","/**\n * @import {Event} from 'micromark-util-types'\n */\n\nimport { subtokenize } from 'micromark-util-subtokenize';\n\n/**\n * @param {Array<Event>} events\n * Events.\n * @returns {Array<Event>}\n * Events.\n */\nexport function postprocess(events) {\n while (!subtokenize(events)) {\n // Empty\n }\n return events;\n}","/**\n * @import {Chunk, Code, Encoding, Value} from 'micromark-util-types'\n */\n\n/**\n * @callback Preprocessor\n * Preprocess a value.\n * @param {Value} value\n * Value.\n * @param {Encoding | null | undefined} [encoding]\n * Encoding when `value` is a typed array (optional).\n * @param {boolean | null | undefined} [end=false]\n * Whether this is the last chunk (default: `false`).\n * @returns {Array<Chunk>}\n * Chunks.\n */\n\nconst search = /[\\0\\t\\n\\r]/g;\n\n/**\n * @returns {Preprocessor}\n * Preprocess a value.\n */\nexport function preprocess() {\n let column = 1;\n let buffer = '';\n /** @type {boolean | undefined} */\n let start = true;\n /** @type {boolean | undefined} */\n let atCarriageReturn;\n return preprocessor;\n\n /** @type {Preprocessor} */\n // eslint-disable-next-line complexity\n function preprocessor(value, encoding, end) {\n value = buffer + (typeof value === 'string' ? value.toString() : new TextDecoder(encoding || undefined).decode(value));\n\n /** @type {Array<Chunk>} */\n const chunks = [];\n let startPosition = 0;\n buffer = '';\n if (start) {\n // To do: `markdown-rs` actually parses BOMs (byte order mark).\n if (value.charCodeAt(0) === 65279) {\n startPosition++;\n }\n start = undefined;\n }\n while (startPosition < value.length) {\n search.lastIndex = startPosition;\n const match = search.exec(value);\n const endPosition = match && match.index !== undefined ? match.index : value.length;\n const code = value.charCodeAt(endPosition);\n if (!match) {\n buffer = value.slice(startPosition);\n break;\n }\n if (code === 10 && startPosition === endPosition && atCarriageReturn) {\n chunks.push(-3);\n atCarriageReturn = undefined;\n } else {\n if (atCarriageReturn) {\n chunks.push(-5);\n atCarriageReturn = undefined;\n }\n if (startPosition < endPosition) {\n chunks.push(value.slice(startPosition, endPosition));\n column += endPosition - startPosition;\n }\n switch (code) {\n case 0:\n {\n chunks.push(65533);\n column++;\n break;\n }\n case 9:\n {\n const next = Math.ceil(column / 4) * 4;\n chunks.push(-2);\n while (column++ < next) {\n chunks.push(-1);\n }\n break;\n }\n case 10:\n {\n chunks.push(-4);\n column = 1;\n break;\n }\n default:\n {\n atCarriageReturn = true;\n column = 1;\n }\n }\n }\n startPosition = endPosition + 1;\n }\n if (end) {\n if (atCarriageReturn) {\n chunks.push(-5);\n }\n if (buffer) {\n chunks.push(buffer);\n }\n chunks.push(null);\n }\n return chunks;\n }\n}","import { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nconst characterEscapeOrReference = /\\\\([!-/:-@[-`{-~])|&(#(?:\\d{1,7}|x[\\da-f]{1,6})|[\\da-z]{1,31});/gi;\n\n/**\n * Decode markdown strings (which occur in places such as fenced code info\n * strings, destinations, labels, and titles).\n *\n * The “string” content type allows character escapes and -references.\n * This decodes those.\n *\n * @param {string} value\n * Value to decode.\n * @returns {string}\n * Decoded value.\n */\nexport function decodeString(value) {\n return value.replace(characterEscapeOrReference, decode);\n}\n\n/**\n * @param {string} $0\n * Match.\n * @param {string} $1\n * Character escape.\n * @param {string} $2\n * Character reference.\n * @returns {string}\n * Decoded value\n */\nfunction decode($0, $1, $2) {\n if ($1) {\n // Escape.\n return $1;\n }\n\n // Reference.\n const head = $2.charCodeAt(0);\n if (head === 35) {\n const head = $2.charCodeAt(1);\n const hex = head === 120 || head === 88;\n return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10);\n }\n return decodeNamedCharacterReference($2) || $0;\n}","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n * @typedef {import('unist').Position} Position\n */\n\n/**\n * @typedef NodeLike\n * @property {string} type\n * @property {PositionLike | null | undefined} [position]\n *\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n */\n\n/**\n * Serialize the positional info of a point, position (start and end points),\n * or node.\n *\n * @param {Node | NodeLike | Point | PointLike | Position | PositionLike | null | undefined} [value]\n * Node, position, or point.\n * @returns {string}\n * Pretty printed positional info of a node (`string`).\n *\n * In the format of a range `ls:cs-le:ce` (when given `node` or `position`)\n * or a point `l:c` (when given `point`), where `l` stands for line, `c` for\n * column, `s` for `start`, and `e` for end.\n * An empty string (`''`) is returned if the given value is neither `node`,\n * `position`, nor `point`.\n */\nexport function stringifyPosition(value) {\n // Nothing.\n if (!value || typeof value !== 'object') {\n return ''\n }\n\n // Node.\n if ('position' in value || 'type' in value) {\n return position(value.position)\n }\n\n // Position.\n if ('start' in value || 'end' in value) {\n return position(value)\n }\n\n // Point.\n if ('line' in value || 'column' in value) {\n return point(value)\n }\n\n // ?\n return ''\n}\n\n/**\n * @param {Point | PointLike | null | undefined} point\n * @returns {string}\n */\nfunction point(point) {\n return index(point && point.line) + ':' + index(point && point.column)\n}\n\n/**\n * @param {Position | PositionLike | null | undefined} pos\n * @returns {string}\n */\nfunction position(pos) {\n return point(pos && pos.start) + '-' + point(pos && pos.end)\n}\n\n/**\n * @param {number | null | undefined} value\n * @returns {number}\n */\nfunction index(value) {\n return value && typeof value === 'number' ? value : 1\n}\n","/**\n * @import {\n * Break,\n * Blockquote,\n * Code,\n * Definition,\n * Emphasis,\n * Heading,\n * Html,\n * Image,\n * InlineCode,\n * Link,\n * ListItem,\n * List,\n * Nodes,\n * Paragraph,\n * PhrasingContent,\n * ReferenceType,\n * Root,\n * Strong,\n * Text,\n * ThematicBreak\n * } from 'mdast'\n * @import {\n * Encoding,\n * Event,\n * Token,\n * Value\n * } from 'micromark-util-types'\n * @import {Point} from 'unist'\n * @import {\n * CompileContext,\n * CompileData,\n * Config,\n * Extension,\n * Handle,\n * OnEnterError,\n * Options\n * } from './types.js'\n */\n\nimport { toString } from 'mdast-util-to-string';\nimport { parse, postprocess, preprocess } from 'micromark';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nimport { decodeString } from 'micromark-util-decode-string';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { stringifyPosition } from 'unist-util-stringify-position';\nconst own = {}.hasOwnProperty;\n\n/**\n * Turn markdown into a syntax tree.\n *\n * @overload\n * @param {Value} value\n * @param {Encoding | null | undefined} [encoding]\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @overload\n * @param {Value} value\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @param {Value} value\n * Markdown to parse.\n * @param {Encoding | Options | null | undefined} [encoding]\n * Character encoding for when `value` is `Buffer`.\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {Root}\n * mdast tree.\n */\nexport function fromMarkdown(value, encoding, options) {\n if (encoding && typeof encoding === 'object') {\n options = encoding;\n encoding = undefined;\n }\n return compiler(options)(postprocess(parse(options).document().write(preprocess()(value, encoding, true))));\n}\n\n/**\n * Note this compiler only understand complete buffering, not streaming.\n *\n * @param {Options | null | undefined} [options]\n */\nfunction compiler(options) {\n /** @type {Config} */\n const config = {\n afterExit: [],\n beforeEnter: [],\n transforms: [],\n canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],\n enter: {\n autolink: opener(link),\n autolinkProtocol: onenterdata,\n autolinkEmail: onenterdata,\n atxHeading: opener(heading),\n blockQuote: opener(blockQuote),\n characterEscape: onenterdata,\n characterReference: onenterdata,\n codeFenced: opener(codeFlow),\n codeFencedFenceInfo: buffer,\n codeFencedFenceMeta: buffer,\n codeIndented: opener(codeFlow, buffer),\n codeText: opener(codeText, buffer),\n codeTextData: onenterdata,\n data: onenterdata,\n codeFlowValue: onenterdata,\n definition: opener(definition),\n definitionDestinationString: buffer,\n definitionLabelString: buffer,\n definitionTitleString: buffer,\n emphasis: opener(emphasis),\n hardBreakEscape: opener(hardBreak),\n hardBreakTrailing: opener(hardBreak),\n htmlFlow: opener(html, buffer),\n htmlFlowData: onenterdata,\n htmlText: opener(html, buffer),\n htmlTextData: onenterdata,\n image: opener(image),\n label: buffer,\n link: opener(link),\n listItem: opener(listItem),\n listItemValue: onenterlistitemvalue,\n listOrdered: opener(list, onenterlistordered),\n listUnordered: opener(list),\n paragraph: opener(paragraph),\n reference: onenterreference,\n referenceString: buffer,\n resourceDestinationString: buffer,\n resourceTitleString: buffer,\n setextHeading: opener(heading),\n strong: opener(strong),\n thematicBreak: opener(thematicBreak)\n },\n exit: {\n atxHeading: closer(),\n atxHeadingSequence: onexitatxheadingsequence,\n autolink: closer(),\n autolinkEmail: onexitautolinkemail,\n autolinkProtocol: onexitautolinkprotocol,\n blockQuote: closer(),\n characterEscapeValue: onexitdata,\n characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,\n characterReferenceMarkerNumeric: onexitcharacterreferencemarker,\n characterReferenceValue: onexitcharacterreferencevalue,\n characterReference: onexitcharacterreference,\n codeFenced: closer(onexitcodefenced),\n codeFencedFence: onexitcodefencedfence,\n codeFencedFenceInfo: onexitcodefencedfenceinfo,\n codeFencedFenceMeta: onexitcodefencedfencemeta,\n codeFlowValue: onexitdata,\n codeIndented: closer(onexitcodeindented),\n codeText: closer(onexitcodetext),\n codeTextData: onexitdata,\n data: onexitdata,\n definition: closer(),\n definitionDestinationString: onexitdefinitiondestinationstring,\n definitionLabelString: onexitdefinitionlabelstring,\n definitionTitleString: onexitdefinitiontitlestring,\n emphasis: closer(),\n hardBreakEscape: closer(onexithardbreak),\n hardBreakTrailing: closer(onexithardbreak),\n htmlFlow: closer(onexithtmlflow),\n htmlFlowData: onexitdata,\n htmlText: closer(onexithtmltext),\n htmlTextData: onexitdata,\n image: closer(onexitimage),\n label: onexitlabel,\n labelText: onexitlabeltext,\n lineEnding: onexitlineending,\n link: closer(onexitlink),\n listItem: closer(),\n listOrdered: closer(),\n listUnordered: closer(),\n paragraph: closer(),\n referenceString: onexitreferencestring,\n resourceDestinationString: onexitresourcedestinationstring,\n resourceTitleString: onexitresourcetitlestring,\n resource: onexitresource,\n setextHeading: closer(onexitsetextheading),\n setextHeadingLineSequence: onexitsetextheadinglinesequence,\n setextHeadingText: onexitsetextheadingtext,\n strong: closer(),\n thematicBreak: closer()\n }\n };\n configure(config, (options || {}).mdastExtensions || []);\n\n /** @type {CompileData} */\n const data = {};\n return compile;\n\n /**\n * Turn micromark events into an mdast tree.\n *\n * @param {Array<Event>} events\n * Events.\n * @returns {Root}\n * mdast tree.\n */\n function compile(events) {\n /** @type {Root} */\n let tree = {\n type: 'root',\n children: [],\n position: undefined\n };\n /** @type {Omit<CompileContext, 'sliceSerialize'>} */\n const context = {\n stack: [tree],\n tokenStack: [],\n config,\n enter,\n exit,\n buffer,\n resume,\n data\n };\n /** @type {Array<number>} */\n const listStack = [];\n /** @type {Array<Event>} */\n const prepared = [];\n let index = -1;\n\n // Add `listItem` tokens and infer spread.\n // Each list is prepared while it is last in `prepared`, so nothing shifts.\n while (++index < events.length) {\n prepared.push(events[index]);\n if (events[index][1].type === \"listOrdered\" || events[index][1].type === \"listUnordered\") {\n if (events[index][0] === 'enter') {\n listStack.push(prepared.length - 1);\n } else {\n const tail = listStack.pop();\n prepareList(prepared, tail);\n }\n }\n }\n events = prepared;\n index = -1;\n while (++index < events.length) {\n const handler = config[events[index][0]];\n if (events[index][0] === 'enter' && config.beforeEnter.length > 0) {\n callListeners(config.beforeEnter, {\n ...context,\n sliceSerialize: events[index][2].sliceSerialize\n }, events[index][1]);\n }\n if (own.call(handler, events[index][1].type)) {\n // Note: spread first, V8 has optimizations for object shape cloning.\n handler[events[index][1].type].call({\n ...context,\n sliceSerialize: events[index][2].sliceSerialize\n }, events[index][1]);\n }\n if (events[index][0] === 'exit' && config.afterExit.length > 0) {\n callListeners(config.afterExit, {\n ...context,\n sliceSerialize: events[index][2].sliceSerialize\n }, events[index][1]);\n }\n }\n\n // Handle tokens still being open.\n if (context.tokenStack.length > 0) {\n const tail = context.tokenStack[context.tokenStack.length - 1];\n const handler = tail[1] || defaultOnError;\n handler.call(context, undefined, tail[0]);\n }\n\n // Figure out `root` position.\n tree.position = {\n start: point(events.length > 0 ? events[0][1].start : {\n line: 1,\n column: 1,\n offset: 0\n }),\n end: point(events.length > 0 ? events[events.length - 2][1].end : {\n line: 1,\n column: 1,\n offset: 0\n })\n };\n\n // Call transforms.\n index = -1;\n while (++index < config.transforms.length) {\n tree = config.transforms[index](tree) || tree;\n }\n return tree;\n }\n\n /**\n * @param {Array<Handle>} listeners\n * Listeners.\n * @param {CompileContext} context\n * Context.\n * @param {Token} token\n * Token.\n * @returns {undefined}\n * Nothing.\n */\n function callListeners(listeners, context, token) {\n let index = -1;\n while (++index < listeners.length) {\n listeners[index].call(context, token);\n }\n }\n\n /**\n * @param {Array<Event>} events\n * Events, ending with the list to prepare.\n * @param {number} start\n * Index of the list enter.\n * @returns {undefined}\n */\n function prepareList(events, start) {\n const end = events.length - 1;\n let index = start - 1;\n let containerBalance = -1;\n let listSpread = false;\n /** @type {Token | undefined} */\n let listItem;\n /** @type {number | undefined} */\n let lineIndex;\n /** @type {number | undefined} */\n let firstBlankLineIndex;\n /** @type {boolean | undefined} */\n let atMarker;\n /**\n * `listItem` events to insert before the event at `at`, in walk order.\n * Merged in after the walk, as inserting while walking would shift the\n * rest of the list once per item.\n * @type {Array<{at: number, event: Event}>}\n */\n const insertions = [];\n while (++index <= end) {\n const event = events[index];\n switch (event[1].type) {\n case \"listUnordered\":\n case \"listOrdered\":\n case \"blockQuote\":\n {\n if (event[0] === 'enter') {\n containerBalance++;\n } else {\n containerBalance--;\n }\n atMarker = undefined;\n break;\n }\n case \"lineEndingBlank\":\n {\n if (event[0] === 'enter') {\n if (listItem && !atMarker && !containerBalance && !firstBlankLineIndex) {\n firstBlankLineIndex = index;\n }\n atMarker = undefined;\n }\n break;\n }\n case \"linePrefix\":\n case \"listItemValue\":\n case \"listItemMarker\":\n case \"listItemPrefix\":\n case \"listItemPrefixWhitespace\":\n {\n // Empty.\n\n break;\n }\n default:\n {\n atMarker = undefined;\n }\n }\n if (!containerBalance && event[0] === 'enter' && event[1].type === \"listItemPrefix\" || containerBalance === -1 && event[0] === 'exit' && (event[1].type === \"listUnordered\" || event[1].type === \"listOrdered\")) {\n if (listItem) {\n let tailIndex = index;\n lineIndex = undefined;\n while (tailIndex--) {\n const tailEvent = events[tailIndex];\n if (tailEvent[1].type === \"lineEnding\" || tailEvent[1].type === \"lineEndingBlank\") {\n if (tailEvent[0] === 'exit') continue;\n if (lineIndex) {\n events[lineIndex][1].type = \"lineEndingBlank\";\n listSpread = true;\n }\n tailEvent[1].type = \"lineEnding\";\n lineIndex = tailIndex;\n } else if (tailEvent[1].type === \"linePrefix\" || tailEvent[1].type === \"blockQuotePrefix\" || tailEvent[1].type === \"blockQuotePrefixWhitespace\" || tailEvent[1].type === \"blockQuoteMarker\" || tailEvent[1].type === \"listItemIndent\") {\n // Empty\n } else {\n break;\n }\n }\n if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) {\n listItem._spread = true;\n }\n\n // Fix position.\n listItem.end = Object.assign({}, lineIndex ? events[lineIndex][1].start : event[1].end);\n insertions.push({\n at: lineIndex || index,\n event: ['exit', listItem, event[2]]\n });\n }\n\n // Create a new list item.\n if (event[1].type === \"listItemPrefix\") {\n /** @type {Token} */\n const item = {\n type: 'listItem',\n _spread: false,\n start: Object.assign({}, event[1].start),\n // @ts-expect-error: we’ll add `end` in a second.\n end: undefined\n };\n listItem = item;\n insertions.push({\n at: index,\n event: ['enter', item, event[2]]\n });\n firstBlankLineIndex = undefined;\n atMarker = true;\n }\n }\n }\n\n // The list is at the end of `events`: take it off, then push it back with\n // the insertions merged in.\n // Nothing follows the list, so nothing shifts.\n const listEvents = events.splice(start);\n let insertion = 0;\n index = -1;\n while (++index < listEvents.length) {\n while (insertion < insertions.length && insertions[insertion].at === start + index) {\n events.push(insertions[insertion++].event);\n }\n events.push(listEvents[index]);\n }\n events[start][1]._spread = listSpread;\n }\n\n /**\n * Create an opener handle.\n *\n * @param {(token: Token) => Nodes} create\n * Create a node.\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function opener(create, and) {\n return open;\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function open(token) {\n enter.call(this, create(token), token);\n if (and) and.call(this, token);\n }\n }\n\n /**\n * @type {CompileContext['buffer']}\n */\n function buffer() {\n this.stack.push({\n type: 'fragment',\n children: []\n });\n }\n\n /**\n * @type {CompileContext['enter']}\n */\n function enter(node, token, errorHandler) {\n const parent = this.stack[this.stack.length - 1];\n /** @type {Array<Nodes>} */\n const siblings = parent.children;\n siblings.push(node);\n this.stack.push(node);\n this.tokenStack.push([token, errorHandler || undefined]);\n node.position = {\n start: point(token.start),\n // @ts-expect-error: `end` will be patched later.\n end: undefined\n };\n }\n\n /**\n * Create a closer handle.\n *\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function closer(and) {\n return close;\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function close(token) {\n if (and) and.call(this, token);\n exit.call(this, token);\n }\n }\n\n /**\n * @type {CompileContext['exit']}\n */\n function exit(token, onExitError) {\n const node = this.stack.pop();\n const open = this.tokenStack.pop();\n if (!open) {\n throw new Error('Cannot close `' + token.type + '` (' + stringifyPosition({\n start: token.start,\n end: token.end\n }) + '): it’s not open');\n }\n if (open[0].type !== token.type) {\n if (onExitError) {\n onExitError.call(this, token, open[0]);\n } else {\n const handler = open[1] || defaultOnError;\n handler.call(this, token, open[0]);\n }\n }\n node.position.end = point(token.end);\n }\n\n /**\n * @type {CompileContext['resume']}\n */\n function resume() {\n return toString(this.stack.pop());\n }\n\n //\n // Handlers.\n //\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistordered() {\n this.data.expectingFirstListItemValue = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistitemvalue(token) {\n if (this.data.expectingFirstListItemValue) {\n const ancestor = this.stack[this.stack.length - 2];\n ancestor.start = Number.parseInt(this.sliceSerialize(token), 10);\n this.data.expectingFirstListItemValue = undefined;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfenceinfo() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.lang = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfencemeta() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.meta = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfence() {\n // Exit if this is the closing fence.\n if (this.data.flowCodeInside) return;\n this.buffer();\n this.data.flowCodeInside = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefenced() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data.replace(/^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g, '');\n this.data.flowCodeInside = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodeindented() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data.replace(/(\\r?\\n|\\r)$/g, '');\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitionlabelstring(token) {\n const label = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.label = label;\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiontitlestring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.title = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiondestinationstring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.url = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitatxheadingsequence(token) {\n const node = this.stack[this.stack.length - 1];\n if (!node.depth) {\n const depth = this.sliceSerialize(token).length;\n node.depth = depth;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadingtext() {\n this.data.setextHeadingSlurpLineEnding = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadinglinesequence(token) {\n const node = this.stack[this.stack.length - 1];\n node.depth = this.sliceSerialize(token).codePointAt(0) === 61 ? 1 : 2;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheading() {\n this.data.setextHeadingSlurpLineEnding = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterdata(token) {\n const node = this.stack[this.stack.length - 1];\n /** @type {Array<Nodes>} */\n const siblings = node.children;\n let tail = siblings[siblings.length - 1];\n if (!tail || tail.type !== 'text') {\n // Add a new text node.\n tail = text();\n tail.position = {\n start: point(token.start),\n // @ts-expect-error: we’ll add `end` later.\n end: undefined\n };\n siblings.push(tail);\n }\n this.stack.push(tail);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitdata(token) {\n const tail = this.stack.pop();\n tail.value += this.sliceSerialize(token);\n tail.position.end = point(token.end);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlineending(token) {\n const context = this.stack[this.stack.length - 1];\n // If we’re at a hard break, include the line ending in there.\n if (this.data.atHardBreak) {\n const tail = context.children[context.children.length - 1];\n tail.position.end = point(token.end);\n this.data.atHardBreak = undefined;\n return;\n }\n if (!this.data.setextHeadingSlurpLineEnding && config.canContainEols.includes(context.type)) {\n onenterdata.call(this, token);\n onexitdata.call(this, token);\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithardbreak() {\n this.data.atHardBreak = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmlflow() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmltext() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcodetext() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlink() {\n const node = this.stack[this.stack.length - 1];\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut';\n node.type += 'Reference';\n // @ts-expect-error: mutate.\n node.referenceType = referenceType;\n // @ts-expect-error: mutate.\n delete node.url;\n delete node.title;\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier;\n // @ts-expect-error: mutate.\n delete node.label;\n }\n this.data.referenceType = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitimage() {\n const node = this.stack[this.stack.length - 1];\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut';\n node.type += 'Reference';\n // @ts-expect-error: mutate.\n node.referenceType = referenceType;\n // @ts-expect-error: mutate.\n delete node.url;\n delete node.title;\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier;\n // @ts-expect-error: mutate.\n delete node.label;\n }\n this.data.referenceType = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabeltext(token) {\n const string = this.sliceSerialize(token);\n const ancestor = this.stack[this.stack.length - 2];\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n ancestor.label = decodeString(string);\n // @ts-expect-error: same as above.\n ancestor.identifier = normalizeIdentifier(string).toLowerCase();\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabel() {\n const fragment = this.stack[this.stack.length - 1];\n const value = this.resume();\n const node = this.stack[this.stack.length - 1];\n // Assume a reference.\n this.data.inReference = true;\n if (node.type === 'link') {\n /** @type {Array<PhrasingContent>} */\n const children = fragment.children;\n node.children = children;\n } else {\n node.alt = value;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcedestinationstring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.url = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcetitlestring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.title = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresource() {\n this.data.inReference = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterreference() {\n this.data.referenceType = 'collapsed';\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitreferencestring(token) {\n const label = this.resume();\n const node = this.stack[this.stack.length - 1];\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n node.label = label;\n // @ts-expect-error: same as above.\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n this.data.referenceType = 'full';\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcharacterreferencemarker(token) {\n this.data.characterReferenceType = token.type;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreferencevalue(token) {\n const data = this.sliceSerialize(token);\n const type = this.data.characterReferenceType;\n /** @type {string} */\n let value;\n if (type) {\n value = decodeNumericCharacterReference(data, type === \"characterReferenceMarkerNumeric\" ? 10 : 16);\n this.data.characterReferenceType = undefined;\n } else {\n const result = decodeNamedCharacterReference(data);\n value = result;\n }\n const tail = this.stack[this.stack.length - 1];\n tail.value += value;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreference(token) {\n const tail = this.stack.pop();\n tail.position.end = point(token.end);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkprotocol(token) {\n onexitdata.call(this, token);\n const node = this.stack[this.stack.length - 1];\n node.url = this.sliceSerialize(token);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkemail(token) {\n onexitdata.call(this, token);\n const node = this.stack[this.stack.length - 1];\n node.url = 'mailto:' + this.sliceSerialize(token);\n }\n\n //\n // Creaters.\n //\n\n // Each node factory pre-declares `position` as undefined as the trailing\n // property. enter() patches it to a real value, but the property already\n // exists, so V8 sees a single hidden class for each node type from\n // construction through the rest of the pipeline. Without the pre-declare,\n // each node took a hidden-class transition when enter() added position.\n\n /** @returns {Blockquote} */\n function blockQuote() {\n return {\n type: 'blockquote',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Code} */\n function codeFlow() {\n return {\n type: 'code',\n lang: null,\n meta: null,\n value: '',\n position: undefined\n };\n }\n\n /** @returns {InlineCode} */\n function codeText() {\n return {\n type: 'inlineCode',\n value: '',\n position: undefined\n };\n }\n\n /** @returns {Definition} */\n function definition() {\n return {\n type: 'definition',\n identifier: '',\n label: null,\n title: null,\n url: '',\n position: undefined\n };\n }\n\n /** @returns {Emphasis} */\n function emphasis() {\n return {\n type: 'emphasis',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Heading} */\n function heading() {\n return {\n type: 'heading',\n // @ts-expect-error `depth` will be set later.\n depth: 0,\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Break} */\n function hardBreak() {\n return {\n type: 'break',\n position: undefined\n };\n }\n\n /** @returns {Html} */\n function html() {\n return {\n type: 'html',\n value: '',\n position: undefined\n };\n }\n\n /** @returns {Image} */\n function image() {\n return {\n type: 'image',\n title: null,\n url: '',\n alt: null,\n position: undefined\n };\n }\n\n /** @returns {Link} */\n function link() {\n return {\n type: 'link',\n title: null,\n url: '',\n children: [],\n position: undefined\n };\n }\n\n /**\n * @param {Token} token\n * @returns {List}\n */\n function list(token) {\n return {\n type: 'list',\n ordered: token.type === 'listOrdered',\n start: null,\n spread: token._spread,\n children: [],\n position: undefined\n };\n }\n\n /**\n * @param {Token} token\n * @returns {ListItem}\n */\n function listItem(token) {\n return {\n type: 'listItem',\n spread: token._spread,\n checked: null,\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Paragraph} */\n function paragraph() {\n return {\n type: 'paragraph',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Strong} */\n function strong() {\n return {\n type: 'strong',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Text} */\n function text() {\n return {\n type: 'text',\n value: '',\n position: undefined\n };\n }\n\n /** @returns {ThematicBreak} */\n function thematicBreak() {\n return {\n type: 'thematicBreak',\n position: undefined\n };\n }\n}\n\n/**\n * Copy a point-like value.\n *\n * @param {Point} d\n * Point-like value.\n * @returns {Point}\n * unist point.\n */\nfunction point(d) {\n return {\n line: d.line,\n column: d.column,\n offset: d.offset\n };\n}\n\n/**\n * @param {Config} combined\n * @param {Array<Array<Extension> | Extension>} extensions\n * @returns {undefined}\n */\nfunction configure(combined, extensions) {\n let index = -1;\n while (++index < extensions.length) {\n const value = extensions[index];\n if (Array.isArray(value)) {\n configure(combined, value);\n } else {\n extension(combined, value);\n }\n }\n}\n\n/**\n * @param {Config} combined\n * @param {Extension} extension\n * @returns {undefined}\n */\nfunction extension(combined, extension) {\n /** @type {keyof Extension} */\n let key;\n for (key in extension) {\n if (own.call(extension, key)) {\n switch (key) {\n case 'canContainEols':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(...right);\n }\n break;\n }\n case 'transforms':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(...right);\n }\n break;\n }\n case 'afterExit':\n case 'beforeEnter':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(right);\n }\n break;\n }\n case 'enter':\n case 'exit':\n {\n const right = extension[key];\n if (right) {\n Object.assign(combined[key], right);\n }\n break;\n }\n // No default\n }\n }\n }\n}\n\n/** @type {OnEnterError} */\nfunction defaultOnError(left, right) {\n if (left) {\n throw new Error('Cannot close `' + left.type + '` (' + stringifyPosition({\n start: left.start,\n end: left.end\n }) + '): a different token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is open');\n }\n throw new Error('Cannot close document, a token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is still open');\n}","import { fromMarkdown } from 'mdast-util-from-markdown'\nimport type { Definition, Nodes } from 'mdast'\nimport type { WorkspaceFileLinkResolver } from './workspace-file-links.js'\n\nconst WEB_SCHEME = /^(?:https?|mailto):/i\nconst HOST_ABSOLUTE = /^(?:[\\\\/]|[A-Za-z]:[\\\\/]|file:)/i\n\nexport interface FlattenOptions {\n /** Keep a relative target linked: a code host resolves it against the repository, chat cannot. */\n resolvesRelativeTargets?: boolean\n /** A daemon-owned mapping from runtime file targets to authenticated workspace URLs. */\n resolveFileLink?: WorkspaceFileLinkResolver\n}\n\n/** Rewrite unsafe link targets without reformatting the rest of the Markdown source. */\nexport function flattenUnsafeLinks(source: string, opts: FlattenOptions = {}): string {\n // A session file's host path never reaches the conversation; its `files:` name does (inbound-file-attachments.md §2.4).\n const text = opts.resolveFileLink?.rewriteSessionPaths?.(source) ?? source\n if (!text.includes('[') && !text.includes('<')) return text\n const tree = fromMarkdown(text)\n const definitions = new Map<string, Definition>()\n const index = (node: Nodes): void => {\n // CommonMark resolves every reference against the first definition with that identifier.\n if (node.type === 'definition' && !definitions.has(node.identifier)) definitions.set(node.identifier, node)\n if ('children' in node) node.children.forEach(index)\n }\n index(tree)\n\n const keeps = (url: string): boolean =>\n WEB_SCHEME.test(url) || (opts.resolvesRelativeTargets === true && !HOST_ABSOLUTE.test(url))\n\n const render = (node: Nodes, insideLink = false): string => {\n const start = node.position!.start.offset!\n const end = node.position!.end.offset!\n if (node.type === 'definition') return keeps(node.url) ? text.slice(start, end) : ''\n\n let cursor = start\n let content = ''\n let label = ''\n if ('children' in node) {\n const children = node.children.map((child) => ({\n child,\n rendered: render(child, insideLink || node.type === 'link' || node.type === 'linkReference')\n }))\n const changed = children.some(\n ({ child, rendered }) => rendered !== text.slice(child.position!.start.offset!, child.position!.end.offset!)\n )\n for (const { child, rendered: result } of children) {\n // Literal syntax beside a rewritten link must not become an active outer link on the platform.\n const rendered = changed && child.type === 'text' ? escapeLiteralLinkSyntax(result) : result\n content += text.slice(cursor, child.position!.start.offset!) + rendered\n label += rendered\n cursor = child.position!.end.offset!\n }\n }\n content += text.slice(cursor, end)\n\n const target =\n node.type === 'link' || node.type === 'image'\n ? node\n : node.type === 'linkReference' || node.type === 'imageReference'\n ? definitions.get(node.identifier)\n : undefined\n if (!target || keeps(target.url)) return content\n\n const display = target.url.startsWith('#') ? '' : HOST_ABSOLUTE.test(target.url) ? basename(target.url) : target.url\n // Images have no useful visible label here; an autolink's label is the unsafe target itself.\n const visible = (node.type === 'link' && text[start] === '[') || node.type === 'linkReference' ? label : ''\n const fileUrl = !insideLink ? opts.resolveFileLink?.(target.url) : undefined\n if (fileUrl && /^https?:/i.test(fileUrl)) return `[${visible || inlineCode(display)}](<${fileUrl}>)`\n if (!display || visible.includes(display)) return visible || inlineCode(display)\n return visible ? `${visible} (${inlineCode(display)})` : inlineCode(display)\n }\n return render(tree)\n}\n\n/** Escape both bracket sides so literal text cannot open or prematurely close a surrounding link. */\nfunction escapeLiteralLinkSyntax(text: string): string {\n return text.replace(/\\\\.|[<[\\]]/g, (token) => (token.length === 1 ? `\\\\${token}` : token))\n}\n\n/** Hold a whole Markdown block when later definitions could still change its references. */\nexport function referenceBufferStart(text: string): number | undefined {\n if (!text.includes('[')) return undefined\n const needsDefinitions = (node: Nodes): boolean => {\n if (node.type === 'definition' || node.type === 'linkReference' || node.type === 'imageReference') return true\n if (node.type === 'text') return node.value.includes('[')\n return 'children' in node && node.children.some(needsDefinitions)\n }\n return fromMarkdown(text).children.find(needsDefinitions)?.position?.start.offset\n}\n\n/** Last path segment of a host path, in either separator, ignoring trailing slashes. */\nfunction basename(path: string): string {\n const trimmed = path.replaceAll('\\\\', '/').replace(/\\/+$/, '')\n return trimmed.slice(trimmed.lastIndexOf('/') + 1) || trimmed\n}\n\n/** A decoded destination may contain backticks, so quote it with a longer code delimiter. */\nfunction inlineCode(value: string): string {\n const width = (value.match(/`+/g) ?? []).reduce((max, run) => Math.max(max, run.length), 0) + 1\n const fence = '`'.repeat(width)\n const padded = value.startsWith('`') || value.endsWith('`') || (value.startsWith(' ') && value.endsWith(' '))\n return `${fence}${padded ? ` ${value} ` : value}${fence}`\n}\n","/**\n * Runtime-independent \"not for me\" suppression.\n *\n * Every agent session receives the same standing response-choice contract. When an\n * activation is not directed at the agent, it replies with one product-specific\n * control marker; visible platform delivery boundaries suppress that marker. Direct\n * messages and direct agent calls are explicitly described as addressed, while shared\n * conversations are where the silent branch is normally useful.\n *\n * Kept in one module so the rule that TEACHES the sentinel and the convergers that\n * DETECT it (Slack/Telegram/Discord/Feishu render) can never drift apart.\n */\n\n/** The reserved reply meaning \"this message isn't for me — stay silent\". */\nexport const NO_RESPONSE_SENTINEL = 'AC_NO_RESPONSE'\n\n/** Standing system-prompt guidance injected into every agent session. It teaches the\n * agent to stay silent on activations that are not for it by replying with the bare\n * sentinel, which visible platform delivery boundaries drop before chat. */\nexport const NO_RESPONSE_RULE =\n `# Choosing whether to respond\\n` +\n `Apply this rule in every conversation type. Respond normally to messages directed at you. A direct message or ` +\n `direct agent call is addressed to you. A message that @-mentions you, directly replies to you, plainly asks ` +\n `you something, or puts to the room a request your role exists to handle is also addressed to you. A message ` +\n `is not addressed to you merely because it is about your topic. Only when an activation is not for you (for ` +\n `example, it addresses someone else, continues a conversation you are not part of, or is people talking among ` +\n `themselves, even about your topic or about work you did for them), ` +\n `do NOT respond: your entire reply must be exactly \\`${NO_RESPONSE_SENTINEL}\\` — start with that token ` +\n `and stop. Do not explain why, add punctuation, or output any other text. When a message may be asking you ` +\n `something and you're unsure, respond normally rather than staying silent.`\n\n/** A compact restatement of the rule, re-injected as a system reminder on long-running\n * sessions (every N turns, or right after a context compaction). The full rule is\n * asserted once at session start — for Claude it lives in the persistent\n * system-prompt append, but for non-Claude runtimes it rides only the first prompt block\n * and is summarized away once the runtime compacts its history, so it must be re-asserted.\n * Kept short (unlike the full rule) so periodic re-injection costs almost nothing. */\nexport const NO_RESPONSE_REMINDER =\n `<system-reminder>\\n` +\n `The response-choice rule still applies. Follow the activation chronologically. A direct message, direct ` +\n `agent call, @-mention, direct reply, or plain request to you is for you. Only when the activation is not ` +\n `directed at you, including people talking among themselves about your topic, your entire reply must be ` +\n `exactly ${NO_RESPONSE_SENTINEL}: start with that token, stop, and do not explain.\\n` +\n `</system-reminder>`\n\n/** Trusted routing context for a person's message in a shared conversation that reached this agent without tagging it. */\nexport const UNADDRESSED_MESSAGE_REMINDER =\n `<system-reminder>\\n` +\n `Routing fact: The platform message in this activation does not @-mention you. Nobody tagged you; it reached ` +\n `you because you are part of this conversation or follow this channel. Treat it as addressed to you only if it ` +\n `names you or plainly asks you something, gives you an instruction, answers a question you asked, or puts to ` +\n `the room a request your role exists to handle. If people are talking ` +\n `among themselves, even about your topic or about work you did for them, your entire reply must be exactly ` +\n `${NO_RESPONSE_SENTINEL}.\\n` +\n `</system-reminder>`\n\n/** Trusted per-turn routing context for an explicit platform @mention. Slack and\n * similar platforms expose an opaque user id in the raw message, so the model cannot\n * infer from its AgentConnect name alone that the token denotes its own bound bot. */\nexport const EXPLICIT_MENTION_REMINDER =\n `<system-reminder>\\n` +\n `Routing fact: A platform message in this activation explicitly @-mentioned your bound bot identity. ` +\n `That mentioned message is directed at you, even if its raw mention is an opaque platform user ID that ` +\n `does not resemble your AgentConnect name. Follow the conversation chronologically and respond normally; ` +\n `do not return ${NO_RESPONSE_SENTINEL} merely because of that ID mismatch.\\n` +\n `</system-reminder>`\n\n/** Trusted routing context for a daemon-delivered agent call. The payload may\n * quote or discuss any agent, so the model must not reinterpret names in the\n * body as evidence that the activation belongs to someone else. */\nexport const DIRECT_AGENT_CALL_REMINDER =\n `<system-reminder>\\n` +\n `Routing fact: This activation is a trusted direct agent call addressed to you. A leading ` +\n `\\`[Message <id>] From <agent>\\` header or \\`From <agent>:\\` label identifies the caller; it does not address that agent. Follow the request and respond ` +\n `normally. Do not return ${NO_RESPONSE_SENTINEL} merely because the body names or discusses another agent.\\n` +\n `</system-reminder>`\n\n/** Routing context for a webchat continuation the human's @mention left out (webchat-multi-agents.md §5.2a). */\nexport const OUTSIDE_HUMAN_SCOPE_REMINDER =\n `<system-reminder>\\n` +\n `Routing fact: In this multi-agent conversation the human @-mentioned other participants, not you, and the ` +\n `post that woke you does not @-mention you. Stay out of their exchange: unless that post asks you something ` +\n `directly, your entire reply must be exactly ${NO_RESPONSE_SENTINEL}.\\n` +\n `</system-reminder>`\n\n/** A replacement generation of a left-out turn now carries an activation addressed to this agent (§5.2a). */\nexport const ADDRESSED_AFTER_OUTSIDE_SCOPE_REMINDER =\n `<system-reminder>\\n` +\n `Routing fact: A newer post in this update is addressed to you, so the earlier instruction to stay out of the ` +\n `exchange no longer applies. Respond to it normally.\\n` +\n `</system-reminder>`\n\n/** A replacement generation of an addressed turn absorbed posts from an exchange the human addressed to others (§5.2a). */\nexport function absorbedOutsideScopeReminder(authors: readonly string[]): string {\n return (\n `<system-reminder>\\n` +\n `Routing fact: The newer post(s) from ${authors.map((a) => `[${a}]`).join(', ')} in this update belong to an ` +\n `exchange the human addressed to other participants. Answer what was asked of you; do not take up theirs.\\n` +\n `</system-reminder>`\n )\n}\n\n// Sentinels and sentinel prefixes separated by optional whitespace: a steered turn can leave \"AC_NO_RES\" before the retry's sentinel.\nconst SENTINEL_FRAGMENT = `(?:${[...NO_RESPONSE_SENTINEL]\n .map((_, i) => NO_RESPONSE_SENTINEL.slice(0, i + 1))\n .reverse()\n .join('|')})`\nconst SENTINEL_FRAGMENTS = new RegExp(`^(?:${SENTINEL_FRAGMENT}(?:\\\\s*${SENTINEL_FRAGMENT})*)?$`)\n\n/** True while `trimmedBody` could still become the bare sentinel as more chunks stream\n * in — i.e. it is a prefix of (or exactly) the sentinel. Convergers use this to HOLD\n * buffered body instead of posting it, so a streamed sentinel never leaks a partial\n * post before the turn ends. Case-sensitive, so ordinary replies that merely start with\n * \"N\"/\"NO\" are released the instant they diverge. */\nexport function isNoResponsePrefix(trimmedBody: string): boolean {\n return SENTINEL_FRAGMENTS.test(trimmedBody)\n}\n\n/** True when the turn is the bare sentinel, or when a non-compliant model explains itself\n * and then emits the sentinel as the final standalone line. The terminal-line fallback is\n * deliberately narrow: inline mentions, punctuation, fenced examples, and any content\n * after the sentinel remain ordinary replies. A body that is nothing but repeated\n * sentinel occurrences and whitespace is unambiguously a silent turn (#1920). */\nexport function isNoResponseBody(trimmedBody: string): boolean {\n const terminalLine = trimmedBody.split(/\\r?\\n/).at(-1)?.trim()\n if (terminalLine === NO_RESPONSE_SENTINEL) return true\n // Only sentinels, or prefixes cut off by an interrupted generation, ending in a whole sentinel (#1920).\n return SENTINEL_FRAGMENTS.test(trimmedBody) && trimmedBody.endsWith(NO_RESPONSE_SENTINEL)\n}\n","// Runtime message IDs separate successive replies even when no tool or thought occurs between them.\nimport { isNoResponsePrefix } from '../session/no-response.js'\n\n/** The runtime's own id for the message a chunk belongs to, or `''` where it names none. */\nexport function agentMessageId(update: unknown): string {\n const id = (update as { messageId?: unknown } | undefined)?.messageId\n return typeof id === 'string' ? id : ''\n}\n\n/** Tracks that id across the chunks of one turn, reporting where a new message begins. */\nexport class AgentMessageRun {\n private current = ''\n private text = ''\n private closedSentinel = ''\n\n /** Only a change between named messages closes the preceding reply. */\n opens(update: unknown): boolean {\n const id = agentMessageId(update)\n const opens = id !== '' && this.current !== '' && id !== this.current\n this.closedSentinel = opens && this.text.trim() && isNoResponsePrefix(this.text.trim()) ? this.text : ''\n if (opens) this.text = ''\n if (id) this.current = id\n this.text += agentMessageText(update)\n return opens\n }\n\n /** `buffered` without the message just closed when that message was only sentinel text, which can no longer complete. */\n withoutClosedSentinel(buffered: string): string {\n const closed = this.closedSentinel\n return closed && buffered.endsWith(closed) ? buffered.slice(0, -closed.length) : buffered\n }\n}\n\nfunction agentMessageText(update: unknown): string {\n const content = (update as { content?: { type?: unknown; text?: unknown } } | undefined)?.content\n return content?.type === 'text' && typeof content.text === 'string' ? content.text : ''\n}\n\n/** Tracks new work in one turn; ongoing tool output does not finish the agent's current text block. */\nexport class WorkBoundary {\n private readonly tools = new Set<string>()\n\n opens(update: unknown): boolean {\n const u = update as { sessionUpdate?: string; toolCallId?: unknown } | undefined\n if (u?.sessionUpdate === 'agent_thought_chunk' || u?.sessionUpdate === 'plan') return true\n if (u?.sessionUpdate !== 'tool_call' && u?.sessionUpdate !== 'tool_call_update') return false\n const id = u.toolCallId\n if (typeof id !== 'string' || !id) return true\n const opens = !this.tools.has(id)\n this.tools.add(id)\n return opens\n }\n}\n","import { referenceBufferStart } from './agent-links.js'\n\n/** Opening/closing CommonMark fence: up to 3 spaces of indent, then 3+ backticks or tildes. */\nconst FENCE = /^ {0,3}(`{3,}|~{3,})(.*)$/\n\n/** Split at a completed paragraph before any block whose reference definitions may still arrive. */\nexport function splitAtParagraphBoundary(text: string): { ready: string; tail: string } {\n let cut = 0\n let fence: string | undefined\n let pos = 0\n const referenceStart = referenceBufferStart(text) ?? text.length\n while (pos < text.length) {\n const nl = text.indexOf('\\n', pos)\n // A trailing line without its newline is still streaming.\n if (nl < 0) break\n const line = text.slice(pos, nl)\n pos = nl + 1\n const [, run = '', rest = ''] = FENCE.exec(line) ?? []\n if (fence) {\n // A fence closes on the same character, at least as long, alone on its line.\n if (run && run[0] === fence[0] && run.length >= fence.length && !rest.trim()) fence = undefined\n continue\n }\n if (run) {\n fence = run\n continue\n }\n if (!line.trim() && pos <= referenceStart) cut = pos\n }\n const ready = text.slice(0, cut)\n return ready.trim() ? { ready, tail: text.slice(cut) } : { ready: '', tail: text }\n}\n","// Codex ACP mode names shown in platform controls when the runtime reports only IDs.\nconst CODEX_MODE_LABELS: Record<string, string> = {\n 'read-only': 'Read-only',\n 'workspace-write': 'Workspace access',\n agent: 'Auto review',\n 'agent-full-access': 'Full access'\n}\n\n/** Codex's own name for a mode; unknown values (Claude's `default`/`plan`) pass through. */\nexport function permissionModeDisplayLabel(value: string): string {\n return CODEX_MODE_LABELS[value] ?? value\n}\n","/**\n * Length-chunking for outbound chat text: break a body into sections no longer than the\n * target platform's per-message limit, preferring line boundaries.\n *\n * Distinct from stream-boundary.ts, which answers a different question — WHEN a still\n * streaming buffer may be cut at all (paragraph breaks outside fences). That one decides\n * timing, this one decides size; a renderer typically uses both, in that order.\n *\n * Platform-specific knowledge stays with the platform: the limit itself, which character\n * spans are indivisible (Slack's `<@U123>` addresses), and how an unsplittable span is\n * reported. This module only takes the spans and honors them.\n */\n\n/** A half-open character range `[start, end)` a section boundary must not fall inside. */\nexport interface ProtectedSpan {\n start: number\n end: number\n}\n\n/** Thrown when one protected span is itself longer than a section can hold: delivery FAILS\n * rather than publishing a cut-in-half token. Platforms may supply their own error. */\nexport class UnsplittableSpanError extends Error {\n constructor(readonly fragment: string) {\n super(`split: protected span (${fragment.length} chars) exceeds one message and cannot be split`)\n this.name = 'UnsplittableSpanError'\n }\n}\n\nexport interface SplitSectionsOptions {\n /** Indivisible ranges, sorted by start and non-overlapping (callers merge overlaps). */\n protectedSpans?: readonly ProtectedSpan[]\n /** Builds the error thrown when a protected span cannot fit in one section. */\n unsplittable?: (fragment: string) => Error\n}\n\n/**\n * Split text into sections no longer than maxLen, preferring line boundaries; a single line\n * longer than maxLen is hard-cut. Whitespace-only input yields no sections. Content is never\n * lost across sections — `sections.join('')` reproduces the input byte for byte, including\n * boundary newlines and the whitespace around a protected span.\n *\n * A boundary that would fall INSIDE a protected span is moved back to the start of that span,\n * so the following section begins with the complete token. Moving back can only shorten a\n * section, never grow one past `maxLen`.\n */\nexport function splitIntoSections(text: string, maxLen: number, options: SplitSectionsOptions = {}): string[] {\n if (!text.trim()) return []\n if (text.length <= maxLen) return [text]\n const spans = options.protectedSpans ?? []\n const unsplittable = options.unsplittable ?? ((fragment: string) => new UnsplittableSpanError(fragment))\n for (const span of spans) {\n if (span.end - span.start > maxLen) throw unsplittable(text.slice(span.start, span.end))\n }\n const sections: string[] = []\n let consumed = 0\n while (text.length - consumed > maxLen) {\n const remaining = text.slice(consumed)\n // Prefer ending immediately after the last newline that fits. If none fits (an overlong\n // line, or a newline exactly at maxLen), hard-cut at the limit. Slicing the original\n // string rather than reconstructing lines guarantees join('') is byte-for-byte identical\n // to the input, including boundary newlines.\n const newline = remaining.lastIndexOf('\\n', maxLen - 1)\n let end = consumed + (newline >= 0 ? newline + 1 : maxLen)\n // Absolute-offset spans and an absolute boundary, so the retreat below stays correct no\n // matter how many sections have already been emitted.\n const straddled = spans.find((span) => span.start < end && end < span.end)\n if (straddled) {\n end = straddled.start\n // Retreating to a span that starts at (or before) this section's own start would emit\n // an empty section and loop forever. It means the section begins inside the span —\n // impossible, since the previous iteration ended at a span start and no span is longer\n // than maxLen. Fail loudly instead of hanging.\n if (end <= consumed) throw unsplittable(text.slice(straddled.start, straddled.end))\n }\n sections.push(text.slice(consumed, end))\n consumed = end\n }\n if (consumed < text.length) sections.push(text.slice(consumed))\n return sections\n}\n","/** Last-mile Slack formatting: split verbatim Markdown without breaking mention addresses. */\n\nimport { splitIntoSections as splitTextIntoSections } from '../messages/split-sections.js'\n\n/** Slack caps the combined text of a payload's `markdown` blocks at 12,000 characters. */\nexport const SLACK_MARKDOWN_BLOCK_LIMIT = 12000\n\n/** Native mentions, user groups, broadcasts, and channel links must stay whole to preserve delivery. */\nconst SLACK_ADDRESS_RE = /<[@!#][^>]*>/g\n\n/** Merge native addresses and caller-supplied shared-bot addresses into indivisible spans (§5.3). */\nfunction protectedSpans(text: string, extraAddresses: readonly string[]): { start: number; end: number }[] {\n const spans: { start: number; end: number }[] = []\n for (const match of text.matchAll(SLACK_ADDRESS_RE)) {\n spans.push({ start: match.index, end: match.index + match[0].length })\n }\n for (const address of extraAddresses) {\n if (!address) continue\n for (let at = text.indexOf(address); at >= 0; at = text.indexOf(address, at + 1)) {\n spans.push({ start: at, end: at + address.length })\n }\n }\n // Longest-first at equal starts, so the wider address wins the overlap filter below.\n spans.sort((a, b) => a.start - b.start || b.end - a.end)\n const merged: { start: number; end: number }[] = []\n for (const span of spans) {\n const last = merged[merged.length - 1]\n if (last && span.start < last.end) {\n // Merge overlapping addresses so no boundary can fall inside either one.\n if (span.end > last.end) last.end = span.end\n continue\n }\n merged.push({ ...span })\n }\n return merged\n}\n\n/** Fail delivery when an address cannot fit, rather than silently sending a broken mention (§5.3). */\nexport class UnsplittableAddressError extends Error {\n constructor(readonly address: string) {\n super(`slack: mention address (${address.length} chars) exceeds one message and cannot be split`)\n this.name = 'UnsplittableAddressError'\n }\n}\n\n/** Split on line boundaries within `maxLen`, never inside an address; `join('')` reproduces the input. */\nexport function splitIntoSections(\n text: string,\n maxLen = SLACK_MARKDOWN_BLOCK_LIMIT,\n extraAddresses: readonly string[] = []\n): string[] {\n return splitTextIntoSections(text, maxLen, {\n protectedSpans: protectedSpans(text, extraAddresses),\n unsplittable: (address) => new UnsplittableAddressError(address)\n })\n}\n","// The approval-card facet of Layer 2 (integration-plugin-architecture.md §7.3): how a chat surface offers a permission request as a card people in the conversation answer.\nimport type { RequestPermissionRequest } from '@agentclientprotocol/sdk/unstable'\nimport type { SubsessionNoticeOutcome } from '../slack/render.js'\nimport type { ElicitCardHost, ElicitCardTurn } from './elicit-card.js'\n\n/** Who a background sub-session's card or notice says is asking, on every rewrite too (assistant-mode.md §5.6). */\nexport interface SubsessionAsker {\n readonly agentName: string\n readonly title: string | null\n readonly sessionUrl: string\n readonly waitHours: number\n}\n\n/** A settled sub-session notice's subject; a notice swept after a restart may have lost its session. */\nexport interface SubsessionNoticeView {\n readonly agentName: string\n readonly title: string | null\n readonly sessionUrl?: string\n}\n\n/** What an editor's card in their own chat says it is for: the agent, who asked, and the session's page. */\nexport interface ApprovalCardContext {\n readonly agentName: string\n readonly requesterName: string | null\n readonly sessionUrl: string\n}\n\n/** One permission request as core hands it to a surface. */\nexport interface ApprovalCardAsk {\n /** The unguessable id every button on the card carries back. */\n readonly requestId: string\n /** The ACP request, already secret-masked by core; the card offers its options in this order. */\n readonly params: RequestPermissionRequest\n /** The opaque target a relay-forwarded click carries back to this daemon; ignored where ingress is the daemon's own. */\n readonly sessionTarget?: string\n /** The agent and integration the card is posted through, for a surface whose relay routes a click by the target it names. */\n readonly via?: { readonly agentId: string; readonly integrationId: string }\n /** Set when a background sub-session asks: the card names and links it above the request. */\n readonly subsession?: SubsessionAsker\n /** Set on a card sent to an editor outside the conversation: it names and links what it is for. */\n readonly context?: ApprovalCardContext\n}\n\n/** How a card reads once it takes no answer. */\nexport interface ApprovalCardSettlement {\n readonly params: RequestPermissionRequest\n readonly subsession?: SubsessionAsker\n readonly context?: ApprovalCardContext\n /** What happened, with who answered where someone did: \"Allow — Ada\", \"Cancelled\". */\n readonly text: string\n /** Undefined when nothing was decided: cancelled, expired, or approving in chat turned off. */\n readonly allowed?: boolean\n /** The notification text beside the rewrite, where the platform shows one. */\n readonly fallback: string\n}\n\n/** A card whose request settled while no process could rewrite it (a restart), as its stored row recorded it. */\nexport interface ApprovalCardOrphan {\n readonly command: string\n readonly status: string\n readonly resolvedByName?: string | null\n}\n\n/** A conversation of the platform outside the turn, as a sub-session's card is posted to it. */\nexport interface ApprovalCardPlace {\n readonly channel: string\n /** The conversation's platform thread, as the session records it; absent at its top level. */\n readonly thread?: string\n}\n\n/** A posted card's coordinates: the connection that posted it, where it landed, and its message id once the post returns. */\nexport interface ApprovalCardHandle {\n readonly conn: unknown\n readonly channel: string\n /** The platform thread it was posted into, where a thread is not a channel of its own (Slack's). */\n readonly thread?: string\n ts?: string\n}\n\n/** A card or notice the surface built but has not sent, in its own wire shape. Opaque to core. */\nexport type ApprovalCardDraft = unknown\n\n/** One chat surface's approval-card facet; absent ⇒ approvals there go to the console and the conversation gets a notice. */\nexport interface ApprovalCardFacet {\n /** Diagnostic label, and the namespace of a recorded answerer's id. */\n readonly platform: string\n /** The most options one card offers whole: at most the cap every surface and the console share (#1969). */\n readonly maxOptions: number\n /** The live card for the connection it will be posted on, or null when it cannot offer every option there. */\n build(ask: ApprovalCardAsk, conn?: unknown): ApprovalCardDraft | null\n /** The card once it takes no answer, its buttons gone. */\n settled(card: ApprovalCardSettlement): ApprovalCardDraft\n /** A sub-session's notice where nobody there may answer: it is waiting, and an Agent editor answers in the console. */\n notice(asker: SubsessionAsker): ApprovalCardDraft\n /** That notice once its request settled. */\n noticeSettled(view: SubsessionNoticeView, outcome: SubsessionNoticeOutcome): ApprovalCardDraft\n /** The editor path's notice in the turn's own conversation: an Agent editor answers it in the console. */\n turnNotice(): ApprovalCardDraft\n /** That notice once its request settled; `by` is already unset where the conversation is external. */\n turnNoticeSettled(outcome: SubsessionNoticeOutcome): ApprovalCardDraft\n /** A card or notice a restart left behind, from its stored row. */\n orphaned(row: ApprovalCardOrphan): ApprovalCardDraft\n /** Where a card of this turn lands, when that is not the turn's channel (a Discord thread is a channel of its own). */\n cardChannel?(place: ApprovalCardPlace): string\n /** Post a card in the turn's own conversation, serialized on its apply chain; the message id, or undefined when refused. */\n send(host: ElicitCardHost, turn: ElicitCardTurn, draft: ApprovalCardDraft): Promise<string | undefined>\n /** Post into another conversation of this platform on a connection core resolved for it, under the turn's agent. */\n post(\n conn: unknown,\n place: ApprovalCardPlace,\n draft: ApprovalCardDraft,\n turn: ElicitCardTurn\n ): Promise<string | undefined>\n /** Rewrite a posted card or notice in place; best effort, no outcome depends on it. */\n rewrite(handle: ApprovalCardHandle, draft: ApprovalCardDraft): void\n /** Tell only `userId`, beside the card, why their click was not taken. Absent ⇒ core hands the words back to the click's own ingress, which answers the interaction privately. */\n tellPrivately?(handle: ApprovalCardHandle, userId: string, text: string): void\n /** The most characters a refusal said only to the clicker can carry here, by either path; absent ⇒ no limit core must fit. */\n readonly privateTextLimit?: number\n /** The namespace a clicker's id is scoped to; absent where the platform's user ids are already global. */\n answerScope?(handle: ApprovalCardHandle): string | undefined\n /** A clicker's display name, for a click that carried none. */\n nameOf?(handle: ApprovalCardHandle, userId: string): Promise<string | undefined>\n /** Whether chat approvals are deliverable on `conn` (e.g. callback URL configured); absent ⇒ true. */\n canApproveInChat?(conn: unknown): boolean\n}\n\n/** \"Agent’s task “title”\", or just \"Agent’s task\" without a title; plain text, each surface defuses its own markup. */\nexport function subsessionAskerText(\n agentName: string,\n title: string | null,\n clamp: (s: string, n: number) => string\n): string {\n const agent = `${clamp(agentName, 60)}’s task`\n return title?.trim() ? `${agent} “${clamp(title.trim(), 80)}”` : agent\n}\n\n/** How long a task's request waits, as its card and notice say it. */\nexport function subsessionWaitText(hours: number): string {\n return `If nobody answers within ${hours} hour${hours === 1 ? '' : 's'}, it is denied and the task stops.`\n}\n\n/** How a settled sub-session notice reads, in plain text with literal marks. */\nexport function subsessionSettledText(\n asker: string,\n outcome: SubsessionNoticeOutcome,\n name: (s: string) => string\n): string {\n const by = (word: string, who: string | null): string => (who?.trim() ? ` ${word} ${name(who.trim())}` : '')\n switch (outcome.kind) {\n case 'allowed':\n return `✅ ${asker} got permission${by('from', outcome.by)}.`\n case 'denied':\n return `🚫 ${asker} was denied permission${by('by', outcome.by)}.`\n case 'expired':\n return `🚫 ${asker} got no answer within ${outcome.hours} hour${outcome.hours === 1 ? '' : 's'}, so it was denied and stopped.`\n case 'cancelled':\n return `⏳ ${asker} no longer needs permission.`\n }\n}\n\n/** The editor path's notice in the turn's own conversation; like a sub-session's, it names no tool. */\nexport const TURN_NOTICE_TEXT =\n '🔒 Permission requested. Ask an Agent editor to allow it from the Agent or Session page.'\n\n/** How the turn's notice reads once its request settled, in plain text with literal marks. */\nexport function turnNoticeSettledText(outcome: SubsessionNoticeOutcome, name: (s: string) => string): string {\n const by = (who: string | null): string => (who?.trim() ? ` by ${name(who.trim())}` : '')\n switch (outcome.kind) {\n case 'allowed':\n return `✅ Permission granted${by(outcome.by)}.`\n case 'denied':\n return `🚫 Permission denied${by(outcome.by)}.`\n case 'expired':\n return `🚫 Permission denied: nobody answered within ${outcome.hours} hour${outcome.hours === 1 ? '' : 's'}.`\n case 'cancelled':\n return '⏳ Permission no longer needed.'\n }\n}\n\n/** A settled card's literal mark: allowed, denied, or nothing decided. */\nexport function approvalMark(allowed: boolean | undefined): string {\n return allowed === undefined ? '⏳' : allowed ? '✅' : '🚫'\n}\n\n/** An orphaned row's mark, by its stored status. */\nexport function orphanMark(status: string): string {\n return status === 'allowed' ? '✅' : status === 'denied' ? '🚫' : '⏳'\n}\n","/**\n * Pull human-readable output text out of an ACP tool_call/_update — the ONE copy every\n * platform renderer uses, so a runtime's shape learned once is learned everywhere.\n *\n * Prefers the `content[]` text blocks (the tool's reported output); diff / terminal blocks are\n * skipped — they have no compact inline text. `rawOutput` is the fallback, and it is not one\n * shape: codex-acp sends NO content for a finished shell command — the output rides\n * `rawOutput.formatted_output` (folded there at ACP ingress by `TerminalOutputFolder`) — and\n * wraps an MCP tool's result as `rawOutput.result.content[]` text blocks.\n */\nexport function extractToolOutput(update: { content?: unknown; rawOutput?: unknown }): string {\n const content = update.content\n if (Array.isArray(content)) {\n const parts: string[] = []\n for (const item of content) {\n if (!item || typeof item !== 'object') continue\n if ((item as { type?: string }).type !== 'content') continue\n const block = (item as { content?: { type?: string; text?: string } }).content\n if (block?.type === 'text' && block.text) parts.push(block.text)\n }\n if (parts.length) return parts.join('\\n').trim()\n }\n const raw = update.rawOutput\n if (typeof raw === 'string') return raw.trim()\n if (raw && typeof raw === 'object') {\n const r = raw as { formatted_output?: unknown; result?: { content?: unknown } }\n if (typeof r.formatted_output === 'string') return r.formatted_output.trim()\n const nested = r.result?.content\n if (Array.isArray(nested)) {\n const parts = nested\n .filter((b): b is { type: string; text: string } => {\n const x = b as { type?: unknown; text?: unknown } | null\n return !!x && x.type === 'text' && typeof x.text === 'string'\n })\n .map((b) => b.text)\n if (parts.length) return parts.join('\\n').trim()\n }\n }\n return ''\n}\n","import type {\n CreateElicitationRequest,\n RequestPermissionRequest,\n SessionUpdate,\n ToolKind\n} from '@agentclientprotocol/sdk/unstable'\nimport {\n ELICIT_ACTION_PREFIX,\n ELICIT_CONFIRM_ACTION,\n ELICIT_DISMISS_ACTION,\n ELICIT_FORM_FIELD_CAP,\n ELICIT_FORM_INPUT_ACTION,\n PERMISSION_ACTION_PREFIX,\n SLACK_STATUS_ACTION,\n elicitFormBlockId,\n elicitFormBlockIndex,\n encodePermValue,\n encodeSlackStatusOverflowValue,\n followUpWatchLabel,\n parseFollowUpWatchUrl\n} from '@agentconnect.md/protocol'\nexport {\n ELICIT_ACTION_PREFIX,\n ELICIT_CONFIRM_ACTION,\n ELICIT_DISMISS_ACTION,\n PERMISSION_ACTION_PREFIX,\n decodePermValue,\n elicitFormBlockId,\n elicitFormViewValues,\n encodePermValue,\n type SlackViewState\n} from '@agentconnect.md/protocol'\nimport { renderAttributionMessage, type ReplyAttributionInfo } from '../messages/attribution.js'\nimport { flattenUnsafeLinks } from '../messages/agent-links.js'\nimport type { WorkspaceFileLinkResolver } from '../messages/workspace-file-links.js'\nimport { AgentMessageRun, WorkBoundary } from '../messages/message-boundary.js'\nimport { splitAtParagraphBoundary } from '../messages/stream-boundary.js'\nimport { permissionModeDisplayLabel } from '../acp/permission-modes.js'\nimport { splitIntoSections } from './formatter.js'\nimport { TURN_NOTICE_TEXT, turnNoticeSettledText } from '../platforms/approval-card.js'\nimport { isNoResponseBody, isNoResponsePrefix } from '../session/no-response.js'\nimport { extractToolOutput } from '../session/tool-output.js'\n\n/**\n * The mode-aware ACP→Slack intermediate representation (§9.1). The daemon's\n * applyAction resolves these against a live SlackConnection:\n * - `post` a finalized body/result section → chat.postMessage in the thread.\n * - `notice` a system line (e.g. the done footer) posted to the thread but not recorded.\n * - `set-status` the transient working indicator (agents.sessions.setStatus; text = on/off only).\n * - `set-title` the native Slack app-thread title (agents.sessions.rename).\n * - `progress` the SINGLE in-place \"main progress\" message (medium/high) — posted\n * once then chat.update-ed in place as tool activity changes (in-place update).\n * - `reasoning` the SINGLE in-place reasoning \"context block\" (high only) — the\n * agent's accumulated thinking, edited in place as more arrives. Kept\n * separate from `progress` so reasoning and tool activity never\n * overwrite each other on one message (§9.1 agent_thought_chunk).\n * - `plan` the SINGLE in-place plan-summary message (medium/high).\n * - `tool-output` a finished tool call's output as a code block (high only) — posted\n * to the thread but NOT recorded (the TranscriptRecorder captures tool\n * rows independently; this is live chrome, not the agent's words).\n */\nexport type SlackAction =\n // `post` carries the agent's own reply text (a flushed message buffer) — the daemon\n // posts it AND records it into the thread transcript (sender = agentId), so other\n // agents replaying the thread see what this one actually said. `attributed: false`\n // is reserved for daemon-generated failure notices that use the same transcript path.\n // `recordOnly: true` writes the text to the transcript WITHOUT posting to the channel —\n // used by `minimal` mode, whose interim segments reach the channel as history cards on\n // the chrome stream rather than as messages.\n // `terminal: true` marks the LAST body section of the turn's final flush: the complete\n // response is known when it posts, so the applier can stamp it `final` at birth\n // (send-message-routing-rework.md §5.5) instead of re-editing it after delivery.\n | { kind: 'post'; text: string; attributed?: boolean; recordOnly?: boolean; terminal?: boolean }\n // `notice` is a system line the daemon posts but must NOT record — recording it would\n // replay daemon chrome back to agents as thread context.\n | { kind: 'notice'; text: string }\n // `lifecycle: 'suspended'` shows the session as waiting on a person instead of working.\n | { kind: 'set-status'; text: string; lifecycle?: 'suspended' }\n | { kind: 'set-title'; text: string }\n | { kind: 'progress'; text: string }\n | { kind: 'reasoning'; text: string }\n // `markdown` is the same plan for a code channel's Plan tab canvas.\n | { kind: 'plan'; text: string; blocks: unknown[]; markdown: string }\n // `tool-output` posts a finished tool's output (code block) but is NOT recorded — same\n // post-but-don't-record contract as `notice`.\n | { kind: 'tool-output'; text: string }\n // `status-bar` is the session-scoped status line (model / context / tokens / cost)\n // rendered as an interactive Block Kit row. Posted once for the Slack session (after\n // the ACP session is up, before the reply), then chat.update-ed in place as later\n // turns progress. `text` is the notification/accessibility fallback; `blocks` is the\n // Block Kit payload. Shown when the Agent's status-bar setting is enabled. NOT\n // recorded into the transcript.\n | { kind: 'status-bar'; text: string; blocks: unknown[]; info?: StatusBarInfo }\n // Remove a status row left by an earlier turn after the Agent disables it. The daemon\n // clears the persisted ts only after Slack accepts the delete, so a transient failure\n // can retry on the next turn.\n | { kind: 'clear-status-bar'; info?: StatusBarInfo }\n // `attribution` closes the footer lifecycle after the latest reply section was first\n // posted with it. The daemon uses this boundary to retry stale-footer cleanup or refresh\n // final metadata that changed during the prompt. Not transcript content.\n | { kind: 'attribution'; text: string; blocks: unknown[] }\n // ── Native tool-call chrome (slack-streaming-turn-output.md §3) ──────────────\n // On a medium/high turn the in-place `progress` message becomes ONE cards-only\n // `chat.startStream` stream; on a minimal turn the same stream holds the interim reply\n // segments as history cards. The final answer never rides it: posts, the footer, the\n // transcript and the status calls are all unchanged.\n | { kind: 'stream-start' }\n // `progressText` is the same in-place `progress` rendering this batch would have\n // produced, so a turn whose stream never opened degrades to today's message.\n | { kind: 'stream-append'; chunks: SlackStreamChunk[]; progressText?: string }\n // The terminal settle rides the STOP rather than a preceding append, because the two\n // cannot be split: stopping while cards are still `in_progress` makes Slack render\n // \"Something went wrong\", so a refused settle has to hold its own stop back.\n | { kind: 'stream-stop'; settle: SlackStreamChunk[]; progressText?: string }\n\n/** Native progress chunks replace titles, statuses and icons; each bounded body field appends once. */\nexport type SlackStreamChunk =\n | {\n type: 'task_update'\n id: string\n title: string\n status: 'in_progress' | 'complete' | 'error'\n icon?: { type: 'icon'; name: string }\n details?: string\n output?: string\n }\n // The group title summarizes work steps or Minimal's interim reply history.\n | { type: 'plan_update'; title: string }\n\n/** Dynamic identity shown under the last reply section. All Slack integration modes use\n * the same compact `context` footer so shared-bot attribution never looks like body text\n * or causes its console links to sprout rich previews. */\nexport type SlackAttributionInfo = ReplyAttributionInfo\n\nconst THINKING = 'is thinking…'\nconst WORKING = 'is working…'\nconst MAX_LABEL = 100\nconst MAX_STATUS = 50\n// A deliberately compact cap for the reasoning block (well under Slack's markdown-block\n// limit) — it's a live \"current thinking\" view, not the main content, so keep only the\n// newest tail and mark a drop with a leading ellipsis. The raw buffer is soft-capped at\n// 2× so it can't grow unbounded across a long turn.\nconst MAX_REASONING = 2800\n// Every streaming card field caps at 256 characters ON THE WIRE, per chunk. Because nothing\n// appending is ever re-sent, a clamped field is also the card's final size.\nconst MAX_STREAM_TASK = 256\n// A card title is a ONE-LINE step label, so it is clamped far below the wire cap: Slack wraps\n// a long title into a paragraph of shell instead of truncating it, and there is no hover or\n// per-title disclosure to recover the rest. The verbatim command rides the card's code block.\nconst MAX_CARD_TITLE = 72\n// A COMMAND standing in for a missing description is clamped tighter still — Slack's thread\n// panel fits roughly this much on one line (the channel view fits more, mobile less) — and cut\n// at its first shell separator first: the opening command of a `&&` chain is a far better\n// label than 72 characters of run-on shell. The full chain rides the card's code block.\nconst MAX_COMMAND_TITLE = 48\nconst SHELL_SEPARATOR = / (?:&&|\\|\\||;|\\|) /\n/** The card that stands for one thinking run until its first line names it. */\nconst THINKING_CARD = 'Thinking'\nconst TASK_ICONS: Record<ToolKind, string> = {\n read: 'file',\n edit: 'edit',\n delete: 'trash',\n move: 'folder',\n search: 'sparkle',\n execute: 'code',\n think: 'lightbulb',\n fetch: 'globe',\n switch_mode: 'gear',\n other: 'gear'\n}\n/** minimal: the history card for an interim reply whose first line yields no title. */\nconst REPLY_CARD = 'Reply'\n// How much of a thinking run to hold while waiting for its first line to end. A runtime opens\n// a thought with a short `**heading**`, so this only ever buffers one line's worth.\nconst MAX_THINKING_HEAD = 400\n/** The collapsed container's label while the turn is still working (§4). */\nconst STREAM_PLAN_WORKING = 'Working…'\n/** …and after a cancel, a user Stop, or suppression — the in-flight cards settle as errors. */\nconst STREAM_PLAN_STOPPED = 'Stopped'\n/** …and after the RUNTIME dies mid-turn. Same error settle as a stop — the in-flight step did\n * not finish because the turn ended — under the label that says which way it ended. */\nconst STREAM_PLAN_FAILED = 'Failed'\n/** A failed tool's title prefix — words, not card status: any `error` card reddens the whole\n * container (the icon is derived, verified live 2026-08-29), and the title parses no markdown\n * and no shortcodes, so plain text is the entire palette. */\nconst FAILED_PREFIX = '(failed) '\n\nexport function clampTo(s: string, max: number): string {\n const t = s.trim()\n return t.length > max ? `${t.slice(0, max - 1)}…` : t\n}\n\n/** Drop paired bold markers, keeping every other kind of markdown. Card bodies parse markdown,\n * and runtimes write each thought heading as `**heading**` — content worth keeping, shouting\n * not. Bounded to a line so a stray `**` cannot swallow text across paragraphs. */\nfunction stripBoldMarks(s: string): string {\n return s.replace(/\\*\\*([^\\n]+?)\\*\\*/g, '$1').replace(/__([^\\n]+?)__/g, '$1')\n}\n\n/** Flatten markdown emphasis for a card field. Task titles and plan labels render as PLAIN\n * text, so `**bold**` would arrive as literal punctuation rather than styling. */\nfunction plainCardText(s: string): string {\n return s\n .replace(/```[\\s\\S]*?```|`([^`]*)`/g, '$1')\n .replace(/[*_~]{1,3}(?=\\S)([\\s\\S]*?\\S)[*_~]{1,3}/g, '$1')\n .replace(/^\\s{0,3}#{1,6}\\s+/gm, '')\n .replace(/\\s+/g, ' ')\n .trim()\n}\n\nfunction clampLabel(s: string): string {\n return clampTo(s, MAX_LABEL)\n}\n\n/** A card body under a title taken from its first line: '' when the title already shows the\n * whole text, the rest when the title shows the first line whole, the whole body when the\n * title had to clamp it — that line is then what the title could not show. */\nfunction bodyUnderTitle(body: string, title: string): string {\n if (!body || plainCardText(body) === title) return ''\n const nl = body.indexOf('\\n')\n return nl >= 0 && plainCardText(body.slice(0, nl)) === title ? body.slice(nl + 1).trim() : body\n}\n\n/** minimal: a history card's title is the segment's first line, or the fallback when that line\n * is a code fence or flattens to nothing. */\nfunction replyCardTitle(text: string): string {\n const nl = text.indexOf('\\n')\n const line = nl < 0 ? text : text.slice(0, nl)\n return (line.startsWith('```') ? '' : clampTo(plainCardText(line), MAX_CARD_TITLE)) || REPLY_CARD\n}\n\n/** Wrap tool activity (a command line, tool title, or tool output) in a CommonMark code\n * span so it renders monospace and verbatim — Slack posts these as `markdown` blocks, so\n * unwrapped text with `*` / `_` / `#` would otherwise be interpreted as emphasis. A\n * single-line value uses an inline span, multi-line (or `block`-forced) a fenced block;\n * the delimiter is grown past the longest internal backtick run so values containing\n * backticks stay intact (CommonMark's variable-length fence rule). */\nfunction codeSpan(s: string, block = false): string {\n const text = s.trim()\n if (!text) return ''\n const longestRun = Math.max(0, ...[...text.matchAll(/`+/g)].map((m) => m[0].length))\n if (block || text.includes('\\n')) {\n const fence = '`'.repeat(Math.max(3, longestRun + 1))\n return `${fence}\\n${text}\\n${fence}`\n }\n const ticks = '`'.repeat(longestRun + 1)\n // Pad when the content touches a backtick so the delimiters stay unambiguous.\n const pad = text.startsWith('`') || text.endsWith('`') ? ' ' : ''\n return `${ticks}${pad}${text}${pad}${ticks}`\n}\n\n// Head-clamp a finished tool's output for the channel. Kept well under Slack's\n// markdown-block limit (so the whole code block posts as one intact message — a\n// fence split across sections would break) and head-kept because the start of a\n// command's output is usually the most informative; truncation is marked with an\n// ellipsis. Empty/whitespace output yields ''.\nconst MAX_TOOL_OUTPUT = 2800\nfunction capOutput(s: string): string {\n const t = s.trim()\n return t.length > MAX_TOOL_OUTPUT ? `${t.slice(0, MAX_TOOL_OUTPUT - 1)}…` : t\n}\n\n/** A TOP-LEVEL `rawInput` string the runtime wrote about its call; nested `arguments` belong to the tool (`gitlabMergeRequest`'s `description` is a document). */\nfunction rawInputField(update: { rawInput?: unknown }, key: 'command' | 'description' | 'command_description'): string {\n const raw = update.rawInput as Record<string, unknown> | undefined\n if (!raw || typeof raw !== 'object') return ''\n return typeof raw[key] === 'string' ? raw[key].trim() : ''\n}\n\n/** The runtime's own description of a call; Claude Code's shell tools may spell it `command_description`. */\nfunction rawInputDescription(update: { rawInput?: unknown }): string {\n return rawInputField(update, 'description') || rawInputField(update, 'command_description')\n}\n\n/** Whether a runtime's description can stand as a card's one-line label. Even at the top level\n * this is a string we did not author, so it has to LOOK like a label — one line, and short\n * enough that clamping it would not be hiding most of it. */\nfunction isStepLabel(s: string): boolean {\n return s.length > 0 && s.length <= MAX_CARD_TITLE * 2 && !s.includes('\\n')\n}\n\n/** Escape interpolated labels before embedding them in Slack mrkdwn. `|` is a link-label\n * delimiter, so replace it rather than letting a configured display name break the URL. */\nfunction escapeMrkdwnLabel(value: string): string {\n return value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\\|/g, '¦')\n}\n\nconst MAX_SLACK_LINK_URL_LENGTH = 2_048\n\n/** Validate an interpolated Slack link target without normalizing it. Slack parses\n * `<url|label>` itself, so delimiters, controls, and whitespace must never reach\n * that syntax even when the platform URL was derived from configuration. */\nfunction safeSlackLinkUrl(raw?: string): string | undefined {\n if (!raw || raw.length > MAX_SLACK_LINK_URL_LENGTH || /[<>|\\s\\p{Cc}]/u.test(raw)) return undefined\n try {\n const url = new URL(raw)\n if (url.protocol !== 'https:' && url.protocol !== 'http:') return undefined\n return raw\n } catch {\n return undefined\n }\n}\n\nfunction attributionText(info: SlackAttributionInfo): string {\n const sessionUrl = safeSlackLinkUrl(info.sessionUrl)\n return renderAttributionMessage({\n agent: info.botName,\n runtime: info.runtime,\n model: info.model,\n renderSession: sessionUrl ? (label) => label : undefined,\n notice: info.notice\n })\n}\n\nexport function attributionMrkdwn(info: SlackAttributionInfo): string {\n const botName = escapeMrkdwnLabel(info.botName)\n const runtime = escapeMrkdwnLabel(info.runtime)\n const model = escapeMrkdwnLabel(info.model)\n const botUrl = safeSlackLinkUrl(info.botUrl)\n const sessionUrl = safeSlackLinkUrl(info.sessionUrl)\n return renderAttributionMessage({\n agent: botUrl ? `<${botUrl}|${botName}>` : botName,\n runtime,\n model,\n renderSession: (label) => (sessionUrl ? `<${sessionUrl}|${escapeMrkdwnLabel(label)}>` : undefined),\n notice: info.notice ? escapeMrkdwnLabel(info.notice) : undefined\n })\n}\n\n/** The per-turn footer is a compact secondary/gray Slack `context` block. Exported so\n * the daemon can include it in the reply's initial chat.postMessage (the only reliable\n * point at which Slack's unfurl controls apply). */\nexport function buildAttributionBlocks(info: SlackAttributionInfo): { text: string; blocks: unknown[] } {\n return {\n text: attributionText(info),\n blocks: [{ type: 'context', elements: [{ type: 'mrkdwn', text: attributionMrkdwn(info) }] }]\n }\n}\n\ntype PlanEntry = { content?: string; status?: 'pending' | 'in_progress' | 'completed' }\n\n/** A plan entry is a task title, not a paragraph. Slack imposes no length on a rich-text\n * list item (200 items of 3,000 characters all post fine), so this cap is editorial: it\n * keeps one runaway entry from swallowing the message. */\nconst MAX_PLAN_LABEL = 150\n\n/** Render an ACP plan (full entry list, resent on every update) as a native bulleted list:\n * completed entries struck through, the entry in flight bolded, the rest plain, under a\n * `Plan · n/m` heading and ruled top and bottom so it reads as the turn's own artifact\n * rather than one more chrome message in the thread.\n *\n * Deliberately NOT Block Kit `checkboxes`, which is the prettier first instinct: that\n * element is an INPUT with no read-only variant, so it offers a click that can do nothing —\n * the plan belongs to the agent, and a reader ticking a box states nothing the daemon should\n * believe. It also caps at 10 options and 150 characters per label, both ENFORCED rather\n * than truncated. A struck-through line says \"done\" just as plainly and promises nothing.\n *\n * `text` is the notification/fallback string, never displayed when the blocks render. */\nfunction renderPlan(entries: PlanEntry[]): { text: string; blocks: unknown[]; markdown: string } {\n const done = entries.filter((e) => e.status === 'completed').length\n const item = (entry: PlanEntry) => ({\n type: 'rich_text_section',\n elements: [\n {\n type: 'text',\n text: clampTo(entry.content ?? '', MAX_PLAN_LABEL),\n ...(entry.status === 'completed'\n ? { style: { strike: true } }\n : entry.status === 'in_progress'\n ? { style: { bold: true } }\n : {})\n }\n ]\n })\n // The fallback is NOT dead weight beside the blocks: Slack routes top-level `text` to screen\n // readers and to the notification preview, and reads neither from the interior blocks. Left\n // as the bare count it would be the one place the plan does not exist for those two readers,\n // which is a regression against the text renderer this replaces. Statuses spell out as words\n // rather than glyphs, because that is the form being read ALOUD.\n const spoken = (status?: string) =>\n status === 'completed' ? 'done' : status === 'in_progress' ? 'in progress' : 'to do'\n return {\n text: [\n `Plan · ${done}/${entries.length}`,\n ...entries.map((e) => `${spoken(e.status)}: ${clampTo(e.content ?? '', MAX_PLAN_LABEL)}`)\n ].join('\\n'),\n markdown: planCanvasMarkdown(entries),\n blocks: [\n { type: 'divider' },\n { type: 'context', elements: [{ type: 'mrkdwn', text: `*Plan* · ${done}/${entries.length}` }] },\n { type: 'rich_text', elements: [{ type: 'rich_text_list', style: 'bullet', elements: entries.map(item) }] },\n { type: 'divider' }\n ]\n }\n}\n\n/** The plan as canvas markdown: a checklist, the step in progress in bold. Canvases nest no lists inside numbered ones. */\nexport function planCanvasMarkdown(entries: PlanEntry[]): string {\n const line = (entry: PlanEntry) => {\n const content = (entry.content ?? '').replace(/\\s+/g, ' ').trim()\n if (entry.status === 'completed') return `- [x] ${content}`\n return entry.status === 'in_progress' ? `- [ ] **${content}**` : `- [ ] ${content}`\n }\n return ['# Plan', '', ...entries.map(line)].join('\\n')\n}\n\n/** Render the accumulated reasoning trace (high mode) as one in-place message. Posted as\n * a `markdown` block (verbatim CommonMark, so `**bold**`), tail-clamped to a compact cap\n * — the newest thinking is the most relevant, so keep the end and mark truncation with a\n * leading ellipsis. */\nfunction renderReasoning(buf: string): string {\n const trimmed = buf.trim()\n const tail = trimmed.length > MAX_REASONING ? `…${trimmed.slice(-MAX_REASONING)}` : trimmed\n return `:thought_balloon: **Thinking**\\n${tail}`\n}\n\n/** The session status-bar inputs: the model selector (distilled by the daemon) plus the\n * folded ACP usage snapshot. Every field is optional — a runtime may advertise no model,\n * and context/token/cost each arrive on their own cadence (context/cost stream live;\n * token totals refresh at turn end). */\nexport interface StatusBarInfo {\n runtime?: string\n model?: string\n effort?: string\n /** Effective session permission preset. Codex Auto is a composite value, not a raw ACP mode. */\n permissionMode?: string\n fastMode?: boolean\n contextUsed?: number\n contextSize?: number\n totalTokens?: number\n costAmount?: number\n costCurrency?: string\n // Selectable model / effort lists + whether a fast toggle is offered — the modal's\n // dropdowns/toggle (and the console's, carried on the webchat frame). renderStatusBar\n // ignores these; only buildStatusModal / the web bar consume them.\n models?: string[]\n efforts?: string[]\n /** Selectable session presets; may include the synthetic Codex Auto value. */\n permissionModes?: string[]\n fastModeAvailable?: boolean\n /** A message sent during this turn can be steered into it (webchat status only). */\n steerable?: boolean\n // Current Slack output verbosity (daemon-side minimal/low/medium/high). Modal-only selector;\n // the level set is a fixed enum, so there's no \"available\" list. renderStatusBar ignores it.\n outputMode?: 'none' | 'minimal' | 'low' | 'medium' | 'high'\n sessionId?: string\n // Full token breakdown — shown in the Slack modal's detail block (the compact line only\n // shows totalTokens). All optional; absent fields are simply omitted from the detail.\n inputTokens?: number\n outputTokens?: number\n thoughtTokens?: number\n cachedReadTokens?: number\n cachedWriteTokens?: number\n}\n\n/** Concrete agent identity shown at the top of the Session modal. Kept separate from\n * StatusBarInfo so agent chrome never leaks into the compact status/webchat payload. */\nexport interface StatusModalIdentity {\n name: string\n agentUrl?: string\n iconUrl?: string\n sessionTitle?: string\n}\n\n/** Compact a token count as `1.2k` / `3.4M` (whole numbers under 1000 stay verbatim). */\nfunction compactCount(n: number): string {\n if (n < 1000) return String(n)\n if (n < 1_000_000) return `${(n / 1000).toFixed(n < 10_000 ? 1 : 0)}k`\n return `${(n / 1_000_000).toFixed(1)}M`\n}\n\n/** Render the compact in-thread status line as one `markdown` block — e.g.\n * `:bar_chart: *opus-4.8* · fast · ctx 120k/200k (60%) · 45.2k tok`. Deliberately narrow:\n * effort and cost are omitted here (they live in the Configure modal) to keep the line short in a\n * Slack thread. Pure: unknown fields are dropped so a partial snapshot still yields a clean\n * line, and an empty snapshot degrades to a bare `:bar_chart: —` placeholder. */\nexport function renderStatusBar(info: StatusBarInfo): string {\n const parts: string[] = []\n if (info.model) parts.push(`*${escapeMrkdwnLabel(info.model)}*`)\n if (info.fastMode) parts.push('fast')\n if (info.contextUsed !== undefined && info.contextSize !== undefined && info.contextSize > 0) {\n const pct = Math.round((info.contextUsed / info.contextSize) * 100)\n parts.push(`ctx ${compactCount(info.contextUsed)}/${compactCount(info.contextSize)} (${pct}%)`)\n } else if (info.contextUsed !== undefined) {\n parts.push(`ctx ${compactCount(info.contextUsed)}`)\n }\n if (info.totalTokens !== undefined) parts.push(`${compactCount(info.totalTokens)} tok`)\n return `:bar_chart: ${parts.length ? parts.join(' · ') : '—'}`\n}\n\n// Native code-channel chrome stays compact; the settings modal owns output mode and token totals.\nexport function renderCodeContextLabels(info: StatusBarInfo): { model: string; context?: string } {\n const model = clampTo([info.model, info.effort].filter(Boolean).join(' · ') || 'Session settings', 128)\n const context =\n info.contextUsed === undefined\n ? undefined\n : `${compactCount(info.contextUsed)}${info.contextSize !== undefined && info.contextSize > 0 ? `/${compactCount(info.contextSize)}` : ''}`\n return { model, context }\n}\n\n/** Slack action_ids for the interactive status bar + modal. The protocol owns the\n * values because a shared bot receives the same actions on the relay first. */\nexport const STATUS_ACTION = SLACK_STATUS_ACTION\n\n/** URL-only OAuth button. Direct Socket Mode bots still receive its interaction\n * payload and must ACK it; shared HTTP bots are ACKed by the relay ingress. */\nexport const PERMISSION_UPDATE_ACTION = 'ac_update_permissions'\n/** A capability card's link button (capability-requests.md §4.4.2): Slack still sends its click, which is acked and ignored. */\nexport const CAPABILITY_OPEN_ACTION = 'ac_capability_open'\n\n/** The modal view's callback_id — used if we ever handle a submit (controls apply on\n * interaction today, so there's no submit). */\nexport const STATUS_MODAL_CALLBACK = 'ac_status_modal'\n\n/** Human label for a permission request: the runtime's description, else `toolCall.title` (a shell title is the raw command), `kind`, `toolCallId`. */\nexport function permToolLabel(params: RequestPermissionRequest): string {\n const tc = params.toolCall\n const label =\n permDescription(params) || tc?.title?.trim() || tc?.kind?.trim() || tc?.toolCallId?.trim() || 'a tool call'\n return clampTo(label, 200)\n}\n\n/** A shell request's one-line description, read only beside a `command`: an MCP tool's top-level input may have a `description` argument. */\nfunction permDescription(params: RequestPermissionRequest): string {\n const tc = params.toolCall\n if (!tc || !rawInputField(tc, 'command')) return ''\n const description = rawInputDescription(tc)\n return isStepLabel(description) ? description : ''\n}\n\n/** The command a described request will run, so a card never shows only the model's account of it; '' when the label is the title. */\nexport function permToolCommand(params: RequestPermissionRequest): string {\n const tc = params.toolCall\n return tc && permDescription(params) ? rawInputField(tc, 'command') : ''\n}\n\n/** How much of a permission request's command a card shows. */\nexport const PERMISSION_COMMAND_CAP = 1500\n\n/** {@link permToolCommand} clamped for a card, '' when there is none. */\nexport function permCommandText(params: RequestPermissionRequest): string {\n const command = permToolCommand(params)\n return command ? clampTo(command, PERMISSION_COMMAND_CAP) : ''\n}\n\n/** `text` with the request's command on its own line, passed through `format`, for a plain-text card. */\nexport function appendPermCommand(\n text: string,\n params: RequestPermissionRequest,\n format: (command: string) => string = (command) => command\n): string {\n const command = permCommandText(params)\n return command ? `${text}\\n${format(command)}` : text\n}\n\n/** A described request's command as its own code-block section (backtick runs split, since mrkdwn fences cannot grow); none otherwise. */\nfunction permCommandBlocks(params: RequestPermissionRequest): unknown[] {\n const command = permCommandText(params)\n if (!command) return []\n const body = clampTo(escapeSlackMrkdwn(command.replace(/`(?=`)/g, '`\\u200b')), SLACK_SECTION_TEXT_CAP - 8)\n return [{ type: 'section', text: agentMrkdwn(`\\`\\`\\`\\n${body}\\n\\`\\`\\``) }]\n}\n\n/** Slack button color for a permission option: green for allow, red for reject, default\n * (gray) for anything else the runtime might send. */\nfunction permOptionStyle(kind: string): 'primary' | 'danger' | undefined {\n if (kind === 'allow_once' || kind === 'allow_always') return 'primary'\n if (kind === 'reject_once' || kind === 'reject_always') return 'danger'\n return undefined\n}\n\n/** How many option buttons one permission card offers. Slack allows 25 elements in one `actions`\n * block and wraps them across lines, and this card puts nothing else in that block — so the cap\n * is the block's own, not a row's. The 5 this used to slice to was neither. */\nexport const SLACK_PERMISSION_MAX_OPTIONS = 25\n\n/** The permission card: label, command, one `<requestId>|<optionId>` button per option; null when not every option fits, never a partial menu (#1811). */\nexport function buildPermissionCard(\n requestId: string,\n params: RequestPermissionRequest,\n sessionTarget?: string\n): unknown[] | null {\n if (!params.options.length || params.options.length > SLACK_PERMISSION_MAX_OPTIONS) return null\n const header = `:lock: *Permission requested* — ${escapeSlackMrkdwn(permToolLabel(params))}`\n const buttons = params.options.map((o, i) => {\n const style = permOptionStyle(o.kind)\n return {\n type: 'button',\n action_id: `${PERMISSION_ACTION_PREFIX}:${i}`,\n text: { type: 'plain_text', text: clampTo(o.name, 75), emoji: true },\n value: encodePermValue(requestId, o.optionId),\n ...(style ? { style } : {})\n }\n })\n return [\n { type: 'section', text: agentMrkdwn(header) },\n ...permCommandBlocks(params),\n { type: 'actions', ...(sessionTarget ? { block_id: sessionTarget } : {}), elements: buttons }\n ]\n}\n\n/** The settled permission card, buttons replaced by `decision`; `allowed` picks the icon (undefined ⇒ ⌛ cancelled/expired). Pure. */\nexport function buildPermissionResolvedCard(\n params: RequestPermissionRequest,\n decision: string,\n allowed?: boolean\n): unknown[] {\n const icon = allowed === undefined ? ':hourglass:' : allowed ? ':white_check_mark:' : ':no_entry_sign:'\n return [\n {\n type: 'section',\n text: agentMrkdwn(\n `:lock: *Permission* — ${escapeSlackMrkdwn(permToolLabel(params))}\\n${icon} ${escapeSlackMrkdwn(decision)}`\n )\n },\n ...permCommandBlocks(params)\n ]\n}\n\n/** Context header for an approval DM (slack-approval-dm.md §5.2): which agent is\n * asking, who triggered the turn, a quote of the triggering Slack message, the\n * console session deep link, and a permalink to the source thread. Pure. */\nexport function buildApprovalDmIntro(info: {\n agentName: string\n requesterName?: string | null\n sessionUrl: string\n sourceUrl?: string\n sourceText?: string\n /** A background sub-session is asking (assistant-mode.md §5.6); `sessionUrl` is its own page. */\n subsession?: { title: string | null; waitHours: number }\n}): unknown[] {\n if (info.subsession) {\n const { title, waitHours } = info.subsession\n return [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: `${subsessionAsker(info.agentName, title)} is waiting on an approval. ${subsessionWaitNote(waitHours)}\\n<${info.sessionUrl}|Open the task>`\n }\n }\n ]\n }\n const requester = info.requesterName ? ` for *${escapeMrkdwnLabel(clampTo(info.requesterName, 60))}*` : ''\n // Quoted on every line so a multi-line message stays one visual quote block.\n const quote = info.sourceText?.trim()\n ? `\\n${clampTo(info.sourceText.trim(), 300)\n .split('\\n')\n .map((line) => `> ${line}`)\n .join('\\n')}`\n : ''\n const links = [`<${info.sessionUrl}|Open session>`, ...(info.sourceUrl ? [`<${info.sourceUrl}|Source thread>`] : [])]\n return [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: `*${escapeMrkdwnLabel(clampTo(info.agentName, 60))}* is waiting on an approval${requester}.${quote}\\n${links.join(' · ')}`\n }\n }\n ]\n}\n\n/** The owner's DM when an API caller answers a computer-use approval on its own stream (computer-use.md §4.2). Pure. */\nexport function buildComputerCallerApprovalNotice(info: {\n agentName: string\n title: string\n sessionUrl: string\n}): unknown[] {\n const link = safeSlackLinkUrl(info.sessionUrl)\n return [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text:\n `:computer: *${escapeMrkdwnLabel(clampTo(info.agentName, 60))}* asked for approval to use your Computer: ` +\n `${escapeMrkdwnLabel(clampTo(info.title, 200))}. The API caller that started this session answers it.` +\n (link ? `\\n<${link}|Open session>` : '')\n }\n }\n ]\n}\n\n/** \"Agent's task “label”\", the subject of every task approval card; no quote without a label. */\nfunction subsessionAsker(agentName: string, title: string | null): string {\n const agent = `*${escapeMrkdwnLabel(clampTo(agentName, 60))}*’s task`\n return title?.trim() ? `${agent} “${escapeMrkdwnLabel(clampTo(title.trim(), 80))}”` : agent\n}\n\nconst subsessionWaitNote = (hours: number): string =>\n `If nobody answers within ${hours} hour${hours === 1 ? '' : 's'}, it is denied and the task stops.`\n\n/** The header of a sub-session's approval card in the conversation it belongs to (assistant-mode.md §5.6). Pure. */\nexport function buildSubsessionApprovalIntro(info: {\n agentName: string\n title: string | null\n sessionUrl: string\n waitHours: number\n}): unknown[] {\n return [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: `${subsessionAsker(info.agentName, info.title)} is asking for permission. ${subsessionWaitNote(info.waitHours)}\\n<${info.sessionUrl}|Open the task>`\n }\n }\n ]\n}\n\n/** The neutral notice a sub-session's request leaves in its conversation when only an Agent editor may answer it (§5.6). Pure. */\nexport function buildSubsessionApprovalNotice(info: {\n agentName: string\n title: string | null\n sessionUrl: string\n waitHours: number\n}): unknown[] {\n return [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text:\n `:lock: ${subsessionAsker(info.agentName, info.title)} is waiting for permission. Ask an Agent editor to ` +\n `allow it from the Agent or Session page. ${subsessionWaitNote(info.waitHours)}\\n<${info.sessionUrl}|Open the task>`\n }\n }\n ]\n}\n\n/** How a sub-session's request ended, as its settled notice says (§5.6). */\nexport type SubsessionNoticeOutcome =\n { kind: 'allowed' | 'denied'; by: string | null } | { kind: 'expired'; hours: number } | { kind: 'cancelled' }\n\n/** The neutral notice rewritten in place once its request settles; like the notice, it names no tool (§5.6). Pure. */\nexport function buildSubsessionApprovalSettledNotice(\n info: { agentName: string; title: string | null; sessionUrl?: string },\n outcome: SubsessionNoticeOutcome\n): unknown[] {\n const link = info.sessionUrl ? `\\n<${info.sessionUrl}|Open the task>` : ''\n return [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: `${subsessionSettledLine(subsessionAsker(info.agentName, info.title), outcome)}${link}`\n }\n }\n ]\n}\n\n/** The editor path's notice in the turn's own conversation, rewritten in place once its request settles. Pure. */\nexport function buildTurnApprovalNotice(outcome?: SubsessionNoticeOutcome): unknown[] {\n const text = outcome\n ? turnNoticeSettledText(outcome, (name) => escapeMrkdwnLabel(clampTo(name, 60)))\n : TURN_NOTICE_TEXT\n return [{ type: 'section', text: { type: 'mrkdwn', text } }]\n}\n\nfunction subsessionSettledLine(asker: string, outcome: SubsessionNoticeOutcome): string {\n const by = (word: string, name: string | null): string =>\n name?.trim() ? ` ${word} ${escapeMrkdwnLabel(clampTo(name.trim(), 60))}` : ''\n switch (outcome.kind) {\n case 'allowed':\n return `:white_check_mark: ${asker} got permission${by('from', outcome.by)}.`\n case 'denied':\n return `:no_entry_sign: ${asker} was denied permission${by('by', outcome.by)}.`\n case 'expired':\n return `:no_entry_sign: ${asker} got no answer within ${outcome.hours} hour${outcome.hours === 1 ? '' : 's'}, so it was denied and stopped.`\n case 'cancelled':\n return `:hourglass: ${asker} no longer needs permission.`\n }\n}\n\n/** What an assistant-mode draft card shows (assistant-mode.md §5.5); a `task` is a check's proposal (§5.10), whose text is the task. */\nexport interface AssistantDraftCardView {\n agentName: string\n iconUrl?: string\n kind: 'reply' | 'elsewhere' | 'task'\n /** A proposal's own sentence, which the card leads with, its reason, and a follow-up form's follow-up. */\n proposal?: {\n sentence: string\n why: string\n followUp?: { title: string; doneWhen: string; nextCheck: number | null; watch?: string | null }\n }\n target: {\n platform: string\n channel: string\n isDm: boolean\n external: boolean\n /** The conversation's name, or the DM recipient's display name. */\n name?: string\n /** The DM recipient's platform user id. */\n userId?: string\n thread?: string\n threadLink?: string\n }\n /** The target platform's own name, for a place the reader cannot open from this workspace. */\n platformName: string\n text: string\n sessionUrl?: string\n}\n\n/** The draft card's buttons; values ride `ac_perm` so both Slack transports already route the click. */\nexport const ASSISTANT_DRAFT_CHOICES = { approve: 'approve', discard: 'discard' } as const\nexport type AssistantDraftChoice = keyof typeof ASSISTANT_DRAFT_CHOICES\n\n/** How much of a draft one card shows; the markdown block holds 12,000 characters. */\nconst DRAFT_CARD_TEXT_CAP = 10_000\n\n/** The actual destination: the recipient of a DM, the conversation by name, and its platform when it is not Slack. */\nfunction draftPlace(view: AssistantDraftCardView): string {\n const { target } = view\n const slack = target.platform === 'slack'\n const on = slack ? '' : ` on ${escapeMrkdwnLabel(view.platformName)}`\n const name = target.name ? escapeMrkdwnLabel(clampTo(target.name, 80)) : undefined\n if (target.isDm) {\n const who = slack && target.userId ? `<@${escapeMrkdwnLabel(target.userId)}>` : name ? `*${name}*` : undefined\n return who ? `a direct message to ${who}${on}` : `a direct message${on}`\n }\n if (slack) return `<#${escapeMrkdwnLabel(target.channel)}>${name ? ` (#${name})` : ''}`\n return `*${name ?? escapeMrkdwnLabel(target.channel)}*${on}`\n}\n\n/** The destination's identifiers: the conversation id, and the thread by link or id. */\nfunction draftDestinationNote(view: AssistantDraftCardView): string {\n const { target } = view\n const parts = [`${escapeMrkdwnLabel(view.platformName)} \\`${escapeMrkdwnLabel(target.channel)}\\``]\n if (target.isDm && target.name && target.userId) parts.push(escapeMrkdwnLabel(clampTo(target.name, 80)))\n if (target.thread) {\n const link = safeSlackLinkUrl(target.threadLink)\n parts.push(\n link ? `<${link}|thread ${escapeMrkdwnLabel(target.thread)}>` : `thread \\`${escapeMrkdwnLabel(target.thread)}\\``\n )\n }\n return parts.join(' · ')\n}\n\n/** The one plain sentence a draft card leads with: where it goes, and that it posts on approval; a proposal's own sentence, bold, as the bot already names its sender. */\nfunction draftSentence(view: AssistantDraftCardView): string {\n if (view.kind === 'task') return `*${escapeSlackMrkdwn(clampTo(view.proposal?.sentence.trim() ?? '', 300))}*`\n const agent = `*${escapeMrkdwnLabel(clampTo(view.agentName, 60))}*`\n const place = draftPlace(view)\n if (view.kind === 'reply') {\n return `${agent} drafted a reply in ${place}, which is shared with another organization. It posts in the same thread once you approve.`\n }\n const external = view.target.external ? ', which is shared with another organization,' : ''\n return `${agent} will post this to ${place}${external} once you approve.`\n}\n\n/** The exact text, quoted; a text longer than the card holds says how much is shown. A proposal shows its reason and what it does. */\nfunction draftBody(view: AssistantDraftCardView): unknown[] {\n if (view.kind === 'task') return proposalBody(view)\n const shown = view.text.length > DRAFT_CARD_TEXT_CAP ? view.text.slice(0, DRAFT_CARD_TEXT_CAP) : view.text\n const quoted = shown\n .split('\\n')\n .map((line) => `> ${line}`)\n .join('\\n')\n const blocks: unknown[] = [{ type: 'markdown', text: quoted }]\n const notes: string[] = [draftDestinationNote(view)]\n if (shown.length < view.text.length) {\n notes.push(`Showing the first ${shown.length} of ${view.text.length} characters; the whole text posts.`)\n }\n const session = safeSlackLinkUrl(view.sessionUrl)\n if (session) notes.push(`<${session}|Open session>`)\n blocks.push({ type: 'context', elements: [{ type: 'mrkdwn', text: notes.join(' · ') }] })\n return blocks\n}\n\n/** A proposal's reason; a follow-up form's, then what it will do and its first check. */\nfunction proposalBody(view: AssistantDraftCardView): unknown[] {\n const why = view.proposal?.why.trim() ?? ''\n const blocks: unknown[] = why ? [{ type: 'markdown', text: clampTo(why, 2_000) }] : []\n const followUp = view.proposal?.followUp\n return followUp ? [...blocks, ...followUpProposalBody(followUp)] : blocks\n}\n\n/** A follow-up form's sentence of what it will do, what it watches, and its first check as a date in the reader's own time zone. */\nfunction followUpProposalBody(followUp: {\n doneWhen: string\n nextCheck: number | null\n watch?: string | null\n}): unknown[] {\n const doneWhen = followUp.doneWhen.trim()\n const at = followUp.nextCheck\n const watched = followUp.watch ? parseFollowUpWatchUrl(followUp.watch) : undefined\n return [\n ...(doneWhen ? [{ type: 'markdown', text: clampTo(doneWhen, 2_000) }] : []),\n ...(watched && 'target' in watched\n ? [\n {\n type: 'context',\n elements: [{ type: 'mrkdwn', text: escapeMrkdwnLabel(`Watches ${followUpWatchLabel(watched.target)}`) }]\n }\n ]\n : []),\n // Slack's date token renders in the reader's own time zone, which a markdown block does not.\n ...(at === null\n ? []\n : [\n {\n type: 'context',\n elements: [\n {\n type: 'mrkdwn',\n text: `🕒 <!date^${Math.floor(at / 1000)}^{date_short_pretty} {time}|${new Date(at).toISOString()}>`\n }\n ]\n }\n ])\n ]\n}\n\n/** A pending draft: the sentence, the exact text, and approve / discard; a proposal offers approve / deny. */\nexport function buildAssistantDraftCard(\n draftId: string,\n view: AssistantDraftCardView,\n options: { routingTarget?: string; notice?: string }\n): unknown[] {\n const button = (choice: AssistantDraftChoice, index: number, text: string, style?: 'primary' | 'danger') => ({\n type: 'button',\n action_id: `${PERMISSION_ACTION_PREFIX}:${index}`,\n text: { type: 'plain_text', text, emoji: true },\n value: encodePermValue(draftId, ASSISTANT_DRAFT_CHOICES[choice]),\n ...(style ? { style } : {})\n })\n const task = view.kind === 'task'\n const elements = [\n button('approve', 0, 'Approve', 'primary'),\n button('discard', 1, task ? 'Deny' : 'Discard', 'danger')\n ]\n return [\n { type: 'section', text: { type: 'mrkdwn', text: draftSentence(view) } },\n ...draftBody(view),\n ...(options.notice\n ? [{ type: 'context', elements: [{ type: 'mrkdwn', text: escapeSlackMrkdwn(clampTo(options.notice, 500)) }] }]\n : []),\n { type: 'actions', ...(options.routingTarget ? { block_id: options.routingTarget } : {}), elements }\n ]\n}\n\n/** A settled draft: the same sentence and text, the buttons replaced by what happened. */\nexport function buildAssistantDraftSettledCard(view: AssistantDraftCardView, outcome: string): unknown[] {\n return [\n { type: 'section', text: { type: 'mrkdwn', text: draftSentence(view) } },\n ...draftBody(view),\n { type: 'section', text: agentMrkdwn(escapeSlackMrkdwn(outcome)) }\n ]\n}\n\n/** Terminal rewrite for a DM card orphaned by a restart or takeover (§5.4): only the\n * stored row survives, so this renders from its bounded summary, no ACP params. Pure. */\nexport function buildApprovalOrphanCard(command: string, status: string, resolvedByName?: string | null): unknown[] {\n const icon = status === 'allowed' ? ':white_check_mark:' : status === 'denied' ? ':no_entry_sign:' : ':hourglass:'\n const by = resolvedByName ? ` by ${escapeSlackMrkdwn(clampTo(resolvedByName, 60))}` : ''\n return [\n {\n type: 'section',\n text: agentMrkdwn(`:lock: *Permission* — ${escapeSlackMrkdwn(clampTo(command, 150))}\\n${icon} ${status}${by}`)\n }\n ]\n}\n\n/** A workspace-level OAuth warning shown when Slack rejects an API call with\n * `missing_scope`. The URL button needs no daemon-side action handling: Slack opens\n * the app's OAuth & Permissions page directly so an owner can update/reinstall it. */\nexport function buildPermissionUpdateCard(updateUrl: string): unknown[] {\n return [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: ':warning: *Permissions update required.* Please update and re-authorize this Slack app to ensure all features work correctly.'\n }\n },\n {\n type: 'actions',\n elements: [\n {\n type: 'button',\n text: { type: 'plain_text', text: 'Update permissions', emoji: true },\n style: 'primary',\n url: updateUrl,\n action_id: PERMISSION_UPDATE_ACTION\n }\n ]\n }\n ]\n}\n\n// ── Elicitation (ACP elicitation/create — structured questions) ──────────────\n\n/** The field shapes an elicitation card can reduce a form to. `multi-enum` answers with a\n * LIST of the chosen values, `number` with a real JS number, the rest with one scalar. */\nexport type ElicitKind = 'enum' | 'boolean' | 'multi-enum' | 'text' | 'number'\n\n/** What a surface declares it is able to render — the field kinds it has controls for, and the\n * most options one of those controls may offer. {@link elicitTarget} skips every property the\n * surface has not claimed on either count, so a kind (or an option list) reaches a surface only\n * once that surface claims it, and a form it cannot show whole is declined rather than trimmed.\n * Every surface limit belongs here: a limit left inside a card builder is one the reduction\n * cannot see, which is exactly how an over-long option list used to be quietly cut to fit. An\n * option's own LENGTH is not among them any more — a Slack card carries positions rather than\n * values ({@link elicitOptionToken}), so no surface refuses a long one (#1794). */\nexport interface ElicitSurface {\n kinds: ReadonlySet<ElicitKind>\n /** The longest typed answer this surface's own control accepts, when that is shorter than\n * {@link ELICIT_TEXT_CAP}. Declared here for the same reason an option limit is: a bound left\n * in a card builder is one the REDUCTION cannot see, so a field the surface could never take\n * whole is discovered at build time, when the only move left is to withhold the entire card.\n * Applied here instead, an unanswerable field is simply not a field — and `elicitForm` then\n * declines the ask only when the schema actually REQUIRED it. */\n textLimits?: { maxLength?: number }\n /** Per-kind option limits, because one surface's controls do not all hold the same list: on\n * Slack a row of buttons and a select menu do not take the same number of options. A kind\n * absent from the map is unlimited — webchat renders them all. Widening one kind's limit\n * never widens another's. */\n optionLimits?: Partial<Record<ElicitKind, { maxOptions?: number }>>\n}\n\n/** Slack's own cap on a `plain_text_input`'s `min_length`/`max_length`. */\nconst SLACK_INPUT_LENGTH_CAP = 3000\n\n/** Slack allows 25 elements in one `actions` block and wraps them across lines, so the card can\n * offer every option of a list this long and still keep its Dismiss button. A longer list is\n * declined: no card is built from a slice of it, which is what made a pick a misreported answer. */\nconst SLACK_ELICIT_MAX_BUTTONS = 24\n\n/** Slack's own cap on a select menu's `options`. */\nconst SLACK_SELECT_MAX_OPTIONS = 100\n\nconst ELICIT_OPTION_TOKEN_PREFIX = 'ac_o'\n\n/** The value one option carries ON A SLACK CARD: its POSITION in the field the card rendered,\n * never the option's own value. Slack caps an option object's `value` at 75 characters and a\n * button's at 2000, so an enum of paths, ids or a long URL could not carry its own answer and\n * was declined outright (#1794). A position always fits, and it resolves without a lookup table\n * to keep: the same trick {@link elicitFormBlockId} already uses for a field's block id, and\n * safe for the same reason — the daemon re-derives the field list from the card's own params\n * (#1815), so the position names the very option that was offered. Every Slack card carries\n * positions, so a token can never be mistaken for a literal one of its own options spells. */\nexport function elicitOptionToken(index: number): string {\n return `${ELICIT_OPTION_TOKEN_PREFIX}${index}`\n}\n\n/** The option one carried card value stands for, or null when it names none this field offered —\n * the server-side half of {@link elicitOptionToken}, and the only way a Slack answer becomes a\n * literal again. Pure. */\nexport function elicitOptionLiteral(target: ElicitTarget, carried: string): string | null {\n if (!carried.startsWith(ELICIT_OPTION_TOKEN_PREFIX)) return null\n const digits = carried.slice(ELICIT_OPTION_TOKEN_PREFIX.length)\n if (!/^\\d+$/.test(digits)) return null\n return target.options[Number(digits)]?.value ?? null\n}\n\n/** The literals a card's carried option value(s) stand for — `carried` unchanged for a field that\n * offers no options, and null when one of them names no option this field rendered, which is the\n * same verdict `fieldAccepts` reaches for an unoffered value. Pure. */\nexport function elicitCardValues(target: ElicitTarget, carried: string | string[]): string | string[] | null {\n if (!target.options.length) return carried\n if (!Array.isArray(carried)) return elicitOptionLiteral(target, carried)\n const out: string[] = []\n for (const one of carried) {\n const literal = elicitOptionLiteral(target, one)\n if (literal === null) return null\n out.push(literal)\n }\n return out\n}\n\n/** Slack renders a lone single-select or boolean as a row of buttons — one tap answers it — and\n * every other shape as `input` blocks in the message with one Confirm, since a select, a\n * checkbox list and a typed box all need something filled in before they can submit. The\n * option-taking controls carry different lists, which is why the limits are per kind rather than\n * one number for the surface. */\nexport const SLACK_ELICIT_SURFACE: ElicitSurface = {\n kinds: new Set<ElicitKind>(['enum', 'boolean', 'multi-enum', 'text', 'number']),\n textLimits: { maxLength: SLACK_INPUT_LENGTH_CAP },\n optionLimits: {\n enum: { maxOptions: SLACK_ELICIT_MAX_BUTTONS },\n 'multi-enum': { maxOptions: SLACK_SELECT_MAX_OPTIONS }\n }\n}\n\n/** The approval DM's card is a button row whose taps settle through the editor path, which holds\n * no per-card state — so every kind that needs a Confirm to submit could be shown there but never\n * confirmed, and all of them are withheld rather than posted dead. What is left is exactly the\n * one-tap half of the in-channel Slack surface. */\nexport const SLACK_DM_ELICIT_SURFACE: ElicitSurface = {\n kinds: new Set<ElicitKind>(['enum', 'boolean']),\n optionLimits: { enum: { maxOptions: SLACK_ELICIT_MAX_BUTTONS } }\n}\n\n/** Webchat's card has toggles, a confirm control and a typed input, so it takes every kind,\n * and its list scrolls, so it declares no option limit. */\nexport const WEBCHAT_ELICIT_SURFACE: ElicitSurface = {\n kinds: new Set<ElicitKind>(['enum', 'boolean', 'multi-enum', 'text', 'number'])\n}\n\n/** The auth CLI drives a real terminal: an arrow-key list for the pickable kinds and a typed\n * line for the rest, so it claims every kind, and its list scrolls like webchat's — no limit. */\nexport const CLI_ELICIT_SURFACE: ElicitSurface = {\n kinds: new Set<ElicitKind>(['enum', 'boolean', 'multi-enum', 'text', 'number'])\n}\n\n/** The `format` values MCP `2025-11-25` defines for an elicited string — exactly these four. */\nexport type ElicitFormat = 'email' | 'uri' | 'date' | 'date-time'\nconst ELICIT_FORMATS: readonly ElicitFormat[] = ['email', 'uri', 'date', 'date-time']\n\n/** The one form field an elicitation card renders as buttons. */\nexport interface ElicitTarget {\n /** Property name in the form schema — the key the accepted value is returned under. */\n propName: string\n kind: ElicitKind\n /** Selectable options: `value` is the wire value returned in the accept content,\n * `label` is the human button text. Empty for `text`/`number`, which offer none. */\n options: { value: string; label: string }[]\n /** Selection bounds from the array schema — `multi-enum` only, absent when unbounded. */\n minItems?: number\n maxItems?: number\n /** String bounds — `text` only. `pattern` is present only when {@link safeElicitPattern} cleared it. */\n minLength?: number\n maxLength?: number\n pattern?: string\n format?: ElicitFormat\n /** Numeric bounds — `number` only; `integer` marks the schema's `integer` type. */\n minimum?: number\n maximum?: number\n integer?: boolean\n /** The schema's `default`, kept only when it satisfies this target's own constraints —\n * the card seeds its control with it, and the reader may still answer something else. */\n defaultValue?: string | number | boolean | string[]\n /** The property's own `description` — the question text, where `title` is only its header\n * (an AskUserQuestion bridge splits them that way). Absent when the schema gave none. */\n description?: string\n /** Set on a select question's free-text companion: the property whose question this box\n * types an answer for. Only ever a `text` target, and only when that question is rendered\n * in the same form — the card then places the box inside it instead of asking it twice. */\n customAnswerFor?: string\n}\n\n/** The longest answer a card accepts: an elicitation asks a question, not for a file. */\nconst ELICIT_TEXT_CAP = 4096\n\n/** The longest answer a PATTERN is matched against. Backtracking cost grows with the input,\n * so a screened pattern is only cheap over a short one — and a patterned field asks for a\n * name or an id, not prose. A longer answer is rejected rather than matched. */\nconst ELICIT_PATTERN_INPUT_CAP = 256\n\n/** The most quantifiers a screened pattern may carry. The group rule below stops nested\n * blow-up, but ADJACENT quantifiers backtrack polynomially with no group at all (`a*a*a*b`),\n * and degree is what the input cap is budgeted against. */\nconst ELICIT_PATTERN_QUANTIFIER_CAP = 3\n\n/**\n * Compile a schema `pattern` only when a linear-time match is assured, since the expression is\n * agent-authored and JS regexes backtrack: over-long sources and every quantified group whose\n * body itself quantifies or alternates ((a+)+, (a|a)*) are refused. A refused pattern makes the\n * property unrenderable, so the form declines rather than accepting an unchecked answer.\n */\nexport function safeElicitPattern(src: string): RegExp | null {\n if (src.length > 200) return null\n // Riskiness of the body being scanned, and of every enclosing group, innermost last.\n const enclosing: boolean[] = []\n let risky: boolean = false\n let quantifiers = 0\n for (let i = 0; i < src.length; i++) {\n const c = src[i]!\n if (c === '\\\\') i++\n else if (c === '[') {\n while (i < src.length && src[i] !== ']') i += src[i] === '\\\\' ? 2 : 1\n } else if (c === '(') {\n enclosing.push(risky)\n risky = false\n // A group modifier ((?:, (?=, (?!, (?<=, (?<name>) is syntax, not a quantifier.\n if (src[i + 1] === '?') {\n i++\n const kind = src[i + 1]\n if (kind === ':' || kind === '=' || kind === '!') i++\n else if (kind === '<') while (i + 1 < src.length && !'>=!'.includes(src[++i] ?? '')) {}\n }\n } else if (c === ')') {\n const body: boolean = risky\n const parent = enclosing.pop()\n if (parent === undefined) return null\n const quantified = i + 1 < src.length && '*+?{'.includes(src[i + 1]!)\n if (quantified && body) return null\n risky = parent || body || quantified\n } else if (c === '|' || '*+?{'.includes(c)) {\n if (c !== '|' && ++quantifiers > ELICIT_PATTERN_QUANTIFIER_CAP) return null\n risky = true\n }\n }\n if (enclosing.length) return null\n try {\n return new RegExp(src)\n } catch {\n return null\n }\n}\n\n/** A schema bound kept only when it is a real finite number. */\nfunction numBound(value: unknown): number | undefined {\n return typeof value === 'number' && Number.isFinite(value) ? value : undefined\n}\n\n/** A string-length bound, kept whenever it is a sane non-negative integer. A bound ABOVE the\n * cap is never dropped: silently losing a minimum would let an answer the schema forbids\n * through, so the caller compares it against the effective cap and declines instead. */\nfunction lengthBound(value: unknown): number | undefined {\n return itemBound(value)\n}\n\n/** The longest answer a text target can actually take: a pattern is only cheap over a short\n * input, so a patterned field's ceiling is the pattern cap rather than the answer cap. */\nfunction effectiveTextMax(pattern: string | undefined): number {\n return pattern === undefined ? ELICIT_TEXT_CAP : ELICIT_PATTERN_INPUT_CAP\n}\n\n/** The four `format` checks, each strict enough that a value passing it is one the agent asked for. */\nconst FORMAT_CHECK: Record<ElicitFormat, (value: string) => boolean> = {\n // Deliberately narrow: one @, no spaces, a dotted host — not a full RFC 5322 grammar.\n email: (v) => /^[^\\s@]+@[^\\s@.]+(\\.[^\\s@.]+)+$/.test(v),\n uri: (v) => {\n try {\n return !!new URL(v).protocol\n } catch {\n return false\n }\n },\n date: (v) => {\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(v)) return false\n // `2025-13-01` matches the shape but is not a date: toISOString would THROW on it.\n const d = new Date(`${v}T00:00:00Z`)\n return !Number.isNaN(d.getTime()) && v === d.toISOString().slice(0, 10)\n },\n 'date-time': (v) =>\n /^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?([Zz]|[+-]\\d{2}:\\d{2})$/.test(v) && !isNaN(Date.parse(v))\n}\n\n/** The options an array property's `items` offers, plus the `anyOf`/`oneOf` titled form. */\nfunction arrayOptions(prop: Record<string, unknown>): { value: string; label: string }[] {\n const items = prop.items as Record<string, unknown> | undefined\n const choices = (items?.anyOf ?? items?.oneOf) as { const?: unknown; title?: unknown }[] | undefined\n if (Array.isArray(choices))\n // A non-string const would make the accepted list lie about the schema's item type.\n return choices.every((o) => typeof o?.const === 'string')\n ? choices.map((o) => ({ value: String(o.const), label: clampTo(String(o.title ?? o.const), 75) }))\n : []\n const en = items?.enum\n return items?.type === 'string' && Array.isArray(en)\n ? en.map((v) => ({ value: String(v), label: clampTo(String(v), 75) }))\n : []\n}\n\n/** A schema bound, kept only when it is a sane non-negative integer. */\nfunction itemBound(value: unknown): number | undefined {\n return typeof value === 'number' && Number.isInteger(value) && value >= 0 ? value : undefined\n}\n\n/** Build the `text` target for a bare string property, or null when a constraint makes it\n * unrenderable: an unsupported `format`, a pattern we refuse to run, an impossible length. */\nfunction textTarget(name: string, prop: Record<string, unknown>, surfaceMax?: number): ElicitTarget | null {\n const format = prop.format\n if (format !== undefined && !ELICIT_FORMATS.includes(format as ElicitFormat)) return null\n const pattern = prop.pattern\n if (pattern !== undefined && (typeof pattern !== 'string' || !safeElicitPattern(pattern))) return null\n const min = lengthBound(prop.minLength)\n const declared = lengthBound(prop.maxLength)\n // The ceiling this surface can actually enforce. A declared minimum above it is\n // unanswerable — dropping it would accept a short answer the schema forbids — and the\n // effective maximum is carried on the target so the browser bounds its own draft by it.\n // Three ceilings, and the lowest wins: what a card accepts at all, what a pattern is cheap over,\n // and what THIS surface's own box holds — a Slack `plain_text_input` takes 3000 where the card\n // cap is 4096, so the same ask is a narrower box there and a shorter one is no answer at all.\n const ceiling = Math.min(effectiveTextMax(typeof pattern === 'string' ? pattern : undefined), surfaceMax ?? Infinity)\n const max = declared === undefined ? ceiling : Math.min(declared, ceiling)\n if (min !== undefined && min > max) return null\n if (max === 0) return null\n return {\n propName: name,\n kind: 'text',\n options: [],\n ...(min !== undefined ? { minLength: min } : {}),\n maxLength: max,\n ...(typeof pattern === 'string' ? { pattern } : {}),\n ...(format !== undefined ? { format: format as ElicitFormat } : {})\n }\n}\n\n/** Build the `number` target for a numeric property, or null when its bounds admit nothing. */\nfunction numberTarget(name: string, prop: Record<string, unknown>): ElicitTarget | null {\n const integer = prop.type === 'integer'\n const min = numBound(prop.minimum)\n const max = numBound(prop.maximum)\n if (min !== undefined && max !== undefined && min > max) return null\n // An integer range spanning no integer at all (0.2 … 0.8) is not a question either.\n if (integer && min !== undefined && max !== undefined && Math.ceil(min) > Math.floor(max)) return null\n return {\n propName: name,\n kind: 'number',\n options: [],\n ...(min !== undefined ? { minimum: min } : {}),\n ...(max !== undefined ? { maximum: max } : {}),\n ...(integer ? { integer: true } : {})\n }\n}\n\n/** Carry the schema's `default` onto a target, but only where the target itself would accept it —\n * the spec asks the card to pre-populate, and pre-populating an answer we would then refuse\n * hands the reader a control that cannot be submitted. */\nfunction withDefault(target: ElicitTarget, raw: unknown): ElicitTarget {\n if (raw === undefined) return target\n const ok =\n target.kind === 'boolean'\n ? typeof raw === 'boolean'\n : target.kind === 'multi-enum'\n ? Array.isArray(raw) && raw.every((v) => typeof v === 'string') && multiSelectAccepts(target, raw)\n : target.kind === 'number'\n ? typeof raw === 'number' && numberAccepts(target, raw)\n : target.kind === 'text'\n ? typeof raw === 'string' && textAccepts(target, raw)\n : typeof raw === 'string' && target.options.some((o) => o.value === raw)\n return ok ? { ...target, defaultValue: raw as ElicitTarget['defaultValue'] } : target\n}\n\n/** The form's `required` property names, as the schema spells them — anything that is not a\n * string is dropped, since it cannot name a property this scan produced. */\nexport function elicitRequiredProps(params: CreateElicitationRequest): string[] {\n const req = (params as { requestedSchema?: { required?: unknown } }).requestedSchema?.required\n return Array.isArray(req) ? req.filter((r): r is string => typeof r === 'string') : []\n}\n\n/** How a form card names one field: the schema's own `title` when it has one, else the property\n * name. A control stacked with others and labelled by neither is not answerable. */\nexport function elicitFieldLabel(params: CreateElicitationRequest, propName: string): string {\n const props = (params as { requestedSchema?: { properties?: Record<string, Record<string, unknown>> } })\n .requestedSchema?.properties\n const title = props?.[propName]?.title\n return clampTo((typeof title === 'string' && title.trim()) || propName, 75)\n}\n\n/** How a MULTI-FIELD card names one field. A select question's free-text companion is named for\n * the question it belongs to (\"Branch (Other)\") rather than on its own: \"Other\" beside a stack\n * of other labels says which words were typed but not what they answer. Pure. */\nexport function elicitFormFieldLabel(params: CreateElicitationRequest, target: ElicitTarget): string {\n const own = elicitFieldLabel(params, target.propName)\n if (!target.customAnswerFor) return own\n return clampTo(`${elicitFieldLabel(params, target.customAnswerFor)} (${own})`, 75)\n}\n\n// ACP's cross-agent marker for a select question's own free-text box, under a namespace-free `_meta` key on purpose.\nconst CUSTOM_ANSWER_META_KEY = '_askUserQuestionCustomAnswer'\n\n// Codex spells the same box its own way: `request_user_input` writes `_meta.codex.isOtherAnswer`, so both are read.\nconst CODEX_CUSTOM_ANSWER_META_KEY = 'codex'\n\n/** The longest question text a card carries under a field's label. */\nconst ELICIT_DESCRIPTION_MAX = 300\n\n/** The marker namespaces above, each with the flag that binds a box inside its question. */\nconst CUSTOM_ANSWER_MARKERS = [\n [CUSTOM_ANSWER_META_KEY, 'isCustomAnswer'],\n [CODEX_CUSTOM_ANSWER_META_KEY, 'isOtherAnswer']\n] as const\n\n/** The question a property's `_meta` claims this free-text box answers, or undefined when it\n * claims none — an unmarked property is a question in its own right. */\nfunction customAnswerOwner(prop: Record<string, unknown>): string | undefined {\n const meta = prop._meta as Record<string, unknown> | undefined\n for (const [key, flag] of CUSTOM_ANSWER_MARKERS) {\n const marker = meta?.[key] as Record<string, unknown> | undefined\n const owner = marker?.questionId\n if (marker?.[flag] === true && typeof owner === 'string' && owner) return owner\n }\n return undefined\n}\n\n/** Whether a property speaks a marker namespace at all, flag or no flag. A producer that speaks\n * one has already said what the box is, so its silence is a statement and not shape to guess at. */\nfunction speaksCustomAnswerMarker(prop: Record<string, unknown>): boolean {\n const meta = prop._meta as Record<string, unknown> | undefined\n return CUSTOM_ANSWER_MARKERS.some(([key]) => !!meta?.[key])\n}\n\n// What a bridge appends to a question's property name when it adds that question's own box:\n// `question_0_custom`, `need_type__other`. Read as the marker of LAST resort, so a bridge that\n// marks nothing (DeepSeek Harness spells the pair by name alone) still folds its box inside the\n// question instead of asking \"Other\" as a question of its own.\nconst CUSTOM_ANSWER_SUFFIXES = ['_custom', '_other', '-custom', '-other'] as const\n\n/** The select question this property name is the free-text box OF, by shape alone: another\n * rendered question's name plus a custom-answer suffix, with a doubled separator (`__other`)\n * read the same as a single one. Undefined when the name claims no question on this card. */\nfunction suffixedCustomAnswerOwner(propName: string, questions: Set<string>): string | undefined {\n const lower = propName.toLowerCase()\n for (const suffix of CUSTOM_ANSWER_SUFFIXES) {\n if (!lower.endsWith(suffix)) continue\n const stem = propName.slice(0, propName.length - suffix.length)\n for (const owner of [stem, stem.slice(0, -1)]) if (owner && questions.has(owner)) return owner\n }\n return undefined\n}\n\n/** A target whose {@link ElicitTarget.defaultValue} still names one of its own options — the\n * seed of a control that lost an option must not be a value the control cannot show. */\nfunction withoutStaleDefault(target: ElicitTarget): ElicitTarget {\n const values = new Set(target.options.map((o) => o.value))\n const raw = target.defaultValue\n const stale = Array.isArray(raw) ? raw.some((v) => !values.has(v)) : typeof raw === 'string' && !values.has(raw)\n if (!stale) return target\n const { defaultValue: _dropped, ...rest } = target\n return rest\n}\n\n/**\n * Every property of the form this surface can render, in schema order: string-enum (`oneOf`\n * titled options or bare `enum`), boolean, string-array multi-select (`items.enum` or\n * `items.anyOf`), free-text string, and number/integer — each only where the CALLING SURFACE\n * declares that kind. At most one target per property, since a property's `type` picks its\n * kind. The shared scan behind {@link elicitTarget} and {@link elicitForm}, so the two can\n * never disagree about what is renderable. Empty for URL-mode and an empty/absent schema.\n */\nfunction elicitCandidates(params: CreateElicitationRequest, surface: ElicitSurface): ElicitTarget[] {\n const p = params as {\n mode?: string\n requestedSchema?: { properties?: Record<string, Record<string, unknown>> }\n }\n if (p.mode !== 'form') return []\n const renderable = surface.kinds\n // A list this surface's control for that kind cannot hold whole is not a renderable field: a\n // card built from part of it would report the reader's pick as their answer to the question.\n const fits = (kind: ElicitKind, options: readonly { value: string }[]) => {\n const limits = surface.optionLimits?.[kind]\n return limits?.maxOptions === undefined || options.length <= limits.maxOptions\n }\n const found: ElicitTarget[] = []\n for (const [name, prop] of Object.entries(p.requestedSchema?.properties ?? {})) {\n const owner = customAnswerOwner(prop)\n // A companion's own description is boilerplate the inline placement already says; the\n // question's is the ask itself, which `title` (a header) does not carry.\n const desc = !owner && typeof prop.description === 'string' ? prop.description.trim() : ''\n const keep = (t: ElicitTarget | null) => {\n if (!t) return\n found.push(\n withDefault(\n {\n ...t,\n ...(desc ? { description: clampTo(desc, ELICIT_DESCRIPTION_MAX) } : {}),\n // Only a typed box can BE a custom answer; a marker on anything else is ignored.\n ...(owner && t.kind === 'text' ? { customAnswerFor: owner } : {})\n },\n prop.default\n )\n )\n }\n if (prop?.type === 'string') {\n const oneOf = prop.oneOf as { const?: unknown; title?: unknown }[] | undefined\n const en = prop.enum as unknown[] | undefined\n const options = Array.isArray(oneOf)\n ? oneOf.map((o) => ({ value: String(o.const), label: clampTo(String(o.title ?? o.const), 75) }))\n : Array.isArray(en)\n ? en.map((v) => ({ value: String(v), label: clampTo(String(v), 75) }))\n : []\n if (options.length && fits('enum', options) && renderable.has('enum'))\n keep({ propName: name, kind: 'enum', options })\n // Free text is the string with nothing to choose from — an enumerated one is a pick,\n // and typing into it would let an unoffered value through.\n if (!options.length && renderable.has('text')) keep(textTarget(name, prop, surface.textLimits?.maxLength))\n }\n if ((prop?.type === 'number' || prop?.type === 'integer') && renderable.has('number'))\n keep(numberTarget(name, prop))\n if (prop?.type === 'array' && renderable.has('multi-enum')) {\n const options = arrayOptions(prop)\n const min = itemBound(prop.minItems)\n const max = itemBound(prop.maxItems)\n // Bounds that admit only the empty selection, or none at all, are not a question.\n const askable = max === undefined || (max > 0 && max >= (min ?? 0))\n if (options.length && fits('multi-enum', options) && askable)\n keep({\n propName: name,\n kind: 'multi-enum',\n options,\n ...(min !== undefined ? { minItems: min } : {}),\n ...(max !== undefined ? { maxItems: max } : {})\n })\n }\n if (prop?.type === 'boolean' && renderable.has('boolean'))\n keep({\n propName: name,\n kind: 'boolean',\n options: [\n { value: 'true', label: 'Yes' },\n { value: 'false', label: 'No' }\n ]\n })\n }\n // A companion whose question this surface did not render has nothing to sit inside, so it\n // stands as a field of its own rather than pointing at a control that is not on the card.\n const questions = new Set(found.filter((t) => !t.customAnswerFor).map((t) => t.propName))\n // The unmarked pair, read by name off the questions that OFFER options — the shape only says\n // \"box for that question\" where the question has choices this box is an alternative to.\n const selects = new Set(found.filter((t) => t.kind === 'enum' || t.kind === 'multi-enum').map((t) => t.propName))\n const required = new Set(elicitRequiredProps(params))\n const bound = found.map((t) => {\n if (t.customAnswerFor) return questions.has(t.customAnswerFor) ? t : dropCustomAnswerFor(t)\n // Only where the property claimed no marker namespace of its own, and only where it is\n // OPTIONAL: a companion is an alternative to a pick, so a REQUIRED text property is a\n // question in its own right whatever it is named, and folding it would place a field the\n // answer cannot omit behind a chip that discloses it.\n if (t.kind !== 'text' || required.has(t.propName)) return t\n if (speaksCustomAnswerMarker(p.requestedSchema?.properties?.[t.propName] ?? {})) return t\n const owner = suffixedCustomAnswerOwner(t.propName, selects)\n return owner ? { ...t, customAnswerFor: owner } : t\n })\n // A question whose box the card offers ITSELF must not also offer that box as a choice: a\n // bridge that appends an \"Other\" option to the enum means \"type below\", but picking it answers\n // the question with a value the agent reads as no answer at all. Matched against the\n // companion's own label rather than any word, and never down to an empty list of options.\n const companionLabel = new Map<string, string>()\n for (const t of bound)\n if (t.customAnswerFor)\n companionLabel.set(t.customAnswerFor, elicitFieldLabel(params, t.propName).trim().toLowerCase())\n return bound.map((t) => {\n const label = companionLabel.get(t.propName)\n if (label === undefined || !t.options.length) return t\n const options = t.options.filter((o) => o.label.trim().toLowerCase() !== label)\n return options.length && options.length < t.options.length ? withoutStaleDefault({ ...t, options }) : t\n })\n}\n\n/** The same target with no owning question — a companion that turned out to point at nothing. */\nfunction dropCustomAnswerFor(target: ElicitTarget): ElicitTarget {\n const { customAnswerFor: _orphan, ...rest } = target\n return rest\n}\n\n/** The elicitation's URL-mode target (ACP `ElicitationUrlMode`), or null when this is not a\n * URL-mode ask. Only `http`/`https` survive: every other scheme — `javascript:`, `data:`,\n * `file:` — is something a consent card must never hand a browser as an href, and the caller\n * declines instead. The URL is returned VERBATIM, never re-serialized, because the reader has\n * to examine the same bytes the agent asked for. Pure. */\nexport function elicitUrl(params: CreateElicitationRequest): { elicitationId: string; url: string } | null {\n const p = params as { mode?: string; url?: unknown; elicitationId?: unknown }\n if (p.mode !== 'url') return null\n if (typeof p.url !== 'string' || typeof p.elicitationId !== 'string' || !p.elicitationId) return null\n if (p.url.length > 2048) return null\n let parsed: URL\n try {\n parsed = new URL(p.url)\n } catch {\n return null\n }\n if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') return null\n return { elicitationId: p.elicitationId, url: p.url }\n}\n\n/**\n * Resolve the single form field an elicitation card renders: the FIRST renderable property\n * that ALONE satisfies the schema's `required`. Returns null for URL-mode, an empty/absent\n * schema, a form whose fields this surface can't render, or one that requires a property other\n * than the rendered target — the daemon then declines rather than accepting a partial answer.\n * A candidate that fails that check does NOT end the scan: a later property may be the sole\n * required one, and stopping here would decline a form this surface can in fact answer. Pure,\n * and shared by every surface so the option values and their interpretation can't drift.\n */\nexport function elicitTarget(params: CreateElicitationRequest, surface: ElicitSurface): ElicitTarget | null {\n const required = elicitRequiredProps(params)\n // A required field we can't render is unanswerable: accepting without it would assert a lie.\n return elicitCandidates(params, surface).find((t) => required.every((r) => r === t.propName)) ?? null\n}\n\n/**\n * Resolve the WHOLE form a card renders one control per: every renderable property, in schema\n * order. Returns null when the surface can render nothing, when a `required` property is not\n * among the rendered set — {@link elicitTarget}'s rule (#1795) generalised from the one\n * rendered field to the rendered set, and still the difference between an honest `accept` and\n * a lie — or when the form asks more than {@link ELICIT_FORM_FIELD_CAP} QUESTIONS. A select\n * question's free-text companion is not one of them: it rides inside the question it belongs\n * to, so pairing every question with an \"Other\" box does not halve the form a card can show.\n * A one-field result is exactly what {@link elicitTarget} would return, which is what keeps a\n * single-field card's wire payload unchanged.\n */\nexport function elicitForm(params: CreateElicitationRequest, surface: ElicitSurface): ElicitTarget[] | null {\n const targets = elicitCandidates(params, surface)\n if (!targets.length || targets.filter((t) => !t.customAnswerFor).length > ELICIT_FORM_FIELD_CAP) return null\n const rendered = new Set(targets.map((t) => t.propName))\n return elicitRequiredProps(params).every((r) => rendered.has(r)) ? targets : null\n}\n\n/** Whether one value answers one field: the arity its kind is answered with, then that kind's\n * own accept check. The single-field card's gate, per field, so a form re-checks every one. */\nexport function fieldAccepts(target: ElicitTarget, value: string | number | string[]): boolean {\n if (Array.isArray(value)) return multiSelectAccepts(target, value)\n if (typeof value === 'number') return numberAccepts(target, value)\n if (target.kind === 'text') return textAccepts(target, value)\n // An enum or boolean answers with one of the values the card itself offered.\n return (target.kind === 'enum' || target.kind === 'boolean') && target.options.some((o) => o.value === value)\n}\n\n/** Whether a form answer is one the card it was posted for can accept: EXACTLY the fields that\n * card rendered (an extra or misspelled key would inject a property the agent never asked\n * for), every `required` one present, and each value valid for its own field. An optional\n * field may simply be absent — legal per the schema, and the reason #1795's rule was narrow.\n * One bad field refuses the whole answer; the card stays live to be answered again. */\nexport function elicitFormAccepts(\n targets: readonly ElicitTarget[],\n required: readonly string[],\n answer: Record<string, string | number | string[]>\n): boolean {\n const byName = new Map(targets.map((t) => [t.propName, t]))\n for (const name of required) if (!Object.hasOwn(answer, name)) return false\n for (const [name, value] of Object.entries(answer)) {\n const target = byName.get(name)\n if (!target || !fieldAccepts(target, value)) return false\n }\n return true\n}\n\n/** The accept content for a form answer: every answered field under its own property name,\n * each carrying the schema's own type — a boolean field's wire value is its option string,\n * which becomes a real boolean here for the same reason the single-field card converts it. */\nexport function elicitFormContent(\n targets: readonly ElicitTarget[],\n answer: Record<string, string | number | string[]>\n): Record<string, string | number | boolean | string[]> {\n const boolean = new Set(targets.filter((t) => t.kind === 'boolean').map((t) => t.propName))\n return Object.fromEntries(\n Object.entries(answer).map(([name, value]) => [name, boolean.has(name) ? value === 'true' : value])\n )\n}\n\n/** Whether a submitted list is an answer this multi-select target actually offered: every value\n * is one of its options, no repeats, and the count inside `minItems`/`maxItems`. */\nexport function multiSelectAccepts(target: ElicitTarget, values: string[]): boolean {\n if (target.kind !== 'multi-enum') return false\n if (new Set(values).size !== values.length) return false\n if (values.length < (target.minItems ?? 0)) return false\n if (target.maxItems !== undefined && values.length > target.maxItems) return false\n return values.every((v) => target.options.some((o) => o.value === v))\n}\n\n/** Whether a typed string is an answer this text target's own schema allows: inside the answer\n * cap and `minLength`/`maxLength`, matching `pattern`, and of the declared `format`. The\n * browser enforces the same rules to keep the control honest; this is what makes them binding. */\nexport function textAccepts(target: ElicitTarget, value: string): boolean {\n if (target.kind !== 'text') return false\n if (value.length > ELICIT_TEXT_CAP) return false\n if (value.length < (target.minLength ?? 0)) return false\n if (target.maxLength !== undefined && value.length > target.maxLength) return false\n if (target.format && !FORMAT_CHECK[target.format](value)) return false\n if (target.pattern === undefined) return true\n // maxLength already carries the pattern ceiling, so the expression only ever runs over a\n // short input; this is the belt to that braces, since the target arrives from a caller.\n if (value.length > ELICIT_PATTERN_INPUT_CAP) return false\n const re = safeElicitPattern(target.pattern)\n return !!re && re.test(value)\n}\n\n/** Whether a typed number is an answer this number target allows: real and finite, inside\n * `minimum`/`maximum`, and a whole number where the schema said `integer`. */\nexport function numberAccepts(target: ElicitTarget, value: number): boolean {\n if (target.kind !== 'number') return false\n if (!Number.isFinite(value)) return false\n if (target.integer && !Number.isInteger(value)) return false\n if (target.minimum !== undefined && value < target.minimum) return false\n return target.maximum === undefined || value <= target.maximum\n}\n\n/** How a card names the shape a `format` asks for — plain words, with an example where the shape\n * is not one, because the reader has to type it from the card alone. */\nconst FORMAT_EXPECTATION: Record<ElicitFormat, string> = {\n email: 'an email address',\n uri: 'a link',\n date: 'a date, like 2026-09-07',\n 'date-time': 'a date and time, like 2026-09-07T09:30:00Z'\n}\n\n/** What a typed field asks for, in plain words and never in schema vocabulary — said when an\n * entry does not fit, so the reader is told the shape rather than the schema keyword. Pure. */\nexport function elicitFieldExpectation(target: ElicitTarget): string {\n if (target.kind === 'number') {\n const noun = target.integer ? 'a whole number' : 'a number'\n const { minimum: min, maximum: max } = target\n if (min !== undefined && max !== undefined) return `${noun} from ${min} to ${max}`\n if (min !== undefined) return `${noun}, ${min} or more`\n return max !== undefined ? `${noun}, ${max} or less` : noun\n }\n const min = target.minLength\n // Only a bound TIGHTER than the ceilings this surface imposes is the reader's to break: our own\n // 4096/256 answer caps are not news, and a target cannot tell a declared 256 from the pattern one.\n const max =\n target.maxLength !== undefined && target.maxLength < ELICIT_PATTERN_INPUT_CAP ? target.maxLength : undefined\n const length =\n min !== undefined && max !== undefined\n ? `${min} to ${max} characters long`\n : min !== undefined\n ? `at least ${min} characters long`\n : max !== undefined\n ? `at most ${max} characters long`\n : ''\n const parts = [target.format ? FORMAT_EXPECTATION[target.format] : 'some text']\n if (length) parts.push(length)\n if (target.pattern !== undefined) parts.push('in the exact format the question asks for')\n return parts.join(', ')\n}\n\n/** The digit shapes a typed number may take. Deliberately narrower than `Number()`, which reads\n * `0x1f`, `Infinity` and whitespace as numbers a reader plainly did not type. */\nconst NUMERIC_REPLY_RE = /^[+-]?(\\d+\\.?\\d*|\\.\\d+)([eE][+-]?\\d+)?$/\n\nconst BARE_URL_RE = /(?:https?:\\/\\/|www\\.)\\S+/gi\n\n/** The agent-authored elicitation `message`, with every link in it defused. A form-mode ask\n * may not send the reader anywhere — the spec keeps URLs on URL-mode elicitations, whose\n * consent card is the only place a URL is ever followable — and Slack turns both bare URLs\n * and `<url|label>` into taps, so the angle-bracket form is escaped and the bare form is\n * wrapped in a code span, which Slack mrkdwn does not autolink. Pure. */\nfunction elicitCardMessage(params: CreateElicitationRequest): string {\n const raw = (params as { message?: string }).message?.trim() || 'The agent needs your input'\n return escapeSlackMrkdwn(raw).replace(BARE_URL_RE, (m) => `\\`${m}\\``)\n}\n\n/** The three characters Slack mrkdwn reads as markup rather than as themselves. Escaping them is\n * how a literal `&`, `<` or `>` reaches the reader — Slack unescapes the entities on display. */\nfunction escapeSlackMrkdwn(raw: string): string {\n return raw.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')\n}\n\n/** The text object for a section quoting agent words, already escaped: `verbatim` stops Slack autolinking a bare URL or domain. */\nfunction agentMrkdwn(text: string): { type: 'mrkdwn'; text: string; verbatim: true } {\n return { type: 'mrkdwn', text, verbatim: true }\n}\n\n/** Slack's own limit on one section's mrkdwn text. */\nconst SLACK_SECTION_TEXT_CAP = 3000\n\n/** How much of the agent's question a card carries. Cut only where Slack itself would refuse the\n * block — the old 400 cut ordinary questions Slack could have shown whole, and {@link clampTo}'s\n * trailing `…` is the only mark a cut ever gets, so a shorter cap is a quieter one. */\nconst ELICIT_MESSAGE_CAP = SLACK_SECTION_TEXT_CAP - 200\n\n/** What a multi-select card says its bounds are, so a refused Confirm is not the reader's first\n * news of them. Slack enforces the maximum itself (`max_selected_items`); the minimum is the\n * one a reader can break, and the daemon re-validates both either way. Empty when unbounded. */\nfunction selectionHint(target: ElicitTarget): string {\n const { minItems: min, maxItems: max } = target\n if (min !== undefined && max !== undefined) return min === max ? `Select exactly ${min}.` : `Select ${min} to ${max}.`\n if (min !== undefined) return `Select at least ${min}.`\n return max !== undefined ? `Select up to ${max}.` : ''\n}\n\n/** The Dismiss button every elicitation card carries — the reader's one explicit `decline`. */\nfunction elicitDismissButton(requestId: string): Record<string, unknown> {\n return {\n type: 'button',\n action_id: ELICIT_DISMISS_ACTION as string,\n text: { type: 'plain_text', text: 'Dismiss', emoji: true },\n value: requestId\n }\n}\n\n/** Element types Slack REFUSES inside a block, by block type. Slack rejects the WHOLE message\n * rather than the offending block, so a card that gets this wrong never posts and its request is\n * cancelled with no trace in the channel — which is exactly how a `multi_static_select` in an\n * `actions` block took down a live session. Verified against the live API, not read off the docs:\n * an `actions` block answers `unsupported element: multiselect` for a multi-select and\n * `unsupported type` for a typed input, and an `input` block holds no button. */\nconst SLACK_FORBIDDEN_ELEMENTS: Readonly<Record<string, ReadonlySet<string>>> = {\n actions: new Set([\n 'multi_static_select',\n 'multi_external_select',\n 'multi_users_select',\n 'multi_conversations_select',\n 'multi_channels_select',\n 'plain_text_input',\n 'number_input',\n 'email_text_input',\n 'url_text_input'\n ]),\n input: new Set(['button', 'overflow'])\n}\n\n/** How many `options` each element type holds. `checkboxes` and `radio_buttons` answer\n * `no more than 10 items allowed` past ten, where the select menus take a hundred — which is why\n * the card picks between them by list length rather than by taste. Verified against the API. */\nconst SLACK_ELEMENT_MAX_OPTIONS: Readonly<Record<string, number>> = {\n checkboxes: 10,\n radio_buttons: 10,\n static_select: 100,\n multi_static_select: 100,\n overflow: 5\n}\n\n/** The elements that HAVE a `max_selected_items`. `checkboxes` does not: Slack answers\n * `invalid additional property` for it, so a checkbox list's upper bound is said in the block's\n * hint and enforced when the answer comes back, never by the control. */\nconst SLACK_MAX_SELECTED_ELEMENTS: ReadonlySet<string> = new Set([\n 'multi_static_select',\n 'multi_external_select',\n 'multi_users_select',\n 'multi_conversations_select',\n 'multi_channels_select'\n])\n\n/** Slack's own caps on one `actions` block's elements, on an option object's `value`, and on an\n * interactive element's own `value`. Every Slack card carries positions rather than agent-authored\n * strings ({@link elicitOptionToken}), so nothing we build should reach either value cap — which\n * is exactly why they are asserted rather than assumed. */\nconst SLACK_ACTIONS_MAX_ELEMENTS = 25\nconst SLACK_OPTION_VALUE_CAP = 75\nconst SLACK_ACTION_VALUE_CAP = 2000\n\n/** Every Slack rule this file has paid for, checked over one card's blocks: the element types a\n * block type refuses, the per-element option caps, `max_selected_items` only where it exists,\n * an `input` block's mandatory element, an option value or an element `value` past Slack's own\n * cap, and block ids unique within the message. Returns the reasons Slack would reject the card,\n * empty when it would take it. Exported and asserted over every card we build, because our own\n * JSON looks valid to us right up until Slack sees it — the only reason #1825 shipped. Pure. */\nexport function slackCardViolations(blocks: readonly unknown[]): string[] {\n const bad: string[] = []\n const seen = new Set<string>()\n for (const [i, raw] of blocks.entries()) {\n const b = raw as SlackBlockShape\n if (typeof b.block_id === 'string') {\n if (seen.has(b.block_id)) bad.push(`blocks/${i}: duplicate block_id \"${b.block_id}\"`)\n seen.add(b.block_id)\n }\n const forbidden = SLACK_FORBIDDEN_ELEMENTS[b.type ?? ''] ?? new Set<string>()\n if (b.type === 'input' && !b.element?.type) bad.push(`blocks/${i}: input block has no element`)\n if (b.type === 'actions' && (b.elements?.length ?? 0) > SLACK_ACTIONS_MAX_ELEMENTS)\n bad.push(`blocks/${i}: ${b.elements?.length} elements in an actions block, past ${SLACK_ACTIONS_MAX_ELEMENTS}`)\n for (const el of [...(b.elements ?? []), ...(b.element ? [b.element] : [])]) {\n if (!el?.type) continue\n if (forbidden.has(el.type)) bad.push(`blocks/${i}: ${el.type} is not allowed in a ${b.type} block`)\n bad.push(...slackElementViolations(el, `blocks/${i}/${el.type}`))\n }\n }\n return bad\n}\n\n/** The shape {@link slackCardViolations} reads a block and its elements through — deliberately\n * everything-optional, since the point is to inspect JSON that may be wrong. */\ninterface SlackElementShape {\n type?: string\n value?: unknown\n options?: { value?: unknown }[]\n initial_options?: { value?: unknown }[]\n initial_option?: { value?: unknown }\n max_selected_items?: unknown\n}\ninterface SlackBlockShape {\n type?: string\n block_id?: string\n elements?: SlackElementShape[]\n element?: SlackElementShape\n}\n\n/** One element's own rules: its option cap, its option values, and whether it may be told a\n * maximum selection at all. Pure. */\nfunction slackElementViolations(el: SlackElementShape, at: string): string[] {\n const bad: string[] = []\n const cap = SLACK_ELEMENT_MAX_OPTIONS[el.type ?? '']\n if (cap !== undefined && (el.options?.length ?? 0) > cap)\n bad.push(`${at}: ${el.options?.length} options, past the ${cap} this element holds`)\n if (el.max_selected_items !== undefined && !SLACK_MAX_SELECTED_ELEMENTS.has(el.type ?? ''))\n bad.push(`${at}: max_selected_items is not a property of this element`)\n const values = [\n ...(el.options ?? []),\n ...(el.initial_options ?? []),\n ...(el.initial_option ? [el.initial_option] : [])\n ]\n for (const o of values)\n if (typeof o?.value === 'string' && o.value.length > SLACK_OPTION_VALUE_CAP)\n bad.push(`${at}: an option value is ${o.value.length} characters, past ${SLACK_OPTION_VALUE_CAP}`)\n // A button's own `value` — the cap that silently cost a long consent URL its whole card.\n if (typeof el.value === 'string' && el.value.length > SLACK_ACTION_VALUE_CAP)\n bad.push(`${at}: a value is ${el.value.length} characters, past ${SLACK_ACTION_VALUE_CAP}`)\n return bad\n}\n\n/**\n * Build the ONE-TAP elicitation card: the agent's `message` and one actions row carrying EVERY\n * {@link elicitTarget} option as a button, plus Dismiss. The choice rides each option's `value`\n * (`<requestId>|<optionToken>`, see {@link elicitOptionToken}). Only a single-select or a boolean\n * is answered this way — one tap IS the answer there, where every other kind needs something\n * filled in first and takes the\n * `input` blocks of {@link buildElicitationFormCard} ({@link elicitCardShape} decides). Returns\n * null when the form can't be rendered on `surface` (caller declines): a kind or an option list\n * it does not claim, which the reduction has already refused. Nothing here trims a list to fit.\n * Pure.\n */\nexport function buildElicitationCard(\n requestId: string,\n params: CreateElicitationRequest,\n sessionTarget?: string,\n surface: ElicitSurface = SLACK_ELICIT_SURFACE\n): unknown[] | null {\n const target = elicitTarget(params, surface)\n if (!target) return null\n const message = elicitCardMessage(params)\n // A lone question that has to be filled in is its own ONE-FIELD form: nothing tapped in an\n // `actions` block can carry what was typed or selected, so the control is an input block.\n if (elicitCardShape([target]) !== 'buttons')\n return buildElicitationFormCard(requestId, params, [target], sessionTarget)\n const buttons = target.options.map((o, i) => ({\n type: 'button',\n action_id: `${ELICIT_ACTION_PREFIX}:${i}`,\n text: { type: 'plain_text', text: o.label, emoji: true },\n value: encodePermValue(requestId, elicitOptionToken(i))\n }))\n buttons.push(elicitDismissButton(requestId) as (typeof buttons)[number])\n return [\n { type: 'section', text: agentMrkdwn(`:speech_balloon: ${clampTo(message, ELICIT_MESSAGE_CAP)}`) },\n { type: 'actions', ...(sessionTarget ? { block_id: sessionTarget } : {}), elements: buttons }\n ]\n}\n\n/** Where a DM sends a reader whose question Slack has no control for. Mirrors the in-channel\n * decline notice's words, minus its verdict: this ask is still open on the editor path. */\nconst ELICIT_DM_UNANSWERABLE =\n \":hourglass: This chat can't collect an answer for it — answer it in the session console, via *Open session* above.\"\n\nconst PERMISSION_DM_UNANSWERABLE =\n \":hourglass: This chat can't show every option for it — decide it in the session console, via *Open session* above.\"\n\n/** The stand-in for an approval DM's permission card that {@link buildPermissionCard} cannot\n * build: the ask, and where every option CAN be seen. The request is untouched — it stays open on\n * the editor path, which is where the DM points — so this is the same promise the elicitation\n * stand-in below makes, for the same reason (#1811). Pure. */\nexport function buildPermissionDmUnanswerableCard(params: RequestPermissionRequest): unknown[] {\n return buildPermissionResolvedCard(params, PERMISSION_DM_UNANSWERABLE, undefined)\n}\n\n/** The stand-in for an approval DM's elicitation card that {@link buildElicitationCard} cannot\n * build for the DM surface (#1794): the question, and where it CAN be answered. Without it the\n * DM went out carrying its intro and nothing else — a live request, no controls, and no hint\n * that the console holds the same ask — until the turn cancelled. The intro above it owns the\n * `Open session` link this points at, so the URL is never repeated. Pure. */\nexport function buildElicitDmUnanswerableCard(params: CreateElicitationRequest): unknown[] {\n return buildElicitationResolvedCard(params, ELICIT_DM_UNANSWERABLE)\n}\n\n/** Build the RESOLVED elicitation card (buttons removed) that replaces {@link\n * buildElicitationCard} once answered, dismissed, or cancelled. Pure. */\nexport function buildElicitationResolvedCard(params: CreateElicitationRequest, decision: string): unknown[] {\n const message = elicitCardMessage(params)\n const text = clampTo(`:speech_balloon: ${clampTo(message, ELICIT_MESSAGE_CAP)}\\n${decision}`, SLACK_SECTION_TEXT_CAP)\n return [{ type: 'section', text: agentMrkdwn(text) }]\n}\n\n// ── Elicitation form cards (`input` blocks in the message, issue #1794's last Slack item) ────\n\n/** The longest list `checkboxes` and `radio_buttons` hold — past ten Slack answers `no more than\n * 10 items allowed`, so a longer list falls back to the select menu, which holds a hundred. */\nconst SLACK_CHOICE_MAX_OPTIONS = 10\n\n/** Slack's own cap on an `input` block's hint. */\nconst SLACK_HINT_TEXT_CAP = 2000\n\n/** The `input` element one form field is answered by: for a pick, the control that fits the list —\n * `radio_buttons`/`checkboxes` for a short one, which show every option without a second tap, and\n * a select menu past what those hold — plus a `plain_text_input` for text and a `number_input` for\n * numbers, each carrying the schema's own bounds so Slack refuses on the card what the daemon\n * would refuse anyway. A checkbox list gets no `max_selected_items` (Slack has no such property\n * there): its bounds are said in the block's hint and enforced when the answer comes back, which\n * is where they were always binding. Null ⇒ this field cannot BE an input block — no options at\n * all, or a minimum length past what an input holds — and the whole card is then withheld rather\n * than posted with a field the reader cannot answer honestly. An option's own length is no longer\n * such a reason: every option carries its POSITION ({@link elicitOptionToken}). Pure. */\nfunction elicitFormInputElement(target: ElicitTarget): Record<string, unknown> | null {\n const action_id = ELICIT_FORM_INPUT_ACTION as string\n if (target.kind === 'text') {\n const min = target.minLength\n // Bounded by the REDUCTION, which drops a field whose own minimum is past this surface's box\n // ({@link SLACK_ELICIT_SURFACE.textLimits}) — so a target that reaches here already fits, and\n // this clamp is a floor under a bug rather than the place the limit is decided.\n const max = Math.min(target.maxLength ?? SLACK_INPUT_LENGTH_CAP, SLACK_INPUT_LENGTH_CAP)\n if (min !== undefined && min > max) return null\n return {\n type: 'plain_text_input',\n action_id,\n ...(min !== undefined ? { min_length: min } : {}),\n max_length: max,\n ...(typeof target.defaultValue === 'string' ? { initial_value: target.defaultValue } : {})\n }\n }\n if (target.kind === 'number') {\n return {\n type: 'number_input',\n action_id,\n is_decimal_allowed: target.integer !== true,\n ...(target.minimum !== undefined ? { min_value: String(target.minimum) } : {}),\n ...(target.maximum !== undefined ? { max_value: String(target.maximum) } : {}),\n ...(typeof target.defaultValue === 'number' ? { initial_value: String(target.defaultValue) } : {})\n }\n }\n const options = target.options.map((o, i) => ({\n text: { type: 'plain_text', text: o.label, emoji: true },\n value: elicitOptionToken(i)\n }))\n if (!options.length) return null\n const short = options.length <= SLACK_CHOICE_MAX_OPTIONS\n if (target.kind === 'multi-enum') {\n const seeded = Array.isArray(target.defaultValue) ? new Set(target.defaultValue) : null\n const initial = seeded ? options.filter((_, i) => seeded.has(target.options[i]!.value)) : []\n if (short)\n return { type: 'checkboxes', action_id, options, ...(initial.length ? { initial_options: initial } : {}) }\n return {\n type: 'multi_static_select',\n action_id,\n placeholder: { type: 'plain_text', text: 'Select options', emoji: true },\n options,\n ...(initial.length ? { initial_options: initial } : {}),\n ...(target.maxItems !== undefined ? { max_selected_items: target.maxItems } : {})\n }\n }\n // A boolean's `default` is a real boolean, so its option value is the string the card spells it with.\n const seed = target.kind === 'boolean' ? String(target.defaultValue) : target.defaultValue\n const seedIndex = target.options.findIndex((o) => o.value === seed)\n const initial = seedIndex < 0 ? undefined : options[seedIndex]\n if (short) return { type: 'radio_buttons', action_id, options, ...(initial ? { initial_option: initial } : {}) }\n return {\n type: 'static_select',\n action_id,\n placeholder: { type: 'plain_text', text: 'Choose one', emoji: true },\n options,\n ...(initial ? { initial_option: initial } : {})\n }\n}\n\n/** What one field's block says under its label: the question's own words, plus a multi-select's\n * bounds, since a checkbox list cannot enforce them itself. Empty when there is nothing to add. */\nexport function elicitFormFieldHint(target: ElicitTarget): string {\n const parts = [target.description ?? '', target.kind === 'multi-enum' ? selectionHint(target) : '']\n return clampTo(parts.filter(Boolean).join(' '), SLACK_HINT_TEXT_CAP)\n}\n\n/**\n * Build the elicitation card whose fields are ANSWERED IN THE MESSAGE: the agent's defused\n * question, then one `input` block per field in schema order — each keyed by {@link\n * elicitFormBlockId}, which is the key its submitted value comes back under — and one actions\n * block carrying Confirm and Dismiss, which share the `block_id` the relay routes on.\n *\n * ONE Confirm for the whole card, never one per question: a message's input values all arrive in\n * `state.values` on any button tap in that message, so a single button submits the lot. That is\n * also why a lone select that needs no typing keeps its row of buttons instead — one tap answers\n * it, and there is nothing to fill in first ({@link elicitCardShape}).\n *\n * Null ⇒ some field cannot be an input block (see {@link elicitFormInputElement}) and the caller\n * declines with a notice rather than posting a card with a field nobody can answer. Pure.\n */\nexport function buildElicitationFormCard(\n requestId: string,\n params: CreateElicitationRequest,\n form: readonly ElicitTarget[],\n sessionTarget?: string\n): unknown[] | null {\n const required = new Set(elicitRequiredProps(params))\n const inputs: Record<string, unknown>[] = []\n for (const [index, target] of form.entries()) {\n const element = elicitFormInputElement(target)\n if (!element) return null\n const hint = elicitFormFieldHint(target)\n inputs.push({\n type: 'input',\n block_id: elicitFormBlockId(index),\n label: { type: 'plain_text', text: elicitFormFieldLabel(params, target), emoji: true },\n // Slack enforces presence itself for a required field; a required multi-select then also\n // needs one selection, which is stricter than `minItems: 0` but never admits less.\n optional: !required.has(target.propName),\n ...(hint ? { hint: { type: 'plain_text', text: hint } } : {}),\n element\n })\n }\n return [\n {\n type: 'section',\n text: agentMrkdwn(`:speech_balloon: ${clampTo(elicitCardMessage(params), ELICIT_MESSAGE_CAP)}`)\n },\n ...inputs,\n {\n type: 'actions',\n ...(sessionTarget ? { block_id: sessionTarget } : {}),\n elements: [\n {\n type: 'button',\n action_id: ELICIT_CONFIRM_ACTION as string,\n text: { type: 'plain_text', text: 'Confirm', emoji: true },\n style: 'primary',\n value: requestId\n },\n elicitDismissButton(requestId)\n ]\n }\n ]\n}\n\n/** The two shapes a Slack elicitation card takes, decided by the reduction alone.\n *\n * A card is a row of BUTTONS exactly when ONE TAP CAN ANSWER IT: a single question that is a pure\n * single-select or a boolean. Everything else is INPUT blocks with one Confirm and one Dismiss —\n * a multi-select, a typed box, several questions, and a single question that brought a free-text\n * companion box. A button submits the instant it is tapped, which leaves no moment to fill\n * anything in; that is why a question gains a Confirm exactly when it has something to fill in.\n *\n * The companion case is not a guess about the schema: {@link elicitForm} already marks a companion\n * with {@link ElicitTarget.customAnswerFor} (the `_meta` flag an AskUserQuestion bridge or a Codex\n * `request_user_input` writes), so a question with a box is a reduction of two TARGETS and one\n * QUESTION, where two questions are two of each. Reading the TARGET count is therefore all this\n * needs: either way the card needs its inputs. Pure. */\nexport type ElicitCardShape = 'buttons' | 'inputs'\n\nexport function elicitCardShape(form: readonly ElicitTarget[]): ElicitCardShape {\n const only = form.length === 1 ? form[0]! : null\n return only && (only.kind === 'enum' || only.kind === 'boolean') ? 'buttons' : 'inputs'\n}\n\n/** What a refused field's error says, in the same plain words the card would have used — a\n * reader who has to retype something is told the shape, never the schema keyword. */\nfunction elicitFormFieldError(target: ElicitTarget): string {\n if (target.kind === 'text' || target.kind === 'number') return `Enter ${elicitFieldExpectation(target)}.`\n if (target.kind === 'multi-enum') return selectionHint(target) || 'Select from the options offered.'\n return 'Choose one of the options offered.'\n}\n\n/** A form card's answer, or the per-field errors that refuse it. Keyed by BLOCK id, which is what\n * the submitted state itself is keyed by. */\nexport interface ElicitFormSubmission {\n answer?: Record<string, string | number | string[]>\n errors?: Record<string, string>\n}\n\n/**\n * Decode one Confirm's raw field state into the typed record a form card answers with, re-derived\n * against the FORM THAT WAS RENDERED rather than trusted from the wire (#1815): each value is read\n * under its field's own block id, resolved from the position the card carried it as, given the\n * schema's own type — a real number for `number`/`integer`, a list for a multi-select — and\n * checked by {@link fieldAccepts}. A blank optional\n * input is simply absent; a missing REQUIRED field, a value of the wrong shape, and a value the\n * field does not admit each come back as that field's error, so one bad field refuses the whole\n * answer instead of being silently dropped. Pure.\n */\nexport function elicitFormSubmission(\n params: CreateElicitationRequest,\n form: readonly ElicitTarget[],\n fields: Readonly<Record<string, string | string[]>>\n): ElicitFormSubmission {\n const required = new Set(elicitRequiredProps(params))\n const answer: Record<string, string | number | string[]> = {}\n const errors: Record<string, string> = {}\n for (const [index, target] of form.entries()) {\n const blockId = elicitFormBlockId(index)\n const raw = fields[blockId]\n // Slack sends `[]` for a multi-select nobody touched, so a blank OPTIONAL one is an omission,\n // not an empty answer that then fails its own `minItems`. A required field keeps being checked:\n // there, `[]` is a real selection and its bounds decide. (An emptied REQUIRED select staying an\n // answer is #1801's reading, kept.)\n const blank = raw === undefined || (Array.isArray(raw) && !raw.length && !required.has(target.propName))\n if (blank) {\n if (required.has(target.propName)) errors[blockId] = 'This field is required.'\n continue\n }\n // A Slack card's options carry their POSITION, so the literals come back through the field\n // the card rendered ({@link elicitCardValues}) before anything is checked — that is what lets\n // an option's value be a path, an id or a URL at all (#1794). One carried value naming no\n // option this field offered refuses the field, exactly as an unoffered literal would.\n const carried = elicitCardValues(target, raw)\n if (carried === null) {\n errors[blockId] = elicitFormFieldError(target)\n continue\n }\n const shaped =\n target.kind === 'multi-enum'\n ? Array.isArray(carried)\n ? carried\n : undefined\n : Array.isArray(carried)\n ? undefined\n : target.kind === 'number'\n ? NUMERIC_REPLY_RE.test(carried.trim())\n ? Number(carried.trim())\n : undefined\n : carried\n if (shaped === undefined || !fieldAccepts(target, shaped)) errors[blockId] = elicitFormFieldError(target)\n else answer[target.propName] = shaped\n }\n return Object.keys(errors).length ? { errors } : { answer }\n}\n\n/** What ANY refused answer is told on the card's own surface. A refusal drops the answer and\n * leaves the card live (#1815), which without a line like this one is a button that does nothing:\n * the reader cannot tell a rejected answer from a broken card. One wording for every transport —\n * a refusal explained on Slack and silent on webchat is worse than a consistent one. */\nexport const ELICIT_ANSWER_REFUSED = \"That answer wasn't accepted — the question is still open.\"\n\n/** What a refused Confirm is told IN THE THREAD, since a message card has no modal to return the\n * errors to: each refused field named as the card names it, with the same plain words a reply-\n * answered card would use, and the card left live to be answered again. Pure. */\nexport function elicitFormRefusalNotice(\n params: CreateElicitationRequest,\n form: readonly ElicitTarget[],\n errors: Readonly<Record<string, string>>\n): string {\n const parts: string[] = []\n for (const [blockId, message] of Object.entries(errors)) {\n const index = elicitFormBlockIndex(blockId)\n const target = index === null ? undefined : form[index]\n parts.push(target ? `${elicitFormFieldLabel(params, target)}: ${message}` : message)\n }\n return clampTo(`${ELICIT_ANSWER_REFUSED} ${parts.join(' ')}`, ELICIT_MESSAGE_CAP)\n}\n\n/** What a consent card shows about its URL: the REAL host, so a lookalike or a userinfo prefix\n * cannot pass itself off as one, and what to warn about. Both checks are on the host alone — a\n * lookalike hides there, not in the path — and both are advisory: the card still shows the whole\n * URL and still opens only on an explicit tap. Null ⇒ nothing a consent card may offer: a scheme\n * no browser tab should take (the caller's {@link elicitUrl} already refused those, and this\n * refuses them again rather than trust its caller), or a backtick, which cannot sit inside the\n * code span that keeps the URL unfollowable without either escaping the span or lying about the\n * bytes. Pure — it parses the URL and never touches the network. */\nfunction consentUrlParts(url: string): { host: string; warnings: string[] } | null {\n if (url.includes('`')) return null\n let parsed: URL\n try {\n parsed = new URL(url)\n } catch {\n return null\n }\n if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') return null\n // Sliced by POSITION, never by searching `parsed.host`: the parser's spelling is not in the original.\n const afterScheme = url.indexOf('//') + 2\n const authorityEnd = url.slice(afterScheme).search(/[/?#]/)\n const shownHost = url.slice(afterScheme, authorityEnd < 0 ? url.length : afterScheme + authorityEnd)\n const warnings: string[] = []\n if (parsed.protocol !== 'https:')\n warnings.push('Not encrypted (http) — anything you type on that page can be read in transit.')\n // Both spellings of one risk: the parser punycodes Unicode, but a homograph is a lookalike ON SCREEN.\n if (/(^|\\.)xn--/i.test(parsed.hostname) || /[^\\x00-\\x7F]/.test(shownHost))\n warnings.push('This host is not plain ASCII, which can disguise a lookalike domain.')\n return { host: parsed.hostname, warnings }\n}\n\n/** Build the URL-mode CONSENT card: the agent's defused `message`, the real host, the whole URL in\n * a code span, any advisory warnings, an Open link button and a Dismiss button. The URL is shown\n * but deliberately NOT followable as text — Slack autolinks a bare URL, and a reader who left\n * through that autolink would deliver no interaction, so the card would hang unanswered. The\n * button's `url` field both opens the page and still sends Slack's interaction, which is what\n * makes consent observable; its `value` carries the card's ONE option back ({@link\n * elicitOptionToken}), which the daemon resolves to this same URL, so the answer is re-derived\n * against the card that offered it. The URL itself never rides the button: Slack caps a `value`\n * at 2000 and `elicitUrl` admits 2048, so a long OAuth `state` used to lose the card entirely\n * (#1794). Returns null — the caller then declines with a notice — when this is not a URL-mode\n * ask or the URL is not one a card may offer. Pure; the daemon never fetches the URL. */\nexport function buildUrlConsentCard(\n requestId: string,\n params: CreateElicitationRequest,\n sessionTarget?: string\n): unknown[] | null {\n const url = elicitUrl(params)\n const parts = url && consentUrlParts(url.url)\n if (!url || !parts) return null\n const value = encodePermValue(requestId, elicitOptionToken(0))\n const detail = [\n 'Opens in your browser. This agent never sees that page or anything you type on it.',\n `Host: \\`${escapeSlackMrkdwn(parts.host)}\\``,\n `\\`${escapeSlackMrkdwn(url.url)}\\``,\n ...parts.warnings.map((w) => `:warning: ${escapeSlackMrkdwn(w)}`)\n ].join('\\n')\n return [\n {\n type: 'section',\n text: agentMrkdwn(`:link: ${clampTo(elicitCardMessage(params), ELICIT_MESSAGE_CAP)}`)\n },\n { type: 'section', text: agentMrkdwn(clampTo(detail, SLACK_SECTION_TEXT_CAP)) },\n {\n type: 'actions',\n ...(sessionTarget ? { block_id: sessionTarget } : {}),\n elements: [\n {\n type: 'button',\n action_id: `${ELICIT_ACTION_PREFIX}:0`,\n text: { type: 'plain_text', text: 'Open link', emoji: true },\n style: 'primary',\n url: url.url,\n value\n },\n {\n type: 'button',\n action_id: ELICIT_DISMISS_ACTION as string,\n text: { type: 'plain_text', text: 'Dismiss', emoji: true },\n value: requestId\n }\n ]\n }\n ]\n}\n\n/** Build the RESOLVED consent card (buttons removed) that replaces {@link buildUrlConsentCard}\n * once opened, dismissed, cancelled, or reported complete. It keeps the URL on screen so the\n * settled card still records what was consented to. Pure. */\nexport function buildUrlConsentResolvedCard(params: CreateElicitationRequest, decision: string): unknown[] {\n const url = elicitUrl(params)\n const shown = url && !url.url.includes('`') ? `\\n\\`${escapeSlackMrkdwn(url.url)}\\`` : ''\n const text = `:link: ${clampTo(elicitCardMessage(params), ELICIT_MESSAGE_CAP)}${shown}\\n${decision}`\n return [{ type: 'section', text: agentMrkdwn(clampTo(text, SLACK_SECTION_TEXT_CAP)) }]\n}\n\nexport interface SharedStatusActions {\n /** Opaque `{agentId,integrationId,sessionKey}` target validated by the relay. */\n sessionTarget: string\n /** Whether the bot is shareable (multi-agent) — gates the \"Switch agent\" option.\n * A non-shareable shared bot still routes its overflow via `sessionTarget`, but it\n * hosts one agent, so there is nothing to switch to. */\n shareable: boolean\n}\n\n/** Build the compact in-thread status message. Both dedicated and shared bots use one\n * overflow accessory so the status stays on a single row; a SHAREABLE (multi-agent) bot\n * also exposes Switch agent. Interrupting a turn is Slack's own Stop control — the\n * overflow carries no cancel item. */\nexport function buildStatusBlocks(\n info: StatusBarInfo,\n sessionKey: string,\n link?: string,\n shared?: SharedStatusActions\n): unknown[] {\n const text = `${renderStatusBar(info)}${link ? ` · <${link}|View Session>` : ''}`\n const target = shared?.sessionTarget ?? sessionKey\n const option = (label: string, action: 'switch-agent' | 'manage') => ({\n text: { type: 'plain_text', text: label },\n value: encodeSlackStatusOverflowValue(action)\n })\n const options = [\n ...(shared?.shareable ? [option('Switch agent', 'switch-agent')] : []),\n option('Session options', 'manage')\n ]\n return [\n {\n type: 'section',\n block_id: target,\n text: { type: 'mrkdwn', text },\n accessory: {\n type: 'overflow',\n action_id: STATUS_ACTION.more,\n options\n }\n }\n ]\n}\n\n/** Match the console's compact count display: 1_240_000 → \"1.24M\", 92_000 → \"92K\". */\nfunction fmtCount(n?: number): string | undefined {\n if (n === undefined || !Number.isFinite(n)) return undefined\n const trim = (s: string) => (s.includes('.') ? s.replace(/\\.?0+$/, '') : s)\n if (n >= 1_000_000) return trim((n / 1_000_000).toFixed(n >= 10_000_000 ? 0 : 2)) + 'M'\n if (n >= 1_000) return trim((n / 1_000).toFixed(n >= 10_000 ? 0 : 1)) + 'K'\n return String(n)\n}\n\n/** Small terminal modal for a shortcut whose selected conversation has no\n * addressable AgentConnect session (or is not visible to the clicking user). */\nexport function buildStatusUnavailableModal(): Record<string, unknown> {\n return {\n type: 'modal',\n title: { type: 'plain_text', text: 'Session options' },\n close: { type: 'plain_text', text: 'Close' },\n blocks: [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: 'No AgentConnect session was found for this conversation.'\n }\n }\n ]\n }\n}\n\n/**\n * Build the controls modal opened from Configure (a snapshot — Slack modals don't\n * stream). `private_metadata` carries either the direct session key or a shared-bot\n * routing target so the modal's `block_actions` resolve the session. The modal stays\n * compact: identity + View-session share one line, related selectors render two per\n * row, and usage uses label-over-value fields. Interrupting a turn is Slack's own Stop\n * control — the modal carries no cancel button.\n */\nexport function buildStatusModal(\n info: StatusBarInfo,\n sessionKey: string,\n link?: string,\n privateMetadata = sessionKey,\n identity?: StatusModalIdentity\n): Record<string, unknown> {\n const blocks: unknown[] = []\n const controlBlocks: unknown[] = []\n const modelControls: unknown[] = []\n const tuningControls: unknown[] = []\n const outputControls: unknown[] = []\n const models = info.models ?? []\n const compactOption = (label: string, text: string, value: string) => ({\n text: { type: 'plain_text', text: clampTo(`${label} · ${text}`, 75) },\n value\n })\n\n if (models.length > 0) {\n const opts = info.model && !models.includes(info.model) ? [info.model, ...models] : models\n const option = (m: string) => compactOption('Model', m, m)\n modelControls.push({\n type: 'static_select',\n action_id: STATUS_ACTION.setModel,\n placeholder: { type: 'plain_text', text: 'Model' },\n ...(info.model ? { initial_option: option(info.model) } : {}),\n options: opts.map(option)\n })\n }\n\n // Effort — a static_select of the runtime's `thought_level` levels (plus synthetic\n // ultracode/max on Claude runtimes). Omitted when the runtime offers no effort selector.\n const efforts = info.efforts ?? []\n if (efforts.length > 0) {\n const opts = info.effort && !efforts.includes(info.effort) ? [info.effort, ...efforts] : efforts\n const option = (e: string) => compactOption('Effort level', e, e)\n tuningControls.push({\n type: 'static_select',\n action_id: STATUS_ACTION.setEffort,\n placeholder: { type: 'plain_text', text: 'Effort level' },\n ...(info.effort ? { initial_option: option(info.effort) } : {}),\n options: opts.map(option)\n })\n }\n\n // Fast mode — an On/Off static_select, shown only when the selected model advertises a\n // fast toggle (the ACP `model_config` option). `on`/`off` match the daemon's set path.\n if (info.fastModeAvailable) {\n const fastOpt = (v: 'on' | 'off') => compactOption('Fast mode', v === 'on' ? 'On' : 'Off', v)\n const current: 'on' | 'off' = info.fastMode ? 'on' : 'off'\n modelControls.push({\n type: 'static_select',\n action_id: STATUS_ACTION.setFast,\n placeholder: { type: 'plain_text', text: 'Fast mode' },\n initial_option: fastOpt(current),\n options: [fastOpt('on'), fastOpt('off')]\n })\n }\n\n // Permission follows the model / effort / fast controls, matching the Agent and\n // console session surfaces. Codex Auto travels as one AgentConnect session preset;\n // the daemon decomposes it before calling ACP.\n const permissionModes = info.permissionModes ?? []\n if (permissionModes.length > 0) {\n const opts =\n info.permissionMode && !permissionModes.includes(info.permissionMode)\n ? [info.permissionMode, ...permissionModes]\n : permissionModes\n const option = (m: string) => compactOption('Permission', permissionModeDisplayLabel(m), m)\n tuningControls.push({\n type: 'static_select',\n action_id: STATUS_ACTION.setPermissionMode,\n placeholder: { type: 'plain_text', text: 'Permission' },\n ...(info.permissionMode ? { initial_option: option(info.permissionMode) } : {}),\n options: opts.map(option)\n })\n }\n\n // Output verbosity — a fixed none/minimal/low/medium/high select controlling how much of the\n // turn (reasoning / tool activity / output) reaches Slack. `none` delivers nothing to the\n // channel (session transcript only). Daemon-side, not ACP; always shown (unlike model/effort/\n // fast, it isn't runtime-gated). Omitted only when unknown.\n if (info.outputMode) {\n const modeOpt = (v: 'none' | 'minimal' | 'low' | 'medium' | 'high') => compactOption('Output mode', v, v)\n outputControls.push({\n type: 'static_select',\n action_id: STATUS_ACTION.setOutput,\n placeholder: { type: 'plain_text', text: 'Output mode' },\n initial_option: modeOpt(info.outputMode),\n options: [modeOpt('none'), modeOpt('minimal'), modeOpt('low'), modeOpt('medium'), modeOpt('high')]\n })\n }\n\n for (const controls of [modelControls, tuningControls, outputControls]) {\n if (controls.length) controlBlocks.push({ type: 'actions', elements: controls })\n }\n\n const identityName = identity?.name.replace(/\\s+/g, ' ').trim()\n const sessionTitle = identity?.sessionTitle?.replace(/\\s+/g, ' ').trim()\n const currentModel = info.model?.replace(/\\s+/g, ' ').trim()\n const agentLink = safeSlackLinkUrl(identity?.agentUrl)\n const sessionLink = safeSlackLinkUrl(link)\n const identityLabel = identityName\n ? agentLink\n ? `<${agentLink}|${escapeMrkdwnLabel(clampTo(identityName, 256))}>`\n : escapeMrkdwnLabel(clampTo(identityName, 256))\n : undefined\n const modelLabel = models.length === 0 && currentModel ? escapeMrkdwnLabel(clampTo(currentModel, 256)) : undefined\n const meta = [identityLabel, modelLabel].filter((part): part is string => Boolean(part))\n const identityElements: unknown[] = []\n if (identityName) {\n const iconUrl = safeSlackLinkUrl(identity?.iconUrl)\n if (iconUrl) identityElements.push({ type: 'image', image_url: iconUrl, alt_text: clampTo(identityName, 2_000) })\n }\n if (meta.length) {\n identityElements.push({\n type: 'mrkdwn',\n text: `${meta.join(' · ')}${sessionLink ? ' ·' : ''}`\n })\n }\n if (sessionLink) identityElements.push({ type: 'mrkdwn', text: `<${sessionLink}|View session>` })\n if (identityElements.length) {\n blocks.push({\n type: 'context',\n elements: identityElements\n })\n }\n blocks.push(...controlBlocks)\n\n // Usage fields keep labels above their values without the old Usage / Token breakdown\n // headers. Slack lays fields out two per row; missing metrics collapse naturally.\n let contextValue: string | undefined\n if (info.contextUsed !== undefined) {\n contextValue =\n info.contextSize && info.contextSize > 0\n ? `${fmtCount(info.contextUsed)} / ${fmtCount(info.contextSize)} (${Math.round(\n (info.contextUsed / info.contextSize) * 100\n )}%)`\n : fmtCount(info.contextUsed)\n }\n let costValue: string | undefined\n if (info.costAmount !== undefined) {\n // Bare `$` for USD (the common case), else an explicit ISO code suffix.\n const cur = info.costCurrency && info.costCurrency !== 'USD' ? ` ${info.costCurrency}` : ''\n const sym = !info.costCurrency || info.costCurrency === 'USD' ? '$' : ''\n costValue = `${sym}${info.costAmount.toFixed(info.costAmount < 1 ? 3 : 2)}${cur}`\n }\n const totalTokensValue = fmtCount(info.totalTokens)\n const field = (label: string, value?: string) =>\n value === undefined ? undefined : { type: 'mrkdwn', text: `*${label}*\\n${value}` }\n const pairedField = (...items: Array<[label: string, value: string | undefined]>) => {\n const visible = items.filter((item): item is [string, string] => item[1] !== undefined)\n return visible.length\n ? {\n type: 'mrkdwn',\n text: `${visible.map(([label]) => `*${label}*`).join(' · ')}\\n${visible.map(([, value]) => value).join(' · ')}`\n }\n : undefined\n }\n const totalAndCost = [totalTokensValue, costValue].filter((value): value is string => value !== undefined)\n const totalAndCostLabel =\n totalTokensValue !== undefined && costValue !== undefined\n ? 'Total tokens · Cost'\n : totalTokensValue !== undefined\n ? 'Total tokens'\n : 'Cost'\n const cachedReadValue = fmtCount(info.cachedReadTokens)\n const cachedWriteValue = fmtCount(info.cachedWriteTokens)\n const cacheField =\n cachedReadValue !== undefined || cachedWriteValue !== undefined\n ? pairedField(['Cache read', cachedReadValue ?? '—'], ['Cache write', cachedWriteValue ?? '—'])\n : undefined\n const summaryFields = [\n field('Current context', contextValue),\n field(totalAndCostLabel, totalAndCost.length ? totalAndCost.join(' · ') : undefined)\n ].filter(Boolean)\n const breakdownFields = [\n pairedField(['Input', fmtCount(info.inputTokens)], ['Output', fmtCount(info.outputTokens)]),\n cacheField\n ].filter(Boolean)\n if (summaryFields.length || breakdownFields.length) {\n if (blocks.length) blocks.push({ type: 'divider' })\n if (summaryFields.length) blocks.push({ type: 'section', fields: summaryFields })\n if (breakdownFields.length) blocks.push({ type: 'section', fields: breakdownFields })\n }\n\n return {\n type: 'modal',\n callback_id: STATUS_MODAL_CALLBACK,\n private_metadata: privateMetadata,\n title: {\n type: 'plain_text',\n text: clampTo(sessionTitle ? `Session · ${sessionTitle}` : 'Session', 24)\n },\n close: { type: 'plain_text', text: 'Close' },\n blocks\n }\n}\n\nexport class OutputConverger {\n private buf = ''\n // Accumulated thinking text (high mode only) and a dirty flag. Reasoning is coalesced\n // onto the daemon's idle-flush timer — never emitted per thought chunk — so a long\n // thinking stream edits its one in-place message at most once per idle window instead\n // of flooding chat.update through the 350ms send-queue.\n private reasoningBuf = ''\n private reasoningDirty = false\n // Last activity label (tool title / \"is thinking…\") — only for consecutive-collapse:\n // the label is never displayed, a non-empty set-status just keeps the session `processing`.\n private lastActivity = ''\n // Set while a person is being waited on, so every activity status keeps the session `suspended`.\n private humanWaiting = false\n // Remember each tool's last known title so a title-less tool_call_update reuses it\n // (and is collapsed by consecutive-dedup) instead of surfacing the raw toolCallId.\n private toolTitles = new Map<string, string>()\n // high mode only: latest extracted output per in-flight tool (content is a whole\n // replacement each update, so keep the newest), and the set of tools whose output has\n // already been posted — output is emitted at most once, when the call reaches a\n // terminal status, so it isn't re-posted on every streamed update.\n private toolOutputs = new Map<string, string>()\n private emittedOutput = new Set<string>()\n // minimal: how many interim segments have become history cards, so each gets its own id.\n private replyCards = 0\n // The runtime's own message identity, which is the only boundary a speak-only run offers.\n private readonly messages = new AgentMessageRun()\n private readonly work = new WorkBoundary()\n // ── Native tool-call chrome (slack-streaming-turn-output.md §3) ──────────────\n // The axis, plus the one stream's card bookkeeping. Nothing here touches the body.\n private streaming = false\n private streamOpened = false\n private streamClosed = false\n // Cards awaiting the next append, keyed by ACP tool call id so a burst of updates for one\n // call collapses to its newest state; `emittedTasks` suppresses an unchanged repeat.\n private pendingTasks = new Map<string, Extract<SlackStreamChunk, { type: 'task_update' }>>()\n private emittedTasks = new Map<string, string>()\n private taskTitles = new Map<string, string>()\n private openTasks = new Set<string>()\n /** Slack appends each body field, so details and results are each written once. */\n private detailsWritten = new Set<string>()\n private outputWritten = new Set<string>()\n private taskIcons = new Map<string, string>()\n /** Tool calls ACP reported failed — counted into the closing label, never the model's to\n * narrate, and deliberately NOT the cards' status (see FAILED_PREFIX). */\n private failedTasks = new Set<string>()\n // A tool call's own one-line label and verbatim command, remembered from whichever update\n // carried `rawInput` — a streamed `tool_call_update` usually carries none.\n private toolDescriptions = new Map<string, string>()\n private toolCommands = new Map<string, string>()\n // The current thinking run: whether one is open, a counter so each gets its own card, and\n // the head of its text until the first line names it.\n private thinkingActive = false\n private thinkingRun = 0\n private thinkingHead = ''\n private thinkingTitle = ''\n private thinkingBody = ''\n private thinkingBodyTruncated = false\n /** The container's label, so an unchanged one is never re-sent, plus the one awaiting the\n * next append and the legacy `progress` text that append would degrade to. */\n private planTitle = ''\n private pendingPlanTitle = ''\n private pendingProgress = ''\n\n /**\n * `protectedAddresses` are the COMPOUND mention addresses in this conversation — a\n * shared Slack bot's `<@U_SHARED> reviewer`, where the bot user id names the app and the\n * trailing slug selects the agent (send-message-routing-rework.md §5.3/§8.5).\n *\n * The splitter finds every self-delimiting `<…>` address by itself; it cannot infer that\n * a bare word after a mention is part of the address, because in every other message it\n * is ordinary prose. So the daemon supplies the ones it rendered from its own directory.\n * Splitting between the two halves would address the APP instead of the agent — under\n * §2.1 that silently drops the delivery the mention was making, not just its formatting.\n */\n constructor(\n private mode: 'none' | 'minimal' | 'low' | 'medium' | 'high',\n private protectedAddresses: readonly string[] = [],\n private readonly resolveFileLink?: WorkspaceFileLinkResolver\n ) {}\n\n /** True while body text OR reasoning is pending — the daemon uses this to (re)arm\n * the ~2s idle-flush timer (§9.1 text-buffer) so a long pure-text stream posts in\n * steps and streamed thinking updates its in-place block at most once per window. */\n hasBuffered(): boolean {\n // minimal: nothing is delivered mid-segment, so there is never an idle flush to arm.\n if (this.mode === 'minimal') return false\n return this.buf.trim().length > 0 || this.reasoningDirty\n }\n\n /**\n * Take the native chrome pipeline for this turn (§3.1). Decided once at turn start from a\n * synchronous capability read; `medium` and `high` put tool chrome on the stream and\n * `minimal` its interim reply segments (§5.2), so `none` and `low` stay byte-identical to\n * today whatever the workspace supports.\n */\n enableStreaming(): void {\n if (this.mode === 'minimal' || this.mode === 'medium' || this.mode === 'high') this.streaming = true\n }\n\n isStreaming(): boolean {\n return this.streaming\n }\n\n /** Whether a newer card snapshot is ready for the append timer (§3.5). */\n hasStreamingUpdate(): boolean {\n return this.streaming && !this.streamClosed && (this.pendingTasks.size > 0 || this.pendingPlanTitle !== '')\n }\n\n /**\n * Drain the dirty cards into ONE append, opening the stream lazily on the first batch that\n * has something to show. A turn that runs no tools therefore never opens a stream and is\n * byte-identical to today.\n */\n streamUpdate(): SlackAction[] {\n if (!this.streaming || this.streamClosed) return []\n const progressText = this.pendingProgress\n const chunks = this.drainStreamChunks()\n if (chunks.length === 0) return []\n this.pendingProgress = ''\n const out: SlackAction[] = []\n if (!this.streamOpened) {\n this.streamOpened = true\n out.push({ kind: 'stream-start' })\n }\n out.push({ kind: 'stream-append', chunks, ...(progressText ? { progressText } : {}) })\n return out\n }\n\n /**\n * Settle every card to a real terminal status and relabel the container, then stop.\n *\n * Stopping a stream that still has `in_progress` cards makes Slack render the container as\n * \"Something went wrong\" and flip those cards to `error` (verified live 2026-08-28), so the\n * settle append is not cosmetic — it is what every stop is owed. Idempotent: the second\n * caller of a turn's settle gets nothing.\n */\n settleStream(outcome: 'completed' | 'stopped' | 'failed'): SlackAction[] {\n if (!this.streaming || this.streamClosed) return []\n this.streamClosed = true\n // A tool that started AND finished inside one coalescing window leaves cards pending with\n // no stream open yet. Opening it here is what keeps such a turn from ending with no tool\n // chrome at all; only a genuinely tool-free turn stays silent.\n if (!this.streamOpened && this.emittedTasks.size === 0) return []\n const terminal = outcome === 'completed' ? 'complete' : 'error'\n this.closeThinkingRun(terminal)\n for (const id of [...this.openTasks]) this.queueTask(id, this.taskTitles.get(id) ?? 'tool', terminal)\n // Forced rather than queued: the container must always carry its closing label, even when\n // the working one happens to read the same.\n this.planTitle =\n outcome === 'completed' ? this.planSummary() : outcome === 'stopped' ? STREAM_PLAN_STOPPED : STREAM_PLAN_FAILED\n this.pendingPlanTitle = this.planTitle\n const progressText = this.pendingProgress\n this.pendingProgress = ''\n const settle = this.drainStreamChunks()\n const out: SlackAction[] = []\n if (!this.streamOpened) {\n this.streamOpened = true\n out.push({ kind: 'stream-start' })\n }\n out.push({ kind: 'stream-stop', settle, ...(progressText ? { progressText } : {}) })\n return out\n }\n\n private drainStreamChunks(): SlackStreamChunk[] {\n const chunks: SlackStreamChunk[] = [...this.pendingTasks.values()]\n this.pendingTasks.clear()\n if (this.pendingPlanTitle) {\n chunks.push({ type: 'plan_update', title: this.pendingPlanTitle })\n this.pendingPlanTitle = ''\n }\n return chunks\n }\n\n /** Coalesce replaceable card fields while retaining each write-once body field until the next flush. */\n private queueTask(\n id: string,\n title: string,\n status: 'in_progress' | 'complete' | 'error',\n body: { command?: string; details?: string; output?: string; icon?: string } = {}\n ): void {\n const clamped = clampTo(plainCardText(title), MAX_CARD_TITLE) || 'tool'\n const above = body.command ? codeSpan(capOutput(body.command), true) : capOutput(body.details ?? '')\n const details = this.detailsWritten.has(id) ? '' : above\n const output = !this.outputWritten.has(id) && body.output ? capOutput(body.output) : ''\n if (body.icon) this.taskIcons.set(id, body.icon)\n const icon = this.taskIcons.get(id) ?? 'gear'\n const chunk: Extract<SlackStreamChunk, { type: 'task_update' }> = {\n ...this.pendingTasks.get(id),\n type: 'task_update',\n id,\n title: clamped,\n status,\n icon: { type: 'icon', name: icon },\n ...(details ? { details } : {}),\n ...(output ? { output } : {})\n }\n const signature = `${chunk.title} ${chunk.status} ${icon}`\n if (!details && !output && this.emittedTasks.get(id) === signature) return\n if (details) this.detailsWritten.add(id)\n if (output) this.outputWritten.add(id)\n this.emittedTasks.set(id, signature)\n this.taskTitles.set(id, clamped)\n if (status === 'in_progress') this.openTasks.add(id)\n else this.openTasks.delete(id)\n this.pendingTasks.set(id, chunk)\n // The container earns its working label the moment it has a card to hold.\n this.queuePlanTitle(STREAM_PLAN_WORKING)\n }\n\n /** Relabel the container, skipping an unchanged label (§4). */\n private queuePlanTitle(title: string): void {\n const clamped = clampTo(plainCardText(title), MAX_STREAM_TASK)\n if (!clamped || clamped === this.planTitle) return\n this.planTitle = clamped\n this.pendingPlanTitle = clamped\n }\n\n /** What the container says once the turn is over. Counted, not narrated: no model call, and\n * a failed step is named rather than folded into a success. */\n private planSummary(): string {\n const total = this.emittedTasks.size\n if (total === 0) return 'Done'\n // minimal: every card is an interim reply, and the container sits above the final one.\n if (this.mode === 'minimal') return `${total} earlier ${total === 1 ? 'reply' : 'replies'}`\n const steps = `${total} step${total === 1 ? '' : 's'}`\n const failed = this.failedTasks.size\n return failed === 0 ? `Completed ${steps}` : `Completed ${steps} · ${failed} failed`\n }\n\n private thinkingId(): string {\n return `thinking-${this.thinkingRun}`\n }\n\n /** Accumulate a run's body under the card-body cap, REMEMBERING that the cap was reached.\n * Silently slicing to the cap hands `capOutput` a value that already looks whole, so the\n * card would present a run missing its ending as if that were the ending. */\n private appendThinkingBody(thought: string): void {\n const room = MAX_TOOL_OUTPUT - this.thinkingBody.length\n if (room <= 0 || thought.length > room) this.thinkingBodyTruncated = true\n if (room > 0) this.thinkingBody += thought.slice(0, room)\n }\n\n /**\n * Title a thinking run from its FIRST LINE. Runtimes open a thought with a short\n * `**heading**` — the same line the web console shows as the step's title — so the card can\n * say what the agent is thinking about instead of the bare word \"Thinking\". The card opens\n * before that line has arrived, which costs nothing: `title` REPLACES per id, so the\n * placeholder is simply renamed (verified live 2026-08-29).\n *\n * Runs once per run, at the first newline or once the head is title-width, whichever comes\n * first — a runtime that streams one unbroken paragraph still gets a title out of its head.\n */\n private noteThinkingTitle(thought: string): void {\n if (this.thinkingTitle) return\n this.thinkingHead = (this.thinkingHead + thought).slice(0, MAX_THINKING_HEAD)\n const title = this.thinkingTitleFrom(false)\n if (title) this.queueTask(this.thinkingId(), title, 'in_progress')\n }\n\n /** The run's title, resolved from its head, or '' while the first line could still grow.\n * `final` takes whatever the head holds — at settle time no more of it is coming, which is\n * what titles a short last thought that never reached a newline. */\n private thinkingTitleFrom(final: boolean): string {\n if (this.thinkingTitle) return this.thinkingTitle\n // trimStart: a thought can open with blank lines, which must not resolve to a blank title.\n const head = this.thinkingHead.trimStart()\n const nl = head.indexOf('\\n')\n if (!final && nl < 0 && head.length < MAX_CARD_TITLE) return ''\n this.thinkingTitle = clampTo(plainCardText(nl < 0 ? head : head.slice(0, nl)), MAX_CARD_TITLE)\n return this.thinkingTitle\n }\n\n /** A thinking run ends at the next tool call or at turn end — settle its card rather than\n * leaving a spinner behind. Title and status only: the thought text itself belongs in\n * high mode's in-place Thinking message, which is where 2,800 characters fit. */\n private closeThinkingRun(status: 'complete' | 'error' = 'complete'): void {\n if (!this.thinkingActive) return\n const title = this.thinkingTitleFrom(true) || THINKING_CARD\n this.queueTask(this.thinkingId(), title, status, { details: this.thinkingRunBody(title), icon: 'lightbulb' })\n this.thinkingActive = false\n this.thinkingRun += 1\n this.thinkingHead = ''\n this.thinkingTitle = ''\n this.thinkingBody = ''\n this.thinkingBodyTruncated = false\n }\n\n /**\n * What a settled thinking card shows under its title on `high`: the run, as the web console's\n * work rows show it — de-bolded, and without re-saying a title that was shown whole.\n *\n * The body is dropped only when the TITLE already shows the run whole. \"Has no newline\" is not\n * that test: a single unbroken line longer than the title clamp would then survive only as its\n * own first 72 characters, and with the reasoning message gone there is nothing else holding\n * the rest. When the title DID show the first line whole, that line is dropped from the body\n * instead — repeating it directly under itself says nothing.\n *\n * Bold markers are stripped: runtimes emit every thought heading as `**heading**`, so a\n * heading-only run rendered as a slab of bold. The headings are the content; the shouting is\n * not. Other markdown is left alone.\n */\n private thinkingRunBody(title: string): string {\n if (this.mode !== 'high') return ''\n const body = bodyUnderTitle(stripBoldMarks(this.thinkingBody.trim()), title)\n if (!body) return ''\n return this.thinkingBodyTruncated ? `${body}…` : body\n }\n\n /** Flush pending output for the idle timer: in high mode one in-place `reasoning` update\n * carrying the reasoning accumulated since the last flush, THEN the buffered body\n * (verbatim markdown split into ≤block-limit `post` sections — each a Block Kit\n * `markdown` block, no mrkdwn conversion). Reasoning is emitted first so its in-place\n * block is first-posted ABOVE the reply: thinking precedes the answer (§9.1), so the\n * Thinking block must sit above it, not below.\n *\n * minimal: nothing — a segment reaches the channel only once it closes (§5.2). */\n flushBuffered(): SlackAction[] {\n if (this.mode === 'minimal') return []\n return [...this.drainReasoning(), ...this.flushStreaming()]\n }\n\n /** Drain everything for a turn that is ending abnormally: the runtime narrated its terminal\n * error into the message stream and then rejected the prompt, so `onFinal` never runs and\n * there is no later flush to hold a partial paragraph for. Unlike the idle flush this takes\n * the whole buffer, paragraph break or not — otherwise the runtime's own error text is\n * dropped and replaced by the generic failure notice. */\n flushTerminal(): SlackAction[] {\n // A crashed turn settles like a stopped one: whatever was still in flight did not finish\n // BECAUSE the turn died, so those cards are honestly `error` under a \"Failed\" label — while\n // steps that already finished keep their state, (failed)-prefixed ones included. The ⚠️\n // notice the caller appends still carries the reason in the body.\n const opensLate = !this.streamOpened\n const settle = this.settleStream('failed')\n const body = [...this.drainReasoning(), ...this.flush()]\n return opensLate ? [...settle, ...body] : [...body, ...settle]\n }\n\n /** minimal: close an interim reply segment — a history card on the chrome stream for the\n * channel (§5.2) plus the full text as `recordOnly` post(s) for the transcript. The final\n * segment is not closed here: onFinal posts it as the turn's one visible reply. */\n private closeSegment(): SlackAction[] {\n const trimmed = this.buf.trim()\n if (!trimmed) {\n this.buf = ''\n return []\n }\n // Hold while the body may still be the bare sentinel — a suppressed reply must not be\n // recorded or shown; onFinal makes the final drop. Non-sentinel bodies close normally.\n if (isNoResponsePrefix(trimmed)) return []\n const text = flattenUnsafeLinks(this.buf, { resolveFileLink: this.resolveFileLink })\n this.buf = ''\n if (!text.trim()) return []\n this.queueReplyCard(text)\n return splitIntoSections(text, undefined, this.protectedAddresses).map(\n (t) => ({ kind: 'post', text: t, recordOnly: true }) as SlackAction\n )\n }\n\n /** minimal: one history card per closed segment, the shape of a settled thinking card — titled\n * by its first line, its body written once, `complete` from birth. Off the axis the segment\n * stays transcript-only, which is what minimal showed before the stream existed. */\n private queueReplyCard(text: string): void {\n if (!this.streaming) return\n this.replyCards += 1\n const body = text.trim()\n const title = replyCardTitle(body)\n this.queueTask(`reply-${this.replyCards}`, title, 'complete', {\n details: bodyUnderTitle(body, title),\n icon: 'comment'\n })\n }\n\n /** Drain reasoning buffered since the last flush into a 0-or-1-length action list (only\n * high mode ever sets `reasoningDirty`). Callers place it before the body flush so the\n * Thinking block posts above the reply. */\n private drainReasoning(): SlackAction[] {\n // A streaming turn's thinking cards ARE this message — posting it too would repeat every\n // line of it under the container that already holds them.\n if (this.streaming || !this.reasoningDirty) return []\n this.reasoningDirty = false\n const text = flattenUnsafeLinks(this.reasoningBuf, { resolveFileLink: this.resolveFileLink })\n return text.trim() ? [{ kind: 'reasoning', text: renderReasoning(text) }] : []\n }\n\n private flush(): SlackAction[] {\n const trimmed = this.buf.trim()\n if (!trimmed) {\n this.buf = ''\n return []\n }\n // \"Not for me\" control marker (§no-response): hold the buffer while it could\n // still become the bare marker (it streams token-by-token) so a suppressed\n // turn never leaks a partial post. onFinal drops it entirely; a body that diverges from\n // the sentinel is released and posted normally on the next flush.\n if (isNoResponsePrefix(trimmed)) return []\n const text = this.buf\n this.buf = ''\n return this.emitBody(text)\n }\n\n /** The idle timer's body flush. Unlike a semantic boundary (tool call / plan / thinking,\n * where the model really did finish a text block) this fires on a mere pause in the ACP\n * stream, so it posts only up to the last paragraph break and re-buffers the rest —\n * otherwise one reply is split across two messages mid-sentence (§stream-boundary). */\n private flushStreaming(): SlackAction[] {\n const trimmed = this.buf.trim()\n if (!trimmed || isNoResponsePrefix(trimmed)) return []\n const { ready, tail } = splitAtParagraphBoundary(this.buf)\n if (!ready) return []\n this.buf = tail\n return this.emitBody(ready)\n }\n\n private emitBody(raw: string): SlackAction[] {\n const text = flattenUnsafeLinks(raw, { resolveFileLink: this.resolveFileLink })\n if (!text.trim()) return []\n // none: record the reply into the transcript WITHOUT sending it — `recordOnly` is handled\n // before the connection check on every platform, so it lands even though replyConn is unset.\n const recordOnly = this.mode === 'none'\n return splitIntoSections(text, undefined, this.protectedAddresses).map(\n (t) => ({ kind: 'post', text: t, ...(recordOnly ? { recordOnly: true } : {}) }) as SlackAction\n )\n }\n\n /**\n * Record an activity label and build the working-status action. Consecutive repeats\n * collapse to nothing (returns []), which throttles streamed thought chunks down to one\n * status update per thinking run; the connection dedupes the rest at the lifecycle level.\n */\n private pushActivity(raw: string): SlackAction[] {\n // none: nothing reaches the channel, not even the transient working status.\n if (this.mode === 'none') return []\n const label = clampTo(raw, MAX_STATUS)\n if (this.lastActivity === label) return []\n this.lastActivity = label\n return [{ kind: 'set-status', text: label, ...(this.humanWaiting ? { lifecycle: 'suspended' as const } : {}) }]\n }\n\n /** A human wait opened (`suspended`) or its last gate settled (`processing` again); none mode shows nothing. */\n onHumanWait(waiting: boolean): SlackAction[] {\n this.humanWaiting = waiting\n if (this.mode === 'none') return []\n const text = this.lastActivity || 'working…'\n return [waiting ? { kind: 'set-status', text, lifecycle: 'suspended' } : { kind: 'set-status', text }]\n }\n\n /** Resolve a tool call's display label, reusing a known title when an update omits it. */\n private toolLabel(update: { toolCallId?: string; title?: string }): string {\n const id = update.toolCallId\n if (update.title) {\n if (id) this.toolTitles.set(id, update.title)\n return update.title\n }\n return (id && this.toolTitles.get(id)) ?? id ?? 'tool'\n }\n\n /** Remember what a tool call's `rawInput` said about itself. Only some updates carry it — a\n * streamed `tool_call_update` usually does not — so the first one that does wins. */\n private noteToolInput(update: { toolCallId?: string; rawInput?: unknown }): void {\n const id = update.toolCallId\n if (!id || update.rawInput === undefined) return\n const description = rawInputDescription(update)\n const command = rawInputField(update, 'command')\n if (isStepLabel(description) && !this.toolDescriptions.has(id)) this.toolDescriptions.set(id, description)\n if (command && !this.toolCommands.has(id)) this.toolCommands.set(id, command)\n }\n\n /** A card's one-line step label: the runtime's own description when it gave one, else the\n * tool title SHAPED. An ACP title for a shell tool IS the command (codex-acp sends no\n * description at all), which reads as a paragraph of shell on a card — so a command-shaped\n * fallback is cut at its first shell separator and clamped tighter than a prose title:\n * `git status --short --branch …` labels the step; the full chain rides the code block. */\n private cardTitle(id: string, label: string): string {\n const description = this.toolDescriptions.get(id)\n if (description) return description\n const head = label.split(SHELL_SEPARATOR, 1)[0] ?? label\n if (head.length < label.length) return `${clampTo(head, MAX_COMMAND_TITLE - 2)} …`\n return clampTo(label, MAX_COMMAND_TITLE)\n }\n\n /** What the card's code block shows: the verbatim command, or the full title when that is\n * all the runtime gave. Skipped when the title already shows it whole — an untruncated\n * one-line label needs no code block repeating it. */\n private cardCommand(id: string, label: string): string {\n const command = this.toolCommands.get(id) || label\n return plainCardText(command) === plainCardText(this.cardTitle(id, label)) ? '' : command\n }\n\n /** Refresh the newest output for one tool call. content/rawOutput are a whole replacement\n * when present, so only touch the cache when this update actually carries them: set the\n * newest text, or clear a stale entry if the replacement is empty / a non-text block. */\n private noteToolOutput(update: { toolCallId?: string; content?: unknown; rawOutput?: unknown }): void {\n const id = update.toolCallId\n if (!id || (update.content === undefined && update.rawOutput === undefined)) return\n const out = extractToolOutput(update)\n if (out) this.toolOutputs.set(id, out)\n else this.toolOutputs.delete(id)\n }\n\n /** high mode: surface a finished tool's output as a code-block `tool-output` action.\n * Tracks the latest output across streamed updates and emits it exactly once, when the\n * call reaches a terminal status (completed/failed) — so partial output isn't posted\n * early and the final result isn't re-posted. Returns [] when there's nothing to post. */\n private drainToolOutput(update: {\n toolCallId?: string\n status?: string\n content?: unknown\n rawOutput?: unknown\n }): SlackAction[] {\n const id = update.toolCallId\n if (!id) return []\n this.noteToolOutput(update)\n const terminal = update.status === 'completed' || update.status === 'failed'\n if (!terminal || this.emittedOutput.has(id)) return []\n const text = this.toolOutputs.get(id)\n if (!text) return []\n this.emittedOutput.add(id)\n this.toolOutputs.delete(id)\n const icon = update.status === 'failed' ? ':x:' : ':page_facing_up:'\n // Icon on its own line so the fenced code block starts at column 0 — a fence indented\n // by the icon prefix would not be parsed as a code block under CommonMark.\n return [{ kind: 'tool-output', text: `${icon}\\n${codeSpan(capOutput(text), true)}` }]\n }\n\n onUpdate(update: SessionUpdate): SlackAction[] {\n switch (update.sessionUpdate) {\n case 'agent_message_chunk': {\n const content = (update as { content?: { type?: string; text?: string } }).content\n const text = content?.type === 'text' ? (content.text ?? '') : ''\n // A new message closes the one before it as a tool boundary would; without this the two run together as one post.\n const opens = this.messages.opens(update)\n // A closed message that was only sentinel text can never complete: drop it instead of joining the next message onto it.\n if (opens) this.buf = this.messages.withoutClosedSentinel(this.buf)\n const closed = opens ? (this.mode === 'minimal' ? this.closeSegment() : this.flush()) : []\n this.buf += text\n return closed\n }\n case 'agent_thought_chunk': {\n // high: accumulate the streamed thought into the reasoning buffer and mark it\n // dirty; the actual in-place `reasoning` update is deferred to flushBuffered()\n // (idle timer) / onFinal so a token-by-token stream doesn't flood chat.update.\n // low + medium keep only the transient status — no reasoning in the channel.\n // A STREAMING turn keeps none of this: its cards are the Thinking message (§5).\n const thought = (update as { content?: { text?: string } }).content?.text ?? ''\n if (this.mode === 'high' && thought && !this.streaming) {\n this.reasoningBuf += thought\n // Soft-cap the raw buffer so a very long turn can't grow it unbounded;\n // renderReasoning tail-clamps again for the message body.\n if (this.reasoningBuf.length > MAX_REASONING * 2) {\n this.reasoningBuf = this.reasoningBuf.slice(-MAX_REASONING * 2)\n }\n this.reasoningDirty = true\n }\n // streaming: ONE card per thinking run, opened once and settled once. Its title is the\n // run's own first line and, on high, its body is the rest of the run — so the card IS\n // the Thinking message and the separate one is not posted (§5). Not on minimal, whose\n // cards are its interim replies and whose thinking stays in the transient status.\n if (this.streaming && thought && this.mode !== 'minimal') {\n if (!this.thinkingActive) {\n this.thinkingActive = true\n this.queueTask(this.thinkingId(), THINKING_CARD, 'in_progress', { icon: 'lightbulb' })\n }\n this.noteThinkingTitle(thought)\n if (this.mode === 'high') this.appendThinkingBody(thought)\n }\n // minimal: keep the streamed reply intact (thinking mid-reply doesn't close a\n // segment) — only surface the transient status.\n if (this.mode === 'minimal') return this.pushActivity(THINKING)\n // Flush any buffered body, then surface the live \"is thinking…\" status.\n return [...this.flush(), ...this.pushActivity(THINKING)]\n }\n case 'tool_call':\n case 'tool_call_update': {\n const u = update as {\n toolCallId?: string\n title?: string\n status?: string\n kind?: ToolKind | null\n content?: unknown\n rawInput?: unknown\n rawOutput?: unknown\n }\n // Minimal deliberately hides the concrete tool label as well as tool cards/output:\n // keep Slack's transient working indicator generic so commands and tool names do\n // not leak into the channel chrome. Thinking remains a distinct thought-chunk state.\n const label = this.mode === 'minimal' ? WORKING : this.toolLabel(u)\n this.noteToolInput(u)\n const status = this.pushActivity(label)\n const closed = this.work.opens(update) ? (this.mode === 'minimal' ? this.closeSegment() : this.flush()) : []\n // minimal: only new work closes the reply segment into a history card and transcript.\n if (this.mode === 'minimal') return [...status, ...closed]\n // none/low: just record the buffered body — no tool card, no status (none emits none).\n if (this.mode === 'low' || this.mode === 'none') return [...closed, ...status]\n // medium/high: reflect the current tool on the in-place progress message. The\n // label (a command line / tool title) is wrapped in a code span so it renders\n // verbatim in the `markdown` block instead of being parsed as emphasis.\n const progressText = `:hammer_and_wrench: ${codeSpan(label)}`\n const actions: SlackAction[] = [...closed, ...status]\n // streaming: that in-place message becomes one task card on the stream, keyed by\n // toolCallId so streamed updates edit a card instead of stacking (§4). The append\n // still carries the legacy text, so a stream that never opened degrades to it.\n if (this.streaming && u.toolCallId) {\n this.closeThinkingRun()\n const terminal = u.status === 'completed' || u.status === 'failed'\n // A failed TOOL never takes card status `error`: the container icon is derived from\n // the cards (any error card reddens the whole plan, verified live 2026-08-29), so one\n // non-zero exit would present a completed turn as a failed one. The failure is said\n // in words instead — a plain \"(failed)\" prefix, counted into the closing label —\n // and `error` is reserved for the cancel path, where a red container is the truth.\n const failed = u.status === 'failed'\n if (failed) this.failedTasks.add(u.toolCallId)\n // High mode shows the command immediately and retains the latest result until completion.\n if (this.mode === 'high') this.noteToolOutput(u)\n const body =\n this.mode === 'high'\n ? {\n command: this.cardCommand(u.toolCallId, label),\n ...(terminal ? { output: this.toolOutputs.get(u.toolCallId) ?? '' } : {})\n }\n : {}\n this.queueTask(\n u.toolCallId,\n (failed ? FAILED_PREFIX : '') + this.cardTitle(u.toolCallId, label),\n terminal ? 'complete' : 'in_progress',\n { ...body, ...(u.kind ? { icon: TASK_ICONS[u.kind] ?? 'gear' } : {}) }\n )\n if (terminal) this.toolOutputs.delete(u.toolCallId)\n this.pendingProgress = progressText\n } else {\n actions.push({ kind: 'progress', text: progressText })\n }\n // high only, and only off the stream: a streaming turn's card already carries the same\n // command and result, so posting the code block too would say everything twice.\n if (this.mode === 'high' && !this.streaming) actions.push(...this.drainToolOutput(u))\n return actions\n }\n case 'plan': {\n const entries = (update as { entries?: PlanEntry[] }).entries ?? []\n // `minimal` promises the turn is ONE visible reply and `none` sends nothing at all, so\n // both keep planning as transient status. `low` renders it: that rung means \"body and\n // result only, activity goes to the status row\", and the plan was excluded when its\n // only shape was a six-line emoji block. As a ruled, struck-through list it is neither\n // activity nor noise — it is the shortest statement of what the turn is for — and low\n // is the DEFAULT, so excluding it hid the plan from most agents in the product.\n if (this.mode === 'minimal') return this.pushActivity('planning…')\n if (this.mode === 'none') return [...this.flush(), ...this.pushActivity('planning…')]\n return [...this.flush(), { kind: 'plan', ...renderPlan(entries) }]\n }\n case 'usage_update':\n return [] // dropped (goes to telemetry, not the channel)\n default:\n return []\n }\n }\n\n /** Turn end (§9.1 stopReason): flush remaining body, clear the loading status, and\n * append the optional identity/runtime/model/session attribution. */\n onFinal(info?: SlackAttributionInfo): SlackAction[] {\n const clear: SlackAction = { kind: 'set-status', text: '' }\n // A bare response-control marker (or a non-compliant explanation ending in a bare marker\n // line) means this message wasn't for the agent.\n // Suppress everything: clear the \"is thinking…\" status and post nothing — no body, no\n // reasoning, no attribution footer. The inbound message was still recorded and the thread\n // watermark advanced in SessionManager, so peers keep seeing it as context; this agent\n // just stays silent.\n if (isNoResponseBody(this.buf.trim())) {\n this.buf = ''\n // The stream is chrome, not the answer: a silent turn that ran tools still owes its\n // cards a terminal status and its container a closing label.\n return [clear, ...this.settleStream('completed')]\n }\n // none: settle the final body into the transcript (recordOnly via flush) and stop — no\n // status clear, no attribution footer; nothing is delivered to the channel this turn.\n if (this.mode === 'none') return this.flush()\n const attribution: SlackAction[] = info ? [{ kind: 'attribution', ...buildAttributionBlocks(info) }] : []\n if (this.mode === 'low') return [...this.markTerminalPost(this.flush()), clear, ...attribution]\n // minimal takes the same path as medium/high: its one visible reply is the final flush,\n // posted like any other body, and the settle closes the history cards above it (§5.2).\n // The daemon cancels the idle-flush timer before onFinal, so drain any reasoning\n // buffered since the last flush here. It goes BEFORE the body flush so the Thinking\n // block posts above the reply — thinking precedes the answer (§9.1), so it must sit\n // above it, not below (only high mode ever has reasoning to drain).\n const reasoning = this.drainReasoning()\n // A settle that must still OPEN the stream goes before the body, so the container is created\n // above the answer it precedes (§6); a stream already open settles after the body, as before.\n const opensLate = !this.streamOpened\n const settle = this.settleStream('completed')\n const body = [...this.markTerminalPost(this.flush()), clear, ...attribution]\n return opensLate ? [...reasoning, ...settle, ...body] : [...reasoning, ...body, ...settle]\n }\n\n /** onFinal only: flag the last delivered body section as this response's terminal post,\n * so the applier can close the response at post time instead of re-editing it (§5.5). */\n private markTerminalPost(actions: SlackAction[]): SlackAction[] {\n for (let i = actions.length - 1; i >= 0; i--) {\n const action = actions[i]\n if (action?.kind === 'post' && !action.recordOnly && action.attributed !== false) {\n action.terminal = true\n break\n }\n }\n return actions\n }\n}\n"],"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],"mappings":";;;;;;;AAEA,MAAa,4BAA4B;AACzC,MAAM,WAAWA,MAAO,CAAC,UAAU,OAAO,CAAC;AAC3C,MAAM,SAASC,SAAS,CAAC,CAAC,MAAM,YAAY;AAE5C,MAAa,0BAA0BC,OAAS;CAC5C,UAAU;CACV,QAAQ;CACR,OAAOC,OACK;EACR,OAAOF,SAAS,CAAC,CAAC,IAAI,CAAC;EACvB,WAAWA,SAAS,CAAC,CAAC,KAAK;EAC3B,MAAMA,SAAS,CAAC,CAAC,IAAI;EACrB,YAAYA,SAAS,CAAC,CAAC,IAAI,CAAC;EAC5B,gBAAgBA,SA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,OAAO;CACT;AACF"}
|
|
1
|
+
{"version":3,"file":"render-Dazz4Vk5.js","names":["z.enum","z.string","z.object","z\n .object","z.literal","z\n .object","z.number","z\n .string","z.boolean","z.array","z.object","z.enum","z.string","z\n .string","z.number","z.array","z.literal","z.boolean","z.discriminatedUnion","z\n .object","z.guid","z.union","z\n .object","z.unknown","z.record","z\n .array","own","content","document","flow","string","text","resolveText","defaultConstructs","content","document","flow","string","text","point","splitIntoSections","splitTextIntoSections"],"sources":["../../protocol/dist/frames/codehost-feedback.js","../../protocol/dist/frames/relay-cp.js","../src/messages/attribution.ts","../../../node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.js","../../../node_modules/.pnpm/character-entities@2.0.2/node_modules/character-entities/index.js","../../../node_modules/.pnpm/decode-named-character-reference@1.3.0/node_modules/decode-named-character-reference/index.js","../../../node_modules/.pnpm/micromark-util-chunked@2.0.1/node_modules/micromark-util-chunked/index.js","../../../node_modules/.pnpm/micromark-util-combine-extensions@2.0.1/node_modules/micromark-util-combine-extensions/index.js","../../../node_modules/.pnpm/micromark-util-decode-numeric-character-reference@2.0.2/node_modules/micromark-util-decode-numeric-character-reference/index.js","../../../node_modules/.pnpm/micromark-util-normalize-identifier@2.0.1/node_modules/micromark-util-normalize-identifier/index.js","../../../node_modules/.pnpm/micromark-util-character@2.1.1/node_modules/micromark-util-character/index.js","../../../node_modules/.pnpm/micromark-factory-space@2.1.0/node_modules/micromark-factory-space/index.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/initialize/content.js","../../../node_modules/.pnpm/micromark-util-edit-map@1.0.0/node_modules/micromark-util-edit-map/index.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/initialize/document.js","../../../node_modules/.pnpm/micromark-util-classify-character@2.0.1/node_modules/micromark-util-classify-character/index.js","../../../node_modules/.pnpm/micromark-util-resolve-all@2.0.1/node_modules/micromark-util-resolve-all/index.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/attention.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/autolink.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/blank-line.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/block-quote.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/character-escape.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/character-reference.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/code-fenced.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/code-indented.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/code-text.js","../../../node_modules/.pnpm/micromark-util-subtokenize@2.1.0/node_modules/micromark-util-subtokenize/lib/splice-buffer.js","../../../node_modules/.pnpm/micromark-util-subtokenize@2.1.0/node_modules/micromark-util-subtokenize/index.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/content.js","../../../node_modules/.pnpm/micromark-factory-destination@2.0.1/node_modules/micromark-factory-destination/index.js","../../../node_modules/.pnpm/micromark-factory-label@2.0.1/node_modules/micromark-factory-label/index.js","../../../node_modules/.pnpm/micromark-factory-title@2.0.1/node_modules/micromark-factory-title/index.js","../../../node_modules/.pnpm/micromark-factory-whitespace@2.0.1/node_modules/micromark-factory-whitespace/index.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/definition.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/hard-break-escape.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/heading-atx.js","../../../node_modules/.pnpm/micromark-util-html-tag-name@2.0.1/node_modules/micromark-util-html-tag-name/index.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/html-flow.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/html-text.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/label-end.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/label-start-image.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/label-start-link.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/line-ending.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/thematic-break.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/list.js","../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/setext-underline.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/initialize/flow.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/initialize/text.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/constructs.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/create-tokenizer.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/parse.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/postprocess.js","../../../node_modules/.pnpm/micromark@4.0.3_supports-color@7.2.0/node_modules/micromark/lib/preprocess.js","../../../node_modules/.pnpm/micromark-util-decode-string@2.0.1/node_modules/micromark-util-decode-string/index.js","../../../node_modules/.pnpm/unist-util-stringify-position@4.0.0/node_modules/unist-util-stringify-position/lib/index.js","../../../node_modules/.pnpm/mdast-util-from-markdown@2.1.0_supports-color@7.2.0/node_modules/mdast-util-from-markdown/lib/index.js","../src/messages/agent-links.ts","../src/session/no-response.ts","../src/messages/message-boundary.ts","../src/messages/stream-boundary.ts","../src/acp/permission-modes.ts","../src/messages/split-sections.ts","../src/slack/formatter.ts","../src/platforms/approval-card.ts","../src/session/tool-output.ts","../src/slack/render.ts"],"sourcesContent":["import { z } from 'zod';\nimport { FollowUpEventKind, FollowUpWatchSubject } from './follow-up-watch.js';\nexport const CODEHOST_FEEDBACK_FEATURE = 'codehost-feedback-v1';\nconst Provider = z.enum(['gitlab', 'gitea']);\nconst RepoId = z.string().regex(/^[1-9]\\d*$/);\n// A repository subscription has no trigger, agent, prompt, or review authority; never log its signing keys.\nexport const RcCodeHostFeedbackWatch = z.object({\n provider: Provider,\n repoId: RepoId,\n watch: z\n .object({\n orgId: z.string().min(1),\n bindingId: z.string().uuid(),\n host: z.string().url(),\n signingKey: z.string().min(1),\n nextSigningKey: z.string().min(1).optional(),\n // Follow-ups watch objects here (assistant-mode.md §5.14), so the relay also sends their wake-only events.\n followUps: z.literal(true).optional()\n })\n .optional()\n});\n// Only verified event coordinates cross this boundary; the daemon reads feedback bodies and logs.\nexport const RcCodeHostFeedback = z\n .object({\n provider: Provider,\n orgId: z.string().min(1),\n bindingId: z.string().uuid(),\n host: z.string().url(),\n repoId: RepoId,\n deliveryKey: z.string().min(1).max(200),\n pullNumber: z.number().int().positive().optional(),\n headSha: z\n .string()\n .regex(/^[a-fA-F0-9]{40,64}$/)\n .optional(),\n actorId: RepoId.optional(),\n actorUsername: z.string().min(1).max(255).optional(),\n // `event` is any other change on an object, sent wake-only (assistant-mode.md §5.14).\n kind: z.enum(['comment', 'ci', 'event']),\n // What happened and on which kind of object; a `wakeOnly` signal wakes follow-ups alone.\n subject: FollowUpWatchSubject.optional(),\n event: FollowUpEventKind.optional(),\n wakeOnly: z.literal(true).optional()\n})\n .refine((value) => (value.kind === 'ci' ? value.headSha !== undefined : value.pullNumber !== undefined))\n .refine((value) => value.wakeOnly === true || (value.kind !== 'event' && value.subject !== 'issue'), {\n message: 'an issue or other object event wakes follow-ups only'\n});\nexport const RcCodeHostFeedbackResult = z.object({\n accepted: z.boolean(),\n authorAgentIds: z.array(z.string().uuid())\n});\n//# sourceMappingURL=codehost-feedback.js.map","import { RcCodeHostFeedback, RcCodeHostFeedbackResult, RcCodeHostFeedbackWatch } from './codehost-feedback.js';\nimport { z } from 'zod';\nimport { AhpGrant } from '../ahp.js';\nimport { frameSchema } from '../envelope.js';\nimport { CodeHostExternalId, CodeHostProviderString, HOOK_KINDS } from '../code-host.js';\nimport { COMPUTER_TURN_URLS_MAX, ComputerStunUrl, ComputerTurnUrl } from '../computer-viewer.js';\nimport { ErrorFrame } from './error.js';\nimport { BindMatch, ChannelBlockedBotSenders, ChannelBotSender, IntegrationChannel } from './integration.js';\nimport { CronTarget } from './cron.js';\nimport { Platform } from './route.js';\nimport { CollabRoutesSnapshot } from './collab.js';\nimport { FrameFragment } from './fragment.js';\nimport { AzureDevOpsDeliveryKind, AzureDevOpsHookMetadata, GiteaHookMetadata, GithubHookMetadata, GitlabHookMetadata, HookBigIntString, HookInstructions, OptionalHookConfigSnapshot } from './hook.js';\nimport { WebchatRemoteMcpEntitlement } from './remote-mcp.js';\nimport { PullRequestFeedbackSignal } from './session.js';\nimport { FollowUpEventKind, FollowUpWatchSubject, RcFollowUpWatch } from './follow-up-watch.js';\nimport { AzureDevOpsRepoRouting, ChatCallerRole } from './agent.js';\nimport { buildEnvelopeRaw, decodeEnvelopeWith } from '../wire.js';\n/**\n * relay↔CP control frames (`rc/*`) — shared-bot-relay.md §7.1 / §8.\n *\n * The relay dials OUT to the CP (`/api/v1/relays/ws`) and this wire carries\n * ONLY control signaling: registration, heartbeat, delegated credential\n * verification, and revocation. Message content NEVER crosses it — content\n * flows browser/platform → relay → daemon on the `rd/*` wire.\n *\n * This is a SEPARATE frame union from the daemon↔CP protocol (`frame.ts`) and\n * from the relay↔daemon wire (`relay-daemon.ts`): each socket decodes against\n * its own schema map, so a frame from the wrong family is `UNKNOWN_FRAME`.\n *\n * Milestone A carried the skeleton subset (register / heartbeat / verify /\n * daemon-revoke); milestone B-github adds the hook frames (`rc/hook-assign`,\n * `rc/hook-remove`, `rc/run-report` — webhook-triggers-and-github-events.md).\n * Shared-bot (`rc/bot-assign`…) frames land with milestone B-slack.\n */\n/** Subprotocol negotiated on the relay↔CP socket. */\nexport const RELAY_CP_SUBPROTOCOL = 'agentconnect.rc.v1';\n// ── auth (first frame; §8 dual-mode) ─────────────────────────────────────────\n// R→C REQ → rc/auth/ok. `token` = deployment-shared secret (`RELAY_TOKEN`, or a\n// JWT signed with it — the credential FORM is discriminated by the presence of\n// dots, not here); `apikey` = a per-relay ApiKey (kind 'relay', org-less).\n// The credential is secret material — NEVER log this frame.\nexport const RcAuth = z.object({\n method: z.enum(['token', 'apikey']),\n credential: z.string().min(1)\n});\n// The deployment Google Chat app's anchor (google-chat-integration.md §10.4): its project number and the console's claim page.\nexport const RcGoogleChatAnchor = z.object({\n projectNumber: z.string().regex(/^[1-9]\\d{0,19}$/),\n claimUrl: z.string().url({ protocol: /^https$/ })\n});\n/** The deployment Google Chat app the relay sends its customer rows' Chat API calls with (google-chat-integration.md §10.10). */\nexport const RcGoogleChatDeploymentApp = z.object({\n projectNumber: z.string().regex(/^[1-9]\\d{0,19}$/),\n /** Service-account key JSON; secret material, never logged. */\n serviceAccountKey: z.string().min(1)\n});\n// The deployment Teams app's anchor (teams-integration.md §8.4): it answers a tenant no organization connected, so it carries the app's secret.\nexport const RcMsTeamsAnchor = z.object({\n appId: z.string().uuid(),\n /** The app's home tenant, which issues every Bot Framework token the anchor sends with. */\n tenantId: z.string().uuid(),\n /** Secret material, never logged. */\n clientSecret: z.string().min(1),\n connectUrl: z.string().url({ protocol: /^https$/ })\n});\n/** The agent identity blueprint whose secret obtains every agent bot's Bot Connector token (teams-integration.md §8.6.7). */\nexport const RcMsTeamsBlueprint = z.object({\n appId: z.string().uuid(),\n /** Secret material, never logged. */\n clientSecret: z.string().min(1)\n});\n/** The deployment Teams app the relay sends its customer rows' Bot Connector calls and mints their Graph tokens with (teams-integration.md §8.5). */\nexport const RcMsTeamsDeploymentApp = z.object({\n appId: z.string().uuid(),\n /** The app's home tenant, which issues every Bot Connector token. */\n tenantId: z.string().uuid(),\n /** Secret material, never logged. */\n clientSecret: z.string().min(1),\n /** The base64url key every relay signs and checks conversation tickets with; derived from the CP's pepper, never logged. */\n ticketKey: z.string().min(43),\n /** Present when the deployment configures agent bots; absent, the relay serves none. */\n blueprint: RcMsTeamsBlueprint.optional()\n});\n/** The deployment's mail domain as the relay receives and sends for it (email-integration.md §7): the provider account and its sending token, the ingress Worker's secret, and the key reply tickets are signed with. */\nexport const RcEmailDeployment = z.object({\n /** The domain every agent address is on, lower-cased. */\n mailDomain: z\n .string()\n .max(253)\n .regex(/^[a-z0-9-]+(?:\\.[a-z0-9-]+)+$/),\n /** The provider account the sending token belongs to. */\n accountId: z.string().regex(/^[0-9a-f]{32}$/),\n /** The API token that sends as any address on the mail domain; secret material, never logged, and never sent to a daemon. */\n apiToken: z.string().min(1),\n /** The secret the ingress Worker signs each inbound post with; never logged. */\n ingressSecret: z.string().min(32),\n /** The authserv-id whose `Authentication-Results` the relay reads a sender's verdict from (§4 step 2). */\n authservId: z.string().min(1).max(253),\n /** The most messages the whole deployment sends in a day (§6.3); absent, only the per-address and per-organization budgets apply. */\n dailySendLimit: z.number().int().positive().optional(),\n /** The base64url key every relay signs and checks reply tickets with (§6.2); derived from the CP's pepper, never logged. */\n ticketKey: z.string().min(43)\n});\n// C→R REP (corr = rc/auth id). Rejection is a `error` REP + close, not a reply.\n// The CP's deployment snapshot, sent on every authentication; the GitHub secret is applied once per relay process, the Google Chat anchor on every registration.\nexport const RcDeploymentConfig = z.object({\n revision: z.number().int().nonnegative(),\n githubWebhookSecret: z.string().min(1).optional(),\n googleChatAnchor: RcGoogleChatAnchor.optional(),\n googleChatApp: RcGoogleChatDeploymentApp.optional(),\n msTeamsAnchor: RcMsTeamsAnchor.optional(),\n msTeamsApp: RcMsTeamsDeploymentApp.optional(),\n // Present once Setup holds the whole Email configuration; absent, the relay serves no mail.\n email: RcEmailDeployment.optional(),\n // Console links in provider-owned onboarding use the configured origin, without an organization path.\n webAppUrl: z\n .string()\n .url({ protocol: /^https?$/ })\n .optional(),\n // The relay pool's public origin (the CP's PUBLIC_RELAY_URL): a provider that signs for its callback URL is checked against it.\n publicRelayUrl: z\n .string()\n .url({ protocol: /^https?$/ })\n .optional()\n});\nexport const RcAuthOk = z.object({\n heartbeatSec: z.number().int(), // cadence the relay must emit rc/heartbeat at\n serverTime: z.string().datetime(),\n deploymentConfig: RcDeploymentConfig.optional(),\n // The secret the CP mints viewer TURN credentials from, so a relay serving TURN can check them; secret, never logged.\n computerTurnSecret: z.string().min(32).max(256).optional(),\n // CP-derived HMAC secret for verifying Mattermost interactive action button callbacks; secret, never logged.\n mattermostActionSecret: z.string().min(32).max(256).optional()\n});\n// ── registration ─────────────────────────────────────────────────────────────\n// R→C REQ → rc/registered. Announces this relay instance and where daemons can\n// dial it. Re-sent on every (re)connect; the CP upserts and re-issues the id.\n// `daemonUrl` MUST route to THIS instance (per-pod DNS or a relay-id-sticky\n// path) — a pool-level random LB breaks the no-cross-pod-forwarding topology\n// (design §5). The pool-level public ingress is env-level PUBLIC_RELAY_URL and\n// is never registered here.\nexport const RcRegister = z.object({\n name: z.string().min(1), // deployment-side identity (pod name etc.)\n daemonUrl: z.string().min(1), // per-instance-routable WSS origin daemons dial\n // Relay feature advertisement (e.g. webchat_session_continuation_v1). The\n // default keeps old relays register-compatible; absent ⇒ no features.\n features: z.array(z.string()).default([]),\n // This instance's public STUN address (`stun:<host>:<port>`) for viewer hole punching; absent when it serves none.\n stunUrl: ComputerStunUrl.optional(),\n // This instance's public TURN addresses for viewer media without a punched path; sent only once it holds the TURN secret.\n turnUrls: z.array(ComputerTurnUrl).min(1).max(COMPUTER_TURN_URLS_MAX).optional()\n});\n// C→R REP (corr = rc/register id).\nexport const RcRegistered = z.object({\n relayId: z.string().uuid(),\n // Optional compatibility discovery for a new relay connected to an older CP.\n serverFeatures: z.array(z.string()).default([])\n});\n// `event` names what happened; a `wakeOnly` signal wakes follow-ups alone and resumes no session, and an issue's always is one.\nexport const RcPullRequestFeedback = PullRequestFeedbackSignal.extend({\n subject: FollowUpWatchSubject.optional(),\n event: FollowUpEventKind.optional(),\n wakeOnly: z.literal(true).optional()\n}).refine((signal) => signal.subject !== 'issue' || signal.wakeOnly === true, {\n message: 'an issue signal wakes follow-ups only'\n});\nexport const RcPullRequestFeedbackResult = z.object({\n deliveryKey: z.string().min(1).max(200),\n accepted: z.boolean()\n});\n// R→C EVT — liveness; drives `relay.lastSeenAt` and the failover sweeper.\nexport const RcHeartbeat = z.object({});\n// ── delegated verification (§9 / §10) ────────────────────────────────────────\n/** The longest chat id the agent chat API accepts; `useChat` generates far shorter ones. */\nexport const AGENT_CHAT_ID_MAX_CHARS = 128;\n/** Why the CP refused an agent chat key, each of which the relay answers with its own status. */\nexport const AGENT_CHAT_KEY_REFUSAL = {\n invalidKey: 'invalid key',\n notPermitted: 'key not permitted',\n agentNotFound: 'agent not found',\n agentMoved: 'agent moved',\n agentUnavailable: 'agent unavailable'\n};\n// R→C REQ → rc/verify/ok. The relay holds no database, so it delegates credential\n// checks to the CP: a daemon's API key on `rd/hello`, or a browser's CP-minted\n// short-lived webchat token. The credential is secret material — NEVER log.\n// `conversationBinding` is optional on the wire so a new CP can reject one old\n// relay's webchat dial without closing the relay's shared control connection.\nexport const RcVerify = z.discriminatedUnion('kind', [\n z.object({\n kind: z.literal('ahp-client-key'),\n credential: z.string().min(1),\n agentId: z.string().uuid(),\n // The endpoint the relay advertised as the protected resource; an OAuth token's grant must name it.\n resource: z.string().url().max(2048).optional()\n }),\n z.object({\n kind: z.literal('daemon-key'),\n credential: z.string().min(1)\n }),\n // An in-cluster daemon's projected ServiceAccount token, reviewed against its cluster.\n z.object({\n kind: z.literal('daemon-token'),\n credential: z.string().min(1),\n // The daemonId claimed on `rd/hello`, forwarded unverified. CP binds a pool member token's\n // reviewed Pod UID to one member record and refuses any different claim.\n daemonId: z.string().uuid().optional()\n }),\n z.object({\n kind: z.literal('webchat-token'),\n credential: z.string().min(1),\n conversationBinding: z.literal('v1').optional(),\n protocol: z.literal('ahp').optional(),\n agentId: z.string().uuid().optional()\n }),\n // A desktop daemon's relay-audience channel token on `cr/hello` (computer-use.md §3.7): signed with its live channel key.\n z.object({\n kind: z.literal('computer-relay-token'),\n credential: z.string().min(1).max(2048),\n computerId: z.string().uuid()\n }),\n // An API key on the agent chat API (shared-bot-relay.md §10.4): the CP maps (key owner, agent, chat id) to its conversation.\n z.object({\n kind: z.literal('agent-chat-key'),\n credential: z.string().min(1),\n agentId: z.string().uuid(),\n chatId: z.string().min(1).max(AGENT_CHAT_ID_MAX_CHARS)\n }),\n // An open webchat socket, re-checked by the principal its dial verified: no credential, and the answer is `ok` alone.\n z.object({\n kind: z.literal('webchat-access'),\n orgId: z.string().min(1),\n userId: z.string().min(1),\n agentId: z.string().uuid(),\n conversationId: z.string().uuid()\n })\n]);\n// C→R REP (corr = rc/verify id). `ok:false` carries no detail beyond `reason`\n// (no existence oracle). On success the identity fields depend on `kind`:\n// - daemon-key → daemonId + orgId\n// - daemon-token → daemonId + orgId (same shape; a different credential)\n// - webchat-token → userId (+ display `user`) + agentId + daemonId + orgId +\n// conversationId, where daemonId is the agent's CURRENT placement and the\n// conversation id is the CP-authorized binding carried by the token.\n// One conversation participant, as resolved at verification time. `daemonId` is\n// the agent's CURRENT placement; absent when the agent is unplaced or its daemon\n// is not READY (the relay then refuses turns targeting it with `no_agent`).\nexport const RcWebchatParticipant = z.object({\n agentId: z.string().uuid(),\n daemonId: z.string().uuid().optional(),\n // The member that recorded this participant's current session, which is where its content is unless a shared store holds it. The relay carries it on every op so a member that reached the turn another way can refuse it (#2218).\n recordedDaemonId: z.string().uuid().optional(),\n primary: z.boolean().optional(),\n // This participant's own CP-selected continuation target, stamped on its rd/msg only; set on the peers a hook target's conversation brings (#2500).\n targetSessionId: z.string().min(1).optional(),\n // Who the token's user is to this participant; the relay stamps it on the turns and runtime changes it sends there.\n callerRole: ChatCallerRole.optional()\n});\nexport const RcVerifyResult = z.object({\n ahpGrant: AhpGrant.optional(),\n callerRole: ChatCallerRole.optional(),\n ok: z.boolean(),\n reason: z.string().optional(),\n orgId: z.string().optional(),\n daemonId: z.string().uuid().optional(),\n // computer-relay-token → the Computer the desktop proved it holds a live channel key for.\n computerId: z.string().uuid().optional(),\n userId: z.string().optional(),\n user: z.string().optional(), // display handle for the transcript author line\n // The author's public avatar URL, for a platform mirror that renders a per-message identity.\n userPicture: z.string().url().max(2_048).optional(),\n // A session continuation's author on the target session's platform (`<platform>:<tenant>:<memberId>`), from their linked accounts.\n userIdentities: z.array(z.string().min(1).max(512)).max(8).optional(),\n agentId: z.string().uuid().optional(),\n conversationId: z.string().uuid().optional(),\n // The conversation's full roster (multi-agent webchat). Singular agentId/daemonId\n // above stay the PRIMARY's values for rolling compatibility; `participants`\n // always includes the primary. Absent ⇒ single-agent conversation on an older CP.\n participants: z.array(RcWebchatParticipant).max(16).optional(),\n // Session-targeted continuation (webchat-cross-integration-continuation.md):\n // the CP-selected target session, by its outward id (§1.1). The relay copies it verbatim onto\n // every rd/msg for this conversation; it never originates in the browser and\n // is deliberately the only cross-system coordinate on the wire — every local\n // coordinate comes from the daemon's own session row.\n targetSessionId: z.string().min(1).optional(),\n remoteMcp: WebchatRemoteMcpEntitlement.optional(),\n // The primary agent's enabled chat APIs; the relay's chat API refuses a protocol absent here. Plain strings, so a newer CP's protocol never fails an older relay's parse.\n apiProtocols: z.array(z.string().min(1)).max(16).optional(),\n // The API key's owner could decide this agent's approvals in the console, so its calls may decide them too.\n callerApproves: z.boolean().optional()\n});\n// R→C REQ → rc/github-comment-authz/ok. The relay asks the CP (which owns the\n// App installation) for a current repository-permission verdict instead of\n// treating webhook `author_association` as authority. This frame is deliberately\n// metadata-only: authored content must never cross the relay↔CP control plane.\nexport const RcGithubHookFence = z\n .object({\n hookId: z.string().uuid(),\n configRevision: HookBigIntString,\n dispatchRevision: HookBigIntString\n})\n .strict();\nexport const RcGithubCommentAuthz = z\n .object({\n hookId: z.string().uuid(),\n installationId: z.string().regex(/^[1-9]\\d*$/),\n repoId: z.string().regex(/^[1-9]\\d*$/),\n repoFullName: z.string().regex(/^[^/\\s]+\\/[^/\\s]+$/),\n // Legacy field name: comment deliveries carry `comment.user.login`, not\n // the top-level webhook action sender. Maintainer controls carry the actor.\n senderLogin: z.string().min(1),\n // An unmentioned thread comment may continue automatically only when both\n // its commenter and the issue/PR author still have write authority. An\n // explicit maintainer summon omits this second actor.\n subjectAuthorLogin: z.string().min(1).optional(),\n // Fence authorization to the exact compiled rule that accepted the\n // delivery. A stale relay copy cannot authorize after retarget/reassign.\n configRevision: HookBigIntString,\n dispatchRevision: HookBigIntString,\n // Thread-actor authorization is repository-wide, but every matching sibling\n // must still be fenced against current CP state before one allow verdict\n // can authorize the complete fan-out.\n siblingFences: z.array(RcGithubHookFence).min(1).optional()\n})\n .strict();\n// C→R REP (corr = rc/github-comment-authz id). Do not disclose the user's\n// effective permission or which validation failed; the relay needs one bit.\nexport const RcGithubCommentAuthzResult = z.object({ allowed: z.boolean() }).strict();\n/** Neutral alias: the fence shape was never GitHub-specific. */\nexport const RcHookFence = RcGithubHookFence;\n// R→C REQ → rc/codehost-membership-authz/ok — metadata-only live membership (gitlab-com-integration.md §12.2), not `.strict()` so it can grow; an older CP fails closed.\nexport const RcCodeHostMembershipAuthz = z\n .object({\n hookId: z.string().uuid(),\n provider: z.string().min(1), // 'gitlab' today; open string so a new host degrades per-value\n repoExternalId: z.string().regex(/^[1-9]\\d*$/), // numeric project/repository id — the match key\n // Sender/actor numeric user id; an Azure DevOps actor is named by `actorIdentityId` instead, exactly one of the two.\n actorExternalId: z\n .string()\n .regex(/^[1-9]\\d*$/)\n .optional(),\n // The actor's Azure DevOps identity id (azure-devops-integration.md §11.4); an older CP refuses the frame and the relay fails closed.\n actorIdentityId: z.guid().toLowerCase().optional(),\n // The actor's login for a provider that looks permission up by name (Gitea §8); the CP re-resolves it against the id.\n actorUsername: z.string().min(1).optional(),\n // An unmentioned thread continuation also gates the subject author; an explicit summon omits it.\n subjectAuthorExternalId: z\n .string()\n .regex(/^[1-9]\\d*$/)\n .optional(),\n subjectAuthorUsername: z.string().min(1).optional(),\n // Fence authorization to the exact compiled rule that accepted the delivery.\n configRevision: HookBigIntString,\n dispatchRevision: HookBigIntString,\n siblingFences: z.array(RcHookFence).min(1).optional()\n})\n .superRefine((request, ctx) => {\n if ((request.actorExternalId === undefined) === (request.actorIdentityId === undefined)) {\n ctx.addIssue({\n code: 'custom',\n path: ['actorExternalId'],\n message: 'exactly one of actorExternalId and actorIdentityId is required'\n });\n }\n});\n// C→R REP (corr = rc/codehost-membership-authz id). One bit, same as GitHub.\nexport const RcCodeHostMembershipAuthzResult = z.object({ allowed: z.boolean() });\n// R→C REQ — signature-verified Check identity, suite identity, or waiting external-PR workflow control.\nconst GithubNumericId = z.string().regex(/^[1-9]\\d*$/);\nexport const RcGithubRerequest = z.union([\n z\n .object({\n checkRunId: GithubNumericId,\n repoId: GithubNumericId,\n headSha: z.string().min(1),\n deliveryKey: z.string().min(1).max(200),\n // Rolling opt-in: a new CP includes baseSha only when a new relay asks.\n // This keeps replies to older strict-schema relays byte-compatible.\n includeBaseSha: z.literal(true).optional(),\n // An organization App delivered it: the Check must be that App's.\n appId: GithubNumericId.optional()\n })\n .strict(),\n z\n .object({\n scope: z.literal('suite'),\n appId: GithubNumericId,\n installationId: GithubNumericId,\n repoId: GithubNumericId,\n headSha: z.string().min(1),\n deliveryKey: z.string().min(1).max(200)\n })\n .strict(),\n z\n .object({\n scope: z.literal('workflow'),\n installationId: GithubNumericId,\n repoId: GithubNumericId,\n headSha: z.string().min(1),\n pullNumber: z.number().int().positive().optional(),\n deliveryKey: z.string().min(1).max(200)\n })\n .strict()\n]);\n// C→R REP — a bare denial or durable run targets that relay re-fences against current compiled rules.\nconst RcGithubRerequestTarget = z\n .object({\n hookId: z.string().uuid(),\n pullNumber: z.number().int().positive(),\n baseSha: z.string().min(1),\n configRevision: HookBigIntString,\n dispatchRevision: HookBigIntString\n})\n .strict();\nexport const RcGithubRerequestResult = z.union([\n z.object({ allowed: z.literal(false) }).strict(),\n z\n .object({\n allowed: z.literal(true),\n hookId: z.string().uuid(),\n pullNumber: z.number().int().positive(),\n baseSha: z.string().min(1).optional(),\n configRevision: HookBigIntString,\n dispatchRevision: HookBigIntString\n })\n .strict(),\n z\n .object({\n allowed: z.literal(true),\n targets: z.array(RcGithubRerequestTarget).min(1)\n })\n .strict()\n]);\n// ── hooks (webhook-triggers-and-github-events.md; pool-wide broadcast) ──────\n/** The github member of a compiled rule (P2). */\nexport const RcGithubHookRule = z.object({\n repoId: z.string(), // GitHub numeric repo id (BigInt as string) — the match key\n repoFullName: z.string(), // display/logs only; never matched on\n // Immutable per-thread session namespace; optional for a CP that predates rename-stable affinity.\n sessionKeyPrefix: z.string().min(1).optional(),\n events: z.array(z.string()), // 'issues:opened' / 'pull_request:*' / …\n labelFilter: z.array(z.string()),\n // Draft PR revisions do not fire; `ready_for_review` reviews the head instead. Absent on a CP that predates it.\n skipDrafts: z.boolean().optional(),\n // Scopes GitHub's shared issue_comment event to the console-selected thread families; absent or empty keeps the legacy repo-wide meaning.\n commentFamilies: z.array(z.enum(['issues', 'pull_request'])).optional(),\n // P3 summon mode: authored text must @-mention this agent or the App; thread events still pass the live maintainer gate.\n mentionOnly: z.boolean(),\n // The broadcast handle: `@<appSlug>` keeps every matching rule in the repo fan-out (compiled from GITHUB_APP_SLUG).\n appSlug: z.string().optional(),\n // The org's other GitHub Apps (the built-in one included): their same-repository pull request revisions are the internal CI lane too.\n internalAppSlugs: z.array(z.string()).optional(),\n // The targeted handle: `@<agentName>` keeps only this agent's rules; optional for a CP that predates targeted mentions.\n agentName: z.string().optional(),\n // The org's valid installation ids (BigInt as string): an event fires only if payload.installation.id is in the set.\n installationIds: z.array(z.string())\n});\n/** Relays that fill an installation rule's repository in from each event advertise this (webhook-triggers-and-github-events.md, Installation-Wide Rows). */\nexport const HOOK_GITHUB_INSTALLATION_V1_FEATURE = 'hook-github-installation-v1';\n/** A relay that forwards a generic rule's `webhook.instructions` on each delivery, so the CP may send it one. */\nexport const HOOK_INSTRUCTIONS_V1_FEATURE = 'hook-instructions-v1';\n/** An installation-wide github rule: every repository of one App installation, the event naming the repository; its session prefix is `github:<repoId>`. */\nexport const RcGithubInstallationHookRule = RcGithubHookRule.omit({\n repoId: true,\n repoFullName: true,\n sessionKeyPrefix: true\n}).extend({\n installationId: z.string().regex(/^[1-9]\\d*$/), // the covered installation (BigInt as string) — the match key\n accountLogin: z.string().min(1) // display/logs only; never matched on\n});\n/** The gitlab member of a compiled rule (gitlab-com-integration.md §11.3); it carries the signing token inline, so the rule is NEVER logged. */\nexport const RcGitlabHookRule = z.object({\n projectId: z.string().regex(/^[1-9]\\d*$/), // numeric project id — the match key\n projectPath: z.string().min(1), // display/logs only; never matched on\n sessionKeyPrefix: z.string().min(1), // rename-stable per-thread namespace: gitlab:<projectId>\n events: z.array(z.string()), // 'issues:*' / 'merge_request:*' / 'push:*' …\n // Non-empty ⇒ the subject's CURRENT labels must intersect it (case-insensitive); optional for a CP predating the filter.\n labelFilter: z.array(z.string()).optional(),\n commentFamilies: z.array(z.enum(['issues', 'merge_request'])).optional(),\n mentionOnly: z.boolean(),\n agentName: z.string().optional(),\n // The binding's runtime identity: loop prevention (§12.1) and the mention/reviewer targets.\n serviceAccountUserId: z.string().regex(/^[1-9]\\d*$/),\n serviceAccountUsername: z.string().min(1),\n // §12.1 veto set: every managed account bound to the project; additive optional (§17.3), a rule without it vetoes only the account above.\n boundServiceAccountUserIds: z.array(z.string().regex(/^[1-9]\\d*$/)).optional(),\n // whsec_ Standard Webhooks signing key for §11.2 verification.\n signingToken: z.string().min(1),\n // The instance this rule addresses (§24.4), copied opaquely onto forwarded metadata as the turn-time host fence; absent means GitLab.com.\n host: z.string().optional()\n});\n/** The gitea member of a compiled rule (gitea-integration.md §7); it carries the signing key inline, so the rule is NEVER logged. */\nexport const RcGiteaHookRule = z.object({\n repoId: z.string().regex(/^[1-9]\\d*$/), // numeric repository id — the match key\n repoPath: z.string().min(1), // display/logs only; never matched on\n sessionKeyPrefix: z.string().min(1), // rename-stable per-thread namespace: gitea:<repoId>\n events: z.array(z.string()), // 'issues:*' / 'merge_request:*' / 'push:*' …\n // Non-empty ⇒ the subject's CURRENT labels must intersect it (case-insensitive); additive optional, an older relay ignores it.\n labelFilter: z.array(z.string()).optional(),\n // The comment SUBJECT vocabulary (`is_pull`), not the event family: the CP maps a stored `merge_request` scope here.\n commentFamilies: z.array(z.enum(['issues', 'pull_request'])).optional(),\n mentionOnly: z.boolean(),\n agentName: z.string().optional(),\n // The connection's single bot user: the §8 veto set and the mention/reviewer target. Gitea's\n // permission lookup is by username, so the relay forwards the login beside the numeric id.\n botUserId: z.string().regex(/^[1-9]\\d*$/),\n botUsername: z.string().min(1),\n // Hex HMAC-SHA256 key for the `X-Gitea-Signature` verification of §7.\n signingKey: z.string().min(1),\n // The successor key mid-rotation (§7): the relay accepts either until the CP promotes it.\n nextSigningKey: z.string().min(1).optional(),\n // The instance this rule addresses (§3), copied opaquely onto forwarded metadata as the turn-time host fence; absent means gitea.com.\n host: z.string().optional()\n});\n/** The fixed Basic user name every Azure DevOps subscription is created with (azure-devops-integration.md §11.2); the password is the signing key. */\nexport const AZURE_DEVOPS_HOOK_BASIC_USER = 'agentconnect';\n/** One recorded service hook subscription of the binding and the delivery kind it was created for. */\nexport const RcAzureDevOpsHookSubscription = z.object({\n subscriptionId: z.guid().toLowerCase(),\n kind: AzureDevOpsDeliveryKind\n});\n/** The azureDevOps member of a compiled rule (azure-devops-integration.md §11.3); it carries the signing keys inline, so the rule is NEVER logged. */\nexport const RcAzureDevOpsHookRule = z\n .object({\n repoId: z.string().regex(/^[1-9]\\d*$/), // the surrogate repository id\n repoPath: z.string().min(1), // organization/project/repository — display/logs only; never matched on\n sessionKeyPrefix: z.string().min(1), // rename-stable per-thread namespace: azure-devops:<repoId>\n ...AzureDevOpsRepoRouting.shape,\n // The organization's collection id, which every delivery names in `resourceContainers.collection`.\n instanceId: z.guid().toLowerCase(),\n // Every subscription the binding records: the relay's lookup key, each with the one kind it delivers.\n subscriptions: z.array(RcAzureDevOpsHookSubscription).min(1).max(16),\n events: z.array(z.string()), // 'merge_request:*' / 'push:*' …; no issues, releases or labels\n commentFamilies: z.array(z.enum(['pull_request'])).optional(),\n mentionOnly: z.boolean(),\n agentName: z.string().optional(),\n // The connection's identity: the §11.4 veto set and the broadcast mention.\n identityId: z.guid().toLowerCase(),\n // The Basic password each subscription sends; mid-rotation the next one verifies too.\n signingKey: z.string().min(1),\n nextSigningKey: z.string().min(1).optional(),\n // The key a promotion replaced, still accepted until its expiry so a queued retry is not refused.\n previousSigningKey: z.string().min(1).optional(),\n previousSigningKeyExpiresAt: z.string().datetime().optional()\n})\n .superRefine((rule, ctx) => {\n if ((rule.previousSigningKey === undefined) !== (rule.previousSigningKeyExpiresAt === undefined)) {\n ctx.addIssue({\n code: 'custom',\n path: ['previousSigningKeyExpiresAt'],\n message: 'previousSigningKey and previousSigningKeyExpiresAt go together'\n });\n }\n const ids = rule.subscriptions.map((subscription) => subscription.subscriptionId);\n if (new Set(ids).size !== ids.length) {\n ctx.addIssue({ code: 'custom', path: ['subscriptions'], message: 'a subscription is recorded once' });\n }\n});\n/** A code-host rule's routing scope: one routing per organization, repository and subject family, hosted by one watching agent. */\nexport const RcHookRouting = z.object({\n routingId: z.string().uuid(),\n decisionId: z.string().uuid(),\n // The watching agent whose daemon evaluates, and that daemon, so every relay names the same host.\n evaluationAgentId: z.string().uuid(),\n evaluationDaemonId: z.string().uuid()\n});\n// C→R EVT — one enabled hook's compiled rule, broadcast to the WHOLE pool\n// (webhook-type ingress is pool-served, shared-bot-relay.md §5). Upsert\n// semantics: the CP re-sends the full frame on hook create/update/enable, on\n// agent placement moves, and (github kind) when the org's installation set\n// changes; disable/delete send `rc/hook-remove`. After a relay (re)registers\n// the CP replays every enabled hook — the relay's table is a memory copy.\n// `hmacSecret` is secret material — NEVER log this frame.\nexport const RcHookAssign = z\n .object({\n hookId: z.string().uuid(),\n kind: z.enum(HOOK_KINDS),\n agentId: z.string().uuid(),\n daemonId: z.string().uuid(), // the agent's CURRENT placement; re-sent on moves\n // R1/R2a rolling fields. Partial/absent remains decodable, but the relay\n // propagates an incomplete tuple with review/reporting forced off.\n ...OptionalHookConfigSnapshot.shape,\n sessionMode: z.enum(['perDelivery', 'perThread', 'perSubject', 'shared']),\n target: CronTarget.optional(), // output anchoring; absent ⇒ headless\n // The repository scope's Decision routing this rule belongs to; its events go once to the evaluation host (code-host-decisions.md §4).\n routing: RcHookRouting.optional(),\n // kind=webhook — required for that kind (enforced at the CP compile site)\n webhook: z\n .object({\n urlToken: z.string().min(1), // ingress routing key (capability URL)\n hmacSecret: z.string().optional(), // optional X-AC-Signature key\n // Only to relays advertising HOOK_INSTRUCTIONS_V1_FEATURE: an older one would drop it and run the payload as the instruction.\n instructions: HookInstructions.optional()\n })\n .optional(),\n // kind=github (P2) — required for that kind, unless the rule is installation-wide\n github: RcGithubHookRule.optional(),\n // kind=github installation row — only to relays advertising HOOK_GITHUB_INSTALLATION_V1_FEATURE\n githubInstallation: RcGithubInstallationHookRule.optional(),\n // kind=gitlab (gitlab-com-integration.md §11.3) — required for that kind\n gitlab: RcGitlabHookRule.optional(),\n // kind=gitea (gitea-integration.md §7) — required for that kind\n gitea: RcGiteaHookRule.optional(),\n // kind=azure-devops (azure-devops-integration.md §11.3) — required for that kind, only to relays advertising azure-devops-hooks-v1\n azureDevOps: RcAzureDevOpsHookRule.optional()\n})\n .superRefine((rule, ctx) => {\n if (rule.github !== undefined && rule.githubInstallation !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['githubInstallation'],\n message: 'a rule watches a repository or an installation, not both'\n });\n }\n if (rule.dispatchDaemonId !== undefined && rule.dispatchDaemonId !== rule.daemonId) {\n ctx.addIssue({\n code: 'custom',\n path: ['dispatchDaemonId'],\n message: 'dispatchDaemonId must equal daemonId on a compiled rule'\n });\n }\n});\n/** The code-host rule a compiled rule carries; undefined for the generic kind or a kind missing its member. */\nexport function codeHostHookRuleOf(rule) {\n if (rule.kind === 'github' && rule.github) {\n const { repoId: externalId, repoFullName: path } = rule.github;\n return { provider: 'github', repo: { provider: 'github', externalId, path }, rule: rule.github };\n }\n if (rule.kind === 'gitlab' && rule.gitlab) {\n const { projectId: externalId, projectPath: path } = rule.gitlab;\n return { provider: 'gitlab', repo: { provider: 'gitlab', externalId, path }, rule: rule.gitlab };\n }\n if (rule.kind === 'gitea' && rule.gitea) {\n const { repoId: externalId, repoPath: path } = rule.gitea;\n return { provider: 'gitea', repo: { provider: 'gitea', externalId, path }, rule: rule.gitea };\n }\n if (rule.kind === 'azure-devops' && rule.azureDevOps) {\n const { repoId: externalId, repoPath: path } = rule.azureDevOps;\n const repo = { provider: 'azure-devops', externalId, path };\n return { provider: 'azure-devops', repo, rule: rule.azureDevOps };\n }\n return undefined;\n}\n// C→R EVT — drop one rule (hook disabled / deleted / agent unplaced).\nexport const RcHookRemove = z.object({\n hookId: z.string().uuid()\n});\n/** Definite pre-dispatch unavailability: the relay found no live connection for\n * the assigned daemon, so no agent turn or external review effect could start. */\nexport const HOOK_DELIVERY_REASON_DAEMON_OFFLINE = 'daemon_offline';\n/** Definite pre-admission refusal while the selected daemon is draining. */\nexport const HOOK_DELIVERY_REASON_DAEMON_DRAINING = 'rejected:draining';\n/** Definite pre-admission refusal after no routed daemon acquired the agent duty. */\nexport const HOOK_DELIVERY_REASON_DAEMON_NOT_HOLDER = 'rejected:not_holder';\n/** Ambiguous delivery: the daemon may have admitted the message before the ACK\n * was lost. Record it consistently, but do not automatically redeliver it\n * without cross-daemon idempotency or an end-to-end admission fence. */\nexport const HOOK_DELIVERY_REASON_DISPATCH_TIMEOUT = 'dispatch_timeout';\n/** A PR authored outside the repository's write boundary is intentionally not\n * dispatched until a maintainer explicitly requests review. The failed\n * delivery-stage row is a metadata-only durable anchor for the actionable\n * informational Check; it does not represent an attempted agent turn. */\nexport const HOOK_DELIVERY_REASON_REVIEW_REQUEST_REQUIRED = 'review_request_required';\n/** Identifier returned by GitHub when a maintainer clicks the Check action that\n * opens the first review generation for an external PR. */\nexport const GITHUB_REQUEST_REVIEW_ACTION = 'request_review';\n/** Closed set of delivery failures proven to occur before durable daemon admission. */\nexport const RETRYABLE_HOOK_DELIVERY_REASONS = [\n HOOK_DELIVERY_REASON_DAEMON_OFFLINE,\n HOOK_DELIVERY_REASON_DAEMON_DRAINING,\n HOOK_DELIVERY_REASON_DAEMON_NOT_HOLDER\n];\nconst retryableHookDeliveryReasons = new Set(RETRYABLE_HOOK_DELIVERY_REASONS);\nexport function isRetryableHookDeliveryReason(reason) {\n return typeof reason === 'string' && retryableHookDeliveryReasons.has(reason);\n}\n// R→C EVT (fire-and-forget) — delivery-stage bookkeeping, pure metadata (no\n// payload ever). `accepted` opens the HookRun row (running); `failed` records a\n// failed row outright. The daemon's `hook/report` completion EVT (frames/hook.ts,\n// the control WS) later closes accepted rows; the HookRunReaper harvests the\n// rest. Duplicate reports collapse on the CP's (hookId, deliveryKey) unique key.\nexport const RcRunReport = z\n .object({\n hookId: z.string().uuid(),\n deliveryKey: z.string().min(1),\n firedAt: z.string().datetime(), // relay ingest time == HookRun.startedAt\n agentId: z.string().uuid(),\n daemonId: z.string().uuid().optional(),\n ...OptionalHookConfigSnapshot.shape,\n event: z.string().min(1).optional(), // 'issues:opened' etc (github); absent for webhook kind\n github: GithubHookMetadata.optional(),\n gitlab: GitlabHookMetadata.optional(),\n gitea: GiteaHookMetadata.optional(),\n azureDevOps: AzureDevOpsHookMetadata.optional(),\n status: z.enum(['accepted', 'failed']),\n reason: z.string().optional() // delivery-stage reason; use isRetryableHookDeliveryReason before redelivery\n})\n .superRefine((report, ctx) => {\n if (report.daemonId !== undefined &&\n report.dispatchDaemonId !== undefined &&\n report.daemonId !== report.dispatchDaemonId) {\n ctx.addIssue({\n code: 'custom',\n path: ['dispatchDaemonId'],\n message: 'dispatchDaemonId must equal daemonId on a delivery report'\n });\n }\n});\n// R→C EVT (fire-and-forget) — installation doorbell (webhook-triggers decision 11):\n// the relay forwards a verified `installation`/`installation_repositories`\n// event as a minimal poke; the CP re-pulls `GET /app/installations/{id}` as the\n// source of truth (`action` is observational — the CP never writes from it).\n// Emitted ONLY after X-Hub-Signature-256 verification. A dropped doorbell is\n// safe for a durable claim: the setup callback / scoped manual Sync /\n// mint-failure refresh paths converge eventually.\nexport const RcGithubInstallation = z.object({\n installationId: z.string().min(1), // GitHub numeric id (BigInt as string)\n action: z.string().min(1), // created|deleted|suspend|…|added|removed\n // Set when an organization App delivered it (its GitHub App id): the CP re-pulls that App's roster.\n appId: GithubNumericId.optional()\n});\n// R→C EVT — one verified, body-free code-host delivery, matched or not (gitea-integration.md §6, §7): it verifies the binding and promotes a rotated key; a drop is never an error.\nexport const RcCodeHostDelivery = z.object({\n provider: CodeHostProviderString,\n repoExternalId: CodeHostExternalId,\n deliveryKey: z.string().min(1),\n receivedAt: z.string().datetime(),\n // Which of the rule's signing keys verified the body; absent means the current one. `previous` is Azure DevOps's retry window.\n verifiedWith: z.enum(['current', 'next', 'previous']).optional()\n});\n// ── revocation (§9 revocation loop) ─────────────────────────────────────────\n// C→R EVT — the daemon's credential was revoked / membership removed: the relay\n// must immediately drop that daemon's connection and stop routing to it.\nexport const RcDaemonRevoke = z.object({\n daemonId: z.string().uuid()\n});\n// The Block Kit `action_id` on a shared bot's 👤 switch-agent button (§10.1; older\n// posted messages may still carry the same action on their footer). The DAEMON renders\n// the button (send-only) and the RELAY receives the click over HTTP interactivity — they're\n// different processes, so the id is pinned here as the single source. The `callback_id`\n// on the relay-owned default-agent modal shares the same string. Session configuration\n// uses `SLACK_STATUS_ACTION.manage` (⚙️) instead.\nexport const SHARED_CONFIG_ACTION_ID = 'ac_shared_channel_config';\n/** The Block Kit `action_id` on a shared status bar's inline agent selector.\n * The relay owns the shared app's HTTP interaction edge and answers both the\n * external-select suggestions and the resulting channel-default selection. Keep\n * this separate from {@link SHARED_CONFIG_ACTION_ID}: older posted messages still\n * use that id for the legacy 👤 button + modal flow. */\nexport const SHARED_AGENT_SELECT_ACTION_ID = 'ac_shared_agent_select';\n// `SLACK_MANAGE_SESSION_SHORTCUT_CALLBACK_ID` is declared in the app manifest, so\n// it lives in `../slack-app-manifest.ts` and is re-exported from the package root\n// alongside the ids below. See that file for why it cannot import back into here.\n/** Slack action ids shared by the daemon-owned status modal and the relay-owned\n * HTTP interaction edge. Dedicated bots handle them in the daemon directly; shared bots\n * forward them from the relay to the target daemon. */\nexport const SLACK_STATUS_ACTION = {\n more: 'ac_more',\n manage: 'ac_manage',\n setModel: 'ac_set_model',\n setEffort: 'ac_set_effort',\n setPermissionMode: 'ac_set_permission_mode',\n setFast: 'ac_set_fast',\n setOutput: 'ac_set_output',\n cancel: 'ac_cancel',\n view: 'ac_view'\n};\n/** Slack action ids/codecs shared by the daemon-rendered human-input cards and\n * the relay-owned HTTP interaction edge. Keeping them on the wire package prevents\n * direct Socket Mode and HTTP relay mode from interpreting the same card differently. */\nexport const PERMISSION_ACTION_PREFIX = 'ac_perm';\nexport const ELICIT_ACTION_PREFIX = 'ac_elicit';\nexport const ELICIT_DISMISS_ACTION = 'ac_elicit_dismiss';\n/** The Confirm button on an elicitation card whose fields are `input` blocks — a select, a\n * checkbox list or a typed box never submits on its own. Nothing is tracked between the two:\n * Confirm reads every field out of its OWN payload's message state, so what it submits is the\n * state that card was in when this reader tapped it. Its `value` is the bare request id. */\nexport const ELICIT_CONFIRM_ACTION = 'ac_elicit_confirm';\n/** The `action_id` every one of those `input` elements carries. One input per block, because\n * Slack keys the submitted state by BLOCK id — {@link elicitFormBlockId} is that key. */\nexport const ELICIT_FORM_INPUT_ACTION = 'ac_elicit_input';\nconst ELICIT_FORM_BLOCK_PREFIX = 'ac_elicit_f';\n/** The block id of the card's Nth field. The INDEX rather than the property name: a property\n * name can outrun Slack's own id length, and the daemon re-derives the field list from the\n * card's params anyway (#1815), so an index is all the wire has to carry. */\nexport function elicitFormBlockId(index) {\n return `${ELICIT_FORM_BLOCK_PREFIX}${index}`;\n}\n/** The field index one of those block ids names, or null when the id is not one of ours. */\nexport function elicitFormBlockIndex(blockId) {\n if (!blockId.startsWith(ELICIT_FORM_BLOCK_PREFIX))\n return null;\n const digits = blockId.slice(ELICIT_FORM_BLOCK_PREFIX.length);\n return /^\\d+$/.test(digits) ? Number(digits) : null;\n}\n/** What the reader typed and picked on a form card, keyed by the field's BLOCK id so a per-field\n * verdict can name the very same key. A blank input and a cleared select are OMITTED rather than\n * reported as empty: an untouched optional field is absent from the answer, which is what the\n * schema means by optional, and the daemon's own accept check is what decides whether a required\n * one may be missing. Pure. */\nexport function elicitFormViewValues(state) {\n const out = {};\n for (const [blockId, block] of Object.entries(state?.values ?? {})) {\n if (elicitFormBlockIndex(blockId) === null)\n continue;\n const input = block?.[ELICIT_FORM_INPUT_ACTION];\n if (!input)\n continue;\n if (Array.isArray(input.selected_options)) {\n const values = input.selected_options.map((o) => o.value);\n if (values.every((v) => typeof v === 'string'))\n out[blockId] = values;\n continue;\n }\n const picked = input.selected_option?.value;\n if (typeof picked === 'string')\n out[blockId] = picked;\n else if (typeof input.value === 'string' && input.value.length)\n out[blockId] = input.value;\n }\n return out;\n}\n/** Encode/decode the choice carried by permission and elicitation buttons. The\n * daemon-generated request id is `|`-free; runtime-owned option values may contain it. */\nexport function encodePermValue(requestId, optionId) {\n return `${requestId}|${optionId}`;\n}\nexport function decodePermValue(value) {\n const i = value.indexOf('|');\n return i < 0 ? null : { requestId: value.slice(0, i), optionId: value.slice(i + 1) };\n}\n/** One short choice from the compact Slack status overflow. Slack caps option\n * values at 150 characters; the longer session target rides in `block_id`. */\nexport const SlackStatusOverflowAction = z.enum(['switch-agent', 'manage', 'cancel']);\nconst LegacySlackStatusOverflowValue = z\n .object({\n v: z.literal(1),\n action: SlackStatusOverflowAction,\n target: z.string().min(1)\n})\n .strict();\nexport function encodeSlackStatusOverflowValue(action) {\n return action;\n}\nexport function decodeSlackStatusOverflowValue(value) {\n const compact = SlackStatusOverflowAction.safeParse(value);\n if (compact.success)\n return { action: compact.data };\n try {\n const legacy = LegacySlackStatusOverflowValue.safeParse(JSON.parse(value));\n return legacy.success ? { action: legacy.data.action, target: legacy.data.target } : null;\n }\n catch {\n return null;\n }\n}\n/** Opaque routing target carried by a shared bot's session-config button and modal.\n * Slack returns it unchanged in `action.value` / `view.private_metadata`; the relay\n * validates the agent against its current bot assignment before forwarding. */\nexport const SharedSlackStatusTarget = z\n .object({\n v: z.literal(1),\n agentId: z.string().min(1),\n integrationId: z.string().min(1),\n sessionKey: z.string().min(1)\n})\n .strict();\nexport function encodeSharedSlackStatusTarget(target) {\n return JSON.stringify({ v: 1, ...target });\n}\nexport function decodeSharedSlackStatusTarget(value) {\n try {\n const parsed = SharedSlackStatusTarget.safeParse(JSON.parse(value));\n return parsed.success ? parsed.data : null;\n }\n catch {\n return null;\n }\n}\n// ── shared-bot assignment + routing (§7.1 / §10) ─────────────────────────────\n// One attributed routing rule the relay arbitrates inbound against. Unlike the\n// daemon's local BindRule this ALREADY carries its target (agentId + the daemon\n// to forward to + the integration id to send the reply back through) — the\n// CP→relay protocol is new, so the v1 \"owner side can't express attribution\"\n// blocker is fixed by attaching attribution here (§3). `scope` narrows the rule\n// to a channel/thread (channel ownership → per-channel default agent, §10).\nexport const AttributedRoute = z.object({\n agentId: z.string().uuid(),\n daemonId: z.string().uuid(),\n integrationId: z.string().uuid(),\n scope: z.object({ channel: z.string().optional(), thread: z.string().optional() }).optional(),\n match: BindMatch,\n decisionId: z.string().min(1).max(128).optional() // present exactly when match.kind === 'decision'\n});\n// Ingress-only credentials handed to the relay. Slack currently keeps its bot\n// token here for the existing HTTP interaction/channel APIs. Feishu deliberately\n// sends only callback verification material: its app secret and all provider API\n// egress stay on the daemon. Secret — NEVER log this frame.\nexport const RcBotSecrets = z.union([\n // The typed variants keep full validation for today's platforms AND pass unknown\n // keys through (`catchall`): a bag that satisfies a typed prefix may still carry\n // additional credential fields a newer platform module needs — stripping them\n // here would hand the §6.7 platform-module boundary less than what was on the\n // wire. Ordered first so validation still applies during the window.\n z\n .object({\n botToken: z.string(),\n signingSecret: z.string()\n })\n .catchall(z.unknown()),\n z\n .object({\n verificationToken: z.string(),\n encryptKey: z.string().optional()\n })\n .catchall(z.unknown()),\n // §6.7 open reader: a platform this build predates ships an opaque secret bag;\n // the relay's platform module (S3) validates its shape.\n z.record(z.string(), z.unknown())\n]);\n// One member agent's display info — the relay holds no DB, so it can't resolve a\n// name from an id. Carried so the relay can label the per-channel \"default agent\"\n// picker modal (§10.1 config button). Ids alone aren't enough for a human list.\nexport const RcAgentDirEntry = z.object({\n agentId: z.string().uuid(),\n name: z.string(), // the slug; the modal shows it (displayName folded in by the CP if set)\n daemonId: z.string().uuid(),\n // Rolling optional: new CPs include the install id so a receive-only relay can\n // hand an unroutable gated callback to the daemon that owns provider egress.\n integrationId: z.string().uuid().optional()\n});\n// One conversation's DEFAULT agent — the ladder rung consulted after keyword and\n// thread continuity and before the group's `defaultAgentId` (linear-integration.md\n// §6.2). It is what a conversation row's owner compiles to on a platform whose every\n// event already addresses the bot, where a channel-scoped route would instead outrank\n// the keyword and continuity rungs. Empty on every platform without that axis.\nexport const RcConversationDefault = z.object({\n channel: z.string().min(1),\n agentId: z.string().uuid(),\n daemonId: z.string().uuid(),\n integrationId: z.string().uuid()\n});\n// One executable By decision routing conversation and the one daemon that evaluates it (message-intake.md §6).\nexport const RcRoutedConversation = z.object({\n channel: z.string().min(1),\n decisionId: z.string().min(1).max(128),\n evaluationDaemonId: z.string().uuid(),\n // The agents its routing can select. Saving the routing needs edit rights on each, so it enables a gated (§14)\n // one in this conversation as a channel-scoped route does; absent ⇒ an older CP, only routes enable one\n targetAgentIds: z.array(z.string().uuid()).max(64).optional()\n});\n// C→R EVT — load a shared bot's INBOUND routing + credentials onto this relay:\n// inbound arrives over the shared HTTP Events API endpoints (`/slack/events`,\n// `/slack/interactions`) and is arbitrated against `routes`. Whole-pool: the CP\n// BROADCASTS this to EVERY connected relay (any pod may receive an event via the\n// stable `PUBLIC_RELAY_URL` LB); there is no per-bot relay placement. `members`\n// lists which daemons/agents this bot serves (drives which daemon connections the\n// relay expects). NEVER log.\nexport const RcBotAssign = z.object({\n botId: z.string().uuid(),\n // Console organization path for provider-owned management links; absent from older CPs.\n orgSlug: z.string().min(1).optional(),\n // Bindings outlive daemon availability; an empty array means the installation is disconnected.\n installedAgentIds: z.array(z.string().uuid()).optional(),\n // S1a open reader (route.ts Platform policy). The CP only emits ids the\n // relay build supports; the relay's assign handler already refuses an\n // unsupported platform gracefully (\"not yet supported\"), never the socket.\n platform: Platform,\n // §6.1: the platform's origin kind, so an older relay can classify an id a\n // newer CP introduces (always 'chat' for a bot assignment today). Overlaid on\n // the relay's built-in seed; absent (older CP) ⇒ the seed answers, and an id\n // neither classifies defaults to 'chat' (fail-closed in coordsDecision).\n originKind: z.string().min(1).optional(),\n // Install GENERATION of the credentials below — advanced by the CP every time a\n // fresh credential lands on this bot. The relay echoes it back in\n // `rc/bot-revoked` so the CP can refuse a revocation observed under a credential\n // that has since been replaced (Slack does not order lifecycle events). Absent\n // ⇒ the CP applies revocations without the revision arm of the fence.\n credentialRevision: z.number().int().nonnegative().optional(),\n secrets: RcBotSecrets,\n // §6.7 opaque INGRESS bag — the ONE carrier of the per-platform demux identity\n // (Slack: apiAppId \"A…\" + the distributed-install teamId \"T…\" + botUserId;\n // Feishu: appId \"cli_…\"). Shape validation belongs to the platform module on\n // both ends (S3): the CP provider's `projectBotAssign` produces it, the\n // relay's `toBotAssignment` / platform ingress plugin consume it. The legacy\n // named top-level twins (`apiAppId`/`teamId`/`botUserId`) left the schema with\n // the S3 protocol cleanup — emission stopped when the bag landed (#556) and\n // the bag-preferring reader shipped before that (#545), so nothing deployed\n // reads or writes them.\n ingress: z.unknown().optional(),\n members: z.array(z.object({ daemonId: z.string().uuid(), agentIds: z.array(z.string().uuid()) })),\n agents: z.array(RcAgentDirEntry).default([]), // member directory (id→name) for the config modal\n routes: z.array(AttributedRoute),\n defaultAgentId: z.string().uuid().optional(), // bare @bot / DM fallback within the group (§10.3)\n defaultDaemonId: z.string().uuid().optional(),\n // Conversation gating (resource-visibility.md §14): member agents whose ingress is\n // fail-closed. The relay's thread-affinity rung honours a binding to a gated agent\n // only while that agent still has a channel-scoped route in the conversation —\n // otherwise a thread bound before the gate was applied would keep routing forever.\n gatedAgentIds: z.array(z.string().uuid()).default([]),\n // Channels switched OFF for this bot. The relay's ladder has rungs no\n // channel-scoped route can suppress — unscoped keyword, the group's\n // `defaultAgentId`, thread continuity — so an Off channel needs a subtractive\n // fence rather than the mere absence of a route. A muted channel resolves to no\n // target at all. Bot-scoped, matching how an HTTP bot's channels converge on one\n // owner, and how the trigger is replicated across its membership rows. Defaults empty.\n mutedChannels: z.array(z.string()).default([]),\n // The muted channels that are Off rather than a held decision: an addressed message there gets the §14.3 notice.\n offChannels: z.array(z.string()).default([]),\n // Per conversation, the bot senders whose posts activate no agent of this bot there.\n blockedBotSenders: z.array(ChannelBlockedBotSenders).optional(),\n // §14.3 gating notice in a CHANNEL: the relay that posts it, since a channel mention's two event copies may land on different pods; absent ⇒ no relay posts.\n noticeAuthority: z.string().uuid().optional(),\n // §14.10: ms left in which a gated member's own new room may still be opening, so an unrouted message in a room this bot owns is retried rather than refused.\n roomOpeningMs: z.number().int().positive().max(120_000).optional(),\n // linear-integration.md §6.2 — the per-conversation default rung's table, keyed by\n // channel id, and the fact the thread-affinity gate reads for a gated agent on an\n // `ownerAsDefault` platform (its grant is the default seat it holds). Empty elsewhere.\n conversationDefaults: z.array(RcConversationDefault).default([]),\n // §9.1's platform axis, projected so the relay can pick the terminal `grant-withdrawn`\n // affinity refusal over Slack's fall-through without ever reading a platform name.\n ownerAsDefault: z.boolean().default(false),\n // Executable routed conversations only (held ones are muted); absent means none, as from an older CP.\n routedConversations: z.array(RcRoutedConversation).default([])\n});\n// C→R EVT — release a shared bot from this relay (bot un-shared, uninstalled, or\n// re-placed onto another relay): close the ingest, drop the routing table.\nexport const RcBotUnassign = z.object({\n botId: z.string().uuid(),\n // The install GENERATION this release describes. A revocation decides and\n // commits, then broadcasts — and a re-install can land in that gap, commit\n // N+1, and broadcast its own assign FIRST. An unfenced unassign arriving after\n // it would tear down the live ingest of a credential it never described. The\n // relay therefore ignores an unassign whose revision is older than the\n // assignment it currently holds. Absent ⇒ unconditional release (a transport\n // flip, an un-share, the last install removed — none of which race a\n // credential).\n credentialRevision: z.number().int().nonnegative().optional()\n});\n// C→R EVT — hot-update the routing table for an already-assigned bot (channel\n// ownership / membership / default-agent change) WITHOUT re-opening the ingest.\nexport const RcRoutes = z.object({\n botId: z.string().uuid(),\n members: z.array(z.object({ daemonId: z.string().uuid(), agentIds: z.array(z.string().uuid()) })),\n agents: z.array(RcAgentDirEntry).default([]),\n routes: z.array(AttributedRoute),\n defaultAgentId: z.string().uuid().optional(),\n defaultDaemonId: z.string().uuid().optional(),\n gatedAgentIds: z.array(z.string().uuid()).default([]), // §14 — see RcBotAssign.gatedAgentIds\n mutedChannels: z.array(z.string()).default([]), // Off channels — see RcBotAssign.mutedChannels\n offChannels: z.array(z.string()).default([]), // see RcBotAssign.offChannels\n blockedBotSenders: z.array(ChannelBlockedBotSenders).optional(), // see RcBotAssign.blockedBotSenders\n noticeAuthority: z.string().uuid().optional(), // §14.3 — see RcBotAssign.noticeAuthority\n roomOpeningMs: z.number().int().positive().max(120_000).optional(), // §14.10 — see RcBotAssign.roomOpeningMs\n // Rides the hot update too: an owner edit converges through `syncRoutes` without a\n // re-assign, so an already-connected relay would otherwise keep the old default —\n // and with it the old grant fact — after exactly the edit this rung exists for.\n // The immutable `ownerAsDefault` axis stays assignment-scoped.\n conversationDefaults: z.array(RcConversationDefault).default([]),\n routedConversations: z.array(RcRoutedConversation).default([]) // see RcBotAssign.routedConversations\n});\n// C→R EVT — durable per-sessionKey thread affinity BROADCAST leg (§10 step 3): the\n// CP persists a (botId, sessionKey)→{agentId, daemonId} binding reported by a relay\n// via `rc/thread-assign` and broadcasts it to EVERY connected relay, so any pool pod\n// that later receives an un-mentioned follow-up routes it to the same agent. A relay\n// also learns affinity live from its own routing; this is the authoritative sync +\n// the answer to a `rc/thread-lookup` miss.\nexport const RcAssign = z.object({\n botId: z.string().uuid(),\n sessionKey: z.string().min(1),\n agentId: z.string().uuid(),\n daemonId: z.string().uuid()\n});\n// C→R EVT — one durable conversation member. Kept as a distinct frame from\n// `rc/assign` so an older relay can never strip a discriminator and accidentally\n// replace legacy single-owner affinity with an arbitrary participant.\nexport const RcParticipantAssign = z.object({\n botId: z.string().uuid(),\n sessionKey: z.string().min(1),\n agentId: z.string().uuid(),\n daemonId: z.string().uuid()\n});\n// R→C EVT (fire-and-forget) — the operator picked a channel's default agent in the\n// in-Slack config modal (§10.1). The CP persists it as the channel's owner\n// (IntegrationChannel.agentId on the chosen agent's install for this bot, clearing\n// any other install's row for the same channel) and re-compiles the bot's routes\n// (rc/routes). A shared channel always has one owner. The relay acks the modal\n// immediately; this rides best-effort like other rc EVTs.\nexport const RcSetChannelAgent = z.object({\n botId: z.string().uuid(),\n channelId: z.string().min(1),\n agentId: z.string().uuid()\n});\n// R→C EVT (fire-and-forget) — the relay received an HTTP-mode Slack membership\n// event for the bot itself, re-listed the bot's complete channel membership via\n// users.conversations, and reports that authoritative snapshot to the CP. The CP\n// fans it across every active integration of this bot and recompiles channel routes.\n// Channel names are control metadata; no message content crosses this wire.\nexport const RcBotChannels = z.object({\n botId: z.string().uuid(),\n channels: z.array(IntegrationChannel)\n});\n// A platform's own answer code, recorded beside a revocation or a rejection; bounded so it stays a code, never prose.\nexport const BotCredentialCode = z.string().min(1).max(64);\n// How a relay learned a credential is dead: a platform lifecycle `event`, or a `probe` of the credential answering definitively.\nexport const BotRevocationEvidence = z.enum(['event', 'probe']);\n// R→C REQ → rc/bot-revoked/ok — the bot's credential is definitively dead: revoke it, flip its installs, release it; kept queued until acknowledged and fenced against a replaced credential (preset-agents.md §5.3).\nexport const RcBotRevoked = z.object({\n botId: z.string().uuid(),\n reason: z.enum(['app_uninstalled', 'tokens_revoked']),\n // The generation this relay held when it observed the event (from `rc/bot-assign`); a mismatch refuses the report.\n credentialRevision: z.number().int().nonnegative().optional(),\n // The platform's event time in ms; refuses an event that predates the current credential even when the revision matches.\n eventAtMs: z.number().int().nonnegative().optional(),\n // Recorded with the revocation for the console; absent (an older relay) ⇒ `event`.\n evidence: BotRevocationEvidence.optional(),\n // The platform's own code behind a probe's verdict (e.g. `token_revoked`); absent ⇒ none recorded.\n code: BotCredentialCode.optional()\n});\n// C→R REP (corr = rc/bot-revoked id) — the committed verdict, `applied: false` meaning the fence refused it; both are terminal, only a missing reply is retried.\nexport const RcBotRevokedOk = z.object({\n botId: z.string().uuid(),\n applied: z.boolean()\n});\n// Fields every credential check carries, whatever its result.\nconst RcBotCredentialCheckBase = z.object({\n botId: z.string().uuid(),\n // The generation the relay probed; the CP applies the check only while it is still the bot's current one.\n credentialRevision: z.number().int().nonnegative(),\n // When the relay observed the answer, in ms: a rejection's first-seen time, and the order this relay's checks apply in (older ones are ignored).\n observedAtMs: z.number().int().nonnegative()\n});\n// R→C REQ → rc/bot-credential-check/ok — this relay's probe answer that is not a revocation (`rejected` is ambiguous, e.g. an IP allowlist); the CP keeps each relay's latest and marks the bot while any is rejected; sent only to a CP advertising `bot-credential-check-v2`.\nexport const RcBotCredentialCheck = z.discriminatedUnion('result', [\n RcBotCredentialCheckBase.extend({ result: z.literal('ok') }),\n RcBotCredentialCheckBase.extend({ result: z.literal('rejected'), code: BotCredentialCode })\n]);\n// C→R REP (corr = rc/bot-credential-check id) — committed; `applied: false` means a replaced credential, an unknown bot or relay, or an observation no newer than this relay's last, and nothing was written.\nexport const RcBotCredentialCheckOk = z.object({\n botId: z.string().uuid(),\n applied: z.boolean()\n});\n// R→C REQ → rc/bot-tenant/ok — the tenant key a single-tenant row's own traffic named (google-chat-integration.md §10.3); at-least-once, so the CP deduplicates; sent only to a CP advertising `bot-tenant-v1`.\nexport const RcBotTenant = z.object({\n botId: z.string().uuid(),\n // The platform's tenant key as the event named it (`customers/…`, `domains/…`); the platform module decides what it records.\n tenantId: z.string().min(1).max(256)\n});\n// C→R REP (corr = rc/bot-tenant id) — committed and pushed; `applied: false` means the row already knew the key (re-synced all the same), refused it, or is not one that learns, and nothing was written.\nexport const RcBotTenantOk = z.object({\n botId: z.string().uuid(),\n applied: z.boolean()\n});\n// R→C EVT (fire-and-forget) — INCREMENTAL conversation report (resource-visibility\n// §14.3): the relay saw an inbound direct conversation to a shared bot. The CP fans\n// a per-install row across every member, using each agent's visibility-appropriate\n// default. Incremental on purpose — unlike `rc/bot-channels` this must never\n// carry full-set semantics (DM rows are never dropped by snapshots). Conversation\n// id/name are control metadata; no message content crosses this wire. Loss is\n// self-healing: the counterpart's next DM re-reports.\nexport const RcBotConversation = z.object({\n botId: z.string().uuid(),\n conversation: IntegrationChannel\n});\n// R→C EVT (fire-and-forget): another bot posted in a conversation of a shared bot. A lost report heals on that bot's next post.\nexport const RcBotSender = z.object({\n botId: z.string().uuid(),\n channel: z.string().min(1),\n sender: ChannelBotSender\n});\n// R→C EVT (fire-and-forget) — durable thread-affinity REPORT leg (§10 step 3, the\n// 3-leg affinity dance). The relay tells the CP which agent now owns a (channel,\n// thread) `sessionKey` the first time it routes that thread, and again on a\n// Switch-agent. The CP is the single writer: it persists the (botId, sessionKey)→\n// {agentId, daemonId} binding and BROADCASTS it back to every relay via `rc/assign`.\n// Sibling of `rc/set-channel-agent`; rides best-effort like other rc EVTs.\nexport const RcThreadAssign = z.object({\n botId: z.string().uuid(),\n sessionKey: z.string().min(1),\n agentId: z.string().uuid(),\n daemonId: z.string().uuid()\n});\n// R→C EVT — add one durable participant without changing affinity. A distinct\n// frame fails closed against an older CP instead of being decoded as owner assignment.\nexport const RcThreadParticipant = z.object({\n botId: z.string().uuid(),\n sessionKey: z.string().min(1),\n agentId: z.string().uuid(),\n daemonId: z.string().uuid()\n});\n// R→C REQ → rc/thread-lookup/ok — pull-on-miss BACKSTOP leg. When an un-mentioned\n// follow-up arrives for a (channel, thread) the relay has no cached affinity for\n// (missed the broadcast, or (re)started before it), the relay asks the CP for the\n// persisted owner rather than dropping the message. The relay caches the result.\nexport const RcThreadLookup = z.object({\n botId: z.string().uuid(),\n sessionKey: z.string().min(1),\n // `stop` makes the answer GRANT-BLIND (linear-integration.md §9.3): a stop can only\n // end work, so it must reach the runtime that holds the session even after the\n // conversation's default moved off a gated holder. Absent ⇒ the ordinary gated mode.\n mode: z.literal('stop').optional()\n});\n// C→R REP (corr = rc/thread-lookup id). `target: null` ⇒ the CP holds no binding\n// for this (botId, sessionKey) — the relay falls back to normal arbitration.\nexport const RcThreadLookupOk = z.object({\n botId: z.string().uuid(),\n sessionKey: z.string().min(1),\n // `integrationId` is the holder's install ON THIS BOT — carried so a pre-addressed\n // interaction (the Stop-mode lookup, §9.3) needs no second resolution. Optional:\n // an older CP omits it and the relay backfills from its own member directory.\n target: z\n .object({ agentId: z.string().uuid(), daemonId: z.string().uuid(), integrationId: z.string().uuid().optional() })\n .nullable(),\n // Durable room membership is independent of the compatibility owner. Default\n // keeps new relays able to read replies from an older CP during rollout.\n participants: z.array(z.object({ agentId: z.string().uuid(), daemonId: z.string().uuid() })).default([])\n});\n// C→R EVT — the bot-AGNOSTIC agent-collaboration routing snapshot (agent-collaboration\n// §2.3 / §6.2 / §6.5). FULL-REPLACE: the relay swaps its whole `(orgId,platform,channel)\n// → agents` table. Unlike `rc/bot-assign` (keyed by botId, can't address cross-bot), this\n// lets the relay resolve a cross-daemon `rd/agentmsg` `toAgentId` → owning daemonId and\n// authorize caller/target call policy. Bodiless routing/policy metadata only.\nexport const RcCollabRoutes = CollabRoutesSnapshot;\n// C→R EVT — pool-wide MCP proxy binding (centralized-tool-management.md §5.2); `headers` carry the UPSTREAM credential — NEVER log this frame.\n/** The longest MCP tool name a decision table or catalog carries. */\nexport const MCP_TOOL_NAME_MAX = 256;\n/** The most tools one decision list or one catalog carries. */\nexport const MCP_TOOL_LIST_MAX = 1_000;\nconst McpToolNames = z.array(z.string().min(1).max(MCP_TOOL_NAME_MAX)).max(MCP_TOOL_LIST_MAX).default([]);\n/** One restricted grant's per-tool decisions (mcp-tool-permissions.md §6.1); a name in no list is Blocked. */\nexport const McpToolPolicy = z.object({\n allow: McpToolNames,\n approval: McpToolNames,\n ask: McpToolNames\n});\n/** The relay enforces per-agent tool tables and answers `rc/mcp-catalog` (mcp-tool-permissions.md §6). */\nexport const MCP_TOOL_POLICY_V1_FEATURE = 'mcp-tool-policy-v1';\n/** Stage 6 approvals (mcp-tool-permissions.md §5.6): relays check the approval header, daemons keep `daemon`-custody grants from runtimes. */\nexport const MCP_TOOL_APPROVAL_V1_FEATURE = 'mcp-tool-approval-v1';\nexport const RcMcpAssign = z\n .object({\n providerId: z.string().uuid(),\n upstreamUrl: z.string(),\n headers: z.array(z.object({ name: z.string(), value: z.string() })).default([]),\n // sha256 of the active unrestricted grant keys; never empty, because an empty allowlist must not read as \"unrestricted\".\n grantKeyHashes: z.array(z.string().min(1)).min(1),\n // Deduplicated decision tables, sent only to a relay advertising MCP_TOOL_POLICY_V1_FEATURE.\n toolPolicies: z.array(McpToolPolicy).max(MCP_TOOL_LIST_MAX).optional(),\n // Restricted agent grants: each hash is judged by its table, never treated as unrestricted.\n restrictedGrants: z\n .array(z.object({ grantKeyHash: z.string().min(1), policy: z.number().int().nonnegative() }))\n .max(10_000)\n .optional()\n})\n .superRefine((assign, ctx) => {\n const unrestricted = new Set(assign.grantKeyHashes);\n for (const [i, grant] of (assign.restrictedGrants ?? []).entries()) {\n if (grant.policy >= (assign.toolPolicies?.length ?? 0))\n ctx.addIssue({ code: 'custom', path: ['restrictedGrants', i, 'policy'], message: 'unknown tool policy' });\n if (unrestricted.has(grant.grantKeyHash))\n ctx.addIssue({\n code: 'custom',\n path: ['restrictedGrants', i],\n message: 'a grant is restricted or not, never both'\n });\n }\n});\n// C→R EVT — drop an MCP proxy binding: whole provider (`{providerId}`, deleted/revoked)\n// or a single grant hash (`{providerId, grantKeyHash}`, rotation — old key retired).\nexport const RcMcpUnassign = z.object({\n providerId: z.string().uuid(),\n grantKeyHash: z.string().optional()\n});\n// C→R REQ → rc/mcp-catalog/ok — list a provider's tools through the relay's own binding and egress (mcp-tool-permissions.md §4).\nexport const RcMcpCatalog = z.object({ providerId: z.string().uuid() });\n/** The longest tool description a catalog carries. */\nexport const MCP_CATALOG_DESCRIPTION_MAX = 1_000;\n/** One tool as the console groups it: its name, display text, annotation hints, and whether it renders an interface. */\nexport const McpCatalogTool = z.object({\n name: z.string().min(1).max(MCP_TOOL_NAME_MAX),\n title: z.string().max(256).optional(),\n description: z.string().max(MCP_CATALOG_DESCRIPTION_MAX).optional(),\n readOnlyHint: z.boolean().optional(),\n destructiveHint: z.boolean().optional(),\n idempotentHint: z.boolean().optional(),\n openWorldHint: z.boolean().optional(),\n interactive: z.boolean()\n});\n/** Why a catalog fetch failed; a closed set that never carries a host or a secret. */\nexport const McpCatalogFailure = z.enum([\n 'unknown_provider',\n 'misconfigured',\n 'blocked_address',\n 'unreachable',\n 'upstream_rejected',\n 'timeout',\n 'too_large',\n 'invalid_response'\n]);\nexport const RcMcpCatalogOk = z\n .object({ tools: z.array(McpCatalogTool).max(MCP_TOOL_LIST_MAX).optional(), failure: McpCatalogFailure.optional() })\n .refine((ok) => (ok.tools === undefined) !== (ok.failure === undefined), {\n message: 'exactly one of tools or failure'\n});\n// C→R EVT — purpose-separated external-memory proxy binding. It deliberately\n// does not reuse rc/mcp-assign: memory plugin traffic is daemon-private and must\n// never enter an agent/model MCP enable-list. Secret header values are relay-only.\nexport const RcMemoryConnectionAssign = z.object({\n orgId: z.string().min(1).max(64).optional(),\n connectionId: z.string().uuid(),\n // Monotonic durable connection revision. Relays ignore stale assignments so\n // concurrent HTTP mutations cannot roll credentials/config back out of order.\n revision: z.number().int().positive(),\n upstreamUrl: z.string().url().max(2_048),\n headers: z\n .array(z.object({ name: z.string().min(1).max(128), value: z.string().max(16 * 1024) }))\n .max(64)\n .default([]),\n grantKeyHashes: z\n .array(z.string().regex(/^[a-f0-9]{64}$/))\n .min(1)\n .max(64)\n});\nexport const RcMemoryConnectionUnassign = z.object({\n connectionId: z.string().uuid(),\n // Whole-connection delete uses the next revision as a tombstone; a\n // grant-specific retirement uses the revision of the preceding assign.\n revision: z.number().int().positive(),\n grantKeyHash: z\n .string()\n .regex(/^[a-f0-9]{64}$/)\n .optional()\n});\n/** This relay verifies organization GitHub Apps' webhooks, so the CP may send it `rc/github-app-assign`. */\nexport const GITHUB_APP_WEBHOOK_V1_FEATURE = 'github-app-webhook-v1';\n// C→R EVT — one organization App's webhook secret (github-app-git-credentials.md §Organization GitHub Apps); NEVER log this frame.\nexport const RcGithubAppAssign = z.object({\n githubAppId: z.string().uuid(),\n appId: GithubNumericId,\n webhookSecret: z.string().min(1).max(256)\n});\n// C→R EVT — the App is gone: its deliveries no longer verify.\nexport const RcGithubAppUnassign = z.object({ githubAppId: z.string().uuid() });\n/** Both ends frame a full reconnect replay as one snapshot, so the relay prunes what the replay no longer names. */\nexport const RELAY_PROJECTION_SNAPSHOT_V1_FEATURE = 'relay-projection-snapshot-v1';\n/** At most this many ids ride one `rc/snapshot-end`; a CP that failed on more sends no end, and the relay keeps its copy. */\nexport const RC_SNAPSHOT_MAX_WITHHELD = 1_000;\n/** The relay projections a CP replays in full after the relay (re)registers. */\nexport const RcSnapshotKind = z.enum(['mcp', 'hook', 'memory', 'follow-up-watch', 'github-app']);\n/** C→R EVT: a full replay of one projection starts; the relay keeps serving its current copy meanwhile. */\nexport const RcSnapshotBegin = z.object({ kind: RcSnapshotKind, snapshotId: z.string().uuid() });\n/** C→R EVT: the replay is complete; the relay drops each entry it neither received nor finds `withheld` (items the CP failed to produce). */\nexport const RcSnapshotEnd = z.object({\n kind: RcSnapshotKind,\n snapshotId: z.string().uuid(),\n withheld: z.array(z.string().uuid()).max(RC_SNAPSHOT_MAX_WITHHELD)\n});\n// ── computer viewer media metering (computer-use.md §15.5) ───────────────────\n/** CP takes `rc/computer-media-usage`; a relay sends it only when the CP advertised this. */\nexport const COMPUTER_MEDIA_USAGE_FEATURE = 'computer-media-usage-v1';\nexport const RC_COMPUTER_MEDIA_USAGE_MAX = 1000;\n// R→C EVT: TURN bytes this relay forwarded per Computer since its last report; best effort, a lost report is lost usage.\nexport const RcComputerMediaUsage = z.object({\n from: z.string().datetime(),\n to: z.string().datetime(),\n entries: z\n .array(z.object({ computerId: z.string().uuid(), bytes: z.number().int().positive().max(Number.MAX_SAFE_INTEGER) }))\n .min(1)\n .max(RC_COMPUTER_MEDIA_USAGE_MAX)\n});\n// ── the wire union ───────────────────────────────────────────────────────────\n/** `type` string → payload schema for the relay↔CP wire. */\nexport const RELAY_CP_SCHEMAS = {\n 'rc/auth': RcAuth,\n 'rc/auth/ok': RcAuthOk,\n 'rc/register': RcRegister,\n 'rc/registered': RcRegistered,\n 'rc/heartbeat': RcHeartbeat,\n 'rc/verify': RcVerify,\n 'rc/verify/ok': RcVerifyResult,\n 'rc/github-comment-authz': RcGithubCommentAuthz,\n 'rc/github-comment-authz/ok': RcGithubCommentAuthzResult,\n 'rc/codehost-membership-authz': RcCodeHostMembershipAuthz,\n 'rc/codehost-membership-authz/ok': RcCodeHostMembershipAuthzResult,\n 'rc/github-rerequest': RcGithubRerequest,\n 'rc/github-rerequest/ok': RcGithubRerequestResult,\n 'rc/codehost-feedback-watch': RcCodeHostFeedbackWatch,\n 'rc/codehost-feedback': RcCodeHostFeedback,\n 'rc/codehost-feedback/ok': RcCodeHostFeedbackResult,\n 'rc/pull-request-feedback': RcPullRequestFeedback,\n 'rc/pull-request-feedback/ok': RcPullRequestFeedbackResult,\n 'rc/follow-up-watch': RcFollowUpWatch,\n 'rc/hook-assign': RcHookAssign,\n 'rc/hook-remove': RcHookRemove,\n 'rc/run-report': RcRunReport,\n 'rc/github-installation': RcGithubInstallation,\n 'rc/codehost-delivery': RcCodeHostDelivery,\n 'rc/daemon-revoke': RcDaemonRevoke,\n 'rc/bot-assign': RcBotAssign,\n 'rc/bot-unassign': RcBotUnassign,\n 'rc/routes': RcRoutes,\n 'rc/assign': RcAssign,\n 'rc/participant-assign': RcParticipantAssign,\n 'rc/set-channel-agent': RcSetChannelAgent,\n 'rc/bot-channels': RcBotChannels,\n 'rc/bot-conversation': RcBotConversation,\n 'rc/bot-sender': RcBotSender,\n 'rc/bot-revoked': RcBotRevoked,\n 'rc/bot-revoked/ok': RcBotRevokedOk,\n 'rc/bot-credential-check': RcBotCredentialCheck,\n 'rc/bot-credential-check/ok': RcBotCredentialCheckOk,\n 'rc/bot-tenant': RcBotTenant,\n 'rc/bot-tenant/ok': RcBotTenantOk,\n 'rc/thread-assign': RcThreadAssign,\n 'rc/thread-participant': RcThreadParticipant,\n 'rc/thread-lookup': RcThreadLookup,\n 'rc/thread-lookup/ok': RcThreadLookupOk,\n 'rc/collab-routes': RcCollabRoutes,\n 'rc/mcp-assign': RcMcpAssign,\n 'rc/mcp-unassign': RcMcpUnassign,\n 'rc/mcp-catalog': RcMcpCatalog,\n 'rc/mcp-catalog/ok': RcMcpCatalogOk,\n 'rc/memoryconnection-assign': RcMemoryConnectionAssign,\n 'rc/memoryconnection-unassign': RcMemoryConnectionUnassign,\n 'rc/github-app-assign': RcGithubAppAssign,\n 'rc/github-app-unassign': RcGithubAppUnassign,\n 'rc/snapshot-begin': RcSnapshotBegin,\n 'rc/snapshot-end': RcSnapshotEnd,\n 'rc/fragment': FrameFragment,\n 'rc/computer-media-usage': RcComputerMediaUsage,\n error: ErrorFrame\n};\n/** All relay↔CP frame `type` strings, as a runtime array (guards / tests). */\nexport const RELAY_CP_FRAME_TYPES = Object.keys(RELAY_CP_SCHEMAS);\n/** The discriminated union of every fully-validated relay↔CP frame. */\nexport const RelayCpFrame = z.discriminatedUnion('type', [\n frameSchema('rc/auth', RELAY_CP_SCHEMAS['rc/auth']),\n frameSchema('rc/auth/ok', RELAY_CP_SCHEMAS['rc/auth/ok']),\n frameSchema('rc/register', RELAY_CP_SCHEMAS['rc/register']),\n frameSchema('rc/registered', RELAY_CP_SCHEMAS['rc/registered']),\n frameSchema('rc/heartbeat', RELAY_CP_SCHEMAS['rc/heartbeat']),\n frameSchema('rc/verify', RELAY_CP_SCHEMAS['rc/verify']),\n frameSchema('rc/verify/ok', RELAY_CP_SCHEMAS['rc/verify/ok']),\n frameSchema('rc/github-comment-authz', RELAY_CP_SCHEMAS['rc/github-comment-authz']),\n frameSchema('rc/github-comment-authz/ok', RELAY_CP_SCHEMAS['rc/github-comment-authz/ok']),\n frameSchema('rc/codehost-membership-authz', RELAY_CP_SCHEMAS['rc/codehost-membership-authz']),\n frameSchema('rc/codehost-membership-authz/ok', RELAY_CP_SCHEMAS['rc/codehost-membership-authz/ok']),\n frameSchema('rc/github-rerequest', RELAY_CP_SCHEMAS['rc/github-rerequest']),\n frameSchema('rc/github-rerequest/ok', RELAY_CP_SCHEMAS['rc/github-rerequest/ok']),\n frameSchema('rc/codehost-feedback', RELAY_CP_SCHEMAS['rc/codehost-feedback']),\n frameSchema('rc/codehost-feedback/ok', RELAY_CP_SCHEMAS['rc/codehost-feedback/ok']),\n frameSchema('rc/codehost-feedback-watch', RELAY_CP_SCHEMAS['rc/codehost-feedback-watch']),\n frameSchema('rc/pull-request-feedback', RELAY_CP_SCHEMAS['rc/pull-request-feedback']),\n frameSchema('rc/pull-request-feedback/ok', RELAY_CP_SCHEMAS['rc/pull-request-feedback/ok']),\n frameSchema('rc/follow-up-watch', RELAY_CP_SCHEMAS['rc/follow-up-watch']),\n frameSchema('rc/hook-assign', RELAY_CP_SCHEMAS['rc/hook-assign']),\n frameSchema('rc/hook-remove', RELAY_CP_SCHEMAS['rc/hook-remove']),\n frameSchema('rc/run-report', RELAY_CP_SCHEMAS['rc/run-report']),\n frameSchema('rc/github-installation', RELAY_CP_SCHEMAS['rc/github-installation']),\n frameSchema('rc/codehost-delivery', RELAY_CP_SCHEMAS['rc/codehost-delivery']),\n frameSchema('rc/daemon-revoke', RELAY_CP_SCHEMAS['rc/daemon-revoke']),\n frameSchema('rc/bot-assign', RELAY_CP_SCHEMAS['rc/bot-assign']),\n frameSchema('rc/bot-unassign', RELAY_CP_SCHEMAS['rc/bot-unassign']),\n frameSchema('rc/routes', RELAY_CP_SCHEMAS['rc/routes']),\n frameSchema('rc/assign', RELAY_CP_SCHEMAS['rc/assign']),\n frameSchema('rc/participant-assign', RELAY_CP_SCHEMAS['rc/participant-assign']),\n frameSchema('rc/set-channel-agent', RELAY_CP_SCHEMAS['rc/set-channel-agent']),\n frameSchema('rc/bot-channels', RELAY_CP_SCHEMAS['rc/bot-channels']),\n frameSchema('rc/bot-conversation', RELAY_CP_SCHEMAS['rc/bot-conversation']),\n frameSchema('rc/bot-sender', RELAY_CP_SCHEMAS['rc/bot-sender']),\n frameSchema('rc/bot-revoked', RELAY_CP_SCHEMAS['rc/bot-revoked']),\n frameSchema('rc/bot-revoked/ok', RELAY_CP_SCHEMAS['rc/bot-revoked/ok']),\n frameSchema('rc/bot-credential-check', RELAY_CP_SCHEMAS['rc/bot-credential-check']),\n frameSchema('rc/bot-credential-check/ok', RELAY_CP_SCHEMAS['rc/bot-credential-check/ok']),\n frameSchema('rc/bot-tenant', RELAY_CP_SCHEMAS['rc/bot-tenant']),\n frameSchema('rc/bot-tenant/ok', RELAY_CP_SCHEMAS['rc/bot-tenant/ok']),\n frameSchema('rc/thread-assign', RELAY_CP_SCHEMAS['rc/thread-assign']),\n frameSchema('rc/thread-participant', RELAY_CP_SCHEMAS['rc/thread-participant']),\n frameSchema('rc/thread-lookup', RELAY_CP_SCHEMAS['rc/thread-lookup']),\n frameSchema('rc/thread-lookup/ok', RELAY_CP_SCHEMAS['rc/thread-lookup/ok']),\n frameSchema('rc/collab-routes', RELAY_CP_SCHEMAS['rc/collab-routes']),\n frameSchema('rc/mcp-assign', RELAY_CP_SCHEMAS['rc/mcp-assign']),\n frameSchema('rc/mcp-unassign', RELAY_CP_SCHEMAS['rc/mcp-unassign']),\n frameSchema('rc/mcp-catalog', RELAY_CP_SCHEMAS['rc/mcp-catalog']),\n frameSchema('rc/mcp-catalog/ok', RELAY_CP_SCHEMAS['rc/mcp-catalog/ok']),\n frameSchema('rc/memoryconnection-assign', RELAY_CP_SCHEMAS['rc/memoryconnection-assign']),\n frameSchema('rc/memoryconnection-unassign', RELAY_CP_SCHEMAS['rc/memoryconnection-unassign']),\n frameSchema('rc/github-app-assign', RELAY_CP_SCHEMAS['rc/github-app-assign']),\n frameSchema('rc/github-app-unassign', RELAY_CP_SCHEMAS['rc/github-app-unassign']),\n frameSchema('rc/snapshot-begin', RELAY_CP_SCHEMAS['rc/snapshot-begin']),\n frameSchema('rc/snapshot-end', RELAY_CP_SCHEMAS['rc/snapshot-end']),\n frameSchema('rc/fragment', RELAY_CP_SCHEMAS['rc/fragment']),\n frameSchema('rc/computer-media-usage', RELAY_CP_SCHEMAS['rc/computer-media-usage']),\n frameSchema('error', RELAY_CP_SCHEMAS['error'])\n]);\n/** Runtime guard: is `t` a known relay↔CP frame `type`? */\nexport function isRelayCpFrameType(t) {\n return Object.prototype.hasOwnProperty.call(RELAY_CP_SCHEMAS, t);\n}\n/** Decode one relay↔CP wire frame (envelope + typed payload). */\nexport function decodeRelayCpFrame(text, opts = {}) {\n return decodeEnvelopeWith(RELAY_CP_SCHEMAS, text, opts);\n}\n/** Build a relay↔CP frame with a compile-time-typed payload. */\nexport function buildRelayCpFrame(type, payload, opts = {}) {\n return buildEnvelopeRaw(type, payload, opts);\n}\n//# sourceMappingURL=relay-cp.js.map","/**\n * Platform-neutral attribution sentence. Callers render and escape each part\n * before passing it here so GitHub Markdown, Slack mrkdwn, and Slack fallback\n * text can keep their own link syntax.\n */\nexport interface AttributionMessageParts {\n agent: string\n runtime?: string\n model?: string\n renderSession?: (label: string) => string | undefined\n notice?: string\n}\n\n/** Raw reply identity shared by platform renderers before each platform applies\n * its own escaping and link syntax. */\nexport interface ReplyAttributionInfo {\n botName: string\n botUrl: string\n runtime: string\n model: string\n sessionUrl: string\n notice?: string\n}\n\nconst OPEN_IN_SESSION_LABEL = 'open in session'\n\nfunction present(value: string | undefined): value is string {\n return value !== undefined && value.trim().length > 0\n}\n\n/** Canonical visible order: sender, optional runtime/model identity, session link. */\nexport function renderAttributionMessage({\n agent,\n runtime,\n model,\n renderSession,\n notice\n}: AttributionMessageParts): string {\n const identity = [runtime, model].filter(present)\n const sender = identity.length > 0 ? `sent by ${agent} (${identity.join(' · ')})` : `sent by ${agent}`\n const session = renderSession?.(OPEN_IN_SESSION_LABEL)\n return [sender, session, notice].filter(present).join(' · ')\n}\n","/**\n * @typedef {import('mdast').Nodes} Nodes\n *\n * @typedef Options\n * Configuration (optional).\n * @property {boolean | null | undefined} [includeImageAlt=true]\n * Whether to use `alt` for `image`s (default: `true`).\n * @property {boolean | null | undefined} [includeHtml=true]\n * Whether to use `value` of HTML (default: `true`).\n */\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Get the text content of a node or list of nodes.\n *\n * Prefers the node’s plain-text fields, otherwise serializes its children,\n * and if the given value is an array, serialize the nodes in it.\n *\n * @param {unknown} [value]\n * Thing to serialize, typically `Node`.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {string}\n * Serialized `value`.\n */\nexport function toString(value, options) {\n const settings = options || emptyOptions\n const includeImageAlt =\n typeof settings.includeImageAlt === 'boolean'\n ? settings.includeImageAlt\n : true\n const includeHtml =\n typeof settings.includeHtml === 'boolean' ? settings.includeHtml : true\n\n return one(value, includeImageAlt, includeHtml)\n}\n\n/**\n * One node or several nodes.\n *\n * @param {unknown} value\n * Thing to serialize.\n * @param {boolean} includeImageAlt\n * Include image `alt`s.\n * @param {boolean} includeHtml\n * Include HTML.\n * @returns {string}\n * Serialized node.\n */\nfunction one(value, includeImageAlt, includeHtml) {\n if (node(value)) {\n if ('value' in value) {\n return value.type === 'html' && !includeHtml ? '' : value.value\n }\n\n if (includeImageAlt && 'alt' in value && value.alt) {\n return value.alt\n }\n\n if ('children' in value) {\n return all(value.children, includeImageAlt, includeHtml)\n }\n }\n\n if (Array.isArray(value)) {\n return all(value, includeImageAlt, includeHtml)\n }\n\n return ''\n}\n\n/**\n * Serialize a list of nodes.\n *\n * @param {Array<unknown>} values\n * Thing to serialize.\n * @param {boolean} includeImageAlt\n * Include image `alt`s.\n * @param {boolean} includeHtml\n * Include HTML.\n * @returns {string}\n * Serialized nodes.\n */\nfunction all(values, includeImageAlt, includeHtml) {\n /** @type {Array<string>} */\n const result = []\n let index = -1\n\n while (++index < values.length) {\n result[index] = one(values[index], includeImageAlt, includeHtml)\n }\n\n return result.join('')\n}\n\n/**\n * Check if `value` looks like a node.\n *\n * @param {unknown} value\n * Thing.\n * @returns {value is Nodes}\n * Whether `value` is a node.\n */\nfunction node(value) {\n return Boolean(value && typeof value === 'object')\n}\n","/**\n * Map of named character references.\n *\n * @type {Record<string, string>}\n */\nexport const characterEntities = {\n AElig: 'Æ',\n AMP: '&',\n Aacute: 'Á',\n Abreve: 'Ă',\n Acirc: 'Â',\n Acy: 'А',\n Afr: '𝔄',\n Agrave: 'À',\n Alpha: 'Α',\n Amacr: 'Ā',\n And: '⩓',\n Aogon: 'Ą',\n Aopf: '𝔸',\n ApplyFunction: '',\n Aring: 'Å',\n Ascr: '𝒜',\n Assign: '≔',\n Atilde: 'Ã',\n Auml: 'Ä',\n Backslash: '∖',\n Barv: '⫧',\n Barwed: '⌆',\n Bcy: 'Б',\n Because: '∵',\n Bernoullis: 'ℬ',\n Beta: 'Β',\n Bfr: '𝔅',\n Bopf: '𝔹',\n Breve: '˘',\n Bscr: 'ℬ',\n Bumpeq: '≎',\n CHcy: 'Ч',\n COPY: '©',\n Cacute: 'Ć',\n Cap: '⋒',\n CapitalDifferentialD: 'ⅅ',\n Cayleys: 'ℭ',\n Ccaron: 'Č',\n Ccedil: 'Ç',\n Ccirc: 'Ĉ',\n Cconint: '∰',\n Cdot: 'Ċ',\n Cedilla: '¸',\n CenterDot: '·',\n Cfr: 'ℭ',\n Chi: 'Χ',\n CircleDot: '⊙',\n CircleMinus: '⊖',\n CirclePlus: '⊕',\n CircleTimes: '⊗',\n ClockwiseContourIntegral: '∲',\n CloseCurlyDoubleQuote: '”',\n CloseCurlyQuote: '’',\n Colon: '∷',\n Colone: '⩴',\n Congruent: '≡',\n Conint: '∯',\n ContourIntegral: '∮',\n Copf: 'ℂ',\n Coproduct: '∐',\n CounterClockwiseContourIntegral: '∳',\n Cross: '⨯',\n Cscr: '𝒞',\n Cup: '⋓',\n CupCap: '≍',\n DD: 'ⅅ',\n DDotrahd: '⤑',\n DJcy: 'Ђ',\n DScy: 'Ѕ',\n DZcy: 'Џ',\n Dagger: '‡',\n Darr: '↡',\n Dashv: '⫤',\n Dcaron: 'Ď',\n Dcy: 'Д',\n Del: '∇',\n Delta: 'Δ',\n Dfr: '𝔇',\n DiacriticalAcute: '´',\n DiacriticalDot: '˙',\n DiacriticalDoubleAcute: '˝',\n DiacriticalGrave: '`',\n DiacriticalTilde: '˜',\n Diamond: '⋄',\n DifferentialD: 'ⅆ',\n Dopf: '𝔻',\n Dot: '¨',\n DotDot: '⃜',\n DotEqual: '≐',\n DoubleContourIntegral: '∯',\n DoubleDot: '¨',\n DoubleDownArrow: '⇓',\n DoubleLeftArrow: '⇐',\n DoubleLeftRightArrow: '⇔',\n DoubleLeftTee: '⫤',\n DoubleLongLeftArrow: '⟸',\n DoubleLongLeftRightArrow: '⟺',\n DoubleLongRightArrow: '⟹',\n DoubleRightArrow: '⇒',\n DoubleRightTee: '⊨',\n DoubleUpArrow: '⇑',\n DoubleUpDownArrow: '⇕',\n DoubleVerticalBar: '∥',\n DownArrow: '↓',\n DownArrowBar: '⤓',\n DownArrowUpArrow: '⇵',\n DownBreve: '̑',\n DownLeftRightVector: '⥐',\n DownLeftTeeVector: '⥞',\n DownLeftVector: '↽',\n DownLeftVectorBar: '⥖',\n DownRightTeeVector: '⥟',\n DownRightVector: '⇁',\n DownRightVectorBar: '⥗',\n DownTee: '⊤',\n DownTeeArrow: '↧',\n Downarrow: '⇓',\n Dscr: '𝒟',\n Dstrok: 'Đ',\n ENG: 'Ŋ',\n ETH: 'Ð',\n Eacute: 'É',\n Ecaron: 'Ě',\n Ecirc: 'Ê',\n Ecy: 'Э',\n Edot: 'Ė',\n Efr: '𝔈',\n Egrave: 'È',\n Element: '∈',\n Emacr: 'Ē',\n EmptySmallSquare: '◻',\n EmptyVerySmallSquare: '▫',\n Eogon: 'Ę',\n Eopf: '𝔼',\n Epsilon: 'Ε',\n Equal: '⩵',\n EqualTilde: '≂',\n Equilibrium: '⇌',\n Escr: 'ℰ',\n Esim: '⩳',\n Eta: 'Η',\n Euml: 'Ë',\n Exists: '∃',\n ExponentialE: 'ⅇ',\n Fcy: 'Ф',\n Ffr: '𝔉',\n FilledSmallSquare: '◼',\n FilledVerySmallSquare: '▪',\n Fopf: '𝔽',\n ForAll: '∀',\n Fouriertrf: 'ℱ',\n Fscr: 'ℱ',\n GJcy: 'Ѓ',\n GT: '>',\n Gamma: 'Γ',\n Gammad: 'Ϝ',\n Gbreve: 'Ğ',\n Gcedil: 'Ģ',\n Gcirc: 'Ĝ',\n Gcy: 'Г',\n Gdot: 'Ġ',\n Gfr: '𝔊',\n Gg: '⋙',\n Gopf: '𝔾',\n GreaterEqual: '≥',\n GreaterEqualLess: '⋛',\n GreaterFullEqual: '≧',\n GreaterGreater: '⪢',\n GreaterLess: '≷',\n GreaterSlantEqual: '⩾',\n GreaterTilde: '≳',\n Gscr: '𝒢',\n Gt: '≫',\n HARDcy: 'Ъ',\n Hacek: 'ˇ',\n Hat: '^',\n Hcirc: 'Ĥ',\n Hfr: 'ℌ',\n HilbertSpace: 'ℋ',\n Hopf: 'ℍ',\n HorizontalLine: '─',\n Hscr: 'ℋ',\n Hstrok: 'Ħ',\n HumpDownHump: '≎',\n HumpEqual: '≏',\n IEcy: 'Е',\n IJlig: 'IJ',\n IOcy: 'Ё',\n Iacute: 'Í',\n Icirc: 'Î',\n Icy: 'И',\n Idot: 'İ',\n Ifr: 'ℑ',\n Igrave: 'Ì',\n Im: 'ℑ',\n Imacr: 'Ī',\n ImaginaryI: 'ⅈ',\n Implies: '⇒',\n Int: '∬',\n Integral: '∫',\n Intersection: '⋂',\n InvisibleComma: '',\n InvisibleTimes: '',\n Iogon: 'Į',\n Iopf: '𝕀',\n Iota: 'Ι',\n Iscr: 'ℐ',\n Itilde: 'Ĩ',\n Iukcy: 'І',\n Iuml: 'Ï',\n Jcirc: 'Ĵ',\n Jcy: 'Й',\n Jfr: '𝔍',\n Jopf: '𝕁',\n Jscr: '𝒥',\n Jsercy: 'Ј',\n Jukcy: 'Є',\n KHcy: 'Х',\n KJcy: 'Ќ',\n Kappa: 'Κ',\n Kcedil: 'Ķ',\n Kcy: 'К',\n Kfr: '𝔎',\n Kopf: '𝕂',\n Kscr: '𝒦',\n LJcy: 'Љ',\n LT: '<',\n Lacute: 'Ĺ',\n Lambda: 'Λ',\n Lang: '⟪',\n Laplacetrf: 'ℒ',\n Larr: '↞',\n Lcaron: 'Ľ',\n Lcedil: 'Ļ',\n Lcy: 'Л',\n LeftAngleBracket: '⟨',\n LeftArrow: '←',\n LeftArrowBar: '⇤',\n LeftArrowRightArrow: '⇆',\n LeftCeiling: '⌈',\n LeftDoubleBracket: '⟦',\n LeftDownTeeVector: '⥡',\n LeftDownVector: '⇃',\n LeftDownVectorBar: '⥙',\n LeftFloor: '⌊',\n LeftRightArrow: '↔',\n LeftRightVector: '⥎',\n LeftTee: '⊣',\n LeftTeeArrow: '↤',\n LeftTeeVector: '⥚',\n LeftTriangle: '⊲',\n LeftTriangleBar: '⧏',\n LeftTriangleEqual: '⊴',\n LeftUpDownVector: '⥑',\n LeftUpTeeVector: '⥠',\n LeftUpVector: '↿',\n LeftUpVectorBar: '⥘',\n LeftVector: '↼',\n LeftVectorBar: '⥒',\n Leftarrow: '⇐',\n Leftrightarrow: '⇔',\n LessEqualGreater: '⋚',\n LessFullEqual: '≦',\n LessGreater: '≶',\n LessLess: '⪡',\n LessSlantEqual: '⩽',\n LessTilde: '≲',\n Lfr: '𝔏',\n Ll: '⋘',\n Lleftarrow: '⇚',\n Lmidot: 'Ŀ',\n LongLeftArrow: '⟵',\n LongLeftRightArrow: '⟷',\n LongRightArrow: '⟶',\n Longleftarrow: '⟸',\n Longleftrightarrow: '⟺',\n Longrightarrow: '⟹',\n Lopf: '𝕃',\n LowerLeftArrow: '↙',\n LowerRightArrow: '↘',\n Lscr: 'ℒ',\n Lsh: '↰',\n Lstrok: 'Ł',\n Lt: '≪',\n Map: '⤅',\n Mcy: 'М',\n MediumSpace: ' ',\n Mellintrf: 'ℳ',\n Mfr: '𝔐',\n MinusPlus: '∓',\n Mopf: '𝕄',\n Mscr: 'ℳ',\n Mu: 'Μ',\n NJcy: 'Њ',\n Nacute: 'Ń',\n Ncaron: 'Ň',\n Ncedil: 'Ņ',\n Ncy: 'Н',\n NegativeMediumSpace: '',\n NegativeThickSpace: '',\n NegativeThinSpace: '',\n NegativeVeryThinSpace: '',\n NestedGreaterGreater: '≫',\n NestedLessLess: '≪',\n NewLine: '\\n',\n Nfr: '𝔑',\n NoBreak: '',\n NonBreakingSpace: ' ',\n Nopf: 'ℕ',\n Not: '⫬',\n NotCongruent: '≢',\n NotCupCap: '≭',\n NotDoubleVerticalBar: '∦',\n NotElement: '∉',\n NotEqual: '≠',\n NotEqualTilde: '≂̸',\n NotExists: '∄',\n NotGreater: '≯',\n NotGreaterEqual: '≱',\n NotGreaterFullEqual: '≧̸',\n NotGreaterGreater: '≫̸',\n NotGreaterLess: '≹',\n NotGreaterSlantEqual: '⩾̸',\n NotGreaterTilde: '≵',\n NotHumpDownHump: '≎̸',\n NotHumpEqual: '≏̸',\n NotLeftTriangle: '⋪',\n NotLeftTriangleBar: '⧏̸',\n NotLeftTriangleEqual: '⋬',\n NotLess: '≮',\n NotLessEqual: '≰',\n NotLessGreater: '≸',\n NotLessLess: '≪̸',\n NotLessSlantEqual: '⩽̸',\n NotLessTilde: '≴',\n NotNestedGreaterGreater: '⪢̸',\n NotNestedLessLess: '⪡̸',\n NotPrecedes: '⊀',\n NotPrecedesEqual: '⪯̸',\n NotPrecedesSlantEqual: '⋠',\n NotReverseElement: '∌',\n NotRightTriangle: '⋫',\n NotRightTriangleBar: '⧐̸',\n NotRightTriangleEqual: '⋭',\n NotSquareSubset: '⊏̸',\n NotSquareSubsetEqual: '⋢',\n NotSquareSuperset: '⊐̸',\n NotSquareSupersetEqual: '⋣',\n NotSubset: '⊂⃒',\n NotSubsetEqual: '⊈',\n NotSucceeds: '⊁',\n NotSucceedsEqual: '⪰̸',\n NotSucceedsSlantEqual: '⋡',\n NotSucceedsTilde: '≿̸',\n NotSuperset: '⊃⃒',\n NotSupersetEqual: '⊉',\n NotTilde: '≁',\n NotTildeEqual: '≄',\n NotTildeFullEqual: '≇',\n NotTildeTilde: '≉',\n NotVerticalBar: '∤',\n Nscr: '𝒩',\n Ntilde: 'Ñ',\n Nu: 'Ν',\n OElig: 'Œ',\n Oacute: 'Ó',\n Ocirc: 'Ô',\n Ocy: 'О',\n Odblac: 'Ő',\n Ofr: '𝔒',\n Ograve: 'Ò',\n Omacr: 'Ō',\n Omega: 'Ω',\n Omicron: 'Ο',\n Oopf: '𝕆',\n OpenCurlyDoubleQuote: '“',\n OpenCurlyQuote: '‘',\n Or: '⩔',\n Oscr: '𝒪',\n Oslash: 'Ø',\n Otilde: 'Õ',\n Otimes: '⨷',\n Ouml: 'Ö',\n OverBar: '‾',\n OverBrace: '⏞',\n OverBracket: '⎴',\n OverParenthesis: '⏜',\n PartialD: '∂',\n Pcy: 'П',\n Pfr: '𝔓',\n Phi: 'Φ',\n Pi: 'Π',\n PlusMinus: '±',\n Poincareplane: 'ℌ',\n Popf: 'ℙ',\n Pr: '⪻',\n Precedes: '≺',\n PrecedesEqual: '⪯',\n PrecedesSlantEqual: '≼',\n PrecedesTilde: '≾',\n Prime: '″',\n Product: '∏',\n Proportion: '∷',\n Proportional: '∝',\n Pscr: '𝒫',\n Psi: 'Ψ',\n QUOT: '\"',\n Qfr: '𝔔',\n Qopf: 'ℚ',\n Qscr: '𝒬',\n RBarr: '⤐',\n REG: '®',\n Racute: 'Ŕ',\n Rang: '⟫',\n Rarr: '↠',\n Rarrtl: '⤖',\n Rcaron: 'Ř',\n Rcedil: 'Ŗ',\n Rcy: 'Р',\n Re: 'ℜ',\n ReverseElement: '∋',\n ReverseEquilibrium: '⇋',\n ReverseUpEquilibrium: '⥯',\n Rfr: 'ℜ',\n Rho: 'Ρ',\n RightAngleBracket: '⟩',\n RightArrow: '→',\n RightArrowBar: '⇥',\n RightArrowLeftArrow: '⇄',\n RightCeiling: '⌉',\n RightDoubleBracket: '⟧',\n RightDownTeeVector: '⥝',\n RightDownVector: '⇂',\n RightDownVectorBar: '⥕',\n RightFloor: '⌋',\n RightTee: '⊢',\n RightTeeArrow: '↦',\n RightTeeVector: '⥛',\n RightTriangle: '⊳',\n RightTriangleBar: '⧐',\n RightTriangleEqual: '⊵',\n RightUpDownVector: '⥏',\n RightUpTeeVector: '⥜',\n RightUpVector: '↾',\n RightUpVectorBar: '⥔',\n RightVector: '⇀',\n RightVectorBar: '⥓',\n Rightarrow: '⇒',\n Ropf: 'ℝ',\n RoundImplies: '⥰',\n Rrightarrow: '⇛',\n Rscr: 'ℛ',\n Rsh: '↱',\n RuleDelayed: '⧴',\n SHCHcy: 'Щ',\n SHcy: 'Ш',\n SOFTcy: 'Ь',\n Sacute: 'Ś',\n Sc: '⪼',\n Scaron: 'Š',\n Scedil: 'Ş',\n Scirc: 'Ŝ',\n Scy: 'С',\n Sfr: '𝔖',\n ShortDownArrow: '↓',\n ShortLeftArrow: '←',\n ShortRightArrow: '→',\n ShortUpArrow: '↑',\n Sigma: 'Σ',\n SmallCircle: '∘',\n Sopf: '𝕊',\n Sqrt: '√',\n Square: '□',\n SquareIntersection: '⊓',\n SquareSubset: '⊏',\n SquareSubsetEqual: '⊑',\n SquareSuperset: '⊐',\n SquareSupersetEqual: '⊒',\n SquareUnion: '⊔',\n Sscr: '𝒮',\n Star: '⋆',\n Sub: '⋐',\n Subset: '⋐',\n SubsetEqual: '⊆',\n Succeeds: '≻',\n SucceedsEqual: '⪰',\n SucceedsSlantEqual: '≽',\n SucceedsTilde: '≿',\n SuchThat: '∋',\n Sum: '∑',\n Sup: '⋑',\n Superset: '⊃',\n SupersetEqual: '⊇',\n Supset: '⋑',\n THORN: 'Þ',\n TRADE: '™',\n TSHcy: 'Ћ',\n TScy: 'Ц',\n Tab: '\\t',\n Tau: 'Τ',\n Tcaron: 'Ť',\n Tcedil: 'Ţ',\n Tcy: 'Т',\n Tfr: '𝔗',\n Therefore: '∴',\n Theta: 'Θ',\n ThickSpace: ' ',\n ThinSpace: ' ',\n Tilde: '∼',\n TildeEqual: '≃',\n TildeFullEqual: '≅',\n TildeTilde: '≈',\n Topf: '𝕋',\n TripleDot: '⃛',\n Tscr: '𝒯',\n Tstrok: 'Ŧ',\n Uacute: 'Ú',\n Uarr: '↟',\n Uarrocir: '⥉',\n Ubrcy: 'Ў',\n Ubreve: 'Ŭ',\n Ucirc: 'Û',\n Ucy: 'У',\n Udblac: 'Ű',\n Ufr: '𝔘',\n Ugrave: 'Ù',\n Umacr: 'Ū',\n UnderBar: '_',\n UnderBrace: '⏟',\n UnderBracket: '⎵',\n UnderParenthesis: '⏝',\n Union: '⋃',\n UnionPlus: '⊎',\n Uogon: 'Ų',\n Uopf: '𝕌',\n UpArrow: '↑',\n UpArrowBar: '⤒',\n UpArrowDownArrow: '⇅',\n UpDownArrow: '↕',\n UpEquilibrium: '⥮',\n UpTee: '⊥',\n UpTeeArrow: '↥',\n Uparrow: '⇑',\n Updownarrow: '⇕',\n UpperLeftArrow: '↖',\n UpperRightArrow: '↗',\n Upsi: 'ϒ',\n Upsilon: 'Υ',\n Uring: 'Ů',\n Uscr: '𝒰',\n Utilde: 'Ũ',\n Uuml: 'Ü',\n VDash: '⊫',\n Vbar: '⫫',\n Vcy: 'В',\n Vdash: '⊩',\n Vdashl: '⫦',\n Vee: '⋁',\n Verbar: '‖',\n Vert: '‖',\n VerticalBar: '∣',\n VerticalLine: '|',\n VerticalSeparator: '❘',\n VerticalTilde: '≀',\n VeryThinSpace: ' ',\n Vfr: '𝔙',\n Vopf: '𝕍',\n Vscr: '𝒱',\n Vvdash: '⊪',\n Wcirc: 'Ŵ',\n Wedge: '⋀',\n Wfr: '𝔚',\n Wopf: '𝕎',\n Wscr: '𝒲',\n Xfr: '𝔛',\n Xi: 'Ξ',\n Xopf: '𝕏',\n Xscr: '𝒳',\n YAcy: 'Я',\n YIcy: 'Ї',\n YUcy: 'Ю',\n Yacute: 'Ý',\n Ycirc: 'Ŷ',\n Ycy: 'Ы',\n Yfr: '𝔜',\n Yopf: '𝕐',\n Yscr: '𝒴',\n Yuml: 'Ÿ',\n ZHcy: 'Ж',\n Zacute: 'Ź',\n Zcaron: 'Ž',\n Zcy: 'З',\n Zdot: 'Ż',\n ZeroWidthSpace: '',\n Zeta: 'Ζ',\n Zfr: 'ℨ',\n Zopf: 'ℤ',\n Zscr: '𝒵',\n aacute: 'á',\n abreve: 'ă',\n ac: '∾',\n acE: '∾̳',\n acd: '∿',\n acirc: 'â',\n acute: '´',\n acy: 'а',\n aelig: 'æ',\n af: '',\n afr: '𝔞',\n agrave: 'à',\n alefsym: 'ℵ',\n aleph: 'ℵ',\n alpha: 'α',\n amacr: 'ā',\n amalg: '⨿',\n amp: '&',\n and: '∧',\n andand: '⩕',\n andd: '⩜',\n andslope: '⩘',\n andv: '⩚',\n ang: '∠',\n ange: '⦤',\n angle: '∠',\n angmsd: '∡',\n angmsdaa: '⦨',\n angmsdab: '⦩',\n angmsdac: '⦪',\n angmsdad: '⦫',\n angmsdae: '⦬',\n angmsdaf: '⦭',\n angmsdag: '⦮',\n angmsdah: '⦯',\n angrt: '∟',\n angrtvb: '⊾',\n angrtvbd: '⦝',\n angsph: '∢',\n angst: 'Å',\n angzarr: '⍼',\n aogon: 'ą',\n aopf: '𝕒',\n ap: '≈',\n apE: '⩰',\n apacir: '⩯',\n ape: '≊',\n apid: '≋',\n apos: \"'\",\n approx: '≈',\n approxeq: '≊',\n aring: 'å',\n ascr: '𝒶',\n ast: '*',\n asymp: '≈',\n asympeq: '≍',\n atilde: 'ã',\n auml: 'ä',\n awconint: '∳',\n awint: '⨑',\n bNot: '⫭',\n backcong: '≌',\n backepsilon: '϶',\n backprime: '‵',\n backsim: '∽',\n backsimeq: '⋍',\n barvee: '⊽',\n barwed: '⌅',\n barwedge: '⌅',\n bbrk: '⎵',\n bbrktbrk: '⎶',\n bcong: '≌',\n bcy: 'б',\n bdquo: '„',\n becaus: '∵',\n because: '∵',\n bemptyv: '⦰',\n bepsi: '϶',\n bernou: 'ℬ',\n beta: 'β',\n beth: 'ℶ',\n between: '≬',\n bfr: '𝔟',\n bigcap: '⋂',\n bigcirc: '◯',\n bigcup: '⋃',\n bigodot: '⨀',\n bigoplus: '⨁',\n bigotimes: '⨂',\n bigsqcup: '⨆',\n bigstar: '★',\n bigtriangledown: '▽',\n bigtriangleup: '△',\n biguplus: '⨄',\n bigvee: '⋁',\n bigwedge: '⋀',\n bkarow: '⤍',\n blacklozenge: '⧫',\n blacksquare: '▪',\n blacktriangle: '▴',\n blacktriangledown: '▾',\n blacktriangleleft: '◂',\n blacktriangleright: '▸',\n blank: '␣',\n blk12: '▒',\n blk14: '░',\n blk34: '▓',\n block: '█',\n bne: '=⃥',\n bnequiv: '≡⃥',\n bnot: '⌐',\n bopf: '𝕓',\n bot: '⊥',\n bottom: '⊥',\n bowtie: '⋈',\n boxDL: '╗',\n boxDR: '╔',\n boxDl: '╖',\n boxDr: '╓',\n boxH: '═',\n boxHD: '╦',\n boxHU: '╩',\n boxHd: '╤',\n boxHu: '╧',\n boxUL: '╝',\n boxUR: '╚',\n boxUl: '╜',\n boxUr: '╙',\n boxV: '║',\n boxVH: '╬',\n boxVL: '╣',\n boxVR: '╠',\n boxVh: '╫',\n boxVl: '╢',\n boxVr: '╟',\n boxbox: '⧉',\n boxdL: '╕',\n boxdR: '╒',\n boxdl: '┐',\n boxdr: '┌',\n boxh: '─',\n boxhD: '╥',\n boxhU: '╨',\n boxhd: '┬',\n boxhu: '┴',\n boxminus: '⊟',\n boxplus: '⊞',\n boxtimes: '⊠',\n boxuL: '╛',\n boxuR: '╘',\n boxul: '┘',\n boxur: '└',\n boxv: '│',\n boxvH: '╪',\n boxvL: '╡',\n boxvR: '╞',\n boxvh: '┼',\n boxvl: '┤',\n boxvr: '├',\n bprime: '‵',\n breve: '˘',\n brvbar: '¦',\n bscr: '𝒷',\n bsemi: '⁏',\n bsim: '∽',\n bsime: '⋍',\n bsol: '\\\\',\n bsolb: '⧅',\n bsolhsub: '⟈',\n bull: '•',\n bullet: '•',\n bump: '≎',\n bumpE: '⪮',\n bumpe: '≏',\n bumpeq: '≏',\n cacute: 'ć',\n cap: '∩',\n capand: '⩄',\n capbrcup: '⩉',\n capcap: '⩋',\n capcup: '⩇',\n capdot: '⩀',\n caps: '∩︀',\n caret: '⁁',\n caron: 'ˇ',\n ccaps: '⩍',\n ccaron: 'č',\n ccedil: 'ç',\n ccirc: 'ĉ',\n ccups: '⩌',\n ccupssm: '⩐',\n cdot: 'ċ',\n cedil: '¸',\n cemptyv: '⦲',\n cent: '¢',\n centerdot: '·',\n cfr: '𝔠',\n chcy: 'ч',\n check: '✓',\n checkmark: '✓',\n chi: 'χ',\n cir: '○',\n cirE: '⧃',\n circ: 'ˆ',\n circeq: '≗',\n circlearrowleft: '↺',\n circlearrowright: '↻',\n circledR: '®',\n circledS: 'Ⓢ',\n circledast: '⊛',\n circledcirc: '⊚',\n circleddash: '⊝',\n cire: '≗',\n cirfnint: '⨐',\n cirmid: '⫯',\n cirscir: '⧂',\n clubs: '♣',\n clubsuit: '♣',\n colon: ':',\n colone: '≔',\n coloneq: '≔',\n comma: ',',\n commat: '@',\n comp: '∁',\n compfn: '∘',\n complement: '∁',\n complexes: 'ℂ',\n cong: '≅',\n congdot: '⩭',\n conint: '∮',\n copf: '𝕔',\n coprod: '∐',\n copy: '©',\n copysr: '℗',\n crarr: '↵',\n cross: '✗',\n cscr: '𝒸',\n csub: '⫏',\n csube: '⫑',\n csup: '⫐',\n csupe: '⫒',\n ctdot: '⋯',\n cudarrl: '⤸',\n cudarrr: '⤵',\n cuepr: '⋞',\n cuesc: '⋟',\n cularr: '↶',\n cularrp: '⤽',\n cup: '∪',\n cupbrcap: '⩈',\n cupcap: '⩆',\n cupcup: '⩊',\n cupdot: '⊍',\n cupor: '⩅',\n cups: '∪︀',\n curarr: '↷',\n curarrm: '⤼',\n curlyeqprec: '⋞',\n curlyeqsucc: '⋟',\n curlyvee: '⋎',\n curlywedge: '⋏',\n curren: '¤',\n curvearrowleft: '↶',\n curvearrowright: '↷',\n cuvee: '⋎',\n cuwed: '⋏',\n cwconint: '∲',\n cwint: '∱',\n cylcty: '⌭',\n dArr: '⇓',\n dHar: '⥥',\n dagger: '†',\n daleth: 'ℸ',\n darr: '↓',\n dash: '‐',\n dashv: '⊣',\n dbkarow: '⤏',\n dblac: '˝',\n dcaron: 'ď',\n dcy: 'д',\n dd: 'ⅆ',\n ddagger: '‡',\n ddarr: '⇊',\n ddotseq: '⩷',\n deg: '°',\n delta: 'δ',\n demptyv: '⦱',\n dfisht: '⥿',\n dfr: '𝔡',\n dharl: '⇃',\n dharr: '⇂',\n diam: '⋄',\n diamond: '⋄',\n diamondsuit: '♦',\n diams: '♦',\n die: '¨',\n digamma: 'ϝ',\n disin: '⋲',\n div: '÷',\n divide: '÷',\n divideontimes: '⋇',\n divonx: '⋇',\n djcy: 'ђ',\n dlcorn: '⌞',\n dlcrop: '⌍',\n dollar: '$',\n dopf: '𝕕',\n dot: '˙',\n doteq: '≐',\n doteqdot: '≑',\n dotminus: '∸',\n dotplus: '∔',\n dotsquare: '⊡',\n doublebarwedge: '⌆',\n downarrow: '↓',\n downdownarrows: '⇊',\n downharpoonleft: '⇃',\n downharpoonright: '⇂',\n drbkarow: '⤐',\n drcorn: '⌟',\n drcrop: '⌌',\n dscr: '𝒹',\n dscy: 'ѕ',\n dsol: '⧶',\n dstrok: 'đ',\n dtdot: '⋱',\n dtri: '▿',\n dtrif: '▾',\n duarr: '⇵',\n duhar: '⥯',\n dwangle: '⦦',\n dzcy: 'џ',\n dzigrarr: '⟿',\n eDDot: '⩷',\n eDot: '≑',\n eacute: 'é',\n easter: '⩮',\n ecaron: 'ě',\n ecir: '≖',\n ecirc: 'ê',\n ecolon: '≕',\n ecy: 'э',\n edot: 'ė',\n ee: 'ⅇ',\n efDot: '≒',\n efr: '𝔢',\n eg: '⪚',\n egrave: 'è',\n egs: '⪖',\n egsdot: '⪘',\n el: '⪙',\n elinters: '⏧',\n ell: 'ℓ',\n els: '⪕',\n elsdot: '⪗',\n emacr: 'ē',\n empty: '∅',\n emptyset: '∅',\n emptyv: '∅',\n emsp13: ' ',\n emsp14: ' ',\n emsp: ' ',\n eng: 'ŋ',\n ensp: ' ',\n eogon: 'ę',\n eopf: '𝕖',\n epar: '⋕',\n eparsl: '⧣',\n eplus: '⩱',\n epsi: 'ε',\n epsilon: 'ε',\n epsiv: 'ϵ',\n eqcirc: '≖',\n eqcolon: '≕',\n eqsim: '≂',\n eqslantgtr: '⪖',\n eqslantless: '⪕',\n equals: '=',\n equest: '≟',\n equiv: '≡',\n equivDD: '⩸',\n eqvparsl: '⧥',\n erDot: '≓',\n erarr: '⥱',\n escr: 'ℯ',\n esdot: '≐',\n esim: '≂',\n eta: 'η',\n eth: 'ð',\n euml: 'ë',\n euro: '€',\n excl: '!',\n exist: '∃',\n expectation: 'ℰ',\n exponentiale: 'ⅇ',\n fallingdotseq: '≒',\n fcy: 'ф',\n female: '♀',\n ffilig: 'ffi',\n fflig: 'ff',\n ffllig: 'ffl',\n ffr: '𝔣',\n filig: 'fi',\n fjlig: 'fj',\n flat: '♭',\n fllig: 'fl',\n fltns: '▱',\n fnof: 'ƒ',\n fopf: '𝕗',\n forall: '∀',\n fork: '⋔',\n forkv: '⫙',\n fpartint: '⨍',\n frac12: '½',\n frac13: '⅓',\n frac14: '¼',\n frac15: '⅕',\n frac16: '⅙',\n frac18: '⅛',\n frac23: '⅔',\n frac25: '⅖',\n frac34: '¾',\n frac35: '⅗',\n frac38: '⅜',\n frac45: '⅘',\n frac56: '⅚',\n frac58: '⅝',\n frac78: '⅞',\n frasl: '⁄',\n frown: '⌢',\n fscr: '𝒻',\n gE: '≧',\n gEl: '⪌',\n gacute: 'ǵ',\n gamma: 'γ',\n gammad: 'ϝ',\n gap: '⪆',\n gbreve: 'ğ',\n gcirc: 'ĝ',\n gcy: 'г',\n gdot: 'ġ',\n ge: '≥',\n gel: '⋛',\n geq: '≥',\n geqq: '≧',\n geqslant: '⩾',\n ges: '⩾',\n gescc: '⪩',\n gesdot: '⪀',\n gesdoto: '⪂',\n gesdotol: '⪄',\n gesl: '⋛︀',\n gesles: '⪔',\n gfr: '𝔤',\n gg: '≫',\n ggg: '⋙',\n gimel: 'ℷ',\n gjcy: 'ѓ',\n gl: '≷',\n glE: '⪒',\n gla: '⪥',\n glj: '⪤',\n gnE: '≩',\n gnap: '⪊',\n gnapprox: '⪊',\n gne: '⪈',\n gneq: '⪈',\n gneqq: '≩',\n gnsim: '⋧',\n gopf: '𝕘',\n grave: '`',\n gscr: 'ℊ',\n gsim: '≳',\n gsime: '⪎',\n gsiml: '⪐',\n gt: '>',\n gtcc: '⪧',\n gtcir: '⩺',\n gtdot: '⋗',\n gtlPar: '⦕',\n gtquest: '⩼',\n gtrapprox: '⪆',\n gtrarr: '⥸',\n gtrdot: '⋗',\n gtreqless: '⋛',\n gtreqqless: '⪌',\n gtrless: '≷',\n gtrsim: '≳',\n gvertneqq: '≩︀',\n gvnE: '≩︀',\n hArr: '⇔',\n hairsp: ' ',\n half: '½',\n hamilt: 'ℋ',\n hardcy: 'ъ',\n harr: '↔',\n harrcir: '⥈',\n harrw: '↭',\n hbar: 'ℏ',\n hcirc: 'ĥ',\n hearts: '♥',\n heartsuit: '♥',\n hellip: '…',\n hercon: '⊹',\n hfr: '𝔥',\n hksearow: '⤥',\n hkswarow: '⤦',\n hoarr: '⇿',\n homtht: '∻',\n hookleftarrow: '↩',\n hookrightarrow: '↪',\n hopf: '𝕙',\n horbar: '―',\n hscr: '𝒽',\n hslash: 'ℏ',\n hstrok: 'ħ',\n hybull: '⁃',\n hyphen: '‐',\n iacute: 'í',\n ic: '',\n icirc: 'î',\n icy: 'и',\n iecy: 'е',\n iexcl: '¡',\n iff: '⇔',\n ifr: '𝔦',\n igrave: 'ì',\n ii: 'ⅈ',\n iiiint: '⨌',\n iiint: '∭',\n iinfin: '⧜',\n iiota: '℩',\n ijlig: 'ij',\n imacr: 'ī',\n image: 'ℑ',\n imagline: 'ℐ',\n imagpart: 'ℑ',\n imath: 'ı',\n imof: '⊷',\n imped: 'Ƶ',\n in: '∈',\n incare: '℅',\n infin: '∞',\n infintie: '⧝',\n inodot: 'ı',\n int: '∫',\n intcal: '⊺',\n integers: 'ℤ',\n intercal: '⊺',\n intlarhk: '⨗',\n intprod: '⨼',\n iocy: 'ё',\n iogon: 'į',\n iopf: '𝕚',\n iota: 'ι',\n iprod: '⨼',\n iquest: '¿',\n iscr: '𝒾',\n isin: '∈',\n isinE: '⋹',\n isindot: '⋵',\n isins: '⋴',\n isinsv: '⋳',\n isinv: '∈',\n it: '',\n itilde: 'ĩ',\n iukcy: 'і',\n iuml: 'ï',\n jcirc: 'ĵ',\n jcy: 'й',\n jfr: '𝔧',\n jmath: 'ȷ',\n jopf: '𝕛',\n jscr: '𝒿',\n jsercy: 'ј',\n jukcy: 'є',\n kappa: 'κ',\n kappav: 'ϰ',\n kcedil: 'ķ',\n kcy: 'к',\n kfr: '𝔨',\n kgreen: 'ĸ',\n khcy: 'х',\n kjcy: 'ќ',\n kopf: '𝕜',\n kscr: '𝓀',\n lAarr: '⇚',\n lArr: '⇐',\n lAtail: '⤛',\n lBarr: '⤎',\n lE: '≦',\n lEg: '⪋',\n lHar: '⥢',\n lacute: 'ĺ',\n laemptyv: '⦴',\n lagran: 'ℒ',\n lambda: 'λ',\n lang: '⟨',\n langd: '⦑',\n langle: '⟨',\n lap: '⪅',\n laquo: '«',\n larr: '←',\n larrb: '⇤',\n larrbfs: '⤟',\n larrfs: '⤝',\n larrhk: '↩',\n larrlp: '↫',\n larrpl: '⤹',\n larrsim: '⥳',\n larrtl: '↢',\n lat: '⪫',\n latail: '⤙',\n late: '⪭',\n lates: '⪭︀',\n lbarr: '⤌',\n lbbrk: '❲',\n lbrace: '{',\n lbrack: '[',\n lbrke: '⦋',\n lbrksld: '⦏',\n lbrkslu: '⦍',\n lcaron: 'ľ',\n lcedil: 'ļ',\n lceil: '⌈',\n lcub: '{',\n lcy: 'л',\n ldca: '⤶',\n ldquo: '“',\n ldquor: '„',\n ldrdhar: '⥧',\n ldrushar: '⥋',\n ldsh: '↲',\n le: '≤',\n leftarrow: '←',\n leftarrowtail: '↢',\n leftharpoondown: '↽',\n leftharpoonup: '↼',\n leftleftarrows: '⇇',\n leftrightarrow: '↔',\n leftrightarrows: '⇆',\n leftrightharpoons: '⇋',\n leftrightsquigarrow: '↭',\n leftthreetimes: '⋋',\n leg: '⋚',\n leq: '≤',\n leqq: '≦',\n leqslant: '⩽',\n les: '⩽',\n lescc: '⪨',\n lesdot: '⩿',\n lesdoto: '⪁',\n lesdotor: '⪃',\n lesg: '⋚︀',\n lesges: '⪓',\n lessapprox: '⪅',\n lessdot: '⋖',\n lesseqgtr: '⋚',\n lesseqqgtr: '⪋',\n lessgtr: '≶',\n lesssim: '≲',\n lfisht: '⥼',\n lfloor: '⌊',\n lfr: '𝔩',\n lg: '≶',\n lgE: '⪑',\n lhard: '↽',\n lharu: '↼',\n lharul: '⥪',\n lhblk: '▄',\n ljcy: 'љ',\n ll: '≪',\n llarr: '⇇',\n llcorner: '⌞',\n llhard: '⥫',\n lltri: '◺',\n lmidot: 'ŀ',\n lmoust: '⎰',\n lmoustache: '⎰',\n lnE: '≨',\n lnap: '⪉',\n lnapprox: '⪉',\n lne: '⪇',\n lneq: '⪇',\n lneqq: '≨',\n lnsim: '⋦',\n loang: '⟬',\n loarr: '⇽',\n lobrk: '⟦',\n longleftarrow: '⟵',\n longleftrightarrow: '⟷',\n longmapsto: '⟼',\n longrightarrow: '⟶',\n looparrowleft: '↫',\n looparrowright: '↬',\n lopar: '⦅',\n lopf: '𝕝',\n loplus: '⨭',\n lotimes: '⨴',\n lowast: '∗',\n lowbar: '_',\n loz: '◊',\n lozenge: '◊',\n lozf: '⧫',\n lpar: '(',\n lparlt: '⦓',\n lrarr: '⇆',\n lrcorner: '⌟',\n lrhar: '⇋',\n lrhard: '⥭',\n lrm: '',\n lrtri: '⊿',\n lsaquo: '‹',\n lscr: '𝓁',\n lsh: '↰',\n lsim: '≲',\n lsime: '⪍',\n lsimg: '⪏',\n lsqb: '[',\n lsquo: '‘',\n lsquor: '‚',\n lstrok: 'ł',\n lt: '<',\n ltcc: '⪦',\n ltcir: '⩹',\n ltdot: '⋖',\n lthree: '⋋',\n ltimes: '⋉',\n ltlarr: '⥶',\n ltquest: '⩻',\n ltrPar: '⦖',\n ltri: '◃',\n ltrie: '⊴',\n ltrif: '◂',\n lurdshar: '⥊',\n luruhar: '⥦',\n lvertneqq: '≨︀',\n lvnE: '≨︀',\n mDDot: '∺',\n macr: '¯',\n male: '♂',\n malt: '✠',\n maltese: '✠',\n map: '↦',\n mapsto: '↦',\n mapstodown: '↧',\n mapstoleft: '↤',\n mapstoup: '↥',\n marker: '▮',\n mcomma: '⨩',\n mcy: 'м',\n mdash: '—',\n measuredangle: '∡',\n mfr: '𝔪',\n mho: '℧',\n micro: 'µ',\n mid: '∣',\n midast: '*',\n midcir: '⫰',\n middot: '·',\n minus: '−',\n minusb: '⊟',\n minusd: '∸',\n minusdu: '⨪',\n mlcp: '⫛',\n mldr: '…',\n mnplus: '∓',\n models: '⊧',\n mopf: '𝕞',\n mp: '∓',\n mscr: '𝓂',\n mstpos: '∾',\n mu: 'μ',\n multimap: '⊸',\n mumap: '⊸',\n nGg: '⋙̸',\n nGt: '≫⃒',\n nGtv: '≫̸',\n nLeftarrow: '⇍',\n nLeftrightarrow: '⇎',\n nLl: '⋘̸',\n nLt: '≪⃒',\n nLtv: '≪̸',\n nRightarrow: '⇏',\n nVDash: '⊯',\n nVdash: '⊮',\n nabla: '∇',\n nacute: 'ń',\n nang: '∠⃒',\n nap: '≉',\n napE: '⩰̸',\n napid: '≋̸',\n napos: 'ʼn',\n napprox: '≉',\n natur: '♮',\n natural: '♮',\n naturals: 'ℕ',\n nbsp: ' ',\n nbump: '≎̸',\n nbumpe: '≏̸',\n ncap: '⩃',\n ncaron: 'ň',\n ncedil: 'ņ',\n ncong: '≇',\n ncongdot: '⩭̸',\n ncup: '⩂',\n ncy: 'н',\n ndash: '–',\n ne: '≠',\n neArr: '⇗',\n nearhk: '⤤',\n nearr: '↗',\n nearrow: '↗',\n nedot: '≐̸',\n nequiv: '≢',\n nesear: '⤨',\n nesim: '≂̸',\n nexist: '∄',\n nexists: '∄',\n nfr: '𝔫',\n ngE: '≧̸',\n nge: '≱',\n ngeq: '≱',\n ngeqq: '≧̸',\n ngeqslant: '⩾̸',\n nges: '⩾̸',\n ngsim: '≵',\n ngt: '≯',\n ngtr: '≯',\n nhArr: '⇎',\n nharr: '↮',\n nhpar: '⫲',\n ni: '∋',\n nis: '⋼',\n nisd: '⋺',\n niv: '∋',\n njcy: 'њ',\n nlArr: '⇍',\n nlE: '≦̸',\n nlarr: '↚',\n nldr: '‥',\n nle: '≰',\n nleftarrow: '↚',\n nleftrightarrow: '↮',\n nleq: '≰',\n nleqq: '≦̸',\n nleqslant: '⩽̸',\n nles: '⩽̸',\n nless: '≮',\n nlsim: '≴',\n nlt: '≮',\n nltri: '⋪',\n nltrie: '⋬',\n nmid: '∤',\n nopf: '𝕟',\n not: '¬',\n notin: '∉',\n notinE: '⋹̸',\n notindot: '⋵̸',\n notinva: '∉',\n notinvb: '⋷',\n notinvc: '⋶',\n notni: '∌',\n notniva: '∌',\n notnivb: '⋾',\n notnivc: '⋽',\n npar: '∦',\n nparallel: '∦',\n nparsl: '⫽⃥',\n npart: '∂̸',\n npolint: '⨔',\n npr: '⊀',\n nprcue: '⋠',\n npre: '⪯̸',\n nprec: '⊀',\n npreceq: '⪯̸',\n nrArr: '⇏',\n nrarr: '↛',\n nrarrc: '⤳̸',\n nrarrw: '↝̸',\n nrightarrow: '↛',\n nrtri: '⋫',\n nrtrie: '⋭',\n nsc: '⊁',\n nsccue: '⋡',\n nsce: '⪰̸',\n nscr: '𝓃',\n nshortmid: '∤',\n nshortparallel: '∦',\n nsim: '≁',\n nsime: '≄',\n nsimeq: '≄',\n nsmid: '∤',\n nspar: '∦',\n nsqsube: '⋢',\n nsqsupe: '⋣',\n nsub: '⊄',\n nsubE: '⫅̸',\n nsube: '⊈',\n nsubset: '⊂⃒',\n nsubseteq: '⊈',\n nsubseteqq: '⫅̸',\n nsucc: '⊁',\n nsucceq: '⪰̸',\n nsup: '⊅',\n nsupE: '⫆̸',\n nsupe: '⊉',\n nsupset: '⊃⃒',\n nsupseteq: '⊉',\n nsupseteqq: '⫆̸',\n ntgl: '≹',\n ntilde: 'ñ',\n ntlg: '≸',\n ntriangleleft: '⋪',\n ntrianglelefteq: '⋬',\n ntriangleright: '⋫',\n ntrianglerighteq: '⋭',\n nu: 'ν',\n num: '#',\n numero: '№',\n numsp: ' ',\n nvDash: '⊭',\n nvHarr: '⤄',\n nvap: '≍⃒',\n nvdash: '⊬',\n nvge: '≥⃒',\n nvgt: '>⃒',\n nvinfin: '⧞',\n nvlArr: '⤂',\n nvle: '≤⃒',\n nvlt: '<⃒',\n nvltrie: '⊴⃒',\n nvrArr: '⤃',\n nvrtrie: '⊵⃒',\n nvsim: '∼⃒',\n nwArr: '⇖',\n nwarhk: '⤣',\n nwarr: '↖',\n nwarrow: '↖',\n nwnear: '⤧',\n oS: 'Ⓢ',\n oacute: 'ó',\n oast: '⊛',\n ocir: '⊚',\n ocirc: 'ô',\n ocy: 'о',\n odash: '⊝',\n odblac: 'ő',\n odiv: '⨸',\n odot: '⊙',\n odsold: '⦼',\n oelig: 'œ',\n ofcir: '⦿',\n ofr: '𝔬',\n ogon: '˛',\n ograve: 'ò',\n ogt: '⧁',\n ohbar: '⦵',\n ohm: 'Ω',\n oint: '∮',\n olarr: '↺',\n olcir: '⦾',\n olcross: '⦻',\n oline: '‾',\n olt: '⧀',\n omacr: 'ō',\n omega: 'ω',\n omicron: 'ο',\n omid: '⦶',\n ominus: '⊖',\n oopf: '𝕠',\n opar: '⦷',\n operp: '⦹',\n oplus: '⊕',\n or: '∨',\n orarr: '↻',\n ord: '⩝',\n order: 'ℴ',\n orderof: 'ℴ',\n ordf: 'ª',\n ordm: 'º',\n origof: '⊶',\n oror: '⩖',\n orslope: '⩗',\n orv: '⩛',\n oscr: 'ℴ',\n oslash: 'ø',\n osol: '⊘',\n otilde: 'õ',\n otimes: '⊗',\n otimesas: '⨶',\n ouml: 'ö',\n ovbar: '⌽',\n par: '∥',\n para: '¶',\n parallel: '∥',\n parsim: '⫳',\n parsl: '⫽',\n part: '∂',\n pcy: 'п',\n percnt: '%',\n period: '.',\n permil: '‰',\n perp: '⊥',\n pertenk: '‱',\n pfr: '𝔭',\n phi: 'φ',\n phiv: 'ϕ',\n phmmat: 'ℳ',\n phone: '☎',\n pi: 'π',\n pitchfork: '⋔',\n piv: 'ϖ',\n planck: 'ℏ',\n planckh: 'ℎ',\n plankv: 'ℏ',\n plus: '+',\n plusacir: '⨣',\n plusb: '⊞',\n pluscir: '⨢',\n plusdo: '∔',\n plusdu: '⨥',\n pluse: '⩲',\n plusmn: '±',\n plussim: '⨦',\n plustwo: '⨧',\n pm: '±',\n pointint: '⨕',\n popf: '𝕡',\n pound: '£',\n pr: '≺',\n prE: '⪳',\n prap: '⪷',\n prcue: '≼',\n pre: '⪯',\n prec: '≺',\n precapprox: '⪷',\n preccurlyeq: '≼',\n preceq: '⪯',\n precnapprox: '⪹',\n precneqq: '⪵',\n precnsim: '⋨',\n precsim: '≾',\n prime: '′',\n primes: 'ℙ',\n prnE: '⪵',\n prnap: '⪹',\n prnsim: '⋨',\n prod: '∏',\n profalar: '⌮',\n profline: '⌒',\n profsurf: '⌓',\n prop: '∝',\n propto: '∝',\n prsim: '≾',\n prurel: '⊰',\n pscr: '𝓅',\n psi: 'ψ',\n puncsp: ' ',\n qfr: '𝔮',\n qint: '⨌',\n qopf: '𝕢',\n qprime: '⁗',\n qscr: '𝓆',\n quaternions: 'ℍ',\n quatint: '⨖',\n quest: '?',\n questeq: '≟',\n quot: '\"',\n rAarr: '⇛',\n rArr: '⇒',\n rAtail: '⤜',\n rBarr: '⤏',\n rHar: '⥤',\n race: '∽̱',\n racute: 'ŕ',\n radic: '√',\n raemptyv: '⦳',\n rang: '⟩',\n rangd: '⦒',\n range: '⦥',\n rangle: '⟩',\n raquo: '»',\n rarr: '→',\n rarrap: '⥵',\n rarrb: '⇥',\n rarrbfs: '⤠',\n rarrc: '⤳',\n rarrfs: '⤞',\n rarrhk: '↪',\n rarrlp: '↬',\n rarrpl: '⥅',\n rarrsim: '⥴',\n rarrtl: '↣',\n rarrw: '↝',\n ratail: '⤚',\n ratio: '∶',\n rationals: 'ℚ',\n rbarr: '⤍',\n rbbrk: '❳',\n rbrace: '}',\n rbrack: ']',\n rbrke: '⦌',\n rbrksld: '⦎',\n rbrkslu: '⦐',\n rcaron: 'ř',\n rcedil: 'ŗ',\n rceil: '⌉',\n rcub: '}',\n rcy: 'р',\n rdca: '⤷',\n rdldhar: '⥩',\n rdquo: '”',\n rdquor: '”',\n rdsh: '↳',\n real: 'ℜ',\n realine: 'ℛ',\n realpart: 'ℜ',\n reals: 'ℝ',\n rect: '▭',\n reg: '®',\n rfisht: '⥽',\n rfloor: '⌋',\n rfr: '𝔯',\n rhard: '⇁',\n rharu: '⇀',\n rharul: '⥬',\n rho: 'ρ',\n rhov: 'ϱ',\n rightarrow: '→',\n rightarrowtail: '↣',\n rightharpoondown: '⇁',\n rightharpoonup: '⇀',\n rightleftarrows: '⇄',\n rightleftharpoons: '⇌',\n rightrightarrows: '⇉',\n rightsquigarrow: '↝',\n rightthreetimes: '⋌',\n ring: '˚',\n risingdotseq: '≓',\n rlarr: '⇄',\n rlhar: '⇌',\n rlm: '',\n rmoust: '⎱',\n rmoustache: '⎱',\n rnmid: '⫮',\n roang: '⟭',\n roarr: '⇾',\n robrk: '⟧',\n ropar: '⦆',\n ropf: '𝕣',\n roplus: '⨮',\n rotimes: '⨵',\n rpar: ')',\n rpargt: '⦔',\n rppolint: '⨒',\n rrarr: '⇉',\n rsaquo: '›',\n rscr: '𝓇',\n rsh: '↱',\n rsqb: ']',\n rsquo: '’',\n rsquor: '’',\n rthree: '⋌',\n rtimes: '⋊',\n rtri: '▹',\n rtrie: '⊵',\n rtrif: '▸',\n rtriltri: '⧎',\n ruluhar: '⥨',\n rx: '℞',\n sacute: 'ś',\n sbquo: '‚',\n sc: '≻',\n scE: '⪴',\n scap: '⪸',\n scaron: 'š',\n sccue: '≽',\n sce: '⪰',\n scedil: 'ş',\n scirc: 'ŝ',\n scnE: '⪶',\n scnap: '⪺',\n scnsim: '⋩',\n scpolint: '⨓',\n scsim: '≿',\n scy: 'с',\n sdot: '⋅',\n sdotb: '⊡',\n sdote: '⩦',\n seArr: '⇘',\n searhk: '⤥',\n searr: '↘',\n searrow: '↘',\n sect: '§',\n semi: ';',\n seswar: '⤩',\n setminus: '∖',\n setmn: '∖',\n sext: '✶',\n sfr: '𝔰',\n sfrown: '⌢',\n sharp: '♯',\n shchcy: 'щ',\n shcy: 'ш',\n shortmid: '∣',\n shortparallel: '∥',\n shy: '',\n sigma: 'σ',\n sigmaf: 'ς',\n sigmav: 'ς',\n sim: '∼',\n simdot: '⩪',\n sime: '≃',\n simeq: '≃',\n simg: '⪞',\n simgE: '⪠',\n siml: '⪝',\n simlE: '⪟',\n simne: '≆',\n simplus: '⨤',\n simrarr: '⥲',\n slarr: '←',\n smallsetminus: '∖',\n smashp: '⨳',\n smeparsl: '⧤',\n smid: '∣',\n smile: '⌣',\n smt: '⪪',\n smte: '⪬',\n smtes: '⪬︀',\n softcy: 'ь',\n sol: '/',\n solb: '⧄',\n solbar: '⌿',\n sopf: '𝕤',\n spades: '♠',\n spadesuit: '♠',\n spar: '∥',\n sqcap: '⊓',\n sqcaps: '⊓︀',\n sqcup: '⊔',\n sqcups: '⊔︀',\n sqsub: '⊏',\n sqsube: '⊑',\n sqsubset: '⊏',\n sqsubseteq: '⊑',\n sqsup: '⊐',\n sqsupe: '⊒',\n sqsupset: '⊐',\n sqsupseteq: '⊒',\n squ: '□',\n square: '□',\n squarf: '▪',\n squf: '▪',\n srarr: '→',\n sscr: '𝓈',\n ssetmn: '∖',\n ssmile: '⌣',\n sstarf: '⋆',\n star: '☆',\n starf: '★',\n straightepsilon: 'ϵ',\n straightphi: 'ϕ',\n strns: '¯',\n sub: '⊂',\n subE: '⫅',\n subdot: '⪽',\n sube: '⊆',\n subedot: '⫃',\n submult: '⫁',\n subnE: '⫋',\n subne: '⊊',\n subplus: '⪿',\n subrarr: '⥹',\n subset: '⊂',\n subseteq: '⊆',\n subseteqq: '⫅',\n subsetneq: '⊊',\n subsetneqq: '⫋',\n subsim: '⫇',\n subsub: '⫕',\n subsup: '⫓',\n succ: '≻',\n succapprox: '⪸',\n succcurlyeq: '≽',\n succeq: '⪰',\n succnapprox: '⪺',\n succneqq: '⪶',\n succnsim: '⋩',\n succsim: '≿',\n sum: '∑',\n sung: '♪',\n sup1: '¹',\n sup2: '²',\n sup3: '³',\n sup: '⊃',\n supE: '⫆',\n supdot: '⪾',\n supdsub: '⫘',\n supe: '⊇',\n supedot: '⫄',\n suphsol: '⟉',\n suphsub: '⫗',\n suplarr: '⥻',\n supmult: '⫂',\n supnE: '⫌',\n supne: '⊋',\n supplus: '⫀',\n supset: '⊃',\n supseteq: '⊇',\n supseteqq: '⫆',\n supsetneq: '⊋',\n supsetneqq: '⫌',\n supsim: '⫈',\n supsub: '⫔',\n supsup: '⫖',\n swArr: '⇙',\n swarhk: '⤦',\n swarr: '↙',\n swarrow: '↙',\n swnwar: '⤪',\n szlig: 'ß',\n target: '⌖',\n tau: 'τ',\n tbrk: '⎴',\n tcaron: 'ť',\n tcedil: 'ţ',\n tcy: 'т',\n tdot: '⃛',\n telrec: '⌕',\n tfr: '𝔱',\n there4: '∴',\n therefore: '∴',\n theta: 'θ',\n thetasym: 'ϑ',\n thetav: 'ϑ',\n thickapprox: '≈',\n thicksim: '∼',\n thinsp: ' ',\n thkap: '≈',\n thksim: '∼',\n thorn: 'þ',\n tilde: '˜',\n times: '×',\n timesb: '⊠',\n timesbar: '⨱',\n timesd: '⨰',\n tint: '∭',\n toea: '⤨',\n top: '⊤',\n topbot: '⌶',\n topcir: '⫱',\n topf: '𝕥',\n topfork: '⫚',\n tosa: '⤩',\n tprime: '‴',\n trade: '™',\n triangle: '▵',\n triangledown: '▿',\n triangleleft: '◃',\n trianglelefteq: '⊴',\n triangleq: '≜',\n triangleright: '▹',\n trianglerighteq: '⊵',\n tridot: '◬',\n trie: '≜',\n triminus: '⨺',\n triplus: '⨹',\n trisb: '⧍',\n tritime: '⨻',\n trpezium: '⏢',\n tscr: '𝓉',\n tscy: 'ц',\n tshcy: 'ћ',\n tstrok: 'ŧ',\n twixt: '≬',\n twoheadleftarrow: '↞',\n twoheadrightarrow: '↠',\n uArr: '⇑',\n uHar: '⥣',\n uacute: 'ú',\n uarr: '↑',\n ubrcy: 'ў',\n ubreve: 'ŭ',\n ucirc: 'û',\n ucy: 'у',\n udarr: '⇅',\n udblac: 'ű',\n udhar: '⥮',\n ufisht: '⥾',\n ufr: '𝔲',\n ugrave: 'ù',\n uharl: '↿',\n uharr: '↾',\n uhblk: '▀',\n ulcorn: '⌜',\n ulcorner: '⌜',\n ulcrop: '⌏',\n ultri: '◸',\n umacr: 'ū',\n uml: '¨',\n uogon: 'ų',\n uopf: '𝕦',\n uparrow: '↑',\n updownarrow: '↕',\n upharpoonleft: '↿',\n upharpoonright: '↾',\n uplus: '⊎',\n upsi: 'υ',\n upsih: 'ϒ',\n upsilon: 'υ',\n upuparrows: '⇈',\n urcorn: '⌝',\n urcorner: '⌝',\n urcrop: '⌎',\n uring: 'ů',\n urtri: '◹',\n uscr: '𝓊',\n utdot: '⋰',\n utilde: 'ũ',\n utri: '▵',\n utrif: '▴',\n uuarr: '⇈',\n uuml: 'ü',\n uwangle: '⦧',\n vArr: '⇕',\n vBar: '⫨',\n vBarv: '⫩',\n vDash: '⊨',\n vangrt: '⦜',\n varepsilon: 'ϵ',\n varkappa: 'ϰ',\n varnothing: '∅',\n varphi: 'ϕ',\n varpi: 'ϖ',\n varpropto: '∝',\n varr: '↕',\n varrho: 'ϱ',\n varsigma: 'ς',\n varsubsetneq: '⊊︀',\n varsubsetneqq: '⫋︀',\n varsupsetneq: '⊋︀',\n varsupsetneqq: '⫌︀',\n vartheta: 'ϑ',\n vartriangleleft: '⊲',\n vartriangleright: '⊳',\n vcy: 'в',\n vdash: '⊢',\n vee: '∨',\n veebar: '⊻',\n veeeq: '≚',\n vellip: '⋮',\n verbar: '|',\n vert: '|',\n vfr: '𝔳',\n vltri: '⊲',\n vnsub: '⊂⃒',\n vnsup: '⊃⃒',\n vopf: '𝕧',\n vprop: '∝',\n vrtri: '⊳',\n vscr: '𝓋',\n vsubnE: '⫋︀',\n vsubne: '⊊︀',\n vsupnE: '⫌︀',\n vsupne: '⊋︀',\n vzigzag: '⦚',\n wcirc: 'ŵ',\n wedbar: '⩟',\n wedge: '∧',\n wedgeq: '≙',\n weierp: '℘',\n wfr: '𝔴',\n wopf: '𝕨',\n wp: '℘',\n wr: '≀',\n wreath: '≀',\n wscr: '𝓌',\n xcap: '⋂',\n xcirc: '◯',\n xcup: '⋃',\n xdtri: '▽',\n xfr: '𝔵',\n xhArr: '⟺',\n xharr: '⟷',\n xi: 'ξ',\n xlArr: '⟸',\n xlarr: '⟵',\n xmap: '⟼',\n xnis: '⋻',\n xodot: '⨀',\n xopf: '𝕩',\n xoplus: '⨁',\n xotime: '⨂',\n xrArr: '⟹',\n xrarr: '⟶',\n xscr: '𝓍',\n xsqcup: '⨆',\n xuplus: '⨄',\n xutri: '△',\n xvee: '⋁',\n xwedge: '⋀',\n yacute: 'ý',\n yacy: 'я',\n ycirc: 'ŷ',\n ycy: 'ы',\n yen: '¥',\n yfr: '𝔶',\n yicy: 'ї',\n yopf: '𝕪',\n yscr: '𝓎',\n yucy: 'ю',\n yuml: 'ÿ',\n zacute: 'ź',\n zcaron: 'ž',\n zcy: 'з',\n zdot: 'ż',\n zeetrf: 'ℨ',\n zeta: 'ζ',\n zfr: '𝔷',\n zhcy: 'ж',\n zigrarr: '⇝',\n zopf: '𝕫',\n zscr: '𝓏',\n zwj: '',\n zwnj: ''\n}\n","import {characterEntities} from 'character-entities'\n\n// To do: next major: use `Object.hasOwn`.\nconst own = {}.hasOwnProperty\n\n/**\n * Decode a single character reference (without the `&` or `;`).\n * You probably only need this when you’re building parsers yourself that follow\n * different rules compared to HTML.\n * This is optimized to be tiny in browsers.\n *\n * @param {string} value\n * `notin` (named), `#123` (deci), `#x123` (hexa).\n * @returns {string|false}\n * Decoded reference.\n */\nexport function decodeNamedCharacterReference(value) {\n return own.call(characterEntities, value) ? characterEntities[value] : false\n}\n","/**\n * Like `Array#splice`, but smarter for giant arrays.\n *\n * `Array#splice` takes all items to be inserted as individual argument which\n * causes a stack overflow in V8 when trying to insert 100k items for instance.\n *\n * Otherwise, this does not return the removed items, and takes `items` as an\n * array instead of rest parameters.\n *\n * @template {unknown} T\n * Item type.\n * @param {Array<T>} list\n * List to operate on.\n * @param {number} start\n * Index to remove/insert at (can be negative).\n * @param {number} remove\n * Number of items to remove.\n * @param {Array<T>} items\n * Items to inject into `list`.\n * @returns {undefined}\n * Nothing.\n */\nexport function splice(list, start, remove, items) {\n const end = list.length;\n let chunkStart = 0;\n /** @type {Array<unknown>} */\n let parameters;\n\n // Make start between zero and `end` (included).\n if (start < 0) {\n start = -start > end ? 0 : end + start;\n } else {\n start = start > end ? end : start;\n }\n remove = remove > 0 ? remove : 0;\n\n // No need to chunk the items if there’s only a couple (10k) items.\n if (items.length < 10000) {\n parameters = Array.from(items);\n parameters.unshift(start, remove);\n // @ts-expect-error Hush, it’s fine.\n list.splice(...parameters);\n } else {\n // Delete `remove` items starting from `start`\n if (remove) list.splice(start, remove);\n\n // Insert the items in chunks to not cause stack overflows.\n while (chunkStart < items.length) {\n parameters = items.slice(chunkStart, chunkStart + 10000);\n parameters.unshift(start, 0);\n // @ts-expect-error Hush, it’s fine.\n list.splice(...parameters);\n chunkStart += 10000;\n start += 10000;\n }\n }\n}\n\n/**\n * Append `items` (an array) at the end of `list` (another array).\n * When `list` was empty, returns `items` instead.\n *\n * This prevents a potentially expensive operation when `list` is empty,\n * and adds items in batches to prevent V8 from hanging.\n *\n * @template {unknown} T\n * Item type.\n * @param {Array<T>} list\n * List to operate on.\n * @param {Array<T>} items\n * Items to add to `list`.\n * @returns {Array<T>}\n * Either `list` or `items`.\n */\nexport function push(list, items) {\n if (list.length > 0) {\n splice(list, list.length, 0, items);\n return list;\n }\n return items;\n}","/**\n * @import {\n * Extension,\n * Handles,\n * HtmlExtension,\n * NormalizedExtension\n * } from 'micromark-util-types'\n */\n\nimport {splice} from 'micromark-util-chunked'\n\nconst hasOwnProperty = {}.hasOwnProperty\n\n/**\n * Combine multiple syntax extensions into one.\n *\n * @param {ReadonlyArray<Extension>} extensions\n * List of syntax extensions.\n * @returns {NormalizedExtension}\n * A single combined extension.\n */\nexport function combineExtensions(extensions) {\n /** @type {NormalizedExtension} */\n const all = {}\n let index = -1\n\n while (++index < extensions.length) {\n syntaxExtension(all, extensions[index])\n }\n\n return all\n}\n\n/**\n * Merge `extension` into `all`.\n *\n * @param {NormalizedExtension} all\n * Extension to merge into.\n * @param {Extension} extension\n * Extension to merge.\n * @returns {undefined}\n * Nothing.\n */\nfunction syntaxExtension(all, extension) {\n /** @type {keyof Extension} */\n let hook\n\n for (hook in extension) {\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined\n /** @type {Record<string, unknown>} */\n const left = maybe || (all[hook] = {})\n /** @type {Record<string, unknown> | undefined} */\n const right = extension[hook]\n /** @type {string} */\n let code\n\n if (right) {\n for (code in right) {\n if (!hasOwnProperty.call(left, code)) left[code] = []\n const value = right[code]\n constructs(\n // @ts-expect-error Looks like a list.\n left[code],\n Array.isArray(value) ? value : value ? [value] : []\n )\n }\n }\n }\n}\n\n/**\n * Merge `list` into `existing` (both lists of constructs).\n * Mutates `existing`.\n *\n * @param {Array<unknown>} existing\n * List of constructs to merge into.\n * @param {Array<unknown>} list\n * List of constructs to merge.\n * @returns {undefined}\n * Nothing.\n */\nfunction constructs(existing, list) {\n let index = -1\n /** @type {Array<unknown>} */\n const before = []\n\n while (++index < list.length) {\n // @ts-expect-error Looks like an object.\n ;(list[index].add === 'after' ? existing : before).push(list[index])\n }\n\n splice(existing, 0, 0, before)\n}\n\n/**\n * Combine multiple HTML extensions into one.\n *\n * @param {ReadonlyArray<HtmlExtension>} htmlExtensions\n * List of HTML extensions.\n * @returns {HtmlExtension}\n * Single combined HTML extension.\n */\nexport function combineHtmlExtensions(htmlExtensions) {\n /** @type {HtmlExtension} */\n const handlers = {}\n let index = -1\n\n while (++index < htmlExtensions.length) {\n htmlExtension(handlers, htmlExtensions[index])\n }\n\n return handlers\n}\n\n/**\n * Merge `extension` into `all`.\n *\n * @param {HtmlExtension} all\n * Extension to merge into.\n * @param {HtmlExtension} extension\n * Extension to merge.\n * @returns {undefined}\n * Nothing.\n */\nfunction htmlExtension(all, extension) {\n /** @type {keyof HtmlExtension} */\n let hook\n\n for (hook in extension) {\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined\n const left = maybe || (all[hook] = {})\n const right = extension[hook]\n /** @type {keyof Handles} */\n let type\n\n if (right) {\n for (type in right) {\n // @ts-expect-error assume document vs regular handler are managed correctly.\n left[type] = right[type]\n }\n }\n }\n}\n","/**\n * Turn the number (in string form as either hexa- or plain decimal) coming from\n * a numeric character reference into a character.\n *\n * Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes\n * non-characters and control characters safe.\n *\n * @param {string} value\n * Value to decode.\n * @param {number} base\n * Numeric base.\n * @returns {string}\n * Character.\n */\nexport function decodeNumericCharacterReference(value, base) {\n const code = Number.parseInt(value, base);\n if (\n // C0 except for HT, LF, FF, CR, space.\n code < 9 || code === 11 || code > 13 && code < 32 ||\n // Control character (DEL) of C0, and C1 controls.\n code > 126 && code < 160 ||\n // Lone high surrogates and low surrogates.\n code > 55_295 && code < 57_344 ||\n // Noncharacters.\n code > 64_975 && code < 65_008 || /* eslint-disable no-bitwise */\n (code & 65_535) === 65_535 || (code & 65_535) === 65_534 || /* eslint-enable no-bitwise */\n // Out of range\n code > 1_114_111) {\n return \"\\uFFFD\";\n }\n return String.fromCodePoint(code);\n}","/**\n * Normalize an identifier (as found in references, definitions).\n *\n * Collapses markdown whitespace, trim, and then lower- and uppercase.\n *\n * Some characters are considered “uppercase”, such as U+03F4 (`ϴ`), but if their\n * lowercase counterpart (U+03B8 (`θ`)) is uppercased will result in a different\n * uppercase character (U+0398 (`Θ`)).\n * So, to get a canonical form, we perform both lower- and uppercase.\n *\n * Using uppercase last makes sure keys will never interact with default\n * prototypal values (such as `constructor`): nothing in the prototype of\n * `Object` is uppercase.\n *\n * @param {string} value\n * Identifier to normalize.\n * @returns {string}\n * Normalized identifier.\n */\nexport function normalizeIdentifier(value) {\n return value\n // Collapse markdown whitespace.\n .replace(/[\\t\\n\\r ]+/g, \" \")\n // Trim.\n .replace(/^ | $/g, '')\n // Some characters are considered “uppercase”, but if their lowercase\n // counterpart is uppercased will result in a different uppercase\n // character.\n // Hence, to get that form, we perform both lower- and uppercase.\n // Upper case makes sure keys will not interact with default prototypal\n // methods: no method is uppercase.\n .toLowerCase().toUpperCase();\n}","/**\n * @import {Code} from 'micromark-util-types'\n */\n\n/**\n * Check whether the character code represents an ASCII alpha (`a` through `z`,\n * case insensitive).\n *\n * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.\n *\n * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)\n * to U+005A (`Z`).\n *\n * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)\n * to U+007A (`z`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAlpha = regexCheck(/[A-Za-z]/);\n\n/**\n * Check whether the character code represents an ASCII alphanumeric (`a`\n * through `z`, case insensitive, or `0` through `9`).\n *\n * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha\n * (see `asciiAlpha`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAlphanumeric = regexCheck(/[\\dA-Za-z]/);\n\n/**\n * Check whether the character code represents an ASCII atext.\n *\n * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in\n * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),\n * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F\n * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E\n * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE\n * (`{`) to U+007E TILDE (`~`).\n *\n * See:\n * **\\[RFC5322]**:\n * [Internet Message Format](https://tools.ietf.org/html/rfc5322).\n * P. Resnick.\n * IETF.\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAtext = regexCheck(/[#-'*+\\--9=?A-Z^-~]/);\n\n/**\n * Check whether a character code is an ASCII control character.\n *\n * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)\n * to U+001F (US), or U+007F (DEL).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function asciiControl(code) {\n return (\n // Special whitespace codes (which have negative values), C0 and Control\n // character DEL\n code !== null && (code < 32 || code === 127)\n );\n}\n\n/**\n * Check whether the character code represents an ASCII digit (`0` through `9`).\n *\n * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to\n * U+0039 (`9`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiDigit = regexCheck(/\\d/);\n\n/**\n * Check whether the character code represents an ASCII hex digit (`a` through\n * `f`, case insensitive, or `0` through `9`).\n *\n * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex\n * digit, or an ASCII lower hex digit.\n *\n * An **ASCII upper hex digit** is a character in the inclusive range U+0041\n * (`A`) to U+0046 (`F`).\n *\n * An **ASCII lower hex digit** is a character in the inclusive range U+0061\n * (`a`) to U+0066 (`f`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiHexDigit = regexCheck(/[\\dA-Fa-f]/);\n\n/**\n * Check whether the character code represents ASCII punctuation.\n *\n * An **ASCII punctuation** is a character in the inclusive ranges U+0021\n * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT\n * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT\n * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);\n\n/**\n * Check whether a character code is a markdown line ending.\n *\n * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN\n * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).\n *\n * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE\n * RETURN (CR) are replaced by these virtual characters depending on whether\n * they occurred together.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEnding(code) {\n return code !== null && code < -2;\n}\n\n/**\n * Check whether a character code is a markdown line ending (see\n * `markdownLineEnding`) or markdown space (see `markdownSpace`).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEndingOrSpace(code) {\n return code !== null && (code < 0 || code === 32);\n}\n\n/**\n * Check whether a character code is a markdown space.\n *\n * A **markdown space** is the concrete character U+0020 SPACE (SP) and the\n * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).\n *\n * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is\n * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL\n * SPACE (VS) characters, depending on the column at which the tab occurred.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownSpace(code) {\n return code === -2 || code === -1 || code === 32;\n}\n\n// Size note: removing ASCII from the regex and using `asciiPunctuation` here\n// In fact adds to the bundle size.\n/**\n * Check whether the character code represents Unicode punctuation.\n *\n * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,\n * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`\n * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`\n * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII\n * punctuation (see `asciiPunctuation`).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const unicodePunctuation = regexCheck(/\\p{P}|\\p{S}/u);\n\n/**\n * Check whether the character code represents Unicode whitespace.\n *\n * Note that this does handle micromark specific markdown whitespace characters.\n * See `markdownLineEndingOrSpace` to check that.\n *\n * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,\n * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),\n * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\\[UNICODE]**).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const unicodeWhitespace = regexCheck(/\\s/);\n\n/**\n * Create a code check from a regex.\n *\n * @param {RegExp} regex\n * Expression.\n * @returns {(code: Code) => boolean}\n * Check.\n */\nfunction regexCheck(regex) {\n return check;\n\n /**\n * Check whether a code matches the bound regex.\n *\n * @param {Code} code\n * Character code.\n * @returns {boolean}\n * Whether the character code matches the bound regex.\n */\n function check(code) {\n return code !== null && code > -1 && regex.test(String.fromCharCode(code));\n }\n}","/**\n * @import {Effects, State, TokenType} from 'micromark-util-types'\n */\n\nimport { markdownSpace } from 'micromark-util-character';\n\n// To do: implement `spaceOrTabWithOptions` (`connect`, `content`).\n\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * spaces in markdown are often optional, in which case this factory can be\n * used and `ok` will be switched to whether spaces were found or not\n * * one line ending or space can be detected with `markdownSpace(code)` right\n * before using `factorySpace`\n *\n * ###### Examples\n *\n * Where `␉` represents a tab (plus how much it expands) and `␠` represents a\n * single space.\n *\n * ```markdown\n * ␉\n * ␠␠␠␠\n * ␉␠\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {TokenType} type\n * Type of the whole whitespace.\n * @param {number | undefined} [max=Infinity]\n * Max (exclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpace(effects, ok, type, max) {\n const limit = max ? max - 1 : Infinity;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return ok(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size++ < limit) {\n effects.consume(code);\n return prefix;\n }\n effects.exit(type);\n return ok(code);\n }\n}\n\n/**\n * Parse spaces and tabs, with a required minimum and maximum, matching\n * `markdown-rs`’s `space_or_tab_min_max`.\n *\n * Unlike `factorySpace`, this can fail: `nok` is used when fewer than\n * `min` spaces or tabs are found.\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole whitespace.\n * @param {number} min\n * Minimum allowed characters (inclusive).\n * @param {number} max\n * Maximum allowed characters (inclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpaceMinMax(effects, ok, nok, type, min, max) {\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (max > 0 && markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return after(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size < max) {\n effects.consume(code);\n size++;\n return prefix;\n }\n effects.exit(type);\n return after(code);\n }\n\n /** @type {State} */\n function after(code) {\n return size >= min ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * InitialConstruct,\n * Initializer,\n * State,\n * TokenizeContext,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {InitialConstruct} */\nexport const content = {\n tokenize: initializeContent\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Initializer}\n * Content.\n */\nfunction initializeContent(effects) {\n const contentStart = effects.attempt(this.parser.constructs.contentInitial, afterContentStartConstruct, paragraphInitial);\n /** @type {Token} */\n let previous;\n return contentStart;\n\n /** @type {State} */\n function afterContentStartConstruct(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, contentStart, \"linePrefix\");\n }\n\n /** @type {State} */\n function paragraphInitial(code) {\n effects.enter(\"paragraph\");\n return lineStart(code);\n }\n\n /** @type {State} */\n function lineStart(code) {\n const token = effects.enter(\"chunkText\", {\n contentType: \"text\",\n previous\n });\n if (previous) {\n previous.next = token;\n }\n previous = token;\n return data(code);\n }\n\n /** @type {State} */\n function data(code) {\n if (code === null) {\n effects.exit(\"chunkText\");\n effects.exit(\"paragraph\");\n effects.consume(code);\n return;\n }\n if (markdownLineEnding(code)) {\n effects.consume(code);\n effects.exit(\"chunkText\");\n return lineStart;\n }\n\n // Data.\n effects.consume(code);\n return data;\n }\n}","/**\n * @import {Event} from 'micromark-util-types'\n */\n\n/**\n * @typedef {[number, number, Array<Event>]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n *\n * Port of `edit_map.rs` from `markdown-rs`:\n * <https://github.com/wooorm/markdown-rs/blob/1506572f/src/util/edit_map.rs>.\n *\n * Deal with several changes in events, batching them together.\n *\n * Preferably, changes should be kept to a minimum.\n * Sometimes, it’s needed to change the list of events, because parsing can be\n * messy, and it helps to expose a cleaner interface of events to the compiler\n * and other users.\n * It can also help to merge many adjacent similar events.\n * And, in other cases, it’s needed to parse subcontent: pass some events\n * through another tokenizer and inject the result.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n *\n * @returns\n * New instance.\n */\n constructor() {\n /**\n * Changes by index, so `add` does not need to scan `map` (which is\n * quadratic for documents with many edits at different places).\n *\n * @type {Map<number, Change>}\n */\n this.index = new Map();\n\n /**\n * Record of changes.\n *\n * @type {Array<Change>}\n */\n this.map = [];\n }\n\n /**\n * Create an edit: a remove and/or add at a certain place.\n *\n * @param {number} index\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @returns {undefined}\n * Nothing.\n */\n add(index, remove, add) {\n addImplementation(this, index, remove, add, false);\n }\n\n /**\n * Create an edit: but insert `add` before existing additions, instead of\n * after them.\n *\n * @param {number} index\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @returns {undefined}\n * Nothing.\n */\n addBefore(index, remove, add) {\n addImplementation(this, index, remove, add, true);\n }\n\n /**\n * Done, change the events.\n *\n * @param {Array<Event>} events\n * List of events to apply the edits to.\n * @returns {undefined}\n * Nothing.\n */\n consume(events) {\n this.map.sort(function (a, b) {\n return a[0] - b[0];\n });\n if (this.map.length === 0) {\n return;\n }\n\n // To do: if links are added in events, like they are in `markdown-rs`,\n // this is needed.\n // // Calculate jumps: where items in the current list move to.\n // /** @type {Array<Jump>} */\n // const jumps = []\n // let index = 0\n // let addAcc = 0\n // let removeAcc = 0\n // while (index < this.map.length) {\n // const [at, remove, add] = this.map[index]\n // removeAcc += remove\n // addAcc += add.length\n // jumps.push([at, removeAcc, addAcc])\n // index += 1\n // }\n //\n // shiftLinks(events, jumps)\n\n let index = this.map.length;\n /** @type {Array<Array<Event>>} */\n const vecs = [];\n while (index > 0) {\n index -= 1;\n vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);\n\n // Truncate rest.\n events.length = this.map[index][0];\n }\n vecs.push(events.slice());\n events.length = 0;\n let slice = vecs.pop();\n while (slice) {\n for (const element of slice) {\n events.push(element);\n }\n slice = vecs.pop();\n }\n\n // Truncate everything.\n this.map.length = 0;\n this.index.clear();\n }\n}\n\n/**\n * Create an edit.\n *\n * @param {EditMap} editMap\n * Edit map to apply to.\n * @param {number} at\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @param {boolean} before\n * Insert `add` before existing additions at `at`, instead of after them.\n * @returns {undefined}\n * Nothing.\n */\nfunction addImplementation(editMap, at, remove, add, before) {\n if (remove === 0 && add.length === 0) {\n return;\n }\n const existing = editMap.index.get(at);\n if (existing) {\n existing[1] += remove;\n if (before) {\n add.push(...existing[2]);\n existing[2] = add;\n } else {\n existing[2].push(...add);\n }\n return;\n }\n\n /** @type {Change} */\n const change = [at, remove, add];\n editMap.map.push(change);\n editMap.index.set(at, change);\n}\n\n// /**\n// * Shift `previous` and `next` links according to `jumps`.\n// *\n// * This fixes links in case there are events removed or added between them.\n// *\n// * @param {Array<Event>} events\n// * @param {Array<Jump>} jumps\n// */\n// function shiftLinks(events, jumps) {\n// let jumpIndex = 0\n// let index = 0\n// let add = 0\n// let rm = 0\n\n// while (index < events.length) {\n// const rmCurr = rm\n\n// while (jumpIndex < jumps.length && jumps[jumpIndex][0] <= index) {\n// add = jumps[jumpIndex][2]\n// rm = jumps[jumpIndex][1]\n// jumpIndex += 1\n// }\n\n// // Ignore items that will be removed.\n// if (rm > rmCurr) {\n// index += rm - rmCurr\n// } else {\n// // ?\n// // if let Some(link) = &events[index].link {\n// // if let Some(next) = link.next {\n// // events[next].link.as_mut().unwrap().previous = Some(index + add - rm);\n// // while jumpIndex < jumps.len() && jumps[jumpIndex].0 <= next {\n// // add = jumps[jumpIndex].2;\n// // rm = jumps[jumpIndex].1;\n// // jumpIndex += 1;\n// // }\n// // events[index].link.as_mut().unwrap().next = Some(next + add - rm);\n// // index = next;\n// // continue;\n// // }\n// // }\n// index += 1\n// }\n// }\n// }","/**\n * @import {\n * Construct,\n * ContainerState,\n * InitialConstruct,\n * Initializer,\n * Point,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\n/**\n * @typedef {[Construct, ContainerState]} StackItem\n * Construct and its state.\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { EditMap } from 'micromark-util-edit-map';\n/** @type {InitialConstruct} */\nexport const document = {\n tokenize: initializeDocument\n};\n\n/** @type {Construct} */\nconst containerConstruct = {\n tokenize: tokenizeContainer\n};\n\n/**\n * @this {TokenizeContext}\n * Self.\n * @type {Initializer}\n * Initializer.\n */\nfunction initializeDocument(effects) {\n const self = this;\n /** @type {Array<StackItem>} */\n const stack = [];\n let continued = 0;\n /** @type {TokenizeContext | undefined} */\n let childFlow;\n /** @type {Token | undefined} */\n let childToken;\n /** @type {number} */\n let lineStartOffset;\n return start;\n\n /** @type {State} */\n function start(code) {\n // First we iterate through the open blocks, starting with the root\n // document, and descending through last children down to the last open\n // block.\n // Each block imposes a condition that the line must satisfy if the block is\n // to remain open.\n // For example, a block quote requires a `>` character.\n // A paragraph requires a non-blank line.\n // In this phase we may match all or just some of the open blocks.\n // But we cannot close unmatched blocks yet, because we may have a lazy\n // continuation line.\n if (continued < stack.length) {\n const item = stack[continued];\n self.containerState = item[1];\n return effects.attempt(item[0].continuation, documentContinue, checkNewContainers)(code);\n }\n\n // Done.\n return checkNewContainers(code);\n }\n\n /** @type {State} */\n function documentContinue(code) {\n continued++;\n\n // Note: this field is called `_closeFlow` but it also closes containers.\n // Perhaps a good idea to rename it but it’s already used in the wild by\n // extensions.\n if (self.containerState._closeFlow) {\n self.containerState._closeFlow = undefined;\n if (childFlow) {\n closeFlow();\n }\n\n // Note: this algorithm for moving events around is similar to the\n // algorithm when dealing with lazy lines in `writeToChild`.\n const indexBeforeExits = self.events.length;\n let indexBeforeFlow = indexBeforeExits;\n /** @type {Point | undefined} */\n let point;\n\n // Find the flow chunk.\n while (indexBeforeFlow--) {\n if (self.events[indexBeforeFlow][0] === 'exit' && self.events[indexBeforeFlow][1].type === \"chunkFlow\") {\n point = self.events[indexBeforeFlow][1].end;\n break;\n }\n }\n exitContainers(continued);\n\n // Fix positions.\n let index = indexBeforeExits;\n while (index < self.events.length) {\n self.events[index][1].end = {\n ...point\n };\n index++;\n }\n const editMap = new EditMap();\n // Inject the exits earlier (they’re still also at the end).\n editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));\n // Discard the duplicate exits.\n editMap.add(indexBeforeExits, index - indexBeforeExits, []);\n editMap.consume(self.events);\n return checkNewContainers(code);\n }\n return start(code);\n }\n\n /** @type {State} */\n function checkNewContainers(code) {\n // Next, after consuming the continuation markers for existing blocks, we\n // look for new block starts (e.g. `>` for a block quote).\n // If we encounter a new block start, we close any blocks unmatched in\n // step 1 before creating the new block as a child of the last matched\n // block.\n if (continued === stack.length) {\n // No need to `check` whether there’s a container, of `exitContainers`\n // would be moot.\n // We can instead immediately `attempt` to parse one.\n if (!childFlow) {\n return documentContinued(code);\n }\n\n // If we have concrete content, such as block HTML or fenced code,\n // we can’t have containers “pierce” into them, so we can immediately\n // start.\n if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {\n return flowStart(code);\n }\n\n // If we do have flow, it could still be a blank line,\n // but we’d be interrupting it w/ a new container if there’s a current\n // construct.\n // To do: next major: remove `_gfmTableDynamicInterruptHack` (no longer\n // needed in micromark-extension-gfm-table@1.0.6).\n self.interrupt = Boolean(childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack);\n }\n\n // Check if there is a new container.\n self.containerState = {};\n return effects.check(containerConstruct, thereIsANewContainer, thereIsNoNewContainer)(code);\n }\n\n /** @type {State} */\n function thereIsANewContainer(code) {\n if (childFlow) {\n closeFlow();\n }\n exitContainers(continued);\n return documentContinued(code);\n }\n\n /** @type {State} */\n function thereIsNoNewContainer(code) {\n self.parser.lazy[self.now().line] = continued !== stack.length;\n lineStartOffset = self.now().offset;\n return flowStart(code);\n }\n\n /** @type {State} */\n function documentContinued(code) {\n // Try new containers.\n self.containerState = {};\n return effects.attempt(containerConstruct, containerContinue, flowStart)(code);\n }\n\n /** @type {State} */\n function containerContinue(code) {\n continued++;\n stack.push([self.currentConstruct, self.containerState]);\n // Try another.\n return documentContinued(code);\n }\n\n /** @type {State} */\n function flowStart(code) {\n if (code === null) {\n if (childFlow) {\n closeFlow();\n }\n exitContainers(0);\n effects.consume(code);\n return;\n }\n childFlow = childFlow || self.parser.flow(self.now());\n effects.enter(\"chunkFlow\", {\n _tokenizer: childFlow,\n contentType: \"flow\",\n previous: childToken\n });\n return flowContinue(code);\n }\n\n /** @type {State} */\n function flowContinue(code) {\n if (code === null) {\n writeToChild(effects.exit(\"chunkFlow\"), true);\n exitContainers(0);\n effects.consume(code);\n return;\n }\n if (markdownLineEnding(code)) {\n effects.consume(code);\n writeToChild(effects.exit(\"chunkFlow\"));\n // Get ready for the next line.\n continued = 0;\n self.interrupt = undefined;\n return start;\n }\n effects.consume(code);\n return flowContinue;\n }\n\n /**\n * @param {Token} token\n * Token.\n * @param {boolean | undefined} [endOfFile]\n * Whether the token is at the end of the file (default: `false`).\n * @returns {undefined}\n * Nothing.\n */\n function writeToChild(token, endOfFile) {\n const stream = self.sliceStream(token);\n if (endOfFile) {\n stream.push(null);\n }\n token.previous = childToken;\n if (childToken) {\n childToken.next = token;\n }\n childToken = token;\n childFlow.defineSkip(token.start);\n childFlow.write(stream);\n\n // Alright, so we just added a lazy line:\n //\n // ```markdown\n // > a\n // b.\n //\n // Or:\n //\n // > ~~~c\n // d\n //\n // Or:\n //\n // > | e |\n // f\n // ```\n //\n // The construct in the second example (fenced code) does not accept lazy\n // lines, so it marked itself as done at the end of its first line, and\n // then the content construct parses `d`.\n // Most constructs in markdown match on the first line: if the first line\n // forms a construct, a non-lazy line can’t “unmake” it.\n //\n // The construct in the third example is potentially a GFM table, and\n // those are *weird*.\n // It *could* be a table, from the first line, if the following line\n // matches a condition.\n // In this case, that second line is lazy, which “unmakes” the first line\n // and turns the whole into one content block.\n //\n // We’ve now parsed the non-lazy and the lazy line, and can figure out\n // whether the lazy line started a new flow block.\n // If it did, we exit the current containers between the two flow blocks.\n if (self.parser.lazy[token.start.line]) {\n let index = childFlow.events.length;\n while (index--) {\n if (\n // The token starts before the line ending…\n childFlow.events[index][1].start.offset < lineStartOffset && (\n // …and either is not ended yet…\n !childFlow.events[index][1].end ||\n // …or ends after it.\n childFlow.events[index][1].end.offset > lineStartOffset)) {\n // Exit: there’s still something open, which means it’s a lazy line\n // part of something.\n return;\n }\n }\n\n // Note: this algorithm for moving events around is similar to the\n // algorithm when closing flow in `documentContinue`.\n const indexBeforeExits = self.events.length;\n let indexBeforeFlow = indexBeforeExits;\n /** @type {boolean | undefined} */\n let seen;\n /** @type {Point | undefined} */\n let point;\n\n // Find the previous chunk (the one before the lazy line).\n while (indexBeforeFlow--) {\n if (self.events[indexBeforeFlow][0] === 'exit' && self.events[indexBeforeFlow][1].type === \"chunkFlow\") {\n if (seen) {\n point = self.events[indexBeforeFlow][1].end;\n break;\n }\n seen = true;\n }\n }\n exitContainers(continued);\n\n // Fix positions.\n index = indexBeforeExits;\n while (index < self.events.length) {\n self.events[index][1].end = {\n ...point\n };\n index++;\n }\n const editMap = new EditMap();\n // Inject the exits earlier (they’re still also at the end).\n editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));\n // Discard the duplicate exits.\n editMap.add(indexBeforeExits, index - indexBeforeExits, []);\n editMap.consume(self.events);\n }\n }\n\n /**\n * @param {number} size\n * Size.\n * @returns {undefined}\n * Nothing.\n */\n function exitContainers(size) {\n let index = stack.length;\n\n // Exit open containers.\n while (index-- > size) {\n const entry = stack[index];\n self.containerState = entry[1];\n entry[0].exit.call(self, effects);\n }\n stack.length = size;\n }\n function closeFlow() {\n childFlow.write([null]);\n childToken = undefined;\n childFlow = undefined;\n self.containerState._closeFlow = undefined;\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n * Tokenizer.\n */\nfunction tokenizeContainer(effects, ok, nok) {\n // Always populated by defaults.\n\n return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok, nok), \"linePrefix\", this.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4);\n}","/**\n * @import {Code} from 'micromark-util-types'\n */\n\nimport { markdownLineEndingOrSpace, unicodePunctuation, unicodeWhitespace } from 'micromark-util-character';\n/**\n * Classify whether a code represents whitespace, punctuation, or something\n * else.\n *\n * Used for attention (emphasis, strong), whose sequences can open or close\n * based on the class of surrounding characters.\n *\n * > 👉 **Note**: eof (`null`) is seen as whitespace.\n *\n * @param {Code} code\n * Code.\n * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}\n * Group.\n */\nexport function classifyCharacter(code) {\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return 1;\n }\n if (unicodePunctuation(code)) {\n return 2;\n }\n}","/**\n * @import {Event, Resolver, TokenizeContext} from 'micromark-util-types'\n */\n\n/**\n * Call all `resolveAll`s.\n *\n * @param {ReadonlyArray<{resolveAll?: Resolver | undefined}>} constructs\n * List of constructs, optionally with `resolveAll`s.\n * @param {Array<Event>} events\n * List of events.\n * @param {TokenizeContext} context\n * Context used by `tokenize`.\n * @returns {Array<Event>}\n * Changed events.\n */\nexport function resolveAll(constructs, events, context) {\n /** @type {Array<Resolver>} */\n const called = []\n let index = -1\n\n while (++index < constructs.length) {\n const resolve = constructs[index].resolveAll\n\n if (resolve && !called.includes(resolve)) {\n events = resolve(events, context)\n called.push(resolve)\n }\n }\n\n return events\n}\n","/**\n * @import {\n * Code,\n * Construct,\n * Event,\n * Point,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { push, splice } from 'micromark-util-chunked';\nimport { classifyCharacter } from 'micromark-util-classify-character';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const attention = {\n name: 'attention',\n resolveAll: resolveAllAttention,\n tokenize: tokenizeAttention\n};\n\n/**\n * Take all events and resolve attention to emphasis or strong.\n *\n * @type {Resolver}\n */\n// eslint-disable-next-line complexity\nfunction resolveAllAttention(events, context) {\n let index = -1;\n /** @type {Array<Event>} */\n let nextEvents;\n\n // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n while (++index < events.length) {\n // Find a token that can close.\n if (events[index][0] === 'enter' && events[index][1].type === 'attentionSequence' && events[index][1]._close) {\n let open = index;\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (events[open][0] === 'exit' && events[open][1].type === 'attentionSequence' && events[open][1]._open &&\n // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0)) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if ((events[open][1]._close || events[index][1]._open) && (events[index][1].end.offset - events[index][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index][1].end.offset - events[index][1].start.offset) % 3)) {\n continue;\n }\n\n // Number of markers to use from the sequence.\n const use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;\n const start = {\n ...events[open][1].end\n };\n const end = {\n ...events[index][1].start\n };\n movePoint(start, -use);\n movePoint(end, use);\n const openingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start,\n end: {\n ...events[open][1].end\n }\n };\n const closingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start: {\n ...events[index][1].start\n },\n end\n };\n const text = {\n type: use > 1 ? \"strongText\" : \"emphasisText\",\n start: {\n ...events[open][1].end\n },\n end: {\n ...events[index][1].start\n }\n };\n const group = {\n type: use > 1 ? \"strong\" : \"emphasis\",\n start: {\n ...openingSequence.start\n },\n end: {\n ...closingSequence.end\n }\n };\n events[open][1].end = {\n ...openingSequence.start\n };\n events[index][1].start = {\n ...closingSequence.end\n };\n nextEvents = [];\n\n // If there are more markers in the opening, add them before.\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [['enter', events[open][1], context], ['exit', events[open][1], context]]);\n }\n\n // Opening.\n nextEvents = push(nextEvents, [['enter', group, context], ['enter', openingSequence, context], ['exit', openingSequence, context], ['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n nextEvents = push(nextEvents, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + 1, index), context));\n\n // Closing.\n nextEvents = push(nextEvents, [['exit', text, context], ['enter', closingSequence, context], ['exit', closingSequence, context], ['exit', group, context]]);\n\n /** @type {number} */\n let offset = 0;\n\n // If there are more markers in the closing, add them after.\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2;\n nextEvents = push(nextEvents, [['enter', events[index][1], context], ['exit', events[index][1], context]]);\n }\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - offset - 2;\n break;\n }\n }\n }\n }\n\n // Remove remaining sequences.\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data';\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeAttention(effects, ok) {\n const attentionMarkers = this.parser.constructs.attentionMarkers.null;\n const previous = this.previous;\n const before = classifyCharacter(previous);\n\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Before a sequence.\n *\n * ```markdown\n * > | **\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n marker = code;\n effects.enter('attentionSequence');\n return inside(code);\n }\n\n /**\n * In a sequence.\n *\n * ```markdown\n * > | **\n * ^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n const token = effects.exit('attentionSequence');\n\n // To do: next major: move this to resolver, just like `markdown-rs`.\n const after = classifyCharacter(code);\n\n // Always populated by defaults.\n\n // Note: `*` and `_` are in `attentionMarkers` through core.\n // They are excluded here as the loosening is meant for markers registered\n // by *other* constructs (such as GFM strikethrough’s `~`).\n const open = !after || after === 2 && before || attentionMarkers.includes(code) && code !== 42 && code !== 95;\n const close = !before || before === 2 && after || attentionMarkers.includes(previous) && previous !== 42 && previous !== 95;\n token._open = Boolean(marker === 42 ? open : open && (before || !close));\n token._close = Boolean(marker === 42 ? close : close && (after || !open));\n return ok(code);\n }\n}\n\n/**\n * Move a point a bit.\n *\n * Note: `move` only works inside lines! It’s not possible to move past other\n * chunks (replacement characters, tabs, or line endings).\n *\n * @param {Point} point\n * Point.\n * @param {number} offset\n * Amount to move.\n * @returns {undefined}\n * Nothing.\n */\nfunction movePoint(point, offset) {\n point.column += offset;\n point.offset += offset;\n point._bufferIndex += offset;\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { asciiAlphanumeric, asciiAlpha, asciiAtext, asciiControl } from 'micromark-util-character';\n/** @type {Construct} */\nexport const autolink = {\n name: 'autolink',\n tokenize: tokenizeAutolink\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeAutolink(effects, ok, nok) {\n let size = 0;\n return start;\n\n /**\n * Start of an autolink.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"autolink\");\n effects.enter(\"autolinkMarker\");\n effects.consume(code);\n effects.exit(\"autolinkMarker\");\n effects.enter(\"autolinkProtocol\");\n return open;\n }\n\n /**\n * After `<`, at protocol or atext.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (asciiAlpha(code)) {\n effects.consume(code);\n return schemeOrEmailAtext;\n }\n if (code === 64) {\n return nok(code);\n }\n return emailAtext(code);\n }\n\n /**\n * At second byte of protocol or atext.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeOrEmailAtext(code) {\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) {\n // Count the previous alphabetical from `open` too.\n size = 1;\n return schemeInsideOrEmailAtext(code);\n }\n return emailAtext(code);\n }\n\n /**\n * In ambiguous protocol or atext.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeInsideOrEmailAtext(code) {\n if (code === 58) {\n effects.consume(code);\n size = 0;\n return urlInside;\n }\n\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if ((code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) && size++ < 32) {\n effects.consume(code);\n return schemeInsideOrEmailAtext;\n }\n size = 0;\n return emailAtext(code);\n }\n\n /**\n * After protocol, in URL.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function urlInside(code) {\n if (code === 62) {\n effects.exit(\"autolinkProtocol\");\n effects.enter(\"autolinkMarker\");\n effects.consume(code);\n effects.exit(\"autolinkMarker\");\n effects.exit(\"autolink\");\n return ok;\n }\n\n // ASCII control, space, or `<`.\n if (code === null || code === 32 || code === 60 || asciiControl(code)) {\n return nok(code);\n }\n effects.consume(code);\n return urlInside;\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | a<user.name@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailAtext(code) {\n if (code === 64) {\n effects.consume(code);\n return emailAtSignOrDot;\n }\n if (asciiAtext(code)) {\n effects.consume(code);\n return emailAtext;\n }\n return nok(code);\n }\n\n /**\n * In label, after at-sign or dot.\n *\n * ```markdown\n * > | a<user.name@example.com>b\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function emailAtSignOrDot(code) {\n return asciiAlphanumeric(code) ? emailLabel(code) : nok(code);\n }\n\n /**\n * In label, where `.` and `>` are allowed.\n *\n * ```markdown\n * > | a<user.name@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailLabel(code) {\n if (code === 46) {\n effects.consume(code);\n size = 0;\n return emailAtSignOrDot;\n }\n if (code === 62) {\n // Exit, then change the token type.\n effects.exit(\"autolinkProtocol\").type = \"autolinkEmail\";\n effects.enter(\"autolinkMarker\");\n effects.consume(code);\n effects.exit(\"autolinkMarker\");\n effects.exit(\"autolink\");\n return ok;\n }\n return emailValue(code);\n }\n\n /**\n * In label, where `.` and `>` are *not* allowed.\n *\n * Though, this is also used in `emailLabel` to parse other values.\n *\n * ```markdown\n * > | a<user.name@ex-ample.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailValue(code) {\n // ASCII alphanumeric or `-`.\n if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) {\n const next = code === 45 ? emailValue : emailLabel;\n effects.consume(code);\n return next;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const blankLine = {\n partial: true,\n tokenize: tokenizeBlankLine\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLine(effects, ok, nok) {\n return start;\n\n /**\n * Start of blank line.\n *\n * > 👉 **Note**: `␠` represents a space character.\n *\n * ```markdown\n * > | ␠␠␊\n * ^\n * > | ␊\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n return markdownSpace(code) ? factorySpace(effects, after, \"linePrefix\")(code) : after(code);\n }\n\n /**\n * At eof/eol, after optional whitespace.\n *\n * > 👉 **Note**: `␠` represents a space character.\n *\n * ```markdown\n * > | ␠␠␊\n * ^\n * > | ␊\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * Exiter,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const blockQuote = {\n continuation: {\n tokenize: tokenizeBlockQuoteContinuation\n },\n exit,\n name: 'blockQuote',\n tokenize: tokenizeBlockQuoteStart\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlockQuoteStart(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * Start of block quote.\n *\n * ```markdown\n * > | > a\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 62) {\n const state = self.containerState;\n if (!state.open) {\n effects.enter(\"blockQuote\", {\n _container: true\n });\n state.open = true;\n }\n effects.enter(\"blockQuotePrefix\");\n effects.enter(\"blockQuoteMarker\");\n effects.consume(code);\n effects.exit(\"blockQuoteMarker\");\n return after;\n }\n return nok(code);\n }\n\n /**\n * After `>`, before optional whitespace.\n *\n * ```markdown\n * > | > a\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (markdownSpace(code)) {\n effects.enter(\"blockQuotePrefixWhitespace\");\n effects.consume(code);\n effects.exit(\"blockQuotePrefixWhitespace\");\n effects.exit(\"blockQuotePrefix\");\n return ok;\n }\n effects.exit(\"blockQuotePrefix\");\n return ok(code);\n }\n}\n\n/**\n * Start of block quote continuation.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlockQuoteContinuation(effects, ok, nok) {\n const self = this;\n return contStart;\n\n /**\n * Start of block quote continuation.\n *\n * Also used to parse the first block quote opening.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @type {State}\n */\n function contStart(code) {\n if (markdownSpace(code)) {\n // Always populated by defaults.\n\n return factorySpace(effects, contBefore, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n return contBefore(code);\n }\n\n /**\n * At `>`, after optional whitespace.\n *\n * Also used to parse the first block quote opening.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @type {State}\n */\n function contBefore(code) {\n return effects.attempt(blockQuote, ok, nok)(code);\n }\n}\n\n/** @type {Exiter} */\nfunction exit(effects) {\n effects.exit(\"blockQuote\");\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { asciiPunctuation } from 'micromark-util-character';\n/** @type {Construct} */\nexport const characterEscape = {\n name: 'characterEscape',\n tokenize: tokenizeCharacterEscape\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterEscape(effects, ok, nok) {\n return start;\n\n /**\n * Start of character escape.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"characterEscape\");\n effects.enter(\"escapeMarker\");\n effects.consume(code);\n effects.exit(\"escapeMarker\");\n return inside;\n }\n\n /**\n * After `\\`, at punctuation.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // ASCII punctuation.\n if (asciiPunctuation(code)) {\n effects.enter(\"characterEscapeValue\");\n effects.consume(code);\n effects.exit(\"characterEscapeValue\");\n effects.exit(\"characterEscape\");\n return ok;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { asciiAlphanumeric, asciiDigit, asciiHexDigit } from 'micromark-util-character';\n/** @type {Construct} */\nexport const characterReference = {\n name: 'characterReference',\n tokenize: tokenizeCharacterReference\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterReference(effects, ok, nok) {\n const self = this;\n let size = 0;\n /** @type {number} */\n let max;\n /** @type {(code: Code) => boolean} */\n let test;\n return start;\n\n /**\n * Start of character reference.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a	b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"characterReference\");\n effects.enter(\"characterReferenceMarker\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarker\");\n return open;\n }\n\n /**\n * After `&`, at `#` for numeric references or alphanumeric for named\n * references.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a	b\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 35) {\n effects.enter(\"characterReferenceMarkerNumeric\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarkerNumeric\");\n return numeric;\n }\n effects.enter(\"characterReferenceValue\");\n max = 31;\n test = asciiAlphanumeric;\n return value(code);\n }\n\n /**\n * After `#`, at `x` for hexadecimals or digit for decimals.\n *\n * ```markdown\n * > | a{b\n * ^\n * > | a	b\n * ^\n * ```\n *\n * @type {State}\n */\n function numeric(code) {\n if (code === 88 || code === 120) {\n effects.enter(\"characterReferenceMarkerHexadecimal\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarkerHexadecimal\");\n effects.enter(\"characterReferenceValue\");\n max = 6;\n test = asciiHexDigit;\n return value;\n }\n effects.enter(\"characterReferenceValue\");\n max = 7;\n test = asciiDigit;\n return value(code);\n }\n\n /**\n * After markers (`&#x`, `&#`, or `&`), in value, before `;`.\n *\n * The character reference kind defines what and how many characters are\n * allowed.\n *\n * ```markdown\n * > | a&b\n * ^^^\n * > | a{b\n * ^^^\n * > | a	b\n * ^\n * ```\n *\n * @type {State}\n */\n function value(code) {\n if (code === 59 && size) {\n const token = effects.exit(\"characterReferenceValue\");\n if (test === asciiAlphanumeric && !decodeNamedCharacterReference(self.sliceSerialize(token))) {\n return nok(code);\n }\n\n // To do: `markdown-rs` uses a different name:\n // `CharacterReferenceMarkerSemi`.\n effects.enter(\"characterReferenceMarker\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarker\");\n effects.exit(\"characterReference\");\n return ok;\n }\n if (test(code) && size++ < max) {\n effects.consume(code);\n return value;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const nonLazyContinuation = {\n partial: true,\n tokenize: tokenizeNonLazyContinuation\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuation(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * At eol, before continuation.\n *\n * ```markdown\n * > | * ```js\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === null) {\n return nok(code);\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return after;\n }\n\n /**\n * A continuation.\n *\n * ```markdown\n * | * ```js\n * > | b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { nonLazyContinuation } from './partial-non-lazy-continuation.js';\n\n/** @type {Construct} */\nexport const codeFenced = {\n concrete: true,\n name: 'codeFenced',\n tokenize: tokenizeCodeFenced\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeFenced(effects, ok, nok) {\n const self = this;\n /** @type {Construct} */\n const closeStart = {\n partial: true,\n tokenize: tokenizeCloseStart\n };\n let initialPrefix = 0;\n let sizeOpen = 0;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of code.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse whitespace like `markdown-rs`.\n return beforeSequenceOpen(code);\n }\n\n /**\n * In opening fence, after prefix, at sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeSequenceOpen(code) {\n const tail = self.events[self.events.length - 1];\n initialPrefix = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n marker = code;\n effects.enter(\"codeFenced\");\n effects.enter(\"codeFencedFence\");\n effects.enter(\"codeFencedFenceSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening fence sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === marker) {\n sizeOpen++;\n effects.consume(code);\n return sequenceOpen;\n }\n if (sizeOpen < 3) {\n return nok(code);\n }\n effects.exit(\"codeFencedFenceSequence\");\n return markdownSpace(code) ? factorySpace(effects, infoBefore, \"whitespace\")(code) : infoBefore(code);\n }\n\n /**\n * In opening fence, after the sequence (and optional whitespace), before info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function infoBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFencedFence\");\n return self.interrupt ? ok(code) : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code);\n }\n effects.enter(\"codeFencedFenceInfo\");\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return info(code);\n }\n\n /**\n * In info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function info(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceInfo\");\n return infoBefore(code);\n }\n if (markdownSpace(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceInfo\");\n return factorySpace(effects, metaBefore, \"whitespace\")(code);\n }\n if (code === 96 && code === marker) {\n return nok(code);\n }\n effects.consume(code);\n return info;\n }\n\n /**\n * In opening fence, after info and whitespace, before meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function metaBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return infoBefore(code);\n }\n effects.enter(\"codeFencedFenceMeta\");\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return meta(code);\n }\n\n /**\n * In meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceMeta\");\n return infoBefore(code);\n }\n if (code === 96 && code === marker) {\n return nok(code);\n }\n effects.consume(code);\n return meta;\n }\n\n /**\n * At eol/eof in code, before a non-lazy closing fence or content.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function atNonLazyBreak(code) {\n return effects.attempt(closeStart, after, contentBefore)(code);\n }\n\n /**\n * Before code content, not a closing fence, at eol.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentBefore(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return contentStart;\n }\n\n /**\n * Before code content, not a closing fence.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentStart(code) {\n return initialPrefix > 0 && markdownSpace(code) ? factorySpace(effects, beforeContentChunk, \"linePrefix\", initialPrefix + 1)(code) : beforeContentChunk(code);\n }\n\n /**\n * Before code content, after optional prefix.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeContentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code);\n }\n effects.enter(\"codeFlowValue\");\n return contentChunk(code);\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^^^^^^^^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFlowValue\");\n return beforeContentChunk(code);\n }\n effects.consume(code);\n return contentChunk;\n }\n\n /**\n * After code.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n effects.exit(\"codeFenced\");\n return ok(code);\n }\n\n /**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\n function tokenizeCloseStart(effects, ok, nok) {\n let size = 0;\n return startBefore;\n\n /**\n *\n *\n * @type {State}\n */\n function startBefore(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return start;\n }\n\n /**\n * Before closing fence, at optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Always populated by defaults.\n\n // To do: `enter` here or in next state?\n effects.enter(\"codeFencedFence\");\n return markdownSpace(code) ? factorySpace(effects, beforeSequenceClose, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code) : beforeSequenceClose(code);\n }\n\n /**\n * In closing fence, after optional whitespace, at sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeSequenceClose(code) {\n if (code === marker) {\n effects.enter(\"codeFencedFenceSequence\");\n return sequenceClose(code);\n }\n return nok(code);\n }\n\n /**\n * In closing fence sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n if (code === marker) {\n size++;\n effects.consume(code);\n return sequenceClose;\n }\n if (size >= sizeOpen) {\n effects.exit(\"codeFencedFenceSequence\");\n return markdownSpace(code) ? factorySpace(effects, sequenceCloseAfter, \"whitespace\")(code) : sequenceCloseAfter(code);\n }\n return nok(code);\n }\n\n /**\n * After closing fence sequence, after optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceCloseAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFencedFence\");\n return ok(code);\n }\n return nok(code);\n }\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpaceMinMax } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const codeIndented = {\n name: 'codeIndented',\n tokenize: tokenizeCodeIndented\n};\n\n/** @type {Construct} */\nconst furtherStart = {\n partial: true,\n tokenize: tokenizeFurtherStart\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeIndented(effects, ok, nok) {\n return start;\n\n /**\n * Start of code (indented).\n *\n * > **Parsing note**: it is not needed to check if this first line is a\n * > filled line (that it has a non-whitespace character), because blank lines\n * > are parsed already, so we never run into that.\n *\n * ```markdown\n * > | aaa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: manually check if interrupting like `markdown-rs`.\n\n effects.enter(\"codeIndented\");\n return factorySpaceMinMax(effects, atBreak, nok, \"linePrefix\", 4, 4)(code);\n }\n\n /**\n * At a break.\n *\n * ```markdown\n * > | aaa\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === null) {\n return after(code);\n }\n if (markdownLineEnding(code)) {\n return effects.attempt(furtherStart, atBreak, after)(code);\n }\n effects.enter(\"codeFlowValue\");\n return inside(code);\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * > | aaa\n * ^^^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFlowValue\");\n return atBreak(code);\n }\n effects.consume(code);\n return inside;\n }\n\n /** @type {State} */\n function after(code) {\n effects.exit(\"codeIndented\");\n // To do: allow interrupting like `markdown-rs`.\n // Feel free to interrupt.\n // tokenizer.interrupt = false\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeFurtherStart(effects, ok, nok) {\n const self = this;\n return furtherStart;\n\n /**\n * At eol, trying to parse another indent.\n *\n * ```markdown\n * > | aaa\n * ^\n * | bbb\n * ```\n *\n * @type {State}\n */\n function furtherStart(code) {\n // To do: improve `lazy` / `pierce` handling.\n // If this is a lazy line, it can’t be code.\n if (self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return furtherStart;\n }\n\n // To do: the code here in `micromark-js` is a bit different from\n // `markdown-rs` because there it can attempt spaces.\n // We can’t yet.\n return factorySpaceMinMax(effects, ok, onNotEnoughPrefix, \"linePrefix\", 4, 4)(code);\n }\n\n /**\n * After not enough of a prefix.\n *\n * A following line ending is another (potentially blank) line to try,\n * anything else means this isn’t a continuation.\n *\n * ```markdown\n * > | aaa\n *\n * | bbb\n * ```\n *\n * @type {State}\n */\n function onNotEnoughPrefix(code) {\n return markdownLineEnding(code) ? furtherStart(code) : nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * Previous,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const codeText = {\n name: 'codeText',\n previous,\n resolve: resolveCodeText,\n tokenize: tokenizeCodeText\n};\n\n// To do: next major: don’t resolve, like `markdown-rs`.\n/** @type {Resolver} */\nfunction resolveCodeText(events) {\n let tailExitIndex = events.length - 4;\n let headEnterIndex = 3;\n /** @type {number} */\n let index;\n /** @type {number | undefined} */\n let enter;\n\n // If we start and end with an EOL or a space.\n if ((events[headEnterIndex][1].type === \"lineEnding\" || events[headEnterIndex][1].type === 'space') && (events[tailExitIndex][1].type === \"lineEnding\" || events[tailExitIndex][1].type === 'space')) {\n index = headEnterIndex;\n\n // And we have data.\n while (++index < tailExitIndex) {\n if (events[index][1].type === \"codeTextData\") {\n // Then we have padding.\n events[headEnterIndex][1].type = \"codeTextPadding\";\n events[tailExitIndex][1].type = \"codeTextPadding\";\n headEnterIndex += 2;\n tailExitIndex -= 2;\n break;\n }\n }\n }\n\n // Merge adjacent spaces and data.\n index = headEnterIndex - 1;\n tailExitIndex++;\n while (++index <= tailExitIndex) {\n if (enter === undefined) {\n if (index !== tailExitIndex && events[index][1].type !== \"lineEnding\") {\n enter = index;\n }\n } else if (index === tailExitIndex || events[index][1].type === \"lineEnding\") {\n events[enter][1].type = \"codeTextData\";\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n tailExitIndex -= index - enter - 2;\n index = enter + 2;\n }\n enter = undefined;\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Previous}\n */\nfunction previous(code) {\n // If there is a previous code, there will always be a tail.\n return code !== 96 || this.events[this.events.length - 1][1].type === \"characterEscape\";\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeText(effects, ok, nok) {\n const self = this;\n let sizeOpen = 0;\n /** @type {number} */\n let size;\n /** @type {Token} */\n let token;\n return start;\n\n /**\n * Start of code (text).\n *\n * ```markdown\n * > | `a`\n * ^\n * > | \\`a`\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"codeText\");\n effects.enter(\"codeTextSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 96) {\n effects.consume(code);\n sizeOpen++;\n return sequenceOpen;\n }\n effects.exit(\"codeTextSequence\");\n return between(code);\n }\n\n /**\n * Between something and something else.\n *\n * ```markdown\n * > | `a`\n * ^^\n * ```\n *\n * @type {State}\n */\n function between(code) {\n // EOF.\n if (code === null) {\n return nok(code);\n }\n\n // To do: next major: don’t do spaces in resolve, but when compiling,\n // like `markdown-rs`.\n // Tabs don’t work, and virtual spaces don’t make sense.\n if (code === 32) {\n effects.enter('space');\n effects.consume(code);\n effects.exit('space');\n return between;\n }\n\n // Closing fence? Could also be data.\n if (code === 96) {\n token = effects.enter(\"codeTextSequence\");\n size = 0;\n return sequenceClose(code);\n }\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return between;\n }\n\n // Data.\n effects.enter(\"codeTextData\");\n return data(code);\n }\n\n /**\n * In data.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (code === null || code === 32 || code === 96 || markdownLineEnding(code)) {\n effects.exit(\"codeTextData\");\n return between(code);\n }\n effects.consume(code);\n return data;\n }\n\n /**\n * In closing sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n // More.\n if (code === 96) {\n effects.consume(code);\n size++;\n return sequenceClose;\n }\n\n // Done!\n if (size === sizeOpen) {\n effects.exit(\"codeTextSequence\");\n effects.exit(\"codeText\");\n return ok(code);\n }\n\n // More or less accents: mark as data.\n token.type = \"codeTextData\";\n return data(code);\n }\n}","/**\n * Some of the internal operations of micromark do lots of editing\n * operations on very large arrays. This runs into problems with two\n * properties of most circa-2020 JavaScript interpreters:\n *\n * - Array-length modifications at the high end of an array (push/pop) are\n * expected to be common and are implemented in (amortized) time\n * proportional to the number of elements added or removed, whereas\n * other operations (shift/unshift and splice) are much less efficient.\n * - Function arguments are passed on the stack, so adding tens of thousands\n * of elements to an array with `arr.push(...newElements)` will frequently\n * cause stack overflows. (see <https://stackoverflow.com/questions/22123769/rangeerror-maximum-call-stack-size-exceeded-why>)\n *\n * SpliceBuffers are an implementation of gap buffers, which are a\n * generalization of the \"queue made of two stacks\" idea. The splice buffer\n * maintains a cursor, and moving the cursor has cost proportional to the\n * distance the cursor moves, but inserting, deleting, or splicing in\n * new information at the cursor is as efficient as the push/pop operation.\n * This allows for an efficient sequence of splices (or pushes, pops, shifts,\n * or unshifts) as long such edits happen at the same part of the array or\n * generally sweep through the array from the beginning to the end.\n *\n * The interface for splice buffers also supports large numbers of inputs by\n * passing a single array argument rather passing multiple arguments on the\n * function call stack.\n *\n * @template T\n * Item type.\n */\nexport class SpliceBuffer {\n /**\n * @param {ReadonlyArray<T> | null | undefined} [initial]\n * Initial items (optional).\n * @returns\n * Splice buffer.\n */\n constructor(initial) {\n /** @type {Array<T>} */\n this.left = initial ? [...initial] : [];\n /** @type {Array<T>} */\n this.right = [];\n }\n\n /**\n * Array access;\n * does not move the cursor.\n *\n * @param {number} index\n * Index.\n * @return {T}\n * Item.\n */\n get(index) {\n if (index < 0 || index >= this.left.length + this.right.length) {\n throw new RangeError('Cannot access index `' + index + '` in a splice buffer of size `' + (this.left.length + this.right.length) + '`');\n }\n if (index < this.left.length) return this.left[index];\n return this.right[this.right.length - index + this.left.length - 1];\n }\n\n /**\n * The length of the splice buffer, one greater than the largest index in the\n * array.\n */\n get length() {\n return this.left.length + this.right.length;\n }\n\n /**\n * Remove and return `list[0]`;\n * moves the cursor to `0`.\n *\n * @returns {T | undefined}\n * Item, optional.\n */\n shift() {\n this.setCursor(0);\n return this.right.pop();\n }\n\n /**\n * Slice the buffer to get an array;\n * does not move the cursor.\n *\n * @param {number} start\n * Start.\n * @param {number | null | undefined} [end]\n * End (optional).\n * @returns {Array<T>}\n * Array of items.\n */\n slice(start, end) {\n /** @type {number} */\n const stop = end === null || end === undefined ? Number.POSITIVE_INFINITY : end;\n if (stop < this.left.length) {\n return this.left.slice(start, stop);\n }\n if (start > this.left.length) {\n return this.right.slice(this.right.length - stop + this.left.length, this.right.length - start + this.left.length).reverse();\n }\n return this.left.slice(start).concat(this.right.slice(this.right.length - stop + this.left.length).reverse());\n }\n\n /**\n * Mimics the behavior of Array.prototype.splice() except for the change of\n * interface necessary to avoid segfaults when patching in very large arrays.\n *\n * This operation moves cursor is moved to `start` and results in the cursor\n * placed after any inserted items.\n *\n * @param {number} start\n * Start;\n * zero-based index at which to start changing the array;\n * negative numbers count backwards from the end of the array and values\n * that are out-of bounds are clamped to the appropriate end of the array.\n * @param {number | null | undefined} [deleteCount=0]\n * Delete count (default: `0`);\n * maximum number of elements to delete, starting from start.\n * @param {Array<T> | null | undefined} [items=[]]\n * Items to include in place of the deleted items (default: `[]`).\n * @return {Array<T>}\n * Any removed items.\n */\n splice(start, deleteCount, items) {\n /** @type {number} */\n const count = deleteCount || 0;\n this.setCursor(Math.trunc(start));\n const removed = this.right.splice(this.right.length - count, Number.POSITIVE_INFINITY);\n if (items) chunkedPush(this.left, items);\n return removed.reverse();\n }\n\n /**\n * Remove and return the highest-numbered item in the array, so\n * `list[list.length - 1]`;\n * Moves the cursor to `length`.\n *\n * @returns {T | undefined}\n * Item, optional.\n */\n pop() {\n this.setCursor(Number.POSITIVE_INFINITY);\n return this.left.pop();\n }\n\n /**\n * Inserts a single item to the high-numbered side of the array;\n * moves the cursor to `length`.\n *\n * @param {T} item\n * Item.\n * @returns {undefined}\n * Nothing.\n */\n push(item) {\n this.setCursor(Number.POSITIVE_INFINITY);\n this.left.push(item);\n }\n\n /**\n * Inserts many items to the high-numbered side of the array.\n * Moves the cursor to `length`.\n *\n * @param {Array<T>} items\n * Items.\n * @returns {undefined}\n * Nothing.\n */\n pushMany(items) {\n this.setCursor(Number.POSITIVE_INFINITY);\n chunkedPush(this.left, items);\n }\n\n /**\n * Inserts a single item to the low-numbered side of the array;\n * Moves the cursor to `0`.\n *\n * @param {T} item\n * Item.\n * @returns {undefined}\n * Nothing.\n */\n unshift(item) {\n this.setCursor(0);\n this.right.push(item);\n }\n\n /**\n * Inserts many items to the low-numbered side of the array;\n * moves the cursor to `0`.\n *\n * @param {Array<T>} items\n * Items.\n * @returns {undefined}\n * Nothing.\n */\n unshiftMany(items) {\n this.setCursor(0);\n chunkedPush(this.right, items.reverse());\n }\n\n /**\n * Move the cursor to a specific position in the array. Requires\n * time proportional to the distance moved.\n *\n * If `n < 0`, the cursor will end up at the beginning.\n * If `n > length`, the cursor will end up at the end.\n *\n * @param {number} n\n * Position.\n * @return {undefined}\n * Nothing.\n */\n setCursor(n) {\n if (n === this.left.length || n > this.left.length && this.right.length === 0 || n < 0 && this.left.length === 0) return;\n if (n < this.left.length) {\n // Move cursor to the this.left\n const removed = this.left.splice(n, Number.POSITIVE_INFINITY);\n chunkedPush(this.right, removed.reverse());\n } else {\n // Move cursor to the this.right\n const removed = this.right.splice(this.left.length + this.right.length - n, Number.POSITIVE_INFINITY);\n chunkedPush(this.left, removed.reverse());\n }\n }\n}\n\n/**\n * Avoid stack overflow by pushing items onto the stack in segments\n *\n * @template T\n * Item type.\n * @param {Array<T>} list\n * List to inject into.\n * @param {ReadonlyArray<T>} right\n * Items to inject.\n * @return {undefined}\n * Nothing.\n */\nfunction chunkedPush(list, right) {\n /** @type {number} */\n let chunkStart = 0;\n if (right.length < 10000) {\n list.push(...right);\n } else {\n while (chunkStart < right.length) {\n list.push(...right.slice(chunkStart, chunkStart + 10000));\n chunkStart += 10000;\n }\n }\n}","/**\n * @import {Chunk, Event, Token} from 'micromark-util-types'\n */\n\nimport { splice } from 'micromark-util-chunked';\nimport { SpliceBuffer } from './lib/splice-buffer.js';\n\n// Hidden API exposed for testing.\nexport { SpliceBuffer } from './lib/splice-buffer.js';\n\n/**\n * Tokenize subcontent.\n *\n * @param {Array<Event>} eventsArray\n * List of events.\n * @returns {boolean}\n * Whether subtokens were found.\n */\n// eslint-disable-next-line complexity\nexport function subtokenize(eventsArray) {\n /** @type {Record<string, number>} */\n const jumps = {};\n let index = -1;\n /** @type {Event} */\n let event;\n /** @type {number | undefined} */\n let lineIndex;\n /** @type {number} */\n let otherIndex;\n /** @type {Event} */\n let otherEvent;\n /** @type {Array<Event>} */\n let parameters;\n /** @type {Array<Event>} */\n let subevents;\n /** @type {boolean | undefined} */\n let more;\n const events = new SpliceBuffer(eventsArray);\n while (++index < events.length) {\n while (index in jumps) {\n index = jumps[index];\n }\n event = events.get(index);\n\n // Add a hook for the GFM tasklist extension, which needs to know if text\n // is in the first content of a list item.\n if (index && event[1].type === \"chunkFlow\" && events.get(index - 1)[1].type === \"listItemPrefix\") {\n subevents = event[1]._tokenizer.events;\n otherIndex = 0;\n if (otherIndex < subevents.length && subevents[otherIndex][1].type === \"lineEndingBlank\") {\n otherIndex += 2;\n }\n if (otherIndex < subevents.length && subevents[otherIndex][1].type === \"content\") {\n while (++otherIndex < subevents.length) {\n if (subevents[otherIndex][1].type === \"content\") {\n break;\n }\n if (subevents[otherIndex][1].type === \"chunkText\") {\n subevents[otherIndex][1]._isInFirstContentOfListItem = true;\n otherIndex++;\n }\n }\n }\n }\n\n // Enter.\n if (event[0] === 'enter') {\n if (event[1].contentType) {\n Object.assign(jumps, subcontent(events, index));\n index = jumps[index];\n more = true;\n }\n }\n // Exit.\n else if (event[1]._container) {\n otherIndex = index;\n lineIndex = undefined;\n while (otherIndex--) {\n otherEvent = events.get(otherIndex);\n if (otherEvent[1].type === \"lineEnding\" || otherEvent[1].type === \"lineEndingBlank\") {\n if (otherEvent[0] === 'enter') {\n if (lineIndex) {\n events.get(lineIndex)[1].type = \"lineEndingBlank\";\n }\n otherEvent[1].type = \"lineEnding\";\n lineIndex = otherIndex;\n }\n } else if (otherEvent[1].type === \"linePrefix\" || otherEvent[1].type === \"listItemIndent\") {\n // Move past.\n } else {\n break;\n }\n }\n if (lineIndex) {\n // Fix position.\n event[1].end = {\n ...events.get(lineIndex)[1].start\n };\n\n // Switch container exit w/ line endings.\n parameters = events.slice(lineIndex, index);\n parameters.unshift(event);\n events.splice(lineIndex, index - lineIndex + 1, parameters);\n }\n }\n }\n\n // The changes to the `events` buffer must be copied back into the eventsArray\n splice(eventsArray, 0, Number.POSITIVE_INFINITY, events.slice(0));\n return !more;\n}\n\n/**\n * Tokenize embedded tokens.\n *\n * @param {SpliceBuffer<Event>} events\n * Events.\n * @param {number} eventIndex\n * Index.\n * @returns {Record<string, number>}\n * Gaps.\n */\nfunction subcontent(events, eventIndex) {\n const token = events.get(eventIndex)[1];\n const context = events.get(eventIndex)[2];\n let startPosition = eventIndex - 1;\n /** @type {Array<number>} */\n const startPositions = [];\n let tokenizer = token._tokenizer;\n if (!tokenizer) {\n tokenizer = context.parser[token.contentType](token.start);\n if (token._contentTypeTextTrailing) {\n tokenizer._contentTypeTextTrailing = true;\n }\n }\n const childEvents = tokenizer.events;\n /** @type {Array<[number, number]>} */\n const jumps = [];\n /** @type {Record<string, number>} */\n const gaps = {};\n /** @type {Array<Chunk>} */\n let stream;\n /** @type {Token | undefined} */\n let previous;\n let index = -1;\n /** @type {Token | undefined} */\n let current = token;\n let adjust = 0;\n let start = 0;\n const breaks = [start];\n\n // Loop forward through the linked tokens to pass them in order to the\n // subtokenizer.\n while (current) {\n // Find the position of the event for this token.\n while (events.get(++startPosition)[1] !== current) {\n // Empty.\n }\n startPositions.push(startPosition);\n if (!current._tokenizer) {\n stream = context.sliceStream(current);\n if (!current.next) {\n stream.push(null);\n }\n if (previous) {\n tokenizer.defineSkip(current.start);\n }\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = true;\n }\n tokenizer.write(stream);\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = undefined;\n }\n }\n\n // Unravel the next token.\n previous = current;\n current = current.next;\n }\n\n // Now, loop back through all events (and linked tokens), to figure out which\n // parts belong where.\n current = token;\n while (++index < childEvents.length) {\n if (\n // Find a void token that includes a break.\n childEvents[index][0] === 'exit' && childEvents[index - 1][0] === 'enter' && childEvents[index][1].type === childEvents[index - 1][1].type && childEvents[index][1].start.line !== childEvents[index][1].end.line) {\n start = index + 1;\n breaks.push(start);\n // Help GC.\n current._tokenizer = undefined;\n current.previous = undefined;\n current = current.next;\n }\n }\n\n // Help GC.\n tokenizer.events = [];\n\n // If there’s one more token (which is the cases for lines that end in an\n // EOF), that’s perfect: the last point we found starts it.\n // If there isn’t then make sure any remaining content is added to it.\n if (current) {\n // Help GC.\n current._tokenizer = undefined;\n current.previous = undefined;\n } else {\n breaks.pop();\n }\n\n // Now splice the events from the subtokenizer into the current events,\n // moving back to front so that splice indices aren’t affected.\n index = breaks.length;\n while (index--) {\n const slice = childEvents.slice(breaks[index], breaks[index + 1]);\n const start = startPositions.pop();\n jumps.push([start, start + slice.length - 1]);\n events.splice(start, 2, slice);\n }\n jumps.reverse();\n index = -1;\n while (++index < jumps.length) {\n gaps[adjust + jumps[index][0]] = adjust + jumps[index][1];\n adjust += jumps[index][1] - jumps[index][0] - 1;\n }\n return gaps;\n}","/**\n * @import {\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { subtokenize } from 'micromark-util-subtokenize';\n/**\n * No name because it must not be turned off.\n * @type {Construct}\n */\nexport const content = {\n resolve: resolveContent,\n tokenize: tokenizeContent\n};\n\n/** @type {Construct} */\nconst continuationConstruct = {\n partial: true,\n tokenize: tokenizeContinuation\n};\n\n/**\n * Content is transparent: it’s parsed right now. That way, definitions are also\n * parsed right now: before text in paragraphs (specifically, media) are parsed.\n *\n * @type {Resolver}\n */\nfunction resolveContent(events) {\n subtokenize(events);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeContent(effects, ok) {\n /** @type {Token | undefined} */\n let previous;\n return chunkStart;\n\n /**\n * Before a content chunk.\n *\n * ```markdown\n * > | abc\n * ^\n * ```\n *\n * @type {State}\n */\n function chunkStart(code) {\n effects.enter(\"content\");\n previous = effects.enter(\"chunkContent\", {\n contentType: \"content\"\n });\n return chunkInside(code);\n }\n\n /**\n * In a content chunk.\n *\n * ```markdown\n * > | abc\n * ^^^\n * ```\n *\n * @type {State}\n */\n function chunkInside(code) {\n if (code === null) {\n return contentEnd(code);\n }\n\n // To do: in `markdown-rs`, each line is parsed on its own, and everything\n // is stitched together resolving.\n if (markdownLineEnding(code)) {\n return effects.check(continuationConstruct, contentContinue, contentEnd)(code);\n }\n\n // Data.\n effects.consume(code);\n return chunkInside;\n }\n\n /**\n *\n *\n * @type {State}\n */\n function contentEnd(code) {\n effects.exit(\"chunkContent\");\n effects.exit(\"content\");\n return ok(code);\n }\n\n /**\n *\n *\n * @type {State}\n */\n function contentContinue(code) {\n effects.consume(code);\n effects.exit(\"chunkContent\");\n previous.next = effects.enter(\"chunkContent\", {\n contentType: \"content\",\n previous\n });\n previous = previous.next;\n return chunkInside;\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeContinuation(effects, ok, nok) {\n const self = this;\n return startLookahead;\n\n /**\n *\n *\n * @type {State}\n */\n function startLookahead(code) {\n effects.exit(\"chunkContent\");\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, prefixed, \"linePrefix\");\n }\n\n /**\n *\n *\n * @type {State}\n */\n function prefixed(code) {\n if (code === null || markdownLineEnding(code)) {\n return nok(code);\n }\n\n // Always populated by defaults.\n\n const tail = self.events[self.events.length - 1];\n if (!self.parser.constructs.disable.null.includes('codeIndented') && tail && tail[1].type === \"linePrefix\" && tail[2].sliceSerialize(tail[1], true).length >= 4) {\n return ok(code);\n }\n return effects.interrupt(self.parser.constructs.flow, nok, ok)(code);\n }\n}","/**\n * @import {Effects, State, TokenType} from 'micromark-util-types'\n */\n\nimport { asciiControl, markdownLineEndingOrSpace, markdownLineEnding } from 'micromark-util-character';\n/**\n * Parse destinations.\n *\n * ###### Examples\n *\n * ```markdown\n * <a>\n * <a\\>b>\n * <a b>\n * <a)>\n * a\n * a\\)b\n * a(b)c\n * a(b)\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type for whole (`<a>` or `b`).\n * @param {TokenType} literalType\n * Type when enclosed (`<a>`).\n * @param {TokenType} literalMarkerType\n * Type for enclosing (`<` and `>`).\n * @param {TokenType} rawType\n * Type when not enclosed (`b`).\n * @param {TokenType} stringType\n * Type for the value (`a` or `b`).\n * @param {number | undefined} [max=Infinity]\n * Depth of nested parens (inclusive).\n * @returns {State}\n * Start state.\n */\nexport function factoryDestination(effects, ok, nok, type, literalType, literalMarkerType, rawType, stringType, max) {\n const limit = max || Number.POSITIVE_INFINITY;\n let balance = 0;\n return start;\n\n /**\n * Start of destination.\n *\n * ```markdown\n * > | <aa>\n * ^\n * > | aa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 60) {\n effects.enter(type);\n effects.enter(literalType);\n effects.enter(literalMarkerType);\n effects.consume(code);\n effects.exit(literalMarkerType);\n return enclosedBefore;\n }\n\n // ASCII control, space, closing paren.\n if (code === null || code === 32 || code === 41 || asciiControl(code)) {\n return nok(code);\n }\n effects.enter(type);\n effects.enter(rawType);\n effects.enter(stringType);\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return raw(code);\n }\n\n /**\n * After `<`, at an enclosed destination.\n *\n * ```markdown\n * > | <aa>\n * ^\n * ```\n *\n * @type {State}\n */\n function enclosedBefore(code) {\n if (code === 62) {\n effects.enter(literalMarkerType);\n effects.consume(code);\n effects.exit(literalMarkerType);\n effects.exit(literalType);\n effects.exit(type);\n return ok;\n }\n effects.enter(stringType);\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return enclosed(code);\n }\n\n /**\n * In enclosed destination.\n *\n * ```markdown\n * > | <aa>\n * ^\n * ```\n *\n * @type {State}\n */\n function enclosed(code) {\n if (code === 62) {\n effects.exit(\"chunkString\");\n effects.exit(stringType);\n return enclosedBefore(code);\n }\n if (code === null || code === 60 || markdownLineEnding(code)) {\n return nok(code);\n }\n effects.consume(code);\n return code === 92 ? enclosedEscape : enclosed;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | <a\\*a>\n * ^\n * ```\n *\n * @type {State}\n */\n function enclosedEscape(code) {\n if (code === 60 || code === 62 || code === 92) {\n effects.consume(code);\n return enclosed;\n }\n return enclosed(code);\n }\n\n /**\n * In raw destination.\n *\n * ```markdown\n * > | aa\n * ^\n * ```\n *\n * @type {State}\n */\n function raw(code) {\n if (!balance && (code === null || code === 41 || markdownLineEndingOrSpace(code))) {\n effects.exit(\"chunkString\");\n effects.exit(stringType);\n effects.exit(rawType);\n effects.exit(type);\n return ok(code);\n }\n if (balance < limit && code === 40) {\n effects.consume(code);\n balance++;\n return raw;\n }\n if (code === 41) {\n effects.consume(code);\n balance--;\n return raw;\n }\n\n // ASCII control (but *not* `\\0`) and space and `(`.\n // Note: in `markdown-rs`, `\\0` exists in codes, in `micromark-js` it\n // doesn’t.\n if (code === null || code === 32 || code === 40 || asciiControl(code)) {\n return nok(code);\n }\n effects.consume(code);\n return code === 92 ? rawEscape : raw;\n }\n\n /**\n * After `\\`, at special character.\n *\n * ```markdown\n * > | a\\*a\n * ^\n * ```\n *\n * @type {State}\n */\n function rawEscape(code) {\n if (code === 40 || code === 41 || code === 92) {\n effects.consume(code);\n return raw;\n }\n return raw(code);\n }\n}","/**\n * @import {\n * Effects,\n * State,\n * TokenizeContext,\n * TokenType\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/**\n * Parse labels.\n *\n * > 👉 **Note**: labels in markdown are capped at 999 characters in the string.\n *\n * ###### Examples\n *\n * ```markdown\n * [a]\n * [a\n * b]\n * [a\\]b]\n * ```\n *\n * @this {TokenizeContext}\n * Tokenize context.\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole label (`[a]`).\n * @param {TokenType} markerType\n * Type for the markers (`[` and `]`).\n * @param {TokenType} stringType\n * Type for the identifier (`a`).\n * @returns {State}\n * Start state.\n */\nexport function factoryLabel(effects, ok, nok, type, markerType, stringType) {\n const self = this;\n let size = 0;\n /** @type {boolean} */\n let seen;\n return start;\n\n /**\n * Start of label.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(type);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.enter(stringType);\n return atBreak;\n }\n\n /**\n * In label, at something, before something else.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (size > 999 || code === null || code === 91 || code === 93 && !seen ||\n // To do: remove in the future once we’ve switched from\n // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,\n // which doesn’t need this.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n code === 94 && !size && '_hiddenFootnoteSupport' in self.parser.constructs) {\n return nok(code);\n }\n if (code === 93) {\n effects.exit(stringType);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.exit(type);\n return ok;\n }\n\n // To do: indent? Link chunks and EOLs together?\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return atBreak;\n }\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return labelInside(code);\n }\n\n /**\n * In label, in text.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function labelInside(code) {\n if (code === null || code === 91 || code === 93 || markdownLineEnding(code) || size++ > 999) {\n effects.exit(\"chunkString\");\n return atBreak(code);\n }\n effects.consume(code);\n if (!seen) seen = !markdownSpace(code);\n return code === 92 ? labelEscape : labelInside;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | [a\\*a]\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return labelInside;\n }\n return labelInside(code);\n }\n}","/**\n * @import {\n * Code,\n * Effects,\n * State,\n * TokenType\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/**\n * Parse titles.\n *\n * ###### Examples\n *\n * ```markdown\n * \"a\"\n * 'b'\n * (c)\n * \"a\n * b\"\n * 'a\n * b'\n * (a\\)b)\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole title (`\"a\"`, `'b'`, `(c)`).\n * @param {TokenType} markerType\n * Type for the markers (`\"`, `'`, `(`, and `)`).\n * @param {TokenType} stringType\n * Type for the value (`a`).\n * @returns {State}\n * Start state.\n */\nexport function factoryTitle(effects, ok, nok, type, markerType, stringType) {\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of title.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 34 || code === 39 || code === 40) {\n effects.enter(type);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n marker = code === 40 ? 41 : code;\n return begin;\n }\n return nok(code);\n }\n\n /**\n * After opening marker.\n *\n * This is also used at the closing marker.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function begin(code) {\n if (code === marker) {\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.exit(type);\n return ok;\n }\n effects.enter(stringType);\n return atBreak(code);\n }\n\n /**\n * At something, before something else.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === marker) {\n effects.exit(stringType);\n return begin(marker);\n }\n if (code === null) {\n return nok(code);\n }\n\n // Note: blank lines can’t exist in content.\n if (markdownLineEnding(code)) {\n // To do: use `space_or_tab_eol_with_options`, connect.\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, atBreak, \"linePrefix\");\n }\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return inside(code);\n }\n\n /**\n *\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker || code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n return atBreak(code);\n }\n effects.consume(code);\n return code === 92 ? escape : inside;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | \"a\\*b\"\n * ^\n * ```\n *\n * @type {State}\n */\n function escape(code) {\n if (code === marker || code === 92) {\n effects.consume(code);\n return inside;\n }\n return inside(code);\n }\n}","/**\n * @import {Effects, State} from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * line endings or spaces in markdown are often optional, in which case this\n * factory can be used and `ok` will be switched to whether spaces were found\n * or not\n * * one line ending or space can be detected with\n * `markdownLineEndingOrSpace(code)` right before using `factoryWhitespace`\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @returns {State}\n * Start state.\n */\nexport function factoryWhitespace(effects, ok) {\n /** @type {boolean} */\n let seen;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n seen = true;\n return start;\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, start, seen ? \"linePrefix\" : \"lineSuffix\")(code);\n }\n return ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factoryDestination } from 'micromark-factory-destination';\nimport { factoryLabel } from 'micromark-factory-label';\nimport { factorySpace } from 'micromark-factory-space';\nimport { factoryTitle } from 'micromark-factory-title';\nimport { factoryWhitespace } from 'micromark-factory-whitespace';\nimport { markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\n/** @type {Construct} */\nexport const definition = {\n name: 'definition',\n tokenize: tokenizeDefinition\n};\n\n/** @type {Construct} */\nconst titleBefore = {\n partial: true,\n tokenize: tokenizeTitleBefore\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeDefinition(effects, ok, nok) {\n const self = this;\n /** @type {string} */\n let identifier;\n return start;\n\n /**\n * At start of a definition.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Do not interrupt paragraphs (but do follow definitions).\n // To do: do `interrupt` the way `markdown-rs` does.\n // To do: parse whitespace the way `markdown-rs` does.\n effects.enter(\"definition\");\n return before(code);\n }\n\n /**\n * After optional whitespace, at `[`.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n // To do: parse whitespace the way `markdown-rs` does.\n\n return factoryLabel.call(self, effects, labelAfter,\n // Note: we don’t need to reset the way `markdown-rs` does.\n nok, \"definitionLabel\", \"definitionLabelMarker\", \"definitionLabelString\")(code);\n }\n\n /**\n * After label.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAfter(code) {\n identifier = normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1));\n if (code === 58) {\n effects.enter(\"definitionMarker\");\n effects.consume(code);\n effects.exit(\"definitionMarker\");\n return markerAfter;\n }\n return nok(code);\n }\n\n /**\n * After marker.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function markerAfter(code) {\n // Note: whitespace is optional.\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, destinationBefore)(code) : destinationBefore(code);\n }\n\n /**\n * Before destination.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function destinationBefore(code) {\n return factoryDestination(effects, destinationAfter,\n // Note: we don’t need to reset the way `markdown-rs` does.\n nok, \"definitionDestination\", \"definitionDestinationLiteral\", \"definitionDestinationLiteralMarker\", \"definitionDestinationRaw\", \"definitionDestinationString\")(code);\n }\n\n /**\n * After destination.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function destinationAfter(code) {\n return effects.attempt(titleBefore, after, after)(code);\n }\n\n /**\n * After definition.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return markdownSpace(code) ? factorySpace(effects, afterWhitespace, \"whitespace\")(code) : afterWhitespace(code);\n }\n\n /**\n * After definition, after optional whitespace.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function afterWhitespace(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"definition\");\n\n // Note: we don’t care about uniqueness.\n // It’s likely that that doesn’t happen very frequently.\n // It is more likely that it wastes precious time.\n self.parser.defined.push(identifier);\n\n // To do: `markdown-rs` interrupt.\n // // You’d be interrupting.\n // tokenizer.interrupt = true\n return ok(code);\n }\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeTitleBefore(effects, ok, nok) {\n return titleBefore;\n\n /**\n * After destination, at whitespace.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleBefore(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, beforeMarker)(code) : nok(code);\n }\n\n /**\n * At title.\n *\n * ```markdown\n * | [a]: b\n * > | \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeMarker(code) {\n return factoryTitle(effects, titleAfter, nok, \"definitionTitle\", \"definitionTitleMarker\", \"definitionTitleString\")(code);\n }\n\n /**\n * After title.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleAfter(code) {\n return markdownSpace(code) ? factorySpace(effects, titleAfterOptionalWhitespace, \"whitespace\")(code) : titleAfterOptionalWhitespace(code);\n }\n\n /**\n * After title, after optional whitespace.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleAfterOptionalWhitespace(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const hardBreakEscape = {\n name: 'hardBreakEscape',\n tokenize: tokenizeHardBreakEscape\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHardBreakEscape(effects, ok, nok) {\n return start;\n\n /**\n * Start of a hard break (escape).\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"hardBreakEscape\");\n effects.consume(code);\n return after;\n }\n\n /**\n * After `\\`, at eol.\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (markdownLineEnding(code)) {\n effects.exit(\"hardBreakEscape\");\n return ok(code);\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { splice } from 'micromark-util-chunked';\n/** @type {Construct} */\nexport const headingAtx = {\n name: 'headingAtx',\n resolve: resolveHeadingAtx,\n tokenize: tokenizeHeadingAtx\n};\n\n/** @type {Resolver} */\nfunction resolveHeadingAtx(events, context) {\n let contentEnd = events.length - 2;\n let contentStart = 3;\n\n // Prefix whitespace, part of the opening.\n if (events[contentStart][1].type === \"whitespace\") {\n contentStart += 2;\n }\n\n // Suffix whitespace, part of the closing.\n if (contentEnd - 2 > contentStart && events[contentEnd][1].type === \"whitespace\") {\n contentEnd -= 2;\n }\n if (events[contentEnd][1].type === \"atxHeadingSequence\" && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === \"whitespace\")) {\n contentEnd -= contentStart + 1 === contentEnd ? 2 : 4;\n }\n if (contentEnd > contentStart) {\n const content = {\n type: \"atxHeadingText\",\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end\n };\n const text = {\n type: \"chunkText\",\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end,\n contentType: \"text\"\n };\n splice(events, contentStart, contentEnd - contentStart + 1, [['enter', content, context], ['enter', text, context], ['exit', text, context], ['exit', content, context]]);\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHeadingAtx(effects, ok, nok) {\n let size = 0;\n return start;\n\n /**\n * Start of a heading (atx).\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse indent like `markdown-rs`.\n effects.enter(\"atxHeading\");\n return before(code);\n }\n\n /**\n * After optional whitespace, at `#`.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"atxHeadingSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 35 && size++ < 6) {\n effects.consume(code);\n return sequenceOpen;\n }\n\n // Always at least one `#`.\n if (code === null || markdownLineEndingOrSpace(code)) {\n effects.exit(\"atxHeadingSequence\");\n return atBreak(code);\n }\n return nok(code);\n }\n\n /**\n * After something, before something else.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === 35) {\n effects.enter(\"atxHeadingSequence\");\n return sequenceFurther(code);\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"atxHeading\");\n // To do: interrupt like `markdown-rs`.\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n return ok(code);\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, atBreak, \"whitespace\")(code);\n }\n\n // To do: generate `data` tokens, add the `text` token later.\n // Needs edit map, see: `markdown.rs`.\n effects.enter(\"atxHeadingText\");\n return data(code);\n }\n\n /**\n * In further sequence (after whitespace).\n *\n * Could be normal “visible” hashes in the heading or a final sequence.\n *\n * ```markdown\n * > | ## aa ##\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceFurther(code) {\n if (code === 35) {\n effects.consume(code);\n return sequenceFurther;\n }\n effects.exit(\"atxHeadingSequence\");\n return atBreak(code);\n }\n\n /**\n * In text.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (code === null || code === 35 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"atxHeadingText\");\n return atBreak(code);\n }\n effects.consume(code);\n return data;\n }\n}","/**\n * List of lowercase HTML “block” tag names.\n *\n * The list, when parsing HTML (flow), results in more relaxed rules (condition\n * 6).\n * Because they are known blocks, the HTML-like syntax doesn’t have to be\n * strictly parsed.\n * For tag names not in this list, a more strict algorithm (condition 7) is used\n * to detect whether the HTML-like syntax is seen as HTML (flow) or not.\n *\n * This is copied from:\n * <https://spec.commonmark.org/0.30/#html-blocks>.\n *\n * > 👉 **Note**: `search` was added in `CommonMark@0.31`.\n */\nexport const htmlBlockNames = [\n 'address',\n 'article',\n 'aside',\n 'base',\n 'basefont',\n 'blockquote',\n 'body',\n 'caption',\n 'center',\n 'col',\n 'colgroup',\n 'dd',\n 'details',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'iframe',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'menu',\n 'menuitem',\n 'nav',\n 'noframes',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'param',\n 'search',\n 'section',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'track',\n 'ul'\n]\n\n/**\n * List of lowercase HTML “raw” tag names.\n *\n * The list, when parsing HTML (flow), results in HTML that can include lines\n * without exiting, until a closing tag also in this list is found (condition\n * 1).\n *\n * This module is copied from:\n * <https://spec.commonmark.org/0.30/#html-blocks>.\n *\n * > 👉 **Note**: `textarea` was added in `CommonMark@0.30`.\n */\nexport const htmlRawNames = ['pre', 'script', 'style', 'textarea']\n","/**\n * @import {\n * Code,\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { asciiAlphanumeric, asciiAlpha, markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { htmlBlockNames, htmlRawNames } from 'micromark-util-html-tag-name';\nimport { blankLine } from './blank-line.js';\nimport { nonLazyContinuation } from './partial-non-lazy-continuation.js';\n\n/** @type {Construct} */\nexport const htmlFlow = {\n concrete: true,\n name: 'htmlFlow',\n resolveTo: resolveToHtmlFlow,\n tokenize: tokenizeHtmlFlow\n};\n\n/** @type {Construct} */\nconst blankLineBefore = {\n partial: true,\n tokenize: tokenizeBlankLineBefore\n};\n\n/** @type {Resolver} */\nfunction resolveToHtmlFlow(events) {\n let index = events.length;\n while (index--) {\n if (events[index][0] === 'enter' && events[index][1].type === \"htmlFlow\") {\n break;\n }\n }\n if (index > 1 && events[index - 2][1].type === \"linePrefix\") {\n // Add the prefix start to the HTML token.\n events[index][1].start = events[index - 2][1].start;\n // Add the prefix start to the HTML line token.\n events[index + 1][1].start = events[index - 2][1].start;\n // Remove the line prefix.\n events.splice(index - 2, 2);\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlFlow(effects, ok, nok) {\n const self = this;\n /** @type {number} */\n let marker;\n /** @type {boolean} */\n let closingTag;\n /** @type {string} */\n let buffer;\n /** @type {number} */\n let index;\n /** @type {Code} */\n let markerB;\n return start;\n\n /**\n * Start of HTML (flow).\n *\n * ```markdown\n * > | <x />\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse indent like `markdown-rs`.\n return before(code);\n }\n\n /**\n * At `<`, after optional whitespace.\n *\n * ```markdown\n * > | <x />\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"htmlFlow\");\n effects.enter(\"htmlFlowData\");\n effects.consume(code);\n return open;\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | <x />\n * ^\n * > | <!doctype>\n * ^\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code);\n return declarationOpen;\n }\n if (code === 47) {\n effects.consume(code);\n closingTag = true;\n return tagCloseStart;\n }\n if (code === 63) {\n effects.consume(code);\n marker = 3;\n // To do:\n // tokenizer.concrete = true\n // To do: use `markdown-rs` style interrupt.\n // While we’re in an instruction instead of a declaration, we’re on a `?`\n // right now, so we do need to search for `>`, similar to declarations.\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n // Always the case.\n effects.consume(code);\n buffer = String.fromCharCode(code);\n return tagName;\n }\n return nok(code);\n }\n\n /**\n * After `<!`, at declaration, comment, or CDATA.\n *\n * ```markdown\n * > | <!doctype>\n * ^\n * > | <!--xxx-->\n * ^\n * > | <![CDATA[>&<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code);\n marker = 2;\n return commentOpenInside;\n }\n if (code === 91) {\n effects.consume(code);\n marker = 5;\n index = 0;\n return cdataOpenInside;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n marker = 4;\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n return nok(code);\n }\n\n /**\n * After `<!-`, inside a comment, at another `-`.\n *\n * ```markdown\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code);\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n return nok(code);\n }\n\n /**\n * After `<![`, inside CDATA, expecting `CDATA[`.\n *\n * ```markdown\n * > | <![CDATA[>&<]]>\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = \"CDATA[\";\n if (code === value.charCodeAt(index++)) {\n effects.consume(code);\n if (index === value.length) {\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuation;\n }\n return cdataOpenInside;\n }\n return nok(code);\n }\n\n /**\n * After `</`, in closing tag, at tag name.\n *\n * ```markdown\n * > | </x>\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n if (asciiAlpha(code)) {\n // Always the case.\n effects.consume(code);\n buffer = String.fromCharCode(code);\n return tagName;\n }\n return nok(code);\n }\n\n /**\n * In tag name.\n *\n * ```markdown\n * > | <ab>\n * ^^\n * > | </ab>\n * ^^\n * ```\n *\n * @type {State}\n */\n function tagName(code) {\n if (code === null || code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n const slash = code === 47;\n const name = buffer.toLowerCase();\n if (!slash && !closingTag && htmlRawNames.includes(name)) {\n marker = 1;\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok(code) : continuation(code);\n }\n if (htmlBlockNames.includes(buffer.toLowerCase())) {\n marker = 6;\n if (slash) {\n effects.consume(code);\n return basicSelfClosing;\n }\n\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok(code) : continuation(code);\n }\n marker = 7;\n // Do not support complete HTML when interrupting.\n return self.interrupt && !self.parser.lazy[self.now().line] ? nok(code) : closingTag ? completeClosingTagAfter(code) : completeAttributeNameBefore(code);\n }\n\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n buffer += String.fromCharCode(code);\n return tagName;\n }\n return nok(code);\n }\n\n /**\n * After closing slash of a basic tag name.\n *\n * ```markdown\n * > | <div/>\n * ^\n * ```\n *\n * @type {State}\n */\n function basicSelfClosing(code) {\n if (code === 62) {\n effects.consume(code);\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuation;\n }\n return nok(code);\n }\n\n /**\n * After closing slash of a complete tag name.\n *\n * ```markdown\n * > | <x/>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeClosingTagAfter(code) {\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeClosingTagAfter;\n }\n return completeEnd(code);\n }\n\n /**\n * At an attribute name.\n *\n * At first, this state is used after a complete tag name, after whitespace,\n * where it expects optional attributes or the end of the tag.\n * It is also reused after attributes, when expecting more optional\n * attributes.\n *\n * ```markdown\n * > | <a />\n * ^\n * > | <a :b>\n * ^\n * > | <a _b>\n * ^\n * > | <a b>\n * ^\n * > | <a >\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeNameBefore(code) {\n if (code === 47) {\n effects.consume(code);\n return completeEnd;\n }\n\n // ASCII alphanumerical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code);\n return completeAttributeName;\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeNameBefore;\n }\n return completeEnd(code);\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | <a :b>\n * ^\n * > | <a _b>\n * ^\n * > | <a b>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeName(code) {\n // ASCII alphanumerical and `-`, `.`, `:`, and `_`.\n if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return completeAttributeName;\n }\n return completeAttributeNameAfter(code);\n }\n\n /**\n * After attribute name, at an optional initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | <a b>\n * ^\n * > | <a b=c>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code);\n return completeAttributeValueBefore;\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeNameAfter;\n }\n return completeAttributeNameBefore(code);\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | <a b=c>\n * ^\n * > | <a b=\"c\">\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueBefore(code) {\n if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {\n return nok(code);\n }\n if (code === 34 || code === 39) {\n effects.consume(code);\n markerB = code;\n return completeAttributeValueQuoted;\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeValueBefore;\n }\n return completeAttributeValueUnquoted(code);\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | <a b=\"c\">\n * ^\n * > | <a b='c'>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueQuoted(code) {\n if (code === markerB) {\n effects.consume(code);\n markerB = null;\n return completeAttributeValueQuotedAfter;\n }\n if (code === null || markdownLineEnding(code)) {\n return nok(code);\n }\n effects.consume(code);\n return completeAttributeValueQuoted;\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | <a b=c>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueUnquoted(code) {\n if (code === null || code === 34 || code === 39 || code === 47 || code === 60 || code === 61 || code === 62 || code === 96 || markdownLineEndingOrSpace(code)) {\n return completeAttributeNameAfter(code);\n }\n effects.consume(code);\n return completeAttributeValueUnquoted;\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the\n * end of the tag.\n *\n * ```markdown\n * > | <a b=\"c\">\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownSpace(code)) {\n return completeAttributeNameBefore(code);\n }\n return nok(code);\n }\n\n /**\n * In certain circumstances of a complete tag where only an `>` is allowed.\n *\n * ```markdown\n * > | <a b=\"c\">\n * ^\n * ```\n *\n * @type {State}\n */\n function completeEnd(code) {\n if (code === 62) {\n effects.consume(code);\n return completeAfter;\n }\n return nok(code);\n }\n\n /**\n * After `>` in a complete tag.\n *\n * ```markdown\n * > | <x>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n // // Do not form containers.\n // tokenizer.concrete = true\n return continuation(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAfter;\n }\n return nok(code);\n }\n\n /**\n * In continuation of any HTML kind.\n *\n * ```markdown\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function continuation(code) {\n if (code === 45 && marker === 2) {\n effects.consume(code);\n return continuationCommentInside;\n }\n if (code === 60 && marker === 1) {\n effects.consume(code);\n return continuationRawTagOpen;\n }\n if (code === 62 && marker === 4) {\n effects.consume(code);\n return continuationClose;\n }\n if (code === 63 && marker === 3) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n if (code === 93 && marker === 5) {\n effects.consume(code);\n return continuationCdataInside;\n }\n if (markdownLineEnding(code) && (marker === 6 || marker === 7)) {\n effects.exit(\"htmlFlowData\");\n return effects.check(blankLineBefore, continuationAfter, continuationStart)(code);\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"htmlFlowData\");\n return continuationStart(code);\n }\n effects.consume(code);\n return continuation;\n }\n\n /**\n * In continuation, at eol.\n *\n * ```markdown\n * > | <x>\n * ^\n * | asd\n * ```\n *\n * @type {State}\n */\n function continuationStart(code) {\n return effects.check(nonLazyContinuation, continuationStartNonLazy, continuationAfter)(code);\n }\n\n /**\n * In continuation, at eol, before non-lazy content.\n *\n * ```markdown\n * > | <x>\n * ^\n * | asd\n * ```\n *\n * @type {State}\n */\n function continuationStartNonLazy(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return continuationBefore;\n }\n\n /**\n * In continuation, before non-lazy content.\n *\n * ```markdown\n * | <x>\n * > | asd\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return continuationStart(code);\n }\n effects.enter(\"htmlFlowData\");\n return continuation(code);\n }\n\n /**\n * In comment continuation, after one `-`, expecting another.\n *\n * ```markdown\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCommentInside(code) {\n if (code === 45) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In raw continuation, after `<`, at `/`.\n *\n * ```markdown\n * > | <script>console.log(1)</script>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationRawTagOpen(code) {\n if (code === 47) {\n effects.consume(code);\n buffer = '';\n return continuationRawEndTag;\n }\n return continuation(code);\n }\n\n /**\n * In raw continuation, after `</`, in a raw tag name.\n *\n * ```markdown\n * > | <script>console.log(1)</script>\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function continuationRawEndTag(code) {\n if (code === 62) {\n const name = buffer.toLowerCase();\n if (htmlRawNames.includes(name)) {\n effects.consume(code);\n return continuationClose;\n }\n return continuation(code);\n }\n if (asciiAlpha(code) && buffer.length < 8) {\n // Always the case.\n effects.consume(code);\n buffer += String.fromCharCode(code);\n return continuationRawEndTag;\n }\n return continuation(code);\n }\n\n /**\n * In cdata continuation, after `]`, expecting `]>`.\n *\n * ```markdown\n * > | <![CDATA[>&<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCdataInside(code) {\n if (code === 93) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In declaration or instruction continuation, at `>`.\n *\n * ```markdown\n * > | <!-->\n * ^\n * > | <?>\n * ^\n * > | <!q>\n * ^\n * > | <!--ab-->\n * ^\n * > | <![CDATA[>&<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationDeclarationInside(code) {\n if (code === 62) {\n effects.consume(code);\n return continuationClose;\n }\n\n // More dashes.\n if (code === 45 && marker === 2) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In closed continuation: everything we get until the eol/eof is part of it.\n *\n * ```markdown\n * > | <!doctype>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"htmlFlowData\");\n return continuationAfter(code);\n }\n effects.consume(code);\n return continuationClose;\n }\n\n /**\n * Done.\n *\n * ```markdown\n * > | <!doctype>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationAfter(code) {\n effects.exit(\"htmlFlow\");\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n // // No longer concrete.\n // tokenizer.concrete = false\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLineBefore(effects, ok, nok) {\n return start;\n\n /**\n * Before eol, expecting blank line.\n *\n * ```markdown\n * > | <div>\n * ^\n * |\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return effects.attempt(blankLine, ok, nok);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiAlphanumeric, asciiAlpha, markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const htmlText = {\n name: 'htmlText',\n tokenize: tokenizeHtmlText\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlText(effects, ok, nok) {\n const self = this;\n /** @type {NonNullable<Code> | undefined} */\n let marker;\n /** @type {number} */\n let index;\n /** @type {State} */\n let returnState;\n return start;\n\n /**\n * Start of HTML (text).\n *\n * ```markdown\n * > | a <b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"htmlText\");\n effects.enter(\"htmlTextData\");\n effects.consume(code);\n return open;\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | a <b> c\n * ^\n * > | a <!doctype> c\n * ^\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code);\n return declarationOpen;\n }\n if (code === 47) {\n effects.consume(code);\n return tagCloseStart;\n }\n if (code === 63) {\n effects.consume(code);\n return instruction;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagOpen;\n }\n return nok(code);\n }\n\n /**\n * After `<!`, at declaration, comment, or CDATA.\n *\n * ```markdown\n * > | a <!doctype> c\n * ^\n * > | a <!--b--> c\n * ^\n * > | a <![CDATA[>&<]]> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code);\n return commentOpenInside;\n }\n if (code === 91) {\n effects.consume(code);\n index = 0;\n return cdataOpenInside;\n }\n if (asciiAlpha(code)) {\n effects.consume(code);\n return declaration;\n }\n return nok(code);\n }\n\n /**\n * In a comment, after `<!-`, at another `-`.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code);\n return commentEnd;\n }\n return nok(code);\n }\n\n /**\n * In comment.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function comment(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 45) {\n effects.consume(code);\n return commentClose;\n }\n if (markdownLineEnding(code)) {\n returnState = comment;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return comment;\n }\n\n /**\n * In comment, after `-`.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentClose(code) {\n if (code === 45) {\n effects.consume(code);\n return commentEnd;\n }\n return comment(code);\n }\n\n /**\n * In comment, after `--`.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentEnd(code) {\n return code === 62 ? end(code) : code === 45 ? commentClose(code) : comment(code);\n }\n\n /**\n * After `<![`, in CDATA, expecting `CDATA[`.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = \"CDATA[\";\n if (code === value.charCodeAt(index++)) {\n effects.consume(code);\n return index === value.length ? cdata : cdataOpenInside;\n }\n return nok(code);\n }\n\n /**\n * In CDATA.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^^^\n * ```\n *\n * @type {State}\n */\n function cdata(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 93) {\n effects.consume(code);\n return cdataClose;\n }\n if (markdownLineEnding(code)) {\n returnState = cdata;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return cdata;\n }\n\n /**\n * In CDATA, after `]`, at another `]`.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataClose(code) {\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n return cdata(code);\n }\n\n /**\n * In CDATA, after `]]`, at `>`.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataEnd(code) {\n if (code === 62) {\n return end(code);\n }\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n return cdata(code);\n }\n\n /**\n * In declaration.\n *\n * ```markdown\n * > | a <!b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declaration(code) {\n if (code === null || code === 62) {\n return end(code);\n }\n if (markdownLineEnding(code)) {\n returnState = declaration;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return declaration;\n }\n\n /**\n * In instruction.\n *\n * ```markdown\n * > | a <?b?> c\n * ^\n * ```\n *\n * @type {State}\n */\n function instruction(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 63) {\n effects.consume(code);\n return instructionClose;\n }\n if (markdownLineEnding(code)) {\n returnState = instruction;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return instruction;\n }\n\n /**\n * In instruction, after `?`, at `>`.\n *\n * ```markdown\n * > | a <?b?> c\n * ^\n * ```\n *\n * @type {State}\n */\n function instructionClose(code) {\n return code === 62 ? end(code) : instruction(code);\n }\n\n /**\n * After `</`, in closing tag, at tag name.\n *\n * ```markdown\n * > | a </b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagClose;\n }\n return nok(code);\n }\n\n /**\n * After `</x`, in a tag name.\n *\n * ```markdown\n * > | a </b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagClose(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagClose;\n }\n return tagCloseBetween(code);\n }\n\n /**\n * In closing tag, after tag name.\n *\n * ```markdown\n * > | a </b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseBetween(code) {\n if (markdownLineEnding(code)) {\n returnState = tagCloseBetween;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagCloseBetween;\n }\n return end(code);\n }\n\n /**\n * After `<x`, in opening tag name.\n *\n * ```markdown\n * > | a <b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpen(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpen;\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n return nok(code);\n }\n\n /**\n * In opening tag, after tag name.\n *\n * ```markdown\n * > | a <b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenBetween(code) {\n if (code === 47) {\n effects.consume(code);\n return end;\n }\n\n // ASCII alphabetical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenBetween;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenBetween;\n }\n return end(code);\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | a <b c> d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeName(code) {\n // ASCII alphabetical and `-`, `.`, `:`, and `_`.\n if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n return tagOpenAttributeNameAfter(code);\n }\n\n /**\n * After attribute name, before initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | a <b c> d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeNameAfter;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeNameAfter;\n }\n return tagOpenBetween(code);\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | a <b c=d> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueBefore(code) {\n if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {\n return nok(code);\n }\n if (code === 34 || code === 39) {\n effects.consume(code);\n marker = code;\n return tagOpenAttributeValueQuoted;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueBefore;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n effects.consume(code);\n return tagOpenAttributeValueUnquoted;\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | a <b c=\"d\"> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuoted(code) {\n if (code === marker) {\n effects.consume(code);\n marker = undefined;\n return tagOpenAttributeValueQuotedAfter;\n }\n if (code === null) {\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueQuoted;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return tagOpenAttributeValueQuoted;\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | a <b c=d> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueUnquoted(code) {\n if (code === null || code === 34 || code === 39 || code === 60 || code === 61 || code === 96) {\n return nok(code);\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n effects.consume(code);\n return tagOpenAttributeValueUnquoted;\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the end\n * of the tag.\n *\n * ```markdown\n * > | a <b c=\"d\"> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n return nok(code);\n }\n\n /**\n * In certain circumstances of a tag where only an `>` is allowed.\n *\n * ```markdown\n * > | a <b c=\"d\"> e\n * ^\n * ```\n *\n * @type {State}\n */\n function end(code) {\n if (code === 62) {\n effects.consume(code);\n effects.exit(\"htmlTextData\");\n effects.exit(\"htmlText\");\n return ok;\n }\n return nok(code);\n }\n\n /**\n * At eol.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * > | a <!--a\n * ^\n * | b-->\n * ```\n *\n * @type {State}\n */\n function lineEndingBefore(code) {\n effects.exit(\"htmlTextData\");\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return lineEndingAfter;\n }\n\n /**\n * After eol, at optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a <!--a\n * > | b-->\n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfter(code) {\n // Always populated by defaults.\n\n return markdownSpace(code) ? factorySpace(effects, lineEndingAfterPrefix, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code) : lineEndingAfterPrefix(code);\n }\n\n /**\n * After eol, after optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a <!--a\n * > | b-->\n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfterPrefix(code) {\n effects.enter(\"htmlTextData\");\n return returnState(code);\n }\n}","/**\n * @import {\n * Construct,\n * Event,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factoryDestination } from 'micromark-factory-destination';\nimport { factoryLabel } from 'micromark-factory-label';\nimport { factoryTitle } from 'micromark-factory-title';\nimport { factoryWhitespace } from 'micromark-factory-whitespace';\nimport { markdownLineEndingOrSpace } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const labelEnd = {\n name: 'labelEnd',\n resolveAll: resolveAllLabelEnd,\n resolveTo: resolveToLabelEnd,\n tokenize: tokenizeLabelEnd\n};\n\n/** @type {Construct} */\nconst resourceConstruct = {\n tokenize: tokenizeResource\n};\n/** @type {Construct} */\nconst referenceFullConstruct = {\n tokenize: tokenizeReferenceFull\n};\n/** @type {Construct} */\nconst referenceCollapsedConstruct = {\n tokenize: tokenizeReferenceCollapsed\n};\n\n/** @type {Resolver} */\nfunction resolveAllLabelEnd(events) {\n let index = -1;\n /** @type {Array<Event>} */\n const newEvents = [];\n while (++index < events.length) {\n const token = events[index][1];\n newEvents.push(events[index]);\n if (token.type === \"labelImage\" || token.type === \"labelLink\" || token.type === \"labelEnd\") {\n // Remove the marker.\n const offset = token.type === \"labelImage\" ? 4 : 2;\n token.type = \"data\";\n index += offset;\n }\n }\n\n // If the events are equal, we don't have to copy newEvents to events\n if (events.length !== newEvents.length) {\n splice(events, 0, events.length, newEvents);\n }\n return events;\n}\n\n/** @type {Resolver} */\nfunction resolveToLabelEnd(events, context) {\n let index = events.length;\n let offset = 0;\n /** @type {number | undefined} */\n let open;\n /** @type {number | undefined} */\n let close;\n /** @type {Array<Event>} */\n let media;\n\n // Find an opening.\n while (index--) {\n const token = events[index][1];\n if (open) {\n // If we see another link, or inactive link label, we’ve been here before.\n if (token.type === \"link\" || token.type === \"labelLink\" && token._inactive) {\n break;\n }\n\n // Mark other link openings as inactive, as we can’t have links in\n // links.\n if (events[index][0] === 'enter' && token.type === \"labelLink\") {\n token._inactive = true;\n }\n } else if (close) {\n if (events[index][0] === 'enter' && (token.type === \"labelImage\" || token.type === \"labelLink\") && !token._balanced) {\n open = index;\n if (token.type !== \"labelLink\") {\n offset = 2;\n break;\n }\n }\n } else if (token.type === \"labelEnd\") {\n close = index;\n }\n }\n const group = {\n type: events[open][1].type === \"labelLink\" ? \"link\" : \"image\",\n start: {\n ...events[open][1].start\n },\n end: {\n ...events[events.length - 1][1].end\n }\n };\n const label = {\n type: \"label\",\n start: {\n ...events[open][1].start\n },\n end: {\n ...events[close][1].end\n }\n };\n const text = {\n type: \"labelText\",\n start: {\n ...events[open + offset + 2][1].end\n },\n end: {\n ...events[close - 2][1].start\n }\n };\n media = [['enter', group, context], ['enter', label, context]];\n\n // Opening marker.\n media = push(media, events.slice(open + 1, open + offset + 3));\n\n // Text open.\n media = push(media, [['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n media = push(media, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + offset + 4, close - 3), context));\n\n // Text close, marker close, label close.\n media = push(media, [['exit', text, context], events[close - 2], events[close - 1], ['exit', label, context]]);\n\n // Reference, resource, or so.\n media = push(media, events.slice(close + 1));\n\n // Media close.\n media = push(media, [['exit', group, context]]);\n splice(events, open, events.length, media);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelEnd(effects, ok, nok) {\n const self = this;\n const labelStarts = self._labelStarts;\n /** @type {Token} */\n let labelStart;\n /** @type {boolean} */\n let defined;\n if (labelStarts) {\n // Discard ones that failed to close,\n // they’re not needed anymore.\n while (labelStarts.length > 0 && labelStarts[labelStarts.length - 1]._balanced) {\n labelStarts.pop();\n }\n labelStart = labelStarts[labelStarts.length - 1];\n }\n return start;\n\n /**\n * Start of label end.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // If there is not an okay opening.\n if (!labelStart) {\n return nok(code);\n }\n\n // If the corresponding label (link) start is marked as inactive,\n // it means we’d be wrapping a link, like this:\n //\n // ```markdown\n // > | a [b [c](d) e](f) g.\n // ^\n // ```\n //\n // We can’t have that, so it’s just balanced brackets.\n if (labelStart._inactive) {\n return labelEndNok(code);\n }\n defined = self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })));\n effects.enter(\"labelEnd\");\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n effects.exit(\"labelEnd\");\n return after;\n }\n\n /**\n * After `]`.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Note: `markdown-rs` also parses GFM footnotes here, which for us is in\n // an extension.\n\n // Resource (`[asd](fgh)`)?\n if (code === 40) {\n return effects.attempt(resourceConstruct, labelEndOk, defined ? labelEndOk : labelEndNok)(code);\n }\n\n // Full (`[asd][fgh]`) or collapsed (`[asd][]`) reference?\n if (code === 91) {\n return effects.attempt(referenceFullConstruct, labelEndOk, defined ? referenceNotFull : labelEndNok)(code);\n }\n\n // Shortcut (`[asd]`) reference?\n return defined ? labelEndOk(code) : labelEndNok(code);\n }\n\n /**\n * After `]`, at `[`, but not at a full reference.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceNotFull(code) {\n return effects.attempt(referenceCollapsedConstruct, labelEndOk, labelEndNok)(code);\n }\n\n /**\n * Done, we found something.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndOk(code) {\n // Note: `markdown-rs` does a bunch of stuff here.\n // This label start is now used up: discard it so it’s never found again.\n\n labelStarts.pop();\n return ok(code);\n }\n\n /**\n * Done, it’s nothing.\n *\n * There was an okay opening, but we didn’t match anything.\n *\n * ```markdown\n * > | [a](b c\n * ^\n * > | [a][b c\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndNok(code) {\n labelStart._balanced = true;\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeResource(effects, ok, nok) {\n return resourceStart;\n\n /**\n * At a resource.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceStart(code) {\n effects.enter(\"resource\");\n effects.enter(\"resourceMarker\");\n effects.consume(code);\n effects.exit(\"resourceMarker\");\n return resourceBefore;\n }\n\n /**\n * In resource, after `(`, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBefore(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceOpen)(code) : resourceOpen(code);\n }\n\n /**\n * In resource, after optional whitespace, at `)` or a destination.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceOpen(code) {\n if (code === 41) {\n return resourceEnd(code);\n }\n return factoryDestination(effects, resourceDestinationAfter, resourceDestinationMissing, \"resourceDestination\", \"resourceDestinationLiteral\", \"resourceDestinationLiteralMarker\", \"resourceDestinationRaw\", \"resourceDestinationString\", 32)(code);\n }\n\n /**\n * In resource, after destination, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationAfter(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceBetween)(code) : resourceEnd(code);\n }\n\n /**\n * At invalid destination.\n *\n * ```markdown\n * > | [a](<<) b\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationMissing(code) {\n return nok(code);\n }\n\n /**\n * In resource, after destination and whitespace, at `(` or title.\n *\n * ```markdown\n * > | [a](b ) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBetween(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(effects, resourceTitleAfter, nok, \"resourceTitle\", \"resourceTitleMarker\", \"resourceTitleString\")(code);\n }\n return resourceEnd(code);\n }\n\n /**\n * In resource, after title, at optional whitespace.\n *\n * ```markdown\n * > | [a](b \"c\") d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceTitleAfter(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceEnd)(code) : resourceEnd(code);\n }\n\n /**\n * In resource, at `)`.\n *\n * ```markdown\n * > | [a](b) d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceEnd(code) {\n if (code === 41) {\n effects.enter(\"resourceMarker\");\n effects.consume(code);\n effects.exit(\"resourceMarker\");\n effects.exit(\"resource\");\n return ok;\n }\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceFull(effects, ok, nok) {\n const self = this;\n return referenceFull;\n\n /**\n * In a reference (full), at the `[`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFull(code) {\n return factoryLabel.call(self, effects, referenceFullAfter, referenceFullMissing, \"reference\", \"referenceMarker\", \"referenceString\")(code);\n }\n\n /**\n * In a reference (full), after `]`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullAfter(code) {\n return self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1))) ? ok(code) : nok(code);\n }\n\n /**\n * In reference (full) that was missing.\n *\n * ```markdown\n * > | [a][b d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullMissing(code) {\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceCollapsed(effects, ok, nok) {\n return referenceCollapsedStart;\n\n /**\n * In reference (collapsed), at `[`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedStart(code) {\n // We only attempt a collapsed label if there’s a `[`.\n\n effects.enter(\"reference\");\n effects.enter(\"referenceMarker\");\n effects.consume(code);\n effects.exit(\"referenceMarker\");\n return referenceCollapsedOpen;\n }\n\n /**\n * In reference (collapsed), at `]`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedOpen(code) {\n if (code === 93) {\n effects.enter(\"referenceMarker\");\n effects.consume(code);\n effects.exit(\"referenceMarker\");\n effects.exit(\"reference\");\n return ok;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * Token,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { labelEnd } from './label-end.js';\n\n/** @type {Construct} */\nexport const labelStartImage = {\n name: 'labelStartImage',\n resolveAll: labelEnd.resolveAll,\n tokenize: tokenizeLabelStartImage\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartImage(effects, ok, nok) {\n const self = this;\n /** @type {Token} */\n let labelImage;\n return start;\n\n /**\n * Start of label (image) start.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"labelImage\");\n effects.enter(\"labelImageMarker\");\n effects.consume(code);\n effects.exit(\"labelImageMarker\");\n return open;\n }\n\n /**\n * After `!`, at `[`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 91) {\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n labelImage = effects.exit(\"labelImage\");\n return after;\n }\n return nok(code);\n }\n\n /**\n * After `![`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * This is needed in because, when GFM footnotes are enabled, images never\n * form when started with a `^`.\n * Instead, links form:\n *\n * ```markdown\n * \n *\n * ![^a][b]\n *\n * [b]: c\n * ```\n *\n * ```html\n * <p>!<a href=\\\"b\\\">^a</a></p>\n * <p>!<a href=\\\"c\\\">^a</a></p>\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // To do: use a new field to do this, this is still needed for\n // `micromark-extension-gfm-footnote`, but the `label-start-link`\n // behavior isn’t.\n // Hidden footnotes hook.\n /* c8 ignore next 6 */\n if (code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs) {\n return nok(code);\n }\n self._labelStarts = self._labelStarts || [];\n self._labelStarts.push(labelImage);\n return ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * Token,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { labelEnd } from './label-end.js';\n\n/** @type {Construct} */\nexport const labelStartLink = {\n name: 'labelStartLink',\n resolveAll: labelEnd.resolveAll,\n tokenize: tokenizeLabelStartLink\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartLink(effects, ok, nok) {\n const self = this;\n /** @type {Token} */\n let labelLink;\n return start;\n\n /**\n * Start of label (link) start.\n *\n * ```markdown\n * > | a [b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"labelLink\");\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n labelLink = effects.exit(\"labelLink\");\n return after;\n }\n\n /** @type {State} */\n function after(code) {\n // To do: this isn’t needed in `micromark-extension-gfm-footnote`,\n // remove.\n // Hidden footnotes hook.\n /* c8 ignore next 6 */\n if (code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs) {\n return nok(code);\n }\n self._labelStarts = self._labelStarts || [];\n self._labelStarts.push(labelLink);\n return ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const lineEnding = {\n name: 'lineEnding',\n tokenize: tokenizeLineEnding\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLineEnding(effects, ok) {\n return start;\n\n /** @type {State} */\n function start(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, ok, \"linePrefix\");\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const thematicBreak = {\n name: 'thematicBreak',\n tokenize: tokenizeThematicBreak\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeThematicBreak(effects, ok, nok) {\n let size = 0;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of thematic break.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"thematicBreak\");\n // To do: parse indent like `markdown-rs`.\n return before(code);\n }\n\n /**\n * After optional whitespace, at marker.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n marker = code;\n return atBreak(code);\n }\n\n /**\n * After something, before something else.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === marker) {\n effects.enter(\"thematicBreakSequence\");\n return sequence(code);\n }\n if (size >= 3 && (code === null || markdownLineEnding(code))) {\n effects.exit(\"thematicBreak\");\n return ok(code);\n }\n return nok(code);\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function sequence(code) {\n if (code === marker) {\n effects.consume(code);\n size++;\n return sequence;\n }\n effects.exit(\"thematicBreakSequence\");\n return markdownSpace(code) ? factorySpace(effects, atBreak, \"whitespace\")(code) : atBreak(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * Exiter,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiDigit, markdownSpace } from 'micromark-util-character';\nimport { blankLine } from './blank-line.js';\nimport { thematicBreak } from './thematic-break.js';\n\n/** @type {Construct} */\nexport const list = {\n continuation: {\n tokenize: tokenizeListContinuation\n },\n exit: tokenizeListEnd,\n name: 'list',\n tokenize: tokenizeListStart\n};\n\n/** @type {Construct} */\nconst listItemPrefixWhitespaceConstruct = {\n partial: true,\n tokenize: tokenizeListItemPrefixWhitespace\n};\n\n/** @type {Construct} */\nconst indentConstruct = {\n partial: true,\n tokenize: tokenizeIndent\n};\n\n// To do: `markdown-rs` parses list items on their own and later stitches them\n// together.\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListStart(effects, ok, nok) {\n const self = this;\n const tail = self.events[self.events.length - 1];\n let initialSize = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n const kind = self.containerState.type || (code === 42 || code === 43 || code === 45 ? \"listUnordered\" : \"listOrdered\");\n if (kind === \"listUnordered\" ? !self.containerState.marker || code === self.containerState.marker : asciiDigit(code)) {\n if (!self.containerState.type) {\n self.containerState.type = kind;\n effects.enter(kind, {\n _container: true\n });\n }\n if (kind === \"listUnordered\") {\n effects.enter(\"listItemPrefix\");\n return code === 42 || code === 45 ? effects.check(thematicBreak, nok, atMarker)(code) : atMarker(code);\n }\n if (!self.interrupt || code === 49) {\n effects.enter(\"listItemPrefix\");\n effects.enter(\"listItemValue\");\n return inside(code);\n }\n }\n return nok(code);\n }\n\n /** @type {State} */\n function inside(code) {\n if (asciiDigit(code) && ++size < 10) {\n effects.consume(code);\n return inside;\n }\n if ((!self.interrupt || size < 2) && (self.containerState.marker ? code === self.containerState.marker : code === 41 || code === 46)) {\n effects.exit(\"listItemValue\");\n return atMarker(code);\n }\n return nok(code);\n }\n\n /**\n * @type {State}\n **/\n function atMarker(code) {\n effects.enter(\"listItemMarker\");\n effects.consume(code);\n effects.exit(\"listItemMarker\");\n self.containerState.marker = self.containerState.marker || code;\n return effects.check(blankLine,\n // Can’t be empty when interrupting.\n self.interrupt ? nok : onBlank, effects.attempt(listItemPrefixWhitespaceConstruct, endOfPrefix, otherPrefix));\n }\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.initialBlankLine = true;\n initialSize++;\n return endOfPrefix(code);\n }\n\n /** @type {State} */\n function otherPrefix(code) {\n if (markdownSpace(code)) {\n effects.enter(\"listItemPrefixWhitespace\");\n effects.consume(code);\n effects.exit(\"listItemPrefixWhitespace\");\n return endOfPrefix;\n }\n return nok(code);\n }\n\n /** @type {State} */\n function endOfPrefix(code) {\n self.containerState.size = initialSize + self.sliceSerialize(effects.exit(\"listItemPrefix\"), true).length;\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListContinuation(effects, ok, nok) {\n const self = this;\n self.containerState._closeFlow = undefined;\n return effects.check(blankLine, onBlank, notBlank);\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.furtherBlankLines = self.containerState.furtherBlankLines || self.containerState.initialBlankLine;\n\n // We have a blank line.\n // Still, try to consume at most the items size.\n return factorySpace(effects, ok, \"listItemIndent\", self.containerState.size + 1)(code);\n }\n\n /** @type {State} */\n function notBlank(code) {\n if (self.containerState.furtherBlankLines || !markdownSpace(code)) {\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return notInCurrentItem(code);\n }\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return effects.attempt(indentConstruct, ok, notInCurrentItem)(code);\n }\n\n /** @type {State} */\n function notInCurrentItem(code) {\n // While we do continue, we signal that the flow should be closed.\n self.containerState._closeFlow = true;\n // As we’re closing flow, we’re no longer interrupting.\n self.interrupt = undefined;\n // Always populated by defaults.\n\n return factorySpace(effects, effects.attempt(list, ok, nok), \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this;\n return factorySpace(effects, afterPrefix, \"listItemIndent\", self.containerState.size + 1);\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return tail && tail[1].type === \"listItemIndent\" && tail[2].sliceSerialize(tail[1], true).length === self.containerState.size ? ok(code) : nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Exiter}\n */\nfunction tokenizeListEnd(effects) {\n effects.exit(this.containerState.type);\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListItemPrefixWhitespace(effects, ok, nok) {\n const self = this;\n\n // Always populated by defaults.\n\n return factorySpace(effects, afterPrefix, \"listItemPrefixWhitespace\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4 + 1);\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return !markdownSpace(code) && tail && tail[1].type === \"listItemPrefixWhitespace\" ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { EditMap } from 'micromark-util-edit-map';\n/** @type {Construct} */\nexport const setextUnderline = {\n name: 'setextUnderline',\n resolveTo: resolveToSetextUnderline,\n tokenize: tokenizeSetextUnderline\n};\n\n/** @type {Resolver} */\nfunction resolveToSetextUnderline(events, context) {\n const editMap = new EditMap();\n let index = events.length;\n /** @type {number | undefined} */\n let content;\n /** @type {number | undefined} */\n let text;\n /** @type {number | undefined} */\n let definition;\n\n // Find the opening of the content.\n // It’ll always exist: we don’t tokenize if it isn’t there.\n while (index--) {\n if (events[index][0] === 'enter') {\n if (events[index][1].type === \"content\") {\n content = index;\n break;\n }\n if (events[index][1].type === \"paragraph\") {\n text = index;\n }\n }\n // Exit\n else {\n if (events[index][1].type === \"content\") {\n // Remove the content end (if needed we’ll add it later)\n editMap.add(index, 1, []);\n }\n if (!definition && events[index][1].type === \"definition\") {\n definition = index;\n }\n }\n }\n const heading = {\n type: \"setextHeading\",\n start: {\n ...events[content][1].start\n },\n end: {\n ...events[events.length - 1][1].end\n }\n };\n\n // Change the paragraph to setext heading text.\n events[text][1].type = \"setextHeadingText\";\n\n // If we have definitions in the content, we’ll keep on having content,\n // but we need move it.\n if (definition) {\n editMap.add(text, 0, [['enter', heading, context]]);\n editMap.add(definition + 1, 0, [['exit', events[content][1], context]]);\n events[content][1].end = {\n ...events[definition][1].end\n };\n } else {\n events[content][1] = heading;\n }\n\n // Add the heading exit at the end.\n editMap.add(events.length, 0, [['exit', heading, context]]);\n editMap.consume(events);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeSetextUnderline(effects, ok, nok) {\n const self = this;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * At start of heading (setext) underline.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n let index = self.events.length;\n /** @type {boolean | undefined} */\n let paragraph;\n // Find an opening.\n while (index--) {\n // Skip enter/exit of line ending, line prefix, and content.\n // We can now either have a definition or a paragraph.\n if (self.events[index][1].type !== \"lineEnding\" && self.events[index][1].type !== \"linePrefix\" && self.events[index][1].type !== \"content\") {\n paragraph = self.events[index][1].type === \"paragraph\";\n break;\n }\n }\n\n // To do: handle lazy/pierce like `markdown-rs`.\n // To do: parse indent like `markdown-rs`.\n if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) {\n effects.enter(\"setextHeadingLine\");\n marker = code;\n return before(code);\n }\n return nok(code);\n }\n\n /**\n * After optional whitespace, at `-` or `=`.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"setextHeadingLineSequence\");\n return inside(code);\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n effects.exit(\"setextHeadingLineSequence\");\n return markdownSpace(code) ? factorySpace(effects, after, \"lineSuffix\")(code) : after(code);\n }\n\n /**\n * After sequence, after optional whitespace.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"setextHeadingLine\");\n return ok(code);\n }\n return nok(code);\n }\n}","/**\n * @import {\n * InitialConstruct,\n * Initializer,\n * State,\n * TokenizeContext\n * } from 'micromark-util-types'\n */\n\nimport { blankLine, content } from 'micromark-core-commonmark';\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {InitialConstruct} */\nexport const flow = {\n tokenize: initializeFlow\n};\n\n/**\n * @this {TokenizeContext}\n * Self.\n * @type {Initializer}\n * Initializer.\n */\nfunction initializeFlow(effects) {\n const self = this;\n const initial = effects.attempt(\n // Try to parse a blank line.\n blankLine, atBlankEnding,\n // Try to parse initial flow (essentially, only code).\n effects.attempt(this.parser.constructs.flowInitial, afterConstruct, factorySpace(effects, effects.attempt(this.parser.constructs.flow, afterConstruct, effects.attempt(content, afterConstruct)), \"linePrefix\")));\n return initial;\n\n /** @type {State} */\n function atBlankEnding(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEndingBlank\");\n effects.consume(code);\n effects.exit(\"lineEndingBlank\");\n self.currentConstruct = undefined;\n return initial;\n }\n\n /** @type {State} */\n function afterConstruct(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n self.currentConstruct = undefined;\n return initial;\n }\n}","/**\n * @import {\n * Code,\n * InitialConstruct,\n * Initializer,\n * Resolver,\n * State,\n * TokenizeContext\n * } from 'micromark-util-types'\n */\n\nimport { EditMap } from 'micromark-util-edit-map';\nexport const resolver = {\n resolveAll: createResolver()\n};\nexport const string = initializeFactory('string');\nexport const text = initializeFactory('text');\n\n/**\n * @param {'string' | 'text'} field\n * Field.\n * @returns {InitialConstruct}\n * Construct.\n */\nfunction initializeFactory(field) {\n return {\n resolveAll: createResolver(field === 'text' ? resolveAllLineSuffixes : undefined),\n tokenize: initializeText\n };\n\n /**\n * @this {TokenizeContext}\n * Context.\n * @type {Initializer}\n */\n function initializeText(effects) {\n const self = this;\n const constructs = this.parser.constructs[field];\n const text = effects.attempt(constructs, start, notText);\n return start;\n\n /** @type {State} */\n function start(code) {\n return atBreak(code) ? text(code) : notText(code);\n }\n\n /** @type {State} */\n function notText(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"data\");\n effects.consume(code);\n return data;\n }\n\n /** @type {State} */\n function data(code) {\n if (atBreak(code)) {\n effects.exit(\"data\");\n return text(code);\n }\n\n // Data.\n effects.consume(code);\n return data;\n }\n\n /**\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether the code is a break.\n */\n function atBreak(code) {\n if (code === null) {\n return true;\n }\n const list = constructs[code];\n let index = -1;\n if (list) {\n // Always populated by defaults.\n\n while (++index < list.length) {\n const item = list[index];\n if (!item.previous || item.previous.call(self, self.previous)) {\n return true;\n }\n }\n }\n return false;\n }\n }\n}\n\n/**\n * @param {Resolver | undefined} [extraResolver]\n * Resolver.\n * @returns {Resolver}\n * Resolver.\n */\nfunction createResolver(extraResolver) {\n return resolveAllText;\n\n /** @type {Resolver} */\n function resolveAllText(events, context) {\n let index = -1;\n /** @type {number | undefined} */\n let enter;\n\n // A rather boring computation (to merge adjacent `data` events) which\n // improves mm performance by 29%.\n while (++index <= events.length) {\n if (enter === undefined) {\n if (events[index] && events[index][1].type === \"data\") {\n enter = index;\n index++;\n }\n } else if (!events[index] || events[index][1].type !== \"data\") {\n // Don’t do anything if there is one data token.\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n index = enter + 2;\n }\n enter = undefined;\n }\n }\n return extraResolver ? extraResolver(events, context) : events;\n }\n}\n\n/**\n * A rather ugly set of instructions which again looks at chunks in the input\n * stream.\n * The reason to do this here is that it is *much* faster to parse in reverse.\n * And that we can’t hook into `null` to split the line suffix before an EOF.\n * To do: figure out if we can make this into a clean utility, or even in core.\n * As it will be useful for GFMs literal autolink extension (and maybe even\n * tables?)\n *\n * @type {Resolver}\n */\nfunction resolveAllLineSuffixes(events, context) {\n const editMap = new EditMap();\n let eventIndex = 0; // Skip first.\n\n while (++eventIndex <= events.length) {\n if ((eventIndex === events.length || events[eventIndex][1].type === \"lineEnding\") && events[eventIndex - 1][1].type === \"data\") {\n const data = events[eventIndex - 1][1];\n const chunks = context.sliceStream(data);\n let index = chunks.length;\n let bufferIndex = -1;\n let size = 0;\n /** @type {boolean | undefined} */\n let tabs;\n while (index--) {\n const chunk = chunks[index];\n if (typeof chunk === 'string') {\n bufferIndex = chunk.length;\n while (chunk.charCodeAt(bufferIndex - 1) === 32) {\n size++;\n bufferIndex--;\n }\n if (bufferIndex) {\n break;\n }\n bufferIndex = -1;\n }\n // Number\n else if (chunk === -2) {\n tabs = true;\n size++;\n } else if (chunk === -1) {\n // Empty\n } else {\n // Replacement character, exit.\n index++;\n break;\n }\n }\n\n // Allow final trailing whitespace.\n if (context._contentTypeTextTrailing && eventIndex === events.length) {\n size = 0;\n }\n if (size) {\n const token = {\n type: eventIndex === events.length || tabs || size < 2 ? \"lineSuffix\" : \"hardBreakTrailing\",\n start: {\n _bufferIndex: index ? bufferIndex : data.start._bufferIndex + bufferIndex,\n _index: data.start._index + index,\n line: data.end.line,\n column: data.end.column - size,\n offset: data.end.offset - size\n },\n end: {\n ...data.end\n }\n };\n data.end = {\n ...token.start\n };\n if (data.start.offset === data.end.offset) {\n Object.assign(data, token);\n } else {\n editMap.add(eventIndex, 0, [['enter', token, context], ['exit', token, context]]);\n }\n }\n eventIndex++;\n }\n }\n editMap.consume(events);\n return events;\n}","/**\n * @import {Extension} from 'micromark-util-types'\n */\n\nimport { attention, autolink, blockQuote, characterEscape, characterReference, codeFenced, codeIndented, codeText, definition, hardBreakEscape, headingAtx, htmlFlow, htmlText, labelEnd, labelStartImage, labelStartLink, lineEnding, list, setextUnderline, thematicBreak } from 'micromark-core-commonmark';\nimport { resolver as resolveText } from './initialize/text.js';\n\n/** @satisfies {Extension['document']} */\nexport const document = {\n [42]: list,\n [43]: list,\n [45]: list,\n [48]: list,\n [49]: list,\n [50]: list,\n [51]: list,\n [52]: list,\n [53]: list,\n [54]: list,\n [55]: list,\n [56]: list,\n [57]: list,\n [62]: blockQuote\n};\n\n/** @satisfies {Extension['contentInitial']} */\nexport const contentInitial = {\n [91]: definition\n};\n\n/** @satisfies {Extension['flowInitial']} */\nexport const flowInitial = {\n [-2]: codeIndented,\n [-1]: codeIndented,\n [32]: codeIndented\n};\n\n/** @satisfies {Extension['flow']} */\nexport const flow = {\n [35]: headingAtx,\n [42]: thematicBreak,\n [45]: [setextUnderline, thematicBreak],\n [60]: htmlFlow,\n [61]: setextUnderline,\n [95]: thematicBreak,\n [96]: codeFenced,\n [126]: codeFenced\n};\n\n/** @satisfies {Extension['string']} */\nexport const string = {\n [38]: characterReference,\n [92]: characterEscape\n};\n\n/** @satisfies {Extension['text']} */\nexport const text = {\n [-5]: lineEnding,\n [-4]: lineEnding,\n [-3]: lineEnding,\n [33]: labelStartImage,\n [38]: characterReference,\n [42]: attention,\n [60]: [autolink, htmlText],\n [91]: labelStartLink,\n [92]: [hardBreakEscape, characterEscape],\n [93]: labelEnd,\n [95]: attention,\n [96]: codeText\n};\n\n/** @satisfies {Extension['insideSpan']} */\nexport const insideSpan = {\n null: [attention, resolveText]\n};\n\n/** @satisfies {Extension['attentionMarkers']} */\nexport const attentionMarkers = {\n null: [42, 95]\n};\n\n/** @satisfies {Extension['disable']} */\nexport const disable = {\n null: []\n};","/**\n * @import {\n * Chunk,\n * Code,\n * ConstructRecord,\n * Construct,\n * Effects,\n * InitialConstruct,\n * ParseContext,\n * Point,\n * State,\n * TokenizeContext,\n * Token\n * } from 'micromark-util-types'\n */\n\n/**\n * @callback Restore\n * Restore the state.\n * @returns {undefined}\n * Nothing.\n *\n * @typedef Info\n * Info.\n * @property {Restore} restore\n * Restore.\n * @property {number} from\n * From.\n *\n * @callback ReturnHandle\n * Handle a successful run.\n * @param {Construct} construct\n * Construct.\n * @param {Info} info\n * Info.\n * @returns {undefined}\n * Nothing.\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/**\n * Create a tokenizer.\n * Tokenizers deal with one type of data (e.g., containers, flow, text).\n * The parser is the object dealing with it all.\n * `initialize` works like other constructs, except that only its `tokenize`\n * function is used, in which case it doesn’t receive an `ok` or `nok`.\n * `from` can be given to set the point before the first character, although\n * when further lines are indented, they must be set with `defineSkip`.\n *\n * @param {ParseContext} parser\n * Parser.\n * @param {InitialConstruct} initialize\n * Construct.\n * @param {Omit<Point, '_bufferIndex' | '_index'> | undefined} [from]\n * Point (optional).\n * @returns {TokenizeContext}\n * Context.\n */\nexport function createTokenizer(parser, initialize, from) {\n /** @type {Point} */\n let point = {\n _bufferIndex: -1,\n _index: 0,\n line: from && from.line || 1,\n column: from && from.column || 1,\n offset: from && from.offset || 0\n };\n /** @type {Record<string, number>} */\n const columnStart = {};\n /** @type {Array<Construct>} */\n const resolveAllConstructs = [];\n /** @type {Array<Chunk>} */\n let chunks = [];\n /** @type {Array<Token>} */\n let stack = [];\n /** @type {boolean | undefined} */\n let consumed = true;\n\n /**\n * Tools used for tokenizing.\n *\n * @type {Effects}\n */\n const effects = {\n attempt: constructFactory(onsuccessfulconstruct),\n check: constructFactory(onsuccessfulcheck),\n consume,\n enter,\n exit,\n interrupt: constructFactory(onsuccessfulcheck, {\n interrupt: true\n })\n };\n\n /**\n * State and tools for resolving and serializing.\n *\n * @type {TokenizeContext}\n */\n const context = {\n code: null,\n containerState: {},\n defineSkip,\n events: [],\n now,\n parser,\n previous: null,\n sliceSerialize,\n sliceStream,\n write\n };\n\n /**\n * The state function.\n *\n * @type {State | undefined}\n */\n let state = initialize.tokenize.call(context, effects);\n\n /**\n * Track which character we expect to be consumed, to catch bugs.\n *\n * @type {Code}\n */\n let expectedCode;\n if (initialize.resolveAll) {\n resolveAllConstructs.push(initialize);\n }\n return context;\n\n /** @type {TokenizeContext['write']} */\n function write(slice) {\n chunks = push(chunks, slice);\n main();\n\n // Exit if we’re not done, resolve might change stuff.\n if (chunks[chunks.length - 1] !== null) {\n return [];\n }\n addResult(initialize, 0);\n\n // Otherwise, resolve, and exit.\n context.events = resolveAll(resolveAllConstructs, context.events, context);\n return context.events;\n }\n\n //\n // Tools.\n //\n\n /** @type {TokenizeContext['sliceSerialize']} */\n function sliceSerialize(token, expandTabs) {\n return serializeChunks(sliceStream(token), expandTabs);\n }\n\n /** @type {TokenizeContext['sliceStream']} */\n function sliceStream(token) {\n return sliceChunks(chunks, token);\n }\n\n /** @type {TokenizeContext['now']} */\n function now() {\n // This is a hot path, so we clone manually instead of `Object.assign({}, point)`\n const {\n _bufferIndex,\n _index,\n line,\n column,\n offset\n } = point;\n return {\n _bufferIndex,\n _index,\n line,\n column,\n offset\n };\n }\n\n /** @type {TokenizeContext['defineSkip']} */\n function defineSkip(value) {\n columnStart[value.line] = value.column;\n accountForPotentialSkip();\n }\n\n //\n // State management.\n //\n\n /**\n * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by\n * `consume`).\n * Here is where we walk through the chunks, which either include strings of\n * several characters, or numerical character codes.\n * The reason to do this in a loop instead of a call is so the stack can\n * drain.\n *\n * @returns {undefined}\n * Nothing.\n */\n function main() {\n while (point._index < chunks.length) {\n const chunk = chunks[point._index];\n\n // If we’re in a buffer chunk, loop through it.\n if (typeof chunk === 'string') {\n const chunkIndex = point._index;\n if (point._bufferIndex < 0) {\n point._bufferIndex = 0;\n }\n while (point._index === chunkIndex && point._bufferIndex < chunk.length) {\n go(chunk.charCodeAt(point._bufferIndex));\n }\n } else {\n go(chunk);\n }\n }\n }\n\n /**\n * Deal with one code.\n *\n * @param {Code} code\n * Code.\n * @returns {undefined}\n * Nothing.\n */\n function go(code) {\n consumed = undefined;\n expectedCode = code;\n state = state(code);\n }\n\n /** @type {Effects['consume']} */\n function consume(code) {\n if (markdownLineEnding(code)) {\n point.line++;\n point.column = 1;\n point.offset += code === -3 ? 2 : 1;\n accountForPotentialSkip();\n } else if (code !== -1) {\n point.column++;\n point.offset++;\n }\n\n // Not in a string chunk.\n if (point._bufferIndex < 0) {\n point._index++;\n } else {\n point._bufferIndex++;\n\n // At end of string chunk.\n if (point._bufferIndex ===\n // Points w/ non-negative `_bufferIndex` reference\n // strings.\n /** @type {string} */\n chunks[point._index].length) {\n point._bufferIndex = -1;\n point._index++;\n }\n }\n\n // Expose the previous character.\n context.previous = code;\n\n // Mark as consumed.\n consumed = true;\n }\n\n /** @type {Effects['enter']} */\n function enter(type, fields) {\n /** @type {Token} */\n // @ts-expect-error Patch instead of assign required fields to help GC.\n const token = fields || {};\n token.type = type;\n token.start = now();\n context.events.push(['enter', token, context]);\n stack.push(token);\n return token;\n }\n\n /** @type {Effects['exit']} */\n function exit(type) {\n const token = stack.pop();\n token.end = now();\n context.events.push(['exit', token, context]);\n return token;\n }\n\n /**\n * Use results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulconstruct(construct, info) {\n addResult(construct, info.from);\n }\n\n /**\n * Discard results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulcheck(_, info) {\n info.restore();\n }\n\n /**\n * Factory to attempt/check/interrupt.\n *\n * @param {ReturnHandle} onreturn\n * Callback.\n * @param {{interrupt?: boolean | undefined} | undefined} [fields]\n * Fields.\n */\n function constructFactory(onreturn, fields) {\n return hook;\n\n /**\n * Handle either an object mapping codes to constructs, a list of\n * constructs, or a single construct.\n *\n * @param {Array<Construct> | ConstructRecord | Construct} constructs\n * Constructs.\n * @param {State} returnState\n * State.\n * @param {State | undefined} [bogusState]\n * State.\n * @returns {State}\n * State.\n */\n function hook(constructs, returnState, bogusState) {\n /** @type {ReadonlyArray<Construct>} */\n let listOfConstructs;\n /** @type {number} */\n let constructIndex;\n /** @type {Construct} */\n let currentConstruct;\n /** @type {Info} */\n let info;\n return Array.isArray(constructs) ? /* c8 ignore next 1 */\n handleListOfConstructs(constructs) : 'tokenize' in constructs ?\n // Looks like a construct.\n handleListOfConstructs([(/** @type {Construct} */constructs)]) : handleMapOfConstructs(constructs);\n\n /**\n * Handle a list of construct.\n *\n * @param {ConstructRecord} map\n * Constructs.\n * @returns {State}\n * State.\n */\n function handleMapOfConstructs(map) {\n return start;\n\n /** @type {State} */\n function start(code) {\n const left = code !== null && map[code];\n const all = code !== null && map.null;\n const list = [\n // To do: add more extension tests.\n /* c8 ignore next 2 */\n ...(Array.isArray(left) ? left : left ? [left] : []), ...(Array.isArray(all) ? all : all ? [all] : [])];\n return handleListOfConstructs(list)(code);\n }\n }\n\n /**\n * Handle a list of construct.\n *\n * @param {ReadonlyArray<Construct>} list\n * Constructs.\n * @returns {State}\n * State.\n */\n function handleListOfConstructs(list) {\n listOfConstructs = list;\n constructIndex = 0;\n if (list.length === 0) {\n return bogusState;\n }\n return handleConstruct(list[constructIndex]);\n }\n\n /**\n * Handle a single construct.\n *\n * @param {Construct} construct\n * Construct.\n * @returns {State}\n * State.\n */\n function handleConstruct(construct) {\n return start;\n\n /** @type {State} */\n function start(code) {\n // To do: not needed to store if there is no bogus state, probably?\n // Currently doesn’t work because `inspect` in document does a check\n // w/o a bogus, which doesn’t make sense. But it does seem to help perf\n // by not storing.\n info = store();\n currentConstruct = construct;\n if (!construct.partial) {\n context.currentConstruct = construct;\n }\n\n // Always populated by defaults.\n\n if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) {\n return nok(code);\n }\n return construct.tokenize.call(\n // If we do have fields, create an object w/ `context` as its\n // prototype.\n // This allows a “live binding”, which is needed for `interrupt`.\n fields ? Object.assign(Object.create(context), fields) : context, effects, ok, nok)(code);\n }\n }\n\n /** @type {State} */\n function ok(code) {\n consumed = true;\n onreturn(currentConstruct, info);\n return returnState;\n }\n\n /** @type {State} */\n function nok(code) {\n consumed = true;\n info.restore();\n if (++constructIndex < listOfConstructs.length) {\n return handleConstruct(listOfConstructs[constructIndex]);\n }\n return bogusState;\n }\n }\n }\n\n /**\n * @param {Construct} construct\n * Construct.\n * @param {number} from\n * From.\n * @returns {undefined}\n * Nothing.\n */\n function addResult(construct, from) {\n if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {\n resolveAllConstructs.push(construct);\n }\n if (construct.resolve) {\n splice(context.events, from, context.events.length - from, construct.resolve(context.events.slice(from), context));\n }\n if (construct.resolveTo) {\n context.events = construct.resolveTo(context.events, context);\n }\n }\n\n /**\n * Store state.\n *\n * @returns {Info}\n * Info.\n */\n function store() {\n const startPoint = now();\n const startPrevious = context.previous;\n const startCurrentConstruct = context.currentConstruct;\n const startEventsIndex = context.events.length;\n const startStack = Array.from(stack);\n return {\n from: startEventsIndex,\n restore\n };\n\n /**\n * Restore state.\n *\n * @returns {undefined}\n * Nothing.\n */\n function restore() {\n point = startPoint;\n context.previous = startPrevious;\n context.currentConstruct = startCurrentConstruct;\n context.events.length = startEventsIndex;\n stack = startStack;\n accountForPotentialSkip();\n }\n }\n\n /**\n * Move the current point a bit forward in the line when it’s on a column\n * skip.\n *\n * @returns {undefined}\n * Nothing.\n */\n function accountForPotentialSkip() {\n if (point.line in columnStart && point.column < 2) {\n point.column = columnStart[point.line];\n point.offset += columnStart[point.line] - 1;\n }\n }\n}\n\n/**\n * Get the chunks from a slice of chunks in the range of a token.\n *\n * @param {ReadonlyArray<Chunk>} chunks\n * Chunks.\n * @param {Pick<Token, 'end' | 'start'>} token\n * Token.\n * @returns {Array<Chunk>}\n * Chunks.\n */\nfunction sliceChunks(chunks, token) {\n const startIndex = token.start._index;\n const startBufferIndex = token.start._bufferIndex;\n const endIndex = token.end._index;\n const endBufferIndex = token.end._bufferIndex;\n /** @type {Array<Chunk>} */\n let view;\n if (startIndex === endIndex) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)];\n } else {\n view = chunks.slice(startIndex, endIndex);\n if (startBufferIndex > -1) {\n const head = view[0];\n if (typeof head === 'string') {\n view[0] = head.slice(startBufferIndex);\n /* c8 ignore next 4 -- used to be used, no longer */\n } else {\n view.shift();\n }\n }\n if (endBufferIndex > 0) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view.push(chunks[endIndex].slice(0, endBufferIndex));\n }\n }\n return view;\n}\n\n/**\n * Get the string value of a slice of chunks.\n *\n * @param {ReadonlyArray<Chunk>} chunks\n * Chunks.\n * @param {boolean | undefined} [expandTabs=false]\n * Whether to expand tabs (default: `false`).\n * @returns {string}\n * Result.\n */\nfunction serializeChunks(chunks, expandTabs) {\n let index = -1;\n /** @type {Array<string>} */\n const result = [];\n /** @type {boolean | undefined} */\n let atTab;\n while (++index < chunks.length) {\n const chunk = chunks[index];\n /** @type {string} */\n let value;\n if (typeof chunk === 'string') {\n value = chunk;\n } else {\n switch (chunk) {\n case -5:\n {\n value = \"\\r\";\n break;\n }\n case -4:\n {\n value = \"\\n\";\n break;\n }\n case -3:\n {\n value = \"\\r\" + \"\\n\";\n break;\n }\n case -2:\n {\n value = expandTabs ? \" \" : \"\\t\";\n break;\n }\n case -1:\n {\n if (!expandTabs && atTab) {\n continue;\n }\n value = \" \";\n break;\n }\n default:\n {\n // Currently only replacement character.\n value = String.fromCharCode(chunk);\n }\n }\n }\n atTab = chunk === -2;\n result.push(value);\n }\n return result.join('');\n}","/**\n * @import {\n * Create,\n * FullNormalizedExtension,\n * InitialConstruct,\n * ParseContext,\n * ParseOptions\n * } from 'micromark-util-types'\n */\n\nimport { combineExtensions } from 'micromark-util-combine-extensions';\nimport { content } from './initialize/content.js';\nimport { document } from './initialize/document.js';\nimport { flow } from './initialize/flow.js';\nimport { string, text } from './initialize/text.js';\nimport * as defaultConstructs from './constructs.js';\nimport { createTokenizer } from './create-tokenizer.js';\n\n/**\n * @param {ParseOptions | null | undefined} [options]\n * Configuration (optional).\n * @returns {ParseContext}\n * Parser.\n */\nexport function parse(options) {\n const settings = options || {};\n const constructs = /** @type {FullNormalizedExtension} */\n combineExtensions([defaultConstructs, ...(settings.extensions || [])]);\n\n /** @type {ParseContext} */\n const parser = {\n constructs,\n content: create(content),\n defined: [],\n document: create(document),\n flow: create(flow),\n lazy: {},\n string: create(string),\n text: create(text)\n };\n return parser;\n\n /**\n * @param {InitialConstruct} initial\n * Construct to start with.\n * @returns {Create}\n * Create a tokenizer.\n */\n function create(initial) {\n return creator;\n /** @type {Create} */\n function creator(from) {\n return createTokenizer(parser, initial, from);\n }\n }\n}","/**\n * @import {Event} from 'micromark-util-types'\n */\n\nimport { subtokenize } from 'micromark-util-subtokenize';\n\n/**\n * @param {Array<Event>} events\n * Events.\n * @returns {Array<Event>}\n * Events.\n */\nexport function postprocess(events) {\n while (!subtokenize(events)) {\n // Empty\n }\n return events;\n}","/**\n * @import {Chunk, Code, Encoding, Value} from 'micromark-util-types'\n */\n\n/**\n * @callback Preprocessor\n * Preprocess a value.\n * @param {Value} value\n * Value.\n * @param {Encoding | null | undefined} [encoding]\n * Encoding when `value` is a typed array (optional).\n * @param {boolean | null | undefined} [end=false]\n * Whether this is the last chunk (default: `false`).\n * @returns {Array<Chunk>}\n * Chunks.\n */\n\nconst search = /[\\0\\t\\n\\r]/g;\n\n/**\n * @returns {Preprocessor}\n * Preprocess a value.\n */\nexport function preprocess() {\n let column = 1;\n let buffer = '';\n /** @type {boolean | undefined} */\n let start = true;\n /** @type {boolean | undefined} */\n let atCarriageReturn;\n return preprocessor;\n\n /** @type {Preprocessor} */\n // eslint-disable-next-line complexity\n function preprocessor(value, encoding, end) {\n value = buffer + (typeof value === 'string' ? value.toString() : new TextDecoder(encoding || undefined).decode(value));\n\n /** @type {Array<Chunk>} */\n const chunks = [];\n let startPosition = 0;\n buffer = '';\n if (start) {\n // To do: `markdown-rs` actually parses BOMs (byte order mark).\n if (value.charCodeAt(0) === 65279) {\n startPosition++;\n }\n start = undefined;\n }\n while (startPosition < value.length) {\n search.lastIndex = startPosition;\n const match = search.exec(value);\n const endPosition = match && match.index !== undefined ? match.index : value.length;\n const code = value.charCodeAt(endPosition);\n if (!match) {\n buffer = value.slice(startPosition);\n break;\n }\n if (code === 10 && startPosition === endPosition && atCarriageReturn) {\n chunks.push(-3);\n atCarriageReturn = undefined;\n } else {\n if (atCarriageReturn) {\n chunks.push(-5);\n atCarriageReturn = undefined;\n }\n if (startPosition < endPosition) {\n chunks.push(value.slice(startPosition, endPosition));\n column += endPosition - startPosition;\n }\n switch (code) {\n case 0:\n {\n chunks.push(65533);\n column++;\n break;\n }\n case 9:\n {\n const next = Math.ceil(column / 4) * 4;\n chunks.push(-2);\n while (column++ < next) {\n chunks.push(-1);\n }\n break;\n }\n case 10:\n {\n chunks.push(-4);\n column = 1;\n break;\n }\n default:\n {\n atCarriageReturn = true;\n column = 1;\n }\n }\n }\n startPosition = endPosition + 1;\n }\n if (end) {\n if (atCarriageReturn) {\n chunks.push(-5);\n }\n if (buffer) {\n chunks.push(buffer);\n }\n chunks.push(null);\n }\n return chunks;\n }\n}","import { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nconst characterEscapeOrReference = /\\\\([!-/:-@[-`{-~])|&(#(?:\\d{1,7}|x[\\da-f]{1,6})|[\\da-z]{1,31});/gi;\n\n/**\n * Decode markdown strings (which occur in places such as fenced code info\n * strings, destinations, labels, and titles).\n *\n * The “string” content type allows character escapes and -references.\n * This decodes those.\n *\n * @param {string} value\n * Value to decode.\n * @returns {string}\n * Decoded value.\n */\nexport function decodeString(value) {\n return value.replace(characterEscapeOrReference, decode);\n}\n\n/**\n * @param {string} $0\n * Match.\n * @param {string} $1\n * Character escape.\n * @param {string} $2\n * Character reference.\n * @returns {string}\n * Decoded value\n */\nfunction decode($0, $1, $2) {\n if ($1) {\n // Escape.\n return $1;\n }\n\n // Reference.\n const head = $2.charCodeAt(0);\n if (head === 35) {\n const head = $2.charCodeAt(1);\n const hex = head === 120 || head === 88;\n return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10);\n }\n return decodeNamedCharacterReference($2) || $0;\n}","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n * @typedef {import('unist').Position} Position\n */\n\n/**\n * @typedef NodeLike\n * @property {string} type\n * @property {PositionLike | null | undefined} [position]\n *\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n */\n\n/**\n * Serialize the positional info of a point, position (start and end points),\n * or node.\n *\n * @param {Node | NodeLike | Point | PointLike | Position | PositionLike | null | undefined} [value]\n * Node, position, or point.\n * @returns {string}\n * Pretty printed positional info of a node (`string`).\n *\n * In the format of a range `ls:cs-le:ce` (when given `node` or `position`)\n * or a point `l:c` (when given `point`), where `l` stands for line, `c` for\n * column, `s` for `start`, and `e` for end.\n * An empty string (`''`) is returned if the given value is neither `node`,\n * `position`, nor `point`.\n */\nexport function stringifyPosition(value) {\n // Nothing.\n if (!value || typeof value !== 'object') {\n return ''\n }\n\n // Node.\n if ('position' in value || 'type' in value) {\n return position(value.position)\n }\n\n // Position.\n if ('start' in value || 'end' in value) {\n return position(value)\n }\n\n // Point.\n if ('line' in value || 'column' in value) {\n return point(value)\n }\n\n // ?\n return ''\n}\n\n/**\n * @param {Point | PointLike | null | undefined} point\n * @returns {string}\n */\nfunction point(point) {\n return index(point && point.line) + ':' + index(point && point.column)\n}\n\n/**\n * @param {Position | PositionLike | null | undefined} pos\n * @returns {string}\n */\nfunction position(pos) {\n return point(pos && pos.start) + '-' + point(pos && pos.end)\n}\n\n/**\n * @param {number | null | undefined} value\n * @returns {number}\n */\nfunction index(value) {\n return value && typeof value === 'number' ? value : 1\n}\n","/**\n * @import {\n * Break,\n * Blockquote,\n * Code,\n * Definition,\n * Emphasis,\n * Heading,\n * Html,\n * Image,\n * InlineCode,\n * Link,\n * ListItem,\n * List,\n * Nodes,\n * Paragraph,\n * PhrasingContent,\n * ReferenceType,\n * Root,\n * Strong,\n * Text,\n * ThematicBreak\n * } from 'mdast'\n * @import {\n * Encoding,\n * Event,\n * Token,\n * Value\n * } from 'micromark-util-types'\n * @import {Point} from 'unist'\n * @import {\n * CompileContext,\n * CompileData,\n * Config,\n * Extension,\n * Handle,\n * OnEnterError,\n * Options\n * } from './types.js'\n */\n\nimport { toString } from 'mdast-util-to-string';\nimport { parse, postprocess, preprocess } from 'micromark';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nimport { decodeString } from 'micromark-util-decode-string';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { stringifyPosition } from 'unist-util-stringify-position';\nconst own = {}.hasOwnProperty;\n\n/**\n * Turn markdown into a syntax tree.\n *\n * @overload\n * @param {Value} value\n * @param {Encoding | null | undefined} [encoding]\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @overload\n * @param {Value} value\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @param {Value} value\n * Markdown to parse.\n * @param {Encoding | Options | null | undefined} [encoding]\n * Character encoding for when `value` is `Buffer`.\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {Root}\n * mdast tree.\n */\nexport function fromMarkdown(value, encoding, options) {\n if (encoding && typeof encoding === 'object') {\n options = encoding;\n encoding = undefined;\n }\n return compiler(options)(postprocess(parse(options).document().write(preprocess()(value, encoding, true))));\n}\n\n/**\n * Note this compiler only understand complete buffering, not streaming.\n *\n * @param {Options | null | undefined} [options]\n */\nfunction compiler(options) {\n /** @type {Config} */\n const config = {\n afterExit: [],\n beforeEnter: [],\n transforms: [],\n canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],\n enter: {\n autolink: opener(link),\n autolinkProtocol: onenterdata,\n autolinkEmail: onenterdata,\n atxHeading: opener(heading),\n blockQuote: opener(blockQuote),\n characterEscape: onenterdata,\n characterReference: onenterdata,\n codeFenced: opener(codeFlow),\n codeFencedFenceInfo: buffer,\n codeFencedFenceMeta: buffer,\n codeIndented: opener(codeFlow, buffer),\n codeText: opener(codeText, buffer),\n codeTextData: onenterdata,\n data: onenterdata,\n codeFlowValue: onenterdata,\n definition: opener(definition),\n definitionDestinationString: buffer,\n definitionLabelString: buffer,\n definitionTitleString: buffer,\n emphasis: opener(emphasis),\n hardBreakEscape: opener(hardBreak),\n hardBreakTrailing: opener(hardBreak),\n htmlFlow: opener(html, buffer),\n htmlFlowData: onenterdata,\n htmlText: opener(html, buffer),\n htmlTextData: onenterdata,\n image: opener(image),\n label: buffer,\n link: opener(link),\n listItem: opener(listItem),\n listItemValue: onenterlistitemvalue,\n listOrdered: opener(list, onenterlistordered),\n listUnordered: opener(list),\n paragraph: opener(paragraph),\n reference: onenterreference,\n referenceString: buffer,\n resourceDestinationString: buffer,\n resourceTitleString: buffer,\n setextHeading: opener(heading),\n strong: opener(strong),\n thematicBreak: opener(thematicBreak)\n },\n exit: {\n atxHeading: closer(),\n atxHeadingSequence: onexitatxheadingsequence,\n autolink: closer(),\n autolinkEmail: onexitautolinkemail,\n autolinkProtocol: onexitautolinkprotocol,\n blockQuote: closer(),\n characterEscapeValue: onexitdata,\n characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,\n characterReferenceMarkerNumeric: onexitcharacterreferencemarker,\n characterReferenceValue: onexitcharacterreferencevalue,\n characterReference: onexitcharacterreference,\n codeFenced: closer(onexitcodefenced),\n codeFencedFence: onexitcodefencedfence,\n codeFencedFenceInfo: onexitcodefencedfenceinfo,\n codeFencedFenceMeta: onexitcodefencedfencemeta,\n codeFlowValue: onexitdata,\n codeIndented: closer(onexitcodeindented),\n codeText: closer(onexitcodetext),\n codeTextData: onexitdata,\n data: onexitdata,\n definition: closer(),\n definitionDestinationString: onexitdefinitiondestinationstring,\n definitionLabelString: onexitdefinitionlabelstring,\n definitionTitleString: onexitdefinitiontitlestring,\n emphasis: closer(),\n hardBreakEscape: closer(onexithardbreak),\n hardBreakTrailing: closer(onexithardbreak),\n htmlFlow: closer(onexithtmlflow),\n htmlFlowData: onexitdata,\n htmlText: closer(onexithtmltext),\n htmlTextData: onexitdata,\n image: closer(onexitimage),\n label: onexitlabel,\n labelText: onexitlabeltext,\n lineEnding: onexitlineending,\n link: closer(onexitlink),\n listItem: closer(),\n listOrdered: closer(),\n listUnordered: closer(),\n paragraph: closer(),\n referenceString: onexitreferencestring,\n resourceDestinationString: onexitresourcedestinationstring,\n resourceTitleString: onexitresourcetitlestring,\n resource: onexitresource,\n setextHeading: closer(onexitsetextheading),\n setextHeadingLineSequence: onexitsetextheadinglinesequence,\n setextHeadingText: onexitsetextheadingtext,\n strong: closer(),\n thematicBreak: closer()\n }\n };\n configure(config, (options || {}).mdastExtensions || []);\n\n /** @type {CompileData} */\n const data = {};\n return compile;\n\n /**\n * Turn micromark events into an mdast tree.\n *\n * @param {Array<Event>} events\n * Events.\n * @returns {Root}\n * mdast tree.\n */\n function compile(events) {\n /** @type {Root} */\n let tree = {\n type: 'root',\n children: [],\n position: undefined\n };\n /** @type {Omit<CompileContext, 'sliceSerialize'>} */\n const context = {\n stack: [tree],\n tokenStack: [],\n config,\n enter,\n exit,\n buffer,\n resume,\n data\n };\n /** @type {Array<number>} */\n const listStack = [];\n /** @type {Array<Event>} */\n const prepared = [];\n let index = -1;\n\n // Add `listItem` tokens and infer spread.\n // Each list is prepared while it is last in `prepared`, so nothing shifts.\n while (++index < events.length) {\n prepared.push(events[index]);\n if (events[index][1].type === \"listOrdered\" || events[index][1].type === \"listUnordered\") {\n if (events[index][0] === 'enter') {\n listStack.push(prepared.length - 1);\n } else {\n const tail = listStack.pop();\n prepareList(prepared, tail);\n }\n }\n }\n events = prepared;\n index = -1;\n while (++index < events.length) {\n const handler = config[events[index][0]];\n if (events[index][0] === 'enter' && config.beforeEnter.length > 0) {\n callListeners(config.beforeEnter, {\n ...context,\n sliceSerialize: events[index][2].sliceSerialize\n }, events[index][1]);\n }\n if (own.call(handler, events[index][1].type)) {\n // Note: spread first, V8 has optimizations for object shape cloning.\n handler[events[index][1].type].call({\n ...context,\n sliceSerialize: events[index][2].sliceSerialize\n }, events[index][1]);\n }\n if (events[index][0] === 'exit' && config.afterExit.length > 0) {\n callListeners(config.afterExit, {\n ...context,\n sliceSerialize: events[index][2].sliceSerialize\n }, events[index][1]);\n }\n }\n\n // Handle tokens still being open.\n if (context.tokenStack.length > 0) {\n const tail = context.tokenStack[context.tokenStack.length - 1];\n const handler = tail[1] || defaultOnError;\n handler.call(context, undefined, tail[0]);\n }\n\n // Figure out `root` position.\n tree.position = {\n start: point(events.length > 0 ? events[0][1].start : {\n line: 1,\n column: 1,\n offset: 0\n }),\n end: point(events.length > 0 ? events[events.length - 2][1].end : {\n line: 1,\n column: 1,\n offset: 0\n })\n };\n\n // Call transforms.\n index = -1;\n while (++index < config.transforms.length) {\n tree = config.transforms[index](tree) || tree;\n }\n return tree;\n }\n\n /**\n * @param {Array<Handle>} listeners\n * Listeners.\n * @param {CompileContext} context\n * Context.\n * @param {Token} token\n * Token.\n * @returns {undefined}\n * Nothing.\n */\n function callListeners(listeners, context, token) {\n let index = -1;\n while (++index < listeners.length) {\n listeners[index].call(context, token);\n }\n }\n\n /**\n * @param {Array<Event>} events\n * Events, ending with the list to prepare.\n * @param {number} start\n * Index of the list enter.\n * @returns {undefined}\n */\n function prepareList(events, start) {\n const end = events.length - 1;\n let index = start - 1;\n let containerBalance = -1;\n let listSpread = false;\n /** @type {Token | undefined} */\n let listItem;\n /** @type {number | undefined} */\n let lineIndex;\n /** @type {number | undefined} */\n let firstBlankLineIndex;\n /** @type {boolean | undefined} */\n let atMarker;\n /**\n * `listItem` events to insert before the event at `at`, in walk order.\n * Merged in after the walk, as inserting while walking would shift the\n * rest of the list once per item.\n * @type {Array<{at: number, event: Event}>}\n */\n const insertions = [];\n while (++index <= end) {\n const event = events[index];\n switch (event[1].type) {\n case \"listUnordered\":\n case \"listOrdered\":\n case \"blockQuote\":\n {\n if (event[0] === 'enter') {\n containerBalance++;\n } else {\n containerBalance--;\n }\n atMarker = undefined;\n break;\n }\n case \"lineEndingBlank\":\n {\n if (event[0] === 'enter') {\n if (listItem && !atMarker && !containerBalance && !firstBlankLineIndex) {\n firstBlankLineIndex = index;\n }\n atMarker = undefined;\n }\n break;\n }\n case \"linePrefix\":\n case \"listItemValue\":\n case \"listItemMarker\":\n case \"listItemPrefix\":\n case \"listItemPrefixWhitespace\":\n {\n // Empty.\n\n break;\n }\n default:\n {\n atMarker = undefined;\n }\n }\n if (!containerBalance && event[0] === 'enter' && event[1].type === \"listItemPrefix\" || containerBalance === -1 && event[0] === 'exit' && (event[1].type === \"listUnordered\" || event[1].type === \"listOrdered\")) {\n if (listItem) {\n let tailIndex = index;\n lineIndex = undefined;\n while (tailIndex--) {\n const tailEvent = events[tailIndex];\n if (tailEvent[1].type === \"lineEnding\" || tailEvent[1].type === \"lineEndingBlank\") {\n if (tailEvent[0] === 'exit') continue;\n if (lineIndex) {\n events[lineIndex][1].type = \"lineEndingBlank\";\n listSpread = true;\n }\n tailEvent[1].type = \"lineEnding\";\n lineIndex = tailIndex;\n } else if (tailEvent[1].type === \"linePrefix\" || tailEvent[1].type === \"blockQuotePrefix\" || tailEvent[1].type === \"blockQuotePrefixWhitespace\" || tailEvent[1].type === \"blockQuoteMarker\" || tailEvent[1].type === \"listItemIndent\") {\n // Empty\n } else {\n break;\n }\n }\n if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) {\n listItem._spread = true;\n }\n\n // Fix position.\n listItem.end = Object.assign({}, lineIndex ? events[lineIndex][1].start : event[1].end);\n insertions.push({\n at: lineIndex || index,\n event: ['exit', listItem, event[2]]\n });\n }\n\n // Create a new list item.\n if (event[1].type === \"listItemPrefix\") {\n /** @type {Token} */\n const item = {\n type: 'listItem',\n _spread: false,\n start: Object.assign({}, event[1].start),\n // @ts-expect-error: we’ll add `end` in a second.\n end: undefined\n };\n listItem = item;\n insertions.push({\n at: index,\n event: ['enter', item, event[2]]\n });\n firstBlankLineIndex = undefined;\n atMarker = true;\n }\n }\n }\n\n // The list is at the end of `events`: take it off, then push it back with\n // the insertions merged in.\n // Nothing follows the list, so nothing shifts.\n const listEvents = events.splice(start);\n let insertion = 0;\n index = -1;\n while (++index < listEvents.length) {\n while (insertion < insertions.length && insertions[insertion].at === start + index) {\n events.push(insertions[insertion++].event);\n }\n events.push(listEvents[index]);\n }\n events[start][1]._spread = listSpread;\n }\n\n /**\n * Create an opener handle.\n *\n * @param {(token: Token) => Nodes} create\n * Create a node.\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function opener(create, and) {\n return open;\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function open(token) {\n enter.call(this, create(token), token);\n if (and) and.call(this, token);\n }\n }\n\n /**\n * @type {CompileContext['buffer']}\n */\n function buffer() {\n this.stack.push({\n type: 'fragment',\n children: []\n });\n }\n\n /**\n * @type {CompileContext['enter']}\n */\n function enter(node, token, errorHandler) {\n const parent = this.stack[this.stack.length - 1];\n /** @type {Array<Nodes>} */\n const siblings = parent.children;\n siblings.push(node);\n this.stack.push(node);\n this.tokenStack.push([token, errorHandler || undefined]);\n node.position = {\n start: point(token.start),\n // @ts-expect-error: `end` will be patched later.\n end: undefined\n };\n }\n\n /**\n * Create a closer handle.\n *\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function closer(and) {\n return close;\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function close(token) {\n if (and) and.call(this, token);\n exit.call(this, token);\n }\n }\n\n /**\n * @type {CompileContext['exit']}\n */\n function exit(token, onExitError) {\n const node = this.stack.pop();\n const open = this.tokenStack.pop();\n if (!open) {\n throw new Error('Cannot close `' + token.type + '` (' + stringifyPosition({\n start: token.start,\n end: token.end\n }) + '): it’s not open');\n }\n if (open[0].type !== token.type) {\n if (onExitError) {\n onExitError.call(this, token, open[0]);\n } else {\n const handler = open[1] || defaultOnError;\n handler.call(this, token, open[0]);\n }\n }\n node.position.end = point(token.end);\n }\n\n /**\n * @type {CompileContext['resume']}\n */\n function resume() {\n return toString(this.stack.pop());\n }\n\n //\n // Handlers.\n //\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistordered() {\n this.data.expectingFirstListItemValue = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistitemvalue(token) {\n if (this.data.expectingFirstListItemValue) {\n const ancestor = this.stack[this.stack.length - 2];\n ancestor.start = Number.parseInt(this.sliceSerialize(token), 10);\n this.data.expectingFirstListItemValue = undefined;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfenceinfo() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.lang = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfencemeta() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.meta = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfence() {\n // Exit if this is the closing fence.\n if (this.data.flowCodeInside) return;\n this.buffer();\n this.data.flowCodeInside = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefenced() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data.replace(/^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g, '');\n this.data.flowCodeInside = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodeindented() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data.replace(/(\\r?\\n|\\r)$/g, '');\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitionlabelstring(token) {\n const label = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.label = label;\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiontitlestring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.title = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiondestinationstring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.url = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitatxheadingsequence(token) {\n const node = this.stack[this.stack.length - 1];\n if (!node.depth) {\n const depth = this.sliceSerialize(token).length;\n node.depth = depth;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadingtext() {\n this.data.setextHeadingSlurpLineEnding = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadinglinesequence(token) {\n const node = this.stack[this.stack.length - 1];\n node.depth = this.sliceSerialize(token).codePointAt(0) === 61 ? 1 : 2;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheading() {\n this.data.setextHeadingSlurpLineEnding = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterdata(token) {\n const node = this.stack[this.stack.length - 1];\n /** @type {Array<Nodes>} */\n const siblings = node.children;\n let tail = siblings[siblings.length - 1];\n if (!tail || tail.type !== 'text') {\n // Add a new text node.\n tail = text();\n tail.position = {\n start: point(token.start),\n // @ts-expect-error: we’ll add `end` later.\n end: undefined\n };\n siblings.push(tail);\n }\n this.stack.push(tail);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitdata(token) {\n const tail = this.stack.pop();\n tail.value += this.sliceSerialize(token);\n tail.position.end = point(token.end);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlineending(token) {\n const context = this.stack[this.stack.length - 1];\n // If we’re at a hard break, include the line ending in there.\n if (this.data.atHardBreak) {\n const tail = context.children[context.children.length - 1];\n tail.position.end = point(token.end);\n this.data.atHardBreak = undefined;\n return;\n }\n if (!this.data.setextHeadingSlurpLineEnding && config.canContainEols.includes(context.type)) {\n onenterdata.call(this, token);\n onexitdata.call(this, token);\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithardbreak() {\n this.data.atHardBreak = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmlflow() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmltext() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcodetext() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlink() {\n const node = this.stack[this.stack.length - 1];\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut';\n node.type += 'Reference';\n // @ts-expect-error: mutate.\n node.referenceType = referenceType;\n // @ts-expect-error: mutate.\n delete node.url;\n delete node.title;\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier;\n // @ts-expect-error: mutate.\n delete node.label;\n }\n this.data.referenceType = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitimage() {\n const node = this.stack[this.stack.length - 1];\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut';\n node.type += 'Reference';\n // @ts-expect-error: mutate.\n node.referenceType = referenceType;\n // @ts-expect-error: mutate.\n delete node.url;\n delete node.title;\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier;\n // @ts-expect-error: mutate.\n delete node.label;\n }\n this.data.referenceType = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabeltext(token) {\n const string = this.sliceSerialize(token);\n const ancestor = this.stack[this.stack.length - 2];\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n ancestor.label = decodeString(string);\n // @ts-expect-error: same as above.\n ancestor.identifier = normalizeIdentifier(string).toLowerCase();\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabel() {\n const fragment = this.stack[this.stack.length - 1];\n const value = this.resume();\n const node = this.stack[this.stack.length - 1];\n // Assume a reference.\n this.data.inReference = true;\n if (node.type === 'link') {\n /** @type {Array<PhrasingContent>} */\n const children = fragment.children;\n node.children = children;\n } else {\n node.alt = value;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcedestinationstring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.url = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcetitlestring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.title = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresource() {\n this.data.inReference = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterreference() {\n this.data.referenceType = 'collapsed';\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitreferencestring(token) {\n const label = this.resume();\n const node = this.stack[this.stack.length - 1];\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n node.label = label;\n // @ts-expect-error: same as above.\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n this.data.referenceType = 'full';\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcharacterreferencemarker(token) {\n this.data.characterReferenceType = token.type;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreferencevalue(token) {\n const data = this.sliceSerialize(token);\n const type = this.data.characterReferenceType;\n /** @type {string} */\n let value;\n if (type) {\n value = decodeNumericCharacterReference(data, type === \"characterReferenceMarkerNumeric\" ? 10 : 16);\n this.data.characterReferenceType = undefined;\n } else {\n const result = decodeNamedCharacterReference(data);\n value = result;\n }\n const tail = this.stack[this.stack.length - 1];\n tail.value += value;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreference(token) {\n const tail = this.stack.pop();\n tail.position.end = point(token.end);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkprotocol(token) {\n onexitdata.call(this, token);\n const node = this.stack[this.stack.length - 1];\n node.url = this.sliceSerialize(token);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkemail(token) {\n onexitdata.call(this, token);\n const node = this.stack[this.stack.length - 1];\n node.url = 'mailto:' + this.sliceSerialize(token);\n }\n\n //\n // Creaters.\n //\n\n // Each node factory pre-declares `position` as undefined as the trailing\n // property. enter() patches it to a real value, but the property already\n // exists, so V8 sees a single hidden class for each node type from\n // construction through the rest of the pipeline. Without the pre-declare,\n // each node took a hidden-class transition when enter() added position.\n\n /** @returns {Blockquote} */\n function blockQuote() {\n return {\n type: 'blockquote',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Code} */\n function codeFlow() {\n return {\n type: 'code',\n lang: null,\n meta: null,\n value: '',\n position: undefined\n };\n }\n\n /** @returns {InlineCode} */\n function codeText() {\n return {\n type: 'inlineCode',\n value: '',\n position: undefined\n };\n }\n\n /** @returns {Definition} */\n function definition() {\n return {\n type: 'definition',\n identifier: '',\n label: null,\n title: null,\n url: '',\n position: undefined\n };\n }\n\n /** @returns {Emphasis} */\n function emphasis() {\n return {\n type: 'emphasis',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Heading} */\n function heading() {\n return {\n type: 'heading',\n // @ts-expect-error `depth` will be set later.\n depth: 0,\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Break} */\n function hardBreak() {\n return {\n type: 'break',\n position: undefined\n };\n }\n\n /** @returns {Html} */\n function html() {\n return {\n type: 'html',\n value: '',\n position: undefined\n };\n }\n\n /** @returns {Image} */\n function image() {\n return {\n type: 'image',\n title: null,\n url: '',\n alt: null,\n position: undefined\n };\n }\n\n /** @returns {Link} */\n function link() {\n return {\n type: 'link',\n title: null,\n url: '',\n children: [],\n position: undefined\n };\n }\n\n /**\n * @param {Token} token\n * @returns {List}\n */\n function list(token) {\n return {\n type: 'list',\n ordered: token.type === 'listOrdered',\n start: null,\n spread: token._spread,\n children: [],\n position: undefined\n };\n }\n\n /**\n * @param {Token} token\n * @returns {ListItem}\n */\n function listItem(token) {\n return {\n type: 'listItem',\n spread: token._spread,\n checked: null,\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Paragraph} */\n function paragraph() {\n return {\n type: 'paragraph',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Strong} */\n function strong() {\n return {\n type: 'strong',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Text} */\n function text() {\n return {\n type: 'text',\n value: '',\n position: undefined\n };\n }\n\n /** @returns {ThematicBreak} */\n function thematicBreak() {\n return {\n type: 'thematicBreak',\n position: undefined\n };\n }\n}\n\n/**\n * Copy a point-like value.\n *\n * @param {Point} d\n * Point-like value.\n * @returns {Point}\n * unist point.\n */\nfunction point(d) {\n return {\n line: d.line,\n column: d.column,\n offset: d.offset\n };\n}\n\n/**\n * @param {Config} combined\n * @param {Array<Array<Extension> | Extension>} extensions\n * @returns {undefined}\n */\nfunction configure(combined, extensions) {\n let index = -1;\n while (++index < extensions.length) {\n const value = extensions[index];\n if (Array.isArray(value)) {\n configure(combined, value);\n } else {\n extension(combined, value);\n }\n }\n}\n\n/**\n * @param {Config} combined\n * @param {Extension} extension\n * @returns {undefined}\n */\nfunction extension(combined, extension) {\n /** @type {keyof Extension} */\n let key;\n for (key in extension) {\n if (own.call(extension, key)) {\n switch (key) {\n case 'canContainEols':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(...right);\n }\n break;\n }\n case 'transforms':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(...right);\n }\n break;\n }\n case 'afterExit':\n case 'beforeEnter':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(right);\n }\n break;\n }\n case 'enter':\n case 'exit':\n {\n const right = extension[key];\n if (right) {\n Object.assign(combined[key], right);\n }\n break;\n }\n // No default\n }\n }\n }\n}\n\n/** @type {OnEnterError} */\nfunction defaultOnError(left, right) {\n if (left) {\n throw new Error('Cannot close `' + left.type + '` (' + stringifyPosition({\n start: left.start,\n end: left.end\n }) + '): a different token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is open');\n }\n throw new Error('Cannot close document, a token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is still open');\n}","import { fromMarkdown } from 'mdast-util-from-markdown'\nimport type { Definition, Nodes } from 'mdast'\nimport type { WorkspaceFileLinkResolver } from './workspace-file-links.js'\n\nconst WEB_SCHEME = /^(?:https?|mailto):/i\nconst HOST_ABSOLUTE = /^(?:[\\\\/]|[A-Za-z]:[\\\\/]|file:)/i\n\nexport interface FlattenOptions {\n /** Keep a relative target linked: a code host resolves it against the repository, chat cannot. */\n resolvesRelativeTargets?: boolean\n /** A daemon-owned mapping from runtime file targets to authenticated workspace URLs. */\n resolveFileLink?: WorkspaceFileLinkResolver\n}\n\n/** Rewrite unsafe link targets without reformatting the rest of the Markdown source. */\nexport function flattenUnsafeLinks(source: string, opts: FlattenOptions = {}): string {\n // A session file's host path never reaches the conversation; its `files:` name does (inbound-file-attachments.md §2.4).\n const text = opts.resolveFileLink?.rewriteSessionPaths?.(source) ?? source\n if (!text.includes('[') && !text.includes('<')) return text\n const tree = fromMarkdown(text)\n const definitions = new Map<string, Definition>()\n const index = (node: Nodes): void => {\n // CommonMark resolves every reference against the first definition with that identifier.\n if (node.type === 'definition' && !definitions.has(node.identifier)) definitions.set(node.identifier, node)\n if ('children' in node) node.children.forEach(index)\n }\n index(tree)\n\n const keeps = (url: string): boolean =>\n WEB_SCHEME.test(url) || (opts.resolvesRelativeTargets === true && !HOST_ABSOLUTE.test(url))\n\n const render = (node: Nodes, insideLink = false): string => {\n const start = node.position!.start.offset!\n const end = node.position!.end.offset!\n if (node.type === 'definition') return keeps(node.url) ? text.slice(start, end) : ''\n\n let cursor = start\n let content = ''\n let label = ''\n if ('children' in node) {\n const children = node.children.map((child) => ({\n child,\n rendered: render(child, insideLink || node.type === 'link' || node.type === 'linkReference')\n }))\n const changed = children.some(\n ({ child, rendered }) => rendered !== text.slice(child.position!.start.offset!, child.position!.end.offset!)\n )\n for (const { child, rendered: result } of children) {\n // Literal syntax beside a rewritten link must not become an active outer link on the platform.\n const rendered = changed && child.type === 'text' ? escapeLiteralLinkSyntax(result) : result\n content += text.slice(cursor, child.position!.start.offset!) + rendered\n label += rendered\n cursor = child.position!.end.offset!\n }\n }\n content += text.slice(cursor, end)\n\n const target =\n node.type === 'link' || node.type === 'image'\n ? node\n : node.type === 'linkReference' || node.type === 'imageReference'\n ? definitions.get(node.identifier)\n : undefined\n if (!target || keeps(target.url)) return content\n\n const display = target.url.startsWith('#') ? '' : HOST_ABSOLUTE.test(target.url) ? basename(target.url) : target.url\n // Images have no useful visible label here; an autolink's label is the unsafe target itself.\n const visible = (node.type === 'link' && text[start] === '[') || node.type === 'linkReference' ? label : ''\n const fileUrl = !insideLink ? opts.resolveFileLink?.(target.url) : undefined\n if (fileUrl && /^https?:/i.test(fileUrl)) return `[${visible || inlineCode(display)}](<${fileUrl}>)`\n if (!display || visible.includes(display)) return visible || inlineCode(display)\n return visible ? `${visible} (${inlineCode(display)})` : inlineCode(display)\n }\n return render(tree)\n}\n\n/** Escape both bracket sides so literal text cannot open or prematurely close a surrounding link. */\nfunction escapeLiteralLinkSyntax(text: string): string {\n return text.replace(/\\\\.|[<[\\]]/g, (token) => (token.length === 1 ? `\\\\${token}` : token))\n}\n\n/** Hold a whole Markdown block when later definitions could still change its references. */\nexport function referenceBufferStart(text: string): number | undefined {\n if (!text.includes('[')) return undefined\n const needsDefinitions = (node: Nodes): boolean => {\n if (node.type === 'definition' || node.type === 'linkReference' || node.type === 'imageReference') return true\n if (node.type === 'text') return node.value.includes('[')\n return 'children' in node && node.children.some(needsDefinitions)\n }\n return fromMarkdown(text).children.find(needsDefinitions)?.position?.start.offset\n}\n\n/** Last path segment of a host path, in either separator, ignoring trailing slashes. */\nfunction basename(path: string): string {\n const trimmed = path.replaceAll('\\\\', '/').replace(/\\/+$/, '')\n return trimmed.slice(trimmed.lastIndexOf('/') + 1) || trimmed\n}\n\n/** A decoded destination may contain backticks, so quote it with a longer code delimiter. */\nfunction inlineCode(value: string): string {\n const width = (value.match(/`+/g) ?? []).reduce((max, run) => Math.max(max, run.length), 0) + 1\n const fence = '`'.repeat(width)\n const padded = value.startsWith('`') || value.endsWith('`') || (value.startsWith(' ') && value.endsWith(' '))\n return `${fence}${padded ? ` ${value} ` : value}${fence}`\n}\n","/**\n * Runtime-independent \"not for me\" suppression.\n *\n * Every agent session receives the same standing response-choice contract. When an\n * activation is not directed at the agent, it replies with one product-specific\n * control marker; visible platform delivery boundaries suppress that marker. Direct\n * messages and direct agent calls are explicitly described as addressed, while shared\n * conversations are where the silent branch is normally useful.\n *\n * Kept in one module so the rule that TEACHES the sentinel and the convergers that\n * DETECT it (Slack/Telegram/Discord/Feishu render) can never drift apart.\n */\n\n/** The reserved reply meaning \"this message isn't for me — stay silent\". */\nexport const NO_RESPONSE_SENTINEL = 'AC_NO_RESPONSE'\n\n/** Standing system-prompt guidance injected into every agent session. It teaches the\n * agent to stay silent on activations that are not for it by replying with the bare\n * sentinel, which visible platform delivery boundaries drop before chat. */\nexport const NO_RESPONSE_RULE =\n `# Choosing whether to respond\\n` +\n `Apply this rule in every conversation type. Respond normally to messages directed at you. A direct message or ` +\n `direct agent call is addressed to you. A message that @-mentions you, directly replies to you, plainly asks ` +\n `you something, or puts to the room a request your role exists to handle is also addressed to you. A message ` +\n `is not addressed to you merely because it is about your topic. Only when an activation is not for you (for ` +\n `example, it addresses someone else, continues a conversation you are not part of, or is people talking among ` +\n `themselves, even about your topic or about work you did for them), ` +\n `do NOT respond: your entire reply must be exactly \\`${NO_RESPONSE_SENTINEL}\\` — start with that token ` +\n `and stop. Do not explain why, add punctuation, or output any other text. When a message may be asking you ` +\n `something and you're unsure, respond normally rather than staying silent.`\n\n/** A compact restatement of the rule, re-injected as a system reminder on long-running\n * sessions (every N turns, or right after a context compaction). The full rule is\n * asserted once at session start — for Claude it lives in the persistent\n * system-prompt append, but for non-Claude runtimes it rides only the first prompt block\n * and is summarized away once the runtime compacts its history, so it must be re-asserted.\n * Kept short (unlike the full rule) so periodic re-injection costs almost nothing. */\nexport const NO_RESPONSE_REMINDER =\n `<system-reminder>\\n` +\n `The response-choice rule still applies. Follow the activation chronologically. A direct message, direct ` +\n `agent call, @-mention, direct reply, or plain request to you is for you. Only when the activation is not ` +\n `directed at you, including people talking among themselves about your topic, your entire reply must be ` +\n `exactly ${NO_RESPONSE_SENTINEL}: start with that token, stop, and do not explain.\\n` +\n `</system-reminder>`\n\n/** Trusted routing context for a person's message in a shared conversation that reached this agent without tagging it. */\nexport const UNADDRESSED_MESSAGE_REMINDER =\n `<system-reminder>\\n` +\n `Routing fact: The platform message in this activation does not @-mention you. Nobody tagged you; it reached ` +\n `you because you are part of this conversation or follow this channel. Treat it as addressed to you only if it ` +\n `names you or plainly asks you something, gives you an instruction, answers a question you asked, or puts to ` +\n `the room a request your role exists to handle. If people are talking ` +\n `among themselves, even about your topic or about work you did for them, your entire reply must be exactly ` +\n `${NO_RESPONSE_SENTINEL}.\\n` +\n `</system-reminder>`\n\n/** Trusted per-turn routing context for an explicit platform @mention. Slack and\n * similar platforms expose an opaque user id in the raw message, so the model cannot\n * infer from its AgentConnect name alone that the token denotes its own bound bot. */\nexport const EXPLICIT_MENTION_REMINDER =\n `<system-reminder>\\n` +\n `Routing fact: A platform message in this activation explicitly @-mentioned your bound bot identity. ` +\n `That mentioned message is directed at you, even if its raw mention is an opaque platform user ID that ` +\n `does not resemble your AgentConnect name. Follow the conversation chronologically and respond normally; ` +\n `do not return ${NO_RESPONSE_SENTINEL} merely because of that ID mismatch.\\n` +\n `</system-reminder>`\n\n/** Trusted routing context for a daemon-delivered agent call. The payload may\n * quote or discuss any agent, so the model must not reinterpret names in the\n * body as evidence that the activation belongs to someone else. */\nexport const DIRECT_AGENT_CALL_REMINDER =\n `<system-reminder>\\n` +\n `Routing fact: This activation is a trusted direct agent call addressed to you. A leading ` +\n `\\`[Message <id>] From <agent>\\` header or \\`From <agent>:\\` label identifies the caller; it does not address that agent. Follow the request and respond ` +\n `normally. Do not return ${NO_RESPONSE_SENTINEL} merely because the body names or discusses another agent.\\n` +\n `</system-reminder>`\n\n/** Routing context for a webchat continuation the human's @mention left out (webchat-multi-agents.md §5.2a). */\nexport const OUTSIDE_HUMAN_SCOPE_REMINDER =\n `<system-reminder>\\n` +\n `Routing fact: In this multi-agent conversation the human @-mentioned other participants, not you, and the ` +\n `post that woke you does not @-mention you. Stay out of their exchange: unless that post asks you something ` +\n `directly, your entire reply must be exactly ${NO_RESPONSE_SENTINEL}.\\n` +\n `</system-reminder>`\n\n/** A replacement generation of a left-out turn now carries an activation addressed to this agent (§5.2a). */\nexport const ADDRESSED_AFTER_OUTSIDE_SCOPE_REMINDER =\n `<system-reminder>\\n` +\n `Routing fact: A newer post in this update is addressed to you, so the earlier instruction to stay out of the ` +\n `exchange no longer applies. Respond to it normally.\\n` +\n `</system-reminder>`\n\n/** A replacement generation of an addressed turn absorbed posts from an exchange the human addressed to others (§5.2a). */\nexport function absorbedOutsideScopeReminder(authors: readonly string[]): string {\n return (\n `<system-reminder>\\n` +\n `Routing fact: The newer post(s) from ${authors.map((a) => `[${a}]`).join(', ')} in this update belong to an ` +\n `exchange the human addressed to other participants. Answer what was asked of you; do not take up theirs.\\n` +\n `</system-reminder>`\n )\n}\n\n// Sentinels and sentinel prefixes separated by optional whitespace: a steered turn can leave \"AC_NO_RES\" before the retry's sentinel.\nconst SENTINEL_FRAGMENT = `(?:${[...NO_RESPONSE_SENTINEL]\n .map((_, i) => NO_RESPONSE_SENTINEL.slice(0, i + 1))\n .reverse()\n .join('|')})`\nconst SENTINEL_FRAGMENTS = new RegExp(`^(?:${SENTINEL_FRAGMENT}(?:\\\\s*${SENTINEL_FRAGMENT})*)?$`)\n\n/** True while `trimmedBody` could still become the bare sentinel as more chunks stream\n * in — i.e. it is a prefix of (or exactly) the sentinel. Convergers use this to HOLD\n * buffered body instead of posting it, so a streamed sentinel never leaks a partial\n * post before the turn ends. Case-sensitive, so ordinary replies that merely start with\n * \"N\"/\"NO\" are released the instant they diverge. */\nexport function isNoResponsePrefix(trimmedBody: string): boolean {\n return SENTINEL_FRAGMENTS.test(trimmedBody)\n}\n\n/** True when the turn is the bare sentinel, or when a non-compliant model explains itself\n * and then emits the sentinel as the final standalone line. The terminal-line fallback is\n * deliberately narrow: inline mentions, punctuation, fenced examples, and any content\n * after the sentinel remain ordinary replies. A body that is nothing but repeated\n * sentinel occurrences and whitespace is unambiguously a silent turn (#1920). */\nexport function isNoResponseBody(trimmedBody: string): boolean {\n const terminalLine = trimmedBody.split(/\\r?\\n/).at(-1)?.trim()\n if (terminalLine === NO_RESPONSE_SENTINEL) return true\n // Only sentinels, or prefixes cut off by an interrupted generation, ending in a whole sentinel (#1920).\n return SENTINEL_FRAGMENTS.test(trimmedBody) && trimmedBody.endsWith(NO_RESPONSE_SENTINEL)\n}\n","// Runtime message IDs separate successive replies even when no tool or thought occurs between them.\nimport { isNoResponsePrefix } from '../session/no-response.js'\n\n/** The runtime's own id for the message a chunk belongs to, or `''` where it names none. */\nexport function agentMessageId(update: unknown): string {\n const id = (update as { messageId?: unknown } | undefined)?.messageId\n return typeof id === 'string' ? id : ''\n}\n\n/** Tracks that id across the chunks of one turn, reporting where a new message begins. */\nexport class AgentMessageRun {\n private current = ''\n private text = ''\n private closedSentinel = ''\n\n /** Only a change between named messages closes the preceding reply. */\n opens(update: unknown): boolean {\n const id = agentMessageId(update)\n const opens = id !== '' && this.current !== '' && id !== this.current\n this.closedSentinel = opens && this.text.trim() && isNoResponsePrefix(this.text.trim()) ? this.text : ''\n if (opens) this.text = ''\n if (id) this.current = id\n this.text += agentMessageText(update)\n return opens\n }\n\n /** `buffered` without the message just closed when that message was only sentinel text, which can no longer complete. */\n withoutClosedSentinel(buffered: string): string {\n const closed = this.closedSentinel\n return closed && buffered.endsWith(closed) ? buffered.slice(0, -closed.length) : buffered\n }\n}\n\nfunction agentMessageText(update: unknown): string {\n const content = (update as { content?: { type?: unknown; text?: unknown } } | undefined)?.content\n return content?.type === 'text' && typeof content.text === 'string' ? content.text : ''\n}\n\n/** Tracks new work in one turn; ongoing tool output does not finish the agent's current text block. */\nexport class WorkBoundary {\n private readonly tools = new Set<string>()\n\n opens(update: unknown): boolean {\n const u = update as { sessionUpdate?: string; toolCallId?: unknown } | undefined\n if (u?.sessionUpdate === 'agent_thought_chunk' || u?.sessionUpdate === 'plan') return true\n if (u?.sessionUpdate !== 'tool_call' && u?.sessionUpdate !== 'tool_call_update') return false\n const id = u.toolCallId\n if (typeof id !== 'string' || !id) return true\n const opens = !this.tools.has(id)\n this.tools.add(id)\n return opens\n }\n}\n","import { referenceBufferStart } from './agent-links.js'\n\n/** Opening/closing CommonMark fence: up to 3 spaces of indent, then 3+ backticks or tildes. */\nconst FENCE = /^ {0,3}(`{3,}|~{3,})(.*)$/\n\n/** Split at a completed paragraph before any block whose reference definitions may still arrive. */\nexport function splitAtParagraphBoundary(text: string): { ready: string; tail: string } {\n let cut = 0\n let fence: string | undefined\n let pos = 0\n const referenceStart = referenceBufferStart(text) ?? text.length\n while (pos < text.length) {\n const nl = text.indexOf('\\n', pos)\n // A trailing line without its newline is still streaming.\n if (nl < 0) break\n const line = text.slice(pos, nl)\n pos = nl + 1\n const [, run = '', rest = ''] = FENCE.exec(line) ?? []\n if (fence) {\n // A fence closes on the same character, at least as long, alone on its line.\n if (run && run[0] === fence[0] && run.length >= fence.length && !rest.trim()) fence = undefined\n continue\n }\n if (run) {\n fence = run\n continue\n }\n if (!line.trim() && pos <= referenceStart) cut = pos\n }\n const ready = text.slice(0, cut)\n return ready.trim() ? { ready, tail: text.slice(cut) } : { ready: '', tail: text }\n}\n","// Codex ACP mode names shown in platform controls when the runtime reports only IDs.\nconst CODEX_MODE_LABELS: Record<string, string> = {\n 'read-only': 'Read-only',\n 'workspace-write': 'Workspace access',\n agent: 'Auto review',\n 'agent-full-access': 'Full access'\n}\n\n/** Codex's own name for a mode; unknown values (Claude's `default`/`plan`) pass through. */\nexport function permissionModeDisplayLabel(value: string): string {\n return CODEX_MODE_LABELS[value] ?? value\n}\n","/**\n * Length-chunking for outbound chat text: break a body into sections no longer than the\n * target platform's per-message limit, preferring line boundaries.\n *\n * Distinct from stream-boundary.ts, which answers a different question — WHEN a still\n * streaming buffer may be cut at all (paragraph breaks outside fences). That one decides\n * timing, this one decides size; a renderer typically uses both, in that order.\n *\n * Platform-specific knowledge stays with the platform: the limit itself, which character\n * spans are indivisible (Slack's `<@U123>` addresses), and how an unsplittable span is\n * reported. This module only takes the spans and honors them.\n */\n\n/** A half-open character range `[start, end)` a section boundary must not fall inside. */\nexport interface ProtectedSpan {\n start: number\n end: number\n}\n\n/** Thrown when one protected span is itself longer than a section can hold: delivery FAILS\n * rather than publishing a cut-in-half token. Platforms may supply their own error. */\nexport class UnsplittableSpanError extends Error {\n constructor(readonly fragment: string) {\n super(`split: protected span (${fragment.length} chars) exceeds one message and cannot be split`)\n this.name = 'UnsplittableSpanError'\n }\n}\n\nexport interface SplitSectionsOptions {\n /** Indivisible ranges, sorted by start and non-overlapping (callers merge overlaps). */\n protectedSpans?: readonly ProtectedSpan[]\n /** Builds the error thrown when a protected span cannot fit in one section. */\n unsplittable?: (fragment: string) => Error\n}\n\n/**\n * Split text into sections no longer than maxLen, preferring line boundaries; a single line\n * longer than maxLen is hard-cut. Whitespace-only input yields no sections. Content is never\n * lost across sections — `sections.join('')` reproduces the input byte for byte, including\n * boundary newlines and the whitespace around a protected span.\n *\n * A boundary that would fall INSIDE a protected span is moved back to the start of that span,\n * so the following section begins with the complete token. Moving back can only shorten a\n * section, never grow one past `maxLen`.\n */\nexport function splitIntoSections(text: string, maxLen: number, options: SplitSectionsOptions = {}): string[] {\n if (!text.trim()) return []\n if (text.length <= maxLen) return [text]\n const spans = options.protectedSpans ?? []\n const unsplittable = options.unsplittable ?? ((fragment: string) => new UnsplittableSpanError(fragment))\n for (const span of spans) {\n if (span.end - span.start > maxLen) throw unsplittable(text.slice(span.start, span.end))\n }\n const sections: string[] = []\n let consumed = 0\n while (text.length - consumed > maxLen) {\n const remaining = text.slice(consumed)\n // Prefer ending immediately after the last newline that fits. If none fits (an overlong\n // line, or a newline exactly at maxLen), hard-cut at the limit. Slicing the original\n // string rather than reconstructing lines guarantees join('') is byte-for-byte identical\n // to the input, including boundary newlines.\n const newline = remaining.lastIndexOf('\\n', maxLen - 1)\n let end = consumed + (newline >= 0 ? newline + 1 : maxLen)\n // Absolute-offset spans and an absolute boundary, so the retreat below stays correct no\n // matter how many sections have already been emitted.\n const straddled = spans.find((span) => span.start < end && end < span.end)\n if (straddled) {\n end = straddled.start\n // Retreating to a span that starts at (or before) this section's own start would emit\n // an empty section and loop forever. It means the section begins inside the span —\n // impossible, since the previous iteration ended at a span start and no span is longer\n // than maxLen. Fail loudly instead of hanging.\n if (end <= consumed) throw unsplittable(text.slice(straddled.start, straddled.end))\n }\n sections.push(text.slice(consumed, end))\n consumed = end\n }\n if (consumed < text.length) sections.push(text.slice(consumed))\n return sections\n}\n","/** Last-mile Slack formatting: split verbatim Markdown without breaking mention addresses. */\n\nimport { splitIntoSections as splitTextIntoSections } from '../messages/split-sections.js'\n\n/** Slack caps the combined text of a payload's `markdown` blocks at 12,000 characters. */\nexport const SLACK_MARKDOWN_BLOCK_LIMIT = 12000\n\n/** Native mentions, user groups, broadcasts, and channel links must stay whole to preserve delivery. */\nconst SLACK_ADDRESS_RE = /<[@!#][^>]*>/g\n\n/** Merge native addresses and caller-supplied shared-bot addresses into indivisible spans (§5.3). */\nfunction protectedSpans(text: string, extraAddresses: readonly string[]): { start: number; end: number }[] {\n const spans: { start: number; end: number }[] = []\n for (const match of text.matchAll(SLACK_ADDRESS_RE)) {\n spans.push({ start: match.index, end: match.index + match[0].length })\n }\n for (const address of extraAddresses) {\n if (!address) continue\n for (let at = text.indexOf(address); at >= 0; at = text.indexOf(address, at + 1)) {\n spans.push({ start: at, end: at + address.length })\n }\n }\n // Longest-first at equal starts, so the wider address wins the overlap filter below.\n spans.sort((a, b) => a.start - b.start || b.end - a.end)\n const merged: { start: number; end: number }[] = []\n for (const span of spans) {\n const last = merged[merged.length - 1]\n if (last && span.start < last.end) {\n // Merge overlapping addresses so no boundary can fall inside either one.\n if (span.end > last.end) last.end = span.end\n continue\n }\n merged.push({ ...span })\n }\n return merged\n}\n\n/** Fail delivery when an address cannot fit, rather than silently sending a broken mention (§5.3). */\nexport class UnsplittableAddressError extends Error {\n constructor(readonly address: string) {\n super(`slack: mention address (${address.length} chars) exceeds one message and cannot be split`)\n this.name = 'UnsplittableAddressError'\n }\n}\n\n/** Split on line boundaries within `maxLen`, never inside an address; `join('')` reproduces the input. */\nexport function splitIntoSections(\n text: string,\n maxLen = SLACK_MARKDOWN_BLOCK_LIMIT,\n extraAddresses: readonly string[] = []\n): string[] {\n return splitTextIntoSections(text, maxLen, {\n protectedSpans: protectedSpans(text, extraAddresses),\n unsplittable: (address) => new UnsplittableAddressError(address)\n })\n}\n","// The approval-card facet of Layer 2 (integration-plugin-architecture.md §7.3): how a chat surface offers a permission request as a card people in the conversation answer.\nimport type { RequestPermissionRequest } from '@agentclientprotocol/sdk/unstable'\nimport type { SubsessionNoticeOutcome } from '../slack/render.js'\nimport type { ElicitCardHost, ElicitCardTurn } from './elicit-card.js'\n\n/** Who a background sub-session's card or notice says is asking, on every rewrite too (assistant-mode.md §5.6). */\nexport interface SubsessionAsker {\n readonly agentName: string\n readonly title: string | null\n readonly sessionUrl: string\n readonly waitHours: number\n}\n\n/** A settled sub-session notice's subject; a notice swept after a restart may have lost its session. */\nexport interface SubsessionNoticeView {\n readonly agentName: string\n readonly title: string | null\n readonly sessionUrl?: string\n}\n\n/** What an editor's card in their own chat says it is for: the agent, who asked, and the session's page. */\nexport interface ApprovalCardContext {\n readonly agentName: string\n readonly requesterName: string | null\n readonly sessionUrl: string\n}\n\n/** One permission request as core hands it to a surface. */\nexport interface ApprovalCardAsk {\n /** The unguessable id every button on the card carries back. */\n readonly requestId: string\n /** The ACP request, already secret-masked by core; the card offers its options in this order. */\n readonly params: RequestPermissionRequest\n /** The opaque target a relay-forwarded click carries back to this daemon; ignored where ingress is the daemon's own. */\n readonly sessionTarget?: string\n /** The agent and integration the card is posted through, for a surface whose relay routes a click by the target it names. */\n readonly via?: { readonly agentId: string; readonly integrationId: string }\n /** Set when a background sub-session asks: the card names and links it above the request. */\n readonly subsession?: SubsessionAsker\n /** Set on a card sent to an editor outside the conversation: it names and links what it is for. */\n readonly context?: ApprovalCardContext\n}\n\n/** How a card reads once it takes no answer. */\nexport interface ApprovalCardSettlement {\n readonly params: RequestPermissionRequest\n readonly subsession?: SubsessionAsker\n readonly context?: ApprovalCardContext\n /** What happened, with who answered where someone did: \"Allow — Ada\", \"Cancelled\". */\n readonly text: string\n /** Undefined when nothing was decided: cancelled, expired, or approving in chat turned off. */\n readonly allowed?: boolean\n /** The notification text beside the rewrite, where the platform shows one. */\n readonly fallback: string\n}\n\n/** A card whose request settled while no process could rewrite it (a restart), as its stored row recorded it. */\nexport interface ApprovalCardOrphan {\n readonly command: string\n readonly status: string\n readonly resolvedByName?: string | null\n}\n\n/** A conversation of the platform outside the turn, as a sub-session's card is posted to it. */\nexport interface ApprovalCardPlace {\n readonly channel: string\n /** The conversation's platform thread, as the session records it; absent at its top level. */\n readonly thread?: string\n}\n\n/** A posted card's coordinates: the connection that posted it, where it landed, and its message id once the post returns. */\nexport interface ApprovalCardHandle {\n readonly conn: unknown\n readonly channel: string\n /** The platform thread it was posted into, where a thread is not a channel of its own (Slack's). */\n readonly thread?: string\n ts?: string\n}\n\n/** A card or notice the surface built but has not sent, in its own wire shape. Opaque to core. */\nexport type ApprovalCardDraft = unknown\n\n/** One chat surface's approval-card facet; absent ⇒ approvals there go to the console and the conversation gets a notice. */\nexport interface ApprovalCardFacet {\n /** Diagnostic label, and the namespace of a recorded answerer's id. */\n readonly platform: string\n /** The most options one card offers whole: at most the cap every surface and the console share (#1969). */\n readonly maxOptions: number\n /** The live card for the connection it will be posted on, or null when it cannot offer every option there. */\n build(ask: ApprovalCardAsk, conn?: unknown): ApprovalCardDraft | null\n /** The card once it takes no answer, its buttons gone. */\n settled(card: ApprovalCardSettlement): ApprovalCardDraft\n /** A sub-session's notice where nobody there may answer: it is waiting, and an Agent editor answers in the console. */\n notice(asker: SubsessionAsker): ApprovalCardDraft\n /** That notice once its request settled. */\n noticeSettled(view: SubsessionNoticeView, outcome: SubsessionNoticeOutcome): ApprovalCardDraft\n /** The editor path's notice in the turn's own conversation: an Agent editor answers it in the console. */\n turnNotice(): ApprovalCardDraft\n /** That notice once its request settled; `by` is already unset where the conversation is external. */\n turnNoticeSettled(outcome: SubsessionNoticeOutcome): ApprovalCardDraft\n /** A card or notice a restart left behind, from its stored row. */\n orphaned(row: ApprovalCardOrphan): ApprovalCardDraft\n /** Where a card of this turn lands, when that is not the turn's channel (a Discord thread is a channel of its own). */\n cardChannel?(place: ApprovalCardPlace): string\n /** Post a card in the turn's own conversation, serialized on its apply chain; the message id, or undefined when refused. */\n send(host: ElicitCardHost, turn: ElicitCardTurn, draft: ApprovalCardDraft): Promise<string | undefined>\n /** Post into another conversation of this platform on a connection core resolved for it, under the turn's agent. */\n post(\n conn: unknown,\n place: ApprovalCardPlace,\n draft: ApprovalCardDraft,\n turn: ElicitCardTurn\n ): Promise<string | undefined>\n /** Rewrite a posted card or notice in place; best effort, no outcome depends on it. */\n rewrite(handle: ApprovalCardHandle, draft: ApprovalCardDraft): void\n /** Tell only `userId`, beside the card, why their click was not taken. Absent ⇒ core hands the words back to the click's own ingress, which answers the interaction privately. */\n tellPrivately?(handle: ApprovalCardHandle, userId: string, text: string): void\n /** The most characters a refusal said only to the clicker can carry here, by either path; absent ⇒ no limit core must fit. */\n readonly privateTextLimit?: number\n /** The namespace a clicker's id is scoped to; absent where the platform's user ids are already global. */\n answerScope?(handle: ApprovalCardHandle): string | undefined\n /** A clicker's display name, for a click that carried none. */\n nameOf?(handle: ApprovalCardHandle, userId: string): Promise<string | undefined>\n /** Whether chat approvals are deliverable on `conn` (e.g. callback URL configured); absent ⇒ true. */\n canApproveInChat?(conn: unknown): boolean\n}\n\n/** \"Agent’s task “title”\", or just \"Agent’s task\" without a title; plain text, each surface defuses its own markup. */\nexport function subsessionAskerText(\n agentName: string,\n title: string | null,\n clamp: (s: string, n: number) => string\n): string {\n const agent = `${clamp(agentName, 60)}’s task`\n return title?.trim() ? `${agent} “${clamp(title.trim(), 80)}”` : agent\n}\n\n/** How long a task's request waits, as its card and notice say it. */\nexport function subsessionWaitText(hours: number): string {\n return `If nobody answers within ${hours} hour${hours === 1 ? '' : 's'}, it is denied and the task stops.`\n}\n\n/** How a settled sub-session notice reads, in plain text with literal marks. */\nexport function subsessionSettledText(\n asker: string,\n outcome: SubsessionNoticeOutcome,\n name: (s: string) => string\n): string {\n const by = (word: string, who: string | null): string => (who?.trim() ? ` ${word} ${name(who.trim())}` : '')\n switch (outcome.kind) {\n case 'allowed':\n return `✅ ${asker} got permission${by('from', outcome.by)}.`\n case 'denied':\n return `🚫 ${asker} was denied permission${by('by', outcome.by)}.`\n case 'expired':\n return `🚫 ${asker} got no answer within ${outcome.hours} hour${outcome.hours === 1 ? '' : 's'}, so it was denied and stopped.`\n case 'cancelled':\n return `⏳ ${asker} no longer needs permission.`\n }\n}\n\n/** The editor path's notice in the turn's own conversation; like a sub-session's, it names no tool. */\nexport const TURN_NOTICE_TEXT =\n '🔒 Permission requested. Ask an Agent editor to allow it from the Agent or Session page.'\n\n/** How the turn's notice reads once its request settled, in plain text with literal marks. */\nexport function turnNoticeSettledText(outcome: SubsessionNoticeOutcome, name: (s: string) => string): string {\n const by = (who: string | null): string => (who?.trim() ? ` by ${name(who.trim())}` : '')\n switch (outcome.kind) {\n case 'allowed':\n return `✅ Permission granted${by(outcome.by)}.`\n case 'denied':\n return `🚫 Permission denied${by(outcome.by)}.`\n case 'expired':\n return `🚫 Permission denied: nobody answered within ${outcome.hours} hour${outcome.hours === 1 ? '' : 's'}.`\n case 'cancelled':\n return '⏳ Permission no longer needed.'\n }\n}\n\n/** A settled card's literal mark: allowed, denied, or nothing decided. */\nexport function approvalMark(allowed: boolean | undefined): string {\n return allowed === undefined ? '⏳' : allowed ? '✅' : '🚫'\n}\n\n/** An orphaned row's mark, by its stored status. */\nexport function orphanMark(status: string): string {\n return status === 'allowed' ? '✅' : status === 'denied' ? '🚫' : '⏳'\n}\n","/**\n * Pull human-readable output text out of an ACP tool_call/_update — the ONE copy every\n * platform renderer uses, so a runtime's shape learned once is learned everywhere.\n *\n * Prefers the `content[]` text blocks (the tool's reported output); diff / terminal blocks are\n * skipped — they have no compact inline text. `rawOutput` is the fallback, and it is not one\n * shape: codex-acp sends NO content for a finished shell command — the output rides\n * `rawOutput.formatted_output` (folded there at ACP ingress by `TerminalOutputFolder`) — and\n * wraps an MCP tool's result as `rawOutput.result.content[]` text blocks.\n */\nexport function extractToolOutput(update: { content?: unknown; rawOutput?: unknown }): string {\n const content = update.content\n if (Array.isArray(content)) {\n const parts: string[] = []\n for (const item of content) {\n if (!item || typeof item !== 'object') continue\n if ((item as { type?: string }).type !== 'content') continue\n const block = (item as { content?: { type?: string; text?: string } }).content\n if (block?.type === 'text' && block.text) parts.push(block.text)\n }\n if (parts.length) return parts.join('\\n').trim()\n }\n const raw = update.rawOutput\n if (typeof raw === 'string') return raw.trim()\n if (raw && typeof raw === 'object') {\n const r = raw as { formatted_output?: unknown; result?: { content?: unknown } }\n if (typeof r.formatted_output === 'string') return r.formatted_output.trim()\n const nested = r.result?.content\n if (Array.isArray(nested)) {\n const parts = nested\n .filter((b): b is { type: string; text: string } => {\n const x = b as { type?: unknown; text?: unknown } | null\n return !!x && x.type === 'text' && typeof x.text === 'string'\n })\n .map((b) => b.text)\n if (parts.length) return parts.join('\\n').trim()\n }\n }\n return ''\n}\n","import type {\n CreateElicitationRequest,\n RequestPermissionRequest,\n SessionUpdate,\n ToolKind\n} from '@agentclientprotocol/sdk/unstable'\nimport {\n ELICIT_ACTION_PREFIX,\n ELICIT_CONFIRM_ACTION,\n ELICIT_DISMISS_ACTION,\n ELICIT_FORM_FIELD_CAP,\n ELICIT_FORM_INPUT_ACTION,\n PERMISSION_ACTION_PREFIX,\n SLACK_STATUS_ACTION,\n elicitFormBlockId,\n elicitFormBlockIndex,\n encodePermValue,\n encodeSlackStatusOverflowValue,\n followUpWatchLabel,\n parseFollowUpWatchUrl\n} from '@agentconnect.md/protocol'\nexport {\n ELICIT_ACTION_PREFIX,\n ELICIT_CONFIRM_ACTION,\n ELICIT_DISMISS_ACTION,\n PERMISSION_ACTION_PREFIX,\n decodePermValue,\n elicitFormBlockId,\n elicitFormViewValues,\n encodePermValue,\n type SlackViewState\n} from '@agentconnect.md/protocol'\nimport { renderAttributionMessage, type ReplyAttributionInfo } from '../messages/attribution.js'\nimport { flattenUnsafeLinks } from '../messages/agent-links.js'\nimport type { WorkspaceFileLinkResolver } from '../messages/workspace-file-links.js'\nimport { AgentMessageRun, WorkBoundary } from '../messages/message-boundary.js'\nimport { splitAtParagraphBoundary } from '../messages/stream-boundary.js'\nimport { permissionModeDisplayLabel } from '../acp/permission-modes.js'\nimport { splitIntoSections } from './formatter.js'\nimport { TURN_NOTICE_TEXT, turnNoticeSettledText } from '../platforms/approval-card.js'\nimport { isNoResponseBody, isNoResponsePrefix } from '../session/no-response.js'\nimport { extractToolOutput } from '../session/tool-output.js'\n\n/**\n * The mode-aware ACP→Slack intermediate representation (§9.1). The daemon's\n * applyAction resolves these against a live SlackConnection:\n * - `post` a finalized body/result section → chat.postMessage in the thread.\n * - `notice` a system line (e.g. the done footer) posted to the thread but not recorded.\n * - `set-status` the transient working indicator (agents.sessions.setStatus; text = on/off only).\n * - `set-title` the native Slack app-thread title (agents.sessions.rename).\n * - `progress` the SINGLE in-place \"main progress\" message (medium/high) — posted\n * once then chat.update-ed in place as tool activity changes (in-place update).\n * - `reasoning` the SINGLE in-place reasoning \"context block\" (high only) — the\n * agent's accumulated thinking, edited in place as more arrives. Kept\n * separate from `progress` so reasoning and tool activity never\n * overwrite each other on one message (§9.1 agent_thought_chunk).\n * - `plan` the SINGLE in-place plan-summary message (medium/high).\n * - `tool-output` a finished tool call's output as a code block (high only) — posted\n * to the thread but NOT recorded (the TranscriptRecorder captures tool\n * rows independently; this is live chrome, not the agent's words).\n */\nexport type SlackAction =\n // `post` carries the agent's own reply text (a flushed message buffer) — the daemon\n // posts it AND records it into the thread transcript (sender = agentId), so other\n // agents replaying the thread see what this one actually said. `attributed: false`\n // is reserved for daemon-generated failure notices that use the same transcript path.\n // `recordOnly: true` writes the text to the transcript WITHOUT posting to the channel —\n // used by `minimal` mode, whose interim segments reach the channel as history cards on\n // the chrome stream rather than as messages.\n // `terminal: true` marks the LAST body section of the turn's final flush: the complete\n // response is known when it posts, so the applier can stamp it `final` at birth\n // (send-message-routing-rework.md §5.5) instead of re-editing it after delivery.\n | { kind: 'post'; text: string; attributed?: boolean; recordOnly?: boolean; terminal?: boolean }\n // `notice` is a system line the daemon posts but must NOT record — recording it would\n // replay daemon chrome back to agents as thread context.\n | { kind: 'notice'; text: string }\n // `lifecycle: 'suspended'` shows the session as waiting on a person instead of working.\n | { kind: 'set-status'; text: string; lifecycle?: 'suspended' }\n | { kind: 'set-title'; text: string }\n | { kind: 'progress'; text: string }\n | { kind: 'reasoning'; text: string }\n // `markdown` is the same plan for a code channel's Plan tab canvas.\n | { kind: 'plan'; text: string; blocks: unknown[]; markdown: string }\n // `tool-output` posts a finished tool's output (code block) but is NOT recorded — same\n // post-but-don't-record contract as `notice`.\n | { kind: 'tool-output'; text: string }\n // `status-bar` is the session-scoped status line (model / context / tokens / cost)\n // rendered as an interactive Block Kit row. Posted once for the Slack session (after\n // the ACP session is up, before the reply), then chat.update-ed in place as later\n // turns progress. `text` is the notification/accessibility fallback; `blocks` is the\n // Block Kit payload. Shown when the Agent's status-bar setting is enabled. NOT\n // recorded into the transcript.\n | { kind: 'status-bar'; text: string; blocks: unknown[]; info?: StatusBarInfo }\n // Remove a status row left by an earlier turn after the Agent disables it. The daemon\n // clears the persisted ts only after Slack accepts the delete, so a transient failure\n // can retry on the next turn.\n | { kind: 'clear-status-bar'; info?: StatusBarInfo }\n // `attribution` closes the footer lifecycle after the latest reply section was first\n // posted with it. The daemon uses this boundary to retry stale-footer cleanup or refresh\n // final metadata that changed during the prompt. Not transcript content.\n | { kind: 'attribution'; text: string; blocks: unknown[] }\n // ── Native tool-call chrome (slack-streaming-turn-output.md §3) ──────────────\n // On a medium/high turn the in-place `progress` message becomes ONE cards-only\n // `chat.startStream` stream; on a minimal turn the same stream holds the interim reply\n // segments as history cards. The final answer never rides it: posts, the footer, the\n // transcript and the status calls are all unchanged.\n | { kind: 'stream-start' }\n // `progressText` is the same in-place `progress` rendering this batch would have\n // produced, so a turn whose stream never opened degrades to today's message.\n | { kind: 'stream-append'; chunks: SlackStreamChunk[]; progressText?: string }\n // The terminal settle rides the STOP rather than a preceding append, because the two\n // cannot be split: stopping while cards are still `in_progress` makes Slack render\n // \"Something went wrong\", so a refused settle has to hold its own stop back.\n | { kind: 'stream-stop'; settle: SlackStreamChunk[]; progressText?: string }\n\n/** Native progress chunks replace titles, statuses and icons; each bounded body field appends once. */\nexport type SlackStreamChunk =\n | {\n type: 'task_update'\n id: string\n title: string\n status: 'in_progress' | 'complete' | 'error'\n icon?: { type: 'icon'; name: string }\n details?: string\n output?: string\n }\n // The group title summarizes work steps or Minimal's interim reply history.\n | { type: 'plan_update'; title: string }\n\n/** Dynamic identity shown under the last reply section. All Slack integration modes use\n * the same compact `context` footer so shared-bot attribution never looks like body text\n * or causes its console links to sprout rich previews. */\nexport type SlackAttributionInfo = ReplyAttributionInfo\n\nconst THINKING = 'is thinking…'\nconst WORKING = 'is working…'\nconst MAX_LABEL = 100\nconst MAX_STATUS = 50\n// A deliberately compact cap for the reasoning block (well under Slack's markdown-block\n// limit) — it's a live \"current thinking\" view, not the main content, so keep only the\n// newest tail and mark a drop with a leading ellipsis. The raw buffer is soft-capped at\n// 2× so it can't grow unbounded across a long turn.\nconst MAX_REASONING = 2800\n// Every streaming card field caps at 256 characters ON THE WIRE, per chunk. Because nothing\n// appending is ever re-sent, a clamped field is also the card's final size.\nconst MAX_STREAM_TASK = 256\n// A card title is a ONE-LINE step label, so it is clamped far below the wire cap: Slack wraps\n// a long title into a paragraph of shell instead of truncating it, and there is no hover or\n// per-title disclosure to recover the rest. The verbatim command rides the card's code block.\nconst MAX_CARD_TITLE = 72\n// A COMMAND standing in for a missing description is clamped tighter still — Slack's thread\n// panel fits roughly this much on one line (the channel view fits more, mobile less) — and cut\n// at its first shell separator first: the opening command of a `&&` chain is a far better\n// label than 72 characters of run-on shell. The full chain rides the card's code block.\nconst MAX_COMMAND_TITLE = 48\nconst SHELL_SEPARATOR = / (?:&&|\\|\\||;|\\|) /\n/** The card that stands for one thinking run until its first line names it. */\nconst THINKING_CARD = 'Thinking'\nconst TASK_ICONS: Record<ToolKind, string> = {\n read: 'file',\n edit: 'edit',\n delete: 'trash',\n move: 'folder',\n search: 'sparkle',\n execute: 'code',\n think: 'lightbulb',\n fetch: 'globe',\n switch_mode: 'gear',\n other: 'gear'\n}\n/** minimal: the history card for an interim reply whose first line yields no title. */\nconst REPLY_CARD = 'Reply'\n// How much of a thinking run to hold while waiting for its first line to end. A runtime opens\n// a thought with a short `**heading**`, so this only ever buffers one line's worth.\nconst MAX_THINKING_HEAD = 400\n/** The collapsed container's label while the turn is still working (§4). */\nconst STREAM_PLAN_WORKING = 'Working…'\n/** …and after a cancel, a user Stop, or suppression — the in-flight cards settle as errors. */\nconst STREAM_PLAN_STOPPED = 'Stopped'\n/** …and after the RUNTIME dies mid-turn. Same error settle as a stop — the in-flight step did\n * not finish because the turn ended — under the label that says which way it ended. */\nconst STREAM_PLAN_FAILED = 'Failed'\n/** A failed tool's title prefix — words, not card status: any `error` card reddens the whole\n * container (the icon is derived, verified live 2026-08-29), and the title parses no markdown\n * and no shortcodes, so plain text is the entire palette. */\nconst FAILED_PREFIX = '(failed) '\n\nexport function clampTo(s: string, max: number): string {\n const t = s.trim()\n return t.length > max ? `${t.slice(0, max - 1)}…` : t\n}\n\n/** Drop paired bold markers, keeping every other kind of markdown. Card bodies parse markdown,\n * and runtimes write each thought heading as `**heading**` — content worth keeping, shouting\n * not. Bounded to a line so a stray `**` cannot swallow text across paragraphs. */\nfunction stripBoldMarks(s: string): string {\n return s.replace(/\\*\\*([^\\n]+?)\\*\\*/g, '$1').replace(/__([^\\n]+?)__/g, '$1')\n}\n\n/** Flatten markdown emphasis for a card field. Task titles and plan labels render as PLAIN\n * text, so `**bold**` would arrive as literal punctuation rather than styling. */\nfunction plainCardText(s: string): string {\n return s\n .replace(/```[\\s\\S]*?```|`([^`]*)`/g, '$1')\n .replace(/[*_~]{1,3}(?=\\S)([\\s\\S]*?\\S)[*_~]{1,3}/g, '$1')\n .replace(/^\\s{0,3}#{1,6}\\s+/gm, '')\n .replace(/\\s+/g, ' ')\n .trim()\n}\n\nfunction clampLabel(s: string): string {\n return clampTo(s, MAX_LABEL)\n}\n\n/** A card body under a title taken from its first line: '' when the title already shows the\n * whole text, the rest when the title shows the first line whole, the whole body when the\n * title had to clamp it — that line is then what the title could not show. */\nfunction bodyUnderTitle(body: string, title: string): string {\n if (!body || plainCardText(body) === title) return ''\n const nl = body.indexOf('\\n')\n return nl >= 0 && plainCardText(body.slice(0, nl)) === title ? body.slice(nl + 1).trim() : body\n}\n\n/** minimal: a history card's title is the segment's first line, or the fallback when that line\n * is a code fence or flattens to nothing. */\nfunction replyCardTitle(text: string): string {\n const nl = text.indexOf('\\n')\n const line = nl < 0 ? text : text.slice(0, nl)\n return (line.startsWith('```') ? '' : clampTo(plainCardText(line), MAX_CARD_TITLE)) || REPLY_CARD\n}\n\n/** Wrap tool activity (a command line, tool title, or tool output) in a CommonMark code\n * span so it renders monospace and verbatim — Slack posts these as `markdown` blocks, so\n * unwrapped text with `*` / `_` / `#` would otherwise be interpreted as emphasis. A\n * single-line value uses an inline span, multi-line (or `block`-forced) a fenced block;\n * the delimiter is grown past the longest internal backtick run so values containing\n * backticks stay intact (CommonMark's variable-length fence rule). */\nfunction codeSpan(s: string, block = false): string {\n const text = s.trim()\n if (!text) return ''\n const longestRun = Math.max(0, ...[...text.matchAll(/`+/g)].map((m) => m[0].length))\n if (block || text.includes('\\n')) {\n const fence = '`'.repeat(Math.max(3, longestRun + 1))\n return `${fence}\\n${text}\\n${fence}`\n }\n const ticks = '`'.repeat(longestRun + 1)\n // Pad when the content touches a backtick so the delimiters stay unambiguous.\n const pad = text.startsWith('`') || text.endsWith('`') ? ' ' : ''\n return `${ticks}${pad}${text}${pad}${ticks}`\n}\n\n// Head-clamp a finished tool's output for the channel. Kept well under Slack's\n// markdown-block limit (so the whole code block posts as one intact message — a\n// fence split across sections would break) and head-kept because the start of a\n// command's output is usually the most informative; truncation is marked with an\n// ellipsis. Empty/whitespace output yields ''.\nconst MAX_TOOL_OUTPUT = 2800\nfunction capOutput(s: string): string {\n const t = s.trim()\n return t.length > MAX_TOOL_OUTPUT ? `${t.slice(0, MAX_TOOL_OUTPUT - 1)}…` : t\n}\n\n/** A TOP-LEVEL `rawInput` string the runtime wrote about its call; nested `arguments` belong to the tool (`gitlabMergeRequest`'s `description` is a document). */\nfunction rawInputField(update: { rawInput?: unknown }, key: 'command' | 'description' | 'command_description'): string {\n const raw = update.rawInput as Record<string, unknown> | undefined\n if (!raw || typeof raw !== 'object') return ''\n return typeof raw[key] === 'string' ? raw[key].trim() : ''\n}\n\n/** The runtime's own description of a call; Claude Code's shell tools may spell it `command_description`. */\nfunction rawInputDescription(update: { rawInput?: unknown }): string {\n return rawInputField(update, 'description') || rawInputField(update, 'command_description')\n}\n\n/** Whether a runtime's description can stand as a card's one-line label. Even at the top level\n * this is a string we did not author, so it has to LOOK like a label — one line, and short\n * enough that clamping it would not be hiding most of it. */\nfunction isStepLabel(s: string): boolean {\n return s.length > 0 && s.length <= MAX_CARD_TITLE * 2 && !s.includes('\\n')\n}\n\n/** Escape interpolated labels before embedding them in Slack mrkdwn. `|` is a link-label\n * delimiter, so replace it rather than letting a configured display name break the URL. */\nfunction escapeMrkdwnLabel(value: string): string {\n return value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\\|/g, '¦')\n}\n\nconst MAX_SLACK_LINK_URL_LENGTH = 2_048\n\n/** Validate an interpolated Slack link target without normalizing it. Slack parses\n * `<url|label>` itself, so delimiters, controls, and whitespace must never reach\n * that syntax even when the platform URL was derived from configuration. */\nfunction safeSlackLinkUrl(raw?: string): string | undefined {\n if (!raw || raw.length > MAX_SLACK_LINK_URL_LENGTH || /[<>|\\s\\p{Cc}]/u.test(raw)) return undefined\n try {\n const url = new URL(raw)\n if (url.protocol !== 'https:' && url.protocol !== 'http:') return undefined\n return raw\n } catch {\n return undefined\n }\n}\n\nfunction attributionText(info: SlackAttributionInfo): string {\n const sessionUrl = safeSlackLinkUrl(info.sessionUrl)\n return renderAttributionMessage({\n agent: info.botName,\n runtime: info.runtime,\n model: info.model,\n renderSession: sessionUrl ? (label) => label : undefined,\n notice: info.notice\n })\n}\n\nexport function attributionMrkdwn(info: SlackAttributionInfo): string {\n const botName = escapeMrkdwnLabel(info.botName)\n const runtime = escapeMrkdwnLabel(info.runtime)\n const model = escapeMrkdwnLabel(info.model)\n const botUrl = safeSlackLinkUrl(info.botUrl)\n const sessionUrl = safeSlackLinkUrl(info.sessionUrl)\n return renderAttributionMessage({\n agent: botUrl ? `<${botUrl}|${botName}>` : botName,\n runtime,\n model,\n renderSession: (label) => (sessionUrl ? `<${sessionUrl}|${escapeMrkdwnLabel(label)}>` : undefined),\n notice: info.notice ? escapeMrkdwnLabel(info.notice) : undefined\n })\n}\n\n/** The per-turn footer is a compact secondary/gray Slack `context` block. Exported so\n * the daemon can include it in the reply's initial chat.postMessage (the only reliable\n * point at which Slack's unfurl controls apply). */\nexport function buildAttributionBlocks(info: SlackAttributionInfo): { text: string; blocks: unknown[] } {\n return {\n text: attributionText(info),\n blocks: [{ type: 'context', elements: [{ type: 'mrkdwn', text: attributionMrkdwn(info) }] }]\n }\n}\n\ntype PlanEntry = { content?: string; status?: 'pending' | 'in_progress' | 'completed' }\n\n/** A plan entry is a task title, not a paragraph. Slack imposes no length on a rich-text\n * list item (200 items of 3,000 characters all post fine), so this cap is editorial: it\n * keeps one runaway entry from swallowing the message. */\nconst MAX_PLAN_LABEL = 150\n\n/** Render an ACP plan (full entry list, resent on every update) as a native bulleted list:\n * completed entries struck through, the entry in flight bolded, the rest plain, under a\n * `Plan · n/m` heading and ruled top and bottom so it reads as the turn's own artifact\n * rather than one more chrome message in the thread.\n *\n * Deliberately NOT Block Kit `checkboxes`, which is the prettier first instinct: that\n * element is an INPUT with no read-only variant, so it offers a click that can do nothing —\n * the plan belongs to the agent, and a reader ticking a box states nothing the daemon should\n * believe. It also caps at 10 options and 150 characters per label, both ENFORCED rather\n * than truncated. A struck-through line says \"done\" just as plainly and promises nothing.\n *\n * `text` is the notification/fallback string, never displayed when the blocks render. */\nfunction renderPlan(entries: PlanEntry[]): { text: string; blocks: unknown[]; markdown: string } {\n const done = entries.filter((e) => e.status === 'completed').length\n const item = (entry: PlanEntry) => ({\n type: 'rich_text_section',\n elements: [\n {\n type: 'text',\n text: clampTo(entry.content ?? '', MAX_PLAN_LABEL),\n ...(entry.status === 'completed'\n ? { style: { strike: true } }\n : entry.status === 'in_progress'\n ? { style: { bold: true } }\n : {})\n }\n ]\n })\n // The fallback is NOT dead weight beside the blocks: Slack routes top-level `text` to screen\n // readers and to the notification preview, and reads neither from the interior blocks. Left\n // as the bare count it would be the one place the plan does not exist for those two readers,\n // which is a regression against the text renderer this replaces. Statuses spell out as words\n // rather than glyphs, because that is the form being read ALOUD.\n const spoken = (status?: string) =>\n status === 'completed' ? 'done' : status === 'in_progress' ? 'in progress' : 'to do'\n return {\n text: [\n `Plan · ${done}/${entries.length}`,\n ...entries.map((e) => `${spoken(e.status)}: ${clampTo(e.content ?? '', MAX_PLAN_LABEL)}`)\n ].join('\\n'),\n markdown: planCanvasMarkdown(entries),\n blocks: [\n { type: 'divider' },\n { type: 'context', elements: [{ type: 'mrkdwn', text: `*Plan* · ${done}/${entries.length}` }] },\n { type: 'rich_text', elements: [{ type: 'rich_text_list', style: 'bullet', elements: entries.map(item) }] },\n { type: 'divider' }\n ]\n }\n}\n\n/** The plan as canvas markdown: a checklist, the step in progress in bold. Canvases nest no lists inside numbered ones. */\nexport function planCanvasMarkdown(entries: PlanEntry[]): string {\n const line = (entry: PlanEntry) => {\n const content = (entry.content ?? '').replace(/\\s+/g, ' ').trim()\n if (entry.status === 'completed') return `- [x] ${content}`\n return entry.status === 'in_progress' ? `- [ ] **${content}**` : `- [ ] ${content}`\n }\n return ['# Plan', '', ...entries.map(line)].join('\\n')\n}\n\n/** Render the accumulated reasoning trace (high mode) as one in-place message. Posted as\n * a `markdown` block (verbatim CommonMark, so `**bold**`), tail-clamped to a compact cap\n * — the newest thinking is the most relevant, so keep the end and mark truncation with a\n * leading ellipsis. */\nfunction renderReasoning(buf: string): string {\n const trimmed = buf.trim()\n const tail = trimmed.length > MAX_REASONING ? `…${trimmed.slice(-MAX_REASONING)}` : trimmed\n return `:thought_balloon: **Thinking**\\n${tail}`\n}\n\n/** The session status-bar inputs: the model selector (distilled by the daemon) plus the\n * folded ACP usage snapshot. Every field is optional — a runtime may advertise no model,\n * and context/token/cost each arrive on their own cadence (context/cost stream live;\n * token totals refresh at turn end). */\nexport interface StatusBarInfo {\n runtime?: string\n model?: string\n effort?: string\n /** Effective session permission preset. Codex Auto is a composite value, not a raw ACP mode. */\n permissionMode?: string\n fastMode?: boolean\n contextUsed?: number\n contextSize?: number\n totalTokens?: number\n costAmount?: number\n costCurrency?: string\n // Selectable model / effort lists + whether a fast toggle is offered — the modal's\n // dropdowns/toggle (and the console's, carried on the webchat frame). renderStatusBar\n // ignores these; only buildStatusModal / the web bar consume them.\n models?: string[]\n efforts?: string[]\n /** Selectable session presets; may include the synthetic Codex Auto value. */\n permissionModes?: string[]\n fastModeAvailable?: boolean\n /** A message sent during this turn can be steered into it (webchat status only). */\n steerable?: boolean\n // Current Slack output verbosity (daemon-side minimal/low/medium/high). Modal-only selector;\n // the level set is a fixed enum, so there's no \"available\" list. renderStatusBar ignores it.\n outputMode?: 'none' | 'minimal' | 'low' | 'medium' | 'high'\n sessionId?: string\n // Full token breakdown — shown in the Slack modal's detail block (the compact line only\n // shows totalTokens). All optional; absent fields are simply omitted from the detail.\n inputTokens?: number\n outputTokens?: number\n thoughtTokens?: number\n cachedReadTokens?: number\n cachedWriteTokens?: number\n}\n\n/** Concrete agent identity shown at the top of the Session modal. Kept separate from\n * StatusBarInfo so agent chrome never leaks into the compact status/webchat payload. */\nexport interface StatusModalIdentity {\n name: string\n agentUrl?: string\n iconUrl?: string\n sessionTitle?: string\n}\n\n/** Compact a token count as `1.2k` / `3.4M` (whole numbers under 1000 stay verbatim). */\nfunction compactCount(n: number): string {\n if (n < 1000) return String(n)\n if (n < 1_000_000) return `${(n / 1000).toFixed(n < 10_000 ? 1 : 0)}k`\n return `${(n / 1_000_000).toFixed(1)}M`\n}\n\n/** Render the compact in-thread status line as one `markdown` block — e.g.\n * `:bar_chart: *opus-4.8* · fast · ctx 120k/200k (60%) · 45.2k tok`. Deliberately narrow:\n * effort and cost are omitted here (they live in the Configure modal) to keep the line short in a\n * Slack thread. Pure: unknown fields are dropped so a partial snapshot still yields a clean\n * line, and an empty snapshot degrades to a bare `:bar_chart: —` placeholder. */\nexport function renderStatusBar(info: StatusBarInfo): string {\n const parts: string[] = []\n if (info.model) parts.push(`*${escapeMrkdwnLabel(info.model)}*`)\n if (info.fastMode) parts.push('fast')\n if (info.contextUsed !== undefined && info.contextSize !== undefined && info.contextSize > 0) {\n const pct = Math.round((info.contextUsed / info.contextSize) * 100)\n parts.push(`ctx ${compactCount(info.contextUsed)}/${compactCount(info.contextSize)} (${pct}%)`)\n } else if (info.contextUsed !== undefined) {\n parts.push(`ctx ${compactCount(info.contextUsed)}`)\n }\n if (info.totalTokens !== undefined) parts.push(`${compactCount(info.totalTokens)} tok`)\n return `:bar_chart: ${parts.length ? parts.join(' · ') : '—'}`\n}\n\n// Native code-channel chrome stays compact; the settings modal owns output mode and token totals.\nexport function renderCodeContextLabels(info: StatusBarInfo): { model: string; context?: string } {\n const model = clampTo([info.model, info.effort].filter(Boolean).join(' · ') || 'Session settings', 128)\n const context =\n info.contextUsed === undefined\n ? undefined\n : `${compactCount(info.contextUsed)}${info.contextSize !== undefined && info.contextSize > 0 ? `/${compactCount(info.contextSize)}` : ''}`\n return { model, context }\n}\n\n/** Slack action_ids for the interactive status bar + modal. The protocol owns the\n * values because a shared bot receives the same actions on the relay first. */\nexport const STATUS_ACTION = SLACK_STATUS_ACTION\n\n/** URL-only OAuth button. Direct Socket Mode bots still receive its interaction\n * payload and must ACK it; shared HTTP bots are ACKed by the relay ingress. */\nexport const PERMISSION_UPDATE_ACTION = 'ac_update_permissions'\n/** A capability card's link button (capability-requests.md §4.4.2): Slack still sends its click, which is acked and ignored. */\nexport const CAPABILITY_OPEN_ACTION = 'ac_capability_open'\n\n/** The modal view's callback_id — used if we ever handle a submit (controls apply on\n * interaction today, so there's no submit). */\nexport const STATUS_MODAL_CALLBACK = 'ac_status_modal'\n\n/** Human label for a permission request: the runtime's description, else `toolCall.title` (a shell title is the raw command), `kind`, `toolCallId`. */\nexport function permToolLabel(params: RequestPermissionRequest): string {\n const tc = params.toolCall\n const label =\n permDescription(params) || tc?.title?.trim() || tc?.kind?.trim() || tc?.toolCallId?.trim() || 'a tool call'\n return clampTo(label, 200)\n}\n\n/** A shell request's one-line description, read only beside a `command`: an MCP tool's top-level input may have a `description` argument. */\nfunction permDescription(params: RequestPermissionRequest): string {\n const tc = params.toolCall\n if (!tc || !rawInputField(tc, 'command')) return ''\n const description = rawInputDescription(tc)\n return isStepLabel(description) ? description : ''\n}\n\n/** The command a described request will run, so a card never shows only the model's account of it; '' when the label is the title. */\nexport function permToolCommand(params: RequestPermissionRequest): string {\n const tc = params.toolCall\n return tc && permDescription(params) ? rawInputField(tc, 'command') : ''\n}\n\n/** How much of a permission request's command a card shows. */\nexport const PERMISSION_COMMAND_CAP = 1500\n\n/** {@link permToolCommand} clamped for a card, '' when there is none. */\nexport function permCommandText(params: RequestPermissionRequest): string {\n const command = permToolCommand(params)\n return command ? clampTo(command, PERMISSION_COMMAND_CAP) : ''\n}\n\n/** `text` with the request's command on its own line, passed through `format`, for a plain-text card. */\nexport function appendPermCommand(\n text: string,\n params: RequestPermissionRequest,\n format: (command: string) => string = (command) => command\n): string {\n const command = permCommandText(params)\n return command ? `${text}\\n${format(command)}` : text\n}\n\n/** A described request's command as its own code-block section (backtick runs split, since mrkdwn fences cannot grow); none otherwise. */\nfunction permCommandBlocks(params: RequestPermissionRequest): unknown[] {\n const command = permCommandText(params)\n if (!command) return []\n const body = clampTo(escapeSlackMrkdwn(command.replace(/`(?=`)/g, '`\\u200b')), SLACK_SECTION_TEXT_CAP - 8)\n return [{ type: 'section', text: agentMrkdwn(`\\`\\`\\`\\n${body}\\n\\`\\`\\``) }]\n}\n\n/** Slack button color for a permission option: green for allow, red for reject, default\n * (gray) for anything else the runtime might send. */\nfunction permOptionStyle(kind: string): 'primary' | 'danger' | undefined {\n if (kind === 'allow_once' || kind === 'allow_always') return 'primary'\n if (kind === 'reject_once' || kind === 'reject_always') return 'danger'\n return undefined\n}\n\n/** How many option buttons one permission card offers. Slack allows 25 elements in one `actions`\n * block and wraps them across lines, and this card puts nothing else in that block — so the cap\n * is the block's own, not a row's. The 5 this used to slice to was neither. */\nexport const SLACK_PERMISSION_MAX_OPTIONS = 25\n\n/** The permission card: label, command, one `<requestId>|<optionId>` button per option; null when not every option fits, never a partial menu (#1811). */\nexport function buildPermissionCard(\n requestId: string,\n params: RequestPermissionRequest,\n sessionTarget?: string\n): unknown[] | null {\n if (!params.options.length || params.options.length > SLACK_PERMISSION_MAX_OPTIONS) return null\n const header = `:lock: *Permission requested* — ${escapeSlackMrkdwn(permToolLabel(params))}`\n const buttons = params.options.map((o, i) => {\n const style = permOptionStyle(o.kind)\n return {\n type: 'button',\n action_id: `${PERMISSION_ACTION_PREFIX}:${i}`,\n text: { type: 'plain_text', text: clampTo(o.name, 75), emoji: true },\n value: encodePermValue(requestId, o.optionId),\n ...(style ? { style } : {})\n }\n })\n return [\n { type: 'section', text: agentMrkdwn(header) },\n ...permCommandBlocks(params),\n { type: 'actions', ...(sessionTarget ? { block_id: sessionTarget } : {}), elements: buttons }\n ]\n}\n\n/** The settled permission card, buttons replaced by `decision`; `allowed` picks the icon (undefined ⇒ ⌛ cancelled/expired). Pure. */\nexport function buildPermissionResolvedCard(\n params: RequestPermissionRequest,\n decision: string,\n allowed?: boolean\n): unknown[] {\n const icon = allowed === undefined ? ':hourglass:' : allowed ? ':white_check_mark:' : ':no_entry_sign:'\n return [\n {\n type: 'section',\n text: agentMrkdwn(\n `:lock: *Permission* — ${escapeSlackMrkdwn(permToolLabel(params))}\\n${icon} ${escapeSlackMrkdwn(decision)}`\n )\n },\n ...permCommandBlocks(params)\n ]\n}\n\n/** Context header for an approval DM (slack-approval-dm.md §5.2): which agent is\n * asking, who triggered the turn, a quote of the triggering Slack message, the\n * console session deep link, and a permalink to the source thread. Pure. */\nexport function buildApprovalDmIntro(info: {\n agentName: string\n requesterName?: string | null\n sessionUrl: string\n sourceUrl?: string\n sourceText?: string\n /** A background sub-session is asking (assistant-mode.md §5.6); `sessionUrl` is its own page. */\n subsession?: { title: string | null; waitHours: number }\n}): unknown[] {\n if (info.subsession) {\n const { title, waitHours } = info.subsession\n return [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: `${subsessionAsker(info.agentName, title)} is waiting on an approval. ${subsessionWaitNote(waitHours)}\\n<${info.sessionUrl}|Open the task>`\n }\n }\n ]\n }\n const requester = info.requesterName ? ` for *${escapeMrkdwnLabel(clampTo(info.requesterName, 60))}*` : ''\n // Quoted on every line so a multi-line message stays one visual quote block.\n const quote = info.sourceText?.trim()\n ? `\\n${clampTo(info.sourceText.trim(), 300)\n .split('\\n')\n .map((line) => `> ${line}`)\n .join('\\n')}`\n : ''\n const links = [`<${info.sessionUrl}|Open session>`, ...(info.sourceUrl ? [`<${info.sourceUrl}|Source thread>`] : [])]\n return [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: `*${escapeMrkdwnLabel(clampTo(info.agentName, 60))}* is waiting on an approval${requester}.${quote}\\n${links.join(' · ')}`\n }\n }\n ]\n}\n\n/** The owner's DM when an API caller answers a computer-use approval on its own stream (computer-use.md §4.2). Pure. */\nexport function buildComputerCallerApprovalNotice(info: {\n agentName: string\n title: string\n sessionUrl: string\n}): unknown[] {\n const link = safeSlackLinkUrl(info.sessionUrl)\n return [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text:\n `:computer: *${escapeMrkdwnLabel(clampTo(info.agentName, 60))}* asked for approval to use your Computer: ` +\n `${escapeMrkdwnLabel(clampTo(info.title, 200))}. The API caller that started this session answers it.` +\n (link ? `\\n<${link}|Open session>` : '')\n }\n }\n ]\n}\n\n/** \"Agent's task “label”\", the subject of every task approval card; no quote without a label. */\nfunction subsessionAsker(agentName: string, title: string | null): string {\n const agent = `*${escapeMrkdwnLabel(clampTo(agentName, 60))}*’s task`\n return title?.trim() ? `${agent} “${escapeMrkdwnLabel(clampTo(title.trim(), 80))}”` : agent\n}\n\nconst subsessionWaitNote = (hours: number): string =>\n `If nobody answers within ${hours} hour${hours === 1 ? '' : 's'}, it is denied and the task stops.`\n\n/** The header of a sub-session's approval card in the conversation it belongs to (assistant-mode.md §5.6). Pure. */\nexport function buildSubsessionApprovalIntro(info: {\n agentName: string\n title: string | null\n sessionUrl: string\n waitHours: number\n}): unknown[] {\n return [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: `${subsessionAsker(info.agentName, info.title)} is asking for permission. ${subsessionWaitNote(info.waitHours)}\\n<${info.sessionUrl}|Open the task>`\n }\n }\n ]\n}\n\n/** The neutral notice a sub-session's request leaves in its conversation when only an Agent editor may answer it (§5.6). Pure. */\nexport function buildSubsessionApprovalNotice(info: {\n agentName: string\n title: string | null\n sessionUrl: string\n waitHours: number\n}): unknown[] {\n return [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text:\n `:lock: ${subsessionAsker(info.agentName, info.title)} is waiting for permission. Ask an Agent editor to ` +\n `allow it from the Agent or Session page. ${subsessionWaitNote(info.waitHours)}\\n<${info.sessionUrl}|Open the task>`\n }\n }\n ]\n}\n\n/** How a sub-session's request ended, as its settled notice says (§5.6). */\nexport type SubsessionNoticeOutcome =\n { kind: 'allowed' | 'denied'; by: string | null } | { kind: 'expired'; hours: number } | { kind: 'cancelled' }\n\n/** The neutral notice rewritten in place once its request settles; like the notice, it names no tool (§5.6). Pure. */\nexport function buildSubsessionApprovalSettledNotice(\n info: { agentName: string; title: string | null; sessionUrl?: string },\n outcome: SubsessionNoticeOutcome\n): unknown[] {\n const link = info.sessionUrl ? `\\n<${info.sessionUrl}|Open the task>` : ''\n return [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: `${subsessionSettledLine(subsessionAsker(info.agentName, info.title), outcome)}${link}`\n }\n }\n ]\n}\n\n/** The editor path's notice in the turn's own conversation, rewritten in place once its request settles. Pure. */\nexport function buildTurnApprovalNotice(outcome?: SubsessionNoticeOutcome): unknown[] {\n const text = outcome\n ? turnNoticeSettledText(outcome, (name) => escapeMrkdwnLabel(clampTo(name, 60)))\n : TURN_NOTICE_TEXT\n return [{ type: 'section', text: { type: 'mrkdwn', text } }]\n}\n\nfunction subsessionSettledLine(asker: string, outcome: SubsessionNoticeOutcome): string {\n const by = (word: string, name: string | null): string =>\n name?.trim() ? ` ${word} ${escapeMrkdwnLabel(clampTo(name.trim(), 60))}` : ''\n switch (outcome.kind) {\n case 'allowed':\n return `:white_check_mark: ${asker} got permission${by('from', outcome.by)}.`\n case 'denied':\n return `:no_entry_sign: ${asker} was denied permission${by('by', outcome.by)}.`\n case 'expired':\n return `:no_entry_sign: ${asker} got no answer within ${outcome.hours} hour${outcome.hours === 1 ? '' : 's'}, so it was denied and stopped.`\n case 'cancelled':\n return `:hourglass: ${asker} no longer needs permission.`\n }\n}\n\n/** What an assistant-mode draft card shows (assistant-mode.md §5.5); a `task` is a check's proposal (§5.10), whose text is the task. */\nexport interface AssistantDraftCardView {\n agentName: string\n iconUrl?: string\n kind: 'reply' | 'elsewhere' | 'task'\n /** A proposal's own sentence, which the card leads with, its reason, and a follow-up form's follow-up. */\n proposal?: {\n sentence: string\n why: string\n followUp?: { title: string; doneWhen: string; nextCheck: number | null; watch?: string | null }\n }\n target: {\n platform: string\n channel: string\n isDm: boolean\n external: boolean\n /** The conversation's name, or the DM recipient's display name. */\n name?: string\n /** The DM recipient's platform user id. */\n userId?: string\n thread?: string\n threadLink?: string\n }\n /** The target platform's own name, for a place the reader cannot open from this workspace. */\n platformName: string\n text: string\n sessionUrl?: string\n}\n\n/** The draft card's buttons; values ride `ac_perm` so both Slack transports already route the click. */\nexport const ASSISTANT_DRAFT_CHOICES = { approve: 'approve', discard: 'discard' } as const\nexport type AssistantDraftChoice = keyof typeof ASSISTANT_DRAFT_CHOICES\n\n/** How much of a draft one card shows; the markdown block holds 12,000 characters. */\nconst DRAFT_CARD_TEXT_CAP = 10_000\n\n/** The actual destination: the recipient of a DM, the conversation by name, and its platform when it is not Slack. */\nfunction draftPlace(view: AssistantDraftCardView): string {\n const { target } = view\n const slack = target.platform === 'slack'\n const on = slack ? '' : ` on ${escapeMrkdwnLabel(view.platformName)}`\n const name = target.name ? escapeMrkdwnLabel(clampTo(target.name, 80)) : undefined\n if (target.isDm) {\n const who = slack && target.userId ? `<@${escapeMrkdwnLabel(target.userId)}>` : name ? `*${name}*` : undefined\n return who ? `a direct message to ${who}${on}` : `a direct message${on}`\n }\n if (slack) return `<#${escapeMrkdwnLabel(target.channel)}>${name ? ` (#${name})` : ''}`\n return `*${name ?? escapeMrkdwnLabel(target.channel)}*${on}`\n}\n\n/** The destination's identifiers: the conversation id, and the thread by link or id. */\nfunction draftDestinationNote(view: AssistantDraftCardView): string {\n const { target } = view\n const parts = [`${escapeMrkdwnLabel(view.platformName)} \\`${escapeMrkdwnLabel(target.channel)}\\``]\n if (target.isDm && target.name && target.userId) parts.push(escapeMrkdwnLabel(clampTo(target.name, 80)))\n if (target.thread) {\n const link = safeSlackLinkUrl(target.threadLink)\n parts.push(\n link ? `<${link}|thread ${escapeMrkdwnLabel(target.thread)}>` : `thread \\`${escapeMrkdwnLabel(target.thread)}\\``\n )\n }\n return parts.join(' · ')\n}\n\n/** The one plain sentence a draft card leads with: where it goes, and that it posts on approval; a proposal's own sentence, bold, as the bot already names its sender. */\nfunction draftSentence(view: AssistantDraftCardView): string {\n if (view.kind === 'task') return `*${escapeSlackMrkdwn(clampTo(view.proposal?.sentence.trim() ?? '', 300))}*`\n const agent = `*${escapeMrkdwnLabel(clampTo(view.agentName, 60))}*`\n const place = draftPlace(view)\n if (view.kind === 'reply') {\n return `${agent} drafted a reply in ${place}, which is shared with another organization. It posts in the same thread once you approve.`\n }\n const external = view.target.external ? ', which is shared with another organization,' : ''\n return `${agent} will post this to ${place}${external} once you approve.`\n}\n\n/** The exact text, quoted; a text longer than the card holds says how much is shown. A proposal shows its reason and what it does. */\nfunction draftBody(view: AssistantDraftCardView): unknown[] {\n if (view.kind === 'task') return proposalBody(view)\n const shown = view.text.length > DRAFT_CARD_TEXT_CAP ? view.text.slice(0, DRAFT_CARD_TEXT_CAP) : view.text\n const quoted = shown\n .split('\\n')\n .map((line) => `> ${line}`)\n .join('\\n')\n const blocks: unknown[] = [{ type: 'markdown', text: quoted }]\n const notes: string[] = [draftDestinationNote(view)]\n if (shown.length < view.text.length) {\n notes.push(`Showing the first ${shown.length} of ${view.text.length} characters; the whole text posts.`)\n }\n const session = safeSlackLinkUrl(view.sessionUrl)\n if (session) notes.push(`<${session}|Open session>`)\n blocks.push({ type: 'context', elements: [{ type: 'mrkdwn', text: notes.join(' · ') }] })\n return blocks\n}\n\n/** A proposal's reason; a follow-up form's, then what it will do and its first check. */\nfunction proposalBody(view: AssistantDraftCardView): unknown[] {\n const why = view.proposal?.why.trim() ?? ''\n const blocks: unknown[] = why ? [{ type: 'markdown', text: clampTo(why, 2_000) }] : []\n const followUp = view.proposal?.followUp\n return followUp ? [...blocks, ...followUpProposalBody(followUp)] : blocks\n}\n\n/** A follow-up form's sentence of what it will do, what it watches, and its first check as a date in the reader's own time zone. */\nfunction followUpProposalBody(followUp: {\n doneWhen: string\n nextCheck: number | null\n watch?: string | null\n}): unknown[] {\n const doneWhen = followUp.doneWhen.trim()\n const at = followUp.nextCheck\n const watched = followUp.watch ? parseFollowUpWatchUrl(followUp.watch) : undefined\n return [\n ...(doneWhen ? [{ type: 'markdown', text: clampTo(doneWhen, 2_000) }] : []),\n ...(watched && 'target' in watched\n ? [\n {\n type: 'context',\n elements: [{ type: 'mrkdwn', text: escapeMrkdwnLabel(`Watches ${followUpWatchLabel(watched.target)}`) }]\n }\n ]\n : []),\n // Slack's date token renders in the reader's own time zone, which a markdown block does not.\n ...(at === null\n ? []\n : [\n {\n type: 'context',\n elements: [\n {\n type: 'mrkdwn',\n text: `🕒 <!date^${Math.floor(at / 1000)}^{date_short_pretty} {time}|${new Date(at).toISOString()}>`\n }\n ]\n }\n ])\n ]\n}\n\n/** A pending draft: the sentence, the exact text, and approve / discard; a proposal offers approve / deny. */\nexport function buildAssistantDraftCard(\n draftId: string,\n view: AssistantDraftCardView,\n options: { routingTarget?: string; notice?: string }\n): unknown[] {\n const button = (choice: AssistantDraftChoice, index: number, text: string, style?: 'primary' | 'danger') => ({\n type: 'button',\n action_id: `${PERMISSION_ACTION_PREFIX}:${index}`,\n text: { type: 'plain_text', text, emoji: true },\n value: encodePermValue(draftId, ASSISTANT_DRAFT_CHOICES[choice]),\n ...(style ? { style } : {})\n })\n const task = view.kind === 'task'\n const elements = [\n button('approve', 0, 'Approve', 'primary'),\n button('discard', 1, task ? 'Deny' : 'Discard', 'danger')\n ]\n return [\n { type: 'section', text: { type: 'mrkdwn', text: draftSentence(view) } },\n ...draftBody(view),\n ...(options.notice\n ? [{ type: 'context', elements: [{ type: 'mrkdwn', text: escapeSlackMrkdwn(clampTo(options.notice, 500)) }] }]\n : []),\n { type: 'actions', ...(options.routingTarget ? { block_id: options.routingTarget } : {}), elements }\n ]\n}\n\n/** A settled draft: the same sentence and text, the buttons replaced by what happened. */\nexport function buildAssistantDraftSettledCard(view: AssistantDraftCardView, outcome: string): unknown[] {\n return [\n { type: 'section', text: { type: 'mrkdwn', text: draftSentence(view) } },\n ...draftBody(view),\n { type: 'section', text: agentMrkdwn(escapeSlackMrkdwn(outcome)) }\n ]\n}\n\n/** Terminal rewrite for a DM card orphaned by a restart or takeover (§5.4): only the\n * stored row survives, so this renders from its bounded summary, no ACP params. Pure. */\nexport function buildApprovalOrphanCard(command: string, status: string, resolvedByName?: string | null): unknown[] {\n const icon = status === 'allowed' ? ':white_check_mark:' : status === 'denied' ? ':no_entry_sign:' : ':hourglass:'\n const by = resolvedByName ? ` by ${escapeSlackMrkdwn(clampTo(resolvedByName, 60))}` : ''\n return [\n {\n type: 'section',\n text: agentMrkdwn(`:lock: *Permission* — ${escapeSlackMrkdwn(clampTo(command, 150))}\\n${icon} ${status}${by}`)\n }\n ]\n}\n\n/** A workspace-level OAuth warning shown when Slack rejects an API call with\n * `missing_scope`. The URL button needs no daemon-side action handling: Slack opens\n * the app's OAuth & Permissions page directly so an owner can update/reinstall it. */\nexport function buildPermissionUpdateCard(updateUrl: string): unknown[] {\n return [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: ':warning: *Permissions update required.* Please update and re-authorize this Slack app to ensure all features work correctly.'\n }\n },\n {\n type: 'actions',\n elements: [\n {\n type: 'button',\n text: { type: 'plain_text', text: 'Update permissions', emoji: true },\n style: 'primary',\n url: updateUrl,\n action_id: PERMISSION_UPDATE_ACTION\n }\n ]\n }\n ]\n}\n\n// ── Elicitation (ACP elicitation/create — structured questions) ──────────────\n\n/** The field shapes an elicitation card can reduce a form to. `multi-enum` answers with a\n * LIST of the chosen values, `number` with a real JS number, the rest with one scalar. */\nexport type ElicitKind = 'enum' | 'boolean' | 'multi-enum' | 'text' | 'number'\n\n/** What a surface declares it is able to render — the field kinds it has controls for, and the\n * most options one of those controls may offer. {@link elicitTarget} skips every property the\n * surface has not claimed on either count, so a kind (or an option list) reaches a surface only\n * once that surface claims it, and a form it cannot show whole is declined rather than trimmed.\n * Every surface limit belongs here: a limit left inside a card builder is one the reduction\n * cannot see, which is exactly how an over-long option list used to be quietly cut to fit. An\n * option's own LENGTH is not among them any more — a Slack card carries positions rather than\n * values ({@link elicitOptionToken}), so no surface refuses a long one (#1794). */\nexport interface ElicitSurface {\n kinds: ReadonlySet<ElicitKind>\n /** The longest typed answer this surface's own control accepts, when that is shorter than\n * {@link ELICIT_TEXT_CAP}. Declared here for the same reason an option limit is: a bound left\n * in a card builder is one the REDUCTION cannot see, so a field the surface could never take\n * whole is discovered at build time, when the only move left is to withhold the entire card.\n * Applied here instead, an unanswerable field is simply not a field — and `elicitForm` then\n * declines the ask only when the schema actually REQUIRED it. */\n textLimits?: { maxLength?: number }\n /** Per-kind option limits, because one surface's controls do not all hold the same list: on\n * Slack a row of buttons and a select menu do not take the same number of options. A kind\n * absent from the map is unlimited — webchat renders them all. Widening one kind's limit\n * never widens another's. */\n optionLimits?: Partial<Record<ElicitKind, { maxOptions?: number }>>\n}\n\n/** Slack's own cap on a `plain_text_input`'s `min_length`/`max_length`. */\nconst SLACK_INPUT_LENGTH_CAP = 3000\n\n/** Slack allows 25 elements in one `actions` block and wraps them across lines, so the card can\n * offer every option of a list this long and still keep its Dismiss button. A longer list is\n * declined: no card is built from a slice of it, which is what made a pick a misreported answer. */\nconst SLACK_ELICIT_MAX_BUTTONS = 24\n\n/** Slack's own cap on a select menu's `options`. */\nconst SLACK_SELECT_MAX_OPTIONS = 100\n\nconst ELICIT_OPTION_TOKEN_PREFIX = 'ac_o'\n\n/** The value one option carries ON A SLACK CARD: its POSITION in the field the card rendered,\n * never the option's own value. Slack caps an option object's `value` at 75 characters and a\n * button's at 2000, so an enum of paths, ids or a long URL could not carry its own answer and\n * was declined outright (#1794). A position always fits, and it resolves without a lookup table\n * to keep: the same trick {@link elicitFormBlockId} already uses for a field's block id, and\n * safe for the same reason — the daemon re-derives the field list from the card's own params\n * (#1815), so the position names the very option that was offered. Every Slack card carries\n * positions, so a token can never be mistaken for a literal one of its own options spells. */\nexport function elicitOptionToken(index: number): string {\n return `${ELICIT_OPTION_TOKEN_PREFIX}${index}`\n}\n\n/** The option one carried card value stands for, or null when it names none this field offered —\n * the server-side half of {@link elicitOptionToken}, and the only way a Slack answer becomes a\n * literal again. Pure. */\nexport function elicitOptionLiteral(target: ElicitTarget, carried: string): string | null {\n if (!carried.startsWith(ELICIT_OPTION_TOKEN_PREFIX)) return null\n const digits = carried.slice(ELICIT_OPTION_TOKEN_PREFIX.length)\n if (!/^\\d+$/.test(digits)) return null\n return target.options[Number(digits)]?.value ?? null\n}\n\n/** The literals a card's carried option value(s) stand for — `carried` unchanged for a field that\n * offers no options, and null when one of them names no option this field rendered, which is the\n * same verdict `fieldAccepts` reaches for an unoffered value. Pure. */\nexport function elicitCardValues(target: ElicitTarget, carried: string | string[]): string | string[] | null {\n if (!target.options.length) return carried\n if (!Array.isArray(carried)) return elicitOptionLiteral(target, carried)\n const out: string[] = []\n for (const one of carried) {\n const literal = elicitOptionLiteral(target, one)\n if (literal === null) return null\n out.push(literal)\n }\n return out\n}\n\n/** Slack renders a lone single-select or boolean as a row of buttons — one tap answers it — and\n * every other shape as `input` blocks in the message with one Confirm, since a select, a\n * checkbox list and a typed box all need something filled in before they can submit. The\n * option-taking controls carry different lists, which is why the limits are per kind rather than\n * one number for the surface. */\nexport const SLACK_ELICIT_SURFACE: ElicitSurface = {\n kinds: new Set<ElicitKind>(['enum', 'boolean', 'multi-enum', 'text', 'number']),\n textLimits: { maxLength: SLACK_INPUT_LENGTH_CAP },\n optionLimits: {\n enum: { maxOptions: SLACK_ELICIT_MAX_BUTTONS },\n 'multi-enum': { maxOptions: SLACK_SELECT_MAX_OPTIONS }\n }\n}\n\n/** The approval DM's card is a button row whose taps settle through the editor path, which holds\n * no per-card state — so every kind that needs a Confirm to submit could be shown there but never\n * confirmed, and all of them are withheld rather than posted dead. What is left is exactly the\n * one-tap half of the in-channel Slack surface. */\nexport const SLACK_DM_ELICIT_SURFACE: ElicitSurface = {\n kinds: new Set<ElicitKind>(['enum', 'boolean']),\n optionLimits: { enum: { maxOptions: SLACK_ELICIT_MAX_BUTTONS } }\n}\n\n/** Webchat's card has toggles, a confirm control and a typed input, so it takes every kind,\n * and its list scrolls, so it declares no option limit. */\nexport const WEBCHAT_ELICIT_SURFACE: ElicitSurface = {\n kinds: new Set<ElicitKind>(['enum', 'boolean', 'multi-enum', 'text', 'number'])\n}\n\n/** The auth CLI drives a real terminal: an arrow-key list for the pickable kinds and a typed\n * line for the rest, so it claims every kind, and its list scrolls like webchat's — no limit. */\nexport const CLI_ELICIT_SURFACE: ElicitSurface = {\n kinds: new Set<ElicitKind>(['enum', 'boolean', 'multi-enum', 'text', 'number'])\n}\n\n/** The `format` values MCP `2025-11-25` defines for an elicited string — exactly these four. */\nexport type ElicitFormat = 'email' | 'uri' | 'date' | 'date-time'\nconst ELICIT_FORMATS: readonly ElicitFormat[] = ['email', 'uri', 'date', 'date-time']\n\n/** The one form field an elicitation card renders as buttons. */\nexport interface ElicitTarget {\n /** Property name in the form schema — the key the accepted value is returned under. */\n propName: string\n kind: ElicitKind\n /** Selectable options: `value` is the wire value returned in the accept content,\n * `label` is the human button text. Empty for `text`/`number`, which offer none. */\n options: { value: string; label: string }[]\n /** Selection bounds from the array schema — `multi-enum` only, absent when unbounded. */\n minItems?: number\n maxItems?: number\n /** String bounds — `text` only. `pattern` is present only when {@link safeElicitPattern} cleared it. */\n minLength?: number\n maxLength?: number\n pattern?: string\n format?: ElicitFormat\n /** Numeric bounds — `number` only; `integer` marks the schema's `integer` type. */\n minimum?: number\n maximum?: number\n integer?: boolean\n /** The schema's `default`, kept only when it satisfies this target's own constraints —\n * the card seeds its control with it, and the reader may still answer something else. */\n defaultValue?: string | number | boolean | string[]\n /** The property's own `description` — the question text, where `title` is only its header\n * (an AskUserQuestion bridge splits them that way). Absent when the schema gave none. */\n description?: string\n /** Set on a select question's free-text companion: the property whose question this box\n * types an answer for. Only ever a `text` target, and only when that question is rendered\n * in the same form — the card then places the box inside it instead of asking it twice. */\n customAnswerFor?: string\n}\n\n/** The longest answer a card accepts: an elicitation asks a question, not for a file. */\nconst ELICIT_TEXT_CAP = 4096\n\n/** The longest answer a PATTERN is matched against. Backtracking cost grows with the input,\n * so a screened pattern is only cheap over a short one — and a patterned field asks for a\n * name or an id, not prose. A longer answer is rejected rather than matched. */\nconst ELICIT_PATTERN_INPUT_CAP = 256\n\n/** The most quantifiers a screened pattern may carry. The group rule below stops nested\n * blow-up, but ADJACENT quantifiers backtrack polynomially with no group at all (`a*a*a*b`),\n * and degree is what the input cap is budgeted against. */\nconst ELICIT_PATTERN_QUANTIFIER_CAP = 3\n\n/**\n * Compile a schema `pattern` only when a linear-time match is assured, since the expression is\n * agent-authored and JS regexes backtrack: over-long sources and every quantified group whose\n * body itself quantifies or alternates ((a+)+, (a|a)*) are refused. A refused pattern makes the\n * property unrenderable, so the form declines rather than accepting an unchecked answer.\n */\nexport function safeElicitPattern(src: string): RegExp | null {\n if (src.length > 200) return null\n // Riskiness of the body being scanned, and of every enclosing group, innermost last.\n const enclosing: boolean[] = []\n let risky: boolean = false\n let quantifiers = 0\n for (let i = 0; i < src.length; i++) {\n const c = src[i]!\n if (c === '\\\\') i++\n else if (c === '[') {\n while (i < src.length && src[i] !== ']') i += src[i] === '\\\\' ? 2 : 1\n } else if (c === '(') {\n enclosing.push(risky)\n risky = false\n // A group modifier ((?:, (?=, (?!, (?<=, (?<name>) is syntax, not a quantifier.\n if (src[i + 1] === '?') {\n i++\n const kind = src[i + 1]\n if (kind === ':' || kind === '=' || kind === '!') i++\n else if (kind === '<') while (i + 1 < src.length && !'>=!'.includes(src[++i] ?? '')) {}\n }\n } else if (c === ')') {\n const body: boolean = risky\n const parent = enclosing.pop()\n if (parent === undefined) return null\n const quantified = i + 1 < src.length && '*+?{'.includes(src[i + 1]!)\n if (quantified && body) return null\n risky = parent || body || quantified\n } else if (c === '|' || '*+?{'.includes(c)) {\n if (c !== '|' && ++quantifiers > ELICIT_PATTERN_QUANTIFIER_CAP) return null\n risky = true\n }\n }\n if (enclosing.length) return null\n try {\n return new RegExp(src)\n } catch {\n return null\n }\n}\n\n/** A schema bound kept only when it is a real finite number. */\nfunction numBound(value: unknown): number | undefined {\n return typeof value === 'number' && Number.isFinite(value) ? value : undefined\n}\n\n/** A string-length bound, kept whenever it is a sane non-negative integer. A bound ABOVE the\n * cap is never dropped: silently losing a minimum would let an answer the schema forbids\n * through, so the caller compares it against the effective cap and declines instead. */\nfunction lengthBound(value: unknown): number | undefined {\n return itemBound(value)\n}\n\n/** The longest answer a text target can actually take: a pattern is only cheap over a short\n * input, so a patterned field's ceiling is the pattern cap rather than the answer cap. */\nfunction effectiveTextMax(pattern: string | undefined): number {\n return pattern === undefined ? ELICIT_TEXT_CAP : ELICIT_PATTERN_INPUT_CAP\n}\n\n/** The four `format` checks, each strict enough that a value passing it is one the agent asked for. */\nconst FORMAT_CHECK: Record<ElicitFormat, (value: string) => boolean> = {\n // Deliberately narrow: one @, no spaces, a dotted host — not a full RFC 5322 grammar.\n email: (v) => /^[^\\s@]+@[^\\s@.]+(\\.[^\\s@.]+)+$/.test(v),\n uri: (v) => {\n try {\n return !!new URL(v).protocol\n } catch {\n return false\n }\n },\n date: (v) => {\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(v)) return false\n // `2025-13-01` matches the shape but is not a date: toISOString would THROW on it.\n const d = new Date(`${v}T00:00:00Z`)\n return !Number.isNaN(d.getTime()) && v === d.toISOString().slice(0, 10)\n },\n 'date-time': (v) =>\n /^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?([Zz]|[+-]\\d{2}:\\d{2})$/.test(v) && !isNaN(Date.parse(v))\n}\n\n/** The options an array property's `items` offers, plus the `anyOf`/`oneOf` titled form. */\nfunction arrayOptions(prop: Record<string, unknown>): { value: string; label: string }[] {\n const items = prop.items as Record<string, unknown> | undefined\n const choices = (items?.anyOf ?? items?.oneOf) as { const?: unknown; title?: unknown }[] | undefined\n if (Array.isArray(choices))\n // A non-string const would make the accepted list lie about the schema's item type.\n return choices.every((o) => typeof o?.const === 'string')\n ? choices.map((o) => ({ value: String(o.const), label: clampTo(String(o.title ?? o.const), 75) }))\n : []\n const en = items?.enum\n return items?.type === 'string' && Array.isArray(en)\n ? en.map((v) => ({ value: String(v), label: clampTo(String(v), 75) }))\n : []\n}\n\n/** A schema bound, kept only when it is a sane non-negative integer. */\nfunction itemBound(value: unknown): number | undefined {\n return typeof value === 'number' && Number.isInteger(value) && value >= 0 ? value : undefined\n}\n\n/** Build the `text` target for a bare string property, or null when a constraint makes it\n * unrenderable: an unsupported `format`, a pattern we refuse to run, an impossible length. */\nfunction textTarget(name: string, prop: Record<string, unknown>, surfaceMax?: number): ElicitTarget | null {\n const format = prop.format\n if (format !== undefined && !ELICIT_FORMATS.includes(format as ElicitFormat)) return null\n const pattern = prop.pattern\n if (pattern !== undefined && (typeof pattern !== 'string' || !safeElicitPattern(pattern))) return null\n const min = lengthBound(prop.minLength)\n const declared = lengthBound(prop.maxLength)\n // The ceiling this surface can actually enforce. A declared minimum above it is\n // unanswerable — dropping it would accept a short answer the schema forbids — and the\n // effective maximum is carried on the target so the browser bounds its own draft by it.\n // Three ceilings, and the lowest wins: what a card accepts at all, what a pattern is cheap over,\n // and what THIS surface's own box holds — a Slack `plain_text_input` takes 3000 where the card\n // cap is 4096, so the same ask is a narrower box there and a shorter one is no answer at all.\n const ceiling = Math.min(effectiveTextMax(typeof pattern === 'string' ? pattern : undefined), surfaceMax ?? Infinity)\n const max = declared === undefined ? ceiling : Math.min(declared, ceiling)\n if (min !== undefined && min > max) return null\n if (max === 0) return null\n return {\n propName: name,\n kind: 'text',\n options: [],\n ...(min !== undefined ? { minLength: min } : {}),\n maxLength: max,\n ...(typeof pattern === 'string' ? { pattern } : {}),\n ...(format !== undefined ? { format: format as ElicitFormat } : {})\n }\n}\n\n/** Build the `number` target for a numeric property, or null when its bounds admit nothing. */\nfunction numberTarget(name: string, prop: Record<string, unknown>): ElicitTarget | null {\n const integer = prop.type === 'integer'\n const min = numBound(prop.minimum)\n const max = numBound(prop.maximum)\n if (min !== undefined && max !== undefined && min > max) return null\n // An integer range spanning no integer at all (0.2 … 0.8) is not a question either.\n if (integer && min !== undefined && max !== undefined && Math.ceil(min) > Math.floor(max)) return null\n return {\n propName: name,\n kind: 'number',\n options: [],\n ...(min !== undefined ? { minimum: min } : {}),\n ...(max !== undefined ? { maximum: max } : {}),\n ...(integer ? { integer: true } : {})\n }\n}\n\n/** Carry the schema's `default` onto a target, but only where the target itself would accept it —\n * the spec asks the card to pre-populate, and pre-populating an answer we would then refuse\n * hands the reader a control that cannot be submitted. */\nfunction withDefault(target: ElicitTarget, raw: unknown): ElicitTarget {\n if (raw === undefined) return target\n const ok =\n target.kind === 'boolean'\n ? typeof raw === 'boolean'\n : target.kind === 'multi-enum'\n ? Array.isArray(raw) && raw.every((v) => typeof v === 'string') && multiSelectAccepts(target, raw)\n : target.kind === 'number'\n ? typeof raw === 'number' && numberAccepts(target, raw)\n : target.kind === 'text'\n ? typeof raw === 'string' && textAccepts(target, raw)\n : typeof raw === 'string' && target.options.some((o) => o.value === raw)\n return ok ? { ...target, defaultValue: raw as ElicitTarget['defaultValue'] } : target\n}\n\n/** The form's `required` property names, as the schema spells them — anything that is not a\n * string is dropped, since it cannot name a property this scan produced. */\nexport function elicitRequiredProps(params: CreateElicitationRequest): string[] {\n const req = (params as { requestedSchema?: { required?: unknown } }).requestedSchema?.required\n return Array.isArray(req) ? req.filter((r): r is string => typeof r === 'string') : []\n}\n\n/** How a form card names one field: the schema's own `title` when it has one, else the property\n * name. A control stacked with others and labelled by neither is not answerable. */\nexport function elicitFieldLabel(params: CreateElicitationRequest, propName: string): string {\n const props = (params as { requestedSchema?: { properties?: Record<string, Record<string, unknown>> } })\n .requestedSchema?.properties\n const title = props?.[propName]?.title\n return clampTo((typeof title === 'string' && title.trim()) || propName, 75)\n}\n\n/** How a MULTI-FIELD card names one field. A select question's free-text companion is named for\n * the question it belongs to (\"Branch (Other)\") rather than on its own: \"Other\" beside a stack\n * of other labels says which words were typed but not what they answer. Pure. */\nexport function elicitFormFieldLabel(params: CreateElicitationRequest, target: ElicitTarget): string {\n const own = elicitFieldLabel(params, target.propName)\n if (!target.customAnswerFor) return own\n return clampTo(`${elicitFieldLabel(params, target.customAnswerFor)} (${own})`, 75)\n}\n\n// ACP's cross-agent marker for a select question's own free-text box, under a namespace-free `_meta` key on purpose.\nconst CUSTOM_ANSWER_META_KEY = '_askUserQuestionCustomAnswer'\n\n// Codex spells the same box its own way: `request_user_input` writes `_meta.codex.isOtherAnswer`, so both are read.\nconst CODEX_CUSTOM_ANSWER_META_KEY = 'codex'\n\n/** The longest question text a card carries under a field's label. */\nconst ELICIT_DESCRIPTION_MAX = 300\n\n/** The marker namespaces above, each with the flag that binds a box inside its question. */\nconst CUSTOM_ANSWER_MARKERS = [\n [CUSTOM_ANSWER_META_KEY, 'isCustomAnswer'],\n [CODEX_CUSTOM_ANSWER_META_KEY, 'isOtherAnswer']\n] as const\n\n/** The question a property's `_meta` claims this free-text box answers, or undefined when it\n * claims none — an unmarked property is a question in its own right. */\nfunction customAnswerOwner(prop: Record<string, unknown>): string | undefined {\n const meta = prop._meta as Record<string, unknown> | undefined\n for (const [key, flag] of CUSTOM_ANSWER_MARKERS) {\n const marker = meta?.[key] as Record<string, unknown> | undefined\n const owner = marker?.questionId\n if (marker?.[flag] === true && typeof owner === 'string' && owner) return owner\n }\n return undefined\n}\n\n/** Whether a property speaks a marker namespace at all, flag or no flag. A producer that speaks\n * one has already said what the box is, so its silence is a statement and not shape to guess at. */\nfunction speaksCustomAnswerMarker(prop: Record<string, unknown>): boolean {\n const meta = prop._meta as Record<string, unknown> | undefined\n return CUSTOM_ANSWER_MARKERS.some(([key]) => !!meta?.[key])\n}\n\n// What a bridge appends to a question's property name when it adds that question's own box:\n// `question_0_custom`, `need_type__other`. Read as the marker of LAST resort, so a bridge that\n// marks nothing (DeepSeek Harness spells the pair by name alone) still folds its box inside the\n// question instead of asking \"Other\" as a question of its own.\nconst CUSTOM_ANSWER_SUFFIXES = ['_custom', '_other', '-custom', '-other'] as const\n\n/** The select question this property name is the free-text box OF, by shape alone: another\n * rendered question's name plus a custom-answer suffix, with a doubled separator (`__other`)\n * read the same as a single one. Undefined when the name claims no question on this card. */\nfunction suffixedCustomAnswerOwner(propName: string, questions: Set<string>): string | undefined {\n const lower = propName.toLowerCase()\n for (const suffix of CUSTOM_ANSWER_SUFFIXES) {\n if (!lower.endsWith(suffix)) continue\n const stem = propName.slice(0, propName.length - suffix.length)\n for (const owner of [stem, stem.slice(0, -1)]) if (owner && questions.has(owner)) return owner\n }\n return undefined\n}\n\n/** A target whose {@link ElicitTarget.defaultValue} still names one of its own options — the\n * seed of a control that lost an option must not be a value the control cannot show. */\nfunction withoutStaleDefault(target: ElicitTarget): ElicitTarget {\n const values = new Set(target.options.map((o) => o.value))\n const raw = target.defaultValue\n const stale = Array.isArray(raw) ? raw.some((v) => !values.has(v)) : typeof raw === 'string' && !values.has(raw)\n if (!stale) return target\n const { defaultValue: _dropped, ...rest } = target\n return rest\n}\n\n/**\n * Every property of the form this surface can render, in schema order: string-enum (`oneOf`\n * titled options or bare `enum`), boolean, string-array multi-select (`items.enum` or\n * `items.anyOf`), free-text string, and number/integer — each only where the CALLING SURFACE\n * declares that kind. At most one target per property, since a property's `type` picks its\n * kind. The shared scan behind {@link elicitTarget} and {@link elicitForm}, so the two can\n * never disagree about what is renderable. Empty for URL-mode and an empty/absent schema.\n */\nfunction elicitCandidates(params: CreateElicitationRequest, surface: ElicitSurface): ElicitTarget[] {\n const p = params as {\n mode?: string\n requestedSchema?: { properties?: Record<string, Record<string, unknown>> }\n }\n if (p.mode !== 'form') return []\n const renderable = surface.kinds\n // A list this surface's control for that kind cannot hold whole is not a renderable field: a\n // card built from part of it would report the reader's pick as their answer to the question.\n const fits = (kind: ElicitKind, options: readonly { value: string }[]) => {\n const limits = surface.optionLimits?.[kind]\n return limits?.maxOptions === undefined || options.length <= limits.maxOptions\n }\n const found: ElicitTarget[] = []\n for (const [name, prop] of Object.entries(p.requestedSchema?.properties ?? {})) {\n const owner = customAnswerOwner(prop)\n // A companion's own description is boilerplate the inline placement already says; the\n // question's is the ask itself, which `title` (a header) does not carry.\n const desc = !owner && typeof prop.description === 'string' ? prop.description.trim() : ''\n const keep = (t: ElicitTarget | null) => {\n if (!t) return\n found.push(\n withDefault(\n {\n ...t,\n ...(desc ? { description: clampTo(desc, ELICIT_DESCRIPTION_MAX) } : {}),\n // Only a typed box can BE a custom answer; a marker on anything else is ignored.\n ...(owner && t.kind === 'text' ? { customAnswerFor: owner } : {})\n },\n prop.default\n )\n )\n }\n if (prop?.type === 'string') {\n const oneOf = prop.oneOf as { const?: unknown; title?: unknown }[] | undefined\n const en = prop.enum as unknown[] | undefined\n const options = Array.isArray(oneOf)\n ? oneOf.map((o) => ({ value: String(o.const), label: clampTo(String(o.title ?? o.const), 75) }))\n : Array.isArray(en)\n ? en.map((v) => ({ value: String(v), label: clampTo(String(v), 75) }))\n : []\n if (options.length && fits('enum', options) && renderable.has('enum'))\n keep({ propName: name, kind: 'enum', options })\n // Free text is the string with nothing to choose from — an enumerated one is a pick,\n // and typing into it would let an unoffered value through.\n if (!options.length && renderable.has('text')) keep(textTarget(name, prop, surface.textLimits?.maxLength))\n }\n if ((prop?.type === 'number' || prop?.type === 'integer') && renderable.has('number'))\n keep(numberTarget(name, prop))\n if (prop?.type === 'array' && renderable.has('multi-enum')) {\n const options = arrayOptions(prop)\n const min = itemBound(prop.minItems)\n const max = itemBound(prop.maxItems)\n // Bounds that admit only the empty selection, or none at all, are not a question.\n const askable = max === undefined || (max > 0 && max >= (min ?? 0))\n if (options.length && fits('multi-enum', options) && askable)\n keep({\n propName: name,\n kind: 'multi-enum',\n options,\n ...(min !== undefined ? { minItems: min } : {}),\n ...(max !== undefined ? { maxItems: max } : {})\n })\n }\n if (prop?.type === 'boolean' && renderable.has('boolean'))\n keep({\n propName: name,\n kind: 'boolean',\n options: [\n { value: 'true', label: 'Yes' },\n { value: 'false', label: 'No' }\n ]\n })\n }\n // A companion whose question this surface did not render has nothing to sit inside, so it\n // stands as a field of its own rather than pointing at a control that is not on the card.\n const questions = new Set(found.filter((t) => !t.customAnswerFor).map((t) => t.propName))\n // The unmarked pair, read by name off the questions that OFFER options — the shape only says\n // \"box for that question\" where the question has choices this box is an alternative to.\n const selects = new Set(found.filter((t) => t.kind === 'enum' || t.kind === 'multi-enum').map((t) => t.propName))\n const required = new Set(elicitRequiredProps(params))\n const bound = found.map((t) => {\n if (t.customAnswerFor) return questions.has(t.customAnswerFor) ? t : dropCustomAnswerFor(t)\n // Only where the property claimed no marker namespace of its own, and only where it is\n // OPTIONAL: a companion is an alternative to a pick, so a REQUIRED text property is a\n // question in its own right whatever it is named, and folding it would place a field the\n // answer cannot omit behind a chip that discloses it.\n if (t.kind !== 'text' || required.has(t.propName)) return t\n if (speaksCustomAnswerMarker(p.requestedSchema?.properties?.[t.propName] ?? {})) return t\n const owner = suffixedCustomAnswerOwner(t.propName, selects)\n return owner ? { ...t, customAnswerFor: owner } : t\n })\n // A question whose box the card offers ITSELF must not also offer that box as a choice: a\n // bridge that appends an \"Other\" option to the enum means \"type below\", but picking it answers\n // the question with a value the agent reads as no answer at all. Matched against the\n // companion's own label rather than any word, and never down to an empty list of options.\n const companionLabel = new Map<string, string>()\n for (const t of bound)\n if (t.customAnswerFor)\n companionLabel.set(t.customAnswerFor, elicitFieldLabel(params, t.propName).trim().toLowerCase())\n return bound.map((t) => {\n const label = companionLabel.get(t.propName)\n if (label === undefined || !t.options.length) return t\n const options = t.options.filter((o) => o.label.trim().toLowerCase() !== label)\n return options.length && options.length < t.options.length ? withoutStaleDefault({ ...t, options }) : t\n })\n}\n\n/** The same target with no owning question — a companion that turned out to point at nothing. */\nfunction dropCustomAnswerFor(target: ElicitTarget): ElicitTarget {\n const { customAnswerFor: _orphan, ...rest } = target\n return rest\n}\n\n/** The elicitation's URL-mode target (ACP `ElicitationUrlMode`), or null when this is not a\n * URL-mode ask. Only `http`/`https` survive: every other scheme — `javascript:`, `data:`,\n * `file:` — is something a consent card must never hand a browser as an href, and the caller\n * declines instead. The URL is returned VERBATIM, never re-serialized, because the reader has\n * to examine the same bytes the agent asked for. Pure. */\nexport function elicitUrl(params: CreateElicitationRequest): { elicitationId: string; url: string } | null {\n const p = params as { mode?: string; url?: unknown; elicitationId?: unknown }\n if (p.mode !== 'url') return null\n if (typeof p.url !== 'string' || typeof p.elicitationId !== 'string' || !p.elicitationId) return null\n if (p.url.length > 2048) return null\n let parsed: URL\n try {\n parsed = new URL(p.url)\n } catch {\n return null\n }\n if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') return null\n return { elicitationId: p.elicitationId, url: p.url }\n}\n\n/**\n * Resolve the single form field an elicitation card renders: the FIRST renderable property\n * that ALONE satisfies the schema's `required`. Returns null for URL-mode, an empty/absent\n * schema, a form whose fields this surface can't render, or one that requires a property other\n * than the rendered target — the daemon then declines rather than accepting a partial answer.\n * A candidate that fails that check does NOT end the scan: a later property may be the sole\n * required one, and stopping here would decline a form this surface can in fact answer. Pure,\n * and shared by every surface so the option values and their interpretation can't drift.\n */\nexport function elicitTarget(params: CreateElicitationRequest, surface: ElicitSurface): ElicitTarget | null {\n const required = elicitRequiredProps(params)\n // A required field we can't render is unanswerable: accepting without it would assert a lie.\n return elicitCandidates(params, surface).find((t) => required.every((r) => r === t.propName)) ?? null\n}\n\n/**\n * Resolve the WHOLE form a card renders one control per: every renderable property, in schema\n * order. Returns null when the surface can render nothing, when a `required` property is not\n * among the rendered set — {@link elicitTarget}'s rule (#1795) generalised from the one\n * rendered field to the rendered set, and still the difference between an honest `accept` and\n * a lie — or when the form asks more than {@link ELICIT_FORM_FIELD_CAP} QUESTIONS. A select\n * question's free-text companion is not one of them: it rides inside the question it belongs\n * to, so pairing every question with an \"Other\" box does not halve the form a card can show.\n * A one-field result is exactly what {@link elicitTarget} would return, which is what keeps a\n * single-field card's wire payload unchanged.\n */\nexport function elicitForm(params: CreateElicitationRequest, surface: ElicitSurface): ElicitTarget[] | null {\n const targets = elicitCandidates(params, surface)\n if (!targets.length || targets.filter((t) => !t.customAnswerFor).length > ELICIT_FORM_FIELD_CAP) return null\n const rendered = new Set(targets.map((t) => t.propName))\n return elicitRequiredProps(params).every((r) => rendered.has(r)) ? targets : null\n}\n\n/** Whether one value answers one field: the arity its kind is answered with, then that kind's\n * own accept check. The single-field card's gate, per field, so a form re-checks every one. */\nexport function fieldAccepts(target: ElicitTarget, value: string | number | string[]): boolean {\n if (Array.isArray(value)) return multiSelectAccepts(target, value)\n if (typeof value === 'number') return numberAccepts(target, value)\n if (target.kind === 'text') return textAccepts(target, value)\n // An enum or boolean answers with one of the values the card itself offered.\n return (target.kind === 'enum' || target.kind === 'boolean') && target.options.some((o) => o.value === value)\n}\n\n/** Whether a form answer is one the card it was posted for can accept: EXACTLY the fields that\n * card rendered (an extra or misspelled key would inject a property the agent never asked\n * for), every `required` one present, and each value valid for its own field. An optional\n * field may simply be absent — legal per the schema, and the reason #1795's rule was narrow.\n * One bad field refuses the whole answer; the card stays live to be answered again. */\nexport function elicitFormAccepts(\n targets: readonly ElicitTarget[],\n required: readonly string[],\n answer: Record<string, string | number | string[]>\n): boolean {\n const byName = new Map(targets.map((t) => [t.propName, t]))\n for (const name of required) if (!Object.hasOwn(answer, name)) return false\n for (const [name, value] of Object.entries(answer)) {\n const target = byName.get(name)\n if (!target || !fieldAccepts(target, value)) return false\n }\n return true\n}\n\n/** The accept content for a form answer: every answered field under its own property name,\n * each carrying the schema's own type — a boolean field's wire value is its option string,\n * which becomes a real boolean here for the same reason the single-field card converts it. */\nexport function elicitFormContent(\n targets: readonly ElicitTarget[],\n answer: Record<string, string | number | string[]>\n): Record<string, string | number | boolean | string[]> {\n const boolean = new Set(targets.filter((t) => t.kind === 'boolean').map((t) => t.propName))\n return Object.fromEntries(\n Object.entries(answer).map(([name, value]) => [name, boolean.has(name) ? value === 'true' : value])\n )\n}\n\n/** Whether a submitted list is an answer this multi-select target actually offered: every value\n * is one of its options, no repeats, and the count inside `minItems`/`maxItems`. */\nexport function multiSelectAccepts(target: ElicitTarget, values: string[]): boolean {\n if (target.kind !== 'multi-enum') return false\n if (new Set(values).size !== values.length) return false\n if (values.length < (target.minItems ?? 0)) return false\n if (target.maxItems !== undefined && values.length > target.maxItems) return false\n return values.every((v) => target.options.some((o) => o.value === v))\n}\n\n/** Whether a typed string is an answer this text target's own schema allows: inside the answer\n * cap and `minLength`/`maxLength`, matching `pattern`, and of the declared `format`. The\n * browser enforces the same rules to keep the control honest; this is what makes them binding. */\nexport function textAccepts(target: ElicitTarget, value: string): boolean {\n if (target.kind !== 'text') return false\n if (value.length > ELICIT_TEXT_CAP) return false\n if (value.length < (target.minLength ?? 0)) return false\n if (target.maxLength !== undefined && value.length > target.maxLength) return false\n if (target.format && !FORMAT_CHECK[target.format](value)) return false\n if (target.pattern === undefined) return true\n // maxLength already carries the pattern ceiling, so the expression only ever runs over a\n // short input; this is the belt to that braces, since the target arrives from a caller.\n if (value.length > ELICIT_PATTERN_INPUT_CAP) return false\n const re = safeElicitPattern(target.pattern)\n return !!re && re.test(value)\n}\n\n/** Whether a typed number is an answer this number target allows: real and finite, inside\n * `minimum`/`maximum`, and a whole number where the schema said `integer`. */\nexport function numberAccepts(target: ElicitTarget, value: number): boolean {\n if (target.kind !== 'number') return false\n if (!Number.isFinite(value)) return false\n if (target.integer && !Number.isInteger(value)) return false\n if (target.minimum !== undefined && value < target.minimum) return false\n return target.maximum === undefined || value <= target.maximum\n}\n\n/** How a card names the shape a `format` asks for — plain words, with an example where the shape\n * is not one, because the reader has to type it from the card alone. */\nconst FORMAT_EXPECTATION: Record<ElicitFormat, string> = {\n email: 'an email address',\n uri: 'a link',\n date: 'a date, like 2026-09-07',\n 'date-time': 'a date and time, like 2026-09-07T09:30:00Z'\n}\n\n/** What a typed field asks for, in plain words and never in schema vocabulary — said when an\n * entry does not fit, so the reader is told the shape rather than the schema keyword. Pure. */\nexport function elicitFieldExpectation(target: ElicitTarget): string {\n if (target.kind === 'number') {\n const noun = target.integer ? 'a whole number' : 'a number'\n const { minimum: min, maximum: max } = target\n if (min !== undefined && max !== undefined) return `${noun} from ${min} to ${max}`\n if (min !== undefined) return `${noun}, ${min} or more`\n return max !== undefined ? `${noun}, ${max} or less` : noun\n }\n const min = target.minLength\n // Only a bound TIGHTER than the ceilings this surface imposes is the reader's to break: our own\n // 4096/256 answer caps are not news, and a target cannot tell a declared 256 from the pattern one.\n const max =\n target.maxLength !== undefined && target.maxLength < ELICIT_PATTERN_INPUT_CAP ? target.maxLength : undefined\n const length =\n min !== undefined && max !== undefined\n ? `${min} to ${max} characters long`\n : min !== undefined\n ? `at least ${min} characters long`\n : max !== undefined\n ? `at most ${max} characters long`\n : ''\n const parts = [target.format ? FORMAT_EXPECTATION[target.format] : 'some text']\n if (length) parts.push(length)\n if (target.pattern !== undefined) parts.push('in the exact format the question asks for')\n return parts.join(', ')\n}\n\n/** The digit shapes a typed number may take. Deliberately narrower than `Number()`, which reads\n * `0x1f`, `Infinity` and whitespace as numbers a reader plainly did not type. */\nconst NUMERIC_REPLY_RE = /^[+-]?(\\d+\\.?\\d*|\\.\\d+)([eE][+-]?\\d+)?$/\n\nconst BARE_URL_RE = /(?:https?:\\/\\/|www\\.)\\S+/gi\n\n/** The agent-authored elicitation `message`, with every link in it defused. A form-mode ask\n * may not send the reader anywhere — the spec keeps URLs on URL-mode elicitations, whose\n * consent card is the only place a URL is ever followable — and Slack turns both bare URLs\n * and `<url|label>` into taps, so the angle-bracket form is escaped and the bare form is\n * wrapped in a code span, which Slack mrkdwn does not autolink. Pure. */\nfunction elicitCardMessage(params: CreateElicitationRequest): string {\n const raw = (params as { message?: string }).message?.trim() || 'The agent needs your input'\n return escapeSlackMrkdwn(raw).replace(BARE_URL_RE, (m) => `\\`${m}\\``)\n}\n\n/** The three characters Slack mrkdwn reads as markup rather than as themselves. Escaping them is\n * how a literal `&`, `<` or `>` reaches the reader — Slack unescapes the entities on display. */\nfunction escapeSlackMrkdwn(raw: string): string {\n return raw.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')\n}\n\n/** The text object for a section quoting agent words, already escaped: `verbatim` stops Slack autolinking a bare URL or domain. */\nfunction agentMrkdwn(text: string): { type: 'mrkdwn'; text: string; verbatim: true } {\n return { type: 'mrkdwn', text, verbatim: true }\n}\n\n/** Slack's own limit on one section's mrkdwn text. */\nconst SLACK_SECTION_TEXT_CAP = 3000\n\n/** How much of the agent's question a card carries. Cut only where Slack itself would refuse the\n * block — the old 400 cut ordinary questions Slack could have shown whole, and {@link clampTo}'s\n * trailing `…` is the only mark a cut ever gets, so a shorter cap is a quieter one. */\nconst ELICIT_MESSAGE_CAP = SLACK_SECTION_TEXT_CAP - 200\n\n/** What a multi-select card says its bounds are, so a refused Confirm is not the reader's first\n * news of them. Slack enforces the maximum itself (`max_selected_items`); the minimum is the\n * one a reader can break, and the daemon re-validates both either way. Empty when unbounded. */\nfunction selectionHint(target: ElicitTarget): string {\n const { minItems: min, maxItems: max } = target\n if (min !== undefined && max !== undefined) return min === max ? `Select exactly ${min}.` : `Select ${min} to ${max}.`\n if (min !== undefined) return `Select at least ${min}.`\n return max !== undefined ? `Select up to ${max}.` : ''\n}\n\n/** The Dismiss button every elicitation card carries — the reader's one explicit `decline`. */\nfunction elicitDismissButton(requestId: string): Record<string, unknown> {\n return {\n type: 'button',\n action_id: ELICIT_DISMISS_ACTION as string,\n text: { type: 'plain_text', text: 'Dismiss', emoji: true },\n value: requestId\n }\n}\n\n/** Element types Slack REFUSES inside a block, by block type. Slack rejects the WHOLE message\n * rather than the offending block, so a card that gets this wrong never posts and its request is\n * cancelled with no trace in the channel — which is exactly how a `multi_static_select` in an\n * `actions` block took down a live session. Verified against the live API, not read off the docs:\n * an `actions` block answers `unsupported element: multiselect` for a multi-select and\n * `unsupported type` for a typed input, and an `input` block holds no button. */\nconst SLACK_FORBIDDEN_ELEMENTS: Readonly<Record<string, ReadonlySet<string>>> = {\n actions: new Set([\n 'multi_static_select',\n 'multi_external_select',\n 'multi_users_select',\n 'multi_conversations_select',\n 'multi_channels_select',\n 'plain_text_input',\n 'number_input',\n 'email_text_input',\n 'url_text_input'\n ]),\n input: new Set(['button', 'overflow'])\n}\n\n/** How many `options` each element type holds. `checkboxes` and `radio_buttons` answer\n * `no more than 10 items allowed` past ten, where the select menus take a hundred — which is why\n * the card picks between them by list length rather than by taste. Verified against the API. */\nconst SLACK_ELEMENT_MAX_OPTIONS: Readonly<Record<string, number>> = {\n checkboxes: 10,\n radio_buttons: 10,\n static_select: 100,\n multi_static_select: 100,\n overflow: 5\n}\n\n/** The elements that HAVE a `max_selected_items`. `checkboxes` does not: Slack answers\n * `invalid additional property` for it, so a checkbox list's upper bound is said in the block's\n * hint and enforced when the answer comes back, never by the control. */\nconst SLACK_MAX_SELECTED_ELEMENTS: ReadonlySet<string> = new Set([\n 'multi_static_select',\n 'multi_external_select',\n 'multi_users_select',\n 'multi_conversations_select',\n 'multi_channels_select'\n])\n\n/** Slack's own caps on one `actions` block's elements, on an option object's `value`, and on an\n * interactive element's own `value`. Every Slack card carries positions rather than agent-authored\n * strings ({@link elicitOptionToken}), so nothing we build should reach either value cap — which\n * is exactly why they are asserted rather than assumed. */\nconst SLACK_ACTIONS_MAX_ELEMENTS = 25\nconst SLACK_OPTION_VALUE_CAP = 75\nconst SLACK_ACTION_VALUE_CAP = 2000\n\n/** Every Slack rule this file has paid for, checked over one card's blocks: the element types a\n * block type refuses, the per-element option caps, `max_selected_items` only where it exists,\n * an `input` block's mandatory element, an option value or an element `value` past Slack's own\n * cap, and block ids unique within the message. Returns the reasons Slack would reject the card,\n * empty when it would take it. Exported and asserted over every card we build, because our own\n * JSON looks valid to us right up until Slack sees it — the only reason #1825 shipped. Pure. */\nexport function slackCardViolations(blocks: readonly unknown[]): string[] {\n const bad: string[] = []\n const seen = new Set<string>()\n for (const [i, raw] of blocks.entries()) {\n const b = raw as SlackBlockShape\n if (typeof b.block_id === 'string') {\n if (seen.has(b.block_id)) bad.push(`blocks/${i}: duplicate block_id \"${b.block_id}\"`)\n seen.add(b.block_id)\n }\n const forbidden = SLACK_FORBIDDEN_ELEMENTS[b.type ?? ''] ?? new Set<string>()\n if (b.type === 'input' && !b.element?.type) bad.push(`blocks/${i}: input block has no element`)\n if (b.type === 'actions' && (b.elements?.length ?? 0) > SLACK_ACTIONS_MAX_ELEMENTS)\n bad.push(`blocks/${i}: ${b.elements?.length} elements in an actions block, past ${SLACK_ACTIONS_MAX_ELEMENTS}`)\n for (const el of [...(b.elements ?? []), ...(b.element ? [b.element] : [])]) {\n if (!el?.type) continue\n if (forbidden.has(el.type)) bad.push(`blocks/${i}: ${el.type} is not allowed in a ${b.type} block`)\n bad.push(...slackElementViolations(el, `blocks/${i}/${el.type}`))\n }\n }\n return bad\n}\n\n/** The shape {@link slackCardViolations} reads a block and its elements through — deliberately\n * everything-optional, since the point is to inspect JSON that may be wrong. */\ninterface SlackElementShape {\n type?: string\n value?: unknown\n options?: { value?: unknown }[]\n initial_options?: { value?: unknown }[]\n initial_option?: { value?: unknown }\n max_selected_items?: unknown\n}\ninterface SlackBlockShape {\n type?: string\n block_id?: string\n elements?: SlackElementShape[]\n element?: SlackElementShape\n}\n\n/** One element's own rules: its option cap, its option values, and whether it may be told a\n * maximum selection at all. Pure. */\nfunction slackElementViolations(el: SlackElementShape, at: string): string[] {\n const bad: string[] = []\n const cap = SLACK_ELEMENT_MAX_OPTIONS[el.type ?? '']\n if (cap !== undefined && (el.options?.length ?? 0) > cap)\n bad.push(`${at}: ${el.options?.length} options, past the ${cap} this element holds`)\n if (el.max_selected_items !== undefined && !SLACK_MAX_SELECTED_ELEMENTS.has(el.type ?? ''))\n bad.push(`${at}: max_selected_items is not a property of this element`)\n const values = [\n ...(el.options ?? []),\n ...(el.initial_options ?? []),\n ...(el.initial_option ? [el.initial_option] : [])\n ]\n for (const o of values)\n if (typeof o?.value === 'string' && o.value.length > SLACK_OPTION_VALUE_CAP)\n bad.push(`${at}: an option value is ${o.value.length} characters, past ${SLACK_OPTION_VALUE_CAP}`)\n // A button's own `value` — the cap that silently cost a long consent URL its whole card.\n if (typeof el.value === 'string' && el.value.length > SLACK_ACTION_VALUE_CAP)\n bad.push(`${at}: a value is ${el.value.length} characters, past ${SLACK_ACTION_VALUE_CAP}`)\n return bad\n}\n\n/**\n * Build the ONE-TAP elicitation card: the agent's `message` and one actions row carrying EVERY\n * {@link elicitTarget} option as a button, plus Dismiss. The choice rides each option's `value`\n * (`<requestId>|<optionToken>`, see {@link elicitOptionToken}). Only a single-select or a boolean\n * is answered this way — one tap IS the answer there, where every other kind needs something\n * filled in first and takes the\n * `input` blocks of {@link buildElicitationFormCard} ({@link elicitCardShape} decides). Returns\n * null when the form can't be rendered on `surface` (caller declines): a kind or an option list\n * it does not claim, which the reduction has already refused. Nothing here trims a list to fit.\n * Pure.\n */\nexport function buildElicitationCard(\n requestId: string,\n params: CreateElicitationRequest,\n sessionTarget?: string,\n surface: ElicitSurface = SLACK_ELICIT_SURFACE\n): unknown[] | null {\n const target = elicitTarget(params, surface)\n if (!target) return null\n const message = elicitCardMessage(params)\n // A lone question that has to be filled in is its own ONE-FIELD form: nothing tapped in an\n // `actions` block can carry what was typed or selected, so the control is an input block.\n if (elicitCardShape([target]) !== 'buttons')\n return buildElicitationFormCard(requestId, params, [target], sessionTarget)\n const buttons = target.options.map((o, i) => ({\n type: 'button',\n action_id: `${ELICIT_ACTION_PREFIX}:${i}`,\n text: { type: 'plain_text', text: o.label, emoji: true },\n value: encodePermValue(requestId, elicitOptionToken(i))\n }))\n buttons.push(elicitDismissButton(requestId) as (typeof buttons)[number])\n return [\n { type: 'section', text: agentMrkdwn(`:speech_balloon: ${clampTo(message, ELICIT_MESSAGE_CAP)}`) },\n { type: 'actions', ...(sessionTarget ? { block_id: sessionTarget } : {}), elements: buttons }\n ]\n}\n\n/** Where a DM sends a reader whose question Slack has no control for. Mirrors the in-channel\n * decline notice's words, minus its verdict: this ask is still open on the editor path. */\nconst ELICIT_DM_UNANSWERABLE =\n \":hourglass: This chat can't collect an answer for it — answer it in the session console, via *Open session* above.\"\n\nconst PERMISSION_DM_UNANSWERABLE =\n \":hourglass: This chat can't show every option for it — decide it in the session console, via *Open session* above.\"\n\n/** The stand-in for an approval DM's permission card that {@link buildPermissionCard} cannot\n * build: the ask, and where every option CAN be seen. The request is untouched — it stays open on\n * the editor path, which is where the DM points — so this is the same promise the elicitation\n * stand-in below makes, for the same reason (#1811). Pure. */\nexport function buildPermissionDmUnanswerableCard(params: RequestPermissionRequest): unknown[] {\n return buildPermissionResolvedCard(params, PERMISSION_DM_UNANSWERABLE, undefined)\n}\n\n/** The stand-in for an approval DM's elicitation card that {@link buildElicitationCard} cannot\n * build for the DM surface (#1794): the question, and where it CAN be answered. Without it the\n * DM went out carrying its intro and nothing else — a live request, no controls, and no hint\n * that the console holds the same ask — until the turn cancelled. The intro above it owns the\n * `Open session` link this points at, so the URL is never repeated. Pure. */\nexport function buildElicitDmUnanswerableCard(params: CreateElicitationRequest): unknown[] {\n return buildElicitationResolvedCard(params, ELICIT_DM_UNANSWERABLE)\n}\n\n/** Build the RESOLVED elicitation card (buttons removed) that replaces {@link\n * buildElicitationCard} once answered, dismissed, or cancelled. Pure. */\nexport function buildElicitationResolvedCard(params: CreateElicitationRequest, decision: string): unknown[] {\n const message = elicitCardMessage(params)\n const text = clampTo(`:speech_balloon: ${clampTo(message, ELICIT_MESSAGE_CAP)}\\n${decision}`, SLACK_SECTION_TEXT_CAP)\n return [{ type: 'section', text: agentMrkdwn(text) }]\n}\n\n// ── Elicitation form cards (`input` blocks in the message, issue #1794's last Slack item) ────\n\n/** The longest list `checkboxes` and `radio_buttons` hold — past ten Slack answers `no more than\n * 10 items allowed`, so a longer list falls back to the select menu, which holds a hundred. */\nconst SLACK_CHOICE_MAX_OPTIONS = 10\n\n/** Slack's own cap on an `input` block's hint. */\nconst SLACK_HINT_TEXT_CAP = 2000\n\n/** The `input` element one form field is answered by: for a pick, the control that fits the list —\n * `radio_buttons`/`checkboxes` for a short one, which show every option without a second tap, and\n * a select menu past what those hold — plus a `plain_text_input` for text and a `number_input` for\n * numbers, each carrying the schema's own bounds so Slack refuses on the card what the daemon\n * would refuse anyway. A checkbox list gets no `max_selected_items` (Slack has no such property\n * there): its bounds are said in the block's hint and enforced when the answer comes back, which\n * is where they were always binding. Null ⇒ this field cannot BE an input block — no options at\n * all, or a minimum length past what an input holds — and the whole card is then withheld rather\n * than posted with a field the reader cannot answer honestly. An option's own length is no longer\n * such a reason: every option carries its POSITION ({@link elicitOptionToken}). Pure. */\nfunction elicitFormInputElement(target: ElicitTarget): Record<string, unknown> | null {\n const action_id = ELICIT_FORM_INPUT_ACTION as string\n if (target.kind === 'text') {\n const min = target.minLength\n // Bounded by the REDUCTION, which drops a field whose own minimum is past this surface's box\n // ({@link SLACK_ELICIT_SURFACE.textLimits}) — so a target that reaches here already fits, and\n // this clamp is a floor under a bug rather than the place the limit is decided.\n const max = Math.min(target.maxLength ?? SLACK_INPUT_LENGTH_CAP, SLACK_INPUT_LENGTH_CAP)\n if (min !== undefined && min > max) return null\n return {\n type: 'plain_text_input',\n action_id,\n ...(min !== undefined ? { min_length: min } : {}),\n max_length: max,\n ...(typeof target.defaultValue === 'string' ? { initial_value: target.defaultValue } : {})\n }\n }\n if (target.kind === 'number') {\n return {\n type: 'number_input',\n action_id,\n is_decimal_allowed: target.integer !== true,\n ...(target.minimum !== undefined ? { min_value: String(target.minimum) } : {}),\n ...(target.maximum !== undefined ? { max_value: String(target.maximum) } : {}),\n ...(typeof target.defaultValue === 'number' ? { initial_value: String(target.defaultValue) } : {})\n }\n }\n const options = target.options.map((o, i) => ({\n text: { type: 'plain_text', text: o.label, emoji: true },\n value: elicitOptionToken(i)\n }))\n if (!options.length) return null\n const short = options.length <= SLACK_CHOICE_MAX_OPTIONS\n if (target.kind === 'multi-enum') {\n const seeded = Array.isArray(target.defaultValue) ? new Set(target.defaultValue) : null\n const initial = seeded ? options.filter((_, i) => seeded.has(target.options[i]!.value)) : []\n if (short)\n return { type: 'checkboxes', action_id, options, ...(initial.length ? { initial_options: initial } : {}) }\n return {\n type: 'multi_static_select',\n action_id,\n placeholder: { type: 'plain_text', text: 'Select options', emoji: true },\n options,\n ...(initial.length ? { initial_options: initial } : {}),\n ...(target.maxItems !== undefined ? { max_selected_items: target.maxItems } : {})\n }\n }\n // A boolean's `default` is a real boolean, so its option value is the string the card spells it with.\n const seed = target.kind === 'boolean' ? String(target.defaultValue) : target.defaultValue\n const seedIndex = target.options.findIndex((o) => o.value === seed)\n const initial = seedIndex < 0 ? undefined : options[seedIndex]\n if (short) return { type: 'radio_buttons', action_id, options, ...(initial ? { initial_option: initial } : {}) }\n return {\n type: 'static_select',\n action_id,\n placeholder: { type: 'plain_text', text: 'Choose one', emoji: true },\n options,\n ...(initial ? { initial_option: initial } : {})\n }\n}\n\n/** What one field's block says under its label: the question's own words, plus a multi-select's\n * bounds, since a checkbox list cannot enforce them itself. Empty when there is nothing to add. */\nexport function elicitFormFieldHint(target: ElicitTarget): string {\n const parts = [target.description ?? '', target.kind === 'multi-enum' ? selectionHint(target) : '']\n return clampTo(parts.filter(Boolean).join(' '), SLACK_HINT_TEXT_CAP)\n}\n\n/**\n * Build the elicitation card whose fields are ANSWERED IN THE MESSAGE: the agent's defused\n * question, then one `input` block per field in schema order — each keyed by {@link\n * elicitFormBlockId}, which is the key its submitted value comes back under — and one actions\n * block carrying Confirm and Dismiss, which share the `block_id` the relay routes on.\n *\n * ONE Confirm for the whole card, never one per question: a message's input values all arrive in\n * `state.values` on any button tap in that message, so a single button submits the lot. That is\n * also why a lone select that needs no typing keeps its row of buttons instead — one tap answers\n * it, and there is nothing to fill in first ({@link elicitCardShape}).\n *\n * Null ⇒ some field cannot be an input block (see {@link elicitFormInputElement}) and the caller\n * declines with a notice rather than posting a card with a field nobody can answer. Pure.\n */\nexport function buildElicitationFormCard(\n requestId: string,\n params: CreateElicitationRequest,\n form: readonly ElicitTarget[],\n sessionTarget?: string\n): unknown[] | null {\n const required = new Set(elicitRequiredProps(params))\n const inputs: Record<string, unknown>[] = []\n for (const [index, target] of form.entries()) {\n const element = elicitFormInputElement(target)\n if (!element) return null\n const hint = elicitFormFieldHint(target)\n inputs.push({\n type: 'input',\n block_id: elicitFormBlockId(index),\n label: { type: 'plain_text', text: elicitFormFieldLabel(params, target), emoji: true },\n // Slack enforces presence itself for a required field; a required multi-select then also\n // needs one selection, which is stricter than `minItems: 0` but never admits less.\n optional: !required.has(target.propName),\n ...(hint ? { hint: { type: 'plain_text', text: hint } } : {}),\n element\n })\n }\n return [\n {\n type: 'section',\n text: agentMrkdwn(`:speech_balloon: ${clampTo(elicitCardMessage(params), ELICIT_MESSAGE_CAP)}`)\n },\n ...inputs,\n {\n type: 'actions',\n ...(sessionTarget ? { block_id: sessionTarget } : {}),\n elements: [\n {\n type: 'button',\n action_id: ELICIT_CONFIRM_ACTION as string,\n text: { type: 'plain_text', text: 'Confirm', emoji: true },\n style: 'primary',\n value: requestId\n },\n elicitDismissButton(requestId)\n ]\n }\n ]\n}\n\n/** The two shapes a Slack elicitation card takes, decided by the reduction alone.\n *\n * A card is a row of BUTTONS exactly when ONE TAP CAN ANSWER IT: a single question that is a pure\n * single-select or a boolean. Everything else is INPUT blocks with one Confirm and one Dismiss —\n * a multi-select, a typed box, several questions, and a single question that brought a free-text\n * companion box. A button submits the instant it is tapped, which leaves no moment to fill\n * anything in; that is why a question gains a Confirm exactly when it has something to fill in.\n *\n * The companion case is not a guess about the schema: {@link elicitForm} already marks a companion\n * with {@link ElicitTarget.customAnswerFor} (the `_meta` flag an AskUserQuestion bridge or a Codex\n * `request_user_input` writes), so a question with a box is a reduction of two TARGETS and one\n * QUESTION, where two questions are two of each. Reading the TARGET count is therefore all this\n * needs: either way the card needs its inputs. Pure. */\nexport type ElicitCardShape = 'buttons' | 'inputs'\n\nexport function elicitCardShape(form: readonly ElicitTarget[]): ElicitCardShape {\n const only = form.length === 1 ? form[0]! : null\n return only && (only.kind === 'enum' || only.kind === 'boolean') ? 'buttons' : 'inputs'\n}\n\n/** What a refused field's error says, in the same plain words the card would have used — a\n * reader who has to retype something is told the shape, never the schema keyword. */\nfunction elicitFormFieldError(target: ElicitTarget): string {\n if (target.kind === 'text' || target.kind === 'number') return `Enter ${elicitFieldExpectation(target)}.`\n if (target.kind === 'multi-enum') return selectionHint(target) || 'Select from the options offered.'\n return 'Choose one of the options offered.'\n}\n\n/** A form card's answer, or the per-field errors that refuse it. Keyed by BLOCK id, which is what\n * the submitted state itself is keyed by. */\nexport interface ElicitFormSubmission {\n answer?: Record<string, string | number | string[]>\n errors?: Record<string, string>\n}\n\n/**\n * Decode one Confirm's raw field state into the typed record a form card answers with, re-derived\n * against the FORM THAT WAS RENDERED rather than trusted from the wire (#1815): each value is read\n * under its field's own block id, resolved from the position the card carried it as, given the\n * schema's own type — a real number for `number`/`integer`, a list for a multi-select — and\n * checked by {@link fieldAccepts}. A blank optional\n * input is simply absent; a missing REQUIRED field, a value of the wrong shape, and a value the\n * field does not admit each come back as that field's error, so one bad field refuses the whole\n * answer instead of being silently dropped. Pure.\n */\nexport function elicitFormSubmission(\n params: CreateElicitationRequest,\n form: readonly ElicitTarget[],\n fields: Readonly<Record<string, string | string[]>>\n): ElicitFormSubmission {\n const required = new Set(elicitRequiredProps(params))\n const answer: Record<string, string | number | string[]> = {}\n const errors: Record<string, string> = {}\n for (const [index, target] of form.entries()) {\n const blockId = elicitFormBlockId(index)\n const raw = fields[blockId]\n // Slack sends `[]` for a multi-select nobody touched, so a blank OPTIONAL one is an omission,\n // not an empty answer that then fails its own `minItems`. A required field keeps being checked:\n // there, `[]` is a real selection and its bounds decide. (An emptied REQUIRED select staying an\n // answer is #1801's reading, kept.)\n const blank = raw === undefined || (Array.isArray(raw) && !raw.length && !required.has(target.propName))\n if (blank) {\n if (required.has(target.propName)) errors[blockId] = 'This field is required.'\n continue\n }\n // A Slack card's options carry their POSITION, so the literals come back through the field\n // the card rendered ({@link elicitCardValues}) before anything is checked — that is what lets\n // an option's value be a path, an id or a URL at all (#1794). One carried value naming no\n // option this field offered refuses the field, exactly as an unoffered literal would.\n const carried = elicitCardValues(target, raw)\n if (carried === null) {\n errors[blockId] = elicitFormFieldError(target)\n continue\n }\n const shaped =\n target.kind === 'multi-enum'\n ? Array.isArray(carried)\n ? carried\n : undefined\n : Array.isArray(carried)\n ? undefined\n : target.kind === 'number'\n ? NUMERIC_REPLY_RE.test(carried.trim())\n ? Number(carried.trim())\n : undefined\n : carried\n if (shaped === undefined || !fieldAccepts(target, shaped)) errors[blockId] = elicitFormFieldError(target)\n else answer[target.propName] = shaped\n }\n return Object.keys(errors).length ? { errors } : { answer }\n}\n\n/** What ANY refused answer is told on the card's own surface. A refusal drops the answer and\n * leaves the card live (#1815), which without a line like this one is a button that does nothing:\n * the reader cannot tell a rejected answer from a broken card. One wording for every transport —\n * a refusal explained on Slack and silent on webchat is worse than a consistent one. */\nexport const ELICIT_ANSWER_REFUSED = \"That answer wasn't accepted — the question is still open.\"\n\n/** What a refused Confirm is told IN THE THREAD, since a message card has no modal to return the\n * errors to: each refused field named as the card names it, with the same plain words a reply-\n * answered card would use, and the card left live to be answered again. Pure. */\nexport function elicitFormRefusalNotice(\n params: CreateElicitationRequest,\n form: readonly ElicitTarget[],\n errors: Readonly<Record<string, string>>\n): string {\n const parts: string[] = []\n for (const [blockId, message] of Object.entries(errors)) {\n const index = elicitFormBlockIndex(blockId)\n const target = index === null ? undefined : form[index]\n parts.push(target ? `${elicitFormFieldLabel(params, target)}: ${message}` : message)\n }\n return clampTo(`${ELICIT_ANSWER_REFUSED} ${parts.join(' ')}`, ELICIT_MESSAGE_CAP)\n}\n\n/** What a consent card shows about its URL: the REAL host, so a lookalike or a userinfo prefix\n * cannot pass itself off as one, and what to warn about. Both checks are on the host alone — a\n * lookalike hides there, not in the path — and both are advisory: the card still shows the whole\n * URL and still opens only on an explicit tap. Null ⇒ nothing a consent card may offer: a scheme\n * no browser tab should take (the caller's {@link elicitUrl} already refused those, and this\n * refuses them again rather than trust its caller), or a backtick, which cannot sit inside the\n * code span that keeps the URL unfollowable without either escaping the span or lying about the\n * bytes. Pure — it parses the URL and never touches the network. */\nfunction consentUrlParts(url: string): { host: string; warnings: string[] } | null {\n if (url.includes('`')) return null\n let parsed: URL\n try {\n parsed = new URL(url)\n } catch {\n return null\n }\n if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') return null\n // Sliced by POSITION, never by searching `parsed.host`: the parser's spelling is not in the original.\n const afterScheme = url.indexOf('//') + 2\n const authorityEnd = url.slice(afterScheme).search(/[/?#]/)\n const shownHost = url.slice(afterScheme, authorityEnd < 0 ? url.length : afterScheme + authorityEnd)\n const warnings: string[] = []\n if (parsed.protocol !== 'https:')\n warnings.push('Not encrypted (http) — anything you type on that page can be read in transit.')\n // Both spellings of one risk: the parser punycodes Unicode, but a homograph is a lookalike ON SCREEN.\n if (/(^|\\.)xn--/i.test(parsed.hostname) || /[^\\x00-\\x7F]/.test(shownHost))\n warnings.push('This host is not plain ASCII, which can disguise a lookalike domain.')\n return { host: parsed.hostname, warnings }\n}\n\n/** Build the URL-mode CONSENT card: the agent's defused `message`, the real host, the whole URL in\n * a code span, any advisory warnings, an Open link button and a Dismiss button. The URL is shown\n * but deliberately NOT followable as text — Slack autolinks a bare URL, and a reader who left\n * through that autolink would deliver no interaction, so the card would hang unanswered. The\n * button's `url` field both opens the page and still sends Slack's interaction, which is what\n * makes consent observable; its `value` carries the card's ONE option back ({@link\n * elicitOptionToken}), which the daemon resolves to this same URL, so the answer is re-derived\n * against the card that offered it. The URL itself never rides the button: Slack caps a `value`\n * at 2000 and `elicitUrl` admits 2048, so a long OAuth `state` used to lose the card entirely\n * (#1794). Returns null — the caller then declines with a notice — when this is not a URL-mode\n * ask or the URL is not one a card may offer. Pure; the daemon never fetches the URL. */\nexport function buildUrlConsentCard(\n requestId: string,\n params: CreateElicitationRequest,\n sessionTarget?: string\n): unknown[] | null {\n const url = elicitUrl(params)\n const parts = url && consentUrlParts(url.url)\n if (!url || !parts) return null\n const value = encodePermValue(requestId, elicitOptionToken(0))\n const detail = [\n 'Opens in your browser. This agent never sees that page or anything you type on it.',\n `Host: \\`${escapeSlackMrkdwn(parts.host)}\\``,\n `\\`${escapeSlackMrkdwn(url.url)}\\``,\n ...parts.warnings.map((w) => `:warning: ${escapeSlackMrkdwn(w)}`)\n ].join('\\n')\n return [\n {\n type: 'section',\n text: agentMrkdwn(`:link: ${clampTo(elicitCardMessage(params), ELICIT_MESSAGE_CAP)}`)\n },\n { type: 'section', text: agentMrkdwn(clampTo(detail, SLACK_SECTION_TEXT_CAP)) },\n {\n type: 'actions',\n ...(sessionTarget ? { block_id: sessionTarget } : {}),\n elements: [\n {\n type: 'button',\n action_id: `${ELICIT_ACTION_PREFIX}:0`,\n text: { type: 'plain_text', text: 'Open link', emoji: true },\n style: 'primary',\n url: url.url,\n value\n },\n {\n type: 'button',\n action_id: ELICIT_DISMISS_ACTION as string,\n text: { type: 'plain_text', text: 'Dismiss', emoji: true },\n value: requestId\n }\n ]\n }\n ]\n}\n\n/** Build the RESOLVED consent card (buttons removed) that replaces {@link buildUrlConsentCard}\n * once opened, dismissed, cancelled, or reported complete. It keeps the URL on screen so the\n * settled card still records what was consented to. Pure. */\nexport function buildUrlConsentResolvedCard(params: CreateElicitationRequest, decision: string): unknown[] {\n const url = elicitUrl(params)\n const shown = url && !url.url.includes('`') ? `\\n\\`${escapeSlackMrkdwn(url.url)}\\`` : ''\n const text = `:link: ${clampTo(elicitCardMessage(params), ELICIT_MESSAGE_CAP)}${shown}\\n${decision}`\n return [{ type: 'section', text: agentMrkdwn(clampTo(text, SLACK_SECTION_TEXT_CAP)) }]\n}\n\nexport interface SharedStatusActions {\n /** Opaque `{agentId,integrationId,sessionKey}` target validated by the relay. */\n sessionTarget: string\n /** Whether the bot is shareable (multi-agent) — gates the \"Switch agent\" option.\n * A non-shareable shared bot still routes its overflow via `sessionTarget`, but it\n * hosts one agent, so there is nothing to switch to. */\n shareable: boolean\n}\n\n/** Build the compact in-thread status message. Both dedicated and shared bots use one\n * overflow accessory so the status stays on a single row; a SHAREABLE (multi-agent) bot\n * also exposes Switch agent. Interrupting a turn is Slack's own Stop control — the\n * overflow carries no cancel item. */\nexport function buildStatusBlocks(\n info: StatusBarInfo,\n sessionKey: string,\n link?: string,\n shared?: SharedStatusActions\n): unknown[] {\n const text = `${renderStatusBar(info)}${link ? ` · <${link}|View Session>` : ''}`\n const target = shared?.sessionTarget ?? sessionKey\n const option = (label: string, action: 'switch-agent' | 'manage') => ({\n text: { type: 'plain_text', text: label },\n value: encodeSlackStatusOverflowValue(action)\n })\n const options = [\n ...(shared?.shareable ? [option('Switch agent', 'switch-agent')] : []),\n option('Session options', 'manage')\n ]\n return [\n {\n type: 'section',\n block_id: target,\n text: { type: 'mrkdwn', text },\n accessory: {\n type: 'overflow',\n action_id: STATUS_ACTION.more,\n options\n }\n }\n ]\n}\n\n/** Match the console's compact count display: 1_240_000 → \"1.24M\", 92_000 → \"92K\". */\nfunction fmtCount(n?: number): string | undefined {\n if (n === undefined || !Number.isFinite(n)) return undefined\n const trim = (s: string) => (s.includes('.') ? s.replace(/\\.?0+$/, '') : s)\n if (n >= 1_000_000) return trim((n / 1_000_000).toFixed(n >= 10_000_000 ? 0 : 2)) + 'M'\n if (n >= 1_000) return trim((n / 1_000).toFixed(n >= 10_000 ? 0 : 1)) + 'K'\n return String(n)\n}\n\n/** Small terminal modal for a shortcut whose selected conversation has no\n * addressable AgentConnect session (or is not visible to the clicking user). */\nexport function buildStatusUnavailableModal(): Record<string, unknown> {\n return {\n type: 'modal',\n title: { type: 'plain_text', text: 'Session options' },\n close: { type: 'plain_text', text: 'Close' },\n blocks: [\n {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: 'No AgentConnect session was found for this conversation.'\n }\n }\n ]\n }\n}\n\n/**\n * Build the controls modal opened from Configure (a snapshot — Slack modals don't\n * stream). `private_metadata` carries either the direct session key or a shared-bot\n * routing target so the modal's `block_actions` resolve the session. The modal stays\n * compact: identity + View-session share one line, related selectors render two per\n * row, and usage uses label-over-value fields. Interrupting a turn is Slack's own Stop\n * control — the modal carries no cancel button.\n */\nexport function buildStatusModal(\n info: StatusBarInfo,\n sessionKey: string,\n link?: string,\n privateMetadata = sessionKey,\n identity?: StatusModalIdentity\n): Record<string, unknown> {\n const blocks: unknown[] = []\n const controlBlocks: unknown[] = []\n const modelControls: unknown[] = []\n const tuningControls: unknown[] = []\n const outputControls: unknown[] = []\n const models = info.models ?? []\n const compactOption = (label: string, text: string, value: string) => ({\n text: { type: 'plain_text', text: clampTo(`${label} · ${text}`, 75) },\n value\n })\n\n if (models.length > 0) {\n const opts = info.model && !models.includes(info.model) ? [info.model, ...models] : models\n const option = (m: string) => compactOption('Model', m, m)\n modelControls.push({\n type: 'static_select',\n action_id: STATUS_ACTION.setModel,\n placeholder: { type: 'plain_text', text: 'Model' },\n ...(info.model ? { initial_option: option(info.model) } : {}),\n options: opts.map(option)\n })\n }\n\n // Effort — a static_select of the runtime's `thought_level` levels (plus synthetic\n // ultracode/max on Claude runtimes). Omitted when the runtime offers no effort selector.\n const efforts = info.efforts ?? []\n if (efforts.length > 0) {\n const opts = info.effort && !efforts.includes(info.effort) ? [info.effort, ...efforts] : efforts\n const option = (e: string) => compactOption('Effort level', e, e)\n tuningControls.push({\n type: 'static_select',\n action_id: STATUS_ACTION.setEffort,\n placeholder: { type: 'plain_text', text: 'Effort level' },\n ...(info.effort ? { initial_option: option(info.effort) } : {}),\n options: opts.map(option)\n })\n }\n\n // Fast mode — an On/Off static_select, shown only when the selected model advertises a\n // fast toggle (the ACP `model_config` option). `on`/`off` match the daemon's set path.\n if (info.fastModeAvailable) {\n const fastOpt = (v: 'on' | 'off') => compactOption('Fast mode', v === 'on' ? 'On' : 'Off', v)\n const current: 'on' | 'off' = info.fastMode ? 'on' : 'off'\n modelControls.push({\n type: 'static_select',\n action_id: STATUS_ACTION.setFast,\n placeholder: { type: 'plain_text', text: 'Fast mode' },\n initial_option: fastOpt(current),\n options: [fastOpt('on'), fastOpt('off')]\n })\n }\n\n // Permission follows the model / effort / fast controls, matching the Agent and\n // console session surfaces. Codex Auto travels as one AgentConnect session preset;\n // the daemon decomposes it before calling ACP.\n const permissionModes = info.permissionModes ?? []\n if (permissionModes.length > 0) {\n const opts =\n info.permissionMode && !permissionModes.includes(info.permissionMode)\n ? [info.permissionMode, ...permissionModes]\n : permissionModes\n const option = (m: string) => compactOption('Permission', permissionModeDisplayLabel(m), m)\n tuningControls.push({\n type: 'static_select',\n action_id: STATUS_ACTION.setPermissionMode,\n placeholder: { type: 'plain_text', text: 'Permission' },\n ...(info.permissionMode ? { initial_option: option(info.permissionMode) } : {}),\n options: opts.map(option)\n })\n }\n\n // Output verbosity — a fixed none/minimal/low/medium/high select controlling how much of the\n // turn (reasoning / tool activity / output) reaches Slack. `none` delivers nothing to the\n // channel (session transcript only). Daemon-side, not ACP; always shown (unlike model/effort/\n // fast, it isn't runtime-gated). Omitted only when unknown.\n if (info.outputMode) {\n const modeOpt = (v: 'none' | 'minimal' | 'low' | 'medium' | 'high') => compactOption('Output mode', v, v)\n outputControls.push({\n type: 'static_select',\n action_id: STATUS_ACTION.setOutput,\n placeholder: { type: 'plain_text', text: 'Output mode' },\n initial_option: modeOpt(info.outputMode),\n options: [modeOpt('none'), modeOpt('minimal'), modeOpt('low'), modeOpt('medium'), modeOpt('high')]\n })\n }\n\n for (const controls of [modelControls, tuningControls, outputControls]) {\n if (controls.length) controlBlocks.push({ type: 'actions', elements: controls })\n }\n\n const identityName = identity?.name.replace(/\\s+/g, ' ').trim()\n const sessionTitle = identity?.sessionTitle?.replace(/\\s+/g, ' ').trim()\n const currentModel = info.model?.replace(/\\s+/g, ' ').trim()\n const agentLink = safeSlackLinkUrl(identity?.agentUrl)\n const sessionLink = safeSlackLinkUrl(link)\n const identityLabel = identityName\n ? agentLink\n ? `<${agentLink}|${escapeMrkdwnLabel(clampTo(identityName, 256))}>`\n : escapeMrkdwnLabel(clampTo(identityName, 256))\n : undefined\n const modelLabel = models.length === 0 && currentModel ? escapeMrkdwnLabel(clampTo(currentModel, 256)) : undefined\n const meta = [identityLabel, modelLabel].filter((part): part is string => Boolean(part))\n const identityElements: unknown[] = []\n if (identityName) {\n const iconUrl = safeSlackLinkUrl(identity?.iconUrl)\n if (iconUrl) identityElements.push({ type: 'image', image_url: iconUrl, alt_text: clampTo(identityName, 2_000) })\n }\n if (meta.length) {\n identityElements.push({\n type: 'mrkdwn',\n text: `${meta.join(' · ')}${sessionLink ? ' ·' : ''}`\n })\n }\n if (sessionLink) identityElements.push({ type: 'mrkdwn', text: `<${sessionLink}|View session>` })\n if (identityElements.length) {\n blocks.push({\n type: 'context',\n elements: identityElements\n })\n }\n blocks.push(...controlBlocks)\n\n // Usage fields keep labels above their values without the old Usage / Token breakdown\n // headers. Slack lays fields out two per row; missing metrics collapse naturally.\n let contextValue: string | undefined\n if (info.contextUsed !== undefined) {\n contextValue =\n info.contextSize && info.contextSize > 0\n ? `${fmtCount(info.contextUsed)} / ${fmtCount(info.contextSize)} (${Math.round(\n (info.contextUsed / info.contextSize) * 100\n )}%)`\n : fmtCount(info.contextUsed)\n }\n let costValue: string | undefined\n if (info.costAmount !== undefined) {\n // Bare `$` for USD (the common case), else an explicit ISO code suffix.\n const cur = info.costCurrency && info.costCurrency !== 'USD' ? ` ${info.costCurrency}` : ''\n const sym = !info.costCurrency || info.costCurrency === 'USD' ? '$' : ''\n costValue = `${sym}${info.costAmount.toFixed(info.costAmount < 1 ? 3 : 2)}${cur}`\n }\n const totalTokensValue = fmtCount(info.totalTokens)\n const field = (label: string, value?: string) =>\n value === undefined ? undefined : { type: 'mrkdwn', text: `*${label}*\\n${value}` }\n const pairedField = (...items: Array<[label: string, value: string | undefined]>) => {\n const visible = items.filter((item): item is [string, string] => item[1] !== undefined)\n return visible.length\n ? {\n type: 'mrkdwn',\n text: `${visible.map(([label]) => `*${label}*`).join(' · ')}\\n${visible.map(([, value]) => value).join(' · ')}`\n }\n : undefined\n }\n const totalAndCost = [totalTokensValue, costValue].filter((value): value is string => value !== undefined)\n const totalAndCostLabel =\n totalTokensValue !== undefined && costValue !== undefined\n ? 'Total tokens · Cost'\n : totalTokensValue !== undefined\n ? 'Total tokens'\n : 'Cost'\n const cachedReadValue = fmtCount(info.cachedReadTokens)\n const cachedWriteValue = fmtCount(info.cachedWriteTokens)\n const cacheField =\n cachedReadValue !== undefined || cachedWriteValue !== undefined\n ? pairedField(['Cache read', cachedReadValue ?? '—'], ['Cache write', cachedWriteValue ?? '—'])\n : undefined\n const summaryFields = [\n field('Current context', contextValue),\n field(totalAndCostLabel, totalAndCost.length ? totalAndCost.join(' · ') : undefined)\n ].filter(Boolean)\n const breakdownFields = [\n pairedField(['Input', fmtCount(info.inputTokens)], ['Output', fmtCount(info.outputTokens)]),\n cacheField\n ].filter(Boolean)\n if (summaryFields.length || breakdownFields.length) {\n if (blocks.length) blocks.push({ type: 'divider' })\n if (summaryFields.length) blocks.push({ type: 'section', fields: summaryFields })\n if (breakdownFields.length) blocks.push({ type: 'section', fields: breakdownFields })\n }\n\n return {\n type: 'modal',\n callback_id: STATUS_MODAL_CALLBACK,\n private_metadata: privateMetadata,\n title: {\n type: 'plain_text',\n text: clampTo(sessionTitle ? `Session · ${sessionTitle}` : 'Session', 24)\n },\n close: { type: 'plain_text', text: 'Close' },\n blocks\n }\n}\n\nexport class OutputConverger {\n private buf = ''\n // Accumulated thinking text (high mode only) and a dirty flag. Reasoning is coalesced\n // onto the daemon's idle-flush timer — never emitted per thought chunk — so a long\n // thinking stream edits its one in-place message at most once per idle window instead\n // of flooding chat.update through the 350ms send-queue.\n private reasoningBuf = ''\n private reasoningDirty = false\n // Last activity label (tool title / \"is thinking…\") — only for consecutive-collapse:\n // the label is never displayed, a non-empty set-status just keeps the session `processing`.\n private lastActivity = ''\n // Set while a person is being waited on, so every activity status keeps the session `suspended`.\n private humanWaiting = false\n // Remember each tool's last known title so a title-less tool_call_update reuses it\n // (and is collapsed by consecutive-dedup) instead of surfacing the raw toolCallId.\n private toolTitles = new Map<string, string>()\n // high mode only: latest extracted output per in-flight tool (content is a whole\n // replacement each update, so keep the newest), and the set of tools whose output has\n // already been posted — output is emitted at most once, when the call reaches a\n // terminal status, so it isn't re-posted on every streamed update.\n private toolOutputs = new Map<string, string>()\n private emittedOutput = new Set<string>()\n // minimal: how many interim segments have become history cards, so each gets its own id.\n private replyCards = 0\n // The runtime's own message identity, which is the only boundary a speak-only run offers.\n private readonly messages = new AgentMessageRun()\n private readonly work = new WorkBoundary()\n // ── Native tool-call chrome (slack-streaming-turn-output.md §3) ──────────────\n // The axis, plus the one stream's card bookkeeping. Nothing here touches the body.\n private streaming = false\n private streamOpened = false\n private streamClosed = false\n // Cards awaiting the next append, keyed by ACP tool call id so a burst of updates for one\n // call collapses to its newest state; `emittedTasks` suppresses an unchanged repeat.\n private pendingTasks = new Map<string, Extract<SlackStreamChunk, { type: 'task_update' }>>()\n private emittedTasks = new Map<string, string>()\n private taskTitles = new Map<string, string>()\n private openTasks = new Set<string>()\n /** Slack appends each body field, so details and results are each written once. */\n private detailsWritten = new Set<string>()\n private outputWritten = new Set<string>()\n private taskIcons = new Map<string, string>()\n /** Tool calls ACP reported failed — counted into the closing label, never the model's to\n * narrate, and deliberately NOT the cards' status (see FAILED_PREFIX). */\n private failedTasks = new Set<string>()\n // A tool call's own one-line label and verbatim command, remembered from whichever update\n // carried `rawInput` — a streamed `tool_call_update` usually carries none.\n private toolDescriptions = new Map<string, string>()\n private toolCommands = new Map<string, string>()\n // The current thinking run: whether one is open, a counter so each gets its own card, and\n // the head of its text until the first line names it.\n private thinkingActive = false\n private thinkingRun = 0\n private thinkingHead = ''\n private thinkingTitle = ''\n private thinkingBody = ''\n private thinkingBodyTruncated = false\n /** The container's label, so an unchanged one is never re-sent, plus the one awaiting the\n * next append and the legacy `progress` text that append would degrade to. */\n private planTitle = ''\n private pendingPlanTitle = ''\n private pendingProgress = ''\n\n /**\n * `protectedAddresses` are the COMPOUND mention addresses in this conversation — a\n * shared Slack bot's `<@U_SHARED> reviewer`, where the bot user id names the app and the\n * trailing slug selects the agent (send-message-routing-rework.md §5.3/§8.5).\n *\n * The splitter finds every self-delimiting `<…>` address by itself; it cannot infer that\n * a bare word after a mention is part of the address, because in every other message it\n * is ordinary prose. So the daemon supplies the ones it rendered from its own directory.\n * Splitting between the two halves would address the APP instead of the agent — under\n * §2.1 that silently drops the delivery the mention was making, not just its formatting.\n */\n constructor(\n private mode: 'none' | 'minimal' | 'low' | 'medium' | 'high',\n private protectedAddresses: readonly string[] = [],\n private readonly resolveFileLink?: WorkspaceFileLinkResolver\n ) {}\n\n /** True while body text OR reasoning is pending — the daemon uses this to (re)arm\n * the ~2s idle-flush timer (§9.1 text-buffer) so a long pure-text stream posts in\n * steps and streamed thinking updates its in-place block at most once per window. */\n hasBuffered(): boolean {\n // minimal: nothing is delivered mid-segment, so there is never an idle flush to arm.\n if (this.mode === 'minimal') return false\n return this.buf.trim().length > 0 || this.reasoningDirty\n }\n\n /**\n * Take the native chrome pipeline for this turn (§3.1). Decided once at turn start from a\n * synchronous capability read; `medium` and `high` put tool chrome on the stream and\n * `minimal` its interim reply segments (§5.2), so `none` and `low` stay byte-identical to\n * today whatever the workspace supports.\n */\n enableStreaming(): void {\n if (this.mode === 'minimal' || this.mode === 'medium' || this.mode === 'high') this.streaming = true\n }\n\n isStreaming(): boolean {\n return this.streaming\n }\n\n /** Whether a newer card snapshot is ready for the append timer (§3.5). */\n hasStreamingUpdate(): boolean {\n return this.streaming && !this.streamClosed && (this.pendingTasks.size > 0 || this.pendingPlanTitle !== '')\n }\n\n /**\n * Drain the dirty cards into ONE append, opening the stream lazily on the first batch that\n * has something to show. A turn that runs no tools therefore never opens a stream and is\n * byte-identical to today.\n */\n streamUpdate(): SlackAction[] {\n if (!this.streaming || this.streamClosed) return []\n const progressText = this.pendingProgress\n const chunks = this.drainStreamChunks()\n if (chunks.length === 0) return []\n this.pendingProgress = ''\n const out: SlackAction[] = []\n if (!this.streamOpened) {\n this.streamOpened = true\n out.push({ kind: 'stream-start' })\n }\n out.push({ kind: 'stream-append', chunks, ...(progressText ? { progressText } : {}) })\n return out\n }\n\n /**\n * Settle every card to a real terminal status and relabel the container, then stop.\n *\n * Stopping a stream that still has `in_progress` cards makes Slack render the container as\n * \"Something went wrong\" and flip those cards to `error` (verified live 2026-08-28), so the\n * settle append is not cosmetic — it is what every stop is owed. Idempotent: the second\n * caller of a turn's settle gets nothing.\n */\n settleStream(outcome: 'completed' | 'stopped' | 'failed'): SlackAction[] {\n if (!this.streaming || this.streamClosed) return []\n this.streamClosed = true\n // A tool that started AND finished inside one coalescing window leaves cards pending with\n // no stream open yet. Opening it here is what keeps such a turn from ending with no tool\n // chrome at all; only a genuinely tool-free turn stays silent.\n if (!this.streamOpened && this.emittedTasks.size === 0) return []\n const terminal = outcome === 'completed' ? 'complete' : 'error'\n this.closeThinkingRun(terminal)\n for (const id of [...this.openTasks]) this.queueTask(id, this.taskTitles.get(id) ?? 'tool', terminal)\n // Forced rather than queued: the container must always carry its closing label, even when\n // the working one happens to read the same.\n this.planTitle =\n outcome === 'completed' ? this.planSummary() : outcome === 'stopped' ? STREAM_PLAN_STOPPED : STREAM_PLAN_FAILED\n this.pendingPlanTitle = this.planTitle\n const progressText = this.pendingProgress\n this.pendingProgress = ''\n const settle = this.drainStreamChunks()\n const out: SlackAction[] = []\n if (!this.streamOpened) {\n this.streamOpened = true\n out.push({ kind: 'stream-start' })\n }\n out.push({ kind: 'stream-stop', settle, ...(progressText ? { progressText } : {}) })\n return out\n }\n\n private drainStreamChunks(): SlackStreamChunk[] {\n const chunks: SlackStreamChunk[] = [...this.pendingTasks.values()]\n this.pendingTasks.clear()\n if (this.pendingPlanTitle) {\n chunks.push({ type: 'plan_update', title: this.pendingPlanTitle })\n this.pendingPlanTitle = ''\n }\n return chunks\n }\n\n /** Coalesce replaceable card fields while retaining each write-once body field until the next flush. */\n private queueTask(\n id: string,\n title: string,\n status: 'in_progress' | 'complete' | 'error',\n body: { command?: string; details?: string; output?: string; icon?: string } = {}\n ): void {\n const clamped = clampTo(plainCardText(title), MAX_CARD_TITLE) || 'tool'\n const above = body.command ? codeSpan(capOutput(body.command), true) : capOutput(body.details ?? '')\n const details = this.detailsWritten.has(id) ? '' : above\n const output = !this.outputWritten.has(id) && body.output ? capOutput(body.output) : ''\n if (body.icon) this.taskIcons.set(id, body.icon)\n const icon = this.taskIcons.get(id) ?? 'gear'\n const chunk: Extract<SlackStreamChunk, { type: 'task_update' }> = {\n ...this.pendingTasks.get(id),\n type: 'task_update',\n id,\n title: clamped,\n status,\n icon: { type: 'icon', name: icon },\n ...(details ? { details } : {}),\n ...(output ? { output } : {})\n }\n const signature = `${chunk.title} ${chunk.status} ${icon}`\n if (!details && !output && this.emittedTasks.get(id) === signature) return\n if (details) this.detailsWritten.add(id)\n if (output) this.outputWritten.add(id)\n this.emittedTasks.set(id, signature)\n this.taskTitles.set(id, clamped)\n if (status === 'in_progress') this.openTasks.add(id)\n else this.openTasks.delete(id)\n this.pendingTasks.set(id, chunk)\n // The container earns its working label the moment it has a card to hold.\n this.queuePlanTitle(STREAM_PLAN_WORKING)\n }\n\n /** Relabel the container, skipping an unchanged label (§4). */\n private queuePlanTitle(title: string): void {\n const clamped = clampTo(plainCardText(title), MAX_STREAM_TASK)\n if (!clamped || clamped === this.planTitle) return\n this.planTitle = clamped\n this.pendingPlanTitle = clamped\n }\n\n /** What the container says once the turn is over. Counted, not narrated: no model call, and\n * a failed step is named rather than folded into a success. */\n private planSummary(): string {\n const total = this.emittedTasks.size\n if (total === 0) return 'Done'\n // minimal: every card is an interim reply, and the container sits above the final one.\n if (this.mode === 'minimal') return `${total} earlier ${total === 1 ? 'reply' : 'replies'}`\n const steps = `${total} step${total === 1 ? '' : 's'}`\n const failed = this.failedTasks.size\n return failed === 0 ? `Completed ${steps}` : `Completed ${steps} · ${failed} failed`\n }\n\n private thinkingId(): string {\n return `thinking-${this.thinkingRun}`\n }\n\n /** Accumulate a run's body under the card-body cap, REMEMBERING that the cap was reached.\n * Silently slicing to the cap hands `capOutput` a value that already looks whole, so the\n * card would present a run missing its ending as if that were the ending. */\n private appendThinkingBody(thought: string): void {\n const room = MAX_TOOL_OUTPUT - this.thinkingBody.length\n if (room <= 0 || thought.length > room) this.thinkingBodyTruncated = true\n if (room > 0) this.thinkingBody += thought.slice(0, room)\n }\n\n /**\n * Title a thinking run from its FIRST LINE. Runtimes open a thought with a short\n * `**heading**` — the same line the web console shows as the step's title — so the card can\n * say what the agent is thinking about instead of the bare word \"Thinking\". The card opens\n * before that line has arrived, which costs nothing: `title` REPLACES per id, so the\n * placeholder is simply renamed (verified live 2026-08-29).\n *\n * Runs once per run, at the first newline or once the head is title-width, whichever comes\n * first — a runtime that streams one unbroken paragraph still gets a title out of its head.\n */\n private noteThinkingTitle(thought: string): void {\n if (this.thinkingTitle) return\n this.thinkingHead = (this.thinkingHead + thought).slice(0, MAX_THINKING_HEAD)\n const title = this.thinkingTitleFrom(false)\n if (title) this.queueTask(this.thinkingId(), title, 'in_progress')\n }\n\n /** The run's title, resolved from its head, or '' while the first line could still grow.\n * `final` takes whatever the head holds — at settle time no more of it is coming, which is\n * what titles a short last thought that never reached a newline. */\n private thinkingTitleFrom(final: boolean): string {\n if (this.thinkingTitle) return this.thinkingTitle\n // trimStart: a thought can open with blank lines, which must not resolve to a blank title.\n const head = this.thinkingHead.trimStart()\n const nl = head.indexOf('\\n')\n if (!final && nl < 0 && head.length < MAX_CARD_TITLE) return ''\n this.thinkingTitle = clampTo(plainCardText(nl < 0 ? head : head.slice(0, nl)), MAX_CARD_TITLE)\n return this.thinkingTitle\n }\n\n /** A thinking run ends at the next tool call or at turn end — settle its card rather than\n * leaving a spinner behind. Title and status only: the thought text itself belongs in\n * high mode's in-place Thinking message, which is where 2,800 characters fit. */\n private closeThinkingRun(status: 'complete' | 'error' = 'complete'): void {\n if (!this.thinkingActive) return\n const title = this.thinkingTitleFrom(true) || THINKING_CARD\n this.queueTask(this.thinkingId(), title, status, { details: this.thinkingRunBody(title), icon: 'lightbulb' })\n this.thinkingActive = false\n this.thinkingRun += 1\n this.thinkingHead = ''\n this.thinkingTitle = ''\n this.thinkingBody = ''\n this.thinkingBodyTruncated = false\n }\n\n /**\n * What a settled thinking card shows under its title on `high`: the run, as the web console's\n * work rows show it — de-bolded, and without re-saying a title that was shown whole.\n *\n * The body is dropped only when the TITLE already shows the run whole. \"Has no newline\" is not\n * that test: a single unbroken line longer than the title clamp would then survive only as its\n * own first 72 characters, and with the reasoning message gone there is nothing else holding\n * the rest. When the title DID show the first line whole, that line is dropped from the body\n * instead — repeating it directly under itself says nothing.\n *\n * Bold markers are stripped: runtimes emit every thought heading as `**heading**`, so a\n * heading-only run rendered as a slab of bold. The headings are the content; the shouting is\n * not. Other markdown is left alone.\n */\n private thinkingRunBody(title: string): string {\n if (this.mode !== 'high') return ''\n const body = bodyUnderTitle(stripBoldMarks(this.thinkingBody.trim()), title)\n if (!body) return ''\n return this.thinkingBodyTruncated ? `${body}…` : body\n }\n\n /** Flush pending output for the idle timer: in high mode one in-place `reasoning` update\n * carrying the reasoning accumulated since the last flush, THEN the buffered body\n * (verbatim markdown split into ≤block-limit `post` sections — each a Block Kit\n * `markdown` block, no mrkdwn conversion). Reasoning is emitted first so its in-place\n * block is first-posted ABOVE the reply: thinking precedes the answer (§9.1), so the\n * Thinking block must sit above it, not below.\n *\n * minimal: nothing — a segment reaches the channel only once it closes (§5.2). */\n flushBuffered(): SlackAction[] {\n if (this.mode === 'minimal') return []\n return [...this.drainReasoning(), ...this.flushStreaming()]\n }\n\n /** Drain everything for a turn that is ending abnormally: the runtime narrated its terminal\n * error into the message stream and then rejected the prompt, so `onFinal` never runs and\n * there is no later flush to hold a partial paragraph for. Unlike the idle flush this takes\n * the whole buffer, paragraph break or not — otherwise the runtime's own error text is\n * dropped and replaced by the generic failure notice. */\n flushTerminal(): SlackAction[] {\n // A crashed turn settles like a stopped one: whatever was still in flight did not finish\n // BECAUSE the turn died, so those cards are honestly `error` under a \"Failed\" label — while\n // steps that already finished keep their state, (failed)-prefixed ones included. The ⚠️\n // notice the caller appends still carries the reason in the body.\n const opensLate = !this.streamOpened\n const settle = this.settleStream('failed')\n const body = [...this.drainReasoning(), ...this.flush()]\n return opensLate ? [...settle, ...body] : [...body, ...settle]\n }\n\n /** minimal: close an interim reply segment — a history card on the chrome stream for the\n * channel (§5.2) plus the full text as `recordOnly` post(s) for the transcript. The final\n * segment is not closed here: onFinal posts it as the turn's one visible reply. */\n private closeSegment(): SlackAction[] {\n const trimmed = this.buf.trim()\n if (!trimmed) {\n this.buf = ''\n return []\n }\n // Hold while the body may still be the bare sentinel — a suppressed reply must not be\n // recorded or shown; onFinal makes the final drop. Non-sentinel bodies close normally.\n if (isNoResponsePrefix(trimmed)) return []\n const text = flattenUnsafeLinks(this.buf, { resolveFileLink: this.resolveFileLink })\n this.buf = ''\n if (!text.trim()) return []\n this.queueReplyCard(text)\n return splitIntoSections(text, undefined, this.protectedAddresses).map(\n (t) => ({ kind: 'post', text: t, recordOnly: true }) as SlackAction\n )\n }\n\n /** minimal: one history card per closed segment, the shape of a settled thinking card — titled\n * by its first line, its body written once, `complete` from birth. Off the axis the segment\n * stays transcript-only, which is what minimal showed before the stream existed. */\n private queueReplyCard(text: string): void {\n if (!this.streaming) return\n this.replyCards += 1\n const body = text.trim()\n const title = replyCardTitle(body)\n this.queueTask(`reply-${this.replyCards}`, title, 'complete', {\n details: bodyUnderTitle(body, title),\n icon: 'comment'\n })\n }\n\n /** Drain reasoning buffered since the last flush into a 0-or-1-length action list (only\n * high mode ever sets `reasoningDirty`). Callers place it before the body flush so the\n * Thinking block posts above the reply. */\n private drainReasoning(): SlackAction[] {\n // A streaming turn's thinking cards ARE this message — posting it too would repeat every\n // line of it under the container that already holds them.\n if (this.streaming || !this.reasoningDirty) return []\n this.reasoningDirty = false\n const text = flattenUnsafeLinks(this.reasoningBuf, { resolveFileLink: this.resolveFileLink })\n return text.trim() ? [{ kind: 'reasoning', text: renderReasoning(text) }] : []\n }\n\n private flush(): SlackAction[] {\n const trimmed = this.buf.trim()\n if (!trimmed) {\n this.buf = ''\n return []\n }\n // \"Not for me\" control marker (§no-response): hold the buffer while it could\n // still become the bare marker (it streams token-by-token) so a suppressed\n // turn never leaks a partial post. onFinal drops it entirely; a body that diverges from\n // the sentinel is released and posted normally on the next flush.\n if (isNoResponsePrefix(trimmed)) return []\n const text = this.buf\n this.buf = ''\n return this.emitBody(text)\n }\n\n /** The idle timer's body flush. Unlike a semantic boundary (tool call / plan / thinking,\n * where the model really did finish a text block) this fires on a mere pause in the ACP\n * stream, so it posts only up to the last paragraph break and re-buffers the rest —\n * otherwise one reply is split across two messages mid-sentence (§stream-boundary). */\n private flushStreaming(): SlackAction[] {\n const trimmed = this.buf.trim()\n if (!trimmed || isNoResponsePrefix(trimmed)) return []\n const { ready, tail } = splitAtParagraphBoundary(this.buf)\n if (!ready) return []\n this.buf = tail\n return this.emitBody(ready)\n }\n\n private emitBody(raw: string): SlackAction[] {\n const text = flattenUnsafeLinks(raw, { resolveFileLink: this.resolveFileLink })\n if (!text.trim()) return []\n // none: record the reply into the transcript WITHOUT sending it — `recordOnly` is handled\n // before the connection check on every platform, so it lands even though replyConn is unset.\n const recordOnly = this.mode === 'none'\n return splitIntoSections(text, undefined, this.protectedAddresses).map(\n (t) => ({ kind: 'post', text: t, ...(recordOnly ? { recordOnly: true } : {}) }) as SlackAction\n )\n }\n\n /**\n * Record an activity label and build the working-status action. Consecutive repeats\n * collapse to nothing (returns []), which throttles streamed thought chunks down to one\n * status update per thinking run; the connection dedupes the rest at the lifecycle level.\n */\n private pushActivity(raw: string): SlackAction[] {\n // none: nothing reaches the channel, not even the transient working status.\n if (this.mode === 'none') return []\n const label = clampTo(raw, MAX_STATUS)\n if (this.lastActivity === label) return []\n this.lastActivity = label\n return [{ kind: 'set-status', text: label, ...(this.humanWaiting ? { lifecycle: 'suspended' as const } : {}) }]\n }\n\n /** A human wait opened (`suspended`) or its last gate settled (`processing` again); none mode shows nothing. */\n onHumanWait(waiting: boolean): SlackAction[] {\n this.humanWaiting = waiting\n if (this.mode === 'none') return []\n const text = this.lastActivity || 'working…'\n return [waiting ? { kind: 'set-status', text, lifecycle: 'suspended' } : { kind: 'set-status', text }]\n }\n\n /** Resolve a tool call's display label, reusing a known title when an update omits it. */\n private toolLabel(update: { toolCallId?: string; title?: string }): string {\n const id = update.toolCallId\n if (update.title) {\n if (id) this.toolTitles.set(id, update.title)\n return update.title\n }\n return (id && this.toolTitles.get(id)) ?? id ?? 'tool'\n }\n\n /** Remember what a tool call's `rawInput` said about itself. Only some updates carry it — a\n * streamed `tool_call_update` usually does not — so the first one that does wins. */\n private noteToolInput(update: { toolCallId?: string; rawInput?: unknown }): void {\n const id = update.toolCallId\n if (!id || update.rawInput === undefined) return\n const description = rawInputDescription(update)\n const command = rawInputField(update, 'command')\n if (isStepLabel(description) && !this.toolDescriptions.has(id)) this.toolDescriptions.set(id, description)\n if (command && !this.toolCommands.has(id)) this.toolCommands.set(id, command)\n }\n\n /** A card's one-line step label: the runtime's own description when it gave one, else the\n * tool title SHAPED. An ACP title for a shell tool IS the command (codex-acp sends no\n * description at all), which reads as a paragraph of shell on a card — so a command-shaped\n * fallback is cut at its first shell separator and clamped tighter than a prose title:\n * `git status --short --branch …` labels the step; the full chain rides the code block. */\n private cardTitle(id: string, label: string): string {\n const description = this.toolDescriptions.get(id)\n if (description) return description\n const head = label.split(SHELL_SEPARATOR, 1)[0] ?? label\n if (head.length < label.length) return `${clampTo(head, MAX_COMMAND_TITLE - 2)} …`\n return clampTo(label, MAX_COMMAND_TITLE)\n }\n\n /** What the card's code block shows: the verbatim command, or the full title when that is\n * all the runtime gave. Skipped when the title already shows it whole — an untruncated\n * one-line label needs no code block repeating it. */\n private cardCommand(id: string, label: string): string {\n const command = this.toolCommands.get(id) || label\n return plainCardText(command) === plainCardText(this.cardTitle(id, label)) ? '' : command\n }\n\n /** Refresh the newest output for one tool call. content/rawOutput are a whole replacement\n * when present, so only touch the cache when this update actually carries them: set the\n * newest text, or clear a stale entry if the replacement is empty / a non-text block. */\n private noteToolOutput(update: { toolCallId?: string; content?: unknown; rawOutput?: unknown }): void {\n const id = update.toolCallId\n if (!id || (update.content === undefined && update.rawOutput === undefined)) return\n const out = extractToolOutput(update)\n if (out) this.toolOutputs.set(id, out)\n else this.toolOutputs.delete(id)\n }\n\n /** high mode: surface a finished tool's output as a code-block `tool-output` action.\n * Tracks the latest output across streamed updates and emits it exactly once, when the\n * call reaches a terminal status (completed/failed) — so partial output isn't posted\n * early and the final result isn't re-posted. Returns [] when there's nothing to post. */\n private drainToolOutput(update: {\n toolCallId?: string\n status?: string\n content?: unknown\n rawOutput?: unknown\n }): SlackAction[] {\n const id = update.toolCallId\n if (!id) return []\n this.noteToolOutput(update)\n const terminal = update.status === 'completed' || update.status === 'failed'\n if (!terminal || this.emittedOutput.has(id)) return []\n const text = this.toolOutputs.get(id)\n if (!text) return []\n this.emittedOutput.add(id)\n this.toolOutputs.delete(id)\n const icon = update.status === 'failed' ? ':x:' : ':page_facing_up:'\n // Icon on its own line so the fenced code block starts at column 0 — a fence indented\n // by the icon prefix would not be parsed as a code block under CommonMark.\n return [{ kind: 'tool-output', text: `${icon}\\n${codeSpan(capOutput(text), true)}` }]\n }\n\n onUpdate(update: SessionUpdate): SlackAction[] {\n switch (update.sessionUpdate) {\n case 'agent_message_chunk': {\n const content = (update as { content?: { type?: string; text?: string } }).content\n const text = content?.type === 'text' ? (content.text ?? '') : ''\n // A new message closes the one before it as a tool boundary would; without this the two run together as one post.\n const opens = this.messages.opens(update)\n // A closed message that was only sentinel text can never complete: drop it instead of joining the next message onto it.\n if (opens) this.buf = this.messages.withoutClosedSentinel(this.buf)\n const closed = opens ? (this.mode === 'minimal' ? this.closeSegment() : this.flush()) : []\n this.buf += text\n return closed\n }\n case 'agent_thought_chunk': {\n // high: accumulate the streamed thought into the reasoning buffer and mark it\n // dirty; the actual in-place `reasoning` update is deferred to flushBuffered()\n // (idle timer) / onFinal so a token-by-token stream doesn't flood chat.update.\n // low + medium keep only the transient status — no reasoning in the channel.\n // A STREAMING turn keeps none of this: its cards are the Thinking message (§5).\n const thought = (update as { content?: { text?: string } }).content?.text ?? ''\n if (this.mode === 'high' && thought && !this.streaming) {\n this.reasoningBuf += thought\n // Soft-cap the raw buffer so a very long turn can't grow it unbounded;\n // renderReasoning tail-clamps again for the message body.\n if (this.reasoningBuf.length > MAX_REASONING * 2) {\n this.reasoningBuf = this.reasoningBuf.slice(-MAX_REASONING * 2)\n }\n this.reasoningDirty = true\n }\n // streaming: ONE card per thinking run, opened once and settled once. Its title is the\n // run's own first line and, on high, its body is the rest of the run — so the card IS\n // the Thinking message and the separate one is not posted (§5). Not on minimal, whose\n // cards are its interim replies and whose thinking stays in the transient status.\n if (this.streaming && thought && this.mode !== 'minimal') {\n if (!this.thinkingActive) {\n this.thinkingActive = true\n this.queueTask(this.thinkingId(), THINKING_CARD, 'in_progress', { icon: 'lightbulb' })\n }\n this.noteThinkingTitle(thought)\n if (this.mode === 'high') this.appendThinkingBody(thought)\n }\n // minimal: keep the streamed reply intact (thinking mid-reply doesn't close a\n // segment) — only surface the transient status.\n if (this.mode === 'minimal') return this.pushActivity(THINKING)\n // Flush any buffered body, then surface the live \"is thinking…\" status.\n return [...this.flush(), ...this.pushActivity(THINKING)]\n }\n case 'tool_call':\n case 'tool_call_update': {\n const u = update as {\n toolCallId?: string\n title?: string\n status?: string\n kind?: ToolKind | null\n content?: unknown\n rawInput?: unknown\n rawOutput?: unknown\n }\n // Minimal deliberately hides the concrete tool label as well as tool cards/output:\n // keep Slack's transient working indicator generic so commands and tool names do\n // not leak into the channel chrome. Thinking remains a distinct thought-chunk state.\n const label = this.mode === 'minimal' ? WORKING : this.toolLabel(u)\n this.noteToolInput(u)\n const status = this.pushActivity(label)\n const closed = this.work.opens(update) ? (this.mode === 'minimal' ? this.closeSegment() : this.flush()) : []\n // minimal: only new work closes the reply segment into a history card and transcript.\n if (this.mode === 'minimal') return [...status, ...closed]\n // none/low: just record the buffered body — no tool card, no status (none emits none).\n if (this.mode === 'low' || this.mode === 'none') return [...closed, ...status]\n // medium/high: reflect the current tool on the in-place progress message. The\n // label (a command line / tool title) is wrapped in a code span so it renders\n // verbatim in the `markdown` block instead of being parsed as emphasis.\n const progressText = `:hammer_and_wrench: ${codeSpan(label)}`\n const actions: SlackAction[] = [...closed, ...status]\n // streaming: that in-place message becomes one task card on the stream, keyed by\n // toolCallId so streamed updates edit a card instead of stacking (§4). The append\n // still carries the legacy text, so a stream that never opened degrades to it.\n if (this.streaming && u.toolCallId) {\n this.closeThinkingRun()\n const terminal = u.status === 'completed' || u.status === 'failed'\n // A failed TOOL never takes card status `error`: the container icon is derived from\n // the cards (any error card reddens the whole plan, verified live 2026-08-29), so one\n // non-zero exit would present a completed turn as a failed one. The failure is said\n // in words instead — a plain \"(failed)\" prefix, counted into the closing label —\n // and `error` is reserved for the cancel path, where a red container is the truth.\n const failed = u.status === 'failed'\n if (failed) this.failedTasks.add(u.toolCallId)\n // High mode shows the command immediately and retains the latest result until completion.\n if (this.mode === 'high') this.noteToolOutput(u)\n const body =\n this.mode === 'high'\n ? {\n command: this.cardCommand(u.toolCallId, label),\n ...(terminal ? { output: this.toolOutputs.get(u.toolCallId) ?? '' } : {})\n }\n : {}\n this.queueTask(\n u.toolCallId,\n (failed ? FAILED_PREFIX : '') + this.cardTitle(u.toolCallId, label),\n terminal ? 'complete' : 'in_progress',\n { ...body, ...(u.kind ? { icon: TASK_ICONS[u.kind] ?? 'gear' } : {}) }\n )\n if (terminal) this.toolOutputs.delete(u.toolCallId)\n this.pendingProgress = progressText\n } else {\n actions.push({ kind: 'progress', text: progressText })\n }\n // high only, and only off the stream: a streaming turn's card already carries the same\n // command and result, so posting the code block too would say everything twice.\n if (this.mode === 'high' && !this.streaming) actions.push(...this.drainToolOutput(u))\n return actions\n }\n case 'plan': {\n const entries = (update as { entries?: PlanEntry[] }).entries ?? []\n // `minimal` promises the turn is ONE visible reply and `none` sends nothing at all, so\n // both keep planning as transient status. `low` renders it: that rung means \"body and\n // result only, activity goes to the status row\", and the plan was excluded when its\n // only shape was a six-line emoji block. As a ruled, struck-through list it is neither\n // activity nor noise — it is the shortest statement of what the turn is for — and low\n // is the DEFAULT, so excluding it hid the plan from most agents in the product.\n if (this.mode === 'minimal') return this.pushActivity('planning…')\n if (this.mode === 'none') return [...this.flush(), ...this.pushActivity('planning…')]\n return [...this.flush(), { kind: 'plan', ...renderPlan(entries) }]\n }\n case 'usage_update':\n return [] // dropped (goes to telemetry, not the channel)\n default:\n return []\n }\n }\n\n /** Turn end (§9.1 stopReason): flush remaining body, clear the loading status, and\n * append the optional identity/runtime/model/session attribution. */\n onFinal(info?: SlackAttributionInfo): SlackAction[] {\n const clear: SlackAction = { kind: 'set-status', text: '' }\n // A bare response-control marker (or a non-compliant explanation ending in a bare marker\n // line) means this message wasn't for the agent.\n // Suppress everything: clear the \"is thinking…\" status and post nothing — no body, no\n // reasoning, no attribution footer. The inbound message was still recorded and the thread\n // watermark advanced in SessionManager, so peers keep seeing it as context; this agent\n // just stays silent.\n if (isNoResponseBody(this.buf.trim())) {\n this.buf = ''\n // The stream is chrome, not the answer: a silent turn that ran tools still owes its\n // cards a terminal status and its container a closing label.\n return [clear, ...this.settleStream('completed')]\n }\n // none: settle the final body into the transcript (recordOnly via flush) and stop — no\n // status clear, no attribution footer; nothing is delivered to the channel this turn.\n if (this.mode === 'none') return this.flush()\n const attribution: SlackAction[] = info ? [{ kind: 'attribution', ...buildAttributionBlocks(info) }] : []\n if (this.mode === 'low') return [...this.markTerminalPost(this.flush()), clear, ...attribution]\n // minimal takes the same path as medium/high: its one visible reply is the final flush,\n // posted like any other body, and the settle closes the history cards above it (§5.2).\n // The daemon cancels the idle-flush timer before onFinal, so drain any reasoning\n // buffered since the last flush here. It goes BEFORE the body flush so the Thinking\n // block posts above the reply — thinking precedes the answer (§9.1), so it must sit\n // above it, not below (only high mode ever has reasoning to drain).\n const reasoning = this.drainReasoning()\n // A settle that must still OPEN the stream goes before the body, so the container is created\n // above the answer it precedes (§6); a stream already open settles after the body, as before.\n const opensLate = !this.streamOpened\n const settle = this.settleStream('completed')\n const body = [...this.markTerminalPost(this.flush()), clear, ...attribution]\n return opensLate ? [...reasoning, ...settle, ...body] : [...reasoning, ...body, ...settle]\n }\n\n /** onFinal only: flag the last delivered body section as this response's terminal post,\n * so the applier can close the response at post time instead of re-editing it (§5.5). */\n private markTerminalPost(actions: SlackAction[]): SlackAction[] {\n for (let i = actions.length - 1; i >= 0; i--) {\n const action = actions[i]\n if (action?.kind === 'post' && !action.recordOnly && action.attributed !== false) {\n action.terminal = true\n break\n }\n }\n return actions\n }\n}\n"],"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],"mappings":";;;;;;;AAEA,MAAa,4BAA4B;AACzC,MAAM,WAAWA,MAAO,CAAC,UAAU,OAAO,CAAC;AAC3C,MAAM,SAASC,SAAS,CAAC,CAAC,MAAM,YAAY;AAE5C,MAAa,0BAA0BC,OAAS;CAC5C,UAAU;CACV,QAAQ;CACR,OAAOC,OACK;EACR,OAAOF,SAAS,CAAC,CAAC,IAAI,CAAC;EACvB,WAAWA,SAAS,CAAC,CAAC,KAAK;EAC3B,MAAMA,SAAS,CAAC,CAAC,IAAI;EACrB,YAAYA,SAAS,CAAC,CAAC,IAAI,CAAC;EAC5B,gBAAgBA,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;EAE3C,WAAWG,QAAU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