@agentconnect.md/daemon 1.0.0-rc.22 → 1.0.0-rc.221

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/acp-host-zyZ_j0yY.js +10570 -0
  2. package/dist/acp-host-zyZ_j0yY.js.map +1 -0
  3. package/dist/agent-list-Vx-p1X3q.js +21 -0
  4. package/dist/agent-list-Vx-p1X3q.js.map +1 -0
  5. package/dist/bridge-DoUrmBw9.js +9904 -0
  6. package/dist/bridge-DoUrmBw9.js.map +1 -0
  7. package/dist/chat-CqfkPkqK.js +79 -0
  8. package/dist/chat-CqfkPkqK.js.map +1 -0
  9. package/dist/commander-B5QVEFzH.js +2965 -0
  10. package/dist/commander-B5QVEFzH.js.map +1 -0
  11. package/dist/esm-DrGCKNjx.js +1516 -0
  12. package/dist/esm-DrGCKNjx.js.map +1 -0
  13. package/dist/execAsync-C-9b-eWN.js +12 -0
  14. package/dist/execAsync-C-9b-eWN.js.map +1 -0
  15. package/dist/getMachineId-bsd-CfqSzACM.js +29 -0
  16. package/dist/getMachineId-bsd-CfqSzACM.js.map +1 -0
  17. package/dist/getMachineId-darwin-CDKafrUs.js +26 -0
  18. package/dist/getMachineId-darwin-CDKafrUs.js.map +1 -0
  19. package/dist/getMachineId-linux-DG3AvXtg.js +22 -0
  20. package/dist/getMachineId-linux-DG3AvXtg.js.map +1 -0
  21. package/dist/getMachineId-unsupported-BIPpTXqb.js +17 -0
  22. package/dist/getMachineId-unsupported-BIPpTXqb.js.map +1 -0
  23. package/dist/getMachineId-win-DNO3uByP.js +28 -0
  24. package/dist/getMachineId-win-DNO3uByP.js.map +1 -0
  25. package/dist/git-credential-BfkyzKn2.js +99 -0
  26. package/dist/git-credential-BfkyzKn2.js.map +1 -0
  27. package/dist/gitcred-server-Dcsq6QJe.js +236 -0
  28. package/dist/gitcred-server-Dcsq6QJe.js.map +1 -0
  29. package/dist/index.js +67364 -79446
  30. package/dist/index.js.map +1 -1
  31. package/dist/ipc-2Xbxe7uu.js +35 -0
  32. package/dist/ipc-2Xbxe7uu.js.map +1 -0
  33. package/dist/load-agents-C1m5Y9n_.js +317 -0
  34. package/dist/load-agents-C1m5Y9n_.js.map +1 -0
  35. package/dist/lock-CA9Bm8_s.js +66 -0
  36. package/dist/lock-CA9Bm8_s.js.map +1 -0
  37. package/dist/login-DUhkVhAr.js +229 -0
  38. package/dist/login-DUhkVhAr.js.map +1 -0
  39. package/dist/paths-CcRUjFjy.js +2 -0
  40. package/dist/paths-DEcUO8lC.js +43 -0
  41. package/dist/paths-DEcUO8lC.js.map +1 -0
  42. package/dist/rolldown-runtime-CE-6LUnI.js +44 -0
  43. package/dist/run-foreground-PSOzCSP8.js +2 -0
  44. package/dist/run-foreground-mvTzCScX.js +84591 -0
  45. package/dist/run-foreground-mvTzCScX.js.map +1 -0
  46. package/dist/schemas-DujcoO0q.js +4357 -0
  47. package/dist/schemas-DujcoO0q.js.map +1 -0
  48. package/dist/service-6w0WKhdx.js +2 -0
  49. package/dist/service-BQVw7wbz.js +245 -0
  50. package/dist/service-BQVw7wbz.js.map +1 -0
  51. package/dist/src-DDtlVutj.js +811 -0
  52. package/dist/src-DDtlVutj.js.map +1 -0
  53. package/dist/version-DGaRXjBK.js +7 -0
  54. package/dist/version-DGaRXjBK.js.map +1 -0
  55. package/package.json +3 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acp-host-zyZ_j0yY.js","names":["z.object","z.string","z.array","z.record","z\n .object","z.union","z.object","z.literal","z.string","z.unknown","z.number","z.object","z.string","z\n .object","z.number","z.boolean","z.enum","z.object","z.string","z.discriminatedUnion","z.literal","z.array","z.boolean","z.number","z.unknown","z.union","z.object","z.enum","z.string","z.boolean","z.number","z.object","z.string","z.number","z.enum","z.discriminatedUnion","z.object","z.literal","z.string","z.enum","z.boolean","z.record","z.array","z.discriminatedUnion","z.object","z.literal","z.string","z.array","z.boolean","z.object","z.string","z.array","z.boolean","z.number","z.object","z.string","z.enum","z.literal","z.number","z.object","z.number","z.string","z.array","z.unknown","z.boolean","z.object","z.string","z.enum","z.array","z.object","z.string","z.enum","z.number","z.boolean","z.array","z.object","z.string","z.number","z.boolean","z.array","z.object","z.number","z.enum","z.array","z.string","z.boolean","z.record","z.unknown","z.enum","z.object","z.string","z.boolean","z.record","z.unknown","z.object","z.string","z.boolean","z.enum","z.discriminatedUnion","z.literal","z.number","z.array","z\n .object","z.object","z.literal","z.string","z.discriminatedUnion","c","o","r","m","v","FOLDER","isPathSpec","isPathSpec2","pathspec2","pathspec3","vulnerabilityCheck","isPathSpec3","toPaths","z.unknown","z.NEVER","z\n .array","z.union","z.number","z.string","z.object","z.record","z.unknown","z\n .int","z.literal","z.array","z.boolean","z\n .record","z.intersection","z.url","z\n .union","z.int","validate.zInitializeRequest","validate.zNewSessionRequest","validate.zLoadSessionRequest","validate.zForkSessionRequest","validate.zListSessionsRequest","validate.zDeleteSessionRequest","validate.zResumeSessionRequest","validate.zCloseSessionRequest","validate.zSetSessionModeRequest","validate.zSetSessionConfigOptionRequest","validate.zAuthenticateRequest","validate.zListProvidersRequest","validate.zSetProviderRequest","validate.zDisableProviderRequest","validate.zLogoutRequest","validate.zPromptRequest","validate.zStartNesRequest","validate.zSuggestNesRequest","validate.zCloseNesRequest","validate.zCancelNotification","validate.zDidOpenDocumentNotification","validate.zDidChangeDocumentNotification","validate.zDidCloseDocumentNotification","validate.zDidSaveDocumentNotification","validate.zDidFocusDocumentNotification","validate.zAcceptNesNotification","validate.zRejectNesNotification","validate.zRequestPermissionRequest","validate.zWriteTextFileRequest","validate.zReadTextFileRequest","validate.zCreateTerminalRequest","validate.zTerminalOutputRequest","validate.zReleaseTerminalRequest","validate.zWaitForTerminalExitRequest","validate.zKillTerminalRequest","validate.zCreateElicitationRequest","validate.zSessionNotification","validate.zCompleteElicitationNotification","spawn","createClientApp"],"sources":["../src/runtimes/registry.ts","../../protocol/dist/envelope.js","../../protocol/dist/frames/auth.js","../../protocol/dist/frames/route.js","../../protocol/dist/frames/cron.js","../../protocol/dist/frames/secrets.js","../../protocol/dist/frames/agent.js","../../protocol/dist/frames/integration.js","../../protocol/dist/frames/register.js","../../protocol/dist/frames/gitcred.js","../../protocol/dist/frames/session.js","../../protocol/dist/frames/channel.js","../../protocol/dist/frames/workspace.js","../../protocol/dist/frames/memory.js","../../protocol/dist/frames/telemetry.js","../../protocol/dist/frames/error.js","../../protocol/dist/frames/webchat.js","../../protocol/dist/frame.js","../../protocol/dist/codec.js","../../protocol/dist/git-url.js","../../protocol/dist/index.js","../../../node_modules/.pnpm/@kwsites+file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/src/index.js","../../../node_modules/.pnpm/@kwsites+file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/index.js","../../../node_modules/.pnpm/@simple-git+args-pathspec@1.0.3/node_modules/@simple-git/args-pathspec/dist/index.mjs","../../../node_modules/.pnpm/@kwsites+promise-deferred@1.1.1/node_modules/@kwsites/promise-deferred/dist/index.js","../../../node_modules/.pnpm/@simple-git+argv-parser@1.1.1/node_modules/@simple-git/argv-parser/dist/index.mjs","../../../node_modules/.pnpm/simple-git@3.36.0/node_modules/simple-git/dist/esm/index.js","../src/workspace/git-injection.ts","../src/workspace/workspace-manager.ts","../../../node_modules/.pnpm/@agentclientprotocol+sdk@1.1.0_zod@4.4.3/node_modules/@agentclientprotocol/sdk/dist/schema/index.js","../../../node_modules/.pnpm/@agentclientprotocol+sdk@1.1.0_zod@4.4.3/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js","../../../node_modules/.pnpm/@agentclientprotocol+sdk@1.1.0_zod@4.4.3/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js","../../../node_modules/.pnpm/@agentclientprotocol+sdk@1.1.0_zod@4.4.3/node_modules/@agentclientprotocol/sdk/dist/stream.js","../../../node_modules/.pnpm/@agentclientprotocol+sdk@1.1.0_zod@4.4.3/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js","../../../node_modules/.pnpm/@agentclientprotocol+sdk@1.1.0_zod@4.4.3/node_modules/@agentclientprotocol/sdk/dist/acp.js","../src/runtimes/probe.ts","../src/acp/acp-host.ts"],"sourcesContent":["import { z } from 'zod'\nimport { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs'\nimport { dirname } from 'node:path'\nimport type { RuntimeDef, Config } from '../config/config-schema.js'\nimport { registryPath, registryCachePath } from '../paths.js'\n\nconst PackageDistSchema = z.object({ package: z.string(), args: z.array(z.string()).default([]) })\nconst BinaryPlatformSchema = z.object({\n archive: z.string().optional(),\n cmd: z.string(),\n args: z.array(z.string()).default([]),\n env: z.record(z.string(), z.string()).default({})\n})\nconst DistributionSchema = z.object({\n npx: PackageDistSchema.optional(),\n uvx: PackageDistSchema.optional(),\n binary: z.record(z.string(), BinaryPlatformSchema).optional()\n})\nexport const RegistryEntrySchema = z.object({\n id: z.string(),\n name: z.string().default(''),\n version: z.string().default(''),\n distribution: DistributionSchema\n})\nexport type RegistryEntry = z.infer<typeof RegistryEntrySchema>\n\n// Root tolerates both an id-keyed object and an {agents:[...]} array; normalizes to {agents: Record}.\nexport const RegistryDocSchema = z\n .object({ agents: z.union([z.array(RegistryEntrySchema), z.record(z.string(), RegistryEntrySchema)]) })\n .transform((d) => ({\n agents: Array.isArray(d.agents) ? Object.fromEntries(d.agents.map((a) => [a.id, a])) : d.agents\n }))\nexport type RegistryDoc = { agents: Record<string, RegistryEntry> }\n\nexport function platformKey(): string | null {\n const os =\n process.platform === 'win32'\n ? 'windows'\n : process.platform === 'darwin'\n ? 'darwin'\n : process.platform === 'linux'\n ? 'linux'\n : null\n const arch = process.arch === 'arm64' ? 'aarch64' : process.arch === 'x64' ? 'x86_64' : null\n if (!os || !arch) return null\n return `${os}-${arch}`\n}\n\nexport function toRuntimeDef(entry: RegistryEntry): RuntimeDef | null {\n const d = entry.distribution\n if (d.npx) return { command: 'npx', args: ['-y', d.npx.package, ...d.npx.args], env: [] }\n if (d.uvx) return { command: 'uvx', args: [d.uvx.package, ...d.uvx.args], env: [] }\n if (d.binary) {\n const key = platformKey()\n const bin = key ? d.binary[key] : undefined\n if (!bin) return null\n return { command: bin.cmd, args: bin.args, env: Object.entries(bin.env).map(([name, value]) => ({ name, value })) }\n }\n return null\n}\n\nconst REGISTRY_URL = 'https://cdn.agentclientprotocol.com/registry/v1/latest/registry.json'\nconst DEFAULT_TIMEOUT_MS = 4500\n\ninterface CacheMeta {\n etag?: string\n lastModified?: string\n fetchedAt?: number\n}\n\nfunction readCachedDoc(root: string): RegistryDoc | null {\n const file = registryPath(root)\n if (!existsSync(file)) return null\n try {\n return RegistryDocSchema.parse(JSON.parse(readFileSync(file, 'utf8')))\n } catch {\n return null\n }\n}\n\nfunction readCacheMeta(root: string): CacheMeta {\n const file = registryCachePath(root)\n if (!existsSync(file)) return {}\n try {\n return JSON.parse(readFileSync(file, 'utf8')) as CacheMeta\n } catch {\n return {}\n }\n}\n\nexport async function fetchRegistry(\n root: string,\n opts: { fetchImpl?: typeof fetch; timeoutMs?: number } = {}\n): Promise<RegistryDoc> {\n const doFetch = opts.fetchImpl ?? fetch\n const meta = readCacheMeta(root)\n const headers: Record<string, string> = {}\n if (meta.etag) headers['If-None-Match'] = meta.etag\n if (meta.lastModified) headers['If-Modified-Since'] = meta.lastModified\n\n const ac = new AbortController()\n const timer = setTimeout(() => ac.abort(), opts.timeoutMs ?? DEFAULT_TIMEOUT_MS)\n try {\n const res = await doFetch(REGISTRY_URL, { headers, signal: ac.signal })\n if (res.status === 304) return readCachedDoc(root) ?? { agents: {} }\n if (!res.ok) return readCachedDoc(root) ?? { agents: {} }\n const bodyText = await res.text()\n const doc = RegistryDocSchema.parse(JSON.parse(bodyText))\n mkdirSync(dirname(registryPath(root)), { recursive: true }) // root may not exist on a zero-config first run\n writeFileSync(registryPath(root), bodyText)\n const newMeta: CacheMeta = {\n etag: res.headers.get('etag') ?? undefined,\n lastModified: res.headers.get('last-modified') ?? undefined,\n fetchedAt: Date.now()\n }\n writeFileSync(registryCachePath(root), JSON.stringify(newMeta))\n return doc\n } catch {\n return readCachedDoc(root) ?? { agents: {} }\n } finally {\n clearTimeout(timer)\n }\n}\n\n/**\n * Display names (registry id -> human-facing `name`) read from the local cache.\n * Used for capability reporting — the daemon advertises the tool name to the CP\n * rather than the registry id. Entries with no `name` are omitted (callers fall\n * back to the id). Returns `{}` when no cached registry doc exists.\n */\nexport function cachedRuntimeNames(root: string): Record<string, string> {\n const doc = readCachedDoc(root)\n if (!doc) return {}\n const out: Record<string, string> = {}\n for (const [id, entry] of Object.entries(doc.agents)) {\n if (entry.name) out[id] = entry.name\n }\n return out\n}\n\n/**\n * Runtime versions (registry id -> `version`) read from the local cache. Used to\n * stamp each entry of the `facts/daemon-runtimes` snapshot the daemon reports.\n * Entries with no `version` are omitted (callers fall back to ''). `{}` when no\n * cached registry doc exists.\n */\nexport function cachedRuntimeVersions(root: string): Record<string, string> {\n const doc = readCachedDoc(root)\n if (!doc) return {}\n const out: Record<string, string> = {}\n for (const [id, entry] of Object.entries(doc.agents)) {\n if (entry.version) out[id] = entry.version\n }\n return out\n}\n\nexport async function defaultRuntimes(\n root: string,\n opts: { mode?: 'cache-first' | 'blocking'; fetchImpl?: typeof fetch; timeoutMs?: number } = {}\n): Promise<Record<string, RuntimeDef>> {\n const mode = opts.mode ?? 'blocking'\n const cached = mode === 'cache-first' ? readCachedDoc(root) : null\n let doc: RegistryDoc\n if (cached) {\n doc = cached\n void fetchRegistry(root, opts).catch(() => {}) // background refresh; affects next run only\n } else {\n doc = await fetchRegistry(root, opts)\n }\n const out: Record<string, RuntimeDef> = {}\n for (const [id, entry] of Object.entries(doc.agents)) {\n const rt = toRuntimeDef(entry)\n if (rt) out[id] = rt\n }\n return out\n}\n\nexport async function resolveRuntimes(\n cfg: Config,\n root: string,\n opts: {\n neededRuntimes?: string[]\n mode?: 'cache-first' | 'blocking'\n fetchImpl?: typeof fetch\n timeoutMs?: number\n } = {}\n): Promise<Record<string, RuntimeDef>> {\n const userRuntimes = cfg.runtimes ?? {}\n const needed = opts.neededRuntimes\n if (needed && needed.length > 0 && needed.every((n) => userRuntimes[n])) {\n return { ...userRuntimes }\n }\n const defaults = await defaultRuntimes(root, opts)\n return { ...defaults, ...userRuntimes }\n}\n","import { z } from 'zod';\n/**\n * The protocol envelope — every frame, both directions, is wrapped in this.\n * Mirrors daemon-cp-ws-protocol.md §1.1.\n *\n * `payload` is left as `unknown` here and validated by the per-type schema in\n * `frames/*` via `FRAME_SCHEMAS[type]` (see `frame.ts`). This two-step parse is\n * what lets the codec answer an unknown `type` with `UNKNOWN_FRAME` (a REP)\n * instead of a hard close — forward-compat, protocol §1.\n */\nexport const Envelope = z.object({\n v: z.literal(1), // protocol major; bump = breaking\n id: z.string().uuid(), // unique per frame (sender-generated)\n ts: z.string().datetime(), // RFC3339, sender clock (advisory only)\n type: z.string(), // frame discriminator, e.g. \"register\"\n corr: z.string().uuid().optional(), // correlation: set on a reply to the request's `id`\n payload: z.unknown() // validated by the per-type schema\n});\n/**\n * Control-frame envelope extension — protocol §4.2.\n *\n * Fenced C→D frames carry this block alongside `payload`. It is the fencing\n * surface: `epoch` (sessionEpoch this frame was issued under), the `agentId` an\n * agent-scoped frame belongs to, and the `launchId` fence. Daemon validation\n * order: epoch → launchId.\n */\nexport const ControlExt = z.object({\n epoch: z.number().int(), // sessionEpoch this frame was issued under (§3.1 fencing)\n agentId: z.string().uuid().optional(), // present on agent-scoped frames\n launchId: z.string().uuid().optional() // per-launch fence, §4.4\n});\n/** The all-zero UUID used when a frame is malformed past the point of reading `id`. */\nexport const NIL_UUID = '00000000-0000-0000-0000-000000000000';\n//# sourceMappingURL=envelope.js.map","import { z } from 'zod';\n/**\n * Auth & identity — protocol §3.1 / §3.2.\n *\n * `auth` is the first frame after the socket opens. `auth/ok` carries the\n * minted `sessionEpoch` (the global fencing token), heartbeat cadence, and the\n * resume verdict.\n */\nexport const AuthReq = z.object({\n // Long-lived, revocable API key — a bare opaque `<secret><crc>`, hashed at rest and looked up\n // by that unique hash (see docs/designs/daemon-api-key-auth.md). The only daemon credential.\n apiKey: z.string(),\n // Optional echo of the daemonId. If present it must equal the daemonId the ApiKey row\n // resolves to; otherwise the daemon adopts the authoritative id from `auth/ok`.\n daemonId: z.string().uuid().optional(),\n machineId: z.string().uuid().optional(), // 🅼 machine identity (scope-attestation, §3.2) — NOT the auth credential\n attestation: z.string().optional(), // 🅼 signed proof (JWS), §3.2\n agentVersion: z.string(), // daemon build/version\n resume: z\n .object({\n lastEpoch: z.number().int() // sessionEpoch the daemon last held\n })\n .optional()\n});\nexport const AuthOk = z.object({\n daemonId: z.string().uuid(),\n sessionEpoch: z.number().int(), // monotonic; bumped each successful (re)auth — fencing token\n heartbeatSec: z.number().int(), // cadence the daemon must emit heartbeat at\n serverTime: z.string().datetime(),\n // Base URL of the Web App console (the CP's own public origin), so the daemon can build\n // session deep links without local config. Omitted when the CP has no console URL\n // configured; a daemon-local `webAppUrl` overrides it.\n webAppUrl: z.string().optional(),\n // Slug of the org this daemon's api key belongs to. The console is org-scoped\n // (`<webAppUrl>/<orgSlug>/sessions/<id>`), so the daemon needs it to build a link that\n // resolves. Omitted when the CP can't resolve it; then the daemon drops the segment.\n orgSlug: z.string().optional(),\n resume: z\n .object({\n accepted: z.boolean() // false ⇒ daemon must do a full register reconcile\n })\n .optional()\n});\n//# sourceMappingURL=auth.js.map","import { z } from 'zod';\n/**\n * Routing & orchestration (C→D control) — protocol §5.\n *\n * `SessionKey` is the canonical session primitive shared across route/*,\n * agent/*, and event/session. Its canonical string form is\n * `${platform}:${channel}:${thread ?? \"-\"}`.\n */\nexport const Platform = z.enum(['slack', 'telegram', 'webchat']);\nexport const SessionKey = z.object({\n platform: Platform,\n channel: z.string(),\n thread: z.string().optional() // absent = channel-root\n});\n/** Trigger-matching rule for a binding (protocol §5.1). */\nexport const BindRule = z.object({\n match: z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('mention') }),\n z.object({ kind: z.literal('dm') }),\n z.object({ kind: z.literal('keyword'), value: z.string() }),\n z.object({ kind: z.literal('auto') }) // alert-channel auto-handle\n ])\n});\nexport const RouteAssign = z.object({\n // also appears in RegisterOk.assignments[]\n sessionKey: SessionKey,\n agentId: z.string().uuid(),\n workspaceId: z.string().uuid(), // which D9 workspace to prepare\n bindRules: z.array(BindRule).default([])\n});\nexport const RouteAssignAck = z.object({\n ok: z.boolean(),\n sessionKey: SessionKey,\n reason: z.string().optional()\n});\nexport const RouteUpdate = z.object({\n routingEpoch: z.number().int(),\n rules: z.array(z.object({ match: z.unknown(), agentId: z.string().uuid() }))\n});\n/** Graceful scale-down / rebalance — protocol §5.3. */\nexport const Drain = z.object({\n scope: z.union([\n z.object({ kind: z.literal('agent'), agentId: z.string().uuid() }),\n z.object({ kind: z.literal('daemon') }), // whole-daemon drain (shutdown/upgrade)\n z.object({ kind: z.literal('session'), sessionKey: SessionKey })\n ]),\n deadline: z.string().datetime() // hard cutoff; in-flight turns past this are cancelled\n});\nexport const DrainProgress = z.object({\n remaining: z.number().int(),\n drained: z.array(SessionKey)\n});\nexport const DrainDone = z.object({\n released: z.array(SessionKey) // CP may now reassign — fenced by new epoch\n});\n//# sourceMappingURL=route.js.map","import { z } from 'zod';\n/**\n * Cron sinks to the daemon (D5) — protocol §5.4.\n *\n * A cron periodically triggers ONE AGENT with a synthetic prompt (`trigger`) to\n * carry out some work. The CP owns the definition; the daemon owns firing +\n * last-run persistence, so crons fire even when the CP is down. On receipt the\n * daemon persists the def into the owning agent's `agent.json` `crons[]` (the\n * single source of truth, same model as integrations) — surviving a restart\n * with the CP down.\n *\n * `target` is OPTIONAL output routing: when present, the daemon posts the\n * trigger as a real message in that channel and the agent's session replies in\n * its thread; when absent the fire is headless (the agent works with no\n * platform output).\n */\nexport const CronTarget = z.object({\n platform: z.enum(['slack', 'telegram']).default('slack'),\n channel: z.string(),\n // The agent integration whose connection posts the anchor — targets come from\n // the owning agent's integrations, so the daemon posts through the right bot\n // when the agent has several. Absent (legacy defs) ⇒ first integration.\n integrationId: z.string().uuid().optional()\n});\nexport const CronUpsert = z.object({\n cronId: z.string().uuid(),\n agentId: z.string().uuid(), // the agent this cron drives — routes the def to its daemon\n schedule: z.string(), // croner expression (tz-aware)\n target: CronTarget.optional(), // absent ⇒ headless fire\n trigger: z.string(), // synthetic prompt text injected on fire\n enabled: z.boolean().default(true)\n});\nexport const CronRemove = z.object({\n cronId: z.string().uuid()\n});\n/**\n * `cron/report` (D→C EVT, fire-and-forget) — one CP-owned cron fired. The\n * daemon stamps the fire into its local store first (it stays authoritative,\n * §5.4) and reports it here so the console's `lastRunAt` converges; the CP\n * upsert is latest-wins, so the daemon re-asserting its stored stamps on\n * reconnect (fires while the CP was unreachable) is idempotent and can never\n * regress the value. Hand-authored (no-origin) crons are never reported.\n *\n * Two reports per fire, keyed by `(cronId, firedAt)`: the FIRE report (no\n * `status`) opens the run, and the COMPLETION report (with `status` + outcome\n * fields) closes it once the dispatched turn ends — feeding the console's\n * per-schedule run history. A completion without a prior fire report (CP was\n * down at fire time) still creates the run row.\n */\nexport const CronRunStatus = z.enum(['success', 'failed']);\nexport const CronReport = z.object({\n cronId: z.string().uuid(),\n agentId: z.string().uuid(), // the owning agent — scopes the report to its daemon\n firedAt: z.string().datetime(),\n // Completion-only outcome fields (absent on the fire report / legacy daemons).\n status: CronRunStatus.optional(),\n durationMs: z.number().int().nonnegative().optional(), // fire → turn end\n sessionId: z.string().optional(), // ACP session the run prompted (console deep-link)\n reason: z.string().optional() // short failure text (status \"failed\")\n});\n/**\n * `cron/run` (C→D REQ → ack) — fire one CP-owned cron NOW (console \"Run now\").\n * The daemon accepts (`ok:true`) and runs the fire asynchronously — outcome\n * arrives as normal `cron/report`s; `ok:false` when it holds no such cron.\n */\nexport const CronRunNow = z.object({\n cronId: z.string().uuid()\n});\n//# sourceMappingURL=cron.js.map","import { z } from 'zod';\nimport { Platform } from './route.js';\n/**\n * Secrets (C5 ↔ D10) — protocol §6.\n *\n * Lease-based, no plaintext on the wire or in PG. Every frame carries a\n * REFERENCE to a Vault/KMS path, never the secret material itself.\n */\nexport const SecretsRequest = z.object({\n // D→C, REQ — daemon asks for a lease at session start\n scope: z.object({\n platform: Platform,\n workspaceId: z.string().uuid()\n })\n});\nexport const SecretsGrant = z.object({\n // C→D, REP (also in RegisterOk.leases[])\n leaseId: z.string().uuid(),\n scope: z.object({\n platform: z.string(),\n workspaceId: z.string().uuid()\n }),\n ref: z.string(), // Vault/KMS path or handle — NOT the secret\n ttl: z.number().int(), // seconds\n renewBeforeSec: z.number().int() // daemon should renew this many sec before expiry\n});\nexport const SecretsRenew = z.object({\n leaseId: z.string().uuid() // D→C REQ → new SecretsGrant\n});\nexport const SecretsRevoke = z.object({\n leaseId: z.string().uuid(),\n reason: z.string() // C→D EVT (hot revoke)\n});\n/** 🅼 Direct-to-store upload/download grant — protocol §3.2 / frame #25. */\nexport const ScopeAttestation = z.object({\n machineId: z.string().uuid(),\n scope: z.enum(['attachment.put', 'attachment.get', 'facts.put']),\n resourceRef: z.string(), // opaque object key/prefix\n jws: z.string(), // signed capability the store verifies offline\n exp: z.string().datetime()\n});\n//# sourceMappingURL=secrets.js.map","import { z } from 'zod';\n/**\n * Agent lifecycle (protocol §4.4, §7.4, §8).\n *\n * There is no CP→daemon prompt-delivery frame: the daemon prompts an agent from\n * its own ingress (platform adapters, and webchat over its own `webchat/*`\n * frames), never the CP. The old `agent/prompt` + per-agent `seq` machinery was\n * reserved infrastructure with no live caller and has been removed.\n */\n/**\n * Where the agent runs. Two modes; the **path is always daemon-generated** —\n * never specified by the caller (UX picks the mode, the machine owns the dir).\n *\n * - `scratch`: a fresh empty working dir on the machine, no repo.\n * - `github`: the daemon clones `gitRepo` @ `branch` and runs the agent in\n * `agentDir` (a subdir of the repo, repo-root if omitted). **Multiple agents\n * may share one repo** — they differ by `agentDir`, so the repo is not an\n * owned entity, just shared config on each agent.\n */\nexport const AgentWorkspace = z.discriminatedUnion('mode', [\n z.object({ mode: z.literal('scratch') }),\n z.object({\n mode: z.literal('github'),\n gitRepo: z.string(), // FULL cloneable address, e.g. https://github.com/acme/infra (normalizeGitUrl)\n branch: z.string().default('main'),\n agentDir: z.string().optional(), // subdir within the repo; omitted ⇒ repo root\n // Credential mode for remote git ops. Absent ⇒ anonymous (public repos,\n // the pre-github-app behavior). 'github-app' ⇒ the daemon pulls short-lived\n // CP-minted installation tokens over gitcred/request and injects them via\n // the local credential helper — no durable git credential on the host.\n gitCredential: z.enum(['github-app']).optional()\n })\n]);\n/**\n * The editable agent definition the CP owns and the daemon needs to run it:\n * prompt + runtime selection. Raft ships this in the launch config and the\n * daemon synthesizes the system prompt locally; `description` IS the prompt.\n */\nexport const AgentSpec = z.object({\n name: z.string(),\n description: z.string().optional(), // the system prompt seed; appended to the daemon's standing prompt\n runtime: z.string().optional(), // which ACP runtime to run, e.g. \"claude\" / \"codex\"\n model: z.string().optional(), // runtime model, e.g. \"opus\"\n reasoningEffort: z.string().optional(),\n executionMode: z.string().optional(), // e.g. \"byoc\"\n outputMode: z.enum(['low', 'medium', 'high']).optional(), // platform output verbosity → agent.json output.mode\n fastMode: z.boolean().optional(), // runtime fast mode (ACP `model_config` toggle); absent ⇒ leave runtime default\n permissionMode: z.string().optional(), // runtime permission/approval mode (ACP `mode` selector); absent ⇒ runtime default\n workspace: AgentWorkspace.optional(), // where it runs; absent ⇒ daemon defaults to scratch\n env: z.record(z.string(), z.string()).optional() // extra env injected into the runtime\n});\nexport const AgentLaunch = z.object({\n // C→D, carries ControlExt(epoch)\n agentId: z.string().uuid(),\n runtime: z.string(), // must be in RegisterReq.capabilities.runtimes\n workspaceId: z.string().uuid(),\n capabilities: z.array(z.string()), // the active-capability pin (§8.1)\n spec: AgentSpec, // prompt/model/env — arrives at start, no separate CRUD needed\n mode: z.enum(['long_lived', 'per_turn']).default('long_lived') // 🅰️ decision #2 knob\n});\n/**\n * Live agent CRUD (C→D): the console edited an agent's spec; push it so a\n * running daemon reloads without waiting for the next launch. `agent/remove`\n * tears the agent down. Deleting an agent never relaunches it.\n */\nexport const AgentUpsert = z.object({\n agentId: z.string().uuid(),\n spec: AgentSpec\n});\nexport const AgentRemove = z.object({\n agentId: z.string().uuid()\n});\nexport const AgentLaunched = z.object({\n // D→C, REP/EVT\n agentId: z.string().uuid(),\n launchId: z.string().uuid(), // new fence value\n acpSessionId: z.string().optional(), // 🅰️ present iff long-lived ACP session (default)\n startedAt: z.string().datetime(),\n runtime: z.string() // e.g. \"claude\" / \"codex\"\n});\nexport const AgentStop = z.object({\n agentId: z.string().uuid(),\n launchId: z.string().uuid(),\n reason: z.string()\n});\nexport const AgentActivity = z.object({\n // D→C, EVT — activity-probe (§7.4)\n agentId: z.string().uuid(),\n launchId: z.string().uuid(),\n state: z.enum(['thinking', 'tool_call', 'awaiting_permission', 'idle']),\n ts: z.string().datetime()\n});\nexport const AgentScopeDenied = z.object({\n // D→C, EVT — capability-scope audit (§8.1)\n agentId: z.string().uuid(),\n launchId: z.string().uuid(),\n capability: z.string()\n});\n//# sourceMappingURL=agent.js.map","import { z } from 'zod';\n/**\n * Platform integration distribution (C→D) — the Slack \"install\" flow.\n *\n * The Control Plane is the source of truth for platform integrations and pushes\n * them to the daemon that owns the integration's agent (`integration/upsert`, and\n * the reconcile snapshot `RegisterOk.integrations[]`). The daemon opens the Socket\n * Mode connection from the delivered config (see slack/connection.ts).\n *\n * SECURITY: `integration/upsert` and `RegisterOk.integrations[]` carry PLAINTEXT\n * platform tokens (botToken/appToken). These payloads MUST NEVER be logged — no\n * body dump on decode error, no register/ok snapshot debug dump. The daemon\n * persists them into the owning agent's local `agent.json` (same trust boundary\n * as hand-authored agents, which already keep tokens there) so integrations\n * survive a restart with the CP down.\n *\n * `signingSecret` is intentionally absent: Socket Mode authenticates with the\n * app-level token, so the daemon never needs a signing secret.\n */\n/** Trigger match — mirrors the daemon BindRuleConfig.match (agents/agent-schema.ts). */\nexport const BindMatch = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('mention') }),\n z.object({ kind: z.literal('dm') }),\n z.object({ kind: z.literal('keyword'), value: z.string() }),\n z.object({ kind: z.literal('auto') })\n]);\n/** One channel/thread trigger binding — mirrors the daemon BindRuleConfig. */\nexport const IntegrationBindRule = z.object({\n channel: z.string().optional(), // absent = any channel\n thread: z.string().optional(),\n match: BindMatch\n});\n/** The Slack config the daemon needs to open + route a socket (no signingSecret). */\nexport const IntegrationSlackConfig = z.object({\n botToken: z.string(), // xoxb-… (plaintext — never log)\n appToken: z.string(), // xapp-… (plaintext — never log)\n allowedUserIds: z.array(z.string()).default([]),\n bindRules: z.array(IntegrationBindRule).default([])\n});\n/**\n * One platform integration, owned by exactly one agent. Also the element type of\n * `RegisterOk.integrations[]` (the per-daemon reconcile set).\n */\nexport const IntegrationSpec = z.object({\n integrationId: z.string().uuid(),\n agentId: z.string().uuid(),\n platform: z.literal('slack'),\n slack: IntegrationSlackConfig\n});\n/** C→D EVT — install/update an integration on the owning agent's daemon. */\nexport const IntegrationUpsert = IntegrationSpec;\n/** C→D EVT — remove an integration from the daemon. */\nexport const IntegrationRemove = z.object({\n integrationId: z.string().uuid()\n});\n/** One channel the bot is currently a member of (metadata only — no messages). */\nexport const IntegrationChannel = z.object({\n id: z.string(), // platform channel id (Slack \"C…\")\n name: z.string().optional(), // \"#deploys\" without the hash; absent if lookup failed\n isPrivate: z.boolean().optional()\n});\n/**\n * D→C EVT — the FULL set of channels the integration's bot is a member of\n * (fire-and-forget, latest-wins). Emitted on socket start and whenever the bot\n * is invited to / removed from a channel, so the console can offer per-channel\n * trigger config. Channel names are control metadata, never message content.\n */\nexport const IntegrationChannels = z.object({\n integrationId: z.string().uuid(),\n channels: z.array(IntegrationChannel)\n});\n//# sourceMappingURL=integration.js.map","import { z } from 'zod';\nimport { Platform, RouteAssign } from './route.js';\nimport { CronUpsert } from './cron.js';\nimport { SecretsGrant } from './secrets.js';\nimport { AgentSpec } from './agent.js';\nimport { IntegrationSpec } from './integration.js';\n/**\n * Capability upload + the reconcile snapshot — protocol §3.3.\n *\n * `register/ok` is the authoritative source of truth: the daemon converges its\n * local cache to it. CP wins all conflicts, so re-issuing the same snapshot is\n * idempotent.\n */\nexport const RegisterReq = z.object({\n host: z.string(), // hostname (display only)\n capabilities: z.object({\n platforms: z.array(Platform), // D3 adapters present\n runtimes: z.array(z.string()), // e.g. [\"claude\",\"codex\"]\n acp: z.boolean(), // can this daemon host ACP sessions (D6)?\n features: z.array(z.string()).default([]) // e.g. [\"cli-wrapper-fallback\",\"worktree-iso\"]\n }),\n maxAgents: z.number().int(), // concurrency ceiling for placement (C3)\n localState: z.object({\n // what the daemon currently believes it owns (for reconcile)\n assignments: z.array(z.string()), // sessionKeys it is actively serving\n crons: z.array(z.string()), // cronIds it has scheduled\n leases: z.array(z.string()) // leaseIds it holds\n })\n});\nexport const RegisterOk = z.object({\n routingEpoch: z.number().int(), // version of the routing table this snapshot reflects\n // Authoritative reconcile snapshot — daemon converges its local cache to this:\n assignments: z.array(RouteAssign), // the route/assign set the daemon SHOULD own\n agents: z.array(AgentSpec.extend({ agentId: z.string().uuid() })).default([]), // spec set CP wants present; daemon converges\n crons: z.array(CronUpsert), // the cron set it SHOULD run\n // Platform integrations this daemon SHOULD hold — FILTERED to this daemon (never\n // org-wide), since each element carries plaintext tokens. Never log this array.\n integrations: z.array(IntegrationSpec).default([]),\n leases: z.array(SecretsGrant), // secret leases it SHOULD hold\n drop: z.object({\n // things in localState the CP says to release\n assignments: z.array(z.string()),\n crons: z.array(z.string())\n })\n});\n//# sourceMappingURL=register.js.map","import { z } from 'zod';\n/**\n * Git credentials (github-app workspaces) — daemon-pulled, CP-minted.\n *\n * The CP holds the GitHub App private key and mints short-lived (1h,\n * non-renewable) installation access tokens scoped to a single repository;\n * the daemon pulls one on demand right before a remote git operation and\n * holds it in memory only. Unlike `secrets/*` (lease + reference semantics,\n * still unwired), the grant here carries the TOKEN MATERIAL itself — same\n * plaintext-over-TLS-WS posture as `integration/upsert`, and the same\n * discipline: **never log the payload**.\n *\n * The daemon may only name an agentId — the CP resolves agent → workspace →\n * repo → installation itself, so a daemon can never pick a repo it wasn't\n * assigned. Failures come back as correlated `error` REPs: `SCOPE_DENIED`\n * (not a github-app workspace, or agent not placed on this daemon — stop\n * asking), `LEASE_DENIED` (installation uninstalled/suspended or the repo\n * left its grant set — recoverable only by an operator), `RATE_LIMITED`,\n * `INTERNAL`.\n */\nexport const GitCredRequest = z.object({\n // D→C, REQ\n agentId: z.string().uuid(),\n reason: z.enum(['clone', 'fetch', 'pull', 'push', 'helper']).optional() // observability only\n});\nexport const GitCredGrant = z.object({\n // C→D, REP (plaintext token — never log)\n username: z.literal('x-access-token'), // fixed HTTPS basic-auth username for installation tokens\n token: z.string(), // ghs_… — new stateless format runs ~520 chars; never assume a length\n ttlSec: z.number().int(), // CP-computed remaining life, 60s clock-skew allowance already shaved.\n // Daemons MUST track expiry as monotonic receivedAt+ttlSec (a skewed local\n // clock must never resurrect a dead token); `expiresAt` is observability only.\n expiresAt: z.string().datetime(),\n repoFullName: z.string(), // owner/repo — helper path-match + diagnostics\n access: z.enum(['read', 'write'])\n});\n//# sourceMappingURL=gitcred.js.map","import { z } from 'zod';\nimport { SessionKey } from './route.js';\n/**\n * Session read-back (C→D REQ → REP) — the console's on-demand pulls.\n *\n * Session bodies are daemon-local (body-locality, §1/§12). The CP may persist a\n * metadata-only session-list snapshot from daemon `event/session` events, while\n * transcript/tool bodies are pulled live from the owning daemon and proxied to\n * the console only for display.\n *\n * - `session/list`: the daemon's local metadata projection, used for snapshots\n * and direct read-back/debugging.\n * - `session/history`: one cursor-paginated page of a session's transcript.\n */\n/**\n * Per-session token accounting, metered by the daemon from the agent's ACP usage\n * stream. Token counts are CUMULATIVE across the session's turns (summed from each\n * turn's `PromptResponse.usage`); context/cost are the LATEST snapshot from the\n * agent's `usage_update` stream. Every field is optional — a runtime that reports\n * no usage yields an absent field, not a zero.\n */\nexport const SessionUsage = z.object({\n totalTokens: z.number().int().optional(),\n inputTokens: z.number().int().optional(),\n outputTokens: z.number().int().optional(),\n thoughtTokens: z.number().int().optional(),\n cachedReadTokens: z.number().int().optional(),\n cachedWriteTokens: z.number().int().optional(),\n contextUsed: z.number().int().optional(), // current context-window occupancy\n contextSize: z.number().int().optional(), // context-window size\n costAmount: z.number().optional(), // running session cost\n costCurrency: z.string().optional()\n});\n/** One row in the session list (metadata + console metrics; NOT the transcript). */\nexport const SessionListItem = z.object({\n sessionId: z.string(), // opaque ACP session id (agent-assigned; NOT a wire UUID)\n sessionKey: SessionKey, // platform/channel/thread — drives the \"integration · channel\" column\n agentId: z.string().uuid(),\n title: z.string().optional(), // human-facing session title (daemon-derived)\n status: z.string().optional(), // e.g. \"plan\" / \"completed\" / \"awaiting approval\"\n lastActivityAt: z.string().optional(), // ISO/string ts of the last activity\n usage: SessionUsage.optional(), // per-session token/cost accounting (daemon-metered)\n triggeredBy: z.string().optional(), // sender handle/id that triggered/drove the run\n // Human-readable display names, resolved + cached by the daemon (the only side\n // holding platform credentials). Always optional — the raw ids above stay the\n // canonical identity; absent when the daemon hasn't resolved them (yet).\n channelName: z.string().optional(), // \"general\" for a Slack \"C…\" channel; \"@Dana Reyes\" for a \"D…\" DM\n triggeredByName: z.string().optional(), // display name for `triggeredBy`\n // Platform-native deep link back to the source thread (e.g. a Slack\n // `…/archives/<C…>/p<ts>` permalink), built by the daemon from the platform\n // credentials it holds. Optional — absent when the daemon can't resolve the\n // workspace URL (yet) or the platform has no addressable thread link.\n threadUrl: z.string().optional()\n});\n/** C→D REQ: list the daemon's sessions (optionally just one agent's). */\nexport const SessionListReq = z.object({\n agentId: z.string().uuid().optional() // omit ⇒ all this daemon's sessions\n});\n/** D→C REP (corr = req id): the daemon's current sessions. */\nexport const SessionListPage = z.object({\n sessions: z.array(SessionListItem)\n});\n/**\n * The full ACP tool body, transported as a JSON STRING in `SessionMessage.body`.\n * Kept structurally faithful to the ACP `ToolCall`; free-form fields stay opaque\n * (`z.unknown()`) so no daemon-side redaction/reshaping is implied.\n */\nexport const ToolBody = z.object({\n toolCallId: z.string(),\n kind: z.string().optional(), // ACP ToolKind: read|edit|delete|move|search|execute|think|fetch|switch_mode|other\n status: z.string().optional(), // ACP ToolCallStatus: pending|in_progress|completed|failed\n rawInput: z.unknown().optional(),\n rawOutput: z.unknown().optional(),\n content: z.array(z.unknown()).optional(), // ACP ToolCallContent[] kept opaque (content|diff|terminal blocks)\n locations: z.array(z.object({ path: z.string(), line: z.number().int().optional() })).optional(),\n truncated: z.boolean().optional() // set when the daemon capped the stored body at write time\n});\n/** One message in a session transcript page (a body — returned only for display). */\nexport const SessionMessage = z.object({\n seq: z.number().int(), // daemon-local insertion order within the session\n sender: z.string(), // platform handle/id of the author\n senderName: z.string().optional(), // display name (daemon-resolved; absent if unknown)\n ts: z.string(), // platform timestamp (daemon-local string form)\n kind: z.string(), // \"text\" / tool / … (daemon transcript kind)\n text: z.string(),\n // ── tool-body enrichment (optional ⇒ text/reasoning rows and old daemons omit these) ──\n toolCallId: z.string().optional(), // parsed from the ToolBody (tool rows only)\n toolStatus: z.string().optional(), // ACP ToolCallStatus, surfaced for the console badge\n toolKind: z.string().optional(), // ACP ToolKind, surfaced for the console icon\n body: z.string().optional(), // JSON.stringify(ToolBody); may be a truncated-but-VALID-JSON preview\n bodyTruncated: z.boolean().optional(), // preview was shrunk for the frame; full body via session/tool-body\n bodyBytes: z.number().int().optional() // full (untruncated) body byte length\n});\n/** C→D REQ: fetch one page of a session's history from the owning daemon. */\nexport const SessionHistoryReq = z.object({\n sessionId: z.string(), // opaque ACP session id (agent-assigned; NOT a wire UUID)\n cursor: z.string().optional(), // opaque; omit ⇒ newest page\n limit: z.number().int().positive().max(200).default(50)\n});\n/** D→C REP (corr = the req id): a page of messages + the cursor for the next page. */\nexport const SessionHistoryPage = z.object({\n sessionId: z.string(), // opaque ACP session id (agent-assigned; NOT a wire UUID)\n messages: z.array(SessionMessage), // ordered oldest→newest within the page\n nextCursor: z.string().optional() // absent ⇒ no older messages\n});\n/**\n * C→D REQ: fetch the FULL (untruncated) ToolBody JSON for one tool call, chunked.\n * The inline `SessionMessage.body` preview is capped at 32 KiB; when a body is\n * bigger the console pages the whole thing back through this frame by offset.\n */\nexport const SessionToolBodyReq = z.object({\n sessionId: z.string(),\n toolCallId: z.string(),\n offset: z.number().int().nonnegative().default(0)\n});\n/** D→C REP (corr = the req id): one frame-budgeted byte slice of the full ToolBody JSON. */\nexport const SessionToolBodyChunk = z.object({\n sessionId: z.string(),\n toolCallId: z.string(),\n data: z.string(), // UTF-8-boundary-safe byte slice of the FULL ToolBody JSON\n totalBytes: z.number().int(),\n nextOffset: z.number().int().optional() // absent ⇒ this is the last chunk\n});\n//# sourceMappingURL=session.js.map","import { z } from 'zod';\nimport { Platform } from './route.js';\n/**\n * Channel agent directory (D→C REQ → REP) — agent collaboration lookup.\n *\n * An agent asks (via a daemon-side tool) \"who else is in this channel?\". The\n * daemon forwards it to the CP — the ONLY authority for the FULL channel roster,\n * because agents in one channel may run on different daemons (each daemon knows\n * only its own agents). The CP joins the channel's integrations to their agents\n * and returns their public metadata (name / displayName / description / status).\n * Metadata only — never message content (§1/§12).\n *\n * Direction is daemon→CP (like `auth` / `register`): the daemon sends the REQ and\n * the CP replies with `channel/agents/ok` (corr = the req id).\n */\n/** One agent visible in a channel — the collaboration directory entry. */\nexport const ChannelAgent = z.object({\n agentId: z.string().uuid(),\n name: z.string(), // slug\n displayName: z.string().optional(), // human-readable name, if set\n description: z.string().optional(), // what the agent does (its system-prompt seed)\n status: z.enum(['active', 'inactive', 'paused'])\n});\n/** D→C REQ: list the agents in a channel (for the asking agent's collaboration tool). */\nexport const ChannelAgentsReq = z.object({\n platform: Platform,\n channel: z.string() // platform channel id\n});\n/** C→D REP (corr = req id): every agent in the channel across all daemons. */\nexport const ChannelAgentsOk = z.object({\n platform: Platform,\n channel: z.string(),\n agents: z.array(ChannelAgent)\n});\n//# sourceMappingURL=channel.js.map","import { z } from 'zod';\n/**\n * Agent workspace file browsing (C→D REQ → REP) — the console's on-demand pulls.\n *\n * The CP stores NO workspace data — directory listings and file bytes are pulled\n * live from the owning daemon and proxied to the console, never persisted\n * (body-locality). Missing paths are DATA (`exists:false`), not errors; only\n * path-containment violations (`BAD_PAYLOAD`) and unexpected fs failures\n * (`INTERNAL`) come back as `error` frames.\n *\n * - `workspace/list`: one cursor-paginated page of a directory's entries.\n * - `workspace/read`: one byte slice of a file. `limit` is only a ceiling — the\n * daemon returns FEWER bytes when needed to keep the JSON-escaped REP under the\n * 256 KiB frame cap (control bytes escape to `\\uXXXX`, a 6× blowup), and always\n * ends the slice on a UTF-8 character boundary. `nextOffset` is the authoritative\n * byte offset to request next — callers must NOT recompute it from the decoded\n * `content` (a split multi-byte char would make the byte count drift).\n */\n/** One directory entry in a workspace listing (name-only; not a full path). */\nexport const WorkspaceEntry = z.object({\n name: z.string(),\n type: z.enum(['dir', 'file', 'symlink', 'other']),\n size: z.number().int().nonnegative().optional(), // regular files only\n mtime: z.string().optional() // RFC3339\n});\n/** C→D REQ: list one page of a directory in the agent's workspace. */\nexport const WorkspaceListReq = z.object({\n agentId: z.string().min(1), // local agent id (NOT a wire UUID)\n path: z.string().default(''), // workspace-relative POSIX path; '' ⇒ workspace root\n cursor: z.string().optional(), // opaque; omit ⇒ first page\n limit: z.number().int().positive().max(500).default(200)\n});\n/** D→C REP (corr = the req id): a page of entries + the cursor for the next page. */\nexport const WorkspaceListPage = z.object({\n agentId: z.string(),\n path: z.string(),\n exists: z.boolean(), // false ⇒ workspace root or the dir does not exist (NOT an error)\n entries: z.array(WorkspaceEntry),\n nextCursor: z.string().optional() // absent ⇒ no more entries\n});\n/** C→D REQ: read one byte slice of a file in the agent's workspace. */\nexport const WorkspaceReadReq = z.object({\n agentId: z.string().min(1), // local agent id (NOT a wire UUID)\n path: z.string().min(1), // workspace-relative POSIX path to a file\n offset: z.number().int().nonnegative().default(0), // byte offset\n limit: z.number().int().positive().max(65536).default(65536) // byte count per slice (64 KiB, see docblock)\n});\n/** D→C REP (corr = the req id): the file slice (or `exists:false` / binary-detected). */\nexport const WorkspaceReadContent = z.object({\n agentId: z.string(),\n path: z.string(),\n exists: z.boolean(), // false ⇒ the file does not exist (NOT an error)\n size: z.number().int().nonnegative().optional(),\n mtime: z.string().optional(), // RFC3339\n encoding: z.enum(['utf8', 'none']).optional(), // 'none' ⇒ binary detected, content omitted\n content: z.string().optional(), // utf8 text slice\n offset: z.number().int().nonnegative().optional(), // byte offset this slice starts at\n nextOffset: z.number().int().nonnegative().optional(), // byte offset to request next (offset + bytes in this slice)\n truncated: z.boolean().optional() // true ⇒ nextOffset < size (more bytes remain)\n});\n/**\n * Agent workspace git ops (C→D REQ → REP) — the console's on-demand controls for\n * a git-repo workspace. Like list/read these run daemon-local; the CP proxies the\n * outcome and stores nothing.\n *\n * These are DATA-oriented: a non-repo workspace (`isRepo:false`), a dirty tree,\n * or a pull that can't fast-forward (offline, diverged, local edits) all come\n * back as a normal REP — NOT an `error` frame. Only an unknown agent\n * (`BAD_PAYLOAD`) or an unexpected git/fs failure (`INTERNAL`) is an error.\n */\n/** C→D REQ: report `git status` of the agent's workspace (is it clean?). */\nexport const WorkspaceGitStatusReq = z.object({\n agentId: z.string().min(1) // local agent id (NOT a wire UUID)\n});\n/** One changed path in a `git status`. `index`/`workingDir` are git's per-file XY\n * status chars (' ', 'M', 'A', 'D', 'R', 'C', 'U', '?', …). */\nexport const WorkspaceGitFile = z.object({\n path: z.string(),\n index: z.string(), // staged (X) status char\n workingDir: z.string() // unstaged (Y) status char\n});\n/** The HEAD commit of the checkout. */\nexport const WorkspaceGitCommit = z.object({\n sha: z.string(), // full 40-hex commit hash\n shortSha: z.string(), // abbreviated hash (7 hex) for display\n subject: z.string(), // first line of the commit message\n committedAt: z.string() // RFC3339 committer date\n});\n/** D→C REP (corr = the req id): the working-tree status. */\nexport const WorkspaceGitStatus = z.object({\n agentId: z.string(),\n isRepo: z.boolean(), // false ⇒ from-scratch workspace (no .git) — git ops are N/A\n clean: z.boolean(), // true ⇒ no staged / unstaged / untracked changes\n branch: z.string().optional(), // current branch (absent ⇒ detached / unknown)\n tracking: z.string().optional(), // upstream ref, if the branch tracks one\n ahead: z.number().int().nonnegative().optional(), // commits ahead of upstream\n behind: z.number().int().nonnegative().optional(), // commits behind upstream\n files: z.array(WorkspaceGitFile).optional(), // changed paths (bounded; see `truncated`)\n truncated: z.boolean().optional(), // true ⇒ the `files` list was capped\n lastCommit: WorkspaceGitCommit.optional(), // HEAD commit (absent ⇒ empty repo / no commits yet)\n lastFetchAt: z.string().optional() // RFC3339 mtime of .git/FETCH_HEAD — when the repo last fetched/pulled\n});\n/** C→D REQ: force a fast-forward-only `git pull` in the agent's workspace now. */\nexport const WorkspaceGitPullReq = z.object({\n agentId: z.string().min(1) // local agent id (NOT a wire UUID)\n});\n/** D→C REP (corr = the req id): the pull outcome. A failed pull is DATA\n * (`ok:false` + `detail`), not an error frame (see the section docblock). */\nexport const WorkspaceGitPullResult = z.object({\n agentId: z.string(),\n isRepo: z.boolean(), // false ⇒ from-scratch workspace (no .git) — nothing to pull\n ok: z.boolean(), // true ⇒ pull succeeded (fast-forwarded or already up to date)\n detail: z.string().optional(), // human summary or failure reason (host paths stripped)\n changed: z.number().int().nonnegative().optional(), // files changed by the pull\n insertions: z.number().int().nonnegative().optional(),\n deletions: z.number().int().nonnegative().optional()\n});\n//# sourceMappingURL=workspace.js.map","import { z } from 'zod';\n/**\n * Agent memory directory (C→D REQ → REP) — the console's read/write of an agent's\n * long-term memory, and the surface the daemon serves it from.\n *\n * Memory is a DIRECTORY at the agent's ROOT (`<agent-root>/memory/`), OUTSIDE the\n * workspace — so it survives a workspace reset / re-clone and is never committed\n * into a github-workspace repo. It follows the index-plus-topics shape: a lean\n * `MEMORY.md` index (injected into the prompt every session, bounded) plus any\n * number of `<topic>.md` files the agent reads on demand. The agent maintains it\n * via MCP tools; these frames are the third channel — the CP reading/writing it\n * for the console — all pointing at the same directory.\n *\n * The CP stores NO memory content — bytes are pulled live from the owning daemon\n * and proxied to the console, never persisted (body-locality). A not-yet-created\n * file/dir is DATA (`exists:false`), not an error; only an unknown agent or a\n * path-containment violation (`BAD_PAYLOAD`) or an unexpected fs failure\n * (`INTERNAL`) comes back as an `error` frame.\n *\n * - `memory/list`: the topic files in the memory dir (flat; the index + topics).\n * - `memory/read`: one byte slice of a memory file (`path` relative to the memory\n * dir; default `MEMORY.md`). `limit` is a ceiling — the daemon returns fewer\n * bytes to keep the JSON-escaped REP under the 256 KiB frame cap and always ends\n * on a UTF-8 boundary. `nextOffset` is authoritative — do NOT recompute it.\n * - `memory/write`: replace the whole named memory file with `content`.\n */\n/** The default file name of the memory index (loaded into the prompt each session). */\nexport const MEMORY_INDEX = 'MEMORY.md';\n/** One entry in a memory-dir listing (name-only; not a path). */\nexport const MemoryEntry = z.object({\n name: z.string(), // file name relative to the memory dir\n size: z.number().int().nonnegative(),\n mtime: z.string() // RFC3339\n});\n/** C→D REQ: list the files in the agent's memory dir. */\nexport const MemoryListReq = z.object({\n agentId: z.string().min(1) // local agent id (NOT a wire UUID)\n});\n/** D→C REP (corr = the req id): the memory dir's files (or `exists:false`). */\nexport const MemoryListPage = z.object({\n agentId: z.string(),\n exists: z.boolean(), // false ⇒ the memory dir does not exist yet (NOT an error)\n entries: z.array(MemoryEntry)\n});\n/** C→D REQ: read one byte slice of a memory file (path relative to the memory dir). */\nexport const MemoryReadReq = z.object({\n agentId: z.string().min(1), // local agent id (NOT a wire UUID)\n path: z.string().default(MEMORY_INDEX), // memory-dir-relative POSIX path; default the index\n offset: z.number().int().nonnegative().default(0), // byte offset\n limit: z.number().int().positive().max(65536).default(65536) // byte count per slice (64 KiB, see docblock)\n});\n/** D→C REP (corr = the req id): the memory file slice (or `exists:false`). Always utf8 text. */\nexport const MemoryReadContent = z.object({\n agentId: z.string(),\n path: z.string(),\n exists: z.boolean(), // false ⇒ the file does not exist yet (NOT an error)\n size: z.number().int().nonnegative().optional(), // total file size in bytes\n mtime: z.string().optional(), // RFC3339\n content: z.string().optional(), // utf8 text slice\n offset: z.number().int().nonnegative().optional(), // byte offset this slice starts at\n nextOffset: z.number().int().nonnegative().optional(), // byte offset to request next (offset + bytes in this slice)\n truncated: z.boolean().optional() // true ⇒ nextOffset < size (more bytes remain)\n});\n/** C→D REQ: replace the whole named memory file with `content` (console edit). */\nexport const MemoryWriteReq = z.object({\n agentId: z.string().min(1), // local agent id (NOT a wire UUID)\n path: z.string().default(MEMORY_INDEX), // memory-dir-relative POSIX path; default the index\n content: z.string(), // full new file content (utf8); '' clears the file\n // Optimistic concurrency: the mtime the writer last read. When present the write\n // fails (CONFLICT) unless the file still has this mtime — so a console edit can't\n // clobber a newer agent write. Omit to force (last-write-wins).\n ifMatchMtime: z.string().optional()\n});\n/** D→C REP (corr = the req id): the written state, so the console can refresh. */\nexport const MemoryWriteOk = z.object({\n agentId: z.string(),\n path: z.string(),\n size: z.number().int().nonnegative(), // bytes written\n mtime: z.string() // RFC3339 of the write\n});\n//# sourceMappingURL=memory.js.map","import { z } from 'zod';\nimport { SessionUsage } from './session.js';\nimport { Platform } from './route.js';\n/**\n * Telemetry & facts (D→C) — protocol §7.\n *\n * The dashboard's real-time source. `event/session` is the converged milestone\n * feed (NOT the message stream); `facts/daemon-runtimes` is the observed runtime\n * capability feed; `heartbeat` drives the watchdog.\n */\nexport const Heartbeat = z.object({\n load: z.object({\n cpu: z.number(), // 0..1 CPU utilization fraction (busy-time across cores) — NOT a raw load average\n mem: z.number(), // 0..1 utilization fraction\n agents: z.number().int()\n }),\n health: z.enum(['ok', 'degraded']),\n activeSessions: z.number().int(),\n degradedScopes: z.array(z.string()).default([]) // e.g. expired-lease bindings (§6)\n});\n/** Converged session lifecycle milestone — protocol §7.2. NOT the message stream. */\nexport const EventSession = z.object({\n sessionId: z.string(), // ACP session id (agent-assigned; a free string, NOT a wire UUID — matches usage/report)\n agentId: z.string().uuid(),\n launchId: z.string().uuid().optional(), // 🅰️ CP launch fence — absent for sessions created on the Slack/Discord→daemon path (no CP-initiated launch)\n phase: z.enum(['start', 'plan', 'problem', 'end']),\n // sessionKey echo — where the session lives; the CP stores it so a deep-link\n // detail page (…/sessions/:id) can show the channel without the daemon online.\n platform: Platform.optional(),\n channel: z.string().optional(),\n thread: z.string().optional(),\n link: z.string().optional(), // deep-link to detail view\n summary: z.string().optional(), // short, human-facing milestone text\n // Dashboard-list metadata snapshot. Still metadata-only: no message bodies,\n // transcript stream, attachment bytes, or tool payloads cross into the CP store.\n title: z.string().optional(),\n status: z.string().optional(),\n lastActivityAt: z.string().datetime().optional(),\n triggeredBy: z.string().optional(),\n channelName: z.string().optional(),\n triggeredByName: z.string().optional(),\n threadUrl: z.string().optional(),\n ts: z.string().datetime()\n});\n/**\n * Per-session token-usage report — D→C EVT. The daemon meters usage from the\n * agent's ACP stream and reports the session's CUMULATIVE snapshot (latest-wins)\n * so the CP can persist it for the console's historical usage aggregates. This is\n * dashboard metadata (token counts + cost), never the message stream. Idempotent\n * by `sessionId`: re-sending the same snapshot is a no-op upsert on the CP.\n */\nexport const UsageReport = z.object({\n sessionId: z.string(), // ACP session id (agent-assigned; NOT a wire UUID)\n agentId: z.string().uuid(),\n platform: z.string().optional(), // denormalized sessionKey echo for dashboard filters\n channel: z.string().optional(),\n lastActivityAt: z.string(), // ISO ts of the session's last activity\n usage: SessionUsage\n});\n/**\n * Observed capabilities of an installed runtime — protocol §7.3. The element\n * type of the `facts/daemon-runtimes` snapshot. As a standalone per-runtime\n * frame (`facts/runtime-profile`, upsert-only) it is DEPRECATED: current\n * daemons report the full snapshot instead; the CP keeps accepting the old\n * frame from older daemons.\n */\nexport const FactsRuntimeProfile = z.object({\n runtime: z.string(), // \"claude\" / \"codex\" / ...\n version: z.string(),\n models: z.array(z.string()),\n contextWindow: z.number().int().optional(),\n acpSupport: z.enum(['full', 'partial', 'none']), // gates the dual-mode decision (#1)\n // ACP protocol version the runtime negotiated at `initialize` (the number the\n // agent echoed/downgraded to). Absent for older daemons / runtimes not probed yet.\n acpProtocolVersion: z.number().int().optional(),\n toolCalling: z.boolean()\n});\n/**\n * Full snapshot of the daemon's installed runtimes — D→C EVT (protocol §7.3a),\n * emitted on each register and again once the background probe sweep completes\n * (with the learned `models[]`). REPLACE semantics: the CP reconciles its\n * stored runtime list for the daemon to exactly `runtimes[]`, pruning runtimes\n * that are no longer installed. Idempotent (latest-wins). Supersedes the\n * per-runtime `facts/runtime-profile` upsert.\n */\nexport const DaemonRuntimes = z.object({\n runtimes: z.array(FactsRuntimeProfile)\n});\n/** Non-secret config update — C→D EVT, protocol §8.3 / frame #26. */\nexport const ConfigPush = z.object({\n keys: z.record(z.string(), z.unknown())\n});\n/** Fleet: drain+exit, supervisor restarts — C→D REQ, protocol §8.3 / frame #27. */\nexport const DaemonRestart = z.object({\n reason: z.string(),\n drainFirst: z.boolean().default(true)\n});\n/** Fleet: drain+exit for version bump — C→D REQ, protocol §8.3 / frame #28. */\nexport const DaemonUpgrade = z.object({\n targetVersion: z.string(),\n drainFirst: z.boolean().default(true)\n});\n/** Reply to a fleet restart/upgrade REQ (protocol §8.3). */\nexport const DaemonControlAck = z.object({\n accepted: z.boolean(),\n willDrainUntil: z.string().datetime().optional()\n});\n/**\n * Generic acknowledgement for REQs whose reply is just `ack` in the frame index\n * (cron/upsert, cron/remove, agent/stop). Kept permissive but typed.\n */\nexport const Ack = z.object({\n ok: z.boolean(),\n reason: z.string().optional()\n});\n//# sourceMappingURL=telemetry.js.map","import { z } from 'zod';\n/**\n * Error model — protocol §9.\n *\n * Every REQ can be answered by an `error` REP (`corr` = request `id`). Errors\n * are typed and actionable, not free text.\n */\nexport const ErrorCode = z.enum([\n // protocol / framing\n 'UNKNOWN_FRAME',\n 'FRAME_TOO_LARGE',\n 'PROTOCOL_STATE',\n 'BAD_PAYLOAD',\n // auth / identity\n 'AUTH_FAILED',\n 'ATTESTATION_INVALID',\n // fencing / ordering\n 'STALE_EPOCH',\n 'STALE_LAUNCH',\n // delivery\n 'NO_SESSION',\n 'SCOPE_DENIED',\n // secrets\n 'LEASE_EXPIRED',\n 'LEASE_DENIED',\n // generic\n 'RATE_LIMITED',\n 'CONFLICT',\n 'INTERNAL'\n]);\nexport const ErrorFrame = z.object({\n code: ErrorCode,\n message: z.string(), // human-readable, redacted of secrets\n retryable: z.boolean(),\n details: z.record(z.string(), z.unknown()).optional()\n});\n/**\n * WebSocket close codes — protocol §9.\n *\n * `4401` requires a fresh credential before reconnecting; everything else uses\n * exponential backoff with jitter.\n */\nexport const CloseCode = {\n BAD_SUBPROTOCOL: 4400, // bad subprotocol/handshake\n AUTH_FAILED: 4401, // auth failed (don't auto-retry)\n EPOCH_CONFLICT: 4409, // epoch conflict on handshake (do full reconcile)\n UNSUPPORTED_ENCODING: 4415, // binary/unsupported encoding\n RATE_LIMITED: 4429, // rate-limited (backoff)\n SERVER_INTERNAL: 1011, // server internal\n SERVER_RESTARTING: 1012, // server restarting (reconnect with backoff)\n /** soft 256 KiB cap exceeded → ws library close (protocol §1). */\n MESSAGE_TOO_BIG: 1009\n};\n//# sourceMappingURL=error.js.map","import { z } from 'zod';\n// webchat is the one integration whose data plane is the daemon↔CP control WS\n// (its far end is the CP/browser). These frames carry content INLINE, bounded by\n// the 256 KiB frame cap — long output is split across multiple webchat/output chunks.\n// C→D REQ → webchat/ack. The integration's \"receive\": a console/API turn the CP\n// relays to the owning daemon. Body is inline (console-originated, not daemon-local).\nexport const WebchatMessage = z.object({\n conversationId: z.string().uuid(), // == SessionKey.channel for platform 'webchat'\n agentId: z.string().uuid(), // explicit target — no trigger matching\n text: z.string(),\n user: z.string().optional() // display handle for the transcript author line\n});\n// D→C REP (corr = message.id)\nexport const WebchatAck = z.object({\n accepted: z.boolean(),\n turnId: z.string().uuid(), // correlates the streamed output to this turn\n reason: z.enum(['queued', 'no_agent', 'busy']).optional()\n});\n// One structured chunk of the agent's reply stream. Ordered per-connection (TCP);\n// 'index' is a per-turn monotonic counter for client-side assembly (NOT a global fence).\nexport const WebchatEvent = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('message'), text: z.string() }), // from agent_message_chunk\n z.object({ kind: z.literal('thinking'), text: z.string() }), // from agent_thought_chunk\n z.object({ kind: z.literal('tool_call'), toolCallId: z.string(), title: z.string(), status: z.string() }),\n z.object({ kind: z.literal('tool_update'), toolCallId: z.string(), status: z.string() }),\n // The runtime's auto-generated session title (from ACP session_info_update). The\n // daemon persists it (session/list surfaces it on the persisted row); this streams\n // the same value so the LIVE playground session renames itself in place, matching\n // what a Slack session shows once its title lands.\n z.object({ kind: z.literal('session_info'), title: z.string() })\n]);\n// The session status-bar snapshot (model / context / tokens / cost), rebuilt from\n// the daemon's model selector + folded ACP usage. All fields optional so a partial\n// snapshot is valid: context/cost stream live via ACP `usage_update`, while token\n// totals only refresh at each turn's end. Carried as an extra field on the output\n// frame (see below) rather than a reply-stream event — a status update is not part\n// of the transcript and can arrive with no text chunk of its own.\nexport const WebchatStatus = z.object({\n model: z.string().optional(),\n effort: z.string().optional(),\n permissionMode: z.string().optional(),\n fastMode: z.boolean().optional(),\n contextUsed: z.number().int().optional(),\n contextSize: z.number().int().optional(),\n totalTokens: z.number().int().optional(),\n costAmount: z.number().optional(),\n costCurrency: z.string().optional(),\n // The models this session's runtime advertises as selectable (from the ACP model\n // config option) — populates the console's model dropdown. Absent ⇒ no selector.\n models: z.array(z.string()).optional(),\n // The reasoning-effort levels this session's runtime offers (from the ACP\n // `thought_level` config option, plus the synthetic `ultracode`/`max` entries on\n // Claude runtimes) — populates the console's effort dropdown. Absent ⇒ no selector.\n efforts: z.array(z.string()).optional(),\n // The runtime's selectable permission/approval modes (ACP `mode` config option).\n // Values are runtime-owned; absent ⇒ no selector.\n permissionModes: z.array(z.string()).optional(),\n // Whether the selected model advertises a fast-mode toggle (the ACP `model_config`\n // config option only appears once a fast-capable model is selected). Absent/false ⇒\n // no fast toggle shown.\n fastModeAvailable: z.boolean().optional(),\n // The daemon's session id (== acpSessionId) for this conversation, so the console can\n // deep-link to the session detail page. Absent until the session is created.\n sessionId: z.string().optional()\n});\n// D→C EVT — the integration's \"send\": one chunk of a turn's reply and/or a status\n// snapshot. `event` is optional so a status-only frame (no reply chunk) is valid;\n// every frame still carries a monotonic `index` for client-side ordering.\nexport const WebchatOutput = z\n .object({\n conversationId: z.string().uuid(),\n turnId: z.string().uuid(),\n index: z.number().int(),\n event: WebchatEvent.optional(),\n status: WebchatStatus.optional()\n})\n // A frame must carry at least one of event/status — an empty frame is meaningless.\n .refine((o) => o.event !== undefined || o.status !== undefined, {\n message: 'WebchatOutput must carry event and/or status'\n});\n// D→C EVT — the turn finished. `error` is set when the turn ended in FAILURE\n// (agent failed to start, ACP handshake/prompt rejected) rather than completing —\n// a human-readable reason the client renders instead of a normal reply. When\n// present, `stopReason`/`usage` are absent (the turn produced no clean result).\nexport const WebchatDone = z.object({\n conversationId: z.string().uuid(),\n turnId: z.string().uuid(),\n stopReason: z.string().optional(),\n usage: z.object({ used: z.number().int().optional(), cost: z.number().optional() }).optional(),\n error: z.string().optional()\n});\n// C→D EVT — the client closed the conversation (tab closed / explicit close).\nexport const WebchatClose = z.object({ conversationId: z.string().uuid() });\n// C→D EVT — switch the model for this conversation's session. Session-scoped and\n// sticky (applied to the live ACP session if warm, and remembered for later turns);\n// does NOT change the agent's stored default. `agentId` names the target (the gateway\n// knows it) so the daemon can resolve the session key without a live session yet.\nexport const WebchatSetModel = z.object({\n conversationId: z.string().uuid(),\n agentId: z.string().uuid(),\n model: z.string()\n});\n// C→D EVT — set the reasoning-effort level for this conversation's session.\n// Session-scoped and sticky like WebchatSetModel (applied live to a warm session\n// via ACP `session/set_config_option` on `thought_level`, and remembered for later\n// turns); does NOT change the agent's stored default. The `ultracode` sentinel can't\n// ride the select — it takes effect on the next session/new|load via session `_meta`.\nexport const WebchatSetEffort = z.object({\n conversationId: z.string().uuid(),\n agentId: z.string().uuid(),\n effort: z.string()\n});\n// C→D EVT — set the permission/approval mode for this conversation's session.\n// Session-scoped and sticky like WebchatSetModel (applied live via ACP\n// `session/set_config_option` on `mode`, and remembered for later turns); does NOT\n// change the agent's stored default.\nexport const WebchatSetPermissionMode = z.object({\n conversationId: z.string().uuid(),\n agentId: z.string().uuid(),\n permissionMode: z.string()\n});\n// C→D EVT — toggle fast mode for this conversation's session. Session-scoped and\n// sticky like WebchatSetModel (applied live via ACP `session/set_config_option` on\n// `model_config` when the selected model offers it, else remembered for later turns);\n// does NOT change the agent's stored default.\nexport const WebchatSetFast = z.object({\n conversationId: z.string().uuid(),\n agentId: z.string().uuid(),\n fastMode: z.boolean()\n});\n// C→D EVT — interrupt the conversation's in-flight turn (the status-bar \"Cancel\").\n// Unlike `!stop`, the session is NOT muted: follow-up turns still dispatch.\nexport const WebchatCancel = z.object({ conversationId: z.string().uuid() });\n//# sourceMappingURL=webchat.js.map","import { z } from 'zod';\nimport { AuthReq, AuthOk } from './frames/auth.js';\nimport { RegisterReq, RegisterOk } from './frames/register.js';\nimport { RouteAssign, RouteAssignAck, RouteUpdate, Drain, DrainProgress, DrainDone } from './frames/route.js';\nimport { AgentLaunch, AgentLaunched, AgentStop, AgentUpsert, AgentRemove, AgentActivity, AgentScopeDenied } from './frames/agent.js';\nimport { CronUpsert, CronRemove, CronReport, CronRunNow } from './frames/cron.js';\nimport { IntegrationUpsert, IntegrationRemove, IntegrationChannels } from './frames/integration.js';\nimport { GitCredRequest, GitCredGrant } from './frames/gitcred.js';\nimport { SecretsRequest, SecretsGrant, SecretsRenew, SecretsRevoke, ScopeAttestation } from './frames/secrets.js';\nimport { SessionHistoryReq, SessionHistoryPage, SessionListReq, SessionListPage, SessionToolBodyReq, SessionToolBodyChunk } from './frames/session.js';\nimport { ChannelAgentsReq, ChannelAgentsOk } from './frames/channel.js';\nimport { WorkspaceListReq, WorkspaceListPage, WorkspaceReadReq, WorkspaceReadContent, WorkspaceGitStatusReq, WorkspaceGitStatus, WorkspaceGitPullReq, WorkspaceGitPullResult } from './frames/workspace.js';\nimport { MemoryListReq, MemoryListPage, MemoryReadReq, MemoryReadContent, MemoryWriteReq, MemoryWriteOk } from './frames/memory.js';\nimport { Heartbeat, EventSession, UsageReport, FactsRuntimeProfile, DaemonRuntimes, ConfigPush, DaemonRestart, DaemonUpgrade, DaemonControlAck, Ack } from './frames/telemetry.js';\nimport { ErrorFrame } from './frames/error.js';\nimport { WebchatMessage, WebchatAck, WebchatOutput, WebchatDone, WebchatClose, WebchatSetModel, WebchatSetEffort, WebchatSetPermissionMode, WebchatSetFast, WebchatCancel } from './frames/webchat.js';\n/**\n * The single source of truth for the wire: `type` string → payload zod schema.\n *\n * Mirrors the frame index in daemon-cp-ws-protocol.md §10 (the 29 numbered\n * frames) plus the correlated REP types named in the \"Reply\" column\n * (`route/assign/ack`, `drain/done`, and the generic `ack` replies) that also\n * travel on the wire and must be decodable.\n *\n * `ws/codec.ts` validates every inbound `payload` against `FRAME_SCHEMAS[type]`;\n * an unknown `type` → `ErrorFrame{code:\"UNKNOWN_FRAME\"}` (a REP, not a close).\n */\nexport const FRAME_SCHEMAS = {\n // ── auth / identity ──\n auth: AuthReq,\n 'auth/ok': AuthOk,\n // ── register / reconcile ──\n register: RegisterReq,\n 'register/ok': RegisterOk,\n // ── telemetry ──\n heartbeat: Heartbeat,\n // ── agent lifecycle / delivery ──\n 'agent/launch': AgentLaunch,\n 'agent/launched': AgentLaunched,\n 'agent/stop': AgentStop,\n 'agent/upsert': AgentUpsert,\n 'agent/remove': AgentRemove,\n 'agent/activity': AgentActivity,\n 'agent/scope-denied': AgentScopeDenied,\n // ── webchat (integration over the control WS) ──\n 'webchat/message': WebchatMessage,\n 'webchat/ack': WebchatAck,\n 'webchat/output': WebchatOutput,\n 'webchat/done': WebchatDone,\n 'webchat/close': WebchatClose,\n 'webchat/set-model': WebchatSetModel,\n 'webchat/set-effort': WebchatSetEffort,\n 'webchat/set-permission-mode': WebchatSetPermissionMode,\n 'webchat/set-fast': WebchatSetFast,\n 'webchat/cancel': WebchatCancel,\n // ── routing / orchestration ──\n 'route/assign': RouteAssign,\n 'route/assign/ack': RouteAssignAck,\n 'route/update': RouteUpdate,\n 'daemon/drain': Drain,\n 'drain/progress': DrainProgress,\n 'drain/done': DrainDone,\n // ── cron ──\n 'cron/upsert': CronUpsert,\n 'cron/remove': CronRemove,\n 'cron/report': CronReport,\n 'cron/run': CronRunNow,\n // ── integrations (platform config distribution; token-bearing — never log) ──\n 'integration/upsert': IntegrationUpsert,\n 'integration/remove': IntegrationRemove,\n 'integration/channels': IntegrationChannels,\n // ── git credentials (github-app workspaces; token-bearing — never log) ──\n 'gitcred/request': GitCredRequest,\n 'gitcred/grant': GitCredGrant,\n // ── secrets ──\n 'secrets/request': SecretsRequest,\n 'secrets/grant': SecretsGrant,\n 'secrets/renew': SecretsRenew,\n 'secrets/revoke': SecretsRevoke,\n 'scope-attestation': ScopeAttestation,\n // ── dashboard / facts ──\n 'event/session': EventSession,\n 'usage/report': UsageReport,\n 'facts/runtime-profile': FactsRuntimeProfile,\n 'facts/daemon-runtimes': DaemonRuntimes,\n // ── session read-back (console history pull) ──\n 'session/list': SessionListReq,\n 'session/list/page': SessionListPage,\n 'session/history': SessionHistoryReq,\n 'session/history/page': SessionHistoryPage,\n 'session/tool-body': SessionToolBodyReq,\n 'session/tool-body/chunk': SessionToolBodyChunk,\n // ── channel agent directory (agent collaboration; D→C REQ → REP) ──\n 'channel/agents': ChannelAgentsReq,\n 'channel/agents/ok': ChannelAgentsOk,\n // ── workspace file browsing (console live pull; bytes transit, never stored) ──\n 'workspace/list': WorkspaceListReq,\n 'workspace/list/page': WorkspaceListPage,\n 'workspace/read': WorkspaceReadReq,\n 'workspace/read/content': WorkspaceReadContent,\n 'workspace/gitstatus': WorkspaceGitStatusReq,\n 'workspace/gitstatus/result': WorkspaceGitStatus,\n 'workspace/gitpull': WorkspaceGitPullReq,\n 'workspace/gitpull/result': WorkspaceGitPullResult,\n 'memory/list': MemoryListReq,\n 'memory/list/page': MemoryListPage,\n 'memory/read': MemoryReadReq,\n 'memory/read/content': MemoryReadContent,\n 'memory/write': MemoryWriteReq,\n 'memory/write/ok': MemoryWriteOk,\n // ── fleet / config ──\n 'config/push': ConfigPush,\n 'daemon/restart': DaemonRestart,\n 'daemon/upgrade': DaemonUpgrade,\n // ── generic replies ──\n 'daemon/control/ack': DaemonControlAck,\n ack: Ack,\n // ── error ──\n error: ErrorFrame\n};\n/** All frame `type` strings, as a runtime array (used by guards / tests). */\nexport const FRAME_TYPES = Object.keys(FRAME_SCHEMAS);\n/**\n * Builds the envelope schema for one frame `type` with a `type` literal and the\n * typed payload, so the discriminated union infers `payload` precisely.\n */\nfunction frame(type, payload) {\n return z.object({\n v: z.literal(1),\n id: z.string().uuid(),\n ts: z.string().datetime(),\n type: z.literal(type),\n corr: z.string().uuid().optional(),\n payload\n });\n}\n/**\n * `AnyFrame` — the discriminated union over `type` of every fully-validated\n * frame (envelope + typed payload). This is the runtime guard at the socket\n * edge and the precise inferred type the handlers switch on.\n */\nexport const AnyFrame = z.discriminatedUnion('type', [\n frame('auth', FRAME_SCHEMAS['auth']),\n frame('auth/ok', FRAME_SCHEMAS['auth/ok']),\n frame('register', FRAME_SCHEMAS['register']),\n frame('register/ok', FRAME_SCHEMAS['register/ok']),\n frame('heartbeat', FRAME_SCHEMAS['heartbeat']),\n frame('agent/launch', FRAME_SCHEMAS['agent/launch']),\n frame('agent/launched', FRAME_SCHEMAS['agent/launched']),\n frame('agent/stop', FRAME_SCHEMAS['agent/stop']),\n frame('agent/upsert', FRAME_SCHEMAS['agent/upsert']),\n frame('agent/remove', FRAME_SCHEMAS['agent/remove']),\n frame('agent/activity', FRAME_SCHEMAS['agent/activity']),\n frame('agent/scope-denied', FRAME_SCHEMAS['agent/scope-denied']),\n // ── webchat (integration over the control WS) ──\n frame('webchat/message', FRAME_SCHEMAS['webchat/message']),\n frame('webchat/ack', FRAME_SCHEMAS['webchat/ack']),\n frame('webchat/output', FRAME_SCHEMAS['webchat/output']),\n frame('webchat/done', FRAME_SCHEMAS['webchat/done']),\n frame('webchat/close', FRAME_SCHEMAS['webchat/close']),\n frame('webchat/set-model', FRAME_SCHEMAS['webchat/set-model']),\n frame('webchat/set-effort', FRAME_SCHEMAS['webchat/set-effort']),\n frame('webchat/set-permission-mode', FRAME_SCHEMAS['webchat/set-permission-mode']),\n frame('webchat/set-fast', FRAME_SCHEMAS['webchat/set-fast']),\n frame('webchat/cancel', FRAME_SCHEMAS['webchat/cancel']),\n frame('route/assign', FRAME_SCHEMAS['route/assign']),\n frame('route/assign/ack', FRAME_SCHEMAS['route/assign/ack']),\n frame('route/update', FRAME_SCHEMAS['route/update']),\n frame('daemon/drain', FRAME_SCHEMAS['daemon/drain']),\n frame('drain/progress', FRAME_SCHEMAS['drain/progress']),\n frame('drain/done', FRAME_SCHEMAS['drain/done']),\n frame('cron/upsert', FRAME_SCHEMAS['cron/upsert']),\n frame('cron/remove', FRAME_SCHEMAS['cron/remove']),\n frame('cron/report', FRAME_SCHEMAS['cron/report']),\n frame('cron/run', FRAME_SCHEMAS['cron/run']),\n frame('integration/upsert', FRAME_SCHEMAS['integration/upsert']),\n frame('integration/remove', FRAME_SCHEMAS['integration/remove']),\n frame('integration/channels', FRAME_SCHEMAS['integration/channels']),\n frame('gitcred/request', FRAME_SCHEMAS['gitcred/request']),\n frame('gitcred/grant', FRAME_SCHEMAS['gitcred/grant']),\n frame('secrets/request', FRAME_SCHEMAS['secrets/request']),\n frame('secrets/grant', FRAME_SCHEMAS['secrets/grant']),\n frame('secrets/renew', FRAME_SCHEMAS['secrets/renew']),\n frame('secrets/revoke', FRAME_SCHEMAS['secrets/revoke']),\n frame('scope-attestation', FRAME_SCHEMAS['scope-attestation']),\n frame('event/session', FRAME_SCHEMAS['event/session']),\n frame('usage/report', FRAME_SCHEMAS['usage/report']),\n frame('facts/runtime-profile', FRAME_SCHEMAS['facts/runtime-profile']),\n frame('facts/daemon-runtimes', FRAME_SCHEMAS['facts/daemon-runtimes']),\n frame('session/list', FRAME_SCHEMAS['session/list']),\n frame('session/list/page', FRAME_SCHEMAS['session/list/page']),\n frame('session/history', FRAME_SCHEMAS['session/history']),\n frame('session/history/page', FRAME_SCHEMAS['session/history/page']),\n frame('session/tool-body', FRAME_SCHEMAS['session/tool-body']),\n frame('session/tool-body/chunk', FRAME_SCHEMAS['session/tool-body/chunk']),\n frame('channel/agents', FRAME_SCHEMAS['channel/agents']),\n frame('channel/agents/ok', FRAME_SCHEMAS['channel/agents/ok']),\n frame('workspace/list', FRAME_SCHEMAS['workspace/list']),\n frame('workspace/list/page', FRAME_SCHEMAS['workspace/list/page']),\n frame('workspace/read', FRAME_SCHEMAS['workspace/read']),\n frame('workspace/read/content', FRAME_SCHEMAS['workspace/read/content']),\n frame('workspace/gitstatus', FRAME_SCHEMAS['workspace/gitstatus']),\n frame('workspace/gitstatus/result', FRAME_SCHEMAS['workspace/gitstatus/result']),\n frame('workspace/gitpull', FRAME_SCHEMAS['workspace/gitpull']),\n frame('workspace/gitpull/result', FRAME_SCHEMAS['workspace/gitpull/result']),\n frame('memory/list', FRAME_SCHEMAS['memory/list']),\n frame('memory/list/page', FRAME_SCHEMAS['memory/list/page']),\n frame('memory/read', FRAME_SCHEMAS['memory/read']),\n frame('memory/read/content', FRAME_SCHEMAS['memory/read/content']),\n frame('memory/write', FRAME_SCHEMAS['memory/write']),\n frame('memory/write/ok', FRAME_SCHEMAS['memory/write/ok']),\n frame('config/push', FRAME_SCHEMAS['config/push']),\n frame('daemon/restart', FRAME_SCHEMAS['daemon/restart']),\n frame('daemon/upgrade', FRAME_SCHEMAS['daemon/upgrade']),\n frame('daemon/control/ack', FRAME_SCHEMAS['daemon/control/ack']),\n frame('ack', FRAME_SCHEMAS['ack']),\n frame('error', FRAME_SCHEMAS['error'])\n]);\n/** Runtime guard: is `t` a known frame `type`? */\nexport function isFrameType(t) {\n return Object.prototype.hasOwnProperty.call(FRAME_SCHEMAS, t);\n}\n//# sourceMappingURL=frame.js.map","import { randomUUID } from 'node:crypto';\nimport { Envelope, FRAME_SCHEMAS, NIL_UUID } from './index.js';\n/** Soft cap per frame — 256 KiB (protocol §1). Over this → FRAME_TOO_LARGE. */\nexport const MAX_FRAME_BYTES = 256 * 1024;\nconst textEncoder = new TextEncoder();\nfunction byteLength(text) {\n return textEncoder.encode(text).length;\n}\nfunction extractControlExt(json) {\n if (typeof json !== 'object' || json === null)\n return undefined;\n const o = json;\n const ext = {};\n if (typeof o.epoch === 'number')\n ext.epoch = o.epoch;\n if (typeof o.agentId === 'string')\n ext.agentId = o.agentId;\n if (typeof o.launchId === 'string')\n ext.launchId = o.launchId;\n return Object.keys(ext).length > 0 ? ext : undefined;\n}\nexport function decodeEnvelope(text) {\n if (byteLength(text) > MAX_FRAME_BYTES) {\n return { ok: false, id: NIL_UUID, msg: 'FRAME_TOO_LARGE' };\n }\n let json;\n try {\n json = JSON.parse(text);\n }\n catch {\n return { ok: false, id: NIL_UUID, msg: 'invalid json' };\n }\n const env = Envelope.safeParse(json);\n if (!env.success) {\n const id = typeof json === 'object' && json !== null && typeof json.id === 'string'\n ? json.id\n : NIL_UUID;\n return { ok: false, id, msg: env.error.message };\n }\n const schema = FRAME_SCHEMAS[env.data.type];\n if (!schema) {\n return { ok: false, id: env.data.id, msg: 'UNKNOWN_FRAME' };\n }\n const payload = schema.safeParse(env.data.payload);\n if (!payload.success) {\n return { ok: false, id: env.data.id, msg: payload.error.message };\n }\n const ext = extractControlExt(json);\n return {\n ok: true,\n frame: { ...env.data, payload: payload.data },\n ...(ext ? { ext } : {})\n };\n}\nexport function buildEnvelope(type, payload, opts = {}) {\n const base = {\n v: 1,\n id: opts.id ?? randomUUID(),\n ts: opts.ts ?? new Date().toISOString(),\n type,\n payload,\n ...(opts.corr ? { corr: opts.corr } : {}),\n ...(opts.ext ?? {})\n };\n return base;\n}\nexport function encode(frame) {\n return JSON.stringify(frame);\n}\n//# sourceMappingURL=codec.js.map","/**\n * Git repo address helpers, shared by the CP (normalize on write) and the\n * daemon (defensive normalize before clone).\n *\n * STORAGE INVARIANT: `workspace.gitRepo` is persisted as a FULL cloneable git\n * address (e.g. `https://github.com/acme/infra`), never the `acme/infra`\n * shorthand a user may type. UIs shorten it back to `org/repo` for display\n * with `gitRepoLabel`.\n */\n/** Scheme-full address: https://, ssh://, git://, file://, … */\nconst SCHEME_RE = /^[a-z][a-z0-9+.-]*:\\/\\//i;\n/** scp-like ssh address: git@github.com:acme/infra(.git) */\nconst SCP_RE = /^[\\w.-]+@[\\w.-]+:(.+)$/;\n/**\n * Normalize a user-supplied repo reference into a full cloneable git address.\n * Idempotent — full addresses pass through unchanged.\n *\n * - `https://…` / `ssh://…` / `git://…` / `git@host:…` → as-is\n * - `github.com/acme/infra` (host-prefixed shorthand) → `https://github.com/acme/infra`\n * - `acme/infra` (bare org/repo) → `https://github.com/acme/infra`\n * - anything else (e.g. a local path) → as-is\n */\nexport function normalizeGitUrl(input) {\n const s = input.trim().replace(/\\/+$/, '');\n if (!s || SCHEME_RE.test(s) || SCP_RE.test(s))\n return s;\n const segments = s.split('/');\n // host-prefixed shorthand: first segment looks like a hostname (has a dot)\n if (segments.length >= 3 && segments[0].includes('.'))\n return `https://${s}`;\n // bare org/repo → GitHub by default\n if (segments.length === 2 && segments.every((p) => p.length > 0))\n return `https://github.com/${s}`;\n return s;\n}\n/**\n * Shorten a stored git address to the `org/repo` display form.\n * `https://github.com/acme/infra.git` / `git@github.com:acme/infra` → `acme/infra`.\n * Unrecognized inputs come back unchanged (minus a trailing `.git`).\n */\nexport function gitRepoLabel(gitRepo) {\n const s = gitRepo\n .trim()\n .replace(/\\/+$/, '')\n .replace(/\\.git$/, '');\n const scp = SCP_RE.exec(s);\n if (scp)\n return scp[1].replace(/^\\/+/, '');\n const url = /^[a-z][a-z0-9+.-]*:\\/\\/[^/]+\\/(.+)$/i.exec(s);\n if (url)\n return url[1];\n const segments = s.split('/');\n if (segments.length >= 3 && segments[0].includes('.'))\n return segments.slice(1).join('/');\n return s;\n}\n//# sourceMappingURL=git-url.js.map","/**\n * `@agentconnect.md/protocol` — the shared wire contract for the daemon ↔ CP\n * WebSocket protocol (daemon-cp-ws-protocol.md). Single source of truth for all\n * frames and the `sessionEpoch`/`seq`/`launchId` fencing fields, imported by\n * both the control-plane and the daemon.\n *\n * This barrel re-exports the zod schemas, their inferred types, and the\n * `isFrameType` guard.\n */\n// ── envelope + control extension ──\nexport { Envelope, ControlExt, NIL_UUID } from './envelope.js';\n// ── frame groups (schemas + inferred types) ──\nexport * from './frames/auth.js';\nexport * from './frames/register.js';\nexport * from './frames/route.js';\nexport * from './frames/agent.js';\nexport * from './frames/cron.js';\nexport * from './frames/integration.js';\nexport * from './frames/gitcred.js';\nexport * from './frames/secrets.js';\nexport * from './frames/session.js';\nexport * from './frames/channel.js';\nexport * from './frames/workspace.js';\nexport * from './frames/memory.js';\nexport * from './frames/telemetry.js';\nexport * from './frames/error.js';\nexport * from './frames/webchat.js';\n// ── the union, the type map, and guards ──\nexport { AnyFrame, FRAME_SCHEMAS, FRAME_TYPES, isFrameType } from './frame.js';\nimport { isFrameType } from './frame.js';\n/**\n * Narrowing guard factory: `isFrame(\"auth\")(frame)` narrows a decoded\n * `AnyFrame` to the member whose `type` matches.\n */\nexport function isFrame(type) {\n return (frame) => frame.type === type;\n}\n/** Re-export under a convenience alias for call sites that prefer it. */\nexport { isFrameType as isKnownFrameType };\n// ── wire codec (shared by daemon + control-plane) ──\nexport { decodeEnvelope, buildEnvelope, encode, MAX_FRAME_BYTES } from './codec.js';\n// ── git repo address helpers (normalize on write, shorten for display) ──\nexport { normalizeGitUrl, gitRepoLabel } from './git-url.js';\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst fs_1 = require(\"fs\");\nconst debug_1 = __importDefault(require(\"debug\"));\nconst log = debug_1.default('@kwsites/file-exists');\nfunction check(path, isFile, isDirectory) {\n log(`checking %s`, path);\n try {\n const stat = fs_1.statSync(path);\n if (stat.isFile() && isFile) {\n log(`[OK] path represents a file`);\n return true;\n }\n if (stat.isDirectory() && isDirectory) {\n log(`[OK] path represents a directory`);\n return true;\n }\n log(`[FAIL] path represents something other than a file or directory`);\n return false;\n }\n catch (e) {\n if (e.code === 'ENOENT') {\n log(`[FAIL] path is not accessible: %o`, e);\n return false;\n }\n log(`[FATAL] %o`, e);\n throw e;\n }\n}\n/**\n * Synchronous validation of a path existing either as a file or as a directory.\n *\n * @param {string} path The path to check\n * @param {number} type One or both of the exported numeric constants\n */\nfunction exists(path, type = exports.READABLE) {\n return check(path, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);\n}\nexports.exists = exists;\n/**\n * Constant representing a file\n */\nexports.FILE = 1;\n/**\n * Constant representing a folder\n */\nexports.FOLDER = 2;\n/**\n * Constant representing either a file or a folder\n */\nexports.READABLE = exports.FILE + exports.FOLDER;\n//# sourceMappingURL=index.js.map","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(require(\"./src\"));\n//# sourceMappingURL=index.js.map","const t = /* @__PURE__ */ new WeakMap();\nfunction c(...n) {\n const e = new String(n);\n return t.set(e, n), e;\n}\nfunction r(n) {\n return n instanceof String && t.has(n);\n}\nfunction o(n) {\n return t.get(n) ?? [];\n}\nexport {\n r as isPathSpec,\n c as pathspec,\n o as toPaths\n};\n//# sourceMappingURL=index.mjs.map\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createDeferred = exports.deferred = void 0;\n/**\n * Creates a new `DeferredPromise`\n *\n * ```typescript\n import {deferred} from '@kwsites/promise-deferred`;\n ```\n */\nfunction deferred() {\n let done;\n let fail;\n let status = 'pending';\n const promise = new Promise((_done, _fail) => {\n done = _done;\n fail = _fail;\n });\n return {\n promise,\n done(result) {\n if (status === 'pending') {\n status = 'resolved';\n done(result);\n }\n },\n fail(error) {\n if (status === 'pending') {\n status = 'rejected';\n fail(error);\n }\n },\n get fulfilled() {\n return status !== 'pending';\n },\n get status() {\n return status;\n },\n };\n}\nexports.deferred = deferred;\n/**\n * Alias of the exported `deferred` function, to help consumers wanting to use `deferred` as the\n * local variable name rather than the factory import name, without needing to rename on import.\n *\n * ```typescript\n import {createDeferred} from '@kwsites/promise-deferred`;\n ```\n */\nexports.createDeferred = deferred;\n/**\n * Default export allows use as:\n *\n * ```typescript\n import deferred from '@kwsites/promise-deferred`;\n ```\n */\nexports.default = deferred;\n//# sourceMappingURL=index.js.map","import { isPathSpec as m, toPaths as v } from \"@simple-git/args-pathspec\";\nfunction* U(e, t) {\n const n = t === \"global\";\n for (const o of e)\n o.isGlobal === n && (yield o);\n}\nconst k = /* @__PURE__ */ new Set([\n \"--add\",\n \"--edit\",\n \"--remove-section\",\n \"--rename-section\",\n \"--replace-all\",\n \"--unset\",\n \"--unset-all\",\n \"-e\"\n]), S = /* @__PURE__ */ new Set([\n \"--get\",\n \"--get-all\",\n \"--get-color\",\n \"--get-colorbool\",\n \"--get-regexp\",\n \"--get-urlmatch\",\n \"--list\",\n \"-l\"\n]), P = /* @__PURE__ */ new Set([\n \"edit\",\n \"remove-section\",\n \"rename-section\",\n \"set\",\n \"unset\"\n]), E = /* @__PURE__ */ new Set([\"get\", \"get-color\", \"get-colorbool\", \"list\"]);\nfunction F(e, t) {\n for (const { name: o } of U(e, \"task\")) {\n if (k.has(o))\n return p(!0, t);\n if (S.has(o))\n return p(!1, t);\n }\n const n = t.at(0)?.toLowerCase();\n return n === void 0 ? null : P.has(n) ? p(!0, t.slice(1)) : E.has(n) ? p(!1, t.slice(1)) : t.length === 1 ? p(!1, t) : p(!0, t);\n}\nfunction p(e = !1, t = []) {\n const n = t.at(0)?.toLowerCase();\n return n === void 0 ? null : {\n isWrite: e,\n isRead: !e,\n key: n,\n value: t.at(1)\n };\n}\nfunction A(e, t) {\n return t.isWrite && t.value !== void 0 ? { key: t.key, value: t.value, scope: e } : { key: t.key, scope: e };\n}\nfunction M(e) {\n const t = e?.indexOf(\"=\") || -1;\n return !e || t < 0 ? null : {\n key: e.slice(0, t).trim().toLowerCase(),\n value: e.slice(t + 1)\n };\n}\nfunction N(e) {\n for (const { name: t } of U(e, \"task\"))\n switch (t) {\n case \"--global\":\n return \"global\";\n case \"--system\":\n return \"system\";\n case \"--worktree\":\n return \"worktree\";\n case \"--local\":\n return \"local\";\n case \"--file\":\n case \"-f\":\n return \"file\";\n }\n return \"local\";\n}\nfunction G({ name: e }) {\n if (e === \"-c\" || e === \"--config\")\n return \"inline\";\n if (e === \"--config-env\")\n return \"env\";\n}\nfunction* O(e) {\n for (const t of e) {\n const n = G(t), o = n && M(t.value);\n o && (yield {\n ...o,\n scope: n\n });\n }\n}\nfunction L(e, t, n) {\n const o = {\n read: [],\n write: [...O(t)]\n };\n return e === \"config\" && $(\n o,\n N(t),\n F(t, n)\n ), o;\n}\nfunction $(e, t, n) {\n if (n === null)\n return;\n const o = A(t, n);\n n.isWrite ? e.write.push(o) : e.read.push(o);\n}\nconst x = {\n short: /* @__PURE__ */ new Map([\n [\"c\", !0]\n // -c <k=v> set config key for this invocation\n ])\n}, D = {\n short: new Map([\n [\"C\", !0],\n // -C <path> change working directory\n [\"P\", !1],\n // -P no pager (alias for --no-pager)\n [\"h\", !1],\n // -h help\n [\"p\", !1],\n // -p paginate\n [\"v\", !1],\n // -v version\n ...x.short.entries()\n ]),\n long: /* @__PURE__ */ new Set([\n \"attr-source\",\n \"config-env\",\n \"exec-path\",\n \"git-dir\",\n \"list-cmds\",\n \"namespace\",\n \"super-prefix\",\n \"work-tree\"\n ])\n}, R = {\n clone: {\n short: /* @__PURE__ */ new Map([\n [\"b\", !0],\n // -b <branch>\n [\"j\", !0],\n // -j <n> parallel jobs\n [\"l\", !1],\n // -l local\n [\"n\", !1],\n // -n no-checkout\n [\"o\", !0],\n // -o <name> remote name\n [\"q\", !1],\n // -q quiet\n [\"s\", !1],\n // -s shared\n [\"u\", !0]\n // -u <upload-pack>\n ]),\n long: /* @__PURE__ */ new Set([\"branch\", \"config\", \"jobs\", \"origin\", \"upload-pack\", \"u\", \"template\"])\n },\n commit: {\n short: /* @__PURE__ */ new Map([\n [\"C\", !0],\n // -C <commit> reuse message\n [\"F\", !0],\n // -F <file> read message from file\n [\"c\", !0],\n // -c <commit> reedit message\n [\"m\", !0],\n // -m <msg>\n [\"t\", !0]\n // -t <template>\n ]),\n long: /* @__PURE__ */ new Set([\"file\", \"message\", \"reedit-message\", \"reuse-message\", \"template\"])\n },\n config: {\n short: /* @__PURE__ */ new Map([\n [\"e\", !1],\n // -e open editor\n [\"f\", !0],\n // -f <file>\n [\"l\", !1]\n // -l list\n ]),\n long: /* @__PURE__ */ new Set([\"blob\", \"comment\", \"default\", \"file\", \"type\", \"value\"])\n },\n fetch: {\n short: /* @__PURE__ */ new Map(),\n long: /* @__PURE__ */ new Set([\"upload-pack\"])\n },\n init: {\n short: /* @__PURE__ */ new Map(),\n long: /* @__PURE__ */ new Set([\"template\"])\n },\n pull: {\n short: /* @__PURE__ */ new Map(),\n long: /* @__PURE__ */ new Set([\"upload-pack\"])\n },\n push: {\n short: /* @__PURE__ */ new Map(),\n long: /* @__PURE__ */ new Set([\"exec\", \"receive-pack\"])\n }\n}, T = { short: /* @__PURE__ */ new Map(), long: /* @__PURE__ */ new Set() };\nfunction I(e) {\n const t = R[e ?? \"\"] ?? T;\n return {\n short: new Map([...x.short.entries(), ...t.short.entries()]),\n long: t.long\n };\n}\nfunction b(e, t = D) {\n if (e.startsWith(\"--\")) {\n const n = e.indexOf(\"=\");\n if (n > 2)\n return [{ name: e.slice(0, n), value: e.slice(n + 1), needsNext: !1 }];\n const o = e.slice(2);\n return [{ name: e, needsNext: t.long.has(o) }];\n }\n if (e.length === 2) {\n const n = e.charAt(1), o = t.short.get(n);\n return [{ name: e, needsNext: o === !0 }];\n }\n return W(e, t.short);\n}\nfunction W(e, t) {\n const n = e.slice(1).split(\"\"), o = [];\n for (let s = 0; s < n.length; s++) {\n const r = n[s], l = t.get(r);\n if (l === void 0)\n return [{ name: e, needsNext: !1 }];\n if (l) {\n const a = n.slice(s + 1).join(\"\");\n if (a && ![...a].every((w) => t.has(w)))\n return o.push({ name: `-${r}`, value: a, needsNext: !1 }), o;\n }\n o.push({ name: `-${r}`, needsNext: l });\n }\n return o;\n}\nfunction j(e, t = []) {\n let n = 0;\n for (; n < e.length; ) {\n const o = String(e[n]);\n if (!o.startsWith(\"-\") || o.length < 2) break;\n const s = b(o);\n let r = n + 1;\n for (const l of s) {\n const a = {\n name: l.name,\n value: l.value,\n absorbedNext: !1,\n isGlobal: !0\n };\n l.needsNext && a.value === void 0 && r < e.length && (a.value = String(e[r]), a.absorbedNext = !0, r++), t.push(a);\n }\n n = r;\n }\n return { flags: t, taskIndex: n };\n}\nfunction B(e, t, n = []) {\n const o = I(t), s = [], r = [];\n let l = 0;\n for (; l < e.length; ) {\n const a = e[l];\n if (m(a)) {\n r.push(...v(a)), l++;\n continue;\n }\n const f = String(a);\n if (f === \"--\") {\n for (let g = l + 1; g < e.length; g++) {\n const u = e[g];\n m(u) ? r.push(...v(u)) : r.push(String(u));\n }\n break;\n }\n if (!f.startsWith(\"-\") || f.length < 2) {\n s.push(f), l++;\n continue;\n }\n const w = b(f, o);\n let d = l + 1;\n for (const g of w) {\n const u = {\n name: g.name,\n value: g.value,\n absorbedNext: !1,\n isGlobal: !1\n };\n g.needsNext && u.value === void 0 && d < e.length && !m(e[d]) && (u.value = String(e[d]), u.absorbedNext = !0, d++), n.push(u);\n }\n l = d;\n }\n return { flags: n, positionals: s, pathspecs: r };\n}\nfunction* V({\n write: e\n}) {\n for (const t of e)\n for (const n of q) {\n const o = n(t.key);\n o && (yield o);\n }\n}\nfunction c(e, t, n = String(e)) {\n const o = typeof e == \"string\" ? new RegExp(`\\\\s*${e.toLowerCase()}`) : e;\n return function(r) {\n if (o.test(r))\n return {\n category: t,\n message: `Configuring ${n} is not permitted without enabling ${t}`\n };\n };\n}\nfunction i(e, t) {\n const n = new RegExp(`\\\\s*${e.toLowerCase().replace(/\\./g, \"(..+)?.\")}`);\n return c(n, t, e);\n}\nconst q = [\n c(\"alias\", \"allowUnsafeAlias\"),\n c(\"core.askPass\", \"allowUnsafeAskPass\"),\n c(\"core.editor\", \"allowUnsafeEditor\"),\n c(\"core.fsmonitor\", \"allowUnsafeFsMonitor\"),\n c(\"core.gitProxy\", \"allowUnsafeGitProxy\"),\n c(\"core.hooksPath\", \"allowUnsafeHooksPath\"),\n c(\"core.pager\", \"allowUnsafePager\"),\n c(\"core.sshCommand\", \"allowUnsafeSshCommand\"),\n i(\"credential.helper\", \"allowUnsafeCredentialHelper\"),\n i(\"diff.command\", \"allowUnsafeDiffExternal\"),\n c(\"diff.external\", \"allowUnsafeDiffExternal\"),\n i(\"diff.textconv\", \"allowUnsafeDiffTextConv\"),\n i(\"filter.clean\", \"allowUnsafeFilter\"),\n i(\"filter.smudge\", \"allowUnsafeFilter\"),\n i(\"gpg.program\", \"allowUnsafeGpgProgram\"),\n c(\"init.templateDir\", \"allowUnsafeTemplateDir\"),\n i(\"merge.driver\", \"allowUnsafeMergeDriver\"),\n i(\"mergetool.path\", \"allowUnsafeMergeDriver\"),\n i(\"mergetool.cmd\", \"allowUnsafeMergeDriver\"),\n i(\"protocol.allow\", \"allowUnsafeProtocolOverride\"),\n i(\"remote.receivepack\", \"allowUnsafePack\"),\n i(\"remote.uploadpack\", \"allowUnsafePack\"),\n c(\"sequence.editor\", \"allowUnsafeEditor\")\n];\nfunction* K(e, t) {\n for (const n of t)\n for (const o of H) {\n const s = o(e, n.name);\n s && (yield s);\n }\n}\nfunction h(e, t, n, o = String(t)) {\n const s = typeof t == \"string\" ? new RegExp(`\\\\s*${t.toLowerCase()}`) : t, r = `Use of ${e ? `${e} with option ` : \"\"}${o} is not permitted without enabling ${n}`;\n return function(a, f) {\n if ((!e || a === e) && s.test(f))\n return {\n category: n,\n message: r\n };\n };\n}\nconst H = [\n h(\n null,\n /--(upload|receive)-pack/,\n \"allowUnsafePack\",\n \"--upload-pack or --receive-pack\"\n ),\n h(\"clone\", /^-\\w*u/, \"allowUnsafePack\"),\n h(\"clone\", \"--u\", \"allowUnsafePack\"),\n h(\"push\", \"--exec\", \"allowUnsafePack\"),\n h(null, \"--template\", \"allowUnsafeTemplateDir\")\n];\nfunction C(e, t, n) {\n return [...K(e, t), ...V(n)];\n}\nfunction Y(...e) {\n const { flags: t, taskIndex: n } = j(e), o = n < e.length ? String(e[n]).toLowerCase() : null, s = o !== null ? e.slice(n + 1) : [], { positionals: r, pathspecs: l } = B(s, o, t), a = L(o, t, r);\n return {\n task: o,\n flags: t.map(J),\n paths: l,\n config: a,\n vulnerabilities: z(C(o, t, a))\n };\n}\nfunction z(e) {\n return Object.defineProperty(e, \"vulnerabilities\", {\n value: e\n });\n}\nfunction J({ value: e, name: t }) {\n return e !== void 0 ? { name: t, value: e } : { name: t };\n}\nconst y = {\n editor: \"allowUnsafeEditor\",\n git_askpass: \"allowUnsafeAskPass\",\n git_config_global: \"allowUnsafeConfigPaths\",\n git_config_system: \"allowUnsafeConfigPaths\",\n git_config_count: \"allowUnsafeConfigEnvCount\",\n git_config: \"allowUnsafeConfigPaths\",\n git_editor: \"allowUnsafeEditor\",\n git_exec_path: \"allowUnsafeConfigPaths\",\n git_external_diff: \"allowUnsafeDiffExternal\",\n git_pager: \"allowUnsafePager\",\n git_proxy_command: \"allowUnsafeGitProxy\",\n git_template_dir: \"allowUnsafeTemplateDir\",\n git_sequence_editor: \"allowUnsafeEditor\",\n git_ssh: \"allowUnsafeSshCommand\",\n git_ssh_command: \"allowUnsafeSshCommand\",\n pager: \"allowUnsafePager\",\n prefix: \"allowUnsafeConfigPaths\",\n ssh_askpass: \"allowUnsafeAskPass\"\n};\nfunction* Q(e) {\n const t = parseInt(e.git_config_count ?? \"0\", 10);\n for (let n = 0; n < t; n++) {\n const o = e[`git_config_key_${n}`], s = e[`git_config_value_${n}`];\n o !== void 0 && (yield { key: o.toLowerCase().trim(), value: s, scope: \"env\" });\n }\n}\nfunction* X(e) {\n for (const t of Object.keys(e))\n if (_(t)) {\n const n = y[t];\n yield {\n category: n,\n message: `Use of \"${t.toUpperCase()}\" is not permitted without enabling ${n}`\n };\n }\n}\nfunction _(e) {\n return Object.hasOwn(y, e);\n}\nfunction Z(e) {\n const t = {};\n for (const [n, o] of Object.entries(e)) {\n const s = n.toLowerCase().trim();\n (_(s) || s.startsWith(\"git\")) && (t[s] = String(o));\n }\n return t;\n}\nfunction ee(e) {\n const t = Z(e), n = {\n read: [],\n write: [...Q(t)]\n }, o = [\n ...X(t),\n ...C(null, [], n)\n ];\n return {\n config: n,\n vulnerabilities: o\n };\n}\nfunction ne(e, t) {\n return [...Y(...e).vulnerabilities, ...ee(t).vulnerabilities];\n}\nexport {\n Y as parseArgv,\n ee as parseEnv,\n ne as vulnerabilityCheck\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __esm = (fn, res) => function __init() {\n return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;\n};\nvar __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/lib/errors/git-error.ts\nvar GitError;\nvar init_git_error = __esm({\n \"src/lib/errors/git-error.ts\"() {\n \"use strict\";\n GitError = class extends Error {\n constructor(task, message) {\n super(message);\n this.task = task;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n };\n }\n});\n\n// src/lib/errors/git-response-error.ts\nvar GitResponseError;\nvar init_git_response_error = __esm({\n \"src/lib/errors/git-response-error.ts\"() {\n \"use strict\";\n init_git_error();\n GitResponseError = class extends GitError {\n constructor(git, message) {\n super(void 0, message || String(git));\n this.git = git;\n }\n };\n }\n});\n\n// src/lib/errors/task-configuration-error.ts\nvar TaskConfigurationError;\nvar init_task_configuration_error = __esm({\n \"src/lib/errors/task-configuration-error.ts\"() {\n \"use strict\";\n init_git_error();\n TaskConfigurationError = class extends GitError {\n constructor(message) {\n super(void 0, message);\n }\n };\n }\n});\n\n// src/lib/utils/util.ts\nimport { exists, FOLDER } from \"@kwsites/file-exists\";\nfunction asFunction(source) {\n if (typeof source !== \"function\") {\n return NOOP;\n }\n return source;\n}\nfunction isUserFunction(source) {\n return typeof source === \"function\" && source !== NOOP;\n}\nfunction splitOn(input, char) {\n const index = input.indexOf(char);\n if (index <= 0) {\n return [input, \"\"];\n }\n return [input.substr(0, index), input.substr(index + 1)];\n}\nfunction first(input, offset = 0) {\n return isArrayLike(input) && input.length > offset ? input[offset] : void 0;\n}\nfunction last(input, offset = 0) {\n if (isArrayLike(input) && input.length > offset) {\n return input[input.length - 1 - offset];\n }\n}\nfunction isArrayLike(input) {\n return filterHasLength(input);\n}\nfunction toLinesWithContent(input = \"\", trimmed2 = true, separator = \"\\n\") {\n return input.split(separator).reduce((output, line) => {\n const lineContent = trimmed2 ? line.trim() : line;\n if (lineContent) {\n output.push(lineContent);\n }\n return output;\n }, []);\n}\nfunction forEachLineWithContent(input, callback) {\n return toLinesWithContent(input, true).map((line) => callback(line));\n}\nfunction folderExists(path) {\n return exists(path, FOLDER);\n}\nfunction append(target, item) {\n if (Array.isArray(target)) {\n if (!target.includes(item)) {\n target.push(item);\n }\n } else {\n target.add(item);\n }\n return item;\n}\nfunction including(target, item) {\n if (Array.isArray(target) && !target.includes(item)) {\n target.push(item);\n }\n return target;\n}\nfunction remove(target, item) {\n if (Array.isArray(target)) {\n const index = target.indexOf(item);\n if (index >= 0) {\n target.splice(index, 1);\n }\n } else {\n target.delete(item);\n }\n return item;\n}\nfunction asArray(source) {\n return Array.isArray(source) ? source : [source];\n}\nfunction asCamelCase(str) {\n return str.replace(/[\\s-]+(.)/g, (_all, chr) => {\n return chr.toUpperCase();\n });\n}\nfunction asStringArray(source) {\n return asArray(source).map((item) => {\n return item instanceof String ? item : String(item);\n });\n}\nfunction asNumber(source, onNaN = 0) {\n if (source == null) {\n return onNaN;\n }\n const num = parseInt(source, 10);\n return Number.isNaN(num) ? onNaN : num;\n}\nfunction prefixedArray(input, prefix) {\n const output = [];\n for (let i = 0, max = input.length; i < max; i++) {\n output.push(prefix, input[i]);\n }\n return output;\n}\nfunction bufferToString(input) {\n return (Array.isArray(input) ? Buffer.concat(input) : input).toString(\"utf-8\");\n}\nfunction pick(source, properties) {\n const out = {};\n properties.forEach((key) => {\n if (source[key] !== void 0) {\n out[key] = source[key];\n }\n });\n return out;\n}\nfunction delay(duration = 0) {\n return new Promise((done) => setTimeout(done, duration));\n}\nfunction orVoid(input) {\n if (input === false) {\n return void 0;\n }\n return input;\n}\nvar NULL, NOOP, objectToString;\nvar init_util = __esm({\n \"src/lib/utils/util.ts\"() {\n \"use strict\";\n init_argument_filters();\n NULL = \"\\0\";\n NOOP = () => {\n };\n objectToString = Object.prototype.toString.call.bind(Object.prototype.toString);\n }\n});\n\n// src/lib/utils/argument-filters.ts\nimport { isPathSpec } from \"@simple-git/args-pathspec\";\nfunction filterType(input, filter, def) {\n if (filter(input)) {\n return input;\n }\n return arguments.length > 2 ? def : void 0;\n}\nfunction filterPrimitives(input, omit) {\n const type = isPathSpec(input) ? \"string\" : typeof input;\n return /number|string|boolean/.test(type) && (!omit || !omit.includes(type));\n}\nfunction filterPlainObject(input) {\n return !!input && objectToString(input) === \"[object Object]\";\n}\nfunction filterFunction(input) {\n return typeof input === \"function\";\n}\nvar filterArray, filterNumber, filterString, filterStringOrStringArray, filterHasLength;\nvar init_argument_filters = __esm({\n \"src/lib/utils/argument-filters.ts\"() {\n \"use strict\";\n init_util();\n filterArray = (input) => {\n return Array.isArray(input);\n };\n filterNumber = (input) => {\n return typeof input === \"number\";\n };\n filterString = (input) => {\n return typeof input === \"string\" || isPathSpec(input);\n };\n filterStringOrStringArray = (input) => {\n return filterString(input) || Array.isArray(input) && input.every(filterString);\n };\n filterHasLength = (input) => {\n if (input == null || \"number|boolean|function\".includes(typeof input)) {\n return false;\n }\n return typeof input.length === \"number\";\n };\n }\n});\n\n// src/lib/utils/exit-codes.ts\nvar ExitCodes;\nvar init_exit_codes = __esm({\n \"src/lib/utils/exit-codes.ts\"() {\n \"use strict\";\n ExitCodes = /* @__PURE__ */ ((ExitCodes2) => {\n ExitCodes2[ExitCodes2[\"SUCCESS\"] = 0] = \"SUCCESS\";\n ExitCodes2[ExitCodes2[\"ERROR\"] = 1] = \"ERROR\";\n ExitCodes2[ExitCodes2[\"NOT_FOUND\"] = -2] = \"NOT_FOUND\";\n ExitCodes2[ExitCodes2[\"UNCLEAN\"] = 128] = \"UNCLEAN\";\n return ExitCodes2;\n })(ExitCodes || {});\n }\n});\n\n// src/lib/utils/git-output-streams.ts\nvar GitOutputStreams;\nvar init_git_output_streams = __esm({\n \"src/lib/utils/git-output-streams.ts\"() {\n \"use strict\";\n GitOutputStreams = class _GitOutputStreams {\n constructor(stdOut, stdErr) {\n this.stdOut = stdOut;\n this.stdErr = stdErr;\n }\n asStrings() {\n return new _GitOutputStreams(this.stdOut.toString(\"utf8\"), this.stdErr.toString(\"utf8\"));\n }\n };\n }\n});\n\n// src/lib/utils/line-parser.ts\nfunction useMatchesDefault() {\n throw new Error(`LineParser:useMatches not implemented`);\n}\nvar LineParser, RemoteLineParser;\nvar init_line_parser = __esm({\n \"src/lib/utils/line-parser.ts\"() {\n \"use strict\";\n LineParser = class {\n constructor(regExp, useMatches) {\n this.matches = [];\n this.useMatches = useMatchesDefault;\n this.parse = (line, target) => {\n this.resetMatches();\n if (!this._regExp.every((reg, index) => this.addMatch(reg, index, line(index)))) {\n return false;\n }\n return this.useMatches(target, this.prepareMatches()) !== false;\n };\n this._regExp = Array.isArray(regExp) ? regExp : [regExp];\n if (useMatches) {\n this.useMatches = useMatches;\n }\n }\n resetMatches() {\n this.matches.length = 0;\n }\n prepareMatches() {\n return this.matches;\n }\n addMatch(reg, index, line) {\n const matched = line && reg.exec(line);\n if (matched) {\n this.pushMatch(index, matched);\n }\n return !!matched;\n }\n pushMatch(_index, matched) {\n this.matches.push(...matched.slice(1));\n }\n };\n RemoteLineParser = class extends LineParser {\n addMatch(reg, index, line) {\n return /^remote:\\s/.test(String(line)) && super.addMatch(reg, index, line);\n }\n pushMatch(index, matched) {\n if (index > 0 || matched.length > 1) {\n super.pushMatch(index, matched);\n }\n }\n };\n }\n});\n\n// src/lib/utils/simple-git-options.ts\nfunction createInstanceConfig(...options) {\n const baseDir = process.cwd();\n const config = Object.assign(\n { baseDir, ...defaultOptions },\n ...options.filter((o) => typeof o === \"object\" && o)\n );\n config.baseDir = config.baseDir || baseDir;\n config.trimmed = config.trimmed === true;\n return config;\n}\nvar defaultOptions;\nvar init_simple_git_options = __esm({\n \"src/lib/utils/simple-git-options.ts\"() {\n \"use strict\";\n defaultOptions = {\n binary: \"git\",\n maxConcurrentProcesses: 5,\n config: [],\n trimmed: false\n };\n }\n});\n\n// src/lib/utils/task-options.ts\nimport { isPathSpec as isPathSpec2 } from \"@simple-git/args-pathspec\";\nfunction appendTaskOptions(options, commands = []) {\n if (!filterPlainObject(options)) {\n return commands;\n }\n return Object.keys(options).reduce((commands2, key) => {\n const value = options[key];\n if (isPathSpec2(value)) {\n commands2.push(value);\n } else if (filterPrimitives(value, [\"boolean\"])) {\n commands2.push(key + \"=\" + value);\n } else if (Array.isArray(value)) {\n for (const v of value) {\n if (!filterPrimitives(v, [\"string\", \"number\"])) {\n commands2.push(key + \"=\" + v);\n }\n }\n } else {\n commands2.push(key);\n }\n return commands2;\n }, commands);\n}\nfunction getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {\n const command = [];\n for (let i = 0, max = initialPrimitive < 0 ? args.length : initialPrimitive; i < max; i++) {\n if (\"string|number\".includes(typeof args[i])) {\n command.push(String(args[i]));\n }\n }\n appendTaskOptions(trailingOptionsArgument(args), command);\n if (!objectOnly) {\n command.push(...trailingArrayArgument(args));\n }\n return command;\n}\nfunction trailingArrayArgument(args) {\n const hasTrailingCallback = typeof last(args) === \"function\";\n return asStringArray(filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []));\n}\nfunction trailingOptionsArgument(args) {\n const hasTrailingCallback = filterFunction(last(args));\n return filterType(last(args, hasTrailingCallback ? 1 : 0), filterPlainObject);\n}\nfunction trailingFunctionArgument(args, includeNoop = true) {\n const callback = asFunction(last(args));\n return includeNoop || isUserFunction(callback) ? callback : void 0;\n}\nvar init_task_options = __esm({\n \"src/lib/utils/task-options.ts\"() {\n \"use strict\";\n init_argument_filters();\n init_util();\n }\n});\n\n// src/lib/utils/task-parser.ts\nfunction callTaskParser(parser4, streams) {\n return parser4(streams.stdOut, streams.stdErr);\n}\nfunction parseStringResponse(result, parsers12, texts, trim = true) {\n asArray(texts).forEach((text) => {\n for (let lines = toLinesWithContent(text, trim), i = 0, max = lines.length; i < max; i++) {\n const line = (offset = 0) => {\n if (i + offset >= max) {\n return;\n }\n return lines[i + offset];\n };\n parsers12.some(({ parse }) => parse(line, result));\n }\n });\n return result;\n}\nvar init_task_parser = __esm({\n \"src/lib/utils/task-parser.ts\"() {\n \"use strict\";\n init_util();\n }\n});\n\n// src/lib/utils/index.ts\nvar utils_exports = {};\n__export(utils_exports, {\n ExitCodes: () => ExitCodes,\n GitOutputStreams: () => GitOutputStreams,\n LineParser: () => LineParser,\n NOOP: () => NOOP,\n NULL: () => NULL,\n RemoteLineParser: () => RemoteLineParser,\n append: () => append,\n appendTaskOptions: () => appendTaskOptions,\n asArray: () => asArray,\n asCamelCase: () => asCamelCase,\n asFunction: () => asFunction,\n asNumber: () => asNumber,\n asStringArray: () => asStringArray,\n bufferToString: () => bufferToString,\n callTaskParser: () => callTaskParser,\n createInstanceConfig: () => createInstanceConfig,\n delay: () => delay,\n filterArray: () => filterArray,\n filterFunction: () => filterFunction,\n filterHasLength: () => filterHasLength,\n filterNumber: () => filterNumber,\n filterPlainObject: () => filterPlainObject,\n filterPrimitives: () => filterPrimitives,\n filterString: () => filterString,\n filterStringOrStringArray: () => filterStringOrStringArray,\n filterType: () => filterType,\n first: () => first,\n folderExists: () => folderExists,\n forEachLineWithContent: () => forEachLineWithContent,\n getTrailingOptions: () => getTrailingOptions,\n including: () => including,\n isUserFunction: () => isUserFunction,\n last: () => last,\n objectToString: () => objectToString,\n orVoid: () => orVoid,\n parseStringResponse: () => parseStringResponse,\n pick: () => pick,\n prefixedArray: () => prefixedArray,\n remove: () => remove,\n splitOn: () => splitOn,\n toLinesWithContent: () => toLinesWithContent,\n trailingFunctionArgument: () => trailingFunctionArgument,\n trailingOptionsArgument: () => trailingOptionsArgument\n});\nvar init_utils = __esm({\n \"src/lib/utils/index.ts\"() {\n \"use strict\";\n init_argument_filters();\n init_exit_codes();\n init_git_output_streams();\n init_line_parser();\n init_simple_git_options();\n init_task_options();\n init_task_parser();\n init_util();\n }\n});\n\n// src/lib/tasks/check-is-repo.ts\nvar check_is_repo_exports = {};\n__export(check_is_repo_exports, {\n CheckRepoActions: () => CheckRepoActions,\n checkIsBareRepoTask: () => checkIsBareRepoTask,\n checkIsRepoRootTask: () => checkIsRepoRootTask,\n checkIsRepoTask: () => checkIsRepoTask\n});\nfunction checkIsRepoTask(action) {\n switch (action) {\n case \"bare\" /* BARE */:\n return checkIsBareRepoTask();\n case \"root\" /* IS_REPO_ROOT */:\n return checkIsRepoRootTask();\n }\n const commands = [\"rev-parse\", \"--is-inside-work-tree\"];\n return {\n commands,\n format: \"utf-8\",\n onError,\n parser\n };\n}\nfunction checkIsRepoRootTask() {\n const commands = [\"rev-parse\", \"--git-dir\"];\n return {\n commands,\n format: \"utf-8\",\n onError,\n parser(path) {\n return /^\\.(git)?$/.test(path.trim());\n }\n };\n}\nfunction checkIsBareRepoTask() {\n const commands = [\"rev-parse\", \"--is-bare-repository\"];\n return {\n commands,\n format: \"utf-8\",\n onError,\n parser\n };\n}\nfunction isNotRepoMessage(error) {\n return /(Not a git repository|Kein Git-Repository)/i.test(String(error));\n}\nvar CheckRepoActions, onError, parser;\nvar init_check_is_repo = __esm({\n \"src/lib/tasks/check-is-repo.ts\"() {\n \"use strict\";\n init_utils();\n CheckRepoActions = /* @__PURE__ */ ((CheckRepoActions2) => {\n CheckRepoActions2[\"BARE\"] = \"bare\";\n CheckRepoActions2[\"IN_TREE\"] = \"tree\";\n CheckRepoActions2[\"IS_REPO_ROOT\"] = \"root\";\n return CheckRepoActions2;\n })(CheckRepoActions || {});\n onError = ({ exitCode }, error, done, fail) => {\n if (exitCode === 128 /* UNCLEAN */ && isNotRepoMessage(error)) {\n return done(Buffer.from(\"false\"));\n }\n fail(error);\n };\n parser = (text) => {\n return text.trim() === \"true\";\n };\n }\n});\n\n// src/lib/responses/CleanSummary.ts\nfunction cleanSummaryParser(dryRun, text) {\n const summary = new CleanResponse(dryRun);\n const regexp = dryRun ? dryRunRemovalRegexp : removalRegexp;\n toLinesWithContent(text).forEach((line) => {\n const removed = line.replace(regexp, \"\");\n summary.paths.push(removed);\n (isFolderRegexp.test(removed) ? summary.folders : summary.files).push(removed);\n });\n return summary;\n}\nvar CleanResponse, removalRegexp, dryRunRemovalRegexp, isFolderRegexp;\nvar init_CleanSummary = __esm({\n \"src/lib/responses/CleanSummary.ts\"() {\n \"use strict\";\n init_utils();\n CleanResponse = class {\n constructor(dryRun) {\n this.dryRun = dryRun;\n this.paths = [];\n this.files = [];\n this.folders = [];\n }\n };\n removalRegexp = /^[a-z]+\\s*/i;\n dryRunRemovalRegexp = /^[a-z]+\\s+[a-z]+\\s*/i;\n isFolderRegexp = /\\/$/;\n }\n});\n\n// src/lib/tasks/task.ts\nvar task_exports = {};\n__export(task_exports, {\n EMPTY_COMMANDS: () => EMPTY_COMMANDS,\n adhocExecTask: () => adhocExecTask,\n configurationErrorTask: () => configurationErrorTask,\n isBufferTask: () => isBufferTask,\n isEmptyTask: () => isEmptyTask,\n straightThroughBufferTask: () => straightThroughBufferTask,\n straightThroughStringTask: () => straightThroughStringTask\n});\nfunction adhocExecTask(parser4) {\n return {\n commands: EMPTY_COMMANDS,\n format: \"empty\",\n parser: parser4\n };\n}\nfunction configurationErrorTask(error) {\n return {\n commands: EMPTY_COMMANDS,\n format: \"empty\",\n parser() {\n throw typeof error === \"string\" ? new TaskConfigurationError(error) : error;\n }\n };\n}\nfunction straightThroughStringTask(commands, trimmed2 = false) {\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return trimmed2 ? String(text).trim() : text;\n }\n };\n}\nfunction straightThroughBufferTask(commands) {\n return {\n commands,\n format: \"buffer\",\n parser(buffer) {\n return buffer;\n }\n };\n}\nfunction isBufferTask(task) {\n return task.format === \"buffer\";\n}\nfunction isEmptyTask(task) {\n return task.format === \"empty\" || !task.commands.length;\n}\nvar EMPTY_COMMANDS;\nvar init_task = __esm({\n \"src/lib/tasks/task.ts\"() {\n \"use strict\";\n init_task_configuration_error();\n EMPTY_COMMANDS = [];\n }\n});\n\n// src/lib/tasks/clean.ts\nvar clean_exports = {};\n__export(clean_exports, {\n CONFIG_ERROR_INTERACTIVE_MODE: () => CONFIG_ERROR_INTERACTIVE_MODE,\n CONFIG_ERROR_MODE_REQUIRED: () => CONFIG_ERROR_MODE_REQUIRED,\n CONFIG_ERROR_UNKNOWN_OPTION: () => CONFIG_ERROR_UNKNOWN_OPTION,\n CleanOptions: () => CleanOptions,\n cleanTask: () => cleanTask,\n cleanWithOptionsTask: () => cleanWithOptionsTask,\n isCleanOptionsArray: () => isCleanOptionsArray\n});\nfunction cleanWithOptionsTask(mode, customArgs) {\n const { cleanMode, options, valid } = getCleanOptions(mode);\n if (!cleanMode) {\n return configurationErrorTask(CONFIG_ERROR_MODE_REQUIRED);\n }\n if (!valid.options) {\n return configurationErrorTask(CONFIG_ERROR_UNKNOWN_OPTION + JSON.stringify(mode));\n }\n options.push(...customArgs);\n if (options.some(isInteractiveMode)) {\n return configurationErrorTask(CONFIG_ERROR_INTERACTIVE_MODE);\n }\n return cleanTask(cleanMode, options);\n}\nfunction cleanTask(mode, customArgs) {\n const commands = [\"clean\", `-${mode}`, ...customArgs];\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return cleanSummaryParser(mode === \"n\" /* DRY_RUN */, text);\n }\n };\n}\nfunction isCleanOptionsArray(input) {\n return Array.isArray(input) && input.every((test) => CleanOptionValues.has(test));\n}\nfunction getCleanOptions(input) {\n let cleanMode;\n let options = [];\n let valid = { cleanMode: false, options: true };\n input.replace(/[^a-z]i/g, \"\").split(\"\").forEach((char) => {\n if (isCleanMode(char)) {\n cleanMode = char;\n valid.cleanMode = true;\n } else {\n valid.options = valid.options && isKnownOption(options[options.length] = `-${char}`);\n }\n });\n return {\n cleanMode,\n options,\n valid\n };\n}\nfunction isCleanMode(cleanMode) {\n return cleanMode === \"f\" /* FORCE */ || cleanMode === \"n\" /* DRY_RUN */;\n}\nfunction isKnownOption(option) {\n return /^-[a-z]$/i.test(option) && CleanOptionValues.has(option.charAt(1));\n}\nfunction isInteractiveMode(option) {\n if (/^-[^\\-]/.test(option)) {\n return option.indexOf(\"i\") > 0;\n }\n return option === \"--interactive\";\n}\nvar CONFIG_ERROR_INTERACTIVE_MODE, CONFIG_ERROR_MODE_REQUIRED, CONFIG_ERROR_UNKNOWN_OPTION, CleanOptions, CleanOptionValues;\nvar init_clean = __esm({\n \"src/lib/tasks/clean.ts\"() {\n \"use strict\";\n init_CleanSummary();\n init_utils();\n init_task();\n CONFIG_ERROR_INTERACTIVE_MODE = \"Git clean interactive mode is not supported\";\n CONFIG_ERROR_MODE_REQUIRED = 'Git clean mode parameter (\"n\" or \"f\") is required';\n CONFIG_ERROR_UNKNOWN_OPTION = \"Git clean unknown option found in: \";\n CleanOptions = /* @__PURE__ */ ((CleanOptions2) => {\n CleanOptions2[\"DRY_RUN\"] = \"n\";\n CleanOptions2[\"FORCE\"] = \"f\";\n CleanOptions2[\"IGNORED_INCLUDED\"] = \"x\";\n CleanOptions2[\"IGNORED_ONLY\"] = \"X\";\n CleanOptions2[\"EXCLUDING\"] = \"e\";\n CleanOptions2[\"QUIET\"] = \"q\";\n CleanOptions2[\"RECURSIVE\"] = \"d\";\n return CleanOptions2;\n })(CleanOptions || {});\n CleanOptionValues = /* @__PURE__ */ new Set([\n \"i\",\n ...asStringArray(Object.values(CleanOptions))\n ]);\n }\n});\n\n// src/lib/responses/ConfigList.ts\nfunction configListParser(text) {\n const config = new ConfigList();\n for (const item of configParser(text)) {\n config.addValue(item.file, String(item.key), item.value);\n }\n return config;\n}\nfunction configGetParser(text, key) {\n let value = null;\n const values = [];\n const scopes = /* @__PURE__ */ new Map();\n for (const item of configParser(text, key)) {\n if (item.key !== key) {\n continue;\n }\n values.push(value = item.value);\n if (!scopes.has(item.file)) {\n scopes.set(item.file, []);\n }\n scopes.get(item.file).push(value);\n }\n return {\n key,\n paths: Array.from(scopes.keys()),\n scopes,\n value,\n values\n };\n}\nfunction configFilePath(filePath) {\n return filePath.replace(/^(file):/, \"\");\n}\nfunction* configParser(text, requestedKey = null) {\n const lines = text.split(\"\\0\");\n for (let i = 0, max = lines.length - 1; i < max; ) {\n const file = configFilePath(lines[i++]);\n let value = lines[i++];\n let key = requestedKey;\n if (value.includes(\"\\n\")) {\n const line = splitOn(value, \"\\n\");\n key = line[0];\n value = line[1];\n }\n yield { file, key, value };\n }\n}\nvar ConfigList;\nvar init_ConfigList = __esm({\n \"src/lib/responses/ConfigList.ts\"() {\n \"use strict\";\n init_utils();\n ConfigList = class {\n constructor() {\n this.files = [];\n this.values = /* @__PURE__ */ Object.create(null);\n }\n get all() {\n if (!this._all) {\n this._all = this.files.reduce((all, file) => {\n return Object.assign(all, this.values[file]);\n }, {});\n }\n return this._all;\n }\n addFile(file) {\n if (!(file in this.values)) {\n const latest = last(this.files);\n this.values[file] = latest ? Object.create(this.values[latest]) : {};\n this.files.push(file);\n }\n return this.values[file];\n }\n addValue(file, key, value) {\n const values = this.addFile(file);\n if (!Object.hasOwn(values, key)) {\n values[key] = value;\n } else if (Array.isArray(values[key])) {\n values[key].push(value);\n } else {\n values[key] = [values[key], value];\n }\n this._all = void 0;\n }\n };\n }\n});\n\n// src/lib/tasks/config.ts\nfunction asConfigScope(scope, fallback) {\n if (typeof scope === \"string\" && Object.hasOwn(GitConfigScope, scope)) {\n return scope;\n }\n return fallback;\n}\nfunction addConfigTask(key, value, append2, scope) {\n const commands = [\"config\", `--${scope}`];\n if (append2) {\n commands.push(\"--add\");\n }\n commands.push(key, value);\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return text;\n }\n };\n}\nfunction getConfigTask(key, scope) {\n const commands = [\"config\", \"--null\", \"--show-origin\", \"--get-all\", key];\n if (scope) {\n commands.splice(1, 0, `--${scope}`);\n }\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return configGetParser(text, key);\n }\n };\n}\nfunction listConfigTask(scope) {\n const commands = [\"config\", \"--list\", \"--show-origin\", \"--null\"];\n if (scope) {\n commands.push(`--${scope}`);\n }\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return configListParser(text);\n }\n };\n}\nfunction config_default() {\n return {\n addConfig(key, value, ...rest) {\n return this._runTask(\n addConfigTask(\n key,\n value,\n rest[0] === true,\n asConfigScope(rest[1], \"local\" /* local */)\n ),\n trailingFunctionArgument(arguments)\n );\n },\n getConfig(key, scope) {\n return this._runTask(\n getConfigTask(key, asConfigScope(scope, void 0)),\n trailingFunctionArgument(arguments)\n );\n },\n listConfig(...rest) {\n return this._runTask(\n listConfigTask(asConfigScope(rest[0], void 0)),\n trailingFunctionArgument(arguments)\n );\n }\n };\n}\nvar GitConfigScope;\nvar init_config = __esm({\n \"src/lib/tasks/config.ts\"() {\n \"use strict\";\n init_ConfigList();\n init_utils();\n GitConfigScope = /* @__PURE__ */ ((GitConfigScope2) => {\n GitConfigScope2[\"system\"] = \"system\";\n GitConfigScope2[\"global\"] = \"global\";\n GitConfigScope2[\"local\"] = \"local\";\n GitConfigScope2[\"worktree\"] = \"worktree\";\n return GitConfigScope2;\n })(GitConfigScope || {});\n }\n});\n\n// src/lib/tasks/diff-name-status.ts\nfunction isDiffNameStatus(input) {\n return diffNameStatus.has(input);\n}\nvar DiffNameStatus, diffNameStatus;\nvar init_diff_name_status = __esm({\n \"src/lib/tasks/diff-name-status.ts\"() {\n \"use strict\";\n DiffNameStatus = /* @__PURE__ */ ((DiffNameStatus2) => {\n DiffNameStatus2[\"ADDED\"] = \"A\";\n DiffNameStatus2[\"COPIED\"] = \"C\";\n DiffNameStatus2[\"DELETED\"] = \"D\";\n DiffNameStatus2[\"MODIFIED\"] = \"M\";\n DiffNameStatus2[\"RENAMED\"] = \"R\";\n DiffNameStatus2[\"CHANGED\"] = \"T\";\n DiffNameStatus2[\"UNMERGED\"] = \"U\";\n DiffNameStatus2[\"UNKNOWN\"] = \"X\";\n DiffNameStatus2[\"BROKEN\"] = \"B\";\n return DiffNameStatus2;\n })(DiffNameStatus || {});\n diffNameStatus = new Set(Object.values(DiffNameStatus));\n }\n});\n\n// src/lib/tasks/grep.ts\nfunction grepQueryBuilder(...params) {\n return new GrepQuery().param(...params);\n}\nfunction parseGrep(grep) {\n const paths = /* @__PURE__ */ new Set();\n const results = {};\n forEachLineWithContent(grep, (input) => {\n const [path, line, preview] = input.split(NULL);\n paths.add(path);\n (results[path] = results[path] || []).push({\n line: asNumber(line),\n path,\n preview\n });\n });\n return {\n paths,\n results\n };\n}\nfunction grep_default() {\n return {\n grep(searchTerm) {\n const then = trailingFunctionArgument(arguments);\n const options = getTrailingOptions(arguments);\n for (const option of disallowedOptions) {\n if (options.includes(option)) {\n return this._runTask(\n configurationErrorTask(`git.grep: use of \"${option}\" is not supported.`),\n then\n );\n }\n }\n if (typeof searchTerm === \"string\") {\n searchTerm = grepQueryBuilder().param(searchTerm);\n }\n const commands = [\"grep\", \"--null\", \"-n\", \"--full-name\", ...options, ...searchTerm];\n return this._runTask(\n {\n commands,\n format: \"utf-8\",\n parser(stdOut) {\n return parseGrep(stdOut);\n }\n },\n then\n );\n }\n };\n}\nvar disallowedOptions, Query, _a, GrepQuery;\nvar init_grep = __esm({\n \"src/lib/tasks/grep.ts\"() {\n \"use strict\";\n init_utils();\n init_task();\n disallowedOptions = [\"-h\"];\n Query = Symbol(\"grepQuery\");\n GrepQuery = class {\n constructor() {\n this[_a] = [];\n }\n *[(_a = Query, Symbol.iterator)]() {\n for (const query of this[Query]) {\n yield query;\n }\n }\n and(...and) {\n and.length && this[Query].push(\"--and\", \"(\", ...prefixedArray(and, \"-e\"), \")\");\n return this;\n }\n param(...param) {\n this[Query].push(...prefixedArray(param, \"-e\"));\n return this;\n }\n };\n }\n});\n\n// src/lib/tasks/reset.ts\nvar reset_exports = {};\n__export(reset_exports, {\n ResetMode: () => ResetMode,\n getResetMode: () => getResetMode,\n resetTask: () => resetTask\n});\nfunction resetTask(mode, customArgs) {\n const commands = [\"reset\"];\n if (isValidResetMode(mode)) {\n commands.push(`--${mode}`);\n }\n commands.push(...customArgs);\n return straightThroughStringTask(commands);\n}\nfunction getResetMode(mode) {\n if (isValidResetMode(mode)) {\n return mode;\n }\n switch (typeof mode) {\n case \"string\":\n case \"undefined\":\n return \"soft\" /* SOFT */;\n }\n return;\n}\nfunction isValidResetMode(mode) {\n return typeof mode === \"string\" && validResetModes.includes(mode);\n}\nvar ResetMode, validResetModes;\nvar init_reset = __esm({\n \"src/lib/tasks/reset.ts\"() {\n \"use strict\";\n init_utils();\n init_task();\n ResetMode = /* @__PURE__ */ ((ResetMode2) => {\n ResetMode2[\"MIXED\"] = \"mixed\";\n ResetMode2[\"SOFT\"] = \"soft\";\n ResetMode2[\"HARD\"] = \"hard\";\n ResetMode2[\"MERGE\"] = \"merge\";\n ResetMode2[\"KEEP\"] = \"keep\";\n return ResetMode2;\n })(ResetMode || {});\n validResetModes = asStringArray(Object.values(ResetMode));\n }\n});\n\n// src/lib/git-logger.ts\nimport debug from \"debug\";\nfunction createLog() {\n return debug(\"simple-git\");\n}\nfunction prefixedLogger(to, prefix, forward) {\n if (!prefix || !String(prefix).replace(/\\s*/, \"\")) {\n return !forward ? to : (message, ...args) => {\n to(message, ...args);\n forward(message, ...args);\n };\n }\n return (message, ...args) => {\n to(`%s ${message}`, prefix, ...args);\n if (forward) {\n forward(message, ...args);\n }\n };\n}\nfunction childLoggerName(name, childDebugger, { namespace: parentNamespace }) {\n if (typeof name === \"string\") {\n return name;\n }\n const childNamespace = childDebugger && childDebugger.namespace || \"\";\n if (childNamespace.startsWith(parentNamespace)) {\n return childNamespace.substr(parentNamespace.length + 1);\n }\n return childNamespace || parentNamespace;\n}\nfunction createLogger(label, verbose, initialStep, infoDebugger = createLog()) {\n const labelPrefix = label && `[${label}]` || \"\";\n const spawned = [];\n const debugDebugger = typeof verbose === \"string\" ? infoDebugger.extend(verbose) : verbose;\n const key = childLoggerName(filterType(verbose, filterString), debugDebugger, infoDebugger);\n return step(initialStep);\n function sibling(name, initial) {\n return append(\n spawned,\n createLogger(label, key.replace(/^[^:]+/, name), initial, infoDebugger)\n );\n }\n function step(phase) {\n const stepPrefix = phase && `[${phase}]` || \"\";\n const debug2 = debugDebugger && prefixedLogger(debugDebugger, stepPrefix) || NOOP;\n const info = prefixedLogger(infoDebugger, `${labelPrefix} ${stepPrefix}`, debug2);\n return Object.assign(debugDebugger ? debug2 : info, {\n label,\n sibling,\n info,\n step\n });\n }\n}\nvar init_git_logger = __esm({\n \"src/lib/git-logger.ts\"() {\n \"use strict\";\n init_utils();\n debug.formatters.L = (value) => String(filterHasLength(value) ? value.length : \"-\");\n debug.formatters.B = (value) => {\n if (Buffer.isBuffer(value)) {\n return value.toString(\"utf8\");\n }\n return objectToString(value);\n };\n }\n});\n\n// src/lib/runners/tasks-pending-queue.ts\nvar TasksPendingQueue;\nvar init_tasks_pending_queue = __esm({\n \"src/lib/runners/tasks-pending-queue.ts\"() {\n \"use strict\";\n init_git_error();\n init_git_logger();\n TasksPendingQueue = class _TasksPendingQueue {\n constructor(logLabel = \"GitExecutor\") {\n this.logLabel = logLabel;\n this._queue = /* @__PURE__ */ new Map();\n }\n withProgress(task) {\n return this._queue.get(task);\n }\n createProgress(task) {\n const name = _TasksPendingQueue.getName(task.commands[0]);\n const logger = createLogger(this.logLabel, name);\n return {\n task,\n logger,\n name\n };\n }\n push(task) {\n const progress = this.createProgress(task);\n progress.logger(\"Adding task to the queue, commands = %o\", task.commands);\n this._queue.set(task, progress);\n return progress;\n }\n fatal(err) {\n for (const [task, { logger }] of Array.from(this._queue.entries())) {\n if (task === err.task) {\n logger.info(`Failed %o`, err);\n logger(\n `Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`\n );\n } else {\n logger.info(\n `A fatal exception occurred in a previous task, the queue has been purged: %o`,\n err.message\n );\n }\n this.complete(task);\n }\n if (this._queue.size !== 0) {\n throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`);\n }\n }\n complete(task) {\n const progress = this.withProgress(task);\n if (progress) {\n this._queue.delete(task);\n }\n }\n attempt(task) {\n const progress = this.withProgress(task);\n if (!progress) {\n throw new GitError(void 0, \"TasksPendingQueue: attempt called for an unknown task\");\n }\n progress.logger(\"Starting task\");\n return progress;\n }\n static getName(name = \"empty\") {\n return `task:${name}:${++_TasksPendingQueue.counter}`;\n }\n static {\n this.counter = 0;\n }\n };\n }\n});\n\n// src/lib/runners/git-executor-chain.ts\nimport { spawn } from \"child_process\";\nfunction pluginContext(task, commands) {\n return {\n method: first(task.commands) || \"\",\n commands\n };\n}\nfunction onErrorReceived(target, logger) {\n return (err) => {\n logger(`[ERROR] child process exception %o`, err);\n target.push(Buffer.from(String(err.stack), \"ascii\"));\n };\n}\nfunction onDataReceived(target, name, logger, output) {\n return (buffer) => {\n logger(`%s received %L bytes`, name, buffer);\n output(`%B`, buffer);\n target.push(buffer);\n };\n}\nvar GitExecutorChain;\nvar init_git_executor_chain = __esm({\n \"src/lib/runners/git-executor-chain.ts\"() {\n \"use strict\";\n init_git_error();\n init_task();\n init_utils();\n init_tasks_pending_queue();\n GitExecutorChain = class {\n constructor(_executor, _scheduler, _plugins) {\n this._executor = _executor;\n this._scheduler = _scheduler;\n this._plugins = _plugins;\n this._chain = Promise.resolve();\n this._queue = new TasksPendingQueue();\n }\n get cwd() {\n return this._cwd || this._executor.cwd;\n }\n set cwd(cwd) {\n this._cwd = cwd;\n }\n get env() {\n return this._executor.env;\n }\n get outputHandler() {\n return this._executor.outputHandler;\n }\n chain() {\n return this;\n }\n push(task) {\n this._queue.push(task);\n return this._chain = this._chain.then(() => this.attemptTask(task));\n }\n async attemptTask(task) {\n const onScheduleComplete = await this._scheduler.next();\n const onQueueComplete = () => this._queue.complete(task);\n try {\n const { logger } = this._queue.attempt(task);\n return await (isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger));\n } catch (e) {\n throw this.onFatalException(task, e);\n } finally {\n onQueueComplete();\n onScheduleComplete();\n }\n }\n onFatalException(task, e) {\n const gitError = e instanceof GitError ? Object.assign(e, { task }) : new GitError(task, e && String(e));\n this._chain = Promise.resolve();\n this._queue.fatal(gitError);\n return gitError;\n }\n async attemptRemoteTask(task, logger) {\n const binary = this._plugins.exec(\"spawn.binary\", \"\", pluginContext(task, task.commands));\n const args = this._plugins.exec(\"spawn.args\", [...task.commands], {\n ...pluginContext(task, task.commands),\n env: { ...this.env }\n });\n const raw = await this.gitResponse(\n task,\n binary,\n args,\n this.outputHandler,\n logger.step(\"SPAWN\")\n );\n const outputStreams = await this.handleTaskData(task, args, raw, logger.step(\"HANDLE\"));\n logger(`passing response to task's parser as a %s`, task.format);\n if (isBufferTask(task)) {\n return callTaskParser(task.parser, outputStreams);\n }\n return callTaskParser(task.parser, outputStreams.asStrings());\n }\n async attemptEmptyTask(task, logger) {\n logger(`empty task bypassing child process to call to task's parser`);\n return task.parser(this);\n }\n handleTaskData(task, args, result, logger) {\n const { exitCode, rejection, stdOut, stdErr } = result;\n return new Promise((done, fail) => {\n logger(`Preparing to handle process response exitCode=%d stdOut=`, exitCode);\n const { error } = this._plugins.exec(\n \"task.error\",\n { error: rejection },\n {\n ...pluginContext(task, args),\n ...result\n }\n );\n if (error && task.onError) {\n logger.info(`exitCode=%s handling with custom error handler`);\n return task.onError(\n result,\n error,\n (newStdOut) => {\n logger.info(`custom error handler treated as success`);\n logger(`custom error returned a %s`, objectToString(newStdOut));\n done(\n new GitOutputStreams(\n Array.isArray(newStdOut) ? Buffer.concat(newStdOut) : newStdOut,\n Buffer.concat(stdErr)\n )\n );\n },\n fail\n );\n }\n if (error) {\n logger.info(\n `handling as error: exitCode=%s stdErr=%s rejection=%o`,\n exitCode,\n stdErr.length,\n rejection\n );\n return fail(error);\n }\n logger.info(`retrieving task output complete`);\n done(new GitOutputStreams(Buffer.concat(stdOut), Buffer.concat(stdErr)));\n });\n }\n async gitResponse(task, command, args, outputHandler, logger) {\n const outputLogger = logger.sibling(\"output\");\n const spawnOptions = this._plugins.exec(\n \"spawn.options\",\n {\n cwd: this.cwd,\n env: this.env,\n windowsHide: true\n },\n pluginContext(task, task.commands)\n );\n return new Promise((done) => {\n const stdOut = [];\n const stdErr = [];\n logger.info(`%s %o`, command, args);\n logger(\"%O\", spawnOptions);\n let rejection = this._beforeSpawn(task, args);\n if (rejection) {\n return done({\n stdOut,\n stdErr,\n exitCode: 9901,\n rejection\n });\n }\n this._plugins.exec(\"spawn.before\", void 0, {\n ...pluginContext(task, args),\n kill(reason) {\n rejection = reason || rejection;\n }\n });\n const spawned = spawn(command, args, spawnOptions);\n spawned.stdout.on(\n \"data\",\n onDataReceived(stdOut, \"stdOut\", logger, outputLogger.step(\"stdOut\"))\n );\n spawned.stderr.on(\n \"data\",\n onDataReceived(stdErr, \"stdErr\", logger, outputLogger.step(\"stdErr\"))\n );\n spawned.on(\"error\", onErrorReceived(stdErr, logger));\n if (outputHandler) {\n logger(`Passing child process stdOut/stdErr to custom outputHandler`);\n outputHandler(command, spawned.stdout, spawned.stderr, [...args]);\n }\n this._plugins.exec(\"spawn.after\", void 0, {\n ...pluginContext(task, args),\n spawned,\n close(exitCode, reason) {\n done({\n stdOut,\n stdErr,\n exitCode,\n rejection: rejection || reason\n });\n },\n kill(reason) {\n if (spawned.killed) {\n return;\n }\n rejection = reason;\n spawned.kill(\"SIGINT\");\n }\n });\n });\n }\n _beforeSpawn(task, args) {\n let rejection;\n this._plugins.exec(\"spawn.before\", void 0, {\n ...pluginContext(task, args),\n kill(reason) {\n rejection = reason || rejection;\n }\n });\n return rejection;\n }\n };\n }\n});\n\n// src/lib/runners/git-executor.ts\nvar git_executor_exports = {};\n__export(git_executor_exports, {\n GitExecutor: () => GitExecutor\n});\nvar GitExecutor;\nvar init_git_executor = __esm({\n \"src/lib/runners/git-executor.ts\"() {\n \"use strict\";\n init_git_executor_chain();\n GitExecutor = class {\n constructor(cwd, _scheduler, _plugins) {\n this.cwd = cwd;\n this._scheduler = _scheduler;\n this._plugins = _plugins;\n this._chain = new GitExecutorChain(this, this._scheduler, this._plugins);\n }\n chain() {\n return new GitExecutorChain(this, this._scheduler, this._plugins);\n }\n push(task) {\n return this._chain.push(task);\n }\n };\n }\n});\n\n// src/lib/task-callback.ts\nfunction taskCallback(task, response, callback = NOOP) {\n const onSuccess = (data) => {\n callback(null, data);\n };\n const onError2 = (err) => {\n if (err?.task === task) {\n callback(\n err instanceof GitResponseError ? addDeprecationNoticeToError(err) : err,\n void 0\n );\n }\n };\n response.then(onSuccess, onError2);\n}\nfunction addDeprecationNoticeToError(err) {\n let log = (name) => {\n console.warn(\n `simple-git deprecation notice: accessing GitResponseError.${name} should be GitResponseError.git.${name}, this will no longer be available in version 3`\n );\n log = NOOP;\n };\n return Object.create(err, Object.getOwnPropertyNames(err.git).reduce(descriptorReducer, {}));\n function descriptorReducer(all, name) {\n if (name in err) {\n return all;\n }\n all[name] = {\n enumerable: false,\n configurable: false,\n get() {\n log(name);\n return err.git[name];\n }\n };\n return all;\n }\n}\nvar init_task_callback = __esm({\n \"src/lib/task-callback.ts\"() {\n \"use strict\";\n init_git_response_error();\n init_utils();\n }\n});\n\n// src/lib/tasks/change-working-directory.ts\nfunction changeWorkingDirectoryTask(directory, root) {\n return adhocExecTask((instance) => {\n if (!folderExists(directory)) {\n throw new Error(`Git.cwd: cannot change to non-directory \"${directory}\"`);\n }\n return (root || instance).cwd = directory;\n });\n}\nvar init_change_working_directory = __esm({\n \"src/lib/tasks/change-working-directory.ts\"() {\n \"use strict\";\n init_utils();\n init_task();\n }\n});\n\n// src/lib/tasks/checkout.ts\nfunction checkoutTask(args) {\n const commands = [\"checkout\", ...args];\n if (commands[1] === \"-b\" && commands.includes(\"-B\")) {\n commands[1] = remove(commands, \"-B\");\n }\n return straightThroughStringTask(commands);\n}\nfunction checkout_default() {\n return {\n checkout() {\n return this._runTask(\n checkoutTask(getTrailingOptions(arguments, 1)),\n trailingFunctionArgument(arguments)\n );\n },\n checkoutBranch(branchName, startPoint) {\n return this._runTask(\n checkoutTask([\"-b\", branchName, startPoint, ...getTrailingOptions(arguments)]),\n trailingFunctionArgument(arguments)\n );\n },\n checkoutLocalBranch(branchName) {\n return this._runTask(\n checkoutTask([\"-b\", branchName, ...getTrailingOptions(arguments)]),\n trailingFunctionArgument(arguments)\n );\n }\n };\n}\nvar init_checkout = __esm({\n \"src/lib/tasks/checkout.ts\"() {\n \"use strict\";\n init_utils();\n init_task();\n }\n});\n\n// src/lib/tasks/count-objects.ts\nfunction countObjectsResponse() {\n return {\n count: 0,\n garbage: 0,\n inPack: 0,\n packs: 0,\n prunePackable: 0,\n size: 0,\n sizeGarbage: 0,\n sizePack: 0\n };\n}\nfunction count_objects_default() {\n return {\n countObjects() {\n return this._runTask({\n commands: [\"count-objects\", \"--verbose\"],\n format: \"utf-8\",\n parser(stdOut) {\n return parseStringResponse(countObjectsResponse(), [parser2], stdOut);\n }\n });\n }\n };\n}\nvar parser2;\nvar init_count_objects = __esm({\n \"src/lib/tasks/count-objects.ts\"() {\n \"use strict\";\n init_utils();\n parser2 = new LineParser(\n /([a-z-]+): (\\d+)$/,\n (result, [key, value]) => {\n const property = asCamelCase(key);\n if (Object.hasOwn(result, property)) {\n result[property] = asNumber(value);\n }\n }\n );\n }\n});\n\n// src/lib/parsers/parse-commit.ts\nfunction parseCommitResult(stdOut) {\n const result = {\n author: null,\n branch: \"\",\n commit: \"\",\n root: false,\n summary: {\n changes: 0,\n insertions: 0,\n deletions: 0\n }\n };\n return parseStringResponse(result, parsers, stdOut);\n}\nvar parsers;\nvar init_parse_commit = __esm({\n \"src/lib/parsers/parse-commit.ts\"() {\n \"use strict\";\n init_utils();\n parsers = [\n new LineParser(/^\\[([^\\s]+)( \\([^)]+\\))? ([^\\]]+)/, (result, [branch, root, commit]) => {\n result.branch = branch;\n result.commit = commit;\n result.root = !!root;\n }),\n new LineParser(/\\s*Author:\\s(.+)/i, (result, [author]) => {\n const parts = author.split(\"<\");\n const email = parts.pop();\n if (!email || !email.includes(\"@\")) {\n return;\n }\n result.author = {\n email: email.substr(0, email.length - 1),\n name: parts.join(\"<\").trim()\n };\n }),\n new LineParser(\n /(\\d+)[^,]*(?:,\\s*(\\d+)[^,]*)(?:,\\s*(\\d+))/g,\n (result, [changes, insertions, deletions]) => {\n result.summary.changes = parseInt(changes, 10) || 0;\n result.summary.insertions = parseInt(insertions, 10) || 0;\n result.summary.deletions = parseInt(deletions, 10) || 0;\n }\n ),\n new LineParser(\n /^(\\d+)[^,]*(?:,\\s*(\\d+)[^(]+\\(([+-]))?/,\n (result, [changes, lines, direction]) => {\n result.summary.changes = parseInt(changes, 10) || 0;\n const count = parseInt(lines, 10) || 0;\n if (direction === \"-\") {\n result.summary.deletions = count;\n } else if (direction === \"+\") {\n result.summary.insertions = count;\n }\n }\n )\n ];\n }\n});\n\n// src/lib/tasks/commit.ts\nfunction commitTask(message, files, customArgs) {\n const commands = [\n \"-c\",\n \"core.abbrev=40\",\n \"commit\",\n ...prefixedArray(message, \"-m\"),\n ...files,\n ...customArgs\n ];\n return {\n commands,\n format: \"utf-8\",\n parser: parseCommitResult\n };\n}\nfunction commit_default() {\n return {\n commit(message, ...rest) {\n const next = trailingFunctionArgument(arguments);\n const task = rejectDeprecatedSignatures(message) || commitTask(\n asArray(message),\n asArray(filterType(rest[0], filterStringOrStringArray, [])),\n [\n ...asStringArray(filterType(rest[1], filterArray, [])),\n ...getTrailingOptions(arguments, 0, true)\n ]\n );\n return this._runTask(task, next);\n }\n };\n function rejectDeprecatedSignatures(message) {\n return !filterStringOrStringArray(message) && configurationErrorTask(\n `git.commit: requires the commit message to be supplied as a string/string[]`\n );\n }\n}\nvar init_commit = __esm({\n \"src/lib/tasks/commit.ts\"() {\n \"use strict\";\n init_parse_commit();\n init_utils();\n init_task();\n }\n});\n\n// src/lib/tasks/first-commit.ts\nfunction first_commit_default() {\n return {\n firstCommit() {\n return this._runTask(\n straightThroughStringTask([\"rev-list\", \"--max-parents=0\", \"HEAD\"], true),\n trailingFunctionArgument(arguments)\n );\n }\n };\n}\nvar init_first_commit = __esm({\n \"src/lib/tasks/first-commit.ts\"() {\n \"use strict\";\n init_utils();\n init_task();\n }\n});\n\n// src/lib/tasks/hash-object.ts\nfunction hashObjectTask(filePath, write) {\n const commands = [\"hash-object\", filePath];\n if (write) {\n commands.push(\"-w\");\n }\n return straightThroughStringTask(commands, true);\n}\nvar init_hash_object = __esm({\n \"src/lib/tasks/hash-object.ts\"() {\n \"use strict\";\n init_task();\n }\n});\n\n// src/lib/responses/InitSummary.ts\nfunction parseInit(bare, path, text) {\n const response = String(text).trim();\n let result;\n if (result = initResponseRegex.exec(response)) {\n return new InitSummary(bare, path, false, result[1]);\n }\n if (result = reInitResponseRegex.exec(response)) {\n return new InitSummary(bare, path, true, result[1]);\n }\n let gitDir = \"\";\n const tokens = response.split(\" \");\n while (tokens.length) {\n const token = tokens.shift();\n if (token === \"in\") {\n gitDir = tokens.join(\" \");\n break;\n }\n }\n return new InitSummary(bare, path, /^re/i.test(response), gitDir);\n}\nvar InitSummary, initResponseRegex, reInitResponseRegex;\nvar init_InitSummary = __esm({\n \"src/lib/responses/InitSummary.ts\"() {\n \"use strict\";\n InitSummary = class {\n constructor(bare, path, existing, gitDir) {\n this.bare = bare;\n this.path = path;\n this.existing = existing;\n this.gitDir = gitDir;\n }\n };\n initResponseRegex = /^Init.+ repository in (.+)$/;\n reInitResponseRegex = /^Rein.+ in (.+)$/;\n }\n});\n\n// src/lib/tasks/init.ts\nfunction hasBareCommand(command) {\n return command.includes(bareCommand);\n}\nfunction initTask(bare = false, path, customArgs) {\n const commands = [\"init\", ...customArgs];\n if (bare && !hasBareCommand(commands)) {\n commands.splice(1, 0, bareCommand);\n }\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return parseInit(commands.includes(\"--bare\"), path, text);\n }\n };\n}\nvar bareCommand;\nvar init_init = __esm({\n \"src/lib/tasks/init.ts\"() {\n \"use strict\";\n init_InitSummary();\n bareCommand = \"--bare\";\n }\n});\n\n// src/lib/args/log-format.ts\nfunction logFormatFromCommand(customArgs) {\n for (let i = 0; i < customArgs.length; i++) {\n const format = logFormatRegex.exec(customArgs[i]);\n if (format) {\n return `--${format[1]}`;\n }\n }\n return \"\" /* NONE */;\n}\nfunction isLogFormat(customArg) {\n return logFormatRegex.test(customArg);\n}\nvar logFormatRegex;\nvar init_log_format = __esm({\n \"src/lib/args/log-format.ts\"() {\n \"use strict\";\n logFormatRegex = /^--(stat|numstat|name-only|name-status)(=|$)/;\n }\n});\n\n// src/lib/responses/DiffSummary.ts\nvar DiffSummary;\nvar init_DiffSummary = __esm({\n \"src/lib/responses/DiffSummary.ts\"() {\n \"use strict\";\n DiffSummary = class {\n constructor() {\n this.changed = 0;\n this.deletions = 0;\n this.insertions = 0;\n this.files = [];\n }\n };\n }\n});\n\n// src/lib/parsers/parse-diff-summary.ts\nfunction getDiffParser(format = \"\" /* NONE */) {\n const parser4 = diffSummaryParsers[format];\n return (stdOut) => parseStringResponse(new DiffSummary(), parser4, stdOut, false);\n}\nvar statParser, numStatParser, nameOnlyParser, nameStatusParser, diffSummaryParsers;\nvar init_parse_diff_summary = __esm({\n \"src/lib/parsers/parse-diff-summary.ts\"() {\n \"use strict\";\n init_log_format();\n init_DiffSummary();\n init_diff_name_status();\n init_utils();\n statParser = [\n new LineParser(\n /^(.+)\\s+\\|\\s+(\\d+)(\\s+[+\\-]+)?$/,\n (result, [file, changes, alterations = \"\"]) => {\n result.files.push({\n file: file.trim(),\n changes: asNumber(changes),\n insertions: alterations.replace(/[^+]/g, \"\").length,\n deletions: alterations.replace(/[^-]/g, \"\").length,\n binary: false\n });\n }\n ),\n new LineParser(\n /^(.+) \\|\\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,\n (result, [file, before, after]) => {\n result.files.push({\n file: file.trim(),\n before: asNumber(before),\n after: asNumber(after),\n binary: true\n });\n }\n ),\n new LineParser(\n /(\\d+) files? changed\\s*((?:, \\d+ [^,]+){0,2})/,\n (result, [changed, summary]) => {\n const inserted = /(\\d+) i/.exec(summary);\n const deleted = /(\\d+) d/.exec(summary);\n result.changed = asNumber(changed);\n result.insertions = asNumber(inserted?.[1]);\n result.deletions = asNumber(deleted?.[1]);\n }\n )\n ];\n numStatParser = [\n new LineParser(\n /(\\d+)\\t(\\d+)\\t(.+)$/,\n (result, [changesInsert, changesDelete, file]) => {\n const insertions = asNumber(changesInsert);\n const deletions = asNumber(changesDelete);\n result.changed++;\n result.insertions += insertions;\n result.deletions += deletions;\n result.files.push({\n file,\n changes: insertions + deletions,\n insertions,\n deletions,\n binary: false\n });\n }\n ),\n new LineParser(/-\\t-\\t(.+)$/, (result, [file]) => {\n result.changed++;\n result.files.push({\n file,\n after: 0,\n before: 0,\n binary: true\n });\n })\n ];\n nameOnlyParser = [\n new LineParser(/(.+)$/, (result, [file]) => {\n result.changed++;\n result.files.push({\n file,\n changes: 0,\n insertions: 0,\n deletions: 0,\n binary: false\n });\n })\n ];\n nameStatusParser = [\n new LineParser(\n /([ACDMRTUXB])([0-9]{0,3})\\t(.[^\\t]*)(\\t(.[^\\t]*))?$/,\n (result, [status, similarity, from, _to, to]) => {\n result.changed++;\n result.files.push({\n file: to ?? from,\n changes: 0,\n insertions: 0,\n deletions: 0,\n binary: false,\n status: orVoid(isDiffNameStatus(status) && status),\n from: orVoid(!!to && from !== to && from),\n similarity: asNumber(similarity)\n });\n }\n )\n ];\n diffSummaryParsers = {\n [\"\" /* NONE */]: statParser,\n [\"--stat\" /* STAT */]: statParser,\n [\"--numstat\" /* NUM_STAT */]: numStatParser,\n [\"--name-status\" /* NAME_STATUS */]: nameStatusParser,\n [\"--name-only\" /* NAME_ONLY */]: nameOnlyParser\n };\n }\n});\n\n// src/lib/parsers/parse-list-log-summary.ts\nfunction lineBuilder(tokens, fields) {\n return fields.reduce(\n (line, field, index) => {\n line[field] = tokens[index] || \"\";\n return line;\n },\n /* @__PURE__ */ Object.create({ diff: null })\n );\n}\nfunction createListLogSummaryParser(splitter = SPLITTER, fields = defaultFieldNames, logFormat = \"\" /* NONE */) {\n const parseDiffResult = getDiffParser(logFormat);\n return function(stdOut) {\n const all = toLinesWithContent(\n stdOut.trim(),\n false,\n START_BOUNDARY\n ).map(function(item) {\n const lineDetail = item.split(COMMIT_BOUNDARY);\n const listLogLine = lineBuilder(lineDetail[0].split(splitter), fields);\n if (lineDetail.length > 1 && !!lineDetail[1].trim()) {\n listLogLine.diff = parseDiffResult(lineDetail[1]);\n }\n return listLogLine;\n });\n return {\n all,\n latest: all.length && all[0] || null,\n total: all.length\n };\n };\n}\nvar START_BOUNDARY, COMMIT_BOUNDARY, SPLITTER, defaultFieldNames;\nvar init_parse_list_log_summary = __esm({\n \"src/lib/parsers/parse-list-log-summary.ts\"() {\n \"use strict\";\n init_utils();\n init_parse_diff_summary();\n init_log_format();\n START_BOUNDARY = \"\\xF2\\xF2\\xF2\\xF2\\xF2\\xF2 \";\n COMMIT_BOUNDARY = \" \\xF2\\xF2\";\n SPLITTER = \" \\xF2 \";\n defaultFieldNames = [\"hash\", \"date\", \"message\", \"refs\", \"author_name\", \"author_email\"];\n }\n});\n\n// src/lib/tasks/diff.ts\nvar diff_exports = {};\n__export(diff_exports, {\n diffSummaryTask: () => diffSummaryTask,\n validateLogFormatConfig: () => validateLogFormatConfig\n});\nfunction diffSummaryTask(customArgs) {\n let logFormat = logFormatFromCommand(customArgs);\n const commands = [\"diff\"];\n if (logFormat === \"\" /* NONE */) {\n logFormat = \"--stat\" /* STAT */;\n commands.push(\"--stat=4096\");\n }\n commands.push(...customArgs);\n return validateLogFormatConfig(commands) || {\n commands,\n format: \"utf-8\",\n parser: getDiffParser(logFormat)\n };\n}\nfunction validateLogFormatConfig(customArgs) {\n const flags = customArgs.filter(isLogFormat);\n if (flags.length > 1) {\n return configurationErrorTask(\n `Summary flags are mutually exclusive - pick one of ${flags.join(\",\")}`\n );\n }\n if (flags.length && customArgs.includes(\"-z\")) {\n return configurationErrorTask(\n `Summary flag ${flags} parsing is not compatible with null termination option '-z'`\n );\n }\n}\nvar init_diff = __esm({\n \"src/lib/tasks/diff.ts\"() {\n \"use strict\";\n init_log_format();\n init_parse_diff_summary();\n init_task();\n }\n});\n\n// src/lib/tasks/log.ts\nimport { pathspec as pathspec2 } from \"@simple-git/args-pathspec\";\nfunction prettyFormat(format, splitter) {\n const fields = [];\n const formatStr = [];\n Object.keys(format).forEach((field) => {\n fields.push(field);\n formatStr.push(String(format[field]));\n });\n return [fields, formatStr.join(splitter)];\n}\nfunction userOptions(input) {\n return Object.keys(input).reduce((out, key) => {\n if (!(key in excludeOptions)) {\n out[key] = input[key];\n }\n return out;\n }, {});\n}\nfunction parseLogOptions(opt = {}, customArgs = []) {\n const splitter = filterType(opt.splitter, filterString, SPLITTER);\n const format = filterPlainObject(opt.format) ? opt.format : {\n hash: \"%H\",\n date: opt.strictDate === false ? \"%ai\" : \"%aI\",\n message: \"%s\",\n refs: \"%D\",\n body: opt.multiLine ? \"%B\" : \"%b\",\n author_name: opt.mailMap !== false ? \"%aN\" : \"%an\",\n author_email: opt.mailMap !== false ? \"%aE\" : \"%ae\"\n };\n const [fields, formatStr] = prettyFormat(format, splitter);\n const suffix = [];\n const command = [\n `--pretty=format:${START_BOUNDARY}${formatStr}${COMMIT_BOUNDARY}`,\n ...customArgs\n ];\n const maxCount = opt.n || opt[\"max-count\"] || opt.maxCount;\n if (maxCount) {\n command.push(`--max-count=${maxCount}`);\n }\n if (opt.from || opt.to) {\n const rangeOperator = opt.symmetric !== false ? \"...\" : \"..\";\n suffix.push(`${opt.from || \"\"}${rangeOperator}${opt.to || \"\"}`);\n }\n if (filterString(opt.file)) {\n command.push(\"--follow\", pathspec2(opt.file));\n }\n appendTaskOptions(userOptions(opt), command);\n return {\n fields,\n splitter,\n commands: [...command, ...suffix]\n };\n}\nfunction logTask(splitter, fields, customArgs) {\n const parser4 = createListLogSummaryParser(splitter, fields, logFormatFromCommand(customArgs));\n return {\n commands: [\"log\", ...customArgs],\n format: \"utf-8\",\n parser: parser4\n };\n}\nfunction log_default() {\n return {\n log(...rest) {\n const next = trailingFunctionArgument(arguments);\n const options = parseLogOptions(\n trailingOptionsArgument(arguments),\n asStringArray(filterType(arguments[0], filterArray, []))\n );\n const task = rejectDeprecatedSignatures(...rest) || validateLogFormatConfig(options.commands) || createLogTask(options);\n return this._runTask(task, next);\n }\n };\n function createLogTask(options) {\n return logTask(options.splitter, options.fields, options.commands);\n }\n function rejectDeprecatedSignatures(from, to) {\n return filterString(from) && filterString(to) && configurationErrorTask(\n `git.log(string, string) should be replaced with git.log({ from: string, to: string })`\n );\n }\n}\nvar excludeOptions;\nvar init_log = __esm({\n \"src/lib/tasks/log.ts\"() {\n \"use strict\";\n init_log_format();\n init_parse_list_log_summary();\n init_utils();\n init_task();\n init_diff();\n excludeOptions = /* @__PURE__ */ ((excludeOptions2) => {\n excludeOptions2[excludeOptions2[\"--pretty\"] = 0] = \"--pretty\";\n excludeOptions2[excludeOptions2[\"max-count\"] = 1] = \"max-count\";\n excludeOptions2[excludeOptions2[\"maxCount\"] = 2] = \"maxCount\";\n excludeOptions2[excludeOptions2[\"n\"] = 3] = \"n\";\n excludeOptions2[excludeOptions2[\"file\"] = 4] = \"file\";\n excludeOptions2[excludeOptions2[\"format\"] = 5] = \"format\";\n excludeOptions2[excludeOptions2[\"from\"] = 6] = \"from\";\n excludeOptions2[excludeOptions2[\"to\"] = 7] = \"to\";\n excludeOptions2[excludeOptions2[\"splitter\"] = 8] = \"splitter\";\n excludeOptions2[excludeOptions2[\"symmetric\"] = 9] = \"symmetric\";\n excludeOptions2[excludeOptions2[\"mailMap\"] = 10] = \"mailMap\";\n excludeOptions2[excludeOptions2[\"multiLine\"] = 11] = \"multiLine\";\n excludeOptions2[excludeOptions2[\"strictDate\"] = 12] = \"strictDate\";\n return excludeOptions2;\n })(excludeOptions || {});\n }\n});\n\n// src/lib/responses/MergeSummary.ts\nvar MergeSummaryConflict, MergeSummaryDetail;\nvar init_MergeSummary = __esm({\n \"src/lib/responses/MergeSummary.ts\"() {\n \"use strict\";\n MergeSummaryConflict = class {\n constructor(reason, file = null, meta) {\n this.reason = reason;\n this.file = file;\n this.meta = meta;\n }\n toString() {\n return `${this.file}:${this.reason}`;\n }\n };\n MergeSummaryDetail = class {\n constructor() {\n this.conflicts = [];\n this.merges = [];\n this.result = \"success\";\n }\n get failed() {\n return this.conflicts.length > 0;\n }\n get reason() {\n return this.result;\n }\n toString() {\n if (this.conflicts.length) {\n return `CONFLICTS: ${this.conflicts.join(\", \")}`;\n }\n return \"OK\";\n }\n };\n }\n});\n\n// src/lib/responses/PullSummary.ts\nvar PullSummary, PullFailedSummary;\nvar init_PullSummary = __esm({\n \"src/lib/responses/PullSummary.ts\"() {\n \"use strict\";\n PullSummary = class {\n constructor() {\n this.remoteMessages = {\n all: []\n };\n this.created = [];\n this.deleted = [];\n this.files = [];\n this.deletions = {};\n this.insertions = {};\n this.summary = {\n changes: 0,\n deletions: 0,\n insertions: 0\n };\n }\n };\n PullFailedSummary = class {\n constructor() {\n this.remote = \"\";\n this.hash = {\n local: \"\",\n remote: \"\"\n };\n this.branch = {\n local: \"\",\n remote: \"\"\n };\n this.message = \"\";\n }\n toString() {\n return this.message;\n }\n };\n }\n});\n\n// src/lib/parsers/parse-remote-objects.ts\nfunction objectEnumerationResult(remoteMessages) {\n return remoteMessages.objects = remoteMessages.objects || {\n compressing: 0,\n counting: 0,\n enumerating: 0,\n packReused: 0,\n reused: { count: 0, delta: 0 },\n total: { count: 0, delta: 0 }\n };\n}\nfunction asObjectCount(source) {\n const count = /^\\s*(\\d+)/.exec(source);\n const delta = /delta (\\d+)/i.exec(source);\n return {\n count: asNumber(count && count[1] || \"0\"),\n delta: asNumber(delta && delta[1] || \"0\")\n };\n}\nvar remoteMessagesObjectParsers;\nvar init_parse_remote_objects = __esm({\n \"src/lib/parsers/parse-remote-objects.ts\"() {\n \"use strict\";\n init_utils();\n remoteMessagesObjectParsers = [\n new RemoteLineParser(\n /^remote:\\s*(enumerating|counting|compressing) objects: (\\d+),/i,\n (result, [action, count]) => {\n const key = action.toLowerCase();\n const enumeration = objectEnumerationResult(result.remoteMessages);\n Object.assign(enumeration, { [key]: asNumber(count) });\n }\n ),\n new RemoteLineParser(\n /^remote:\\s*(enumerating|counting|compressing) objects: \\d+% \\(\\d+\\/(\\d+)\\),/i,\n (result, [action, count]) => {\n const key = action.toLowerCase();\n const enumeration = objectEnumerationResult(result.remoteMessages);\n Object.assign(enumeration, { [key]: asNumber(count) });\n }\n ),\n new RemoteLineParser(\n /total ([^,]+), reused ([^,]+), pack-reused (\\d+)/i,\n (result, [total, reused, packReused]) => {\n const objects = objectEnumerationResult(result.remoteMessages);\n objects.total = asObjectCount(total);\n objects.reused = asObjectCount(reused);\n objects.packReused = asNumber(packReused);\n }\n )\n ];\n }\n});\n\n// src/lib/parsers/parse-remote-messages.ts\nfunction parseRemoteMessages(_stdOut, stdErr) {\n return parseStringResponse({ remoteMessages: new RemoteMessageSummary() }, parsers2, stdErr);\n}\nvar parsers2, RemoteMessageSummary;\nvar init_parse_remote_messages = __esm({\n \"src/lib/parsers/parse-remote-messages.ts\"() {\n \"use strict\";\n init_utils();\n init_parse_remote_objects();\n parsers2 = [\n new RemoteLineParser(/^remote:\\s*(.+)$/, (result, [text]) => {\n result.remoteMessages.all.push(text.trim());\n return false;\n }),\n ...remoteMessagesObjectParsers,\n new RemoteLineParser(\n [/create a (?:pull|merge) request/i, /\\s(https?:\\/\\/\\S+)$/],\n (result, [pullRequestUrl]) => {\n result.remoteMessages.pullRequestUrl = pullRequestUrl;\n }\n ),\n new RemoteLineParser(\n [/found (\\d+) vulnerabilities.+\\(([^)]+)\\)/i, /\\s(https?:\\/\\/\\S+)$/],\n (result, [count, summary, url]) => {\n result.remoteMessages.vulnerabilities = {\n count: asNumber(count),\n summary,\n url\n };\n }\n )\n ];\n RemoteMessageSummary = class {\n constructor() {\n this.all = [];\n }\n };\n }\n});\n\n// src/lib/parsers/parse-pull.ts\nfunction parsePullErrorResult(stdOut, stdErr) {\n const pullError = parseStringResponse(new PullFailedSummary(), errorParsers, [stdOut, stdErr]);\n return pullError.message && pullError;\n}\nvar FILE_UPDATE_REGEX, SUMMARY_REGEX, ACTION_REGEX, parsers3, errorParsers, parsePullDetail, parsePullResult;\nvar init_parse_pull = __esm({\n \"src/lib/parsers/parse-pull.ts\"() {\n \"use strict\";\n init_PullSummary();\n init_utils();\n init_parse_remote_messages();\n FILE_UPDATE_REGEX = /^\\s*(.+?)\\s+\\|\\s+\\d+\\s*(\\+*)(-*)/;\n SUMMARY_REGEX = /(\\d+)\\D+((\\d+)\\D+\\(\\+\\))?(\\D+(\\d+)\\D+\\(-\\))?/;\n ACTION_REGEX = /^(create|delete) mode \\d+ (.+)/;\n parsers3 = [\n new LineParser(FILE_UPDATE_REGEX, (result, [file, insertions, deletions]) => {\n result.files.push(file);\n if (insertions) {\n result.insertions[file] = insertions.length;\n }\n if (deletions) {\n result.deletions[file] = deletions.length;\n }\n }),\n new LineParser(SUMMARY_REGEX, (result, [changes, , insertions, , deletions]) => {\n if (insertions !== void 0 || deletions !== void 0) {\n result.summary.changes = +changes || 0;\n result.summary.insertions = +insertions || 0;\n result.summary.deletions = +deletions || 0;\n return true;\n }\n return false;\n }),\n new LineParser(ACTION_REGEX, (result, [action, file]) => {\n append(result.files, file);\n append(action === \"create\" ? result.created : result.deleted, file);\n })\n ];\n errorParsers = [\n new LineParser(/^from\\s(.+)$/i, (result, [remote]) => void (result.remote = remote)),\n new LineParser(/^fatal:\\s(.+)$/, (result, [message]) => void (result.message = message)),\n new LineParser(\n /([a-z0-9]+)\\.\\.([a-z0-9]+)\\s+(\\S+)\\s+->\\s+(\\S+)$/,\n (result, [hashLocal, hashRemote, branchLocal, branchRemote]) => {\n result.branch.local = branchLocal;\n result.hash.local = hashLocal;\n result.branch.remote = branchRemote;\n result.hash.remote = hashRemote;\n }\n )\n ];\n parsePullDetail = (stdOut, stdErr) => {\n return parseStringResponse(new PullSummary(), parsers3, [stdOut, stdErr]);\n };\n parsePullResult = (stdOut, stdErr) => {\n return Object.assign(\n new PullSummary(),\n parsePullDetail(stdOut, stdErr),\n parseRemoteMessages(stdOut, stdErr)\n );\n };\n }\n});\n\n// src/lib/parsers/parse-merge.ts\nvar parsers4, parseMergeResult, parseMergeDetail;\nvar init_parse_merge = __esm({\n \"src/lib/parsers/parse-merge.ts\"() {\n \"use strict\";\n init_MergeSummary();\n init_utils();\n init_parse_pull();\n parsers4 = [\n new LineParser(/^Auto-merging\\s+(.+)$/, (summary, [autoMerge]) => {\n summary.merges.push(autoMerge);\n }),\n new LineParser(/^CONFLICT\\s+\\((.+)\\): Merge conflict in (.+)$/, (summary, [reason, file]) => {\n summary.conflicts.push(new MergeSummaryConflict(reason, file));\n }),\n new LineParser(\n /^CONFLICT\\s+\\((.+\\/delete)\\): (.+) deleted in (.+) and/,\n (summary, [reason, file, deleteRef]) => {\n summary.conflicts.push(new MergeSummaryConflict(reason, file, { deleteRef }));\n }\n ),\n new LineParser(/^CONFLICT\\s+\\((.+)\\):/, (summary, [reason]) => {\n summary.conflicts.push(new MergeSummaryConflict(reason, null));\n }),\n new LineParser(/^Automatic merge failed;\\s+(.+)$/, (summary, [result]) => {\n summary.result = result;\n })\n ];\n parseMergeResult = (stdOut, stdErr) => {\n return Object.assign(parseMergeDetail(stdOut, stdErr), parsePullResult(stdOut, stdErr));\n };\n parseMergeDetail = (stdOut) => {\n return parseStringResponse(new MergeSummaryDetail(), parsers4, stdOut);\n };\n }\n});\n\n// src/lib/tasks/merge.ts\nfunction mergeTask(customArgs) {\n if (!customArgs.length) {\n return configurationErrorTask(\"Git.merge requires at least one option\");\n }\n return {\n commands: [\"merge\", ...customArgs],\n format: \"utf-8\",\n parser(stdOut, stdErr) {\n const merge = parseMergeResult(stdOut, stdErr);\n if (merge.failed) {\n throw new GitResponseError(merge);\n }\n return merge;\n }\n };\n}\nvar init_merge = __esm({\n \"src/lib/tasks/merge.ts\"() {\n \"use strict\";\n init_git_response_error();\n init_parse_merge();\n init_task();\n }\n});\n\n// src/lib/parsers/parse-push.ts\nfunction pushResultPushedItem(local, remote, status) {\n const deleted = status.includes(\"deleted\");\n const tag = status.includes(\"tag\") || /^refs\\/tags/.test(local);\n const alreadyUpdated = !status.includes(\"new\");\n return {\n deleted,\n tag,\n branch: !tag,\n new: !alreadyUpdated,\n alreadyUpdated,\n local,\n remote\n };\n}\nvar parsers5, parsePushResult, parsePushDetail;\nvar init_parse_push = __esm({\n \"src/lib/parsers/parse-push.ts\"() {\n \"use strict\";\n init_utils();\n init_parse_remote_messages();\n parsers5 = [\n new LineParser(/^Pushing to (.+)$/, (result, [repo]) => {\n result.repo = repo;\n }),\n new LineParser(/^updating local tracking ref '(.+)'/, (result, [local]) => {\n result.ref = {\n ...result.ref || {},\n local\n };\n }),\n new LineParser(/^[=*-]\\s+([^:]+):(\\S+)\\s+\\[(.+)]$/, (result, [local, remote, type]) => {\n result.pushed.push(pushResultPushedItem(local, remote, type));\n }),\n new LineParser(\n /^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,\n (result, [local, remote, remoteName]) => {\n result.branch = {\n ...result.branch || {},\n local,\n remote,\n remoteName\n };\n }\n ),\n new LineParser(\n /^([^:]+):(\\S+)\\s+([a-z0-9]+)\\.\\.([a-z0-9]+)$/,\n (result, [local, remote, from, to]) => {\n result.update = {\n head: {\n local,\n remote\n },\n hash: {\n from,\n to\n }\n };\n }\n )\n ];\n parsePushResult = (stdOut, stdErr) => {\n const pushDetail = parsePushDetail(stdOut, stdErr);\n const responseDetail = parseRemoteMessages(stdOut, stdErr);\n return {\n ...pushDetail,\n ...responseDetail\n };\n };\n parsePushDetail = (stdOut, stdErr) => {\n return parseStringResponse({ pushed: [] }, parsers5, [stdOut, stdErr]);\n };\n }\n});\n\n// src/lib/tasks/push.ts\nvar push_exports = {};\n__export(push_exports, {\n pushTagsTask: () => pushTagsTask,\n pushTask: () => pushTask\n});\nfunction pushTagsTask(ref = {}, customArgs) {\n append(customArgs, \"--tags\");\n return pushTask(ref, customArgs);\n}\nfunction pushTask(ref = {}, customArgs) {\n const commands = [\"push\", ...customArgs];\n if (ref.branch) {\n commands.splice(1, 0, ref.branch);\n }\n if (ref.remote) {\n commands.splice(1, 0, ref.remote);\n }\n remove(commands, \"-v\");\n append(commands, \"--verbose\");\n append(commands, \"--porcelain\");\n return {\n commands,\n format: \"utf-8\",\n parser: parsePushResult\n };\n}\nvar init_push = __esm({\n \"src/lib/tasks/push.ts\"() {\n \"use strict\";\n init_parse_push();\n init_utils();\n }\n});\n\n// src/lib/tasks/show.ts\nfunction show_default() {\n return {\n showBuffer() {\n const commands = [\"show\", ...getTrailingOptions(arguments, 1)];\n if (!commands.includes(\"--binary\")) {\n commands.splice(1, 0, \"--binary\");\n }\n return this._runTask(\n straightThroughBufferTask(commands),\n trailingFunctionArgument(arguments)\n );\n },\n show() {\n const commands = [\"show\", ...getTrailingOptions(arguments, 1)];\n return this._runTask(\n straightThroughStringTask(commands),\n trailingFunctionArgument(arguments)\n );\n }\n };\n}\nvar init_show = __esm({\n \"src/lib/tasks/show.ts\"() {\n \"use strict\";\n init_utils();\n init_task();\n }\n});\n\n// src/lib/responses/FileStatusSummary.ts\nvar fromPathRegex, FileStatusSummary;\nvar init_FileStatusSummary = __esm({\n \"src/lib/responses/FileStatusSummary.ts\"() {\n \"use strict\";\n fromPathRegex = /^(.+)\\0(.+)$/;\n FileStatusSummary = class {\n constructor(path, index, working_dir) {\n this.path = path;\n this.index = index;\n this.working_dir = working_dir;\n if (index === \"R\" || working_dir === \"R\") {\n const detail = fromPathRegex.exec(path) || [null, path, path];\n this.from = detail[2] || \"\";\n this.path = detail[1] || \"\";\n }\n }\n };\n }\n});\n\n// src/lib/responses/StatusSummary.ts\nfunction renamedFile(line) {\n const [to, from] = line.split(NULL);\n return {\n from: from || to,\n to\n };\n}\nfunction parser3(indexX, indexY, handler) {\n return [`${indexX}${indexY}`, handler];\n}\nfunction conflicts(indexX, ...indexY) {\n return indexY.map((y) => parser3(indexX, y, (result, file) => result.conflicted.push(file)));\n}\nfunction splitLine(result, lineStr) {\n const trimmed2 = lineStr.trim();\n switch (\" \") {\n case trimmed2.charAt(2):\n return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.slice(3));\n case trimmed2.charAt(1):\n return data(\" \" /* NONE */, trimmed2.charAt(0), trimmed2.slice(2));\n default:\n return;\n }\n function data(index, workingDir, path) {\n const raw = `${index}${workingDir}`;\n const handler = parsers6.get(raw);\n if (handler) {\n handler(result, path);\n }\n if (raw !== \"##\" && raw !== \"!!\") {\n result.files.push(new FileStatusSummary(path, index, workingDir));\n }\n }\n}\nvar StatusSummary, parsers6, parseStatusSummary;\nvar init_StatusSummary = __esm({\n \"src/lib/responses/StatusSummary.ts\"() {\n \"use strict\";\n init_utils();\n init_FileStatusSummary();\n StatusSummary = class {\n constructor() {\n this.not_added = [];\n this.conflicted = [];\n this.created = [];\n this.deleted = [];\n this.ignored = void 0;\n this.modified = [];\n this.renamed = [];\n this.files = [];\n this.staged = [];\n this.ahead = 0;\n this.behind = 0;\n this.current = null;\n this.tracking = null;\n this.detached = false;\n this.isClean = () => {\n return !this.files.length;\n };\n }\n };\n parsers6 = new Map([\n parser3(\n \" \" /* NONE */,\n \"A\" /* ADDED */,\n (result, file) => result.created.push(file)\n ),\n parser3(\n \" \" /* NONE */,\n \"D\" /* DELETED */,\n (result, file) => result.deleted.push(file)\n ),\n parser3(\n \" \" /* NONE */,\n \"M\" /* MODIFIED */,\n (result, file) => result.modified.push(file)\n ),\n parser3(\"A\" /* ADDED */, \" \" /* NONE */, (result, file) => {\n result.created.push(file);\n result.staged.push(file);\n }),\n parser3(\"A\" /* ADDED */, \"M\" /* MODIFIED */, (result, file) => {\n result.created.push(file);\n result.staged.push(file);\n result.modified.push(file);\n }),\n parser3(\"D\" /* DELETED */, \" \" /* NONE */, (result, file) => {\n result.deleted.push(file);\n result.staged.push(file);\n }),\n parser3(\"M\" /* MODIFIED */, \" \" /* NONE */, (result, file) => {\n result.modified.push(file);\n result.staged.push(file);\n }),\n parser3(\"M\" /* MODIFIED */, \"M\" /* MODIFIED */, (result, file) => {\n result.modified.push(file);\n result.staged.push(file);\n }),\n parser3(\"R\" /* RENAMED */, \" \" /* NONE */, (result, file) => {\n result.renamed.push(renamedFile(file));\n }),\n parser3(\"R\" /* RENAMED */, \"M\" /* MODIFIED */, (result, file) => {\n const renamed = renamedFile(file);\n result.renamed.push(renamed);\n result.modified.push(renamed.to);\n }),\n parser3(\"!\" /* IGNORED */, \"!\" /* IGNORED */, (_result, _file) => {\n (_result.ignored = _result.ignored || []).push(_file);\n }),\n parser3(\n \"?\" /* UNTRACKED */,\n \"?\" /* UNTRACKED */,\n (result, file) => result.not_added.push(file)\n ),\n ...conflicts(\"A\" /* ADDED */, \"A\" /* ADDED */, \"U\" /* UNMERGED */),\n ...conflicts(\n \"D\" /* DELETED */,\n \"D\" /* DELETED */,\n \"U\" /* UNMERGED */\n ),\n ...conflicts(\n \"U\" /* UNMERGED */,\n \"A\" /* ADDED */,\n \"D\" /* DELETED */,\n \"U\" /* UNMERGED */\n ),\n [\n \"##\",\n (result, line) => {\n const aheadReg = /ahead (\\d+)/;\n const behindReg = /behind (\\d+)/;\n const currentReg = /^(.+?(?=(?:\\.{3}|\\s|$)))/;\n const trackingReg = /\\.{3}(\\S*)/;\n const onEmptyBranchReg = /\\son\\s(\\S+?)(?=\\.{3}|$)/;\n let regexResult = aheadReg.exec(line);\n result.ahead = regexResult && +regexResult[1] || 0;\n regexResult = behindReg.exec(line);\n result.behind = regexResult && +regexResult[1] || 0;\n regexResult = currentReg.exec(line);\n result.current = filterType(regexResult?.[1], filterString, null);\n regexResult = trackingReg.exec(line);\n result.tracking = filterType(regexResult?.[1], filterString, null);\n regexResult = onEmptyBranchReg.exec(line);\n if (regexResult) {\n result.current = filterType(regexResult?.[1], filterString, result.current);\n }\n result.detached = /\\(no branch\\)/.test(line);\n }\n ]\n ]);\n parseStatusSummary = function(text) {\n const lines = text.split(NULL);\n const status = new StatusSummary();\n for (let i = 0, l = lines.length; i < l; ) {\n let line = lines[i++].trim();\n if (!line) {\n continue;\n }\n if (line.charAt(0) === \"R\" /* RENAMED */) {\n line += NULL + (lines[i++] || \"\");\n }\n splitLine(status, line);\n }\n return status;\n };\n }\n});\n\n// src/lib/tasks/status.ts\nfunction statusTask(customArgs) {\n const commands = [\n \"status\",\n \"--porcelain\",\n \"-b\",\n \"-u\",\n \"--null\",\n ...customArgs.filter((arg) => !ignoredOptions.includes(arg))\n ];\n return {\n format: \"utf-8\",\n commands,\n parser(text) {\n return parseStatusSummary(text);\n }\n };\n}\nvar ignoredOptions;\nvar init_status = __esm({\n \"src/lib/tasks/status.ts\"() {\n \"use strict\";\n init_StatusSummary();\n ignoredOptions = [\"--null\", \"-z\"];\n }\n});\n\n// src/lib/tasks/version.ts\nfunction versionResponse(major = 0, minor = 0, patch = 0, agent = \"\", installed = true) {\n return Object.defineProperty(\n {\n major,\n minor,\n patch,\n agent,\n installed\n },\n \"toString\",\n {\n value() {\n return `${this.major}.${this.minor}.${this.patch}`;\n },\n configurable: false,\n enumerable: false\n }\n );\n}\nfunction notInstalledResponse() {\n return versionResponse(0, 0, 0, \"\", false);\n}\nfunction version_default() {\n return {\n version() {\n return this._runTask({\n commands: [\"--version\"],\n format: \"utf-8\",\n parser: versionParser,\n onError(result, error, done, fail) {\n if (result.exitCode === -2 /* NOT_FOUND */) {\n return done(Buffer.from(NOT_INSTALLED));\n }\n fail(error);\n }\n });\n }\n };\n}\nfunction versionParser(stdOut) {\n if (stdOut === NOT_INSTALLED) {\n return notInstalledResponse();\n }\n return parseStringResponse(versionResponse(0, 0, 0, stdOut), parsers7, stdOut);\n}\nvar NOT_INSTALLED, parsers7;\nvar init_version = __esm({\n \"src/lib/tasks/version.ts\"() {\n \"use strict\";\n init_utils();\n NOT_INSTALLED = \"installed=false\";\n parsers7 = [\n new LineParser(\n /version (\\d+)\\.(\\d+)\\.(\\d+)(?:\\s*\\((.+)\\))?/,\n (result, [major, minor, patch, agent = \"\"]) => {\n Object.assign(\n result,\n versionResponse(asNumber(major), asNumber(minor), asNumber(patch), agent)\n );\n }\n ),\n new LineParser(\n /version (\\d+)\\.(\\d+)\\.(\\D+)(.+)?$/,\n (result, [major, minor, patch, agent = \"\"]) => {\n Object.assign(result, versionResponse(asNumber(major), asNumber(minor), patch, agent));\n }\n )\n ];\n }\n});\n\n// src/lib/tasks/clone.ts\nimport { pathspec as pathspec3 } from \"@simple-git/args-pathspec\";\nfunction createCloneTask(api, task, repoPath, ...args) {\n if (!filterString(repoPath)) {\n return configurationErrorTask(`git.${api}() requires a string 'repoPath'`);\n }\n return task(repoPath, filterType(args[0], filterString), getTrailingOptions(arguments));\n}\nfunction clone_default() {\n return {\n clone(repo, ...rest) {\n return this._runTask(\n createCloneTask(\"clone\", cloneTask, filterType(repo, filterString), ...rest),\n trailingFunctionArgument(arguments)\n );\n },\n mirror(repo, ...rest) {\n return this._runTask(\n createCloneTask(\"mirror\", cloneMirrorTask, filterType(repo, filterString), ...rest),\n trailingFunctionArgument(arguments)\n );\n }\n };\n}\nvar cloneTask, cloneMirrorTask;\nvar init_clone = __esm({\n \"src/lib/tasks/clone.ts\"() {\n \"use strict\";\n init_task();\n init_utils();\n cloneTask = (repo, directory, customArgs) => {\n const commands = [\"clone\", ...customArgs];\n filterString(repo) && commands.push(pathspec3(repo));\n filterString(directory) && commands.push(pathspec3(directory));\n return straightThroughStringTask(commands);\n };\n cloneMirrorTask = (repo, directory, customArgs) => {\n append(customArgs, \"--mirror\");\n return cloneTask(repo, directory, customArgs);\n };\n }\n});\n\n// src/lib/simple-git-api.ts\nvar simple_git_api_exports = {};\n__export(simple_git_api_exports, {\n SimpleGitApi: () => SimpleGitApi\n});\nvar SimpleGitApi;\nvar init_simple_git_api = __esm({\n \"src/lib/simple-git-api.ts\"() {\n \"use strict\";\n init_task_callback();\n init_change_working_directory();\n init_checkout();\n init_count_objects();\n init_commit();\n init_config();\n init_first_commit();\n init_grep();\n init_hash_object();\n init_init();\n init_log();\n init_merge();\n init_push();\n init_show();\n init_status();\n init_task();\n init_version();\n init_utils();\n init_clone();\n SimpleGitApi = class {\n constructor(_executor) {\n this._executor = _executor;\n }\n _runTask(task, then) {\n const chain = this._executor.chain();\n const promise = chain.push(task);\n if (then) {\n taskCallback(task, promise, then);\n }\n return Object.create(this, {\n then: { value: promise.then.bind(promise) },\n catch: { value: promise.catch.bind(promise) },\n _executor: { value: chain }\n });\n }\n add(files) {\n return this._runTask(\n straightThroughStringTask([\"add\", ...asArray(files)]),\n trailingFunctionArgument(arguments)\n );\n }\n cwd(directory) {\n const next = trailingFunctionArgument(arguments);\n if (typeof directory === \"string\") {\n return this._runTask(changeWorkingDirectoryTask(directory, this._executor), next);\n }\n if (typeof directory?.path === \"string\") {\n return this._runTask(\n changeWorkingDirectoryTask(\n directory.path,\n directory.root && this._executor || void 0\n ),\n next\n );\n }\n return this._runTask(\n configurationErrorTask(\"Git.cwd: workingDirectory must be supplied as a string\"),\n next\n );\n }\n hashObject(path, write) {\n return this._runTask(\n hashObjectTask(path, write === true),\n trailingFunctionArgument(arguments)\n );\n }\n init(bare) {\n return this._runTask(\n initTask(bare === true, this._executor.cwd, getTrailingOptions(arguments)),\n trailingFunctionArgument(arguments)\n );\n }\n merge() {\n return this._runTask(\n mergeTask(getTrailingOptions(arguments)),\n trailingFunctionArgument(arguments)\n );\n }\n mergeFromTo(remote, branch) {\n if (!(filterString(remote) && filterString(branch))) {\n return this._runTask(\n configurationErrorTask(\n `Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`\n )\n );\n }\n return this._runTask(\n mergeTask([remote, branch, ...getTrailingOptions(arguments)]),\n trailingFunctionArgument(arguments, false)\n );\n }\n outputHandler(handler) {\n this._executor.outputHandler = handler;\n return this;\n }\n push() {\n const task = pushTask(\n {\n remote: filterType(arguments[0], filterString),\n branch: filterType(arguments[1], filterString)\n },\n getTrailingOptions(arguments)\n );\n return this._runTask(task, trailingFunctionArgument(arguments));\n }\n stash() {\n return this._runTask(\n straightThroughStringTask([\"stash\", ...getTrailingOptions(arguments)]),\n trailingFunctionArgument(arguments)\n );\n }\n status() {\n return this._runTask(\n statusTask(getTrailingOptions(arguments)),\n trailingFunctionArgument(arguments)\n );\n }\n };\n Object.assign(\n SimpleGitApi.prototype,\n checkout_default(),\n clone_default(),\n commit_default(),\n config_default(),\n count_objects_default(),\n first_commit_default(),\n grep_default(),\n log_default(),\n show_default(),\n version_default()\n );\n }\n});\n\n// src/lib/runners/scheduler.ts\nvar scheduler_exports = {};\n__export(scheduler_exports, {\n Scheduler: () => Scheduler\n});\nimport { createDeferred } from \"@kwsites/promise-deferred\";\nvar createScheduledTask, Scheduler;\nvar init_scheduler = __esm({\n \"src/lib/runners/scheduler.ts\"() {\n \"use strict\";\n init_utils();\n init_git_logger();\n createScheduledTask = /* @__PURE__ */ (() => {\n let id = 0;\n return () => {\n id++;\n const { promise, done } = createDeferred();\n return {\n promise,\n done,\n id\n };\n };\n })();\n Scheduler = class {\n constructor(concurrency = 2) {\n this.concurrency = concurrency;\n this.logger = createLogger(\"\", \"scheduler\");\n this.pending = [];\n this.running = [];\n this.logger(`Constructed, concurrency=%s`, concurrency);\n }\n schedule() {\n if (!this.pending.length || this.running.length >= this.concurrency) {\n this.logger(\n `Schedule attempt ignored, pending=%s running=%s concurrency=%s`,\n this.pending.length,\n this.running.length,\n this.concurrency\n );\n return;\n }\n const task = append(this.running, this.pending.shift());\n this.logger(`Attempting id=%s`, task.id);\n task.done(() => {\n this.logger(`Completing id=`, task.id);\n remove(this.running, task);\n this.schedule();\n });\n }\n next() {\n const { promise, id } = append(this.pending, createScheduledTask());\n this.logger(`Scheduling id=%s`, id);\n this.schedule();\n return promise;\n }\n };\n }\n});\n\n// src/lib/tasks/apply-patch.ts\nvar apply_patch_exports = {};\n__export(apply_patch_exports, {\n applyPatchTask: () => applyPatchTask\n});\nfunction applyPatchTask(patches, customArgs) {\n return straightThroughStringTask([\"apply\", ...customArgs, ...patches]);\n}\nvar init_apply_patch = __esm({\n \"src/lib/tasks/apply-patch.ts\"() {\n \"use strict\";\n init_task();\n }\n});\n\n// src/lib/responses/BranchDeleteSummary.ts\nfunction branchDeletionSuccess(branch, hash) {\n return {\n branch,\n hash,\n success: true\n };\n}\nfunction branchDeletionFailure(branch) {\n return {\n branch,\n hash: null,\n success: false\n };\n}\nvar BranchDeletionBatch;\nvar init_BranchDeleteSummary = __esm({\n \"src/lib/responses/BranchDeleteSummary.ts\"() {\n \"use strict\";\n BranchDeletionBatch = class {\n constructor() {\n this.all = [];\n this.branches = {};\n this.errors = [];\n }\n get success() {\n return !this.errors.length;\n }\n };\n }\n});\n\n// src/lib/parsers/parse-branch-delete.ts\nfunction hasBranchDeletionError(data, processExitCode) {\n return processExitCode === 1 /* ERROR */ && deleteErrorRegex.test(data);\n}\nvar deleteSuccessRegex, deleteErrorRegex, parsers8, parseBranchDeletions;\nvar init_parse_branch_delete = __esm({\n \"src/lib/parsers/parse-branch-delete.ts\"() {\n \"use strict\";\n init_BranchDeleteSummary();\n init_utils();\n deleteSuccessRegex = /(\\S+)\\s+\\(\\S+\\s([^)]+)\\)/;\n deleteErrorRegex = /^error[^']+'([^']+)'/m;\n parsers8 = [\n new LineParser(deleteSuccessRegex, (result, [branch, hash]) => {\n const deletion = branchDeletionSuccess(branch, hash);\n result.all.push(deletion);\n result.branches[branch] = deletion;\n }),\n new LineParser(deleteErrorRegex, (result, [branch]) => {\n const deletion = branchDeletionFailure(branch);\n result.errors.push(deletion);\n result.all.push(deletion);\n result.branches[branch] = deletion;\n })\n ];\n parseBranchDeletions = (stdOut, stdErr) => {\n return parseStringResponse(new BranchDeletionBatch(), parsers8, [stdOut, stdErr]);\n };\n }\n});\n\n// src/lib/responses/BranchSummary.ts\nvar BranchSummaryResult;\nvar init_BranchSummary = __esm({\n \"src/lib/responses/BranchSummary.ts\"() {\n \"use strict\";\n BranchSummaryResult = class {\n constructor() {\n this.all = [];\n this.branches = {};\n this.current = \"\";\n this.detached = false;\n }\n push(status, detached, name, commit, label) {\n if (status === \"*\" /* CURRENT */) {\n this.detached = detached;\n this.current = name;\n }\n this.all.push(name);\n this.branches[name] = {\n current: status === \"*\" /* CURRENT */,\n linkedWorkTree: status === \"+\" /* LINKED */,\n name,\n commit,\n label\n };\n }\n };\n }\n});\n\n// src/lib/parsers/parse-branch.ts\nfunction branchStatus(input) {\n return input ? input.charAt(0) : \"\";\n}\nfunction parseBranchSummary(stdOut, currentOnly = false) {\n return parseStringResponse(\n new BranchSummaryResult(),\n currentOnly ? [currentBranchParser] : parsers9,\n stdOut\n );\n}\nvar parsers9, currentBranchParser;\nvar init_parse_branch = __esm({\n \"src/lib/parsers/parse-branch.ts\"() {\n \"use strict\";\n init_BranchSummary();\n init_utils();\n parsers9 = [\n new LineParser(\n /^([*+]\\s)?\\((?:HEAD )?detached (?:from|at) (\\S+)\\)\\s+([a-z0-9]+)\\s(.*)$/,\n (result, [current, name, commit, label]) => {\n result.push(branchStatus(current), true, name, commit, label);\n }\n ),\n new LineParser(\n /^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$/s,\n (result, [current, name, commit, label]) => {\n result.push(branchStatus(current), false, name, commit, label);\n }\n )\n ];\n currentBranchParser = new LineParser(/^(\\S+)$/s, (result, [name]) => {\n result.push(\"*\" /* CURRENT */, false, name, \"\", \"\");\n });\n }\n});\n\n// src/lib/tasks/branch.ts\nvar branch_exports = {};\n__export(branch_exports, {\n branchLocalTask: () => branchLocalTask,\n branchTask: () => branchTask,\n containsDeleteBranchCommand: () => containsDeleteBranchCommand,\n deleteBranchTask: () => deleteBranchTask,\n deleteBranchesTask: () => deleteBranchesTask\n});\nfunction containsDeleteBranchCommand(commands) {\n const deleteCommands = [\"-d\", \"-D\", \"--delete\"];\n return commands.some((command) => deleteCommands.includes(command));\n}\nfunction branchTask(customArgs) {\n const isDelete = containsDeleteBranchCommand(customArgs);\n const isCurrentOnly = customArgs.includes(\"--show-current\");\n const commands = [\"branch\", ...customArgs];\n if (commands.length === 1) {\n commands.push(\"-a\");\n }\n if (!commands.includes(\"-v\")) {\n commands.splice(1, 0, \"-v\");\n }\n return {\n format: \"utf-8\",\n commands,\n parser(stdOut, stdErr) {\n if (isDelete) {\n return parseBranchDeletions(stdOut, stdErr).all[0];\n }\n return parseBranchSummary(stdOut, isCurrentOnly);\n }\n };\n}\nfunction branchLocalTask() {\n return {\n format: \"utf-8\",\n commands: [\"branch\", \"-v\"],\n parser(stdOut) {\n return parseBranchSummary(stdOut);\n }\n };\n}\nfunction deleteBranchesTask(branches, forceDelete = false) {\n return {\n format: \"utf-8\",\n commands: [\"branch\", \"-v\", forceDelete ? \"-D\" : \"-d\", ...branches],\n parser(stdOut, stdErr) {\n return parseBranchDeletions(stdOut, stdErr);\n },\n onError({ exitCode, stdOut }, error, done, fail) {\n if (!hasBranchDeletionError(String(error), exitCode)) {\n return fail(error);\n }\n done(stdOut);\n }\n };\n}\nfunction deleteBranchTask(branch, forceDelete = false) {\n const task = {\n format: \"utf-8\",\n commands: [\"branch\", \"-v\", forceDelete ? \"-D\" : \"-d\", branch],\n parser(stdOut, stdErr) {\n return parseBranchDeletions(stdOut, stdErr).branches[branch];\n },\n onError({ exitCode, stdErr, stdOut }, error, _, fail) {\n if (!hasBranchDeletionError(String(error), exitCode)) {\n return fail(error);\n }\n throw new GitResponseError(\n task.parser(bufferToString(stdOut), bufferToString(stdErr)),\n String(error)\n );\n }\n };\n return task;\n}\nvar init_branch = __esm({\n \"src/lib/tasks/branch.ts\"() {\n \"use strict\";\n init_git_response_error();\n init_parse_branch_delete();\n init_parse_branch();\n init_utils();\n }\n});\n\n// src/lib/responses/CheckIgnore.ts\nimport { normalize } from \"node:path\";\nfunction toPath(input) {\n const path = input.trim().replace(/^[\"']|[\"']$/g, \"\");\n return path && normalize(path);\n}\nvar parseCheckIgnore;\nvar init_CheckIgnore = __esm({\n \"src/lib/responses/CheckIgnore.ts\"() {\n \"use strict\";\n parseCheckIgnore = (text) => {\n return text.split(/\\n/g).map(toPath).filter(Boolean);\n };\n }\n});\n\n// src/lib/tasks/check-ignore.ts\nvar check_ignore_exports = {};\n__export(check_ignore_exports, {\n checkIgnoreTask: () => checkIgnoreTask\n});\nfunction checkIgnoreTask(paths) {\n return {\n commands: [\"check-ignore\", ...paths],\n format: \"utf-8\",\n parser: parseCheckIgnore\n };\n}\nvar init_check_ignore = __esm({\n \"src/lib/tasks/check-ignore.ts\"() {\n \"use strict\";\n init_CheckIgnore();\n }\n});\n\n// src/lib/parsers/parse-fetch.ts\nfunction parseFetchResult(stdOut, stdErr) {\n const result = {\n raw: stdOut,\n remote: null,\n branches: [],\n tags: [],\n updated: [],\n deleted: []\n };\n return parseStringResponse(result, parsers10, [stdOut, stdErr]);\n}\nvar parsers10;\nvar init_parse_fetch = __esm({\n \"src/lib/parsers/parse-fetch.ts\"() {\n \"use strict\";\n init_utils();\n parsers10 = [\n new LineParser(/From (.+)$/, (result, [remote]) => {\n result.remote = remote;\n }),\n new LineParser(/\\* \\[new branch]\\s+(\\S+)\\s*-> (.+)$/, (result, [name, tracking]) => {\n result.branches.push({\n name,\n tracking\n });\n }),\n new LineParser(/\\* \\[new tag]\\s+(\\S+)\\s*-> (.+)$/, (result, [name, tracking]) => {\n result.tags.push({\n name,\n tracking\n });\n }),\n new LineParser(/- \\[deleted]\\s+\\S+\\s*-> (.+)$/, (result, [tracking]) => {\n result.deleted.push({\n tracking\n });\n }),\n new LineParser(\n /\\s*([^.]+)\\.\\.(\\S+)\\s+(\\S+)\\s*-> (.+)$/,\n (result, [from, to, name, tracking]) => {\n result.updated.push({\n name,\n tracking,\n to,\n from\n });\n }\n )\n ];\n }\n});\n\n// src/lib/tasks/fetch.ts\nvar fetch_exports = {};\n__export(fetch_exports, {\n fetchTask: () => fetchTask\n});\nfunction disallowedCommand(command) {\n return /^--upload-pack(=|$)/.test(command);\n}\nfunction fetchTask(remote, branch, customArgs) {\n const commands = [\"fetch\", ...customArgs];\n if (remote && branch) {\n commands.push(remote, branch);\n }\n const banned = commands.find(disallowedCommand);\n if (banned) {\n return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);\n }\n return {\n commands,\n format: \"utf-8\",\n parser: parseFetchResult\n };\n}\nvar init_fetch = __esm({\n \"src/lib/tasks/fetch.ts\"() {\n \"use strict\";\n init_parse_fetch();\n init_task();\n }\n});\n\n// src/lib/parsers/parse-move.ts\nfunction parseMoveResult(stdOut) {\n return parseStringResponse({ moves: [] }, parsers11, stdOut);\n}\nvar parsers11;\nvar init_parse_move = __esm({\n \"src/lib/parsers/parse-move.ts\"() {\n \"use strict\";\n init_utils();\n parsers11 = [\n new LineParser(/^Renaming (.+) to (.+)$/, (result, [from, to]) => {\n result.moves.push({ from, to });\n })\n ];\n }\n});\n\n// src/lib/tasks/move.ts\nvar move_exports = {};\n__export(move_exports, {\n moveTask: () => moveTask\n});\nfunction moveTask(from, to) {\n return {\n commands: [\"mv\", \"-v\", ...asArray(from), to],\n format: \"utf-8\",\n parser: parseMoveResult\n };\n}\nvar init_move = __esm({\n \"src/lib/tasks/move.ts\"() {\n \"use strict\";\n init_parse_move();\n init_utils();\n }\n});\n\n// src/lib/tasks/pull.ts\nvar pull_exports = {};\n__export(pull_exports, {\n pullTask: () => pullTask\n});\nfunction pullTask(remote, branch, customArgs) {\n const commands = [\"pull\", ...customArgs];\n if (remote && branch) {\n commands.splice(1, 0, remote, branch);\n }\n return {\n commands,\n format: \"utf-8\",\n parser(stdOut, stdErr) {\n return parsePullResult(stdOut, stdErr);\n },\n onError(result, _error, _done, fail) {\n const pullError = parsePullErrorResult(\n bufferToString(result.stdOut),\n bufferToString(result.stdErr)\n );\n if (pullError) {\n return fail(new GitResponseError(pullError));\n }\n fail(_error);\n }\n };\n}\nvar init_pull = __esm({\n \"src/lib/tasks/pull.ts\"() {\n \"use strict\";\n init_git_response_error();\n init_parse_pull();\n init_utils();\n }\n});\n\n// src/lib/responses/GetRemoteSummary.ts\nfunction parseGetRemotes(text) {\n const remotes = {};\n forEach(text, ([name]) => remotes[name] = { name });\n return Object.values(remotes);\n}\nfunction parseGetRemotesVerbose(text) {\n const remotes = {};\n forEach(text, ([name, url, purpose]) => {\n if (!Object.hasOwn(remotes, name)) {\n remotes[name] = {\n name,\n refs: { fetch: \"\", push: \"\" }\n };\n }\n if (purpose && url) {\n remotes[name].refs[purpose.replace(/[^a-z]/g, \"\")] = url;\n }\n });\n return Object.values(remotes);\n}\nfunction forEach(text, handler) {\n forEachLineWithContent(text, (line) => handler(line.split(/\\s+/)));\n}\nvar init_GetRemoteSummary = __esm({\n \"src/lib/responses/GetRemoteSummary.ts\"() {\n \"use strict\";\n init_utils();\n }\n});\n\n// src/lib/tasks/remote.ts\nvar remote_exports = {};\n__export(remote_exports, {\n addRemoteTask: () => addRemoteTask,\n getRemotesTask: () => getRemotesTask,\n listRemotesTask: () => listRemotesTask,\n remoteTask: () => remoteTask,\n removeRemoteTask: () => removeRemoteTask\n});\nfunction addRemoteTask(remoteName, remoteRepo, customArgs) {\n return straightThroughStringTask([\"remote\", \"add\", ...customArgs, remoteName, remoteRepo]);\n}\nfunction getRemotesTask(verbose) {\n const commands = [\"remote\"];\n if (verbose) {\n commands.push(\"-v\");\n }\n return {\n commands,\n format: \"utf-8\",\n parser: verbose ? parseGetRemotesVerbose : parseGetRemotes\n };\n}\nfunction listRemotesTask(customArgs) {\n const commands = [...customArgs];\n if (commands[0] !== \"ls-remote\") {\n commands.unshift(\"ls-remote\");\n }\n return straightThroughStringTask(commands);\n}\nfunction remoteTask(customArgs) {\n const commands = [...customArgs];\n if (commands[0] !== \"remote\") {\n commands.unshift(\"remote\");\n }\n return straightThroughStringTask(commands);\n}\nfunction removeRemoteTask(remoteName) {\n return straightThroughStringTask([\"remote\", \"remove\", remoteName]);\n}\nvar init_remote = __esm({\n \"src/lib/tasks/remote.ts\"() {\n \"use strict\";\n init_GetRemoteSummary();\n init_task();\n }\n});\n\n// src/lib/tasks/stash-list.ts\nvar stash_list_exports = {};\n__export(stash_list_exports, {\n stashListTask: () => stashListTask\n});\nfunction stashListTask(opt = {}, customArgs) {\n const options = parseLogOptions(opt);\n const commands = [\"stash\", \"list\", ...options.commands, ...customArgs];\n const parser4 = createListLogSummaryParser(\n options.splitter,\n options.fields,\n logFormatFromCommand(commands)\n );\n return validateLogFormatConfig(commands) || {\n commands,\n format: \"utf-8\",\n parser: parser4\n };\n}\nvar init_stash_list = __esm({\n \"src/lib/tasks/stash-list.ts\"() {\n \"use strict\";\n init_log_format();\n init_parse_list_log_summary();\n init_diff();\n init_log();\n }\n});\n\n// src/lib/tasks/sub-module.ts\nvar sub_module_exports = {};\n__export(sub_module_exports, {\n addSubModuleTask: () => addSubModuleTask,\n initSubModuleTask: () => initSubModuleTask,\n subModuleTask: () => subModuleTask,\n updateSubModuleTask: () => updateSubModuleTask\n});\nfunction addSubModuleTask(repo, path) {\n return subModuleTask([\"add\", repo, path]);\n}\nfunction initSubModuleTask(customArgs) {\n return subModuleTask([\"init\", ...customArgs]);\n}\nfunction subModuleTask(customArgs) {\n const commands = [...customArgs];\n if (commands[0] !== \"submodule\") {\n commands.unshift(\"submodule\");\n }\n return straightThroughStringTask(commands);\n}\nfunction updateSubModuleTask(customArgs) {\n return subModuleTask([\"update\", ...customArgs]);\n}\nvar init_sub_module = __esm({\n \"src/lib/tasks/sub-module.ts\"() {\n \"use strict\";\n init_task();\n }\n});\n\n// src/lib/responses/TagList.ts\nfunction singleSorted(a, b) {\n const aIsNum = Number.isNaN(a);\n const bIsNum = Number.isNaN(b);\n if (aIsNum !== bIsNum) {\n return aIsNum ? 1 : -1;\n }\n return aIsNum ? sorted(a, b) : 0;\n}\nfunction sorted(a, b) {\n return a === b ? 0 : a > b ? 1 : -1;\n}\nfunction trimmed(input) {\n return input.trim();\n}\nfunction toNumber(input) {\n if (typeof input === \"string\") {\n return parseInt(input.replace(/^\\D+/g, \"\"), 10) || 0;\n }\n return 0;\n}\nvar TagList, parseTagList;\nvar init_TagList = __esm({\n \"src/lib/responses/TagList.ts\"() {\n \"use strict\";\n TagList = class {\n constructor(all, latest) {\n this.all = all;\n this.latest = latest;\n }\n };\n parseTagList = function(data, customSort = false) {\n const tags = data.split(\"\\n\").map(trimmed).filter(Boolean);\n if (!customSort) {\n tags.sort(function(tagA, tagB) {\n const partsA = tagA.split(\".\");\n const partsB = tagB.split(\".\");\n if (partsA.length === 1 || partsB.length === 1) {\n return singleSorted(toNumber(partsA[0]), toNumber(partsB[0]));\n }\n for (let i = 0, l = Math.max(partsA.length, partsB.length); i < l; i++) {\n const diff = sorted(toNumber(partsA[i]), toNumber(partsB[i]));\n if (diff) {\n return diff;\n }\n }\n return 0;\n });\n }\n const latest = customSort ? tags[0] : [...tags].reverse().find((tag) => tag.indexOf(\".\") >= 0);\n return new TagList(tags, latest);\n };\n }\n});\n\n// src/lib/tasks/tag.ts\nvar tag_exports = {};\n__export(tag_exports, {\n addAnnotatedTagTask: () => addAnnotatedTagTask,\n addTagTask: () => addTagTask,\n tagListTask: () => tagListTask\n});\nfunction tagListTask(customArgs = []) {\n const hasCustomSort = customArgs.some((option) => /^--sort=/.test(option));\n return {\n format: \"utf-8\",\n commands: [\"tag\", \"-l\", ...customArgs],\n parser(text) {\n return parseTagList(text, hasCustomSort);\n }\n };\n}\nfunction addTagTask(name) {\n return {\n format: \"utf-8\",\n commands: [\"tag\", name],\n parser() {\n return { name };\n }\n };\n}\nfunction addAnnotatedTagTask(name, tagMessage) {\n return {\n format: \"utf-8\",\n commands: [\"tag\", \"-a\", \"-m\", tagMessage, name],\n parser() {\n return { name };\n }\n };\n}\nvar init_tag = __esm({\n \"src/lib/tasks/tag.ts\"() {\n \"use strict\";\n init_TagList();\n }\n});\n\n// src/git.js\nvar require_git = __commonJS({\n \"src/git.js\"(exports, module) {\n \"use strict\";\n var { GitExecutor: GitExecutor2 } = (init_git_executor(), __toCommonJS(git_executor_exports));\n var { SimpleGitApi: SimpleGitApi2 } = (init_simple_git_api(), __toCommonJS(simple_git_api_exports));\n var { Scheduler: Scheduler2 } = (init_scheduler(), __toCommonJS(scheduler_exports));\n var { adhocExecTask: adhocExecTask2, configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS(task_exports));\n var {\n asArray: asArray2,\n filterArray: filterArray2,\n filterPrimitives: filterPrimitives2,\n filterString: filterString2,\n filterStringOrStringArray: filterStringOrStringArray2,\n filterType: filterType2,\n getTrailingOptions: getTrailingOptions2,\n trailingFunctionArgument: trailingFunctionArgument2,\n trailingOptionsArgument: trailingOptionsArgument2\n } = (init_utils(), __toCommonJS(utils_exports));\n var { applyPatchTask: applyPatchTask2 } = (init_apply_patch(), __toCommonJS(apply_patch_exports));\n var {\n branchTask: branchTask2,\n branchLocalTask: branchLocalTask2,\n deleteBranchesTask: deleteBranchesTask2,\n deleteBranchTask: deleteBranchTask2\n } = (init_branch(), __toCommonJS(branch_exports));\n var { checkIgnoreTask: checkIgnoreTask2 } = (init_check_ignore(), __toCommonJS(check_ignore_exports));\n var { checkIsRepoTask: checkIsRepoTask2 } = (init_check_is_repo(), __toCommonJS(check_is_repo_exports));\n var { cleanWithOptionsTask: cleanWithOptionsTask2, isCleanOptionsArray: isCleanOptionsArray2 } = (init_clean(), __toCommonJS(clean_exports));\n var { diffSummaryTask: diffSummaryTask2 } = (init_diff(), __toCommonJS(diff_exports));\n var { fetchTask: fetchTask2 } = (init_fetch(), __toCommonJS(fetch_exports));\n var { moveTask: moveTask2 } = (init_move(), __toCommonJS(move_exports));\n var { pullTask: pullTask2 } = (init_pull(), __toCommonJS(pull_exports));\n var { pushTagsTask: pushTagsTask2 } = (init_push(), __toCommonJS(push_exports));\n var {\n addRemoteTask: addRemoteTask2,\n getRemotesTask: getRemotesTask2,\n listRemotesTask: listRemotesTask2,\n remoteTask: remoteTask2,\n removeRemoteTask: removeRemoteTask2\n } = (init_remote(), __toCommonJS(remote_exports));\n var { getResetMode: getResetMode2, resetTask: resetTask2 } = (init_reset(), __toCommonJS(reset_exports));\n var { stashListTask: stashListTask2 } = (init_stash_list(), __toCommonJS(stash_list_exports));\n var {\n addSubModuleTask: addSubModuleTask2,\n initSubModuleTask: initSubModuleTask2,\n subModuleTask: subModuleTask2,\n updateSubModuleTask: updateSubModuleTask2\n } = (init_sub_module(), __toCommonJS(sub_module_exports));\n var { addAnnotatedTagTask: addAnnotatedTagTask2, addTagTask: addTagTask2, tagListTask: tagListTask2 } = (init_tag(), __toCommonJS(tag_exports));\n var { straightThroughBufferTask: straightThroughBufferTask2, straightThroughStringTask: straightThroughStringTask2 } = (init_task(), __toCommonJS(task_exports));\n function Git2(options, plugins) {\n this._plugins = plugins;\n this._executor = new GitExecutor2(\n options.baseDir,\n new Scheduler2(options.maxConcurrentProcesses),\n plugins\n );\n this._trimmed = options.trimmed;\n }\n (Git2.prototype = Object.create(SimpleGitApi2.prototype)).constructor = Git2;\n Git2.prototype.customBinary = function(command) {\n this._plugins.reconfigure(\"binary\", command);\n return this;\n };\n Git2.prototype.env = function(name, value) {\n if (arguments.length === 1 && typeof name === \"object\") {\n this._executor.env = name;\n } else {\n (this._executor.env = this._executor.env || {})[name] = value;\n }\n return this;\n };\n Git2.prototype.stashList = function(options) {\n return this._runTask(\n stashListTask2(\n trailingOptionsArgument2(arguments) || {},\n filterArray2(options) && options || []\n ),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.mv = function(from, to) {\n return this._runTask(moveTask2(from, to), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.checkoutLatestTag = function(then) {\n var git = this;\n return this.pull(function() {\n git.tags(function(err, tags) {\n git.checkout(tags.latest, then);\n });\n });\n };\n Git2.prototype.pull = function(remote, branch, options, then) {\n return this._runTask(\n pullTask2(\n filterType2(remote, filterString2),\n filterType2(branch, filterString2),\n getTrailingOptions2(arguments)\n ),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.fetch = function(remote, branch) {\n return this._runTask(\n fetchTask2(\n filterType2(remote, filterString2),\n filterType2(branch, filterString2),\n getTrailingOptions2(arguments)\n ),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.silent = function(silence) {\n return this._runTask(\n adhocExecTask2(\n () => console.warn(\n \"simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.\"\n )\n )\n );\n };\n Git2.prototype.tags = function(options, then) {\n return this._runTask(\n tagListTask2(getTrailingOptions2(arguments)),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.rebase = function() {\n return this._runTask(\n straightThroughStringTask2([\"rebase\", ...getTrailingOptions2(arguments)]),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.reset = function(mode) {\n return this._runTask(\n resetTask2(getResetMode2(mode), getTrailingOptions2(arguments)),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.revert = function(commit) {\n const next = trailingFunctionArgument2(arguments);\n if (typeof commit !== \"string\") {\n return this._runTask(configurationErrorTask2(\"Commit must be a string\"), next);\n }\n return this._runTask(\n straightThroughStringTask2([\"revert\", ...getTrailingOptions2(arguments, 0, true), commit]),\n next\n );\n };\n Git2.prototype.addTag = function(name) {\n const task = typeof name === \"string\" ? addTagTask2(name) : configurationErrorTask2(\"Git.addTag requires a tag name\");\n return this._runTask(task, trailingFunctionArgument2(arguments));\n };\n Git2.prototype.addAnnotatedTag = function(tagName, tagMessage) {\n return this._runTask(\n addAnnotatedTagTask2(tagName, tagMessage),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.deleteLocalBranch = function(branchName, forceDelete, then) {\n return this._runTask(\n deleteBranchTask2(branchName, typeof forceDelete === \"boolean\" ? forceDelete : false),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.deleteLocalBranches = function(branchNames, forceDelete, then) {\n return this._runTask(\n deleteBranchesTask2(branchNames, typeof forceDelete === \"boolean\" ? forceDelete : false),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.branch = function(options, then) {\n return this._runTask(\n branchTask2(getTrailingOptions2(arguments)),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.branchLocal = function(then) {\n return this._runTask(branchLocalTask2(), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.raw = function(commands) {\n const createRestCommands = !Array.isArray(commands);\n const command = [].slice.call(createRestCommands ? arguments : commands, 0);\n for (let i = 0; i < command.length && createRestCommands; i++) {\n if (!filterPrimitives2(command[i])) {\n command.splice(i, command.length - i);\n break;\n }\n }\n command.push(...getTrailingOptions2(arguments, 0, true));\n var next = trailingFunctionArgument2(arguments);\n if (!command.length) {\n return this._runTask(\n configurationErrorTask2(\"Raw: must supply one or more command to execute\"),\n next\n );\n }\n return this._runTask(straightThroughStringTask2(command, this._trimmed), next);\n };\n Git2.prototype.submoduleAdd = function(repo, path, then) {\n return this._runTask(addSubModuleTask2(repo, path), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.submoduleUpdate = function(args, then) {\n return this._runTask(\n updateSubModuleTask2(getTrailingOptions2(arguments, true)),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.submoduleInit = function(args, then) {\n return this._runTask(\n initSubModuleTask2(getTrailingOptions2(arguments, true)),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.subModule = function(options, then) {\n return this._runTask(\n subModuleTask2(getTrailingOptions2(arguments)),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.listRemote = function() {\n return this._runTask(\n listRemotesTask2(getTrailingOptions2(arguments)),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.addRemote = function(remoteName, remoteRepo, then) {\n return this._runTask(\n addRemoteTask2(remoteName, remoteRepo, getTrailingOptions2(arguments)),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.removeRemote = function(remoteName, then) {\n return this._runTask(removeRemoteTask2(remoteName), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.getRemotes = function(verbose, then) {\n return this._runTask(getRemotesTask2(verbose === true), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.remote = function(options, then) {\n return this._runTask(\n remoteTask2(getTrailingOptions2(arguments)),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.tag = function(options, then) {\n const command = getTrailingOptions2(arguments);\n if (command[0] !== \"tag\") {\n command.unshift(\"tag\");\n }\n return this._runTask(straightThroughStringTask2(command), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.updateServerInfo = function(then) {\n return this._runTask(\n straightThroughStringTask2([\"update-server-info\"]),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.pushTags = function(remote, then) {\n const task = pushTagsTask2(\n { remote: filterType2(remote, filterString2) },\n getTrailingOptions2(arguments)\n );\n return this._runTask(task, trailingFunctionArgument2(arguments));\n };\n Git2.prototype.rm = function(files) {\n return this._runTask(\n straightThroughStringTask2([\"rm\", \"-f\", ...asArray2(files)]),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.rmKeepLocal = function(files) {\n return this._runTask(\n straightThroughStringTask2([\"rm\", \"--cached\", ...asArray2(files)]),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.catFile = function(options, then) {\n return this._catFile(\"utf-8\", arguments);\n };\n Git2.prototype.binaryCatFile = function() {\n return this._catFile(\"buffer\", arguments);\n };\n Git2.prototype._catFile = function(format, args) {\n var handler = trailingFunctionArgument2(args);\n var command = [\"cat-file\"];\n var options = args[0];\n if (typeof options === \"string\") {\n return this._runTask(\n configurationErrorTask2(\"Git.catFile: options must be supplied as an array of strings\"),\n handler\n );\n }\n if (Array.isArray(options)) {\n command.push.apply(command, options);\n }\n const task = format === \"buffer\" ? straightThroughBufferTask2(command) : straightThroughStringTask2(command);\n return this._runTask(task, handler);\n };\n Git2.prototype.diff = function(options, then) {\n const task = filterString2(options) ? configurationErrorTask2(\n \"git.diff: supplying options as a single string is no longer supported, switch to an array of strings\"\n ) : straightThroughStringTask2([\"diff\", ...getTrailingOptions2(arguments)]);\n return this._runTask(task, trailingFunctionArgument2(arguments));\n };\n Git2.prototype.diffSummary = function() {\n return this._runTask(\n diffSummaryTask2(getTrailingOptions2(arguments, 1)),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.applyPatch = function(patches) {\n const task = !filterStringOrStringArray2(patches) ? configurationErrorTask2(\n `git.applyPatch requires one or more string patches as the first argument`\n ) : applyPatchTask2(asArray2(patches), getTrailingOptions2([].slice.call(arguments, 1)));\n return this._runTask(task, trailingFunctionArgument2(arguments));\n };\n Git2.prototype.revparse = function() {\n const commands = [\"rev-parse\", ...getTrailingOptions2(arguments, true)];\n return this._runTask(\n straightThroughStringTask2(commands, true),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.clean = function(mode, options, then) {\n const usingCleanOptionsArray = isCleanOptionsArray2(mode);\n const cleanMode = usingCleanOptionsArray && mode.join(\"\") || filterType2(mode, filterString2) || \"\";\n const customArgs = getTrailingOptions2([].slice.call(arguments, usingCleanOptionsArray ? 1 : 0));\n return this._runTask(\n cleanWithOptionsTask2(cleanMode, customArgs),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.exec = function(then) {\n const task = {\n commands: [],\n format: \"utf-8\",\n parser() {\n if (typeof then === \"function\") {\n then();\n }\n }\n };\n return this._runTask(task);\n };\n Git2.prototype.clearQueue = function() {\n return this._runTask(\n adhocExecTask2(\n () => console.warn(\n \"simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.\"\n )\n )\n );\n };\n Git2.prototype.checkIgnore = function(pathnames, then) {\n return this._runTask(\n checkIgnoreTask2(asArray2(filterType2(pathnames, filterStringOrStringArray2, []))),\n trailingFunctionArgument2(arguments)\n );\n };\n Git2.prototype.checkIsRepo = function(checkType, then) {\n return this._runTask(\n checkIsRepoTask2(filterType2(checkType, filterString2)),\n trailingFunctionArgument2(arguments)\n );\n };\n module.exports = Git2;\n }\n});\n\n// src/lib/api.ts\nimport { pathspec } from \"@simple-git/args-pathspec\";\n\n// src/lib/errors/git-construct-error.ts\ninit_git_error();\nvar GitConstructError = class extends GitError {\n constructor(config, message) {\n super(void 0, message);\n this.config = config;\n }\n};\n\n// src/lib/api.ts\ninit_git_error();\n\n// src/lib/errors/git-plugin-error.ts\ninit_git_error();\nvar GitPluginError = class extends GitError {\n constructor(task, plugin, message) {\n super(task, message);\n this.task = task;\n this.plugin = plugin;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n};\n\n// src/lib/api.ts\ninit_git_response_error();\ninit_task_configuration_error();\ninit_check_is_repo();\ninit_clean();\ninit_config();\ninit_diff_name_status();\ninit_grep();\ninit_reset();\n\n// src/lib/plugins/abort-plugin.ts\nfunction abortPlugin(signal) {\n if (!signal) {\n return;\n }\n const onSpawnAfter = {\n type: \"spawn.after\",\n action(_data, context) {\n function kill() {\n context.kill(new GitPluginError(void 0, \"abort\", \"Abort signal received\"));\n }\n signal.addEventListener(\"abort\", kill);\n context.spawned.on(\"close\", () => signal.removeEventListener(\"abort\", kill));\n }\n };\n const onSpawnBefore = {\n type: \"spawn.before\",\n action(_data, context) {\n if (signal.aborted) {\n context.kill(new GitPluginError(void 0, \"abort\", \"Abort already signaled\"));\n }\n }\n };\n return [onSpawnBefore, onSpawnAfter];\n}\n\n// src/lib/plugins/block-unsafe-operations-plugin.ts\nimport { vulnerabilityCheck } from \"@simple-git/argv-parser\";\nfunction blockUnsafeOperationsPlugin(options = {}) {\n return {\n type: \"spawn.args\",\n action(args, { env }) {\n for (const vulnerability of vulnerabilityCheck(args, env)) {\n if (options[vulnerability.category] !== true) {\n throw new GitPluginError(void 0, \"unsafe\", vulnerability.message);\n }\n }\n return args;\n }\n };\n}\n\n// src/lib/plugins/command-config-prefixing-plugin.ts\ninit_utils();\nfunction commandConfigPrefixingPlugin(configuration) {\n const prefix = prefixedArray(configuration, \"-c\");\n return {\n type: \"spawn.args\",\n action(data) {\n return [...prefix, ...data];\n }\n };\n}\n\n// src/lib/plugins/completion-detection.plugin.ts\ninit_utils();\nimport { deferred } from \"@kwsites/promise-deferred\";\nvar never = deferred().promise;\nfunction completionDetectionPlugin({\n onClose = true,\n onExit = 50\n} = {}) {\n function createEvents() {\n let exitCode = -1;\n const events = {\n close: deferred(),\n closeTimeout: deferred(),\n exit: deferred(),\n exitTimeout: deferred()\n };\n const result = Promise.race([\n onClose === false ? never : events.closeTimeout.promise,\n onExit === false ? never : events.exitTimeout.promise\n ]);\n configureTimeout(onClose, events.close, events.closeTimeout);\n configureTimeout(onExit, events.exit, events.exitTimeout);\n return {\n close(code) {\n exitCode = code;\n events.close.done();\n },\n exit(code) {\n exitCode = code;\n events.exit.done();\n },\n get exitCode() {\n return exitCode;\n },\n result\n };\n }\n function configureTimeout(flag, event, timeout) {\n if (flag === false) {\n return;\n }\n (flag === true ? event.promise : event.promise.then(() => delay(flag))).then(timeout.done);\n }\n return {\n type: \"spawn.after\",\n async action(_data, { spawned, close }) {\n const events = createEvents();\n let deferClose = true;\n let quickClose = () => void (deferClose = false);\n spawned.stdout?.on(\"data\", quickClose);\n spawned.stderr?.on(\"data\", quickClose);\n spawned.on(\"error\", quickClose);\n spawned.on(\"close\", (code) => events.close(code));\n spawned.on(\"exit\", (code) => events.exit(code));\n try {\n await events.result;\n if (deferClose) {\n await delay(50);\n }\n close(events.exitCode);\n } catch (err) {\n close(events.exitCode, err);\n }\n }\n };\n}\n\n// src/lib/plugins/custom-binary.plugin.ts\ninit_utils();\nvar WRONG_NUMBER_ERR = `Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`;\nvar WRONG_CHARS_ERR = `Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;\nfunction isBadArgument(arg) {\n return !arg || !/^([a-z]:)?([a-z0-9/.\\\\_~-]+)$/i.test(arg);\n}\nfunction toBinaryConfig(input, allowUnsafe) {\n if (input.length < 1 || input.length > 2) {\n throw new GitPluginError(void 0, \"binary\", WRONG_NUMBER_ERR);\n }\n const isBad = input.some(isBadArgument);\n if (isBad) {\n if (allowUnsafe) {\n console.warn(WRONG_CHARS_ERR);\n } else {\n throw new GitPluginError(void 0, \"binary\", WRONG_CHARS_ERR);\n }\n }\n const [binary, prefix] = input;\n return {\n binary,\n prefix\n };\n}\nfunction customBinaryPlugin(plugins, input = [\"git\"], allowUnsafe = false) {\n let config = toBinaryConfig(asArray(input), allowUnsafe);\n plugins.on(\"binary\", (input2) => {\n config = toBinaryConfig(asArray(input2), allowUnsafe);\n });\n plugins.append(\"spawn.binary\", () => {\n return config.binary;\n });\n plugins.append(\"spawn.args\", (data) => {\n return config.prefix ? [config.prefix, ...data] : data;\n });\n}\n\n// src/lib/plugins/error-detection.plugin.ts\ninit_git_error();\nfunction isTaskError(result) {\n return !!(result.exitCode && result.stdErr.length);\n}\nfunction getErrorMessage(result) {\n return Buffer.concat([...result.stdOut, ...result.stdErr]);\n}\nfunction errorDetectionHandler(overwrite = false, isError = isTaskError, errorMessage = getErrorMessage) {\n return (error, result) => {\n if (!overwrite && error || !isError(result)) {\n return error;\n }\n return errorMessage(result);\n };\n}\nfunction errorDetectionPlugin(config) {\n return {\n type: \"task.error\",\n action(data, context) {\n const error = config(data.error, {\n stdErr: context.stdErr,\n stdOut: context.stdOut,\n exitCode: context.exitCode\n });\n if (Buffer.isBuffer(error)) {\n return { error: new GitError(void 0, error.toString(\"utf-8\")) };\n }\n return {\n error\n };\n }\n };\n}\n\n// src/lib/plugins/plugin-store.ts\ninit_utils();\nimport { EventEmitter } from \"node:events\";\nvar PluginStore = class {\n constructor() {\n this.plugins = /* @__PURE__ */ new Set();\n this.events = new EventEmitter();\n }\n on(type, listener) {\n this.events.on(type, listener);\n }\n reconfigure(type, data) {\n this.events.emit(type, data);\n }\n append(type, action) {\n const plugin = append(this.plugins, { type, action });\n return () => this.plugins.delete(plugin);\n }\n add(plugin) {\n const plugins = [];\n asArray(plugin).forEach((plugin2) => plugin2 && this.plugins.add(append(plugins, plugin2)));\n return () => {\n plugins.forEach((plugin2) => this.plugins.delete(plugin2));\n };\n }\n exec(type, data, context) {\n let output = data;\n const contextual = Object.freeze(Object.create(context));\n for (const plugin of this.plugins) {\n if (plugin.type === type) {\n output = plugin.action(output, contextual);\n }\n }\n return output;\n }\n};\n\n// src/lib/plugins/progress-monitor-plugin.ts\ninit_utils();\nfunction progressMonitorPlugin(progress) {\n const progressCommand = \"--progress\";\n const progressMethods = [\"checkout\", \"clone\", \"fetch\", \"pull\", \"push\"];\n const onProgress = {\n type: \"spawn.after\",\n action(_data, context) {\n if (!context.commands.includes(progressCommand)) {\n return;\n }\n context.spawned.stderr?.on(\"data\", (chunk) => {\n const message = /^([\\s\\S]+?):\\s*(\\d+)% \\((\\d+)\\/(\\d+)\\)/.exec(chunk.toString(\"utf8\"));\n if (!message) {\n return;\n }\n progress({\n method: context.method,\n stage: progressEventStage(message[1]),\n progress: asNumber(message[2]),\n processed: asNumber(message[3]),\n total: asNumber(message[4])\n });\n });\n }\n };\n const onArgs = {\n type: \"spawn.args\",\n action(args, context) {\n if (!progressMethods.includes(context.method)) {\n return args;\n }\n return including(args, progressCommand);\n }\n };\n return [onArgs, onProgress];\n}\nfunction progressEventStage(input) {\n return String(input.toLowerCase().split(\" \", 1)) || \"unknown\";\n}\n\n// src/lib/plugins/spawn-options-plugin.ts\ninit_utils();\nfunction spawnOptionsPlugin(spawnOptions) {\n const options = pick(spawnOptions, [\"uid\", \"gid\"]);\n return {\n type: \"spawn.options\",\n action(data) {\n return { ...options, ...data };\n }\n };\n}\n\n// src/lib/plugins/timout-plugin.ts\nfunction timeoutPlugin({\n block,\n stdErr = true,\n stdOut = true\n}) {\n if (block > 0) {\n return {\n type: \"spawn.after\",\n action(_data, context) {\n let timeout;\n function wait() {\n timeout && clearTimeout(timeout);\n timeout = setTimeout(kill, block);\n }\n function stop() {\n context.spawned.stdout?.off(\"data\", wait);\n context.spawned.stderr?.off(\"data\", wait);\n context.spawned.off(\"exit\", stop);\n context.spawned.off(\"close\", stop);\n timeout && clearTimeout(timeout);\n }\n function kill() {\n stop();\n context.kill(new GitPluginError(void 0, \"timeout\", `block timeout reached`));\n }\n stdOut && context.spawned.stdout?.on(\"data\", wait);\n stdErr && context.spawned.stderr?.on(\"data\", wait);\n context.spawned.on(\"exit\", stop);\n context.spawned.on(\"close\", stop);\n wait();\n }\n };\n }\n}\n\n// src/lib/plugins/suffix-paths.plugin.ts\nimport { isPathSpec as isPathSpec3, toPaths } from \"@simple-git/args-pathspec\";\nfunction suffixPathsPlugin() {\n return {\n type: \"spawn.args\",\n action(data) {\n const prefix = [];\n let suffix;\n function append2(args) {\n (suffix = suffix || []).push(...args);\n }\n for (let i = 0; i < data.length; i++) {\n const param = data[i];\n if (isPathSpec3(param)) {\n append2(toPaths(param));\n continue;\n }\n if (param === \"--\") {\n append2(\n data.slice(i + 1).flatMap((item) => isPathSpec3(item) && toPaths(item) || item)\n );\n break;\n }\n prefix.push(param);\n }\n return !suffix ? prefix : [...prefix, \"--\", ...suffix.map(String)];\n }\n };\n}\n\n// src/lib/git-factory.ts\ninit_utils();\nvar Git = require_git();\nfunction gitInstanceFactory(baseDir, options) {\n const plugins = new PluginStore();\n const config = createInstanceConfig(\n baseDir && (typeof baseDir === \"string\" ? { baseDir } : baseDir) || {},\n options\n );\n if (!folderExists(config.baseDir)) {\n throw new GitConstructError(\n config,\n `Cannot use simple-git on a directory that does not exist`\n );\n }\n if (Array.isArray(config.config)) {\n plugins.add(commandConfigPrefixingPlugin(config.config));\n }\n plugins.add(blockUnsafeOperationsPlugin(config.unsafe));\n plugins.add(completionDetectionPlugin(config.completion));\n config.abort && plugins.add(abortPlugin(config.abort));\n config.progress && plugins.add(progressMonitorPlugin(config.progress));\n config.timeout && plugins.add(timeoutPlugin(config.timeout));\n config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));\n plugins.add(suffixPathsPlugin());\n plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));\n config.errors && plugins.add(errorDetectionPlugin(config.errors));\n customBinaryPlugin(plugins, config.binary, config.unsafe?.allowUnsafeCustomBinary);\n return new Git(config, plugins);\n}\n\n// src/lib/runners/promise-wrapped.ts\ninit_git_response_error();\nvar functionNamesBuilderApi = [\"customBinary\", \"env\", \"outputHandler\", \"silent\"];\nvar functionNamesPromiseApi = [\n \"add\",\n \"addAnnotatedTag\",\n \"addConfig\",\n \"addRemote\",\n \"addTag\",\n \"applyPatch\",\n \"binaryCatFile\",\n \"branch\",\n \"branchLocal\",\n \"catFile\",\n \"checkIgnore\",\n \"checkIsRepo\",\n \"checkout\",\n \"checkoutBranch\",\n \"checkoutLatestTag\",\n \"checkoutLocalBranch\",\n \"clean\",\n \"clone\",\n \"commit\",\n \"cwd\",\n \"deleteLocalBranch\",\n \"deleteLocalBranches\",\n \"diff\",\n \"diffSummary\",\n \"exec\",\n \"fetch\",\n \"getRemotes\",\n \"init\",\n \"listConfig\",\n \"listRemote\",\n \"log\",\n \"merge\",\n \"mergeFromTo\",\n \"mirror\",\n \"mv\",\n \"pull\",\n \"push\",\n \"pushTags\",\n \"raw\",\n \"rebase\",\n \"remote\",\n \"removeRemote\",\n \"reset\",\n \"revert\",\n \"revparse\",\n \"rm\",\n \"rmKeepLocal\",\n \"show\",\n \"stash\",\n \"stashList\",\n \"status\",\n \"subModule\",\n \"submoduleAdd\",\n \"submoduleInit\",\n \"submoduleUpdate\",\n \"tag\",\n \"tags\",\n \"updateServerInfo\"\n];\nfunction gitP(...args) {\n let git;\n let chain = Promise.resolve();\n try {\n git = gitInstanceFactory(...args);\n } catch (e) {\n chain = Promise.reject(e);\n }\n function builderReturn() {\n return promiseApi;\n }\n function chainReturn() {\n return chain;\n }\n const promiseApi = [...functionNamesBuilderApi, ...functionNamesPromiseApi].reduce(\n (api, name) => {\n const isAsync = functionNamesPromiseApi.includes(name);\n const valid = isAsync ? asyncWrapper(name, git) : syncWrapper(name, git, api);\n const alternative = isAsync ? chainReturn : builderReturn;\n Object.defineProperty(api, name, {\n enumerable: false,\n configurable: false,\n value: git ? valid : alternative\n });\n return api;\n },\n {}\n );\n return promiseApi;\n function asyncWrapper(fn, git2) {\n return function(...args2) {\n if (typeof args2[args2.length] === \"function\") {\n throw new TypeError(\n \"Promise interface requires that handlers are not supplied inline, trailing function not allowed in call to \" + fn\n );\n }\n return chain.then(function() {\n return new Promise(function(resolve, reject) {\n const callback = (err, result) => {\n if (err) {\n return reject(toError(err));\n }\n resolve(result);\n };\n args2.push(callback);\n git2[fn].apply(git2, args2);\n });\n });\n };\n }\n function syncWrapper(fn, git2, api) {\n return (...args2) => {\n git2[fn](...args2);\n return api;\n };\n }\n}\nfunction toError(error) {\n if (error instanceof Error) {\n return error;\n }\n if (typeof error === \"string\") {\n return new Error(error);\n }\n return new GitResponseError(error);\n}\n\n// src/esm.mjs\nvar simpleGit = gitInstanceFactory;\nvar esm_default = gitInstanceFactory;\nexport {\n CheckRepoActions,\n CleanOptions,\n DiffNameStatus,\n GitConfigScope,\n GitConstructError,\n GitError,\n GitPluginError,\n GitResponseError,\n ResetMode,\n TaskConfigurationError,\n esm_default as default,\n gitP,\n grepQueryBuilder,\n pathspec,\n simpleGit\n};\n//# sourceMappingURL=index.js.map\n","/**\n * Git credential injection (docs/designs/github-app-git-credentials.md\n * §git 操作注入 / §子仓库) — the TWO secret-free channels that point every git\n * process at `agentconnect git-credential`:\n *\n * 1. Repo-local `.git/config` (written once post-clone): covers agent-run git\n * in the main checkout. Multiple agents can share one checkout — the file\n * carries the LAST writer's agentId, so channel 2 is authoritative there.\n * 2. Session-env `GIT_CONFIG_GLOBAL` pointing at a generated per-agent\n * gitconfig (includes the user's real global config first). Inherited by\n * the WHOLE agent process tree — submodules and nested clones hit OUR\n * helper (and get a clean denial) instead of leaking to a machine-global\n * osxkeychain credential. NOT GIT_CONFIG_COUNT: the indexed env vars don't\n * merge across processes, so any child that sets its own COUNT would\n * silently drop the reset and reopen the leak.\n *\n * All config values single-quote the shim path (git runs `!`-helpers via\n * `sh -c` — a space in $HOME must not word-split), reset the helper list first\n * (empty entry) and set useHttpPath=true (git strips `path` from credential\n * lookups by default; the reset-list semantics for URL-scoped keys are\n * implementation behavior verified on git ≥2.32 — see the design doc).\n *\n * Everything written here is a POINTER to the daemon — never a secret.\n */\nimport { execFile } from 'node:child_process'\nimport { mkdirSync, writeFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\nimport { simpleGit, type SimpleGit } from 'simple-git'\n\n/**\n * simple-git ≥3.36 vulnerability-checks argv AND any child env passed via\n * `.env()` (blockUnsafeOperationsPlugin → @simple-git/argv-parser). Two\n * behaviors matter here:\n *\n * - configuring `credential.helper` (any scope — argv `config` writes AND\n * GIT_CONFIG_KEY_n pairs) and the GIT_CONFIG_COUNT env channel itself each\n * need their own unsafe opt-in;\n * - a NAME blocklist of editor/pager/ssh/askpass/exec-path env vars is\n * refused outright, presence-based — the value is never read, so an empty\n * string or the operator's login-shell EDITOR both throw.\n *\n * Our helper injection IS the feature — opt in to exactly the two categories\n * whose values the daemon constructs itself. The host-shell noise (EDITOR,\n * stray GIT_DIR, a host GIT_CONFIG_*) gets SANITIZED instead: none of it\n * belongs in a daemon-run git child.\n */\nconst UNSAFE_OPTS = {\n unsafe: {\n allowUnsafeCredentialHelper: true, // the daemon-built credential.https://github.com.helper pairs\n allowUnsafeConfigEnvCount: true // the daemon-built GIT_CONFIG_COUNT/KEY_n/VALUE_n channel\n }\n} as const\n\n/**\n * simple-git bound to a cwd with the credential-helper opt-in. An `abort`\n * signal KILLS the spawned git child (abort-plugin) — pair budget timeouts\n * with it, or the abandoned child keeps running and holds .git locks\n * (index.lock) into the next session's pull.\n */\nexport function gitFor(cwd?: string, abort?: AbortSignal): SimpleGit {\n return simpleGit({\n ...(cwd ? { baseDir: cwd } : {}),\n ...(abort ? { abort } : {}),\n ...UNSAFE_OPTS\n })\n}\n\n// Every env var simple-git's checker refuses by NAME (it matches\n// case-insensitively — mirror that) + repo-context overrides that must never\n// leak into a clone/pull child. VISUAL rides along with the editor family.\nconst HOST_ENV_STRIP = new Set([\n 'EDITOR',\n 'VISUAL',\n 'PAGER',\n 'PREFIX',\n 'GIT_EDITOR',\n 'GIT_SEQUENCE_EDITOR',\n 'GIT_PAGER',\n 'GIT_SSH',\n 'GIT_SSH_COMMAND',\n 'GIT_ASKPASS',\n 'SSH_ASKPASS',\n 'GIT_EXEC_PATH',\n 'GIT_EXTERNAL_DIFF',\n 'GIT_PROXY_COMMAND',\n 'GIT_TEMPLATE_DIR',\n 'GIT_DIR',\n 'GIT_WORK_TREE',\n 'GIT_INDEX_FILE',\n 'GIT_NAMESPACE',\n 'GIT_CONFIG',\n 'GIT_CONFIG_GLOBAL',\n 'GIT_CONFIG_SYSTEM'\n])\n\n/**\n * `process.env` minus host-shell git noise — the base for every daemon-run git\n * child. The host keeps its ambient capabilities (PATH, HOME → ~/.gitconfig\n * and ~/.ssh/config, SSH_AUTH_SOCK, proxies); what goes is anything the\n * checker blocks by name plus repo-context overrides. A host that truly needs\n * e.g. a custom ssh command can set core.sshCommand in ~/.gitconfig — config\n * FILES are honored as ever, only env-var overrides are dropped.\n */\nexport function gitEnvBase(): Record<string, string> {\n const env: Record<string, string> = {}\n for (const [k, v] of Object.entries(process.env)) {\n if (v === undefined) continue\n const key = k.toUpperCase()\n if (HOST_ENV_STRIP.has(key)) continue\n if (key.startsWith('GIT_CONFIG_')) continue // stray host GIT_CONFIG_COUNT/KEY_n/VALUE_n\n env[k] = v\n }\n return env\n}\n\n/** Module-level init (workspace-manager is functional; mirrors cloneInFlight). */\nlet shimPath: string | undefined\nlet runDir: string | undefined\nlet preWarm: ((agentId: string, reason: 'clone' | 'pull') => Promise<void>) | undefined\n\nexport function initGitInjection(opts: {\n shimPath: string\n runDir: string\n /** Warm the daemon credential cache BEFORE a timed git op (never inside its budget). */\n preWarm: (agentId: string, reason: 'clone' | 'pull') => Promise<void>\n}): void {\n shimPath = opts.shimPath\n runDir = opts.runDir\n preWarm = opts.preWarm\n}\n\nfunction quotedHelper(agentId: string): string {\n if (!shimPath) throw new Error('git credential injection is not initialized')\n return `!'${shimPath.replaceAll(\"'\", \"'\\\\''\")}' ${agentId}`\n}\n\n/** The three github.com-scoped config pairs both channels share. */\nfunction configPairs(agentId: string): Array<[string, string]> {\n return [\n ['credential.https://github.com.helper', ''], // reset: machine helpers must never answer for github.com\n ['credential.https://github.com.helper', quotedHelper(agentId)],\n ['credential.https://github.com.useHttpPath', 'true'] // git strips `path` otherwise — the helper wants it\n ]\n}\n\n/**\n * Env for a DAEMON-RUN git process (clone — no repo config exists yet).\n * Spread over `process.env` by the caller: simple-git's `.env()` REPLACES the\n * child environment (v3.36 verified), a bare object would strip PATH/HOME.\n */\nexport function cloneGitEnv(agentId: string): Record<string, string> {\n const pairs = configPairs(agentId)\n const env: Record<string, string> = {\n GIT_TERMINAL_PROMPT: '0',\n GIT_CONFIG_COUNT: String(pairs.length)\n }\n pairs.forEach(([k, v], i) => {\n env[`GIT_CONFIG_KEY_${i}`] = k\n env[`GIT_CONFIG_VALUE_${i}`] = v\n })\n return env\n}\n\n/**\n * Session-env channel: (re)write the per-agent gitconfig and return the env to\n * inject into the agent's ACP runtime process. Regenerated on every host spawn\n * (#251 retries rebuild the host ⇒ this re-runs).\n */\nexport function sessionGitEnv(agentId: string): Record<string, string> {\n if (!runDir) throw new Error('git credential injection is not initialized')\n const dir = join(runDir, 'gitcred')\n mkdirSync(dir, { recursive: true, mode: 0o700 })\n const file = join(dir, `${agentId}.gitconfig`)\n const lines = [\n '# agentconnect session git config — regenerated on agent start; NO secrets.',\n '# Keeps the user global config, then pins github.com credentials to the daemon helper.',\n '[include]',\n `\\tpath = ${join(homedir(), '.gitconfig')}`,\n '[credential \"https://github.com\"]',\n '\\thelper = ', // reset the accumulated helper list for github.com\n `\\thelper = ${quotedHelper(agentId)}`,\n '\\tuseHttpPath = true',\n ''\n ]\n writeFileSync(file, lines.join('\\n'), { mode: 0o644 })\n return { GIT_CONFIG_GLOBAL: file, GIT_TERMINAL_PROMPT: '0' }\n}\n\n/** Post-clone: pin the repo-local helper so agent-run git in the checkout works. */\nexport async function writeRepoHelperConfig(cwd: string, agentId: string): Promise<void> {\n const git = gitFor(cwd)\n // `--replace-all` on the first write resets any stale helper list from a\n // previous agent generation; addConfig(append=true) accumulates the rest.\n await git.raw(['config', '--replace-all', 'credential.https://github.com.helper', ''])\n await git.raw(['config', '--add', 'credential.https://github.com.helper', quotedHelper(agentId)])\n await git.raw(['config', 'credential.https://github.com.useHttpPath', 'true'])\n}\n\n/** Pre-warm hook for workspace-manager (no-op until initialized). */\nexport async function preWarmGitCred(agentId: string, reason: 'clone' | 'pull'): Promise<void> {\n if (!preWarm) return\n await preWarm(agentId, reason)\n}\n\n// The session channel (GIT_CONFIG_GLOBAL) needs git ≥ 2.32 and DEGRADES\n// SILENTLY below it — old git just ignores the variable and agent-run git\n// falls through to whatever machine credentials exist. The clone channel\n// (GIT_CONFIG_COUNT/KEY_n/VALUE_n) needs ≥ 2.31 and fails loudly instead.\nconst MIN_GIT: readonly [number, number] = [2, 32]\n\n/** `git version 2.39.5 (Apple Git-154)` → [2, 39]; null when unparseable. */\nexport function parseGitVersion(raw: string): [number, number] | null {\n const m = /git version (\\d+)\\.(\\d+)/.exec(raw)\n return m ? [Number(m[1]), Number(m[2])] : null\n}\n\n/**\n * Boot-time probe (fire-and-forget): a host below the floor would otherwise\n * only show up as a mysterious credential prompt / auth failure deep inside an\n * agent session — say it once, at startup, in plain words.\n */\nexport function probeGitVersion(warn: (msg: string) => void): void {\n execFile('git', ['--version'], { timeout: 5_000 }, (err, stdout) => {\n if (err) {\n warn('git probe: `git --version` failed — git workspaces will not work on this host')\n return\n }\n const v = parseGitVersion(String(stdout))\n if (!v) return // vendor-mangled banner — do not cry wolf\n const [major, minor] = v\n if (major > MIN_GIT[0] || (major === MIN_GIT[0] && minor >= MIN_GIT[1])) return\n const cloneToo = major < 2 || (major === 2 && minor < 31)\n warn(\n `git ${major}.${minor} found but github-app workspaces need git >= ${MIN_GIT[0]}.${MIN_GIT[1]}: ` +\n 'this git silently ignores the session credential channel (GIT_CONFIG_GLOBAL)' +\n (cloneToo ? ' and clone-time injection (GIT_CONFIG_COUNT, needs >= 2.31) will fail' : '')\n )\n })\n}\n","import { mkdirSync, existsSync, rmSync } from 'node:fs'\nimport { join } from 'node:path'\nimport { normalizeGitUrl } from '@agentconnect.md/protocol'\nimport type { Agent } from '../agents/agent-schema.js'\nimport { cloneGitEnv, gitEnvBase, gitFor, preWarmGitCred, writeRepoHelperConfig } from './git-injection.js'\n\nconst PULL_TIMEOUT_MS = 4500\n\n// Single-flight clone lock keyed by the absolute cwd. Two concurrent sessions\n// (especially multiple agents sharing one repo checkout) must not race into the\n// same dir — the second awaits the first's in-flight clone instead of re-cloning.\nconst cloneInFlight = new Map<string, Promise<void>>()\n\nfunction usesGithubApp(agent: Agent): boolean {\n return agent.workspace.mode === 'git-repo' && agent.workspace.gitCredential === 'github-app'\n}\n\nexport async function prepareWorkspace(agent: Agent): Promise<string> {\n const cwd = agent.workspace.path\n mkdirSync(cwd, { recursive: true })\n\n if (agent.workspace.mode === 'from-scratch') {\n // The agent's memory file lives at the agent ROOT (outside the workspace) and\n // is seeded separately (see agents/memory.ts `ensureMemory`), so from-scratch\n // just needs the (empty) workspace dir to exist.\n return cwd\n }\n\n // git-repo, first session: no checkout yet → clone. Unlike pull, a clone has no\n // on-disk fallback, so on failure we THROW (the session creation fails + the error\n // surfaces) rather than silently proceeding with an empty dir (design §4.3).\n if (!existsSync(join(cwd, '.git'))) {\n await cloneRepo(agent)\n return cwd\n }\n\n // git-repo, existing checkout: best-effort ff-only pull; never block/throw on\n // offline (design §4.3) — proceed with the on-disk checkout.\n if (agent.workspace.pullOnNewSession) {\n // github-app: warm the credential cache OUTSIDE the pull budget — a cold\n // cache means a CP round trip that would otherwise eat the whole 4.5s.\n if (usesGithubApp(agent)) await preWarmGitCred(agent.id, 'pull').catch(() => undefined)\n // Abort-driven budget: the signal makes simple-git KILL the git child at\n // the deadline. A bare Promise.race would abandon it still running — a\n // wedged pull (network black hole) then holds .git/index.lock into the\n // next session's pull.\n const abort = new AbortController()\n const timer = setTimeout(() => abort.abort(), PULL_TIMEOUT_MS)\n try {\n await gitFor(cwd, abort.signal)\n .env({ ...gitEnvBase(), GIT_TERMINAL_PROMPT: '0' })\n .pull(['--ff-only'])\n } catch {\n // offline / timed out / non-fast-forward: proceed with the on-disk checkout\n } finally {\n clearTimeout(timer)\n }\n }\n return cwd\n}\n\n/**\n * Eagerly clone a git-repo workspace that has no checkout yet — for reconcile-time\n * prefetch so the repo is warm before the first message arrives. No-op for\n * from-scratch or an already-cloned checkout (the session-time `prepareWorkspace`\n * stays authoritative and still owns pull + hard-fail). Reuses the single-flight\n * lock so a prefetch and a concurrent session-start clone never race into the same\n * dir. The caller invokes this fire-and-forget and logs any rejection — clone\n * failure here is non-fatal because `prepareWorkspace` re-clones (and hard-fails)\n * on the first session as the backstop.\n */\nexport async function prefetchWorkspace(agent: Agent): Promise<void> {\n if (agent.workspace.mode !== 'git-repo') return\n const cwd = agent.workspace.path\n if (existsSync(join(cwd, '.git'))) return\n mkdirSync(cwd, { recursive: true })\n await cloneRepo(agent)\n}\n\n/** Clone agent.workspace.gitRepo @ gitBranch into cwd, single-flight per cwd. */\nasync function cloneRepo(agent: Agent): Promise<void> {\n const cwd = agent.workspace.path\n const inflight = cloneInFlight.get(cwd)\n if (inflight) return inflight\n\n // Stored value should already be a full address, but normalize defensively —\n // a hand-edited or pre-normalization agent.json may still say \"org/repo\",\n // which git would treat as a local path (\"repository ... does not exist\").\n const gitRepo = agent.workspace.gitRepo && normalizeGitUrl(agent.workspace.gitRepo)\n if (!gitRepo) throw new Error(`workspace clone: agent \"${agent.id}\" has git-repo mode but no gitRepo configured`)\n const branch = agent.workspace.gitBranch\n const githubApp = usesGithubApp(agent)\n\n const p = (async () => {\n // github-app: credentials ride the env-injected helper (no repo config exists\n // yet). SPREAD over process.env — simple-git's .env() REPLACES the child env.\n if (githubApp) await preWarmGitCred(agent.id, 'clone')\n const git = githubApp\n ? gitFor().env({ ...gitEnvBase(), ...cloneGitEnv(agent.id) })\n : gitFor().env({ ...gitEnvBase(), GIT_TERMINAL_PROMPT: '0' })\n try {\n await git.clone(gitRepo, cwd, ['--branch', branch, '--single-branch'])\n } catch (e) {\n // A failed clone leaves a half-written dir whose stray `.git` would make\n // every later attempt think the checkout exists — clean before rethrowing.\n rmSync(join(cwd, '.git'), { recursive: true, force: true })\n throw e\n }\n // Pin the repo-local helper so AGENT-run git in this checkout authenticates\n // through the daemon too — the \"no credentials on the machine, but the agent\n // can still push\" half of the design.\n if (githubApp) await writeRepoHelperConfig(cwd, agent.id)\n })().finally(() => {\n cloneInFlight.delete(cwd)\n })\n cloneInFlight.set(cwd, p)\n return p\n}\n","// This file is auto-generated by @hey-api/openapi-ts\nexport const AGENT_METHODS = {\n initialize: \"initialize\",\n authenticate: \"authenticate\",\n providers_list: \"providers/list\",\n providers_set: \"providers/set\",\n providers_disable: \"providers/disable\",\n session_new: \"session/new\",\n session_load: \"session/load\",\n session_set_mode: \"session/set_mode\",\n session_set_config_option: \"session/set_config_option\",\n session_prompt: \"session/prompt\",\n session_cancel: \"session/cancel\",\n mcp_message: \"mcp/message\",\n session_list: \"session/list\",\n session_delete: \"session/delete\",\n session_fork: \"session/fork\",\n session_resume: \"session/resume\",\n session_close: \"session/close\",\n logout: \"logout\",\n nes_start: \"nes/start\",\n nes_suggest: \"nes/suggest\",\n nes_accept: \"nes/accept\",\n nes_reject: \"nes/reject\",\n nes_close: \"nes/close\",\n document_did_open: \"document/didOpen\",\n document_did_change: \"document/didChange\",\n document_did_close: \"document/didClose\",\n document_did_save: \"document/didSave\",\n document_did_focus: \"document/didFocus\",\n};\nexport const CLIENT_METHODS = {\n session_request_permission: \"session/request_permission\",\n session_update: \"session/update\",\n fs_write_text_file: \"fs/write_text_file\",\n fs_read_text_file: \"fs/read_text_file\",\n terminal_create: \"terminal/create\",\n terminal_output: \"terminal/output\",\n terminal_release: \"terminal/release\",\n terminal_wait_for_exit: \"terminal/wait_for_exit\",\n terminal_kill: \"terminal/kill\",\n mcp_connect: \"mcp/connect\",\n mcp_message: \"mcp/message\",\n mcp_disconnect: \"mcp/disconnect\",\n elicitation_create: \"elicitation/create\",\n elicitation_complete: \"elicitation/complete\",\n};\nexport const PROTOCOL_METHODS = {\n cancel_request: \"$/cancel_request\",\n};\nexport const PROTOCOL_VERSION = 1;\n//# sourceMappingURL=index.js.map","import { z } from \"zod/v4\";\nconst skippedItem = Symbol(\"skippedItem\");\nexport function defaultOnError(schema, fallback) {\n return schema.catch(fallback);\n}\nexport function requiredDefaultOnError(schema, fallback) {\n const schemaWithCatch = schema.catch(fallback);\n return z.unknown().transform((value, context) => {\n if (value !== undefined)\n return schemaWithCatch.parse(value);\n context.addIssue({\n code: \"custom\",\n message: \"Required value is missing\",\n });\n return z.NEVER;\n });\n}\nexport function vecSkipError(itemSchema) {\n return z\n .array(itemSchema.catch(skippedItem))\n .transform((items) => items.filter((item) => item !== skippedItem));\n}\n//# sourceMappingURL=schema-deserialize.js.map","// This file is auto-generated by @hey-api/openapi-ts\nimport { defaultOnError, requiredDefaultOnError, vecSkipError, } from \"../schema-deserialize.js\";\nimport * as z from \"zod/v4\";\n/**\n * JSON RPC Request Id\n *\n * An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null \\[1\\] and Numbers SHOULD NOT contain fractional parts \\[2\\]\n *\n * The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n *\n * \\[1\\] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n *\n * \\[2\\] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.\n */\nexport const zRequestId = z.union([z.number(), z.string()]).nullable();\n/**\n * A unique identifier for a conversation session between a client and agent.\n *\n * Sessions maintain their own context, conversation history, and state,\n * allowing multiple independent interactions with the same agent.\n *\n * See protocol docs: [Session ID](https://agentclientprotocol.com/protocol/session-setup#session-id)\n */\nexport const zSessionId = z.string();\n/**\n * Request to write content to a text file.\n *\n * Only available if the client supports the `fs.writeTextFile` capability.\n */\nexport const zWriteTextFileRequest = z.object({\n sessionId: zSessionId,\n path: z.string(),\n content: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request to read content from a text file.\n *\n * Only available if the client supports the `fs.readTextFile` capability.\n */\nexport const zReadTextFileRequest = z.object({\n sessionId: zSessionId,\n path: z.string(),\n line: z\n .int()\n .gte(0)\n .max(4294967295, {\n error: \"Invalid value: Expected uint32 to be <= 4294967295\",\n })\n .nullish(),\n limit: z\n .int()\n .gte(0)\n .max(4294967295, {\n error: \"Invalid value: Expected uint32 to be <= 4294967295\",\n })\n .nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Unique identifier for a tool call within a session.\n */\nexport const zToolCallId = z.string();\n/**\n * Categories of tools that can be invoked.\n *\n * Tool kinds help clients choose appropriate icons and optimize how they\n * display tool execution progress.\n *\n * See protocol docs: [Creating](https://agentclientprotocol.com/protocol/tool-calls#creating)\n */\nexport const zToolKind = z.union([\n z.literal(\"read\"),\n z.literal(\"edit\"),\n z.literal(\"delete\"),\n z.literal(\"move\"),\n z.literal(\"search\"),\n z.literal(\"execute\"),\n z.literal(\"think\"),\n z.literal(\"fetch\"),\n z.literal(\"switch_mode\"),\n z.literal(\"other\"),\n]);\n/**\n * Execution status of a tool call.\n *\n * Tool calls progress through different statuses during their lifecycle.\n *\n * See protocol docs: [Status](https://agentclientprotocol.com/protocol/tool-calls#status)\n */\nexport const zToolCallStatus = z.union([\n z.literal(\"pending\"),\n z.literal(\"in_progress\"),\n z.literal(\"completed\"),\n z.literal(\"failed\"),\n]);\n/**\n * The sender or recipient of messages and data in a conversation.\n */\nexport const zRole = z.union([z.literal(\"assistant\"), z.literal(\"user\")]);\n/**\n * Optional annotations for the client. The client can use annotations to inform how objects are used or displayed\n */\nexport const zAnnotations = z.object({\n audience: defaultOnError(vecSkipError(zRole).nullish(), () => undefined),\n lastModified: z.string().nullish(),\n priority: z.number().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Text provided to or from an LLM.\n */\nexport const zTextContent = z.object({\n annotations: defaultOnError(zAnnotations.nullish(), () => undefined),\n text: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * An image provided to or from an LLM.\n */\nexport const zImageContent = z.object({\n annotations: defaultOnError(zAnnotations.nullish(), () => undefined),\n data: z.string(),\n mimeType: z.string(),\n uri: z.string().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Audio provided to or from an LLM.\n */\nexport const zAudioContent = z.object({\n annotations: defaultOnError(zAnnotations.nullish(), () => undefined),\n data: z.string(),\n mimeType: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A resource that the server is capable of reading, included in a prompt or tool call result.\n */\nexport const zResourceLink = z.object({\n annotations: defaultOnError(zAnnotations.nullish(), () => undefined),\n description: z.string().nullish(),\n mimeType: z.string().nullish(),\n name: z.string(),\n size: z.number().nullish(),\n title: z.string().nullish(),\n uri: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Text-based resource contents.\n */\nexport const zTextResourceContents = z.object({\n mimeType: z.string().nullish(),\n text: z.string(),\n uri: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Binary resource contents.\n */\nexport const zBlobResourceContents = z.object({\n blob: z.string(),\n mimeType: z.string().nullish(),\n uri: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Resource content that can be embedded in a message.\n */\nexport const zEmbeddedResourceResource = z.union([\n zTextResourceContents,\n zBlobResourceContents,\n]);\n/**\n * The contents of a resource, embedded into a prompt or tool call result.\n */\nexport const zEmbeddedResource = z.object({\n annotations: defaultOnError(zAnnotations.nullish(), () => undefined),\n resource: zEmbeddedResourceResource,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Content blocks represent displayable information in the Agent Client Protocol.\n *\n * They provide a structured way to handle various types of user-facing content—whether\n * it's text from language models, images for analysis, or embedded resources for context.\n *\n * Content blocks appear in:\n * - User prompts sent via `session/prompt`\n * - Language model output streamed through `session/update` notifications\n * - Progress updates and results from tool calls\n *\n * This structure is compatible with the Model Context Protocol (MCP), enabling\n * agents to seamlessly forward content from MCP tool outputs without transformation.\n *\n * See protocol docs: [Content](https://agentclientprotocol.com/protocol/content)\n */\nexport const zContentBlock = z.union([\n zTextContent.and(z.object({\n type: z.literal(\"text\"),\n })),\n zImageContent.and(z.object({\n type: z.literal(\"image\"),\n })),\n zAudioContent.and(z.object({\n type: z.literal(\"audio\"),\n })),\n zResourceLink.and(z.object({\n type: z.literal(\"resource_link\"),\n })),\n zEmbeddedResource.and(z.object({\n type: z.literal(\"resource\"),\n })),\n]);\n/**\n * Standard content block (text, images, resources).\n */\nexport const zContent = z.object({\n content: zContentBlock,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A diff representing file modifications.\n *\n * Shows changes to files in a format suitable for display in the client UI.\n *\n * See protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)\n */\nexport const zDiff = z.object({\n path: z.string(),\n oldText: z.string().nullish(),\n newText: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Typed identifier used for terminal values on the wire.\n */\nexport const zTerminalId = z.string();\n/**\n * Embed a terminal created with `terminal/create` by its id.\n *\n * The terminal must be added before calling `terminal/release`.\n *\n * See protocol docs: [Terminal](https://agentclientprotocol.com/protocol/terminals)\n */\nexport const zTerminal = z.object({\n terminalId: zTerminalId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Content produced by a tool call.\n *\n * Tool calls can produce different types of content including\n * standard content blocks (text, images) or file diffs.\n *\n * See protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)\n */\nexport const zToolCallContent = z.union([\n zContent.and(z.object({\n type: z.literal(\"content\"),\n })),\n zDiff.and(z.object({\n type: z.literal(\"diff\"),\n })),\n zTerminal.and(z.object({\n type: z.literal(\"terminal\"),\n })),\n]);\n/**\n * A file location being accessed or modified by a tool.\n *\n * Enables clients to implement \"follow-along\" features that track\n * which files the agent is working with in real-time.\n *\n * See protocol docs: [Following the Agent](https://agentclientprotocol.com/protocol/tool-calls#following-the-agent)\n */\nexport const zToolCallLocation = z.object({\n path: z.string(),\n line: z\n .int()\n .gte(0)\n .max(4294967295, {\n error: \"Invalid value: Expected uint32 to be <= 4294967295\",\n })\n .nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * An update to an existing tool call.\n *\n * Used to report progress and results as tools execute. All fields except\n * the tool call ID are optional - only changed fields need to be included.\n *\n * See protocol docs: [Updating](https://agentclientprotocol.com/protocol/tool-calls#updating)\n */\nexport const zToolCallUpdate = z.object({\n toolCallId: zToolCallId,\n kind: defaultOnError(zToolKind.nullish(), () => undefined),\n status: defaultOnError(zToolCallStatus.nullish(), () => undefined),\n title: z.string().nullish(),\n content: defaultOnError(vecSkipError(zToolCallContent).nullish(), () => undefined),\n locations: defaultOnError(vecSkipError(zToolCallLocation).nullish(), () => undefined),\n rawInput: z.unknown().optional(),\n rawOutput: z.unknown().optional(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Unique identifier for a permission option.\n */\nexport const zPermissionOptionId = z.string();\n/**\n * The type of permission option being presented to the user.\n *\n * Helps clients choose appropriate icons and UI treatment.\n */\nexport const zPermissionOptionKind = z.union([\n z.literal(\"allow_once\"),\n z.literal(\"allow_always\"),\n z.literal(\"reject_once\"),\n z.literal(\"reject_always\"),\n]);\n/**\n * An option presented to the user when requesting permission.\n */\nexport const zPermissionOption = z.object({\n optionId: zPermissionOptionId,\n name: z.string(),\n kind: zPermissionOptionKind,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request for user permission to execute a tool call.\n *\n * Sent when the agent needs authorization before performing a sensitive operation.\n *\n * See protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)\n */\nexport const zRequestPermissionRequest = z.object({\n sessionId: zSessionId,\n toolCall: zToolCallUpdate,\n options: z.array(zPermissionOption),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * An environment variable to set when launching an MCP server.\n */\nexport const zEnvVariable = z.object({\n name: z.string(),\n value: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request to create a new terminal and execute a command.\n */\nexport const zCreateTerminalRequest = z.object({\n sessionId: zSessionId,\n command: z.string(),\n args: z.array(z.string()).optional(),\n env: z.array(zEnvVariable).optional(),\n cwd: z.string().nullish(),\n outputByteLimit: z.number().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request to get the current output and status of a terminal.\n */\nexport const zTerminalOutputRequest = z.object({\n sessionId: zSessionId,\n terminalId: zTerminalId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request to release a terminal and free its resources.\n */\nexport const zReleaseTerminalRequest = z.object({\n sessionId: zSessionId,\n terminalId: zTerminalId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request to wait for a terminal command to exit.\n */\nexport const zWaitForTerminalExitRequest = z.object({\n sessionId: zSessionId,\n terminalId: zTerminalId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request to kill a terminal without releasing it.\n */\nexport const zKillTerminalRequest = z.object({\n sessionId: zSessionId,\n terminalId: zTerminalId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Session-scoped elicitation, optionally tied to a specific tool call.\n *\n * When `tool_call_id` is set, the elicitation is tied to a specific tool call.\n * This is useful when an agent receives an elicitation from an MCP server\n * during a tool call and needs to redirect it to the user.\n *\n * @experimental\n */\nexport const zElicitationSessionScope = z.object({\n sessionId: zSessionId,\n toolCallId: zToolCallId.nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Request-scoped elicitation, tied to a specific JSON-RPC request outside of a session\n * (e.g., during auth/configuration phases before any session is started).\n *\n * @experimental\n */\nexport const zElicitationRequestScope = z.object({\n requestId: zRequestId,\n});\n/**\n * Object schema type.\n */\nexport const zElicitationSchemaType = z.literal(\"object\");\n/**\n * String format types for string properties in elicitation schemas.\n */\nexport const zStringFormat = z.union([\n z.literal(\"email\"),\n z.literal(\"uri\"),\n z.literal(\"date\"),\n z.literal(\"date-time\"),\n]);\n/**\n * A titled enum option with a const value and human-readable title.\n */\nexport const zEnumOption = z.object({\n const: z.string(),\n title: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Schema for string properties in an elicitation form.\n *\n * When `enum` or `oneOf` is set, this represents a single-select enum\n * with `\"type\": \"string\"`.\n */\nexport const zStringPropertySchema = z.object({\n title: z.string().nullish(),\n description: z.string().nullish(),\n minLength: z\n .int()\n .gte(0)\n .max(4294967295, {\n error: \"Invalid value: Expected uint32 to be <= 4294967295\",\n })\n .nullish(),\n maxLength: z\n .int()\n .gte(0)\n .max(4294967295, {\n error: \"Invalid value: Expected uint32 to be <= 4294967295\",\n })\n .nullish(),\n pattern: z.string().nullish(),\n format: zStringFormat.nullish(),\n default: z.string().nullish(),\n enum: z.array(z.string()).nullish(),\n oneOf: z.array(zEnumOption).nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Schema for number (floating-point) properties in an elicitation form.\n */\nexport const zNumberPropertySchema = z.object({\n title: z.string().nullish(),\n description: z.string().nullish(),\n minimum: z.number().nullish(),\n maximum: z.number().nullish(),\n default: z.number().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Schema for integer properties in an elicitation form.\n */\nexport const zIntegerPropertySchema = z.object({\n title: z.string().nullish(),\n description: z.string().nullish(),\n minimum: z.number().nullish(),\n maximum: z.number().nullish(),\n default: z.number().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Schema for boolean properties in an elicitation form.\n */\nexport const zBooleanPropertySchema = z.object({\n title: z.string().nullish(),\n description: z.string().nullish(),\n default: z.boolean().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * String schema type.\n */\nexport const zElicitationStringType = z.literal(\"string\");\n/**\n * Items definition for untitled multi-select enum properties.\n */\nexport const zUntitledMultiSelectItems = z.object({\n type: zElicitationStringType,\n enum: z.array(z.string()),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Items definition for titled multi-select enum properties.\n */\nexport const zTitledMultiSelectItems = z.object({\n anyOf: z.array(zEnumOption),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Items for a multi-select (array) property schema.\n */\nexport const zMultiSelectItems = z.union([\n zUntitledMultiSelectItems,\n zTitledMultiSelectItems,\n]);\n/**\n * Schema for multi-select (array) properties in an elicitation form.\n */\nexport const zMultiSelectPropertySchema = z.object({\n title: z.string().nullish(),\n description: z.string().nullish(),\n minItems: z.number().nullish(),\n maxItems: z.number().nullish(),\n items: zMultiSelectItems,\n default: z.array(z.string()).nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Property schema for elicitation form fields.\n *\n * Each variant corresponds to a JSON Schema `\"type\"` value.\n * Single-select enums use the `String` variant with `enum` or `oneOf` set.\n * Multi-select enums use the `Array` variant.\n */\nexport const zElicitationPropertySchema = z.union([\n zStringPropertySchema.and(z.object({\n type: z.literal(\"string\"),\n })),\n zNumberPropertySchema.and(z.object({\n type: z.literal(\"number\"),\n })),\n zIntegerPropertySchema.and(z.object({\n type: z.literal(\"integer\"),\n })),\n zBooleanPropertySchema.and(z.object({\n type: z.literal(\"boolean\"),\n })),\n zMultiSelectPropertySchema.and(z.object({\n type: z.literal(\"array\"),\n })),\n]);\n/**\n * Type-safe elicitation schema for requesting structured user input.\n *\n * This represents a JSON Schema object with primitive-typed properties,\n * as required by the elicitation specification.\n */\nexport const zElicitationSchema = z.object({\n type: zElicitationSchemaType.optional().default(\"object\"),\n title: z.string().nullish(),\n properties: z\n .record(z.string(), zElicitationPropertySchema)\n .optional()\n .default({}),\n required: z.array(z.string()).nullish(),\n description: z.string().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Form-based elicitation mode where the client renders a form from the provided schema.\n *\n * @experimental\n */\nexport const zElicitationFormMode = z.intersection(z.union([zElicitationSessionScope, zElicitationRequestScope]), z.object({\n requestedSchema: zElicitationSchema,\n}));\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Unique identifier for an elicitation.\n *\n * @experimental\n */\nexport const zElicitationId = z.string();\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * URL-based elicitation mode where the client directs the user to a URL.\n *\n * @experimental\n */\nexport const zElicitationUrlMode = z.intersection(z.union([zElicitationSessionScope, zElicitationRequestScope]), z.object({\n elicitationId: zElicitationId,\n url: z.url(),\n}));\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Request from the agent to elicit structured user input.\n *\n * The agent sends this to the client to request information from the user,\n * either via a form or by directing them to a URL.\n * Elicitations are tied to a session (optionally a tool call) or a request.\n *\n * @experimental\n */\nexport const zCreateElicitationRequest = z.intersection(z.union([\n zElicitationFormMode.and(z.object({\n mode: z.literal(\"form\"),\n })),\n zElicitationUrlMode.and(z.object({\n mode: z.literal(\"url\"),\n })),\n]), z.object({\n message: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n}));\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Unique identifier for an MCP server using the ACP transport.\n *\n * The value is opaque and generated by the ACP component providing the MCP server. It is\n * used by `mcp/connect` to route connection requests back to the component that declared the\n * server.\n *\n * @experimental\n */\nexport const zMcpServerAcpId = z.string();\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Request parameters for `mcp/connect`.\n *\n * @experimental\n */\nexport const zConnectMcpRequest = z.object({\n acpId: zMcpServerAcpId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * A unique identifier for an active MCP-over-ACP connection.\n *\n * @experimental\n */\nexport const zMcpConnectionId = z.string();\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Request parameters for `mcp/message`.\n *\n * @experimental\n */\nexport const zMessageMcpRequest = z.object({\n connectionId: zMcpConnectionId,\n method: z.string(),\n params: z.record(z.string(), z.unknown()).nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Request parameters for `mcp/disconnect`.\n *\n * @experimental\n */\nexport const zDisconnectMcpRequest = z.object({\n connectionId: zMcpConnectionId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Allows for sending an arbitrary request that is not part of the ACP spec.\n * Extension methods provide a way to add custom functionality while maintaining\n * protocol compatibility.\n *\n * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)\n */\nexport const zExtRequest = z.unknown();\n/**\n * A JSON-RPC request object.\n */\nexport const zAgentRequest = z.object({\n id: zRequestId,\n method: z.string(),\n params: z\n .union([\n zWriteTextFileRequest,\n zReadTextFileRequest,\n zRequestPermissionRequest,\n zCreateTerminalRequest,\n zTerminalOutputRequest,\n zReleaseTerminalRequest,\n zWaitForTerminalExitRequest,\n zKillTerminalRequest,\n zCreateElicitationRequest,\n zConnectMcpRequest,\n zMessageMcpRequest,\n zDisconnectMcpRequest,\n zExtRequest,\n ])\n .nullish(),\n});\n/**\n * Protocol version identifier.\n *\n * This version is only bumped for breaking changes.\n * Non-breaking changes should be introduced via capabilities.\n */\nexport const zProtocolVersion = z.int().gte(0).lte(65535);\n/**\n * Prompt capabilities supported by the agent in `session/prompt` requests.\n *\n * Baseline agent functionality requires support for [`ContentBlock::Text`]\n * and [`ContentBlock::ResourceLink`] in prompt requests.\n *\n * Other variants must be explicitly opted in to.\n * Capabilities for different types of content in prompt requests.\n *\n * Indicates which content types beyond the baseline (text and resource links)\n * the agent can process.\n *\n * See protocol docs: [Prompt Capabilities](https://agentclientprotocol.com/protocol/initialization#prompt-capabilities)\n */\nexport const zPromptCapabilities = z.object({\n image: z.boolean().optional().default(false),\n audio: z.boolean().optional().default(false),\n embeddedContext: z.boolean().optional().default(false),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * MCP capabilities supported by the agent\n */\nexport const zMcpCapabilities = z.object({\n http: z.boolean().optional().default(false),\n sse: z.boolean().optional().default(false),\n acp: z.boolean().optional().default(false),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Capabilities for the `session/list` method.\n *\n * By supplying `{}` it means that the agent supports listing of sessions.\n */\nexport const zSessionListCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Capabilities for the `session/delete` method.\n *\n * Supplying `{}` means the agent supports deleting sessions from `session/list`.\n */\nexport const zSessionDeleteCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Capabilities for additional session directories support.\n *\n * By supplying `{}` it means that the agent supports the `additionalDirectories`\n * field on supported session lifecycle requests. Agents that also support\n * `session/list` may return `SessionInfo.additionalDirectories` to report the\n * complete ordered additional-root list associated with a listed session.\n */\nexport const zSessionAdditionalDirectoriesCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Capabilities for the `session/fork` method.\n *\n * By supplying `{}` it means that the agent supports forking of sessions.\n *\n * @experimental\n */\nexport const zSessionForkCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Capabilities for the `session/resume` method.\n *\n * By supplying `{}` it means that the agent supports resuming of sessions.\n */\nexport const zSessionResumeCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Capabilities for the `session/close` method.\n *\n * By supplying `{}` it means that the agent supports closing of sessions.\n */\nexport const zSessionCloseCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Session capabilities supported by the agent.\n *\n * As a baseline, all Agents **MUST** support `session/new`, `session/prompt`, `session/cancel`, and `session/update`.\n *\n * Optionally, they **MAY** support other session methods and notifications by specifying additional capabilities.\n *\n * Note: `session/load` is still handled by the top-level `load_session` capability. This will be unified in future versions of the protocol.\n *\n * See protocol docs: [Session Capabilities](https://agentclientprotocol.com/protocol/initialization#session-capabilities)\n */\nexport const zSessionCapabilities = z.object({\n list: defaultOnError(zSessionListCapabilities.nullish(), () => undefined),\n delete: defaultOnError(zSessionDeleteCapabilities.nullish(), () => undefined),\n additionalDirectories: defaultOnError(zSessionAdditionalDirectoriesCapabilities.nullish(), () => undefined),\n fork: defaultOnError(zSessionForkCapabilities.nullish(), () => undefined),\n resume: defaultOnError(zSessionResumeCapabilities.nullish(), () => undefined),\n close: defaultOnError(zSessionCloseCapabilities.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Logout capabilities supported by the agent.\n *\n * By supplying `{}` it means that the agent supports the logout method.\n */\nexport const zLogoutCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Authentication-related capabilities supported by the agent.\n */\nexport const zAgentAuthCapabilities = z.object({\n logout: defaultOnError(zLogoutCapabilities.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Provider configuration capabilities supported by the agent.\n *\n * By supplying `{}` it means that the agent supports provider configuration methods.\n *\n * @experimental\n */\nexport const zProvidersCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Marker for `document/didOpen` capability support.\n */\nexport const zNesDocumentDidOpenCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * How the agent wants document changes delivered.\n */\nexport const zTextDocumentSyncKind = z.union([\n z.literal(\"full\"),\n z.literal(\"incremental\"),\n]);\n/**\n * Capabilities for `document/didChange` events.\n */\nexport const zNesDocumentDidChangeCapabilities = z.object({\n syncKind: zTextDocumentSyncKind,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Marker for `document/didClose` capability support.\n */\nexport const zNesDocumentDidCloseCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Marker for `document/didSave` capability support.\n */\nexport const zNesDocumentDidSaveCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Marker for `document/didFocus` capability support.\n */\nexport const zNesDocumentDidFocusCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Document event capabilities the agent wants to receive.\n */\nexport const zNesDocumentEventCapabilities = z.object({\n didOpen: defaultOnError(zNesDocumentDidOpenCapabilities.nullish(), () => undefined),\n didChange: defaultOnError(zNesDocumentDidChangeCapabilities.nullish(), () => undefined),\n didClose: defaultOnError(zNesDocumentDidCloseCapabilities.nullish(), () => undefined),\n didSave: defaultOnError(zNesDocumentDidSaveCapabilities.nullish(), () => undefined),\n didFocus: defaultOnError(zNesDocumentDidFocusCapabilities.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Event capabilities the agent can consume.\n */\nexport const zNesEventCapabilities = z.object({\n document: defaultOnError(zNesDocumentEventCapabilities.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Capabilities for recent files context.\n */\nexport const zNesRecentFilesCapabilities = z.object({\n maxCount: z\n .int()\n .gte(0)\n .max(4294967295, {\n error: \"Invalid value: Expected uint32 to be <= 4294967295\",\n })\n .nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Capabilities for related snippets context.\n */\nexport const zNesRelatedSnippetsCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Capabilities for edit history context.\n */\nexport const zNesEditHistoryCapabilities = z.object({\n maxCount: z\n .int()\n .gte(0)\n .max(4294967295, {\n error: \"Invalid value: Expected uint32 to be <= 4294967295\",\n })\n .nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Capabilities for user actions context.\n */\nexport const zNesUserActionsCapabilities = z.object({\n maxCount: z\n .int()\n .gte(0)\n .max(4294967295, {\n error: \"Invalid value: Expected uint32 to be <= 4294967295\",\n })\n .nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Capabilities for open files context.\n */\nexport const zNesOpenFilesCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Capabilities for diagnostics context.\n */\nexport const zNesDiagnosticsCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Context capabilities the agent wants attached to each suggestion request.\n */\nexport const zNesContextCapabilities = z.object({\n recentFiles: defaultOnError(zNesRecentFilesCapabilities.nullish(), () => undefined),\n relatedSnippets: defaultOnError(zNesRelatedSnippetsCapabilities.nullish(), () => undefined),\n editHistory: defaultOnError(zNesEditHistoryCapabilities.nullish(), () => undefined),\n userActions: defaultOnError(zNesUserActionsCapabilities.nullish(), () => undefined),\n openFiles: defaultOnError(zNesOpenFilesCapabilities.nullish(), () => undefined),\n diagnostics: defaultOnError(zNesDiagnosticsCapabilities.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * NES capabilities advertised by the agent during initialization.\n */\nexport const zNesCapabilities = z.object({\n events: defaultOnError(zNesEventCapabilities.nullish(), () => undefined),\n context: defaultOnError(zNesContextCapabilities.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * The encoding used for character offsets in positions.\n *\n * Follows the same conventions as LSP 3.17. The default is UTF-16.\n */\nexport const zPositionEncodingKind = z.union([\n z.literal(\"utf-16\"),\n z.literal(\"utf-32\"),\n z.literal(\"utf-8\"),\n]);\n/**\n * Capabilities supported by the agent.\n *\n * Advertised during initialization to inform the client about\n * available features and content types.\n *\n * See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/initialization#agent-capabilities)\n */\nexport const zAgentCapabilities = z.object({\n loadSession: z.boolean().optional().default(false),\n promptCapabilities: zPromptCapabilities.optional().default({\n image: false,\n audio: false,\n embeddedContext: false,\n }),\n mcpCapabilities: zMcpCapabilities.optional().default({\n http: false,\n sse: false,\n acp: false,\n }),\n sessionCapabilities: zSessionCapabilities.optional().default({}),\n auth: zAgentAuthCapabilities.optional().default({}),\n providers: defaultOnError(zProvidersCapabilities.nullish(), () => undefined),\n nes: defaultOnError(zNesCapabilities.nullish(), () => undefined),\n positionEncoding: defaultOnError(zPositionEncodingKind.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Typed identifier used for auth method values on the wire.\n */\nexport const zAuthMethodId = z.string();\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Describes a single environment variable for an [`AuthMethodEnvVar`] authentication method.\n *\n * @experimental\n */\nexport const zAuthEnvVar = z.object({\n name: z.string(),\n label: z.string().nullish(),\n secret: z.boolean().optional().default(true),\n optional: z.boolean().optional().default(false),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Environment variable authentication method.\n *\n * The user provides credentials that the client passes to the agent as environment variables.\n *\n * @experimental\n */\nexport const zAuthMethodEnvVar = z.object({\n id: zAuthMethodId,\n name: z.string(),\n description: z.string().nullish(),\n vars: z.array(zAuthEnvVar),\n link: z.string().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Terminal-based authentication method.\n *\n * The client runs an interactive terminal for the user to authenticate via a TUI.\n *\n * @experimental\n */\nexport const zAuthMethodTerminal = z.object({\n id: zAuthMethodId,\n name: z.string(),\n description: z.string().nullish(),\n args: z.array(z.string()).optional(),\n env: z.record(z.string(), z.string()).optional(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Agent handles authentication itself.\n *\n * This is the default authentication method type.\n */\nexport const zAuthMethodAgent = z.object({\n id: zAuthMethodId,\n name: z.string(),\n description: z.string().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Describes an available authentication method.\n *\n * The `type` field acts as the discriminator in the serialized JSON form.\n * When no `type` is present, the method is treated as `agent`.\n */\nexport const zAuthMethod = z.union([\n zAuthMethodEnvVar.and(z.object({\n type: z.literal(\"env_var\"),\n })),\n zAuthMethodTerminal.and(z.object({\n type: z.literal(\"terminal\"),\n })),\n zAuthMethodAgent,\n]);\n/**\n * Metadata about the implementation of the client or agent.\n * Describes the name and version of an MCP implementation, with an optional\n * title for UI representation.\n */\nexport const zImplementation = z.object({\n name: z.string(),\n title: z.string().nullish(),\n version: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response to the `initialize` method.\n *\n * Contains the negotiated protocol version and agent capabilities.\n *\n * See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)\n */\nexport const zInitializeResponse = z.object({\n protocolVersion: zProtocolVersion,\n agentCapabilities: zAgentCapabilities.optional().default({\n loadSession: false,\n promptCapabilities: {\n image: false,\n audio: false,\n embeddedContext: false,\n },\n mcpCapabilities: {\n http: false,\n sse: false,\n acp: false,\n },\n sessionCapabilities: {},\n auth: {},\n }),\n authMethods: defaultOnError(vecSkipError(zAuthMethod).optional().default([]), () => []),\n agentInfo: defaultOnError(zImplementation.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response to the `authenticate` method.\n */\nexport const zAuthenticateResponse = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Well-known API protocol identifiers for LLM providers.\n *\n * Agents and clients MUST handle unknown protocol identifiers gracefully.\n *\n * Protocol names beginning with `_` are free for custom use, like other ACP extension methods.\n * Protocol names that do not begin with `_` are reserved for the ACP spec.\n *\n * @experimental\n */\nexport const zLlmProtocol = z.union([\n z.literal(\"anthropic\"),\n z.literal(\"openai\"),\n z.literal(\"azure\"),\n z.literal(\"vertex\"),\n z.literal(\"bedrock\"),\n z.string(),\n]);\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Current effective non-secret routing configuration for a provider.\n *\n * @experimental\n */\nexport const zProviderCurrentConfig = z.object({\n apiType: zLlmProtocol,\n baseUrl: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Information about a configurable LLM provider.\n *\n * @experimental\n */\nexport const zProviderInfo = z.object({\n id: z.string(),\n supported: requiredDefaultOnError(vecSkipError(zLlmProtocol), () => []),\n required: z.boolean(),\n current: zProviderCurrentConfig.nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Response to `providers/list`.\n *\n * @experimental\n */\nexport const zListProvidersResponse = z.object({\n providers: requiredDefaultOnError(vecSkipError(zProviderInfo), () => []),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Response to `providers/set`.\n *\n * @experimental\n */\nexport const zSetProviderResponse = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Response to `providers/disable`.\n *\n * @experimental\n */\nexport const zDisableProviderResponse = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response to the `logout` method.\n */\nexport const zLogoutResponse = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Unique identifier for a Session Mode.\n */\nexport const zSessionModeId = z.string();\n/**\n * A mode the agent can operate in.\n *\n * See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)\n */\nexport const zSessionMode = z.object({\n id: zSessionModeId,\n name: z.string(),\n description: z.string().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * The set of modes and the one currently active.\n */\nexport const zSessionModeState = z.object({\n currentModeId: zSessionModeId,\n availableModes: requiredDefaultOnError(vecSkipError(zSessionMode), () => []),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Unique identifier for a session configuration option.\n */\nexport const zSessionConfigId = z.string();\n/**\n * Semantic category for a session configuration option.\n *\n * This is intended to help Clients distinguish broadly common selectors (e.g. model selector vs\n * session mode selector vs thought/reasoning level) for UX purposes (keyboard shortcuts, icons,\n * placement). It MUST NOT be required for correctness. Clients MUST handle missing or unknown\n * categories gracefully.\n *\n * Category names beginning with `_` are free for custom use, like other ACP extension methods.\n * Category names that do not begin with `_` are reserved for the ACP spec.\n */\nexport const zSessionConfigOptionCategory = z.union([\n z.literal(\"mode\"),\n z.literal(\"model\"),\n z.literal(\"model_config\"),\n z.literal(\"thought_level\"),\n z.string(),\n]);\n/**\n * Unique identifier for a session configuration option value.\n */\nexport const zSessionConfigValueId = z.string();\n/**\n * A possible value for a session configuration option.\n */\nexport const zSessionConfigSelectOption = z.object({\n value: zSessionConfigValueId,\n name: z.string(),\n description: z.string().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Unique identifier for a session configuration option value group.\n */\nexport const zSessionConfigGroupId = z.string();\n/**\n * A group of possible values for a session configuration option.\n */\nexport const zSessionConfigSelectGroup = z.object({\n group: zSessionConfigGroupId,\n name: z.string(),\n options: z.array(zSessionConfigSelectOption),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Possible values for a session configuration option.\n */\nexport const zSessionConfigSelectOptions = z.union([\n z.array(zSessionConfigSelectOption),\n z.array(zSessionConfigSelectGroup),\n]);\n/**\n * A single-value selector (dropdown) session configuration option payload.\n */\nexport const zSessionConfigSelect = z.object({\n currentValue: zSessionConfigValueId,\n options: zSessionConfigSelectOptions,\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * A boolean on/off toggle session configuration option payload.\n *\n * @experimental\n */\nexport const zSessionConfigBoolean = z.object({\n currentValue: z.boolean(),\n});\n/**\n * A session configuration option selector and its current state.\n */\nexport const zSessionConfigOption = z.intersection(z.union([\n zSessionConfigSelect.and(z.object({\n type: z.literal(\"select\"),\n })),\n zSessionConfigBoolean.and(z.object({\n type: z.literal(\"boolean\"),\n })),\n]), z.object({\n id: zSessionConfigId,\n name: z.string(),\n description: z.string().nullish(),\n category: defaultOnError(zSessionConfigOptionCategory.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n}));\n/**\n * Response from creating a new session.\n *\n * See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)\n */\nexport const zNewSessionResponse = z.object({\n sessionId: zSessionId,\n modes: defaultOnError(zSessionModeState.nullish(), () => undefined),\n configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response from loading an existing session.\n */\nexport const zLoadSessionResponse = z.object({\n modes: defaultOnError(zSessionModeState.nullish(), () => undefined),\n configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Information about a session returned by session/list\n */\nexport const zSessionInfo = z.object({\n sessionId: zSessionId,\n cwd: z.string(),\n additionalDirectories: z.array(z.string()).optional(),\n title: defaultOnError(z.string().nullish(), () => undefined),\n updatedAt: defaultOnError(z.string().nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response from listing sessions.\n */\nexport const zListSessionsResponse = z.object({\n sessions: requiredDefaultOnError(vecSkipError(zSessionInfo), () => []),\n nextCursor: z.string().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response from deleting a session.\n */\nexport const zDeleteSessionResponse = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Response from forking an existing session.\n *\n * @experimental\n */\nexport const zForkSessionResponse = z.object({\n sessionId: zSessionId,\n modes: defaultOnError(zSessionModeState.nullish(), () => undefined),\n configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response from resuming an existing session.\n */\nexport const zResumeSessionResponse = z.object({\n modes: defaultOnError(zSessionModeState.nullish(), () => undefined),\n configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response from closing a session.\n */\nexport const zCloseSessionResponse = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response to `session/set_mode` method.\n */\nexport const zSetSessionModeResponse = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response to `session/set_config_option` method.\n */\nexport const zSetSessionConfigOptionResponse = z.object({\n configOptions: requiredDefaultOnError(vecSkipError(zSessionConfigOption), () => []),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Reasons why an agent stops processing a prompt turn.\n *\n * See protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/prompt-turn#stop-reasons)\n */\nexport const zStopReason = z.union([\n z.literal(\"end_turn\"),\n z.literal(\"max_tokens\"),\n z.literal(\"max_turn_requests\"),\n z.literal(\"refusal\"),\n z.literal(\"cancelled\"),\n]);\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Token usage information for a prompt turn.\n *\n * @experimental\n */\nexport const zUsage = z.object({\n totalTokens: z.number(),\n inputTokens: z.number(),\n outputTokens: z.number(),\n thoughtTokens: z.number().nullish(),\n cachedReadTokens: z.number().nullish(),\n cachedWriteTokens: z.number().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response from processing a user prompt.\n *\n * See protocol docs: [Check for Completion](https://agentclientprotocol.com/protocol/prompt-turn#4-check-for-completion)\n */\nexport const zPromptResponse = z.object({\n stopReason: zStopReason,\n usage: defaultOnError(zUsage.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response to `nes/start`.\n */\nexport const zStartNesResponse = z.object({\n sessionId: zSessionId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A zero-based position in a text document.\n *\n * The meaning of `character` depends on the negotiated position encoding.\n */\nexport const zPosition = z.object({\n line: z.int().gte(0).max(4294967295, {\n error: \"Invalid value: Expected uint32 to be <= 4294967295\",\n }),\n character: z.int().gte(0).max(4294967295, {\n error: \"Invalid value: Expected uint32 to be <= 4294967295\",\n }),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A range in a text document, expressed as start and end positions.\n */\nexport const zRange = z.object({\n start: zPosition,\n end: zPosition,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A text edit within a suggestion.\n */\nexport const zNesTextEdit = z.object({\n range: zRange,\n newText: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A text edit suggestion.\n */\nexport const zNesEditSuggestion = z.object({\n id: z.string(),\n uri: z.string(),\n edits: z.array(zNesTextEdit),\n cursorPosition: defaultOnError(zPosition.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A jump-to-location suggestion.\n */\nexport const zNesJumpSuggestion = z.object({\n id: z.string(),\n uri: z.string(),\n position: zPosition,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A rename symbol suggestion.\n */\nexport const zNesRenameSuggestion = z.object({\n id: z.string(),\n uri: z.string(),\n position: zPosition,\n newName: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A search-and-replace suggestion.\n */\nexport const zNesSearchAndReplaceSuggestion = z.object({\n id: z.string(),\n uri: z.string(),\n search: z.string(),\n replace: z.string(),\n isRegex: z.boolean().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A suggestion returned by the agent.\n */\nexport const zNesSuggestion = z.union([\n zNesEditSuggestion.and(z.object({\n kind: z.literal(\"edit\"),\n })),\n zNesJumpSuggestion.and(z.object({\n kind: z.literal(\"jump\"),\n })),\n zNesRenameSuggestion.and(z.object({\n kind: z.literal(\"rename\"),\n })),\n zNesSearchAndReplaceSuggestion.and(z.object({\n kind: z.literal(\"searchAndReplace\"),\n })),\n]);\n/**\n * Response to `nes/suggest`.\n */\nexport const zSuggestNesResponse = z.object({\n suggestions: requiredDefaultOnError(vecSkipError(zNesSuggestion), () => []),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response from closing an NES session.\n */\nexport const zCloseNesResponse = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Allows for sending an arbitrary response to an [`ExtRequest`] that is not part of the ACP spec.\n * Extension methods provide a way to add custom functionality while maintaining\n * protocol compatibility.\n *\n * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)\n */\nexport const zExtResponse = z.unknown();\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Response to `mcp/message`.\n *\n * This is the inner MCP response result payload. Any JSON value is valid.\n *\n * @experimental\n */\nexport const zMessageMcpResponse = z.unknown();\n/**\n * Predefined error codes for common JSON-RPC and ACP-specific errors.\n *\n * These codes follow the JSON-RPC 2.0 specification for standard errors\n * and use the reserved range (-32000 to -32099) for protocol-specific errors.\n */\nexport const zErrorCode = z.union([\n z.literal(-32700),\n z.literal(-32600),\n z.literal(-32601),\n z.literal(-32602),\n z.literal(-32603),\n z.literal(-32800),\n z.literal(-32000),\n z.literal(-32002),\n z.literal(-32042),\n z\n .int()\n .min(-2147483648, {\n error: \"Invalid value: Expected int32 to be >= -2147483648\",\n })\n .max(2147483647, {\n error: \"Invalid value: Expected int32 to be <= 2147483647\",\n }),\n]);\n/**\n * JSON-RPC error object.\n *\n * Represents an error that occurred during method execution, following the\n * JSON-RPC 2.0 error object specification with optional additional data.\n *\n * See protocol docs: [JSON-RPC Error Object](https://www.jsonrpc.org/specification#error_object)\n */\nexport const zError = z.object({\n code: zErrorCode,\n message: z.string(),\n data: z.unknown().optional(),\n});\n/**\n * A JSON-RPC response object.\n */\nexport const zAgentResponse = z.union([\n z.object({\n id: zRequestId,\n result: z.union([\n zInitializeResponse,\n zAuthenticateResponse,\n zListProvidersResponse,\n zSetProviderResponse,\n zDisableProviderResponse,\n zLogoutResponse,\n zNewSessionResponse,\n zLoadSessionResponse,\n zListSessionsResponse,\n zDeleteSessionResponse,\n zForkSessionResponse,\n zResumeSessionResponse,\n zCloseSessionResponse,\n zSetSessionModeResponse,\n zSetSessionConfigOptionResponse,\n zPromptResponse,\n zStartNesResponse,\n zSuggestNesResponse,\n zCloseNesResponse,\n zExtResponse,\n zMessageMcpResponse,\n ]),\n }),\n z.object({\n id: zRequestId,\n error: zError,\n }),\n]);\n/**\n * Unique identifier for a message within a session.\n */\nexport const zMessageId = z.string();\n/**\n * A streamed item of content\n */\nexport const zContentChunk = z.object({\n content: zContentBlock,\n messageId: zMessageId.nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Represents a tool call that the language model has requested.\n *\n * Tool calls are actions that the agent executes on behalf of the language model,\n * such as reading files, executing code, or fetching data from external sources.\n *\n * See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-calls)\n */\nexport const zToolCall = z.object({\n toolCallId: zToolCallId,\n title: z.string(),\n kind: zToolKind.optional(),\n status: zToolCallStatus.optional(),\n content: defaultOnError(vecSkipError(zToolCallContent).optional(), () => []),\n locations: defaultOnError(vecSkipError(zToolCallLocation).optional(), () => []),\n rawInput: z.unknown().optional(),\n rawOutput: z.unknown().optional(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Priority levels for plan entries.\n *\n * Used to indicate the relative importance or urgency of different\n * tasks in the execution plan.\n * See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)\n */\nexport const zPlanEntryPriority = z.union([\n z.literal(\"high\"),\n z.literal(\"medium\"),\n z.literal(\"low\"),\n]);\n/**\n * Status of a plan entry in the execution flow.\n *\n * Tracks the lifecycle of each task from planning through completion.\n * See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)\n */\nexport const zPlanEntryStatus = z.union([\n z.literal(\"pending\"),\n z.literal(\"in_progress\"),\n z.literal(\"completed\"),\n]);\n/**\n * A single entry in the execution plan.\n *\n * Represents a task or goal that the assistant intends to accomplish\n * as part of fulfilling the user's request.\n * See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)\n */\nexport const zPlanEntry = z.object({\n content: z.string(),\n priority: zPlanEntryPriority,\n status: zPlanEntryStatus,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * An execution plan for accomplishing complex tasks.\n *\n * Plans consist of multiple entries representing individual tasks or goals.\n * Agents report plans to clients to provide visibility into their execution strategy.\n * Plans can evolve during execution as the agent discovers new requirements or completes tasks.\n *\n * See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)\n */\nexport const zPlan = z.object({\n entries: requiredDefaultOnError(vecSkipError(zPlanEntry), () => []),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Unique identifier for a plan within a session.\n *\n * @experimental\n */\nexport const zPlanId = z.string();\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * A plan represented as structured entries.\n *\n * @experimental\n */\nexport const zPlanItems = z.object({\n id: zPlanId,\n entries: requiredDefaultOnError(vecSkipError(zPlanEntry), () => []),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * A plan represented by a file URI.\n *\n * @experimental\n */\nexport const zPlanFile = z.object({\n id: zPlanId,\n uri: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * A plan represented as raw markdown content.\n *\n * @experimental\n */\nexport const zPlanMarkdown = z.object({\n id: zPlanId,\n content: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Updated content for a plan.\n *\n * @experimental\n */\nexport const zPlanUpdateContent = z.union([\n zPlanItems.and(z.object({\n type: z.literal(\"items\"),\n })),\n zPlanFile.and(z.object({\n type: z.literal(\"file\"),\n })),\n zPlanMarkdown.and(z.object({\n type: z.literal(\"markdown\"),\n })),\n]);\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * A content update for a plan identified by ID.\n *\n * @experimental\n */\nexport const zPlanUpdate = z.object({\n plan: zPlanUpdateContent,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Removal notice for a plan identified by ID.\n *\n * @experimental\n */\nexport const zPlanRemoved = z.object({\n id: zPlanId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * All text that was typed after the command name is provided as input.\n */\nexport const zUnstructuredCommandInput = z.object({\n hint: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * unstructured\n *\n * All text that was typed after the command name is provided as input.\n */\nexport const zAvailableCommandInput = zUnstructuredCommandInput;\n/**\n * Information about a command.\n */\nexport const zAvailableCommand = z.object({\n name: z.string(),\n description: z.string(),\n input: defaultOnError(zAvailableCommandInput.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Available commands are ready or have changed\n */\nexport const zAvailableCommandsUpdate = z.object({\n availableCommands: requiredDefaultOnError(vecSkipError(zAvailableCommand), () => []),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * The current mode of the session has changed\n *\n * See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)\n */\nexport const zCurrentModeUpdate = z.object({\n currentModeId: zSessionModeId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Session configuration options have been updated.\n */\nexport const zConfigOptionUpdate = z.object({\n configOptions: requiredDefaultOnError(vecSkipError(zSessionConfigOption), () => []),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Update to session metadata. All fields are optional to support partial updates.\n *\n * Agents send this notification to update session information like title or custom metadata.\n * This allows clients to display dynamic session names and track session state changes.\n */\nexport const zSessionInfoUpdate = z.object({\n title: z.string().nullish(),\n updatedAt: z.string().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Cost information for a session.\n */\nexport const zCost = z.object({\n amount: z.number(),\n currency: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Context window and cost update for a session.\n */\nexport const zUsageUpdate = z.object({\n used: z.number(),\n size: z.number(),\n cost: defaultOnError(zCost.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Different types of updates that can be sent during session processing.\n *\n * These updates provide real-time feedback about the agent's progress.\n *\n * See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)\n */\nexport const zSessionUpdate = z.union([\n zContentChunk.and(z.object({\n sessionUpdate: z.literal(\"user_message_chunk\"),\n })),\n zContentChunk.and(z.object({\n sessionUpdate: z.literal(\"agent_message_chunk\"),\n })),\n zContentChunk.and(z.object({\n sessionUpdate: z.literal(\"agent_thought_chunk\"),\n })),\n zToolCall.and(z.object({\n sessionUpdate: z.literal(\"tool_call\"),\n })),\n zToolCallUpdate.and(z.object({\n sessionUpdate: z.literal(\"tool_call_update\"),\n })),\n zPlan.and(z.object({\n sessionUpdate: z.literal(\"plan\"),\n })),\n zPlanUpdate.and(z.object({\n sessionUpdate: z.literal(\"plan_update\"),\n })),\n zPlanRemoved.and(z.object({\n sessionUpdate: z.literal(\"plan_removed\"),\n })),\n zAvailableCommandsUpdate.and(z.object({\n sessionUpdate: z.literal(\"available_commands_update\"),\n })),\n zCurrentModeUpdate.and(z.object({\n sessionUpdate: z.literal(\"current_mode_update\"),\n })),\n zConfigOptionUpdate.and(z.object({\n sessionUpdate: z.literal(\"config_option_update\"),\n })),\n zSessionInfoUpdate.and(z.object({\n sessionUpdate: z.literal(\"session_info_update\"),\n })),\n zUsageUpdate.and(z.object({\n sessionUpdate: z.literal(\"usage_update\"),\n })),\n]);\n/**\n * Notification containing a session update from the agent.\n *\n * Used to stream real-time progress and results during prompt processing.\n *\n * See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)\n */\nexport const zSessionNotification = z.object({\n sessionId: zSessionId,\n update: zSessionUpdate,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Notification sent by the agent when a URL-based elicitation is complete.\n *\n * @experimental\n */\nexport const zCompleteElicitationNotification = z.object({\n elicitationId: zElicitationId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Notification parameters for `mcp/message`.\n *\n * This is used when the wrapped MCP message is a notification and the outer JSON-RPC\n * envelope has no `id`.\n *\n * @experimental\n */\nexport const zMessageMcpNotification = z.object({\n connectionId: zMcpConnectionId,\n method: z.string(),\n params: z.record(z.string(), z.unknown()).nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Allows the Agent to send an arbitrary notification that is not part of the ACP spec.\n * Extension notifications provide a way to send one-way messages for custom functionality\n * while maintaining protocol compatibility.\n *\n * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)\n */\nexport const zExtNotification = z.unknown();\n/**\n * A JSON-RPC notification object.\n */\nexport const zAgentNotification = z.object({\n method: z.string(),\n params: z\n .union([\n zSessionNotification,\n zCompleteElicitationNotification,\n zMessageMcpNotification,\n zExtNotification,\n ])\n .nullish(),\n});\n/**\n * File system capabilities that a client may support.\n *\n * See protocol docs: [FileSystem](https://agentclientprotocol.com/protocol/initialization#filesystem)\n */\nexport const zFileSystemCapabilities = z.object({\n readTextFile: z.boolean().optional().default(false),\n writeTextFile: z.boolean().optional().default(false),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Capabilities for boolean session configuration options.\n *\n * Supplying `{}` means the client supports boolean session configuration options.\n *\n * @experimental\n */\nexport const zBooleanConfigOptionCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Session configuration option capabilities supported by the client.\n *\n * @experimental\n */\nexport const zSessionConfigOptionsCapabilities = z.object({\n boolean: defaultOnError(zBooleanConfigOptionCapabilities.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Session-related capabilities supported by the client.\n *\n * @experimental\n */\nexport const zClientSessionCapabilities = z.object({\n configOptions: defaultOnError(zSessionConfigOptionsCapabilities.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Capabilities for receiving `plan_update` and `plan_removed` session updates.\n *\n * @experimental\n */\nexport const zPlanCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Authentication capabilities supported by the client.\n *\n * Advertised during initialization to inform the agent which authentication\n * method types the client can handle. This governs opt-in types that require\n * additional client-side support.\n *\n * @experimental\n */\nexport const zAuthCapabilities = z.object({\n terminal: z.boolean().optional().default(false),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Form-based elicitation capabilities.\n *\n * @experimental\n */\nexport const zElicitationFormCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * URL-based elicitation capabilities.\n *\n * @experimental\n */\nexport const zElicitationUrlCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Elicitation capabilities supported by the client.\n *\n * @experimental\n */\nexport const zElicitationCapabilities = z.object({\n form: defaultOnError(zElicitationFormCapabilities.nullish(), () => undefined),\n url: defaultOnError(zElicitationUrlCapabilities.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Marker for jump suggestion support.\n */\nexport const zNesJumpCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Marker for rename suggestion support.\n */\nexport const zNesRenameCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Marker for search and replace suggestion support.\n */\nexport const zNesSearchAndReplaceCapabilities = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * NES capabilities advertised by the client during initialization.\n */\nexport const zClientNesCapabilities = z.object({\n jump: defaultOnError(zNesJumpCapabilities.nullish(), () => undefined),\n rename: defaultOnError(zNesRenameCapabilities.nullish(), () => undefined),\n searchAndReplace: defaultOnError(zNesSearchAndReplaceCapabilities.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Capabilities supported by the client.\n *\n * Advertised during initialization to inform the agent about\n * available features and methods.\n *\n * See protocol docs: [Client Capabilities](https://agentclientprotocol.com/protocol/initialization#client-capabilities)\n */\nexport const zClientCapabilities = z.object({\n fs: zFileSystemCapabilities\n .optional()\n .default({ readTextFile: false, writeTextFile: false }),\n terminal: z.boolean().optional().default(false),\n session: defaultOnError(zClientSessionCapabilities.nullish(), () => undefined),\n plan: defaultOnError(zPlanCapabilities.nullish(), () => undefined),\n auth: zAuthCapabilities.optional().default({ terminal: false }),\n elicitation: defaultOnError(zElicitationCapabilities.nullish(), () => undefined),\n nes: defaultOnError(zClientNesCapabilities.nullish(), () => undefined),\n positionEncodings: defaultOnError(vecSkipError(zPositionEncodingKind).optional(), () => []),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request parameters for the initialize method.\n *\n * Sent by the client to establish connection and negotiate capabilities.\n *\n * See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)\n */\nexport const zInitializeRequest = z.object({\n protocolVersion: zProtocolVersion,\n clientCapabilities: zClientCapabilities.optional().default({\n fs: { readTextFile: false, writeTextFile: false },\n terminal: false,\n auth: { terminal: false },\n }),\n clientInfo: defaultOnError(zImplementation.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request parameters for the authenticate method.\n *\n * Specifies which authentication method to use.\n */\nexport const zAuthenticateRequest = z.object({\n methodId: zAuthMethodId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Request parameters for `providers/list`.\n *\n * @experimental\n */\nexport const zListProvidersRequest = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Request parameters for `providers/set`.\n *\n * Replaces the full configuration for one provider id.\n *\n * @experimental\n */\nexport const zSetProviderRequest = z.object({\n id: z.string(),\n apiType: zLlmProtocol,\n baseUrl: z.string(),\n headers: z.record(z.string(), z.string()).optional(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Request parameters for `providers/disable`.\n *\n * @experimental\n */\nexport const zDisableProviderRequest = z.object({\n id: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request parameters for the logout method.\n *\n * Terminates the current authenticated session.\n */\nexport const zLogoutRequest = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * An HTTP header to set when making requests to the MCP server.\n */\nexport const zHttpHeader = z.object({\n name: z.string(),\n value: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * HTTP transport configuration for MCP.\n */\nexport const zMcpServerHttp = z.object({\n name: z.string(),\n url: z.string(),\n headers: z.array(zHttpHeader),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * SSE transport configuration for MCP.\n */\nexport const zMcpServerSse = z.object({\n name: z.string(),\n url: z.string(),\n headers: z.array(zHttpHeader),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * ACP transport configuration for MCP.\n *\n * The MCP server is provided by an ACP component and communicates over the ACP channel\n * using `mcp/connect`, `mcp/message`, and `mcp/disconnect`.\n *\n * @experimental\n */\nexport const zMcpServerAcp = z.object({\n name: z.string(),\n id: zMcpServerAcpId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Stdio transport configuration for MCP.\n */\nexport const zMcpServerStdio = z.object({\n name: z.string(),\n command: z.string(),\n args: z.array(z.string()),\n env: z.array(zEnvVariable),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Configuration for connecting to an MCP (Model Context Protocol) server.\n *\n * MCP servers provide tools and context that the agent can use when\n * processing prompts.\n *\n * See protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/session-setup#mcp-servers)\n */\nexport const zMcpServer = z.union([\n zMcpServerHttp.and(z.object({\n type: z.literal(\"http\"),\n })),\n zMcpServerSse.and(z.object({\n type: z.literal(\"sse\"),\n })),\n zMcpServerAcp.and(z.object({\n type: z.literal(\"acp\"),\n })),\n zMcpServerStdio,\n]);\n/**\n * Request parameters for creating a new session.\n *\n * See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)\n */\nexport const zNewSessionRequest = z.object({\n cwd: z.string(),\n additionalDirectories: z.array(z.string()).optional(),\n mcpServers: z.array(zMcpServer),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request parameters for loading an existing session.\n *\n * Only available if the Agent supports the `loadSession` capability.\n *\n * See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)\n */\nexport const zLoadSessionRequest = z.object({\n mcpServers: z.array(zMcpServer),\n cwd: z.string(),\n additionalDirectories: z.array(z.string()).optional(),\n sessionId: zSessionId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request parameters for listing existing sessions.\n *\n * Only available if the Agent supports the `sessionCapabilities.list` capability.\n */\nexport const zListSessionsRequest = z.object({\n cwd: z.string().nullish(),\n cursor: z.string().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request parameters for deleting an existing session from `session/list`.\n *\n * Only available if the Agent supports the `sessionCapabilities.delete` capability.\n */\nexport const zDeleteSessionRequest = z.object({\n sessionId: zSessionId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Request parameters for forking an existing session.\n *\n * Creates a new session based on the context of an existing one, allowing\n * operations like generating summaries without affecting the original session's history.\n *\n * Only available if the Agent supports the `session.fork` capability.\n *\n * @experimental\n */\nexport const zForkSessionRequest = z.object({\n sessionId: zSessionId,\n cwd: z.string(),\n additionalDirectories: z.array(z.string()).optional(),\n mcpServers: z.array(zMcpServer).optional(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request parameters for resuming an existing session.\n *\n * Resumes an existing session without returning previous messages (unlike `session/load`).\n * This is useful for agents that can resume sessions but don't implement full session loading.\n *\n * Only available if the Agent supports the `sessionCapabilities.resume` capability.\n */\nexport const zResumeSessionRequest = z.object({\n sessionId: zSessionId,\n cwd: z.string(),\n additionalDirectories: z.array(z.string()).optional(),\n mcpServers: z.array(zMcpServer).optional(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request parameters for closing an active session.\n *\n * If supported, the agent **must** cancel any ongoing work related to the session\n * (treat it as if `session/cancel` was called) and then free up any resources\n * associated with the session.\n *\n * Only available if the Agent supports the `sessionCapabilities.close` capability.\n */\nexport const zCloseSessionRequest = z.object({\n sessionId: zSessionId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request parameters for setting a session mode.\n */\nexport const zSetSessionModeRequest = z.object({\n sessionId: zSessionId,\n modeId: zSessionModeId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request parameters for setting a session configuration option.\n */\nexport const zSetSessionConfigOptionRequest = z.intersection(z.union([\n z.object({\n value: z.boolean(),\n type: z.literal(\"boolean\"),\n }),\n z.object({\n value: zSessionConfigValueId,\n }),\n]), z.object({\n sessionId: zSessionId,\n configId: zSessionConfigId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n}));\n/**\n * Request parameters for sending a user prompt to the agent.\n *\n * Contains the user's message and any additional context.\n *\n * See protocol docs: [User Message](https://agentclientprotocol.com/protocol/prompt-turn#1-user-message)\n */\nexport const zPromptRequest = z.object({\n sessionId: zSessionId,\n prompt: z.array(zContentBlock),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A workspace folder.\n */\nexport const zWorkspaceFolder = z.object({\n uri: z.string(),\n name: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Repository metadata for an NES session.\n */\nexport const zNesRepository = z.object({\n name: z.string(),\n owner: z.string(),\n remoteUrl: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request to start an NES session.\n */\nexport const zStartNesRequest = z.object({\n workspaceUri: z.string().nullish(),\n workspaceFolders: defaultOnError(vecSkipError(zWorkspaceFolder).nullish(), () => undefined),\n repository: defaultOnError(zNesRepository.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * What triggered the suggestion request.\n */\nexport const zNesTriggerKind = z.union([\n z.literal(\"automatic\"),\n z.literal(\"diagnostic\"),\n z.literal(\"manual\"),\n]);\n/**\n * A recently accessed file.\n */\nexport const zNesRecentFile = z.object({\n uri: z.string(),\n languageId: z.string(),\n text: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A code excerpt from a file.\n */\nexport const zNesExcerpt = z.object({\n startLine: z.int().gte(0).max(4294967295, {\n error: \"Invalid value: Expected uint32 to be <= 4294967295\",\n }),\n endLine: z.int().gte(0).max(4294967295, {\n error: \"Invalid value: Expected uint32 to be <= 4294967295\",\n }),\n text: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A related code snippet from a file.\n */\nexport const zNesRelatedSnippet = z.object({\n uri: z.string(),\n excerpts: z.array(zNesExcerpt),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * An entry in the edit history.\n */\nexport const zNesEditHistoryEntry = z.object({\n uri: z.string(),\n diff: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A user action (typing, cursor movement, etc.).\n */\nexport const zNesUserAction = z.object({\n action: z.string(),\n uri: z.string(),\n position: zPosition,\n timestampMs: z.number(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * An open file in the editor.\n */\nexport const zNesOpenFile = z.object({\n uri: z.string(),\n languageId: z.string(),\n visibleRange: defaultOnError(zRange.nullish(), () => undefined),\n lastFocusedMs: defaultOnError(z.number().nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Severity of a diagnostic.\n */\nexport const zNesDiagnosticSeverity = z.union([\n z.literal(\"error\"),\n z.literal(\"warning\"),\n z.literal(\"information\"),\n z.literal(\"hint\"),\n]);\n/**\n * A diagnostic (error, warning, etc.).\n */\nexport const zNesDiagnostic = z.object({\n uri: z.string(),\n range: zRange,\n severity: zNesDiagnosticSeverity,\n message: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Context attached to a suggestion request.\n */\nexport const zNesSuggestContext = z.object({\n recentFiles: defaultOnError(vecSkipError(zNesRecentFile).nullish(), () => undefined),\n relatedSnippets: defaultOnError(vecSkipError(zNesRelatedSnippet).nullish(), () => undefined),\n editHistory: defaultOnError(vecSkipError(zNesEditHistoryEntry).nullish(), () => undefined),\n userActions: defaultOnError(vecSkipError(zNesUserAction).nullish(), () => undefined),\n openFiles: defaultOnError(vecSkipError(zNesOpenFile).nullish(), () => undefined),\n diagnostics: defaultOnError(vecSkipError(zNesDiagnostic).nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request for a code suggestion.\n */\nexport const zSuggestNesRequest = z.object({\n sessionId: zSessionId,\n uri: z.string(),\n version: z.number(),\n position: zPosition,\n selection: defaultOnError(zRange.nullish(), () => undefined),\n triggerKind: zNesTriggerKind,\n context: defaultOnError(zNesSuggestContext.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Request to close an NES session.\n *\n * The agent **must** cancel any ongoing work related to the NES session\n * and then free up any resources associated with the session.\n */\nexport const zCloseNesRequest = z.object({\n sessionId: zSessionId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A JSON-RPC request object.\n */\nexport const zClientRequest = z.object({\n id: zRequestId,\n method: z.string(),\n params: z\n .union([\n zInitializeRequest,\n zAuthenticateRequest,\n zListProvidersRequest,\n zSetProviderRequest,\n zDisableProviderRequest,\n zLogoutRequest,\n zNewSessionRequest,\n zLoadSessionRequest,\n zListSessionsRequest,\n zDeleteSessionRequest,\n zForkSessionRequest,\n zResumeSessionRequest,\n zCloseSessionRequest,\n zSetSessionModeRequest,\n zSetSessionConfigOptionRequest,\n zPromptRequest,\n zStartNesRequest,\n zSuggestNesRequest,\n zCloseNesRequest,\n zMessageMcpRequest,\n zExtRequest,\n ])\n .nullish(),\n});\n/**\n * Response to `fs/write_text_file`\n */\nexport const zWriteTextFileResponse = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response containing the contents of a text file.\n */\nexport const zReadTextFileResponse = z.object({\n content: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * The user selected one of the provided options.\n */\nexport const zSelectedPermissionOutcome = z.object({\n optionId: zPermissionOptionId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * The outcome of a permission request.\n */\nexport const zRequestPermissionOutcome = z.union([\n z.object({\n outcome: z.literal(\"cancelled\"),\n }),\n zSelectedPermissionOutcome.and(z.object({\n outcome: z.literal(\"selected\"),\n })),\n]);\n/**\n * Response to a permission request.\n */\nexport const zRequestPermissionResponse = z.object({\n outcome: zRequestPermissionOutcome,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response containing the ID of the created terminal.\n */\nexport const zCreateTerminalResponse = z.object({\n terminalId: zTerminalId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Exit status of a terminal command.\n */\nexport const zTerminalExitStatus = z.object({\n exitCode: z\n .int()\n .gte(0)\n .max(4294967295, {\n error: \"Invalid value: Expected uint32 to be <= 4294967295\",\n })\n .nullish(),\n signal: z.string().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response containing the terminal output and exit status.\n */\nexport const zTerminalOutputResponse = z.object({\n output: z.string(),\n truncated: z.boolean(),\n exitStatus: zTerminalExitStatus.nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response to terminal/release method\n */\nexport const zReleaseTerminalResponse = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response containing the exit status of a terminal command.\n */\nexport const zWaitForTerminalExitResponse = z.object({\n exitCode: z\n .int()\n .gte(0)\n .max(4294967295, {\n error: \"Invalid value: Expected uint32 to be <= 4294967295\",\n })\n .nullish(),\n signal: z.string().nullish(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Response to `terminal/kill` method\n */\nexport const zKillTerminalResponse = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Allowed wire representations for [`ElicitationContentValue`].\n */\nexport const zElicitationContentValue = z.union([\n z.string(),\n z.number(),\n z.number(),\n z.boolean(),\n z.array(z.string()),\n]);\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * The user accepted the elicitation and provided content.\n *\n * @experimental\n */\nexport const zElicitationAcceptAction = z.object({\n content: z.record(z.string(), zElicitationContentValue).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Response from the client to an elicitation request.\n *\n * @experimental\n */\nexport const zCreateElicitationResponse = z.intersection(z.union([\n zElicitationAcceptAction.and(z.object({\n action: z.literal(\"accept\"),\n })),\n z.object({\n action: z.literal(\"decline\"),\n }),\n z.object({\n action: z.literal(\"cancel\"),\n }),\n]), z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n}));\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Response to `mcp/connect`.\n *\n * @experimental\n */\nexport const zConnectMcpResponse = z.object({\n connectionId: zMcpConnectionId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Response to `mcp/disconnect`.\n *\n * @experimental\n */\nexport const zDisconnectMcpResponse = z.object({\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A JSON-RPC response object.\n */\nexport const zClientResponse = z.union([\n z.object({\n id: zRequestId,\n result: z.union([\n zWriteTextFileResponse,\n zReadTextFileResponse,\n zRequestPermissionResponse,\n zCreateTerminalResponse,\n zTerminalOutputResponse,\n zReleaseTerminalResponse,\n zWaitForTerminalExitResponse,\n zKillTerminalResponse,\n zCreateElicitationResponse,\n zConnectMcpResponse,\n zDisconnectMcpResponse,\n zExtResponse,\n zMessageMcpResponse,\n ]),\n }),\n z.object({\n id: zRequestId,\n error: zError,\n }),\n]);\n/**\n * Notification to cancel ongoing operations for a session.\n *\n * See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)\n */\nexport const zCancelNotification = z.object({\n sessionId: zSessionId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Notification sent when a file is opened in the editor.\n */\nexport const zDidOpenDocumentNotification = z.object({\n sessionId: zSessionId,\n uri: z.string(),\n languageId: z.string(),\n version: z.number(),\n text: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A content change event for a document.\n *\n * When `range` is `None`, `text` is the full content of the document.\n * When `range` is `Some`, `text` replaces the given range.\n */\nexport const zTextDocumentContentChangeEvent = z.object({\n range: zRange.nullish(),\n text: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Notification sent when a file is edited.\n */\nexport const zDidChangeDocumentNotification = z.object({\n sessionId: zSessionId,\n uri: z.string(),\n version: z.number(),\n contentChanges: z.array(zTextDocumentContentChangeEvent),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Notification sent when a file is closed.\n */\nexport const zDidCloseDocumentNotification = z.object({\n sessionId: zSessionId,\n uri: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Notification sent when a file is saved.\n */\nexport const zDidSaveDocumentNotification = z.object({\n sessionId: zSessionId,\n uri: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Notification sent when a file becomes the active editor tab.\n */\nexport const zDidFocusDocumentNotification = z.object({\n sessionId: zSessionId,\n uri: z.string(),\n version: z.number(),\n position: zPosition,\n visibleRange: zRange,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * Notification sent when a suggestion is accepted.\n */\nexport const zAcceptNesNotification = z.object({\n sessionId: zSessionId,\n id: z.string(),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * The reason a suggestion was rejected.\n */\nexport const zNesRejectReason = z.union([\n z.literal(\"rejected\"),\n z.literal(\"ignored\"),\n z.literal(\"replaced\"),\n z.literal(\"cancelled\"),\n]);\n/**\n * Notification sent when a suggestion is rejected.\n */\nexport const zRejectNesNotification = z.object({\n sessionId: zSessionId,\n id: z.string(),\n reason: defaultOnError(zNesRejectReason.nullish(), () => undefined),\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n/**\n * A JSON-RPC notification object.\n */\nexport const zClientNotification = z.object({\n method: z.string(),\n params: z\n .union([\n zCancelNotification,\n zDidOpenDocumentNotification,\n zDidChangeDocumentNotification,\n zDidCloseDocumentNotification,\n zDidSaveDocumentNotification,\n zDidFocusDocumentNotification,\n zAcceptNesNotification,\n zRejectNesNotification,\n zMessageMcpNotification,\n zExtNotification,\n ])\n .nullish(),\n});\n/**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Notification to cancel an ongoing request.\n *\n * See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/cancellation)\n *\n * @experimental\n */\nexport const zCancelRequestNotification = z.object({\n requestId: zRequestId,\n _meta: z.record(z.string(), z.unknown()).nullish(),\n});\n//# sourceMappingURL=zod.gen.js.map","/**\n * Creates an ACP Stream from a pair of newline-delimited JSON streams.\n *\n * This is the typical way to handle ACP connections over stdio, converting\n * between AnyMessage objects and newline-delimited JSON.\n *\n * @param output - The writable stream to send encoded messages to\n * @param input - The readable stream to receive encoded messages from\n * @returns A Stream for bidirectional ACP communication\n */\nexport function ndJsonStream(output, input) {\n const textEncoder = new TextEncoder();\n const textDecoder = new TextDecoder();\n let cancelled = false;\n let inputReader;\n const readable = new ReadableStream({\n async start(controller) {\n let content = \"\";\n const reader = input.getReader();\n inputReader = reader;\n try {\n while (true) {\n const { value, done } = await reader.read();\n if (cancelled) {\n return;\n }\n if (done) {\n content += textDecoder.decode();\n break;\n }\n if (!value) {\n continue;\n }\n content += textDecoder.decode(value, { stream: true });\n const lines = content.split(\"\\n\");\n content = lines.pop() || \"\";\n for (const line of lines) {\n if (cancelled) {\n return;\n }\n const trimmedLine = line.trim();\n if (trimmedLine) {\n try {\n const message = JSON.parse(trimmedLine);\n controller.enqueue(message);\n }\n catch (err) {\n console.error(\"Failed to parse JSON message:\", trimmedLine, err);\n }\n }\n }\n }\n if (cancelled) {\n return;\n }\n const trimmedLine = content.trim();\n if (trimmedLine) {\n try {\n const message = JSON.parse(trimmedLine);\n controller.enqueue(message);\n }\n catch (err) {\n console.error(\"Failed to parse JSON message:\", trimmedLine, err);\n }\n }\n }\n catch (err) {\n if (cancelled) {\n return;\n }\n controller.error(err);\n return;\n }\n finally {\n if (inputReader === reader) {\n inputReader = undefined;\n }\n reader.releaseLock();\n }\n if (cancelled) {\n return;\n }\n controller.close();\n },\n cancel(reason) {\n cancelled = true;\n return inputReader?.cancel(reason);\n },\n });\n const writable = new WritableStream({\n async write(message) {\n const content = JSON.stringify(message) + \"\\n\";\n const writer = output.getWriter();\n try {\n await writer.write(textEncoder.encode(content));\n }\n finally {\n writer.releaseLock();\n }\n },\n });\n return { readable, writable };\n}\n//# sourceMappingURL=stream.js.map","const CANCEL_REQUEST_METHOD = \"$/cancel_request\";\nexport function isJsonRpcMessage(value) {\n return (isRequestMessage(value) ||\n isResponseMessage(value) ||\n isNotificationMessage(value));\n}\nexport function isRequestMessage(value) {\n return (isJsonRpcEnvelope(value) &&\n \"id\" in value &&\n typeof value[\"method\"] === \"string\" &&\n isJsonRpcId(value[\"id\"]));\n}\nexport function isResponseMessage(value) {\n if (!isJsonRpcEnvelope(value) || \"method\" in value) {\n return false;\n }\n if (!(\"id\" in value) || !isJsonRpcId(value[\"id\"])) {\n return false;\n }\n const hasResult = Object.hasOwn(value, \"result\");\n const hasError = Object.hasOwn(value, \"error\");\n if (hasResult === hasError) {\n return false;\n }\n return !hasError || isErrorResponse(value[\"error\"]);\n}\nexport function isNotificationMessage(value) {\n return (isJsonRpcEnvelope(value) &&\n !(\"id\" in value) &&\n typeof value[\"method\"] === \"string\");\n}\nexport function isRecord(value) {\n return typeof value === \"object\" && value !== null;\n}\nfunction isJsonRpcEnvelope(value) {\n return isRecord(value) && value[\"jsonrpc\"] === \"2.0\";\n}\nfunction isJsonRpcId(value) {\n return (value === null ||\n typeof value === \"string\" ||\n (typeof value === \"number\" && Number.isFinite(value)));\n}\nfunction cancelRequestId(params) {\n if (!isRecord(params) || !isJsonRpcId(params[\"requestId\"])) {\n return undefined;\n }\n return params[\"requestId\"];\n}\nfunction isErrorResponse(value) {\n return (isRecord(value) &&\n typeof value[\"code\"] === \"number\" &&\n Number.isInteger(value[\"code\"]) &&\n typeof value[\"message\"] === \"string\");\n}\n/**\n * Helpers for constructing `HandleResult` values.\n */\nexport const Handled = {\n /**\n * Marks a message as handled.\n */\n yes() {\n return { handled: true };\n },\n /**\n * Leaves a message unhandled so later handlers can process it.\n */\n no(message, retry = false) {\n return { handled: false, message, retry };\n },\n};\nfunction rejectedPromise(error) {\n const promise = Promise.reject(error);\n promise.catch(() => { });\n return promise;\n}\nfunction errorDetails(error) {\n if (error instanceof Error) {\n return error.message;\n }\n if (typeof error === \"object\" &&\n error != null &&\n \"message\" in error &&\n typeof error.message === \"string\") {\n return error.message;\n }\n return undefined;\n}\nfunction isZodError(error) {\n return (typeof error === \"object\" &&\n error !== null &&\n \"name\" in error &&\n error.name === \"ZodError\" &&\n \"issues\" in error &&\n Array.isArray(error.issues) &&\n \"format\" in error &&\n typeof error.format === \"function\");\n}\nfunction errorToResult(error) {\n if (error instanceof RequestError) {\n return error.toResult();\n }\n if (isZodError(error)) {\n return RequestError.invalidParams(error.format()).toResult();\n }\n const details = errorDetails(error);\n try {\n return RequestError.internalError(details ? JSON.parse(details) : {}).toResult();\n }\n catch {\n return RequestError.internalError({ details }).toResult();\n }\n}\nfunction requestCancelledError(reason) {\n if (reason instanceof RequestError && reason.code === -32800) {\n return reason;\n }\n return RequestError.requestCancelled(reason);\n}\nfunction errorToRequestResult(error, signal) {\n const requestCancelled = abortErrorToRequestCancelled(error, signal);\n return requestCancelled ? requestCancelled.toResult() : errorToResult(error);\n}\nfunction abortErrorToRequestCancelled(error, signal) {\n if (!signal.aborted || !isAbortError(error)) {\n return undefined;\n }\n return requestCancelledError(signal.reason);\n}\nfunction isAbortError(error) {\n if (typeof error !== \"object\" || error === null) {\n return false;\n }\n const maybeAbortError = error;\n return (maybeAbortError.name === \"AbortError\" ||\n maybeAbortError.code === \"ABORT_ERR\");\n}\n/**\n * Responder for one incoming JSON-RPC request.\n *\n * Handlers may use this when they need to decide exactly when or how the\n * response is sent.\n */\nexport class RequestResponder {\n id;\n sendResult;\n signal;\n finishRequest;\n didRespond = false;\n constructor(\n /**\n * Request ID to include in the response.\n */\n id, sendResult, \n /**\n * AbortSignal for this incoming request.\n */\n signal = new AbortController().signal, finishRequest) {\n this.id = id;\n this.sendResult = sendResult;\n this.signal = signal;\n this.finishRequest = finishRequest;\n }\n /**\n * Whether this request has already received a response.\n */\n get responded() {\n return this.didRespond;\n }\n /**\n * Sends a successful JSON-RPC response.\n */\n respond(response) {\n return this.respondWithResult({ result: (response ?? null) });\n }\n /**\n * Sends an error JSON-RPC response.\n */\n respondWithError(error) {\n const errorResponse = error instanceof RequestError ? error.toErrorResponse() : error;\n return this.respondWithResult({ error: errorResponse });\n }\n /**\n * Sends a complete JSON-RPC result payload.\n */\n respondWithResult(result) {\n if (this.didRespond) {\n return rejectedPromise(new Error(\"JSON-RPC request already responded\"));\n }\n this.didRespond = true;\n return this.sendResult(result).finally(() => {\n this.finishRequest?.();\n });\n }\n}\n/**\n * Disposable handle returned when a handler is registered dynamically.\n */\nexport class HandlerRegistration {\n disposeHandler;\n active = true;\n constructor(disposeHandler) {\n this.disposeHandler = disposeHandler;\n }\n /**\n * Unregisters the associated handler.\n */\n dispose() {\n if (!this.active) {\n return;\n }\n this.active = false;\n this.disposeHandler();\n }\n /**\n * Supports explicit resource management with `using`.\n */\n [Symbol.dispose]() {\n this.dispose();\n }\n /**\n * Returns this registration for call sites that intentionally keep it active.\n */\n runIndefinitely() {\n return this;\n }\n}\n/**\n * Per-connection context passed to low-level JSON-RPC handlers.\n */\nexport class ConnectionContext {\n connection;\n constructor(connection) {\n this.connection = connection;\n }\n /**\n * Sends a request over the connection.\n */\n sendRequest(method, params, mapResponse, options) {\n return this.connection.sendRequest(method, params, mapResponse, options);\n }\n /**\n * Sends a notification over the connection.\n */\n sendNotification(method, params) {\n return this.connection.sendNotification(method, params);\n }\n /**\n * Sends a protocol-level request cancellation notification.\n */\n sendCancelRequest(requestId) {\n return this.connection.sendCancelRequest(requestId);\n }\n /**\n * Registers a handler that can be disposed independently.\n */\n addDynamicHandler(handler) {\n return this.connection.addDynamicHandler(handler);\n }\n /**\n * AbortSignal that aborts when the connection closes.\n */\n get signal() {\n return this.connection.signal;\n }\n /**\n * Promise that resolves when the connection closes.\n */\n get closed() {\n return this.connection.closed;\n }\n}\n/**\n * Lower-level JSON-RPC connection over an ACP `Stream`.\n *\n * Most ACP integrations should use `agent(...)` or `client(...)`. Use this\n * class when building generic JSON-RPC middleware or custom dispatch behavior.\n */\nexport class Connection {\n pendingResponses = new Map();\n incomingRequests = new Map();\n nextRequestId = 0;\n staticHandlers = [];\n dynamicHandlers = new Set();\n stream;\n writeQueue = Promise.resolve();\n abortController = new AbortController();\n closedPromise;\n retryQueue = [];\n context = new ConnectionContext(this);\n receiveReader;\n constructor(requestHandlerOrStream, notificationHandlerOrHandlers, streamOrOptions, options) {\n if (typeof requestHandlerOrStream === \"function\") {\n const requestHandler = requestHandlerOrStream;\n const notificationHandler = notificationHandlerOrHandlers;\n const stream = streamOrOptions;\n this.initialize(stream, [\n ...(options?.handlers ?? []),\n this.legacyHandler(requestHandler, notificationHandler),\n ]);\n return;\n }\n const stream = requestHandlerOrStream;\n const handlers = notificationHandlerOrHandlers;\n const connectionOptions = streamOrOptions;\n this.initialize(stream, [\n ...(connectionOptions?.handlers ?? []),\n ...handlers,\n ]);\n }\n /**\n * Creates a builder for configuring a handler-based connection.\n */\n static builder() {\n return new ConnectionBuilder();\n }\n /**\n * Runs an operation while the connection is open, then closes the connection.\n *\n * If the stream closes before `op` settles, the returned promise rejects with\n * the connection close reason.\n */\n runUntil(op) {\n let opSettled = false;\n const opPromise = Promise.resolve()\n .then(() => op(this.context))\n .finally(() => {\n opSettled = true;\n });\n const closedPromise = this.closed.then(() => {\n if (opSettled) {\n return new Promise(() => { });\n }\n throw this.closedReason();\n });\n return Promise.race([opPromise, closedPromise]).finally(() => {\n opSettled = true;\n this.close();\n });\n }\n /**\n * Adds a handler after the connection has started.\n *\n * Any messages queued with `Handled.no(message, true)` are retried after the\n * handler is added.\n */\n addDynamicHandler(handler) {\n this.dynamicHandlers.add(handler);\n if (this.retryQueue.length > 0) {\n for (const message of this.retryQueue.splice(0)) {\n void this.processIncomingMessage(message).catch((error) => this.close(error));\n }\n }\n return new HandlerRegistration(() => {\n this.dynamicHandlers.delete(handler);\n });\n }\n /**\n * AbortSignal that aborts when the connection closes.\n */\n get signal() {\n return this.abortController.signal;\n }\n /**\n * Promise that resolves when the connection closes.\n */\n get closed() {\n return this.closedPromise;\n }\n /** @internal */\n getContext() {\n return this.context;\n }\n /**\n * Sends a JSON-RPC request.\n *\n * `mapResponse` can convert the raw result before the returned promise\n * resolves.\n */\n sendRequest(method, params, mapResponse, options = {}) {\n if (this.abortController.signal.aborted) {\n return rejectedPromise(this.closedReason());\n }\n const id = this.nextRequestId++;\n let cancel = () => { };\n const responsePromise = new Promise((resolve, reject) => {\n const pendingResponse = {\n resolve: (response) => {\n try {\n const value = mapResponse\n ? mapResponse(response)\n : response;\n resolve(value);\n }\n catch (error) {\n reject(error);\n }\n },\n reject,\n };\n cancel = () => {\n if (pendingResponse.cancellationSent) {\n return;\n }\n pendingResponse.cancellationSent = true;\n pendingResponse.cleanup?.();\n void this.sendCancelRequest(id).catch(() => { });\n };\n options.cancellationSignal?.addEventListener(\"abort\", cancel, {\n once: true,\n });\n pendingResponse.cleanup = () => {\n options.cancellationSignal?.removeEventListener(\"abort\", cancel);\n };\n this.pendingResponses.set(id, pendingResponse);\n });\n responsePromise.catch(() => { });\n const requestSent = this.sendMessage({\n jsonrpc: \"2.0\",\n id,\n method,\n params,\n });\n void requestSent.catch(() => { });\n if (options.cancellationSignal?.aborted) {\n cancel();\n }\n return responsePromise;\n }\n /**\n * Sends a protocol-level request cancellation notification.\n */\n sendCancelRequest(requestId) {\n return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId });\n }\n /**\n * Sends a JSON-RPC notification.\n */\n sendNotification(method, params) {\n if (this.abortController.signal.aborted) {\n return rejectedPromise(this.closedReason());\n }\n return this.sendMessage({ jsonrpc: \"2.0\", method, params });\n }\n /**\n * Closes the connection and rejects pending requests.\n */\n close(error) {\n if (this.abortController.signal.aborted) {\n return;\n }\n const closeError = error ?? new Error(\"ACP connection closed\");\n this.abortController.abort(closeError);\n for (const pendingResponse of this.pendingResponses.values()) {\n pendingResponse.cleanup?.();\n pendingResponse.reject(closeError);\n }\n this.pendingResponses.clear();\n for (const controller of this.incomingRequests.values()) {\n controller.abort(closeError);\n }\n this.incomingRequests.clear();\n void this.receiveReader?.cancel(closeError).catch(() => { });\n }\n initialize(stream, handlers) {\n this.stream = stream;\n this.staticHandlers = handlers;\n this.closedPromise = new Promise((resolve) => {\n this.abortController.signal.addEventListener(\"abort\", () => resolve());\n });\n void this.receive();\n }\n legacyHandler(requestHandler, notificationHandler) {\n return {\n handleMessage: async (message, cx) => {\n if (message.kind === \"request\") {\n const result = await requestHandler(message.method, message.params, cx);\n await message.responder.respond(result);\n }\n else {\n await notificationHandler(message.method, message.params, cx);\n }\n return Handled.yes();\n },\n };\n }\n async receive() {\n let closeError = undefined;\n try {\n const reader = this.stream.readable.getReader();\n this.receiveReader = reader;\n try {\n while (!this.abortController.signal.aborted) {\n const { value: message, done } = await reader.read();\n if (this.abortController.signal.aborted) {\n break;\n }\n if (done) {\n break;\n }\n if (!message) {\n continue;\n }\n this.receiveMessage(message);\n }\n }\n finally {\n if (this.receiveReader === reader) {\n this.receiveReader = undefined;\n }\n reader.releaseLock();\n }\n }\n catch (error) {\n closeError = error;\n }\n finally {\n this.close(closeError);\n }\n }\n receiveMessage(message) {\n if (this.abortController.signal.aborted) {\n return;\n }\n if (\"method\" in message) {\n if (!(\"id\" in message)) {\n this.handleProtocolNotification(message);\n }\n void this.processIncomingMessage(this.toIncomingMessage(message)).catch((error) => this.close(error));\n }\n else if (\"id\" in message) {\n this.handleResponse(message);\n }\n else {\n console.error(\"Invalid message\", { message });\n }\n }\n async processIncomingMessage(message) {\n if (this.abortController.signal.aborted) {\n return;\n }\n let current = message;\n let retry = false;\n try {\n for (const handler of [\n ...this.staticHandlers,\n ...this.dynamicHandlers.values(),\n ]) {\n if (this.abortController.signal.aborted) {\n return;\n }\n const result = (await handler.handleMessage(current, this.context)) ?? {\n handled: true,\n };\n if (result.handled) {\n return;\n }\n current = result.message ?? current;\n retry = retry || Boolean(result.retry);\n }\n if (retry) {\n this.retryQueue.push(current);\n }\n else if (current.kind === \"request\") {\n await current.responder.respondWithError(RequestError.methodNotFound(current.method));\n }\n }\n catch (error) {\n if (this.abortController.signal.aborted) {\n return;\n }\n if (current.kind === \"request\" && !current.responder.responded) {\n await current.responder.respondWithResult(errorToRequestResult(error, current.responder.signal));\n }\n else {\n const response = errorToResult(error);\n if (\"error\" in response) {\n console.error(\"Error handling notification\", message.raw, response.error);\n }\n }\n }\n }\n toIncomingMessage(message) {\n if (\"id\" in message) {\n const abortController = new AbortController();\n this.incomingRequests.set(message.id, abortController);\n const finishRequest = () => {\n if (this.incomingRequests.get(message.id) === abortController) {\n this.incomingRequests.delete(message.id);\n }\n };\n return {\n kind: \"request\",\n method: message.method,\n params: message.params,\n raw: message,\n signal: abortController.signal,\n responder: new RequestResponder(message.id, (result) => this.sendMessage({\n jsonrpc: \"2.0\",\n id: message.id,\n ...result,\n }), abortController.signal, finishRequest),\n };\n }\n return {\n kind: \"notification\",\n method: message.method,\n params: message.params,\n raw: message,\n };\n }\n handleResponse(response) {\n const pendingResponse = this.pendingResponses.get(response.id);\n if (pendingResponse) {\n this.pendingResponses.delete(response.id);\n pendingResponse.cleanup?.();\n if (\"result\" in response) {\n pendingResponse.resolve(response.result);\n }\n else if (\"error\" in response) {\n const { code, message, data } = response.error;\n pendingResponse.reject(new RequestError(code, message, data));\n }\n else {\n pendingResponse.reject(RequestError.invalidRequest(response));\n }\n }\n else {\n console.error(\"Got response to unknown request\", response.id);\n }\n }\n handleProtocolNotification(message) {\n if (message.method !== CANCEL_REQUEST_METHOD) {\n return;\n }\n const requestId = cancelRequestId(message.params);\n if (requestId === undefined) {\n return;\n }\n const controller = this.incomingRequests.get(requestId);\n if (!controller || controller.signal.aborted) {\n return;\n }\n controller.abort(RequestError.requestCancelled({ requestId }));\n }\n closedReason() {\n return (this.abortController.signal.reason ?? new Error(\"ACP connection closed\"));\n }\n async sendMessage(message) {\n if (this.abortController.signal.aborted) {\n return rejectedPromise(this.closedReason());\n }\n this.writeQueue = this.writeQueue\n .then(async () => {\n if (this.abortController.signal.aborted) {\n throw this.closedReason();\n }\n const writer = this.stream.writable.getWriter();\n try {\n await writer.write(message);\n }\n finally {\n writer.releaseLock();\n }\n })\n .catch((error) => {\n this.close(error);\n throw error;\n });\n return this.writeQueue;\n }\n}\n/**\n * Builder for a lower-level handler-based JSON-RPC connection.\n */\nexport class ConnectionBuilder {\n handlers = [];\n connectionName;\n /**\n * Sets a diagnostic name used by handlers created from this builder.\n */\n name(name) {\n this.connectionName = name;\n return this;\n }\n /**\n * Adds a raw JSON-RPC handler to the handler chain.\n */\n withHandler(handler) {\n this.handlers.push(handler);\n return this;\n }\n /**\n * Adds a handler that can inspect every incoming request or notification.\n *\n * Observer callbacks that return void pass the message through to later\n * handlers. Return `Handled.yes()` to stop dispatch explicitly.\n */\n onReceiveMessage(handler) {\n return this.withHandler({\n handleMessage: async (message, cx) => (await handler(message, cx)) ?? Handled.no(message),\n describe: () => this.connectionName ?? \"onReceiveMessage\",\n });\n }\n /**\n * Adds a typed request handler for one method.\n */\n onReceiveRequest(method, parse, handler) {\n return this.withHandler({\n handleMessage: async (message, cx) => {\n if (message.kind !== \"request\" || message.method !== method) {\n return Handled.no(message);\n }\n const request = parse(message.params);\n return ((await handler(request, message.responder, cx)) ?? Handled.yes());\n },\n describe: () => `${this.connectionName ?? \"request\"}:${method}`,\n });\n }\n /**\n * Adds a typed notification handler for one method.\n */\n onReceiveNotification(method, parse, handler) {\n return this.withHandler({\n handleMessage: async (message, cx) => {\n if (message.kind !== \"notification\" || message.method !== method) {\n return Handled.no(message);\n }\n const notification = parse(message.params);\n return (await handler(notification, cx)) ?? Handled.yes();\n },\n describe: () => `${this.connectionName ?? \"notification\"}:${method}`,\n });\n }\n /**\n * Connects the configured handlers to a stream.\n */\n connect(stream, options) {\n return new Connection(stream, this.handlers, options);\n }\n /**\n * Connects to a stream for the lifetime of `op`, then closes the connection.\n */\n connectWith(stream, op, options) {\n return this.connect(stream, options).runUntil(op);\n }\n}\n/**\n * JSON-RPC error object.\n *\n * Represents an error that occurred during method execution, following the\n * JSON-RPC 2.0 error object specification with optional additional data.\n *\n * See protocol docs: [JSON-RPC Error Object](https://www.jsonrpc.org/specification#error_object)\n */\nexport class RequestError extends Error {\n code;\n /**\n * Additional JSON-RPC error data.\n */\n data;\n constructor(\n /**\n * JSON-RPC error code.\n */\n code, message, data) {\n super(message);\n this.code = code;\n this.name = \"RequestError\";\n this.data = data;\n }\n /**\n * Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.\n */\n static parseError(data, additionalMessage) {\n return new RequestError(-32700, `Parse error${additionalMessage ? `: ${additionalMessage}` : \"\"}`, data);\n }\n /**\n * The JSON sent is not a valid Request object.\n */\n static invalidRequest(data, additionalMessage) {\n return new RequestError(-32600, `Invalid request${additionalMessage ? `: ${additionalMessage}` : \"\"}`, data);\n }\n /**\n * The method does not exist / is not available.\n */\n static methodNotFound(method) {\n return new RequestError(-32601, `\"Method not found\": ${method}`, {\n method,\n });\n }\n /**\n * Invalid method parameter(s).\n */\n static invalidParams(data, additionalMessage) {\n return new RequestError(-32602, `Invalid params${additionalMessage ? `: ${additionalMessage}` : \"\"}`, data);\n }\n /**\n * Internal JSON-RPC error.\n */\n static internalError(data, additionalMessage) {\n return new RequestError(-32603, `Internal error${additionalMessage ? `: ${additionalMessage}` : \"\"}`, data);\n }\n /**\n * Execution of the request was aborted.\n */\n static requestCancelled(data, additionalMessage) {\n return new RequestError(-32800, `Request cancelled${additionalMessage ? `: ${additionalMessage}` : \"\"}`, data);\n }\n /**\n * Authentication required.\n */\n static authRequired(data, additionalMessage) {\n return new RequestError(-32000, `Authentication required${additionalMessage ? `: ${additionalMessage}` : \"\"}`, data);\n }\n /**\n * Resource, such as a file, was not found\n */\n static resourceNotFound(uri) {\n return new RequestError(-32002, `Resource not found${uri ? `: ${uri}` : \"\"}`, uri && { uri });\n }\n /**\n * Converts this error to a JSON-RPC result object.\n */\n toResult() {\n return {\n error: {\n code: this.code,\n message: this.message,\n data: this.data,\n },\n };\n }\n /**\n * Converts this error to a JSON-RPC error response payload.\n */\n toErrorResponse() {\n return {\n code: this.code,\n message: this.message,\n data: this.data,\n };\n }\n}\n//# sourceMappingURL=jsonrpc.js.map","import * as schema from \"./schema/index.js\";\nimport * as validate from \"./schema/zod.gen.js\";\nexport { AGENT_METHODS, CLIENT_METHODS, PROTOCOL_METHODS, PROTOCOL_VERSION, } from \"./schema/index.js\";\nexport * from \"./stream.js\";\nexport { RequestError } from \"./jsonrpc.js\";\nimport { Connection, Handled, HandlerRegistration } from \"./jsonrpc.js\";\nfunction emptyObjectResponse(response) {\n return response ?? {};\n}\nfunction isStream(value) {\n return (typeof value === \"object\" &&\n value !== null &&\n \"readable\" in value &&\n \"writable\" in value);\n}\nfunction memoryStreamPair() {\n const leftToRight = new TransformStream();\n const rightToLeft = new TransformStream();\n return [\n {\n readable: rightToLeft.readable,\n writable: leftToRight.writable,\n },\n {\n readable: leftToRight.readable,\n writable: rightToLeft.writable,\n },\n ];\n}\n/**\n * ACP method-name constants.\n *\n * Use these with `onRequest(...)`, `onNotification(...)`, `request(...)`, and\n * `notify(...)` when you want literal-string type inference without spelling\n * protocol strings inline.\n */\nexport const methods = {\n agent: {\n initialize: schema.AGENT_METHODS.initialize,\n authenticate: schema.AGENT_METHODS.authenticate,\n logout: schema.AGENT_METHODS.logout,\n providers: {\n list: schema.AGENT_METHODS.providers_list,\n set: schema.AGENT_METHODS.providers_set,\n disable: schema.AGENT_METHODS.providers_disable,\n },\n session: {\n new: schema.AGENT_METHODS.session_new,\n load: schema.AGENT_METHODS.session_load,\n list: schema.AGENT_METHODS.session_list,\n delete: schema.AGENT_METHODS.session_delete,\n fork: schema.AGENT_METHODS.session_fork,\n resume: schema.AGENT_METHODS.session_resume,\n close: schema.AGENT_METHODS.session_close,\n setMode: schema.AGENT_METHODS.session_set_mode,\n setConfigOption: schema.AGENT_METHODS.session_set_config_option,\n prompt: schema.AGENT_METHODS.session_prompt,\n cancel: schema.AGENT_METHODS.session_cancel,\n },\n nes: {\n start: schema.AGENT_METHODS.nes_start,\n suggest: schema.AGENT_METHODS.nes_suggest,\n accept: schema.AGENT_METHODS.nes_accept,\n reject: schema.AGENT_METHODS.nes_reject,\n close: schema.AGENT_METHODS.nes_close,\n },\n document: {\n didOpen: schema.AGENT_METHODS.document_did_open,\n didChange: schema.AGENT_METHODS.document_did_change,\n didClose: schema.AGENT_METHODS.document_did_close,\n didSave: schema.AGENT_METHODS.document_did_save,\n didFocus: schema.AGENT_METHODS.document_did_focus,\n },\n },\n client: {\n session: {\n requestPermission: schema.CLIENT_METHODS.session_request_permission,\n update: schema.CLIENT_METHODS.session_update,\n },\n fs: {\n writeTextFile: schema.CLIENT_METHODS.fs_write_text_file,\n readTextFile: schema.CLIENT_METHODS.fs_read_text_file,\n },\n terminal: {\n create: schema.CLIENT_METHODS.terminal_create,\n output: schema.CLIENT_METHODS.terminal_output,\n release: schema.CLIENT_METHODS.terminal_release,\n waitForExit: schema.CLIENT_METHODS.terminal_wait_for_exit,\n kill: schema.CLIENT_METHODS.terminal_kill,\n },\n elicitation: {\n create: schema.CLIENT_METHODS.elicitation_create,\n complete: schema.CLIENT_METHODS.elicitation_complete,\n },\n },\n protocol: {\n cancelRequest: schema.PROTOCOL_METHODS.cancel_request,\n },\n};\nconst startActiveSession = Symbol(\"startActiveSession\");\nclass AcpContext {\n cx;\n currentRequestId;\n /** @internal */\n constructor(cx, currentRequestId) {\n this.cx = cx;\n this.currentRequestId = currentRequestId;\n }\n /**\n * JSON-RPC id of the request currently being handled.\n *\n * This is `undefined` for notification handlers and for contexts created\n * outside an inbound request, such as `connect(...)` and `connectWith(...)`.\n */\n get requestId() {\n return this.currentRequestId;\n }\n /** @internal */\n get connectionContext() {\n return this.cx;\n }\n /** @internal */\n sendRequest(method, params, mapResponse, options) {\n return this.cx.sendRequest(method, params, mapResponse, options);\n }\n /** @internal */\n sendNotification(method, params) {\n return this.cx.sendNotification(method, params);\n }\n /** @internal */\n addDynamicHandler(handler) {\n return this.cx.addDynamicHandler(handler);\n }\n}\n/**\n * Context passed to agent-side handlers.\n *\n * Agents use this context to call client-side ACP methods while handling\n * requests such as `session/prompt`.\n */\nexport class AgentContext extends AcpContext {\n constructor(cx, requestId) {\n super(cx, requestId);\n }\n /** @internal */\n static create(cx, requestId) {\n return new AgentContext(cx, requestId);\n }\n request(method, params, options) {\n const spec = clientRequestSpecsByMethod[method];\n return this.sendRequest(method, params, spec?.mapResponse, options);\n }\n notify(method, params) {\n return this.sendNotification(method, params);\n }\n}\n/**\n * Context used by clients to call agent-side ACP methods.\n *\n * `connectWith` passes a `ClientContext` to the callback. Client handlers also\n * receive one as `ctx.agent` when they need to call back into the agent.\n */\nexport class ClientContext extends AcpContext {\n constructor(cx, requestId) {\n super(cx, requestId);\n }\n /** @internal */\n static create(cx, requestId) {\n return new ClientContext(cx, requestId);\n }\n /** @internal */\n [startActiveSession](params, options) {\n return this.sendRequest(schema.AGENT_METHODS.session_new, params, (response) => this.attachSession(response), options);\n }\n buildSession(cwdOrRequest) {\n if (typeof cwdOrRequest === \"string\") {\n return SessionBuilder.create(this, {\n cwd: cwdOrRequest,\n mcpServers: [],\n });\n }\n return SessionBuilder.create(this, cwdOrRequest);\n }\n /**\n * Builds active-session helpers around a `session/new` response.\n */\n attachSession(response) {\n const updates = new AsyncQueue();\n const closeSignal = this.connectionContext.signal;\n const failUpdatesOnClose = () => {\n updates.fail(closeSignal.reason ?? new Error(\"ACP connection closed\"));\n };\n if (closeSignal.aborted) {\n failUpdatesOnClose();\n }\n else {\n closeSignal.addEventListener(\"abort\", failUpdatesOnClose);\n }\n const sessionRegistration = sessionUpdateRouter(this.connectionContext).attach(response, updates);\n const closeRegistration = new HandlerRegistration(() => {\n closeSignal.removeEventListener(\"abort\", failUpdatesOnClose);\n });\n return ActiveSession.create(this, response, updates, [\n sessionRegistration,\n closeRegistration,\n ]);\n }\n request(method, params, options) {\n const spec = agentRequestSpecsByMethod[method];\n return this.sendRequest(method, params, spec?.mapResponse, options);\n }\n notify(method, params) {\n return this.sendNotification(method, params);\n }\n}\nclass AcpConnectionHandle {\n connection;\n constructor(connection) {\n this.connection = connection;\n }\n get signal() {\n return this.connection.signal;\n }\n get closed() {\n return this.connection.closed;\n }\n close(error) {\n this.connection.close(error);\n }\n}\nclass AgentConnectionHandle extends AcpConnectionHandle {\n connectHandlers;\n client;\n didStartConnectHandlers = false;\n constructor(connection, connectHandlers = []) {\n super(connection);\n this.connectHandlers = connectHandlers;\n this.client = AgentContext.create(connection.getContext());\n }\n /** @internal */\n startConnectHandlers() {\n if (this.didStartConnectHandlers) {\n return;\n }\n this.didStartConnectHandlers = true;\n runConnectHandlers(this, this.connectHandlers);\n }\n}\nclass ClientConnectionHandle extends AcpConnectionHandle {\n connectHandlers;\n agent;\n didStartConnectHandlers = false;\n constructor(connection, connectHandlers = []) {\n super(connection);\n this.connectHandlers = connectHandlers;\n this.agent = ClientContext.create(connection.getContext());\n }\n /** @internal */\n startConnectHandlers() {\n if (this.didStartConnectHandlers) {\n return;\n }\n this.didStartConnectHandlers = true;\n runConnectHandlers(this, this.connectHandlers);\n }\n}\nfunction agentConnection(connection, connectHandlers = []) {\n return new AgentConnectionHandle(connection, connectHandlers);\n}\nfunction clientConnection(connection, connectHandlers = []) {\n return new ClientConnectionHandle(connection, connectHandlers);\n}\nclass AsyncQueue {\n values = [];\n waiters = [];\n failed = false;\n failure;\n enqueue(value) {\n if (this.failed) {\n return;\n }\n const waiter = this.waiters.shift();\n if (waiter) {\n waiter.resolve(value);\n }\n else {\n this.values.push({ kind: \"value\", value });\n }\n }\n reject(error) {\n if (this.failed) {\n return;\n }\n if (this.waiters.length > 0) {\n for (const waiter of this.waiters.splice(0)) {\n waiter.reject(error);\n }\n return;\n }\n this.values.push({ kind: \"error\", error });\n }\n clearErrors() {\n this.values = this.values.filter((entry) => entry.kind === \"value\");\n }\n fail(error) {\n if (this.failed) {\n return;\n }\n this.failed = true;\n this.failure = error;\n for (const waiter of this.waiters.splice(0)) {\n waiter.reject(error);\n }\n }\n next() {\n if (this.values.length > 0) {\n const entry = this.values.shift();\n if (entry.kind === \"error\") {\n return Promise.reject(entry.error);\n }\n return Promise.resolve(entry.value);\n }\n if (this.failed) {\n return Promise.reject(this.failure);\n }\n return new Promise((resolve, reject) => {\n this.waiters.push({ resolve, reject });\n });\n }\n}\nfunction cloneNewSessionRequest(request) {\n return {\n ...request,\n additionalDirectories: request.additionalDirectories\n ? [...request.additionalDirectories]\n : undefined,\n mcpServers: [...request.mcpServers],\n };\n}\n/**\n * Builder for creating an `ActiveSession`.\n *\n * Start from `ctx.buildSession(\"/absolute/cwd\")` for the common case, or\n * pass a full `NewSessionRequest` to `ctx.buildSession(...)` when the session\n * needs MCP servers, `_meta`, or additional request fields. All paths in ACP\n * payloads should be absolute.\n */\nexport class SessionBuilder {\n cx;\n request;\n constructor(cx, request) {\n this.cx = cx;\n this.request = cloneNewSessionRequest(request);\n }\n /** @internal */\n static create(cx, request) {\n return new SessionBuilder(cx, request);\n }\n /**\n * Returns the `session/new` request that will be sent.\n *\n * The returned object is a defensive copy, so mutating it does not change the\n * builder.\n */\n toRequest() {\n return cloneNewSessionRequest(this.request);\n }\n /**\n * Replaces the additional workspace roots for this session.\n *\n * `additionalDirectories` expand the session's file-system scope without\n * changing `cwd`. Each path should be absolute.\n */\n withAdditionalDirectories(additionalDirectories) {\n this.request = {\n ...this.request,\n additionalDirectories: [...additionalDirectories],\n };\n return this;\n }\n /**\n * Adds one MCP server to the `session/new` request.\n */\n withMcpServer(mcpServer) {\n this.request = {\n ...this.request,\n mcpServers: [...this.request.mcpServers, mcpServer],\n };\n return this;\n }\n /**\n * Starts the session and returns an `ActiveSession` for prompting and reading\n * updates.\n *\n * Call `dispose()` on the returned session when you no longer need update\n * routing, or use `withSession(...)` to scope disposal automatically.\n */\n async start(options) {\n return this.cx[startActiveSession](this.toRequest(), options);\n }\n /**\n * Starts the session, runs `op`, and disposes the active-session update\n * routing when `op` finishes or throws.\n */\n async withSession(op) {\n const session = await this.start();\n try {\n return await op(session);\n }\n finally {\n session.dispose();\n }\n }\n}\n/**\n * Convenience wrapper for an active ACP session.\n *\n * An active session routes `session/update` notifications for one session ID\n * into an async queue. Use `prompt(...)` to send user content, then read updates\n * with `nextUpdate()` until a `stop` message is returned.\n */\nexport class ActiveSession {\n cx;\n sessionResponse;\n updates;\n registrations;\n constructor(cx, sessionResponse, updates, registrations) {\n this.cx = cx;\n this.sessionResponse = sessionResponse;\n this.updates = updates;\n this.registrations = registrations;\n }\n /** @internal */\n static create(cx, sessionResponse, updates, registrations) {\n return new ActiveSession(cx, sessionResponse, updates, registrations);\n }\n /**\n * Session ID returned by `session/new`.\n */\n get sessionId() {\n return this.sessionResponse.sessionId;\n }\n /**\n * Mode state returned when the session was created, if the agent provided it.\n */\n get modes() {\n return this.sessionResponse.modes;\n }\n /**\n * Metadata returned when the session was created.\n */\n get meta() {\n return this.sessionResponse._meta;\n }\n /**\n * Full response returned by `session/new`.\n */\n get newSessionResponse() {\n return this.sessionResponse;\n }\n /**\n * Sends a prompt to this session.\n *\n * Strings are converted to one text content block. A single content block is\n * wrapped in an array. The returned promise resolves with the final\n * `PromptResponse`, and the same completion is also queued as a `stop`\n * message for `nextUpdate()`.\n */\n prompt(prompt, options) {\n this.updates.clearErrors();\n const response = this.cx.request(schema.AGENT_METHODS.session_prompt, {\n sessionId: this.sessionId,\n prompt: this.promptBlocks(prompt),\n }, options);\n void response.then((value) => {\n this.updates.enqueue({\n kind: \"stop\",\n response: value,\n stopReason: value.stopReason,\n });\n }, (error) => {\n this.updates.reject(error);\n });\n return response;\n }\n /**\n * Reads the next update or stop message for this session.\n */\n nextUpdate() {\n return this.updates.next();\n }\n /**\n * Reads text chunks until the current prompt turn stops.\n *\n * Only `agent_message_chunk` updates with text content are appended. Other\n * update types are ignored by this helper; use `nextUpdate()` when you need\n * tool calls, plans, or the final `PromptResponse`.\n */\n async readText() {\n let output = \"\";\n for (;;) {\n const message = await this.nextUpdate();\n if (message.kind === \"stop\") {\n return output;\n }\n const { update } = message;\n if (update.sessionUpdate === \"agent_message_chunk\" &&\n update.content.type === \"text\") {\n output += update.content.text;\n }\n }\n }\n /**\n * Stops routing updates to this active-session helper.\n *\n * This does not close the ACP session on the agent. Use `ClientContext`\n * session lifecycle methods when the protocol session itself should be closed\n * or deleted.\n */\n dispose() {\n for (const registration of this.registrations.splice(0)) {\n registration.dispose();\n }\n this.updates.fail(new Error(\"Active session disposed\"));\n }\n /**\n * Supports explicit resource management with `using`.\n */\n [Symbol.dispose]() {\n this.dispose();\n }\n promptBlocks(prompt) {\n if (typeof prompt === \"string\") {\n return [{ type: \"text\", text: prompt }];\n }\n if (Array.isArray(prompt)) {\n return prompt;\n }\n return [prompt];\n }\n}\nfunction parseParams(parser, params) {\n if (!parser) {\n return params;\n }\n if (typeof parser === \"function\") {\n return parser(params);\n }\n return parser.parse(params);\n}\nfunction requestSpec(method, params, mapResponse) {\n return { method, params, mapResponse };\n}\nfunction notificationSpec(method, params) {\n return { method, params };\n}\nfunction registerAppRequest(builder, spec, context, handler) {\n builder.onReceiveRequest(spec.method, (params) => parseParams(spec.params, params), async (params, responder, cx) => {\n const response = await handler(context(params, cx, responder.signal, responder.id));\n await responder.respond((spec.mapResponse\n ? spec.mapResponse(response)\n : response));\n });\n}\nfunction registerAppNotification(builder, spec, context, handler) {\n builder.onReceiveNotification(spec.method, (params) => parseParams(spec.params, params), (params, cx) => handler(context(params, cx, cx.signal)));\n}\nfunction specsByMethod(specs) {\n const byMethod = {};\n for (const spec of Object.values(specs)) {\n byMethod[spec.method] = spec;\n }\n return byMethod;\n}\nconst agentRequestSpecs = {\n initialize: requestSpec(schema.AGENT_METHODS.initialize, validate.zInitializeRequest),\n newSession: requestSpec(schema.AGENT_METHODS.session_new, validate.zNewSessionRequest),\n loadSession: requestSpec(schema.AGENT_METHODS.session_load, validate.zLoadSessionRequest, emptyObjectResponse),\n unstable_forkSession: requestSpec(schema.AGENT_METHODS.session_fork, validate.zForkSessionRequest),\n listSessions: requestSpec(schema.AGENT_METHODS.session_list, validate.zListSessionsRequest),\n deleteSession: requestSpec(schema.AGENT_METHODS.session_delete, validate.zDeleteSessionRequest, emptyObjectResponse),\n resumeSession: requestSpec(schema.AGENT_METHODS.session_resume, validate.zResumeSessionRequest),\n closeSession: requestSpec(schema.AGENT_METHODS.session_close, validate.zCloseSessionRequest, emptyObjectResponse),\n setSessionMode: requestSpec(schema.AGENT_METHODS.session_set_mode, validate.zSetSessionModeRequest, emptyObjectResponse),\n setSessionConfigOption: requestSpec(schema.AGENT_METHODS.session_set_config_option, validate.zSetSessionConfigOptionRequest),\n authenticate: requestSpec(schema.AGENT_METHODS.authenticate, validate.zAuthenticateRequest, emptyObjectResponse),\n unstable_listProviders: requestSpec(schema.AGENT_METHODS.providers_list, validate.zListProvidersRequest),\n unstable_setProvider: requestSpec(schema.AGENT_METHODS.providers_set, validate.zSetProviderRequest, emptyObjectResponse),\n unstable_disableProvider: requestSpec(schema.AGENT_METHODS.providers_disable, validate.zDisableProviderRequest, emptyObjectResponse),\n logout: requestSpec(schema.AGENT_METHODS.logout, validate.zLogoutRequest, emptyObjectResponse),\n prompt: requestSpec(schema.AGENT_METHODS.session_prompt, validate.zPromptRequest),\n unstable_startNes: requestSpec(schema.AGENT_METHODS.nes_start, validate.zStartNesRequest),\n unstable_suggestNes: requestSpec(schema.AGENT_METHODS.nes_suggest, validate.zSuggestNesRequest),\n unstable_closeNes: requestSpec(schema.AGENT_METHODS.nes_close, validate.zCloseNesRequest, emptyObjectResponse),\n};\nconst agentNotificationSpecs = {\n cancel: notificationSpec(schema.AGENT_METHODS.session_cancel, validate.zCancelNotification),\n unstable_didOpenDocument: notificationSpec(schema.AGENT_METHODS.document_did_open, validate.zDidOpenDocumentNotification),\n unstable_didChangeDocument: notificationSpec(schema.AGENT_METHODS.document_did_change, validate.zDidChangeDocumentNotification),\n unstable_didCloseDocument: notificationSpec(schema.AGENT_METHODS.document_did_close, validate.zDidCloseDocumentNotification),\n unstable_didSaveDocument: notificationSpec(schema.AGENT_METHODS.document_did_save, validate.zDidSaveDocumentNotification),\n unstable_didFocusDocument: notificationSpec(schema.AGENT_METHODS.document_did_focus, validate.zDidFocusDocumentNotification),\n unstable_acceptNes: notificationSpec(schema.AGENT_METHODS.nes_accept, validate.zAcceptNesNotification),\n unstable_rejectNes: notificationSpec(schema.AGENT_METHODS.nes_reject, validate.zRejectNesNotification),\n};\nconst clientRequestSpecs = {\n requestPermission: requestSpec(schema.CLIENT_METHODS.session_request_permission, validate.zRequestPermissionRequest),\n writeTextFile: requestSpec(schema.CLIENT_METHODS.fs_write_text_file, validate.zWriteTextFileRequest, emptyObjectResponse),\n readTextFile: requestSpec(schema.CLIENT_METHODS.fs_read_text_file, validate.zReadTextFileRequest),\n createTerminal: requestSpec(schema.CLIENT_METHODS.terminal_create, validate.zCreateTerminalRequest),\n terminalOutput: requestSpec(schema.CLIENT_METHODS.terminal_output, validate.zTerminalOutputRequest),\n releaseTerminal: requestSpec(schema.CLIENT_METHODS.terminal_release, validate.zReleaseTerminalRequest, emptyObjectResponse),\n waitForTerminalExit: requestSpec(schema.CLIENT_METHODS.terminal_wait_for_exit, validate.zWaitForTerminalExitRequest),\n killTerminal: requestSpec(schema.CLIENT_METHODS.terminal_kill, validate.zKillTerminalRequest, emptyObjectResponse),\n unstable_createElicitation: requestSpec(schema.CLIENT_METHODS.elicitation_create, validate.zCreateElicitationRequest),\n};\nconst clientNotificationSpecs = {\n sessionUpdate: notificationSpec(schema.CLIENT_METHODS.session_update, validate.zSessionNotification),\n unstable_completeElicitation: notificationSpec(schema.CLIENT_METHODS.elicitation_complete, validate.zCompleteElicitationNotification),\n};\nconst agentRequestSpecsByMethod = specsByMethod(agentRequestSpecs);\nconst agentNotificationSpecsByMethod = specsByMethod(agentNotificationSpecs);\nconst clientRequestSpecsByMethod = specsByMethod(clientRequestSpecs);\nconst clientNotificationSpecsByMethod = specsByMethod(clientNotificationSpecs);\nfunction agentRequestContext(params, client, signal, requestId) {\n return {\n params,\n requestId,\n signal,\n client,\n };\n}\nfunction agentNotificationContext(params, client, signal) {\n return {\n params,\n signal,\n client,\n };\n}\nfunction clientRequestContext(params, agent, signal, requestId) {\n return {\n params,\n requestId,\n signal,\n agent,\n };\n}\nfunction clientNotificationContext(params, agent, signal) {\n return {\n params,\n signal,\n agent,\n };\n}\nclass SessionUpdateRouter {\n activeSessions = new Map();\n handleMessage(message) {\n if (message.kind !== \"notification\" ||\n message.method !== schema.CLIENT_METHODS.session_update) {\n return Handled.no(message);\n }\n const notification = validate.zSessionNotification.parse(message.params);\n const update = {\n kind: \"session_update\",\n notification,\n update: notification.update,\n };\n const activeSessions = this.activeSessions.get(notification.sessionId);\n if (activeSessions && activeSessions.size > 0) {\n for (const session of activeSessions) {\n session.enqueue(update);\n }\n }\n return Handled.no(message);\n }\n attach(response, updates) {\n const sessions = this.activeSessions.get(response.sessionId) ??\n new Set();\n sessions.add(updates);\n this.activeSessions.set(response.sessionId, sessions);\n return new HandlerRegistration(() => {\n sessions.delete(updates);\n if (sessions.size === 0) {\n this.activeSessions.delete(response.sessionId);\n }\n });\n }\n}\nconst sessionUpdateRouters = new WeakMap();\nfunction sessionUpdateRouter(cx) {\n let router = sessionUpdateRouters.get(cx);\n if (!router) {\n router = new SessionUpdateRouter();\n sessionUpdateRouters.set(cx, router);\n }\n return router;\n}\nfunction runConnectHandlers(connection, handlers) {\n for (const handler of handlers) {\n let result;\n try {\n result = handler(connection);\n }\n catch (error) {\n connection.close(error);\n throw error;\n }\n void Promise.resolve(result).catch((error) => {\n connection.close(error);\n });\n }\n}\nconst appBuilder = Symbol(\"appBuilder\");\nconst runAgentConnectHandlers = Symbol(\"runAgentConnectHandlers\");\nconst runClientConnectHandlers = Symbol(\"runClientConnectHandlers\");\n/**\n * Creates an agent-side app.\n *\n * Register request and notification handlers by ACP method name, then call\n * `connect(stream)` to serve an ACP client.\n */\nexport function agent(options) {\n return new AgentApp(options);\n}\n/**\n * Agent-side app builder.\n *\n * Methods on this class register typed request or notification handlers and\n * return `this`, so apps can be built with a fluent chain. Handler params are\n * parsed with the generated ACP schemas before your handler runs, and thrown\n * errors are converted to JSON-RPC errors by the connection layer.\n */\nexport class AgentApp {\n builder = Connection.builder();\n connectHandlers = [];\n constructor(options = {}) {\n if (options.name) {\n this.builder.name(options.name);\n }\n }\n /** @internal */\n [appBuilder]() {\n return this.builder;\n }\n /** @internal */\n [runAgentConnectHandlers](connection) {\n runConnectHandlers(connection, this.connectHandlers);\n }\n connect(target, options = {}) {\n return this.connectConnection(target, options).connection;\n }\n connectWith(target, op) {\n const { rawConnection, connection } = this.connectConnection(target);\n return rawConnection.runUntil(() => op(connection.client));\n }\n /**\n * Registers a handler that runs when this agent app opens a connection.\n *\n * Use this for connection-scoped work that needs to call client-side ACP\n * methods outside an inbound request handler.\n */\n onConnect(handler) {\n this.connectHandlers.push(handler);\n return this;\n }\n onRequest(method, handlerOrParams, handler) {\n if (handler) {\n return this.request({ method, params: handlerOrParams }, handler);\n }\n const spec = agentRequestSpecsByMethod[method];\n if (!spec) {\n throw new Error(`Unknown ACP request method '${method}'. Pass a params parser for custom methods.`);\n }\n return this.request(spec, handlerOrParams);\n }\n onNotification(method, handlerOrParams, handler) {\n if (handler) {\n return this.notification({ method, params: handlerOrParams }, handler);\n }\n const spec = agentNotificationSpecsByMethod[method];\n if (!spec) {\n throw new Error(`Unknown ACP notification method '${method}'. Pass a params parser for custom methods.`);\n }\n return this.notification(spec, handlerOrParams);\n }\n request(spec, handler) {\n registerAppRequest(this.builder, spec, (params, cx, signal, requestId) => agentRequestContext(params, AgentContext.create(cx, requestId), signal, requestId), handler);\n return this;\n }\n notification(spec, handler) {\n registerAppNotification(this.builder, spec, (params, cx, signal) => agentNotificationContext(params, AgentContext.create(cx), signal), handler);\n return this;\n }\n connectConnection(target, options = {}) {\n if (isStream(target)) {\n const state = this.openStreamConnection(target);\n if (!options.deferConnectHandlers) {\n this[runAgentConnectHandlers](state.connection);\n }\n return state;\n }\n const [thisStream, peerStream] = memoryStreamPair();\n const peerRawConnection = target[appBuilder]().connect(peerStream);\n const peerConnection = clientConnection(peerRawConnection);\n const state = this.openStreamConnection(thisStream);\n void state.rawConnection.closed.then(() => peerConnection.close());\n void peerRawConnection.closed.then(() => state.connection.close());\n try {\n target[runClientConnectHandlers](peerConnection);\n this[runAgentConnectHandlers](state.connection);\n }\n catch (error) {\n peerConnection.close(error);\n state.connection.close(error);\n throw error;\n }\n return state;\n }\n openStreamConnection(stream) {\n const rawConnection = this.builder.connect(stream);\n return {\n rawConnection,\n connection: agentConnection(rawConnection, this.connectHandlers),\n };\n }\n}\n/**\n * Creates a client-side app.\n *\n * Register request and notification handlers by ACP method name, then use\n * `connectWith(...)` to run the workflow that calls agent-side methods.\n */\nexport function client(options) {\n return new ClientApp(options);\n}\n/**\n * Client-side app builder.\n *\n * Methods on this class register typed client handlers and return `this`, so\n * apps can be built with a fluent chain. `connectWith(...)` is the usual entry\n * point for clients because it provides a `ClientContext` for calling\n * agent-side requests and session helpers.\n */\nexport class ClientApp {\n builder = Connection.builder();\n connectHandlers = [];\n constructor(options = {}) {\n if (options.name) {\n this.builder.name(options.name);\n }\n this.builder.withHandler({\n handleMessage: (message, cx) => sessionUpdateRouter(cx).handleMessage(message),\n describe: () => \"client-session-update-router\",\n });\n }\n /** @internal */\n [appBuilder]() {\n return this.builder;\n }\n /** @internal */\n [runClientConnectHandlers](connection) {\n runConnectHandlers(connection, this.connectHandlers);\n }\n connect(target) {\n return this.connectConnection(target).connection;\n }\n connectWith(target, op) {\n const { rawConnection, connection } = this.connectConnection(target);\n return rawConnection.runUntil(() => op(connection.agent));\n }\n /**\n * Registers a handler that runs when this client app opens a connection.\n *\n * Use this for connection-scoped work that needs to call agent-side ACP\n * methods outside an inbound request handler.\n */\n onConnect(handler) {\n this.connectHandlers.push(handler);\n return this;\n }\n onRequest(method, handlerOrParams, handler) {\n if (handler) {\n return this.request({ method, params: handlerOrParams }, handler);\n }\n const spec = clientRequestSpecsByMethod[method];\n if (!spec) {\n throw new Error(`Unknown ACP request method '${method}'. Pass a params parser for custom methods.`);\n }\n return this.request(spec, handlerOrParams);\n }\n onNotification(method, handlerOrParams, handler) {\n if (handler) {\n return this.notification({ method, params: handlerOrParams }, handler);\n }\n const spec = clientNotificationSpecsByMethod[method];\n if (!spec) {\n throw new Error(`Unknown ACP notification method '${method}'. Pass a params parser for custom methods.`);\n }\n return this.notification(spec, handlerOrParams);\n }\n request(spec, handler) {\n registerAppRequest(this.builder, spec, (params, cx, signal, requestId) => clientRequestContext(params, ClientContext.create(cx, requestId), signal, requestId), handler);\n return this;\n }\n notification(spec, handler) {\n registerAppNotification(this.builder, spec, (params, cx, signal) => clientNotificationContext(params, ClientContext.create(cx), signal), handler);\n return this;\n }\n connectConnection(target) {\n if (isStream(target)) {\n const state = this.openStreamConnection(target);\n this[runClientConnectHandlers](state.connection);\n return state;\n }\n const [thisStream, peerStream] = memoryStreamPair();\n const peerRawConnection = target[appBuilder]().connect(peerStream);\n const peerConnection = agentConnection(peerRawConnection);\n const state = this.openStreamConnection(thisStream);\n void state.rawConnection.closed.then(() => peerConnection.close());\n void peerRawConnection.closed.then(() => state.connection.close());\n try {\n target[runAgentConnectHandlers](peerConnection);\n this[runClientConnectHandlers](state.connection);\n }\n catch (error) {\n peerConnection.close(error);\n state.connection.close(error);\n throw error;\n }\n return state;\n }\n openStreamConnection(stream) {\n const rawConnection = this.builder.connect(stream);\n return {\n rawConnection,\n connection: clientConnection(rawConnection, this.connectHandlers),\n };\n }\n}\nconst legacyAgentRequestMethods = new Set([\n schema.AGENT_METHODS.initialize,\n schema.AGENT_METHODS.authenticate,\n schema.AGENT_METHODS.providers_list,\n schema.AGENT_METHODS.providers_set,\n schema.AGENT_METHODS.providers_disable,\n schema.AGENT_METHODS.session_new,\n schema.AGENT_METHODS.session_load,\n schema.AGENT_METHODS.session_set_mode,\n schema.AGENT_METHODS.session_set_config_option,\n schema.AGENT_METHODS.session_prompt,\n schema.AGENT_METHODS.session_list,\n schema.AGENT_METHODS.session_delete,\n schema.AGENT_METHODS.session_fork,\n schema.AGENT_METHODS.session_resume,\n schema.AGENT_METHODS.session_close,\n schema.AGENT_METHODS.logout,\n schema.AGENT_METHODS.nes_start,\n schema.AGENT_METHODS.nes_suggest,\n schema.AGENT_METHODS.nes_close,\n]);\nconst legacyAgentNotificationMethods = new Set([\n schema.AGENT_METHODS.session_cancel,\n schema.AGENT_METHODS.nes_accept,\n schema.AGENT_METHODS.nes_reject,\n schema.AGENT_METHODS.document_did_open,\n schema.AGENT_METHODS.document_did_change,\n schema.AGENT_METHODS.document_did_close,\n schema.AGENT_METHODS.document_did_save,\n schema.AGENT_METHODS.document_did_focus,\n]);\nconst legacyClientRequestMethods = new Set([\n schema.CLIENT_METHODS.session_request_permission,\n schema.CLIENT_METHODS.fs_write_text_file,\n schema.CLIENT_METHODS.fs_read_text_file,\n schema.CLIENT_METHODS.terminal_create,\n schema.CLIENT_METHODS.terminal_output,\n schema.CLIENT_METHODS.terminal_release,\n schema.CLIENT_METHODS.terminal_wait_for_exit,\n schema.CLIENT_METHODS.terminal_kill,\n schema.CLIENT_METHODS.elicitation_create,\n]);\nconst legacyClientNotificationMethods = new Set([\n schema.CLIENT_METHODS.session_update,\n schema.CLIENT_METHODS.elicitation_complete,\n]);\nfunction legacyAgentApp(implementation) {\n const app = agent()\n .onRequest(schema.AGENT_METHODS.initialize, (ctx) => implementation.initialize(ctx.params))\n .onRequest(schema.AGENT_METHODS.session_new, (ctx) => implementation.newSession(ctx.params))\n .onRequest(schema.AGENT_METHODS.authenticate, async (ctx) => (await implementation.authenticate(ctx.params)) ?? {})\n .onRequest(schema.AGENT_METHODS.session_prompt, (ctx) => implementation.prompt(ctx.params))\n .onNotification(schema.AGENT_METHODS.session_cancel, (ctx) => implementation.cancel(ctx.params));\n if (implementation.loadSession) {\n app.onRequest(schema.AGENT_METHODS.session_load, (ctx) => implementation.loadSession(ctx.params));\n }\n if (implementation.listSessions) {\n app.onRequest(schema.AGENT_METHODS.session_list, (ctx) => implementation.listSessions(ctx.params));\n }\n if (implementation.deleteSession) {\n app.onRequest(schema.AGENT_METHODS.session_delete, async (ctx) => (await implementation.deleteSession(ctx.params)) ?? {});\n }\n if (implementation.unstable_forkSession) {\n app.onRequest(schema.AGENT_METHODS.session_fork, (ctx) => implementation.unstable_forkSession(ctx.params));\n }\n if (implementation.resumeSession) {\n app.onRequest(schema.AGENT_METHODS.session_resume, (ctx) => implementation.resumeSession(ctx.params));\n }\n if (implementation.closeSession) {\n app.onRequest(schema.AGENT_METHODS.session_close, async (ctx) => (await implementation.closeSession(ctx.params)) ?? {});\n }\n if (implementation.setSessionMode) {\n app.onRequest(schema.AGENT_METHODS.session_set_mode, async (ctx) => (await implementation.setSessionMode(ctx.params)) ?? {});\n }\n if (implementation.setSessionConfigOption) {\n app.onRequest(schema.AGENT_METHODS.session_set_config_option, (ctx) => implementation.setSessionConfigOption(ctx.params));\n }\n if (implementation.unstable_listProviders) {\n app.onRequest(schema.AGENT_METHODS.providers_list, (ctx) => implementation.unstable_listProviders(ctx.params));\n }\n if (implementation.unstable_setProvider) {\n app.onRequest(schema.AGENT_METHODS.providers_set, async (ctx) => (await implementation.unstable_setProvider(ctx.params)) ?? {});\n }\n if (implementation.unstable_disableProvider) {\n app.onRequest(schema.AGENT_METHODS.providers_disable, async (ctx) => (await implementation.unstable_disableProvider(ctx.params)) ?? {});\n }\n if (implementation.logout) {\n app.onRequest(schema.AGENT_METHODS.logout, async (ctx) => (await implementation.logout(ctx.params)) ?? {});\n }\n if (implementation.unstable_startNes) {\n app.onRequest(schema.AGENT_METHODS.nes_start, (ctx) => implementation.unstable_startNes(ctx.params));\n }\n if (implementation.unstable_suggestNes) {\n app.onRequest(schema.AGENT_METHODS.nes_suggest, (ctx) => implementation.unstable_suggestNes(ctx.params));\n }\n if (implementation.unstable_closeNes) {\n app.onRequest(schema.AGENT_METHODS.nes_close, async (ctx) => (await implementation.unstable_closeNes(ctx.params)) ?? {});\n }\n if (implementation.unstable_didOpenDocument) {\n app.onNotification(schema.AGENT_METHODS.document_did_open, (ctx) => implementation.unstable_didOpenDocument(ctx.params));\n }\n if (implementation.unstable_didChangeDocument) {\n app.onNotification(schema.AGENT_METHODS.document_did_change, (ctx) => implementation.unstable_didChangeDocument(ctx.params));\n }\n if (implementation.unstable_didCloseDocument) {\n app.onNotification(schema.AGENT_METHODS.document_did_close, (ctx) => implementation.unstable_didCloseDocument(ctx.params));\n }\n if (implementation.unstable_didSaveDocument) {\n app.onNotification(schema.AGENT_METHODS.document_did_save, (ctx) => implementation.unstable_didSaveDocument(ctx.params));\n }\n if (implementation.unstable_didFocusDocument) {\n app.onNotification(schema.AGENT_METHODS.document_did_focus, (ctx) => implementation.unstable_didFocusDocument(ctx.params));\n }\n if (implementation.unstable_acceptNes) {\n app.onNotification(schema.AGENT_METHODS.nes_accept, (ctx) => implementation.unstable_acceptNes(ctx.params));\n }\n if (implementation.unstable_rejectNes) {\n app.onNotification(schema.AGENT_METHODS.nes_reject, (ctx) => implementation.unstable_rejectNes(ctx.params));\n }\n if (implementation.extMethod) {\n app[appBuilder]().withHandler({\n handleMessage: async (message) => {\n if (message.kind !== \"request\" ||\n legacyAgentRequestMethods.has(message.method)) {\n return Handled.no(message);\n }\n await message.responder.respond(await implementation.extMethod(message.method, message.params));\n return Handled.yes();\n },\n describe: () => \"legacy-agent-extension-request\",\n });\n }\n if (implementation.extNotification) {\n app[appBuilder]().withHandler({\n handleMessage: async (message) => {\n if (message.kind !== \"notification\" ||\n legacyAgentNotificationMethods.has(message.method)) {\n return Handled.no(message);\n }\n await implementation.extNotification(message.method, message.params);\n return Handled.yes();\n },\n describe: () => \"legacy-agent-extension-notification\",\n });\n }\n return app;\n}\nfunction legacyClientApp(implementation) {\n const app = client()\n .onRequest(schema.CLIENT_METHODS.session_request_permission, (ctx) => implementation.requestPermission(ctx.params))\n .onNotification(schema.CLIENT_METHODS.session_update, (ctx) => implementation.sessionUpdate(ctx.params))\n .onRequest(schema.CLIENT_METHODS.fs_write_text_file, async (ctx) => (await implementation.writeTextFile?.(ctx.params)) ?? {})\n .onRequest(schema.CLIENT_METHODS.fs_read_text_file, async (ctx) => (await implementation.readTextFile?.(ctx.params)))\n .onRequest(schema.CLIENT_METHODS.terminal_create, async (ctx) => (await implementation.createTerminal?.(ctx.params)))\n .onRequest(schema.CLIENT_METHODS.terminal_output, async (ctx) => (await implementation.terminalOutput?.(ctx.params)))\n .onRequest(schema.CLIENT_METHODS.terminal_release, async (ctx) => (await implementation.releaseTerminal?.(ctx.params)) ?? {})\n .onRequest(schema.CLIENT_METHODS.terminal_wait_for_exit, async (ctx) => (await implementation.waitForTerminalExit?.(ctx.params)))\n .onRequest(schema.CLIENT_METHODS.terminal_kill, async (ctx) => (await implementation.killTerminal?.(ctx.params)) ?? {});\n if (implementation.unstable_createElicitation) {\n app.onRequest(schema.CLIENT_METHODS.elicitation_create, (ctx) => implementation.unstable_createElicitation(ctx.params));\n }\n if (implementation.unstable_completeElicitation) {\n app.onNotification(schema.CLIENT_METHODS.elicitation_complete, (ctx) => implementation.unstable_completeElicitation(ctx.params));\n }\n if (implementation.extMethod) {\n app[appBuilder]().withHandler({\n handleMessage: async (message) => {\n if (message.kind !== \"request\" ||\n legacyClientRequestMethods.has(message.method)) {\n return Handled.no(message);\n }\n await message.responder.respond(await implementation.extMethod(message.method, message.params));\n return Handled.yes();\n },\n describe: () => \"legacy-client-extension-request\",\n });\n }\n if (implementation.extNotification) {\n app[appBuilder]().withHandler({\n handleMessage: async (message) => {\n if (message.kind !== \"notification\" ||\n legacyClientNotificationMethods.has(message.method)) {\n return Handled.no(message);\n }\n await implementation.extNotification(message.method, message.params);\n return Handled.yes();\n },\n describe: () => \"legacy-client-extension-notification\",\n });\n }\n return app;\n}\n/**\n * An agent-side connection to a client.\n *\n * This class provides the agent's view of an ACP connection, allowing\n * agents to communicate with clients. It implements the {@link Client} interface\n * to provide methods for requesting permissions, accessing the file system,\n * and sending session updates.\n *\n * See protocol docs: [Agent](https://agentclientprotocol.com/protocol/overview#agent)\n *\n * @deprecated Prefer {@link agent}, which registers typed handlers with a\n * single context object and supports direct app composition.\n */\nexport class AgentSideConnection {\n connection;\n /**\n * Creates a new agent-side connection to a client.\n *\n * This establishes the communication channel from the agent's perspective\n * following the ACP specification.\n *\n * @param toAgent - A function that creates an Agent handler to process incoming client requests\n * @param stream - The bidirectional message stream for communication. Typically created using\n * {@link ndJsonStream} for stdio-based connections.\n *\n * See protocol docs: [Communication Model](https://agentclientprotocol.com/protocol/overview#communication-model)\n *\n * @deprecated Prefer `agent({ name }).connect(stream)`.\n */\n constructor(toAgent, stream) {\n this.connection = legacyAgentApp(toAgent(this))[appBuilder]()\n .connect(stream);\n }\n /**\n * Handles session update notifications from the agent.\n *\n * This is a notification endpoint (no response expected) that sends\n * real-time updates about session progress, including message chunks,\n * tool calls, and execution plans.\n *\n * Note: Clients SHOULD continue accepting tool call updates even after\n * sending a `session/cancel` notification, as the agent may send final\n * updates before responding with the cancelled stop reason.\n *\n * See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)\n */\n sessionUpdate(params) {\n return this.connection.sendNotification(schema.CLIENT_METHODS.session_update, params);\n }\n /**\n * Requests permission from the user for a tool call operation.\n *\n * Called by the agent when it needs user authorization before executing\n * a potentially sensitive operation. The client should present the options\n * to the user and return their decision.\n *\n * If the client cancels the prompt turn via `session/cancel`, it MUST\n * respond to this request with `RequestPermissionOutcome::Cancelled`.\n *\n * See protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)\n */\n requestPermission(params) {\n return this.connection.sendRequest(schema.CLIENT_METHODS.session_request_permission, params);\n }\n /**\n * Reads content from a text file in the client's file system.\n *\n * Only available if the client advertises the `fs.readTextFile` capability.\n * Allows the agent to access file contents within the client's environment.\n *\n * See protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)\n */\n readTextFile(params) {\n return this.connection.sendRequest(schema.CLIENT_METHODS.fs_read_text_file, params);\n }\n /**\n * Writes content to a text file in the client's file system.\n *\n * Only available if the client advertises the `fs.writeTextFile` capability.\n * Allows the agent to create or modify files within the client's environment.\n *\n * See protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)\n */\n writeTextFile(params) {\n return this.connection.sendRequest(schema.CLIENT_METHODS.fs_write_text_file, params, emptyObjectResponse);\n }\n /**\n * Executes a command in a new terminal.\n *\n * Returns a `TerminalHandle` that can be used to get output, wait for exit,\n * kill the command, or release the terminal.\n *\n * The terminal can also be embedded in tool calls by using its ID in\n * `ToolCallContent` with type \"terminal\".\n *\n * @param params - The terminal creation parameters\n * @returns A handle to control and monitor the terminal\n */\n createTerminal(params) {\n return this.connection.sendRequest(schema.CLIENT_METHODS.terminal_create, params, (response) => TerminalHandle.create(response.terminalId, params.sessionId, this.connection));\n }\n /**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Creates an elicitation to request input from the user.\n *\n * @experimental\n */\n unstable_createElicitation(params) {\n return this.connection.sendRequest(schema.CLIENT_METHODS.elicitation_create, params);\n }\n /**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Notifies the client that a URL-based elicitation is complete.\n *\n * @experimental\n */\n unstable_completeElicitation(params) {\n return this.connection.sendNotification(schema.CLIENT_METHODS.elicitation_complete, params);\n }\n request(method, params, options) {\n const spec = clientRequestSpecsByMethod[method];\n return this.connection.sendRequest(method, params, spec?.mapResponse, options);\n }\n notify(method, params) {\n return this.connection.sendNotification(method, params);\n }\n /**\n * Extension method.\n *\n * @deprecated Use {@link request}.\n */\n extMethod(method, params) {\n return this.request(method, params);\n }\n /**\n * Extension notification.\n *\n * @deprecated Use {@link notify}.\n */\n extNotification(method, params) {\n return this.notify(method, params);\n }\n /**\n * AbortSignal that aborts when the connection closes.\n *\n * This signal can be used to:\n * - Listen for connection closure: `connection.signal.addEventListener('abort', () => {...})`\n * - Check connection status synchronously: `if (connection.signal.aborted) {...}`\n * - Pass to other APIs (fetch, setTimeout) for automatic cancellation\n *\n * The connection closes when the underlying stream ends, either normally or due to an error.\n *\n * @example\n * ```typescript\n * const connection = new AgentSideConnection(agent, stream);\n *\n * // Listen for closure\n * connection.signal.addEventListener('abort', () => {\n * console.log('Connection closed - performing cleanup');\n * });\n *\n * // Check status\n * if (connection.signal.aborted) {\n * console.log('Connection is already closed');\n * }\n *\n * // Pass to other APIs\n * fetch(url, { signal: connection.signal });\n * ```\n */\n get signal() {\n return this.connection.signal;\n }\n /**\n * Promise that resolves when the connection closes.\n *\n * The connection closes when the underlying stream ends, either normally or due to an error.\n * Once closed, the connection cannot send or receive any more messages.\n *\n * This is useful for async/await style cleanup:\n *\n * @example\n * ```typescript\n * const connection = new AgentSideConnection(agent, stream);\n * await connection.closed;\n * console.log('Connection closed - performing cleanup');\n * ```\n */\n get closed() {\n return this.connection.closed;\n }\n}\n/**\n * Handle for controlling and monitoring a terminal created via `createTerminal`.\n *\n * Provides methods to:\n * - Get current output without waiting\n * - Wait for command completion\n * - Kill the running command\n * - Release terminal resources\n *\n * **Important:** Always call `release()` when done with the terminal to free resources.\n\n * The terminal supports async disposal via `Symbol.asyncDispose` for automatic cleanup.\n\n * You can use `await using` to ensure the terminal is automatically released when it\n * goes out of scope.\n */\nexport class TerminalHandle {\n /**\n * Terminal identifier returned by `terminal/create`.\n */\n id;\n sessionId;\n connection;\n constructor(id, sessionId, conn) {\n this.id = id;\n this.sessionId = sessionId;\n this.connection = conn;\n }\n /** @internal */\n static create(id, sessionId, conn) {\n return new TerminalHandle(id, sessionId, conn);\n }\n /**\n * Gets the current terminal output without waiting for the command to exit.\n */\n currentOutput() {\n return this.connection.sendRequest(schema.CLIENT_METHODS.terminal_output, {\n sessionId: this.sessionId,\n terminalId: this.id,\n });\n }\n /**\n * Waits for the terminal command to complete and returns its exit status.\n */\n waitForExit() {\n return this.connection.sendRequest(schema.CLIENT_METHODS.terminal_wait_for_exit, {\n sessionId: this.sessionId,\n terminalId: this.id,\n });\n }\n /**\n * Kills the terminal command without releasing the terminal.\n *\n * The terminal remains valid after killing, allowing you to:\n * - Get the final output with `currentOutput()`\n * - Check the exit status\n * - Release the terminal when done\n *\n * Useful for implementing timeouts or cancellation.\n */\n kill() {\n return this.connection.sendRequest(schema.CLIENT_METHODS.terminal_kill, {\n sessionId: this.sessionId,\n terminalId: this.id,\n }, emptyObjectResponse);\n }\n /**\n * Releases the terminal and frees all associated resources.\n *\n * If the command is still running, it will be killed.\n * After release, the terminal ID becomes invalid and cannot be used\n * with other terminal methods.\n *\n * Tool calls that already reference this terminal will continue to\n * display its output.\n *\n * **Important:** Always call this method when done with the terminal.\n */\n release() {\n return this.connection.sendRequest(schema.CLIENT_METHODS.terminal_release, {\n sessionId: this.sessionId,\n terminalId: this.id,\n }, emptyObjectResponse);\n }\n /**\n * Releases the terminal when used with `await using`.\n */\n async [Symbol.asyncDispose]() {\n await this.release();\n }\n}\n/**\n * A client-side connection to an agent.\n *\n * This class provides the client's view of an ACP connection, allowing\n * clients (such as code editors) to communicate with agents. It implements\n * the {@link Agent} interface to provide methods for initializing sessions, sending\n * prompts, and managing the agent lifecycle.\n *\n * See protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)\n *\n * @deprecated Prefer {@link client}, which registers typed handlers with a\n * single context object and supports `connectWith` and session helpers.\n */\nexport class ClientSideConnection {\n connection;\n /**\n * Creates a new client-side connection to an agent.\n *\n * This establishes the communication channel between a client and agent\n * following the ACP specification.\n *\n * @param toClient - A function that creates a Client handler to process incoming agent requests\n * @param stream - The bidirectional message stream for communication. Typically created using\n * {@link ndJsonStream} for stdio-based connections.\n *\n * See protocol docs: [Communication Model](https://agentclientprotocol.com/protocol/overview#communication-model)\n *\n * @deprecated Prefer `client({ name }).connectWith(stream, async (ctx) => ...)`.\n */\n constructor(toClient, stream) {\n this.connection = legacyClientApp(toClient(this))[appBuilder]()\n .connect(stream);\n }\n /**\n * Establishes the connection with a client and negotiates protocol capabilities.\n *\n * This method is called once at the beginning of the connection to:\n * - Negotiate the protocol version to use\n * - Exchange capability information between client and agent\n * - Determine available authentication methods\n *\n * The agent should respond with its supported protocol version and capabilities.\n *\n * See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)\n */\n initialize(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.initialize, params);\n }\n /**\n * Creates a new conversation session with the agent.\n *\n * Sessions represent independent conversation contexts with their own history and state.\n *\n * The agent should:\n * - Create a new session context\n * - Connect to any specified MCP servers\n * - Return a unique session ID for future requests\n *\n * The request may include `additionalDirectories` to expand the session's filesystem\n * scope beyond `cwd` without changing the base for relative paths.\n *\n * May return an `auth_required` error if the agent requires authentication.\n *\n * See protocol docs: [Session Setup](https://agentclientprotocol.com/protocol/session-setup)\n */\n newSession(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.session_new, params);\n }\n /**\n * Loads an existing session to resume a previous conversation.\n *\n * This method is only available if the agent advertises the `loadSession` capability.\n *\n * The agent should:\n * - Restore the session context and conversation history\n * - Connect to the specified MCP servers\n * - Stream the entire conversation history back to the client via notifications\n *\n * The request may include `additionalDirectories` to set the complete list of\n * additional workspace roots for the loaded session.\n *\n * See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)\n */\n loadSession(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.session_load, params, emptyObjectResponse);\n }\n /**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Forks an existing session to create a new independent session.\n *\n * Creates a new session based on the context of an existing one, allowing\n * operations like generating summaries without affecting the original session's history.\n *\n * The request may include `additionalDirectories` to set the complete list of\n * additional workspace roots for the forked session.\n *\n * This method is only available if the agent advertises the `session.fork` capability.\n *\n * @experimental\n */\n unstable_forkSession(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.session_fork, params);\n }\n /**\n * Lists existing sessions from the agent.\n *\n * This method is only available if the agent advertises the `listSessions` capability.\n *\n * Returns a list of sessions with metadata like session ID, working directory,\n * title, and last update time. Supports filtering by working directory,\n * `additionalDirectories`, and cursor-based pagination.\n */\n listSessions(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.session_list, params);\n }\n /**\n * Deletes an existing session returned by `session/list`.\n *\n * This method is only available if the agent advertises the `sessionCapabilities.delete` capability.\n */\n deleteSession(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.session_delete, params, emptyObjectResponse);\n }\n /**\n * Resumes an existing session without returning previous messages.\n *\n * This method is only available if the agent advertises the `session.resume` capability.\n *\n * The agent should resume the session context, allowing the conversation to continue\n * without replaying the message history (unlike `session/load`).\n *\n * The request may include `additionalDirectories` to set the complete list of\n * additional workspace roots for the resumed session.\n */\n resumeSession(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.session_resume, params);\n }\n /**\n * Closes an active session and frees up any resources associated with it.\n *\n * This method is only available if the agent advertises the `session.close` capability.\n *\n * The agent must cancel any ongoing work (as if `session/cancel` was called)\n * and then free up any resources associated with the session.\n */\n closeSession(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.session_close, params, emptyObjectResponse);\n }\n /**\n * Sets the operational mode for a session.\n *\n * Allows switching between different agent modes (e.g., \"ask\", \"architect\", \"code\")\n * that affect system prompts, tool availability, and permission behaviors.\n *\n * The mode must be one of the modes advertised in `availableModes` during session\n * creation or loading. Agents may also change modes autonomously and notify the\n * client via `current_mode_update` notifications.\n *\n * This method can be called at any time during a session, whether the Agent is\n * idle or actively generating a turn.\n *\n * See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)\n */\n setSessionMode(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.session_set_mode, params, emptyObjectResponse);\n }\n /**\n * Set a configuration option for a given session.\n *\n * The response contains the full set of configuration options and their current values,\n * as changing one option may affect the available values or state of other options.\n */\n setSessionConfigOption(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.session_set_config_option, params);\n }\n /**\n * Authenticates the client using the specified authentication method.\n *\n * Called when the agent requires authentication before allowing session creation.\n * The client provides the authentication method ID that was advertised during initialization.\n *\n * After successful authentication, the client can proceed to create sessions with\n * `newSession` without receiving an `auth_required` error.\n *\n * See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)\n */\n authenticate(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.authenticate, params, emptyObjectResponse);\n }\n /**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Lists providers that can be configured by the client.\n *\n * This method is only available if the agent advertises the `providers` capability.\n *\n * @experimental\n */\n unstable_listProviders(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.providers_list, params);\n }\n /**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Replaces the configuration for a provider.\n *\n * This method is only available if the agent advertises the `providers` capability.\n *\n * @experimental\n */\n unstable_setProvider(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.providers_set, params, emptyObjectResponse);\n }\n /**\n * **UNSTABLE**\n *\n * This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Disables a provider.\n *\n * This method is only available if the agent advertises the `providers` capability.\n *\n * @experimental\n */\n unstable_disableProvider(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.providers_disable, params, emptyObjectResponse);\n }\n /**\n * Logout of the current authentication method.\n */\n logout(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.logout, params, emptyObjectResponse);\n }\n /**\n * Processes a user prompt within a session.\n *\n * This method handles the whole lifecycle of a prompt:\n * - Receives user messages with optional context (files, images, etc.)\n * - Processes the prompt using language models\n * - Reports language model content and tool calls to the Clients\n * - Requests permission to run tools\n * - Executes any requested tool calls\n * - Returns when the turn is complete with a stop reason\n *\n * See protocol docs: [Prompt Turn](https://agentclientprotocol.com/protocol/prompt-turn)\n */\n prompt(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.session_prompt, params);\n }\n /**\n * Cancels ongoing operations for a session.\n *\n * This is a notification sent by the client to cancel an ongoing prompt turn.\n *\n * Upon receiving this notification, the Agent SHOULD:\n * - Stop all language model requests as soon as possible\n * - Abort all tool call invocations in progress\n * - Send any pending `session/update` notifications\n * - Respond to the original `session/prompt` request with `StopReason::Cancelled`\n *\n * See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)\n */\n cancel(params) {\n return this.connection.sendNotification(schema.AGENT_METHODS.session_cancel, params);\n }\n /**\n * **UNSTABLE**: This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Starts a NES (Next Edit Suggestions) session.\n *\n * @experimental\n */\n unstable_startNes(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.nes_start, params);\n }\n /**\n * **UNSTABLE**: This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Sends a NES suggestion request.\n *\n * @experimental\n */\n unstable_suggestNes(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.nes_suggest, params);\n }\n /**\n * **UNSTABLE**: This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Closes a NES session.\n *\n * @experimental\n */\n unstable_closeNes(params) {\n return this.connection.sendRequest(schema.AGENT_METHODS.nes_close, params, emptyObjectResponse);\n }\n /**\n * **UNSTABLE**: This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Notifies the agent that a document was opened.\n *\n * @experimental\n */\n unstable_didOpenDocument(params) {\n return this.connection.sendNotification(schema.AGENT_METHODS.document_did_open, params);\n }\n /**\n * **UNSTABLE**: This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Notifies the agent that a document was changed.\n *\n * @experimental\n */\n unstable_didChangeDocument(params) {\n return this.connection.sendNotification(schema.AGENT_METHODS.document_did_change, params);\n }\n /**\n * **UNSTABLE**: This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Notifies the agent that a document was closed.\n *\n * @experimental\n */\n unstable_didCloseDocument(params) {\n return this.connection.sendNotification(schema.AGENT_METHODS.document_did_close, params);\n }\n /**\n * **UNSTABLE**: This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Notifies the agent that a document was saved.\n *\n * @experimental\n */\n unstable_didSaveDocument(params) {\n return this.connection.sendNotification(schema.AGENT_METHODS.document_did_save, params);\n }\n /**\n * **UNSTABLE**: This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Notifies the agent that a document received focus.\n *\n * @experimental\n */\n unstable_didFocusDocument(params) {\n return this.connection.sendNotification(schema.AGENT_METHODS.document_did_focus, params);\n }\n /**\n * **UNSTABLE**: This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Notifies the agent that a NES suggestion was accepted.\n *\n * @experimental\n */\n unstable_acceptNes(params) {\n return this.connection.sendNotification(schema.AGENT_METHODS.nes_accept, params);\n }\n /**\n * **UNSTABLE**: This capability is not part of the spec yet, and may be removed or changed at any point.\n *\n * Notifies the agent that a NES suggestion was rejected.\n *\n * @experimental\n */\n unstable_rejectNes(params) {\n return this.connection.sendNotification(schema.AGENT_METHODS.nes_reject, params);\n }\n request(method, params, options) {\n const spec = agentRequestSpecsByMethod[method];\n return this.connection.sendRequest(method, params, spec?.mapResponse, options);\n }\n notify(method, params) {\n return this.connection.sendNotification(method, params);\n }\n /**\n * Extension method.\n *\n * @deprecated Use {@link request}.\n */\n extMethod(method, params) {\n return this.request(method, params);\n }\n /**\n * Extension notification.\n *\n * @deprecated Use {@link notify}.\n */\n extNotification(method, params) {\n return this.notify(method, params);\n }\n /**\n * AbortSignal that aborts when the connection closes.\n *\n * This signal can be used to:\n * - Listen for connection closure: `connection.signal.addEventListener('abort', () => {...})`\n * - Check connection status synchronously: `if (connection.signal.aborted) {...}`\n * - Pass to other APIs (fetch, setTimeout) for automatic cancellation\n *\n * The connection closes when the underlying stream ends, either normally or due to an error.\n *\n * @example\n * ```typescript\n * const connection = new ClientSideConnection(client, stream);\n *\n * // Listen for closure\n * connection.signal.addEventListener('abort', () => {\n * console.log('Connection closed - performing cleanup');\n * });\n *\n * // Check status\n * if (connection.signal.aborted) {\n * console.log('Connection is already closed');\n * }\n *\n * // Pass to other APIs\n * fetch(url, { signal: connection.signal });\n * ```\n */\n get signal() {\n return this.connection.signal;\n }\n /**\n * Promise that resolves when the connection closes.\n *\n * The connection closes when the underlying stream ends, either normally or due to an error.\n * Once closed, the connection cannot send or receive any more messages.\n *\n * This is useful for async/await style cleanup:\n *\n * @example\n * ```typescript\n * const connection = new ClientSideConnection(client, stream);\n * await connection.closed;\n * console.log('Connection closed - performing cleanup');\n * ```\n */\n get closed() {\n return this.connection.closed;\n }\n}\n//# sourceMappingURL=acp.js.map","import { accessSync, constants, existsSync } from 'node:fs'\nimport { delimiter, join } from 'node:path'\nimport { homedir } from 'node:os'\nimport type { RuntimeDef } from '../config/config-schema.js'\n\n/**\n * Host-availability probing for runtimes.\n *\n * `resolveRuntimes()` produces a runtime for every ACP-registry entry that has a\n * distribution for this platform — but that says nothing about whether the tool\n * is actually runnable *here*. This module answers that question so the daemon\n * only advertises genuinely-installed runtimes in `RegisterReq.capabilities`.\n *\n * Two layers:\n * 1. A generic launcher check — is the runtime's `command` resolvable? For a\n * runtime distributed as a real binary (`command` is the tool's own\n * executable) this is a meaningful signal: the binary on `$PATH` means it's\n * installed.\n * 2. For runtimes distributed via a package launcher (`npx`/`uvx`), (1) is\n * meaningless — the launcher fetches on demand, so \"npx exists\" is true on\n * virtually every dev host and tells us nothing about the wrapped agent. For\n * those we REQUIRE a per-runtime custom probe (`CUSTOM_PROBES`) that looks for\n * the wrapped CLI's own config/state dir, which appears once the user has\n * installed and run/initialized it. A launcher-distributed runtime with no\n * probe is treated as NOT installed — otherwise every npx/uvx agent in the\n * ACP registry would be falsely advertised just because `npx` is on `$PATH`.\n *\n * The custom probes test for the config *directory* (the \"installed & initialized\n * on this host\" signal). A stricter \"is logged in\" check would look for the auth\n * file instead (e.g. `~/.codex/auth.json`), but that yields false negatives for\n * users who authenticate via an API-key env var, so directory presence is the\n * pragmatic signal. Paths verified against each tool's docs (July 2026).\n */\n\nconst isWin = process.platform === 'win32'\n\nfunction isExecutableFile(p: string): boolean {\n try {\n // X_OK is meaningless on Windows; fall back to mere existence there.\n accessSync(p, isWin ? constants.F_OK : constants.X_OK)\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Resolve a launcher command the way a shell would. A command containing a path\n * separator is treated as a literal path; a bare name is searched across `$PATH`\n * (trying `$PATHEXT` extensions on Windows).\n */\nexport function isCommandAvailable(command: string, env: NodeJS.ProcessEnv = process.env): boolean {\n return resolveCommandPath(command, env) !== undefined\n}\n\n/**\n * Resolve a launcher/command to its absolute path the way a shell would — a path\n * containing a separator is checked literally; a bare name is searched across\n * `$PATH` (trying `$PATHEXT` extensions on Windows). Returns undefined if not found.\n */\nexport function resolveCommandPath(command: string, env: NodeJS.ProcessEnv = process.env): string | undefined {\n const exts = isWin ? ['', ...(env.PATHEXT ?? '.EXE;.CMD;.BAT;.COM').split(';')] : ['']\n const hasSep = command.includes('/') || (isWin && command.includes('\\\\'))\n if (hasSep) {\n // Try as a literal path relative to CWD first (covers auto-downloaded archives\n // where the binary sits in the extraction directory).\n const literal = exts.map((ext) => command + ext).find(isExecutableFile)\n if (literal) return literal\n // Not found as a literal path — the ACP registry stores binary commands with a\n // `./` prefix (\"./opencode\", \"./goose\", …) which is meaningful when the daemon\n // downloads and extracts the archive itself, but the tool may also be installed\n // directly on `$PATH` as just the basename. Fall back to PATH search with the\n // basename (stripping any directory prefix) so the probe finds it either way.\n const basename = command.split(/[/\\\\]/).filter(Boolean).pop() ?? command\n if (basename !== command) {\n const dirs = (env.PATH ?? '').split(delimiter).filter(Boolean)\n for (const dir of dirs) {\n for (const ext of exts) {\n const p = join(dir, basename) + ext\n if (isExecutableFile(p)) return p\n }\n }\n }\n return undefined\n }\n const dirs = (env.PATH ?? '').split(delimiter).filter(Boolean)\n for (const dir of dirs) {\n for (const ext of exts) {\n const p = join(dir, command) + ext\n if (isExecutableFile(p)) return p\n }\n }\n return undefined\n}\n\n/** Extra, runtime-specific check layered (AND) on top of the launcher probe. */\nexport type RuntimeProbe = (env: NodeJS.ProcessEnv) => boolean\n\n// --- home / XDG path resolution (honors the standard env overrides) ----------\n\nfunction home(env: NodeJS.ProcessEnv): string {\n return (isWin ? env.USERPROFILE : env.HOME) || homedir()\n}\nfunction xdgConfigHome(env: NodeJS.ProcessEnv): string {\n return env.XDG_CONFIG_HOME || join(home(env), '.config')\n}\nfunction xdgDataHome(env: NodeJS.ProcessEnv): string {\n return env.XDG_DATA_HOME || join(home(env), '.local', 'share')\n}\nfunction pathExists(p: string | undefined): boolean {\n return !!p && existsSync(p)\n}\n/** True if any candidate path exists (undefined candidates are skipped). */\nfunction anyExists(...candidates: (string | undefined)[]): boolean {\n return candidates.some(pathExists)\n}\n\n/**\n * Custom probes keyed by ACP-registry runtime id. Add an entry here whenever the\n * launcher-on-PATH check is too weak to mean \"actually installed & set up\".\n * Each tests for the tool's home/XDG config dir (or, where the dir is ambiguous,\n * a tool-specific file), honoring the documented env overrides.\n */\nexport const CUSTOM_PROBES: Record<string, RuntimeProbe> = {\n // Anthropic Claude Code — ~/.claude state dir + ~/.claude.json global config.\n 'claude-acp': (env) => anyExists(join(home(env), '.claude'), join(home(env), '.claude.json')),\n\n // OpenAI Codex CLI — ~/.codex (honors $CODEX_HOME).\n 'codex-acp': (env) => anyExists(env.CODEX_HOME, join(home(env), '.codex')),\n\n // Google Gemini CLI — ~/.gemini.\n gemini: (env) => pathExists(join(home(env), '.gemini')),\n\n // Qwen Code (Gemini-CLI fork) — ~/.qwen.\n 'qwen-code': (env) => pathExists(join(home(env), '.qwen')),\n\n // GitHub Copilot CLI — ~/.copilot (honors $COPILOT_HOME).\n 'github-copilot-cli': (env) => anyExists(env.COPILOT_HOME, join(home(env), '.copilot')),\n\n // Cursor CLI — ~/.cursor is shared with the editor, so probe the CLI-specific\n // config file (honors $CURSOR_CONFIG_DIR).\n cursor: (env) =>\n anyExists(\n env.CURSOR_CONFIG_DIR ? join(env.CURSOR_CONFIG_DIR, 'cli-config.json') : undefined,\n join(home(env), '.cursor', 'cli-config.json')\n ),\n\n // sst OpenCode — XDG config dir + auth file under XDG data. `~/.opencode` is the\n // project-level config dir, not the documented global one, but it lands in $HOME\n // when opencode is run from home, so accept it as a fallback signal.\n opencode: (env) =>\n anyExists(\n join(xdgConfigHome(env), 'opencode'),\n join(xdgDataHome(env), 'opencode', 'auth.json'),\n join(home(env), '.opencode')\n ),\n\n // pi (svkozak pi-acp npx adapter) — ~/.pi (agent state under ~/.pi/agent).\n 'pi-acp': (env) => pathExists(join(home(env), '.pi')),\n\n // Nous Research Hermes — ~/.hermes (honors $HERMES_HOME, which relocates the\n // whole home dir). Not yet in the ACP registry; this covers a user-configured\n // `hermes` runtime, keyed like the other native-ACP tools (opencode/goose).\n hermes: (env) => anyExists(env.HERMES_HOME, join(home(env), '.hermes')),\n\n // Block goose — $XDG_CONFIG_HOME/goose.\n goose: (env) => pathExists(join(xdgConfigHome(env), 'goose')),\n\n // Sourcegraph Amp — $XDG_CONFIG_HOME/amp (honors $AMP_SETTINGS_FILE).\n 'amp-acp': (env) => anyExists(env.AMP_SETTINGS_FILE, join(xdgConfigHome(env), 'amp')),\n\n // Augment auggie — ~/.augment.\n auggie: (env) => pathExists(join(home(env), '.augment')),\n\n // Cline CLI — ~/.cline (honors $CLINE_DATA_DIR).\n cline: (env) => anyExists(env.CLINE_DATA_DIR, join(home(env), '.cline')),\n\n // xAI Grok CLI — ~/.grok.\n 'grok-build': (env) => pathExists(join(home(env), '.grok')),\n\n // Moonshot Kimi CLI — ~/.kimi (legacy) or ~/.kimi-code (newer, honors $KIMI_CODE_HOME).\n kimi: (env) => anyExists(env.KIMI_CODE_HOME, join(home(env), '.kimi'), join(home(env), '.kimi-code')),\n\n // Factory Droid — ~/.factory.\n 'factory-droid': (env) => pathExists(join(home(env), '.factory')),\n\n // Cognition Devin (for Terminal) — XDG config + data dirs.\n devin: (env) => anyExists(join(xdgConfigHome(env), 'devin'), join(xdgDataHome(env), 'devin'))\n}\n\n/**\n * Package launchers that fetch-and-run on demand. When a runtime is launched via\n * one of these, the launcher being on `$PATH` says nothing about whether the\n * wrapped agent is installed, so such runtimes require a custom probe to count.\n */\nconst PACKAGE_LAUNCHERS = new Set(['npx', 'uvx'])\n\n/** Is this runtime actually usable on this host? */\nexport function isRuntimeAvailable(id: string, rt: RuntimeDef, env: NodeJS.ProcessEnv = process.env): boolean {\n if (!isCommandAvailable(rt.command, env)) return false\n const custom = CUSTOM_PROBES[id]\n if (custom) return custom(env)\n // No bespoke probe: trust the launcher check only for real-binary distributions.\n // Package-launcher runtimes (npx/uvx) without a probe are NOT considered\n // installed — the launcher is present on almost every host regardless.\n return !PACKAGE_LAUNCHERS.has(rt.command)\n}\n\n/**\n * Filter a runtime map down to those installed on this host — what the daemon\n * should report to the Control Plane and is able to launch.\n */\nexport function installedRuntimes(\n runtimes: Record<string, RuntimeDef>,\n env: NodeJS.ProcessEnv = process.env\n): Record<string, RuntimeDef> {\n const out: Record<string, RuntimeDef> = {}\n for (const [id, rt] of Object.entries(runtimes)) {\n if (isRuntimeAvailable(id, rt, env)) out[id] = rt\n }\n return out\n}\n","import { spawn, type ChildProcess } from 'node:child_process'\nimport { Readable, Writable } from 'node:stream'\nimport {\n client as createClientApp,\n methods,\n ndJsonStream,\n type ClientConnection,\n type ContentBlock,\n type McpServer,\n type SessionConfigOption,\n type SessionUpdate,\n type StopReason,\n type Usage\n} from '@agentclientprotocol/sdk'\nimport type { RuntimeDef } from '../config/config-schema.js'\nimport { resolveCommandPath } from '../runtimes/probe.js'\nimport type { Logger } from '../log.js'\n\nconst PROTOCOL_VERSION = 1\n\n/** A runtime's advertised model selector, distilled from ACP session config options. */\nexport interface ModelOptions {\n /** The model id currently selected for the session (the agent's default). */\n current?: string\n /** Selectable model ids (group structure flattened away). */\n models: string[]\n}\n\n/** A runtime's advertised reasoning-effort selector (ACP `thought_level`), distilled\n * from session config options and augmented with the synthetic `ultracode`/`max`\n * entries on Claude runtimes (they aren't `thought_level` select values — see\n * {@link ULTRACODE_EFFORT} / {@link claudeSessionMeta}). */\nexport interface EffortOptions {\n /** The effort level currently selected on the session (per the `thought_level`\n * select's currentValue) — note a `_meta`-driven `ultracode` won't appear here. */\n current?: string\n /** Selectable effort levels (group structure flattened; synthetic entries appended). */\n efforts: string[]\n}\n\n/** A runtime's advertised permission/approval mode selector (ACP `mode`). Values are\n * runtime-owned (`default` / `plan` on Claude, `agent` / `read-only` on Codex). */\nexport interface PermissionModeOptions {\n /** The permission mode currently selected for the session. */\n current?: string\n /** Selectable permission mode values (group structure flattened away). */\n modes: string[]\n}\n\n/** A runtime's advertised fast-mode toggle (ACP `model_config` on/off select). The\n * option only exists once a fast-capable model is selected, so `null` means the\n * current model offers no fast toggle. */\nexport interface FastModeOption {\n /** Whether fast mode is currently on (the select's currentValue === \"on\"). */\n current: boolean\n}\n\n/**\n * Desired per-session runtime config, applied through ACP session config\n * options (`session/set_config_option`) right after `session/new` /\n * `session/load`. This is the only channel a runtime like claude-acp accepts\n * for reasoning effort — there is no env var or spawn flag for it; the model\n * additionally has env fallbacks some runtimes read (see cp-overlay.ts).\n */\nexport interface SessionConfigPrefs {\n /** Model id, matched against the option tagged `category: \"model\"`. */\n model?: string\n /** Effort level, matched against the option tagged `category: \"thought_level\"`. */\n reasoningEffort?: string\n /** Fast mode, matched against the option tagged `category: \"model_config\"` —\n * both claude-acp (id \"fast\") and codex-acp (id \"fast-mode\") advertise it\n * there, as an on/off `select` (we don't opt into boolean config options).\n * The option only exists when the selected model supports fast mode, so an\n * unsupported combination degrades to a logged skip. undefined ⇒ don't touch. */\n fastMode?: boolean\n /** Runtime permission/approval mode, matched against the option tagged\n * `category: \"mode\"`. Values are runtime-owned (`default` / `plan` on\n * claude-acp, `agent` / `read-only` on codex-acp, etc.). */\n permissionMode?: string\n /** System-prompt seed (the agent's `description`). Sent via `_meta.systemPrompt`\n * as an append on Claude runtimes only — see {@link claudeSessionMeta}. There is\n * no session config option or ACP field for it. undefined ⇒ don't send one. */\n systemPrompt?: string\n}\n\n/** The `session/set_config_option` call that applies a desired value, or the reason none is needed. */\nexport type ConfigSelectionPlan = { configId: string; value: string } | { skip: string }\n\n/**\n * Resolve how to apply `desired` to the select config option tagged `category`.\n * `{skip}` (with the reason) means nothing should be sent: the runtime\n * advertises no such selector, doesn't offer the value, or already has it set.\n */\nexport function planConfigSelection(\n configOptions: SessionConfigOption[] | null | undefined,\n category: string,\n desired: string\n): ConfigSelectionPlan {\n const opt = configOptions?.find((o) => o.category === category && o.type === 'select')\n if (!opt || opt.type !== 'select') return { skip: `runtime advertises no ${category} selector` }\n const values = opt.options.flatMap((o) => ('group' in o ? o.options : [o])).map((o) => o.value)\n if (!values.includes(desired)) {\n return { skip: `value \"${desired}\" not offered (available: ${values.join(', ')})` }\n }\n if (opt.currentValue === desired) return { skip: `already \"${desired}\"` }\n return { configId: opt.id, value: desired }\n}\n\n/** Effort sentinel `'ultracode'` (matching Claude Code's own `ultracode` settings\n * key) meaning xhigh reasoning PLUS standing dynamic-workflow orchestration. It is\n * deliberately NOT a `thought_level` select value: the claude-acp runtime rejects\n * effort=\"ultracode\" (\"Invalid value\"). See {@link claudeSessionMeta}. */\nexport const ULTRACODE_EFFORT = 'ultracode'\n\n/** The session `_meta` sent to a Claude runtime on session/new and session/load\n * (`_meta.claudeCode.options` is spread into the SDK `query()` options layer), or\n * undefined off Claude runtimes. Three things ride on it:\n *\n * - `thinking`: recent models default `thinking.display` to \"omitted\" — thinking\n * blocks stream signature-only with empty text, so the ACP wrapper never emits\n * `agent_thought_chunk` and the transcript loses its reasoning rows. Request\n * \"summarized\" (the fullest display the API offers) so thoughts reach the stream.\n * - `settings.ultracode` (effort \"ultracode\" only): a session-scoped flag setting\n * the effort select can't reach — the runtime rejects effort=\"ultracode\".\n * `enableWorkflows` rides along so the \"pro\" plan default (workflows off) doesn't\n * silently drop the orchestration half. Best-effort: on a non-xhigh-capable model\n * or with workflows unavailable the runtime reports `applied.ultracode=false` and\n * the session still runs on its default effort — nothing to fail on our side.\n * - `systemPrompt` (top-level, sibling of `claudeCode`): the agent's system-prompt\n * seed. We send it as `{ append }` so it layers ON TOP of claude-acp's\n * `claude_code` preset (keeping the coding scaffolding) rather than replacing it.\n * Honored by claude-agent-acp #91; older runtimes ignore the unknown `_meta` key.\n * This is the only channel for the system prompt — ACP session/new has no such\n * field, and other runtimes have no equivalent yet (see cp-overlay.ts). */\nexport function claudeSessionMeta(\n reasoningEffort: string | undefined,\n isClaudeRuntime: boolean,\n systemPrompt?: string\n):\n | {\n claudeCode: {\n options: {\n thinking: { type: 'adaptive'; display: 'summarized' }\n settings?: { ultracode: true; enableWorkflows: true }\n }\n }\n systemPrompt?: { append: string }\n }\n | undefined {\n if (!isClaudeRuntime) return undefined\n return {\n claudeCode: {\n options: {\n thinking: { type: 'adaptive', display: 'summarized' },\n ...(reasoningEffort === ULTRACODE_EFFORT\n ? { settings: { ultracode: true as const, enableWorkflows: true as const } }\n : {})\n }\n },\n ...(systemPrompt ? { systemPrompt: { append: systemPrompt } } : {})\n }\n}\n\n/**\n * Extract the model selector from a session's `configOptions`. ACP models are an\n * (experimental) session config option tagged `category: \"model\"`, `type:\n * \"select\"`; the selectable values (optionally grouped) are the model list.\n * Returns null when the agent advertises no model selector.\n */\nexport function modelOptionsFrom(configOptions: SessionConfigOption[] | null | undefined): ModelOptions | null {\n const model = configOptions?.find((o) => o.category === 'model' && o.type === 'select')\n if (!model || model.type !== 'select') return null\n // `options` is either a flat SelectOption[] or a SelectGroup[]; flatten groups.\n const models = model.options.flatMap((o) => ('group' in o ? o.options : [o])).map((o) => o.value)\n return { current: model.currentValue, models }\n}\n\n/**\n * Extract the reasoning-effort selector from a session's `configOptions` (ACP\n * `category: \"thought_level\"`, `type: \"select\"`). Effort support is per-model: a runtime\n * only advertises this select for models that support effort (e.g. Opus/Sonnet, not\n * Haiku), so a missing/empty selector means the CURRENT model has no effort → returns\n * null and the picker is hidden. When the model DOES support effort, Claude runtimes get\n * the synthetic `max`/`ultracode` entries appended if not already offered (see\n * {@link ULTRACODE_EFFORT}) — never fabricated for a model that lacks effort entirely.\n */\nexport function effortOptionsFrom(\n configOptions: SessionConfigOption[] | null | undefined,\n isClaudeRuntime: boolean\n): EffortOptions | null {\n const opt = configOptions?.find((o) => o.category === 'thought_level' && o.type === 'select')\n if (!opt || opt.type !== 'select') return null\n const advertised = opt.options.flatMap((o) => ('group' in o ? o.options : [o])).map((o) => o.value)\n if (advertised.length === 0) return null\n const efforts = [...advertised]\n // The current model supports effort — Claude additionally allows `max` (session-only)\n // and `ultracode` (xhigh + workflow orchestration), which aren't `thought_level` values.\n if (isClaudeRuntime) for (const extra of ['max', ULTRACODE_EFFORT]) if (!efforts.includes(extra)) efforts.push(extra)\n return { current: opt.currentValue, efforts }\n}\n\n/**\n * Extract the permission/approval mode selector from a session's `configOptions` (ACP\n * `category: \"mode\"`, `type: \"select\"`). Returns null when the runtime exposes no mode\n * selector.\n */\nexport function permissionModeOptionsFrom(\n configOptions: SessionConfigOption[] | null | undefined\n): PermissionModeOptions | null {\n const opt = configOptions?.find((o) => o.category === 'mode' && o.type === 'select')\n if (!opt || opt.type !== 'select') return null\n const modes = opt.options.flatMap((o) => ('group' in o ? o.options : [o])).map((o) => o.value)\n return { current: opt.currentValue, modes }\n}\n\n/**\n * Extract the fast-mode toggle from a session's `configOptions` (ACP `category:\n * \"model_config\"`, `type: \"select\"` with on/off values). Returns null when the current\n * model advertises no fast toggle.\n */\nexport function fastOptionFrom(configOptions: SessionConfigOption[] | null | undefined): FastModeOption | null {\n const opt = configOptions?.find((o) => o.category === 'model_config' && o.type === 'select')\n if (!opt || opt.type !== 'select') return null\n return { current: opt.currentValue === 'on' }\n}\n\nexport class AcpHost {\n private child?: ChildProcess\n private conn?: ClientConnection\n // acpSessionIds this process created (or loaded). ACP sessions are in-memory in\n // the subprocess, so an id persisted across a daemon restart / host eviction is\n // unknown to a fresh process and must be re-created or re-loaded.\n private live = new Set<string>()\n // sessionIds currently mid-load: `session/load` makes the agent REPLAY its whole\n // history via session/update, which we must NOT forward to the platform (it would\n // re-post the entire conversation). Cleared when the load resolves.\n private loadingSessions = new Set<string>()\n // whether the agent advertised the `loadSession` capability at initialize.\n private canLoad = false\n // prompt content-block variants the agent opted into at initialize. text +\n // resource_link are always baseline; image/audio/embeddedContext are gated.\n private promptCaps: { image?: boolean; audio?: boolean; embeddedContext?: boolean } = {}\n // Selectors from the most recent session/new|load|set, distilled from the reconciled\n // config options. Populated by refreshOptionCaches(); read via modelOptions() /\n // effortOptions() / fastModeOption(). null ⇒ the runtime advertised no such selector.\n private lastModelOptions: ModelOptions | null = null\n private lastEffortOptions: EffortOptions | null = null\n private lastPermissionModeOptions: PermissionModeOptions | null = null\n private lastFastOption: FastModeOption | null = null\n // The most recent reconciled config-option set per live session, cached so a\n // mid-session `set_config_option` (e.g. setSessionModel) can plan against the\n // current options without a round-trip. Updated on new/load and each set.\n private sessionConfigs = new Map<string, SessionConfigOption[] | null | undefined>()\n // ACP protocol version the agent negotiated at initialize (it echoes the version\n // we requested if supported, else downgrades to its own latest). Read via\n // acpProtocolVersion(); undefined until start() completes the handshake.\n private negotiatedProtocolVersion?: number\n\n constructor(\n private runtime: RuntimeDef,\n private opts: {\n onUpdate: (sessionId: string, update: SessionUpdate) => void\n env?: Record<string, string>\n configPrefs?: SessionConfigPrefs\n log?: Logger\n }\n ) {}\n\n /** A Claude Code runtime (its command/args reference `claude`) — these embed the\n * @anthropic-ai/claude-agent-sdk, which needs a Claude Code executable. */\n private isClaudeRuntime(): boolean {\n return [this.runtime.command, ...this.runtime.args].join(' ').toLowerCase().includes('claude')\n }\n\n async start(): Promise<void> {\n if (this.child) throw new Error('AcpHost: already started')\n const env: NodeJS.ProcessEnv = {\n ...process.env,\n ...Object.fromEntries(this.runtime.env.map((e) => [e.name, e.value])),\n ...(this.opts.env ?? {})\n }\n // The claude-agent-sdk resolves the Claude Code binary from its own bundled\n // native package (an OPTIONAL npm dep, often missing under npx / --omit=optional)\n // OR from `CLAUDE_CODE_EXECUTABLE`. If nothing set it but a `claude` CLI is on\n // PATH, point at it so an out-of-the-box Claude Code install just works.\n if (!env.CLAUDE_CODE_EXECUTABLE && this.isClaudeRuntime()) {\n const claude = resolveCommandPath('claude', env)\n if (claude) {\n env.CLAUDE_CODE_EXECUTABLE = claude\n this.opts.log?.info(`acp: CLAUDE_CODE_EXECUTABLE not set — using claude on PATH (${claude})`)\n }\n }\n // AgentConnect owns agent memory uniformly across harnesses (a single\n // <agent-root>/memory.md the daemon injects + the `updateMemory` tool writes).\n // Turn OFF Claude Code's own auto-memory so the agent doesn't end up with two\n // competing memory systems. Respect an explicit override if the operator set one.\n if (this.isClaudeRuntime() && env.CLAUDE_CODE_DISABLE_AUTO_MEMORY === undefined) {\n env.CLAUDE_CODE_DISABLE_AUTO_MEMORY = '1'\n }\n // Resolve the command through resolveCommandPath so spawn gets an absolute path\n // (or a path-qualified relative one for auto-downloaded archives). This handles\n // ACP registry binary commands with a `./` prefix (\"./opencode\", \"./goose\", …)\n // that spawn() would otherwise resolve only against CWD and miss the binary on\n // `$PATH`. Falls back to the raw command when resolution fails (spawn's own error\n // surface is clearer than a synthetic ours).\n const resolved = resolveCommandPath(this.runtime.command, env) ?? this.runtime.command\n const child = spawn(resolved, this.runtime.args, { stdio: ['pipe', 'pipe', 'inherit'], env })\n this.child = child\n\n if (!child.stdin || !child.stdout) {\n throw new Error('AcpHost: subprocess stdin/stdout are not piped')\n }\n const toAgent = Writable.toWeb(child.stdin) as WritableStream<Uint8Array>\n const fromAgent = Readable.toWeb(child.stdout) as unknown as ReadableStream<Uint8Array>\n const stream = ndJsonStream(toAgent, fromAgent)\n\n const self = this\n // fs read/write handlers are intentionally omitted (we advertise fs:false);\n // the SDK auto-replies method-not-found if the agent ever calls them.\n this.conn = createClientApp({ name: 'agentconnect' })\n .onNotification(methods.client.session.update, (ctx) => {\n // Drop the historical updates a `session/load` replays — only live turn\n // output should reach the platform.\n if (self.loadingSessions.has(ctx.params.sessionId)) return\n self.opts.onUpdate(ctx.params.sessionId, ctx.params.update)\n })\n .onRequest(methods.client.session.requestPermission, (ctx) => {\n // MVP: auto-allow the first option (no interactive policy yet)\n const allow = ctx.params.options.find((o) => o.kind === 'allow_once' || o.kind === 'allow_always')\n const optionId = (allow ?? ctx.params.options[0])?.optionId\n return {\n outcome: optionId ? { outcome: 'selected', optionId } : { outcome: 'cancelled' }\n }\n })\n .connect(stream)\n\n const init = await this.conn.agent.request(methods.agent.initialize, {\n protocolVersion: PROTOCOL_VERSION,\n clientCapabilities: { fs: { readTextFile: false, writeTextFile: false } }\n })\n this.negotiatedProtocolVersion = init.protocolVersion\n this.canLoad = init.agentCapabilities?.loadSession ?? false\n this.promptCaps = init.agentCapabilities?.promptCapabilities ?? {}\n this.opts.log?.debug(\n `acp: agent initialized (loadSession=${this.canLoad}, prompt caps: image=${!!this.promptCaps.image} audio=${!!this.promptCaps.audio} embeddedContext=${!!this.promptCaps.embeddedContext})`\n )\n }\n\n /** Whether the agent advertised support for a gated prompt content-block kind.\n * `text` and `resource_link` are baseline and always return true. */\n promptSupports(kind: 'image' | 'audio' | 'embeddedContext'): boolean {\n return Boolean(this.promptCaps[kind])\n }\n\n /** The system-prompt seed to prepend as the first prompt text block of a newly\n * created session, or undefined when none should be inlined. Only NON-Claude\n * runtimes get it here: Claude receives the prompt via `_meta.systemPrompt` on\n * session/new|load (see claudeSessionMeta), so returning undefined for Claude\n * avoids injecting it twice. The caller (SessionManager) prepends the returned\n * text ahead of the first turn's blocks, only when it created the ACP session. */\n inlineSystemPrompt(): string | undefined {\n const seed = this.opts.configPrefs?.systemPrompt\n if (!seed || this.isClaudeRuntime()) return undefined\n return seed\n }\n\n /** Create a fresh ACP session. `effortOverride` (the sticky per-session effort choice,\n * when set) takes the place of the agent default in the Claude `_meta` — the only\n * channel `ultracode` can ride (the `thought_level` select rejects it); select-based\n * effort/model/fast overrides are layered on afterward by the daemon at turn start. */\n async newSession(cwd: string, mcpServers: McpServer[] = [], effortOverride?: string): Promise<string> {\n const _meta = claudeSessionMeta(\n effortOverride ?? this.opts.configPrefs?.reasoningEffort,\n this.isClaudeRuntime(),\n this.opts.configPrefs?.systemPrompt\n )\n const res = await this.conn!.agent.request(methods.agent.session.new, {\n cwd,\n mcpServers,\n ...(_meta ? { _meta } : {})\n })\n this.live.add(res.sessionId)\n const configOptions = await this.applySessionConfig(res.sessionId, res.configOptions)\n this.refreshOptionCaches(configOptions)\n this.sessionConfigs.set(res.sessionId, configOptions)\n return res.sessionId\n }\n\n /**\n * Apply the desired model / reasoning effort / fast mode to a fresh session\n * via ACP `session/set_config_option`. Model first — the effort and fast-mode\n * vocabularies depend on the selected model, and each response returns the\n * reconciled option set the next step plans against. Best-effort by design: a\n * runtime without the selector, an unoffered value, or a failed request logs\n * and moves on — the session still runs on the runtime's defaults. Returns the\n * final option set.\n */\n private async applySessionConfig(\n sessionId: string,\n initial: SessionConfigOption[] | null | undefined\n ): Promise<SessionConfigOption[] | null | undefined> {\n let options = initial\n // ultracode rides `_meta` on session/new|load (see claudeSessionMeta), not the\n // thought_level select — the runtime rejects effort=\"ultracode\". When it's\n // requested, skip thought_level entirely (it would only `{skip}` anyway, and\n // ultracode already forces effort to xhigh).\n const ultracode = this.isClaudeRuntime() && this.opts.configPrefs?.reasoningEffort === ULTRACODE_EFFORT\n const fastMode = this.opts.configPrefs?.fastMode\n const prefs: Array<[category: string, desired: string | undefined]> = [\n ['model', this.opts.configPrefs?.model],\n ['mode', this.opts.configPrefs?.permissionMode],\n ['thought_level', ultracode ? undefined : this.opts.configPrefs?.reasoningEffort],\n // Fast mode comes AFTER model: the option is only advertised (and the\n // reconciled option set only carries it) once a fast-capable model is set.\n ['model_config', fastMode === undefined ? undefined : fastMode ? 'on' : 'off']\n ]\n for (const [category, desired] of prefs) {\n if (!desired) continue\n const plan = planConfigSelection(options, category, desired)\n if ('skip' in plan) {\n this.opts.log?.debug(`acp: session config ${category}=\"${desired}\" not applied — ${plan.skip}`)\n continue\n }\n try {\n const res = await this.conn!.agent.request(methods.agent.session.setConfigOption, {\n sessionId,\n configId: plan.configId,\n value: plan.value\n })\n options = res.configOptions\n this.opts.log?.info(`acp: session config ${category} set to \"${desired}\"`)\n } catch (err) {\n this.opts.log?.warn(`acp: failed to set session config ${category}=\"${desired}\": ${(err as Error).message}`)\n }\n }\n return options\n }\n\n /** Re-derive the model / effort / fast selector caches from a reconciled option set. */\n private refreshOptionCaches(configOptions: SessionConfigOption[] | null | undefined): void {\n this.lastModelOptions = modelOptionsFrom(configOptions)\n this.lastEffortOptions = effortOptionsFrom(configOptions, this.isClaudeRuntime())\n this.lastPermissionModeOptions = permissionModeOptionsFrom(configOptions)\n this.lastFastOption = fastOptionFrom(configOptions)\n }\n\n /** The model selector advertised by the most recent session/new|load, or null if the\n * agent exposed none. Used by the runtime probe + status bar to report models. */\n modelOptions(): ModelOptions | null {\n return this.lastModelOptions\n }\n\n /** The reasoning-effort selector (incl. synthetic ultracode/max on Claude runtimes)\n * from the most recent session/new|load, or null if none is offered. */\n effortOptions(): EffortOptions | null {\n return this.lastEffortOptions\n }\n\n /** The permission/approval mode selector from the most recent session/new|load, or\n * null if none is offered. */\n permissionModeOptions(): PermissionModeOptions | null {\n return this.lastPermissionModeOptions\n }\n\n /** The fast-mode toggle from the most recent session/new|load, or null if the current\n * model offers no fast mode. */\n fastModeOption(): FastModeOption | null {\n return this.lastFastOption\n }\n\n /**\n * Apply one select config option to an ALREADY-RUNNING session via ACP\n * `session/set_config_option`, refreshing the cached option set + selector caches on\n * success. Returns true iff applied: false when the session isn't live here, the\n * runtime advertises no such selector, the value isn't offered, or it's already set.\n */\n private async setSessionConfig(sessionId: string, category: string, value: string): Promise<boolean> {\n if (!this.live.has(sessionId)) return false\n const plan = planConfigSelection(this.sessionConfigs.get(sessionId), category, value)\n if ('skip' in plan) {\n this.opts.log?.debug(`acp: set ${category}=\"${value}\" on ${sessionId} not applied — ${plan.skip}`)\n return false\n }\n const res = await this.conn!.agent.request(methods.agent.session.setConfigOption, {\n sessionId,\n configId: plan.configId,\n value: plan.value\n })\n this.sessionConfigs.set(sessionId, res.configOptions)\n this.refreshOptionCaches(res.configOptions)\n this.opts.log?.info(`acp: session ${sessionId} ${category} set to \"${value}\"`)\n return true\n }\n\n /** Switch the model of an already-running session (ACP `model` select) — the\n * mid-session counterpart of the model applied at new/load. */\n async setSessionModel(sessionId: string, model: string): Promise<boolean> {\n return this.setSessionConfig(sessionId, 'model', model)\n }\n\n /** Switch the reasoning effort of an already-running session (ACP `thought_level`\n * select). Returns false for `ultracode` — it isn't a select value and can only ride\n * session `_meta` at new/load, so the caller relies on the override being re-applied\n * when the session is next (re)created or resumed. */\n async setSessionEffort(sessionId: string, effort: string): Promise<boolean> {\n if (effort === ULTRACODE_EFFORT) return false\n return this.setSessionConfig(sessionId, 'thought_level', effort)\n }\n\n /** Switch the permission/approval mode of an already-running session (ACP `mode`\n * select). Values are runtime-owned and validated against the advertised options. */\n async setSessionPermissionMode(sessionId: string, mode: string): Promise<boolean> {\n return this.setSessionConfig(sessionId, 'mode', mode)\n }\n\n /** Toggle fast mode on an already-running session (ACP `model_config` on/off select).\n * False when the current model offers no fast toggle. */\n async setSessionFastMode(sessionId: string, on: boolean): Promise<boolean> {\n return this.setSessionConfig(sessionId, 'model_config', on ? 'on' : 'off')\n }\n\n /** The ACP protocol version negotiated at initialize, or undefined before the\n * handshake completed. Used by the runtime probe to report ACP coverage. */\n acpProtocolVersion(): number | undefined {\n return this.negotiatedProtocolVersion\n }\n\n /** True iff THIS agent process created or loaded `sessionId` in its current lifetime. */\n hasSession(sessionId: string): boolean {\n return this.live.has(sessionId)\n }\n\n /** Whether the agent advertised the `loadSession` capability (session/load is usable). */\n loadSupported(): boolean {\n return this.canLoad\n }\n\n /** Resume a previously-created session by id (ACP `session/load`). The agent\n * restores its own history server-side; its replayed session/update stream is\n * suppressed so it isn't re-posted. Throws if the agent can't load the id\n * (caller falls back to newSession). */\n async loadSession(sessionId: string, cwd: string, effortOverride?: string): Promise<void> {\n this.loadingSessions.add(sessionId)\n try {\n const _meta = claudeSessionMeta(\n effortOverride ?? this.opts.configPrefs?.reasoningEffort,\n this.isClaudeRuntime(),\n this.opts.configPrefs?.systemPrompt\n )\n const res = await this.conn!.agent.request(methods.agent.session.load, {\n sessionId,\n cwd,\n mcpServers: [],\n ...(_meta ? { _meta } : {})\n })\n this.live.add(sessionId)\n // Re-apply config prefs: ACP sessions restore their own last model/effort,\n // which may predate a CP-side agent edit.\n const configOptions = await this.applySessionConfig(sessionId, res.configOptions)\n // Refresh the selectors from the reconciled options — a resumed session must\n // report its own model/effort/fast, not stale ones from the last session/new (or\n // null if this process never created one). Mirrors newSession().\n this.refreshOptionCaches(configOptions)\n this.sessionConfigs.set(sessionId, configOptions)\n this.opts.log?.info(`acp: resumed session ${sessionId} via session/load`)\n } catch (err) {\n this.opts.log?.debug(`acp: session/load failed for ${sessionId} (${(err as Error).message}) — will recreate`)\n throw err\n } finally {\n this.loadingSessions.delete(sessionId)\n }\n }\n\n /** Drive one turn to completion. Returns the stop reason plus the agent's token\n * `usage` when the runtime reports it (ACP's experimental per-turn usage, which\n * carries session-cumulative counts) — `undefined` when it doesn't. */\n async prompt(sessionId: string, blocks: ContentBlock[]): Promise<{ stopReason: StopReason; usage?: Usage }> {\n const res = await this.conn!.agent.request(methods.agent.session.prompt, { sessionId, prompt: blocks })\n return { stopReason: res.stopReason, usage: res.usage ?? undefined }\n }\n\n async cancel(sessionId: string): Promise<void> {\n await this.conn!.agent.notify(methods.agent.session.cancel, { sessionId })\n }\n\n /** Stop the adapter child: SIGTERM, then escalate to SIGKILL if it hasn't exited\n * within `deadlineMs` (a buggy/hung agent must never block daemon shutdown or an\n * idle reap). Idempotent — the child handle is cleared up front so a concurrent\n * stop (drain + reconcile racing) is a no-op rather than a double-kill. */\n async stop(deadlineMs = 5000): Promise<void> {\n const child = this.child\n if (!child) return\n this.child = undefined\n child.kill('SIGTERM')\n await new Promise<void>((resolve) => {\n let settled = false\n const done = () => {\n if (settled) return\n settled = true\n clearTimeout(timer)\n resolve()\n }\n const timer = setTimeout(() => {\n this.opts.log?.warn(`acp: child ignored SIGTERM after ${deadlineMs}ms — sending SIGKILL`)\n child.kill('SIGKILL')\n }, deadlineMs)\n child.once('exit', done)\n })\n }\n}\n"],"x_google_ignoreList":[21,22,23,24,25,26,29,30,31,32,33,34],"mappings":";;;;;;;;;;;;;AAMA,MAAM,oBAAoBA,OAAS;CAAE,SAASC,OAAS;CAAG,MAAMC,MAAQD,OAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAAE,CAAC;AACjG,MAAM,uBAAuBD,OAAS;CACpC,SAASC,OAAS,CAAC,CAAC,SAAS;CAC7B,KAAKA,OAAS;CACd,MAAMC,MAAQD,OAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;CACpC,KAAKE,OAASF,OAAS,GAAGA,OAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAClD,CAAC;AACD,MAAM,qBAAqBD,OAAS;CAClC,KAAK,kBAAkB,SAAS;CAChC,KAAK,kBAAkB,SAAS;CAChC,QAAQG,OAASF,OAAS,GAAG,oBAAoB,CAAC,CAAC,SAAS;AAC9D,CAAC;AACD,MAAa,sBAAsBD,OAAS;CAC1C,IAAIC,OAAS;CACb,MAAMA,OAAS,CAAC,CAAC,QAAQ,EAAE;CAC3B,SAASA,OAAS,CAAC,CAAC,QAAQ,EAAE;CAC9B,cAAc;AAChB,CAAC;AAID,MAAa,oBAAoBG,OACvB,EAAE,QAAQC,MAAQ,CAACH,MAAQ,mBAAmB,GAAGC,OAASF,OAAS,GAAG,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CACtG,WAAW,OAAO,EACjB,QAAQ,MAAM,QAA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