@keystrokehq/cli 0.0.106 → 0.0.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{dist-DvDsEErE.mjs → dist-D1ip549D.mjs} +2 -2
- package/dist/{dist-DvDsEErE.mjs.map → dist-D1ip549D.mjs.map} +1 -1
- package/dist/index.mjs +33 -4387
- package/dist/index.mjs.map +1 -1
- package/dist/maybe-auto-update-DCsPT080.mjs +247 -0
- package/dist/maybe-auto-update-DCsPT080.mjs.map +1 -0
- package/dist/schemas-DwAYtN9C.mjs +4296 -0
- package/dist/schemas-DwAYtN9C.mjs.map +1 -0
- package/dist/skills-bundle/_AGENTS.md +12 -12
- package/dist/skills-bundle/skills/{actions → keystroke-actions}/SKILL.md +2 -2
- package/dist/skills-bundle/skills/{agents → keystroke-agents}/SKILL.md +2 -2
- package/dist/skills-bundle/skills/{cli → keystroke-cli}/SKILL.md +2 -2
- package/dist/skills-bundle/skills/{credentials → keystroke-credentials}/SKILL.md +2 -2
- package/dist/skills-bundle/skills/{credentials → keystroke-credentials}/references/cli-and-oauth.md +1 -1
- package/dist/skills-bundle/skills/{files → keystroke-files}/SKILL.md +2 -2
- package/dist/skills-bundle/skills/{gateways → keystroke-gateways}/SKILL.md +2 -2
- package/dist/skills-bundle/skills/{skills → keystroke-skills}/SKILL.md +2 -2
- package/dist/skills-bundle/skills/{triggers → keystroke-triggers}/SKILL.md +2 -2
- package/dist/skills-bundle/skills/{workflows → keystroke-workflows}/SKILL.md +2 -2
- package/dist/version-DESgLEkE.mjs +94 -0
- package/dist/version-DESgLEkE.mjs.map +1 -0
- package/package.json +1 -1
- /package/dist/skills-bundle/skills/{actions → keystroke-actions}/references/catalog-and-imports.md +0 -0
- /package/dist/skills-bundle/skills/{agents → keystroke-agents}/references/models.md +0 -0
- /package/dist/skills-bundle/skills/{agents → keystroke-agents}/references/tools-mcp-codemode.md +0 -0
- /package/dist/skills-bundle/skills/{agents → keystroke-agents}/references/workflows-and-testing.md +0 -0
- /package/dist/skills-bundle/skills/{cli → keystroke-cli}/references/api-targets.md +0 -0
- /package/dist/skills-bundle/skills/{gateways → keystroke-gateways}/references/slack-setup.md +0 -0
- /package/dist/skills-bundle/skills/{workflows → keystroke-workflows}/references/authoring.md +0 -0
- /package/dist/skills-bundle/skills/{workflows → keystroke-workflows}/references/testing.md +0 -0
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["isObject","isObject","isPlainObject","objectToString","#options","#runBeforeRequestHooks","#retry","#fetch","#consumeReturnedResponseFromBeforeRetryHook","#runAfterResponseHooks","#retryFromError","#getResponseRequest","#getNormalizedOptions","#getResponseData","#decorateResponse","#cancelResponseBody","#beforeRetryHookErrors","#retryCount","#originalRequest","#cancelBody","#normalizeSearchParams","#input","#userProvidedAbortSignal","#abortController","#createManagedSignal","#startTime","#getCurrentTime","#calculateRetryDelay","#calculateDelay","#readResponseText","#getErrorDataTimeout","#throwIfTotalTimeoutExhausted","#isJsonContentType","#parseJson","#getRemainingTotalTimeout","#assignRequest","#setResponseRequest","#returnedResponseFromBeforeRetryHook","#wrapRequestWithUploadProgress","#cachedNormalizedOptions","#responseRequests","_a","F","isPlainObject","clone","initializer","util.jsonStringifyReplacer","core.$ZodAsyncError","util.finalizeIssue","core.config","errors.$ZodError","safeParse","errors.$ZodRealError","safeParseAsync","duration","_emoji","date","time","datetime","string","number","boolean","util.floatSafeRemainder","util.NUMBER_FORMAT_RANGES","regexes.integer","util.nullish","util.getLengthableOrigin","regexes.lowercase","regexes.uppercase","util.escapeRegex","content","version","version","util.aborted","util.explicitlyAborted","core.$ZodAsyncError","safeParse","safeParseAsync","regexes.string","regexes.guid","regexes.uuid","regexes.email","regexes.emoji","regexes.nanoid","regexes.cuid","regexes.cuid2","regexes.ulid","regexes.xid","regexes.ksuid","regexes.datetime","regexes.date","regexes.time","regexes.duration","regexes.ipv4","regexes.ipv6","regexes.cidrv4","regexes.cidrv6","regexes.base64","regexes.base64url","regexes.e164","regexes.number","regexes.boolean","util.prefixIssues","util.optionalKeys","util.cached","isObject","util.isObject","util.esc","allowsEval","util.allowsEval","util.finalizeIssue","core.config","util.cleanRegex","util.isPlainObject","util.getEnumValues","util.escapeRegex","core.$ZodEncodeError","util.issue","registry","util.normalizeParams","checks.$ZodCheckLessThan","checks.$ZodCheckGreaterThan","checks.$ZodCheckMultipleOf","checks.$ZodCheckMaxLength","checks.$ZodCheckMinLength","checks.$ZodCheckLengthEquals","checks.$ZodCheckRegex","checks.$ZodCheckLowerCase","checks.$ZodCheckUpperCase","checks.$ZodCheckIncludes","checks.$ZodCheckStartsWith","checks.$ZodCheckEndsWith","checks.$ZodCheckOverwrite","util.slugify","issue","util.issue","checks.$ZodCheck","process","process","core._isoDateTime","core._isoDate","core._isoTime","core._isoDuration","core.formatError","core.flattenError","util.jsonStringifyReplacer","parse.parse","parse.safeParse","parse.parseAsync","parse.safeParseAsync","parse.encode","parse.decode","parse.encodeAsync","parse.decodeAsync","parse.safeEncode","parse.safeDecode","parse.safeEncodeAsync","parse.safeDecodeAsync","util.mergeDefs","core.clone","checks.overwrite","processors.stringProcessor","checks.regex","checks.includes","checks.startsWith","checks.endsWith","checks.minLength","checks.maxLength","checks.length","checks.lowercase","checks.uppercase","checks.trim","checks.normalize","checks.toLowerCase","checks.toUpperCase","checks.slugify","core._email","core._url","core._jwt","core._emoji","core._guid","core._uuid","core._uuidv4","core._uuidv6","core._uuidv7","core._nanoid","core._cuid","core._cuid2","core._ulid","core._base64","core._base64url","core._xid","core._ksuid","core._ipv4","core._ipv6","core._cidrv4","core._cidrv6","core._e164","iso.datetime","iso.date","iso.time","iso.duration","core._string","processors.numberProcessor","checks.gt","checks.gte","checks.lt","checks.lte","checks.multipleOf","number","core._number","core._int","processors.booleanProcessor","core._boolean","processors.unknownProcessor","core._unknown","processors.neverProcessor","core._never","processors.arrayProcessor","core._array","processors.objectProcessor","util.extend","util.safeExtend","util.merge","util.pick","util.omit","util.partial","util.required","util.normalizeParams","processors.unionProcessor","processors.intersectionProcessor","processors.recordProcessor","processors.enumProcessor","processors.literalProcessor","processors.transformProcessor","core.$ZodEncodeError","issue","util.issue","processors.optionalProcessor","processors.nullableProcessor","processors.defaultProcessor","util.shallowClone","processors.prefaultProcessor","processors.nonoptionalProcessor","processors.catchProcessor","processors.pipeProcessor","processors.readonlyProcessor","processors.customProcessor","core._custom","core._refine","core._superRefine","core._coercedNumber","schemas.ZodNumber","z.string","z.discriminatedUnion","z.object","z.literal","z.record","z.unknown","z.array","z.enum","z.ZodType","z.custom","z.boolean","z.union","z.coerce.number","z.number","normalizeBaseUrl","applyActiveOrganizationHeader","applyAuthHeaders","kyCredentials","createAgentsResource","createCredentialsResource","createHealthResource","createWorkflowsResource","collectSetValues","#hiddenStack","now","getMethod","sleep"],"sources":["../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/KyError.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/HTTPError.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/NetworkError.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/NonError.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/ForceRetryError.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/SchemaValidationError.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/TimeoutError.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/core/constants.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/body.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/is.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/merge.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/normalize.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/timeout.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/delay.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/options.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/is-network-error.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/type-guards.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/core/Ky.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/index.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/coerce.js","../../../packages/shared/dist/index.mjs","../../../packages/sdk/dist/index.mjs","../src/auth/credentials.ts","../src/resolve-platform-url.ts","../src/config.ts","../src/auth/resolve-cli-auth.ts","../src/client.ts","../../../packages/sdk/dist/platform/index.mjs","../src/platform-client.ts","../src/organization/active-organization.ts","../src/dev-session.ts","../src/resolve-api-target.ts","../src/target-options.ts","../src/errors/example-input.ts","../src/errors/format-api-message.ts","../src/errors/format-cli-error.ts","../src/errors/run-command.ts","../src/errors/command-input.ts","../src/commands/agent/prompt.ts","../src/commands/agent/sessions.ts","../src/commands/agent/index.ts","../src/auth/open-url.ts","../src/commands/connect/run-connect.ts","../src/commands/connect/index.ts","../src/commands/credentials/target-options.ts","../src/commands/credentials/delete.ts","../src/commands/credentials/list.ts","../src/commands/credentials/format-set-conflict-error.ts","../src/project/env-ref.ts","../src/project/resolve-project-root.ts","../src/project/load-project-env.ts","../src/commands/credentials/parse-value.ts","../src/commands/credentials/set.ts","../src/commands/credentials/update.ts","../src/commands/credentials/index.ts","../../../packages/auth/dist/constants-BaNTvWUo.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/package.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/version.mjs","../../../node_modules/.pnpm/better-call@1.3.5_zod@4.4.3/node_modules/better-call/dist/error.mjs","../../../node_modules/.pnpm/@better-auth+core@1.6.11_@better-auth+utils@0.4.0_@better-fetch+fetch@1.1.21_better-cal_90e7d2cb715d3338ca39f1d23262e011/node_modules/@better-auth/core/dist/error/index.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/plugins/device-authorization/client.mjs","../../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/clean-stores/index.js","../../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/atom/index.js","../../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/lifecycle/index.js","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/query.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/broadcast-channel.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/focus-manager.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/online-manager.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/parser.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/session-refresh.mjs","../../../node_modules/.pnpm/@better-auth+core@1.6.11_@better-auth+utils@0.4.0_@better-fetch+fetch@1.1.21_better-cal_90e7d2cb715d3338ca39f1d23262e011/node_modules/@better-auth/core/dist/env/env-impl.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/utils/url.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/fetch-plugins.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/session-atom.mjs","../../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs","../../../node_modules/.pnpm/@better-fetch+fetch@1.1.21/node_modules/@better-fetch/fetch/dist/index.js","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/config.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/utils/is-atom.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/proxy.mjs","../../../node_modules/.pnpm/@better-auth+core@1.6.11_@better-auth+utils@0.4.0_@better-fetch+fetch@1.1.21_better-cal_90e7d2cb715d3338ca39f1d23262e011/node_modules/@better-auth/core/dist/utils/string.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/vanilla.mjs","../../../packages/auth/dist/cli.mjs","../src/auth/resolve-login-targets.ts","../src/commands/auth/login.ts","../src/commands/auth/logout.ts","../src/commands/auth/status.ts","../src/commands/auth/index.ts","../src/commands/build.ts","../../../packages/storage/dist/pack-artifact.mjs","../src/commands/deploy.ts","../src/project/runtime-child-env.ts","../src/project/bootstrap-run.ts","../src/project/resolve-cli-root.ts","../src/process/run-processes.ts","../src/runtime/ensure-native-deps.ts","../src/runtime/resolve-runtime-node-modules.ts","../src/commands/dev.ts","../src/commands/health.ts","../src/init/package-manager.ts","../src/init/project-name.ts","../src/init/prompts.ts","../src/init/copy-template.ts","../src/init/resolve-template-dir.ts","../src/init/project-files.ts","../src/init/resolve-skills-bundle-dir.ts","../src/init/scaffold-bundled-skills.ts","../src/init/scaffold-empty-src-dirs.ts","../src/init/scaffold-project-dotfiles.ts","../src/init/run-init.ts","../src/version.ts","../src/commands/init.ts","../src/commands/project/run-project.ts","../src/commands/project/index.ts","../src/commands/start.ts","../src/commands/trigger/list.ts","../src/commands/trigger/poll.ts","../src/commands/trigger/runs.ts","../src/commands/trigger/index.ts","../src/commands/workflow/run.ts","../src/commands/workflow/runs.ts","../src/commands/workflow/index.ts","../src/commands/config/use-project.ts","../src/commands/config/index.ts","../src/program.ts","../src/index.ts"],"sourcesContent":["/**\nBase class for all Ky-specific errors. `HTTPError`, `NetworkError`, `TimeoutError`, and `ForceRetryError` extend this class.\n\nYou can use `instanceof KyError` to check if an error originated from Ky, or use the `isKyError()` type guard for cross-realm compatibility and TypeScript type narrowing.\n\nNote: `SchemaValidationError` is intentionally not considered a Ky error. `KyError` covers failures in Ky's HTTP lifecycle (bad status, timeout, retry), while schema validation errors originate from the user-provided schema, not from Ky itself.\n*/\nexport class KyError extends Error {\n name = 'KyError';\n get isKyError() {\n return true;\n }\n}\n//# sourceMappingURL=KyError.js.map","import { KyError } from './KyError.js';\n/**\nError thrown when the response has a non-2xx status code and `throwHttpErrors` is enabled.\n\nThe error has a `response` property with the `Response` object, a `request` property with the `Request` object, an `options` property with the normalized options (either passed to `ky` when creating an instance with `ky.create()` or directly when performing the request), and a `data` property with the pre-parsed response body. For JSON responses (based on `Content-Type`), the body is parsed using the `parseJson` option if set, or `JSON.parse` by default. For other content types, it is set as plain text. If the body is empty or parsing fails, `data` will be `undefined`. To avoid hanging or excessive buffering, `error.data` population is bounded by the request timeout and a 10 MiB response body size limit. The `data` property is populated before `beforeError` hooks run, so hooks can access it.\n\nThe response body is automatically consumed when populating `error.data`, so `error.response.json()` and other body methods will not work. Use `error.data` instead. The `error.response` object is still available for headers, status, etc.\n\nBe aware that some types of errors, such as network errors, inherently mean that a response was not received. In that case, the error will be an instance of `NetworkError` instead of `HTTPError` and will not contain a `response` property.\n*/\nexport class HTTPError extends KyError {\n name = 'HTTPError';\n response;\n request;\n options;\n data;\n constructor(response, request, options) {\n const code = (response.status || response.status === 0) ? response.status : '';\n const title = response.statusText ?? '';\n const status = `${code} ${title}`.trim();\n const reason = status ? `status code ${status}` : 'an unknown error';\n super(`Request failed with ${reason}: ${request.method} ${request.url}`);\n this.response = response;\n this.request = request;\n this.options = options;\n }\n}\n//# sourceMappingURL=HTTPError.js.map","import { KyError } from './KyError.js';\n/**\nError thrown when a network error occurs during the request (e.g., DNS failure, connection refused, offline). It has a `request` property with the `Request` object. The original error is available via the standard `cause` property.\n\nNetwork errors are automatically retried (for retriable methods).\n\nNote: Network errors are detected using runtime-specific heuristics. Unrecognized runtimes may produce errors that are not wrapped in `NetworkError`. Use the `shouldRetry` option to handle such cases.\n*/\nexport class NetworkError extends KyError {\n name = 'NetworkError';\n request;\n constructor(request, options) {\n super(`Request failed due to a network error: ${request.method} ${request.url}`, options);\n this.request = request;\n }\n}\n//# sourceMappingURL=NetworkError.js.map","/**\nWrapper for non-Error values that were thrown.\n\nIn JavaScript, any value can be thrown (not just Error instances). This class wraps such values to ensure consistent error handling.\n*/\nexport class NonError extends Error {\n name = 'NonError';\n value;\n constructor(value) {\n let message = 'Non-error value was thrown';\n // Intentionally minimal as this error is just an edge-case.\n try {\n if (typeof value === 'string') {\n message = value;\n }\n else if (value && typeof value === 'object' && 'message' in value && typeof value.message === 'string') {\n message = value.message;\n }\n }\n catch {\n // Use default message if accessing properties throws\n }\n super(message);\n this.value = value;\n }\n}\n//# sourceMappingURL=NonError.js.map","import { KyError } from './KyError.js';\nimport { NonError } from './NonError.js';\n/**\nError used to signal a forced retry from `afterResponse` hooks.\n\nThis is thrown when `ky.retry()` is returned from an `afterResponse` hook. It is observable in `beforeRetry` and `beforeError` hooks via the `isForceRetryError()` type guard.\n*/\nexport class ForceRetryError extends KyError {\n name = 'ForceRetryError';\n customDelay;\n code;\n customRequest;\n constructor(options) {\n // Runtime protection: wrap non-Error causes in NonError\n // TypeScript type is Error for guidance, but JS users can pass anything\n const cause = options?.cause\n ? (options.cause instanceof Error ? options.cause : new NonError(options.cause))\n : undefined;\n super(options?.code ? `Forced retry: ${options.code}` : 'Forced retry', cause ? { cause } : undefined);\n this.customDelay = options?.delay;\n this.code = options?.code;\n this.customRequest = options?.request;\n }\n}\n//# sourceMappingURL=ForceRetryError.js.map","/**\nThe error thrown when [Standard Schema](https://github.com/standard-schema/standard-schema) validation fails in `.json(schema)`. It has an `issues` property with the validation issues from the schema.\n\nThis error intentionally does not extend `KyError` because it does not represent a failure in Ky's HTTP lifecycle. The request succeeded; the user's schema rejected the data. As such, it is not matched by `isKyError()`.\n\n@example\n```\nimport ky, {SchemaValidationError} from 'ky';\nimport {z} from 'zod';\n\nconst userSchema = z.object({name: z.string()});\n\ntry {\n const user = await ky('/api/user').json(userSchema);\n console.log(user.name);\n} catch (error) {\n if (error instanceof SchemaValidationError) {\n console.error(error.issues);\n }\n}\n```\n*/\nexport class SchemaValidationError extends Error {\n name = 'SchemaValidationError';\n issues;\n constructor(issues) {\n super('Response schema validation failed');\n this.issues = issues;\n }\n}\n//# sourceMappingURL=SchemaValidationError.js.map","import { KyError } from './KyError.js';\n/**\nError thrown when the request times out. It has a `request` property with the `Request` object.\n*/\nexport class TimeoutError extends KyError {\n name = 'TimeoutError';\n request;\n constructor(request) {\n super(`Request timed out: ${request.method} ${request.url}`);\n this.request = request;\n }\n}\n//# sourceMappingURL=TimeoutError.js.map","export const supportsRequestStreams = (() => {\n let duplexAccessed = false;\n let hasContentType = false;\n const supportsReadableStream = typeof globalThis.ReadableStream === 'function';\n const supportsRequest = typeof globalThis.Request === 'function';\n if (supportsReadableStream && supportsRequest) {\n try {\n hasContentType = new globalThis.Request('https://empty.invalid', {\n body: new globalThis.ReadableStream(),\n method: 'POST',\n // @ts-expect-error - Types are outdated.\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n }\n catch (error) {\n // QQBrowser on iOS throws \"unsupported BodyInit type\" error (see issue #581)\n if (error instanceof Error && error.message === 'unsupported BodyInit type') {\n return false;\n }\n throw error;\n }\n }\n return duplexAccessed && !hasContentType;\n})();\nexport const supportsAbortController = typeof globalThis.AbortController === 'function';\nexport const supportsAbortSignal = typeof globalThis.AbortSignal === 'function' && typeof globalThis.AbortSignal.any === 'function';\nexport const supportsResponseStreams = typeof globalThis.ReadableStream === 'function';\nexport const supportsFormData = typeof globalThis.FormData === 'function';\nexport const requestMethods = ['get', 'post', 'put', 'patch', 'head', 'delete'];\nconst validate = () => undefined;\nvalidate();\nexport const responseTypes = {\n json: 'application/json',\n text: 'text/*',\n formData: 'multipart/form-data',\n arrayBuffer: '*/*',\n blob: '*/*',\n // Supported in modern Fetch implementations (for example, browsers and recent Node.js/undici).\n // We still feature-check at runtime before exposing the shortcut.\n bytes: '*/*',\n};\n// The maximum value of a 32bit int (see issue #117)\nexport const maxSafeTimeout = 2_147_483_647;\n// Size in bytes of a typical form boundary (e.g., '------WebKitFormBoundaryaxpyiPgbbPti10Rw'), used to help estimate upload size\nexport const usualFormBoundarySize = 40;\n/**\nSymbol that can be returned by a `beforeRetry` hook to stop retrying without throwing an error.\n*/\nexport const stop = Symbol('stop');\n/**\nMarker returned by `ky.retry()` to signal a forced retry from `afterResponse` hooks.\n*/\nexport class RetryMarker {\n options;\n constructor(options) {\n this.options = options;\n }\n}\n/**\nForce a retry from an `afterResponse` hook.\n\nThis allows you to retry a request based on the response content, even if the response has a successful status code. The retry will respect the `retry.limit` option and skip the `shouldRetry` check. The forced retry is observable in `beforeRetry` hooks, where the error will be a `ForceRetryError`.\n\n@param options - Optional configuration for the retry.\n\n@example\n```\nimport ky, {isForceRetryError} from 'ky';\n\nconst api = ky.extend({\n hooks: {\n afterResponse: [\n async ({request, response}) => {\n // Retry based on response body content\n if (response.status === 200) {\n const data = await response.json();\n\n // Simple retry with default delay\n if (data.error?.code === 'TEMPORARY_ERROR') {\n return ky.retry();\n }\n\n // Retry with custom delay from API response\n if (data.error?.code === 'RATE_LIMIT') {\n return ky.retry({\n delay: data.error.retryAfter * 1000,\n code: 'RATE_LIMIT'\n });\n }\n\n // Retry with a modified request (e.g., fallback endpoint)\n if (data.error?.code === 'FALLBACK_TO_BACKUP') {\n return ky.retry({\n request: new Request('https://backup-api.com/endpoint', {\n method: request.method,\n headers: request.headers,\n }),\n code: 'BACKUP_ENDPOINT'\n });\n }\n\n // Retry with refreshed authentication\n if (data.error?.code === 'TOKEN_REFRESH' && data.newToken) {\n return ky.retry({\n request: new Request(request, {\n headers: {\n ...Object.fromEntries(request.headers),\n 'Authorization': `Bearer ${data.newToken}`\n }\n }),\n code: 'TOKEN_REFRESHED'\n });\n }\n\n // Retry with cause to preserve error chain\n try {\n validateResponse(data);\n } catch (error) {\n return ky.retry({\n code: 'VALIDATION_FAILED',\n cause: error\n });\n }\n }\n }\n ],\n beforeRetry: [\n ({error, retryCount}) => {\n // Observable in beforeRetry hooks\n if (isForceRetryError(error)) {\n console.log(`Forced retry #${retryCount}: ${error.message}`);\n // Example output: \"Forced retry #1: Forced retry: RATE_LIMIT\"\n }\n }\n ]\n }\n});\n\nconst response = await api.get('https://example.com/api');\n```\n*/\nexport const retry = (options) => new RetryMarker(options);\nexport const kyOptionKeys = {\n json: true,\n parseJson: true,\n stringifyJson: true,\n searchParams: true,\n baseUrl: true,\n prefix: true,\n retry: true,\n timeout: true,\n totalTimeout: true,\n hooks: true,\n throwHttpErrors: true,\n onDownloadProgress: true,\n onUploadProgress: true,\n fetch: true,\n context: true,\n};\n// Standard RequestInit options that should NOT be passed separately to fetch()\n// because they're already applied to the Request object.\n// Note: `dispatcher` and `priority` are NOT included here - they're fetch-only\n// options that the Request constructor doesn't accept, so they need to be passed\n// separately to fetch().\nexport const requestOptionsRegistry = {\n method: true,\n headers: true,\n body: true,\n mode: true,\n credentials: true,\n cache: true,\n redirect: true,\n referrer: true,\n referrerPolicy: true,\n integrity: true,\n keepalive: true,\n signal: true,\n window: true,\n duplex: true,\n};\n//# sourceMappingURL=constants.js.map","import { usualFormBoundarySize } from '../core/constants.js';\nconst encoder = new TextEncoder();\n// eslint-disable-next-line @typescript-eslint/no-restricted-types\nexport const getBodySize = (body) => {\n if (!body) {\n return 0;\n }\n if (body instanceof FormData) {\n // This is an approximation, as FormData size calculation is not straightforward\n let size = 0;\n for (const [key, value] of body) {\n size += usualFormBoundarySize;\n size += encoder.encode(`Content-Disposition: form-data; name=\"${key}\"`).byteLength;\n size += typeof value === 'string'\n ? encoder.encode(value).byteLength\n : value.size;\n }\n return size;\n }\n if (body instanceof Blob) {\n return body.size;\n }\n if (body instanceof ArrayBuffer || ArrayBuffer.isView(body)) {\n return body.byteLength;\n }\n if (typeof body === 'string') {\n return encoder.encode(body).byteLength;\n }\n if (body instanceof URLSearchParams) {\n return encoder.encode(body.toString()).byteLength;\n }\n return 0;\n};\nconst withProgress = (stream, totalBytes, onProgress) => {\n let previousChunk;\n let transferredBytes = 0;\n return stream.pipeThrough(new TransformStream({\n transform(currentChunk, controller) {\n controller.enqueue(currentChunk);\n if (previousChunk) {\n transferredBytes += previousChunk.byteLength;\n let percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;\n // Avoid reporting 100% progress before the stream is actually finished (in case totalBytes is inaccurate)\n if (percent >= 1) {\n // Epsilon is used here to get as close as possible to 100% without reaching it.\n // If we were to use 0.99 here, percent could potentially go backwards.\n percent = 1 - Number.EPSILON;\n }\n onProgress?.({ percent, totalBytes: Math.max(totalBytes, transferredBytes), transferredBytes }, previousChunk);\n }\n previousChunk = currentChunk;\n },\n flush() {\n if (previousChunk) {\n transferredBytes += previousChunk.byteLength;\n onProgress?.({ percent: 1, totalBytes: Math.max(totalBytes, transferredBytes), transferredBytes }, previousChunk);\n }\n },\n }));\n};\nexport const streamResponse = (response, onDownloadProgress) => {\n if (!response.body) {\n return response;\n }\n const responseInit = {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n };\n if (response.status === 204) {\n return new Response(null, responseInit);\n }\n const totalBytes = Math.max(0, Number(response.headers.get('content-length')) || 0);\n return new Response(withProgress(response.body, totalBytes, onDownloadProgress), responseInit);\n};\n// eslint-disable-next-line @typescript-eslint/no-restricted-types\nexport const streamRequest = (request, onUploadProgress, originalBody) => {\n if (!request.body) {\n return request;\n }\n // Use original body for size calculation since request.body is already a stream\n const totalBytes = getBodySize(originalBody ?? request.body);\n return new Request(request, {\n // @ts-expect-error - Types are outdated.\n duplex: 'half',\n body: withProgress(request.body, totalBytes, onUploadProgress),\n });\n};\n//# sourceMappingURL=body.js.map","// eslint-disable-next-line @typescript-eslint/no-restricted-types\nexport const isObject = (value) => value !== null && typeof value === 'object';\n//# sourceMappingURL=is.js.map","import { supportsAbortSignal } from '../core/constants.js';\nimport { isObject } from './is.js';\nconst replaceSymbol = Symbol('replaceOption');\nconst getReplaceState = (value) => isObject(value) && value[replaceSymbol] === true\n ? {\n isReplace: true,\n value: value.value,\n }\n : {\n isReplace: false,\n value,\n };\n/**\nWraps a value so that `ky.extend()` will replace the parent value instead of merging with it. Works with hooks, headers, search parameters, context, and any other deep-merged option.\n\nBy default, `.extend()` deep-merges options with the parent instance: hooks get appended, headers get merged, and search parameters get accumulated. Use `replaceOption` when you want to fully replace a merged property instead.\n\n@example\n```\nimport ky, {replaceOption} from 'ky';\n\nconst base = ky.create({\n hooks: {beforeRequest: [addAuth, addTracking]},\n});\n\n// Replaces instead of appending\nconst extended = base.extend({\n hooks: replaceOption({beforeRequest: [onlyThis]}),\n});\n// hooks.beforeRequest is now [onlyThis], not [addAuth, addTracking, onlyThis]\n```\n*/\nexport const replaceOption = (value) => {\n const markedValue = { [replaceSymbol]: true, value };\n return markedValue;\n};\nexport const validateAndMerge = (...sources) => {\n for (const source of sources) {\n if ((!isObject(source) || Array.isArray(source)) && source !== undefined) {\n throw new TypeError('The `options` argument must be an object');\n }\n }\n return deepMerge({}, ...sources);\n};\nexport const mergeHeaders = (source1 = {}, source2 = {}) => {\n const result = new globalThis.Headers(source1);\n const isHeadersInstance = source2 instanceof globalThis.Headers;\n const source = new globalThis.Headers(source2);\n for (const [key, value] of source.entries()) {\n if ((isHeadersInstance && value === 'undefined') || value === undefined) {\n result.delete(key);\n }\n else {\n result.set(key, value);\n }\n }\n return result;\n};\nconst isPlainObject = (value) => {\n if (!isObject(value) || Array.isArray(value)) {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n};\nexport const cloneShallow = (value) => {\n if (value instanceof URLSearchParams) {\n const copy = new URLSearchParams(value);\n const deleted = value[deletedParametersSymbol];\n if (deleted) {\n // Preserve internal deletion markers so init-hook cloning does not resurrect params removed during option merging.\n copy[deletedParametersSymbol] = new Set(deleted);\n }\n return copy;\n }\n if (value instanceof globalThis.Headers) {\n return new globalThis.Headers(value);\n }\n if (Array.isArray(value)) {\n return [...value];\n }\n if (isPlainObject(value)) {\n const copy = { ...value };\n return copy;\n }\n return value;\n};\nconst normalizeHeaderObject = (headers) => Object.fromEntries(Object.entries(headers).filter((entry) => entry[1] !== undefined));\nconst mergeHeaderContainers = (source1, source2) => {\n if (isPlainObject(source1) && isPlainObject(source2)) {\n return normalizeHeaderObject({ ...source1, ...source2 });\n }\n return mergeHeaders(source1, source2);\n};\nfunction newHookValue(original, incoming, property) {\n return (Object.hasOwn(incoming, property) && incoming[property] === undefined)\n ? []\n : deepMerge(original[property] ?? [], incoming[property] ?? []);\n}\nexport const mergeHooks = (original = {}, incoming = {}) => ({\n init: newHookValue(original, incoming, 'init'),\n beforeRequest: newHookValue(original, incoming, 'beforeRequest'),\n beforeRetry: newHookValue(original, incoming, 'beforeRetry'),\n beforeError: newHookValue(original, incoming, 'beforeError'),\n afterResponse: newHookValue(original, incoming, 'afterResponse'),\n});\nexport const deletedParametersSymbol = Symbol('deletedParameters');\nconst appendSearchParameters = (target, source) => {\n const result = new URLSearchParams();\n const deleted = new Set();\n for (const input of [target, source]) {\n if (input === undefined) {\n continue;\n }\n if (input instanceof URLSearchParams) {\n for (const [key, value] of input.entries()) {\n result.append(key, value);\n deleted.delete(key);\n }\n const inputDeleted = input[deletedParametersSymbol];\n if (inputDeleted) {\n for (const key of inputDeleted) {\n result.delete(key);\n deleted.add(key);\n }\n }\n }\n else if (Array.isArray(input)) {\n for (const pair of input) {\n if (!Array.isArray(pair) || pair.length !== 2) {\n throw new TypeError('Array search parameters must be provided in [[key, value], ...] format');\n }\n result.append(String(pair[0]), String(pair[1]));\n deleted.delete(String(pair[0]));\n }\n }\n else if (isObject(input)) {\n for (const [key, value] of Object.entries(input)) {\n if (value === undefined) {\n result.delete(key);\n deleted.add(key);\n }\n else {\n result.append(key, String(value));\n deleted.delete(key);\n }\n }\n }\n else {\n // String\n const parameters = new URLSearchParams(input);\n for (const [key, value] of parameters.entries()) {\n result.append(key, value);\n deleted.delete(key);\n }\n }\n }\n if (deleted.size > 0) {\n result[deletedParametersSymbol] = deleted;\n }\n return result;\n};\n// TODO: Make this strongly-typed (no `any`).\nexport const deepMerge = (...sources) => {\n let returnValue = {};\n let headers = {};\n let hooks = {};\n let searchParameters;\n const signals = [];\n for (const source of sources) {\n if (Array.isArray(source)) {\n if (!Array.isArray(returnValue)) {\n returnValue = [];\n }\n returnValue = [...returnValue, ...source];\n }\n else if (isObject(source)) {\n for (let [key, value] of Object.entries(source)) {\n // Special handling for AbortSignal instances\n if (key === 'signal' && value instanceof globalThis.AbortSignal) {\n signals.push(value);\n continue;\n }\n const replaceState = getReplaceState(value);\n const { isReplace } = replaceState;\n value = replaceState.value;\n // Special handling for context - shallow merge only\n if (key === 'context') {\n if (value !== undefined && value !== null && (!isObject(value) || Array.isArray(value))) {\n throw new TypeError('The `context` option must be an object');\n }\n // Shallow merge: always create a new object to prevent mutation bugs\n returnValue = {\n ...returnValue,\n context: (value === undefined || value === null)\n ? {}\n : (isReplace\n ? { ...value }\n : { ...returnValue.context, ...value }),\n };\n continue;\n }\n // Special handling for searchParams\n if (key === 'searchParams') {\n if (value === undefined || value === null) {\n // Explicit undefined or null removes searchParams\n searchParameters = undefined;\n }\n else if (isReplace) {\n searchParameters = value;\n }\n else {\n // First source: keep as-is to preserve type (string/object/URLSearchParams)\n // Subsequent sources: merge and convert to URLSearchParams\n searchParameters = searchParameters === undefined ? value : appendSearchParameters(searchParameters, value);\n }\n continue;\n }\n if (isObject(value) && !isReplace && key in returnValue) {\n value = deepMerge(returnValue[key], value);\n }\n returnValue = { ...returnValue, [key]: value };\n }\n if (isObject(source.hooks)) {\n const { value: hookValue, isReplace } = getReplaceState(source.hooks);\n hooks = isReplace\n ? mergeHooks({}, hookValue)\n : mergeHooks(hooks, hookValue);\n returnValue.hooks = hooks;\n }\n if (isObject(source.headers)) {\n const { value: headerValue, isReplace } = getReplaceState(source.headers);\n headers = isReplace\n ? cloneShallow(headerValue)\n : mergeHeaderContainers(headers, headerValue);\n returnValue.headers = headers;\n }\n }\n }\n if (searchParameters !== undefined) {\n returnValue.searchParams = searchParameters;\n }\n if (signals.length > 0) {\n if (signals.length === 1) {\n returnValue.signal = signals[0];\n }\n else if (supportsAbortSignal) {\n returnValue.signal = AbortSignal.any(signals);\n }\n else {\n // When AbortSignal.any is not available, use the last signal\n // This maintains the previous behavior before signal merging was added\n // This can be remove when the `supportsAbortSignal` check is removed.`\n returnValue.signal = signals.at(-1);\n }\n }\n return returnValue;\n};\n//# sourceMappingURL=merge.js.map","import { requestMethods } from '../core/constants.js';\nexport const normalizeRequestMethod = (input) => requestMethods.includes(input) ? input.toUpperCase() : input;\nconst retryMethods = ['get', 'put', 'head', 'delete', 'options', 'trace'];\nconst retryStatusCodes = [408, 413, 429, 500, 502, 503, 504];\nconst retryAfterStatusCodes = [413, 429, 503];\nconst defaultRetryOptions = {\n limit: 2,\n methods: retryMethods,\n statusCodes: retryStatusCodes,\n afterStatusCodes: retryAfterStatusCodes,\n maxRetryAfter: Number.POSITIVE_INFINITY,\n backoffLimit: Number.POSITIVE_INFINITY,\n delay: attemptCount => 0.3 * (2 ** (attemptCount - 1)) * 1000,\n jitter: undefined,\n retryOnTimeout: false,\n};\nexport const normalizeRetryOptions = (retry = {}) => {\n if (typeof retry === 'number') {\n return {\n ...defaultRetryOptions,\n limit: retry,\n };\n }\n if (retry.methods && !Array.isArray(retry.methods)) {\n throw new Error('retry.methods must be an array');\n }\n if (retry.statusCodes && !Array.isArray(retry.statusCodes)) {\n throw new Error('retry.statusCodes must be an array');\n }\n const normalizedRetry = Object.fromEntries(Object.entries({\n ...retry,\n methods: retry.methods?.map(method => method.toLowerCase()),\n }).filter(([, value]) => value !== undefined));\n return {\n ...defaultRetryOptions,\n ...normalizedRetry,\n };\n};\n//# sourceMappingURL=normalize.js.map","import { TimeoutError } from '../errors/TimeoutError.js';\n// `Promise.race()` workaround (#91)\nexport default async function timeout(request, init, abortController, options) {\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n if (abortController) {\n abortController.abort();\n }\n reject(new TimeoutError(request));\n }, options.timeout);\n void options\n .fetch(request, init)\n .then(resolve)\n .catch(reject)\n .then(() => {\n clearTimeout(timeoutId);\n });\n });\n}\n//# sourceMappingURL=timeout.js.map","// https://github.com/sindresorhus/delay/tree/ab98ae8dfcb38e1593286c94d934e70d14a4e111\nexport default async function delay(ms, { signal }) {\n return new Promise((resolve, reject) => {\n if (signal) {\n signal.throwIfAborted();\n signal.addEventListener('abort', abortHandler, { once: true });\n }\n function abortHandler() {\n clearTimeout(timeoutId);\n reject(signal.reason);\n }\n const timeoutId = setTimeout(() => {\n signal?.removeEventListener('abort', abortHandler);\n resolve();\n }, ms);\n });\n}\n//# sourceMappingURL=delay.js.map","import { kyOptionKeys, requestOptionsRegistry } from '../core/constants.js';\nimport { deletedParametersSymbol } from './merge.js';\nexport const findUnknownOptions = (options) => {\n const unknownOptions = {};\n for (const key in options) {\n // Skip inherited properties\n if (!Object.hasOwn(options, key)) {\n continue;\n }\n // Forward every non-standard, non-Ky option to fetch().\n // We intentionally do not check whether the key also exists on `Request`, because some runtimes\n // patch `Request.prototype` with fetch-only extensions. For example, Next.js adds `next`, and the\n // old `key in request` heuristic dropped it unless Ky kept a special-case allowlist.\n // Passing all non-standard keys makes that allowlist unnecessary and preserves future fetch extensions too.\n if (!(key in requestOptionsRegistry) && !(key in kyOptionKeys)) {\n unknownOptions[key] = options[key];\n }\n }\n return unknownOptions;\n};\nexport const hasSearchParameters = (search) => {\n if (search === undefined) {\n return false;\n }\n // The `typeof array` still gives \"object\", so we need different checking for array.\n if (Array.isArray(search)) {\n return search.length > 0;\n }\n if (search instanceof URLSearchParams) {\n return search.size > 0 || Boolean(search[deletedParametersSymbol]?.size);\n }\n // Record\n if (typeof search === 'object') {\n return Object.keys(search).length > 0;\n }\n if (typeof search === 'string') {\n return search.trim().length > 0;\n }\n return Boolean(search);\n};\n//# sourceMappingURL=options.js.map","// Inlined from https://github.com/sindresorhus/is-network-error v1.3.1\nconst objectToString = Object.prototype.toString;\nconst isError = (value) => objectToString.call(value) === '[object Error]';\nconst errorMessages = new Set([\n 'network error', // Chrome\n 'NetworkError when attempting to fetch resource.', // Firefox\n 'The Internet connection appears to be offline.', // Safari 16\n 'Network request failed', // `cross-fetch`\n 'fetch failed', // Undici (Node.js)\n 'terminated', // Undici (Node.js)\n ' A network error occurred.', // Bun (WebKit) - leading space is intentional\n 'Network connection lost', // Cloudflare Workers (fetch)\n]);\nexport default function isRawNetworkError(error) {\n const isValid = error\n && isError(error)\n && error.name === 'TypeError'\n && typeof error.message === 'string';\n if (!isValid) {\n return false;\n }\n const { message, stack } = error;\n // Safari 17+ has generic message but no stack for network errors\n if (message === 'Load failed') {\n return stack === undefined\n // Sentry adds its own stack trace to the fetch error, so also check for that\n || '__sentry_captured__' in error;\n }\n // Deno network errors start with specific text\n if (message.startsWith('error sending request for url')) {\n return true;\n }\n // Chrome: exact \"Failed to fetch\" or with hostname: \"Failed to fetch (example.com)\"\n if (message === 'Failed to fetch' || (message.startsWith('Failed to fetch (') && message.endsWith(')'))) {\n return true;\n }\n // Standard network error messages\n return errorMessages.has(message);\n}\n//# sourceMappingURL=is-network-error.js.map","import { HTTPError } from '../errors/HTTPError.js';\nimport { NetworkError } from '../errors/NetworkError.js';\nimport { TimeoutError } from '../errors/TimeoutError.js';\nimport { ForceRetryError } from '../errors/ForceRetryError.js';\n// Handles cross-realm cases (e.g., iframes, different JS contexts) where `instanceof` fails.\nconst isErrorType = (error, cls) => error instanceof cls || error?.name === cls.name;\n/**\nType guard to check if an error is a `KyError`.\n\nNote: `SchemaValidationError` is intentionally not considered a Ky error. `KyError` covers failures in Ky's HTTP lifecycle (bad status, timeout, retry), while schema validation errors originate from the user-provided schema, not from Ky itself.\n\n@param error - The error to check\n@returns `true` if the error is a Ky error, `false` otherwise\n\n@example\n```\nimport ky, {isKyError} from 'ky';\ntry {\n const response = await ky.get('/api/data');\n} catch (error) {\n if (isKyError(error)) {\n // Handle Ky-specific errors\n console.log('Ky error occurred:', error.message);\n } else {\n // Handle other errors\n console.log('Unknown error:', error);\n }\n}\n```\n*/\nexport function isKyError(error) {\n return error?.isKyError === true || isHTTPError(error) || isNetworkError(error) || isTimeoutError(error) || isForceRetryError(error);\n}\n/**\nType guard to check if an error is an `HTTPError`.\n\n@param error - The error to check\n@returns `true` if the error is an `HTTPError`, `false` otherwise\n\n@example\n```\nimport ky, {isHTTPError} from 'ky';\ntry {\n const response = await ky.get('/api/data');\n} catch (error) {\n if (isHTTPError(error)) {\n console.log('HTTP error status:', error.response.status);\n }\n}\n```\n*/\nexport function isHTTPError(error) {\n return isErrorType(error, HTTPError);\n}\n/**\nType guard to check if an error is a `NetworkError`.\n\n@param error - The error to check\n@returns `true` if the error is a `NetworkError`, `false` otherwise\n\n@example\n```\nimport ky, {isNetworkError} from 'ky';\ntry {\n const response = await ky.get('/api/data');\n} catch (error) {\n if (isNetworkError(error)) {\n console.log('Network error:', error.request.url);\n }\n}\n```\n*/\nexport function isNetworkError(error) {\n return isErrorType(error, NetworkError);\n}\n/**\nType guard to check if an error is a `TimeoutError`.\n\n@param error - The error to check\n@returns `true` if the error is a `TimeoutError`, `false` otherwise\n\n@example\n```\nimport ky, {isTimeoutError} from 'ky';\ntry {\n const response = await ky.get('/api/data', { timeout: 1000 });\n} catch (error) {\n if (isTimeoutError(error)) {\n console.log('Request timed out:', error.request.url);\n }\n}\n```\n*/\nexport function isTimeoutError(error) {\n return isErrorType(error, TimeoutError);\n}\n/**\nType guard to check if an error is a `ForceRetryError`.\n\n@param error - The error to check\n@returns `true` if the error is a `ForceRetryError`, `false` otherwise\n\n@example\n```\nimport ky, {isForceRetryError} from 'ky';\n\nconst api = ky.extend({\n hooks: {\n beforeRetry: [\n ({error, retryCount}) => {\n if (isForceRetryError(error)) {\n console.log(`Forced retry #${retryCount}: ${error.code}`);\n }\n }\n ]\n }\n});\n```\n*/\nexport function isForceRetryError(error) {\n return isErrorType(error, ForceRetryError);\n}\n//# sourceMappingURL=type-guards.js.map","import { HTTPError } from '../errors/HTTPError.js';\nimport { NetworkError } from '../errors/NetworkError.js';\nimport { NonError } from '../errors/NonError.js';\nimport { ForceRetryError } from '../errors/ForceRetryError.js';\nimport { SchemaValidationError } from '../errors/SchemaValidationError.js';\nimport { TimeoutError } from '../errors/TimeoutError.js';\nimport { streamRequest, streamResponse } from '../utils/body.js';\nimport { cloneShallow, mergeHeaders, mergeHooks, deletedParametersSymbol, } from '../utils/merge.js';\nimport { normalizeRequestMethod, normalizeRetryOptions } from '../utils/normalize.js';\nimport timeout from '../utils/timeout.js';\nimport delay from '../utils/delay.js';\nimport { findUnknownOptions, hasSearchParameters } from '../utils/options.js';\nimport isRawNetworkError from '../utils/is-network-error.js';\nimport { isHTTPError, isNetworkError, isTimeoutError } from '../utils/type-guards.js';\nimport { maxSafeTimeout, responseTypes, stop, RetryMarker, supportsAbortController, supportsAbortSignal, supportsFormData, supportsResponseStreams, supportsRequestStreams, } from './constants.js';\nconst maxErrorResponseBodySize = 10 * 1024 * 1024;\nconst prefixUrlRenamedErrorMessage = 'The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl';\nconst timedOutResponseData = Symbol('timedOutResponseData');\nconst createTextDecoder = (contentType) => {\n const match = /;\\s*charset\\s*=\\s*(?:\"([^\"]+)\"|([^;,\\s]+))/i.exec(contentType);\n const charset = match?.[1] ?? match?.[2];\n if (charset) {\n try {\n return new TextDecoder(charset);\n }\n catch { }\n }\n return new TextDecoder();\n};\nconst invalidSchemaMessage = 'The `schema` argument must follow the Standard Schema specification';\nconst cloneRetryOptions = (retry) => {\n if (typeof retry !== 'object') {\n return retry;\n }\n // Clone nested arrays too so init hooks can mutate retry config without leaking state across requests.\n return {\n ...retry,\n ...(retry.methods && { methods: [...retry.methods] }),\n ...(retry.statusCodes && { statusCodes: [...retry.statusCodes] }),\n ...(retry.afterStatusCodes && { afterStatusCodes: [...retry.afterStatusCodes] }),\n };\n};\nconst objectToString = Object.prototype.toString;\nconst isRequestInstance = (value) => value instanceof globalThis.Request || objectToString.call(value) === '[object Request]';\n// Accepted custom responses are treated as full Responses throughout Ky.\n// If a custom fetch returns one, it must behave like a Response for cloning,\n// body consumption, `json()` decoration, and any enabled stream features.\nconst isResponseInstance = (value) => value instanceof globalThis.Response || objectToString.call(value) === '[object Response]';\nconst cloneSearchParametersForInitHook = (searchParameters) => {\n if (Array.isArray(searchParameters)) {\n return searchParameters.map(parameter => [...parameter]);\n }\n return cloneShallow(searchParameters);\n};\n// Shallow-clone mutable option properties so init hook mutations don't leak across requests.\nfunction cloneInitHookOptions(options) {\n const clonedOptions = {\n ...options,\n json: cloneShallow(options.json),\n context: cloneShallow(options.context),\n headers: cloneShallow(options.headers),\n searchParams: cloneSearchParametersForInitHook(options.searchParams),\n };\n if (options.retry !== undefined) {\n clonedOptions.retry = cloneRetryOptions(options.retry);\n }\n return clonedOptions;\n}\nconst validateJsonWithSchema = async (jsonValue, schema) => {\n if ((typeof schema !== 'object'\n && typeof schema !== 'function')\n || schema === null) {\n throw new TypeError(invalidSchemaMessage);\n }\n const standardSchema = schema['~standard'];\n if (typeof standardSchema !== 'object'\n || standardSchema === null\n || typeof standardSchema.validate !== 'function') {\n throw new TypeError(invalidSchemaMessage);\n }\n const validationResult = await standardSchema.validate(jsonValue);\n if (validationResult.issues) {\n throw new SchemaValidationError(validationResult.issues);\n }\n return validationResult.value;\n};\nexport class Ky {\n static create(input, options) {\n const initHooks = options.hooks?.init ?? [];\n const initHookOptions = initHooks.length > 0 ? cloneInitHookOptions(options) : options;\n for (const hook of initHooks) {\n hook(initHookOptions);\n }\n const ky = new Ky(input, initHookOptions);\n const function_ = async () => {\n if (typeof ky.#options.timeout === 'number' && ky.#options.timeout > maxSafeTimeout) {\n throw new RangeError(`The \\`timeout\\` option cannot be greater than ${maxSafeTimeout}`);\n }\n if (typeof ky.#options.totalTimeout === 'number' && ky.#options.totalTimeout > maxSafeTimeout) {\n throw new RangeError(`The \\`totalTimeout\\` option cannot be greater than ${maxSafeTimeout}`);\n }\n // Delay the fetch so that body method shortcuts can set the Accept header\n await Promise.resolve();\n const beforeRequestResponse = await ky.#runBeforeRequestHooks();\n let response = beforeRequestResponse ?? await ky.#retry(async () => ky.#fetch());\n let responseFromHook = beforeRequestResponse !== undefined\n || ky.#consumeReturnedResponseFromBeforeRetryHook();\n for (;;) {\n // `undefined` means a hook stopped the flow without providing a response.\n // Non-native Responses still continue through Ky if they pass `isResponseInstance()`.\n if (response === undefined) {\n return response;\n }\n if (isResponseInstance(response)) {\n try {\n // eslint-disable-next-line no-await-in-loop\n response = await ky.#runAfterResponseHooks(response);\n }\n catch (error) {\n if (!(error instanceof ForceRetryError)) {\n throw error;\n }\n // eslint-disable-next-line no-await-in-loop\n const retriedResponse = await ky.#retryFromError(error, async () => ky.#fetch());\n if (retriedResponse === undefined) {\n return retriedResponse;\n }\n response = retriedResponse;\n responseFromHook = ky.#consumeReturnedResponseFromBeforeRetryHook();\n continue;\n }\n }\n const currentResponse = response;\n // Opaque responses (`response.type === 'opaque'`) from `no-cors` requests always have `status: 0` and `ok: false`, but this is not a failure - the actual status is hidden by the browser.\n if (!currentResponse.ok && currentResponse.type !== 'opaque' && (typeof ky.#options.throwHttpErrors === 'function'\n ? ky.#options.throwHttpErrors(currentResponse.status)\n : ky.#options.throwHttpErrors)) {\n // `request` must reflect the request that actually failed, but `options` stays as Ky's\n // normalized options snapshot. Replacement `Request` instances do not preserve the\n // original `BodyInit`, so trying to make `options` mirror arbitrary requests would be lossy.\n const httpError = new HTTPError(currentResponse, ky.#getResponseRequest(currentResponse), ky.#getNormalizedOptions());\n const errorToThrow = httpError;\n // eslint-disable-next-line no-await-in-loop\n httpError.data = await ky.#getResponseData(currentResponse);\n if (responseFromHook) {\n throw errorToThrow;\n }\n // eslint-disable-next-line no-await-in-loop\n const retriedResponse = await ky.#retryFromError(httpError, async () => ky.#fetch());\n if (retriedResponse === undefined) {\n return retriedResponse;\n }\n response = retriedResponse;\n responseFromHook = ky.#consumeReturnedResponseFromBeforeRetryHook();\n continue;\n }\n break;\n }\n if (!isResponseInstance(response)) {\n return response;\n }\n ky.#decorateResponse(response);\n // If `onDownloadProgress` is passed, it uses the stream API internally\n if (ky.#options.onDownloadProgress) {\n if (typeof ky.#options.onDownloadProgress !== 'function') {\n throw new TypeError('The `onDownloadProgress` option must be a function');\n }\n if (!supportsResponseStreams) {\n throw new Error('Streams are not supported in your environment. `ReadableStream` is missing.');\n }\n const progressResponse = response.clone();\n ky.#cancelResponseBody(response);\n return streamResponse(progressResponse, ky.#options.onDownloadProgress);\n }\n return response;\n };\n const result = (async () => {\n try {\n return await function_();\n }\n catch (error) {\n // Non-Error throws (e.g., thrown strings) pass through unchanged\n if (!(error instanceof Error)) {\n throw error;\n }\n // Errors thrown by beforeRetry hooks must propagate unchanged.\n if (ky.#beforeRetryHookErrors.has(error)) {\n throw error;\n }\n let processedError = error;\n for (const hook of ky.#options.hooks.beforeError) {\n // `request` is the current failing request. `options` intentionally remains the\n // stable normalized Ky options snapshot for the same reason as `HTTPError` above.\n // eslint-disable-next-line no-await-in-loop\n const hookResult = await hook({\n request: ky.request,\n options: ky.#getNormalizedOptions(),\n error: processedError,\n retryCount: ky.#retryCount,\n });\n // Only overwrite if the hook returns a valid Error instance.\n if (hookResult instanceof Error) {\n processedError = hookResult;\n }\n }\n throw processedError;\n }\n finally {\n const originalRequest = ky.#originalRequest;\n // Ignore cancellation errors from already-locked or already-consumed streams.\n ky.#cancelBody(originalRequest?.body ?? undefined);\n // Only cancel the current request body if it's distinct from the original (i.e. it was cloned for retries).\n if (ky.request !== originalRequest) {\n ky.#cancelBody(ky.request.body ?? undefined);\n }\n }\n })();\n for (const [type, mimeType] of Object.entries(responseTypes)) {\n // Only expose `.bytes()` when the environment implements it.\n if (type === 'bytes'\n && typeof globalThis.Response?.prototype?.bytes !== 'function') {\n continue;\n }\n result[type] = async (schema) => {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n ky.request.headers.set('accept', ky.request.headers.get('accept') || mimeType);\n const response = await result;\n if (type !== 'json') {\n return response[type]();\n }\n const text = await response.text();\n if (text === '') {\n if (schema !== undefined) {\n return validateJsonWithSchema(undefined, schema);\n }\n return JSON.parse(text);\n }\n const jsonValue = initHookOptions.parseJson\n ? await initHookOptions.parseJson(text, { request: ky.#getResponseRequest(response), response })\n : JSON.parse(text);\n return schema === undefined ? jsonValue : validateJsonWithSchema(jsonValue, schema);\n };\n }\n return result;\n }\n // eslint-disable-next-line unicorn/prevent-abbreviations\n static #normalizeSearchParams(searchParams) {\n // Filter out undefined values from plain objects\n if (searchParams && typeof searchParams === 'object' && !Array.isArray(searchParams) && !(searchParams instanceof URLSearchParams)) {\n return Object.fromEntries(Object.entries(searchParams).filter(([, value]) => value !== undefined));\n }\n return searchParams;\n }\n request;\n #abortController;\n #retryCount = 0;\n // eslint-disable-next-line @typescript-eslint/prefer-readonly -- False positive: #input is reassigned on line 202\n #input;\n #options;\n #originalRequest;\n #userProvidedAbortSignal;\n #beforeRetryHookErrors = new WeakSet();\n #cachedNormalizedOptions;\n #startTime;\n #returnedResponseFromBeforeRetryHook = false;\n #responseRequests = new WeakMap();\n // eslint-disable-next-line complexity\n constructor(input, options = {}) {\n this.#input = input;\n if (Object.hasOwn(options, 'prefixUrl')) {\n throw new Error(prefixUrlRenamedErrorMessage);\n }\n this.#options = {\n ...options,\n headers: mergeHeaders(this.#input.headers, options.headers),\n hooks: mergeHooks({}, options.hooks),\n method: normalizeRequestMethod(options.method ?? this.#input.method ?? 'GET'),\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n prefix: String(options.prefix || ''),\n retry: normalizeRetryOptions(options.retry),\n throwHttpErrors: options.throwHttpErrors ?? true,\n timeout: options.timeout ?? 10_000,\n totalTimeout: options.totalTimeout ?? false,\n fetch: options.fetch ?? globalThis.fetch.bind(globalThis),\n context: options.context ?? {},\n };\n if (typeof this.#input !== 'string' && !(this.#input instanceof URL || this.#input instanceof globalThis.Request)) {\n throw new TypeError('`input` must be a string, URL, or Request');\n }\n if (typeof this.#input === 'string') {\n if (this.#options.prefix) {\n const normalizedPrefix = this.#options.prefix.replace(/\\/+$/, '');\n const normalizedInput = this.#input.replace(/^\\/+/, '');\n this.#input = `${normalizedPrefix}/${normalizedInput}`;\n }\n if (this.#options.baseUrl) {\n let absoluteInput;\n try {\n absoluteInput = new URL(this.#input);\n }\n catch { }\n if (!absoluteInput) {\n this.#input = new URL(this.#input, (new Request(this.#options.baseUrl)).url);\n }\n }\n }\n if (supportsAbortController && supportsAbortSignal) {\n this.#userProvidedAbortSignal = this.#options.signal ?? this.#input.signal;\n this.#abortController = new globalThis.AbortController();\n this.#options.signal = this.#createManagedSignal();\n }\n if (supportsRequestStreams) {\n // @ts-expect-error - Types are outdated.\n this.#options.duplex = 'half';\n }\n if (this.#options.json !== undefined) {\n this.#options.body = this.#options.stringifyJson?.(this.#options.json) ?? JSON.stringify(this.#options.json);\n this.#options.headers.set('content-type', this.#options.headers.get('content-type') ?? 'application/json');\n }\n // To provide correct form boundary, Content-Type header should be deleted when creating Request from another Request with FormData/URLSearchParams body\n // Only delete if user didn't explicitly provide a custom content-type\n const userProvidedContentType = options.headers && new globalThis.Headers(options.headers).has('content-type');\n if (this.#input instanceof globalThis.Request\n && ((supportsFormData && this.#options.body instanceof globalThis.FormData) || this.#options.body instanceof URLSearchParams)\n && !userProvidedContentType) {\n this.#options.headers.delete('content-type');\n }\n this.request = new globalThis.Request(this.#input, this.#options);\n if (hasSearchParameters(this.#options.searchParams)) {\n const url = new URL(this.request.url);\n const deleted = this.#options.searchParams?.[deletedParametersSymbol];\n if (deleted) {\n // Remove keys from the input URL first so later searchParams entries can intentionally re-add them.\n for (const key of deleted) {\n url.searchParams.delete(key);\n }\n }\n if (typeof this.#options.searchParams === 'string') {\n const stringSearchParameters = this.#options.searchParams.replace(/^\\?/, '');\n if (stringSearchParameters !== '') {\n url.search = url.search ? `${url.search}&${stringSearchParameters}` : `?${stringSearchParameters}`;\n }\n }\n else {\n const optionsSearchParameters = new URLSearchParams(Ky.#normalizeSearchParams(this.#options.searchParams));\n for (const [key, value] of optionsSearchParameters.entries()) {\n url.searchParams.append(key, value);\n }\n }\n if (this.#options.searchParams\n && typeof this.#options.searchParams === 'object'\n && !Array.isArray(this.#options.searchParams)\n && !(this.#options.searchParams instanceof URLSearchParams)) {\n for (const [key, value] of Object.entries(this.#options.searchParams)) {\n if (value === undefined) {\n url.searchParams.delete(key);\n }\n }\n }\n // Recreate request with the updated URL. We already have all options in this.#options, including duplex.\n this.request = new globalThis.Request(url, this.#options);\n }\n if (this.#options.onUploadProgress && typeof this.#options.onUploadProgress !== 'function') {\n throw new TypeError('The `onUploadProgress` option must be a function');\n }\n // `totalTimeout` starts when the request pipeline is created, so it also includes\n // Ky's internal scheduling and user hook time before the first fetch attempt.\n this.#startTime = typeof this.#options.totalTimeout === 'number' ? this.#getCurrentTime() : undefined;\n }\n #calculateDelay() {\n const retryDelay = this.#options.retry.delay(this.#retryCount + 1);\n let jitteredDelay = retryDelay;\n if (this.#options.retry.jitter === true) {\n jitteredDelay = Math.random() * retryDelay;\n }\n else if (typeof this.#options.retry.jitter === 'function') {\n jitteredDelay = this.#options.retry.jitter(retryDelay);\n if (!Number.isFinite(jitteredDelay) || jitteredDelay < 0) {\n jitteredDelay = retryDelay;\n }\n }\n return Math.min(this.#options.retry.backoffLimit, jitteredDelay);\n }\n async #calculateRetryDelay(error) {\n if (this.#retryCount >= this.#options.retry.limit) {\n throw error;\n }\n // Wrap non-Error throws to ensure consistent error handling\n const errorObject = error instanceof Error ? error : new NonError(error);\n // Handle forced retry from afterResponse hook - skip method check and shouldRetry\n if (errorObject instanceof ForceRetryError) {\n return errorObject.customDelay ?? this.#calculateDelay();\n }\n // Check if method is retriable for non-forced retries\n if (!this.#options.retry.methods.includes(this.request.method.toLowerCase())) {\n throw error;\n }\n // User-provided shouldRetry function takes precedence over default checks (retryOnTimeout, status codes, etc.)\n if (this.#options.retry.shouldRetry !== undefined) {\n const result = await this.#options.retry.shouldRetry({ error: errorObject, retryCount: this.#retryCount + 1 });\n // Strict boolean checking - only exact true/false are handled specially\n if (result === false) {\n throw error;\n }\n if (result === true) {\n // Force retry - skip all other validation and return delay\n return this.#calculateDelay();\n }\n // If undefined or any other value, fall through to default behavior\n }\n // Default timeout behavior\n if (isTimeoutError(error)) {\n if (!this.#options.retry.retryOnTimeout) {\n throw error;\n }\n return this.#calculateDelay();\n }\n if (isHTTPError(error)) {\n if (!this.#options.retry.statusCodes.includes(error.response.status)) {\n throw error;\n }\n const retryAfter = error.response.headers.get('Retry-After')\n ?? error.response.headers.get('RateLimit-Reset')\n ?? error.response.headers.get('X-RateLimit-Retry-After') // Symfony-based services\n ?? error.response.headers.get('X-RateLimit-Reset') // GitHub\n ?? error.response.headers.get('X-Rate-Limit-Reset'); // Twitter\n if (retryAfter && this.#options.retry.afterStatusCodes.includes(error.response.status)) {\n let after = Number(retryAfter) * 1000;\n if (Number.isNaN(after)) {\n after = Date.parse(retryAfter) - Date.now();\n }\n else if (after >= Date.parse('2024-01-01')) {\n // A large number is treated as a timestamp (fixed threshold protects against clock skew)\n after -= Date.now();\n }\n if (!Number.isFinite(after)) {\n return Math.min(this.#options.retry.maxRetryAfter, this.#calculateDelay());\n }\n after = Math.max(0, after);\n // Don't apply jitter when server provides explicit retry timing\n return Math.min(this.#options.retry.maxRetryAfter, after);\n }\n if (error.response.status === 413) {\n throw error;\n }\n return this.#calculateDelay();\n }\n // Only retry known retriable error types. Unknown errors (e.g., programming bugs) are not retried.\n if (!isNetworkError(error)) {\n throw error;\n }\n return this.#calculateDelay();\n }\n #decorateResponse(response) {\n const request = this.#getResponseRequest(response);\n if (this.#options.parseJson) {\n response.json = async () => {\n const text = await response.text();\n if (text === '') {\n return JSON.parse(text);\n }\n return this.#options.parseJson(text, { request, response });\n };\n }\n return response;\n }\n async #getResponseData(response) {\n // Even with request timeouts disabled, bound error-body reads so retries and error propagation\n // cannot be stalled indefinitely by never-ending response streams.\n const text = await this.#readResponseText(response, this.#getErrorDataTimeout());\n if (text === timedOutResponseData) {\n this.#throwIfTotalTimeoutExhausted();\n return undefined;\n }\n if (!text) {\n return undefined;\n }\n if (!this.#isJsonContentType(response.headers.get('content-type') ?? '')) {\n return text;\n }\n const data = await this.#parseJson(text, response, this.#getErrorDataTimeout(), this.#getResponseRequest(response));\n if (data === timedOutResponseData) {\n this.#throwIfTotalTimeoutExhausted();\n return undefined;\n }\n return data;\n }\n #getErrorDataTimeout() {\n const errorDataTimeout = this.#options.timeout === false ? 10_000 : this.#options.timeout;\n const remainingTotal = this.#getRemainingTotalTimeout();\n if (remainingTotal === undefined) {\n return errorDataTimeout;\n }\n if (remainingTotal <= 0) {\n throw new TimeoutError(this.request);\n }\n return Math.min(errorDataTimeout, remainingTotal);\n }\n #isJsonContentType(contentType) {\n // Match JSON subtypes like `json`, `problem+json`, and `vnd.api+json`.\n const mimeType = (contentType.split(';', 1)[0] ?? '').trim().toLowerCase();\n return /\\/(?:.*[.+-])?json$/.test(mimeType);\n }\n async #readResponseText(response, timeoutMs) {\n const { body } = response;\n if (!body) {\n try {\n return await response.text();\n }\n catch {\n return undefined;\n }\n }\n let reader;\n try {\n reader = body.getReader();\n }\n catch {\n // Another consumer already locked the stream.\n return undefined;\n }\n const decoder = createTextDecoder(response.headers.get('content-type') ?? '');\n const chunks = [];\n let totalBytes = 0;\n const readAll = (async () => {\n try {\n for (;;) {\n // eslint-disable-next-line no-await-in-loop\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n totalBytes += value.byteLength;\n if (totalBytes > maxErrorResponseBodySize) {\n void reader.cancel().catch(() => undefined);\n return undefined;\n }\n chunks.push(decoder.decode(value, { stream: true }));\n }\n }\n catch {\n return undefined;\n }\n chunks.push(decoder.decode());\n return chunks.join('');\n })();\n const timeoutPromise = new Promise(resolve => {\n const timeoutId = setTimeout(() => {\n resolve(timedOutResponseData);\n }, timeoutMs);\n void readAll.finally(() => {\n clearTimeout(timeoutId);\n });\n });\n const result = await Promise.race([readAll, timeoutPromise]);\n if (result === timedOutResponseData) {\n void reader.cancel().catch(() => undefined);\n }\n return result;\n }\n async #parseJson(text, response, timeoutMs, request) {\n let timeoutId;\n try {\n return await Promise.race([\n Promise.resolve().then(() => this.#options.parseJson\n ? this.#options.parseJson(text, { request, response })\n : JSON.parse(text)),\n new Promise(resolve => {\n timeoutId = setTimeout(() => {\n resolve(timedOutResponseData);\n }, timeoutMs);\n }),\n ]);\n }\n catch {\n return undefined;\n }\n finally {\n clearTimeout(timeoutId);\n }\n }\n #cancelBody(body) {\n if (!body) {\n return;\n }\n // Ignore cancellation failures from already-locked or already-consumed streams.\n void body.cancel().catch(() => undefined);\n }\n #cancelResponseBody(response) {\n // Ignore cancellation failures from already-locked or already-consumed streams.\n this.#cancelBody(response.body ?? undefined);\n }\n #createManagedSignal() {\n return this.#userProvidedAbortSignal\n ? AbortSignal.any([this.#userProvidedAbortSignal, this.#abortController.signal])\n : this.#abortController.signal;\n }\n #throwIfTotalTimeoutExhausted() {\n const remaining = this.#getRemainingTotalTimeout();\n if (remaining !== undefined && remaining <= 0) {\n throw new TimeoutError(this.request);\n }\n }\n async #runBeforeRequestHooks() {\n for (const hook of this.#options.hooks.beforeRequest) {\n // eslint-disable-next-line no-await-in-loop\n const result = await hook({\n request: this.request,\n options: this.#getNormalizedOptions(),\n retryCount: 0,\n });\n if (isRequestInstance(result)) {\n this.#assignRequest(result);\n }\n else if (isResponseInstance(result)) {\n return result;\n }\n }\n return undefined;\n }\n async #runAfterResponseHooks(response) {\n const responseRequest = this.#getResponseRequest(response);\n for (const hook of this.#options.hooks.afterResponse) {\n const hookResponse = this.#setResponseRequest(response.clone(), responseRequest);\n this.#decorateResponse(hookResponse);\n let modifiedResponse;\n try {\n // eslint-disable-next-line no-await-in-loop\n modifiedResponse = await hook({\n request: this.request,\n options: this.#getNormalizedOptions(),\n response: hookResponse,\n retryCount: this.#retryCount,\n });\n }\n catch (error) {\n // Cancel both responses to prevent memory leaks when hook throws\n if (hookResponse !== response) {\n this.#cancelResponseBody(hookResponse);\n }\n this.#cancelResponseBody(response);\n throw error;\n }\n if (modifiedResponse instanceof RetryMarker) {\n // Cancel both the cloned response passed to the hook and the current response to prevent resource leaks (especially important in Deno/Bun).\n // Do not await cancellation since hooks can clone the response, leaving extra tee branches that keep cancel promises pending per the Streams spec.\n if (hookResponse !== response) {\n this.#cancelResponseBody(hookResponse);\n }\n this.#cancelResponseBody(response);\n throw new ForceRetryError(modifiedResponse.options);\n }\n const nextResponse = isResponseInstance(modifiedResponse)\n ? this.#setResponseRequest(modifiedResponse, responseRequest)\n : response;\n // Cancel any response bodies we won't use to prevent memory leaks.\n // Uses fire-and-forget since hooks may have cloned the response, creating tee branches that block cancellation.\n // If the hook wrapped an existing body into a new Response, both Response objects can still point at the same stream.\n if (hookResponse !== response && hookResponse !== nextResponse && hookResponse.body !== nextResponse.body) {\n this.#cancelResponseBody(hookResponse);\n }\n if (response !== nextResponse && response.body !== nextResponse.body) {\n this.#cancelResponseBody(response);\n }\n response = nextResponse;\n }\n return response;\n }\n async #retry(function_) {\n try {\n return await function_();\n }\n catch (error) {\n return this.#retryFromError(error, function_);\n }\n }\n async #retryFromError(error, function_) {\n this.#returnedResponseFromBeforeRetryHook = false;\n const retryDelay = Math.min(await this.#calculateRetryDelay(error), maxSafeTimeout);\n const delayOptions = { signal: this.#userProvidedAbortSignal };\n const remainingTimeout = this.#getRemainingTotalTimeout();\n if (remainingTimeout !== undefined) {\n if (remainingTimeout <= 0) {\n throw new TimeoutError(this.request);\n }\n // If waiting would consume all remaining budget, time out without starting another request.\n if (retryDelay >= remainingTimeout) {\n await delay(remainingTimeout, delayOptions);\n throw new TimeoutError(this.request);\n }\n }\n // Only use user-provided signal for delay, not our internal abortController\n await delay(retryDelay, delayOptions);\n this.#throwIfTotalTimeoutExhausted();\n // Apply custom request from forced retry before beforeRetry hooks\n // Ensure the custom request has the correct managed signal for timeouts and user aborts\n if (error instanceof ForceRetryError && error.customRequest) {\n const customRequest = new globalThis.Request(error.customRequest, this.#options.signal ? { signal: this.#options.signal } : undefined);\n // Replacement Requests are authoritative by design. Do not rewrite headers here,\n // even for cross-origin retries. Callers using `ky.retry({request})` explicitly\n // opted into the exact Request they constructed.\n this.#assignRequest(customRequest);\n }\n for (const hook of this.#options.hooks.beforeRetry) {\n let hookResult;\n try {\n // eslint-disable-next-line no-await-in-loop\n hookResult = await hook({\n request: this.request,\n options: this.#getNormalizedOptions(),\n error: error,\n retryCount: this.#retryCount + 1,\n });\n }\n catch (hookError) {\n // Preserve the original request error path (`throw error`) so beforeError hooks can still run.\n if (hookError instanceof Error && hookError !== error) {\n this.#beforeRetryHookErrors.add(hookError);\n }\n throw hookError;\n }\n if (isRequestInstance(hookResult)) {\n // Same contract as `ky.retry({request})`: a Request returned from `beforeRetry`\n // is used as-is rather than being sanitized or otherwise rewritten by Ky.\n this.#assignRequest(hookResult);\n break;\n }\n if (isResponseInstance(hookResult)) {\n this.#returnedResponseFromBeforeRetryHook = true;\n this.#retryCount++;\n return hookResult;\n }\n // If `stop` is returned from the hook, the retry process is stopped\n if (hookResult === stop) {\n return;\n }\n }\n this.#throwIfTotalTimeoutExhausted();\n this.#retryCount++;\n return this.#retry(function_);\n }\n #consumeReturnedResponseFromBeforeRetryHook() {\n const value = this.#returnedResponseFromBeforeRetryHook;\n this.#returnedResponseFromBeforeRetryHook = false;\n return value;\n }\n async #fetch() {\n // Reset abortController if it was aborted (happens on timeout retry)\n if (this.#abortController?.signal.aborted) {\n this.#abortController = new globalThis.AbortController();\n this.#options.signal = this.#createManagedSignal();\n // Recreate request with new signal\n this.request = new globalThis.Request(this.request, { signal: this.#options.signal });\n }\n const nonRequestOptions = findUnknownOptions(this.#options);\n const retryRequest = this.#options.retry.limit > 0 ? this.request.clone() : undefined;\n const request = this.#wrapRequestWithUploadProgress(this.request, this.#options.body ?? undefined);\n // Cloning is done here to prepare in advance for retries.\n // Skip cloning when retries are disabled - cloning a streaming body calls ReadableStream#tee()\n // which buffers the entire stream in memory, causing excessive memory usage for large uploads.\n this.#originalRequest = request;\n if (retryRequest) {\n this.request = retryRequest;\n }\n try {\n const remainingTotal = this.#getRemainingTotalTimeout();\n if (remainingTotal !== undefined && remainingTotal <= 0) {\n throw new TimeoutError(this.request);\n }\n const effectiveTimeout = this.#options.timeout === false\n ? remainingTotal\n : (remainingTotal === undefined\n ? this.#options.timeout\n : Math.min(this.#options.timeout, remainingTotal));\n const response = effectiveTimeout === undefined\n ? await this.#options.fetch(request, nonRequestOptions)\n : await timeout(request, nonRequestOptions, this.#abortController, {\n timeout: effectiveTimeout,\n fetch: this.#options.fetch,\n });\n return this.#setResponseRequest(response, request);\n }\n catch (error) {\n if (isRawNetworkError(error)) {\n throw new NetworkError(this.request, { cause: error });\n }\n throw error;\n }\n }\n #getRemainingTotalTimeout() {\n if (this.#startTime === undefined) {\n return undefined;\n }\n const elapsed = this.#getCurrentTime() - this.#startTime;\n return Math.max(0, this.#options.totalTimeout - elapsed);\n }\n #getCurrentTime() {\n return globalThis.performance?.now() ?? Date.now();\n }\n #getNormalizedOptions() {\n if (!this.#cachedNormalizedOptions) {\n // Exclude Ky-specific options that are not part of `RequestInit`.\n const { hooks, json, parseJson, stringifyJson, searchParams, timeout, totalTimeout, throwHttpErrors, fetch, ...normalizedOptions } = this.#options;\n this.#cachedNormalizedOptions = Object.freeze(normalizedOptions);\n }\n return this.#cachedNormalizedOptions;\n }\n #assignRequest(request) {\n this.#cachedNormalizedOptions = undefined;\n this.request = request;\n }\n #getResponseRequest(response) {\n return this.#responseRequests.get(response) ?? this.request;\n }\n #setResponseRequest(response, request) {\n this.#responseRequests.set(response, request);\n return response;\n }\n #wrapRequestWithUploadProgress(request, originalBody) {\n if (!this.#options.onUploadProgress || !request.body || !supportsRequestStreams) {\n return request;\n }\n return streamRequest(request, this.#options.onUploadProgress, originalBody ?? this.#options.body ?? undefined);\n }\n}\n//# sourceMappingURL=Ky.js.map","/*! MIT License © Sindre Sorhus */\nimport { Ky } from './core/Ky.js';\nimport { requestMethods, stop, retry } from './core/constants.js';\nimport { validateAndMerge } from './utils/merge.js';\nconst createInstance = (defaults) => {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n const ky = (input, options) => Ky.create(input, validateAndMerge(defaults, options));\n for (const method of requestMethods) {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n ky[method] = (input, options) => Ky.create(input, validateAndMerge(defaults, options, { method }));\n }\n ky.create = (newDefaults) => createInstance(validateAndMerge(newDefaults));\n ky.extend = (newDefaults) => {\n if (typeof newDefaults === 'function') {\n newDefaults = newDefaults(defaults ?? {});\n }\n return createInstance(validateAndMerge(defaults, newDefaults));\n };\n ky.stop = stop;\n ky.retry = retry;\n return ky;\n};\nconst ky = createInstance();\nexport default ky;\nexport { KyError } from './errors/KyError.js';\nexport { HTTPError } from './errors/HTTPError.js';\nexport { SchemaValidationError } from './errors/SchemaValidationError.js';\nexport { NetworkError } from './errors/NetworkError.js';\nexport { TimeoutError } from './errors/TimeoutError.js';\nexport { ForceRetryError } from './errors/ForceRetryError.js';\nexport { isKyError, isHTTPError, isNetworkError, isTimeoutError, isForceRetryError, } from './utils/type-guards.js';\nexport { replaceOption } from './utils/merge.js';\n// Intentionally not exporting this for now as it's just an implementation detail and we don't want to commit to a certain API yet at least.\n// export {NonError} from './errors/NonError.js';\n//# sourceMappingURL=index.js.map","var _a;\n/** A special constant with type `never` */\nexport const NEVER = /*@__PURE__*/ Object.freeze({\n status: \"aborted\",\n});\nexport /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, params) {\n function init(inst, def) {\n if (!inst._zod) {\n Object.defineProperty(inst, \"_zod\", {\n value: {\n def,\n constr: _,\n traits: new Set(),\n },\n enumerable: false,\n });\n }\n if (inst._zod.traits.has(name)) {\n return;\n }\n inst._zod.traits.add(name);\n initializer(inst, def);\n // support prototype modifications\n const proto = _.prototype;\n const keys = Object.keys(proto);\n for (let i = 0; i < keys.length; i++) {\n const k = keys[i];\n if (!(k in inst)) {\n inst[k] = proto[k].bind(inst);\n }\n }\n }\n // doesn't work if Parent has a constructor with arguments\n const Parent = params?.Parent ?? Object;\n class Definition extends Parent {\n }\n Object.defineProperty(Definition, \"name\", { value: name });\n function _(def) {\n var _a;\n const inst = params?.Parent ? new Definition() : this;\n init(inst, def);\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n for (const fn of inst._zod.deferred) {\n fn();\n }\n return inst;\n }\n Object.defineProperty(_, \"init\", { value: init });\n Object.defineProperty(_, Symbol.hasInstance, {\n value: (inst) => {\n if (params?.Parent && inst instanceof params.Parent)\n return true;\n return inst?._zod?.traits?.has(name);\n },\n });\n Object.defineProperty(_, \"name\", { value: name });\n return _;\n}\n////////////////////////////// UTILITIES ///////////////////////////////////////\nexport const $brand = Symbol(\"zod_brand\");\nexport class $ZodAsyncError extends Error {\n constructor() {\n super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);\n }\n}\nexport class $ZodEncodeError extends Error {\n constructor(name) {\n super(`Encountered unidirectional transform during encode: ${name}`);\n this.name = \"ZodEncodeError\";\n }\n}\n(_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});\nexport const globalConfig = globalThis.__zod_globalConfig;\nexport function config(newConfig) {\n if (newConfig)\n Object.assign(globalConfig, newConfig);\n return globalConfig;\n}\n","import { globalConfig } from \"./core.js\";\n// functions\nexport function assertEqual(val) {\n return val;\n}\nexport function assertNotEqual(val) {\n return val;\n}\nexport function assertIs(_arg) { }\nexport function assertNever(_x) {\n throw new Error(\"Unexpected value in exhaustive check\");\n}\nexport function assert(_) { }\nexport function getEnumValues(entries) {\n const numericValues = Object.values(entries).filter((v) => typeof v === \"number\");\n const values = Object.entries(entries)\n .filter(([k, _]) => numericValues.indexOf(+k) === -1)\n .map(([_, v]) => v);\n return values;\n}\nexport function joinValues(array, separator = \"|\") {\n return array.map((val) => stringifyPrimitive(val)).join(separator);\n}\nexport function jsonStringifyReplacer(_, value) {\n if (typeof value === \"bigint\")\n return value.toString();\n return value;\n}\nexport function cached(getter) {\n const set = false;\n return {\n get value() {\n if (!set) {\n const value = getter();\n Object.defineProperty(this, \"value\", { value });\n return value;\n }\n throw new Error(\"cached value already set\");\n },\n };\n}\nexport function nullish(input) {\n return input === null || input === undefined;\n}\nexport function cleanRegex(source) {\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n return source.slice(start, end);\n}\nexport function floatSafeRemainder(val, step) {\n const ratio = val / step;\n const roundedRatio = Math.round(ratio);\n // Use a relative epsilon scaled to the magnitude of the result\n const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);\n if (Math.abs(ratio - roundedRatio) < tolerance)\n return 0;\n return ratio - roundedRatio;\n}\nconst EVALUATING = /* @__PURE__*/ Symbol(\"evaluating\");\nexport function defineLazy(object, key, getter) {\n let value = undefined;\n Object.defineProperty(object, key, {\n get() {\n if (value === EVALUATING) {\n // Circular reference detected, return undefined to break the cycle\n return undefined;\n }\n if (value === undefined) {\n value = EVALUATING;\n value = getter();\n }\n return value;\n },\n set(v) {\n Object.defineProperty(object, key, {\n value: v,\n // configurable: true,\n });\n // object[key] = v;\n },\n configurable: true,\n });\n}\nexport function objectClone(obj) {\n return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));\n}\nexport function assignProp(target, prop, value) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n}\nexport function mergeDefs(...defs) {\n const mergedDescriptors = {};\n for (const def of defs) {\n const descriptors = Object.getOwnPropertyDescriptors(def);\n Object.assign(mergedDescriptors, descriptors);\n }\n return Object.defineProperties({}, mergedDescriptors);\n}\nexport function cloneDef(schema) {\n return mergeDefs(schema._zod.def);\n}\nexport function getElementAtPath(obj, path) {\n if (!path)\n return obj;\n return path.reduce((acc, key) => acc?.[key], obj);\n}\nexport function promiseAllObject(promisesObj) {\n const keys = Object.keys(promisesObj);\n const promises = keys.map((key) => promisesObj[key]);\n return Promise.all(promises).then((results) => {\n const resolvedObj = {};\n for (let i = 0; i < keys.length; i++) {\n resolvedObj[keys[i]] = results[i];\n }\n return resolvedObj;\n });\n}\nexport function randomString(length = 10) {\n const chars = \"abcdefghijklmnopqrstuvwxyz\";\n let str = \"\";\n for (let i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n}\nexport function esc(str) {\n return JSON.stringify(str);\n}\nexport function slugify(input) {\n return input\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/[\\s_-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\nexport const captureStackTrace = (\"captureStackTrace\" in Error ? Error.captureStackTrace : (..._args) => { });\nexport function isObject(data) {\n return typeof data === \"object\" && data !== null && !Array.isArray(data);\n}\nexport const allowsEval = /* @__PURE__*/ cached(() => {\n // Skip the probe under `jitless`: strict CSPs report the caught `new Function`\n // as a `securitypolicyviolation` even though the throw is swallowed.\n if (globalConfig.jitless) {\n return false;\n }\n // @ts-ignore\n if (typeof navigator !== \"undefined\" && navigator?.userAgent?.includes(\"Cloudflare\")) {\n return false;\n }\n try {\n const F = Function;\n new F(\"\");\n return true;\n }\n catch (_) {\n return false;\n }\n});\nexport function isPlainObject(o) {\n if (isObject(o) === false)\n return false;\n // modified constructor\n const ctor = o.constructor;\n if (ctor === undefined)\n return true;\n if (typeof ctor !== \"function\")\n return true;\n // modified prototype\n const prot = ctor.prototype;\n if (isObject(prot) === false)\n return false;\n // ctor doesn't have static `isPrototypeOf`\n if (Object.prototype.hasOwnProperty.call(prot, \"isPrototypeOf\") === false) {\n return false;\n }\n return true;\n}\nexport function shallowClone(o) {\n if (isPlainObject(o))\n return { ...o };\n if (Array.isArray(o))\n return [...o];\n if (o instanceof Map)\n return new Map(o);\n if (o instanceof Set)\n return new Set(o);\n return o;\n}\nexport function numKeys(data) {\n let keyCount = 0;\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n keyCount++;\n }\n }\n return keyCount;\n}\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return \"undefined\";\n case \"string\":\n return \"string\";\n case \"number\":\n return Number.isNaN(data) ? \"nan\" : \"number\";\n case \"boolean\":\n return \"boolean\";\n case \"function\":\n return \"function\";\n case \"bigint\":\n return \"bigint\";\n case \"symbol\":\n return \"symbol\";\n case \"object\":\n if (Array.isArray(data)) {\n return \"array\";\n }\n if (data === null) {\n return \"null\";\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return \"promise\";\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return \"map\";\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return \"set\";\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return \"date\";\n }\n // @ts-ignore\n if (typeof File !== \"undefined\" && data instanceof File) {\n return \"file\";\n }\n return \"object\";\n default:\n throw new Error(`Unknown data type: ${t}`);\n }\n};\nexport const propertyKeyTypes = /* @__PURE__*/ new Set([\"string\", \"number\", \"symbol\"]);\nexport const primitiveTypes = /* @__PURE__*/ new Set([\n \"string\",\n \"number\",\n \"bigint\",\n \"boolean\",\n \"symbol\",\n \"undefined\",\n]);\nexport function escapeRegex(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n// zod-specific utils\nexport function clone(inst, def, params) {\n const cl = new inst._zod.constr(def ?? inst._zod.def);\n if (!def || params?.parent)\n cl._zod.parent = inst;\n return cl;\n}\nexport function normalizeParams(_params) {\n const params = _params;\n if (!params)\n return {};\n if (typeof params === \"string\")\n return { error: () => params };\n if (params?.message !== undefined) {\n if (params?.error !== undefined)\n throw new Error(\"Cannot specify both `message` and `error` params\");\n params.error = params.message;\n }\n delete params.message;\n if (typeof params.error === \"string\")\n return { ...params, error: () => params.error };\n return params;\n}\nexport function createTransparentProxy(getter) {\n let target;\n return new Proxy({}, {\n get(_, prop, receiver) {\n target ?? (target = getter());\n return Reflect.get(target, prop, receiver);\n },\n set(_, prop, value, receiver) {\n target ?? (target = getter());\n return Reflect.set(target, prop, value, receiver);\n },\n has(_, prop) {\n target ?? (target = getter());\n return Reflect.has(target, prop);\n },\n deleteProperty(_, prop) {\n target ?? (target = getter());\n return Reflect.deleteProperty(target, prop);\n },\n ownKeys(_) {\n target ?? (target = getter());\n return Reflect.ownKeys(target);\n },\n getOwnPropertyDescriptor(_, prop) {\n target ?? (target = getter());\n return Reflect.getOwnPropertyDescriptor(target, prop);\n },\n defineProperty(_, prop, descriptor) {\n target ?? (target = getter());\n return Reflect.defineProperty(target, prop, descriptor);\n },\n });\n}\nexport function stringifyPrimitive(value) {\n if (typeof value === \"bigint\")\n return value.toString() + \"n\";\n if (typeof value === \"string\")\n return `\"${value}\"`;\n return `${value}`;\n}\nexport function optionalKeys(shape) {\n return Object.keys(shape).filter((k) => {\n return shape[k]._zod.optin === \"optional\" && shape[k]._zod.optout === \"optional\";\n });\n}\nexport const NUMBER_FORMAT_RANGES = {\n safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],\n int32: [-2147483648, 2147483647],\n uint32: [0, 4294967295],\n float32: [-3.4028234663852886e38, 3.4028234663852886e38],\n float64: [-Number.MAX_VALUE, Number.MAX_VALUE],\n};\nexport const BIGINT_FORMAT_RANGES = {\n int64: [/* @__PURE__*/ BigInt(\"-9223372036854775808\"), /* @__PURE__*/ BigInt(\"9223372036854775807\")],\n uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt(\"18446744073709551615\")],\n};\nexport function pick(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".pick() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = {};\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n newShape[key] = currDef.shape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function omit(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".omit() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = { ...schema._zod.def.shape };\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n delete newShape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function extend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to extend: expected a plain object\");\n }\n const checks = schema._zod.def.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n // Only throw if new shape overlaps with existing shape\n // Use getOwnPropertyDescriptor to check key existence without accessing values\n const existingShape = schema._zod.def.shape;\n for (const key in shape) {\n if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {\n throw new Error(\"Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.\");\n }\n }\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function safeExtend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to safeExtend: expected a plain object\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function merge(a, b) {\n if (a._zod.def.checks?.length) {\n throw new Error(\".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.\");\n }\n const def = mergeDefs(a._zod.def, {\n get shape() {\n const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n get catchall() {\n return b._zod.def.catchall;\n },\n checks: b._zod.def.checks ?? [],\n });\n return clone(a, def);\n}\nexport function partial(Class, schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".partial() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in oldShape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n else {\n for (const key in oldShape) {\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function required(Class, schema, mask) {\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n else {\n for (const key in oldShape) {\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n });\n return clone(schema, def);\n}\n// invalid_type | too_big | too_small | invalid_format | not_multiple_of | unrecognized_keys | invalid_union | invalid_key | invalid_element | invalid_value | custom\nexport function aborted(x, startIndex = 0) {\n if (x.aborted === true)\n return true;\n for (let i = startIndex; i < x.issues.length; i++) {\n if (x.issues[i]?.continue !== true) {\n return true;\n }\n }\n return false;\n}\n// Checks for explicit abort (continue === false), as opposed to implicit abort (continue === undefined).\n// Used to respect `abort: true` in .refine() even for checks that have a `when` function.\nexport function explicitlyAborted(x, startIndex = 0) {\n if (x.aborted === true)\n return true;\n for (let i = startIndex; i < x.issues.length; i++) {\n if (x.issues[i]?.continue === false) {\n return true;\n }\n }\n return false;\n}\nexport function prefixIssues(path, issues) {\n return issues.map((iss) => {\n var _a;\n (_a = iss).path ?? (_a.path = []);\n iss.path.unshift(path);\n return iss;\n });\n}\nexport function unwrapMessage(message) {\n return typeof message === \"string\" ? message : message?.message;\n}\nexport function finalizeIssue(iss, ctx, config) {\n const message = iss.message\n ? iss.message\n : (unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??\n unwrapMessage(ctx?.error?.(iss)) ??\n unwrapMessage(config.customError?.(iss)) ??\n unwrapMessage(config.localeError?.(iss)) ??\n \"Invalid input\");\n const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;\n rest.path ?? (rest.path = []);\n rest.message = message;\n if (ctx?.reportInput) {\n rest.input = _input;\n }\n return rest;\n}\nexport function getSizableOrigin(input) {\n if (input instanceof Set)\n return \"set\";\n if (input instanceof Map)\n return \"map\";\n // @ts-ignore\n if (input instanceof File)\n return \"file\";\n return \"unknown\";\n}\nexport function getLengthableOrigin(input) {\n if (Array.isArray(input))\n return \"array\";\n if (typeof input === \"string\")\n return \"string\";\n return \"unknown\";\n}\nexport function parsedType(data) {\n const t = typeof data;\n switch (t) {\n case \"number\": {\n return Number.isNaN(data) ? \"nan\" : \"number\";\n }\n case \"object\": {\n if (data === null) {\n return \"null\";\n }\n if (Array.isArray(data)) {\n return \"array\";\n }\n const obj = data;\n if (obj && Object.getPrototypeOf(obj) !== Object.prototype && \"constructor\" in obj && obj.constructor) {\n return obj.constructor.name;\n }\n }\n }\n return t;\n}\nexport function issue(...args) {\n const [iss, input, inst] = args;\n if (typeof iss === \"string\") {\n return {\n message: iss,\n code: \"custom\",\n input,\n inst,\n };\n }\n return { ...iss };\n}\nexport function cleanEnum(obj) {\n return Object.entries(obj)\n .filter(([k, _]) => {\n // return true if NaN, meaning it's not a number, thus a string key\n return Number.isNaN(Number.parseInt(k, 10));\n })\n .map((el) => el[1]);\n}\n// Codec utility functions\nexport function base64ToUint8Array(base64) {\n const binaryString = atob(base64);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes;\n}\nexport function uint8ArrayToBase64(bytes) {\n let binaryString = \"\";\n for (let i = 0; i < bytes.length; i++) {\n binaryString += String.fromCharCode(bytes[i]);\n }\n return btoa(binaryString);\n}\nexport function base64urlToUint8Array(base64url) {\n const base64 = base64url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padding = \"=\".repeat((4 - (base64.length % 4)) % 4);\n return base64ToUint8Array(base64 + padding);\n}\nexport function uint8ArrayToBase64url(bytes) {\n return uint8ArrayToBase64(bytes).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=/g, \"\");\n}\nexport function hexToUint8Array(hex) {\n const cleanHex = hex.replace(/^0x/, \"\");\n if (cleanHex.length % 2 !== 0) {\n throw new Error(\"Invalid hex string length\");\n }\n const bytes = new Uint8Array(cleanHex.length / 2);\n for (let i = 0; i < cleanHex.length; i += 2) {\n bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);\n }\n return bytes;\n}\nexport function uint8ArrayToHex(bytes) {\n return Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n// instanceof\nexport class Class {\n constructor(..._args) { }\n}\n","import { $constructor } from \"./core.js\";\nimport * as util from \"./util.js\";\nconst initializer = (inst, def) => {\n inst.name = \"$ZodError\";\n Object.defineProperty(inst, \"_zod\", {\n value: inst._zod,\n enumerable: false,\n });\n Object.defineProperty(inst, \"issues\", {\n value: def,\n enumerable: false,\n });\n inst.message = JSON.stringify(def, util.jsonStringifyReplacer, 2);\n Object.defineProperty(inst, \"toString\", {\n value: () => inst.message,\n enumerable: false,\n });\n};\nexport const $ZodError = $constructor(\"$ZodError\", initializer);\nexport const $ZodRealError = $constructor(\"$ZodError\", initializer, { Parent: Error });\nexport function flattenError(error, mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of error.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n}\nexport function formatError(error, mapper = (issue) => issue.message) {\n const fieldErrors = { _errors: [] };\n const processError = (error, path = []) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n }\n };\n processError(error);\n return fieldErrors;\n}\nexport function treeifyError(error, mapper = (issue) => issue.message) {\n const result = { errors: [] };\n const processError = (error, path = []) => {\n var _a, _b;\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n // regular union error\n issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n result.errors.push(mapper(issue));\n continue;\n }\n let curr = result;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n if (typeof el === \"string\") {\n curr.properties ?? (curr.properties = {});\n (_a = curr.properties)[el] ?? (_a[el] = { errors: [] });\n curr = curr.properties[el];\n }\n else {\n curr.items ?? (curr.items = []);\n (_b = curr.items)[el] ?? (_b[el] = { errors: [] });\n curr = curr.items[el];\n }\n if (terminal) {\n curr.errors.push(mapper(issue));\n }\n i++;\n }\n }\n }\n };\n processError(error);\n return result;\n}\n/** Format a ZodError as a human-readable string in the following form.\n *\n * From\n *\n * ```ts\n * ZodError {\n * issues: [\n * {\n * expected: 'string',\n * code: 'invalid_type',\n * path: [ 'username' ],\n * message: 'Invalid input: expected string'\n * },\n * {\n * expected: 'number',\n * code: 'invalid_type',\n * path: [ 'favoriteNumbers', 1 ],\n * message: 'Invalid input: expected number'\n * }\n * ];\n * }\n * ```\n *\n * to\n *\n * ```\n * username\n * ✖ Expected number, received string at \"username\n * favoriteNumbers[0]\n * ✖ Invalid input: expected number\n * ```\n */\nexport function toDotPath(_path) {\n const segs = [];\n const path = _path.map((seg) => (typeof seg === \"object\" ? seg.key : seg));\n for (const seg of path) {\n if (typeof seg === \"number\")\n segs.push(`[${seg}]`);\n else if (typeof seg === \"symbol\")\n segs.push(`[${JSON.stringify(String(seg))}]`);\n else if (/[^\\w$]/.test(seg))\n segs.push(`[${JSON.stringify(seg)}]`);\n else {\n if (segs.length)\n segs.push(\".\");\n segs.push(seg);\n }\n }\n return segs.join(\"\");\n}\nexport function prettifyError(error) {\n const lines = [];\n // sort by path length\n const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);\n // Process each issue\n for (const issue of issues) {\n lines.push(`✖ ${issue.message}`);\n if (issue.path?.length)\n lines.push(` → at ${toDotPath(issue.path)}`);\n }\n // Convert Map to formatted string\n return lines.join(\"\\n\");\n}\n","import * as core from \"./core.js\";\nimport * as errors from \"./errors.js\";\nimport * as util from \"./util.js\";\nexport const _parse = (_Err) => (schema, value, _ctx, _params) => {\n const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n if (result.issues.length) {\n const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, _params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);\nexport const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {\n const ctx = _ctx ? { ..._ctx, async: true } : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n if (result.issues.length) {\n const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);\nexport const _safeParse = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n return result.issues.length\n ? {\n success: false,\n error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);\nexport const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, async: true } : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n return result.issues.length\n ? {\n success: false,\n error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);\nexport const _encode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n return _parse(_Err)(schema, value, ctx);\n};\nexport const encode = /* @__PURE__*/ _encode(errors.$ZodRealError);\nexport const _decode = (_Err) => (schema, value, _ctx) => {\n return _parse(_Err)(schema, value, _ctx);\n};\nexport const decode = /* @__PURE__*/ _decode(errors.$ZodRealError);\nexport const _encodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n return _parseAsync(_Err)(schema, value, ctx);\n};\nexport const encodeAsync = /* @__PURE__*/ _encodeAsync(errors.$ZodRealError);\nexport const _decodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _parseAsync(_Err)(schema, value, _ctx);\n};\nexport const decodeAsync = /* @__PURE__*/ _decodeAsync(errors.$ZodRealError);\nexport const _safeEncode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n return _safeParse(_Err)(schema, value, ctx);\n};\nexport const safeEncode = /* @__PURE__*/ _safeEncode(errors.$ZodRealError);\nexport const _safeDecode = (_Err) => (schema, value, _ctx) => {\n return _safeParse(_Err)(schema, value, _ctx);\n};\nexport const safeDecode = /* @__PURE__*/ _safeDecode(errors.$ZodRealError);\nexport const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n return _safeParseAsync(_Err)(schema, value, ctx);\n};\nexport const safeEncodeAsync = /* @__PURE__*/ _safeEncodeAsync(errors.$ZodRealError);\nexport const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _safeParseAsync(_Err)(schema, value, _ctx);\n};\nexport const safeDecodeAsync = /* @__PURE__*/ _safeDecodeAsync(errors.$ZodRealError);\n","import * as util from \"./util.js\";\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link cuid2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport const cuid = /^[cC][0-9a-z]{6,}$/;\nexport const cuid2 = /^[0-9a-z]+$/;\nexport const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;\nexport const xid = /^[0-9a-vA-V]{20}$/;\nexport const ksuid = /^[A-Za-z0-9]{27}$/;\nexport const nanoid = /^[a-zA-Z0-9_-]{21}$/;\n/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */\nexport const duration = /^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/;\n/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */\nexport const extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */\nexport const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;\n/** Returns a regex for validating an RFC 9562/4122 UUID.\n *\n * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */\nexport const uuid = (version) => {\n if (!version)\n return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;\n return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);\n};\nexport const uuid4 = /*@__PURE__*/ uuid(4);\nexport const uuid6 = /*@__PURE__*/ uuid(6);\nexport const uuid7 = /*@__PURE__*/ uuid(7);\n/** Practical email validation */\nexport const email = /^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/;\n/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */\nexport const html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n/** The classic emailregex.com regex for RFC 5322-compliant emails */\nexport const rfc5322Email = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */\nexport const unicodeEmail = /^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u;\nexport const idnEmail = unicodeEmail;\nexport const browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emoji = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nexport function emoji() {\n return new RegExp(_emoji, \"u\");\n}\nexport const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nexport const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;\nexport const mac = (delimiter) => {\n const escapedDelim = util.escapeRegex(delimiter ?? \":\");\n return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);\n};\nexport const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$/;\nexport const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nexport const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;\nexport const base64url = /^[A-Za-z0-9_-]*$/;\n// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address\n// export const hostname: RegExp = /^([a-zA-Z0-9-]+\\.)*[a-zA-Z0-9-]+$/;\nexport const hostname = /^(?=.{1,253}\\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\\.?$/;\nexport const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/;\nexport const httpProtocol = /^https?$/;\n// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)\n// E.164: leading digit must be 1-9; total digits (excluding '+') between 7-15\nexport const e164 = /^\\+[1-9]\\d{6,14}$/;\n// const dateSource = `((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))`;\nconst dateSource = `(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))`;\nexport const date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);\nfunction timeSource(args) {\n const hhmm = `(?:[01]\\\\d|2[0-3]):[0-5]\\\\d`;\n const regex = typeof args.precision === \"number\"\n ? args.precision === -1\n ? `${hhmm}`\n : args.precision === 0\n ? `${hhmm}:[0-5]\\\\d`\n : `${hhmm}:[0-5]\\\\d\\\\.\\\\d{${args.precision}}`\n : `${hhmm}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`;\n return regex;\n}\nexport function time(args) {\n return new RegExp(`^${timeSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetime(args) {\n const time = timeSource({ precision: args.precision });\n const opts = [\"Z\"];\n if (args.local)\n opts.push(\"\");\n // if (args.offset) opts.push(`([+-]\\\\d{2}:\\\\d{2})`);\n if (args.offset)\n opts.push(`([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)`);\n const timeRegex = `${time}(?:${opts.join(\"|\")})`;\n return new RegExp(`^${dateSource}T(?:${timeRegex})$`);\n}\nexport const string = (params) => {\n const regex = params ? `[\\\\s\\\\S]{${params?.minimum ?? 0},${params?.maximum ?? \"\"}}` : `[\\\\s\\\\S]*`;\n return new RegExp(`^${regex}$`);\n};\nexport const bigint = /^-?\\d+n?$/;\nexport const integer = /^-?\\d+$/;\nexport const number = /^-?\\d+(?:\\.\\d+)?$/;\nexport const boolean = /^(?:true|false)$/i;\nconst _null = /^null$/i;\nexport { _null as null };\nconst _undefined = /^undefined$/i;\nexport { _undefined as undefined };\n// regex for string with no uppercase letters\nexport const lowercase = /^[^A-Z]*$/;\n// regex for string with no lowercase letters\nexport const uppercase = /^[^a-z]*$/;\n// regex for hexadecimal strings (any length)\nexport const hex = /^[0-9a-fA-F]*$/;\n// Hash regexes for different algorithms and encodings\n// Helper function to create base64 regex with exact length and padding\nfunction fixedBase64(bodyLength, padding) {\n return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`);\n}\n// Helper function to create base64url regex with exact length (no padding)\nfunction fixedBase64url(length) {\n return new RegExp(`^[A-Za-z0-9_-]{${length}}$`);\n}\n// MD5 (16 bytes): base64 = 24 chars total (22 + \"==\")\nexport const md5_hex = /^[0-9a-fA-F]{32}$/;\nexport const md5_base64 = /*@__PURE__*/ fixedBase64(22, \"==\");\nexport const md5_base64url = /*@__PURE__*/ fixedBase64url(22);\n// SHA1 (20 bytes): base64 = 28 chars total (27 + \"=\")\nexport const sha1_hex = /^[0-9a-fA-F]{40}$/;\nexport const sha1_base64 = /*@__PURE__*/ fixedBase64(27, \"=\");\nexport const sha1_base64url = /*@__PURE__*/ fixedBase64url(27);\n// SHA256 (32 bytes): base64 = 44 chars total (43 + \"=\")\nexport const sha256_hex = /^[0-9a-fA-F]{64}$/;\nexport const sha256_base64 = /*@__PURE__*/ fixedBase64(43, \"=\");\nexport const sha256_base64url = /*@__PURE__*/ fixedBase64url(43);\n// SHA384 (48 bytes): base64 = 64 chars total (no padding)\nexport const sha384_hex = /^[0-9a-fA-F]{96}$/;\nexport const sha384_base64 = /*@__PURE__*/ fixedBase64(64, \"\");\nexport const sha384_base64url = /*@__PURE__*/ fixedBase64url(64);\n// SHA512 (64 bytes): base64 = 88 chars total (86 + \"==\")\nexport const sha512_hex = /^[0-9a-fA-F]{128}$/;\nexport const sha512_base64 = /*@__PURE__*/ fixedBase64(86, \"==\");\nexport const sha512_base64url = /*@__PURE__*/ fixedBase64url(86);\n","// import { $ZodType } from \"./schemas.js\";\nimport * as core from \"./core.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nexport const $ZodCheck = /*@__PURE__*/ core.$constructor(\"$ZodCheck\", (inst, def) => {\n var _a;\n inst._zod ?? (inst._zod = {});\n inst._zod.def = def;\n (_a = inst._zod).onattach ?? (_a.onattach = []);\n});\nconst numericOriginMap = {\n number: \"number\",\n bigint: \"bigint\",\n object: \"date\",\n};\nexport const $ZodCheckLessThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckLessThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;\n if (def.value < curr) {\n if (def.inclusive)\n bag.maximum = def.value;\n else\n bag.exclusiveMaximum = def.value;\n }\n });\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {\n return;\n }\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckGreaterThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckGreaterThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;\n if (def.value > curr) {\n if (def.inclusive)\n bag.minimum = def.value;\n else\n bag.exclusiveMinimum = def.value;\n }\n });\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {\n return;\n }\n payload.issues.push({\n origin,\n code: \"too_small\",\n minimum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMultipleOf = \n/*@__PURE__*/ core.$constructor(\"$ZodCheckMultipleOf\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.onattach.push((inst) => {\n var _a;\n (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);\n });\n inst._zod.check = (payload) => {\n if (typeof payload.value !== typeof def.value)\n throw new Error(\"Cannot mix number and bigint in multiple_of check.\");\n const isMultiple = typeof payload.value === \"bigint\"\n ? payload.value % def.value === BigInt(0)\n : util.floatSafeRemainder(payload.value, def.value) === 0;\n if (isMultiple)\n return;\n payload.issues.push({\n origin: typeof payload.value,\n code: \"not_multiple_of\",\n divisor: def.value,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckNumberFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n def.format = def.format || \"float64\";\n const isInt = def.format?.includes(\"int\");\n const origin = isInt ? \"int\" : \"number\";\n const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n bag.minimum = minimum;\n bag.maximum = maximum;\n if (isInt)\n bag.pattern = regexes.integer;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (isInt) {\n if (!Number.isInteger(input)) {\n // invalid_format issue\n // payload.issues.push({\n // expected: def.format,\n // format: def.format,\n // code: \"invalid_format\",\n // input,\n // inst,\n // });\n // invalid_type issue\n payload.issues.push({\n expected: origin,\n format: def.format,\n code: \"invalid_type\",\n continue: false,\n input,\n inst,\n });\n return;\n // not_multiple_of issue\n // payload.issues.push({\n // code: \"not_multiple_of\",\n // origin: \"number\",\n // input,\n // inst,\n // divisor: 1,\n // });\n }\n if (!Number.isSafeInteger(input)) {\n if (input > 0) {\n // too_big\n payload.issues.push({\n input,\n code: \"too_big\",\n maximum: Number.MAX_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n else {\n // too_small\n payload.issues.push({\n input,\n code: \"too_small\",\n minimum: Number.MIN_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n return;\n }\n }\n if (input < minimum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_small\",\n minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckBigIntFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n bag.minimum = minimum;\n bag.maximum = maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (input < minimum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_small\",\n minimum: minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckMaxSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);\n if (def.maximum < curr)\n inst._zod.bag.maximum = def.maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size <= def.maximum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);\n if (def.minimum > curr)\n inst._zod.bag.minimum = def.minimum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size >= def.minimum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckSizeEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckSizeEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.minimum = def.size;\n bag.maximum = def.size;\n bag.size = def.size;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size === def.size)\n return;\n const tooBig = size > def.size;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n ...(tooBig ? { code: \"too_big\", maximum: def.size } : { code: \"too_small\", minimum: def.size }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMaxLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);\n if (def.maximum < curr)\n inst._zod.bag.maximum = def.maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length <= def.maximum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);\n if (def.minimum > curr)\n inst._zod.bag.minimum = def.minimum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length >= def.minimum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLengthEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckLengthEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.minimum = def.length;\n bag.maximum = def.length;\n bag.length = def.length;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length === def.length)\n return;\n const origin = util.getLengthableOrigin(input);\n const tooBig = length > def.length;\n payload.issues.push({\n origin,\n ...(tooBig ? { code: \"too_big\", maximum: def.length } : { code: \"too_small\", minimum: def.length }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckStringFormat\", (inst, def) => {\n var _a, _b;\n $ZodCheck.init(inst, def);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n if (def.pattern) {\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(def.pattern);\n }\n });\n if (def.pattern)\n (_a = inst._zod).check ?? (_a.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n ...(def.pattern ? { pattern: def.pattern.toString() } : {}),\n inst,\n continue: !def.abort,\n });\n });\n else\n (_b = inst._zod).check ?? (_b.check = () => { });\n});\nexport const $ZodCheckRegex = /*@__PURE__*/ core.$constructor(\"$ZodCheckRegex\", (inst, def) => {\n $ZodCheckStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"regex\",\n input: payload.value,\n pattern: def.pattern.toString(),\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLowerCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckLowerCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.lowercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckUpperCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckUpperCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.uppercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckIncludes = /*@__PURE__*/ core.$constructor(\"$ZodCheckIncludes\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const escapedRegex = util.escapeRegex(def.includes);\n const pattern = new RegExp(typeof def.position === \"number\" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);\n def.pattern = pattern;\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.includes(def.includes, def.position))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"includes\",\n includes: def.includes,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStartsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckStartsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.startsWith(def.prefix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"starts_with\",\n prefix: def.prefix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckEndsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckEndsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.endsWith(def.suffix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"ends_with\",\n suffix: def.suffix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n///////////////////////////////////\n///// $ZodCheckProperty /////\n///////////////////////////////////\nfunction handleCheckPropertyResult(result, payload, property) {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(property, result.issues));\n }\n}\nexport const $ZodCheckProperty = /*@__PURE__*/ core.$constructor(\"$ZodCheckProperty\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n const result = def.schema._zod.run({\n value: payload.value[def.property],\n issues: [],\n }, {});\n if (result instanceof Promise) {\n return result.then((result) => handleCheckPropertyResult(result, payload, def.property));\n }\n handleCheckPropertyResult(result, payload, def.property);\n return;\n };\n});\nexport const $ZodCheckMimeType = /*@__PURE__*/ core.$constructor(\"$ZodCheckMimeType\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const mimeSet = new Set(def.mime);\n inst._zod.onattach.push((inst) => {\n inst._zod.bag.mime = def.mime;\n });\n inst._zod.check = (payload) => {\n if (mimeSet.has(payload.value.type))\n return;\n payload.issues.push({\n code: \"invalid_value\",\n values: def.mime,\n input: payload.value.type,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckOverwrite = /*@__PURE__*/ core.$constructor(\"$ZodCheckOverwrite\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n payload.value = def.tx(payload.value);\n };\n});\n","export class Doc {\n constructor(args = []) {\n this.content = [];\n this.indent = 0;\n if (this)\n this.args = args;\n }\n indented(fn) {\n this.indent += 1;\n fn(this);\n this.indent -= 1;\n }\n write(arg) {\n if (typeof arg === \"function\") {\n arg(this, { execution: \"sync\" });\n arg(this, { execution: \"async\" });\n return;\n }\n const content = arg;\n const lines = content.split(\"\\n\").filter((x) => x);\n const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));\n const dedented = lines.map((x) => x.slice(minIndent)).map((x) => \" \".repeat(this.indent * 2) + x);\n for (const line of dedented) {\n this.content.push(line);\n }\n }\n compile() {\n const F = Function;\n const args = this?.args;\n const content = this?.content ?? [``];\n const lines = [...content.map((x) => ` ${x}`)];\n // console.log(lines.join(\"\\n\"));\n return new F(...args, lines.join(\"\\n\"));\n }\n}\n","export const version = {\n major: 4,\n minor: 4,\n patch: 3,\n};\n","import * as checks from \"./checks.js\";\nimport * as core from \"./core.js\";\nimport { Doc } from \"./doc.js\";\nimport { parse, parseAsync, safeParse, safeParseAsync } from \"./parse.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nimport { version } from \"./versions.js\";\nexport const $ZodType = /*@__PURE__*/ core.$constructor(\"$ZodType\", (inst, def) => {\n var _a;\n inst ?? (inst = {});\n inst._zod.def = def; // set _def property\n inst._zod.bag = inst._zod.bag || {}; // initialize _bag object\n inst._zod.version = version;\n const checks = [...(inst._zod.def.checks ?? [])];\n // if inst is itself a checks.$ZodCheck, run it as a check\n if (inst._zod.traits.has(\"$ZodCheck\")) {\n checks.unshift(inst);\n }\n for (const ch of checks) {\n for (const fn of ch._zod.onattach) {\n fn(inst);\n }\n }\n if (checks.length === 0) {\n // deferred initializer\n // inst._zod.parse is not yet defined\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred?.push(() => {\n inst._zod.run = inst._zod.parse;\n });\n }\n else {\n const runChecks = (payload, checks, ctx) => {\n let isAborted = util.aborted(payload);\n let asyncResult;\n for (const ch of checks) {\n if (ch._zod.def.when) {\n if (util.explicitlyAborted(payload))\n continue;\n const shouldRun = ch._zod.def.when(payload);\n if (!shouldRun)\n continue;\n }\n else if (isAborted) {\n continue;\n }\n const currLen = payload.issues.length;\n const _ = ch._zod.check(payload);\n if (_ instanceof Promise && ctx?.async === false) {\n throw new core.$ZodAsyncError();\n }\n if (asyncResult || _ instanceof Promise) {\n asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {\n await _;\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n return;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n });\n }\n else {\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n continue;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n }\n }\n if (asyncResult) {\n return asyncResult.then(() => {\n return payload;\n });\n }\n return payload;\n };\n const handleCanaryResult = (canary, payload, ctx) => {\n // abort if the canary is aborted\n if (util.aborted(canary)) {\n canary.aborted = true;\n return canary;\n }\n // run checks first, then\n const checkResult = runChecks(payload, checks, ctx);\n if (checkResult instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));\n }\n return inst._zod.parse(checkResult, ctx);\n };\n inst._zod.run = (payload, ctx) => {\n if (ctx.skipChecks) {\n return inst._zod.parse(payload, ctx);\n }\n if (ctx.direction === \"backward\") {\n // run canary\n // initial pass (no checks)\n const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });\n if (canary instanceof Promise) {\n return canary.then((canary) => {\n return handleCanaryResult(canary, payload, ctx);\n });\n }\n return handleCanaryResult(canary, payload, ctx);\n }\n // forward\n const result = inst._zod.parse(payload, ctx);\n if (result instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return result.then((result) => runChecks(result, checks, ctx));\n }\n return runChecks(result, checks, ctx);\n };\n }\n // Lazy initialize ~standard to avoid creating objects for every schema\n util.defineLazy(inst, \"~standard\", () => ({\n validate: (value) => {\n try {\n const r = safeParse(inst, value);\n return r.success ? { value: r.data } : { issues: r.error?.issues };\n }\n catch (_) {\n return safeParseAsync(inst, value).then((r) => (r.success ? { value: r.data } : { issues: r.error?.issues }));\n }\n },\n vendor: \"zod\",\n version: 1,\n }));\n});\nexport { clone } from \"./util.js\";\nexport const $ZodString = /*@__PURE__*/ core.$constructor(\"$ZodString\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);\n inst._zod.parse = (payload, _) => {\n if (def.coerce)\n try {\n payload.value = String(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"string\")\n return payload;\n payload.issues.push({\n expected: \"string\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodStringFormat\", (inst, def) => {\n // check initialization must come first\n checks.$ZodCheckStringFormat.init(inst, def);\n $ZodString.init(inst, def);\n});\nexport const $ZodGUID = /*@__PURE__*/ core.$constructor(\"$ZodGUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.guid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodUUID = /*@__PURE__*/ core.$constructor(\"$ZodUUID\", (inst, def) => {\n if (def.version) {\n const versionMap = {\n v1: 1,\n v2: 2,\n v3: 3,\n v4: 4,\n v5: 5,\n v6: 6,\n v7: 7,\n v8: 8,\n };\n const v = versionMap[def.version];\n if (v === undefined)\n throw new Error(`Invalid UUID version: \"${def.version}\"`);\n def.pattern ?? (def.pattern = regexes.uuid(v));\n }\n else\n def.pattern ?? (def.pattern = regexes.uuid());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodEmail = /*@__PURE__*/ core.$constructor(\"$ZodEmail\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.email);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodURL = /*@__PURE__*/ core.$constructor(\"$ZodURL\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n try {\n // Trim whitespace from input\n const trimmed = payload.value.trim();\n // When normalize is off, require :// for http/https URLs\n // This prevents strings like \"http:example.com\" or \"https:/path\" from being silently accepted\n if (!def.normalize && def.protocol?.source === regexes.httpProtocol.source) {\n if (!/^https?:\\/\\//i.test(trimmed)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid URL format\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n return;\n }\n }\n // @ts-ignore\n const url = new URL(trimmed);\n if (def.hostname) {\n def.hostname.lastIndex = 0;\n if (!def.hostname.test(url.hostname)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid hostname\",\n pattern: def.hostname.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n }\n if (def.protocol) {\n def.protocol.lastIndex = 0;\n if (!def.protocol.test(url.protocol.endsWith(\":\") ? url.protocol.slice(0, -1) : url.protocol)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid protocol\",\n pattern: def.protocol.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n }\n // Set the output value based on normalize flag\n if (def.normalize) {\n // Use normalized URL\n payload.value = url.href;\n }\n else {\n // Preserve the original input (trimmed)\n payload.value = trimmed;\n }\n return;\n }\n catch (_) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodEmoji = /*@__PURE__*/ core.$constructor(\"$ZodEmoji\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.emoji());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodNanoID = /*@__PURE__*/ core.$constructor(\"$ZodNanoID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.nanoid);\n $ZodStringFormat.init(inst, def);\n});\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport const $ZodCUID = /*@__PURE__*/ core.$constructor(\"$ZodCUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID2 = /*@__PURE__*/ core.$constructor(\"$ZodCUID2\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid2);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodULID = /*@__PURE__*/ core.$constructor(\"$ZodULID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ulid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodXID = /*@__PURE__*/ core.$constructor(\"$ZodXID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.xid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodKSUID = /*@__PURE__*/ core.$constructor(\"$ZodKSUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ksuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODateTime = /*@__PURE__*/ core.$constructor(\"$ZodISODateTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.datetime(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODate = /*@__PURE__*/ core.$constructor(\"$ZodISODate\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.date);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISOTime = /*@__PURE__*/ core.$constructor(\"$ZodISOTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.time(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODuration = /*@__PURE__*/ core.$constructor(\"$ZodISODuration\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.duration);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodIPv4 = /*@__PURE__*/ core.$constructor(\"$ZodIPv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv4);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `ipv4`;\n});\nexport const $ZodIPv6 = /*@__PURE__*/ core.$constructor(\"$ZodIPv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv6);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `ipv6`;\n inst._zod.check = (payload) => {\n try {\n // @ts-ignore\n new URL(`http://[${payload.value}]`);\n // return;\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"ipv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodMAC = /*@__PURE__*/ core.$constructor(\"$ZodMAC\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.mac(def.delimiter));\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `mac`;\n});\nexport const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv4);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n const parts = payload.value.split(\"/\");\n try {\n if (parts.length !== 2)\n throw new Error();\n const [address, prefix] = parts;\n if (!prefix)\n throw new Error();\n const prefixNum = Number(prefix);\n if (`${prefixNum}` !== prefix)\n throw new Error();\n if (prefixNum < 0 || prefixNum > 128)\n throw new Error();\n // @ts-ignore\n new URL(`http://[${address}]`);\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"cidrv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64(data) {\n if (data === \"\")\n return true;\n // atob ignores whitespace, so reject it up front.\n if (/\\s/.test(data))\n return false;\n if (data.length % 4 !== 0)\n return false;\n try {\n // @ts-ignore\n atob(data);\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodBase64 = /*@__PURE__*/ core.$constructor(\"$ZodBase64\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.contentEncoding = \"base64\";\n inst._zod.check = (payload) => {\n if (isValidBase64(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64URL(data) {\n if (!regexes.base64url.test(data))\n return false;\n const base64 = data.replace(/[-_]/g, (c) => (c === \"-\" ? \"+\" : \"/\"));\n const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, \"=\");\n return isValidBase64(padded);\n}\nexport const $ZodBase64URL = /*@__PURE__*/ core.$constructor(\"$ZodBase64URL\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64url);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.contentEncoding = \"base64url\";\n inst._zod.check = (payload) => {\n if (isValidBase64URL(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodE164 = /*@__PURE__*/ core.$constructor(\"$ZodE164\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.e164);\n $ZodStringFormat.init(inst, def);\n});\n////////////////////////////// ZodJWT //////////////////////////////\nexport function isValidJWT(token, algorithm = null) {\n try {\n const tokensParts = token.split(\".\");\n if (tokensParts.length !== 3)\n return false;\n const [header] = tokensParts;\n if (!header)\n return false;\n // @ts-ignore\n const parsedHeader = JSON.parse(atob(header));\n if (\"typ\" in parsedHeader && parsedHeader?.typ !== \"JWT\")\n return false;\n if (!parsedHeader.alg)\n return false;\n if (algorithm && (!(\"alg\" in parsedHeader) || parsedHeader.alg !== algorithm))\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodJWT = /*@__PURE__*/ core.$constructor(\"$ZodJWT\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidJWT(payload.value, def.alg))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"jwt\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCustomStringFormat\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (def.fn(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodNumber = /*@__PURE__*/ core.$constructor(\"$ZodNumber\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Number(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"number\" && !Number.isNaN(input) && Number.isFinite(input)) {\n return payload;\n }\n const received = typeof input === \"number\"\n ? Number.isNaN(input)\n ? \"NaN\"\n : !Number.isFinite(input)\n ? \"Infinity\"\n : undefined\n : undefined;\n payload.issues.push({\n expected: \"number\",\n code: \"invalid_type\",\n input,\n inst,\n ...(received ? { received } : {}),\n });\n return payload;\n };\n});\nexport const $ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodNumberFormat\", (inst, def) => {\n checks.$ZodCheckNumberFormat.init(inst, def);\n $ZodNumber.init(inst, def); // no format checks\n});\nexport const $ZodBoolean = /*@__PURE__*/ core.$constructor(\"$ZodBoolean\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.boolean;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Boolean(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"boolean\")\n return payload;\n payload.issues.push({\n expected: \"boolean\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigInt = /*@__PURE__*/ core.$constructor(\"$ZodBigInt\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.bigint;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = BigInt(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"bigint\")\n return payload;\n payload.issues.push({\n expected: \"bigint\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodBigIntFormat\", (inst, def) => {\n checks.$ZodCheckBigIntFormat.init(inst, def);\n $ZodBigInt.init(inst, def); // no format checks\n});\nexport const $ZodSymbol = /*@__PURE__*/ core.$constructor(\"$ZodSymbol\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"symbol\")\n return payload;\n payload.issues.push({\n expected: \"symbol\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodUndefined = /*@__PURE__*/ core.$constructor(\"$ZodUndefined\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.undefined;\n inst._zod.values = new Set([undefined]);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"undefined\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodNull = /*@__PURE__*/ core.$constructor(\"$ZodNull\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.null;\n inst._zod.values = new Set([null]);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (input === null)\n return payload;\n payload.issues.push({\n expected: \"null\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodAny = /*@__PURE__*/ core.$constructor(\"$ZodAny\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodUnknown = /*@__PURE__*/ core.$constructor(\"$ZodUnknown\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodNever = /*@__PURE__*/ core.$constructor(\"$ZodNever\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n payload.issues.push({\n expected: \"never\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodVoid = /*@__PURE__*/ core.$constructor(\"$ZodVoid\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"void\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodDate = /*@__PURE__*/ core.$constructor(\"$ZodDate\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce) {\n try {\n payload.value = new Date(payload.value);\n }\n catch (_err) { }\n }\n const input = payload.value;\n const isDate = input instanceof Date;\n const isValidDate = isDate && !Number.isNaN(input.getTime());\n if (isValidDate)\n return payload;\n payload.issues.push({\n expected: \"date\",\n code: \"invalid_type\",\n input,\n ...(isDate ? { received: \"Invalid Date\" } : {}),\n inst,\n });\n return payload;\n };\n});\nfunction handleArrayResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodArray = /*@__PURE__*/ core.$constructor(\"$ZodArray\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n expected: \"array\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = Array(input.length);\n const proms = [];\n for (let i = 0; i < input.length; i++) {\n const item = input[i];\n const result = def.element._zod.run({\n value: item,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleArrayResult(result, payload, i)));\n }\n else {\n handleArrayResult(result, payload, i);\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload; //handleArrayResultsAsync(parseResults, final);\n };\n});\nfunction handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {\n const isPresent = key in input;\n if (result.issues.length) {\n // For optional-in/out schemas, ignore errors on absent keys.\n if (isOptionalIn && isOptionalOut && !isPresent) {\n return;\n }\n final.issues.push(...util.prefixIssues(key, result.issues));\n }\n if (!isPresent && !isOptionalIn) {\n if (!result.issues.length) {\n final.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: undefined,\n path: [key],\n });\n }\n return;\n }\n if (result.value === undefined) {\n if (isPresent) {\n final.value[key] = undefined;\n }\n }\n else {\n final.value[key] = result.value;\n }\n}\nfunction normalizeDef(def) {\n const keys = Object.keys(def.shape);\n for (const k of keys) {\n if (!def.shape?.[k]?._zod?.traits?.has(\"$ZodType\")) {\n throw new Error(`Invalid element at key \"${k}\": expected a Zod schema`);\n }\n }\n const okeys = util.optionalKeys(def.shape);\n return {\n ...def,\n keys,\n keySet: new Set(keys),\n numKeys: keys.length,\n optionalKeys: new Set(okeys),\n };\n}\nfunction handleCatchall(proms, input, payload, ctx, def, inst) {\n const unrecognized = [];\n const keySet = def.keySet;\n const _catchall = def.catchall._zod;\n const t = _catchall.def.type;\n const isOptionalIn = _catchall.optin === \"optional\";\n const isOptionalOut = _catchall.optout === \"optional\";\n for (const key in input) {\n // skip __proto__ so it can't replace the result prototype via the\n // assignment setter on the plain {} we build into\n if (key === \"__proto__\")\n continue;\n if (keySet.has(key))\n continue;\n if (t === \"never\") {\n unrecognized.push(key);\n continue;\n }\n const r = _catchall.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));\n }\n else {\n handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);\n }\n }\n if (unrecognized.length) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n keys: unrecognized,\n input,\n inst,\n });\n }\n if (!proms.length)\n return payload;\n return Promise.all(proms).then(() => {\n return payload;\n });\n}\nexport const $ZodObject = /*@__PURE__*/ core.$constructor(\"$ZodObject\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodType.init(inst, def);\n // const sh = def.shape;\n const desc = Object.getOwnPropertyDescriptor(def, \"shape\");\n if (!desc?.get) {\n const sh = def.shape;\n Object.defineProperty(def, \"shape\", {\n get: () => {\n const newSh = { ...sh };\n Object.defineProperty(def, \"shape\", {\n value: newSh,\n });\n return newSh;\n },\n });\n }\n const _normalized = util.cached(() => normalizeDef(def));\n util.defineLazy(inst._zod, \"propValues\", () => {\n const shape = def.shape;\n const propValues = {};\n for (const key in shape) {\n const field = shape[key]._zod;\n if (field.values) {\n propValues[key] ?? (propValues[key] = new Set());\n for (const v of field.values)\n propValues[key].add(v);\n }\n }\n return propValues;\n });\n const isObject = util.isObject;\n const catchall = def.catchall;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = {};\n const proms = [];\n const shape = value.shape;\n for (const key of value.keys) {\n const el = shape[key];\n const isOptionalIn = el._zod.optin === \"optional\";\n const isOptionalOut = el._zod.optout === \"optional\";\n const r = el._zod.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));\n }\n else {\n handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);\n }\n }\n if (!catchall) {\n return proms.length ? Promise.all(proms).then(() => payload) : payload;\n }\n return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);\n };\n});\nexport const $ZodObjectJIT = /*@__PURE__*/ core.$constructor(\"$ZodObjectJIT\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodObject.init(inst, def);\n const superParse = inst._zod.parse;\n const _normalized = util.cached(() => normalizeDef(def));\n const generateFastpass = (shape) => {\n const doc = new Doc([\"shape\", \"payload\", \"ctx\"]);\n const normalized = _normalized.value;\n const parseStr = (key) => {\n const k = util.esc(key);\n return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;\n };\n doc.write(`const input = payload.value;`);\n const ids = Object.create(null);\n let counter = 0;\n for (const key of normalized.keys) {\n ids[key] = `key_${counter++}`;\n }\n // A: preserve key order {\n doc.write(`const newResult = {};`);\n for (const key of normalized.keys) {\n const id = ids[key];\n const k = util.esc(key);\n const schema = shape[key];\n const isOptionalIn = schema?._zod?.optin === \"optional\";\n const isOptionalOut = schema?._zod?.optout === \"optional\";\n doc.write(`const ${id} = ${parseStr(key)};`);\n if (isOptionalIn && isOptionalOut) {\n // For optional-in/out schemas, ignore errors on absent keys\n doc.write(`\n if (${id}.issues.length) {\n if (${k} in input) {\n payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}]\n })));\n }\n }\n \n if (${id}.value === undefined) {\n if (${k} in input) {\n newResult[${k}] = undefined;\n }\n } else {\n newResult[${k}] = ${id}.value;\n }\n \n `);\n }\n else if (!isOptionalIn) {\n doc.write(`\n const ${id}_present = ${k} in input;\n if (${id}.issues.length) {\n payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}]\n })));\n }\n if (!${id}_present && !${id}.issues.length) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: undefined,\n path: [${k}]\n });\n }\n\n if (${id}_present) {\n if (${id}.value === undefined) {\n newResult[${k}] = undefined;\n } else {\n newResult[${k}] = ${id}.value;\n }\n }\n\n `);\n }\n else {\n doc.write(`\n if (${id}.issues.length) {\n payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}]\n })));\n }\n \n if (${id}.value === undefined) {\n if (${k} in input) {\n newResult[${k}] = undefined;\n }\n } else {\n newResult[${k}] = ${id}.value;\n }\n \n `);\n }\n }\n doc.write(`payload.value = newResult;`);\n doc.write(`return payload;`);\n const fn = doc.compile();\n return (payload, ctx) => fn(shape, payload, ctx);\n };\n let fastpass;\n const isObject = util.isObject;\n const jit = !core.globalConfig.jitless;\n const allowsEval = util.allowsEval;\n const fastEnabled = jit && allowsEval.value; // && !def.catchall;\n const catchall = def.catchall;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {\n // always synchronous\n if (!fastpass)\n fastpass = generateFastpass(def.shape);\n payload = fastpass(payload, ctx);\n if (!catchall)\n return payload;\n return handleCatchall([], input, payload, ctx, value, inst);\n }\n return superParse(payload, ctx);\n };\n});\nfunction handleUnionResults(results, final, inst, ctx) {\n for (const result of results) {\n if (result.issues.length === 0) {\n final.value = result.value;\n return final;\n }\n }\n const nonaborted = results.filter((r) => !util.aborted(r));\n if (nonaborted.length === 1) {\n final.value = nonaborted[0].value;\n return nonaborted[0];\n }\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n return final;\n}\nexport const $ZodUnion = /*@__PURE__*/ core.$constructor(\"$ZodUnion\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.options.some((o) => o._zod.optin === \"optional\") ? \"optional\" : undefined);\n util.defineLazy(inst._zod, \"optout\", () => def.options.some((o) => o._zod.optout === \"optional\") ? \"optional\" : undefined);\n util.defineLazy(inst._zod, \"values\", () => {\n if (def.options.every((o) => o._zod.values)) {\n return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));\n }\n return undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n if (def.options.every((o) => o._zod.pattern)) {\n const patterns = def.options.map((o) => o._zod.pattern);\n return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join(\"|\")})$`);\n }\n return undefined;\n });\n const first = def.options.length === 1 ? def.options[0]._zod.run : null;\n inst._zod.parse = (payload, ctx) => {\n if (first) {\n return first(payload, ctx);\n }\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n if (result.issues.length === 0)\n return result;\n results.push(result);\n }\n }\n if (!async)\n return handleUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleUnionResults(results, payload, inst, ctx);\n });\n };\n});\nfunction handleExclusiveUnionResults(results, final, inst, ctx) {\n const successes = results.filter((r) => r.issues.length === 0);\n if (successes.length === 1) {\n final.value = successes[0].value;\n return final;\n }\n if (successes.length === 0) {\n // No matches - same as regular union\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n }\n else {\n // Multiple matches - exclusive union failure\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: [],\n inclusive: false,\n });\n }\n return final;\n}\nexport const $ZodXor = /*@__PURE__*/ core.$constructor(\"$ZodXor\", (inst, def) => {\n $ZodUnion.init(inst, def);\n def.inclusive = false;\n const first = def.options.length === 1 ? def.options[0]._zod.run : null;\n inst._zod.parse = (payload, ctx) => {\n if (first) {\n return first(payload, ctx);\n }\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n results.push(result);\n }\n }\n if (!async)\n return handleExclusiveUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleExclusiveUnionResults(results, payload, inst, ctx);\n });\n };\n});\nexport const $ZodDiscriminatedUnion = \n/*@__PURE__*/\ncore.$constructor(\"$ZodDiscriminatedUnion\", (inst, def) => {\n def.inclusive = false;\n $ZodUnion.init(inst, def);\n const _super = inst._zod.parse;\n util.defineLazy(inst._zod, \"propValues\", () => {\n const propValues = {};\n for (const option of def.options) {\n const pv = option._zod.propValues;\n if (!pv || Object.keys(pv).length === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(option)}\"`);\n for (const [k, v] of Object.entries(pv)) {\n if (!propValues[k])\n propValues[k] = new Set();\n for (const val of v) {\n propValues[k].add(val);\n }\n }\n }\n return propValues;\n });\n const disc = util.cached(() => {\n const opts = def.options;\n const map = new Map();\n for (const o of opts) {\n const values = o._zod.propValues?.[def.discriminator];\n if (!values || values.size === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(o)}\"`);\n for (const v of values) {\n if (map.has(v)) {\n throw new Error(`Duplicate discriminator value \"${String(v)}\"`);\n }\n map.set(v, o);\n }\n }\n return map;\n });\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isObject(input)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"object\",\n input,\n inst,\n });\n return payload;\n }\n const opt = disc.value.get(input?.[def.discriminator]);\n if (opt) {\n return opt._zod.run(payload, ctx);\n }\n // Fall back to union matching when the fast discriminator path fails:\n // - explicitly enabled via unionFallback, or\n // - during backward direction (encode), since codec-based discriminators\n // have different values in forward vs backward directions\n if (def.unionFallback || ctx.direction === \"backward\") {\n return _super(payload, ctx);\n }\n // no matching discriminator\n payload.issues.push({\n code: \"invalid_union\",\n errors: [],\n note: \"No matching discriminator\",\n discriminator: def.discriminator,\n options: Array.from(disc.value.keys()),\n input,\n path: [def.discriminator],\n inst,\n });\n return payload;\n };\n});\nexport const $ZodIntersection = /*@__PURE__*/ core.$constructor(\"$ZodIntersection\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n const left = def.left._zod.run({ value: input, issues: [] }, ctx);\n const right = def.right._zod.run({ value: input, issues: [] }, ctx);\n const async = left instanceof Promise || right instanceof Promise;\n if (async) {\n return Promise.all([left, right]).then(([left, right]) => {\n return handleIntersectionResults(payload, left, right);\n });\n }\n return handleIntersectionResults(payload, left, right);\n };\n});\nfunction mergeValues(a, b) {\n // const aType = parse.t(a);\n // const bType = parse.t(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n if (a instanceof Date && b instanceof Date && +a === +b) {\n return { valid: true, data: a };\n }\n if (util.isPlainObject(a) && util.isPlainObject(b)) {\n const bKeys = Object.keys(b);\n const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [key, ...sharedValue.mergeErrorPath],\n };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return { valid: false, mergeErrorPath: [] };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [index, ...sharedValue.mergeErrorPath],\n };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n return { valid: false, mergeErrorPath: [] };\n}\nfunction handleIntersectionResults(result, left, right) {\n // Track which side(s) report each key as unrecognized\n const unrecKeys = new Map();\n let unrecIssue;\n for (const iss of left.issues) {\n if (iss.code === \"unrecognized_keys\") {\n unrecIssue ?? (unrecIssue = iss);\n for (const k of iss.keys) {\n if (!unrecKeys.has(k))\n unrecKeys.set(k, {});\n unrecKeys.get(k).l = true;\n }\n }\n else {\n result.issues.push(iss);\n }\n }\n for (const iss of right.issues) {\n if (iss.code === \"unrecognized_keys\") {\n for (const k of iss.keys) {\n if (!unrecKeys.has(k))\n unrecKeys.set(k, {});\n unrecKeys.get(k).r = true;\n }\n }\n else {\n result.issues.push(iss);\n }\n }\n // Report only keys unrecognized by BOTH sides\n const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);\n if (bothKeys.length && unrecIssue) {\n result.issues.push({ ...unrecIssue, keys: bothKeys });\n }\n if (util.aborted(result))\n return result;\n const merged = mergeValues(left.value, right.value);\n if (!merged.valid) {\n throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);\n }\n result.value = merged.data;\n return result;\n}\nexport const $ZodTuple = /*@__PURE__*/ core.$constructor(\"$ZodTuple\", (inst, def) => {\n $ZodType.init(inst, def);\n const items = def.items;\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n input,\n inst,\n expected: \"tuple\",\n code: \"invalid_type\",\n });\n return payload;\n }\n payload.value = [];\n const proms = [];\n const optinStart = getTupleOptStart(items, \"optin\");\n const optoutStart = getTupleOptStart(items, \"optout\");\n if (!def.rest) {\n if (input.length < optinStart) {\n payload.issues.push({\n code: \"too_small\",\n minimum: optinStart,\n inclusive: true,\n input,\n inst,\n origin: \"array\",\n });\n return payload;\n }\n if (input.length > items.length) {\n payload.issues.push({\n code: \"too_big\",\n maximum: items.length,\n inclusive: true,\n input,\n inst,\n origin: \"array\",\n });\n }\n }\n // Run every item in parallel, collecting results into an indexed\n // array. The post-processing in `handleTupleResults` walks them in\n // order so it can decide whether an absent optional-output error can\n // truncate the tail or must be reported to preserve required output.\n const itemResults = new Array(items.length);\n for (let i = 0; i < items.length; i++) {\n const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((rr) => {\n itemResults[i] = rr;\n }));\n }\n else {\n itemResults[i] = r;\n }\n }\n if (def.rest) {\n let i = items.length - 1;\n const rest = input.slice(items.length);\n for (const el of rest) {\n i++;\n const result = def.rest._zod.run({ value: el, issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((r) => handleTupleResult(r, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));\n }\n return handleTupleResults(itemResults, payload, items, input, optoutStart);\n };\n});\nfunction getTupleOptStart(items, key) {\n for (let i = items.length - 1; i >= 0; i--) {\n if (items[i]._zod[key] !== \"optional\")\n return i + 1;\n }\n return 0;\n}\nfunction handleTupleResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nfunction handleTupleResults(itemResults, final, items, input, optoutStart) {\n // Walk results in order. Mirror $ZodObject's swallow-on-absent-optional\n // rule, but only after `optoutStart`: the first index where the output\n // tuple tail can be absent.\n for (let i = 0; i < items.length; i++) {\n const r = itemResults[i];\n const isPresent = i < input.length;\n if (r.issues.length) {\n if (!isPresent && i >= optoutStart) {\n final.value.length = i;\n break;\n }\n final.issues.push(...util.prefixIssues(i, r.issues));\n }\n final.value[i] = r.value;\n }\n // Drop trailing slots that produced `undefined` for absent input\n // (the array analog of an absent optional key on an object). The\n // `i >= input.length` floor is critical: an explicit `undefined`\n // *inside* the input must be preserved even when the schema is\n // optional-out (e.g. `z.string().or(z.undefined())` accepting an\n // explicit undefined value).\n for (let i = final.value.length - 1; i >= input.length; i--) {\n if (items[i]._zod.optout === \"optional\" && final.value[i] === undefined) {\n final.value.length = i;\n }\n else {\n break;\n }\n }\n return final;\n}\nexport const $ZodRecord = /*@__PURE__*/ core.$constructor(\"$ZodRecord\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isPlainObject(input)) {\n payload.issues.push({\n expected: \"record\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n const values = def.keyType._zod.values;\n if (values) {\n payload.value = {};\n const recordKeys = new Set();\n for (const key of values) {\n if (typeof key === \"string\" || typeof key === \"number\" || typeof key === \"symbol\") {\n recordKeys.add(typeof key === \"number\" ? key.toString() : key);\n const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n if (keyResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n if (keyResult.issues.length) {\n payload.issues.push({\n code: \"invalid_key\",\n origin: \"record\",\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n input: key,\n path: [key],\n inst,\n });\n continue;\n }\n const outKey = keyResult.value;\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[outKey] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[outKey] = result.value;\n }\n }\n }\n let unrecognized;\n for (const key in input) {\n if (!recordKeys.has(key)) {\n unrecognized = unrecognized ?? [];\n unrecognized.push(key);\n }\n }\n if (unrecognized && unrecognized.length > 0) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n input,\n inst,\n keys: unrecognized,\n });\n }\n }\n else {\n payload.value = {};\n // Reflect.ownKeys for Symbol-key support; filter non-enumerable to match z.object()\n for (const key of Reflect.ownKeys(input)) {\n if (key === \"__proto__\")\n continue;\n if (!Object.prototype.propertyIsEnumerable.call(input, key))\n continue;\n let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n if (keyResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n // Numeric string fallback: if key is a numeric string and failed, retry with Number(key)\n // This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals\n const checkNumericKey = typeof key === \"string\" && regexes.number.test(key) && keyResult.issues.length;\n if (checkNumericKey) {\n const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);\n if (retryResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n if (retryResult.issues.length === 0) {\n keyResult = retryResult;\n }\n }\n if (keyResult.issues.length) {\n if (def.mode === \"loose\") {\n // Pass through unchanged\n payload.value[key] = input[key];\n }\n else {\n // Default \"strict\" behavior: error on invalid key\n payload.issues.push({\n code: \"invalid_key\",\n origin: \"record\",\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n input: key,\n path: [key],\n inst,\n });\n }\n continue;\n }\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload;\n };\n});\nexport const $ZodMap = /*@__PURE__*/ core.$constructor(\"$ZodMap\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Map)) {\n payload.issues.push({\n expected: \"map\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n payload.value = new Map();\n for (const [key, value] of input) {\n const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);\n if (keyResult instanceof Promise || valueResult instanceof Promise) {\n proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }));\n }\n else {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {\n if (keyResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, keyResult.issues));\n }\n else {\n final.issues.push({\n code: \"invalid_key\",\n origin: \"map\",\n input,\n inst,\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n if (valueResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, valueResult.issues));\n }\n else {\n final.issues.push({\n origin: \"map\",\n code: \"invalid_element\",\n input,\n inst,\n key: key,\n issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n final.value.set(keyResult.value, valueResult.value);\n}\nexport const $ZodSet = /*@__PURE__*/ core.$constructor(\"$ZodSet\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Set)) {\n payload.issues.push({\n input,\n inst,\n expected: \"set\",\n code: \"invalid_type\",\n });\n return payload;\n }\n const proms = [];\n payload.value = new Set();\n for (const item of input) {\n const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleSetResult(result, payload)));\n }\n else\n handleSetResult(result, payload);\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleSetResult(result, final) {\n if (result.issues.length) {\n final.issues.push(...result.issues);\n }\n final.value.add(result.value);\n}\nexport const $ZodEnum = /*@__PURE__*/ core.$constructor(\"$ZodEnum\", (inst, def) => {\n $ZodType.init(inst, def);\n const values = util.getEnumValues(def.entries);\n const valuesSet = new Set(values);\n inst._zod.values = valuesSet;\n inst._zod.pattern = new RegExp(`^(${values\n .filter((k) => util.propertyKeyTypes.has(typeof k))\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o.toString()))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (valuesSet.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodLiteral = /*@__PURE__*/ core.$constructor(\"$ZodLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n if (def.values.length === 0) {\n throw new Error(\"Cannot create literal schema with no valid values\");\n }\n const values = new Set(def.values);\n inst._zod.values = values;\n inst._zod.pattern = new RegExp(`^(${def.values\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (values.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values: def.values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodFile = /*@__PURE__*/ core.$constructor(\"$ZodFile\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n // @ts-ignore\n if (input instanceof File)\n return payload;\n payload.issues.push({\n expected: \"file\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodTransform = /*@__PURE__*/ core.$constructor(\"$ZodTransform\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(inst.constructor.name);\n }\n const _out = def.transform(payload.value, payload);\n if (ctx.async) {\n const output = _out instanceof Promise ? _out : Promise.resolve(_out);\n return output.then((output) => {\n payload.value = output;\n payload.fallback = true;\n return payload;\n });\n }\n if (_out instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n payload.value = _out;\n payload.fallback = true;\n return payload;\n };\n});\nfunction handleOptionalResult(result, input) {\n if (input === undefined && (result.issues.length || result.fallback)) {\n return { issues: [], value: undefined };\n }\n return result;\n}\nexport const $ZodOptional = /*@__PURE__*/ core.$constructor(\"$ZodOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n inst._zod.optout = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n if (def.innerType._zod.optin === \"optional\") {\n const input = payload.value;\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise)\n return result.then((r) => handleOptionalResult(r, input));\n return handleOptionalResult(result, input);\n }\n if (payload.value === undefined) {\n return payload;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodExactOptional = /*@__PURE__*/ core.$constructor(\"$ZodExactOptional\", (inst, def) => {\n // Call parent init - inherits optin/optout = \"optional\"\n $ZodOptional.init(inst, def);\n // Override values/pattern to NOT add undefined\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n util.defineLazy(inst._zod, \"pattern\", () => def.innerType._zod.pattern);\n // Override parse to just delegate (no undefined handling)\n inst._zod.parse = (payload, ctx) => {\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNullable = /*@__PURE__*/ core.$constructor(\"$ZodNullable\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;\n });\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n // Forward direction (decode): allow null to pass through\n if (payload.value === null)\n return payload;\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodDefault = /*@__PURE__*/ core.$constructor(\"$ZodDefault\", (inst, def) => {\n $ZodType.init(inst, def);\n // inst._zod.qin = \"true\";\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply defaults for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n /**\n * $ZodDefault returns the default value immediately in forward direction.\n * It doesn't pass the default value into the validator (\"prefault\"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a \"prefault\" for the pipe. */\n return payload;\n }\n // Forward direction: continue with default handling\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleDefaultResult(result, def));\n }\n return handleDefaultResult(result, def);\n };\n});\nfunction handleDefaultResult(payload, def) {\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return payload;\n}\nexport const $ZodPrefault = /*@__PURE__*/ core.$constructor(\"$ZodPrefault\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply prefault for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNonOptional = /*@__PURE__*/ core.$constructor(\"$ZodNonOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => {\n const v = def.innerType._zod.values;\n return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleNonOptionalResult(result, inst));\n }\n return handleNonOptionalResult(result, inst);\n };\n});\nfunction handleNonOptionalResult(payload, inst) {\n if (!payload.issues.length && payload.value === undefined) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: payload.value,\n inst,\n });\n }\n return payload;\n}\nexport const $ZodSuccess = /*@__PURE__*/ core.$constructor(\"$ZodSuccess\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(\"ZodSuccess\");\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.issues.length === 0;\n return payload;\n });\n }\n payload.value = result.issues.length === 0;\n return payload;\n };\n});\nexport const $ZodCatch = /*@__PURE__*/ core.$constructor(\"$ZodCatch\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply catch logic\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n payload.fallback = true;\n }\n return payload;\n });\n }\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n payload.fallback = true;\n }\n return payload;\n };\n});\nexport const $ZodNaN = /*@__PURE__*/ core.$constructor(\"$ZodNaN\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"number\" || !Number.isNaN(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"nan\",\n code: \"invalid_type\",\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodPipe = /*@__PURE__*/ core.$constructor(\"$ZodPipe\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n util.defineLazy(inst._zod, \"propValues\", () => def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handlePipeResult(right, def.in, ctx));\n }\n return handlePipeResult(right, def.in, ctx);\n }\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handlePipeResult(left, def.out, ctx));\n }\n return handlePipeResult(left, def.out, ctx);\n };\n});\nfunction handlePipeResult(left, next, ctx) {\n if (left.issues.length) {\n // prevent further checks\n left.aborted = true;\n return left;\n }\n return next._zod.run({ value: left.value, issues: left.issues, fallback: left.fallback }, ctx);\n}\nexport const $ZodCodec = /*@__PURE__*/ core.$constructor(\"$ZodCodec\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n util.defineLazy(inst._zod, \"propValues\", () => def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handleCodecAResult(left, def, ctx));\n }\n return handleCodecAResult(left, def, ctx);\n }\n else {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handleCodecAResult(right, def, ctx));\n }\n return handleCodecAResult(right, def, ctx);\n }\n };\n});\nfunction handleCodecAResult(result, def, ctx) {\n if (result.issues.length) {\n // prevent further checks\n result.aborted = true;\n return result;\n }\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const transformed = def.transform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));\n }\n return handleCodecTxResult(result, transformed, def.out, ctx);\n }\n else {\n const transformed = def.reverseTransform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));\n }\n return handleCodecTxResult(result, transformed, def.in, ctx);\n }\n}\nfunction handleCodecTxResult(left, value, nextSchema, ctx) {\n // Check if transform added any issues\n if (left.issues.length) {\n left.aborted = true;\n return left;\n }\n return nextSchema._zod.run({ value, issues: left.issues }, ctx);\n}\nexport const $ZodPreprocess = /*@__PURE__*/ core.$constructor(\"$ZodPreprocess\", (inst, def) => {\n $ZodPipe.init(inst, def);\n});\nexport const $ZodReadonly = /*@__PURE__*/ core.$constructor(\"$ZodReadonly\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"propValues\", () => def.innerType._zod.propValues);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType?._zod?.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType?._zod?.optout);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then(handleReadonlyResult);\n }\n return handleReadonlyResult(result);\n };\n});\nfunction handleReadonlyResult(payload) {\n payload.value = Object.freeze(payload.value);\n return payload;\n}\nexport const $ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"$ZodTemplateLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n const regexParts = [];\n for (const part of def.parts) {\n if (typeof part === \"object\" && part !== null) {\n // is Zod schema\n if (!part._zod.pattern) {\n // if (!source)\n throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);\n }\n const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;\n if (!source)\n throw new Error(`Invalid template literal part: ${part._zod.traits}`);\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n regexParts.push(source.slice(start, end));\n }\n else if (part === null || util.primitiveTypes.has(typeof part)) {\n regexParts.push(util.escapeRegex(`${part}`));\n }\n else {\n throw new Error(`Invalid template literal part: ${part}`);\n }\n }\n inst._zod.pattern = new RegExp(`^${regexParts.join(\"\")}$`);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"string\") {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"string\",\n code: \"invalid_type\",\n });\n return payload;\n }\n inst._zod.pattern.lastIndex = 0;\n if (!inst._zod.pattern.test(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n code: \"invalid_format\",\n format: def.format ?? \"template_literal\",\n pattern: inst._zod.pattern.source,\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodFunction = /*@__PURE__*/ core.$constructor(\"$ZodFunction\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._def = def;\n inst._zod.def = def;\n inst.implement = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implement() must be called with a function\");\n }\n return function (...args) {\n const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args;\n const result = Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return parse(inst._def.output, result);\n }\n return result;\n };\n };\n inst.implementAsync = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implementAsync() must be called with a function\");\n }\n return async function (...args) {\n const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args;\n const result = await Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return await parseAsync(inst._def.output, result);\n }\n return result;\n };\n };\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"function\") {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"function\",\n input: payload.value,\n inst,\n });\n return payload;\n }\n // Check if output is a promise type to determine if we should use async implementation\n const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === \"promise\";\n if (hasPromiseOutput) {\n payload.value = inst.implementAsync(payload.value);\n }\n else {\n payload.value = inst.implement(payload.value);\n }\n return payload;\n };\n inst.input = (...args) => {\n const F = inst.constructor;\n if (Array.isArray(args[0])) {\n return new F({\n type: \"function\",\n input: new $ZodTuple({\n type: \"tuple\",\n items: args[0],\n rest: args[1],\n }),\n output: inst._def.output,\n });\n }\n return new F({\n type: \"function\",\n input: args[0],\n output: inst._def.output,\n });\n };\n inst.output = (output) => {\n const F = inst.constructor;\n return new F({\n type: \"function\",\n input: inst._def.input,\n output,\n });\n };\n return inst;\n});\nexport const $ZodPromise = /*@__PURE__*/ core.$constructor(\"$ZodPromise\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));\n };\n});\nexport const $ZodLazy = /*@__PURE__*/ core.$constructor(\"$ZodLazy\", (inst, def) => {\n $ZodType.init(inst, def);\n // Cache the resolved inner type on the shared `def` so all clones of this\n // lazy (e.g. via `.describe()`/`.meta()`) share the same inner instance,\n // preserving identity for cycle detection on recursive schemas.\n util.defineLazy(inst._zod, \"innerType\", () => {\n const d = def;\n if (!d._cachedInner)\n d._cachedInner = def.getter();\n return d._cachedInner;\n });\n util.defineLazy(inst._zod, \"pattern\", () => inst._zod.innerType?._zod?.pattern);\n util.defineLazy(inst._zod, \"propValues\", () => inst._zod.innerType?._zod?.propValues);\n util.defineLazy(inst._zod, \"optin\", () => inst._zod.innerType?._zod?.optin ?? undefined);\n util.defineLazy(inst._zod, \"optout\", () => inst._zod.innerType?._zod?.optout ?? undefined);\n inst._zod.parse = (payload, ctx) => {\n const inner = inst._zod.innerType;\n return inner._zod.run(payload, ctx);\n };\n});\nexport const $ZodCustom = /*@__PURE__*/ core.$constructor(\"$ZodCustom\", (inst, def) => {\n checks.$ZodCheck.init(inst, def);\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _) => {\n return payload;\n };\n inst._zod.check = (payload) => {\n const input = payload.value;\n const r = def.fn(input);\n if (r instanceof Promise) {\n return r.then((r) => handleRefineResult(r, payload, input, inst));\n }\n handleRefineResult(r, payload, input, inst);\n return;\n };\n});\nfunction handleRefineResult(result, payload, input, inst) {\n if (!result) {\n const _iss = {\n code: \"custom\",\n input,\n inst, // incorporates params.error into issue reporting\n path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting\n continue: !inst._zod.def.abort,\n // params: inst._zod.def.params,\n };\n if (inst._zod.def.params)\n _iss.params = inst._zod.def.params;\n payload.issues.push(util.issue(_iss));\n }\n}\n","var _a;\nexport const $output = Symbol(\"ZodOutput\");\nexport const $input = Symbol(\"ZodInput\");\nexport class $ZodRegistry {\n constructor() {\n this._map = new WeakMap();\n this._idmap = new Map();\n }\n add(schema, ..._meta) {\n const meta = _meta[0];\n this._map.set(schema, meta);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.set(meta.id, schema);\n }\n return this;\n }\n clear() {\n this._map = new WeakMap();\n this._idmap = new Map();\n return this;\n }\n remove(schema) {\n const meta = this._map.get(schema);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.delete(meta.id);\n }\n this._map.delete(schema);\n return this;\n }\n get(schema) {\n // return this._map.get(schema) as any;\n // inherit metadata\n const p = schema._zod.parent;\n if (p) {\n const pm = { ...(this.get(p) ?? {}) };\n delete pm.id; // do not inherit id\n const f = { ...pm, ...this._map.get(schema) };\n return Object.keys(f).length ? f : undefined;\n }\n return this._map.get(schema);\n }\n has(schema) {\n return this._map.has(schema);\n }\n}\n// registries\nexport function registry() {\n return new $ZodRegistry();\n}\n(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());\nexport const globalRegistry = globalThis.__zod_globalRegistry;\n","import * as checks from \"./checks.js\";\nimport * as registries from \"./registries.js\";\nimport * as schemas from \"./schemas.js\";\nimport * as util from \"./util.js\";\n// @__NO_SIDE_EFFECTS__\nexport function _string(Class, params) {\n return new Class({\n type: \"string\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedString(Class, params) {\n return new Class({\n type: \"string\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _email(Class, params) {\n return new Class({\n type: \"string\",\n format: \"email\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _guid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"guid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v4\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v6\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv7(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v7\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _emoji(Class, params) {\n return new Class({\n type: \"string\",\n format: \"emoji\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nanoid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"nanoid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link _cuid2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\n// @__NO_SIDE_EFFECTS__\nexport function _cuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid2(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid2\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ulid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ulid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _xid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"xid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ksuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ksuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mac(Class, params) {\n return new Class({\n type: \"string\",\n format: \"mac\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _e164(Class, params) {\n return new Class({\n type: \"string\",\n format: \"e164\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _jwt(Class, params) {\n return new Class({\n type: \"string\",\n format: \"jwt\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport const TimePrecision = {\n Any: null,\n Minute: -1,\n Second: 0,\n Millisecond: 3,\n Microsecond: 6,\n};\n// @__NO_SIDE_EFFECTS__\nexport function _isoDateTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"datetime\",\n check: \"string_format\",\n offset: false,\n local: false,\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDate(Class, params) {\n return new Class({\n type: \"string\",\n format: \"date\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"time\",\n check: \"string_format\",\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDuration(Class, params) {\n return new Class({\n type: \"string\",\n format: \"duration\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _number(Class, params) {\n return new Class({\n type: \"number\",\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedNumber(Class, params) {\n return new Class({\n type: \"number\",\n coerce: true,\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"safeint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float64(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"int32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"uint32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _boolean(Class, params) {\n return new Class({\n type: \"boolean\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBoolean(Class, params) {\n return new Class({\n type: \"boolean\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _bigint(Class, params) {\n return new Class({\n type: \"bigint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBigint(Class, params) {\n return new Class({\n type: \"bigint\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"int64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"uint64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _symbol(Class, params) {\n return new Class({\n type: \"symbol\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _undefined(Class, params) {\n return new Class({\n type: \"undefined\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _null(Class, params) {\n return new Class({\n type: \"null\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _any(Class) {\n return new Class({\n type: \"any\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _unknown(Class) {\n return new Class({\n type: \"unknown\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _never(Class, params) {\n return new Class({\n type: \"never\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _void(Class, params) {\n return new Class({\n type: \"void\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _date(Class, params) {\n return new Class({\n type: \"date\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedDate(Class, params) {\n return new Class({\n type: \"date\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nan(Class, params) {\n return new Class({\n type: \"nan\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lt(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lte(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.lte()` instead. */\n_lte as _max, };\n// @__NO_SIDE_EFFECTS__\nexport function _gt(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _gte(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.gte()` instead. */\n_gte as _min, };\n// @__NO_SIDE_EFFECTS__\nexport function _positive(params) {\n return _gt(0, params);\n}\n// negative\n// @__NO_SIDE_EFFECTS__\nexport function _negative(params) {\n return _lt(0, params);\n}\n// nonpositive\n// @__NO_SIDE_EFFECTS__\nexport function _nonpositive(params) {\n return _lte(0, params);\n}\n// nonnegative\n// @__NO_SIDE_EFFECTS__\nexport function _nonnegative(params) {\n return _gte(0, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function _multipleOf(value, params) {\n return new checks.$ZodCheckMultipleOf({\n check: \"multiple_of\",\n ...util.normalizeParams(params),\n value,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxSize(maximum, params) {\n return new checks.$ZodCheckMaxSize({\n check: \"max_size\",\n ...util.normalizeParams(params),\n maximum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minSize(minimum, params) {\n return new checks.$ZodCheckMinSize({\n check: \"min_size\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _size(size, params) {\n return new checks.$ZodCheckSizeEquals({\n check: \"size_equals\",\n ...util.normalizeParams(params),\n size,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxLength(maximum, params) {\n const ch = new checks.$ZodCheckMaxLength({\n check: \"max_length\",\n ...util.normalizeParams(params),\n maximum,\n });\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minLength(minimum, params) {\n return new checks.$ZodCheckMinLength({\n check: \"min_length\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _length(length, params) {\n return new checks.$ZodCheckLengthEquals({\n check: \"length_equals\",\n ...util.normalizeParams(params),\n length,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _regex(pattern, params) {\n return new checks.$ZodCheckRegex({\n check: \"string_format\",\n format: \"regex\",\n ...util.normalizeParams(params),\n pattern,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lowercase(params) {\n return new checks.$ZodCheckLowerCase({\n check: \"string_format\",\n format: \"lowercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uppercase(params) {\n return new checks.$ZodCheckUpperCase({\n check: \"string_format\",\n format: \"uppercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _includes(includes, params) {\n return new checks.$ZodCheckIncludes({\n check: \"string_format\",\n format: \"includes\",\n ...util.normalizeParams(params),\n includes,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _startsWith(prefix, params) {\n return new checks.$ZodCheckStartsWith({\n check: \"string_format\",\n format: \"starts_with\",\n ...util.normalizeParams(params),\n prefix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _endsWith(suffix, params) {\n return new checks.$ZodCheckEndsWith({\n check: \"string_format\",\n format: \"ends_with\",\n ...util.normalizeParams(params),\n suffix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _property(property, schema, params) {\n return new checks.$ZodCheckProperty({\n check: \"property\",\n property,\n schema,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mime(types, params) {\n return new checks.$ZodCheckMimeType({\n check: \"mime_type\",\n mime: types,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _overwrite(tx) {\n return new checks.$ZodCheckOverwrite({\n check: \"overwrite\",\n tx,\n });\n}\n// normalize\n// @__NO_SIDE_EFFECTS__\nexport function _normalize(form) {\n return _overwrite((input) => input.normalize(form));\n}\n// trim\n// @__NO_SIDE_EFFECTS__\nexport function _trim() {\n return _overwrite((input) => input.trim());\n}\n// toLowerCase\n// @__NO_SIDE_EFFECTS__\nexport function _toLowerCase() {\n return _overwrite((input) => input.toLowerCase());\n}\n// toUpperCase\n// @__NO_SIDE_EFFECTS__\nexport function _toUpperCase() {\n return _overwrite((input) => input.toUpperCase());\n}\n// slugify\n// @__NO_SIDE_EFFECTS__\nexport function _slugify() {\n return _overwrite((input) => util.slugify(input));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _array(Class, element, params) {\n return new Class({\n type: \"array\",\n element,\n // get element() {\n // return element;\n // },\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _union(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n ...util.normalizeParams(params),\n });\n}\nexport function _xor(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _discriminatedUnion(Class, discriminator, options, params) {\n return new Class({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _intersection(Class, left, right) {\n return new Class({\n type: \"intersection\",\n left,\n right,\n });\n}\n// export function _tuple(\n// Class: util.SchemaClass<schemas.$ZodTuple>,\n// items: [],\n// params?: string | $ZodTupleParams\n// ): schemas.$ZodTuple<[], null>;\n// @__NO_SIDE_EFFECTS__\nexport function _tuple(Class, items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof schemas.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new Class({\n type: \"tuple\",\n items,\n rest,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _record(Class, keyType, valueType, params) {\n return new Class({\n type: \"record\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _map(Class, keyType, valueType, params) {\n return new Class({\n type: \"map\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _set(Class, valueType, params) {\n return new Class({\n type: \"set\",\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _enum(Class, values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n // if (Array.isArray(values)) {\n // for (const value of values) {\n // entries[value] = value;\n // }\n // } else {\n // Object.assign(entries, values);\n // }\n // const entries: util.EnumLike = {};\n // for (const val of values) {\n // entries[val] = val;\n // }\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function _nativeEnum(Class, entries, params) {\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _literal(Class, value, params) {\n return new Class({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _file(Class, params) {\n return new Class({\n type: \"file\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _transform(Class, fn) {\n return new Class({\n type: \"transform\",\n transform: fn,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _optional(Class, innerType) {\n return new Class({\n type: \"optional\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nullable(Class, innerType) {\n return new Class({\n type: \"nullable\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _default(Class, innerType, defaultValue) {\n return new Class({\n type: \"default\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nonoptional(Class, innerType, params) {\n return new Class({\n type: \"nonoptional\",\n innerType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _success(Class, innerType) {\n return new Class({\n type: \"success\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _catch(Class, innerType, catchValue) {\n return new Class({\n type: \"catch\",\n innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _pipe(Class, in_, out) {\n return new Class({\n type: \"pipe\",\n in: in_,\n out,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _readonly(Class, innerType) {\n return new Class({\n type: \"readonly\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _templateLiteral(Class, parts, params) {\n return new Class({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lazy(Class, getter) {\n return new Class({\n type: \"lazy\",\n getter,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _promise(Class, innerType) {\n return new Class({\n type: \"promise\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _custom(Class, fn, _params) {\n const norm = util.normalizeParams(_params);\n norm.abort ?? (norm.abort = true); // default to abort:false\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...norm,\n });\n return schema;\n}\n// same as _custom but defaults to abort:false\n// @__NO_SIDE_EFFECTS__\nexport function _refine(Class, fn, _params) {\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...util.normalizeParams(_params),\n });\n return schema;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _superRefine(fn, params) {\n const ch = _check((payload) => {\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, ch._zod.def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = ch);\n _issue.continue ?? (_issue.continue = !ch._zod.def.abort); // abort is always undefined, so this is always true...\n payload.issues.push(util.issue(_issue));\n }\n };\n return fn(payload.value, payload);\n }, params);\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _check(fn, params) {\n const ch = new checks.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function describe(description) {\n const ch = new checks.$ZodCheck({ check: \"describe\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, description });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function meta(metadata) {\n const ch = new checks.$ZodCheck({ check: \"meta\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, ...metadata });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringbool(Classes, _params) {\n const params = util.normalizeParams(_params);\n let truthyArray = params.truthy ?? [\"true\", \"1\", \"yes\", \"on\", \"y\", \"enabled\"];\n let falsyArray = params.falsy ?? [\"false\", \"0\", \"no\", \"off\", \"n\", \"disabled\"];\n if (params.case !== \"sensitive\") {\n truthyArray = truthyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n falsyArray = falsyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n }\n const truthySet = new Set(truthyArray);\n const falsySet = new Set(falsyArray);\n const _Codec = Classes.Codec ?? schemas.$ZodCodec;\n const _Boolean = Classes.Boolean ?? schemas.$ZodBoolean;\n const _String = Classes.String ?? schemas.$ZodString;\n const stringSchema = new _String({ type: \"string\", error: params.error });\n const booleanSchema = new _Boolean({ type: \"boolean\", error: params.error });\n const codec = new _Codec({\n type: \"pipe\",\n in: stringSchema,\n out: booleanSchema,\n transform: ((input, payload) => {\n let data = input;\n if (params.case !== \"sensitive\")\n data = data.toLowerCase();\n if (truthySet.has(data)) {\n return true;\n }\n else if (falsySet.has(data)) {\n return false;\n }\n else {\n payload.issues.push({\n code: \"invalid_value\",\n expected: \"stringbool\",\n values: [...truthySet, ...falsySet],\n input: payload.value,\n inst: codec,\n continue: false,\n });\n return {};\n }\n }),\n reverseTransform: ((input, _payload) => {\n if (input === true) {\n return truthyArray[0] || \"true\";\n }\n else {\n return falsyArray[0] || \"false\";\n }\n }),\n error: params.error,\n });\n return codec;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringFormat(Class, format, fnOrRegex, _params = {}) {\n const params = util.normalizeParams(_params);\n const def = {\n ...util.normalizeParams(_params),\n check: \"string_format\",\n type: \"string\",\n format,\n fn: typeof fnOrRegex === \"function\" ? fnOrRegex : (val) => fnOrRegex.test(val),\n ...params,\n };\n if (fnOrRegex instanceof RegExp) {\n def.pattern = fnOrRegex;\n }\n const inst = new Class(def);\n return inst;\n}\n","import { globalRegistry } from \"./registries.js\";\n// function initializeContext<T extends schemas.$ZodType>(inputs: JSONSchemaGeneratorParams<T>): ToJSONSchemaContext<T> {\n// return {\n// processor: inputs.processor,\n// metadataRegistry: inputs.metadata ?? globalRegistry,\n// target: inputs.target ?? \"draft-2020-12\",\n// unrepresentable: inputs.unrepresentable ?? \"throw\",\n// };\n// }\nexport function initializeContext(params) {\n // Normalize target: convert old non-hyphenated versions to hyphenated versions\n let target = params?.target ?? \"draft-2020-12\";\n if (target === \"draft-4\")\n target = \"draft-04\";\n if (target === \"draft-7\")\n target = \"draft-07\";\n return {\n processors: params.processors ?? {},\n metadataRegistry: params?.metadata ?? globalRegistry,\n target,\n unrepresentable: params?.unrepresentable ?? \"throw\",\n override: params?.override ?? (() => { }),\n io: params?.io ?? \"output\",\n counter: 0,\n seen: new Map(),\n cycles: params?.cycles ?? \"ref\",\n reused: params?.reused ?? \"inline\",\n external: params?.external ?? undefined,\n };\n}\nexport function process(schema, ctx, _params = { path: [], schemaPath: [] }) {\n var _a;\n const def = schema._zod.def;\n // check for schema in seens\n const seen = ctx.seen.get(schema);\n if (seen) {\n seen.count++;\n // check if cycle\n const isCycle = _params.schemaPath.includes(schema);\n if (isCycle) {\n seen.cycle = _params.path;\n }\n return seen.schema;\n }\n // initialize\n const result = { schema: {}, count: 1, cycle: undefined, path: _params.path };\n ctx.seen.set(schema, result);\n // custom method overrides default behavior\n const overrideSchema = schema._zod.toJSONSchema?.();\n if (overrideSchema) {\n result.schema = overrideSchema;\n }\n else {\n const params = {\n ..._params,\n schemaPath: [..._params.schemaPath, schema],\n path: _params.path,\n };\n if (schema._zod.processJSONSchema) {\n schema._zod.processJSONSchema(ctx, result.schema, params);\n }\n else {\n const _json = result.schema;\n const processor = ctx.processors[def.type];\n if (!processor) {\n throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);\n }\n processor(schema, ctx, _json, params);\n }\n const parent = schema._zod.parent;\n if (parent) {\n // Also set ref if processor didn't (for inheritance)\n if (!result.ref)\n result.ref = parent;\n process(parent, ctx, params);\n ctx.seen.get(parent).isParent = true;\n }\n }\n // metadata\n const meta = ctx.metadataRegistry.get(schema);\n if (meta)\n Object.assign(result.schema, meta);\n if (ctx.io === \"input\" && isTransforming(schema)) {\n // examples/defaults only apply to output type of pipe\n delete result.schema.examples;\n delete result.schema.default;\n }\n // set prefault as default\n if (ctx.io === \"input\" && \"_prefault\" in result.schema)\n (_a = result.schema).default ?? (_a.default = result.schema._prefault);\n delete result.schema._prefault;\n // pulling fresh from ctx.seen in case it was overwritten\n const _result = ctx.seen.get(schema);\n return _result.schema;\n}\nexport function extractDefs(ctx, schema\n// params: EmitParams\n) {\n // iterate over seen map;\n const root = ctx.seen.get(schema);\n if (!root)\n throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n // Track ids to detect duplicates across different schemas\n const idToSchema = new Map();\n for (const entry of ctx.seen.entries()) {\n const id = ctx.metadataRegistry.get(entry[0])?.id;\n if (id) {\n const existing = idToSchema.get(id);\n if (existing && existing !== entry[0]) {\n throw new Error(`Duplicate schema id \"${id}\" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);\n }\n idToSchema.set(id, entry[0]);\n }\n }\n // returns a ref to the schema\n // defId will be empty if the ref points to an external schema (or #)\n const makeURI = (entry) => {\n // comparing the seen objects because sometimes\n // multiple schemas map to the same seen object.\n // e.g. lazy\n // external is configured\n const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n if (ctx.external) {\n const externalId = ctx.external.registry.get(entry[0])?.id; // ?? \"__shared\";// `__schema${ctx.counter++}`;\n // check if schema is in the external registry\n const uriGenerator = ctx.external.uri ?? ((id) => id);\n if (externalId) {\n return { ref: uriGenerator(externalId) };\n }\n // otherwise, add to __shared\n const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;\n entry[1].defId = id; // set defId so it will be reused if needed\n return { defId: id, ref: `${uriGenerator(\"__shared\")}#/${defsSegment}/${id}` };\n }\n if (entry[1] === root) {\n return { ref: \"#\" };\n }\n // self-contained schema\n const uriPrefix = `#`;\n const defUriPrefix = `${uriPrefix}/${defsSegment}/`;\n const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;\n return { defId, ref: defUriPrefix + defId };\n };\n // stored cached version in `def` property\n // remove all properties, set $ref\n const extractToDef = (entry) => {\n // if the schema is already a reference, do not extract it\n if (entry[1].schema.$ref) {\n return;\n }\n const seen = entry[1];\n const { ref, defId } = makeURI(entry);\n seen.def = { ...seen.schema };\n // defId won't be set if the schema is a reference to an external schema\n // or if the schema is the root schema\n if (defId)\n seen.defId = defId;\n // wipe away all properties except $ref\n const schema = seen.schema;\n for (const key in schema) {\n delete schema[key];\n }\n schema.$ref = ref;\n };\n // throw on cycles\n // break cycles\n if (ctx.cycles === \"throw\") {\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n if (seen.cycle) {\n throw new Error(\"Cycle detected: \" +\n `#/${seen.cycle?.join(\"/\")}/<root>` +\n '\\n\\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.');\n }\n }\n }\n // extract schemas into $defs\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n // convert root schema to # $ref\n if (schema === entry[0]) {\n extractToDef(entry); // this has special handling for the root schema\n continue;\n }\n // extract schemas that are in the external registry\n if (ctx.external) {\n const ext = ctx.external.registry.get(entry[0])?.id;\n if (schema !== entry[0] && ext) {\n extractToDef(entry);\n continue;\n }\n }\n // extract schemas with `id` meta\n const id = ctx.metadataRegistry.get(entry[0])?.id;\n if (id) {\n extractToDef(entry);\n continue;\n }\n // break cycles\n if (seen.cycle) {\n // any\n extractToDef(entry);\n continue;\n }\n // extract reused schemas\n if (seen.count > 1) {\n if (ctx.reused === \"ref\") {\n extractToDef(entry);\n // biome-ignore lint:\n continue;\n }\n }\n }\n}\nexport function finalize(ctx, schema) {\n const root = ctx.seen.get(schema);\n if (!root)\n throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n // flatten refs - inherit properties from parent schemas\n const flattenRef = (zodSchema) => {\n const seen = ctx.seen.get(zodSchema);\n // already processed\n if (seen.ref === null)\n return;\n const schema = seen.def ?? seen.schema;\n const _cached = { ...schema };\n const ref = seen.ref;\n seen.ref = null; // prevent infinite recursion\n if (ref) {\n flattenRef(ref);\n const refSeen = ctx.seen.get(ref);\n const refSchema = refSeen.schema;\n // merge referenced schema into current\n if (refSchema.$ref && (ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\")) {\n // older drafts can't combine $ref with other properties\n schema.allOf = schema.allOf ?? [];\n schema.allOf.push(refSchema);\n }\n else {\n Object.assign(schema, refSchema);\n }\n // restore child's own properties (child wins)\n Object.assign(schema, _cached);\n const isParentRef = zodSchema._zod.parent === ref;\n // For parent chain, child is a refinement - remove parent-only properties\n if (isParentRef) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (!(key in _cached)) {\n delete schema[key];\n }\n }\n }\n // When ref was extracted to $defs, remove properties that match the definition\n if (refSchema.$ref && refSeen.def) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) {\n delete schema[key];\n }\n }\n }\n }\n // If parent was extracted (has $ref), propagate $ref to this schema\n // This handles cases like: readonly().meta({id}).describe()\n // where processor sets ref to innerType but parent should be referenced\n const parent = zodSchema._zod.parent;\n if (parent && parent !== ref) {\n // Ensure parent is processed first so its def has inherited properties\n flattenRef(parent);\n const parentSeen = ctx.seen.get(parent);\n if (parentSeen?.schema.$ref) {\n schema.$ref = parentSeen.schema.$ref;\n // De-duplicate with parent's definition\n if (parentSeen.def) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) {\n delete schema[key];\n }\n }\n }\n }\n }\n // execute overrides\n ctx.override({\n zodSchema: zodSchema,\n jsonSchema: schema,\n path: seen.path ?? [],\n });\n };\n for (const entry of [...ctx.seen.entries()].reverse()) {\n flattenRef(entry[0]);\n }\n const result = {};\n if (ctx.target === \"draft-2020-12\") {\n result.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n }\n else if (ctx.target === \"draft-07\") {\n result.$schema = \"http://json-schema.org/draft-07/schema#\";\n }\n else if (ctx.target === \"draft-04\") {\n result.$schema = \"http://json-schema.org/draft-04/schema#\";\n }\n else if (ctx.target === \"openapi-3.0\") {\n // OpenAPI 3.0 schema objects should not include a $schema property\n }\n else {\n // Arbitrary string values are allowed but won't have a $schema property set\n }\n if (ctx.external?.uri) {\n const id = ctx.external.registry.get(schema)?.id;\n if (!id)\n throw new Error(\"Schema is missing an `id` property\");\n result.$id = ctx.external.uri(id);\n }\n Object.assign(result, root.def ?? root.schema);\n // The `id` in `.meta()` is a Zod-specific registration tag used to extract\n // schemas into $defs — it is not user-facing JSON Schema metadata. Strip it\n // from the output body where it would otherwise leak. The id is preserved\n // implicitly via the $defs key (and via $ref paths).\n const rootMetaId = ctx.metadataRegistry.get(schema)?.id;\n if (rootMetaId !== undefined && result.id === rootMetaId)\n delete result.id;\n // build defs object\n const defs = ctx.external?.defs ?? {};\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n if (seen.def && seen.defId) {\n if (seen.def.id === seen.defId)\n delete seen.def.id;\n defs[seen.defId] = seen.def;\n }\n }\n // set definitions in result\n if (ctx.external) {\n }\n else {\n if (Object.keys(defs).length > 0) {\n if (ctx.target === \"draft-2020-12\") {\n result.$defs = defs;\n }\n else {\n result.definitions = defs;\n }\n }\n }\n try {\n // this \"finalizes\" this schema and ensures all cycles are removed\n // each call to finalize() is functionally independent\n // though the seen map is shared\n const finalized = JSON.parse(JSON.stringify(result));\n Object.defineProperty(finalized, \"~standard\", {\n value: {\n ...schema[\"~standard\"],\n jsonSchema: {\n input: createStandardJSONSchemaMethod(schema, \"input\", ctx.processors),\n output: createStandardJSONSchemaMethod(schema, \"output\", ctx.processors),\n },\n },\n enumerable: false,\n writable: false,\n });\n return finalized;\n }\n catch (_err) {\n throw new Error(\"Error converting schema to JSON.\");\n }\n}\nfunction isTransforming(_schema, _ctx) {\n const ctx = _ctx ?? { seen: new Set() };\n if (ctx.seen.has(_schema))\n return false;\n ctx.seen.add(_schema);\n const def = _schema._zod.def;\n if (def.type === \"transform\")\n return true;\n if (def.type === \"array\")\n return isTransforming(def.element, ctx);\n if (def.type === \"set\")\n return isTransforming(def.valueType, ctx);\n if (def.type === \"lazy\")\n return isTransforming(def.getter(), ctx);\n if (def.type === \"promise\" ||\n def.type === \"optional\" ||\n def.type === \"nonoptional\" ||\n def.type === \"nullable\" ||\n def.type === \"readonly\" ||\n def.type === \"default\" ||\n def.type === \"prefault\") {\n return isTransforming(def.innerType, ctx);\n }\n if (def.type === \"intersection\") {\n return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);\n }\n if (def.type === \"record\" || def.type === \"map\") {\n return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);\n }\n if (def.type === \"pipe\") {\n if (_schema._zod.traits.has(\"$ZodCodec\"))\n return true;\n return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);\n }\n if (def.type === \"object\") {\n for (const key in def.shape) {\n if (isTransforming(def.shape[key], ctx))\n return true;\n }\n return false;\n }\n if (def.type === \"union\") {\n for (const option of def.options) {\n if (isTransforming(option, ctx))\n return true;\n }\n return false;\n }\n if (def.type === \"tuple\") {\n for (const item of def.items) {\n if (isTransforming(item, ctx))\n return true;\n }\n if (def.rest && isTransforming(def.rest, ctx))\n return true;\n return false;\n }\n return false;\n}\n/**\n * Creates a toJSONSchema method for a schema instance.\n * This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.\n */\nexport const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {\n const ctx = initializeContext({ ...params, processors });\n process(schema, ctx);\n extractDefs(ctx, schema);\n return finalize(ctx, schema);\n};\nexport const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {\n const { libraryOptions, target } = params ?? {};\n const ctx = initializeContext({ ...(libraryOptions ?? {}), target, io, processors });\n process(schema, ctx);\n extractDefs(ctx, schema);\n return finalize(ctx, schema);\n};\n","import { extractDefs, finalize, initializeContext, process, } from \"./to-json-schema.js\";\nimport { getEnumValues } from \"./util.js\";\nconst formatMap = {\n guid: \"uuid\",\n url: \"uri\",\n datetime: \"date-time\",\n json_string: \"json-string\",\n regex: \"\", // do not set\n};\n// ==================== SIMPLE TYPE PROCESSORS ====================\nexport const stringProcessor = (schema, ctx, _json, _params) => {\n const json = _json;\n json.type = \"string\";\n const { minimum, maximum, format, patterns, contentEncoding } = schema._zod\n .bag;\n if (typeof minimum === \"number\")\n json.minLength = minimum;\n if (typeof maximum === \"number\")\n json.maxLength = maximum;\n // custom pattern overrides format\n if (format) {\n json.format = formatMap[format] ?? format;\n if (json.format === \"\")\n delete json.format; // empty format is not valid\n // JSON Schema format: \"time\" requires a full time with offset or Z\n // z.iso.time() does not include timezone information, so format: \"time\" should never be used\n if (format === \"time\") {\n delete json.format;\n }\n }\n if (contentEncoding)\n json.contentEncoding = contentEncoding;\n if (patterns && patterns.size > 0) {\n const regexes = [...patterns];\n if (regexes.length === 1)\n json.pattern = regexes[0].source;\n else if (regexes.length > 1) {\n json.allOf = [\n ...regexes.map((regex) => ({\n ...(ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\"\n ? { type: \"string\" }\n : {}),\n pattern: regex.source,\n })),\n ];\n }\n }\n};\nexport const numberProcessor = (schema, ctx, _json, _params) => {\n const json = _json;\n const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;\n if (typeof format === \"string\" && format.includes(\"int\"))\n json.type = \"integer\";\n else\n json.type = \"number\";\n // when both minimum and exclusiveMinimum exist, pick the more restrictive one\n const exMin = typeof exclusiveMinimum === \"number\" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);\n const exMax = typeof exclusiveMaximum === \"number\" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);\n const legacy = ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\";\n if (exMin) {\n if (legacy) {\n json.minimum = exclusiveMinimum;\n json.exclusiveMinimum = true;\n }\n else {\n json.exclusiveMinimum = exclusiveMinimum;\n }\n }\n else if (typeof minimum === \"number\") {\n json.minimum = minimum;\n }\n if (exMax) {\n if (legacy) {\n json.maximum = exclusiveMaximum;\n json.exclusiveMaximum = true;\n }\n else {\n json.exclusiveMaximum = exclusiveMaximum;\n }\n }\n else if (typeof maximum === \"number\") {\n json.maximum = maximum;\n }\n if (typeof multipleOf === \"number\")\n json.multipleOf = multipleOf;\n};\nexport const booleanProcessor = (_schema, _ctx, json, _params) => {\n json.type = \"boolean\";\n};\nexport const bigintProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"BigInt cannot be represented in JSON Schema\");\n }\n};\nexport const symbolProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Symbols cannot be represented in JSON Schema\");\n }\n};\nexport const nullProcessor = (_schema, ctx, json, _params) => {\n if (ctx.target === \"openapi-3.0\") {\n json.type = \"string\";\n json.nullable = true;\n json.enum = [null];\n }\n else {\n json.type = \"null\";\n }\n};\nexport const undefinedProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Undefined cannot be represented in JSON Schema\");\n }\n};\nexport const voidProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Void cannot be represented in JSON Schema\");\n }\n};\nexport const neverProcessor = (_schema, _ctx, json, _params) => {\n json.not = {};\n};\nexport const anyProcessor = (_schema, _ctx, _json, _params) => {\n // empty schema accepts anything\n};\nexport const unknownProcessor = (_schema, _ctx, _json, _params) => {\n // empty schema accepts anything\n};\nexport const dateProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Date cannot be represented in JSON Schema\");\n }\n};\nexport const enumProcessor = (schema, _ctx, json, _params) => {\n const def = schema._zod.def;\n const values = getEnumValues(def.entries);\n // Number enums can have both string and number values\n if (values.every((v) => typeof v === \"number\"))\n json.type = \"number\";\n if (values.every((v) => typeof v === \"string\"))\n json.type = \"string\";\n json.enum = values;\n};\nexport const literalProcessor = (schema, ctx, json, _params) => {\n const def = schema._zod.def;\n const vals = [];\n for (const val of def.values) {\n if (val === undefined) {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Literal `undefined` cannot be represented in JSON Schema\");\n }\n else {\n // do not add to vals\n }\n }\n else if (typeof val === \"bigint\") {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"BigInt literals cannot be represented in JSON Schema\");\n }\n else {\n vals.push(Number(val));\n }\n }\n else {\n vals.push(val);\n }\n }\n if (vals.length === 0) {\n // do nothing (an undefined literal was stripped)\n }\n else if (vals.length === 1) {\n const val = vals[0];\n json.type = val === null ? \"null\" : typeof val;\n if (ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\") {\n json.enum = [val];\n }\n else {\n json.const = val;\n }\n }\n else {\n if (vals.every((v) => typeof v === \"number\"))\n json.type = \"number\";\n if (vals.every((v) => typeof v === \"string\"))\n json.type = \"string\";\n if (vals.every((v) => typeof v === \"boolean\"))\n json.type = \"boolean\";\n if (vals.every((v) => v === null))\n json.type = \"null\";\n json.enum = vals;\n }\n};\nexport const nanProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"NaN cannot be represented in JSON Schema\");\n }\n};\nexport const templateLiteralProcessor = (schema, _ctx, json, _params) => {\n const _json = json;\n const pattern = schema._zod.pattern;\n if (!pattern)\n throw new Error(\"Pattern not found in template literal\");\n _json.type = \"string\";\n _json.pattern = pattern.source;\n};\nexport const fileProcessor = (schema, _ctx, json, _params) => {\n const _json = json;\n const file = {\n type: \"string\",\n format: \"binary\",\n contentEncoding: \"binary\",\n };\n const { minimum, maximum, mime } = schema._zod.bag;\n if (minimum !== undefined)\n file.minLength = minimum;\n if (maximum !== undefined)\n file.maxLength = maximum;\n if (mime) {\n if (mime.length === 1) {\n file.contentMediaType = mime[0];\n Object.assign(_json, file);\n }\n else {\n Object.assign(_json, file); // shared props at root\n _json.anyOf = mime.map((m) => ({ contentMediaType: m })); // only contentMediaType differs\n }\n }\n else {\n Object.assign(_json, file);\n }\n};\nexport const successProcessor = (_schema, _ctx, json, _params) => {\n json.type = \"boolean\";\n};\nexport const customProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Custom types cannot be represented in JSON Schema\");\n }\n};\nexport const functionProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Function types cannot be represented in JSON Schema\");\n }\n};\nexport const transformProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Transforms cannot be represented in JSON Schema\");\n }\n};\nexport const mapProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Map cannot be represented in JSON Schema\");\n }\n};\nexport const setProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Set cannot be represented in JSON Schema\");\n }\n};\n// ==================== COMPOSITE TYPE PROCESSORS ====================\nexport const arrayProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n const { minimum, maximum } = schema._zod.bag;\n if (typeof minimum === \"number\")\n json.minItems = minimum;\n if (typeof maximum === \"number\")\n json.maxItems = maximum;\n json.type = \"array\";\n json.items = process(def.element, ctx, {\n ...params,\n path: [...params.path, \"items\"],\n });\n};\nexport const objectProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"object\";\n json.properties = {};\n const shape = def.shape;\n for (const key in shape) {\n json.properties[key] = process(shape[key], ctx, {\n ...params,\n path: [...params.path, \"properties\", key],\n });\n }\n // required keys\n const allKeys = new Set(Object.keys(shape));\n const requiredKeys = new Set([...allKeys].filter((key) => {\n const v = def.shape[key]._zod;\n if (ctx.io === \"input\") {\n return v.optin === undefined;\n }\n else {\n return v.optout === undefined;\n }\n }));\n if (requiredKeys.size > 0) {\n json.required = Array.from(requiredKeys);\n }\n // catchall\n if (def.catchall?._zod.def.type === \"never\") {\n // strict\n json.additionalProperties = false;\n }\n else if (!def.catchall) {\n // regular\n if (ctx.io === \"output\")\n json.additionalProperties = false;\n }\n else if (def.catchall) {\n json.additionalProperties = process(def.catchall, ctx, {\n ...params,\n path: [...params.path, \"additionalProperties\"],\n });\n }\n};\nexport const unionProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n // Exclusive unions (inclusive === false) use oneOf (exactly one match) instead of anyOf (one or more matches)\n // This includes both z.xor() and discriminated unions\n const isExclusive = def.inclusive === false;\n const options = def.options.map((x, i) => process(x, ctx, {\n ...params,\n path: [...params.path, isExclusive ? \"oneOf\" : \"anyOf\", i],\n }));\n if (isExclusive) {\n json.oneOf = options;\n }\n else {\n json.anyOf = options;\n }\n};\nexport const intersectionProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n const a = process(def.left, ctx, {\n ...params,\n path: [...params.path, \"allOf\", 0],\n });\n const b = process(def.right, ctx, {\n ...params,\n path: [...params.path, \"allOf\", 1],\n });\n const isSimpleIntersection = (val) => \"allOf\" in val && Object.keys(val).length === 1;\n const allOf = [\n ...(isSimpleIntersection(a) ? a.allOf : [a]),\n ...(isSimpleIntersection(b) ? b.allOf : [b]),\n ];\n json.allOf = allOf;\n};\nexport const tupleProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"array\";\n const prefixPath = ctx.target === \"draft-2020-12\" ? \"prefixItems\" : \"items\";\n const restPath = ctx.target === \"draft-2020-12\" ? \"items\" : ctx.target === \"openapi-3.0\" ? \"items\" : \"additionalItems\";\n const prefixItems = def.items.map((x, i) => process(x, ctx, {\n ...params,\n path: [...params.path, prefixPath, i],\n }));\n const rest = def.rest\n ? process(def.rest, ctx, {\n ...params,\n path: [...params.path, restPath, ...(ctx.target === \"openapi-3.0\" ? [def.items.length] : [])],\n })\n : null;\n if (ctx.target === \"draft-2020-12\") {\n json.prefixItems = prefixItems;\n if (rest) {\n json.items = rest;\n }\n }\n else if (ctx.target === \"openapi-3.0\") {\n json.items = {\n anyOf: prefixItems,\n };\n if (rest) {\n json.items.anyOf.push(rest);\n }\n json.minItems = prefixItems.length;\n if (!rest) {\n json.maxItems = prefixItems.length;\n }\n }\n else {\n json.items = prefixItems;\n if (rest) {\n json.additionalItems = rest;\n }\n }\n // length\n const { minimum, maximum } = schema._zod.bag;\n if (typeof minimum === \"number\")\n json.minItems = minimum;\n if (typeof maximum === \"number\")\n json.maxItems = maximum;\n};\nexport const recordProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"object\";\n // For looseRecord with regex patterns, use patternProperties\n // This correctly represents \"only validate keys matching the pattern\" semantics\n // and composes well with allOf (intersections)\n const keyType = def.keyType;\n const keyBag = keyType._zod.bag;\n const patterns = keyBag?.patterns;\n if (def.mode === \"loose\" && patterns && patterns.size > 0) {\n // Use patternProperties for looseRecord with regex patterns\n const valueSchema = process(def.valueType, ctx, {\n ...params,\n path: [...params.path, \"patternProperties\", \"*\"],\n });\n json.patternProperties = {};\n for (const pattern of patterns) {\n json.patternProperties[pattern.source] = valueSchema;\n }\n }\n else {\n // Default behavior: use propertyNames + additionalProperties\n if (ctx.target === \"draft-07\" || ctx.target === \"draft-2020-12\") {\n json.propertyNames = process(def.keyType, ctx, {\n ...params,\n path: [...params.path, \"propertyNames\"],\n });\n }\n json.additionalProperties = process(def.valueType, ctx, {\n ...params,\n path: [...params.path, \"additionalProperties\"],\n });\n }\n // Add required for keys with discrete values (enum, literal, etc.)\n const keyValues = keyType._zod.values;\n if (keyValues) {\n const validKeyValues = [...keyValues].filter((v) => typeof v === \"string\" || typeof v === \"number\");\n if (validKeyValues.length > 0) {\n json.required = validKeyValues;\n }\n }\n};\nexport const nullableProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n const inner = process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n if (ctx.target === \"openapi-3.0\") {\n seen.ref = def.innerType;\n json.nullable = true;\n }\n else {\n json.anyOf = [inner, { type: \"null\" }];\n }\n};\nexport const nonoptionalProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const defaultProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n json.default = JSON.parse(JSON.stringify(def.defaultValue));\n};\nexport const prefaultProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n if (ctx.io === \"input\")\n json._prefault = JSON.parse(JSON.stringify(def.defaultValue));\n};\nexport const catchProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n let catchValue;\n try {\n catchValue = def.catchValue(undefined);\n }\n catch {\n throw new Error(\"Dynamic catch values are not supported in JSON Schema\");\n }\n json.default = catchValue;\n};\nexport const pipeProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n const inIsTransform = def.in._zod.traits.has(\"$ZodTransform\");\n const innerType = ctx.io === \"input\" ? (inIsTransform ? def.out : def.in) : def.out;\n process(innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = innerType;\n};\nexport const readonlyProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n json.readOnly = true;\n};\nexport const promiseProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const optionalProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const lazyProcessor = (schema, ctx, _json, params) => {\n const innerType = schema._zod.innerType;\n process(innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = innerType;\n};\n// ==================== ALL PROCESSORS ====================\nexport const allProcessors = {\n string: stringProcessor,\n number: numberProcessor,\n boolean: booleanProcessor,\n bigint: bigintProcessor,\n symbol: symbolProcessor,\n null: nullProcessor,\n undefined: undefinedProcessor,\n void: voidProcessor,\n never: neverProcessor,\n any: anyProcessor,\n unknown: unknownProcessor,\n date: dateProcessor,\n enum: enumProcessor,\n literal: literalProcessor,\n nan: nanProcessor,\n template_literal: templateLiteralProcessor,\n file: fileProcessor,\n success: successProcessor,\n custom: customProcessor,\n function: functionProcessor,\n transform: transformProcessor,\n map: mapProcessor,\n set: setProcessor,\n array: arrayProcessor,\n object: objectProcessor,\n union: unionProcessor,\n intersection: intersectionProcessor,\n tuple: tupleProcessor,\n record: recordProcessor,\n nullable: nullableProcessor,\n nonoptional: nonoptionalProcessor,\n default: defaultProcessor,\n prefault: prefaultProcessor,\n catch: catchProcessor,\n pipe: pipeProcessor,\n readonly: readonlyProcessor,\n promise: promiseProcessor,\n optional: optionalProcessor,\n lazy: lazyProcessor,\n};\nexport function toJSONSchema(input, params) {\n if (\"_idmap\" in input) {\n // Registry case\n const registry = input;\n const ctx = initializeContext({ ...params, processors: allProcessors });\n const defs = {};\n // First pass: process all schemas to build the seen map\n for (const entry of registry._idmap.entries()) {\n const [_, schema] = entry;\n process(schema, ctx);\n }\n const schemas = {};\n const external = {\n registry,\n uri: params?.uri,\n defs,\n };\n // Update the context with external configuration\n ctx.external = external;\n // Second pass: emit each schema\n for (const entry of registry._idmap.entries()) {\n const [key, schema] = entry;\n extractDefs(ctx, schema);\n schemas[key] = finalize(ctx, schema);\n }\n if (Object.keys(defs).length > 0) {\n const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n schemas.__shared = {\n [defsSegment]: defs,\n };\n }\n return { schemas };\n }\n // Single schema case\n const ctx = initializeContext({ ...params, processors: allProcessors });\n process(input, ctx);\n extractDefs(ctx, input);\n return finalize(ctx, input);\n}\n","import * as core from \"../core/index.js\";\nimport * as schemas from \"./schemas.js\";\nexport const ZodISODateTime = /*@__PURE__*/ core.$constructor(\"ZodISODateTime\", (inst, def) => {\n core.$ZodISODateTime.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function datetime(params) {\n return core._isoDateTime(ZodISODateTime, params);\n}\nexport const ZodISODate = /*@__PURE__*/ core.$constructor(\"ZodISODate\", (inst, def) => {\n core.$ZodISODate.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function date(params) {\n return core._isoDate(ZodISODate, params);\n}\nexport const ZodISOTime = /*@__PURE__*/ core.$constructor(\"ZodISOTime\", (inst, def) => {\n core.$ZodISOTime.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function time(params) {\n return core._isoTime(ZodISOTime, params);\n}\nexport const ZodISODuration = /*@__PURE__*/ core.$constructor(\"ZodISODuration\", (inst, def) => {\n core.$ZodISODuration.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function duration(params) {\n return core._isoDuration(ZodISODuration, params);\n}\n","import * as core from \"../core/index.js\";\nimport { $ZodError } from \"../core/index.js\";\nimport * as util from \"../core/util.js\";\nconst initializer = (inst, issues) => {\n $ZodError.init(inst, issues);\n inst.name = \"ZodError\";\n Object.defineProperties(inst, {\n format: {\n value: (mapper) => core.formatError(inst, mapper),\n // enumerable: false,\n },\n flatten: {\n value: (mapper) => core.flattenError(inst, mapper),\n // enumerable: false,\n },\n addIssue: {\n value: (issue) => {\n inst.issues.push(issue);\n inst.message = JSON.stringify(inst.issues, util.jsonStringifyReplacer, 2);\n },\n // enumerable: false,\n },\n addIssues: {\n value: (issues) => {\n inst.issues.push(...issues);\n inst.message = JSON.stringify(inst.issues, util.jsonStringifyReplacer, 2);\n },\n // enumerable: false,\n },\n isEmpty: {\n get() {\n return inst.issues.length === 0;\n },\n // enumerable: false,\n },\n });\n // Object.defineProperty(inst, \"isEmpty\", {\n // get() {\n // return inst.issues.length === 0;\n // },\n // });\n};\nexport const ZodError = /*@__PURE__*/ core.$constructor(\"ZodError\", initializer);\nexport const ZodRealError = /*@__PURE__*/ core.$constructor(\"ZodError\", initializer, {\n Parent: Error,\n});\n// /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */\n// export type ErrorMapCtx = core.$ZodErrorMapCtx;\n","import * as core from \"../core/index.js\";\nimport { ZodRealError } from \"./errors.js\";\nexport const parse = /* @__PURE__ */ core._parse(ZodRealError);\nexport const parseAsync = /* @__PURE__ */ core._parseAsync(ZodRealError);\nexport const safeParse = /* @__PURE__ */ core._safeParse(ZodRealError);\nexport const safeParseAsync = /* @__PURE__ */ core._safeParseAsync(ZodRealError);\n// Codec functions\nexport const encode = /* @__PURE__ */ core._encode(ZodRealError);\nexport const decode = /* @__PURE__ */ core._decode(ZodRealError);\nexport const encodeAsync = /* @__PURE__ */ core._encodeAsync(ZodRealError);\nexport const decodeAsync = /* @__PURE__ */ core._decodeAsync(ZodRealError);\nexport const safeEncode = /* @__PURE__ */ core._safeEncode(ZodRealError);\nexport const safeDecode = /* @__PURE__ */ core._safeDecode(ZodRealError);\nexport const safeEncodeAsync = /* @__PURE__ */ core._safeEncodeAsync(ZodRealError);\nexport const safeDecodeAsync = /* @__PURE__ */ core._safeDecodeAsync(ZodRealError);\n","import * as core from \"../core/index.js\";\nimport { util } from \"../core/index.js\";\nimport * as processors from \"../core/json-schema-processors.js\";\nimport { createStandardJSONSchemaMethod, createToJSONSchemaMethod } from \"../core/to-json-schema.js\";\nimport * as checks from \"./checks.js\";\nimport * as iso from \"./iso.js\";\nimport * as parse from \"./parse.js\";\n// Lazy-bind builder methods.\n//\n// Builder methods (`.optional`, `.array`, `.refine`, ...) live as\n// non-enumerable getters on each concrete schema constructor's\n// prototype. On first access from an instance the getter allocates\n// `fn.bind(this)` and caches it as an own property on that instance,\n// so detached usage (`const m = schema.optional; m()`) still works\n// and the per-instance allocation only happens for methods actually\n// touched.\n//\n// One install per (prototype, group), memoized by `_installedGroups`.\nconst _installedGroups = /* @__PURE__ */ new WeakMap();\nfunction _installLazyMethods(inst, group, methods) {\n const proto = Object.getPrototypeOf(inst);\n let installed = _installedGroups.get(proto);\n if (!installed) {\n installed = new Set();\n _installedGroups.set(proto, installed);\n }\n if (installed.has(group))\n return;\n installed.add(group);\n for (const key in methods) {\n const fn = methods[key];\n Object.defineProperty(proto, key, {\n configurable: true,\n enumerable: false,\n get() {\n const bound = fn.bind(this);\n Object.defineProperty(this, key, {\n configurable: true,\n writable: true,\n enumerable: true,\n value: bound,\n });\n return bound;\n },\n set(v) {\n Object.defineProperty(this, key, {\n configurable: true,\n writable: true,\n enumerable: true,\n value: v,\n });\n },\n });\n }\n}\nexport const ZodType = /*@__PURE__*/ core.$constructor(\"ZodType\", (inst, def) => {\n core.$ZodType.init(inst, def);\n Object.assign(inst[\"~standard\"], {\n jsonSchema: {\n input: createStandardJSONSchemaMethod(inst, \"input\"),\n output: createStandardJSONSchemaMethod(inst, \"output\"),\n },\n });\n inst.toJSONSchema = createToJSONSchemaMethod(inst, {});\n inst.def = def;\n inst.type = def.type;\n Object.defineProperty(inst, \"_def\", { value: def });\n // Parse-family is intentionally kept as per-instance closures: these are\n // the hot path AND the most-detached methods (`arr.map(schema.parse)`,\n // `const { parse } = schema`, etc.). Eager closures here mean callers pay\n // ~12 closure allocations per schema but get monomorphic call sites and\n // detached usage that \"just works\".\n inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });\n inst.safeParse = (data, params) => parse.safeParse(inst, data, params);\n inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });\n inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);\n inst.spa = inst.safeParseAsync;\n inst.encode = (data, params) => parse.encode(inst, data, params);\n inst.decode = (data, params) => parse.decode(inst, data, params);\n inst.encodeAsync = async (data, params) => parse.encodeAsync(inst, data, params);\n inst.decodeAsync = async (data, params) => parse.decodeAsync(inst, data, params);\n inst.safeEncode = (data, params) => parse.safeEncode(inst, data, params);\n inst.safeDecode = (data, params) => parse.safeDecode(inst, data, params);\n inst.safeEncodeAsync = async (data, params) => parse.safeEncodeAsync(inst, data, params);\n inst.safeDecodeAsync = async (data, params) => parse.safeDecodeAsync(inst, data, params);\n // All builder methods are placed on the internal prototype as lazy-bind\n // getters. On first access per-instance, a bound thunk is allocated and\n // cached as an own property; subsequent accesses skip the getter. This\n // means: no per-instance allocation for unused methods, full\n // detachability preserved (`const m = schema.optional; m()` works), and\n // shared underlying function references across all instances.\n _installLazyMethods(inst, \"ZodType\", {\n check(...chks) {\n const def = this.def;\n return this.clone(util.mergeDefs(def, {\n checks: [\n ...(def.checks ?? []),\n ...chks.map((ch) => typeof ch === \"function\" ? { _zod: { check: ch, def: { check: \"custom\" }, onattach: [] } } : ch),\n ],\n }), { parent: true });\n },\n with(...chks) {\n return this.check(...chks);\n },\n clone(def, params) {\n return core.clone(this, def, params);\n },\n brand() {\n return this;\n },\n register(reg, meta) {\n reg.add(this, meta);\n return this;\n },\n refine(check, params) {\n return this.check(refine(check, params));\n },\n superRefine(refinement, params) {\n return this.check(superRefine(refinement, params));\n },\n overwrite(fn) {\n return this.check(checks.overwrite(fn));\n },\n optional() {\n return optional(this);\n },\n exactOptional() {\n return exactOptional(this);\n },\n nullable() {\n return nullable(this);\n },\n nullish() {\n return optional(nullable(this));\n },\n nonoptional(params) {\n return nonoptional(this, params);\n },\n array() {\n return array(this);\n },\n or(arg) {\n return union([this, arg]);\n },\n and(arg) {\n return intersection(this, arg);\n },\n transform(tx) {\n return pipe(this, transform(tx));\n },\n default(d) {\n return _default(this, d);\n },\n prefault(d) {\n return prefault(this, d);\n },\n catch(params) {\n return _catch(this, params);\n },\n pipe(target) {\n return pipe(this, target);\n },\n readonly() {\n return readonly(this);\n },\n describe(description) {\n const cl = this.clone();\n core.globalRegistry.add(cl, { description });\n return cl;\n },\n meta(...args) {\n // overloaded: meta() returns the registered metadata, meta(data)\n // returns a clone with `data` registered. The mapped type picks\n // up the second overload, so we accept variadic any-args and\n // return `any` to satisfy both at runtime.\n if (args.length === 0)\n return core.globalRegistry.get(this);\n const cl = this.clone();\n core.globalRegistry.add(cl, args[0]);\n return cl;\n },\n isOptional() {\n return this.safeParse(undefined).success;\n },\n isNullable() {\n return this.safeParse(null).success;\n },\n apply(fn) {\n return fn(this);\n },\n });\n Object.defineProperty(inst, \"description\", {\n get() {\n return core.globalRegistry.get(inst)?.description;\n },\n configurable: true,\n });\n return inst;\n});\n/** @internal */\nexport const _ZodString = /*@__PURE__*/ core.$constructor(\"_ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.stringProcessor(inst, ctx, json, params);\n const bag = inst._zod.bag;\n inst.format = bag.format ?? null;\n inst.minLength = bag.minimum ?? null;\n inst.maxLength = bag.maximum ?? null;\n _installLazyMethods(inst, \"_ZodString\", {\n regex(...args) {\n return this.check(checks.regex(...args));\n },\n includes(...args) {\n return this.check(checks.includes(...args));\n },\n startsWith(...args) {\n return this.check(checks.startsWith(...args));\n },\n endsWith(...args) {\n return this.check(checks.endsWith(...args));\n },\n min(...args) {\n return this.check(checks.minLength(...args));\n },\n max(...args) {\n return this.check(checks.maxLength(...args));\n },\n length(...args) {\n return this.check(checks.length(...args));\n },\n nonempty(...args) {\n return this.check(checks.minLength(1, ...args));\n },\n lowercase(params) {\n return this.check(checks.lowercase(params));\n },\n uppercase(params) {\n return this.check(checks.uppercase(params));\n },\n trim() {\n return this.check(checks.trim());\n },\n normalize(...args) {\n return this.check(checks.normalize(...args));\n },\n toLowerCase() {\n return this.check(checks.toLowerCase());\n },\n toUpperCase() {\n return this.check(checks.toUpperCase());\n },\n slugify() {\n return this.check(checks.slugify());\n },\n });\n});\nexport const ZodString = /*@__PURE__*/ core.$constructor(\"ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n _ZodString.init(inst, def);\n inst.email = (params) => inst.check(core._email(ZodEmail, params));\n inst.url = (params) => inst.check(core._url(ZodURL, params));\n inst.jwt = (params) => inst.check(core._jwt(ZodJWT, params));\n inst.emoji = (params) => inst.check(core._emoji(ZodEmoji, params));\n inst.guid = (params) => inst.check(core._guid(ZodGUID, params));\n inst.uuid = (params) => inst.check(core._uuid(ZodUUID, params));\n inst.uuidv4 = (params) => inst.check(core._uuidv4(ZodUUID, params));\n inst.uuidv6 = (params) => inst.check(core._uuidv6(ZodUUID, params));\n inst.uuidv7 = (params) => inst.check(core._uuidv7(ZodUUID, params));\n inst.nanoid = (params) => inst.check(core._nanoid(ZodNanoID, params));\n inst.guid = (params) => inst.check(core._guid(ZodGUID, params));\n inst.cuid = (params) => inst.check(core._cuid(ZodCUID, params));\n inst.cuid2 = (params) => inst.check(core._cuid2(ZodCUID2, params));\n inst.ulid = (params) => inst.check(core._ulid(ZodULID, params));\n inst.base64 = (params) => inst.check(core._base64(ZodBase64, params));\n inst.base64url = (params) => inst.check(core._base64url(ZodBase64URL, params));\n inst.xid = (params) => inst.check(core._xid(ZodXID, params));\n inst.ksuid = (params) => inst.check(core._ksuid(ZodKSUID, params));\n inst.ipv4 = (params) => inst.check(core._ipv4(ZodIPv4, params));\n inst.ipv6 = (params) => inst.check(core._ipv6(ZodIPv6, params));\n inst.cidrv4 = (params) => inst.check(core._cidrv4(ZodCIDRv4, params));\n inst.cidrv6 = (params) => inst.check(core._cidrv6(ZodCIDRv6, params));\n inst.e164 = (params) => inst.check(core._e164(ZodE164, params));\n // iso\n inst.datetime = (params) => inst.check(iso.datetime(params));\n inst.date = (params) => inst.check(iso.date(params));\n inst.time = (params) => inst.check(iso.time(params));\n inst.duration = (params) => inst.check(iso.duration(params));\n});\nexport function string(params) {\n return core._string(ZodString, params);\n}\nexport const ZodStringFormat = /*@__PURE__*/ core.$constructor(\"ZodStringFormat\", (inst, def) => {\n core.$ZodStringFormat.init(inst, def);\n _ZodString.init(inst, def);\n});\nexport const ZodEmail = /*@__PURE__*/ core.$constructor(\"ZodEmail\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmail.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function email(params) {\n return core._email(ZodEmail, params);\n}\nexport const ZodGUID = /*@__PURE__*/ core.$constructor(\"ZodGUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodGUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function guid(params) {\n return core._guid(ZodGUID, params);\n}\nexport const ZodUUID = /*@__PURE__*/ core.$constructor(\"ZodUUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodUUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function uuid(params) {\n return core._uuid(ZodUUID, params);\n}\nexport function uuidv4(params) {\n return core._uuidv4(ZodUUID, params);\n}\n// ZodUUIDv6\nexport function uuidv6(params) {\n return core._uuidv6(ZodUUID, params);\n}\n// ZodUUIDv7\nexport function uuidv7(params) {\n return core._uuidv7(ZodUUID, params);\n}\nexport const ZodURL = /*@__PURE__*/ core.$constructor(\"ZodURL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodURL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function url(params) {\n return core._url(ZodURL, params);\n}\nexport function httpUrl(params) {\n return core._url(ZodURL, {\n protocol: core.regexes.httpProtocol,\n hostname: core.regexes.domain,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodEmoji = /*@__PURE__*/ core.$constructor(\"ZodEmoji\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmoji.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function emoji(params) {\n return core._emoji(ZodEmoji, params);\n}\nexport const ZodNanoID = /*@__PURE__*/ core.$constructor(\"ZodNanoID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodNanoID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function nanoid(params) {\n return core._nanoid(ZodNanoID, params);\n}\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link ZodCUID2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport const ZodCUID = /*@__PURE__*/ core.$constructor(\"ZodCUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\n/**\n * Validates a CUID v1 string.\n *\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport function cuid(params) {\n return core._cuid(ZodCUID, params);\n}\nexport const ZodCUID2 = /*@__PURE__*/ core.$constructor(\"ZodCUID2\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID2.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cuid2(params) {\n return core._cuid2(ZodCUID2, params);\n}\nexport const ZodULID = /*@__PURE__*/ core.$constructor(\"ZodULID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodULID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ulid(params) {\n return core._ulid(ZodULID, params);\n}\nexport const ZodXID = /*@__PURE__*/ core.$constructor(\"ZodXID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodXID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function xid(params) {\n return core._xid(ZodXID, params);\n}\nexport const ZodKSUID = /*@__PURE__*/ core.$constructor(\"ZodKSUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodKSUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ksuid(params) {\n return core._ksuid(ZodKSUID, params);\n}\nexport const ZodIPv4 = /*@__PURE__*/ core.$constructor(\"ZodIPv4\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv4(params) {\n return core._ipv4(ZodIPv4, params);\n}\nexport const ZodMAC = /*@__PURE__*/ core.$constructor(\"ZodMAC\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodMAC.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function mac(params) {\n return core._mac(ZodMAC, params);\n}\nexport const ZodIPv6 = /*@__PURE__*/ core.$constructor(\"ZodIPv6\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv6(params) {\n return core._ipv6(ZodIPv6, params);\n}\nexport const ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv4\", (inst, def) => {\n core.$ZodCIDRv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv4(params) {\n return core._cidrv4(ZodCIDRv4, params);\n}\nexport const ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv6\", (inst, def) => {\n core.$ZodCIDRv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv6(params) {\n return core._cidrv6(ZodCIDRv6, params);\n}\nexport const ZodBase64 = /*@__PURE__*/ core.$constructor(\"ZodBase64\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64(params) {\n return core._base64(ZodBase64, params);\n}\nexport const ZodBase64URL = /*@__PURE__*/ core.$constructor(\"ZodBase64URL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64URL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64url(params) {\n return core._base64url(ZodBase64URL, params);\n}\nexport const ZodE164 = /*@__PURE__*/ core.$constructor(\"ZodE164\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodE164.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function e164(params) {\n return core._e164(ZodE164, params);\n}\nexport const ZodJWT = /*@__PURE__*/ core.$constructor(\"ZodJWT\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodJWT.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function jwt(params) {\n return core._jwt(ZodJWT, params);\n}\nexport const ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"ZodCustomStringFormat\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCustomStringFormat.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function stringFormat(format, fnOrRegex, _params = {}) {\n return core._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);\n}\nexport function hostname(_params) {\n return core._stringFormat(ZodCustomStringFormat, \"hostname\", core.regexes.hostname, _params);\n}\nexport function hex(_params) {\n return core._stringFormat(ZodCustomStringFormat, \"hex\", core.regexes.hex, _params);\n}\nexport function hash(alg, params) {\n const enc = params?.enc ?? \"hex\";\n const format = `${alg}_${enc}`;\n const regex = core.regexes[format];\n if (!regex)\n throw new Error(`Unrecognized hash format: ${format}`);\n return core._stringFormat(ZodCustomStringFormat, format, regex, params);\n}\nexport const ZodNumber = /*@__PURE__*/ core.$constructor(\"ZodNumber\", (inst, def) => {\n core.$ZodNumber.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.numberProcessor(inst, ctx, json, params);\n _installLazyMethods(inst, \"ZodNumber\", {\n gt(value, params) {\n return this.check(checks.gt(value, params));\n },\n gte(value, params) {\n return this.check(checks.gte(value, params));\n },\n min(value, params) {\n return this.check(checks.gte(value, params));\n },\n lt(value, params) {\n return this.check(checks.lt(value, params));\n },\n lte(value, params) {\n return this.check(checks.lte(value, params));\n },\n max(value, params) {\n return this.check(checks.lte(value, params));\n },\n int(params) {\n return this.check(int(params));\n },\n safe(params) {\n return this.check(int(params));\n },\n positive(params) {\n return this.check(checks.gt(0, params));\n },\n nonnegative(params) {\n return this.check(checks.gte(0, params));\n },\n negative(params) {\n return this.check(checks.lt(0, params));\n },\n nonpositive(params) {\n return this.check(checks.lte(0, params));\n },\n multipleOf(value, params) {\n return this.check(checks.multipleOf(value, params));\n },\n step(value, params) {\n return this.check(checks.multipleOf(value, params));\n },\n finite() {\n return this;\n },\n });\n const bag = inst._zod.bag;\n inst.minValue =\n Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;\n inst.maxValue =\n Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;\n inst.isInt = (bag.format ?? \"\").includes(\"int\") || Number.isSafeInteger(bag.multipleOf ?? 0.5);\n inst.isFinite = true;\n inst.format = bag.format ?? null;\n});\nexport function number(params) {\n return core._number(ZodNumber, params);\n}\nexport const ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"ZodNumberFormat\", (inst, def) => {\n core.$ZodNumberFormat.init(inst, def);\n ZodNumber.init(inst, def);\n});\nexport function int(params) {\n return core._int(ZodNumberFormat, params);\n}\nexport function float32(params) {\n return core._float32(ZodNumberFormat, params);\n}\nexport function float64(params) {\n return core._float64(ZodNumberFormat, params);\n}\nexport function int32(params) {\n return core._int32(ZodNumberFormat, params);\n}\nexport function uint32(params) {\n return core._uint32(ZodNumberFormat, params);\n}\nexport const ZodBoolean = /*@__PURE__*/ core.$constructor(\"ZodBoolean\", (inst, def) => {\n core.$ZodBoolean.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.booleanProcessor(inst, ctx, json, params);\n});\nexport function boolean(params) {\n return core._boolean(ZodBoolean, params);\n}\nexport const ZodBigInt = /*@__PURE__*/ core.$constructor(\"ZodBigInt\", (inst, def) => {\n core.$ZodBigInt.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.bigintProcessor(inst, ctx, json, params);\n inst.gte = (value, params) => inst.check(checks.gte(value, params));\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.gt = (value, params) => inst.check(checks.gt(value, params));\n inst.gte = (value, params) => inst.check(checks.gte(value, params));\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.lt = (value, params) => inst.check(checks.lt(value, params));\n inst.lte = (value, params) => inst.check(checks.lte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n inst.positive = (params) => inst.check(checks.gt(BigInt(0), params));\n inst.negative = (params) => inst.check(checks.lt(BigInt(0), params));\n inst.nonpositive = (params) => inst.check(checks.lte(BigInt(0), params));\n inst.nonnegative = (params) => inst.check(checks.gte(BigInt(0), params));\n inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));\n const bag = inst._zod.bag;\n inst.minValue = bag.minimum ?? null;\n inst.maxValue = bag.maximum ?? null;\n inst.format = bag.format ?? null;\n});\nexport function bigint(params) {\n return core._bigint(ZodBigInt, params);\n}\nexport const ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"ZodBigIntFormat\", (inst, def) => {\n core.$ZodBigIntFormat.init(inst, def);\n ZodBigInt.init(inst, def);\n});\n// int64\nexport function int64(params) {\n return core._int64(ZodBigIntFormat, params);\n}\n// uint64\nexport function uint64(params) {\n return core._uint64(ZodBigIntFormat, params);\n}\nexport const ZodSymbol = /*@__PURE__*/ core.$constructor(\"ZodSymbol\", (inst, def) => {\n core.$ZodSymbol.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.symbolProcessor(inst, ctx, json, params);\n});\nexport function symbol(params) {\n return core._symbol(ZodSymbol, params);\n}\nexport const ZodUndefined = /*@__PURE__*/ core.$constructor(\"ZodUndefined\", (inst, def) => {\n core.$ZodUndefined.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.undefinedProcessor(inst, ctx, json, params);\n});\nfunction _undefined(params) {\n return core._undefined(ZodUndefined, params);\n}\nexport { _undefined as undefined };\nexport const ZodNull = /*@__PURE__*/ core.$constructor(\"ZodNull\", (inst, def) => {\n core.$ZodNull.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nullProcessor(inst, ctx, json, params);\n});\nfunction _null(params) {\n return core._null(ZodNull, params);\n}\nexport { _null as null };\nexport const ZodAny = /*@__PURE__*/ core.$constructor(\"ZodAny\", (inst, def) => {\n core.$ZodAny.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.anyProcessor(inst, ctx, json, params);\n});\nexport function any() {\n return core._any(ZodAny);\n}\nexport const ZodUnknown = /*@__PURE__*/ core.$constructor(\"ZodUnknown\", (inst, def) => {\n core.$ZodUnknown.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unknownProcessor(inst, ctx, json, params);\n});\nexport function unknown() {\n return core._unknown(ZodUnknown);\n}\nexport const ZodNever = /*@__PURE__*/ core.$constructor(\"ZodNever\", (inst, def) => {\n core.$ZodNever.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.neverProcessor(inst, ctx, json, params);\n});\nexport function never(params) {\n return core._never(ZodNever, params);\n}\nexport const ZodVoid = /*@__PURE__*/ core.$constructor(\"ZodVoid\", (inst, def) => {\n core.$ZodVoid.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.voidProcessor(inst, ctx, json, params);\n});\nfunction _void(params) {\n return core._void(ZodVoid, params);\n}\nexport { _void as void };\nexport const ZodDate = /*@__PURE__*/ core.$constructor(\"ZodDate\", (inst, def) => {\n core.$ZodDate.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.dateProcessor(inst, ctx, json, params);\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n const c = inst._zod.bag;\n inst.minDate = c.minimum ? new Date(c.minimum) : null;\n inst.maxDate = c.maximum ? new Date(c.maximum) : null;\n});\nexport function date(params) {\n return core._date(ZodDate, params);\n}\nexport const ZodArray = /*@__PURE__*/ core.$constructor(\"ZodArray\", (inst, def) => {\n core.$ZodArray.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.arrayProcessor(inst, ctx, json, params);\n inst.element = def.element;\n _installLazyMethods(inst, \"ZodArray\", {\n min(n, params) {\n return this.check(checks.minLength(n, params));\n },\n nonempty(params) {\n return this.check(checks.minLength(1, params));\n },\n max(n, params) {\n return this.check(checks.maxLength(n, params));\n },\n length(n, params) {\n return this.check(checks.length(n, params));\n },\n unwrap() {\n return this.element;\n },\n });\n});\nexport function array(element, params) {\n return core._array(ZodArray, element, params);\n}\n// .keyof\nexport function keyof(schema) {\n const shape = schema._zod.def.shape;\n return _enum(Object.keys(shape));\n}\nexport const ZodObject = /*@__PURE__*/ core.$constructor(\"ZodObject\", (inst, def) => {\n core.$ZodObjectJIT.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.objectProcessor(inst, ctx, json, params);\n util.defineLazy(inst, \"shape\", () => {\n return def.shape;\n });\n _installLazyMethods(inst, \"ZodObject\", {\n keyof() {\n return _enum(Object.keys(this._zod.def.shape));\n },\n catchall(catchall) {\n return this.clone({ ...this._zod.def, catchall: catchall });\n },\n passthrough() {\n return this.clone({ ...this._zod.def, catchall: unknown() });\n },\n loose() {\n return this.clone({ ...this._zod.def, catchall: unknown() });\n },\n strict() {\n return this.clone({ ...this._zod.def, catchall: never() });\n },\n strip() {\n return this.clone({ ...this._zod.def, catchall: undefined });\n },\n extend(incoming) {\n return util.extend(this, incoming);\n },\n safeExtend(incoming) {\n return util.safeExtend(this, incoming);\n },\n merge(other) {\n return util.merge(this, other);\n },\n pick(mask) {\n return util.pick(this, mask);\n },\n omit(mask) {\n return util.omit(this, mask);\n },\n partial(...args) {\n return util.partial(ZodOptional, this, args[0]);\n },\n required(...args) {\n return util.required(ZodNonOptional, this, args[0]);\n },\n });\n});\nexport function object(shape, params) {\n const def = {\n type: \"object\",\n shape: shape ?? {},\n ...util.normalizeParams(params),\n };\n return new ZodObject(def);\n}\n// strictObject\nexport function strictObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n shape,\n catchall: never(),\n ...util.normalizeParams(params),\n });\n}\n// looseObject\nexport function looseObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n shape,\n catchall: unknown(),\n ...util.normalizeParams(params),\n });\n}\nexport const ZodUnion = /*@__PURE__*/ core.$constructor(\"ZodUnion\", (inst, def) => {\n core.$ZodUnion.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);\n inst.options = def.options;\n});\nexport function union(options, params) {\n return new ZodUnion({\n type: \"union\",\n options: options,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodXor = /*@__PURE__*/ core.$constructor(\"ZodXor\", (inst, def) => {\n ZodUnion.init(inst, def);\n core.$ZodXor.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);\n inst.options = def.options;\n});\n/** Creates an exclusive union (XOR) where exactly one option must match.\n * Unlike regular unions that succeed when any option matches, xor fails if\n * zero or more than one option matches the input. */\nexport function xor(options, params) {\n return new ZodXor({\n type: \"union\",\n options: options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodDiscriminatedUnion = /*@__PURE__*/ core.$constructor(\"ZodDiscriminatedUnion\", (inst, def) => {\n ZodUnion.init(inst, def);\n core.$ZodDiscriminatedUnion.init(inst, def);\n});\nexport function discriminatedUnion(discriminator, options, params) {\n // const [options, params] = args;\n return new ZodDiscriminatedUnion({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodIntersection = /*@__PURE__*/ core.$constructor(\"ZodIntersection\", (inst, def) => {\n core.$ZodIntersection.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.intersectionProcessor(inst, ctx, json, params);\n});\nexport function intersection(left, right) {\n return new ZodIntersection({\n type: \"intersection\",\n left: left,\n right: right,\n });\n}\nexport const ZodTuple = /*@__PURE__*/ core.$constructor(\"ZodTuple\", (inst, def) => {\n core.$ZodTuple.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.tupleProcessor(inst, ctx, json, params);\n inst.rest = (rest) => inst.clone({\n ...inst._zod.def,\n rest: rest,\n });\n});\nexport function tuple(items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof core.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new ZodTuple({\n type: \"tuple\",\n items: items,\n rest,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodRecord = /*@__PURE__*/ core.$constructor(\"ZodRecord\", (inst, def) => {\n core.$ZodRecord.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.recordProcessor(inst, ctx, json, params);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n});\nexport function record(keyType, valueType, params) {\n // v3-compat: z.record(valueType, params?) — defaults keyType to z.string()\n if (!valueType || !valueType._zod) {\n return new ZodRecord({\n type: \"record\",\n keyType: string(),\n valueType: keyType,\n ...util.normalizeParams(valueType),\n });\n }\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\n// type alksjf = core.output<core.$ZodRecordKey>;\nexport function partialRecord(keyType, valueType, params) {\n const k = core.clone(keyType);\n k._zod.values = undefined;\n return new ZodRecord({\n type: \"record\",\n keyType: k,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function looseRecord(keyType, valueType, params) {\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n mode: \"loose\",\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMap = /*@__PURE__*/ core.$constructor(\"ZodMap\", (inst, def) => {\n core.$ZodMap.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.mapProcessor(inst, ctx, json, params);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n inst.min = (...args) => inst.check(core._minSize(...args));\n inst.nonempty = (params) => inst.check(core._minSize(1, params));\n inst.max = (...args) => inst.check(core._maxSize(...args));\n inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function map(keyType, valueType, params) {\n return new ZodMap({\n type: \"map\",\n keyType: keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSet = /*@__PURE__*/ core.$constructor(\"ZodSet\", (inst, def) => {\n core.$ZodSet.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.setProcessor(inst, ctx, json, params);\n inst.min = (...args) => inst.check(core._minSize(...args));\n inst.nonempty = (params) => inst.check(core._minSize(1, params));\n inst.max = (...args) => inst.check(core._maxSize(...args));\n inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function set(valueType, params) {\n return new ZodSet({\n type: \"set\",\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodEnum = /*@__PURE__*/ core.$constructor(\"ZodEnum\", (inst, def) => {\n core.$ZodEnum.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.enumProcessor(inst, ctx, json, params);\n inst.enum = def.entries;\n inst.options = Object.values(def.entries);\n const keys = new Set(Object.keys(def.entries));\n inst.extract = (values, params) => {\n const newEntries = {};\n for (const value of values) {\n if (keys.has(value)) {\n newEntries[value] = def.entries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n inst.exclude = (values, params) => {\n const newEntries = { ...def.entries };\n for (const value of values) {\n if (keys.has(value)) {\n delete newEntries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n});\nfunction _enum(values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n return new ZodEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport { _enum as enum };\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function nativeEnum(entries, params) {\n return new ZodEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLiteral = /*@__PURE__*/ core.$constructor(\"ZodLiteral\", (inst, def) => {\n core.$ZodLiteral.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.literalProcessor(inst, ctx, json, params);\n inst.values = new Set(def.values);\n Object.defineProperty(inst, \"value\", {\n get() {\n if (def.values.length > 1) {\n throw new Error(\"This schema contains multiple valid literal values. Use `.values` instead.\");\n }\n return def.values[0];\n },\n });\n});\nexport function literal(value, params) {\n return new ZodLiteral({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\nexport const ZodFile = /*@__PURE__*/ core.$constructor(\"ZodFile\", (inst, def) => {\n core.$ZodFile.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.fileProcessor(inst, ctx, json, params);\n inst.min = (size, params) => inst.check(core._minSize(size, params));\n inst.max = (size, params) => inst.check(core._maxSize(size, params));\n inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));\n});\nexport function file(params) {\n return core._file(ZodFile, params);\n}\nexport const ZodTransform = /*@__PURE__*/ core.$constructor(\"ZodTransform\", (inst, def) => {\n core.$ZodTransform.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.transformProcessor(inst, ctx, json, params);\n inst._zod.parse = (payload, _ctx) => {\n if (_ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(inst.constructor.name);\n }\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = inst);\n // _issue.continue ??= true;\n payload.issues.push(util.issue(_issue));\n }\n };\n const output = def.transform(payload.value, payload);\n if (output instanceof Promise) {\n return output.then((output) => {\n payload.value = output;\n payload.fallback = true;\n return payload;\n });\n }\n payload.value = output;\n payload.fallback = true;\n return payload;\n };\n});\nexport function transform(fn) {\n return new ZodTransform({\n type: \"transform\",\n transform: fn,\n });\n}\nexport const ZodOptional = /*@__PURE__*/ core.$constructor(\"ZodOptional\", (inst, def) => {\n core.$ZodOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function optional(innerType) {\n return new ZodOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodExactOptional = /*@__PURE__*/ core.$constructor(\"ZodExactOptional\", (inst, def) => {\n core.$ZodExactOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function exactOptional(innerType) {\n return new ZodExactOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodNullable = /*@__PURE__*/ core.$constructor(\"ZodNullable\", (inst, def) => {\n core.$ZodNullable.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nullableProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nullable(innerType) {\n return new ZodNullable({\n type: \"nullable\",\n innerType: innerType,\n });\n}\n// nullish\nexport function nullish(innerType) {\n return optional(nullable(innerType));\n}\nexport const ZodDefault = /*@__PURE__*/ core.$constructor(\"ZodDefault\", (inst, def) => {\n core.$ZodDefault.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.defaultProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeDefault = inst.unwrap;\n});\nexport function _default(innerType, defaultValue) {\n return new ZodDefault({\n type: \"default\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodPrefault = /*@__PURE__*/ core.$constructor(\"ZodPrefault\", (inst, def) => {\n core.$ZodPrefault.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.prefaultProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function prefault(innerType, defaultValue) {\n return new ZodPrefault({\n type: \"prefault\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodNonOptional = /*@__PURE__*/ core.$constructor(\"ZodNonOptional\", (inst, def) => {\n core.$ZodNonOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nonoptionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nonoptional(innerType, params) {\n return new ZodNonOptional({\n type: \"nonoptional\",\n innerType: innerType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSuccess = /*@__PURE__*/ core.$constructor(\"ZodSuccess\", (inst, def) => {\n core.$ZodSuccess.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.successProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function success(innerType) {\n return new ZodSuccess({\n type: \"success\",\n innerType: innerType,\n });\n}\nexport const ZodCatch = /*@__PURE__*/ core.$constructor(\"ZodCatch\", (inst, def) => {\n core.$ZodCatch.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.catchProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeCatch = inst.unwrap;\n});\nfunction _catch(innerType, catchValue) {\n return new ZodCatch({\n type: \"catch\",\n innerType: innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\nexport { _catch as catch };\nexport const ZodNaN = /*@__PURE__*/ core.$constructor(\"ZodNaN\", (inst, def) => {\n core.$ZodNaN.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nanProcessor(inst, ctx, json, params);\n});\nexport function nan(params) {\n return core._nan(ZodNaN, params);\n}\nexport const ZodPipe = /*@__PURE__*/ core.$constructor(\"ZodPipe\", (inst, def) => {\n core.$ZodPipe.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.pipeProcessor(inst, ctx, json, params);\n inst.in = def.in;\n inst.out = def.out;\n});\nexport function pipe(in_, out) {\n return new ZodPipe({\n type: \"pipe\",\n in: in_,\n out: out,\n // ...util.normalizeParams(params),\n });\n}\nexport const ZodCodec = /*@__PURE__*/ core.$constructor(\"ZodCodec\", (inst, def) => {\n ZodPipe.init(inst, def);\n core.$ZodCodec.init(inst, def);\n});\nexport function codec(in_, out, params) {\n return new ZodCodec({\n type: \"pipe\",\n in: in_,\n out: out,\n transform: params.decode,\n reverseTransform: params.encode,\n });\n}\nexport function invertCodec(codec) {\n const def = codec._zod.def;\n return new ZodCodec({\n type: \"pipe\",\n in: def.out,\n out: def.in,\n transform: def.reverseTransform,\n reverseTransform: def.transform,\n });\n}\nexport const ZodPreprocess = /*@__PURE__*/ core.$constructor(\"ZodPreprocess\", (inst, def) => {\n ZodPipe.init(inst, def);\n core.$ZodPreprocess.init(inst, def);\n});\nexport const ZodReadonly = /*@__PURE__*/ core.$constructor(\"ZodReadonly\", (inst, def) => {\n core.$ZodReadonly.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.readonlyProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function readonly(innerType) {\n return new ZodReadonly({\n type: \"readonly\",\n innerType: innerType,\n });\n}\nexport const ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"ZodTemplateLiteral\", (inst, def) => {\n core.$ZodTemplateLiteral.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.templateLiteralProcessor(inst, ctx, json, params);\n});\nexport function templateLiteral(parts, params) {\n return new ZodTemplateLiteral({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLazy = /*@__PURE__*/ core.$constructor(\"ZodLazy\", (inst, def) => {\n core.$ZodLazy.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.lazyProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.getter();\n});\nexport function lazy(getter) {\n return new ZodLazy({\n type: \"lazy\",\n getter: getter,\n });\n}\nexport const ZodPromise = /*@__PURE__*/ core.$constructor(\"ZodPromise\", (inst, def) => {\n core.$ZodPromise.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.promiseProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function promise(innerType) {\n return new ZodPromise({\n type: \"promise\",\n innerType: innerType,\n });\n}\nexport const ZodFunction = /*@__PURE__*/ core.$constructor(\"ZodFunction\", (inst, def) => {\n core.$ZodFunction.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.functionProcessor(inst, ctx, json, params);\n});\nexport function _function(params) {\n return new ZodFunction({\n type: \"function\",\n input: Array.isArray(params?.input) ? tuple(params?.input) : (params?.input ?? array(unknown())),\n output: params?.output ?? unknown(),\n });\n}\nexport { _function as function };\nexport const ZodCustom = /*@__PURE__*/ core.$constructor(\"ZodCustom\", (inst, def) => {\n core.$ZodCustom.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.customProcessor(inst, ctx, json, params);\n});\n// custom checks\nexport function check(fn) {\n const ch = new core.$ZodCheck({\n check: \"custom\",\n // ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\nexport function custom(fn, _params) {\n return core._custom(ZodCustom, fn ?? (() => true), _params);\n}\nexport function refine(fn, _params = {}) {\n return core._refine(ZodCustom, fn, _params);\n}\n// superRefine\nexport function superRefine(fn, params) {\n return core._superRefine(fn, params);\n}\n// Re-export describe and meta from core\nexport const describe = core.describe;\nexport const meta = core.meta;\nfunction _instanceof(cls, params = {}) {\n const inst = new ZodCustom({\n type: \"custom\",\n check: \"custom\",\n fn: (data) => data instanceof cls,\n abort: true,\n ...util.normalizeParams(params),\n });\n inst._zod.bag.Class = cls;\n // Override check to emit invalid_type instead of custom\n inst._zod.check = (payload) => {\n if (!(payload.value instanceof cls)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: cls.name,\n input: payload.value,\n inst,\n path: [...(inst._zod.def.path ?? [])],\n });\n }\n };\n return inst;\n}\nexport { _instanceof as instanceof };\n// stringbool\nexport const stringbool = (...args) => core._stringbool({\n Codec: ZodCodec,\n Boolean: ZodBoolean,\n String: ZodString,\n}, ...args);\nexport function json(params) {\n const jsonSchema = lazy(() => {\n return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);\n });\n return jsonSchema;\n}\n// preprocess\nexport function preprocess(fn, schema) {\n return new ZodPreprocess({\n type: \"pipe\",\n in: transform(fn),\n out: schema,\n });\n}\n","import * as core from \"../core/index.js\";\nimport * as schemas from \"./schemas.js\";\nexport function string(params) {\n return core._coercedString(schemas.ZodString, params);\n}\nexport function number(params) {\n return core._coercedNumber(schemas.ZodNumber, params);\n}\nexport function boolean(params) {\n return core._coercedBoolean(schemas.ZodBoolean, params);\n}\nexport function bigint(params) {\n return core._coercedBigint(schemas.ZodBigInt, params);\n}\nexport function date(params) {\n return core._coercedDate(schemas.ZodDate, params);\n}\n","import { z } from \"zod\";\n//#region src/constants/conventions.ts\n/** File-layout rules shared by agents, workflows, triggers, and OpenAPI `x-keystroke`. */\nconst DISCOVERY_CONVENTIONS = {\n\tagents: {\n\t\tflat: \"{name}.ts → POST /agents/{name}\",\n\t\tnested: \"{path}/agent.ts or {path}/index.ts → POST /agents/{path}\",\n\t\thelpers: \"Other .ts files under nested folders are not mounted.\"\n\t},\n\tworkflows: {\n\t\tflat: \"{name}.ts → POST /workflows/{name}\",\n\t\tnested: \"{path}/workflow.ts or {path}/index.ts → POST /workflows/{path}\",\n\t\thelpers: \"Other .ts files under nested folders are not mounted.\"\n\t},\n\ttriggers: {\n\t\tflat: \"{name}.ts → trigger key {name}, attachment id {triggerKey}:{workflowKey}\",\n\t\tnested: \"{path}/trigger.ts or {path}/index.ts → trigger key {path}\",\n\t\thelpers: \"Reusable sources live under triggers/sources/ and are not discovered.\"\n\t},\n\topenapi: \"GET /openapi.json is built from the same discovery + mount loop as the live server.\"\n};\n//#endregion\n//#region src/constants/http.ts\nconst ACTIVE_ORG_COOKIE = \"keystroke-active-org-id\";\nconst ACTIVE_ORG_HEADER = \"x-keystroke-org-id\";\n//#endregion\n//#region src/organization-slug.ts\n/** Auth, session, and account-entry URL segments. */\nconst AUTH_ACCOUNT_SLUGS = [\n\t\"2fa\",\n\t\"accept-invite\",\n\t\"auth\",\n\t\"authorize\",\n\t\"callback\",\n\t\"callbacks\",\n\t\"confirm-email\",\n\t\"confirmation\",\n\t\"connect\",\n\t\"device\",\n\t\"email-verification\",\n\t\"forgot-password\",\n\t\"invite\",\n\t\"invites\",\n\t\"login\",\n\t\"logout\",\n\t\"magic-link\",\n\t\"mfa\",\n\t\"oauth\",\n\t\"onboarding\",\n\t\"password\",\n\t\"recovery\",\n\t\"register\",\n\t\"reset-password\",\n\t\"saml\",\n\t\"session\",\n\t\"sessions\",\n\t\"sign-in\",\n\t\"sign-up\",\n\t\"signin\",\n\t\"signout\",\n\t\"signup\",\n\t\"sso\",\n\t\"token\",\n\t\"tokens\",\n\t\"unlink\",\n\t\"verify\",\n\t\"verify-email\"\n];\n/** Org, workspace, billing, and account-management URL segments. */\nconst ORG_ACCOUNT_SLUGS = [\n\t\"account\",\n\t\"accounts\",\n\t\"billing\",\n\t\"console\",\n\t\"invoice\",\n\t\"invoices\",\n\t\"member\",\n\t\"members\",\n\t\"me\",\n\t\"org\",\n\t\"organization\",\n\t\"organizations\",\n\t\"orgs\",\n\t\"payment\",\n\t\"payments\",\n\t\"plan\",\n\t\"plans\",\n\t\"portal\",\n\t\"preferences\",\n\t\"profile\",\n\t\"settings\",\n\t\"subscription\",\n\t\"subscriptions\",\n\t\"team\",\n\t\"teams\",\n\t\"upgrade\",\n\t\"usage\",\n\t\"user\",\n\t\"users\",\n\t\"workspace\",\n\t\"workspaces\"\n];\n/** Product surfaces, resource types, and in-app navigation segments. */\nconst PRODUCT_SLUGS = [\n\t\"action\",\n\t\"actions\",\n\t\"activity\",\n\t\"agent\",\n\t\"agents\",\n\t\"analytics\",\n\t\"app\",\n\t\"apps\",\n\t\"artifact\",\n\t\"artifacts\",\n\t\"assistant\",\n\t\"assistants\",\n\t\"audit\",\n\t\"audit-log\",\n\t\"automation\",\n\t\"automations\",\n\t\"branch\",\n\t\"branches\",\n\t\"canvas\",\n\t\"chat\",\n\t\"chats\",\n\t\"connection\",\n\t\"connections\",\n\t\"create\",\n\t\"credential\",\n\t\"credentials\",\n\t\"dashboard\",\n\t\"deployment\",\n\t\"deployments\",\n\t\"examples\",\n\t\"execute\",\n\t\"execution\",\n\t\"executions\",\n\t\"explore\",\n\t\"get-started\",\n\t\"history\",\n\t\"inbox\",\n\t\"inspector\",\n\t\"integration\",\n\t\"integrations\",\n\t\"library\",\n\t\"logs\",\n\t\"marketplace\",\n\t\"mcp\",\n\t\"mcps\",\n\t\"new\",\n\t\"notifications\",\n\t\"observe\",\n\t\"plugin\",\n\t\"plugins\",\n\t\"primitive\",\n\t\"primitives\",\n\t\"project\",\n\t\"projects\",\n\t\"recents\",\n\t\"registry\",\n\t\"reports\",\n\t\"run\",\n\t\"runs\",\n\t\"runtime\",\n\t\"runtimes\",\n\t\"sandbox\",\n\t\"sandboxes\",\n\t\"search\",\n\t\"skill\",\n\t\"skills\",\n\t\"templates\",\n\t\"thread\",\n\t\"threads\",\n\t\"trigger\",\n\t\"triggers\",\n\t\"version\",\n\t\"versions\",\n\t\"workflow\",\n\t\"workflows\"\n];\n/** Marketing, docs, company, and go-to-market URL segments. */\nconst MARKETING_SITE_SLUGS = [\n\t\"about\",\n\t\"affiliates\",\n\t\"ai\",\n\t\"announcements\",\n\t\"anthropic\",\n\t\"blog\",\n\t\"book-demo\",\n\t\"brand\",\n\t\"campaigns\",\n\t\"career\",\n\t\"careers\",\n\t\"case-studies\",\n\t\"casestudies\",\n\t\"changelog\",\n\t\"chatgpt\",\n\t\"chrome-extension\",\n\t\"claude\",\n\t\"codex\",\n\t\"community\",\n\t\"company\",\n\t\"compare\",\n\t\"contact\",\n\t\"contribute\",\n\t\"creators\",\n\t\"customers\",\n\t\"demo\",\n\t\"demos\",\n\t\"discord\",\n\t\"docs\",\n\t\"documentation\",\n\t\"download\",\n\t\"downloads\",\n\t\"dust\",\n\t\"emerging-talent\",\n\t\"engineering-blog\",\n\t\"enterprise\",\n\t\"events\",\n\t\"experts\",\n\t\"extension\",\n\t\"faq\",\n\t\"faqs\",\n\t\"features\",\n\t\"forum\",\n\t\"glean\",\n\t\"grok\",\n\t\"guide\",\n\t\"guides\",\n\t\"gumloop\",\n\t\"handbook\",\n\t\"help\",\n\t\"help-center\",\n\t\"home\",\n\t\"how-it-works\",\n\t\"howitworks\",\n\t\"inspo\",\n\t\"intern\",\n\t\"investors\",\n\t\"jobs\",\n\t\"legal\",\n\t\"lindy\",\n\t\"llm\",\n\t\"llms\",\n\t\"love\",\n\t\"make\",\n\t\"manifesto\",\n\t\"media\",\n\t\"merch\",\n\t\"mission\",\n\t\"mobile\",\n\t\"models\",\n\t\"n8n\",\n\t\"news\",\n\t\"newsroom\",\n\t\"open\",\n\t\"open-claw\",\n\t\"open-source\",\n\t\"openai\",\n\t\"our-story\",\n\t\"overview\",\n\t\"partners\",\n\t\"pi\",\n\t\"pipedream\",\n\t\"platform\",\n\t\"press\",\n\t\"press-kit\",\n\t\"pricing\",\n\t\"privacy\",\n\t\"product\",\n\t\"products\",\n\t\"provider\",\n\t\"providers\",\n\t\"quick-start\",\n\t\"quickstart\",\n\t\"refer\",\n\t\"relay\",\n\t\"relay-app\",\n\t\"reporting\",\n\t\"request-demo\",\n\t\"resources\",\n\t\"roadmap\",\n\t\"schedule-demo\",\n\t\"security\",\n\t\"solutions\",\n\t\"stack-ai\",\n\t\"stackai\",\n\t\"startup\",\n\t\"startups\",\n\t\"status\",\n\t\"stories\",\n\t\"story\",\n\t\"students\",\n\t\"support\",\n\t\"swag\",\n\t\"switch\",\n\t\"talent\",\n\t\"terms\",\n\t\"testimonials\",\n\t\"thesis\",\n\t\"tines\",\n\t\"trust\",\n\t\"tutorials\",\n\t\"university\",\n\t\"use-case\",\n\t\"use-cases\",\n\t\"usecases\",\n\t\"versus\",\n\t\"vellum\",\n\t\"vs\",\n\t\"webinars\",\n\t\"workato\",\n\t\"xai\",\n\t\"yc\",\n\t\"zapier\"\n];\n/** Integrations, competitors, and partner brand slugs (marketing / integration pages). */\nconst INTEGRATION_BRAND_SLUGS = [\n\t\"airtable\",\n\t\"asana\",\n\t\"aws\",\n\t\"azure\",\n\t\"bun\",\n\t\"confluence\",\n\t\"copilot\",\n\t\"cursor\",\n\t\"databricks\",\n\t\"figma\",\n\t\"firebase\",\n\t\"fly\",\n\t\"gcp\",\n\t\"gemini\",\n\t\"github\",\n\t\"gitlab\",\n\t\"gmail\",\n\t\"heroku\",\n\t\"hubspot\",\n\t\"huggingface\",\n\t\"jira\",\n\t\"linear\",\n\t\"mailchimp\",\n\t\"meta\",\n\t\"mistral\",\n\t\"mixmax\",\n\t\"monday\",\n\t\"netlify\",\n\t\"neon\",\n\t\"notion\",\n\t\"npm\",\n\t\"outlook\",\n\t\"outreach\",\n\t\"perplexity\",\n\t\"planetscale\",\n\t\"pnpm\",\n\t\"postmark\",\n\t\"ramp\",\n\t\"railway\",\n\t\"render\",\n\t\"resend\",\n\t\"salesforce\",\n\t\"segment\",\n\t\"sendgrid\",\n\t\"shopify\",\n\t\"slack\",\n\t\"snowflake\",\n\t\"stripe\",\n\t\"supabase\",\n\t\"terraform\",\n\t\"trello\",\n\t\"turso\",\n\t\"twilio\",\n\t\"typeform\",\n\t\"vercel\",\n\t\"vscode\",\n\t\"windsurf\",\n\t\"yarn\"\n];\n/** Company, team, and department landing-page segments. */\nconst COMPANY_TEAM_SLUGS = [\n\t\"engineers\",\n\t\"engineering\",\n\t\"executives\",\n\t\"hc\",\n\t\"intern\",\n\t\"it\",\n\t\"leadership\",\n\t\"marketing\",\n\t\"ops\",\n\t\"revops\",\n\t\"sales\",\n\t\"services\",\n\t\"tech\"\n];\n/** Legal, trust, compliance, and policy URL segments. */\nconst LEGAL_TRUST_SLUGS = [\n\t\"accessibility\",\n\t\"agreement\",\n\t\"a11y\",\n\t\"bug-bounty\",\n\t\"compliance\",\n\t\"cookie-policy\",\n\t\"cookies\",\n\t\"disclose\",\n\t\"dpa\",\n\t\"eula\",\n\t\"gdpr\",\n\t\"hipaa\",\n\t\"iso\",\n\t\"msa\",\n\t\"pci\",\n\t\"responsible-disclosure\",\n\t\"sla\",\n\t\"soc2\",\n\t\"tos\",\n\t\"trust-center\",\n\t\"trustcenter\",\n\t\"vulnerability\"\n];\n/** Developer, API, CLI, and technical URL segments. */\nconst DEVELOPER_TECH_SLUGS = [\n\t\"api\",\n\t\"api-docs\",\n\t\"cli\",\n\t\"code\",\n\t\"config\",\n\t\"developer\",\n\t\"developer-tools\",\n\t\"developers\",\n\t\"dev-tools\",\n\t\"devtools\",\n\t\"dev\",\n\t\"dev-states\",\n\t\"graphql\",\n\t\"graphql-playground\",\n\t\"mcp-server\",\n\t\"mcp-servers\",\n\t\"openapi\",\n\t\"sdk\",\n\t\"swagger\"\n];\n/** Infra, ops, static assets, and system URL segments. */\nconst INFRA_SYSTEM_SLUGS = [\n\t\"acme-challenge\",\n\t\"admin\",\n\t\"apple-app-site-association\",\n\t\"assets\",\n\t\"batch\",\n\t\"cache\",\n\t\"cdn\",\n\t\"cron\",\n\t\"debug\",\n\t\"error\",\n\t\"errors\",\n\t\"favicon\",\n\t\"feed\",\n\t\"files\",\n\t\"health\",\n\t\"healthcheck\",\n\t\"healthz\",\n\t\"hooks\",\n\t\"internal\",\n\t\"item\",\n\t\"manifest\",\n\t\"metrics\",\n\t\"null\",\n\t\"ping\",\n\t\"prod\",\n\t\"public\",\n\t\"redirect\",\n\t\"robots\",\n\t\"rpc\",\n\t\"rss\",\n\t\"sharer\",\n\t\"sitemap\",\n\t\"staging\",\n\t\"static\",\n\t\"storage\",\n\t\"test\",\n\t\"undefined\",\n\t\"universal\",\n\t\"webhooks\",\n\t\"well-known\",\n\t\"www\"\n];\n/** Reserved slugs that are valid org names in theory but blocked for routing safety. */\nconst ROUTING_SAFETY_SLUGS = [\n\t\"alpha\",\n\t\"anonymous\",\n\t\"archive\",\n\t\"archived\",\n\t\"beta\",\n\t\"clone\",\n\t\"copy\",\n\t\"default\",\n\t\"deleted\",\n\t\"demo-org\",\n\t\"draft\",\n\t\"drafts\",\n\t\"duplicate\",\n\t\"early-access\",\n\t\"embed\",\n\t\"embedded\",\n\t\"export\",\n\t\"fork\",\n\t\"free\",\n\t\"guest\",\n\t\"import\",\n\t\"index\",\n\t\"list\",\n\t\"manage\",\n\t\"moderator\",\n\t\"newsletter\",\n\t\"owner\",\n\t\"preview\",\n\t\"previews\",\n\t\"private\",\n\t\"pro\",\n\t\"public-api\",\n\t\"publish\",\n\t\"published\",\n\t\"queue\",\n\t\"remove\",\n\t\"root\",\n\t\"sample\",\n\t\"samples\",\n\t\"selection\",\n\t\"share\",\n\t\"shared\",\n\t\"sponsor\",\n\t\"sponsors\",\n\t\"sponsorship\",\n\t\"subscribe\",\n\t\"super\",\n\t\"superuser\",\n\t\"system\",\n\t\"sys\",\n\t\"test-org\",\n\t\"trash\",\n\t\"unpublish\",\n\t\"unsubscribe\",\n\t\"upload\",\n\t\"uploads\",\n\t\"waitlist\",\n\t\"widget\",\n\t\"widgets\",\n\t\"worker\",\n\t\"workers\"\n];\n/**\n* URL segments reserved for global (non-org) routes — cannot be used as an org slug.\n* Prefer adding new entries to the category arrays above; the Set is the enforcement surface.\n*/\nconst RESERVED_ORGANIZATION_SLUGS = new Set([\n\t...AUTH_ACCOUNT_SLUGS,\n\t...ORG_ACCOUNT_SLUGS,\n\t...PRODUCT_SLUGS,\n\t...MARKETING_SITE_SLUGS,\n\t...INTEGRATION_BRAND_SLUGS,\n\t...COMPANY_TEAM_SLUGS,\n\t...LEGAL_TRUST_SLUGS,\n\t...DEVELOPER_TECH_SLUGS,\n\t...INFRA_SYSTEM_SLUGS,\n\t...ROUTING_SAFETY_SLUGS\n]);\n/**\n* Base slug format: lowercase, 2-64 chars, alphanumeric + dashes.\n*\n* IMPORTANT: this is the schema for *reading* slugs (persisted rows, API\n* responses). It intentionally does NOT enforce the reserved-name list — an org\n* created before a name became reserved must still parse on read. Use\n* `ClaimableOrganizationSlugSchema` to validate slugs a user is trying to claim.\n*/\nconst OrganizationSlugSchema = z.string().trim().toLowerCase().min(2, \"Slug must be at least 2 characters\").max(64, \"Slug must be at most 64 characters\").regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, \"Use lowercase letters, numbers, and dashes only\");\n/**\n* Slug validation for *claiming* a slug (organization create/rename). Adds the\n* reserved-name check on top of the base format. Never use this to parse\n* existing org data, or pre-existing orgs whose slug later became reserved would\n* fail to load.\n*/\nconst ClaimableOrganizationSlugSchema = OrganizationSlugSchema.refine((slug) => !RESERVED_ORGANIZATION_SLUGS.has(slug), \"This slug is reserved\");\n/** Normalize a display name into slug-shaped text (may be empty or too short to claim). */\nfunction normalizeOrganizationNameToSlugBase(name) {\n\treturn name.trim().toLowerCase().replace(/[^a-z0-9]+/g, \"-\").replace(/-+/g, \"-\").replace(/^-|-$/g, \"\");\n}\n/**\n* Live slug preview while typing an org name. Returns normalized text only —\n* no server-side `\"org\"` fallback when the preview is empty or under min length.\n*/\nfunction previewOrganizationSlugFromName(name) {\n\treturn normalizeOrganizationNameToSlugBase(name);\n}\n/** Derive a URL slug from a display name (not guaranteed unique). */\nfunction slugifyOrganizationName(name) {\n\tconst base = normalizeOrganizationNameToSlugBase(name);\n\tif (!base) return \"org\";\n\tconst parsed = OrganizationSlugSchema.safeParse(base);\n\treturn parsed.success ? parsed.data : \"org\";\n}\nfunction parseOrganizationSlug(input) {\n\treturn OrganizationSlugSchema.parse(input);\n}\n//#endregion\n//#region src/constants/projects.ts\n/** Platform wait for project /health before declaring unreachable. */\nconst PROJECT_PING_TIMEOUT_MS = 15e3;\n/** Browser→platform request budget (ping + small platform overhead). */\nconst PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS = 17e3;\n/** Pause between reachability checks after the previous check finishes. */\nconst PROJECT_REACHABILITY_RETRY_MS = 5e3;\n//#endregion\n//#region src/public-url.ts\n/** Normalize a public origin URL (no trailing slash). */\nfunction originFromPublicUrl(value, fallback) {\n\tconst trimmed = value?.trim();\n\tif (!trimmed) return fallback.replace(/\\/+$/, \"\");\n\treturn trimmed.replace(/\\/+$/, \"\");\n}\n/** TCP port to bind for a local server, derived from a public URL. */\nfunction listenPortFromUrl(url, fallback) {\n\tconst parsed = new URL(url);\n\tif (parsed.port) {\n\t\tconst port = Number(parsed.port);\n\t\tif (Number.isFinite(port) && port > 0) return port;\n\t}\n\tif (parsed.protocol === \"https:\") return 443;\n\tif (parsed.protocol === \"http:\") return 80;\n\treturn fallback;\n}\n/** Shorthand: listen port from `PUBLIC_*_URL` or fallback. */\nfunction listenPortFromPublicUrl(value, fallback) {\n\tconst trimmed = value?.trim();\n\tif (!trimmed) return fallback;\n\ttry {\n\t\treturn listenPortFromUrl(trimmed, fallback);\n\t} catch {\n\t\treturn fallback;\n\t}\n}\n//#endregion\n//#region src/tool-parameters.ts\n/** JSON Schema draft 2020-12 for LLM tool inputs (not OpenAPI 3.0). */\nfunction toolParameters(schema) {\n\treturn z.toJSONSchema(schema, { target: \"draft-2020-12\" });\n}\n//#endregion\n//#region src/constants/route-manifest.ts\n/** On-disk path under the project root (packed in deploy artifacts when present). */\nconst ROUTE_MANIFEST_REL_PATH = \"dist/.keystroke/route-manifest.json\";\n/** HTTP route served by the project server after bootstrap. */\nconst ROUTE_MANIFEST_HTTP_PATH = \"/.keystroke/route-manifest\";\n//#endregion\n//#region src/schemas/route-manifest.ts\nconst serializedRouteManifestEntrySchema = z.discriminatedUnion(\"kind\", [\n\tz.object({\n\t\tkind: z.literal(\"health\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.literal(\"/health\")\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"agent\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tmoduleFile: z.string(),\n\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"agent-sessions-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tagentId: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"agent-session-detail\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tagentId: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"workflow\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tworkflowId: z.string(),\n\t\tworkflowName: z.string().optional(),\n\t\tmoduleFile: z.string(),\n\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"workflow-runs-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tworkflowId: z.string(),\n\t\tworkflowName: z.string().optional(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"workflow-run-detail\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tworkflowId: z.string(),\n\t\tworkflowName: z.string().optional(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-webhook\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tattachmentIds: z.array(z.string()),\n\t\tmoduleFile: z.string(),\n\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\tattachmentSchemas: z.record(z.string(), z.object({\n\t\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\t\tfilterSchema: z.record(z.string(), z.unknown()).optional()\n\t\t})),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-poll\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string(),\n\t\tschedule: z.string(),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-poll-group\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tpollId: z.string(),\n\t\tattachmentIds: z.array(z.string()),\n\t\tmoduleFile: z.string(),\n\t\tschedule: z.string(),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-runs-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-run-detail\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"cron-schedule\"),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string(),\n\t\tschedule: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"plugin\"),\n\t\tmethod: z.enum([\n\t\t\t\"GET\",\n\t\t\t\"POST\",\n\t\t\t\"PUT\",\n\t\t\t\"PATCH\",\n\t\t\t\"DELETE\"\n\t\t]),\n\t\tpath: z.string(),\n\t\tplugin: z.string()\n\t})\n]);\nconst StoredRouteManifestSchema = z.object({\n\tversion: z.literal(1),\n\tentries: z.array(serializedRouteManifestEntrySchema),\n\tintegrations: z.array(z.string()).optional()\n});\nfunction parseStoredRouteManifest(value) {\n\treturn StoredRouteManifestSchema.parse(value);\n}\n//#endregion\n//#region src/schemas/credentials.ts\n/** How a credential instance is stored (`credential_instances.auth_kind`). */\nconst CredentialAuthKindSchema = z.enum([\"api_key\", \"oauth_managed\"]);\n/** Where a credential instance is stored (`credential_instances.scope_type`). */\nconst CredentialScopeTypeSchema = z.enum([\n\t\"global\",\n\t\"organization\",\n\t\"project\",\n\t\"user\"\n]);\n/**\n* Resolution chain step when an action/tool looks up credentials.\n* `selection` uses explicit instance ids; other levels map to {@link CredentialScopeType}.\n*/\nconst CredentialScopeLevelSchema = z.enum([\n\t\"selection\",\n\t\"organization\",\n\t\"project\",\n\t\"user\"\n]);\nconst CREDENTIAL_AUTH_KINDS = CredentialAuthKindSchema.options;\nconst CREDENTIAL_SCOPE_TYPES = CredentialScopeTypeSchema.options;\nconst CREDENTIAL_SCOPE_LEVELS = CredentialScopeLevelSchema.options;\n/** Default chain when `credential.static(...).scope()` is called with no args. */\nconst DEFAULT_CREDENTIAL_RESOLUTION_CHAIN = [\"organization\", \"project\"];\nconst CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE = {\n\torganization: \"organization\",\n\tproject: \"project\",\n\tuser: \"user\"\n};\n//#endregion\n//#region src/schemas/credential-spec.ts\nfunction isCredentialInput(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = value;\n\treturn typeof candidate.key === \"string\" && CredentialAuthKindSchema.safeParse(candidate.kind).success && candidate.schema instanceof z.ZodType;\n}\nconst credentialInputSchema = z.custom((value) => isCredentialInput(value), \"must be a credential requirement\");\nfunction createRef(kind, key, schema, options) {\n\tconst tokenField = options?.tokenField;\n\treturn {\n\t\tkind,\n\t\tkey,\n\t\tschema,\n\t\t...tokenField !== void 0 ? { tokenField } : {},\n\t\tscope(...chain) {\n\t\t\treturn {\n\t\t\t\tkey,\n\t\t\t\tkind,\n\t\t\t\tschema,\n\t\t\t\tchain: chain.length > 0 ? chain : DEFAULT_CREDENTIAL_RESOLUTION_CHAIN,\n\t\t\t\t...tokenField !== void 0 ? { tokenField } : {}\n\t\t\t};\n\t\t}\n\t};\n}\nfunction staticCredential(key, schema) {\n\treturn createRef(\"api_key\", key, schema instanceof z.ZodType ? schema : z.object(schema));\n}\nfunction oauthCredential(key, options) {\n\tconst tokenField = options?.tokenField ?? \"accessToken\";\n\treturn createRef(\"oauth_managed\", key, tokenField === \"accessToken\" ? z.object({ accessToken: z.string() }) : z.object({ [tokenField]: z.string() }), { tokenField });\n}\nconst credential = {\n\tstatic: staticCredential,\n\toauth: oauthCredential\n};\nfunction defineCredential(input) {\n\tif (input.kind === \"oauth\") return input.tokenField !== void 0 ? credential.oauth(input.key, { tokenField: input.tokenField }) : credential.oauth(input.key);\n\tif (\"schema\" in input) return credential.static(input.key, input.schema);\n\treturn credential.static(input.key, input.fields);\n}\nfunction normalizeCredentialList(list) {\n\treturn list.map((item) => toCredentialRequirement(item));\n}\nfunction isCredentialRequirement(item) {\n\treturn \"chain\" in item;\n}\nfunction toCredentialRequirement(item) {\n\tif (isCredentialRequirement(item)) return item;\n\treturn {\n\t\tkey: item.key,\n\t\tkind: item.kind,\n\t\tschema: item.schema,\n\t\tchain: DEFAULT_CREDENTIAL_RESOLUTION_CHAIN,\n\t\t...item.tokenField !== void 0 ? { tokenField: item.tokenField } : {}\n\t};\n}\n//#endregion\n//#region src/schemas/organizations.ts\n/** Canonical copy for slug collision errors (API + UI). */\nconst ORGANIZATION_SLUG_TAKEN_MESSAGE = \"That slug is already taken.\";\nconst OrganizationSlugErrorCodeSchema = z.enum([\n\t\"slug_taken\",\n\t\"slug_reserved\",\n\t\"slug_invalid\"\n]);\nconst SlugAvailabilityReasonSchema = z.enum([\n\t\"taken\",\n\t\"reserved\",\n\t\"invalid\"\n]);\nconst SlugAvailabilityResponseSchema = z.object({\n\tslug: z.string(),\n\tavailable: z.boolean(),\n\treason: SlugAvailabilityReasonSchema.optional(),\n\tsuggestion: OrganizationSlugSchema.optional()\n});\nconst SlugAvailabilityQuerySchema = z.object({\n\tslug: z.string().trim().min(1),\n\texcludeOrganizationId: z.string().min(1).optional()\n});\n/** Client-side instant validation before hitting the availability endpoint. */\nfunction validateClaimableOrganizationSlug(slug) {\n\tconst normalized = slug.trim().toLowerCase();\n\tif (!normalized) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: \"Slug is required\"\n\t};\n\tconst format = OrganizationSlugSchema.safeParse(normalized);\n\tif (!format.success) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: format.error.issues[0]?.message ?? \"Invalid slug\"\n\t};\n\tif (RESERVED_ORGANIZATION_SLUGS.has(format.data)) return {\n\t\tvalid: false,\n\t\treason: \"reserved\",\n\t\tmessage: \"This slug is reserved\"\n\t};\n\treturn { valid: true };\n}\nfunction organizationSlugErrorCodeFromMessage(message) {\n\tif (message === \"That slug is already taken.\" || /already taken/i.test(message)) return \"slug_taken\";\n\tif (/reserved/i.test(message)) return \"slug_reserved\";\n\treturn \"slug_invalid\";\n}\nconst ProjectStatusSchema = z.enum([\n\t\"inactive\",\n\t\"starting\",\n\t\"active\",\n\t\"failed\"\n]);\nconst OrganizationUserRoleSchema = z.enum([\n\t\"owner\",\n\t\"admin\",\n\t\"builder\"\n]);\nconst isoDateTime$2 = z.string().datetime();\nconst OrganizationSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tslug: OrganizationSlugSchema,\n\tcreatedAt: isoDateTime$2,\n\tupdatedAt: isoDateTime$2\n});\nconst ProjectSchema = z.object({\n\tid: z.string(),\n\torganizationId: z.string(),\n\tname: z.string(),\n\tdescription: z.string().nullable(),\n\tstatus: ProjectStatusSchema,\n\tbaseUrl: z.string().nullable(),\n\truntimeId: z.string().nullable(),\n\tlastError: z.string().nullable(),\n\tcreatedAt: isoDateTime$2,\n\tupdatedAt: isoDateTime$2\n});\nconst UserOrganizationSchema = z.object({\n\torganization: OrganizationSchema,\n\trole: OrganizationUserRoleSchema\n});\nconst CurrentOrganizationResponseSchema = z.object({ organization: UserOrganizationSchema.nullable() });\nconst ActiveOrganizationResponseSchema = CurrentOrganizationResponseSchema;\nconst ListOrganizationsResponseSchema = z.object({ organizations: z.array(UserOrganizationSchema) });\nconst SetActiveOrganizationRequestSchema = z.object({ organizationId: z.string().min(1) });\nconst CreateOrganizationRequestSchema = z.object({\n\tname: z.string().trim().min(1),\n\t/** Format-only at the wire boundary; reserved-name checks run in platform-database. */\n\tslug: OrganizationSlugSchema.optional()\n});\nconst UpdateOrganizationRequestSchema = z.object({ slug: ClaimableOrganizationSlugSchema });\nconst CreateOrganizationResponseSchema = z.object({ organization: UserOrganizationSchema });\nconst ListProjectsResponseSchema = z.object({ projects: z.array(ProjectSchema) });\nconst CreateProjectRequestSchema = z.object({\n\tname: z.string().trim().min(1),\n\tdescription: z.string().trim().min(1).optional()\n});\nconst CreateProjectResponseSchema = z.object({ project: ProjectSchema });\nconst ProjectResponseSchema = z.object({ project: ProjectSchema });\nconst ProjectReachabilityResponseSchema = z.object({ reachable: z.boolean() });\nfunction parseCreateOrganizationRequest(input) {\n\treturn CreateOrganizationRequestSchema.parse(input);\n}\n//#endregion\n//#region src/schemas/errors/schema.ts\nconst ValidationErrorDetailSchema = z.object({\n\tpath: z.string(),\n\tmessage: z.string()\n});\n/** Machine-readable codes returned in standard API error bodies. */\nconst ErrorResponseCodeSchema = OrganizationSlugErrorCodeSchema.or(z.enum([\"needs_org_selection\"]));\n/** Standard JSON error body returned by the HTTP API. */\nconst ErrorResponseSchema = z.object({\n\terror: z.string(),\n\tcode: ErrorResponseCodeSchema.optional(),\n\tmessage: z.string().optional(),\n\tdetails: z.array(ValidationErrorDetailSchema).optional()\n});\n//#endregion\n//#region src/schemas/errors/from-zod.ts\n/** Build the JSON body for HTTP 400 validation failures. */\nfunction validationErrorResponse(error, summary) {\n\treturn {\n\t\terror: summary,\n\t\tdetails: error.issues.map((issue) => ({\n\t\t\tpath: issue.path.join(\".\"),\n\t\t\tmessage: issue.message\n\t\t}))\n\t};\n}\n//#endregion\n//#region src/schemas/errors/parse.ts\nconst MessageOnlyErrorBodySchema = z.object({ message: z.string() });\n/** Parse a JSON error body from the API. */\nfunction parseErrorResponse(body) {\n\tconst parsed = ErrorResponseSchema.safeParse(body);\n\tif (parsed.success) return parsed.data;\n\tconst messageOnly = MessageOnlyErrorBodySchema.safeParse(body);\n\tif (messageOnly.success) return {\n\t\terror: messageOnly.data.message,\n\t\tmessage: messageOnly.data.message\n\t};\n}\n//#endregion\n//#region src/schemas/http.ts\nconst CredentialRunContextSchema = z.object({\n\torgId: z.string().min(1).optional(),\n\tprojectId: z.string().min(1).optional(),\n\tuserId: z.string().min(1).optional(),\n\tuserIds: z.record(z.string(), z.string()).optional(),\n\tselection: z.record(z.string(), z.string()).optional()\n});\nconst ThinkingLevelSchema = z.enum([\n\t\"off\",\n\t\"minimal\",\n\t\"low\",\n\t\"medium\",\n\t\"high\",\n\t\"xhigh\"\n]);\nconst PromptInputSchema = z.object({\n\tmessage: z.string().min(1),\n\tsessionId: z.string().min(1).optional(),\n\tsubscriptionId: z.string().min(1).optional(),\n\tcontext: CredentialRunContextSchema.optional(),\n\tthinkingLevel: ThinkingLevelSchema.optional()\n});\nconst PromptResponseSchema = z.object({\n\tsessionId: z.string(),\n\tmessages: z.array(z.record(z.string(), z.unknown())),\n\terror: z.string().nullable()\n});\nconst SkipResponseSchema = z.object({\n\tok: z.literal(true),\n\tskipped: z.literal(true)\n});\nconst HealthResponseSchema = z.object({ ok: z.literal(true) });\nconst PlatformInfoResponseSchema = z.object({ service: z.string() });\nconst ConnectProviderSchema = z.object({\n\tkey: z.string(),\n\tmode: z.enum([\"authorize-url\", \"browser-redirect\"]),\n\tpath: z.string(),\n\trequiresAuth: z.boolean()\n});\nconst ConnectProvidersResponseSchema = z.object({ providers: z.array(ConnectProviderSchema) });\nconst ConnectAuthorizeUrlResponseSchema = z.object({ url: z.string() });\nconst QueuedRunResponseSchema = z.object({ runId: z.string() });\nconst QueuedAgentPromptResponseSchema = z.object({ sessionId: z.string() });\nfunction parsePromptInput(input) {\n\treturn PromptInputSchema.parse(input);\n}\nconst PollRunRequestSchema = z.object({\n\tworkflows: z.array(z.string().min(1)).optional(),\n\tattachments: z.array(z.string().min(1)).optional()\n});\nconst PollAttachmentResultSchema = z.object({\n\tattachmentKey: z.string(),\n\tworkflowKey: z.string(),\n\trunId: z.string().optional(),\n\tbody: z.unknown().optional(),\n\tqueued: z.boolean(),\n\tskipped: z.boolean().optional()\n});\nconst PollRunMultiResponseSchema = z.object({ results: z.array(PollAttachmentResultSchema) });\nconst PollRunResponseSchema = z.union([\n\tz.record(z.string(), z.unknown()),\n\tPollRunMultiResponseSchema,\n\tSkipResponseSchema,\n\tz.object({ runId: z.string() })\n]);\nfunction parsePollRunRequest(body) {\n\tif (body === void 0 || body === null) return {};\n\treturn PollRunRequestSchema.parse(body);\n}\n//#endregion\n//#region src/schemas/runs.ts\nconst RunSourceKindSchema = z.enum([\n\t\"api\",\n\t\"trigger\",\n\t\"gateway\",\n\t\"workflow\",\n\t\"agent\"\n]);\nconst RunSourceSchema = z.object({\n\tkind: RunSourceKindSchema,\n\tid: z.string().nullable()\n});\n//#endregion\n//#region src/schemas/workflow-runs.ts\nconst WorkflowRunStatusSchema = z.enum([\n\t\"pending\",\n\t\"running\",\n\t\"completed\",\n\t\"failed\"\n]);\nconst WorkflowRunTriggerSchema = z.enum([\n\t\"api\",\n\t\"cron\",\n\t\"webhook\",\n\t\"poll\",\n\t\"retry\"\n]);\n/**\n* Durable workflow event-log entry types. Shared so the persistence layer\n* (`@keystrokehq/database` schema) and the runtime-agnostic replay engine\n* (`@keystrokehq/workflow`) reference one definition instead of duplicating it.\n*/\nconst WorkflowEventTypeSchema = z.enum([\n\t\"run_started\",\n\t\"step_completed\",\n\t\"step_failed\",\n\t\"step_retrying\",\n\t\"sleep_scheduled\",\n\t\"sleep_completed\",\n\t\"hook_created\",\n\t\"hook_resumed\",\n\t\"run_completed\",\n\t\"run_failed\"\n]);\nconst WorkflowRunSummarySchema = z.object({\n\tid: z.string(),\n\tstatus: WorkflowRunStatusSchema,\n\ttrigger: WorkflowRunTriggerSchema,\n\ttriggeredAt: z.string(),\n\tstartedAt: z.string().nullable(),\n\tfinishedAt: z.string().nullable(),\n\tsourceKind: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\ttriggerRunId: z.string().nullable(),\n\tattachmentId: z.string().nullable()\n});\nconst WorkflowRunRecordSchema = z.object({\n\tid: z.string(),\n\tworkflowKey: z.string(),\n\tstatus: WorkflowRunStatusSchema,\n\ttrigger: WorkflowRunTriggerSchema,\n\ttriggeredAt: z.string(),\n\tstartedAt: z.string().nullable(),\n\tfinishedAt: z.string().nullable(),\n\tsourceKind: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\ttriggerRunId: z.string().nullable(),\n\tattachmentId: z.string().nullable(),\n\tparentWorkflowRunId: z.string().nullable(),\n\tparentSpanId: z.string().nullable(),\n\tinput: z.unknown().nullable(),\n\toutput: z.unknown().nullable(),\n\terror: z.unknown().nullable()\n});\nconst WorkflowRunListQuerySchema = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(20),\n\tcursor: z.string().min(1).optional(),\n\tstatus: WorkflowRunStatusSchema.optional(),\n\ttrigger: WorkflowRunTriggerSchema.optional()\n});\nconst WorkflowRunListResponseSchema = z.object({\n\titems: z.array(WorkflowRunSummarySchema),\n\tnextCursor: z.string().nullable()\n});\nconst WorkflowRunDetailIncludeSchema = z.enum([\n\t\"trigger\",\n\t\"steps\",\n\t\"trace\"\n]);\nconst WorkflowRunDetailQuerySchema = z.object({ include: z.string().optional() });\nconst DEFAULT_DETAIL_INCLUDE$2 = [\n\t\"trigger\",\n\t\"steps\",\n\t\"trace\"\n];\nfunction parseWorkflowRunDetailInclude(include) {\n\tif (!include?.trim()) return [...DEFAULT_DETAIL_INCLUDE$2];\n\tconst parsed = include.split(\",\").map((part) => part.trim()).filter((part) => WorkflowRunDetailIncludeSchema.options.includes(part));\n\treturn parsed.length > 0 ? parsed : [...DEFAULT_DETAIL_INCLUDE$2];\n}\nconst TriggerRunDetailSchema = z.object({\n\tid: z.string(),\n\tattachmentId: z.string(),\n\tattachmentKey: z.string().nullable(),\n\ttriggerType: z.enum([\n\t\t\"cron\",\n\t\t\"webhook\",\n\t\t\"poll\"\n\t]),\n\tsourcePath: z.string().nullable(),\n\tpayload: z.unknown().nullable(),\n\ttriggeredAt: z.string()\n});\nconst WorkflowStepRunSchema = z.object({\n\tid: z.string(),\n\tactionKey: z.string(),\n\toutput: z.unknown(),\n\tcompletedAt: z.string()\n});\nconst TraceTriggerSummarySchema = z.object({\n\ttriggerType: z.string(),\n\ttriggerRunId: z.string(),\n\tworkflowKey: z.string().optional(),\n\tagentKey: z.string().optional(),\n\tattachmentId: z.string().nullable().optional(),\n\tattachmentKey: z.string().nullable().optional(),\n\troute: z.string().optional(),\n\tsourcePath: z.string().nullable().optional()\n}).nullable();\nconst TraceGatewaySummarySchema = z.object({\n\tgatewayAttachmentId: z.string(),\n\tgatewayAttachmentKey: z.string(),\n\tthreadId: z.string().optional(),\n\tchannelId: z.string().optional(),\n\tmode: z.string().optional()\n}).nullable();\nconst TraceSpanSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tparentSpanId: z.string().nullable(),\n\tkind: z.string(),\n\trefId: z.string(),\n\tname: z.string(),\n\tstatus: z.string(),\n\tstartedAt: z.string(),\n\tfinishedAt: z.string().nullable(),\n\tmetadata: z.unknown().nullable(),\n\terror: z.unknown().nullable()\n});\nconst TraceLogSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tspanId: z.string(),\n\tseq: z.number(),\n\tlevel: z.string(),\n\tmessage: z.string(),\n\tdata: z.unknown().nullable(),\n\tsource: z.string(),\n\tcreatedAt: z.string()\n});\nconst TraceResponseSchema = z.object({\n\ttraceId: z.string(),\n\ttrigger: TraceTriggerSummarySchema,\n\tgateway: TraceGatewaySummarySchema,\n\tspans: z.array(TraceSpanSchema),\n\tlogs: z.array(TraceLogSchema)\n});\nconst WorkflowRunDetailResponseSchema = z.object({\n\trun: WorkflowRunRecordSchema,\n\ttrigger: TriggerRunDetailSchema.nullable(),\n\tsteps: z.array(WorkflowStepRunSchema),\n\ttrace: TraceResponseSchema.nullable()\n});\n//#endregion\n//#region src/schemas/agent-sessions.ts\nconst AgentSessionStatusSchema = z.enum([\n\t\"running\",\n\t\"completed\",\n\t\"failed\"\n]);\nconst AgentSessionSummarySchema = z.object({\n\tid: z.string(),\n\tstatus: AgentSessionStatusSchema,\n\tsource: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tmessageCount: z.number()\n});\nconst AgentSessionRecordSchema = z.object({\n\tid: z.string(),\n\tagentKey: z.string(),\n\tstatus: AgentSessionStatusSchema,\n\tsource: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tparentSpanId: z.string().nullable(),\n\tmessageCount: z.number(),\n\terror: z.unknown().nullable()\n});\nconst AgentSessionListQuerySchema = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(20),\n\tcursor: z.string().min(1).optional(),\n\tstatus: AgentSessionStatusSchema.optional(),\n\tsource: RunSourceKindSchema.optional()\n});\nconst AgentSessionListResponseSchema = z.object({\n\titems: z.array(AgentSessionSummarySchema),\n\tnextCursor: z.string().nullable()\n});\nconst AgentSessionDetailIncludeSchema = z.enum([\n\t\"gateway\",\n\t\"messages\",\n\t\"events\",\n\t\"trace\"\n]);\nconst AgentSessionDetailQuerySchema = z.object({ include: z.string().optional() });\nconst DEFAULT_DETAIL_INCLUDE$1 = [\n\t\"gateway\",\n\t\"messages\",\n\t\"trace\"\n];\nfunction parseAgentSessionDetailInclude(include) {\n\tif (!include?.trim()) return [...DEFAULT_DETAIL_INCLUDE$1];\n\tconst parsed = include.split(\",\").map((part) => part.trim()).filter((part) => AgentSessionDetailIncludeSchema.options.includes(part));\n\treturn parsed.length > 0 ? parsed : [...DEFAULT_DETAIL_INCLUDE$1];\n}\nconst GatewaySessionDetailSchema = z.object({\n\tthreadId: z.string(),\n\tattachmentId: z.string(),\n\tattachmentKey: z.string().nullable()\n});\nconst AgentEventSchema = z.object({\n\tid: z.string(),\n\tsessionId: z.string(),\n\tseq: z.number(),\n\teventType: z.string(),\n\tpayload: z.unknown(),\n\tcreatedAt: z.string()\n});\nconst AgentSessionDetailResponseSchema = z.object({\n\tsession: AgentSessionRecordSchema,\n\tgateway: GatewaySessionDetailSchema.nullable(),\n\tmessages: z.array(z.record(z.string(), z.unknown())),\n\tevents: z.array(AgentEventSchema),\n\ttrace: TraceResponseSchema.nullable()\n});\n//#endregion\n//#region src/schemas/gateway-attachments.ts\nconst SlackGatewayModeSchema = z.enum([\n\t\"mention\",\n\t\"channel\",\n\t\"dm\"\n]);\nconst GatewayAttachmentSourceSchema = z.object({\n\tkind: z.literal(\"slack\"),\n\tmode: SlackGatewayModeSchema,\n\tcredentialKey: z.string(),\n\tchannelIds: z.array(z.string()).optional(),\n\tsubscribeOnMention: z.boolean()\n});\nconst GatewayAttachmentRecordSchema = z.object({\n\tid: z.string(),\n\tkey: z.string(),\n\tagentKey: z.string(),\n\tchannelId: z.string(),\n\tplatform: z.string(),\n\tsource: GatewayAttachmentSourceSchema,\n\tregisteredAt: z.string(),\n\tupdatedAt: z.string()\n});\nconst GatewayAttachmentListResponseSchema = z.object({ attachments: z.array(GatewayAttachmentRecordSchema) });\nconst UpsertGatewayAttachmentBodySchema = z.object({\n\tagentKey: z.string().min(1),\n\tmode: SlackGatewayModeSchema.optional(),\n\tsubscribeOnMention: z.boolean().optional()\n});\nconst AgentListItemSchema = z.object({\n\tkey: z.string(),\n\tname: z.string().optional(),\n\troute: z.string()\n});\nconst AgentListResponseSchema = z.object({ agents: z.array(AgentListItemSchema) });\n//#endregion\n//#region src/schemas/workflow-deployments.ts\nconst WorkflowSubscriptionRecordSchema = z.object({\n\tid: z.string(),\n\tworkflowKey: z.string(),\n\tuserId: z.string(),\n\tenabled: z.boolean(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string()\n});\nconst WorkflowSubscriptionListResponseSchema = z.object({ subscriptions: z.array(WorkflowSubscriptionRecordSchema) });\nconst UpsertWorkflowSubscriptionBodySchema = z.object({\n\tuserId: z.string().min(1).optional(),\n\tenabled: z.boolean().optional()\n});\nconst CredentialInstanceRecordSchema = z.object({\n\tid: z.string(),\n\tkey: z.string(),\n\tscopeType: CredentialScopeTypeSchema,\n\tscopeId: z.string().nullable(),\n\tlabel: z.string().nullable(),\n\tisDefault: z.boolean(),\n\tauthKind: CredentialAuthKindSchema\n});\nconst CredentialInstanceListResponseSchema = z.object({ instances: z.array(CredentialInstanceRecordSchema) });\nconst CreateCredentialInstanceBodySchema = z.object({\n\tkey: z.string().min(1),\n\tscopeType: CredentialScopeTypeSchema,\n\tscopeId: z.string().nullable().optional(),\n\tlabel: z.string().nullable().optional(),\n\tisDefault: z.boolean().optional(),\n\tvalue: z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: \"value must be a non-empty object\" })\n});\nconst UpdateCredentialInstanceBodySchema = z.object({\n\tlabel: z.string().nullable().optional(),\n\tisDefault: z.boolean().optional(),\n\tvalue: z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: \"value must be a non-empty object\" }).optional()\n});\n//#endregion\n//#region src/schemas/trigger-runs.ts\nconst TriggerRunTypeSchema = z.enum([\n\t\"cron\",\n\t\"webhook\",\n\t\"poll\"\n]);\nconst TriggerRunWorkflowSummarySchema = z.object({\n\tid: z.string(),\n\tstatus: WorkflowRunStatusSchema,\n\tworkflowKey: z.string()\n});\nconst TriggerRunAgentSessionSummarySchema = z.object({\n\tid: z.string(),\n\tagentKey: z.string()\n});\nconst TriggerRunSummarySchema = z.object({\n\tid: z.string(),\n\ttriggerType: TriggerRunTypeSchema,\n\ttriggeredAt: z.string(),\n\tsourcePath: z.string().nullable(),\n\tworkflowRun: TriggerRunWorkflowSummarySchema.nullable(),\n\tagentSession: TriggerRunAgentSessionSummarySchema.nullable()\n});\nconst TriggerRunRecordSchema = z.object({\n\tid: z.string(),\n\tattachmentId: z.string(),\n\tattachmentKey: z.string(),\n\ttriggerType: TriggerRunTypeSchema,\n\tsourcePath: z.string().nullable(),\n\tpayload: z.unknown().nullable(),\n\ttriggeredAt: z.string()\n});\nconst TriggerRunListQuerySchema = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(20),\n\tcursor: z.string().min(1).optional(),\n\ttriggerType: TriggerRunTypeSchema.optional()\n});\nconst TriggerRunListResponseSchema = z.object({\n\titems: z.array(TriggerRunSummarySchema),\n\tnextCursor: z.string().nullable()\n});\nconst TriggerRunDetailIncludeSchema = z.enum([\n\t\"workflows\",\n\t\"agents\",\n\t\"trace\"\n]);\nconst TriggerRunDetailQuerySchema = z.object({ include: z.string().optional() });\nconst DEFAULT_DETAIL_INCLUDE = [\n\t\"workflows\",\n\t\"agents\",\n\t\"trace\"\n];\nfunction parseTriggerRunDetailInclude(include) {\n\tif (!include?.trim()) return [...DEFAULT_DETAIL_INCLUDE];\n\tconst parsed = include.split(\",\").map((part) => part.trim()).filter((part) => TriggerRunDetailIncludeSchema.options.includes(part));\n\treturn parsed.length > 0 ? parsed : [...DEFAULT_DETAIL_INCLUDE];\n}\nconst TriggerRunAgentSessionDetailSchema = z.object({\n\tid: z.string(),\n\tagentKey: z.string()\n});\nconst TriggerRunDetailResponseSchema = z.object({\n\trun: TriggerRunRecordSchema,\n\tworkflowRuns: z.array(WorkflowRunSummarySchema),\n\tagentSessions: z.array(TriggerRunAgentSessionDetailSchema),\n\ttrace: TraceResponseSchema.nullable()\n});\n//#endregion\n//#region src/schemas/triggers.ts\nconst TriggerTypeSchema = z.enum([\n\t\"webhook\",\n\t\"poll\",\n\t\"cron\"\n]);\nconst TriggerTargetKindSchema = z.enum([\"workflow\", \"agent\"]);\nconst TriggerListItemSchema = z.object({\n\tkey: z.string(),\n\ttype: TriggerTypeSchema,\n\troute: z.string().optional(),\n\twebhookUrl: z.string().url().optional(),\n\ttargetKind: TriggerTargetKindSchema,\n\tworkflowKey: z.string().optional(),\n\tagentKey: z.string().optional()\n});\nconst TriggerListResponseSchema = z.object({ triggers: z.array(TriggerListItemSchema) });\nconst TriggerListQuerySchema = z.object({ endpoint: z.string().min(1).optional() });\nconst TriggerDetailResponseSchema = TriggerListItemSchema;\n//#endregion\n//#region src/schemas/members.ts\nconst OrganizationMemberRoleSchema = z.enum([\n\t\"owner\",\n\t\"admin\",\n\t\"builder\"\n]);\nconst OrganizationMemberStatusSchema = z.enum([\n\t\"invited\",\n\t\"active\",\n\t\"rejected\",\n\t\"suspended\"\n]);\nconst InvitableOrganizationMemberRoleSchema = z.enum([\"admin\", \"builder\"]);\nconst isoDateTime$1 = z.string().datetime();\nconst OrganizationMemberSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\temail: z.string().email(),\n\trole: OrganizationMemberRoleSchema,\n\tstatus: OrganizationMemberStatusSchema,\n\tavatarUrl: z.string().optional(),\n\tjoinedAt: isoDateTime$1.optional(),\n\tlastActiveAt: isoDateTime$1.nullable().optional()\n});\nconst ListOrganizationMembersResponseSchema = z.object({ members: z.array(OrganizationMemberSchema) });\nconst InviteOrganizationMembersRequestSchema = z.object({\n\temails: z.array(z.string().trim().email()).min(1),\n\trole: InvitableOrganizationMemberRoleSchema\n});\nconst InviteOrganizationMemberResultStatusSchema = z.enum([\n\t\"sent\",\n\t\"already_member\",\n\t\"pending\",\n\t\"invalid\"\n]);\nconst InviteOrganizationMemberResultSchema = z.object({\n\temail: z.string(),\n\tstatus: InviteOrganizationMemberResultStatusSchema,\n\tinvitationId: z.string().optional()\n});\nconst InviteOrganizationMembersResponseSchema = z.object({ results: z.array(InviteOrganizationMemberResultSchema) });\nconst UpdateOrganizationMemberRequestSchema = z.object({ role: InvitableOrganizationMemberRoleSchema });\nconst UpdateOrganizationMemberResponseSchema = z.object({ member: OrganizationMemberSchema });\nconst OrganizationInvitationSchema = z.object({\n\tid: z.string(),\n\torganizationName: z.string(),\n\torganizationSlug: OrganizationSlugSchema,\n\tinvitedByName: z.string().optional(),\n\tinvitedByEmail: z.string().email().optional(),\n\trole: OrganizationMemberRoleSchema\n});\nconst ListOrganizationInvitationsResponseSchema = z.object({ invitations: z.array(OrganizationInvitationSchema) });\nconst AcceptOrganizationInvitationResponseSchema = z.object({ organization: UserOrganizationSchema });\nconst DeclineOrganizationInvitationResponseSchema = z.object({ success: z.literal(true) });\n/** Web path to auto-accept an invitation after sign-in (used in invite emails). */\nfunction organizationInvitationAcceptPath(invitationId) {\n\treturn `/organization/invitations?${new URLSearchParams({ accept: invitationId }).toString()}`;\n}\n//#endregion\n//#region src/schemas/project-artifacts.ts\nconst ProjectArtifactStatusSchema = z.enum([\"pending\", \"ready\"]);\nconst isoDateTime = z.string().datetime();\nconst ProjectArtifactSchema = z.object({\n\tid: z.string(),\n\tprojectId: z.string(),\n\tstorageKey: z.string(),\n\tstatus: ProjectArtifactStatusSchema,\n\tcreatedAt: isoDateTime,\n\tupdatedAt: isoDateTime\n});\nconst CreateProjectArtifactResponseSchema = z.object({\n\tartifact: ProjectArtifactSchema,\n\tuploadUrl: z.string().url(),\n\texpiresInSeconds: z.number().int().positive()\n});\nconst CompleteProjectArtifactResponseSchema = z.object({\n\tartifact: ProjectArtifactSchema,\n\tproject: ProjectSchema\n});\n//#endregion\n//#region src/mappers/organizations.ts\nfunction mapOrganization(row) {\n\treturn OrganizationSchema.parse({\n\t\tid: row.id,\n\t\tname: row.name,\n\t\tslug: row.slug,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tupdatedAt: row.updatedAt.toISOString()\n\t});\n}\nfunction mapProject(row) {\n\treturn ProjectSchema.parse({\n\t\tid: row.id,\n\t\torganizationId: row.organizationId,\n\t\tname: row.name,\n\t\tdescription: row.description,\n\t\tstatus: row.status,\n\t\tbaseUrl: row.baseUrl,\n\t\truntimeId: row.runtimeId,\n\t\tlastError: row.lastError,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tupdatedAt: row.updatedAt.toISOString()\n\t});\n}\nfunction mapUserOrganization(row) {\n\treturn UserOrganizationSchema.parse({\n\t\torganization: mapOrganization(row.organization),\n\t\trole: row.role\n\t});\n}\n//#endregion\n//#region src/mappers/members.ts\nfunction mapOrganizationMember(row) {\n\treturn OrganizationMemberSchema.parse({\n\t\tid: row.id,\n\t\tname: row.name,\n\t\temail: row.email,\n\t\trole: row.role,\n\t\tstatus: row.status,\n\t\t...row.image ? { avatarUrl: row.image } : {},\n\t\tjoinedAt: row.createdAt.toISOString(),\n\t\tlastActiveAt: null\n\t});\n}\nfunction mapOrganizationInvitation(row) {\n\treturn OrganizationInvitationSchema.parse({\n\t\tid: row.id,\n\t\torganizationName: row.organizationName,\n\t\torganizationSlug: row.organizationSlug,\n\t\trole: row.role,\n\t\t...row.invitedByName ? { invitedByName: row.invitedByName } : {},\n\t\t...row.invitedByEmail ? { invitedByEmail: row.invitedByEmail } : {}\n\t});\n}\n//#endregion\n//#region src/mappers/project-artifacts.ts\nfunction mapProjectArtifact(row) {\n\treturn ProjectArtifactSchema.parse({\n\t\tid: row.id,\n\t\tprojectId: row.projectId,\n\t\tstorageKey: row.storageKey,\n\t\tstatus: row.status,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tupdatedAt: row.updatedAt.toISOString()\n\t});\n}\n//#endregion\nexport { ACTIVE_ORG_COOKIE, ACTIVE_ORG_HEADER, AcceptOrganizationInvitationResponseSchema, ActiveOrganizationResponseSchema, AgentListResponseSchema, AgentSessionDetailQuerySchema, AgentSessionDetailResponseSchema, AgentSessionListQuerySchema, AgentSessionListResponseSchema, CREDENTIAL_AUTH_KINDS, CREDENTIAL_SCOPE_LEVELS, CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE, CREDENTIAL_SCOPE_TYPES, ClaimableOrganizationSlugSchema, CompleteProjectArtifactResponseSchema, ConnectAuthorizeUrlResponseSchema, ConnectProvidersResponseSchema, CreateCredentialInstanceBodySchema, CreateOrganizationRequestSchema, CreateOrganizationResponseSchema, CreateProjectArtifactResponseSchema, CreateProjectRequestSchema, CreateProjectResponseSchema, CredentialAuthKindSchema, CredentialInstanceListResponseSchema, CredentialInstanceRecordSchema, CredentialScopeLevelSchema, CredentialScopeTypeSchema, CurrentOrganizationResponseSchema, DEFAULT_CREDENTIAL_RESOLUTION_CHAIN, DISCOVERY_CONVENTIONS, DeclineOrganizationInvitationResponseSchema, ErrorResponseCodeSchema, ErrorResponseSchema, GatewayAttachmentListResponseSchema, GatewayAttachmentRecordSchema, HealthResponseSchema, InvitableOrganizationMemberRoleSchema, InviteOrganizationMembersRequestSchema, InviteOrganizationMembersResponseSchema, ListOrganizationInvitationsResponseSchema, ListOrganizationMembersResponseSchema, ListOrganizationsResponseSchema, ListProjectsResponseSchema, ORGANIZATION_SLUG_TAKEN_MESSAGE, OrganizationInvitationSchema, OrganizationMemberRoleSchema, OrganizationMemberSchema, OrganizationMemberStatusSchema, OrganizationSchema, OrganizationSlugErrorCodeSchema, OrganizationSlugSchema, OrganizationUserRoleSchema, PROJECT_PING_TIMEOUT_MS, PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, PROJECT_REACHABILITY_RETRY_MS, PlatformInfoResponseSchema, PollRunRequestSchema, PollRunResponseSchema, ProjectArtifactSchema, ProjectArtifactStatusSchema, ProjectReachabilityResponseSchema, ProjectResponseSchema, ProjectSchema, ProjectStatusSchema, PromptInputSchema, PromptResponseSchema, QueuedAgentPromptResponseSchema, QueuedRunResponseSchema, RESERVED_ORGANIZATION_SLUGS, ROUTE_MANIFEST_HTTP_PATH, ROUTE_MANIFEST_REL_PATH, RunSourceKindSchema, RunSourceSchema, SetActiveOrganizationRequestSchema, SkipResponseSchema, SlugAvailabilityQuerySchema, SlugAvailabilityReasonSchema, SlugAvailabilityResponseSchema, StoredRouteManifestSchema, TriggerDetailResponseSchema, TriggerListItemSchema, TriggerListQuerySchema, TriggerListResponseSchema, TriggerRunDetailQuerySchema, TriggerRunDetailResponseSchema, TriggerRunListQuerySchema, TriggerRunListResponseSchema, TriggerTypeSchema, UpdateCredentialInstanceBodySchema, UpdateOrganizationMemberRequestSchema, UpdateOrganizationMemberResponseSchema, UpdateOrganizationRequestSchema, UpsertGatewayAttachmentBodySchema, UpsertWorkflowSubscriptionBodySchema, UserOrganizationSchema, ValidationErrorDetailSchema, WorkflowEventTypeSchema, WorkflowRunDetailQuerySchema, WorkflowRunDetailResponseSchema, WorkflowRunListQuerySchema, WorkflowRunListResponseSchema, WorkflowSubscriptionListResponseSchema, WorkflowSubscriptionRecordSchema, credential, credentialInputSchema, defineCredential, isCredentialInput, listenPortFromPublicUrl, listenPortFromUrl, mapOrganization, mapOrganizationInvitation, mapOrganizationMember, mapProject, mapProjectArtifact, mapUserOrganization, normalizeCredentialList, organizationInvitationAcceptPath, organizationSlugErrorCodeFromMessage, originFromPublicUrl, parseAgentSessionDetailInclude, parseCreateOrganizationRequest, parseErrorResponse, parseOrganizationSlug, parsePollRunRequest, parsePromptInput, parseStoredRouteManifest, parseTriggerRunDetailInclude, parseWorkflowRunDetailInclude, previewOrganizationSlugFromName, slugifyOrganizationName, toCredentialRequirement, toolParameters, validateClaimableOrganizationSlug, validationErrorResponse };\n\n//# sourceMappingURL=index.mjs.map","import ky, { isHTTPError } from \"ky\";\nimport { ACTIVE_ORG_HEADER, AgentSessionDetailResponseSchema, AgentSessionListResponseSchema, ConnectAuthorizeUrlResponseSchema, ConnectProvidersResponseSchema, CreateCredentialInstanceBodySchema, CredentialInstanceListResponseSchema, CredentialInstanceRecordSchema, HealthResponseSchema, PollRunResponseSchema, PromptInputSchema, PromptResponseSchema, QueuedAgentPromptResponseSchema, QueuedRunResponseSchema, SkipResponseSchema, TriggerDetailResponseSchema, TriggerListResponseSchema, TriggerRunDetailResponseSchema, TriggerRunListResponseSchema, UpdateCredentialInstanceBodySchema, WorkflowRunDetailResponseSchema, WorkflowRunListResponseSchema, parseErrorResponse } from \"@keystrokehq/shared\";\n//#region src/auth.ts\nfunction normalizeBaseUrl(baseUrl) {\n\treturn baseUrl.replace(/\\/+$/, \"\");\n}\nfunction applyActiveOrganizationHeader(request, organizationId) {\n\tif (organizationId) request.headers.set(ACTIVE_ORG_HEADER, organizationId);\n}\nfunction applyAuthHeaders(request, auth, getToken) {\n\tif (!auth || auth.type === \"none\") return;\n\tif (auth.type === \"cookie\") return;\n\tif (auth.type === \"apiKey\") {\n\t\tconst key = auth.getKey();\n\t\tif (key) request.headers.set(\"x-api-key\", key);\n\t\treturn;\n\t}\n\tif (auth.type === \"bearer\") {\n\t\tconst tokenPromise = getToken?.() ?? auth.getToken();\n\t\treturn Promise.resolve(tokenPromise).then((token) => {\n\t\t\tif (token) request.headers.set(\"Authorization\", `Bearer ${token}`);\n\t\t});\n\t}\n}\nfunction kyCredentials(auth) {\n\tif (auth?.type === \"cookie\") return auth.credentials ?? \"include\";\n\treturn \"omit\";\n}\n//#endregion\n//#region src/errors.ts\nvar KeystrokeError = class extends Error {\n\tstatus;\n\tbody;\n\tconstructor(message, status, body) {\n\t\tsuper(message);\n\t\tthis.name = \"KeystrokeError\";\n\t\tthis.status = status;\n\t\tthis.body = body;\n\t}\n};\nasync function toKeystrokeError(error) {\n\tif (!isHTTPError(error)) return new KeystrokeError(error instanceof Error ? error.message : \"Request failed\", 0, null);\n\tconst status = error.response.status;\n\tconst body = error.data ?? null;\n\tconst parsed = parseErrorResponse(body);\n\treturn new KeystrokeError(parsed ? parsed.message ?? parsed.error : `Request failed with status ${status}`, status, body);\n}\n//#endregion\n//#region src/resources/shared.ts\nasync function readJson(response) {\n\treturn response.json();\n}\n//#endregion\n//#region src/resources/agents.ts\nfunction isQueuedAgentPromptResponse(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tif (\"messages\" in value) return false;\n\treturn QueuedAgentPromptResponseSchema.safeParse(value).success;\n}\nfunction listSessionsSearchParams(query) {\n\tif (!query) return {};\n\tconst params = {};\n\tif (query.limit !== void 0) params.limit = String(query.limit);\n\tif (query.cursor) params.cursor = query.cursor;\n\tif (query.status) params.status = query.status;\n\tif (query.source) params.source = query.source;\n\treturn params;\n}\nfunction detailSearchParams$2(query) {\n\tif (!query?.include) return {};\n\treturn { include: query.include };\n}\nfunction createAgentsResource(http) {\n\treturn {\n\t\tasync prompt(id, input) {\n\t\t\tconst body = PromptInputSchema.parse(input);\n\t\t\ttry {\n\t\t\t\tconst response = await http.post(`agents/${id}`, { json: body });\n\t\t\t\tconst data = await readJson(response);\n\t\t\t\tif (response.status === 202) return QueuedAgentPromptResponseSchema.parse(data);\n\t\t\t\treturn PromptResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync listSessions(agentId, query) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`agents/${agentId}/sessions`, { searchParams: listSessionsSearchParams(query) }).json();\n\t\t\t\treturn AgentSessionListResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync getSession(agentId, sessionId, query) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`agents/${agentId}/sessions/${sessionId}`, { searchParams: detailSearchParams$2(query) }).json();\n\t\t\t\treturn AgentSessionDetailResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/resources/connect.ts\nfunction routeFromPath(path) {\n\treturn path.replace(/^\\//, \"\");\n}\nfunction createConnectResource(http) {\n\treturn {\n\t\tasync listProviders() {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(\"connect/providers\").json();\n\t\t\t\treturn ConnectProvidersResponseSchema.parse(data).providers;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync getAuthorizeUrl(path) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(routeFromPath(path)).json();\n\t\t\t\treturn ConnectAuthorizeUrlResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/resources/credentials.ts\nfunction createCredentialsResource(http) {\n\treturn {\n\t\tasync listInstances(options) {\n\t\t\ttry {\n\t\t\t\tconst searchParams = options?.key ? { key: options.key } : void 0;\n\t\t\t\tconst data = await http.get(\"credentials/instances\", { searchParams }).json();\n\t\t\t\treturn CredentialInstanceListResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync createInstance(body) {\n\t\t\ttry {\n\t\t\t\tconst payload = CreateCredentialInstanceBodySchema.parse(body);\n\t\t\t\tconst data = await http.post(\"credentials/instances\", { json: payload }).json();\n\t\t\t\treturn CredentialInstanceRecordSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync updateInstance(id, body) {\n\t\t\ttry {\n\t\t\t\tconst payload = UpdateCredentialInstanceBodySchema.parse(body);\n\t\t\t\tconst data = await http.put(`credentials/instances/${id}`, { json: payload }).json();\n\t\t\t\treturn CredentialInstanceRecordSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync deleteInstance(id) {\n\t\t\ttry {\n\t\t\t\tawait http.delete(`credentials/instances/${id}`);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/resources/health.ts\nfunction createHealthResource(http) {\n\treturn { async check() {\n\t\ttry {\n\t\t\tconst data = await http.get(\"health\").json();\n\t\t\treturn HealthResponseSchema.parse(data);\n\t\t} catch (error) {\n\t\t\tthrow await toKeystrokeError(error);\n\t\t}\n\t} };\n}\n//#endregion\n//#region src/resources/openapi.ts\nfunction createOpenApiResource(http) {\n\treturn { async fetch() {\n\t\ttry {\n\t\t\treturn await http.get(\"openapi.json\").json();\n\t\t} catch (error) {\n\t\t\tthrow await toKeystrokeError(error);\n\t\t}\n\t} };\n}\n//#endregion\n//#region src/resources/triggers.ts\nfunction pollRunBody(options) {\n\tif (!options?.workflows?.length && !options?.attachments?.length) return;\n\treturn {\n\t\t...options.workflows?.length ? { workflows: options.workflows } : {},\n\t\t...options.attachments?.length ? { attachments: options.attachments } : {}\n\t};\n}\nfunction listRunsSearchParams$1(query) {\n\tif (!query) return {};\n\tconst params = {};\n\tif (query.limit !== void 0) params.limit = String(query.limit);\n\tif (query.cursor) params.cursor = query.cursor;\n\tif (query.triggerType) params.triggerType = query.triggerType;\n\treturn params;\n}\nfunction detailSearchParams$1(query) {\n\tif (!query?.include) return {};\n\treturn { include: query.include };\n}\nfunction createTriggersResource(http) {\n\treturn {\n\t\tasync list(query) {\n\t\t\ttry {\n\t\t\t\tconst searchParams = query?.endpoint ? { endpoint: query.endpoint } : void 0;\n\t\t\t\tconst data = await http.get(\"triggers\", { searchParams }).json();\n\t\t\t\treturn TriggerListResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync get(id) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`triggers/${id}`).json();\n\t\t\t\tconst list = TriggerListResponseSchema.safeParse(data);\n\t\t\t\tif (list.success) return list.data;\n\t\t\t\treturn TriggerDetailResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync webhookUrl(id) {\n\t\t\tconst result = await this.get(id);\n\t\t\tconst webhookUrl = \"triggers\" in result ? result.triggers.find((entry) => entry.webhookUrl)?.webhookUrl : result.webhookUrl;\n\t\t\tif (!webhookUrl) throw new KeystrokeError(`Webhook URL not found: ${id}`, 404, { error: \"Not found\" });\n\t\t\treturn webhookUrl;\n\t\t},\n\t\tasync webhook(endpoint, body = {}, options = {}) {\n\t\t\ttry {\n\t\t\t\tconst searchParams = options.token ? { token: options.token } : void 0;\n\t\t\t\tconst normalized = endpoint.replace(/^\\/+|\\/+$/g, \"\").replace(/^triggers\\/?/, \"\");\n\t\t\t\treturn await http.post(`triggers/${normalized}`, {\n\t\t\t\t\tjson: body,\n\t\t\t\t\tsearchParams\n\t\t\t\t}).json();\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync poll(id, options = {}) {\n\t\t\ttry {\n\t\t\t\tconst { group, ...target } = options;\n\t\t\t\tconst json = pollRunBody(target);\n\t\t\t\tconst path = group ? `triggers/polls/${id}/run` : `triggers/${id}/poll`;\n\t\t\t\tconst data = await readJson(await http.post(path, json ? { json } : void 0));\n\t\t\t\tPollRunResponseSchema.parse(data);\n\t\t\t\treturn data;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync runPollGroup(pollId, options = {}) {\n\t\t\treturn this.poll(pollId, {\n\t\t\t\t...options,\n\t\t\t\tgroup: true\n\t\t\t});\n\t\t},\n\t\tasync listRuns(attachmentId, query) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`triggers/${attachmentId}/runs`, { searchParams: listRunsSearchParams$1(query) }).json();\n\t\t\t\treturn TriggerRunListResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync getRun(attachmentId, runId, query) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`triggers/${attachmentId}/runs/${runId}`, { searchParams: detailSearchParams$1(query) }).json();\n\t\t\t\treturn TriggerRunDetailResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t}\n\t};\n}\nfunction isSkippedTriggerResponse(value) {\n\treturn SkipResponseSchema.safeParse(value).success;\n}\n//#endregion\n//#region src/resources/workflows.ts\nfunction isQueuedRunResponse(value) {\n\treturn QueuedRunResponseSchema.safeParse(value).success;\n}\nfunction listRunsSearchParams(query) {\n\tif (!query) return {};\n\tconst params = {};\n\tif (query.limit !== void 0) params.limit = String(query.limit);\n\tif (query.cursor) params.cursor = query.cursor;\n\tif (query.status) params.status = query.status;\n\tif (query.trigger) params.trigger = query.trigger;\n\treturn params;\n}\nfunction detailSearchParams(query) {\n\tif (!query?.include) return {};\n\treturn { include: query.include };\n}\nfunction createWorkflowsResource(http) {\n\treturn {\n\t\tasync run(id, input = {}) {\n\t\t\ttry {\n\t\t\t\tconst response = await http.post(`workflows/${id}`, { json: input });\n\t\t\t\tconst data = await readJson(response);\n\t\t\t\tif (response.status === 202) return QueuedRunResponseSchema.parse(data);\n\t\t\t\treturn data;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync listRuns(workflowId, query) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`workflows/${workflowId}/runs`, { searchParams: listRunsSearchParams(query) }).json();\n\t\t\t\treturn WorkflowRunListResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync getRun(workflowId, runId, query) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`workflows/${workflowId}/runs/${runId}`, { searchParams: detailSearchParams(query) }).json();\n\t\t\t\treturn WorkflowRunDetailResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/index.ts\nfunction createKeystrokeClient(options) {\n\tconst auth = options.auth ?? { type: \"none\" };\n\tconst base = normalizeBaseUrl(options.baseUrl);\n\tconst getActiveOrganizationId = options.getActiveOrganizationId;\n\tconst http = ky.create({\n\t\tprefix: base === \"\" ? void 0 : `${base}/`,\n\t\tcredentials: kyCredentials(auth),\n\t\thooks: { beforeRequest: [({ request }) => {\n\t\t\tapplyActiveOrganizationHeader(request, getActiveOrganizationId?.());\n\t\t\treturn applyAuthHeaders(request, auth);\n\t\t}] },\n\t\t...options.ky\n\t});\n\treturn {\n\t\thttp,\n\t\thealth: createHealthResource(http),\n\t\tconnect: createConnectResource(http),\n\t\tcredentials: createCredentialsResource(http),\n\t\topenapi: createOpenApiResource(http),\n\t\tagents: createAgentsResource(http),\n\t\tworkflows: createWorkflowsResource(http),\n\t\ttriggers: createTriggersResource(http)\n\t};\n}\n//#endregion\nexport { KeystrokeError, createKeystrokeClient, isQueuedAgentPromptResponse, isQueuedRunResponse, isSkippedTriggerResponse, toKeystrokeError };\n\n//# sourceMappingURL=index.mjs.map","import { Entry } from \"@napi-rs/keyring\";\n\nconst SERVICE = \"keystroke\";\n\nfunction accountForWebUrl(webUrl: string): string {\n return new URL(webUrl).hostname;\n}\n\nexport function getAccessToken(webUrl: string): string | undefined {\n const entry = new Entry(SERVICE, accountForWebUrl(webUrl));\n const password = entry.getPassword();\n return password === null ? undefined : password;\n}\n\nexport function setAccessToken(webUrl: string, token: string): void {\n const entry = new Entry(SERVICE, accountForWebUrl(webUrl));\n entry.setPassword(token);\n}\n\nexport function clearAccessToken(webUrl: string): void {\n const entry = new Entry(SERVICE, accountForWebUrl(webUrl));\n entry.deletePassword();\n}\n","import { originFromPublicUrl } from \"@keystrokehq/shared\";\n\nexport const DEFAULT_WEB_URL = \"https://app.keystroke.ai\";\nexport const DEFAULT_PLATFORM_URL = \"https://api.keystroke.ai\";\nexport const LOCAL_WEB_URL = \"http://localhost:3000\";\nexport const LOCAL_PLATFORM_URL = \"http://localhost:3002\";\n\nexport type ResolvePlatformUrlOptions = {\n platformUrl?: string;\n /** Used when webUrl does not match a known deployment. */\n fallback?: string;\n};\n\nfunction webOriginFromUrl(webUrl: string): string {\n return originFromPublicUrl(webUrl, webUrl.replace(/\\/+$/, \"\"));\n}\n\n/** Known web origins with a fixed platform API — undefined for custom/staging URLs. */\nexport function knownPlatformUrlForWebUrl(webUrl: string): string | undefined {\n const webOrigin = webOriginFromUrl(webUrl);\n\n if (webOrigin === LOCAL_WEB_URL || webOrigin === \"http://127.0.0.1:3000\") {\n return LOCAL_PLATFORM_URL;\n }\n\n if (webOrigin === DEFAULT_WEB_URL) {\n return DEFAULT_PLATFORM_URL;\n }\n\n return undefined;\n}\n\nexport function resolvePlatformUrlForWebUrl(\n webUrl: string,\n options: ResolvePlatformUrlOptions = {},\n): string {\n const explicit = options.platformUrl?.trim();\n if (explicit) {\n return explicit.replace(/\\/+$/, \"\");\n }\n\n const known = knownPlatformUrlForWebUrl(webUrl);\n if (known) {\n return known;\n }\n\n const fallback = options.fallback?.trim() || DEFAULT_PLATFORM_URL;\n return fallback.replace(/\\/+$/, \"\");\n}\n","import Conf from \"conf\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nimport {\n DEFAULT_PLATFORM_URL,\n DEFAULT_WEB_URL,\n knownPlatformUrlForWebUrl,\n resolvePlatformUrlForWebUrl,\n} from \"./resolve-platform-url\";\n\nexport type ApiTargetMode = \"local\" | \"platform\";\n\nexport type CliConfig = {\n serverUrl: string;\n webUrl: string;\n platformUrl: string;\n activeOrganizationId?: string;\n activeProjectId?: string;\n apiTarget?: ApiTargetMode;\n};\n\nexport function getCliConfigDir(cwd = join(homedir(), \".keystroke\")): string {\n return cwd;\n}\n\nexport function getConfigDir(config: Conf<CliConfig>): string {\n return dirname(config.path);\n}\n\nexport function getEffectiveApiTarget(config: Conf<CliConfig>): ApiTargetMode {\n const explicit = config.get(\"apiTarget\");\n if (explicit === \"local\" || explicit === \"platform\") {\n return explicit;\n }\n\n return \"local\";\n}\n\nfunction syncPlatformUrlWithWebUrl(config: Conf<CliConfig>): void {\n const webUrl = config.get(\"webUrl\");\n const known = knownPlatformUrlForWebUrl(webUrl);\n if (!known) {\n return;\n }\n\n const stored = config.get(\"platformUrl\");\n if (stored !== known) {\n config.set(\"platformUrl\", known);\n }\n}\n\nexport function createCliConfig(cwd = getCliConfigDir()): Conf<CliConfig> {\n const config = new Conf<CliConfig>({\n projectName: \"keystroke\",\n cwd,\n schema: {\n serverUrl: {\n type: \"string\",\n default: \"http://localhost:3001\",\n },\n webUrl: {\n type: \"string\",\n default: DEFAULT_WEB_URL,\n },\n platformUrl: {\n type: \"string\",\n default: DEFAULT_PLATFORM_URL,\n },\n activeOrganizationId: {\n type: \"string\",\n },\n activeProjectId: {\n type: \"string\",\n },\n apiTarget: {\n type: \"string\",\n enum: [\"local\", \"platform\"],\n },\n },\n });\n\n syncPlatformUrlWithWebUrl(config);\n return config;\n}\n\nexport function getServerUrl(config: Conf<CliConfig>): string {\n return config.get(\"serverUrl\");\n}\n\nexport function getWebUrl(config: Conf<CliConfig>): string {\n return config.get(\"webUrl\");\n}\n\nexport function getPlatformUrl(config: Conf<CliConfig>): string {\n return resolvePlatformUrlForWebUrl(getWebUrl(config), {\n fallback: config.get(\"platformUrl\"),\n });\n}\n","import type { AuthStrategy } from \"@keystrokehq/sdk\";\nimport type Conf from \"conf\";\nimport { getAccessToken } from \"./credentials\";\nimport { getWebUrl, type CliConfig } from \"../config\";\n\n/** Returns bearer auth when a token is stored; otherwise none. */\nexport function resolveCliAuth(config: Conf<CliConfig>): AuthStrategy {\n const webUrl = getWebUrl(config);\n const token = getAccessToken(webUrl);\n if (!token) {\n return { type: \"none\" };\n }\n\n return {\n type: \"bearer\",\n getToken: () => token,\n };\n}\n","import { createKeystrokeClient, type KeystrokeClient } from \"@keystrokehq/sdk\";\nimport type Conf from \"conf\";\nimport { resolveCliAuth } from \"./auth/resolve-cli-auth\";\nimport type { CliConfig } from \"./config\";\n\nexport function createCliClient(\n config: Conf<CliConfig>,\n options: { baseUrl: string; platform?: boolean },\n): KeystrokeClient {\n return createKeystrokeClient({\n baseUrl: options.baseUrl,\n auth: resolveCliAuth(config),\n getActiveOrganizationId: options.platform\n ? () => config.get(\"activeOrganizationId\") ?? null\n : undefined,\n });\n}\n","import ky, { isHTTPError } from \"ky\";\nimport { ACTIVE_ORG_HEADER, AcceptOrganizationInvitationResponseSchema, ActiveOrganizationResponseSchema, CompleteProjectArtifactResponseSchema, CreateOrganizationRequestSchema, CreateOrganizationResponseSchema, CreateProjectArtifactResponseSchema, CreateProjectRequestSchema, CreateProjectResponseSchema, DeclineOrganizationInvitationResponseSchema, ErrorResponseSchema, HealthResponseSchema, InviteOrganizationMembersRequestSchema, InviteOrganizationMembersResponseSchema, ListOrganizationInvitationsResponseSchema, ListOrganizationMembersResponseSchema, ListOrganizationsResponseSchema, ListProjectsResponseSchema, PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, ProjectReachabilityResponseSchema, ProjectResponseSchema, SetActiveOrganizationRequestSchema, SlugAvailabilityResponseSchema, UpdateOrganizationMemberRequestSchema, UpdateOrganizationMemberResponseSchema, UpdateOrganizationRequestSchema } from \"@keystrokehq/shared\";\n//#region src/platform/active-organization.ts\nconst STORAGE_KEY = \"keystroke-active-org-id\";\nfunction readActiveOrganizationId() {\n\tif (typeof localStorage === \"undefined\") return null;\n\treturn localStorage.getItem(STORAGE_KEY);\n}\nfunction writeActiveOrganizationId(organizationId) {\n\tif (typeof localStorage === \"undefined\") return;\n\tif (organizationId) {\n\t\tlocalStorage.setItem(STORAGE_KEY, organizationId);\n\t\treturn;\n\t}\n\tlocalStorage.removeItem(STORAGE_KEY);\n}\n//#endregion\n//#region src/platform/auth.ts\nfunction normalizeBaseUrl(baseUrl) {\n\treturn baseUrl.replace(/\\/+$/, \"\");\n}\nfunction applyAuthHeaders(request, auth, getToken) {\n\tif (!auth || auth.type === \"none\" || auth.type === \"cookie\") return;\n\tif (auth.type === \"bearer\") {\n\t\tconst tokenPromise = getToken?.() ?? auth.getToken();\n\t\treturn Promise.resolve(tokenPromise).then((token) => {\n\t\t\tif (token) request.headers.set(\"Authorization\", `Bearer ${token}`);\n\t\t});\n\t}\n}\nfunction applyActiveOrganizationHeader(request, organizationId) {\n\tif (organizationId) request.headers.set(ACTIVE_ORG_HEADER, organizationId);\n}\nfunction kyCredentials(auth) {\n\tif (auth?.type === \"cookie\") return auth.credentials ?? \"include\";\n\treturn \"omit\";\n}\n/** Browser client — sends Better Auth session cookies with platform API requests. */\nfunction browserAuthStrategy() {\n\treturn {\n\t\ttype: \"cookie\",\n\t\tcredentials: \"include\"\n\t};\n}\n//#endregion\n//#region src/platform/errors.ts\nvar PlatformError = class extends Error {\n\tstatus;\n\tbody;\n\tcode;\n\tconstructor(message, status, body, code) {\n\t\tsuper(message);\n\t\tthis.name = \"PlatformError\";\n\t\tthis.status = status;\n\t\tthis.body = body;\n\t\tthis.code = code;\n\t}\n};\nasync function toPlatformError(error) {\n\tif (!isHTTPError(error)) return new PlatformError(error instanceof Error ? error.message : \"Request failed\", 0, null);\n\tconst status = error.response.status;\n\tconst body = error.data ?? null;\n\tconst parsed = ErrorResponseSchema.safeParse(body);\n\treturn new PlatformError(parsed.success ? parsed.data.error : `Request failed with status ${status}`, status, body, parsed.success ? parsed.data.code : void 0);\n}\n//#endregion\n//#region src/platform/resources/artifacts.ts\nfunction createArtifactsResource(http) {\n\treturn {\n\t\tasync create(projectId) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(`/api/projects/${encodeURIComponent(projectId)}/artifacts`).json();\n\t\t\t\treturn CreateProjectArtifactResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync complete(projectId, artifactId) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(`/api/projects/${encodeURIComponent(projectId)}/artifacts/${encodeURIComponent(artifactId)}/complete`).json();\n\t\t\t\treturn CompleteProjectArtifactResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/platform/resources/health.ts\nfunction createHealthResource(http) {\n\treturn { async check() {\n\t\ttry {\n\t\t\tconst data = await http.get(\"/health\").json();\n\t\t\treturn HealthResponseSchema.parse(data);\n\t\t} catch (error) {\n\t\t\tthrow await toPlatformError(error);\n\t\t}\n\t} };\n}\n//#endregion\n//#region src/platform/resources/mock-registry.ts\nconst registry = /* @__PURE__ */ new Map();\n/**\n* Wraps a mock implementation, registering it in the manifest. The returned\n* function is the unchanged implementation — `mock()` only adds bookkeeping.\n*/\nfunction mock(entry, impl) {\n\tregistry.set(`${entry.domain}.${entry.method}`, entry);\n\treturn impl;\n}\n/** The current inventory of mocked methods. Populated once a client is created. */\nfunction mockManifest() {\n\treturn [...registry.values()];\n}\n//#endregion\n//#region src/platform/resources/organizations.ts\nfunction createOrganizationsResource(http, options = {}) {\n\treturn {\n\t\tasync list() {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(\"/api/organizations\").json();\n\t\t\t\treturn ListOrganizationsResponseSchema.parse(data).organizations;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync getActive() {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(\"/api/organizations/active\").json();\n\t\t\t\treturn ActiveOrganizationResponseSchema.parse(data).organization;\n\t\t\t} catch (error) {\n\t\t\t\tif (isHTTPError(error) && error.response.status === 401) return null;\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync setActive(input) {\n\t\t\tconst body = SetActiveOrganizationRequestSchema.parse(input);\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(\"/api/organizations/active\", { json: body }).json();\n\t\t\t\tconst organization = ActiveOrganizationResponseSchema.parse(data).organization;\n\t\t\t\tif (!organization) throw new Error(\"Active organization was not returned\");\n\t\t\t\toptions.onActiveOrganizationChange?.(organization.organization.id);\n\t\t\t\treturn organization;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync clearActive() {\n\t\t\ttry {\n\t\t\t\tawait http.delete(\"/api/organizations/active\");\n\t\t\t\toptions.onActiveOrganizationChange?.(null);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync update(input) {\n\t\t\tconst body = UpdateOrganizationRequestSchema.parse(input);\n\t\t\ttry {\n\t\t\t\tconst data = await http.patch(\"/api/organizations/active\", { json: body }).json();\n\t\t\t\tconst organization = ActiveOrganizationResponseSchema.parse(data).organization;\n\t\t\t\tif (!organization) throw new Error(\"Active organization was not returned\");\n\t\t\t\treturn organization;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync create(input) {\n\t\t\tconst body = CreateOrganizationRequestSchema.parse(input);\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(\"/api/organizations\", { json: body }).json();\n\t\t\t\treturn CreateOrganizationResponseSchema.parse(data).organization;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tupdateProfile: mock({\n\t\t\tdomain: \"organizations\",\n\t\t\tmethod: \"updateProfile\",\n\t\t\tplannedEndpoint: \"PATCH /api/organizations/active (name)\"\n\t\t}, async (input) => {\n\t\t\tconst name = input.name.trim();\n\t\t\tif (!name) throw new Error(\"Organization name is required\");\n\t\t\tconst organizationId = options.getActiveOrganizationId?.()?.trim();\n\t\t\tif (!organizationId) throw new Error(\"Active organization is required to update profile\");\n\t\t\treturn {\n\t\t\t\tid: organizationId,\n\t\t\t\tname\n\t\t\t};\n\t\t}),\n\t\tasync checkSlug(slug, options = {}) {\n\t\t\tconst searchParams = new URLSearchParams({ slug });\n\t\t\tif (options.excludeOrganizationId) searchParams.set(\"excludeOrganizationId\", options.excludeOrganizationId);\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`/api/organizations/slug-available?${searchParams}`).json();\n\t\t\t\treturn SlugAvailabilityResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/platform/resources/projects.ts\nfunction createProjectsResource(http) {\n\treturn {\n\t\tasync list() {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(\"/api/projects\").json();\n\t\t\t\treturn ListProjectsResponseSchema.parse(data).projects;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync create(input) {\n\t\t\tconst body = CreateProjectRequestSchema.parse(input);\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(\"/api/projects\", { json: body }).json();\n\t\t\t\treturn CreateProjectResponseSchema.parse(data).project;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync get(projectId) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`/api/projects/${encodeURIComponent(projectId)}`).json();\n\t\t\t\treturn ProjectResponseSchema.parse(data).project;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tupdate: mock({\n\t\t\tdomain: \"projects\",\n\t\t\tmethod: \"update\",\n\t\t\tplannedEndpoint: \"PATCH /api/projects/:id\"\n\t\t}, async (projectId, patch) => {\n\t\t\treturn {\n\t\t\t\tid: projectId,\n\t\t\t\t...patch\n\t\t\t};\n\t\t}),\n\t\tasync checkReachability(projectId) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`/api/projects/${encodeURIComponent(projectId)}/reachability`, { timeout: PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS }).json();\n\t\t\t\treturn ProjectReachabilityResponseSchema.parse(data).reachable;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/platform/resources/mock-project-settings.ts\nconst DEFAULT_PROJECT_SETTINGS = {\n\tdescription: \"\",\n\tdefaultRole: \"editor\",\n\tinvitePermission: \"admin\"\n};\nconst MOCK_STORAGE_KEY$4 = \"keystroke:mock-project-settings:v1\";\nfunction getBrowserLocalStorage$4() {\n\tif (typeof globalThis !== \"object\") return null;\n\treturn globalThis.localStorage ?? null;\n}\nfunction normalizeDefaultRole(value) {\n\treturn value === \"admin\" ? \"admin\" : \"editor\";\n}\nfunction normalizeInvitePermission(value) {\n\treturn value === \"all\" ? \"all\" : \"admin\";\n}\nfunction normalizeProjectSettings(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_PROJECT_SETTINGS;\n\tconst settings = value;\n\treturn {\n\t\tdescription: typeof settings.description === \"string\" ? settings.description : \"\",\n\t\tdefaultRole: normalizeDefaultRole(settings.defaultRole),\n\t\tinvitePermission: normalizeInvitePermission(settings.invitePermission)\n\t};\n}\nfunction mergeProjectSettings(current, patch) {\n\treturn normalizeProjectSettings({\n\t\t...current,\n\t\t...patch\n\t});\n}\nfunction readSettingsStore() {\n\tconst localStorage = getBrowserLocalStorage$4();\n\tif (!localStorage) return {};\n\ttry {\n\t\tconst raw = localStorage.getItem(MOCK_STORAGE_KEY$4);\n\t\tif (!raw) return {};\n\t\tconst parsed = JSON.parse(raw);\n\t\tif (!parsed || typeof parsed !== \"object\") return {};\n\t\treturn Object.fromEntries(Object.entries(parsed).map(([projectId, value]) => [projectId, normalizeProjectSettings(value)]));\n\t} catch {\n\t\treturn {};\n\t}\n}\nfunction writeSettingsStore(store) {\n\tconst localStorage = getBrowserLocalStorage$4();\n\tif (!localStorage) return;\n\ttry {\n\t\tlocalStorage.setItem(MOCK_STORAGE_KEY$4, JSON.stringify(store));\n\t} catch {}\n}\nfunction requireProjectId(projectId) {\n\tconst trimmed = projectId.trim();\n\tif (!trimmed) throw new Error(\"Project settings require a project id\");\n\treturn trimmed;\n}\nfunction createProjectSettingsResource() {\n\treturn {\n\t\tget: mock({\n\t\t\tdomain: \"projectSettings\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/projects/:id/settings\"\n\t\t}, async (projectId) => {\n\t\t\tconst id = requireProjectId(projectId);\n\t\t\treturn readSettingsStore()[id] ?? DEFAULT_PROJECT_SETTINGS;\n\t\t}),\n\t\tupdate: mock({\n\t\t\tdomain: \"projectSettings\",\n\t\t\tmethod: \"update\",\n\t\t\tplannedEndpoint: \"PATCH /api/projects/:id/settings\"\n\t\t}, async (projectId, patch) => {\n\t\t\tconst id = requireProjectId(projectId);\n\t\t\tconst store = readSettingsStore();\n\t\t\tconst next = mergeProjectSettings(store[id] ?? DEFAULT_PROJECT_SETTINGS, patch);\n\t\t\twriteSettingsStore({\n\t\t\t\t...store,\n\t\t\t\t[id]: next\n\t\t\t});\n\t\t\treturn next;\n\t\t})\n\t};\n}\n//#endregion\n//#region src/platform/resources/invitations.ts\nfunction createInvitationsResource(http) {\n\treturn {\n\t\tasync list() {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(\"/api/invitations\").json();\n\t\t\t\treturn ListOrganizationInvitationsResponseSchema.parse(data).invitations;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync accept(invitationId) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(`/api/invitations/${encodeURIComponent(invitationId)}/accept`).json();\n\t\t\t\treturn AcceptOrganizationInvitationResponseSchema.parse(data).organization;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync decline(invitationId) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(`/api/invitations/${encodeURIComponent(invitationId)}/decline`).json();\n\t\t\t\tDeclineOrganizationInvitationResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/platform/resources/members.ts\nfunction createMembersResource$1(http) {\n\treturn {\n\t\tasync listOrganizationMembers() {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(\"/api/members\").json();\n\t\t\t\treturn ListOrganizationMembersResponseSchema.parse(data).members;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync inviteOrganizationMembers(input) {\n\t\t\tconst body = InviteOrganizationMembersRequestSchema.parse(input);\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(\"/api/members/invitations\", { json: body }).json();\n\t\t\t\treturn InviteOrganizationMembersResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync updateOrganizationMember(userId, input) {\n\t\t\tconst body = UpdateOrganizationMemberRequestSchema.parse(input);\n\t\t\ttry {\n\t\t\t\tconst data = await http.patch(`/api/members/${encodeURIComponent(userId)}`, { json: body }).json();\n\t\t\t\treturn UpdateOrganizationMemberResponseSchema.parse(data).member;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync removeOrganizationMember(userId) {\n\t\t\ttry {\n\t\t\t\tawait http.delete(`/api/members/${encodeURIComponent(userId)}`);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/platform/resources/mock-seed.ts\nconst APP_CATALOG_BASE = [\n\t{\n\t\tid: \"app-gmail\",\n\t\tname: \"Gmail\",\n\t\tdescription: \"Email trigger and delivery integration.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-slack\",\n\t\tname: \"Slack\",\n\t\tdescription: \"Post messages and handle approvals via Slack channels.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-github\",\n\t\tname: \"GitHub\",\n\t\tdescription: \"React to repo events and manage pull requests.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-anthropic\",\n\t\tname: \"Anthropic\",\n\t\tdescription: \"Claude models for agent and workflow AI steps.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-attio\",\n\t\tname: \"Attio\",\n\t\tdescription: \"CRM operations for deals, contacts, and notes.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-openai\",\n\t\tname: \"OpenAI\",\n\t\tdescription: \"GPT models and embeddings for AI-powered steps.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-airtable\",\n\t\tname: \"Airtable\",\n\t\tdescription: \"Read and write records in Airtable bases.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-google-sheets\",\n\t\tname: \"Google Sheets\",\n\t\tdescription: \"Read, update, and append rows in spreadsheets.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-google-drive\",\n\t\tname: \"Google Drive\",\n\t\tdescription: \"Find, read, and organize files across shared drives.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-google-calendar\",\n\t\tname: \"Google Calendar\",\n\t\tdescription: \"Create events, check availability, and coordinate meetings.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-notion\",\n\t\tname: \"Notion\",\n\t\tdescription: \"Query databases, create pages, and update workspace docs.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-linear\",\n\t\tname: \"Linear\",\n\t\tdescription: \"Create issues, update triage queues, and comment on work.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-jira\",\n\t\tname: \"Jira\",\n\t\tdescription: \"Sync issues, transitions, comments, and project fields.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-asana\",\n\t\tname: \"Asana\",\n\t\tdescription: \"Create tasks, update projects, and track team work.\",\n\t\tcategory: \"Project Management\"\n\t},\n\t{\n\t\tid: \"app-trello\",\n\t\tname: \"Trello\",\n\t\tdescription: \"Move cards, update boards, and automate checklist work.\",\n\t\tcategory: \"Project Management\"\n\t},\n\t{\n\t\tid: \"app-clickup\",\n\t\tname: \"ClickUp\",\n\t\tdescription: \"Manage tasks, docs, custom fields, and workspace automations.\",\n\t\tcategory: \"Project Management\"\n\t},\n\t{\n\t\tid: \"app-monday\",\n\t\tname: \"monday.com\",\n\t\tdescription: \"Automate boards, items, updates, and team workflows.\",\n\t\tcategory: \"Project Management\"\n\t},\n\t{\n\t\tid: \"app-discord\",\n\t\tname: \"Discord\",\n\t\tdescription: \"Post updates, listen for commands, and manage communities.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-microsoft-teams\",\n\t\tname: \"Microsoft Teams\",\n\t\tdescription: \"Send messages, route approvals, and coordinate team channels.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-google-chat\",\n\t\tname: \"Google Chat\",\n\t\tdescription: \"Send messages and surface agent responses in Google Chat.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-telegram\",\n\t\tname: \"Telegram\",\n\t\tdescription: \"Send bot messages and respond to chats and groups.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-whatsapp\",\n\t\tname: \"WhatsApp\",\n\t\tdescription: \"Send WhatsApp messages and respond to customer threads.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-hubspot\",\n\t\tname: \"HubSpot\",\n\t\tdescription: \"Manage contacts, companies, deals, tickets, and timelines.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-salesforce\",\n\t\tname: \"Salesforce\",\n\t\tdescription: \"Read and update leads, accounts, opportunities, and cases.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-pipedrive\",\n\t\tname: \"Pipedrive\",\n\t\tdescription: \"Move deals, update contacts, and automate sales pipelines.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-intercom\",\n\t\tname: \"Intercom\",\n\t\tdescription: \"Route conversations, update users, and summarize support.\",\n\t\tcategory: \"Support\"\n\t},\n\t{\n\t\tid: \"app-zendesk\",\n\t\tname: \"Zendesk\",\n\t\tdescription: \"Create tickets, reply to customers, and sync support context.\",\n\t\tcategory: \"Support\"\n\t},\n\t{\n\t\tid: \"app-freshdesk\",\n\t\tname: \"Freshdesk\",\n\t\tdescription: \"Automate ticket routing, replies, and customer updates.\",\n\t\tcategory: \"Support\"\n\t},\n\t{\n\t\tid: \"app-front\",\n\t\tname: \"Front\",\n\t\tdescription: \"Manage shared inboxes, comments, tags, and customer replies.\",\n\t\tcategory: \"Support\"\n\t},\n\t{\n\t\tid: \"app-stripe\",\n\t\tname: \"Stripe\",\n\t\tdescription: \"React to payments, manage customers, and reconcile billing.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-quickbooks\",\n\t\tname: \"QuickBooks\",\n\t\tdescription: \"Create invoices, sync customers, and reconcile accounting data.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-xero\",\n\t\tname: \"Xero\",\n\t\tdescription: \"Automate invoices, contacts, bills, and accounting workflows.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-shopify\",\n\t\tname: \"Shopify\",\n\t\tdescription: \"Process orders, update products, and coordinate fulfillment.\",\n\t\tcategory: \"Commerce\"\n\t},\n\t{\n\t\tid: \"app-woocommerce\",\n\t\tname: \"WooCommerce\",\n\t\tdescription: \"Sync orders, customers, products, and storefront events.\",\n\t\tcategory: \"Commerce\"\n\t},\n\t{\n\t\tid: \"app-webflow\",\n\t\tname: \"Webflow\",\n\t\tdescription: \"Publish CMS items, update site content, and trigger workflows.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-mailchimp\",\n\t\tname: \"Mailchimp\",\n\t\tdescription: \"Manage audiences, campaigns, tags, and email automations.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-sendgrid\",\n\t\tname: \"SendGrid\",\n\t\tdescription: \"Send transactional email and react to delivery events.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-typeform\",\n\t\tname: \"Typeform\",\n\t\tdescription: \"Capture form responses and enrich follow-up workflows.\",\n\t\tcategory: \"Forms\"\n\t},\n\t{\n\t\tid: \"app-surveymonkey\",\n\t\tname: \"SurveyMonkey\",\n\t\tdescription: \"Collect survey responses and sync insights into workflows.\",\n\t\tcategory: \"Forms\"\n\t},\n\t{\n\t\tid: \"app-calendly\",\n\t\tname: \"Calendly\",\n\t\tdescription: \"React to bookings, cancellations, and scheduling updates.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-docusign\",\n\t\tname: \"DocuSign\",\n\t\tdescription: \"Send envelopes, track signatures, and file completed agreements.\",\n\t\tcategory: \"Documents\"\n\t},\n\t{\n\t\tid: \"app-dropbox\",\n\t\tname: \"Dropbox\",\n\t\tdescription: \"Read files, upload assets, and organize shared folders.\",\n\t\tcategory: \"Files\"\n\t},\n\t{\n\t\tid: \"app-box\",\n\t\tname: \"Box\",\n\t\tdescription: \"Search enterprise files, update folders, and manage documents.\",\n\t\tcategory: \"Files\"\n\t},\n\t{\n\t\tid: \"app-figma\",\n\t\tname: \"Figma\",\n\t\tdescription: \"Inspect designs, sync comments, and coordinate design handoffs.\",\n\t\tcategory: \"Design\"\n\t},\n\t{\n\t\tid: \"app-canva\",\n\t\tname: \"Canva\",\n\t\tdescription: \"Create design assets and automate content production.\",\n\t\tcategory: \"Design\"\n\t},\n\t{\n\t\tid: \"app-sentry\",\n\t\tname: \"Sentry\",\n\t\tdescription: \"Triage errors, summarize issues, and route incidents.\",\n\t\tcategory: \"Observability\"\n\t},\n\t{\n\t\tid: \"app-datadog\",\n\t\tname: \"Datadog\",\n\t\tdescription: \"Query metrics, inspect monitors, and coordinate incidents.\",\n\t\tcategory: \"Observability\"\n\t},\n\t{\n\t\tid: \"app-pagerduty\",\n\t\tname: \"PagerDuty\",\n\t\tdescription: \"Create incidents, page responders, and automate escalations.\",\n\t\tcategory: \"Observability\"\n\t},\n\t{\n\t\tid: \"app-gitlab\",\n\t\tname: \"GitLab\",\n\t\tdescription: \"Manage merge requests, issues, pipelines, and repositories.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-bitbucket\",\n\t\tname: \"Bitbucket\",\n\t\tdescription: \"Automate pull requests, branches, and repository workflows.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-vercel\",\n\t\tname: \"Vercel\",\n\t\tdescription: \"Track deployments, manage projects, and react to build events.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-netlify\",\n\t\tname: \"Netlify\",\n\t\tdescription: \"Automate deploys, forms, sites, and build notifications.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-supabase\",\n\t\tname: \"Supabase\",\n\t\tdescription: \"Query databases, manage auth, and automate backend workflows.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-postgres\",\n\t\tname: \"Postgres\",\n\t\tdescription: \"Run SQL queries and sync structured data from Postgres.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-snowflake\",\n\t\tname: \"Snowflake\",\n\t\tdescription: \"Query warehouse data and automate analytics workflows.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-databricks\",\n\t\tname: \"Databricks\",\n\t\tdescription: \"Run jobs, query lakehouse data, and coordinate pipelines.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-segment\",\n\t\tname: \"Segment\",\n\t\tdescription: \"Route customer events and enrich downstream automations.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-twilio\",\n\t\tname: \"Twilio\",\n\t\tdescription: \"Send SMS, manage calls, and coordinate customer notifications.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-zoom\",\n\t\tname: \"Zoom\",\n\t\tdescription: \"Schedule meetings, manage recordings, and notify attendees.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-loom\",\n\t\tname: \"Loom\",\n\t\tdescription: \"Create video handoffs, summarize recordings, and share updates.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-miro\",\n\t\tname: \"Miro\",\n\t\tdescription: \"Create boards, sync cards, and coordinate visual planning.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-coda\",\n\t\tname: \"Coda\",\n\t\tdescription: \"Update docs, tables, packs, and team operating workflows.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-confluence\",\n\t\tname: \"Confluence\",\n\t\tdescription: \"Search knowledge bases and create or update documentation.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-aws\",\n\t\tname: \"AWS\",\n\t\tdescription: \"Coordinate cloud resources, events, queues, and infrastructure.\",\n\t\tcategory: \"Infrastructure\"\n\t},\n\t{\n\t\tid: \"app-google-cloud\",\n\t\tname: \"Google Cloud\",\n\t\tdescription: \"Manage cloud jobs, storage, Pub/Sub, and deployment workflows.\",\n\t\tcategory: \"Infrastructure\"\n\t},\n\t{\n\t\tid: \"app-azure\",\n\t\tname: \"Azure\",\n\t\tdescription: \"Automate Azure resources, queues, deployments, and identities.\",\n\t\tcategory: \"Infrastructure\"\n\t},\n\t{\n\t\tid: \"app-cloudflare\",\n\t\tname: \"Cloudflare\",\n\t\tdescription: \"Manage DNS, Workers, Pages, queues, and edge automations.\",\n\t\tcategory: \"Infrastructure\"\n\t},\n\t{\n\t\tid: \"app-docker\",\n\t\tname: \"Docker\",\n\t\tdescription: \"Coordinate images, registries, builds, and deployment events.\",\n\t\tcategory: \"Infrastructure\"\n\t},\n\t{\n\t\tid: \"app-kubernetes\",\n\t\tname: \"Kubernetes\",\n\t\tdescription: \"Inspect clusters, trigger jobs, and automate operations.\",\n\t\tcategory: \"Infrastructure\"\n\t},\n\t{\n\t\tid: \"app-algolia\",\n\t\tname: \"Algolia\",\n\t\tdescription: \"Sync search indexes and automate content discovery workflows.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-elasticsearch\",\n\t\tname: \"Elasticsearch\",\n\t\tdescription: \"Query search clusters and automate log or document workflows.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-redis\",\n\t\tname: \"Redis\",\n\t\tdescription: \"Read cache data, coordinate queues, and manage realtime state.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-pinecone\",\n\t\tname: \"Pinecone\",\n\t\tdescription: \"Manage vector indexes and power retrieval workflows.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-plaid\",\n\t\tname: \"Plaid\",\n\t\tdescription: \"Connect financial accounts and automate banking data flows.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-brex\",\n\t\tname: \"Brex\",\n\t\tdescription: \"Sync expenses, cards, reimbursements, and finance approvals.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-mercury\",\n\t\tname: \"Mercury\",\n\t\tdescription: \"Automate banking workflows, transactions, and treasury tasks.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-elevenlabs\",\n\t\tname: \"ElevenLabs\",\n\t\tdescription: \"Generate speech, transcribe audio, and automate voice agents.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-perplexity\",\n\t\tname: \"Perplexity\",\n\t\tdescription: \"Search the web with citations and grounded AI answers.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-gemini\",\n\t\tname: \"Gemini\",\n\t\tdescription: \"Use Google AI models for generation, analysis, and reasoning.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-polymarket\",\n\t\tname: \"Polymarket\",\n\t\tdescription: \"Read market data and automate prediction-market workflows.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-blacksmith\",\n\t\tname: \"Blacksmith\",\n\t\tdescription: \"Automate CI builds, runners, and developer infrastructure.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-deel\",\n\t\tname: \"Deel\",\n\t\tdescription: \"Sync employee, contractor, payroll, and HR workflows.\",\n\t\tcategory: \"HR\"\n\t},\n\t{\n\t\tid: \"app-doordash\",\n\t\tname: \"DoorDash\",\n\t\tdescription: \"Coordinate delivery, merchant, and logistics workflows.\",\n\t\tcategory: \"Commerce\"\n\t},\n\t{\n\t\tid: \"app-dub\",\n\t\tname: \"Dub\",\n\t\tdescription: \"Manage short links, attribution, and campaign routing.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-exa\",\n\t\tname: \"Exa\",\n\t\tdescription: \"Search the web and retrieve AI-ready research results.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-firecrawl\",\n\t\tname: \"Firecrawl\",\n\t\tdescription: \"Crawl sites, extract structured data, and power research agents.\",\n\t\tcategory: \"Search\"\n\t},\n\t{\n\t\tid: \"app-granola\",\n\t\tname: \"Granola\",\n\t\tdescription: \"Sync meeting notes, summaries, and follow-up workflows.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-gusto\",\n\t\tname: \"Gusto\",\n\t\tdescription: \"Automate payroll, benefits, and HR operations.\",\n\t\tcategory: \"HR\"\n\t},\n\t{\n\t\tid: \"app-hex\",\n\t\tname: \"Hex\",\n\t\tdescription: \"Run analytics workflows, notebooks, and data apps.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-instacart\",\n\t\tname: \"Instacart\",\n\t\tdescription: \"Coordinate grocery commerce, orders, and fulfillment workflows.\",\n\t\tcategory: \"Commerce\"\n\t},\n\t{\n\t\tid: \"app-kalshi\",\n\t\tname: \"Kalshi\",\n\t\tdescription: \"Read event markets and automate prediction-market workflows.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-omni\",\n\t\tname: \"Omni\",\n\t\tdescription: \"Query business intelligence models and automate analytics workflows.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-parallel\",\n\t\tname: \"Parallel\",\n\t\tdescription: \"Run AI research, enrichment, and web task workflows.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-planetscale\",\n\t\tname: \"PlanetScale\",\n\t\tdescription: \"Manage MySQL databases, branches, and deploy requests.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-porter\",\n\t\tname: \"Porter\",\n\t\tdescription: \"Coordinate cloud deployments and application infrastructure.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-puzzle\",\n\t\tname: \"Puzzle\",\n\t\tdescription: \"Automate accounting workflows, books, and finance operations.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-pylon\",\n\t\tname: \"Pylon\",\n\t\tdescription: \"Manage B2B support conversations and customer workflows.\",\n\t\tcategory: \"Support\"\n\t},\n\t{\n\t\tid: \"app-ramp\",\n\t\tname: \"Ramp\",\n\t\tdescription: \"Sync spend, expenses, approvals, and finance workflows.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-reducto\",\n\t\tname: \"Reducto\",\n\t\tdescription: \"Extract structured data from complex documents.\",\n\t\tcategory: \"Documents\"\n\t},\n\t{\n\t\tid: \"app-resend\",\n\t\tname: \"Resend\",\n\t\tdescription: \"Send product email and react to delivery events.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-rippling\",\n\t\tname: \"Rippling\",\n\t\tdescription: \"Automate employee, device, payroll, and HR workflows.\",\n\t\tcategory: \"HR\"\n\t},\n\t{\n\t\tid: \"app-streak\",\n\t\tname: \"Streak\",\n\t\tdescription: \"Manage Gmail-native CRM pipelines and contact workflows.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-warp\",\n\t\tname: \"Warp\",\n\t\tdescription: \"Coordinate terminal, developer environment, and AI coding workflows.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-apollo\",\n\t\tname: \"Apollo\",\n\t\tdescription: \"Sync sales intelligence, prospecting, and enrichment workflows.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-cal-com\",\n\t\tname: \"Cal.com\",\n\t\tdescription: \"Automate scheduling, bookings, availability, and routing workflows.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-cerebras\",\n\t\tname: \"Cerebras\",\n\t\tdescription: \"Use fast AI inference for model-powered workflow steps.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-chargebee\",\n\t\tname: \"Chargebee\",\n\t\tdescription: \"Automate subscription billing, customers, invoices, and revenue workflows.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-deepseek\",\n\t\tname: \"DeepSeek\",\n\t\tdescription: \"Use DeepSeek models for generation, reasoning, and analysis.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-gong\",\n\t\tname: \"Gong\",\n\t\tdescription: \"Sync revenue conversations, account insights, and sales follow-up workflows.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-google-contacts\",\n\t\tname: \"Google Contacts\",\n\t\tdescription: \"Read and update contact records across Google Workspace.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-google-docs\",\n\t\tname: \"Google Docs\",\n\t\tdescription: \"Create, read, and update collaborative documents.\",\n\t\tcategory: \"Documents\"\n\t},\n\t{\n\t\tid: \"app-google-forms\",\n\t\tname: \"Google Forms\",\n\t\tdescription: \"Capture form responses and turn submissions into automated work.\",\n\t\tcategory: \"Forms\"\n\t},\n\t{\n\t\tid: \"app-google-meet\",\n\t\tname: \"Google Meet\",\n\t\tdescription: \"Coordinate meetings, recordings, and video collaboration workflows.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-google-slides\",\n\t\tname: \"Google Slides\",\n\t\tdescription: \"Create and update presentations from workflow outputs.\",\n\t\tcategory: \"Documents\"\n\t},\n\t{\n\t\tid: \"app-google-tasks\",\n\t\tname: \"Google Tasks\",\n\t\tdescription: \"Create tasks, update lists, and coordinate personal work queues.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-greenhouse\",\n\t\tname: \"Greenhouse\",\n\t\tdescription: \"Automate candidate, job, and interview coordination workflows.\",\n\t\tcategory: \"HR\"\n\t},\n\t{\n\t\tid: \"app-groq\",\n\t\tname: \"Groq\",\n\t\tdescription: \"Use low-latency AI inference in agents and workflows.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-help-scout\",\n\t\tname: \"Help Scout\",\n\t\tdescription: \"Manage customer conversations, mailboxes, and support workflows.\",\n\t\tcategory: \"Support\"\n\t},\n\t{\n\t\tid: \"app-linkedin\",\n\t\tname: \"LinkedIn\",\n\t\tdescription: \"Coordinate professional network, recruiting, and social workflows.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-microsoft-excel\",\n\t\tname: \"Microsoft Excel\",\n\t\tdescription: \"Read, update, and append rows in Excel workbooks.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-microsoft-onedrive\",\n\t\tname: \"Microsoft OneDrive\",\n\t\tdescription: \"Find, read, upload, and organize files in OneDrive.\",\n\t\tcategory: \"Files\"\n\t},\n\t{\n\t\tid: \"app-microsoft-outlook\",\n\t\tname: \"Microsoft Outlook\",\n\t\tdescription: \"Send email, read messages, and coordinate calendar workflows.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-microsoft-planner\",\n\t\tname: \"Microsoft Planner\",\n\t\tdescription: \"Create tasks, update plans, and coordinate project work.\",\n\t\tcategory: \"Project Management\"\n\t},\n\t{\n\t\tid: \"app-microsoft-sharepoint\",\n\t\tname: \"Microsoft SharePoint\",\n\t\tdescription: \"Search sites, update lists, and manage shared documents.\",\n\t\tcategory: \"Documents\"\n\t},\n\t{\n\t\tid: \"app-mistral\",\n\t\tname: \"Mistral\",\n\t\tdescription: \"Use Mistral models for generation, analysis, and AI workflow steps.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-posthog\",\n\t\tname: \"PostHog\",\n\t\tdescription: \"Query product analytics, feature flags, and user behavior signals.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-reddit\",\n\t\tname: \"Reddit\",\n\t\tdescription: \"Monitor communities, posts, and discussion-driven workflows.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-square\",\n\t\tname: \"Square\",\n\t\tdescription: \"Automate payments, customers, catalog, and point-of-sale workflows.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-todoist\",\n\t\tname: \"Todoist\",\n\t\tdescription: \"Create tasks, update projects, and automate personal work queues.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-wordpress\",\n\t\tname: \"WordPress\",\n\t\tdescription: \"Publish posts, update pages, and automate site content workflows.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-x-twitter\",\n\t\tname: \"X / Twitter\",\n\t\tdescription: \"Monitor posts, publish updates, and coordinate social workflows.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-xai\",\n\t\tname: \"xAI\",\n\t\tdescription: \"Use xAI models for generation, analysis, and reasoning steps.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-youtube\",\n\t\tname: \"YouTube\",\n\t\tdescription: \"Manage videos, channels, comments, and creator workflows.\",\n\t\tcategory: \"Marketing\"\n\t}\n];\nconst APP_INTEGRATION_DESCRIPTIONS = {\n\t\"app-gmail\": \"Connect Gmail so agents can read, draft, send, and organize email as part of a workflow. Use it for customer follow-ups, approval threads, inbound request triage, or any automation where the next step happens in an inbox.\",\n\t\"app-slack\": \"Connect Slack so agents can post updates, request approvals, and keep work moving from channel conversations. Use it for deployment approvals, triage alerts, support handoffs, or workflows that need a human decision in chat.\",\n\t\"app-github\": \"Connect GitHub so agents can react to issues, pull requests, commits, and repository events. Use it to automate review follow-ups, update project state, open PRs, or summarize engineering activity without leaving Keystroke.\",\n\t\"app-anthropic\": \"Connect Anthropic to give workflows and agents access to Claude for reasoning, writing, analysis, and structured generation. Use it when an automation needs judgment, summarization, code understanding, or a safer model step.\",\n\t\"app-attio\": \"Connect Attio so agents can look up customer context, update CRM records, and keep deal activity current. Use it to enrich leads, prepare account briefs, or write notes back to the relationship record after work happens elsewhere.\",\n\t\"app-openai\": \"Connect OpenAI to use GPT models, embeddings, and multimodal generation inside agents and workflows. Use it for classification, drafting, extraction, retrieval, and AI steps that need fast general-purpose model coverage.\",\n\t\"app-airtable\": \"Connect Airtable so workflows can read, create, and update records in the bases your team already uses. Use it for lightweight operations dashboards, intake queues, content calendars, or any structured data that lives outside the product database.\",\n\t\"app-google-sheets\": \"Connect Google Sheets so agents can inspect spreadsheets, append rows, and keep tabular data up to date. Use it for operational reports, lead lists, reconciliation sheets, or simple automations that still run through a spreadsheet.\",\n\t\"app-google-drive\": \"Connect Google Drive so agents can find, read, create, and organize files across shared folders. Use it when workflows need source documents, generated exports, meeting artifacts, or project files stored in Drive.\",\n\t\"app-google-calendar\": \"Connect Google Calendar so agents can check availability, create events, and coordinate schedule changes. Use it for booking follow-ups, launch calendars, interview loops, or workflows that need to reserve time with the right people.\",\n\t\"app-notion\": \"Connect Notion so agents can search workspace knowledge, update databases, and create pages from completed work. Use it to turn conversations into docs, keep project trackers current, or pull context from team operating notes.\",\n\t\"app-linear\": \"Connect Linear so agents can create issues, update triage queues, and comment on engineering work. Use it to turn chat decisions into tickets, keep statuses current, or route follow-up tasks to the right project.\",\n\t\"app-jira\": \"Connect Jira so agents can sync issues, transitions, comments, and project fields with the rest of your automation. Use it for sprint hygiene, release coordination, support escalations, or workflows that need to move work through Jira states.\",\n\t\"app-asana\": \"Connect Asana so workflows can create tasks, update projects, and keep team work visible. Use it for campaign checklists, launch plans, cross-functional handoffs, or automations that turn decisions into assigned tasks.\",\n\t\"app-trello\": \"Connect Trello so agents can move cards, update boards, and manage checklist work. Use it for lightweight pipelines, editorial boards, personal task flows, or team processes that are organized around cards.\",\n\t\"app-clickup\": \"Connect ClickUp so agents can manage tasks, docs, custom fields, and workspace automations. Use it to update complex workspaces, coordinate owners, or keep custom project metadata in sync with the rest of your tools.\",\n\t\"app-monday\": \"Connect monday.com so agents can update boards, create items, and automate team workflow changes. Use it for operations trackers, handoff boards, campaign production, or any process your team runs through monday.com.\",\n\t\"app-discord\": \"Connect Discord so agents can post updates, listen for commands, and respond inside communities or private servers. Use it for developer communities, customer groups, incident rooms, or lightweight command-driven workflows.\",\n\t\"app-microsoft-teams\": \"Connect Microsoft Teams so agents can send messages, coordinate approvals, and keep work moving in team channels. Use it for enterprise handoffs, meeting follow-ups, internal notifications, or workflows that need to meet users where they collaborate.\",\n\t\"app-google-chat\": \"Connect Google Chat so agents can send updates and surface workflow responses in spaces or direct messages. Use it for Workspace-native notifications, team approvals, status pings, or lightweight chat commands.\",\n\t\"app-telegram\": \"Connect Telegram so agents can send bot messages and respond to chats or groups. Use it for community operations, alerts, personal workflows, or automations that need fast mobile-friendly messaging.\",\n\t\"app-whatsapp\": \"Connect WhatsApp so agents can send customer messages and respond to conversation threads. Use it for support follow-ups, appointment reminders, sales handoffs, or any workflow where customers already expect WhatsApp updates.\",\n\t\"app-hubspot\": \"Connect HubSpot so agents can manage contacts, companies, deals, tickets, and timelines. Use it to enrich CRM records, log customer activity, trigger sales follow-ups, or keep marketing and success workflows aligned.\",\n\t\"app-salesforce\": \"Connect Salesforce so workflows can read and update leads, accounts, opportunities, and cases. Use it for account research, sales operations, support escalation, or automations that need Salesforce to remain the source of truth.\",\n\t\"app-pipedrive\": \"Connect Pipedrive so agents can move deals, update contacts, and automate sales pipeline work. Use it for lead routing, next-step reminders, pipeline cleanup, or follow-ups triggered by activity in other systems.\",\n\t\"app-intercom\": \"Connect Intercom so agents can route conversations, update users, and summarize support context. Use it to triage inbound messages, draft replies, escalate issues, or connect customer conversations to product and engineering workflows.\",\n\t\"app-zendesk\": \"Connect Zendesk so agents can create tickets, reply to customers, and keep support context in sync. Use it for ticket triage, SLA follow-ups, escalation summaries, or workflows that turn support signals into action.\",\n\t\"app-freshdesk\": \"Connect Freshdesk so workflows can route tickets, draft replies, and update customer records. Use it to automate support queues, enrich tickets with external context, or make sure resolution steps are captured consistently.\",\n\t\"app-front\": \"Connect Front so agents can work with shared inboxes, internal comments, tags, and customer replies. Use it for support or success teams that coordinate from email but need automation to keep the thread moving.\",\n\t\"app-stripe\": \"Connect Stripe so agents can react to payments, manage customers, and reconcile billing events. Use it for revenue alerts, failed payment follow-ups, invoice workflows, or customer lifecycle automation tied to billing state.\",\n\t\"app-quickbooks\": \"Connect QuickBooks so workflows can create invoices, sync customers, and reconcile accounting data. Use it for finance handoffs, bookkeeping follow-ups, payment checks, or automations that keep operational data aligned with accounting.\",\n\t\"app-xero\": \"Connect Xero so agents can automate invoices, contacts, bills, and accounting workflows. Use it for finance reviews, customer billing updates, payable tracking, or recurring accounting tasks that should not require manual entry.\",\n\t\"app-shopify\": \"Connect Shopify so agents can process orders, update products, and coordinate fulfillment work. Use it for ecommerce support, inventory checks, fulfillment exceptions, or automations triggered by store events.\",\n\t\"app-woocommerce\": \"Connect WooCommerce so workflows can sync orders, customers, products, and storefront events. Use it for store operations, fulfillment coordination, customer follow-ups, or reporting across commerce and support tools.\",\n\t\"app-webflow\": \"Connect Webflow so agents can publish CMS items, update site content, and react to site events. Use it for marketing pages, content operations, launch checklists, or workflows that turn approved content into live updates.\",\n\t\"app-mailchimp\": \"Connect Mailchimp so agents can manage audiences, campaigns, tags, and email automations. Use it for lifecycle marketing, list hygiene, campaign follow-ups, or workflows that connect product events to audience segments.\",\n\t\"app-sendgrid\": \"Connect SendGrid so workflows can send transactional email and react to delivery events. Use it for notifications, receipts, onboarding messages, or automations that need reliable email delivery and bounce handling.\",\n\t\"app-typeform\": \"Connect Typeform so agents can capture submissions and turn responses into follow-up work. Use it for intake forms, lead qualification, research surveys, or workflows that start when someone submits structured answers.\",\n\t\"app-surveymonkey\": \"Connect SurveyMonkey so agents can collect responses and move survey insights into the right workflow. Use it for customer research, feedback analysis, NPS follow-up, or reporting loops that begin with survey data.\",\n\t\"app-calendly\": \"Connect Calendly so agents can react to bookings, cancellations, and scheduling updates. Use it for sales handoffs, interview coordination, onboarding calls, or workflows that need to prepare before or follow up after a meeting.\",\n\t\"app-docusign\": \"Connect DocuSign so workflows can send envelopes, track signatures, and file completed agreements. Use it for contracts, approvals, onboarding packets, or any process where a signed document should trigger the next step.\",\n\t\"app-dropbox\": \"Connect Dropbox so agents can read files, upload assets, and organize shared folders. Use it for document intake, generated exports, client deliverables, or workflows that need to move files between teams and systems.\",\n\t\"app-box\": \"Connect Box so agents can search enterprise files, update folders, and manage documents securely. Use it for governed document workflows, legal handoffs, knowledge retrieval, or file operations that need enterprise storage controls.\",\n\t\"app-figma\": \"Connect Figma so agents can inspect designs, sync comments, and coordinate design handoffs. Use it to pull design context into implementation work, track feedback, or turn approved mockups into downstream tasks.\",\n\t\"app-canva\": \"Connect Canva so agents can help create design assets and automate content production. Use it for campaign graphics, social templates, brand asset updates, or workflows where creative requests need repeatable output.\",\n\t\"app-sentry\": \"Connect Sentry so agents can triage errors, summarize issues, and route incidents from production signals. Use it to turn crash reports into engineering tasks, prepare context for responders, or close the loop after a fix.\",\n\t\"app-datadog\": \"Connect Datadog so workflows can query metrics, inspect monitors, and coordinate incidents. Use it for alert triage, deployment checks, operational summaries, or automations that need observability context before taking action.\",\n\t\"app-pagerduty\": \"Connect PagerDuty so agents can create incidents, page responders, and automate escalation steps. Use it for on-call workflows, incident updates, postmortem prep, or routing urgent operational work to the right person.\",\n\t\"app-gitlab\": \"Connect GitLab so agents can manage merge requests, issues, pipelines, and repositories. Use it for CI follow-ups, release coordination, code review automation, or engineering workflows centered on GitLab projects.\",\n\t\"app-bitbucket\": \"Connect Bitbucket so workflows can automate pull requests, branches, and repository activity. Use it for review routing, branch hygiene, deployment handoffs, or teams whose source control lives in Atlassian.\",\n\t\"app-vercel\": \"Connect Vercel so agents can track deployments, inspect projects, and react to build events. Use it for preview checks, release notifications, failed build triage, or workflows that connect product changes to deployment state.\",\n\t\"app-netlify\": \"Connect Netlify so agents can automate deploys, forms, sites, and build notifications. Use it for static site releases, form-driven workflows, build triage, or marketing site operations tied to deployment events.\",\n\t\"app-supabase\": \"Connect Supabase so agents can query databases, manage auth context, and automate backend workflows. Use it for operational data checks, admin tasks, user support lookups, or workflows that depend on app data stored in Supabase.\",\n\t\"app-postgres\": \"Connect Postgres so workflows can run SQL queries and sync structured data from your database. Use it for reports, back-office operations, data enrichment, or automations that need direct access to relational data.\",\n\t\"app-snowflake\": \"Connect Snowflake so agents can query warehouse data and automate analytics workflows. Use it for reporting, customer segmentation, anomaly checks, or workflows that need trusted business data before acting.\",\n\t\"app-databricks\": \"Connect Databricks so workflows can run jobs, query lakehouse data, and coordinate data pipelines. Use it for analytics operations, model-adjacent workflows, data quality checks, or pipeline handoffs between teams.\",\n\t\"app-segment\": \"Connect Segment so agents can route customer events and enrich downstream automations. Use it for lifecycle triggers, audience syncs, event QA, or workflows that begin when product behavior changes.\",\n\t\"app-twilio\": \"Connect Twilio so agents can send SMS, manage calls, and coordinate customer notifications. Use it for reminders, verification flows, support callbacks, or automations that need to reach people outside email and chat.\",\n\t\"app-zoom\": \"Connect Zoom so agents can schedule meetings, manage recordings, and notify attendees. Use it for meeting prep, transcript follow-ups, customer call workflows, or automations that turn live conversations into next steps.\",\n\t\"app-loom\": \"Connect Loom so agents can create video handoffs, summarize recordings, and share updates. Use it for async status reports, customer walkthroughs, product feedback, or workflows where a short video carries the context.\",\n\t\"app-miro\": \"Connect Miro so agents can create boards, sync cards, and coordinate visual planning. Use it for workshops, roadmap sessions, research synthesis, or workflows that move structured work into a shared canvas.\",\n\t\"app-coda\": \"Connect Coda so workflows can update docs, tables, packs, and team operating systems. Use it for custom trackers, lightweight apps, planning docs, or automations that need to keep Coda tables current.\",\n\t\"app-confluence\": \"Connect Confluence so agents can search knowledge bases and create or update documentation. Use it for runbooks, implementation notes, release docs, or workflows that should leave behind durable team knowledge.\",\n\t\"app-aws\": \"Connect AWS so agents can coordinate cloud resources, events, queues, and infrastructure tasks. Use it for operational checks, deployment handoffs, queue monitoring, or workflows that need cloud state before acting.\",\n\t\"app-google-cloud\": \"Connect Google Cloud so workflows can manage cloud jobs, storage, Pub/Sub, and deployment work. Use it for infrastructure automation, data pipeline coordination, operational checks, or alerts tied to Google Cloud services.\",\n\t\"app-azure\": \"Connect Azure so agents can automate resources, queues, deployments, and identity-related tasks. Use it for enterprise cloud operations, release workflows, infrastructure checks, or automations in Microsoft-backed environments.\",\n\t\"app-cloudflare\": \"Connect Cloudflare so agents can manage DNS, Workers, Pages, queues, and edge automations. Use it for site operations, edge deployments, incident response, or workflows that need to change traffic and infrastructure at the edge.\",\n\t\"app-docker\": \"Connect Docker so agents can coordinate images, registries, builds, and deployment events. Use it for release preparation, image promotion, environment checks, or workflows that need container metadata.\",\n\t\"app-kubernetes\": \"Connect Kubernetes so agents can inspect clusters, trigger jobs, and automate operational tasks. Use it for rollout checks, incident triage, job coordination, or workflows that need live cluster context.\",\n\t\"app-algolia\": \"Connect Algolia so workflows can sync search indexes and automate content discovery tasks. Use it for search freshness, indexing checks, merchandising updates, or workflows that need searchable content to stay current.\",\n\t\"app-elasticsearch\": \"Connect Elasticsearch so agents can query search clusters and automate log or document workflows. Use it for operational investigations, search-backed features, document indexing, or workflows that depend on fast text retrieval.\",\n\t\"app-redis\": \"Connect Redis so workflows can read cache data, coordinate queues, and manage realtime state. Use it for operational checks, queue insight, temporary state lookups, or automations that need fast key-value context.\",\n\t\"app-pinecone\": \"Connect Pinecone so agents can manage vector indexes and power retrieval workflows. Use it for semantic search, memory, recommendation, or knowledge retrieval steps that need embeddings-backed context.\",\n\t\"app-plaid\": \"Connect Plaid so agents can work with financial account data and banking flows. Use it for transaction enrichment, onboarding checks, financial reporting, or workflows that depend on verified account activity.\",\n\t\"app-brex\": \"Connect Brex so workflows can sync expenses, cards, reimbursements, and finance approvals. Use it for spend review, receipt follow-up, budget alerts, or automations that connect finance operations to team workflows.\",\n\t\"app-mercury\": \"Connect Mercury so agents can automate banking workflows, transactions, and treasury tasks. Use it for finance operations, cash movement checks, approval routing, or workflows triggered by account activity.\",\n\t\"app-elevenlabs\": \"Connect ElevenLabs so agents can generate speech, transcribe audio, and build voice-enabled workflows. Use it for narrated updates, voice agents, call summaries, or automations that need natural-sounding audio output.\",\n\t\"app-perplexity\": \"Connect Perplexity so agents can search the web with citations and grounded answers. Use it for research, competitive monitoring, fact gathering, or workflows that need fresh external context before making a recommendation.\",\n\t\"app-gemini\": \"Connect Gemini so agents can use Google AI models for generation, analysis, and reasoning. Use it for multimodal understanding, document analysis, content generation, or workflows that benefit from Google model coverage.\",\n\t\"app-polymarket\": \"Connect Polymarket so agents can read market data and automate prediction-market workflows. Use it for market monitoring, research context, probability tracking, or automations that react to changing public forecasts.\",\n\t\"app-blacksmith\": \"Connect Blacksmith so agents can inspect CI runs, coordinate build infrastructure, and react to developer workflow events. Use it for failed build triage, runner capacity checks, deployment gates, or automations that keep engineering pipelines moving.\",\n\t\"app-deel\": \"Connect Deel so agents can work with contractor, employee, payroll, and compliance workflows. Use it to prepare onboarding tasks, follow up on HR operations, reconcile workforce data, or route people ops requests to the right system.\",\n\t\"app-doordash\": \"Connect DoorDash so agents can coordinate delivery, merchant, and logistics workflows. Use it for order exception handling, fulfillment updates, operational alerts, or automations where real-world delivery status needs to trigger follow-up work.\",\n\t\"app-dub\": \"Connect Dub so agents can manage short links, attribution, and campaign routing. Use it to create tracked links, monitor conversion signals, clean up campaign metadata, or connect marketing activity to downstream reporting.\",\n\t\"app-exa\": \"Connect Exa so agents can search the web and retrieve AI-ready research results. Use it for market scans, company enrichment, competitive research, or workflows that need fresh external context before drafting or deciding.\",\n\t\"app-firecrawl\": \"Connect Firecrawl so agents can crawl sites, extract structured data, and turn webpages into workflow-ready inputs. Use it for lead enrichment, documentation ingestion, content monitoring, or research tasks that start from public web pages.\",\n\t\"app-granola\": \"Connect Granola so agents can use meeting notes, summaries, and follow-up context in your workflows. Use it to turn calls into tasks, update account records, prepare recap messages, or make meeting outcomes available to other automations.\",\n\t\"app-gusto\": \"Connect Gusto so agents can coordinate payroll, benefits, and HR operations. Use it for onboarding checklists, payroll review reminders, people ops follow-ups, or workflows that need employee and compensation context.\",\n\t\"app-hex\": \"Connect Hex so agents can run analytics workflows, query notebooks, and coordinate data app outputs. Use it for metric investigations, recurring analysis, stakeholder reports, or automations that need trusted analytical context.\",\n\t\"app-instacart\": \"Connect Instacart so agents can coordinate grocery commerce, orders, and fulfillment workflows. Use it for delivery exceptions, merchant operations, catalog checks, or automations that depend on order and shopper activity.\",\n\t\"app-kalshi\": \"Connect Kalshi so agents can read event markets and automate prediction-market workflows. Use it for market monitoring, probability snapshots, research briefs, or automations that react to changing expectations around real-world events.\",\n\t\"app-omni\": \"Connect Omni so agents can query business intelligence models and automate analytics workflows. Use it to answer operational questions, refresh stakeholder summaries, investigate metric movement, or bring governed BI context into agent work.\",\n\t\"app-parallel\": \"Connect Parallel so agents can run AI research, enrichment, and web task workflows. Use it for background research, lead enrichment, competitive monitoring, or automations that delegate broad information-gathering tasks.\",\n\t\"app-planetscale\": \"Connect PlanetScale so agents can manage database branches, deploy requests, and MySQL-backed workflows. Use it for schema review reminders, release coordination, operational data checks, or automations tied to database changes.\",\n\t\"app-porter\": \"Connect Porter so agents can coordinate cloud deployments and application infrastructure. Use it for rollout checks, failed deploy triage, environment updates, or workflows that keep application operations moving.\",\n\t\"app-puzzle\": \"Connect Puzzle so agents can automate accounting workflows, books, and finance operations. Use it for close checklists, transaction review, finance handoffs, or workflows that keep bookkeeping context current.\",\n\t\"app-pylon\": \"Connect Pylon so agents can manage B2B support conversations and customer workflows. Use it to triage customer issues, summarize account context, route engineering follow-ups, or keep support signals connected to product work.\",\n\t\"app-ramp\": \"Connect Ramp so agents can sync spend, expenses, approvals, and finance workflows. Use it for receipt follow-ups, budget alerts, approval routing, or automations that connect company spend to operational context.\",\n\t\"app-reducto\": \"Connect Reducto so agents can extract structured data from complex documents. Use it for document intake, contract review prep, invoice parsing, or workflows where PDFs and files need to become reliable structured inputs.\",\n\t\"app-resend\": \"Connect Resend so agents can send product email and react to delivery events. Use it for onboarding messages, transactional notifications, bounce handling, or workflows that need reliable email delivery from product systems.\",\n\t\"app-rippling\": \"Connect Rippling so agents can coordinate employee, device, payroll, and HR workflows from one place. Use it for onboarding and offboarding checklists, access changes, equipment follow-ups, or automations that need workforce context before acting.\",\n\t\"app-streak\": \"Connect Streak so agents can manage Gmail-native CRM pipelines and contact workflows. Use it for deal follow-ups, inbox-driven sales activity, contact updates, or workflows where relationship context lives directly inside Gmail.\",\n\t\"app-warp\": \"Connect Warp so agents can coordinate terminal, developer environment, and AI coding workflows. Use it for developer setup tasks, command-driven runbooks, environment checks, or workflows that bridge local engineering activity with team operations.\",\n\t\"app-apollo\": \"Connect Apollo so agents can use sales intelligence, prospecting data, and enrichment workflows. Use it to qualify leads, enrich accounts, prepare outbound context, or route sales follow-ups based on fresh prospect data.\",\n\t\"app-cal-com\": \"Connect Cal.com so agents can automate scheduling, bookings, availability, and routing workflows. Use it for handoff scheduling, round-robin booking, interview coordination, or follow-ups that should happen before or after a meeting.\",\n\t\"app-cerebras\": \"Connect Cerebras so agents can use fast AI inference inside workflows and tools. Use it for low-latency generation, classification, extraction, or model-powered steps that need quick responses at scale.\",\n\t\"app-chargebee\": \"Connect Chargebee so agents can automate subscription billing, customers, invoices, and revenue workflows. Use it for renewal alerts, billing support, failed payment follow-ups, or automations tied to subscription lifecycle changes.\",\n\t\"app-deepseek\": \"Connect DeepSeek so agents can use DeepSeek models for generation, reasoning, and analysis. Use it for coding assistance, structured extraction, summarization, or AI steps that benefit from an additional model provider.\",\n\t\"app-gong\": \"Connect Gong so agents can use revenue conversations, account insights, and sales activity. Use it to summarize calls, extract next steps, update CRM context, or trigger follow-ups from customer conversations.\",\n\t\"app-google-contacts\": \"Connect Google Contacts so agents can read and update contact records across Google Workspace. Use it to enrich communication workflows, keep people data current, or resolve the right recipient before sending follow-ups.\",\n\t\"app-google-docs\": \"Connect Google Docs so agents can create, read, and update collaborative documents. Use it for drafting briefs, maintaining runbooks, turning conversations into docs, or updating shared plans after workflow activity.\",\n\t\"app-google-forms\": \"Connect Google Forms so agents can capture submissions and turn responses into follow-up work. Use it for intake flows, lightweight surveys, internal requests, or automations that begin when someone submits structured information.\",\n\t\"app-google-meet\": \"Connect Google Meet so agents can coordinate meetings, recordings, and video collaboration workflows. Use it for meeting prep, attendee updates, recording follow-ups, or automations that turn live conversations into next steps.\",\n\t\"app-google-slides\": \"Connect Google Slides so agents can create and update presentations from workflow outputs. Use it for status decks, customer recaps, board updates, or automations that turn approved content and data into slides.\",\n\t\"app-google-tasks\": \"Connect Google Tasks so agents can create tasks, update lists, and coordinate personal work queues. Use it for lightweight reminders, follow-up capture, personal task routing, or workflows that should land in a simple to-do list.\",\n\t\"app-greenhouse\": \"Connect Greenhouse so agents can automate candidate, job, and interview coordination workflows. Use it for recruiting follow-ups, interview loop prep, candidate summaries, or workflows that keep hiring processes current.\",\n\t\"app-groq\": \"Connect Groq so agents can use low-latency AI inference in workflows. Use it for fast classification, summarization, extraction, or interactive agent steps where response speed matters.\",\n\t\"app-help-scout\": \"Connect Help Scout so agents can manage customer conversations, mailboxes, and support workflows. Use it to triage inbound requests, draft replies, summarize customer context, or route support signals into product and engineering work.\",\n\t\"app-linkedin\": \"Connect LinkedIn so agents can coordinate professional network, recruiting, and social workflows. Use it for prospect research, hiring context, relationship prep, or automations that connect professional profiles to your operating data.\",\n\t\"app-microsoft-excel\": \"Connect Microsoft Excel so agents can read, update, and append rows in workbooks. Use it for operational reports, finance trackers, reconciliation sheets, or workflows that need to work with spreadsheets stored in Microsoft 365.\",\n\t\"app-microsoft-onedrive\": \"Connect Microsoft OneDrive so agents can find, read, upload, and organize files. Use it for document intake, generated exports, shared artifacts, or workflows that need source material from Microsoft cloud storage.\",\n\t\"app-microsoft-outlook\": \"Connect Microsoft Outlook so agents can send email, read messages, and coordinate calendar workflows. Use it for customer follow-ups, scheduling handoffs, inbox triage, or automations that need to operate inside Microsoft 365.\",\n\t\"app-microsoft-planner\": \"Connect Microsoft Planner so agents can create tasks, update plans, and coordinate project work. Use it for team checklists, project handoffs, status updates, or workflows that should create visible work items for Microsoft 365 teams.\",\n\t\"app-microsoft-sharepoint\": \"Connect Microsoft SharePoint so agents can search sites, update lists, and manage shared documents. Use it for governed document workflows, internal knowledge retrieval, approval tracking, or automations that depend on SharePoint content.\",\n\t\"app-mistral\": \"Connect Mistral so agents can use Mistral models for generation, analysis, and reasoning. Use it for multilingual tasks, structured extraction, summarization, or AI workflow steps that need another model option.\",\n\t\"app-posthog\": \"Connect PostHog so agents can query product analytics, feature flags, and user behavior signals. Use it for growth investigations, experiment follow-ups, customer debugging, or workflows triggered by product usage patterns.\",\n\t\"app-reddit\": \"Connect Reddit so agents can monitor communities, posts, and discussion-driven workflows. Use it for audience research, brand monitoring, support signal discovery, or automations that react to public community conversations.\",\n\t\"app-square\": \"Connect Square so agents can automate payments, customers, catalog, and point-of-sale workflows. Use it for transaction follow-ups, customer updates, sales reporting, or operational workflows tied to in-person and online commerce.\",\n\t\"app-todoist\": \"Connect Todoist so agents can create tasks, update projects, and automate personal work queues. Use it for lightweight reminders, follow-up capture, recurring checklists, or workflows that should become personal tasks.\",\n\t\"app-wordpress\": \"Connect WordPress so agents can publish posts, update pages, and automate site content workflows. Use it for editorial operations, release notes, content refreshes, or workflows that turn approved drafts into live site updates.\",\n\t\"app-x-twitter\": \"Connect X / Twitter so agents can monitor posts, publish updates, and coordinate social workflows. Use it for launch announcements, brand monitoring, support escalation, or automations that react to public conversation.\",\n\t\"app-xai\": \"Connect xAI so agents can use xAI models for generation, analysis, and reasoning. Use it for drafting, summarization, classification, or AI workflow steps that benefit from another model provider.\",\n\t\"app-youtube\": \"Connect YouTube so agents can manage videos, channels, comments, and creator workflows. Use it for publishing checklists, comment triage, content reporting, or automations that connect video activity to the rest of your workspace.\"\n};\nconst CATEGORY_INTEGRATION_USE_CASES = {\n\tAI: \"add model calls, embeddings, structured generation, and reasoning steps to agents or workflows\",\n\tCommerce: \"keep storefront, order, product, and fulfillment workflows moving without manual handoffs\",\n\tCommunication: \"send updates, listen for replies, route approvals, and keep conversations tied to the work they affect\",\n\tCRM: \"sync customer context, update records, and keep sales or success workflows current\",\n\tData: \"query, enrich, sync, and transform structured data as part of automated workflows\",\n\tDesign: \"pull design context into implementation work and keep creative handoffs coordinated\",\n\tDevelopment: \"react to engineering events, update project metadata, and connect code activity to agent workflows\",\n\tDocuments: \"send, track, organize, and file documents as part of repeatable business processes\",\n\tFiles: \"find, read, upload, and organize files so workflows can work with the right source material\",\n\tFinance: \"reconcile billing, accounting, customer, and transaction data across finance workflows\",\n\tForms: \"capture submissions, enrich responses, and trigger follow-up work from collected data\",\n\tHR: \"coordinate onboarding, payroll, and people operations without leaving the workspace\",\n\tInfrastructure: \"coordinate cloud resources, deployments, queues, and operational tasks from one workspace\",\n\tMarketing: \"manage campaigns, audiences, content, and delivery events from automated growth workflows\",\n\tObservability: \"triage incidents, summarize operational context, and route alerts to the right responders\",\n\tProductivity: \"coordinate calendars, docs, tasks, files, and team knowledge without leaving the workspace\",\n\t\"Project Management\": \"create tasks, update project state, and keep work queues aligned with agent-driven execution\",\n\tSearch: \"retrieve fresh external context, crawl sources, and ground workflows in real-time results\",\n\tSupport: \"triage customer conversations, update tickets, and move support context into the right workflow\"\n};\nfunction buildIntegrationDescription(app) {\n\tconst explicit = APP_INTEGRATION_DESCRIPTIONS[app.id];\n\tif (explicit) return explicit;\n\tconst categoryUseCase = CATEGORY_INTEGRATION_USE_CASES[app.category] ?? \"connect external context, events, and actions to your automated workflows\";\n\treturn `Connect ${app.name} to Keystroke so the workflows and AI agents you build can use it as a live ${app.category.toLowerCase()} system. ${app.description} Once connected, those automations can ${categoryUseCase}.`;\n}\nconst DEFAULT_OAUTH_SCOPE_DESCRIPTIONS = {\n\temail: \"View the email address associated with the connected account.\",\n\tprofile: \"View basic profile information for the connected account.\"\n};\nconst OAUTH_SCOPE_CATALOG_BY_APP_ID = {\n\t\"app-slack\": [\n\t\t{\n\t\t\tname: \"channels:history\",\n\t\t\tdescription: \"View messages and other content in public channels that the Slack Bot has been added to.\"\n\t\t},\n\t\t{\n\t\t\tname: \"channels:read\",\n\t\t\tdescription: \"View basic information about public channels in Slack.\"\n\t\t},\n\t\t{\n\t\t\tname: \"chat:write\",\n\t\t\tdescription: \"Send messages as the Keystroke Slack Bot.\"\n\t\t},\n\t\t{\n\t\t\tname: \"commands\",\n\t\t\tdescription: \"Add shortcuts and slash commands that start Keystroke actions.\"\n\t\t},\n\t\t{\n\t\t\tname: \"users:read\",\n\t\t\tdescription: \"View people in the Slack workspace.\"\n\t\t},\n\t\t{\n\t\t\tname: \"groups:read\",\n\t\t\tdescription: \"View basic information about private channels.\"\n\t\t},\n\t\t{\n\t\t\tname: \"im:read\",\n\t\t\tdescription: \"View basic information about direct messages.\"\n\t\t},\n\t\t{\n\t\t\tname: \"mpim:read\",\n\t\t\tdescription: \"View basic information about group direct messages.\"\n\t\t},\n\t\t{\n\t\t\tname: \"reactions:read\",\n\t\t\tdescription: \"View emoji reactions in conversations.\"\n\t\t},\n\t\t{\n\t\t\tname: \"team:read\",\n\t\t\tdescription: \"View basic information about the Slack workspace.\"\n\t\t},\n\t\t{\n\t\t\tname: \"files:read\",\n\t\t\tdescription: \"View files shared in Slack conversations.\"\n\t\t},\n\t\t{\n\t\t\tname: \"users.profile:read\",\n\t\t\tdescription: \"View profile fields for people in the workspace.\"\n\t\t},\n\t\t{\n\t\t\tname: \"channels:join\",\n\t\t\tdescription: \"Join public channels in the workspace.\"\n\t\t},\n\t\t{\n\t\t\tname: \"chat:write.public\",\n\t\t\tdescription: \"Send messages to public channels the bot is not a member of.\"\n\t\t},\n\t\t{\n\t\t\tname: \"groups:history\",\n\t\t\tdescription: \"View messages in private channels the bot has been added to.\"\n\t\t},\n\t\t{\n\t\t\tname: \"im:history\",\n\t\t\tdescription: \"View messages in direct message conversations.\"\n\t\t},\n\t\t{\n\t\t\tname: \"mpim:history\",\n\t\t\tdescription: \"View messages in group direct message conversations.\"\n\t\t},\n\t\t{\n\t\t\tname: \"reactions:write\",\n\t\t\tdescription: \"Add emoji reactions to Slack messages.\"\n\t\t},\n\t\t{\n\t\t\tname: \"files:write\",\n\t\t\tdescription: \"Upload and manage files in Slack conversations.\"\n\t\t}\n\t],\n\t\"app-gmail\": [\n\t\t{\n\t\t\tname: \"gmail.readonly\",\n\t\t\tdescription: \"View Gmail messages and metadata.\"\n\t\t},\n\t\t{\n\t\t\tname: \"gmail.send\",\n\t\t\tdescription: \"Send email from the connected Gmail account.\"\n\t\t},\n\t\t{\n\t\t\tname: \"gmail.modify\",\n\t\t\tdescription: \"Read, label, archive, and delete Gmail messages.\"\n\t\t},\n\t\t{\n\t\t\tname: \"gmail.labels\",\n\t\t\tdescription: \"Create, read, update, and delete Gmail labels.\"\n\t\t},\n\t\t{\n\t\t\tname: \"gmail.compose\",\n\t\t\tdescription: \"Create and manage draft email messages.\"\n\t\t},\n\t\t{\n\t\t\tname: \"profile\",\n\t\t\tdescription: DEFAULT_OAUTH_SCOPE_DESCRIPTIONS.profile\n\t\t},\n\t\t{\n\t\t\tname: \"email\",\n\t\t\tdescription: DEFAULT_OAUTH_SCOPE_DESCRIPTIONS.email\n\t\t}\n\t],\n\t\"app-github\": [\n\t\t{\n\t\t\tname: \"repo\",\n\t\t\tdescription: \"Read and write code, pull requests, issues, and repository metadata.\"\n\t\t},\n\t\t{\n\t\t\tname: \"read:org\",\n\t\t\tdescription: \"Read organization membership and team information.\"\n\t\t},\n\t\t{\n\t\t\tname: \"workflow\",\n\t\t\tdescription: \"Update GitHub Actions workflow files.\"\n\t\t},\n\t\t{\n\t\t\tname: \"admin:repo_hook\",\n\t\t\tdescription: \"Create and manage repository webhooks.\"\n\t\t},\n\t\t{\n\t\t\tname: \"read:user\",\n\t\t\tdescription: \"Read the connected GitHub user profile.\"\n\t\t},\n\t\t{\n\t\t\tname: \"user:email\",\n\t\t\tdescription: \"Read the connected GitHub user email addresses.\"\n\t\t}\n\t],\n\t\"app-stripe\": [\n\t\t{\n\t\t\tname: \"charges:read\",\n\t\t\tdescription: \"View charges, payment status, and dispute details.\"\n\t\t},\n\t\t{\n\t\t\tname: \"customers:read\",\n\t\t\tdescription: \"View customers and saved billing details.\"\n\t\t},\n\t\t{\n\t\t\tname: \"customers:write\",\n\t\t\tdescription: \"Create and update customer records.\"\n\t\t},\n\t\t{\n\t\t\tname: \"invoices:read\",\n\t\t\tdescription: \"View invoices, invoice items, and payment attempts.\"\n\t\t},\n\t\t{\n\t\t\tname: \"invoices:write\",\n\t\t\tdescription: \"Create, finalize, and update invoices.\"\n\t\t},\n\t\t{\n\t\t\tname: \"subscriptions:read\",\n\t\t\tdescription: \"View subscription plans, items, and billing schedules.\"\n\t\t},\n\t\t{\n\t\t\tname: \"webhook_endpoints:write\",\n\t\t\tdescription: \"Create and manage webhook endpoints for Stripe events.\"\n\t\t}\n\t]\n};\nfunction buildAppCatalogEntry(app) {\n\treturn {\n\t\t...app,\n\t\tintegrationDescription: buildIntegrationDescription(app),\n\t\toauthScopes: OAUTH_SCOPE_CATALOG_BY_APP_ID[app.id] ?? []\n\t};\n}\n/**\n* The supported-app catalog shown in the \"Connect an app\" picker. Mirrors the\n* curated integration list from keystroke-mockups. No connected/available flag:\n* \"connected\" is not a property of an app, it's whether a credential exists.\n*/\nconst appCatalogSeed = APP_CATALOG_BASE.map(buildAppCatalogEntry);\nconst GMAIL_SCOPES = [\n\t\"gmail.readonly\",\n\t\"gmail.send\",\n\t\"profile\",\n\t\"email\"\n];\nconst SLACK_SCOPES = [\n\t\"channels:history\",\n\t\"channels:read\",\n\t\"chat:write\",\n\t\"commands\",\n\t\"users:read\",\n\t\"groups:read\",\n\t\"im:read\",\n\t\"mpim:read\",\n\t\"reactions:read\",\n\t\"team:read\",\n\t\"files:read\",\n\t\"users.profile:read\"\n];\n/**\n* Credential records the signed-in user can see, spanning the three scopes\n* (organization, project, user) and both connection kinds (oauth, manual) so\n* the table's pre-built views and the detail page all have data to render.\n*/\nconst credentialSeed = [\n\t{\n\t\tid: \"cred-gmail-org-1\",\n\t\tappId: \"app-gmail\",\n\t\tappName: \"Gmail\",\n\t\tlabel: \"Company Gmail\",\n\t\tscope: \"organization\",\n\t\tisDefault: true,\n\t\tstatus: \"Active\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-02-10T14:00:00Z\",\n\t\tlastUsedAt: \"2026-04-20T15:44:00Z\",\n\t\tlastRefreshedAt: \"2026-04-20T15:44:00Z\",\n\t\texpiresAt: \"2026-05-20T15:44:00Z\",\n\t\tgrantedScopes: GMAIL_SCOPES,\n\t\townerUserId: \"org-member-nate\",\n\t\townerName: \"Nate Wells\"\n\t},\n\t{\n\t\tid: \"cred-gmail-proj-marketing\",\n\t\tappId: \"app-gmail\",\n\t\tappName: \"Gmail\",\n\t\tlabel: \"Marketing Gmail\",\n\t\tscope: \"project\",\n\t\tprojectId: \"project_gtm_engineering\",\n\t\tprojectName: \"GTM Engineering\",\n\t\tisDefault: false,\n\t\tstatus: \"Active\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-03-10T09:00:00Z\",\n\t\tlastUsedAt: \"2026-04-19T11:20:00Z\",\n\t\tlastRefreshedAt: \"2026-04-19T11:20:00Z\",\n\t\texpiresAt: \"2026-05-19T11:20:00Z\",\n\t\tgrantedScopes: GMAIL_SCOPES,\n\t\townerUserId: \"org-member-nate\",\n\t\townerName: \"Nate Wells\"\n\t},\n\t{\n\t\tid: \"cred-gmail-proj-support\",\n\t\tappId: \"app-gmail\",\n\t\tappName: \"Gmail\",\n\t\tlabel: \"Support Gmail\",\n\t\tscope: \"project\",\n\t\tprojectId: \"project_gtm_engineering\",\n\t\tprojectName: \"GTM Engineering\",\n\t\tisDefault: false,\n\t\tstatus: \"Expired\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-03-15T10:30:00Z\",\n\t\tlastUsedAt: \"2026-04-18T16:05:00Z\",\n\t\tlastRefreshedAt: \"2026-04-18T16:05:00Z\",\n\t\texpiresAt: \"2026-04-18T16:05:00Z\",\n\t\tgrantedScopes: [\n\t\t\t\"gmail.readonly\",\n\t\t\t\"profile\",\n\t\t\t\"email\"\n\t\t],\n\t\townerUserId: \"org-member-dallin\",\n\t\townerName: \"Dallin Bentley\"\n\t},\n\t{\n\t\tid: \"cred-gmail-user-blake\",\n\t\tappId: \"app-gmail\",\n\t\tappName: \"Gmail\",\n\t\tlabel: \"Blake's Gmail\",\n\t\tscope: \"user\",\n\t\tisDefault: false,\n\t\tstatus: \"Active\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-03-20T08:15:00Z\",\n\t\tlastUsedAt: \"2026-04-20T09:18:00Z\",\n\t\tlastRefreshedAt: \"2026-04-20T09:18:00Z\",\n\t\texpiresAt: \"2026-05-20T09:18:00Z\",\n\t\tgrantedScopes: GMAIL_SCOPES,\n\t\townerUserId: \"user_blake_rouse\",\n\t\townerName: \"Blake Rouse\"\n\t},\n\t{\n\t\tid: \"cred-slack-org-1\",\n\t\tappId: \"app-slack\",\n\t\tappName: \"Slack\",\n\t\tlabel: \"Keystroke Slack\",\n\t\tscope: \"organization\",\n\t\tisDefault: true,\n\t\tstatus: \"Active\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-02-12T11:00:00Z\",\n\t\tlastUsedAt: \"2026-04-20T14:21:00Z\",\n\t\tlastRefreshedAt: \"2026-04-20T14:21:00Z\",\n\t\texpiresAt: \"2026-05-20T14:21:00Z\",\n\t\tgrantedScopes: SLACK_SCOPES,\n\t\townerUserId: \"org-member-wells\",\n\t\townerName: \"Wells Riley\"\n\t},\n\t{\n\t\tid: \"cred-slack-user-nate\",\n\t\tappId: \"app-slack\",\n\t\tappName: \"Slack\",\n\t\tlabel: \"Nate's Slack\",\n\t\tscope: \"user\",\n\t\tisDefault: false,\n\t\tstatus: \"Needs Reauth\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-03-22T15:45:00Z\",\n\t\tlastUsedAt: \"2026-04-20T12:05:00Z\",\n\t\tlastRefreshedAt: \"2026-04-20T12:05:00Z\",\n\t\texpiresAt: \"2026-04-20T12:05:00Z\",\n\t\tgrantedScopes: SLACK_SCOPES,\n\t\townerUserId: \"org-member-nate\",\n\t\townerName: \"Nate Wells\"\n\t},\n\t{\n\t\tid: \"cred-github-org-1\",\n\t\tappId: \"app-github\",\n\t\tappName: \"GitHub\",\n\t\tlabel: \"Keystroke GitHub\",\n\t\tscope: \"organization\",\n\t\tisDefault: true,\n\t\tstatus: \"Active\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-02-08T09:30:00Z\",\n\t\tlastUsedAt: \"2026-04-20T13:02:00Z\",\n\t\tlastRefreshedAt: \"2026-04-20T13:02:00Z\",\n\t\texpiresAt: \"2026-05-20T13:02:00Z\",\n\t\tgrantedScopes: [\n\t\t\t\"repo\",\n\t\t\t\"read:org\",\n\t\t\t\"workflow\"\n\t\t],\n\t\townerUserId: \"org-member-dallin\",\n\t\townerName: \"Dallin Bentley\"\n\t},\n\t{\n\t\tid: \"cred-github-proj-personal\",\n\t\tappId: \"app-github\",\n\t\tappName: \"GitHub\",\n\t\tlabel: \"Personal Repo GitHub\",\n\t\tscope: \"project\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tprojectName: \"Blake's Project\",\n\t\tisDefault: false,\n\t\tstatus: \"Active\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-03-01T16:00:00Z\",\n\t\tlastUsedAt: \"2026-04-19T19:41:00Z\",\n\t\tlastRefreshedAt: \"2026-04-19T19:41:00Z\",\n\t\texpiresAt: \"2026-05-19T19:41:00Z\",\n\t\tgrantedScopes: [\"repo\", \"workflow\"],\n\t\townerUserId: \"user_blake_rouse\",\n\t\townerName: \"Blake Rouse\"\n\t},\n\t{\n\t\tid: \"cred-anthropic-org-1\",\n\t\tappId: \"app-anthropic\",\n\t\tappName: \"Anthropic\",\n\t\tlabel: \"Anthropic API\",\n\t\tscope: \"organization\",\n\t\tisDefault: true,\n\t\tstatus: \"Active\",\n\t\tconnectionKind: \"manual\",\n\t\tcreatedAt: \"2026-02-20T13:00:00Z\",\n\t\tlastUsedAt: \"2026-04-19T09:40:00Z\",\n\t\tlastRefreshedAt: \"2026-04-19T09:40:00Z\",\n\t\tcredentialKeys: [\"ANTHROPIC_API_KEY\"],\n\t\tkeyPreviews: { ANTHROPIC_API_KEY: \"••••••••••••••••••M5f\" },\n\t\townerUserId: \"org-member-nate\",\n\t\townerName: \"Nate Wells\"\n\t}\n];\nconst agentSeed = [{\n\tid: \"agent-support\",\n\tname: \"Support Agent\",\n\tprojectId: \"project_personal_repo\",\n\tupdatedAt: \"2026-06-02T14:20:00Z\",\n\tdescription: \"Triage support requests and draft helpful replies.\",\n\tsourcePath: \"src/agents/support-agent.ts\",\n\tmodel: \"claude-4-sonnet\",\n\ttoolCount: 4,\n\tcredentialCount: 2,\n\tlastRunAt: \"2026-06-02T14:20:00Z\"\n}, {\n\tid: \"agent-research\",\n\tname: \"Research Agent\",\n\tprojectId: \"project_personal_repo\",\n\tupdatedAt: \"2026-06-01T09:15:00Z\",\n\tdescription: \"Summarize docs and pull answers from connected sources.\",\n\tsourcePath: \"src/agents/research-agent.ts\",\n\tmodel: \"claude-4-sonnet\",\n\ttoolCount: 6,\n\tcredentialCount: 3,\n\tlastRunAt: \"2026-06-01T09:15:00Z\"\n}];\nconst workflowSeed = [{\n\tid: \"workflow-daily-digest\",\n\tname: \"Daily Digest\",\n\tprojectId: \"project_personal_repo\",\n\tupdatedAt: \"2026-06-02T11:05:00Z\",\n\tdescription: \"Collect project updates and send a daily summary.\",\n\tsourcePath: \"src/workflows/daily-digest.ts\",\n\tstepCount: 2,\n\tlastRunAt: \"2026-06-02T11:05:00Z\"\n}, {\n\tid: \"workflow-email-triage\",\n\tname: \"Email Triage\",\n\tprojectId: \"project_personal_repo\",\n\tupdatedAt: \"2026-05-31T16:40:00Z\",\n\tdescription: \"Label, prioritize, and draft replies for inbound email.\",\n\tsourcePath: \"src/workflows/email-triage.ts\",\n\tstepCount: 4,\n\tlastRunAt: \"2026-05-31T16:40:00Z\"\n}];\nconst skillSeed = [{\n\tid: \"skill-attio-sync\",\n\tname: \"Attio Sync\",\n\tprojectId: \"project_personal_repo\",\n\tupdatedAt: \"2026-06-01T18:05:00Z\",\n\tdescription: \"Enrich company and contact records from Attio.\",\n\tsourcePath: \".agents/skills/attio-sync/SKILL.md\"\n}, {\n\tid: \"skill-doc-coauthor\",\n\tname: \"Doc Co-author\",\n\tprojectId: \"project_personal_repo\",\n\tupdatedAt: \"2026-05-30T10:24:00Z\",\n\tdescription: \"Collaborative writing, editing, and version tracking for docs.\",\n\tsourcePath: \".agents/skills/doc-coauthor/SKILL.md\"\n}];\nconst deploymentSeed = [{\n\tid: \"deployment-v002\",\n\tprojectId: \"project_personal_repo\",\n\tversion: \"v0.0.2\",\n\tcommit: \"0842e21\",\n\tcommitSha: \"0842e21\",\n\tdeployedBy: \"Dallin Bentley\",\n\tdeployedByEmail: \"dallin@keystroke.ai\",\n\tcreatedAt: \"2026-04-20T15:44:00Z\",\n\tactive: true\n}, {\n\tid: \"deployment-v001\",\n\tprojectId: \"project_personal_repo\",\n\tversion: \"v0.0.1\",\n\tcommit: \"5aeb762\",\n\tcommitSha: \"5aeb762\",\n\tdeployedBy: \"Dallin Bentley\",\n\tdeployedByEmail: \"dallin@keystroke.ai\",\n\tcreatedAt: \"2026-04-18T15:44:00Z\",\n\tactive: false\n}];\nconst projectFileSeed = [\n\t{\n\t\tid: \"file-agents-support-agent\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tpath: \"src/agents/support-agent.ts\",\n\t\tlanguage: \"typescript\",\n\t\tupdatedAt: \"2026-04-20T15:44:00Z\",\n\t\tcontents: `import { defineAgent } from \"@keystrokehq/agent\";\n\nexport const supportAgent = defineAgent({\n key: \"support-agent\",\n name: \"Support Agent\",\n model: \"claude-4-sonnet\",\n instructions: \"Triage support requests and draft helpful replies.\",\n});\n`\n\t},\n\t{\n\t\tid: \"file-workflows-daily-digest\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tpath: \"src/workflows/daily-digest.ts\",\n\t\tlanguage: \"typescript\",\n\t\tupdatedAt: \"2026-04-20T15:12:00Z\",\n\t\tcontents: `import { defineWorkflow } from \"@keystrokehq/workflow\";\n\nexport const dailyDigest = defineWorkflow({\n key: \"daily-digest\",\n name: \"Daily Digest\",\n trigger: \"schedule.daily\",\n async run(ctx) {\n await ctx.step(\"collect-updates\");\n await ctx.step(\"send-summary\");\n },\n});\n`\n\t},\n\t{\n\t\tid: \"file-skills-attio-sync\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tpath: \".agents/skills/attio-sync/SKILL.md\",\n\t\tlanguage: \"markdown\",\n\t\tupdatedAt: \"2026-04-19T18:05:00Z\",\n\t\tcontents: `# Attio Sync\n\nUse this skill when a workflow needs to enrich company or person records from Attio.\n\n## Inputs\n\n- company domain\n- contact email\n- enrichment depth\n\n## Output\n\nNormalized CRM metadata ready for downstream workflow steps.\n`\n\t},\n\t{\n\t\tid: \"file-skills-doc-coauthor\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tpath: \".agents/skills/doc-coauthor/SKILL.md\",\n\t\tlanguage: \"markdown\",\n\t\tupdatedAt: \"2026-05-30T10:24:00Z\",\n\t\tcontents: `# Doc Co-author\n\nUse this skill when a workflow needs to collaboratively write, edit, and track\nversions of a document.\n\n## Inputs\n\n- document title\n- source outline or draft\n- target audience\n\n## Output\n\nA revised document with tracked changes and a short summary of edits.\n`\n\t},\n\t{\n\t\tid: \"file-skills-doc-coauthor-reference\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tpath: \".agents/skills/doc-coauthor/reference.md\",\n\t\tlanguage: \"markdown\",\n\t\tupdatedAt: \"2026-05-30T10:24:00Z\",\n\t\tcontents: `# Reference\n\nStyle and structure guidance the co-author follows when editing docs.\n\n## Voice\n\n- Prefer active voice and short sentences.\n- Keep headings consistent with the existing document.\n\n## Versioning\n\n- Summarize each revision pass.\n- Never drop the reader's original intent.\n`\n\t},\n\t{\n\t\tid: \"file-skills-doc-coauthor-template\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tpath: \".agents/skills/doc-coauthor/templates/outline.md\",\n\t\tlanguage: \"markdown\",\n\t\tupdatedAt: \"2026-05-30T10:24:00Z\",\n\t\tcontents: `# {{title}}\n\n## Summary\n\n## Background\n\n## Details\n\n## Next steps\n`\n\t},\n\t{\n\t\tid: \"file-actions-send-slack\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tpath: \"src/actions/send-slack-message.ts\",\n\t\tlanguage: \"typescript\",\n\t\tupdatedAt: \"2026-04-18T12:30:00Z\",\n\t\tcontents: `import { defineAction } from \"@keystrokehq/action\";\n\nexport const sendSlackMessage = defineAction({\n key: \"send-slack-message\",\n name: \"Send Slack message\",\n async run({ channel, text }) {\n return { channel, text, sent: true };\n },\n});\n`\n\t}\n];\n/** Review personas for mocked project members and API key authors (not org membership). */\nconst mockPersonaSeed = [\n\t{\n\t\tid: \"user_blake_rouse\",\n\t\tname: \"Blake Rouse\",\n\t\temail: \"blake@keystroke.ai\",\n\t\tavatarUrl: \"/icons/avatars/blake-rouse.png\",\n\t\tjoinedAt: \"2026-01-12T18:00:00Z\",\n\t\tlastActiveAt: \"2026-05-31T18:00:00Z\"\n\t},\n\t{\n\t\tid: \"org-member-nate\",\n\t\tname: \"Nate Wells\",\n\t\temail: \"nate@keystroke.ai\",\n\t\tavatarUrl: \"/icons/avatars/nate-kelley.png\",\n\t\tjoinedAt: \"2026-02-03T18:00:00Z\",\n\t\tlastActiveAt: \"2026-05-31T16:00:00Z\"\n\t},\n\t{\n\t\tid: \"org-member-dallin\",\n\t\tname: \"Dallin Bentley\",\n\t\temail: \"dallin@keystroke.ai\",\n\t\tavatarUrl: \"/icons/avatars/dallin-bentley.png\",\n\t\tjoinedAt: \"2026-03-18T18:00:00Z\",\n\t\tlastActiveAt: \"2026-05-30T16:00:00Z\"\n\t},\n\t{\n\t\tid: \"org-member-wells\",\n\t\tname: \"Wells Riley\",\n\t\temail: \"wells@keystroke.ai\",\n\t\tavatarUrl: \"/icons/avatars/wells-bunker.png\",\n\t\tjoinedAt: \"2026-04-09T18:00:00Z\",\n\t\tlastActiveAt: \"2026-05-20T16:00:00Z\"\n\t}\n];\nconst projectMemberSeed = mockPersonaSeed.map((member, index) => ({\n\tid: `project-member-${member.id}`,\n\tprojectId: \"project_personal_repo\",\n\tname: member.name,\n\temail: member.email,\n\trole: index <= 1 ? \"admin\" : \"editor\",\n\tstatus: \"active\",\n\tavatarUrl: member.avatarUrl,\n\tjoinedAt: member.joinedAt,\n\tlastActiveAt: member.lastActiveAt,\n\tisCurrentUser: member.id === \"user_blake_rouse\"\n}));\nconst apiKeySeed = [\n\t{\n\t\tid: \"api-key-local-dev\",\n\t\tname: \"LOCAL_DEV_BLAKE\",\n\t\tkeyPreview: \"******J7Pt\",\n\t\tcreatedAt: \"2026-04-20T15:44:00Z\",\n\t\tcreatedBy: mockPersonaSeed[0],\n\t\tisCreatedByCurrentUser: true\n\t},\n\t{\n\t\tid: \"api-key-ci-deploy\",\n\t\tname: \"CI deploy\",\n\t\tkeyPreview: \"******TJb7\",\n\t\tcreatedAt: \"2026-03-08T15:44:00Z\",\n\t\tcreatedBy: mockPersonaSeed[1],\n\t\tisCreatedByCurrentUser: false\n\t},\n\t{\n\t\tid: \"api-key-partner-webhooks\",\n\t\tname: \"partner_webhooks\",\n\t\tkeyPreview: \"******9Qzc\",\n\t\tcreatedAt: \"2026-02-18T15:44:00Z\",\n\t\tcreatedBy: mockPersonaSeed[2],\n\t\tisCreatedByCurrentUser: false\n\t}\n];\n//#endregion\n//#region src/platform/resources/mock-resources.ts\nlet credentialRecords = [...credentialSeed];\nconst recentProjectNameById = { project_personal_repo: \"Blake's Project\" };\nfunction laterIso(a, b) {\n\treturn new Date(a).getTime() >= new Date(b).getTime() ? a : b;\n}\nfunction hoursBefore(iso, hours) {\n\treturn (/* @__PURE__ */ new Date(new Date(iso).getTime() - hours * 36e5)).toISOString();\n}\nfunction buildRecentResourceSeed() {\n\tconst agentRecents = agentSeed.map((agent, index) => {\n\t\tconst lastModifiedAt = agent.updatedAt;\n\t\tconst lastOpenedAt = hoursBefore(lastModifiedAt, index * 5 + 2);\n\t\treturn {\n\t\t\tid: `recent-agent-${agent.id}`,\n\t\t\tresourceKind: \"agent\",\n\t\t\tresourceId: agent.id,\n\t\t\tname: agent.name,\n\t\t\tdescription: agent.description,\n\t\t\tprojectId: agent.projectId,\n\t\t\tprojectName: recentProjectNameById[agent.projectId] ?? agent.projectId,\n\t\t\tsourcePath: agent.sourcePath,\n\t\t\tsource: \"owned\",\n\t\t\tlastOpenedAt,\n\t\t\tlastModifiedAt\n\t\t};\n\t});\n\tconst workflowRecents = workflowSeed.map((workflow, index) => {\n\t\tconst lastModifiedAt = workflow.updatedAt;\n\t\tconst lastOpenedAt = hoursBefore(lastModifiedAt, index * 4 + 6);\n\t\treturn {\n\t\t\tid: `recent-workflow-${workflow.id}`,\n\t\t\tresourceKind: \"workflow\",\n\t\t\tresourceId: workflow.id,\n\t\t\tname: workflow.name,\n\t\t\tdescription: workflow.description,\n\t\t\tprojectId: workflow.projectId,\n\t\t\tprojectName: recentProjectNameById[workflow.projectId] ?? workflow.projectId,\n\t\t\tsourcePath: workflow.sourcePath,\n\t\t\tsource: \"owned\",\n\t\t\tlastOpenedAt,\n\t\t\tlastModifiedAt\n\t\t};\n\t});\n\tconst skillRecents = skillSeed.map((skill, index) => {\n\t\tconst lastModifiedAt = skill.updatedAt;\n\t\tconst lastOpenedAt = hoursBefore(lastModifiedAt, index * 3 + 1);\n\t\treturn {\n\t\t\tid: `recent-skill-${skill.id}`,\n\t\t\tresourceKind: \"skill\",\n\t\t\tresourceId: skill.id,\n\t\t\tname: skill.name,\n\t\t\tdescription: skill.description,\n\t\t\tprojectId: skill.projectId,\n\t\t\tprojectName: recentProjectNameById[skill.projectId] ?? skill.projectId,\n\t\t\tsourcePath: skill.sourcePath,\n\t\t\tsource: \"owned\",\n\t\t\tlastOpenedAt,\n\t\t\tlastModifiedAt\n\t\t};\n\t});\n\treturn [\n\t\t...agentRecents,\n\t\t...workflowRecents,\n\t\t...skillRecents\n\t].sort((left, right) => {\n\t\tconst leftAt = laterIso(left.lastOpenedAt, left.lastModifiedAt);\n\t\tconst rightAt = laterIso(right.lastOpenedAt, right.lastModifiedAt);\n\t\treturn new Date(rightAt).getTime() - new Date(leftAt).getTime();\n\t});\n}\nfunction createMockApiKeySecret() {\n\tconst secret = `sk_${`${Date.now().toString(36)}${Math.random().toString(36).slice(2, 10)}`}`;\n\treturn {\n\t\tsecret,\n\t\tkeyPreview: `******${secret.slice(-4)}`\n\t};\n}\nfunction createAgentsResource() {\n\treturn {\n\t\tlist: mock({\n\t\t\tdomain: \"agents\",\n\t\t\tmethod: \"list\",\n\t\t\tplannedEndpoint: \"GET /api/agents\"\n\t\t}, async () => agentSeed),\n\t\tget: mock({\n\t\t\tdomain: \"agents\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/agents/:id\"\n\t\t}, async (agentId) => agentSeed.find((agent) => agent.id === agentId) ?? null)\n\t};\n}\nfunction createWorkflowsResource() {\n\treturn {\n\t\tlist: mock({\n\t\t\tdomain: \"workflows\",\n\t\t\tmethod: \"list\",\n\t\t\tplannedEndpoint: \"GET /api/workflows\"\n\t\t}, async () => workflowSeed),\n\t\tget: mock({\n\t\t\tdomain: \"workflows\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/workflows/:id\"\n\t\t}, async (workflowId) => workflowSeed.find((workflow) => workflow.id === workflowId) ?? null)\n\t};\n}\nfunction createSkillsResource() {\n\treturn {\n\t\tlist: mock({\n\t\t\tdomain: \"skills\",\n\t\t\tmethod: \"list\",\n\t\t\tplannedEndpoint: \"GET /api/skills\"\n\t\t}, async () => skillSeed),\n\t\tget: mock({\n\t\t\tdomain: \"skills\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/skills/:id\"\n\t\t}, async (skillId) => skillSeed.find((skill) => skill.id === skillId) ?? null)\n\t};\n}\nfunction createAppsResource() {\n\treturn { listCatalog: mock({\n\t\tdomain: \"apps\",\n\t\tmethod: \"listCatalog\",\n\t\tplannedEndpoint: \"GET /api/apps\"\n\t}, async () => appCatalogSeed) };\n}\nfunction createCredentialsResource() {\n\treturn {\n\t\tlist: mock({\n\t\t\tdomain: \"credentials\",\n\t\t\tmethod: \"list\",\n\t\t\tplannedEndpoint: \"GET /api/credentials\"\n\t\t}, async () => credentialRecords),\n\t\tget: mock({\n\t\t\tdomain: \"credentials\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/credentials/:id\"\n\t\t}, async (credentialId) => credentialRecords.find((credential) => credential.id === credentialId) ?? null),\n\t\tstartOAuthConnection: mock({\n\t\t\tdomain: \"credentials\",\n\t\t\tmethod: \"startOAuthConnection\",\n\t\t\tplannedEndpoint: \"GET /oauth/:key/authorize-url\"\n\t\t}, async (input) => {\n\t\t\tawait new Promise((resolve) => setTimeout(resolve, 900));\n\t\t\treturn {\n\t\t\t\tstatus: \"connected\",\n\t\t\t\tauthorizeUrl: null\n\t\t\t};\n\t\t}),\n\t\tcreate: mock({\n\t\t\tdomain: \"credentials\",\n\t\t\tmethod: \"create\",\n\t\t\tplannedEndpoint: \"POST /api/credentials\"\n\t\t}, async (input) => {\n\t\t\tconst app = appCatalogSeed.find((entry) => entry.id === input.appId);\n\t\t\tconst now = (/* @__PURE__ */ new Date()).toISOString();\n\t\t\tconst keyName = `${(app?.name ?? \"APP\").toUpperCase().replace(/\\W+/g, \"_\")}_API_KEY`;\n\t\t\tconst base = {\n\t\t\t\tappId: input.appId,\n\t\t\t\tappName: app?.name,\n\t\t\t\tstatus: \"Active\",\n\t\t\t\tconnectionKind: input.connectionKind,\n\t\t\t\tcreatedAt: now,\n\t\t\t\tlastRefreshedAt: now,\n\t\t\t\tlastUsedAt: null,\n\t\t\t\tisDefault: false,\n\t\t\t\tgrantedScopes: input.scopes,\n\t\t\t\tcredentialKeys: input.apiKey ? [keyName] : void 0,\n\t\t\t\tkeyPreviews: input.apiKey ? { [keyName]: maskSecretPreview(input.apiKey) } : void 0,\n\t\t\t\townerUserId: \"user_blake_rouse\",\n\t\t\t\townerName: \"Blake Rouse\"\n\t\t\t};\n\t\t\tconst created = [\n\t\t\t\t...input.projectIds.map((projectId) => ({\n\t\t\t\t\t...base,\n\t\t\t\t\tid: `cred-${input.appId}-${projectId}-${Date.now().toString(36)}`,\n\t\t\t\t\tlabel: `${app?.name ?? input.appId} project credential`,\n\t\t\t\t\tscope: \"project\",\n\t\t\t\t\tprojectId\n\t\t\t\t})),\n\t\t\t\t...input.createOrganizationCredential ? [{\n\t\t\t\t\t...base,\n\t\t\t\t\tid: `cred-${input.appId}-org-${Date.now().toString(36)}`,\n\t\t\t\t\tlabel: `${app?.name ?? input.appId} organization credential`,\n\t\t\t\t\tscope: \"organization\"\n\t\t\t\t}] : [],\n\t\t\t\t...input.createUserProvidedCredential ? [{\n\t\t\t\t\t...base,\n\t\t\t\t\tid: `cred-${input.appId}-user-${Date.now().toString(36)}`,\n\t\t\t\t\tlabel: `${app?.name ?? input.appId} personal credential`,\n\t\t\t\t\tscope: \"user\"\n\t\t\t\t}] : []\n\t\t\t];\n\t\t\tcredentialRecords = [...created, ...credentialRecords];\n\t\t\treturn created;\n\t\t}),\n\t\tupdate: mock({\n\t\t\tdomain: \"credentials\",\n\t\t\tmethod: \"update\",\n\t\t\tplannedEndpoint: \"PATCH /api/credentials/:id\"\n\t\t}, async (credentialId, patch) => {\n\t\t\tconst target = credentialRecords.find((credential) => credential.id === credentialId);\n\t\t\tif (!target) return null;\n\t\t\tconst settingDefault = patch.isDefault === true;\n\t\t\tcredentialRecords = credentialRecords.map((credential) => {\n\t\t\t\tif (credential.id === credentialId) return {\n\t\t\t\t\t...credential,\n\t\t\t\t\t...patch.label !== void 0 ? { label: patch.label } : {},\n\t\t\t\t\t...patch.isDefault !== void 0 ? { isDefault: patch.isDefault } : {}\n\t\t\t\t};\n\t\t\t\tif (settingDefault && credential.appId === target.appId && credential.scope === target.scope) return {\n\t\t\t\t\t...credential,\n\t\t\t\t\tisDefault: false\n\t\t\t\t};\n\t\t\t\treturn credential;\n\t\t\t});\n\t\t\treturn credentialRecords.find((credential) => credential.id === credentialId) ?? null;\n\t\t})\n\t};\n}\n/** Masked preview of a secret — last 4 chars revealed, the rest masked. */\nfunction maskSecretPreview(value) {\n\tconst trimmed = value.trim();\n\tif (trimmed.length <= 4) return \"•\".repeat(Math.max(trimmed.length, 4));\n\treturn `${\"•\".repeat(Math.min(trimmed.length - 4, 20))}${trimmed.slice(-4)}`;\n}\nfunction createDeploymentsResource() {\n\treturn { listForProject: mock({\n\t\tdomain: \"deployments\",\n\t\tmethod: \"listForProject\",\n\t\tplannedEndpoint: \"GET /api/projects/:id/deployments\"\n\t}, async (projectId) => {\n\t\treturn deploymentSeed.map((deployment) => ({\n\t\t\t...deployment,\n\t\t\tprojectId\n\t\t}));\n\t}) };\n}\nfunction createProjectMetricsResource() {\n\treturn { list: mock({\n\t\tdomain: \"projectMetrics\",\n\t\tmethod: \"list\",\n\t\tplannedEndpoint: \"GET /api/projects/metrics\"\n\t}, async () => ({})) };\n}\nfunction createProjectFilesResource() {\n\treturn { listForProject: mock({\n\t\tdomain: \"projectFiles\",\n\t\tmethod: \"listForProject\",\n\t\tplannedEndpoint: \"GET /api/projects/:id/files\"\n\t}, async (projectId) => projectFileSeed.map((file) => ({\n\t\t...file,\n\t\tprojectId\n\t}))) };\n}\nconst projectMembersStore = /* @__PURE__ */ new Map();\nfunction getProjectMembers(projectId) {\n\tlet members = projectMembersStore.get(projectId);\n\tif (!members) {\n\t\tmembers = projectMemberSeed.map((member) => ({\n\t\t\t...member,\n\t\t\tprojectId\n\t\t}));\n\t\tprojectMembersStore.set(projectId, members);\n\t}\n\treturn members;\n}\n/** Derive a best-effort display name from an email local part. */\nfunction displayNameFromEmail(email) {\n\treturn (email.split(\"@\")[0] ?? email).split(/[._-]+/).filter((part) => part.length > 0).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(\" \");\n}\nfunction createMembersResource(http) {\n\treturn {\n\t\t...createMembersResource$1(http),\n\t\tlistForProject: mock({\n\t\t\tdomain: \"members\",\n\t\t\tmethod: \"listForProject\",\n\t\t\tplannedEndpoint: \"GET /api/projects/:id/members\"\n\t\t}, async (projectId) => [...getProjectMembers(projectId)]),\n\t\tinviteToProject: mock({\n\t\t\tdomain: \"members\",\n\t\t\tmethod: \"inviteToProject\",\n\t\t\tplannedEndpoint: \"POST /api/projects/:id/members/invitations\"\n\t\t}, async (input) => {\n\t\t\tconst members = getProjectMembers(input.projectId);\n\t\t\tconst pendingOrgEmails = new Set((input.pendingOrgEmails ?? []).map((email) => email.toLowerCase()));\n\t\t\tconst seen = new Set(members.map((member) => member.email.toLowerCase()));\n\t\t\tconst invited = [];\n\t\t\tinput.emails.forEach((email, index) => {\n\t\t\t\tconst key = email.toLowerCase();\n\t\t\t\tif (seen.has(key)) return;\n\t\t\t\tseen.add(key);\n\t\t\t\tinvited.push({\n\t\t\t\t\tid: `project-member-invite-${Date.now().toString(36)}-${index}`,\n\t\t\t\t\tprojectId: input.projectId,\n\t\t\t\t\tname: displayNameFromEmail(email),\n\t\t\t\t\temail,\n\t\t\t\t\trole: input.role,\n\t\t\t\t\tstatus: pendingOrgEmails.has(key) ? \"invited\" : \"active\",\n\t\t\t\t\tjoinedAt: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\t\t\tlastActiveAt: null\n\t\t\t\t});\n\t\t\t});\n\t\t\tif (invited.length > 0) projectMembersStore.set(input.projectId, [...members, ...invited]);\n\t\t\treturn { invited };\n\t\t})\n\t};\n}\nlet apiKeyRecords = [...apiKeySeed];\nfunction createApiKeysResource() {\n\treturn {\n\t\tlist: mock({\n\t\t\tdomain: \"apiKeys\",\n\t\t\tmethod: \"list\",\n\t\t\tplannedEndpoint: \"GET /api/api-keys\"\n\t\t}, async () => apiKeyRecords),\n\t\tcreate: mock({\n\t\t\tdomain: \"apiKeys\",\n\t\t\tmethod: \"create\",\n\t\t\tplannedEndpoint: \"POST /api/api-keys\"\n\t\t}, async (input) => {\n\t\t\tconst { secret, keyPreview } = createMockApiKeySecret();\n\t\t\tconst created = {\n\t\t\t\tid: `api-key-${Date.now().toString(36)}`,\n\t\t\t\tname: input.name,\n\t\t\t\tkeyPreview,\n\t\t\t\tcreatedAt: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\t\tcreatedBy: mockPersonaSeed[0],\n\t\t\t\tisCreatedByCurrentUser: true\n\t\t\t};\n\t\t\tapiKeyRecords = [created, ...apiKeyRecords];\n\t\t\treturn {\n\t\t\t\t...created,\n\t\t\t\tsecret\n\t\t\t};\n\t\t}),\n\t\trevoke: mock({\n\t\t\tdomain: \"apiKeys\",\n\t\t\tmethod: \"revoke\",\n\t\t\tplannedEndpoint: \"DELETE /api/api-keys/:id\"\n\t\t}, async (apiKeyId) => {\n\t\t\tapiKeyRecords = apiKeyRecords.filter((apiKey) => apiKey.id !== apiKeyId);\n\t\t})\n\t};\n}\nfunction createRecentsResource() {\n\treturn { list: mock({\n\t\tdomain: \"recents\",\n\t\tmethod: \"list\",\n\t\tplannedEndpoint: \"GET /api/recents\"\n\t}, async () => buildRecentResourceSeed()) };\n}\n//#endregion\n//#region src/platform/resources/mock-history.ts\nconst historyProjectNameById = { project_personal_repo: \"Blake's Project\" };\nconst MOCK_ACTOR = {\n\tuserId: \"user_blake\",\n\tname: \"Blake Rouse\",\n\tavatarUrl: null\n};\nfunction buildCompletedUsage(durationMs) {\n\treturn {\n\t\trunDurationMs: durationMs,\n\t\tlineItems: [\n\t\t\t{\n\t\t\t\tid: \"claude-opus\",\n\t\t\t\tlabel: \"Claude Opus 4.8\",\n\t\t\t\tamountUsd: .413\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"gemini-flash\",\n\t\t\t\tlabel: \"Gemini Flash 3.5\",\n\t\t\t\tamountUsd: .001\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"daytona\",\n\t\t\t\tlabel: \"Daytona Sandbox\",\n\t\t\t\tamountUsd: .188\n\t\t\t}\n\t\t],\n\t\ttotalExcludingDurationUsd: .603\n\t};\n}\nfunction buildRunningUsage() {\n\treturn {\n\t\trunDurationMs: null,\n\t\tlineItems: [],\n\t\ttotalExcludingDurationUsd: null\n\t};\n}\nfunction buildFailedUsage(durationMs) {\n\tif (durationMs == null) return {\n\t\trunDurationMs: null,\n\t\tlineItems: [],\n\t\ttotalExcludingDurationUsd: null\n\t};\n\treturn {\n\t\trunDurationMs: durationMs,\n\t\tlineItems: [{\n\t\t\tid: \"claude-opus\",\n\t\t\tlabel: \"Claude Opus 4.8\",\n\t\t\tamountUsd: .021\n\t\t}],\n\t\ttotalExcludingDurationUsd: .021\n\t};\n}\nfunction workflowKeyFromId(workflowId) {\n\tconst row = workflowSeed.find((workflow) => workflow.id === workflowId);\n\tif (!row?.sourcePath) return workflowId;\n\treturn row.sourcePath.match(/\\/([^/]+)\\.ts$/)?.[1] ?? workflowId;\n}\nfunction agentKeyFromId(agentId) {\n\tconst row = agentSeed.find((agent) => agent.id === agentId);\n\tif (!row?.sourcePath) return agentId;\n\treturn row.sourcePath.match(/\\/([^/]+)\\.ts$/)?.[1] ?? agentId;\n}\nconst historyRunSeed = [\n\t{\n\t\tid: \"run-support-agent-001\",\n\t\tkind: \"agent\",\n\t\ttraceId: \"run-support-agent-001\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tprojectName: historyProjectNameById.project_personal_repo ?? \"Project\",\n\t\tresourceKey: agentKeyFromId(\"agent-support\"),\n\t\tresourceId: \"agent-support\",\n\t\tresourceName: \"Support Agent\",\n\t\tstatus: \"completed\",\n\t\ttriggeredAt: \"2026-04-20T15:44:00Z\",\n\t\ttimeInQueueMs: 85,\n\t\tstartedAt: \"2026-04-20T15:44:00Z\",\n\t\tfinishedAt: \"2026-04-20T15:44:42Z\",\n\t\tdurationMs: 42e3,\n\t\ttriggerLabel: \"Gateway\",\n\t\ttriggerRaw: \"gateway\",\n\t\tranAs: MOCK_ACTOR,\n\t\tmodelsUsed: [\"Claude Opus 4.8\", \"Gemini Flash 3.5\"],\n\t\totherServicesUsed: [\"Slack\", \"Daytona Sandbox\"],\n\t\ttotalCostUsd: .603,\n\t\tmessageCount: 8\n\t},\n\t{\n\t\tid: \"run-daily-digest-001\",\n\t\tkind: \"workflow\",\n\t\ttraceId: \"run-daily-digest-001\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tprojectName: historyProjectNameById.project_personal_repo ?? \"Project\",\n\t\tresourceKey: workflowKeyFromId(\"workflow-daily-digest\"),\n\t\tresourceId: \"workflow-daily-digest\",\n\t\tresourceName: \"Daily Digest\",\n\t\tstatus: \"running\",\n\t\ttriggeredAt: \"2026-04-20T15:12:00Z\",\n\t\ttimeInQueueMs: null,\n\t\tstartedAt: \"2026-04-20T15:12:00Z\",\n\t\tfinishedAt: null,\n\t\tdurationMs: null,\n\t\ttriggerLabel: \"Cron\",\n\t\ttriggerRaw: \"cron\",\n\t\tranAs: MOCK_ACTOR,\n\t\tmodelsUsed: [],\n\t\totherServicesUsed: [],\n\t\ttotalCostUsd: null,\n\t\tstepCount: 1\n\t},\n\t{\n\t\tid: \"run-support-agent-000\",\n\t\tkind: \"agent\",\n\t\ttraceId: \"run-support-agent-000\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tprojectName: historyProjectNameById.project_personal_repo ?? \"Project\",\n\t\tresourceKey: agentKeyFromId(\"agent-support\"),\n\t\tresourceId: \"agent-support\",\n\t\tresourceName: \"Support Agent\",\n\t\tstatus: \"failed\",\n\t\ttriggeredAt: \"2026-04-19T18:22:00Z\",\n\t\ttimeInQueueMs: 45,\n\t\tstartedAt: \"2026-04-19T18:22:00Z\",\n\t\tfinishedAt: \"2026-04-19T18:22:12Z\",\n\t\tdurationMs: 12e3,\n\t\ttriggerLabel: \"Gateway\",\n\t\ttriggerRaw: \"gateway\",\n\t\tranAs: MOCK_ACTOR,\n\t\tmodelsUsed: [\"Claude Opus 4.8\"],\n\t\totherServicesUsed: [\"Slack\"],\n\t\ttotalCostUsd: .021,\n\t\tmessageCount: 2\n\t},\n\t{\n\t\tid: \"run-email-triage-002\",\n\t\tkind: \"workflow\",\n\t\ttraceId: \"run-email-triage-002\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tprojectName: historyProjectNameById.project_personal_repo ?? \"Project\",\n\t\tresourceKey: workflowKeyFromId(\"workflow-email-triage\"),\n\t\tresourceId: \"workflow-email-triage\",\n\t\tresourceName: \"Email Triage\",\n\t\tstatus: \"failed\",\n\t\ttriggeredAt: \"2026-05-31T16:40:05Z\",\n\t\ttimeInQueueMs: 120,\n\t\tstartedAt: \"2026-05-31T16:40:05Z\",\n\t\tfinishedAt: \"2026-05-31T16:40:18Z\",\n\t\tdurationMs: 13e3,\n\t\ttriggerLabel: \"Webhook\",\n\t\ttriggerRaw: \"webhook\",\n\t\tranAs: MOCK_ACTOR,\n\t\tmodelsUsed: [\"Claude Opus 4.8\"],\n\t\totherServicesUsed: [\"Gmail\"],\n\t\ttotalCostUsd: .021,\n\t\tstepCount: 2\n\t},\n\t{\n\t\tid: \"run-research-agent-003\",\n\t\tkind: \"agent\",\n\t\ttraceId: \"run-research-agent-003\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tprojectName: historyProjectNameById.project_personal_repo ?? \"Project\",\n\t\tresourceKey: agentKeyFromId(\"agent-research\"),\n\t\tresourceId: \"agent-research\",\n\t\tresourceName: \"Research Agent\",\n\t\tstatus: \"completed\",\n\t\ttriggeredAt: \"2026-06-01T09:15:00Z\",\n\t\ttimeInQueueMs: 210,\n\t\tstartedAt: \"2026-06-01T09:15:00Z\",\n\t\tfinishedAt: \"2026-06-01T09:16:24Z\",\n\t\tdurationMs: 84e3,\n\t\ttriggerLabel: \"API\",\n\t\ttriggerRaw: \"api\",\n\t\tranAs: MOCK_ACTOR,\n\t\tmodelsUsed: [\"Claude Opus 4.8\"],\n\t\totherServicesUsed: [\"Exa\"],\n\t\ttotalCostUsd: .603,\n\t\tmessageCount: 12\n\t}\n];\nconst historyRunById = Object.fromEntries(historyRunSeed.map((run) => [run.id, run]));\n/** Resolve a seed run by id so fixtures stay consistent if the seed is reordered. */\nfunction runById(id) {\n\tconst run = historyRunById[id];\n\tif (!run) throw new Error(`Unknown history run: ${id}`);\n\treturn run;\n}\nlet historyRuns = historyRunSeed.map((run) => ({ ...run }));\nconst historyRunStatusOverrides = /* @__PURE__ */ new Map();\nfunction listHistoryRuns() {\n\treturn historyRuns;\n}\n/**\n* Cancel a running/queued run. Terminal runs are returned unchanged. Updates the\n* list row and records an override so {@link getHistoryRunDetail} stays in sync.\n*/\nfunction cancelHistoryRun(runId) {\n\tconst run = historyRuns.find((entry) => entry.id === runId);\n\tif (!run) return null;\n\tif (run.status !== \"running\" && run.status !== \"pending\") return run;\n\tconst finishedAt = (/* @__PURE__ */ new Date()).toISOString();\n\tconst durationMs = run.startedAt ? Math.max(0, new Date(finishedAt).getTime() - new Date(run.startedAt).getTime()) : run.durationMs;\n\tconst canceled = {\n\t\t...run,\n\t\tstatus: \"canceled\",\n\t\tfinishedAt,\n\t\tdurationMs\n\t};\n\thistoryRuns = historyRuns.map((entry) => entry.id === runId ? canceled : entry);\n\thistoryRunStatusOverrides.set(runId, {\n\t\tstatus: \"canceled\",\n\t\tfinishedAt\n\t});\n\treturn canceled;\n}\nfunction buildSupportAgentTrace(runId, failed) {\n\tconst run = runById(runId);\n\tconst startedAt = run.startedAt;\n\tconst finishedAt = run.finishedAt ?? run.startedAt;\n\tconst sessionSpanId = `span-session-${runId}`;\n\treturn {\n\t\ttraceId: runId,\n\t\ttrigger: {\n\t\t\ttriggerType: \"gateway\",\n\t\t\ttriggerRunId: `trigger-${runId}`,\n\t\t\tagentKey: \"support-agent\",\n\t\t\tattachmentId: \"attach-slack-incoming\",\n\t\t\tattachmentKey: \"slack-incoming\",\n\t\t\troute: \"/agents/support-agent\",\n\t\t\tsourcePath: \"src/triggers/slack-message.ts\"\n\t\t},\n\t\tgateway: {\n\t\t\tgatewayAttachmentId: \"attach-slack-incoming\",\n\t\t\tgatewayAttachmentKey: \"slack-incoming\",\n\t\t\tthreadId: \"C01234567\",\n\t\t\tchannelId: \"support-escalations\",\n\t\t\tmode: \"thread\"\n\t\t},\n\t\tspans: [{\n\t\t\tid: sessionSpanId,\n\t\t\ttraceId: runId,\n\t\t\tparentSpanId: null,\n\t\t\tkind: \"agent_session\",\n\t\t\trefId: runId,\n\t\t\tname: \"Support Agent\",\n\t\t\tstatus: failed ? \"error\" : \"ok\",\n\t\t\tstartedAt,\n\t\t\tfinishedAt,\n\t\t\tmetadata: { messageCount: failed ? 2 : 8 },\n\t\t\terror: failed ? { message: \"Credential expired\" } : null\n\t\t}, {\n\t\t\tid: `span-tool-${runId}`,\n\t\t\ttraceId: runId,\n\t\t\tparentSpanId: sessionSpanId,\n\t\t\tkind: \"tool_call\",\n\t\t\trefId: `tool-${runId}`,\n\t\t\tname: \"post_slack_reply\",\n\t\t\tstatus: failed ? \"error\" : \"ok\",\n\t\t\tstartedAt,\n\t\t\tfinishedAt,\n\t\t\tmetadata: null,\n\t\t\terror: failed ? { message: \"oauth_token_expired\" } : null\n\t\t}],\n\t\tlogs: [{\n\t\t\tid: `log-${runId}-1`,\n\t\t\ttraceId: runId,\n\t\t\tspanId: sessionSpanId,\n\t\t\tseq: 1,\n\t\t\tlevel: \"info\",\n\t\t\tmessage: failed ? \"Received Slack message\" : \"Session started from gateway thread\",\n\t\t\tdata: null,\n\t\t\tsource: \"system\",\n\t\t\tcreatedAt: startedAt\n\t\t}, {\n\t\t\tid: `log-${runId}-2`,\n\t\t\ttraceId: runId,\n\t\t\tspanId: sessionSpanId,\n\t\t\tseq: 2,\n\t\t\tlevel: failed ? \"error\" : \"info\",\n\t\t\tmessage: failed ? \"Credential expired before response could be posted.\" : \"Drafted three support replies.\",\n\t\t\tdata: null,\n\t\t\tsource: \"system\",\n\t\t\tcreatedAt: finishedAt\n\t\t}]\n\t};\n}\nfunction buildDailyDigestTrace() {\n\treturn {\n\t\ttraceId: \"run-daily-digest-001\",\n\t\ttrigger: {\n\t\t\ttriggerType: \"cron\",\n\t\t\ttriggerRunId: \"trigger-daily-digest-001\",\n\t\t\tworkflowKey: \"daily-digest\",\n\t\t\tattachmentId: \"attach-schedule-daily\",\n\t\t\tattachmentKey: \"schedule-daily\",\n\t\t\troute: \"/workflows/daily-digest\",\n\t\t\tsourcePath: \"src/triggers/daily-digest.ts\"\n\t\t},\n\t\tgateway: null,\n\t\tspans: [{\n\t\t\tid: \"span-wf-daily-001\",\n\t\t\ttraceId: \"run-daily-digest-001\",\n\t\t\tparentSpanId: null,\n\t\t\tkind: \"workflow_run\",\n\t\t\trefId: \"run-daily-digest-001\",\n\t\t\tname: \"Daily Digest\",\n\t\t\tstatus: \"running\",\n\t\t\tstartedAt: \"2026-04-20T15:12:00Z\",\n\t\t\tfinishedAt: null,\n\t\t\tmetadata: null,\n\t\t\terror: null\n\t\t}, {\n\t\t\tid: \"span-action-collect\",\n\t\t\ttraceId: \"run-daily-digest-001\",\n\t\t\tparentSpanId: \"span-wf-daily-001\",\n\t\t\tkind: \"action\",\n\t\t\trefId: \"step-collect\",\n\t\t\tname: \"collect_updates\",\n\t\t\tstatus: \"ok\",\n\t\t\tstartedAt: \"2026-04-20T15:12:02Z\",\n\t\t\tfinishedAt: \"2026-04-20T15:12:45Z\",\n\t\t\tmetadata: {\n\t\t\t\trunId: \"run-daily-digest-001\",\n\t\t\t\tactionKey: \"collect_updates\"\n\t\t\t},\n\t\t\terror: null\n\t\t}],\n\t\tlogs: [{\n\t\t\tid: \"log-daily-1\",\n\t\t\ttraceId: \"run-daily-digest-001\",\n\t\t\tspanId: \"span-wf-daily-001\",\n\t\t\tseq: 1,\n\t\t\tlevel: \"info\",\n\t\t\tmessage: \"Cron tick fired\",\n\t\t\tdata: null,\n\t\t\tsource: \"system\",\n\t\t\tcreatedAt: \"2026-04-20T15:12:00Z\"\n\t\t}, {\n\t\t\tid: \"log-daily-2\",\n\t\t\ttraceId: \"run-daily-digest-001\",\n\t\t\tspanId: \"span-wf-daily-001\",\n\t\t\tseq: 2,\n\t\t\tlevel: \"info\",\n\t\t\tmessage: \"Collecting project updates.\",\n\t\t\tdata: null,\n\t\t\tsource: \"console\",\n\t\t\tcreatedAt: \"2026-04-20T15:12:46Z\"\n\t\t}]\n\t};\n}\nfunction buildEmailTriageDetail() {\n\treturn {\n\t\tkind: \"workflow\",\n\t\trun: {\n\t\t\tid: \"run-email-triage-002\",\n\t\t\tworkflowKey: \"email-triage\",\n\t\t\tstatus: \"failed\",\n\t\t\ttrigger: \"webhook\",\n\t\t\ttriggeredAt: \"2026-05-31T16:40:05Z\",\n\t\t\tstartedAt: \"2026-05-31T16:40:05Z\",\n\t\t\tfinishedAt: \"2026-05-31T16:40:18Z\",\n\t\t\tinput: { messageId: \"msg_abc123\" },\n\t\t\toutput: null,\n\t\t\terror: { message: \"Step classify failed: missing Gmail scope.\" }\n\t\t},\n\t\ttrigger: {\n\t\t\tid: \"trigger-email-002\",\n\t\t\tattachmentKey: \"gmail-new-message\",\n\t\t\ttriggerType: \"webhook\",\n\t\t\tsourcePath: \"src/triggers/gmail-new-message.ts\",\n\t\t\tpayload: { messageId: \"msg_abc123\" },\n\t\t\ttriggeredAt: \"2026-05-31T16:40:05Z\"\n\t\t},\n\t\tsteps: [{\n\t\t\tid: \"step-ingest-002\",\n\t\t\tactionKey: \"ingest\",\n\t\t\toutput: { ok: true },\n\t\t\tcompletedAt: \"2026-05-31T16:40:10Z\"\n\t\t}, {\n\t\t\tid: \"step-classify-002\",\n\t\t\tactionKey: \"classify\",\n\t\t\toutput: { error: \"missing_scope\" },\n\t\t\tcompletedAt: \"2026-05-31T16:40:18Z\"\n\t\t}],\n\t\ttrace: {\n\t\t\ttraceId: \"run-email-triage-002\",\n\t\t\ttrigger: {\n\t\t\t\ttriggerType: \"webhook\",\n\t\t\t\ttriggerRunId: \"trigger-email-002\",\n\t\t\t\tworkflowKey: \"email-triage\",\n\t\t\t\tattachmentId: \"attach-gmail-new-message\",\n\t\t\t\tattachmentKey: \"gmail-new-message\",\n\t\t\t\troute: \"/workflows/email-triage\"\n\t\t\t},\n\t\t\tgateway: null,\n\t\t\tspans: [{\n\t\t\t\tid: \"span-wf-email-002\",\n\t\t\t\ttraceId: \"run-email-triage-002\",\n\t\t\t\tparentSpanId: null,\n\t\t\t\tkind: \"workflow_run\",\n\t\t\t\trefId: \"run-email-triage-002\",\n\t\t\t\tname: \"Email Triage\",\n\t\t\t\tstatus: \"error\",\n\t\t\t\tstartedAt: \"2026-05-31T16:40:05Z\",\n\t\t\t\tfinishedAt: \"2026-05-31T16:40:18Z\",\n\t\t\t\tmetadata: null,\n\t\t\t\terror: { message: \"Step classify failed\" }\n\t\t\t}],\n\t\t\tlogs: [{\n\t\t\t\tid: \"log-email-1\",\n\t\t\t\ttraceId: \"run-email-triage-002\",\n\t\t\t\tspanId: \"span-wf-email-002\",\n\t\t\t\tseq: 1,\n\t\t\t\tlevel: \"error\",\n\t\t\t\tmessage: \"Step classify failed: missing Gmail scope.\",\n\t\t\t\tdata: { step: \"classify\" },\n\t\t\t\tsource: \"system\",\n\t\t\t\tcreatedAt: \"2026-05-31T16:40:18Z\"\n\t\t\t}]\n\t\t},\n\t\tranAs: MOCK_ACTOR,\n\t\tusage: buildFailedUsage(13e3)\n\t};\n}\nconst historyDetailById = {\n\t\"run-support-agent-001\": {\n\t\tkind: \"agent\",\n\t\tsession: {\n\t\t\tid: \"run-support-agent-001\",\n\t\t\tagentKey: \"support-agent\",\n\t\t\tstatus: \"completed\",\n\t\t\tsource: \"gateway\",\n\t\t\tsourceId: \"gw-slack-incoming\",\n\t\t\tcreatedAt: \"2026-04-20T15:44:00Z\",\n\t\t\tupdatedAt: \"2026-04-20T15:44:42Z\",\n\t\t\tmessageCount: 8,\n\t\t\terror: null\n\t\t},\n\t\tgateway: {\n\t\t\tthreadId: \"C01234567\",\n\t\t\tattachmentKey: \"slack-incoming\"\n\t\t},\n\t\tmessages: [{\n\t\t\trole: \"user\",\n\t\t\tcontent: \"Customer asked about billing cycle.\"\n\t\t}, {\n\t\t\trole: \"assistant\",\n\t\t\tcontent: \"Drafted reply with prorated credit explanation.\"\n\t\t}],\n\t\ttrace: buildSupportAgentTrace(\"run-support-agent-001\", false),\n\t\tranAs: MOCK_ACTOR,\n\t\tusage: buildCompletedUsage(42e3)\n\t},\n\t\"run-support-agent-000\": {\n\t\tkind: \"agent\",\n\t\tsession: {\n\t\t\tid: \"run-support-agent-000\",\n\t\t\tagentKey: \"support-agent\",\n\t\t\tstatus: \"failed\",\n\t\t\tsource: \"gateway\",\n\t\t\tsourceId: \"gw-slack-incoming\",\n\t\t\tcreatedAt: \"2026-04-19T18:22:00Z\",\n\t\t\tupdatedAt: \"2026-04-19T18:22:12Z\",\n\t\t\tmessageCount: 2,\n\t\t\terror: { message: \"Credential expired\" }\n\t\t},\n\t\tgateway: {\n\t\t\tthreadId: \"C09876543\",\n\t\t\tattachmentKey: \"slack-incoming\"\n\t\t},\n\t\tmessages: [{\n\t\t\trole: \"user\",\n\t\t\tcontent: \"Urgent refund request in #support.\"\n\t\t}],\n\t\ttrace: buildSupportAgentTrace(\"run-support-agent-000\", true),\n\t\tranAs: MOCK_ACTOR,\n\t\tusage: buildFailedUsage(12e3)\n\t},\n\t\"run-daily-digest-001\": {\n\t\tkind: \"workflow\",\n\t\trun: {\n\t\t\tid: \"run-daily-digest-001\",\n\t\t\tworkflowKey: \"daily-digest\",\n\t\t\tstatus: \"running\",\n\t\t\ttrigger: \"cron\",\n\t\t\ttriggeredAt: \"2026-04-20T15:12:00Z\",\n\t\t\tstartedAt: \"2026-04-20T15:12:00Z\",\n\t\t\tfinishedAt: null,\n\t\t\tinput: { date: \"2026-04-20\" },\n\t\t\toutput: null,\n\t\t\terror: null\n\t\t},\n\t\ttrigger: {\n\t\t\tid: \"trigger-daily-digest-001\",\n\t\t\tattachmentKey: \"schedule-daily\",\n\t\t\ttriggerType: \"cron\",\n\t\t\tsourcePath: \"src/triggers/daily-digest.ts\",\n\t\t\tpayload: { schedule: \"0 8 * * *\" },\n\t\t\ttriggeredAt: \"2026-04-20T15:12:00Z\"\n\t\t},\n\t\tsteps: [{\n\t\t\tid: \"step-collect-001\",\n\t\t\tactionKey: \"collect_updates\",\n\t\t\toutput: { projects: 3 },\n\t\t\tcompletedAt: \"2026-04-20T15:12:45Z\"\n\t\t}],\n\t\ttrace: buildDailyDigestTrace(),\n\t\tranAs: MOCK_ACTOR,\n\t\tusage: buildRunningUsage()\n\t},\n\t\"run-email-triage-002\": buildEmailTriageDetail(),\n\t\"run-research-agent-003\": {\n\t\tkind: \"agent\",\n\t\tsession: {\n\t\t\tid: \"run-research-agent-003\",\n\t\t\tagentKey: \"research-agent\",\n\t\t\tstatus: \"completed\",\n\t\t\tsource: \"api\",\n\t\t\tsourceId: null,\n\t\t\tcreatedAt: \"2026-06-01T09:15:00Z\",\n\t\t\tupdatedAt: \"2026-06-01T09:16:24Z\",\n\t\t\tmessageCount: 12,\n\t\t\terror: null\n\t\t},\n\t\tgateway: null,\n\t\tmessages: [{\n\t\t\trole: \"user\",\n\t\t\tcontent: \"Summarize the Q2 roadmap doc.\"\n\t\t}, {\n\t\t\trole: \"assistant\",\n\t\t\tcontent: \"Found 4 themes: platform, agents, billing, design.\"\n\t\t}],\n\t\ttrace: {\n\t\t\ttraceId: \"run-research-agent-003\",\n\t\t\ttrigger: {\n\t\t\t\ttriggerType: \"api\",\n\t\t\t\ttriggerRunId: \"trigger-research-003\",\n\t\t\t\tagentKey: \"research-agent\",\n\t\t\t\troute: \"/agents/research-agent\"\n\t\t\t},\n\t\t\tgateway: null,\n\t\t\tspans: [{\n\t\t\t\tid: \"span-research-003\",\n\t\t\t\ttraceId: \"run-research-agent-003\",\n\t\t\t\tparentSpanId: null,\n\t\t\t\tkind: \"agent_session\",\n\t\t\t\trefId: \"run-research-agent-003\",\n\t\t\t\tname: \"Research Agent\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\tstartedAt: \"2026-06-01T09:15:00Z\",\n\t\t\t\tfinishedAt: \"2026-06-01T09:16:24Z\",\n\t\t\t\tmetadata: { messageCount: 12 },\n\t\t\t\terror: null\n\t\t\t}],\n\t\t\tlogs: [{\n\t\t\t\tid: \"log-research-1\",\n\t\t\t\ttraceId: \"run-research-agent-003\",\n\t\t\t\tspanId: \"span-research-003\",\n\t\t\t\tseq: 1,\n\t\t\t\tlevel: \"info\",\n\t\t\t\tmessage: \"Summarized 4 documents and returned citations.\",\n\t\t\t\tdata: null,\n\t\t\t\tsource: \"system\",\n\t\t\t\tcreatedAt: \"2026-06-01T09:16:24Z\"\n\t\t\t}]\n\t\t},\n\t\tranAs: MOCK_ACTOR,\n\t\tusage: buildCompletedUsage(84e3)\n\t}\n};\nfunction applyRunStatusOverride(detail, override) {\n\tif (detail.kind === \"workflow\") return {\n\t\t...detail,\n\t\trun: {\n\t\t\t...detail.run,\n\t\t\tstatus: override.status,\n\t\t\tfinishedAt: override.finishedAt\n\t\t}\n\t};\n\treturn {\n\t\t...detail,\n\t\tsession: {\n\t\t\t...detail.session,\n\t\t\tstatus: override.status,\n\t\t\tupdatedAt: override.finishedAt ?? detail.session.updatedAt\n\t\t}\n\t};\n}\nfunction getHistoryRunDetail(runId) {\n\tconst detail = historyDetailById[runId];\n\tif (!detail) return null;\n\tconst override = historyRunStatusOverrides.get(runId);\n\treturn override ? applyRunStatusOverride(detail, override) : detail;\n}\n//#endregion\n//#region src/platform/resources/mock-history-resource.ts\nfunction createHistoryResource() {\n\treturn {\n\t\t/** Runs across projects the current user can access in the active org. */\n\t\tlist: mock({\n\t\t\tdomain: \"history\",\n\t\t\tmethod: \"list\",\n\t\t\tplannedEndpoint: \"GET /api/orgs/:orgSlug/history\"\n\t\t}, async () => [...listHistoryRuns()].sort((a, b) => new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime())),\n\t\tget: mock({\n\t\t\tdomain: \"history\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/orgs/:orgSlug/history/:runId\"\n\t\t}, async (runId) => getHistoryRunDetail(runId)),\n\t\t/** Cancel a running/queued run. Returns the updated run (or null if unknown). */\n\t\tcancel: mock({\n\t\t\tdomain: \"history\",\n\t\t\tmethod: \"cancel\",\n\t\t\tplannedEndpoint: \"POST /api/orgs/:orgSlug/history/:runId/cancel\"\n\t\t}, async (runId) => cancelHistoryRun(runId))\n\t};\n}\n//#endregion\n//#region src/platform/resources/mock-organization-sidebar-branding.ts\nconst MOCK_STORAGE_KEY$3 = \"keystroke:mock-organization-sidebar-branding:v1\";\nfunction getBrowserLocalStorage$3() {\n\tif (typeof globalThis !== \"object\") return null;\n\treturn globalThis.localStorage ?? null;\n}\nconst DEFAULT_ORGANIZATION_SIDEBAR_BRANDING = {\n\tcustomSidebarLogoEnabled: false,\n\tcustomSidebarLogoExplicitlyDisabled: false,\n\tsidebarLogoLightDataUrl: null,\n\tsidebarLogoDarkDataUrl: null,\n\tsidebarLogoHeightPx: 20\n};\nfunction normalizeSidebarLogoDataUrl(value) {\n\tif (typeof value !== \"string\" || !value.startsWith(\"data:image/\")) return null;\n\treturn value;\n}\nfunction normalizeCustomSidebarLogoEnabled(value, branding) {\n\tconst hasCustomLogo = Boolean(normalizeSidebarLogoDataUrl(branding.sidebarLogoLightDataUrl) || normalizeSidebarLogoDataUrl(branding.sidebarLogoDarkDataUrl));\n\tif (branding.customSidebarLogoExplicitlyDisabled === true) return false;\n\tif (typeof value === \"boolean\") return value || hasCustomLogo;\n\treturn hasCustomLogo;\n}\nfunction normalizeSidebarLogoHeightPx(value) {\n\tif (typeof value !== \"number\" || !Number.isFinite(value)) return DEFAULT_ORGANIZATION_SIDEBAR_BRANDING.sidebarLogoHeightPx;\n\treturn Math.min(32, Math.max(14, Math.round(value)));\n}\nfunction normalizeOrganizationSidebarBranding(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_ORGANIZATION_SIDEBAR_BRANDING;\n\tconst branding = value;\n\treturn {\n\t\tcustomSidebarLogoEnabled: normalizeCustomSidebarLogoEnabled(branding.customSidebarLogoEnabled, branding),\n\t\tcustomSidebarLogoExplicitlyDisabled: branding.customSidebarLogoExplicitlyDisabled === true,\n\t\tsidebarLogoLightDataUrl: normalizeSidebarLogoDataUrl(branding.sidebarLogoLightDataUrl),\n\t\tsidebarLogoDarkDataUrl: normalizeSidebarLogoDataUrl(branding.sidebarLogoDarkDataUrl),\n\t\tsidebarLogoHeightPx: normalizeSidebarLogoHeightPx(branding.sidebarLogoHeightPx)\n\t};\n}\nfunction mergeOrganizationSidebarBranding(current, patch) {\n\treturn normalizeOrganizationSidebarBranding({\n\t\t...current,\n\t\t...patch\n\t});\n}\nfunction readBrandingStore() {\n\tconst localStorage = getBrowserLocalStorage$3();\n\tif (!localStorage) return {};\n\ttry {\n\t\tconst raw = localStorage.getItem(MOCK_STORAGE_KEY$3);\n\t\tif (!raw) return {};\n\t\tconst parsed = JSON.parse(raw);\n\t\tif (!parsed || typeof parsed !== \"object\") return {};\n\t\treturn Object.fromEntries(Object.entries(parsed).map(([organizationId, value]) => [organizationId, normalizeOrganizationSidebarBranding(value)]));\n\t} catch {\n\t\treturn {};\n\t}\n}\nfunction writeBrandingStore(store) {\n\tconst localStorage = getBrowserLocalStorage$3();\n\tif (!localStorage) return;\n\ttry {\n\t\tlocalStorage.setItem(MOCK_STORAGE_KEY$3, JSON.stringify(store));\n\t} catch {}\n}\nfunction resolveOrganizationId(getActiveOrganizationId) {\n\tconst organizationId = getActiveOrganizationId()?.trim();\n\tif (!organizationId) throw new Error(\"Organization sidebar branding requires an active organization\");\n\treturn organizationId;\n}\nfunction createOrganizationSidebarBrandingResource(options) {\n\treturn {\n\t\tget: mock({\n\t\t\tdomain: \"organizationSidebarBranding\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/organizations/active/branding\"\n\t\t}, async () => {\n\t\t\tconst organizationId = resolveOrganizationId(options.getActiveOrganizationId ?? (() => null));\n\t\t\treturn readBrandingStore()[organizationId] ?? DEFAULT_ORGANIZATION_SIDEBAR_BRANDING;\n\t\t}),\n\t\tupdate: mock({\n\t\t\tdomain: \"organizationSidebarBranding\",\n\t\t\tmethod: \"update\",\n\t\t\tplannedEndpoint: \"PATCH /api/organizations/active/branding\"\n\t\t}, async (patch) => {\n\t\t\tconst organizationId = resolveOrganizationId(options.getActiveOrganizationId ?? (() => null));\n\t\t\tconst store = readBrandingStore();\n\t\t\tconst next = mergeOrganizationSidebarBranding(store[organizationId] ?? DEFAULT_ORGANIZATION_SIDEBAR_BRANDING, patch);\n\t\t\twriteBrandingStore({\n\t\t\t\t...store,\n\t\t\t\t[organizationId]: next\n\t\t\t});\n\t\t\treturn next;\n\t\t})\n\t};\n}\n//#endregion\n//#region src/platform/resources/mock-user-preferences.ts\nconst MOCK_STORAGE_KEY$2 = \"keystroke:mock-user-preferences:v1\";\nfunction getBrowserLocalStorage$2() {\n\tif (typeof globalThis !== \"object\") return null;\n\treturn globalThis.localStorage ?? null;\n}\nconst DEFAULT_USER_SIDEBAR_PREFERENCES = {\n\tnavIconVisibility: \"visible\",\n\tfooterChatRowVisibility: \"visible\",\n\thiddenNavItemIds: [\"registry\"],\n\ttopNavItemOrderIds: [],\n\tworkspaceNavItemOrderIds: []\n};\nconst DEFAULT_USER_PREFERENCES = {\n\tinterfaceTheme: \"system\",\n\tsurfaceContrast: \"on\",\n\tlayoutMode: \"linear\",\n\tfontSize: \"default\",\n\tsidebar: DEFAULT_USER_SIDEBAR_PREFERENCES,\n\tfavorites: [],\n\tprojectOrderIds: [],\n\tprojectDotColors: {},\n\tonboardingTabVisible: true\n};\nfunction normalizeInterfaceTheme(value) {\n\tif (value === \"light\" || value === \"dark\") return value;\n\treturn \"system\";\n}\nfunction normalizeSurfaceContrast(value) {\n\treturn value === \"off\" ? \"off\" : \"on\";\n}\nfunction normalizeLayoutMode(value) {\n\treturn value === \"default\" ? \"default\" : \"linear\";\n}\nfunction normalizeFontSize(value) {\n\treturn value === \"large\" ? \"large\" : \"default\";\n}\nfunction normalizeStringList(value) {\n\tif (!Array.isArray(value)) return [];\n\treturn Array.from(new Set(value.filter((item) => typeof item === \"string\")));\n}\nfunction normalizeHiddenNavItemIds(value) {\n\tif (!Array.isArray(value)) return DEFAULT_USER_SIDEBAR_PREFERENCES.hiddenNavItemIds;\n\treturn normalizeStringList(value);\n}\nfunction normalizeSidebarPreferences(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_USER_SIDEBAR_PREFERENCES;\n\tconst sidebar = value;\n\treturn {\n\t\tnavIconVisibility: sidebar.navIconVisibility === \"visible\" ? \"visible\" : \"hidden\",\n\t\tfooterChatRowVisibility: sidebar.footerChatRowVisibility === \"hidden\" ? \"hidden\" : \"visible\",\n\t\thiddenNavItemIds: normalizeHiddenNavItemIds(sidebar.hiddenNavItemIds),\n\t\ttopNavItemOrderIds: normalizeStringList(sidebar.topNavItemOrderIds),\n\t\tworkspaceNavItemOrderIds: normalizeStringList(sidebar.workspaceNavItemOrderIds)\n\t};\n}\nfunction isWorkspaceFavoriteKind(value) {\n\treturn value === \"agent\" || value === \"workflow\" || value === \"skill\";\n}\nfunction normalizeFavorites(value) {\n\tif (!Array.isArray(value)) return [];\n\tconst seenKeys = /* @__PURE__ */ new Set();\n\tconst favorites = [];\n\tfor (const item of value) {\n\t\tif (!item || typeof item !== \"object\") continue;\n\t\tconst favorite = item;\n\t\tif (typeof favorite.kind !== \"string\" || !isWorkspaceFavoriteKind(favorite.kind) || typeof favorite.resourceId !== \"string\" || favorite.resourceId.length === 0) continue;\n\t\tconst key = `${favorite.kind}:${favorite.resourceId}`;\n\t\tif (seenKeys.has(key)) continue;\n\t\tseenKeys.add(key);\n\t\tfavorites.push({\n\t\t\tkind: favorite.kind,\n\t\t\tresourceId: favorite.resourceId\n\t\t});\n\t}\n\treturn favorites;\n}\nfunction normalizeProjectDotColors(value) {\n\tif (!value || typeof value !== \"object\" || Array.isArray(value)) return {};\n\treturn Object.fromEntries(Object.entries(value).filter((entry) => typeof entry[0] === \"string\" && typeof entry[1] === \"string\"));\n}\nfunction normalizeOnboardingTabVisible(value) {\n\treturn typeof value === \"boolean\" ? value : DEFAULT_USER_PREFERENCES.onboardingTabVisible;\n}\nfunction normalizeUserPreferences(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_USER_PREFERENCES;\n\tconst preferences = value;\n\treturn {\n\t\tinterfaceTheme: normalizeInterfaceTheme(preferences.interfaceTheme),\n\t\tsurfaceContrast: normalizeSurfaceContrast(preferences.surfaceContrast),\n\t\tlayoutMode: normalizeLayoutMode(preferences.layoutMode),\n\t\tfontSize: normalizeFontSize(preferences.fontSize),\n\t\tsidebar: normalizeSidebarPreferences(preferences.sidebar),\n\t\tfavorites: normalizeFavorites(preferences.favorites),\n\t\tprojectOrderIds: normalizeStringList(preferences.projectOrderIds),\n\t\tprojectDotColors: normalizeProjectDotColors(preferences.projectDotColors),\n\t\tonboardingTabVisible: normalizeOnboardingTabVisible(preferences.onboardingTabVisible)\n\t};\n}\nfunction mergeUserPreferences(current, patch) {\n\treturn normalizeUserPreferences({\n\t\t...current,\n\t\t...patch,\n\t\tsidebar: patch.sidebar ? {\n\t\t\t...current.sidebar,\n\t\t\t...patch.sidebar\n\t\t} : current.sidebar\n\t});\n}\nfunction readPreferencesStore() {\n\tconst localStorage = getBrowserLocalStorage$2();\n\tif (!localStorage) return {};\n\ttry {\n\t\tconst raw = localStorage.getItem(MOCK_STORAGE_KEY$2);\n\t\tif (!raw) return {};\n\t\tconst parsed = JSON.parse(raw);\n\t\tif (!parsed || typeof parsed !== \"object\") return {};\n\t\tconst entries = Object.entries(parsed);\n\t\treturn Object.fromEntries(entries.map(([userId, value]) => [userId, normalizeUserPreferences(value)]));\n\t} catch {\n\t\treturn {};\n\t}\n}\nfunction writePreferencesStore(store) {\n\tconst localStorage = getBrowserLocalStorage$2();\n\tif (!localStorage) return;\n\ttry {\n\t\tlocalStorage.setItem(MOCK_STORAGE_KEY$2, JSON.stringify(store));\n\t} catch {}\n}\nfunction resolveUserId$1(getCurrentUserId) {\n\tconst userId = getCurrentUserId()?.trim();\n\tif (!userId) throw new Error(\"User preferences require an authenticated user\");\n\treturn userId;\n}\nfunction createUserPreferencesResource(options) {\n\treturn {\n\t\tget: mock({\n\t\t\tdomain: \"userPreferences\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/account/preferences\"\n\t\t}, async () => {\n\t\t\tconst userId = resolveUserId$1(options.getCurrentUserId ?? (() => null));\n\t\t\treturn readPreferencesStore()[userId] ?? DEFAULT_USER_PREFERENCES;\n\t\t}),\n\t\tupdate: mock({\n\t\t\tdomain: \"userPreferences\",\n\t\t\tmethod: \"update\",\n\t\t\tplannedEndpoint: \"PATCH /api/account/preferences\"\n\t\t}, async (patch) => {\n\t\t\tconst userId = resolveUserId$1(options.getCurrentUserId ?? (() => null));\n\t\t\tconst store = readPreferencesStore();\n\t\t\tconst next = mergeUserPreferences(store[userId] ?? DEFAULT_USER_PREFERENCES, patch);\n\t\t\twritePreferencesStore({\n\t\t\t\t...store,\n\t\t\t\t[userId]: next\n\t\t\t});\n\t\t\treturn next;\n\t\t})\n\t};\n}\n//#endregion\n//#region src/platform/resources/mock-user-avatar.ts\nconst DEFAULT_USER_AVATAR = { dataUrl: null };\nconst MOCK_STORAGE_KEY$1 = \"keystroke:mock-user-avatar:v1\";\nfunction getBrowserLocalStorage$1() {\n\tif (typeof globalThis !== \"object\") return null;\n\treturn globalThis.localStorage ?? null;\n}\nfunction normalizeUserAvatar(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_USER_AVATAR;\n\tconst dataUrl = value.dataUrl;\n\treturn { dataUrl: typeof dataUrl === \"string\" && dataUrl.length > 0 ? dataUrl : null };\n}\nfunction readAvatarStore() {\n\tconst localStorage = getBrowserLocalStorage$1();\n\tif (!localStorage) return {};\n\ttry {\n\t\tconst raw = localStorage.getItem(MOCK_STORAGE_KEY$1);\n\t\tif (!raw) return {};\n\t\tconst parsed = JSON.parse(raw);\n\t\tif (!parsed || typeof parsed !== \"object\") return {};\n\t\treturn Object.fromEntries(Object.entries(parsed).map(([userId, value]) => [userId, normalizeUserAvatar(value)]));\n\t} catch {\n\t\treturn {};\n\t}\n}\nfunction writeAvatarStore(store) {\n\tconst localStorage = getBrowserLocalStorage$1();\n\tif (!localStorage) return;\n\ttry {\n\t\tlocalStorage.setItem(MOCK_STORAGE_KEY$1, JSON.stringify(store));\n\t} catch {}\n}\nfunction resolveUserId(getCurrentUserId) {\n\tconst userId = getCurrentUserId()?.trim();\n\tif (!userId) throw new Error(\"User avatar requires an authenticated user\");\n\treturn userId;\n}\nfunction createUserAvatarResource(options) {\n\treturn {\n\t\tget: mock({\n\t\t\tdomain: \"userAvatar\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/account/avatar\"\n\t\t}, async () => {\n\t\t\tconst userId = resolveUserId(options.getCurrentUserId ?? (() => null));\n\t\t\treturn readAvatarStore()[userId] ?? DEFAULT_USER_AVATAR;\n\t\t}),\n\t\tupdate: mock({\n\t\t\tdomain: \"userAvatar\",\n\t\t\tmethod: \"update\",\n\t\t\tplannedEndpoint: \"PATCH /api/account/avatar\"\n\t\t}, async (patch) => {\n\t\t\tconst userId = resolveUserId(options.getCurrentUserId ?? (() => null));\n\t\t\tconst store = readAvatarStore();\n\t\t\tconst next = normalizeUserAvatar({ dataUrl: patch.dataUrl });\n\t\t\twriteAvatarStore({\n\t\t\t\t...store,\n\t\t\t\t[userId]: next\n\t\t\t});\n\t\t\treturn next;\n\t\t})\n\t};\n}\n//#endregion\n//#region src/platform/resources/mock-channels.ts\nconst CHANNEL_PLATFORMS = [\n\t{\n\t\tkey: \"slack\",\n\t\tname: \"Slack\",\n\t\tappLogoId: \"slack\",\n\t\tfallbackDomain: \"slack.com\",\n\t\tdescription: \"Connect a Slack workspace so this agent can respond in channels, threads, and DMs.\",\n\t\ttagline: \"Respond in channels, threads, and DMs.\",\n\t\tauthKind: \"oauth\",\n\t\tcredentialFields: [],\n\t\tcapabilities: {\n\t\t\tmentions: true,\n\t\t\treactions: \"full\",\n\t\t\tcards: \"full\",\n\t\t\tmodals: true,\n\t\t\tstreaming: \"native\",\n\t\t\tdms: true\n\t\t},\n\t\tsupportedModes: [\n\t\t\t\"mention\",\n\t\t\t\"all\",\n\t\t\t\"dm\"\n\t\t],\n\t\tresourceNoun: {\n\t\t\tsingular: \"channel\",\n\t\t\tplural: \"channels\"\n\t\t},\n\t\twebhookPathHint: \"/gateways/slack\",\n\t\tsupportsChannelDirectory: true,\n\t\tdocsUrl: \"https://chat-sdk.dev/adapters/official/slack\"\n\t},\n\t{\n\t\tkey: \"discord\",\n\t\tname: \"Discord\",\n\t\tappLogoId: \"discord\",\n\t\tfallbackDomain: \"discord.com\",\n\t\tdescription: \"Connect a Discord application so this agent can respond in servers and channels.\",\n\t\ttagline: \"Respond in servers and channels.\",\n\t\tauthKind: \"credentials\",\n\t\tcredentialFields: [\n\t\t\t{\n\t\t\t\tkey: \"botToken\",\n\t\t\t\tlabel: \"Bot token\",\n\t\t\t\tplaceholder: \"Bot token from the Discord developer portal\",\n\t\t\t\thelpText: \"Bot → Reset Token. Shown only once.\",\n\t\t\t\ttype: \"password\",\n\t\t\t\trequired: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: \"applicationId\",\n\t\t\t\tlabel: \"Application ID\",\n\t\t\t\tplaceholder: \"Application ID\",\n\t\t\t\ttype: \"text\",\n\t\t\t\trequired: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: \"publicKey\",\n\t\t\t\tlabel: \"Public key\",\n\t\t\t\tplaceholder: \"Public key\",\n\t\t\t\thelpText: \"General Information → Public Key, used to verify interactions.\",\n\t\t\t\ttype: \"text\",\n\t\t\t\trequired: true\n\t\t\t}\n\t\t],\n\t\tcapabilities: {\n\t\t\tmentions: true,\n\t\t\treactions: \"full\",\n\t\t\tcards: \"full\",\n\t\t\tmodals: false,\n\t\t\tstreaming: \"post-edit\",\n\t\t\tdms: true\n\t\t},\n\t\tsupportedModes: [\n\t\t\t\"mention\",\n\t\t\t\"all\",\n\t\t\t\"dm\"\n\t\t],\n\t\tresourceNoun: {\n\t\t\tsingular: \"channel\",\n\t\t\tplural: \"channels\"\n\t\t},\n\t\twebhookPathHint: \"/gateways/discord\",\n\t\tsupportsChannelDirectory: true,\n\t\tdocsUrl: \"https://chat-sdk.dev/adapters/official/discord\"\n\t},\n\t{\n\t\tkey: \"telegram\",\n\t\tname: \"Telegram\",\n\t\tappLogoId: \"telegram\",\n\t\tfallbackDomain: \"telegram.org\",\n\t\tdescription: \"Connect a Telegram bot so this agent can respond in chats and groups.\",\n\t\ttagline: \"Respond in chats and groups.\",\n\t\tauthKind: \"bot-token\",\n\t\tcredentialFields: [{\n\t\t\tkey: \"botToken\",\n\t\t\tlabel: \"Bot token\",\n\t\t\tplaceholder: \"123456:ABC-DEF…\",\n\t\t\thelpText: \"Create a bot with @BotFather and paste its token.\",\n\t\t\ttype: \"password\",\n\t\t\trequired: true\n\t\t}, {\n\t\t\tkey: \"botUsername\",\n\t\t\tlabel: \"Bot username\",\n\t\t\tplaceholder: \"my_agent_bot\",\n\t\t\ttype: \"text\",\n\t\t\trequired: false,\n\t\t\tprefix: \"@\"\n\t\t}],\n\t\tcapabilities: {\n\t\t\tmentions: true,\n\t\t\treactions: \"full\",\n\t\t\tcards: \"partial\",\n\t\t\tmodals: false,\n\t\t\tstreaming: \"drafts\",\n\t\t\tdms: true\n\t\t},\n\t\tsupportedModes: [\n\t\t\t\"mention\",\n\t\t\t\"all\",\n\t\t\t\"dm\"\n\t\t],\n\t\tresourceNoun: {\n\t\t\tsingular: \"chat\",\n\t\t\tplural: \"chats\"\n\t\t},\n\t\twebhookPathHint: \"/gateways/telegram\",\n\t\tsupportsChannelDirectory: false,\n\t\tdocsUrl: \"https://chat-sdk.dev/adapters/official/telegram\"\n\t},\n\t{\n\t\tkey: \"microsoft-teams\",\n\t\tname: \"Microsoft Teams\",\n\t\tappLogoId: \"microsoft-teams\",\n\t\tfallbackDomain: \"teams.microsoft.com\",\n\t\tdescription: \"Connect a Microsoft Teams app so this agent can respond in channels and chats.\",\n\t\ttagline: \"Respond in channels and chats.\",\n\t\tauthKind: \"credentials\",\n\t\tcredentialFields: [\n\t\t\t{\n\t\t\t\tkey: \"appId\",\n\t\t\t\tlabel: \"App ID\",\n\t\t\t\tplaceholder: \"Azure AD application (client) ID\",\n\t\t\t\ttype: \"text\",\n\t\t\t\trequired: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: \"appPassword\",\n\t\t\t\tlabel: \"App password\",\n\t\t\t\tplaceholder: \"Client secret\",\n\t\t\t\ttype: \"password\",\n\t\t\t\trequired: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: \"tenantId\",\n\t\t\t\tlabel: \"Tenant ID\",\n\t\t\t\tplaceholder: \"Azure AD tenant ID\",\n\t\t\t\ttype: \"text\",\n\t\t\t\trequired: true\n\t\t\t}\n\t\t],\n\t\tcapabilities: {\n\t\t\tmentions: true,\n\t\t\treactions: \"read-only\",\n\t\t\tcards: \"full\",\n\t\t\tmodals: true,\n\t\t\tstreaming: \"buffered\",\n\t\t\tdms: true\n\t\t},\n\t\tsupportedModes: [\n\t\t\t\"mention\",\n\t\t\t\"all\",\n\t\t\t\"dm\"\n\t\t],\n\t\tresourceNoun: {\n\t\t\tsingular: \"channel\",\n\t\t\tplural: \"channels\"\n\t\t},\n\t\twebhookPathHint: \"/gateways/teams\",\n\t\tsupportsChannelDirectory: true,\n\t\tdocsUrl: \"https://chat-sdk.dev/adapters/official/teams\"\n\t},\n\t{\n\t\tkey: \"google-chat\",\n\t\tname: \"Google Chat\",\n\t\tappLogoId: \"google-chat\",\n\t\tfallbackDomain: \"chat.google.com\",\n\t\tdescription: \"Connect a Google Chat app so this agent can respond in spaces and direct messages.\",\n\t\ttagline: \"Respond in spaces and DMs.\",\n\t\tauthKind: \"credentials\",\n\t\tcredentialFields: [{\n\t\t\tkey: \"serviceAccountJson\",\n\t\t\tlabel: \"Service account JSON\",\n\t\t\tplaceholder: \"Paste the service account key JSON\",\n\t\t\thelpText: \"IAM → Service Accounts → Keys → Add key → JSON.\",\n\t\t\ttype: \"textarea\",\n\t\t\trequired: true\n\t\t}, {\n\t\t\tkey: \"projectNumber\",\n\t\t\tlabel: \"GCP project number\",\n\t\t\tplaceholder: \"Project number used to verify webhooks\",\n\t\t\ttype: \"text\",\n\t\t\trequired: true\n\t\t}],\n\t\tcapabilities: {\n\t\t\tmentions: true,\n\t\t\treactions: \"full\",\n\t\t\tcards: \"full\",\n\t\t\tmodals: false,\n\t\t\tstreaming: \"post-edit\",\n\t\t\tdms: true\n\t\t},\n\t\tsupportedModes: [\n\t\t\t\"mention\",\n\t\t\t\"all\",\n\t\t\t\"dm\"\n\t\t],\n\t\tresourceNoun: {\n\t\t\tsingular: \"space\",\n\t\t\tplural: \"spaces\"\n\t\t},\n\t\twebhookPathHint: \"/gateways/gchat\",\n\t\tsupportsChannelDirectory: true,\n\t\tdocsUrl: \"https://chat-sdk.dev/adapters/official/google-chat\"\n\t}\n];\nfunction getChannelPlatform(key) {\n\treturn CHANNEL_PLATFORMS.find((platform) => platform.key === key);\n}\nconst CHANNEL_DIRECTORY = {\n\tslack: [\n\t\t{\n\t\t\tid: \"C0SUPPORT\",\n\t\t\tname: \"support\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 48\n\t\t},\n\t\t{\n\t\t\tid: \"C0GENERAL\",\n\t\t\tname: \"general\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 132\n\t\t},\n\t\t{\n\t\t\tid: \"C0ENG\",\n\t\t\tname: \"engineering\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 27\n\t\t},\n\t\t{\n\t\t\tid: \"C0INCIDENTS\",\n\t\t\tname: \"incidents\",\n\t\t\tkind: \"private\",\n\t\t\tmemberCount: 12\n\t\t},\n\t\t{\n\t\t\tid: \"C0RANDOM\",\n\t\t\tname: \"random\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 118\n\t\t},\n\t\t{\n\t\t\tid: \"C0ARCHIVE\",\n\t\t\tname: \"launch-2025\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 9,\n\t\t\tisArchived: true\n\t\t}\n\t],\n\tdiscord: [\n\t\t{\n\t\t\tid: \"d-general\",\n\t\t\tname: \"general\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 540\n\t\t},\n\t\t{\n\t\t\tid: \"d-help\",\n\t\t\tname: \"help\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 312\n\t\t},\n\t\t{\n\t\t\tid: \"d-dev\",\n\t\t\tname: \"dev\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 76\n\t\t},\n\t\t{\n\t\t\tid: \"d-staff\",\n\t\t\tname: \"staff\",\n\t\t\tkind: \"private\",\n\t\t\tmemberCount: 8\n\t\t}\n\t],\n\ttelegram: [],\n\t\"microsoft-teams\": [\n\t\t{\n\t\t\tid: \"t-general\",\n\t\t\tname: \"General\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 64\n\t\t},\n\t\t{\n\t\t\tid: \"t-support\",\n\t\t\tname: \"Customer Support\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 22\n\t\t},\n\t\t{\n\t\t\tid: \"t-leads\",\n\t\t\tname: \"Leadership\",\n\t\t\tkind: \"private\",\n\t\t\tmemberCount: 6\n\t\t}\n\t],\n\t\"google-chat\": [\n\t\t{\n\t\t\tid: \"spaces/AAA-support\",\n\t\t\tname: \"Support\",\n\t\t\tkind: \"space\",\n\t\t\tmemberCount: 31\n\t\t},\n\t\t{\n\t\t\tid: \"spaces/AAA-eng\",\n\t\t\tname: \"Engineering\",\n\t\t\tkind: \"space\",\n\t\t\tmemberCount: 44\n\t\t},\n\t\t{\n\t\t\tid: \"spaces/AAA-ops\",\n\t\t\tname: \"Ops On-call\",\n\t\t\tkind: \"space\",\n\t\t\tmemberCount: 10\n\t\t}\n\t]\n};\nconst MOCK_STORAGE_KEY = \"keystroke:mock-channels:v1\";\nfunction getBrowserLocalStorage() {\n\tif (typeof globalThis !== \"object\") return null;\n\treturn globalThis.localStorage ?? null;\n}\n/** A connected Slack workspace with two bindings, so the panel is reviewable. */\nfunction seedStore() {\n\treturn { \"agent-support\": [{\n\t\tid: \"chan-conn-slack-support\",\n\t\tplatform: \"slack\",\n\t\tagentId: \"agent-support\",\n\t\taccountLabel: \"Keystroke HQ\",\n\t\taccountId: \"T0KEYSTROKE\",\n\t\tconnectedAt: \"2026-05-28T15:30:00Z\",\n\t\tbindings: [{\n\t\t\tid: \"chan-bind-support\",\n\t\t\tchannelId: \"C0SUPPORT\",\n\t\t\tchannelName: \"support\",\n\t\t\tchannelKind: \"public\",\n\t\t\tmode: \"all\",\n\t\t\tsubscribeOnMention: true,\n\t\t\tcreatedAt: \"2026-05-28T15:31:00Z\",\n\t\t\tupdatedAt: \"2026-05-28T15:31:00Z\"\n\t\t}, {\n\t\t\tid: \"chan-bind-incidents\",\n\t\t\tchannelId: \"C0INCIDENTS\",\n\t\t\tchannelName: \"incidents\",\n\t\t\tchannelKind: \"private\",\n\t\t\tmode: \"mention\",\n\t\t\tsubscribeOnMention: true,\n\t\t\tcreatedAt: \"2026-05-29T09:05:00Z\",\n\t\t\tupdatedAt: \"2026-05-29T09:05:00Z\"\n\t\t}]\n\t}] };\n}\nfunction readStore() {\n\tconst localStorage = getBrowserLocalStorage();\n\tif (!localStorage) return seedStore();\n\ttry {\n\t\tconst raw = localStorage.getItem(MOCK_STORAGE_KEY);\n\t\tif (!raw) {\n\t\t\tconst seeded = seedStore();\n\t\t\tlocalStorage.setItem(MOCK_STORAGE_KEY, JSON.stringify(seeded));\n\t\t\treturn seeded;\n\t\t}\n\t\tconst parsed = JSON.parse(raw);\n\t\tif (!parsed || typeof parsed !== \"object\") return {};\n\t\treturn parsed;\n\t} catch {\n\t\treturn {};\n\t}\n}\nfunction writeStore(store) {\n\tconst localStorage = getBrowserLocalStorage();\n\tif (!localStorage) return;\n\ttry {\n\t\tlocalStorage.setItem(MOCK_STORAGE_KEY, JSON.stringify(store));\n\t} catch {}\n}\nfunction newId(prefix) {\n\tconst cryptoRef = globalThis.crypto;\n\tif (cryptoRef?.randomUUID) return `${prefix}-${cryptoRef.randomUUID()}`;\n\treturn `${prefix}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;\n}\nfunction requireAgentId(agentId) {\n\tconst trimmed = agentId.trim();\n\tif (!trimmed) throw new Error(\"Channels require an agent id\");\n\treturn trimmed;\n}\nfunction clone(value) {\n\treturn JSON.parse(JSON.stringify(value));\n}\nfunction defaultAccountLabel(platform) {\n\tconst meta = getChannelPlatform(platform);\n\treturn meta ? `${meta.name} workspace` : platform;\n}\nfunction findConnection(connections, connectionId) {\n\tconst connection = connections.find((entry) => entry.id === connectionId);\n\tif (!connection) throw new Error(`Channel connection not found: ${connectionId}`);\n\treturn connection;\n}\nfunction toBinding(input, now) {\n\treturn {\n\t\tid: newId(\"chan-bind\"),\n\t\tchannelId: input.channelId,\n\t\tchannelName: input.channelName,\n\t\tchannelKind: input.channelKind ?? \"public\",\n\t\tmode: input.mode ?? \"mention\",\n\t\tsubscribeOnMention: input.subscribeOnMention ?? true,\n\t\tcreatedAt: now,\n\t\tupdatedAt: now\n\t};\n}\nfunction createChannelsResource() {\n\treturn {\n\t\t/** The supported-platform catalog (static; backend may derive from the adapter registry). */\n\t\tlistPlatforms: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"listPlatforms\",\n\t\t\tplannedEndpoint: \"GET /api/channels/platforms\"\n\t\t}, async () => clone(CHANNEL_PLATFORMS)),\n\t\t/** Connections (with their channel bindings) for one agent. */\n\t\tlistForAgent: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"listForAgent\",\n\t\t\tplannedEndpoint: \"GET /api/agents/:agentId/channels\"\n\t\t}, async (agentId) => {\n\t\t\tconst id = requireAgentId(agentId);\n\t\t\treturn clone(readStore()[id] ?? []);\n\t\t}),\n\t\t/**\n\t\t* Channel directory for a platform — the picker source. NET-NEW vs. the\n\t\t* current backend (no channel-list endpoint exists). The runtime team needs\n\t\t* to expose this (e.g. Slack `conversations.list`) for a real picker.\n\t\t*/\n\t\tlistChannels: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"listChannels\",\n\t\t\tplannedEndpoint: \"GET /api/channels/:platform/directory\"\n\t\t}, async (platform) => clone(CHANNEL_DIRECTORY[platform] ?? [])),\n\t\t/** Connect a platform for an agent (OAuth install or credential entry), optionally with a first binding. */\n\t\tconnect: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"connect\",\n\t\t\tplannedEndpoint: \"POST /api/agents/:agentId/channels\"\n\t\t}, async (input) => {\n\t\t\tconst agentId = requireAgentId(input.agentId);\n\t\t\tconst store = readStore();\n\t\t\tconst now = (/* @__PURE__ */ new Date()).toISOString();\n\t\t\tconst connection = {\n\t\t\t\tid: newId(\"chan-conn\"),\n\t\t\t\tplatform: input.platform,\n\t\t\t\tagentId,\n\t\t\t\taccountLabel: input.accountLabel ?? defaultAccountLabel(input.platform),\n\t\t\t\taccountId: newId(\"acct\").toUpperCase(),\n\t\t\t\tconnectedAt: now,\n\t\t\t\tbindings: input.initialBinding ? [toBinding(input.initialBinding, now)] : []\n\t\t\t};\n\t\t\twriteStore({\n\t\t\t\t...store,\n\t\t\t\t[agentId]: [...store[agentId] ?? [], connection]\n\t\t\t});\n\t\t\treturn clone(connection);\n\t\t}),\n\t\t/** Add a channel binding to an existing connection. */\n\t\taddBinding: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"addBinding\",\n\t\t\tplannedEndpoint: \"PUT /gateways/:platform/attachments/:channelId\"\n\t\t}, async (input) => {\n\t\t\tconst agentId = requireAgentId(input.agentId);\n\t\t\tconst store = readStore();\n\t\t\tconst connections = store[agentId] ?? [];\n\t\t\tconst connection = findConnection(connections, input.connectionId);\n\t\t\tconst now = (/* @__PURE__ */ new Date()).toISOString();\n\t\t\tconnection.bindings = [...connection.bindings, toBinding(input.binding, now)];\n\t\t\twriteStore({\n\t\t\t\t...store,\n\t\t\t\t[agentId]: connections\n\t\t\t});\n\t\t\treturn clone(connection);\n\t\t}),\n\t\t/** Update a binding's listen mode / subscribe flag. */\n\t\tupdateBinding: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"updateBinding\",\n\t\t\tplannedEndpoint: \"PUT /gateways/:platform/attachments/:channelId\"\n\t\t}, async (input) => {\n\t\t\tconst agentId = requireAgentId(input.agentId);\n\t\t\tconst store = readStore();\n\t\t\tconst connections = store[agentId] ?? [];\n\t\t\tconst connection = findConnection(connections, input.connectionId);\n\t\t\tconst binding = connection.bindings.find((entry) => entry.id === input.bindingId);\n\t\t\tif (!binding) throw new Error(`Channel binding not found: ${input.bindingId}`);\n\t\t\tif (input.patch.mode !== void 0) binding.mode = input.patch.mode;\n\t\t\tif (input.patch.subscribeOnMention !== void 0) binding.subscribeOnMention = input.patch.subscribeOnMention;\n\t\t\tbinding.updatedAt = (/* @__PURE__ */ new Date()).toISOString();\n\t\t\twriteStore({\n\t\t\t\t...store,\n\t\t\t\t[agentId]: connections\n\t\t\t});\n\t\t\treturn clone(connection);\n\t\t}),\n\t\t/** Remove a channel binding. */\n\t\tremoveBinding: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"removeBinding\",\n\t\t\tplannedEndpoint: \"DELETE /gateways/:platform/attachments/:channelId\"\n\t\t}, async (input) => {\n\t\t\tconst agentId = requireAgentId(input.agentId);\n\t\t\tconst store = readStore();\n\t\t\tconst connections = store[agentId] ?? [];\n\t\t\tconst connection = findConnection(connections, input.connectionId);\n\t\t\tconnection.bindings = connection.bindings.filter((entry) => entry.id !== input.bindingId);\n\t\t\twriteStore({\n\t\t\t\t...store,\n\t\t\t\t[agentId]: connections\n\t\t\t});\n\t\t\treturn clone(connection);\n\t\t}),\n\t\t/** Disconnect the agent from a platform (removes the connection + its bindings). */\n\t\tdisconnect: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"disconnect\",\n\t\t\tplannedEndpoint: \"DELETE /api/agents/:agentId/channels/:connectionId\"\n\t\t}, async (input) => {\n\t\t\tconst agentId = requireAgentId(input.agentId);\n\t\t\tconst store = readStore();\n\t\t\tconst next = (store[agentId] ?? []).filter((entry) => entry.id !== input.connectionId);\n\t\t\twriteStore({\n\t\t\t\t...store,\n\t\t\t\t[agentId]: next\n\t\t\t});\n\t\t})\n\t};\n}\n//#endregion\n//#region src/platform/index.ts\nfunction createPlatformClient(options) {\n\tconst auth = options.auth ?? { type: \"none\" };\n\tconst base = normalizeBaseUrl(options.baseUrl);\n\tlet activeOrganizationId = options.getActiveOrganizationId?.() ?? null;\n\tconst setActiveOrganizationId = (organizationId) => {\n\t\tactiveOrganizationId = organizationId;\n\t\toptions.onActiveOrganizationChange?.(organizationId);\n\t};\n\tconst http = ky.create({\n\t\tprefix: base === \"\" ? void 0 : `${base}/`,\n\t\tcredentials: kyCredentials(auth),\n\t\thooks: { beforeRequest: [({ request }) => {\n\t\t\tapplyActiveOrganizationHeader(request, activeOrganizationId);\n\t\t\treturn applyAuthHeaders(request, auth);\n\t\t}] },\n\t\t...options.ky\n\t});\n\treturn {\n\t\thttp,\n\t\thealth: createHealthResource(http),\n\t\torganizations: createOrganizationsResource(http, {\n\t\t\tonActiveOrganizationChange: setActiveOrganizationId,\n\t\t\tgetActiveOrganizationId: () => activeOrganizationId\n\t\t}),\n\t\tprojects: createProjectsResource(http),\n\t\tartifacts: createArtifactsResource(http),\n\t\tprojectSettings: createProjectSettingsResource(),\n\t\tagents: createAgentsResource(),\n\t\tworkflows: createWorkflowsResource(),\n\t\tskills: createSkillsResource(),\n\t\tapps: createAppsResource(),\n\t\tcredentials: createCredentialsResource(),\n\t\thistory: createHistoryResource(),\n\t\tdeployments: createDeploymentsResource(),\n\t\tprojectMetrics: createProjectMetricsResource(),\n\t\tprojectFiles: createProjectFilesResource(),\n\t\tchannels: createChannelsResource(),\n\t\tmembers: createMembersResource(http),\n\t\tinvitations: createInvitationsResource(http),\n\t\tapiKeys: createApiKeysResource(),\n\t\trecents: createRecentsResource(),\n\t\tuserPreferences: createUserPreferencesResource({ getCurrentUserId: options.getCurrentUserId }),\n\t\tuserAvatar: createUserAvatarResource({ getCurrentUserId: options.getCurrentUserId }),\n\t\torganizationSidebarBranding: createOrganizationSidebarBrandingResource({ getActiveOrganizationId: () => activeOrganizationId }),\n\t\tgetActiveOrganizationId: () => activeOrganizationId,\n\t\tsetActiveOrganizationId\n\t};\n}\n/** Browser client for apps using Better Auth session cookies (e.g. apps/web). */\nfunction createBrowserPlatformClient(options = {}) {\n\treturn createPlatformClient({\n\t\t...options,\n\t\tbaseUrl: options.baseUrl ?? \"\",\n\t\tauth: browserAuthStrategy(),\n\t\tgetActiveOrganizationId: readActiveOrganizationId,\n\t\tonActiveOrganizationChange: writeActiveOrganizationId\n\t});\n}\n//#endregion\nexport { CHANNEL_PLATFORMS, DEFAULT_ORGANIZATION_SIDEBAR_BRANDING, DEFAULT_PROJECT_SETTINGS, DEFAULT_USER_AVATAR, DEFAULT_USER_PREFERENCES, PlatformError, browserAuthStrategy, createBrowserPlatformClient, createPlatformClient, getChannelPlatform, kyCredentials, mergeOrganizationSidebarBranding, mergeProjectSettings, mergeUserPreferences, mockManifest, normalizeBaseUrl, normalizeOrganizationSidebarBranding, normalizeProjectSettings, normalizeUserPreferences, readActiveOrganizationId, toPlatformError, writeActiveOrganizationId };\n\n//# sourceMappingURL=index.mjs.map","import {\n createPlatformClient,\n type AuthStrategy as PlatformAuthStrategy,\n type PlatformClient,\n} from \"@keystrokehq/sdk/platform\";\nimport type { AuthStrategy as CliAuthStrategy } from \"@keystrokehq/sdk\";\nimport type Conf from \"conf\";\n\nimport { resolveCliAuth } from \"./auth/resolve-cli-auth\";\nimport { getPlatformUrl, type CliConfig } from \"./config\";\n\nfunction toPlatformAuth(auth: CliAuthStrategy): PlatformAuthStrategy {\n if (auth.type === \"bearer\") {\n return auth;\n }\n\n if (auth.type === \"apiKey\") {\n return {\n type: \"bearer\",\n getToken: async () => auth.getKey(),\n };\n }\n\n return { type: \"none\" };\n}\n\nexport function createCliPlatformClient(config: Conf<CliConfig>): PlatformClient {\n return createPlatformClient({\n baseUrl: getPlatformUrl(config),\n auth: toPlatformAuth(resolveCliAuth(config)),\n getActiveOrganizationId: () => config.get(\"activeOrganizationId\") ?? null,\n onActiveOrganizationChange: (organizationId) => {\n if (organizationId) {\n config.set(\"activeOrganizationId\", organizationId);\n } else {\n config.delete(\"activeOrganizationId\");\n }\n },\n });\n}\n","import { select } from \"@inquirer/prompts\";\nimport type Conf from \"conf\";\nimport type { UserOrganization } from \"@keystrokehq/shared\";\n\nimport type { CliConfig } from \"../config\";\nimport { getWebUrl } from \"../config\";\nimport { createCliPlatformClient } from \"../platform-client\";\n\nexport type ActivateOrganizationOptions = {\n organizationId?: string;\n};\n\nfunction formatOrganization(membership: UserOrganization): string {\n return `${membership.organization.name} (${membership.role})`;\n}\n\nexport async function listOrganizations(config: Conf<CliConfig>): Promise<UserOrganization[]> {\n const platform = createCliPlatformClient(config);\n return platform.organizations.list();\n}\n\nexport async function activateOrganization(\n config: Conf<CliConfig>,\n organizationId: string,\n): Promise<UserOrganization> {\n const platform = createCliPlatformClient(config);\n const membership = await platform.organizations.setActive({ organizationId });\n platform.setActiveOrganizationId(membership.organization.id);\n return membership;\n}\n\nasync function pickOrganization(\n config: Conf<CliConfig>,\n organizations: UserOrganization[],\n organizationId?: string,\n): Promise<UserOrganization> {\n if (organizationId) {\n const membership = organizations.find((entry) => entry.organization.id === organizationId);\n if (!membership) {\n throw new Error(`Organization ${organizationId} was not found or you do not have access`);\n }\n\n return activateOrganization(config, membership.organization.id);\n }\n\n if (!process.stdin.isTTY) {\n const names = organizations.map((entry) => entry.organization.id).join(\", \");\n throw new Error(\n `Multiple organizations found. Run \\`keystroke config use org <id>\\`. Options: ${names}`,\n );\n }\n\n const selectedId = await select({\n message: \"Select an organization\",\n choices: organizations.map((entry) => ({\n name: formatOrganization(entry),\n value: entry.organization.id,\n })),\n });\n\n return activateOrganization(config, selectedId);\n}\n\nexport async function selectActiveOrganization(\n config: Conf<CliConfig>,\n options: ActivateOrganizationOptions = {},\n): Promise<UserOrganization> {\n const organizations = await listOrganizations(config);\n\n if (organizations.length === 0) {\n throw new Error(`No organization found — create one at ${getWebUrl(config)}`);\n }\n\n if (organizations.length === 1) {\n return activateOrganization(config, organizations[0]!.organization.id);\n }\n\n return pickOrganization(config, organizations, options.organizationId);\n}\n\nexport async function syncActiveOrganizationAfterLogin(\n config: Conf<CliConfig>,\n options: ActivateOrganizationOptions = {},\n): Promise<UserOrganization | null> {\n const organizations = await listOrganizations(config);\n\n if (organizations.length === 0) {\n throw new Error(`No organization found — create one at ${getWebUrl(config)}`);\n }\n\n const storedId = config.get(\"activeOrganizationId\");\n if (storedId && organizations.some((entry) => entry.organization.id === storedId)) {\n const membership = await activateOrganization(config, storedId);\n process.stdout.write(`Using organization ${membership.organization.name}\\n`);\n return membership;\n }\n\n if (organizations.length === 1) {\n const membership = await activateOrganization(config, organizations[0]!.organization.id);\n process.stdout.write(`Using organization ${membership.organization.name}\\n`);\n return membership;\n }\n\n if (options.organizationId) {\n const membership = await pickOrganization(config, organizations, options.organizationId);\n process.stdout.write(`Using organization ${membership.organization.name}\\n`);\n return membership;\n }\n\n const membership = await pickOrganization(config, organizations);\n process.stdout.write(`Using organization ${membership.organization.name}\\n`);\n return membership;\n}\n\nexport async function ensureActiveOrganization(config: Conf<CliConfig>): Promise<void> {\n const storedId = config.get(\"activeOrganizationId\");\n if (storedId) {\n await activateOrganization(config, storedId);\n return;\n }\n\n const organizations = await listOrganizations(config);\n if (organizations.length === 1) {\n await activateOrganization(config, organizations[0]!.organization.id);\n return;\n }\n\n throw new Error(\n \"No active organization. Run `keystroke auth login` or `keystroke config use org`.\",\n );\n}\n","import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\n\nimport { getCliConfigDir } from \"./config\";\n\nexport type DevSession = {\n pid: number;\n port: number;\n root: string;\n serverUrl: string;\n};\n\nexport function getDevSessionPath(configDir = getCliConfigDir()): string {\n return join(configDir, \"dev-session.json\");\n}\n\nexport function isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch {\n return false;\n }\n}\n\nexport function writeDevSession(session: DevSession, configDir = getCliConfigDir()): void {\n const path = getDevSessionPath(configDir);\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, `${JSON.stringify(session)}\\n`, \"utf8\");\n}\n\nexport function clearDevSession(configDir = getCliConfigDir()): void {\n const path = getDevSessionPath(configDir);\n if (existsSync(path)) {\n unlinkSync(path);\n }\n}\n\nexport function readDevSession(configDir = getCliConfigDir()): DevSession | undefined {\n const path = getDevSessionPath(configDir);\n if (!existsSync(path)) {\n return undefined;\n }\n\n try {\n const session = JSON.parse(readFileSync(path, \"utf8\")) as DevSession;\n if (!isProcessAlive(session.pid)) {\n clearDevSession(configDir);\n return undefined;\n }\n return session;\n } catch {\n clearDevSession(configDir);\n return undefined;\n }\n}\n","import type Conf from \"conf\";\nimport { PlatformError } from \"@keystrokehq/sdk/platform\";\n\nimport {\n getConfigDir,\n getEffectiveApiTarget,\n getPlatformUrl,\n getServerUrl,\n type CliConfig,\n} from \"./config\";\nimport { readDevSession } from \"./dev-session\";\nimport { createCliPlatformClient } from \"./platform-client\";\n\nexport type ApiTargetOptions = {\n projectId?: string;\n local?: boolean;\n /** Route to `/api/projects/:id` and require a project id. Default false. */\n projectScoped?: boolean;\n /** Org-level platform API; ignores `--project` and activeProjectId. */\n orgScoped?: boolean;\n};\n\nexport const projectScopedTarget: ApiTargetOptions = { projectScoped: true };\n\nexport type ResolvedApiTarget = {\n baseUrl: string;\n projectId?: string;\n mode: \"local\" | \"platform\";\n};\n\nfunction resolveLocalTarget(config: Conf<CliConfig>): ResolvedApiTarget {\n return {\n baseUrl: getServerUrl(config),\n mode: \"local\",\n };\n}\n\nfunction resolveOrgPlatformTarget(config: Conf<CliConfig>): ResolvedApiTarget {\n return {\n baseUrl: `${getPlatformUrl(config).replace(/\\/+$/, \"\")}/api`,\n mode: \"platform\",\n };\n}\n\nasync function resolvePlatformTarget(\n config: Conf<CliConfig>,\n projectId: string,\n): Promise<ResolvedApiTarget> {\n const platform = createCliPlatformClient(config);\n let project;\n try {\n project = await platform.projects.get(projectId);\n } catch (error) {\n if (error instanceof PlatformError && error.status === 404) {\n throw new Error(\n `Project ${projectId} not found in the active organization. Run \\`keystroke config use project <id>\\` or pass \\`--project\\` with a valid project id.`,\n );\n }\n throw error;\n }\n if (project.status !== \"active\") {\n throw new Error(`Project ${projectId} is not active (${project.status})`);\n }\n\n const platformUrl = getPlatformUrl(config).replace(/\\/+$/, \"\");\n return {\n baseUrl: `${platformUrl}/api/projects/${encodeURIComponent(projectId)}`,\n projectId,\n mode: \"platform\",\n };\n}\n\nexport async function resolveApiTarget(\n config: Conf<CliConfig>,\n options: ApiTargetOptions = {},\n): Promise<ResolvedApiTarget> {\n if (options.local) {\n return resolveLocalTarget(config);\n }\n\n const devSession = readDevSession(getConfigDir(config));\n if (devSession && getEffectiveApiTarget(config) !== \"platform\") {\n return {\n baseUrl: devSession.serverUrl,\n mode: \"local\",\n };\n }\n\n if (options.orgScoped || options.projectScoped === false) {\n if (getEffectiveApiTarget(config) === \"local\") {\n return resolveLocalTarget(config);\n }\n return resolveOrgPlatformTarget(config);\n }\n\n if (options.projectId) {\n return resolvePlatformTarget(config, options.projectId);\n }\n\n if (getEffectiveApiTarget(config) === \"local\") {\n return resolveLocalTarget(config);\n }\n\n if (!options.projectScoped) {\n return resolveOrgPlatformTarget(config);\n }\n\n const projectId = options.projectId ?? config.get(\"activeProjectId\");\n if (!projectId) {\n throw new Error(\n \"No project selected. Pass `--project <id>` or run `keystroke config use project <id>`.\",\n );\n }\n\n return resolvePlatformTarget(config, projectId);\n}\n","import type { ApiTargetOptions } from \"./resolve-api-target\";\n\nlet targetOptions: ApiTargetOptions = {};\n\nexport function setCliTargetOptions(options: ApiTargetOptions): void {\n targetOptions = options;\n}\n\nexport function getCliTargetOptions(): ApiTargetOptions {\n return targetOptions;\n}\n","import type { ValidationErrorDetail } from \"@keystrokehq/shared\";\n\nfunction exampleValueFromValidationMessage(message: string): unknown {\n if (/expected number/i.test(message)) {\n return 0;\n }\n if (/expected string/i.test(message)) {\n return \"\";\n }\n if (/expected boolean/i.test(message)) {\n return false;\n }\n if (/expected array/i.test(message)) {\n return [];\n }\n if (/expected object/i.test(message)) {\n return {};\n }\n\n const enumMatch = message.match(/expected one of (.+)/i);\n if (enumMatch) {\n const firstOption = enumMatch[1]?.match(/\"([^\"]+)\"/);\n if (firstOption?.[1]) {\n return firstOption[1];\n }\n }\n\n return null;\n}\n\nfunction setNestedExampleValue(input: Record<string, unknown>, path: string, value: unknown): void {\n const parts = path.split(\".\").filter(Boolean);\n if (parts.length === 0) {\n return;\n }\n\n let current: Record<string, unknown> = input;\n for (let index = 0; index < parts.length - 1; index += 1) {\n const key = parts[index]!;\n const next = current[key];\n if (typeof next !== \"object\" || next === null || Array.isArray(next)) {\n current[key] = {};\n }\n current = current[key] as Record<string, unknown>;\n }\n\n current[parts[parts.length - 1]!] = value;\n}\n\nexport function exampleInputFromValidationDetails(\n details: ValidationErrorDetail[],\n): Record<string, unknown> {\n const input: Record<string, unknown> = {};\n\n for (const detail of details) {\n if (!detail.path) {\n continue;\n }\n setNestedExampleValue(input, detail.path, exampleValueFromValidationMessage(detail.message));\n }\n\n return input;\n}\n","import type { ErrorResponse } from \"@keystrokehq/shared\";\nimport { exampleInputFromValidationDetails } from \"./example-input\";\nimport type { CliUsageHint } from \"./types\";\n\n/** Turn a parsed API error body into terminal output. */\nexport function formatApiErrorMessage(\n response: ErrorResponse,\n fallback: string,\n options?: CliUsageHint,\n): string {\n const summary = response.message ?? response.error ?? fallback;\n\n if (!response.details?.length) {\n return summary;\n }\n\n const lines = response.details.map((detail) => {\n const field = detail.path || \"(root)\";\n return ` • ${field}: ${detail.message}`;\n });\n let message = `${summary}:\\n${lines.join(\"\\n\")}`;\n\n if (options?.usage) {\n const example = JSON.stringify(exampleInputFromValidationDetails(response.details));\n const flag = options.usage.flag ?? \"--input\";\n message += `\\n\\nTry: ${options.usage.command} ${flag} '${example}'`;\n }\n\n return message;\n}\n","import { parseErrorResponse } from \"@keystrokehq/shared\";\nimport { KeystrokeError } from \"@keystrokehq/sdk\";\nimport { PlatformError } from \"@keystrokehq/sdk/platform\";\nimport { getAccessToken } from \"../auth/credentials\";\nimport type { CliErrorContext } from \"./types\";\nimport { formatApiErrorMessage } from \"./format-api-message\";\n\nfunction isUnreachableServerError(error: Error): boolean {\n return (\n error.message.includes(\"network error\") ||\n error.message.includes(\"ECONNREFUSED\") ||\n error.message.includes(\"ENOTFOUND\") ||\n error.message.includes(\"fetch failed\")\n );\n}\n\nfunction unreachableTarget(context?: CliErrorContext): string | undefined {\n return context?.serverUrl ?? context?.webUrl;\n}\n\nfunction unreachableServerMessage(targetUrl?: string): string {\n const target = targetUrl ?? \"the keystroke server\";\n return `Could not reach ${target}. Is the server running? (keystroke dev or keystroke start)`;\n}\n\ntype HttpClientError = {\n status: number;\n body: unknown;\n message: string;\n};\n\nfunction formatHttpClientError(error: HttpClientError, context?: CliErrorContext): string {\n if (error.status === 401) {\n if (context?.webUrl && !getAccessToken(context.webUrl)) {\n return \"Not logged in. Run `keystroke auth login` first.\";\n }\n return \"Authentication failed. Run `keystroke auth login` again.\";\n }\n\n if (error.status === 0) {\n return unreachableServerMessage(unreachableTarget(context));\n }\n\n const parsed = parseErrorResponse(error.body);\n if (parsed) {\n return formatApiErrorMessage(parsed, error.message, context);\n }\n\n return error.message;\n}\n\nexport function formatCliError(\n error: unknown,\n fallback: string,\n context?: CliErrorContext,\n): string {\n if (error instanceof KeystrokeError || error instanceof PlatformError) {\n return formatHttpClientError(error, context);\n }\n\n if (error instanceof Error) {\n if (isUnreachableServerError(error)) {\n return unreachableServerMessage(unreachableTarget(context));\n }\n return error.message;\n }\n\n return fallback;\n}\n","import { createCliClient } from \"../client\";\nimport { createCliConfig, getWebUrl } from \"../config\";\nimport { ensureActiveOrganization } from \"../organization/active-organization\";\nimport {\n projectScopedTarget,\n resolveApiTarget,\n type ApiTargetOptions,\n} from \"../resolve-api-target\";\nimport { getCliTargetOptions } from \"../target-options\";\nimport type { CliContext, CliErrorContext } from \"./types\";\nimport { formatCliError } from \"./format-cli-error\";\n\nexport async function runProjectCliCommand(\n fallback: string,\n fn: (ctx: CliContext) => Promise<void>,\n errorContext?: CliErrorContext,\n targetOptions: ApiTargetOptions = {},\n): Promise<void> {\n return runCliCommand(fallback, fn, errorContext, {\n ...projectScopedTarget,\n ...targetOptions,\n });\n}\n\nexport async function runCliCommand(\n fallback: string,\n fn: (ctx: CliContext) => Promise<void>,\n errorContext?: CliErrorContext,\n targetOptions: ApiTargetOptions = {},\n): Promise<void> {\n const config = createCliConfig();\n const target = await resolveApiTarget(config, {\n ...getCliTargetOptions(),\n ...targetOptions,\n });\n\n if (target.mode === \"platform\") {\n await ensureActiveOrganization(config);\n }\n\n const ctx: CliContext = {\n config,\n client: createCliClient(config, {\n baseUrl: target.baseUrl,\n platform: target.mode === \"platform\",\n }),\n serverUrl: target.baseUrl,\n webUrl: getWebUrl(config),\n apiTarget: target,\n };\n\n try {\n await fn(ctx);\n } catch (error) {\n process.stderr.write(\n `${formatCliError(error, fallback, {\n ...errorContext,\n serverUrl: ctx.serverUrl,\n webUrl: ctx.webUrl,\n })}\\n`,\n );\n process.exitCode = 1;\n }\n}\n","/**\n * Binary name to show in help text and \"Try: ...\" hints. Always the published\n * `keystroke`, or the `keystroke-dev` wrapper (which sets KEYSTROKE_DEV) so\n * examples stay copy-pasteable while developing on keystroke itself.\n */\nexport function cliBinaryName(): string {\n return process.env.KEYSTROKE_DEV ? \"keystroke-dev\" : \"keystroke\";\n}\n\n/** Parse a JSON CLI flag; throws a readable error on invalid input. */\nexport function parseJsonOption(value: string, flag: string): unknown {\n try {\n return JSON.parse(value) as unknown;\n } catch {\n throw new Error(`Invalid ${flag} JSON`);\n }\n}\n","import type { Command } from \"commander\";\nimport { runProjectCliCommand } from \"../../errors\";\n\nexport function registerAgentPromptCommand(agent: Command): void {\n agent\n .command(\"prompt\")\n .description(\"Send a message to an agent (or follow up in an existing session)\")\n .argument(\"<agentId>\", \"Agent key / route id\")\n .requiredOption(\"--message <text>\", \"Message to send\")\n .option(\"--session-id <id>\", \"Existing session id for follow-up\")\n .action((agentId: string, options: { message: string; sessionId?: string }) =>\n runProjectCliCommand(\"Agent prompt failed\", async ({ client }) => {\n const result = await client.agents.prompt(agentId, {\n message: options.message,\n ...(options.sessionId ? { sessionId: options.sessionId } : {}),\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n}\n","import type { Command } from \"commander\";\nimport { runProjectCliCommand } from \"../../errors\";\n\nexport function registerAgentSessionsCommand(agent: Command): void {\n const sessions = agent.command(\"sessions\").description(\"List and inspect agent sessions\");\n\n sessions\n .command(\"list\")\n .description(\"List sessions for an agent\")\n .argument(\"<agentId>\", \"Agent key / route id\")\n .option(\"--limit <n>\", \"Page size (1–100)\", \"20\")\n .option(\"--cursor <cursor>\", \"Pagination cursor from a previous page\")\n .option(\"--status <status>\", \"Filter by status (running, completed, failed)\")\n .option(\"--source <source>\", \"Filter by source (api, gateway)\")\n .action((agentId: string, options: Record<string, string | undefined>) =>\n runProjectCliCommand(\"List agent sessions failed\", async ({ client }) => {\n const result = await client.agents.listSessions(agentId, {\n limit: Number(options.limit),\n ...(options.cursor ? { cursor: options.cursor } : {}),\n ...(options.status\n ? { status: options.status as \"running\" | \"completed\" | \"failed\" }\n : {}),\n ...(options.source ? { source: options.source as \"api\" | \"gateway\" } : {}),\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n\n sessions\n .command(\"get\")\n .description(\"Get full details for an agent session\")\n .argument(\"<agentId>\", \"Agent key / route id\")\n .argument(\"<sessionId>\", \"Agent session id\")\n .option(\"--include <parts>\", \"Comma-separated: gateway, messages, events, trace\")\n .action((agentId: string, sessionId: string, options: { include?: string }) =>\n runProjectCliCommand(\"Get agent session failed\", async ({ client }) => {\n const result = await client.agents.getSession(agentId, sessionId, {\n include: options.include,\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n}\n","import type { Command } from \"commander\";\nimport { registerAgentPromptCommand } from \"./prompt\";\nimport { registerAgentSessionsCommand } from \"./sessions\";\n\nexport function registerAgentCommand(program: Command): void {\n const agent = program.command(\"agent\").description(\"Invoke and inspect agents\");\n\n registerAgentPromptCommand(agent);\n registerAgentSessionsCommand(agent);\n}\n","import { spawn } from \"node:child_process\";\n\nexport function openUrl(url: string): void {\n const platform = process.platform;\n const command = platform === \"darwin\" ? \"open\" : platform === \"win32\" ? \"start\" : \"xdg-open\";\n\n spawn(command, [url], {\n detached: true,\n stdio: \"ignore\",\n }).unref();\n}\n","import type { ConnectProvider } from \"@keystrokehq/shared\";\nimport type { KeystrokeClient } from \"@keystrokehq/sdk\";\nimport { openUrl } from \"../../auth/open-url\";\n\nfunction providerLabel(key: string): string {\n return key.charAt(0).toUpperCase() + key.slice(1);\n}\n\nexport async function runConnect(options: {\n client: KeystrokeClient;\n provider: ConnectProvider;\n serverUrl: string;\n printUrl?: boolean;\n}): Promise<void> {\n const { client, provider, serverUrl, printUrl } = options;\n const label = providerLabel(provider.key);\n\n if (provider.mode === \"browser-redirect\") {\n const url = `${serverUrl}${provider.path}`;\n\n if (printUrl) {\n process.stdout.write(`${url}\\n`);\n return;\n }\n\n openUrl(url);\n process.stdout.write(`Complete ${label} sign-in in your browser.\\n`);\n return;\n }\n\n const payload = await client.connect.getAuthorizeUrl(provider.path);\n\n const authorizeUrl = new URL(payload.url);\n const scopes = authorizeUrl.searchParams.get(\"scope\")?.split(\" \").filter(Boolean) ?? [];\n\n if (scopes.length > 0) {\n process.stdout.write(\"Requested scopes:\\n\");\n for (const scope of scopes) {\n process.stdout.write(` - ${scope}\\n`);\n }\n process.stdout.write(\"\\n\");\n }\n\n if (printUrl) {\n process.stdout.write(`${payload.url}\\n`);\n return;\n }\n\n openUrl(payload.url);\n process.stdout.write(`Complete ${label} sign-in in your browser.\\n`);\n}\n","import type { Command } from \"commander\";\nimport { runCliCommand } from \"../../errors\";\nimport { getCliTargetOptions } from \"../../target-options\";\nimport type { ApiTargetOptions } from \"../../resolve-api-target\";\nimport { runConnect } from \"./run-connect\";\n\nfunction resolveConnectTargetOptions(): ApiTargetOptions {\n const { local } = getCliTargetOptions();\n if (local) {\n return { local: true };\n }\n return { orgScoped: true };\n}\n\nexport function registerConnectCommand(program: Command): void {\n program\n .command(\"connect [provider]\")\n .description(\"Connect third-party accounts (uses apiTarget; --local for local server)\")\n .option(\"--print-url\", \"Print the authorize URL and exit without opening the browser\")\n .action((provider: string | undefined, options: { printUrl?: boolean }) =>\n runCliCommand(\n \"Could not fetch connect providers\",\n async (ctx) => {\n const providers = await ctx.client.connect.listProviders();\n\n if (!provider) {\n if (providers.length === 0) {\n process.stdout.write(\"No connect providers available on this server.\\n\");\n return;\n }\n\n process.stdout.write(\"Available providers:\\n\");\n for (const entry of providers) {\n process.stdout.write(` ${entry.key}\\n`);\n }\n return;\n }\n\n const match = providers.find((entry) => entry.key === provider);\n if (!match) {\n const available = providers.map((entry) => entry.key).join(\", \") || \"(none)\";\n throw new Error(`Unknown provider \"${provider}\". Available: ${available}`);\n }\n\n await runConnect({\n client: ctx.client,\n provider: match,\n serverUrl: ctx.serverUrl,\n printUrl: options.printUrl,\n });\n },\n undefined,\n resolveConnectTargetOptions(),\n ),\n );\n}\n","import type { CredentialScopeType } from \"@keystrokehq/shared\";\nimport type { ApiTargetOptions } from \"../../resolve-api-target\";\nimport { projectScopedTarget } from \"../../resolve-api-target\";\n\nexport function resolveCredentialsTargetOptions(\n options: {\n scopeType?: CredentialScopeType;\n projectId?: string;\n } = {},\n): ApiTargetOptions {\n if (options.scopeType === \"project\") {\n return {\n ...projectScopedTarget,\n projectId: options.projectId,\n };\n }\n\n return { orgScoped: true };\n}\n","import type { Command } from \"commander\";\nimport { runCliCommand } from \"../../errors\";\nimport { resolveCredentialsTargetOptions } from \"./target-options\";\n\nexport function registerCredentialsDeleteCommand(credentials: Command): void {\n credentials\n .command(\"delete\")\n .description(\"Delete an api_key credential instance\")\n .argument(\"<id>\", \"Credential instance id\")\n .action((id: string) =>\n runCliCommand(\n \"Delete credential failed\",\n async ({ client }) => {\n await client.credentials.deleteInstance(id);\n },\n undefined,\n resolveCredentialsTargetOptions(),\n ),\n );\n}\n","import type { Command } from \"commander\";\nimport { runCliCommand } from \"../../errors\";\nimport { resolveCredentialsTargetOptions } from \"./target-options\";\n\nexport function registerCredentialsListCommand(credentials: Command): void {\n credentials\n .command(\"list\")\n .description(\"List stored credential instances\")\n .option(\"--key <key>\", \"Filter by credential key\")\n .action((options: { key?: string }) =>\n runCliCommand(\n \"List credential instances failed\",\n async ({ client }) => {\n const result = await client.credentials.listInstances(\n options.key ? { key: options.key } : undefined,\n );\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n },\n undefined,\n resolveCredentialsTargetOptions(),\n ),\n );\n}\n","import type { CredentialScopeType } from \"@keystrokehq/shared\";\nimport type { KeystrokeClient } from \"@keystrokehq/sdk\";\nimport { cliBinaryName } from \"../../errors\";\n\ntype ConflictInstance = {\n id: string;\n label: string | null;\n isDefault: boolean;\n};\n\nfunction describeInstance(instance: ConflictInstance): string {\n const defaultStatus = instance.isDefault ? \"default\" : \"not default\";\n const labelStatus = instance.label ? `label: ${instance.label}` : \"no label\";\n return `id: ${instance.id}, ${defaultStatus}, ${labelStatus}`;\n}\n\nfunction formatSetFields(setFields: string[]): string {\n return setFields.map((field) => `--set ${field}`).join(\" \");\n}\n\nfunction formatSetConflictError(args: {\n key: string;\n scope: string;\n setFields: string[];\n matching: ConflictInstance[];\n}): string {\n const binary = cliBinaryName();\n const setArgs = formatSetFields(args.setFields);\n const listCmd = `${binary} credentials list --key ${args.key}`;\n const addSecondCmd = `${binary} credentials set ${args.key} --scope ${args.scope} --label <name> ${setArgs}`;\n\n if (args.matching.length === 1) {\n const instance = args.matching[0]!;\n const updateCmd = `${binary} credentials update ${instance.id} ${setArgs}`;\n\n return [\n `An ${args.key} credential already exists in ${args.scope} scope (${describeInstance(instance)}).`,\n \"credentials set creates a new instance — it does not update an existing one.\",\n \"To update the existing credential:\",\n ` ${updateCmd}`,\n \"To add a second credential in the same scope:\",\n ` ${addSecondCmd}`,\n `List instances: ${listCmd}`,\n ].join(\"\\n\");\n }\n\n const instanceLines = args.matching.map((instance) => ` • ${describeInstance(instance)}`);\n\n return [\n `Multiple ${args.key} credentials already exist in ${args.scope} scope. --label is required to add another:`,\n ...instanceLines,\n \"To add another credential in the same scope:\",\n ` ${addSecondCmd}`,\n `List instances: ${listCmd}`,\n ].join(\"\\n\");\n}\n\nexport async function assertNoSetConflict(\n client: KeystrokeClient,\n args: {\n key: string;\n scope: string;\n scopeType: CredentialScopeType;\n projectId?: string;\n label?: string;\n setFields: string[];\n },\n): Promise<void> {\n if (args.label) {\n return;\n }\n\n const { instances } = await client.credentials.listInstances({ key: args.key });\n const matching = instances.filter(\n (instance) =>\n instance.scopeType === args.scopeType &&\n (args.scopeType !== \"project\" || instance.scopeId === args.projectId),\n );\n\n if (matching.length === 0) {\n return;\n }\n\n throw new Error(\n formatSetConflictError({\n key: args.key,\n scope: args.scope,\n setFields: args.setFields,\n matching,\n }),\n );\n}\n","export const ENV_REF_PREFIX = \"@env:\";\n\nexport function isEnvRef(raw: string): boolean {\n return raw.startsWith(ENV_REF_PREFIX);\n}\n\nexport function envRefName(raw: string): string {\n return raw.slice(ENV_REF_PREFIX.length);\n}\n","import { existsSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\n\nfunction hasProjectLayout(dir: string): boolean {\n return existsSync(join(dir, \"package.json\")) && existsSync(join(dir, \"src\", \"agents\"));\n}\n\nexport function resolveProjectRoot(fromDir = process.cwd()): string {\n let dir = resolve(fromDir);\n\n while (dir !== dirname(dir)) {\n if (hasProjectLayout(dir)) {\n return dir;\n }\n\n dir = dirname(dir);\n }\n\n if (hasProjectLayout(dir)) {\n return dir;\n }\n\n throw new Error(\"Could not find keystroke project root (expected package.json and src/agents/)\");\n}\n","import { existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { resolveProjectRoot } from \"./resolve-project-root\";\n\nlet loaded = false;\n\nexport function parseEnvFile(contents: string): Record<string, string> {\n const values: Record<string, string> = {};\n\n for (const line of contents.split(\"\\n\")) {\n const trimmed = line.trim();\n if (!trimmed || trimmed.startsWith(\"#\")) {\n continue;\n }\n\n const eq = trimmed.indexOf(\"=\");\n if (eq === -1) {\n continue;\n }\n\n const key = trimmed.slice(0, eq).trim();\n let value = trimmed.slice(eq + 1).trim();\n if (\n (value.startsWith('\"') && value.endsWith('\"')) ||\n (value.startsWith(\"'\") && value.endsWith(\"'\"))\n ) {\n value = value.slice(1, -1);\n }\n\n values[key] = value;\n }\n\n return values;\n}\n\nexport function loadProjectEnv(fromDir = process.cwd()): void {\n if (loaded) {\n return;\n }\n\n loaded = true;\n\n let envPath: string;\n try {\n envPath = join(resolveProjectRoot(fromDir), \".env\");\n } catch {\n return;\n }\n\n if (!existsSync(envPath)) {\n return;\n }\n\n for (const [key, value] of Object.entries(parseEnvFile(readFileSync(envPath, \"utf8\")))) {\n if (process.env[key] === undefined) {\n process.env[key] = value;\n }\n }\n}\n\nexport function resetProjectEnvLoadedForTests(): void {\n loaded = false;\n}\n","import { envRefName, isEnvRef } from \"../../project/env-ref\";\nimport { loadProjectEnv } from \"../../project/load-project-env\";\n\nexport function parseCredentialValueFields(fields: string[]): Record<string, string> {\n const value: Record<string, string> = {};\n\n for (const field of fields) {\n const separatorIndex = field.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new Error(`Invalid --set value: ${field}`);\n }\n\n const key = field.slice(0, separatorIndex);\n let rawValue = field.slice(separatorIndex + 1);\n\n if (isEnvRef(rawValue)) {\n const envName = envRefName(rawValue);\n if (process.env[envName] === undefined) {\n loadProjectEnv();\n }\n rawValue = process.env[envName] ?? \"\";\n if (!rawValue) {\n throw new Error(`Environment variable ${envName} is not set`);\n }\n }\n\n value[key] = rawValue;\n }\n\n if (Object.keys(value).length === 0) {\n throw new Error(\"At least one --set field is required\");\n }\n\n return value;\n}\n\nexport function scopeTypeFromCli(scope: string): \"organization\" | \"user\" | \"project\" | \"global\" {\n switch (scope) {\n case \"org\":\n return \"organization\";\n case \"user\":\n return \"user\";\n case \"project\":\n return \"project\";\n case \"global\":\n return \"global\";\n default:\n throw new Error(`Unknown scope \"${scope}\". Expected org, user, project, or global.`);\n }\n}\n","import type { Command } from \"commander\";\nimport { runCliCommand } from \"../../errors\";\nimport { assertNoSetConflict } from \"./format-set-conflict-error\";\nimport { parseCredentialValueFields, scopeTypeFromCli } from \"./parse-value\";\nimport { resolveCredentialsTargetOptions } from \"./target-options\";\n\nexport function registerCredentialsSetCommand(credentials: Command): void {\n credentials\n .command(\"set\")\n .description(\"Create a new api_key credential instance\")\n .argument(\"<key>\", \"Credential key, e.g. exa\")\n .requiredOption(\"--scope <scope>\", \"org, user, project, or global\")\n .option(\"--project-id <id>\", \"Project id when scope is project\")\n .option(\"--label <label>\", \"Human-readable label within the scope\")\n .option(\"--default\", \"Mark as default for this scope\")\n .option(\n \"--set <field>\",\n \"Credential field as key=value or key=@env:VAR (falls back to project .env when unset in shell)\",\n collectSetValues,\n [],\n )\n .action(\n (\n key: string,\n options: {\n scope: string;\n projectId?: string;\n label?: string;\n default?: boolean;\n set: string[];\n },\n ) =>\n runCliCommand(\n \"Set credential failed\",\n async ({ client }) => {\n const value = parseCredentialValueFields(options.set);\n const scopeType = scopeTypeFromCli(options.scope);\n\n if (scopeType === \"project\" && !options.projectId) {\n throw new Error(\"--project-id is required when scope is project\");\n }\n\n await assertNoSetConflict(client, {\n key,\n scope: options.scope,\n scopeType,\n projectId: options.projectId,\n label: options.label,\n setFields: options.set,\n });\n\n const result = await client.credentials.createInstance({\n key,\n scopeType,\n scopeId: scopeType === \"project\" ? options.projectId! : undefined,\n label: options.label,\n isDefault: options.default,\n value,\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n },\n undefined,\n resolveCredentialsTargetOptions({\n scopeType: scopeTypeFromCli(options.scope),\n projectId: options.projectId,\n }),\n ),\n );\n}\n\nfunction collectSetValues(value: string, previous: string[]): string[] {\n return previous.concat([value]);\n}\n","import type { Command } from \"commander\";\nimport { runCliCommand } from \"../../errors\";\nimport { parseCredentialValueFields } from \"./parse-value\";\nimport { resolveCredentialsTargetOptions } from \"./target-options\";\n\nexport function registerCredentialsUpdateCommand(credentials: Command): void {\n credentials\n .command(\"update\")\n .description(\"Update an api_key credential instance\")\n .argument(\"<id>\", \"Credential instance id\")\n .option(\"--label <label>\", \"Human-readable label within the scope\")\n .option(\"--default\", \"Mark as default for this scope\")\n .option(\"--set <field>\", \"Credential field as key=value or key=@env:VAR\", collectSetValues, [])\n .action(\n (\n id: string,\n options: {\n label?: string;\n default?: boolean;\n set: string[];\n },\n ) =>\n runCliCommand(\n \"Update credential failed\",\n async ({ client }) => {\n const value =\n options.set.length > 0 ? parseCredentialValueFields(options.set) : undefined;\n\n const result = await client.credentials.updateInstance(id, {\n ...(options.label !== undefined ? { label: options.label } : {}),\n ...(options.default !== undefined ? { isDefault: options.default } : {}),\n ...(value ? { value } : {}),\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n },\n undefined,\n resolveCredentialsTargetOptions(),\n ),\n );\n}\n\nfunction collectSetValues(value: string, previous: string[]): string[] {\n return previous.concat([value]);\n}\n","import type { Command } from \"commander\";\nimport { registerCredentialsDeleteCommand } from \"./delete\";\nimport { registerCredentialsListCommand } from \"./list\";\nimport { registerCredentialsSetCommand } from \"./set\";\nimport { registerCredentialsUpdateCommand } from \"./update\";\n\nexport function registerCredentialsCommand(program: Command): void {\n const credentials = program\n .command(\"credentials\")\n .description(\"Manage stored api_key credential instances\");\n\n registerCredentialsListCommand(credentials);\n registerCredentialsSetCommand(credentials);\n registerCredentialsUpdateCommand(credentials);\n registerCredentialsDeleteCommand(credentials);\n}\n","//#region src/constants.ts\n/** OAuth device-flow client id for `keystroke auth login`. */\nconst CLI_CLIENT_ID = \"keystroke-cli\";\n//#endregion\nexport { CLI_CLIENT_ID as t };\n\n//# sourceMappingURL=constants-BaNTvWUo.mjs.map","//#region package.json\nvar version = \"1.6.11\";\n//#endregion\nexport { version };\n","import { version } from \"./package.mjs\";\n//#region src/version.ts\nconst PACKAGE_VERSION = version;\n//#endregion\nexport { PACKAGE_VERSION };\n","//#region src/error.ts\nfunction isErrorStackTraceLimitWritable() {\n\tconst desc = Object.getOwnPropertyDescriptor(Error, \"stackTraceLimit\");\n\tif (desc === void 0) return Object.isExtensible(Error);\n\treturn Object.prototype.hasOwnProperty.call(desc, \"writable\") ? desc.writable : desc.set !== void 0;\n}\n/**\n* Hide internal stack frames from the error stack trace.\n*/\nfunction hideInternalStackFrames(stack) {\n\tconst lines = stack.split(\"\\n at \");\n\tif (lines.length <= 1) return stack;\n\tlines.splice(1, 1);\n\treturn lines.join(\"\\n at \");\n}\n/**\n* Creates a custom error class that hides stack frames.\n*/\nfunction makeErrorForHideStackFrame(Base, clazz) {\n\tclass HideStackFramesError extends Base {\n\t\t#hiddenStack;\n\t\tconstructor(...args) {\n\t\t\tif (isErrorStackTraceLimitWritable()) {\n\t\t\t\tconst limit = Error.stackTraceLimit;\n\t\t\t\tError.stackTraceLimit = 0;\n\t\t\t\tsuper(...args);\n\t\t\t\tError.stackTraceLimit = limit;\n\t\t\t} else super(...args);\n\t\t\tconst stack = (/* @__PURE__ */ new Error()).stack;\n\t\t\tif (stack) this.#hiddenStack = hideInternalStackFrames(stack.replace(/^Error/, this.name));\n\t\t}\n\t\tget errorStack() {\n\t\t\treturn this.#hiddenStack;\n\t\t}\n\t}\n\tObject.defineProperty(HideStackFramesError.prototype, \"constructor\", {\n\t\tget() {\n\t\t\treturn clazz;\n\t\t},\n\t\tenumerable: false,\n\t\tconfigurable: true\n\t});\n\treturn HideStackFramesError;\n}\nconst statusCodes = {\n\tOK: 200,\n\tCREATED: 201,\n\tACCEPTED: 202,\n\tNO_CONTENT: 204,\n\tMULTIPLE_CHOICES: 300,\n\tMOVED_PERMANENTLY: 301,\n\tFOUND: 302,\n\tSEE_OTHER: 303,\n\tNOT_MODIFIED: 304,\n\tTEMPORARY_REDIRECT: 307,\n\tBAD_REQUEST: 400,\n\tUNAUTHORIZED: 401,\n\tPAYMENT_REQUIRED: 402,\n\tFORBIDDEN: 403,\n\tNOT_FOUND: 404,\n\tMETHOD_NOT_ALLOWED: 405,\n\tNOT_ACCEPTABLE: 406,\n\tPROXY_AUTHENTICATION_REQUIRED: 407,\n\tREQUEST_TIMEOUT: 408,\n\tCONFLICT: 409,\n\tGONE: 410,\n\tLENGTH_REQUIRED: 411,\n\tPRECONDITION_FAILED: 412,\n\tPAYLOAD_TOO_LARGE: 413,\n\tURI_TOO_LONG: 414,\n\tUNSUPPORTED_MEDIA_TYPE: 415,\n\tRANGE_NOT_SATISFIABLE: 416,\n\tEXPECTATION_FAILED: 417,\n\t\"I'M_A_TEAPOT\": 418,\n\tMISDIRECTED_REQUEST: 421,\n\tUNPROCESSABLE_ENTITY: 422,\n\tLOCKED: 423,\n\tFAILED_DEPENDENCY: 424,\n\tTOO_EARLY: 425,\n\tUPGRADE_REQUIRED: 426,\n\tPRECONDITION_REQUIRED: 428,\n\tTOO_MANY_REQUESTS: 429,\n\tREQUEST_HEADER_FIELDS_TOO_LARGE: 431,\n\tUNAVAILABLE_FOR_LEGAL_REASONS: 451,\n\tINTERNAL_SERVER_ERROR: 500,\n\tNOT_IMPLEMENTED: 501,\n\tBAD_GATEWAY: 502,\n\tSERVICE_UNAVAILABLE: 503,\n\tGATEWAY_TIMEOUT: 504,\n\tHTTP_VERSION_NOT_SUPPORTED: 505,\n\tVARIANT_ALSO_NEGOTIATES: 506,\n\tINSUFFICIENT_STORAGE: 507,\n\tLOOP_DETECTED: 508,\n\tNOT_EXTENDED: 510,\n\tNETWORK_AUTHENTICATION_REQUIRED: 511\n};\nvar InternalAPIError = class extends Error {\n\tconstructor(status = \"INTERNAL_SERVER_ERROR\", body = void 0, headers = {}, statusCode = typeof status === \"number\" ? status : statusCodes[status]) {\n\t\tsuper(body?.message, body?.cause ? { cause: body.cause } : void 0);\n\t\tthis.status = status;\n\t\tthis.body = body;\n\t\tthis.headers = headers;\n\t\tthis.statusCode = statusCode;\n\t\tthis.name = \"APIError\";\n\t\tthis.status = status;\n\t\tthis.headers = headers;\n\t\tthis.statusCode = statusCode;\n\t\tthis.body = body;\n\t}\n};\nvar ValidationError = class extends InternalAPIError {\n\tconstructor(message, issues) {\n\t\tsuper(400, {\n\t\t\tmessage,\n\t\t\tcode: \"VALIDATION_ERROR\"\n\t\t});\n\t\tthis.message = message;\n\t\tthis.issues = issues;\n\t\tthis.issues = issues;\n\t}\n};\nvar BetterCallError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"BetterCallError\";\n\t}\n};\nconst kAPIErrorHeaderSymbol = Symbol.for(\"better-call:api-error-headers\");\nconst APIError = makeErrorForHideStackFrame(InternalAPIError, Error);\n\n//#endregion\nexport { APIError, BetterCallError, ValidationError, hideInternalStackFrames, kAPIErrorHeaderSymbol, makeErrorForHideStackFrame, statusCodes };\n//# sourceMappingURL=error.mjs.map","import { BASE_ERROR_CODES } from \"./codes.mjs\";\nimport { APIError as APIError$1 } from \"better-call/error\";\n//#region src/error/index.ts\nvar BetterAuthError = class extends Error {\n\tconstructor(message, options) {\n\t\tsuper(message, options);\n\t\tthis.name = \"BetterAuthError\";\n\t\tthis.message = message;\n\t\tthis.stack = \"\";\n\t}\n};\nvar APIError = class APIError extends APIError$1 {\n\tconstructor(...args) {\n\t\tsuper(...args);\n\t}\n\tstatic fromStatus(status, body) {\n\t\treturn new APIError(status, body);\n\t}\n\tstatic from(status, error) {\n\t\treturn new APIError(status, {\n\t\t\tmessage: error.message,\n\t\t\tcode: error.code\n\t\t});\n\t}\n};\n//#endregion\nexport { APIError, BASE_ERROR_CODES, BetterAuthError };\n","import { PACKAGE_VERSION } from \"../../version.mjs\";\n//#region src/plugins/device-authorization/client.ts\nconst deviceAuthorizationClient = () => {\n\treturn {\n\t\tid: \"device-authorization\",\n\t\tversion: PACKAGE_VERSION,\n\t\t$InferServerPlugin: {},\n\t\tpathMethods: {\n\t\t\t\"/device/code\": \"POST\",\n\t\t\t\"/device/token\": \"POST\",\n\t\t\t\"/device\": \"GET\",\n\t\t\t\"/device/approve\": \"POST\",\n\t\t\t\"/device/deny\": \"POST\"\n\t\t}\n\t};\n};\n//#endregion\nexport { deviceAuthorizationClient };\n","import { cleanTasks } from '../task/index.js'\n\nexport const clean = Symbol('clean')\n\nexport const cleanStores = (...stores) => {\n if (process.env.NODE_ENV === 'production') {\n throw new Error(\n 'cleanStores() can be used only during development or tests'\n )\n }\n cleanTasks()\n for (let $store of stores) {\n if ($store) {\n if ($store.mocked) delete $store.mocked\n if ($store[clean]) $store[clean]()\n }\n }\n}\n","import { clean } from '../clean-stores/index.js'\n\nlet listenerQueue = []\nlet lqIndex = 0\nconst QUEUE_ITEMS_PER_LISTENER = 4\n// Use globalThis.nanostoresGlobal to store epoch so all module instances share\n// the same counter. This fixes issues when Nano Store is bundled separately\n// in different parts of an application (e.g., tree-shaking separates core\n// from React), causing each bundle to have its own epoch instance.\nexport const nanostoresGlobal = (globalThis.nanostoresGlobal ||= { epoch: 0 })\n\n/* @__NO_SIDE_EFFECTS__ */\nexport const atom = initialValue => {\n let listeners = []\n let $atom = {\n get() {\n if (!$atom.lc) {\n $atom.listen(() => {})()\n }\n return $atom.value\n },\n init: initialValue,\n lc: 0,\n listen(listener) {\n $atom.lc = listeners.push(listener)\n\n return () => {\n for (\n let i = lqIndex + QUEUE_ITEMS_PER_LISTENER;\n i < listenerQueue.length;\n ) {\n if (listenerQueue[i] === listener) {\n listenerQueue.splice(i, QUEUE_ITEMS_PER_LISTENER)\n } else {\n i += QUEUE_ITEMS_PER_LISTENER\n }\n }\n\n let index = listeners.indexOf(listener)\n if (~index) {\n listeners.splice(index, 1)\n if (!--$atom.lc) $atom.off()\n }\n }\n },\n notify(oldValue, changedKey) {\n nanostoresGlobal.epoch++\n let runListenerQueue = !listenerQueue.length\n for (let listener of listeners) {\n listenerQueue.push(listener, $atom.value, oldValue, changedKey)\n }\n\n if (runListenerQueue) {\n for (\n lqIndex = 0;\n lqIndex < listenerQueue.length;\n lqIndex += QUEUE_ITEMS_PER_LISTENER\n ) {\n listenerQueue[lqIndex](\n listenerQueue[lqIndex + 1],\n listenerQueue[lqIndex + 2],\n listenerQueue[lqIndex + 3]\n )\n }\n listenerQueue.length = 0\n }\n },\n /* It will be called on last listener unsubscribing.\n We will redefine it in onMount and onStop. */\n off() {},\n set(newValue) {\n let oldValue = $atom.value\n if (oldValue !== newValue) {\n $atom.value = newValue\n $atom.notify(oldValue)\n }\n },\n subscribe(listener) {\n let unbind = $atom.listen(listener)\n listener($atom.value)\n return unbind\n },\n value: initialValue\n }\n\n if (process.env.NODE_ENV !== 'production') {\n $atom[clean] = () => {\n listeners = []\n $atom.lc = 0\n $atom.off()\n }\n }\n\n return $atom\n}\n\nexport const readonlyType = store => store\n","import { clean } from '../clean-stores/index.js'\n\nconst START = 0\nconst STOP = 1\nconst SET = 2\nconst NOTIFY = 3\nconst MOUNT = 5\nconst UNMOUNT = 6\nconst REVERT_MUTATION = 10\n\nexport let on = (object, listener, eventKey, mutateStore) => {\n object.events = object.events || {}\n if (!object.events[eventKey + REVERT_MUTATION]) {\n object.events[eventKey + REVERT_MUTATION] = mutateStore(eventProps => {\n // eslint-disable-next-line no-sequences\n object.events[eventKey].reduceRight((event, l) => (l(event), event), {\n shared: {},\n ...eventProps\n })\n })\n }\n object.events[eventKey] = object.events[eventKey] || []\n object.events[eventKey].push(listener)\n return () => {\n let currentListeners = object.events[eventKey]\n let index = currentListeners.indexOf(listener)\n currentListeners.splice(index, 1)\n if (!currentListeners.length) {\n delete object.events[eventKey]\n object.events[eventKey + REVERT_MUTATION]()\n delete object.events[eventKey + REVERT_MUTATION]\n }\n }\n}\n\nexport let onStart = ($store, listener) =>\n on($store, listener, START, runListeners => {\n let originListen = $store.listen\n $store.listen = arg => {\n if (!$store.lc && !$store.starting) {\n $store.starting = true\n runListeners()\n delete $store.starting\n }\n return originListen(arg)\n }\n return () => {\n $store.listen = originListen\n }\n })\n\nexport let onStop = ($store, listener) =>\n on($store, listener, STOP, runListeners => {\n let originOff = $store.off\n $store.off = () => {\n runListeners()\n originOff()\n }\n return () => {\n $store.off = originOff\n }\n })\n\nexport let onSet = ($store, listener) =>\n on($store, listener, SET, runListeners => {\n let originSet = $store.set\n let originSetKey = $store.setKey\n if ($store.setKey) {\n $store.setKey = (changed, changedValue) => {\n let isAborted\n let abort = () => {\n isAborted = true\n }\n\n runListeners({\n abort,\n changed,\n newValue: { ...$store.value, [changed]: changedValue }\n })\n if (!isAborted) return originSetKey(changed, changedValue)\n }\n }\n $store.set = newValue => {\n let isAborted\n let abort = () => {\n isAborted = true\n }\n\n runListeners({ abort, newValue })\n if (!isAborted) return originSet(newValue)\n }\n return () => {\n $store.set = originSet\n $store.setKey = originSetKey\n }\n })\n\nexport let onNotify = ($store, listener) =>\n on($store, listener, NOTIFY, runListeners => {\n let originNotify = $store.notify\n $store.notify = (oldValue, changed) => {\n let isAborted\n let abort = () => {\n isAborted = true\n }\n\n runListeners({ abort, changed, oldValue })\n if (!isAborted) return originNotify(oldValue, changed)\n }\n return () => {\n $store.notify = originNotify\n }\n })\n\nexport const STORE_UNMOUNT_DELAY = 1000\n\nexport let onMount = ($store, initialize) => {\n let listener = payload => {\n let destroy = initialize(payload)\n if (destroy) $store.events[UNMOUNT].push(destroy)\n }\n return on($store, listener, MOUNT, runListeners => {\n let originListen = $store.listen\n $store.listen = (...args) => {\n if (!$store.lc && !$store.active) {\n $store.active = true\n runListeners()\n }\n return originListen(...args)\n }\n\n let originOff = $store.off\n $store.events[UNMOUNT] = []\n $store.off = () => {\n originOff()\n setTimeout(() => {\n if ($store.active && !$store.lc) {\n $store.active = false\n for (let destroy of $store.events[UNMOUNT]) destroy()\n $store.events[UNMOUNT] = []\n }\n }, STORE_UNMOUNT_DELAY)\n }\n\n if (process.env.NODE_ENV !== 'production') {\n let originClean = $store[clean]\n $store[clean] = () => {\n for (let destroy of $store.events[UNMOUNT]) destroy()\n $store.events[UNMOUNT] = []\n $store.active = false\n originClean()\n }\n }\n\n return () => {\n $store.listen = originListen\n $store.off = originOff\n }\n })\n}\n","import { atom, onMount } from \"nanostores\";\n//#region src/client/query.ts\nconst isServer = () => typeof window === \"undefined\";\nconst useAuthQuery = (initializedAtom, path, $fetch, options) => {\n\tconst value = atom({\n\t\tdata: null,\n\t\terror: null,\n\t\tisPending: true,\n\t\tisRefetching: false,\n\t\trefetch: (queryParams) => fn(queryParams)\n\t});\n\tconst fn = async (queryParams) => {\n\t\treturn new Promise((resolve) => {\n\t\t\tconst opts = typeof options === \"function\" ? options({\n\t\t\t\tdata: value.get().data,\n\t\t\t\terror: value.get().error,\n\t\t\t\tisPending: value.get().isPending\n\t\t\t}) : options;\n\t\t\t$fetch(path, {\n\t\t\t\t...opts,\n\t\t\t\tquery: {\n\t\t\t\t\t...opts?.query,\n\t\t\t\t\t...queryParams?.query\n\t\t\t\t},\n\t\t\t\tasync onSuccess(context) {\n\t\t\t\t\tvalue.set({\n\t\t\t\t\t\tdata: context.data,\n\t\t\t\t\t\terror: null,\n\t\t\t\t\t\tisPending: false,\n\t\t\t\t\t\tisRefetching: false,\n\t\t\t\t\t\trefetch: value.value.refetch\n\t\t\t\t\t});\n\t\t\t\t\tawait opts?.onSuccess?.(context);\n\t\t\t\t},\n\t\t\t\tasync onError(context) {\n\t\t\t\t\tconst { request } = context;\n\t\t\t\t\tconst retryAttempts = typeof request.retry === \"number\" ? request.retry : request.retry?.attempts;\n\t\t\t\t\tconst retryAttempt = request.retryAttempt || 0;\n\t\t\t\t\tif (retryAttempts && retryAttempt < retryAttempts) return;\n\t\t\t\t\tconst isUnauthorized = context.error.status === 401;\n\t\t\t\t\tvalue.set({\n\t\t\t\t\t\terror: context.error,\n\t\t\t\t\t\tdata: isUnauthorized ? null : value.get().data,\n\t\t\t\t\t\tisPending: false,\n\t\t\t\t\t\tisRefetching: false,\n\t\t\t\t\t\trefetch: value.value.refetch\n\t\t\t\t\t});\n\t\t\t\t\tawait opts?.onError?.(context);\n\t\t\t\t},\n\t\t\t\tasync onRequest(context) {\n\t\t\t\t\tconst currentValue = value.get();\n\t\t\t\t\tvalue.set({\n\t\t\t\t\t\tisPending: currentValue.data === null,\n\t\t\t\t\t\tdata: currentValue.data,\n\t\t\t\t\t\terror: null,\n\t\t\t\t\t\tisRefetching: true,\n\t\t\t\t\t\trefetch: value.value.refetch\n\t\t\t\t\t});\n\t\t\t\t\tawait opts?.onRequest?.(context);\n\t\t\t\t}\n\t\t\t}).catch((error) => {\n\t\t\t\tvalue.set({\n\t\t\t\t\terror,\n\t\t\t\t\tdata: value.get().data,\n\t\t\t\t\tisPending: false,\n\t\t\t\t\tisRefetching: false,\n\t\t\t\t\trefetch: value.value.refetch\n\t\t\t\t});\n\t\t\t}).finally(() => {\n\t\t\t\tresolve(void 0);\n\t\t\t});\n\t\t});\n\t};\n\tinitializedAtom = Array.isArray(initializedAtom) ? initializedAtom : [initializedAtom];\n\tlet isInitialized = false;\n\tfor (const initAtom of initializedAtom) initAtom.subscribe(async () => {\n\t\tif (isServer()) return;\n\t\tif (isInitialized) await fn();\n\t\telse onMount(value, () => {\n\t\t\tconst timeoutId = setTimeout(async () => {\n\t\t\t\tif (!isInitialized) {\n\t\t\t\t\tisInitialized = true;\n\t\t\t\t\tawait fn();\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t\treturn () => {\n\t\t\t\tvalue.off();\n\t\t\t\tinitAtom.off();\n\t\t\t\tclearTimeout(timeoutId);\n\t\t\t};\n\t\t});\n\t});\n\treturn value;\n};\n//#endregion\nexport { useAuthQuery };\n","//#region src/client/broadcast-channel.ts\nconst kBroadcastChannel = Symbol.for(\"better-auth:broadcast-channel\");\nconst now = () => Math.floor(Date.now() / 1e3);\nvar WindowBroadcastChannel = class {\n\tlisteners = /* @__PURE__ */ new Set();\n\tname;\n\tconstructor(name = \"better-auth.message\") {\n\t\tthis.name = name;\n\t}\n\tsubscribe(listener) {\n\t\tthis.listeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t};\n\t}\n\tpost(message) {\n\t\tif (typeof window === \"undefined\") return;\n\t\ttry {\n\t\t\tlocalStorage.setItem(this.name, JSON.stringify({\n\t\t\t\t...message,\n\t\t\t\ttimestamp: now()\n\t\t\t}));\n\t\t} catch {}\n\t}\n\tsetup() {\n\t\tif (typeof window === \"undefined\" || typeof window.addEventListener === \"undefined\") return () => {};\n\t\tconst handler = (event) => {\n\t\t\tif (event.key !== this.name) return;\n\t\t\tconst message = JSON.parse(event.newValue ?? \"{}\");\n\t\t\tif (message?.event !== \"session\" || !message?.data) return;\n\t\t\tthis.listeners.forEach((listener) => listener(message));\n\t\t};\n\t\twindow.addEventListener(\"storage\", handler);\n\t\treturn () => {\n\t\t\twindow.removeEventListener(\"storage\", handler);\n\t\t};\n\t}\n};\nfunction getGlobalBroadcastChannel(name = \"better-auth.message\") {\n\tif (!globalThis[kBroadcastChannel]) globalThis[kBroadcastChannel] = new WindowBroadcastChannel(name);\n\treturn globalThis[kBroadcastChannel];\n}\n//#endregion\nexport { getGlobalBroadcastChannel, kBroadcastChannel };\n","//#region src/client/focus-manager.ts\nconst kFocusManager = Symbol.for(\"better-auth:focus-manager\");\nvar WindowFocusManager = class {\n\tlisteners = /* @__PURE__ */ new Set();\n\tsubscribe(listener) {\n\t\tthis.listeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t};\n\t}\n\tsetFocused(focused) {\n\t\tthis.listeners.forEach((listener) => listener(focused));\n\t}\n\tsetup() {\n\t\tif (typeof window === \"undefined\" || typeof document === \"undefined\" || typeof window.addEventListener === \"undefined\") return () => {};\n\t\tconst visibilityHandler = () => {\n\t\t\tif (document.visibilityState === \"visible\") this.setFocused(true);\n\t\t};\n\t\tdocument.addEventListener(\"visibilitychange\", visibilityHandler, false);\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"visibilitychange\", visibilityHandler, false);\n\t\t};\n\t}\n};\nfunction getGlobalFocusManager() {\n\tif (!globalThis[kFocusManager]) globalThis[kFocusManager] = new WindowFocusManager();\n\treturn globalThis[kFocusManager];\n}\n//#endregion\nexport { getGlobalFocusManager, kFocusManager };\n","//#region src/client/online-manager.ts\nconst kOnlineManager = Symbol.for(\"better-auth:online-manager\");\nvar WindowOnlineManager = class {\n\tlisteners = /* @__PURE__ */ new Set();\n\tisOnline = typeof navigator !== \"undefined\" ? navigator.onLine : true;\n\tsubscribe(listener) {\n\t\tthis.listeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t};\n\t}\n\tsetOnline(online) {\n\t\tthis.isOnline = online;\n\t\tthis.listeners.forEach((listener) => listener(online));\n\t}\n\tsetup() {\n\t\tif (typeof window === \"undefined\" || typeof window.addEventListener === \"undefined\") return () => {};\n\t\tconst onOnline = () => this.setOnline(true);\n\t\tconst onOffline = () => this.setOnline(false);\n\t\twindow.addEventListener(\"online\", onOnline, false);\n\t\twindow.addEventListener(\"offline\", onOffline, false);\n\t\treturn () => {\n\t\t\twindow.removeEventListener(\"online\", onOnline, false);\n\t\t\twindow.removeEventListener(\"offline\", onOffline, false);\n\t\t};\n\t}\n};\nfunction getGlobalOnlineManager() {\n\tif (!globalThis[kOnlineManager]) globalThis[kOnlineManager] = new WindowOnlineManager();\n\treturn globalThis[kOnlineManager];\n}\n//#endregion\nexport { getGlobalOnlineManager, kOnlineManager };\n","//#region src/client/parser.ts\nconst PROTO_POLLUTION_PATTERNS = {\n\tproto: /\"(?:_|\\\\u0{2}5[Ff]){2}(?:p|\\\\u0{2}70)(?:r|\\\\u0{2}72)(?:o|\\\\u0{2}6[Ff])(?:t|\\\\u0{2}74)(?:o|\\\\u0{2}6[Ff])(?:_|\\\\u0{2}5[Ff]){2}\"\\s*:/,\n\tconstructor: /\"(?:c|\\\\u0063)(?:o|\\\\u006[Ff])(?:n|\\\\u006[Ee])(?:s|\\\\u0073)(?:t|\\\\u0074)(?:r|\\\\u0072)(?:u|\\\\u0075)(?:c|\\\\u0063)(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:r|\\\\u0072)\"\\s*:/,\n\tprotoShort: /\"__proto__\"\\s*:/,\n\tconstructorShort: /\"constructor\"\\s*:/\n};\nconst JSON_SIGNATURE = /^\\s*[\"[{]|^\\s*-?\\d{1,16}(\\.\\d{1,17})?([Ee][+-]?\\d+)?\\s*$/;\nconst SPECIAL_VALUES = {\n\ttrue: true,\n\tfalse: false,\n\tnull: null,\n\tundefined: void 0,\n\tnan: NaN,\n\tinfinity: Number.POSITIVE_INFINITY,\n\t\"-infinity\": Number.NEGATIVE_INFINITY\n};\nconst ISO_DATE_REGEX = /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,7}))?(?:Z|([+-])(\\d{2}):(\\d{2}))$/;\nfunction isValidDate(date) {\n\treturn date instanceof Date && !isNaN(date.getTime());\n}\nfunction parseISODate(value) {\n\tconst match = ISO_DATE_REGEX.exec(value);\n\tif (!match) return null;\n\tconst [, year, month, day, hour, minute, second, ms, offsetSign, offsetHour, offsetMinute] = match;\n\tconst date = new Date(Date.UTC(parseInt(year, 10), parseInt(month, 10) - 1, parseInt(day, 10), parseInt(hour, 10), parseInt(minute, 10), parseInt(second, 10), ms ? parseInt(ms.padEnd(3, \"0\"), 10) : 0));\n\tif (offsetSign) {\n\t\tconst offset = (parseInt(offsetHour, 10) * 60 + parseInt(offsetMinute, 10)) * (offsetSign === \"+\" ? -1 : 1);\n\t\tdate.setUTCMinutes(date.getUTCMinutes() + offset);\n\t}\n\treturn isValidDate(date) ? date : null;\n}\nfunction betterJSONParse(value, options = {}) {\n\tconst { strict = false, warnings = false, reviver, parseDates = true } = options;\n\tif (typeof value !== \"string\") return value;\n\tconst trimmed = value.trim();\n\tif (trimmed.length > 0 && trimmed[0] === \"\\\"\" && trimmed.endsWith(\"\\\"\") && !trimmed.slice(1, -1).includes(\"\\\"\")) return trimmed.slice(1, -1);\n\tconst lowerValue = trimmed.toLowerCase();\n\tif (lowerValue.length <= 9 && lowerValue in SPECIAL_VALUES) return SPECIAL_VALUES[lowerValue];\n\tif (!JSON_SIGNATURE.test(trimmed)) {\n\t\tif (strict) throw new SyntaxError(\"[better-json] Invalid JSON\");\n\t\treturn value;\n\t}\n\tif (Object.entries(PROTO_POLLUTION_PATTERNS).some(([key, pattern]) => {\n\t\tconst matches = pattern.test(trimmed);\n\t\tif (matches && warnings) console.warn(`[better-json] Detected potential prototype pollution attempt using ${key} pattern`);\n\t\treturn matches;\n\t}) && strict) throw new Error(\"[better-json] Potential prototype pollution attempt detected\");\n\ttry {\n\t\tconst secureReviver = (key, value) => {\n\t\t\tif (key === \"__proto__\" || key === \"constructor\" && value && typeof value === \"object\" && \"prototype\" in value) {\n\t\t\t\tif (warnings) console.warn(`[better-json] Dropping \"${key}\" key to prevent prototype pollution`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (parseDates && typeof value === \"string\") {\n\t\t\t\tconst date = parseISODate(value);\n\t\t\t\tif (date) return date;\n\t\t\t}\n\t\t\treturn reviver ? reviver(key, value) : value;\n\t\t};\n\t\treturn JSON.parse(trimmed, secureReviver);\n\t} catch (error) {\n\t\tif (strict) throw error;\n\t\treturn value;\n\t}\n}\nfunction parseJSON(value, options = { strict: true }) {\n\treturn betterJSONParse(value, options);\n}\n//#endregion\nexport { parseJSON };\n","import { getGlobalBroadcastChannel } from \"./broadcast-channel.mjs\";\nimport { getGlobalFocusManager } from \"./focus-manager.mjs\";\nimport { getGlobalOnlineManager } from \"./online-manager.mjs\";\n//#region src/client/session-refresh.ts\nconst now = () => Math.floor(Date.now() / 1e3);\n/**\n* Normalize $fetch response: `throw: true` returns data directly, otherwise `{ data, error }`.\n*/\nfunction normalizeSessionResponse(res) {\n\tif (typeof res === \"object\" && res !== null && \"data\" in res && \"error\" in res) return res;\n\treturn {\n\t\tdata: res,\n\t\terror: null\n\t};\n}\n/**\n* Rate limit: don't refetch on focus if a session request was made within this many seconds\n*/\nconst FOCUS_REFETCH_RATE_LIMIT_SECONDS = 5;\nfunction createSessionRefreshManager(opts) {\n\tconst { sessionAtom, sessionSignal, $fetch, options = {} } = opts;\n\tconst refetchInterval = options.sessionOptions?.refetchInterval ?? 0;\n\tconst refetchOnWindowFocus = options.sessionOptions?.refetchOnWindowFocus ?? true;\n\tconst refetchWhenOffline = options.sessionOptions?.refetchWhenOffline ?? false;\n\tconst state = {\n\t\tlastSync: 0,\n\t\tlastSessionRequest: 0,\n\t\tcachedSession: void 0\n\t};\n\tconst shouldRefetch = () => {\n\t\treturn refetchWhenOffline || getGlobalOnlineManager().isOnline;\n\t};\n\tconst triggerRefetch = (event) => {\n\t\tif (!shouldRefetch()) return;\n\t\tif (event?.event === \"storage\") {\n\t\t\tstate.lastSync = now();\n\t\t\tsessionSignal.set(!sessionSignal.get());\n\t\t\treturn;\n\t\t}\n\t\tconst currentSession = sessionAtom.get();\n\t\tconst fetchSessionWithRefresh = () => {\n\t\t\tstate.lastSessionRequest = now();\n\t\t\t$fetch(\"/get-session\").then(async (res) => {\n\t\t\t\tlet { data, error } = normalizeSessionResponse(res);\n\t\t\t\tif (data?.needsRefresh) try {\n\t\t\t\t\tconst refreshRes = await $fetch(\"/get-session\", { method: \"POST\" });\n\t\t\t\t\t({data, error} = normalizeSessionResponse(refreshRes));\n\t\t\t\t} catch {}\n\t\t\t\tconst sessionData = data?.session && data?.user ? data : null;\n\t\t\t\tsessionAtom.set({\n\t\t\t\t\t...currentSession,\n\t\t\t\t\tdata: sessionData,\n\t\t\t\t\terror\n\t\t\t\t});\n\t\t\t\tstate.lastSync = now();\n\t\t\t\tsessionSignal.set(!sessionSignal.get());\n\t\t\t}).catch(() => {});\n\t\t};\n\t\tif (event?.event === \"poll\") {\n\t\t\tfetchSessionWithRefresh();\n\t\t\treturn;\n\t\t}\n\t\tif (event?.event === \"visibilitychange\") {\n\t\t\tif (now() - state.lastSessionRequest < FOCUS_REFETCH_RATE_LIMIT_SECONDS) return;\n\t\t\tstate.lastSessionRequest = now();\n\t\t}\n\t\tif (event?.event === \"visibilitychange\") {\n\t\t\tfetchSessionWithRefresh();\n\t\t\treturn;\n\t\t}\n\t\tif (currentSession?.data === null || currentSession?.data === void 0) {\n\t\t\tstate.lastSync = now();\n\t\t\tsessionSignal.set(!sessionSignal.get());\n\t\t}\n\t};\n\tconst broadcastSessionUpdate = (trigger) => {\n\t\tgetGlobalBroadcastChannel().post({\n\t\t\tevent: \"session\",\n\t\t\tdata: { trigger },\n\t\t\tclientId: Math.random().toString(36).substring(7)\n\t\t});\n\t};\n\tconst setupPolling = () => {\n\t\tif (refetchInterval && refetchInterval > 0) state.pollInterval = setInterval(() => {\n\t\t\tif (sessionAtom.get()?.data) triggerRefetch({ event: \"poll\" });\n\t\t}, refetchInterval * 1e3);\n\t};\n\tconst setupBroadcast = () => {\n\t\tstate.unsubscribeBroadcast = getGlobalBroadcastChannel().subscribe(() => {\n\t\t\ttriggerRefetch({ event: \"storage\" });\n\t\t});\n\t};\n\tconst setupFocusRefetch = () => {\n\t\tif (!refetchOnWindowFocus) return;\n\t\tstate.unsubscribeFocus = getGlobalFocusManager().subscribe(() => {\n\t\t\ttriggerRefetch({ event: \"visibilitychange\" });\n\t\t});\n\t};\n\tconst setupOnlineRefetch = () => {\n\t\tstate.unsubscribeOnline = getGlobalOnlineManager().subscribe((online) => {\n\t\t\tif (online) triggerRefetch({ event: \"visibilitychange\" });\n\t\t});\n\t};\n\tconst init = () => {\n\t\tsetupPolling();\n\t\tsetupBroadcast();\n\t\tsetupFocusRefetch();\n\t\tsetupOnlineRefetch();\n\t\tgetGlobalBroadcastChannel().setup();\n\t\tgetGlobalFocusManager().setup();\n\t\tgetGlobalOnlineManager().setup();\n\t};\n\tconst cleanup = () => {\n\t\tif (state.pollInterval) {\n\t\t\tclearInterval(state.pollInterval);\n\t\t\tstate.pollInterval = void 0;\n\t\t}\n\t\tif (state.unsubscribeBroadcast) {\n\t\t\tstate.unsubscribeBroadcast();\n\t\t\tstate.unsubscribeBroadcast = void 0;\n\t\t}\n\t\tif (state.unsubscribeFocus) {\n\t\t\tstate.unsubscribeFocus();\n\t\t\tstate.unsubscribeFocus = void 0;\n\t\t}\n\t\tif (state.unsubscribeOnline) {\n\t\t\tstate.unsubscribeOnline();\n\t\t\tstate.unsubscribeOnline = void 0;\n\t\t}\n\t\tstate.lastSync = 0;\n\t\tstate.lastSessionRequest = 0;\n\t\tstate.cachedSession = void 0;\n\t};\n\treturn {\n\t\tinit,\n\t\tcleanup,\n\t\ttriggerRefetch,\n\t\tbroadcastSessionUpdate\n\t};\n}\n//#endregion\nexport { createSessionRefreshManager };\n","//#region src/env/env-impl.ts\nconst _envShim = Object.create(null);\nconst _getEnv = (useShim) => globalThis.process?.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (useShim ? _envShim : globalThis);\nconst env = new Proxy(_envShim, {\n\tget(_, prop) {\n\t\treturn _getEnv()[prop] ?? _envShim[prop];\n\t},\n\thas(_, prop) {\n\t\treturn prop in _getEnv() || prop in _envShim;\n\t},\n\tset(_, prop, value) {\n\t\tconst env = _getEnv(true);\n\t\tenv[prop] = value;\n\t\treturn true;\n\t},\n\tdeleteProperty(_, prop) {\n\t\tif (!prop) return false;\n\t\tconst env = _getEnv(true);\n\t\tdelete env[prop];\n\t\treturn true;\n\t},\n\townKeys() {\n\t\tconst env = _getEnv(true);\n\t\treturn Object.keys(env);\n\t}\n});\nfunction toBoolean(val) {\n\treturn val ? val !== \"false\" : false;\n}\nconst nodeENV = typeof process !== \"undefined\" && process.env && process.env.NODE_ENV || \"\";\n/** Detect if `NODE_ENV` environment variable is `production` */\nconst isProduction = nodeENV === \"production\";\n/** Detect if `NODE_ENV` environment variable is `dev` or `development` */\nconst isDevelopment = () => nodeENV === \"dev\" || nodeENV === \"development\";\n/** Detect if `NODE_ENV` environment variable is `test` */\nconst isTest = () => nodeENV === \"test\" || toBoolean(env.TEST);\n/**\n* Get environment variable with fallback\n*/\nfunction getEnvVar(key, fallback) {\n\tif (typeof process !== \"undefined\" && process.env) return process.env[key] ?? fallback;\n\tif (typeof Deno !== \"undefined\") return Deno.env.get(key) ?? fallback;\n\tif (typeof Bun !== \"undefined\") return Bun.env[key] ?? fallback;\n\treturn fallback;\n}\n/**\n* Get boolean environment variable\n*/\nfunction getBooleanEnvVar(key, fallback = true) {\n\tconst value = getEnvVar(key);\n\tif (!value) return fallback;\n\treturn value !== \"0\" && value.toLowerCase() !== \"false\" && value !== \"\";\n}\n/**\n* Common environment variables used in Better Auth\n*/\nconst ENV = Object.freeze({\n\tget BETTER_AUTH_SECRET() {\n\t\treturn getEnvVar(\"BETTER_AUTH_SECRET\");\n\t},\n\tget AUTH_SECRET() {\n\t\treturn getEnvVar(\"AUTH_SECRET\");\n\t},\n\tget BETTER_AUTH_TELEMETRY() {\n\t\treturn getEnvVar(\"BETTER_AUTH_TELEMETRY\");\n\t},\n\tget BETTER_AUTH_TELEMETRY_ID() {\n\t\treturn getEnvVar(\"BETTER_AUTH_TELEMETRY_ID\");\n\t},\n\tget NODE_ENV() {\n\t\treturn getEnvVar(\"NODE_ENV\", \"development\");\n\t},\n\tget PACKAGE_VERSION() {\n\t\treturn getEnvVar(\"PACKAGE_VERSION\", \"0.0.0\");\n\t},\n\tget BETTER_AUTH_TELEMETRY_ENDPOINT() {\n\t\treturn getEnvVar(\"BETTER_AUTH_TELEMETRY_ENDPOINT\", \"\");\n\t}\n});\n//#endregion\nexport { ENV, env, getBooleanEnvVar, getEnvVar, isDevelopment, isProduction, isTest, nodeENV };\n","import { wildcardMatch } from \"./wildcard.mjs\";\nimport { env } from \"@better-auth/core/env\";\nimport { BetterAuthError } from \"@better-auth/core/error\";\n//#region src/utils/url.ts\n/**\n* Minimal loopback check for dev scheme inference only. Reachable from\n* `client/config.ts` via `getBaseURL`, so we MUST NOT import the full\n* `@better-auth/core/utils/host` classifier here: its `utils/ip` dependency\n* on zod would leak into the client bundle (see `e2e/smoke/test/vite.spec.ts`).\n*\n* Server-side SSRF/loopback checks (oauth redirect matching, trusted-origin\n* resolution, electron fetch gate) continue to use the authoritative\n* `isLoopbackHost` from `@better-auth/core/utils/host`. This helper's only\n* job is picking `http` vs `https` for dev ergonomics.\n*/\nfunction isLoopbackForDevScheme(host) {\n\tconst hostname = host.replace(/:\\d+$/, \"\").replace(/^\\[|\\]$/g, \"\").toLowerCase();\n\treturn hostname === \"localhost\" || hostname.endsWith(\".localhost\") || hostname === \"::1\" || hostname.startsWith(\"127.\");\n}\nfunction checkHasPath(url) {\n\ttry {\n\t\treturn (new URL(url).pathname.replace(/\\/+$/, \"\") || \"/\") !== \"/\";\n\t} catch {\n\t\tthrow new BetterAuthError(`Invalid base URL: ${url}. Please provide a valid base URL.`);\n\t}\n}\nfunction assertHasProtocol(url) {\n\ttry {\n\t\tconst parsedUrl = new URL(url);\n\t\tif (parsedUrl.protocol !== \"http:\" && parsedUrl.protocol !== \"https:\") throw new BetterAuthError(`Invalid base URL: ${url}. URL must include 'http://' or 'https://'`);\n\t} catch (error) {\n\t\tif (error instanceof BetterAuthError) throw error;\n\t\tthrow new BetterAuthError(`Invalid base URL: ${url}. Please provide a valid base URL.`, { cause: error });\n\t}\n}\nfunction withPath(url, path = \"/api/auth\") {\n\tassertHasProtocol(url);\n\tif (checkHasPath(url)) return url;\n\tconst trimmedUrl = url.replace(/\\/+$/, \"\");\n\tif (!path || path === \"/\") return trimmedUrl;\n\tpath = path.startsWith(\"/\") ? path : `/${path}`;\n\treturn `${trimmedUrl}${path}`;\n}\nfunction validateProxyHeader(header, type) {\n\tif (!header || header.trim() === \"\") return false;\n\tif (type === \"proto\") return header === \"http\" || header === \"https\";\n\tif (type === \"host\") {\n\t\tif ([\n\t\t\t/\\.\\./,\n\t\t\t/\\0/,\n\t\t\t/[\\s]/,\n\t\t\t/^[.]/,\n\t\t\t/[<>'\"]/,\n\t\t\t/javascript:/i,\n\t\t\t/file:/i,\n\t\t\t/data:/i\n\t\t].some((pattern) => pattern.test(header))) return false;\n\t\treturn /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(header) || /^(\\d{1,3}\\.){3}\\d{1,3}(:[0-9]{1,5})?$/.test(header) || /^\\[[0-9a-fA-F:]+\\](:[0-9]{1,5})?$/.test(header) || /^localhost(:[0-9]{1,5})?$/i.test(header);\n\t}\n\treturn false;\n}\nfunction getBaseURL(url, path, request, loadEnv, trustedProxyHeaders) {\n\tif (url) return withPath(url, path);\n\tif (loadEnv !== false) {\n\t\tconst fromEnv = env.BETTER_AUTH_URL || env.NEXT_PUBLIC_BETTER_AUTH_URL || env.PUBLIC_BETTER_AUTH_URL || env.NUXT_PUBLIC_BETTER_AUTH_URL || env.NUXT_PUBLIC_AUTH_URL || (env.BASE_URL !== \"/\" ? env.BASE_URL : void 0);\n\t\tif (fromEnv) return withPath(fromEnv, path);\n\t}\n\tconst fromRequest = request?.headers.get(\"x-forwarded-host\");\n\tconst fromRequestProto = request?.headers.get(\"x-forwarded-proto\");\n\tif (fromRequest && fromRequestProto && trustedProxyHeaders) {\n\t\tif (validateProxyHeader(fromRequestProto, \"proto\") && validateProxyHeader(fromRequest, \"host\")) try {\n\t\t\treturn withPath(`${fromRequestProto}://${fromRequest}`, path);\n\t\t} catch (_error) {}\n\t}\n\tif (request) {\n\t\tconst url = getOrigin(request.url);\n\t\tif (!url) throw new BetterAuthError(\"Could not get origin from request. Please provide a valid base URL.\");\n\t\treturn withPath(url, path);\n\t}\n\tif (typeof window !== \"undefined\" && window.location) return withPath(window.location.origin, path);\n}\nfunction getOrigin(url) {\n\ttry {\n\t\tconst parsedUrl = new URL(url);\n\t\treturn parsedUrl.origin === \"null\" ? null : parsedUrl.origin;\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction getProtocol(url) {\n\ttry {\n\t\treturn new URL(url).protocol;\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction getHost(url) {\n\ttry {\n\t\treturn new URL(url).host;\n\t} catch {\n\t\treturn null;\n\t}\n}\n/**\n* Checks if the baseURL config is a dynamic config object\n*/\nfunction isDynamicBaseURLConfig(config) {\n\treturn typeof config === \"object\" && config !== null && \"allowedHosts\" in config && Array.isArray(config.allowedHosts);\n}\n/**\n* Check if a value is a `Request`\n* - `instanceof`: works for native Request instances\n* - `toString`: handles where instanceof check fails but the object is still a\n* valid Request (e.g. cross-realm, polyfills). Paired with a shape check so\n* an object that only spoofs `Symbol.toStringTag` without the real shape is\n* rejected before downstream code tries to read `.headers` / `.url`.\n*\n* @param value The value to check\n* @returns `true` if the value is a Request instance\n*/\nfunction isRequestLike(value) {\n\tif (value instanceof Request) return true;\n\tif (typeof value !== \"object\" || value === null || Object.prototype.toString.call(value) !== \"[object Request]\") return false;\n\tconst v = value;\n\treturn typeof v.url === \"string\" && typeof v.headers === \"object\" && v.headers !== null && typeof v.headers.get === \"function\";\n}\n/**\n* Extracts the host from a `Request` or `Headers`.\n* Honors `x-forwarded-host` only when `trustedProxyHeaders` is enabled,\n* then falls back to the `host` header and finally the request URL.\n*/\nfunction getHostFromSource(source, trustedProxyHeaders) {\n\tconst headers = isRequestLike(source) ? source.headers : source;\n\tif (trustedProxyHeaders) {\n\t\tconst forwardedHost = headers.get(\"x-forwarded-host\");\n\t\tif (forwardedHost && validateProxyHeader(forwardedHost, \"host\")) return forwardedHost;\n\t}\n\tconst host = headers.get(\"host\");\n\tif (host && validateProxyHeader(host, \"host\")) return host;\n\tif (isRequestLike(source)) try {\n\t\treturn new URL(source.url).host;\n\t} catch {\n\t\treturn null;\n\t}\n\treturn null;\n}\n/**\n* Extracts the protocol from a `Request` or `Headers`.\n* Honors `x-forwarded-proto` only when `trustedProxyHeaders` is enabled,\n* then falls back to the request URL, then to \"https\".\n*/\nfunction getProtocolFromSource(source, configProtocol, trustedProxyHeaders) {\n\tif (configProtocol === \"http\" || configProtocol === \"https\") return configProtocol;\n\tconst headers = isRequestLike(source) ? source.headers : source;\n\tif (trustedProxyHeaders) {\n\t\tconst forwardedProto = headers.get(\"x-forwarded-proto\");\n\t\tif (forwardedProto && validateProxyHeader(forwardedProto, \"proto\")) return forwardedProto;\n\t}\n\tif (isRequestLike(source)) try {\n\t\tconst url = new URL(source.url);\n\t\tif (url.protocol === \"http:\" || url.protocol === \"https:\") return url.protocol.slice(0, -1);\n\t} catch {}\n\tconst host = getHostFromSource(source, trustedProxyHeaders);\n\tif (host && isLoopbackForDevScheme(host)) return \"http\";\n\treturn \"https\";\n}\n/**\n* Matches a hostname against a host pattern.\n* Supports wildcard patterns like `*.vercel.app` or `preview-*.myapp.com`.\n*\n* @param host The hostname to test (e.g., \"myapp.com\", \"preview-123.vercel.app\")\n* @param pattern The host pattern (e.g., \"myapp.com\", \"*.vercel.app\")\n* @returns {boolean} true if the host matches the pattern, false otherwise.\n*\n* @example\n* ```ts\n* matchesHostPattern(\"myapp.com\", \"myapp.com\") // true\n* matchesHostPattern(\"preview-123.vercel.app\", \"*.vercel.app\") // true\n* matchesHostPattern(\"preview-123.myapp.com\", \"preview-*.myapp.com\") // true\n* matchesHostPattern(\"evil.com\", \"myapp.com\") // false\n* ```\n*/\nconst matchesHostPattern = (host, pattern) => {\n\tif (!host || !pattern) return false;\n\tconst normalizedHost = host.replace(/^https?:\\/\\//, \"\").split(\"/\")[0].toLowerCase();\n\tconst normalizedPattern = pattern.replace(/^https?:\\/\\//, \"\").split(\"/\")[0].toLowerCase();\n\tif (normalizedPattern.includes(\"*\") || normalizedPattern.includes(\"?\")) return wildcardMatch(normalizedPattern)(normalizedHost);\n\treturn normalizedHost.toLowerCase() === normalizedPattern.toLowerCase();\n};\n/**\n* Resolves the base URL from a dynamic config based on the incoming request.\n* Validates the derived host against the allowedHosts allowlist.\n*\n* @param config The dynamic base URL config\n* @param request The incoming request\n* @param basePath The base path to append\n* @returns The resolved base URL with path\n* @throws BetterAuthError if host is not in allowedHosts and no fallback is set\n*/\nfunction resolveDynamicBaseURL(config, source, basePath, trustedProxyHeaders) {\n\tconst host = getHostFromSource(source, trustedProxyHeaders);\n\tif (!host) {\n\t\tif (config.fallback) return withPath(config.fallback, basePath);\n\t\tthrow new BetterAuthError(\"Could not determine host from request headers. Please provide a fallback URL in your baseURL config.\");\n\t}\n\tif (config.allowedHosts.some((pattern) => matchesHostPattern(host, pattern))) return withPath(`${getProtocolFromSource(source, config.protocol, trustedProxyHeaders)}://${host}`, basePath);\n\tif (config.fallback) return withPath(config.fallback, basePath);\n\tthrow new BetterAuthError(`Host \"${host}\" is not in the allowed hosts list. Allowed hosts: ${config.allowedHosts.join(\", \")}. Add this host to your allowedHosts config or provide a fallback URL.`);\n}\n/**\n* Resolves the base URL from any config type (static string or dynamic object).\n* This is the main entry point for base URL resolution.\n*\n* @param config The base URL config (string or object)\n* @param basePath The base path to append\n* @param request Optional request for dynamic resolution\n* @param loadEnv Whether to load from environment variables\n* @param trustedProxyHeaders Whether to trust proxy headers (for legacy behavior)\n* @returns The resolved base URL with path\n*/\nfunction resolveBaseURL(config, basePath, source, loadEnv, trustedProxyHeaders) {\n\tif (isDynamicBaseURLConfig(config)) {\n\t\tif (source) return resolveDynamicBaseURL(config, source, basePath, trustedProxyHeaders);\n\t\tif (config.fallback) return withPath(config.fallback, basePath);\n\t\treturn getBaseURL(void 0, basePath, void 0, loadEnv, trustedProxyHeaders);\n\t}\n\tconst request = isRequestLike(source) ? source : void 0;\n\tif (typeof config === \"string\") return getBaseURL(config, basePath, request, loadEnv, trustedProxyHeaders);\n\treturn getBaseURL(void 0, basePath, request, loadEnv, trustedProxyHeaders);\n}\n//#endregion\nexport { getBaseURL, getHost, getHostFromSource, getOrigin, getProtocol, getProtocolFromSource, isDynamicBaseURLConfig, isRequestLike, matchesHostPattern, resolveBaseURL, resolveDynamicBaseURL };\n","//#region src/client/fetch-plugins.ts\nconst redirectPlugin = {\n\tid: \"redirect\",\n\tname: \"Redirect\",\n\thooks: { onSuccess(context) {\n\t\tif (context.data?.url && context.data?.redirect) {\n\t\t\tif (typeof window !== \"undefined\" && window.location) {\n\t\t\t\tif (window.location) try {\n\t\t\t\t\twindow.location.href = context.data.url;\n\t\t\t\t} catch {}\n\t\t\t}\n\t\t}\n\t} }\n};\n//#endregion\nexport { redirectPlugin };\n","import { useAuthQuery } from \"./query.mjs\";\nimport { createSessionRefreshManager } from \"./session-refresh.mjs\";\nimport { atom, onMount } from \"nanostores\";\n//#region src/client/session-atom.ts\nfunction getSessionAtom($fetch, options) {\n\tconst $signal = atom(false);\n\tconst session = useAuthQuery($signal, \"/get-session\", $fetch, { method: \"GET\" });\n\tlet broadcastSessionUpdate = () => {};\n\tonMount(session, () => {\n\t\tconst refreshManager = createSessionRefreshManager({\n\t\t\tsessionAtom: session,\n\t\t\tsessionSignal: $signal,\n\t\t\t$fetch,\n\t\t\toptions\n\t\t});\n\t\trefreshManager.init();\n\t\tbroadcastSessionUpdate = refreshManager.broadcastSessionUpdate;\n\t\treturn () => {\n\t\t\trefreshManager.cleanup();\n\t\t};\n\t});\n\treturn {\n\t\tsession,\n\t\t$sessionSignal: $signal,\n\t\tbroadcastSessionUpdate: (trigger) => broadcastSessionUpdate(trigger)\n\t};\n}\n//#endregion\nexport { getSessionAtom };\n","function isPlainObject(value) {\n if (value === null || typeof value !== \"object\") {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {\n return false;\n }\n if (Symbol.iterator in value) {\n return false;\n }\n if (Symbol.toStringTag in value) {\n return Object.prototype.toString.call(value) === \"[object Module]\";\n }\n return true;\n}\n\nfunction _defu(baseObject, defaults, namespace = \".\", merger) {\n if (!isPlainObject(defaults)) {\n return _defu(baseObject, {}, namespace, merger);\n }\n const object = { ...defaults };\n for (const key of Object.keys(baseObject)) {\n if (key === \"__proto__\" || key === \"constructor\") {\n continue;\n }\n const value = baseObject[key];\n if (value === null || value === void 0) {\n continue;\n }\n if (merger && merger(object, key, value, namespace)) {\n continue;\n }\n if (Array.isArray(value) && Array.isArray(object[key])) {\n object[key] = [...value, ...object[key]];\n } else if (isPlainObject(value) && isPlainObject(object[key])) {\n object[key] = _defu(\n value,\n object[key],\n (namespace ? `${namespace}.` : \"\") + key.toString(),\n merger\n );\n } else {\n object[key] = value;\n }\n }\n return object;\n}\nfunction createDefu(merger) {\n return (...arguments_) => (\n // eslint-disable-next-line unicorn/no-array-reduce\n arguments_.reduce((p, c) => _defu(p, c, \"\", merger), {})\n );\n}\nconst defu = createDefu();\nconst defuFn = createDefu((object, key, currentValue) => {\n if (object[key] !== void 0 && typeof currentValue === \"function\") {\n object[key] = currentValue(object[key]);\n return true;\n }\n});\nconst defuArrayFn = createDefu((object, key, currentValue) => {\n if (Array.isArray(object[key]) && typeof currentValue === \"function\") {\n object[key] = currentValue(object[key]);\n return true;\n }\n});\n\nexport { createDefu, defu as default, defu, defuArrayFn, defuFn };\n","var __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\n\n// src/error.ts\nvar BetterFetchError = class extends Error {\n constructor(status, statusText, error) {\n super(statusText || status.toString(), {\n cause: error\n });\n this.status = status;\n this.statusText = statusText;\n this.error = error;\n Error.captureStackTrace(this, this.constructor);\n }\n};\n\n// src/plugins.ts\nvar initializePlugins = async (url, options) => {\n var _a, _b, _c, _d, _e, _f;\n let opts = options || {};\n const hooks = {\n onRequest: [options == null ? void 0 : options.onRequest],\n onResponse: [options == null ? void 0 : options.onResponse],\n onSuccess: [options == null ? void 0 : options.onSuccess],\n onError: [options == null ? void 0 : options.onError],\n onRetry: [options == null ? void 0 : options.onRetry]\n };\n if (!options || !(options == null ? void 0 : options.plugins)) {\n return {\n url,\n options: opts,\n hooks\n };\n }\n for (const plugin of (options == null ? void 0 : options.plugins) || []) {\n if (plugin.init) {\n const pluginRes = await ((_a = plugin.init) == null ? void 0 : _a.call(plugin, url.toString(), options));\n opts = pluginRes.options || opts;\n url = pluginRes.url;\n }\n hooks.onRequest.push((_b = plugin.hooks) == null ? void 0 : _b.onRequest);\n hooks.onResponse.push((_c = plugin.hooks) == null ? void 0 : _c.onResponse);\n hooks.onSuccess.push((_d = plugin.hooks) == null ? void 0 : _d.onSuccess);\n hooks.onError.push((_e = plugin.hooks) == null ? void 0 : _e.onError);\n hooks.onRetry.push((_f = plugin.hooks) == null ? void 0 : _f.onRetry);\n }\n return {\n url,\n options: opts,\n hooks\n };\n};\n\n// src/retry.ts\nvar LinearRetryStrategy = class {\n constructor(options) {\n this.options = options;\n }\n shouldAttemptRetry(attempt, response) {\n if (this.options.shouldRetry) {\n return Promise.resolve(\n attempt < this.options.attempts && this.options.shouldRetry(response)\n );\n }\n return Promise.resolve(attempt < this.options.attempts);\n }\n getDelay() {\n return this.options.delay;\n }\n};\nvar ExponentialRetryStrategy = class {\n constructor(options) {\n this.options = options;\n }\n shouldAttemptRetry(attempt, response) {\n if (this.options.shouldRetry) {\n return Promise.resolve(\n attempt < this.options.attempts && this.options.shouldRetry(response)\n );\n }\n return Promise.resolve(attempt < this.options.attempts);\n }\n getDelay(attempt) {\n const delay = Math.min(\n this.options.maxDelay,\n this.options.baseDelay * 2 ** attempt\n );\n return delay;\n }\n};\nfunction createRetryStrategy(options) {\n if (typeof options === \"number\") {\n return new LinearRetryStrategy({\n type: \"linear\",\n attempts: options,\n delay: 1e3\n });\n }\n switch (options.type) {\n case \"linear\":\n return new LinearRetryStrategy(options);\n case \"exponential\":\n return new ExponentialRetryStrategy(options);\n default:\n throw new Error(\"Invalid retry strategy\");\n }\n}\n\n// src/auth.ts\nvar getAuthHeader = async (options) => {\n const headers = {};\n const getValue = async (value) => typeof value === \"function\" ? await value() : value;\n if (options == null ? void 0 : options.auth) {\n if (options.auth.type === \"Bearer\") {\n const token = await getValue(options.auth.token);\n if (!token) {\n return headers;\n }\n headers[\"authorization\"] = `Bearer ${token}`;\n } else if (options.auth.type === \"Basic\") {\n const [username, password] = await Promise.all([\n getValue(options.auth.username),\n getValue(options.auth.password)\n ]);\n if (!username || !password) {\n return headers;\n }\n headers[\"authorization\"] = `Basic ${btoa(`${username}:${password}`)}`;\n } else if (options.auth.type === \"Custom\") {\n const [prefix, value] = await Promise.all([\n getValue(options.auth.prefix),\n getValue(options.auth.value)\n ]);\n if (!value) {\n return headers;\n }\n headers[\"authorization\"] = `${prefix != null ? prefix : \"\"} ${value}`;\n }\n }\n return headers;\n};\n\n// src/utils.ts\nvar JSON_RE = /^application\\/(?:[\\w!#$%&*.^`~-]*\\+)?json(;.+)?$/i;\nfunction detectResponseType(request) {\n const _contentType = request.headers.get(\"content-type\");\n const textTypes = /* @__PURE__ */ new Set([\n \"image/svg\",\n \"application/xml\",\n \"application/xhtml\",\n \"application/html\"\n ]);\n if (!_contentType) {\n return \"json\";\n }\n const contentType = _contentType.split(\";\").shift() || \"\";\n if (JSON_RE.test(contentType)) {\n return \"json\";\n }\n if (textTypes.has(contentType) || contentType.startsWith(\"text/\")) {\n return \"text\";\n }\n return \"blob\";\n}\nfunction isJSONParsable(value) {\n try {\n JSON.parse(value);\n return true;\n } catch (error) {\n return false;\n }\n}\nfunction isJSONSerializable(value) {\n if (value === void 0) {\n return false;\n }\n const t = typeof value;\n if (t === \"string\" || t === \"number\" || t === \"boolean\" || t === null) {\n return true;\n }\n if (t !== \"object\") {\n return false;\n }\n if (Array.isArray(value)) {\n return true;\n }\n if (value.buffer) {\n return false;\n }\n return value.constructor && value.constructor.name === \"Object\" || typeof value.toJSON === \"function\";\n}\nfunction jsonParse(text) {\n try {\n return JSON.parse(text);\n } catch (error) {\n return text;\n }\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\nfunction getFetch(options) {\n if (options == null ? void 0 : options.customFetchImpl) {\n return options.customFetchImpl;\n }\n if (typeof globalThis !== \"undefined\" && isFunction(globalThis.fetch)) {\n return globalThis.fetch;\n }\n if (typeof window !== \"undefined\" && isFunction(window.fetch)) {\n return window.fetch;\n }\n throw new Error(\"No fetch implementation found\");\n}\nfunction isPayloadMethod(method) {\n if (!method) {\n return false;\n }\n const payloadMethod = [\"POST\", \"PUT\", \"PATCH\", \"DELETE\"];\n return payloadMethod.includes(method.toUpperCase());\n}\nfunction isRouteMethod(method) {\n const routeMethod = [\"GET\", \"POST\", \"PUT\", \"PATCH\", \"DELETE\"];\n if (!method) {\n return false;\n }\n return routeMethod.includes(method.toUpperCase());\n}\nasync function getHeaders(opts) {\n const headers = new Headers(opts == null ? void 0 : opts.headers);\n const authHeader = await getAuthHeader(opts);\n for (const [key, value] of Object.entries(authHeader || {})) {\n headers.set(key, value);\n }\n if (!headers.has(\"content-type\")) {\n const t = detectContentType(opts == null ? void 0 : opts.body);\n if (t) {\n headers.set(\"content-type\", t);\n }\n }\n return headers;\n}\nfunction getURL(url, options) {\n if (url.startsWith(\"@\")) {\n const m = url.toString().split(\"@\")[1].split(\"/\")[0];\n if (methods.includes(m)) {\n url = url.replace(`@${m}/`, \"/\");\n }\n }\n let _url;\n try {\n if (url.startsWith(\"http\")) {\n _url = url;\n } else {\n let baseURL = options == null ? void 0 : options.baseURL;\n if (baseURL && !(baseURL == null ? void 0 : baseURL.endsWith(\"/\"))) {\n baseURL = baseURL + \"/\";\n }\n if (url.startsWith(\"/\")) {\n _url = new URL(url.substring(1), baseURL);\n } else {\n _url = new URL(url, options == null ? void 0 : options.baseURL);\n }\n }\n } catch (e) {\n if (e instanceof TypeError) {\n if (!(options == null ? void 0 : options.baseURL)) {\n throw TypeError(\n `Invalid URL ${url}. Are you passing in a relative url but not setting the baseURL?`\n );\n }\n throw TypeError(\n `Invalid URL ${url}. Please validate that you are passing the correct input.`\n );\n }\n throw e;\n }\n if (options == null ? void 0 : options.params) {\n if (Array.isArray(options == null ? void 0 : options.params)) {\n const params = (options == null ? void 0 : options.params) ? Array.isArray(options.params) ? `/${options.params.join(\"/\")}` : `/${Object.values(options.params).join(\"/\")}` : \"\";\n _url = _url.toString().split(\"/:\")[0];\n _url = `${_url.toString()}${params}`;\n } else {\n for (const [key, value] of Object.entries(options == null ? void 0 : options.params)) {\n _url = _url.toString().replace(`:${key}`, String(value));\n }\n }\n }\n const __url = new URL(_url);\n const queryParams = options == null ? void 0 : options.query;\n if (queryParams) {\n for (const [key, value] of Object.entries(queryParams)) {\n __url.searchParams.append(key, String(value));\n }\n }\n return __url;\n}\nfunction detectContentType(body) {\n if (isJSONSerializable(body)) {\n return \"application/json\";\n }\n return null;\n}\nfunction getBody(options) {\n if (!(options == null ? void 0 : options.body)) {\n return null;\n }\n const headers = new Headers(options == null ? void 0 : options.headers);\n if (isJSONSerializable(options.body) && !headers.has(\"content-type\")) {\n for (const [key, value] of Object.entries(options == null ? void 0 : options.body)) {\n if (value instanceof Date) {\n options.body[key] = value.toISOString();\n }\n }\n return JSON.stringify(options.body);\n }\n if (headers.has(\"content-type\") && headers.get(\"content-type\") === \"application/x-www-form-urlencoded\") {\n if (isJSONSerializable(options.body)) {\n return new URLSearchParams(options.body).toString();\n }\n return options.body;\n }\n return options.body;\n}\nfunction getMethod(url, options) {\n var _a;\n if (options == null ? void 0 : options.method) {\n return options.method.toUpperCase();\n }\n if (url.startsWith(\"@\")) {\n const pMethod = (_a = url.split(\"@\")[1]) == null ? void 0 : _a.split(\"/\")[0];\n if (!methods.includes(pMethod)) {\n return (options == null ? void 0 : options.body) ? \"POST\" : \"GET\";\n }\n return pMethod.toUpperCase();\n }\n return (options == null ? void 0 : options.body) ? \"POST\" : \"GET\";\n}\nfunction getTimeout(options, controller) {\n let abortTimeout;\n if (!(options == null ? void 0 : options.signal) && (options == null ? void 0 : options.timeout)) {\n abortTimeout = setTimeout(() => controller == null ? void 0 : controller.abort(), options == null ? void 0 : options.timeout);\n }\n return {\n abortTimeout,\n clearTimeout: () => {\n if (abortTimeout) {\n clearTimeout(abortTimeout);\n }\n }\n };\n}\nfunction bodyParser(data, responseType) {\n if (responseType === \"json\") {\n return JSON.parse(data);\n }\n return data;\n}\nvar ValidationError = class _ValidationError extends Error {\n constructor(issues, message) {\n super(message || JSON.stringify(issues, null, 2));\n this.issues = issues;\n Object.setPrototypeOf(this, _ValidationError.prototype);\n }\n};\nasync function parseStandardSchema(schema, input) {\n const result = await schema[\"~standard\"].validate(input);\n if (result.issues) {\n throw new ValidationError(result.issues);\n }\n return result.value;\n}\n\n// src/create-fetch/schema.ts\nvar methods = [\"get\", \"post\", \"put\", \"patch\", \"delete\"];\nvar createSchema = (schema, config) => {\n return {\n schema,\n config\n };\n};\n\n// src/create-fetch/index.ts\nvar applySchemaPlugin = (config) => ({\n id: \"apply-schema\",\n name: \"Apply Schema\",\n version: \"1.0.0\",\n async init(url, options) {\n var _a, _b, _c, _d;\n const schema = ((_b = (_a = config.plugins) == null ? void 0 : _a.find(\n (plugin) => {\n var _a2;\n return ((_a2 = plugin.schema) == null ? void 0 : _a2.config) ? url.startsWith(plugin.schema.config.baseURL || \"\") || url.startsWith(plugin.schema.config.prefix || \"\") : false;\n }\n )) == null ? void 0 : _b.schema) || config.schema;\n if (schema) {\n let urlKey = url;\n if ((_c = schema.config) == null ? void 0 : _c.prefix) {\n if (urlKey.startsWith(schema.config.prefix)) {\n urlKey = urlKey.replace(schema.config.prefix, \"\");\n if (schema.config.baseURL) {\n url = url.replace(schema.config.prefix, schema.config.baseURL);\n }\n }\n }\n if ((_d = schema.config) == null ? void 0 : _d.baseURL) {\n if (urlKey.startsWith(schema.config.baseURL)) {\n urlKey = urlKey.replace(schema.config.baseURL, \"\");\n }\n }\n const keySchema = schema.schema[urlKey];\n if (keySchema) {\n let opts = __spreadProps(__spreadValues({}, options), {\n method: keySchema.method,\n output: keySchema.output\n });\n if (!(options == null ? void 0 : options.disableValidation)) {\n opts = __spreadProps(__spreadValues({}, opts), {\n body: keySchema.input ? await parseStandardSchema(keySchema.input, options == null ? void 0 : options.body) : options == null ? void 0 : options.body,\n params: keySchema.params ? await parseStandardSchema(keySchema.params, options == null ? void 0 : options.params) : options == null ? void 0 : options.params,\n query: keySchema.query ? await parseStandardSchema(keySchema.query, options == null ? void 0 : options.query) : options == null ? void 0 : options.query\n });\n }\n return {\n url,\n options: opts\n };\n }\n }\n return {\n url,\n options\n };\n }\n});\nvar createFetch = (config) => {\n async function $fetch(url, options) {\n const opts = __spreadProps(__spreadValues(__spreadValues({}, config), options), {\n plugins: [...(config == null ? void 0 : config.plugins) || [], applySchemaPlugin(config || {}), ...(options == null ? void 0 : options.plugins) || []]\n });\n if (config == null ? void 0 : config.catchAllError) {\n try {\n return await betterFetch(url, opts);\n } catch (error) {\n return {\n data: null,\n error: {\n status: 500,\n statusText: \"Fetch Error\",\n message: \"Fetch related error. Captured by catchAllError option. See error property for more details.\",\n error\n }\n };\n }\n }\n return await betterFetch(url, opts);\n }\n return $fetch;\n};\n\n// src/url.ts\nfunction getURL2(url, option) {\n const { baseURL, params, query } = option || {\n query: {},\n params: {},\n baseURL: \"\"\n };\n let basePath = url.startsWith(\"http\") ? url.split(\"/\").slice(0, 3).join(\"/\") : baseURL || \"\";\n if (url.startsWith(\"@\")) {\n const m = url.toString().split(\"@\")[1].split(\"/\")[0];\n if (methods.includes(m)) {\n url = url.replace(`@${m}/`, \"/\");\n }\n }\n if (!basePath.endsWith(\"/\")) basePath += \"/\";\n let [path, urlQuery] = url.replace(basePath, \"\").split(\"?\");\n const queryParams = new URLSearchParams(urlQuery);\n for (const [key, value] of Object.entries(query || {})) {\n if (value == null) continue;\n let serializedValue;\n if (typeof value === \"string\") {\n serializedValue = value;\n } else if (Array.isArray(value)) {\n for (const val of value) {\n queryParams.append(key, val);\n }\n continue;\n } else {\n serializedValue = JSON.stringify(value);\n }\n queryParams.set(key, serializedValue);\n }\n if (params) {\n if (Array.isArray(params)) {\n const paramPaths = path.split(\"/\").filter((p) => p.startsWith(\":\"));\n for (const [index, key] of paramPaths.entries()) {\n const value = params[index];\n path = path.replace(key, value);\n }\n } else {\n for (const [key, value] of Object.entries(params)) {\n path = path.replace(`:${key}`, String(value));\n }\n }\n }\n path = path.split(\"/\").map(encodeURIComponent).join(\"/\");\n if (path.startsWith(\"/\")) path = path.slice(1);\n let queryParamString = queryParams.toString();\n queryParamString = queryParamString.length > 0 ? `?${queryParamString}`.replace(/\\+/g, \"%20\") : \"\";\n if (!basePath.startsWith(\"http\")) {\n return `${basePath}${path}${queryParamString}`;\n }\n const _url = new URL(`${path}${queryParamString}`, basePath);\n return _url;\n}\n\n// src/fetch.ts\nvar betterFetch = async (url, options) => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n const {\n hooks,\n url: __url,\n options: opts\n } = await initializePlugins(url, options);\n const fetch = getFetch(opts);\n const controller = new AbortController();\n const signal = (_a = opts.signal) != null ? _a : controller.signal;\n const _url = getURL2(__url, opts);\n const body = getBody(opts);\n const headers = await getHeaders(opts);\n const method = getMethod(__url, opts);\n let context = __spreadProps(__spreadValues({}, opts), {\n url: _url,\n headers,\n body,\n method,\n signal\n });\n for (const onRequest of hooks.onRequest) {\n if (onRequest) {\n const res = await onRequest(context);\n if (typeof res === \"object\" && res !== null) {\n context = res;\n }\n }\n }\n if (\"pipeTo\" in context && typeof context.pipeTo === \"function\" || typeof ((_b = options == null ? void 0 : options.body) == null ? void 0 : _b.pipe) === \"function\") {\n if (!(\"duplex\" in context)) {\n context.duplex = \"half\";\n }\n }\n const { clearTimeout: clearTimeout2 } = getTimeout(opts, controller);\n let response = await fetch(context.url, context);\n clearTimeout2();\n const responseContext = {\n response,\n request: context\n };\n for (const onResponse of hooks.onResponse) {\n if (onResponse) {\n const r = await onResponse(__spreadProps(__spreadValues({}, responseContext), {\n response: ((_c = options == null ? void 0 : options.hookOptions) == null ? void 0 : _c.cloneResponse) ? response.clone() : response\n }));\n if (r instanceof Response) {\n response = r;\n } else if (typeof r === \"object\" && r !== null) {\n response = r.response;\n }\n }\n }\n if (response.ok) {\n const hasBody = context.method !== \"HEAD\";\n if (!hasBody) {\n return {\n data: \"\",\n error: null\n };\n }\n const responseType = detectResponseType(response);\n const successContext = {\n data: null,\n response,\n request: context\n };\n if (responseType === \"json\" || responseType === \"text\") {\n const text = await response.text();\n const parser2 = (_d = context.jsonParser) != null ? _d : jsonParse;\n successContext.data = await parser2(text);\n } else {\n successContext.data = await response[responseType]();\n }\n if (context == null ? void 0 : context.output) {\n if (context.output && !context.disableValidation) {\n successContext.data = await parseStandardSchema(\n context.output,\n successContext.data\n );\n }\n }\n for (const onSuccess of hooks.onSuccess) {\n if (onSuccess) {\n await onSuccess(__spreadProps(__spreadValues({}, successContext), {\n response: ((_e = options == null ? void 0 : options.hookOptions) == null ? void 0 : _e.cloneResponse) ? response.clone() : response\n }));\n }\n }\n if (options == null ? void 0 : options.throw) {\n return successContext.data;\n }\n return {\n data: successContext.data,\n error: null\n };\n }\n const parser = (_f = options == null ? void 0 : options.jsonParser) != null ? _f : jsonParse;\n const responseText = await response.text();\n const isJSONResponse = isJSONParsable(responseText);\n const errorObject = isJSONResponse ? await parser(responseText) : null;\n const errorContext = {\n response,\n responseText,\n request: context,\n error: __spreadProps(__spreadValues({}, errorObject), {\n status: response.status,\n statusText: response.statusText\n })\n };\n for (const onError of hooks.onError) {\n if (onError) {\n await onError(__spreadProps(__spreadValues({}, errorContext), {\n response: ((_g = options == null ? void 0 : options.hookOptions) == null ? void 0 : _g.cloneResponse) ? response.clone() : response\n }));\n }\n }\n if (options == null ? void 0 : options.retry) {\n const retryStrategy = createRetryStrategy(options.retry);\n const _retryAttempt = (_h = options.retryAttempt) != null ? _h : 0;\n if (await retryStrategy.shouldAttemptRetry(_retryAttempt, response)) {\n for (const onRetry of hooks.onRetry) {\n if (onRetry) {\n await onRetry(responseContext);\n }\n }\n const delay = retryStrategy.getDelay(_retryAttempt);\n await new Promise((resolve) => setTimeout(resolve, delay));\n return await betterFetch(url, __spreadProps(__spreadValues({}, options), {\n retryAttempt: _retryAttempt + 1\n }));\n }\n }\n if (options == null ? void 0 : options.throw) {\n throw new BetterFetchError(\n response.status,\n response.statusText,\n isJSONResponse ? errorObject : responseText\n );\n }\n return {\n data: null,\n error: __spreadProps(__spreadValues({}, errorObject), {\n status: response.status,\n statusText: response.statusText\n })\n };\n};\nexport {\n BetterFetchError,\n ValidationError,\n applySchemaPlugin,\n betterFetch,\n bodyParser,\n createFetch,\n createRetryStrategy,\n createSchema,\n detectContentType,\n detectResponseType,\n getBody,\n getFetch,\n getHeaders,\n getMethod,\n getTimeout,\n getURL,\n initializePlugins,\n isFunction,\n isJSONParsable,\n isJSONSerializable,\n isPayloadMethod,\n isRouteMethod,\n jsonParse,\n methods,\n parseStandardSchema\n};\n//# sourceMappingURL=index.js.map","import { getBaseURL } from \"../utils/url.mjs\";\nimport { parseJSON } from \"./parser.mjs\";\nimport { redirectPlugin } from \"./fetch-plugins.mjs\";\nimport { getSessionAtom } from \"./session-atom.mjs\";\nimport { defu } from \"defu\";\nimport { createFetch } from \"@better-fetch/fetch\";\n//#region src/client/config.ts\nconst resolvePublicAuthUrl = (basePath) => {\n\tif (typeof process === \"undefined\") return void 0;\n\tconst path = basePath ?? \"/api/auth\";\n\tif (process.env.NEXT_PUBLIC_AUTH_URL) return process.env.NEXT_PUBLIC_AUTH_URL;\n\tif (typeof window === \"undefined\") {\n\t\tif (process.env.NEXTAUTH_URL) try {\n\t\t\treturn process.env.NEXTAUTH_URL;\n\t\t} catch {}\n\t\tif (process.env.VERCEL_URL) try {\n\t\t\tconst protocol = process.env.VERCEL_URL.startsWith(\"http\") ? \"\" : \"https://\";\n\t\t\treturn `${new URL(`${protocol}${process.env.VERCEL_URL}`).origin}${path}`;\n\t\t} catch {}\n\t}\n};\nconst getClientConfig = (options, loadEnv) => {\n\tconst isCredentialsSupported = \"credentials\" in Request.prototype;\n\tconst baseURL = getBaseURL(options?.baseURL, options?.basePath, void 0, loadEnv) ?? resolvePublicAuthUrl(options?.basePath) ?? \"/api/auth\";\n\tconst pluginsFetchPlugins = options?.plugins?.flatMap((plugin) => plugin.fetchPlugins).filter((pl) => pl !== void 0) || [];\n\tconst lifeCyclePlugin = {\n\t\tid: \"lifecycle-hooks\",\n\t\tname: \"lifecycle-hooks\",\n\t\thooks: {\n\t\t\tonSuccess: options?.fetchOptions?.onSuccess,\n\t\t\tonError: options?.fetchOptions?.onError,\n\t\t\tonRequest: options?.fetchOptions?.onRequest,\n\t\t\tonResponse: options?.fetchOptions?.onResponse\n\t\t}\n\t};\n\tconst { onSuccess: _onSuccess, onError: _onError, onRequest: _onRequest, onResponse: _onResponse, ...restOfFetchOptions } = options?.fetchOptions || {};\n\tconst $fetch = createFetch({\n\t\tbaseURL,\n\t\t...isCredentialsSupported ? { credentials: \"include\" } : {},\n\t\tmethod: \"GET\",\n\t\tjsonParser(text) {\n\t\t\tif (!text) return null;\n\t\t\treturn parseJSON(text, { strict: false });\n\t\t},\n\t\tcustomFetchImpl: fetch,\n\t\t...restOfFetchOptions,\n\t\tplugins: [\n\t\t\tlifeCyclePlugin,\n\t\t\t...restOfFetchOptions.plugins || [],\n\t\t\t...options?.disableDefaultFetchPlugins ? [] : [redirectPlugin],\n\t\t\t...pluginsFetchPlugins\n\t\t]\n\t});\n\tconst { $sessionSignal, session, broadcastSessionUpdate } = getSessionAtom($fetch, options);\n\tconst plugins = options?.plugins || [];\n\tlet pluginsActions = {};\n\tconst pluginsAtoms = {\n\t\t$sessionSignal,\n\t\tsession\n\t};\n\tconst pluginPathMethods = {\n\t\t\"/sign-out\": \"POST\",\n\t\t\"/revoke-sessions\": \"POST\",\n\t\t\"/revoke-other-sessions\": \"POST\",\n\t\t\"/delete-user\": \"POST\"\n\t};\n\tconst atomListeners = [{\n\t\tsignal: \"$sessionSignal\",\n\t\tmatcher(path) {\n\t\t\treturn path === \"/sign-out\" || path === \"/update-user\" || path === \"/update-session\" || path === \"/sign-up/email\" || path === \"/sign-in/email\" || path === \"/delete-user\" || path === \"/verify-email\" || path === \"/revoke-sessions\" || path === \"/revoke-session\" || path === \"/revoke-other-sessions\" || path === \"/change-email\" || path === \"/change-password\";\n\t\t},\n\t\tcallback(path) {\n\t\t\tif (path === \"/sign-out\") broadcastSessionUpdate(\"signout\");\n\t\t\telse if (path === \"/update-user\" || path === \"/update-session\") broadcastSessionUpdate(\"updateUser\");\n\t\t}\n\t}];\n\tfor (const plugin of plugins) {\n\t\tif (plugin.getAtoms) Object.assign(pluginsAtoms, plugin.getAtoms?.($fetch));\n\t\tif (plugin.pathMethods) Object.assign(pluginPathMethods, plugin.pathMethods);\n\t\tif (plugin.atomListeners) atomListeners.push(...plugin.atomListeners);\n\t}\n\tconst $store = {\n\t\tnotify: (signal) => {\n\t\t\tpluginsAtoms[signal].set(!pluginsAtoms[signal].get());\n\t\t},\n\t\tlisten: (signal, listener) => {\n\t\t\tpluginsAtoms[signal].subscribe(listener);\n\t\t},\n\t\tatoms: pluginsAtoms\n\t};\n\tfor (const plugin of plugins) if (plugin.getActions) pluginsActions = defu(plugin.getActions?.($fetch, $store, options) ?? {}, pluginsActions);\n\treturn {\n\t\tget baseURL() {\n\t\t\treturn baseURL;\n\t\t},\n\t\tpluginsActions,\n\t\tpluginsAtoms,\n\t\tpluginPathMethods,\n\t\tatomListeners,\n\t\t$fetch,\n\t\t$store\n\t};\n};\n//#endregion\nexport { getClientConfig };\n","//#region src/utils/is-atom.ts\nfunction isAtom(value) {\n\treturn typeof value === \"object\" && value !== null && \"get\" in value && typeof value.get === \"function\" && \"lc\" in value && typeof value.lc === \"number\";\n}\n//#endregion\nexport { isAtom };\n","import { isAtom } from \"../utils/is-atom.mjs\";\n//#region src/client/proxy.ts\nfunction getMethod(path, knownPathMethods, args) {\n\tconst method = knownPathMethods[path];\n\tconst { fetchOptions, query: _query, ...body } = args || {};\n\tif (method) return method;\n\tif (fetchOptions?.method) return fetchOptions.method;\n\tif (body && Object.keys(body).length > 0) return \"POST\";\n\treturn \"GET\";\n}\nfunction createDynamicPathProxy(routes, client, knownPathMethods, atoms, atomListeners) {\n\tfunction createProxy(path = []) {\n\t\treturn new Proxy(function() {}, {\n\t\t\tget(_, prop) {\n\t\t\t\tif (typeof prop !== \"string\") return;\n\t\t\t\tif (prop === \"then\" || prop === \"catch\" || prop === \"finally\") return;\n\t\t\t\tconst fullPath = [...path, prop];\n\t\t\t\tlet current = routes;\n\t\t\t\tfor (const segment of fullPath) if (current && typeof current === \"object\" && segment in current) current = current[segment];\n\t\t\t\telse {\n\t\t\t\t\tcurrent = void 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (typeof current === \"function\") return current;\n\t\t\t\tif (isAtom(current)) return current;\n\t\t\t\treturn createProxy(fullPath);\n\t\t\t},\n\t\t\tapply: async (_, __, args) => {\n\t\t\t\tconst routePath = \"/\" + path.map((segment) => segment.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)).join(\"/\");\n\t\t\t\tconst arg = args[0] || {};\n\t\t\t\tconst fetchOptions = args[1] || {};\n\t\t\t\tconst { query, fetchOptions: argFetchOptions, ...body } = arg;\n\t\t\t\tconst options = {\n\t\t\t\t\t...fetchOptions,\n\t\t\t\t\t...argFetchOptions\n\t\t\t\t};\n\t\t\t\tconst method = getMethod(routePath, knownPathMethods, arg);\n\t\t\t\treturn await client(routePath, {\n\t\t\t\t\t...options,\n\t\t\t\t\tbody: method === \"GET\" ? void 0 : {\n\t\t\t\t\t\t...body,\n\t\t\t\t\t\t...options?.body || {}\n\t\t\t\t\t},\n\t\t\t\t\tquery: query || options?.query,\n\t\t\t\t\tmethod,\n\t\t\t\t\tasync onSuccess(context) {\n\t\t\t\t\t\tawait options?.onSuccess?.(context);\n\t\t\t\t\t\tif (!atomListeners || options.disableSignal) return;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* We trigger listeners\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tconst matches = atomListeners.filter((s) => s.matcher(routePath));\n\t\t\t\t\t\tif (!matches.length) return;\n\t\t\t\t\t\tconst visited = /* @__PURE__ */ new Set();\n\t\t\t\t\t\tfor (const match of matches) {\n\t\t\t\t\t\t\tconst signal = atoms[match.signal];\n\t\t\t\t\t\t\tif (!signal) return;\n\t\t\t\t\t\t\tif (visited.has(match.signal)) continue;\n\t\t\t\t\t\t\tvisited.add(match.signal);\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t* To avoid race conditions we set the signal in a setTimeout\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\tconst val = signal.get();\n\t\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\t\tsignal.set(!val);\n\t\t\t\t\t\t\t}, 10);\n\t\t\t\t\t\t\tmatch.callback?.(routePath);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\treturn createProxy();\n}\n//#endregion\nexport { createDynamicPathProxy };\n","//#region src/utils/string.ts\nfunction capitalizeFirstLetter(str) {\n\treturn str.charAt(0).toUpperCase() + str.slice(1);\n}\n//#endregion\nexport { capitalizeFirstLetter };\n","import { getClientConfig } from \"./config.mjs\";\nimport { createDynamicPathProxy } from \"./proxy.mjs\";\nimport { capitalizeFirstLetter } from \"@better-auth/core/utils/string\";\n//#region src/client/vanilla.ts\nfunction createAuthClient(options) {\n\tconst { pluginPathMethods, pluginsActions, pluginsAtoms, $fetch, atomListeners, $store } = getClientConfig(options);\n\tconst resolvedHooks = {};\n\tfor (const [key, value] of Object.entries(pluginsAtoms)) resolvedHooks[`use${capitalizeFirstLetter(key)}`] = value;\n\treturn createDynamicPathProxy({\n\t\t...pluginsActions,\n\t\t...resolvedHooks,\n\t\t$fetch,\n\t\t$store\n\t}, $fetch, pluginPathMethods, pluginsAtoms, atomListeners);\n}\n//#endregion\nexport { createAuthClient };\n","import { t as CLI_CLIENT_ID } from \"./constants-BaNTvWUo.mjs\";\nimport { deviceAuthorizationClient } from \"better-auth/client/plugins\";\nimport { createAuthClient } from \"better-auth/client\";\n//#region src/cli.ts\nfunction createCliAuthClient(baseURL) {\n\treturn createAuthClient({\n\t\tbaseURL,\n\t\tplugins: [deviceAuthorizationClient()]\n\t});\n}\nfunction sleep(ms) {\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\n}\nfunction isDeviceTokenError(value) {\n\treturn typeof value === \"object\" && value !== null && \"error\" in value && typeof value.error === \"string\";\n}\nasync function runDeviceLogin(options) {\n\tconst client = createCliAuthClient(options.baseURL);\n\tconst codeResult = await client.device.code({ client_id: options.clientId });\n\tif (codeResult.error) {\n\t\tconst message = \"error_description\" in codeResult.error ? codeResult.error.error_description : \"Failed to request device code\";\n\t\tthrow new Error(message);\n\t}\n\tconst { device_code: deviceCode, user_code: userCode, verification_uri: verificationUri, verification_uri_complete: verificationUriComplete, expires_in: expiresIn, interval } = codeResult.data;\n\tif (options.onCodes) options.onCodes({\n\t\tuserCode,\n\t\tverificationUri,\n\t\tverificationUriComplete\n\t});\n\telse {\n\t\tprocess.stderr.write(`Visit ${verificationUri} and enter code: ${userCode}\\n`);\n\t\toptions.openUrl?.(verificationUriComplete);\n\t}\n\tconst deadline = Date.now() + expiresIn * 1e3;\n\tlet pollIntervalMs = interval * 1e3;\n\twhile (Date.now() < deadline) {\n\t\tconst tokenResult = await client.device.token({\n\t\t\tgrant_type: \"urn:ietf:params:oauth:grant-type:device_code\",\n\t\t\tdevice_code: deviceCode,\n\t\t\tclient_id: options.clientId\n\t\t});\n\t\tif (!tokenResult.error) {\n\t\t\tconst token = tokenResult.data;\n\t\t\treturn {\n\t\t\t\taccessToken: token.access_token,\n\t\t\t\texpiresIn: token.expires_in\n\t\t\t};\n\t\t}\n\t\tconst errorPayload = tokenResult.error;\n\t\tconst oauthError = isDeviceTokenError(errorPayload.body) ? errorPayload.body : isDeviceTokenError(tokenResult.error) ? tokenResult.error : null;\n\t\tif (oauthError?.error === \"authorization_pending\") {\n\t\t\tawait sleep(pollIntervalMs);\n\t\t\tcontinue;\n\t\t}\n\t\tif (oauthError?.error === \"slow_down\") {\n\t\t\tpollIntervalMs += 5e3;\n\t\t\tawait sleep(pollIntervalMs);\n\t\t\tcontinue;\n\t\t}\n\t\tif (oauthError?.error === \"expired_token\") throw new Error(\"Device code expired. Run auth login again.\");\n\t\tif (oauthError?.error === \"access_denied\") throw new Error(\"Device authorization was denied.\");\n\t\tthrow new Error(oauthError?.error_description ?? errorPayload.message ?? \"Device login failed\");\n\t}\n\tthrow new Error(\"Device code expired. Run auth login again.\");\n}\nasync function getSessionWithBearer(baseURL, accessToken) {\n\tconst result = await createCliAuthClient(baseURL).getSession({ fetchOptions: { headers: { Authorization: `Bearer ${accessToken}` } } });\n\tconst user = result && \"user\" in result ? result.user : result && \"data\" in result && result.data && \"user\" in result.data ? result.data.user : void 0;\n\tif (typeof user !== \"object\" || user === null || !(\"id\" in user) || !(\"email\" in user) || !(\"name\" in user) || typeof user.id !== \"string\" || typeof user.email !== \"string\" || typeof user.name !== \"string\") return null;\n\treturn {\n\t\tid: user.id,\n\t\temail: user.email,\n\t\tname: user.name\n\t};\n}\n//#endregion\nexport { CLI_CLIENT_ID, createCliAuthClient, getSessionWithBearer, runDeviceLogin };\n\n//# sourceMappingURL=cli.mjs.map","import type Conf from \"conf\";\nimport type { CliConfig } from \"../config\";\nimport { getPlatformUrl } from \"../config\";\nimport {\n DEFAULT_PLATFORM_URL,\n DEFAULT_WEB_URL,\n resolvePlatformUrlForWebUrl,\n} from \"../resolve-platform-url\";\n\nexport type AuthLoginTargetOptions = {\n webUrl?: string;\n platformUrl?: string;\n};\n\nexport function resolveAuthLoginTargets(\n options: AuthLoginTargetOptions,\n config: Conf<CliConfig>,\n): { webUrl: string; platformUrl: string } {\n const webUrl = options.webUrl ?? DEFAULT_WEB_URL;\n const platformUrl = resolvePlatformUrlForWebUrl(webUrl, {\n platformUrl: options.platformUrl,\n fallback: options.webUrl ? getPlatformUrl(config) : DEFAULT_PLATFORM_URL,\n });\n\n return { webUrl, platformUrl };\n}\n","import type { Command } from \"commander\";\nimport { CLI_CLIENT_ID, getSessionWithBearer, runDeviceLogin } from \"@keystrokehq/auth/cli\";\nimport { setAccessToken } from \"../../auth/credentials\";\nimport { openUrl } from \"../../auth/open-url\";\nimport { resolveAuthLoginTargets } from \"../../auth/resolve-login-targets\";\nimport { createCliConfig } from \"../../config\";\nimport { formatCliError } from \"../../errors/format-cli-error\";\nimport { syncActiveOrganizationAfterLogin } from \"../../organization/active-organization\";\n\ntype LoginOptions = {\n webUrl?: string;\n platformUrl?: string;\n org?: string;\n};\n\nexport function registerAuthLoginCommand(auth: Command): void {\n auth\n .command(\"login\")\n .description(\"Authenticate via browser device flow\")\n .option(\n \"--web-url <url>\",\n \"Web dashboard origin (omit to use production defaults; local dev: http://localhost:3000)\",\n )\n .option(\"--platform-url <url>\", \"Platform API origin (derived from web URL when omitted)\")\n .option(\"--org <id>\", \"Active organization id (skips prompt when you belong to several)\")\n .action(async (options: LoginOptions) => {\n const config = createCliConfig();\n const { webUrl, platformUrl } = resolveAuthLoginTargets(options, config);\n\n config.set(\"webUrl\", webUrl);\n config.set(\"platformUrl\", platformUrl);\n\n try {\n const result = await runDeviceLogin({\n baseURL: webUrl,\n clientId: CLI_CLIENT_ID,\n openUrl,\n });\n\n setAccessToken(webUrl, result.accessToken);\n\n const user = await getSessionWithBearer(webUrl, result.accessToken);\n if (user) {\n process.stdout.write(`Logged in as ${user.name} (${user.email})\\n`);\n } else {\n process.stdout.write(`Logged in to ${webUrl}\\n`);\n }\n\n await syncActiveOrganizationAfterLogin(config, {\n organizationId: options.org,\n });\n } catch (error) {\n process.stderr.write(`${formatCliError(error, \"Login failed\", { webUrl })}\\n`);\n process.exitCode = 1;\n }\n });\n}\n","import type { Command } from \"commander\";\nimport { clearAccessToken } from \"../../auth/credentials\";\nimport { createCliConfig, getWebUrl } from \"../../config\";\n\ntype LogoutOptions = {\n webUrl?: string;\n};\n\nexport function registerAuthLogoutCommand(auth: Command): void {\n auth\n .command(\"logout\")\n .description(\"Clear stored credentials\")\n .option(\"--web-url <url>\", \"Web dashboard origin (default from config)\")\n .action((options: LogoutOptions) => {\n const config = createCliConfig();\n const webUrl = options.webUrl ?? getWebUrl(config);\n clearAccessToken(webUrl);\n process.stdout.write(`${JSON.stringify({ authenticated: false, webUrl })}\\n`);\n });\n}\n","import { getSessionWithBearer } from \"@keystrokehq/auth/cli\";\nimport type { Command } from \"commander\";\nimport { getAccessToken } from \"../../auth/credentials\";\nimport { createCliConfig, getWebUrl } from \"../../config\";\nimport { formatCliError } from \"../../errors/format-cli-error\";\nimport { listOrganizations } from \"../../organization/active-organization\";\n\ntype StatusOptions = {\n webUrl?: string;\n};\n\nexport function registerAuthStatusCommand(auth: Command): void {\n auth\n .command(\"status\")\n .description(\"Show authentication status\")\n .option(\"--web-url <url>\", \"Web dashboard origin (default from config)\")\n .action(async (options: StatusOptions) => {\n const config = createCliConfig();\n const webUrl = options.webUrl ?? getWebUrl(config);\n const token = getAccessToken(webUrl);\n\n if (!token) {\n process.stdout.write(`${JSON.stringify({ authenticated: false, webUrl })}\\n`);\n return;\n }\n\n try {\n const user = await getSessionWithBearer(webUrl, token);\n const organizations = user ? await listOrganizations(config).catch(() => []) : [];\n const activeOrganizationId = config.get(\"activeOrganizationId\");\n const activeOrganization = activeOrganizationId\n ? organizations.find((entry) => entry.organization.id === activeOrganizationId)\n : undefined;\n\n process.stdout.write(\n `${JSON.stringify({\n authenticated: user !== null,\n webUrl,\n user,\n activeOrganizationId: activeOrganizationId ?? null,\n activeOrganization: activeOrganization?.organization.name ?? null,\n })}\\n`,\n );\n\n if (!user) {\n process.exitCode = 1;\n }\n } catch (error) {\n process.stderr.write(`${formatCliError(error, \"Status check failed\", { webUrl })}\\n`);\n process.exitCode = 1;\n }\n });\n}\n","import type { Command } from \"commander\";\nimport { registerAuthLoginCommand } from \"./login\";\nimport { registerAuthLogoutCommand } from \"./logout\";\nimport { registerAuthStatusCommand } from \"./status\";\n\nexport function registerAuthCommand(program: Command): void {\n const auth = program.command(\"auth\").description(\"Authenticate with an keystroke deployment\");\n\n registerAuthLoginCommand(auth);\n registerAuthLogoutCommand(auth);\n registerAuthStatusCommand(auth);\n}\n","import type { Command } from \"commander\";\nimport { resolveProjectRoot } from \"../project/resolve-project-root\";\n\nexport function registerBuildCommand(program: Command): void {\n program\n .command(\"build\")\n .description(\"Build the keystroke project for production\")\n .option(\"--dir <path>\", \"Project directory\", process.cwd())\n .action(async (options) => {\n try {\n const root = resolveProjectRoot(options.dir);\n const { buildApp } = await import(\"@keystrokehq/build\");\n await buildApp({ root });\n process.stdout.write(`Built ${root}\\n`);\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Build failed\";\n process.stderr.write(`${message}\\n`);\n process.exitCode = 1;\n }\n });\n}\n","import { spawnSync } from \"node:child_process\";\nimport { existsSync, mkdtempSync, readFileSync, rmSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\n//#region src/pack-artifact.ts\n/** Pack `dist/` into a gzip tarball suitable for `/app` extraction in the project server image. */\nfunction packProjectArtifact(projectRoot) {\n\tif (!existsSync(join(projectRoot, \"dist\"))) throw new Error(\"dist/ not found — run keystroke build first\");\n\tconst tempDir = mkdtempSync(join(tmpdir(), \"keystroke-artifact-\"));\n\tconst archivePath = join(tempDir, \"artifact.tgz\");\n\ttry {\n\t\tconst result = spawnSync(\"tar\", [\n\t\t\t\"-czf\",\n\t\t\tarchivePath,\n\t\t\t\"--exclude=._*\",\n\t\t\t\"--exclude=.DS_Store\",\n\t\t\t\"-C\",\n\t\t\tprojectRoot,\n\t\t\t\"dist\"\n\t\t], {\n\t\t\tencoding: \"utf8\",\n\t\t\tenv: {\n\t\t\t\t...process.env,\n\t\t\t\tCOPYFILE_DISABLE: \"1\"\n\t\t\t}\n\t\t});\n\t\tif (result.status !== 0) throw new Error(result.stderr?.trim() || \"Failed to pack project artifact\");\n\t\treturn readFileSync(archivePath);\n\t} finally {\n\t\trmSync(tempDir, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t});\n\t}\n}\n//#endregion\nexport { packProjectArtifact };\n\n//# sourceMappingURL=pack-artifact.mjs.map","import { packProjectArtifact } from \"@keystrokehq/storage/pack-artifact\";\nimport type { Command } from \"commander\";\n\nimport { createCliConfig } from \"../config\";\nimport { selectActiveOrganization } from \"../organization/active-organization\";\nimport { createCliPlatformClient } from \"../platform-client\";\nimport { resolveProjectRoot } from \"../project/resolve-project-root\";\nimport { getCliTargetOptions } from \"../target-options\";\n\nconst POLL_INTERVAL_MS = 2_000;\nconst DEPLOY_TIMEOUT_MS = 120_000;\n\ntype DeployOptions = {\n dir: string;\n projectId: string;\n skipBuild?: boolean;\n};\n\nasync function sleep(ms: number): Promise<void> {\n await new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n\nexport async function runDeploy(options: DeployOptions): Promise<void> {\n const root = resolveProjectRoot(options.dir);\n const config = createCliConfig();\n const client = createCliPlatformClient(config);\n\n if (!options.skipBuild) {\n const { buildApp } = await import(\"@keystrokehq/build\");\n await buildApp({ root });\n }\n\n const archive = packProjectArtifact(root);\n\n let active = await client.organizations.getActive();\n if (!active) {\n active = await selectActiveOrganization(config);\n }\n\n client.setActiveOrganizationId(active.organization.id);\n\n const project = await client.projects.get(options.projectId);\n\n const created = await client.artifacts.create(project.id);\n const upload = await fetch(created.uploadUrl, {\n method: \"PUT\",\n body: archive,\n headers: {\n \"Content-Type\": \"application/gzip\",\n },\n });\n\n if (!upload.ok) {\n throw new Error(`Artifact upload failed (${upload.status})`);\n }\n\n const completed = await client.artifacts.complete(project.id, created.artifact.id);\n process.stdout.write(`Deploy ${completed.artifact.id} uploaded\\n`);\n\n const deadline = Date.now() + DEPLOY_TIMEOUT_MS;\n while (Date.now() < deadline) {\n const current = await client.projects.get(project.id);\n if (current.status === \"active\") {\n config.set(\"activeProjectId\", project.id);\n config.set(\"apiTarget\", \"platform\");\n process.stdout.write(`Project active${current.baseUrl ? `: ${current.baseUrl}` : \"\"}\\n`);\n return;\n }\n\n if (current.status === \"failed\") {\n throw new Error(current.lastError ?? \"Project runtime failed\");\n }\n\n await sleep(POLL_INTERVAL_MS);\n }\n\n throw new Error(\"Timed out waiting for project to become active\");\n}\n\nexport function registerDeployCommand(program: Command): void {\n program\n .command(\"deploy\")\n .description(\"Build, upload, and deploy the project to the platform\")\n .option(\"--dir <path>\", \"Project directory\", process.cwd())\n .option(\"--skip-build\", \"Upload the existing dist/ without rebuilding\")\n .action(async (options) => {\n try {\n const config = createCliConfig();\n const projectId = getCliTargetOptions().projectId ?? config.get(\"activeProjectId\");\n if (!projectId) {\n throw new Error(\"Usage: keystroke deploy --project <id>\");\n }\n\n await runDeploy({\n dir: options.dir,\n projectId,\n skipBuild: options.skipBuild,\n });\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Deploy failed\";\n process.stderr.write(`${message}\\n`);\n process.exitCode = 1;\n }\n });\n}\n","/** Strip dev-only Node flags so the API child loads built `dist/`, not package `src/`. */\nexport function runtimeChildNodeOptions(nodeOptions: string | undefined): string | undefined {\n if (!nodeOptions?.trim()) {\n return undefined;\n }\n\n const parts = nodeOptions.trim().split(/\\s+/);\n const cleaned: string[] = [];\n\n for (let index = 0; index < parts.length; index++) {\n const part = parts[index]!;\n if (part === \"--conditions=development\") {\n continue;\n }\n if (part === \"--conditions\" && parts[index + 1] === \"development\") {\n index++;\n continue;\n }\n cleaned.push(part);\n }\n\n const result = cleaned.join(\" \").trim();\n return result || undefined;\n}\n\nexport function runtimeChildEnv(\n parentEnv: NodeJS.ProcessEnv,\n overrides: Record<string, string>,\n): NodeJS.ProcessEnv {\n const env: NodeJS.ProcessEnv = { ...parentEnv, ...overrides };\n delete env.KEYSTROKE_DEV;\n\n const nodeOptions = runtimeChildNodeOptions(env.NODE_OPTIONS);\n if (nodeOptions) {\n env.NODE_OPTIONS = nodeOptions;\n } else {\n delete env.NODE_OPTIONS;\n }\n\n // Local project API — sqlite only; Infisical POSTGRES_* is for platform/orchestrator.\n for (const key of [\n \"POSTGRES_HOST\",\n \"POSTGRES_PORT\",\n \"POSTGRES_DB\",\n \"POSTGRES_USER\",\n \"POSTGRES_PASSWORD\",\n \"DATABASE_SEARCH_PATH\",\n ]) {\n delete env[key];\n }\n if (!env.DATABASE_URL?.trim()) {\n env.DATABASE_URL = \"file:./data/dev.db\";\n }\n\n return env;\n}\n","import { pathToFileURL } from \"node:url\";\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { listenPortFromPublicUrl } from \"@keystrokehq/shared\";\nimport { runtimeChildEnv } from \"./runtime-child-env\";\n\nexport type BootstrapRunOptions = {\n root: string;\n runtimeNodeModules: string;\n apiPort: number;\n};\n\nexport type BootstrapRun = {\n cwd: string;\n args: string[];\n env: NodeJS.ProcessEnv;\n};\n\n/** Node args + env for `@keystrokehq/build` bootstrap (shared by start + dev). */\nexport async function resolveBootstrapRun(options: BootstrapRunOptions): Promise<BootstrapRun> {\n const { resolveRuntimeBuildArtifact } = await import(\"@keystrokehq/build\");\n const loader = pathToFileURL(\n resolveRuntimeBuildArtifact(options.runtimeNodeModules, \"dist/runtime-loader.mjs\"),\n ).href;\n const bootstrap = resolveRuntimeBuildArtifact(options.runtimeNodeModules, \"dist/bootstrap.mjs\");\n\n const args: string[] = [`--import=${loader}`];\n const envFile = join(options.root, \".env\");\n\n if (existsSync(envFile)) {\n args.push(`--env-file=${envFile}`);\n }\n\n args.push(bootstrap);\n\n const childEnv = runtimeChildEnv(process.env, {\n KEYSTROKE_ROOT: options.root,\n KEYSTROKE_RUNTIME_NODE_MODULES: options.runtimeNodeModules,\n PROJECT_ID: process.env.PROJECT_ID ?? \"default\",\n });\n childEnv.PORT = String(listenPortFromPublicUrl(childEnv.PUBLIC_SERVER_URL, options.apiPort));\n\n return {\n cwd: options.root,\n args,\n env: childEnv,\n };\n}\n","import { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nfunction isCliPackage(dir: string): boolean {\n const packageJsonPath = join(dir, \"package.json\");\n if (!existsSync(packageJsonPath)) {\n return false;\n }\n\n const pkg = JSON.parse(readFileSync(packageJsonPath, \"utf8\")) as { name?: string };\n return pkg.name === \"@keystrokehq/cli\";\n}\n\nexport function resolveCliRoot(fromModuleUrl: string): string {\n let dir = dirname(fileURLToPath(fromModuleUrl));\n\n while (dir !== dirname(dir)) {\n if (isCliPackage(dir)) {\n return dir;\n }\n\n dir = dirname(dir);\n }\n\n throw new Error(\"Could not resolve keystroke CLI package root\");\n}\n","import { spawn, type ChildProcess } from \"node:child_process\";\n\nexport type ManagedProcess = {\n name: string;\n child: ChildProcess;\n};\n\nexport function waitForExit(child: ChildProcess): Promise<number | null> {\n return new Promise((resolve) => {\n child.on(\"exit\", (code) => resolve(code ?? null));\n });\n}\n\nexport async function runUntilExit(processes: ManagedProcess[]): Promise<number | null> {\n const shutdown = (signal: NodeJS.Signals = \"SIGTERM\") => {\n for (const { child } of processes) {\n if (!child.killed && child.pid !== undefined) {\n child.kill(signal);\n }\n }\n };\n\n const onSignal = () => {\n shutdown(\"SIGINT\");\n process.exit(0);\n };\n\n process.on(\"SIGINT\", onSignal);\n process.on(\"SIGTERM\", onSignal);\n\n try {\n const results = await Promise.race(\n processes.map(async ({ name, child }) => {\n const code = await waitForExit(child);\n return { name, code };\n }),\n );\n\n if (results.code !== 0 && results.code !== null) {\n shutdown();\n throw new Error(`${results.name} exited with status ${results.code}`);\n }\n\n shutdown();\n return results.code;\n } finally {\n process.off(\"SIGINT\", onSignal);\n process.off(\"SIGTERM\", onSignal);\n }\n}\n\nexport function spawnNodeScript(options: {\n cwd: string;\n args: string[];\n env: NodeJS.ProcessEnv;\n}): ChildProcess {\n return spawn(\"node\", options.args, {\n cwd: options.cwd,\n env: options.env,\n stdio: \"inherit\",\n });\n}\n","import { spawnSync } from \"node:child_process\";\nimport { createRequire } from \"node:module\";\nimport { dirname, join } from \"node:path\";\n\nconst NATIVE_PACKAGES = [\"better-sqlite3\"] as const;\n\nfunction isMissingBindingsError(error: unknown): boolean {\n return error instanceof Error && error.message.includes(\"Could not locate the bindings file\");\n}\n\nfunction rebuildNativePackage(require: NodeRequire, pkg: string): void {\n const pkgDir = dirname(require.resolve(`${pkg}/package.json`));\n const npm = process.platform === \"win32\" ? \"npm.cmd\" : \"npm\";\n const result = spawnSync(npm, [\"run\", \"install\"], { cwd: pkgDir, stdio: \"inherit\" });\n\n if (result.status !== 0) {\n throw new Error(`Failed to build ${pkg} native bindings. Try: pnpm rebuild -g ${pkg}`);\n }\n}\n\n/** Compile native addons when pnpm skipped dependency install scripts (common on global install). */\nexport function ensureNativeDeps(nodeModulesRoot: string): void {\n const anchor = join(nodeModulesRoot, \"@keystrokehq\", \"server\", \"package.json\");\n const require = createRequire(anchor);\n\n for (const pkg of NATIVE_PACKAGES) {\n try {\n require(pkg);\n } catch (error) {\n if (!isMissingBindingsError(error)) {\n throw error;\n }\n\n process.stderr.write(`Building ${pkg} native bindings…\\n`);\n rebuildNativePackage(require, pkg);\n require(pkg);\n }\n }\n}\n","import { existsSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\n\n/** Directory whose `node_modules/@keystrokehq/server` ships with the CLI pack. */\nexport function resolveCliRuntimeNodeModules(cliRoot: string): string {\n let dir = cliRoot;\n\n while (dir !== dirname(dir)) {\n const nodeModules = join(dir, \"node_modules\");\n if (existsSync(join(nodeModules, \"@keystrokehq\", \"server\"))) {\n return nodeModules;\n }\n dir = dirname(dir);\n }\n\n throw new Error(\n \"Keystroke runtime packages are missing. Reinstall or repack the CLI (expected @keystrokehq/server in node_modules).\",\n );\n}\n","/**\n * `keystroke dev` — watch-build + API restart.\n *\n * NOT true hot reload. On src/ changes tsdown rebuilds dist/, then we stop and\n * boot the API again so route discovery picks up new agents/workflows/triggers.\n */\nimport type { Command } from \"commander\";\nimport type { ChildProcess } from \"node:child_process\";\nimport { createCliConfig, getConfigDir, getServerUrl } from \"../config\";\nimport { clearDevSession, writeDevSession } from \"../dev-session\";\nimport { resolveBootstrapRun } from \"../project/bootstrap-run\";\nimport { resolveCliRoot } from \"../project/resolve-cli-root\";\nimport { resolveProjectRoot } from \"../project/resolve-project-root\";\nimport { spawnNodeScript } from \"../process/run-processes\";\nimport { ensureNativeDeps } from \"../runtime/ensure-native-deps\";\nimport { resolveCliRuntimeNodeModules } from \"../runtime/resolve-runtime-node-modules\";\n\nconst DEV_BANNER = \"keystroke dev: watch rebuilds dist/ and restarts the API — not hot reload.\\n\";\n\ntype DevOptions = {\n dir: string;\n port?: number;\n};\n\nfunction stopChild(child: ChildProcess | undefined): void {\n if (child && !child.killed && child.pid !== undefined) {\n child.kill(\"SIGTERM\");\n }\n}\n\nfunction resolveDevServerUrl(\n config: ReturnType<typeof createCliConfig>,\n portOverride?: number,\n): string {\n const url = new URL(getServerUrl(config));\n if (portOverride !== undefined) {\n url.port = String(portOverride);\n }\n return url.origin;\n}\n\nexport async function runDev(options: DevOptions): Promise<void> {\n const root = resolveProjectRoot(options.dir);\n\n const runtimeNodeModules = resolveCliRuntimeNodeModules(resolveCliRoot(import.meta.url));\n ensureNativeDeps(runtimeNodeModules);\n\n const cliConfig = createCliConfig();\n const configDir = getConfigDir(cliConfig);\n\n process.stdout.write(DEV_BANNER);\n\n const serverUrl = resolveDevServerUrl(cliConfig, options.port);\n const apiPort = Number(new URL(serverUrl).port || 80);\n\n writeDevSession(\n {\n pid: process.pid,\n port: apiPort,\n root,\n serverUrl,\n },\n configDir,\n );\n\n let apiChild: ChildProcess | undefined;\n let restarting = false;\n let firstBoot = true;\n\n const restartApi = async () => {\n if (restarting) {\n return;\n }\n\n restarting = true;\n stopChild(apiChild);\n const bootstrap = await resolveBootstrapRun({\n root,\n runtimeNodeModules,\n apiPort,\n });\n apiChild = spawnNodeScript(bootstrap);\n\n if (firstBoot) {\n firstBoot = false;\n process.stdout.write(`API: ${serverUrl}\\n`);\n } else {\n process.stdout.write(\"API restarted after dist rebuild (not hot reload).\\n\");\n }\n\n restarting = false;\n };\n\n const shutdown = () => {\n clearDevSession(configDir);\n stopChild(apiChild);\n process.exit(0);\n };\n\n process.on(\"SIGINT\", shutdown);\n process.on(\"SIGTERM\", shutdown);\n\n try {\n const { watchApp } = await import(\"@keystrokehq/build\");\n await watchApp({\n root,\n clean: false,\n onRebuild: restartApi,\n });\n } finally {\n process.off(\"SIGINT\", shutdown);\n process.off(\"SIGTERM\", shutdown);\n clearDevSession(configDir);\n stopChild(apiChild);\n }\n}\n\nexport function registerDevCommand(program: Command): void {\n program\n .command(\"dev\")\n .description(\"Watch src/, rebuild dist/, and restart the API (not true hot reload)\")\n .option(\"--dir <path>\", \"Project directory\", process.cwd())\n .option(\"--port <number>\", \"API port\", (value) => Number(value))\n .action(async (options) => {\n try {\n await runDev({\n dir: options.dir,\n port: options.port,\n });\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Dev failed\";\n process.stderr.write(`${message}\\n`);\n process.exitCode = 1;\n }\n });\n}\n","import type { Command } from \"commander\";\nimport { runCliCommand } from \"../errors\";\n\nexport function registerHealthCommand(program: Command): void {\n program\n .command(\"health\")\n .description(\"Check connectivity to the keystroke API\")\n .action(() =>\n runCliCommand(\"Health check failed\", async ({ client }) => {\n const result = await client.health.check();\n process.stdout.write(`${JSON.stringify(result)}\\n`);\n }),\n );\n}\n","import { spawnSync } from \"node:child_process\";\n\nexport type PackageManager = \"npm\" | \"pnpm\" | \"yarn\" | \"bun\";\n\nconst MANAGERS: PackageManager[] = [\"pnpm\", \"npm\", \"yarn\", \"bun\"];\n\nexport function detectPackageManager(): PackageManager {\n const userAgent = process.env.npm_config_user_agent ?? \"\";\n\n for (const manager of MANAGERS) {\n if (userAgent.startsWith(manager)) {\n return manager;\n }\n }\n\n if (process.env.PNPM_HOME) {\n return \"pnpm\";\n }\n\n return \"npm\";\n}\n\nexport function resolvePackageManager(explicit?: string): PackageManager {\n if (!explicit) {\n return detectPackageManager();\n }\n\n const normalized = explicit.trim().toLowerCase();\n if (!MANAGERS.includes(normalized as PackageManager)) {\n throw new Error(`Unsupported package manager \"${explicit}\". Use npm, pnpm, yarn, or bun.`);\n }\n\n return normalized as PackageManager;\n}\n\n/** Resolve GitHub Packages auth for @keystrokehq/* when NODE_AUTH_TOKEN is unset. */\nexport function resolveGithubPackagesToken(): string | undefined {\n if (process.env.NODE_AUTH_TOKEN) {\n return process.env.NODE_AUTH_TOKEN;\n }\n\n for (const key of [\"GITHUB_TOKEN\", \"GH_TOKEN\"] as const) {\n const value = process.env[key];\n if (value) {\n return value;\n }\n }\n\n const gh = spawnSync(\"gh\", [\"auth\", \"token\"], { encoding: \"utf8\" });\n if (gh.status === 0) {\n const token = gh.stdout.trim();\n if (token) {\n return token;\n }\n }\n\n return undefined;\n}\n\nexport function installDependencies(cwd: string, manager: PackageManager): void {\n const token = resolveGithubPackagesToken();\n const env = token ? { ...process.env, NODE_AUTH_TOKEN: token } : process.env;\n\n const result = spawnSync(manager, [\"install\"], {\n cwd,\n stdio: \"inherit\",\n env,\n });\n\n if (result.status !== 0) {\n throw new Error(`${manager} install failed`);\n }\n}\n\nexport function installPlaygroundDependencies(cwd: string): void {\n const result = spawnSync(\"pnpm\", [\"install\", \"--ignore-workspace\"], {\n cwd,\n stdio: \"inherit\",\n env: process.env,\n });\n\n if (result.status !== 0) {\n throw new Error(\"pnpm install failed\");\n }\n}\n\n/**\n * Build every workspace package so the playground's `link:` deps resolve to\n * compiled `dist/`. Without this, `keystroke dev` fails with\n * `ERR_MODULE_NOT_FOUND` against whichever package was never built. Turbo\n * caches, so this is only slow on the first run.\n */\nexport function buildPlaygroundWorkspace(monorepoRoot: string): void {\n // Build with a clean Node env: the `keystroke-dev` wrapper sets\n // NODE_OPTIONS=--conditions=development, which would make tsdown/turbo resolve\n // their own deps to src/ and fail. Dropping NODE_OPTIONS builds to dist/ normally.\n const { NODE_OPTIONS: _drop, ...buildEnv } = process.env;\n const result = spawnSync(\"pnpm\", [\"run\", \"build\"], {\n cwd: monorepoRoot,\n stdio: \"inherit\",\n env: buildEnv,\n });\n\n if (result.status !== 0) {\n throw new Error(\"workspace build failed (pnpm run build)\");\n }\n}\n","const KEBAB_CASE = /^[a-z][a-z0-9-]*$/;\nconst HAS_EMOJI = /\\p{Extended_Pictographic}/u;\nconst HAS_UPPERCASE = /[A-Z]/;\nconst HAS_WHITESPACE = /\\s/;\nconst HAS_UNDERSCORE = /_/;\n\nconst EXAMPLE = \"my-keystroke\";\nconst RULES = \"Use lowercase letters, numbers, and hyphens only\";\n\nfunction projectNameValidationError(name: string): string {\n if (HAS_UPPERCASE.test(name)) {\n return `Project name must be lowercase (${RULES}; e.g. ${EXAMPLE})`;\n }\n if (HAS_WHITESPACE.test(name)) {\n return `Project name cannot contain spaces (${RULES}; e.g. ${EXAMPLE})`;\n }\n if (HAS_UNDERSCORE.test(name)) {\n return `Project name cannot contain underscores (${RULES}; e.g. ${EXAMPLE})`;\n }\n if (HAS_EMOJI.test(name)) {\n return `Project name cannot contain emojis (${RULES}; e.g. ${EXAMPLE})`;\n }\n if (/[^a-z0-9-]/.test(name)) {\n return `Project name cannot contain special characters (${RULES}; e.g. ${EXAMPLE})`;\n }\n if (!/^[a-z]/.test(name)) {\n return `Project name must start with a lowercase letter (e.g. ${EXAMPLE})`;\n }\n return `Project name must be kebab-case (${RULES}; e.g. ${EXAMPLE})`;\n}\n\nexport function assertProjectName(name: string): string {\n const trimmed = name.trim();\n if (!trimmed) {\n throw new Error(\"Project name is required\");\n }\n\n if (!KEBAB_CASE.test(trimmed)) {\n throw new Error(projectNameValidationError(trimmed));\n }\n\n return trimmed;\n}\n\nexport function projectNameFromDirectory(directory: string): string {\n const base = directory.split(/[/\\\\]/).filter(Boolean).at(-1) ?? directory;\n return assertProjectName(base);\n}\n","import { confirm, input } from \"@inquirer/prompts\";\nimport { resolve } from \"node:path\";\nimport { assertProjectName, projectNameFromDirectory } from \"./project-name\";\nimport type { InitOptions } from \"./types\";\n\nexport type InitPromptResult = {\n projectName: string;\n targetDir: string;\n};\n\nexport async function promptInitOptions(options: InitOptions): Promise<InitPromptResult> {\n const defaultName =\n options.name ??\n (options.directory ? projectNameFromDirectory(options.directory) : \"my-keystroke\");\n\n const projectName = assertProjectName(\n options.name ??\n (await input({\n message: \"Project name\",\n default: defaultName,\n validate: (value) => {\n try {\n assertProjectName(value);\n return true;\n } catch (error) {\n return error instanceof Error ? error.message : \"Invalid project name\";\n }\n },\n })),\n );\n\n const targetDir = resolve(\n options.directory ??\n (await input({\n message: \"Project directory\",\n default: `./${projectName}`,\n })),\n );\n\n return { projectName, targetDir };\n}\n\nexport async function confirmTargetDir(targetDir: string): Promise<boolean> {\n return confirm({\n message: `Directory \"${targetDir}\" is not empty. Continue and merge files?`,\n default: false,\n });\n}\n","import { readdir, readFile, stat, writeFile, mkdir } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\n\nexport type TemplateVariables = {\n projectName: string;\n version: string;\n};\n\nfunction renderTemplate(content: string, variables: TemplateVariables): string {\n return content\n .replaceAll(\"{{projectName}}\", variables.projectName)\n .replaceAll(\"{{version}}\", variables.version);\n}\n\nasync function copyEntry(\n sourcePath: string,\n targetPath: string,\n variables: TemplateVariables,\n): Promise<void> {\n const info = await stat(sourcePath);\n\n if (info.isDirectory()) {\n await mkdir(targetPath, { recursive: true });\n const entries = await readdir(sourcePath);\n\n for (const entry of entries) {\n await copyEntry(join(sourcePath, entry), join(targetPath, entry), variables);\n }\n\n return;\n }\n\n await mkdir(dirname(targetPath), { recursive: true });\n const content = await readFile(sourcePath, \"utf8\");\n await writeFile(targetPath, renderTemplate(content, variables));\n}\n\nexport async function copyTemplate(\n templateDir: string,\n targetDir: string,\n variables: TemplateVariables,\n): Promise<void> {\n await copyEntry(templateDir, targetDir, variables);\n}\n","import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { resolveCliRoot } from \"../project/resolve-cli-root\";\n\nexport function resolveTemplateDir(templateName: string, fromModuleUrl = import.meta.url): string {\n const cliRoot = resolveCliRoot(fromModuleUrl);\n // Check source first so contributors editing `templates/` see their changes\n // without rebuilding the CLI. End users don't have `templates/` (only `dist/`\n // ships), so the fallback is what they hit.\n const candidates = [\n join(cliRoot, \"templates\", templateName),\n join(cliRoot, \"dist\", \"templates\", templateName),\n ];\n\n for (const candidate of candidates) {\n if (existsSync(candidate)) {\n return candidate;\n }\n }\n\n throw new Error(`Template \"${templateName}\" not found`);\n}\n","import { readFile, unlink, writeFile } from \"node:fs/promises\";\nimport { join, relative } from \"node:path\";\n\nexport const PROJECT_NPMRC = `@keystrokehq:registry=https://registry.npmjs.org\n`;\n\nexport const PROJECT_GITIGNORE = `node_modules/\ndist/\ndata/\ncoverage/\n.env\n.agent/\n`;\n\nfunction linkSpec(fromDir: string, toDir: string): string {\n const path = relative(fromDir, toDir);\n return `link:${path.startsWith(\".\") ? path : `./${path}`}`;\n}\n\nfunction buildPlaygroundPackageJson(\n projectName: string,\n targetDir: string,\n monorepoRoot: string,\n): string {\n return `${JSON.stringify(\n {\n name: projectName,\n version: \"0.0.0\",\n private: true,\n type: \"module\",\n scripts: {\n dev: \"keystroke dev\",\n build: \"keystroke build\",\n start: \"keystroke start\",\n lint: \"oxlint .\",\n typecheck: \"tsc --noEmit\",\n \"test:unit\": \"vitest run --project unit\",\n \"test:int\": \"vitest run --project integration\",\n },\n dependencies: {\n \"@keystrokehq/action\": linkSpec(targetDir, join(monorepoRoot, \"packages/action\")),\n \"@keystrokehq/agent\": linkSpec(targetDir, join(monorepoRoot, \"packages/agent\")),\n \"@keystrokehq/config\": linkSpec(targetDir, join(monorepoRoot, \"packages/config\")),\n \"@keystrokehq/google\": linkSpec(\n targetDir,\n join(monorepoRoot, \"packages/integrations/google\"),\n ),\n \"@keystrokehq/slack\": linkSpec(\n targetDir,\n join(monorepoRoot, \"packages/integrations/slack\"),\n ),\n \"@keystrokehq/workflow\": linkSpec(targetDir, join(monorepoRoot, \"packages/workflow\")),\n zod: \"^4.4.3\",\n },\n devDependencies: {\n \"@keystrokehq/cli\": linkSpec(targetDir, join(monorepoRoot, \"apps/cli\")),\n \"@keystrokehq/tsconfig\": linkSpec(targetDir, join(monorepoRoot, \"packages/tsconfig\")),\n \"@types/node\": \"^25.9.1\",\n oxlint: \"^1.66.0\",\n typescript: \"^6.0.3\",\n vitest: \"^4.1.7\",\n },\n },\n null,\n 2,\n )}\\n`;\n}\n\n/** Patch hello-world scaffold for monorepo playground/ (link deps, no GitHub Packages). */\nexport async function applyPlaygroundManifest(\n targetDir: string,\n projectName: string,\n monorepoRoot: string,\n): Promise<void> {\n await writeFile(\n join(targetDir, \"package.json\"),\n buildPlaygroundPackageJson(projectName, targetDir, monorepoRoot),\n );\n\n try {\n await unlink(join(targetDir, \".npmrc\"));\n } catch {\n // Existing dirs may have a consumer .npmrc from an earlier scaffold.\n }\n\n const tsconfigPath = join(targetDir, \"tsconfig.json\");\n const tsconfig = JSON.parse(await readFile(tsconfigPath, \"utf8\")) as {\n include?: string[];\n compilerOptions?: { rootDir?: string };\n };\n tsconfig.include = [\"src\", \"keystroke.config.ts\"];\n if (tsconfig.compilerOptions) {\n tsconfig.compilerOptions.rootDir = \".\";\n }\n await writeFile(tsconfigPath, `${JSON.stringify(tsconfig, null, 2)}\\n`);\n}\n","import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { resolveCliRoot } from \"../project/resolve-cli-root\";\n\nconst SKILLS_BUNDLE = \"skills-bundle\";\n\nexport function resolveSkillsBundleDir(fromModuleUrl = import.meta.url): string {\n const cliRoot = resolveCliRoot(fromModuleUrl);\n // The real skills source lives in `packages/skills/`. Check it first so\n // contributor edits are picked up without rebuilding the CLI. End users\n // don't have those paths — they get the bundled copy under `dist/`.\n const candidates = [\n join(cliRoot, \"..\", \"..\", \"packages\", \"skills\", \"bundled\"),\n join(cliRoot, \"..\", \"..\", \"packages\", \"skills\", \"dist\"),\n join(cliRoot, \"dist\", SKILLS_BUNDLE),\n join(cliRoot, SKILLS_BUNDLE),\n ];\n\n for (const candidate of candidates) {\n if (existsSync(join(candidate, \"_AGENTS.md\"))) {\n return candidate;\n }\n }\n\n throw new Error(\n \"Bundled keystroke skills not found — run `pnpm --filter @keystrokehq/cli build`\",\n );\n}\n","import { cp, mkdir, readFile, symlink, writeFile } from \"node:fs/promises\";\nimport { platform } from \"node:os\";\nimport { dirname, join, relative } from \"node:path\";\nimport { resolveSkillsBundleDir } from \"./resolve-skills-bundle-dir\";\n\nasync function linkPath(target: string, linkPath: string, kind: \"dir\" | \"file\"): Promise<void> {\n await mkdir(dirname(linkPath), { recursive: true });\n const type = platform() === \"win32\" && kind === \"dir\" ? \"junction\" : kind;\n await symlink(target, linkPath, type);\n}\n\n/** Copy bundled skills into `.agents/skills/` and scaffold root agent docs. */\nexport async function scaffoldBundledSkills(\n targetDir: string,\n fromModuleUrl = import.meta.url,\n): Promise<void> {\n const bundleDir = resolveSkillsBundleDir(fromModuleUrl);\n const agentsSkillsDir = join(targetDir, \".agents\", \"skills\");\n const agentsMdPath = join(targetDir, \"AGENTS.md\");\n\n await mkdir(agentsSkillsDir, { recursive: true });\n await cp(join(bundleDir, \"skills\"), agentsSkillsDir, { recursive: true });\n await writeFile(agentsMdPath, await readFile(join(bundleDir, \"_AGENTS.md\"), \"utf8\"));\n\n const claudeSkillsLink = join(targetDir, \".claude\", \"skills\");\n await linkPath(relative(dirname(claudeSkillsLink), agentsSkillsDir), claudeSkillsLink, \"dir\");\n\n const claudeMdLink = join(targetDir, \"CLAUDE.md\");\n await linkPath(relative(dirname(claudeMdLink), agentsMdPath), claudeMdLink, \"file\");\n}\n","import { mkdir } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nconst EMPTY_SRC_DIRS = [\"files\", \"skills\", \"triggers\"] as const;\n\n/** Ensure standard empty `src/` folders exist (git does not track empty directories). */\nexport async function scaffoldEmptySrcDirs(targetDir: string): Promise<void> {\n await Promise.all(\n EMPTY_SRC_DIRS.map((dir) => mkdir(join(targetDir, \"src\", dir), { recursive: true })),\n );\n}\n","import { writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { PROJECT_GITIGNORE, PROJECT_NPMRC } from \"./project-files\";\n\n/** Write dotfiles npm/pnpm deploy omits from bundled templates. */\nexport async function scaffoldProjectDotfiles(targetDir: string): Promise<void> {\n await writeFile(join(targetDir, \".npmrc\"), PROJECT_NPMRC);\n await writeFile(join(targetDir, \".gitignore\"), PROJECT_GITIGNORE);\n}\n","import { existsSync } from \"node:fs\";\nimport { access, copyFile, readdir } from \"node:fs/promises\";\nimport { basename, isAbsolute, join, relative, resolve } from \"node:path\";\nimport {\n buildPlaygroundWorkspace,\n installDependencies,\n installPlaygroundDependencies,\n resolvePackageManager,\n} from \"./package-manager\";\nimport { assertProjectName, projectNameFromDirectory } from \"./project-name\";\nimport { confirmTargetDir, promptInitOptions } from \"./prompts\";\nimport { copyTemplate } from \"./copy-template\";\nimport { resolveTemplateDir } from \"./resolve-template-dir\";\nimport { applyPlaygroundManifest } from \"./project-files\";\nimport { scaffoldBundledSkills } from \"./scaffold-bundled-skills\";\nimport { scaffoldEmptySrcDirs } from \"./scaffold-empty-src-dirs\";\nimport { scaffoldProjectDotfiles } from \"./scaffold-project-dotfiles\";\nimport { resolveCliRoot } from \"../project/resolve-cli-root\";\nimport type { InitOptions } from \"./types\";\n\nexport type RunInitOptions = InitOptions & {\n version: string;\n};\n\nfunction monorepoRoot(): string | null {\n const root = join(resolveCliRoot(import.meta.url), \"..\", \"..\");\n return existsSync(join(root, \"pnpm-workspace.yaml\")) ? root : null;\n}\n\nfunction resolvePlaygroundRoot(targetDir: string): string | null {\n if (process.env.KEYSTROKE_DEV !== \"1\") {\n return null;\n }\n\n const root = monorepoRoot();\n if (!root) {\n return null;\n }\n\n const rel = relative(join(root, \"playground\"), resolve(targetDir));\n return rel.length > 0 && !rel.startsWith(\"..\") && !isAbsolute(rel) ? root : null;\n}\n\nasync function directoryExists(path: string): Promise<boolean> {\n try {\n await access(path);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function directoryIsEmpty(path: string): Promise<boolean> {\n if (!(await directoryExists(path))) {\n return true;\n }\n\n const entries = await readdir(path);\n return entries.length === 0;\n}\n\nfunction resolveHeadlessOptions(options: RunInitOptions): {\n projectName: string;\n targetDir: string;\n} {\n const targetDir = resolve(options.directory ?? options.name ?? \"my-keystroke\");\n const projectName = assertProjectName(\n options.name ?? projectNameFromDirectory(basename(targetDir)),\n );\n\n return { projectName, targetDir };\n}\n\nexport async function runInit(\n options: RunInitOptions,\n): Promise<{ targetDir: string; projectName: string }> {\n const interactive = !options.yes && process.stdin.isTTY;\n const resolved = interactive ? await promptInitOptions(options) : resolveHeadlessOptions(options);\n const { projectName, targetDir } = resolved;\n const playgroundRoot = resolvePlaygroundRoot(targetDir);\n\n if (!(await directoryIsEmpty(targetDir))) {\n if (interactive) {\n const ok = await confirmTargetDir(targetDir);\n if (!ok) {\n throw new Error(\"Init cancelled\");\n }\n } else if (!options.yes) {\n throw new Error(\n `Directory \"${targetDir}\" is not empty. Pass --yes to merge or choose an empty directory.`,\n );\n }\n }\n\n await copyTemplate(resolveTemplateDir(options.template ?? \"hello-world\"), targetDir, {\n projectName,\n version: options.version,\n });\n await scaffoldEmptySrcDirs(targetDir);\n\n if (playgroundRoot) {\n await applyPlaygroundManifest(targetDir, projectName, playgroundRoot);\n } else {\n await scaffoldProjectDotfiles(targetDir);\n }\n\n await scaffoldBundledSkills(targetDir);\n await copyFile(join(targetDir, \".env.example\"), join(targetDir, \".env\"));\n\n if (!options.skipInstall) {\n if (playgroundRoot) {\n installPlaygroundDependencies(targetDir);\n // `link:` deps consume each package's built dist/; build so `keystroke dev`\n // works immediately instead of failing with ERR_MODULE_NOT_FOUND.\n buildPlaygroundWorkspace(playgroundRoot);\n } else {\n const manager = resolvePackageManager(options.packageManager);\n installDependencies(targetDir, manager);\n }\n }\n\n return { targetDir, projectName };\n}\n","import { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { resolveCliRoot } from \"./project/resolve-cli-root\";\n\nexport function readCliVersion(): string {\n const packageJsonPath = join(resolveCliRoot(import.meta.url), \"package.json\");\n const pkg = JSON.parse(readFileSync(packageJsonPath, \"utf8\")) as { version?: string };\n return pkg.version ?? \"0.0.0\";\n}\n","import type { Command } from \"commander\";\nimport { runInit } from \"../init/run-init\";\nimport { readCliVersion } from \"../version\";\n\nexport function registerInitCommand(program: Command): void {\n program\n .command(\"init\")\n .description(\"Create a new keystroke project from a template\")\n .argument(\"[directory]\", \"Directory to create the project in\")\n .option(\"--name <name>\", \"Project name (kebab-case)\")\n .option(\"--template <name>\", \"Template to use\", \"hello-world\")\n .option(\"-y, --yes\", \"Skip prompts (headless mode for scripts and AI agents)\")\n .option(\"--skip-install\", \"Skip dependency installation\")\n .option(\"--pm <manager>\", \"Package manager: npm, pnpm, yarn, or bun\")\n .action(async (directory: string | undefined, options) => {\n try {\n const result = await runInit({\n directory,\n name: options.name,\n template: options.template,\n yes: options.yes,\n skipInstall: options.skipInstall,\n packageManager: options.pm,\n version: readCliVersion(),\n });\n\n process.stdout.write(\n `Created keystroke project \"${result.projectName}\" at ${result.targetDir}\\n`,\n );\n process.stdout.write(\"\\nNext steps:\\n\");\n process.stdout.write(` cd ${result.targetDir}\\n`);\n process.stdout.write(\" # set ANTHROPIC_API_KEY and integration keys in .env\\n\");\n process.stdout.write(\" keystroke dev\\n\");\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Init failed\";\n process.stderr.write(`${message}\\n`);\n process.exitCode = 1;\n }\n });\n}\n","import type Conf from \"conf\";\nimport type { PlatformClient } from \"@keystrokehq/sdk/platform\";\nimport type { CreateProjectRequest, Project } from \"@keystrokehq/shared\";\n\nimport type { CliConfig } from \"../../config\";\nimport { cliBinaryName } from \"../../errors/command-input\";\nimport { selectActiveOrganization } from \"../../organization/active-organization\";\nimport { createCliPlatformClient } from \"../../platform-client\";\n\nexport async function withActivePlatformClient(\n config: Conf<CliConfig>,\n fn: (platform: PlatformClient) => Promise<void>,\n): Promise<void> {\n const platform = createCliPlatformClient(config);\n let active = await platform.organizations.getActive();\n if (!active) {\n active = await selectActiveOrganization(config);\n }\n\n platform.setActiveOrganizationId(active.organization.id);\n await fn(platform);\n}\n\nfunction writeInactiveDeployHints(projects: Pick<Project, \"id\" | \"status\">[]): void {\n const bin = cliBinaryName();\n for (const project of projects) {\n if (project.status !== \"inactive\") {\n continue;\n }\n\n process.stderr.write(\n `Project ${project.id} is inactive. Deploy with: ${bin} deploy --project ${project.id}\\n`,\n );\n }\n}\n\nexport async function runProjectList(config: Conf<CliConfig>): Promise<void> {\n await withActivePlatformClient(config, async (platform) => {\n const projects = await platform.projects.list();\n process.stdout.write(`${JSON.stringify({ projects }, null, 2)}\\n`);\n\n if (projects.length === 0) {\n const bin = cliBinaryName();\n process.stderr.write(\n `No projects yet. Create one with: ${bin} project create --name \"My project\"\\n`,\n );\n return;\n }\n\n writeInactiveDeployHints(projects);\n });\n}\n\nexport async function runProjectCreate(\n config: Conf<CliConfig>,\n input: CreateProjectRequest,\n): Promise<void> {\n await withActivePlatformClient(config, async (platform) => {\n const project = await platform.projects.create(input);\n process.stdout.write(`${JSON.stringify({ project }, null, 2)}\\n`);\n writeInactiveDeployHints([project]);\n });\n}\n","import type { Command } from \"commander\";\n\nimport { createCliConfig, getPlatformUrl, getWebUrl } from \"../../config\";\nimport { formatCliError } from \"../../errors/format-cli-error\";\nimport { runProjectCreate, runProjectList } from \"./run-project\";\n\nexport function registerProjectCommand(program: Command): void {\n const project = program.command(\"project\").description(\"List and create platform projects\");\n\n project\n .command(\"list\")\n .description(\"List projects in the active organization\")\n .action(async () => {\n const config = createCliConfig();\n try {\n await runProjectList(config);\n } catch (error) {\n process.stderr.write(\n `${formatCliError(error, \"List projects failed\", {\n serverUrl: getPlatformUrl(config),\n webUrl: getWebUrl(config),\n })}\\n`,\n );\n process.exitCode = 1;\n }\n });\n\n project\n .command(\"create\")\n .description(\"Create a platform project in the active organization\")\n .requiredOption(\"--name <name>\", \"Project name\")\n .option(\"--description <description>\", \"Project description\")\n .action(async (options: { name: string; description?: string }) => {\n const config = createCliConfig();\n try {\n await runProjectCreate(config, {\n name: options.name,\n ...(options.description ? { description: options.description } : {}),\n });\n } catch (error) {\n process.stderr.write(\n `${formatCliError(error, \"Create project failed\", {\n serverUrl: getPlatformUrl(config),\n webUrl: getWebUrl(config),\n })}\\n`,\n );\n process.exitCode = 1;\n }\n });\n}\n","import type { Command } from \"commander\";\nimport { createCliConfig, getServerUrl } from \"../config\";\nimport { resolveBootstrapRun } from \"../project/bootstrap-run\";\nimport { resolveCliRoot } from \"../project/resolve-cli-root\";\nimport { resolveProjectRoot } from \"../project/resolve-project-root\";\nimport { runUntilExit, spawnNodeScript, type ManagedProcess } from \"../process/run-processes\";\nimport { ensureNativeDeps } from \"../runtime/ensure-native-deps\";\nimport { resolveCliRuntimeNodeModules } from \"../runtime/resolve-runtime-node-modules\";\n\ntype StartOptions = {\n dir: string;\n port?: number;\n};\n\nfunction resolveStartServerUrl(portOverride?: number): string {\n const url = new URL(getServerUrl(createCliConfig()));\n if (portOverride !== undefined) {\n url.port = String(portOverride);\n }\n return url.origin;\n}\n\nexport async function runStart(options: StartOptions): Promise<void> {\n const root = resolveProjectRoot(options.dir);\n const serverUrl = resolveStartServerUrl(options.port);\n const apiPort = Number(new URL(serverUrl).port || 80);\n\n const runtimeNodeModules = resolveCliRuntimeNodeModules(resolveCliRoot(import.meta.url));\n ensureNativeDeps(runtimeNodeModules);\n const { buildApp } = await import(\"@keystrokehq/build\");\n await buildApp({ root, clean: false });\n\n const bootstrap = await resolveBootstrapRun({\n root,\n runtimeNodeModules,\n apiPort,\n });\n\n const processes: ManagedProcess[] = [\n {\n name: \"api\",\n child: spawnNodeScript(bootstrap),\n },\n ];\n\n process.stdout.write(`API: ${serverUrl}\\n`);\n\n await runUntilExit(processes);\n}\n\nexport function registerStartCommand(program: Command): void {\n program\n .command(\"start\")\n .description(\"Build and run the API server\")\n .option(\"--dir <path>\", \"Project directory\", process.cwd())\n .option(\"--port <number>\", \"API port\", (value) => Number(value))\n .action(async (options) => {\n try {\n await runStart({\n dir: options.dir,\n port: options.port,\n });\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Start failed\";\n process.stderr.write(`${message}\\n`);\n process.exitCode = 1;\n }\n });\n}\n","import type { Command } from \"commander\";\nimport { runProjectCliCommand } from \"../../errors\";\n\nexport function registerTriggerListCommand(trigger: Command): void {\n trigger\n .command(\"list\")\n .description(\"List discovered triggers\")\n .option(\"--endpoint <endpoint>\", \"Only webhook triggers on this shared endpoint\")\n .action((options: { endpoint?: string }) =>\n runProjectCliCommand(\"List triggers failed\", async ({ client }) => {\n const result = await client.triggers.list(\n options.endpoint ? { endpoint: options.endpoint } : undefined,\n );\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n}\n\nexport function registerTriggerGetCommand(trigger: Command): void {\n trigger\n .command(\"get\")\n .description(\"Get a trigger by key, or all webhook triggers on a shared endpoint\")\n .argument(\"<id>\", \"Trigger key or shared webhook endpoint\")\n .action((id: string) =>\n runProjectCliCommand(\"Get trigger failed\", async ({ client }) => {\n const result = await client.triggers.get(id);\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n}\n\nexport function registerTriggerUrlCommand(trigger: Command): void {\n trigger\n .command(\"url\")\n .description(\"Print the webhook URL for a trigger\")\n .argument(\"<id>\", \"Attachment key or webhook route\")\n .action((id: string) =>\n runProjectCliCommand(\"Resolve webhook URL failed\", async ({ client }) => {\n const url = await client.triggers.webhookUrl(id);\n process.stdout.write(`${url}\\n`);\n }),\n );\n}\n","import type { Command } from \"commander\";\nimport { runProjectCliCommand } from \"../../errors\";\n\nfunction collect(value: string, previous: string[]): string[] {\n return [...previous, value];\n}\n\nexport function registerTriggerPollCommand(trigger: Command): void {\n trigger\n .command(\"poll\")\n .description(\"Run a poll trigger on demand\")\n .argument(\"<id>\", \"Poll attachment key, or poll source id with --group\")\n .option(\"--group\", \"Run all attachments that share this poll source id\")\n .option(\"--workflow <key>\", \"Only trigger this workflow (repeatable)\", collect, [])\n .option(\"--attachment <key>\", \"Only trigger this attachment (repeatable)\", collect, [])\n .action((id: string, options: { group?: boolean; workflow: string[]; attachment: string[] }) =>\n runProjectCliCommand(\"Poll trigger failed\", async ({ client }) => {\n const result = await client.triggers.poll(id, {\n ...(options.group ? { group: true } : {}),\n ...(options.workflow.length > 0 ? { workflows: options.workflow } : {}),\n ...(options.attachment.length > 0 ? { attachments: options.attachment } : {}),\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n}\n","import type { Command } from \"commander\";\nimport { runProjectCliCommand } from \"../../errors\";\n\nexport function registerTriggerRunsCommand(trigger: Command): void {\n const runs = trigger.command(\"runs\").description(\"List and inspect trigger runs\");\n\n runs\n .command(\"list\")\n .description(\"List runs for a trigger attachment\")\n .argument(\"<attachmentId>\", \"Trigger attachment key\")\n .option(\"--limit <n>\", \"Page size (1–100)\", \"20\")\n .option(\"--cursor <cursor>\", \"Pagination cursor from a previous page\")\n .option(\"--trigger-type <type>\", \"Filter by trigger type (cron, webhook, poll)\")\n .action((attachmentId: string, options: Record<string, string | undefined>) =>\n runProjectCliCommand(\"List trigger runs failed\", async ({ client }) => {\n const result = await client.triggers.listRuns(attachmentId, {\n limit: Number(options.limit),\n ...(options.cursor ? { cursor: options.cursor } : {}),\n ...(options.triggerType\n ? { triggerType: options.triggerType as \"cron\" | \"webhook\" | \"poll\" }\n : {}),\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n\n runs\n .command(\"get\")\n .description(\"Get full details for a trigger run\")\n .argument(\"<attachmentId>\", \"Trigger attachment key\")\n .argument(\"<runId>\", \"Trigger run id\")\n .option(\"--include <parts>\", \"Comma-separated: workflows, trace\")\n .action((attachmentId: string, runId: string, options: { include?: string }) =>\n runProjectCliCommand(\"Get trigger run failed\", async ({ client }) => {\n const result = await client.triggers.getRun(attachmentId, runId, {\n include: options.include,\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n}\n","import type { Command } from \"commander\";\nimport {\n registerTriggerGetCommand,\n registerTriggerListCommand,\n registerTriggerUrlCommand,\n} from \"./list\";\nimport { registerTriggerPollCommand } from \"./poll\";\nimport { registerTriggerRunsCommand } from \"./runs\";\n\nexport function registerTriggerCommand(program: Command): void {\n const trigger = program.command(\"trigger\").description(\"Invoke and inspect triggers\");\n\n registerTriggerListCommand(trigger);\n registerTriggerGetCommand(trigger);\n registerTriggerUrlCommand(trigger);\n registerTriggerPollCommand(trigger);\n registerTriggerRunsCommand(trigger);\n}\n","import { isQueuedRunResponse } from \"@keystrokehq/sdk\";\nimport type { Command } from \"commander\";\nimport { cliBinaryName, parseJsonOption, runProjectCliCommand } from \"../../errors\";\n\nexport function registerWorkflowRunCommand(workflow: Command): void {\n workflow\n .command(\"run\")\n .description(\"Invoke a workflow\")\n .argument(\"<workflowId>\", \"Workflow key / route id\")\n .option(\"--input <json>\", \"JSON request body (defaults to {})\", \"{}\")\n .addHelpText(\n \"after\",\n `\nExamples:\n ${cliBinaryName()} workflow run math --input '{\"first\":1,\"second\":2}'\n ${cliBinaryName()} workflow run incoming-message --input '{\"message\":\"Hi\",\"sender\":\"you\"}'\n`,\n )\n .action((workflowId: string, options: { input: string }) =>\n runProjectCliCommand(\n \"Workflow run failed\",\n async ({ client }) => {\n const input = parseJsonOption(options.input, \"--input\");\n const result = await client.workflows.run(workflowId, input);\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n\n if (isQueuedRunResponse(result)) {\n process.stderr.write(\n `Run queued. Track progress:\\n` +\n ` ${cliBinaryName()} workflow runs get ${workflowId} ${result.runId} --include steps,trace\\n`,\n );\n }\n },\n {\n usage: {\n command: `${cliBinaryName()} workflow run ${workflowId}`,\n flag: \"--input\",\n },\n },\n ),\n );\n}\n","import type { Command } from \"commander\";\nimport { runProjectCliCommand } from \"../../errors\";\n\nexport function registerWorkflowRunsCommand(workflow: Command): void {\n const runs = workflow.command(\"runs\").description(\"List and inspect workflow runs\");\n\n runs\n .command(\"list\")\n .description(\"List runs for a workflow\")\n .argument(\"<workflowId>\", \"Workflow key / route id\")\n .option(\"--limit <n>\", \"Page size (1–100)\", \"20\")\n .option(\"--cursor <cursor>\", \"Pagination cursor from a previous page\")\n .option(\"--status <status>\", \"Filter by status\")\n .option(\"--trigger <trigger>\", \"Filter by trigger kind\")\n .action((workflowId: string, options: Record<string, string | undefined>) =>\n runProjectCliCommand(\"List workflow runs failed\", async ({ client }) => {\n const result = await client.workflows.listRuns(workflowId, {\n limit: Number(options.limit),\n ...(options.cursor ? { cursor: options.cursor } : {}),\n ...(options.status\n ? { status: options.status as \"pending\" | \"running\" | \"completed\" | \"failed\" }\n : {}),\n ...(options.trigger\n ? { trigger: options.trigger as \"api\" | \"cron\" | \"webhook\" | \"poll\" | \"retry\" }\n : {}),\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n\n runs\n .command(\"get\")\n .description(\"Get full details for a workflow run\")\n .argument(\"<workflowId>\", \"Workflow key / route id\")\n .argument(\"<runId>\", \"Workflow run id\")\n .option(\"--include <parts>\", \"Comma-separated: trigger, steps, trace\")\n .action((workflowId: string, runId: string, options: { include?: string }) =>\n runProjectCliCommand(\"Get workflow run failed\", async ({ client }) => {\n const result = await client.workflows.getRun(workflowId, runId, {\n include: options.include,\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n}\n","import type { Command } from \"commander\";\nimport { registerWorkflowRunCommand } from \"./run\";\nimport { registerWorkflowRunsCommand } from \"./runs\";\n\nexport function registerWorkflowCommand(program: Command): void {\n const workflow = program.command(\"workflow\").description(\"Invoke and inspect workflows\");\n\n registerWorkflowRunCommand(workflow);\n registerWorkflowRunsCommand(workflow);\n}\n","import type Conf from \"conf\";\nimport type { Project } from \"@keystrokehq/shared\";\nimport { PlatformError } from \"@keystrokehq/sdk/platform\";\n\nimport type { CliConfig } from \"../../config\";\nimport { cliBinaryName } from \"../../errors/command-input\";\nimport { createCliPlatformClient } from \"../../platform-client\";\n\nexport type ConfigUseProjectResult = {\n stdout: string;\n stderr?: string;\n};\n\nasync function fetchProjectInOrg(config: Conf<CliConfig>, projectId: string): Promise<Project> {\n const platform = createCliPlatformClient(config);\n\n try {\n return await platform.projects.get(projectId);\n } catch (error) {\n if (error instanceof PlatformError && error.status === 404) {\n throw new Error(\n `Project ${projectId} not found in the active organization. Run \\`keystroke project list\\`, then \\`keystroke config use project <id>\\`.`,\n );\n }\n throw error;\n }\n}\n\nfunction assertProjectReadyForConfig(project: Project): void {\n if (project.status === \"failed\") {\n throw new Error(\n project.lastError\n ? `Project ${project.id} deploy failed: ${project.lastError}`\n : `Project ${project.id} deploy failed`,\n );\n }\n\n if (project.status === \"starting\") {\n throw new Error(\n `Project ${project.id} is still starting. Wait for deploy to finish, then run \\`keystroke config use project ${project.id}\\`.`,\n );\n }\n}\n\nexport async function runConfigUseProject(\n config: Conf<CliConfig>,\n projectId: string,\n): Promise<ConfigUseProjectResult> {\n const project = await fetchProjectInOrg(config, projectId);\n assertProjectReadyForConfig(project);\n\n config.set(\"activeProjectId\", projectId);\n config.set(\"apiTarget\", \"platform\");\n\n const stdout =\n project.status === \"active\"\n ? `Using platform project ${projectId}\\n`\n : `Using platform project ${projectId} (${project.status})\\n`;\n\n const stderr =\n project.status === \"inactive\"\n ? `Project is not active yet. Deploy with: ${cliBinaryName()} deploy --project ${projectId}\\n`\n : undefined;\n\n return { stdout, stderr };\n}\n","import type { Command } from \"commander\";\n\nimport { createCliConfig, getConfigDir, getEffectiveApiTarget, getPlatformUrl } from \"../../config\";\nimport { readDevSession } from \"../../dev-session\";\nimport {\n listOrganizations,\n selectActiveOrganization,\n} from \"../../organization/active-organization\";\nimport { runConfigUseProject } from \"./use-project\";\n\nexport function registerConfigCommand(program: Command): void {\n const config = program.command(\"config\").description(\"Manage CLI configuration\");\n\n config\n .command(\"show\")\n .description(\"Show CLI configuration\")\n .action(() => {\n const cliConfig = createCliConfig();\n const configDir = getConfigDir(cliConfig);\n process.stdout.write(\n `${JSON.stringify(\n {\n serverUrl: cliConfig.get(\"serverUrl\"),\n webUrl: cliConfig.get(\"webUrl\"),\n platformUrl: getPlatformUrl(cliConfig),\n activeOrganizationId: cliConfig.get(\"activeOrganizationId\"),\n activeProjectId: cliConfig.get(\"activeProjectId\"),\n apiTarget: getEffectiveApiTarget(cliConfig),\n devSession: readDevSession(configDir) ?? null,\n },\n null,\n 2,\n )}\\n`,\n );\n });\n\n config\n .command(\"use\")\n .description(\"Switch API target (local/cloud/project) or active organization\")\n .argument(\"[mode]\", \"local, cloud, project, or org\")\n .argument(\"[id]\", \"Project or organization id when switching cloud target or org\")\n .action(async (mode?: string, id?: string) => {\n const cliConfig = createCliConfig();\n\n if (!mode || mode === \"local\") {\n cliConfig.set(\"apiTarget\", \"local\");\n const activeProjectId = cliConfig.get(\"activeProjectId\");\n process.stdout.write(\n activeProjectId\n ? `Using local keystroke server (cloud project ${activeProjectId} unchanged)\\n`\n : \"Using local keystroke server\\n\",\n );\n return;\n }\n\n if (mode === \"org\") {\n const membership = await selectActiveOrganization(cliConfig, { organizationId: id });\n process.stdout.write(`Using organization ${membership.organization.name}\\n`);\n return;\n }\n\n if (mode === \"cloud\") {\n cliConfig.set(\"apiTarget\", \"platform\");\n const activeProjectId = cliConfig.get(\"activeProjectId\");\n process.stdout.write(\n activeProjectId\n ? `Using platform API (default project ${activeProjectId} for project-scoped commands)\\n`\n : \"Using platform API\\n\",\n );\n return;\n }\n\n if (mode !== \"project\") {\n throw new Error(\n \"Usage: keystroke config use [local|cloud|project [projectId]|org [organizationId]]\",\n );\n }\n\n const targetProjectId = id ?? cliConfig.get(\"activeProjectId\");\n if (!targetProjectId) {\n throw new Error(\"Usage: keystroke config use project <projectId>\");\n }\n\n const result = await runConfigUseProject(cliConfig, targetProjectId);\n process.stdout.write(result.stdout);\n if (result.stderr) {\n process.stderr.write(result.stderr);\n }\n });\n\n config\n .command(\"org\")\n .description(\"List organizations you belong to\")\n .action(async () => {\n const cliConfig = createCliConfig();\n const organizations = await listOrganizations(cliConfig);\n process.stdout.write(`${JSON.stringify({ organizations }, null, 2)}\\n`);\n });\n}\n","import { Command } from \"commander\";\nimport { registerAgentCommand } from \"./commands/agent\";\nimport { registerConnectCommand } from \"./commands/connect\";\nimport { registerCredentialsCommand } from \"./commands/credentials\";\nimport { registerAuthCommand } from \"./commands/auth\";\nimport { registerBuildCommand } from \"./commands/build\";\nimport { registerDeployCommand } from \"./commands/deploy\";\nimport { registerDevCommand } from \"./commands/dev\";\nimport { registerHealthCommand } from \"./commands/health\";\nimport { registerInitCommand } from \"./commands/init\";\nimport { registerProjectCommand } from \"./commands/project\";\nimport { registerStartCommand } from \"./commands/start\";\nimport { registerTriggerCommand } from \"./commands/trigger\";\nimport { registerWorkflowCommand } from \"./commands/workflow\";\nimport { registerConfigCommand } from \"./commands/config\";\nimport { readCliVersion } from \"./version\";\nimport { setCliTargetOptions } from \"./target-options\";\n\nexport function createProgram(): Command {\n const program = new Command()\n .name(\"keystroke\")\n .description(\"Build, run, and manage keystroke projects\")\n .version(readCliVersion())\n .option(\"--project <id>\", \"Platform project id (deploy target or one-off API target)\")\n .option(\"--local\", \"Force local keystroke server URL\")\n .hook(\"preAction\", (thisCommand) => {\n const opts = thisCommand.opts<{ project?: string; local?: boolean }>();\n setCliTargetOptions({\n projectId: opts.project,\n local: opts.local,\n });\n });\n\n registerAuthCommand(program);\n registerConnectCommand(program);\n registerConfigCommand(program);\n registerProjectCommand(program);\n registerCredentialsCommand(program);\n registerHealthCommand(program);\n registerInitCommand(program);\n registerBuildCommand(program);\n registerDeployCommand(program);\n registerDevCommand(program);\n registerStartCommand(program);\n registerAgentCommand(program);\n registerWorkflowCommand(program);\n registerTriggerCommand(program);\n return program;\n}\n\nexport function runCli(argv: string[]): void {\n createProgram().parse(argv);\n}\n","import { runCli } from \"./program\";\n\nrunCli(process.argv);\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97],"mappings":";;;;;;;;;;;;;;;;;;;;AAOA,IAAa,UAAb,cAA6B,MAAM;CAC/B,OAAO;CACP,IAAI,YAAY;EACZ,OAAO;CACX;AACJ;;;;;;;;;;;;ACFA,IAAa,YAAb,cAA+B,QAAQ;CACnC,OAAO;CACP;CACA;CACA;CACA;CACA,YAAY,UAAU,SAAS,SAAS;EAGpC,MAAM,SAAS,GAFD,SAAS,UAAU,SAAS,WAAW,IAAK,SAAS,SAAS,GAErD,GADT,SAAS,cAAc,KACH,KAAK;EACvC,MAAM,SAAS,SAAS,eAAe,WAAW;EAClD,MAAM,uBAAuB,OAAO,IAAI,QAAQ,OAAO,GAAG,QAAQ,KAAK;EACvE,KAAK,WAAW;EAChB,KAAK,UAAU;EACf,KAAK,UAAU;CACnB;AACJ;;;;;;;;;;AClBA,IAAa,eAAb,cAAkC,QAAQ;CACtC,OAAO;CACP;CACA,YAAY,SAAS,SAAS;EAC1B,MAAM,0CAA0C,QAAQ,OAAO,GAAG,QAAQ,OAAO,OAAO;EACxF,KAAK,UAAU;CACnB;AACJ;;;;;;;;ACVA,IAAa,WAAb,cAA8B,MAAM;CAChC,OAAO;CACP;CACA,YAAY,OAAO;EACf,IAAI,UAAU;EAEd,IAAI;GACA,IAAI,OAAO,UAAU,UACjB,UAAU;QAET,IAAI,SAAS,OAAO,UAAU,YAAY,aAAa,SAAS,OAAO,MAAM,YAAY,UAC1F,UAAU,MAAM;EAExB,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A;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,0BAA0B;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,oBAAoB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;AAKA,MAAM,8BAA8B,IAAI,IAAI;CAC3C,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACJ,CAAC;;;;;;;;;AASD,MAAM,yBAAyBC,OAAS,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,GAAG,oCAAoC,EAAE,IAAI,IAAI,oCAAoC,EAAE,MAAM,8BAA8B,iDAAiD;;;;;;;AA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Aa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;AACD;AACA,MAAM,+BAA+B;CACpC,aAAa;CACb,aAAa;CACb,cAAc;CACd,iBAAiB;CACjB,aAAa;CACb,cAAc;CACd,gBAAgB;CAChB,qBAAqB;CACrB,oBAAoB;CACpB,uBAAuB;CACvB,cAAc;CACd,cAAc;CACd,YAAY;CACZ,aAAa;CACb,cAAc;CACd,eAAe;CACf,cAAc;CACd,eAAe;CACf,uBAAuB;CACvB,mBAAmB;CACnB,gBAAgB;CAChB,gBAAgB;CAChB,eAAe;CACf,kBAAkB;CAClB,iBAAiB;CACjB,gBAAgB;CAChB,eAAe;CACf,iBAAiB;CACjB,aAAa;CACb,cAAc;CACd,kBAAkB;CAClB,YAAY;CACZ,eAAe;CACf,mBAAmB;CACnB,eAAe;CACf,iBAAiB;CACjB,gBAAgB;CAChB,gBAAgB;CAChB,oBAAoB;CACpB,gBAAgB;CAChB,gBAAgB;CAChB,eAAe;CACf,WAAW;CACX,aAAa;CACb,aAAa;CACb,cAAc;CACd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,SAAS;CACT,OAAO;CACP,IAAI;CACJ,gBAAgB;CAChB,WAAW;CACX,eAAe;CACf,cAAc;CACd,sBAAsB;CACtB,QAAQ;CACR,SAAS;AACV;AACA,SAAS,4BAA4B,KAAK;CACzC,MAAM,WAAW,6BAA6B,IAAI;CAClD,IAAI,UAAU,OAAO;CACrB,MAAM,kBAAkB,+BAA+B,IAAI,aAAa;CACxE,OAAO,WAAW,IAAI,KAAK,8EAA8E,IAAI,SAAS,YAAY,EAAE,WAAW,IAAI,YAAY,yCAAyC,gBAAgB;AACzN;AACA,MAAM,mCAAmC;CACxC,OAAO;CACP,SAAS;AACV;AACA,MAAM,gCAAgC;CACrC,aAAa;EACZ;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;CACD;CACA,aAAa;EACZ;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa,iCAAiC;EAC/C;EACA;GACC,MAAM;GACN,aAAa,iCAAiC;EAC/C;CACD;CACA,cAAc;EACb;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;CACD;CACA,cAAc;EACb;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;CACD;AACD;AACA,SAAS,qBAAqB,KAAK;CAClC,OAAO;EACN,GAAG;EACH,wBAAwB,4BAA4B,GAAG;EACvD,aAAa,8BAA8B,IAAI,OAAO,CAAC;CACxD;AACD;;;;;;AAMA,MAAM,iBAAiB,iBAAiB,IAAI,oBAAoB;AAChE,MAAM,eAAe;CACpB;CACA;CACA;CACA;AACD;AACA,MAAM,eAAe;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;;AAMA,MAAM,iBAAiB;CACtB;EACC,IAAI;EACJ,OAAO;EACP,SAAS;EACT,OAAO;EACP,OAAO;EACP,WAAW;EACX,QAAQ;EACR,gBAAgB;EAChB,WAAW;EACX,YAAY;EACZ,iBAAiB;EACjB,WAAW;EACX,eAAe;EACf,aAAa;EACb,WAAW;CACZ;CACA;EACC,IAAI;EACJ,OAAO;EACP,SAAS;EACT,OAAO;EACP,OAAO;EACP,WAAW;EACX,aAAa;EACb,WAAW;EACX,QAAQ;EACR,gBAAgB;EAChB,WAAW;EACX,YAAY;EACZ,iBAAiB;EACjB,WAAW;EACX,eAAe;EACf,aAAa;EACb,WAAW;CACZ;CACA;EACC,IAAI;EACJ,OA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OAAO;GACP,QAAQ;GACR,WAAW;GACX,KAAK;EACN;EACA,gBAAgB;GACf;GACA;GACA;EACD;EACA,cAAc;GACb,UAAU;GACV,QAAQ;EACT;EACA,iBAAiB;EACjB,0BAA0B;EAC1B,SAAS;CACV;CACA;EACC,KAAK;EACL,MAAM;EACN,WAAW;EACX,gBAAgB;EAChB,aAAa;EACb,SAAS;EACT,UAAU;EACV,kBAAkB,CAAC;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,UAAU;GACV,MAAM;GACN,UAAU;EACX,GAAG;GACF,KAAK;GACL,OAAO;GACP,aAAa;GACb,MAAM;GACN,UAAU;GACV,QAAQ;EACT,CAAC;EACD,cAAc;GACb,UAAU;GACV,WAAW;GACX,OAAO;GACP,QAAQ;GACR,WAAW;GACX,KAAK;EACN;EACA,gBAAgB;GACf;GACA;GACA;EACD;EACA,cAAc;GACb,UAAU;GACV,QAAQ;EACT;EACA,iBAAiB;EACjB,0BAA0B;EAC1B,SAAS;CACV;CACA;EACC,KAAK;EACL,MAAM;EACN,WAAW;EACX,gBAAgB;EAChB,aAAa;EACb,SAAS;EACT,UAAU;EACV,kBAAkB;GACjB;IACC,KAAK;IACL,OAAO;IACP,aAAa;IACb,MAAM;IACN,UAAU;GACX;GACA;IACC,KAAK;IACL,OAAO;IACP,aAAa;IACb,MAAM;IACN,UAAU;GACX;GACA;IACC,KAAK;IACL,OAAO;IACP,aAAa;IACb,MAAM;IACN,UAAU;GACX;EACD;EACA,cAAc;GACb,UAAU;GACV,WAAW;GACX,OAAO;GACP,QAAQ;GACR,WAAW;GACX,KAAK;EACN;EACA,gBAAgB;GACf;GACA;GACA;EACD;EACA,cAAc;GACb,UAAU;GACV,QAAQ;EACT;EACA,iBAAiB;EACjB,0BAA0B;EAC1B,SAAS;CACV;CACA;EACC,KAAK;EACL,MAAM;EACN,WAAW;EACX,gBAAgB;EAChB,aAAa;EACb,SAAS;EACT,UAAU;EACV,kBAAkB,CAAC;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,UAAU;GACV,MAAM;GACN,UAAU;EACX,GAAG;GACF,KAAK;GACL,OAAO;GACP,aAAa;GACb,MAAM;GACN,UAAU;EACX,CAAC;EACD,cAAc;GACb,UAAU;GACV,WAAW;GACX,OAAO;GACP,QAAQ;GACR,WAAW;GACX,KAAK;EACN;EACA,gBAAgB;GACf;GACA;GACA;EACD;EACA,cAAc;GACb,UAAU;GACV,QAAQ;EACT;EACA,iBAAiB;EACjB,0BAA0B;EAC1B,SAAS;CACV;AACD;AACA,SAAS,mBAAmB,KAAK;CAChC,OAAO,kBAAkB,MAAM,aAAa,SAAS,QAAQ,GAAG;AACjE;AACA,MAAM,oBAAoB;CACzB,OAAO;EACN;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;GACb,YAAY;EACb;CACD;CACA,SAAS;EACR;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;CACD;CACA,UAAU,CAAC;CACX,mBAAmB;EAClB;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;CACD;CACA,eAAe;EACd;GACC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AAgB,MAAM,kBADV,gBACoC,CAAC;EACvD,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,EAAE,cAAc,GAAG,MAAM,CAAC,EAAE,GAAG;CACxE,CAAC;AACL;;;AChFA,SAAgB,gBAAyB;CACvC,MAAM,UAAU,IAAI,QAAQ,EACzB,KAAK,WAAW,EAChB,YAAY,2CAA2C,EACvD,QAAQ,eAAe,CAAC,EACxB,OAAO,kBAAkB,2DAA2D,EACpF,OAAO,WAAW,kCAAkC,EACpD,KAAK,cAAc,gBAAgB;EAClC,MAAM,OAAO,YAAY,KAA4C;EACrE,oBAAoB;GAClB,WAAW,KAAK;GAChB,OAAO,KAAK;EACd,CAAC;CACH,CAAC;CAEH,oBAAoB,OAAO;CAC3B,uBAAuB,OAAO;CAC9B,sBAAsB,OAAO;CAC7B,uBAAuB,OAAO;CAC9B,2BAA2B,OAAO;CAClC,sBAAsB,OAAO;CAC7B,oBAAoB,OAAO;CAC3B,qBAAqB,OAAO;CAC5B,sBAAsB,OAAO;CAC7B,mBAAmB,OAAO;CAC1B,qBAAqB,OAAO;CAC5B,qBAAqB,OAAO;CAC5B,wBAAwB,OAAO;CAC/B,uBAAuB,OAAO;CAC9B,OAAO;AACT;AAEA,SAAgB,OAAO,MAAsB;CAC3C,cAAc,EAAE,MAAM,IAAI;AAC5B;;;AClDA,OAAO,QAAQ,IAAI"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["isPlainObject","objectToString","#options","#runBeforeRequestHooks","#retry","#fetch","#consumeReturnedResponseFromBeforeRetryHook","#runAfterResponseHooks","#retryFromError","#getResponseRequest","#getNormalizedOptions","#getResponseData","#decorateResponse","#cancelResponseBody","#beforeRetryHookErrors","#retryCount","#originalRequest","#cancelBody","#normalizeSearchParams","#input","#userProvidedAbortSignal","#abortController","#createManagedSignal","#startTime","#getCurrentTime","#calculateRetryDelay","#calculateDelay","#readResponseText","#getErrorDataTimeout","#throwIfTotalTimeoutExhausted","#isJsonContentType","#parseJson","#getRemainingTotalTimeout","#assignRequest","#setResponseRequest","#returnedResponseFromBeforeRetryHook","#wrapRequestWithUploadProgress","#cachedNormalizedOptions","#responseRequests","core._coercedNumber","schemas.ZodNumber","z.string","z.discriminatedUnion","z.object","z.literal","z.record","z.unknown","z.array","z.enum","z.ZodType","z.custom","z.boolean","z.union","z.coerce.number","z.number","normalizeBaseUrl","applyActiveOrganizationHeader","applyAuthHeaders","kyCredentials","createAgentsResource","createCredentialsResource","createHealthResource","createWorkflowsResource","collectSetValues","#hiddenStack","now","getMethod","sleep"],"sources":["../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/KyError.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/HTTPError.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/NetworkError.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/NonError.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/ForceRetryError.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/SchemaValidationError.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/TimeoutError.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/core/constants.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/body.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/is.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/merge.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/normalize.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/timeout.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/delay.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/options.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/is-network-error.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/utils/type-guards.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/core/Ky.js","../../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/index.js","../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/coerce.js","../../../packages/shared/dist/index.mjs","../../../packages/sdk/dist/index.mjs","../src/auth/credentials.ts","../src/resolve-platform-url.ts","../src/config.ts","../src/auth/resolve-cli-auth.ts","../src/client.ts","../../../packages/sdk/dist/platform/index.mjs","../src/platform-client.ts","../src/organization/active-organization.ts","../src/dev-session.ts","../src/resolve-api-target.ts","../src/target-options.ts","../src/errors/example-input.ts","../src/errors/format-api-message.ts","../src/errors/format-cli-error.ts","../src/errors/run-command.ts","../src/errors/command-input.ts","../src/commands/agent/prompt.ts","../src/commands/agent/sessions.ts","../src/commands/agent/index.ts","../src/auth/open-url.ts","../src/commands/connect/run-connect.ts","../src/commands/connect/index.ts","../src/commands/credentials/target-options.ts","../src/commands/credentials/delete.ts","../src/commands/credentials/list.ts","../src/commands/credentials/format-set-conflict-error.ts","../src/project/env-ref.ts","../src/project/resolve-project-root.ts","../src/project/load-project-env.ts","../src/commands/credentials/parse-value.ts","../src/commands/credentials/set.ts","../src/commands/credentials/update.ts","../src/commands/credentials/index.ts","../../../packages/auth/dist/constants-BaNTvWUo.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/package.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/version.mjs","../../../node_modules/.pnpm/better-call@1.3.5_zod@4.4.3/node_modules/better-call/dist/error.mjs","../../../node_modules/.pnpm/@better-auth+core@1.6.11_@better-auth+utils@0.4.0_@better-fetch+fetch@1.1.21_better-cal_90e7d2cb715d3338ca39f1d23262e011/node_modules/@better-auth/core/dist/error/index.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/plugins/device-authorization/client.mjs","../../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/clean-stores/index.js","../../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/atom/index.js","../../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/lifecycle/index.js","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/query.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/broadcast-channel.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/focus-manager.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/online-manager.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/parser.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/session-refresh.mjs","../../../node_modules/.pnpm/@better-auth+core@1.6.11_@better-auth+utils@0.4.0_@better-fetch+fetch@1.1.21_better-cal_90e7d2cb715d3338ca39f1d23262e011/node_modules/@better-auth/core/dist/env/env-impl.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/utils/url.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/fetch-plugins.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/session-atom.mjs","../../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs","../../../node_modules/.pnpm/@better-fetch+fetch@1.1.21/node_modules/@better-fetch/fetch/dist/index.js","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/config.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/utils/is-atom.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/proxy.mjs","../../../node_modules/.pnpm/@better-auth+core@1.6.11_@better-auth+utils@0.4.0_@better-fetch+fetch@1.1.21_better-cal_90e7d2cb715d3338ca39f1d23262e011/node_modules/@better-auth/core/dist/utils/string.mjs","../../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/vanilla.mjs","../../../packages/auth/dist/cli.mjs","../src/auth/resolve-login-targets.ts","../src/commands/auth/login.ts","../src/commands/auth/logout.ts","../src/commands/auth/status.ts","../src/commands/auth/index.ts","../src/commands/build.ts","../../../packages/storage/dist/pack-artifact.mjs","../src/commands/deploy.ts","../src/project/runtime-child-env.ts","../src/project/bootstrap-run.ts","../src/process/run-processes.ts","../src/runtime/ensure-native-deps.ts","../src/runtime/resolve-runtime-node-modules.ts","../src/commands/dev.ts","../src/commands/health.ts","../src/init/project-name.ts","../src/init/prompts.ts","../src/init/copy-template.ts","../src/init/resolve-template-dir.ts","../src/init/project-files.ts","../src/init/resolve-skills-bundle-dir.ts","../src/init/scaffold-bundled-skills.ts","../src/init/scaffold-empty-src-dirs.ts","../src/init/scaffold-project-dotfiles.ts","../src/init/run-init.ts","../src/commands/init.ts","../src/commands/project/run-project.ts","../src/commands/project/index.ts","../src/commands/start.ts","../src/commands/trigger/list.ts","../src/commands/trigger/poll.ts","../src/commands/trigger/runs.ts","../src/commands/trigger/index.ts","../src/commands/workflow/run.ts","../src/commands/workflow/runs.ts","../src/commands/workflow/index.ts","../src/commands/config/use-project.ts","../src/commands/config/index.ts","../src/program.ts","../src/index.ts"],"sourcesContent":["/**\nBase class for all Ky-specific errors. `HTTPError`, `NetworkError`, `TimeoutError`, and `ForceRetryError` extend this class.\n\nYou can use `instanceof KyError` to check if an error originated from Ky, or use the `isKyError()` type guard for cross-realm compatibility and TypeScript type narrowing.\n\nNote: `SchemaValidationError` is intentionally not considered a Ky error. `KyError` covers failures in Ky's HTTP lifecycle (bad status, timeout, retry), while schema validation errors originate from the user-provided schema, not from Ky itself.\n*/\nexport class KyError extends Error {\n name = 'KyError';\n get isKyError() {\n return true;\n }\n}\n//# sourceMappingURL=KyError.js.map","import { KyError } from './KyError.js';\n/**\nError thrown when the response has a non-2xx status code and `throwHttpErrors` is enabled.\n\nThe error has a `response` property with the `Response` object, a `request` property with the `Request` object, an `options` property with the normalized options (either passed to `ky` when creating an instance with `ky.create()` or directly when performing the request), and a `data` property with the pre-parsed response body. For JSON responses (based on `Content-Type`), the body is parsed using the `parseJson` option if set, or `JSON.parse` by default. For other content types, it is set as plain text. If the body is empty or parsing fails, `data` will be `undefined`. To avoid hanging or excessive buffering, `error.data` population is bounded by the request timeout and a 10 MiB response body size limit. The `data` property is populated before `beforeError` hooks run, so hooks can access it.\n\nThe response body is automatically consumed when populating `error.data`, so `error.response.json()` and other body methods will not work. Use `error.data` instead. The `error.response` object is still available for headers, status, etc.\n\nBe aware that some types of errors, such as network errors, inherently mean that a response was not received. In that case, the error will be an instance of `NetworkError` instead of `HTTPError` and will not contain a `response` property.\n*/\nexport class HTTPError extends KyError {\n name = 'HTTPError';\n response;\n request;\n options;\n data;\n constructor(response, request, options) {\n const code = (response.status || response.status === 0) ? response.status : '';\n const title = response.statusText ?? '';\n const status = `${code} ${title}`.trim();\n const reason = status ? `status code ${status}` : 'an unknown error';\n super(`Request failed with ${reason}: ${request.method} ${request.url}`);\n this.response = response;\n this.request = request;\n this.options = options;\n }\n}\n//# sourceMappingURL=HTTPError.js.map","import { KyError } from './KyError.js';\n/**\nError thrown when a network error occurs during the request (e.g., DNS failure, connection refused, offline). It has a `request` property with the `Request` object. The original error is available via the standard `cause` property.\n\nNetwork errors are automatically retried (for retriable methods).\n\nNote: Network errors are detected using runtime-specific heuristics. Unrecognized runtimes may produce errors that are not wrapped in `NetworkError`. Use the `shouldRetry` option to handle such cases.\n*/\nexport class NetworkError extends KyError {\n name = 'NetworkError';\n request;\n constructor(request, options) {\n super(`Request failed due to a network error: ${request.method} ${request.url}`, options);\n this.request = request;\n }\n}\n//# sourceMappingURL=NetworkError.js.map","/**\nWrapper for non-Error values that were thrown.\n\nIn JavaScript, any value can be thrown (not just Error instances). This class wraps such values to ensure consistent error handling.\n*/\nexport class NonError extends Error {\n name = 'NonError';\n value;\n constructor(value) {\n let message = 'Non-error value was thrown';\n // Intentionally minimal as this error is just an edge-case.\n try {\n if (typeof value === 'string') {\n message = value;\n }\n else if (value && typeof value === 'object' && 'message' in value && typeof value.message === 'string') {\n message = value.message;\n }\n }\n catch {\n // Use default message if accessing properties throws\n }\n super(message);\n this.value = value;\n }\n}\n//# sourceMappingURL=NonError.js.map","import { KyError } from './KyError.js';\nimport { NonError } from './NonError.js';\n/**\nError used to signal a forced retry from `afterResponse` hooks.\n\nThis is thrown when `ky.retry()` is returned from an `afterResponse` hook. It is observable in `beforeRetry` and `beforeError` hooks via the `isForceRetryError()` type guard.\n*/\nexport class ForceRetryError extends KyError {\n name = 'ForceRetryError';\n customDelay;\n code;\n customRequest;\n constructor(options) {\n // Runtime protection: wrap non-Error causes in NonError\n // TypeScript type is Error for guidance, but JS users can pass anything\n const cause = options?.cause\n ? (options.cause instanceof Error ? options.cause : new NonError(options.cause))\n : undefined;\n super(options?.code ? `Forced retry: ${options.code}` : 'Forced retry', cause ? { cause } : undefined);\n this.customDelay = options?.delay;\n this.code = options?.code;\n this.customRequest = options?.request;\n }\n}\n//# sourceMappingURL=ForceRetryError.js.map","/**\nThe error thrown when [Standard Schema](https://github.com/standard-schema/standard-schema) validation fails in `.json(schema)`. It has an `issues` property with the validation issues from the schema.\n\nThis error intentionally does not extend `KyError` because it does not represent a failure in Ky's HTTP lifecycle. The request succeeded; the user's schema rejected the data. As such, it is not matched by `isKyError()`.\n\n@example\n```\nimport ky, {SchemaValidationError} from 'ky';\nimport {z} from 'zod';\n\nconst userSchema = z.object({name: z.string()});\n\ntry {\n const user = await ky('/api/user').json(userSchema);\n console.log(user.name);\n} catch (error) {\n if (error instanceof SchemaValidationError) {\n console.error(error.issues);\n }\n}\n```\n*/\nexport class SchemaValidationError extends Error {\n name = 'SchemaValidationError';\n issues;\n constructor(issues) {\n super('Response schema validation failed');\n this.issues = issues;\n }\n}\n//# sourceMappingURL=SchemaValidationError.js.map","import { KyError } from './KyError.js';\n/**\nError thrown when the request times out. It has a `request` property with the `Request` object.\n*/\nexport class TimeoutError extends KyError {\n name = 'TimeoutError';\n request;\n constructor(request) {\n super(`Request timed out: ${request.method} ${request.url}`);\n this.request = request;\n }\n}\n//# sourceMappingURL=TimeoutError.js.map","export const supportsRequestStreams = (() => {\n let duplexAccessed = false;\n let hasContentType = false;\n const supportsReadableStream = typeof globalThis.ReadableStream === 'function';\n const supportsRequest = typeof globalThis.Request === 'function';\n if (supportsReadableStream && supportsRequest) {\n try {\n hasContentType = new globalThis.Request('https://empty.invalid', {\n body: new globalThis.ReadableStream(),\n method: 'POST',\n // @ts-expect-error - Types are outdated.\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n }\n catch (error) {\n // QQBrowser on iOS throws \"unsupported BodyInit type\" error (see issue #581)\n if (error instanceof Error && error.message === 'unsupported BodyInit type') {\n return false;\n }\n throw error;\n }\n }\n return duplexAccessed && !hasContentType;\n})();\nexport const supportsAbortController = typeof globalThis.AbortController === 'function';\nexport const supportsAbortSignal = typeof globalThis.AbortSignal === 'function' && typeof globalThis.AbortSignal.any === 'function';\nexport const supportsResponseStreams = typeof globalThis.ReadableStream === 'function';\nexport const supportsFormData = typeof globalThis.FormData === 'function';\nexport const requestMethods = ['get', 'post', 'put', 'patch', 'head', 'delete'];\nconst validate = () => undefined;\nvalidate();\nexport const responseTypes = {\n json: 'application/json',\n text: 'text/*',\n formData: 'multipart/form-data',\n arrayBuffer: '*/*',\n blob: '*/*',\n // Supported in modern Fetch implementations (for example, browsers and recent Node.js/undici).\n // We still feature-check at runtime before exposing the shortcut.\n bytes: '*/*',\n};\n// The maximum value of a 32bit int (see issue #117)\nexport const maxSafeTimeout = 2_147_483_647;\n// Size in bytes of a typical form boundary (e.g., '------WebKitFormBoundaryaxpyiPgbbPti10Rw'), used to help estimate upload size\nexport const usualFormBoundarySize = 40;\n/**\nSymbol that can be returned by a `beforeRetry` hook to stop retrying without throwing an error.\n*/\nexport const stop = Symbol('stop');\n/**\nMarker returned by `ky.retry()` to signal a forced retry from `afterResponse` hooks.\n*/\nexport class RetryMarker {\n options;\n constructor(options) {\n this.options = options;\n }\n}\n/**\nForce a retry from an `afterResponse` hook.\n\nThis allows you to retry a request based on the response content, even if the response has a successful status code. The retry will respect the `retry.limit` option and skip the `shouldRetry` check. The forced retry is observable in `beforeRetry` hooks, where the error will be a `ForceRetryError`.\n\n@param options - Optional configuration for the retry.\n\n@example\n```\nimport ky, {isForceRetryError} from 'ky';\n\nconst api = ky.extend({\n hooks: {\n afterResponse: [\n async ({request, response}) => {\n // Retry based on response body content\n if (response.status === 200) {\n const data = await response.json();\n\n // Simple retry with default delay\n if (data.error?.code === 'TEMPORARY_ERROR') {\n return ky.retry();\n }\n\n // Retry with custom delay from API response\n if (data.error?.code === 'RATE_LIMIT') {\n return ky.retry({\n delay: data.error.retryAfter * 1000,\n code: 'RATE_LIMIT'\n });\n }\n\n // Retry with a modified request (e.g., fallback endpoint)\n if (data.error?.code === 'FALLBACK_TO_BACKUP') {\n return ky.retry({\n request: new Request('https://backup-api.com/endpoint', {\n method: request.method,\n headers: request.headers,\n }),\n code: 'BACKUP_ENDPOINT'\n });\n }\n\n // Retry with refreshed authentication\n if (data.error?.code === 'TOKEN_REFRESH' && data.newToken) {\n return ky.retry({\n request: new Request(request, {\n headers: {\n ...Object.fromEntries(request.headers),\n 'Authorization': `Bearer ${data.newToken}`\n }\n }),\n code: 'TOKEN_REFRESHED'\n });\n }\n\n // Retry with cause to preserve error chain\n try {\n validateResponse(data);\n } catch (error) {\n return ky.retry({\n code: 'VALIDATION_FAILED',\n cause: error\n });\n }\n }\n }\n ],\n beforeRetry: [\n ({error, retryCount}) => {\n // Observable in beforeRetry hooks\n if (isForceRetryError(error)) {\n console.log(`Forced retry #${retryCount}: ${error.message}`);\n // Example output: \"Forced retry #1: Forced retry: RATE_LIMIT\"\n }\n }\n ]\n }\n});\n\nconst response = await api.get('https://example.com/api');\n```\n*/\nexport const retry = (options) => new RetryMarker(options);\nexport const kyOptionKeys = {\n json: true,\n parseJson: true,\n stringifyJson: true,\n searchParams: true,\n baseUrl: true,\n prefix: true,\n retry: true,\n timeout: true,\n totalTimeout: true,\n hooks: true,\n throwHttpErrors: true,\n onDownloadProgress: true,\n onUploadProgress: true,\n fetch: true,\n context: true,\n};\n// Standard RequestInit options that should NOT be passed separately to fetch()\n// because they're already applied to the Request object.\n// Note: `dispatcher` and `priority` are NOT included here - they're fetch-only\n// options that the Request constructor doesn't accept, so they need to be passed\n// separately to fetch().\nexport const requestOptionsRegistry = {\n method: true,\n headers: true,\n body: true,\n mode: true,\n credentials: true,\n cache: true,\n redirect: true,\n referrer: true,\n referrerPolicy: true,\n integrity: true,\n keepalive: true,\n signal: true,\n window: true,\n duplex: true,\n};\n//# sourceMappingURL=constants.js.map","import { usualFormBoundarySize } from '../core/constants.js';\nconst encoder = new TextEncoder();\n// eslint-disable-next-line @typescript-eslint/no-restricted-types\nexport const getBodySize = (body) => {\n if (!body) {\n return 0;\n }\n if (body instanceof FormData) {\n // This is an approximation, as FormData size calculation is not straightforward\n let size = 0;\n for (const [key, value] of body) {\n size += usualFormBoundarySize;\n size += encoder.encode(`Content-Disposition: form-data; name=\"${key}\"`).byteLength;\n size += typeof value === 'string'\n ? encoder.encode(value).byteLength\n : value.size;\n }\n return size;\n }\n if (body instanceof Blob) {\n return body.size;\n }\n if (body instanceof ArrayBuffer || ArrayBuffer.isView(body)) {\n return body.byteLength;\n }\n if (typeof body === 'string') {\n return encoder.encode(body).byteLength;\n }\n if (body instanceof URLSearchParams) {\n return encoder.encode(body.toString()).byteLength;\n }\n return 0;\n};\nconst withProgress = (stream, totalBytes, onProgress) => {\n let previousChunk;\n let transferredBytes = 0;\n return stream.pipeThrough(new TransformStream({\n transform(currentChunk, controller) {\n controller.enqueue(currentChunk);\n if (previousChunk) {\n transferredBytes += previousChunk.byteLength;\n let percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;\n // Avoid reporting 100% progress before the stream is actually finished (in case totalBytes is inaccurate)\n if (percent >= 1) {\n // Epsilon is used here to get as close as possible to 100% without reaching it.\n // If we were to use 0.99 here, percent could potentially go backwards.\n percent = 1 - Number.EPSILON;\n }\n onProgress?.({ percent, totalBytes: Math.max(totalBytes, transferredBytes), transferredBytes }, previousChunk);\n }\n previousChunk = currentChunk;\n },\n flush() {\n if (previousChunk) {\n transferredBytes += previousChunk.byteLength;\n onProgress?.({ percent: 1, totalBytes: Math.max(totalBytes, transferredBytes), transferredBytes }, previousChunk);\n }\n },\n }));\n};\nexport const streamResponse = (response, onDownloadProgress) => {\n if (!response.body) {\n return response;\n }\n const responseInit = {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n };\n if (response.status === 204) {\n return new Response(null, responseInit);\n }\n const totalBytes = Math.max(0, Number(response.headers.get('content-length')) || 0);\n return new Response(withProgress(response.body, totalBytes, onDownloadProgress), responseInit);\n};\n// eslint-disable-next-line @typescript-eslint/no-restricted-types\nexport const streamRequest = (request, onUploadProgress, originalBody) => {\n if (!request.body) {\n return request;\n }\n // Use original body for size calculation since request.body is already a stream\n const totalBytes = getBodySize(originalBody ?? request.body);\n return new Request(request, {\n // @ts-expect-error - Types are outdated.\n duplex: 'half',\n body: withProgress(request.body, totalBytes, onUploadProgress),\n });\n};\n//# sourceMappingURL=body.js.map","// eslint-disable-next-line @typescript-eslint/no-restricted-types\nexport const isObject = (value) => value !== null && typeof value === 'object';\n//# sourceMappingURL=is.js.map","import { supportsAbortSignal } from '../core/constants.js';\nimport { isObject } from './is.js';\nconst replaceSymbol = Symbol('replaceOption');\nconst getReplaceState = (value) => isObject(value) && value[replaceSymbol] === true\n ? {\n isReplace: true,\n value: value.value,\n }\n : {\n isReplace: false,\n value,\n };\n/**\nWraps a value so that `ky.extend()` will replace the parent value instead of merging with it. Works with hooks, headers, search parameters, context, and any other deep-merged option.\n\nBy default, `.extend()` deep-merges options with the parent instance: hooks get appended, headers get merged, and search parameters get accumulated. Use `replaceOption` when you want to fully replace a merged property instead.\n\n@example\n```\nimport ky, {replaceOption} from 'ky';\n\nconst base = ky.create({\n hooks: {beforeRequest: [addAuth, addTracking]},\n});\n\n// Replaces instead of appending\nconst extended = base.extend({\n hooks: replaceOption({beforeRequest: [onlyThis]}),\n});\n// hooks.beforeRequest is now [onlyThis], not [addAuth, addTracking, onlyThis]\n```\n*/\nexport const replaceOption = (value) => {\n const markedValue = { [replaceSymbol]: true, value };\n return markedValue;\n};\nexport const validateAndMerge = (...sources) => {\n for (const source of sources) {\n if ((!isObject(source) || Array.isArray(source)) && source !== undefined) {\n throw new TypeError('The `options` argument must be an object');\n }\n }\n return deepMerge({}, ...sources);\n};\nexport const mergeHeaders = (source1 = {}, source2 = {}) => {\n const result = new globalThis.Headers(source1);\n const isHeadersInstance = source2 instanceof globalThis.Headers;\n const source = new globalThis.Headers(source2);\n for (const [key, value] of source.entries()) {\n if ((isHeadersInstance && value === 'undefined') || value === undefined) {\n result.delete(key);\n }\n else {\n result.set(key, value);\n }\n }\n return result;\n};\nconst isPlainObject = (value) => {\n if (!isObject(value) || Array.isArray(value)) {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n};\nexport const cloneShallow = (value) => {\n if (value instanceof URLSearchParams) {\n const copy = new URLSearchParams(value);\n const deleted = value[deletedParametersSymbol];\n if (deleted) {\n // Preserve internal deletion markers so init-hook cloning does not resurrect params removed during option merging.\n copy[deletedParametersSymbol] = new Set(deleted);\n }\n return copy;\n }\n if (value instanceof globalThis.Headers) {\n return new globalThis.Headers(value);\n }\n if (Array.isArray(value)) {\n return [...value];\n }\n if (isPlainObject(value)) {\n const copy = { ...value };\n return copy;\n }\n return value;\n};\nconst normalizeHeaderObject = (headers) => Object.fromEntries(Object.entries(headers).filter((entry) => entry[1] !== undefined));\nconst mergeHeaderContainers = (source1, source2) => {\n if (isPlainObject(source1) && isPlainObject(source2)) {\n return normalizeHeaderObject({ ...source1, ...source2 });\n }\n return mergeHeaders(source1, source2);\n};\nfunction newHookValue(original, incoming, property) {\n return (Object.hasOwn(incoming, property) && incoming[property] === undefined)\n ? []\n : deepMerge(original[property] ?? [], incoming[property] ?? []);\n}\nexport const mergeHooks = (original = {}, incoming = {}) => ({\n init: newHookValue(original, incoming, 'init'),\n beforeRequest: newHookValue(original, incoming, 'beforeRequest'),\n beforeRetry: newHookValue(original, incoming, 'beforeRetry'),\n beforeError: newHookValue(original, incoming, 'beforeError'),\n afterResponse: newHookValue(original, incoming, 'afterResponse'),\n});\nexport const deletedParametersSymbol = Symbol('deletedParameters');\nconst appendSearchParameters = (target, source) => {\n const result = new URLSearchParams();\n const deleted = new Set();\n for (const input of [target, source]) {\n if (input === undefined) {\n continue;\n }\n if (input instanceof URLSearchParams) {\n for (const [key, value] of input.entries()) {\n result.append(key, value);\n deleted.delete(key);\n }\n const inputDeleted = input[deletedParametersSymbol];\n if (inputDeleted) {\n for (const key of inputDeleted) {\n result.delete(key);\n deleted.add(key);\n }\n }\n }\n else if (Array.isArray(input)) {\n for (const pair of input) {\n if (!Array.isArray(pair) || pair.length !== 2) {\n throw new TypeError('Array search parameters must be provided in [[key, value], ...] format');\n }\n result.append(String(pair[0]), String(pair[1]));\n deleted.delete(String(pair[0]));\n }\n }\n else if (isObject(input)) {\n for (const [key, value] of Object.entries(input)) {\n if (value === undefined) {\n result.delete(key);\n deleted.add(key);\n }\n else {\n result.append(key, String(value));\n deleted.delete(key);\n }\n }\n }\n else {\n // String\n const parameters = new URLSearchParams(input);\n for (const [key, value] of parameters.entries()) {\n result.append(key, value);\n deleted.delete(key);\n }\n }\n }\n if (deleted.size > 0) {\n result[deletedParametersSymbol] = deleted;\n }\n return result;\n};\n// TODO: Make this strongly-typed (no `any`).\nexport const deepMerge = (...sources) => {\n let returnValue = {};\n let headers = {};\n let hooks = {};\n let searchParameters;\n const signals = [];\n for (const source of sources) {\n if (Array.isArray(source)) {\n if (!Array.isArray(returnValue)) {\n returnValue = [];\n }\n returnValue = [...returnValue, ...source];\n }\n else if (isObject(source)) {\n for (let [key, value] of Object.entries(source)) {\n // Special handling for AbortSignal instances\n if (key === 'signal' && value instanceof globalThis.AbortSignal) {\n signals.push(value);\n continue;\n }\n const replaceState = getReplaceState(value);\n const { isReplace } = replaceState;\n value = replaceState.value;\n // Special handling for context - shallow merge only\n if (key === 'context') {\n if (value !== undefined && value !== null && (!isObject(value) || Array.isArray(value))) {\n throw new TypeError('The `context` option must be an object');\n }\n // Shallow merge: always create a new object to prevent mutation bugs\n returnValue = {\n ...returnValue,\n context: (value === undefined || value === null)\n ? {}\n : (isReplace\n ? { ...value }\n : { ...returnValue.context, ...value }),\n };\n continue;\n }\n // Special handling for searchParams\n if (key === 'searchParams') {\n if (value === undefined || value === null) {\n // Explicit undefined or null removes searchParams\n searchParameters = undefined;\n }\n else if (isReplace) {\n searchParameters = value;\n }\n else {\n // First source: keep as-is to preserve type (string/object/URLSearchParams)\n // Subsequent sources: merge and convert to URLSearchParams\n searchParameters = searchParameters === undefined ? value : appendSearchParameters(searchParameters, value);\n }\n continue;\n }\n if (isObject(value) && !isReplace && key in returnValue) {\n value = deepMerge(returnValue[key], value);\n }\n returnValue = { ...returnValue, [key]: value };\n }\n if (isObject(source.hooks)) {\n const { value: hookValue, isReplace } = getReplaceState(source.hooks);\n hooks = isReplace\n ? mergeHooks({}, hookValue)\n : mergeHooks(hooks, hookValue);\n returnValue.hooks = hooks;\n }\n if (isObject(source.headers)) {\n const { value: headerValue, isReplace } = getReplaceState(source.headers);\n headers = isReplace\n ? cloneShallow(headerValue)\n : mergeHeaderContainers(headers, headerValue);\n returnValue.headers = headers;\n }\n }\n }\n if (searchParameters !== undefined) {\n returnValue.searchParams = searchParameters;\n }\n if (signals.length > 0) {\n if (signals.length === 1) {\n returnValue.signal = signals[0];\n }\n else if (supportsAbortSignal) {\n returnValue.signal = AbortSignal.any(signals);\n }\n else {\n // When AbortSignal.any is not available, use the last signal\n // This maintains the previous behavior before signal merging was added\n // This can be remove when the `supportsAbortSignal` check is removed.`\n returnValue.signal = signals.at(-1);\n }\n }\n return returnValue;\n};\n//# sourceMappingURL=merge.js.map","import { requestMethods } from '../core/constants.js';\nexport const normalizeRequestMethod = (input) => requestMethods.includes(input) ? input.toUpperCase() : input;\nconst retryMethods = ['get', 'put', 'head', 'delete', 'options', 'trace'];\nconst retryStatusCodes = [408, 413, 429, 500, 502, 503, 504];\nconst retryAfterStatusCodes = [413, 429, 503];\nconst defaultRetryOptions = {\n limit: 2,\n methods: retryMethods,\n statusCodes: retryStatusCodes,\n afterStatusCodes: retryAfterStatusCodes,\n maxRetryAfter: Number.POSITIVE_INFINITY,\n backoffLimit: Number.POSITIVE_INFINITY,\n delay: attemptCount => 0.3 * (2 ** (attemptCount - 1)) * 1000,\n jitter: undefined,\n retryOnTimeout: false,\n};\nexport const normalizeRetryOptions = (retry = {}) => {\n if (typeof retry === 'number') {\n return {\n ...defaultRetryOptions,\n limit: retry,\n };\n }\n if (retry.methods && !Array.isArray(retry.methods)) {\n throw new Error('retry.methods must be an array');\n }\n if (retry.statusCodes && !Array.isArray(retry.statusCodes)) {\n throw new Error('retry.statusCodes must be an array');\n }\n const normalizedRetry = Object.fromEntries(Object.entries({\n ...retry,\n methods: retry.methods?.map(method => method.toLowerCase()),\n }).filter(([, value]) => value !== undefined));\n return {\n ...defaultRetryOptions,\n ...normalizedRetry,\n };\n};\n//# sourceMappingURL=normalize.js.map","import { TimeoutError } from '../errors/TimeoutError.js';\n// `Promise.race()` workaround (#91)\nexport default async function timeout(request, init, abortController, options) {\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n if (abortController) {\n abortController.abort();\n }\n reject(new TimeoutError(request));\n }, options.timeout);\n void options\n .fetch(request, init)\n .then(resolve)\n .catch(reject)\n .then(() => {\n clearTimeout(timeoutId);\n });\n });\n}\n//# sourceMappingURL=timeout.js.map","// https://github.com/sindresorhus/delay/tree/ab98ae8dfcb38e1593286c94d934e70d14a4e111\nexport default async function delay(ms, { signal }) {\n return new Promise((resolve, reject) => {\n if (signal) {\n signal.throwIfAborted();\n signal.addEventListener('abort', abortHandler, { once: true });\n }\n function abortHandler() {\n clearTimeout(timeoutId);\n reject(signal.reason);\n }\n const timeoutId = setTimeout(() => {\n signal?.removeEventListener('abort', abortHandler);\n resolve();\n }, ms);\n });\n}\n//# sourceMappingURL=delay.js.map","import { kyOptionKeys, requestOptionsRegistry } from '../core/constants.js';\nimport { deletedParametersSymbol } from './merge.js';\nexport const findUnknownOptions = (options) => {\n const unknownOptions = {};\n for (const key in options) {\n // Skip inherited properties\n if (!Object.hasOwn(options, key)) {\n continue;\n }\n // Forward every non-standard, non-Ky option to fetch().\n // We intentionally do not check whether the key also exists on `Request`, because some runtimes\n // patch `Request.prototype` with fetch-only extensions. For example, Next.js adds `next`, and the\n // old `key in request` heuristic dropped it unless Ky kept a special-case allowlist.\n // Passing all non-standard keys makes that allowlist unnecessary and preserves future fetch extensions too.\n if (!(key in requestOptionsRegistry) && !(key in kyOptionKeys)) {\n unknownOptions[key] = options[key];\n }\n }\n return unknownOptions;\n};\nexport const hasSearchParameters = (search) => {\n if (search === undefined) {\n return false;\n }\n // The `typeof array` still gives \"object\", so we need different checking for array.\n if (Array.isArray(search)) {\n return search.length > 0;\n }\n if (search instanceof URLSearchParams) {\n return search.size > 0 || Boolean(search[deletedParametersSymbol]?.size);\n }\n // Record\n if (typeof search === 'object') {\n return Object.keys(search).length > 0;\n }\n if (typeof search === 'string') {\n return search.trim().length > 0;\n }\n return Boolean(search);\n};\n//# sourceMappingURL=options.js.map","// Inlined from https://github.com/sindresorhus/is-network-error v1.3.1\nconst objectToString = Object.prototype.toString;\nconst isError = (value) => objectToString.call(value) === '[object Error]';\nconst errorMessages = new Set([\n 'network error', // Chrome\n 'NetworkError when attempting to fetch resource.', // Firefox\n 'The Internet connection appears to be offline.', // Safari 16\n 'Network request failed', // `cross-fetch`\n 'fetch failed', // Undici (Node.js)\n 'terminated', // Undici (Node.js)\n ' A network error occurred.', // Bun (WebKit) - leading space is intentional\n 'Network connection lost', // Cloudflare Workers (fetch)\n]);\nexport default function isRawNetworkError(error) {\n const isValid = error\n && isError(error)\n && error.name === 'TypeError'\n && typeof error.message === 'string';\n if (!isValid) {\n return false;\n }\n const { message, stack } = error;\n // Safari 17+ has generic message but no stack for network errors\n if (message === 'Load failed') {\n return stack === undefined\n // Sentry adds its own stack trace to the fetch error, so also check for that\n || '__sentry_captured__' in error;\n }\n // Deno network errors start with specific text\n if (message.startsWith('error sending request for url')) {\n return true;\n }\n // Chrome: exact \"Failed to fetch\" or with hostname: \"Failed to fetch (example.com)\"\n if (message === 'Failed to fetch' || (message.startsWith('Failed to fetch (') && message.endsWith(')'))) {\n return true;\n }\n // Standard network error messages\n return errorMessages.has(message);\n}\n//# sourceMappingURL=is-network-error.js.map","import { HTTPError } from '../errors/HTTPError.js';\nimport { NetworkError } from '../errors/NetworkError.js';\nimport { TimeoutError } from '../errors/TimeoutError.js';\nimport { ForceRetryError } from '../errors/ForceRetryError.js';\n// Handles cross-realm cases (e.g., iframes, different JS contexts) where `instanceof` fails.\nconst isErrorType = (error, cls) => error instanceof cls || error?.name === cls.name;\n/**\nType guard to check if an error is a `KyError`.\n\nNote: `SchemaValidationError` is intentionally not considered a Ky error. `KyError` covers failures in Ky's HTTP lifecycle (bad status, timeout, retry), while schema validation errors originate from the user-provided schema, not from Ky itself.\n\n@param error - The error to check\n@returns `true` if the error is a Ky error, `false` otherwise\n\n@example\n```\nimport ky, {isKyError} from 'ky';\ntry {\n const response = await ky.get('/api/data');\n} catch (error) {\n if (isKyError(error)) {\n // Handle Ky-specific errors\n console.log('Ky error occurred:', error.message);\n } else {\n // Handle other errors\n console.log('Unknown error:', error);\n }\n}\n```\n*/\nexport function isKyError(error) {\n return error?.isKyError === true || isHTTPError(error) || isNetworkError(error) || isTimeoutError(error) || isForceRetryError(error);\n}\n/**\nType guard to check if an error is an `HTTPError`.\n\n@param error - The error to check\n@returns `true` if the error is an `HTTPError`, `false` otherwise\n\n@example\n```\nimport ky, {isHTTPError} from 'ky';\ntry {\n const response = await ky.get('/api/data');\n} catch (error) {\n if (isHTTPError(error)) {\n console.log('HTTP error status:', error.response.status);\n }\n}\n```\n*/\nexport function isHTTPError(error) {\n return isErrorType(error, HTTPError);\n}\n/**\nType guard to check if an error is a `NetworkError`.\n\n@param error - The error to check\n@returns `true` if the error is a `NetworkError`, `false` otherwise\n\n@example\n```\nimport ky, {isNetworkError} from 'ky';\ntry {\n const response = await ky.get('/api/data');\n} catch (error) {\n if (isNetworkError(error)) {\n console.log('Network error:', error.request.url);\n }\n}\n```\n*/\nexport function isNetworkError(error) {\n return isErrorType(error, NetworkError);\n}\n/**\nType guard to check if an error is a `TimeoutError`.\n\n@param error - The error to check\n@returns `true` if the error is a `TimeoutError`, `false` otherwise\n\n@example\n```\nimport ky, {isTimeoutError} from 'ky';\ntry {\n const response = await ky.get('/api/data', { timeout: 1000 });\n} catch (error) {\n if (isTimeoutError(error)) {\n console.log('Request timed out:', error.request.url);\n }\n}\n```\n*/\nexport function isTimeoutError(error) {\n return isErrorType(error, TimeoutError);\n}\n/**\nType guard to check if an error is a `ForceRetryError`.\n\n@param error - The error to check\n@returns `true` if the error is a `ForceRetryError`, `false` otherwise\n\n@example\n```\nimport ky, {isForceRetryError} from 'ky';\n\nconst api = ky.extend({\n hooks: {\n beforeRetry: [\n ({error, retryCount}) => {\n if (isForceRetryError(error)) {\n console.log(`Forced retry #${retryCount}: ${error.code}`);\n }\n }\n ]\n }\n});\n```\n*/\nexport function isForceRetryError(error) {\n return isErrorType(error, ForceRetryError);\n}\n//# sourceMappingURL=type-guards.js.map","import { HTTPError } from '../errors/HTTPError.js';\nimport { NetworkError } from '../errors/NetworkError.js';\nimport { NonError } from '../errors/NonError.js';\nimport { ForceRetryError } from '../errors/ForceRetryError.js';\nimport { SchemaValidationError } from '../errors/SchemaValidationError.js';\nimport { TimeoutError } from '../errors/TimeoutError.js';\nimport { streamRequest, streamResponse } from '../utils/body.js';\nimport { cloneShallow, mergeHeaders, mergeHooks, deletedParametersSymbol, } from '../utils/merge.js';\nimport { normalizeRequestMethod, normalizeRetryOptions } from '../utils/normalize.js';\nimport timeout from '../utils/timeout.js';\nimport delay from '../utils/delay.js';\nimport { findUnknownOptions, hasSearchParameters } from '../utils/options.js';\nimport isRawNetworkError from '../utils/is-network-error.js';\nimport { isHTTPError, isNetworkError, isTimeoutError } from '../utils/type-guards.js';\nimport { maxSafeTimeout, responseTypes, stop, RetryMarker, supportsAbortController, supportsAbortSignal, supportsFormData, supportsResponseStreams, supportsRequestStreams, } from './constants.js';\nconst maxErrorResponseBodySize = 10 * 1024 * 1024;\nconst prefixUrlRenamedErrorMessage = 'The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl';\nconst timedOutResponseData = Symbol('timedOutResponseData');\nconst createTextDecoder = (contentType) => {\n const match = /;\\s*charset\\s*=\\s*(?:\"([^\"]+)\"|([^;,\\s]+))/i.exec(contentType);\n const charset = match?.[1] ?? match?.[2];\n if (charset) {\n try {\n return new TextDecoder(charset);\n }\n catch { }\n }\n return new TextDecoder();\n};\nconst invalidSchemaMessage = 'The `schema` argument must follow the Standard Schema specification';\nconst cloneRetryOptions = (retry) => {\n if (typeof retry !== 'object') {\n return retry;\n }\n // Clone nested arrays too so init hooks can mutate retry config without leaking state across requests.\n return {\n ...retry,\n ...(retry.methods && { methods: [...retry.methods] }),\n ...(retry.statusCodes && { statusCodes: [...retry.statusCodes] }),\n ...(retry.afterStatusCodes && { afterStatusCodes: [...retry.afterStatusCodes] }),\n };\n};\nconst objectToString = Object.prototype.toString;\nconst isRequestInstance = (value) => value instanceof globalThis.Request || objectToString.call(value) === '[object Request]';\n// Accepted custom responses are treated as full Responses throughout Ky.\n// If a custom fetch returns one, it must behave like a Response for cloning,\n// body consumption, `json()` decoration, and any enabled stream features.\nconst isResponseInstance = (value) => value instanceof globalThis.Response || objectToString.call(value) === '[object Response]';\nconst cloneSearchParametersForInitHook = (searchParameters) => {\n if (Array.isArray(searchParameters)) {\n return searchParameters.map(parameter => [...parameter]);\n }\n return cloneShallow(searchParameters);\n};\n// Shallow-clone mutable option properties so init hook mutations don't leak across requests.\nfunction cloneInitHookOptions(options) {\n const clonedOptions = {\n ...options,\n json: cloneShallow(options.json),\n context: cloneShallow(options.context),\n headers: cloneShallow(options.headers),\n searchParams: cloneSearchParametersForInitHook(options.searchParams),\n };\n if (options.retry !== undefined) {\n clonedOptions.retry = cloneRetryOptions(options.retry);\n }\n return clonedOptions;\n}\nconst validateJsonWithSchema = async (jsonValue, schema) => {\n if ((typeof schema !== 'object'\n && typeof schema !== 'function')\n || schema === null) {\n throw new TypeError(invalidSchemaMessage);\n }\n const standardSchema = schema['~standard'];\n if (typeof standardSchema !== 'object'\n || standardSchema === null\n || typeof standardSchema.validate !== 'function') {\n throw new TypeError(invalidSchemaMessage);\n }\n const validationResult = await standardSchema.validate(jsonValue);\n if (validationResult.issues) {\n throw new SchemaValidationError(validationResult.issues);\n }\n return validationResult.value;\n};\nexport class Ky {\n static create(input, options) {\n const initHooks = options.hooks?.init ?? [];\n const initHookOptions = initHooks.length > 0 ? cloneInitHookOptions(options) : options;\n for (const hook of initHooks) {\n hook(initHookOptions);\n }\n const ky = new Ky(input, initHookOptions);\n const function_ = async () => {\n if (typeof ky.#options.timeout === 'number' && ky.#options.timeout > maxSafeTimeout) {\n throw new RangeError(`The \\`timeout\\` option cannot be greater than ${maxSafeTimeout}`);\n }\n if (typeof ky.#options.totalTimeout === 'number' && ky.#options.totalTimeout > maxSafeTimeout) {\n throw new RangeError(`The \\`totalTimeout\\` option cannot be greater than ${maxSafeTimeout}`);\n }\n // Delay the fetch so that body method shortcuts can set the Accept header\n await Promise.resolve();\n const beforeRequestResponse = await ky.#runBeforeRequestHooks();\n let response = beforeRequestResponse ?? await ky.#retry(async () => ky.#fetch());\n let responseFromHook = beforeRequestResponse !== undefined\n || ky.#consumeReturnedResponseFromBeforeRetryHook();\n for (;;) {\n // `undefined` means a hook stopped the flow without providing a response.\n // Non-native Responses still continue through Ky if they pass `isResponseInstance()`.\n if (response === undefined) {\n return response;\n }\n if (isResponseInstance(response)) {\n try {\n // eslint-disable-next-line no-await-in-loop\n response = await ky.#runAfterResponseHooks(response);\n }\n catch (error) {\n if (!(error instanceof ForceRetryError)) {\n throw error;\n }\n // eslint-disable-next-line no-await-in-loop\n const retriedResponse = await ky.#retryFromError(error, async () => ky.#fetch());\n if (retriedResponse === undefined) {\n return retriedResponse;\n }\n response = retriedResponse;\n responseFromHook = ky.#consumeReturnedResponseFromBeforeRetryHook();\n continue;\n }\n }\n const currentResponse = response;\n // Opaque responses (`response.type === 'opaque'`) from `no-cors` requests always have `status: 0` and `ok: false`, but this is not a failure - the actual status is hidden by the browser.\n if (!currentResponse.ok && currentResponse.type !== 'opaque' && (typeof ky.#options.throwHttpErrors === 'function'\n ? ky.#options.throwHttpErrors(currentResponse.status)\n : ky.#options.throwHttpErrors)) {\n // `request` must reflect the request that actually failed, but `options` stays as Ky's\n // normalized options snapshot. Replacement `Request` instances do not preserve the\n // original `BodyInit`, so trying to make `options` mirror arbitrary requests would be lossy.\n const httpError = new HTTPError(currentResponse, ky.#getResponseRequest(currentResponse), ky.#getNormalizedOptions());\n const errorToThrow = httpError;\n // eslint-disable-next-line no-await-in-loop\n httpError.data = await ky.#getResponseData(currentResponse);\n if (responseFromHook) {\n throw errorToThrow;\n }\n // eslint-disable-next-line no-await-in-loop\n const retriedResponse = await ky.#retryFromError(httpError, async () => ky.#fetch());\n if (retriedResponse === undefined) {\n return retriedResponse;\n }\n response = retriedResponse;\n responseFromHook = ky.#consumeReturnedResponseFromBeforeRetryHook();\n continue;\n }\n break;\n }\n if (!isResponseInstance(response)) {\n return response;\n }\n ky.#decorateResponse(response);\n // If `onDownloadProgress` is passed, it uses the stream API internally\n if (ky.#options.onDownloadProgress) {\n if (typeof ky.#options.onDownloadProgress !== 'function') {\n throw new TypeError('The `onDownloadProgress` option must be a function');\n }\n if (!supportsResponseStreams) {\n throw new Error('Streams are not supported in your environment. `ReadableStream` is missing.');\n }\n const progressResponse = response.clone();\n ky.#cancelResponseBody(response);\n return streamResponse(progressResponse, ky.#options.onDownloadProgress);\n }\n return response;\n };\n const result = (async () => {\n try {\n return await function_();\n }\n catch (error) {\n // Non-Error throws (e.g., thrown strings) pass through unchanged\n if (!(error instanceof Error)) {\n throw error;\n }\n // Errors thrown by beforeRetry hooks must propagate unchanged.\n if (ky.#beforeRetryHookErrors.has(error)) {\n throw error;\n }\n let processedError = error;\n for (const hook of ky.#options.hooks.beforeError) {\n // `request` is the current failing request. `options` intentionally remains the\n // stable normalized Ky options snapshot for the same reason as `HTTPError` above.\n // eslint-disable-next-line no-await-in-loop\n const hookResult = await hook({\n request: ky.request,\n options: ky.#getNormalizedOptions(),\n error: processedError,\n retryCount: ky.#retryCount,\n });\n // Only overwrite if the hook returns a valid Error instance.\n if (hookResult instanceof Error) {\n processedError = hookResult;\n }\n }\n throw processedError;\n }\n finally {\n const originalRequest = ky.#originalRequest;\n // Ignore cancellation errors from already-locked or already-consumed streams.\n ky.#cancelBody(originalRequest?.body ?? undefined);\n // Only cancel the current request body if it's distinct from the original (i.e. it was cloned for retries).\n if (ky.request !== originalRequest) {\n ky.#cancelBody(ky.request.body ?? undefined);\n }\n }\n })();\n for (const [type, mimeType] of Object.entries(responseTypes)) {\n // Only expose `.bytes()` when the environment implements it.\n if (type === 'bytes'\n && typeof globalThis.Response?.prototype?.bytes !== 'function') {\n continue;\n }\n result[type] = async (schema) => {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n ky.request.headers.set('accept', ky.request.headers.get('accept') || mimeType);\n const response = await result;\n if (type !== 'json') {\n return response[type]();\n }\n const text = await response.text();\n if (text === '') {\n if (schema !== undefined) {\n return validateJsonWithSchema(undefined, schema);\n }\n return JSON.parse(text);\n }\n const jsonValue = initHookOptions.parseJson\n ? await initHookOptions.parseJson(text, { request: ky.#getResponseRequest(response), response })\n : JSON.parse(text);\n return schema === undefined ? jsonValue : validateJsonWithSchema(jsonValue, schema);\n };\n }\n return result;\n }\n // eslint-disable-next-line unicorn/prevent-abbreviations\n static #normalizeSearchParams(searchParams) {\n // Filter out undefined values from plain objects\n if (searchParams && typeof searchParams === 'object' && !Array.isArray(searchParams) && !(searchParams instanceof URLSearchParams)) {\n return Object.fromEntries(Object.entries(searchParams).filter(([, value]) => value !== undefined));\n }\n return searchParams;\n }\n request;\n #abortController;\n #retryCount = 0;\n // eslint-disable-next-line @typescript-eslint/prefer-readonly -- False positive: #input is reassigned on line 202\n #input;\n #options;\n #originalRequest;\n #userProvidedAbortSignal;\n #beforeRetryHookErrors = new WeakSet();\n #cachedNormalizedOptions;\n #startTime;\n #returnedResponseFromBeforeRetryHook = false;\n #responseRequests = new WeakMap();\n // eslint-disable-next-line complexity\n constructor(input, options = {}) {\n this.#input = input;\n if (Object.hasOwn(options, 'prefixUrl')) {\n throw new Error(prefixUrlRenamedErrorMessage);\n }\n this.#options = {\n ...options,\n headers: mergeHeaders(this.#input.headers, options.headers),\n hooks: mergeHooks({}, options.hooks),\n method: normalizeRequestMethod(options.method ?? this.#input.method ?? 'GET'),\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n prefix: String(options.prefix || ''),\n retry: normalizeRetryOptions(options.retry),\n throwHttpErrors: options.throwHttpErrors ?? true,\n timeout: options.timeout ?? 10_000,\n totalTimeout: options.totalTimeout ?? false,\n fetch: options.fetch ?? globalThis.fetch.bind(globalThis),\n context: options.context ?? {},\n };\n if (typeof this.#input !== 'string' && !(this.#input instanceof URL || this.#input instanceof globalThis.Request)) {\n throw new TypeError('`input` must be a string, URL, or Request');\n }\n if (typeof this.#input === 'string') {\n if (this.#options.prefix) {\n const normalizedPrefix = this.#options.prefix.replace(/\\/+$/, '');\n const normalizedInput = this.#input.replace(/^\\/+/, '');\n this.#input = `${normalizedPrefix}/${normalizedInput}`;\n }\n if (this.#options.baseUrl) {\n let absoluteInput;\n try {\n absoluteInput = new URL(this.#input);\n }\n catch { }\n if (!absoluteInput) {\n this.#input = new URL(this.#input, (new Request(this.#options.baseUrl)).url);\n }\n }\n }\n if (supportsAbortController && supportsAbortSignal) {\n this.#userProvidedAbortSignal = this.#options.signal ?? this.#input.signal;\n this.#abortController = new globalThis.AbortController();\n this.#options.signal = this.#createManagedSignal();\n }\n if (supportsRequestStreams) {\n // @ts-expect-error - Types are outdated.\n this.#options.duplex = 'half';\n }\n if (this.#options.json !== undefined) {\n this.#options.body = this.#options.stringifyJson?.(this.#options.json) ?? JSON.stringify(this.#options.json);\n this.#options.headers.set('content-type', this.#options.headers.get('content-type') ?? 'application/json');\n }\n // To provide correct form boundary, Content-Type header should be deleted when creating Request from another Request with FormData/URLSearchParams body\n // Only delete if user didn't explicitly provide a custom content-type\n const userProvidedContentType = options.headers && new globalThis.Headers(options.headers).has('content-type');\n if (this.#input instanceof globalThis.Request\n && ((supportsFormData && this.#options.body instanceof globalThis.FormData) || this.#options.body instanceof URLSearchParams)\n && !userProvidedContentType) {\n this.#options.headers.delete('content-type');\n }\n this.request = new globalThis.Request(this.#input, this.#options);\n if (hasSearchParameters(this.#options.searchParams)) {\n const url = new URL(this.request.url);\n const deleted = this.#options.searchParams?.[deletedParametersSymbol];\n if (deleted) {\n // Remove keys from the input URL first so later searchParams entries can intentionally re-add them.\n for (const key of deleted) {\n url.searchParams.delete(key);\n }\n }\n if (typeof this.#options.searchParams === 'string') {\n const stringSearchParameters = this.#options.searchParams.replace(/^\\?/, '');\n if (stringSearchParameters !== '') {\n url.search = url.search ? `${url.search}&${stringSearchParameters}` : `?${stringSearchParameters}`;\n }\n }\n else {\n const optionsSearchParameters = new URLSearchParams(Ky.#normalizeSearchParams(this.#options.searchParams));\n for (const [key, value] of optionsSearchParameters.entries()) {\n url.searchParams.append(key, value);\n }\n }\n if (this.#options.searchParams\n && typeof this.#options.searchParams === 'object'\n && !Array.isArray(this.#options.searchParams)\n && !(this.#options.searchParams instanceof URLSearchParams)) {\n for (const [key, value] of Object.entries(this.#options.searchParams)) {\n if (value === undefined) {\n url.searchParams.delete(key);\n }\n }\n }\n // Recreate request with the updated URL. We already have all options in this.#options, including duplex.\n this.request = new globalThis.Request(url, this.#options);\n }\n if (this.#options.onUploadProgress && typeof this.#options.onUploadProgress !== 'function') {\n throw new TypeError('The `onUploadProgress` option must be a function');\n }\n // `totalTimeout` starts when the request pipeline is created, so it also includes\n // Ky's internal scheduling and user hook time before the first fetch attempt.\n this.#startTime = typeof this.#options.totalTimeout === 'number' ? this.#getCurrentTime() : undefined;\n }\n #calculateDelay() {\n const retryDelay = this.#options.retry.delay(this.#retryCount + 1);\n let jitteredDelay = retryDelay;\n if (this.#options.retry.jitter === true) {\n jitteredDelay = Math.random() * retryDelay;\n }\n else if (typeof this.#options.retry.jitter === 'function') {\n jitteredDelay = this.#options.retry.jitter(retryDelay);\n if (!Number.isFinite(jitteredDelay) || jitteredDelay < 0) {\n jitteredDelay = retryDelay;\n }\n }\n return Math.min(this.#options.retry.backoffLimit, jitteredDelay);\n }\n async #calculateRetryDelay(error) {\n if (this.#retryCount >= this.#options.retry.limit) {\n throw error;\n }\n // Wrap non-Error throws to ensure consistent error handling\n const errorObject = error instanceof Error ? error : new NonError(error);\n // Handle forced retry from afterResponse hook - skip method check and shouldRetry\n if (errorObject instanceof ForceRetryError) {\n return errorObject.customDelay ?? this.#calculateDelay();\n }\n // Check if method is retriable for non-forced retries\n if (!this.#options.retry.methods.includes(this.request.method.toLowerCase())) {\n throw error;\n }\n // User-provided shouldRetry function takes precedence over default checks (retryOnTimeout, status codes, etc.)\n if (this.#options.retry.shouldRetry !== undefined) {\n const result = await this.#options.retry.shouldRetry({ error: errorObject, retryCount: this.#retryCount + 1 });\n // Strict boolean checking - only exact true/false are handled specially\n if (result === false) {\n throw error;\n }\n if (result === true) {\n // Force retry - skip all other validation and return delay\n return this.#calculateDelay();\n }\n // If undefined or any other value, fall through to default behavior\n }\n // Default timeout behavior\n if (isTimeoutError(error)) {\n if (!this.#options.retry.retryOnTimeout) {\n throw error;\n }\n return this.#calculateDelay();\n }\n if (isHTTPError(error)) {\n if (!this.#options.retry.statusCodes.includes(error.response.status)) {\n throw error;\n }\n const retryAfter = error.response.headers.get('Retry-After')\n ?? error.response.headers.get('RateLimit-Reset')\n ?? error.response.headers.get('X-RateLimit-Retry-After') // Symfony-based services\n ?? error.response.headers.get('X-RateLimit-Reset') // GitHub\n ?? error.response.headers.get('X-Rate-Limit-Reset'); // Twitter\n if (retryAfter && this.#options.retry.afterStatusCodes.includes(error.response.status)) {\n let after = Number(retryAfter) * 1000;\n if (Number.isNaN(after)) {\n after = Date.parse(retryAfter) - Date.now();\n }\n else if (after >= Date.parse('2024-01-01')) {\n // A large number is treated as a timestamp (fixed threshold protects against clock skew)\n after -= Date.now();\n }\n if (!Number.isFinite(after)) {\n return Math.min(this.#options.retry.maxRetryAfter, this.#calculateDelay());\n }\n after = Math.max(0, after);\n // Don't apply jitter when server provides explicit retry timing\n return Math.min(this.#options.retry.maxRetryAfter, after);\n }\n if (error.response.status === 413) {\n throw error;\n }\n return this.#calculateDelay();\n }\n // Only retry known retriable error types. Unknown errors (e.g., programming bugs) are not retried.\n if (!isNetworkError(error)) {\n throw error;\n }\n return this.#calculateDelay();\n }\n #decorateResponse(response) {\n const request = this.#getResponseRequest(response);\n if (this.#options.parseJson) {\n response.json = async () => {\n const text = await response.text();\n if (text === '') {\n return JSON.parse(text);\n }\n return this.#options.parseJson(text, { request, response });\n };\n }\n return response;\n }\n async #getResponseData(response) {\n // Even with request timeouts disabled, bound error-body reads so retries and error propagation\n // cannot be stalled indefinitely by never-ending response streams.\n const text = await this.#readResponseText(response, this.#getErrorDataTimeout());\n if (text === timedOutResponseData) {\n this.#throwIfTotalTimeoutExhausted();\n return undefined;\n }\n if (!text) {\n return undefined;\n }\n if (!this.#isJsonContentType(response.headers.get('content-type') ?? '')) {\n return text;\n }\n const data = await this.#parseJson(text, response, this.#getErrorDataTimeout(), this.#getResponseRequest(response));\n if (data === timedOutResponseData) {\n this.#throwIfTotalTimeoutExhausted();\n return undefined;\n }\n return data;\n }\n #getErrorDataTimeout() {\n const errorDataTimeout = this.#options.timeout === false ? 10_000 : this.#options.timeout;\n const remainingTotal = this.#getRemainingTotalTimeout();\n if (remainingTotal === undefined) {\n return errorDataTimeout;\n }\n if (remainingTotal <= 0) {\n throw new TimeoutError(this.request);\n }\n return Math.min(errorDataTimeout, remainingTotal);\n }\n #isJsonContentType(contentType) {\n // Match JSON subtypes like `json`, `problem+json`, and `vnd.api+json`.\n const mimeType = (contentType.split(';', 1)[0] ?? '').trim().toLowerCase();\n return /\\/(?:.*[.+-])?json$/.test(mimeType);\n }\n async #readResponseText(response, timeoutMs) {\n const { body } = response;\n if (!body) {\n try {\n return await response.text();\n }\n catch {\n return undefined;\n }\n }\n let reader;\n try {\n reader = body.getReader();\n }\n catch {\n // Another consumer already locked the stream.\n return undefined;\n }\n const decoder = createTextDecoder(response.headers.get('content-type') ?? '');\n const chunks = [];\n let totalBytes = 0;\n const readAll = (async () => {\n try {\n for (;;) {\n // eslint-disable-next-line no-await-in-loop\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n totalBytes += value.byteLength;\n if (totalBytes > maxErrorResponseBodySize) {\n void reader.cancel().catch(() => undefined);\n return undefined;\n }\n chunks.push(decoder.decode(value, { stream: true }));\n }\n }\n catch {\n return undefined;\n }\n chunks.push(decoder.decode());\n return chunks.join('');\n })();\n const timeoutPromise = new Promise(resolve => {\n const timeoutId = setTimeout(() => {\n resolve(timedOutResponseData);\n }, timeoutMs);\n void readAll.finally(() => {\n clearTimeout(timeoutId);\n });\n });\n const result = await Promise.race([readAll, timeoutPromise]);\n if (result === timedOutResponseData) {\n void reader.cancel().catch(() => undefined);\n }\n return result;\n }\n async #parseJson(text, response, timeoutMs, request) {\n let timeoutId;\n try {\n return await Promise.race([\n Promise.resolve().then(() => this.#options.parseJson\n ? this.#options.parseJson(text, { request, response })\n : JSON.parse(text)),\n new Promise(resolve => {\n timeoutId = setTimeout(() => {\n resolve(timedOutResponseData);\n }, timeoutMs);\n }),\n ]);\n }\n catch {\n return undefined;\n }\n finally {\n clearTimeout(timeoutId);\n }\n }\n #cancelBody(body) {\n if (!body) {\n return;\n }\n // Ignore cancellation failures from already-locked or already-consumed streams.\n void body.cancel().catch(() => undefined);\n }\n #cancelResponseBody(response) {\n // Ignore cancellation failures from already-locked or already-consumed streams.\n this.#cancelBody(response.body ?? undefined);\n }\n #createManagedSignal() {\n return this.#userProvidedAbortSignal\n ? AbortSignal.any([this.#userProvidedAbortSignal, this.#abortController.signal])\n : this.#abortController.signal;\n }\n #throwIfTotalTimeoutExhausted() {\n const remaining = this.#getRemainingTotalTimeout();\n if (remaining !== undefined && remaining <= 0) {\n throw new TimeoutError(this.request);\n }\n }\n async #runBeforeRequestHooks() {\n for (const hook of this.#options.hooks.beforeRequest) {\n // eslint-disable-next-line no-await-in-loop\n const result = await hook({\n request: this.request,\n options: this.#getNormalizedOptions(),\n retryCount: 0,\n });\n if (isRequestInstance(result)) {\n this.#assignRequest(result);\n }\n else if (isResponseInstance(result)) {\n return result;\n }\n }\n return undefined;\n }\n async #runAfterResponseHooks(response) {\n const responseRequest = this.#getResponseRequest(response);\n for (const hook of this.#options.hooks.afterResponse) {\n const hookResponse = this.#setResponseRequest(response.clone(), responseRequest);\n this.#decorateResponse(hookResponse);\n let modifiedResponse;\n try {\n // eslint-disable-next-line no-await-in-loop\n modifiedResponse = await hook({\n request: this.request,\n options: this.#getNormalizedOptions(),\n response: hookResponse,\n retryCount: this.#retryCount,\n });\n }\n catch (error) {\n // Cancel both responses to prevent memory leaks when hook throws\n if (hookResponse !== response) {\n this.#cancelResponseBody(hookResponse);\n }\n this.#cancelResponseBody(response);\n throw error;\n }\n if (modifiedResponse instanceof RetryMarker) {\n // Cancel both the cloned response passed to the hook and the current response to prevent resource leaks (especially important in Deno/Bun).\n // Do not await cancellation since hooks can clone the response, leaving extra tee branches that keep cancel promises pending per the Streams spec.\n if (hookResponse !== response) {\n this.#cancelResponseBody(hookResponse);\n }\n this.#cancelResponseBody(response);\n throw new ForceRetryError(modifiedResponse.options);\n }\n const nextResponse = isResponseInstance(modifiedResponse)\n ? this.#setResponseRequest(modifiedResponse, responseRequest)\n : response;\n // Cancel any response bodies we won't use to prevent memory leaks.\n // Uses fire-and-forget since hooks may have cloned the response, creating tee branches that block cancellation.\n // If the hook wrapped an existing body into a new Response, both Response objects can still point at the same stream.\n if (hookResponse !== response && hookResponse !== nextResponse && hookResponse.body !== nextResponse.body) {\n this.#cancelResponseBody(hookResponse);\n }\n if (response !== nextResponse && response.body !== nextResponse.body) {\n this.#cancelResponseBody(response);\n }\n response = nextResponse;\n }\n return response;\n }\n async #retry(function_) {\n try {\n return await function_();\n }\n catch (error) {\n return this.#retryFromError(error, function_);\n }\n }\n async #retryFromError(error, function_) {\n this.#returnedResponseFromBeforeRetryHook = false;\n const retryDelay = Math.min(await this.#calculateRetryDelay(error), maxSafeTimeout);\n const delayOptions = { signal: this.#userProvidedAbortSignal };\n const remainingTimeout = this.#getRemainingTotalTimeout();\n if (remainingTimeout !== undefined) {\n if (remainingTimeout <= 0) {\n throw new TimeoutError(this.request);\n }\n // If waiting would consume all remaining budget, time out without starting another request.\n if (retryDelay >= remainingTimeout) {\n await delay(remainingTimeout, delayOptions);\n throw new TimeoutError(this.request);\n }\n }\n // Only use user-provided signal for delay, not our internal abortController\n await delay(retryDelay, delayOptions);\n this.#throwIfTotalTimeoutExhausted();\n // Apply custom request from forced retry before beforeRetry hooks\n // Ensure the custom request has the correct managed signal for timeouts and user aborts\n if (error instanceof ForceRetryError && error.customRequest) {\n const customRequest = new globalThis.Request(error.customRequest, this.#options.signal ? { signal: this.#options.signal } : undefined);\n // Replacement Requests are authoritative by design. Do not rewrite headers here,\n // even for cross-origin retries. Callers using `ky.retry({request})` explicitly\n // opted into the exact Request they constructed.\n this.#assignRequest(customRequest);\n }\n for (const hook of this.#options.hooks.beforeRetry) {\n let hookResult;\n try {\n // eslint-disable-next-line no-await-in-loop\n hookResult = await hook({\n request: this.request,\n options: this.#getNormalizedOptions(),\n error: error,\n retryCount: this.#retryCount + 1,\n });\n }\n catch (hookError) {\n // Preserve the original request error path (`throw error`) so beforeError hooks can still run.\n if (hookError instanceof Error && hookError !== error) {\n this.#beforeRetryHookErrors.add(hookError);\n }\n throw hookError;\n }\n if (isRequestInstance(hookResult)) {\n // Same contract as `ky.retry({request})`: a Request returned from `beforeRetry`\n // is used as-is rather than being sanitized or otherwise rewritten by Ky.\n this.#assignRequest(hookResult);\n break;\n }\n if (isResponseInstance(hookResult)) {\n this.#returnedResponseFromBeforeRetryHook = true;\n this.#retryCount++;\n return hookResult;\n }\n // If `stop` is returned from the hook, the retry process is stopped\n if (hookResult === stop) {\n return;\n }\n }\n this.#throwIfTotalTimeoutExhausted();\n this.#retryCount++;\n return this.#retry(function_);\n }\n #consumeReturnedResponseFromBeforeRetryHook() {\n const value = this.#returnedResponseFromBeforeRetryHook;\n this.#returnedResponseFromBeforeRetryHook = false;\n return value;\n }\n async #fetch() {\n // Reset abortController if it was aborted (happens on timeout retry)\n if (this.#abortController?.signal.aborted) {\n this.#abortController = new globalThis.AbortController();\n this.#options.signal = this.#createManagedSignal();\n // Recreate request with new signal\n this.request = new globalThis.Request(this.request, { signal: this.#options.signal });\n }\n const nonRequestOptions = findUnknownOptions(this.#options);\n const retryRequest = this.#options.retry.limit > 0 ? this.request.clone() : undefined;\n const request = this.#wrapRequestWithUploadProgress(this.request, this.#options.body ?? undefined);\n // Cloning is done here to prepare in advance for retries.\n // Skip cloning when retries are disabled - cloning a streaming body calls ReadableStream#tee()\n // which buffers the entire stream in memory, causing excessive memory usage for large uploads.\n this.#originalRequest = request;\n if (retryRequest) {\n this.request = retryRequest;\n }\n try {\n const remainingTotal = this.#getRemainingTotalTimeout();\n if (remainingTotal !== undefined && remainingTotal <= 0) {\n throw new TimeoutError(this.request);\n }\n const effectiveTimeout = this.#options.timeout === false\n ? remainingTotal\n : (remainingTotal === undefined\n ? this.#options.timeout\n : Math.min(this.#options.timeout, remainingTotal));\n const response = effectiveTimeout === undefined\n ? await this.#options.fetch(request, nonRequestOptions)\n : await timeout(request, nonRequestOptions, this.#abortController, {\n timeout: effectiveTimeout,\n fetch: this.#options.fetch,\n });\n return this.#setResponseRequest(response, request);\n }\n catch (error) {\n if (isRawNetworkError(error)) {\n throw new NetworkError(this.request, { cause: error });\n }\n throw error;\n }\n }\n #getRemainingTotalTimeout() {\n if (this.#startTime === undefined) {\n return undefined;\n }\n const elapsed = this.#getCurrentTime() - this.#startTime;\n return Math.max(0, this.#options.totalTimeout - elapsed);\n }\n #getCurrentTime() {\n return globalThis.performance?.now() ?? Date.now();\n }\n #getNormalizedOptions() {\n if (!this.#cachedNormalizedOptions) {\n // Exclude Ky-specific options that are not part of `RequestInit`.\n const { hooks, json, parseJson, stringifyJson, searchParams, timeout, totalTimeout, throwHttpErrors, fetch, ...normalizedOptions } = this.#options;\n this.#cachedNormalizedOptions = Object.freeze(normalizedOptions);\n }\n return this.#cachedNormalizedOptions;\n }\n #assignRequest(request) {\n this.#cachedNormalizedOptions = undefined;\n this.request = request;\n }\n #getResponseRequest(response) {\n return this.#responseRequests.get(response) ?? this.request;\n }\n #setResponseRequest(response, request) {\n this.#responseRequests.set(response, request);\n return response;\n }\n #wrapRequestWithUploadProgress(request, originalBody) {\n if (!this.#options.onUploadProgress || !request.body || !supportsRequestStreams) {\n return request;\n }\n return streamRequest(request, this.#options.onUploadProgress, originalBody ?? this.#options.body ?? undefined);\n }\n}\n//# sourceMappingURL=Ky.js.map","/*! MIT License © Sindre Sorhus */\nimport { Ky } from './core/Ky.js';\nimport { requestMethods, stop, retry } from './core/constants.js';\nimport { validateAndMerge } from './utils/merge.js';\nconst createInstance = (defaults) => {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n const ky = (input, options) => Ky.create(input, validateAndMerge(defaults, options));\n for (const method of requestMethods) {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n ky[method] = (input, options) => Ky.create(input, validateAndMerge(defaults, options, { method }));\n }\n ky.create = (newDefaults) => createInstance(validateAndMerge(newDefaults));\n ky.extend = (newDefaults) => {\n if (typeof newDefaults === 'function') {\n newDefaults = newDefaults(defaults ?? {});\n }\n return createInstance(validateAndMerge(defaults, newDefaults));\n };\n ky.stop = stop;\n ky.retry = retry;\n return ky;\n};\nconst ky = createInstance();\nexport default ky;\nexport { KyError } from './errors/KyError.js';\nexport { HTTPError } from './errors/HTTPError.js';\nexport { SchemaValidationError } from './errors/SchemaValidationError.js';\nexport { NetworkError } from './errors/NetworkError.js';\nexport { TimeoutError } from './errors/TimeoutError.js';\nexport { ForceRetryError } from './errors/ForceRetryError.js';\nexport { isKyError, isHTTPError, isNetworkError, isTimeoutError, isForceRetryError, } from './utils/type-guards.js';\nexport { replaceOption } from './utils/merge.js';\n// Intentionally not exporting this for now as it's just an implementation detail and we don't want to commit to a certain API yet at least.\n// export {NonError} from './errors/NonError.js';\n//# sourceMappingURL=index.js.map","import * as core from \"../core/index.js\";\nimport * as schemas from \"./schemas.js\";\nexport function string(params) {\n return core._coercedString(schemas.ZodString, params);\n}\nexport function number(params) {\n return core._coercedNumber(schemas.ZodNumber, params);\n}\nexport function boolean(params) {\n return core._coercedBoolean(schemas.ZodBoolean, params);\n}\nexport function bigint(params) {\n return core._coercedBigint(schemas.ZodBigInt, params);\n}\nexport function date(params) {\n return core._coercedDate(schemas.ZodDate, params);\n}\n","import { z } from \"zod\";\n//#region src/constants/conventions.ts\n/** File-layout rules shared by agents, workflows, triggers, and OpenAPI `x-keystroke`. */\nconst DISCOVERY_CONVENTIONS = {\n\tagents: {\n\t\tflat: \"{name}.ts → POST /agents/{name}\",\n\t\tnested: \"{path}/agent.ts or {path}/index.ts → POST /agents/{path}\",\n\t\thelpers: \"Other .ts files under nested folders are not mounted.\"\n\t},\n\tworkflows: {\n\t\tflat: \"{name}.ts → POST /workflows/{name}\",\n\t\tnested: \"{path}/workflow.ts or {path}/index.ts → POST /workflows/{path}\",\n\t\thelpers: \"Other .ts files under nested folders are not mounted.\"\n\t},\n\ttriggers: {\n\t\tflat: \"{name}.ts → trigger key {name}, attachment id {triggerKey}:{workflowKey}\",\n\t\tnested: \"{path}/trigger.ts or {path}/index.ts → trigger key {path}\",\n\t\thelpers: \"Reusable sources live under triggers/sources/ and are not discovered.\"\n\t},\n\topenapi: \"GET /openapi.json is built from the same discovery + mount loop as the live server.\"\n};\n//#endregion\n//#region src/constants/http.ts\nconst ACTIVE_ORG_COOKIE = \"keystroke-active-org-id\";\nconst ACTIVE_ORG_HEADER = \"x-keystroke-org-id\";\n//#endregion\n//#region src/organization-slug.ts\n/** Auth, session, and account-entry URL segments. */\nconst AUTH_ACCOUNT_SLUGS = [\n\t\"2fa\",\n\t\"accept-invite\",\n\t\"auth\",\n\t\"authorize\",\n\t\"callback\",\n\t\"callbacks\",\n\t\"confirm-email\",\n\t\"confirmation\",\n\t\"connect\",\n\t\"device\",\n\t\"email-verification\",\n\t\"forgot-password\",\n\t\"invite\",\n\t\"invites\",\n\t\"login\",\n\t\"logout\",\n\t\"magic-link\",\n\t\"mfa\",\n\t\"oauth\",\n\t\"onboarding\",\n\t\"password\",\n\t\"recovery\",\n\t\"register\",\n\t\"reset-password\",\n\t\"saml\",\n\t\"session\",\n\t\"sessions\",\n\t\"sign-in\",\n\t\"sign-up\",\n\t\"signin\",\n\t\"signout\",\n\t\"signup\",\n\t\"sso\",\n\t\"token\",\n\t\"tokens\",\n\t\"unlink\",\n\t\"verify\",\n\t\"verify-email\"\n];\n/** Org, workspace, billing, and account-management URL segments. */\nconst ORG_ACCOUNT_SLUGS = [\n\t\"account\",\n\t\"accounts\",\n\t\"billing\",\n\t\"console\",\n\t\"invoice\",\n\t\"invoices\",\n\t\"member\",\n\t\"members\",\n\t\"me\",\n\t\"org\",\n\t\"organization\",\n\t\"organizations\",\n\t\"orgs\",\n\t\"payment\",\n\t\"payments\",\n\t\"plan\",\n\t\"plans\",\n\t\"portal\",\n\t\"preferences\",\n\t\"profile\",\n\t\"settings\",\n\t\"subscription\",\n\t\"subscriptions\",\n\t\"team\",\n\t\"teams\",\n\t\"upgrade\",\n\t\"usage\",\n\t\"user\",\n\t\"users\",\n\t\"workspace\",\n\t\"workspaces\"\n];\n/** Product surfaces, resource types, and in-app navigation segments. */\nconst PRODUCT_SLUGS = [\n\t\"action\",\n\t\"actions\",\n\t\"activity\",\n\t\"agent\",\n\t\"agents\",\n\t\"analytics\",\n\t\"app\",\n\t\"apps\",\n\t\"artifact\",\n\t\"artifacts\",\n\t\"assistant\",\n\t\"assistants\",\n\t\"audit\",\n\t\"audit-log\",\n\t\"automation\",\n\t\"automations\",\n\t\"branch\",\n\t\"branches\",\n\t\"canvas\",\n\t\"chat\",\n\t\"chats\",\n\t\"connection\",\n\t\"connections\",\n\t\"create\",\n\t\"credential\",\n\t\"credentials\",\n\t\"dashboard\",\n\t\"deployment\",\n\t\"deployments\",\n\t\"examples\",\n\t\"execute\",\n\t\"execution\",\n\t\"executions\",\n\t\"explore\",\n\t\"get-started\",\n\t\"history\",\n\t\"inbox\",\n\t\"inspector\",\n\t\"integration\",\n\t\"integrations\",\n\t\"library\",\n\t\"logs\",\n\t\"marketplace\",\n\t\"mcp\",\n\t\"mcps\",\n\t\"new\",\n\t\"notifications\",\n\t\"observe\",\n\t\"plugin\",\n\t\"plugins\",\n\t\"primitive\",\n\t\"primitives\",\n\t\"project\",\n\t\"projects\",\n\t\"recents\",\n\t\"registry\",\n\t\"reports\",\n\t\"run\",\n\t\"runs\",\n\t\"runtime\",\n\t\"runtimes\",\n\t\"sandbox\",\n\t\"sandboxes\",\n\t\"search\",\n\t\"skill\",\n\t\"skills\",\n\t\"templates\",\n\t\"thread\",\n\t\"threads\",\n\t\"trigger\",\n\t\"triggers\",\n\t\"version\",\n\t\"versions\",\n\t\"workflow\",\n\t\"workflows\"\n];\n/** Marketing, docs, company, and go-to-market URL segments. */\nconst MARKETING_SITE_SLUGS = [\n\t\"about\",\n\t\"affiliates\",\n\t\"ai\",\n\t\"announcements\",\n\t\"anthropic\",\n\t\"blog\",\n\t\"book-demo\",\n\t\"brand\",\n\t\"campaigns\",\n\t\"career\",\n\t\"careers\",\n\t\"case-studies\",\n\t\"casestudies\",\n\t\"changelog\",\n\t\"chatgpt\",\n\t\"chrome-extension\",\n\t\"claude\",\n\t\"codex\",\n\t\"community\",\n\t\"company\",\n\t\"compare\",\n\t\"contact\",\n\t\"contribute\",\n\t\"creators\",\n\t\"customers\",\n\t\"demo\",\n\t\"demos\",\n\t\"discord\",\n\t\"docs\",\n\t\"documentation\",\n\t\"download\",\n\t\"downloads\",\n\t\"dust\",\n\t\"emerging-talent\",\n\t\"engineering-blog\",\n\t\"enterprise\",\n\t\"events\",\n\t\"experts\",\n\t\"extension\",\n\t\"faq\",\n\t\"faqs\",\n\t\"features\",\n\t\"forum\",\n\t\"glean\",\n\t\"grok\",\n\t\"guide\",\n\t\"guides\",\n\t\"gumloop\",\n\t\"handbook\",\n\t\"help\",\n\t\"help-center\",\n\t\"home\",\n\t\"how-it-works\",\n\t\"howitworks\",\n\t\"inspo\",\n\t\"intern\",\n\t\"investors\",\n\t\"jobs\",\n\t\"legal\",\n\t\"lindy\",\n\t\"llm\",\n\t\"llms\",\n\t\"love\",\n\t\"make\",\n\t\"manifesto\",\n\t\"media\",\n\t\"merch\",\n\t\"mission\",\n\t\"mobile\",\n\t\"models\",\n\t\"n8n\",\n\t\"news\",\n\t\"newsroom\",\n\t\"open\",\n\t\"open-claw\",\n\t\"open-source\",\n\t\"openai\",\n\t\"our-story\",\n\t\"overview\",\n\t\"partners\",\n\t\"pi\",\n\t\"pipedream\",\n\t\"platform\",\n\t\"press\",\n\t\"press-kit\",\n\t\"pricing\",\n\t\"privacy\",\n\t\"product\",\n\t\"products\",\n\t\"provider\",\n\t\"providers\",\n\t\"quick-start\",\n\t\"quickstart\",\n\t\"refer\",\n\t\"relay\",\n\t\"relay-app\",\n\t\"reporting\",\n\t\"request-demo\",\n\t\"resources\",\n\t\"roadmap\",\n\t\"schedule-demo\",\n\t\"security\",\n\t\"solutions\",\n\t\"stack-ai\",\n\t\"stackai\",\n\t\"startup\",\n\t\"startups\",\n\t\"status\",\n\t\"stories\",\n\t\"story\",\n\t\"students\",\n\t\"support\",\n\t\"swag\",\n\t\"switch\",\n\t\"talent\",\n\t\"terms\",\n\t\"testimonials\",\n\t\"thesis\",\n\t\"tines\",\n\t\"trust\",\n\t\"tutorials\",\n\t\"university\",\n\t\"use-case\",\n\t\"use-cases\",\n\t\"usecases\",\n\t\"versus\",\n\t\"vellum\",\n\t\"vs\",\n\t\"webinars\",\n\t\"workato\",\n\t\"xai\",\n\t\"yc\",\n\t\"zapier\"\n];\n/** Integrations, competitors, and partner brand slugs (marketing / integration pages). */\nconst INTEGRATION_BRAND_SLUGS = [\n\t\"airtable\",\n\t\"asana\",\n\t\"aws\",\n\t\"azure\",\n\t\"bun\",\n\t\"confluence\",\n\t\"copilot\",\n\t\"cursor\",\n\t\"databricks\",\n\t\"figma\",\n\t\"firebase\",\n\t\"fly\",\n\t\"gcp\",\n\t\"gemini\",\n\t\"github\",\n\t\"gitlab\",\n\t\"gmail\",\n\t\"heroku\",\n\t\"hubspot\",\n\t\"huggingface\",\n\t\"jira\",\n\t\"linear\",\n\t\"mailchimp\",\n\t\"meta\",\n\t\"mistral\",\n\t\"mixmax\",\n\t\"monday\",\n\t\"netlify\",\n\t\"neon\",\n\t\"notion\",\n\t\"npm\",\n\t\"outlook\",\n\t\"outreach\",\n\t\"perplexity\",\n\t\"planetscale\",\n\t\"pnpm\",\n\t\"postmark\",\n\t\"ramp\",\n\t\"railway\",\n\t\"render\",\n\t\"resend\",\n\t\"salesforce\",\n\t\"segment\",\n\t\"sendgrid\",\n\t\"shopify\",\n\t\"slack\",\n\t\"snowflake\",\n\t\"stripe\",\n\t\"supabase\",\n\t\"terraform\",\n\t\"trello\",\n\t\"turso\",\n\t\"twilio\",\n\t\"typeform\",\n\t\"vercel\",\n\t\"vscode\",\n\t\"windsurf\",\n\t\"yarn\"\n];\n/** Company, team, and department landing-page segments. */\nconst COMPANY_TEAM_SLUGS = [\n\t\"engineers\",\n\t\"engineering\",\n\t\"executives\",\n\t\"hc\",\n\t\"intern\",\n\t\"it\",\n\t\"leadership\",\n\t\"marketing\",\n\t\"ops\",\n\t\"revops\",\n\t\"sales\",\n\t\"services\",\n\t\"tech\"\n];\n/** Legal, trust, compliance, and policy URL segments. */\nconst LEGAL_TRUST_SLUGS = [\n\t\"accessibility\",\n\t\"agreement\",\n\t\"a11y\",\n\t\"bug-bounty\",\n\t\"compliance\",\n\t\"cookie-policy\",\n\t\"cookies\",\n\t\"disclose\",\n\t\"dpa\",\n\t\"eula\",\n\t\"gdpr\",\n\t\"hipaa\",\n\t\"iso\",\n\t\"msa\",\n\t\"pci\",\n\t\"responsible-disclosure\",\n\t\"sla\",\n\t\"soc2\",\n\t\"tos\",\n\t\"trust-center\",\n\t\"trustcenter\",\n\t\"vulnerability\"\n];\n/** Developer, API, CLI, and technical URL segments. */\nconst DEVELOPER_TECH_SLUGS = [\n\t\"api\",\n\t\"api-docs\",\n\t\"cli\",\n\t\"code\",\n\t\"config\",\n\t\"developer\",\n\t\"developer-tools\",\n\t\"developers\",\n\t\"dev-tools\",\n\t\"devtools\",\n\t\"dev\",\n\t\"dev-states\",\n\t\"graphql\",\n\t\"graphql-playground\",\n\t\"mcp-server\",\n\t\"mcp-servers\",\n\t\"openapi\",\n\t\"sdk\",\n\t\"swagger\"\n];\n/** Infra, ops, static assets, and system URL segments. */\nconst INFRA_SYSTEM_SLUGS = [\n\t\"acme-challenge\",\n\t\"admin\",\n\t\"apple-app-site-association\",\n\t\"assets\",\n\t\"batch\",\n\t\"cache\",\n\t\"cdn\",\n\t\"cron\",\n\t\"debug\",\n\t\"error\",\n\t\"errors\",\n\t\"favicon\",\n\t\"feed\",\n\t\"files\",\n\t\"health\",\n\t\"healthcheck\",\n\t\"healthz\",\n\t\"hooks\",\n\t\"internal\",\n\t\"item\",\n\t\"manifest\",\n\t\"metrics\",\n\t\"null\",\n\t\"ping\",\n\t\"prod\",\n\t\"public\",\n\t\"redirect\",\n\t\"robots\",\n\t\"rpc\",\n\t\"rss\",\n\t\"sharer\",\n\t\"sitemap\",\n\t\"staging\",\n\t\"static\",\n\t\"storage\",\n\t\"test\",\n\t\"undefined\",\n\t\"universal\",\n\t\"webhooks\",\n\t\"well-known\",\n\t\"www\"\n];\n/** Reserved slugs that are valid org names in theory but blocked for routing safety. */\nconst ROUTING_SAFETY_SLUGS = [\n\t\"alpha\",\n\t\"anonymous\",\n\t\"archive\",\n\t\"archived\",\n\t\"beta\",\n\t\"clone\",\n\t\"copy\",\n\t\"default\",\n\t\"deleted\",\n\t\"demo-org\",\n\t\"draft\",\n\t\"drafts\",\n\t\"duplicate\",\n\t\"early-access\",\n\t\"embed\",\n\t\"embedded\",\n\t\"export\",\n\t\"fork\",\n\t\"free\",\n\t\"guest\",\n\t\"import\",\n\t\"index\",\n\t\"list\",\n\t\"manage\",\n\t\"moderator\",\n\t\"newsletter\",\n\t\"owner\",\n\t\"preview\",\n\t\"previews\",\n\t\"private\",\n\t\"pro\",\n\t\"public-api\",\n\t\"publish\",\n\t\"published\",\n\t\"queue\",\n\t\"remove\",\n\t\"root\",\n\t\"sample\",\n\t\"samples\",\n\t\"selection\",\n\t\"share\",\n\t\"shared\",\n\t\"sponsor\",\n\t\"sponsors\",\n\t\"sponsorship\",\n\t\"subscribe\",\n\t\"super\",\n\t\"superuser\",\n\t\"system\",\n\t\"sys\",\n\t\"test-org\",\n\t\"trash\",\n\t\"unpublish\",\n\t\"unsubscribe\",\n\t\"upload\",\n\t\"uploads\",\n\t\"waitlist\",\n\t\"widget\",\n\t\"widgets\",\n\t\"worker\",\n\t\"workers\"\n];\n/**\n* URL segments reserved for global (non-org) routes — cannot be used as an org slug.\n* Prefer adding new entries to the category arrays above; the Set is the enforcement surface.\n*/\nconst RESERVED_ORGANIZATION_SLUGS = new Set([\n\t...AUTH_ACCOUNT_SLUGS,\n\t...ORG_ACCOUNT_SLUGS,\n\t...PRODUCT_SLUGS,\n\t...MARKETING_SITE_SLUGS,\n\t...INTEGRATION_BRAND_SLUGS,\n\t...COMPANY_TEAM_SLUGS,\n\t...LEGAL_TRUST_SLUGS,\n\t...DEVELOPER_TECH_SLUGS,\n\t...INFRA_SYSTEM_SLUGS,\n\t...ROUTING_SAFETY_SLUGS\n]);\n/**\n* Base slug format: lowercase, 2-64 chars, alphanumeric + dashes.\n*\n* IMPORTANT: this is the schema for *reading* slugs (persisted rows, API\n* responses). It intentionally does NOT enforce the reserved-name list — an org\n* created before a name became reserved must still parse on read. Use\n* `ClaimableOrganizationSlugSchema` to validate slugs a user is trying to claim.\n*/\nconst OrganizationSlugSchema = z.string().trim().toLowerCase().min(2, \"Slug must be at least 2 characters\").max(64, \"Slug must be at most 64 characters\").regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, \"Use lowercase letters, numbers, and dashes only\");\n/**\n* Slug validation for *claiming* a slug (organization create/rename). Adds the\n* reserved-name check on top of the base format. Never use this to parse\n* existing org data, or pre-existing orgs whose slug later became reserved would\n* fail to load.\n*/\nconst ClaimableOrganizationSlugSchema = OrganizationSlugSchema.refine((slug) => !RESERVED_ORGANIZATION_SLUGS.has(slug), \"This slug is reserved\");\n/** Normalize a display name into slug-shaped text (may be empty or too short to claim). */\nfunction normalizeOrganizationNameToSlugBase(name) {\n\treturn name.trim().toLowerCase().replace(/[^a-z0-9]+/g, \"-\").replace(/-+/g, \"-\").replace(/^-|-$/g, \"\");\n}\n/**\n* Live slug preview while typing an org name. Returns normalized text only —\n* no server-side `\"org\"` fallback when the preview is empty or under min length.\n*/\nfunction previewOrganizationSlugFromName(name) {\n\treturn normalizeOrganizationNameToSlugBase(name);\n}\n/** Derive a URL slug from a display name (not guaranteed unique). */\nfunction slugifyOrganizationName(name) {\n\tconst base = normalizeOrganizationNameToSlugBase(name);\n\tif (!base) return \"org\";\n\tconst parsed = OrganizationSlugSchema.safeParse(base);\n\treturn parsed.success ? parsed.data : \"org\";\n}\nfunction parseOrganizationSlug(input) {\n\treturn OrganizationSlugSchema.parse(input);\n}\n//#endregion\n//#region src/constants/projects.ts\n/** Platform wait for project /health before declaring unreachable. */\nconst PROJECT_PING_TIMEOUT_MS = 15e3;\n/** Browser→platform request budget (ping + small platform overhead). */\nconst PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS = 17e3;\n/** Pause between reachability checks after the previous check finishes. */\nconst PROJECT_REACHABILITY_RETRY_MS = 5e3;\n//#endregion\n//#region src/public-url.ts\n/** Normalize a public origin URL (no trailing slash). */\nfunction originFromPublicUrl(value, fallback) {\n\tconst trimmed = value?.trim();\n\tif (!trimmed) return fallback.replace(/\\/+$/, \"\");\n\treturn trimmed.replace(/\\/+$/, \"\");\n}\n/** TCP port to bind for a local server, derived from a public URL. */\nfunction listenPortFromUrl(url, fallback) {\n\tconst parsed = new URL(url);\n\tif (parsed.port) {\n\t\tconst port = Number(parsed.port);\n\t\tif (Number.isFinite(port) && port > 0) return port;\n\t}\n\tif (parsed.protocol === \"https:\") return 443;\n\tif (parsed.protocol === \"http:\") return 80;\n\treturn fallback;\n}\n/** Shorthand: listen port from `PUBLIC_*_URL` or fallback. */\nfunction listenPortFromPublicUrl(value, fallback) {\n\tconst trimmed = value?.trim();\n\tif (!trimmed) return fallback;\n\ttry {\n\t\treturn listenPortFromUrl(trimmed, fallback);\n\t} catch {\n\t\treturn fallback;\n\t}\n}\n//#endregion\n//#region src/tool-parameters.ts\n/** JSON Schema draft 2020-12 for LLM tool inputs (not OpenAPI 3.0). */\nfunction toolParameters(schema) {\n\treturn z.toJSONSchema(schema, { target: \"draft-2020-12\" });\n}\n//#endregion\n//#region src/constants/route-manifest.ts\n/** On-disk path under the project root (packed in deploy artifacts when present). */\nconst ROUTE_MANIFEST_REL_PATH = \"dist/.keystroke/route-manifest.json\";\n/** HTTP route served by the project server after bootstrap. */\nconst ROUTE_MANIFEST_HTTP_PATH = \"/.keystroke/route-manifest\";\n//#endregion\n//#region src/schemas/route-manifest.ts\nconst serializedRouteManifestEntrySchema = z.discriminatedUnion(\"kind\", [\n\tz.object({\n\t\tkind: z.literal(\"health\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.literal(\"/health\")\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"agent\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tmoduleFile: z.string(),\n\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"agent-sessions-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tagentId: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"agent-session-detail\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tagentId: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"workflow\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tworkflowId: z.string(),\n\t\tworkflowName: z.string().optional(),\n\t\tmoduleFile: z.string(),\n\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"workflow-runs-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tworkflowId: z.string(),\n\t\tworkflowName: z.string().optional(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"workflow-run-detail\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tworkflowId: z.string(),\n\t\tworkflowName: z.string().optional(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-webhook\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tattachmentIds: z.array(z.string()),\n\t\tmoduleFile: z.string(),\n\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\tattachmentSchemas: z.record(z.string(), z.object({\n\t\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\t\tfilterSchema: z.record(z.string(), z.unknown()).optional()\n\t\t})),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-poll\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string(),\n\t\tschedule: z.string(),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-poll-group\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tpollId: z.string(),\n\t\tattachmentIds: z.array(z.string()),\n\t\tmoduleFile: z.string(),\n\t\tschedule: z.string(),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-runs-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-run-detail\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"cron-schedule\"),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string(),\n\t\tschedule: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"plugin\"),\n\t\tmethod: z.enum([\n\t\t\t\"GET\",\n\t\t\t\"POST\",\n\t\t\t\"PUT\",\n\t\t\t\"PATCH\",\n\t\t\t\"DELETE\"\n\t\t]),\n\t\tpath: z.string(),\n\t\tplugin: z.string()\n\t})\n]);\nconst StoredRouteManifestSchema = z.object({\n\tversion: z.literal(1),\n\tentries: z.array(serializedRouteManifestEntrySchema),\n\tintegrations: z.array(z.string()).optional()\n});\nfunction parseStoredRouteManifest(value) {\n\treturn StoredRouteManifestSchema.parse(value);\n}\n//#endregion\n//#region src/schemas/credentials.ts\n/** How a credential instance is stored (`credential_instances.auth_kind`). */\nconst CredentialAuthKindSchema = z.enum([\"api_key\", \"oauth_managed\"]);\n/** Where a credential instance is stored (`credential_instances.scope_type`). */\nconst CredentialScopeTypeSchema = z.enum([\n\t\"global\",\n\t\"organization\",\n\t\"project\",\n\t\"user\"\n]);\n/**\n* Resolution chain step when an action/tool looks up credentials.\n* `selection` uses explicit instance ids; other levels map to {@link CredentialScopeType}.\n*/\nconst CredentialScopeLevelSchema = z.enum([\n\t\"selection\",\n\t\"organization\",\n\t\"project\",\n\t\"user\"\n]);\nconst CREDENTIAL_AUTH_KINDS = CredentialAuthKindSchema.options;\nconst CREDENTIAL_SCOPE_TYPES = CredentialScopeTypeSchema.options;\nconst CREDENTIAL_SCOPE_LEVELS = CredentialScopeLevelSchema.options;\n/** Default chain when `credential.static(...).scope()` is called with no args. */\nconst DEFAULT_CREDENTIAL_RESOLUTION_CHAIN = [\"organization\", \"project\"];\nconst CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE = {\n\torganization: \"organization\",\n\tproject: \"project\",\n\tuser: \"user\"\n};\n//#endregion\n//#region src/schemas/credential-spec.ts\nfunction isCredentialInput(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = value;\n\treturn typeof candidate.key === \"string\" && CredentialAuthKindSchema.safeParse(candidate.kind).success && candidate.schema instanceof z.ZodType;\n}\nconst credentialInputSchema = z.custom((value) => isCredentialInput(value), \"must be a credential requirement\");\nfunction createRef(kind, key, schema, options) {\n\tconst tokenField = options?.tokenField;\n\treturn {\n\t\tkind,\n\t\tkey,\n\t\tschema,\n\t\t...tokenField !== void 0 ? { tokenField } : {},\n\t\tscope(...chain) {\n\t\t\treturn {\n\t\t\t\tkey,\n\t\t\t\tkind,\n\t\t\t\tschema,\n\t\t\t\tchain: chain.length > 0 ? chain : DEFAULT_CREDENTIAL_RESOLUTION_CHAIN,\n\t\t\t\t...tokenField !== void 0 ? { tokenField } : {}\n\t\t\t};\n\t\t}\n\t};\n}\nfunction staticCredential(key, schema) {\n\treturn createRef(\"api_key\", key, schema instanceof z.ZodType ? schema : z.object(schema));\n}\nfunction oauthCredential(key, options) {\n\tconst tokenField = options?.tokenField ?? \"accessToken\";\n\treturn createRef(\"oauth_managed\", key, tokenField === \"accessToken\" ? z.object({ accessToken: z.string() }) : z.object({ [tokenField]: z.string() }), { tokenField });\n}\nconst credential = {\n\tstatic: staticCredential,\n\toauth: oauthCredential\n};\nfunction defineCredential(input) {\n\tif (input.kind === \"oauth\") return input.tokenField !== void 0 ? credential.oauth(input.key, { tokenField: input.tokenField }) : credential.oauth(input.key);\n\tif (\"schema\" in input) return credential.static(input.key, input.schema);\n\treturn credential.static(input.key, input.fields);\n}\nfunction normalizeCredentialList(list) {\n\treturn list.map((item) => toCredentialRequirement(item));\n}\nfunction isCredentialRequirement(item) {\n\treturn \"chain\" in item;\n}\nfunction toCredentialRequirement(item) {\n\tif (isCredentialRequirement(item)) return item;\n\treturn {\n\t\tkey: item.key,\n\t\tkind: item.kind,\n\t\tschema: item.schema,\n\t\tchain: DEFAULT_CREDENTIAL_RESOLUTION_CHAIN,\n\t\t...item.tokenField !== void 0 ? { tokenField: item.tokenField } : {}\n\t};\n}\n//#endregion\n//#region src/schemas/organizations.ts\n/** Canonical copy for slug collision errors (API + UI). */\nconst ORGANIZATION_SLUG_TAKEN_MESSAGE = \"That slug is already taken.\";\nconst OrganizationSlugErrorCodeSchema = z.enum([\n\t\"slug_taken\",\n\t\"slug_reserved\",\n\t\"slug_invalid\"\n]);\nconst SlugAvailabilityReasonSchema = z.enum([\n\t\"taken\",\n\t\"reserved\",\n\t\"invalid\"\n]);\nconst SlugAvailabilityResponseSchema = z.object({\n\tslug: z.string(),\n\tavailable: z.boolean(),\n\treason: SlugAvailabilityReasonSchema.optional(),\n\tsuggestion: OrganizationSlugSchema.optional()\n});\nconst SlugAvailabilityQuerySchema = z.object({\n\tslug: z.string().trim().min(1),\n\texcludeOrganizationId: z.string().min(1).optional()\n});\n/** Client-side instant validation before hitting the availability endpoint. */\nfunction validateClaimableOrganizationSlug(slug) {\n\tconst normalized = slug.trim().toLowerCase();\n\tif (!normalized) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: \"Slug is required\"\n\t};\n\tconst format = OrganizationSlugSchema.safeParse(normalized);\n\tif (!format.success) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: format.error.issues[0]?.message ?? \"Invalid slug\"\n\t};\n\tif (RESERVED_ORGANIZATION_SLUGS.has(format.data)) return {\n\t\tvalid: false,\n\t\treason: \"reserved\",\n\t\tmessage: \"This slug is reserved\"\n\t};\n\treturn { valid: true };\n}\nfunction organizationSlugErrorCodeFromMessage(message) {\n\tif (message === \"That slug is already taken.\" || /already taken/i.test(message)) return \"slug_taken\";\n\tif (/reserved/i.test(message)) return \"slug_reserved\";\n\treturn \"slug_invalid\";\n}\nconst ProjectStatusSchema = z.enum([\n\t\"inactive\",\n\t\"starting\",\n\t\"active\",\n\t\"failed\"\n]);\nconst OrganizationUserRoleSchema = z.enum([\n\t\"owner\",\n\t\"admin\",\n\t\"builder\"\n]);\nconst isoDateTime$2 = z.string().datetime();\nconst OrganizationSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tslug: OrganizationSlugSchema,\n\tcreatedAt: isoDateTime$2,\n\tupdatedAt: isoDateTime$2\n});\nconst ProjectSchema = z.object({\n\tid: z.string(),\n\torganizationId: z.string(),\n\tname: z.string(),\n\tdescription: z.string().nullable(),\n\tstatus: ProjectStatusSchema,\n\tbaseUrl: z.string().nullable(),\n\truntimeId: z.string().nullable(),\n\tlastError: z.string().nullable(),\n\tcreatedAt: isoDateTime$2,\n\tupdatedAt: isoDateTime$2\n});\nconst UserOrganizationSchema = z.object({\n\torganization: OrganizationSchema,\n\trole: OrganizationUserRoleSchema\n});\nconst CurrentOrganizationResponseSchema = z.object({ organization: UserOrganizationSchema.nullable() });\nconst ActiveOrganizationResponseSchema = CurrentOrganizationResponseSchema;\nconst ListOrganizationsResponseSchema = z.object({ organizations: z.array(UserOrganizationSchema) });\nconst SetActiveOrganizationRequestSchema = z.object({ organizationId: z.string().min(1) });\nconst CreateOrganizationRequestSchema = z.object({\n\tname: z.string().trim().min(1),\n\t/** Format-only at the wire boundary; reserved-name checks run in platform-database. */\n\tslug: OrganizationSlugSchema.optional()\n});\nconst UpdateOrganizationRequestSchema = z.object({ slug: ClaimableOrganizationSlugSchema });\nconst CreateOrganizationResponseSchema = z.object({ organization: UserOrganizationSchema });\nconst ListProjectsResponseSchema = z.object({ projects: z.array(ProjectSchema) });\nconst CreateProjectRequestSchema = z.object({\n\tname: z.string().trim().min(1),\n\tdescription: z.string().trim().min(1).optional()\n});\nconst CreateProjectResponseSchema = z.object({ project: ProjectSchema });\nconst ProjectResponseSchema = z.object({ project: ProjectSchema });\nconst ProjectReachabilityResponseSchema = z.object({ reachable: z.boolean() });\nfunction parseCreateOrganizationRequest(input) {\n\treturn CreateOrganizationRequestSchema.parse(input);\n}\n//#endregion\n//#region src/schemas/errors/schema.ts\nconst ValidationErrorDetailSchema = z.object({\n\tpath: z.string(),\n\tmessage: z.string()\n});\n/** Machine-readable codes returned in standard API error bodies. */\nconst ErrorResponseCodeSchema = OrganizationSlugErrorCodeSchema.or(z.enum([\"needs_org_selection\"]));\n/** Standard JSON error body returned by the HTTP API. */\nconst ErrorResponseSchema = z.object({\n\terror: z.string(),\n\tcode: ErrorResponseCodeSchema.optional(),\n\tmessage: z.string().optional(),\n\tdetails: z.array(ValidationErrorDetailSchema).optional()\n});\n//#endregion\n//#region src/schemas/errors/from-zod.ts\n/** Build the JSON body for HTTP 400 validation failures. */\nfunction validationErrorResponse(error, summary) {\n\treturn {\n\t\terror: summary,\n\t\tdetails: error.issues.map((issue) => ({\n\t\t\tpath: issue.path.join(\".\"),\n\t\t\tmessage: issue.message\n\t\t}))\n\t};\n}\n//#endregion\n//#region src/schemas/errors/parse.ts\nconst MessageOnlyErrorBodySchema = z.object({ message: z.string() });\n/** Parse a JSON error body from the API. */\nfunction parseErrorResponse(body) {\n\tconst parsed = ErrorResponseSchema.safeParse(body);\n\tif (parsed.success) return parsed.data;\n\tconst messageOnly = MessageOnlyErrorBodySchema.safeParse(body);\n\tif (messageOnly.success) return {\n\t\terror: messageOnly.data.message,\n\t\tmessage: messageOnly.data.message\n\t};\n}\n//#endregion\n//#region src/schemas/http.ts\nconst CredentialRunContextSchema = z.object({\n\torgId: z.string().min(1).optional(),\n\tprojectId: z.string().min(1).optional(),\n\tuserId: z.string().min(1).optional(),\n\tuserIds: z.record(z.string(), z.string()).optional(),\n\tselection: z.record(z.string(), z.string()).optional()\n});\nconst ThinkingLevelSchema = z.enum([\n\t\"off\",\n\t\"minimal\",\n\t\"low\",\n\t\"medium\",\n\t\"high\",\n\t\"xhigh\"\n]);\nconst PromptInputSchema = z.object({\n\tmessage: z.string().min(1),\n\tsessionId: z.string().min(1).optional(),\n\tsubscriptionId: z.string().min(1).optional(),\n\tcontext: CredentialRunContextSchema.optional(),\n\tthinkingLevel: ThinkingLevelSchema.optional()\n});\nconst PromptResponseSchema = z.object({\n\tsessionId: z.string(),\n\tmessages: z.array(z.record(z.string(), z.unknown())),\n\terror: z.string().nullable()\n});\nconst SkipResponseSchema = z.object({\n\tok: z.literal(true),\n\tskipped: z.literal(true)\n});\nconst HealthResponseSchema = z.object({ ok: z.literal(true) });\nconst PlatformInfoResponseSchema = z.object({ service: z.string() });\nconst ConnectProviderSchema = z.object({\n\tkey: z.string(),\n\tmode: z.enum([\"authorize-url\", \"browser-redirect\"]),\n\tpath: z.string(),\n\trequiresAuth: z.boolean()\n});\nconst ConnectProvidersResponseSchema = z.object({ providers: z.array(ConnectProviderSchema) });\nconst ConnectAuthorizeUrlResponseSchema = z.object({ url: z.string() });\nconst QueuedRunResponseSchema = z.object({ runId: z.string() });\nconst QueuedAgentPromptResponseSchema = z.object({ sessionId: z.string() });\nfunction parsePromptInput(input) {\n\treturn PromptInputSchema.parse(input);\n}\nconst PollRunRequestSchema = z.object({\n\tworkflows: z.array(z.string().min(1)).optional(),\n\tattachments: z.array(z.string().min(1)).optional()\n});\nconst PollAttachmentResultSchema = z.object({\n\tattachmentKey: z.string(),\n\tworkflowKey: z.string(),\n\trunId: z.string().optional(),\n\tbody: z.unknown().optional(),\n\tqueued: z.boolean(),\n\tskipped: z.boolean().optional()\n});\nconst PollRunMultiResponseSchema = z.object({ results: z.array(PollAttachmentResultSchema) });\nconst PollRunResponseSchema = z.union([\n\tz.record(z.string(), z.unknown()),\n\tPollRunMultiResponseSchema,\n\tSkipResponseSchema,\n\tz.object({ runId: z.string() })\n]);\nfunction parsePollRunRequest(body) {\n\tif (body === void 0 || body === null) return {};\n\treturn PollRunRequestSchema.parse(body);\n}\n//#endregion\n//#region src/schemas/runs.ts\nconst RunSourceKindSchema = z.enum([\n\t\"api\",\n\t\"trigger\",\n\t\"gateway\",\n\t\"workflow\",\n\t\"agent\"\n]);\nconst RunSourceSchema = z.object({\n\tkind: RunSourceKindSchema,\n\tid: z.string().nullable()\n});\n//#endregion\n//#region src/schemas/workflow-runs.ts\nconst WorkflowRunStatusSchema = z.enum([\n\t\"pending\",\n\t\"running\",\n\t\"completed\",\n\t\"failed\"\n]);\nconst WorkflowRunTriggerSchema = z.enum([\n\t\"api\",\n\t\"cron\",\n\t\"webhook\",\n\t\"poll\",\n\t\"retry\"\n]);\n/**\n* Durable workflow event-log entry types. Shared so the persistence layer\n* (`@keystrokehq/database` schema) and the runtime-agnostic replay engine\n* (`@keystrokehq/workflow`) reference one definition instead of duplicating it.\n*/\nconst WorkflowEventTypeSchema = z.enum([\n\t\"run_started\",\n\t\"step_completed\",\n\t\"step_failed\",\n\t\"step_retrying\",\n\t\"sleep_scheduled\",\n\t\"sleep_completed\",\n\t\"hook_created\",\n\t\"hook_resumed\",\n\t\"run_completed\",\n\t\"run_failed\"\n]);\nconst WorkflowRunSummarySchema = z.object({\n\tid: z.string(),\n\tstatus: WorkflowRunStatusSchema,\n\ttrigger: WorkflowRunTriggerSchema,\n\ttriggeredAt: z.string(),\n\tstartedAt: z.string().nullable(),\n\tfinishedAt: z.string().nullable(),\n\tsourceKind: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\ttriggerRunId: z.string().nullable(),\n\tattachmentId: z.string().nullable()\n});\nconst WorkflowRunRecordSchema = z.object({\n\tid: z.string(),\n\tworkflowKey: z.string(),\n\tstatus: WorkflowRunStatusSchema,\n\ttrigger: WorkflowRunTriggerSchema,\n\ttriggeredAt: z.string(),\n\tstartedAt: z.string().nullable(),\n\tfinishedAt: z.string().nullable(),\n\tsourceKind: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\ttriggerRunId: z.string().nullable(),\n\tattachmentId: z.string().nullable(),\n\tparentWorkflowRunId: z.string().nullable(),\n\tparentSpanId: z.string().nullable(),\n\tinput: z.unknown().nullable(),\n\toutput: z.unknown().nullable(),\n\terror: z.unknown().nullable()\n});\nconst WorkflowRunListQuerySchema = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(20),\n\tcursor: z.string().min(1).optional(),\n\tstatus: WorkflowRunStatusSchema.optional(),\n\ttrigger: WorkflowRunTriggerSchema.optional()\n});\nconst WorkflowRunListResponseSchema = z.object({\n\titems: z.array(WorkflowRunSummarySchema),\n\tnextCursor: z.string().nullable()\n});\nconst WorkflowRunDetailIncludeSchema = z.enum([\n\t\"trigger\",\n\t\"steps\",\n\t\"trace\"\n]);\nconst WorkflowRunDetailQuerySchema = z.object({ include: z.string().optional() });\nconst DEFAULT_DETAIL_INCLUDE$2 = [\n\t\"trigger\",\n\t\"steps\",\n\t\"trace\"\n];\nfunction parseWorkflowRunDetailInclude(include) {\n\tif (!include?.trim()) return [...DEFAULT_DETAIL_INCLUDE$2];\n\tconst parsed = include.split(\",\").map((part) => part.trim()).filter((part) => WorkflowRunDetailIncludeSchema.options.includes(part));\n\treturn parsed.length > 0 ? parsed : [...DEFAULT_DETAIL_INCLUDE$2];\n}\nconst TriggerRunDetailSchema = z.object({\n\tid: z.string(),\n\tattachmentId: z.string(),\n\tattachmentKey: z.string().nullable(),\n\ttriggerType: z.enum([\n\t\t\"cron\",\n\t\t\"webhook\",\n\t\t\"poll\"\n\t]),\n\tsourcePath: z.string().nullable(),\n\tpayload: z.unknown().nullable(),\n\ttriggeredAt: z.string()\n});\nconst WorkflowStepRunSchema = z.object({\n\tid: z.string(),\n\tactionKey: z.string(),\n\toutput: z.unknown(),\n\tcompletedAt: z.string()\n});\nconst TraceTriggerSummarySchema = z.object({\n\ttriggerType: z.string(),\n\ttriggerRunId: z.string(),\n\tworkflowKey: z.string().optional(),\n\tagentKey: z.string().optional(),\n\tattachmentId: z.string().nullable().optional(),\n\tattachmentKey: z.string().nullable().optional(),\n\troute: z.string().optional(),\n\tsourcePath: z.string().nullable().optional()\n}).nullable();\nconst TraceGatewaySummarySchema = z.object({\n\tgatewayAttachmentId: z.string(),\n\tgatewayAttachmentKey: z.string(),\n\tthreadId: z.string().optional(),\n\tchannelId: z.string().optional(),\n\tmode: z.string().optional()\n}).nullable();\nconst TraceSpanSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tparentSpanId: z.string().nullable(),\n\tkind: z.string(),\n\trefId: z.string(),\n\tname: z.string(),\n\tstatus: z.string(),\n\tstartedAt: z.string(),\n\tfinishedAt: z.string().nullable(),\n\tmetadata: z.unknown().nullable(),\n\terror: z.unknown().nullable()\n});\nconst TraceLogSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tspanId: z.string(),\n\tseq: z.number(),\n\tlevel: z.string(),\n\tmessage: z.string(),\n\tdata: z.unknown().nullable(),\n\tsource: z.string(),\n\tcreatedAt: z.string()\n});\nconst TraceResponseSchema = z.object({\n\ttraceId: z.string(),\n\ttrigger: TraceTriggerSummarySchema,\n\tgateway: TraceGatewaySummarySchema,\n\tspans: z.array(TraceSpanSchema),\n\tlogs: z.array(TraceLogSchema)\n});\nconst WorkflowRunDetailResponseSchema = z.object({\n\trun: WorkflowRunRecordSchema,\n\ttrigger: TriggerRunDetailSchema.nullable(),\n\tsteps: z.array(WorkflowStepRunSchema),\n\ttrace: TraceResponseSchema.nullable()\n});\n//#endregion\n//#region src/schemas/agent-sessions.ts\nconst AgentSessionStatusSchema = z.enum([\n\t\"running\",\n\t\"completed\",\n\t\"failed\"\n]);\nconst AgentSessionSummarySchema = z.object({\n\tid: z.string(),\n\tstatus: AgentSessionStatusSchema,\n\tsource: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tmessageCount: z.number()\n});\nconst AgentSessionRecordSchema = z.object({\n\tid: z.string(),\n\tagentKey: z.string(),\n\tstatus: AgentSessionStatusSchema,\n\tsource: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tparentSpanId: z.string().nullable(),\n\tmessageCount: z.number(),\n\terror: z.unknown().nullable()\n});\nconst AgentSessionListQuerySchema = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(20),\n\tcursor: z.string().min(1).optional(),\n\tstatus: AgentSessionStatusSchema.optional(),\n\tsource: RunSourceKindSchema.optional()\n});\nconst AgentSessionListResponseSchema = z.object({\n\titems: z.array(AgentSessionSummarySchema),\n\tnextCursor: z.string().nullable()\n});\nconst AgentSessionDetailIncludeSchema = z.enum([\n\t\"gateway\",\n\t\"messages\",\n\t\"events\",\n\t\"trace\"\n]);\nconst AgentSessionDetailQuerySchema = z.object({ include: z.string().optional() });\nconst DEFAULT_DETAIL_INCLUDE$1 = [\n\t\"gateway\",\n\t\"messages\",\n\t\"trace\"\n];\nfunction parseAgentSessionDetailInclude(include) {\n\tif (!include?.trim()) return [...DEFAULT_DETAIL_INCLUDE$1];\n\tconst parsed = include.split(\",\").map((part) => part.trim()).filter((part) => AgentSessionDetailIncludeSchema.options.includes(part));\n\treturn parsed.length > 0 ? parsed : [...DEFAULT_DETAIL_INCLUDE$1];\n}\nconst GatewaySessionDetailSchema = z.object({\n\tthreadId: z.string(),\n\tattachmentId: z.string(),\n\tattachmentKey: z.string().nullable()\n});\nconst AgentEventSchema = z.object({\n\tid: z.string(),\n\tsessionId: z.string(),\n\tseq: z.number(),\n\teventType: z.string(),\n\tpayload: z.unknown(),\n\tcreatedAt: z.string()\n});\nconst AgentSessionDetailResponseSchema = z.object({\n\tsession: AgentSessionRecordSchema,\n\tgateway: GatewaySessionDetailSchema.nullable(),\n\tmessages: z.array(z.record(z.string(), z.unknown())),\n\tevents: z.array(AgentEventSchema),\n\ttrace: TraceResponseSchema.nullable()\n});\n//#endregion\n//#region src/schemas/gateway-attachments.ts\nconst SlackGatewayModeSchema = z.enum([\n\t\"mention\",\n\t\"channel\",\n\t\"dm\"\n]);\nconst GatewayAttachmentSourceSchema = z.object({\n\tkind: z.literal(\"slack\"),\n\tmode: SlackGatewayModeSchema,\n\tcredentialKey: z.string(),\n\tchannelIds: z.array(z.string()).optional(),\n\tsubscribeOnMention: z.boolean()\n});\nconst GatewayAttachmentRecordSchema = z.object({\n\tid: z.string(),\n\tkey: z.string(),\n\tagentKey: z.string(),\n\tchannelId: z.string(),\n\tplatform: z.string(),\n\tsource: GatewayAttachmentSourceSchema,\n\tregisteredAt: z.string(),\n\tupdatedAt: z.string()\n});\nconst GatewayAttachmentListResponseSchema = z.object({ attachments: z.array(GatewayAttachmentRecordSchema) });\nconst UpsertGatewayAttachmentBodySchema = z.object({\n\tagentKey: z.string().min(1),\n\tmode: SlackGatewayModeSchema.optional(),\n\tsubscribeOnMention: z.boolean().optional()\n});\nconst AgentListItemSchema = z.object({\n\tkey: z.string(),\n\tname: z.string().optional(),\n\troute: z.string()\n});\nconst AgentListResponseSchema = z.object({ agents: z.array(AgentListItemSchema) });\n//#endregion\n//#region src/schemas/workflow-deployments.ts\nconst WorkflowSubscriptionRecordSchema = z.object({\n\tid: z.string(),\n\tworkflowKey: z.string(),\n\tuserId: z.string(),\n\tenabled: z.boolean(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string()\n});\nconst WorkflowSubscriptionListResponseSchema = z.object({ subscriptions: z.array(WorkflowSubscriptionRecordSchema) });\nconst UpsertWorkflowSubscriptionBodySchema = z.object({\n\tuserId: z.string().min(1).optional(),\n\tenabled: z.boolean().optional()\n});\nconst CredentialInstanceRecordSchema = z.object({\n\tid: z.string(),\n\tkey: z.string(),\n\tscopeType: CredentialScopeTypeSchema,\n\tscopeId: z.string().nullable(),\n\tlabel: z.string().nullable(),\n\tisDefault: z.boolean(),\n\tauthKind: CredentialAuthKindSchema\n});\nconst CredentialInstanceListResponseSchema = z.object({ instances: z.array(CredentialInstanceRecordSchema) });\nconst CreateCredentialInstanceBodySchema = z.object({\n\tkey: z.string().min(1),\n\tscopeType: CredentialScopeTypeSchema,\n\tscopeId: z.string().nullable().optional(),\n\tlabel: z.string().nullable().optional(),\n\tisDefault: z.boolean().optional(),\n\tvalue: z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: \"value must be a non-empty object\" })\n});\nconst UpdateCredentialInstanceBodySchema = z.object({\n\tlabel: z.string().nullable().optional(),\n\tisDefault: z.boolean().optional(),\n\tvalue: z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: \"value must be a non-empty object\" }).optional()\n});\n//#endregion\n//#region src/schemas/trigger-runs.ts\nconst TriggerRunTypeSchema = z.enum([\n\t\"cron\",\n\t\"webhook\",\n\t\"poll\"\n]);\nconst TriggerRunWorkflowSummarySchema = z.object({\n\tid: z.string(),\n\tstatus: WorkflowRunStatusSchema,\n\tworkflowKey: z.string()\n});\nconst TriggerRunAgentSessionSummarySchema = z.object({\n\tid: z.string(),\n\tagentKey: z.string()\n});\nconst TriggerRunSummarySchema = z.object({\n\tid: z.string(),\n\ttriggerType: TriggerRunTypeSchema,\n\ttriggeredAt: z.string(),\n\tsourcePath: z.string().nullable(),\n\tworkflowRun: TriggerRunWorkflowSummarySchema.nullable(),\n\tagentSession: TriggerRunAgentSessionSummarySchema.nullable()\n});\nconst TriggerRunRecordSchema = z.object({\n\tid: z.string(),\n\tattachmentId: z.string(),\n\tattachmentKey: z.string(),\n\ttriggerType: TriggerRunTypeSchema,\n\tsourcePath: z.string().nullable(),\n\tpayload: z.unknown().nullable(),\n\ttriggeredAt: z.string()\n});\nconst TriggerRunListQuerySchema = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(20),\n\tcursor: z.string().min(1).optional(),\n\ttriggerType: TriggerRunTypeSchema.optional()\n});\nconst TriggerRunListResponseSchema = z.object({\n\titems: z.array(TriggerRunSummarySchema),\n\tnextCursor: z.string().nullable()\n});\nconst TriggerRunDetailIncludeSchema = z.enum([\n\t\"workflows\",\n\t\"agents\",\n\t\"trace\"\n]);\nconst TriggerRunDetailQuerySchema = z.object({ include: z.string().optional() });\nconst DEFAULT_DETAIL_INCLUDE = [\n\t\"workflows\",\n\t\"agents\",\n\t\"trace\"\n];\nfunction parseTriggerRunDetailInclude(include) {\n\tif (!include?.trim()) return [...DEFAULT_DETAIL_INCLUDE];\n\tconst parsed = include.split(\",\").map((part) => part.trim()).filter((part) => TriggerRunDetailIncludeSchema.options.includes(part));\n\treturn parsed.length > 0 ? parsed : [...DEFAULT_DETAIL_INCLUDE];\n}\nconst TriggerRunAgentSessionDetailSchema = z.object({\n\tid: z.string(),\n\tagentKey: z.string()\n});\nconst TriggerRunDetailResponseSchema = z.object({\n\trun: TriggerRunRecordSchema,\n\tworkflowRuns: z.array(WorkflowRunSummarySchema),\n\tagentSessions: z.array(TriggerRunAgentSessionDetailSchema),\n\ttrace: TraceResponseSchema.nullable()\n});\n//#endregion\n//#region src/schemas/triggers.ts\nconst TriggerTypeSchema = z.enum([\n\t\"webhook\",\n\t\"poll\",\n\t\"cron\"\n]);\nconst TriggerTargetKindSchema = z.enum([\"workflow\", \"agent\"]);\nconst TriggerListItemSchema = z.object({\n\tkey: z.string(),\n\ttype: TriggerTypeSchema,\n\troute: z.string().optional(),\n\twebhookUrl: z.string().url().optional(),\n\ttargetKind: TriggerTargetKindSchema,\n\tworkflowKey: z.string().optional(),\n\tagentKey: z.string().optional()\n});\nconst TriggerListResponseSchema = z.object({ triggers: z.array(TriggerListItemSchema) });\nconst TriggerListQuerySchema = z.object({ endpoint: z.string().min(1).optional() });\nconst TriggerDetailResponseSchema = TriggerListItemSchema;\n//#endregion\n//#region src/schemas/members.ts\nconst OrganizationMemberRoleSchema = z.enum([\n\t\"owner\",\n\t\"admin\",\n\t\"builder\"\n]);\nconst OrganizationMemberStatusSchema = z.enum([\n\t\"invited\",\n\t\"active\",\n\t\"rejected\",\n\t\"suspended\"\n]);\nconst InvitableOrganizationMemberRoleSchema = z.enum([\"admin\", \"builder\"]);\nconst isoDateTime$1 = z.string().datetime();\nconst OrganizationMemberSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\temail: z.string().email(),\n\trole: OrganizationMemberRoleSchema,\n\tstatus: OrganizationMemberStatusSchema,\n\tavatarUrl: z.string().optional(),\n\tjoinedAt: isoDateTime$1.optional(),\n\tlastActiveAt: isoDateTime$1.nullable().optional()\n});\nconst ListOrganizationMembersResponseSchema = z.object({ members: z.array(OrganizationMemberSchema) });\nconst InviteOrganizationMembersRequestSchema = z.object({\n\temails: z.array(z.string().trim().email()).min(1),\n\trole: InvitableOrganizationMemberRoleSchema\n});\nconst InviteOrganizationMemberResultStatusSchema = z.enum([\n\t\"sent\",\n\t\"already_member\",\n\t\"pending\",\n\t\"invalid\"\n]);\nconst InviteOrganizationMemberResultSchema = z.object({\n\temail: z.string(),\n\tstatus: InviteOrganizationMemberResultStatusSchema,\n\tinvitationId: z.string().optional()\n});\nconst InviteOrganizationMembersResponseSchema = z.object({ results: z.array(InviteOrganizationMemberResultSchema) });\nconst UpdateOrganizationMemberRequestSchema = z.object({ role: InvitableOrganizationMemberRoleSchema });\nconst UpdateOrganizationMemberResponseSchema = z.object({ member: OrganizationMemberSchema });\nconst OrganizationInvitationSchema = z.object({\n\tid: z.string(),\n\torganizationName: z.string(),\n\torganizationSlug: OrganizationSlugSchema,\n\tinvitedByName: z.string().optional(),\n\tinvitedByEmail: z.string().email().optional(),\n\trole: OrganizationMemberRoleSchema\n});\nconst ListOrganizationInvitationsResponseSchema = z.object({ invitations: z.array(OrganizationInvitationSchema) });\nconst AcceptOrganizationInvitationResponseSchema = z.object({ organization: UserOrganizationSchema });\nconst DeclineOrganizationInvitationResponseSchema = z.object({ success: z.literal(true) });\n/** Web path to auto-accept an invitation after sign-in (used in invite emails). */\nfunction organizationInvitationAcceptPath(invitationId) {\n\treturn `/organization/invitations?${new URLSearchParams({ accept: invitationId }).toString()}`;\n}\n//#endregion\n//#region src/schemas/project-artifacts.ts\nconst ProjectArtifactStatusSchema = z.enum([\"pending\", \"ready\"]);\nconst isoDateTime = z.string().datetime();\nconst ProjectArtifactSchema = z.object({\n\tid: z.string(),\n\tprojectId: z.string(),\n\tstorageKey: z.string(),\n\tstatus: ProjectArtifactStatusSchema,\n\tcreatedAt: isoDateTime,\n\tupdatedAt: isoDateTime\n});\nconst CreateProjectArtifactResponseSchema = z.object({\n\tartifact: ProjectArtifactSchema,\n\tuploadUrl: z.string().url(),\n\texpiresInSeconds: z.number().int().positive()\n});\nconst CompleteProjectArtifactResponseSchema = z.object({\n\tartifact: ProjectArtifactSchema,\n\tproject: ProjectSchema\n});\n//#endregion\n//#region src/mappers/organizations.ts\nfunction mapOrganization(row) {\n\treturn OrganizationSchema.parse({\n\t\tid: row.id,\n\t\tname: row.name,\n\t\tslug: row.slug,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tupdatedAt: row.updatedAt.toISOString()\n\t});\n}\nfunction mapProject(row) {\n\treturn ProjectSchema.parse({\n\t\tid: row.id,\n\t\torganizationId: row.organizationId,\n\t\tname: row.name,\n\t\tdescription: row.description,\n\t\tstatus: row.status,\n\t\tbaseUrl: row.baseUrl,\n\t\truntimeId: row.runtimeId,\n\t\tlastError: row.lastError,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tupdatedAt: row.updatedAt.toISOString()\n\t});\n}\nfunction mapUserOrganization(row) {\n\treturn UserOrganizationSchema.parse({\n\t\torganization: mapOrganization(row.organization),\n\t\trole: row.role\n\t});\n}\n//#endregion\n//#region src/mappers/members.ts\nfunction mapOrganizationMember(row) {\n\treturn OrganizationMemberSchema.parse({\n\t\tid: row.id,\n\t\tname: row.name,\n\t\temail: row.email,\n\t\trole: row.role,\n\t\tstatus: row.status,\n\t\t...row.image ? { avatarUrl: row.image } : {},\n\t\tjoinedAt: row.createdAt.toISOString(),\n\t\tlastActiveAt: null\n\t});\n}\nfunction mapOrganizationInvitation(row) {\n\treturn OrganizationInvitationSchema.parse({\n\t\tid: row.id,\n\t\torganizationName: row.organizationName,\n\t\torganizationSlug: row.organizationSlug,\n\t\trole: row.role,\n\t\t...row.invitedByName ? { invitedByName: row.invitedByName } : {},\n\t\t...row.invitedByEmail ? { invitedByEmail: row.invitedByEmail } : {}\n\t});\n}\n//#endregion\n//#region src/mappers/project-artifacts.ts\nfunction mapProjectArtifact(row) {\n\treturn ProjectArtifactSchema.parse({\n\t\tid: row.id,\n\t\tprojectId: row.projectId,\n\t\tstorageKey: row.storageKey,\n\t\tstatus: row.status,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tupdatedAt: row.updatedAt.toISOString()\n\t});\n}\n//#endregion\nexport { ACTIVE_ORG_COOKIE, ACTIVE_ORG_HEADER, AcceptOrganizationInvitationResponseSchema, ActiveOrganizationResponseSchema, AgentListResponseSchema, AgentSessionDetailQuerySchema, AgentSessionDetailResponseSchema, AgentSessionListQuerySchema, AgentSessionListResponseSchema, CREDENTIAL_AUTH_KINDS, CREDENTIAL_SCOPE_LEVELS, CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE, CREDENTIAL_SCOPE_TYPES, ClaimableOrganizationSlugSchema, CompleteProjectArtifactResponseSchema, ConnectAuthorizeUrlResponseSchema, ConnectProvidersResponseSchema, CreateCredentialInstanceBodySchema, CreateOrganizationRequestSchema, CreateOrganizationResponseSchema, CreateProjectArtifactResponseSchema, CreateProjectRequestSchema, CreateProjectResponseSchema, CredentialAuthKindSchema, CredentialInstanceListResponseSchema, CredentialInstanceRecordSchema, CredentialScopeLevelSchema, CredentialScopeTypeSchema, CurrentOrganizationResponseSchema, DEFAULT_CREDENTIAL_RESOLUTION_CHAIN, DISCOVERY_CONVENTIONS, DeclineOrganizationInvitationResponseSchema, ErrorResponseCodeSchema, ErrorResponseSchema, GatewayAttachmentListResponseSchema, GatewayAttachmentRecordSchema, HealthResponseSchema, InvitableOrganizationMemberRoleSchema, InviteOrganizationMembersRequestSchema, InviteOrganizationMembersResponseSchema, ListOrganizationInvitationsResponseSchema, ListOrganizationMembersResponseSchema, ListOrganizationsResponseSchema, ListProjectsResponseSchema, ORGANIZATION_SLUG_TAKEN_MESSAGE, OrganizationInvitationSchema, OrganizationMemberRoleSchema, OrganizationMemberSchema, OrganizationMemberStatusSchema, OrganizationSchema, OrganizationSlugErrorCodeSchema, OrganizationSlugSchema, OrganizationUserRoleSchema, PROJECT_PING_TIMEOUT_MS, PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, PROJECT_REACHABILITY_RETRY_MS, PlatformInfoResponseSchema, PollRunRequestSchema, PollRunResponseSchema, ProjectArtifactSchema, ProjectArtifactStatusSchema, ProjectReachabilityResponseSchema, ProjectResponseSchema, ProjectSchema, ProjectStatusSchema, PromptInputSchema, PromptResponseSchema, QueuedAgentPromptResponseSchema, QueuedRunResponseSchema, RESERVED_ORGANIZATION_SLUGS, ROUTE_MANIFEST_HTTP_PATH, ROUTE_MANIFEST_REL_PATH, RunSourceKindSchema, RunSourceSchema, SetActiveOrganizationRequestSchema, SkipResponseSchema, SlugAvailabilityQuerySchema, SlugAvailabilityReasonSchema, SlugAvailabilityResponseSchema, StoredRouteManifestSchema, TriggerDetailResponseSchema, TriggerListItemSchema, TriggerListQuerySchema, TriggerListResponseSchema, TriggerRunDetailQuerySchema, TriggerRunDetailResponseSchema, TriggerRunListQuerySchema, TriggerRunListResponseSchema, TriggerTypeSchema, UpdateCredentialInstanceBodySchema, UpdateOrganizationMemberRequestSchema, UpdateOrganizationMemberResponseSchema, UpdateOrganizationRequestSchema, UpsertGatewayAttachmentBodySchema, UpsertWorkflowSubscriptionBodySchema, UserOrganizationSchema, ValidationErrorDetailSchema, WorkflowEventTypeSchema, WorkflowRunDetailQuerySchema, WorkflowRunDetailResponseSchema, WorkflowRunListQuerySchema, WorkflowRunListResponseSchema, WorkflowSubscriptionListResponseSchema, WorkflowSubscriptionRecordSchema, credential, credentialInputSchema, defineCredential, isCredentialInput, listenPortFromPublicUrl, listenPortFromUrl, mapOrganization, mapOrganizationInvitation, mapOrganizationMember, mapProject, mapProjectArtifact, mapUserOrganization, normalizeCredentialList, organizationInvitationAcceptPath, organizationSlugErrorCodeFromMessage, originFromPublicUrl, parseAgentSessionDetailInclude, parseCreateOrganizationRequest, parseErrorResponse, parseOrganizationSlug, parsePollRunRequest, parsePromptInput, parseStoredRouteManifest, parseTriggerRunDetailInclude, parseWorkflowRunDetailInclude, previewOrganizationSlugFromName, slugifyOrganizationName, toCredentialRequirement, toolParameters, validateClaimableOrganizationSlug, validationErrorResponse };\n\n//# sourceMappingURL=index.mjs.map","import ky, { isHTTPError } from \"ky\";\nimport { ACTIVE_ORG_HEADER, AgentSessionDetailResponseSchema, AgentSessionListResponseSchema, ConnectAuthorizeUrlResponseSchema, ConnectProvidersResponseSchema, CreateCredentialInstanceBodySchema, CredentialInstanceListResponseSchema, CredentialInstanceRecordSchema, HealthResponseSchema, PollRunResponseSchema, PromptInputSchema, PromptResponseSchema, QueuedAgentPromptResponseSchema, QueuedRunResponseSchema, SkipResponseSchema, TriggerDetailResponseSchema, TriggerListResponseSchema, TriggerRunDetailResponseSchema, TriggerRunListResponseSchema, UpdateCredentialInstanceBodySchema, WorkflowRunDetailResponseSchema, WorkflowRunListResponseSchema, parseErrorResponse } from \"@keystrokehq/shared\";\n//#region src/auth.ts\nfunction normalizeBaseUrl(baseUrl) {\n\treturn baseUrl.replace(/\\/+$/, \"\");\n}\nfunction applyActiveOrganizationHeader(request, organizationId) {\n\tif (organizationId) request.headers.set(ACTIVE_ORG_HEADER, organizationId);\n}\nfunction applyAuthHeaders(request, auth, getToken) {\n\tif (!auth || auth.type === \"none\") return;\n\tif (auth.type === \"cookie\") return;\n\tif (auth.type === \"apiKey\") {\n\t\tconst key = auth.getKey();\n\t\tif (key) request.headers.set(\"x-api-key\", key);\n\t\treturn;\n\t}\n\tif (auth.type === \"bearer\") {\n\t\tconst tokenPromise = getToken?.() ?? auth.getToken();\n\t\treturn Promise.resolve(tokenPromise).then((token) => {\n\t\t\tif (token) request.headers.set(\"Authorization\", `Bearer ${token}`);\n\t\t});\n\t}\n}\nfunction kyCredentials(auth) {\n\tif (auth?.type === \"cookie\") return auth.credentials ?? \"include\";\n\treturn \"omit\";\n}\n//#endregion\n//#region src/errors.ts\nvar KeystrokeError = class extends Error {\n\tstatus;\n\tbody;\n\tconstructor(message, status, body) {\n\t\tsuper(message);\n\t\tthis.name = \"KeystrokeError\";\n\t\tthis.status = status;\n\t\tthis.body = body;\n\t}\n};\nasync function toKeystrokeError(error) {\n\tif (!isHTTPError(error)) return new KeystrokeError(error instanceof Error ? error.message : \"Request failed\", 0, null);\n\tconst status = error.response.status;\n\tconst body = error.data ?? null;\n\tconst parsed = parseErrorResponse(body);\n\treturn new KeystrokeError(parsed ? parsed.message ?? parsed.error : `Request failed with status ${status}`, status, body);\n}\n//#endregion\n//#region src/resources/shared.ts\nasync function readJson(response) {\n\treturn response.json();\n}\n//#endregion\n//#region src/resources/agents.ts\nfunction isQueuedAgentPromptResponse(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tif (\"messages\" in value) return false;\n\treturn QueuedAgentPromptResponseSchema.safeParse(value).success;\n}\nfunction listSessionsSearchParams(query) {\n\tif (!query) return {};\n\tconst params = {};\n\tif (query.limit !== void 0) params.limit = String(query.limit);\n\tif (query.cursor) params.cursor = query.cursor;\n\tif (query.status) params.status = query.status;\n\tif (query.source) params.source = query.source;\n\treturn params;\n}\nfunction detailSearchParams$2(query) {\n\tif (!query?.include) return {};\n\treturn { include: query.include };\n}\nfunction createAgentsResource(http) {\n\treturn {\n\t\tasync prompt(id, input) {\n\t\t\tconst body = PromptInputSchema.parse(input);\n\t\t\ttry {\n\t\t\t\tconst response = await http.post(`agents/${id}`, { json: body });\n\t\t\t\tconst data = await readJson(response);\n\t\t\t\tif (response.status === 202) return QueuedAgentPromptResponseSchema.parse(data);\n\t\t\t\treturn PromptResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync listSessions(agentId, query) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`agents/${agentId}/sessions`, { searchParams: listSessionsSearchParams(query) }).json();\n\t\t\t\treturn AgentSessionListResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync getSession(agentId, sessionId, query) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`agents/${agentId}/sessions/${sessionId}`, { searchParams: detailSearchParams$2(query) }).json();\n\t\t\t\treturn AgentSessionDetailResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/resources/connect.ts\nfunction routeFromPath(path) {\n\treturn path.replace(/^\\//, \"\");\n}\nfunction createConnectResource(http) {\n\treturn {\n\t\tasync listProviders() {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(\"connect/providers\").json();\n\t\t\t\treturn ConnectProvidersResponseSchema.parse(data).providers;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync getAuthorizeUrl(path) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(routeFromPath(path)).json();\n\t\t\t\treturn ConnectAuthorizeUrlResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/resources/credentials.ts\nfunction createCredentialsResource(http) {\n\treturn {\n\t\tasync listInstances(options) {\n\t\t\ttry {\n\t\t\t\tconst searchParams = options?.key ? { key: options.key } : void 0;\n\t\t\t\tconst data = await http.get(\"credentials/instances\", { searchParams }).json();\n\t\t\t\treturn CredentialInstanceListResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync createInstance(body) {\n\t\t\ttry {\n\t\t\t\tconst payload = CreateCredentialInstanceBodySchema.parse(body);\n\t\t\t\tconst data = await http.post(\"credentials/instances\", { json: payload }).json();\n\t\t\t\treturn CredentialInstanceRecordSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync updateInstance(id, body) {\n\t\t\ttry {\n\t\t\t\tconst payload = UpdateCredentialInstanceBodySchema.parse(body);\n\t\t\t\tconst data = await http.put(`credentials/instances/${id}`, { json: payload }).json();\n\t\t\t\treturn CredentialInstanceRecordSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync deleteInstance(id) {\n\t\t\ttry {\n\t\t\t\tawait http.delete(`credentials/instances/${id}`);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/resources/health.ts\nfunction createHealthResource(http) {\n\treturn { async check() {\n\t\ttry {\n\t\t\tconst data = await http.get(\"health\").json();\n\t\t\treturn HealthResponseSchema.parse(data);\n\t\t} catch (error) {\n\t\t\tthrow await toKeystrokeError(error);\n\t\t}\n\t} };\n}\n//#endregion\n//#region src/resources/openapi.ts\nfunction createOpenApiResource(http) {\n\treturn { async fetch() {\n\t\ttry {\n\t\t\treturn await http.get(\"openapi.json\").json();\n\t\t} catch (error) {\n\t\t\tthrow await toKeystrokeError(error);\n\t\t}\n\t} };\n}\n//#endregion\n//#region src/resources/triggers.ts\nfunction pollRunBody(options) {\n\tif (!options?.workflows?.length && !options?.attachments?.length) return;\n\treturn {\n\t\t...options.workflows?.length ? { workflows: options.workflows } : {},\n\t\t...options.attachments?.length ? { attachments: options.attachments } : {}\n\t};\n}\nfunction listRunsSearchParams$1(query) {\n\tif (!query) return {};\n\tconst params = {};\n\tif (query.limit !== void 0) params.limit = String(query.limit);\n\tif (query.cursor) params.cursor = query.cursor;\n\tif (query.triggerType) params.triggerType = query.triggerType;\n\treturn params;\n}\nfunction detailSearchParams$1(query) {\n\tif (!query?.include) return {};\n\treturn { include: query.include };\n}\nfunction createTriggersResource(http) {\n\treturn {\n\t\tasync list(query) {\n\t\t\ttry {\n\t\t\t\tconst searchParams = query?.endpoint ? { endpoint: query.endpoint } : void 0;\n\t\t\t\tconst data = await http.get(\"triggers\", { searchParams }).json();\n\t\t\t\treturn TriggerListResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync get(id) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`triggers/${id}`).json();\n\t\t\t\tconst list = TriggerListResponseSchema.safeParse(data);\n\t\t\t\tif (list.success) return list.data;\n\t\t\t\treturn TriggerDetailResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync webhookUrl(id) {\n\t\t\tconst result = await this.get(id);\n\t\t\tconst webhookUrl = \"triggers\" in result ? result.triggers.find((entry) => entry.webhookUrl)?.webhookUrl : result.webhookUrl;\n\t\t\tif (!webhookUrl) throw new KeystrokeError(`Webhook URL not found: ${id}`, 404, { error: \"Not found\" });\n\t\t\treturn webhookUrl;\n\t\t},\n\t\tasync webhook(endpoint, body = {}, options = {}) {\n\t\t\ttry {\n\t\t\t\tconst searchParams = options.token ? { token: options.token } : void 0;\n\t\t\t\tconst normalized = endpoint.replace(/^\\/+|\\/+$/g, \"\").replace(/^triggers\\/?/, \"\");\n\t\t\t\treturn await http.post(`triggers/${normalized}`, {\n\t\t\t\t\tjson: body,\n\t\t\t\t\tsearchParams\n\t\t\t\t}).json();\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync poll(id, options = {}) {\n\t\t\ttry {\n\t\t\t\tconst { group, ...target } = options;\n\t\t\t\tconst json = pollRunBody(target);\n\t\t\t\tconst path = group ? `triggers/polls/${id}/run` : `triggers/${id}/poll`;\n\t\t\t\tconst data = await readJson(await http.post(path, json ? { json } : void 0));\n\t\t\t\tPollRunResponseSchema.parse(data);\n\t\t\t\treturn data;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync runPollGroup(pollId, options = {}) {\n\t\t\treturn this.poll(pollId, {\n\t\t\t\t...options,\n\t\t\t\tgroup: true\n\t\t\t});\n\t\t},\n\t\tasync listRuns(attachmentId, query) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`triggers/${attachmentId}/runs`, { searchParams: listRunsSearchParams$1(query) }).json();\n\t\t\t\treturn TriggerRunListResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync getRun(attachmentId, runId, query) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`triggers/${attachmentId}/runs/${runId}`, { searchParams: detailSearchParams$1(query) }).json();\n\t\t\t\treturn TriggerRunDetailResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t}\n\t};\n}\nfunction isSkippedTriggerResponse(value) {\n\treturn SkipResponseSchema.safeParse(value).success;\n}\n//#endregion\n//#region src/resources/workflows.ts\nfunction isQueuedRunResponse(value) {\n\treturn QueuedRunResponseSchema.safeParse(value).success;\n}\nfunction listRunsSearchParams(query) {\n\tif (!query) return {};\n\tconst params = {};\n\tif (query.limit !== void 0) params.limit = String(query.limit);\n\tif (query.cursor) params.cursor = query.cursor;\n\tif (query.status) params.status = query.status;\n\tif (query.trigger) params.trigger = query.trigger;\n\treturn params;\n}\nfunction detailSearchParams(query) {\n\tif (!query?.include) return {};\n\treturn { include: query.include };\n}\nfunction createWorkflowsResource(http) {\n\treturn {\n\t\tasync run(id, input = {}) {\n\t\t\ttry {\n\t\t\t\tconst response = await http.post(`workflows/${id}`, { json: input });\n\t\t\t\tconst data = await readJson(response);\n\t\t\t\tif (response.status === 202) return QueuedRunResponseSchema.parse(data);\n\t\t\t\treturn data;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync listRuns(workflowId, query) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`workflows/${workflowId}/runs`, { searchParams: listRunsSearchParams(query) }).json();\n\t\t\t\treturn WorkflowRunListResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t},\n\t\tasync getRun(workflowId, runId, query) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`workflows/${workflowId}/runs/${runId}`, { searchParams: detailSearchParams(query) }).json();\n\t\t\t\treturn WorkflowRunDetailResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toKeystrokeError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/index.ts\nfunction createKeystrokeClient(options) {\n\tconst auth = options.auth ?? { type: \"none\" };\n\tconst base = normalizeBaseUrl(options.baseUrl);\n\tconst getActiveOrganizationId = options.getActiveOrganizationId;\n\tconst http = ky.create({\n\t\tprefix: base === \"\" ? void 0 : `${base}/`,\n\t\tcredentials: kyCredentials(auth),\n\t\thooks: { beforeRequest: [({ request }) => {\n\t\t\tapplyActiveOrganizationHeader(request, getActiveOrganizationId?.());\n\t\t\treturn applyAuthHeaders(request, auth);\n\t\t}] },\n\t\t...options.ky\n\t});\n\treturn {\n\t\thttp,\n\t\thealth: createHealthResource(http),\n\t\tconnect: createConnectResource(http),\n\t\tcredentials: createCredentialsResource(http),\n\t\topenapi: createOpenApiResource(http),\n\t\tagents: createAgentsResource(http),\n\t\tworkflows: createWorkflowsResource(http),\n\t\ttriggers: createTriggersResource(http)\n\t};\n}\n//#endregion\nexport { KeystrokeError, createKeystrokeClient, isQueuedAgentPromptResponse, isQueuedRunResponse, isSkippedTriggerResponse, toKeystrokeError };\n\n//# sourceMappingURL=index.mjs.map","import { Entry } from \"@napi-rs/keyring\";\n\nconst SERVICE = \"keystroke\";\n\nfunction accountForWebUrl(webUrl: string): string {\n return new URL(webUrl).hostname;\n}\n\nexport function getAccessToken(webUrl: string): string | undefined {\n const entry = new Entry(SERVICE, accountForWebUrl(webUrl));\n const password = entry.getPassword();\n return password === null ? undefined : password;\n}\n\nexport function setAccessToken(webUrl: string, token: string): void {\n const entry = new Entry(SERVICE, accountForWebUrl(webUrl));\n entry.setPassword(token);\n}\n\nexport function clearAccessToken(webUrl: string): void {\n const entry = new Entry(SERVICE, accountForWebUrl(webUrl));\n entry.deletePassword();\n}\n","import { originFromPublicUrl } from \"@keystrokehq/shared\";\n\nexport const DEFAULT_WEB_URL = \"https://app.keystroke.ai\";\nexport const DEFAULT_PLATFORM_URL = \"https://api.keystroke.ai\";\nexport const LOCAL_WEB_URL = \"http://localhost:3000\";\nexport const LOCAL_PLATFORM_URL = \"http://localhost:3002\";\n\nexport type ResolvePlatformUrlOptions = {\n platformUrl?: string;\n /** Used when webUrl does not match a known deployment. */\n fallback?: string;\n};\n\nfunction webOriginFromUrl(webUrl: string): string {\n return originFromPublicUrl(webUrl, webUrl.replace(/\\/+$/, \"\"));\n}\n\n/** Known web origins with a fixed platform API — undefined for custom/staging URLs. */\nexport function knownPlatformUrlForWebUrl(webUrl: string): string | undefined {\n const webOrigin = webOriginFromUrl(webUrl);\n\n if (webOrigin === LOCAL_WEB_URL || webOrigin === \"http://127.0.0.1:3000\") {\n return LOCAL_PLATFORM_URL;\n }\n\n if (webOrigin === DEFAULT_WEB_URL) {\n return DEFAULT_PLATFORM_URL;\n }\n\n return undefined;\n}\n\nexport function resolvePlatformUrlForWebUrl(\n webUrl: string,\n options: ResolvePlatformUrlOptions = {},\n): string {\n const explicit = options.platformUrl?.trim();\n if (explicit) {\n return explicit.replace(/\\/+$/, \"\");\n }\n\n const known = knownPlatformUrlForWebUrl(webUrl);\n if (known) {\n return known;\n }\n\n const fallback = options.fallback?.trim() || DEFAULT_PLATFORM_URL;\n return fallback.replace(/\\/+$/, \"\");\n}\n","import Conf from \"conf\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nimport {\n DEFAULT_PLATFORM_URL,\n DEFAULT_WEB_URL,\n knownPlatformUrlForWebUrl,\n resolvePlatformUrlForWebUrl,\n} from \"./resolve-platform-url\";\n\nexport type ApiTargetMode = \"local\" | \"platform\";\n\nexport type CliConfig = {\n serverUrl: string;\n webUrl: string;\n platformUrl: string;\n activeOrganizationId?: string;\n activeProjectId?: string;\n apiTarget?: ApiTargetMode;\n};\n\nexport function getCliConfigDir(cwd = join(homedir(), \".keystroke\")): string {\n return cwd;\n}\n\nexport function getConfigDir(config: Conf<CliConfig>): string {\n return dirname(config.path);\n}\n\nexport function getEffectiveApiTarget(config: Conf<CliConfig>): ApiTargetMode {\n const explicit = config.get(\"apiTarget\");\n if (explicit === \"local\" || explicit === \"platform\") {\n return explicit;\n }\n\n return \"local\";\n}\n\nfunction syncPlatformUrlWithWebUrl(config: Conf<CliConfig>): void {\n const webUrl = config.get(\"webUrl\");\n const known = knownPlatformUrlForWebUrl(webUrl);\n if (!known) {\n return;\n }\n\n const stored = config.get(\"platformUrl\");\n if (stored !== known) {\n config.set(\"platformUrl\", known);\n }\n}\n\nexport function createCliConfig(cwd = getCliConfigDir()): Conf<CliConfig> {\n const config = new Conf<CliConfig>({\n projectName: \"keystroke\",\n cwd,\n schema: {\n serverUrl: {\n type: \"string\",\n default: \"http://localhost:3001\",\n },\n webUrl: {\n type: \"string\",\n default: DEFAULT_WEB_URL,\n },\n platformUrl: {\n type: \"string\",\n default: DEFAULT_PLATFORM_URL,\n },\n activeOrganizationId: {\n type: \"string\",\n },\n activeProjectId: {\n type: \"string\",\n },\n apiTarget: {\n type: \"string\",\n enum: [\"local\", \"platform\"],\n },\n },\n });\n\n syncPlatformUrlWithWebUrl(config);\n return config;\n}\n\nexport function getServerUrl(config: Conf<CliConfig>): string {\n return config.get(\"serverUrl\");\n}\n\nexport function getWebUrl(config: Conf<CliConfig>): string {\n return config.get(\"webUrl\");\n}\n\nexport function getPlatformUrl(config: Conf<CliConfig>): string {\n return resolvePlatformUrlForWebUrl(getWebUrl(config), {\n fallback: config.get(\"platformUrl\"),\n });\n}\n","import type { AuthStrategy } from \"@keystrokehq/sdk\";\nimport type Conf from \"conf\";\nimport { getAccessToken } from \"./credentials\";\nimport { getWebUrl, type CliConfig } from \"../config\";\n\n/** Returns bearer auth when a token is stored; otherwise none. */\nexport function resolveCliAuth(config: Conf<CliConfig>): AuthStrategy {\n const webUrl = getWebUrl(config);\n const token = getAccessToken(webUrl);\n if (!token) {\n return { type: \"none\" };\n }\n\n return {\n type: \"bearer\",\n getToken: () => token,\n };\n}\n","import { createKeystrokeClient, type KeystrokeClient } from \"@keystrokehq/sdk\";\nimport type Conf from \"conf\";\nimport { resolveCliAuth } from \"./auth/resolve-cli-auth\";\nimport type { CliConfig } from \"./config\";\n\nexport function createCliClient(\n config: Conf<CliConfig>,\n options: { baseUrl: string; platform?: boolean },\n): KeystrokeClient {\n return createKeystrokeClient({\n baseUrl: options.baseUrl,\n auth: resolveCliAuth(config),\n getActiveOrganizationId: options.platform\n ? () => config.get(\"activeOrganizationId\") ?? null\n : undefined,\n });\n}\n","import ky, { isHTTPError } from \"ky\";\nimport { ACTIVE_ORG_HEADER, AcceptOrganizationInvitationResponseSchema, ActiveOrganizationResponseSchema, CompleteProjectArtifactResponseSchema, CreateOrganizationRequestSchema, CreateOrganizationResponseSchema, CreateProjectArtifactResponseSchema, CreateProjectRequestSchema, CreateProjectResponseSchema, DeclineOrganizationInvitationResponseSchema, ErrorResponseSchema, HealthResponseSchema, InviteOrganizationMembersRequestSchema, InviteOrganizationMembersResponseSchema, ListOrganizationInvitationsResponseSchema, ListOrganizationMembersResponseSchema, ListOrganizationsResponseSchema, ListProjectsResponseSchema, PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, ProjectReachabilityResponseSchema, ProjectResponseSchema, SetActiveOrganizationRequestSchema, SlugAvailabilityResponseSchema, UpdateOrganizationMemberRequestSchema, UpdateOrganizationMemberResponseSchema, UpdateOrganizationRequestSchema } from \"@keystrokehq/shared\";\n//#region src/platform/active-organization.ts\nconst STORAGE_KEY = \"keystroke-active-org-id\";\nfunction readActiveOrganizationId() {\n\tif (typeof localStorage === \"undefined\") return null;\n\treturn localStorage.getItem(STORAGE_KEY);\n}\nfunction writeActiveOrganizationId(organizationId) {\n\tif (typeof localStorage === \"undefined\") return;\n\tif (organizationId) {\n\t\tlocalStorage.setItem(STORAGE_KEY, organizationId);\n\t\treturn;\n\t}\n\tlocalStorage.removeItem(STORAGE_KEY);\n}\n//#endregion\n//#region src/platform/auth.ts\nfunction normalizeBaseUrl(baseUrl) {\n\treturn baseUrl.replace(/\\/+$/, \"\");\n}\nfunction applyAuthHeaders(request, auth, getToken) {\n\tif (!auth || auth.type === \"none\" || auth.type === \"cookie\") return;\n\tif (auth.type === \"bearer\") {\n\t\tconst tokenPromise = getToken?.() ?? auth.getToken();\n\t\treturn Promise.resolve(tokenPromise).then((token) => {\n\t\t\tif (token) request.headers.set(\"Authorization\", `Bearer ${token}`);\n\t\t});\n\t}\n}\nfunction applyActiveOrganizationHeader(request, organizationId) {\n\tif (organizationId) request.headers.set(ACTIVE_ORG_HEADER, organizationId);\n}\nfunction kyCredentials(auth) {\n\tif (auth?.type === \"cookie\") return auth.credentials ?? \"include\";\n\treturn \"omit\";\n}\n/** Browser client — sends Better Auth session cookies with platform API requests. */\nfunction browserAuthStrategy() {\n\treturn {\n\t\ttype: \"cookie\",\n\t\tcredentials: \"include\"\n\t};\n}\n//#endregion\n//#region src/platform/errors.ts\nvar PlatformError = class extends Error {\n\tstatus;\n\tbody;\n\tcode;\n\tconstructor(message, status, body, code) {\n\t\tsuper(message);\n\t\tthis.name = \"PlatformError\";\n\t\tthis.status = status;\n\t\tthis.body = body;\n\t\tthis.code = code;\n\t}\n};\nasync function toPlatformError(error) {\n\tif (!isHTTPError(error)) return new PlatformError(error instanceof Error ? error.message : \"Request failed\", 0, null);\n\tconst status = error.response.status;\n\tconst body = error.data ?? null;\n\tconst parsed = ErrorResponseSchema.safeParse(body);\n\treturn new PlatformError(parsed.success ? parsed.data.error : `Request failed with status ${status}`, status, body, parsed.success ? parsed.data.code : void 0);\n}\n//#endregion\n//#region src/platform/resources/artifacts.ts\nfunction createArtifactsResource(http) {\n\treturn {\n\t\tasync create(projectId) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(`/api/projects/${encodeURIComponent(projectId)}/artifacts`).json();\n\t\t\t\treturn CreateProjectArtifactResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync complete(projectId, artifactId) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(`/api/projects/${encodeURIComponent(projectId)}/artifacts/${encodeURIComponent(artifactId)}/complete`).json();\n\t\t\t\treturn CompleteProjectArtifactResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/platform/resources/health.ts\nfunction createHealthResource(http) {\n\treturn { async check() {\n\t\ttry {\n\t\t\tconst data = await http.get(\"/health\").json();\n\t\t\treturn HealthResponseSchema.parse(data);\n\t\t} catch (error) {\n\t\t\tthrow await toPlatformError(error);\n\t\t}\n\t} };\n}\n//#endregion\n//#region src/platform/resources/mock-registry.ts\nconst registry = /* @__PURE__ */ new Map();\n/**\n* Wraps a mock implementation, registering it in the manifest. The returned\n* function is the unchanged implementation — `mock()` only adds bookkeeping.\n*/\nfunction mock(entry, impl) {\n\tregistry.set(`${entry.domain}.${entry.method}`, entry);\n\treturn impl;\n}\n/** The current inventory of mocked methods. Populated once a client is created. */\nfunction mockManifest() {\n\treturn [...registry.values()];\n}\n//#endregion\n//#region src/platform/resources/organizations.ts\nfunction createOrganizationsResource(http, options = {}) {\n\treturn {\n\t\tasync list() {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(\"/api/organizations\").json();\n\t\t\t\treturn ListOrganizationsResponseSchema.parse(data).organizations;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync getActive() {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(\"/api/organizations/active\").json();\n\t\t\t\treturn ActiveOrganizationResponseSchema.parse(data).organization;\n\t\t\t} catch (error) {\n\t\t\t\tif (isHTTPError(error) && error.response.status === 401) return null;\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync setActive(input) {\n\t\t\tconst body = SetActiveOrganizationRequestSchema.parse(input);\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(\"/api/organizations/active\", { json: body }).json();\n\t\t\t\tconst organization = ActiveOrganizationResponseSchema.parse(data).organization;\n\t\t\t\tif (!organization) throw new Error(\"Active organization was not returned\");\n\t\t\t\toptions.onActiveOrganizationChange?.(organization.organization.id);\n\t\t\t\treturn organization;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync clearActive() {\n\t\t\ttry {\n\t\t\t\tawait http.delete(\"/api/organizations/active\");\n\t\t\t\toptions.onActiveOrganizationChange?.(null);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync update(input) {\n\t\t\tconst body = UpdateOrganizationRequestSchema.parse(input);\n\t\t\ttry {\n\t\t\t\tconst data = await http.patch(\"/api/organizations/active\", { json: body }).json();\n\t\t\t\tconst organization = ActiveOrganizationResponseSchema.parse(data).organization;\n\t\t\t\tif (!organization) throw new Error(\"Active organization was not returned\");\n\t\t\t\treturn organization;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync create(input) {\n\t\t\tconst body = CreateOrganizationRequestSchema.parse(input);\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(\"/api/organizations\", { json: body }).json();\n\t\t\t\treturn CreateOrganizationResponseSchema.parse(data).organization;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tupdateProfile: mock({\n\t\t\tdomain: \"organizations\",\n\t\t\tmethod: \"updateProfile\",\n\t\t\tplannedEndpoint: \"PATCH /api/organizations/active (name)\"\n\t\t}, async (input) => {\n\t\t\tconst name = input.name.trim();\n\t\t\tif (!name) throw new Error(\"Organization name is required\");\n\t\t\tconst organizationId = options.getActiveOrganizationId?.()?.trim();\n\t\t\tif (!organizationId) throw new Error(\"Active organization is required to update profile\");\n\t\t\treturn {\n\t\t\t\tid: organizationId,\n\t\t\t\tname\n\t\t\t};\n\t\t}),\n\t\tasync checkSlug(slug, options = {}) {\n\t\t\tconst searchParams = new URLSearchParams({ slug });\n\t\t\tif (options.excludeOrganizationId) searchParams.set(\"excludeOrganizationId\", options.excludeOrganizationId);\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`/api/organizations/slug-available?${searchParams}`).json();\n\t\t\t\treturn SlugAvailabilityResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/platform/resources/projects.ts\nfunction createProjectsResource(http) {\n\treturn {\n\t\tasync list() {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(\"/api/projects\").json();\n\t\t\t\treturn ListProjectsResponseSchema.parse(data).projects;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync create(input) {\n\t\t\tconst body = CreateProjectRequestSchema.parse(input);\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(\"/api/projects\", { json: body }).json();\n\t\t\t\treturn CreateProjectResponseSchema.parse(data).project;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync get(projectId) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`/api/projects/${encodeURIComponent(projectId)}`).json();\n\t\t\t\treturn ProjectResponseSchema.parse(data).project;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tupdate: mock({\n\t\t\tdomain: \"projects\",\n\t\t\tmethod: \"update\",\n\t\t\tplannedEndpoint: \"PATCH /api/projects/:id\"\n\t\t}, async (projectId, patch) => {\n\t\t\treturn {\n\t\t\t\tid: projectId,\n\t\t\t\t...patch\n\t\t\t};\n\t\t}),\n\t\tasync checkReachability(projectId) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(`/api/projects/${encodeURIComponent(projectId)}/reachability`, { timeout: PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS }).json();\n\t\t\t\treturn ProjectReachabilityResponseSchema.parse(data).reachable;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/platform/resources/mock-project-settings.ts\nconst DEFAULT_PROJECT_SETTINGS = {\n\tdescription: \"\",\n\tdefaultRole: \"editor\",\n\tinvitePermission: \"admin\"\n};\nconst MOCK_STORAGE_KEY$4 = \"keystroke:mock-project-settings:v1\";\nfunction getBrowserLocalStorage$4() {\n\tif (typeof globalThis !== \"object\") return null;\n\treturn globalThis.localStorage ?? null;\n}\nfunction normalizeDefaultRole(value) {\n\treturn value === \"admin\" ? \"admin\" : \"editor\";\n}\nfunction normalizeInvitePermission(value) {\n\treturn value === \"all\" ? \"all\" : \"admin\";\n}\nfunction normalizeProjectSettings(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_PROJECT_SETTINGS;\n\tconst settings = value;\n\treturn {\n\t\tdescription: typeof settings.description === \"string\" ? settings.description : \"\",\n\t\tdefaultRole: normalizeDefaultRole(settings.defaultRole),\n\t\tinvitePermission: normalizeInvitePermission(settings.invitePermission)\n\t};\n}\nfunction mergeProjectSettings(current, patch) {\n\treturn normalizeProjectSettings({\n\t\t...current,\n\t\t...patch\n\t});\n}\nfunction readSettingsStore() {\n\tconst localStorage = getBrowserLocalStorage$4();\n\tif (!localStorage) return {};\n\ttry {\n\t\tconst raw = localStorage.getItem(MOCK_STORAGE_KEY$4);\n\t\tif (!raw) return {};\n\t\tconst parsed = JSON.parse(raw);\n\t\tif (!parsed || typeof parsed !== \"object\") return {};\n\t\treturn Object.fromEntries(Object.entries(parsed).map(([projectId, value]) => [projectId, normalizeProjectSettings(value)]));\n\t} catch {\n\t\treturn {};\n\t}\n}\nfunction writeSettingsStore(store) {\n\tconst localStorage = getBrowserLocalStorage$4();\n\tif (!localStorage) return;\n\ttry {\n\t\tlocalStorage.setItem(MOCK_STORAGE_KEY$4, JSON.stringify(store));\n\t} catch {}\n}\nfunction requireProjectId(projectId) {\n\tconst trimmed = projectId.trim();\n\tif (!trimmed) throw new Error(\"Project settings require a project id\");\n\treturn trimmed;\n}\nfunction createProjectSettingsResource() {\n\treturn {\n\t\tget: mock({\n\t\t\tdomain: \"projectSettings\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/projects/:id/settings\"\n\t\t}, async (projectId) => {\n\t\t\tconst id = requireProjectId(projectId);\n\t\t\treturn readSettingsStore()[id] ?? DEFAULT_PROJECT_SETTINGS;\n\t\t}),\n\t\tupdate: mock({\n\t\t\tdomain: \"projectSettings\",\n\t\t\tmethod: \"update\",\n\t\t\tplannedEndpoint: \"PATCH /api/projects/:id/settings\"\n\t\t}, async (projectId, patch) => {\n\t\t\tconst id = requireProjectId(projectId);\n\t\t\tconst store = readSettingsStore();\n\t\t\tconst next = mergeProjectSettings(store[id] ?? DEFAULT_PROJECT_SETTINGS, patch);\n\t\t\twriteSettingsStore({\n\t\t\t\t...store,\n\t\t\t\t[id]: next\n\t\t\t});\n\t\t\treturn next;\n\t\t})\n\t};\n}\n//#endregion\n//#region src/platform/resources/invitations.ts\nfunction createInvitationsResource(http) {\n\treturn {\n\t\tasync list() {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(\"/api/invitations\").json();\n\t\t\t\treturn ListOrganizationInvitationsResponseSchema.parse(data).invitations;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync accept(invitationId) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(`/api/invitations/${encodeURIComponent(invitationId)}/accept`).json();\n\t\t\t\treturn AcceptOrganizationInvitationResponseSchema.parse(data).organization;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync decline(invitationId) {\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(`/api/invitations/${encodeURIComponent(invitationId)}/decline`).json();\n\t\t\t\tDeclineOrganizationInvitationResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/platform/resources/members.ts\nfunction createMembersResource$1(http) {\n\treturn {\n\t\tasync listOrganizationMembers() {\n\t\t\ttry {\n\t\t\t\tconst data = await http.get(\"/api/members\").json();\n\t\t\t\treturn ListOrganizationMembersResponseSchema.parse(data).members;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync inviteOrganizationMembers(input) {\n\t\t\tconst body = InviteOrganizationMembersRequestSchema.parse(input);\n\t\t\ttry {\n\t\t\t\tconst data = await http.post(\"/api/members/invitations\", { json: body }).json();\n\t\t\t\treturn InviteOrganizationMembersResponseSchema.parse(data);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync updateOrganizationMember(userId, input) {\n\t\t\tconst body = UpdateOrganizationMemberRequestSchema.parse(input);\n\t\t\ttry {\n\t\t\t\tconst data = await http.patch(`/api/members/${encodeURIComponent(userId)}`, { json: body }).json();\n\t\t\t\treturn UpdateOrganizationMemberResponseSchema.parse(data).member;\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t},\n\t\tasync removeOrganizationMember(userId) {\n\t\t\ttry {\n\t\t\t\tawait http.delete(`/api/members/${encodeURIComponent(userId)}`);\n\t\t\t} catch (error) {\n\t\t\t\tthrow await toPlatformError(error);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/platform/resources/mock-seed.ts\nconst APP_CATALOG_BASE = [\n\t{\n\t\tid: \"app-gmail\",\n\t\tname: \"Gmail\",\n\t\tdescription: \"Email trigger and delivery integration.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-slack\",\n\t\tname: \"Slack\",\n\t\tdescription: \"Post messages and handle approvals via Slack channels.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-github\",\n\t\tname: \"GitHub\",\n\t\tdescription: \"React to repo events and manage pull requests.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-anthropic\",\n\t\tname: \"Anthropic\",\n\t\tdescription: \"Claude models for agent and workflow AI steps.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-attio\",\n\t\tname: \"Attio\",\n\t\tdescription: \"CRM operations for deals, contacts, and notes.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-openai\",\n\t\tname: \"OpenAI\",\n\t\tdescription: \"GPT models and embeddings for AI-powered steps.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-airtable\",\n\t\tname: \"Airtable\",\n\t\tdescription: \"Read and write records in Airtable bases.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-google-sheets\",\n\t\tname: \"Google Sheets\",\n\t\tdescription: \"Read, update, and append rows in spreadsheets.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-google-drive\",\n\t\tname: \"Google Drive\",\n\t\tdescription: \"Find, read, and organize files across shared drives.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-google-calendar\",\n\t\tname: \"Google Calendar\",\n\t\tdescription: \"Create events, check availability, and coordinate meetings.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-notion\",\n\t\tname: \"Notion\",\n\t\tdescription: \"Query databases, create pages, and update workspace docs.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-linear\",\n\t\tname: \"Linear\",\n\t\tdescription: \"Create issues, update triage queues, and comment on work.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-jira\",\n\t\tname: \"Jira\",\n\t\tdescription: \"Sync issues, transitions, comments, and project fields.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-asana\",\n\t\tname: \"Asana\",\n\t\tdescription: \"Create tasks, update projects, and track team work.\",\n\t\tcategory: \"Project Management\"\n\t},\n\t{\n\t\tid: \"app-trello\",\n\t\tname: \"Trello\",\n\t\tdescription: \"Move cards, update boards, and automate checklist work.\",\n\t\tcategory: \"Project Management\"\n\t},\n\t{\n\t\tid: \"app-clickup\",\n\t\tname: \"ClickUp\",\n\t\tdescription: \"Manage tasks, docs, custom fields, and workspace automations.\",\n\t\tcategory: \"Project Management\"\n\t},\n\t{\n\t\tid: \"app-monday\",\n\t\tname: \"monday.com\",\n\t\tdescription: \"Automate boards, items, updates, and team workflows.\",\n\t\tcategory: \"Project Management\"\n\t},\n\t{\n\t\tid: \"app-discord\",\n\t\tname: \"Discord\",\n\t\tdescription: \"Post updates, listen for commands, and manage communities.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-microsoft-teams\",\n\t\tname: \"Microsoft Teams\",\n\t\tdescription: \"Send messages, route approvals, and coordinate team channels.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-google-chat\",\n\t\tname: \"Google Chat\",\n\t\tdescription: \"Send messages and surface agent responses in Google Chat.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-telegram\",\n\t\tname: \"Telegram\",\n\t\tdescription: \"Send bot messages and respond to chats and groups.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-whatsapp\",\n\t\tname: \"WhatsApp\",\n\t\tdescription: \"Send WhatsApp messages and respond to customer threads.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-hubspot\",\n\t\tname: \"HubSpot\",\n\t\tdescription: \"Manage contacts, companies, deals, tickets, and timelines.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-salesforce\",\n\t\tname: \"Salesforce\",\n\t\tdescription: \"Read and update leads, accounts, opportunities, and cases.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-pipedrive\",\n\t\tname: \"Pipedrive\",\n\t\tdescription: \"Move deals, update contacts, and automate sales pipelines.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-intercom\",\n\t\tname: \"Intercom\",\n\t\tdescription: \"Route conversations, update users, and summarize support.\",\n\t\tcategory: \"Support\"\n\t},\n\t{\n\t\tid: \"app-zendesk\",\n\t\tname: \"Zendesk\",\n\t\tdescription: \"Create tickets, reply to customers, and sync support context.\",\n\t\tcategory: \"Support\"\n\t},\n\t{\n\t\tid: \"app-freshdesk\",\n\t\tname: \"Freshdesk\",\n\t\tdescription: \"Automate ticket routing, replies, and customer updates.\",\n\t\tcategory: \"Support\"\n\t},\n\t{\n\t\tid: \"app-front\",\n\t\tname: \"Front\",\n\t\tdescription: \"Manage shared inboxes, comments, tags, and customer replies.\",\n\t\tcategory: \"Support\"\n\t},\n\t{\n\t\tid: \"app-stripe\",\n\t\tname: \"Stripe\",\n\t\tdescription: \"React to payments, manage customers, and reconcile billing.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-quickbooks\",\n\t\tname: \"QuickBooks\",\n\t\tdescription: \"Create invoices, sync customers, and reconcile accounting data.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-xero\",\n\t\tname: \"Xero\",\n\t\tdescription: \"Automate invoices, contacts, bills, and accounting workflows.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-shopify\",\n\t\tname: \"Shopify\",\n\t\tdescription: \"Process orders, update products, and coordinate fulfillment.\",\n\t\tcategory: \"Commerce\"\n\t},\n\t{\n\t\tid: \"app-woocommerce\",\n\t\tname: \"WooCommerce\",\n\t\tdescription: \"Sync orders, customers, products, and storefront events.\",\n\t\tcategory: \"Commerce\"\n\t},\n\t{\n\t\tid: \"app-webflow\",\n\t\tname: \"Webflow\",\n\t\tdescription: \"Publish CMS items, update site content, and trigger workflows.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-mailchimp\",\n\t\tname: \"Mailchimp\",\n\t\tdescription: \"Manage audiences, campaigns, tags, and email automations.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-sendgrid\",\n\t\tname: \"SendGrid\",\n\t\tdescription: \"Send transactional email and react to delivery events.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-typeform\",\n\t\tname: \"Typeform\",\n\t\tdescription: \"Capture form responses and enrich follow-up workflows.\",\n\t\tcategory: \"Forms\"\n\t},\n\t{\n\t\tid: \"app-surveymonkey\",\n\t\tname: \"SurveyMonkey\",\n\t\tdescription: \"Collect survey responses and sync insights into workflows.\",\n\t\tcategory: \"Forms\"\n\t},\n\t{\n\t\tid: \"app-calendly\",\n\t\tname: \"Calendly\",\n\t\tdescription: \"React to bookings, cancellations, and scheduling updates.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-docusign\",\n\t\tname: \"DocuSign\",\n\t\tdescription: \"Send envelopes, track signatures, and file completed agreements.\",\n\t\tcategory: \"Documents\"\n\t},\n\t{\n\t\tid: \"app-dropbox\",\n\t\tname: \"Dropbox\",\n\t\tdescription: \"Read files, upload assets, and organize shared folders.\",\n\t\tcategory: \"Files\"\n\t},\n\t{\n\t\tid: \"app-box\",\n\t\tname: \"Box\",\n\t\tdescription: \"Search enterprise files, update folders, and manage documents.\",\n\t\tcategory: \"Files\"\n\t},\n\t{\n\t\tid: \"app-figma\",\n\t\tname: \"Figma\",\n\t\tdescription: \"Inspect designs, sync comments, and coordinate design handoffs.\",\n\t\tcategory: \"Design\"\n\t},\n\t{\n\t\tid: \"app-canva\",\n\t\tname: \"Canva\",\n\t\tdescription: \"Create design assets and automate content production.\",\n\t\tcategory: \"Design\"\n\t},\n\t{\n\t\tid: \"app-sentry\",\n\t\tname: \"Sentry\",\n\t\tdescription: \"Triage errors, summarize issues, and route incidents.\",\n\t\tcategory: \"Observability\"\n\t},\n\t{\n\t\tid: \"app-datadog\",\n\t\tname: \"Datadog\",\n\t\tdescription: \"Query metrics, inspect monitors, and coordinate incidents.\",\n\t\tcategory: \"Observability\"\n\t},\n\t{\n\t\tid: \"app-pagerduty\",\n\t\tname: \"PagerDuty\",\n\t\tdescription: \"Create incidents, page responders, and automate escalations.\",\n\t\tcategory: \"Observability\"\n\t},\n\t{\n\t\tid: \"app-gitlab\",\n\t\tname: \"GitLab\",\n\t\tdescription: \"Manage merge requests, issues, pipelines, and repositories.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-bitbucket\",\n\t\tname: \"Bitbucket\",\n\t\tdescription: \"Automate pull requests, branches, and repository workflows.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-vercel\",\n\t\tname: \"Vercel\",\n\t\tdescription: \"Track deployments, manage projects, and react to build events.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-netlify\",\n\t\tname: \"Netlify\",\n\t\tdescription: \"Automate deploys, forms, sites, and build notifications.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-supabase\",\n\t\tname: \"Supabase\",\n\t\tdescription: \"Query databases, manage auth, and automate backend workflows.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-postgres\",\n\t\tname: \"Postgres\",\n\t\tdescription: \"Run SQL queries and sync structured data from Postgres.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-snowflake\",\n\t\tname: \"Snowflake\",\n\t\tdescription: \"Query warehouse data and automate analytics workflows.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-databricks\",\n\t\tname: \"Databricks\",\n\t\tdescription: \"Run jobs, query lakehouse data, and coordinate pipelines.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-segment\",\n\t\tname: \"Segment\",\n\t\tdescription: \"Route customer events and enrich downstream automations.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-twilio\",\n\t\tname: \"Twilio\",\n\t\tdescription: \"Send SMS, manage calls, and coordinate customer notifications.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-zoom\",\n\t\tname: \"Zoom\",\n\t\tdescription: \"Schedule meetings, manage recordings, and notify attendees.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-loom\",\n\t\tname: \"Loom\",\n\t\tdescription: \"Create video handoffs, summarize recordings, and share updates.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-miro\",\n\t\tname: \"Miro\",\n\t\tdescription: \"Create boards, sync cards, and coordinate visual planning.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-coda\",\n\t\tname: \"Coda\",\n\t\tdescription: \"Update docs, tables, packs, and team operating workflows.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-confluence\",\n\t\tname: \"Confluence\",\n\t\tdescription: \"Search knowledge bases and create or update documentation.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-aws\",\n\t\tname: \"AWS\",\n\t\tdescription: \"Coordinate cloud resources, events, queues, and infrastructure.\",\n\t\tcategory: \"Infrastructure\"\n\t},\n\t{\n\t\tid: \"app-google-cloud\",\n\t\tname: \"Google Cloud\",\n\t\tdescription: \"Manage cloud jobs, storage, Pub/Sub, and deployment workflows.\",\n\t\tcategory: \"Infrastructure\"\n\t},\n\t{\n\t\tid: \"app-azure\",\n\t\tname: \"Azure\",\n\t\tdescription: \"Automate Azure resources, queues, deployments, and identities.\",\n\t\tcategory: \"Infrastructure\"\n\t},\n\t{\n\t\tid: \"app-cloudflare\",\n\t\tname: \"Cloudflare\",\n\t\tdescription: \"Manage DNS, Workers, Pages, queues, and edge automations.\",\n\t\tcategory: \"Infrastructure\"\n\t},\n\t{\n\t\tid: \"app-docker\",\n\t\tname: \"Docker\",\n\t\tdescription: \"Coordinate images, registries, builds, and deployment events.\",\n\t\tcategory: \"Infrastructure\"\n\t},\n\t{\n\t\tid: \"app-kubernetes\",\n\t\tname: \"Kubernetes\",\n\t\tdescription: \"Inspect clusters, trigger jobs, and automate operations.\",\n\t\tcategory: \"Infrastructure\"\n\t},\n\t{\n\t\tid: \"app-algolia\",\n\t\tname: \"Algolia\",\n\t\tdescription: \"Sync search indexes and automate content discovery workflows.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-elasticsearch\",\n\t\tname: \"Elasticsearch\",\n\t\tdescription: \"Query search clusters and automate log or document workflows.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-redis\",\n\t\tname: \"Redis\",\n\t\tdescription: \"Read cache data, coordinate queues, and manage realtime state.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-pinecone\",\n\t\tname: \"Pinecone\",\n\t\tdescription: \"Manage vector indexes and power retrieval workflows.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-plaid\",\n\t\tname: \"Plaid\",\n\t\tdescription: \"Connect financial accounts and automate banking data flows.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-brex\",\n\t\tname: \"Brex\",\n\t\tdescription: \"Sync expenses, cards, reimbursements, and finance approvals.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-mercury\",\n\t\tname: \"Mercury\",\n\t\tdescription: \"Automate banking workflows, transactions, and treasury tasks.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-elevenlabs\",\n\t\tname: \"ElevenLabs\",\n\t\tdescription: \"Generate speech, transcribe audio, and automate voice agents.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-perplexity\",\n\t\tname: \"Perplexity\",\n\t\tdescription: \"Search the web with citations and grounded AI answers.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-gemini\",\n\t\tname: \"Gemini\",\n\t\tdescription: \"Use Google AI models for generation, analysis, and reasoning.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-polymarket\",\n\t\tname: \"Polymarket\",\n\t\tdescription: \"Read market data and automate prediction-market workflows.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-blacksmith\",\n\t\tname: \"Blacksmith\",\n\t\tdescription: \"Automate CI builds, runners, and developer infrastructure.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-deel\",\n\t\tname: \"Deel\",\n\t\tdescription: \"Sync employee, contractor, payroll, and HR workflows.\",\n\t\tcategory: \"HR\"\n\t},\n\t{\n\t\tid: \"app-doordash\",\n\t\tname: \"DoorDash\",\n\t\tdescription: \"Coordinate delivery, merchant, and logistics workflows.\",\n\t\tcategory: \"Commerce\"\n\t},\n\t{\n\t\tid: \"app-dub\",\n\t\tname: \"Dub\",\n\t\tdescription: \"Manage short links, attribution, and campaign routing.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-exa\",\n\t\tname: \"Exa\",\n\t\tdescription: \"Search the web and retrieve AI-ready research results.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-firecrawl\",\n\t\tname: \"Firecrawl\",\n\t\tdescription: \"Crawl sites, extract structured data, and power research agents.\",\n\t\tcategory: \"Search\"\n\t},\n\t{\n\t\tid: \"app-granola\",\n\t\tname: \"Granola\",\n\t\tdescription: \"Sync meeting notes, summaries, and follow-up workflows.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-gusto\",\n\t\tname: \"Gusto\",\n\t\tdescription: \"Automate payroll, benefits, and HR operations.\",\n\t\tcategory: \"HR\"\n\t},\n\t{\n\t\tid: \"app-hex\",\n\t\tname: \"Hex\",\n\t\tdescription: \"Run analytics workflows, notebooks, and data apps.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-instacart\",\n\t\tname: \"Instacart\",\n\t\tdescription: \"Coordinate grocery commerce, orders, and fulfillment workflows.\",\n\t\tcategory: \"Commerce\"\n\t},\n\t{\n\t\tid: \"app-kalshi\",\n\t\tname: \"Kalshi\",\n\t\tdescription: \"Read event markets and automate prediction-market workflows.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-omni\",\n\t\tname: \"Omni\",\n\t\tdescription: \"Query business intelligence models and automate analytics workflows.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-parallel\",\n\t\tname: \"Parallel\",\n\t\tdescription: \"Run AI research, enrichment, and web task workflows.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-planetscale\",\n\t\tname: \"PlanetScale\",\n\t\tdescription: \"Manage MySQL databases, branches, and deploy requests.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-porter\",\n\t\tname: \"Porter\",\n\t\tdescription: \"Coordinate cloud deployments and application infrastructure.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-puzzle\",\n\t\tname: \"Puzzle\",\n\t\tdescription: \"Automate accounting workflows, books, and finance operations.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-pylon\",\n\t\tname: \"Pylon\",\n\t\tdescription: \"Manage B2B support conversations and customer workflows.\",\n\t\tcategory: \"Support\"\n\t},\n\t{\n\t\tid: \"app-ramp\",\n\t\tname: \"Ramp\",\n\t\tdescription: \"Sync spend, expenses, approvals, and finance workflows.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-reducto\",\n\t\tname: \"Reducto\",\n\t\tdescription: \"Extract structured data from complex documents.\",\n\t\tcategory: \"Documents\"\n\t},\n\t{\n\t\tid: \"app-resend\",\n\t\tname: \"Resend\",\n\t\tdescription: \"Send product email and react to delivery events.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-rippling\",\n\t\tname: \"Rippling\",\n\t\tdescription: \"Automate employee, device, payroll, and HR workflows.\",\n\t\tcategory: \"HR\"\n\t},\n\t{\n\t\tid: \"app-streak\",\n\t\tname: \"Streak\",\n\t\tdescription: \"Manage Gmail-native CRM pipelines and contact workflows.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-warp\",\n\t\tname: \"Warp\",\n\t\tdescription: \"Coordinate terminal, developer environment, and AI coding workflows.\",\n\t\tcategory: \"Development\"\n\t},\n\t{\n\t\tid: \"app-apollo\",\n\t\tname: \"Apollo\",\n\t\tdescription: \"Sync sales intelligence, prospecting, and enrichment workflows.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-cal-com\",\n\t\tname: \"Cal.com\",\n\t\tdescription: \"Automate scheduling, bookings, availability, and routing workflows.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-cerebras\",\n\t\tname: \"Cerebras\",\n\t\tdescription: \"Use fast AI inference for model-powered workflow steps.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-chargebee\",\n\t\tname: \"Chargebee\",\n\t\tdescription: \"Automate subscription billing, customers, invoices, and revenue workflows.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-deepseek\",\n\t\tname: \"DeepSeek\",\n\t\tdescription: \"Use DeepSeek models for generation, reasoning, and analysis.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-gong\",\n\t\tname: \"Gong\",\n\t\tdescription: \"Sync revenue conversations, account insights, and sales follow-up workflows.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-google-contacts\",\n\t\tname: \"Google Contacts\",\n\t\tdescription: \"Read and update contact records across Google Workspace.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-google-docs\",\n\t\tname: \"Google Docs\",\n\t\tdescription: \"Create, read, and update collaborative documents.\",\n\t\tcategory: \"Documents\"\n\t},\n\t{\n\t\tid: \"app-google-forms\",\n\t\tname: \"Google Forms\",\n\t\tdescription: \"Capture form responses and turn submissions into automated work.\",\n\t\tcategory: \"Forms\"\n\t},\n\t{\n\t\tid: \"app-google-meet\",\n\t\tname: \"Google Meet\",\n\t\tdescription: \"Coordinate meetings, recordings, and video collaboration workflows.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-google-slides\",\n\t\tname: \"Google Slides\",\n\t\tdescription: \"Create and update presentations from workflow outputs.\",\n\t\tcategory: \"Documents\"\n\t},\n\t{\n\t\tid: \"app-google-tasks\",\n\t\tname: \"Google Tasks\",\n\t\tdescription: \"Create tasks, update lists, and coordinate personal work queues.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-greenhouse\",\n\t\tname: \"Greenhouse\",\n\t\tdescription: \"Automate candidate, job, and interview coordination workflows.\",\n\t\tcategory: \"HR\"\n\t},\n\t{\n\t\tid: \"app-groq\",\n\t\tname: \"Groq\",\n\t\tdescription: \"Use low-latency AI inference in agents and workflows.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-help-scout\",\n\t\tname: \"Help Scout\",\n\t\tdescription: \"Manage customer conversations, mailboxes, and support workflows.\",\n\t\tcategory: \"Support\"\n\t},\n\t{\n\t\tid: \"app-linkedin\",\n\t\tname: \"LinkedIn\",\n\t\tdescription: \"Coordinate professional network, recruiting, and social workflows.\",\n\t\tcategory: \"CRM\"\n\t},\n\t{\n\t\tid: \"app-microsoft-excel\",\n\t\tname: \"Microsoft Excel\",\n\t\tdescription: \"Read, update, and append rows in Excel workbooks.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-microsoft-onedrive\",\n\t\tname: \"Microsoft OneDrive\",\n\t\tdescription: \"Find, read, upload, and organize files in OneDrive.\",\n\t\tcategory: \"Files\"\n\t},\n\t{\n\t\tid: \"app-microsoft-outlook\",\n\t\tname: \"Microsoft Outlook\",\n\t\tdescription: \"Send email, read messages, and coordinate calendar workflows.\",\n\t\tcategory: \"Communication\"\n\t},\n\t{\n\t\tid: \"app-microsoft-planner\",\n\t\tname: \"Microsoft Planner\",\n\t\tdescription: \"Create tasks, update plans, and coordinate project work.\",\n\t\tcategory: \"Project Management\"\n\t},\n\t{\n\t\tid: \"app-microsoft-sharepoint\",\n\t\tname: \"Microsoft SharePoint\",\n\t\tdescription: \"Search sites, update lists, and manage shared documents.\",\n\t\tcategory: \"Documents\"\n\t},\n\t{\n\t\tid: \"app-mistral\",\n\t\tname: \"Mistral\",\n\t\tdescription: \"Use Mistral models for generation, analysis, and AI workflow steps.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-posthog\",\n\t\tname: \"PostHog\",\n\t\tdescription: \"Query product analytics, feature flags, and user behavior signals.\",\n\t\tcategory: \"Data\"\n\t},\n\t{\n\t\tid: \"app-reddit\",\n\t\tname: \"Reddit\",\n\t\tdescription: \"Monitor communities, posts, and discussion-driven workflows.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-square\",\n\t\tname: \"Square\",\n\t\tdescription: \"Automate payments, customers, catalog, and point-of-sale workflows.\",\n\t\tcategory: \"Finance\"\n\t},\n\t{\n\t\tid: \"app-todoist\",\n\t\tname: \"Todoist\",\n\t\tdescription: \"Create tasks, update projects, and automate personal work queues.\",\n\t\tcategory: \"Productivity\"\n\t},\n\t{\n\t\tid: \"app-wordpress\",\n\t\tname: \"WordPress\",\n\t\tdescription: \"Publish posts, update pages, and automate site content workflows.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-x-twitter\",\n\t\tname: \"X / Twitter\",\n\t\tdescription: \"Monitor posts, publish updates, and coordinate social workflows.\",\n\t\tcategory: \"Marketing\"\n\t},\n\t{\n\t\tid: \"app-xai\",\n\t\tname: \"xAI\",\n\t\tdescription: \"Use xAI models for generation, analysis, and reasoning steps.\",\n\t\tcategory: \"AI\"\n\t},\n\t{\n\t\tid: \"app-youtube\",\n\t\tname: \"YouTube\",\n\t\tdescription: \"Manage videos, channels, comments, and creator workflows.\",\n\t\tcategory: \"Marketing\"\n\t}\n];\nconst APP_INTEGRATION_DESCRIPTIONS = {\n\t\"app-gmail\": \"Connect Gmail so agents can read, draft, send, and organize email as part of a workflow. Use it for customer follow-ups, approval threads, inbound request triage, or any automation where the next step happens in an inbox.\",\n\t\"app-slack\": \"Connect Slack so agents can post updates, request approvals, and keep work moving from channel conversations. Use it for deployment approvals, triage alerts, support handoffs, or workflows that need a human decision in chat.\",\n\t\"app-github\": \"Connect GitHub so agents can react to issues, pull requests, commits, and repository events. Use it to automate review follow-ups, update project state, open PRs, or summarize engineering activity without leaving Keystroke.\",\n\t\"app-anthropic\": \"Connect Anthropic to give workflows and agents access to Claude for reasoning, writing, analysis, and structured generation. Use it when an automation needs judgment, summarization, code understanding, or a safer model step.\",\n\t\"app-attio\": \"Connect Attio so agents can look up customer context, update CRM records, and keep deal activity current. Use it to enrich leads, prepare account briefs, or write notes back to the relationship record after work happens elsewhere.\",\n\t\"app-openai\": \"Connect OpenAI to use GPT models, embeddings, and multimodal generation inside agents and workflows. Use it for classification, drafting, extraction, retrieval, and AI steps that need fast general-purpose model coverage.\",\n\t\"app-airtable\": \"Connect Airtable so workflows can read, create, and update records in the bases your team already uses. Use it for lightweight operations dashboards, intake queues, content calendars, or any structured data that lives outside the product database.\",\n\t\"app-google-sheets\": \"Connect Google Sheets so agents can inspect spreadsheets, append rows, and keep tabular data up to date. Use it for operational reports, lead lists, reconciliation sheets, or simple automations that still run through a spreadsheet.\",\n\t\"app-google-drive\": \"Connect Google Drive so agents can find, read, create, and organize files across shared folders. Use it when workflows need source documents, generated exports, meeting artifacts, or project files stored in Drive.\",\n\t\"app-google-calendar\": \"Connect Google Calendar so agents can check availability, create events, and coordinate schedule changes. Use it for booking follow-ups, launch calendars, interview loops, or workflows that need to reserve time with the right people.\",\n\t\"app-notion\": \"Connect Notion so agents can search workspace knowledge, update databases, and create pages from completed work. Use it to turn conversations into docs, keep project trackers current, or pull context from team operating notes.\",\n\t\"app-linear\": \"Connect Linear so agents can create issues, update triage queues, and comment on engineering work. Use it to turn chat decisions into tickets, keep statuses current, or route follow-up tasks to the right project.\",\n\t\"app-jira\": \"Connect Jira so agents can sync issues, transitions, comments, and project fields with the rest of your automation. Use it for sprint hygiene, release coordination, support escalations, or workflows that need to move work through Jira states.\",\n\t\"app-asana\": \"Connect Asana so workflows can create tasks, update projects, and keep team work visible. Use it for campaign checklists, launch plans, cross-functional handoffs, or automations that turn decisions into assigned tasks.\",\n\t\"app-trello\": \"Connect Trello so agents can move cards, update boards, and manage checklist work. Use it for lightweight pipelines, editorial boards, personal task flows, or team processes that are organized around cards.\",\n\t\"app-clickup\": \"Connect ClickUp so agents can manage tasks, docs, custom fields, and workspace automations. Use it to update complex workspaces, coordinate owners, or keep custom project metadata in sync with the rest of your tools.\",\n\t\"app-monday\": \"Connect monday.com so agents can update boards, create items, and automate team workflow changes. Use it for operations trackers, handoff boards, campaign production, or any process your team runs through monday.com.\",\n\t\"app-discord\": \"Connect Discord so agents can post updates, listen for commands, and respond inside communities or private servers. Use it for developer communities, customer groups, incident rooms, or lightweight command-driven workflows.\",\n\t\"app-microsoft-teams\": \"Connect Microsoft Teams so agents can send messages, coordinate approvals, and keep work moving in team channels. Use it for enterprise handoffs, meeting follow-ups, internal notifications, or workflows that need to meet users where they collaborate.\",\n\t\"app-google-chat\": \"Connect Google Chat so agents can send updates and surface workflow responses in spaces or direct messages. Use it for Workspace-native notifications, team approvals, status pings, or lightweight chat commands.\",\n\t\"app-telegram\": \"Connect Telegram so agents can send bot messages and respond to chats or groups. Use it for community operations, alerts, personal workflows, or automations that need fast mobile-friendly messaging.\",\n\t\"app-whatsapp\": \"Connect WhatsApp so agents can send customer messages and respond to conversation threads. Use it for support follow-ups, appointment reminders, sales handoffs, or any workflow where customers already expect WhatsApp updates.\",\n\t\"app-hubspot\": \"Connect HubSpot so agents can manage contacts, companies, deals, tickets, and timelines. Use it to enrich CRM records, log customer activity, trigger sales follow-ups, or keep marketing and success workflows aligned.\",\n\t\"app-salesforce\": \"Connect Salesforce so workflows can read and update leads, accounts, opportunities, and cases. Use it for account research, sales operations, support escalation, or automations that need Salesforce to remain the source of truth.\",\n\t\"app-pipedrive\": \"Connect Pipedrive so agents can move deals, update contacts, and automate sales pipeline work. Use it for lead routing, next-step reminders, pipeline cleanup, or follow-ups triggered by activity in other systems.\",\n\t\"app-intercom\": \"Connect Intercom so agents can route conversations, update users, and summarize support context. Use it to triage inbound messages, draft replies, escalate issues, or connect customer conversations to product and engineering workflows.\",\n\t\"app-zendesk\": \"Connect Zendesk so agents can create tickets, reply to customers, and keep support context in sync. Use it for ticket triage, SLA follow-ups, escalation summaries, or workflows that turn support signals into action.\",\n\t\"app-freshdesk\": \"Connect Freshdesk so workflows can route tickets, draft replies, and update customer records. Use it to automate support queues, enrich tickets with external context, or make sure resolution steps are captured consistently.\",\n\t\"app-front\": \"Connect Front so agents can work with shared inboxes, internal comments, tags, and customer replies. Use it for support or success teams that coordinate from email but need automation to keep the thread moving.\",\n\t\"app-stripe\": \"Connect Stripe so agents can react to payments, manage customers, and reconcile billing events. Use it for revenue alerts, failed payment follow-ups, invoice workflows, or customer lifecycle automation tied to billing state.\",\n\t\"app-quickbooks\": \"Connect QuickBooks so workflows can create invoices, sync customers, and reconcile accounting data. Use it for finance handoffs, bookkeeping follow-ups, payment checks, or automations that keep operational data aligned with accounting.\",\n\t\"app-xero\": \"Connect Xero so agents can automate invoices, contacts, bills, and accounting workflows. Use it for finance reviews, customer billing updates, payable tracking, or recurring accounting tasks that should not require manual entry.\",\n\t\"app-shopify\": \"Connect Shopify so agents can process orders, update products, and coordinate fulfillment work. Use it for ecommerce support, inventory checks, fulfillment exceptions, or automations triggered by store events.\",\n\t\"app-woocommerce\": \"Connect WooCommerce so workflows can sync orders, customers, products, and storefront events. Use it for store operations, fulfillment coordination, customer follow-ups, or reporting across commerce and support tools.\",\n\t\"app-webflow\": \"Connect Webflow so agents can publish CMS items, update site content, and react to site events. Use it for marketing pages, content operations, launch checklists, or workflows that turn approved content into live updates.\",\n\t\"app-mailchimp\": \"Connect Mailchimp so agents can manage audiences, campaigns, tags, and email automations. Use it for lifecycle marketing, list hygiene, campaign follow-ups, or workflows that connect product events to audience segments.\",\n\t\"app-sendgrid\": \"Connect SendGrid so workflows can send transactional email and react to delivery events. Use it for notifications, receipts, onboarding messages, or automations that need reliable email delivery and bounce handling.\",\n\t\"app-typeform\": \"Connect Typeform so agents can capture submissions and turn responses into follow-up work. Use it for intake forms, lead qualification, research surveys, or workflows that start when someone submits structured answers.\",\n\t\"app-surveymonkey\": \"Connect SurveyMonkey so agents can collect responses and move survey insights into the right workflow. Use it for customer research, feedback analysis, NPS follow-up, or reporting loops that begin with survey data.\",\n\t\"app-calendly\": \"Connect Calendly so agents can react to bookings, cancellations, and scheduling updates. Use it for sales handoffs, interview coordination, onboarding calls, or workflows that need to prepare before or follow up after a meeting.\",\n\t\"app-docusign\": \"Connect DocuSign so workflows can send envelopes, track signatures, and file completed agreements. Use it for contracts, approvals, onboarding packets, or any process where a signed document should trigger the next step.\",\n\t\"app-dropbox\": \"Connect Dropbox so agents can read files, upload assets, and organize shared folders. Use it for document intake, generated exports, client deliverables, or workflows that need to move files between teams and systems.\",\n\t\"app-box\": \"Connect Box so agents can search enterprise files, update folders, and manage documents securely. Use it for governed document workflows, legal handoffs, knowledge retrieval, or file operations that need enterprise storage controls.\",\n\t\"app-figma\": \"Connect Figma so agents can inspect designs, sync comments, and coordinate design handoffs. Use it to pull design context into implementation work, track feedback, or turn approved mockups into downstream tasks.\",\n\t\"app-canva\": \"Connect Canva so agents can help create design assets and automate content production. Use it for campaign graphics, social templates, brand asset updates, or workflows where creative requests need repeatable output.\",\n\t\"app-sentry\": \"Connect Sentry so agents can triage errors, summarize issues, and route incidents from production signals. Use it to turn crash reports into engineering tasks, prepare context for responders, or close the loop after a fix.\",\n\t\"app-datadog\": \"Connect Datadog so workflows can query metrics, inspect monitors, and coordinate incidents. Use it for alert triage, deployment checks, operational summaries, or automations that need observability context before taking action.\",\n\t\"app-pagerduty\": \"Connect PagerDuty so agents can create incidents, page responders, and automate escalation steps. Use it for on-call workflows, incident updates, postmortem prep, or routing urgent operational work to the right person.\",\n\t\"app-gitlab\": \"Connect GitLab so agents can manage merge requests, issues, pipelines, and repositories. Use it for CI follow-ups, release coordination, code review automation, or engineering workflows centered on GitLab projects.\",\n\t\"app-bitbucket\": \"Connect Bitbucket so workflows can automate pull requests, branches, and repository activity. Use it for review routing, branch hygiene, deployment handoffs, or teams whose source control lives in Atlassian.\",\n\t\"app-vercel\": \"Connect Vercel so agents can track deployments, inspect projects, and react to build events. Use it for preview checks, release notifications, failed build triage, or workflows that connect product changes to deployment state.\",\n\t\"app-netlify\": \"Connect Netlify so agents can automate deploys, forms, sites, and build notifications. Use it for static site releases, form-driven workflows, build triage, or marketing site operations tied to deployment events.\",\n\t\"app-supabase\": \"Connect Supabase so agents can query databases, manage auth context, and automate backend workflows. Use it for operational data checks, admin tasks, user support lookups, or workflows that depend on app data stored in Supabase.\",\n\t\"app-postgres\": \"Connect Postgres so workflows can run SQL queries and sync structured data from your database. Use it for reports, back-office operations, data enrichment, or automations that need direct access to relational data.\",\n\t\"app-snowflake\": \"Connect Snowflake so agents can query warehouse data and automate analytics workflows. Use it for reporting, customer segmentation, anomaly checks, or workflows that need trusted business data before acting.\",\n\t\"app-databricks\": \"Connect Databricks so workflows can run jobs, query lakehouse data, and coordinate data pipelines. Use it for analytics operations, model-adjacent workflows, data quality checks, or pipeline handoffs between teams.\",\n\t\"app-segment\": \"Connect Segment so agents can route customer events and enrich downstream automations. Use it for lifecycle triggers, audience syncs, event QA, or workflows that begin when product behavior changes.\",\n\t\"app-twilio\": \"Connect Twilio so agents can send SMS, manage calls, and coordinate customer notifications. Use it for reminders, verification flows, support callbacks, or automations that need to reach people outside email and chat.\",\n\t\"app-zoom\": \"Connect Zoom so agents can schedule meetings, manage recordings, and notify attendees. Use it for meeting prep, transcript follow-ups, customer call workflows, or automations that turn live conversations into next steps.\",\n\t\"app-loom\": \"Connect Loom so agents can create video handoffs, summarize recordings, and share updates. Use it for async status reports, customer walkthroughs, product feedback, or workflows where a short video carries the context.\",\n\t\"app-miro\": \"Connect Miro so agents can create boards, sync cards, and coordinate visual planning. Use it for workshops, roadmap sessions, research synthesis, or workflows that move structured work into a shared canvas.\",\n\t\"app-coda\": \"Connect Coda so workflows can update docs, tables, packs, and team operating systems. Use it for custom trackers, lightweight apps, planning docs, or automations that need to keep Coda tables current.\",\n\t\"app-confluence\": \"Connect Confluence so agents can search knowledge bases and create or update documentation. Use it for runbooks, implementation notes, release docs, or workflows that should leave behind durable team knowledge.\",\n\t\"app-aws\": \"Connect AWS so agents can coordinate cloud resources, events, queues, and infrastructure tasks. Use it for operational checks, deployment handoffs, queue monitoring, or workflows that need cloud state before acting.\",\n\t\"app-google-cloud\": \"Connect Google Cloud so workflows can manage cloud jobs, storage, Pub/Sub, and deployment work. Use it for infrastructure automation, data pipeline coordination, operational checks, or alerts tied to Google Cloud services.\",\n\t\"app-azure\": \"Connect Azure so agents can automate resources, queues, deployments, and identity-related tasks. Use it for enterprise cloud operations, release workflows, infrastructure checks, or automations in Microsoft-backed environments.\",\n\t\"app-cloudflare\": \"Connect Cloudflare so agents can manage DNS, Workers, Pages, queues, and edge automations. Use it for site operations, edge deployments, incident response, or workflows that need to change traffic and infrastructure at the edge.\",\n\t\"app-docker\": \"Connect Docker so agents can coordinate images, registries, builds, and deployment events. Use it for release preparation, image promotion, environment checks, or workflows that need container metadata.\",\n\t\"app-kubernetes\": \"Connect Kubernetes so agents can inspect clusters, trigger jobs, and automate operational tasks. Use it for rollout checks, incident triage, job coordination, or workflows that need live cluster context.\",\n\t\"app-algolia\": \"Connect Algolia so workflows can sync search indexes and automate content discovery tasks. Use it for search freshness, indexing checks, merchandising updates, or workflows that need searchable content to stay current.\",\n\t\"app-elasticsearch\": \"Connect Elasticsearch so agents can query search clusters and automate log or document workflows. Use it for operational investigations, search-backed features, document indexing, or workflows that depend on fast text retrieval.\",\n\t\"app-redis\": \"Connect Redis so workflows can read cache data, coordinate queues, and manage realtime state. Use it for operational checks, queue insight, temporary state lookups, or automations that need fast key-value context.\",\n\t\"app-pinecone\": \"Connect Pinecone so agents can manage vector indexes and power retrieval workflows. Use it for semantic search, memory, recommendation, or knowledge retrieval steps that need embeddings-backed context.\",\n\t\"app-plaid\": \"Connect Plaid so agents can work with financial account data and banking flows. Use it for transaction enrichment, onboarding checks, financial reporting, or workflows that depend on verified account activity.\",\n\t\"app-brex\": \"Connect Brex so workflows can sync expenses, cards, reimbursements, and finance approvals. Use it for spend review, receipt follow-up, budget alerts, or automations that connect finance operations to team workflows.\",\n\t\"app-mercury\": \"Connect Mercury so agents can automate banking workflows, transactions, and treasury tasks. Use it for finance operations, cash movement checks, approval routing, or workflows triggered by account activity.\",\n\t\"app-elevenlabs\": \"Connect ElevenLabs so agents can generate speech, transcribe audio, and build voice-enabled workflows. Use it for narrated updates, voice agents, call summaries, or automations that need natural-sounding audio output.\",\n\t\"app-perplexity\": \"Connect Perplexity so agents can search the web with citations and grounded answers. Use it for research, competitive monitoring, fact gathering, or workflows that need fresh external context before making a recommendation.\",\n\t\"app-gemini\": \"Connect Gemini so agents can use Google AI models for generation, analysis, and reasoning. Use it for multimodal understanding, document analysis, content generation, or workflows that benefit from Google model coverage.\",\n\t\"app-polymarket\": \"Connect Polymarket so agents can read market data and automate prediction-market workflows. Use it for market monitoring, research context, probability tracking, or automations that react to changing public forecasts.\",\n\t\"app-blacksmith\": \"Connect Blacksmith so agents can inspect CI runs, coordinate build infrastructure, and react to developer workflow events. Use it for failed build triage, runner capacity checks, deployment gates, or automations that keep engineering pipelines moving.\",\n\t\"app-deel\": \"Connect Deel so agents can work with contractor, employee, payroll, and compliance workflows. Use it to prepare onboarding tasks, follow up on HR operations, reconcile workforce data, or route people ops requests to the right system.\",\n\t\"app-doordash\": \"Connect DoorDash so agents can coordinate delivery, merchant, and logistics workflows. Use it for order exception handling, fulfillment updates, operational alerts, or automations where real-world delivery status needs to trigger follow-up work.\",\n\t\"app-dub\": \"Connect Dub so agents can manage short links, attribution, and campaign routing. Use it to create tracked links, monitor conversion signals, clean up campaign metadata, or connect marketing activity to downstream reporting.\",\n\t\"app-exa\": \"Connect Exa so agents can search the web and retrieve AI-ready research results. Use it for market scans, company enrichment, competitive research, or workflows that need fresh external context before drafting or deciding.\",\n\t\"app-firecrawl\": \"Connect Firecrawl so agents can crawl sites, extract structured data, and turn webpages into workflow-ready inputs. Use it for lead enrichment, documentation ingestion, content monitoring, or research tasks that start from public web pages.\",\n\t\"app-granola\": \"Connect Granola so agents can use meeting notes, summaries, and follow-up context in your workflows. Use it to turn calls into tasks, update account records, prepare recap messages, or make meeting outcomes available to other automations.\",\n\t\"app-gusto\": \"Connect Gusto so agents can coordinate payroll, benefits, and HR operations. Use it for onboarding checklists, payroll review reminders, people ops follow-ups, or workflows that need employee and compensation context.\",\n\t\"app-hex\": \"Connect Hex so agents can run analytics workflows, query notebooks, and coordinate data app outputs. Use it for metric investigations, recurring analysis, stakeholder reports, or automations that need trusted analytical context.\",\n\t\"app-instacart\": \"Connect Instacart so agents can coordinate grocery commerce, orders, and fulfillment workflows. Use it for delivery exceptions, merchant operations, catalog checks, or automations that depend on order and shopper activity.\",\n\t\"app-kalshi\": \"Connect Kalshi so agents can read event markets and automate prediction-market workflows. Use it for market monitoring, probability snapshots, research briefs, or automations that react to changing expectations around real-world events.\",\n\t\"app-omni\": \"Connect Omni so agents can query business intelligence models and automate analytics workflows. Use it to answer operational questions, refresh stakeholder summaries, investigate metric movement, or bring governed BI context into agent work.\",\n\t\"app-parallel\": \"Connect Parallel so agents can run AI research, enrichment, and web task workflows. Use it for background research, lead enrichment, competitive monitoring, or automations that delegate broad information-gathering tasks.\",\n\t\"app-planetscale\": \"Connect PlanetScale so agents can manage database branches, deploy requests, and MySQL-backed workflows. Use it for schema review reminders, release coordination, operational data checks, or automations tied to database changes.\",\n\t\"app-porter\": \"Connect Porter so agents can coordinate cloud deployments and application infrastructure. Use it for rollout checks, failed deploy triage, environment updates, or workflows that keep application operations moving.\",\n\t\"app-puzzle\": \"Connect Puzzle so agents can automate accounting workflows, books, and finance operations. Use it for close checklists, transaction review, finance handoffs, or workflows that keep bookkeeping context current.\",\n\t\"app-pylon\": \"Connect Pylon so agents can manage B2B support conversations and customer workflows. Use it to triage customer issues, summarize account context, route engineering follow-ups, or keep support signals connected to product work.\",\n\t\"app-ramp\": \"Connect Ramp so agents can sync spend, expenses, approvals, and finance workflows. Use it for receipt follow-ups, budget alerts, approval routing, or automations that connect company spend to operational context.\",\n\t\"app-reducto\": \"Connect Reducto so agents can extract structured data from complex documents. Use it for document intake, contract review prep, invoice parsing, or workflows where PDFs and files need to become reliable structured inputs.\",\n\t\"app-resend\": \"Connect Resend so agents can send product email and react to delivery events. Use it for onboarding messages, transactional notifications, bounce handling, or workflows that need reliable email delivery from product systems.\",\n\t\"app-rippling\": \"Connect Rippling so agents can coordinate employee, device, payroll, and HR workflows from one place. Use it for onboarding and offboarding checklists, access changes, equipment follow-ups, or automations that need workforce context before acting.\",\n\t\"app-streak\": \"Connect Streak so agents can manage Gmail-native CRM pipelines and contact workflows. Use it for deal follow-ups, inbox-driven sales activity, contact updates, or workflows where relationship context lives directly inside Gmail.\",\n\t\"app-warp\": \"Connect Warp so agents can coordinate terminal, developer environment, and AI coding workflows. Use it for developer setup tasks, command-driven runbooks, environment checks, or workflows that bridge local engineering activity with team operations.\",\n\t\"app-apollo\": \"Connect Apollo so agents can use sales intelligence, prospecting data, and enrichment workflows. Use it to qualify leads, enrich accounts, prepare outbound context, or route sales follow-ups based on fresh prospect data.\",\n\t\"app-cal-com\": \"Connect Cal.com so agents can automate scheduling, bookings, availability, and routing workflows. Use it for handoff scheduling, round-robin booking, interview coordination, or follow-ups that should happen before or after a meeting.\",\n\t\"app-cerebras\": \"Connect Cerebras so agents can use fast AI inference inside workflows and tools. Use it for low-latency generation, classification, extraction, or model-powered steps that need quick responses at scale.\",\n\t\"app-chargebee\": \"Connect Chargebee so agents can automate subscription billing, customers, invoices, and revenue workflows. Use it for renewal alerts, billing support, failed payment follow-ups, or automations tied to subscription lifecycle changes.\",\n\t\"app-deepseek\": \"Connect DeepSeek so agents can use DeepSeek models for generation, reasoning, and analysis. Use it for coding assistance, structured extraction, summarization, or AI steps that benefit from an additional model provider.\",\n\t\"app-gong\": \"Connect Gong so agents can use revenue conversations, account insights, and sales activity. Use it to summarize calls, extract next steps, update CRM context, or trigger follow-ups from customer conversations.\",\n\t\"app-google-contacts\": \"Connect Google Contacts so agents can read and update contact records across Google Workspace. Use it to enrich communication workflows, keep people data current, or resolve the right recipient before sending follow-ups.\",\n\t\"app-google-docs\": \"Connect Google Docs so agents can create, read, and update collaborative documents. Use it for drafting briefs, maintaining runbooks, turning conversations into docs, or updating shared plans after workflow activity.\",\n\t\"app-google-forms\": \"Connect Google Forms so agents can capture submissions and turn responses into follow-up work. Use it for intake flows, lightweight surveys, internal requests, or automations that begin when someone submits structured information.\",\n\t\"app-google-meet\": \"Connect Google Meet so agents can coordinate meetings, recordings, and video collaboration workflows. Use it for meeting prep, attendee updates, recording follow-ups, or automations that turn live conversations into next steps.\",\n\t\"app-google-slides\": \"Connect Google Slides so agents can create and update presentations from workflow outputs. Use it for status decks, customer recaps, board updates, or automations that turn approved content and data into slides.\",\n\t\"app-google-tasks\": \"Connect Google Tasks so agents can create tasks, update lists, and coordinate personal work queues. Use it for lightweight reminders, follow-up capture, personal task routing, or workflows that should land in a simple to-do list.\",\n\t\"app-greenhouse\": \"Connect Greenhouse so agents can automate candidate, job, and interview coordination workflows. Use it for recruiting follow-ups, interview loop prep, candidate summaries, or workflows that keep hiring processes current.\",\n\t\"app-groq\": \"Connect Groq so agents can use low-latency AI inference in workflows. Use it for fast classification, summarization, extraction, or interactive agent steps where response speed matters.\",\n\t\"app-help-scout\": \"Connect Help Scout so agents can manage customer conversations, mailboxes, and support workflows. Use it to triage inbound requests, draft replies, summarize customer context, or route support signals into product and engineering work.\",\n\t\"app-linkedin\": \"Connect LinkedIn so agents can coordinate professional network, recruiting, and social workflows. Use it for prospect research, hiring context, relationship prep, or automations that connect professional profiles to your operating data.\",\n\t\"app-microsoft-excel\": \"Connect Microsoft Excel so agents can read, update, and append rows in workbooks. Use it for operational reports, finance trackers, reconciliation sheets, or workflows that need to work with spreadsheets stored in Microsoft 365.\",\n\t\"app-microsoft-onedrive\": \"Connect Microsoft OneDrive so agents can find, read, upload, and organize files. Use it for document intake, generated exports, shared artifacts, or workflows that need source material from Microsoft cloud storage.\",\n\t\"app-microsoft-outlook\": \"Connect Microsoft Outlook so agents can send email, read messages, and coordinate calendar workflows. Use it for customer follow-ups, scheduling handoffs, inbox triage, or automations that need to operate inside Microsoft 365.\",\n\t\"app-microsoft-planner\": \"Connect Microsoft Planner so agents can create tasks, update plans, and coordinate project work. Use it for team checklists, project handoffs, status updates, or workflows that should create visible work items for Microsoft 365 teams.\",\n\t\"app-microsoft-sharepoint\": \"Connect Microsoft SharePoint so agents can search sites, update lists, and manage shared documents. Use it for governed document workflows, internal knowledge retrieval, approval tracking, or automations that depend on SharePoint content.\",\n\t\"app-mistral\": \"Connect Mistral so agents can use Mistral models for generation, analysis, and reasoning. Use it for multilingual tasks, structured extraction, summarization, or AI workflow steps that need another model option.\",\n\t\"app-posthog\": \"Connect PostHog so agents can query product analytics, feature flags, and user behavior signals. Use it for growth investigations, experiment follow-ups, customer debugging, or workflows triggered by product usage patterns.\",\n\t\"app-reddit\": \"Connect Reddit so agents can monitor communities, posts, and discussion-driven workflows. Use it for audience research, brand monitoring, support signal discovery, or automations that react to public community conversations.\",\n\t\"app-square\": \"Connect Square so agents can automate payments, customers, catalog, and point-of-sale workflows. Use it for transaction follow-ups, customer updates, sales reporting, or operational workflows tied to in-person and online commerce.\",\n\t\"app-todoist\": \"Connect Todoist so agents can create tasks, update projects, and automate personal work queues. Use it for lightweight reminders, follow-up capture, recurring checklists, or workflows that should become personal tasks.\",\n\t\"app-wordpress\": \"Connect WordPress so agents can publish posts, update pages, and automate site content workflows. Use it for editorial operations, release notes, content refreshes, or workflows that turn approved drafts into live site updates.\",\n\t\"app-x-twitter\": \"Connect X / Twitter so agents can monitor posts, publish updates, and coordinate social workflows. Use it for launch announcements, brand monitoring, support escalation, or automations that react to public conversation.\",\n\t\"app-xai\": \"Connect xAI so agents can use xAI models for generation, analysis, and reasoning. Use it for drafting, summarization, classification, or AI workflow steps that benefit from another model provider.\",\n\t\"app-youtube\": \"Connect YouTube so agents can manage videos, channels, comments, and creator workflows. Use it for publishing checklists, comment triage, content reporting, or automations that connect video activity to the rest of your workspace.\"\n};\nconst CATEGORY_INTEGRATION_USE_CASES = {\n\tAI: \"add model calls, embeddings, structured generation, and reasoning steps to agents or workflows\",\n\tCommerce: \"keep storefront, order, product, and fulfillment workflows moving without manual handoffs\",\n\tCommunication: \"send updates, listen for replies, route approvals, and keep conversations tied to the work they affect\",\n\tCRM: \"sync customer context, update records, and keep sales or success workflows current\",\n\tData: \"query, enrich, sync, and transform structured data as part of automated workflows\",\n\tDesign: \"pull design context into implementation work and keep creative handoffs coordinated\",\n\tDevelopment: \"react to engineering events, update project metadata, and connect code activity to agent workflows\",\n\tDocuments: \"send, track, organize, and file documents as part of repeatable business processes\",\n\tFiles: \"find, read, upload, and organize files so workflows can work with the right source material\",\n\tFinance: \"reconcile billing, accounting, customer, and transaction data across finance workflows\",\n\tForms: \"capture submissions, enrich responses, and trigger follow-up work from collected data\",\n\tHR: \"coordinate onboarding, payroll, and people operations without leaving the workspace\",\n\tInfrastructure: \"coordinate cloud resources, deployments, queues, and operational tasks from one workspace\",\n\tMarketing: \"manage campaigns, audiences, content, and delivery events from automated growth workflows\",\n\tObservability: \"triage incidents, summarize operational context, and route alerts to the right responders\",\n\tProductivity: \"coordinate calendars, docs, tasks, files, and team knowledge without leaving the workspace\",\n\t\"Project Management\": \"create tasks, update project state, and keep work queues aligned with agent-driven execution\",\n\tSearch: \"retrieve fresh external context, crawl sources, and ground workflows in real-time results\",\n\tSupport: \"triage customer conversations, update tickets, and move support context into the right workflow\"\n};\nfunction buildIntegrationDescription(app) {\n\tconst explicit = APP_INTEGRATION_DESCRIPTIONS[app.id];\n\tif (explicit) return explicit;\n\tconst categoryUseCase = CATEGORY_INTEGRATION_USE_CASES[app.category] ?? \"connect external context, events, and actions to your automated workflows\";\n\treturn `Connect ${app.name} to Keystroke so the workflows and AI agents you build can use it as a live ${app.category.toLowerCase()} system. ${app.description} Once connected, those automations can ${categoryUseCase}.`;\n}\nconst DEFAULT_OAUTH_SCOPE_DESCRIPTIONS = {\n\temail: \"View the email address associated with the connected account.\",\n\tprofile: \"View basic profile information for the connected account.\"\n};\nconst OAUTH_SCOPE_CATALOG_BY_APP_ID = {\n\t\"app-slack\": [\n\t\t{\n\t\t\tname: \"channels:history\",\n\t\t\tdescription: \"View messages and other content in public channels that the Slack Bot has been added to.\"\n\t\t},\n\t\t{\n\t\t\tname: \"channels:read\",\n\t\t\tdescription: \"View basic information about public channels in Slack.\"\n\t\t},\n\t\t{\n\t\t\tname: \"chat:write\",\n\t\t\tdescription: \"Send messages as the Keystroke Slack Bot.\"\n\t\t},\n\t\t{\n\t\t\tname: \"commands\",\n\t\t\tdescription: \"Add shortcuts and slash commands that start Keystroke actions.\"\n\t\t},\n\t\t{\n\t\t\tname: \"users:read\",\n\t\t\tdescription: \"View people in the Slack workspace.\"\n\t\t},\n\t\t{\n\t\t\tname: \"groups:read\",\n\t\t\tdescription: \"View basic information about private channels.\"\n\t\t},\n\t\t{\n\t\t\tname: \"im:read\",\n\t\t\tdescription: \"View basic information about direct messages.\"\n\t\t},\n\t\t{\n\t\t\tname: \"mpim:read\",\n\t\t\tdescription: \"View basic information about group direct messages.\"\n\t\t},\n\t\t{\n\t\t\tname: \"reactions:read\",\n\t\t\tdescription: \"View emoji reactions in conversations.\"\n\t\t},\n\t\t{\n\t\t\tname: \"team:read\",\n\t\t\tdescription: \"View basic information about the Slack workspace.\"\n\t\t},\n\t\t{\n\t\t\tname: \"files:read\",\n\t\t\tdescription: \"View files shared in Slack conversations.\"\n\t\t},\n\t\t{\n\t\t\tname: \"users.profile:read\",\n\t\t\tdescription: \"View profile fields for people in the workspace.\"\n\t\t},\n\t\t{\n\t\t\tname: \"channels:join\",\n\t\t\tdescription: \"Join public channels in the workspace.\"\n\t\t},\n\t\t{\n\t\t\tname: \"chat:write.public\",\n\t\t\tdescription: \"Send messages to public channels the bot is not a member of.\"\n\t\t},\n\t\t{\n\t\t\tname: \"groups:history\",\n\t\t\tdescription: \"View messages in private channels the bot has been added to.\"\n\t\t},\n\t\t{\n\t\t\tname: \"im:history\",\n\t\t\tdescription: \"View messages in direct message conversations.\"\n\t\t},\n\t\t{\n\t\t\tname: \"mpim:history\",\n\t\t\tdescription: \"View messages in group direct message conversations.\"\n\t\t},\n\t\t{\n\t\t\tname: \"reactions:write\",\n\t\t\tdescription: \"Add emoji reactions to Slack messages.\"\n\t\t},\n\t\t{\n\t\t\tname: \"files:write\",\n\t\t\tdescription: \"Upload and manage files in Slack conversations.\"\n\t\t}\n\t],\n\t\"app-gmail\": [\n\t\t{\n\t\t\tname: \"gmail.readonly\",\n\t\t\tdescription: \"View Gmail messages and metadata.\"\n\t\t},\n\t\t{\n\t\t\tname: \"gmail.send\",\n\t\t\tdescription: \"Send email from the connected Gmail account.\"\n\t\t},\n\t\t{\n\t\t\tname: \"gmail.modify\",\n\t\t\tdescription: \"Read, label, archive, and delete Gmail messages.\"\n\t\t},\n\t\t{\n\t\t\tname: \"gmail.labels\",\n\t\t\tdescription: \"Create, read, update, and delete Gmail labels.\"\n\t\t},\n\t\t{\n\t\t\tname: \"gmail.compose\",\n\t\t\tdescription: \"Create and manage draft email messages.\"\n\t\t},\n\t\t{\n\t\t\tname: \"profile\",\n\t\t\tdescription: DEFAULT_OAUTH_SCOPE_DESCRIPTIONS.profile\n\t\t},\n\t\t{\n\t\t\tname: \"email\",\n\t\t\tdescription: DEFAULT_OAUTH_SCOPE_DESCRIPTIONS.email\n\t\t}\n\t],\n\t\"app-github\": [\n\t\t{\n\t\t\tname: \"repo\",\n\t\t\tdescription: \"Read and write code, pull requests, issues, and repository metadata.\"\n\t\t},\n\t\t{\n\t\t\tname: \"read:org\",\n\t\t\tdescription: \"Read organization membership and team information.\"\n\t\t},\n\t\t{\n\t\t\tname: \"workflow\",\n\t\t\tdescription: \"Update GitHub Actions workflow files.\"\n\t\t},\n\t\t{\n\t\t\tname: \"admin:repo_hook\",\n\t\t\tdescription: \"Create and manage repository webhooks.\"\n\t\t},\n\t\t{\n\t\t\tname: \"read:user\",\n\t\t\tdescription: \"Read the connected GitHub user profile.\"\n\t\t},\n\t\t{\n\t\t\tname: \"user:email\",\n\t\t\tdescription: \"Read the connected GitHub user email addresses.\"\n\t\t}\n\t],\n\t\"app-stripe\": [\n\t\t{\n\t\t\tname: \"charges:read\",\n\t\t\tdescription: \"View charges, payment status, and dispute details.\"\n\t\t},\n\t\t{\n\t\t\tname: \"customers:read\",\n\t\t\tdescription: \"View customers and saved billing details.\"\n\t\t},\n\t\t{\n\t\t\tname: \"customers:write\",\n\t\t\tdescription: \"Create and update customer records.\"\n\t\t},\n\t\t{\n\t\t\tname: \"invoices:read\",\n\t\t\tdescription: \"View invoices, invoice items, and payment attempts.\"\n\t\t},\n\t\t{\n\t\t\tname: \"invoices:write\",\n\t\t\tdescription: \"Create, finalize, and update invoices.\"\n\t\t},\n\t\t{\n\t\t\tname: \"subscriptions:read\",\n\t\t\tdescription: \"View subscription plans, items, and billing schedules.\"\n\t\t},\n\t\t{\n\t\t\tname: \"webhook_endpoints:write\",\n\t\t\tdescription: \"Create and manage webhook endpoints for Stripe events.\"\n\t\t}\n\t]\n};\nfunction buildAppCatalogEntry(app) {\n\treturn {\n\t\t...app,\n\t\tintegrationDescription: buildIntegrationDescription(app),\n\t\toauthScopes: OAUTH_SCOPE_CATALOG_BY_APP_ID[app.id] ?? []\n\t};\n}\n/**\n* The supported-app catalog shown in the \"Connect an app\" picker. Mirrors the\n* curated integration list from keystroke-mockups. No connected/available flag:\n* \"connected\" is not a property of an app, it's whether a credential exists.\n*/\nconst appCatalogSeed = APP_CATALOG_BASE.map(buildAppCatalogEntry);\nconst GMAIL_SCOPES = [\n\t\"gmail.readonly\",\n\t\"gmail.send\",\n\t\"profile\",\n\t\"email\"\n];\nconst SLACK_SCOPES = [\n\t\"channels:history\",\n\t\"channels:read\",\n\t\"chat:write\",\n\t\"commands\",\n\t\"users:read\",\n\t\"groups:read\",\n\t\"im:read\",\n\t\"mpim:read\",\n\t\"reactions:read\",\n\t\"team:read\",\n\t\"files:read\",\n\t\"users.profile:read\"\n];\n/**\n* Credential records the signed-in user can see, spanning the three scopes\n* (organization, project, user) and both connection kinds (oauth, manual) so\n* the table's pre-built views and the detail page all have data to render.\n*/\nconst credentialSeed = [\n\t{\n\t\tid: \"cred-gmail-org-1\",\n\t\tappId: \"app-gmail\",\n\t\tappName: \"Gmail\",\n\t\tlabel: \"Company Gmail\",\n\t\tscope: \"organization\",\n\t\tisDefault: true,\n\t\tstatus: \"Active\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-02-10T14:00:00Z\",\n\t\tlastUsedAt: \"2026-04-20T15:44:00Z\",\n\t\tlastRefreshedAt: \"2026-04-20T15:44:00Z\",\n\t\texpiresAt: \"2026-05-20T15:44:00Z\",\n\t\tgrantedScopes: GMAIL_SCOPES,\n\t\townerUserId: \"org-member-nate\",\n\t\townerName: \"Nate Wells\"\n\t},\n\t{\n\t\tid: \"cred-gmail-proj-marketing\",\n\t\tappId: \"app-gmail\",\n\t\tappName: \"Gmail\",\n\t\tlabel: \"Marketing Gmail\",\n\t\tscope: \"project\",\n\t\tprojectId: \"project_gtm_engineering\",\n\t\tprojectName: \"GTM Engineering\",\n\t\tisDefault: false,\n\t\tstatus: \"Active\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-03-10T09:00:00Z\",\n\t\tlastUsedAt: \"2026-04-19T11:20:00Z\",\n\t\tlastRefreshedAt: \"2026-04-19T11:20:00Z\",\n\t\texpiresAt: \"2026-05-19T11:20:00Z\",\n\t\tgrantedScopes: GMAIL_SCOPES,\n\t\townerUserId: \"org-member-nate\",\n\t\townerName: \"Nate Wells\"\n\t},\n\t{\n\t\tid: \"cred-gmail-proj-support\",\n\t\tappId: \"app-gmail\",\n\t\tappName: \"Gmail\",\n\t\tlabel: \"Support Gmail\",\n\t\tscope: \"project\",\n\t\tprojectId: \"project_gtm_engineering\",\n\t\tprojectName: \"GTM Engineering\",\n\t\tisDefault: false,\n\t\tstatus: \"Expired\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-03-15T10:30:00Z\",\n\t\tlastUsedAt: \"2026-04-18T16:05:00Z\",\n\t\tlastRefreshedAt: \"2026-04-18T16:05:00Z\",\n\t\texpiresAt: \"2026-04-18T16:05:00Z\",\n\t\tgrantedScopes: [\n\t\t\t\"gmail.readonly\",\n\t\t\t\"profile\",\n\t\t\t\"email\"\n\t\t],\n\t\townerUserId: \"org-member-dallin\",\n\t\townerName: \"Dallin Bentley\"\n\t},\n\t{\n\t\tid: \"cred-gmail-user-blake\",\n\t\tappId: \"app-gmail\",\n\t\tappName: \"Gmail\",\n\t\tlabel: \"Blake's Gmail\",\n\t\tscope: \"user\",\n\t\tisDefault: false,\n\t\tstatus: \"Active\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-03-20T08:15:00Z\",\n\t\tlastUsedAt: \"2026-04-20T09:18:00Z\",\n\t\tlastRefreshedAt: \"2026-04-20T09:18:00Z\",\n\t\texpiresAt: \"2026-05-20T09:18:00Z\",\n\t\tgrantedScopes: GMAIL_SCOPES,\n\t\townerUserId: \"user_blake_rouse\",\n\t\townerName: \"Blake Rouse\"\n\t},\n\t{\n\t\tid: \"cred-slack-org-1\",\n\t\tappId: \"app-slack\",\n\t\tappName: \"Slack\",\n\t\tlabel: \"Keystroke Slack\",\n\t\tscope: \"organization\",\n\t\tisDefault: true,\n\t\tstatus: \"Active\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-02-12T11:00:00Z\",\n\t\tlastUsedAt: \"2026-04-20T14:21:00Z\",\n\t\tlastRefreshedAt: \"2026-04-20T14:21:00Z\",\n\t\texpiresAt: \"2026-05-20T14:21:00Z\",\n\t\tgrantedScopes: SLACK_SCOPES,\n\t\townerUserId: \"org-member-wells\",\n\t\townerName: \"Wells Riley\"\n\t},\n\t{\n\t\tid: \"cred-slack-user-nate\",\n\t\tappId: \"app-slack\",\n\t\tappName: \"Slack\",\n\t\tlabel: \"Nate's Slack\",\n\t\tscope: \"user\",\n\t\tisDefault: false,\n\t\tstatus: \"Needs Reauth\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-03-22T15:45:00Z\",\n\t\tlastUsedAt: \"2026-04-20T12:05:00Z\",\n\t\tlastRefreshedAt: \"2026-04-20T12:05:00Z\",\n\t\texpiresAt: \"2026-04-20T12:05:00Z\",\n\t\tgrantedScopes: SLACK_SCOPES,\n\t\townerUserId: \"org-member-nate\",\n\t\townerName: \"Nate Wells\"\n\t},\n\t{\n\t\tid: \"cred-github-org-1\",\n\t\tappId: \"app-github\",\n\t\tappName: \"GitHub\",\n\t\tlabel: \"Keystroke GitHub\",\n\t\tscope: \"organization\",\n\t\tisDefault: true,\n\t\tstatus: \"Active\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-02-08T09:30:00Z\",\n\t\tlastUsedAt: \"2026-04-20T13:02:00Z\",\n\t\tlastRefreshedAt: \"2026-04-20T13:02:00Z\",\n\t\texpiresAt: \"2026-05-20T13:02:00Z\",\n\t\tgrantedScopes: [\n\t\t\t\"repo\",\n\t\t\t\"read:org\",\n\t\t\t\"workflow\"\n\t\t],\n\t\townerUserId: \"org-member-dallin\",\n\t\townerName: \"Dallin Bentley\"\n\t},\n\t{\n\t\tid: \"cred-github-proj-personal\",\n\t\tappId: \"app-github\",\n\t\tappName: \"GitHub\",\n\t\tlabel: \"Personal Repo GitHub\",\n\t\tscope: \"project\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tprojectName: \"Blake's Project\",\n\t\tisDefault: false,\n\t\tstatus: \"Active\",\n\t\tconnectionKind: \"oauth\",\n\t\tcreatedAt: \"2026-03-01T16:00:00Z\",\n\t\tlastUsedAt: \"2026-04-19T19:41:00Z\",\n\t\tlastRefreshedAt: \"2026-04-19T19:41:00Z\",\n\t\texpiresAt: \"2026-05-19T19:41:00Z\",\n\t\tgrantedScopes: [\"repo\", \"workflow\"],\n\t\townerUserId: \"user_blake_rouse\",\n\t\townerName: \"Blake Rouse\"\n\t},\n\t{\n\t\tid: \"cred-anthropic-org-1\",\n\t\tappId: \"app-anthropic\",\n\t\tappName: \"Anthropic\",\n\t\tlabel: \"Anthropic API\",\n\t\tscope: \"organization\",\n\t\tisDefault: true,\n\t\tstatus: \"Active\",\n\t\tconnectionKind: \"manual\",\n\t\tcreatedAt: \"2026-02-20T13:00:00Z\",\n\t\tlastUsedAt: \"2026-04-19T09:40:00Z\",\n\t\tlastRefreshedAt: \"2026-04-19T09:40:00Z\",\n\t\tcredentialKeys: [\"ANTHROPIC_API_KEY\"],\n\t\tkeyPreviews: { ANTHROPIC_API_KEY: \"••••••••••••••••••M5f\" },\n\t\townerUserId: \"org-member-nate\",\n\t\townerName: \"Nate Wells\"\n\t}\n];\nconst agentSeed = [{\n\tid: \"agent-support\",\n\tname: \"Support Agent\",\n\tprojectId: \"project_personal_repo\",\n\tupdatedAt: \"2026-06-02T14:20:00Z\",\n\tdescription: \"Triage support requests and draft helpful replies.\",\n\tsourcePath: \"src/agents/support-agent.ts\",\n\tmodel: \"claude-4-sonnet\",\n\ttoolCount: 4,\n\tcredentialCount: 2,\n\tlastRunAt: \"2026-06-02T14:20:00Z\"\n}, {\n\tid: \"agent-research\",\n\tname: \"Research Agent\",\n\tprojectId: \"project_personal_repo\",\n\tupdatedAt: \"2026-06-01T09:15:00Z\",\n\tdescription: \"Summarize docs and pull answers from connected sources.\",\n\tsourcePath: \"src/agents/research-agent.ts\",\n\tmodel: \"claude-4-sonnet\",\n\ttoolCount: 6,\n\tcredentialCount: 3,\n\tlastRunAt: \"2026-06-01T09:15:00Z\"\n}];\nconst workflowSeed = [{\n\tid: \"workflow-daily-digest\",\n\tname: \"Daily Digest\",\n\tprojectId: \"project_personal_repo\",\n\tupdatedAt: \"2026-06-02T11:05:00Z\",\n\tdescription: \"Collect project updates and send a daily summary.\",\n\tsourcePath: \"src/workflows/daily-digest.ts\",\n\tstepCount: 2,\n\tlastRunAt: \"2026-06-02T11:05:00Z\"\n}, {\n\tid: \"workflow-email-triage\",\n\tname: \"Email Triage\",\n\tprojectId: \"project_personal_repo\",\n\tupdatedAt: \"2026-05-31T16:40:00Z\",\n\tdescription: \"Label, prioritize, and draft replies for inbound email.\",\n\tsourcePath: \"src/workflows/email-triage.ts\",\n\tstepCount: 4,\n\tlastRunAt: \"2026-05-31T16:40:00Z\"\n}];\nconst skillSeed = [{\n\tid: \"skill-attio-sync\",\n\tname: \"Attio Sync\",\n\tprojectId: \"project_personal_repo\",\n\tupdatedAt: \"2026-06-01T18:05:00Z\",\n\tdescription: \"Enrich company and contact records from Attio.\",\n\tsourcePath: \".agents/skills/attio-sync/SKILL.md\"\n}, {\n\tid: \"skill-doc-coauthor\",\n\tname: \"Doc Co-author\",\n\tprojectId: \"project_personal_repo\",\n\tupdatedAt: \"2026-05-30T10:24:00Z\",\n\tdescription: \"Collaborative writing, editing, and version tracking for docs.\",\n\tsourcePath: \".agents/skills/doc-coauthor/SKILL.md\"\n}];\nconst deploymentSeed = [{\n\tid: \"deployment-v002\",\n\tprojectId: \"project_personal_repo\",\n\tversion: \"v0.0.2\",\n\tcommit: \"0842e21\",\n\tcommitSha: \"0842e21\",\n\tdeployedBy: \"Dallin Bentley\",\n\tdeployedByEmail: \"dallin@keystroke.ai\",\n\tcreatedAt: \"2026-04-20T15:44:00Z\",\n\tactive: true\n}, {\n\tid: \"deployment-v001\",\n\tprojectId: \"project_personal_repo\",\n\tversion: \"v0.0.1\",\n\tcommit: \"5aeb762\",\n\tcommitSha: \"5aeb762\",\n\tdeployedBy: \"Dallin Bentley\",\n\tdeployedByEmail: \"dallin@keystroke.ai\",\n\tcreatedAt: \"2026-04-18T15:44:00Z\",\n\tactive: false\n}];\nconst projectFileSeed = [\n\t{\n\t\tid: \"file-agents-support-agent\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tpath: \"src/agents/support-agent.ts\",\n\t\tlanguage: \"typescript\",\n\t\tupdatedAt: \"2026-04-20T15:44:00Z\",\n\t\tcontents: `import { defineAgent } from \"@keystrokehq/agent\";\n\nexport const supportAgent = defineAgent({\n key: \"support-agent\",\n name: \"Support Agent\",\n model: \"claude-4-sonnet\",\n instructions: \"Triage support requests and draft helpful replies.\",\n});\n`\n\t},\n\t{\n\t\tid: \"file-workflows-daily-digest\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tpath: \"src/workflows/daily-digest.ts\",\n\t\tlanguage: \"typescript\",\n\t\tupdatedAt: \"2026-04-20T15:12:00Z\",\n\t\tcontents: `import { defineWorkflow } from \"@keystrokehq/workflow\";\n\nexport const dailyDigest = defineWorkflow({\n key: \"daily-digest\",\n name: \"Daily Digest\",\n trigger: \"schedule.daily\",\n async run(ctx) {\n await ctx.step(\"collect-updates\");\n await ctx.step(\"send-summary\");\n },\n});\n`\n\t},\n\t{\n\t\tid: \"file-skills-attio-sync\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tpath: \".agents/skills/attio-sync/SKILL.md\",\n\t\tlanguage: \"markdown\",\n\t\tupdatedAt: \"2026-04-19T18:05:00Z\",\n\t\tcontents: `# Attio Sync\n\nUse this skill when a workflow needs to enrich company or person records from Attio.\n\n## Inputs\n\n- company domain\n- contact email\n- enrichment depth\n\n## Output\n\nNormalized CRM metadata ready for downstream workflow steps.\n`\n\t},\n\t{\n\t\tid: \"file-skills-doc-coauthor\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tpath: \".agents/skills/doc-coauthor/SKILL.md\",\n\t\tlanguage: \"markdown\",\n\t\tupdatedAt: \"2026-05-30T10:24:00Z\",\n\t\tcontents: `# Doc Co-author\n\nUse this skill when a workflow needs to collaboratively write, edit, and track\nversions of a document.\n\n## Inputs\n\n- document title\n- source outline or draft\n- target audience\n\n## Output\n\nA revised document with tracked changes and a short summary of edits.\n`\n\t},\n\t{\n\t\tid: \"file-skills-doc-coauthor-reference\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tpath: \".agents/skills/doc-coauthor/reference.md\",\n\t\tlanguage: \"markdown\",\n\t\tupdatedAt: \"2026-05-30T10:24:00Z\",\n\t\tcontents: `# Reference\n\nStyle and structure guidance the co-author follows when editing docs.\n\n## Voice\n\n- Prefer active voice and short sentences.\n- Keep headings consistent with the existing document.\n\n## Versioning\n\n- Summarize each revision pass.\n- Never drop the reader's original intent.\n`\n\t},\n\t{\n\t\tid: \"file-skills-doc-coauthor-template\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tpath: \".agents/skills/doc-coauthor/templates/outline.md\",\n\t\tlanguage: \"markdown\",\n\t\tupdatedAt: \"2026-05-30T10:24:00Z\",\n\t\tcontents: `# {{title}}\n\n## Summary\n\n## Background\n\n## Details\n\n## Next steps\n`\n\t},\n\t{\n\t\tid: \"file-actions-send-slack\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tpath: \"src/actions/send-slack-message.ts\",\n\t\tlanguage: \"typescript\",\n\t\tupdatedAt: \"2026-04-18T12:30:00Z\",\n\t\tcontents: `import { defineAction } from \"@keystrokehq/action\";\n\nexport const sendSlackMessage = defineAction({\n key: \"send-slack-message\",\n name: \"Send Slack message\",\n async run({ channel, text }) {\n return { channel, text, sent: true };\n },\n});\n`\n\t}\n];\n/** Review personas for mocked project members and API key authors (not org membership). */\nconst mockPersonaSeed = [\n\t{\n\t\tid: \"user_blake_rouse\",\n\t\tname: \"Blake Rouse\",\n\t\temail: \"blake@keystroke.ai\",\n\t\tavatarUrl: \"/icons/avatars/blake-rouse.png\",\n\t\tjoinedAt: \"2026-01-12T18:00:00Z\",\n\t\tlastActiveAt: \"2026-05-31T18:00:00Z\"\n\t},\n\t{\n\t\tid: \"org-member-nate\",\n\t\tname: \"Nate Wells\",\n\t\temail: \"nate@keystroke.ai\",\n\t\tavatarUrl: \"/icons/avatars/nate-kelley.png\",\n\t\tjoinedAt: \"2026-02-03T18:00:00Z\",\n\t\tlastActiveAt: \"2026-05-31T16:00:00Z\"\n\t},\n\t{\n\t\tid: \"org-member-dallin\",\n\t\tname: \"Dallin Bentley\",\n\t\temail: \"dallin@keystroke.ai\",\n\t\tavatarUrl: \"/icons/avatars/dallin-bentley.png\",\n\t\tjoinedAt: \"2026-03-18T18:00:00Z\",\n\t\tlastActiveAt: \"2026-05-30T16:00:00Z\"\n\t},\n\t{\n\t\tid: \"org-member-wells\",\n\t\tname: \"Wells Riley\",\n\t\temail: \"wells@keystroke.ai\",\n\t\tavatarUrl: \"/icons/avatars/wells-bunker.png\",\n\t\tjoinedAt: \"2026-04-09T18:00:00Z\",\n\t\tlastActiveAt: \"2026-05-20T16:00:00Z\"\n\t}\n];\nconst projectMemberSeed = mockPersonaSeed.map((member, index) => ({\n\tid: `project-member-${member.id}`,\n\tprojectId: \"project_personal_repo\",\n\tname: member.name,\n\temail: member.email,\n\trole: index <= 1 ? \"admin\" : \"editor\",\n\tstatus: \"active\",\n\tavatarUrl: member.avatarUrl,\n\tjoinedAt: member.joinedAt,\n\tlastActiveAt: member.lastActiveAt,\n\tisCurrentUser: member.id === \"user_blake_rouse\"\n}));\nconst apiKeySeed = [\n\t{\n\t\tid: \"api-key-local-dev\",\n\t\tname: \"LOCAL_DEV_BLAKE\",\n\t\tkeyPreview: \"******J7Pt\",\n\t\tcreatedAt: \"2026-04-20T15:44:00Z\",\n\t\tcreatedBy: mockPersonaSeed[0],\n\t\tisCreatedByCurrentUser: true\n\t},\n\t{\n\t\tid: \"api-key-ci-deploy\",\n\t\tname: \"CI deploy\",\n\t\tkeyPreview: \"******TJb7\",\n\t\tcreatedAt: \"2026-03-08T15:44:00Z\",\n\t\tcreatedBy: mockPersonaSeed[1],\n\t\tisCreatedByCurrentUser: false\n\t},\n\t{\n\t\tid: \"api-key-partner-webhooks\",\n\t\tname: \"partner_webhooks\",\n\t\tkeyPreview: \"******9Qzc\",\n\t\tcreatedAt: \"2026-02-18T15:44:00Z\",\n\t\tcreatedBy: mockPersonaSeed[2],\n\t\tisCreatedByCurrentUser: false\n\t}\n];\n//#endregion\n//#region src/platform/resources/mock-resources.ts\nlet credentialRecords = [...credentialSeed];\nconst recentProjectNameById = { project_personal_repo: \"Blake's Project\" };\nfunction laterIso(a, b) {\n\treturn new Date(a).getTime() >= new Date(b).getTime() ? a : b;\n}\nfunction hoursBefore(iso, hours) {\n\treturn (/* @__PURE__ */ new Date(new Date(iso).getTime() - hours * 36e5)).toISOString();\n}\nfunction buildRecentResourceSeed() {\n\tconst agentRecents = agentSeed.map((agent, index) => {\n\t\tconst lastModifiedAt = agent.updatedAt;\n\t\tconst lastOpenedAt = hoursBefore(lastModifiedAt, index * 5 + 2);\n\t\treturn {\n\t\t\tid: `recent-agent-${agent.id}`,\n\t\t\tresourceKind: \"agent\",\n\t\t\tresourceId: agent.id,\n\t\t\tname: agent.name,\n\t\t\tdescription: agent.description,\n\t\t\tprojectId: agent.projectId,\n\t\t\tprojectName: recentProjectNameById[agent.projectId] ?? agent.projectId,\n\t\t\tsourcePath: agent.sourcePath,\n\t\t\tsource: \"owned\",\n\t\t\tlastOpenedAt,\n\t\t\tlastModifiedAt\n\t\t};\n\t});\n\tconst workflowRecents = workflowSeed.map((workflow, index) => {\n\t\tconst lastModifiedAt = workflow.updatedAt;\n\t\tconst lastOpenedAt = hoursBefore(lastModifiedAt, index * 4 + 6);\n\t\treturn {\n\t\t\tid: `recent-workflow-${workflow.id}`,\n\t\t\tresourceKind: \"workflow\",\n\t\t\tresourceId: workflow.id,\n\t\t\tname: workflow.name,\n\t\t\tdescription: workflow.description,\n\t\t\tprojectId: workflow.projectId,\n\t\t\tprojectName: recentProjectNameById[workflow.projectId] ?? workflow.projectId,\n\t\t\tsourcePath: workflow.sourcePath,\n\t\t\tsource: \"owned\",\n\t\t\tlastOpenedAt,\n\t\t\tlastModifiedAt\n\t\t};\n\t});\n\tconst skillRecents = skillSeed.map((skill, index) => {\n\t\tconst lastModifiedAt = skill.updatedAt;\n\t\tconst lastOpenedAt = hoursBefore(lastModifiedAt, index * 3 + 1);\n\t\treturn {\n\t\t\tid: `recent-skill-${skill.id}`,\n\t\t\tresourceKind: \"skill\",\n\t\t\tresourceId: skill.id,\n\t\t\tname: skill.name,\n\t\t\tdescription: skill.description,\n\t\t\tprojectId: skill.projectId,\n\t\t\tprojectName: recentProjectNameById[skill.projectId] ?? skill.projectId,\n\t\t\tsourcePath: skill.sourcePath,\n\t\t\tsource: \"owned\",\n\t\t\tlastOpenedAt,\n\t\t\tlastModifiedAt\n\t\t};\n\t});\n\treturn [\n\t\t...agentRecents,\n\t\t...workflowRecents,\n\t\t...skillRecents\n\t].sort((left, right) => {\n\t\tconst leftAt = laterIso(left.lastOpenedAt, left.lastModifiedAt);\n\t\tconst rightAt = laterIso(right.lastOpenedAt, right.lastModifiedAt);\n\t\treturn new Date(rightAt).getTime() - new Date(leftAt).getTime();\n\t});\n}\nfunction createMockApiKeySecret() {\n\tconst secret = `sk_${`${Date.now().toString(36)}${Math.random().toString(36).slice(2, 10)}`}`;\n\treturn {\n\t\tsecret,\n\t\tkeyPreview: `******${secret.slice(-4)}`\n\t};\n}\nfunction createAgentsResource() {\n\treturn {\n\t\tlist: mock({\n\t\t\tdomain: \"agents\",\n\t\t\tmethod: \"list\",\n\t\t\tplannedEndpoint: \"GET /api/agents\"\n\t\t}, async () => agentSeed),\n\t\tget: mock({\n\t\t\tdomain: \"agents\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/agents/:id\"\n\t\t}, async (agentId) => agentSeed.find((agent) => agent.id === agentId) ?? null)\n\t};\n}\nfunction createWorkflowsResource() {\n\treturn {\n\t\tlist: mock({\n\t\t\tdomain: \"workflows\",\n\t\t\tmethod: \"list\",\n\t\t\tplannedEndpoint: \"GET /api/workflows\"\n\t\t}, async () => workflowSeed),\n\t\tget: mock({\n\t\t\tdomain: \"workflows\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/workflows/:id\"\n\t\t}, async (workflowId) => workflowSeed.find((workflow) => workflow.id === workflowId) ?? null)\n\t};\n}\nfunction createSkillsResource() {\n\treturn {\n\t\tlist: mock({\n\t\t\tdomain: \"skills\",\n\t\t\tmethod: \"list\",\n\t\t\tplannedEndpoint: \"GET /api/skills\"\n\t\t}, async () => skillSeed),\n\t\tget: mock({\n\t\t\tdomain: \"skills\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/skills/:id\"\n\t\t}, async (skillId) => skillSeed.find((skill) => skill.id === skillId) ?? null)\n\t};\n}\nfunction createAppsResource() {\n\treturn { listCatalog: mock({\n\t\tdomain: \"apps\",\n\t\tmethod: \"listCatalog\",\n\t\tplannedEndpoint: \"GET /api/apps\"\n\t}, async () => appCatalogSeed) };\n}\nfunction createCredentialsResource() {\n\treturn {\n\t\tlist: mock({\n\t\t\tdomain: \"credentials\",\n\t\t\tmethod: \"list\",\n\t\t\tplannedEndpoint: \"GET /api/credentials\"\n\t\t}, async () => credentialRecords),\n\t\tget: mock({\n\t\t\tdomain: \"credentials\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/credentials/:id\"\n\t\t}, async (credentialId) => credentialRecords.find((credential) => credential.id === credentialId) ?? null),\n\t\tstartOAuthConnection: mock({\n\t\t\tdomain: \"credentials\",\n\t\t\tmethod: \"startOAuthConnection\",\n\t\t\tplannedEndpoint: \"GET /oauth/:key/authorize-url\"\n\t\t}, async (input) => {\n\t\t\tawait new Promise((resolve) => setTimeout(resolve, 900));\n\t\t\treturn {\n\t\t\t\tstatus: \"connected\",\n\t\t\t\tauthorizeUrl: null\n\t\t\t};\n\t\t}),\n\t\tcreate: mock({\n\t\t\tdomain: \"credentials\",\n\t\t\tmethod: \"create\",\n\t\t\tplannedEndpoint: \"POST /api/credentials\"\n\t\t}, async (input) => {\n\t\t\tconst app = appCatalogSeed.find((entry) => entry.id === input.appId);\n\t\t\tconst now = (/* @__PURE__ */ new Date()).toISOString();\n\t\t\tconst keyName = `${(app?.name ?? \"APP\").toUpperCase().replace(/\\W+/g, \"_\")}_API_KEY`;\n\t\t\tconst base = {\n\t\t\t\tappId: input.appId,\n\t\t\t\tappName: app?.name,\n\t\t\t\tstatus: \"Active\",\n\t\t\t\tconnectionKind: input.connectionKind,\n\t\t\t\tcreatedAt: now,\n\t\t\t\tlastRefreshedAt: now,\n\t\t\t\tlastUsedAt: null,\n\t\t\t\tisDefault: false,\n\t\t\t\tgrantedScopes: input.scopes,\n\t\t\t\tcredentialKeys: input.apiKey ? [keyName] : void 0,\n\t\t\t\tkeyPreviews: input.apiKey ? { [keyName]: maskSecretPreview(input.apiKey) } : void 0,\n\t\t\t\townerUserId: \"user_blake_rouse\",\n\t\t\t\townerName: \"Blake Rouse\"\n\t\t\t};\n\t\t\tconst created = [\n\t\t\t\t...input.projectIds.map((projectId) => ({\n\t\t\t\t\t...base,\n\t\t\t\t\tid: `cred-${input.appId}-${projectId}-${Date.now().toString(36)}`,\n\t\t\t\t\tlabel: `${app?.name ?? input.appId} project credential`,\n\t\t\t\t\tscope: \"project\",\n\t\t\t\t\tprojectId\n\t\t\t\t})),\n\t\t\t\t...input.createOrganizationCredential ? [{\n\t\t\t\t\t...base,\n\t\t\t\t\tid: `cred-${input.appId}-org-${Date.now().toString(36)}`,\n\t\t\t\t\tlabel: `${app?.name ?? input.appId} organization credential`,\n\t\t\t\t\tscope: \"organization\"\n\t\t\t\t}] : [],\n\t\t\t\t...input.createUserProvidedCredential ? [{\n\t\t\t\t\t...base,\n\t\t\t\t\tid: `cred-${input.appId}-user-${Date.now().toString(36)}`,\n\t\t\t\t\tlabel: `${app?.name ?? input.appId} personal credential`,\n\t\t\t\t\tscope: \"user\"\n\t\t\t\t}] : []\n\t\t\t];\n\t\t\tcredentialRecords = [...created, ...credentialRecords];\n\t\t\treturn created;\n\t\t}),\n\t\tupdate: mock({\n\t\t\tdomain: \"credentials\",\n\t\t\tmethod: \"update\",\n\t\t\tplannedEndpoint: \"PATCH /api/credentials/:id\"\n\t\t}, async (credentialId, patch) => {\n\t\t\tconst target = credentialRecords.find((credential) => credential.id === credentialId);\n\t\t\tif (!target) return null;\n\t\t\tconst settingDefault = patch.isDefault === true;\n\t\t\tcredentialRecords = credentialRecords.map((credential) => {\n\t\t\t\tif (credential.id === credentialId) return {\n\t\t\t\t\t...credential,\n\t\t\t\t\t...patch.label !== void 0 ? { label: patch.label } : {},\n\t\t\t\t\t...patch.isDefault !== void 0 ? { isDefault: patch.isDefault } : {}\n\t\t\t\t};\n\t\t\t\tif (settingDefault && credential.appId === target.appId && credential.scope === target.scope) return {\n\t\t\t\t\t...credential,\n\t\t\t\t\tisDefault: false\n\t\t\t\t};\n\t\t\t\treturn credential;\n\t\t\t});\n\t\t\treturn credentialRecords.find((credential) => credential.id === credentialId) ?? null;\n\t\t})\n\t};\n}\n/** Masked preview of a secret — last 4 chars revealed, the rest masked. */\nfunction maskSecretPreview(value) {\n\tconst trimmed = value.trim();\n\tif (trimmed.length <= 4) return \"•\".repeat(Math.max(trimmed.length, 4));\n\treturn `${\"•\".repeat(Math.min(trimmed.length - 4, 20))}${trimmed.slice(-4)}`;\n}\nfunction createDeploymentsResource() {\n\treturn { listForProject: mock({\n\t\tdomain: \"deployments\",\n\t\tmethod: \"listForProject\",\n\t\tplannedEndpoint: \"GET /api/projects/:id/deployments\"\n\t}, async (projectId) => {\n\t\treturn deploymentSeed.map((deployment) => ({\n\t\t\t...deployment,\n\t\t\tprojectId\n\t\t}));\n\t}) };\n}\nfunction createProjectMetricsResource() {\n\treturn { list: mock({\n\t\tdomain: \"projectMetrics\",\n\t\tmethod: \"list\",\n\t\tplannedEndpoint: \"GET /api/projects/metrics\"\n\t}, async () => ({})) };\n}\nfunction createProjectFilesResource() {\n\treturn { listForProject: mock({\n\t\tdomain: \"projectFiles\",\n\t\tmethod: \"listForProject\",\n\t\tplannedEndpoint: \"GET /api/projects/:id/files\"\n\t}, async (projectId) => projectFileSeed.map((file) => ({\n\t\t...file,\n\t\tprojectId\n\t}))) };\n}\nconst projectMembersStore = /* @__PURE__ */ new Map();\nfunction getProjectMembers(projectId) {\n\tlet members = projectMembersStore.get(projectId);\n\tif (!members) {\n\t\tmembers = projectMemberSeed.map((member) => ({\n\t\t\t...member,\n\t\t\tprojectId\n\t\t}));\n\t\tprojectMembersStore.set(projectId, members);\n\t}\n\treturn members;\n}\n/** Derive a best-effort display name from an email local part. */\nfunction displayNameFromEmail(email) {\n\treturn (email.split(\"@\")[0] ?? email).split(/[._-]+/).filter((part) => part.length > 0).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(\" \");\n}\nfunction createMembersResource(http) {\n\treturn {\n\t\t...createMembersResource$1(http),\n\t\tlistForProject: mock({\n\t\t\tdomain: \"members\",\n\t\t\tmethod: \"listForProject\",\n\t\t\tplannedEndpoint: \"GET /api/projects/:id/members\"\n\t\t}, async (projectId) => [...getProjectMembers(projectId)]),\n\t\tinviteToProject: mock({\n\t\t\tdomain: \"members\",\n\t\t\tmethod: \"inviteToProject\",\n\t\t\tplannedEndpoint: \"POST /api/projects/:id/members/invitations\"\n\t\t}, async (input) => {\n\t\t\tconst members = getProjectMembers(input.projectId);\n\t\t\tconst pendingOrgEmails = new Set((input.pendingOrgEmails ?? []).map((email) => email.toLowerCase()));\n\t\t\tconst seen = new Set(members.map((member) => member.email.toLowerCase()));\n\t\t\tconst invited = [];\n\t\t\tinput.emails.forEach((email, index) => {\n\t\t\t\tconst key = email.toLowerCase();\n\t\t\t\tif (seen.has(key)) return;\n\t\t\t\tseen.add(key);\n\t\t\t\tinvited.push({\n\t\t\t\t\tid: `project-member-invite-${Date.now().toString(36)}-${index}`,\n\t\t\t\t\tprojectId: input.projectId,\n\t\t\t\t\tname: displayNameFromEmail(email),\n\t\t\t\t\temail,\n\t\t\t\t\trole: input.role,\n\t\t\t\t\tstatus: pendingOrgEmails.has(key) ? \"invited\" : \"active\",\n\t\t\t\t\tjoinedAt: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\t\t\tlastActiveAt: null\n\t\t\t\t});\n\t\t\t});\n\t\t\tif (invited.length > 0) projectMembersStore.set(input.projectId, [...members, ...invited]);\n\t\t\treturn { invited };\n\t\t})\n\t};\n}\nlet apiKeyRecords = [...apiKeySeed];\nfunction createApiKeysResource() {\n\treturn {\n\t\tlist: mock({\n\t\t\tdomain: \"apiKeys\",\n\t\t\tmethod: \"list\",\n\t\t\tplannedEndpoint: \"GET /api/api-keys\"\n\t\t}, async () => apiKeyRecords),\n\t\tcreate: mock({\n\t\t\tdomain: \"apiKeys\",\n\t\t\tmethod: \"create\",\n\t\t\tplannedEndpoint: \"POST /api/api-keys\"\n\t\t}, async (input) => {\n\t\t\tconst { secret, keyPreview } = createMockApiKeySecret();\n\t\t\tconst created = {\n\t\t\t\tid: `api-key-${Date.now().toString(36)}`,\n\t\t\t\tname: input.name,\n\t\t\t\tkeyPreview,\n\t\t\t\tcreatedAt: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\t\tcreatedBy: mockPersonaSeed[0],\n\t\t\t\tisCreatedByCurrentUser: true\n\t\t\t};\n\t\t\tapiKeyRecords = [created, ...apiKeyRecords];\n\t\t\treturn {\n\t\t\t\t...created,\n\t\t\t\tsecret\n\t\t\t};\n\t\t}),\n\t\trevoke: mock({\n\t\t\tdomain: \"apiKeys\",\n\t\t\tmethod: \"revoke\",\n\t\t\tplannedEndpoint: \"DELETE /api/api-keys/:id\"\n\t\t}, async (apiKeyId) => {\n\t\t\tapiKeyRecords = apiKeyRecords.filter((apiKey) => apiKey.id !== apiKeyId);\n\t\t})\n\t};\n}\nfunction createRecentsResource() {\n\treturn { list: mock({\n\t\tdomain: \"recents\",\n\t\tmethod: \"list\",\n\t\tplannedEndpoint: \"GET /api/recents\"\n\t}, async () => buildRecentResourceSeed()) };\n}\n//#endregion\n//#region src/platform/resources/mock-history.ts\nconst historyProjectNameById = { project_personal_repo: \"Blake's Project\" };\nconst MOCK_ACTOR = {\n\tuserId: \"user_blake\",\n\tname: \"Blake Rouse\",\n\tavatarUrl: null\n};\nfunction buildCompletedUsage(durationMs) {\n\treturn {\n\t\trunDurationMs: durationMs,\n\t\tlineItems: [\n\t\t\t{\n\t\t\t\tid: \"claude-opus\",\n\t\t\t\tlabel: \"Claude Opus 4.8\",\n\t\t\t\tamountUsd: .413\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"gemini-flash\",\n\t\t\t\tlabel: \"Gemini Flash 3.5\",\n\t\t\t\tamountUsd: .001\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"daytona\",\n\t\t\t\tlabel: \"Daytona Sandbox\",\n\t\t\t\tamountUsd: .188\n\t\t\t}\n\t\t],\n\t\ttotalExcludingDurationUsd: .603\n\t};\n}\nfunction buildRunningUsage() {\n\treturn {\n\t\trunDurationMs: null,\n\t\tlineItems: [],\n\t\ttotalExcludingDurationUsd: null\n\t};\n}\nfunction buildFailedUsage(durationMs) {\n\tif (durationMs == null) return {\n\t\trunDurationMs: null,\n\t\tlineItems: [],\n\t\ttotalExcludingDurationUsd: null\n\t};\n\treturn {\n\t\trunDurationMs: durationMs,\n\t\tlineItems: [{\n\t\t\tid: \"claude-opus\",\n\t\t\tlabel: \"Claude Opus 4.8\",\n\t\t\tamountUsd: .021\n\t\t}],\n\t\ttotalExcludingDurationUsd: .021\n\t};\n}\nfunction workflowKeyFromId(workflowId) {\n\tconst row = workflowSeed.find((workflow) => workflow.id === workflowId);\n\tif (!row?.sourcePath) return workflowId;\n\treturn row.sourcePath.match(/\\/([^/]+)\\.ts$/)?.[1] ?? workflowId;\n}\nfunction agentKeyFromId(agentId) {\n\tconst row = agentSeed.find((agent) => agent.id === agentId);\n\tif (!row?.sourcePath) return agentId;\n\treturn row.sourcePath.match(/\\/([^/]+)\\.ts$/)?.[1] ?? agentId;\n}\nconst historyRunSeed = [\n\t{\n\t\tid: \"run-support-agent-001\",\n\t\tkind: \"agent\",\n\t\ttraceId: \"run-support-agent-001\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tprojectName: historyProjectNameById.project_personal_repo ?? \"Project\",\n\t\tresourceKey: agentKeyFromId(\"agent-support\"),\n\t\tresourceId: \"agent-support\",\n\t\tresourceName: \"Support Agent\",\n\t\tstatus: \"completed\",\n\t\ttriggeredAt: \"2026-04-20T15:44:00Z\",\n\t\ttimeInQueueMs: 85,\n\t\tstartedAt: \"2026-04-20T15:44:00Z\",\n\t\tfinishedAt: \"2026-04-20T15:44:42Z\",\n\t\tdurationMs: 42e3,\n\t\ttriggerLabel: \"Gateway\",\n\t\ttriggerRaw: \"gateway\",\n\t\tranAs: MOCK_ACTOR,\n\t\tmodelsUsed: [\"Claude Opus 4.8\", \"Gemini Flash 3.5\"],\n\t\totherServicesUsed: [\"Slack\", \"Daytona Sandbox\"],\n\t\ttotalCostUsd: .603,\n\t\tmessageCount: 8\n\t},\n\t{\n\t\tid: \"run-daily-digest-001\",\n\t\tkind: \"workflow\",\n\t\ttraceId: \"run-daily-digest-001\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tprojectName: historyProjectNameById.project_personal_repo ?? \"Project\",\n\t\tresourceKey: workflowKeyFromId(\"workflow-daily-digest\"),\n\t\tresourceId: \"workflow-daily-digest\",\n\t\tresourceName: \"Daily Digest\",\n\t\tstatus: \"running\",\n\t\ttriggeredAt: \"2026-04-20T15:12:00Z\",\n\t\ttimeInQueueMs: null,\n\t\tstartedAt: \"2026-04-20T15:12:00Z\",\n\t\tfinishedAt: null,\n\t\tdurationMs: null,\n\t\ttriggerLabel: \"Cron\",\n\t\ttriggerRaw: \"cron\",\n\t\tranAs: MOCK_ACTOR,\n\t\tmodelsUsed: [],\n\t\totherServicesUsed: [],\n\t\ttotalCostUsd: null,\n\t\tstepCount: 1\n\t},\n\t{\n\t\tid: \"run-support-agent-000\",\n\t\tkind: \"agent\",\n\t\ttraceId: \"run-support-agent-000\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tprojectName: historyProjectNameById.project_personal_repo ?? \"Project\",\n\t\tresourceKey: agentKeyFromId(\"agent-support\"),\n\t\tresourceId: \"agent-support\",\n\t\tresourceName: \"Support Agent\",\n\t\tstatus: \"failed\",\n\t\ttriggeredAt: \"2026-04-19T18:22:00Z\",\n\t\ttimeInQueueMs: 45,\n\t\tstartedAt: \"2026-04-19T18:22:00Z\",\n\t\tfinishedAt: \"2026-04-19T18:22:12Z\",\n\t\tdurationMs: 12e3,\n\t\ttriggerLabel: \"Gateway\",\n\t\ttriggerRaw: \"gateway\",\n\t\tranAs: MOCK_ACTOR,\n\t\tmodelsUsed: [\"Claude Opus 4.8\"],\n\t\totherServicesUsed: [\"Slack\"],\n\t\ttotalCostUsd: .021,\n\t\tmessageCount: 2\n\t},\n\t{\n\t\tid: \"run-email-triage-002\",\n\t\tkind: \"workflow\",\n\t\ttraceId: \"run-email-triage-002\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tprojectName: historyProjectNameById.project_personal_repo ?? \"Project\",\n\t\tresourceKey: workflowKeyFromId(\"workflow-email-triage\"),\n\t\tresourceId: \"workflow-email-triage\",\n\t\tresourceName: \"Email Triage\",\n\t\tstatus: \"failed\",\n\t\ttriggeredAt: \"2026-05-31T16:40:05Z\",\n\t\ttimeInQueueMs: 120,\n\t\tstartedAt: \"2026-05-31T16:40:05Z\",\n\t\tfinishedAt: \"2026-05-31T16:40:18Z\",\n\t\tdurationMs: 13e3,\n\t\ttriggerLabel: \"Webhook\",\n\t\ttriggerRaw: \"webhook\",\n\t\tranAs: MOCK_ACTOR,\n\t\tmodelsUsed: [\"Claude Opus 4.8\"],\n\t\totherServicesUsed: [\"Gmail\"],\n\t\ttotalCostUsd: .021,\n\t\tstepCount: 2\n\t},\n\t{\n\t\tid: \"run-research-agent-003\",\n\t\tkind: \"agent\",\n\t\ttraceId: \"run-research-agent-003\",\n\t\tprojectId: \"project_personal_repo\",\n\t\tprojectName: historyProjectNameById.project_personal_repo ?? \"Project\",\n\t\tresourceKey: agentKeyFromId(\"agent-research\"),\n\t\tresourceId: \"agent-research\",\n\t\tresourceName: \"Research Agent\",\n\t\tstatus: \"completed\",\n\t\ttriggeredAt: \"2026-06-01T09:15:00Z\",\n\t\ttimeInQueueMs: 210,\n\t\tstartedAt: \"2026-06-01T09:15:00Z\",\n\t\tfinishedAt: \"2026-06-01T09:16:24Z\",\n\t\tdurationMs: 84e3,\n\t\ttriggerLabel: \"API\",\n\t\ttriggerRaw: \"api\",\n\t\tranAs: MOCK_ACTOR,\n\t\tmodelsUsed: [\"Claude Opus 4.8\"],\n\t\totherServicesUsed: [\"Exa\"],\n\t\ttotalCostUsd: .603,\n\t\tmessageCount: 12\n\t}\n];\nconst historyRunById = Object.fromEntries(historyRunSeed.map((run) => [run.id, run]));\n/** Resolve a seed run by id so fixtures stay consistent if the seed is reordered. */\nfunction runById(id) {\n\tconst run = historyRunById[id];\n\tif (!run) throw new Error(`Unknown history run: ${id}`);\n\treturn run;\n}\nlet historyRuns = historyRunSeed.map((run) => ({ ...run }));\nconst historyRunStatusOverrides = /* @__PURE__ */ new Map();\nfunction listHistoryRuns() {\n\treturn historyRuns;\n}\n/**\n* Cancel a running/queued run. Terminal runs are returned unchanged. Updates the\n* list row and records an override so {@link getHistoryRunDetail} stays in sync.\n*/\nfunction cancelHistoryRun(runId) {\n\tconst run = historyRuns.find((entry) => entry.id === runId);\n\tif (!run) return null;\n\tif (run.status !== \"running\" && run.status !== \"pending\") return run;\n\tconst finishedAt = (/* @__PURE__ */ new Date()).toISOString();\n\tconst durationMs = run.startedAt ? Math.max(0, new Date(finishedAt).getTime() - new Date(run.startedAt).getTime()) : run.durationMs;\n\tconst canceled = {\n\t\t...run,\n\t\tstatus: \"canceled\",\n\t\tfinishedAt,\n\t\tdurationMs\n\t};\n\thistoryRuns = historyRuns.map((entry) => entry.id === runId ? canceled : entry);\n\thistoryRunStatusOverrides.set(runId, {\n\t\tstatus: \"canceled\",\n\t\tfinishedAt\n\t});\n\treturn canceled;\n}\nfunction buildSupportAgentTrace(runId, failed) {\n\tconst run = runById(runId);\n\tconst startedAt = run.startedAt;\n\tconst finishedAt = run.finishedAt ?? run.startedAt;\n\tconst sessionSpanId = `span-session-${runId}`;\n\treturn {\n\t\ttraceId: runId,\n\t\ttrigger: {\n\t\t\ttriggerType: \"gateway\",\n\t\t\ttriggerRunId: `trigger-${runId}`,\n\t\t\tagentKey: \"support-agent\",\n\t\t\tattachmentId: \"attach-slack-incoming\",\n\t\t\tattachmentKey: \"slack-incoming\",\n\t\t\troute: \"/agents/support-agent\",\n\t\t\tsourcePath: \"src/triggers/slack-message.ts\"\n\t\t},\n\t\tgateway: {\n\t\t\tgatewayAttachmentId: \"attach-slack-incoming\",\n\t\t\tgatewayAttachmentKey: \"slack-incoming\",\n\t\t\tthreadId: \"C01234567\",\n\t\t\tchannelId: \"support-escalations\",\n\t\t\tmode: \"thread\"\n\t\t},\n\t\tspans: [{\n\t\t\tid: sessionSpanId,\n\t\t\ttraceId: runId,\n\t\t\tparentSpanId: null,\n\t\t\tkind: \"agent_session\",\n\t\t\trefId: runId,\n\t\t\tname: \"Support Agent\",\n\t\t\tstatus: failed ? \"error\" : \"ok\",\n\t\t\tstartedAt,\n\t\t\tfinishedAt,\n\t\t\tmetadata: { messageCount: failed ? 2 : 8 },\n\t\t\terror: failed ? { message: \"Credential expired\" } : null\n\t\t}, {\n\t\t\tid: `span-tool-${runId}`,\n\t\t\ttraceId: runId,\n\t\t\tparentSpanId: sessionSpanId,\n\t\t\tkind: \"tool_call\",\n\t\t\trefId: `tool-${runId}`,\n\t\t\tname: \"post_slack_reply\",\n\t\t\tstatus: failed ? \"error\" : \"ok\",\n\t\t\tstartedAt,\n\t\t\tfinishedAt,\n\t\t\tmetadata: null,\n\t\t\terror: failed ? { message: \"oauth_token_expired\" } : null\n\t\t}],\n\t\tlogs: [{\n\t\t\tid: `log-${runId}-1`,\n\t\t\ttraceId: runId,\n\t\t\tspanId: sessionSpanId,\n\t\t\tseq: 1,\n\t\t\tlevel: \"info\",\n\t\t\tmessage: failed ? \"Received Slack message\" : \"Session started from gateway thread\",\n\t\t\tdata: null,\n\t\t\tsource: \"system\",\n\t\t\tcreatedAt: startedAt\n\t\t}, {\n\t\t\tid: `log-${runId}-2`,\n\t\t\ttraceId: runId,\n\t\t\tspanId: sessionSpanId,\n\t\t\tseq: 2,\n\t\t\tlevel: failed ? \"error\" : \"info\",\n\t\t\tmessage: failed ? \"Credential expired before response could be posted.\" : \"Drafted three support replies.\",\n\t\t\tdata: null,\n\t\t\tsource: \"system\",\n\t\t\tcreatedAt: finishedAt\n\t\t}]\n\t};\n}\nfunction buildDailyDigestTrace() {\n\treturn {\n\t\ttraceId: \"run-daily-digest-001\",\n\t\ttrigger: {\n\t\t\ttriggerType: \"cron\",\n\t\t\ttriggerRunId: \"trigger-daily-digest-001\",\n\t\t\tworkflowKey: \"daily-digest\",\n\t\t\tattachmentId: \"attach-schedule-daily\",\n\t\t\tattachmentKey: \"schedule-daily\",\n\t\t\troute: \"/workflows/daily-digest\",\n\t\t\tsourcePath: \"src/triggers/daily-digest.ts\"\n\t\t},\n\t\tgateway: null,\n\t\tspans: [{\n\t\t\tid: \"span-wf-daily-001\",\n\t\t\ttraceId: \"run-daily-digest-001\",\n\t\t\tparentSpanId: null,\n\t\t\tkind: \"workflow_run\",\n\t\t\trefId: \"run-daily-digest-001\",\n\t\t\tname: \"Daily Digest\",\n\t\t\tstatus: \"running\",\n\t\t\tstartedAt: \"2026-04-20T15:12:00Z\",\n\t\t\tfinishedAt: null,\n\t\t\tmetadata: null,\n\t\t\terror: null\n\t\t}, {\n\t\t\tid: \"span-action-collect\",\n\t\t\ttraceId: \"run-daily-digest-001\",\n\t\t\tparentSpanId: \"span-wf-daily-001\",\n\t\t\tkind: \"action\",\n\t\t\trefId: \"step-collect\",\n\t\t\tname: \"collect_updates\",\n\t\t\tstatus: \"ok\",\n\t\t\tstartedAt: \"2026-04-20T15:12:02Z\",\n\t\t\tfinishedAt: \"2026-04-20T15:12:45Z\",\n\t\t\tmetadata: {\n\t\t\t\trunId: \"run-daily-digest-001\",\n\t\t\t\tactionKey: \"collect_updates\"\n\t\t\t},\n\t\t\terror: null\n\t\t}],\n\t\tlogs: [{\n\t\t\tid: \"log-daily-1\",\n\t\t\ttraceId: \"run-daily-digest-001\",\n\t\t\tspanId: \"span-wf-daily-001\",\n\t\t\tseq: 1,\n\t\t\tlevel: \"info\",\n\t\t\tmessage: \"Cron tick fired\",\n\t\t\tdata: null,\n\t\t\tsource: \"system\",\n\t\t\tcreatedAt: \"2026-04-20T15:12:00Z\"\n\t\t}, {\n\t\t\tid: \"log-daily-2\",\n\t\t\ttraceId: \"run-daily-digest-001\",\n\t\t\tspanId: \"span-wf-daily-001\",\n\t\t\tseq: 2,\n\t\t\tlevel: \"info\",\n\t\t\tmessage: \"Collecting project updates.\",\n\t\t\tdata: null,\n\t\t\tsource: \"console\",\n\t\t\tcreatedAt: \"2026-04-20T15:12:46Z\"\n\t\t}]\n\t};\n}\nfunction buildEmailTriageDetail() {\n\treturn {\n\t\tkind: \"workflow\",\n\t\trun: {\n\t\t\tid: \"run-email-triage-002\",\n\t\t\tworkflowKey: \"email-triage\",\n\t\t\tstatus: \"failed\",\n\t\t\ttrigger: \"webhook\",\n\t\t\ttriggeredAt: \"2026-05-31T16:40:05Z\",\n\t\t\tstartedAt: \"2026-05-31T16:40:05Z\",\n\t\t\tfinishedAt: \"2026-05-31T16:40:18Z\",\n\t\t\tinput: { messageId: \"msg_abc123\" },\n\t\t\toutput: null,\n\t\t\terror: { message: \"Step classify failed: missing Gmail scope.\" }\n\t\t},\n\t\ttrigger: {\n\t\t\tid: \"trigger-email-002\",\n\t\t\tattachmentKey: \"gmail-new-message\",\n\t\t\ttriggerType: \"webhook\",\n\t\t\tsourcePath: \"src/triggers/gmail-new-message.ts\",\n\t\t\tpayload: { messageId: \"msg_abc123\" },\n\t\t\ttriggeredAt: \"2026-05-31T16:40:05Z\"\n\t\t},\n\t\tsteps: [{\n\t\t\tid: \"step-ingest-002\",\n\t\t\tactionKey: \"ingest\",\n\t\t\toutput: { ok: true },\n\t\t\tcompletedAt: \"2026-05-31T16:40:10Z\"\n\t\t}, {\n\t\t\tid: \"step-classify-002\",\n\t\t\tactionKey: \"classify\",\n\t\t\toutput: { error: \"missing_scope\" },\n\t\t\tcompletedAt: \"2026-05-31T16:40:18Z\"\n\t\t}],\n\t\ttrace: {\n\t\t\ttraceId: \"run-email-triage-002\",\n\t\t\ttrigger: {\n\t\t\t\ttriggerType: \"webhook\",\n\t\t\t\ttriggerRunId: \"trigger-email-002\",\n\t\t\t\tworkflowKey: \"email-triage\",\n\t\t\t\tattachmentId: \"attach-gmail-new-message\",\n\t\t\t\tattachmentKey: \"gmail-new-message\",\n\t\t\t\troute: \"/workflows/email-triage\"\n\t\t\t},\n\t\t\tgateway: null,\n\t\t\tspans: [{\n\t\t\t\tid: \"span-wf-email-002\",\n\t\t\t\ttraceId: \"run-email-triage-002\",\n\t\t\t\tparentSpanId: null,\n\t\t\t\tkind: \"workflow_run\",\n\t\t\t\trefId: \"run-email-triage-002\",\n\t\t\t\tname: \"Email Triage\",\n\t\t\t\tstatus: \"error\",\n\t\t\t\tstartedAt: \"2026-05-31T16:40:05Z\",\n\t\t\t\tfinishedAt: \"2026-05-31T16:40:18Z\",\n\t\t\t\tmetadata: null,\n\t\t\t\terror: { message: \"Step classify failed\" }\n\t\t\t}],\n\t\t\tlogs: [{\n\t\t\t\tid: \"log-email-1\",\n\t\t\t\ttraceId: \"run-email-triage-002\",\n\t\t\t\tspanId: \"span-wf-email-002\",\n\t\t\t\tseq: 1,\n\t\t\t\tlevel: \"error\",\n\t\t\t\tmessage: \"Step classify failed: missing Gmail scope.\",\n\t\t\t\tdata: { step: \"classify\" },\n\t\t\t\tsource: \"system\",\n\t\t\t\tcreatedAt: \"2026-05-31T16:40:18Z\"\n\t\t\t}]\n\t\t},\n\t\tranAs: MOCK_ACTOR,\n\t\tusage: buildFailedUsage(13e3)\n\t};\n}\nconst historyDetailById = {\n\t\"run-support-agent-001\": {\n\t\tkind: \"agent\",\n\t\tsession: {\n\t\t\tid: \"run-support-agent-001\",\n\t\t\tagentKey: \"support-agent\",\n\t\t\tstatus: \"completed\",\n\t\t\tsource: \"gateway\",\n\t\t\tsourceId: \"gw-slack-incoming\",\n\t\t\tcreatedAt: \"2026-04-20T15:44:00Z\",\n\t\t\tupdatedAt: \"2026-04-20T15:44:42Z\",\n\t\t\tmessageCount: 8,\n\t\t\terror: null\n\t\t},\n\t\tgateway: {\n\t\t\tthreadId: \"C01234567\",\n\t\t\tattachmentKey: \"slack-incoming\"\n\t\t},\n\t\tmessages: [{\n\t\t\trole: \"user\",\n\t\t\tcontent: \"Customer asked about billing cycle.\"\n\t\t}, {\n\t\t\trole: \"assistant\",\n\t\t\tcontent: \"Drafted reply with prorated credit explanation.\"\n\t\t}],\n\t\ttrace: buildSupportAgentTrace(\"run-support-agent-001\", false),\n\t\tranAs: MOCK_ACTOR,\n\t\tusage: buildCompletedUsage(42e3)\n\t},\n\t\"run-support-agent-000\": {\n\t\tkind: \"agent\",\n\t\tsession: {\n\t\t\tid: \"run-support-agent-000\",\n\t\t\tagentKey: \"support-agent\",\n\t\t\tstatus: \"failed\",\n\t\t\tsource: \"gateway\",\n\t\t\tsourceId: \"gw-slack-incoming\",\n\t\t\tcreatedAt: \"2026-04-19T18:22:00Z\",\n\t\t\tupdatedAt: \"2026-04-19T18:22:12Z\",\n\t\t\tmessageCount: 2,\n\t\t\terror: { message: \"Credential expired\" }\n\t\t},\n\t\tgateway: {\n\t\t\tthreadId: \"C09876543\",\n\t\t\tattachmentKey: \"slack-incoming\"\n\t\t},\n\t\tmessages: [{\n\t\t\trole: \"user\",\n\t\t\tcontent: \"Urgent refund request in #support.\"\n\t\t}],\n\t\ttrace: buildSupportAgentTrace(\"run-support-agent-000\", true),\n\t\tranAs: MOCK_ACTOR,\n\t\tusage: buildFailedUsage(12e3)\n\t},\n\t\"run-daily-digest-001\": {\n\t\tkind: \"workflow\",\n\t\trun: {\n\t\t\tid: \"run-daily-digest-001\",\n\t\t\tworkflowKey: \"daily-digest\",\n\t\t\tstatus: \"running\",\n\t\t\ttrigger: \"cron\",\n\t\t\ttriggeredAt: \"2026-04-20T15:12:00Z\",\n\t\t\tstartedAt: \"2026-04-20T15:12:00Z\",\n\t\t\tfinishedAt: null,\n\t\t\tinput: { date: \"2026-04-20\" },\n\t\t\toutput: null,\n\t\t\terror: null\n\t\t},\n\t\ttrigger: {\n\t\t\tid: \"trigger-daily-digest-001\",\n\t\t\tattachmentKey: \"schedule-daily\",\n\t\t\ttriggerType: \"cron\",\n\t\t\tsourcePath: \"src/triggers/daily-digest.ts\",\n\t\t\tpayload: { schedule: \"0 8 * * *\" },\n\t\t\ttriggeredAt: \"2026-04-20T15:12:00Z\"\n\t\t},\n\t\tsteps: [{\n\t\t\tid: \"step-collect-001\",\n\t\t\tactionKey: \"collect_updates\",\n\t\t\toutput: { projects: 3 },\n\t\t\tcompletedAt: \"2026-04-20T15:12:45Z\"\n\t\t}],\n\t\ttrace: buildDailyDigestTrace(),\n\t\tranAs: MOCK_ACTOR,\n\t\tusage: buildRunningUsage()\n\t},\n\t\"run-email-triage-002\": buildEmailTriageDetail(),\n\t\"run-research-agent-003\": {\n\t\tkind: \"agent\",\n\t\tsession: {\n\t\t\tid: \"run-research-agent-003\",\n\t\t\tagentKey: \"research-agent\",\n\t\t\tstatus: \"completed\",\n\t\t\tsource: \"api\",\n\t\t\tsourceId: null,\n\t\t\tcreatedAt: \"2026-06-01T09:15:00Z\",\n\t\t\tupdatedAt: \"2026-06-01T09:16:24Z\",\n\t\t\tmessageCount: 12,\n\t\t\terror: null\n\t\t},\n\t\tgateway: null,\n\t\tmessages: [{\n\t\t\trole: \"user\",\n\t\t\tcontent: \"Summarize the Q2 roadmap doc.\"\n\t\t}, {\n\t\t\trole: \"assistant\",\n\t\t\tcontent: \"Found 4 themes: platform, agents, billing, design.\"\n\t\t}],\n\t\ttrace: {\n\t\t\ttraceId: \"run-research-agent-003\",\n\t\t\ttrigger: {\n\t\t\t\ttriggerType: \"api\",\n\t\t\t\ttriggerRunId: \"trigger-research-003\",\n\t\t\t\tagentKey: \"research-agent\",\n\t\t\t\troute: \"/agents/research-agent\"\n\t\t\t},\n\t\t\tgateway: null,\n\t\t\tspans: [{\n\t\t\t\tid: \"span-research-003\",\n\t\t\t\ttraceId: \"run-research-agent-003\",\n\t\t\t\tparentSpanId: null,\n\t\t\t\tkind: \"agent_session\",\n\t\t\t\trefId: \"run-research-agent-003\",\n\t\t\t\tname: \"Research Agent\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\tstartedAt: \"2026-06-01T09:15:00Z\",\n\t\t\t\tfinishedAt: \"2026-06-01T09:16:24Z\",\n\t\t\t\tmetadata: { messageCount: 12 },\n\t\t\t\terror: null\n\t\t\t}],\n\t\t\tlogs: [{\n\t\t\t\tid: \"log-research-1\",\n\t\t\t\ttraceId: \"run-research-agent-003\",\n\t\t\t\tspanId: \"span-research-003\",\n\t\t\t\tseq: 1,\n\t\t\t\tlevel: \"info\",\n\t\t\t\tmessage: \"Summarized 4 documents and returned citations.\",\n\t\t\t\tdata: null,\n\t\t\t\tsource: \"system\",\n\t\t\t\tcreatedAt: \"2026-06-01T09:16:24Z\"\n\t\t\t}]\n\t\t},\n\t\tranAs: MOCK_ACTOR,\n\t\tusage: buildCompletedUsage(84e3)\n\t}\n};\nfunction applyRunStatusOverride(detail, override) {\n\tif (detail.kind === \"workflow\") return {\n\t\t...detail,\n\t\trun: {\n\t\t\t...detail.run,\n\t\t\tstatus: override.status,\n\t\t\tfinishedAt: override.finishedAt\n\t\t}\n\t};\n\treturn {\n\t\t...detail,\n\t\tsession: {\n\t\t\t...detail.session,\n\t\t\tstatus: override.status,\n\t\t\tupdatedAt: override.finishedAt ?? detail.session.updatedAt\n\t\t}\n\t};\n}\nfunction getHistoryRunDetail(runId) {\n\tconst detail = historyDetailById[runId];\n\tif (!detail) return null;\n\tconst override = historyRunStatusOverrides.get(runId);\n\treturn override ? applyRunStatusOverride(detail, override) : detail;\n}\n//#endregion\n//#region src/platform/resources/mock-history-resource.ts\nfunction createHistoryResource() {\n\treturn {\n\t\t/** Runs across projects the current user can access in the active org. */\n\t\tlist: mock({\n\t\t\tdomain: \"history\",\n\t\t\tmethod: \"list\",\n\t\t\tplannedEndpoint: \"GET /api/orgs/:orgSlug/history\"\n\t\t}, async () => [...listHistoryRuns()].sort((a, b) => new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime())),\n\t\tget: mock({\n\t\t\tdomain: \"history\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/orgs/:orgSlug/history/:runId\"\n\t\t}, async (runId) => getHistoryRunDetail(runId)),\n\t\t/** Cancel a running/queued run. Returns the updated run (or null if unknown). */\n\t\tcancel: mock({\n\t\t\tdomain: \"history\",\n\t\t\tmethod: \"cancel\",\n\t\t\tplannedEndpoint: \"POST /api/orgs/:orgSlug/history/:runId/cancel\"\n\t\t}, async (runId) => cancelHistoryRun(runId))\n\t};\n}\n//#endregion\n//#region src/platform/resources/mock-organization-sidebar-branding.ts\nconst MOCK_STORAGE_KEY$3 = \"keystroke:mock-organization-sidebar-branding:v1\";\nfunction getBrowserLocalStorage$3() {\n\tif (typeof globalThis !== \"object\") return null;\n\treturn globalThis.localStorage ?? null;\n}\nconst DEFAULT_ORGANIZATION_SIDEBAR_BRANDING = {\n\tcustomSidebarLogoEnabled: false,\n\tcustomSidebarLogoExplicitlyDisabled: false,\n\tsidebarLogoLightDataUrl: null,\n\tsidebarLogoDarkDataUrl: null,\n\tsidebarLogoHeightPx: 20\n};\nfunction normalizeSidebarLogoDataUrl(value) {\n\tif (typeof value !== \"string\" || !value.startsWith(\"data:image/\")) return null;\n\treturn value;\n}\nfunction normalizeCustomSidebarLogoEnabled(value, branding) {\n\tconst hasCustomLogo = Boolean(normalizeSidebarLogoDataUrl(branding.sidebarLogoLightDataUrl) || normalizeSidebarLogoDataUrl(branding.sidebarLogoDarkDataUrl));\n\tif (branding.customSidebarLogoExplicitlyDisabled === true) return false;\n\tif (typeof value === \"boolean\") return value || hasCustomLogo;\n\treturn hasCustomLogo;\n}\nfunction normalizeSidebarLogoHeightPx(value) {\n\tif (typeof value !== \"number\" || !Number.isFinite(value)) return DEFAULT_ORGANIZATION_SIDEBAR_BRANDING.sidebarLogoHeightPx;\n\treturn Math.min(32, Math.max(14, Math.round(value)));\n}\nfunction normalizeOrganizationSidebarBranding(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_ORGANIZATION_SIDEBAR_BRANDING;\n\tconst branding = value;\n\treturn {\n\t\tcustomSidebarLogoEnabled: normalizeCustomSidebarLogoEnabled(branding.customSidebarLogoEnabled, branding),\n\t\tcustomSidebarLogoExplicitlyDisabled: branding.customSidebarLogoExplicitlyDisabled === true,\n\t\tsidebarLogoLightDataUrl: normalizeSidebarLogoDataUrl(branding.sidebarLogoLightDataUrl),\n\t\tsidebarLogoDarkDataUrl: normalizeSidebarLogoDataUrl(branding.sidebarLogoDarkDataUrl),\n\t\tsidebarLogoHeightPx: normalizeSidebarLogoHeightPx(branding.sidebarLogoHeightPx)\n\t};\n}\nfunction mergeOrganizationSidebarBranding(current, patch) {\n\treturn normalizeOrganizationSidebarBranding({\n\t\t...current,\n\t\t...patch\n\t});\n}\nfunction readBrandingStore() {\n\tconst localStorage = getBrowserLocalStorage$3();\n\tif (!localStorage) return {};\n\ttry {\n\t\tconst raw = localStorage.getItem(MOCK_STORAGE_KEY$3);\n\t\tif (!raw) return {};\n\t\tconst parsed = JSON.parse(raw);\n\t\tif (!parsed || typeof parsed !== \"object\") return {};\n\t\treturn Object.fromEntries(Object.entries(parsed).map(([organizationId, value]) => [organizationId, normalizeOrganizationSidebarBranding(value)]));\n\t} catch {\n\t\treturn {};\n\t}\n}\nfunction writeBrandingStore(store) {\n\tconst localStorage = getBrowserLocalStorage$3();\n\tif (!localStorage) return;\n\ttry {\n\t\tlocalStorage.setItem(MOCK_STORAGE_KEY$3, JSON.stringify(store));\n\t} catch {}\n}\nfunction resolveOrganizationId(getActiveOrganizationId) {\n\tconst organizationId = getActiveOrganizationId()?.trim();\n\tif (!organizationId) throw new Error(\"Organization sidebar branding requires an active organization\");\n\treturn organizationId;\n}\nfunction createOrganizationSidebarBrandingResource(options) {\n\treturn {\n\t\tget: mock({\n\t\t\tdomain: \"organizationSidebarBranding\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/organizations/active/branding\"\n\t\t}, async () => {\n\t\t\tconst organizationId = resolveOrganizationId(options.getActiveOrganizationId ?? (() => null));\n\t\t\treturn readBrandingStore()[organizationId] ?? DEFAULT_ORGANIZATION_SIDEBAR_BRANDING;\n\t\t}),\n\t\tupdate: mock({\n\t\t\tdomain: \"organizationSidebarBranding\",\n\t\t\tmethod: \"update\",\n\t\t\tplannedEndpoint: \"PATCH /api/organizations/active/branding\"\n\t\t}, async (patch) => {\n\t\t\tconst organizationId = resolveOrganizationId(options.getActiveOrganizationId ?? (() => null));\n\t\t\tconst store = readBrandingStore();\n\t\t\tconst next = mergeOrganizationSidebarBranding(store[organizationId] ?? DEFAULT_ORGANIZATION_SIDEBAR_BRANDING, patch);\n\t\t\twriteBrandingStore({\n\t\t\t\t...store,\n\t\t\t\t[organizationId]: next\n\t\t\t});\n\t\t\treturn next;\n\t\t})\n\t};\n}\n//#endregion\n//#region src/platform/resources/mock-user-preferences.ts\nconst MOCK_STORAGE_KEY$2 = \"keystroke:mock-user-preferences:v1\";\nfunction getBrowserLocalStorage$2() {\n\tif (typeof globalThis !== \"object\") return null;\n\treturn globalThis.localStorage ?? null;\n}\nconst DEFAULT_USER_SIDEBAR_PREFERENCES = {\n\tnavIconVisibility: \"visible\",\n\tfooterChatRowVisibility: \"visible\",\n\thiddenNavItemIds: [\"registry\"],\n\ttopNavItemOrderIds: [],\n\tworkspaceNavItemOrderIds: []\n};\nconst DEFAULT_USER_PREFERENCES = {\n\tinterfaceTheme: \"system\",\n\tsurfaceContrast: \"on\",\n\tlayoutMode: \"linear\",\n\tfontSize: \"default\",\n\tsidebar: DEFAULT_USER_SIDEBAR_PREFERENCES,\n\tfavorites: [],\n\tprojectOrderIds: [],\n\tprojectDotColors: {},\n\tonboardingTabVisible: true\n};\nfunction normalizeInterfaceTheme(value) {\n\tif (value === \"light\" || value === \"dark\") return value;\n\treturn \"system\";\n}\nfunction normalizeSurfaceContrast(value) {\n\treturn value === \"off\" ? \"off\" : \"on\";\n}\nfunction normalizeLayoutMode(value) {\n\treturn value === \"default\" ? \"default\" : \"linear\";\n}\nfunction normalizeFontSize(value) {\n\treturn value === \"large\" ? \"large\" : \"default\";\n}\nfunction normalizeStringList(value) {\n\tif (!Array.isArray(value)) return [];\n\treturn Array.from(new Set(value.filter((item) => typeof item === \"string\")));\n}\nfunction normalizeHiddenNavItemIds(value) {\n\tif (!Array.isArray(value)) return DEFAULT_USER_SIDEBAR_PREFERENCES.hiddenNavItemIds;\n\treturn normalizeStringList(value);\n}\nfunction normalizeSidebarPreferences(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_USER_SIDEBAR_PREFERENCES;\n\tconst sidebar = value;\n\treturn {\n\t\tnavIconVisibility: sidebar.navIconVisibility === \"visible\" ? \"visible\" : \"hidden\",\n\t\tfooterChatRowVisibility: sidebar.footerChatRowVisibility === \"hidden\" ? \"hidden\" : \"visible\",\n\t\thiddenNavItemIds: normalizeHiddenNavItemIds(sidebar.hiddenNavItemIds),\n\t\ttopNavItemOrderIds: normalizeStringList(sidebar.topNavItemOrderIds),\n\t\tworkspaceNavItemOrderIds: normalizeStringList(sidebar.workspaceNavItemOrderIds)\n\t};\n}\nfunction isWorkspaceFavoriteKind(value) {\n\treturn value === \"agent\" || value === \"workflow\" || value === \"skill\";\n}\nfunction normalizeFavorites(value) {\n\tif (!Array.isArray(value)) return [];\n\tconst seenKeys = /* @__PURE__ */ new Set();\n\tconst favorites = [];\n\tfor (const item of value) {\n\t\tif (!item || typeof item !== \"object\") continue;\n\t\tconst favorite = item;\n\t\tif (typeof favorite.kind !== \"string\" || !isWorkspaceFavoriteKind(favorite.kind) || typeof favorite.resourceId !== \"string\" || favorite.resourceId.length === 0) continue;\n\t\tconst key = `${favorite.kind}:${favorite.resourceId}`;\n\t\tif (seenKeys.has(key)) continue;\n\t\tseenKeys.add(key);\n\t\tfavorites.push({\n\t\t\tkind: favorite.kind,\n\t\t\tresourceId: favorite.resourceId\n\t\t});\n\t}\n\treturn favorites;\n}\nfunction normalizeProjectDotColors(value) {\n\tif (!value || typeof value !== \"object\" || Array.isArray(value)) return {};\n\treturn Object.fromEntries(Object.entries(value).filter((entry) => typeof entry[0] === \"string\" && typeof entry[1] === \"string\"));\n}\nfunction normalizeOnboardingTabVisible(value) {\n\treturn typeof value === \"boolean\" ? value : DEFAULT_USER_PREFERENCES.onboardingTabVisible;\n}\nfunction normalizeUserPreferences(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_USER_PREFERENCES;\n\tconst preferences = value;\n\treturn {\n\t\tinterfaceTheme: normalizeInterfaceTheme(preferences.interfaceTheme),\n\t\tsurfaceContrast: normalizeSurfaceContrast(preferences.surfaceContrast),\n\t\tlayoutMode: normalizeLayoutMode(preferences.layoutMode),\n\t\tfontSize: normalizeFontSize(preferences.fontSize),\n\t\tsidebar: normalizeSidebarPreferences(preferences.sidebar),\n\t\tfavorites: normalizeFavorites(preferences.favorites),\n\t\tprojectOrderIds: normalizeStringList(preferences.projectOrderIds),\n\t\tprojectDotColors: normalizeProjectDotColors(preferences.projectDotColors),\n\t\tonboardingTabVisible: normalizeOnboardingTabVisible(preferences.onboardingTabVisible)\n\t};\n}\nfunction mergeUserPreferences(current, patch) {\n\treturn normalizeUserPreferences({\n\t\t...current,\n\t\t...patch,\n\t\tsidebar: patch.sidebar ? {\n\t\t\t...current.sidebar,\n\t\t\t...patch.sidebar\n\t\t} : current.sidebar\n\t});\n}\nfunction readPreferencesStore() {\n\tconst localStorage = getBrowserLocalStorage$2();\n\tif (!localStorage) return {};\n\ttry {\n\t\tconst raw = localStorage.getItem(MOCK_STORAGE_KEY$2);\n\t\tif (!raw) return {};\n\t\tconst parsed = JSON.parse(raw);\n\t\tif (!parsed || typeof parsed !== \"object\") return {};\n\t\tconst entries = Object.entries(parsed);\n\t\treturn Object.fromEntries(entries.map(([userId, value]) => [userId, normalizeUserPreferences(value)]));\n\t} catch {\n\t\treturn {};\n\t}\n}\nfunction writePreferencesStore(store) {\n\tconst localStorage = getBrowserLocalStorage$2();\n\tif (!localStorage) return;\n\ttry {\n\t\tlocalStorage.setItem(MOCK_STORAGE_KEY$2, JSON.stringify(store));\n\t} catch {}\n}\nfunction resolveUserId$1(getCurrentUserId) {\n\tconst userId = getCurrentUserId()?.trim();\n\tif (!userId) throw new Error(\"User preferences require an authenticated user\");\n\treturn userId;\n}\nfunction createUserPreferencesResource(options) {\n\treturn {\n\t\tget: mock({\n\t\t\tdomain: \"userPreferences\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/account/preferences\"\n\t\t}, async () => {\n\t\t\tconst userId = resolveUserId$1(options.getCurrentUserId ?? (() => null));\n\t\t\treturn readPreferencesStore()[userId] ?? DEFAULT_USER_PREFERENCES;\n\t\t}),\n\t\tupdate: mock({\n\t\t\tdomain: \"userPreferences\",\n\t\t\tmethod: \"update\",\n\t\t\tplannedEndpoint: \"PATCH /api/account/preferences\"\n\t\t}, async (patch) => {\n\t\t\tconst userId = resolveUserId$1(options.getCurrentUserId ?? (() => null));\n\t\t\tconst store = readPreferencesStore();\n\t\t\tconst next = mergeUserPreferences(store[userId] ?? DEFAULT_USER_PREFERENCES, patch);\n\t\t\twritePreferencesStore({\n\t\t\t\t...store,\n\t\t\t\t[userId]: next\n\t\t\t});\n\t\t\treturn next;\n\t\t})\n\t};\n}\n//#endregion\n//#region src/platform/resources/mock-user-avatar.ts\nconst DEFAULT_USER_AVATAR = { dataUrl: null };\nconst MOCK_STORAGE_KEY$1 = \"keystroke:mock-user-avatar:v1\";\nfunction getBrowserLocalStorage$1() {\n\tif (typeof globalThis !== \"object\") return null;\n\treturn globalThis.localStorage ?? null;\n}\nfunction normalizeUserAvatar(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_USER_AVATAR;\n\tconst dataUrl = value.dataUrl;\n\treturn { dataUrl: typeof dataUrl === \"string\" && dataUrl.length > 0 ? dataUrl : null };\n}\nfunction readAvatarStore() {\n\tconst localStorage = getBrowserLocalStorage$1();\n\tif (!localStorage) return {};\n\ttry {\n\t\tconst raw = localStorage.getItem(MOCK_STORAGE_KEY$1);\n\t\tif (!raw) return {};\n\t\tconst parsed = JSON.parse(raw);\n\t\tif (!parsed || typeof parsed !== \"object\") return {};\n\t\treturn Object.fromEntries(Object.entries(parsed).map(([userId, value]) => [userId, normalizeUserAvatar(value)]));\n\t} catch {\n\t\treturn {};\n\t}\n}\nfunction writeAvatarStore(store) {\n\tconst localStorage = getBrowserLocalStorage$1();\n\tif (!localStorage) return;\n\ttry {\n\t\tlocalStorage.setItem(MOCK_STORAGE_KEY$1, JSON.stringify(store));\n\t} catch {}\n}\nfunction resolveUserId(getCurrentUserId) {\n\tconst userId = getCurrentUserId()?.trim();\n\tif (!userId) throw new Error(\"User avatar requires an authenticated user\");\n\treturn userId;\n}\nfunction createUserAvatarResource(options) {\n\treturn {\n\t\tget: mock({\n\t\t\tdomain: \"userAvatar\",\n\t\t\tmethod: \"get\",\n\t\t\tplannedEndpoint: \"GET /api/account/avatar\"\n\t\t}, async () => {\n\t\t\tconst userId = resolveUserId(options.getCurrentUserId ?? (() => null));\n\t\t\treturn readAvatarStore()[userId] ?? DEFAULT_USER_AVATAR;\n\t\t}),\n\t\tupdate: mock({\n\t\t\tdomain: \"userAvatar\",\n\t\t\tmethod: \"update\",\n\t\t\tplannedEndpoint: \"PATCH /api/account/avatar\"\n\t\t}, async (patch) => {\n\t\t\tconst userId = resolveUserId(options.getCurrentUserId ?? (() => null));\n\t\t\tconst store = readAvatarStore();\n\t\t\tconst next = normalizeUserAvatar({ dataUrl: patch.dataUrl });\n\t\t\twriteAvatarStore({\n\t\t\t\t...store,\n\t\t\t\t[userId]: next\n\t\t\t});\n\t\t\treturn next;\n\t\t})\n\t};\n}\n//#endregion\n//#region src/platform/resources/mock-channels.ts\nconst CHANNEL_PLATFORMS = [\n\t{\n\t\tkey: \"slack\",\n\t\tname: \"Slack\",\n\t\tappLogoId: \"slack\",\n\t\tfallbackDomain: \"slack.com\",\n\t\tdescription: \"Connect a Slack workspace so this agent can respond in channels, threads, and DMs.\",\n\t\ttagline: \"Respond in channels, threads, and DMs.\",\n\t\tauthKind: \"oauth\",\n\t\tcredentialFields: [],\n\t\tcapabilities: {\n\t\t\tmentions: true,\n\t\t\treactions: \"full\",\n\t\t\tcards: \"full\",\n\t\t\tmodals: true,\n\t\t\tstreaming: \"native\",\n\t\t\tdms: true\n\t\t},\n\t\tsupportedModes: [\n\t\t\t\"mention\",\n\t\t\t\"all\",\n\t\t\t\"dm\"\n\t\t],\n\t\tresourceNoun: {\n\t\t\tsingular: \"channel\",\n\t\t\tplural: \"channels\"\n\t\t},\n\t\twebhookPathHint: \"/gateways/slack\",\n\t\tsupportsChannelDirectory: true,\n\t\tdocsUrl: \"https://chat-sdk.dev/adapters/official/slack\"\n\t},\n\t{\n\t\tkey: \"discord\",\n\t\tname: \"Discord\",\n\t\tappLogoId: \"discord\",\n\t\tfallbackDomain: \"discord.com\",\n\t\tdescription: \"Connect a Discord application so this agent can respond in servers and channels.\",\n\t\ttagline: \"Respond in servers and channels.\",\n\t\tauthKind: \"credentials\",\n\t\tcredentialFields: [\n\t\t\t{\n\t\t\t\tkey: \"botToken\",\n\t\t\t\tlabel: \"Bot token\",\n\t\t\t\tplaceholder: \"Bot token from the Discord developer portal\",\n\t\t\t\thelpText: \"Bot → Reset Token. Shown only once.\",\n\t\t\t\ttype: \"password\",\n\t\t\t\trequired: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: \"applicationId\",\n\t\t\t\tlabel: \"Application ID\",\n\t\t\t\tplaceholder: \"Application ID\",\n\t\t\t\ttype: \"text\",\n\t\t\t\trequired: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: \"publicKey\",\n\t\t\t\tlabel: \"Public key\",\n\t\t\t\tplaceholder: \"Public key\",\n\t\t\t\thelpText: \"General Information → Public Key, used to verify interactions.\",\n\t\t\t\ttype: \"text\",\n\t\t\t\trequired: true\n\t\t\t}\n\t\t],\n\t\tcapabilities: {\n\t\t\tmentions: true,\n\t\t\treactions: \"full\",\n\t\t\tcards: \"full\",\n\t\t\tmodals: false,\n\t\t\tstreaming: \"post-edit\",\n\t\t\tdms: true\n\t\t},\n\t\tsupportedModes: [\n\t\t\t\"mention\",\n\t\t\t\"all\",\n\t\t\t\"dm\"\n\t\t],\n\t\tresourceNoun: {\n\t\t\tsingular: \"channel\",\n\t\t\tplural: \"channels\"\n\t\t},\n\t\twebhookPathHint: \"/gateways/discord\",\n\t\tsupportsChannelDirectory: true,\n\t\tdocsUrl: \"https://chat-sdk.dev/adapters/official/discord\"\n\t},\n\t{\n\t\tkey: \"telegram\",\n\t\tname: \"Telegram\",\n\t\tappLogoId: \"telegram\",\n\t\tfallbackDomain: \"telegram.org\",\n\t\tdescription: \"Connect a Telegram bot so this agent can respond in chats and groups.\",\n\t\ttagline: \"Respond in chats and groups.\",\n\t\tauthKind: \"bot-token\",\n\t\tcredentialFields: [{\n\t\t\tkey: \"botToken\",\n\t\t\tlabel: \"Bot token\",\n\t\t\tplaceholder: \"123456:ABC-DEF…\",\n\t\t\thelpText: \"Create a bot with @BotFather and paste its token.\",\n\t\t\ttype: \"password\",\n\t\t\trequired: true\n\t\t}, {\n\t\t\tkey: \"botUsername\",\n\t\t\tlabel: \"Bot username\",\n\t\t\tplaceholder: \"my_agent_bot\",\n\t\t\ttype: \"text\",\n\t\t\trequired: false,\n\t\t\tprefix: \"@\"\n\t\t}],\n\t\tcapabilities: {\n\t\t\tmentions: true,\n\t\t\treactions: \"full\",\n\t\t\tcards: \"partial\",\n\t\t\tmodals: false,\n\t\t\tstreaming: \"drafts\",\n\t\t\tdms: true\n\t\t},\n\t\tsupportedModes: [\n\t\t\t\"mention\",\n\t\t\t\"all\",\n\t\t\t\"dm\"\n\t\t],\n\t\tresourceNoun: {\n\t\t\tsingular: \"chat\",\n\t\t\tplural: \"chats\"\n\t\t},\n\t\twebhookPathHint: \"/gateways/telegram\",\n\t\tsupportsChannelDirectory: false,\n\t\tdocsUrl: \"https://chat-sdk.dev/adapters/official/telegram\"\n\t},\n\t{\n\t\tkey: \"microsoft-teams\",\n\t\tname: \"Microsoft Teams\",\n\t\tappLogoId: \"microsoft-teams\",\n\t\tfallbackDomain: \"teams.microsoft.com\",\n\t\tdescription: \"Connect a Microsoft Teams app so this agent can respond in channels and chats.\",\n\t\ttagline: \"Respond in channels and chats.\",\n\t\tauthKind: \"credentials\",\n\t\tcredentialFields: [\n\t\t\t{\n\t\t\t\tkey: \"appId\",\n\t\t\t\tlabel: \"App ID\",\n\t\t\t\tplaceholder: \"Azure AD application (client) ID\",\n\t\t\t\ttype: \"text\",\n\t\t\t\trequired: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: \"appPassword\",\n\t\t\t\tlabel: \"App password\",\n\t\t\t\tplaceholder: \"Client secret\",\n\t\t\t\ttype: \"password\",\n\t\t\t\trequired: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: \"tenantId\",\n\t\t\t\tlabel: \"Tenant ID\",\n\t\t\t\tplaceholder: \"Azure AD tenant ID\",\n\t\t\t\ttype: \"text\",\n\t\t\t\trequired: true\n\t\t\t}\n\t\t],\n\t\tcapabilities: {\n\t\t\tmentions: true,\n\t\t\treactions: \"read-only\",\n\t\t\tcards: \"full\",\n\t\t\tmodals: true,\n\t\t\tstreaming: \"buffered\",\n\t\t\tdms: true\n\t\t},\n\t\tsupportedModes: [\n\t\t\t\"mention\",\n\t\t\t\"all\",\n\t\t\t\"dm\"\n\t\t],\n\t\tresourceNoun: {\n\t\t\tsingular: \"channel\",\n\t\t\tplural: \"channels\"\n\t\t},\n\t\twebhookPathHint: \"/gateways/teams\",\n\t\tsupportsChannelDirectory: true,\n\t\tdocsUrl: \"https://chat-sdk.dev/adapters/official/teams\"\n\t},\n\t{\n\t\tkey: \"google-chat\",\n\t\tname: \"Google Chat\",\n\t\tappLogoId: \"google-chat\",\n\t\tfallbackDomain: \"chat.google.com\",\n\t\tdescription: \"Connect a Google Chat app so this agent can respond in spaces and direct messages.\",\n\t\ttagline: \"Respond in spaces and DMs.\",\n\t\tauthKind: \"credentials\",\n\t\tcredentialFields: [{\n\t\t\tkey: \"serviceAccountJson\",\n\t\t\tlabel: \"Service account JSON\",\n\t\t\tplaceholder: \"Paste the service account key JSON\",\n\t\t\thelpText: \"IAM → Service Accounts → Keys → Add key → JSON.\",\n\t\t\ttype: \"textarea\",\n\t\t\trequired: true\n\t\t}, {\n\t\t\tkey: \"projectNumber\",\n\t\t\tlabel: \"GCP project number\",\n\t\t\tplaceholder: \"Project number used to verify webhooks\",\n\t\t\ttype: \"text\",\n\t\t\trequired: true\n\t\t}],\n\t\tcapabilities: {\n\t\t\tmentions: true,\n\t\t\treactions: \"full\",\n\t\t\tcards: \"full\",\n\t\t\tmodals: false,\n\t\t\tstreaming: \"post-edit\",\n\t\t\tdms: true\n\t\t},\n\t\tsupportedModes: [\n\t\t\t\"mention\",\n\t\t\t\"all\",\n\t\t\t\"dm\"\n\t\t],\n\t\tresourceNoun: {\n\t\t\tsingular: \"space\",\n\t\t\tplural: \"spaces\"\n\t\t},\n\t\twebhookPathHint: \"/gateways/gchat\",\n\t\tsupportsChannelDirectory: true,\n\t\tdocsUrl: \"https://chat-sdk.dev/adapters/official/google-chat\"\n\t}\n];\nfunction getChannelPlatform(key) {\n\treturn CHANNEL_PLATFORMS.find((platform) => platform.key === key);\n}\nconst CHANNEL_DIRECTORY = {\n\tslack: [\n\t\t{\n\t\t\tid: \"C0SUPPORT\",\n\t\t\tname: \"support\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 48\n\t\t},\n\t\t{\n\t\t\tid: \"C0GENERAL\",\n\t\t\tname: \"general\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 132\n\t\t},\n\t\t{\n\t\t\tid: \"C0ENG\",\n\t\t\tname: \"engineering\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 27\n\t\t},\n\t\t{\n\t\t\tid: \"C0INCIDENTS\",\n\t\t\tname: \"incidents\",\n\t\t\tkind: \"private\",\n\t\t\tmemberCount: 12\n\t\t},\n\t\t{\n\t\t\tid: \"C0RANDOM\",\n\t\t\tname: \"random\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 118\n\t\t},\n\t\t{\n\t\t\tid: \"C0ARCHIVE\",\n\t\t\tname: \"launch-2025\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 9,\n\t\t\tisArchived: true\n\t\t}\n\t],\n\tdiscord: [\n\t\t{\n\t\t\tid: \"d-general\",\n\t\t\tname: \"general\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 540\n\t\t},\n\t\t{\n\t\t\tid: \"d-help\",\n\t\t\tname: \"help\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 312\n\t\t},\n\t\t{\n\t\t\tid: \"d-dev\",\n\t\t\tname: \"dev\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 76\n\t\t},\n\t\t{\n\t\t\tid: \"d-staff\",\n\t\t\tname: \"staff\",\n\t\t\tkind: \"private\",\n\t\t\tmemberCount: 8\n\t\t}\n\t],\n\ttelegram: [],\n\t\"microsoft-teams\": [\n\t\t{\n\t\t\tid: \"t-general\",\n\t\t\tname: \"General\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 64\n\t\t},\n\t\t{\n\t\t\tid: \"t-support\",\n\t\t\tname: \"Customer Support\",\n\t\t\tkind: \"public\",\n\t\t\tmemberCount: 22\n\t\t},\n\t\t{\n\t\t\tid: \"t-leads\",\n\t\t\tname: \"Leadership\",\n\t\t\tkind: \"private\",\n\t\t\tmemberCount: 6\n\t\t}\n\t],\n\t\"google-chat\": [\n\t\t{\n\t\t\tid: \"spaces/AAA-support\",\n\t\t\tname: \"Support\",\n\t\t\tkind: \"space\",\n\t\t\tmemberCount: 31\n\t\t},\n\t\t{\n\t\t\tid: \"spaces/AAA-eng\",\n\t\t\tname: \"Engineering\",\n\t\t\tkind: \"space\",\n\t\t\tmemberCount: 44\n\t\t},\n\t\t{\n\t\t\tid: \"spaces/AAA-ops\",\n\t\t\tname: \"Ops On-call\",\n\t\t\tkind: \"space\",\n\t\t\tmemberCount: 10\n\t\t}\n\t]\n};\nconst MOCK_STORAGE_KEY = \"keystroke:mock-channels:v1\";\nfunction getBrowserLocalStorage() {\n\tif (typeof globalThis !== \"object\") return null;\n\treturn globalThis.localStorage ?? null;\n}\n/** A connected Slack workspace with two bindings, so the panel is reviewable. */\nfunction seedStore() {\n\treturn { \"agent-support\": [{\n\t\tid: \"chan-conn-slack-support\",\n\t\tplatform: \"slack\",\n\t\tagentId: \"agent-support\",\n\t\taccountLabel: \"Keystroke HQ\",\n\t\taccountId: \"T0KEYSTROKE\",\n\t\tconnectedAt: \"2026-05-28T15:30:00Z\",\n\t\tbindings: [{\n\t\t\tid: \"chan-bind-support\",\n\t\t\tchannelId: \"C0SUPPORT\",\n\t\t\tchannelName: \"support\",\n\t\t\tchannelKind: \"public\",\n\t\t\tmode: \"all\",\n\t\t\tsubscribeOnMention: true,\n\t\t\tcreatedAt: \"2026-05-28T15:31:00Z\",\n\t\t\tupdatedAt: \"2026-05-28T15:31:00Z\"\n\t\t}, {\n\t\t\tid: \"chan-bind-incidents\",\n\t\t\tchannelId: \"C0INCIDENTS\",\n\t\t\tchannelName: \"incidents\",\n\t\t\tchannelKind: \"private\",\n\t\t\tmode: \"mention\",\n\t\t\tsubscribeOnMention: true,\n\t\t\tcreatedAt: \"2026-05-29T09:05:00Z\",\n\t\t\tupdatedAt: \"2026-05-29T09:05:00Z\"\n\t\t}]\n\t}] };\n}\nfunction readStore() {\n\tconst localStorage = getBrowserLocalStorage();\n\tif (!localStorage) return seedStore();\n\ttry {\n\t\tconst raw = localStorage.getItem(MOCK_STORAGE_KEY);\n\t\tif (!raw) {\n\t\t\tconst seeded = seedStore();\n\t\t\tlocalStorage.setItem(MOCK_STORAGE_KEY, JSON.stringify(seeded));\n\t\t\treturn seeded;\n\t\t}\n\t\tconst parsed = JSON.parse(raw);\n\t\tif (!parsed || typeof parsed !== \"object\") return {};\n\t\treturn parsed;\n\t} catch {\n\t\treturn {};\n\t}\n}\nfunction writeStore(store) {\n\tconst localStorage = getBrowserLocalStorage();\n\tif (!localStorage) return;\n\ttry {\n\t\tlocalStorage.setItem(MOCK_STORAGE_KEY, JSON.stringify(store));\n\t} catch {}\n}\nfunction newId(prefix) {\n\tconst cryptoRef = globalThis.crypto;\n\tif (cryptoRef?.randomUUID) return `${prefix}-${cryptoRef.randomUUID()}`;\n\treturn `${prefix}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;\n}\nfunction requireAgentId(agentId) {\n\tconst trimmed = agentId.trim();\n\tif (!trimmed) throw new Error(\"Channels require an agent id\");\n\treturn trimmed;\n}\nfunction clone(value) {\n\treturn JSON.parse(JSON.stringify(value));\n}\nfunction defaultAccountLabel(platform) {\n\tconst meta = getChannelPlatform(platform);\n\treturn meta ? `${meta.name} workspace` : platform;\n}\nfunction findConnection(connections, connectionId) {\n\tconst connection = connections.find((entry) => entry.id === connectionId);\n\tif (!connection) throw new Error(`Channel connection not found: ${connectionId}`);\n\treturn connection;\n}\nfunction toBinding(input, now) {\n\treturn {\n\t\tid: newId(\"chan-bind\"),\n\t\tchannelId: input.channelId,\n\t\tchannelName: input.channelName,\n\t\tchannelKind: input.channelKind ?? \"public\",\n\t\tmode: input.mode ?? \"mention\",\n\t\tsubscribeOnMention: input.subscribeOnMention ?? true,\n\t\tcreatedAt: now,\n\t\tupdatedAt: now\n\t};\n}\nfunction createChannelsResource() {\n\treturn {\n\t\t/** The supported-platform catalog (static; backend may derive from the adapter registry). */\n\t\tlistPlatforms: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"listPlatforms\",\n\t\t\tplannedEndpoint: \"GET /api/channels/platforms\"\n\t\t}, async () => clone(CHANNEL_PLATFORMS)),\n\t\t/** Connections (with their channel bindings) for one agent. */\n\t\tlistForAgent: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"listForAgent\",\n\t\t\tplannedEndpoint: \"GET /api/agents/:agentId/channels\"\n\t\t}, async (agentId) => {\n\t\t\tconst id = requireAgentId(agentId);\n\t\t\treturn clone(readStore()[id] ?? []);\n\t\t}),\n\t\t/**\n\t\t* Channel directory for a platform — the picker source. NET-NEW vs. the\n\t\t* current backend (no channel-list endpoint exists). The runtime team needs\n\t\t* to expose this (e.g. Slack `conversations.list`) for a real picker.\n\t\t*/\n\t\tlistChannels: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"listChannels\",\n\t\t\tplannedEndpoint: \"GET /api/channels/:platform/directory\"\n\t\t}, async (platform) => clone(CHANNEL_DIRECTORY[platform] ?? [])),\n\t\t/** Connect a platform for an agent (OAuth install or credential entry), optionally with a first binding. */\n\t\tconnect: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"connect\",\n\t\t\tplannedEndpoint: \"POST /api/agents/:agentId/channels\"\n\t\t}, async (input) => {\n\t\t\tconst agentId = requireAgentId(input.agentId);\n\t\t\tconst store = readStore();\n\t\t\tconst now = (/* @__PURE__ */ new Date()).toISOString();\n\t\t\tconst connection = {\n\t\t\t\tid: newId(\"chan-conn\"),\n\t\t\t\tplatform: input.platform,\n\t\t\t\tagentId,\n\t\t\t\taccountLabel: input.accountLabel ?? defaultAccountLabel(input.platform),\n\t\t\t\taccountId: newId(\"acct\").toUpperCase(),\n\t\t\t\tconnectedAt: now,\n\t\t\t\tbindings: input.initialBinding ? [toBinding(input.initialBinding, now)] : []\n\t\t\t};\n\t\t\twriteStore({\n\t\t\t\t...store,\n\t\t\t\t[agentId]: [...store[agentId] ?? [], connection]\n\t\t\t});\n\t\t\treturn clone(connection);\n\t\t}),\n\t\t/** Add a channel binding to an existing connection. */\n\t\taddBinding: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"addBinding\",\n\t\t\tplannedEndpoint: \"PUT /gateways/:platform/attachments/:channelId\"\n\t\t}, async (input) => {\n\t\t\tconst agentId = requireAgentId(input.agentId);\n\t\t\tconst store = readStore();\n\t\t\tconst connections = store[agentId] ?? [];\n\t\t\tconst connection = findConnection(connections, input.connectionId);\n\t\t\tconst now = (/* @__PURE__ */ new Date()).toISOString();\n\t\t\tconnection.bindings = [...connection.bindings, toBinding(input.binding, now)];\n\t\t\twriteStore({\n\t\t\t\t...store,\n\t\t\t\t[agentId]: connections\n\t\t\t});\n\t\t\treturn clone(connection);\n\t\t}),\n\t\t/** Update a binding's listen mode / subscribe flag. */\n\t\tupdateBinding: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"updateBinding\",\n\t\t\tplannedEndpoint: \"PUT /gateways/:platform/attachments/:channelId\"\n\t\t}, async (input) => {\n\t\t\tconst agentId = requireAgentId(input.agentId);\n\t\t\tconst store = readStore();\n\t\t\tconst connections = store[agentId] ?? [];\n\t\t\tconst connection = findConnection(connections, input.connectionId);\n\t\t\tconst binding = connection.bindings.find((entry) => entry.id === input.bindingId);\n\t\t\tif (!binding) throw new Error(`Channel binding not found: ${input.bindingId}`);\n\t\t\tif (input.patch.mode !== void 0) binding.mode = input.patch.mode;\n\t\t\tif (input.patch.subscribeOnMention !== void 0) binding.subscribeOnMention = input.patch.subscribeOnMention;\n\t\t\tbinding.updatedAt = (/* @__PURE__ */ new Date()).toISOString();\n\t\t\twriteStore({\n\t\t\t\t...store,\n\t\t\t\t[agentId]: connections\n\t\t\t});\n\t\t\treturn clone(connection);\n\t\t}),\n\t\t/** Remove a channel binding. */\n\t\tremoveBinding: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"removeBinding\",\n\t\t\tplannedEndpoint: \"DELETE /gateways/:platform/attachments/:channelId\"\n\t\t}, async (input) => {\n\t\t\tconst agentId = requireAgentId(input.agentId);\n\t\t\tconst store = readStore();\n\t\t\tconst connections = store[agentId] ?? [];\n\t\t\tconst connection = findConnection(connections, input.connectionId);\n\t\t\tconnection.bindings = connection.bindings.filter((entry) => entry.id !== input.bindingId);\n\t\t\twriteStore({\n\t\t\t\t...store,\n\t\t\t\t[agentId]: connections\n\t\t\t});\n\t\t\treturn clone(connection);\n\t\t}),\n\t\t/** Disconnect the agent from a platform (removes the connection + its bindings). */\n\t\tdisconnect: mock({\n\t\t\tdomain: \"channels\",\n\t\t\tmethod: \"disconnect\",\n\t\t\tplannedEndpoint: \"DELETE /api/agents/:agentId/channels/:connectionId\"\n\t\t}, async (input) => {\n\t\t\tconst agentId = requireAgentId(input.agentId);\n\t\t\tconst store = readStore();\n\t\t\tconst next = (store[agentId] ?? []).filter((entry) => entry.id !== input.connectionId);\n\t\t\twriteStore({\n\t\t\t\t...store,\n\t\t\t\t[agentId]: next\n\t\t\t});\n\t\t})\n\t};\n}\n//#endregion\n//#region src/platform/index.ts\nfunction createPlatformClient(options) {\n\tconst auth = options.auth ?? { type: \"none\" };\n\tconst base = normalizeBaseUrl(options.baseUrl);\n\tlet activeOrganizationId = options.getActiveOrganizationId?.() ?? null;\n\tconst setActiveOrganizationId = (organizationId) => {\n\t\tactiveOrganizationId = organizationId;\n\t\toptions.onActiveOrganizationChange?.(organizationId);\n\t};\n\tconst http = ky.create({\n\t\tprefix: base === \"\" ? void 0 : `${base}/`,\n\t\tcredentials: kyCredentials(auth),\n\t\thooks: { beforeRequest: [({ request }) => {\n\t\t\tapplyActiveOrganizationHeader(request, activeOrganizationId);\n\t\t\treturn applyAuthHeaders(request, auth);\n\t\t}] },\n\t\t...options.ky\n\t});\n\treturn {\n\t\thttp,\n\t\thealth: createHealthResource(http),\n\t\torganizations: createOrganizationsResource(http, {\n\t\t\tonActiveOrganizationChange: setActiveOrganizationId,\n\t\t\tgetActiveOrganizationId: () => activeOrganizationId\n\t\t}),\n\t\tprojects: createProjectsResource(http),\n\t\tartifacts: createArtifactsResource(http),\n\t\tprojectSettings: createProjectSettingsResource(),\n\t\tagents: createAgentsResource(),\n\t\tworkflows: createWorkflowsResource(),\n\t\tskills: createSkillsResource(),\n\t\tapps: createAppsResource(),\n\t\tcredentials: createCredentialsResource(),\n\t\thistory: createHistoryResource(),\n\t\tdeployments: createDeploymentsResource(),\n\t\tprojectMetrics: createProjectMetricsResource(),\n\t\tprojectFiles: createProjectFilesResource(),\n\t\tchannels: createChannelsResource(),\n\t\tmembers: createMembersResource(http),\n\t\tinvitations: createInvitationsResource(http),\n\t\tapiKeys: createApiKeysResource(),\n\t\trecents: createRecentsResource(),\n\t\tuserPreferences: createUserPreferencesResource({ getCurrentUserId: options.getCurrentUserId }),\n\t\tuserAvatar: createUserAvatarResource({ getCurrentUserId: options.getCurrentUserId }),\n\t\torganizationSidebarBranding: createOrganizationSidebarBrandingResource({ getActiveOrganizationId: () => activeOrganizationId }),\n\t\tgetActiveOrganizationId: () => activeOrganizationId,\n\t\tsetActiveOrganizationId\n\t};\n}\n/** Browser client for apps using Better Auth session cookies (e.g. apps/web). */\nfunction createBrowserPlatformClient(options = {}) {\n\treturn createPlatformClient({\n\t\t...options,\n\t\tbaseUrl: options.baseUrl ?? \"\",\n\t\tauth: browserAuthStrategy(),\n\t\tgetActiveOrganizationId: readActiveOrganizationId,\n\t\tonActiveOrganizationChange: writeActiveOrganizationId\n\t});\n}\n//#endregion\nexport { CHANNEL_PLATFORMS, DEFAULT_ORGANIZATION_SIDEBAR_BRANDING, DEFAULT_PROJECT_SETTINGS, DEFAULT_USER_AVATAR, DEFAULT_USER_PREFERENCES, PlatformError, browserAuthStrategy, createBrowserPlatformClient, createPlatformClient, getChannelPlatform, kyCredentials, mergeOrganizationSidebarBranding, mergeProjectSettings, mergeUserPreferences, mockManifest, normalizeBaseUrl, normalizeOrganizationSidebarBranding, normalizeProjectSettings, normalizeUserPreferences, readActiveOrganizationId, toPlatformError, writeActiveOrganizationId };\n\n//# sourceMappingURL=index.mjs.map","import {\n createPlatformClient,\n type AuthStrategy as PlatformAuthStrategy,\n type PlatformClient,\n} from \"@keystrokehq/sdk/platform\";\nimport type { AuthStrategy as CliAuthStrategy } from \"@keystrokehq/sdk\";\nimport type Conf from \"conf\";\n\nimport { resolveCliAuth } from \"./auth/resolve-cli-auth\";\nimport { getPlatformUrl, type CliConfig } from \"./config\";\n\nfunction toPlatformAuth(auth: CliAuthStrategy): PlatformAuthStrategy {\n if (auth.type === \"bearer\") {\n return auth;\n }\n\n if (auth.type === \"apiKey\") {\n return {\n type: \"bearer\",\n getToken: async () => auth.getKey(),\n };\n }\n\n return { type: \"none\" };\n}\n\nexport function createCliPlatformClient(config: Conf<CliConfig>): PlatformClient {\n return createPlatformClient({\n baseUrl: getPlatformUrl(config),\n auth: toPlatformAuth(resolveCliAuth(config)),\n getActiveOrganizationId: () => config.get(\"activeOrganizationId\") ?? null,\n onActiveOrganizationChange: (organizationId) => {\n if (organizationId) {\n config.set(\"activeOrganizationId\", organizationId);\n } else {\n config.delete(\"activeOrganizationId\");\n }\n },\n });\n}\n","import { select } from \"@inquirer/prompts\";\nimport type Conf from \"conf\";\nimport type { UserOrganization } from \"@keystrokehq/shared\";\n\nimport type { CliConfig } from \"../config\";\nimport { getWebUrl } from \"../config\";\nimport { createCliPlatformClient } from \"../platform-client\";\n\nexport type ActivateOrganizationOptions = {\n organizationId?: string;\n};\n\nfunction formatOrganization(membership: UserOrganization): string {\n return `${membership.organization.name} (${membership.role})`;\n}\n\nexport async function listOrganizations(config: Conf<CliConfig>): Promise<UserOrganization[]> {\n const platform = createCliPlatformClient(config);\n return platform.organizations.list();\n}\n\nexport async function activateOrganization(\n config: Conf<CliConfig>,\n organizationId: string,\n): Promise<UserOrganization> {\n const platform = createCliPlatformClient(config);\n const membership = await platform.organizations.setActive({ organizationId });\n platform.setActiveOrganizationId(membership.organization.id);\n return membership;\n}\n\nasync function pickOrganization(\n config: Conf<CliConfig>,\n organizations: UserOrganization[],\n organizationId?: string,\n): Promise<UserOrganization> {\n if (organizationId) {\n const membership = organizations.find((entry) => entry.organization.id === organizationId);\n if (!membership) {\n throw new Error(`Organization ${organizationId} was not found or you do not have access`);\n }\n\n return activateOrganization(config, membership.organization.id);\n }\n\n if (!process.stdin.isTTY) {\n const names = organizations.map((entry) => entry.organization.id).join(\", \");\n throw new Error(\n `Multiple organizations found. Run \\`keystroke config use org <id>\\`. Options: ${names}`,\n );\n }\n\n const selectedId = await select({\n message: \"Select an organization\",\n choices: organizations.map((entry) => ({\n name: formatOrganization(entry),\n value: entry.organization.id,\n })),\n });\n\n return activateOrganization(config, selectedId);\n}\n\nexport async function selectActiveOrganization(\n config: Conf<CliConfig>,\n options: ActivateOrganizationOptions = {},\n): Promise<UserOrganization> {\n const organizations = await listOrganizations(config);\n\n if (organizations.length === 0) {\n throw new Error(`No organization found — create one at ${getWebUrl(config)}`);\n }\n\n if (organizations.length === 1) {\n return activateOrganization(config, organizations[0]!.organization.id);\n }\n\n return pickOrganization(config, organizations, options.organizationId);\n}\n\nexport async function syncActiveOrganizationAfterLogin(\n config: Conf<CliConfig>,\n options: ActivateOrganizationOptions = {},\n): Promise<UserOrganization | null> {\n const organizations = await listOrganizations(config);\n\n if (organizations.length === 0) {\n throw new Error(`No organization found — create one at ${getWebUrl(config)}`);\n }\n\n const storedId = config.get(\"activeOrganizationId\");\n if (storedId && organizations.some((entry) => entry.organization.id === storedId)) {\n const membership = await activateOrganization(config, storedId);\n process.stdout.write(`Using organization ${membership.organization.name}\\n`);\n return membership;\n }\n\n if (organizations.length === 1) {\n const membership = await activateOrganization(config, organizations[0]!.organization.id);\n process.stdout.write(`Using organization ${membership.organization.name}\\n`);\n return membership;\n }\n\n if (options.organizationId) {\n const membership = await pickOrganization(config, organizations, options.organizationId);\n process.stdout.write(`Using organization ${membership.organization.name}\\n`);\n return membership;\n }\n\n const membership = await pickOrganization(config, organizations);\n process.stdout.write(`Using organization ${membership.organization.name}\\n`);\n return membership;\n}\n\nexport async function ensureActiveOrganization(config: Conf<CliConfig>): Promise<void> {\n const storedId = config.get(\"activeOrganizationId\");\n if (storedId) {\n await activateOrganization(config, storedId);\n return;\n }\n\n const organizations = await listOrganizations(config);\n if (organizations.length === 1) {\n await activateOrganization(config, organizations[0]!.organization.id);\n return;\n }\n\n throw new Error(\n \"No active organization. Run `keystroke auth login` or `keystroke config use org`.\",\n );\n}\n","import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\n\nimport { getCliConfigDir } from \"./config\";\n\nexport type DevSession = {\n pid: number;\n port: number;\n root: string;\n serverUrl: string;\n};\n\nexport function getDevSessionPath(configDir = getCliConfigDir()): string {\n return join(configDir, \"dev-session.json\");\n}\n\nexport function isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch {\n return false;\n }\n}\n\nexport function writeDevSession(session: DevSession, configDir = getCliConfigDir()): void {\n const path = getDevSessionPath(configDir);\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, `${JSON.stringify(session)}\\n`, \"utf8\");\n}\n\nexport function clearDevSession(configDir = getCliConfigDir()): void {\n const path = getDevSessionPath(configDir);\n if (existsSync(path)) {\n unlinkSync(path);\n }\n}\n\nexport function readDevSession(configDir = getCliConfigDir()): DevSession | undefined {\n const path = getDevSessionPath(configDir);\n if (!existsSync(path)) {\n return undefined;\n }\n\n try {\n const session = JSON.parse(readFileSync(path, \"utf8\")) as DevSession;\n if (!isProcessAlive(session.pid)) {\n clearDevSession(configDir);\n return undefined;\n }\n return session;\n } catch {\n clearDevSession(configDir);\n return undefined;\n }\n}\n","import type Conf from \"conf\";\nimport { PlatformError } from \"@keystrokehq/sdk/platform\";\n\nimport {\n getConfigDir,\n getEffectiveApiTarget,\n getPlatformUrl,\n getServerUrl,\n type CliConfig,\n} from \"./config\";\nimport { readDevSession } from \"./dev-session\";\nimport { createCliPlatformClient } from \"./platform-client\";\n\nexport type ApiTargetOptions = {\n projectId?: string;\n local?: boolean;\n /** Route to `/api/projects/:id` and require a project id. Default false. */\n projectScoped?: boolean;\n /** Org-level platform API; ignores `--project` and activeProjectId. */\n orgScoped?: boolean;\n};\n\nexport const projectScopedTarget: ApiTargetOptions = { projectScoped: true };\n\nexport type ResolvedApiTarget = {\n baseUrl: string;\n projectId?: string;\n mode: \"local\" | \"platform\";\n};\n\nfunction resolveLocalTarget(config: Conf<CliConfig>): ResolvedApiTarget {\n return {\n baseUrl: getServerUrl(config),\n mode: \"local\",\n };\n}\n\nfunction resolveOrgPlatformTarget(config: Conf<CliConfig>): ResolvedApiTarget {\n return {\n baseUrl: `${getPlatformUrl(config).replace(/\\/+$/, \"\")}/api`,\n mode: \"platform\",\n };\n}\n\nasync function resolvePlatformTarget(\n config: Conf<CliConfig>,\n projectId: string,\n): Promise<ResolvedApiTarget> {\n const platform = createCliPlatformClient(config);\n let project;\n try {\n project = await platform.projects.get(projectId);\n } catch (error) {\n if (error instanceof PlatformError && error.status === 404) {\n throw new Error(\n `Project ${projectId} not found in the active organization. Run \\`keystroke config use project <id>\\` or pass \\`--project\\` with a valid project id.`,\n );\n }\n throw error;\n }\n if (project.status !== \"active\") {\n throw new Error(`Project ${projectId} is not active (${project.status})`);\n }\n\n const platformUrl = getPlatformUrl(config).replace(/\\/+$/, \"\");\n return {\n baseUrl: `${platformUrl}/api/projects/${encodeURIComponent(projectId)}`,\n projectId,\n mode: \"platform\",\n };\n}\n\nexport async function resolveApiTarget(\n config: Conf<CliConfig>,\n options: ApiTargetOptions = {},\n): Promise<ResolvedApiTarget> {\n if (options.local) {\n return resolveLocalTarget(config);\n }\n\n const devSession = readDevSession(getConfigDir(config));\n if (devSession && getEffectiveApiTarget(config) !== \"platform\") {\n return {\n baseUrl: devSession.serverUrl,\n mode: \"local\",\n };\n }\n\n if (options.orgScoped || options.projectScoped === false) {\n if (getEffectiveApiTarget(config) === \"local\") {\n return resolveLocalTarget(config);\n }\n return resolveOrgPlatformTarget(config);\n }\n\n if (options.projectId) {\n return resolvePlatformTarget(config, options.projectId);\n }\n\n if (getEffectiveApiTarget(config) === \"local\") {\n return resolveLocalTarget(config);\n }\n\n if (!options.projectScoped) {\n return resolveOrgPlatformTarget(config);\n }\n\n const projectId = options.projectId ?? config.get(\"activeProjectId\");\n if (!projectId) {\n throw new Error(\n \"No project selected. Pass `--project <id>` or run `keystroke config use project <id>`.\",\n );\n }\n\n return resolvePlatformTarget(config, projectId);\n}\n","import type { ApiTargetOptions } from \"./resolve-api-target\";\n\nlet targetOptions: ApiTargetOptions = {};\n\nexport function setCliTargetOptions(options: ApiTargetOptions): void {\n targetOptions = options;\n}\n\nexport function getCliTargetOptions(): ApiTargetOptions {\n return targetOptions;\n}\n","import type { ValidationErrorDetail } from \"@keystrokehq/shared\";\n\nfunction exampleValueFromValidationMessage(message: string): unknown {\n if (/expected number/i.test(message)) {\n return 0;\n }\n if (/expected string/i.test(message)) {\n return \"\";\n }\n if (/expected boolean/i.test(message)) {\n return false;\n }\n if (/expected array/i.test(message)) {\n return [];\n }\n if (/expected object/i.test(message)) {\n return {};\n }\n\n const enumMatch = message.match(/expected one of (.+)/i);\n if (enumMatch) {\n const firstOption = enumMatch[1]?.match(/\"([^\"]+)\"/);\n if (firstOption?.[1]) {\n return firstOption[1];\n }\n }\n\n return null;\n}\n\nfunction setNestedExampleValue(input: Record<string, unknown>, path: string, value: unknown): void {\n const parts = path.split(\".\").filter(Boolean);\n if (parts.length === 0) {\n return;\n }\n\n let current: Record<string, unknown> = input;\n for (let index = 0; index < parts.length - 1; index += 1) {\n const key = parts[index]!;\n const next = current[key];\n if (typeof next !== \"object\" || next === null || Array.isArray(next)) {\n current[key] = {};\n }\n current = current[key] as Record<string, unknown>;\n }\n\n current[parts[parts.length - 1]!] = value;\n}\n\nexport function exampleInputFromValidationDetails(\n details: ValidationErrorDetail[],\n): Record<string, unknown> {\n const input: Record<string, unknown> = {};\n\n for (const detail of details) {\n if (!detail.path) {\n continue;\n }\n setNestedExampleValue(input, detail.path, exampleValueFromValidationMessage(detail.message));\n }\n\n return input;\n}\n","import type { ErrorResponse } from \"@keystrokehq/shared\";\nimport { exampleInputFromValidationDetails } from \"./example-input\";\nimport type { CliUsageHint } from \"./types\";\n\n/** Turn a parsed API error body into terminal output. */\nexport function formatApiErrorMessage(\n response: ErrorResponse,\n fallback: string,\n options?: CliUsageHint,\n): string {\n const summary = response.message ?? response.error ?? fallback;\n\n if (!response.details?.length) {\n return summary;\n }\n\n const lines = response.details.map((detail) => {\n const field = detail.path || \"(root)\";\n return ` • ${field}: ${detail.message}`;\n });\n let message = `${summary}:\\n${lines.join(\"\\n\")}`;\n\n if (options?.usage) {\n const example = JSON.stringify(exampleInputFromValidationDetails(response.details));\n const flag = options.usage.flag ?? \"--input\";\n message += `\\n\\nTry: ${options.usage.command} ${flag} '${example}'`;\n }\n\n return message;\n}\n","import { parseErrorResponse } from \"@keystrokehq/shared\";\nimport { KeystrokeError } from \"@keystrokehq/sdk\";\nimport { PlatformError } from \"@keystrokehq/sdk/platform\";\nimport { getAccessToken } from \"../auth/credentials\";\nimport type { CliErrorContext } from \"./types\";\nimport { formatApiErrorMessage } from \"./format-api-message\";\n\nfunction isUnreachableServerError(error: Error): boolean {\n return (\n error.message.includes(\"network error\") ||\n error.message.includes(\"ECONNREFUSED\") ||\n error.message.includes(\"ENOTFOUND\") ||\n error.message.includes(\"fetch failed\")\n );\n}\n\nfunction unreachableTarget(context?: CliErrorContext): string | undefined {\n return context?.serverUrl ?? context?.webUrl;\n}\n\nfunction unreachableServerMessage(targetUrl?: string): string {\n const target = targetUrl ?? \"the keystroke server\";\n return `Could not reach ${target}. Is the server running? (keystroke dev or keystroke start)`;\n}\n\ntype HttpClientError = {\n status: number;\n body: unknown;\n message: string;\n};\n\nfunction formatHttpClientError(error: HttpClientError, context?: CliErrorContext): string {\n if (error.status === 401) {\n if (context?.webUrl && !getAccessToken(context.webUrl)) {\n return \"Not logged in. Run `keystroke auth login` first.\";\n }\n return \"Authentication failed. Run `keystroke auth login` again.\";\n }\n\n if (error.status === 0) {\n return unreachableServerMessage(unreachableTarget(context));\n }\n\n const parsed = parseErrorResponse(error.body);\n if (parsed) {\n return formatApiErrorMessage(parsed, error.message, context);\n }\n\n return error.message;\n}\n\nexport function formatCliError(\n error: unknown,\n fallback: string,\n context?: CliErrorContext,\n): string {\n if (error instanceof KeystrokeError || error instanceof PlatformError) {\n return formatHttpClientError(error, context);\n }\n\n if (error instanceof Error) {\n if (isUnreachableServerError(error)) {\n return unreachableServerMessage(unreachableTarget(context));\n }\n return error.message;\n }\n\n return fallback;\n}\n","import { createCliClient } from \"../client\";\nimport { createCliConfig, getWebUrl } from \"../config\";\nimport { ensureActiveOrganization } from \"../organization/active-organization\";\nimport {\n projectScopedTarget,\n resolveApiTarget,\n type ApiTargetOptions,\n} from \"../resolve-api-target\";\nimport { getCliTargetOptions } from \"../target-options\";\nimport type { CliContext, CliErrorContext } from \"./types\";\nimport { formatCliError } from \"./format-cli-error\";\n\nexport async function runProjectCliCommand(\n fallback: string,\n fn: (ctx: CliContext) => Promise<void>,\n errorContext?: CliErrorContext,\n targetOptions: ApiTargetOptions = {},\n): Promise<void> {\n return runCliCommand(fallback, fn, errorContext, {\n ...projectScopedTarget,\n ...targetOptions,\n });\n}\n\nexport async function runCliCommand(\n fallback: string,\n fn: (ctx: CliContext) => Promise<void>,\n errorContext?: CliErrorContext,\n targetOptions: ApiTargetOptions = {},\n): Promise<void> {\n const config = createCliConfig();\n const target = await resolveApiTarget(config, {\n ...getCliTargetOptions(),\n ...targetOptions,\n });\n\n if (target.mode === \"platform\") {\n await ensureActiveOrganization(config);\n }\n\n const ctx: CliContext = {\n config,\n client: createCliClient(config, {\n baseUrl: target.baseUrl,\n platform: target.mode === \"platform\",\n }),\n serverUrl: target.baseUrl,\n webUrl: getWebUrl(config),\n apiTarget: target,\n };\n\n try {\n await fn(ctx);\n } catch (error) {\n process.stderr.write(\n `${formatCliError(error, fallback, {\n ...errorContext,\n serverUrl: ctx.serverUrl,\n webUrl: ctx.webUrl,\n })}\\n`,\n );\n process.exitCode = 1;\n }\n}\n","/**\n * Binary name to show in help text and \"Try: ...\" hints. Always the published\n * `keystroke`, or the `keystroke-dev` wrapper (which sets KEYSTROKE_DEV) so\n * examples stay copy-pasteable while developing on keystroke itself.\n */\nexport function cliBinaryName(): string {\n return process.env.KEYSTROKE_DEV ? \"keystroke-dev\" : \"keystroke\";\n}\n\n/** Parse a JSON CLI flag; throws a readable error on invalid input. */\nexport function parseJsonOption(value: string, flag: string): unknown {\n try {\n return JSON.parse(value) as unknown;\n } catch {\n throw new Error(`Invalid ${flag} JSON`);\n }\n}\n","import type { Command } from \"commander\";\nimport { runProjectCliCommand } from \"../../errors\";\n\nexport function registerAgentPromptCommand(agent: Command): void {\n agent\n .command(\"prompt\")\n .description(\"Send a message to an agent (or follow up in an existing session)\")\n .argument(\"<agentId>\", \"Agent key / route id\")\n .requiredOption(\"--message <text>\", \"Message to send\")\n .option(\"--session-id <id>\", \"Existing session id for follow-up\")\n .action((agentId: string, options: { message: string; sessionId?: string }) =>\n runProjectCliCommand(\"Agent prompt failed\", async ({ client }) => {\n const result = await client.agents.prompt(agentId, {\n message: options.message,\n ...(options.sessionId ? { sessionId: options.sessionId } : {}),\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n}\n","import type { Command } from \"commander\";\nimport { runProjectCliCommand } from \"../../errors\";\n\nexport function registerAgentSessionsCommand(agent: Command): void {\n const sessions = agent.command(\"sessions\").description(\"List and inspect agent sessions\");\n\n sessions\n .command(\"list\")\n .description(\"List sessions for an agent\")\n .argument(\"<agentId>\", \"Agent key / route id\")\n .option(\"--limit <n>\", \"Page size (1–100)\", \"20\")\n .option(\"--cursor <cursor>\", \"Pagination cursor from a previous page\")\n .option(\"--status <status>\", \"Filter by status (running, completed, failed)\")\n .option(\"--source <source>\", \"Filter by source (api, gateway)\")\n .action((agentId: string, options: Record<string, string | undefined>) =>\n runProjectCliCommand(\"List agent sessions failed\", async ({ client }) => {\n const result = await client.agents.listSessions(agentId, {\n limit: Number(options.limit),\n ...(options.cursor ? { cursor: options.cursor } : {}),\n ...(options.status\n ? { status: options.status as \"running\" | \"completed\" | \"failed\" }\n : {}),\n ...(options.source ? { source: options.source as \"api\" | \"gateway\" } : {}),\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n\n sessions\n .command(\"get\")\n .description(\"Get full details for an agent session\")\n .argument(\"<agentId>\", \"Agent key / route id\")\n .argument(\"<sessionId>\", \"Agent session id\")\n .option(\"--include <parts>\", \"Comma-separated: gateway, messages, events, trace\")\n .action((agentId: string, sessionId: string, options: { include?: string }) =>\n runProjectCliCommand(\"Get agent session failed\", async ({ client }) => {\n const result = await client.agents.getSession(agentId, sessionId, {\n include: options.include,\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n}\n","import type { Command } from \"commander\";\nimport { registerAgentPromptCommand } from \"./prompt\";\nimport { registerAgentSessionsCommand } from \"./sessions\";\n\nexport function registerAgentCommand(program: Command): void {\n const agent = program.command(\"agent\").description(\"Invoke and inspect agents\");\n\n registerAgentPromptCommand(agent);\n registerAgentSessionsCommand(agent);\n}\n","import { spawn } from \"node:child_process\";\n\nexport function openUrl(url: string): void {\n const platform = process.platform;\n const command = platform === \"darwin\" ? \"open\" : platform === \"win32\" ? \"start\" : \"xdg-open\";\n\n spawn(command, [url], {\n detached: true,\n stdio: \"ignore\",\n }).unref();\n}\n","import type { ConnectProvider } from \"@keystrokehq/shared\";\nimport type { KeystrokeClient } from \"@keystrokehq/sdk\";\nimport { openUrl } from \"../../auth/open-url\";\n\nfunction providerLabel(key: string): string {\n return key.charAt(0).toUpperCase() + key.slice(1);\n}\n\nexport async function runConnect(options: {\n client: KeystrokeClient;\n provider: ConnectProvider;\n serverUrl: string;\n printUrl?: boolean;\n}): Promise<void> {\n const { client, provider, serverUrl, printUrl } = options;\n const label = providerLabel(provider.key);\n\n if (provider.mode === \"browser-redirect\") {\n const url = `${serverUrl}${provider.path}`;\n\n if (printUrl) {\n process.stdout.write(`${url}\\n`);\n return;\n }\n\n openUrl(url);\n process.stdout.write(`Complete ${label} sign-in in your browser.\\n`);\n return;\n }\n\n const payload = await client.connect.getAuthorizeUrl(provider.path);\n\n const authorizeUrl = new URL(payload.url);\n const scopes = authorizeUrl.searchParams.get(\"scope\")?.split(\" \").filter(Boolean) ?? [];\n\n if (scopes.length > 0) {\n process.stdout.write(\"Requested scopes:\\n\");\n for (const scope of scopes) {\n process.stdout.write(` - ${scope}\\n`);\n }\n process.stdout.write(\"\\n\");\n }\n\n if (printUrl) {\n process.stdout.write(`${payload.url}\\n`);\n return;\n }\n\n openUrl(payload.url);\n process.stdout.write(`Complete ${label} sign-in in your browser.\\n`);\n}\n","import type { Command } from \"commander\";\nimport { runCliCommand } from \"../../errors\";\nimport { getCliTargetOptions } from \"../../target-options\";\nimport type { ApiTargetOptions } from \"../../resolve-api-target\";\nimport { runConnect } from \"./run-connect\";\n\nfunction resolveConnectTargetOptions(): ApiTargetOptions {\n const { local } = getCliTargetOptions();\n if (local) {\n return { local: true };\n }\n return { orgScoped: true };\n}\n\nexport function registerConnectCommand(program: Command): void {\n program\n .command(\"connect [provider]\")\n .description(\"Connect third-party accounts (uses apiTarget; --local for local server)\")\n .option(\"--print-url\", \"Print the authorize URL and exit without opening the browser\")\n .action((provider: string | undefined, options: { printUrl?: boolean }) =>\n runCliCommand(\n \"Could not fetch connect providers\",\n async (ctx) => {\n const providers = await ctx.client.connect.listProviders();\n\n if (!provider) {\n if (providers.length === 0) {\n process.stdout.write(\"No connect providers available on this server.\\n\");\n return;\n }\n\n process.stdout.write(\"Available providers:\\n\");\n for (const entry of providers) {\n process.stdout.write(` ${entry.key}\\n`);\n }\n return;\n }\n\n const match = providers.find((entry) => entry.key === provider);\n if (!match) {\n const available = providers.map((entry) => entry.key).join(\", \") || \"(none)\";\n throw new Error(`Unknown provider \"${provider}\". Available: ${available}`);\n }\n\n await runConnect({\n client: ctx.client,\n provider: match,\n serverUrl: ctx.serverUrl,\n printUrl: options.printUrl,\n });\n },\n undefined,\n resolveConnectTargetOptions(),\n ),\n );\n}\n","import type { CredentialScopeType } from \"@keystrokehq/shared\";\nimport type { ApiTargetOptions } from \"../../resolve-api-target\";\nimport { projectScopedTarget } from \"../../resolve-api-target\";\n\nexport function resolveCredentialsTargetOptions(\n options: {\n scopeType?: CredentialScopeType;\n projectId?: string;\n } = {},\n): ApiTargetOptions {\n if (options.scopeType === \"project\") {\n return {\n ...projectScopedTarget,\n projectId: options.projectId,\n };\n }\n\n return { orgScoped: true };\n}\n","import type { Command } from \"commander\";\nimport { runCliCommand } from \"../../errors\";\nimport { resolveCredentialsTargetOptions } from \"./target-options\";\n\nexport function registerCredentialsDeleteCommand(credentials: Command): void {\n credentials\n .command(\"delete\")\n .description(\"Delete an api_key credential instance\")\n .argument(\"<id>\", \"Credential instance id\")\n .action((id: string) =>\n runCliCommand(\n \"Delete credential failed\",\n async ({ client }) => {\n await client.credentials.deleteInstance(id);\n },\n undefined,\n resolveCredentialsTargetOptions(),\n ),\n );\n}\n","import type { Command } from \"commander\";\nimport { runCliCommand } from \"../../errors\";\nimport { resolveCredentialsTargetOptions } from \"./target-options\";\n\nexport function registerCredentialsListCommand(credentials: Command): void {\n credentials\n .command(\"list\")\n .description(\"List stored credential instances\")\n .option(\"--key <key>\", \"Filter by credential key\")\n .action((options: { key?: string }) =>\n runCliCommand(\n \"List credential instances failed\",\n async ({ client }) => {\n const result = await client.credentials.listInstances(\n options.key ? { key: options.key } : undefined,\n );\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n },\n undefined,\n resolveCredentialsTargetOptions(),\n ),\n );\n}\n","import type { CredentialScopeType } from \"@keystrokehq/shared\";\nimport type { KeystrokeClient } from \"@keystrokehq/sdk\";\nimport { cliBinaryName } from \"../../errors\";\n\ntype ConflictInstance = {\n id: string;\n label: string | null;\n isDefault: boolean;\n};\n\nfunction describeInstance(instance: ConflictInstance): string {\n const defaultStatus = instance.isDefault ? \"default\" : \"not default\";\n const labelStatus = instance.label ? `label: ${instance.label}` : \"no label\";\n return `id: ${instance.id}, ${defaultStatus}, ${labelStatus}`;\n}\n\nfunction formatSetFields(setFields: string[]): string {\n return setFields.map((field) => `--set ${field}`).join(\" \");\n}\n\nfunction formatSetConflictError(args: {\n key: string;\n scope: string;\n setFields: string[];\n matching: ConflictInstance[];\n}): string {\n const binary = cliBinaryName();\n const setArgs = formatSetFields(args.setFields);\n const listCmd = `${binary} credentials list --key ${args.key}`;\n const addSecondCmd = `${binary} credentials set ${args.key} --scope ${args.scope} --label <name> ${setArgs}`;\n\n if (args.matching.length === 1) {\n const instance = args.matching[0]!;\n const updateCmd = `${binary} credentials update ${instance.id} ${setArgs}`;\n\n return [\n `An ${args.key} credential already exists in ${args.scope} scope (${describeInstance(instance)}).`,\n \"credentials set creates a new instance — it does not update an existing one.\",\n \"To update the existing credential:\",\n ` ${updateCmd}`,\n \"To add a second credential in the same scope:\",\n ` ${addSecondCmd}`,\n `List instances: ${listCmd}`,\n ].join(\"\\n\");\n }\n\n const instanceLines = args.matching.map((instance) => ` • ${describeInstance(instance)}`);\n\n return [\n `Multiple ${args.key} credentials already exist in ${args.scope} scope. --label is required to add another:`,\n ...instanceLines,\n \"To add another credential in the same scope:\",\n ` ${addSecondCmd}`,\n `List instances: ${listCmd}`,\n ].join(\"\\n\");\n}\n\nexport async function assertNoSetConflict(\n client: KeystrokeClient,\n args: {\n key: string;\n scope: string;\n scopeType: CredentialScopeType;\n projectId?: string;\n label?: string;\n setFields: string[];\n },\n): Promise<void> {\n if (args.label) {\n return;\n }\n\n const { instances } = await client.credentials.listInstances({ key: args.key });\n const matching = instances.filter(\n (instance) =>\n instance.scopeType === args.scopeType &&\n (args.scopeType !== \"project\" || instance.scopeId === args.projectId),\n );\n\n if (matching.length === 0) {\n return;\n }\n\n throw new Error(\n formatSetConflictError({\n key: args.key,\n scope: args.scope,\n setFields: args.setFields,\n matching,\n }),\n );\n}\n","export const ENV_REF_PREFIX = \"@env:\";\n\nexport function isEnvRef(raw: string): boolean {\n return raw.startsWith(ENV_REF_PREFIX);\n}\n\nexport function envRefName(raw: string): string {\n return raw.slice(ENV_REF_PREFIX.length);\n}\n","import { existsSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\n\nfunction hasProjectLayout(dir: string): boolean {\n return existsSync(join(dir, \"package.json\")) && existsSync(join(dir, \"src\", \"agents\"));\n}\n\nexport function resolveProjectRoot(fromDir = process.cwd()): string {\n let dir = resolve(fromDir);\n\n while (dir !== dirname(dir)) {\n if (hasProjectLayout(dir)) {\n return dir;\n }\n\n dir = dirname(dir);\n }\n\n if (hasProjectLayout(dir)) {\n return dir;\n }\n\n throw new Error(\"Could not find keystroke project root (expected package.json and src/agents/)\");\n}\n","import { existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { resolveProjectRoot } from \"./resolve-project-root\";\n\nlet loaded = false;\n\nexport function parseEnvFile(contents: string): Record<string, string> {\n const values: Record<string, string> = {};\n\n for (const line of contents.split(\"\\n\")) {\n const trimmed = line.trim();\n if (!trimmed || trimmed.startsWith(\"#\")) {\n continue;\n }\n\n const eq = trimmed.indexOf(\"=\");\n if (eq === -1) {\n continue;\n }\n\n const key = trimmed.slice(0, eq).trim();\n let value = trimmed.slice(eq + 1).trim();\n if (\n (value.startsWith('\"') && value.endsWith('\"')) ||\n (value.startsWith(\"'\") && value.endsWith(\"'\"))\n ) {\n value = value.slice(1, -1);\n }\n\n values[key] = value;\n }\n\n return values;\n}\n\nexport function loadProjectEnv(fromDir = process.cwd()): void {\n if (loaded) {\n return;\n }\n\n loaded = true;\n\n let envPath: string;\n try {\n envPath = join(resolveProjectRoot(fromDir), \".env\");\n } catch {\n return;\n }\n\n if (!existsSync(envPath)) {\n return;\n }\n\n for (const [key, value] of Object.entries(parseEnvFile(readFileSync(envPath, \"utf8\")))) {\n if (process.env[key] === undefined) {\n process.env[key] = value;\n }\n }\n}\n\nexport function resetProjectEnvLoadedForTests(): void {\n loaded = false;\n}\n","import { envRefName, isEnvRef } from \"../../project/env-ref\";\nimport { loadProjectEnv } from \"../../project/load-project-env\";\n\nexport function parseCredentialValueFields(fields: string[]): Record<string, string> {\n const value: Record<string, string> = {};\n\n for (const field of fields) {\n const separatorIndex = field.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new Error(`Invalid --set value: ${field}`);\n }\n\n const key = field.slice(0, separatorIndex);\n let rawValue = field.slice(separatorIndex + 1);\n\n if (isEnvRef(rawValue)) {\n const envName = envRefName(rawValue);\n if (process.env[envName] === undefined) {\n loadProjectEnv();\n }\n rawValue = process.env[envName] ?? \"\";\n if (!rawValue) {\n throw new Error(`Environment variable ${envName} is not set`);\n }\n }\n\n value[key] = rawValue;\n }\n\n if (Object.keys(value).length === 0) {\n throw new Error(\"At least one --set field is required\");\n }\n\n return value;\n}\n\nexport function scopeTypeFromCli(scope: string): \"organization\" | \"user\" | \"project\" | \"global\" {\n switch (scope) {\n case \"org\":\n return \"organization\";\n case \"user\":\n return \"user\";\n case \"project\":\n return \"project\";\n case \"global\":\n return \"global\";\n default:\n throw new Error(`Unknown scope \"${scope}\". Expected org, user, project, or global.`);\n }\n}\n","import type { Command } from \"commander\";\nimport { runCliCommand } from \"../../errors\";\nimport { assertNoSetConflict } from \"./format-set-conflict-error\";\nimport { parseCredentialValueFields, scopeTypeFromCli } from \"./parse-value\";\nimport { resolveCredentialsTargetOptions } from \"./target-options\";\n\nexport function registerCredentialsSetCommand(credentials: Command): void {\n credentials\n .command(\"set\")\n .description(\"Create a new api_key credential instance\")\n .argument(\"<key>\", \"Credential key, e.g. exa\")\n .requiredOption(\"--scope <scope>\", \"org, user, project, or global\")\n .option(\"--project-id <id>\", \"Project id when scope is project\")\n .option(\"--label <label>\", \"Human-readable label within the scope\")\n .option(\"--default\", \"Mark as default for this scope\")\n .option(\n \"--set <field>\",\n \"Credential field as key=value or key=@env:VAR (falls back to project .env when unset in shell)\",\n collectSetValues,\n [],\n )\n .action(\n (\n key: string,\n options: {\n scope: string;\n projectId?: string;\n label?: string;\n default?: boolean;\n set: string[];\n },\n ) =>\n runCliCommand(\n \"Set credential failed\",\n async ({ client }) => {\n const value = parseCredentialValueFields(options.set);\n const scopeType = scopeTypeFromCli(options.scope);\n\n if (scopeType === \"project\" && !options.projectId) {\n throw new Error(\"--project-id is required when scope is project\");\n }\n\n await assertNoSetConflict(client, {\n key,\n scope: options.scope,\n scopeType,\n projectId: options.projectId,\n label: options.label,\n setFields: options.set,\n });\n\n const result = await client.credentials.createInstance({\n key,\n scopeType,\n scopeId: scopeType === \"project\" ? options.projectId! : undefined,\n label: options.label,\n isDefault: options.default,\n value,\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n },\n undefined,\n resolveCredentialsTargetOptions({\n scopeType: scopeTypeFromCli(options.scope),\n projectId: options.projectId,\n }),\n ),\n );\n}\n\nfunction collectSetValues(value: string, previous: string[]): string[] {\n return previous.concat([value]);\n}\n","import type { Command } from \"commander\";\nimport { runCliCommand } from \"../../errors\";\nimport { parseCredentialValueFields } from \"./parse-value\";\nimport { resolveCredentialsTargetOptions } from \"./target-options\";\n\nexport function registerCredentialsUpdateCommand(credentials: Command): void {\n credentials\n .command(\"update\")\n .description(\"Update an api_key credential instance\")\n .argument(\"<id>\", \"Credential instance id\")\n .option(\"--label <label>\", \"Human-readable label within the scope\")\n .option(\"--default\", \"Mark as default for this scope\")\n .option(\"--set <field>\", \"Credential field as key=value or key=@env:VAR\", collectSetValues, [])\n .action(\n (\n id: string,\n options: {\n label?: string;\n default?: boolean;\n set: string[];\n },\n ) =>\n runCliCommand(\n \"Update credential failed\",\n async ({ client }) => {\n const value =\n options.set.length > 0 ? parseCredentialValueFields(options.set) : undefined;\n\n const result = await client.credentials.updateInstance(id, {\n ...(options.label !== undefined ? { label: options.label } : {}),\n ...(options.default !== undefined ? { isDefault: options.default } : {}),\n ...(value ? { value } : {}),\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n },\n undefined,\n resolveCredentialsTargetOptions(),\n ),\n );\n}\n\nfunction collectSetValues(value: string, previous: string[]): string[] {\n return previous.concat([value]);\n}\n","import type { Command } from \"commander\";\nimport { registerCredentialsDeleteCommand } from \"./delete\";\nimport { registerCredentialsListCommand } from \"./list\";\nimport { registerCredentialsSetCommand } from \"./set\";\nimport { registerCredentialsUpdateCommand } from \"./update\";\n\nexport function registerCredentialsCommand(program: Command): void {\n const credentials = program\n .command(\"credentials\")\n .description(\"Manage stored api_key credential instances\");\n\n registerCredentialsListCommand(credentials);\n registerCredentialsSetCommand(credentials);\n registerCredentialsUpdateCommand(credentials);\n registerCredentialsDeleteCommand(credentials);\n}\n","//#region src/constants.ts\n/** OAuth device-flow client id for `keystroke auth login`. */\nconst CLI_CLIENT_ID = \"keystroke-cli\";\n//#endregion\nexport { CLI_CLIENT_ID as t };\n\n//# sourceMappingURL=constants-BaNTvWUo.mjs.map","//#region package.json\nvar version = \"1.6.11\";\n//#endregion\nexport { version };\n","import { version } from \"./package.mjs\";\n//#region src/version.ts\nconst PACKAGE_VERSION = version;\n//#endregion\nexport { PACKAGE_VERSION };\n","//#region src/error.ts\nfunction isErrorStackTraceLimitWritable() {\n\tconst desc = Object.getOwnPropertyDescriptor(Error, \"stackTraceLimit\");\n\tif (desc === void 0) return Object.isExtensible(Error);\n\treturn Object.prototype.hasOwnProperty.call(desc, \"writable\") ? desc.writable : desc.set !== void 0;\n}\n/**\n* Hide internal stack frames from the error stack trace.\n*/\nfunction hideInternalStackFrames(stack) {\n\tconst lines = stack.split(\"\\n at \");\n\tif (lines.length <= 1) return stack;\n\tlines.splice(1, 1);\n\treturn lines.join(\"\\n at \");\n}\n/**\n* Creates a custom error class that hides stack frames.\n*/\nfunction makeErrorForHideStackFrame(Base, clazz) {\n\tclass HideStackFramesError extends Base {\n\t\t#hiddenStack;\n\t\tconstructor(...args) {\n\t\t\tif (isErrorStackTraceLimitWritable()) {\n\t\t\t\tconst limit = Error.stackTraceLimit;\n\t\t\t\tError.stackTraceLimit = 0;\n\t\t\t\tsuper(...args);\n\t\t\t\tError.stackTraceLimit = limit;\n\t\t\t} else super(...args);\n\t\t\tconst stack = (/* @__PURE__ */ new Error()).stack;\n\t\t\tif (stack) this.#hiddenStack = hideInternalStackFrames(stack.replace(/^Error/, this.name));\n\t\t}\n\t\tget errorStack() {\n\t\t\treturn this.#hiddenStack;\n\t\t}\n\t}\n\tObject.defineProperty(HideStackFramesError.prototype, \"constructor\", {\n\t\tget() {\n\t\t\treturn clazz;\n\t\t},\n\t\tenumerable: false,\n\t\tconfigurable: true\n\t});\n\treturn HideStackFramesError;\n}\nconst statusCodes = {\n\tOK: 200,\n\tCREATED: 201,\n\tACCEPTED: 202,\n\tNO_CONTENT: 204,\n\tMULTIPLE_CHOICES: 300,\n\tMOVED_PERMANENTLY: 301,\n\tFOUND: 302,\n\tSEE_OTHER: 303,\n\tNOT_MODIFIED: 304,\n\tTEMPORARY_REDIRECT: 307,\n\tBAD_REQUEST: 400,\n\tUNAUTHORIZED: 401,\n\tPAYMENT_REQUIRED: 402,\n\tFORBIDDEN: 403,\n\tNOT_FOUND: 404,\n\tMETHOD_NOT_ALLOWED: 405,\n\tNOT_ACCEPTABLE: 406,\n\tPROXY_AUTHENTICATION_REQUIRED: 407,\n\tREQUEST_TIMEOUT: 408,\n\tCONFLICT: 409,\n\tGONE: 410,\n\tLENGTH_REQUIRED: 411,\n\tPRECONDITION_FAILED: 412,\n\tPAYLOAD_TOO_LARGE: 413,\n\tURI_TOO_LONG: 414,\n\tUNSUPPORTED_MEDIA_TYPE: 415,\n\tRANGE_NOT_SATISFIABLE: 416,\n\tEXPECTATION_FAILED: 417,\n\t\"I'M_A_TEAPOT\": 418,\n\tMISDIRECTED_REQUEST: 421,\n\tUNPROCESSABLE_ENTITY: 422,\n\tLOCKED: 423,\n\tFAILED_DEPENDENCY: 424,\n\tTOO_EARLY: 425,\n\tUPGRADE_REQUIRED: 426,\n\tPRECONDITION_REQUIRED: 428,\n\tTOO_MANY_REQUESTS: 429,\n\tREQUEST_HEADER_FIELDS_TOO_LARGE: 431,\n\tUNAVAILABLE_FOR_LEGAL_REASONS: 451,\n\tINTERNAL_SERVER_ERROR: 500,\n\tNOT_IMPLEMENTED: 501,\n\tBAD_GATEWAY: 502,\n\tSERVICE_UNAVAILABLE: 503,\n\tGATEWAY_TIMEOUT: 504,\n\tHTTP_VERSION_NOT_SUPPORTED: 505,\n\tVARIANT_ALSO_NEGOTIATES: 506,\n\tINSUFFICIENT_STORAGE: 507,\n\tLOOP_DETECTED: 508,\n\tNOT_EXTENDED: 510,\n\tNETWORK_AUTHENTICATION_REQUIRED: 511\n};\nvar InternalAPIError = class extends Error {\n\tconstructor(status = \"INTERNAL_SERVER_ERROR\", body = void 0, headers = {}, statusCode = typeof status === \"number\" ? status : statusCodes[status]) {\n\t\tsuper(body?.message, body?.cause ? { cause: body.cause } : void 0);\n\t\tthis.status = status;\n\t\tthis.body = body;\n\t\tthis.headers = headers;\n\t\tthis.statusCode = statusCode;\n\t\tthis.name = \"APIError\";\n\t\tthis.status = status;\n\t\tthis.headers = headers;\n\t\tthis.statusCode = statusCode;\n\t\tthis.body = body;\n\t}\n};\nvar ValidationError = class extends InternalAPIError {\n\tconstructor(message, issues) {\n\t\tsuper(400, {\n\t\t\tmessage,\n\t\t\tcode: \"VALIDATION_ERROR\"\n\t\t});\n\t\tthis.message = message;\n\t\tthis.issues = issues;\n\t\tthis.issues = issues;\n\t}\n};\nvar BetterCallError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"BetterCallError\";\n\t}\n};\nconst kAPIErrorHeaderSymbol = Symbol.for(\"better-call:api-error-headers\");\nconst APIError = makeErrorForHideStackFrame(InternalAPIError, Error);\n\n//#endregion\nexport { APIError, BetterCallError, ValidationError, hideInternalStackFrames, kAPIErrorHeaderSymbol, makeErrorForHideStackFrame, statusCodes };\n//# sourceMappingURL=error.mjs.map","import { BASE_ERROR_CODES } from \"./codes.mjs\";\nimport { APIError as APIError$1 } from \"better-call/error\";\n//#region src/error/index.ts\nvar BetterAuthError = class extends Error {\n\tconstructor(message, options) {\n\t\tsuper(message, options);\n\t\tthis.name = \"BetterAuthError\";\n\t\tthis.message = message;\n\t\tthis.stack = \"\";\n\t}\n};\nvar APIError = class APIError extends APIError$1 {\n\tconstructor(...args) {\n\t\tsuper(...args);\n\t}\n\tstatic fromStatus(status, body) {\n\t\treturn new APIError(status, body);\n\t}\n\tstatic from(status, error) {\n\t\treturn new APIError(status, {\n\t\t\tmessage: error.message,\n\t\t\tcode: error.code\n\t\t});\n\t}\n};\n//#endregion\nexport { APIError, BASE_ERROR_CODES, BetterAuthError };\n","import { PACKAGE_VERSION } from \"../../version.mjs\";\n//#region src/plugins/device-authorization/client.ts\nconst deviceAuthorizationClient = () => {\n\treturn {\n\t\tid: \"device-authorization\",\n\t\tversion: PACKAGE_VERSION,\n\t\t$InferServerPlugin: {},\n\t\tpathMethods: {\n\t\t\t\"/device/code\": \"POST\",\n\t\t\t\"/device/token\": \"POST\",\n\t\t\t\"/device\": \"GET\",\n\t\t\t\"/device/approve\": \"POST\",\n\t\t\t\"/device/deny\": \"POST\"\n\t\t}\n\t};\n};\n//#endregion\nexport { deviceAuthorizationClient };\n","import { cleanTasks } from '../task/index.js'\n\nexport const clean = Symbol('clean')\n\nexport const cleanStores = (...stores) => {\n if (process.env.NODE_ENV === 'production') {\n throw new Error(\n 'cleanStores() can be used only during development or tests'\n )\n }\n cleanTasks()\n for (let $store of stores) {\n if ($store) {\n if ($store.mocked) delete $store.mocked\n if ($store[clean]) $store[clean]()\n }\n }\n}\n","import { clean } from '../clean-stores/index.js'\n\nlet listenerQueue = []\nlet lqIndex = 0\nconst QUEUE_ITEMS_PER_LISTENER = 4\n// Use globalThis.nanostoresGlobal to store epoch so all module instances share\n// the same counter. This fixes issues when Nano Store is bundled separately\n// in different parts of an application (e.g., tree-shaking separates core\n// from React), causing each bundle to have its own epoch instance.\nexport const nanostoresGlobal = (globalThis.nanostoresGlobal ||= { epoch: 0 })\n\n/* @__NO_SIDE_EFFECTS__ */\nexport const atom = initialValue => {\n let listeners = []\n let $atom = {\n get() {\n if (!$atom.lc) {\n $atom.listen(() => {})()\n }\n return $atom.value\n },\n init: initialValue,\n lc: 0,\n listen(listener) {\n $atom.lc = listeners.push(listener)\n\n return () => {\n for (\n let i = lqIndex + QUEUE_ITEMS_PER_LISTENER;\n i < listenerQueue.length;\n ) {\n if (listenerQueue[i] === listener) {\n listenerQueue.splice(i, QUEUE_ITEMS_PER_LISTENER)\n } else {\n i += QUEUE_ITEMS_PER_LISTENER\n }\n }\n\n let index = listeners.indexOf(listener)\n if (~index) {\n listeners.splice(index, 1)\n if (!--$atom.lc) $atom.off()\n }\n }\n },\n notify(oldValue, changedKey) {\n nanostoresGlobal.epoch++\n let runListenerQueue = !listenerQueue.length\n for (let listener of listeners) {\n listenerQueue.push(listener, $atom.value, oldValue, changedKey)\n }\n\n if (runListenerQueue) {\n for (\n lqIndex = 0;\n lqIndex < listenerQueue.length;\n lqIndex += QUEUE_ITEMS_PER_LISTENER\n ) {\n listenerQueue[lqIndex](\n listenerQueue[lqIndex + 1],\n listenerQueue[lqIndex + 2],\n listenerQueue[lqIndex + 3]\n )\n }\n listenerQueue.length = 0\n }\n },\n /* It will be called on last listener unsubscribing.\n We will redefine it in onMount and onStop. */\n off() {},\n set(newValue) {\n let oldValue = $atom.value\n if (oldValue !== newValue) {\n $atom.value = newValue\n $atom.notify(oldValue)\n }\n },\n subscribe(listener) {\n let unbind = $atom.listen(listener)\n listener($atom.value)\n return unbind\n },\n value: initialValue\n }\n\n if (process.env.NODE_ENV !== 'production') {\n $atom[clean] = () => {\n listeners = []\n $atom.lc = 0\n $atom.off()\n }\n }\n\n return $atom\n}\n\nexport const readonlyType = store => store\n","import { clean } from '../clean-stores/index.js'\n\nconst START = 0\nconst STOP = 1\nconst SET = 2\nconst NOTIFY = 3\nconst MOUNT = 5\nconst UNMOUNT = 6\nconst REVERT_MUTATION = 10\n\nexport let on = (object, listener, eventKey, mutateStore) => {\n object.events = object.events || {}\n if (!object.events[eventKey + REVERT_MUTATION]) {\n object.events[eventKey + REVERT_MUTATION] = mutateStore(eventProps => {\n // eslint-disable-next-line no-sequences\n object.events[eventKey].reduceRight((event, l) => (l(event), event), {\n shared: {},\n ...eventProps\n })\n })\n }\n object.events[eventKey] = object.events[eventKey] || []\n object.events[eventKey].push(listener)\n return () => {\n let currentListeners = object.events[eventKey]\n let index = currentListeners.indexOf(listener)\n currentListeners.splice(index, 1)\n if (!currentListeners.length) {\n delete object.events[eventKey]\n object.events[eventKey + REVERT_MUTATION]()\n delete object.events[eventKey + REVERT_MUTATION]\n }\n }\n}\n\nexport let onStart = ($store, listener) =>\n on($store, listener, START, runListeners => {\n let originListen = $store.listen\n $store.listen = arg => {\n if (!$store.lc && !$store.starting) {\n $store.starting = true\n runListeners()\n delete $store.starting\n }\n return originListen(arg)\n }\n return () => {\n $store.listen = originListen\n }\n })\n\nexport let onStop = ($store, listener) =>\n on($store, listener, STOP, runListeners => {\n let originOff = $store.off\n $store.off = () => {\n runListeners()\n originOff()\n }\n return () => {\n $store.off = originOff\n }\n })\n\nexport let onSet = ($store, listener) =>\n on($store, listener, SET, runListeners => {\n let originSet = $store.set\n let originSetKey = $store.setKey\n if ($store.setKey) {\n $store.setKey = (changed, changedValue) => {\n let isAborted\n let abort = () => {\n isAborted = true\n }\n\n runListeners({\n abort,\n changed,\n newValue: { ...$store.value, [changed]: changedValue }\n })\n if (!isAborted) return originSetKey(changed, changedValue)\n }\n }\n $store.set = newValue => {\n let isAborted\n let abort = () => {\n isAborted = true\n }\n\n runListeners({ abort, newValue })\n if (!isAborted) return originSet(newValue)\n }\n return () => {\n $store.set = originSet\n $store.setKey = originSetKey\n }\n })\n\nexport let onNotify = ($store, listener) =>\n on($store, listener, NOTIFY, runListeners => {\n let originNotify = $store.notify\n $store.notify = (oldValue, changed) => {\n let isAborted\n let abort = () => {\n isAborted = true\n }\n\n runListeners({ abort, changed, oldValue })\n if (!isAborted) return originNotify(oldValue, changed)\n }\n return () => {\n $store.notify = originNotify\n }\n })\n\nexport const STORE_UNMOUNT_DELAY = 1000\n\nexport let onMount = ($store, initialize) => {\n let listener = payload => {\n let destroy = initialize(payload)\n if (destroy) $store.events[UNMOUNT].push(destroy)\n }\n return on($store, listener, MOUNT, runListeners => {\n let originListen = $store.listen\n $store.listen = (...args) => {\n if (!$store.lc && !$store.active) {\n $store.active = true\n runListeners()\n }\n return originListen(...args)\n }\n\n let originOff = $store.off\n $store.events[UNMOUNT] = []\n $store.off = () => {\n originOff()\n setTimeout(() => {\n if ($store.active && !$store.lc) {\n $store.active = false\n for (let destroy of $store.events[UNMOUNT]) destroy()\n $store.events[UNMOUNT] = []\n }\n }, STORE_UNMOUNT_DELAY)\n }\n\n if (process.env.NODE_ENV !== 'production') {\n let originClean = $store[clean]\n $store[clean] = () => {\n for (let destroy of $store.events[UNMOUNT]) destroy()\n $store.events[UNMOUNT] = []\n $store.active = false\n originClean()\n }\n }\n\n return () => {\n $store.listen = originListen\n $store.off = originOff\n }\n })\n}\n","import { atom, onMount } from \"nanostores\";\n//#region src/client/query.ts\nconst isServer = () => typeof window === \"undefined\";\nconst useAuthQuery = (initializedAtom, path, $fetch, options) => {\n\tconst value = atom({\n\t\tdata: null,\n\t\terror: null,\n\t\tisPending: true,\n\t\tisRefetching: false,\n\t\trefetch: (queryParams) => fn(queryParams)\n\t});\n\tconst fn = async (queryParams) => {\n\t\treturn new Promise((resolve) => {\n\t\t\tconst opts = typeof options === \"function\" ? options({\n\t\t\t\tdata: value.get().data,\n\t\t\t\terror: value.get().error,\n\t\t\t\tisPending: value.get().isPending\n\t\t\t}) : options;\n\t\t\t$fetch(path, {\n\t\t\t\t...opts,\n\t\t\t\tquery: {\n\t\t\t\t\t...opts?.query,\n\t\t\t\t\t...queryParams?.query\n\t\t\t\t},\n\t\t\t\tasync onSuccess(context) {\n\t\t\t\t\tvalue.set({\n\t\t\t\t\t\tdata: context.data,\n\t\t\t\t\t\terror: null,\n\t\t\t\t\t\tisPending: false,\n\t\t\t\t\t\tisRefetching: false,\n\t\t\t\t\t\trefetch: value.value.refetch\n\t\t\t\t\t});\n\t\t\t\t\tawait opts?.onSuccess?.(context);\n\t\t\t\t},\n\t\t\t\tasync onError(context) {\n\t\t\t\t\tconst { request } = context;\n\t\t\t\t\tconst retryAttempts = typeof request.retry === \"number\" ? request.retry : request.retry?.attempts;\n\t\t\t\t\tconst retryAttempt = request.retryAttempt || 0;\n\t\t\t\t\tif (retryAttempts && retryAttempt < retryAttempts) return;\n\t\t\t\t\tconst isUnauthorized = context.error.status === 401;\n\t\t\t\t\tvalue.set({\n\t\t\t\t\t\terror: context.error,\n\t\t\t\t\t\tdata: isUnauthorized ? null : value.get().data,\n\t\t\t\t\t\tisPending: false,\n\t\t\t\t\t\tisRefetching: false,\n\t\t\t\t\t\trefetch: value.value.refetch\n\t\t\t\t\t});\n\t\t\t\t\tawait opts?.onError?.(context);\n\t\t\t\t},\n\t\t\t\tasync onRequest(context) {\n\t\t\t\t\tconst currentValue = value.get();\n\t\t\t\t\tvalue.set({\n\t\t\t\t\t\tisPending: currentValue.data === null,\n\t\t\t\t\t\tdata: currentValue.data,\n\t\t\t\t\t\terror: null,\n\t\t\t\t\t\tisRefetching: true,\n\t\t\t\t\t\trefetch: value.value.refetch\n\t\t\t\t\t});\n\t\t\t\t\tawait opts?.onRequest?.(context);\n\t\t\t\t}\n\t\t\t}).catch((error) => {\n\t\t\t\tvalue.set({\n\t\t\t\t\terror,\n\t\t\t\t\tdata: value.get().data,\n\t\t\t\t\tisPending: false,\n\t\t\t\t\tisRefetching: false,\n\t\t\t\t\trefetch: value.value.refetch\n\t\t\t\t});\n\t\t\t}).finally(() => {\n\t\t\t\tresolve(void 0);\n\t\t\t});\n\t\t});\n\t};\n\tinitializedAtom = Array.isArray(initializedAtom) ? initializedAtom : [initializedAtom];\n\tlet isInitialized = false;\n\tfor (const initAtom of initializedAtom) initAtom.subscribe(async () => {\n\t\tif (isServer()) return;\n\t\tif (isInitialized) await fn();\n\t\telse onMount(value, () => {\n\t\t\tconst timeoutId = setTimeout(async () => {\n\t\t\t\tif (!isInitialized) {\n\t\t\t\t\tisInitialized = true;\n\t\t\t\t\tawait fn();\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t\treturn () => {\n\t\t\t\tvalue.off();\n\t\t\t\tinitAtom.off();\n\t\t\t\tclearTimeout(timeoutId);\n\t\t\t};\n\t\t});\n\t});\n\treturn value;\n};\n//#endregion\nexport { useAuthQuery };\n","//#region src/client/broadcast-channel.ts\nconst kBroadcastChannel = Symbol.for(\"better-auth:broadcast-channel\");\nconst now = () => Math.floor(Date.now() / 1e3);\nvar WindowBroadcastChannel = class {\n\tlisteners = /* @__PURE__ */ new Set();\n\tname;\n\tconstructor(name = \"better-auth.message\") {\n\t\tthis.name = name;\n\t}\n\tsubscribe(listener) {\n\t\tthis.listeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t};\n\t}\n\tpost(message) {\n\t\tif (typeof window === \"undefined\") return;\n\t\ttry {\n\t\t\tlocalStorage.setItem(this.name, JSON.stringify({\n\t\t\t\t...message,\n\t\t\t\ttimestamp: now()\n\t\t\t}));\n\t\t} catch {}\n\t}\n\tsetup() {\n\t\tif (typeof window === \"undefined\" || typeof window.addEventListener === \"undefined\") return () => {};\n\t\tconst handler = (event) => {\n\t\t\tif (event.key !== this.name) return;\n\t\t\tconst message = JSON.parse(event.newValue ?? \"{}\");\n\t\t\tif (message?.event !== \"session\" || !message?.data) return;\n\t\t\tthis.listeners.forEach((listener) => listener(message));\n\t\t};\n\t\twindow.addEventListener(\"storage\", handler);\n\t\treturn () => {\n\t\t\twindow.removeEventListener(\"storage\", handler);\n\t\t};\n\t}\n};\nfunction getGlobalBroadcastChannel(name = \"better-auth.message\") {\n\tif (!globalThis[kBroadcastChannel]) globalThis[kBroadcastChannel] = new WindowBroadcastChannel(name);\n\treturn globalThis[kBroadcastChannel];\n}\n//#endregion\nexport { getGlobalBroadcastChannel, kBroadcastChannel };\n","//#region src/client/focus-manager.ts\nconst kFocusManager = Symbol.for(\"better-auth:focus-manager\");\nvar WindowFocusManager = class {\n\tlisteners = /* @__PURE__ */ new Set();\n\tsubscribe(listener) {\n\t\tthis.listeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t};\n\t}\n\tsetFocused(focused) {\n\t\tthis.listeners.forEach((listener) => listener(focused));\n\t}\n\tsetup() {\n\t\tif (typeof window === \"undefined\" || typeof document === \"undefined\" || typeof window.addEventListener === \"undefined\") return () => {};\n\t\tconst visibilityHandler = () => {\n\t\t\tif (document.visibilityState === \"visible\") this.setFocused(true);\n\t\t};\n\t\tdocument.addEventListener(\"visibilitychange\", visibilityHandler, false);\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"visibilitychange\", visibilityHandler, false);\n\t\t};\n\t}\n};\nfunction getGlobalFocusManager() {\n\tif (!globalThis[kFocusManager]) globalThis[kFocusManager] = new WindowFocusManager();\n\treturn globalThis[kFocusManager];\n}\n//#endregion\nexport { getGlobalFocusManager, kFocusManager };\n","//#region src/client/online-manager.ts\nconst kOnlineManager = Symbol.for(\"better-auth:online-manager\");\nvar WindowOnlineManager = class {\n\tlisteners = /* @__PURE__ */ new Set();\n\tisOnline = typeof navigator !== \"undefined\" ? navigator.onLine : true;\n\tsubscribe(listener) {\n\t\tthis.listeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t};\n\t}\n\tsetOnline(online) {\n\t\tthis.isOnline = online;\n\t\tthis.listeners.forEach((listener) => listener(online));\n\t}\n\tsetup() {\n\t\tif (typeof window === \"undefined\" || typeof window.addEventListener === \"undefined\") return () => {};\n\t\tconst onOnline = () => this.setOnline(true);\n\t\tconst onOffline = () => this.setOnline(false);\n\t\twindow.addEventListener(\"online\", onOnline, false);\n\t\twindow.addEventListener(\"offline\", onOffline, false);\n\t\treturn () => {\n\t\t\twindow.removeEventListener(\"online\", onOnline, false);\n\t\t\twindow.removeEventListener(\"offline\", onOffline, false);\n\t\t};\n\t}\n};\nfunction getGlobalOnlineManager() {\n\tif (!globalThis[kOnlineManager]) globalThis[kOnlineManager] = new WindowOnlineManager();\n\treturn globalThis[kOnlineManager];\n}\n//#endregion\nexport { getGlobalOnlineManager, kOnlineManager };\n","//#region src/client/parser.ts\nconst PROTO_POLLUTION_PATTERNS = {\n\tproto: /\"(?:_|\\\\u0{2}5[Ff]){2}(?:p|\\\\u0{2}70)(?:r|\\\\u0{2}72)(?:o|\\\\u0{2}6[Ff])(?:t|\\\\u0{2}74)(?:o|\\\\u0{2}6[Ff])(?:_|\\\\u0{2}5[Ff]){2}\"\\s*:/,\n\tconstructor: /\"(?:c|\\\\u0063)(?:o|\\\\u006[Ff])(?:n|\\\\u006[Ee])(?:s|\\\\u0073)(?:t|\\\\u0074)(?:r|\\\\u0072)(?:u|\\\\u0075)(?:c|\\\\u0063)(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:r|\\\\u0072)\"\\s*:/,\n\tprotoShort: /\"__proto__\"\\s*:/,\n\tconstructorShort: /\"constructor\"\\s*:/\n};\nconst JSON_SIGNATURE = /^\\s*[\"[{]|^\\s*-?\\d{1,16}(\\.\\d{1,17})?([Ee][+-]?\\d+)?\\s*$/;\nconst SPECIAL_VALUES = {\n\ttrue: true,\n\tfalse: false,\n\tnull: null,\n\tundefined: void 0,\n\tnan: NaN,\n\tinfinity: Number.POSITIVE_INFINITY,\n\t\"-infinity\": Number.NEGATIVE_INFINITY\n};\nconst ISO_DATE_REGEX = /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,7}))?(?:Z|([+-])(\\d{2}):(\\d{2}))$/;\nfunction isValidDate(date) {\n\treturn date instanceof Date && !isNaN(date.getTime());\n}\nfunction parseISODate(value) {\n\tconst match = ISO_DATE_REGEX.exec(value);\n\tif (!match) return null;\n\tconst [, year, month, day, hour, minute, second, ms, offsetSign, offsetHour, offsetMinute] = match;\n\tconst date = new Date(Date.UTC(parseInt(year, 10), parseInt(month, 10) - 1, parseInt(day, 10), parseInt(hour, 10), parseInt(minute, 10), parseInt(second, 10), ms ? parseInt(ms.padEnd(3, \"0\"), 10) : 0));\n\tif (offsetSign) {\n\t\tconst offset = (parseInt(offsetHour, 10) * 60 + parseInt(offsetMinute, 10)) * (offsetSign === \"+\" ? -1 : 1);\n\t\tdate.setUTCMinutes(date.getUTCMinutes() + offset);\n\t}\n\treturn isValidDate(date) ? date : null;\n}\nfunction betterJSONParse(value, options = {}) {\n\tconst { strict = false, warnings = false, reviver, parseDates = true } = options;\n\tif (typeof value !== \"string\") return value;\n\tconst trimmed = value.trim();\n\tif (trimmed.length > 0 && trimmed[0] === \"\\\"\" && trimmed.endsWith(\"\\\"\") && !trimmed.slice(1, -1).includes(\"\\\"\")) return trimmed.slice(1, -1);\n\tconst lowerValue = trimmed.toLowerCase();\n\tif (lowerValue.length <= 9 && lowerValue in SPECIAL_VALUES) return SPECIAL_VALUES[lowerValue];\n\tif (!JSON_SIGNATURE.test(trimmed)) {\n\t\tif (strict) throw new SyntaxError(\"[better-json] Invalid JSON\");\n\t\treturn value;\n\t}\n\tif (Object.entries(PROTO_POLLUTION_PATTERNS).some(([key, pattern]) => {\n\t\tconst matches = pattern.test(trimmed);\n\t\tif (matches && warnings) console.warn(`[better-json] Detected potential prototype pollution attempt using ${key} pattern`);\n\t\treturn matches;\n\t}) && strict) throw new Error(\"[better-json] Potential prototype pollution attempt detected\");\n\ttry {\n\t\tconst secureReviver = (key, value) => {\n\t\t\tif (key === \"__proto__\" || key === \"constructor\" && value && typeof value === \"object\" && \"prototype\" in value) {\n\t\t\t\tif (warnings) console.warn(`[better-json] Dropping \"${key}\" key to prevent prototype pollution`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (parseDates && typeof value === \"string\") {\n\t\t\t\tconst date = parseISODate(value);\n\t\t\t\tif (date) return date;\n\t\t\t}\n\t\t\treturn reviver ? reviver(key, value) : value;\n\t\t};\n\t\treturn JSON.parse(trimmed, secureReviver);\n\t} catch (error) {\n\t\tif (strict) throw error;\n\t\treturn value;\n\t}\n}\nfunction parseJSON(value, options = { strict: true }) {\n\treturn betterJSONParse(value, options);\n}\n//#endregion\nexport { parseJSON };\n","import { getGlobalBroadcastChannel } from \"./broadcast-channel.mjs\";\nimport { getGlobalFocusManager } from \"./focus-manager.mjs\";\nimport { getGlobalOnlineManager } from \"./online-manager.mjs\";\n//#region src/client/session-refresh.ts\nconst now = () => Math.floor(Date.now() / 1e3);\n/**\n* Normalize $fetch response: `throw: true` returns data directly, otherwise `{ data, error }`.\n*/\nfunction normalizeSessionResponse(res) {\n\tif (typeof res === \"object\" && res !== null && \"data\" in res && \"error\" in res) return res;\n\treturn {\n\t\tdata: res,\n\t\terror: null\n\t};\n}\n/**\n* Rate limit: don't refetch on focus if a session request was made within this many seconds\n*/\nconst FOCUS_REFETCH_RATE_LIMIT_SECONDS = 5;\nfunction createSessionRefreshManager(opts) {\n\tconst { sessionAtom, sessionSignal, $fetch, options = {} } = opts;\n\tconst refetchInterval = options.sessionOptions?.refetchInterval ?? 0;\n\tconst refetchOnWindowFocus = options.sessionOptions?.refetchOnWindowFocus ?? true;\n\tconst refetchWhenOffline = options.sessionOptions?.refetchWhenOffline ?? false;\n\tconst state = {\n\t\tlastSync: 0,\n\t\tlastSessionRequest: 0,\n\t\tcachedSession: void 0\n\t};\n\tconst shouldRefetch = () => {\n\t\treturn refetchWhenOffline || getGlobalOnlineManager().isOnline;\n\t};\n\tconst triggerRefetch = (event) => {\n\t\tif (!shouldRefetch()) return;\n\t\tif (event?.event === \"storage\") {\n\t\t\tstate.lastSync = now();\n\t\t\tsessionSignal.set(!sessionSignal.get());\n\t\t\treturn;\n\t\t}\n\t\tconst currentSession = sessionAtom.get();\n\t\tconst fetchSessionWithRefresh = () => {\n\t\t\tstate.lastSessionRequest = now();\n\t\t\t$fetch(\"/get-session\").then(async (res) => {\n\t\t\t\tlet { data, error } = normalizeSessionResponse(res);\n\t\t\t\tif (data?.needsRefresh) try {\n\t\t\t\t\tconst refreshRes = await $fetch(\"/get-session\", { method: \"POST\" });\n\t\t\t\t\t({data, error} = normalizeSessionResponse(refreshRes));\n\t\t\t\t} catch {}\n\t\t\t\tconst sessionData = data?.session && data?.user ? data : null;\n\t\t\t\tsessionAtom.set({\n\t\t\t\t\t...currentSession,\n\t\t\t\t\tdata: sessionData,\n\t\t\t\t\terror\n\t\t\t\t});\n\t\t\t\tstate.lastSync = now();\n\t\t\t\tsessionSignal.set(!sessionSignal.get());\n\t\t\t}).catch(() => {});\n\t\t};\n\t\tif (event?.event === \"poll\") {\n\t\t\tfetchSessionWithRefresh();\n\t\t\treturn;\n\t\t}\n\t\tif (event?.event === \"visibilitychange\") {\n\t\t\tif (now() - state.lastSessionRequest < FOCUS_REFETCH_RATE_LIMIT_SECONDS) return;\n\t\t\tstate.lastSessionRequest = now();\n\t\t}\n\t\tif (event?.event === \"visibilitychange\") {\n\t\t\tfetchSessionWithRefresh();\n\t\t\treturn;\n\t\t}\n\t\tif (currentSession?.data === null || currentSession?.data === void 0) {\n\t\t\tstate.lastSync = now();\n\t\t\tsessionSignal.set(!sessionSignal.get());\n\t\t}\n\t};\n\tconst broadcastSessionUpdate = (trigger) => {\n\t\tgetGlobalBroadcastChannel().post({\n\t\t\tevent: \"session\",\n\t\t\tdata: { trigger },\n\t\t\tclientId: Math.random().toString(36).substring(7)\n\t\t});\n\t};\n\tconst setupPolling = () => {\n\t\tif (refetchInterval && refetchInterval > 0) state.pollInterval = setInterval(() => {\n\t\t\tif (sessionAtom.get()?.data) triggerRefetch({ event: \"poll\" });\n\t\t}, refetchInterval * 1e3);\n\t};\n\tconst setupBroadcast = () => {\n\t\tstate.unsubscribeBroadcast = getGlobalBroadcastChannel().subscribe(() => {\n\t\t\ttriggerRefetch({ event: \"storage\" });\n\t\t});\n\t};\n\tconst setupFocusRefetch = () => {\n\t\tif (!refetchOnWindowFocus) return;\n\t\tstate.unsubscribeFocus = getGlobalFocusManager().subscribe(() => {\n\t\t\ttriggerRefetch({ event: \"visibilitychange\" });\n\t\t});\n\t};\n\tconst setupOnlineRefetch = () => {\n\t\tstate.unsubscribeOnline = getGlobalOnlineManager().subscribe((online) => {\n\t\t\tif (online) triggerRefetch({ event: \"visibilitychange\" });\n\t\t});\n\t};\n\tconst init = () => {\n\t\tsetupPolling();\n\t\tsetupBroadcast();\n\t\tsetupFocusRefetch();\n\t\tsetupOnlineRefetch();\n\t\tgetGlobalBroadcastChannel().setup();\n\t\tgetGlobalFocusManager().setup();\n\t\tgetGlobalOnlineManager().setup();\n\t};\n\tconst cleanup = () => {\n\t\tif (state.pollInterval) {\n\t\t\tclearInterval(state.pollInterval);\n\t\t\tstate.pollInterval = void 0;\n\t\t}\n\t\tif (state.unsubscribeBroadcast) {\n\t\t\tstate.unsubscribeBroadcast();\n\t\t\tstate.unsubscribeBroadcast = void 0;\n\t\t}\n\t\tif (state.unsubscribeFocus) {\n\t\t\tstate.unsubscribeFocus();\n\t\t\tstate.unsubscribeFocus = void 0;\n\t\t}\n\t\tif (state.unsubscribeOnline) {\n\t\t\tstate.unsubscribeOnline();\n\t\t\tstate.unsubscribeOnline = void 0;\n\t\t}\n\t\tstate.lastSync = 0;\n\t\tstate.lastSessionRequest = 0;\n\t\tstate.cachedSession = void 0;\n\t};\n\treturn {\n\t\tinit,\n\t\tcleanup,\n\t\ttriggerRefetch,\n\t\tbroadcastSessionUpdate\n\t};\n}\n//#endregion\nexport { createSessionRefreshManager };\n","//#region src/env/env-impl.ts\nconst _envShim = Object.create(null);\nconst _getEnv = (useShim) => globalThis.process?.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (useShim ? _envShim : globalThis);\nconst env = new Proxy(_envShim, {\n\tget(_, prop) {\n\t\treturn _getEnv()[prop] ?? _envShim[prop];\n\t},\n\thas(_, prop) {\n\t\treturn prop in _getEnv() || prop in _envShim;\n\t},\n\tset(_, prop, value) {\n\t\tconst env = _getEnv(true);\n\t\tenv[prop] = value;\n\t\treturn true;\n\t},\n\tdeleteProperty(_, prop) {\n\t\tif (!prop) return false;\n\t\tconst env = _getEnv(true);\n\t\tdelete env[prop];\n\t\treturn true;\n\t},\n\townKeys() {\n\t\tconst env = _getEnv(true);\n\t\treturn Object.keys(env);\n\t}\n});\nfunction toBoolean(val) {\n\treturn val ? val !== \"false\" : false;\n}\nconst nodeENV = typeof process !== \"undefined\" && process.env && process.env.NODE_ENV || \"\";\n/** Detect if `NODE_ENV` environment variable is `production` */\nconst isProduction = nodeENV === \"production\";\n/** Detect if `NODE_ENV` environment variable is `dev` or `development` */\nconst isDevelopment = () => nodeENV === \"dev\" || nodeENV === \"development\";\n/** Detect if `NODE_ENV` environment variable is `test` */\nconst isTest = () => nodeENV === \"test\" || toBoolean(env.TEST);\n/**\n* Get environment variable with fallback\n*/\nfunction getEnvVar(key, fallback) {\n\tif (typeof process !== \"undefined\" && process.env) return process.env[key] ?? fallback;\n\tif (typeof Deno !== \"undefined\") return Deno.env.get(key) ?? fallback;\n\tif (typeof Bun !== \"undefined\") return Bun.env[key] ?? fallback;\n\treturn fallback;\n}\n/**\n* Get boolean environment variable\n*/\nfunction getBooleanEnvVar(key, fallback = true) {\n\tconst value = getEnvVar(key);\n\tif (!value) return fallback;\n\treturn value !== \"0\" && value.toLowerCase() !== \"false\" && value !== \"\";\n}\n/**\n* Common environment variables used in Better Auth\n*/\nconst ENV = Object.freeze({\n\tget BETTER_AUTH_SECRET() {\n\t\treturn getEnvVar(\"BETTER_AUTH_SECRET\");\n\t},\n\tget AUTH_SECRET() {\n\t\treturn getEnvVar(\"AUTH_SECRET\");\n\t},\n\tget BETTER_AUTH_TELEMETRY() {\n\t\treturn getEnvVar(\"BETTER_AUTH_TELEMETRY\");\n\t},\n\tget BETTER_AUTH_TELEMETRY_ID() {\n\t\treturn getEnvVar(\"BETTER_AUTH_TELEMETRY_ID\");\n\t},\n\tget NODE_ENV() {\n\t\treturn getEnvVar(\"NODE_ENV\", \"development\");\n\t},\n\tget PACKAGE_VERSION() {\n\t\treturn getEnvVar(\"PACKAGE_VERSION\", \"0.0.0\");\n\t},\n\tget BETTER_AUTH_TELEMETRY_ENDPOINT() {\n\t\treturn getEnvVar(\"BETTER_AUTH_TELEMETRY_ENDPOINT\", \"\");\n\t}\n});\n//#endregion\nexport { ENV, env, getBooleanEnvVar, getEnvVar, isDevelopment, isProduction, isTest, nodeENV };\n","import { wildcardMatch } from \"./wildcard.mjs\";\nimport { env } from \"@better-auth/core/env\";\nimport { BetterAuthError } from \"@better-auth/core/error\";\n//#region src/utils/url.ts\n/**\n* Minimal loopback check for dev scheme inference only. Reachable from\n* `client/config.ts` via `getBaseURL`, so we MUST NOT import the full\n* `@better-auth/core/utils/host` classifier here: its `utils/ip` dependency\n* on zod would leak into the client bundle (see `e2e/smoke/test/vite.spec.ts`).\n*\n* Server-side SSRF/loopback checks (oauth redirect matching, trusted-origin\n* resolution, electron fetch gate) continue to use the authoritative\n* `isLoopbackHost` from `@better-auth/core/utils/host`. This helper's only\n* job is picking `http` vs `https` for dev ergonomics.\n*/\nfunction isLoopbackForDevScheme(host) {\n\tconst hostname = host.replace(/:\\d+$/, \"\").replace(/^\\[|\\]$/g, \"\").toLowerCase();\n\treturn hostname === \"localhost\" || hostname.endsWith(\".localhost\") || hostname === \"::1\" || hostname.startsWith(\"127.\");\n}\nfunction checkHasPath(url) {\n\ttry {\n\t\treturn (new URL(url).pathname.replace(/\\/+$/, \"\") || \"/\") !== \"/\";\n\t} catch {\n\t\tthrow new BetterAuthError(`Invalid base URL: ${url}. Please provide a valid base URL.`);\n\t}\n}\nfunction assertHasProtocol(url) {\n\ttry {\n\t\tconst parsedUrl = new URL(url);\n\t\tif (parsedUrl.protocol !== \"http:\" && parsedUrl.protocol !== \"https:\") throw new BetterAuthError(`Invalid base URL: ${url}. URL must include 'http://' or 'https://'`);\n\t} catch (error) {\n\t\tif (error instanceof BetterAuthError) throw error;\n\t\tthrow new BetterAuthError(`Invalid base URL: ${url}. Please provide a valid base URL.`, { cause: error });\n\t}\n}\nfunction withPath(url, path = \"/api/auth\") {\n\tassertHasProtocol(url);\n\tif (checkHasPath(url)) return url;\n\tconst trimmedUrl = url.replace(/\\/+$/, \"\");\n\tif (!path || path === \"/\") return trimmedUrl;\n\tpath = path.startsWith(\"/\") ? path : `/${path}`;\n\treturn `${trimmedUrl}${path}`;\n}\nfunction validateProxyHeader(header, type) {\n\tif (!header || header.trim() === \"\") return false;\n\tif (type === \"proto\") return header === \"http\" || header === \"https\";\n\tif (type === \"host\") {\n\t\tif ([\n\t\t\t/\\.\\./,\n\t\t\t/\\0/,\n\t\t\t/[\\s]/,\n\t\t\t/^[.]/,\n\t\t\t/[<>'\"]/,\n\t\t\t/javascript:/i,\n\t\t\t/file:/i,\n\t\t\t/data:/i\n\t\t].some((pattern) => pattern.test(header))) return false;\n\t\treturn /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(header) || /^(\\d{1,3}\\.){3}\\d{1,3}(:[0-9]{1,5})?$/.test(header) || /^\\[[0-9a-fA-F:]+\\](:[0-9]{1,5})?$/.test(header) || /^localhost(:[0-9]{1,5})?$/i.test(header);\n\t}\n\treturn false;\n}\nfunction getBaseURL(url, path, request, loadEnv, trustedProxyHeaders) {\n\tif (url) return withPath(url, path);\n\tif (loadEnv !== false) {\n\t\tconst fromEnv = env.BETTER_AUTH_URL || env.NEXT_PUBLIC_BETTER_AUTH_URL || env.PUBLIC_BETTER_AUTH_URL || env.NUXT_PUBLIC_BETTER_AUTH_URL || env.NUXT_PUBLIC_AUTH_URL || (env.BASE_URL !== \"/\" ? env.BASE_URL : void 0);\n\t\tif (fromEnv) return withPath(fromEnv, path);\n\t}\n\tconst fromRequest = request?.headers.get(\"x-forwarded-host\");\n\tconst fromRequestProto = request?.headers.get(\"x-forwarded-proto\");\n\tif (fromRequest && fromRequestProto && trustedProxyHeaders) {\n\t\tif (validateProxyHeader(fromRequestProto, \"proto\") && validateProxyHeader(fromRequest, \"host\")) try {\n\t\t\treturn withPath(`${fromRequestProto}://${fromRequest}`, path);\n\t\t} catch (_error) {}\n\t}\n\tif (request) {\n\t\tconst url = getOrigin(request.url);\n\t\tif (!url) throw new BetterAuthError(\"Could not get origin from request. Please provide a valid base URL.\");\n\t\treturn withPath(url, path);\n\t}\n\tif (typeof window !== \"undefined\" && window.location) return withPath(window.location.origin, path);\n}\nfunction getOrigin(url) {\n\ttry {\n\t\tconst parsedUrl = new URL(url);\n\t\treturn parsedUrl.origin === \"null\" ? null : parsedUrl.origin;\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction getProtocol(url) {\n\ttry {\n\t\treturn new URL(url).protocol;\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction getHost(url) {\n\ttry {\n\t\treturn new URL(url).host;\n\t} catch {\n\t\treturn null;\n\t}\n}\n/**\n* Checks if the baseURL config is a dynamic config object\n*/\nfunction isDynamicBaseURLConfig(config) {\n\treturn typeof config === \"object\" && config !== null && \"allowedHosts\" in config && Array.isArray(config.allowedHosts);\n}\n/**\n* Check if a value is a `Request`\n* - `instanceof`: works for native Request instances\n* - `toString`: handles where instanceof check fails but the object is still a\n* valid Request (e.g. cross-realm, polyfills). Paired with a shape check so\n* an object that only spoofs `Symbol.toStringTag` without the real shape is\n* rejected before downstream code tries to read `.headers` / `.url`.\n*\n* @param value The value to check\n* @returns `true` if the value is a Request instance\n*/\nfunction isRequestLike(value) {\n\tif (value instanceof Request) return true;\n\tif (typeof value !== \"object\" || value === null || Object.prototype.toString.call(value) !== \"[object Request]\") return false;\n\tconst v = value;\n\treturn typeof v.url === \"string\" && typeof v.headers === \"object\" && v.headers !== null && typeof v.headers.get === \"function\";\n}\n/**\n* Extracts the host from a `Request` or `Headers`.\n* Honors `x-forwarded-host` only when `trustedProxyHeaders` is enabled,\n* then falls back to the `host` header and finally the request URL.\n*/\nfunction getHostFromSource(source, trustedProxyHeaders) {\n\tconst headers = isRequestLike(source) ? source.headers : source;\n\tif (trustedProxyHeaders) {\n\t\tconst forwardedHost = headers.get(\"x-forwarded-host\");\n\t\tif (forwardedHost && validateProxyHeader(forwardedHost, \"host\")) return forwardedHost;\n\t}\n\tconst host = headers.get(\"host\");\n\tif (host && validateProxyHeader(host, \"host\")) return host;\n\tif (isRequestLike(source)) try {\n\t\treturn new URL(source.url).host;\n\t} catch {\n\t\treturn null;\n\t}\n\treturn null;\n}\n/**\n* Extracts the protocol from a `Request` or `Headers`.\n* Honors `x-forwarded-proto` only when `trustedProxyHeaders` is enabled,\n* then falls back to the request URL, then to \"https\".\n*/\nfunction getProtocolFromSource(source, configProtocol, trustedProxyHeaders) {\n\tif (configProtocol === \"http\" || configProtocol === \"https\") return configProtocol;\n\tconst headers = isRequestLike(source) ? source.headers : source;\n\tif (trustedProxyHeaders) {\n\t\tconst forwardedProto = headers.get(\"x-forwarded-proto\");\n\t\tif (forwardedProto && validateProxyHeader(forwardedProto, \"proto\")) return forwardedProto;\n\t}\n\tif (isRequestLike(source)) try {\n\t\tconst url = new URL(source.url);\n\t\tif (url.protocol === \"http:\" || url.protocol === \"https:\") return url.protocol.slice(0, -1);\n\t} catch {}\n\tconst host = getHostFromSource(source, trustedProxyHeaders);\n\tif (host && isLoopbackForDevScheme(host)) return \"http\";\n\treturn \"https\";\n}\n/**\n* Matches a hostname against a host pattern.\n* Supports wildcard patterns like `*.vercel.app` or `preview-*.myapp.com`.\n*\n* @param host The hostname to test (e.g., \"myapp.com\", \"preview-123.vercel.app\")\n* @param pattern The host pattern (e.g., \"myapp.com\", \"*.vercel.app\")\n* @returns {boolean} true if the host matches the pattern, false otherwise.\n*\n* @example\n* ```ts\n* matchesHostPattern(\"myapp.com\", \"myapp.com\") // true\n* matchesHostPattern(\"preview-123.vercel.app\", \"*.vercel.app\") // true\n* matchesHostPattern(\"preview-123.myapp.com\", \"preview-*.myapp.com\") // true\n* matchesHostPattern(\"evil.com\", \"myapp.com\") // false\n* ```\n*/\nconst matchesHostPattern = (host, pattern) => {\n\tif (!host || !pattern) return false;\n\tconst normalizedHost = host.replace(/^https?:\\/\\//, \"\").split(\"/\")[0].toLowerCase();\n\tconst normalizedPattern = pattern.replace(/^https?:\\/\\//, \"\").split(\"/\")[0].toLowerCase();\n\tif (normalizedPattern.includes(\"*\") || normalizedPattern.includes(\"?\")) return wildcardMatch(normalizedPattern)(normalizedHost);\n\treturn normalizedHost.toLowerCase() === normalizedPattern.toLowerCase();\n};\n/**\n* Resolves the base URL from a dynamic config based on the incoming request.\n* Validates the derived host against the allowedHosts allowlist.\n*\n* @param config The dynamic base URL config\n* @param request The incoming request\n* @param basePath The base path to append\n* @returns The resolved base URL with path\n* @throws BetterAuthError if host is not in allowedHosts and no fallback is set\n*/\nfunction resolveDynamicBaseURL(config, source, basePath, trustedProxyHeaders) {\n\tconst host = getHostFromSource(source, trustedProxyHeaders);\n\tif (!host) {\n\t\tif (config.fallback) return withPath(config.fallback, basePath);\n\t\tthrow new BetterAuthError(\"Could not determine host from request headers. Please provide a fallback URL in your baseURL config.\");\n\t}\n\tif (config.allowedHosts.some((pattern) => matchesHostPattern(host, pattern))) return withPath(`${getProtocolFromSource(source, config.protocol, trustedProxyHeaders)}://${host}`, basePath);\n\tif (config.fallback) return withPath(config.fallback, basePath);\n\tthrow new BetterAuthError(`Host \"${host}\" is not in the allowed hosts list. Allowed hosts: ${config.allowedHosts.join(\", \")}. Add this host to your allowedHosts config or provide a fallback URL.`);\n}\n/**\n* Resolves the base URL from any config type (static string or dynamic object).\n* This is the main entry point for base URL resolution.\n*\n* @param config The base URL config (string or object)\n* @param basePath The base path to append\n* @param request Optional request for dynamic resolution\n* @param loadEnv Whether to load from environment variables\n* @param trustedProxyHeaders Whether to trust proxy headers (for legacy behavior)\n* @returns The resolved base URL with path\n*/\nfunction resolveBaseURL(config, basePath, source, loadEnv, trustedProxyHeaders) {\n\tif (isDynamicBaseURLConfig(config)) {\n\t\tif (source) return resolveDynamicBaseURL(config, source, basePath, trustedProxyHeaders);\n\t\tif (config.fallback) return withPath(config.fallback, basePath);\n\t\treturn getBaseURL(void 0, basePath, void 0, loadEnv, trustedProxyHeaders);\n\t}\n\tconst request = isRequestLike(source) ? source : void 0;\n\tif (typeof config === \"string\") return getBaseURL(config, basePath, request, loadEnv, trustedProxyHeaders);\n\treturn getBaseURL(void 0, basePath, request, loadEnv, trustedProxyHeaders);\n}\n//#endregion\nexport { getBaseURL, getHost, getHostFromSource, getOrigin, getProtocol, getProtocolFromSource, isDynamicBaseURLConfig, isRequestLike, matchesHostPattern, resolveBaseURL, resolveDynamicBaseURL };\n","//#region src/client/fetch-plugins.ts\nconst redirectPlugin = {\n\tid: \"redirect\",\n\tname: \"Redirect\",\n\thooks: { onSuccess(context) {\n\t\tif (context.data?.url && context.data?.redirect) {\n\t\t\tif (typeof window !== \"undefined\" && window.location) {\n\t\t\t\tif (window.location) try {\n\t\t\t\t\twindow.location.href = context.data.url;\n\t\t\t\t} catch {}\n\t\t\t}\n\t\t}\n\t} }\n};\n//#endregion\nexport { redirectPlugin };\n","import { useAuthQuery } from \"./query.mjs\";\nimport { createSessionRefreshManager } from \"./session-refresh.mjs\";\nimport { atom, onMount } from \"nanostores\";\n//#region src/client/session-atom.ts\nfunction getSessionAtom($fetch, options) {\n\tconst $signal = atom(false);\n\tconst session = useAuthQuery($signal, \"/get-session\", $fetch, { method: \"GET\" });\n\tlet broadcastSessionUpdate = () => {};\n\tonMount(session, () => {\n\t\tconst refreshManager = createSessionRefreshManager({\n\t\t\tsessionAtom: session,\n\t\t\tsessionSignal: $signal,\n\t\t\t$fetch,\n\t\t\toptions\n\t\t});\n\t\trefreshManager.init();\n\t\tbroadcastSessionUpdate = refreshManager.broadcastSessionUpdate;\n\t\treturn () => {\n\t\t\trefreshManager.cleanup();\n\t\t};\n\t});\n\treturn {\n\t\tsession,\n\t\t$sessionSignal: $signal,\n\t\tbroadcastSessionUpdate: (trigger) => broadcastSessionUpdate(trigger)\n\t};\n}\n//#endregion\nexport { getSessionAtom };\n","function isPlainObject(value) {\n if (value === null || typeof value !== \"object\") {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {\n return false;\n }\n if (Symbol.iterator in value) {\n return false;\n }\n if (Symbol.toStringTag in value) {\n return Object.prototype.toString.call(value) === \"[object Module]\";\n }\n return true;\n}\n\nfunction _defu(baseObject, defaults, namespace = \".\", merger) {\n if (!isPlainObject(defaults)) {\n return _defu(baseObject, {}, namespace, merger);\n }\n const object = { ...defaults };\n for (const key of Object.keys(baseObject)) {\n if (key === \"__proto__\" || key === \"constructor\") {\n continue;\n }\n const value = baseObject[key];\n if (value === null || value === void 0) {\n continue;\n }\n if (merger && merger(object, key, value, namespace)) {\n continue;\n }\n if (Array.isArray(value) && Array.isArray(object[key])) {\n object[key] = [...value, ...object[key]];\n } else if (isPlainObject(value) && isPlainObject(object[key])) {\n object[key] = _defu(\n value,\n object[key],\n (namespace ? `${namespace}.` : \"\") + key.toString(),\n merger\n );\n } else {\n object[key] = value;\n }\n }\n return object;\n}\nfunction createDefu(merger) {\n return (...arguments_) => (\n // eslint-disable-next-line unicorn/no-array-reduce\n arguments_.reduce((p, c) => _defu(p, c, \"\", merger), {})\n );\n}\nconst defu = createDefu();\nconst defuFn = createDefu((object, key, currentValue) => {\n if (object[key] !== void 0 && typeof currentValue === \"function\") {\n object[key] = currentValue(object[key]);\n return true;\n }\n});\nconst defuArrayFn = createDefu((object, key, currentValue) => {\n if (Array.isArray(object[key]) && typeof currentValue === \"function\") {\n object[key] = currentValue(object[key]);\n return true;\n }\n});\n\nexport { createDefu, defu as default, defu, defuArrayFn, defuFn };\n","var __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\n\n// src/error.ts\nvar BetterFetchError = class extends Error {\n constructor(status, statusText, error) {\n super(statusText || status.toString(), {\n cause: error\n });\n this.status = status;\n this.statusText = statusText;\n this.error = error;\n Error.captureStackTrace(this, this.constructor);\n }\n};\n\n// src/plugins.ts\nvar initializePlugins = async (url, options) => {\n var _a, _b, _c, _d, _e, _f;\n let opts = options || {};\n const hooks = {\n onRequest: [options == null ? void 0 : options.onRequest],\n onResponse: [options == null ? void 0 : options.onResponse],\n onSuccess: [options == null ? void 0 : options.onSuccess],\n onError: [options == null ? void 0 : options.onError],\n onRetry: [options == null ? void 0 : options.onRetry]\n };\n if (!options || !(options == null ? void 0 : options.plugins)) {\n return {\n url,\n options: opts,\n hooks\n };\n }\n for (const plugin of (options == null ? void 0 : options.plugins) || []) {\n if (plugin.init) {\n const pluginRes = await ((_a = plugin.init) == null ? void 0 : _a.call(plugin, url.toString(), options));\n opts = pluginRes.options || opts;\n url = pluginRes.url;\n }\n hooks.onRequest.push((_b = plugin.hooks) == null ? void 0 : _b.onRequest);\n hooks.onResponse.push((_c = plugin.hooks) == null ? void 0 : _c.onResponse);\n hooks.onSuccess.push((_d = plugin.hooks) == null ? void 0 : _d.onSuccess);\n hooks.onError.push((_e = plugin.hooks) == null ? void 0 : _e.onError);\n hooks.onRetry.push((_f = plugin.hooks) == null ? void 0 : _f.onRetry);\n }\n return {\n url,\n options: opts,\n hooks\n };\n};\n\n// src/retry.ts\nvar LinearRetryStrategy = class {\n constructor(options) {\n this.options = options;\n }\n shouldAttemptRetry(attempt, response) {\n if (this.options.shouldRetry) {\n return Promise.resolve(\n attempt < this.options.attempts && this.options.shouldRetry(response)\n );\n }\n return Promise.resolve(attempt < this.options.attempts);\n }\n getDelay() {\n return this.options.delay;\n }\n};\nvar ExponentialRetryStrategy = class {\n constructor(options) {\n this.options = options;\n }\n shouldAttemptRetry(attempt, response) {\n if (this.options.shouldRetry) {\n return Promise.resolve(\n attempt < this.options.attempts && this.options.shouldRetry(response)\n );\n }\n return Promise.resolve(attempt < this.options.attempts);\n }\n getDelay(attempt) {\n const delay = Math.min(\n this.options.maxDelay,\n this.options.baseDelay * 2 ** attempt\n );\n return delay;\n }\n};\nfunction createRetryStrategy(options) {\n if (typeof options === \"number\") {\n return new LinearRetryStrategy({\n type: \"linear\",\n attempts: options,\n delay: 1e3\n });\n }\n switch (options.type) {\n case \"linear\":\n return new LinearRetryStrategy(options);\n case \"exponential\":\n return new ExponentialRetryStrategy(options);\n default:\n throw new Error(\"Invalid retry strategy\");\n }\n}\n\n// src/auth.ts\nvar getAuthHeader = async (options) => {\n const headers = {};\n const getValue = async (value) => typeof value === \"function\" ? await value() : value;\n if (options == null ? void 0 : options.auth) {\n if (options.auth.type === \"Bearer\") {\n const token = await getValue(options.auth.token);\n if (!token) {\n return headers;\n }\n headers[\"authorization\"] = `Bearer ${token}`;\n } else if (options.auth.type === \"Basic\") {\n const [username, password] = await Promise.all([\n getValue(options.auth.username),\n getValue(options.auth.password)\n ]);\n if (!username || !password) {\n return headers;\n }\n headers[\"authorization\"] = `Basic ${btoa(`${username}:${password}`)}`;\n } else if (options.auth.type === \"Custom\") {\n const [prefix, value] = await Promise.all([\n getValue(options.auth.prefix),\n getValue(options.auth.value)\n ]);\n if (!value) {\n return headers;\n }\n headers[\"authorization\"] = `${prefix != null ? prefix : \"\"} ${value}`;\n }\n }\n return headers;\n};\n\n// src/utils.ts\nvar JSON_RE = /^application\\/(?:[\\w!#$%&*.^`~-]*\\+)?json(;.+)?$/i;\nfunction detectResponseType(request) {\n const _contentType = request.headers.get(\"content-type\");\n const textTypes = /* @__PURE__ */ new Set([\n \"image/svg\",\n \"application/xml\",\n \"application/xhtml\",\n \"application/html\"\n ]);\n if (!_contentType) {\n return \"json\";\n }\n const contentType = _contentType.split(\";\").shift() || \"\";\n if (JSON_RE.test(contentType)) {\n return \"json\";\n }\n if (textTypes.has(contentType) || contentType.startsWith(\"text/\")) {\n return \"text\";\n }\n return \"blob\";\n}\nfunction isJSONParsable(value) {\n try {\n JSON.parse(value);\n return true;\n } catch (error) {\n return false;\n }\n}\nfunction isJSONSerializable(value) {\n if (value === void 0) {\n return false;\n }\n const t = typeof value;\n if (t === \"string\" || t === \"number\" || t === \"boolean\" || t === null) {\n return true;\n }\n if (t !== \"object\") {\n return false;\n }\n if (Array.isArray(value)) {\n return true;\n }\n if (value.buffer) {\n return false;\n }\n return value.constructor && value.constructor.name === \"Object\" || typeof value.toJSON === \"function\";\n}\nfunction jsonParse(text) {\n try {\n return JSON.parse(text);\n } catch (error) {\n return text;\n }\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\nfunction getFetch(options) {\n if (options == null ? void 0 : options.customFetchImpl) {\n return options.customFetchImpl;\n }\n if (typeof globalThis !== \"undefined\" && isFunction(globalThis.fetch)) {\n return globalThis.fetch;\n }\n if (typeof window !== \"undefined\" && isFunction(window.fetch)) {\n return window.fetch;\n }\n throw new Error(\"No fetch implementation found\");\n}\nfunction isPayloadMethod(method) {\n if (!method) {\n return false;\n }\n const payloadMethod = [\"POST\", \"PUT\", \"PATCH\", \"DELETE\"];\n return payloadMethod.includes(method.toUpperCase());\n}\nfunction isRouteMethod(method) {\n const routeMethod = [\"GET\", \"POST\", \"PUT\", \"PATCH\", \"DELETE\"];\n if (!method) {\n return false;\n }\n return routeMethod.includes(method.toUpperCase());\n}\nasync function getHeaders(opts) {\n const headers = new Headers(opts == null ? void 0 : opts.headers);\n const authHeader = await getAuthHeader(opts);\n for (const [key, value] of Object.entries(authHeader || {})) {\n headers.set(key, value);\n }\n if (!headers.has(\"content-type\")) {\n const t = detectContentType(opts == null ? void 0 : opts.body);\n if (t) {\n headers.set(\"content-type\", t);\n }\n }\n return headers;\n}\nfunction getURL(url, options) {\n if (url.startsWith(\"@\")) {\n const m = url.toString().split(\"@\")[1].split(\"/\")[0];\n if (methods.includes(m)) {\n url = url.replace(`@${m}/`, \"/\");\n }\n }\n let _url;\n try {\n if (url.startsWith(\"http\")) {\n _url = url;\n } else {\n let baseURL = options == null ? void 0 : options.baseURL;\n if (baseURL && !(baseURL == null ? void 0 : baseURL.endsWith(\"/\"))) {\n baseURL = baseURL + \"/\";\n }\n if (url.startsWith(\"/\")) {\n _url = new URL(url.substring(1), baseURL);\n } else {\n _url = new URL(url, options == null ? void 0 : options.baseURL);\n }\n }\n } catch (e) {\n if (e instanceof TypeError) {\n if (!(options == null ? void 0 : options.baseURL)) {\n throw TypeError(\n `Invalid URL ${url}. Are you passing in a relative url but not setting the baseURL?`\n );\n }\n throw TypeError(\n `Invalid URL ${url}. Please validate that you are passing the correct input.`\n );\n }\n throw e;\n }\n if (options == null ? void 0 : options.params) {\n if (Array.isArray(options == null ? void 0 : options.params)) {\n const params = (options == null ? void 0 : options.params) ? Array.isArray(options.params) ? `/${options.params.join(\"/\")}` : `/${Object.values(options.params).join(\"/\")}` : \"\";\n _url = _url.toString().split(\"/:\")[0];\n _url = `${_url.toString()}${params}`;\n } else {\n for (const [key, value] of Object.entries(options == null ? void 0 : options.params)) {\n _url = _url.toString().replace(`:${key}`, String(value));\n }\n }\n }\n const __url = new URL(_url);\n const queryParams = options == null ? void 0 : options.query;\n if (queryParams) {\n for (const [key, value] of Object.entries(queryParams)) {\n __url.searchParams.append(key, String(value));\n }\n }\n return __url;\n}\nfunction detectContentType(body) {\n if (isJSONSerializable(body)) {\n return \"application/json\";\n }\n return null;\n}\nfunction getBody(options) {\n if (!(options == null ? void 0 : options.body)) {\n return null;\n }\n const headers = new Headers(options == null ? void 0 : options.headers);\n if (isJSONSerializable(options.body) && !headers.has(\"content-type\")) {\n for (const [key, value] of Object.entries(options == null ? void 0 : options.body)) {\n if (value instanceof Date) {\n options.body[key] = value.toISOString();\n }\n }\n return JSON.stringify(options.body);\n }\n if (headers.has(\"content-type\") && headers.get(\"content-type\") === \"application/x-www-form-urlencoded\") {\n if (isJSONSerializable(options.body)) {\n return new URLSearchParams(options.body).toString();\n }\n return options.body;\n }\n return options.body;\n}\nfunction getMethod(url, options) {\n var _a;\n if (options == null ? void 0 : options.method) {\n return options.method.toUpperCase();\n }\n if (url.startsWith(\"@\")) {\n const pMethod = (_a = url.split(\"@\")[1]) == null ? void 0 : _a.split(\"/\")[0];\n if (!methods.includes(pMethod)) {\n return (options == null ? void 0 : options.body) ? \"POST\" : \"GET\";\n }\n return pMethod.toUpperCase();\n }\n return (options == null ? void 0 : options.body) ? \"POST\" : \"GET\";\n}\nfunction getTimeout(options, controller) {\n let abortTimeout;\n if (!(options == null ? void 0 : options.signal) && (options == null ? void 0 : options.timeout)) {\n abortTimeout = setTimeout(() => controller == null ? void 0 : controller.abort(), options == null ? void 0 : options.timeout);\n }\n return {\n abortTimeout,\n clearTimeout: () => {\n if (abortTimeout) {\n clearTimeout(abortTimeout);\n }\n }\n };\n}\nfunction bodyParser(data, responseType) {\n if (responseType === \"json\") {\n return JSON.parse(data);\n }\n return data;\n}\nvar ValidationError = class _ValidationError extends Error {\n constructor(issues, message) {\n super(message || JSON.stringify(issues, null, 2));\n this.issues = issues;\n Object.setPrototypeOf(this, _ValidationError.prototype);\n }\n};\nasync function parseStandardSchema(schema, input) {\n const result = await schema[\"~standard\"].validate(input);\n if (result.issues) {\n throw new ValidationError(result.issues);\n }\n return result.value;\n}\n\n// src/create-fetch/schema.ts\nvar methods = [\"get\", \"post\", \"put\", \"patch\", \"delete\"];\nvar createSchema = (schema, config) => {\n return {\n schema,\n config\n };\n};\n\n// src/create-fetch/index.ts\nvar applySchemaPlugin = (config) => ({\n id: \"apply-schema\",\n name: \"Apply Schema\",\n version: \"1.0.0\",\n async init(url, options) {\n var _a, _b, _c, _d;\n const schema = ((_b = (_a = config.plugins) == null ? void 0 : _a.find(\n (plugin) => {\n var _a2;\n return ((_a2 = plugin.schema) == null ? void 0 : _a2.config) ? url.startsWith(plugin.schema.config.baseURL || \"\") || url.startsWith(plugin.schema.config.prefix || \"\") : false;\n }\n )) == null ? void 0 : _b.schema) || config.schema;\n if (schema) {\n let urlKey = url;\n if ((_c = schema.config) == null ? void 0 : _c.prefix) {\n if (urlKey.startsWith(schema.config.prefix)) {\n urlKey = urlKey.replace(schema.config.prefix, \"\");\n if (schema.config.baseURL) {\n url = url.replace(schema.config.prefix, schema.config.baseURL);\n }\n }\n }\n if ((_d = schema.config) == null ? void 0 : _d.baseURL) {\n if (urlKey.startsWith(schema.config.baseURL)) {\n urlKey = urlKey.replace(schema.config.baseURL, \"\");\n }\n }\n const keySchema = schema.schema[urlKey];\n if (keySchema) {\n let opts = __spreadProps(__spreadValues({}, options), {\n method: keySchema.method,\n output: keySchema.output\n });\n if (!(options == null ? void 0 : options.disableValidation)) {\n opts = __spreadProps(__spreadValues({}, opts), {\n body: keySchema.input ? await parseStandardSchema(keySchema.input, options == null ? void 0 : options.body) : options == null ? void 0 : options.body,\n params: keySchema.params ? await parseStandardSchema(keySchema.params, options == null ? void 0 : options.params) : options == null ? void 0 : options.params,\n query: keySchema.query ? await parseStandardSchema(keySchema.query, options == null ? void 0 : options.query) : options == null ? void 0 : options.query\n });\n }\n return {\n url,\n options: opts\n };\n }\n }\n return {\n url,\n options\n };\n }\n});\nvar createFetch = (config) => {\n async function $fetch(url, options) {\n const opts = __spreadProps(__spreadValues(__spreadValues({}, config), options), {\n plugins: [...(config == null ? void 0 : config.plugins) || [], applySchemaPlugin(config || {}), ...(options == null ? void 0 : options.plugins) || []]\n });\n if (config == null ? void 0 : config.catchAllError) {\n try {\n return await betterFetch(url, opts);\n } catch (error) {\n return {\n data: null,\n error: {\n status: 500,\n statusText: \"Fetch Error\",\n message: \"Fetch related error. Captured by catchAllError option. See error property for more details.\",\n error\n }\n };\n }\n }\n return await betterFetch(url, opts);\n }\n return $fetch;\n};\n\n// src/url.ts\nfunction getURL2(url, option) {\n const { baseURL, params, query } = option || {\n query: {},\n params: {},\n baseURL: \"\"\n };\n let basePath = url.startsWith(\"http\") ? url.split(\"/\").slice(0, 3).join(\"/\") : baseURL || \"\";\n if (url.startsWith(\"@\")) {\n const m = url.toString().split(\"@\")[1].split(\"/\")[0];\n if (methods.includes(m)) {\n url = url.replace(`@${m}/`, \"/\");\n }\n }\n if (!basePath.endsWith(\"/\")) basePath += \"/\";\n let [path, urlQuery] = url.replace(basePath, \"\").split(\"?\");\n const queryParams = new URLSearchParams(urlQuery);\n for (const [key, value] of Object.entries(query || {})) {\n if (value == null) continue;\n let serializedValue;\n if (typeof value === \"string\") {\n serializedValue = value;\n } else if (Array.isArray(value)) {\n for (const val of value) {\n queryParams.append(key, val);\n }\n continue;\n } else {\n serializedValue = JSON.stringify(value);\n }\n queryParams.set(key, serializedValue);\n }\n if (params) {\n if (Array.isArray(params)) {\n const paramPaths = path.split(\"/\").filter((p) => p.startsWith(\":\"));\n for (const [index, key] of paramPaths.entries()) {\n const value = params[index];\n path = path.replace(key, value);\n }\n } else {\n for (const [key, value] of Object.entries(params)) {\n path = path.replace(`:${key}`, String(value));\n }\n }\n }\n path = path.split(\"/\").map(encodeURIComponent).join(\"/\");\n if (path.startsWith(\"/\")) path = path.slice(1);\n let queryParamString = queryParams.toString();\n queryParamString = queryParamString.length > 0 ? `?${queryParamString}`.replace(/\\+/g, \"%20\") : \"\";\n if (!basePath.startsWith(\"http\")) {\n return `${basePath}${path}${queryParamString}`;\n }\n const _url = new URL(`${path}${queryParamString}`, basePath);\n return _url;\n}\n\n// src/fetch.ts\nvar betterFetch = async (url, options) => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n const {\n hooks,\n url: __url,\n options: opts\n } = await initializePlugins(url, options);\n const fetch = getFetch(opts);\n const controller = new AbortController();\n const signal = (_a = opts.signal) != null ? _a : controller.signal;\n const _url = getURL2(__url, opts);\n const body = getBody(opts);\n const headers = await getHeaders(opts);\n const method = getMethod(__url, opts);\n let context = __spreadProps(__spreadValues({}, opts), {\n url: _url,\n headers,\n body,\n method,\n signal\n });\n for (const onRequest of hooks.onRequest) {\n if (onRequest) {\n const res = await onRequest(context);\n if (typeof res === \"object\" && res !== null) {\n context = res;\n }\n }\n }\n if (\"pipeTo\" in context && typeof context.pipeTo === \"function\" || typeof ((_b = options == null ? void 0 : options.body) == null ? void 0 : _b.pipe) === \"function\") {\n if (!(\"duplex\" in context)) {\n context.duplex = \"half\";\n }\n }\n const { clearTimeout: clearTimeout2 } = getTimeout(opts, controller);\n let response = await fetch(context.url, context);\n clearTimeout2();\n const responseContext = {\n response,\n request: context\n };\n for (const onResponse of hooks.onResponse) {\n if (onResponse) {\n const r = await onResponse(__spreadProps(__spreadValues({}, responseContext), {\n response: ((_c = options == null ? void 0 : options.hookOptions) == null ? void 0 : _c.cloneResponse) ? response.clone() : response\n }));\n if (r instanceof Response) {\n response = r;\n } else if (typeof r === \"object\" && r !== null) {\n response = r.response;\n }\n }\n }\n if (response.ok) {\n const hasBody = context.method !== \"HEAD\";\n if (!hasBody) {\n return {\n data: \"\",\n error: null\n };\n }\n const responseType = detectResponseType(response);\n const successContext = {\n data: null,\n response,\n request: context\n };\n if (responseType === \"json\" || responseType === \"text\") {\n const text = await response.text();\n const parser2 = (_d = context.jsonParser) != null ? _d : jsonParse;\n successContext.data = await parser2(text);\n } else {\n successContext.data = await response[responseType]();\n }\n if (context == null ? void 0 : context.output) {\n if (context.output && !context.disableValidation) {\n successContext.data = await parseStandardSchema(\n context.output,\n successContext.data\n );\n }\n }\n for (const onSuccess of hooks.onSuccess) {\n if (onSuccess) {\n await onSuccess(__spreadProps(__spreadValues({}, successContext), {\n response: ((_e = options == null ? void 0 : options.hookOptions) == null ? void 0 : _e.cloneResponse) ? response.clone() : response\n }));\n }\n }\n if (options == null ? void 0 : options.throw) {\n return successContext.data;\n }\n return {\n data: successContext.data,\n error: null\n };\n }\n const parser = (_f = options == null ? void 0 : options.jsonParser) != null ? _f : jsonParse;\n const responseText = await response.text();\n const isJSONResponse = isJSONParsable(responseText);\n const errorObject = isJSONResponse ? await parser(responseText) : null;\n const errorContext = {\n response,\n responseText,\n request: context,\n error: __spreadProps(__spreadValues({}, errorObject), {\n status: response.status,\n statusText: response.statusText\n })\n };\n for (const onError of hooks.onError) {\n if (onError) {\n await onError(__spreadProps(__spreadValues({}, errorContext), {\n response: ((_g = options == null ? void 0 : options.hookOptions) == null ? void 0 : _g.cloneResponse) ? response.clone() : response\n }));\n }\n }\n if (options == null ? void 0 : options.retry) {\n const retryStrategy = createRetryStrategy(options.retry);\n const _retryAttempt = (_h = options.retryAttempt) != null ? _h : 0;\n if (await retryStrategy.shouldAttemptRetry(_retryAttempt, response)) {\n for (const onRetry of hooks.onRetry) {\n if (onRetry) {\n await onRetry(responseContext);\n }\n }\n const delay = retryStrategy.getDelay(_retryAttempt);\n await new Promise((resolve) => setTimeout(resolve, delay));\n return await betterFetch(url, __spreadProps(__spreadValues({}, options), {\n retryAttempt: _retryAttempt + 1\n }));\n }\n }\n if (options == null ? void 0 : options.throw) {\n throw new BetterFetchError(\n response.status,\n response.statusText,\n isJSONResponse ? errorObject : responseText\n );\n }\n return {\n data: null,\n error: __spreadProps(__spreadValues({}, errorObject), {\n status: response.status,\n statusText: response.statusText\n })\n };\n};\nexport {\n BetterFetchError,\n ValidationError,\n applySchemaPlugin,\n betterFetch,\n bodyParser,\n createFetch,\n createRetryStrategy,\n createSchema,\n detectContentType,\n detectResponseType,\n getBody,\n getFetch,\n getHeaders,\n getMethod,\n getTimeout,\n getURL,\n initializePlugins,\n isFunction,\n isJSONParsable,\n isJSONSerializable,\n isPayloadMethod,\n isRouteMethod,\n jsonParse,\n methods,\n parseStandardSchema\n};\n//# sourceMappingURL=index.js.map","import { getBaseURL } from \"../utils/url.mjs\";\nimport { parseJSON } from \"./parser.mjs\";\nimport { redirectPlugin } from \"./fetch-plugins.mjs\";\nimport { getSessionAtom } from \"./session-atom.mjs\";\nimport { defu } from \"defu\";\nimport { createFetch } from \"@better-fetch/fetch\";\n//#region src/client/config.ts\nconst resolvePublicAuthUrl = (basePath) => {\n\tif (typeof process === \"undefined\") return void 0;\n\tconst path = basePath ?? \"/api/auth\";\n\tif (process.env.NEXT_PUBLIC_AUTH_URL) return process.env.NEXT_PUBLIC_AUTH_URL;\n\tif (typeof window === \"undefined\") {\n\t\tif (process.env.NEXTAUTH_URL) try {\n\t\t\treturn process.env.NEXTAUTH_URL;\n\t\t} catch {}\n\t\tif (process.env.VERCEL_URL) try {\n\t\t\tconst protocol = process.env.VERCEL_URL.startsWith(\"http\") ? \"\" : \"https://\";\n\t\t\treturn `${new URL(`${protocol}${process.env.VERCEL_URL}`).origin}${path}`;\n\t\t} catch {}\n\t}\n};\nconst getClientConfig = (options, loadEnv) => {\n\tconst isCredentialsSupported = \"credentials\" in Request.prototype;\n\tconst baseURL = getBaseURL(options?.baseURL, options?.basePath, void 0, loadEnv) ?? resolvePublicAuthUrl(options?.basePath) ?? \"/api/auth\";\n\tconst pluginsFetchPlugins = options?.plugins?.flatMap((plugin) => plugin.fetchPlugins).filter((pl) => pl !== void 0) || [];\n\tconst lifeCyclePlugin = {\n\t\tid: \"lifecycle-hooks\",\n\t\tname: \"lifecycle-hooks\",\n\t\thooks: {\n\t\t\tonSuccess: options?.fetchOptions?.onSuccess,\n\t\t\tonError: options?.fetchOptions?.onError,\n\t\t\tonRequest: options?.fetchOptions?.onRequest,\n\t\t\tonResponse: options?.fetchOptions?.onResponse\n\t\t}\n\t};\n\tconst { onSuccess: _onSuccess, onError: _onError, onRequest: _onRequest, onResponse: _onResponse, ...restOfFetchOptions } = options?.fetchOptions || {};\n\tconst $fetch = createFetch({\n\t\tbaseURL,\n\t\t...isCredentialsSupported ? { credentials: \"include\" } : {},\n\t\tmethod: \"GET\",\n\t\tjsonParser(text) {\n\t\t\tif (!text) return null;\n\t\t\treturn parseJSON(text, { strict: false });\n\t\t},\n\t\tcustomFetchImpl: fetch,\n\t\t...restOfFetchOptions,\n\t\tplugins: [\n\t\t\tlifeCyclePlugin,\n\t\t\t...restOfFetchOptions.plugins || [],\n\t\t\t...options?.disableDefaultFetchPlugins ? [] : [redirectPlugin],\n\t\t\t...pluginsFetchPlugins\n\t\t]\n\t});\n\tconst { $sessionSignal, session, broadcastSessionUpdate } = getSessionAtom($fetch, options);\n\tconst plugins = options?.plugins || [];\n\tlet pluginsActions = {};\n\tconst pluginsAtoms = {\n\t\t$sessionSignal,\n\t\tsession\n\t};\n\tconst pluginPathMethods = {\n\t\t\"/sign-out\": \"POST\",\n\t\t\"/revoke-sessions\": \"POST\",\n\t\t\"/revoke-other-sessions\": \"POST\",\n\t\t\"/delete-user\": \"POST\"\n\t};\n\tconst atomListeners = [{\n\t\tsignal: \"$sessionSignal\",\n\t\tmatcher(path) {\n\t\t\treturn path === \"/sign-out\" || path === \"/update-user\" || path === \"/update-session\" || path === \"/sign-up/email\" || path === \"/sign-in/email\" || path === \"/delete-user\" || path === \"/verify-email\" || path === \"/revoke-sessions\" || path === \"/revoke-session\" || path === \"/revoke-other-sessions\" || path === \"/change-email\" || path === \"/change-password\";\n\t\t},\n\t\tcallback(path) {\n\t\t\tif (path === \"/sign-out\") broadcastSessionUpdate(\"signout\");\n\t\t\telse if (path === \"/update-user\" || path === \"/update-session\") broadcastSessionUpdate(\"updateUser\");\n\t\t}\n\t}];\n\tfor (const plugin of plugins) {\n\t\tif (plugin.getAtoms) Object.assign(pluginsAtoms, plugin.getAtoms?.($fetch));\n\t\tif (plugin.pathMethods) Object.assign(pluginPathMethods, plugin.pathMethods);\n\t\tif (plugin.atomListeners) atomListeners.push(...plugin.atomListeners);\n\t}\n\tconst $store = {\n\t\tnotify: (signal) => {\n\t\t\tpluginsAtoms[signal].set(!pluginsAtoms[signal].get());\n\t\t},\n\t\tlisten: (signal, listener) => {\n\t\t\tpluginsAtoms[signal].subscribe(listener);\n\t\t},\n\t\tatoms: pluginsAtoms\n\t};\n\tfor (const plugin of plugins) if (plugin.getActions) pluginsActions = defu(plugin.getActions?.($fetch, $store, options) ?? {}, pluginsActions);\n\treturn {\n\t\tget baseURL() {\n\t\t\treturn baseURL;\n\t\t},\n\t\tpluginsActions,\n\t\tpluginsAtoms,\n\t\tpluginPathMethods,\n\t\tatomListeners,\n\t\t$fetch,\n\t\t$store\n\t};\n};\n//#endregion\nexport { getClientConfig };\n","//#region src/utils/is-atom.ts\nfunction isAtom(value) {\n\treturn typeof value === \"object\" && value !== null && \"get\" in value && typeof value.get === \"function\" && \"lc\" in value && typeof value.lc === \"number\";\n}\n//#endregion\nexport { isAtom };\n","import { isAtom } from \"../utils/is-atom.mjs\";\n//#region src/client/proxy.ts\nfunction getMethod(path, knownPathMethods, args) {\n\tconst method = knownPathMethods[path];\n\tconst { fetchOptions, query: _query, ...body } = args || {};\n\tif (method) return method;\n\tif (fetchOptions?.method) return fetchOptions.method;\n\tif (body && Object.keys(body).length > 0) return \"POST\";\n\treturn \"GET\";\n}\nfunction createDynamicPathProxy(routes, client, knownPathMethods, atoms, atomListeners) {\n\tfunction createProxy(path = []) {\n\t\treturn new Proxy(function() {}, {\n\t\t\tget(_, prop) {\n\t\t\t\tif (typeof prop !== \"string\") return;\n\t\t\t\tif (prop === \"then\" || prop === \"catch\" || prop === \"finally\") return;\n\t\t\t\tconst fullPath = [...path, prop];\n\t\t\t\tlet current = routes;\n\t\t\t\tfor (const segment of fullPath) if (current && typeof current === \"object\" && segment in current) current = current[segment];\n\t\t\t\telse {\n\t\t\t\t\tcurrent = void 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (typeof current === \"function\") return current;\n\t\t\t\tif (isAtom(current)) return current;\n\t\t\t\treturn createProxy(fullPath);\n\t\t\t},\n\t\t\tapply: async (_, __, args) => {\n\t\t\t\tconst routePath = \"/\" + path.map((segment) => segment.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)).join(\"/\");\n\t\t\t\tconst arg = args[0] || {};\n\t\t\t\tconst fetchOptions = args[1] || {};\n\t\t\t\tconst { query, fetchOptions: argFetchOptions, ...body } = arg;\n\t\t\t\tconst options = {\n\t\t\t\t\t...fetchOptions,\n\t\t\t\t\t...argFetchOptions\n\t\t\t\t};\n\t\t\t\tconst method = getMethod(routePath, knownPathMethods, arg);\n\t\t\t\treturn await client(routePath, {\n\t\t\t\t\t...options,\n\t\t\t\t\tbody: method === \"GET\" ? void 0 : {\n\t\t\t\t\t\t...body,\n\t\t\t\t\t\t...options?.body || {}\n\t\t\t\t\t},\n\t\t\t\t\tquery: query || options?.query,\n\t\t\t\t\tmethod,\n\t\t\t\t\tasync onSuccess(context) {\n\t\t\t\t\t\tawait options?.onSuccess?.(context);\n\t\t\t\t\t\tif (!atomListeners || options.disableSignal) return;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* We trigger listeners\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tconst matches = atomListeners.filter((s) => s.matcher(routePath));\n\t\t\t\t\t\tif (!matches.length) return;\n\t\t\t\t\t\tconst visited = /* @__PURE__ */ new Set();\n\t\t\t\t\t\tfor (const match of matches) {\n\t\t\t\t\t\t\tconst signal = atoms[match.signal];\n\t\t\t\t\t\t\tif (!signal) return;\n\t\t\t\t\t\t\tif (visited.has(match.signal)) continue;\n\t\t\t\t\t\t\tvisited.add(match.signal);\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t* To avoid race conditions we set the signal in a setTimeout\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\tconst val = signal.get();\n\t\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\t\tsignal.set(!val);\n\t\t\t\t\t\t\t}, 10);\n\t\t\t\t\t\t\tmatch.callback?.(routePath);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\treturn createProxy();\n}\n//#endregion\nexport { createDynamicPathProxy };\n","//#region src/utils/string.ts\nfunction capitalizeFirstLetter(str) {\n\treturn str.charAt(0).toUpperCase() + str.slice(1);\n}\n//#endregion\nexport { capitalizeFirstLetter };\n","import { getClientConfig } from \"./config.mjs\";\nimport { createDynamicPathProxy } from \"./proxy.mjs\";\nimport { capitalizeFirstLetter } from \"@better-auth/core/utils/string\";\n//#region src/client/vanilla.ts\nfunction createAuthClient(options) {\n\tconst { pluginPathMethods, pluginsActions, pluginsAtoms, $fetch, atomListeners, $store } = getClientConfig(options);\n\tconst resolvedHooks = {};\n\tfor (const [key, value] of Object.entries(pluginsAtoms)) resolvedHooks[`use${capitalizeFirstLetter(key)}`] = value;\n\treturn createDynamicPathProxy({\n\t\t...pluginsActions,\n\t\t...resolvedHooks,\n\t\t$fetch,\n\t\t$store\n\t}, $fetch, pluginPathMethods, pluginsAtoms, atomListeners);\n}\n//#endregion\nexport { createAuthClient };\n","import { t as CLI_CLIENT_ID } from \"./constants-BaNTvWUo.mjs\";\nimport { deviceAuthorizationClient } from \"better-auth/client/plugins\";\nimport { createAuthClient } from \"better-auth/client\";\n//#region src/cli.ts\nfunction createCliAuthClient(baseURL) {\n\treturn createAuthClient({\n\t\tbaseURL,\n\t\tplugins: [deviceAuthorizationClient()]\n\t});\n}\nfunction sleep(ms) {\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\n}\nfunction isDeviceTokenError(value) {\n\treturn typeof value === \"object\" && value !== null && \"error\" in value && typeof value.error === \"string\";\n}\nasync function runDeviceLogin(options) {\n\tconst client = createCliAuthClient(options.baseURL);\n\tconst codeResult = await client.device.code({ client_id: options.clientId });\n\tif (codeResult.error) {\n\t\tconst message = \"error_description\" in codeResult.error ? codeResult.error.error_description : \"Failed to request device code\";\n\t\tthrow new Error(message);\n\t}\n\tconst { device_code: deviceCode, user_code: userCode, verification_uri: verificationUri, verification_uri_complete: verificationUriComplete, expires_in: expiresIn, interval } = codeResult.data;\n\tif (options.onCodes) options.onCodes({\n\t\tuserCode,\n\t\tverificationUri,\n\t\tverificationUriComplete\n\t});\n\telse {\n\t\tprocess.stderr.write(`Visit ${verificationUri} and enter code: ${userCode}\\n`);\n\t\toptions.openUrl?.(verificationUriComplete);\n\t}\n\tconst deadline = Date.now() + expiresIn * 1e3;\n\tlet pollIntervalMs = interval * 1e3;\n\twhile (Date.now() < deadline) {\n\t\tconst tokenResult = await client.device.token({\n\t\t\tgrant_type: \"urn:ietf:params:oauth:grant-type:device_code\",\n\t\t\tdevice_code: deviceCode,\n\t\t\tclient_id: options.clientId\n\t\t});\n\t\tif (!tokenResult.error) {\n\t\t\tconst token = tokenResult.data;\n\t\t\treturn {\n\t\t\t\taccessToken: token.access_token,\n\t\t\t\texpiresIn: token.expires_in\n\t\t\t};\n\t\t}\n\t\tconst errorPayload = tokenResult.error;\n\t\tconst oauthError = isDeviceTokenError(errorPayload.body) ? errorPayload.body : isDeviceTokenError(tokenResult.error) ? tokenResult.error : null;\n\t\tif (oauthError?.error === \"authorization_pending\") {\n\t\t\tawait sleep(pollIntervalMs);\n\t\t\tcontinue;\n\t\t}\n\t\tif (oauthError?.error === \"slow_down\") {\n\t\t\tpollIntervalMs += 5e3;\n\t\t\tawait sleep(pollIntervalMs);\n\t\t\tcontinue;\n\t\t}\n\t\tif (oauthError?.error === \"expired_token\") throw new Error(\"Device code expired. Run auth login again.\");\n\t\tif (oauthError?.error === \"access_denied\") throw new Error(\"Device authorization was denied.\");\n\t\tthrow new Error(oauthError?.error_description ?? errorPayload.message ?? \"Device login failed\");\n\t}\n\tthrow new Error(\"Device code expired. Run auth login again.\");\n}\nasync function getSessionWithBearer(baseURL, accessToken) {\n\tconst result = await createCliAuthClient(baseURL).getSession({ fetchOptions: { headers: { Authorization: `Bearer ${accessToken}` } } });\n\tconst user = result && \"user\" in result ? result.user : result && \"data\" in result && result.data && \"user\" in result.data ? result.data.user : void 0;\n\tif (typeof user !== \"object\" || user === null || !(\"id\" in user) || !(\"email\" in user) || !(\"name\" in user) || typeof user.id !== \"string\" || typeof user.email !== \"string\" || typeof user.name !== \"string\") return null;\n\treturn {\n\t\tid: user.id,\n\t\temail: user.email,\n\t\tname: user.name\n\t};\n}\n//#endregion\nexport { CLI_CLIENT_ID, createCliAuthClient, getSessionWithBearer, runDeviceLogin };\n\n//# sourceMappingURL=cli.mjs.map","import type Conf from \"conf\";\nimport type { CliConfig } from \"../config\";\nimport { getPlatformUrl } from \"../config\";\nimport {\n DEFAULT_PLATFORM_URL,\n DEFAULT_WEB_URL,\n resolvePlatformUrlForWebUrl,\n} from \"../resolve-platform-url\";\n\nexport type AuthLoginTargetOptions = {\n webUrl?: string;\n platformUrl?: string;\n};\n\nexport function resolveAuthLoginTargets(\n options: AuthLoginTargetOptions,\n config: Conf<CliConfig>,\n): { webUrl: string; platformUrl: string } {\n const webUrl = options.webUrl ?? DEFAULT_WEB_URL;\n const platformUrl = resolvePlatformUrlForWebUrl(webUrl, {\n platformUrl: options.platformUrl,\n fallback: options.webUrl ? getPlatformUrl(config) : DEFAULT_PLATFORM_URL,\n });\n\n return { webUrl, platformUrl };\n}\n","import type { Command } from \"commander\";\nimport { CLI_CLIENT_ID, getSessionWithBearer, runDeviceLogin } from \"@keystrokehq/auth/cli\";\nimport { setAccessToken } from \"../../auth/credentials\";\nimport { openUrl } from \"../../auth/open-url\";\nimport { resolveAuthLoginTargets } from \"../../auth/resolve-login-targets\";\nimport { createCliConfig } from \"../../config\";\nimport { formatCliError } from \"../../errors/format-cli-error\";\nimport { syncActiveOrganizationAfterLogin } from \"../../organization/active-organization\";\n\ntype LoginOptions = {\n webUrl?: string;\n platformUrl?: string;\n org?: string;\n};\n\nexport function registerAuthLoginCommand(auth: Command): void {\n auth\n .command(\"login\")\n .description(\"Authenticate via browser device flow\")\n .option(\n \"--web-url <url>\",\n \"Web dashboard origin (omit to use production defaults; local dev: http://localhost:3000)\",\n )\n .option(\"--platform-url <url>\", \"Platform API origin (derived from web URL when omitted)\")\n .option(\"--org <id>\", \"Active organization id (skips prompt when you belong to several)\")\n .action(async (options: LoginOptions) => {\n const config = createCliConfig();\n const { webUrl, platformUrl } = resolveAuthLoginTargets(options, config);\n\n config.set(\"webUrl\", webUrl);\n config.set(\"platformUrl\", platformUrl);\n\n try {\n const result = await runDeviceLogin({\n baseURL: webUrl,\n clientId: CLI_CLIENT_ID,\n openUrl,\n });\n\n setAccessToken(webUrl, result.accessToken);\n\n const user = await getSessionWithBearer(webUrl, result.accessToken);\n if (user) {\n process.stdout.write(`Logged in as ${user.name} (${user.email})\\n`);\n } else {\n process.stdout.write(`Logged in to ${webUrl}\\n`);\n }\n\n await syncActiveOrganizationAfterLogin(config, {\n organizationId: options.org,\n });\n } catch (error) {\n process.stderr.write(`${formatCliError(error, \"Login failed\", { webUrl })}\\n`);\n process.exitCode = 1;\n }\n });\n}\n","import type { Command } from \"commander\";\nimport { clearAccessToken } from \"../../auth/credentials\";\nimport { createCliConfig, getWebUrl } from \"../../config\";\n\ntype LogoutOptions = {\n webUrl?: string;\n};\n\nexport function registerAuthLogoutCommand(auth: Command): void {\n auth\n .command(\"logout\")\n .description(\"Clear stored credentials\")\n .option(\"--web-url <url>\", \"Web dashboard origin (default from config)\")\n .action((options: LogoutOptions) => {\n const config = createCliConfig();\n const webUrl = options.webUrl ?? getWebUrl(config);\n clearAccessToken(webUrl);\n process.stdout.write(`${JSON.stringify({ authenticated: false, webUrl })}\\n`);\n });\n}\n","import { getSessionWithBearer } from \"@keystrokehq/auth/cli\";\nimport type { Command } from \"commander\";\nimport { getAccessToken } from \"../../auth/credentials\";\nimport { createCliConfig, getWebUrl } from \"../../config\";\nimport { formatCliError } from \"../../errors/format-cli-error\";\nimport { listOrganizations } from \"../../organization/active-organization\";\n\ntype StatusOptions = {\n webUrl?: string;\n};\n\nexport function registerAuthStatusCommand(auth: Command): void {\n auth\n .command(\"status\")\n .description(\"Show authentication status\")\n .option(\"--web-url <url>\", \"Web dashboard origin (default from config)\")\n .action(async (options: StatusOptions) => {\n const config = createCliConfig();\n const webUrl = options.webUrl ?? getWebUrl(config);\n const token = getAccessToken(webUrl);\n\n if (!token) {\n process.stdout.write(`${JSON.stringify({ authenticated: false, webUrl })}\\n`);\n return;\n }\n\n try {\n const user = await getSessionWithBearer(webUrl, token);\n const organizations = user ? await listOrganizations(config).catch(() => []) : [];\n const activeOrganizationId = config.get(\"activeOrganizationId\");\n const activeOrganization = activeOrganizationId\n ? organizations.find((entry) => entry.organization.id === activeOrganizationId)\n : undefined;\n\n process.stdout.write(\n `${JSON.stringify({\n authenticated: user !== null,\n webUrl,\n user,\n activeOrganizationId: activeOrganizationId ?? null,\n activeOrganization: activeOrganization?.organization.name ?? null,\n })}\\n`,\n );\n\n if (!user) {\n process.exitCode = 1;\n }\n } catch (error) {\n process.stderr.write(`${formatCliError(error, \"Status check failed\", { webUrl })}\\n`);\n process.exitCode = 1;\n }\n });\n}\n","import type { Command } from \"commander\";\nimport { registerAuthLoginCommand } from \"./login\";\nimport { registerAuthLogoutCommand } from \"./logout\";\nimport { registerAuthStatusCommand } from \"./status\";\n\nexport function registerAuthCommand(program: Command): void {\n const auth = program.command(\"auth\").description(\"Authenticate with an keystroke deployment\");\n\n registerAuthLoginCommand(auth);\n registerAuthLogoutCommand(auth);\n registerAuthStatusCommand(auth);\n}\n","import type { Command } from \"commander\";\nimport { resolveProjectRoot } from \"../project/resolve-project-root\";\n\nexport function registerBuildCommand(program: Command): void {\n program\n .command(\"build\")\n .description(\"Build the keystroke project for production\")\n .option(\"--dir <path>\", \"Project directory\", process.cwd())\n .action(async (options) => {\n try {\n const root = resolveProjectRoot(options.dir);\n const { buildApp } = await import(\"@keystrokehq/build\");\n await buildApp({ root });\n process.stdout.write(`Built ${root}\\n`);\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Build failed\";\n process.stderr.write(`${message}\\n`);\n process.exitCode = 1;\n }\n });\n}\n","import { spawnSync } from \"node:child_process\";\nimport { existsSync, mkdtempSync, readFileSync, rmSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\n//#region src/pack-artifact.ts\n/** Pack `dist/` into a gzip tarball suitable for `/app` extraction in the project server image. */\nfunction packProjectArtifact(projectRoot) {\n\tif (!existsSync(join(projectRoot, \"dist\"))) throw new Error(\"dist/ not found — run keystroke build first\");\n\tconst tempDir = mkdtempSync(join(tmpdir(), \"keystroke-artifact-\"));\n\tconst archivePath = join(tempDir, \"artifact.tgz\");\n\ttry {\n\t\tconst result = spawnSync(\"tar\", [\n\t\t\t\"-czf\",\n\t\t\tarchivePath,\n\t\t\t\"--exclude=._*\",\n\t\t\t\"--exclude=.DS_Store\",\n\t\t\t\"-C\",\n\t\t\tprojectRoot,\n\t\t\t\"dist\"\n\t\t], {\n\t\t\tencoding: \"utf8\",\n\t\t\tenv: {\n\t\t\t\t...process.env,\n\t\t\t\tCOPYFILE_DISABLE: \"1\"\n\t\t\t}\n\t\t});\n\t\tif (result.status !== 0) throw new Error(result.stderr?.trim() || \"Failed to pack project artifact\");\n\t\treturn readFileSync(archivePath);\n\t} finally {\n\t\trmSync(tempDir, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t});\n\t}\n}\n//#endregion\nexport { packProjectArtifact };\n\n//# sourceMappingURL=pack-artifact.mjs.map","import { packProjectArtifact } from \"@keystrokehq/storage/pack-artifact\";\nimport type { Command } from \"commander\";\n\nimport { createCliConfig } from \"../config\";\nimport { selectActiveOrganization } from \"../organization/active-organization\";\nimport { createCliPlatformClient } from \"../platform-client\";\nimport { resolveProjectRoot } from \"../project/resolve-project-root\";\nimport { getCliTargetOptions } from \"../target-options\";\n\nconst POLL_INTERVAL_MS = 2_000;\nconst DEPLOY_TIMEOUT_MS = 120_000;\n\ntype DeployOptions = {\n dir: string;\n projectId: string;\n skipBuild?: boolean;\n};\n\nasync function sleep(ms: number): Promise<void> {\n await new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n\nexport async function runDeploy(options: DeployOptions): Promise<void> {\n const root = resolveProjectRoot(options.dir);\n const config = createCliConfig();\n const client = createCliPlatformClient(config);\n\n if (!options.skipBuild) {\n const { buildApp } = await import(\"@keystrokehq/build\");\n await buildApp({ root });\n }\n\n const archive = packProjectArtifact(root);\n\n let active = await client.organizations.getActive();\n if (!active) {\n active = await selectActiveOrganization(config);\n }\n\n client.setActiveOrganizationId(active.organization.id);\n\n const project = await client.projects.get(options.projectId);\n\n const created = await client.artifacts.create(project.id);\n const upload = await fetch(created.uploadUrl, {\n method: \"PUT\",\n body: archive,\n headers: {\n \"Content-Type\": \"application/gzip\",\n },\n });\n\n if (!upload.ok) {\n throw new Error(`Artifact upload failed (${upload.status})`);\n }\n\n const completed = await client.artifacts.complete(project.id, created.artifact.id);\n process.stdout.write(`Deploy ${completed.artifact.id} uploaded\\n`);\n\n const deadline = Date.now() + DEPLOY_TIMEOUT_MS;\n while (Date.now() < deadline) {\n const current = await client.projects.get(project.id);\n if (current.status === \"active\") {\n config.set(\"activeProjectId\", project.id);\n config.set(\"apiTarget\", \"platform\");\n process.stdout.write(`Project active${current.baseUrl ? `: ${current.baseUrl}` : \"\"}\\n`);\n return;\n }\n\n if (current.status === \"failed\") {\n throw new Error(current.lastError ?? \"Project runtime failed\");\n }\n\n await sleep(POLL_INTERVAL_MS);\n }\n\n throw new Error(\"Timed out waiting for project to become active\");\n}\n\nexport function registerDeployCommand(program: Command): void {\n program\n .command(\"deploy\")\n .description(\"Build, upload, and deploy the project to the platform\")\n .option(\"--dir <path>\", \"Project directory\", process.cwd())\n .option(\"--skip-build\", \"Upload the existing dist/ without rebuilding\")\n .action(async (options) => {\n try {\n const config = createCliConfig();\n const projectId = getCliTargetOptions().projectId ?? config.get(\"activeProjectId\");\n if (!projectId) {\n throw new Error(\"Usage: keystroke deploy --project <id>\");\n }\n\n await runDeploy({\n dir: options.dir,\n projectId,\n skipBuild: options.skipBuild,\n });\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Deploy failed\";\n process.stderr.write(`${message}\\n`);\n process.exitCode = 1;\n }\n });\n}\n","/** Strip dev-only Node flags so the API child loads built `dist/`, not package `src/`. */\nexport function runtimeChildNodeOptions(nodeOptions: string | undefined): string | undefined {\n if (!nodeOptions?.trim()) {\n return undefined;\n }\n\n const parts = nodeOptions.trim().split(/\\s+/);\n const cleaned: string[] = [];\n\n for (let index = 0; index < parts.length; index++) {\n const part = parts[index]!;\n if (part === \"--conditions=development\") {\n continue;\n }\n if (part === \"--conditions\" && parts[index + 1] === \"development\") {\n index++;\n continue;\n }\n cleaned.push(part);\n }\n\n const result = cleaned.join(\" \").trim();\n return result || undefined;\n}\n\nexport function runtimeChildEnv(\n parentEnv: NodeJS.ProcessEnv,\n overrides: Record<string, string>,\n): NodeJS.ProcessEnv {\n const env: NodeJS.ProcessEnv = { ...parentEnv, ...overrides };\n delete env.KEYSTROKE_DEV;\n\n const nodeOptions = runtimeChildNodeOptions(env.NODE_OPTIONS);\n if (nodeOptions) {\n env.NODE_OPTIONS = nodeOptions;\n } else {\n delete env.NODE_OPTIONS;\n }\n\n // Local project API — sqlite only; Infisical POSTGRES_* is for platform/orchestrator.\n for (const key of [\n \"POSTGRES_HOST\",\n \"POSTGRES_PORT\",\n \"POSTGRES_DB\",\n \"POSTGRES_USER\",\n \"POSTGRES_PASSWORD\",\n \"DATABASE_SEARCH_PATH\",\n ]) {\n delete env[key];\n }\n if (!env.DATABASE_URL?.trim()) {\n env.DATABASE_URL = \"file:./data/dev.db\";\n }\n\n return env;\n}\n","import { pathToFileURL } from \"node:url\";\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { listenPortFromPublicUrl } from \"@keystrokehq/shared\";\nimport { runtimeChildEnv } from \"./runtime-child-env\";\n\nexport type BootstrapRunOptions = {\n root: string;\n runtimeNodeModules: string;\n apiPort: number;\n};\n\nexport type BootstrapRun = {\n cwd: string;\n args: string[];\n env: NodeJS.ProcessEnv;\n};\n\n/** Node args + env for `@keystrokehq/build` bootstrap (shared by start + dev). */\nexport async function resolveBootstrapRun(options: BootstrapRunOptions): Promise<BootstrapRun> {\n const { resolveRuntimeBuildArtifact } = await import(\"@keystrokehq/build\");\n const loader = pathToFileURL(\n resolveRuntimeBuildArtifact(options.runtimeNodeModules, \"dist/runtime-loader.mjs\"),\n ).href;\n const bootstrap = resolveRuntimeBuildArtifact(options.runtimeNodeModules, \"dist/bootstrap.mjs\");\n\n const args: string[] = [`--import=${loader}`];\n const envFile = join(options.root, \".env\");\n\n if (existsSync(envFile)) {\n args.push(`--env-file=${envFile}`);\n }\n\n args.push(bootstrap);\n\n const childEnv = runtimeChildEnv(process.env, {\n KEYSTROKE_ROOT: options.root,\n KEYSTROKE_RUNTIME_NODE_MODULES: options.runtimeNodeModules,\n PROJECT_ID: process.env.PROJECT_ID ?? \"default\",\n });\n childEnv.PORT = String(listenPortFromPublicUrl(childEnv.PUBLIC_SERVER_URL, options.apiPort));\n\n return {\n cwd: options.root,\n args,\n env: childEnv,\n };\n}\n","import { spawn, type ChildProcess } from \"node:child_process\";\n\nexport type ManagedProcess = {\n name: string;\n child: ChildProcess;\n};\n\nexport function waitForExit(child: ChildProcess): Promise<number | null> {\n return new Promise((resolve) => {\n child.on(\"exit\", (code) => resolve(code ?? null));\n });\n}\n\nexport async function runUntilExit(processes: ManagedProcess[]): Promise<number | null> {\n const shutdown = (signal: NodeJS.Signals = \"SIGTERM\") => {\n for (const { child } of processes) {\n if (!child.killed && child.pid !== undefined) {\n child.kill(signal);\n }\n }\n };\n\n const onSignal = () => {\n shutdown(\"SIGINT\");\n process.exit(0);\n };\n\n process.on(\"SIGINT\", onSignal);\n process.on(\"SIGTERM\", onSignal);\n\n try {\n const results = await Promise.race(\n processes.map(async ({ name, child }) => {\n const code = await waitForExit(child);\n return { name, code };\n }),\n );\n\n if (results.code !== 0 && results.code !== null) {\n shutdown();\n throw new Error(`${results.name} exited with status ${results.code}`);\n }\n\n shutdown();\n return results.code;\n } finally {\n process.off(\"SIGINT\", onSignal);\n process.off(\"SIGTERM\", onSignal);\n }\n}\n\nexport function spawnNodeScript(options: {\n cwd: string;\n args: string[];\n env: NodeJS.ProcessEnv;\n}): ChildProcess {\n return spawn(\"node\", options.args, {\n cwd: options.cwd,\n env: options.env,\n stdio: \"inherit\",\n });\n}\n","import { spawnSync } from \"node:child_process\";\nimport { createRequire } from \"node:module\";\nimport { dirname, join } from \"node:path\";\n\nconst NATIVE_PACKAGES = [\"better-sqlite3\"] as const;\n\nfunction isMissingBindingsError(error: unknown): boolean {\n return error instanceof Error && error.message.includes(\"Could not locate the bindings file\");\n}\n\nfunction rebuildNativePackage(require: NodeRequire, pkg: string): void {\n const pkgDir = dirname(require.resolve(`${pkg}/package.json`));\n const npm = process.platform === \"win32\" ? \"npm.cmd\" : \"npm\";\n const result = spawnSync(npm, [\"run\", \"install\"], { cwd: pkgDir, stdio: \"inherit\" });\n\n if (result.status !== 0) {\n throw new Error(`Failed to build ${pkg} native bindings. Try: pnpm rebuild -g ${pkg}`);\n }\n}\n\n/** Compile native addons when pnpm skipped dependency install scripts (common on global install). */\nexport function ensureNativeDeps(nodeModulesRoot: string): void {\n const anchor = join(nodeModulesRoot, \"@keystrokehq\", \"server\", \"package.json\");\n const require = createRequire(anchor);\n\n for (const pkg of NATIVE_PACKAGES) {\n try {\n require(pkg);\n } catch (error) {\n if (!isMissingBindingsError(error)) {\n throw error;\n }\n\n process.stderr.write(`Building ${pkg} native bindings…\\n`);\n rebuildNativePackage(require, pkg);\n require(pkg);\n }\n }\n}\n","import { existsSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\n\n/** Directory whose `node_modules/@keystrokehq/server` ships with the CLI pack. */\nexport function resolveCliRuntimeNodeModules(cliRoot: string): string {\n let dir = cliRoot;\n\n while (dir !== dirname(dir)) {\n const nodeModules = join(dir, \"node_modules\");\n if (existsSync(join(nodeModules, \"@keystrokehq\", \"server\"))) {\n return nodeModules;\n }\n dir = dirname(dir);\n }\n\n throw new Error(\n \"Keystroke runtime packages are missing. Reinstall or repack the CLI (expected @keystrokehq/server in node_modules).\",\n );\n}\n","/**\n * `keystroke dev` — watch-build + API restart.\n *\n * NOT true hot reload. On src/ changes tsdown rebuilds dist/, then we stop and\n * boot the API again so route discovery picks up new agents/workflows/triggers.\n */\nimport type { Command } from \"commander\";\nimport type { ChildProcess } from \"node:child_process\";\nimport { createCliConfig, getConfigDir, getServerUrl } from \"../config\";\nimport { clearDevSession, writeDevSession } from \"../dev-session\";\nimport { resolveBootstrapRun } from \"../project/bootstrap-run\";\nimport { resolveCliRoot } from \"../project/resolve-cli-root\";\nimport { resolveProjectRoot } from \"../project/resolve-project-root\";\nimport { spawnNodeScript } from \"../process/run-processes\";\nimport { ensureNativeDeps } from \"../runtime/ensure-native-deps\";\nimport { resolveCliRuntimeNodeModules } from \"../runtime/resolve-runtime-node-modules\";\n\nconst DEV_BANNER = \"keystroke dev: watch rebuilds dist/ and restarts the API — not hot reload.\\n\";\n\ntype DevOptions = {\n dir: string;\n port?: number;\n};\n\nfunction stopChild(child: ChildProcess | undefined): void {\n if (child && !child.killed && child.pid !== undefined) {\n child.kill(\"SIGTERM\");\n }\n}\n\nfunction resolveDevServerUrl(\n config: ReturnType<typeof createCliConfig>,\n portOverride?: number,\n): string {\n const url = new URL(getServerUrl(config));\n if (portOverride !== undefined) {\n url.port = String(portOverride);\n }\n return url.origin;\n}\n\nexport async function runDev(options: DevOptions): Promise<void> {\n const root = resolveProjectRoot(options.dir);\n\n const runtimeNodeModules = resolveCliRuntimeNodeModules(resolveCliRoot(import.meta.url));\n ensureNativeDeps(runtimeNodeModules);\n\n const cliConfig = createCliConfig();\n const configDir = getConfigDir(cliConfig);\n\n process.stdout.write(DEV_BANNER);\n\n const serverUrl = resolveDevServerUrl(cliConfig, options.port);\n const apiPort = Number(new URL(serverUrl).port || 80);\n\n writeDevSession(\n {\n pid: process.pid,\n port: apiPort,\n root,\n serverUrl,\n },\n configDir,\n );\n\n let apiChild: ChildProcess | undefined;\n let restarting = false;\n let firstBoot = true;\n\n const restartApi = async () => {\n if (restarting) {\n return;\n }\n\n restarting = true;\n stopChild(apiChild);\n const bootstrap = await resolveBootstrapRun({\n root,\n runtimeNodeModules,\n apiPort,\n });\n apiChild = spawnNodeScript(bootstrap);\n\n if (firstBoot) {\n firstBoot = false;\n process.stdout.write(`API: ${serverUrl}\\n`);\n } else {\n process.stdout.write(\"API restarted after dist rebuild (not hot reload).\\n\");\n }\n\n restarting = false;\n };\n\n const shutdown = () => {\n clearDevSession(configDir);\n stopChild(apiChild);\n process.exit(0);\n };\n\n process.on(\"SIGINT\", shutdown);\n process.on(\"SIGTERM\", shutdown);\n\n try {\n const { watchApp } = await import(\"@keystrokehq/build\");\n await watchApp({\n root,\n clean: false,\n onRebuild: restartApi,\n });\n } finally {\n process.off(\"SIGINT\", shutdown);\n process.off(\"SIGTERM\", shutdown);\n clearDevSession(configDir);\n stopChild(apiChild);\n }\n}\n\nexport function registerDevCommand(program: Command): void {\n program\n .command(\"dev\")\n .description(\"Watch src/, rebuild dist/, and restart the API (not true hot reload)\")\n .option(\"--dir <path>\", \"Project directory\", process.cwd())\n .option(\"--port <number>\", \"API port\", (value) => Number(value))\n .action(async (options) => {\n try {\n await runDev({\n dir: options.dir,\n port: options.port,\n });\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Dev failed\";\n process.stderr.write(`${message}\\n`);\n process.exitCode = 1;\n }\n });\n}\n","import type { Command } from \"commander\";\nimport { runCliCommand } from \"../errors\";\n\nexport function registerHealthCommand(program: Command): void {\n program\n .command(\"health\")\n .description(\"Check connectivity to the keystroke API\")\n .action(() =>\n runCliCommand(\"Health check failed\", async ({ client }) => {\n const result = await client.health.check();\n process.stdout.write(`${JSON.stringify(result)}\\n`);\n }),\n );\n}\n","const KEBAB_CASE = /^[a-z][a-z0-9-]*$/;\nconst HAS_EMOJI = /\\p{Extended_Pictographic}/u;\nconst HAS_UPPERCASE = /[A-Z]/;\nconst HAS_WHITESPACE = /\\s/;\nconst HAS_UNDERSCORE = /_/;\n\nconst EXAMPLE = \"my-keystroke\";\nconst RULES = \"Use lowercase letters, numbers, and hyphens only\";\n\nfunction projectNameValidationError(name: string): string {\n if (HAS_UPPERCASE.test(name)) {\n return `Project name must be lowercase (${RULES}; e.g. ${EXAMPLE})`;\n }\n if (HAS_WHITESPACE.test(name)) {\n return `Project name cannot contain spaces (${RULES}; e.g. ${EXAMPLE})`;\n }\n if (HAS_UNDERSCORE.test(name)) {\n return `Project name cannot contain underscores (${RULES}; e.g. ${EXAMPLE})`;\n }\n if (HAS_EMOJI.test(name)) {\n return `Project name cannot contain emojis (${RULES}; e.g. ${EXAMPLE})`;\n }\n if (/[^a-z0-9-]/.test(name)) {\n return `Project name cannot contain special characters (${RULES}; e.g. ${EXAMPLE})`;\n }\n if (!/^[a-z]/.test(name)) {\n return `Project name must start with a lowercase letter (e.g. ${EXAMPLE})`;\n }\n return `Project name must be kebab-case (${RULES}; e.g. ${EXAMPLE})`;\n}\n\nexport function assertProjectName(name: string): string {\n const trimmed = name.trim();\n if (!trimmed) {\n throw new Error(\"Project name is required\");\n }\n\n if (!KEBAB_CASE.test(trimmed)) {\n throw new Error(projectNameValidationError(trimmed));\n }\n\n return trimmed;\n}\n\nexport function projectNameFromDirectory(directory: string): string {\n const base = directory.split(/[/\\\\]/).filter(Boolean).at(-1) ?? directory;\n return assertProjectName(base);\n}\n","import { confirm, input } from \"@inquirer/prompts\";\nimport { resolve } from \"node:path\";\nimport { assertProjectName, projectNameFromDirectory } from \"./project-name\";\nimport type { InitOptions } from \"./types\";\n\nexport type InitPromptResult = {\n projectName: string;\n targetDir: string;\n};\n\nexport async function promptInitOptions(options: InitOptions): Promise<InitPromptResult> {\n const defaultName =\n options.name ??\n (options.directory ? projectNameFromDirectory(options.directory) : \"my-keystroke\");\n\n const projectName = assertProjectName(\n options.name ??\n (await input({\n message: \"Project name\",\n default: defaultName,\n validate: (value) => {\n try {\n assertProjectName(value);\n return true;\n } catch (error) {\n return error instanceof Error ? error.message : \"Invalid project name\";\n }\n },\n })),\n );\n\n const targetDir = resolve(\n options.directory ??\n (await input({\n message: \"Project directory\",\n default: `./${projectName}`,\n })),\n );\n\n return { projectName, targetDir };\n}\n\nexport async function confirmTargetDir(targetDir: string): Promise<boolean> {\n return confirm({\n message: `Directory \"${targetDir}\" is not empty. Continue and merge files?`,\n default: false,\n });\n}\n","import { readdir, readFile, stat, writeFile, mkdir } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\n\nexport type TemplateVariables = {\n projectName: string;\n version: string;\n};\n\nfunction renderTemplate(content: string, variables: TemplateVariables): string {\n return content\n .replaceAll(\"{{projectName}}\", variables.projectName)\n .replaceAll(\"{{version}}\", variables.version);\n}\n\nasync function copyEntry(\n sourcePath: string,\n targetPath: string,\n variables: TemplateVariables,\n): Promise<void> {\n const info = await stat(sourcePath);\n\n if (info.isDirectory()) {\n await mkdir(targetPath, { recursive: true });\n const entries = await readdir(sourcePath);\n\n for (const entry of entries) {\n await copyEntry(join(sourcePath, entry), join(targetPath, entry), variables);\n }\n\n return;\n }\n\n await mkdir(dirname(targetPath), { recursive: true });\n const content = await readFile(sourcePath, \"utf8\");\n await writeFile(targetPath, renderTemplate(content, variables));\n}\n\nexport async function copyTemplate(\n templateDir: string,\n targetDir: string,\n variables: TemplateVariables,\n): Promise<void> {\n await copyEntry(templateDir, targetDir, variables);\n}\n","import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { resolveCliRoot } from \"../project/resolve-cli-root\";\n\nexport function resolveTemplateDir(templateName: string, fromModuleUrl = import.meta.url): string {\n const cliRoot = resolveCliRoot(fromModuleUrl);\n // Check source first so contributors editing `templates/` see their changes\n // without rebuilding the CLI. End users don't have `templates/` (only `dist/`\n // ships), so the fallback is what they hit.\n const candidates = [\n join(cliRoot, \"templates\", templateName),\n join(cliRoot, \"dist\", \"templates\", templateName),\n ];\n\n for (const candidate of candidates) {\n if (existsSync(candidate)) {\n return candidate;\n }\n }\n\n throw new Error(`Template \"${templateName}\" not found`);\n}\n","import { readFile, unlink, writeFile } from \"node:fs/promises\";\nimport { join, relative } from \"node:path\";\n\nexport const PROJECT_NPMRC = `@keystrokehq:registry=https://registry.npmjs.org\n`;\n\nexport const PROJECT_GITIGNORE = `node_modules/\ndist/\ndata/\ncoverage/\n.env\n.agent/\n`;\n\nfunction linkSpec(fromDir: string, toDir: string): string {\n const path = relative(fromDir, toDir);\n return `link:${path.startsWith(\".\") ? path : `./${path}`}`;\n}\n\nfunction buildPlaygroundPackageJson(\n projectName: string,\n targetDir: string,\n monorepoRoot: string,\n): string {\n return `${JSON.stringify(\n {\n name: projectName,\n version: \"0.0.0\",\n private: true,\n type: \"module\",\n scripts: {\n dev: \"keystroke dev\",\n build: \"keystroke build\",\n start: \"keystroke start\",\n lint: \"oxlint .\",\n typecheck: \"tsc --noEmit\",\n \"test:unit\": \"vitest run --project unit\",\n \"test:int\": \"vitest run --project integration\",\n },\n dependencies: {\n \"@keystrokehq/action\": linkSpec(targetDir, join(monorepoRoot, \"packages/action\")),\n \"@keystrokehq/agent\": linkSpec(targetDir, join(monorepoRoot, \"packages/agent\")),\n \"@keystrokehq/config\": linkSpec(targetDir, join(monorepoRoot, \"packages/config\")),\n \"@keystrokehq/google\": linkSpec(\n targetDir,\n join(monorepoRoot, \"packages/integrations/google\"),\n ),\n \"@keystrokehq/slack\": linkSpec(\n targetDir,\n join(monorepoRoot, \"packages/integrations/slack\"),\n ),\n \"@keystrokehq/workflow\": linkSpec(targetDir, join(monorepoRoot, \"packages/workflow\")),\n zod: \"^4.4.3\",\n },\n devDependencies: {\n \"@keystrokehq/cli\": linkSpec(targetDir, join(monorepoRoot, \"apps/cli\")),\n \"@keystrokehq/tsconfig\": linkSpec(targetDir, join(monorepoRoot, \"packages/tsconfig\")),\n \"@types/node\": \"^25.9.1\",\n oxlint: \"^1.66.0\",\n typescript: \"^6.0.3\",\n vitest: \"^4.1.7\",\n },\n },\n null,\n 2,\n )}\\n`;\n}\n\n/** Patch hello-world scaffold for monorepo playground/ (link deps, no GitHub Packages). */\nexport async function applyPlaygroundManifest(\n targetDir: string,\n projectName: string,\n monorepoRoot: string,\n): Promise<void> {\n await writeFile(\n join(targetDir, \"package.json\"),\n buildPlaygroundPackageJson(projectName, targetDir, monorepoRoot),\n );\n\n try {\n await unlink(join(targetDir, \".npmrc\"));\n } catch {\n // Existing dirs may have a consumer .npmrc from an earlier scaffold.\n }\n\n const tsconfigPath = join(targetDir, \"tsconfig.json\");\n const tsconfig = JSON.parse(await readFile(tsconfigPath, \"utf8\")) as {\n include?: string[];\n compilerOptions?: { rootDir?: string };\n };\n tsconfig.include = [\"src\", \"keystroke.config.ts\"];\n if (tsconfig.compilerOptions) {\n tsconfig.compilerOptions.rootDir = \".\";\n }\n await writeFile(tsconfigPath, `${JSON.stringify(tsconfig, null, 2)}\\n`);\n}\n","import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { resolveCliRoot } from \"../project/resolve-cli-root\";\n\nconst SKILLS_BUNDLE = \"skills-bundle\";\n\nexport function resolveSkillsBundleDir(fromModuleUrl = import.meta.url): string {\n const cliRoot = resolveCliRoot(fromModuleUrl);\n // The real skills source lives in `packages/skills/`. Check it first so\n // contributor edits are picked up without rebuilding the CLI. End users\n // don't have those paths — they get the bundled copy under `dist/`.\n const candidates = [\n join(cliRoot, \"..\", \"..\", \"packages\", \"skills\", \"bundled\"),\n join(cliRoot, \"..\", \"..\", \"packages\", \"skills\", \"dist\"),\n join(cliRoot, \"dist\", SKILLS_BUNDLE),\n join(cliRoot, SKILLS_BUNDLE),\n ];\n\n for (const candidate of candidates) {\n if (existsSync(join(candidate, \"_AGENTS.md\"))) {\n return candidate;\n }\n }\n\n throw new Error(\n \"Bundled keystroke skills not found — run `pnpm --filter @keystrokehq/cli build`\",\n );\n}\n","import { cp, mkdir, readFile, symlink, writeFile } from \"node:fs/promises\";\nimport { platform } from \"node:os\";\nimport { dirname, join, relative } from \"node:path\";\nimport { resolveSkillsBundleDir } from \"./resolve-skills-bundle-dir\";\n\nasync function linkPath(target: string, linkPath: string, kind: \"dir\" | \"file\"): Promise<void> {\n await mkdir(dirname(linkPath), { recursive: true });\n const type = platform() === \"win32\" && kind === \"dir\" ? \"junction\" : kind;\n await symlink(target, linkPath, type);\n}\n\n/** Copy bundled skills into `.agents/skills/` and scaffold root agent docs. */\nexport async function scaffoldBundledSkills(\n targetDir: string,\n fromModuleUrl = import.meta.url,\n): Promise<void> {\n const bundleDir = resolveSkillsBundleDir(fromModuleUrl);\n const agentsSkillsDir = join(targetDir, \".agents\", \"skills\");\n const agentsMdPath = join(targetDir, \"AGENTS.md\");\n\n await mkdir(agentsSkillsDir, { recursive: true });\n await cp(join(bundleDir, \"skills\"), agentsSkillsDir, { recursive: true });\n await writeFile(agentsMdPath, await readFile(join(bundleDir, \"_AGENTS.md\"), \"utf8\"));\n\n const claudeSkillsLink = join(targetDir, \".claude\", \"skills\");\n await linkPath(relative(dirname(claudeSkillsLink), agentsSkillsDir), claudeSkillsLink, \"dir\");\n\n const claudeMdLink = join(targetDir, \"CLAUDE.md\");\n await linkPath(relative(dirname(claudeMdLink), agentsMdPath), claudeMdLink, \"file\");\n}\n","import { mkdir } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nconst EMPTY_SRC_DIRS = [\"files\", \"skills\", \"triggers\"] as const;\n\n/** Ensure standard empty `src/` folders exist (git does not track empty directories). */\nexport async function scaffoldEmptySrcDirs(targetDir: string): Promise<void> {\n await Promise.all(\n EMPTY_SRC_DIRS.map((dir) => mkdir(join(targetDir, \"src\", dir), { recursive: true })),\n );\n}\n","import { writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { PROJECT_GITIGNORE, PROJECT_NPMRC } from \"./project-files\";\n\n/** Write dotfiles npm/pnpm deploy omits from bundled templates. */\nexport async function scaffoldProjectDotfiles(targetDir: string): Promise<void> {\n await writeFile(join(targetDir, \".npmrc\"), PROJECT_NPMRC);\n await writeFile(join(targetDir, \".gitignore\"), PROJECT_GITIGNORE);\n}\n","import { existsSync } from \"node:fs\";\nimport { access, copyFile, readdir } from \"node:fs/promises\";\nimport { basename, isAbsolute, join, relative, resolve } from \"node:path\";\nimport {\n buildPlaygroundWorkspace,\n installDependencies,\n installPlaygroundDependencies,\n resolvePackageManager,\n} from \"./package-manager\";\nimport { assertProjectName, projectNameFromDirectory } from \"./project-name\";\nimport { confirmTargetDir, promptInitOptions } from \"./prompts\";\nimport { copyTemplate } from \"./copy-template\";\nimport { resolveTemplateDir } from \"./resolve-template-dir\";\nimport { applyPlaygroundManifest } from \"./project-files\";\nimport { scaffoldBundledSkills } from \"./scaffold-bundled-skills\";\nimport { scaffoldEmptySrcDirs } from \"./scaffold-empty-src-dirs\";\nimport { scaffoldProjectDotfiles } from \"./scaffold-project-dotfiles\";\nimport { resolveCliRoot } from \"../project/resolve-cli-root\";\nimport type { InitOptions } from \"./types\";\n\nexport type RunInitOptions = InitOptions & {\n version: string;\n};\n\nfunction monorepoRoot(): string | null {\n const root = join(resolveCliRoot(import.meta.url), \"..\", \"..\");\n return existsSync(join(root, \"pnpm-workspace.yaml\")) ? root : null;\n}\n\nfunction resolvePlaygroundRoot(targetDir: string): string | null {\n if (process.env.KEYSTROKE_DEV !== \"1\") {\n return null;\n }\n\n const root = monorepoRoot();\n if (!root) {\n return null;\n }\n\n const rel = relative(join(root, \"playground\"), resolve(targetDir));\n return rel.length > 0 && !rel.startsWith(\"..\") && !isAbsolute(rel) ? root : null;\n}\n\nasync function directoryExists(path: string): Promise<boolean> {\n try {\n await access(path);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function directoryIsEmpty(path: string): Promise<boolean> {\n if (!(await directoryExists(path))) {\n return true;\n }\n\n const entries = await readdir(path);\n return entries.length === 0;\n}\n\nfunction resolveHeadlessOptions(options: RunInitOptions): {\n projectName: string;\n targetDir: string;\n} {\n const targetDir = resolve(options.directory ?? options.name ?? \"my-keystroke\");\n const projectName = assertProjectName(\n options.name ?? projectNameFromDirectory(basename(targetDir)),\n );\n\n return { projectName, targetDir };\n}\n\nexport async function runInit(\n options: RunInitOptions,\n): Promise<{ targetDir: string; projectName: string }> {\n const interactive = !options.yes && process.stdin.isTTY;\n const resolved = interactive ? await promptInitOptions(options) : resolveHeadlessOptions(options);\n const { projectName, targetDir } = resolved;\n const playgroundRoot = resolvePlaygroundRoot(targetDir);\n\n if (!(await directoryIsEmpty(targetDir))) {\n if (interactive) {\n const ok = await confirmTargetDir(targetDir);\n if (!ok) {\n throw new Error(\"Init cancelled\");\n }\n } else if (!options.yes) {\n throw new Error(\n `Directory \"${targetDir}\" is not empty. Pass --yes to merge or choose an empty directory.`,\n );\n }\n }\n\n await copyTemplate(resolveTemplateDir(options.template ?? \"hello-world\"), targetDir, {\n projectName,\n version: options.version,\n });\n await scaffoldEmptySrcDirs(targetDir);\n\n if (playgroundRoot) {\n await applyPlaygroundManifest(targetDir, projectName, playgroundRoot);\n } else {\n await scaffoldProjectDotfiles(targetDir);\n }\n\n await scaffoldBundledSkills(targetDir);\n await copyFile(join(targetDir, \".env.example\"), join(targetDir, \".env\"));\n\n if (!options.skipInstall) {\n if (playgroundRoot) {\n installPlaygroundDependencies(targetDir);\n // `link:` deps consume each package's built dist/; build so `keystroke dev`\n // works immediately instead of failing with ERR_MODULE_NOT_FOUND.\n buildPlaygroundWorkspace(playgroundRoot);\n } else {\n const manager = resolvePackageManager(options.packageManager);\n installDependencies(targetDir, manager);\n }\n }\n\n return { targetDir, projectName };\n}\n","import type { Command } from \"commander\";\nimport { runInit } from \"../init/run-init\";\nimport { readCliVersion } from \"../version\";\n\nexport function registerInitCommand(program: Command): void {\n program\n .command(\"init\")\n .description(\"Create a new keystroke project from a template\")\n .argument(\"[directory]\", \"Directory to create the project in\")\n .option(\"--name <name>\", \"Project name (kebab-case)\")\n .option(\"--template <name>\", \"Template to use\", \"hello-world\")\n .option(\"-y, --yes\", \"Skip prompts (headless mode for scripts and AI agents)\")\n .option(\"--skip-install\", \"Skip dependency installation\")\n .option(\"--pm <manager>\", \"Package manager: npm, pnpm, yarn, or bun\")\n .action(async (directory: string | undefined, options) => {\n try {\n const result = await runInit({\n directory,\n name: options.name,\n template: options.template,\n yes: options.yes,\n skipInstall: options.skipInstall,\n packageManager: options.pm,\n version: readCliVersion(),\n });\n\n process.stdout.write(\n `Created keystroke project \"${result.projectName}\" at ${result.targetDir}\\n`,\n );\n process.stdout.write(\"\\nNext steps:\\n\");\n process.stdout.write(` cd ${result.targetDir}\\n`);\n process.stdout.write(\" # set ANTHROPIC_API_KEY and integration keys in .env\\n\");\n process.stdout.write(\" keystroke dev\\n\");\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Init failed\";\n process.stderr.write(`${message}\\n`);\n process.exitCode = 1;\n }\n });\n}\n","import type Conf from \"conf\";\nimport type { PlatformClient } from \"@keystrokehq/sdk/platform\";\nimport type { CreateProjectRequest, Project } from \"@keystrokehq/shared\";\n\nimport type { CliConfig } from \"../../config\";\nimport { cliBinaryName } from \"../../errors/command-input\";\nimport { selectActiveOrganization } from \"../../organization/active-organization\";\nimport { createCliPlatformClient } from \"../../platform-client\";\n\nexport async function withActivePlatformClient(\n config: Conf<CliConfig>,\n fn: (platform: PlatformClient) => Promise<void>,\n): Promise<void> {\n const platform = createCliPlatformClient(config);\n let active = await platform.organizations.getActive();\n if (!active) {\n active = await selectActiveOrganization(config);\n }\n\n platform.setActiveOrganizationId(active.organization.id);\n await fn(platform);\n}\n\nfunction writeInactiveDeployHints(projects: Pick<Project, \"id\" | \"status\">[]): void {\n const bin = cliBinaryName();\n for (const project of projects) {\n if (project.status !== \"inactive\") {\n continue;\n }\n\n process.stderr.write(\n `Project ${project.id} is inactive. Deploy with: ${bin} deploy --project ${project.id}\\n`,\n );\n }\n}\n\nexport async function runProjectList(config: Conf<CliConfig>): Promise<void> {\n await withActivePlatformClient(config, async (platform) => {\n const projects = await platform.projects.list();\n process.stdout.write(`${JSON.stringify({ projects }, null, 2)}\\n`);\n\n if (projects.length === 0) {\n const bin = cliBinaryName();\n process.stderr.write(\n `No projects yet. Create one with: ${bin} project create --name \"My project\"\\n`,\n );\n return;\n }\n\n writeInactiveDeployHints(projects);\n });\n}\n\nexport async function runProjectCreate(\n config: Conf<CliConfig>,\n input: CreateProjectRequest,\n): Promise<void> {\n await withActivePlatformClient(config, async (platform) => {\n const project = await platform.projects.create(input);\n process.stdout.write(`${JSON.stringify({ project }, null, 2)}\\n`);\n writeInactiveDeployHints([project]);\n });\n}\n","import type { Command } from \"commander\";\n\nimport { createCliConfig, getPlatformUrl, getWebUrl } from \"../../config\";\nimport { formatCliError } from \"../../errors/format-cli-error\";\nimport { runProjectCreate, runProjectList } from \"./run-project\";\n\nexport function registerProjectCommand(program: Command): void {\n const project = program.command(\"project\").description(\"List and create platform projects\");\n\n project\n .command(\"list\")\n .description(\"List projects in the active organization\")\n .action(async () => {\n const config = createCliConfig();\n try {\n await runProjectList(config);\n } catch (error) {\n process.stderr.write(\n `${formatCliError(error, \"List projects failed\", {\n serverUrl: getPlatformUrl(config),\n webUrl: getWebUrl(config),\n })}\\n`,\n );\n process.exitCode = 1;\n }\n });\n\n project\n .command(\"create\")\n .description(\"Create a platform project in the active organization\")\n .requiredOption(\"--name <name>\", \"Project name\")\n .option(\"--description <description>\", \"Project description\")\n .action(async (options: { name: string; description?: string }) => {\n const config = createCliConfig();\n try {\n await runProjectCreate(config, {\n name: options.name,\n ...(options.description ? { description: options.description } : {}),\n });\n } catch (error) {\n process.stderr.write(\n `${formatCliError(error, \"Create project failed\", {\n serverUrl: getPlatformUrl(config),\n webUrl: getWebUrl(config),\n })}\\n`,\n );\n process.exitCode = 1;\n }\n });\n}\n","import type { Command } from \"commander\";\nimport { createCliConfig, getServerUrl } from \"../config\";\nimport { resolveBootstrapRun } from \"../project/bootstrap-run\";\nimport { resolveCliRoot } from \"../project/resolve-cli-root\";\nimport { resolveProjectRoot } from \"../project/resolve-project-root\";\nimport { runUntilExit, spawnNodeScript, type ManagedProcess } from \"../process/run-processes\";\nimport { ensureNativeDeps } from \"../runtime/ensure-native-deps\";\nimport { resolveCliRuntimeNodeModules } from \"../runtime/resolve-runtime-node-modules\";\n\ntype StartOptions = {\n dir: string;\n port?: number;\n};\n\nfunction resolveStartServerUrl(portOverride?: number): string {\n const url = new URL(getServerUrl(createCliConfig()));\n if (portOverride !== undefined) {\n url.port = String(portOverride);\n }\n return url.origin;\n}\n\nexport async function runStart(options: StartOptions): Promise<void> {\n const root = resolveProjectRoot(options.dir);\n const serverUrl = resolveStartServerUrl(options.port);\n const apiPort = Number(new URL(serverUrl).port || 80);\n\n const runtimeNodeModules = resolveCliRuntimeNodeModules(resolveCliRoot(import.meta.url));\n ensureNativeDeps(runtimeNodeModules);\n const { buildApp } = await import(\"@keystrokehq/build\");\n await buildApp({ root, clean: false });\n\n const bootstrap = await resolveBootstrapRun({\n root,\n runtimeNodeModules,\n apiPort,\n });\n\n const processes: ManagedProcess[] = [\n {\n name: \"api\",\n child: spawnNodeScript(bootstrap),\n },\n ];\n\n process.stdout.write(`API: ${serverUrl}\\n`);\n\n await runUntilExit(processes);\n}\n\nexport function registerStartCommand(program: Command): void {\n program\n .command(\"start\")\n .description(\"Build and run the API server\")\n .option(\"--dir <path>\", \"Project directory\", process.cwd())\n .option(\"--port <number>\", \"API port\", (value) => Number(value))\n .action(async (options) => {\n try {\n await runStart({\n dir: options.dir,\n port: options.port,\n });\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Start failed\";\n process.stderr.write(`${message}\\n`);\n process.exitCode = 1;\n }\n });\n}\n","import type { Command } from \"commander\";\nimport { runProjectCliCommand } from \"../../errors\";\n\nexport function registerTriggerListCommand(trigger: Command): void {\n trigger\n .command(\"list\")\n .description(\"List discovered triggers\")\n .option(\"--endpoint <endpoint>\", \"Only webhook triggers on this shared endpoint\")\n .action((options: { endpoint?: string }) =>\n runProjectCliCommand(\"List triggers failed\", async ({ client }) => {\n const result = await client.triggers.list(\n options.endpoint ? { endpoint: options.endpoint } : undefined,\n );\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n}\n\nexport function registerTriggerGetCommand(trigger: Command): void {\n trigger\n .command(\"get\")\n .description(\"Get a trigger by key, or all webhook triggers on a shared endpoint\")\n .argument(\"<id>\", \"Trigger key or shared webhook endpoint\")\n .action((id: string) =>\n runProjectCliCommand(\"Get trigger failed\", async ({ client }) => {\n const result = await client.triggers.get(id);\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n}\n\nexport function registerTriggerUrlCommand(trigger: Command): void {\n trigger\n .command(\"url\")\n .description(\"Print the webhook URL for a trigger\")\n .argument(\"<id>\", \"Attachment key or webhook route\")\n .action((id: string) =>\n runProjectCliCommand(\"Resolve webhook URL failed\", async ({ client }) => {\n const url = await client.triggers.webhookUrl(id);\n process.stdout.write(`${url}\\n`);\n }),\n );\n}\n","import type { Command } from \"commander\";\nimport { runProjectCliCommand } from \"../../errors\";\n\nfunction collect(value: string, previous: string[]): string[] {\n return [...previous, value];\n}\n\nexport function registerTriggerPollCommand(trigger: Command): void {\n trigger\n .command(\"poll\")\n .description(\"Run a poll trigger on demand\")\n .argument(\"<id>\", \"Poll attachment key, or poll source id with --group\")\n .option(\"--group\", \"Run all attachments that share this poll source id\")\n .option(\"--workflow <key>\", \"Only trigger this workflow (repeatable)\", collect, [])\n .option(\"--attachment <key>\", \"Only trigger this attachment (repeatable)\", collect, [])\n .action((id: string, options: { group?: boolean; workflow: string[]; attachment: string[] }) =>\n runProjectCliCommand(\"Poll trigger failed\", async ({ client }) => {\n const result = await client.triggers.poll(id, {\n ...(options.group ? { group: true } : {}),\n ...(options.workflow.length > 0 ? { workflows: options.workflow } : {}),\n ...(options.attachment.length > 0 ? { attachments: options.attachment } : {}),\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n}\n","import type { Command } from \"commander\";\nimport { runProjectCliCommand } from \"../../errors\";\n\nexport function registerTriggerRunsCommand(trigger: Command): void {\n const runs = trigger.command(\"runs\").description(\"List and inspect trigger runs\");\n\n runs\n .command(\"list\")\n .description(\"List runs for a trigger attachment\")\n .argument(\"<attachmentId>\", \"Trigger attachment key\")\n .option(\"--limit <n>\", \"Page size (1–100)\", \"20\")\n .option(\"--cursor <cursor>\", \"Pagination cursor from a previous page\")\n .option(\"--trigger-type <type>\", \"Filter by trigger type (cron, webhook, poll)\")\n .action((attachmentId: string, options: Record<string, string | undefined>) =>\n runProjectCliCommand(\"List trigger runs failed\", async ({ client }) => {\n const result = await client.triggers.listRuns(attachmentId, {\n limit: Number(options.limit),\n ...(options.cursor ? { cursor: options.cursor } : {}),\n ...(options.triggerType\n ? { triggerType: options.triggerType as \"cron\" | \"webhook\" | \"poll\" }\n : {}),\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n\n runs\n .command(\"get\")\n .description(\"Get full details for a trigger run\")\n .argument(\"<attachmentId>\", \"Trigger attachment key\")\n .argument(\"<runId>\", \"Trigger run id\")\n .option(\"--include <parts>\", \"Comma-separated: workflows, trace\")\n .action((attachmentId: string, runId: string, options: { include?: string }) =>\n runProjectCliCommand(\"Get trigger run failed\", async ({ client }) => {\n const result = await client.triggers.getRun(attachmentId, runId, {\n include: options.include,\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n}\n","import type { Command } from \"commander\";\nimport {\n registerTriggerGetCommand,\n registerTriggerListCommand,\n registerTriggerUrlCommand,\n} from \"./list\";\nimport { registerTriggerPollCommand } from \"./poll\";\nimport { registerTriggerRunsCommand } from \"./runs\";\n\nexport function registerTriggerCommand(program: Command): void {\n const trigger = program.command(\"trigger\").description(\"Invoke and inspect triggers\");\n\n registerTriggerListCommand(trigger);\n registerTriggerGetCommand(trigger);\n registerTriggerUrlCommand(trigger);\n registerTriggerPollCommand(trigger);\n registerTriggerRunsCommand(trigger);\n}\n","import { isQueuedRunResponse } from \"@keystrokehq/sdk\";\nimport type { Command } from \"commander\";\nimport { cliBinaryName, parseJsonOption, runProjectCliCommand } from \"../../errors\";\n\nexport function registerWorkflowRunCommand(workflow: Command): void {\n workflow\n .command(\"run\")\n .description(\"Invoke a workflow\")\n .argument(\"<workflowId>\", \"Workflow key / route id\")\n .option(\"--input <json>\", \"JSON request body (defaults to {})\", \"{}\")\n .addHelpText(\n \"after\",\n `\nExamples:\n ${cliBinaryName()} workflow run math --input '{\"first\":1,\"second\":2}'\n ${cliBinaryName()} workflow run incoming-message --input '{\"message\":\"Hi\",\"sender\":\"you\"}'\n`,\n )\n .action((workflowId: string, options: { input: string }) =>\n runProjectCliCommand(\n \"Workflow run failed\",\n async ({ client }) => {\n const input = parseJsonOption(options.input, \"--input\");\n const result = await client.workflows.run(workflowId, input);\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n\n if (isQueuedRunResponse(result)) {\n process.stderr.write(\n `Run queued. Track progress:\\n` +\n ` ${cliBinaryName()} workflow runs get ${workflowId} ${result.runId} --include steps,trace\\n`,\n );\n }\n },\n {\n usage: {\n command: `${cliBinaryName()} workflow run ${workflowId}`,\n flag: \"--input\",\n },\n },\n ),\n );\n}\n","import type { Command } from \"commander\";\nimport { runProjectCliCommand } from \"../../errors\";\n\nexport function registerWorkflowRunsCommand(workflow: Command): void {\n const runs = workflow.command(\"runs\").description(\"List and inspect workflow runs\");\n\n runs\n .command(\"list\")\n .description(\"List runs for a workflow\")\n .argument(\"<workflowId>\", \"Workflow key / route id\")\n .option(\"--limit <n>\", \"Page size (1–100)\", \"20\")\n .option(\"--cursor <cursor>\", \"Pagination cursor from a previous page\")\n .option(\"--status <status>\", \"Filter by status\")\n .option(\"--trigger <trigger>\", \"Filter by trigger kind\")\n .action((workflowId: string, options: Record<string, string | undefined>) =>\n runProjectCliCommand(\"List workflow runs failed\", async ({ client }) => {\n const result = await client.workflows.listRuns(workflowId, {\n limit: Number(options.limit),\n ...(options.cursor ? { cursor: options.cursor } : {}),\n ...(options.status\n ? { status: options.status as \"pending\" | \"running\" | \"completed\" | \"failed\" }\n : {}),\n ...(options.trigger\n ? { trigger: options.trigger as \"api\" | \"cron\" | \"webhook\" | \"poll\" | \"retry\" }\n : {}),\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n\n runs\n .command(\"get\")\n .description(\"Get full details for a workflow run\")\n .argument(\"<workflowId>\", \"Workflow key / route id\")\n .argument(\"<runId>\", \"Workflow run id\")\n .option(\"--include <parts>\", \"Comma-separated: trigger, steps, trace\")\n .action((workflowId: string, runId: string, options: { include?: string }) =>\n runProjectCliCommand(\"Get workflow run failed\", async ({ client }) => {\n const result = await client.workflows.getRun(workflowId, runId, {\n include: options.include,\n });\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n }),\n );\n}\n","import type { Command } from \"commander\";\nimport { registerWorkflowRunCommand } from \"./run\";\nimport { registerWorkflowRunsCommand } from \"./runs\";\n\nexport function registerWorkflowCommand(program: Command): void {\n const workflow = program.command(\"workflow\").description(\"Invoke and inspect workflows\");\n\n registerWorkflowRunCommand(workflow);\n registerWorkflowRunsCommand(workflow);\n}\n","import type Conf from \"conf\";\nimport type { Project } from \"@keystrokehq/shared\";\nimport { PlatformError } from \"@keystrokehq/sdk/platform\";\n\nimport type { CliConfig } from \"../../config\";\nimport { cliBinaryName } from \"../../errors/command-input\";\nimport { createCliPlatformClient } from \"../../platform-client\";\n\nexport type ConfigUseProjectResult = {\n stdout: string;\n stderr?: string;\n};\n\nasync function fetchProjectInOrg(config: Conf<CliConfig>, projectId: string): Promise<Project> {\n const platform = createCliPlatformClient(config);\n\n try {\n return await platform.projects.get(projectId);\n } catch (error) {\n if (error instanceof PlatformError && error.status === 404) {\n throw new Error(\n `Project ${projectId} not found in the active organization. Run \\`keystroke project list\\`, then \\`keystroke config use project <id>\\`.`,\n );\n }\n throw error;\n }\n}\n\nfunction assertProjectReadyForConfig(project: Project): void {\n if (project.status === \"failed\") {\n throw new Error(\n project.lastError\n ? `Project ${project.id} deploy failed: ${project.lastError}`\n : `Project ${project.id} deploy failed`,\n );\n }\n\n if (project.status === \"starting\") {\n throw new Error(\n `Project ${project.id} is still starting. Wait for deploy to finish, then run \\`keystroke config use project ${project.id}\\`.`,\n );\n }\n}\n\nexport async function runConfigUseProject(\n config: Conf<CliConfig>,\n projectId: string,\n): Promise<ConfigUseProjectResult> {\n const project = await fetchProjectInOrg(config, projectId);\n assertProjectReadyForConfig(project);\n\n config.set(\"activeProjectId\", projectId);\n config.set(\"apiTarget\", \"platform\");\n\n const stdout =\n project.status === \"active\"\n ? `Using platform project ${projectId}\\n`\n : `Using platform project ${projectId} (${project.status})\\n`;\n\n const stderr =\n project.status === \"inactive\"\n ? `Project is not active yet. Deploy with: ${cliBinaryName()} deploy --project ${projectId}\\n`\n : undefined;\n\n return { stdout, stderr };\n}\n","import type { Command } from \"commander\";\n\nimport { createCliConfig, getConfigDir, getEffectiveApiTarget, getPlatformUrl } from \"../../config\";\nimport { readDevSession } from \"../../dev-session\";\nimport {\n listOrganizations,\n selectActiveOrganization,\n} from \"../../organization/active-organization\";\nimport { runConfigUseProject } from \"./use-project\";\n\nexport function registerConfigCommand(program: Command): void {\n const config = program.command(\"config\").description(\"Manage CLI configuration\");\n\n config\n .command(\"show\")\n .description(\"Show CLI configuration\")\n .action(() => {\n const cliConfig = createCliConfig();\n const configDir = getConfigDir(cliConfig);\n process.stdout.write(\n `${JSON.stringify(\n {\n serverUrl: cliConfig.get(\"serverUrl\"),\n webUrl: cliConfig.get(\"webUrl\"),\n platformUrl: getPlatformUrl(cliConfig),\n activeOrganizationId: cliConfig.get(\"activeOrganizationId\"),\n activeProjectId: cliConfig.get(\"activeProjectId\"),\n apiTarget: getEffectiveApiTarget(cliConfig),\n devSession: readDevSession(configDir) ?? null,\n },\n null,\n 2,\n )}\\n`,\n );\n });\n\n config\n .command(\"use\")\n .description(\"Switch API target (local/cloud/project) or active organization\")\n .argument(\"[mode]\", \"local, cloud, project, or org\")\n .argument(\"[id]\", \"Project or organization id when switching cloud target or org\")\n .action(async (mode?: string, id?: string) => {\n const cliConfig = createCliConfig();\n\n if (!mode || mode === \"local\") {\n cliConfig.set(\"apiTarget\", \"local\");\n const activeProjectId = cliConfig.get(\"activeProjectId\");\n process.stdout.write(\n activeProjectId\n ? `Using local keystroke server (cloud project ${activeProjectId} unchanged)\\n`\n : \"Using local keystroke server\\n\",\n );\n return;\n }\n\n if (mode === \"org\") {\n const membership = await selectActiveOrganization(cliConfig, { organizationId: id });\n process.stdout.write(`Using organization ${membership.organization.name}\\n`);\n return;\n }\n\n if (mode === \"cloud\") {\n cliConfig.set(\"apiTarget\", \"platform\");\n const activeProjectId = cliConfig.get(\"activeProjectId\");\n process.stdout.write(\n activeProjectId\n ? `Using platform API (default project ${activeProjectId} for project-scoped commands)\\n`\n : \"Using platform API\\n\",\n );\n return;\n }\n\n if (mode !== \"project\") {\n throw new Error(\n \"Usage: keystroke config use [local|cloud|project [projectId]|org [organizationId]]\",\n );\n }\n\n const targetProjectId = id ?? cliConfig.get(\"activeProjectId\");\n if (!targetProjectId) {\n throw new Error(\"Usage: keystroke config use project <projectId>\");\n }\n\n const result = await runConfigUseProject(cliConfig, targetProjectId);\n process.stdout.write(result.stdout);\n if (result.stderr) {\n process.stderr.write(result.stderr);\n }\n });\n\n config\n .command(\"org\")\n .description(\"List organizations you belong to\")\n .action(async () => {\n const cliConfig = createCliConfig();\n const organizations = await listOrganizations(cliConfig);\n process.stdout.write(`${JSON.stringify({ organizations }, null, 2)}\\n`);\n });\n}\n","import { Command } from \"commander\";\nimport { registerAgentCommand } from \"./commands/agent\";\nimport { registerConnectCommand } from \"./commands/connect\";\nimport { registerCredentialsCommand } from \"./commands/credentials\";\nimport { registerAuthCommand } from \"./commands/auth\";\nimport { registerBuildCommand } from \"./commands/build\";\nimport { registerDeployCommand } from \"./commands/deploy\";\nimport { registerDevCommand } from \"./commands/dev\";\nimport { registerHealthCommand } from \"./commands/health\";\nimport { registerInitCommand } from \"./commands/init\";\nimport { registerProjectCommand } from \"./commands/project\";\nimport { registerStartCommand } from \"./commands/start\";\nimport { registerTriggerCommand } from \"./commands/trigger\";\nimport { registerWorkflowCommand } from \"./commands/workflow\";\nimport { registerConfigCommand } from \"./commands/config\";\nimport { readCliVersion } from \"./version\";\nimport { setCliTargetOptions } from \"./target-options\";\n\nexport function createProgram(): Command {\n const program = new Command()\n .name(\"keystroke\")\n .description(\"Build, run, and manage keystroke projects\")\n .version(readCliVersion())\n .option(\"--project <id>\", \"Platform project id (deploy target or one-off API target)\")\n .option(\"--local\", \"Force local keystroke server URL\")\n .hook(\"preAction\", (thisCommand) => {\n const opts = thisCommand.opts<{ project?: string; local?: boolean }>();\n setCliTargetOptions({\n projectId: opts.project,\n local: opts.local,\n });\n });\n\n registerAuthCommand(program);\n registerConnectCommand(program);\n registerConfigCommand(program);\n registerProjectCommand(program);\n registerCredentialsCommand(program);\n registerHealthCommand(program);\n registerInitCommand(program);\n registerBuildCommand(program);\n registerDeployCommand(program);\n registerDevCommand(program);\n registerStartCommand(program);\n registerAgentCommand(program);\n registerWorkflowCommand(program);\n registerTriggerCommand(program);\n return program;\n}\n\nexport async function runCli(argv: string[]): Promise<void> {\n const { maybeAutoUpdate } = await import(\"./update/maybe-auto-update\");\n await maybeAutoUpdate(argv);\n createProgram().parse(argv);\n}\n","import { runCli } from \"./program\";\n\nawait runCli(process.argv);\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAOA,IAAa,UAAb,cAA6B,MAAM;CAC/B,OAAO;CACP,IAAI,YAAY;EACZ,OAAO;CACX;AACJ;;;;;;;;;;;;ACFA,IAAa,YAAb,cAA+B,QAAQ;CACnC,OAAO;CACP;CACA;CACA;CACA;CACA,YAAY,UAAU,SAAS,SAAS;EAGpC,MAAM,SAAS,GAFD,SAAS,UAAU,SAAS,WAAW,IAAK,SAAS,SAAS,GAErD,GADT,SAAS,cAAc,KACH,KAAK;EACvC,MAAM,SAAS,SAAS,eAAe,WAAW;EAClD,MAAM,uBAAuB,OAAO,IAAI,QAAQ,OAAO,GAAG,QAAQ,KAAK;EACvE,KAAK,WAAW;EAChB,KAAK,UAAU;EACf,KAAK,UAAU;CACnB;AACJ;;;;;;;;;;AClBA,IAAa,eAAb,cAAkC,QAAQ;CACtC,OAAO;CACP;CACA,YAAY,SAAS,SAAS;EAC1B,MAAM,0CAA0C,QAAQ,OAAO,GAAG,QAAQ,OAAO,OAAO;EACxF,KAAK,UAAU;CACnB;AACJ;;;;;;;;ACVA,IAAa,WAAb,cAA8B,MAAM;CAChC,OAAO;CACP;CACA,YAAY,OAAO;EACf,IAAI,UAAU;EAEd,IAAI;GACA,IAAI,OAAO,UAAU,UACjB,UAAU;QAET,IAAI,SAAS,OAAO,UAAU,YAAY,aAAa,SAAS,OAAO,MAAM,YAAY,UAC1F,UAAU,MAAM;EAExB,QACM,CAEN;EACA,MAAM,OAAO;EACb,KAAK,QAAQ;CAC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CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,0BAA0B;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,oBAAoB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;AAKA,MAAM,8BAA8B,IAAI,IAAI;CAC3C,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACJ,CAAC;;;;;;;;;AASD,MAAM,yBAAyBC,OAAS,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,GAAG,oCAAoC,EAAE,IAAI,IAAI,oCAAoC,EAAE,MAAM,8BAA8B,iDAAiD;;;;;;;AAO/O,MAAM,k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AAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,aAAa;EACb,UAAU;CACX;AACD;AACA,MAAM,+BAA+B;CACpC,aAAa;CACb,aAAa;CACb,cAAc;CACd,iBAAiB;CACjB,aAAa;CACb,cAAc;CACd,gBAAgB;CAChB,qBAAqB;CACrB,oBAAoB;CACpB,uBAAuB;CACvB,cAAc;CACd,cAAc;CACd,YAAY;CACZ,aAAa;CACb,cAAc;CACd,eAAe;CACf,cAAc;CACd,eAAe;CACf,uBAAuB;CACvB,mBAAmB;CACnB,gBAAgB;CAChB,gBAAgB;CAChB,eAAe;CACf,kBAAkB;CAClB,iBAAiB;CACjB,gBAAgB;CAChB,eAAe;CACf,iBAAiB;C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AAe;CACf,eAAe;CACf,cAAc;CACd,cAAc;CACd,eAAe;CACf,iBAAiB;CACjB,iBAAiB;CACjB,WAAW;CACX,eAAe;AAChB;AACA,MAAM,iCAAiC;CACtC,IAAI;CACJ,UAAU;CACV,eAAe;CACf,KAAK;CACL,MAAM;CACN,QAAQ;CACR,aAAa;CACb,WAAW;CACX,OAAO;CACP,SAAS;CACT,OAAO;CACP,IAAI;CACJ,gBAAgB;CAChB,WAAW;CACX,eAAe;CACf,cAAc;CACd,sBAAsB;CACtB,QAAQ;CACR,SAAS;AACV;AACA,SAAS,4BAA4B,KAAK;CACzC,MAAM,WAAW,6BAA6B,IAAI;CAClD,IAAI,UAAU,OAAO;CACrB,MAAM,kBAAkB,+BAA+B,IAAI,aAAa;CACxE,OAAO,WAAW,IAAI,KAAK,8EAA8E,IAAI,SAAS,YAAY,EAAE,WAAW,IAAI,YAAY,yCAAyC,gBAAgB;AACzN;AACA,MAAM,mCAAmC;CACxC,OAAO;CACP,SAAS;AACV;AACA,MAAM,gCAAgC;CACrC,aAAa;EACZ;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;CACD;CACA,aAAa;EACZ;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa,iCAAiC;EAC/C;EACA;GACC,MAAM;GACN,aAAa,iCAAiC;EAC/C;CACD;CACA,cAAc;EACb;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;CACD;CACA,cAAc;EACb;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;EACA;GACC,MAAM;GACN,aAAa;EACd;CACD;AACD;AACA,SAAS,qBAAqB,KAAK;CAClC,OAAO;EACN,GAAG;EACH,wBAAwB,4BAA4B,GAAG;EACvD,aAAa,8BAA8B,IAAI,OAAO,CAAC;CACxD;AACD;;;;;;AAMA,MAAM,iBAAiB,iBAAiB,IAAI,oBAAoB;AAChE,MAAM,eAAe;CACpB;CACA;CACA;CACA;AACD;AACA,MAAM,eAAe;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;;AAMA,MAAM,iBAAiB;CACtB;EACC,IAAI;EACJ,OAAO;EACP,SAAS;EACT,OAAO;EACP,OAAO;EACP,WAAW;EACX,QAAQ;EACR,gBAAgB;EAChB,WAAW;EACX,YAAY;EACZ,iBAAiB;EACjB,WAAW;EACX,eAAe;EACf,aAAa;EACb,WAAW;CACZ;C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IACP,aAAa;IACb,UAAU;IACV,MAAM;IACN,UAAU;GACX;GACA;IACC,KAAK;IACL,OAAO;IACP,aAAa;IACb,MAAM;IACN,UAAU;GACX;GACA;IACC,KAAK;IACL,OAAO;IACP,aAAa;IACb,UAAU;IACV,MAAM;IACN,UAAU;GACX;EACD;EACA,cAAc;GACb,UAAU;GACV,WAAW;GACX,OAAO;GACP,QAAQ;GACR,WAAW;GACX,KAAK;EACN;EACA,gBAAgB;GACf;GACA;GACA;EACD;EACA,cAAc;GACb,UAAU;GACV,QAAQ;EACT;EACA,iBAAiB;EACjB,0BAA0B;EAC1B,SAAS;CACV;CACA;EACC,KAAK;EACL,MAAM;EACN,WAAW;EACX,gBAAgB;EAChB,aAAa;EACb,SAAS;EACT,UAAU;EACV,kBAAkB,CAAC;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,UAAU;GACV,MAAM;GACN,UAAU;EACX,GAAG;GACF,KAAK;GACL,OAAO;GACP,aAAa;GACb,MAAM;GACN,UAAU;GACV,QAAQ;EACT,CAAC;EACD,cAAc;GACb,UAAU;GACV,WAAW;GACX,OAAO;GACP,QAAQ;GACR,WAAW;GACX,KAAK;EACN;EACA,gBAAgB;GACf;GACA;GACA;EACD;EACA,cAAc;GACb,UAAU;GACV,QAAQ;EACT;EACA,iBAAiB;EACjB,0BAA0B;EAC1B,SAAS;CACV;CACA;EACC,KAAK;EACL,MAAM;EACN,WAAW;EACX,gBAAgB;EAChB,aAAa;EACb,SAAS;EACT,UAAU;EACV,kBAAkB;GACjB;IACC,KAAK;IACL,OAAO;IACP,aAAa;IACb,MAAM;IACN,UAAU;GACX;GACA;IACC,KAAK;IACL,OAAO;IACP,aAAa;IACb,MAAM;IACN,UAAU;GACX;GACA;IACC,KAAK;IACL,OAAO;IACP,aAAa;IACb,MAAM;IACN,UAAU;GACX;EACD;EACA,cAAc;GACb,UAAU;GACV,WAAW;GACX,OAAO;GACP,QAAQ;GACR,WAAW;GACX,KAAK;EACN;EACA,gBAAgB;GACf;GACA;GACA;EACD;EACA,cAAc;GACb,UAAU;GACV,QAAQ;EACT;EACA,iBAAiB;EACjB,0BAA0B;EAC1B,SAAS;CACV;CACA;EACC,KAAK;EACL,MAAM;EACN,WAAW;EACX,gBAAgB;EAChB,aAAa;EACb,SAAS;EACT,UAAU;EACV,kBAAkB,CAAC;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,UAAU;GACV,MAAM;GACN,UAAU;EACX,GAAG;GACF,KAAK;GACL,OAAO;GACP,aAAa;GACb,MAAM;GACN,UAAU;EACX,CAAC;EACD,cAAc;GACb,UAAU;GACV,WAAW;GACX,OAAO;GACP,QAAQ;GACR,WAAW;GACX,KAAK;EACN;EACA,gBAAgB;GACf;GACA;GACA;EACD;EACA,cAAc;GACb,UAAU;GACV,QAAQ;EACT;EACA,iBAAiB;EACjB,0BAA0B;EAC1B,SAAS;CACV;AACD;AACA,SAAS,mBAAmB,KAAK;CAChC,OAAO,kBAAkB,MAAM,aAAa,SAAS,QAAQ,GAAG;AACjE;AACA,MAAM,oBAAoB;CACzB,OAAO;EACN;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;GACb,YAAY;EACb;CACD;CACA,SAAS;EACR;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa;EACd;EACA;GACC,IAAI;GACJ,MAAM;GACN,MAAM;GACN,aAAa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