import { Stats } from "node:fs";
import { rename } from "node:fs/promises";
import { ChildProcess, ChildProcessWithoutNullStreams, execFile, spawn } from "node:child_process";
import { Readable } from "node:stream";
import WebSocket, { ClientOptions } from "ws";
declare namespace json_schema_d_exports {
  export { ArraySchema, BaseSchema, BooleanSchema, IntegerSchema, JSONSchema, NullSchema, NumberSchema, ObjectSchema, Schema$1 as Schema, SchemaType, StringSchema, _JSONSchema };
}
type Schema$1 = ObjectSchema | ArraySchema | StringSchema | NumberSchema | IntegerSchema | BooleanSchema | NullSchema;
type _JSONSchema = boolean | JSONSchema;
type SchemaType = "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
type JSONSchema = {
  [k: string]: unknown;
  $schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
  $id?: string;
  $anchor?: string;
  $ref?: string;
  $dynamicRef?: string;
  $dynamicAnchor?: string;
  $vocabulary?: Record<string, boolean>;
  $comment?: string;
  $defs?: Record<string, JSONSchema>;
  type?: SchemaType | SchemaType[];
  additionalItems?: _JSONSchema;
  unevaluatedItems?: _JSONSchema;
  prefixItems?: _JSONSchema[];
  items?: _JSONSchema | _JSONSchema[];
  contains?: _JSONSchema;
  additionalProperties?: _JSONSchema;
  unevaluatedProperties?: _JSONSchema;
  properties?: Record<string, _JSONSchema>;
  patternProperties?: Record<string, _JSONSchema>;
  dependentSchemas?: Record<string, _JSONSchema>;
  propertyNames?: _JSONSchema;
  if?: _JSONSchema;
  then?: _JSONSchema;
  else?: _JSONSchema;
  allOf?: JSONSchema[];
  anyOf?: JSONSchema[];
  oneOf?: JSONSchema[];
  not?: _JSONSchema;
  multipleOf?: number;
  maximum?: number;
  exclusiveMaximum?: number | boolean;
  minimum?: number;
  exclusiveMinimum?: number | boolean;
  maxLength?: number;
  minLength?: number;
  pattern?: string;
  maxItems?: number;
  minItems?: number;
  uniqueItems?: boolean;
  maxContains?: number;
  minContains?: number;
  maxProperties?: number;
  minProperties?: number;
  required?: string[];
  dependentRequired?: Record<string, string[]>;
  enum?: Array<string | number | boolean | null>;
  const?: string | number | boolean | null;
  id?: string;
  title?: string;
  description?: string;
  default?: unknown;
  deprecated?: boolean;
  readOnly?: boolean;
  writeOnly?: boolean;
  nullable?: boolean;
  examples?: unknown[];
  format?: string;
  contentMediaType?: string;
  contentEncoding?: string;
  contentSchema?: JSONSchema;
  _prefault?: unknown;
};
type BaseSchema = JSONSchema;
interface ObjectSchema extends JSONSchema {
  type: "object";
}
interface ArraySchema extends JSONSchema {
  type: "array";
}
interface StringSchema extends JSONSchema {
  type: "string";
}
interface NumberSchema extends JSONSchema {
  type: "number";
}
interface IntegerSchema extends JSONSchema {
  type: "integer";
}
interface BooleanSchema extends JSONSchema {
  type: "boolean";
}
interface NullSchema extends JSONSchema {
  type: "null";
}
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/standard-schema.d.cts
/** The Standard interface. */
interface StandardTypedV1<Input = unknown, Output = Input> {
  /** The Standard properties. */
  readonly "~standard": StandardTypedV1.Props<Input, Output>;
}
declare namespace StandardTypedV1 {
  /** The Standard properties interface. */
  interface Props<Input = unknown, Output = Input> {
    /** The version number of the standard. */
    readonly version: 1;
    /** The vendor name of the schema library. */
    readonly vendor: string;
    /** Inferred types associated with the schema. */
    readonly types?: Types<Input, Output> | undefined;
  }
  /** The Standard types interface. */
  interface Types<Input = unknown, Output = Input> {
    /** The input type of the schema. */
    readonly input: Input;
    /** The output type of the schema. */
    readonly output: Output;
  }
  /** Infers the input type of a Standard. */
  type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
  /** Infers the output type of a Standard. */
  type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
}
/** The Standard Schema interface. */
interface StandardSchemaV1<Input = unknown, Output = Input> {
  /** The Standard Schema properties. */
  readonly "~standard": StandardSchemaV1.Props<Input, Output>;
}
declare namespace StandardSchemaV1 {
  /** The Standard Schema properties interface. */
  interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
    /** Validates unknown input values. */
    readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
  }
  /** The result interface of the validate function. */
  type Result<Output> = SuccessResult<Output> | FailureResult;
  /** The result interface if validation succeeds. */
  interface SuccessResult<Output> {
    /** The typed output value. */
    readonly value: Output;
    /** The absence of issues indicates success. */
    readonly issues?: undefined;
  }
  interface Options {
    /** Implicit support for additional vendor-specific parameters, if needed. */
    readonly libraryOptions?: Record<string, unknown> | undefined;
  }
  /** The result interface if validation fails. */
  interface FailureResult {
    /** The issues of failed validation. */
    readonly issues: ReadonlyArray<Issue>;
  }
  /** The issue interface of the failure output. */
  interface Issue {
    /** The error message of the issue. */
    readonly message: string;
    /** The path of the issue, if any. */
    readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
  }
  /** The path segment interface of the issue. */
  interface PathSegment {
    /** The key representing a path segment. */
    readonly key: PropertyKey;
  }
  /** The Standard types interface. */
  interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
  /** Infers the input type of a Standard. */
  type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
  /** Infers the output type of a Standard. */
  type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
}
/** The Standard JSON Schema interface. */
interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
  /** The Standard JSON Schema properties. */
  readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
}
declare namespace StandardJSONSchemaV1 {
  /** The Standard JSON Schema properties interface. */
  interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
    /** Methods for generating the input/output JSON Schema. */
    readonly jsonSchema: Converter;
  }
  /** The Standard JSON Schema converter interface. */
  interface Converter {
    /** Converts the input type to JSON Schema. May throw if conversion is not supported. */
    readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
    /** Converts the output type to JSON Schema. May throw if conversion is not supported. */
    readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
  }
  /** The target version of the generated JSON Schema.
   *
   * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use.
   *
   * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
   *
   * All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
   */
  type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string);
  /** The options for the input/output methods. */
  interface Options {
    /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */
    readonly target: Target;
    /** Implicit support for additional vendor-specific parameters, if needed. */
    readonly libraryOptions?: Record<string, unknown> | undefined;
  }
  /** The Standard types interface. */
  interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
  /** Infers the input type of a Standard. */
  type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
  /** Infers the output type of a Standard. */
  type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
}
interface StandardSchemaWithJSONProps<Input = unknown, Output = Input> extends StandardSchemaV1.Props<Input, Output>, StandardJSONSchemaV1.Props<Input, Output> {}
declare namespace registries_d_exports {
  export { $ZodRegistry, $input, $output, $replace, GlobalMeta, JSONSchemaMeta, globalRegistry, registry };
}
declare const $output: unique symbol;
type $output = typeof $output;
declare const $input: unique symbol;
type $input = typeof $input;
type $replace<Meta, S extends $ZodType> = Meta extends $output ? output$1<S> : Meta extends $input ? input$1<S> : Meta extends (infer M)[] ? $replace<M, S>[] : Meta extends ((...args: infer P) => infer R) ? (...args: { [K in keyof P]: $replace<P[K], S>; }) => $replace<R, S> : Meta extends object ? { [K in keyof Meta]: $replace<Meta[K], S>; } : Meta;
type MetadataType = object | undefined;
declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
  _meta: Meta;
  _schema: Schema;
  _map: WeakMap<Schema, $replace<Meta, Schema>>;
  _idmap: Map<string, Schema>;
  add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;
  clear(): this;
  remove(schema: Schema): this;
  get<S extends Schema>(schema: S): $replace<Meta, S> | undefined;
  has(schema: Schema): boolean;
}
interface JSONSchemaMeta {
  id?: string | undefined;
  title?: string | undefined;
  description?: string | undefined;
  deprecated?: boolean | undefined;
  [k: string]: unknown;
}
interface GlobalMeta extends JSONSchemaMeta {}
declare function registry<T extends MetadataType = MetadataType, S extends $ZodType = $ZodType>(): $ZodRegistry<T, S>;
declare const globalRegistry: $ZodRegistry<GlobalMeta>;
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/to-json-schema.d.cts
type Processor<T extends $ZodType = $ZodType> = (schema: T, ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void;
/**
 * Called for each schema that has no JSON Schema equivalent. Return a JSON Schema to use in its
 * place, `"any"` to fall back to the `unrepresentable: "any"` behavior, or `"throw"`/`undefined` to
 * throw the default error. Throwing from the handler propagates, so custom errors work too.
 */
type UnrepresentableHandler<T extends $ZodType = $ZodType> = (ctx: {
  zodSchema: T;
  path: (string | number)[];
  /** The error Zod would throw. Distinguishes sites that share a `zodSchema`, e.g. an `undefined`
   *  vs a `bigint` member of the same literal. */
  message: string;
}) => BaseSchema | "throw" | "any" | undefined;
interface JSONSchemaGeneratorParams {
  processors: Record<string, Processor>;
  /** A registry used to look up metadata for each schema. Any schema with an `id` property will be extracted as a $def.
   *  @default globalRegistry */
  metadata?: $ZodRegistry<Record<string, any>>;
  /** The JSON Schema version to target.
   * - `"draft-2020-12"` — Default. JSON Schema Draft 2020-12
   * - `"draft-07"` — JSON Schema Draft 7
   * - `"draft-04"` — JSON Schema Draft 4
   * - `"openapi-3.0"` — OpenAPI 3.0 Schema Object */
  target?: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string) | undefined;
  /** How to handle unrepresentable types.
   * - `"throw"` — Default. Unrepresentable types throw an error
   * - `"any"` — Unrepresentable types become `{}`
   * - A function — called once per unrepresentable schema; see {@link UnrepresentableHandler}. */
  unrepresentable?: "throw" | "any" | UnrepresentableHandler<$ZodTypes>;
  /** Arbitrary custom logic that can be used to modify the generated JSON Schema. */
  override?: (ctx: {
    zodSchema: $ZodTypes;
    jsonSchema: BaseSchema;
    path: (string | number)[];
  }) => void;
  /** Whether to extract the `"input"` or `"output"` type. Relevant to transforms, defaults, coerced primitives, etc.
   * - `"output"` — Default. Convert the output schema.
   * - `"input"` — Convert the input schema. */
  io?: "input" | "output";
  cycles?: "ref" | "throw";
  reused?: "ref" | "inline";
  external?: {
    registry: $ZodRegistry<{
      id?: string | undefined;
    }>;
    uri?: ((id: string) => string) | undefined;
    defs: Record<string, BaseSchema>;
  } | undefined;
}
/**
 * Parameters for the toJSONSchema function.
 */
type ToJSONSchemaParams = Omit<JSONSchemaGeneratorParams, "processors" | "external">;
/**
 * Parameters for the toJSONSchema function when passing a registry.
 */
interface RegistryToJSONSchemaParams extends ToJSONSchemaParams {
  uri?: (id: string) => string;
}
interface ProcessParams {
  schemaPath: $ZodType[];
  path: (string | number)[];
}
interface Seen {
  /** JSON Schema result for this Zod schema */
  schema: BaseSchema;
  /** A cached version of the schema that doesn't get overwritten during ref resolution */
  def?: BaseSchema;
  defId?: string | undefined;
  /** Number of times this schema was encountered during traversal */
  count: number;
  /** Cycle path */
  cycle?: (string | number)[] | undefined;
  isParent?: boolean | undefined;
  /** Schema to inherit JSON Schema properties from (set by processor for wrappers) */
  ref?: $ZodType | null;
  /** JSON Schema property path for this schema */
  path?: (string | number)[] | undefined;
}
interface ToJSONSchemaContext {
  processors: Record<string, Processor>;
  metadataRegistry: $ZodRegistry<Record<string, any>>;
  target: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string);
  unrepresentable: "throw" | "any" | UnrepresentableHandler;
  override: (ctx: {
    zodSchema: $ZodType;
    jsonSchema: BaseSchema;
    path: (string | number)[];
  }) => void;
  io: "input" | "output";
  counter: number;
  seen: Map<$ZodType, Seen>;
  /** Registry conversions share one `seen` map across every emitted schema. These hold the
   * `external` the whole-map passes below last ran for, so the passes are not repeated once per
   * schema — and still re-run if the map grows or `external` is swapped. `sharedEmitDoneFor`
   * covers both passes in `finalize`: the ref flattening and the `$defs` build.
   *
   * The passes are valid only while nothing they read has changed, so both are cleared in
   * `process()` when the map grows, and in `JSONSchemaGenerator.emit()`, which can also change
   * the `cycles` and `reused` they branch on.
   *
   * One case is deliberately not covered: an `override` callback that writes to
   * `metadataRegistry` mid-conversion. It runs inside `finalize`, so a registry conversion has
   * nowhere left to clear the guards, and later schemas keep the ids the first pass saw. That
   * output was never coherent — before this, whether a shared subschema was inlined or extracted
   * depended on which registry entry happened to be emitted when the callback fired. */
  sharedDefsExtractedFor?: ToJSONSchemaContext["external"];
  sharedEmitDoneFor?: ToJSONSchemaContext["external"];
  cycles: "ref" | "throw";
  reused: "ref" | "inline";
  /** The `allOf` array of each intersection encountered during traversal, innermost first. `finalize` folds every emitted object holding one; see `foldIntersection`. */
  intersections: BaseSchema[][];
  /** Rewrites a processor deferred to `finalize`, where the flatten has resolved every ref and the union branches are in place. */
  deferred: (() => void)[];
  external?: {
    registry: $ZodRegistry<{
      id?: string | undefined;
    }>;
    uri?: ((id: string) => string) | undefined;
    defs: Record<string, BaseSchema>;
  } | undefined;
}
declare function initializeContext(params: JSONSchemaGeneratorParams): ToJSONSchemaContext;
/**
 * Applies the `unrepresentable` setting at a site that has no JSON Schema equivalent. Throws
 * `message` unless the setting (or the handler's return value) says otherwise. Returns `true` if a
 * custom JSON Schema was written into `json`, in which case the caller must not write its own.
 */
declare function handleUnrepresentable(schema: $ZodType, ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams, message: string): boolean;
declare function process<T extends $ZodType>(schema: T, ctx: ToJSONSchemaContext, _params?: ProcessParams): BaseSchema;
declare function extractDefs<T extends $ZodType>(ctx: ToJSONSchemaContext, schema: T): void;
declare function finalize<T extends $ZodType>(ctx: ToJSONSchemaContext, schema: T): ZodStandardJSONSchemaPayload<T>;
type ZodStandardSchemaWithJSON$1<T> = StandardSchemaWithJSONProps<input$1<T>, output$1<T>>;
interface ZodStandardJSONSchemaPayload<T> extends BaseSchema {
  "~standard": ZodStandardSchemaWithJSON$1<T>;
}
/**
 * Creates a toJSONSchema method for a schema instance.
 * This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.
 */
declare const createToJSONSchemaMethod: <T extends $ZodType>(schema: T, processors?: Record<string, Processor>) => (params?: ToJSONSchemaParams) => ZodStandardJSONSchemaPayload<T>;
/**
 * Creates a toJSONSchema method for a schema instance.
 * This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.
 */
type StandardJSONSchemaMethodParams = Parameters<StandardJSONSchemaV1["~standard"]["jsonSchema"]["input"]>[0];
declare const createStandardJSONSchemaMethod: <T extends $ZodType>(schema: T, io: "input" | "output", processors?: Record<string, Processor>) => (params?: StandardJSONSchemaMethodParams) => BaseSchema;
declare namespace util_d_exports {
  export { AnyFunc, AssertEqual, AssertExtends, AssertNotEqual, BIGINT_FORMAT_RANGES, BuiltIn, CONSTANT_CATCH, Class, CleanKey, Constructor, EmptyObject, EmptyToNever, EnumLike, EnumValue, Exactly, Extend, ExtractIndexSignature, Flatten, FromCleanMap, HasLength, HasSize, HashAlgorithm, HashEncoding, HashFormat, IPVersion, Identity, InexactPartial, IsAny, IsProp, JSONType, JWTAlgorithm, KeyOf, Keys, KeysArray, KeysEnum, Literal, LiteralArray, LoosePartial, MakePartial, MakeReadonly, MakeRequired, Mapped, Mask, MaybeAsync, MimeTypes, NUMBER_FORMAT_RANGES, NoNever, NoNeverKeys, NoUndefined, Normalize, Numeric, Omit$1 as Omit, OmitIndexSignature, OmitKeys, ParsedTypes, Prettify, Primitive, PrimitiveArray, PrimitiveSet, PropValues, ProtoOf, SafeParseError, SafeParseResult, SafeParseSuccess, SchemaClass, SomeObject, ToCleanMap, ToEnum, TupleItems, Whatever, Writeable, aborted, allowsEval, assert, assertEqual, assertIs, assertNever, assertNotEqual, assignProp, attachSchema, base64ToUint8Array, base64urlToUint8Array, cached, captureStackTrace, cleanEnum, cleanRegex, clone, cloneDef, codePointLength, constantCatch, createTransparentProxy, defineLazy, defineLazyInternal, esc, escapeRegex, explicitlyAborted, extend, finalizeIssue, floatSafeRemainder, getElementAtPath, getEnumValues, getLengthableOrigin, getParsedType, getSizableOrigin, hexToUint8Array, hide, installLazyProp, isObject, isPlainObject, issue, joinValues, jsonStringifyReplacer, members, merge, mergeDefs, normalizeParams, nullish$1 as nullish, numKeys, objectClone, omit, optionalKeys, own, parsedType, partial, pick, prefixIssues, primitiveTypes, promiseAllObject, propertyKeyTypes, randomString, required, safeExtend, shallowClone, slugify, stringifyPrimitive, toZod, uint8ArrayToBase64, uint8ArrayToBase64url, uint8ArrayToHex, unwrapMessage };
}
type JSONType = string | number | boolean | null | JSONType[] | {
  [key: string]: JSONType;
};
type JWTAlgorithm = "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "EdDSA" | (string & {});
type HashAlgorithm = "md5" | "sha1" | "sha256" | "sha384" | "sha512";
type HashEncoding = "hex" | "base64" | "base64url";
type HashFormat = `${HashAlgorithm}_${HashEncoding}`;
type IPVersion = "v4" | "v6";
type MimeTypes = "application/json" | "application/xml" | "application/x-www-form-urlencoded" | "application/javascript" | "application/pdf" | "application/zip" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/octet-stream" | "application/graphql" | "text/html" | "text/plain" | "text/css" | "text/javascript" | "text/csv" | "image/png" | "image/jpeg" | "image/gif" | "image/svg+xml" | "image/webp" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "video/mp4" | "video/webm" | "video/ogg" | "font/woff" | "font/woff2" | "font/ttf" | "font/otf" | "multipart/form-data" | (string & {});
type ParsedTypes = "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "file" | "date" | "array" | "map" | "set" | "nan" | "null" | "promise";
type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends (<V>() => V extends U ? 1 : 2) ? true : false;
type AssertNotEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends (<V>() => V extends U ? 1 : 2) ? false : true;
type AssertExtends<T, U> = T extends U ? T : never;
type ToZodMismatch<T, S extends $ZodType> = {
  "types do not match": {
    expected: T;
    received: S["_zod"]["output"];
  };
};
type ToZodKeyMismatch<Expected, Received> = $ZodType & {
  "types do not match": {
    expected: Expected;
    received: Received;
  };
};
type ToZodShape<Shape, T> = { [K in keyof Shape]: Shape[K] extends $ZodType ? K extends keyof T ? AssertEqual<Shape[K]["_zod"]["output"], T[K]> extends true ? Shape[K] : ToZodKeyMismatch<T[K], Shape[K]["_zod"]["output"]> : ToZodKeyMismatch<never, Shape[K]["_zod"]["output"]> : Shape[K]; } & { [K in Exclude<keyof T, keyof Shape>]: ToZodKeyMismatch<T[K], never>; };
type ToZodExpand<X> = { [K in keyof X]: X[K]; } & {};
type ToZodTarget<S extends $ZodType, T> = S extends $ZodObject<infer Shape, infer Config> ? T extends object ? AssertEqual<ToZodExpand<ToZodShape<Shape, T>>, ToZodExpand<Shape>> extends true ? S & ToZodMismatch<T, S> : $ZodObject<ToZodExpand<ToZodShape<Shape, T>>, Config> : S & ToZodMismatch<T, S> : S & ToZodMismatch<T, S>;
type IsAny<T> = 0 extends 1 & T ? true : false;
type Omit$1<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
type MakePartial<T, K extends keyof T> = Omit$1<T, K> & InexactPartial<Pick<T, K>>;
type MakeRequired<T, K extends keyof T> = Omit$1<T, K> & Required<Pick<T, K>>;
type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
type NoUndefined<T> = T extends undefined ? never : T;
type Whatever = {} | undefined | null;
type LoosePartial<T extends object> = InexactPartial<T> & {
  [k: string]: unknown;
};
type Mask<Keys extends PropertyKey> = { [K in Keys]?: true; };
type Writeable<T> = { -readonly [P in keyof T]: T[P]; } & {};
type InexactPartial<T> = { [P in keyof T]?: T[P] | undefined; };
type EmptyObject = Record<string, never>;
type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
  readonly [Symbol.toStringTag]: string;
} | Date | Error | Generator | Promise<unknown> | RegExp;
type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
type SomeObject = Record<PropertyKey, any>;
type Identity<T> = T;
type Flatten<T> = Identity<{ [k in keyof T]: T[k]; }>;
type Mapped<T> = { [k in keyof T]: T[k]; };
type Prettify<T> = { [K in keyof T]: T[K]; } & {};
type NoNeverKeys<T> = { [k in keyof T]: [T[k]] extends [never] ? never : k; }[keyof T];
type NoNever<T> = Identity<{ [k in NoNeverKeys<T>]: k extends keyof T ? T[k] : never; }>;
type Extend<A extends SomeObject, B extends SomeObject> = Flatten<keyof A & keyof B extends never ? A & B : { [K in keyof A as K extends keyof B ? never : K]: A[K]; } & { [K in keyof B]: B[K]; }>;
type TupleItems = ReadonlyArray<SomeType>;
type AnyFunc = (...args: any[]) => any;
type IsProp<T, K extends keyof T> = T[K] extends AnyFunc ? never : K;
type MaybeAsync<T> = T | Promise<T>;
type KeyOf<T> = keyof OmitIndexSignature<T>;
type OmitIndexSignature<T> = { [K in keyof T as string extends K ? never : K extends string ? K : never]: T[K]; };
type ExtractIndexSignature<T> = { [K in keyof T as string extends K ? K : K extends string ? never : K]: T[K]; };
type Keys<T extends object> = keyof OmitIndexSignature<T>;
type SchemaClass<T extends SomeType> = {
  new (def: T["_zod"]["def"]): T;
};
type EnumValue = string | number;
type EnumLike = Readonly<Record<string, EnumValue>>;
type ToEnum<T extends EnumValue> = Flatten<{ [k in T]: k; }>;
type KeysEnum<T extends object> = ToEnum<Exclude<keyof T, symbol>>;
type KeysArray<T extends object> = Flatten<(keyof T & string)[]>;
type Literal = string | number | bigint | boolean | null | undefined;
type LiteralArray = Array<Literal>;
type Primitive = string | number | symbol | bigint | boolean | null | undefined;
type PrimitiveArray = Array<Primitive>;
type HasSize = {
  size: number;
};
type HasLength = {
  length: number;
};
type Numeric = number | bigint | Date;
type SafeParseResult<T> = SafeParseSuccess<T> | SafeParseError<T>;
type SafeParseSuccess<T> = {
  success: true;
  data: T;
  error?: never;
};
type SafeParseError<T> = {
  success: false;
  data?: never;
  error: $ZodError<T>;
};
type PropValues = Record<string, Set<Primitive>>;
type PrimitiveSet = Set<Primitive>;
declare function assertEqual<A, B>(val: AssertEqual<A, B>): AssertEqual<A, B>;
declare function assertNotEqual<A, B>(val: AssertNotEqual<A, B>): AssertNotEqual<A, B>;
declare function toZod<T>(): <S extends $ZodType>(schema: AssertEqual<S["_zod"]["output"], T> extends true ? S : ToZodTarget<S, T>) => S;
declare function assertIs<T>(_arg: T): void;
declare function assertNever(_x: never): never;
declare function assert<T>(_: any): asserts _ is T;
declare function getEnumValues(entries: EnumLike): EnumValue[];
declare function joinValues<T extends Primitive[]>(array: T, separator?: string): string;
declare function jsonStringifyReplacer(_: string, value: any): any;
declare function cached<T>(getter: () => T): {
  value: T;
};
declare function nullish$1(input: any): boolean;
declare function cleanRegex(source: string): string;
declare function floatSafeRemainder(val: number, step: number): number;
declare function defineLazy<T, K extends keyof T>(object: T, key: K, getter: () => T[K]): void;
declare function objectClone(obj: object): any;
declare function assignProp<T extends object, K extends PropertyKey>(target: T, prop: K, value: K extends keyof T ? T[K] : any): void;
declare function mergeDefs(...defs: Record<string, any>[]): any;
declare function cloneDef(schema: $ZodType): any;
declare function getElementAtPath(obj: any, path: (string | number)[] | null | undefined): any;
declare function promiseAllObject<T extends object>(promisesObj: T): Promise<{ [k in keyof T]: Awaited<T[k]>; }>;
declare function randomString(length?: number): string;
declare function esc(str: string): string;
declare function slugify(input: string): string;
declare const captureStackTrace: (targetObject: object, constructorOpt?: Function) => void;
declare function isObject(data: any): data is Record<PropertyKey, unknown>;
declare const allowsEval: {
  value: boolean;
};
declare function isPlainObject(o: any): o is Record<PropertyKey, unknown>;
declare function shallowClone(o: any): any;
declare function numKeys(data: any): number;
declare const getParsedType: (data: any) => ParsedTypes;
declare const propertyKeyTypes: Set<string>;
declare const primitiveTypes: Set<string>;
declare function escapeRegex(str: string): string;
declare function clone<T extends $ZodType>(inst: T, def?: T["_zod"]["def"], params?: {
  parent: boolean;
}): T;
type EmptyToNever<T> = keyof T extends never ? never : T;
type Normalize<T> = T extends undefined ? never : T extends Record<any, any> ? Flatten<{ [k in keyof Omit$1<T, "error" | "message">]: T[k]; } & ("error" extends keyof T ? {
  error?: Exclude<T["error"], string>;
} : unknown)> : never;
declare function normalizeParams<T>(_params: T): Normalize<T>;
declare function createTransparentProxy<T extends object>(getter: () => T): T;
declare function stringifyPrimitive(value: any): string;
declare function optionalKeys(shape: $ZodShape): string[];
type CleanKey<T extends PropertyKey> = T extends `?${infer K}` ? K : T extends `${infer K}?` ? K : T;
type ToCleanMap<T extends $ZodLooseShape> = { [k in keyof T]: k extends `?${infer K}` ? K : k extends `${infer K}?` ? K : k; };
type FromCleanMap<T extends $ZodLooseShape> = { [k in keyof T as k extends `?${infer K}` ? K : k extends `${infer K}?` ? K : k]: k; };
declare const NUMBER_FORMAT_RANGES: Record<$ZodNumberFormats, [number, number]>;
declare const BIGINT_FORMAT_RANGES: Record<$ZodBigIntFormats, [bigint, bigint]>;
declare function pick(schema: $ZodObject, mask: Record<string, unknown>): any;
declare function omit(schema: $ZodObject, mask: object): any;
declare function extend(schema: $ZodObject, shape: $ZodShape): any;
declare function safeExtend(schema: $ZodObject, shape: $ZodShape): any;
declare function merge(a: $ZodObject, b: $ZodObject): any;
declare function partial(Class: SchemaClass<$ZodOptional> | null, schema: $ZodObject, mask: object | undefined, name?: string): any;
declare function required(Class: SchemaClass<$ZodNonOptional>, schema: $ZodObject, mask: object | undefined): any;
type Constructor<T, Def extends any[] = any[]> = new (...args: Def) => T;
declare function aborted(x: ParsePayload, startIndex?: number): boolean;
declare function explicitlyAborted(x: ParsePayload, startIndex?: number): boolean;
declare function prefixIssues(path: PropertyKey, issues: $ZodRawIssue[]): $ZodRawIssue[];
declare function unwrapMessage(message: string | {
  message: string;
} | undefined | null): string | undefined;
declare function attachSchema(issues: $ZodRawIssue[], start: number, inst: $ZodType): void;
declare function finalizeIssue(iss: $ZodRawIssue, ctx: ParseContextInternal | undefined, config: $ZodConfig): $ZodIssue;
declare function getSizableOrigin(input: any): "set" | "map" | "file" | "unknown";
declare function codePointLength(str: string): number;
declare function getLengthableOrigin(input: any): "array" | "string" | "unknown";
declare function parsedType(data: unknown): $ZodInvalidTypeExpected;
declare function issue(_iss: string, input: any, inst: any): $ZodRawIssue;
declare function issue(_iss: $ZodRawIssue): $ZodRawIssue;
declare function cleanEnum(obj: Record<string, EnumValue>): EnumValue[];
declare function base64ToUint8Array(base64: string): InstanceType<typeof Uint8Array>;
declare function uint8ArrayToBase64(bytes: Uint8Array): string;
declare function base64urlToUint8Array(base64url: string): InstanceType<typeof Uint8Array>;
declare function uint8ArrayToBase64url(bytes: Uint8Array): string;
declare function hexToUint8Array(hex: string): InstanceType<typeof Uint8Array>;
declare function uint8ArrayToHex(bytes: Uint8Array): string;
declare abstract class Class {
  constructor(..._args: any[]);
}
/**
 * Installs a trait's members on its prototype. Each value builds that member for the instance on first read; the built value shadows the accessor as an own property, so a detached `const { parse } = schema` keeps working.
 *
 * Call this from a `proto` initializer, which runs once per prototype — never per instance.
 */
declare function members(proto: object, table: object): void;
/** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */
declare function own<T>(inst: object, key: string, value: T, enumerable?: boolean): T;
/** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */
declare function hide<T>(inst: object, key: string, value: T): T;
/** A trait's prototype members: a partial view of its own interface, with `this` typed as the instance. */
type ProtoOf<T> = { [K in keyof T]?: (T[K] extends ((...args: infer A) => infer R) ? (...args: A) => R : T[K]) | undefined; } & ThisType<T>;
/**
 * Installs a lazily-derived internal on the `_zod` prototype of `inst`'s
 * constructor, computed from the internals object itself and cached there on
 * first read. One accessor per constructor rather than one per instance.
 */
declare function defineLazyInternal<T extends {
  _zod: any;
}>(inst: T, key: string, compute: (zod: T["_zod"]) => unknown): void;
/**
 * Installs `key` on `inst`'s prototype, computed by `make` on first read and cached there as an own
 * data property. One accessor per constructor rather than one per instance, because an own accessor
 * puts every instance after the first into v8 dictionary mode. The key doubles as the sentinel.
 */
declare function installLazyProp(inst: object, key: string, make: (self: any) => unknown, enumerable: boolean): void;
/** Marks the thunk `_catch` synthesises for a constant catch value. `Function.length` cannot tell that thunk from a user callback — rest and defaulted parameters both report arity 0 — and a user callback reads `ctx.error`, whose issues only finalize correctly against the caller's per-parse error map. Provenance can say what arity cannot. A plain string key rather than `Symbol.for`, whose call at module scope no bundler can prove pure — the same shape that anchored `urlCanParse` into every build. */
declare const CONSTANT_CATCH = "~constantCatch";
/** Wraps a constant catch value in a thunk tagged with {@link CONSTANT_CATCH}. */
declare function constantCatch<T>(value: T): () => T;
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/versions.d.cts
declare const version: {
  readonly major: 4;
  readonly minor: 5;
  readonly patch: number;
};
declare namespace schemas_d_exports$1 {
  export { $DiscriminatedOption, $DiscriminatorValue, $InferEnumInput, $InferEnumOutput, $InferInnerFunctionType, $InferInnerFunctionTypeAsync, $InferObjectInput, $InferObjectOutput, $InferOuterFunctionType, $InferOuterFunctionTypeAsync, $InferTupleInputType, $InferTupleOutputType, $InferUnionInput, $InferUnionOutput, $InferZodRecordInput, $InferZodRecordOutput, $PartsToTemplateLiteral, $ZodAny, $ZodAnyDef, $ZodAnyInternals, $ZodArray, $ZodArrayDef, $ZodArrayInternals, $ZodBase64, $ZodBase64Def, $ZodBase64Internals, $ZodBase64URL, $ZodBase64URLDef, $ZodBase64URLInternals, $ZodBigInt, $ZodBigIntDef, $ZodBigIntFormat, $ZodBigIntFormatDef, $ZodBigIntFormatInternals, $ZodBigIntInternals, $ZodBoolean, $ZodBooleanDef, $ZodBooleanInternals, $ZodCIDRv4, $ZodCIDRv4Def, $ZodCIDRv4Internals, $ZodCIDRv6, $ZodCIDRv6Def, $ZodCIDRv6Internals, $ZodCUID, $ZodCUID2, $ZodCUID2Def, $ZodCUID2Internals, $ZodCUIDDef, $ZodCUIDInternals, $ZodCatch, $ZodCatchCtx, $ZodCatchDef, $ZodCatchInternals, $ZodCodec, $ZodCodecDef, $ZodCodecInternals, $ZodCreditCard, $ZodCreditCardDef, $ZodCreditCardInternals, $ZodCustom, $ZodCustomDef, $ZodCustomInternals, $ZodCustomStringFormat, $ZodCustomStringFormatDef, $ZodCustomStringFormatInternals, $ZodDate, $ZodDateDef, $ZodDateInternals, $ZodDefault, $ZodDefaultDef, $ZodDefaultInternals, $ZodDiscriminatedUnion, $ZodDiscriminatedUnionDef, $ZodDiscriminatedUnionInternals, $ZodE164, $ZodE164Def, $ZodE164Internals, $ZodEmail, $ZodEmailDef, $ZodEmailInternals, $ZodEmoji, $ZodEmojiDef, $ZodEmojiInternals, $ZodEnum, $ZodEnumDef, $ZodEnumInternals, $ZodExactOptional, $ZodExactOptionalDef, $ZodExactOptionalInternals, $ZodFile, $ZodFileDef, $ZodFileInternals, $ZodFunction, $ZodFunctionArgs, $ZodFunctionDef, $ZodFunctionIn, $ZodFunctionInternals, $ZodFunctionOut, $ZodFunctionParams, $ZodGUID, $ZodGUIDDef, $ZodGUIDInternals, $ZodIPv4, $ZodIPv4Def, $ZodIPv4Internals, $ZodIPv6, $ZodIPv6Def, $ZodIPv6Internals, $ZodISODate, $ZodISODateDef, $ZodISODateInternals, $ZodISODateTime, $ZodISODateTimeDef, $ZodISODateTimeInternals, $ZodISODuration, $ZodISODurationDef, $ZodISODurationInternals, $ZodISOTime, $ZodISOTimeDef, $ZodISOTimeInternals, $ZodIntersection, $ZodIntersectionDef, $ZodIntersectionInternals, $ZodJWT, $ZodJWTDef, $ZodJWTInternals, $ZodKSUID, $ZodKSUIDDef, $ZodKSUIDInternals, $ZodLazy, $ZodLazyDef, $ZodLazyInternals, $ZodLiteral, $ZodLiteralDef, $ZodLiteralInternals, $ZodLooseShape, $ZodMAC, $ZodMACDef, $ZodMACInternals, $ZodMap, $ZodMapDef, $ZodMapInternals, $ZodMemoizer, $ZodNaN, $ZodNaNDef, $ZodNaNInternals, $ZodNanoID, $ZodNanoIDDef, $ZodNanoIDInternals, $ZodNever, $ZodNeverDef, $ZodNeverInternals, $ZodNonOptional, $ZodNonOptionalDef, $ZodNonOptionalInternals, $ZodNull, $ZodNullDef, $ZodNullInternals, $ZodNullable, $ZodNullableDef, $ZodNullableInternals, $ZodNumber, $ZodNumberDef, $ZodNumberFormat, $ZodNumberFormatDef, $ZodNumberFormatInternals, $ZodNumberInternals, $ZodObject, $ZodObjectConfig, $ZodObjectDef, $ZodObjectInternals, $ZodObjectJIT, $ZodOptional, $ZodOptionalDef, $ZodOptionalInternals, $ZodPipe, $ZodPipeDef, $ZodPipeInternals, $ZodPrefault, $ZodPrefaultDef, $ZodPrefaultInternals, $ZodPreprocess, $ZodPreprocessDef, $ZodPreprocessInternals, $ZodPromise, $ZodPromiseDef, $ZodPromiseInternals, $ZodReadonly, $ZodReadonlyDef, $ZodReadonlyInternals, $ZodRecord, $ZodRecordDef, $ZodRecordInternals, $ZodRecordKey, $ZodSet, $ZodSetDef, $ZodSetInternals, $ZodShape, $ZodStandardSchema, $ZodString, $ZodStringDef, $ZodStringFormat, $ZodStringFormatDef, $ZodStringFormatInternals, $ZodStringFormatTypes, $ZodStringInternals, $ZodSuccess, $ZodSuccessDef, $ZodSuccessInternals, $ZodSymbol, $ZodSymbolDef, $ZodSymbolInternals, $ZodTemplateLiteral, $ZodTemplateLiteralDef, $ZodTemplateLiteralInternals, $ZodTemplateLiteralPart, $ZodTransform, $ZodTransformDef, $ZodTransformInternals, $ZodTuple, $ZodTupleDef, $ZodTupleInternals, $ZodType, $ZodTypeDef, $ZodTypeInternals, $ZodTypes, $ZodULID, $ZodULIDDef, $ZodULIDInternals, $ZodURL, $ZodURLDef, $ZodURLInternals, $ZodUUID, $ZodUUIDDef, $ZodUUIDInternals, $ZodUndefined, $ZodUndefinedDef, $ZodUndefinedInternals, $ZodUnion, $ZodUnionDef, $ZodUnionInternals, $ZodUnknown, $ZodUnknownDef, $ZodUnknownInternals, $ZodVoid, $ZodVoidDef, $ZodVoidInternals, $ZodXID, $ZodXIDDef, $ZodXIDInternals, $ZodXor, $ZodXorInternals, $catchall, $loose, $partial, $strict, $strip, CheckFn, ConcatenateTupleOfStrings, ConvertPartsToStringTuple, File, ParseContext, ParseContextInternal, ParsePayload, SomeType, ToTemplateLiteral, URL_BAD_FORMAT, URL_UNPARSEABLE, _$ZodType, _$ZodTypeInternals, clone, getDiscriminatedOption, isValidBase64, isValidBase64URL, isValidCIDRv6, isValidCreditCard, isValidIPv6, isValidJWT, mergeValues, parseURLObject, standardProps, stripTabAndNewline, urlHostnameOk, urlProtocolOk };
}
interface ParseContext<T extends $ZodIssueBase = never> {
  /** Customize error messages. */
  readonly error?: $ZodErrorMap<T>;
  /** Include the `input` field in issue objects. Default `false`. */
  readonly reportInput?: boolean;
  /** Skip eval-based fast path. Default `false`. */
  readonly jitless?: boolean;
}
/** @internal */
interface ParseContextInternal<T extends $ZodIssueBase = never> extends ParseContext<T> {
  readonly async?: boolean | undefined;
  readonly direction?: "forward" | "backward";
  readonly skipChecks?: boolean;
}
/** Gives a container cycle support: `attach` wraps its parse, and `alloc` registers the object it builds into before any child is parsed so a reference back to the same input resolves to it. */
interface $ZodMemoizer {
  attach(inst: $ZodType): void;
  guard(inst: $ZodType): void;
  alloc<T extends object>(inst: $ZodType, payload: ParsePayload, empty: T, ctx: ParseContextInternal): T;
}
interface ParsePayload<T = unknown> {
  value: T;
  issues: $ZodRawIssue[];
  /** A way to mark a whole payload as aborted. Used in codecs/pipes. */
  aborted?: boolean;
  /** @internal Set when the value came from a repeat visit to a node still being
   * parsed. Its checks run on the node itself, against the finished value. */
  memo?: boolean | undefined;
}
type CheckFn<T> = (input: ParsePayload<T>) => MaybeAsync<void>;
interface $ZodTypeDef {
  type: "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "null" | "undefined" | "void" | "never" | "any" | "unknown" | "date" | "object" | "record" | "file" | "array" | "tuple" | "union" | "intersection" | "map" | "set" | "enum" | "literal" | "nullable" | "optional" | "nonoptional" | "success" | "transform" | "default" | "prefault" | "catch" | "nan" | "pipe" | "readonly" | "template_literal" | "promise" | "lazy" | "function" | "custom";
  error?: $ZodErrorMap<never> | undefined;
  checks?: $ZodCheck<never>[];
}
interface _$ZodTypeInternals {
  /** The `@zod/core` version of this schema */
  version: typeof version;
  /** Schema definition. */
  def: $ZodTypeDef;
  /** @internal Randomly generated ID for this schema. */
  /** @internal List of deferred initializers. */
  deferred: AnyFunc[] | undefined;
  /** @internal Parses input and runs all checks (refinements). */
  run(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
  /** @internal Parses input, doesn't run checks. */
  parse(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
  /** @internal  Stores identifiers for the set of traits implemented by this schema. */
  traits: Set<string>;
  /** @internal Indicates that a schema output type should be considered optional inside objects.
   * @default Required
   */
  /** @internal Three rungs, each strictly stronger than the last:
   *   undefined    — required; the container may not omit this slot
   *   "optional"   — the container may omit it; nothing is supplied in its place
   *   "defaulted"  — the container may omit it AND this schema substitutes a value
   * Consumers asking "may the slot be absent?" test `!== undefined`.
   * $ZodOptional asks the stronger question and tests `=== "defaulted"`. */
  optin?: "optional" | "defaulted" | undefined;
  /** @internal */
  optout?: "optional" | undefined;
  /** @internal The set of literal values that will pass validation. Must be an exhaustive set. Used to determine optionality in z.record().
   *
   * Defined on: enum, const, literal, null, undefined
   * Passthrough: optional, nullable, branded, default, catch, pipe
   * Todo: unions?
   */
  values?: PrimitiveSet | undefined;
  /** Default value bubbled up from  */
  /** @internal A set of literal discriminators used for the fast path in discriminated unions. */
  propValues?: PropValues | undefined;
  /** @internal This flag indicates that a schema validation can be represented with a regular expression. Used to determine allowable schemas in z.templateLiteral(). */
  pattern: RegExp | undefined;
  /** @internal The constructor function of this schema. */
  constr: new (def: any) => $ZodType;
  /** @internal A catchall object for bag metadata related to this schema. Commonly modified by checks using `onattach`. */
  bag: Record<string, unknown>;
  /** @internal The set of issues this schema might throw during type checking. */
  isst: $ZodIssueBase;
  /** @internal Subject to change, not a public API. */
  processJSONSchema?: ((ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void) | undefined;
  /** An optional method used to override `toJSONSchema` logic. */
  toJSONSchema?: () => unknown;
  /** @internal The parent of this schema. Only set during certain clone operations. */
  parent?: $ZodType | undefined;
}
/** @internal */
interface $ZodTypeInternals<out O = unknown, out I = unknown> extends _$ZodTypeInternals {
  /** @internal The inferred output type */
  output: O;
  /** @internal The inferred input type */
  input: I;
}
type $ZodStandardSchema<T> = StandardSchemaV1.Props<input$1<T>, output$1<T>>;
type SomeType = {
  _zod: _$ZodTypeInternals;
};
interface $ZodType<O = unknown, I = unknown, Internals extends $ZodTypeInternals<O, I> = $ZodTypeInternals<O, I>> {
  _zod: Internals;
  "~standard": $ZodStandardSchema<this>;
}
interface _$ZodType<T extends $ZodTypeInternals = $ZodTypeInternals> extends $ZodType<T["output"], T["input"], T> {}
declare const $ZodType: $constructor<$ZodType>;
declare function standardProps(inst: $ZodType): StandardSchemaV1.Props<any, any>;
interface $ZodStringDef extends $ZodTypeDef {
  type: "string";
  coerce?: boolean;
  checks?: $ZodCheck<string>[];
}
interface $ZodStringInternals<Input> extends $ZodTypeInternals<string, Input> {
  def: $ZodStringDef;
  /** @deprecated Internal API, use with caution (not deprecated) */
  pattern: RegExp;
  /** @deprecated Internal API, use with caution (not deprecated) */
  isst: $ZodIssueInvalidType;
  bag: LoosePartial<{
    minimum: number;
    maximum: number;
    patterns: Set<RegExp>;
    format: string;
    contentEncoding: string;
    /** the pattern admits strings its `format` keyword forbids, so `toJSONSchema` must not emit it */
    laxFormat: boolean;
  }>;
}
interface $ZodString<Input = unknown> extends _$ZodType<$ZodStringInternals<Input>> {}
declare const $ZodString: $constructor<$ZodString>;
interface $ZodStringFormatDef<Format extends string = string> extends $ZodStringDef, $ZodCheckStringFormatDef<Format> {}
interface $ZodStringFormatInternals<Format extends string = string> extends $ZodStringInternals<string>, $ZodCheckStringFormatInternals {
  def: $ZodStringFormatDef<Format>;
}
interface $ZodStringFormat<Format extends string = string> extends $ZodType {
  _zod: $ZodStringFormatInternals<Format>;
}
declare const $ZodStringFormat: $constructor<$ZodStringFormat>;
interface $ZodGUIDDef extends $ZodStringFormatDef<"guid"> {}
interface $ZodGUIDInternals extends $ZodStringFormatInternals<"guid"> {}
interface $ZodGUID extends $ZodType {
  _zod: $ZodGUIDInternals;
}
declare const $ZodGUID: $constructor<$ZodGUID>;
interface $ZodUUIDDef extends $ZodStringFormatDef<"uuid"> {
  version?: "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7" | "v8";
}
interface $ZodUUIDInternals extends $ZodStringFormatInternals<"uuid"> {
  def: $ZodUUIDDef;
}
interface $ZodUUID extends $ZodType {
  _zod: $ZodUUIDInternals;
}
declare const $ZodUUID: $constructor<$ZodUUID>;
interface $ZodEmailDef extends $ZodStringFormatDef<"email"> {}
interface $ZodEmailInternals extends $ZodStringFormatInternals<"email"> {}
interface $ZodEmail extends $ZodType {
  _zod: $ZodEmailInternals;
}
declare const $ZodEmail: $constructor<$ZodEmail>;
interface $ZodURLDef extends $ZodStringFormatDef<"url"> {
  hostname?: RegExp | undefined;
  protocol?: RegExp | undefined;
  normalize?: boolean | undefined;
}
interface $ZodURLInternals extends $ZodStringFormatInternals<"url"> {
  def: $ZodURLDef;
}
interface $ZodURL extends $ZodType {
  _zod: $ZodURLInternals;
}
/** The `://` guard rejected the input before the URL constructor saw it. */
declare const URL_BAD_FORMAT = 1;
/** The URL constructor rejected the input. */
declare const URL_UNPARSEABLE = 2;
/** Parses a URL for `$ZodURL`, applying the one guard the URL constructor cannot express. Returns the parsed URL, or a code naming the stage that rejected it — the runtime needs that distinction to pick an issue note, and compiled code only needs to know it is not a URL. */
declare function parseURLObject(trimmed: string, def: Pick<$ZodURLDef, "protocol" | "normalize">): URL | typeof URL_BAD_FORMAT | typeof URL_UNPARSEABLE;
/** The URL parser deletes every ASCII tab, LF and CR from its input before it parses, so `new URL("https://exa\nmple.com")` reports on `example.com`. Applying the same deletion to the returned value closes the half of that divergence which can move the host; the parser's other rewrite, stripping C0 controls at the edges, cannot. */
declare function stripTabAndNewline(value: string): string;
declare function urlHostnameOk(url: URL, hostname: RegExp): boolean;
declare function urlProtocolOk(url: URL, protocol: RegExp): boolean;
declare const $ZodURL: $constructor<$ZodURL>;
interface $ZodEmojiDef extends $ZodStringFormatDef<"emoji"> {}
interface $ZodEmojiInternals extends $ZodStringFormatInternals<"emoji"> {}
interface $ZodEmoji extends $ZodType {
  _zod: $ZodEmojiInternals;
}
declare const $ZodEmoji: $constructor<$ZodEmoji>;
interface $ZodNanoIDDef extends $ZodStringFormatDef<"nanoid"> {
  length?: number | undefined;
}
interface $ZodNanoIDInternals extends $ZodStringFormatInternals<"nanoid"> {
  def: $ZodNanoIDDef;
}
interface $ZodNanoID extends $ZodType {
  _zod: $ZodNanoIDInternals;
}
declare const $ZodNanoID: $constructor<$ZodNanoID>;
/**
 * @deprecated CUID v1 is deprecated by its authors due to information leakage
 * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
 * See https://github.com/paralleldrive/cuid.
 */
interface $ZodCUIDDef extends $ZodStringFormatDef<"cuid"> {}
/**
 * @deprecated CUID v1 is deprecated by its authors due to information leakage
 * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
 * See https://github.com/paralleldrive/cuid.
 */
interface $ZodCUIDInternals extends $ZodStringFormatInternals<"cuid"> {}
/**
 * @deprecated CUID v1 is deprecated by its authors due to information leakage
 * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
 * See https://github.com/paralleldrive/cuid.
 */
interface $ZodCUID extends $ZodType {
  _zod: $ZodCUIDInternals;
}
/**
 * @deprecated CUID v1 is deprecated by its authors due to information leakage
 * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
 * See https://github.com/paralleldrive/cuid.
 */
declare const $ZodCUID: $constructor<$ZodCUID>;
interface $ZodCUID2Def extends $ZodStringFormatDef<"cuid2"> {}
interface $ZodCUID2Internals extends $ZodStringFormatInternals<"cuid2"> {}
interface $ZodCUID2 extends $ZodType {
  _zod: $ZodCUID2Internals;
}
declare const $ZodCUID2: $constructor<$ZodCUID2>;
interface $ZodULIDDef extends $ZodStringFormatDef<"ulid"> {}
interface $ZodULIDInternals extends $ZodStringFormatInternals<"ulid"> {}
interface $ZodULID extends $ZodType {
  _zod: $ZodULIDInternals;
}
declare const $ZodULID: $constructor<$ZodULID>;
interface $ZodXIDDef extends $ZodStringFormatDef<"xid"> {}
interface $ZodXIDInternals extends $ZodStringFormatInternals<"xid"> {}
interface $ZodXID extends $ZodType {
  _zod: $ZodXIDInternals;
}
declare const $ZodXID: $constructor<$ZodXID>;
interface $ZodKSUIDDef extends $ZodStringFormatDef<"ksuid"> {}
interface $ZodKSUIDInternals extends $ZodStringFormatInternals<"ksuid"> {}
interface $ZodKSUID extends $ZodType {
  _zod: $ZodKSUIDInternals;
}
declare const $ZodKSUID: $constructor<$ZodKSUID>;
interface $ZodISODateTimeDef extends $ZodStringFormatDef<"datetime"> {
  precision: number | null;
  offset: boolean;
  local: boolean;
}
interface $ZodISODateTimeInternals extends $ZodStringFormatInternals {
  def: $ZodISODateTimeDef;
}
interface $ZodISODateTime extends $ZodType {
  _zod: $ZodISODateTimeInternals;
}
declare const $ZodISODateTime: $constructor<$ZodISODateTime>;
interface $ZodISODateDef extends $ZodStringFormatDef<"date"> {}
interface $ZodISODateInternals extends $ZodStringFormatInternals<"date"> {}
interface $ZodISODate extends $ZodType {
  _zod: $ZodISODateInternals;
}
declare const $ZodISODate: $constructor<$ZodISODate>;
interface $ZodISOTimeDef extends $ZodStringFormatDef<"time"> {
  precision?: number | null;
}
interface $ZodISOTimeInternals extends $ZodStringFormatInternals<"time"> {
  def: $ZodISOTimeDef;
}
interface $ZodISOTime extends $ZodType {
  _zod: $ZodISOTimeInternals;
}
declare const $ZodISOTime: $constructor<$ZodISOTime>;
interface $ZodISODurationDef extends $ZodStringFormatDef<"duration"> {}
interface $ZodISODurationInternals extends $ZodStringFormatInternals<"duration"> {}
interface $ZodISODuration extends $ZodType {
  _zod: $ZodISODurationInternals;
}
declare const $ZodISODuration: $constructor<$ZodISODuration>;
interface $ZodIPv4Def extends $ZodStringFormatDef<"ipv4"> {
  version?: "v4";
}
interface $ZodIPv4Internals extends $ZodStringFormatInternals<"ipv4"> {
  def: $ZodIPv4Def;
}
interface $ZodIPv4 extends $ZodType {
  _zod: $ZodIPv4Internals;
}
declare const $ZodIPv4: $constructor<$ZodIPv4>;
interface $ZodIPv6Def extends $ZodStringFormatDef<"ipv6"> {
  version?: "v6";
}
interface $ZodIPv6Internals extends $ZodStringFormatInternals<"ipv6"> {
  def: $ZodIPv6Def;
}
interface $ZodIPv6 extends $ZodType {
  _zod: $ZodIPv6Internals;
}
declare function isValidIPv6(value: string): boolean;
declare const $ZodIPv6: $constructor<$ZodIPv6>;
interface $ZodMACDef extends $ZodStringFormatDef<"mac"> {
  delimiter?: string;
}
interface $ZodMACInternals extends $ZodStringFormatInternals<"mac"> {
  def: $ZodMACDef;
}
interface $ZodMAC extends $ZodType {
  _zod: $ZodMACInternals;
}
declare const $ZodMAC: $constructor<$ZodMAC>;
interface $ZodCIDRv4Def extends $ZodStringFormatDef<"cidrv4"> {
  version?: "v4";
}
interface $ZodCIDRv4Internals extends $ZodStringFormatInternals<"cidrv4"> {
  def: $ZodCIDRv4Def;
}
interface $ZodCIDRv4 extends $ZodType {
  _zod: $ZodCIDRv4Internals;
}
declare const $ZodCIDRv4: $constructor<$ZodCIDRv4>;
interface $ZodCIDRv6Def extends $ZodStringFormatDef<"cidrv6"> {
  version?: "v6";
}
interface $ZodCIDRv6Internals extends $ZodStringFormatInternals<"cidrv6"> {
  def: $ZodCIDRv6Def;
}
interface $ZodCIDRv6 extends $ZodType {
  _zod: $ZodCIDRv6Internals;
}
declare function isValidCIDRv6(value: string): boolean;
declare const $ZodCIDRv6: $constructor<$ZodCIDRv6>;
declare function isValidBase64(data: string): boolean;
interface $ZodBase64Def extends $ZodStringFormatDef<"base64"> {}
interface $ZodBase64Internals extends $ZodStringFormatInternals<"base64"> {}
interface $ZodBase64 extends $ZodType {
  _zod: $ZodBase64Internals;
}
declare const $ZodBase64: $constructor<$ZodBase64>;
declare function isValidBase64URL(data: string): boolean;
interface $ZodBase64URLDef extends $ZodStringFormatDef<"base64url"> {}
interface $ZodBase64URLInternals extends $ZodStringFormatInternals<"base64url"> {}
interface $ZodBase64URL extends $ZodType {
  _zod: $ZodBase64URLInternals;
}
declare const $ZodBase64URL: $constructor<$ZodBase64URL>;
interface $ZodE164Def extends $ZodStringFormatDef<"e164"> {}
interface $ZodE164Internals extends $ZodStringFormatInternals<"e164"> {}
interface $ZodE164 extends $ZodType {
  _zod: $ZodE164Internals;
}
declare const $ZodE164: $constructor<$ZodE164>;
declare function isValidCreditCard(input: string): boolean;
interface $ZodCreditCardDef extends $ZodStringFormatDef<"credit_card"> {}
interface $ZodCreditCardInternals extends $ZodStringFormatInternals<"credit_card"> {
  def: $ZodCreditCardDef;
}
interface $ZodCreditCard extends $ZodType {
  _zod: $ZodCreditCardInternals;
}
declare const $ZodCreditCard: $constructor<$ZodCreditCard>;
declare function isValidJWT(token: string, algorithm?: JWTAlgorithm | null): boolean;
interface $ZodJWTDef extends $ZodStringFormatDef<"jwt"> {
  alg?: JWTAlgorithm | undefined;
}
interface $ZodJWTInternals extends $ZodStringFormatInternals<"jwt"> {
  def: $ZodJWTDef;
}
interface $ZodJWT extends $ZodType {
  _zod: $ZodJWTInternals;
}
declare const $ZodJWT: $constructor<$ZodJWT>;
interface $ZodCustomStringFormatDef<Format extends string = string> extends $ZodStringFormatDef<Format> {
  fn: (val: string) => unknown;
}
interface $ZodCustomStringFormatInternals<Format extends string = string> extends $ZodStringFormatInternals<Format> {
  def: $ZodCustomStringFormatDef<Format>;
}
interface $ZodCustomStringFormat<Format extends string = string> extends $ZodStringFormat<Format> {
  _zod: $ZodCustomStringFormatInternals<Format>;
}
declare const $ZodCustomStringFormat: $constructor<$ZodCustomStringFormat>;
interface $ZodNumberDef extends $ZodTypeDef {
  type: "number";
  coerce?: boolean;
}
interface $ZodNumberInternals<Input = unknown> extends $ZodTypeInternals<number, Input> {
  def: $ZodNumberDef;
  /** @deprecated Internal API, use with caution (not deprecated) */
  pattern: RegExp;
  /** @deprecated Internal API, use with caution (not deprecated) */
  isst: $ZodIssueInvalidType;
  bag: LoosePartial<{
    minimum: number;
    maximum: number;
    exclusiveMinimum: number;
    exclusiveMaximum: number;
    format: string;
    pattern: RegExp;
  }>;
}
interface $ZodNumber<Input = unknown> extends $ZodType {
  _zod: $ZodNumberInternals<Input>;
}
declare const $ZodNumber: $constructor<$ZodNumber>;
interface $ZodNumberFormatDef<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodNumberDef, $ZodCheckNumberFormatDef<Format> {}
interface $ZodNumberFormatInternals<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodNumberInternals<number>, $ZodCheckNumberFormatInternals<Format> {
  def: $ZodNumberFormatDef<Format>;
  isst: $ZodIssueInvalidType;
}
interface $ZodNumberFormat<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodType {
  _zod: $ZodNumberFormatInternals<Format>;
}
declare const $ZodNumberFormat: $constructor<$ZodNumberFormat>;
interface $ZodBooleanDef extends $ZodTypeDef {
  type: "boolean";
  coerce?: boolean;
  checks?: $ZodCheck<boolean>[];
}
interface $ZodBooleanInternals<T = unknown> extends $ZodTypeInternals<boolean, T> {
  pattern: RegExp;
  def: $ZodBooleanDef;
  isst: $ZodIssueInvalidType;
}
interface $ZodBoolean<T = unknown> extends $ZodType {
  _zod: $ZodBooleanInternals<T>;
}
declare const $ZodBoolean: $constructor<$ZodBoolean>;
interface $ZodBigIntDef extends $ZodTypeDef {
  type: "bigint";
  coerce?: boolean;
}
interface $ZodBigIntInternals<T = unknown> extends $ZodTypeInternals<bigint, T> {
  pattern: RegExp;
  /** @internal Internal API, use with caution */
  def: $ZodBigIntDef;
  isst: $ZodIssueInvalidType;
  bag: LoosePartial<{
    minimum: bigint;
    maximum: bigint;
    format: string;
  }>;
}
interface $ZodBigInt<T = unknown> extends $ZodType {
  _zod: $ZodBigIntInternals<T>;
}
declare const $ZodBigInt: $constructor<$ZodBigInt>;
interface $ZodBigIntFormatDef<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends $ZodBigIntDef, $ZodCheckBigIntFormatDef<Format> {
  check: "bigint_format";
}
interface $ZodBigIntFormatInternals<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends $ZodBigIntInternals<bigint>, $ZodCheckBigIntFormatInternals<Format> {
  def: $ZodBigIntFormatDef<Format>;
}
interface $ZodBigIntFormat<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends $ZodType {
  _zod: $ZodBigIntFormatInternals<Format>;
}
declare const $ZodBigIntFormat: $constructor<$ZodBigIntFormat>;
interface $ZodSymbolDef extends $ZodTypeDef {
  type: "symbol";
}
interface $ZodSymbolInternals extends $ZodTypeInternals<symbol, symbol> {
  def: $ZodSymbolDef;
  isst: $ZodIssueInvalidType;
}
interface $ZodSymbol extends $ZodType {
  _zod: $ZodSymbolInternals;
}
declare const $ZodSymbol: $constructor<$ZodSymbol>;
interface $ZodUndefinedDef extends $ZodTypeDef {
  type: "undefined";
}
interface $ZodUndefinedInternals extends $ZodTypeInternals<undefined, undefined> {
  pattern: RegExp;
  def: $ZodUndefinedDef;
  values: PrimitiveSet;
  isst: $ZodIssueInvalidType;
}
interface $ZodUndefined extends $ZodType {
  _zod: $ZodUndefinedInternals;
}
declare const $ZodUndefined: $constructor<$ZodUndefined>;
interface $ZodNullDef extends $ZodTypeDef {
  type: "null";
}
interface $ZodNullInternals extends $ZodTypeInternals<null, null> {
  pattern: RegExp;
  def: $ZodNullDef;
  values: PrimitiveSet;
  isst: $ZodIssueInvalidType;
}
interface $ZodNull extends $ZodType {
  _zod: $ZodNullInternals;
}
declare const $ZodNull: $constructor<$ZodNull>;
interface $ZodAnyDef extends $ZodTypeDef {
  type: "any";
}
interface $ZodAnyInternals extends $ZodTypeInternals<any, any> {
  def: $ZodAnyDef;
  isst: never;
}
interface $ZodAny extends $ZodType {
  _zod: $ZodAnyInternals;
}
declare const $ZodAny: $constructor<$ZodAny>;
interface $ZodUnknownDef extends $ZodTypeDef {
  type: "unknown";
}
interface $ZodUnknownInternals extends $ZodTypeInternals<unknown, unknown> {
  def: $ZodUnknownDef;
  isst: never;
}
interface $ZodUnknown extends $ZodType {
  _zod: $ZodUnknownInternals;
}
declare const $ZodUnknown: $constructor<$ZodUnknown>;
interface $ZodNeverDef extends $ZodTypeDef {
  type: "never";
}
interface $ZodNeverInternals extends $ZodTypeInternals<never, never> {
  def: $ZodNeverDef;
  isst: $ZodIssueInvalidType;
}
interface $ZodNever extends $ZodType {
  _zod: $ZodNeverInternals;
}
declare const $ZodNever: $constructor<$ZodNever>;
interface $ZodVoidDef extends $ZodTypeDef {
  type: "void";
}
interface $ZodVoidInternals extends $ZodTypeInternals<void, void> {
  def: $ZodVoidDef;
  isst: $ZodIssueInvalidType;
}
interface $ZodVoid extends $ZodType {
  _zod: $ZodVoidInternals;
}
declare const $ZodVoid: $constructor<$ZodVoid>;
interface $ZodDateDef extends $ZodTypeDef {
  type: "date";
  coerce?: boolean;
}
interface $ZodDateInternals<T = unknown> extends $ZodTypeInternals<Date, T> {
  def: $ZodDateDef;
  isst: $ZodIssueInvalidType;
  bag: LoosePartial<{
    minimum: Date;
    maximum: Date;
    format: string;
  }>;
}
interface $ZodDate<T = unknown> extends $ZodType {
  _zod: $ZodDateInternals<T>;
}
declare const $ZodDate: $constructor<$ZodDate>;
interface $ZodArrayDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "array";
  element: T;
}
interface $ZodArrayInternals<T extends SomeType = $ZodType> extends _$ZodTypeInternals {
  def: $ZodArrayDef<T>;
  isst: $ZodIssueInvalidType;
  output: output$1<T>[];
  input: input$1<T>[];
}
interface $ZodArray<T extends SomeType = $ZodType> extends $ZodType<any, any, $ZodArrayInternals<T>> {}
declare const $ZodArray: $constructor<$ZodArray>;
type OptionalOutSchema = {
  _zod: {
    optout: "optional";
  };
};
type OptionalInSchema = {
  _zod: {
    optin: "optional" | "defaulted";
  };
};
type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, output$1<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{ -readonly [k in keyof T as T[k] extends OptionalOutSchema ? never : k]: T[k]["_zod"]["output"]; } & { -readonly [k in keyof T as T[k] extends OptionalOutSchema ? k : never]?: T[k]["_zod"]["output"]; } & Extra>;
type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, input$1<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{ -readonly [k in keyof T as T[k] extends OptionalInSchema ? never : k]: T[k]["_zod"]["input"]; } & { -readonly [k in keyof T as T[k] extends OptionalInSchema ? k : never]?: T[k]["_zod"]["input"]; } & Extra>;
type $ZodObjectConfig = {
  out: Record<string, unknown>;
  in: Record<string, unknown>;
};
type $loose = {
  out: Record<string, unknown>;
  in: Record<string, unknown>;
};
type $strict = {
  out: {};
  in: {};
};
type $strip = {
  out: {};
  in: {};
};
type $catchall<T extends SomeType> = {
  out: {
    [k: string]: output$1<T>;
  };
  in: {
    [k: string]: input$1<T>;
  };
};
type $ZodShape = Readonly<{
  [k: string]: $ZodType;
}>;
interface $ZodObjectDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef {
  type: "object";
  shape: Shape;
  catchall?: $ZodType | undefined;
}
interface $ZodObjectInternals<
/** @ts-ignore Cast variance */
out Shape extends $ZodShape = $ZodShape, out Config extends $ZodObjectConfig = $ZodObjectConfig> extends _$ZodTypeInternals {
  def: $ZodObjectDef<Shape>;
  config: Config;
  isst: $ZodIssueInvalidType | $ZodIssueUnrecognizedKeys;
  propValues: PropValues;
  output: $InferObjectOutput<Shape, Config["out"]>;
  input: $InferObjectInput<Shape, Config["in"]>;
  optin?: "optional" | undefined;
  optout?: "optional" | undefined;
}
type $ZodLooseShape = Record<string, any>;
interface $ZodObject<
/** @ts-ignore Cast variance */
out Shape extends Readonly<$ZodShape> = Readonly<$ZodShape>, out Params extends $ZodObjectConfig = $ZodObjectConfig> extends $ZodType<any, any, $ZodObjectInternals<Shape, Params>> {}
declare const $ZodObject: $constructor<$ZodObject>;
declare const $ZodObjectJIT: $constructor<$ZodObject>;
type $InferUnionOutput<T extends SomeType> = T extends any ? output$1<T> : never;
type $InferUnionInput<T extends SomeType> = T extends any ? input$1<T> : never;
interface $ZodUnionDef<Options extends readonly SomeType[] = readonly $ZodType[]> extends $ZodTypeDef {
  type: "union";
  options: Options;
  inclusive?: boolean;
}
type IsOptionalIn<T extends SomeType> = T extends OptionalInSchema ? true : false;
type IsOptionalOut<T extends SomeType> = T extends OptionalOutSchema ? true : false;
interface $ZodUnionInternals<T extends readonly SomeType[] = readonly $ZodType[]> extends _$ZodTypeInternals {
  def: $ZodUnionDef<T>;
  isst: $ZodIssueInvalidUnion;
  pattern: T[number]["_zod"]["pattern"];
  values: T[number]["_zod"]["values"];
  output: $InferUnionOutput<T[number]>;
  input: $InferUnionInput<T[number]>;
  optin: IsOptionalIn<T[number]> extends false ? "optional" | "defaulted" | undefined : "optional" | "defaulted";
  optout: IsOptionalOut<T[number]> extends false ? "optional" | undefined : "optional";
}
interface $ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends $ZodType<any, any, $ZodUnionInternals<T>> {
  _zod: $ZodUnionInternals<T>;
}
declare const $ZodUnion: $constructor<$ZodUnion>;
interface $ZodXorInternals<T extends readonly SomeType[] = readonly $ZodType[]> extends $ZodUnionInternals<T> {}
interface $ZodXor<T extends readonly SomeType[] = readonly $ZodType[]> extends $ZodType<any, any, $ZodXorInternals<T>> {
  _zod: $ZodXorInternals<T>;
}
declare const $ZodXor: $constructor<$ZodXor>;
interface $ZodDiscriminatedUnionDef<Options extends readonly SomeType[] = readonly $ZodType[], Disc extends string = string> extends $ZodUnionDef<Options> {
  discriminator: Disc;
  unionFallback?: boolean;
}
interface $ZodDiscriminatedUnionInternals<Options extends readonly SomeType[] = readonly $ZodType[], Disc extends string = string> extends $ZodUnionInternals<Options> {
  def: $ZodDiscriminatedUnionDef<Options, Disc>;
  propValues: PropValues;
  bag: LoosePartial<{
    optionsMap: Map<Primitive, $ZodType>;
  }>;
}
/** The discriminator values a member of `Options` can declare. An omittable discriminator contributes `undefined`, matching what `propValues` claims for it. */
type $DiscriminatorValue<Options extends readonly SomeType[], Disc extends string> = { [I in keyof Options]: Options[I] extends {
  _zod: {
    output: infer Out;
  };
} ? Disc extends keyof Out ? Out[Disc] : never : never; }[number];
/** The member of `Options` that declares `V`. */
type $DiscriminatedOption<Options extends readonly SomeType[], Disc extends string, V> = { [I in keyof Options]: Options[I] extends {
  _zod: {
    output: infer Out;
  };
} ? Disc extends keyof Out ? V extends Out[Disc] ? Options[I] : never : never : never; }[number];
/** Returns the option of `union` whose discriminator claims `value`. */
declare function getDiscriminatedOption<Options extends readonly SomeType[], Disc extends string, const V extends $DiscriminatorValue<Options, Disc>>(union: $ZodDiscriminatedUnion<Options, Disc>, value: V): $DiscriminatedOption<Options, Disc, V>;
interface $ZodDiscriminatedUnion<Options extends readonly SomeType[] = readonly $ZodType[], Disc extends string = string> extends $ZodType {
  _zod: $ZodDiscriminatedUnionInternals<Options, Disc>;
}
declare const $ZodDiscriminatedUnion: $constructor<$ZodDiscriminatedUnion>;
interface $ZodIntersectionDef<Left extends SomeType = $ZodType, Right extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "intersection";
  left: Left;
  right: Right;
}
interface $ZodIntersectionInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _$ZodTypeInternals {
  def: $ZodIntersectionDef<A, B>;
  isst: never;
  optin: A["_zod"]["optin"] | B["_zod"]["optin"];
  optout: A["_zod"]["optout"] | B["_zod"]["optout"];
  output: output$1<A> & output$1<B>;
  input: input$1<A> & input$1<B>;
}
interface $ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodIntersectionInternals<A, B>;
}
declare const $ZodIntersection: $constructor<$ZodIntersection>;
declare function mergeValues(a: any, b: any): {
  valid: true;
  data: any;
} | {
  valid: false;
  mergeErrorPath: (string | number)[];
};
interface $ZodTupleDef<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodTypeDef {
  type: "tuple";
  items: T;
  rest: Rest;
}
type $InferTupleInputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleInputTypeWithOptionals<T>, ...(Rest extends SomeType ? input$1<Rest>[] : [])];
type TupleInputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: input$1<T[k]>; };
type TupleInputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optin"] extends "optional" | "defaulted" ? [...TupleInputTypeWithOptionals<Prefix>, input$1<Tail>?] : TupleInputTypeNoOptionals<T> : [];
type $InferTupleOutputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleOutputTypeWithOptionals<T>, ...(Rest extends SomeType ? output$1<Rest>[] : [])];
type TupleOutputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: output$1<T[k]>; };
type TupleOutputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optout"] extends "optional" ? [...TupleOutputTypeWithOptionals<Prefix>, output$1<Tail>?] : TupleOutputTypeNoOptionals<T> : [];
interface $ZodTupleInternals<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends _$ZodTypeInternals {
  def: $ZodTupleDef<T, Rest>;
  isst: $ZodIssueInvalidType | $ZodIssueTooBig<unknown[]> | $ZodIssueTooSmall<unknown[]>;
  output: $InferTupleOutputType<T, Rest>;
  input: $InferTupleInputType<T, Rest>;
}
interface $ZodTuple<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodType {
  _zod: $ZodTupleInternals<T, Rest>;
}
declare const $ZodTuple: $constructor<$ZodTuple>;
type $ZodRecordKey = $ZodType<string | number | symbol, unknown>;
interface $ZodRecordDef<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "record";
  keyType: Key;
  valueType: Value;
  /** @default "strict" - errors on keys not matching keyType. "loose" passes through non-matching keys unchanged. */
  mode?: "strict" | "loose";
  partial?: boolean;
}
type $InferZodRecordOutput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<output$1<Key>, output$1<Value>>> : Record<output$1<Key>, output$1<Value>>;
type $InferZodRecordInput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<input$1<Key> & PropertyKey, input$1<Value>>> : [Value] extends [OptionalInSchema] ? Partial<Record<input$1<Key> & PropertyKey, input$1<Value>>> : Record<input$1<Key> & PropertyKey, input$1<Value>>;
interface $ZodRecordInternals<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeInternals<$InferZodRecordOutput<Key, Value>, $InferZodRecordInput<Key, Value>> {
  def: $ZodRecordDef<Key, Value>;
  isst: $ZodIssueInvalidType | $ZodIssueInvalidKey<Record<PropertyKey, unknown>>;
  optin?: "optional" | undefined;
  optout?: "optional" | undefined;
}
type $partial = {
  "~~partial": true;
};
interface $ZodRecord<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodRecordInternals<Key, Value>;
}
declare const $ZodRecord: $constructor<$ZodRecord>;
interface $ZodMapDef<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "map";
  keyType: Key;
  valueType: Value;
}
interface $ZodMapInternals<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeInternals<Map<output$1<Key>, output$1<Value>>, Map<input$1<Key>, input$1<Value>>> {
  def: $ZodMapDef<Key, Value>;
  isst: $ZodIssueInvalidType | $ZodIssueInvalidKey | $ZodIssueInvalidElement<unknown>;
  optin?: "optional" | undefined;
  optout?: "optional" | undefined;
}
interface $ZodMap<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodMapInternals<Key, Value>;
}
declare const $ZodMap: $constructor<$ZodMap>;
interface $ZodSetDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "set";
  valueType: T;
}
interface $ZodSetInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Set<output$1<T>>, Set<input$1<T>>> {
  def: $ZodSetDef<T>;
  isst: $ZodIssueInvalidType;
  optin?: "optional" | undefined;
  optout?: "optional" | undefined;
}
interface $ZodSet<T extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodSetInternals<T>;
}
declare const $ZodSet: $constructor<$ZodSet>;
type $InferEnumOutput<T extends EnumLike> = T[keyof T] & {};
type $InferEnumInput<T extends EnumLike> = T[keyof T] & {};
interface $ZodEnumDef<T extends EnumLike = EnumLike> extends $ZodTypeDef {
  type: "enum";
  entries: T;
}
interface $ZodEnumInternals<
/** @ts-ignore Cast variance */
out T extends EnumLike = EnumLike> extends $ZodTypeInternals<$InferEnumOutput<T>, $InferEnumInput<T>> {
  def: $ZodEnumDef<T>;
  /** @deprecated Internal API, use with caution (not deprecated) */
  values: PrimitiveSet;
  /** @deprecated Internal API, use with caution (not deprecated) */
  pattern: RegExp;
  isst: $ZodIssueInvalidValue;
}
interface $ZodEnum<T extends EnumLike = EnumLike> extends $ZodType {
  _zod: $ZodEnumInternals<T>;
}
declare const $ZodEnum: $constructor<$ZodEnum>;
interface $ZodLiteralDef<T extends Literal> extends $ZodTypeDef {
  type: "literal";
  values: T[];
}
interface $ZodLiteralInternals<T extends Literal = Literal> extends $ZodTypeInternals<T, T> {
  def: $ZodLiteralDef<T>;
  values: Set<T>;
  pattern: RegExp;
  isst: $ZodIssueInvalidValue;
}
interface $ZodLiteral<T extends Literal = Literal> extends $ZodType {
  _zod: $ZodLiteralInternals<T>;
}
declare const $ZodLiteral: $constructor<$ZodLiteral>;
type _File = typeof globalThis extends {
  File: infer F extends new (...args: any[]) => any;
} ? InstanceType<F> : {};
/** Do not reference this directly. */
interface File extends _File {
  readonly type: string;
  readonly size: number;
}
interface $ZodFileDef extends $ZodTypeDef {
  type: "file";
}
interface $ZodFileInternals extends $ZodTypeInternals<File, File> {
  def: $ZodFileDef;
  isst: $ZodIssueInvalidType;
  bag: LoosePartial<{
    minimum: number;
    maximum: number;
    mime: MimeTypes[];
  }>;
}
interface $ZodFile extends $ZodType {
  _zod: $ZodFileInternals;
}
declare const $ZodFile: $constructor<$ZodFile>;
interface $ZodTransformDef extends $ZodTypeDef {
  type: "transform";
  transform: (input: unknown, payload: ParsePayload<unknown>) => MaybeAsync<unknown>;
}
interface $ZodTransformInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I> {
  def: $ZodTransformDef;
  isst: never;
}
interface $ZodTransform<O = unknown, I = unknown> extends $ZodType {
  _zod: $ZodTransformInternals<O, I>;
}
declare const $ZodTransform: $constructor<$ZodTransform>;
interface $ZodOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "optional";
  innerType: T;
}
interface $ZodOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output$1<T> | undefined, input$1<T> | undefined> {
  def: $ZodOptionalDef<T>;
  optin: "optional" | "defaulted";
  optout: "optional";
  isst: never;
  values: T["_zod"]["values"];
  pattern: T["_zod"]["pattern"];
}
interface $ZodOptional<T extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodOptionalInternals<T>;
}
declare const $ZodOptional: $constructor<$ZodOptional>;
interface $ZodExactOptionalDef<T extends SomeType = $ZodType> extends $ZodOptionalDef<T> {}
interface $ZodExactOptionalInternals<T extends SomeType = $ZodType> extends $ZodOptionalInternals<T> {
  def: $ZodExactOptionalDef<T>;
  output: output$1<T>;
  input: input$1<T>;
}
interface $ZodExactOptional<T extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodExactOptionalInternals<T>;
}
declare const $ZodExactOptional: $constructor<$ZodExactOptional>;
interface $ZodNullableDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "nullable";
  innerType: T;
}
interface $ZodNullableInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output$1<T> | null, input$1<T> | null> {
  def: $ZodNullableDef<T>;
  optin: T["_zod"]["optin"];
  optout: T["_zod"]["optout"];
  isst: never;
  values: T["_zod"]["values"];
  pattern: T["_zod"]["pattern"];
}
interface $ZodNullable<T extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodNullableInternals<T>;
}
declare const $ZodNullable: $constructor<$ZodNullable>;
interface $ZodDefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "default";
  innerType: T;
  /** The default value. May be a getter. */
  defaultValue: NoUndefined<output$1<T>>;
}
interface $ZodDefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output$1<T>>, input$1<T> | undefined> {
  def: $ZodDefaultDef<T>;
  optin: "defaulted";
  optout?: "optional" | undefined;
  isst: never;
  values: T["_zod"]["values"];
}
interface $ZodDefault<T extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodDefaultInternals<T>;
}
declare const $ZodDefault: $constructor<$ZodDefault>;
interface $ZodPrefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "prefault";
  innerType: T;
  /** The default value. May be a getter. */
  defaultValue: input$1<T>;
}
interface $ZodPrefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output$1<T>>, input$1<T> | undefined> {
  def: $ZodPrefaultDef<T>;
  optin: "defaulted";
  optout?: "optional" | undefined;
  isst: never;
  values: T["_zod"]["values"];
}
interface $ZodPrefault<T extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodPrefaultInternals<T>;
}
declare const $ZodPrefault: $constructor<$ZodPrefault>;
interface $ZodNonOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "nonoptional";
  innerType: T;
}
interface $ZodNonOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output$1<T>>, NoUndefined<input$1<T>>> {
  def: $ZodNonOptionalDef<T>;
  isst: $ZodIssueInvalidType;
  values: T["_zod"]["values"];
  optin: "optional" | undefined;
  optout: "optional" | undefined;
}
interface $ZodNonOptional<T extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodNonOptionalInternals<T>;
}
declare const $ZodNonOptional: $constructor<$ZodNonOptional>;
interface $ZodSuccessDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "success";
  innerType: T;
}
interface $ZodSuccessInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<boolean, input$1<T>> {
  def: $ZodSuccessDef<T>;
  isst: never;
  optin: T["_zod"]["optin"];
  optout: "optional" | undefined;
}
interface $ZodSuccess<T extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodSuccessInternals<T>;
}
declare const $ZodSuccess: $constructor<$ZodSuccess>;
interface $ZodCatchCtx extends ParsePayload {
  /** @deprecated Use `ctx.issues` */
  error: {
    issues: $ZodIssue[];
  };
  /** @deprecated Use `ctx.value` */
  input: unknown;
}
interface $ZodCatchDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "catch";
  innerType: T;
  catchValue: (ctx: $ZodCatchCtx) => unknown;
}
interface $ZodCatchInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output$1<T>, input$1<T>> {
  def: $ZodCatchDef<T>;
  optin: T["_zod"]["optin"];
  optout: T["_zod"]["optout"];
  isst: never;
  values: T["_zod"]["values"];
}
interface $ZodCatch<T extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodCatchInternals<T>;
}
declare const $ZodCatch: $constructor<$ZodCatch>;
interface $ZodNaNDef extends $ZodTypeDef {
  type: "nan";
}
interface $ZodNaNInternals extends $ZodTypeInternals<number, number> {
  def: $ZodNaNDef;
  isst: $ZodIssueInvalidType;
}
interface $ZodNaN extends $ZodType {
  _zod: $ZodNaNInternals;
}
declare const $ZodNaN: $constructor<$ZodNaN>;
interface $ZodPipeDef<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "pipe";
  in: A;
  out: B;
  /** Only defined inside $ZodCodec instances. */
  transform?: (value: output$1<A>, payload: ParsePayload<output$1<A>>) => MaybeAsync<input$1<B>>;
  /** Only defined inside $ZodCodec instances. */
  reverseTransform?: (value: input$1<B>, payload: ParsePayload<input$1<B>>) => MaybeAsync<output$1<A>>;
}
interface $ZodPipeInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeInternals<output$1<B>, input$1<A>> {
  def: $ZodPipeDef<A, B>;
  isst: never;
  values: A["_zod"]["values"];
  optin: A["_zod"]["optin"];
  optout: B["_zod"]["optout"];
  propValues: A["_zod"]["propValues"];
}
interface $ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodPipeInternals<A, B>;
}
declare const $ZodPipe: $constructor<$ZodPipe>;
interface $ZodCodecDef<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodPipeDef<A, B> {
  transform: (value: output$1<A>, payload: ParsePayload<output$1<A>>) => MaybeAsync<input$1<B>>;
  reverseTransform: (value: input$1<B>, payload: ParsePayload<input$1<B>>) => MaybeAsync<output$1<A>>;
}
interface $ZodCodecInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeInternals<output$1<B>, input$1<A>> {
  def: $ZodCodecDef<A, B>;
  isst: never;
  values: A["_zod"]["values"];
  optin: A["_zod"]["optin"];
  optout: B["_zod"]["optout"];
  propValues: A["_zod"]["propValues"];
}
interface $ZodCodec<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodCodecInternals<A, B>;
}
declare const $ZodCodec: $constructor<$ZodCodec>;
interface $ZodPreprocessDef<B extends SomeType = $ZodType, I = unknown> extends $ZodPipeDef<$ZodTransform<unknown, I>, B> {
  in: $ZodTransform<unknown, I>;
  out: B;
}
interface $ZodPreprocessInternals<B extends SomeType = $ZodType, I = unknown> extends $ZodPipeInternals<$ZodTransform<unknown, I>, B> {
  def: $ZodPreprocessDef<B, I>;
  optin: B["_zod"]["optin"];
  optout: B["_zod"]["optout"];
}
interface $ZodPreprocess<B extends SomeType = $ZodType, I = unknown> extends $ZodPipe<$ZodTransform<unknown, I>, B> {
  _zod: $ZodPreprocessInternals<B, I>;
}
declare const $ZodPreprocess: $constructor<$ZodPreprocess>;
interface $ZodReadonlyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "readonly";
  innerType: T;
}
interface $ZodReadonlyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<MakeReadonly<output$1<T>>, MakeReadonly<input$1<T>>> {
  def: $ZodReadonlyDef<T>;
  optin: T["_zod"]["optin"];
  optout: T["_zod"]["optout"];
  isst: never;
  propValues: T["_zod"]["propValues"];
  values: T["_zod"]["values"];
}
interface $ZodReadonly<T extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodReadonlyInternals<T>;
}
declare const $ZodReadonly: $constructor<$ZodReadonly>;
interface $ZodTemplateLiteralDef extends $ZodTypeDef {
  type: "template_literal";
  parts: $ZodTemplateLiteralPart[];
  format?: string | undefined;
}
interface $ZodTemplateLiteralInternals<Template extends string = string> extends $ZodTypeInternals<Template, Template> {
  pattern: RegExp;
  def: $ZodTemplateLiteralDef;
  isst: $ZodIssueInvalidType;
}
interface $ZodTemplateLiteral<Template extends string = string> extends $ZodType {
  _zod: $ZodTemplateLiteralInternals<Template>;
}
type LiteralPart = Exclude<Literal, symbol>;
interface SchemaPartInternals extends $ZodTypeInternals<LiteralPart, LiteralPart> {
  pattern: RegExp;
}
interface SchemaPart extends $ZodType {
  _zod: SchemaPartInternals;
}
type $ZodTemplateLiteralPart = LiteralPart | SchemaPart;
type UndefinedToEmptyString<T> = T extends undefined ? "" : T;
type AppendToTemplateLiteral<Template extends string, Suffix extends LiteralPart | $ZodType> = Suffix extends LiteralPart ? `${Template}${UndefinedToEmptyString<Suffix>}` : Suffix extends $ZodType ? `${Template}${output$1<Suffix> extends (infer T extends LiteralPart) ? UndefinedToEmptyString<T> : never}` : never;
type ConcatenateTupleOfStrings<T extends string[]> = T extends [infer First extends string, ...infer Rest extends string[]] ? Rest extends string[] ? First extends "" ? ConcatenateTupleOfStrings<Rest> : `${First}${ConcatenateTupleOfStrings<Rest>}` : never : "";
type ConvertPartsToStringTuple<Parts extends $ZodTemplateLiteralPart[]> = { [K in keyof Parts]: Parts[K] extends LiteralPart ? `${UndefinedToEmptyString<Parts[K]>}` : Parts[K] extends $ZodType ? `${output$1<Parts[K]> extends (infer T extends LiteralPart) ? UndefinedToEmptyString<T> : never}` : never; };
type ToTemplateLiteral<Parts extends $ZodTemplateLiteralPart[]> = ConcatenateTupleOfStrings<ConvertPartsToStringTuple<Parts>>;
type $PartsToTemplateLiteral<Parts extends $ZodTemplateLiteralPart[]> = [] extends Parts ? `` : Parts extends [...infer Rest, infer Last extends $ZodTemplateLiteralPart] ? Rest extends $ZodTemplateLiteralPart[] ? AppendToTemplateLiteral<$PartsToTemplateLiteral<Rest>, Last> : never : never;
declare const $ZodTemplateLiteral: $constructor<$ZodTemplateLiteral>;
type $ZodFunctionArgs = $ZodType<unknown[], unknown[]>;
type $ZodFunctionIn = $ZodFunctionArgs;
type $ZodFunctionOut = $ZodType;
type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output$1<Args>) => input$1<Returns>;
type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output$1<Args>) => MaybeAsync<input$1<Returns>>;
type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input$1<Args>) => output$1<Returns>;
type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input$1<Args>) => Promise<output$1<Returns>>;
interface $ZodFunctionDef<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodTypeDef {
  type: "function";
  input: In;
  output: Out;
}
interface $ZodFunctionInternals<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> extends $ZodTypeInternals<$InferOuterFunctionType<Args, Returns>, $InferInnerFunctionType<Args, Returns>> {
  def: $ZodFunctionDef<Args, Returns>;
  isst: $ZodIssueInvalidType;
}
interface $ZodFunction<Args extends $ZodFunctionIn = $ZodFunctionIn, Returns extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodType<any, any, $ZodFunctionInternals<Args, Returns>> {
  /** @deprecated */
  _def: $ZodFunctionDef<Args, Returns>;
  _input: $InferInnerFunctionType<Args, Returns>;
  _output: $InferOuterFunctionType<Args, Returns>;
  implement<F extends $InferInnerFunctionType<Args, Returns>>(func: F): (...args: Parameters<this["_output"]>) => ReturnType<F> extends ReturnType<this["_output"]> ? ReturnType<F> : ReturnType<this["_output"]>;
  implementAsync<F extends $InferInnerFunctionTypeAsync<Args, Returns>>(func: F): F extends $InferOuterFunctionTypeAsync<Args, Returns> ? F : $InferOuterFunctionTypeAsync<Args, Returns>;
  input<const Items extends TupleItems, const Rest extends $ZodFunctionOut = $ZodFunctionOut>(args: Items, rest?: Rest): $ZodFunction<$ZodTuple<Items, Rest>, Returns>;
  input<NewArgs extends $ZodFunctionIn>(args: NewArgs): $ZodFunction<NewArgs, Returns>;
  input(...args: any[]): $ZodFunction<any, Returns>;
  output<NewReturns extends $ZodType>(output: NewReturns): $ZodFunction<Args, NewReturns>;
}
interface $ZodFunctionParams<I extends $ZodFunctionIn, O extends $ZodType> {
  input?: I;
  output?: O;
}
declare const $ZodFunction: $constructor<$ZodFunction>;
interface $ZodPromiseDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "promise";
  innerType: T;
}
interface $ZodPromiseInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Promise<output$1<T>>, MaybeAsync<input$1<T>>> {
  def: $ZodPromiseDef<T>;
  isst: never;
}
interface $ZodPromise<T extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodPromiseInternals<T>;
}
declare const $ZodPromise: $constructor<$ZodPromise>;
interface $ZodLazyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
  type: "lazy";
  getter: () => T;
}
interface $ZodLazyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output$1<T>, input$1<T>> {
  def: $ZodLazyDef<T>;
  isst: never;
  /** Auto-cached way to retrieve the inner schema */
  innerType: T;
  pattern: T["_zod"]["pattern"];
  propValues: T["_zod"]["propValues"];
  optin: T["_zod"]["optin"];
  optout: T["_zod"]["optout"];
}
interface $ZodLazy<T extends SomeType = $ZodType> extends $ZodType {
  _zod: $ZodLazyInternals<T>;
}
declare const $ZodLazy: $constructor<$ZodLazy>;
interface $ZodCustomDef<O = unknown> extends $ZodTypeDef, $ZodCheckDef {
  type: "custom";
  check: "custom";
  path?: PropertyKey[] | undefined;
  error?: $ZodErrorMap | undefined;
  params?: Record<string, any> | undefined;
  fn: (arg: O) => unknown;
}
interface $ZodCustomInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I>, $ZodCheckInternals<O> {
  def: $ZodCustomDef;
  issc: $ZodIssue;
  isst: never;
  bag: LoosePartial<{
    Class: typeof Class;
  }>;
}
interface $ZodCustom<O = unknown, I = unknown> extends $ZodType {
  _zod: $ZodCustomInternals<O, I>;
}
declare const $ZodCustom: $constructor<$ZodCustom>;
type $ZodTypes = $ZodString | $ZodNumber | $ZodBigInt | $ZodBoolean | $ZodDate | $ZodSymbol | $ZodUndefined | $ZodNullable | $ZodNull | $ZodAny | $ZodUnknown | $ZodNever | $ZodVoid | $ZodArray | $ZodObject | $ZodUnion | $ZodIntersection | $ZodTuple | $ZodRecord | $ZodMap | $ZodSet | $ZodLiteral | $ZodEnum | $ZodFunction | $ZodPromise | $ZodLazy | $ZodOptional | $ZodDefault | $ZodPrefault | $ZodTemplateLiteral | $ZodCustom | $ZodTransform | $ZodNonOptional | $ZodReadonly | $ZodNaN | $ZodPipe | $ZodSuccess | $ZodCatch | $ZodFile;
type $ZodStringFormatTypes = $ZodGUID | $ZodUUID | $ZodEmail | $ZodURL | $ZodEmoji | $ZodNanoID | $ZodCUID | $ZodCUID2 | $ZodULID | $ZodXID | $ZodKSUID | $ZodISODateTime | $ZodISODate | $ZodISOTime | $ZodISODuration | $ZodIPv4 | $ZodIPv6 | $ZodMAC | $ZodCIDRv4 | $ZodCIDRv6 | $ZodBase64 | $ZodBase64URL | $ZodE164 | $ZodCreditCard | $ZodJWT | $ZodCustomStringFormat<"hex"> | $ZodCustomStringFormat<HashFormat> | $ZodCustomStringFormat<"hostname">;
declare namespace checks_d_exports {
  export { $ZodBigIntFormats, $ZodCheck, $ZodCheckBigIntFormat, $ZodCheckBigIntFormatDef, $ZodCheckBigIntFormatInternals, $ZodCheckDef, $ZodCheckEndsWith, $ZodCheckEndsWithDef, $ZodCheckEndsWithInternals, $ZodCheckGreaterThan, $ZodCheckGreaterThanDef, $ZodCheckGreaterThanInternals, $ZodCheckIncludes, $ZodCheckIncludesDef, $ZodCheckIncludesInternals, $ZodCheckInternals, $ZodCheckLengthEquals, $ZodCheckLengthEqualsDef, $ZodCheckLengthEqualsInternals, $ZodCheckLessThan, $ZodCheckLessThanDef, $ZodCheckLessThanInternals, $ZodCheckLowerCase, $ZodCheckLowerCaseDef, $ZodCheckLowerCaseInternals, $ZodCheckMaxLength, $ZodCheckMaxLengthDef, $ZodCheckMaxLengthInternals, $ZodCheckMaxSize, $ZodCheckMaxSizeDef, $ZodCheckMaxSizeInternals, $ZodCheckMimeType, $ZodCheckMimeTypeDef, $ZodCheckMimeTypeInternals, $ZodCheckMinLength, $ZodCheckMinLengthDef, $ZodCheckMinLengthInternals, $ZodCheckMinSize, $ZodCheckMinSizeDef, $ZodCheckMinSizeInternals, $ZodCheckMultipleOf, $ZodCheckMultipleOfDef, $ZodCheckMultipleOfInternals, $ZodCheckNumberFormat, $ZodCheckNumberFormatDef, $ZodCheckNumberFormatInternals, $ZodCheckOverwrite, $ZodCheckOverwriteDef, $ZodCheckOverwriteInternals, $ZodCheckProperty, $ZodCheckPropertyDef, $ZodCheckPropertyInternals, $ZodCheckRegex, $ZodCheckRegexDef, $ZodCheckRegexInternals, $ZodCheckSizeEquals, $ZodCheckSizeEqualsDef, $ZodCheckSizeEqualsInternals, $ZodCheckStartsWith, $ZodCheckStartsWithDef, $ZodCheckStartsWithInternals, $ZodCheckStringFormat, $ZodCheckStringFormatDef, $ZodCheckStringFormatInternals, $ZodCheckUpperCase, $ZodCheckUpperCaseDef, $ZodCheckUpperCaseInternals, $ZodChecks, $ZodNumberFormats, $ZodStringFormatChecks, $ZodStringFormats };
}
interface $ZodCheckDef {
  check: string;
  error?: $ZodErrorMap<never> | undefined;
  /** If true, no later checks will be executed if this check fails. Default `false`. */
  abort?: boolean | undefined;
  /** If provided, the check runs only when this returns `true`. By default, it is skipped if prior parsing produced aborting issues. */
  when?: ((payload: ParsePayload) => boolean) | undefined;
}
interface $ZodCheckInternals<T> {
  def: $ZodCheckDef;
  /** The set of issues this check might throw. */
  issc?: $ZodIssueBase;
  check(payload: ParsePayload<T>): MaybeAsync<void>;
  onattach: ((schema: $ZodType) => void)[];
}
interface $ZodCheck<in T = never> {
  _zod: $ZodCheckInternals<T>;
}
declare const $ZodCheck: $constructor<$ZodCheck<any>>;
interface $ZodCheckLessThanDef extends $ZodCheckDef {
  check: "less_than";
  value: Numeric;
  inclusive: boolean;
}
interface $ZodCheckLessThanInternals<T extends Numeric = Numeric> extends $ZodCheckInternals<T> {
  def: $ZodCheckLessThanDef;
  issc: $ZodIssueTooBig<T>;
}
interface $ZodCheckLessThan<T extends Numeric = Numeric> extends $ZodCheck<T> {
  _zod: $ZodCheckLessThanInternals<T>;
}
declare const $ZodCheckLessThan: $constructor<$ZodCheckLessThan>;
interface $ZodCheckGreaterThanDef extends $ZodCheckDef {
  check: "greater_than";
  value: Numeric;
  inclusive: boolean;
}
interface $ZodCheckGreaterThanInternals<T extends Numeric = Numeric> extends $ZodCheckInternals<T> {
  def: $ZodCheckGreaterThanDef;
  issc: $ZodIssueTooSmall<T>;
}
interface $ZodCheckGreaterThan<T extends Numeric = Numeric> extends $ZodCheck<T> {
  _zod: $ZodCheckGreaterThanInternals<T>;
}
declare const $ZodCheckGreaterThan: $constructor<$ZodCheckGreaterThan>;
interface $ZodCheckMultipleOfDef<T extends number | bigint = number | bigint> extends $ZodCheckDef {
  check: "multiple_of";
  value: T;
}
interface $ZodCheckMultipleOfInternals<T extends number | bigint = number | bigint> extends $ZodCheckInternals<T> {
  def: $ZodCheckMultipleOfDef<T>;
  issc: $ZodIssueNotMultipleOf;
}
interface $ZodCheckMultipleOf<T extends number | bigint = number | bigint> extends $ZodCheck<T> {
  _zod: $ZodCheckMultipleOfInternals<T>;
}
declare const $ZodCheckMultipleOf: $constructor<$ZodCheckMultipleOf<number | bigint>>;
type $ZodNumberFormats = "int32" | "uint32" | "float32" | "float64" | "safeint";
interface $ZodCheckNumberFormatDef<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodCheckDef {
  check: "number_format";
  format: Format;
}
interface $ZodCheckNumberFormatInternals<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodCheckInternals<number> {
  def: $ZodCheckNumberFormatDef<Format>;
  issc: $ZodIssueInvalidType | $ZodIssueTooBig<"number"> | $ZodIssueTooSmall<"number">;
}
interface $ZodCheckNumberFormat<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodCheck<number> {
  _zod: $ZodCheckNumberFormatInternals<Format>;
}
declare const $ZodCheckNumberFormat: $constructor<$ZodCheckNumberFormat>;
type $ZodBigIntFormats = "int64" | "uint64";
interface $ZodCheckBigIntFormatDef<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends $ZodCheckDef {
  check: "bigint_format";
  format: Format;
}
interface $ZodCheckBigIntFormatInternals<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends $ZodCheckInternals<bigint> {
  def: $ZodCheckBigIntFormatDef<Format>;
  issc: $ZodIssueTooBig<"bigint"> | $ZodIssueTooSmall<"bigint">;
}
interface $ZodCheckBigIntFormat<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends $ZodCheck<bigint> {
  _zod: $ZodCheckBigIntFormatInternals<Format>;
}
declare const $ZodCheckBigIntFormat: $constructor<$ZodCheckBigIntFormat>;
interface $ZodCheckMaxSizeDef extends $ZodCheckDef {
  check: "max_size";
  maximum: number;
}
interface $ZodCheckMaxSizeInternals<T extends HasSize = HasSize> extends $ZodCheckInternals<T> {
  def: $ZodCheckMaxSizeDef;
  issc: $ZodIssueTooBig<T>;
}
interface $ZodCheckMaxSize<T extends HasSize = HasSize> extends $ZodCheck<T> {
  _zod: $ZodCheckMaxSizeInternals<T>;
}
declare const $ZodCheckMaxSize: $constructor<$ZodCheckMaxSize>;
interface $ZodCheckMinSizeDef extends $ZodCheckDef {
  check: "min_size";
  minimum: number;
}
interface $ZodCheckMinSizeInternals<T extends HasSize = HasSize> extends $ZodCheckInternals<T> {
  def: $ZodCheckMinSizeDef;
  issc: $ZodIssueTooSmall<T>;
}
interface $ZodCheckMinSize<T extends HasSize = HasSize> extends $ZodCheck<T> {
  _zod: $ZodCheckMinSizeInternals<T>;
}
declare const $ZodCheckMinSize: $constructor<$ZodCheckMinSize>;
interface $ZodCheckSizeEqualsDef extends $ZodCheckDef {
  check: "size_equals";
  size: number;
}
interface $ZodCheckSizeEqualsInternals<T extends HasSize = HasSize> extends $ZodCheckInternals<T> {
  def: $ZodCheckSizeEqualsDef;
  issc: $ZodIssueTooBig<T> | $ZodIssueTooSmall<T>;
}
interface $ZodCheckSizeEquals<T extends HasSize = HasSize> extends $ZodCheck<T> {
  _zod: $ZodCheckSizeEqualsInternals<T>;
}
declare const $ZodCheckSizeEquals: $constructor<$ZodCheckSizeEquals>;
interface $ZodCheckMaxLengthDef extends $ZodCheckDef {
  check: "max_length";
  maximum: number;
}
interface $ZodCheckMaxLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
  def: $ZodCheckMaxLengthDef;
  issc: $ZodIssueTooBig<T>;
}
interface $ZodCheckMaxLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
  _zod: $ZodCheckMaxLengthInternals<T>;
}
declare const $ZodCheckMaxLength: $constructor<$ZodCheckMaxLength>;
interface $ZodCheckMinLengthDef extends $ZodCheckDef {
  check: "min_length";
  minimum: number;
}
interface $ZodCheckMinLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
  def: $ZodCheckMinLengthDef;
  issc: $ZodIssueTooSmall<T>;
}
interface $ZodCheckMinLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
  _zod: $ZodCheckMinLengthInternals<T>;
}
declare const $ZodCheckMinLength: $constructor<$ZodCheckMinLength>;
interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {
  check: "length_equals";
  length: number;
}
interface $ZodCheckLengthEqualsInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
  def: $ZodCheckLengthEqualsDef;
  issc: $ZodIssueTooBig<T> | $ZodIssueTooSmall<T>;
}
interface $ZodCheckLengthEquals<T extends HasLength = HasLength> extends $ZodCheck<T> {
  _zod: $ZodCheckLengthEqualsInternals<T>;
}
declare const $ZodCheckLengthEquals: $constructor<$ZodCheckLengthEquals>;
type $ZodStringFormats = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "credit_card" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {
  check: "string_format";
  format: Format;
  pattern?: RegExp | undefined;
}
interface $ZodCheckStringFormatInternals extends $ZodCheckInternals<string> {
  def: $ZodCheckStringFormatDef;
  issc: $ZodIssueInvalidStringFormat;
}
interface $ZodCheckStringFormat extends $ZodCheck<string> {
  _zod: $ZodCheckStringFormatInternals;
}
declare const $ZodCheckStringFormat: $constructor<$ZodCheckStringFormat>;
interface $ZodCheckRegexDef extends $ZodCheckStringFormatDef {
  format: "regex";
  pattern: RegExp;
}
interface $ZodCheckRegexInternals extends $ZodCheckInternals<string> {
  def: $ZodCheckRegexDef;
  issc: $ZodIssueInvalidStringFormat;
}
interface $ZodCheckRegex extends $ZodCheck<string> {
  _zod: $ZodCheckRegexInternals;
}
declare const $ZodCheckRegex: $constructor<$ZodCheckRegex>;
interface $ZodCheckLowerCaseDef extends $ZodCheckStringFormatDef<"lowercase"> {}
interface $ZodCheckLowerCaseInternals extends $ZodCheckInternals<string> {
  def: $ZodCheckLowerCaseDef;
  issc: $ZodIssueInvalidStringFormat;
}
interface $ZodCheckLowerCase extends $ZodCheck<string> {
  _zod: $ZodCheckLowerCaseInternals;
}
declare const $ZodCheckLowerCase: $constructor<$ZodCheckLowerCase>;
interface $ZodCheckUpperCaseDef extends $ZodCheckStringFormatDef<"uppercase"> {}
interface $ZodCheckUpperCaseInternals extends $ZodCheckInternals<string> {
  def: $ZodCheckUpperCaseDef;
  issc: $ZodIssueInvalidStringFormat;
}
interface $ZodCheckUpperCase extends $ZodCheck<string> {
  _zod: $ZodCheckUpperCaseInternals;
}
declare const $ZodCheckUpperCase: $constructor<$ZodCheckUpperCase>;
interface $ZodCheckIncludesDef extends $ZodCheckStringFormatDef<"includes"> {
  includes: string;
  position?: number | undefined;
}
interface $ZodCheckIncludesInternals extends $ZodCheckInternals<string> {
  def: $ZodCheckIncludesDef;
  issc: $ZodIssueInvalidStringFormat;
}
interface $ZodCheckIncludes extends $ZodCheck<string> {
  _zod: $ZodCheckIncludesInternals;
}
declare const $ZodCheckIncludes: $constructor<$ZodCheckIncludes>;
interface $ZodCheckStartsWithDef extends $ZodCheckStringFormatDef<"starts_with"> {
  prefix: string;
}
interface $ZodCheckStartsWithInternals extends $ZodCheckInternals<string> {
  def: $ZodCheckStartsWithDef;
  issc: $ZodIssueInvalidStringFormat;
}
interface $ZodCheckStartsWith extends $ZodCheck<string> {
  _zod: $ZodCheckStartsWithInternals;
}
declare const $ZodCheckStartsWith: $constructor<$ZodCheckStartsWith>;
interface $ZodCheckEndsWithDef extends $ZodCheckStringFormatDef<"ends_with"> {
  suffix: string;
}
interface $ZodCheckEndsWithInternals extends $ZodCheckInternals<string> {
  def: $ZodCheckEndsWithDef;
  issc: $ZodIssueInvalidStringFormat;
}
interface $ZodCheckEndsWith extends $ZodCheckInternals<string> {
  _zod: $ZodCheckEndsWithInternals;
}
declare const $ZodCheckEndsWith: $constructor<$ZodCheckEndsWith>;
interface $ZodCheckPropertyDef extends $ZodCheckDef {
  check: "property";
  property: string;
  schema: $ZodType;
}
interface $ZodCheckPropertyInternals<T extends object = object> extends $ZodCheckInternals<T> {
  def: $ZodCheckPropertyDef;
  issc: $ZodIssue;
}
interface $ZodCheckProperty<T extends object = object> extends $ZodCheck<T> {
  _zod: $ZodCheckPropertyInternals<T>;
}
declare const $ZodCheckProperty: $constructor<$ZodCheckProperty>;
interface $ZodCheckMimeTypeDef extends $ZodCheckDef {
  check: "mime_type";
  mime: MimeTypes[];
}
interface $ZodCheckMimeTypeInternals<T extends File = File> extends $ZodCheckInternals<T> {
  def: $ZodCheckMimeTypeDef;
  issc: $ZodIssueInvalidValue;
}
interface $ZodCheckMimeType<T extends File = File> extends $ZodCheck<T> {
  _zod: $ZodCheckMimeTypeInternals<T>;
}
declare const $ZodCheckMimeType: $constructor<$ZodCheckMimeType>;
interface $ZodCheckOverwriteDef<T = unknown> extends $ZodCheckDef {
  check: "overwrite";
  tx(value: T): T;
}
interface $ZodCheckOverwriteInternals<T = unknown> extends $ZodCheckInternals<T> {
  def: $ZodCheckOverwriteDef<T>;
  issc: never;
}
interface $ZodCheckOverwrite<T = unknown> extends $ZodCheck<T> {
  _zod: $ZodCheckOverwriteInternals<T>;
}
declare const $ZodCheckOverwrite: $constructor<$ZodCheckOverwrite>;
type $ZodChecks = $ZodCheckLessThan | $ZodCheckGreaterThan | $ZodCheckMultipleOf | $ZodCheckNumberFormat | $ZodCheckBigIntFormat | $ZodCheckMaxSize | $ZodCheckMinSize | $ZodCheckSizeEquals | $ZodCheckMaxLength | $ZodCheckMinLength | $ZodCheckLengthEquals | $ZodCheckStringFormat | $ZodCheckProperty | $ZodCheckMimeType | $ZodCheckOverwrite;
type $ZodStringFormatChecks = $ZodCheckRegex | $ZodCheckLowerCase | $ZodCheckUpperCase | $ZodCheckIncludes | $ZodCheckStartsWith | $ZodCheckEndsWith | $ZodStringFormatTypes;
declare namespace errors_d_exports {
  export { $ZodError, $ZodErrorMap, $ZodErrorTree, $ZodFlattenedError, $ZodFormattedError, $ZodInternalIssue, $ZodInvalidTypeExpected, $ZodIssue, $ZodIssueBase, $ZodIssueCode, $ZodIssueCustom, $ZodIssueInvalidElement, $ZodIssueInvalidKey, $ZodIssueInvalidStringFormat, $ZodIssueInvalidType, $ZodIssueInvalidUnion, $ZodIssueInvalidValue, $ZodIssueNotMultipleOf, $ZodIssueStringCommonFormats, $ZodIssueStringEndsWith, $ZodIssueStringIncludes, $ZodIssueStringInvalidJWT, $ZodIssueStringInvalidRegex, $ZodIssueStringStartsWith, $ZodIssueTooBig, $ZodIssueTooSmall, $ZodIssueUnrecognizedKeys, $ZodRawIssue, $ZodRealError, $ZodStringFormatIssues, flattenError, formatError, prettifyError, toDotPath, treeifyError };
}
interface $ZodIssueBase {
  readonly code?: string;
  readonly input?: unknown;
  readonly path: PropertyKey[];
  readonly message: string;
}
type $ZodInvalidTypeExpected = "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "undefined" | "null" | "never" | "void" | "date" | "array" | "object" | "tuple" | "record" | "map" | "set" | "file" | "nonoptional" | "nan" | "function" | (string & {});
interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {
  readonly code: "invalid_type";
  readonly expected: $ZodInvalidTypeExpected;
  readonly input?: Input;
}
interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
  readonly code: "too_big";
  readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
  readonly maximum: number | bigint;
  readonly inclusive?: boolean;
  readonly exact?: boolean;
  readonly input?: Input;
}
interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
  readonly code: "too_small";
  readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
  readonly minimum: number | bigint;
  /** True if the allowable range includes the minimum */
  readonly inclusive?: boolean;
  /** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */
  readonly exact?: boolean;
  readonly input?: Input;
}
interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {
  readonly code: "invalid_format";
  readonly format: $ZodStringFormats | (string & {});
  readonly pattern?: string;
  readonly input?: string;
}
interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {
  readonly code: "not_multiple_of";
  readonly divisor: number;
  readonly input?: Input;
}
interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {
  readonly code: "unrecognized_keys";
  readonly keys: string[];
  readonly input?: Record<string, unknown>;
}
interface $ZodIssueInvalidUnionNoMatch extends $ZodIssueBase {
  readonly code: "invalid_union";
  readonly errors: $ZodIssue[][];
  readonly input?: unknown;
  readonly discriminator?: string | undefined;
  readonly options?: Primitive[];
  readonly inclusive?: true;
}
interface $ZodIssueInvalidUnionMultipleMatch extends $ZodIssueBase {
  readonly code: "invalid_union";
  readonly errors: [];
  readonly input?: unknown;
  readonly discriminator?: string | undefined;
  readonly inclusive: false;
  /** Indices of the options that matched */
  readonly matches: number[];
}
type $ZodIssueInvalidUnion = $ZodIssueInvalidUnionNoMatch | $ZodIssueInvalidUnionMultipleMatch;
interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {
  readonly code: "invalid_key";
  readonly origin: "map" | "record";
  readonly issues: $ZodIssue[];
  readonly input?: Input;
}
interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {
  readonly code: "invalid_element";
  readonly origin: "map" | "set";
  readonly key: unknown;
  readonly issues: $ZodIssue[];
  readonly input?: Input;
}
interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {
  readonly code: "invalid_value";
  readonly values: Primitive[];
  readonly input?: Input;
}
interface $ZodIssueCustom extends $ZodIssueBase {
  readonly code: "custom";
  readonly params?: Record<string, any> | undefined;
  readonly input?: unknown;
}
interface $ZodIssueStringCommonFormats extends $ZodIssueInvalidStringFormat {
  format: Exclude<$ZodStringFormats, "regex" | "jwt" | "starts_with" | "ends_with" | "includes">;
}
interface $ZodIssueStringInvalidRegex extends $ZodIssueInvalidStringFormat {
  format: "regex";
  pattern: string;
}
interface $ZodIssueStringInvalidJWT extends $ZodIssueInvalidStringFormat {
  format: "jwt";
  algorithm?: string;
}
interface $ZodIssueStringStartsWith extends $ZodIssueInvalidStringFormat {
  format: "starts_with";
  prefix: string;
}
interface $ZodIssueStringEndsWith extends $ZodIssueInvalidStringFormat {
  format: "ends_with";
  suffix: string;
}
interface $ZodIssueStringIncludes extends $ZodIssueInvalidStringFormat {
  format: "includes";
  includes: string;
}
type $ZodStringFormatIssues = $ZodIssueStringCommonFormats | $ZodIssueStringInvalidRegex | $ZodIssueStringInvalidJWT | $ZodIssueStringStartsWith | $ZodIssueStringEndsWith | $ZodIssueStringIncludes;
type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom;
type $ZodIssueCode = $ZodIssue["code"];
type $ZodInternalIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue$1<T> : never;
type RawIssue$1<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
  /** The input data */
  readonly input: unknown;
  /** The schema or check that originated this issue. */
  readonly inst?: $ZodType | $ZodCheck;
  /** The schema that owns the issue. Equal to `inst` when a schema originated the issue, and the schema the check was attached to when a check did. */
  readonly schema?: $ZodType | undefined;
  /** If `true`, Zod will continue executing checks/refinements after this issue. */
  readonly continue?: boolean | undefined;
} & Record<string, unknown>> : never;
type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T>;
interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {
  (issue: $ZodRawIssue<T>): {
    message: string;
  } | string | undefined | null;
}
interface $ZodError<T = unknown> extends Error {
  type: T;
  issues: $ZodIssue[];
  _zod: {
    output: T;
    def: $ZodIssue[];
  };
  stack?: string;
  name: string;
}
declare const $ZodError: $constructor<$ZodError>;
interface $ZodRealError<T = any> extends $ZodError<T> {}
declare const $ZodRealError: $constructor<$ZodRealError>;
type $ZodFlattenedError<T, U = string> = _FlattenedError<T, U>;
type _FlattenedError<T, U = string> = {
  formErrors: U[];
  fieldErrors: { [P in keyof T]?: U[]; };
};
declare function flattenError<T>(error: $ZodError<T>): _FlattenedError<T>;
declare function flattenError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): _FlattenedError<T, U>;
type _ZodFormattedError<T, U = string> = T extends [any, ...any[]] ? { [K in keyof T]?: $ZodFormattedError<T[K], U>; } : T extends any[] ? {
  [k: number]: $ZodFormattedError<T[number], U>;
} : T extends object ? Flatten<{ [K in keyof T]?: $ZodFormattedError<T[K], U>; }> : any;
type $ZodFormattedError<T, U = string> = {
  _errors: U[];
} & Flatten<_ZodFormattedError<T, U>>;
declare function formatError<T>(error: $ZodError<T>): $ZodFormattedError<T>;
declare function formatError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;
type $ZodErrorTree<T, U = string> = T extends Primitive ? {
  errors: U[];
} : T extends [any, ...any[]] ? {
  errors: U[];
  items?: { [K in keyof T]?: $ZodErrorTree<T[K], U>; };
} : T extends any[] ? {
  errors: U[];
  items?: Array<$ZodErrorTree<T[number], U>>;
} : T extends object ? {
  errors: U[];
  properties?: { [K in keyof T]?: $ZodErrorTree<T[K], U>; };
} : {
  errors: U[];
};
declare function treeifyError<T>(error: $ZodError<T>): $ZodErrorTree<T>;
declare function treeifyError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): $ZodErrorTree<T, U>;
/** Format a ZodError as a human-readable string in the following form.
 *
 * From
 *
 * ```ts
 * ZodError {
 *   issues: [
 *     {
 *       expected: 'string',
 *       code: 'invalid_type',
 *       path: [ 'username' ],
 *       message: 'Invalid input: expected string'
 *     },
 *     {
 *       expected: 'number',
 *       code: 'invalid_type',
 *       path: [ 'favoriteNumbers', 1 ],
 *       message: 'Invalid input: expected number'
 *     }
 *   ];
 * }
 * ```
 *
 * to
 *
 * ```
 * username
 *   ✖ Expected number, received string at "username
 * favoriteNumbers[0]
 *   ✖ Invalid input: expected number
 * ```
 */
declare function toDotPath(_path: readonly (string | number | symbol | StandardSchemaV1.PathSegment)[]): string;
declare function prettifyError(error: StandardSchemaV1.FailureResult): string;
declare namespace core_d_exports {
  export { $ZodAsyncError, $ZodBranded, $ZodConfig, $ZodEncodeError, $ZodNarrow, $brand, $constructor, $constructorParams, NEVER, config, globalConfig, output$1 as infer, input$1 as input, output$1 as output };
}
type ZodTrait = {
  _zod: {
    def: any;
    [k: string]: any;
  };
};
interface $constructor<T extends ZodTrait, D = T["_zod"]["def"]> {
  new (def: D): T;
  init(inst: T, def: D): asserts inst is T;
}
interface $constructorParams {
  Parent?: typeof Class;
}
/** A special constant with type `never` */
declare const NEVER: never;
declare function $constructor<T extends ZodTrait, D = T["_zod"]["def"]>(name: string, initializer: (inst: T, def: D) => void,
/** This trait's members, installed once on every prototype that composes it. They cannot be declared in the initializer above: that runs per instance, and the prototype is shared. */
proto?: ProtoOf<T>, params?: $constructorParams): $constructor<T, D>;
declare const $brand: unique symbol;
type $brand<T extends string | number | symbol = string | number | symbol> = {
  [$brand]: { [k in T]: true; };
};
type $ZodBranded<T extends SomeType, Brand extends string | number | symbol, Dir extends "in" | "out" | "inout" = "out"> = T & (Dir extends "inout" ? {
  _zod: {
    input: input$1<T> & $brand<Brand>;
    output: output$1<T> & $brand<Brand>;
  };
} : Dir extends "in" ? {
  _zod: {
    input: input$1<T> & $brand<Brand>;
  };
} : {
  _zod: {
    output: output$1<T> & $brand<Brand>;
  };
});
type $ZodNarrow<T extends SomeType, Out> = T & {
  _zod: {
    output: Out;
  };
};
declare class $ZodAsyncError extends Error {
  constructor();
}
declare class $ZodEncodeError extends Error {
  constructor(name: string);
}
type input$1<T> = T extends {
  _zod: {
    input: any;
  };
} ? T["_zod"]["input"] : unknown;
type output$1<T> = T extends {
  _zod: {
    output: any;
  };
} ? T["_zod"]["output"] : unknown;
interface $ZodConfig {
  /** Custom error map. Overrides `config().localeError`. */
  customError?: $ZodErrorMap | undefined;
  /** Localized error map. Lowest priority. */
  localeError?: $ZodErrorMap | undefined;
  /** Disable JIT schema compilation. Useful in environments that disallow `eval`. */
  jitless?: boolean | undefined;
  /** Enables parsing input that contains reference cycles. Read when a schema is constructed. */
  memoizer?: $ZodMemoizer | undefined;
  /**
   * Internal: post-processor invoked on every freshly-constructed schema
   * instance, after init and deferred fns run. Set by `import "zod/compile"`
   * to install AOT compilation. Not part of the public API.
   * @internal
   */
  postProcessor?: ((inst: any) => void) | undefined;
}
declare const globalConfig: $ZodConfig;
declare function config(newConfig?: Partial<$ZodConfig>): $ZodConfig;
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/parse.d.cts
type $ZodErrorClass = {
  new (issues: $ZodIssue[]): $ZodError;
};
type $ParseParams = {
  callee?: AnyFunc;
  Err?: $ZodErrorClass | undefined;
};
type $Parse = <T extends $ZodType>(schema: T, value: unknown, _ctx?: ParseContext<$ZodIssue>, _params?: $ParseParams) => output$1<T>;
declare const _parse: (_Err: $ZodErrorClass) => $Parse;
declare const parse$1: $Parse;
type $ParseAsync = <T extends $ZodType>(schema: T, value: unknown, _ctx?: ParseContext<$ZodIssue>, _params?: $ParseParams) => Promise<output$1<T>>;
declare const _parseAsync: (_Err: $ZodErrorClass) => $ParseAsync;
declare const parseAsync$1: $ParseAsync;
type $SafeParse = <T extends $ZodType>(schema: T, value: unknown, _ctx?: ParseContext<$ZodIssue>) => SafeParseResult<output$1<T>>;
declare const _safeParse: (_Err: $ZodErrorClass) => $SafeParse;
declare const safeParse$1: $SafeParse;
type $SafeParseAsync = <T extends $ZodType>(schema: T, value: unknown, _ctx?: ParseContext<$ZodIssue>) => Promise<SafeParseResult<output$1<T>>>;
declare const _safeParseAsync: (_Err: $ZodErrorClass) => $SafeParseAsync;
declare const safeParseAsync$1: $SafeParseAsync;
type $Validate = <T extends $ZodType>(schema: T, value: unknown, _ctx?: ParseContext<$ZodIssue>) => value is input$1<T>;
declare const validate: $Validate;
type $ValidateAsync = <T extends $ZodType>(schema: T, value: unknown, _ctx?: ParseContext<$ZodIssue>) => Promise<boolean>;
declare const validateAsync: $ValidateAsync;
type $Encode = <T extends $ZodType>(schema: T, value: output$1<T>, _ctx?: ParseContext<$ZodIssue>, _params?: $ParseParams) => input$1<T>;
declare const _encode: (_Err: $ZodErrorClass) => $Encode;
declare const encode$1: $Encode;
type $Decode = <T extends $ZodType>(schema: T, value: input$1<T>, _ctx?: ParseContext<$ZodIssue>, _params?: $ParseParams) => output$1<T>;
declare const _decode: (_Err: $ZodErrorClass) => $Decode;
declare const decode$1: $Decode;
type $EncodeAsync = <T extends $ZodType>(schema: T, value: output$1<T>, _ctx?: ParseContext<$ZodIssue>, _params?: $ParseParams) => Promise<input$1<T>>;
declare const _encodeAsync: (_Err: $ZodErrorClass) => $EncodeAsync;
declare const encodeAsync$1: $EncodeAsync;
type $DecodeAsync = <T extends $ZodType>(schema: T, value: input$1<T>, _ctx?: ParseContext<$ZodIssue>, _params?: $ParseParams) => Promise<output$1<T>>;
declare const _decodeAsync: (_Err: $ZodErrorClass) => $DecodeAsync;
declare const decodeAsync$1: $DecodeAsync;
type $SafeEncode = <T extends $ZodType>(schema: T, value: output$1<T>, _ctx?: ParseContext<$ZodIssue>) => SafeParseResult<input$1<T>>;
declare const _safeEncode: (_Err: $ZodErrorClass) => $SafeEncode;
declare const safeEncode$1: $SafeEncode;
type $SafeDecode = <T extends $ZodType>(schema: T, value: input$1<T>, _ctx?: ParseContext<$ZodIssue>) => SafeParseResult<output$1<T>>;
declare const _safeDecode: (_Err: $ZodErrorClass) => $SafeDecode;
declare const safeDecode$1: $SafeDecode;
type $SafeEncodeAsync = <T extends $ZodType>(schema: T, value: output$1<T>, _ctx?: ParseContext<$ZodIssue>) => Promise<SafeParseResult<input$1<T>>>;
declare const _safeEncodeAsync: (_Err: $ZodErrorClass) => $SafeEncodeAsync;
declare const safeEncodeAsync$1: $SafeEncodeAsync;
type $SafeDecodeAsync = <T extends $ZodType>(schema: T, value: input$1<T>, _ctx?: ParseContext<$ZodIssue>) => Promise<SafeParseResult<output$1<T>>>;
declare const _safeDecodeAsync: (_Err: $ZodErrorClass) => $SafeDecodeAsync;
declare const safeDecodeAsync$1: $SafeDecodeAsync;
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/memoizer.d.cts
declare class $ZodCyclicError extends Error {
  constructor();
}
/**
 * Whether one parse can re-enter this schema, i.e. its subtree contains a cycle.
 * Exported for `z.compile`, which refuses to compile such a schema: cycle
 * breaking is driven from here off state keyed on the parse context, and a
 * generated fast path has no context to key on.
 */
declare function isRecursiveSchema(inst: $ZodType): boolean;
/** The memoizer that gives containers cycle support. `zod` installs it by default; `zod/mini` opts in with `config({ memoizer: memoizer() })`. */
declare function memoizer(): $ZodMemoizer;
/** Whether this value is a node a back-edge resolved to before it finished. */
declare function isBackEdge(ctx: object, value: unknown): boolean;
declare namespace regexes_d_exports {
  export { base64$1 as base64, base64url$1 as base64url, bigint$2 as bigint, boolean$2 as boolean, browserEmail, cidrv4$1 as cidrv4, cidrv6$1 as cidrv6, creditCard$1 as creditCard, cuid$1 as cuid, cuid2$1 as cuid2, date$3 as date, datetime$1 as datetime, domain, duration$1 as duration, e164$1 as e164, email$1 as email, emoji$1 as emoji, extendedDuration, guid$1 as guid, hex$1 as hex, hostname$1 as hostname, html5Email, httpProtocol, idnEmail, integer, ipv4$1 as ipv4, ipv6$1 as ipv6, ksuid$1 as ksuid, lowercase, mac$1 as mac, md5_base64, md5_base64url, md5_hex, nanoid$1 as nanoid, nanoidOfLength, _null$2 as null, number$2 as number, rfc5322Email, sha1_base64, sha1_base64url, sha1_hex, sha256_base64, sha256_base64url, sha256_hex, sha384_base64, sha384_base64url, sha384_hex, sha512_base64, sha512_base64url, sha512_hex, string$2 as string, time$1 as time, ulid$1 as ulid, _undefined$2 as undefined, unicodeEmail, uppercase, uuid$1 as uuid, uuid4, uuid6, uuid7, xid$1 as xid };
}
/**
 * @deprecated CUID v1 is deprecated by its authors due to information leakage
 * (timestamps embedded in the id). Use {@link cuid2} instead.
 * See https://github.com/paralleldrive/cuid.
 */
declare const cuid$1: RegExp;
declare const cuid2$1: RegExp;
declare const ulid$1: RegExp;
declare const xid$1: RegExp;
declare const ksuid$1: RegExp;
declare const nanoid$1: RegExp;
declare function nanoidOfLength(length: number): RegExp;
/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
declare const duration$1: RegExp;
/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */
declare const extendedDuration: RegExp;
/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
declare const guid$1: RegExp;
/** Returns a regex for validating an RFC 9562/4122 UUID.
 *
 * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
declare const uuid$1: (version?: number | undefined) => RegExp;
declare const uuid4: RegExp;
declare const uuid6: RegExp;
declare const uuid7: RegExp;
/** Practical email validation */
declare const email$1: RegExp;
/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */
declare const html5Email: RegExp;
/** The classic emailregex.com regex for RFC 5322-compliant emails */
declare const rfc5322Email: RegExp;
/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */
declare const unicodeEmail: RegExp;
declare const idnEmail: RegExp;
declare const browserEmail: RegExp;
declare function emoji$1(): RegExp;
declare const ipv4$1: RegExp;
declare const ipv6$1: RegExp;
declare const mac$1: (delimiter?: string) => RegExp;
declare const cidrv4$1: RegExp;
declare const cidrv6$1: RegExp;
declare const base64$1: RegExp;
declare const base64url$1: RegExp;
declare const hostname$1: RegExp;
declare const domain: RegExp;
declare const httpProtocol: RegExp;
declare const e164$1: RegExp;
declare const creditCard$1: RegExp;
declare const date$3: RegExp;
declare function time$1(args: {
  precision?: number | null;
}): RegExp;
declare function datetime$1(args: {
  precision?: number | null;
  offset?: boolean;
  local?: boolean;
}): RegExp;
declare const string$2: (params?: {
  minimum?: number | undefined;
  maximum?: number | undefined;
}) => RegExp;
declare const bigint$2: RegExp;
declare const integer: RegExp;
declare const number$2: RegExp;
declare const boolean$2: RegExp;
declare const _null$2: RegExp;
declare const _undefined$2: RegExp;
declare const lowercase: RegExp;
declare const uppercase: RegExp;
declare const hex$1: RegExp;
declare const md5_hex: RegExp;
declare const md5_base64: RegExp;
declare const md5_base64url: RegExp;
declare const sha1_hex: RegExp;
declare const sha1_base64: RegExp;
declare const sha1_base64url: RegExp;
declare const sha256_hex: RegExp;
declare const sha256_base64: RegExp;
declare const sha256_base64url: RegExp;
declare const sha384_hex: RegExp;
declare const sha384_base64: RegExp;
declare const sha384_base64url: RegExp;
declare const sha512_hex: RegExp;
declare const sha512_base64: RegExp;
declare const sha512_base64url: RegExp;
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ar.d.cts
declare function _default$63(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/az.d.cts
declare function _default$62(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/be.d.cts
declare function _default$61(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/bg.d.cts
declare function _default$60(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/bn.d.cts
declare function _default$59(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ca.d.cts
declare function _default$58(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ckb.d.cts
declare function _default$57(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/cs.d.cts
declare function _default$56(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/da.d.cts
declare function _default$55(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/de.d.cts
declare function _default$54(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/el.d.cts
declare function _default$53(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/en.d.cts
declare function _default$52(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/eo.d.cts
declare function _default$51(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/es.d.cts
declare function _default$50(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/fa.d.cts
declare function _default$49(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/fi.d.cts
declare function _default$48(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/fr.d.cts
declare function _default$47(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/fr-CA.d.cts
declare function _default$46(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/gu.d.cts
declare function _default$45(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/he.d.cts
declare function _default$44(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/hi.d.cts
declare function _default$43(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/hr.d.cts
declare function _default$42(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/hu.d.cts
declare function _default$41(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/hy.d.cts
declare function _default$40(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/id.d.cts
declare function _default$39(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/is.d.cts
declare function _default$38(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/it.d.cts
declare function _default$37(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ja.d.cts
declare function _default$36(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ka.d.cts
declare function _default$35(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/kh.d.cts
declare function _default$34(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/km.d.cts
declare function _default$33(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/kn.d.cts
declare function _default$32(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ko.d.cts
declare function _default$31(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/lt.d.cts
declare function _default$30(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/mk.d.cts
declare function _default$29(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ms.d.cts
declare function _default$28(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ne.d.cts
declare function _default$27(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/nl.d.cts
declare function _default$26(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/nn.d.cts
declare function _default$25(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/no.d.cts
declare function _default$24(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ota.d.cts
declare function _default$23(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ps.d.cts
declare function _default$22(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/pl.d.cts
declare function _default$21(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/pt.d.cts
declare function _default$20(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/pt-BR.d.cts
declare function _default$19(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ro.d.cts
declare function _default$18(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ru.d.cts
declare function _default$17(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/sk.d.cts
declare function _default$16(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/sl.d.cts
declare function _default$15(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/sv.d.cts
declare function _default$14(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ta.d.cts
declare function _default$13(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/th.d.cts
declare function _default$12(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/tk.d.cts
declare function _default$11(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/tr.d.cts
declare function _default$10(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ua.d.cts
declare function _default$9(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/uk.d.cts
declare function _default$8(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ur.d.cts
declare function _default$7(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/uz.d.cts
declare function _default$6(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/vi.d.cts
declare function _default$5(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/zh-CN.d.cts
declare function _default$4(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/zh-TW.d.cts
declare function _default$3(): {
  localeError: $ZodErrorMap;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/yo.d.cts
declare function _default$2(): {
  localeError: $ZodErrorMap;
};
declare namespace index_d_exports$2 {
  export { _default$63 as ar, _default$62 as az, _default$61 as be, _default$60 as bg, _default$59 as bn, _default$58 as ca, _default$57 as ckb, _default$56 as cs, _default$55 as da, _default$54 as de, _default$53 as el, _default$52 as en, _default$51 as eo, _default$50 as es, _default$49 as fa, _default$48 as fi, _default$47 as fr, _default$46 as frCA, _default$45 as gu, _default$44 as he, _default$43 as hi, _default$42 as hr, _default$41 as hu, _default$40 as hy, _default$39 as id, _default$38 as is, _default$37 as it, _default$36 as ja, _default$35 as ka, _default$34 as kh, _default$33 as km, _default$32 as kn, _default$31 as ko, _default$30 as lt, _default$29 as mk, _default$28 as ms, _default$27 as ne, _default$26 as nl, _default$25 as nn, _default$24 as no, _default$23 as ota, _default$21 as pl, _default$22 as ps, _default$20 as pt, _default$19 as ptBR, _default$18 as ro, _default$17 as ru, _default$16 as sk, _default$15 as sl, _default$14 as sv, _default$13 as ta, _default$12 as th, _default$11 as tk, _default$10 as tr, _default$9 as ua, _default$8 as uk, _default$7 as ur, _default$6 as uz, _default$5 as vi, _default$2 as yo, _default$4 as zhCN, _default$3 as zhTW };
}
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/doc.d.cts
type ModeWriter = (doc: Doc, modes: {
  execution: "sync" | "async";
}) => void;
declare class Doc {
  args: string[];
  /** Bindings the compiled function closes over, by name. */
  closed: Record<string, unknown>;
  content: string[];
  indent: number;
  constructor(args?: string[], closed?: Record<string, unknown>);
  indented(fn: (doc: Doc) => void): void;
  write(fn: ModeWriter): void;
  write(line: string): void;
  compile(): any;
}
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/compile.d.cts
/** Sentinel value returned by the compiled fast path when validation fails. Internal. */
declare const INVALID: unique symbol;
type INVALID = typeof INVALID;
interface CompileFnOptions {
  debug?: boolean | undefined;
  /** Emit a validator instead of a parser: skip building the output value where nothing reads it. */
  assertOnly?: boolean | undefined;
}
type CompiledFn<T> = ((input: unknown) => T | INVALID) & {
  code?: string | undefined;
};
/** Raised when the schema contains async refinements or transforms. Surfaces only under `compile(schema, { strict: true })`. */
declare class ZodCompileAsyncError extends Error {
  constructor(message?: string);
}
/**
 * Raised when the schema contains a feature whose semantics the fast path
 * can't fully model. Both the shim in `zod/compile` and the default
 * `compile()` fall back to the runtime parser for that schema; only
 * `compile(schema, { strict: true })` lets it surface.
 */
declare class ZodCompileUnsupportedError extends Error {
  /** Whether a container may absorb this refusal by running the child through the runtime (see `compileChild`). False when running only that node on the runtime is not equivalent to running the whole parse there — a runtime island gets no parse context, so a node that *consumes* issues rather than propagating them would finalize them against the wrong error map and still succeed. */
  readonly islandable: boolean;
  constructor(feature: string, islandable?: boolean);
}
interface CompileOptions {
  /** Throw the refusal instead of returning the schema uncompiled. */
  strict?: boolean | undefined;
}
/**
 * AOT-compile a Zod schema. Returns a clone whose `_zod.run` calls a generated
 * fast path first and falls back to the original runtime parser on failure.
 *
 * - Forward direction only. Backward (encode), async, and `skipChecks` paths
 *   bypass the fast path and use the runtime directly.
 * - Never throws. A schema the fast path can't model is returned unchanged and
 *   keeps using the runtime parser. Pass `{ strict: true }` to get the refusal
 *   as a thrown `ZodCompileUnsupportedError` / `ZodCompileAsyncError` instead.
 * - The original schema is unchanged. The clone shares children by reference.
 */
declare function compile<T extends SomeType>(schema: T, options?: CompileOptions): T;
/**
 * Generate the standalone compiled function: a parser by default, a validator under
 * `assertOnly`. Returns either the parsed value, `true` where nothing reads the output,
 * or the `INVALID` sentinel. Internal — consumers should use `compile()`.
 */
declare function compileFn<T extends SomeType>(schema: T, options?: CompileFnOptions): CompiledFn<output$1<T>>;
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/api.d.cts
type Params<T extends $ZodType | $ZodCheck, IssueTypes extends $ZodIssueBase, OmitKeys extends keyof T["_zod"]["def"] = never> = Flatten<Partial<EmptyToNever<Omit<T["_zod"]["def"], OmitKeys> & ([IssueTypes] extends [never] ? {} : {
  error?: string | $ZodErrorMap<IssueTypes> | undefined;
  /** @deprecated This parameter is deprecated. Use `error` instead. */
  message?: string | undefined;
})>>>;
type TypeParams<T extends $ZodType = $ZodType & {
  _isst: never;
}, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error"> = never> = Params<T, NonNullable<T["_zod"]["isst"]>, "type" | "checks" | "error" | AlsoOmit>;
type CheckParams<T extends $ZodCheck = $ZodCheck // & { _issc: never },
, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "check" | "error"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "check" | "error" | AlsoOmit>;
type StringFormatParams<T extends $ZodStringFormat = $ZodStringFormat, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "coerce" | "checks" | "error" | "check" | "format"> = never> = Params<T, NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>, "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit>;
type CheckStringFormatParams<T extends $ZodStringFormat = $ZodStringFormat, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "coerce" | "checks" | "error" | "check" | "format"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit>;
type CheckTypeParams<T extends $ZodType & $ZodCheck = $ZodType & $ZodCheck, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error" | "check"> = never> = Params<T, NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>, "type" | "checks" | "error" | "check" | AlsoOmit>;
type $ZodStringParams = TypeParams<$ZodString<string>, "coerce">;
declare function _string<T extends $ZodString>(Class: SchemaClass<T>, params?: string | $ZodStringParams): T;
declare function _coercedString<T extends $ZodString>(Class: SchemaClass<T>, params?: string | $ZodStringParams): T;
type $ZodStringFormatParams = CheckTypeParams<$ZodStringFormat, "format" | "coerce" | "when" | "pattern">;
type $ZodCheckStringFormatParams = CheckParams<$ZodCheckStringFormat, "format">;
type $ZodEmailParams = StringFormatParams<$ZodEmail, "when">;
type $ZodCheckEmailParams = CheckStringFormatParams<$ZodEmail, "when">;
declare function _email<T extends $ZodEmail>(Class: SchemaClass<T>, params?: string | $ZodEmailParams | $ZodCheckEmailParams): T;
type $ZodGUIDParams = StringFormatParams<$ZodGUID, "pattern" | "when">;
type $ZodCheckGUIDParams = CheckStringFormatParams<$ZodGUID, "pattern" | "when">;
declare function _guid<T extends $ZodGUID>(Class: SchemaClass<T>, params?: string | $ZodGUIDParams | $ZodCheckGUIDParams): T;
type $ZodUUIDParams = StringFormatParams<$ZodUUID, "pattern" | "when">;
type $ZodCheckUUIDParams = CheckStringFormatParams<$ZodUUID, "pattern" | "when">;
declare function _uuid<T extends $ZodUUID>(Class: SchemaClass<T>, params?: string | $ZodUUIDParams | $ZodCheckUUIDParams): T;
type $ZodUUIDv4Params = StringFormatParams<$ZodUUID, "pattern" | "when">;
type $ZodCheckUUIDv4Params = CheckStringFormatParams<$ZodUUID, "pattern" | "when">;
declare function _uuidv4<T extends $ZodUUID>(Class: SchemaClass<T>, params?: string | $ZodUUIDv4Params | $ZodCheckUUIDv4Params): T;
type $ZodUUIDv6Params = StringFormatParams<$ZodUUID, "pattern" | "when">;
type $ZodCheckUUIDv6Params = CheckStringFormatParams<$ZodUUID, "pattern" | "when">;
declare function _uuidv6<T extends $ZodUUID>(Class: SchemaClass<T>, params?: string | $ZodUUIDv6Params | $ZodCheckUUIDv6Params): T;
type $ZodUUIDv7Params = StringFormatParams<$ZodUUID, "pattern" | "when">;
type $ZodCheckUUIDv7Params = CheckStringFormatParams<$ZodUUID, "pattern" | "when">;
declare function _uuidv7<T extends $ZodUUID>(Class: SchemaClass<T>, params?: string | $ZodUUIDv7Params | $ZodCheckUUIDv7Params): T;
type $ZodURLParams = StringFormatParams<$ZodURL, "when">;
type $ZodCheckURLParams = CheckStringFormatParams<$ZodURL, "when">;
declare function _url<T extends $ZodURL>(Class: SchemaClass<T>, params?: string | $ZodURLParams | $ZodCheckURLParams): T;
type $ZodEmojiParams = StringFormatParams<$ZodEmoji, "when">;
type $ZodCheckEmojiParams = CheckStringFormatParams<$ZodEmoji, "when">;
declare function _emoji<T extends $ZodEmoji>(Class: SchemaClass<T>, params?: string | $ZodEmojiParams | $ZodCheckEmojiParams): T;
type $ZodNanoIDParams = StringFormatParams<$ZodNanoID, "when" | "pattern">;
type $ZodCheckNanoIDParams = CheckStringFormatParams<$ZodNanoID, "when" | "pattern">;
declare function _nanoid<T extends $ZodNanoID>(Class: SchemaClass<T>, params?: string | $ZodNanoIDParams | $ZodCheckNanoIDParams): T;
/**
 * @deprecated CUID v1 is deprecated by its authors due to information leakage
 * (timestamps embedded in the id). Use {@link _cuid2} instead.
 * See https://github.com/paralleldrive/cuid.
 */
type $ZodCUIDParams = StringFormatParams<$ZodCUID, "when">;
/**
 * @deprecated CUID v1 is deprecated by its authors due to information leakage
 * (timestamps embedded in the id). Use {@link _cuid2} instead.
 * See https://github.com/paralleldrive/cuid.
 */
type $ZodCheckCUIDParams = CheckStringFormatParams<$ZodCUID, "when">;
/**
 * @deprecated CUID v1 is deprecated by its authors due to information leakage
 * (timestamps embedded in the id). Use {@link _cuid2} instead.
 * See https://github.com/paralleldrive/cuid.
 */
declare function _cuid<T extends $ZodCUID>(Class: SchemaClass<T>, params?: string | $ZodCUIDParams | $ZodCheckCUIDParams): T;
type $ZodCUID2Params = StringFormatParams<$ZodCUID2, "when">;
type $ZodCheckCUID2Params = CheckStringFormatParams<$ZodCUID2, "when">;
declare function _cuid2<T extends $ZodCUID2>(Class: SchemaClass<T>, params?: string | $ZodCUID2Params | $ZodCheckCUID2Params): T;
type $ZodULIDParams = StringFormatParams<$ZodULID, "when">;
type $ZodCheckULIDParams = CheckStringFormatParams<$ZodULID, "when">;
declare function _ulid<T extends $ZodULID>(Class: SchemaClass<T>, params?: string | $ZodULIDParams | $ZodCheckULIDParams): T;
type $ZodXIDParams = StringFormatParams<$ZodXID, "when">;
type $ZodCheckXIDParams = CheckStringFormatParams<$ZodXID, "when">;
declare function _xid<T extends $ZodXID>(Class: SchemaClass<T>, params?: string | $ZodXIDParams | $ZodCheckXIDParams): T;
type $ZodKSUIDParams = StringFormatParams<$ZodKSUID, "when">;
type $ZodCheckKSUIDParams = CheckStringFormatParams<$ZodKSUID, "when">;
declare function _ksuid<T extends $ZodKSUID>(Class: SchemaClass<T>, params?: string | $ZodKSUIDParams | $ZodCheckKSUIDParams): T;
type $ZodIPv4Params = StringFormatParams<$ZodIPv4, "pattern" | "when" | "version">;
type $ZodCheckIPv4Params = CheckStringFormatParams<$ZodIPv4, "pattern" | "when" | "version">;
declare function _ipv4<T extends $ZodIPv4>(Class: SchemaClass<T>, params?: string | $ZodIPv4Params | $ZodCheckIPv4Params): T;
type $ZodIPv6Params = StringFormatParams<$ZodIPv6, "pattern" | "when" | "version">;
type $ZodCheckIPv6Params = CheckStringFormatParams<$ZodIPv6, "pattern" | "when" | "version">;
declare function _ipv6<T extends $ZodIPv6>(Class: SchemaClass<T>, params?: string | $ZodIPv6Params | $ZodCheckIPv6Params): T;
type $ZodMACParams = StringFormatParams<$ZodMAC, "pattern" | "when">;
type $ZodCheckMACParams = CheckStringFormatParams<$ZodMAC, "pattern" | "when">;
declare function _mac<T extends $ZodMAC>(Class: SchemaClass<T>, params?: string | $ZodMACParams | $ZodCheckMACParams): T;
type $ZodCIDRv4Params = StringFormatParams<$ZodCIDRv4, "pattern" | "when">;
type $ZodCheckCIDRv4Params = CheckStringFormatParams<$ZodCIDRv4, "pattern" | "when">;
declare function _cidrv4<T extends $ZodCIDRv4>(Class: SchemaClass<T>, params?: string | $ZodCIDRv4Params | $ZodCheckCIDRv4Params): T;
type $ZodCIDRv6Params = StringFormatParams<$ZodCIDRv6, "pattern" | "when">;
type $ZodCheckCIDRv6Params = CheckStringFormatParams<$ZodCIDRv6, "pattern" | "when">;
declare function _cidrv6<T extends $ZodCIDRv6>(Class: SchemaClass<T>, params?: string | $ZodCIDRv6Params | $ZodCheckCIDRv6Params): T;
type $ZodBase64Params = StringFormatParams<$ZodBase64, "pattern" | "when">;
type $ZodCheckBase64Params = CheckStringFormatParams<$ZodBase64, "pattern" | "when">;
declare function _base64<T extends $ZodBase64>(Class: SchemaClass<T>, params?: string | $ZodBase64Params | $ZodCheckBase64Params): T;
type $ZodBase64URLParams = StringFormatParams<$ZodBase64URL, "pattern" | "when">;
type $ZodCheckBase64URLParams = CheckStringFormatParams<$ZodBase64URL, "pattern" | "when">;
declare function _base64url<T extends $ZodBase64URL>(Class: SchemaClass<T>, params?: string | $ZodBase64URLParams | $ZodCheckBase64URLParams): T;
type $ZodE164Params = StringFormatParams<$ZodE164, "when">;
type $ZodCheckE164Params = CheckStringFormatParams<$ZodE164, "when">;
declare function _e164<T extends $ZodE164>(Class: SchemaClass<T>, params?: string | $ZodE164Params | $ZodCheckE164Params): T;
type $ZodCreditCardParams = StringFormatParams<$ZodCreditCard, "pattern" | "when">;
type $ZodCheckCreditCardParams = CheckStringFormatParams<$ZodCreditCard, "pattern" | "when">;
declare function _creditCard<T extends $ZodCreditCard>(Class: SchemaClass<T>, params?: string | $ZodCreditCardParams | $ZodCheckCreditCardParams): T;
type $ZodJWTParams = StringFormatParams<$ZodJWT, "pattern" | "when">;
type $ZodCheckJWTParams = CheckStringFormatParams<$ZodJWT, "pattern" | "when">;
declare function _jwt<T extends $ZodJWT>(Class: SchemaClass<T>, params?: string | $ZodJWTParams | $ZodCheckJWTParams): T;
declare const TimePrecision: {
  readonly Any: null;
  readonly Minute: -1;
  readonly Second: 0;
  readonly Millisecond: 3;
  readonly Microsecond: 6;
};
type $ZodISODateTimeParams = StringFormatParams<$ZodISODateTime, "pattern" | "when">;
type $ZodCheckISODateTimeParams = CheckStringFormatParams<$ZodISODateTime, "pattern" | "when">;
declare function _isoDateTime<T extends $ZodISODateTime>(Class: SchemaClass<T>, params?: string | $ZodISODateTimeParams | $ZodCheckISODateTimeParams): T;
type $ZodISODateParams = StringFormatParams<$ZodISODate, "pattern" | "when">;
type $ZodCheckISODateParams = CheckStringFormatParams<$ZodISODate, "pattern" | "when">;
declare function _isoDate<T extends $ZodISODate>(Class: SchemaClass<T>, params?: string | $ZodISODateParams | $ZodCheckISODateParams): T;
type $ZodISOTimeParams = StringFormatParams<$ZodISOTime, "pattern" | "when">;
type $ZodCheckISOTimeParams = CheckStringFormatParams<$ZodISOTime, "pattern" | "when">;
declare function _isoTime<T extends $ZodISOTime>(Class: SchemaClass<T>, params?: string | $ZodISOTimeParams | $ZodCheckISOTimeParams): T;
type $ZodISODurationParams = StringFormatParams<$ZodISODuration, "when">;
type $ZodCheckISODurationParams = CheckStringFormatParams<$ZodISODuration, "when">;
declare function _isoDuration<T extends $ZodISODuration>(Class: SchemaClass<T>, params?: string | $ZodISODurationParams | $ZodCheckISODurationParams): T;
type $ZodNumberParams = TypeParams<$ZodNumber<number>, "coerce">;
type $ZodNumberFormatParams = CheckTypeParams<$ZodNumberFormat, "format" | "coerce">;
type $ZodCheckNumberFormatParams = CheckParams<$ZodCheckNumberFormat, "format" | "when">;
declare function _number<T extends $ZodNumber>(Class: SchemaClass<T>, params?: string | $ZodNumberParams): T;
declare function _coercedNumber<T extends $ZodNumber>(Class: SchemaClass<T>, params?: string | $ZodNumberParams): T;
declare function _int<T extends $ZodNumberFormat>(Class: SchemaClass<T>, params?: string | $ZodCheckNumberFormatParams): T;
declare function _float32<T extends $ZodNumberFormat>(Class: SchemaClass<T>, params?: string | $ZodCheckNumberFormatParams): T;
declare function _float64<T extends $ZodNumberFormat>(Class: SchemaClass<T>, params?: string | $ZodCheckNumberFormatParams): T;
declare function _int32<T extends $ZodNumberFormat>(Class: SchemaClass<T>, params?: string | $ZodCheckNumberFormatParams): T;
declare function _uint32<T extends $ZodNumberFormat>(Class: SchemaClass<T>, params?: string | $ZodCheckNumberFormatParams): T;
type $ZodBooleanParams = TypeParams<$ZodBoolean<boolean>, "coerce">;
declare function _boolean<T extends $ZodBoolean>(Class: SchemaClass<T>, params?: string | $ZodBooleanParams): T;
declare function _coercedBoolean<T extends $ZodBoolean>(Class: SchemaClass<T>, params?: string | $ZodBooleanParams): T;
type $ZodBigIntParams = TypeParams<$ZodBigInt<bigint>>;
type $ZodBigIntFormatParams = CheckTypeParams<$ZodBigIntFormat, "format" | "coerce">;
type $ZodCheckBigIntFormatParams = CheckParams<$ZodCheckBigIntFormat, "format" | "when">;
declare function _bigint<T extends $ZodBigInt>(Class: SchemaClass<T>, params?: string | $ZodBigIntParams): T;
declare function _coercedBigint<T extends $ZodBigInt>(Class: SchemaClass<T>, params?: string | $ZodBigIntParams): T;
declare function _int64<T extends $ZodBigIntFormat>(Class: SchemaClass<T>, params?: string | $ZodBigIntFormatParams): T;
declare function _uint64<T extends $ZodBigIntFormat>(Class: SchemaClass<T>, params?: string | $ZodBigIntFormatParams): T;
type $ZodSymbolParams = TypeParams<$ZodSymbol>;
declare function _symbol<T extends $ZodSymbol>(Class: SchemaClass<T>, params?: string | $ZodSymbolParams): T;
type $ZodUndefinedParams = TypeParams<$ZodUndefined>;
declare function _undefined$1<T extends $ZodUndefined>(Class: SchemaClass<T>, params?: string | $ZodUndefinedParams): T;
type $ZodNullParams = TypeParams<$ZodNull>;
declare function _null$1<T extends $ZodNull>(Class: SchemaClass<T>, params?: string | $ZodNullParams): T;
type $ZodAnyParams = TypeParams<$ZodAny>;
declare function _any<T extends $ZodAny>(Class: SchemaClass<T>): T;
type $ZodUnknownParams = TypeParams<$ZodUnknown>;
declare function _unknown<T extends $ZodUnknown>(Class: SchemaClass<T>): T;
type $ZodNeverParams = TypeParams<$ZodNever>;
declare function _never<T extends $ZodNever>(Class: SchemaClass<T>, params?: string | $ZodNeverParams): T;
type $ZodVoidParams = TypeParams<$ZodVoid>;
declare function _void$1<T extends $ZodVoid>(Class: SchemaClass<T>, params?: string | $ZodVoidParams): T;
type $ZodDateParams = TypeParams<$ZodDate, "coerce">;
declare function _date<T extends $ZodDate>(Class: SchemaClass<T>, params?: string | $ZodDateParams): T;
declare function _coercedDate<T extends $ZodDate>(Class: SchemaClass<T>, params?: string | $ZodDateParams): T;
type $ZodNaNParams = TypeParams<$ZodNaN>;
declare function _nan<T extends $ZodNaN>(Class: SchemaClass<T>, params?: string | $ZodNaNParams): T;
type $ZodCheckLessThanParams = CheckParams<$ZodCheckLessThan, "inclusive" | "value" | "when">;
declare function _lt(value: Numeric, params?: string | $ZodCheckLessThanParams): $ZodCheckLessThan<Numeric>;
declare function _lte(value: Numeric, params?: string | $ZodCheckLessThanParams): $ZodCheckLessThan<Numeric>;
type $ZodCheckGreaterThanParams = CheckParams<$ZodCheckGreaterThan, "inclusive" | "value" | "when">;
declare function _gt(value: Numeric, params?: string | $ZodCheckGreaterThanParams): $ZodCheckGreaterThan;
declare function _gte(value: Numeric, params?: string | $ZodCheckGreaterThanParams): $ZodCheckGreaterThan;
declare function _positive(params?: string | $ZodCheckGreaterThanParams): $ZodCheckGreaterThan;
declare function _negative(params?: string | $ZodCheckLessThanParams): $ZodCheckLessThan;
declare function _nonpositive(params?: string | $ZodCheckLessThanParams): $ZodCheckLessThan;
declare function _nonnegative(params?: string | $ZodCheckGreaterThanParams): $ZodCheckGreaterThan;
type $ZodCheckMultipleOfParams = CheckParams<$ZodCheckMultipleOf, "value" | "when">;
declare function _multipleOf(value: number | bigint, params?: string | $ZodCheckMultipleOfParams): $ZodCheckMultipleOf;
type $ZodCheckMaxSizeParams = CheckParams<$ZodCheckMaxSize, "maximum" | "when">;
declare function _maxSize(maximum: number, params?: string | $ZodCheckMaxSizeParams): $ZodCheckMaxSize<HasSize>;
type $ZodCheckMinSizeParams = CheckParams<$ZodCheckMinSize, "minimum" | "when">;
declare function _minSize(minimum: number, params?: string | $ZodCheckMinSizeParams): $ZodCheckMinSize<HasSize>;
type $ZodCheckSizeEqualsParams = CheckParams<$ZodCheckSizeEquals, "size" | "when">;
declare function _size(size: number, params?: string | $ZodCheckSizeEqualsParams): $ZodCheckSizeEquals<HasSize>;
type $ZodCheckMaxLengthParams = CheckParams<$ZodCheckMaxLength, "maximum" | "when">;
declare function _maxLength(maximum: number, params?: string | $ZodCheckMaxLengthParams): $ZodCheckMaxLength<HasLength>;
type $ZodCheckMinLengthParams = CheckParams<$ZodCheckMinLength, "minimum" | "when">;
declare function _minLength(minimum: number, params?: string | $ZodCheckMinLengthParams): $ZodCheckMinLength<HasLength>;
type $ZodCheckLengthEqualsParams = CheckParams<$ZodCheckLengthEquals, "length" | "when">;
declare function _length(length: number, params?: string | $ZodCheckLengthEqualsParams): $ZodCheckLengthEquals<HasLength>;
type $ZodCheckRegexParams = CheckParams<$ZodCheckRegex, "format" | "pattern" | "when">;
declare function _regex(pattern: RegExp, params?: string | $ZodCheckRegexParams): $ZodCheckRegex;
type $ZodCheckLowerCaseParams = CheckParams<$ZodCheckLowerCase, "format" | "when">;
declare function _lowercase(params?: string | $ZodCheckLowerCaseParams): $ZodCheckLowerCase;
type $ZodCheckUpperCaseParams = CheckParams<$ZodCheckUpperCase, "format" | "when">;
declare function _uppercase(params?: string | $ZodCheckUpperCaseParams): $ZodCheckUpperCase;
type $ZodCheckIncludesParams = CheckParams<$ZodCheckIncludes, "includes" | "format" | "when" | "pattern">;
declare function _includes(includes: string, params?: string | $ZodCheckIncludesParams): $ZodCheckIncludes;
type $ZodCheckStartsWithParams = CheckParams<$ZodCheckStartsWith, "prefix" | "format" | "when" | "pattern">;
declare function _startsWith(prefix: string, params?: string | $ZodCheckStartsWithParams): $ZodCheckStartsWith;
type $ZodCheckEndsWithParams = CheckParams<$ZodCheckEndsWith, "suffix" | "format" | "pattern" | "when">;
declare function _endsWith(suffix: string, params?: string | $ZodCheckEndsWithParams): $ZodCheckEndsWith;
type $ZodCheckPropertyParams = CheckParams<$ZodCheckProperty, "property" | "schema" | "when">;
declare function _property<K extends string, T extends $ZodType>(property: K, schema: T, params?: string | $ZodCheckPropertyParams): $ZodCheckProperty<{ [k in K]: output$1<T>; }>;
declare function _properties<Shape extends $ZodShape>(shape: Shape): $ZodCheckProperty<{ -readonly [k in keyof Shape]: output$1<Shape[k]>; }>[];
type $ZodCheckMimeTypeParams = CheckParams<$ZodCheckMimeType, "mime" | "when">;
declare function _mime(types: MimeTypes[], params?: string | $ZodCheckMimeTypeParams): $ZodCheckMimeType;
declare function _overwrite<T>(tx: (input: T) => T): $ZodCheckOverwrite<T>;
declare function _normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): $ZodCheckOverwrite<string>;
declare function _trim(): $ZodCheckOverwrite<string>;
declare function _toLowerCase(): $ZodCheckOverwrite<string>;
declare function _toUpperCase(): $ZodCheckOverwrite<string>;
declare function _slugify(): $ZodCheckOverwrite<string>;
type $ZodArrayParams = TypeParams<$ZodArray, "element">;
declare function _array<T extends $ZodType>(Class: SchemaClass<$ZodArray>, element: T, params?: string | $ZodArrayParams): $ZodArray<T>;
type $ZodObjectParams = TypeParams<$ZodObject, "shape" | "catchall">;
type $ZodUnionParams = TypeParams<$ZodUnion, "options">;
declare function _union<const T extends readonly $ZodObject[]>(Class: SchemaClass<$ZodUnion>, options: T, params?: string | $ZodUnionParams): $ZodUnion<T>;
type $ZodXorParams = TypeParams<$ZodXor, "options">;
declare function _xor<const T extends readonly $ZodObject[]>(Class: SchemaClass<$ZodXor>, options: T, params?: string | $ZodXorParams): $ZodXor<T>;
interface $ZodTypeDiscriminableInternals<_Disc extends string = string> extends _$ZodTypeInternals {
  propValues: PropValues;
}
interface $ZodTypeDiscriminable<_Disc extends string = string> extends SomeType {
  _zod: $ZodTypeDiscriminableInternals;
}
type $ZodDiscriminatedUnionParams = TypeParams<$ZodDiscriminatedUnion, "options" | "discriminator">;
declare function _discriminatedUnion<Types extends [$ZodTypeDiscriminable, ...$ZodTypeDiscriminable[]], Disc extends string>(Class: SchemaClass<$ZodDiscriminatedUnion>, discriminator: Disc, options: Types, params?: string | $ZodDiscriminatedUnionParams): $ZodDiscriminatedUnion<Types, Disc>;
type $ZodIntersectionParams = TypeParams<$ZodIntersection, "left" | "right">;
declare function _intersection<T extends $ZodObject, U extends $ZodObject>(Class: SchemaClass<$ZodIntersection>, left: T, right: U): $ZodIntersection<T, U>;
type $ZodTupleParams = TypeParams<$ZodTuple, "items" | "rest">;
declare function _tuple<T extends readonly [$ZodType, ...$ZodType[]]>(Class: SchemaClass<$ZodTuple>, items: T, params?: string | $ZodTupleParams): $ZodTuple<T, null>;
declare function _tuple<T extends readonly [$ZodType, ...$ZodType[]], Rest extends $ZodType>(Class: SchemaClass<$ZodTuple>, items: T, rest: Rest, params?: string | $ZodTupleParams): $ZodTuple<T, Rest>;
type $ZodRecordParams = TypeParams<$ZodRecord, "keyType" | "valueType" | "partial">;
declare function _record<Key extends $ZodRecordKey, Value extends $ZodObject>(Class: SchemaClass<$ZodRecord>, keyType: Key, valueType: Value, params?: string | $ZodRecordParams): $ZodRecord<Key, Value>;
type $ZodMapParams = TypeParams<$ZodMap, "keyType" | "valueType">;
declare function _map<Key extends $ZodObject, Value extends $ZodObject>(Class: SchemaClass<$ZodMap>, keyType: Key, valueType: Value, params?: string | $ZodMapParams): $ZodMap<Key, Value>;
type $ZodSetParams = TypeParams<$ZodSet, "valueType">;
declare function _set<Value extends $ZodObject>(Class: SchemaClass<$ZodSet>, valueType: Value, params?: string | $ZodSetParams): $ZodSet<Value>;
type $ZodEnumParams = TypeParams<$ZodEnum, "entries">;
declare function _enum$1<const T extends string[]>(Class: SchemaClass<$ZodEnum>, values: T, params?: string | $ZodEnumParams): $ZodEnum<ToEnum<T[number]>>;
declare function _enum$1<T extends EnumLike>(Class: SchemaClass<$ZodEnum>, entries: T, params?: string | $ZodEnumParams): $ZodEnum<T>;
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
 *
 * ```ts
 * enum Colors { red, green, blue }
 * z.enum(Colors);
 * ```
 */
declare function _nativeEnum<T extends EnumLike>(Class: SchemaClass<$ZodEnum>, entries: T, params?: string | $ZodEnumParams): $ZodEnum<T>;
type $ZodLiteralParams = TypeParams<$ZodLiteral, "values">;
declare function _literal<const T extends Array<Literal>>(Class: SchemaClass<$ZodLiteral>, value: T, params?: string | $ZodLiteralParams): $ZodLiteral<T[number]>;
declare function _literal<const T extends Literal>(Class: SchemaClass<$ZodLiteral>, value: T, params?: string | $ZodLiteralParams): $ZodLiteral<T>;
type $ZodFileParams = TypeParams<$ZodFile>;
declare function _file(Class: SchemaClass<$ZodFile>, params?: string | $ZodFileParams): $ZodFile;
type $ZodTransformParams = TypeParams<$ZodTransform, "transform">;
declare function _transform<I = unknown, O = I>(Class: SchemaClass<$ZodTransform>, fn: (input: I, ctx?: ParsePayload) => O): $ZodTransform<Awaited<O>, I>;
type $ZodOptionalParams = TypeParams<$ZodOptional, "innerType">;
declare function _optional<T extends $ZodObject>(Class: SchemaClass<$ZodOptional>, innerType: T): $ZodOptional<T>;
type $ZodNullableParams = TypeParams<$ZodNullable, "innerType">;
declare function _nullable<T extends $ZodObject>(Class: SchemaClass<$ZodNullable>, innerType: T): $ZodNullable<T>;
type $ZodDefaultParams = TypeParams<$ZodDefault, "innerType" | "defaultValue">;
declare function _default$1<T extends $ZodObject>(Class: SchemaClass<$ZodDefault>, innerType: T, defaultValue: NoUndefined<output$1<T>> | (() => NoUndefined<output$1<T>>)): $ZodDefault<T>;
type $ZodNonOptionalParams = TypeParams<$ZodNonOptional, "innerType">;
declare function _nonoptional<T extends $ZodObject>(Class: SchemaClass<$ZodNonOptional>, innerType: T, params?: string | $ZodNonOptionalParams): $ZodNonOptional<T>;
type $ZodSuccessParams = TypeParams<$ZodSuccess, "innerType">;
declare function _success<T extends $ZodObject>(Class: SchemaClass<$ZodSuccess>, innerType: T): $ZodSuccess<T>;
type $ZodCatchParams = TypeParams<$ZodCatch, "innerType" | "catchValue">;
declare function _catch$1<T extends $ZodObject>(Class: SchemaClass<$ZodCatch>, innerType: T, catchValue: output$1<T> | ((ctx: $ZodCatchCtx) => output$1<T>)): $ZodCatch<T>;
type $ZodPipeParams = TypeParams<$ZodPipe, "in" | "out">;
declare function _pipe<const A extends $ZodType, B extends $ZodType<unknown, output$1<A>> = $ZodType<unknown, output$1<A>>>(Class: SchemaClass<$ZodPipe>, in_: A, out: B | $ZodType<unknown, output$1<A>>): $ZodPipe<A, B>;
type $ZodReadonlyParams = TypeParams<$ZodReadonly, "innerType">;
declare function _readonly<T extends $ZodObject>(Class: SchemaClass<$ZodReadonly>, innerType: T): $ZodReadonly<T>;
type $ZodTemplateLiteralParams = TypeParams<$ZodTemplateLiteral, "parts">;
declare function _templateLiteral<const Parts extends $ZodTemplateLiteralPart[]>(Class: SchemaClass<$ZodTemplateLiteral>, parts: Parts, params?: string | $ZodTemplateLiteralParams): $ZodTemplateLiteral<$PartsToTemplateLiteral<Parts>>;
type $ZodLazyParams = TypeParams<$ZodLazy, "getter">;
declare function _lazy<T extends $ZodType>(Class: SchemaClass<$ZodLazy>, getter: () => T): $ZodLazy<T>;
type $ZodPromiseParams = TypeParams<$ZodPromise, "innerType">;
declare function _promise<T extends $ZodObject>(Class: SchemaClass<$ZodPromise>, innerType: T): $ZodPromise<T>;
type $ZodCustomParams = CheckTypeParams<$ZodCustom, "fn">;
declare function _custom<O = unknown, I = O>(Class: SchemaClass<$ZodCustom>, fn: (data: O) => unknown, _params: string | $ZodCustomParams | undefined): $ZodCustom<O, I>;
declare function _refine<O = unknown, I = O>(Class: SchemaClass<$ZodCustom>, fn: (data: O) => unknown, _params: string | $ZodCustomParams | undefined): $ZodCustom<O, I>;
type $ZodSuperRefineIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
type RawIssue<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
  /** The schema or check that originated this issue. */
  readonly inst?: $ZodType | $ZodCheck;
  /** If `true`, Zod will execute subsequent checks/refinements instead of immediately aborting */
  readonly continue?: boolean | undefined;
} & Record<string, unknown>> : never;
interface $RefinementCtx<T = unknown> extends ParsePayload<T> {
  addIssue(arg: string | $ZodSuperRefineIssue): void;
}
interface $ZodSuperRefineParams {
  /** If provided, the refinement runs only when this returns `true`. By default, it is skipped if prior parsing produced aborting issues. */
  when?: ((payload: ParsePayload) => boolean) | undefined;
}
declare function _superRefine<T>(fn: (arg: T, payload: $RefinementCtx<T>) => void | Promise<void>, params?: $ZodSuperRefineParams): $ZodCheck<T>;
declare function _check<O = unknown>(fn: CheckFn<O>, params?: string | $ZodCustomParams): $ZodCheck<O>;
declare function describe$1<T>(description: string): $ZodCheck<T>;
declare function meta$1<T>(metadata: GlobalMeta): $ZodCheck<T>;
interface $ZodStringBoolParams extends TypeParams {
  truthy?: string[];
  falsy?: string[];
  /**
   * Options: `"sensitive"`, `"insensitive"`
   *
   * @default `"insensitive"`
   */
  case?: "sensitive" | "insensitive" | undefined;
}
declare function _stringbool(Classes: {
  Codec?: typeof $ZodCodec;
  Boolean?: typeof $ZodBoolean;
  String?: typeof $ZodString;
}, _params?: string | $ZodStringBoolParams): $ZodCodec<$ZodString, $ZodBoolean>;
declare function _stringFormat<Format extends string>(Class: typeof $ZodCustomStringFormat, format: Format, fnOrRegex: ((arg: string) => MaybeAsync<unknown>) | RegExp, _params?: string | $ZodStringFormatParams): $ZodCustomStringFormat<Format>;
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/json-schema-processors.d.cts
declare function toJSONSchema<T extends $ZodType>(schema: T, params?: ToJSONSchemaParams): ZodStandardJSONSchemaPayload<T>;
declare function toJSONSchema(registry: $ZodRegistry<{
  id?: string | undefined;
}>, params?: RegistryToJSONSchemaParams): {
  schemas: Record<string, ZodStandardJSONSchemaPayload<$ZodType>>;
};
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/json-schema-generator.d.cts
/**
 * Parameters for the emit method of JSONSchemaGenerator.
 * @deprecated Use toJSONSchema function instead
 */
type EmitParams = Pick<JSONSchemaGeneratorParams, "cycles" | "reused" | "external">;
/**
 * Parameters for JSONSchemaGenerator constructor.
 * @deprecated Use toJSONSchema function instead
 */
type JSONSchemaGeneratorConstructorParams = Pick<JSONSchemaGeneratorParams, "metadata" | "target" | "unrepresentable" | "override" | "io">;
/**
 * Legacy class-based interface for JSON Schema generation.
 * This class wraps the new functional implementation to provide backward compatibility.
 *
 * @deprecated Use the `toJSONSchema` function instead for new code.
 *
 * @example
 * ```typescript
 * // Legacy usage (still supported)
 * const gen = new JSONSchemaGenerator({ target: "draft-07" });
 * gen.process(schema);
 * const result = gen.emit(schema);
 *
 * // Preferred modern usage
 * const result = toJSONSchema(schema, { target: "draft-07" });
 * ```
 */
declare class JSONSchemaGenerator {
  private ctx;
  /** @deprecated Access via ctx instead */
  get metadataRegistry(): $ZodRegistry<Record<string, any>>;
  /** @deprecated Access via ctx instead */
  get target(): ({} & string) | "draft-2020-12" | "draft-07" | "openapi-3.0" | "draft-04";
  /** @deprecated Access via ctx instead */
  get unrepresentable(): ToJSONSchemaContext["unrepresentable"];
  /** @deprecated Access via ctx instead */
  get override(): (ctx: {
    zodSchema: $ZodType;
    jsonSchema: BaseSchema;
    path: (string | number)[];
  }) => void;
  /** @deprecated Access via ctx instead */
  get io(): "input" | "output";
  /** @deprecated Access via ctx instead */
  get counter(): number;
  set counter(value: number);
  /** @deprecated Access via ctx instead */
  get seen(): Map<$ZodType, Seen>;
  constructor(params?: JSONSchemaGeneratorConstructorParams);
  /**
   * Process a schema to prepare it for JSON Schema generation.
   * This must be called before emit().
   */
  process(schema: $ZodType, _params?: ProcessParams): BaseSchema;
  /**
   * Emit the final JSON Schema after processing.
   * Must call process() first.
   */
  emit(schema: $ZodType, _params?: EmitParams): BaseSchema;
}
declare namespace index_d_exports$1 {
  export { $Decode, $DecodeAsync, $DiscriminatedOption, $DiscriminatorValue, $Encode, $EncodeAsync, $InferEnumInput, $InferEnumOutput, $InferInnerFunctionType, $InferInnerFunctionTypeAsync, $InferObjectInput, $InferObjectOutput, $InferOuterFunctionType, $InferOuterFunctionTypeAsync, $InferTupleInputType, $InferTupleOutputType, $InferUnionInput, $InferUnionOutput, $InferZodRecordInput, $InferZodRecordOutput, $Parse, $ParseAsync, $PartsToTemplateLiteral, $RefinementCtx, $SafeDecode, $SafeDecodeAsync, $SafeEncode, $SafeEncodeAsync, $SafeParse, $SafeParseAsync, $Validate, $ValidateAsync, $ZodAny, $ZodAnyDef, $ZodAnyInternals, $ZodAnyParams, $ZodArray, $ZodArrayDef, $ZodArrayInternals, $ZodArrayParams, $ZodAsyncError, $ZodBase64, $ZodBase64Def, $ZodBase64Internals, $ZodBase64Params, $ZodBase64URL, $ZodBase64URLDef, $ZodBase64URLInternals, $ZodBase64URLParams, $ZodBigInt, $ZodBigIntDef, $ZodBigIntFormat, $ZodBigIntFormatDef, $ZodBigIntFormatInternals, $ZodBigIntFormatParams, $ZodBigIntFormats, $ZodBigIntInternals, $ZodBigIntParams, $ZodBoolean, $ZodBooleanDef, $ZodBooleanInternals, $ZodBooleanParams, $ZodBranded, $ZodCIDRv4, $ZodCIDRv4Def, $ZodCIDRv4Internals, $ZodCIDRv4Params, $ZodCIDRv6, $ZodCIDRv6Def, $ZodCIDRv6Internals, $ZodCIDRv6Params, $ZodCUID, $ZodCUID2, $ZodCUID2Def, $ZodCUID2Internals, $ZodCUID2Params, $ZodCUIDDef, $ZodCUIDInternals, $ZodCUIDParams, $ZodCatch, $ZodCatchCtx, $ZodCatchDef, $ZodCatchInternals, $ZodCatchParams, $ZodCheck, $ZodCheckBase64Params, $ZodCheckBase64URLParams, $ZodCheckBigIntFormat, $ZodCheckBigIntFormatDef, $ZodCheckBigIntFormatInternals, $ZodCheckBigIntFormatParams, $ZodCheckCIDRv4Params, $ZodCheckCIDRv6Params, $ZodCheckCUID2Params, $ZodCheckCUIDParams, $ZodCheckCreditCardParams, $ZodCheckDef, $ZodCheckE164Params, $ZodCheckEmailParams, $ZodCheckEmojiParams, $ZodCheckEndsWith, $ZodCheckEndsWithDef, $ZodCheckEndsWithInternals, $ZodCheckEndsWithParams, $ZodCheckGUIDParams, $ZodCheckGreaterThan, $ZodCheckGreaterThanDef, $ZodCheckGreaterThanInternals, $ZodCheckGreaterThanParams, $ZodCheckIPv4Params, $ZodCheckIPv6Params, $ZodCheckISODateParams, $ZodCheckISODateTimeParams, $ZodCheckISODurationParams, $ZodCheckISOTimeParams, $ZodCheckIncludes, $ZodCheckIncludesDef, $ZodCheckIncludesInternals, $ZodCheckIncludesParams, $ZodCheckInternals, $ZodCheckJWTParams, $ZodCheckKSUIDParams, $ZodCheckLengthEquals, $ZodCheckLengthEqualsDef, $ZodCheckLengthEqualsInternals, $ZodCheckLengthEqualsParams, $ZodCheckLessThan, $ZodCheckLessThanDef, $ZodCheckLessThanInternals, $ZodCheckLessThanParams, $ZodCheckLowerCase, $ZodCheckLowerCaseDef, $ZodCheckLowerCaseInternals, $ZodCheckLowerCaseParams, $ZodCheckMACParams, $ZodCheckMaxLength, $ZodCheckMaxLengthDef, $ZodCheckMaxLengthInternals, $ZodCheckMaxLengthParams, $ZodCheckMaxSize, $ZodCheckMaxSizeDef, $ZodCheckMaxSizeInternals, $ZodCheckMaxSizeParams, $ZodCheckMimeType, $ZodCheckMimeTypeDef, $ZodCheckMimeTypeInternals, $ZodCheckMimeTypeParams, $ZodCheckMinLength, $ZodCheckMinLengthDef, $ZodCheckMinLengthInternals, $ZodCheckMinLengthParams, $ZodCheckMinSize, $ZodCheckMinSizeDef, $ZodCheckMinSizeInternals, $ZodCheckMinSizeParams, $ZodCheckMultipleOf, $ZodCheckMultipleOfDef, $ZodCheckMultipleOfInternals, $ZodCheckMultipleOfParams, $ZodCheckNanoIDParams, $ZodCheckNumberFormat, $ZodCheckNumberFormatDef, $ZodCheckNumberFormatInternals, $ZodCheckNumberFormatParams, $ZodCheckOverwrite, $ZodCheckOverwriteDef, $ZodCheckOverwriteInternals, $ZodCheckProperty, $ZodCheckPropertyDef, $ZodCheckPropertyInternals, $ZodCheckPropertyParams, $ZodCheckRegex, $ZodCheckRegexDef, $ZodCheckRegexInternals, $ZodCheckRegexParams, $ZodCheckSizeEquals, $ZodCheckSizeEqualsDef, $ZodCheckSizeEqualsInternals, $ZodCheckSizeEqualsParams, $ZodCheckStartsWith, $ZodCheckStartsWithDef, $ZodCheckStartsWithInternals, $ZodCheckStartsWithParams, $ZodCheckStringFormat, $ZodCheckStringFormatDef, $ZodCheckStringFormatInternals, $ZodCheckStringFormatParams, $ZodCheckULIDParams, $ZodCheckURLParams, $ZodCheckUUIDParams, $ZodCheckUUIDv4Params, $ZodCheckUUIDv6Params, $ZodCheckUUIDv7Params, $ZodCheckUpperCase, $ZodCheckUpperCaseDef, $ZodCheckUpperCaseInternals, $ZodCheckUpperCaseParams, $ZodCheckXIDParams, $ZodChecks, $ZodCodec, $ZodCodecDef, $ZodCodecInternals, $ZodConfig, $ZodCreditCard, $ZodCreditCardDef, $ZodCreditCardInternals, $ZodCreditCardParams, $ZodCustom, $ZodCustomDef, $ZodCustomInternals, $ZodCustomParams, $ZodCustomStringFormat, $ZodCustomStringFormatDef, $ZodCustomStringFormatInternals, $ZodCyclicError, $ZodDate, $ZodDateDef, $ZodDateInternals, $ZodDateParams, $ZodDefault, $ZodDefaultDef, $ZodDefaultInternals, $ZodDefaultParams, $ZodDiscriminatedUnion, $ZodDiscriminatedUnionDef, $ZodDiscriminatedUnionInternals, $ZodDiscriminatedUnionParams, $ZodE164, $ZodE164Def, $ZodE164Internals, $ZodE164Params, $ZodEmail, $ZodEmailDef, $ZodEmailInternals, $ZodEmailParams, $ZodEmoji, $ZodEmojiDef, $ZodEmojiInternals, $ZodEmojiParams, $ZodEncodeError, $ZodEnum, $ZodEnumDef, $ZodEnumInternals, $ZodEnumParams, $ZodError, $ZodErrorClass, $ZodErrorMap, $ZodErrorTree, $ZodExactOptional, $ZodExactOptionalDef, $ZodExactOptionalInternals, $ZodFile, $ZodFileDef, $ZodFileInternals, $ZodFileParams, $ZodFlattenedError, $ZodFormattedError, $ZodFunction, $ZodFunctionArgs, $ZodFunctionDef, $ZodFunctionIn, $ZodFunctionInternals, $ZodFunctionOut, $ZodFunctionParams, $ZodGUID, $ZodGUIDDef, $ZodGUIDInternals, $ZodGUIDParams, $ZodIPv4, $ZodIPv4Def, $ZodIPv4Internals, $ZodIPv4Params, $ZodIPv6, $ZodIPv6Def, $ZodIPv6Internals, $ZodIPv6Params, $ZodISODate, $ZodISODateDef, $ZodISODateInternals, $ZodISODateParams, $ZodISODateTime, $ZodISODateTimeDef, $ZodISODateTimeInternals, $ZodISODateTimeParams, $ZodISODuration, $ZodISODurationDef, $ZodISODurationInternals, $ZodISODurationParams, $ZodISOTime, $ZodISOTimeDef, $ZodISOTimeInternals, $ZodISOTimeParams, $ZodInternalIssue, $ZodIntersection, $ZodIntersectionDef, $ZodIntersectionInternals, $ZodIntersectionParams, $ZodInvalidTypeExpected, $ZodIssue, $ZodIssueBase, $ZodIssueCode, $ZodIssueCustom, $ZodIssueInvalidElement, $ZodIssueInvalidKey, $ZodIssueInvalidStringFormat, $ZodIssueInvalidType, $ZodIssueInvalidUnion, $ZodIssueInvalidValue, $ZodIssueNotMultipleOf, $ZodIssueStringCommonFormats, $ZodIssueStringEndsWith, $ZodIssueStringIncludes, $ZodIssueStringInvalidJWT, $ZodIssueStringInvalidRegex, $ZodIssueStringStartsWith, $ZodIssueTooBig, $ZodIssueTooSmall, $ZodIssueUnrecognizedKeys, $ZodJWT, $ZodJWTDef, $ZodJWTInternals, $ZodJWTParams, $ZodKSUID, $ZodKSUIDDef, $ZodKSUIDInternals, $ZodKSUIDParams, $ZodLazy, $ZodLazyDef, $ZodLazyInternals, $ZodLazyParams, $ZodLiteral, $ZodLiteralDef, $ZodLiteralInternals, $ZodLiteralParams, $ZodLooseShape, $ZodMAC, $ZodMACDef, $ZodMACInternals, $ZodMACParams, $ZodMap, $ZodMapDef, $ZodMapInternals, $ZodMapParams, $ZodMemoizer, $ZodNaN, $ZodNaNDef, $ZodNaNInternals, $ZodNaNParams, $ZodNanoID, $ZodNanoIDDef, $ZodNanoIDInternals, $ZodNanoIDParams, $ZodNarrow, $ZodNever, $ZodNeverDef, $ZodNeverInternals, $ZodNeverParams, $ZodNonOptional, $ZodNonOptionalDef, $ZodNonOptionalInternals, $ZodNonOptionalParams, $ZodNull, $ZodNullDef, $ZodNullInternals, $ZodNullParams, $ZodNullable, $ZodNullableDef, $ZodNullableInternals, $ZodNullableParams, $ZodNumber, $ZodNumberDef, $ZodNumberFormat, $ZodNumberFormatDef, $ZodNumberFormatInternals, $ZodNumberFormatParams, $ZodNumberFormats, $ZodNumberInternals, $ZodNumberParams, $ZodObject, $ZodObjectConfig, $ZodObjectDef, $ZodObjectInternals, $ZodObjectJIT, $ZodObjectParams, $ZodOptional, $ZodOptionalDef, $ZodOptionalInternals, $ZodOptionalParams, $ZodPipe, $ZodPipeDef, $ZodPipeInternals, $ZodPipeParams, $ZodPrefault, $ZodPrefaultDef, $ZodPrefaultInternals, $ZodPreprocess, $ZodPreprocessDef, $ZodPreprocessInternals, $ZodPromise, $ZodPromiseDef, $ZodPromiseInternals, $ZodPromiseParams, $ZodRawIssue, $ZodReadonly, $ZodReadonlyDef, $ZodReadonlyInternals, $ZodReadonlyParams, $ZodRealError, $ZodRecord, $ZodRecordDef, $ZodRecordInternals, $ZodRecordKey, $ZodRecordParams, $ZodRegistry, $ZodSet, $ZodSetDef, $ZodSetInternals, $ZodSetParams, $ZodShape, $ZodStandardSchema, $ZodString, $ZodStringBoolParams, $ZodStringDef, $ZodStringFormat, $ZodStringFormatChecks, $ZodStringFormatDef, $ZodStringFormatInternals, $ZodStringFormatIssues, $ZodStringFormatParams, $ZodStringFormatTypes, $ZodStringFormats, $ZodStringInternals, $ZodStringParams, $ZodSuccess, $ZodSuccessDef, $ZodSuccessInternals, $ZodSuccessParams, $ZodSuperRefineIssue, $ZodSuperRefineParams, $ZodSymbol, $ZodSymbolDef, $ZodSymbolInternals, $ZodSymbolParams, $ZodTemplateLiteral, $ZodTemplateLiteralDef, $ZodTemplateLiteralInternals, $ZodTemplateLiteralParams, $ZodTemplateLiteralPart, $ZodTransform, $ZodTransformDef, $ZodTransformInternals, $ZodTransformParams, $ZodTuple, $ZodTupleDef, $ZodTupleInternals, $ZodTupleParams, $ZodType, $ZodTypeDef, $ZodTypeDiscriminable, $ZodTypeDiscriminableInternals, $ZodTypeInternals, $ZodTypes, $ZodULID, $ZodULIDDef, $ZodULIDInternals, $ZodULIDParams, $ZodURL, $ZodURLDef, $ZodURLInternals, $ZodURLParams, $ZodUUID, $ZodUUIDDef, $ZodUUIDInternals, $ZodUUIDParams, $ZodUUIDv4Params, $ZodUUIDv6Params, $ZodUUIDv7Params, $ZodUndefined, $ZodUndefinedDef, $ZodUndefinedInternals, $ZodUndefinedParams, $ZodUnion, $ZodUnionDef, $ZodUnionInternals, $ZodUnionParams, $ZodUnknown, $ZodUnknownDef, $ZodUnknownInternals, $ZodUnknownParams, $ZodVoid, $ZodVoidDef, $ZodVoidInternals, $ZodVoidParams, $ZodXID, $ZodXIDDef, $ZodXIDInternals, $ZodXIDParams, $ZodXor, $ZodXorInternals, $ZodXorParams, $brand, $catchall, $constructor, $constructorParams, $input, $loose, $output, $partial, $replace, $strict, $strip, CheckFn, CheckParams, CheckStringFormatParams, CheckTypeParams, CompileOptions, ConcatenateTupleOfStrings, ConvertPartsToStringTuple, Doc, File, GlobalMeta, INVALID, json_schema_d_exports as JSONSchema, JSONSchemaGenerator, JSONSchemaGeneratorParams, JSONSchemaMeta, NEVER, Params, ParseContext, ParseContextInternal, ParsePayload, ProcessParams, Processor, RegistryToJSONSchemaParams, Seen, SomeType, StringFormatParams, TimePrecision, ToJSONSchemaContext, ToJSONSchemaParams, ToTemplateLiteral, TypeParams, URL_BAD_FORMAT, URL_UNPARSEABLE, UnrepresentableHandler, ZodCompileAsyncError, ZodCompileUnsupportedError, ZodStandardJSONSchemaPayload, ZodStandardSchemaWithJSON$1 as ZodStandardSchemaWithJSON, _$ZodType, _$ZodTypeInternals, _any, _array, _base64, _base64url, _bigint, _boolean, _catch$1 as _catch, _check, _cidrv4, _cidrv6, _coercedBigint, _coercedBoolean, _coercedDate, _coercedNumber, _coercedString, _creditCard, _cuid, _cuid2, _custom, _date, _decode, _decodeAsync, _default$1 as _default, _discriminatedUnion, _e164, _email, _emoji, _encode, _encodeAsync, _endsWith, _enum$1 as _enum, _file, _float32, _float64, _gt, _gte, _guid, _includes, _int, _int32, _int64, _intersection, _ipv4, _ipv6, _isoDate, _isoDateTime, _isoDuration, _isoTime, _jwt, _ksuid, _lazy, _length, _literal, _lowercase, _lt, _lte, _mac, _map, _lte as _max, _maxLength, _maxSize, _mime, _gte as _min, _minLength, _minSize, _multipleOf, _nan, _nanoid, _nativeEnum, _negative, _never, _nonnegative, _nonoptional, _nonpositive, _normalize, _null$1 as _null, _nullable, _number, _optional, _overwrite, _parse, _parseAsync, _pipe, _positive, _promise, _properties, _property, _readonly, _record, _refine, _regex, _safeDecode, _safeDecodeAsync, _safeEncode, _safeEncodeAsync, _safeParse, _safeParseAsync, _set, _size, _slugify, _startsWith, _string, _stringFormat, _stringbool, _success, _superRefine, _symbol, _templateLiteral, _toLowerCase, _toUpperCase, _transform, _trim, _tuple, _uint32, _uint64, _ulid, _undefined$1 as _undefined, _union, _unknown, _uppercase, _url, _uuid, _uuidv4, _uuidv6, _uuidv7, _void$1 as _void, _xid, _xor, clone, compile, compileFn, config, createStandardJSONSchemaMethod, createToJSONSchemaMethod, decode$1 as decode, decodeAsync$1 as decodeAsync, describe$1 as describe, encode$1 as encode, encodeAsync$1 as encodeAsync, extractDefs, finalize, flattenError, formatError, getDiscriminatedOption, globalConfig, globalRegistry, handleUnrepresentable, output$1 as infer, initializeContext, input$1 as input, isBackEdge, isRecursiveSchema, isValidBase64, isValidBase64URL, isValidCIDRv6, isValidCreditCard, isValidIPv6, isValidJWT, index_d_exports$2 as locales, memoizer, mergeValues, meta$1 as meta, output$1 as output, parse$1 as parse, parseAsync$1 as parseAsync, parseURLObject, prettifyError, process, regexes_d_exports as regexes, registry, safeDecode$1 as safeDecode, safeDecodeAsync$1 as safeDecodeAsync, safeEncode$1 as safeEncode, safeEncodeAsync$1 as safeEncodeAsync, safeParse$1 as safeParse, safeParseAsync$1 as safeParseAsync, standardProps, stripTabAndNewline, toDotPath, toJSONSchema, toZod, treeifyError, urlHostnameOk, urlProtocolOk, util_d_exports as util, validate, validateAsync, version };
}
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/errors.d.cts
/** @deprecated Use `z.core.$ZodIssue` from `@zod/core` instead, especially if you are building a library on top of Zod. */
type ZodIssue = $ZodIssue;
/** An Error-like class used to store Zod validation issues.  */
interface ZodError<T = unknown> extends $ZodError<T> {
  /** @deprecated Use the `z.treeifyError(err)` function instead. */
  format(): $ZodFormattedError<T>;
  format<U>(mapper: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;
  /** @deprecated Use the `z.treeifyError(err)` function instead. */
  flatten(): $ZodFlattenedError<T>;
  flatten<U>(mapper: (issue: $ZodIssue) => U): $ZodFlattenedError<T, U>;
  /** @deprecated Push directly to `.issues` instead. */
  addIssue(issue: $ZodIssue): void;
  /** @deprecated Push directly to `.issues` instead. */
  addIssues(issues: $ZodIssue[]): void;
  /** @deprecated Check `err.issues.length === 0` instead. */
  isEmpty: boolean;
}
declare const ZodError: $constructor<ZodError>;
declare const ZodRealError: $constructor<ZodError>;
/** @deprecated Use `z.core.$ZodFlattenedError` instead. */
type ZodFlattenedError<T, U = string> = $ZodFlattenedError<T, U>;
/** @deprecated Use `z.core.$ZodFormattedError` instead. */
type ZodFormattedError<T, U = string> = $ZodFormattedError<T, U>;
/** @deprecated Use `z.core.$ZodErrorMap` instead. */
type ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> = $ZodErrorMap<T>;
/** @deprecated Use `z.core.$ZodRawIssue` instead. */
type IssueData = $ZodRawIssue;
declare namespace parse_d_exports {
  export { ZodSafeParseError, ZodSafeParseResult, ZodSafeParseSuccess, decode, decodeAsync, encode, encodeAsync, parse, parseAsync, safeDecode, safeDecodeAsync, safeEncode, safeEncodeAsync, safeParse, safeParseAsync, validate, validateAsync };
}
type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
type ZodSafeParseSuccess<T> = {
  success: true;
  data: T;
  error?: never;
};
type ZodSafeParseError<T> = {
  success: false;
  data?: never;
  error: ZodError<T>;
};
declare const parse: <T extends $ZodType>(schema: T, value: unknown, _ctx?: ParseContext<$ZodIssue>, _params?: {
  callee?: AnyFunc;
  Err?: $ZodErrorClass;
}) => output$1<T>;
declare const parseAsync: <T extends $ZodType>(schema: T, value: unknown, _ctx?: ParseContext<$ZodIssue>, _params?: {
  callee?: AnyFunc;
  Err?: $ZodErrorClass;
}) => Promise<output$1<T>>;
declare const safeParse: <T extends $ZodType>(schema: T, value: unknown, _ctx?: ParseContext<$ZodIssue>) => ZodSafeParseResult<output$1<T>>;
declare const safeParseAsync: <T extends $ZodType>(schema: T, value: unknown, _ctx?: ParseContext<$ZodIssue>) => Promise<ZodSafeParseResult<output$1<T>>>;
declare const encode: <T extends $ZodType>(schema: T, value: output$1<T>, _ctx?: ParseContext<$ZodIssue>, _params?: {
  callee?: AnyFunc;
  Err?: $ZodErrorClass;
}) => input$1<T>;
declare const decode: <T extends $ZodType>(schema: T, value: input$1<T>, _ctx?: ParseContext<$ZodIssue>, _params?: {
  callee?: AnyFunc;
  Err?: $ZodErrorClass;
}) => output$1<T>;
declare const encodeAsync: <T extends $ZodType>(schema: T, value: output$1<T>, _ctx?: ParseContext<$ZodIssue>, _params?: {
  callee?: AnyFunc;
  Err?: $ZodErrorClass;
}) => Promise<input$1<T>>;
declare const decodeAsync: <T extends $ZodType>(schema: T, value: input$1<T>, _ctx?: ParseContext<$ZodIssue>, _params?: {
  callee?: AnyFunc;
  Err?: $ZodErrorClass;
}) => Promise<output$1<T>>;
declare const safeEncode: <T extends $ZodType>(schema: T, value: output$1<T>, _ctx?: ParseContext<$ZodIssue>) => ZodSafeParseResult<input$1<T>>;
declare const safeDecode: <T extends $ZodType>(schema: T, value: input$1<T>, _ctx?: ParseContext<$ZodIssue>) => ZodSafeParseResult<output$1<T>>;
declare const safeEncodeAsync: <T extends $ZodType>(schema: T, value: output$1<T>, _ctx?: ParseContext<$ZodIssue>) => Promise<ZodSafeParseResult<input$1<T>>>;
declare const safeDecodeAsync: <T extends $ZodType>(schema: T, value: input$1<T>, _ctx?: ParseContext<$ZodIssue>) => Promise<ZodSafeParseResult<output$1<T>>>;
declare namespace schemas_d_exports {
  export { SafeExtendShape, ZodAny, ZodArray, ZodBase64, ZodBase64URL, ZodBigInt, ZodBigIntFormat, ZodBoolean, ZodCIDRv4, ZodCIDRv6, ZodCUID, ZodCUID2, ZodCatch, ZodCodec, ZodCreditCard, ZodCustom, ZodCustomStringFormat, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodE164, ZodEmail, ZodEmoji, ZodEnum, ZodExactOptional, ZodFile, ZodFloat32, ZodFloat64, ZodFunction, ZodGUID, ZodIPv4, ZodIPv6, ZodISODate, ZodISODateTime, ZodISODuration, ZodISOTime, ZodInt, ZodInt32, ZodInt64, ZodIntersection, ZodJSONSchema, ZodJSONSchemaInternals, ZodJWT, ZodKSUID, ZodLazy, ZodLiteral, ZodMAC, ZodMap, ZodNaN, ZodNanoID, ZodNever, ZodNonOptional, ZodNull, ZodNullable, ZodNumber, ZodNumberFormat, ZodObject, ZodOptional, ZodPipe, ZodPrefault, ZodPreprocess, ZodPromise, ZodReadonly, ZodRecord, ZodSet, ZodStandardSchemaWithJSON, ZodString, ZodStringFormat, ZodSuccess, ZodSymbol, ZodTemplateLiteral, ZodTransform, ZodTuple, ZodType, ZodUInt32, ZodUInt64, ZodULID, ZodURL, ZodUUID, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, ZodXID, ZodXor, _ZodBigInt, _ZodBoolean, _ZodDate, _ZodNumber, _ZodString, _ZodType, _default, _function, any, array, base64, base64url, bigint$1 as bigint, boolean$1 as boolean, _catch as catch, check, cidrv4, cidrv6, codec, creditCard, cuid, cuid2, custom, date$2 as date, describe, discriminatedUnion, e164, email, emoji, _enum as enum, exactOptional, file, float32, float64, _function as function, guid, hash, hex, hostname, httpUrl, _instanceof as instanceof, int, int32, int64, intersection, invertCodec, ipv4, ipv6, json, jwt, keyof, ksuid, lazy, literal, looseObject, looseRecord, mac, map, meta, nan, nanoid, nativeEnum, never, nonoptional, _null as null, nullable, nullish, number$1 as number, object, optional, partialRecord, pipe, prefault, preprocess, promise, readonly, record, refine, set, strictObject, string$1 as string, stringFormat, stringbool, success, superRefine, symbol, templateLiteral, transform, tuple, uint32, uint64, ulid, _undefined as undefined, union, unknown, url, uuid, uuidv4, uuidv6, uuidv7, _void as void, xid, xor };
}
type ZodStandardSchemaWithJSON<T> = StandardSchemaWithJSONProps<input$1<T>, output$1<T>>;
interface ZodType<out Output = unknown, out Input = unknown, out Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> extends $ZodType<Output, Input, Internals> {
  def: Internals["def"];
  type: Internals["def"]["type"];
  /** @deprecated Use `.def` instead. */
  _def: Internals["def"];
  /** @deprecated Use `z.output<typeof schema>` instead. */
  _output: Internals["output"];
  /** @deprecated Use `z.input<typeof schema>` instead. */
  _input: Internals["input"];
  "~standard": ZodStandardSchemaWithJSON<this>;
  /** Converts this schema to a JSON Schema representation. */
  toJSONSchema(params?: ToJSONSchemaParams): ZodStandardJSONSchemaPayload<this>;
  check(...checks: (CheckFn<output$1<this>> | $ZodCheck<output$1<this>>)[]): this;
  with(...checks: (CheckFn<output$1<this>> | $ZodCheck<output$1<this>>)[]): this;
  clone(def?: Internals["def"], params?: {
    parent: boolean;
  }): this;
  register<R extends $ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [$replace<R["_meta"], this>?] : [$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
  brand<T extends PropertyKey = PropertyKey, Dir extends "in" | "out" | "inout" = "out">(value?: T): PropertyKey extends T ? this : $ZodBranded<this, T, Dir>;
  parse(data: unknown, params?: ParseContext<$ZodIssue>): output$1<this>;
  safeParse(data: unknown, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output$1<this>>;
  parseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<output$1<this>>;
  safeParseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output$1<this>>>;
  spa: (data: unknown, params?: ParseContext<$ZodIssue>) => Promise<ZodSafeParseResult<output$1<this>>>;
  encode(data: output$1<this>, params?: ParseContext<$ZodIssue>): input$1<this>;
  decode(data: input$1<this>, params?: ParseContext<$ZodIssue>): output$1<this>;
  encodeAsync(data: output$1<this>, params?: ParseContext<$ZodIssue>): Promise<input$1<this>>;
  decodeAsync(data: input$1<this>, params?: ParseContext<$ZodIssue>): Promise<output$1<this>>;
  safeEncode(data: output$1<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<input$1<this>>;
  safeDecode(data: input$1<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output$1<this>>;
  safeEncodeAsync(data: output$1<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<input$1<this>>>;
  safeDecodeAsync(data: input$1<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output$1<this>>>;
  refine<Ch extends (arg: output$1<this>) => unknown | Promise<unknown>>(check: Ch, params?: string | $ZodCustomParams): Ch extends ((arg: any) => arg is infer R) ? this & ZodType<R, input$1<this>> : this;
  superRefine(refinement: (arg: output$1<this>, ctx: $RefinementCtx<output$1<this>>) => void | Promise<void>, params?: $ZodSuperRefineParams): this;
  overwrite(fn: (x: output$1<this>) => output$1<this>): this;
  optional(): ZodOptional<this>;
  exactOptional(): ZodExactOptional<this>;
  nonoptional(params?: string | $ZodNonOptionalParams): ZodNonOptional<this>;
  nullable(): ZodNullable<this>;
  nullish(): ZodOptional<ZodNullable<this>>;
  default(def: NoUndefined<output$1<this>>): ZodDefault<this>;
  default(def: () => NoUndefined<output$1<this>>): ZodDefault<this>;
  prefault(def: () => input$1<this>): ZodPrefault<this>;
  prefault(def: input$1<this>): ZodPrefault<this>;
  array(): ZodArray<this>;
  or<T extends SomeType>(option: T): ZodUnion<[this, T]>;
  and<T extends SomeType>(incoming: T): ZodIntersection<this, T>;
  transform<NewOut>(transform: (arg: output$1<this>, ctx: $RefinementCtx<output$1<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, output$1<this>>>;
  catch(def: output$1<this>): ZodCatch<this>;
  catch(def: (ctx: $ZodCatchCtx) => output$1<this>): ZodCatch<this>;
  pipe<T extends $ZodType<any, output$1<this>>>(target: T | $ZodType<any, output$1<this>>): ZodPipe<this, T>;
  readonly(): ZodReadonly<this>;
  /** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
  describe(description: string): this;
  description?: string;
  /** Returns the metadata associated with this instance in `z.globalRegistry` */
  meta(): $replace<GlobalMeta, this> | undefined;
  /** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
  meta(data: $replace<GlobalMeta, this>): this;
  /** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
   *
   * ```ts
   * const schema = z.string().optional();
   * const isOptional = schema.safeParse(undefined).success; // true
   * ```
   */
  isOptional(): boolean;
  /**
   * @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
   *
   * ```ts
   * const schema = z.string().nullable();
   * const isNullable = schema.safeParse(null).success; // true
   * ```
   */
  isNullable(): boolean;
  apply<T, TArgs extends unknown[] = []>(fn: (schema: this, ...args: TArgs) => T, ...args: TArgs): T;
}
interface _ZodType<out Internals extends $ZodTypeInternals = $ZodTypeInternals> extends ZodType<any, any, Internals> {}
declare const ZodType: $constructor<ZodType>;
interface _ZodString<T extends $ZodStringInternals<unknown> = $ZodStringInternals<unknown>> extends _ZodType<T> {
  format: string | null;
  minLength: number | null;
  maxLength: number | null;
  regex(regex: RegExp, params?: string | $ZodCheckRegexParams): this;
  includes(value: string, params?: string | $ZodCheckIncludesParams): this;
  startsWith(value: string, params?: string | $ZodCheckStartsWithParams): this;
  endsWith(value: string, params?: string | $ZodCheckEndsWithParams): this;
  min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
  max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
  length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
  nonempty(params?: string | $ZodCheckMinLengthParams): this;
  lowercase(params?: string | $ZodCheckLowerCaseParams): this;
  uppercase(params?: string | $ZodCheckUpperCaseParams): this;
  trim(): this;
  normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
  toLowerCase(): this;
  toUpperCase(): this;
  slugify(): this;
}
/** @internal */
declare const _ZodString: $constructor<_ZodString>;
interface ZodString extends _ZodString<$ZodStringInternals<string>> {
  /** @deprecated Use `z.email()` instead. */
  email(params?: string | $ZodCheckEmailParams): this;
  /** @deprecated Use `z.url()` instead. */
  url(params?: string | $ZodCheckURLParams): this;
  /** @deprecated Use `z.jwt()` instead. */
  jwt(params?: string | $ZodCheckJWTParams): this;
  /** @deprecated Use `z.emoji()` instead. */
  emoji(params?: string | $ZodCheckEmojiParams): this;
  /** @deprecated Use `z.guid()` instead. */
  guid(params?: string | $ZodCheckGUIDParams): this;
  /** @deprecated Use `z.uuid()` instead. */
  uuid(params?: string | $ZodCheckUUIDParams): this;
  /** @deprecated Use `z.uuid()` instead. */
  uuidv4(params?: string | $ZodCheckUUIDParams): this;
  /** @deprecated Use `z.uuid()` instead. */
  uuidv6(params?: string | $ZodCheckUUIDParams): this;
  /** @deprecated Use `z.uuid()` instead. */
  uuidv7(params?: string | $ZodCheckUUIDParams): this;
  /** @deprecated Use `z.nanoid()` instead. */
  nanoid(params?: string | $ZodCheckNanoIDParams): this;
  /** @deprecated Use `z.guid()` instead. */
  guid(params?: string | $ZodCheckGUIDParams): this;
  /**
   * @deprecated CUID v1 is deprecated by its authors due to information leakage
   * (timestamps embedded in the id). Use `z.cuid2()` instead.
   * See https://github.com/paralleldrive/cuid.
   */
  cuid(params?: string | $ZodCheckCUIDParams): this;
  /** @deprecated Use `z.cuid2()` instead. */
  cuid2(params?: string | $ZodCheckCUID2Params): this;
  /** @deprecated Use `z.ulid()` instead. */
  ulid(params?: string | $ZodCheckULIDParams): this;
  /** @deprecated Use `z.base64()` instead. */
  base64(params?: string | $ZodCheckBase64Params): this;
  /** @deprecated Use `z.base64url()` instead. */
  base64url(params?: string | $ZodCheckBase64URLParams): this;
  /** @deprecated Use `z.xid()` instead. */
  xid(params?: string | $ZodCheckXIDParams): this;
  /** @deprecated Use `z.ksuid()` instead. */
  ksuid(params?: string | $ZodCheckKSUIDParams): this;
  /** @deprecated Use `z.ipv4()` instead. */
  ipv4(params?: string | $ZodCheckIPv4Params): this;
  /** @deprecated Use `z.ipv6()` instead. */
  ipv6(params?: string | $ZodCheckIPv6Params): this;
  /** @deprecated Use `z.cidrv4()` instead. */
  cidrv4(params?: string | $ZodCheckCIDRv4Params): this;
  /** @deprecated Use `z.cidrv6()` instead. */
  cidrv6(params?: string | $ZodCheckCIDRv6Params): this;
  /** @deprecated Use `z.e164()` instead. */
  e164(params?: string | $ZodCheckE164Params): this;
  /** @deprecated Use `z.iso.datetime()` instead. */
  datetime(params?: string | $ZodCheckISODateTimeParams): this;
  /** @deprecated Use `z.iso.date()` instead. */
  date(params?: string | $ZodCheckISODateParams): this;
  /** @deprecated Use `z.iso.time()` instead. */
  time(params?: string | $ZodCheckISOTimeParams): this;
  /** @deprecated Use `z.iso.duration()` instead. */
  duration(params?: string | $ZodCheckISODurationParams): this;
}
declare const ZodString: $constructor<ZodString>;
declare function string$1(params?: string | $ZodStringParams): ZodString;
declare function string$1<T extends string>(params?: string | $ZodStringParams): $ZodType<T, T>;
interface ZodStringFormat<Format extends string = string> extends _ZodString<$ZodStringFormatInternals<Format>> {}
declare const ZodStringFormat: $constructor<ZodStringFormat>;
interface ZodISODateTime extends ZodStringFormat {
  _zod: $ZodISODateTimeInternals;
}
declare const ZodISODateTime: $constructor<ZodISODateTime>;
interface ZodISODate extends ZodStringFormat {
  _zod: $ZodISODateInternals;
}
declare const ZodISODate: $constructor<ZodISODate>;
interface ZodISOTime extends ZodStringFormat {
  _zod: $ZodISOTimeInternals;
}
declare const ZodISOTime: $constructor<ZodISOTime>;
interface ZodISODuration extends ZodStringFormat {
  _zod: $ZodISODurationInternals;
}
declare const ZodISODuration: $constructor<ZodISODuration>;
interface ZodEmail extends ZodStringFormat<"email"> {
  _zod: $ZodEmailInternals;
}
declare const ZodEmail: $constructor<ZodEmail>;
declare function email(params?: string | $ZodEmailParams): ZodEmail;
interface ZodGUID extends ZodStringFormat<"guid"> {
  _zod: $ZodGUIDInternals;
}
declare const ZodGUID: $constructor<ZodGUID>;
declare function guid(params?: string | $ZodGUIDParams): ZodGUID;
interface ZodUUID extends ZodStringFormat<"uuid"> {
  _zod: $ZodUUIDInternals;
}
declare const ZodUUID: $constructor<ZodUUID>;
declare function uuid(params?: string | $ZodUUIDParams): ZodUUID;
declare function uuidv4(params?: string | $ZodUUIDv4Params): ZodUUID;
declare function uuidv6(params?: string | $ZodUUIDv6Params): ZodUUID;
declare function uuidv7(params?: string | $ZodUUIDv7Params): ZodUUID;
interface ZodURL extends ZodStringFormat<"url"> {
  _zod: $ZodURLInternals;
}
declare const ZodURL: $constructor<ZodURL>;
declare function url(params?: string | $ZodURLParams): ZodURL;
declare function httpUrl(params?: string | Omit<$ZodURLParams, "protocol" | "hostname">): ZodURL;
interface ZodEmoji extends ZodStringFormat<"emoji"> {
  _zod: $ZodEmojiInternals;
}
declare const ZodEmoji: $constructor<ZodEmoji>;
declare function emoji(params?: string | $ZodEmojiParams): ZodEmoji;
interface ZodNanoID extends ZodStringFormat<"nanoid"> {
  _zod: $ZodNanoIDInternals;
}
declare const ZodNanoID: $constructor<ZodNanoID>;
declare function nanoid(params?: string | $ZodNanoIDParams): ZodNanoID;
/**
 * @deprecated CUID v1 is deprecated by its authors due to information leakage
 * (timestamps embedded in the id). Use {@link ZodCUID2} instead.
 * See https://github.com/paralleldrive/cuid.
 */
interface ZodCUID extends ZodStringFormat<"cuid"> {
  _zod: $ZodCUIDInternals;
}
/**
 * @deprecated CUID v1 is deprecated by its authors due to information leakage
 * (timestamps embedded in the id). Use {@link ZodCUID2} instead.
 * See https://github.com/paralleldrive/cuid.
 */
declare const ZodCUID: $constructor<ZodCUID>;
/**
 * Validates a CUID v1 string.
 *
 * @deprecated CUID v1 is deprecated by its authors due to information leakage
 * (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
 * See https://github.com/paralleldrive/cuid.
 */
declare function cuid(params?: string | $ZodCUIDParams): ZodCUID;
interface ZodCUID2 extends ZodStringFormat<"cuid2"> {
  _zod: $ZodCUID2Internals;
}
declare const ZodCUID2: $constructor<ZodCUID2>;
declare function cuid2(params?: string | $ZodCUID2Params): ZodCUID2;
interface ZodULID extends ZodStringFormat<"ulid"> {
  _zod: $ZodULIDInternals;
}
declare const ZodULID: $constructor<ZodULID>;
declare function ulid(params?: string | $ZodULIDParams): ZodULID;
interface ZodXID extends ZodStringFormat<"xid"> {
  _zod: $ZodXIDInternals;
}
declare const ZodXID: $constructor<ZodXID>;
declare function xid(params?: string | $ZodXIDParams): ZodXID;
interface ZodKSUID extends ZodStringFormat<"ksuid"> {
  _zod: $ZodKSUIDInternals;
}
declare const ZodKSUID: $constructor<ZodKSUID>;
declare function ksuid(params?: string | $ZodKSUIDParams): ZodKSUID;
interface ZodIPv4 extends ZodStringFormat<"ipv4"> {
  _zod: $ZodIPv4Internals;
}
declare const ZodIPv4: $constructor<ZodIPv4>;
declare function ipv4(params?: string | $ZodIPv4Params): ZodIPv4;
interface ZodMAC extends ZodStringFormat<"mac"> {
  _zod: $ZodMACInternals;
}
declare const ZodMAC: $constructor<ZodMAC>;
declare function mac(params?: string | $ZodMACParams): ZodMAC;
interface ZodIPv6 extends ZodStringFormat<"ipv6"> {
  _zod: $ZodIPv6Internals;
}
declare const ZodIPv6: $constructor<ZodIPv6>;
declare function ipv6(params?: string | $ZodIPv6Params): ZodIPv6;
interface ZodCIDRv4 extends ZodStringFormat<"cidrv4"> {
  _zod: $ZodCIDRv4Internals;
}
declare const ZodCIDRv4: $constructor<ZodCIDRv4>;
declare function cidrv4(params?: string | $ZodCIDRv4Params): ZodCIDRv4;
interface ZodCIDRv6 extends ZodStringFormat<"cidrv6"> {
  _zod: $ZodCIDRv6Internals;
}
declare const ZodCIDRv6: $constructor<ZodCIDRv6>;
declare function cidrv6(params?: string | $ZodCIDRv6Params): ZodCIDRv6;
interface ZodBase64 extends ZodStringFormat<"base64"> {
  _zod: $ZodBase64Internals;
}
declare const ZodBase64: $constructor<ZodBase64>;
declare function base64(params?: string | $ZodBase64Params): ZodBase64;
interface ZodBase64URL extends ZodStringFormat<"base64url"> {
  _zod: $ZodBase64URLInternals;
}
declare const ZodBase64URL: $constructor<ZodBase64URL>;
declare function base64url(params?: string | $ZodBase64URLParams): ZodBase64URL;
interface ZodE164 extends ZodStringFormat<"e164"> {
  _zod: $ZodE164Internals;
}
declare const ZodE164: $constructor<ZodE164>;
declare function e164(params?: string | $ZodE164Params): ZodE164;
interface ZodCreditCard extends ZodStringFormat<"credit_card"> {
  _zod: $ZodCreditCardInternals;
}
declare const ZodCreditCard: $constructor<ZodCreditCard>;
declare function creditCard(params?: string | $ZodCreditCardParams): ZodCreditCard;
interface ZodJWT extends ZodStringFormat<"jwt"> {
  _zod: $ZodJWTInternals;
}
declare const ZodJWT: $constructor<ZodJWT>;
declare function jwt(params?: string | $ZodJWTParams): ZodJWT;
interface ZodCustomStringFormat<Format extends string = string> extends ZodStringFormat<Format>, $ZodCustomStringFormat<Format> {
  _zod: $ZodCustomStringFormatInternals<Format>;
  "~standard": ZodStandardSchemaWithJSON<this>;
}
declare const ZodCustomStringFormat: $constructor<ZodCustomStringFormat>;
declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => MaybeAsync<unknown>) | RegExp, _params?: string | $ZodStringFormatParams): ZodCustomStringFormat<Format>;
declare function hostname(_params?: string | $ZodStringFormatParams): ZodCustomStringFormat<"hostname">;
declare function hex(_params?: string | $ZodStringFormatParams): ZodCustomStringFormat<"hex">;
declare function hash<Alg extends HashAlgorithm, Enc extends HashEncoding = "hex">(alg: Alg, params?: {
  enc?: Enc;
} & $ZodStringFormatParams): ZodCustomStringFormat<`${Alg}_${Enc}`>;
interface _ZodNumber<Internals extends $ZodNumberInternals = $ZodNumberInternals> extends _ZodType<Internals> {
  gt(value: number, params?: string | $ZodCheckGreaterThanParams): this;
  /** Identical to .min() */
  gte(value: number, params?: string | $ZodCheckGreaterThanParams): this;
  min(value: number, params?: string | $ZodCheckGreaterThanParams): this;
  lt(value: number, params?: string | $ZodCheckLessThanParams): this;
  /** Identical to .max() */
  lte(value: number, params?: string | $ZodCheckLessThanParams): this;
  max(value: number, params?: string | $ZodCheckLessThanParams): this;
  /** Consider `z.int()` instead. This API is considered *legacy*; it will never be removed but a better alternative exists. */
  int(params?: string | $ZodCheckNumberFormatParams): this;
  /** @deprecated This is now identical to `.int()`. Only numbers in the safe integer range are accepted. */
  safe(params?: string | $ZodCheckNumberFormatParams): this;
  positive(params?: string | $ZodCheckGreaterThanParams): this;
  nonnegative(params?: string | $ZodCheckGreaterThanParams): this;
  negative(params?: string | $ZodCheckLessThanParams): this;
  nonpositive(params?: string | $ZodCheckLessThanParams): this;
  multipleOf(value: number, params?: string | $ZodCheckMultipleOfParams): this;
  /** @deprecated Use `.multipleOf()` instead. */
  step(value: number, params?: string | $ZodCheckMultipleOfParams): this;
  /** @deprecated In v4 and later, z.number() does not allow infinite values by default. This is a no-op. */
  finite(params?: unknown): this;
  minValue: number | null;
  maxValue: number | null;
  /** @deprecated Check the `format` property instead.  */
  isInt: boolean;
  /** @deprecated Number schemas no longer accept infinite values, so this always returns `true`. */
  isFinite: boolean;
  format: string | null;
}
interface ZodNumber extends _ZodNumber<$ZodNumberInternals<number>> {}
declare const ZodNumber: $constructor<ZodNumber>;
declare function number$1(params?: string | $ZodNumberParams): ZodNumber;
interface ZodNumberFormat<Format extends $ZodNumberFormats = $ZodNumberFormats> extends ZodNumber {
  _zod: $ZodNumberFormatInternals<Format>;
}
declare const ZodNumberFormat: $constructor<ZodNumberFormat>;
interface ZodInt extends ZodNumberFormat<"safeint"> {}
declare function int(params?: string | $ZodCheckNumberFormatParams): ZodInt;
interface ZodFloat32 extends ZodNumberFormat<"float32"> {}
declare function float32(params?: string | $ZodCheckNumberFormatParams): ZodFloat32;
interface ZodFloat64 extends ZodNumberFormat<"float64"> {}
declare function float64(params?: string | $ZodCheckNumberFormatParams): ZodFloat64;
interface ZodInt32 extends ZodNumberFormat<"int32"> {}
declare function int32(params?: string | $ZodCheckNumberFormatParams): ZodInt32;
interface ZodUInt32 extends ZodNumberFormat<"uint32"> {}
declare function uint32(params?: string | $ZodCheckNumberFormatParams): ZodUInt32;
interface _ZodBoolean<T extends $ZodBooleanInternals = $ZodBooleanInternals> extends _ZodType<T> {}
interface ZodBoolean extends _ZodBoolean<$ZodBooleanInternals<boolean>> {}
declare const ZodBoolean: $constructor<ZodBoolean>;
declare function boolean$1(params?: string | $ZodBooleanParams): ZodBoolean;
interface _ZodBigInt<T extends $ZodBigIntInternals = $ZodBigIntInternals> extends _ZodType<T> {
  gte(value: bigint, params?: string | $ZodCheckGreaterThanParams): this;
  /** Alias of `.gte()` */
  min(value: bigint, params?: string | $ZodCheckGreaterThanParams): this;
  gt(value: bigint, params?: string | $ZodCheckGreaterThanParams): this;
  /** Alias of `.lte()` */
  lte(value: bigint, params?: string | $ZodCheckLessThanParams): this;
  max(value: bigint, params?: string | $ZodCheckLessThanParams): this;
  lt(value: bigint, params?: string | $ZodCheckLessThanParams): this;
  positive(params?: string | $ZodCheckGreaterThanParams): this;
  negative(params?: string | $ZodCheckLessThanParams): this;
  nonpositive(params?: string | $ZodCheckLessThanParams): this;
  nonnegative(params?: string | $ZodCheckGreaterThanParams): this;
  multipleOf(value: bigint, params?: string | $ZodCheckMultipleOfParams): this;
  minValue: bigint | null;
  maxValue: bigint | null;
  format: string | null;
}
interface ZodBigInt extends _ZodBigInt<$ZodBigIntInternals<bigint>> {}
declare const ZodBigInt: $constructor<ZodBigInt>;
declare function bigint$1(params?: string | $ZodBigIntParams): ZodBigInt;
interface ZodBigIntFormat<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends ZodBigInt {
  _zod: $ZodBigIntFormatInternals<Format>;
}
declare const ZodBigIntFormat: $constructor<ZodBigIntFormat>;
interface ZodInt64 extends ZodBigIntFormat<"int64"> {}
declare function int64(params?: string | $ZodBigIntFormatParams): ZodInt64;
interface ZodUInt64 extends ZodBigIntFormat<"uint64"> {}
declare function uint64(params?: string | $ZodBigIntFormatParams): ZodUInt64;
interface ZodSymbol extends _ZodType<$ZodSymbolInternals> {}
declare const ZodSymbol: $constructor<ZodSymbol>;
declare function symbol(params?: string | $ZodSymbolParams): ZodSymbol;
interface ZodUndefined extends _ZodType<$ZodUndefinedInternals> {}
declare const ZodUndefined: $constructor<ZodUndefined>;
declare function _undefined(params?: string | $ZodUndefinedParams): ZodUndefined;
interface ZodNull extends _ZodType<$ZodNullInternals> {}
declare const ZodNull: $constructor<ZodNull>;
declare function _null(params?: string | $ZodNullParams): ZodNull;
interface ZodAny extends _ZodType<$ZodAnyInternals> {}
declare const ZodAny: $constructor<ZodAny>;
declare function any(): ZodAny;
interface ZodUnknown extends _ZodType<$ZodUnknownInternals> {}
declare const ZodUnknown: $constructor<ZodUnknown>;
declare function unknown(): ZodUnknown;
interface ZodNever extends _ZodType<$ZodNeverInternals> {}
declare const ZodNever: $constructor<ZodNever>;
declare function never(params?: string | $ZodNeverParams): ZodNever;
interface ZodVoid extends _ZodType<$ZodVoidInternals> {}
declare const ZodVoid: $constructor<ZodVoid>;
declare function _void(params?: string | $ZodVoidParams): ZodVoid;
interface _ZodDate<T extends $ZodDateInternals = $ZodDateInternals> extends _ZodType<T> {
  min(value: number | Date, params?: string | $ZodCheckGreaterThanParams): this;
  max(value: number | Date, params?: string | $ZodCheckLessThanParams): this;
  /** @deprecated Not recommended. */
  minDate: Date | null;
  /** @deprecated Not recommended. */
  maxDate: Date | null;
}
interface ZodDate extends _ZodDate<$ZodDateInternals<Date>> {}
declare const ZodDate: $constructor<ZodDate>;
declare function date$2(params?: string | $ZodDateParams): ZodDate;
interface ZodArray<T extends SomeType = $ZodType> extends _ZodType<$ZodArrayInternals<T>>, $ZodArray<T> {
  element: T;
  min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
  nonempty(params?: string | $ZodCheckMinLengthParams): this;
  max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
  length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
  unwrap(): T;
  "~standard": ZodStandardSchemaWithJSON<this>;
}
declare const ZodArray: $constructor<ZodArray>;
declare function array<T extends SomeType>(element: T, params?: string | $ZodArrayParams): ZodArray<T>;
declare function keyof<T extends ZodObject>(schema: T): ZodEnum<KeysEnum<T["_zod"]["output"]>>;
type SafeExtendShape<Base extends $ZodShape, Ext extends $ZodLooseShape> = { [K in keyof Ext]: K extends keyof Base ? output$1<Ext[K]> extends output$1<Base[K]> ? input$1<Ext[K]> extends input$1<Base[K]> ? Ext[K] : never : never : Ext[K]; };
interface ZodObject<
/** @ts-ignore Cast variance */
out Shape extends $ZodShape = $ZodLooseShape, out Config extends $ZodObjectConfig = $strip> extends _ZodType<$ZodObjectInternals<Shape, Config>>, $ZodObject<Shape, Config> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  shape: Shape;
  keyof(): ZodEnum<ToEnum<keyof Shape & string>>;
  /** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
  catchall<T extends SomeType>(schema: T): ZodObject<Shape, $catchall<T>>;
  /** @deprecated Use `z.looseObject()` or `.loose()` instead. */
  passthrough(): ZodObject<Shape, $loose>;
  /** Consider `z.looseObject(A.shape)` instead */
  loose(): ZodObject<Shape, $loose>;
  /** Consider `z.strictObject(A.shape)` instead */
  strict(): ZodObject<Shape, $strict>;
  /** This is the default behavior. This method call is likely unnecessary. */
  strip(): ZodObject<Shape, $strip>;
  extend<U extends $ZodLooseShape>(shape: U): ZodObject<Extend<Shape, Writeable<U>>, Config>;
  safeExtend<U extends $ZodLooseShape>(shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, SomeType>>): ZodObject<Extend<Shape, Writeable<U>>, Config>;
  /**
   * @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
   */
  merge<U extends ZodObject>(other: U): ZodObject<Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
  pick<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
  omit<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
  partial(): ZodObject<{ -readonly [k in keyof Shape]: ZodOptional<Shape[k]>; }, Config>;
  partial<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ -readonly [k in keyof Shape]: k extends keyof M ? ZodOptional<Shape[k]> : Shape[k]; }, Config>;
  exactPartial(): ZodObject<{ -readonly [k in keyof Shape]: ZodExactOptional<Shape[k]>; }, Config>;
  exactPartial<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ -readonly [k in keyof Shape]: k extends keyof M ? ZodExactOptional<Shape[k]> : Shape[k]; }, Config>;
  required(): ZodObject<{ -readonly [k in keyof Shape]: ZodNonOptional<Shape[k]>; }, Config>;
  required<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ -readonly [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k]; }, Config>;
}
declare const ZodObject: $constructor<ZodObject>;
declare function object<T extends $ZodLooseShape = Partial<Record<never, SomeType>>>(shape?: T, params?: string | $ZodObjectParams): ZodObject<Writeable<T>, $strip>;
declare function strictObject<T extends $ZodLooseShape>(shape: T, params?: string | $ZodObjectParams): ZodObject<Writeable<T>, $strict>;
declare function looseObject<T extends $ZodLooseShape>(shape: T, params?: string | $ZodObjectParams): ZodObject<Writeable<T>, $loose>;
interface ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends _ZodType<$ZodUnionInternals<T>>, $ZodUnion<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  options: T;
}
declare const ZodUnion: $constructor<ZodUnion>;
declare function union<const T extends readonly SomeType[]>(options: T, params?: string | $ZodUnionParams): ZodUnion<T>;
interface ZodXor<T extends readonly SomeType[] = readonly $ZodType[]> extends _ZodType<$ZodXorInternals<T>>, $ZodXor<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  options: T;
}
declare const ZodXor: $constructor<ZodXor>;
/** Creates an exclusive union (XOR) where exactly one option must match.
 * Unlike regular unions that succeed when any option matches, xor fails if
 * zero or more than one option matches the input. */
declare function xor<const T extends readonly SomeType[]>(options: T, params?: string | $ZodXorParams): ZodXor<T>;
interface ZodDiscriminatedUnion<Options extends readonly SomeType[] = readonly $ZodType[], Disc extends string = string> extends ZodUnion<Options>, $ZodDiscriminatedUnion<Options, Disc> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  _zod: $ZodDiscriminatedUnionInternals<Options, Disc>;
  def: $ZodDiscriminatedUnionDef<Options, Disc>;
}
declare const ZodDiscriminatedUnion: $constructor<ZodDiscriminatedUnion>;
declare function discriminatedUnion<Types extends readonly [$ZodTypeDiscriminable, ...$ZodTypeDiscriminable[]], Disc extends string>(discriminator: Disc, options: Types, params?: string | $ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types, Disc>;
interface ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodIntersectionInternals<A, B>>, $ZodIntersection<A, B> {
  "~standard": ZodStandardSchemaWithJSON<this>;
}
declare const ZodIntersection: $constructor<ZodIntersection>;
declare function intersection<T extends SomeType, U extends SomeType>(left: T, right: U): ZodIntersection<T, U>;
interface ZodTuple<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends _ZodType<$ZodTupleInternals<T, Rest>>, $ZodTuple<T, Rest> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  rest<Rest extends SomeType = $ZodType>(rest: Rest): ZodTuple<T, Rest>;
  partial(): ZodTuple<{ -readonly [k in keyof T]: ZodOptional<T[k]>; }, Rest>;
}
declare const ZodTuple: $constructor<ZodTuple>;
declare function tuple<T extends readonly [SomeType, ...SomeType[]]>(items: T, params?: string | $ZodTupleParams): ZodTuple<T, null>;
declare function tuple<T extends readonly [SomeType, ...SomeType[]], Rest extends SomeType>(items: T, rest: Rest, params?: string | $ZodTupleParams): ZodTuple<T, Rest>;
declare function tuple(items: [], params?: string | $ZodTupleParams): ZodTuple<[], null>;
interface ZodRecord<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends _ZodType<$ZodRecordInternals<Key, Value>>, $ZodRecord<Key, Value> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  keyType: Key;
  valueType: Value;
}
declare const ZodRecord: $constructor<ZodRecord>;
declare function record<Key extends $ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | $ZodRecordParams): ZodRecord<Key, Value>;
declare function partialRecord<Key extends $ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | $ZodRecordParams): ZodRecord<Key & $partial, Value>;
declare function looseRecord<Key extends $ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | $ZodRecordParams): ZodRecord<Key, Value>;
interface ZodMap<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends _ZodType<$ZodMapInternals<Key, Value>>, $ZodMap<Key, Value> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  keyType: Key;
  valueType: Value;
  min(minSize: number, params?: string | $ZodCheckMinSizeParams): this;
  nonempty(params?: string | $ZodCheckMinSizeParams): this;
  max(maxSize: number, params?: string | $ZodCheckMaxSizeParams): this;
  size(size: number, params?: string | $ZodCheckSizeEqualsParams): this;
}
declare const ZodMap: $constructor<ZodMap>;
declare function map<Key extends SomeType, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | $ZodMapParams): ZodMap<Key, Value>;
interface ZodSet<T extends SomeType = $ZodType> extends _ZodType<$ZodSetInternals<T>>, $ZodSet<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  min(minSize: number, params?: string | $ZodCheckMinSizeParams): this;
  nonempty(params?: string | $ZodCheckMinSizeParams): this;
  max(maxSize: number, params?: string | $ZodCheckMaxSizeParams): this;
  size(size: number, params?: string | $ZodCheckSizeEqualsParams): this;
}
declare const ZodSet: $constructor<ZodSet>;
declare function set<Value extends SomeType>(valueType: Value, params?: string | $ZodSetParams): ZodSet<Value>;
interface ZodEnum<
/** @ts-ignore Cast variance */
out T extends EnumLike = EnumLike> extends _ZodType<$ZodEnumInternals<T>>, $ZodEnum<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  enum: T;
  options: Array<T[keyof T]>;
  extract<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Pick<T, U[number]>>>;
  exclude<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Omit<T, U[number]>>>;
}
declare const ZodEnum: $constructor<ZodEnum>;
declare function _enum<const T extends readonly string[]>(values: T, params?: string | $ZodEnumParams): ZodEnum<ToEnum<T[number]>>;
declare function _enum<const T extends EnumLike>(entries: T, params?: string | $ZodEnumParams): ZodEnum<T>;
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
 *
 * ```ts
 * enum Colors { red, green, blue }
 * z.enum(Colors);
 * ```
 */
declare function nativeEnum<T extends EnumLike>(entries: T, params?: string | $ZodEnumParams): ZodEnum<T>;
interface ZodLiteral<T extends Literal = Literal> extends _ZodType<$ZodLiteralInternals<T>>, $ZodLiteral<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  values: Set<T>;
  /** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
  value: T;
}
declare const ZodLiteral: $constructor<ZodLiteral>;
declare function literal<const T extends ReadonlyArray<Literal>>(value: T, params?: string | $ZodLiteralParams): ZodLiteral<T[number]>;
declare function literal<const T extends Literal>(value: T, params?: string | $ZodLiteralParams): ZodLiteral<T>;
interface ZodFile extends _ZodType<$ZodFileInternals>, $ZodFile {
  "~standard": ZodStandardSchemaWithJSON<this>;
  min(size: number, params?: string | $ZodCheckMinSizeParams): this;
  max(size: number, params?: string | $ZodCheckMaxSizeParams): this;
  mime(types: MimeTypes | Array<MimeTypes>, params?: string | $ZodCheckMimeTypeParams): this;
}
declare const ZodFile: $constructor<ZodFile>;
declare function file(params?: string | $ZodFileParams): ZodFile;
interface ZodTransform<O = unknown, I = unknown> extends _ZodType<$ZodTransformInternals<O, I>>, $ZodTransform<O, I> {
  "~standard": ZodStandardSchemaWithJSON<this>;
}
declare const ZodTransform: $constructor<ZodTransform>;
declare function transform<I = unknown, O = I>(fn: (input: I, ctx: $RefinementCtx) => O): ZodTransform<Awaited<O>, I>;
interface ZodOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodOptionalInternals<T>>, $ZodOptional<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  unwrap(): T;
}
declare const ZodOptional: $constructor<ZodOptional>;
declare function optional<T extends SomeType>(innerType: T): ZodOptional<T>;
interface ZodExactOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodExactOptionalInternals<T>>, $ZodExactOptional<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  unwrap(): T;
}
declare const ZodExactOptional: $constructor<ZodExactOptional>;
declare function exactOptional<T extends SomeType>(innerType: T): ZodExactOptional<T>;
interface ZodNullable<T extends SomeType = $ZodType> extends _ZodType<$ZodNullableInternals<T>>, $ZodNullable<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  unwrap(): T;
}
declare const ZodNullable: $constructor<ZodNullable>;
declare function nullable<T extends SomeType>(innerType: T): ZodNullable<T>;
declare function nullish<T extends SomeType>(innerType: T): ZodOptional<ZodNullable<T>>;
interface ZodDefault<T extends SomeType = $ZodType> extends _ZodType<$ZodDefaultInternals<T>>, $ZodDefault<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  unwrap(): T;
  /** @deprecated Use `.unwrap()` instead. */
  removeDefault(): T;
}
declare const ZodDefault: $constructor<ZodDefault>;
declare function _default<T extends SomeType>(innerType: T, defaultValue: NoUndefined<output$1<T>> | (() => NoUndefined<output$1<T>>)): ZodDefault<T>;
interface ZodPrefault<T extends SomeType = $ZodType> extends _ZodType<$ZodPrefaultInternals<T>>, $ZodPrefault<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  unwrap(): T;
}
declare const ZodPrefault: $constructor<ZodPrefault>;
declare function prefault<T extends SomeType>(innerType: T, defaultValue: input$1<T> | (() => input$1<T>)): ZodPrefault<T>;
interface ZodNonOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodNonOptionalInternals<T>>, $ZodNonOptional<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  unwrap(): T;
}
declare const ZodNonOptional: $constructor<ZodNonOptional>;
declare function nonoptional<T extends SomeType>(innerType: T, params?: string | $ZodNonOptionalParams): ZodNonOptional<T>;
interface ZodSuccess<T extends SomeType = $ZodType> extends _ZodType<$ZodSuccessInternals<T>>, $ZodSuccess<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  unwrap(): T;
}
declare const ZodSuccess: $constructor<ZodSuccess>;
declare function success<T extends SomeType>(innerType: T): ZodSuccess<T>;
interface ZodCatch<T extends SomeType = $ZodType> extends _ZodType<$ZodCatchInternals<T>>, $ZodCatch<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  unwrap(): T;
  /** @deprecated Use `.unwrap()` instead. */
  removeCatch(): T;
}
declare const ZodCatch: $constructor<ZodCatch>;
declare function _catch<T extends SomeType>(innerType: T, catchValue: output$1<T> | ((ctx: $ZodCatchCtx) => output$1<T>)): ZodCatch<T>;
interface ZodNaN extends _ZodType<$ZodNaNInternals>, $ZodNaN {
  "~standard": ZodStandardSchemaWithJSON<this>;
}
declare const ZodNaN: $constructor<ZodNaN>;
declare function nan(params?: string | $ZodNaNParams): ZodNaN;
interface ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodPipeInternals<A, B>>, $ZodPipe<A, B> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  in: A;
  out: B;
}
declare const ZodPipe: $constructor<ZodPipe>;
declare function pipe<const A extends SomeType, B extends $ZodType<unknown, output$1<A>> = $ZodType<unknown, output$1<A>>>(in_: A, out: B | $ZodType<unknown, output$1<A>>): ZodPipe<A, B>;
interface ZodCodec<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends ZodPipe<A, B>, $ZodCodec<A, B> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  _zod: $ZodCodecInternals<A, B>;
  def: $ZodCodecDef<A, B>;
}
declare const ZodCodec: $constructor<ZodCodec>;
declare function codec<const A extends SomeType, B extends SomeType = $ZodType>(in_: A, out: B, params: {
  decode: (value: output$1<A>, payload: ParsePayload<output$1<A>>) => MaybeAsync<input$1<B>>;
  encode: (value: input$1<B>, payload: ParsePayload<input$1<B>>) => MaybeAsync<output$1<A>>;
}): ZodCodec<A, B>;
declare function invertCodec<A extends SomeType, B extends SomeType>(codec: ZodCodec<A, B>): ZodCodec<B, A>;
interface ZodPreprocess<B extends SomeType = $ZodType, I = unknown> extends ZodPipe<$ZodTransform<unknown, I>, B>, $ZodPreprocess<B, I> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  _zod: $ZodPreprocessInternals<B, I>;
  def: $ZodPreprocessDef<B, I>;
}
declare const ZodPreprocess: $constructor<ZodPreprocess>;
interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadonlyInternals<T>>, $ZodReadonly<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  unwrap(): T;
}
declare const ZodReadonly: $constructor<ZodReadonly>;
declare function readonly<T extends SomeType>(innerType: T): ZodReadonly<T>;
interface ZodTemplateLiteral<Template extends string = string> extends _ZodType<$ZodTemplateLiteralInternals<Template>>, $ZodTemplateLiteral<Template> {
  "~standard": ZodStandardSchemaWithJSON<this>;
}
declare const ZodTemplateLiteral: $constructor<ZodTemplateLiteral>;
declare function templateLiteral<const Parts extends $ZodTemplateLiteralPart[]>(parts: Parts, params?: string | $ZodTemplateLiteralParams): ZodTemplateLiteral<$PartsToTemplateLiteral<Parts>>;
interface ZodLazy<T extends SomeType = $ZodType> extends _ZodType<$ZodLazyInternals<T>>, $ZodLazy<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  unwrap(): T;
}
declare const ZodLazy: $constructor<ZodLazy>;
declare function lazy<T extends SomeType>(getter: () => T): ZodLazy<T>;
interface ZodPromise<T extends SomeType = $ZodType> extends _ZodType<$ZodPromiseInternals<T>>, $ZodPromise<T> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  unwrap(): T;
}
declare const ZodPromise: $constructor<ZodPromise>;
declare function promise<T extends SomeType>(innerType: T): ZodPromise<T>;
interface ZodFunction<Args extends $ZodFunctionIn = $ZodFunctionIn, Returns extends $ZodFunctionOut = $ZodFunctionOut> extends _ZodType<$ZodFunctionInternals<Args, Returns>>, $ZodFunction<Args, Returns> {
  "~standard": ZodStandardSchemaWithJSON<this>;
  _def: $ZodFunctionDef<Args, Returns>;
  _input: $InferInnerFunctionType<Args, Returns>;
  _output: $InferOuterFunctionType<Args, Returns>;
  input<const Items extends TupleItems, const Rest extends $ZodFunctionOut = $ZodFunctionOut>(args: Items, rest?: Rest): ZodFunction<$ZodTuple<Items, Rest>, Returns>;
  input<NewArgs extends $ZodFunctionIn>(args: NewArgs): ZodFunction<NewArgs, Returns>;
  input(...args: any[]): ZodFunction<any, Returns>;
  output<NewReturns extends $ZodType>(output: NewReturns): ZodFunction<Args, NewReturns>;
}
declare const ZodFunction: $constructor<ZodFunction>;
declare function _function(): ZodFunction;
declare function _function<const In extends ReadonlyArray<$ZodType>>(params: {
  input: In;
}): ZodFunction<ZodTuple<In, null>, $ZodFunctionOut>;
declare function _function<const In extends ReadonlyArray<$ZodType>, const Out extends $ZodFunctionOut = $ZodFunctionOut>(params: {
  input: In;
  output: Out;
}): ZodFunction<ZodTuple<In, null>, Out>;
declare function _function<const In extends $ZodFunctionIn = $ZodFunctionIn>(params: {
  input: In;
}): ZodFunction<In, $ZodFunctionOut>;
declare function _function<const Out extends $ZodFunctionOut = $ZodFunctionOut>(params: {
  output: Out;
}): ZodFunction<$ZodFunctionIn, Out>;
declare function _function<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends $ZodType = $ZodType>(params?: {
  input: In;
  output: Out;
}): ZodFunction<In, Out>;
interface ZodCustom<O = unknown, I = unknown> extends _ZodType<$ZodCustomInternals<O, I>>, $ZodCustom<O, I> {
  "~standard": ZodStandardSchemaWithJSON<this>;
}
declare const ZodCustom: $constructor<ZodCustom>;
declare function check<O = unknown>(fn: CheckFn<O>): $ZodCheck<O>;
declare function custom<O>(fn?: (data: unknown) => unknown, _params?: string | $ZodCustomParams | undefined): ZodCustom<O, O>;
declare function refine<T>(fn: (arg: NoInfer<T>) => MaybeAsync<unknown>, _params?: string | $ZodCustomParams): $ZodCheck<T>;
declare function superRefine<T>(fn: (arg: T, payload: $RefinementCtx<T>) => void | Promise<void>, params?: $ZodSuperRefineParams): $ZodCheck<T>;
declare const describe: typeof describe$1;
declare const meta: typeof meta$1;
type ZodInstanceOfParams = Params<ZodCustom, $ZodIssueCustom, "type" | "check" | "checks" | "fn" | "abort" | "error" | "params" | "path">;
declare function _instanceof<T extends typeof Class>(cls: T, params?: ZodInstanceOfParams): ZodCustom<InstanceType<T>, InstanceType<T>>;
declare const stringbool: (_params?: string | $ZodStringBoolParams) => ZodCodec<ZodString, ZodBoolean>;
type _ZodJSONSchema = ZodUnion<[ZodString, ZodNumber, ZodBoolean, ZodNull, ZodArray<ZodJSONSchema>, ZodRecord<ZodString, ZodJSONSchema>]>;
type _ZodJSONSchemaInternals = _ZodJSONSchema["_zod"];
interface ZodJSONSchemaInternals extends _ZodJSONSchemaInternals {
  output: JSONType;
  input: JSONType;
}
interface ZodJSONSchema extends _ZodJSONSchema {
  _zod: ZodJSONSchemaInternals;
}
declare function json(params?: string | $ZodCustomParams): ZodJSONSchema;
declare function preprocess<A, U extends SomeType, B = unknown>(fn: (arg: B, ctx: $RefinementCtx) => A, schema: U): ZodPreprocess<U, B>;
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/compat.d.cts
/** @deprecated Use `z.output<T>` instead. */
type TypeOf<T> = output$1<T>;
/** @deprecated Use `z.output<T>` instead. */
type Infer<T> = output$1<T>;
/** @deprecated Use `z.core.$ZodTypes` instead */
type ZodFirstPartySchemaTypes = $ZodTypes;
/** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
declare const ZodIssueCode: {
  readonly invalid_type: "invalid_type";
  readonly too_big: "too_big";
  readonly too_small: "too_small";
  readonly invalid_format: "invalid_format";
  readonly not_multiple_of: "not_multiple_of";
  readonly unrecognized_keys: "unrecognized_keys";
  readonly invalid_union: "invalid_union";
  readonly invalid_key: "invalid_key";
  readonly invalid_element: "invalid_element";
  readonly invalid_value: "invalid_value";
  readonly custom: "custom";
};
/** @deprecated Use `z.core.$ZodFlattenedError<z.output<T>>` instead; it takes an inferred type, not a schema. */
type inferFlattenedErrors<T extends $ZodType, U = string> = $ZodFlattenedError<output$1<T>, U>;
/** @deprecated Use `z.core.$ZodFormattedError<z.output<T>>` instead; it takes an inferred type, not a schema. */
type inferFormattedError<T extends $ZodType<any, any>, U = string> = $ZodFormattedError<output$1<T>, U>;
/** Use `z.$brand` instead */
type BRAND<T extends string | number | symbol = string | number | symbol> = {
  [$brand]: { [k in T]: true; };
};
/** @deprecated Use `z.config(params)` instead. */
declare function setErrorMap(map: $ZodErrorMap): void;
/** @deprecated Use `z.config()` instead. */
declare function getErrorMap(): $ZodErrorMap<$ZodIssue> | undefined;
/** @deprecated Use z.ZodType (without generics) instead. */
type ZodTypeAny<Output = unknown, Input = unknown, Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> = ZodType<Output, Input, Internals>;
/** @deprecated Use `z.ZodType` */
type ZodSchema<Output = unknown, Input = unknown, Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> = ZodType<Output, Input, Internals>;
/** @deprecated Use `z.ZodType` */
type Schema<Output = unknown, Input = unknown, Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> = ZodType<Output, Input, Internals>;
/** Included for Zod 3 compatibility */
type ZodRawShape = $ZodShape;
/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
declare enum ZodFirstPartyTypeKind {}
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/from-json-schema.d.cts
type JSONSchemaVersion = "draft-2020-12" | "draft-7" | "draft-4" | "openapi-3.0";
interface FromJSONSchemaParams {
  defaultTarget?: JSONSchemaVersion;
  registry?: $ZodRegistry<any>;
}
/**
 * Converts a JSON Schema to a Zod schema. This function should be considered semi-experimental. It's behavior is liable to change. */
declare function fromJSONSchema(schema: JSONSchema | boolean, params?: FromJSONSchemaParams): ZodType;
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/deep-partial.d.cts
/** Distributes `.partial()` through every object in a schema type, preserving the wrappers around them. */
type DeepPartial<T extends SomeType> = T extends ZodObject<infer Shape, infer Config> ? ZodObject<{ -readonly [K in keyof Shape]: ZodOptional<DeepPartial<Shape[K]>>; }, Config> : T extends ZodDiscriminatedUnion<infer Options, any> ? ZodUnion<{ -readonly [I in keyof Options]: Options[I] extends SomeType ? DeepPartial<Options[I]> : Options[I]; }> : T extends ZodUnion<infer Options> ? ZodUnion<{ -readonly [I in keyof Options]: Options[I] extends SomeType ? DeepPartial<Options[I]> : Options[I]; }> : T extends ZodArray<infer El> ? ZodArray<DeepPartial<El>> : T extends ZodTuple<infer Items, infer Rest> ? ZodTuple<{ -readonly [K in keyof Items]: Items[K] extends SomeType ? DeepPartial<Items[K]> : Items[K]; }, Rest extends SomeType ? DeepPartial<Rest> : Rest> : T extends ZodIntersection<infer A, infer B> ? ZodIntersection<DeepPartial<A>, DeepPartial<B>> : T extends ZodRecord<infer K, infer V> ? ZodRecord<K, DeepPartial<V>> : T extends ZodMap<infer K, infer V> ? ZodMap<K, DeepPartial<V>> : T extends ZodSet<infer El> ? ZodSet<DeepPartial<El>> : T extends ZodOptional<infer Inner> ? ZodOptional<DeepPartial<Inner>> : T extends ZodNullable<infer Inner> ? ZodNullable<DeepPartial<Inner>> : T extends ZodDefault<infer Inner> ? ZodDefault<DeepPartial<Inner>> : T extends ZodPrefault<infer Inner> ? ZodPrefault<DeepPartial<Inner>> : T extends ZodNonOptional<infer Inner> ? ZodNonOptional<DeepPartial<Inner>> : T extends ZodCatch<infer Inner> ? ZodCatch<DeepPartial<Inner>> : T extends ZodReadonly<infer Inner> ? ZodReadonly<DeepPartial<Inner>> : T extends ZodSuccess<infer Inner> ? ZodSuccess<DeepPartial<Inner>> : T extends ZodPromise<infer Inner> ? ZodPromise<DeepPartial<Inner>> : T extends ZodCodec<infer A, infer B> ? ZodCodec<DeepPartial<A>, DeepPartial<B>> : T extends ZodPreprocess<infer B> ? ZodPreprocess<DeepPartial<B>> : T extends ZodPipe<infer A, infer B> ? ZodPipe<DeepPartial<A>, DeepPartial<B>> : T extends ZodLazy<infer Inner> ? ZodLazy<DeepPartial<Inner>> : T;
/** Returns a copy of the schema with every nested object's properties made optional. */
declare function deepPartial<T extends SomeType>(schema: T): DeepPartial<T>;
//#endregion
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/in-out.d.cts
type input<T> = input$1<T>;
type output<T> = output$1<T>;
/** Returns a copy of the schema with every pipe replaced by its input side. A codec's checks are dropped: they constrain the decoded value the input side never produces. */
declare function input<T extends $ZodType>(schema: T): ZodType<input$1<T>, input$1<T>>;
/** Returns a copy of the schema with every pipe replaced by its output side, carrying over the pipe's own checks. */
declare function output<T extends $ZodType>(schema: T): ZodType<output$1<T>, output$1<T>>;
declare namespace iso_d_exports {
  export { ZodISODate, ZodISODateTime, ZodISODuration, ZodISOTime, date$1 as date, datetime, duration, time };
}
declare function datetime(params?: string | $ZodISODateTimeParams): ZodISODateTime;
declare function date$1(params?: string | $ZodISODateParams): ZodISODate;
declare function time(params?: string | $ZodISOTimeParams): ZodISOTime;
declare function duration(params?: string | $ZodISODurationParams): ZodISODuration;
declare namespace coerce_d_exports {
  export { ZodCoercedBigInt, ZodCoercedBoolean, ZodCoercedDate, ZodCoercedNumber, ZodCoercedString, bigint, boolean, date, number, string };
}
interface ZodCoercedString<T = unknown> extends _ZodString<$ZodStringInternals<T>> {}
declare function string<T = unknown>(params?: string | $ZodStringParams): ZodCoercedString<T>;
interface ZodCoercedNumber<T = unknown> extends _ZodNumber<$ZodNumberInternals<T>> {}
declare function number<T = unknown>(params?: string | $ZodNumberParams): ZodCoercedNumber<T>;
interface ZodCoercedBoolean<T = unknown> extends _ZodBoolean<$ZodBooleanInternals<T>> {}
declare function boolean<T = unknown>(params?: string | $ZodBooleanParams): ZodCoercedBoolean<T>;
interface ZodCoercedBigInt<T = unknown> extends _ZodBigInt<$ZodBigIntInternals<T>> {}
declare function bigint<T = unknown>(params?: string | $ZodBigIntParams): ZodCoercedBigInt<T>;
interface ZodCoercedDate<T = unknown> extends _ZodDate<$ZodDateInternals<T>> {}
declare function date<T = unknown>(params?: string | $ZodDateParams): ZodCoercedDate<T>;
declare namespace external_d_exports {
  export { $brand, $input, $output, BRAND, CompileOptions, GlobalMeta, Infer, IssueData, JSONType, NEVER, $RefinementCtx as RefinementCtx, SafeExtendShape, Schema, TimePrecision, TypeOf, ZodAny, ZodArray, ZodBase64, ZodBase64URL, ZodBigInt, ZodBigIntFormat, ZodBoolean, ZodCIDRv4, ZodCIDRv6, ZodCUID, ZodCUID2, ZodCatch, ZodCodec, ZodCoercedBigInt, ZodCoercedBoolean, ZodCoercedDate, ZodCoercedNumber, ZodCoercedString, ZodCompileAsyncError, ZodCompileUnsupportedError, ZodCreditCard, ZodCustom, ZodCustomStringFormat, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodE164, ZodEmail, ZodEmoji, ZodEnum, ZodError, ZodErrorMap, ZodExactOptional, ZodFile, ZodFirstPartySchemaTypes, ZodFirstPartyTypeKind, ZodFlattenedError, ZodFloat32, ZodFloat64, ZodFormattedError, ZodFunction, ZodGUID, ZodIPv4, ZodIPv6, ZodISODate, ZodISODateTime, ZodISODuration, ZodISOTime, ZodInt, ZodInt32, ZodInt64, ZodIntersection, ZodIssue, ZodIssueCode, ZodJSONSchema, ZodJSONSchemaInternals, ZodJWT, ZodKSUID, ZodLazy, ZodLiteral, ZodMAC, ZodMap, ZodNaN, ZodNanoID, ZodNever, ZodNonOptional, ZodNull, ZodNullable, ZodNumber, ZodNumberFormat, ZodObject, ZodOptional, ZodPipe, ZodPrefault, ZodPreprocess, ZodPromise, ZodRawShape, ZodReadonly, ZodRealError, ZodRecord, ZodSafeParseError, ZodSafeParseResult, ZodSafeParseSuccess, ZodSchema, ZodSet, ZodStandardSchemaWithJSON, ZodString, ZodStringFormat, ZodSuccess, ZodSymbol, ZodTemplateLiteral, ZodTransform, ZodTuple, ZodType, ZodTypeAny, ZodUInt32, ZodUInt64, ZodULID, ZodURL, ZodUUID, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, ZodXID, ZodXor, _ZodBigInt, _ZodBoolean, _ZodDate, _ZodNumber, _ZodString, _ZodType, _default, _function, any, array, base64, base64url, bigint$1 as bigint, boolean$1 as boolean, _catch as catch, check, cidrv4, cidrv6, clone, codec, coerce_d_exports as coerce, compile, config, index_d_exports$1 as core, creditCard, cuid, cuid2, custom, date$2 as date, decode, decodeAsync, deepPartial, describe, discriminatedUnion, e164, email, emoji, encode, encodeAsync, _endsWith as endsWith, _enum as enum, exactOptional, file, flattenError, float32, float64, formatError, fromJSONSchema, _function as function, getDiscriminatedOption, getErrorMap, globalRegistry, _gt as gt, _gte as gte, guid, hash, hex, hostname, httpUrl, _includes as includes, output$1 as infer, inferFlattenedErrors, inferFormattedError, input, _instanceof as instanceof, int, int32, int64, intersection, invertCodec, ipv4, ipv6, iso_d_exports as iso, json, jwt, keyof, ksuid, lazy, _length as length, literal, index_d_exports$2 as locales, looseObject, looseRecord, _lowercase as lowercase, _lt as lt, _lte as lte, mac, map, _maxLength as maxLength, _maxSize as maxSize, memoizer, meta, _mime as mime, _minLength as minLength, _minSize as minSize, _multipleOf as multipleOf, nan, nanoid, nativeEnum, _negative as negative, never, _nonnegative as nonnegative, nonoptional, _nonpositive as nonpositive, _normalize as normalize, _null as null, nullable, nullish, number$1 as number, object, optional, output, _overwrite as overwrite, parse, parseAsync, partialRecord, pipe, _positive as positive, prefault, preprocess, prettifyError, promise, _properties as properties, _property as property, readonly, record, refine, _regex as regex, regexes_d_exports as regexes, registry, safeDecode, safeDecodeAsync, safeEncode, safeEncodeAsync, safeParse, safeParseAsync, set, setErrorMap, _size as size, _slugify as slugify, _startsWith as startsWith, strictObject, string$1 as string, stringFormat, stringbool, success, superRefine, symbol, templateLiteral, toJSONSchema, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, toZod, transform, treeifyError, _trim as trim, tuple, uint32, uint64, ulid, _undefined as undefined, union, unknown, _uppercase as uppercase, url, util_d_exports as util, uuid, uuidv4, uuidv6, uuidv7, validate, validateAsync, _void as void, xid, xor };
}
//#endregion
//#region ../../packages/shared/dist/task-C8rUfGxn.d.mts
declare const AccountComputerSummarySchema: ZodObject<{
  computerId: ZodString;
  kind: ZodOptional<ZodEnum<{
    cloud: "cloud";
    local: "local";
  }>>;
  displayName: ZodString;
  platform: ZodEnum<{
    darwin: "darwin";
    linux: "linux";
    win32: "win32";
  }>;
  connectionStatus: ZodEnum<{
    disconnected: "disconnected";
    offline: "offline";
    online: "online";
  }>;
  providerReadiness: ZodOptional<ZodArray<ZodObject<{
    provider: ZodEnum<{
      "claude-code": "claude-code";
      codex: "codex";
      pi: "pi";
    }>;
    status: ZodEnum<{
      checking: "checking";
      install: "install";
      ready: "ready";
      "sign-in": "sign-in";
      unavailable: "unavailable";
    }>;
    observedAt: ZodNullable<ZodString>;
  }, $strict>>>;
  imCliReadiness: ZodOptional<ZodArray<ZodObject<{
    provider: ZodEnum<{
      feishu: "feishu";
      slack: "slack";
    }>;
    status: ZodEnum<{
      checking: "checking";
      install: "install";
      ready: "ready";
      unavailable: "unavailable";
    }>;
    observedAt: ZodNullable<ZodString>;
    reason: ZodOptional<ZodEnum<{
      global_bin_unavailable: "global_bin_unavailable";
      integrity_failed: "integrity_failed";
      unsupported_platform: "unsupported_platform";
      version_incompatible: "version_incompatible";
    }>>;
  }, $strict>>>;
  connectedAt: ZodNullable<ZodString>;
  lastSeenAt: ZodNullable<ZodString>;
  observedAt: ZodString;
  createdAt: ZodString;
  agentIds: ZodArray<ZodString>;
}, $strict>;
declare const ListAccountComputersResponseSchema: ZodObject<{
  computers: ZodArray<ZodObject<{
    computerId: ZodString;
    kind: ZodOptional<ZodEnum<{
      cloud: "cloud";
      local: "local";
    }>>;
    displayName: ZodString;
    platform: ZodEnum<{
      darwin: "darwin";
      linux: "linux";
      win32: "win32";
    }>;
    connectionStatus: ZodEnum<{
      disconnected: "disconnected";
      offline: "offline";
      online: "online";
    }>;
    providerReadiness: ZodOptional<ZodArray<ZodObject<{
      provider: ZodEnum<{
        "claude-code": "claude-code";
        codex: "codex";
        pi: "pi";
      }>;
      status: ZodEnum<{
        checking: "checking";
        install: "install";
        ready: "ready";
        "sign-in": "sign-in";
        unavailable: "unavailable";
      }>;
      observedAt: ZodNullable<ZodString>;
    }, $strict>>>;
    imCliReadiness: ZodOptional<ZodArray<ZodObject<{
      provider: ZodEnum<{
        feishu: "feishu";
        slack: "slack";
      }>;
      status: ZodEnum<{
        checking: "checking";
        install: "install";
        ready: "ready";
        unavailable: "unavailable";
      }>;
      observedAt: ZodNullable<ZodString>;
      reason: ZodOptional<ZodEnum<{
        global_bin_unavailable: "global_bin_unavailable";
        integrity_failed: "integrity_failed";
        unsupported_platform: "unsupported_platform";
        version_incompatible: "version_incompatible";
      }>>;
    }, $strict>>>;
    connectedAt: ZodNullable<ZodString>;
    lastSeenAt: ZodNullable<ZodString>;
    observedAt: ZodString;
    createdAt: ZodString;
    agentIds: ZodArray<ZodString>;
  }, $strict>>;
}, $strict>;
type AccountComputerSummary = output$1<typeof AccountComputerSummarySchema>;
type ListAccountComputersResponse = output$1<typeof ListAccountComputersResponseSchema>;
declare const AgentRuntimeProviderSchema: ZodEnum<{
  "claude-code": "claude-code";
  codex: "codex";
  pi: "pi";
}>;
declare const AgentUsageWindowDaysSchema: ZodUnion<readonly [ZodLiteral<1>, ZodLiteral<7>, ZodLiteral<30>, ZodLiteral<90>]>;
declare const AgentDetailSchema: ZodObject<{
  id: ZodString;
  name: ZodString;
  displayName: ZodString;
  runtimeProvider: ZodEnum<{
    "claude-code": "claude-code";
    codex: "codex";
    pi: "pi";
  }>;
  receiveMode: ZodEnum<{
    all_message: "all_message";
    mention_only: "mention_only";
  }>;
  status: ZodEnum<{
    active: "active";
    suspended: "suspended";
  }>;
  createdAt: ZodString;
  updatedAt: ZodString;
  avatarPath: ZodOptional<ZodNullable<ZodString>>;
  createdBy: ZodObject<{
    userId: ZodString;
    displayName: ZodString;
  }, $strict>;
  computer: ZodNullable<ZodObject<{
    computerId: ZodString;
    displayName: ZodString;
    platform: ZodEnum<{
      darwin: "darwin";
      linux: "linux";
      win32: "win32";
    }>;
  }, $strict>>;
  requiresComputerRebind: ZodOptional<ZodBoolean>;
  slackOAuthAvailable: ZodOptional<ZodBoolean>;
  activity: ZodDiscriminatedUnion<[ZodObject<{
    state: ZodLiteral<"idle">;
  }, $strict>, ZodObject<{
    state: ZodLiteral<"unknown">;
  }, $strict>, ZodObject<{
    state: ZodLiteral<"working">;
    startedAt: ZodString;
  }, $strict>], "state">;
}, $strict>;
declare const AgentUsageDetailSchema: ZodObject<{
  inputTokens: ZodNumber;
  cachedInputTokens: ZodNumber;
  outputTokens: ZodNumber;
  tokens: ZodNumber;
  windowDays: ZodUnion<readonly [ZodLiteral<1>, ZodLiteral<7>, ZodLiteral<30>, ZodLiteral<90>]>;
  startedAt: ZodString;
  endedAt: ZodString;
  tasks: ZodNumber;
  measuredTasks: ZodNumber;
  failed: ZodNumber;
  daily: ZodArray<ZodObject<{
    inputTokens: ZodNumber;
    cachedInputTokens: ZodNumber;
    outputTokens: ZodNumber;
    tokens: ZodNumber;
    date: ZodString;
    tasks: ZodNumber;
    measuredTasks: ZodNumber;
  }, $strict>>;
}, $strict>;
declare const AgentAdminConfigSchema: ZodObject<{
  id: ZodString;
  name: ZodString;
  displayName: ZodString;
  runtimeProvider: ZodEnum<{
    "claude-code": "claude-code";
    codex: "codex";
    pi: "pi";
  }>;
  receiveMode: ZodEnum<{
    all_message: "all_message";
    mention_only: "mention_only";
  }>;
  status: ZodEnum<{
    active: "active";
    suspended: "suspended";
  }>;
  createdAt: ZodString;
  updatedAt: ZodString;
  createdByUserId: ZodString;
  computerId: ZodNullable<ZodString>;
  selfConfigurationEnabled: ZodBoolean;
  revision: ZodNumber;
  runtimeConfig: ZodObject<{
    revision: ZodNumber;
    model: ZodNullable<ZodString>;
    reasoningEffort: ZodNullable<ZodString>;
    instructions: ZodString;
    maxDurationMs: ZodNullable<ZodNumber>;
    contextTrees: ZodArray<ZodObject<{
      kind: ZodLiteral<"git">;
      repository: ZodString;
      path: ZodString;
      ref: ZodString;
    }, $strict>>;
    permissions: ZodObject<{
      approvalPolicy: ZodDefault<ZodEnum<{
        never: "never";
        "on-request": "on-request";
      }>>;
      allowCommands: ZodDefault<ZodArray<ZodString>>;
    }, $strict>;
  }, $strict>;
}, $strict>;
declare const CreateAgentRequestSchema: ZodObject<{
  creationIntentId: ZodOptional<ZodString>;
  name: ZodString;
  displayName: ZodString;
  runtimeProvider: ZodEnum<{
    "claude-code": "claude-code";
    codex: "codex";
    pi: "pi";
  }>;
  computerId: ZodOptional<ZodString>;
  runtimeConfig: ZodOptional<ZodObject<{
    permissions: ZodOptional<ZodObject<{
      approvalPolicy: ZodDefault<ZodEnum<{
        never: "never";
        "on-request": "on-request";
      }>>;
      allowCommands: ZodDefault<ZodArray<ZodString>>;
    }, $strict>>;
    model: ZodOptional<ZodNullable<ZodString>>;
    reasoningEffort: ZodOptional<ZodNullable<ZodString>>;
    instructions: ZodOptional<ZodString>;
    maxDurationMs: ZodOptional<ZodNullable<ZodNumber>>;
  }, $strict>>;
}, $strict>;
declare const UpdateAgentRequestSchema: ZodObject<{
  expectedRevision: ZodNumber;
  displayName: ZodOptional<ZodString>;
  receiveMode: ZodOptional<ZodEnum<{
    all_message: "all_message";
    mention_only: "mention_only";
  }>>;
  selfConfigurationEnabled: ZodOptional<ZodBoolean>;
  runtimeConfig: ZodOptional<ZodObject<{
    permissions: ZodOptional<ZodObject<{
      approvalPolicy: ZodDefault<ZodEnum<{
        never: "never";
        "on-request": "on-request";
      }>>;
      allowCommands: ZodDefault<ZodArray<ZodString>>;
    }, $strict>>;
    model: ZodOptional<ZodNullable<ZodString>>;
    reasoningEffort: ZodOptional<ZodNullable<ZodString>>;
    instructions: ZodOptional<ZodNullable<ZodString>>;
    maxDurationMs: ZodOptional<ZodNullable<ZodNumber>>;
  }, $strict>>;
}, $strict>;
declare const ListAgentsResponseSchema: ZodObject<{
  agents: ZodArray<ZodObject<{
    id: ZodString;
    name: ZodString;
    displayName: ZodString;
    runtimeProvider: ZodEnum<{
      "claude-code": "claude-code";
      codex: "codex";
      pi: "pi";
    }>;
    receiveMode: ZodEnum<{
      all_message: "all_message";
      mention_only: "mention_only";
    }>;
    status: ZodEnum<{
      active: "active";
      suspended: "suspended";
    }>;
    createdAt: ZodString;
    updatedAt: ZodString;
    avatarPath: ZodOptional<ZodNullable<ZodString>>;
    createdBy: ZodObject<{
      userId: ZodString;
      displayName: ZodString;
    }, $strict>;
    computer: ZodNullable<ZodObject<{
      computerId: ZodString;
      displayName: ZodString;
      platform: ZodEnum<{
        darwin: "darwin";
        linux: "linux";
        win32: "win32";
      }>;
    }, $strict>>;
    requiresComputerRebind: ZodOptional<ZodBoolean>;
    slackOAuthAvailable: ZodOptional<ZodBoolean>;
    activity: ZodDiscriminatedUnion<[ZodObject<{
      state: ZodLiteral<"idle">;
    }, $strict>, ZodObject<{
      state: ZodLiteral<"unknown">;
    }, $strict>, ZodObject<{
      state: ZodLiteral<"working">;
      startedAt: ZodString;
    }, $strict>], "state">;
    usage: ZodObject<{
      windowDays: ZodLiteral<30>;
      tasks: ZodNumber;
      failed: ZodNumber;
      tokens: ZodNumber;
    }, $strict>;
  }, $strict>>;
}, $strict>;
declare const AgentRuntimeTestRequestSchema: ZodObject<{
  expectedRevision: ZodNumber;
  expectedRuntimeConfigRevision: ZodNumber;
}, $strict>;
declare const AgentRuntimeTestResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
  status: ZodLiteral<"passed">;
}, $strict>, ZodObject<{
  status: ZodLiteral<"failed">;
  code: ZodEnum<{
    busy: "busy";
    cancelled: "cancelled";
    capability_missing: "capability_missing";
    computer_unavailable: "computer_unavailable";
    interaction_or_tool: "interaction_or_tool";
    provider_failed: "provider_failed";
    provider_start_failed: "provider_start_failed";
    stale_configuration: "stale_configuration";
    timeout: "timeout";
  }>;
}, $strict>], "status">;
type AgentRuntimeProvider = output$1<typeof AgentRuntimeProviderSchema>;
type AgentDetail = output$1<typeof AgentDetailSchema>;
type AgentUsageWindowDays = output$1<typeof AgentUsageWindowDaysSchema>;
type AgentUsageDetail = output$1<typeof AgentUsageDetailSchema>;
type AgentAdminConfig = output$1<typeof AgentAdminConfigSchema>;
type CreateAgentRequest = output$1<typeof CreateAgentRequestSchema>;
type UpdateAgentRequest = output$1<typeof UpdateAgentRequestSchema>;
type ListAgentsResponse = output$1<typeof ListAgentsResponseSchema>;
type AgentRuntimeTestRequest = output$1<typeof AgentRuntimeTestRequestSchema>;
type AgentRuntimeTestResponse = output$1<typeof AgentRuntimeTestResponseSchema>;
declare const ImCliProviderSchema: ZodEnum<{
  feishu: "feishu";
  slack: "slack";
}>;
declare const ProviderCliValidationResultReasonSchema: ZodEnum<{
  artifact_changed: "artifact_changed";
  credential_rejected: "credential_rejected";
  identity_mismatch: "identity_mismatch";
  provider_unreachable: "provider_unreachable";
  rate_limited: "rate_limited";
  scope_missing: "scope_missing";
  upgrade_required: "upgrade_required";
  validation_busy: "validation_busy";
  validation_expired: "validation_expired";
}>;
/**
 * Exchange identifies the local installation, not an existing Computer. The Server decides create vs
 * repair only from the one-time code: create always allocates a new Computer, and repair names its
 * target Computer when the code is issued.
 */
declare const ComputerConnectCodeExchangeRequestSchema: ZodObject<{
  code: ZodString;
  installationId: ZodString;
  displayName: ZodString;
  platform: ZodEnum<{
    darwin: "darwin";
    linux: "linux";
    win32: "win32";
  }>;
  arch: ZodString;
  clientVersion: ZodString;
}, $strict>;
declare const ComputerConnectCodeExchangeResponseSchema: ZodObject<{
  agentId: ZodOptional<ZodString>;
  runtimeProvider: ZodOptional<ZodEnum<{
    "claude-code": "claude-code";
    codex: "codex";
    pi: "pi";
  }>>;
  computerId: ZodString;
  installationId: ZodString;
  machineToken: ZodString;
}, $strict>;
declare const ComputerConnectCodeIssueResponseSchema: ZodObject<{
  connectCodeId: ZodString;
  bootstrapCommand: ZodString;
  expiresIn: ZodNumber;
  issuedAt: ZodString;
  mode: ZodOptional<ZodEnum<{
    create: "create";
    repair: "repair";
  }>>;
}, $strict>;
declare const ComputerConnectCodeStatusSchema: ZodDiscriminatedUnion<[ZodObject<{
  connectCodeId: ZodString;
  computerId: ZodNull;
  redeemedAt: ZodNull;
  state: ZodLiteral<"pending">;
}, $strict>, ZodObject<{
  connectCodeId: ZodString;
  computerId: ZodNull;
  redeemedAt: ZodNull;
  state: ZodLiteral<"expired">;
}, $strict>, ZodObject<{
  connectCodeId: ZodString;
  computerId: ZodNull;
  redeemedAt: ZodNull;
  state: ZodLiteral<"revoked">;
}, $strict>, ZodObject<{
  connectCodeId: ZodString;
  state: ZodLiteral<"redeemed">;
  computerId: ZodString;
  redeemedAt: ZodString;
}, $strict>], "state">;
type ComputerConnectCodeExchangeRequest = output$1<typeof ComputerConnectCodeExchangeRequestSchema>;
type ComputerConnectCodeExchangeResponse = output$1<typeof ComputerConnectCodeExchangeResponseSchema>;
type ComputerConnectCodeIssueResponse = output$1<typeof ComputerConnectCodeIssueResponseSchema>;
type ComputerConnectCodeStatus = output$1<typeof ComputerConnectCodeStatusSchema>;
type ImCliProvider = output$1<typeof ImCliProviderSchema>;
type ProviderCliValidationResultReason = output$1<typeof ProviderCliValidationResultReasonSchema>;
declare const ConnectCodeExchangeResponseSchema: ZodObject<{
  accessToken: ZodString;
  refreshToken: ZodString;
  tokenType: ZodLiteral<"Bearer">;
  expiresIn: ZodNumber;
}, $strict>;
declare const RefreshTokenResponseSchema: ZodObject<{
  accessToken: ZodString;
  refreshToken: ZodString;
  tokenType: ZodLiteral<"Bearer">;
  expiresIn: ZodNumber;
}, $strict>;
/**
 * Authentication proves Account identity only. `setupCompletedAt` is durable Account state from
 * `users.setup_completed_at`; it is never derived from Agents, Workspaces, or grants.
 */
declare const MeResponseSchema: ZodObject<{
  user: ZodObject<{
    id: ZodString;
    email: ZodString;
    displayName: ZodString;
  }, $strict>;
  setupCompletedAt: ZodNullable<ZodString>;
}, $strict>;
type ConnectCodeExchangeResponse = output$1<typeof ConnectCodeExchangeResponseSchema>;
type RefreshTokenResponse = output$1<typeof RefreshTokenResponseSchema>;
type MeResponse = output$1<typeof MeResponseSchema>;
declare const ContextTreeConnectionSchema: ZodObject<{
  kind: ZodLiteral<"git">;
  repository: ZodString;
  path: ZodString;
  ref: ZodString;
}, $strict>;
type ContextTreeConnection = output$1<typeof ContextTreeConnectionSchema>;
/**
 * One client-side failure relayed to the server for forwarding to an error tracker.
 *
 * The client redacts before sending and the server redacts again before forwarding; the schema only
 * bounds what may cross the wire. No token or cookie field exists, and `url` never carries a query
 * string or fragment.
 *
 * The identifiers below are attribution, not authorization. The relay is anonymous, so every one of
 * them is chosen by the caller and a report that names an Account only says that whoever posted it
 * claimed to be that Account. Read them as a lead to follow, never as proof of who someone is.
 */
declare const ErrorReportRequestSchema: ZodObject<{
  source: ZodEnum<{
    cli: "cli";
    web: "web";
  }>;
  message: ZodString;
  stack: ZodOptional<ZodString>;
  code: ZodOptional<ZodString>;
  version: ZodOptional<ZodString>;
  channel: ZodOptional<ZodEnum<{
    dev: "dev";
    prod: "prod";
    staging: "staging";
  }>>;
  environment: ZodOptional<ZodString>;
  reportId: ZodOptional<ZodString>;
  requestId: ZodOptional<ZodString>;
  traceId: ZodOptional<ZodString>;
  userId: ZodOptional<ZodString>;
  route: ZodOptional<ZodString>;
  platform: ZodOptional<ZodString>;
  computerId: ZodOptional<ZodString>;
  installationId: ZodOptional<ZodString>;
  agentId: ZodOptional<ZodString>;
  sessionId: ZodOptional<ZodString>;
  turnId: ZodOptional<ZodString>;
  provider: ZodOptional<ZodString>;
  url: ZodOptional<ZodPipe<ZodString, ZodTransform<string, string>>>;
  command: ZodOptional<ZodString>;
  userAgent: ZodOptional<ZodString>;
  occurredAt: ZodString;
}, $strict>;
type ErrorReportRequest = output$1<typeof ErrorReportRequestSchema>;
//#endregion
//#region src/errors.d.ts
declare const ErrorCategorySchema: ZodEnum<{
  credential: "credential";
  deterministic: "deterministic";
  rate_limit: "rate_limit";
  transient: "transient";
  validation: "validation";
}>;
declare const ErrorCodeSchema: ZodEnum<{
  ACCOUNT_SETUP_AGENT_NOT_FOUND: "ACCOUNT_SETUP_AGENT_NOT_FOUND";
  ACCOUNT_SETUP_NOT_READY: "ACCOUNT_SETUP_NOT_READY";
  AGENT_COMPUTER_NOT_BOUND: "AGENT_COMPUTER_NOT_BOUND";
  AGENT_CREATION_INTENT_CONFLICT: "AGENT_CREATION_INTENT_CONFLICT";
  AGENT_FORBIDDEN: "AGENT_FORBIDDEN";
  AGENT_LIFECYCLE_CONFLICT: "AGENT_LIFECYCLE_CONFLICT";
  AGENT_NAME_CONFLICT: "AGENT_NAME_CONFLICT";
  AGENT_REBIND_BLOCKED: "AGENT_REBIND_BLOCKED";
  AGENT_REVISION_CONFLICT: "AGENT_REVISION_CONFLICT";
  AGENT_SELF_CONFIGURATION_DISABLED: "AGENT_SELF_CONFIGURATION_DISABLED";
  AUTH_CODE_CONSUMED: "AUTH_CODE_CONSUMED";
  AUTH_CODE_EXPIRED: "AUTH_CODE_EXPIRED";
  AUTH_CODE_PURPOSE_MISMATCH: "AUTH_CODE_PURPOSE_MISMATCH";
  AUTH_DEV_USER_UNAVAILABLE: "AUTH_DEV_USER_UNAVAILABLE";
  AUTH_EMAIL_CONFLICT: "AUTH_EMAIL_CONFLICT";
  AUTH_IDENTITY_CONFLICT: "AUTH_IDENTITY_CONFLICT";
  AUTH_INVALID_CODE: "AUTH_INVALID_CODE";
  AUTH_INVALID_TOKEN: "AUTH_INVALID_TOKEN";
  AUTH_OAUTH_FAILED: "AUTH_OAUTH_FAILED";
  AUTH_PROVIDER_DISABLED: "AUTH_PROVIDER_DISABLED";
  AUTH_USER_MISMATCH: "AUTH_USER_MISMATCH";
  AUTH_USER_SUSPENDED: "AUTH_USER_SUSPENDED";
  CLOUD_BILLING_UNAVAILABLE: "CLOUD_BILLING_UNAVAILABLE";
  CLOUD_CAPACITY_EXCEEDED: "CLOUD_CAPACITY_EXCEEDED";
  CLOUD_MODEL_NOT_ALLOWED: "CLOUD_MODEL_NOT_ALLOWED";
  CLOUD_MODEL_UNAVAILABLE: "CLOUD_MODEL_UNAVAILABLE";
  COMPUTER_IDENTITY_CONFLICT: "COMPUTER_IDENTITY_CONFLICT";
  COMPUTER_IN_USE: "COMPUTER_IN_USE";
  COMPUTER_NOT_DELETABLE: "COMPUTER_NOT_DELETABLE";
  COMPUTER_NOT_DISCONNECTABLE: "COMPUTER_NOT_DISCONNECTABLE";
  COMPUTER_NOT_FOUND: "COMPUTER_NOT_FOUND";
  COMPUTER_NOT_REGISTERED: "COMPUTER_NOT_REGISTERED";
  FEISHU_APP_ALREADY_BOUND: "FEISHU_APP_ALREADY_BOUND";
  FEISHU_BINDING_IDENTITY_MISMATCH: "FEISHU_BINDING_IDENTITY_MISMATCH";
  FEISHU_UPSTREAM_UNAVAILABLE: "FEISHU_UPSTREAM_UNAVAILABLE";
  GITHUB_ADMISSION_PERMISSION_INSUFFICIENT: "GITHUB_ADMISSION_PERMISSION_INSUFFICIENT";
  GITHUB_ADMISSION_PROOF_INVALID: "GITHUB_ADMISSION_PROOF_INVALID";
  GITHUB_ADMISSION_PROOF_STALE: "GITHUB_ADMISSION_PROOF_STALE";
  GITHUB_ADMISSION_REPOSITORY_MISSING: "GITHUB_ADMISSION_REPOSITORY_MISSING";
  GITHUB_AGENT_OWNERSHIP_INVALID: "GITHUB_AGENT_OWNERSHIP_INVALID";
  GITHUB_AUTHORIZATION_VERSION_CONFLICT: "GITHUB_AUTHORIZATION_VERSION_CONFLICT";
  GITHUB_CONNECTION_CONFLICT: "GITHUB_CONNECTION_CONFLICT";
  GITHUB_CONNECTION_NOT_FOUND: "GITHUB_CONNECTION_NOT_FOUND";
  GITHUB_CONNECTION_STATE_INVALID: "GITHUB_CONNECTION_STATE_INVALID";
  GITHUB_CREDENTIAL_INPUT_INVALID: "GITHUB_CREDENTIAL_INPUT_INVALID";
  GITHUB_DELEGATED_IM_BINDING_INVALID: "GITHUB_DELEGATED_IM_BINDING_INVALID";
  GITHUB_IDENTITY_MISMATCH: "GITHUB_IDENTITY_MISMATCH";
  GITHUB_INPUT_INVALID: "GITHUB_INPUT_INVALID";
  GITHUB_INTEGRATION_UNAVAILABLE: "GITHUB_INTEGRATION_UNAVAILABLE";
  GITHUB_OAUTH_DENIED: "GITHUB_OAUTH_DENIED";
  GITHUB_OAUTH_FLOW_EXPIRED: "GITHUB_OAUTH_FLOW_EXPIRED";
  GITHUB_OAUTH_FLOW_INVALID: "GITHUB_OAUTH_FLOW_INVALID";
  GITHUB_OAUTH_SESSION_MISMATCH: "GITHUB_OAUTH_SESSION_MISMATCH";
  GITHUB_RATE_LIMITED: "GITHUB_RATE_LIMITED";
  GITHUB_TOKEN_LIFETIME_UNSUPPORTED: "GITHUB_TOKEN_LIFETIME_UNSUPPORTED";
  GITHUB_UPSTREAM_ERROR: "GITHUB_UPSTREAM_ERROR";
  GITHUB_UPSTREAM_UNAVAILABLE: "GITHUB_UPSTREAM_UNAVAILABLE";
  IM_BINDING_CONFIGURATION_CONFLICT: "IM_BINDING_CONFIGURATION_CONFLICT";
  IM_BINDING_FORBIDDEN: "IM_BINDING_FORBIDDEN";
  IM_BINDING_GENERATION_STALE: "IM_BINDING_GENERATION_STALE";
  IM_BINDING_NOT_FOUND: "IM_BINDING_NOT_FOUND";
  IM_BINDING_PROVIDER_IMMUTABLE: "IM_BINDING_PROVIDER_IMMUTABLE";
  IM_BINDING_SCOPE_REAUTH_REQUIRED: "IM_BINDING_SCOPE_REAUTH_REQUIRED";
  IM_BINDING_TEMPORARILY_UNAVAILABLE: "IM_BINDING_TEMPORARILY_UNAVAILABLE";
  IM_BINDING_UNBIND_REQUIRED: "IM_BINDING_UNBIND_REQUIRED";
  INTERNAL_ERROR: "INTERNAL_ERROR";
  MCP_AUTHORIZATION_KIND_INVALID: "MCP_AUTHORIZATION_KIND_INVALID";
  MCP_AUTHORIZATION_NOT_FOUND: "MCP_AUTHORIZATION_NOT_FOUND";
  MCP_AUTHORIZATION_REQUIRED: "MCP_AUTHORIZATION_REQUIRED";
  MCP_AUTHORIZATION_SCOPE_REQUIRED: "MCP_AUTHORIZATION_SCOPE_REQUIRED";
  MCP_AUTH_HEADER_INVALID: "MCP_AUTH_HEADER_INVALID";
  MCP_BINDING_CONFLICT: "MCP_BINDING_CONFLICT";
  MCP_BINDING_NOT_FOUND: "MCP_BINDING_NOT_FOUND";
  MCP_CREDENTIAL_INPUT_INVALID: "MCP_CREDENTIAL_INPUT_INVALID";
  MCP_OAUTH_DENIED: "MCP_OAUTH_DENIED";
  MCP_OAUTH_FAILED: "MCP_OAUTH_FAILED";
  MCP_OAUTH_FLOW_EXPIRED: "MCP_OAUTH_FLOW_EXPIRED";
  MCP_OAUTH_FLOW_INVALID: "MCP_OAUTH_FLOW_INVALID";
  MCP_PROBE_FAILED: "MCP_PROBE_FAILED";
  MCP_PROTOCOL_UNSUPPORTED: "MCP_PROTOCOL_UNSUPPORTED";
  MCP_REFRESH_OUTCOME_UNKNOWN: "MCP_REFRESH_OUTCOME_UNKNOWN";
  MCP_REGISTRATION_FAILED: "MCP_REGISTRATION_FAILED";
  MCP_REGISTRATION_UNSUPPORTED: "MCP_REGISTRATION_UNSUPPORTED";
  MCP_SELF_ATTACH_NONE_AUTH_FORBIDDEN: "MCP_SELF_ATTACH_NONE_AUTH_FORBIDDEN";
  MCP_SERVER_FORBIDDEN: "MCP_SERVER_FORBIDDEN";
  MCP_SERVER_IN_USE: "MCP_SERVER_IN_USE";
  MCP_SERVER_NAME_CONFLICT: "MCP_SERVER_NAME_CONFLICT";
  MCP_SERVER_NOT_FOUND: "MCP_SERVER_NOT_FOUND";
  MCP_SERVER_REVISION_CONFLICT: "MCP_SERVER_REVISION_CONFLICT";
  MCP_SERVER_URL_INVALID: "MCP_SERVER_URL_INVALID";
  MCP_TRANSPORT_UNSUPPORTED: "MCP_TRANSPORT_UNSUPPORTED";
  MCP_UPSTREAM_ERROR: "MCP_UPSTREAM_ERROR";
  MCP_UPSTREAM_UNAVAILABLE: "MCP_UPSTREAM_UNAVAILABLE";
  MCP_URL_BLOCKED: "MCP_URL_BLOCKED";
  ONBOARDING_RESET_OWNERSHIP_INCONSISTENT: "ONBOARDING_RESET_OWNERSHIP_INCONSISTENT";
  ONBOARDING_RESET_UNVERIFIED: "ONBOARDING_RESET_UNVERIFIED";
  PROTOCOL_CAPABILITY_UNSUPPORTED: "PROTOCOL_CAPABILITY_UNSUPPORTED";
  PROTOCOL_ERROR: "PROTOCOL_ERROR";
  PROTOCOL_VERSION_UNSUPPORTED: "PROTOCOL_VERSION_UNSUPPORTED";
  RATE_LIMITED: "RATE_LIMITED";
  RESOURCE_NOT_FOUND: "RESOURCE_NOT_FOUND";
  RUNTIME_AUTH_TIMEOUT: "RUNTIME_AUTH_TIMEOUT";
  RUNTIME_REGISTER_TIMEOUT: "RUNTIME_REGISTER_TIMEOUT";
  SANDBOX_RUNNER_CONFLICT: "SANDBOX_RUNNER_CONFLICT";
  SCHEDULE_INVALID_REQUEST: "SCHEDULE_INVALID_REQUEST";
  SCHEDULE_INVALID_RULE: "SCHEDULE_INVALID_RULE";
  SCHEDULE_INVALID_TIMEZONE: "SCHEDULE_INVALID_TIMEZONE";
  SCHEDULE_NO_FUTURE_OCCURRENCE: "SCHEDULE_NO_FUTURE_OCCURRENCE";
  SCHEDULE_REVISION_CONFLICT: "SCHEDULE_REVISION_CONFLICT";
  SCHEDULE_TARGET_INVALID: "SCHEDULE_TARGET_INVALID";
  SCHEDULE_TARGET_REQUIRED: "SCHEDULE_TARGET_REQUIRED";
  SERVICE_UNAVAILABLE: "SERVICE_UNAVAILABLE";
  SESSION_CURSOR_INVALID: "SESSION_CURSOR_INVALID";
  SESSION_PROOF_INVALID: "SESSION_PROOF_INVALID";
  SKILL_ARCHIVE_INVALID: "SKILL_ARCHIVE_INVALID";
  SKILL_ARCHIVE_TOO_LARGE: "SKILL_ARCHIVE_TOO_LARGE";
  SKILL_HASH_MISMATCH: "SKILL_HASH_MISMATCH";
  SKILL_LIMIT_REACHED: "SKILL_LIMIT_REACHED";
  SKILL_MANIFEST_INVALID: "SKILL_MANIFEST_INVALID";
  SKILL_NAME_CONFLICT: "SKILL_NAME_CONFLICT";
  SKILL_NAME_RESERVED: "SKILL_NAME_RESERVED";
  SKILL_NOT_FOUND: "SKILL_NOT_FOUND";
  SKILL_PRESET_NOT_FOUND: "SKILL_PRESET_NOT_FOUND";
  SKILL_REVISION_CONFLICT: "SKILL_REVISION_CONFLICT";
  SKILL_SOURCE_BLOCKED: "SKILL_SOURCE_BLOCKED";
  SKILL_SOURCE_INVALID: "SKILL_SOURCE_INVALID";
  SKILL_SOURCE_NO_SKILLS: "SKILL_SOURCE_NO_SKILLS";
  SKILL_SOURCE_TOO_LARGE: "SKILL_SOURCE_TOO_LARGE";
  SKILL_SOURCE_UNREACHABLE: "SKILL_SOURCE_UNREACHABLE";
  SKILL_STORAGE_UNAVAILABLE: "SKILL_STORAGE_UNAVAILABLE";
  SLACK_APP_TEAM_ALREADY_BOUND: "SLACK_APP_TEAM_ALREADY_BOUND";
  SLACK_AUTH_IDENTITY_INCOMPLETE: "SLACK_AUTH_IDENTITY_INCOMPLETE";
  SLACK_AUTH_INVALID: "SLACK_AUTH_INVALID";
  SLACK_BINDING_IDENTITY_MISMATCH: "SLACK_BINDING_IDENTITY_MISMATCH";
  SLACK_CONFIGURATION_CONFLICT: "SLACK_CONFIGURATION_CONFLICT";
  SLACK_OAUTH_FAILED: "SLACK_OAUTH_FAILED";
  SLACK_SCOPE_REAUTH_REQUIRED: "SLACK_SCOPE_REAUTH_REQUIRED";
  SLACK_UPSTREAM_UNAVAILABLE: "SLACK_UPSTREAM_UNAVAILABLE";
  TASK_NOT_QUEUED: "TASK_NOT_QUEUED";
  VALIDATION_ERROR: "VALIDATION_ERROR";
}>;
declare const ValidationIssueSchema: ZodObject<{
  path: ZodArray<ZodUnion<readonly [ZodString, ZodNumber]>>;
  code: ZodString;
  message: ZodString;
}, $strict>;
type ErrorCategory = output$1<typeof ErrorCategorySchema>;
type ErrorCode = output$1<typeof ErrorCodeSchema>;
type ValidationIssue = output$1<typeof ValidationIssueSchema>;
//#endregion
//#region src/health.d.ts
declare const ServerHealthSchema: ZodObject<{
  status: ZodLiteral<"ok">;
  service: ZodLiteral<"opentag-server">;
}, $strict>;
type ServerHealth = output$1<typeof ServerHealthSchema>;
declare const ImBindingSummarySchema: ZodObject<{
  id: ZodString;
  agentId: ZodString;
  provider: ZodEnum<{
    feishu: "feishu";
    slack: "slack";
  }>;
  bindingState: ZodEnum<{
    active: "active";
    disabled: "disabled";
    error: "error";
    provisioning: "provisioning";
    reauthorization_required: "reauthorization_required";
  }>;
  bot: ZodObject<{
    displayName: ZodNullable<ZodString>;
    avatarUrl: ZodNullable<ZodString>;
  }, $strict>;
  receiveMode: ZodEnum<{
    all_message: "all_message";
    mention_only: "mention_only";
  }>;
  lastInboundAt: ZodNullable<ZodString>;
  lastValidatedAt: ZodNullable<ZodString>;
  lastRuntimeObservationAt: ZodNullable<ZodString>;
}, $strict>;
declare const ImBindingAdminDetailSchema: ZodObject<{
  id: ZodString;
  agentId: ZodString;
  provider: ZodEnum<{
    feishu: "feishu";
    slack: "slack";
  }>;
  bindingState: ZodEnum<{
    active: "active";
    disabled: "disabled";
    error: "error";
    provisioning: "provisioning";
    reauthorization_required: "reauthorization_required";
  }>;
  bot: ZodObject<{
    displayName: ZodNullable<ZodString>;
    avatarUrl: ZodNullable<ZodString>;
  }, $strict>;
  receiveMode: ZodEnum<{
    all_message: "all_message";
    mention_only: "mention_only";
  }>;
  lastInboundAt: ZodNullable<ZodString>;
  lastValidatedAt: ZodNullable<ZodString>;
  lastRuntimeObservationAt: ZodNullable<ZodString>;
  identity: ZodDiscriminatedUnion<[ZodObject<{
    provider: ZodLiteral<"feishu">;
    appId: ZodString;
    teamId: ZodNullable<ZodString>;
    botOpenId: ZodString;
    teamBrand: ZodNullable<ZodString>;
  }, $strict>, ZodObject<{
    provider: ZodLiteral<"slack">;
    appId: ZodString;
    teamId: ZodString;
    enterpriseId: ZodNullable<ZodString>;
    botUserId: ZodString;
    appIdEvidence: ZodLiteral<"configured">;
  }, $strict>], "provider">;
  credentialGeneration: ZodNumber;
  grantedCapabilities: ZodArray<ZodString>;
  reauthorizationRequired: ZodBoolean;
  lastErrorCode: ZodNullable<ZodString>;
}, $strict>;
declare const FeishuSetupAttemptSchema: ZodObject<{
  id: ZodString;
  agentId: ZodString;
  intent: ZodEnum<{
    create: "create";
    reauthorize: "reauthorize";
    replace: "replace";
  }>;
  state: ZodEnum<{
    awaiting_user: "awaiting_user";
    canceled: "canceled";
    expired: "expired";
    failed: "failed";
    pending_activation: "pending_activation";
    succeeded: "succeeded";
    validating: "validating";
  }>;
  qrUrl: ZodNullable<ZodString>;
  expiresAt: ZodString;
  errorCode: ZodNullable<ZodString>;
  completedAt: ZodNullable<ZodString>;
  createdAt: ZodString;
  activation: ZodOptional<ZodObject<{
    appId: ZodString;
    reason: ZodEnum<{
      app_unavailable: "app_unavailable";
      checking: "checking";
      permissions_pending: "permissions_pending";
      runtime_unavailable: "runtime_unavailable";
      temporary_failure: "temporary_failure";
    }>;
    missingScopes: ZodArray<ZodString>;
    lastCheckedAt: ZodNullable<ZodString>;
    nextCheckAt: ZodString;
  }, $strict>>;
}, $strict>;
declare const StartSlackOAuthRequestSchema: ZodObject<{
  intent: ZodEnum<{
    create: "create";
    reauthorize: "reauthorize";
  }>;
  returnSurface: ZodOptional<ZodEnum<{
    "agent-messaging-settings": "agent-messaging-settings";
    "agent-setup": "agent-setup";
  }>>;
  expectedMessaging: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
    kind: ZodLiteral<"unbound">;
  }, $strict>, ZodObject<{
    kind: ZodLiteral<"bound">;
    provider: ZodEnum<{
      feishu: "feishu";
      slack: "slack";
    }>;
    bindingId: ZodString;
    credentialGeneration: ZodNumber;
  }, $strict>], "kind">>;
}, $strict>;
declare const StartSlackOAuthResponseSchema: ZodObject<{
  authorizationUrl: ZodString;
  expiresAt: ZodString;
}, $strict>;
declare const ImBindingDiagnosticsSchema: ZodObject<{
  imBindingId: ZodString;
  provider: ZodEnum<{
    feishu: "feishu";
    slack: "slack";
  }>;
  ready: ZodBoolean;
  agentRuntimeReadiness: ZodEnum<{
    checking: "checking";
    install: "install";
    ready: "ready";
    "sign-in": "sign-in";
    unavailable: "unavailable";
  }>;
  providerCliReadiness: ZodEnum<{
    checking: "checking";
    install: "install";
    not_applicable: "not_applicable";
    ready: "ready";
    unavailable: "unavailable";
  }>;
  providerCliReason: ZodOptional<ZodEnum<{
    global_bin_unavailable: "global_bin_unavailable";
    integrity_failed: "integrity_failed";
    unsupported_platform: "unsupported_platform";
    version_incompatible: "version_incompatible";
  }>>;
  credentialExecutionReadiness: ZodEnum<{
    checking: "checking";
    needs_attention: "needs_attention";
    ready: "ready";
    retrying: "retrying";
    unconfirmed: "unconfirmed";
  }>;
  credentialExecutionReason: ZodOptional<ZodEnum<{
    credential_rejected: "credential_rejected";
    identity_mismatch: "identity_mismatch";
    provider_unreachable: "provider_unreachable";
    rate_limited: "rate_limited";
    scope_missing: "scope_missing";
    upgrade_required: "upgrade_required";
  }>>;
  credentialGeneration: ZodNumber;
  credentialStatus: ZodEnum<{
    invalid: "invalid";
    valid: "valid";
  }>;
  requiredCapabilities: ZodArray<ZodString>;
  grantedCapabilities: ZodArray<ZodString>;
  missingCapabilities: ZodArray<ZodString>;
  reauthorizationRequired: ZodBoolean;
  slackAppId: ZodNullable<ZodObject<{
    value: ZodString;
    evidence: ZodLiteral<"configured">;
    ingressMatchRequired: ZodLiteral<true>;
  }, $strict>>;
  slackIdentityClosure: ZodNullable<ZodObject<{
    status: ZodEnum<{
      pending: "pending";
      verified: "verified";
    }>;
    verifiedAt: ZodNullable<ZodString>;
  }, $strict>>;
  connection: ZodNullable<ZodObject<{
    state: ZodEnum<{
      connected: "connected";
      disconnected: "disconnected";
    }>;
    observedAt: ZodString;
  }, $strip>>;
  lastInboundAt: ZodNullable<ZodString>;
  lastValidatedAt: ZodNullable<ZodString>;
  lastRuntimeObservationAt: ZodNullable<ZodString>;
  lastErrorCode: ZodNullable<ZodString>;
}, $strict>;
type ImBindingSummary = output$1<typeof ImBindingSummarySchema>;
type ImBindingAdminDetail = output$1<typeof ImBindingAdminDetailSchema>;
type FeishuSetupAttempt = output$1<typeof FeishuSetupAttemptSchema>;
type StartSlackOAuthRequest = output$1<typeof StartSlackOAuthRequestSchema>;
type StartSlackOAuthResponse = output$1<typeof StartSlackOAuthResponseSchema>;
type ImBindingDiagnostics = output$1<typeof ImBindingDiagnosticsSchema>;
/**
 * `defaultAuthKind` is a prefill for a newly created authorization and the trigger for creating a
 * `none` row when binding such a Server. It is never a statement of what the Server requires, and
 * it never constrains the kind an Agent actually writes.
 */
declare const MCPServerSchema: ZodObject<{
  id: ZodString;
  name: ZodString;
  description: ZodNullable<ZodString>;
  url: ZodString;
  defaultAuthKind: ZodEnum<{
    bearer: "bearer";
    none: "none";
    oauth: "oauth";
  }>;
  authHeader: ZodString;
  authScheme: ZodString;
  extraHeaders: ZodRecord<ZodString, ZodString>;
  revision: ZodNumber;
  boundAgentCount: ZodNumber;
  authorizedAgentCount: ZodNumber;
  lastProbedAt: ZodNullable<ZodString>;
  createdAt: ZodString;
  updatedAt: ZodString;
}, $strict>;
type MCPServer = output$1<typeof MCPServerSchema>;
declare const ListMCPServersResponseSchema: ZodObject<{
  servers: ZodArray<ZodObject<{
    id: ZodString;
    name: ZodString;
    description: ZodNullable<ZodString>;
    url: ZodString;
    defaultAuthKind: ZodEnum<{
      bearer: "bearer";
      none: "none";
      oauth: "oauth";
    }>;
    authHeader: ZodString;
    authScheme: ZodString;
    extraHeaders: ZodRecord<ZodString, ZodString>;
    revision: ZodNumber;
    boundAgentCount: ZodNumber;
    authorizedAgentCount: ZodNumber;
    lastProbedAt: ZodNullable<ZodString>;
    createdAt: ZodString;
    updatedAt: ZodString;
  }, $strict>>;
}, $strict>;
type ListMCPServersResponse = output$1<typeof ListMCPServersResponseSchema>;
/**
 * One Agent's view of one Server: where it mounted, whether it is enabled, the effective
 * configuration, and that Agent's own authorization. `enabled` and the authorization status are
 * independent — a disabled binding keeps its credential and needs no reauthorization.
 */
declare const MCPAgentServerSchema: ZodObject<{
  mcpServerId: ZodString;
  name: ZodString;
  description: ZodNullable<ZodString>;
  discoveredDescription: ZodNullable<ZodString>;
  enabled: ZodBoolean;
  effective: ZodObject<{
    url: ZodString;
    authHeader: ZodString;
    authScheme: ZodString;
    extraHeaders: ZodRecord<ZodString, ZodString>;
  }, $strict>;
  overridden: ZodObject<{
    url: ZodBoolean;
    authHeader: ZodBoolean;
    authScheme: ZodBoolean;
    extraHeaders: ZodBoolean;
  }, $strict>;
  authorization: ZodNullable<ZodObject<{
    kind: ZodEnum<{
      bearer: "bearer";
      none: "none";
      oauth: "oauth";
    }>;
    status: ZodEnum<{
      active: "active";
      error: "error";
      expired: "expired";
      pending: "pending";
      revoked: "revoked";
    }>;
    hasCredential: ZodBoolean;
    scopes: ZodNullable<ZodArray<ZodString>>;
    accessTokenExpiresAt: ZodNullable<ZodString>;
    authorizationServer: ZodNullable<ZodString>;
    probeState: ZodEnum<{
      failed: "failed";
      pending: "pending";
      succeeded: "succeeded";
    }>;
    probedAt: ZodNullable<ZodString>;
    probeError: ZodNullable<ZodString>;
    toolsCount: ZodNullable<ZodNumber>;
    toolsTruncated: ZodBoolean;
    failureCode: ZodNullable<ZodString>;
    revision: ZodNumber;
  }, $strict>>;
  snapshot: ZodNullable<ZodObject<{
    protocolEra: ZodNullable<ZodEnum<{
      legacy: "legacy";
      modern: "modern";
    }>>;
    protocolVersion: ZodNullable<ZodString>;
    serverInfo: ZodNullable<ZodUnknown>;
    capabilities: ZodNullable<ZodUnknown>;
    instructions: ZodNullable<ZodString>;
    tools: ZodNullable<ZodArray<ZodObject<{
      name: ZodString;
      description: ZodNullable<ZodString>;
      inputSchema: ZodNullable<ZodUnknown>;
    }, $strict>>>;
  }, $strict>>;
  createdAt: ZodString;
  updatedAt: ZodString;
}, $strict>;
type MCPAgentServer = output$1<typeof MCPAgentServerSchema>;
declare const ListAgentMCPServersResponseSchema: ZodObject<{
  servers: ZodArray<ZodObject<{
    mcpServerId: ZodString;
    name: ZodString;
    description: ZodNullable<ZodString>;
    discoveredDescription: ZodNullable<ZodString>;
    enabled: ZodBoolean;
    effective: ZodObject<{
      url: ZodString;
      authHeader: ZodString;
      authScheme: ZodString;
      extraHeaders: ZodRecord<ZodString, ZodString>;
    }, $strict>;
    overridden: ZodObject<{
      url: ZodBoolean;
      authHeader: ZodBoolean;
      authScheme: ZodBoolean;
      extraHeaders: ZodBoolean;
    }, $strict>;
    authorization: ZodNullable<ZodObject<{
      kind: ZodEnum<{
        bearer: "bearer";
        none: "none";
        oauth: "oauth";
      }>;
      status: ZodEnum<{
        active: "active";
        error: "error";
        expired: "expired";
        pending: "pending";
        revoked: "revoked";
      }>;
      hasCredential: ZodBoolean;
      scopes: ZodNullable<ZodArray<ZodString>>;
      accessTokenExpiresAt: ZodNullable<ZodString>;
      authorizationServer: ZodNullable<ZodString>;
      probeState: ZodEnum<{
        failed: "failed";
        pending: "pending";
        succeeded: "succeeded";
      }>;
      probedAt: ZodNullable<ZodString>;
      probeError: ZodNullable<ZodString>;
      toolsCount: ZodNullable<ZodNumber>;
      toolsTruncated: ZodBoolean;
      failureCode: ZodNullable<ZodString>;
      revision: ZodNumber;
    }, $strict>>;
    snapshot: ZodNullable<ZodObject<{
      protocolEra: ZodNullable<ZodEnum<{
        legacy: "legacy";
        modern: "modern";
      }>>;
      protocolVersion: ZodNullable<ZodString>;
      serverInfo: ZodNullable<ZodUnknown>;
      capabilities: ZodNullable<ZodUnknown>;
      instructions: ZodNullable<ZodString>;
      tools: ZodNullable<ZodArray<ZodObject<{
        name: ZodString;
        description: ZodNullable<ZodString>;
        inputSchema: ZodNullable<ZodUnknown>;
      }, $strict>>>;
    }, $strict>>;
    createdAt: ZodString;
    updatedAt: ZodString;
  }, $strict>>;
}, $strict>;
type ListAgentMCPServersResponse = output$1<typeof ListAgentMCPServersResponseSchema>;
declare const MCPServerDetailSchema: ZodObject<{
  server: ZodObject<{
    id: ZodString;
    name: ZodString;
    description: ZodNullable<ZodString>;
    url: ZodString;
    defaultAuthKind: ZodEnum<{
      bearer: "bearer";
      none: "none";
      oauth: "oauth";
    }>;
    authHeader: ZodString;
    authScheme: ZodString;
    extraHeaders: ZodRecord<ZodString, ZodString>;
    revision: ZodNumber;
    boundAgentCount: ZodNumber;
    authorizedAgentCount: ZodNumber;
    lastProbedAt: ZodNullable<ZodString>;
    createdAt: ZodString;
    updatedAt: ZodString;
  }, $strict>;
  agents: ZodArray<ZodObject<{
    agentId: ZodString;
    agentName: ZodString;
    agentDisplayName: ZodString;
    enabled: ZodBoolean;
    effective: ZodObject<{
      url: ZodString;
      authHeader: ZodString;
      authScheme: ZodString;
      extraHeaders: ZodRecord<ZodString, ZodString>;
    }, $strict>;
    overridden: ZodObject<{
      url: ZodBoolean;
      authHeader: ZodBoolean;
      authScheme: ZodBoolean;
      extraHeaders: ZodBoolean;
    }, $strict>;
    protocolEra: ZodNullable<ZodEnum<{
      legacy: "legacy";
      modern: "modern";
    }>>;
    protocolVersion: ZodNullable<ZodString>;
    authorization: ZodNullable<ZodObject<{
      kind: ZodEnum<{
        bearer: "bearer";
        none: "none";
        oauth: "oauth";
      }>;
      status: ZodEnum<{
        active: "active";
        error: "error";
        expired: "expired";
        pending: "pending";
        revoked: "revoked";
      }>;
      hasCredential: ZodBoolean;
      scopes: ZodNullable<ZodArray<ZodString>>;
      accessTokenExpiresAt: ZodNullable<ZodString>;
      authorizationServer: ZodNullable<ZodString>;
      probeState: ZodEnum<{
        failed: "failed";
        pending: "pending";
        succeeded: "succeeded";
      }>;
      probedAt: ZodNullable<ZodString>;
      probeError: ZodNullable<ZodString>;
      toolsCount: ZodNullable<ZodNumber>;
      toolsTruncated: ZodBoolean;
      failureCode: ZodNullable<ZodString>;
      revision: ZodNumber;
    }, $strict>>;
  }, $strict>>;
}, $strict>;
type MCPServerDetail = output$1<typeof MCPServerDetailSchema>;
declare const ListAvailableMCPServersResponseSchema: ZodObject<{
  servers: ZodArray<ZodObject<{
    id: ZodString;
    name: ZodString;
    description: ZodNullable<ZodString>;
    boundAgentCount: ZodNumber;
  }, $strict>>;
}, $strict>;
type ListAvailableMCPServersResponse = output$1<typeof ListAvailableMCPServersResponseSchema>;
/**
 * Definition create/update input. `authHeader`, `authScheme`, and `extraHeaders` only matter for a
 * bearer authorization; they are still stored on the definition so two Agents can override them
 * independently.
 *
 * `description` is absent on create on purpose: a definition's description is what a probe
 * discovered, and there is nothing to probe until the definition exists. Creation writes NULL and
 * the first successful probe fills it in; `update` is where an operator replaces it.
 */
declare const CreateMCPServerRequestSchema: ZodObject<{
  name: ZodString;
  url: ZodString;
  defaultAuthKind: ZodDefault<ZodEnum<{
    bearer: "bearer";
    none: "none";
    oauth: "oauth";
  }>>;
  authHeader: ZodOptional<ZodPipe<ZodString, ZodTransform<string, string>>>;
  authScheme: ZodOptional<ZodString>;
  extraHeaders: ZodOptional<ZodRecord<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>>;
}, $strict>;
type CreateMCPServerRequest = output$1<typeof CreateMCPServerRequestSchema>;
declare const UpdateMCPServerRequestSchema: ZodObject<{
  description: ZodOptional<ZodNullable<ZodString>>;
  url: ZodOptional<ZodString>;
  defaultAuthKind: ZodOptional<ZodEnum<{
    bearer: "bearer";
    none: "none";
    oauth: "oauth";
  }>>;
  authHeader: ZodOptional<ZodPipe<ZodString, ZodTransform<string, string>>>;
  authScheme: ZodOptional<ZodString>;
  extraHeaders: ZodOptional<ZodRecord<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>>;
  clearExtraHeaders: ZodOptional<ZodBoolean>;
  expectedRevision: ZodNumber;
}, $strict>;
type UpdateMCPServerRequest = output$1<typeof UpdateMCPServerRequestSchema>;
declare const AttachMCPServerRequestSchema: ZodObject<{
  mcpServerId: ZodString;
  enabled: ZodDefault<ZodBoolean>;
}, $strict>;
type AttachMCPServerRequest = output$1<typeof AttachMCPServerRequestSchema>;
/**
 * The binding update: the single enable/disable layer (target 4) plus this Agent's overrides.
 *
 * Every field follows the same three-state contract: omitted leaves the stored value alone,
 * a value writes an override, and the matching `clearX` flag removes the override so the shared
 * definition applies again. A cleared field is never spelled as an empty value, because an empty
 * `authScheme` is a legitimate override meaning "send the stored secret verbatim".
 *
 * `extraHeaders` has one extra action the other three do not: `emptyExtraHeaders` writes `{}`,
 * meaning this Agent sends no extra headers at all, which is distinct from inheriting the
 * definition's set.
 */
declare const UpdateMCPBindingRequestSchema: ZodObject<{
  enabled: ZodOptional<ZodBoolean>;
  url: ZodOptional<ZodString>;
  clearUrl: ZodOptional<ZodBoolean>;
  authHeader: ZodOptional<ZodPipe<ZodString, ZodTransform<string, string>>>;
  clearAuthHeader: ZodOptional<ZodBoolean>;
  authScheme: ZodOptional<ZodString>;
  clearAuthScheme: ZodOptional<ZodBoolean>;
  extraHeaders: ZodOptional<ZodRecord<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>>;
  clearExtraHeaders: ZodOptional<ZodBoolean>;
  emptyExtraHeaders: ZodOptional<ZodBoolean>;
  expectedRevision: ZodOptional<ZodNumber>;
}, $strict>;
type UpdateMCPBindingRequest = output$1<typeof UpdateMCPBindingRequestSchema>;
/**
 * Writes a bearer credential (or declares `none`) for exactly this Agent, upserting the one row for
 * this (Server, Agent) pair. Changing kind replaces the credential in the same row.
 */
declare const SetMCPAuthorizationRequestSchema: ZodObject<{
  kind: ZodEnum<{
    bearer: "bearer";
    none: "none";
  }>;
  bearerKey: ZodOptional<ZodString>;
}, $strict>;
type SetMCPAuthorizationRequest = output$1<typeof SetMCPAuthorizationRequestSchema>;
declare const StartMCPOAuthRequestSchema: ZodObject<{
  scopes: ZodOptional<ZodArray<ZodString>>;
}, $strict>;
type StartMCPOAuthRequest = output$1<typeof StartMCPOAuthRequestSchema>;
declare const StartMCPOAuthResponseSchema: ZodObject<{
  authorizationUrl: ZodString;
  expiresAt: ZodString;
}, $strict>;
type StartMCPOAuthResponse = output$1<typeof StartMCPOAuthResponseSchema>;
declare const MCPProbeResponseSchema: ZodObject<{
  probeState: ZodEnum<{
    failed: "failed";
    pending: "pending";
    succeeded: "succeeded";
  }>;
  probeError: ZodNullable<ZodString>;
  toolsCount: ZodNullable<ZodNumber>;
  toolsTruncated: ZodBoolean;
  protocolEra: ZodNullable<ZodEnum<{
    legacy: "legacy";
    modern: "modern";
  }>>;
  protocolVersion: ZodNullable<ZodString>;
}, $strict>;
type MCPProbeResponse = output$1<typeof MCPProbeResponseSchema>;
declare const AgentRuntimeOptionsSchema: ZodObject<{
  modelSuggestions: ZodArray<ZodString>;
  reasoningEffortAllowedValues: ZodNullable<ZodArray<ZodString>>;
}, $strict>;
type AgentRuntimeOptions = output$1<typeof AgentRuntimeOptionsSchema>;
declare const RuntimeDurableWorkKindSchema: ZodEnum<{
  "session-message": "session-message";
  "turn-report": "turn-report";
}>;
declare const RuntimeDurableWorkRecordSchema: ZodObject<{
  attempts: ZodNumber;
  acceptedAt: ZodNumber;
  key: ZodString;
  kind: ZodEnum<{
    "session-message": "session-message";
    "turn-report": "turn-report";
  }>;
  lastError: ZodOptional<ZodObject<{
    category: ZodString;
    code: ZodString;
    message: ZodString;
    phase: ZodString;
    requestId: ZodString;
    retryability: ZodEnum<{
      retryable: "retryable";
      terminal: "terminal";
    }>;
  }, $strict>>;
  nextAttemptAt: ZodOptional<ZodNumber>;
  payload: ZodUnknown;
  status: ZodEnum<{
    accepted: "accepted";
    "dead-letter": "dead-letter";
    failed: "failed";
    retryable: "retryable";
    running: "running";
    succeeded: "succeeded";
  }>;
  updatedAt: ZodNumber;
}, $strict>;
declare const RuntimeUsageSchema: ZodObject<{
  inputTokens: ZodOptional<ZodNumber>;
  cachedInputTokens: ZodOptional<ZodNumber>;
  outputTokens: ZodOptional<ZodNumber>;
}, $strict>;
declare const EffectiveRuntimeSnapshotSchema: ZodObject<{
  contextTrees: ZodArray<ZodObject<{
    kind: ZodLiteral<"git">;
    repository: ZodString;
    path: ZodString;
    ref: ZodString;
  }, $strict>>;
  revision: ZodObject<{
    agent: ZodObject<{
      sequence: ZodNumber;
      id: ZodString;
    }, $strict>;
    session: ZodObject<{
      sequence: ZodNumber;
      id: ZodString;
    }, $strict>;
  }, $strict>;
  agentId: ZodString;
  selfConfigurationEnabled: ZodOptional<ZodBoolean>;
  provider: ZodEnum<{
    "claude-code": "claude-code";
    codex: "codex";
    pi: "pi";
  }>;
  model: ZodOptional<ZodString>;
  reasoningEffort: ZodOptional<ZodString>;
  instructions: ZodObject<{
    platform: ZodString;
    agent: ZodString;
    session: ZodOptional<ZodString>;
  }, $strict>;
  execution: ZodObject<{
    approvalPolicy: ZodEnum<{
      never: "never";
      "on-request": "on-request";
    }>;
    networkAccess: ZodBoolean;
    allowCommands: ZodOptional<ZodArray<ZodString>>;
  }, $strict>;
  workspace: ZodObject<{
    workspaceId: ZodString;
    mode: ZodLiteral<"empty_on_create">;
    sharing: ZodLiteral<"agent">;
  }, $strict>;
  budget: ZodOptional<ZodObject<{
    maxDurationMs: ZodOptional<ZodNumber>;
  }, $strict>>;
}, $strict>;
declare const InputRejectReasonSchema: ZodEnum<{
  agent_busy: "agent_busy";
  agent_configuration_busy: "agent_configuration_busy";
  client_busy: "client_busy";
  configuration_unsupported: "configuration_unsupported";
  input_conflict: "input_conflict";
  invalid_input: "invalid_input";
  provider_unavailable: "provider_unavailable";
  session_binding_conflict: "session_binding_conflict";
  session_busy: "session_busy";
  session_not_ready: "session_not_ready";
  session_recovery_required: "session_recovery_required";
  stale_configuration: "stale_configuration";
  stale_generation: "stale_generation";
  target_mismatch: "target_mismatch";
  turn_expired: "turn_expired";
}>;
declare const ProviderFailureReasonSchema: ZodEnum<{
  provider_access_denied: "provider_access_denied";
  provider_authentication_failed: "provider_authentication_failed";
  provider_connection_failed: "provider_connection_failed";
  provider_context_limit: "provider_context_limit";
  provider_execution_limit: "provider_execution_limit";
  provider_process_exited: "provider_process_exited";
  provider_quota_exceeded: "provider_quota_exceeded";
  provider_rate_limited: "provider_rate_limited";
  provider_request_rejected: "provider_request_rejected";
  provider_unavailable: "provider_unavailable";
}>;
type ProviderFailureReason = output$1<typeof ProviderFailureReasonSchema>;
declare const TurnFailureReasonSchema: ZodEnum<{
  client_shutdown: "client_shutdown";
  configuration_conflict: "configuration_conflict";
  credential_unavailable: "credential_unavailable";
  output_too_large: "output_too_large";
  provider_access_denied: "provider_access_denied";
  provider_authentication_failed: "provider_authentication_failed";
  provider_connection_failed: "provider_connection_failed";
  provider_context_limit: "provider_context_limit";
  provider_empty_result: "provider_empty_result";
  provider_execution_limit: "provider_execution_limit";
  provider_failed: "provider_failed";
  provider_process_exited: "provider_process_exited";
  provider_protocol_error: "provider_protocol_error";
  provider_quota_exceeded: "provider_quota_exceeded";
  provider_rate_limited: "provider_rate_limited";
  provider_request_rejected: "provider_request_rejected";
  provider_start_failed: "provider_start_failed";
  provider_teardown_failed: "provider_teardown_failed";
  provider_unavailable: "provider_unavailable";
  sandbox_unavailable: "sandbox_unavailable";
  session_resume_failed: "session_resume_failed";
  turn_state_unknown: "turn_state_unknown";
  turn_timeout: "turn_timeout";
  workspace_failed: "workspace_failed";
}>;
declare const SessionReconcileRequestSchema: ZodObject<{
  type: ZodLiteral<"session:reconcile">;
  requestId: ZodString;
  installationId: ZodString;
  sessionId: ZodString;
  agentId: ZodString;
  placementGeneration: ZodNumber;
  sessionKind: ZodOptional<ZodLiteral<"internal">>;
  creatorSessionId: ZodOptional<ZodString>;
  sessionCliProof: ZodOptional<ZodObject<{
    proofId: ZodString;
    token: ZodString;
  }, $strict>>;
  desired: ZodEnum<{
    ready: "ready";
    stopped: "stopped";
  }>;
  runtime: ZodOptional<ZodObject<{
    contextTrees: ZodArray<ZodObject<{
      kind: ZodLiteral<"git">;
      repository: ZodString;
      path: ZodString;
      ref: ZodString;
    }, $strict>>;
    revision: ZodObject<{
      agent: ZodObject<{
        sequence: ZodNumber;
        id: ZodString;
      }, $strict>;
      session: ZodObject<{
        sequence: ZodNumber;
        id: ZodString;
      }, $strict>;
    }, $strict>;
    agentId: ZodString;
    selfConfigurationEnabled: ZodOptional<ZodBoolean>;
    provider: ZodEnum<{
      "claude-code": "claude-code";
      codex: "codex";
      pi: "pi";
    }>;
    model: ZodOptional<ZodString>;
    reasoningEffort: ZodOptional<ZodString>;
    instructions: ZodObject<{
      platform: ZodString;
      agent: ZodString;
      session: ZodOptional<ZodString>;
    }, $strict>;
    execution: ZodObject<{
      approvalPolicy: ZodEnum<{
        never: "never";
        "on-request": "on-request";
      }>;
      networkAccess: ZodBoolean;
      allowCommands: ZodOptional<ZodArray<ZodString>>;
    }, $strict>;
    workspace: ZodObject<{
      workspaceId: ZodString;
      mode: ZodLiteral<"empty_on_create">;
      sharing: ZodLiteral<"agent">;
    }, $strict>;
    budget: ZodOptional<ZodObject<{
      maxDurationMs: ZodOptional<ZodNumber>;
    }, $strict>>;
  }, $strict>>;
}, $strict>;
declare const SessionReconcileResultSchema: ZodObject<{
  type: ZodLiteral<"session:reconcile:result">;
  requestId: ZodString;
  sessionId: ZodString;
  placementGeneration: ZodNumber;
  status: ZodEnum<{
    busy: "busy";
    ready: "ready";
    recovery_required: "recovery_required";
    rejected: "rejected";
    reporting: "reporting";
    running: "running";
    stopped: "stopped";
  }>;
  reason: ZodOptional<ZodString>;
  turn: ZodOptional<ZodObject<{
    turnId: ZodString;
    deliveryId: ZodString;
  }, $strict>>;
  retainedReports: ZodOptional<ZodArray<ZodObject<{
    dispatchRequestId: ZodString;
    deliveryId: ZodString;
    inputHash: ZodString;
    turnId: ZodString;
    placementGeneration: ZodNumber;
    resultHash: ZodString;
  }, $strict>>>;
}, $strict>;
declare const DirectImMessageDeliveryRequestSchema: ZodObject<{
  type: ZodLiteral<"im:deliver">;
  requestId: ZodString;
  deliveryId: ZodString;
  imMessageId: ZodString;
  sessionId: ZodString;
  agentId: ZodString;
  placementGeneration: ZodNumber;
  attention: ZodEnum<{
    ambient: "ambient";
    direct: "direct";
  }>;
  replyRole: ZodOptional<ZodLiteral<"observer">>;
  content: ZodObject<{
    kind: ZodLiteral<"text">;
    text: ZodString;
    providerRef: ZodDiscriminatedUnion<[ZodObject<{
      provider: ZodLiteral<"feishu">;
      teamBrand: ZodEnum<{
        feishu: "feishu";
        lark: "lark";
      }>;
      appId: ZodString;
      botOpenId: ZodString;
      chatId: ZodString;
      chatType: ZodOptional<ZodString>;
      messageId: ZodString;
      threadId: ZodOptional<ZodString>;
      rootId: ZodOptional<ZodString>;
      parentId: ZodOptional<ZodString>;
    }, $strict>, ZodObject<{
      provider: ZodLiteral<"slack">;
      appId: ZodString;
      teamId: ZodString;
      enterpriseId: ZodOptional<ZodString>;
      botUserId: ZodString;
      channelId: ZodString;
      channelType: ZodOptional<ZodString>;
      messageTs: ZodString;
      threadTs: ZodOptional<ZodString>;
      authorUserId: ZodOptional<ZodString>;
    }, $strict>], "provider">;
    history: ZodOptional<ZodArray<ZodObject<{
      imMessageId: ZodString;
      occurredAt: ZodString;
      text: ZodString;
      providerRef: ZodDiscriminatedUnion<[ZodObject<{
        provider: ZodLiteral<"feishu">;
        teamBrand: ZodEnum<{
          feishu: "feishu";
          lark: "lark";
        }>;
        appId: ZodString;
        botOpenId: ZodString;
        chatId: ZodString;
        chatType: ZodOptional<ZodString>;
        messageId: ZodString;
        threadId: ZodOptional<ZodString>;
        rootId: ZodOptional<ZodString>;
        parentId: ZodOptional<ZodString>;
      }, $strict>, ZodObject<{
        provider: ZodLiteral<"slack">;
        appId: ZodString;
        teamId: ZodString;
        enterpriseId: ZodOptional<ZodString>;
        botUserId: ZodString;
        channelId: ZodString;
        channelType: ZodOptional<ZodString>;
        messageTs: ZodString;
        threadTs: ZodOptional<ZodString>;
        authorUserId: ZodOptional<ZodString>;
      }, $strict>], "provider">;
    }, $strict>>>;
    historyTruncated: ZodOptional<ZodBoolean>;
    resources: ZodOptional<ZodArray<ZodObject<{
      imMessageId: ZodString;
      ordinal: ZodNumber;
      kind: ZodEnum<{
        audio: "audio";
        file: "file";
        image: "image";
        video: "video";
      }>;
      filename: ZodOptional<ZodString>;
      mediaType: ZodOptional<ZodString>;
      sizeBytes: ZodOptional<ZodNumber>;
      availability: ZodEnum<{
        available: "available";
        too_large: "too_large";
        unavailable: "unavailable";
        unsupported: "unsupported";
      }>;
    }, $strict>>>;
  }, $strict>;
  batch: ZodOptional<ZodArray<ZodObject<{
    deliveryId: ZodString;
    imMessageId: ZodString;
    inputHash: ZodString;
  }, $strict>>>;
  runtime: ZodObject<{
    contextTrees: ZodArray<ZodObject<{
      kind: ZodLiteral<"git">;
      repository: ZodString;
      path: ZodString;
      ref: ZodString;
    }, $strict>>;
    revision: ZodObject<{
      agent: ZodObject<{
        sequence: ZodNumber;
        id: ZodString;
      }, $strict>;
      session: ZodObject<{
        sequence: ZodNumber;
        id: ZodString;
      }, $strict>;
    }, $strict>;
    agentId: ZodString;
    selfConfigurationEnabled: ZodOptional<ZodBoolean>;
    provider: ZodEnum<{
      "claude-code": "claude-code";
      codex: "codex";
      pi: "pi";
    }>;
    model: ZodOptional<ZodString>;
    reasoningEffort: ZodOptional<ZodString>;
    instructions: ZodObject<{
      platform: ZodString;
      agent: ZodString;
      session: ZodOptional<ZodString>;
    }, $strict>;
    execution: ZodObject<{
      approvalPolicy: ZodEnum<{
        never: "never";
        "on-request": "on-request";
      }>;
      networkAccess: ZodBoolean;
      allowCommands: ZodOptional<ZodArray<ZodString>>;
    }, $strict>;
    workspace: ZodObject<{
      workspaceId: ZodString;
      mode: ZodLiteral<"empty_on_create">;
      sharing: ZodLiteral<"agent">;
    }, $strict>;
    budget: ZodOptional<ZodObject<{
      maxDurationMs: ZodOptional<ZodNumber>;
    }, $strict>>;
  }, $strict>;
  deadlineAt: ZodOptional<ZodString>;
}, $strict>;
declare const RuntimeImSteerRequestSchema: ZodObject<{
  type: ZodLiteral<"im:steer">;
  requestId: ZodString;
  deliveryId: ZodString;
  imMessageId: ZodString;
  sessionId: ZodString;
  agentId: ZodString;
  placementGeneration: ZodNumber;
  rootDeliveryId: ZodString;
  expectedTurnId: ZodString;
  attention: ZodEnum<{
    ambient: "ambient";
    direct: "direct";
  }>;
  replyRole: ZodOptional<ZodLiteral<"observer">>;
  content: ZodObject<{
    kind: ZodLiteral<"text">;
    text: ZodString;
    providerRef: ZodDiscriminatedUnion<[ZodObject<{
      provider: ZodLiteral<"feishu">;
      teamBrand: ZodEnum<{
        feishu: "feishu";
        lark: "lark";
      }>;
      appId: ZodString;
      botOpenId: ZodString;
      chatId: ZodString;
      chatType: ZodOptional<ZodString>;
      messageId: ZodString;
      threadId: ZodOptional<ZodString>;
      rootId: ZodOptional<ZodString>;
      parentId: ZodOptional<ZodString>;
    }, $strict>, ZodObject<{
      provider: ZodLiteral<"slack">;
      appId: ZodString;
      teamId: ZodString;
      enterpriseId: ZodOptional<ZodString>;
      botUserId: ZodString;
      channelId: ZodString;
      channelType: ZodOptional<ZodString>;
      messageTs: ZodString;
      threadTs: ZodOptional<ZodString>;
      authorUserId: ZodOptional<ZodString>;
    }, $strict>], "provider">;
    history: ZodOptional<ZodArray<ZodObject<{
      imMessageId: ZodString;
      occurredAt: ZodString;
      text: ZodString;
      providerRef: ZodDiscriminatedUnion<[ZodObject<{
        provider: ZodLiteral<"feishu">;
        teamBrand: ZodEnum<{
          feishu: "feishu";
          lark: "lark";
        }>;
        appId: ZodString;
        botOpenId: ZodString;
        chatId: ZodString;
        chatType: ZodOptional<ZodString>;
        messageId: ZodString;
        threadId: ZodOptional<ZodString>;
        rootId: ZodOptional<ZodString>;
        parentId: ZodOptional<ZodString>;
      }, $strict>, ZodObject<{
        provider: ZodLiteral<"slack">;
        appId: ZodString;
        teamId: ZodString;
        enterpriseId: ZodOptional<ZodString>;
        botUserId: ZodString;
        channelId: ZodString;
        channelType: ZodOptional<ZodString>;
        messageTs: ZodString;
        threadTs: ZodOptional<ZodString>;
        authorUserId: ZodOptional<ZodString>;
      }, $strict>], "provider">;
    }, $strict>>>;
    historyTruncated: ZodOptional<ZodBoolean>;
    resources: ZodOptional<ZodArray<ZodObject<{
      imMessageId: ZodString;
      ordinal: ZodNumber;
      kind: ZodEnum<{
        audio: "audio";
        file: "file";
        image: "image";
        video: "video";
      }>;
      filename: ZodOptional<ZodString>;
      mediaType: ZodOptional<ZodString>;
      sizeBytes: ZodOptional<ZodNumber>;
      availability: ZodEnum<{
        available: "available";
        too_large: "too_large";
        unavailable: "unavailable";
        unsupported: "unsupported";
      }>;
    }, $strict>>>;
  }, $strict>;
  batch: ZodOptional<ZodArray<ZodObject<{
    deliveryId: ZodString;
    imMessageId: ZodString;
    inputHash: ZodString;
  }, $strict>>>;
  deadlineAt: ZodOptional<ZodString>;
}, $strict>;
declare const RuntimeImOutboxContextSchema: ZodDiscriminatedUnion<[ZodObject<{
  provider: ZodLiteral<"feishu">;
  sessionKind: ZodEnum<{
    channel: "channel";
    thread: "thread";
  }>;
  chatId: ZodString;
  threadId: ZodOptional<ZodString>;
}, $strict>, ZodObject<{
  provider: ZodLiteral<"slack">;
  sessionKind: ZodEnum<{
    channel: "channel";
    thread: "thread";
  }>;
  channelId: ZodString;
  threadTs: ZodOptional<ZodString>;
}, $strict>], "provider">;
declare const RuntimeImCredentialGrantResultSchema: ZodDiscriminatedUnion<[ZodObject<{
  type: ZodLiteral<"im:credential:result">;
  requestId: ZodString;
  status: ZodLiteral<"succeeded">;
  credentialGeneration: ZodNumber;
  grant: ZodDiscriminatedUnion<[ZodObject<{
    provider: ZodLiteral<"feishu">;
    appId: ZodString;
    appSecret: ZodString;
    teamBrand: ZodEnum<{
      feishu: "feishu";
      lark: "lark";
    }>;
  }, $strict>, ZodObject<{
    provider: ZodLiteral<"slack">;
    botAccessToken: ZodString;
  }, $strict>], "provider">;
  outboxContext: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
    provider: ZodLiteral<"feishu">;
    sessionKind: ZodEnum<{
      channel: "channel";
      thread: "thread";
    }>;
    chatId: ZodString;
    threadId: ZodOptional<ZodString>;
  }, $strict>, ZodObject<{
    provider: ZodLiteral<"slack">;
    sessionKind: ZodEnum<{
      channel: "channel";
      thread: "thread";
    }>;
    channelId: ZodString;
    threadTs: ZodOptional<ZodString>;
  }, $strict>], "provider">>;
}, $strict>, ZodObject<{
  type: ZodLiteral<"im:credential:result">;
  requestId: ZodString;
  status: ZodLiteral<"rejected">;
  code: ZodEnum<{
    agent_mismatch: "agent_mismatch";
    binding_inactive: "binding_inactive";
    credential_stale: "credential_stale";
    placement_stale: "placement_stale";
    provider_cli_unready: "provider_cli_unready";
  }>;
}, $strict>], "status">;
declare const ImMessageDeliveryResultSchema: ZodDiscriminatedUnion<[ZodObject<{
  type: ZodLiteral<"im:deliver:result">;
  requestId: ZodString;
  deliveryId: ZodString;
  sessionId: ZodString;
  placementGeneration: ZodNumber;
  status: ZodLiteral<"accepted">;
  turnId: ZodString;
}, $strict>, ZodObject<{
  type: ZodLiteral<"im:deliver:result">;
  requestId: ZodString;
  deliveryId: ZodString;
  sessionId: ZodString;
  placementGeneration: ZodNumber;
  status: ZodLiteral<"absorbed">;
  rootDeliveryId: ZodString;
  turnId: ZodString;
}, $strict>, ZodObject<{
  type: ZodLiteral<"im:deliver:result">;
  requestId: ZodString;
  deliveryId: ZodString;
  sessionId: ZodString;
  placementGeneration: ZodNumber;
  status: ZodLiteral<"rejected">;
  reason: ZodEnum<{
    agent_busy: "agent_busy";
    agent_configuration_busy: "agent_configuration_busy";
    client_busy: "client_busy";
    configuration_unsupported: "configuration_unsupported";
    input_conflict: "input_conflict";
    invalid_input: "invalid_input";
    provider_unavailable: "provider_unavailable";
    session_binding_conflict: "session_binding_conflict";
    session_busy: "session_busy";
    session_not_ready: "session_not_ready";
    session_recovery_required: "session_recovery_required";
    stale_configuration: "stale_configuration";
    stale_generation: "stale_generation";
    target_mismatch: "target_mismatch";
    turn_expired: "turn_expired";
  }>;
}, $strict>], "status">;
declare const RuntimeImSteerResultSchema: ZodDiscriminatedUnion<[ZodObject<{
  type: ZodLiteral<"im:steer:result">;
  requestId: ZodString;
  deliveryId: ZodString;
  sessionId: ZodString;
  placementGeneration: ZodNumber;
  rootDeliveryId: ZodString;
  expectedTurnId: ZodString;
  status: ZodLiteral<"steered">;
}, $strict>, ZodObject<{
  type: ZodLiteral<"im:steer:result">;
  requestId: ZodString;
  deliveryId: ZodString;
  sessionId: ZodString;
  placementGeneration: ZodNumber;
  rootDeliveryId: ZodString;
  expectedTurnId: ZodString;
  status: ZodLiteral<"retry">;
  reason: ZodLiteral<"turn_starting">;
}, $strict>, ZodObject<{
  type: ZodLiteral<"im:steer:result">;
  requestId: ZodString;
  deliveryId: ZodString;
  sessionId: ZodString;
  placementGeneration: ZodNumber;
  rootDeliveryId: ZodString;
  expectedTurnId: ZodString;
  status: ZodLiteral<"deferred">;
  reason: ZodEnum<{
    steer_state_unknown: "steer_state_unknown";
    steer_unsupported: "steer_unsupported";
    turn_not_running: "turn_not_running";
  }>;
}, $strict>, ZodObject<{
  type: ZodLiteral<"im:steer:result">;
  requestId: ZodString;
  deliveryId: ZodString;
  sessionId: ZodString;
  placementGeneration: ZodNumber;
  rootDeliveryId: ZodString;
  expectedTurnId: ZodString;
  status: ZodLiteral<"rejected">;
  reason: ZodEnum<{
    input_conflict: "input_conflict";
    invalid_input: "invalid_input";
    stale_generation: "stale_generation";
    target_mismatch: "target_mismatch";
  }>;
}, $strict>], "status">;
declare const SessionMessageDeliveryResultSchema: ZodObject<{
  type: ZodLiteral<"session:message:deliver:result">;
  requestId: ZodString;
  messageId: ZodString;
  targetSessionId: ZodString;
  placementGeneration: ZodNumber;
  status: ZodEnum<{
    accepted: "accepted";
    rejected: "rejected";
  }>;
  reason: ZodOptional<ZodEnum<{
    agent_busy: "agent_busy";
    agent_configuration_busy: "agent_configuration_busy";
    client_busy: "client_busy";
    configuration_unsupported: "configuration_unsupported";
    input_conflict: "input_conflict";
    invalid_input: "invalid_input";
    provider_unavailable: "provider_unavailable";
    session_binding_conflict: "session_binding_conflict";
    session_busy: "session_busy";
    session_not_ready: "session_not_ready";
    session_recovery_required: "session_recovery_required";
    stale_configuration: "stale_configuration";
    stale_generation: "stale_generation";
    target_mismatch: "target_mismatch";
    turn_expired: "turn_expired";
  }>>;
}, $strict>;
declare const SessionMessageDeliveryRequestV3Schema: ZodObject<{
  type: ZodLiteral<"session:message:deliver">;
  requestId: ZodString;
  messageId: ZodString;
  sourceSessionId: ZodOptional<ZodString>;
  scheduledOrigin: ZodOptional<ZodObject<{
    scheduleId: ZodString;
    scheduledFor: ZodString;
    timezone: ZodString;
    name: ZodString;
  }, $strict>>;
  sentAt: ZodOptional<ZodString>;
  scheduleDetailUrl: ZodOptional<ZodString>;
  targetSessionId: ZodString;
  agentId: ZodString;
  placementGeneration: ZodNumber;
  content: ZodObject<{
    kind: ZodLiteral<"text">;
    text: ZodString;
  }, $strict>;
  runtime: ZodObject<{
    contextTrees: ZodArray<ZodObject<{
      kind: ZodLiteral<"git">;
      repository: ZodString;
      path: ZodString;
      ref: ZodString;
    }, $strict>>;
    revision: ZodObject<{
      agent: ZodObject<{
        sequence: ZodNumber;
        id: ZodString;
      }, $strict>;
      session: ZodObject<{
        sequence: ZodNumber;
        id: ZodString;
      }, $strict>;
    }, $strict>;
    agentId: ZodString;
    selfConfigurationEnabled: ZodOptional<ZodBoolean>;
    provider: ZodEnum<{
      "claude-code": "claude-code";
      codex: "codex";
      pi: "pi";
    }>;
    model: ZodOptional<ZodString>;
    reasoningEffort: ZodOptional<ZodString>;
    instructions: ZodObject<{
      platform: ZodString;
      agent: ZodString;
      session: ZodOptional<ZodString>;
    }, $strict>;
    execution: ZodObject<{
      approvalPolicy: ZodEnum<{
        never: "never";
        "on-request": "on-request";
      }>;
      networkAccess: ZodBoolean;
      allowCommands: ZodOptional<ZodArray<ZodString>>;
    }, $strict>;
    workspace: ZodObject<{
      workspaceId: ZodString;
      mode: ZodLiteral<"empty_on_create">;
      sharing: ZodLiteral<"agent">;
    }, $strict>;
    budget: ZodOptional<ZodObject<{
      maxDurationMs: ZodOptional<ZodNumber>;
    }, $strict>>;
  }, $strict>;
}, $strict>;
declare const TurnReportRequestSchema: ZodObject<{
  type: ZodLiteral<"turn:report">;
  requestId: ZodString;
  deliveryId: ZodString;
  turnId: ZodString;
  sessionId: ZodString;
  agentId: ZodString;
  placementGeneration: ZodNumber;
  outcome: ZodEnum<{
    cancelled: "cancelled";
    completed: "completed";
    failed: "failed";
    unknown: "unknown";
  }>;
  executionEffects: ZodEnum<{
    completed: "completed";
    may_have_occurred: "may_have_occurred";
    not_started: "not_started";
  }>;
  finalText: ZodOptional<ZodString>;
  errorReason: ZodOptional<ZodEnum<{
    client_shutdown: "client_shutdown";
    configuration_conflict: "configuration_conflict";
    credential_unavailable: "credential_unavailable";
    output_too_large: "output_too_large";
    provider_access_denied: "provider_access_denied";
    provider_authentication_failed: "provider_authentication_failed";
    provider_connection_failed: "provider_connection_failed";
    provider_context_limit: "provider_context_limit";
    provider_empty_result: "provider_empty_result";
    provider_execution_limit: "provider_execution_limit";
    provider_failed: "provider_failed";
    provider_process_exited: "provider_process_exited";
    provider_protocol_error: "provider_protocol_error";
    provider_quota_exceeded: "provider_quota_exceeded";
    provider_rate_limited: "provider_rate_limited";
    provider_request_rejected: "provider_request_rejected";
    provider_start_failed: "provider_start_failed";
    provider_teardown_failed: "provider_teardown_failed";
    provider_unavailable: "provider_unavailable";
    sandbox_unavailable: "sandbox_unavailable";
    session_resume_failed: "session_resume_failed";
    turn_state_unknown: "turn_state_unknown";
    turn_timeout: "turn_timeout";
    workspace_failed: "workspace_failed";
  }>>;
  usage: ZodOptional<ZodObject<{
    inputTokens: ZodOptional<ZodNumber>;
    cachedInputTokens: ZodOptional<ZodNumber>;
    outputTokens: ZodOptional<ZodNumber>;
  }, $strict>>;
  traceSummary: ZodObject<{
    lastSequence: ZodNumber;
    droppedEvents: ZodNumber;
  }, $strict>;
  outgoingReplies: ZodOptional<ZodObject<{
    status: ZodEnum<{
      complete: "complete";
      incomplete: "incomplete";
      unavailable: "unavailable";
    }>;
    replies: ZodArray<ZodObject<{
      provider: ZodLiteral<"feishu">;
      teamBrand: ZodEnum<{
        feishu: "feishu";
        lark: "lark";
      }>;
      messageId: ZodString;
      chatId: ZodString;
      threadId: ZodOptional<ZodString>;
      rootId: ZodOptional<ZodString>;
      parentId: ZodOptional<ZodString>;
      createTime: ZodOptional<ZodString>;
      content: ZodObject<{
        msgType: ZodEnum<{
          audio: "audio";
          file: "file";
          image: "image";
          interactive: "interactive";
          media: "media";
          post: "post";
          share_chat: "share_chat";
          share_user: "share_user";
          sticker: "sticker";
          text: "text";
          unknown: "unknown";
          video: "video";
        }>;
        text: ZodOptional<ZodString>;
        post: ZodOptional<ZodUnknown>;
        filename: ZodOptional<ZodString>;
        fileKey: ZodOptional<ZodString>;
        imageKey: ZodOptional<ZodString>;
        raw: ZodOptional<ZodString>;
        unavailable: ZodOptional<ZodEnum<{
          content_read_failed: "content_read_failed";
          content_truncated: "content_truncated";
          omitted: "omitted";
          out_of_scope: "out_of_scope";
        }>>;
      }, $strict>;
    }, $strict>>;
    omittedCount: ZodOptional<ZodNumber>;
    runtimeSummaryTruncated: ZodOptional<ZodBoolean>;
  }, $strict>>;
  resultHash: ZodString;
}, $strict>;
declare const TurnReportResultSchema: ZodObject<{
  type: ZodLiteral<"turn:report:result">;
  requestId: ZodString;
  turnId: ZodString;
  status: ZodEnum<{
    already_recorded: "already_recorded";
    conflict: "conflict";
    recorded: "recorded";
    stale_generation: "stale_generation";
    unsupported_capability: "unsupported_capability";
  }>;
  resultHash: ZodString;
}, $strict>;
declare const AgentRuntimeOptionsRequestFrameSchema: ZodObject<{
  type: ZodLiteral<"agent-runtime:options">;
  requestId: ZodString;
  agentId: ZodString;
  computerId: ZodString;
  provider: ZodEnum<{
    "claude-code": "claude-code";
    codex: "codex";
    pi: "pi";
  }>;
  model: ZodOptional<ZodString>;
}, $strict>;
declare const AgentRuntimeTestRequestFrameSchema: ZodObject<{
  type: ZodLiteral<"agent-runtime:test">;
  requestId: ZodString;
  computerId: ZodString;
  provider: ZodEnum<{
    "claude-code": "claude-code";
    codex: "codex";
    pi: "pi";
  }>;
  model: ZodOptional<ZodString>;
  reasoningEffort: ZodOptional<ZodString>;
}, $strict>;
declare const AgentRuntimeTestResultFrameSchema: ZodObject<{
  type: ZodLiteral<"agent-runtime:test:result">;
  requestId: ZodString;
  status: ZodEnum<{
    failed: "failed";
    passed: "passed";
  }>;
  code: ZodOptional<ZodEnum<{
    busy: "busy";
    cancelled: "cancelled";
    capability_missing: "capability_missing";
    computer_unavailable: "computer_unavailable";
    interaction_or_tool: "interaction_or_tool";
    provider_failed: "provider_failed";
    provider_start_failed: "provider_start_failed";
    stale_configuration: "stale_configuration";
    timeout: "timeout";
  }>>;
}, $strict>;
declare const ProviderCliExpectedIdentitySchema: ZodDiscriminatedUnion<[ZodObject<{
  provider: ZodLiteral<"feishu">;
  appId: ZodString;
  botOpenId: ZodString;
  teamBrand: ZodEnum<{
    feishu: "feishu";
    lark: "lark";
  }>;
}, $strict>, ZodObject<{
  provider: ZodLiteral<"slack">;
  teamId: ZodString;
  botUserId: ZodString;
  botId: ZodString;
}, $strict>], "provider">;
declare const ProviderCliPrewarmFrameSchema: ZodObject<{
  type: ZodLiteral<"provider-cli:prewarm">;
  requestId: ZodString;
  mode: ZodOptional<ZodEnum<{
    ensure: "ensure";
    inspect: "inspect";
  }>>;
  runtimeProvider: ZodOptional<ZodEnum<{
    "claude-code": "claude-code";
    codex: "codex";
    pi: "pi";
  }>>;
  providers: ZodArray<ZodEnum<{
    feishu: "feishu";
    slack: "slack";
  }>>;
}, $strict>;
declare const ProviderCliValidationGrantFrameSchema: ZodObject<{
  requestId: ZodString;
  provider: ZodEnum<{
    feishu: "feishu";
    slack: "slack";
  }>;
  agentId: ZodString;
  integrationId: ZodString;
  credentialGeneration: ZodNumber;
  type: ZodLiteral<"provider-cli:validation:grant">;
  requirementRequestId: ZodString;
  expiresAt: ZodString;
  expectedIdentity: ZodDiscriminatedUnion<[ZodObject<{
    provider: ZodLiteral<"feishu">;
    appId: ZodString;
    botOpenId: ZodString;
    teamBrand: ZodEnum<{
      feishu: "feishu";
      lark: "lark";
    }>;
  }, $strict>, ZodObject<{
    provider: ZodLiteral<"slack">;
    teamId: ZodString;
    botUserId: ZodString;
    botId: ZodString;
  }, $strict>], "provider">;
  grant: ZodDiscriminatedUnion<[ZodObject<{
    provider: ZodLiteral<"feishu">;
    appId: ZodString;
    appSecret: ZodString;
    teamBrand: ZodEnum<{
      feishu: "feishu";
      lark: "lark";
    }>;
  }, $strict>, ZodObject<{
    provider: ZodLiteral<"slack">;
    botAccessToken: ZodString;
  }, $strict>], "provider">;
}, $strict>;
declare const ProviderCliValidationResultFrameSchema: ZodObject<{
  requestId: ZodString;
  provider: ZodEnum<{
    feishu: "feishu";
    slack: "slack";
  }>;
  agentId: ZodString;
  integrationId: ZodString;
  credentialGeneration: ZodNumber;
  type: ZodLiteral<"provider-cli:validation:result">;
  status: ZodEnum<{
    needs_attention: "needs_attention";
    ready: "ready";
    retrying: "retrying";
  }>;
  reason: ZodOptional<ZodEnum<{
    artifact_changed: "artifact_changed";
    credential_rejected: "credential_rejected";
    identity_mismatch: "identity_mismatch";
    provider_unreachable: "provider_unreachable";
    rate_limited: "rate_limited";
    scope_missing: "scope_missing";
    upgrade_required: "upgrade_required";
    validation_busy: "validation_busy";
    validation_expired: "validation_expired";
  }>>;
}, $strict>;
declare const RuntimeApprovalDecisionSchema: ZodObject<{
  requestId: ZodString;
  turnId: ZodString;
  sessionId: ZodString;
  deliveryId: ZodString;
  placementGeneration: ZodNumber;
  type: ZodLiteral<"approval:decision">;
  decision: ZodEnum<{
    accept: "accept";
    decline: "decline";
  }>;
}, $strict>;
declare const RuntimeApprovalResultSchema: ZodObject<{
  requestId: ZodString;
  turnId: ZodString;
  sessionId: ZodString;
  deliveryId: ZodString;
  placementGeneration: ZodNumber;
  type: ZodLiteral<"approval:result">;
  status: ZodEnum<{
    applied: "applied";
    stale: "stale";
  }>;
}, $strict>;
type RuntimeApprovalDecision = output$1<typeof RuntimeApprovalDecisionSchema>;
type RuntimeApprovalResult = output$1<typeof RuntimeApprovalResultSchema>;
type RuntimeUsage = output$1<typeof RuntimeUsageSchema>;
type RuntimeDurableWorkKind = output$1<typeof RuntimeDurableWorkKindSchema>;
type RuntimeDurableWorkRecord = output$1<typeof RuntimeDurableWorkRecordSchema>;
type EffectiveRuntimeSnapshot = output$1<typeof EffectiveRuntimeSnapshotSchema>;
type InputRejectReason = output$1<typeof InputRejectReasonSchema>;
type TurnFailureReason = output$1<typeof TurnFailureReasonSchema>;
type SessionReconcileRequest = output$1<typeof SessionReconcileRequestSchema>;
type SessionReconcileResult = output$1<typeof SessionReconcileResultSchema>;
type DirectImMessageDeliveryRequest = output$1<typeof DirectImMessageDeliveryRequestSchema>;
type RuntimeImSteerRequest = output$1<typeof RuntimeImSteerRequestSchema>;
type RuntimeImSteerResult = output$1<typeof RuntimeImSteerResultSchema>;
type RuntimeImCredentialGrantResult = output$1<typeof RuntimeImCredentialGrantResultSchema>;
type RuntimeImOutboxContext = output$1<typeof RuntimeImOutboxContextSchema>;
type ImMessageDeliveryResult = output$1<typeof ImMessageDeliveryResultSchema>;
type SessionMessageDeliveryRequestV3 = output$1<typeof SessionMessageDeliveryRequestV3Schema>;
type SessionMessageDeliveryResult = output$1<typeof SessionMessageDeliveryResultSchema>;
type TurnReportRequest = output$1<typeof TurnReportRequestSchema>;
type TurnReportResult = output$1<typeof TurnReportResultSchema>;
type AgentRuntimeOptionsRequestFrame = output$1<typeof AgentRuntimeOptionsRequestFrameSchema>;
type AgentRuntimeTestRequestFrame = output$1<typeof AgentRuntimeTestRequestFrameSchema>;
type AgentRuntimeTestResultFrame = output$1<typeof AgentRuntimeTestResultFrameSchema>;
type ProviderCliExpectedIdentity = output$1<typeof ProviderCliExpectedIdentitySchema>;
type ProviderCliPrewarmFrame = output$1<typeof ProviderCliPrewarmFrameSchema>;
type ProviderCliValidationGrantFrame = output$1<typeof ProviderCliValidationGrantFrameSchema>;
type ProviderCliValidationResultFrame = output$1<typeof ProviderCliValidationResultFrameSchema>;
interface RuntimeSnapshotHashes {
  agentConfigHash: string;
  sessionConfigHash: string;
  effectiveSnapshotHash: string;
}
type TurnReportHashInput = Omit<TurnReportRequest, "resultHash" | "type" | "requestId">;
declare const RuntimeClientCapabilitiesSchema: ZodObject<{
  imCredentialGrant: ZodUnion<readonly [ZodLiteral<0>, ZodLiteral<1>]>;
}, $strict>;
declare const RuntimeProviderReadinessObservationSchema: ZodObject<{
  provider: ZodEnum<{
    "claude-code": "claude-code";
    codex: "codex";
    pi: "pi";
  }>;
  status: ZodEnum<{
    checking: "checking";
    install: "install";
    ready: "ready";
    "sign-in": "sign-in";
    unavailable: "unavailable";
  }>;
}, $strict>;
declare const RuntimeImCliReadinessObservationSchema: ZodObject<{
  provider: ZodEnum<{
    feishu: "feishu";
    slack: "slack";
  }>;
  status: ZodEnum<{
    checking: "checking";
    install: "install";
    ready: "ready";
    unavailable: "unavailable";
  }>;
}, $strict>;
/**
 * The exact channel latest target the Server currently advertises. Sent only on v2 heartbeat results
 * when the `runtime.channelTarget` capability was negotiated, so older Clients never see a field
 * their strict schemas would reject.
 */
declare const RuntimeChannelTargetSchema: ZodObject<{
  channel: ZodEnum<{
    dev: "dev";
    prod: "prod";
    staging: "staging";
  }>;
  version: ZodString;
}, $strict>;
type RuntimeClientCapabilities = output$1<typeof RuntimeClientCapabilitiesSchema>;
type RuntimeProviderReadinessObservation = output$1<typeof RuntimeProviderReadinessObservationSchema>;
type RuntimeImCliReadinessObservation = output$1<typeof RuntimeImCliReadinessObservationSchema>;
type RuntimeChannelTarget = output$1<typeof RuntimeChannelTargetSchema>;
/** Full Schedule DTO: every management field, the full prompt, and the Web detail link. */
declare const AgentScheduleSchema: ZodObject<{
  id: ZodString;
  agentId: ZodString;
  target: ZodObject<{
    sessionId: ZodString;
    provider: ZodEnum<{
      feishu: "feishu";
      slack: "slack";
    }>;
    sessionKind: ZodEnum<{
      channel: "channel";
      thread: "thread";
    }>;
    channelId: ZodString;
    threadKey: ZodNullable<ZodString>;
  }, $strict>;
  name: ZodString;
  prompt: ZodString;
  schedule: ZodDiscriminatedUnion<[ZodObject<{
    kind: ZodLiteral<"at">;
    at: ZodString;
  }, $strict>, ZodObject<{
    kind: ZodLiteral<"every">;
    intervalSeconds: ZodNumber;
    anchorAt: ZodString;
  }, $strict>, ZodObject<{
    kind: ZodLiteral<"cron">;
    expression: ZodString;
  }, $strict>], "kind">;
  timezone: ZodString;
  enabled: ZodBoolean;
  nextTriggerAt: ZodNullable<ZodString>;
  revision: ZodNumber;
  lastDispatch: ZodNullable<ZodObject<{
    scheduledFor: ZodString;
    attemptedAt: ZodNullable<ZodString>;
    messageId: ZodNullable<ZodString>;
    outcome: ZodEnum<{
      accepted: "accepted";
      rejected: "rejected";
      skipped: "skipped";
      unknown: "unknown";
      unreachable: "unreachable";
    }>;
    code: ZodNullable<ZodString>;
  }, $strict>>;
  detailUrl: ZodString;
  createdAt: ZodString;
  updatedAt: ZodString;
}, $strict>;
type AgentSchedule = output$1<typeof AgentScheduleSchema>;
declare const AgentScheduleListResponseSchema: ZodObject<{
  items: ZodArray<ZodObject<{
    id: ZodString;
    agentId: ZodString;
    target: ZodObject<{
      sessionId: ZodString;
      provider: ZodEnum<{
        feishu: "feishu";
        slack: "slack";
      }>;
      sessionKind: ZodEnum<{
        channel: "channel";
        thread: "thread";
      }>;
      channelId: ZodString;
      threadKey: ZodNullable<ZodString>;
    }, $strict>;
    name: ZodString;
    schedule: ZodDiscriminatedUnion<[ZodObject<{
      kind: ZodLiteral<"at">;
      at: ZodString;
    }, $strict>, ZodObject<{
      kind: ZodLiteral<"every">;
      intervalSeconds: ZodNumber;
      anchorAt: ZodString;
    }, $strict>, ZodObject<{
      kind: ZodLiteral<"cron">;
      expression: ZodString;
    }, $strict>], "kind">;
    timezone: ZodString;
    enabled: ZodBoolean;
    nextTriggerAt: ZodNullable<ZodString>;
    revision: ZodNumber;
    lastDispatch: ZodNullable<ZodObject<{
      scheduledFor: ZodString;
      attemptedAt: ZodNullable<ZodString>;
      messageId: ZodNullable<ZodString>;
      outcome: ZodEnum<{
        accepted: "accepted";
        rejected: "rejected";
        skipped: "skipped";
        unknown: "unknown";
        unreachable: "unreachable";
      }>;
      code: ZodNullable<ZodString>;
    }, $strict>>;
    createdAt: ZodString;
    updatedAt: ZodString;
  }, $strict>>;
  nextCursor: ZodNullable<ZodString>;
}, $strict>;
type AgentScheduleListResponse = output$1<typeof AgentScheduleListResponseSchema>;
declare const CreateAgentScheduleRequestSchema: ZodObject<{
  name: ZodString;
  prompt: ZodString;
  schedule: ZodDiscriminatedUnion<[ZodObject<{
    kind: ZodLiteral<"at">;
    at: ZodString;
  }, $strict>, ZodObject<{
    kind: ZodLiteral<"every">;
    intervalSeconds: ZodNumber;
  }, $strict>, ZodObject<{
    kind: ZodLiteral<"cron">;
    expression: ZodString;
  }, $strict>], "kind">;
  timezone: ZodString;
}, $strict>;
type CreateAgentScheduleRequest = output$1<typeof CreateAgentScheduleRequestSchema>;
declare const UpdateAgentScheduleRequestSchema: ZodObject<{
  expectedRevision: ZodNumber;
  name: ZodOptional<ZodString>;
  prompt: ZodOptional<ZodString>;
  schedule: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
    kind: ZodLiteral<"at">;
    at: ZodString;
  }, $strict>, ZodObject<{
    kind: ZodLiteral<"every">;
    intervalSeconds: ZodNumber;
  }, $strict>, ZodObject<{
    kind: ZodLiteral<"cron">;
    expression: ZodString;
  }, $strict>], "kind">>;
  timezone: ZodOptional<ZodString>;
}, $strict>;
type UpdateAgentScheduleRequest = output$1<typeof UpdateAgentScheduleRequestSchema>;
/** Preview either a persisted Schedule (keeps its `every` anchor) or an ad-hoc rule + timezone. */
declare const PreviewAgentScheduleRequestSchema: ZodUnion<readonly [ZodObject<{
  scheduleId: ZodString;
}, $strict>, ZodObject<{
  schedule: ZodDiscriminatedUnion<[ZodObject<{
    kind: ZodLiteral<"at">;
    at: ZodString;
  }, $strict>, ZodObject<{
    kind: ZodLiteral<"every">;
    intervalSeconds: ZodNumber;
  }, $strict>, ZodObject<{
    kind: ZodLiteral<"cron">;
    expression: ZodString;
  }, $strict>], "kind">;
  timezone: ZodString;
}, $strict>]>;
type PreviewAgentScheduleRequest = output$1<typeof PreviewAgentScheduleRequestSchema>;
declare const AgentSchedulePreviewSchema: ZodObject<{
  calculatedAt: ZodString;
  schedule: ZodDiscriminatedUnion<[ZodObject<{
    kind: ZodLiteral<"at">;
    at: ZodString;
  }, $strict>, ZodObject<{
    kind: ZodLiteral<"every">;
    intervalSeconds: ZodNumber;
    anchorAt: ZodString;
  }, $strict>, ZodObject<{
    kind: ZodLiteral<"cron">;
    expression: ZodString;
  }, $strict>], "kind">;
  timezone: ZodString;
  items: ZodArray<ZodObject<{
    at: ZodString;
    local: ZodString;
    timezone: ZodString;
  }, $strict>>;
}, $strict>;
type AgentSchedulePreview = output$1<typeof AgentSchedulePreviewSchema>;
declare const SkillArchiveFormatSchema: ZodEnum<{
  "tar.gz": "tar.gz";
  zip: "zip";
}>;
type SkillArchiveFormat = output$1<typeof SkillArchiveFormatSchema>;
declare const SkillSchema: ZodObject<{
  id: ZodString;
  agentId: ZodString;
  name: ZodString;
  description: ZodString;
  enabled: ZodBoolean;
  source: ZodEnum<{
    agent_upload: "agent_upload";
    cli_upload: "cli_upload";
    preset: "preset";
    url_install: "url_install";
    web_upload: "web_upload";
  }>;
  archiveSha256: ZodString;
  archiveBytes: ZodNumber;
  fileCount: ZodNumber;
  revision: ZodNumber;
  createdAt: ZodString;
  updatedAt: ZodString;
}, $strict>;
type Skill = output$1<typeof SkillSchema>;
declare const SkillDetailSchema: ZodObject<{
  id: ZodString;
  agentId: ZodString;
  name: ZodString;
  description: ZodString;
  enabled: ZodBoolean;
  source: ZodEnum<{
    agent_upload: "agent_upload";
    cli_upload: "cli_upload";
    preset: "preset";
    url_install: "url_install";
    web_upload: "web_upload";
  }>;
  archiveSha256: ZodString;
  archiveBytes: ZodNumber;
  fileCount: ZodNumber;
  revision: ZodNumber;
  createdAt: ZodString;
  updatedAt: ZodString;
  files: ZodArray<ZodObject<{
    path: ZodString;
    bytes: ZodNumber;
  }, $strict>>;
  filesTruncated: ZodBoolean;
}, $strict>;
type SkillDetail = output$1<typeof SkillDetailSchema>;
declare const ListAgentSkillsResponseSchema: ZodObject<{
  skills: ZodArray<ZodObject<{
    id: ZodString;
    agentId: ZodString;
    name: ZodString;
    description: ZodString;
    enabled: ZodBoolean;
    source: ZodEnum<{
      agent_upload: "agent_upload";
      cli_upload: "cli_upload";
      preset: "preset";
      url_install: "url_install";
      web_upload: "web_upload";
    }>;
    archiveSha256: ZodString;
    archiveBytes: ZodNumber;
    fileCount: ZodNumber;
    revision: ZodNumber;
    createdAt: ZodString;
    updatedAt: ZodString;
  }, $strict>>;
  storage: ZodEnum<{
    available: "available";
    unavailable: "unavailable";
  }>;
}, $strict>;
type ListAgentSkillsResponse = output$1<typeof ListAgentSkillsResponseSchema>;
declare const RuntimeSkillManifestSchema: ZodObject<{
  skills: ZodArray<ZodObject<{
    id: ZodString;
    name: ZodString;
    archiveSha256: ZodString;
    archiveBytes: ZodNumber;
  }, $strict>>;
}, $strict>;
type RuntimeSkillManifest = output$1<typeof RuntimeSkillManifestSchema>;
declare const ListSkillPresetsResponseSchema: ZodObject<{
  categories: ZodArray<ZodObject<{
    id: ZodEnum<{
      engineering: "engineering";
      "getting-started": "getting-started";
    }>;
    order: ZodNumber;
  }, $strict>>;
  presets: ZodArray<ZodObject<{
    name: ZodString;
    description: ZodString;
    category: ZodEnum<{
      engineering: "engineering";
      "getting-started": "getting-started";
    }>;
    order: ZodNumber;
    archiveSha256: ZodString;
    archiveBytes: ZodNumber;
    fileCount: ZodNumber;
    state: ZodEnum<{
      installed: "installed";
      name_conflict: "name_conflict";
      not_installed: "not_installed";
      update_available: "update_available";
    }>;
  }, $strict>>;
}, $strict>;
type ListSkillPresetsResponse = output$1<typeof ListSkillPresetsResponseSchema>;
declare const InstallSkillPresetResponseSchema: ZodObject<{
  action: ZodEnum<{
    installed: "installed";
    unchanged: "unchanged";
    updated: "updated";
  }>;
  skill: ZodObject<{
    id: ZodString;
    agentId: ZodString;
    name: ZodString;
    description: ZodString;
    enabled: ZodBoolean;
    source: ZodEnum<{
      agent_upload: "agent_upload";
      cli_upload: "cli_upload";
      preset: "preset";
      url_install: "url_install";
      web_upload: "web_upload";
    }>;
    archiveSha256: ZodString;
    archiveBytes: ZodNumber;
    fileCount: ZodNumber;
    revision: ZodNumber;
    createdAt: ZodString;
    updatedAt: ZodString;
  }, $strict>;
}, $strict>;
type InstallSkillPresetResponse = output$1<typeof InstallSkillPresetResponseSchema>;
declare const ProvisionSlackAgentRequestSchema: ZodObject<{
  code: ZodString;
  agent: ZodObject<{
    creationIntentId: ZodNonOptional<ZodOptional<ZodString>>;
    name: ZodString;
    displayName: ZodString;
    runtimeProvider: ZodEnum<{
      "claude-code": "claude-code";
      codex: "codex";
      pi: "pi";
    }>;
    runtimeConfig: ZodOptional<ZodObject<{
      model: ZodOptional<ZodNullable<ZodString>>;
      reasoningEffort: ZodOptional<ZodNullable<ZodString>>;
      instructions: ZodOptional<ZodString>;
    }, $strict>>;
  }, $strict>;
  slack: ZodObject<{
    appId: ZodString;
    teamId: ZodString;
    botUserId: ZodString;
    botAccessToken: ZodString;
    signingSecret: ZodString;
  }, $strict>;
}, $strict>;
declare const ProvisionSlackAgentResponseSchema: ZodObject<{
  agent: ZodObject<{
    id: ZodString;
    name: ZodString;
    displayName: ZodString;
    runtimeProvider: ZodEnum<{
      "claude-code": "claude-code";
      codex: "codex";
      pi: "pi";
    }>;
    receiveMode: ZodEnum<{
      all_message: "all_message";
      mention_only: "mention_only";
    }>;
    status: ZodEnum<{
      active: "active";
      suspended: "suspended";
    }>;
    createdAt: ZodString;
    updatedAt: ZodString;
    createdByUserId: ZodString;
    computerId: ZodNullable<ZodString>;
    selfConfigurationEnabled: ZodBoolean;
    revision: ZodNumber;
    runtimeConfig: ZodObject<{
      revision: ZodNumber;
      model: ZodNullable<ZodString>;
      reasoningEffort: ZodNullable<ZodString>;
      instructions: ZodString;
      maxDurationMs: ZodNullable<ZodNumber>;
      contextTrees: ZodArray<ZodObject<{
        kind: ZodLiteral<"git">;
        repository: ZodString;
        path: ZodString;
        ref: ZodString;
      }, $strict>>;
      permissions: ZodObject<{
        approvalPolicy: ZodDefault<ZodEnum<{
          never: "never";
          "on-request": "on-request";
        }>>;
        allowCommands: ZodDefault<ZodArray<ZodString>>;
      }, $strict>;
    }, $strict>;
  }, $strict>;
  slack: ZodObject<{
    agentDisplayName: ZodString;
    eventsUrl: ZodString;
    allowedIntent: ZodNullable<ZodEnum<{
      create: "create";
      reauthorize: "reauthorize";
    }>>;
    blockedReason: ZodNullable<ZodString>;
    expectedMessaging: ZodNullable<ZodDiscriminatedUnion<[ZodObject<{
      kind: ZodLiteral<"unbound">;
    }, $strict>, ZodObject<{
      kind: ZodLiteral<"bound">;
      provider: ZodEnum<{
        feishu: "feishu";
        slack: "slack";
      }>;
      bindingId: ZodString;
      credentialGeneration: ZodNumber;
    }, $strict>], "kind">>;
    preferredRecovery: ZodEnum<{
      credentials: "credentials";
      oauth: "oauth";
    }>;
    binding: ZodNullable<ZodObject<{
      id: ZodString;
      agentId: ZodString;
      provider: ZodEnum<{
        feishu: "feishu";
        slack: "slack";
      }>;
      bindingState: ZodEnum<{
        active: "active";
        disabled: "disabled";
        error: "error";
        provisioning: "provisioning";
        reauthorization_required: "reauthorization_required";
      }>;
      bot: ZodObject<{
        displayName: ZodNullable<ZodString>;
        avatarUrl: ZodNullable<ZodString>;
      }, $strict>;
      receiveMode: ZodEnum<{
        all_message: "all_message";
        mention_only: "mention_only";
      }>;
      lastInboundAt: ZodNullable<ZodString>;
      lastValidatedAt: ZodNullable<ZodString>;
      lastRuntimeObservationAt: ZodNullable<ZodString>;
      identity: ZodDiscriminatedUnion<[ZodObject<{
        provider: ZodLiteral<"feishu">;
        appId: ZodString;
        teamId: ZodNullable<ZodString>;
        botOpenId: ZodString;
        teamBrand: ZodNullable<ZodString>;
      }, $strict>, ZodObject<{
        provider: ZodLiteral<"slack">;
        appId: ZodString;
        teamId: ZodString;
        enterpriseId: ZodNullable<ZodString>;
        botUserId: ZodString;
        appIdEvidence: ZodLiteral<"configured">;
      }, $strict>], "provider">;
      credentialGeneration: ZodNumber;
      grantedCapabilities: ZodArray<ZodString>;
      reauthorizationRequired: ZodBoolean;
      lastErrorCode: ZodNullable<ZodString>;
    }, $strict>>;
    identityClosure: ZodNullable<ZodObject<{
      status: ZodEnum<{
        pending: "pending";
        verified: "verified";
      }>;
      verifiedAt: ZodNullable<ZodString>;
    }, $strict>>;
    handoff: ZodNullable<ZodUnion<readonly [ZodObject<{
      bindingState: ZodLiteral<"active">;
      handoffReady: ZodLiteral<true>;
    }, $strict>, ZodObject<{
      bindingState: ZodLiteral<"active">;
      handoffReady: ZodLiteral<false>;
      providerCli: ZodOptional<ZodObject<{
        phase: ZodEnum<{
          checking_credentials: "checking_credentials";
          needs_attention: "needs_attention";
          preparing_cli: "preparing_cli";
        }>;
        reason: ZodOptional<ZodEnum<{
          credential_rejected: "credential_rejected";
          global_bin_unavailable: "global_bin_unavailable";
          identity_mismatch: "identity_mismatch";
          integrity_failed: "integrity_failed";
          provider_unreachable: "provider_unreachable";
          rate_limited: "rate_limited";
          scope_missing: "scope_missing";
          unsupported_platform: "unsupported_platform";
          upgrade_required: "upgrade_required";
          version_incompatible: "version_incompatible";
        }>>;
      }, $strict>>;
    }, $strict>, ZodObject<{
      bindingState: ZodEnum<{
        disabled: "disabled";
        error: "error";
        provisioning: "provisioning";
        reauthorization_required: "reauthorization_required";
      }>;
      handoffReady: ZodLiteral<false>;
    }, $strict>]>>;
  }, $strict>;
  interactionsUrl: ZodString;
}, $strict>;
type ProvisionSlackAgentRequest = output$1<typeof ProvisionSlackAgentRequestSchema>;
type ProvisionSlackAgentResponse = output$1<typeof ProvisionSlackAgentResponseSchema>;
declare const SlackAutoSetupRuntimeRequestSchema: ZodObject<{
  type: ZodLiteral<"slack:auto-setup">;
  requestId: ZodString;
  computerId: ZodString;
  agentId: ZodString;
  input: ZodDiscriminatedUnion<[ZodObject<{
    action: ZodLiteral<"authorize">;
    force: ZodOptional<ZodBoolean>;
  }, $strict>, ZodObject<{
    action: ZodLiteral<"install">;
    displayName: ZodString;
    challenge: ZodOptional<ZodString>;
  }, $strict>, ZodObject<{
    action: ZodLiteral<"callbacks">;
    challenge: ZodOptional<ZodString>;
    teamId: ZodString;
    botUserId: ZodString;
    enterpriseId: ZodNullable<ZodString>;
    appId: ZodString;
    eventsUrl: ZodString;
    interactionsUrl: ZodString;
  }, $strict>], "action">;
}, $strict>;
declare const SlackAutoSetupRuntimeResultSchema: ZodObject<{
  type: ZodLiteral<"slack:auto-setup:result">;
  requestId: ZodString;
  result: ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
    status: ZodLiteral<"authorization_required">;
    ticket: ZodString;
  }, $strict>, ZodObject<{
    status: ZodLiteral<"authorized">;
    teamName: ZodString;
  }, $strict>, ZodObject<{
    status: ZodLiteral<"connected">;
  }, $strict>, ZodObject<{
    status: ZodLiteral<"approval_pending">;
    appId: ZodString;
    teamId: ZodString;
  }, $strict>, ZodObject<{
    status: ZodLiteral<"failed">;
    code: ZodEnum<{
      approval_denied: "approval_denied";
      authorization_failed: "authorization_failed";
      busy: "busy";
      callbacks_failed: "callbacks_failed";
      capability_missing: "capability_missing";
      computer_unavailable: "computer_unavailable";
      create_failed: "create_failed";
      create_uncertain: "create_uncertain";
      failed: "failed";
      install_failed: "install_failed";
      manual_required: "manual_required";
    }>;
    appId: ZodOptional<ZodString>;
    teamId: ZodOptional<ZodString>;
    errorCode: ZodOptional<ZodString>;
  }, $strict>], "status">, ZodObject<{
    status: ZodLiteral<"installed">;
    credentials: ZodObject<{
      appId: ZodString;
      teamId: ZodString;
      botUserId: ZodString;
      botAccessToken: ZodString;
      signingSecret: ZodString;
    }, $strict>;
  }, $strict>]>;
}, $strict>;
type SlackAutoSetupRuntimeRequest = output$1<typeof SlackAutoSetupRuntimeRequestSchema>;
type SlackAutoSetupRuntimeResult = output$1<typeof SlackAutoSetupRuntimeResultSchema>;
/** The stable high-level class used for operational routing and dashboards. */
declare const StructuredErrorCategorySchema: ZodEnum<{
  auth: "auth";
  authorization: "authorization";
  cancelled: "cancelled";
  configuration: "configuration";
  conflict: "conflict";
  dependency: "dependency";
  internal: "internal";
  not_found: "not_found";
  protocol: "protocol";
  rate_limit: "rate_limit";
  timeout: "timeout";
  unavailable: "unavailable";
  validation: "validation";
}>;
/** The safe retry policy for a failure. Retries must still respect operation idempotency. */
declare const ErrorRetryabilitySchema: ZodEnum<{
  after_auth: "after_auth";
  backoff: "backoff";
  immediate: "immediate";
  never: "never";
}>;
/** The lifecycle boundary at which an error was observed. */
declare const StructuredErrorPhaseSchema: ZodEnum<{
  authentication: "authentication";
  authorization: "authorization";
  configuration: "configuration";
  dispatch: "dispatch";
  persistence: "persistence";
  provider: "provider";
  request: "request";
  scheduler: "scheduler";
  serialization: "serialization";
  shutdown: "shutdown";
  socket: "socket";
  startup: "startup";
  transport: "transport";
  unknown: "unknown";
  validation: "validation";
  worker: "worker";
}>;
type StructuredErrorCauseInput = {
  code?: string;
  category?: StructuredErrorCategory;
  retryability?: ErrorRetryability;
  phase?: StructuredErrorPhase;
  message: string;
  cause?: StructuredErrorCauseInput;
};
/** A recursively nested, deliberately small representation of a root cause. */
declare const StructuredErrorCauseSchema: ZodType<StructuredErrorCauseInput>;
declare const StructuredErrorSchema: ZodObject<{
  code: ZodString;
  category: ZodEnum<{
    auth: "auth";
    authorization: "authorization";
    cancelled: "cancelled";
    configuration: "configuration";
    conflict: "conflict";
    dependency: "dependency";
    internal: "internal";
    not_found: "not_found";
    protocol: "protocol";
    rate_limit: "rate_limit";
    timeout: "timeout";
    unavailable: "unavailable";
    validation: "validation";
  }>;
  retryability: ZodEnum<{
    after_auth: "after_auth";
    backoff: "backoff";
    immediate: "immediate";
    never: "never";
  }>;
  phase: ZodEnum<{
    authentication: "authentication";
    authorization: "authorization";
    configuration: "configuration";
    dispatch: "dispatch";
    persistence: "persistence";
    provider: "provider";
    request: "request";
    scheduler: "scheduler";
    serialization: "serialization";
    shutdown: "shutdown";
    socket: "socket";
    startup: "startup";
    transport: "transport";
    unknown: "unknown";
    validation: "validation";
    worker: "worker";
  }>;
  requestId: ZodOptional<ZodString>;
  message: ZodString;
  cause: ZodOptional<ZodType<StructuredErrorCauseInput, unknown, $ZodTypeInternals<StructuredErrorCauseInput, unknown>>>;
}, $strict>;
type StructuredErrorCategory = output$1<typeof StructuredErrorCategorySchema>;
type ErrorRetryability = output$1<typeof ErrorRetryabilitySchema>;
type StructuredErrorPhase = output$1<typeof StructuredErrorPhaseSchema>;
type StructuredErrorCause = output$1<typeof StructuredErrorCauseSchema>;
type StructuredError = output$1<typeof StructuredErrorSchema>;
//#endregion
//#region ../../packages/shared/dist/index.d.mts
declare const UpdateSelfAgentRequestSchema: ZodObject<{
  expectedRevision: ZodNumber;
  runtimeConfig: ZodObject<{
    model: ZodOptional<ZodNullable<ZodString>>;
    reasoningEffort: ZodOptional<ZodNullable<ZodString>>;
    instructions: ZodOptional<ZodString>;
  }, $strict>;
}, $strict>;
/** The only binding change an Agent may make to its own mount: enable or disable it. */
declare const UpdateSelfMCPBindingRequestSchema: ZodObject<{
  enabled: ZodBoolean;
}, $strict>;
/**
 * Register a Server definition and mount it on the calling Agent in one step.
 *
 * `apiKey` is the only credential this surface accepts, and only for a `bearer` Server: an OAuth
 * credential cannot be written directly, it arrives through a flow the human completes in a browser.
 * Anonymous registration is refused because an anonymous mount is immediately usable, which would
 * hand an Agent a channel to send data to without any human step.
 */
declare const CreateSelfMCPServerRequestSchema: ZodObject<{
  name: ZodString;
  url: ZodString;
  defaultAuthKind: ZodDefault<ZodEnum<{
    bearer: "bearer";
    none: "none";
    oauth: "oauth";
  }>>;
  apiKey: ZodOptional<ZodString>;
}, $strict>;
type CreateSelfMCPServerRequest = output$1<typeof CreateSelfMCPServerRequestSchema>;
/**
 * The cheap answer to "is it usable yet, and what can it do?".
 *
 * A projection of `MCPAgentServer`, not a replacement: the tool input schemas and the raw protocol
 * snapshot are omitted, so a poll loop costs a few hundred bytes instead of hundreds of kilobytes.
 * `authStatus` and `probeState` are independent — a mounted Server may be authorized but not
 * yet probed, and only `probeState: "succeeded"` with a non-empty `tools` means the tools are live.
 */
declare const SelfMCPOAuthStatusSchema: ZodObject<{
  mcpServerId: ZodString;
  name: ZodString;
  enabled: ZodBoolean;
  authKind: ZodNullable<ZodEnum<{
    bearer: "bearer";
    none: "none";
    oauth: "oauth";
  }>>;
  authStatus: ZodNullable<ZodEnum<{
    active: "active";
    error: "error";
    expired: "expired";
    pending: "pending";
    revoked: "revoked";
  }>>;
  probeState: ZodNullable<ZodEnum<{
    failed: "failed";
    pending: "pending";
    succeeded: "succeeded";
  }>>;
  probeError: ZodNullable<ZodString>;
  failureCode: ZodNullable<ZodString>;
  toolsCount: ZodNullable<ZodNumber>;
  toolsTruncated: ZodBoolean;
  tools: ZodNullable<ZodArray<ZodObject<{
    name: ZodString;
    description: ZodNullable<ZodString>;
  }, $strict>>>;
}, $strict>;
type SelfMCPOAuthStatus = output$1<typeof SelfMCPOAuthStatusSchema>;
type UpdateSelfAgentRequest = output$1<typeof UpdateSelfAgentRequestSchema>;
type UpdateSelfMCPBindingRequest = output$1<typeof UpdateSelfMCPBindingRequestSchema>;
//#endregion
//#region src/channel-name.d.ts
/**
 * Release channel names. Kept free of Node.js imports so browser bundles and protocol schemas can
 * reference channels without pulling in `node:os`/`node:path`.
 */
declare const ChannelNameSchema: ZodEnum<{
  dev: "dev";
  prod: "prod";
  staging: "staging";
}>;
type ChannelName = output$1<typeof ChannelNameSchema>;
//#endregion
//#region src/channel.d.ts
declare const ServiceIdSchema: ZodString;
type ServiceId = output$1<typeof ServiceIdSchema>;
interface ChannelConfig {
  binName: string;
  channel: ChannelName;
  defaultHome: string;
  defaultServerUrl?: string;
  displayName: string;
  packageName: string;
  serviceId: ServiceId;
}
//#endregion
//#region src/execution-services.d.ts
/**
 * Platform services a Client may opt into when it opens an execution.
 *
 * This module exists so no single service owns the union. The two schemas below started inside
 * `web-tools.ts`, which was correct while `web` was the only service; adding `mcp` there would have
 * parked the MCP contract permanently inside the Tavily module and made every future service
 * import from it.
 *
 * A grant is a pure authorization statement — the service and its exact scopes. It carries no
 * secret: a service whose runtime needs a credential hands it over through its own frame in
 * `./runtime-credentials.ts`, which is the invariant every other secret in that protocol already
 * follows.
 */
/** Services a Client may request at execution open. Each is gated by its own negotiated capability. */
declare const RuntimeExecutionServiceRequestSchema: ZodEnum<{
  "context-tree": "context-tree";
  mcp: "mcp";
  web: "web";
}>;
type RuntimeExecutionServiceRequest = output$1<typeof RuntimeExecutionServiceRequestSchema>;
/**
 * One service grant attached to an opened execution.
 *
 * Discriminated on `service` rather than flattened, so each service states its own scope vocabulary
 * and a reader that narrows on `service === "web"` cannot silently accept an `mcp` grant's scopes.
 */
declare const RuntimeExecutionServiceSchema: ZodDiscriminatedUnion<[ZodObject<{
  service: ZodLiteral<"web">;
  scopes: ZodArray<ZodEnum<{
    "web:fetch": "web:fetch";
    "web:search": "web:search";
  }>>;
}, $strict>, ZodObject<{
  service: ZodLiteral<"mcp">;
  scopes: ZodArray<ZodEnum<{
    "mcp:tools": "mcp:tools";
  }>>;
}, $strict>, ZodObject<{
  service: ZodLiteral<"context-tree">;
  scopes: ZodTuple<[ZodLiteral<"context-tree:git">], null>;
}, $strict>], "service">;
type RuntimeExecutionService = output$1<typeof RuntimeExecutionServiceSchema>;
//#endregion
//#region src/runtime-credentials.d.ts
/**
 * Runtime credential delegation contract (control + data planes).
 *
 * The control plane travels over the authenticated runtime business channel; the data plane is a
 * separate binary WebSocket authenticated by a single-use ticket. Schemas here are the only wire
 * authority: both planes use strict objects, bounded strings, and explicit enums. Nothing in this
 * module carries raw platform secrets — capabilities and tickets are opaque random values.
 */
declare const RUNTIME_PROVIDER_PROXY_PATH: "/api/v1/runtime/provider-proxy";
declare const RUNTIME_PROXY_TICKET_TTL_MS = 15000;
declare const RUNTIME_EXECUTION_MAX_LIFETIME_MS: number;
/**
 * Reserved internal header carrying the pinned upstream host for GitHub proxy streams
 * (`github.com` for Git, `api.github.com` for REST/GraphQL). Set only by the trusted Runner
 * adapter; the Server validates it and never treats it as caller authority over the origin.
 */
declare const RUNTIME_PROVIDER_ORIGIN_HEADER: "x-opentag-provider-origin";
declare const RuntimeCredentialProviderSchema: ZodEnum<{
  feishu: "feishu";
  github: "github";
  slack: "slack";
}>;
type RuntimeCredentialProvider = output$1<typeof RuntimeCredentialProviderSchema>;
declare const RuntimeExecutionSourceSchema: ZodDiscriminatedUnion<[ZodObject<{
  kind: ZodLiteral<"delivery">;
  deliveryId: ZodString;
  turnId: ZodString;
}, $strict>, ZodObject<{
  kind: ZodLiteral<"session-message">;
  messageId: ZodString;
}, $strict>, ZodObject<{
  kind: ZodLiteral<"validation">;
  validationRunId: ZodString;
}, $strict>], "kind">;
type RuntimeExecutionSource = output$1<typeof RuntimeExecutionSourceSchema>;
declare const RuntimeExecutionSandboxSchema: ZodObject<{
  sandboxId: ZodString;
  resourceUid: ZodString;
  environmentGeneration: ZodNumber;
}, $strict>;
type RuntimeExecutionSandbox = output$1<typeof RuntimeExecutionSandboxSchema>;
declare const RuntimeContextTreeExecutionSchema: ZodObject<{
  kind: ZodLiteral<"git">;
  repository: ZodString;
  path: ZodString;
  ref: ZodString;
  parentExecutionId: ZodString;
}, $strict>;
type RuntimeContextTreeExecution = output$1<typeof RuntimeContextTreeExecutionSchema>;
declare const RuntimeExecutionOpenRequestSchema: ZodObject<{
  type: ZodLiteral<"runtime:execution:open">;
  requestId: ZodString;
  sessionId: ZodString;
  agentId: ZodString;
  placementGeneration: ZodNumber;
  runId: ZodString;
  source: ZodDiscriminatedUnion<[ZodObject<{
    kind: ZodLiteral<"delivery">;
    deliveryId: ZodString;
    turnId: ZodString;
  }, $strict>, ZodObject<{
    kind: ZodLiteral<"session-message">;
    messageId: ZodString;
  }, $strict>, ZodObject<{
    kind: ZodLiteral<"validation">;
    validationRunId: ZodString;
  }, $strict>], "kind">;
  sandbox: ZodOptional<ZodObject<{
    sandboxId: ZodString;
    resourceUid: ZodString;
    environmentGeneration: ZodNumber;
  }, $strict>>;
  contextTree: ZodOptional<ZodObject<{
    kind: ZodLiteral<"git">;
    repository: ZodString;
    path: ZodString;
    ref: ZodString;
    parentExecutionId: ZodString;
  }, $strict>>;
  services: ZodOptional<ZodArray<ZodEnum<{
    "context-tree": "context-tree";
    mcp: "mcp";
    web: "web";
  }>>>;
}, $strict>;
type RuntimeExecutionOpenRequest = output$1<typeof RuntimeExecutionOpenRequestSchema>;
/**
 * Provider-discriminated, bounded non-secret CLI metadata. A provider variant carries only what
 * the native CLI needs (identity labels and repo scope); it never contains tokens, secrets,
 * signed URLs, or tenant material.
 */
declare const RuntimeProviderCliMetadataSchema: ZodDiscriminatedUnion<[ZodObject<{
  provider: ZodLiteral<"feishu">;
  appId: ZodString;
  teamBrand: ZodEnum<{
    feishu: "feishu";
    lark: "lark";
  }>;
  outboxContext: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
    provider: ZodLiteral<"feishu">;
    sessionKind: ZodEnum<{
      channel: "channel";
      thread: "thread";
    }>;
    chatId: ZodString;
    threadId: ZodOptional<ZodString>;
  }, $strict>, ZodObject<{
    provider: ZodLiteral<"slack">;
    sessionKind: ZodEnum<{
      channel: "channel";
      thread: "thread";
    }>;
    channelId: ZodString;
    threadTs: ZodOptional<ZodString>;
  }, $strict>], "provider">>;
}, $strict>, ZodObject<{
  provider: ZodLiteral<"slack">;
  teamId: ZodString;
  botUserId: ZodString;
  outboxContext: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
    provider: ZodLiteral<"feishu">;
    sessionKind: ZodEnum<{
      channel: "channel";
      thread: "thread";
    }>;
    chatId: ZodString;
    threadId: ZodOptional<ZodString>;
  }, $strict>, ZodObject<{
    provider: ZodLiteral<"slack">;
    sessionKind: ZodEnum<{
      channel: "channel";
      thread: "thread";
    }>;
    channelId: ZodString;
    threadTs: ZodOptional<ZodString>;
  }, $strict>], "provider">>;
}, $strict>, ZodObject<{
  provider: ZodLiteral<"github">;
  connectionId: ZodString;
  authority: ZodEnum<{
    "context-tree": "context-tree";
    "user-task": "user-task";
  }>;
}, $strict>], "provider">;
type RuntimeProviderCliMetadata = output$1<typeof RuntimeProviderCliMetadataSchema>;
declare const RuntimeExecutionProviderSchema: ZodDiscriminatedUnion<[ZodObject<{
  provider: ZodLiteral<"feishu">;
  bindingId: ZodString;
  cli: ZodObject<{
    provider: ZodLiteral<"feishu">;
    appId: ZodString;
    teamBrand: ZodEnum<{
      feishu: "feishu";
      lark: "lark";
    }>;
    outboxContext: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
      provider: ZodLiteral<"feishu">;
      sessionKind: ZodEnum<{
        channel: "channel";
        thread: "thread";
      }>;
      chatId: ZodString;
      threadId: ZodOptional<ZodString>;
    }, $strict>, ZodObject<{
      provider: ZodLiteral<"slack">;
      sessionKind: ZodEnum<{
        channel: "channel";
        thread: "thread";
      }>;
      channelId: ZodString;
      threadTs: ZodOptional<ZodString>;
    }, $strict>], "provider">>;
  }, $strict>;
}, $strict>, ZodObject<{
  provider: ZodLiteral<"slack">;
  bindingId: ZodString;
  cli: ZodObject<{
    provider: ZodLiteral<"slack">;
    teamId: ZodString;
    botUserId: ZodString;
    outboxContext: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
      provider: ZodLiteral<"feishu">;
      sessionKind: ZodEnum<{
        channel: "channel";
        thread: "thread";
      }>;
      chatId: ZodString;
      threadId: ZodOptional<ZodString>;
    }, $strict>, ZodObject<{
      provider: ZodLiteral<"slack">;
      sessionKind: ZodEnum<{
        channel: "channel";
        thread: "thread";
      }>;
      channelId: ZodString;
      threadTs: ZodOptional<ZodString>;
    }, $strict>], "provider">>;
  }, $strict>;
}, $strict>, ZodObject<{
  provider: ZodLiteral<"github">;
  bindingId: ZodString;
  cli: ZodObject<{
    provider: ZodLiteral<"github">;
    connectionId: ZodString;
    authority: ZodEnum<{
      "context-tree": "context-tree";
      "user-task": "user-task";
    }>;
  }, $strict>;
}, $strict>], "provider">;
type RuntimeExecutionProvider = output$1<typeof RuntimeExecutionProviderSchema>;
declare const RuntimeExecutionOpenResultSchema: ZodDiscriminatedUnion<[ZodObject<{
  type: ZodLiteral<"runtime:execution:result">;
  requestId: ZodString;
  status: ZodLiteral<"succeeded">;
  executionId: ZodString;
  expiresAt: ZodString;
  providers: ZodArray<ZodDiscriminatedUnion<[ZodObject<{
    provider: ZodLiteral<"feishu">;
    bindingId: ZodString;
    cli: ZodObject<{
      provider: ZodLiteral<"feishu">;
      appId: ZodString;
      teamBrand: ZodEnum<{
        feishu: "feishu";
        lark: "lark";
      }>;
      outboxContext: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
        provider: ZodLiteral<"feishu">;
        sessionKind: ZodEnum<{
          channel: "channel";
          thread: "thread";
        }>;
        chatId: ZodString;
        threadId: ZodOptional<ZodString>;
      }, $strict>, ZodObject<{
        provider: ZodLiteral<"slack">;
        sessionKind: ZodEnum<{
          channel: "channel";
          thread: "thread";
        }>;
        channelId: ZodString;
        threadTs: ZodOptional<ZodString>;
      }, $strict>], "provider">>;
    }, $strict>;
  }, $strict>, ZodObject<{
    provider: ZodLiteral<"slack">;
    bindingId: ZodString;
    cli: ZodObject<{
      provider: ZodLiteral<"slack">;
      teamId: ZodString;
      botUserId: ZodString;
      outboxContext: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
        provider: ZodLiteral<"feishu">;
        sessionKind: ZodEnum<{
          channel: "channel";
          thread: "thread";
        }>;
        chatId: ZodString;
        threadId: ZodOptional<ZodString>;
      }, $strict>, ZodObject<{
        provider: ZodLiteral<"slack">;
        sessionKind: ZodEnum<{
          channel: "channel";
          thread: "thread";
        }>;
        channelId: ZodString;
        threadTs: ZodOptional<ZodString>;
      }, $strict>], "provider">>;
    }, $strict>;
  }, $strict>, ZodObject<{
    provider: ZodLiteral<"github">;
    bindingId: ZodString;
    cli: ZodObject<{
      provider: ZodLiteral<"github">;
      connectionId: ZodString;
      authority: ZodEnum<{
        "context-tree": "context-tree";
        "user-task": "user-task";
      }>;
    }, $strict>;
  }, $strict>], "provider">>;
  sessionCliProof: ZodOptional<ZodObject<{
    proofId: ZodString;
    token: ZodString;
  }, $strict>>;
  services: ZodOptional<ZodArray<ZodDiscriminatedUnion<[ZodObject<{
    service: ZodLiteral<"web">;
    scopes: ZodArray<ZodEnum<{
      "web:fetch": "web:fetch";
      "web:search": "web:search";
    }>>;
  }, $strict>, ZodObject<{
    service: ZodLiteral<"mcp">;
    scopes: ZodArray<ZodEnum<{
      "mcp:tools": "mcp:tools";
    }>>;
  }, $strict>, ZodObject<{
    service: ZodLiteral<"context-tree">;
    scopes: ZodTuple<[ZodLiteral<"context-tree:git">], null>;
  }, $strict>], "service">>>;
}, $strict>, ZodObject<{
  type: ZodLiteral<"runtime:execution:result">;
  requestId: ZodString;
  status: ZodLiteral<"rejected">;
  code: ZodEnum<{
    agent_mismatch: "agent_mismatch";
    capability_unsupported: "capability_unsupported";
    execution_authority_denied: "execution_authority_denied";
    execution_not_ready: "execution_not_ready";
    execution_source_invalid: "execution_source_invalid";
    owner_unavailable: "owner_unavailable";
    placement_stale: "placement_stale";
    sandbox_mismatch: "sandbox_mismatch";
  }>;
}, $strict>], "status">;
type RuntimeExecutionOpenResult = output$1<typeof RuntimeExecutionOpenResultSchema>;
declare const RuntimeCredentialResultSchema: ZodDiscriminatedUnion<[ZodObject<{
  type: ZodLiteral<"runtime:credential:result">;
  requestId: ZodString;
  status: ZodLiteral<"succeeded">;
  executionId: ZodString;
  grantId: ZodString;
  provider: ZodEnum<{
    feishu: "feishu";
    github: "github";
    slack: "slack";
  }>;
  bindingId: ZodString;
  opaqueToken: ZodString;
  expiresAt: ZodString;
  refreshAfter: ZodString;
  scopeHash: ZodString;
  authorizationRevision: ZodString;
  credentialGeneration: ZodString;
  cli: ZodDiscriminatedUnion<[ZodObject<{
    provider: ZodLiteral<"feishu">;
    appId: ZodString;
    teamBrand: ZodEnum<{
      feishu: "feishu";
      lark: "lark";
    }>;
    outboxContext: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
      provider: ZodLiteral<"feishu">;
      sessionKind: ZodEnum<{
        channel: "channel";
        thread: "thread";
      }>;
      chatId: ZodString;
      threadId: ZodOptional<ZodString>;
    }, $strict>, ZodObject<{
      provider: ZodLiteral<"slack">;
      sessionKind: ZodEnum<{
        channel: "channel";
        thread: "thread";
      }>;
      channelId: ZodString;
      threadTs: ZodOptional<ZodString>;
    }, $strict>], "provider">>;
  }, $strict>, ZodObject<{
    provider: ZodLiteral<"slack">;
    teamId: ZodString;
    botUserId: ZodString;
    outboxContext: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
      provider: ZodLiteral<"feishu">;
      sessionKind: ZodEnum<{
        channel: "channel";
        thread: "thread";
      }>;
      chatId: ZodString;
      threadId: ZodOptional<ZodString>;
    }, $strict>, ZodObject<{
      provider: ZodLiteral<"slack">;
      sessionKind: ZodEnum<{
        channel: "channel";
        thread: "thread";
      }>;
      channelId: ZodString;
      threadTs: ZodOptional<ZodString>;
    }, $strict>], "provider">>;
  }, $strict>, ZodObject<{
    provider: ZodLiteral<"github">;
    connectionId: ZodString;
    authority: ZodEnum<{
      "context-tree": "context-tree";
      "user-task": "user-task";
    }>;
  }, $strict>], "provider">;
}, $strict>, ZodObject<{
  type: ZodLiteral<"runtime:credential:result">;
  requestId: ZodString;
  status: ZodLiteral<"rejected">;
  code: ZodEnum<{
    binding_inactive: "binding_inactive";
    credential_scope_denied: "credential_scope_denied";
    credential_stale: "credential_stale";
    execution_closed: "execution_closed";
    execution_expired: "execution_expired";
    execution_unknown: "execution_unknown";
    grant_mismatch: "grant_mismatch";
    owner_unavailable: "owner_unavailable";
    provider_mismatch: "provider_mismatch";
  }>;
}, $strict>], "status">;
type RuntimeCredentialResult = output$1<typeof RuntimeCredentialResultSchema>;
declare const RuntimeCredentialRevokedFrameSchema: ZodObject<{
  type: ZodLiteral<"runtime:credential:revoked">;
  executionId: ZodString;
  code: ZodEnum<{
    authorization_revoked: "authorization_revoked";
    connection_replaced: "connection_replaced";
    execution_closed: "execution_closed";
    owner_lost: "owner_lost";
    policy_changed: "policy_changed";
  }>;
}, $strict>;
type RuntimeCredentialRevokedFrame = output$1<typeof RuntimeCredentialRevokedFrameSchema>;
declare const RuntimeCredentialServerFrameSchema: ZodDiscriminatedUnion<[ZodDiscriminatedUnion<[ZodObject<{
  type: ZodLiteral<"runtime:execution:result">;
  requestId: ZodString;
  status: ZodLiteral<"succeeded">;
  executionId: ZodString;
  expiresAt: ZodString;
  providers: ZodArray<ZodDiscriminatedUnion<[ZodObject<{
    provider: ZodLiteral<"feishu">;
    bindingId: ZodString;
    cli: ZodObject<{
      provider: ZodLiteral<"feishu">;
      appId: ZodString;
      teamBrand: ZodEnum<{
        feishu: "feishu";
        lark: "lark";
      }>;
      outboxContext: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
        provider: ZodLiteral<"feishu">;
        sessionKind: ZodEnum<{
          channel: "channel";
          thread: "thread";
        }>;
        chatId: ZodString;
        threadId: ZodOptional<ZodString>;
      }, $strict>, ZodObject<{
        provider: ZodLiteral<"slack">;
        sessionKind: ZodEnum<{
          channel: "channel";
          thread: "thread";
        }>;
        channelId: ZodString;
        threadTs: ZodOptional<ZodString>;
      }, $strict>], "provider">>;
    }, $strict>;
  }, $strict>, ZodObject<{
    provider: ZodLiteral<"slack">;
    bindingId: ZodString;
    cli: ZodObject<{
      provider: ZodLiteral<"slack">;
      teamId: ZodString;
      botUserId: ZodString;
      outboxContext: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
        provider: ZodLiteral<"feishu">;
        sessionKind: ZodEnum<{
          channel: "channel";
          thread: "thread";
        }>;
        chatId: ZodString;
        threadId: ZodOptional<ZodString>;
      }, $strict>, ZodObject<{
        provider: ZodLiteral<"slack">;
        sessionKind: ZodEnum<{
          channel: "channel";
          thread: "thread";
        }>;
        channelId: ZodString;
        threadTs: ZodOptional<ZodString>;
      }, $strict>], "provider">>;
    }, $strict>;
  }, $strict>, ZodObject<{
    provider: ZodLiteral<"github">;
    bindingId: ZodString;
    cli: ZodObject<{
      provider: ZodLiteral<"github">;
      connectionId: ZodString;
      authority: ZodEnum<{
        "context-tree": "context-tree";
        "user-task": "user-task";
      }>;
    }, $strict>;
  }, $strict>], "provider">>;
  sessionCliProof: ZodOptional<ZodObject<{
    proofId: ZodString;
    token: ZodString;
  }, $strict>>;
  services: ZodOptional<ZodArray<ZodDiscriminatedUnion<[ZodObject<{
    service: ZodLiteral<"web">;
    scopes: ZodArray<ZodEnum<{
      "web:fetch": "web:fetch";
      "web:search": "web:search";
    }>>;
  }, $strict>, ZodObject<{
    service: ZodLiteral<"mcp">;
    scopes: ZodArray<ZodEnum<{
      "mcp:tools": "mcp:tools";
    }>>;
  }, $strict>, ZodObject<{
    service: ZodLiteral<"context-tree">;
    scopes: ZodTuple<[ZodLiteral<"context-tree:git">], null>;
  }, $strict>], "service">>>;
}, $strict>, ZodObject<{
  type: ZodLiteral<"runtime:execution:result">;
  requestId: ZodString;
  status: ZodLiteral<"rejected">;
  code: ZodEnum<{
    agent_mismatch: "agent_mismatch";
    capability_unsupported: "capability_unsupported";
    execution_authority_denied: "execution_authority_denied";
    execution_not_ready: "execution_not_ready";
    execution_source_invalid: "execution_source_invalid";
    owner_unavailable: "owner_unavailable";
    placement_stale: "placement_stale";
    sandbox_mismatch: "sandbox_mismatch";
  }>;
}, $strict>], "status">, ZodDiscriminatedUnion<[ZodObject<{
  type: ZodLiteral<"runtime:credential:result">;
  requestId: ZodString;
  status: ZodLiteral<"succeeded">;
  executionId: ZodString;
  grantId: ZodString;
  provider: ZodEnum<{
    feishu: "feishu";
    github: "github";
    slack: "slack";
  }>;
  bindingId: ZodString;
  opaqueToken: ZodString;
  expiresAt: ZodString;
  refreshAfter: ZodString;
  scopeHash: ZodString;
  authorizationRevision: ZodString;
  credentialGeneration: ZodString;
  cli: ZodDiscriminatedUnion<[ZodObject<{
    provider: ZodLiteral<"feishu">;
    appId: ZodString;
    teamBrand: ZodEnum<{
      feishu: "feishu";
      lark: "lark";
    }>;
    outboxContext: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
      provider: ZodLiteral<"feishu">;
      sessionKind: ZodEnum<{
        channel: "channel";
        thread: "thread";
      }>;
      chatId: ZodString;
      threadId: ZodOptional<ZodString>;
    }, $strict>, ZodObject<{
      provider: ZodLiteral<"slack">;
      sessionKind: ZodEnum<{
        channel: "channel";
        thread: "thread";
      }>;
      channelId: ZodString;
      threadTs: ZodOptional<ZodString>;
    }, $strict>], "provider">>;
  }, $strict>, ZodObject<{
    provider: ZodLiteral<"slack">;
    teamId: ZodString;
    botUserId: ZodString;
    outboxContext: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
      provider: ZodLiteral<"feishu">;
      sessionKind: ZodEnum<{
        channel: "channel";
        thread: "thread";
      }>;
      chatId: ZodString;
      threadId: ZodOptional<ZodString>;
    }, $strict>, ZodObject<{
      provider: ZodLiteral<"slack">;
      sessionKind: ZodEnum<{
        channel: "channel";
        thread: "thread";
      }>;
      channelId: ZodString;
      threadTs: ZodOptional<ZodString>;
    }, $strict>], "provider">>;
  }, $strict>, ZodObject<{
    provider: ZodLiteral<"github">;
    connectionId: ZodString;
    authority: ZodEnum<{
      "context-tree": "context-tree";
      "user-task": "user-task";
    }>;
  }, $strict>], "provider">;
}, $strict>, ZodObject<{
  type: ZodLiteral<"runtime:credential:result">;
  requestId: ZodString;
  status: ZodLiteral<"rejected">;
  code: ZodEnum<{
    binding_inactive: "binding_inactive";
    credential_scope_denied: "credential_scope_denied";
    credential_stale: "credential_stale";
    execution_closed: "execution_closed";
    execution_expired: "execution_expired";
    execution_unknown: "execution_unknown";
    grant_mismatch: "grant_mismatch";
    owner_unavailable: "owner_unavailable";
    provider_mismatch: "provider_mismatch";
  }>;
}, $strict>], "status">, ZodObject<{
  type: ZodLiteral<"runtime:execution:closed">;
  requestId: ZodString;
  executionId: ZodString;
  status: ZodEnum<{
    rejected: "rejected";
    succeeded: "succeeded";
  }>;
  code: ZodOptional<ZodEnum<{
    execution_unknown: "execution_unknown";
    owner_unavailable: "owner_unavailable";
  }>>;
}, $strict>, ZodDiscriminatedUnion<[ZodObject<{
  type: ZodLiteral<"runtime:proxy:ticket:result">;
  requestId: ZodString;
  status: ZodLiteral<"succeeded">;
  executionId: ZodString;
  ticket: ZodString;
  expiresAt: ZodString;
  path: ZodLiteral<"/api/v1/runtime/provider-proxy">;
}, $strict>, ZodObject<{
  type: ZodLiteral<"runtime:proxy:ticket:result">;
  requestId: ZodString;
  status: ZodLiteral<"rejected">;
  code: ZodEnum<{
    capability_unsupported: "capability_unsupported";
    execution_closed: "execution_closed";
    execution_unknown: "execution_unknown";
    owner_unavailable: "owner_unavailable";
  }>;
}, $strict>], "status">, ZodDiscriminatedUnion<[ZodObject<{
  type: ZodLiteral<"runtime:mcp:gateway:result">;
  requestId: ZodString;
  status: ZodLiteral<"succeeded">;
  executionId: ZodString;
  token: ZodString;
  expiresAt: ZodString;
  path: ZodLiteral<"/api/v1/mcp">;
}, $strict>, ZodObject<{
  type: ZodLiteral<"runtime:mcp:gateway:result">;
  requestId: ZodString;
  status: ZodLiteral<"rejected">;
  code: ZodEnum<{
    capability_unsupported: "capability_unsupported";
    execution_closed: "execution_closed";
    execution_unknown: "execution_unknown";
    owner_unavailable: "owner_unavailable";
    service_not_granted: "service_not_granted";
  }>;
}, $strict>], "status">, ZodDiscriminatedUnion<[ZodObject<{
  type: ZodLiteral<"runtime:web:gateway:result">;
  requestId: ZodString;
  status: ZodLiteral<"succeeded">;
  executionId: ZodString;
  token: ZodString;
  expiresAt: ZodString;
}, $strict>, ZodObject<{
  type: ZodLiteral<"runtime:web:gateway:result">;
  requestId: ZodString;
  status: ZodLiteral<"rejected">;
  code: ZodEnum<{
    capability_unsupported: "capability_unsupported";
    execution_closed: "execution_closed";
    execution_unknown: "execution_unknown";
    owner_unavailable: "owner_unavailable";
    service_not_granted: "service_not_granted";
  }>;
}, $strict>], "status">, ZodObject<{
  type: ZodLiteral<"runtime:credential:revoked">;
  executionId: ZodString;
  code: ZodEnum<{
    authorization_revoked: "authorization_revoked";
    connection_replaced: "connection_replaced";
    execution_closed: "execution_closed";
    owner_lost: "owner_lost";
    policy_changed: "policy_changed";
  }>;
}, $strict>], "type">;
type RuntimeCredentialServerFrame = output$1<typeof RuntimeCredentialServerFrameSchema>;
declare const SessionCliCreateRequestSchema: ZodObject<{
  messageId: ZodString;
  message: ZodString;
  model: ZodOptional<ZodString>;
  reasoningEffort: ZodOptional<ZodString>;
  maxDurationMs: ZodOptional<ZodNumber>;
}, $strict>;
declare const SessionCliSendRequestSchema: ZodObject<{
  messageId: ZodString;
  targetSessionId: ZodString;
  message: ZodString;
}, $strict>;
declare const SessionCliCommandResponseSchema: ZodObject<{
  messageId: ZodString;
  status: ZodEnum<{
    accepted: "accepted";
    rejected: "rejected";
    unknown: "unknown";
    unreachable: "unreachable";
  }>;
  sessionId: ZodOptional<ZodString>;
  code: ZodOptional<ZodString>;
}, $strict>;
declare const SessionCliListQuerySchema: ZodObject<{
  recursive: ZodDefault<ZodBoolean>;
  limit: ZodDefault<ZodNumber>;
  cursor: ZodOptional<ZodString>;
  since: ZodOptional<ZodString>;
}, $strict>;
declare const SessionCliListResponseSchema: ZodObject<{
  items: ZodArray<ZodObject<{
    sessionId: ZodString;
    parentSessionId: ZodString;
    createdAt: ZodString;
    lastMessageAt: ZodString;
    lastDeliveryOutcome: ZodEnum<{
      accepted: "accepted";
      rejected: "rejected";
      unknown: "unknown";
      unreachable: "unreachable";
    }>;
    taskPreview: ZodString;
  }, $strict>>;
  nextCursor: ZodOptional<ZodString>;
}, $strict>;
/**
 * The Server-minted proof a managed Runtime hands to the in-Session CLI. The token is a bearer
 * credential bound to the exact Session/placement/execution connection; it is delivered only over
 * authenticated runtime channels (Local reconcile, Cloud verified frames) and worker stdin.
 */
declare const SessionCliProofGrantSchema: ZodObject<{
  proofId: ZodString;
  token: ZodString;
}, $strict>;
type SessionCliProofGrant = output$1<typeof SessionCliProofGrantSchema>;
type SessionCliCreateRequest = output$1<typeof SessionCliCreateRequestSchema>;
type SessionCliSendRequest = output$1<typeof SessionCliSendRequestSchema>;
type SessionCliCommandResponse = output$1<typeof SessionCliCommandResponseSchema>;
type SessionCliListQuery = output$1<typeof SessionCliListQuerySchema>;
type SessionCliListResponse = output$1<typeof SessionCliListResponseSchema>;
declare const TurnActivityResultSchema: ZodObject<{
  type: ZodLiteral<"turn:activity:result">;
  requestId: ZodString;
  turnId: ZodString;
  sequence: ZodNumber;
  status: ZodEnum<{
    already_recorded: "already_recorded";
    recorded: "recorded";
    stale_generation: "stale_generation";
    unsupported_capability: "unsupported_capability";
  }>;
}, $strict>;
type TurnActivityResult = output$1<typeof TurnActivityResultSchema>;
/** Business parameters shared by every hop; unknown fields are rejected. */
declare const WebSearchParamsSchema: ZodObject<{
  query: ZodString;
  limit: ZodDefault<ZodNumber>;
  domains: ZodOptional<ZodArray<ZodString>>;
  timeRange: ZodOptional<ZodEnum<{
    day: "day";
    month: "month";
    week: "week";
    year: "year";
  }>>;
  language: ZodOptional<ZodString>;
  depth: ZodDefault<ZodEnum<{
    advanced: "advanced";
    basic: "basic";
  }>>;
}, $strict>;
type WebSearchParams = output$1<typeof WebSearchParamsSchema>;
declare const WebFetchParamsSchema: ZodObject<{
  urls: ZodArray<ZodString>;
  depth: ZodDefault<ZodEnum<{
    advanced: "advanced";
    basic: "basic";
  }>>;
}, $strict>;
type WebFetchParams = output$1<typeof WebFetchParamsSchema>;
/** Trusted Runner → Server. Identity fields are fence-checked, never trusted as claims. */
declare const WebSearchExecutionRequestSchema: ZodObject<{
  query: ZodString;
  limit: ZodDefault<ZodNumber>;
  domains: ZodOptional<ZodArray<ZodString>>;
  timeRange: ZodOptional<ZodEnum<{
    day: "day";
    month: "month";
    week: "week";
    year: "year";
  }>>;
  language: ZodOptional<ZodString>;
  depth: ZodDefault<ZodEnum<{
    advanced: "advanced";
    basic: "basic";
  }>>;
  protocolVersion: ZodLiteral<1>;
  executionId: ZodString;
  toolCallId: ZodString;
}, $strict>;
type WebSearchExecutionRequest = output$1<typeof WebSearchExecutionRequestSchema>;
declare const WebFetchExecutionRequestSchema: ZodObject<{
  urls: ZodArray<ZodString>;
  depth: ZodDefault<ZodEnum<{
    advanced: "advanced";
    basic: "basic";
  }>>;
  protocolVersion: ZodLiteral<1>;
  executionId: ZodString;
  toolCallId: ZodString;
}, $strict>;
type WebFetchExecutionRequest = output$1<typeof WebFetchExecutionRequestSchema>;
declare const WebSearchResultSchema: ZodObject<{
  requestId: ZodString;
  status: ZodLiteral<"ok">;
  retrievedAt: ZodString;
  effectiveDepth: ZodEnum<{
    advanced: "advanced";
    basic: "basic";
  }>;
  results: ZodArray<ZodObject<{
    sourceId: ZodString;
    title: ZodString;
    url: ZodString;
    snippet: ZodString;
    publishedAt: ZodOptional<ZodString>;
  }, $strict>>;
}, $strict>;
type WebSearchResult = output$1<typeof WebSearchResultSchema>;
declare const WebFetchResultSchema: ZodObject<{
  requestId: ZodString;
  status: ZodEnum<{
    failed: "failed";
    ok: "ok";
    partial: "partial";
  }>;
  retrievedAt: ZodString;
  effectiveDepth: ZodEnum<{
    advanced: "advanced";
    basic: "basic";
  }>;
  results: ZodArray<ZodUnion<readonly [ZodObject<{
    status: ZodEnum<{
      ok: "ok";
      partial: "partial";
    }>;
    url: ZodString;
    finalUrl: ZodNullable<ZodString>;
    contentKind: ZodLiteral<"extracted">;
    completeness: ZodLiteral<"unknown">;
    content: ZodString;
    sourceFetchedAt: ZodNullable<ZodString>;
    previewTruncated: ZodBoolean;
    artifactTruncated: ZodBoolean;
    upstreamTruncated: ZodNullable<ZodBoolean>;
  }, $strict>, ZodObject<{
    status: ZodLiteral<"failed">;
    url: ZodString;
    code: ZodString;
    retryable: ZodBoolean;
  }, $strict>]>>;
}, $strict>;
type WebFetchResult = output$1<typeof WebFetchResultSchema>;
declare const WebToolErrorCodeSchema: ZodEnum<{
  aborted: "aborted";
  credential_scope_denied: "credential_scope_denied";
  execution_closed: "execution_closed";
  execution_unknown: "execution_unknown";
  idempotency_conflict: "idempotency_conflict";
  insufficient_credit: "insufficient_credit";
  invalid_request: "invalid_request";
  provider_protocol_error: "provider_protocol_error";
  rate_limited: "rate_limited";
  request_in_progress: "request_in_progress";
  request_uncertain: "request_uncertain";
  response_too_large: "response_too_large";
  result_unavailable: "result_unavailable";
  timeout: "timeout";
  unauthenticated: "unauthenticated";
  unknown: "unknown";
  upstream_error: "upstream_error";
  upstream_unavailable: "upstream_unavailable";
  web_disabled: "web_disabled";
}>;
type WebToolErrorCode = output$1<typeof WebToolErrorCodeSchema>;
declare namespace index_d_exports {
  export { ACCOUNT_IDENTITY_FILE_NAME, AGENT_RUNTIME_BINDING_MAX_BYTES, AGENT_RUNTIME_CONTRACT_VERSION, AGENT_RUNTIME_DESCRIPTION_MAX_BYTES, AGENT_RUNTIME_ID_MAX_BYTES, AGENT_RUNTIME_TEXT_MAX_BYTES, AccessTokenLease, AccessTokenProvider, AccountIdentityRotation, AdmissionController, AdmissionDecision, AdmissionLimits, AdmissionPhase, AdmissionReservation, AdmissionSnapshot, AgentAbortRequest, AgentApprovalResponse, AgentHostedToolCall, AgentHostedToolContent, AgentHostedToolDefinition, AgentHostedToolError, AgentHostedToolHandler, AgentHostedToolResult, AgentHostedTools, AgentInput, AgentInputItem, AgentInteractionRequest, AgentInteractionResponse, AgentOutputItem, AgentPromptRequest, AgentProviderError, AgentProviderRunContext, AgentProviderRunEvent, AgentProviderRunResult, AgentQuestionResponse, AgentRunConfiguration, AgentRunError, AgentRunErrorCode, AgentRunId, AgentRunResult, AgentRunStatus, AgentRuntime, AgentRuntimeBinding, AgentRuntimeCapabilities, AgentRuntimeCliInstallation, AgentRuntimeConfigurationOptionsRequest, AgentRuntimeError, AgentRuntimeErrorCode, AgentRuntimeEvent, AgentRuntimeEventSink, AgentRuntimeExecutableDiscoveryError, AgentRuntimeExecutableNotFoundError, AgentRuntimeExecutableSource, AgentRuntimeFactory, AgentRuntimeLifecycleState, AgentRuntimeManifest, AgentRuntimePaths, AgentRuntimePolicy, AgentRuntimeProbeIssue, AgentRuntimeProbeRequest, AgentRuntimeProbeResult, AgentRuntimeProviderRegistration, AgentRuntimeProviderRegistry, AgentRuntimeProviderUnavailableError, AgentRuntimeState, AgentRuntimeWorkspace, AgentSteerRequest, AgentTextInputItem, AgentTextOutputItem, AgentTurnErrorReporter, AgentTurnFailure, AgentTurnRunner, AgentTurnRunnerOptions, AgentUsage, AgentWorkspaceManager, AgentWorkspaceManagerOptions, BaseAgentRuntime, BaseAgentRuntimeOptions, BoundAccountComputerResolution, CLAUDE_CODE_AGENT_RUNTIME_MANIFEST, CLAUDE_CODE_MAX_LINE_BYTES, CLAUDE_CODE_MAX_STDERR_BYTES, CLIENT_ERROR_REPORT_TIMEOUT_MS, CODEX_AGENT_RUNTIME_APP_SERVER_ARGS, CODEX_AGENT_RUNTIME_MANIFEST, CODEX_APP_SERVER_MAX_LINE_BYTES, CODEX_APP_SERVER_MAX_STDERR_BYTES, CODEX_APP_SERVER_REQUEST_TIMEOUT_MS, COMPUTER_IDENTITY_FILE_NAME, CONTEXT_TREE_PACKAGED_SKILL_DIRECTORIES, CREDENTIALS_FILE_NAME, ClaudeCodeAgentRuntime, ClaudeCodeAgentRuntimeFactory, ClaudeCodeAgentRuntimeFactoryOptions, ClaudeCodeProcess, ClaudeCodeProcessClient, ClaudeCodeProcessError, ClaudeCodeProcessResult, ClaudeCodeProcessSpawnOptions, ClaudeCodeSpawnOptions, ClientErrorReportMetadata, ClientLogBindings, ClientLogger, ClientLoggerServiceOptions, ClientRuntime, ClientRuntimeOptions, ClientRuntimeProviderStartError, CloudSandboxCommandOptions, CloudSandboxCredentialBridge, CloudSandboxCredentialBridgeOpenOptions, CodexAgentRuntime, CodexAgentRuntimeFactory, CodexAgentRuntimeFactoryOptions, CodexAppServerClient, CodexAppServerError, CodexAppServerMessage, CodexAppServerProcess, CodexAppServerRequest, CodexProcessSpawnOptions, CodexSpawnOptions, ComposedClientRuntime, ComputerIdentity, ContextTreeExecFile, ContextTreeManager, ContextTreeManagerOptions, ContextTreePackage, ContextTreeStatus, CreateAgentRuntimeRequest, CreateClientRuntimeOptions, CreateLoggerOptions, CustodyResult, DEFAULT_RUNTIME_RETRY_POLICY, DeliveryDecision, DurableFailure, DurableRetryability, DurableWorkKind, DurableWorkRecord, DurableWorkStatus, ExecuteProviderCliTurnPlanOptions, ExpectedSkillBundle, FeishuTokenExchangeError, FileRuntimeDurabilityStore, IgnoredProviderCliCandidate, ImCredentialEnvironmentError, ImCredentialEnvironmentManager, ImCredentialEnvironmentManagerOptions, ImCredentialGrantSubject, ImResourceFetcher, IntegrationCliId, IntegrationCliInstallation, InteractiveCodexAppServerClient, JsonPrimitive, JsonValue, LiveTurnOwner, LocalComputerConfigurationInspection, LocalConfigurationStatus, LocalSessionBinding, MACHINE_CREDENTIALS_FILE_NAME, MAX_PROVIDER_CLI_EXECUTABLE_BYTES, MAX_PROVIDER_CLI_TURN_IDENTITY_BYTES, MAX_PROVIDER_CLI_TURN_PLAN_BYTES, MachineComputerCredential, ContextTreeStatus as ManagedContextTreeStatus, ManagedEnvironment, ManagedSessionContext, MemoryRuntimeDurabilityStore, OpenTagApi, OpenTagApiError, OpenTagHomeLayout, PI_AGENT_RUNTIME_MANIFEST, PI_RPC_MAX_LINE_BYTES, PI_RPC_MAX_STDERR_BYTES, PI_RPC_REQUEST_TIMEOUT_MS, PROCESS_ERROR_FLUSH_WAIT_MS, PROCESS_ERROR_REPORT_WAIT_MS, PROVIDER_CLI_CATALOG, PROVIDER_CLI_LOCK_BUSY_MAX_ATTEMPTS, PROVIDER_CLI_LOCK_BUSY_RETRY_DELAY_MS, PROVIDER_CLI_SELECTION_SCHEMA_VERSION, PROVIDER_CLI_TURN_PLAN_SCHEMA_VERSION, PackedSkillDirectory, PiAgentRuntime, PiAgentRuntimeFactory, PiAgentRuntimeFactoryOptions, PiRpcClient, PiRpcError, PiRpcProcess, PiRpcProcessSpawnOptions, PiRpcSpawnOptions, PlatformSource, PreparedImCredentialEnvironment, PreparedRuntimeCredentialEnvironment, PreparedWebToolsLaunch, ProbeAgentRuntimeCliInstallationsOptions, ProbeIntegrationCliInstallationsOptions, ProcessErrorOrigin, ProcessErrorReportingOptions, ProcessErrorTarget, ProtectedWorkCount, ProtectedWorkSnapshot, ProviderCliAccountError, ProviderCliAccountLayout, ProviderCliArchiveError, ProviderCliCandidate, ProviderCliCandidateReport, ProviderCliCatalogArtifact, ProviderCliCatalogEntry, ProviderCliDetectOptions, ProviderCliDetection, ProviderCliDiagnostic, ProviderCliDiagnosticCode, ProviderCliEnsureAction, ProviderCliEnsureOptions, ProviderCliEnsureResult, ProviderCliExecFile, ProviderCliExecutableFormat, ProviderCliFetcher, ProviderCliFileIdentity, ProviderCliGlobalCommandStatus, ProviderCliInspection, ProviderCliInstallError, ProviderCliInstaller, ProviderCliInstallerOptions, ProviderCliLocalState, ProviderCliLockBusyError, ProviderCliManagedInstall, ProviderCliManager, ProviderCliManagerDeps, ProviderCliPhase, ProviderCliPhaseEvent, ProviderCliPhaseRecord, ProviderCliPreparedTurnPlan, ProviderCliProbeContract, ProviderCliProbeOutcome, ProviderCliProvider, ProviderCliReconciler, ProviderCliReconcilerOptions, ProviderCliSelection, ProviderCliSelectionRecord, ProviderCliTrust, ProviderCliTurnLauncherSpec, ProviderCliTurnPlan, ProviderCliTurnPlanCommand, ProviderCliTurnPlanError, ProviderCliTurnPlanErrorCode, ProviderCliTurnPlanManager, ProviderCliTurnPlanManagerDeps, ProviderCliTurnPlanPrepareInput, ProviderCliValidationRequest, ProviderCliValidationRunner, ProviderCliValidationRunnerOptions, ProviderCliWarning, ProviderCliWarningCode, RUNNER_CLI_NAME, RUNNER_IDENTITY_SCHEMA_VERSION, RUNTIME_CREDENTIAL_CAPABILITY, RUNTIME_EXECUTION_MAX_LIFETIME_MS, RUNTIME_PROVIDER_ORIGIN_HEADER, RUNTIME_PROVIDER_PROXY_CAPABILITY, RUNTIME_PROVIDER_PROXY_PATH, RUNTIME_PROXY_ALLOWED_CONNECT_HOSTS, RUNTIME_PROXY_DATA_BINARY_FRAME_MAX_BYTES, RUNTIME_PROXY_DATA_CHUNK_BYTES, RUNTIME_PROXY_DATA_HEADER_MAX_BYTES, RUNTIME_PROXY_DATA_INITIAL_CREDIT_BYTES, RUNTIME_PROXY_DATA_MAX_STREAMS, RUNTIME_PROXY_GIT_HELPER_MARKER, RUNTIME_PROXY_HANDLE_PATH_PREFIX, RUNTIME_PROXY_PROVIDERS, RUNTIME_PROXY_SHIM_MARKER, RUNTIME_PROXY_TICKET_TTL_MS, RUNTIME_WEB_TOOLS_CAPABILITY, ReadBundleBodyOptions, RecordedInput, ReportClientErrorOptions, ResolveAgentRuntimeExecutableOptions, ResolvedAgentRuntimeExecutable, ResolvedClaudeCodeFactoryOptions, ResolvedCodexFactoryOptions, ResolvedPiFactoryOptions, ResumeAgentRuntimeRequest, RuntimeBusinessFrame, RuntimeConnection, RuntimeConnectionError, RuntimeConnectionErrorCategory, RuntimeConnectionOptions, RuntimeConnectionState, RuntimeCredentialEnvironmentManager, RuntimeCredentialEnvironmentManagerOptions, RuntimeCredentialGrant, RuntimeCredentialMode, RuntimeCredentialPrepareSubject, RuntimeCredentialRelay, RuntimeCredentialRelayError, RuntimeCredentialRelayErrorCode, RuntimeCredentialRelayOptions, RuntimeCredentialResult, RuntimeCredentialRevoked, RuntimeCredentialRunSubject, RuntimeCredentialServerFrame, RuntimeDurabilityFailure, RuntimeDurabilityMetrics, RuntimeDurabilityMetricsSnapshot, RuntimeDurabilityStore, RuntimeExecutionOpenRequest, RuntimeExecutionOpenResult, RuntimeExecutionProvider, RuntimeExecutionSandbox, RuntimeExecutionService, RuntimeExecutionSource, RuntimeLocalPolicy, RuntimePreparation, RuntimeProxyAdapterStreamRequest, RuntimeProxyCliMetadata, RuntimeProxyDataConnectInput, RuntimeProxyDataConnection, RuntimeProxyDataConnectionFactory, RuntimeProxyDataConnectionLike, RuntimeProxyDataConnectionOptions, RuntimeProxyDataError, RuntimeProxyDataErrorCode, RuntimeProxyEnvironment, RuntimeProxyEnvironmentInput, RuntimeProxyExecutionLayout, RuntimeProxyLoopbackAdapter, RuntimeProxyLoopbackAdapterOptions, RuntimeProxyLoopbackCaMaterial, RuntimeProxyLoopbackError, RuntimeProxyMaterialStore, RuntimeProxyOpenStreamRequest, RuntimeProxyProvider, RuntimeProxyStreamResponse, RuntimeQueueLimits, RuntimeRelayScheduler, RuntimeRetryPolicy, RuntimeRetryScheduler, RuntimeSendError, RuntimeSendErrorCode, RuntimeSendOptions, RuntimeSendPriority, RuntimeStorageError, SERVER_HEALTH_TIMEOUT_MS, SESSION_BINDING_SCHEMA_VERSION, SESSION_RECORDED_INPUT_LIMIT, SKILL_CONTENT_SIDECAR_FILE, SKILL_PULL_BUNDLE_TIMEOUT_MS, SKILL_SYNC_DEFAULT_BUDGET_MS, ServerHealthConfigurationError, ServerHealthHttpError, ServerHealthNetworkError, ServerHealthResponseError, ServerHealthTimeoutError, ServerRuntimeDurabilityStore, ServerRuntimeDurabilityStoreOptions, SessionActivity, SessionActivityPhase, SessionBindingConflictError, SessionBindingStore, SessionBindingStoreOptions, SessionCliProofManager, SessionMessageInbox, SessionMessageInboxOptions, SessionMessageTurnContext, SessionPreparationResult, SessionProtectedWorkSnapshot, SessionReconciler, SessionReconcilerOptions, SessionRuntimeManager, SessionRuntimeManagerOptions, SessionRuntimeState, SessionTurnIdentity, SkillArchiveError, SkillArchiveErrorCode, SkillDirectoryMarkerInput, SkillSyncAgentInput, SkillSyncApi, SkillSyncManager, SkillSyncManagerOptions, SkillSyncResult, SkillSyncStatus, StoredAccountIdentity, StoredAccountIdentitySchema, StoredCredentials, StoredMachineCredentials, StoredSessionCliProof, TURN_TRACE_BATCH_SOFT_LIMIT_BYTES, TURN_TRACE_MAX_BUFFER_BYTES, TURN_TRACE_MAX_BUFFER_EVENTS, TURN_TRACE_SEND_DEADLINE_MS, TokenProviderOptions, TurnCustodyOwner, TurnCustodyOwnerOptions, TurnReportOwner, TurnReportOwnerOptions, TurnReportOwnerStoppedError, TurnReportRearmClaim, TurnReportSubmitOptions, TurnReportTerminalStatus, TurnTraceBuffer, TurnTraceBufferOptions, TurnTraceSummary, UnresolvedTurn, UnresolvedTurnPhase, UpdateManager, UpdateManagerOptions, UpdaterAttempt, UpdaterRecoveryStatus, UpdaterStateName, UpdaterStateSnapshot, WebGatewayDispatch, WebGatewayDispatchError, WebToolsClientError, WebToolsGatewayServer, WebToolsGatewayServerOptions, WebToolsServerClient, WebToolsServerClientOptions, accountIdentityMatchesCredentials, accountIdentityPath, agentRuntimePaths, allocateComputerIdentity, assembleContextTreeSkills, assertRealDirectory, assertWithin, buildAgentInput, buildClientErrorReport, buildRuntimeProxyEnvironment, buildSessionMessageInput, captureSlackDeploy, catalogExecutableDigests, checkServerHealth, classifyLarkAuthStatus, classifySlackAuthTest, classifySpawnFailure, claudeCodeAgentRuntimeEnvironment, claudeCodeProcessEnvironment, codexAgentRuntimeEnvironment, codexDesktopAppBinDirs, computeFileIdentity, computeTargetFingerprint, computerIdentityPath, configureClientLoggerContext, configureClientLoggerForService, copyIsolatedPiConfig, createClientRuntime, createLogger, createProviderCliFetcher, createRunnerIdentity, credentialsFingerprint, credentialsPath, defaultProviderCliExecFile, defaultProviderCliFetcher, defaultRuntimeProxyDataConnectionFactory, defaultRuntimeRetryScheduler, deriveProviderCliHomeNamespace, deriveProviderCliRunKey, deriveProviderCliSessionKey, deriveProviderCliValidationRequestKey, deriveRuntimeKey, describePlatform, detectProviderCliCandidates, ensurePrivateDirectory, exchangeFeishuTenantToken, executableFormatSupportsHost, executeProviderCliTurnPlan, extractBoundedJson, extractProviderCliExecutable, extractSkillArchive, findCatalogArtifact, findProviderCliCatalogEntry, generateExecutionCa, hashSkillDirectory, inspectExecutableFormat, inspectGlobalCommand, inspectLocalComputerConfiguration, inspectProviderCliLauncher, installProcessErrorReporting, isSkillMaterializationTarget, isSyncedWorkspace, iterateAgentRuntimeExecutables, linuxAmd64ProviderCliPlans, machineCredentialsPath, mapProviderCliLocalStateToReadiness, markSkillDirectoryManaged, normalizeServerUrl, packSkillDirectory, parseProviderCliTurnPlan, parseProviderCliTurnRunnerArgv, parseRunnerCliArgv, parseRunnerIdentity, parseRuntimeCredentialServerFrame, piAgentRuntimeEnvironment, prepareContextTreeHome, prepareSlackCallbackUpdate, probeAgentRuntimeCliInstallations, probeIntegrationCliInstallations, probeProviderCliExecutable, probeRunnerTools, providerCliArtifactId, providerCliCommandForProvider, providerCliLauncherPath, providerCliLockFilePath, providerCliProbeEnvironment, providerCliSelectionTargetPath, providerCliStateFilePath, providerCliVersionDirPath, providerReadiness, rankProviderCliCandidates, readAccountIdentity, readBundleBody, readComputerIdentity, readCredentials, readDurableJson, readMachineCredentials, readMachineCredentialsStrict, readPrivateJson, readProviderCliSelection, readProviderCliTurnPlan, readSecureFile, readSessionCliProofFile, reconcileProviderCliLauncher, reconcileProviderCliShim, redactAcceptanceRecord, removeAccountIdentity, renderManagedSystemPrompt, renderProviderCliLauncher, renderProviderCliShim, renderProviderCliTurnLauncher, renderRuntimeProxyGitCredentialHelper, renderRuntimeProxyShim, reportClientError, requireProviderCliCatalogEntry, resolveAccountHome, resolveAgentRuntimeExecutable, resolveBoundAccountComputer, resolveCodexHome, resolveComputerIdentity, resolveContextTreeHome, resolveContextTreePackage, resolveMaterializationWorkspace, resolveOpenTagHome, resolveOpenTagHomeLayout, resolvePiHome, resolveProviderCliAccountLayout, resolveProviderCliArtifactUrl, resolveProviderCliTurnRunnerInvocation, resolveWebToolsExtensionPath, resolvedClaudeCodeFactory, resolvedCodexFactory, resolvedPiFactory, retryDelay, retryExhausted, rotateAccountIdentityFingerprint, runContextTreeCli, runProviderCliTurnRunner, runRunnerAcceptance, runRunnerCli, runSlackManagement, serializeEnvironment, sessionBindingPath, skillRootForProvider, slackManagementEnvironment, slackManagementHome, snapshotPath, storeBoundAccountComputer, validatePrivateDirectory, verifyProviderCliCandidateFingerprint, verifySkillBundle, wellKnownAgentRuntimeBinDirs, withProviderCliLock, writeAccountIdentityAtomically, writeComputerIdentityAtomically, writeCredentialsAtomically, writeDurableFile, writeDurableJson, writeMachineCredentialsAtomically, writePrivateJson, writeProviderCliSelection };
}
//#region src/agent-runtime/types.d.ts
declare const AGENT_RUNTIME_CONTRACT_VERSION = 2;
declare const AGENT_RUNTIME_BINDING_MAX_BYTES: number;
declare const AGENT_RUNTIME_DESCRIPTION_MAX_BYTES = 1024;
declare const AGENT_RUNTIME_ID_MAX_BYTES = 256;
declare const AGENT_RUNTIME_TEXT_MAX_BYTES: number;
type JsonPrimitive = boolean | number | string | null;
type JsonValue = JsonPrimitive | JsonValue[] | {
  [key: string]: JsonValue;
};
type AgentRunId = string;
interface AgentRuntimeManifest {
  readonly providerId: string;
  readonly displayName: string;
  readonly contractVersion: typeof AGENT_RUNTIME_CONTRACT_VERSION;
  readonly bindingSchemaVersion: number;
}
interface AgentRuntimeCapabilities {
  readonly steer: "supported" | "unsupported";
  readonly interactions: "supported" | "unsupported";
}
interface AgentRuntimeLifecycleState {
  readonly phase: "idle" | "running" | "closing" | "closed";
  readonly activeRunId?: AgentRunId;
  readonly queuedRunCount: number;
}
interface AgentRuntimeBinding {
  readonly providerId: string;
  readonly schemaVersion: number;
  readonly payload: JsonValue;
}
interface AgentTextInputItem {
  readonly type: "text";
  readonly text: string;
}
type AgentInputItem = AgentTextInputItem;
interface AgentInput {
  readonly items: readonly AgentInputItem[];
}
interface AgentRunConfiguration {
  readonly model?: string;
  readonly reasoningEffort?: string;
  readonly provider?: JsonValue;
}
interface AgentPromptRequest {
  /** Exact sockets from trusted execution preparation; never model-supplied or persisted. */
  readonly allowedUnixSockets?: readonly string[];
  readonly runId: AgentRunId;
  readonly input: AgentInput;
  readonly configuration?: AgentRunConfiguration;
  readonly signal?: AbortSignal;
}
interface AgentSteerRequest {
  readonly expectedRunId: AgentRunId;
  readonly input: AgentInput;
}
interface AgentAbortRequest {
  readonly expectedRunId: AgentRunId;
  readonly reason?: string;
}
interface AgentInteractionIdentity {
  readonly expectedRunId: AgentRunId;
  readonly requestId: string;
}
interface AgentApprovalResponse extends AgentInteractionIdentity {
  readonly kind: "approval";
  readonly decision: "accept" | "decline" | "cancel";
  readonly scope?: "run" | "runtime";
  readonly value?: JsonValue;
}
interface AgentQuestionResponse extends AgentInteractionIdentity {
  readonly kind: "question";
  readonly decision: "answer" | "cancel";
  readonly value?: JsonValue;
}
type AgentInteractionResponse = AgentApprovalResponse | AgentQuestionResponse;
interface AgentUsage {
  readonly inputTokens?: number;
  readonly cachedInputTokens?: number;
  readonly outputTokens?: number;
}
interface AgentTextOutputItem {
  readonly type: "text";
  readonly text: string;
}
type AgentOutputItem = AgentTextOutputItem;
type AgentRunStatus = "completed" | "failed" | "aborted" | "cancelled";
type AgentRunErrorCode = ProviderFailureReason | "event_delivery_failed" | "provider_error" | "provider_protocol_error" | "provider_start_failed" | "runtime_closed" | "run_aborted" | "run_cancelled";
interface AgentRunError {
  readonly code: AgentRunErrorCode;
  readonly message: string;
}
interface AgentRunResult {
  readonly runId: AgentRunId;
  readonly status: AgentRunStatus;
  readonly output: readonly AgentOutputItem[];
  readonly usage?: AgentUsage;
  readonly binding?: AgentRuntimeBinding;
  readonly error?: AgentRunError;
  readonly providerDiagnostics?: JsonValue;
}
interface AgentRuntimeWorkspace {
  /** Directory prepended after the Provider and workspace environments are composed. */
  readonly pathPrepend?: string;
  readonly cwd: string;
  readonly environment?: Readonly<Record<string, string>>;
  readonly writableRoots?: readonly string[];
}
interface AgentRuntimePolicy {
  readonly allowedCommands?: readonly string[];
  readonly managedCli?: readonly string[];
  readonly fileSystem: "read-only" | "workspace-write" | "unrestricted";
  readonly network: "disabled" | "enabled";
  readonly approvals: "never" | "on-request" | "unless-trusted";
  readonly tools: {
    readonly mode: "provider-default";
  } | {
    readonly mode: "allow-list";
    readonly names: readonly string[];
  };
}
interface AgentHostedToolDefinition {
  readonly name: string;
  readonly description?: string;
  readonly inputSchema: JsonValue;
}
interface AgentHostedToolCall {
  readonly runId: AgentRunId;
  readonly toolCallId: string;
  readonly name: string;
  readonly input: JsonValue;
  readonly signal: AbortSignal;
}
interface AgentHostedToolContent {
  readonly type: "text";
  readonly text: string;
}
interface AgentHostedToolError {
  readonly code: string;
  readonly message: string;
}
interface AgentHostedToolResult {
  readonly success: boolean;
  readonly content: readonly AgentHostedToolContent[];
  readonly error?: AgentHostedToolError;
}
type AgentHostedToolHandler = (call: AgentHostedToolCall) => Promise<AgentHostedToolResult>;
interface AgentHostedTools {
  readonly definitions: readonly AgentHostedToolDefinition[];
  readonly handler: AgentHostedToolHandler;
}
type AgentRuntimeEventSink = (event: AgentRuntimeEvent) => void | Promise<void>;
interface CreateAgentRuntimeRequest {
  readonly eventSink: AgentRuntimeEventSink;
  readonly hostedTools?: AgentHostedTools;
  readonly systemPrompt: string;
  readonly workspace: AgentRuntimeWorkspace;
  readonly policy: AgentRuntimePolicy;
  readonly configuration?: AgentRunConfiguration;
  /**
   * Optional Agent-scoped Skill directories the provider should load explicitly in addition to any
   * it discovers ambiently. Pi consumes these as `--skill`; other providers ignore them.
   */
  readonly skillPaths?: readonly string[];
}
interface ResumeAgentRuntimeRequest extends CreateAgentRuntimeRequest {
  readonly binding: AgentRuntimeBinding;
}
interface AgentRuntimeProbeRequest {
  readonly configuration?: AgentRunConfiguration;
  readonly signal?: AbortSignal;
}
interface AgentRuntimeProbeIssue {
  readonly code: "artifact_missing" | "credential_missing" | "configuration_invalid" | "temporarily_unavailable" | "version_incompatible";
  readonly message: string;
}
interface AgentRuntimeProbeResult {
  readonly ready: boolean;
  readonly version?: string;
  readonly issues: readonly AgentRuntimeProbeIssue[];
}
interface AgentInteractionRequest {
  readonly requestId: string;
  readonly kind: "approval" | "question";
  readonly title: string;
  readonly message?: string;
  readonly options?: readonly string[];
  readonly details?: JsonValue;
}
type AgentProviderRunEvent = {
  readonly type: "model_turn_started";
  readonly modelTurnId: string;
} | {
  readonly type: "model_turn_completed";
  readonly modelTurnId: string;
} | {
  readonly type: "message_started";
  readonly messageId: string;
} | {
  readonly type: "message_delta";
  readonly messageId: string;
  readonly delta: string;
} | {
  readonly type: "message_completed";
  readonly messageId: string;
  readonly text: string;
} | {
  readonly type: "tool_started";
  readonly toolCallId: string;
  readonly name: string;
  readonly input?: JsonValue;
} | {
  readonly type: "tool_updated";
  readonly toolCallId: string;
  readonly update: JsonValue;
} | {
  readonly type: "tool_completed";
  readonly toolCallId: string;
  readonly name: string;
  readonly status: "completed" | "failed" | "declined";
  readonly output?: JsonValue;
} | {
  readonly type: "usage_updated";
  readonly usage: AgentUsage;
} | {
  readonly type: "provider_warning";
  readonly code: string;
  readonly message: string;
} | {
  readonly type: "provider_event";
  readonly providerId: string;
  readonly schemaVersion: number;
  readonly payload: JsonValue;
};
type AgentRuntimeEvent = {
  readonly type: "binding_changed";
  readonly binding: AgentRuntimeBinding;
  readonly runId?: AgentRunId;
} | {
  readonly type: "run_queued";
  readonly runId: AgentRunId;
  readonly position: number;
} | {
  readonly type: "run_started";
  readonly runId: AgentRunId;
} | ({
  readonly runId: AgentRunId;
} & AgentProviderRunEvent) | {
  readonly type: "interaction_requested";
  readonly runId: AgentRunId;
  readonly request: AgentInteractionRequest;
} | {
  readonly type: "interaction_resolved";
  readonly runId: AgentRunId;
  readonly requestId: string;
  readonly decision: string;
} | {
  readonly type: "input_accepted";
  readonly runId: AgentRunId;
  readonly input: AgentInput;
} | {
  readonly type: "run_completed";
  readonly runId: AgentRunId;
  readonly result: AgentRunResult;
} | {
  readonly type: "run_failed";
  readonly runId: AgentRunId;
  readonly result: AgentRunResult;
} | {
  readonly type: "run_aborted";
  readonly runId: AgentRunId;
  readonly result: AgentRunResult;
} | {
  readonly type: "run_cancelled";
  readonly runId: AgentRunId;
  readonly result: AgentRunResult;
} | {
  readonly type: "runtime_closed";
};
interface AgentProviderRunResult {
  readonly status: "completed" | "failed" | "aborted";
  readonly output?: readonly AgentOutputItem[];
  readonly usage?: AgentUsage;
  readonly error?: AgentRunError;
  readonly diagnostics?: JsonValue;
}
interface AgentProviderRunContext {
  readonly runId: AgentRunId;
  readonly signal: AbortSignal;
  /** Marks that the authoritative Provider terminal arrived; public settlement still waits for executeRun. */
  claimTerminal(): void;
  emit(event: AgentProviderRunEvent): Promise<void>;
  updateBinding(binding: AgentRuntimeBinding): Promise<void>;
  requestInteraction(request: AgentInteractionRequest): Promise<void>;
  resolveInteraction(requestId: string, decision: string): Promise<void>;
}
interface AgentRuntime {
  readonly manifest: AgentRuntimeManifest;
  readonly capabilities: AgentRuntimeCapabilities;
  readonly state: Readonly<AgentRuntimeLifecycleState>;
  readonly binding: AgentRuntimeBinding | undefined;
  prompt(request: AgentPromptRequest): Promise<AgentRunResult>;
  steer(request: AgentSteerRequest): Promise<void>;
  followUp(request: AgentPromptRequest): Promise<AgentRunResult>;
  respond(response: AgentInteractionResponse): Promise<void>;
  abort(request: AgentAbortRequest): Promise<void>;
  waitForIdle(): Promise<void>;
  close(): Promise<void>;
}
interface AgentRuntimeConfigurationOptionsRequest {
  readonly model?: string;
  readonly cwd: string;
  readonly signal?: AbortSignal;
}
interface AgentRuntimeFactory {
  readonly manifest: AgentRuntimeManifest;
  getConfigurationOptions?(request: AgentRuntimeConfigurationOptionsRequest): Promise<AgentRuntimeOptions>;
  probe(request: AgentRuntimeProbeRequest): Promise<AgentRuntimeProbeResult>;
  create(request: CreateAgentRuntimeRequest): Promise<AgentRuntime>;
  resume(request: ResumeAgentRuntimeRequest): Promise<AgentRuntime>;
}
//#endregion
//#region src/agent-runtime/base-agent-runtime.d.ts
interface BaseAgentRuntimeOptions {
  readonly manifest: AgentRuntimeManifest;
  readonly capabilities: AgentRuntimeCapabilities;
  readonly eventSink: AgentRuntimeEventSink;
  readonly binding?: AgentRuntimeBinding;
}
declare abstract class BaseAgentRuntime implements AgentRuntime {
  #private;
  readonly manifest: AgentRuntimeManifest;
  readonly capabilities: AgentRuntimeCapabilities;
  protected constructor(options: BaseAgentRuntimeOptions);
  get state(): Readonly<AgentRuntimeLifecycleState>;
  get binding(): AgentRuntimeBinding | undefined;
  prompt(request: AgentPromptRequest): Promise<AgentRunResult>;
  followUp(request: AgentPromptRequest): Promise<AgentRunResult>;
  steer(request: AgentSteerRequest): Promise<void>;
  respond(response: AgentInteractionResponse): Promise<void>;
  abort(request: AgentAbortRequest): Promise<void>;
  waitForIdle(): Promise<void>;
  close(): Promise<void>;
  protected abstract executeRun(request: AgentPromptRequest, context: AgentProviderRunContext): Promise<AgentProviderRunResult>;
  protected steerProvider(_request: AgentSteerRequest): Promise<void>;
  protected respondProvider(_response: AgentInteractionResponse): Promise<void>;
  protected abortProvider(_request: AgentAbortRequest): Promise<void>;
  protected abstract closeProvider(): Promise<void>;
  protected closeForProviderFailure(): void;
}
//#endregion
//#region src/agent-runtime/errors.d.ts
type AgentRuntimeErrorCode = "binding_incompatible" | "busy" | "closed" | "configuration_invalid" | "close_failed" | "create_failed" | "duplicate_run_id" | "interaction_not_found" | "invalid_request" | "provider_unavailable" | "resume_failed" | "run_mismatch" | "unsupported_capability";
declare class AgentRuntimeError extends Error {
  readonly code: AgentRuntimeErrorCode;
  constructor(code: AgentRuntimeErrorCode, message: string, options?: ErrorOptions);
}
declare class AgentProviderError extends Error {
  readonly code: ProviderFailureReason | "provider_error" | "provider_protocol_error" | "provider_start_failed";
  constructor(code: ProviderFailureReason | "provider_error" | "provider_protocol_error" | "provider_start_failed", message: string, options?: ErrorOptions);
}
//#endregion
//#region src/request-policy.d.ts
type ErrorRetryability$1 = ErrorRetryability;
type ErrorPhase = StructuredErrorPhase;
interface RequestOptions {
  signal?: AbortSignal;
  timeoutMs?: number;
  requestId?: string;
}
type RequestCause = StructuredErrorCause;
//#endregion
//#region src/api.d.ts
declare class OpenTagApiError extends Error {
  readonly code: ErrorCode | string;
  readonly category: ErrorCategory;
  readonly status?: number | undefined;
  readonly issues?: readonly ValidationIssue[] | undefined;
  readonly structuredError: StructuredError;
  constructor(code: ErrorCode | string, category: ErrorCategory, message: string, status?: number | undefined, issues?: readonly ValidationIssue[] | undefined, options?: {
    cause?: unknown;
    retryability?: ErrorRetryability$1;
    phase?: ErrorPhase;
    requestId?: string;
    safeCause?: RequestCause;
  });
  readonly retryability: ErrorRetryability$1;
  readonly phase: ErrorPhase;
  readonly requestId?: string;
  readonly safeCause?: RequestCause;
  toStructuredError(): StructuredError;
}
interface OpenTagApiConstructorOptions {
  fetchImpl?: typeof fetch;
  timeoutMs?: number;
}
declare class OpenTagApi {
  #private;
  constructor(serverUrl: string, fetchOrOptions?: typeof fetch | OpenTagApiConstructorOptions, options?: OpenTagApiConstructorOptions);
  exchangeConnectCode(code: string, expectedUserId?: string, options?: RequestOptions): Promise<ConnectCodeExchangeResponse>;
  exchangeComputerConnectCode(input: ComputerConnectCodeExchangeRequest, options?: RequestOptions): Promise<ComputerConnectCodeExchangeResponse>;
  refresh(refreshToken: string, options?: RequestOptions): Promise<RefreshTokenResponse>;
  me(accessToken: string, options?: RequestOptions): Promise<MeResponse>;
  issueComputerConnectCode(accessToken: string, options?: RequestOptions): Promise<ComputerConnectCodeIssueResponse>;
  getComputerConnectCodeStatus(accessToken: string, connectCodeId: string, options?: RequestOptions): Promise<ComputerConnectCodeStatus>;
  listAccountComputers(accessToken: string, options?: RequestOptions): Promise<ListAccountComputersResponse>;
  createAgent(accessToken: string, input: CreateAgentRequest, options?: RequestOptions): Promise<AgentAdminConfig>;
  listAgents(accessToken: string, options?: RequestOptions): Promise<ListAgentsResponse>;
  getAgent(accessToken: string, agentId: string, options?: RequestOptions): Promise<AgentDetail>;
  getAgentUsage(accessToken: string, agentId: string, windowDays: AgentUsageWindowDays, options?: RequestOptions): Promise<AgentUsageDetail>;
  getAgentConfig(accessToken: string, agentId: string, options?: RequestOptions): Promise<AgentAdminConfig>;
  testAgentRuntime(accessToken: string, agentId: string, input: AgentRuntimeTestRequest, options?: RequestOptions): Promise<AgentRuntimeTestResponse>;
  rebindAgentComputer(accessToken: string, agentId: string, computerId: string): Promise<AgentAdminConfig>;
  updateAgent(accessToken: string, agentId: string, input: UpdateAgentRequest, options?: RequestOptions): Promise<AgentAdminConfig>;
  suspendAgent(accessToken: string, agentId: string, options?: RequestOptions): Promise<AgentAdminConfig>;
  reactivateAgent(accessToken: string, agentId: string, options?: RequestOptions): Promise<AgentAdminConfig>;
  deleteAgent(accessToken: string, agentId: string, options?: RequestOptions): Promise<void>;
  getAgentImBinding(accessToken: string, agentId: string, options?: RequestOptions): Promise<ImBindingSummary | undefined>;
  getAgentImBindingConfig(accessToken: string, agentId: string, options?: RequestOptions): Promise<ImBindingAdminDetail | undefined>;
  createFeishuSetupAttempt(accessToken: string, agentId: string, intent?: "create" | "reauthorize" | "replace", options?: RequestOptions): Promise<FeishuSetupAttempt>;
  getFeishuSetupAttempt(accessToken: string, attemptId: string, options?: RequestOptions): Promise<FeishuSetupAttempt>;
  cancelFeishuSetupAttempt(accessToken: string, attemptId: string, options?: RequestOptions): Promise<FeishuSetupAttempt>;
  startSlackOAuth(accessToken: string, agentId: string, input: StartSlackOAuthRequest, options?: RequestOptions): Promise<StartSlackOAuthResponse>;
  getImBindingDiagnostics(accessToken: string, imBindingId: string, options?: RequestOptions): Promise<ImBindingDiagnostics>;
  disableImBinding(accessToken: string, imBindingId: string, options?: RequestOptions): Promise<void>;
  listMcpServers(accessToken: string, options?: RequestOptions): Promise<ListMCPServersResponse>;
  createMcpServer(accessToken: string, input: CreateMCPServerRequest, options?: RequestOptions): Promise<MCPServer>;
  getMcpServer(accessToken: string, mcpServerId: string, options?: RequestOptions): Promise<MCPServerDetail>;
  updateMcpServer(accessToken: string, mcpServerId: string, input: UpdateMCPServerRequest, options?: RequestOptions): Promise<MCPServer>;
  removeMcpServer(accessToken: string, mcpServerId: string, options?: RequestOptions): Promise<void>;
  listAgentMcpServers(accessToken: string, agentId: string, options?: RequestOptions): Promise<ListAgentMCPServersResponse>;
  listAvailableMcpServers(accessToken: string, agentId: string, options?: RequestOptions): Promise<ListAvailableMCPServersResponse>;
  attachMcpServer(accessToken: string, agentId: string, input: AttachMCPServerRequest, options?: RequestOptions): Promise<MCPAgentServer>;
  updateAgentMcpServer(accessToken: string, agentId: string, mcpServerId: string, input: UpdateMCPBindingRequest, options?: RequestOptions): Promise<MCPAgentServer>;
  detachMcpServer(accessToken: string, agentId: string, mcpServerId: string, options?: RequestOptions): Promise<void>;
  setMcpAuthorization(accessToken: string, agentId: string, mcpServerId: string, input: SetMCPAuthorizationRequest, options?: RequestOptions): Promise<MCPAgentServer>;
  revokeMcpAuthorization(accessToken: string, agentId: string, mcpServerId: string, options?: RequestOptions & {
    expectedOAuthState?: string;
  }): Promise<MCPAgentServer>;
  startMcpOAuth(accessToken: string, agentId: string, mcpServerId: string, input?: StartMCPOAuthRequest, options?: RequestOptions): Promise<StartMCPOAuthResponse>;
  probeMcpServer(accessToken: string, agentId: string, mcpServerId: string, options?: RequestOptions): Promise<MCPProbeResponse>;
  openImResource(machineToken: string, imMessageId: string, ordinal: number, scope: {
    sessionId: string;
    instanceId: string;
    placementGeneration: number;
  }, options?: RequestOptions): Promise<Response>;
  listRuntimeDurableWork(machineToken: string, kind: RuntimeDurableWorkKind, options?: RequestOptions): Promise<RuntimeDurableWorkRecord[]>;
  writeRuntimeDurableWork(machineToken: string, record: RuntimeDurableWorkRecord, options?: RequestOptions): Promise<void>;
  createInternalSession(proof: string, input: SessionCliCreateRequest, options?: RequestOptions & {
    executionId?: string;
  }): Promise<SessionCliCommandResponse>;
  sendSessionMessage(proof: string, input: SessionCliSendRequest, options?: RequestOptions & {
    executionId?: string;
  }): Promise<SessionCliCommandResponse>;
  listInternalSessions(proof: string, input: SessionCliListQuery, options?: RequestOptions): Promise<SessionCliListResponse>;
  listAgentSkills(accessToken: string, agentId: string, options?: RequestOptions): Promise<ListAgentSkillsResponse>;
  getAgentSkill(accessToken: string, agentId: string, skillId: string, options?: RequestOptions): Promise<SkillDetail>;
  uploadAgentSkill(accessToken: string, agentId: string, input: SkillUploadInput, options?: RequestOptions): Promise<Skill>;
  updateAgentSkill(accessToken: string, agentId: string, skillId: string, input: {
    enabled: boolean;
  }, options?: RequestOptions): Promise<Skill>;
  removeAgentSkill(accessToken: string, agentId: string, skillId: string, options?: RequestOptions): Promise<void>;
  openAgentSkillBundle(accessToken: string, agentId: string, skillId: string, options?: RequestOptions): Promise<Response>;
  getComputerSkillManifest(machineToken: string, agentId: string, options?: RequestOptions): Promise<RuntimeSkillManifest>;
  openComputerSkillBundle(machineToken: string, agentId: string, skillId: string, options?: RequestOptions): Promise<Response>;
  listRuntimeSkills(proof: string, options?: RequestOptions): Promise<ListAgentSkillsResponse>;
  pushRuntimeSkill(proof: string, input: SkillUploadInput, options?: RequestOptions): Promise<Skill>;
  openRuntimeSkillBundle(proof: string, name: string, options?: RequestOptions): Promise<Response>;
  listSkillPresets(accessToken: string, agentId: string, options?: RequestOptions): Promise<ListSkillPresetsResponse>;
  installSkillPreset(accessToken: string, agentId: string, presetName: string, options?: RequestOptions): Promise<InstallSkillPresetResponse>;
  listRuntimeSkillPresets(proof: string, options?: RequestOptions): Promise<ListSkillPresetsResponse>;
  installRuntimeSkillPreset(proof: string, presetName: string, options?: RequestOptions): Promise<InstallSkillPresetResponse>;
  getRuntimeAgentConfig(proof: string, options?: RequestOptions): Promise<AgentAdminConfig>;
  updateRuntimeAgentConfig(proof: string, input: UpdateSelfAgentRequest, options?: RequestOptions): Promise<AgentAdminConfig>;
  createRuntimeAgentSchedule(proof: string, input: CreateAgentScheduleRequest, options?: RequestOptions & {
    executionId?: string;
  }): Promise<AgentSchedule>;
  listRuntimeAgentSchedules(proof: string, query?: {
    limit?: number;
    cursor?: string;
  }, options?: RequestOptions): Promise<AgentScheduleListResponse>;
  getRuntimeAgentSchedule(proof: string, scheduleId: string, options?: RequestOptions): Promise<AgentSchedule>;
  updateRuntimeAgentSchedule(proof: string, scheduleId: string, input: UpdateAgentScheduleRequest, options?: RequestOptions & {
    executionId?: string;
  }): Promise<AgentSchedule>;
  pauseRuntimeAgentSchedule(proof: string, scheduleId: string, expectedRevision: number, options?: RequestOptions): Promise<AgentSchedule>;
  resumeRuntimeAgentSchedule(proof: string, scheduleId: string, expectedRevision: number, options?: RequestOptions & {
    executionId?: string;
  }): Promise<AgentSchedule>;
  deleteRuntimeAgentSchedule(proof: string, scheduleId: string, expectedRevision: number, options?: RequestOptions): Promise<void>;
  previewRuntimeAgentSchedule(proof: string, input: PreviewAgentScheduleRequest, options?: RequestOptions): Promise<AgentSchedulePreview>;
  provisionSlackAgent(proof: string, input: ProvisionSlackAgentRequest, options?: RequestOptions): Promise<ProvisionSlackAgentResponse>;
  listRuntimeAgentMcpServers(proof: string, options?: RequestOptions): Promise<ListAgentMCPServersResponse>;
  listRuntimeAgentAvailableMcpServers(proof: string, options?: RequestOptions): Promise<ListAvailableMCPServersResponse>;
  attachRuntimeAgentMcpServer(proof: string, input: AttachMCPServerRequest, options?: RequestOptions): Promise<MCPAgentServer>;
  updateRuntimeAgentMcpBinding(proof: string, mcpServerId: string, input: UpdateSelfMCPBindingRequest, options?: RequestOptions): Promise<MCPAgentServer>;
  detachRuntimeAgentMcpServer(proof: string, mcpServerId: string, options?: RequestOptions): Promise<void>;
  createRuntimeAgentMcpServer(proof: string, input: CreateSelfMCPServerRequest, options?: RequestOptions): Promise<MCPAgentServer>;
  deleteRuntimeAgentMcpServerDefinition(proof: string, mcpServerId: string, options?: RequestOptions): Promise<void>;
  setRuntimeAgentMcpBearerKey(proof: string, mcpServerId: string, apiKey: string, options?: RequestOptions): Promise<MCPAgentServer>;
  startRuntimeAgentMcpOAuth(proof: string, mcpServerId: string, input?: StartMCPOAuthRequest, options?: RequestOptions): Promise<StartMCPOAuthResponse>;
  getRuntimeAgentMcpOAuthStatus(proof: string, mcpServerId: string, options?: RequestOptions): Promise<SelfMCPOAuthStatus>;
}
interface SkillUploadInput {
  readonly archive: Uint8Array;
  readonly sha256: string;
  readonly format: SkillArchiveFormat;
  readonly replace?: boolean;
}
declare function normalizeServerUrl(serverUrl: string): string;
//#endregion
//#region src/storage/home-layout.d.ts
interface OpenTagHomeLayout {
  config: string;
  contextTreeBin: string;
  daemonState: string;
  data: string;
  home: string;
  logs: string;
  runtime: string;
  runtimeEffectiveSnapshots: string;
  runtimeSessionBindings: string;
  runtimeWorkspaceStates: string;
  serviceState: string;
  state: string;
  workspaces: string;
}
declare function resolveOpenTagHome(environment?: NodeJS.ProcessEnv): string;
declare function resolveOpenTagHomeLayout(home?: string): OpenTagHomeLayout;
//#endregion
//#region src/auth/credentials.d.ts
interface StoredCredentials {
  accessToken: string;
  accessTokenExpiresAt: string;
  refreshToken: string;
  serverUrl: string;
}
declare const CREDENTIALS_FILE_NAME = "credentials.json";
declare function credentialsPath(home?: string): string;
declare function readCredentials(home?: string): Promise<StoredCredentials | undefined>;
declare function writeCredentialsAtomically(credentials: StoredCredentials, home?: string): Promise<void>;
//#endregion
//#region src/auth/account-identity.d.ts
/**
 * Which Account this OpenTag home last signed in as, kept beside `credentials.json` rather than in
 * it.
 *
 * The credentials file is read by a strict schema, and every CLI already installed reads it with
 * the schema it shipped with: a key added to that file by a newer CLI makes the file invalid for an
 * older one, so the documented rollback (`install.sh --version <previous>`) would leave every
 * Account-authenticated command refusing to run. This attribution is a diagnostic detail, not a
 * credential, so it lives in its own optional file that an older CLI never opens. The `serverUrl`
 * is recorded so an identity left behind by a sign-in to one server is never attributed to a
 * sign-in to another.
 *
 * `credentialsFingerprint` ties the identity to the credentials it was written beside. Rollback is
 * a supported sequence, and an older CLI signing in as another Account rewrites only
 * `credentials.json`, leaving this file naming the previous Account on the same server. The
 * fingerprint is a hash of the refresh token — never the token — so a reader can prove the file
 * still describes the credentials it reads, and omit the Account when it cannot. A file written
 * before the field existed fails the strict schema and is treated as absent, which is the safe
 * direction: no attribution rather than a wrong one.
 */
declare const StoredAccountIdentitySchema: ZodObject<{
  userId: ZodString;
  serverUrl: ZodString;
  credentialsFingerprint: ZodString;
}, $strict>;
type StoredAccountIdentity = output$1<typeof StoredAccountIdentitySchema>;
declare const ACCOUNT_IDENTITY_FILE_NAME = "account-identity.json";
declare function accountIdentityPath(home?: string): string;
/** Throws on a malformed file, like the other identity readers; a caller decides what that costs. */
declare function readAccountIdentity(home?: string): Promise<StoredAccountIdentity | undefined>;
declare function writeAccountIdentityAtomically(identity: StoredAccountIdentity, home?: string): Promise<void>;
/**
 * The fingerprint an identity file carries for a set of credentials: a hex SHA-256 of the refresh
 * token. The refresh token rather than the access token because it is the credential that
 * outlives a refresh cycle and changes only when the credentials are rotated or replaced; and a
 * hash rather than the token so the identity file never holds a secret.
 */
declare function credentialsFingerprint(credentials: Pick<StoredCredentials, "refreshToken">): string;
/** Whether an identity file was written beside these credentials. */
declare function accountIdentityMatchesCredentials(identity: Pick<StoredAccountIdentity, "credentialsFingerprint">, credentials: Pick<StoredCredentials, "refreshToken">): boolean;
type AccountIdentityRotation = "rebound" | "unbound" | "absent";
/**
 * Carry the identity over a refresh token rotation.
 *
 * Only an identity that provably belonged to the replaced credentials is rebound to the new ones;
 * one that did not match is left exactly as it was, so a stale file stays unprovable and keeps
 * being ignored. Throws like any other identity read or write; the caller decides that a refresh
 * must not fail over it.
 */
declare function rotateAccountIdentityFingerprint(input: {
  previous: Pick<StoredCredentials, "refreshToken">;
  next: Pick<StoredCredentials, "refreshToken">;
}, home?: string): Promise<AccountIdentityRotation>;
/** Forgets the Account; a home that has no identity file is left as it is. */
declare function removeAccountIdentity(home?: string): Promise<void>;
//#endregion
//#region src/auth/machine-credentials.d.ts
interface MachineComputerCredential {
  computerId: string;
  installationId: string;
  machineToken: string;
  serverUrl: string;
}
interface StoredMachineCredentials {
  version: 3;
  computer: MachineComputerCredential;
}
declare const MACHINE_CREDENTIALS_FILE_NAME = "computer-credentials.json";
declare function machineCredentialsPath(home?: string): string;
declare function readMachineCredentials(home?: string): Promise<StoredMachineCredentials | undefined>;
/**
 * Strict, read-only projection for diagnostics. Unlike the runtime reader, this rejects the whole
 * file when any stored Computer credential is unusable, so corruption cannot be reported as a healthy
 * partial configuration.
 */
declare function readMachineCredentialsStrict(home?: string): Promise<StoredMachineCredentials | undefined>;
/** Rejects rather than throwing synchronously, so a caller handling the returned promise sees the refusal. */
declare function writeMachineCredentialsAtomically(credentials: StoredMachineCredentials, home?: string): Promise<void>;
type BoundAccountComputerResolution = {
  status: "disconnected";
} | {
  status: "bound";
  credential: MachineComputerCredential;
};
/** One canonical home binds at most one Account Computer. */
declare function resolveBoundAccountComputer(credentials: StoredMachineCredentials | undefined): BoundAccountComputerResolution;
declare function storeBoundAccountComputer(credential: MachineComputerCredential, home?: string): Promise<StoredMachineCredentials>;
//#endregion
//#region src/observability/logger.d.ts
type ClientLogBindings = Readonly<Record<string, unknown>>;
interface ClientLogger {
  child(bindings: ClientLogBindings): ClientLogger;
  debug(fields: ClientLogBindings, message: string): void;
  error(fields: ClientLogBindings, message: string): void;
  info(fields: ClientLogBindings, message: string): void;
  warn(fields: ClientLogBindings, message: string): void;
}
interface CreateLoggerOptions {
  destination?: "configured" | "stderr" | "file" | "dual";
}
/**
 * The resolved environment of the service that owns the log directory. The daemon service supplies
 * its `config/daemon.env` result here, so the logger reads the same environment the rest of the
 * daemon runs with instead of the raw process environment.
 */
interface ClientLoggerServiceOptions {
  environment?: Readonly<Record<string, string | undefined>>;
}
declare function configureClientLoggerForService(logDirectory: string, options?: ClientLoggerServiceOptions): void;
declare function configureClientLoggerContext(bindings: ClientLogBindings): void;
declare function createLogger(module: string, options?: CreateLoggerOptions): ClientLogger;
//#endregion
//#region src/auth/token-provider.d.ts
interface AccessTokenLease {
  accessToken: string;
  expiresAt: string;
}
interface TokenProviderOptions {
  api?: Pick<OpenTagApi, "refresh">;
  home?: string;
  now?: () => Date;
  refreshSkewSeconds?: number;
  lockRetryMs?: number;
  lockTimeoutMs?: number;
  /** Where a best-effort step that did not change the refresh's outcome is noted. */
  logger?: Pick<ClientLogger, "debug">;
}
declare class AccessTokenProvider {
  #private;
  constructor(options?: TokenProviderOptions);
  getAccessToken(): Promise<string>;
  getAccessTokenLease(forceRefresh?: boolean): Promise<AccessTokenLease>;
}
//#endregion
//#region src/runtime/computer-identity.d.ts
interface ComputerIdentity {
  version: 2;
  computerId: string;
  serverUrl: string;
}
declare const COMPUTER_IDENTITY_FILE_NAME = "computer.json";
declare function computerIdentityPath(home: string): string;
declare function readComputerIdentity(home: string): Promise<ComputerIdentity | undefined>;
declare function resolveComputerIdentity(home: string, serverUrl: string): Promise<ComputerIdentity>;
/** Allocates a new in-memory installation identity for create or repair without mutating the current binding. */
declare function allocateComputerIdentity(home: string, serverUrl: string): Promise<ComputerIdentity>;
declare function writeComputerIdentityAtomically(home: string, identity: ComputerIdentity): Promise<void>;
//#endregion
//#region src/runtime/runtime-connection-helpers.d.ts
type RuntimeBusinessFrame = Readonly<Record<string, unknown>> & {
  readonly type: string;
};
//#endregion
//#region src/runtime/runtime-connection-errors.d.ts
type RuntimeSendErrorCode = "aborted" | "deadline" | "frame_too_large" | "overflow" | "unavailable" | "capability_unavailable";
type RuntimeConnectionErrorCategory = "authentication_rejection" | "capability_incompatibility" | "protocol" | "transient_connection";
declare class RuntimeConnectionError extends Error {
  readonly fatal: boolean;
  readonly category: RuntimeConnectionErrorCategory;
  constructor(message: string, fatal: boolean, category?: RuntimeConnectionErrorCategory);
}
declare class RuntimeSendError extends Error {
  readonly code: RuntimeSendErrorCode;
  constructor(code: RuntimeSendErrorCode, message: string);
}
//#endregion
//#region src/runtime/runtime-connection.d.ts
declare const PRIORITIES: readonly ["control", "result", "report", "trace"];
type RuntimeConnectionState = "stopped" | "connecting" | "authenticating" | "welcoming" | "registering" | "registered";
type RuntimeSendPriority = (typeof PRIORITIES)[number];
interface RuntimeSendOptions {
  deadline?: number;
  priority?: RuntimeSendPriority;
  signal?: AbortSignal;
}
interface RuntimeQueueLimits {
  control: number;
  result: number;
  report: number;
  trace: number;
}
interface RuntimeScheduler {
  clearTimeout(timer: ReturnType<typeof setTimeout>): void;
  setTimeout(callback: () => void, milliseconds: number): ReturnType<typeof setTimeout>;
}
interface RuntimeConnectionOptions {
  arch: string;
  backpressureDeadlineMs?: number;
  clientVersion: string;
  computer: ComputerIdentity;
  displayName: string;
  handshakeTimeoutMs?: number;
  instanceId: string;
  jitter?: () => number;
  logger?: ClientLogger;
  machineToken: string;
  now?: () => number;
  onChannelTarget?: (target: RuntimeChannelTarget) => void;
  parseBusinessFrame?: (value: unknown) => RuntimeBusinessFrame | undefined;
  platform: "darwin" | "linux" | "win32";
  queueLimits?: Partial<RuntimeQueueLimits>;
  scheduler?: RuntimeScheduler;
  waitForRetry?: (milliseconds: number, signal: AbortSignal) => Promise<void>;
  webSocketFactory?: (url: string, options: ClientOptions) => WebSocket;
}
declare class RuntimeConnection {
  #private;
  constructor(options: RuntimeConnectionOptions);
  get state(): RuntimeConnectionState;
  get installationId(): string;
  get serverUrl(): string;
  get instanceId(): string;
  supportsCapability(capability: string): boolean;
  capabilityVersion(capability: string): number | undefined;
  /** Composition must advertise only the credential path it actually installed. */
  setCredentialProxyEnabled(enabled: boolean): void;
  setVerifiedCapabilities(capabilities: RuntimeClientCapabilities, validForMs?: number): void;
  setProviderReadiness(observation: RuntimeProviderReadinessObservation, validForMs?: number): void;
  leaseProviderReadiness(observation: RuntimeProviderReadinessObservation): () => void;
  setImCliReadiness(observation: RuntimeImCliReadinessObservation, validForMs?: number): void;
  subscribeState(listener: (state: RuntimeConnectionState) => void): () => void;
  subscribeBusinessFrames(listener: (frame: RuntimeBusinessFrame) => void | Promise<void>): () => void;
  whenRegistered(signal?: AbortSignal): Promise<void>;
  run(): Promise<void>;
  stop(): void;
  send(frame: unknown, options?: RuntimeSendOptions): Promise<void>;
}
//#endregion
//#region src/runtime/runtime-credential-frames.d.ts
/** Capability negotiation names offered/negotiated at version 1. */
declare const RUNTIME_CREDENTIAL_CAPABILITY: "runtime.runtimeCredential";
declare const RUNTIME_PROVIDER_PROXY_CAPABILITY: "runtime.providerProxy";
/** The `web_tools_v1` negotiation: both ends speak the fixed web tools protocol at version 1. */
declare const RUNTIME_WEB_TOOLS_CAPABILITY: "runtime.webTools";
/** Short aliases used across the Client runtime modules. */
declare const RUNTIME_PROXY_DATA_HEADER_MAX_BYTES: number;
declare const RUNTIME_PROXY_DATA_CHUNK_BYTES = 65536;
declare const RUNTIME_PROXY_DATA_BINARY_FRAME_MAX_BYTES: number;
declare const RUNTIME_PROXY_DATA_INITIAL_CREDIT_BYTES = 1048576;
declare const RUNTIME_PROXY_DATA_MAX_STREAMS = 8;
type RuntimeProxyProvider = RuntimeCredentialProvider;
type RuntimeProxyCliMetadata = RuntimeProviderCliMetadata;
type RuntimeCredentialGrant = Extract<RuntimeCredentialResult, {
  status: "succeeded";
}>;
type RuntimeCredentialRevoked = RuntimeCredentialRevokedFrame;
declare const RUNTIME_PROXY_PROVIDERS: readonly ["github", "slack", "feishu"];
/** Parse one Server business frame; returns undefined for non-credential frames. */
declare function parseRuntimeCredentialServerFrame(value: unknown): RuntimeCredentialServerFrame | undefined;
//#endregion
//#region src/runtime/runtime-proxy-data-client.d.ts
type RuntimeProxyDataErrorCode = "aborted" | "auth_failed" | "connection_lost" | "connection_closed" | "open_timeout" | "protocol_error" | "queue_full" | "stream_error" | "too_many_streams";
/** Controlled data-channel failure. `code` identifies the local cause; upstream codes are carried separately and must be allowlisted before presentation. */
declare class RuntimeProxyDataError extends Error {
  readonly code: RuntimeProxyDataErrorCode;
  readonly upstreamCode?: string | undefined;
  constructor(code: RuntimeProxyDataErrorCode, message: string, options?: ErrorOptions, upstreamCode?: string | undefined);
}
interface RuntimeProxyOpenStreamRequest {
  readonly bindingId: string;
  readonly body?: AsyncIterable<Uint8Array>;
  readonly capability: string;
  readonly headers: Readonly<Record<string, string>>;
  readonly method: string;
  readonly path: string;
  readonly provider: RuntimeProxyProvider;
  readonly signal?: AbortSignal;
}
interface RuntimeProxyStreamResponse {
  readonly body: AsyncIterable<Uint8Array>;
  /** Cancel the stream locally and send a `cancel` control frame; safe after end/settle. */
  readonly cancel?: (code?: string) => void;
  readonly headers: Readonly<Record<string, string>>;
  readonly status: number;
}
interface RuntimeProxyDataConnectionOptions {
  /** Expected execution binding; a `ready` frame for any other execution fails the handshake. */
  readonly executionId: string;
  readonly handshakeTimeoutMs?: number;
  readonly logger?: Pick<ClientLogger, "debug" | "warn">;
  readonly maxQueuedOpens?: number;
  readonly maxStreams?: number;
  readonly openTimeoutMs?: number;
  readonly ticket: string;
  /** Full WebSocket URL including the fixed path. Must not carry a query string. */
  readonly url: string;
  readonly webSocketFactory?: (url: string, options: ClientOptions) => WebSocket;
}
/**
 * Production client for the fixed binary streaming data protocol: one authenticated
 * WSS per execution, first frame `{type:"auth",ticket}`, JSON header frames bounded at
 * 16 KiB, binary frames `4-byte BE streamId || chunk` with chunks ≤ 64 KiB, 1 MiB
 * initial per-direction credit, at most 8 concurrent streams with a bounded open
 * queue, half-close via `end`, and `cancel`/`error`/connection loss rejecting every
 * pending promise. Writes are never replayed.
 */
declare class RuntimeProxyDataConnection {
  #private;
  private constructor();
  get closed(): boolean;
  get activeStreamCount(): number;
  /** Resolves once the connection is fully closed (by either side or a protocol violation). */
  settled(): Promise<void>;
  /** Establish the connection and complete the ticket auth handshake. */
  static connect(options: RuntimeProxyDataConnectionOptions): Promise<RuntimeProxyDataConnection>;
  /**
   * Open one request/response stream. The response resolves with the status and
   * headers; its body is an async iterable that applies credit backpressure. Request
   * bodies stream concurrently with the response within the credit window.
   */
  openStream(request: RuntimeProxyOpenStreamRequest): Promise<RuntimeProxyStreamResponse>;
  /** Cancel every stream and close the socket. Idempotent. */
  close(): Promise<void>;
}
//#endregion
//#region src/runtime/runtime-credential-relay.d.ts
type RuntimeCredentialRelayErrorCode = "aborted" | "acquire_failed" | "capability_expired" | "data_connect_failed" | "execution_not_ready" | "execution_rejected" | "execution_timeout" | "provider_unavailable" | "relay_closed" | "ticket_failed" | "unsupported_negotiation";
/** Controlled trusted-Relay failure. Server rejection codes stay in `serverCode`. */
declare class RuntimeCredentialRelayError extends Error {
  readonly code: RuntimeCredentialRelayErrorCode;
  readonly serverCode?: string | undefined;
  constructor(code: RuntimeCredentialRelayErrorCode, message: string, serverCode?: string | undefined);
}
interface RuntimeCredentialExecutionSubject {
  readonly agentId: string;
  readonly placementGeneration: number;
  readonly runId: string;
  readonly sandbox?: RuntimeExecutionSandbox;
  readonly sessionId: string;
  readonly source: RuntimeExecutionSource;
  /**
   * Platform services the Client opts into for this execution. Each is sent only when that
   * service's own capability was negotiated; the Server grants per its own policy.
   */
  readonly services?: readonly RuntimeExecutionServiceRequest[];
  readonly contextTree?: RuntimeContextTreeExecution;
}
/** Structural data-connection surface so the parent harness can drive the real Relay. */
interface RuntimeProxyDataConnectionLike {
  readonly closed: boolean;
  close(): Promise<void>;
  openStream(request: {
    readonly bindingId: string;
    readonly body?: AsyncIterable<Uint8Array>;
    readonly capability: string;
    readonly headers: Readonly<Record<string, string>>;
    readonly method: string;
    readonly path: string;
    readonly provider: RuntimeProxyProvider;
    readonly signal?: AbortSignal;
  }): Promise<RuntimeProxyStreamResponse>;
  settled(): Promise<void>;
}
interface RuntimeProxyDataConnectInput {
  readonly executionId: string;
  readonly path: string;
  readonly serverUrl: string;
  readonly signal?: AbortSignal;
  readonly ticket: string;
}
type RuntimeProxyDataConnectionFactory = (input: RuntimeProxyDataConnectInput) => Promise<RuntimeProxyDataConnectionLike>;
interface RuntimeRelayScheduleHandle {
  cancel(): void;
}
interface RuntimeRelayScheduler {
  schedule(delayMs: number, callback: () => void): RuntimeRelayScheduleHandle;
}
interface RuntimeCredentialRelayOptions {
  readonly connection: Pick<RuntimeConnection, "send" | "subscribeBusinessFrames" | "subscribeState">;
  readonly controlResultTimeoutMs?: number;
  readonly dataConnectionFactory?: RuntimeProxyDataConnectionFactory;
  readonly jitter?: () => number;
  readonly logger?: Pick<ClientLogger, "debug" | "warn">;
  readonly notReadyRetryMs?: number;
  readonly now?: () => number;
  readonly openBudgetMs?: number;
  readonly randomBytes?: (bytes: number) => Uint8Array;
  readonly scheduler?: RuntimeRelayScheduler;
  /** Base Server URL used to derive the data WSS endpoint from the ticket path. */
  readonly serverUrl: string;
}
declare function defaultRuntimeProxyDataConnectionFactory(input: RuntimeProxyDataConnectInput): Promise<RuntimeProxyDataConnectionLike>;
/**
 * Trusted per-execution Relay. Holds short-lived capabilities in memory only, renews
 * them at `refreshAfter` while the Sandbox-facing local handle stays constant, and
 * injects the newest capability into every data-channel stream. A local handle is a
 * random 256-bit value stored hash-only and bound to its execution/provider; it is
 * never forwarded upstream. Connection replacement or Server revocation closes the
 * whole execution; nothing is replayed or resurrected.
 */
declare class RuntimeCredentialRelay {
  #private;
  private constructor();
  get closed(): boolean;
  get executionId(): string;
  get agentId(): string;
  get contextTreeExecution(): boolean;
  get providers(): readonly RuntimeExecutionProvider[];
  /** Platform services the Server granted this execution (e.g. `web` with exact scopes). */
  get services(): readonly RuntimeExecutionService[];
  /**
   * E8 Cloud Session CLI proof from the execution-open result, retained in memory only. The
   * trusted Runner forwards it to the in-sandbox worker via stdin; it is never journaled, logged,
   * or archived, and it is dropped with the execution.
   */
  get sessionCliProof(): SessionCliProofGrant | undefined;
  /** Fires when the execution is revoked, closed, or loses its control/data connection. */
  get signal(): AbortSignal;
  openContextTree(source: ContextTreeConnection, signal?: AbortSignal): Promise<RuntimeCredentialRelay>;
  /**
   * Open a trusted execution: bounded `execution_not_ready` retry until Server custody
   * accepts, acquire every granted provider, then establish the data channel with a
   * single-use ticket. Any failure closes the partial execution before throwing.
   */
  static open(options: RuntimeCredentialRelayOptions, subject: RuntimeCredentialExecutionSubject, signal?: AbortSignal): Promise<RuntimeCredentialRelay>;
  /** Plaintext local handle for CLI material assembly. Never leaves the Runner boundary. */
  localHandleFor(provider: RuntimeProxyProvider): string;
  /** Hash-verified handle check for the loopback entry; the entry itself binds the execution. */
  verifyLocalHandle(provider: RuntimeProxyProvider, candidate: string): boolean;
  /** CLI metadata for the provider, when an open execution/grant described it. */
  cliMetadataFor(provider: RuntimeProxyProvider): RuntimeProxyCliMetadata | undefined;
  /**
   * Open one data stream with the current capability for the provider. Expired or
   * missing capability fails the stream; the local handle is never attached.
   */
  openProviderStream(request: {
    readonly body?: AsyncIterable<Uint8Array>;
    readonly headers: Readonly<Record<string, string>>;
    readonly method: string;
    readonly path: string;
    readonly provider: RuntimeProxyProvider;
    readonly signal?: AbortSignal;
  }): Promise<RuntimeProxyStreamResponse>;
  /** Close/release the execution: cancel renewals, close the data channel, then release. */
  close(reason: string): Promise<void>;
  /**
   * Fetch this execution's MCP gateway bearer.
   *
   * Its own request rather than a field on the open result, matching the proxy ticket: the open
   * result carries authorization statements, and every secret in this protocol is fetched. The URL
   * is never taken from the Server — only the fixed path is checked against the constant, and the
   * caller composes it against the origin it already pinned.
   *
   * Returns `undefined` rather than throwing when the Server refuses. A missing gateway costs the
   * Agent its MCP tools; it must not cost it the turn.
   */
  acquireMcpGatewayToken(signal?: AbortSignal): Promise<{
    token: string;
    expiresAt: string;
  } | undefined>;
  /**
   * Fetch this execution's web gateway bearer, if the Server granted the `web` service.
   *
   * The mirrored twin of {@link RuntimeCredentialRelay.acquireMcpGatewayToken}: its own request, a
   * fence on the exact execution. A refusal, timeout, or peer that does not implement the frame
   * returns `undefined`; the Cloud turn owner then fails an execution whose web grant cannot be
   * fulfilled. The bearer is returned to the trusted parent only; it is never written to the
   * worker document, the journal, or a log.
   */
  acquireWebGatewayToken(signal?: AbortSignal): Promise<{
    token: string;
    expiresAt: string;
  } | undefined>;
}
//#endregion
//#region src/runtime/runtime-proxy-loopback-adapter.d.ts
/**
 * Server-issued upload/download handle path. Handles keep the provider's fixed origin and
 * never embed platform tokens; the Server revalidates every use and resolves the native
 * upstream URL only in trusted memory.
 */
declare const RUNTIME_PROXY_HANDLE_PATH_PREFIX = "/__opentag__/handles/";
/** Fixed platform CONNECT allowlist; authentication and target policy are revalidated on the Server. */
declare const RUNTIME_PROXY_ALLOWED_CONNECT_HOSTS: readonly string[];
declare class RuntimeProxyLoopbackError extends Error {
  readonly code: "ca_generation_failed" | "listen_failed" | "adapter_closed";
  constructor(code: "ca_generation_failed" | "listen_failed" | "adapter_closed", message: string);
}
interface RuntimeProxyLoopbackCaMaterial {
  readonly certPath: string;
  readonly keyPath: string;
}
interface RuntimeProxyAdapterStreamRequest {
  readonly body: AsyncIterable<Uint8Array>;
  readonly headers: Readonly<Record<string, string>>;
  readonly method: string;
  readonly path: string;
  readonly provider: RuntimeProxyProvider;
  readonly signal: AbortSignal;
}
interface RuntimeProxyLoopbackAdapterOptions {
  /** The single execution this dedicated entry serves. */
  readonly executionId: string;
  /** Local native gh can use private IPC; Cloud keeps its existing sandbox CONNECT bridge. */
  readonly githubApiSocket?: boolean;
  readonly generateCa?: (materialDir: string) => Promise<RuntimeProxyLoopbackCaMaterial>;
  /**
   * Execution-local handles held by the Sandbox. Used only to substitute the harmless
   * Server tenant-token placeholder for `lark-cli`; the Server keeps the real token.
   */
  readonly localHandleFor?: (provider: RuntimeProxyProvider) => string | undefined;
  readonly logger?: Pick<ClientLogger, "debug" | "warn">;
  /** Private per-execution material directory holding the ephemeral CA. */
  readonly materialDir: string;
  /** Relay stream opening with the current capability already bound. */
  readonly openStream: (request: RuntimeProxyAdapterStreamRequest) => Promise<RuntimeProxyStreamResponse>;
  /** Hash-verified local handle check bound to this execution. */
  readonly verifyHandle: (provider: RuntimeProxyProvider, handle: string) => boolean;
}
/**
 * Per-execution loopback TLS adapter: a CONNECT proxy for git/gh/slack/lark-cli with a fixed
 * platform host allowlist plus a direct HTTPS endpoint for the Slack `--apihost` launcher.
 * It terminates TLS with an ephemeral execution-scoped CA, challenges credential-less Git
 * requests with 401, verifies the execution-local handle, and forwards requests through the
 * trusted Relay. Platform credentials never appear here; `Authorization`, `Cookie`, and
 * `Host` are never forwarded upstream. Server-issued handle URLs stay on the provider's
 * fixed origin (`<origin>/__opentag__/handles/<id>`) and are resolved Server-side.
 */
declare class RuntimeProxyLoopbackAdapter {
  #private;
  private constructor();
  /** Loopback HTTP CONNECT endpoint for git/gh HTTPS_PROXY and lark-cli proxy config. */
  get connectProxyUrl(): string;
  /** Loopback HTTPS endpoint the Slack launcher pins through `--apihost`. */
  get slackApiHost(): string;
  /** Private authenticated IPC transport for Local native gh; Cloud uses its sandbox bridge. */
  get githubApiSocketPath(): string | undefined;
  /** Native Git's private HTTP IPC entry; the same handle/Relay/Server checks still apply. */
  get githubGitSocketPath(): string | undefined;
  /** Execution-scoped CA public certificate path for CLI trust configuration. */
  get caCertPath(): string;
  get executionId(): string;
  get closed(): boolean;
  static start(options: RuntimeProxyLoopbackAdapterOptions): Promise<RuntimeProxyLoopbackAdapter>;
  /** Stop both listeners and destroy every tunneled socket. Idempotent. */
  close(): Promise<void>;
}
/**
 * Ephemeral per-execution CA via the platform OpenSSL CLI (the checked-in probe method).
 * The same self-signed CA cert carries every allowlisted SAN and terminates loopback
 * TLS; only Sandbox CLI subprocesses trust it, never the system store. The key is
 * untrusted Sandbox-side material: it cannot issue capabilities or platform tokens.
 */
declare function generateExecutionCa(materialDir: string): Promise<RuntimeProxyLoopbackCaMaterial>;
//#endregion
//#region src/cloud-runtime/sandbox-credential-bridge.d.ts
interface CloudSandboxCommandOptions {
  /** Trusted deployment image selection, not a value read from Agent content. */
  image: string;
  workspace: string;
  command: readonly [string, ...string[]];
  signal?: AbortSignal;
  /** Defaults to direct inherited stdio, preserving native command semantics. */
  stdio?: "inherit" | "pipe";
}
interface CloudSandboxCredentialBridgeOpenOptions extends RuntimeCredentialRelayOptions {
  readonly subject: RuntimeCredentialExecutionSubject;
  readonly temporaryRoot?: string;
  /** Host cancellation; an already-aborted signal never allocates execution material. */
  readonly signal?: AbortSignal;
  /** Client-owned CA seam; production uses the per-execution OpenSSL CA. */
  readonly generateCa?: (materialDir: string) => Promise<RuntimeProxyLoopbackCaMaterial>;
  /** Test seam. Production always requires the real Linux platform. */
  readonly platform?: NodeJS.Platform;
  /** Test seam. Production always spawns the real Docker CLI. */
  readonly spawnProcess?: typeof spawn;
}
/**
 * Trusted Linux Runner entry for one Cloud execution. The relay and control token remain outside
 * the Agent container; only an execution-specific socket directory is mounted into the container.
 * This is a command execution boundary for the Cloud orchestrator, not a Local daemon trust mode.
 */
declare class CloudSandboxCredentialBridge {
  #private;
  private constructor();
  get executionId(): string;
  get signal(): AbortSignal;
  /** Only this subdirectory is Sandbox-visible. Never mount the containing trusted directory. */
  get publicMountPath(): string;
  static open(options: CloudSandboxCredentialBridgeOpenOptions): Promise<CloudSandboxCredentialBridge>;
  /** Deployment controller executes this argument vector. No token, Agent shell, host HOME, or Docker socket enters it. */
  dockerArguments(options: CloudSandboxCommandOptions): Promise<string[]>;
  /** Exactly one command lifetime per execution; control loss kills the container and never replays it. */
  run(options: CloudSandboxCommandOptions): Promise<{
    code: number;
    stdout?: string;
    stderr?: string;
  }>;
  close(): Promise<void>;
}
//#endregion
//#region src/health.d.ts
declare class ServerHealthConfigurationError extends Error {
  readonly name = "ServerHealthConfigurationError";
}
declare class ServerHealthNetworkError extends Error {
  readonly name = "ServerHealthNetworkError";
}
declare class ServerHealthTimeoutError extends Error {
  readonly name = "ServerHealthTimeoutError";
}
declare class ServerHealthHttpError extends Error {
  readonly status: number;
  readonly name = "ServerHealthHttpError";
  constructor(status: number);
}
declare class ServerHealthResponseError extends Error {
  readonly name = "ServerHealthResponseError";
}
declare const SERVER_HEALTH_TIMEOUT_MS = 5000;
declare function checkServerHealth(serverUrl: string, fetchImpl?: typeof fetch, timeoutMs?: number): Promise<ServerHealth>;
//#endregion
//#region src/observability/error-reporting.d.ts
/** How long a CLI waits on the relay before giving up; a failing tracker must not hold a command open. */
declare const CLIENT_ERROR_REPORT_TIMEOUT_MS = 3000;
/** How long a crashing process waits for its last report before exiting anyway. */
declare const PROCESS_ERROR_REPORT_WAIT_MS = 2000;
/** How long a crashing process waits for its stderr output to drain before exiting anyway. */
declare const PROCESS_ERROR_FLUSH_WAIT_MS = 1000;
interface ClientErrorReportMetadata {
  version: string;
  channel: ChannelName;
  /** The command path without user arguments, such as `agent create`. */
  command?: string | undefined;
  environment?: string | undefined;
  occurredAt?: string | undefined;
  /** Correlates the forwarded tracker event with the server log line holding the rest of this. */
  reportId?: string | undefined;
  /** Operating system, architecture, and runtime version, as `doctor` reports them. */
  platform?: string | undefined;
  /** Who this installation signed in as, when it has; the relay is anonymous and does not verify it. */
  userId?: string | undefined;
  computerId?: string | undefined;
  installationId?: string | undefined;
  /** Set when the failure happened inside an Agent turn rather than in a command. */
  agentId?: string | undefined;
  sessionId?: string | undefined;
  turnId?: string | undefined;
  provider?: string | undefined;
}
/** Redact and bound a thrown value into the relay's request shape. */
declare function buildClientErrorReport(error: unknown, metadata: ClientErrorReportMetadata): ErrorReportRequest;
/** The slice of `process` the description reads, so a test can describe a machine it is not on. */
interface PlatformSource {
  readonly platform: string;
  readonly arch: string;
  readonly version: string;
}
/**
 * The machine a CLI failure happened on, as one line.
 *
 * The same three values `doctor` prints, in the same order, so a report and the diagnostic a reader
 * is asked to run describe the machine identically. One field rather than three because the relay
 * bounds each field it accepts, and this is read rather than queried.
 */
declare function describePlatform(source?: PlatformSource): string;
interface ReportClientErrorOptions extends ClientErrorReportMetadata {
  serverUrl: string;
  error: unknown;
  fetchImpl?: typeof fetch | undefined;
  timeoutMs?: number;
}
/**
 * Post one failure to the server relay. Never throws and never carries a credential: the relay is
 * anonymous, and a report that cannot be delivered is simply lost.
 */
declare function reportClientError(options: ReportClientErrorOptions): Promise<{
  ok: boolean;
}>;
type ProcessErrorOrigin = "uncaughtException" | "unhandledRejection";
interface ProcessErrorTarget {
  on(event: ProcessErrorOrigin, listener: (error: unknown) => void): unknown;
  off(event: ProcessErrorOrigin, listener: (error: unknown) => void): unknown;
}
interface ProcessErrorReportingOptions {
  report: (error: unknown, origin: ProcessErrorOrigin) => Promise<unknown>;
  logger: ClientLogger;
  target?: ProcessErrorTarget;
  /** Ends the process; `process.exit` by default. Injected so tests can observe the code. */
  exit?: (code: number) => void;
  /**
   * Writes the failure to stderr as Node would have. The default writes through `process.stderr`
   * and resolves once the bytes are handed to the operating system, so a piped stderr keeps the
   * crash output that a synchronous exit would have dropped.
   */
  print?: (error: unknown) => void | Promise<void>;
  waitMs?: number;
}
/**
 * Report an uncaught exception or unhandled rejection, then end the process the way Node would have.
 *
 * Node's default for both is to print the failure and exit with code 1; installing a listener
 * suppresses that, so this does the same after a bounded wait for the report. Exit codes are
 * unchanged, only the report is added. Returns the function that removes both listeners.
 */
declare function installProcessErrorReporting(options: ProcessErrorReportingOptions): () => void;
//#endregion
//#region src/providers/claude-code/credential-probe.d.ts
interface EnvironmentCredential {
  token: string;
  header: string;
  oauth: boolean;
  apiKey?: string;
}
/** Verify explicit first-party credentials without a model request or touching native login storage. */
declare function probeClaudeEnvironmentCredential(environment: NodeJS.ProcessEnv, signal?: AbortSignal, readStatus?: typeof requestCredentialStatus): Promise<AgentRuntimeProbeIssue | undefined>;
declare function requestCredentialStatus(environment: NodeJS.ProcessEnv, credential: EnvironmentCredential, signal?: AbortSignal): Promise<number>;
//#endregion
//#region src/providers/claude-code/hosted-tool-bridge.d.ts
/** The remote MCP gateway for this execution; both fields are opaque to this module. */
interface ClaudeCodeMcpGatewayEndpoint {
  readonly url: string;
  readonly token: string;
}
interface ClaudeCodeHostedToolBridge {
  readonly allowedTools: readonly string[];
  readonly configPath: string;
  readonly pluginPath: string;
  close(): Promise<void>;
}
declare function startClaudeCodeHostedToolBridge(hostedTools: AgentHostedTools | undefined, runId: string, signal: AbortSignal, skillPaths: readonly string[], mcpGateway?: ClaudeCodeMcpGatewayEndpoint, cwd?: string): Promise<ClaudeCodeHostedToolBridge>;
//#endregion
//#region src/providers/claude-code/process-wire.d.ts
declare const CLAUDE_CODE_MAX_LINE_BYTES: number;
declare const CLAUDE_CODE_MAX_STDERR_BYTES: number;
declare class ClaudeCodeProcessError extends Error {
  readonly code: "aborted" | "exited" | "protocol" | "spawn" | "write";
  constructor(code: "aborted" | "exited" | "protocol" | "spawn" | "write", message: string);
}
interface ClaudeCodeProcessSpawnOptions {
  cwd: string;
  detached: boolean;
  env: NodeJS.ProcessEnv;
}
interface ClaudeCodeSpawnOptions {
  readonly args: readonly string[];
  readonly command?: string;
  readonly cwd: string;
  readonly env: NodeJS.ProcessEnv;
  readonly maxLineBytes?: number;
  readonly maxStderrBytes?: number;
  readonly logger?: ClientLogger;
  readonly spawnProcess?: (command: string, args: readonly string[], options: ClaudeCodeProcessSpawnOptions) => ChildProcessWithoutNullStreams;
}
interface ClaudeCodeProcessResult {
  readonly stderr: string;
}
interface ClaudeCodeProcessClient {
  send?(message: Readonly<Record<string, unknown>>): Promise<void>;
  execute(input: Readonly<Record<string, unknown>>, onMessage: (message: Readonly<Record<string, unknown>>) => void, signal: AbortSignal): Promise<ClaudeCodeProcessResult>;
  interrupt(): Promise<void>;
  close(graceMs?: number): Promise<void>;
}
declare class ClaudeCodeProcess implements ClaudeCodeProcessClient {
  #private;
  constructor(options: ClaudeCodeSpawnOptions);
  execute(input: Readonly<Record<string, unknown>>, onMessage: (message: Readonly<Record<string, unknown>>) => void, signal: AbortSignal): Promise<ClaudeCodeProcessResult>;
  interrupt(): Promise<void>;
  send(message: Readonly<Record<string, unknown>>): Promise<void>;
  close(graceMs?: number): Promise<void>;
}
//#endregion
//#region src/providers/claude-code/agent-runtime.d.ts
declare const CLAUDE_CODE_AGENT_RUNTIME_MANIFEST: AgentRuntimeManifest;
interface ClaudeCodeRuntimeOptions {
  readonly cwd: string;
  readonly policy: AgentRuntimePolicy;
  readonly binding: AgentRuntimeBinding;
  readonly configuration?: AgentRunConfiguration;
  readonly createProcess: (args: readonly string[]) => ClaudeCodeProcessClient;
  readonly emptyNativeToolAllowList?: boolean;
  readonly eventSink: AgentRuntimeEventSink;
  readonly hostedTools?: AgentHostedTools;
  readonly skillPaths: readonly string[];
  readonly resume: boolean;
  readonly startHostedToolBridge: typeof startClaudeCodeHostedToolBridge;
  readonly systemPrompt: string;
}
interface ClaudeCodeAgentRuntimeFactoryOptions {
  readonly process?: {
    readonly args?: readonly string[];
    readonly command?: string;
    readonly env?: NodeJS.ProcessEnv;
    readonly maxLineBytes?: number;
    readonly maxStderrBytes?: number;
    readonly spawnProcess?: (command: string, args: readonly string[], options: ClaudeCodeProcessSpawnOptions) => ChildProcessWithoutNullStreams;
  };
  readonly createProcess?: (cwd: string, args: readonly string[], environment?: Readonly<Record<string, string>>) => ClaudeCodeProcessClient;
  readonly createSessionId?: () => string;
  readonly startHostedToolBridge?: typeof startClaudeCodeHostedToolBridge;
  readonly verifyCredential?: typeof probeClaudeEnvironmentCredential;
  readonly probeRunner?: (signal?: AbortSignal) => Promise<{
    readonly credential: boolean;
    readonly credentialIssue?: AgentRuntimeProbeIssue;
    readonly streamJson: boolean;
    readonly version: string;
  }>;
}
declare class ClaudeCodeAgentRuntime extends BaseAgentRuntime {
  #private;
  constructor(options: ClaudeCodeRuntimeOptions);
  protected executeRun(request: AgentPromptRequest, context: AgentProviderRunContext): Promise<AgentProviderRunResult>;
  protected abortProvider(_request: AgentAbortRequest): Promise<void>;
  protected closeProvider(): Promise<void>;
  protected respondProvider(response: AgentInteractionResponse): Promise<void>;
}
declare class ClaudeCodeAgentRuntimeFactory implements AgentRuntimeFactory {
  #private;
  readonly manifest: AgentRuntimeManifest;
  constructor(options?: ClaudeCodeAgentRuntimeFactoryOptions);
  probe(request: AgentRuntimeProbeRequest): Promise<AgentRuntimeProbeResult>;
  getConfigurationOptions(request: AgentRuntimeConfigurationOptionsRequest): Promise<{
    modelSuggestions: string[];
    reasoningEffortAllowedValues: string[] | null;
  }>;
  create(request: CreateAgentRuntimeRequest): Promise<ClaudeCodeAgentRuntime>;
  resume(request: ResumeAgentRuntimeRequest): Promise<ClaudeCodeAgentRuntime>;
}
declare function claudeCodeAgentRuntimeEnvironment(source?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
//#endregion
//#region src/providers/codex/app-server-wire.d.ts
declare const CODEX_APP_SERVER_MAX_LINE_BYTES: number;
declare const CODEX_APP_SERVER_MAX_STDERR_BYTES: number;
declare const CODEX_APP_SERVER_REQUEST_TIMEOUT_MS = 60000;
declare class CodexAppServerError extends Error {
  readonly code: "aborted" | "exited" | "protocol" | "spawn" | "timeout" | "write";
  readonly errno?: string;
  readonly exitCode?: number | null;
  readonly signal?: NodeJS.Signals | null;
  readonly killed?: boolean;
  constructor(code: "aborted" | "exited" | "protocol" | "spawn" | "timeout" | "write", message: string, evidence?: {
    readonly errno?: string;
    readonly exitCode?: number | null;
    readonly signal?: NodeJS.Signals | null;
    readonly killed?: boolean;
  });
}
interface CodexAppServerMessage {
  [key: string]: unknown;
}
interface CodexAppServerRequest {
  readonly id: number | string;
  readonly method: string;
  readonly params: unknown;
}
interface CodexSpawnOptions {
  args?: string[];
  command?: string;
  cwd: string;
  env: NodeJS.ProcessEnv;
  expectedCodexHome?: string;
  maxLineBytes?: number;
  maxStderrBytes?: number;
  requestTimeoutMs?: number;
  logger?: ClientLogger;
  spawnProcess?: (command: string, args: readonly string[], options: CodexProcessSpawnOptions) => ChildProcessWithoutNullStreams;
}
interface CodexProcessSpawnOptions {
  cwd: string;
  detached: boolean;
  env: NodeJS.ProcessEnv;
}
interface CodexAppServerClient {
  close(graceMs?: number): Promise<void>;
  initialize(clientVersion: string, signal?: AbortSignal): Promise<void>;
  interrupt(threadId: string, turnId: string): Promise<void>;
  notify(method: string, params: unknown): Promise<void>;
  request(method: string, params: unknown, signal?: AbortSignal): Promise<unknown>;
  setDynamicToolHandler?(handler: CodexDynamicToolHandler | undefined): void;
  subscribe(listener: (message: CodexAppServerMessage) => void): () => void;
}
interface CodexDynamicToolCall {
  arguments: unknown;
  callId: string;
  namespace: string | null;
  threadId: string;
  tool: string;
  turnId: string;
}
interface CodexDynamicToolResult {
  success: boolean;
  text: string;
}
type CodexDynamicToolHandler = (call: CodexDynamicToolCall) => Promise<CodexDynamicToolResult>;
interface InteractiveCodexAppServerClient extends CodexAppServerClient {
  rejectServerRequest(id: number | string, code: number, message: string): Promise<void>;
  respondServerRequest(id: number | string, result: unknown): Promise<void>;
  subscribeServerRequests(listener: (request: CodexAppServerRequest) => void): () => void;
}
declare class CodexAppServerProcess implements InteractiveCodexAppServerClient {
  #private;
  constructor(options: CodexSpawnOptions);
  get pid(): number | undefined;
  subscribe(listener: (message: CodexAppServerMessage) => void): () => void;
  setDynamicToolHandler(handler: CodexDynamicToolHandler | undefined): void;
  subscribeServerRequests(listener: (request: CodexAppServerRequest) => void): () => void;
  respondServerRequest(id: number | string, result: unknown): Promise<void>;
  rejectServerRequest(id: number | string, code: number, message: string): Promise<void>;
  initialize(clientVersion: string, signal?: AbortSignal): Promise<void>;
  request(method: string, params: unknown, signal?: AbortSignal): Promise<unknown>;
  notify(method: string, params: unknown): Promise<void>;
  interrupt(threadId: string, turnId: string): Promise<void>;
  close(graceMs?: number): Promise<void>;
}
//#endregion
//#region src/providers/codex/agent-runtime.d.ts
declare const CODEX_AGENT_RUNTIME_APP_SERVER_ARGS: readonly ["app-server", "--stdio", "--disable", "shell_snapshot", "-c", "allow_login_shell=false", "-c", 'shell_environment_policy.inherit="all"'];
declare const CODEX_AGENT_RUNTIME_MANIFEST: AgentRuntimeManifest;
interface CodexRuntimeOptions {
  readonly client: InteractiveCodexAppServerClient;
  readonly threadId: string;
  readonly eventSink: AgentRuntimeEventSink;
  readonly binding: AgentRuntimeBinding;
  readonly workspace: AgentRuntimeWorkspace;
  readonly policy: AgentRuntimePolicy;
  readonly configuration?: AgentRunConfiguration;
  readonly hostedTools?: AgentHostedTools;
  /** The parameters the thread was opened with, reused when rebinding its MCP servers. */
  readonly threadParams: Readonly<Record<string, unknown>>;
  /** Extra `thread/start` parameters, used to replace a thread that has no rollout yet. */
  readonly threadStartParams: Readonly<Record<string, unknown>>;
  /** Whether Codex has persisted the thread, so it can be unloaded and resumed. */
  readonly threadPersisted: boolean;
  readonly mcpAttachTimeoutMs: number;
}
interface CodexAgentRuntimeFactoryOptions {
  readonly clientVersion: string;
  readonly createClient?: (cwd: string, environment?: Readonly<Record<string, string>>) => InteractiveCodexAppServerClient;
  readonly mcpAttachTimeoutMs?: number;
  readonly process?: Omit<CodexSpawnOptions, "cwd" | "env"> & {
    readonly env?: NodeJS.ProcessEnv;
  };
  readonly probeRunner?: (signal?: AbortSignal) => Promise<{
    readonly appServer: boolean;
    readonly credential: boolean;
    readonly experimentalTools: boolean;
    readonly version: string;
  }>;
}
declare class CodexAgentRuntime extends BaseAgentRuntime {
  #private;
  constructor(options: CodexRuntimeOptions);
  protected executeRun(request: AgentPromptRequest, context: AgentProviderRunContext): Promise<AgentProviderRunResult>;
  protected steerProvider(request: AgentSteerRequest): Promise<void>;
  protected respondProvider(response: AgentInteractionResponse): Promise<void>;
  protected abortProvider(request: AgentAbortRequest): Promise<void>;
  protected closeProvider(): Promise<void>;
}
declare class CodexAgentRuntimeFactory implements AgentRuntimeFactory {
  #private;
  readonly manifest: AgentRuntimeManifest;
  constructor(options: CodexAgentRuntimeFactoryOptions);
  probe(request: AgentRuntimeProbeRequest): Promise<AgentRuntimeProbeResult>;
  getConfigurationOptions(request: AgentRuntimeConfigurationOptionsRequest): Promise<{
    modelSuggestions: string[];
    reasoningEffortAllowedValues: string[] | null;
  }>;
  create(request: CreateAgentRuntimeRequest): Promise<CodexAgentRuntime>;
  resume(request: ResumeAgentRuntimeRequest): Promise<CodexAgentRuntime>;
}
declare function codexAgentRuntimeEnvironment(source?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
//#endregion
//#region src/observability/pi-diagnostics.d.ts
declare const diagnosticSchema: ZodObject<{
  version: ZodLiteral<1>;
  seq: ZodNumber;
  elapsedMs: ZodNumber;
  phase: ZodEnum<{
    await_terminal: "await_terminal";
    cleanup: "cleanup";
    get_state: "get_state";
    pi_spawn: "pi_spawn";
    prompt_acceptance: "prompt_acceptance";
    session_restore: "session_restore";
    worker_preparation: "worker_preparation";
    worker_startup: "worker_startup";
  }>;
  event: ZodEnum<{
    end: "end";
    failure: "failure";
    ready: "ready";
    start: "start";
    worker_end: "worker_end";
  }>;
  diagnosticIncomplete: ZodOptional<ZodBoolean>;
  outcome: ZodOptional<ZodEnum<{
    aborted: "aborted";
    cancelled: "cancelled";
    completed: "completed";
    failed: "failed";
  }>>;
  durationMs: ZodNumber;
  timeoutMs: ZodOptional<ZodNumber>;
  rpcCommand: ZodOptional<ZodEnum<{
    get_state: "get_state";
    prompt: "prompt";
  }>>;
  error: ZodOptional<ZodObject<{
    name: ZodEnum<{
      AbortError: "AbortError";
      AgentProviderError: "AgentProviderError";
      AgentRuntimeError: "AgentRuntimeError";
      Error: "Error";
      PiRpcError: "PiRpcError";
      RangeError: "RangeError";
      SyntaxError: "SyntaxError";
      TypeError: "TypeError";
    }>;
    errorCode: ZodOptional<ZodUnion<readonly [ZodEnum<{
      aborted: "aborted";
      binding_incompatible: "binding_incompatible";
      busy: "busy";
      close_failed: "close_failed";
      closed: "closed";
      command: "command";
      configuration_invalid: "configuration_invalid";
      create_failed: "create_failed";
      duplicate_run_id: "duplicate_run_id";
      exited: "exited";
      interaction_not_found: "interaction_not_found";
      invalid_request: "invalid_request";
      protocol: "protocol";
      provider_error: "provider_error";
      provider_protocol_error: "provider_protocol_error";
      provider_start_failed: "provider_start_failed";
      provider_unavailable: "provider_unavailable";
      resume_failed: "resume_failed";
      run_mismatch: "run_mismatch";
      spawn: "spawn";
      timeout: "timeout";
      unsupported_capability: "unsupported_capability";
      write: "write";
    }>, ZodString]>>;
    message: ZodString;
    messageOrigin: ZodEnum<{
      omitted: "omitted";
      rpc: "rpc";
    }>;
    stack: ZodArray<ZodString>;
    redacted: ZodBoolean;
    truncated: ZodBoolean;
    cause: ZodArray<ZodObject<{
      name: ZodEnum<{
        AbortError: "AbortError";
        AgentProviderError: "AgentProviderError";
        AgentRuntimeError: "AgentRuntimeError";
        Error: "Error";
        PiRpcError: "PiRpcError";
        RangeError: "RangeError";
        SyntaxError: "SyntaxError";
        TypeError: "TypeError";
      }>;
      errorCode: ZodOptional<ZodUnion<readonly [ZodEnum<{
        aborted: "aborted";
        binding_incompatible: "binding_incompatible";
        busy: "busy";
        close_failed: "close_failed";
        closed: "closed";
        command: "command";
        configuration_invalid: "configuration_invalid";
        create_failed: "create_failed";
        duplicate_run_id: "duplicate_run_id";
        exited: "exited";
        interaction_not_found: "interaction_not_found";
        invalid_request: "invalid_request";
        protocol: "protocol";
        provider_error: "provider_error";
        provider_protocol_error: "provider_protocol_error";
        provider_start_failed: "provider_start_failed";
        provider_unavailable: "provider_unavailable";
        resume_failed: "resume_failed";
        run_mismatch: "run_mismatch";
        spawn: "spawn";
        timeout: "timeout";
        unsupported_capability: "unsupported_capability";
        write: "write";
      }>, ZodString]>>;
      message: ZodString;
      messageOrigin: ZodEnum<{
        omitted: "omitted";
        rpc: "rpc";
      }>;
      stack: ZodArray<ZodString>;
      redacted: ZodBoolean;
      truncated: ZodBoolean;
    }, $strict>>;
  }, $strict>>;
  exitCode: ZodOptional<ZodNullable<ZodNumber>>;
  exitSignal: ZodOptional<ZodNullable<ZodString>>;
  compactionCount: ZodOptional<ZodNumber>;
  compactionDurationMs: ZodOptional<ZodNumber>;
  acceptanceWindowSeq: ZodOptional<ZodNumber>;
  acceptanceWindowElapsedMs: ZodOptional<ZodNumber>;
  acceptanceTimerPaused: ZodOptional<ZodBoolean>;
  abortSource: ZodOptional<ZodEnum<{
    client_shutdown: "client_shutdown";
    run_signal: "run_signal";
    turn_timeout: "turn_timeout";
  }>>;
}, $strict>;
type PiDiagnosticRecord = output$1<typeof diagnosticSchema>;
type PiDiagnosticEvent = Omit<PiDiagnosticRecord, "version" | "seq" | "elapsedMs">;
type PiDiagnosticSink = (event: PiDiagnosticEvent) => void;
interface PiProcessExit {
  readonly code: number | null;
  readonly signal: NodeJS.Signals | null;
}
//#endregion
//#region src/providers/pi/rpc-wire.d.ts
declare const PI_RPC_MAX_LINE_BYTES: number;
declare const PI_RPC_MAX_STDERR_BYTES: number;
declare const PI_RPC_REQUEST_TIMEOUT_MS = 60000;
declare class PiRpcError extends Error {
  readonly code: "aborted" | "command" | "exited" | "protocol" | "spawn" | "timeout" | "write";
  constructor(code: "aborted" | "command" | "exited" | "protocol" | "spawn" | "timeout" | "write", message: string, options?: ErrorOptions);
}
interface PiRpcProcessSpawnOptions {
  cwd: string;
  detached: boolean;
  env: NodeJS.ProcessEnv;
}
interface PiRpcSpawnOptions {
  readonly args: readonly string[];
  readonly command?: string;
  readonly cwd: string;
  readonly env: NodeJS.ProcessEnv;
  readonly maxLineBytes?: number;
  readonly maxStderrBytes?: number;
  readonly requestTimeoutMs?: number;
  readonly logger?: ClientLogger;
  readonly spawnProcess?: (command: string, args: readonly string[], options: PiRpcProcessSpawnOptions) => ChildProcessWithoutNullStreams;
}
interface PiRpcRequestOptions {
  /**
   * Overrides the process-wide request timeout for this command. `null` disables the built-in
   * timer: the caller must bound the request with its own signal, which process exit and
   * `close()` still back up.
   */
  readonly timeoutMs?: number | null;
  /** Runs synchronously at a successful correlated response, before following wire events. */
  readonly onResponse?: () => void;
}
interface PiRpcClient {
  readonly exitStatus?: PiProcessExit;
  request(command: Readonly<Record<string, unknown>>, signal?: AbortSignal, options?: PiRpcRequestOptions): Promise<unknown>;
  subscribe(listener: (message: Readonly<Record<string, unknown>>) => void): () => void;
  close(graceMs?: number): Promise<void>;
}
declare class PiRpcProcess implements PiRpcClient {
  #private;
  constructor(options: PiRpcSpawnOptions);
  get exitStatus(): PiProcessExit | undefined;
  get pid(): number | undefined;
  subscribe(listener: (message: Readonly<Record<string, unknown>>) => void): () => void;
  request(command: Readonly<Record<string, unknown>>, signal?: AbortSignal, options?: PiRpcRequestOptions): Promise<unknown>;
  close(graceMs?: number): Promise<void>;
}
//#endregion
//#region src/providers/pi/agent-runtime.d.ts
declare const PI_AGENT_RUNTIME_MANIFEST: AgentRuntimeManifest;
interface PiRuntimeOptions {
  readonly nativeResources?: boolean;
  readonly onDiagnostic?: PiDiagnosticSink;
  readonly mcpAdapterEntry?: string;
  readonly binding: AgentRuntimeBinding;
  readonly configuration?: AgentRunConfiguration;
  readonly createClient: (args: readonly string[], extraEnvironment?: Readonly<Record<string, string>>) => PiRpcClient;
  readonly eventSink: AgentRuntimeEventSink;
  readonly policy: AgentRuntimePolicy;
  /** Budget for Pi to accept a prompt, counted only outside native compaction. */
  readonly promptAcceptanceTimeoutMs?: number;
  readonly resume: boolean;
  readonly sessionDirectory?: string;
  readonly skillPaths?: readonly string[];
  readonly systemPrompt: string;
}
interface PiAgentRuntimeFactoryOptions {
  /** Local execution only. Probes and Cloud keep discovery disabled. */
  readonly nativeResources?: boolean;
  readonly onDiagnostic?: PiDiagnosticSink;
  /** Trusted Cloud image path; Local resolves its pinned Client dependency. */
  readonly mcpAdapterEntry?: string;
  readonly process?: {
    readonly args?: readonly string[];
    readonly command?: string;
    readonly env?: NodeJS.ProcessEnv;
    readonly maxLineBytes?: number;
    readonly maxStderrBytes?: number;
    readonly probeTimeoutMs?: number;
    readonly requestTimeoutMs?: number;
    readonly sessionDirectory?: string;
    readonly spawnProcess?: (command: string, args: readonly string[], options: PiRpcProcessSpawnOptions) => ChildProcessWithoutNullStreams;
  };
  readonly createClient?: (cwd: string, args: readonly string[], environment?: Readonly<Record<string, string>>) => PiRpcClient;
  readonly createSessionId?: () => string;
  readonly probeRunner?: (signal?: AbortSignal) => Promise<{
    readonly credential: boolean;
    readonly rpc: boolean;
    readonly version: string;
  }>;
}
declare class PiAgentRuntime extends BaseAgentRuntime {
  #private;
  constructor(options: PiRuntimeOptions);
  protected executeRun(request: AgentPromptRequest, context: AgentProviderRunContext): Promise<AgentProviderRunResult>;
  protected steerProvider(request: AgentSteerRequest): Promise<void>;
  protected abortProvider(_request: AgentAbortRequest): Promise<void>;
  protected closeProvider(): Promise<void>;
}
declare class PiAgentRuntimeFactory implements AgentRuntimeFactory {
  #private;
  readonly manifest: AgentRuntimeManifest;
  constructor(options?: PiAgentRuntimeFactoryOptions);
  probe(request: AgentRuntimeProbeRequest): Promise<AgentRuntimeProbeResult>;
  getConfigurationOptions(request: AgentRuntimeConfigurationOptionsRequest): Promise<{
    modelSuggestions: string[];
    reasoningEffortAllowedValues: string[] | null;
  }>;
  create(request: CreateAgentRuntimeRequest): Promise<PiAgentRuntime>;
  resume(request: ResumeAgentRuntimeRequest): Promise<PiAgentRuntime>;
}
declare function piAgentRuntimeEnvironment(source?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
//#endregion
//#region src/runner/types.d.ts
declare const RUNNER_IDENTITY_SCHEMA_VERSION = 1;
declare const RUNNER_CLI_NAME = "opentag-runner";
type RunnerChannel = "dev" | "staging" | "prod";
type RunnerCommand = "probe" | "accept" | "identity" | "skills" | "serve" | "worker";
type RunnerMode = "offline" | "real";
interface RunnerToolLock {
  readonly git?: string;
  readonly gh?: string;
  readonly node: string;
  readonly piPackage: string;
  readonly piVersion: string;
  readonly pnpm: string;
}
interface RunnerIdentity {
  readonly channel: RunnerChannel;
  readonly cliPackageName: string;
  readonly contextTreeVersion: string;
  readonly imageId?: string;
  readonly nodeVersion: string;
  readonly piPackage: string;
  readonly piVersion: string;
  readonly pnpmVersion: string;
  readonly schemaVersion: typeof RUNNER_IDENTITY_SCHEMA_VERSION;
  readonly sourceDirty: boolean;
  readonly sourceSha: string;
  readonly toolLock: RunnerToolLock;
  readonly version: string;
}
interface RunnerCliInvocation {
  readonly command: RunnerCommand;
  readonly json: boolean;
  readonly mode: RunnerMode;
  readonly piConfigDir?: string;
  readonly provider?: string;
  readonly workspace?: string;
}
type RunnerCliParseResult = {
  readonly ok: true;
  readonly invocation: RunnerCliInvocation;
} | {
  readonly ok: false;
  readonly error: string;
  readonly exitCode: number;
};
interface RunnerAcceptanceEvent {
  readonly name: string;
  readonly status: "failed" | "skipped" | "passed";
  readonly detail?: string;
}
/** Sanitized acceptance evidence: counts and names only, never command lines or contents. */
interface RunnerAcceptanceEvidence {
  readonly cancel?: {
    readonly livePidsBeforeCancel: number;
    readonly trackedPiPids: number;
  };
  readonly skillsLoaded?: readonly string[];
  readonly tools?: {
    readonly names: readonly string[];
    readonly successfulCount: number;
  };
}
interface RunnerAcceptanceReport {
  readonly events: readonly RunnerAcceptanceEvent[];
  readonly evidence?: RunnerAcceptanceEvidence;
  readonly failed: boolean;
  readonly firstTaskMs?: number;
  readonly identity?: RunnerIdentity;
  readonly model: "failed" | "skipped" | "passed";
  readonly offline: "failed" | "passed";
  readonly skillArguments?: readonly string[];
}
//#endregion
//#region src/runner/probe.d.ts
declare const execFileAsync: typeof execFile.__promisify__;
interface RunnerToolProbe {
  readonly name: string;
  readonly detail?: string;
  readonly ok: boolean;
}
interface ProbeRunnerToolsOptions {
  readonly env?: NodeJS.ProcessEnv;
  readonly execFile?: typeof execFileAsync;
  readonly expected?: Readonly<Record<string, string>>;
  /** Default timeout for every probe; defaults to 10 seconds. */
  readonly timeoutMs?: number;
  /** Native Pi startup may need a longer budget than generic tools. */
  readonly piTimeoutMs?: number;
}
declare function probeRunnerTools(options?: ProbeRunnerToolsOptions): Promise<readonly RunnerToolProbe[]>;
//#endregion
//#region src/runtime/context-tree-connections.d.ts
/** Runtime facts shared by Local preparation, Cloud preparation, and managed prompts. */
type ContextTreeStatus = {
  status: "configured";
  connections: readonly ContextTreeResult[];
} | {
  status: "ready";
  treePath: string;
  projectPath: string;
  branch?: string;
  sha?: string;
} | {
  status: "stale";
  treePath: string;
  projectPath: string;
  reason: string;
} | {
  status: "unconfigured";
} | {
  status: "unavailable";
  reason: string;
};
type ContextTreeResult = ContextTreeConnection & Exclude<ContextTreeStatus, {
  status: "configured";
} | {
  status: "unconfigured";
}>;
//#endregion
//#region src/runtime/context-tree.d.ts
interface ContextTreePackage {
  root: string;
  cliPath: string;
  skillsPath: string;
}
type ContextTreeExecFile = (file: string, args: readonly string[], options: {
  cwd: string;
  timeout: number;
  maxBuffer: number;
  windowsHide: boolean;
  env?: NodeJS.ProcessEnv;
  signal?: AbortSignal;
}) => Promise<{
  stdout: string;
}>;
declare function resolveContextTreePackage(from?: string): ContextTreePackage | undefined;
/**
 * Run one Context Tree command and return its single JSON line.
 *
 * The CLI reports operational failures as JSON on stdout with exit code 1, and sometimes with
 * exit code 0, so the payload is authoritative and the exit code is not.
 */
declare function runContextTreeCli(contextTreePackage: ContextTreePackage, args: readonly string[], options?: {
  cwd?: string;
  network?: boolean;
  execFile?: ContextTreeExecFile;
  nodePath?: string;
  env?: NodeJS.ProcessEnv;
  signal?: AbortSignal;
}): Promise<{
  payload: unknown;
  failureCode?: string;
}>;
interface ContextTreeManagerOptions {
  home: string;
  environment?: NodeJS.ProcessEnv;
  logger?: ClientLogger;
  /** Omit to resolve the installed package; pass `null` for a manager that has none. */
  contextTreePackage?: ContextTreePackage | null;
  execFile?: ContextTreeExecFile;
  /**
   * Trusted credential mode. When true, Context Tree CLI children only run with an explicit
   * execution-local environment and never fall back to ambient host credentials.
   */
  managedCredentials?: boolean;
  platform?: NodeJS.Platform;
  /** Absolute path to the Node.js runtime the generated shim should exec. */
  nodePath?: string;
  /** Resolved Codex config home; skills install independently under account HOME's `.agents`. */
  codexHome?: string;
  sessionStartBudgetMs?: number;
  failureCooldownMs?: number;
}
/**
 * Owns each Agent's optional Context Tree wiring for Sessions.
 *
 * The repository comes from the Agent runtime snapshot; repository-owned configuration stays separate.
 *
 * Every operation here is optional memory, never a Session availability dependency: each failure
 * is reported through the managed prompt, and nothing in this class throws into Session start.
 */
declare class ContextTreeManager {
  #private;
  constructor(options: ContextTreeManagerOptions);
  /** Directory to prepend to a Session PATH so the packaged skills can invoke `context-tree`. */
  binDirectory(): string;
  /** Explicit packaged assets for providers that disable automatic workspace skill discovery. */
  skillPaths(): Promise<string[]>;
  /**
   * Resolve Context Tree for one Agent workspace, connecting it on first use.
   *
   * `cwd` must come from `AgentWorkspaceManager.cwd(agentId)`, which refuses to return a path
   * until the workspace layout state is schema-v3 `complete`. That ordering is what keeps the
   * connection from writing into a workspace still mid-migration.
   */
  ensureAgent(cwd: string, provider?: AgentRuntimeProvider, connections?: readonly ContextTreeConnection[], environment?: Readonly<Record<string, string | undefined>>): Promise<ContextTreeStatus>;
}
//#endregion
//#region src/runner/skills.d.ts
/** Packaged Context Tree skills OpenTag ships to Pi. Matches scripts/portable/runtime-dependencies.mjs. */
declare const CONTEXT_TREE_PACKAGED_SKILL_DIRECTORIES: readonly string[];
interface AssembledContextTreeSkill {
  readonly directory: string;
  readonly name: string;
  readonly skillFile: string;
}
interface AssembledContextTreeSkills {
  readonly package: ContextTreePackage;
  readonly skillPaths: readonly string[];
  readonly skills: readonly AssembledContextTreeSkill[];
  readonly skillsPath: string;
}
/**
 * Assemble the six packaged Context Tree skills using the real Client package resolver.
 * Extra directories that may exist in the npm package are ignored on purpose.
 */
declare function assembleContextTreeSkills(from?: string): Promise<AssembledContextTreeSkills>;
//#endregion
//#region src/runner/acceptance.d.ts
interface RunnerAcceptanceOptions {
  readonly assembleSkills?: () => Promise<AssembledContextTreeSkills>;
  readonly factory?: AgentRuntimeFactory;
  readonly identity?: RunnerIdentity;
  readonly mode: RunnerMode;
  readonly path?: string;
  readonly piHome: string;
  readonly probeTools?: () => Promise<readonly RunnerToolProbe[]>;
  readonly runtimeHome: string;
  readonly sessionDirectory: string;
  readonly workspace: string;
}
declare function runRunnerAcceptance(options: RunnerAcceptanceOptions): Promise<RunnerAcceptanceReport>;
//#endregion
//#region src/runner/args.d.ts
declare function parseRunnerCliArgv(argv: readonly string[]): RunnerCliParseResult;
//#endregion
//#region src/runtime/provider-cli/types.d.ts
/**
 * A managed Provider CLI is either Feishu/Lark (`lark-cli`) or Slack (`slack`).
 * The provider identifier reuses the canonical IM provider vocabulary.
 */
type ProviderCliProvider = ImCliProvider;
/**
 * Exact local selection that the daemon has inspected and accepted. This value
 * never leaves the machine; visible Runs use it to fence their immutable plan
 * to the same artifact generation that readiness verified.
 */
interface ProviderCliReadySelection {
  readonly fingerprint: string;
  readonly generation: number;
  readonly managedDigest?: string;
  readonly path: string;
  readonly version: string;
}
type ProviderCliTrust = "catalog-verified" | "compatible-unverified";
/** Local Provider CLI state machine from the management design; `checking` is an in-flight observation. */
type ProviderCliLocalState = "checking" | "absent" | "ready" | "unavailable";
/**
 * Stable local diagnostic codes. These stay local to the machine; only the coarse
 * readiness mapping may ever leave the device.
 */
type ProviderCliDiagnosticCode = "not_installed" | "global_bin_unavailable" | "launcher_invalid" | "global_command_shadowed" | "external_path_invalid" | "external_not_detected" | "external_candidate_changed" | "external_candidate_unverified" | "artifact_drifted" | "integrity_failed" | "version_incompatible" | "probe_failed" | "install_incomplete" | "credential_unavailable" | "unsupported_platform" | "operation_in_progress" | "selection_invalid";
/** Warning codes that never downgrade readiness on their own. */
type ProviderCliWarningCode = "global_command_shadowed" | "global_path_not_configured" | "external_candidate_unverified";
interface ProviderCliDiagnostic {
  readonly code: ProviderCliDiagnosticCode;
  readonly remediation?: string;
}
interface ProviderCliWarning {
  readonly code: ProviderCliWarningCode;
  readonly remediation?: string;
}
interface ProviderCliSelectionSummary {
  readonly kind: "managed" | "external";
  readonly path: string;
  readonly version: string;
  readonly trust: ProviderCliTrust;
  readonly generation: number;
}
/** Read-only inspection result for one provider. */
interface ProviderCliInspection {
  readonly provider: ProviderCliProvider;
  readonly state: Exclude<ProviderCliLocalState, "checking">;
  readonly readiness: "ready" | "install" | "unavailable";
  readonly selection?: ProviderCliSelectionSummary;
  readonly fingerprint?: string;
  readonly launcher: {
    readonly path: string;
    readonly status: "valid" | "missing" | "invalid" | "mismatch";
  };
  readonly globalCommand: {
    readonly active: boolean;
    readonly path?: string;
    readonly resolvedPath?: string;
  };
  readonly warnings: readonly ProviderCliWarning[];
  readonly diagnostic?: ProviderCliDiagnostic;
}
type ProviderCliEnsureAction = "noop" | "selected-existing" | "installed-managed" | "failed";
type ProviderCliPhase = "detect" | "select" | "managed-install" | "verify";
interface ProviderCliPhaseRecord {
  readonly phase: ProviderCliPhase;
  readonly status: "started" | "completed" | "failed";
  /** Bounded single-line human detail; never carries credentials or raw child-process output. */
  readonly detail?: string;
}
interface ProviderCliCandidateReport {
  readonly path: string;
  readonly version?: string;
  readonly trust?: ProviderCliTrust;
  readonly disposition: "selected" | "ignored";
  readonly reason: string;
}
/** Stable ensure result shape; the `--json` document serializes this verbatim per provider. */
interface ProviderCliEnsureResult {
  readonly ok: boolean;
  readonly provider: ProviderCliProvider;
  readonly action: ProviderCliEnsureAction;
  readonly phases: readonly ProviderCliPhaseRecord[];
  readonly selected?: {
    readonly path: string;
    readonly version: string;
    readonly source: string;
    readonly trust: ProviderCliTrust;
  };
  readonly candidates: readonly ProviderCliCandidateReport[];
  readonly readiness: "ready" | "unavailable";
  readonly globalCommand: {
    readonly active: boolean;
    readonly path?: string;
    readonly resolvedPath?: string;
  };
  readonly warnings: readonly ProviderCliWarning[];
  readonly diagnostic?: ProviderCliDiagnostic;
  readonly dryRun?: boolean;
}
/** Map the local state machine onto the coarse readiness vocabulary used by the Server wire. */
declare function mapProviderCliLocalStateToReadiness(state: ProviderCliLocalState): "checking" | "install" | "ready" | "unavailable";
//#endregion
//#region src/runtime/provider-cli/catalog.d.ts
/**
 * Reviewed Provider CLI catalog.
 *
 * The catalog is the only source of managed-install truth: version, platform asset,
 * digests, size bounds, probe contract, and license are reviewed static data that ship
 * in an OpenTag release. Nothing here is fetched from a mutable remote `latest`
 * manifest. Probe contracts run without credentials and never call a provider API.
 *
 * Reviewed sources:
 * - lark-cli v1.0.92 (2026-08-30) archive digests match the upstream-published `checksums.txt` from
 *   https://github.com/larksuite/cli/releases/tag/v1.0.92; executable digests were
 *   computed from those verified archives.
 * - Slack CLI v4.10.0 (2026-10-16) archive digests match GitHub release asset digests
 *   at https://github.com/slackapi/slack-cli/releases/tag/v4.10.0; executable digests
 *   were computed from those verified archives. Go 1.27 honors SSL_CERT_FILE on macOS
 *   (https://go.dev/doc/go1.27), required by the execution-local HTTPS proxy.
 */
interface ProviderCliProbeContract {
  /** Arguments that print the version, e.g. `["--version"]` or `["version"]`. */
  readonly versionArgs: readonly string[];
  /** Arguments proving the required command surface, e.g. `["im", "--help"]`. */
  readonly surfaceArgs: readonly string[];
  /** RegExp source whose first capture group is the semantic version. */
  readonly versionPattern: string;
  readonly timeoutMs: number;
  readonly maxOutputBytes: number;
}
interface ProviderCliCatalogArtifact {
  readonly platform: "darwin" | "linux";
  readonly arch: "arm64" | "x64";
  readonly archiveType: "tar.gz";
  /** Official artifact URL; the reviewed catalog is the trust root for this location. */
  readonly url: string;
  /** SHA-256 of the archive. */
  readonly sha256: string;
  /** Exact archive size; doubles as the bounded download limit. */
  readonly archiveBytes: number;
  /** Hard cap on the decompressed archive stream (decompression-bomb guard). */
  readonly maxExtractedBytes: number;
  /** Expected executable member path inside the archive (and below the version dir). */
  readonly executablePath: string;
  /** SHA-256 of the extracted executable; also the external `catalog-verified` trust digest. */
  readonly executableSha256: string;
  readonly executableBytes: number;
}
interface ProviderCliCatalogEntry {
  readonly provider: ProviderCliProvider;
  /** Native command name visible to users and Agents. */
  readonly command: "lark-cli" | "slack";
  readonly displayName: string;
  /** Exact version a managed install publishes. */
  readonly version: string;
  /** Semver range an external candidate must satisfy to be compatible. */
  readonly compatibility: string;
  readonly probes: ProviderCliProbeContract;
  /** Update-check suppression applied by the launcher for managed targets only. */
  readonly managedEnvironment: Readonly<Record<string, string>>;
  /** Global flags the launcher prepends for managed targets only. */
  readonly managedArguments: readonly string[];
  readonly license: {
    readonly name: string;
    readonly copyright: string;
    readonly notices: string;
  };
  readonly artifacts: readonly ProviderCliCatalogArtifact[];
}
declare const PROVIDER_CLI_CATALOG: readonly ProviderCliCatalogEntry[];
declare function findProviderCliCatalogEntry(provider: ProviderCliProvider, catalog?: readonly ProviderCliCatalogEntry[]): ProviderCliCatalogEntry | undefined;
declare function requireProviderCliCatalogEntry(provider: ProviderCliProvider, catalog?: readonly ProviderCliCatalogEntry[]): ProviderCliCatalogEntry;
/** Find the reviewed artifact for one platform/architecture pair. */
declare function findCatalogArtifact(entry: ProviderCliCatalogEntry, platform: NodeJS.Platform, arch: string): ProviderCliCatalogArtifact | undefined;
/** Every reviewed executable digest for a provider; backs `catalog-verified` trust. */
declare function catalogExecutableDigests(entry: ProviderCliCatalogEntry): ReadonlySet<string>;
//#endregion
//#region src/runner/catalog.d.ts
interface RunnerProviderCliPlan {
  readonly artifact: ProviderCliCatalogArtifact;
  readonly command: ProviderCliCatalogEntry["command"];
  readonly displayName: string;
  readonly entry: ProviderCliCatalogEntry;
  readonly managedArguments: readonly string[];
  readonly managedEnvironment: Readonly<Record<string, string>>;
  readonly probes: ProviderCliCatalogEntry["probes"];
  readonly provider: ProviderCliCatalogEntry["provider"];
  /** Anchored against the pinned CLI's reviewed `surfaceArgs` help banner; exit 0 alone never passes. */
  readonly surfacePattern: RegExp;
  readonly version: string;
}
/** Linux amd64 artifacts from the reviewed catalog — the only Slack/Lark pin for the Runner image. */
declare function linuxAmd64ProviderCliPlans(catalog?: readonly ProviderCliCatalogEntry[]): readonly RunnerProviderCliPlan[];
//#endregion
//#region src/runner/cli.d.ts
interface RunnerCliIo {
  readonly env?: NodeJS.ProcessEnv;
  readonly stderr: {
    write(chunk: string): void;
  };
  readonly stdout: {
    write(chunk: string): void;
  };
}
declare function runRunnerCli(argv: readonly string[], io: RunnerCliIo, cwd?: string): Promise<number>;
//#endregion
//#region src/runner/config.d.ts
interface CopyIsolatedPiConfigOptions {
  readonly destination: string;
  readonly providers: readonly string[];
  readonly source: string;
}
/**
 * Copies the whitelisted Pi config documents into a FRESH destination the Runner owns. The
 * destination must not exist yet (a preexisting directory, file, or symlink — including a
 * symlinked ancestor — is rejected, so a planted `auth.json` link can never redirect writes),
 * must not physically overlap the source, and partial copies are removed on any error.
 */
declare function copyIsolatedPiConfig(options: CopyIsolatedPiConfigOptions): Promise<string>;
//#endregion
//#region src/runner/identity.d.ts
declare function parseRunnerIdentity(value: unknown): RunnerIdentity;
declare function createRunnerIdentity(input: RunnerIdentity): RunnerIdentity;
//#endregion
//#region src/runner/redact.d.ts
/** Redact secrets from acceptance events. Failures stay visible; only sensitive content is removed. */
declare function redactAcceptanceRecord<T>(value: T): T;
//#endregion
//#region src/runtime/im-resource-fetcher.d.ts
declare class ImResourceFetcher {
  #private;
  constructor(input: {
    instanceId: string;
    api?: Pick<OpenTagApi, "openImResource">;
    machineToken?: string;
    logger?: ClientLogger;
  });
  fetchForTurn(request: DirectImMessageDeliveryRequest | RuntimeImSteerRequest, workspace: string): Promise<string | undefined>;
}
//#endregion
//#region src/runtime/provider-cli/outgoing-reply-store.d.ts
declare const OutgoingReplyReceiptSchema: ZodObject<{
  schemaVersion: ZodLiteral<1>;
  recordedAt: ZodString;
  sequenceHint: ZodNumber;
  kind: ZodEnum<{
    reply: "reply";
    send: "send";
  }>;
  messageId: ZodString;
  chatId: ZodString;
  threadId: ZodOptional<ZodString>;
  rootId: ZodOptional<ZodString>;
  parentId: ZodOptional<ZodString>;
  createTime: ZodOptional<ZodString>;
  senderType: ZodOptional<ZodString>;
  senderId: ZodOptional<ZodString>;
  msgType: ZodOptional<ZodEnum<{
    audio: "audio";
    file: "file";
    image: "image";
    interactive: "interactive";
    media: "media";
    post: "post";
    share_chat: "share_chat";
    share_user: "share_user";
    sticker: "sticker";
    text: "text";
    unknown: "unknown";
    video: "video";
  }>>;
  contentStatus: ZodEnum<{
    available: "available";
    truncated: "truncated";
    unavailable: "unavailable";
  }>;
  content: ZodOptional<ZodObject<{
    msgType: ZodEnum<{
      audio: "audio";
      file: "file";
      image: "image";
      interactive: "interactive";
      media: "media";
      post: "post";
      share_chat: "share_chat";
      share_user: "share_user";
      sticker: "sticker";
      text: "text";
      unknown: "unknown";
      video: "video";
    }>;
    text: ZodOptional<ZodString>;
    post: ZodOptional<ZodUnknown>;
    filename: ZodOptional<ZodString>;
    fileKey: ZodOptional<ZodString>;
    imageKey: ZodOptional<ZodString>;
    raw: ZodOptional<ZodString>;
    unavailable: ZodOptional<ZodEnum<{
      content_read_failed: "content_read_failed";
      content_truncated: "content_truncated";
      omitted: "omitted";
      out_of_scope: "out_of_scope";
    }>>;
  }, $strict>>;
}, $strict>;
type ProviderCliOutgoingReplyReceipt = output$1<typeof OutgoingReplyReceiptSchema>;
interface ProviderCliOutgoingReplyCollectResult {
  readonly status: "complete" | "incomplete" | "unavailable";
  readonly receipts: readonly ProviderCliOutgoingReplyReceipt[];
}
//#endregion
//#region src/runtime/provider-cli/account-layout.d.ts
/**
 * Account-global Provider CLI layout.
 *
 * The root is derived from the operating-system account record (`userInfo().homedir`),
 * never from caller environment variables or `OPENTAG_HOME`, so every OpenTag Home and
 * the daemon for one OS account observe the same installation. Windows paths are
 * reserved by the schema but are not a supported P0 platform.
 *
 * ```text
 * POSIX:   <account-home>/.opentag/provider-cli/
 * Windows: <account-local-app-data>/OpenTag/provider-cli/   (reserved, not P0)
 * ```
 */
interface ProviderCliAccountLayout {
  readonly accountHome: string;
  readonly root: string;
  /** Authoritative OpenTag Runtime command directory. */
  readonly bin: string;
  readonly versions: string;
  readonly state: string;
  readonly staging: string;
  /** Reserved for exact-target Turn plans (Provider CLI integration lands separately). */
  readonly plans: string;
  /** OpenTag-owned public shim directory shared with the portable installer. */
  readonly publicBinDir: string;
}
declare class ProviderCliAccountError extends Error {
  readonly name = "ProviderCliAccountError";
}
/**
 * Resolve the operating-system account home from the account record. Injectable so
 * tests and the CLI can point at an isolated account root without touching the real
 * account home.
 */
declare function resolveAccountHome(account?: {
  homedir: string;
}): string;
declare function resolveProviderCliAccountLayout(accountHome: string, platform?: NodeJS.Platform): ProviderCliAccountLayout;
declare function providerCliStateFilePath(layout: ProviderCliAccountLayout, provider: ProviderCliProvider): string;
declare function providerCliLockFilePath(layout: ProviderCliAccountLayout, provider: ProviderCliProvider): string;
declare function providerCliLauncherPath(layout: ProviderCliAccountLayout, command: string): string;
/**
 * The digest-addressed immutable version directory for one managed artifact:
 * `versions/<provider>/<version>/<platform>-<arch>/<archive-sha256>/`.
 */
declare function providerCliArtifactId(artifact: ProviderCliCatalogArtifact, version: string): string;
declare function providerCliVersionDirPath(layout: ProviderCliAccountLayout, provider: ProviderCliProvider, artifactId: string): string;
//#endregion
//#region src/runtime/provider-cli/turn-plan.d.ts
declare const PROVIDER_CLI_TURN_PLAN_SCHEMA_VERSION = 1;
declare const MAX_PROVIDER_CLI_TURN_PLAN_BYTES: number;
declare const MAX_PROVIDER_CLI_TURN_IDENTITY_BYTES = 4096;
type ProviderCliTurnPlanErrorCode = "selection_missing" | "selection_invalid" | "artifact_drifted" | "target_invalid" | "active_run_conflict" | "plan_invalid" | "plan_missing" | "provider_mismatch" | "run_mismatch" | "session_mismatch" | "home_mismatch" | "unsafe" | "too_large" | "invalid_identity" | "runner_failed";
declare class ProviderCliTurnPlanError extends Error {
  readonly code: ProviderCliTurnPlanErrorCode;
  readonly name = "ProviderCliTurnPlanError";
  constructor(code: ProviderCliTurnPlanErrorCode, message: string);
}
type ProviderCliTurnPlanCommand = "lark-cli" | "slack";
/**
 * Immutable exact-target plan for one visible Turn Run. The on-disk document is the
 * execution authority; later selection replacements must not rewrite it.
 */
type ProviderCliTurnPlanShared = {
  readonly schemaVersion: typeof PROVIDER_CLI_TURN_PLAN_SCHEMA_VERSION;
  readonly command: ProviderCliTurnPlanCommand;
  readonly selectionVersion: string;
  readonly selectionGeneration: number;
  readonly targetPath: string;
  readonly fingerprint: string;
  readonly homeNamespace: string;
  readonly sessionId: string;
  readonly runId: string;
  readonly captureOutgoingReplies?: boolean;
  /**
   * Runtime proxy mode: absolute path of the current execution environment manifest.
   * The Turn runner merges it into the CLI subprocess environment (null unsets).
   */
  readonly environmentManifest?: string;
};
type ProviderCliTurnPlanSelection = {
  readonly selectionKind: "managed";
  readonly artifactId: string;
} | {
  readonly selectionKind: "external";
};
type ProviderCliTurnPlan = (ProviderCliTurnPlanShared & ProviderCliTurnPlanSelection & {
  readonly provider: "feishu";
  readonly command: "lark-cli";
}) | (ProviderCliTurnPlanShared & ProviderCliTurnPlanSelection & {
  readonly provider: "slack";
  readonly command: "slack";
  readonly configDir: string;
  /** Runtime proxy mode: loopback HTTPS endpoint pinned through `--apihost`. */
  readonly slackApiHost?: string;
});
declare function providerCliCommandForProvider(provider: ProviderCliProvider): ProviderCliTurnPlanCommand;
/** Irreversible namespace for one canonical OpenTag Home under the account-global plans root. */
declare function deriveProviderCliHomeNamespace(home: string): string;
/** Irreversible Session directory key; caller-supplied IDs never become path segments. */
declare function deriveProviderCliSessionKey(sessionId: string): string;
/** Irreversible Run directory key; caller-supplied IDs never become path segments. */
declare function deriveProviderCliRunKey(runId: string): string;
declare function parseProviderCliTurnPlan(value: unknown): ProviderCliTurnPlan;
/** Bounded secure read of an immutable Turn plan. Missing files are `undefined`. */
declare function readProviderCliTurnPlan(path: string): Promise<ProviderCliTurnPlan | undefined>;
//#endregion
//#region src/runtime/provider-cli/turn-plan-manager.d.ts
interface ProviderCliTurnPlanManagerDeps {
  /** OS account home (from the account record), never caller $HOME. */
  readonly accountHome: string;
  /** Canonical OpenTag Home used as the irreversible plans namespace. */
  readonly openTagHome: string;
  /** Absolute argv that starts the current daemon Node and loads the runner module. */
  readonly runnerInvocation: readonly string[];
  /** Production readiness fence. Omit only in isolated storage tests. */
  readonly readySelection?: (provider: ProviderCliProvider, signal?: AbortSignal) => Promise<ProviderCliReadySelection | undefined>;
  readonly platform?: NodeJS.Platform;
  readonly sleep?: (ms: number) => Promise<void>;
}
interface ProviderCliTurnPlanPrepareInput {
  readonly provider: ProviderCliProvider;
  readonly sessionId: string;
  readonly runId: string;
  /** Absolute Slack config leaf supplied by the trusted caller; Feishu must omit this. */
  readonly configDir?: string;
  readonly captureOutgoingReplies?: boolean;
  /** Absolute path of the current execution credential environment manifest. */
  readonly environmentManifest?: string;
  /** Runtime proxy mode: loopback HTTPS endpoint pinned through `--apihost` (Slack only). */
  readonly slackApiHost?: string;
}
interface ProviderCliPreparedTurnPlan {
  readonly plan: ProviderCliTurnPlan;
  readonly planPath: string;
  readonly launcherPath: string;
  readonly sessionDir: string;
  readonly homeNamespace: string;
}
/**
 * Publishes and recovers per-Run exact-target plans under the account-global plans
 * root. Plans are isolated first by canonical OpenTag Home namespace, then by
 * irreversible Session key. This manager does not touch AgentTurnRunner,
 * SessionMessageInbox, SessionRuntimeManager, or daemon readiness.
 */
declare class ProviderCliTurnPlanManager {
  #private;
  constructor(deps: ProviderCliTurnPlanManagerDeps);
  get layout(): ProviderCliAccountLayout;
  get homeNamespace(): string;
  sessionDir(sessionId: string): string;
  /**
   * Read the exact current selection, verify its canonical target and fingerprint,
   * and atomically publish an immutable Run plan. A different active Run for the
   * same Session is rejected; the same Run is idempotent even if selection later
   * changes.
   */
  prepare(input: ProviderCliTurnPlanPrepareInput, signal?: AbortSignal): Promise<ProviderCliPreparedTurnPlan>;
  /**
   * Remove the matching Run's plan. The launcher deliberately remains as a
   * fail-closed PATH sentinel: without its plan it exits non-zero instead of
   * allowing a shell to fall through to an ambient provider CLI.
   */
  cleanup(input: ProviderCliTurnPlanPrepareInput): Promise<void>;
  /**
   * Crash recovery for this canonical OpenTag Home only. Sibling Home namespaces under
   * the same account-global plans root are never listed or removed.
   */
  recover(): Promise<void>;
}
//#endregion
//#region src/runtime/im-credential-environment-manager.d.ts
declare class ImCredentialEnvironmentError extends Error {
  readonly code: string;
  constructor(code: string);
}
interface ImCredentialEnvironmentManagerOptions {
  readonly connection: Pick<RuntimeConnection, "send" | "subscribeBusinessFrames">;
  readonly exchangeFeishuToken?: (grant: Extract<RuntimeImCredentialGrantResult, {
    status: "succeeded";
  }>["grant"] & {
    provider: "feishu";
  }, signal?: AbortSignal) => Promise<string>;
  readonly home: string;
  readonly listArtifacts?: (root: string) => Promise<readonly string[]>;
  readonly logger?: Pick<ClientLogger, "debug" | "warn">;
  readonly platform?: NodeJS.Platform;
  readonly removePath?: (path: string, options: {
    force: true;
    recursive?: true;
  }) => Promise<void>;
  readonly writeEnvironmentFile?: (path: string, content: string, mode: number) => Promise<void>;
}
interface ImCredentialGrantSubject {
  readonly agentId: string;
  readonly placementGeneration: number;
  readonly sessionId: string;
}
interface PreparedImCredentialEnvironment {
  readonly environmentManifest: string;
  readonly outboxContext?: RuntimeImOutboxContext;
  readonly path: string;
  readonly provider: "feishu" | "slack";
  /** Private Slack CLI config leaf for this Session; omitted for Feishu. */
  readonly slackConfigDir?: string;
}
declare class ImCredentialEnvironmentManager {
  #private;
  constructor(options: ImCredentialEnvironmentManagerOptions);
  pathForSession(sessionId: string): string;
  activeSlackConfigDirForSession(sessionId: string): string | undefined;
  prepare(request: ImCredentialGrantSubject, signal?: AbortSignal): Promise<PreparedImCredentialEnvironment>;
  cleanup(sessionId: string): Promise<void>;
  close(): Promise<void>;
}
declare function serializeEnvironment(environment: Readonly<Record<string, string | undefined>>, platform: NodeJS.Platform): string;
//#endregion
//#region src/runtime/runtime-proxy-material.d.ts
declare const RUNTIME_PROXY_SHIM_MARKER = "# opentag-runtime-proxy-shim: v1";
declare const RUNTIME_PROXY_GIT_HELPER_MARKER = "# opentag-runtime-proxy-git-helper: v1";
/** Environment assembled for one execution; `undefined` unsets the inherited variable. */
type RuntimeProxyEnvironment = Readonly<Record<string, string | undefined>>;
interface RuntimeProxyExecutionLayout {
  readonly adapterCaCertPath: string;
  readonly executionDir: string;
  readonly gitCredentialHelperPath: string;
  readonly gitConfigPath: string;
  readonly larkConfigDir: string;
  readonly slackConfigDir: string;
}
interface RuntimeProxyEnvironmentInput {
  readonly adapterCaCertPath: string;
  readonly executionId?: string;
  readonly cliMetadata: (provider: RuntimeProxyProvider) => RuntimeProxyCliMetadata | undefined;
  readonly connectProxyUrl: string;
  readonly handles: ReadonlyMap<RuntimeProxyProvider, string>;
  readonly layout: RuntimeProxyExecutionLayout;
  readonly slackApiHost: string;
}
/**
 * Build the CLI environment for one execution. Sandbox-visible values only: the local
 * handle, loopback addresses, the public CA path, and non-secret CLI metadata. No
 * capability, platform token, App Secret, Bot Token, or machine token. No `GH_REPO`:
 * GitHub target resolution stays with cwd, `-R`, and the canonical remote path.
 */
declare function buildRuntimeProxyEnvironment(input: RuntimeProxyEnvironmentInput): RuntimeProxyEnvironment;
declare function renderRuntimeProxyGitCredentialHelper(handle: string, privateHttp?: boolean): string;
declare function renderRuntimeProxyShim(binary: string, environmentFilePath: string): string;
/**
 * Per-Session proxy material store. The stable env file/manifest/shims point at the
 * current execution; every rotating secret-bearing artifact lives under
 * `executions/<executionId>/` so a stale cleanup cannot delete successor material.
 */
declare class RuntimeProxyMaterialStore {
  #private;
  constructor(options: {
    readonly home: string;
  });
  get root(): string;
  sessionDir(sessionId: string): string;
  /** Stable per-Session env file path wired to `OPENTAG_PROVIDER_ENV_FILE`. */
  environmentFilePath(sessionId: string): string;
  manifestPath(sessionId: string): string;
  shimDir(sessionId: string): string;
  executionLayout(sessionId: string, executionId: string): RuntimeProxyExecutionLayout;
  /**
   * Publish one execution's material atomically: per-execution artifacts first, then
   * the stable env file and manifest, then the git/gh shims.
   */
  publish(input: {
    readonly adapterCaCertPath: string;
    readonly environment: RuntimeProxyEnvironment;
    readonly executionId: string;
    readonly handles: ReadonlyMap<RuntimeProxyProvider, string>;
    readonly githubApiSocketPath?: string;
    readonly githubGitSocketPath?: string;
    readonly platform: NodeJS.Platform;
    readonly sessionId: string;
  }): Promise<RuntimeProxyExecutionLayout>;
  /** Execution marker recorded in the stable env file; undefined when absent/foreign. */
  publishedExecution(sessionId: string): Promise<string | undefined>;
  /**
   * Exact-execution cleanup: remove the execution directory; remove the stable env
   * file and manifest only while they still belong to this execution.
   */
  cleanupExecution(sessionId: string, executionId: string): Promise<void>;
  /** Remove every proxy artifact for the Session (Session stop / shutdown). */
  cleanupSession(sessionId: string): Promise<void>;
  /** Startup sweep: remove every managed Session directory left by a previous run. */
  cleanupStale(): Promise<void>;
}
//#endregion
//#region src/runtime/runtime-credential-environment-manager.d.ts
type RuntimeCredentialMode = "legacy" | "proxy";
interface RuntimeCredentialRunSubject {
  readonly runId: string;
  readonly source: RuntimeExecutionSource;
}
interface RuntimeCredentialPrepareSubject extends ImCredentialGrantSubject {
  /** Real Run identity and accepted-delivery/Session-message/validation source. */
  readonly run?: RuntimeCredentialRunSubject;
}
/**
 * One Server-authorized proxy validation execution (`source.kind === "validation"`). The
 * caller must obtain the Server-issued `validationRunId` through the readiness control
 * flow; the Client never invents one. Read-only identity scope only.
 */
interface RuntimeCredentialValidationSubject {
  readonly agentId: string;
  readonly placementGeneration: number;
  readonly validationRunId: string;
}
interface PreparedProxyValidationSession {
  readonly arguments: readonly string[];
  readonly environment: Readonly<Record<string, string>>;
  readonly executionId: string;
  readonly signal: AbortSignal;
  readonly slackApiHost?: string;
  cleanup(): Promise<void>;
}
/** Trusted web tools launch facts for one execution; the socket path is a nonsecret descriptor. */
interface PreparedWebToolsLaunch {
  readonly extensionPath: string;
  readonly socketPath: string;
}
/**
 * MCP gateway launch facts for one execution.
 *
 * The `url` is composed here against the Server origin this Client already pinned — the Server sends
 * only the fixed path, so nothing it says can redirect the provider CLI somewhere else. The token is
 * a secret, but an execution-scoped one: it stops working when this execution ends.
 */
interface PreparedMcpGatewayLaunch {
  readonly url: string;
  readonly token: string;
}
interface PreparedRuntimeCredentialEnvironment {
  /** Local-only exact proxy socket for this execution. Cloud uses its mounted bridge. */
  readonly allowedUnixSockets?: readonly string[];
  /** Present in proxy mode; exact-execution cleanup token. */
  readonly executionId?: string;
  /** Execution environment manifest merged by the Turn launcher. */
  readonly environmentManifest?: string;
  readonly outboxContext?: RuntimeImOutboxContext;
  readonly path: string;
  /** IM provider for Turn plan/outbox flows; absent for GitHub-only executions. */
  readonly provider?: "feishu" | "slack";
  /** Every provider opened for this execution, in Server-granted order, when known. */
  readonly providers?: readonly RuntimeProxyProvider[];
  /** Proxy mode: fires on revocation, close, or control/owner replacement. */
  readonly signal?: AbortSignal;
  /** Proxy mode: loopback HTTPS endpoint for the Slack `--apihost` launcher flag. */
  readonly slackApiHost?: string;
  readonly slackConfigDir?: string;
  /** Present only while this execution carries an authorized web service with a live gateway. */
  readonly web?: PreparedWebToolsLaunch;
  /** Present only while this execution holds a live MCP gateway bearer. */
  readonly mcp?: PreparedMcpGatewayLaunch;
}
interface RuntimeCredentialEnvironmentManagerOptions {
  readonly connection: Pick<RuntimeConnection, "capabilityVersion" | "send" | "subscribeBusinessFrames" | "subscribeState">;
  readonly dataConnectionFactory?: RuntimeProxyDataConnectionFactory;
  readonly generateCa?: (materialDir: string) => Promise<RuntimeProxyLoopbackCaMaterial>;
  readonly home: string;
  /** Optional legacy seam (tests); production composition uses the default. */
  readonly legacy?: (options: ImCredentialEnvironmentManagerOptions) => ImCredentialEnvironmentManager;
  readonly logger?: Pick<ClientLogger, "debug" | "warn">;
  /**
   * Explicit mode selection. `"proxy"` never falls back to raw materials; `"legacy"`
   * keeps the existing Local behavior unchanged. Default `"legacy"`.
   */
  readonly mode?: RuntimeCredentialMode;
  readonly now?: () => number;
  readonly openBudgetMs?: number;
  readonly platform?: NodeJS.Platform;
  /** Trusted Cloud Sandbox binding facts for the Session, when composed for Cloud. */
  readonly sandboxForSession?: (sessionId: string) => RuntimeExecutionSandbox | undefined;
  readonly scheduler?: RuntimeRelayScheduler;
  /** Base Server URL for the data endpoint; required in proxy mode. */
  readonly serverUrl?: string;
  /**
   * Explicit web tools opt-in (deployment + negotiated capability required too). The extension
   * path is the fixed trusted built artifact; the machine token never leaves this process.
   */
  readonly webTools?: {
    readonly extensionPath: string;
    /** The Local Computer's machine token; used as the web-route bearer for this execution. */
    readonly bearerToken: string;
    readonly fetchImpl?: typeof fetch;
  };
}
/**
 * Runtime credential environment lifecycle with explicit proxy mode. Proxy mode opens
 * a trusted execution through the control connection, holds short-lived capabilities
 * only inside the trusted Relay, and materializes execution-local handles, CA, CLI
 * config, and shims for the Sandbox. Legacy mode delegates to the existing IM
 * credential environment manager unchanged.
 */
declare class RuntimeCredentialEnvironmentManager {
  #private;
  constructor(options: RuntimeCredentialEnvironmentManagerOptions);
  get mode(): RuntimeCredentialMode;
  pathForSession(sessionId: string): string;
  activeSlackConfigDirForSession(sessionId: string): string | undefined;
  /** Proxy shim directory prepended to the Session PATH in proxy mode. */
  shimDirForSession(sessionId: string): string | undefined;
  /**
   * Current execution CLI env map (defined values) for the Agent runtime: execution-scoped
   * handles and routing inputs only, never the standard proxy/CA variables. Provider CLI
   * children derive those from the same execution through `providerRoutingEnvironment`.
   */
  environmentForSession(sessionId: string): Readonly<Record<string, string>> | undefined;
  configureContextTree(sessionId: string, cwd: string, sources: readonly ContextTreeConnection[]): void;
  /**
   * Raw execution environment for trusted host-side CLI children (for example Context Tree Git).
   * The standard proxy/CA variables are derived here because these consumers are allowed to use
   * the credential proxy; the Agent runtime environment intentionally never receives them. Unlike
   * `environmentForSession`, `undefined` entries are preserved so a caller can unset inherited
   * ambient credentials (for example a daemon-level `GITHUB_TOKEN`). Legacy mode returns
   * `undefined`; the returned map is valid only for the current execution.
   */
  executionEnvironmentForSession(sessionId: string): Readonly<Record<string, string | undefined>> | undefined;
  /** Current execution id for a Session, when a proxy execution is active. */
  executionIdForSession(sessionId: string): string | undefined;
  /** Trusted web tools launch facts for the Session's live execution, when authorized and started. */
  webToolsForSession(sessionId: string): PreparedWebToolsLaunch | undefined;
  prepare(request: RuntimeCredentialPrepareSubject, signal?: AbortSignal): Promise<PreparedRuntimeCredentialEnvironment>;
  /**
   * Open a Server-authorized validation execution through the same Relay/data path as a
   * business Run. Raw grant material is never accepted; the local adapter only receives
   * execution-local handles and the loopback CA. Release with `cleanup()` before reporting.
   */
  prepareValidationSession(request: RuntimeCredentialValidationSubject, signal?: AbortSignal): Promise<PreparedProxyValidationSession>;
  cleanup(sessionId: string, executionId?: string): Promise<void>;
  close(): Promise<void>;
}
//#endregion
//#region src/runtime/session-binding-store.d.ts
declare const SESSION_BINDING_SCHEMA_VERSION: 3;
declare const SESSION_RECORDED_INPUT_LIMIT = 64;
type UnresolvedTurnPhase = "accepted" | "starting" | "running" | "reporting";
interface RecordedTurnInput {
  kind: "turn";
  deliveryId: string;
  inputHash: string;
  requestId?: string;
  report?: TurnReportRequest;
  resultHash: string;
  turnId: string;
}
interface RecordedSteerInput {
  kind: "steer";
  deliveryId: string;
  inputHash: string;
  requestId: string;
  rootDeliveryId: string;
  turnId: string;
  report?: undefined;
  resultHash?: undefined;
}
type RecordedInput = RecordedTurnInput | RecordedSteerInput;
interface UnresolvedTurn {
  requestId: string;
  deliveryId: string;
  inputHash: string;
  turnId: string;
  phase: UnresolvedTurnPhase;
  providerTurnId?: string;
  report?: TurnReportRequest;
  resultHash?: string;
}
interface LocalSessionBinding {
  schemaVersion: typeof SESSION_BINDING_SCHEMA_VERSION;
  sessionId: string;
  agentId: string;
  workspaceId: string;
  placementGeneration: number;
  provider: string;
  /** Persisted field name retained for schema-v1/v2 compatibility; value identifies the Provider artifact boundary. */
  providerHomeIdentity: string;
  runtimeBinding?: AgentRuntimeBinding;
  appliedSessionRevisionSequence: number;
  appliedSessionRevisionId: string;
  sessionConfigHash: string;
  lastEffectiveSnapshotHash: string;
  recentRecordedInputs: RecordedInput[];
  unresolvedTurn?: UnresolvedTurn;
}
interface SessionPreparationResult {
  binding: LocalSessionBinding;
  unresolvedTurn?: UnresolvedTurn;
}
type CustodyResult = {
  status: "committed";
  binding: LocalSessionBinding;
  unresolvedTurn: UnresolvedTurn;
} | {
  status: "existing";
  binding: LocalSessionBinding;
  unresolvedTurn: UnresolvedTurn;
} | {
  status: "recorded";
  binding: LocalSessionBinding;
  recorded: RecordedTurnInput;
} | {
  status: "absorbed";
  binding: LocalSessionBinding;
  recorded: RecordedSteerInput;
};
declare class SessionBindingConflictError extends Error {
  readonly code: "conflict" | "recovery_required" | "stale";
  constructor(code: "conflict" | "recovery_required" | "stale", message: string);
}
interface SessionBindingStoreOptions {
  home: string;
  providerArtifactIdentity(providerId: string): string | undefined;
  recordedInputLimit?: number;
}
declare class SessionBindingStore {
  #private;
  constructor(options: SessionBindingStoreOptions);
  read(agentId: string, sessionId: string): Promise<LocalSessionBinding | undefined>;
  validatePreparation(request: SessionReconcileRequest, hashes: RuntimeSnapshotHashes): Promise<void>;
  prepare(request: SessionReconcileRequest, hashes: RuntimeSnapshotHashes): Promise<SessionPreparationResult>;
  recordAccepted(request: DirectImMessageDeliveryRequest, inputHash: string, turnId: string): Promise<CustodyResult>;
  getSteerReceipt(request: RuntimeImSteerRequest, inputHash: string): Promise<RecordedSteerInput | undefined>;
  getAbsorbedReceipt(request: DirectImMessageDeliveryRequest): Promise<RecordedSteerInput | undefined>;
  recordSteer(request: RuntimeImSteerRequest, inputHash: string): Promise<RecordedSteerInput>;
  updateUnresolved(agentId: string, sessionId: string, turnId: string, phase: UnresolvedTurnPhase, fields?: {
    providerTurnId?: string;
    report?: TurnReportRequest;
    resultHash?: string;
  }): Promise<LocalSessionBinding>;
  saveRuntimeBinding(agentId: string, sessionId: string, effectiveSnapshotHash: string, runtimeBinding: AgentRuntimeBinding): Promise<LocalSessionBinding>;
  recordResult(agentId: string, sessionId: string, turnId: string, resultHash: string): Promise<LocalSessionBinding>;
}
//#endregion
//#region src/skills/skill-archive.d.ts
/**
 * Local packing and extraction for Agent Skills.
 *
 * `packSkillDirectory` turns a skill directory into the canonical `tar.gz` archive the platform
 * stores; `extractSkillArchive` is the only place a downloaded bundle becomes files. Both are
 * deliberately paranoid: a Skill an Agent authors may contain anything, and a bundle from the
 * platform must never be able to write outside the directory the caller nominated.
 */
/** The content-digest sidecar the Client writes next to `SKILL_MARKER_FILE` in managed directories. */
declare const SKILL_CONTENT_SIDECAR_FILE = ".opentag-skill.content";
type SkillArchiveErrorCode = "not_a_directory" | "manifest_missing" | "manifest_invalid" | "name_reserved" | "symlink" | "unsupported_entry" | "too_many_entries" | "unpacked_too_large" | "path_too_long" | "archive_too_large" | "archive_invalid" | "unsafe_member" | "destination_not_empty" | "io_failed";
declare class SkillArchiveError extends Error {
  readonly code: SkillArchiveErrorCode;
  constructor(code: SkillArchiveErrorCode, message: string, options?: ErrorOptions);
}
interface PackedSkillDirectory {
  readonly archive: Uint8Array;
  /** The manifest name, already validated and non-reserved. */
  readonly name: string;
  /** Lowercase hex SHA-256 over the compressed archive bytes. */
  readonly sha256: string;
  /** Number of files in the archive (directories are not counted). */
  readonly fileCount: number;
}
declare function packSkillDirectory(directory: string): Promise<PackedSkillDirectory>;
declare function extractSkillArchive(stream: Readable, targetDirectory: string): Promise<void>;
//#endregion
//#region src/skills/skill-install.d.ts
/** Content digest of a directory, ignoring the platform marker and its sidecar. */
declare function hashSkillDirectory(root: string): Promise<string>;
//#endregion
//#region src/skills/skill-roots.d.ts
/**
 * Workspace-relative roots that sync reads and writes, and the check that keeps them real.
 *
 * A workspace can contain a symlink where a root should be — most dangerously a provider skills
 * root that points into another workspace, where a removal pass would delete that workspace's
 * Skills. Every root is validated before anything is listed, read, or removed. Absence is fine; a
 * symlink or any non-directory on the path, or a root that resolves outside the workspace, is not.
 */
/** The roots, relative to an Agent workspace, that hold Agent-scoped Skills. */
declare function skillRootForProvider(cwd: string, provider: AgentRuntimeProvider): string;
/**
 * Whether sync has ever started in this workspace.
 *
 * The staging root is the sentinel: sync creates it on every runtime start. Requiring it stops
 * adoption from marking a directory nested inside a checkout that sync never manages.
 */
declare function isSyncedWorkspace(workspace: string): Promise<boolean>;
//#endregion
//#region src/skills/skill-sync.d.ts
declare const SKILL_SYNC_DEFAULT_BUDGET_MS = 15000;
interface SkillSyncApi {
  getComputerSkillManifest(machineToken: string, agentId: string, options?: {
    signal?: AbortSignal;
  }): Promise<RuntimeSkillManifest>;
  openComputerSkillBundle(machineToken: string, agentId: string, skillId: string, options?: {
    signal?: AbortSignal;
  }): Promise<Response>;
}
interface SkillSyncManagerOptions {
  readonly api: SkillSyncApi;
  readonly machineToken: () => Promise<string>;
  readonly logger: ClientLogger;
  readonly now?: () => number;
  readonly budgetMs?: number;
  /** Test seam for the final staged-directory rename; defaults to the real `rename`. */
  readonly rename?: typeof rename;
}
interface SkillSyncAgentInput {
  readonly agentId: string;
  readonly cwd: string;
  readonly provider: AgentRuntimeProvider;
}
type SkillSyncStatus = "synced" | "unavailable";
interface SkillSyncResult {
  /** Absolute paths of the installed skill directories (Pi consumes these as `--skill`). */
  readonly skillPaths: readonly string[];
  readonly status: SkillSyncStatus;
}
interface SkillDirectoryMarkerInput {
  readonly skillId: string;
  readonly archiveSha256: string;
}
/**
 * Mark an existing directory as platform-managed so the next sync owns it.
 *
 * `skill push` calls this when the directory it uploaded is the Skill's own materialization
 * target; without it the authored directory would shadow its platform copy forever.
 */
declare function markSkillDirectoryManaged(directory: string, input: SkillDirectoryMarkerInput): Promise<void>;
/** True when `directory` is where the platform would materialize `name`, regardless of provider. */
declare function isSkillMaterializationTarget(directory: string, name: string): boolean;
/**
 * The Agent workspace that contains `directory` as one of its Skill materialization targets.
 *
 * Matched purely on the path shape `<workspace>/<.claude|.agents|.opentag>/skills/<name>`, walking
 * up from the directory itself, so adoption still works when the caller has `cd`-ed into the skill
 * directory. No provider or ambient cwd is needed.
 */
declare function resolveMaterializationWorkspace(directory: string, name: string): string | undefined;
declare class SkillSyncManager {
  #private;
  constructor(options: SkillSyncManagerOptions);
  ensureAgent(input: SkillSyncAgentInput): Promise<SkillSyncResult>;
}
//#endregion
//#region src/runtime/agent-runtime-provider-registry.d.ts
interface AgentRuntimeProviderRegistration {
  readonly artifactIdentity: string;
  readonly factory: AgentRuntimeFactory;
  readonly policy: (snapshot: EffectiveRuntimeSnapshot) => AgentRuntimePolicy;
  readonly requiresBindingReplacement?: (binding: AgentRuntimeBinding, hostedTools: AgentHostedTools | undefined) => boolean;
  readonly validate: (snapshot: EffectiveRuntimeSnapshot) => InputRejectReason | undefined;
  readonly verifyArtifact?: (signal?: AbortSignal) => Promise<void>;
}
declare class AgentRuntimeProviderUnavailableError extends Error {
  readonly providerId: string;
  readonly result: AgentRuntimeProbeResult;
  constructor(providerId: string, result: AgentRuntimeProbeResult, options?: ErrorOptions);
}
declare class AgentRuntimeProviderRegistry {
  #private;
  constructor(registrations?: readonly AgentRuntimeProviderRegistration[]);
  registration(providerId: string): AgentRuntimeProviderRegistration | undefined;
  providerIds(): readonly AgentRuntimeProvider[];
  artifactIdentity(providerId: string): string | undefined;
  isReady(providerId: string): boolean;
  invalidate(providerId: string, result?: AgentRuntimeProbeResult): void;
  probeResult(providerId: string): AgentRuntimeProbeResult | undefined;
  validate(snapshot: EffectiveRuntimeSnapshot): InputRejectReason | undefined;
  validateConfiguration(snapshot: EffectiveRuntimeSnapshot): InputRejectReason | undefined;
  ensureReady(providerId: string, signal?: AbortSignal): Promise<void>;
  refresh(providerId: string, signal?: AbortSignal): Promise<boolean>;
}
//#endregion
//#region src/runtime/runtime-paths.d.ts
declare function deriveRuntimeKey(kind: "agent" | "session" | "snapshot", id: string): string;
interface AgentRuntimePaths {
  agentsFile: string;
  effectiveSnapshotsRoot: string;
  files: string;
  legacyAgentsFile: string;
  runtimeRoot: string;
  sessionBindingsRoot: string;
  sessions: string;
  snapshots: string;
  workspaceRoot: string;
  workspaceState: string;
  workspaceStatesRoot: string;
  workspaceTransitionRoot: string;
}
declare function agentRuntimePaths(home: string, agentId: string): AgentRuntimePaths;
declare function sessionBindingPath(home: string, agentId: string, sessionId: string): string;
declare function snapshotPath(home: string, agentId: string, snapshotHash: string): string;
//#endregion
//#region src/runtime/session-reconciler.d.ts
type SessionActivityPhase = "running" | "reporting";
interface SessionTurnIdentity {
  deliveryId: string;
  turnId: string;
}
interface SessionActivity extends SessionTurnIdentity {
  phase: SessionActivityPhase;
}
/** Authoritative protected-work snapshot: live Turn activity and unresolved recovered Turns. */
interface SessionProtectedWorkSnapshot {
  activities: Array<SessionActivity & {
    sessionId: string;
  }>;
  recoveries: Array<SessionTurnIdentity & {
    sessionId: string;
  }>;
}
interface RuntimePreparation {
  validateSession?(request: SessionReconcileRequest, hashes: RuntimeSnapshotHashes): Promise<void>;
  prepareAgent(snapshot: EffectiveRuntimeSnapshot, hashes: RuntimeSnapshotHashes): Promise<void>;
  verifyAgent?(snapshot: EffectiveRuntimeSnapshot, hashes: RuntimeSnapshotHashes): Promise<void>;
  requiresSessionPreparation?(request: SessionReconcileRequest, hashes: RuntimeSnapshotHashes): boolean;
  prepareSession(request: SessionReconcileRequest, hashes: RuntimeSnapshotHashes): Promise<{
    unresolvedTurn?: SessionTurnIdentity;
  } | undefined>;
  stopSession(sessionId: string, placementGeneration: number): Promise<void>;
}
interface RuntimeLocalPolicy {
  validate(snapshot: EffectiveRuntimeSnapshot): InputRejectReason | undefined;
  validateDelivery?(snapshot: EffectiveRuntimeSnapshot): InputRejectReason | undefined;
}
interface SessionReconcilerOptions {
  installationId: string;
  localPolicy?: RuntimeLocalPolicy;
  maxRememberedRequests?: number;
  preparation?: RuntimePreparation;
}
interface AgentRuntimeState extends RuntimeSnapshotHashes {
  agentId: string;
  provider: string;
  revisionId: string;
  revisionSequence: number;
  workspaceId: string;
}
interface SessionRuntimeState extends RuntimeSnapshotHashes {
  agentId: string;
  placementGeneration: number;
  provider: string;
  revisionId: string;
  revisionSequence: number;
  sessionId: string;
  sessionKind: "visible" | "internal";
  status: "ready" | "stopped";
  workspaceId: string;
}
declare class SessionReconciler {
  #private;
  constructor(options: SessionReconcilerOptions);
  getAgent(agentId: string): AgentRuntimeState | undefined;
  /**
   * The authoritative local record of work whose interruption could lose or duplicate an accepted
   * Turn: live per-Session Turn activity plus unresolved Turns recovered from durable state that
   * still owe the Server a completion report. Accepted-but-undrained Session messages are owned by
   * the Session message inbox, which registers its drains here as activity.
   */
  protectedWorkSnapshot(): SessionProtectedWorkSnapshot;
  getSession(sessionId: string): SessionRuntimeState | undefined;
  setActivity(sessionId: string, activity: SessionActivity): void;
  clearActivity(sessionId: string, turnId: string): boolean;
  setRecovery(sessionId: string, turn: SessionTurnIdentity): void;
  clearRecovery(sessionId: string, turnId: string): boolean;
  claimRecovery(sessionId: string, turn: SessionTurnIdentity): boolean;
  reconcile(input: SessionReconcileRequest): Promise<SessionReconcileResult>;
  checkDelivery(input: DirectImMessageDeliveryRequest): InputRejectReason | undefined;
  checkSessionMessageDelivery(input: SessionMessageDeliveryRequestV3): InputRejectReason | undefined;
  withAgentLock<T>(agentId: string, task: () => Promise<T>): Promise<T>;
}
//#endregion
//#region src/runtime/agent-workspace.d.ts
interface AgentWorkspaceManagerOptions {
  bindingStore: SessionBindingStore;
  home: string;
}
declare class AgentWorkspaceManager implements RuntimePreparation {
  #private;
  constructor(options: AgentWorkspaceManagerOptions);
  prepareAgent(snapshot: EffectiveRuntimeSnapshot, _hashes: RuntimeSnapshotHashes): Promise<void>;
  validateSession(request: SessionReconcileRequest, hashes: RuntimeSnapshotHashes): Promise<void>;
  prepareSession(request: SessionReconcileRequest, hashes: RuntimeSnapshotHashes): Promise<SessionPreparationResult>;
  verifyAgent(snapshot: EffectiveRuntimeSnapshot, hashes: RuntimeSnapshotHashes): Promise<void>;
  stopSession(_sessionId: string, _placementGeneration: number): Promise<void>;
  cwd(agentId: string): Promise<string>;
  paths(agentId: string): AgentRuntimePaths;
}
//#endregion
//#region src/runtime/session-cli-proof-manager.d.ts
interface StoredSessionCliProof {
  proofId: string;
  token: string;
}
declare class SessionCliProofManager {
  #private;
  constructor(home: string);
  pathForSession(sessionId: string): string;
  materialize(sessionId: string, proof: StoredSessionCliProof): Promise<string>;
  cleanup(sessionId: string): Promise<void>;
}
declare function readSessionCliProofFile(path: string): Promise<StoredSessionCliProof>;
//#endregion
//#region src/runtime/session-runtime-manager.d.ts
declare class ClientRuntimeProviderStartError extends Error {
  readonly providerId: string;
  constructor(providerId: string, options?: ErrorOptions);
}
interface SessionRuntimeManagerOptions {
  readonly bindingStore: SessionBindingStore;
  readonly cliCommand?: string;
  readonly cliInvocation?: readonly string[];
  readonly cleanupProviderEnvironment?: (sessionId: string) => Promise<void>;
  readonly contextTree?: Pick<ContextTreeManager, "ensureAgent" | "skillPaths">;
  /** Managed CLI directory applied after Provider discovery and execution environment overrides. */
  readonly contextTreeBin?: string;
  /**
   * Optional. Materializes the Agent's enabled Skills before the provider starts; a failure only
   * changes what is on disk and never stops the runtime.
   */
  readonly skills?: Pick<SkillSyncManager, "ensureAgent">;
  readonly ensureProviderReady: (providerId: string, signal?: AbortSignal) => Promise<void>;
  readonly providers: AgentRuntimeProviderRegistry;
  readonly home?: string;
  readonly environment?: NodeJS.ProcessEnv;
  readonly providerEnvironmentPath: (sessionId: string) => string;
  /**
   * Optional. Current CLI environment for automatic injection into the provider spawn
   * environment (visible Sessions). Proxy mode returns the execution env map.
   */
  readonly providerEnvironment?: (sessionId: string) => Readonly<Record<string, string>> | undefined;
  /**
   * Optional. Managed Context Tree environment for the trusted CLI child. `undefined` entries
   * unset inherited variables; legacy mode leaves it undefined and keeps ambient Local behavior.
   */
  readonly contextTreeEnvironment?: (sessionId: string, configuration: {
    cwd: string;
    sources: EffectiveRuntimeSnapshot["contextTrees"];
  }) => Readonly<Record<string, string | undefined>> | undefined;
  readonly proofManager?: Pick<SessionCliProofManager, "cleanup" | "materialize">;
  /**
   * Optional. Visible Sessions may receive the currently active Slack config leaf as one extra
   * writable root. Internal Sessions and Feishu must return undefined. Leave unset when unused.
   */
  readonly slackConfigWritableRoot?: (sessionId: string) => string | undefined;
  /** Absolute Session launch-bin directory prepended to the Agent Runtime PATH. Visible only. */
  readonly providerCliLaunchPath?: (sessionId: string) => string | undefined;
  /** Prepare only this visible Session's reply evidence directory, never its trusted plan directory. */
  readonly providerCliReplyWritableRoot?: (sessionId: string) => Promise<string>;
  readonly workspace: AgentWorkspaceManager;
}
declare class SessionRuntimeManager implements RuntimePreparation, RuntimeLocalPolicy {
  #private;
  constructor(options: SessionRuntimeManagerOptions);
  validate(snapshot: EffectiveRuntimeSnapshot): InputRejectReason | undefined;
  validateDelivery(snapshot: EffectiveRuntimeSnapshot): InputRejectReason | undefined;
  validateSession(request: SessionReconcileRequest, hashes: RuntimeSnapshotHashes): Promise<void>;
  prepareAgent(snapshot: EffectiveRuntimeSnapshot, hashes: RuntimeSnapshotHashes): Promise<void>;
  verifyAgent(snapshot: EffectiveRuntimeSnapshot, hashes: RuntimeSnapshotHashes): Promise<void>;
  requiresSessionPreparation(request: SessionReconcileRequest): boolean;
  prepareSession(request: SessionReconcileRequest, hashes: RuntimeSnapshotHashes): Promise<SessionPreparationResult>;
  ensureRuntime(sessionId: string, signal?: AbortSignal): Promise<AgentRuntime>;
  sessionKind(sessionId: string): "visible" | "internal";
  /** The prepared Session's Agent Runtime provider id; undefined when not prepared. */
  providerId(sessionId: string): string | undefined;
  hasAgentSessions(agentId: string): boolean;
  stopSession(sessionId: string, placementGeneration: number): Promise<void>;
  runtime(sessionId: string): AgentRuntime;
  cwd(sessionId: string): string;
  observe(sessionId: string, sink: AgentRuntimeEventSink): () => void;
  close(): Promise<void>;
}
//#endregion
//#region src/runtime/admission-controller.d.ts
type AdmissionPhase = "provisional" | "active" | "reporting" | "released";
interface AdmissionLimits {
  agent: number;
  client: number;
  session: number;
}
interface AdmissionSnapshot {
  activeAgents: ReadonlyMap<string, number>;
  client: number;
  sessions: number;
}
type AdmissionDecision = {
  accepted: true;
  reservation: AdmissionReservation;
} | {
  accepted: false;
  reason: InputRejectReason;
};
declare class AdmissionReservation {
  #private;
  readonly sessionId: string;
  readonly agentId: string;
  private readonly releaseOwner;
  constructor(sessionId: string, agentId: string, releaseOwner: (reservation: AdmissionReservation) => void);
  get phase(): AdmissionPhase;
  markActive(): void;
  markReporting(): void;
  release(): void;
}
declare class AdmissionController {
  #private;
  constructor(limits?: Partial<AdmissionLimits>);
  reserve(sessionId: string, agentId: string, options?: {
    acceptedWork?: boolean;
  }): AdmissionDecision;
  /** Stop taking new work while already accepted work continues to drain. */
  pause(): void;
  /** Resume ordinary admission after an update attempt fails or is superseded. */
  resume(): void;
  get paused(): boolean;
  get(sessionId: string): AdmissionReservation | undefined;
  snapshot(): AdmissionSnapshot;
  waitForRelease(signal?: AbortSignal): Promise<void>;
}
//#endregion
//#region src/runtime/client-runtime.d.ts
interface DeliveryDecision {
  result: ImMessageDeliveryResult;
  onAcceptedSent?(): Promise<void> | void;
}
interface ClientRuntimeOptions {
  handleApproval?(request: RuntimeApprovalDecision): Promise<RuntimeApprovalResult>;
  slackAutoSetup?: {
    run(request: SlackAutoSetupRuntimeRequest, signal?: AbortSignal): Promise<SlackAutoSetupRuntimeResult["result"]>;
  };
  logger?: ClientLogger;
  handleDelivery?(request: DirectImMessageDeliveryRequest): Promise<DeliveryDecision> | DeliveryDecision;
  handleSteer?(request: RuntimeImSteerRequest): Promise<RuntimeImSteerResult> | RuntimeImSteerResult;
  handleTurnActivityResult?(result: TurnActivityResult): void;
  handleTurnReportResult?(result: TurnReportResult): Promise<void> | void;
  handleSessionMessageDelivery?(request: SessionMessageDeliveryRequestV3): Promise<SessionMessageDeliveryResult> | SessionMessageDeliveryResult;
  getRuntimeOptions?(frame: AgentRuntimeOptionsRequestFrame, signal: AbortSignal): Promise<AgentRuntimeOptions>;
  availabilityTester?: {
    run(request: AgentRuntimeTestRequestFrame, signal: AbortSignal): Promise<AgentRuntimeTestResultFrame> | AgentRuntimeTestResultFrame;
  };
  onReconcileResultSendFailed?(request: SessionReconcileRequest, result: SessionReconcileResult, error: unknown): Promise<void> | void;
  onReconciled?(request: SessionReconcileRequest, result: SessionReconcileResult): Promise<void> | void;
  prepareReconcileResult?(request: SessionReconcileRequest, result: SessionReconcileResult): Promise<SessionReconcileResult> | SessionReconcileResult;
  reconciler?: SessionReconciler;
}
declare class ClientRuntime {
  #private;
  readonly reconciler: SessionReconciler;
  constructor(connection: RuntimeConnection, options?: ClientRuntimeOptions);
  run(): Promise<void>;
  stop(): void;
}
//#endregion
//#region src/runtime/turn-custody-owner.d.ts
interface TurnCustodyOwnerOptions {
  admission?: AdmissionController;
  bindingStore: SessionBindingStore;
  id?: () => string;
  imDeliveryVersion?: () => number | undefined;
  imSteerVersion?: () => number | undefined;
  maxRememberedRequests?: number;
  now?: () => number;
  preflight?(request: DirectImMessageDeliveryRequest): Promise<InputRejectReason | undefined>;
  reconciler: SessionReconciler;
  start?(owner: LiveTurnOwner): Promise<void> | void;
  steer?(request: RuntimeImSteerRequest): Promise<RuntimeImSteerResult>;
}
interface LiveTurnOwner {
  readonly inputHash: string;
  readonly request: DirectImMessageDeliveryRequest;
  readonly reservation: AdmissionReservation;
  readonly turnId: string;
}
declare class TurnCustodyOwner {
  #private;
  readonly admission: AdmissionController;
  constructor(options: TurnCustodyOwnerOptions);
  acceptSteer(request: RuntimeImSteerRequest): Promise<RuntimeImSteerResult>;
  accept(request: DirectImMessageDeliveryRequest): Promise<DeliveryDecision>;
  markReporting(turnId: string, reportInput: TurnReportRequest): Promise<void>;
  recordResult(turnId: string, resultHash: string): Promise<void>;
  getTurn(turnId: string): LiveTurnOwner | undefined;
  /** Accepted Turns still under local custody (accepted, not yet recorded as reported). */
  get liveTurnCount(): number;
}
//#endregion
//#region src/runtime/runtime-durability.d.ts
type DurableWorkKind = "session-message" | "turn-report";
type DurableWorkStatus = "accepted" | "running" | "succeeded" | "retryable" | "failed" | "dead-letter";
/** The durable state machine stores taxonomy retry policy, not a second retry enum. */
type DurableRetryability = ErrorRetryability;
type DurableFailure = StructuredError;
declare class RuntimeDurabilityFailure extends Error {
  readonly category: StructuredError["category"];
  readonly code: string;
  readonly phase: StructuredError["phase"];
  readonly requestId: string;
  readonly retryability: DurableRetryability;
  readonly structuredError: DurableFailure;
  constructor(failure: DurableFailure);
}
interface DurableWorkRecord<T = unknown> {
  readonly attempts: number;
  readonly acceptedAt: number;
  readonly key: string;
  readonly kind: DurableWorkKind;
  readonly lastError?: DurableFailure;
  readonly nextAttemptAt?: number;
  readonly payload: T;
  readonly status: DurableWorkStatus;
  readonly updatedAt: number;
}
interface RuntimeDurabilityStore {
  list<T = unknown>(kind: DurableWorkKind): Promise<DurableWorkRecord<T>[]>;
  write<T>(record: DurableWorkRecord<T>): Promise<void>;
}
declare class MemoryRuntimeDurabilityStore implements RuntimeDurabilityStore {
  #private;
  list<T = unknown>(kind: DurableWorkKind): Promise<DurableWorkRecord<T>[]>;
  write<T>(record: DurableWorkRecord<T>): Promise<void>;
}
declare class FileRuntimeDurabilityStore implements RuntimeDurabilityStore {
  #private;
  constructor(home: string);
  list<T = unknown>(kind: DurableWorkKind): Promise<DurableWorkRecord<T>[]>;
  write<T>(record: DurableWorkRecord<T>): Promise<void>;
}
interface RuntimeRetryPolicy {
  readonly baseDelayMs: number;
  readonly maxAgeMs: number;
  readonly maxAttempts: number;
  readonly maxDelayMs: number;
}
declare const DEFAULT_RUNTIME_RETRY_POLICY: RuntimeRetryPolicy;
interface RuntimeRetryScheduler {
  schedule(delayMs: number, task: () => void): {
    cancel(): void;
  };
}
declare const defaultRuntimeRetryScheduler: RuntimeRetryScheduler;
declare function retryDelay(policy: RuntimeRetryPolicy, attempts: number): number;
declare function retryExhausted(policy: RuntimeRetryPolicy, record: Pick<DurableWorkRecord, "acceptedAt" | "attempts">, now: number): boolean;
interface RuntimeDurabilityMetricsSnapshot {
  readonly deadLetters: number;
  readonly retries: number;
  readonly transitions: Readonly<Record<string, number>>;
}
declare class RuntimeDurabilityMetrics {
  #private;
  transition(kind: DurableWorkKind, from: DurableWorkStatus | undefined, to: DurableWorkStatus): void;
  snapshot(): RuntimeDurabilityMetricsSnapshot;
}
//#endregion
//#region src/runtime/turn-report-owner.d.ts
interface TurnReportOwnerOptions {
  connection: Pick<RuntimeConnection, "send" | "state" | "subscribeState"> & Partial<Pick<RuntimeConnection, "capabilityVersion">>;
  id?: () => string;
  maxPending?: number;
  metrics?: RuntimeDurabilityMetrics;
  now?: () => number;
  onFailure?(failure: DurableFailure): void;
  persistence?: RuntimeDurabilityStore;
  retryPolicy?: Partial<RuntimeRetryPolicy>;
  retryDelayMs?: number;
  scheduler?: RuntimeRetryScheduler;
}
type TurnReportTerminalStatus = "conflict" | "stale_generation";
interface TurnReportSubmitOptions {
  onTerminal?(status: TurnReportTerminalStatus): void;
}
type TurnReportRearmClaim = Pick<TurnReportRequest, "agentId" | "deliveryId" | "placementGeneration" | "resultHash" | "sessionId" | "turnId">;
declare class TurnReportOwnerStoppedError extends Error {
  constructor();
}
declare class TurnReportOwner {
  #private;
  constructor(options: TurnReportOwnerOptions);
  get pendingCount(): number;
  ready(): Promise<void>;
  getState(turnId: string): DurableWorkRecord<TurnReportRequest> | undefined;
  metricsSnapshot(): ReturnType<RuntimeDurabilityMetrics["snapshot"]> | undefined;
  create(input: TurnReportHashInput, reportVersion?: number): TurnReportRequest;
  submit(reportInput: TurnReportRequest, confirm: () => Promise<void> | void, options?: TurnReportSubmitOptions): Promise<void>;
  handleResult(input: TurnReportResult): Promise<boolean>;
  get(turnId: string): {
    report: TurnReportRequest;
    serverStatus?: TurnReportTerminalStatus;
  } | undefined;
  rearmTerminal(claim: TurnReportRearmClaim): boolean;
  stop(): void;
  settled(): Promise<void>;
}
//#endregion
//#region src/runtime/agent-turn-runner.d.ts
interface AgentTurnOutgoingReplyCollector {
  collect(input: {
    readonly sessionId: string;
    readonly runId: string;
  }): Promise<ProviderCliOutgoingReplyCollectResult>;
  cleanup(input: {
    readonly sessionId: string;
    readonly runId: string;
  }): Promise<void>;
}
interface AgentTurnRunnerOptions {
  readonly bindingStore: SessionBindingStore;
  readonly connection: Pick<RuntimeConnection, "send"> & {
    capabilityVersion?(capability: string): number | undefined;
  };
  readonly custody: Pick<TurnCustodyOwner, "markReporting" | "recordResult">;
  readonly logger?: ClientLogger;
  readonly now?: () => number;
  readonly onRuntimeEvent?: (event: AgentRuntimeEvent) => Promise<void> | void;
  readonly reportOwner: TurnReportOwner;
  /** @deprecated Attachments are read on demand through the provider CLI. Never called. */
  readonly resourceFetcher?: ImResourceFetcher;
  readonly runtimeManager: SessionRuntimeManager;
  readonly credentialEnvironment: Pick<RuntimeCredentialEnvironmentManager, "cleanup" | "prepare">;
  readonly turnPlan?: {
    cleanup(input: ProviderCliTurnPlanPrepareInput): Promise<void>;
    prepare(input: ProviderCliTurnPlanPrepareInput, signal?: AbortSignal): Promise<unknown>;
  };
  readonly outgoingReplies?: AgentTurnOutgoingReplyCollector;
  /**
   * Relays a turn failure to the error tracker. Given every failure without exception: deciding which
   * of them describe a defect is the reporter's job, not this runner's, so the taxonomy can change
   * without touching the execution path.
   */
  readonly agentErrorReporter?: AgentTurnErrorReporter;
}
/**
 * One failed turn, as much of it as a reader needs to find the Agent it happened to.
 *
 * Only what the failure path already holds. The provider is deliberately absent: reading it means
 * asking the runtime manager, and a turn that failed before its runtime was prepared has no answer
 * to give — the reporter resolves it, where being unable to is not the execution path's problem.
 */
interface AgentTurnFailure {
  readonly error: unknown;
  readonly agentId: string;
  readonly sessionId: string;
  readonly turnId: string;
  readonly errorReason?: TurnFailureReason | undefined;
  readonly outcome: TurnCompletion["outcome"];
}
/** Never throws and never awaited: a tracker that is slow or broken must not hold a turn open. */
type AgentTurnErrorReporter = (failure: AgentTurnFailure) => void;
interface TurnCompletion {
  readonly errorReason?: TurnFailureReason;
  readonly executionEffects: "completed" | "may_have_occurred" | "not_started";
  readonly finalText?: string;
  readonly outcome: "completed" | "failed" | "cancelled" | "unknown";
  readonly usage?: TurnReportHashInput["usage"];
}
declare class AgentTurnRunner {
  #private;
  constructor(options: AgentTurnRunnerOptions);
  handleActivityResult(result: TurnActivityResult): void;
  get activeCount(): number;
  start(owner: LiveTurnOwner): void;
  steer(request: RuntimeImSteerRequest): Promise<RuntimeImSteerResult>;
  respondToApproval(request: RuntimeApprovalDecision): Promise<RuntimeApprovalResult>;
  stop(): void;
  settled(): Promise<void>;
}
declare function buildAgentInput(request: DirectImMessageDeliveryRequest | RuntimeImSteerRequest, supplementalContext?: string, rootRuntime?: EffectiveRuntimeSnapshot, processedAt?: Date): AgentInput;
//#endregion
//#region src/runtime/web-tools-gateway.d.ts
/**
 * Agreed cross-repo error codes. The shared wire enum is the authority; the three
 * lifecycle/credit codes are part of the agreed Router contract and are listed here so the
 * gateway maps them correctly even before the shared enum names them.
 */
type GatewayWebToolErrorCode = WebToolErrorCode | "request_in_progress" | "request_uncertain" | "insufficient_credit";
/** Controlled gateway dispatch failure; `code` maps deterministically to an HTTP status. */
declare class WebGatewayDispatchError extends Error {
  readonly code: GatewayWebToolErrorCode;
  readonly retryable?: boolean;
  constructor(code: GatewayWebToolErrorCode, message: string, options?: {
    retryable?: boolean;
  });
}
/**
 * The one dispatch entry a trusted boundary provides. The gateway owns framing, validation, the
 * decreasing remaining-budget, and abort wiring; the caller owns execution identity and
 * authorization. `remainingMs` is the end-to-end budget left when the request entered the
 * gateway (never more than the operation cap, never reset).
 */
type WebGatewayDispatch = (input: {
  operation: "search";
  toolCallId: string;
  remainingMs: number;
  params: WebSearchParams;
} | {
  operation: "fetch";
  toolCallId: string;
  remainingMs: number;
  params: WebFetchParams;
}, signal: AbortSignal) => Promise<WebSearchResult | WebFetchResult>;
/**
 * The per-execution trusted web gateway: an HTTP/1.1 server on a fresh, owned Unix socket
 * offering exactly `/web/search` and `/web/fetch`. Local (trusted Client) it lives on a short
 * private per-execution path; native it lives inside the Sandbox namespace and its traffic rides
 * the dedicated exec pipe — no network listener anywhere. Bodies are bounded and read under the
 * same decreasing deadline as the dispatch itself.
 */
declare class WebToolsGatewayServer {
  #private;
  private constructor();
  get socketPath(): string;
  static start(options: WebToolsGatewayServerOptions): Promise<WebToolsGatewayServer>;
  /** Stop listening, destroy in-flight connections, and remove only the socket we created. */
  close(): Promise<void>;
}
interface WebToolsGatewayServerOptions {
  /** Exact Unix socket path (the nonsecret endpoint descriptor). Fresh and owned per bind. */
  readonly socketPath: string;
  readonly dispatch: WebGatewayDispatch;
  readonly logger?: Pick<ClientLogger, "debug" | "warn">;
  /** Test seam: clock for the remaining-budget arithmetic. */
  readonly now?: () => number;
}
//#endregion
//#region src/runtime/protected-paths.d.ts
type ReadLink = (path: string) => string;
//#endregion
//#region src/runtime/install-locations.d.ts
/**
 * What the login shell reported about the version manager it had active.
 * `nvmBin` names the selected version outright; `fnmDir` names only the root it
 * was selected from, leaving the version still to be determined.
 */
type ActiveVersionManager = {
  fnmDir?: string;
  nvmBin?: string;
};
//#endregion
//#region src/runtime/login-shell-path.d.ts
/** Injectable seam for hermetic tests — returns the raw shell stdout, or null on failure. */
type RunShell = () => Promise<string | null> | string | null;
type LoginShellSpawn = (command: string, args: readonly string[], options: {
  stdio: ["ignore", "pipe", "ignore"];
  windowsHide: boolean;
  env?: NodeJS.ProcessEnv;
}) => ChildProcess;
type LoginShellPathDeps = {
  runShell?: RunShell;
  readLink?: ReadLink;
  platform?: NodeJS.Platform;
  home?: string;
  environment?: NodeJS.ProcessEnv;
  spawn?: LoginShellSpawn;
  logger?: ClientLogger;
};
//#endregion
//#region src/runtime/agent-runtime-installation.d.ts
type AgentRuntimeExecutableSource = "explicit" | "caller-path" | "well-known" | "login-shell" | "version-manager" | "desktop-app";
interface ResolvedAgentRuntimeExecutable {
  provider: AgentRuntimeProvider;
  path: string;
  source: AgentRuntimeExecutableSource;
  /** Directory of the search hit; used to prepend PATH for automatic candidates. */
  searchDir?: string;
}
type AgentRuntimeCliInstallation = {
  provider: AgentRuntimeProvider;
  displayName: string;
  status: "installed";
  path: string;
  source: AgentRuntimeExecutableSource;
} | {
  provider: AgentRuntimeProvider;
  displayName: string;
  status: "not-installed";
} | {
  provider: AgentRuntimeProvider;
  displayName: string;
  status: "unknown";
  detail: string;
};
interface ResolveAgentRuntimeExecutableOptions {
  access?: (path: string, mode: number) => Promise<void>;
  realpath?: (path: string) => Promise<string>;
  stat?: (path: string) => Promise<Pick<Stats, "isFile">>;
  platform?: NodeJS.Platform;
  home?: string;
  pathDelimiter?: string;
  wellKnownDirs?: (home: string, platform: NodeJS.Platform) => readonly string[];
  desktopAppDirs?: (home: string, platform: NodeJS.Platform) => readonly string[];
  candidateAllowed?: (path: string, options: {
    platform: NodeJS.Platform;
    home: string;
  }) => boolean;
  /**
   * Whether to consult the login-shell PATH (which may spawn a shell) and the
   * version-manager fallback that depends on it. Default `true`. Set `false` on
   * the daemon's pre-connect readiness path so startup never blocks on a login
   * shell. Later refresh and Turn-triggered readiness pass `true`.
   */
  includeLoginShell?: boolean | (() => boolean);
  loginShellPathDirs?: () => Promise<readonly string[]> | readonly string[];
  loginShellEnv?: () => ActiveVersionManager | Promise<ActiveVersionManager>;
  runShell?: LoginShellPathDeps["runShell"];
  loginShellSpawn?: LoginShellPathDeps["spawn"];
  versionManagerDirs?: (home: string, active: ActiveVersionManager) => readonly string[];
  logger?: ClientLogger;
}
interface ProbeAgentRuntimeCliInstallationsOptions extends ResolveAgentRuntimeExecutableOptions {
  environment?: NodeJS.ProcessEnv;
  commands?: Partial<Record<AgentRuntimeProvider, string>>;
}
declare class AgentRuntimeExecutableNotFoundError extends Error {
  readonly name = "AgentRuntimeExecutableNotFoundError";
}
declare class AgentRuntimeExecutableDiscoveryError extends Error {
  readonly name = "AgentRuntimeExecutableDiscoveryError";
}
/** Cheap, spawn-free directories mirrored from First Tree's install-only discovery. */
declare function wellKnownAgentRuntimeBinDirs(home: string, platform?: NodeJS.Platform): string[];
declare function codexDesktopAppBinDirs(home: string, platform?: NodeJS.Platform): string[];
declare function resolveAgentRuntimeExecutable(provider: AgentRuntimeProvider, command: string, environment: NodeJS.ProcessEnv, options?: ResolveAgentRuntimeExecutableOptions): Promise<ResolvedAgentRuntimeExecutable>;
/**
 * Lazy installed-candidate sequence. Later, more expensive sources are only
 * evaluated when the consumer asks for the next candidate — the common case of
 * a single working hit therefore keeps today's cost. An absolute explicit
 * command remains one candidate and never gains fallback sources.
 */
declare function iterateAgentRuntimeExecutables(provider: AgentRuntimeProvider, command: string, environment: NodeJS.ProcessEnv, options?: ResolveAgentRuntimeExecutableOptions): AsyncGenerator<ResolvedAgentRuntimeExecutable>;
declare function probeAgentRuntimeCliInstallations(options?: ProbeAgentRuntimeCliInstallationsOptions): Promise<AgentRuntimeCliInstallation[]>;
//#endregion
//#region src/runtime/provider-cli/validation-runner.d.ts
declare function deriveProviderCliValidationRequestKey(requestId: string): string;
type ProviderCliValidationExecFile = (file: string, args: readonly string[], options: {
  cwd?: string;
  env: NodeJS.ProcessEnv;
  maxBuffer: number;
  signal?: AbortSignal;
  timeout: number;
  windowsHide: boolean;
}) => Promise<{
  stderr: string;
  stdout: string;
}>;
/**
 * One Server-authorized validation execution: read-only identity scope, no business
 * Session, no raw grant material. The environment carries execution-local handles and
 * loopback TLS settings only; `signal` fires when the Server revokes the execution.
 */
interface ProviderCliProxyValidationSession {
  /** Extra CLI flags inserted after the managed `--skip-update --config-dir` prefix. */
  readonly arguments?: readonly string[];
  readonly environment: Readonly<Record<string, string | undefined>>;
  readonly signal?: AbortSignal;
  cleanup(): Promise<void>;
}
interface ProviderCliValidationRunnerOptions {
  readonly exchangeFeishuToken?: (grant: Extract<ProviderCliValidationGrantFrame["grant"], {
    provider: "feishu";
  }>, signal?: AbortSignal) => Promise<string>;
  readonly execFile?: ProviderCliValidationExecFile;
  readonly fetch?: typeof fetch;
  readonly home: string;
  readonly logger?: ClientLogger;
  readonly now?: () => number;
  /**
   * Proxy credential mode: raw grant material is never accepted. Proxy mode requires
   * `openProxyValidation` to open a Server-issued validation execution
   * (`source.kind === "validation"`); without it readiness clearly rejects
   * (`needs_attention`) instead of falling back to raw Cloud tokens.
   */
  readonly openProxyValidation?: (request: ProviderCliValidationRequest, signal?: AbortSignal) => Promise<ProviderCliProxyValidationSession | undefined>;
  readonly proxyCredentialMode?: boolean;
  readonly verifyTarget?: (request: ProviderCliValidationRequest) => Promise<boolean>;
}
interface ProviderCliValidationRequest {
  readonly expectedFingerprint: string;
  readonly expectedIdentity: ProviderCliExpectedIdentity;
  readonly expiresAt: string;
  /** Legacy Local raw material; proxy validation runs carry `validationRunId` instead. */
  readonly grant?: ProviderCliValidationGrantFrame["grant"];
  /** Proxy mode: Server-issued validation run identity (never invented by the Client). */
  readonly validationRunId?: string;
  /** Proxy mode: Agent the Server fenced the validation run to. */
  readonly agentId?: string;
  readonly managedDigest?: string;
  readonly requestId: string;
  readonly targetPath: string;
  readonly version: string;
}
type ProviderCliValidationFence = Omit<ProviderCliValidationResultFrame, "status" | "reason" | "type">;
type ProviderCliValidationResult = Omit<ProviderCliValidationResultFrame, "type">;
declare class FeishuTokenExchangeError extends Error {
  readonly kind: "rate_limited" | "provider_unreachable" | "credential_rejected" | "aborted" | "invalid";
  constructor(kind: "rate_limited" | "provider_unreachable" | "credential_rejected" | "aborted" | "invalid");
}
declare class ProviderCliValidationRunner {
  #private;
  constructor(options: ProviderCliValidationRunnerOptions);
  run(request: ProviderCliValidationRequest, fence: ProviderCliValidationFence, signal?: AbortSignal): Promise<ProviderCliValidationResult>;
  cleanupAll(): Promise<void>;
}
declare function exchangeFeishuTenantToken(grant: Extract<ProviderCliValidationGrantFrame["grant"], {
  provider: "feishu";
}>, signal?: AbortSignal, fetchImpl?: typeof fetch, timeoutMs?: number): Promise<string>;
//#endregion
//#region src/runtime/session-message-inbox.d.ts
interface SessionMessageInboxOptions {
  admission: AdmissionController;
  cliCommand?: string;
  credentialEnvironment: Pick<RuntimeCredentialEnvironmentManager, "cleanup" | "prepare">;
  turnPlan?: {
    cleanup(input: ProviderCliTurnPlanPrepareInput): Promise<void>;
    prepare(input: ProviderCliTurnPlanPrepareInput, signal?: AbortSignal): Promise<unknown>;
  };
  imCredentialGrantVersion(): number | undefined;
  logger?: Pick<ClientLogger, "warn">;
  maxQueuedPerSession?: number;
  maxQueuedTotal?: number;
  maxRememberedMessages?: number;
  metrics?: RuntimeDurabilityMetrics;
  now?: () => number;
  onFailure?(failure: DurableFailure): void;
  persistence?: RuntimeDurabilityStore;
  retryPolicy?: Partial<RuntimeRetryPolicy>;
  scheduler?: RuntimeRetryScheduler;
  timeoutScheduler?: RuntimeRetryScheduler;
  /**
   * The negotiated `runtime.sessionCollaboration` version. A scheduled-origin delivery is only
   * legal on a v3 channel; anything else is refused at the wire boundary instead of being
   * silently executed or silently dropped. Already-accepted durable records are unaffected —
   * recovery never re-checks the negotiation.
   */
  sessionCollaborationVersion(): number | undefined;
  reconciler: Pick<SessionReconciler, "checkSessionMessageDelivery" | "clearActivity" | "setActivity" | "withAgentLock">;
  runtimeManager: Pick<SessionRuntimeManager, "ensureRuntime" | "sessionKind">;
}
declare class SessionMessageInbox {
  #private;
  constructor(options: SessionMessageInboxOptions);
  ready(): Promise<void>;
  getState(messageId: string): DurableWorkRecord<SessionMessageDeliveryRequestV3> | undefined;
  metricsSnapshot(): ReturnType<RuntimeDurabilityMetrics["snapshot"]> | undefined;
  accept(input: SessionMessageDeliveryRequestV3): Promise<SessionMessageDeliveryResult>;
  stop(): void;
  /** Accepted Session messages still waiting in an in-memory delivery queue. */
  get queuedCount(): number;
  /**
   * Every accepted Session message that has not reached a terminal durable state. Unlike
   * `queuedCount`, this includes a message that is running or waiting behind retry backoff.
   */
  get pendingCount(): number;
  settled(): Promise<void>;
}
type SessionMessageTurnContext = {
  readonly sessionKind: "internal";
} | {
  readonly outboxContext: RuntimeImOutboxContext;
  readonly sessionKind: "visible";
};
/**
 * Assemble the Agent input for one Session message at the moment processing actually begins.
 *
 * `processedAt` is the processing clock sample taken by the caller after `waitForIdle()`; every
 * branch exposes it as trustworthy UTC without guessing a local timezone. A scheduled message
 * additionally gains a distinct managed metadata item (schedule name, scheduled/sent/processing
 * times in UTC and the schedule's IANA timezone, message id, detail link, and the normalized
 * <=120 code-point preview) plus the single best-effort start-notification instruction. The full
 * prompt always stays its own trailing user-task item, and untrusted name/preview text enters the
 * managed block only JSON-escaped, so it can never close a managed tag or forge instructions.
 */
declare function buildSessionMessageInput(request: SessionMessageDeliveryRequestV3, cliCommand?: string, turnContext?: SessionMessageTurnContext, processedAt?: Date): AgentInput;
//#endregion
//#region src/runtime/client-runtime-composition.d.ts
/**
 * Every local state whose interruption could lose or duplicate an accepted Turn, pending Turn
 * completion/report custody, or an accepted IM delivery — aggregated from the authoritative owners
 * (Session reconciler activity and recoveries, Turn custody, Turn runner, Turn reports, and the
 * Session message inbox) rather than from any heuristic. `total === 0` is the only upgrade gate.
 */
interface ProtectedWorkSnapshot {
  /** Live per-Session Turn activity recorded by the Session reconciler. */
  sessionActivities: number;
  /** Unresolved Turns recovered from durable state that still owe a completion report. */
  pendingRecoveries: number;
  /** Accepted Turns still under local custody (not yet recorded as reported). */
  custodyTurns: number;
  /** Turns the runner is currently executing or reporting. */
  activeTurns: number;
  /** Turn Reports awaiting Server confirmation. */
  pendingReports: number;
  /** Accepted Session messages that have not reached a terminal state, including retry backoff. */
  queuedSessionMessages: number;
  /** Total protected items; zero means no protected work remains. */
  total: number;
}
interface CreateClientRuntimeOptions {
  readonly api?: Pick<OpenTagApi, "getComputerSkillManifest" | "openComputerSkillBundle" | "openImResource">;
  readonly serverDurability?: {
    readonly api: Pick<OpenTagApi, "listRuntimeDurableWork" | "writeRuntimeDurableWork">;
    readonly machineToken: string;
    readonly now?: () => number;
  };
  readonly capabilityRefreshIntervalMs?: number;
  readonly providerProbeDeadlineMs?: number;
  readonly clientVersion: string;
  /**
   * Explicit credential mode. `"proxy"` opens trusted executions with short-lived
   * capabilities and local handles; it never falls back to raw materials. Default
   * `"legacy"` preserves the existing Local behavior.
   */
  readonly credentialMode?: RuntimeCredentialMode;
  /**
   * Proxy mode injection seam for Cloud host composition. Local proxy mode uses the
   * production defaults (loopback TLS, openssl CA, real WSS client).
   */
  readonly runtimeCredentials?: {
    readonly dataConnectionFactory?: RuntimeProxyDataConnectionFactory;
    readonly generateCa?: (materialDir: string) => Promise<RuntimeProxyLoopbackCaMaterial>;
    readonly now?: () => number;
    readonly openBudgetMs?: number;
    readonly sandboxForSession?: (sessionId: string) => RuntimeExecutionSandbox | undefined;
    readonly scheduler?: RuntimeRelayScheduler;
    /**
     * Host-side managed environment for the Context Tree CLI (`undefined` entries unset). Local
     * proxy mode defaults to the live execution environment; Cloud must supply a trusted
     * Runner-side mapping because the execution environment targets the Sandbox loopback.
     */
    readonly contextTreeEnvironment?: (sessionId: string) => Readonly<Record<string, string | undefined>> | undefined;
  };
  /**
   * Proxy mode only: opens the Server-issued validation execution for CLI readiness.
   * The Server issues `validationRunId`; the client never invents one. Without this the
   * proxy readiness path clearly rejects (`needs_attention`) instead of using raw tokens.
   */
  readonly openProxyValidation?: (request: ProviderCliValidationRequest, signal?: AbortSignal) => Promise<ProviderCliProxyValidationSession | undefined>;
  readonly codexCommand?: string;
  readonly codexHome?: string;
  readonly claudeCodeCommand?: string;
  readonly claudeCodeHome?: string;
  readonly piCommand?: string;
  readonly piHome?: string;
  readonly cliCommand?: string;
  readonly cliInvocation?: readonly string[];
  /** Authoritative packaged CLI entry for the Slack deployment hook; absent embeddings use manual setup. */
  readonly slackAutoSetupCliEntry?: string;
  readonly environment?: NodeJS.ProcessEnv;
  readonly factory?: AgentRuntimeFactory;
  readonly factories?: readonly AgentRuntimeFactory[];
  readonly home: string;
  readonly logger?: ClientLogger;
  readonly signal?: AbortSignal;
  readonly machineToken?: string;
  readonly durabilityStore?: RuntimeDurabilityStore;
  readonly durabilityMetrics?: RuntimeDurabilityMetrics;
  /**
   * Explicit web tools opt-in. Effective only in proxy credential mode with the webTools
   * capability negotiated and the Server granting web scopes to the execution; otherwise the
   * trusted extension is never loaded. `extensionPath` defaults to the fixed built artifact.
   */
  readonly webTools?: {
    readonly enabled: boolean;
    readonly extensionPath?: string;
    readonly fetchImpl?: typeof fetch;
  };
  /**
   * Relays a failed Agent turn to the error tracker. Given every failure; which of them are defects
   * is the host's judgement, because the answer differs between a Computer and a Runner.
   */
  readonly agentErrorReporter?: AgentTurnErrorReporter;
}
declare class ComposedClientRuntime {
  #private;
  readonly bindingStore: SessionBindingStore;
  readonly custody: TurnCustodyOwner;
  readonly credentialEnvironment: RuntimeCredentialEnvironmentManager;
  readonly reconciler: SessionReconciler;
  readonly sessionMessageInbox: SessionMessageInbox;
  readonly reportOwner: TurnReportOwner;
  readonly durabilityMetrics: RuntimeDurabilityMetrics;
  readonly runner: AgentTurnRunner;
  readonly runtimeManager: SessionRuntimeManager;
  readonly workspace: AgentWorkspaceManager;
  constructor(runtime: ClientRuntime, components: {
    admission: AdmissionController;
    bindingStore: SessionBindingStore;
    custody: TurnCustodyOwner;
    credentialEnvironment: RuntimeCredentialEnvironmentManager;
    reconciler: SessionReconciler;
    sessionMessageInbox: SessionMessageInbox;
    reportOwner: TurnReportOwner;
    durabilityMetrics: RuntimeDurabilityMetrics;
    runner: AgentTurnRunner;
    runtimeManager: SessionRuntimeManager;
    workspace: AgentWorkspaceManager;
    refreshCapability: () => Promise<void>;
    capabilityRefreshIntervalMs: number;
    capabilityAbort: AbortController;
    providerCliReconciler?: {
      close(): Promise<void>;
      refreshPublishedImCliReadiness(): Promise<void>;
    };
    providerCliTurnPlans?: {
      recover(): Promise<void>;
    };
  });
  run(): Promise<void>;
  /**
   * Authoritative protected-work snapshot for the automatic-upgrade gate. The Session module owns
   * the bounded lifetime of every counted unit (Turn budgets, delivery deadlines, report retries
   * with terminal outcomes), so a caller may wait on `total === 0` indefinitely without adding a
   * force timeout of its own.
   */
  protectedWork(): ProtectedWorkSnapshot;
  /**
   * Close admission before the updater reads its zero-work snapshot. Already accepted Session
   * messages may still reserve capacity and drain; every new direct or Session delivery receives a
   * retryable `client_busy` result. The returned release function is used only when the attempt is
   * abandoned or fails — a successful install stays quiesced until supervisor handoff.
   */
  quiesceForUpdate(): () => void;
  stop(): void;
}
declare function createClientRuntime(connection: RuntimeConnection, options: CreateClientRuntimeOptions): Promise<ComposedClientRuntime>;
declare function providerReadiness(provider: AgentRuntimeProvider, available: boolean, result: AgentRuntimeProbeResult | undefined): RuntimeProviderReadinessObservation;
interface ResolvedCodexFactoryOptions {
  readonly clientVersion: string;
  readonly codexHome: string;
  readonly command: string;
  readonly environment: NodeJS.ProcessEnv;
  readonly sourceEnvironment: NodeJS.ProcessEnv;
  readonly discovery?: ResolveAgentRuntimeExecutableOptions;
  readonly createCandidateFactory?: (command: string, environment: NodeJS.ProcessEnv) => CodexAgentRuntimeFactory;
}
/**
 * Claude Code treats a set CLAUDE_CONFIG_DIR as a distinct credential record, even when the
 * value equals its own default. Omit the variable only when the resolved home is that default.
 * Exported so the CLI probes the same environment the daemon runs in.
 */
declare function claudeCodeProcessEnvironment(sourceEnvironment: NodeJS.ProcessEnv, claudeCodeHome: string, defaultClaudeCodeHome: string): NodeJS.ProcessEnv;
declare function resolvedCodexFactory(options: ResolvedCodexFactoryOptions): AgentRuntimeFactory;
interface ResolvedClaudeCodeFactoryOptions {
  readonly claudeCodeHome: string;
  readonly command: string;
  readonly environment: NodeJS.ProcessEnv;
  readonly sourceEnvironment: NodeJS.ProcessEnv;
  readonly discovery?: ResolveAgentRuntimeExecutableOptions;
  readonly createCandidateFactory?: (command: string, environment: NodeJS.ProcessEnv) => ClaudeCodeAgentRuntimeFactory;
}
declare function resolvedClaudeCodeFactory(options: ResolvedClaudeCodeFactoryOptions): AgentRuntimeFactory;
interface ResolvedPiFactoryOptions {
  readonly command: string;
  readonly environment: NodeJS.ProcessEnv;
  readonly piHome: string;
  readonly sessionDirectory: string;
  readonly sourceEnvironment: NodeJS.ProcessEnv;
  readonly discovery?: ResolveAgentRuntimeExecutableOptions;
  readonly skillPaths?: readonly string[];
  readonly createCandidateFactory?: (command: string, environment: NodeJS.ProcessEnv) => PiAgentRuntimeFactory;
}
declare function resolvedPiFactory(options: ResolvedPiFactoryOptions): AgentRuntimeFactory;
declare function resolveCodexHome(environment?: NodeJS.ProcessEnv): string;
declare function resolvePiHome(environment?: NodeJS.ProcessEnv): string;
//#endregion
//#region src/runtime/integration-cli-installation.d.ts
type IntegrationCliId = "feishu" | "slack";
type IntegrationCliInstallation = {
  cli: IntegrationCliId;
  displayName: string;
  status: "installed";
  path: string;
  source: AgentRuntimeExecutableSource;
} | {
  cli: IntegrationCliId;
  displayName: string;
  status: "not-installed";
} | {
  cli: IntegrationCliId;
  displayName: string;
  status: "unknown";
  detail: string;
};
type LoginShellProbeOptions = "includeLoginShell" | "loginShellPathDirs" | "loginShellEnv" | "runShell" | "loginShellSpawn" | "versionManagerDirs";
type ProbeIntegrationCliInstallationsOptions = Omit<ResolveAgentRuntimeExecutableOptions, LoginShellProbeOptions> & {
  accountHome?: string;
  environment?: NodeJS.ProcessEnv;
  commands?: Partial<Record<IntegrationCliId, string>>;
};
/**
 * Install-only observation of Lark CLI and Slack CLI. This reuses the shared
 * spawn-free executable discovery and never inspects Provider CLI selection,
 * credentials, versions, or network endpoints.
 */
declare function probeIntegrationCliInstallations(options?: ProbeIntegrationCliInstallationsOptions): Promise<IntegrationCliInstallation[]>;
//#endregion
//#region src/runtime/local-computer-configuration.d.ts
type LocalConfigurationStatus = "valid" | "missing" | "invalid";
interface LocalComputerConfigurationInspection {
  identity: {
    status: LocalConfigurationStatus;
    value?: ComputerIdentity;
    detail?: string;
  };
  credentials: {
    status: LocalConfigurationStatus;
    value?: StoredMachineCredentials;
    detail?: string;
  };
  binding: {
    status: LocalConfigurationStatus;
    credentialCount: number;
    serverUrl?: string;
    detail?: string;
  };
}
/** Strict, read-only inspection of the Computer identity and stored Computer credential. */
declare function inspectLocalComputerConfiguration(home: string): Promise<LocalComputerConfigurationInspection>;
//#endregion
//#region src/runtime/managed-instructions.d.ts
type ManagedEnvironment = "local" | "cloud";
/** Runtime facts supplied by either the Local manager or the Cloud worker. */
interface ManagedSessionContext {
  environment: ManagedEnvironment;
  sessionId: string;
  sessionKind: "visible" | "internal";
  /** The Session that created this one; omitted entirely when the caller does not carry one. */
  creatorSessionId?: string;
  cliCommand: string;
  /** True only with real Session-CLI proof material behind the commands. */
  sessionCliAvailable: boolean;
  selfConfigurationEnabled: boolean;
  contextTree?: ContextTreeStatus;
  /** Local only: the Agent's persistent Home on this Computer. */
  agentHome?: string;
}
/** One template for both runtimes; only environment facts use Local/Cloud branches. */
declare function renderManagedSystemPrompt(snapshot: EffectiveRuntimeSnapshot, context?: ManagedSessionContext): string;
//#endregion
//#region src/runtime/provider-cli/probe.d.ts
/** Injectable bounded child-process runner; the default never uses a shell. */
type ProviderCliExecFile = (file: string, args: readonly string[], options: {
  env: NodeJS.ProcessEnv;
  timeout: number;
  maxBuffer: number;
  windowsHide: boolean;
}) => Promise<{
  stdout: string;
  stderr: string;
}>;
declare const defaultProviderCliExecFile: ProviderCliExecFile;
/**
 * Probes run with a scrubbed environment: no provider credentials, no caller PATH
 * influence beyond the absolute target, and no provider API requests. `probeHome` is a
 * fresh private temporary directory, never the real account home, so provider config,
 * tokens, and logs cannot be read from or written to the user's normal CLI state. The
 * running Node.js directory is first on PATH so `#!/usr/bin/env node` wrappers execute
 * with the same Node runtime as OpenTag.
 */
declare function providerCliProbeEnvironment(probeHome: string, execDir?: string): NodeJS.ProcessEnv;
type ProviderCliProbeOutcome = {
  readonly status: "ok";
  readonly version: string;
} | {
  readonly status: "failed";
  readonly code: "probe_failed" | "version_incompatible" | "unparseable_version";
};
/**
 * Run the reviewed probe contract against one absolute executable: version probe,
 * version parse and compatibility check, then the required command-surface probe.
 * Raw child output never leaves this function.
 */
declare function probeProviderCliExecutable(target: string, entry: ProviderCliCatalogEntry, options: {
  execFile?: ProviderCliExecFile;
  /** False when the target launcher already prepends the catalog-managed arguments. */
  includeManagedArguments?: boolean;
}): Promise<ProviderCliProbeOutcome>;
//#endregion
//#region src/runtime/provider-cli/selection-store.d.ts
declare const PROVIDER_CLI_SELECTION_SCHEMA_VERSION = 1;
/**
 * Exactly two selections exist. A managed selection pins an immutable catalog artifact;
 * an external selection pins a detected executable by canonical path and fingerprint.
 */
type ProviderCliSelection = {
  readonly kind: "managed";
  readonly artifactId: string;
  readonly version: string;
  readonly targetPath: string;
  readonly fingerprint: string;
} | {
  readonly kind: "external";
  readonly executablePath: string;
  readonly fingerprint: string;
  readonly trust: ProviderCliTrust;
  readonly version: string;
};
interface ProviderCliSelectionRecord {
  readonly schemaVersion: typeof PROVIDER_CLI_SELECTION_SCHEMA_VERSION;
  readonly provider: ProviderCliProvider;
  /** Monotonic per provider; every atomic replace increments it. */
  readonly generation: number;
  readonly updatedAt: string;
  readonly selection: ProviderCliSelection;
}
/** Read the current selection; missing state is `undefined`, malformed state throws. */
declare function readProviderCliSelection(layout: ProviderCliAccountLayout, provider: ProviderCliProvider): Promise<ProviderCliSelectionRecord | undefined>;
/** Atomically replace the selection record (0600, write-temp-then-rename). */
declare function writeProviderCliSelection(layout: ProviderCliAccountLayout, provider: ProviderCliProvider, selection: ProviderCliSelection, previous: ProviderCliSelectionRecord | undefined, now?: Date): Promise<ProviderCliSelectionRecord>;
/** Canonical target path a selection executes, regardless of kind. */
declare function providerCliSelectionTargetPath(selection: ProviderCliSelection): string;
//#endregion
//#region src/runtime/provider-cli/detector.d.ts
/**
 * User-facing external detection: one bounded, read-only scan of exact provider command
 * names in the invoking CLI process's PATH. It never scans version managers or home
 * trees, never starts a login shell, and never touches credentials or provider APIs.
 */
interface ProviderCliCandidate {
  /** Ephemeral identity valid only for this detection pass. */
  readonly id: string;
  readonly provider: ProviderCliProvider;
  readonly kind: "external" | "managed";
  /** Canonical realpath of the exact executable this candidate would run. */
  readonly path: string;
  /** PATH directory that contributed the candidate, or `selection`. */
  readonly sourceDir: string;
  readonly version: string;
  readonly trust: ProviderCliTrust;
  readonly fingerprint: string;
  /** Managed archive digest when the candidate is a managed artifact. */
  readonly managedDigest?: string;
  /** Effective PATH order index; candidates not on PATH sort last. */
  readonly pathRank: number;
  /** True when the candidate is the current persisted selection. */
  readonly incumbent: boolean;
}
interface IgnoredProviderCliCandidate {
  readonly path: string;
  readonly sourceDir?: string;
  readonly version?: string;
  readonly reason: string;
}
interface ProviderCliDetection {
  readonly candidates: readonly ProviderCliCandidate[];
  readonly ignored: readonly IgnoredProviderCliCandidate[];
}
interface ProviderCliDetectOptions {
  readonly provider: ProviderCliProvider;
  readonly entry: ProviderCliCatalogEntry;
  readonly layout: ProviderCliAccountLayout;
  /** Invoking CLI process environment; the only PATH authority for detection. */
  readonly env: NodeJS.ProcessEnv;
  readonly platform: NodeJS.Platform;
  readonly arch: string;
  readonly selection: ProviderCliSelectionRecord | undefined;
  readonly mode: "auto" | "managed-only";
  readonly execFile?: ProviderCliExecFile;
}
declare function detectProviderCliCandidates(options: ProviderCliDetectOptions): Promise<ProviderCliDetection>;
/**
 * Deterministic candidate ranking: newest compatible version first, then
 * catalog-verified trust, then the incumbent selection, then effective PATH order.
 * Also explains the winner and each loser for reporting.
 */
declare function rankProviderCliCandidates(candidates: readonly ProviderCliCandidate[]): {
  readonly ordered: readonly ProviderCliCandidate[];
  readonly reasons: ReadonlyMap<string, string>;
};
/**
 * Reopen a winner by canonical path and recompute its fingerprint immediately before
 * persistence. A changed candidate is rejected so the caller can rank again.
 */
declare function verifyProviderCliCandidateFingerprint(candidate: ProviderCliCandidate): Promise<boolean>;
//#endregion
//#region src/runtime/provider-cli/executable-format.d.ts
/**
 * Executable format sniffing for Provider CLI candidates.
 *
 * Detection validates that a candidate can actually run on this platform and
 * architecture without executing it: Mach-O thin/fat binaries and ELF binaries carry
 * their CPU type in the first bytes; `#!` scripts are architecture-neutral. Anything
 * else is unrecognized and never eligible.
 */
type ProviderCliExecutableArch = "arm64" | "x64";
type ProviderCliExecutableFormat = {
  readonly kind: "script";
} | {
  readonly kind: "macho";
  readonly archs: readonly ProviderCliExecutableArch[];
} | {
  readonly kind: "elf";
  readonly arch: ProviderCliExecutableArch;
} | {
  readonly kind: "unknown";
};
/** Inspect the first bytes of a candidate executable; 64 bytes cover every header read here. */
declare function inspectExecutableFormat(header: Uint8Array): ProviderCliExecutableFormat;
declare function executableFormatSupportsHost(format: ProviderCliExecutableFormat, platform: NodeJS.Platform, arch: string): boolean;
//#endregion
//#region src/runtime/provider-cli/fingerprint.d.ts
/**
 * Content-addressed identity of one executable file. `path` is the canonical realpath;
 * `sha256` covers the full file content, so any post-validation replacement is visible.
 */
interface ProviderCliFileIdentity {
  readonly path: string;
  readonly size: number;
  readonly sha256: string;
}
/** Hard bound for any selected Provider CLI executable, including external wrappers. */
declare const MAX_PROVIDER_CLI_EXECUTABLE_BYTES: number;
declare function computeFileIdentity(path: string, maxBytes?: number): Promise<ProviderCliFileIdentity>;
/**
 * Deterministic fingerprint over the parts that define executable identity for
 * OpenTag: canonical target, file identity, version, and the managed archive digest
 * when the target is a managed artifact.
 */
declare function computeTargetFingerprint(identity: ProviderCliFileIdentity, version: string, managedDigest?: string): string;
//#endregion
//#region src/runtime/provider-cli/installer.d.ts
/**
 * Explicit managed-install transaction.
 *
 * One operation: acquire the account/provider lock (held by the caller), download the
 * reviewed catalog artifact into a private staging directory with time and size limits,
 * verify the exact digest, safely extract only the expected executable, publish to a
 * digest-addressed immutable version directory, and run the full non-secret probe.
 * Nothing here runs an upstream installer, escalates privileges, or mutates any prior
 * selection or version directory.
 */
declare class ProviderCliInstallError extends Error {
  readonly code: Extract<ProviderCliDiagnosticCode, "integrity_failed" | "install_incomplete" | "probe_failed" | "version_incompatible" | "unsupported_platform">;
  readonly name = "ProviderCliInstallError";
  constructor(code: Extract<ProviderCliDiagnosticCode, "integrity_failed" | "install_incomplete" | "probe_failed" | "version_incompatible" | "unsupported_platform">, message: string);
}
/** Bounded artifact download; the default implementation follows redirects off the reviewed URL. */
type ProviderCliFetcher = (options: {
  url: string;
  maxBytes: number;
  timeoutMs: number;
}) => Promise<Uint8Array>;
/**
 * Resolve one request or redirect hop to the next URL. Every hop — the reviewed catalog
 * URL itself and every redirect target — must be HTTPS; a plaintext hop is a downgrade
 * attack on the artifact channel and fails closed as an integrity failure.
 */
declare function resolveProviderCliArtifactUrl(current: string, location?: string): string;
/**
 * Create the bounded artifact fetcher. `fetchImpl` exists so tests can exercise the
 * full redirect and size-bound policy without network or TLS; production always uses
 * the global fetch with manual redirect handling.
 */
declare function createProviderCliFetcher(fetchImpl?: typeof fetch): ProviderCliFetcher;
declare const defaultProviderCliFetcher: ProviderCliFetcher;
interface ProviderCliInstallerOptions {
  readonly layout: ProviderCliAccountLayout;
  readonly platform: NodeJS.Platform;
  readonly arch: string;
  readonly fetcher?: ProviderCliFetcher;
  readonly execFile?: ProviderCliExecFile;
}
interface ProviderCliManagedInstall {
  readonly artifactId: string;
  readonly version: string;
  /** Absolute path of the published, probe-verified executable. */
  readonly executablePath: string;
  readonly archiveSha256: string;
  /** True when the digest-addressed version directory already existed. */
  readonly reused: boolean;
}
declare class ProviderCliInstaller {
  #private;
  constructor(options: ProviderCliInstallerOptions);
  /**
   * Remove recognized stale staging directories from interrupted operations. Safe to
   * run only while holding the provider lock: any staging directory present then is a
   * crash leftover by definition.
   */
  recoverStaging(provider: ProviderCliProvider): Promise<void>;
  /**
   * Publish the reviewed catalog artifact for this platform. Callers must hold the
   * account/provider lock. On any failure before publication, no version directory is
   * created or modified.
   */
  install(entry: ProviderCliCatalogEntry, provider: ProviderCliProvider): Promise<ProviderCliManagedInstall>;
}
//#endregion
//#region src/runtime/provider-cli/launcher.d.ts
type ProviderCliLauncherStatus = "valid" | "missing" | "invalid" | "mismatch";
/** Deterministic launcher content for a selection; compared byte-for-byte on inspect. */
declare function renderProviderCliLauncher(entry: ProviderCliCatalogEntry, selection: ProviderCliSelection): string;
/** Deterministic public shim content. */
declare function renderProviderCliShim(provider: ProviderCliProvider, launcherPath: string): string;
/** Write or repair the internal launcher to match the selection. */
declare function reconcileProviderCliLauncher(layout: ProviderCliAccountLayout, entry: ProviderCliCatalogEntry, selection: ProviderCliSelection): Promise<{
  path: string;
  changed: boolean;
}>;
declare function inspectProviderCliLauncher(layout: ProviderCliAccountLayout, entry: ProviderCliCatalogEntry, selection: ProviderCliSelection | undefined): Promise<{
  status: ProviderCliLauncherStatus;
  path: string;
}>;
type ProviderCliShimOutcome = {
  readonly status: "created" | "updated" | "unchanged";
  readonly path: string;
} | {
  readonly status: "occupied";
  readonly path: string;
};
/**
 * Create or refresh the OpenTag-owned public shim. An unmanaged file occupying the
 * public command name is left untouched and reported as `occupied`.
 */
declare function reconcileProviderCliShim(layout: ProviderCliAccountLayout, entry: ProviderCliCatalogEntry): Promise<ProviderCliShimOutcome>;
interface ProviderCliGlobalCommandStatus {
  readonly active: boolean;
  /** The OpenTag public shim path when it exists and is ours. */
  readonly path?: string;
  /** What the invoking shell's PATH resolves the bare command to, if anything. */
  readonly resolvedPath?: string;
  /** True when a different command shadows the OpenTag shim on PATH. */
  readonly shadowed: boolean;
}
/**
 * Resolve the bare command name against the invoking environment's PATH the way a
 * shell would (first executable match wins) and compare it with the OpenTag shim.
 * Read-only; this is detection-scope information, never daemon readiness.
 */
declare function inspectGlobalCommand(layout: ProviderCliAccountLayout, command: string, env: NodeJS.ProcessEnv): Promise<ProviderCliGlobalCommandStatus>;
//#endregion
//#region src/runtime/provider-cli/lock.d.ts
/**
 * Account/provider exclusive mutation lock.
 *
 * Implemented inside `packages/client` on top of the secure durable-file primitives;
 * it deliberately does not depend on the daemon process lease in `apps/cli`. The lock
 * is an `O_CREAT | O_EXCL` file under the account-global state directory. A stale lock
 * whose holder process is gone is broken; a live holder fails the operation as busy.
 */
declare class ProviderCliLockBusyError extends Error {
  readonly name = "ProviderCliLockBusyError";
  constructor(provider: ProviderCliProvider);
}
interface ProviderCliLockDeps {
  readonly isProcessAlive?: (pid: number) => boolean;
  readonly sleep?: (ms: number) => Promise<void>;
  /** Total acquire attempts before reporting busy. */
  readonly maxAttempts?: number;
  readonly retryDelayMs?: number;
}
declare function withProviderCliLock<T>(layout: ProviderCliAccountLayout, provider: ProviderCliProvider, run: () => Promise<T>, deps?: ProviderCliLockDeps): Promise<T>;
//#endregion
//#region src/runtime/provider-cli/manager.d.ts
/**
 * Read-only inspection and the ensure orchestration for one OS-account Provider CLI
 * installation. The manager owns selection validation, probing, readiness mapping, and
 * the ensure transaction; it never forwards paths or diagnostics off the machine.
 */
interface ProviderCliManagerDeps {
  /** OS account home (from the account record), never OPENTAG_HOME or caller $HOME. */
  readonly accountHome: string;
  /** Invoking CLI process environment; the detection PATH authority. */
  readonly env?: NodeJS.ProcessEnv;
  readonly platform?: NodeJS.Platform;
  readonly arch?: string;
  readonly catalog?: readonly ProviderCliCatalogEntry[];
  readonly fetcher?: ProviderCliFetcher;
  readonly execFile?: ProviderCliExecFile;
  readonly now?: () => Date;
  readonly isProcessAlive?: (pid: number) => boolean;
  readonly sleep?: (ms: number) => Promise<void>;
  /** Test hook: runs inside the provider lock immediately before winner re-verification. */
  readonly beforeWinnerReverify?: (winner: ProviderCliCandidate) => Promise<void>;
}
type ProviderCliPhaseEvent = ProviderCliPhaseRecord & {
  readonly provider: ProviderCliProvider;
};
interface ProviderCliEnsureOptions {
  readonly mode?: "auto" | "managed-only";
  /** Create or refresh the public shim in the account's `~/.local/bin`. Default true. */
  readonly pathUpdate?: boolean;
  readonly dryRun?: boolean;
  readonly onPhase?: (event: ProviderCliPhaseEvent) => void;
}
declare class ProviderCliManager {
  #private;
  constructor(deps: ProviderCliManagerDeps);
  get layout(): ProviderCliAccountLayout;
  /** Read-only selection validation, launcher check, fingerprint verify, and probe. */
  inspect(provider: ProviderCliProvider): Promise<ProviderCliInspection>;
  /**
   * Select the newest compatible candidate or immediately perform the managed install
   * when no eligible candidate exists. `auto` never skips an eligible external
   * candidate in favor of a managed install within the same operation.
   */
  ensure(provider: ProviderCliProvider, options?: ProviderCliEnsureOptions): Promise<ProviderCliEnsureResult>;
}
//#endregion
//#region src/runtime/provider-cli/reconciler.d.ts
/**
 * A foreground targeted connect is the sole first-setup installer and holds the per-provider
 * lock while it works. A daemon reconcile that loses that race waits the foreground operation
 * out instead of reporting a verdict: the delay is one lock-acquire budget, and the attempt
 * bound comfortably covers the installer's own download deadline.
 */
declare const PROVIDER_CLI_LOCK_BUSY_RETRY_DELAY_MS = 5000;
declare const PROVIDER_CLI_LOCK_BUSY_MAX_ATTEMPTS = 30;
interface ProviderCliReconcilerOptions {
  readonly connection: Pick<RuntimeConnection, "send" | "subscribeBusinessFrames" | "capabilityVersion" | "setImCliReadiness">;
  readonly logger?: Pick<ClientLogger, "info" | "warn">;
  readonly manager: Pick<ProviderCliManager, "ensure" | "inspect" | "layout">;
  readonly now?: () => number;
  /** Runs the same real Runtime probe used by the capability monitor for Server-owned preparation. */
  readonly refreshRuntimeProvider?: (provider: NonNullable<ProviderCliPrewarmFrame["runtimeProvider"]>) => Promise<RuntimeProviderReadinessObservation>;
  readonly signal?: AbortSignal;
  /** Test hook: replaces the busy-lock retry wait. */
  readonly sleep?: (ms: number) => Promise<void>;
  readonly validation: Pick<ProviderCliValidationRunner, "run" | "cleanupAll">;
}
declare class ProviderCliReconciler {
  #private;
  constructor(options: ProviderCliReconcilerOptions);
  close(): Promise<void>;
  /** Re-inspect published CLIs and active requirement Providers without mutating repair state. */
  refreshPublishedImCliReadiness(): Promise<void>;
  /**
   * Return the exact selection already accepted by daemon readiness.
   *
   * An already-accepted selection that still matches the live CLI is admitted
   * immediately. A never-accepted, already-healthy live CLI joins in-flight owner
   * work when present, otherwise confirms read-only if identity stays stable. A
   * provider that was accepted once and later failed or rotated is not treated as
   * a fresh cold start and does not start Run-triggered ensure. Caller cancellation
   * interrupts inspect and shared-work wait without cancelling other waiters.
   */
  readySelectionForRun(provider: ProviderCliProvider, signal?: AbortSignal): Promise<ProviderCliReadySelection | undefined>;
}
//#endregion
//#region src/runtime/provider-cli/tar.d.ts
/**
 * Minimal safe `tar.gz` reader for the managed-install transaction.
 *
 * Implemented in-process (no system tar dependency) so member validation is exact and
 * deterministic: path traversal, absolute members, links, devices, fifos, setuid/setgid
 * files, and unexpected executables are rejected before anything is written. Only the
 * one expected executable member is ever returned for publication; other regular
 * files (licenses, documentation) are validated and discarded.
 */
type ProviderCliArchiveRejection = "decompression-limit" | "invalid-archive" | "absolute-member" | "path-traversal" | "unexpected-member-type" | "setuid-setgid" | "unexpected-executable" | "executable-missing" | "executable-oversized";
declare class ProviderCliArchiveError extends Error {
  readonly rejection: ProviderCliArchiveRejection;
  readonly name = "ProviderCliArchiveError";
  constructor(rejection: ProviderCliArchiveRejection, message: string);
}
interface ExtractedProviderCliExecutable {
  /** Normalized archive-relative path of the executable member. */
  readonly name: string;
  readonly content: Uint8Array;
}
interface ExtractProviderCliExecutableOptions {
  /** Normalized archive-relative path of the one member that may be executable. */
  readonly expectedExecutable: string;
  /** Hard cap on the decompressed archive stream. */
  readonly maxExtractedBytes: number;
  /** Hard cap on the executable member itself. */
  readonly maxExecutableBytes: number;
}
declare function extractProviderCliExecutable(archive: Uint8Array, options: ExtractProviderCliExecutableOptions): ExtractedProviderCliExecutable;
//#endregion
//#region src/runtime/provider-cli/turn-launcher.d.ts
interface ProviderCliTurnLauncherSpec {
  readonly provider: ProviderCliProvider;
  readonly runId: string;
  readonly planPath: string;
  /** Absolute argv that starts the current daemon Node and loads the runner module. */
  readonly runnerInvocation: readonly string[];
}
/**
 * Private native-name launcher. It only execs the injected daemon Node/module
 * invocation, then forwards user argv after `--` without interpreting it.
 */
declare function renderProviderCliTurnLauncher(spec: ProviderCliTurnLauncherSpec): string;
//#endregion
//#region src/runtime/provider-cli/turn-runner.d.ts
interface ProviderCliTurnRunnerArgv {
  readonly planPath: string;
  readonly provider: ProviderCliProvider;
  readonly runId: string;
  readonly userArgv: readonly string[];
}
interface ExecuteProviderCliTurnPlanOptions {
  readonly planPath: string;
  readonly provider: ProviderCliProvider;
  readonly runId: string;
  readonly argv: readonly string[];
  readonly env?: NodeJS.ProcessEnv;
  readonly catalog?: readonly ProviderCliCatalogEntry[];
  /** Test/composition override. The standalone runner derives this from the OS account record. */
  readonly plansRoot?: string;
  readonly spawnTarget?: (file: string, args: readonly string[], options: {
    env: NodeJS.ProcessEnv;
  }) => Promise<number>;
}
declare function parseProviderCliTurnRunnerArgv(argv: readonly string[]): ProviderCliTurnRunnerArgv;
/**
 * Execute the immutable plan: re-hash the exact target, apply the provider/run fence,
 * and spawn without a shell. The current selection record is never consulted.
 */
declare function executeProviderCliTurnPlan(options: ExecuteProviderCliTurnPlanOptions): Promise<number>;
declare function runProviderCliTurnRunner(argv: readonly string[], options?: {
  readonly plansRoot?: string;
}): Promise<number>;
declare function resolveProviderCliTurnRunnerInvocation(): readonly string[];
//#endregion
//#region src/runtime/provider-cli/validation-classify.d.ts
type ValidationDiagnosticLogger = Pick<ClientLogger, "debug">;
type ProviderCliValidationClassification = {
  readonly status: "ready";
} | {
  readonly status: "retrying" | "needs_attention";
  readonly reason?: ProviderCliValidationResultReason;
};
declare function extractBoundedJson(text: string, maxBytes?: number, logger?: ValidationDiagnosticLogger): unknown;
declare function classifySlackAuthTest(payload: unknown, expected: Extract<ProviderCliExpectedIdentity, {
  provider: "slack";
}>, logger?: ValidationDiagnosticLogger): ProviderCliValidationClassification;
declare function classifyLarkAuthStatus(payload: unknown, expected: Extract<ProviderCliExpectedIdentity, {
  provider: "feishu";
}>, logger?: ValidationDiagnosticLogger): ProviderCliValidationClassification;
declare function classifySpawnFailure(error: unknown): ProviderCliValidationClassification;
//#endregion
//#region src/runtime/server-runtime-durability-store.d.ts
interface ServerRuntimeDurabilityStoreOptions {
  api: Pick<OpenTagApi, "listRuntimeDurableWork" | "writeRuntimeDurableWork">;
  machineToken: string;
  now?: () => number;
}
/** Runtime durability adapter backed by the authenticated Computer's Server rows. */
declare class ServerRuntimeDurabilityStore implements RuntimeDurabilityStore {
  #private;
  constructor(options: ServerRuntimeDurabilityStoreOptions);
  list<T = unknown>(kind: DurableWorkKind): Promise<DurableWorkRecord<T>[]>;
  write<T>(record: DurableWorkRecord<T>): Promise<void>;
}
//#endregion
//#region src/runtime/trace-buffer.d.ts
declare const TURN_TRACE_MAX_BUFFER_BYTES: number;
declare const TURN_TRACE_MAX_BUFFER_EVENTS = 256;
declare const TURN_TRACE_SEND_DEADLINE_MS = 500;
declare const TURN_TRACE_BATCH_SOFT_LIMIT_BYTES: number;
interface TurnTraceBufferOptions {
  id?: () => string;
  maxBufferBytes?: number;
  maxBufferEvents?: number;
  now?: () => number;
  placementGeneration: number;
  sender: Pick<RuntimeConnection, "send">;
  sessionId: string;
  turnId: string;
}
interface TurnTraceSummary {
  droppedEvents: number;
  lastSequence: number;
}
declare class TurnTraceBuffer {
  #private;
  constructor(options: TurnTraceBufferOptions);
  turnStarted(): void;
  itemCompleted(itemType: "agent_message" | "command" | "file_change" | "tool" | "other", status: "completed" | "failed"): void;
  usageUpdated(usage: RuntimeUsage): void;
  warning(code: string, _message: string): void;
  turnCompleted(outcome: "completed" | "failed" | "cancelled" | "unknown"): void;
  record(event: AgentRuntimeEvent): void;
  summary(): TurnTraceSummary;
  finish(): Promise<TurnTraceSummary>;
}
//#endregion
//#region src/runtime/update-manager.d.ts
/**
 * Durable record of one automatic-upgrade attempt. The attempt is recorded before any install work
 * starts, so a crash or supervisor kill mid-install still counts: an interrupted attempt becomes a
 * blocked state instead of a silent retry, which is what keeps restart loops from becoming storms.
 */
interface UpdaterAttempt {
  target: string;
  startedAt: string;
  finishedAt?: string;
  result?: "installed" | "failed";
  failureReason?: string;
}
type UpdaterStateName = "idle" | "awaiting_protected_work" | "installing" | "blocked" | "installed";
type UpdaterRecoveryStatus = "upgrade_required" | "authentication_repair" | "retryable_connectivity";
/** Persisted updater status, also the source for `daemon status` update reporting. */
interface UpdaterStateSnapshot {
  schemaVersion: 1;
  currentVersion: string;
  state: UpdaterStateName;
  recoveryStatus?: UpdaterRecoveryStatus;
  target?: string;
  lastAttempt?: UpdaterAttempt;
  attempts: Record<string, UpdaterAttempt>;
}
interface ProtectedWorkCount {
  /** Zero means no local state could lose or duplicate an accepted Turn or IM delivery. */
  total: number;
}
interface UpdateManagerOptions {
  /** This build's release channel; advertisements for any other channel are ignored. */
  channel: ChannelName;
  /** This build's exact version. */
  currentVersion: string;
  logger?: ClientLogger;
  /** Authoritative protected-work count from the Session runtime boundary. */
  protectedWork(): ProtectedWorkCount;
  /**
   * Atomically close new-work admission before checking the protected-work snapshot. The returned
   * function reopens admission if the target is superseded or the attempt fails.
   */
  quiesce?(): () => void;
  /**
   * Install the exact target and refresh the daemon service definition through the newly installed
   * binary. Resolves when the new version is live on disk; rejects with the failure reason.
   */
  executeUpdate(target: string): Promise<void>;
  /**
   * Hand the process off to the supervisor (reserved restart exit code) after a successful install.
   * Errors are logged and swallowed: the install already succeeded and must not be re-attempted.
   */
  onHandoff(): void | Promise<void>;
  loadState(): Promise<UpdaterStateSnapshot | undefined>;
  saveState(state: UpdaterStateSnapshot): Promise<void>;
  /** Protected-work re-check cadence. This is a poll interval, never a force timeout. */
  checkIntervalMs?: number;
  /** Read the configured release channel without relying on a runtime heartbeat. */
  discoverTarget?: () => Promise<RuntimeChannelTarget | undefined>;
  /** Successful release discovery cadence. Failed reads use bounded exponential backoff. */
  discoveryIntervalMs?: number;
  discoveryMaxBackoffMs?: number;
  now?: () => number;
  sleep?: (milliseconds: number) => Promise<void>;
}
/**
 * Drives automatic upgrades for the portable install mode. One decision loop, one durable attempt
 * per exact target, monotonic SemVer comparisons only (never an automatic downgrade), and an
 * indefinite protected-work gate: the updater adds no force timeout of its own, because the Session
 * module already bounds every unit of protected work (Turn budgets, delivery deadlines, report
 * retries with terminal outcomes) and therefore owns hang prevention.
 *
 * npm-global installs never attach a manager: they upgrade only through the manual CLI command.
 */
declare class UpdateManager {
  #private;
  constructor(options: UpdateManagerOptions);
  /**
   * Reconcile durable status with the binary that actually started. This runs once before runtime
   * traffic begins, so `daemon status` always has a current version even when no update has ever
   * been advertised. If a previously blocked/installed target is now the running version, the
   * supervisor handoff (or a manual restart) succeeded and that record converges to installed.
   */
  syncRunningVersion(): Promise<void>;
  /** Record a Server-advertised channel target. Cheap and safe to call on every heartbeat. */
  observe(advertisement: RuntimeChannelTarget): void;
  /** Start the single heartbeat-independent release discovery loop. */
  startDiscovery(): void;
  /** Trigger one coalesced metadata read, for example after a capability rejection. */
  discoverNow(): Promise<void>;
  /** Keep the discovery loop referenced while the daemon waits for recovery. */
  holdRecoveryAlive(): () => void;
  /** Persist a local recovery diagnosis without changing the install-attempt state machine. */
  recordRecoveryStatus(status: UpdaterRecoveryStatus | undefined): Promise<void>;
  stop(): void;
}
//#endregion
//#region src/runtime/web-tools-artifact.d.ts
/**
 * Resolve the fixed trusted Pi web-tools extension artifact shipped inside the Client package.
 * The artifact is built into `dist/pi-extensions/web-tools.mjs`; resolution never follows
 * environment variables, workspaces, or cwd, so an Agent can never substitute its own extension.
 * An explicit path exists only as a composition/test seam. Failure returns undefined (web tools
 * stay off), never a guessed path.
 */
declare function resolveWebToolsExtensionPath(options?: {
  explicitPath?: string;
}): Promise<string | undefined>;
//#endregion
//#region src/runtime/web-tools-client.d.ts
/**
 * Agreed error codes this trusted client can surface. The shared wire enum is the authority;
 * the three lifecycle/credit codes are part of the agreed Router contract and must survive the
 * client mapping instead of being collapsed into idempotency/unknown.
 */
type ClientWebToolErrorCode = WebToolErrorCode | "request_in_progress" | "request_uncertain" | "insufficient_credit";
/** Controlled trusted-client web failure. `code` is the only detail shared with the Sandbox. */
declare class WebToolsClientError extends Error {
  readonly code: ClientWebToolErrorCode;
  readonly retryable?: boolean;
  constructor(code: ClientWebToolErrorCode, message: string, options?: {
    retryable?: boolean;
  });
}
interface WebToolsServerClientOptions {
  /** Base Server URL from the trusted daemon configuration; never caller input. */
  readonly serverUrl: string;
  /**
   * The bearer presented to the two fixed runtime web routes. A Local daemon passes its Computer
   * machine token; a Cloud Runner parent passes the short-lived execution web bearer the Server
   * issued over the credential tunnel. Either way the value stays in the trusted process: the
   * Sandbox and the Pi extension only ever see the private socket that fronts it.
   */
  readonly bearerToken: string;
  readonly fetchImpl?: typeof fetch;
  readonly logger?: Pick<ClientLogger, "debug" | "warn">;
}
/**
 * Trusted runner → Server web client. The path set is fixed, the bearer is the only credential, the
 * body is the strict execution request, and the response is byte-bounded and schema-validated before
 * anything returns to the Sandbox-facing gateway. One combined deadline spans request headers AND
 * the full response body.
 */
declare class WebToolsServerClient {
  #private;
  constructor(options: WebToolsServerClientOptions);
  search(input: {
    request: WebSearchExecutionRequest;
    remainingMs?: number;
    signal?: AbortSignal;
  }): Promise<WebSearchResult>;
  fetch(input: {
    request: WebFetchExecutionRequest;
    remainingMs?: number;
    signal?: AbortSignal;
  }): Promise<WebFetchResult>;
}
//#endregion
//#region src/skills/skill-bundle.d.ts
/**
 * Integrity check for a Skill bundle, shared by runtime sync and the CLI's `skill pull`.
 *
 * The platform reports each Skill's exact compressed byte length and lowercase-hex SHA-256; both
 * must match before a downloaded bundle is trusted enough to materialize.
 */
interface ExpectedSkillBundle {
  readonly archiveBytes: number;
  /** Lowercase hex SHA-256 over the compressed archive bytes. */
  readonly archiveSha256: string;
  /** Used only to make a failure message identify the Skill. */
  readonly name?: string;
}
declare function verifySkillBundle(bytes: Uint8Array, expected: ExpectedSkillBundle): Uint8Array;
//#endregion
//#region src/skills/skill-bundle-body.d.ts
/**
 * Bounded body reader for a Skill bundle response.
 *
 * `OpenTagApi.#fetchResponse` clears its request timer and abort listener as soon as response
 * headers arrive, so awaiting `response.arrayBuffer()` puts the body outside every deadline the
 * API applied. A server that sends headers and then stalls would hold runtime start indefinitely.
 * This reader races every chunk against the caller's signal, caps the body at the bundle's declared
 * length, and cancels the underlying stream on abort or overrun.
 */
/** `skill pull` is an interactive command, so its body deadline is far longer than a sync budget. */
declare const SKILL_PULL_BUNDLE_TIMEOUT_MS = 60000;
interface ReadBundleBodyOptions {
  readonly signal: AbortSignal;
  /** The bundle's declared compressed byte length; an over-long body is rejected before buffering. */
  readonly maxBytes: number;
}
declare function readBundleBody(response: Response, options: ReadBundleBodyOptions): Promise<Uint8Array>;
//#endregion
//#region src/slack-management.d.ts
declare function slackManagementHome(environment?: NodeJS.ProcessEnv): string;
declare function slackManagementEnvironment(environment: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
declare function runSlackManagement(args: string[], options?: {
  outputFile?: string;
  projectDir?: string;
  team?: string;
  environment?: NodeJS.ProcessEnv;
  binary?: string;
  accountHome?: string;
  signal?: AbortSignal;
  errorFile?: string;
  nonInteractive?: boolean;
  requestAppApproval?: boolean;
}): Promise<number>;
/** Prepare only the callback update from a successful CLI result and the current remote manifest. */
declare function prepareSlackCallbackUpdate(options: {
  manifestFile: string;
  provisionResultFile: string;
  outputFile: string;
  environment?: NodeJS.ProcessEnv;
}): Promise<void>;
/** Called only by the official deploy hook; writes the complete material without logging it. */
declare function captureSlackDeploy(options: {
  createResponseFile: string;
  outputFile: string;
  environment?: NodeJS.ProcessEnv;
  fetchImpl?: typeof fetch;
}): Promise<void>;
//#endregion
//#region src/storage/context-tree-home.d.ts
/** Account storage shared with the standalone Context Tree CLI, independent of OPENTAG_HOME. */
declare function resolveContextTreeHome(environment?: NodeJS.ProcessEnv): {
  directory: string;
};
declare function prepareContextTreeHome(environment?: NodeJS.ProcessEnv): Promise<string>;
//#endregion
//#region src/storage/durable-file.d.ts
declare class RuntimeStorageError extends Error {
  readonly code: "conflict" | "invalid" | "unsafe";
  constructor(code: "conflict" | "invalid" | "unsafe", message: string);
}
declare function ensurePrivateDirectory(root: string, target: string): Promise<string>;
declare function validatePrivateDirectory(root: string, target: string): Promise<boolean>;
declare function readSecureFile(path: string): Promise<string | undefined>;
declare function readDurableJson<T>(path: string, validate: (value: unknown) => T): Promise<T | undefined>;
declare function writeDurableFile(path: string, content: string, mode?: number): Promise<void>;
declare function writeDurableJson(path: string, value: unknown): Promise<void>;
declare function assertRealDirectory(path: string): Promise<void>;
declare function assertWithin(root: string, target: string): void;
//#endregion
//#region src/storage/private-json-file.d.ts
declare function readPrivateJson<T>(home: string, filePath: string, validate: (value: unknown) => T): Promise<T | undefined>;
declare function writePrivateJson(home: string, filePath: string, value: unknown): Promise<void>;
declare namespace policy_d_exports {
  export { CommandError$1 as CommandError, CommandErrorCategory, CommandExecutionOptions, CommandExitCode, CommandFailureObserver, CommandPhase, CommandPresentationOptions, CommandResult, CommandRetryability, EXIT_CODES$1 as EXIT_CODES, commandExitCode$1 as commandExitCode, executeCommand$1 as executeCommand, observeCommandFailures, presentCommand$1 as presentCommand, redactSecrets, toCommandError$1 as toCommandError };
}
/** Process exit values shared by every user-facing CLI command. */
declare const EXIT_CODES$1: {
  readonly success: 0;
  readonly failure: 1;
  readonly usage: 2;
  readonly serviceUnavailable: 3;
  readonly interrupted: 130;
};
type CommandExitCode = (typeof EXIT_CODES$1)[keyof typeof EXIT_CODES$1];
type CommandErrorCategory = StructuredError["category"];
type CommandRetryability = ErrorRetryability;
type CommandPhase = StructuredError["phase"];
type CommandErrorCodeFields = {
  code: string;
  category: CommandErrorCategory;
};
type CommandErrorRetryFields = {
  retryability: CommandRetryability;
  phase: CommandPhase;
};
type CommandErrorRequiredFields = CommandErrorCodeFields & CommandErrorRetryFields;
type CommandErrorFields = CommandErrorRequiredFields & {
  requestId?: string;
};
/** Structured, transport-neutral CLI failure metadata. The Error message is the human detail. */
declare class CommandError$1 extends Error {
  readonly code: string;
  readonly category: CommandErrorCategory;
  readonly retryability: CommandRetryability;
  readonly phase: CommandPhase;
  readonly requestId?: string;
  readonly structuredError: StructuredError;
  constructor(fields: CommandErrorFields, message: string, options?: ErrorOptions);
  toStructuredError(): StructuredError;
}
type SuccessCommandResult<T> = {
  ok: true;
  value: T;
  exitCode: typeof EXIT_CODES$1.success;
};
type FailureCommandResultBase<T> = {
  ok: false;
  error: CommandError$1;
  value?: T;
};
type FailureCommandResult<T> = FailureCommandResultBase<T> & {
  exitCode: Exclude<CommandExitCode, 0>;
};
type CommandResult<T> = SuccessCommandResult<T> | FailureCommandResult<T>;
type CommandFormatValueOptions<T> = {
  formatValue?: (value: T) => string;
};
type CommandFormatWriterOptions = {
  stdout?: (chunk: string) => void;
  stderr?: (chunk: string) => void;
};
type CommandFormatOptions<T> = CommandFormatValueOptions<T> & CommandFormatWriterOptions;
type CommandPresentationOptions<T> = {
  json?: boolean;
} & CommandFormatOptions<T>;
type CommandExecutionOptions<T> = CommandPresentationOptions<T> & {
  logger?: ClientLogger;
  phase?: CommandPhase;
};
/** Convert errors from Commander, Zod, the API, and Node into one local contract. */
declare function toCommandError$1(error: unknown, phase?: CommandPhase): CommandError$1;
/** Present a result once. Human successes use stdout; all failures use redacted stderr. */
declare function presentCommand$1<T>(result: CommandResult<T>, options?: CommandPresentationOptions<T>): CommandExitCode;
type CommandFailureObserver = (error: unknown, commandError: CommandError$1) => void;
/**
 * Observe every failure the shared execution path handles. Commands present their own failures and
 * return an exit code, so a process-level concern such as error reporting cannot see them from the
 * entry point's catch; this is the one seam that does. Returns the function that detaches it.
 */
declare function observeCommandFailures(observer: CommandFailureObserver): () => void;
/** Run an operation through the shared result and presentation path. */
declare function executeCommand$1<T>(operation: () => Promise<T>, options?: CommandExecutionOptions<T>): Promise<CommandExitCode>;
declare function commandExitCode$1(error: CommandError$1): Exclude<CommandExitCode, typeof EXIT_CODES$1.success>;
declare function redactSecrets(value: string): string;
//#endregion
//#region src/build-info.d.ts
export declare const CHANNEL: ChannelName;
export declare const CLI_PACKAGE_NAME: string;
export declare const CLI_VERSION: string;
//#endregion
//#region ../../node_modules/.pnpm/commander@15.0.0/node_modules/commander/typings/index.d.ts
// Type definitions for commander
// Original definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>, Jules Randolph <https://github.com/sveinburne>
/* eslint-disable @typescript-eslint/no-explicit-any */
// This is a trick to encourage editor to suggest the known literals while still
// allowing any BaseType value.
// References:
// - https://github.com/microsoft/TypeScript/issues/29729
// - https://github.com/sindresorhus/type-fest/blob/main/source/literal-union.d.ts
// - https://github.com/sindresorhus/type-fest/blob/main/source/primitive.d.ts
type LiteralUnion<LiteralType, BaseType extends string | number> = LiteralType | (BaseType & Record<never, never>);
declare class CommanderError extends Error {
  code: string;
  exitCode: number;
  message: string;
  nestedError?: string;
  /**
   * Constructs the CommanderError class
   * @param exitCode - suggested exit code which could be used with process.exit
   * @param code - an id string representing the error
   * @param message - human-readable description of the error
   */
  constructor(exitCode: number, code: string, message: string);
}
interface ErrorOptions$1 {
  // optional parameter for error()
  /** an id string representing the error */
  code?: string;
  /** suggested exit code which could be used with process.exit */
  exitCode?: number;
}
declare class Argument {
  description: string;
  required: boolean;
  variadic: boolean;
  defaultValue?: any;
  defaultValueDescription?: string;
  parseArg?: <T>(value: string, previous: T) => T;
  argChoices?: string[];
  /**
   * Initialize a new command argument with the given name and description.
   * The default is that the argument is required, and you can explicitly
   * indicate this with <> around the name. Put [] around the name for an optional argument.
   */
  constructor(arg: string, description?: string);
  /**
   * Return argument name.
   */
  name(): string;
  /**
   * Set the default value, and optionally supply the description to be displayed in the help.
   */
  default(value: unknown, description?: string): this;
  /**
   * Set the custom handler for processing CLI command arguments into argument values.
   */
  argParser<T>(fn: (value: string, previous: T) => T): this;
  /**
   * Only allow argument value to be one of choices.
   */
  choices(values: readonly string[]): this;
  /**
   * Make argument required.
   */
  argRequired(): this;
  /**
   * Make argument optional.
   */
  argOptional(): this;
}
declare class Option {
  flags: string;
  description: string;
  required: boolean; // A value must be supplied when the option is specified.
  optional: boolean; // A value is optional when the option is specified.
  variadic: boolean;
  mandatory: boolean; // The option must have a value after parsing, which usually means it must be specified on command line.
  short?: string;
  long?: string;
  negate: boolean;
  defaultValue?: any;
  defaultValueDescription?: string;
  presetArg?: unknown;
  envVar?: string;
  parseArg?: <T>(value: string, previous: T) => T;
  hidden: boolean;
  argChoices?: string[];
  helpGroupHeading?: string;
  constructor(flags: string, description?: string);
  /**
   * Set the default value, and optionally supply the description to be displayed in the help.
   */
  default(value: unknown, description?: string): this;
  /**
   * Preset to use when option used without option-argument, especially optional but also boolean and negated.
   * The custom processing (parseArg) is called.
   *
   * @example
   * ```ts
   * new Option('--color').default('GREYSCALE').preset('RGB');
   * new Option('--donate [amount]').preset('20').argParser(parseFloat);
   * ```
   */
  preset(arg: unknown): this;
  /**
   * Add option name(s) that conflict with this option.
   * An error will be displayed if conflicting options are found during parsing.
   *
   * @example
   * ```ts
   * new Option('--rgb').conflicts('cmyk');
   * new Option('--js').conflicts(['ts', 'jsx']);
   * ```
   */
  conflicts(names: string | string[]): this;
  /**
   * Specify implied option values for when this option is set and the implied options are not.
   *
   * The custom processing (parseArg) is not called on the implied values.
   *
   * @example
   * program
   *   .addOption(new Option('--log', 'write logging information to file'))
   *   .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));
   */
  implies(optionValues: OptionValues): this;
  /**
   * Set environment variable to check for option value.
   *
   * An environment variables is only used if when processed the current option value is
   * undefined, or the source of the current value is 'default' or 'config' or 'env'.
   */
  env(name: string): this;
  /**
   * Set the custom handler for processing CLI option arguments into option values.
   */
  argParser<T>(fn: (value: string, previous: T) => T): this;
  /**
   * Whether the option is mandatory and must have a value after parsing.
   */
  makeOptionMandatory(mandatory?: boolean): this;
  /**
   * Hide option in help.
   */
  hideHelp(hide?: boolean): this;
  /**
   * Only allow option value to be one of choices.
   */
  choices(values: readonly string[]): this;
  /**
   * Return option name.
   */
  name(): string;
  /**
   * Return option name, in a camelcase format that can be used
   * as an object attribute key.
   */
  attributeName(): string;
  /**
   * Set the help group heading.
   */
  helpGroup(heading: string): this;
  /**
   * Return whether a boolean option.
   *
   * Options are one of boolean, negated, required argument, or optional argument.
   */
  isBoolean(): boolean;
}
declare class Help {
  /** output helpWidth, long lines are wrapped to fit */
  helpWidth?: number;
  minWidthToWrap: number;
  sortSubcommands: boolean;
  sortOptions: boolean;
  showGlobalOptions: boolean;
  constructor();
  /*
   * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`
   * and just before calling `formatHelp()`.
   *
   * Commander just uses the helpWidth and the others are provided for subclasses.
   */
  prepareContext(contextOptions: {
    error?: boolean;
    helpWidth?: number;
    outputHasColors?: boolean;
  }): void;
  /** Get the command term to show in the list of subcommands. */
  subcommandTerm(cmd: Command): string;
  /** Get the command summary to show in the list of subcommands. */
  subcommandDescription(cmd: Command): string;
  /** Get the option term to show in the list of options. */
  optionTerm(option: Option): string;
  /** Get the option description to show in the list of options. */
  optionDescription(option: Option): string;
  /** Get the argument term to show in the list of arguments. */
  argumentTerm(argument: Argument): string;
  /** Get the argument description to show in the list of arguments. */
  argumentDescription(argument: Argument): string;
  /** Get the command usage to be displayed at the top of the built-in help. */
  commandUsage(cmd: Command): string;
  /** Get the description for the command. */
  commandDescription(cmd: Command): string;
  /** Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one. */
  visibleCommands(cmd: Command): Command[];
  /** Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one. */
  visibleOptions(cmd: Command): Option[];
  /** Get an array of the visible global options. (Not including help.) */
  visibleGlobalOptions(cmd: Command): Option[];
  /** Get an array of the arguments which have descriptions. */
  visibleArguments(cmd: Command): Argument[];
  /** Get the longest command term length. */
  longestSubcommandTermLength(cmd: Command, helper: Help): number;
  /** Get the longest option term length. */
  longestOptionTermLength(cmd: Command, helper: Help): number;
  /** Get the longest global option term length. */
  longestGlobalOptionTermLength(cmd: Command, helper: Help): number;
  /** Get the longest argument term length. */
  longestArgumentTermLength(cmd: Command, helper: Help): number;
  /** Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations. */
  displayWidth(str: string): number;
  /** Style the titles. Called with 'Usage:', 'Options:', etc. */
  styleTitle(title: string): string;
  /** Usage: <str> */
  styleUsage(str: string): string;
  /** Style for command name in usage string.  */
  styleCommandText(str: string): string;
  styleCommandDescription(str: string): string;
  styleOptionDescription(str: string): string;
  styleSubcommandDescription(str: string): string;
  styleArgumentDescription(str: string): string;
  /** Base style used by descriptions. */
  styleDescriptionText(str: string): string;
  styleOptionTerm(str: string): string;
  styleSubcommandTerm(str: string): string;
  styleArgumentTerm(str: string): string;
  /** Base style used in terms and usage for options. */
  styleOptionText(str: string): string;
  /** Base style used in terms and usage for subcommands. */
  styleSubcommandText(str: string): string;
  /** Base style used in terms and usage for arguments. */
  styleArgumentText(str: string): string;
  /** Calculate the pad width from the maximum term length. */
  padWidth(cmd: Command, helper: Help): number;
  /**
   * Wrap a string at whitespace, preserving existing line breaks.
   * Wrapping is skipped if the width is less than `minWidthToWrap`.
   */
  boxWrap(str: string, width: number): string;
  /** Detect manually wrapped and indented strings by checking for line break followed by whitespace. */
  preformatted(str: string): boolean;
  /**
   * Format the "item", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.
   *
   * So "TTT", 5, "DDD DDDD DD DDD" might be formatted for this.helpWidth=17 like so:
   *   TTT    DDD DDDD
   *          DD DDD
   */
  formatItem(term: string, termWidth: number, description: string, helper: Help): string;
  /**
   * Format a list of items, given a heading and an array of formatted items.
   */
  formatItemList(heading: string, items: string[], helper: Help): string[];
  /**
   * Group items by their help group heading.
   */
  groupItems<T extends Command | Option>(unsortedItems: T[], visibleItems: T[], getGroup: (item: T) => string): Map<string, T[]>;
  /** Generate the built-in help text. */
  formatHelp(cmd: Command, helper: Help): string;
}
type HelpConfiguration = Partial<Help>;
interface ParseOptions {
  from: 'node' | 'electron' | 'user';
}
interface HelpContext {
  // optional parameter for .help() and .outputHelp()
  error: boolean;
}
interface AddHelpTextContext {
  // passed to text function used with .addHelpText()
  error: boolean;
  command: Command;
}
interface OutputConfiguration {
  writeOut?(str: string): void;
  writeErr?(str: string): void;
  outputError?(str: string, write: (str: string) => void): void;
  getOutHelpWidth?(): number;
  getErrHelpWidth?(): number;
  getOutHasColors?(): boolean;
  getErrHasColors?(): boolean;
  stripColor?(str: string): string;
}
type AddHelpTextPosition = 'beforeAll' | 'before' | 'after' | 'afterAll';
type HookEvent = 'preSubcommand' | 'preAction' | 'postAction';
// The source is a string so author can define their own too.
type OptionValueSource = LiteralUnion<'default' | 'config' | 'env' | 'cli' | 'implied', string> | undefined;
type OptionValues = Record<string, any>;
declare class Command {
  args: string[];
  processedArgs: any[];
  readonly commands: readonly Command[];
  readonly options: readonly Option[];
  readonly registeredArguments: readonly Argument[];
  parent: Command | null;
  constructor(name?: string);
  /**
   * Set the program version to `str`.
   *
   * This method auto-registers the "-V, --version" flag
   * which will print the version number when passed.
   *
   * You can optionally supply the  flags and description to override the defaults.
   */
  version(str: string, flags?: string, description?: string): this;
  /**
   * Get the program version.
   */
  version(): string | undefined;
  /**
   * Define a command, implemented using an action handler.
   *
   * @remarks
   * The command description is supplied using `.description`, not as a parameter to `.command`.
   *
   * @example
   * ```ts
   * program
   *   .command('clone <source> [destination]')
   *   .description('clone a repository into a newly created directory')
   *   .action((source, destination) => {
   *     console.log('clone command called');
   *   });
   * ```
   *
   * @param nameAndArgs - command name and arguments, args are  `<required>` or `[optional]` and last may also be `variadic...`
   * @param opts - configuration options
   * @returns new command
   */
  command(nameAndArgs: string, opts?: CommandOptions): ReturnType<this['createCommand']>;
  /**
   * Define a command, implemented in a separate executable file.
   *
   * @remarks
   * The command description is supplied as the second parameter to `.command`.
   *
   * @example
   * ```ts
   *  program
   *    .command('start <service>', 'start named service')
   *    .command('stop [service]', 'stop named service, or all if no name supplied');
   * ```
   *
   * @param nameAndArgs - command name and arguments, args are  `<required>` or `[optional]` and last may also be `variadic...`
   * @param description - description of executable command
   * @param opts - configuration options
   * @returns `this` command for chaining
   */
  command(nameAndArgs: string, description: string, opts?: ExecutableCommandOptions): this;
  /**
   * Factory routine to create a new unattached command.
   *
   * See .command() for creating an attached subcommand, which uses this routine to
   * create the command. You can override createCommand to customise subcommands.
   */
  createCommand(name?: string): Command;
  /**
   * Add a prepared subcommand.
   *
   * See .command() for creating an attached subcommand which inherits settings from its parent.
   *
   * @returns `this` command for chaining
   */
  addCommand(cmd: Command, opts?: CommandOptions): this;
  /**
   * Factory routine to create a new unattached argument.
   *
   * See .argument() for creating an attached argument, which uses this routine to
   * create the argument. You can override createArgument to return a custom argument.
   */
  createArgument(name: string, description?: string): Argument;
  /**
   * Define argument syntax for command.
   *
   * The default is that the argument is required, and you can explicitly
   * indicate this with <> around the name. Put [] around the name for an optional argument.
   *
   * @example
   * ```
   * program.argument('<input-file>');
   * program.argument('[output-file]');
   * ```
   *
   * @returns `this` command for chaining
   */
  argument<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this;
  argument(name: string, description?: string, defaultValue?: unknown): this;
  /**
   * Define argument syntax for command, adding a prepared argument.
   *
   * @returns `this` command for chaining
   */
  addArgument(arg: Argument): this;
  /**
   * Define argument syntax for command, adding multiple at once (without descriptions).
   *
   * See also .argument().
   *
   * @example
   * ```
   * program.arguments('<cmd> [env]');
   * ```
   *
   * @returns `this` command for chaining
   */
  arguments(names: string): this;
  /**
   * Customise or override default help command. By default a help command is automatically added if your command has subcommands.
   *
   * @example
   * ```ts
   * program.helpCommand('help [cmd]');
   * program.helpCommand('help [cmd]', 'show help');
   * program.helpCommand(false); // suppress default help command
   * program.helpCommand(true); // add help command even if no subcommands
   * ```
   */
  helpCommand(nameAndArgs: string, description?: string): this;
  helpCommand(enable: boolean): this;
  /**
   * Add prepared custom help command.
   */
  addHelpCommand(cmd: Command): this;
  /** @deprecated since v12, instead use helpCommand */
  addHelpCommand(nameAndArgs: string, description?: string): this;
  /** @deprecated since v12, instead use helpCommand */
  addHelpCommand(enable?: boolean): this;
  /**
   * Add hook for life cycle event.
   */
  hook(event: HookEvent, listener: (thisCommand: Command, actionCommand: Command) => void | Promise<void>): this;
  /**
   * Register callback to use as replacement for calling process.exit.
   */
  exitOverride(callback?: (err: CommanderError) => never | void): this;
  /**
   * Display error message and exit (or call exitOverride).
   */
  error(message: string, errorOptions?: ErrorOptions$1): never;
  /**
   * You can customise the help with a subclass of Help by overriding createHelp,
   * or by overriding Help properties using configureHelp().
   */
  createHelp(): Help;
  /**
   * You can customise the help by overriding Help properties using configureHelp(),
   * or with a subclass of Help by overriding createHelp().
   */
  configureHelp(configuration: HelpConfiguration): this;
  /** Get configuration */
  configureHelp(): HelpConfiguration;
  /**
   * The default output goes to stdout and stderr. You can customise this for special
   * applications. You can also customise the display of errors by overriding outputError.
   *
   * The configuration properties are all functions:
   * ```
   * // functions to change where being written, stdout and stderr
   * writeOut(str)
   * writeErr(str)
   * // matching functions to specify width for wrapping help
   * getOutHelpWidth()
   * getErrHelpWidth()
   * // functions based on what is being written out
   * outputError(str, write) // used for displaying errors, and not used for displaying help
   * ```
   */
  configureOutput(configuration: OutputConfiguration): this;
  /** Get configuration */
  configureOutput(): OutputConfiguration;
  /**
   * Copy settings that are useful to have in common across root command and subcommands.
   *
   * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)
   */
  copyInheritedSettings(sourceCommand: Command): this;
  /**
   * Display the help or a custom message after an error occurs.
   */
  showHelpAfterError(displayHelp?: boolean | string): this;
  /**
   * Display suggestion of similar commands for unknown commands, or options for unknown options.
   */
  showSuggestionAfterError(displaySuggestion?: boolean): this;
  /**
   * Register callback `fn` for the command.
   *
   * @example
   * ```
   * program
   *   .command('serve')
   *   .description('start service')
   *   .action(function() {
   *     // do work here
   *   });
   * ```
   *
   * @returns `this` command for chaining
   */
  action(fn: (this: this, ...args: any[]) => void | Promise<void>): this;
  /**
   * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.
   *
   * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required
   * option-argument is indicated by `<>` and an optional option-argument by `[]`.
   *
   * See the README for more details, and see also addOption() and requiredOption().
   *
   * @example
   *
   * ```js
   * program
   *     .option('-p, --pepper', 'add pepper')
   *     .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument
   *     .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default
   *     .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function
   * ```
   *
   * @returns `this` command for chaining
   */
  option(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
  option<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this;
  /** @deprecated since v7, instead use choices or a custom function */
  option(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
  /**
   * Define a required option, which must have a value after parsing. This usually means
   * the option must be specified on the command line. (Otherwise the same as .option().)
   *
   * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
   */
  requiredOption(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
  requiredOption<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this;
  /** @deprecated since v7, instead use choices or a custom function */
  requiredOption(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
  /**
   * Factory routine to create a new unattached option.
   *
   * See .option() for creating an attached option, which uses this routine to
   * create the option. You can override createOption to return a custom option.
   */
  createOption(flags: string, description?: string): Option;
  /**
   * Add a prepared Option.
   *
   * See .option() and .requiredOption() for creating and attaching an option in a single call.
   */
  addOption(option: Option): this;
  /**
   * Whether to store option values as properties on command object,
   * or store separately (specify false). In both cases the option values can be accessed using .opts().
   *
   * @returns `this` command for chaining
   */
  storeOptionsAsProperties<T extends OptionValues>(): this & T;
  storeOptionsAsProperties<T extends OptionValues>(storeAsProperties: true): this & T;
  storeOptionsAsProperties(storeAsProperties?: boolean): this;
  /**
   * Retrieve option value.
   */
  getOptionValue(key: string): any;
  /**
   * Store option value.
   */
  setOptionValue(key: string, value: unknown): this;
  /**
   * Store option value and where the value came from.
   */
  setOptionValueWithSource(key: string, value: unknown, source: OptionValueSource): this;
  /**
   * Get source of option value.
   */
  getOptionValueSource(key: string): OptionValueSource | undefined;
  /**
   * Get source of option value. See also .optsWithGlobals().
   */
  getOptionValueSourceWithGlobals(key: string): OptionValueSource | undefined;
  /**
   * Alter parsing of short flags with optional values.
   *
   * @example
   * ```
   * // for `.option('-f,--flag [value]'):
   * .combineFlagAndOptionalValue(true)  // `-f80` is treated like `--flag=80`, this is the default behaviour
   * .combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`
   * ```
   *
   * @returns `this` command for chaining
   */
  combineFlagAndOptionalValue(combine?: boolean): this;
  /**
   * Allow unknown options on the command line.
   *
   * @returns `this` command for chaining
   */
  allowUnknownOption(allowUnknown?: boolean): this;
  /**
   * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.
   *
   * @returns `this` command for chaining
   */
  allowExcessArguments(allowExcess?: boolean): this;
  /**
   * Enable positional options. Positional means global options are specified before subcommands which lets
   * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.
   *
   * The default behaviour is non-positional and global options may appear anywhere on the command line.
   *
   * @returns `this` command for chaining
   */
  enablePositionalOptions(positional?: boolean): this;
  /**
   * Pass through options that come after command-arguments rather than treat them as command-options,
   * so actual command-options come before command-arguments. Turning this on for a subcommand requires
   * positional options to have been enabled on the program (parent commands).
   *
   * The default behaviour is non-positional and options may appear before or after command-arguments.
   *
   * @returns `this` command for chaining
   */
  passThroughOptions(passThrough?: boolean): this;
  /**
   * Parse `argv`, setting options and invoking commands when defined.
   *
   * Use parseAsync instead of parse if any of your action handlers are async.
   *
   * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
   *
   * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
   * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
   * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
   * - `'user'`: just user arguments
   *
   * @example
   * ```
   * program.parse(); // parse process.argv and auto-detect electron and special node flags
   * program.parse(process.argv); // assume argv[0] is app and argv[1] is script
   * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
   * ```
   *
   * @returns `this` command for chaining
   */
  parse(argv?: readonly string[], parseOptions?: ParseOptions): this;
  /**
   * Parse `argv`, setting options and invoking commands when defined.
   *
   * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
   *
   * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
   * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
   * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
   * - `'user'`: just user arguments
   *
   * @example
   * ```
   * await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags
   * await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script
   * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
   * ```
   *
   * @returns Promise
   */
  parseAsync(argv?: readonly string[], parseOptions?: ParseOptions): Promise<this>;
  /**
   * Called the first time parse is called to save state and allow a restore before subsequent calls to parse.
   * Not usually called directly, but available for subclasses to save their custom state.
   *
   * This is called in a lazy way. Only commands used in parsing chain will have state saved.
   */
  saveStateBeforeParse(): void;
  /**
   * Restore state before parse for calls after the first.
   * Not usually called directly, but available for subclasses to save their custom state.
   *
   * This is called in a lazy way. Only commands used in parsing chain will have state restored.
   */
  restoreStateBeforeParse(): void;
  /**
   * Parse options from `argv` removing known options,
   * and return argv split into operands and unknown arguments.
   *
   * Side effects: modifies command by storing options. Does not reset state if called again.
   *
   *     argv => operands, unknown
   *     --known kkk op => [op], []
   *     op --known kkk => [op], []
   *     sub --unknown uuu op => [sub], [--unknown uuu op]
   *     sub -- --unknown uuu op => [sub --unknown uuu op], []
   */
  parseOptions(argv: string[]): ParseOptionsResult;
  /**
   * Return an object containing local option values as key-value pairs
   */
  opts<T extends OptionValues>(): T;
  /**
   * Return an object containing merged local and global option values as key-value pairs.
   */
  optsWithGlobals<T extends OptionValues>(): T;
  /**
   * Set the description.
   *
   * @returns `this` command for chaining
   */
  description(str: string): this;
  /** @deprecated since v8, instead use .argument to add command argument with description */
  description(str: string, argsDescription: Record<string, string>): this;
  /**
   * Get the description.
   */
  description(): string;
  /**
   * Set the summary. Used when listed as subcommand of parent.
   *
   * @returns `this` command for chaining
   */
  summary(str: string): this;
  /**
   * Get the summary.
   */
  summary(): string;
  /**
   * Set an alias for the command.
   *
   * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.
   *
   * @returns `this` command for chaining
   */
  alias(alias: string): this;
  /**
   * Get alias for the command.
   */
  alias(): string;
  /**
   * Set aliases for the command.
   *
   * Only the first alias is shown in the auto-generated help.
   *
   * @returns `this` command for chaining
   */
  aliases(aliases: readonly string[]): this;
  /**
   * Get aliases for the command.
   */
  aliases(): string[];
  /**
   * Set the command usage.
   *
   * @returns `this` command for chaining
   */
  usage(str: string): this;
  /**
   * Get the command usage.
   */
  usage(): string;
  /**
   * Set the name of the command.
   *
   * @returns `this` command for chaining
   */
  name(str: string): this;
  /**
   * Get the name of the command.
   */
  name(): string;
  /**
   * Set the name of the command from script filename, such as process.argv[1],
   * or import.meta.filename.
   *
   * (Used internally and public although not documented in README.)
   *
   * @example
   * ```ts
   * program.nameFromFilename(import.meta.filename);
   * ```
   *
   * @returns `this` command for chaining
   */
  nameFromFilename(filename: string): this;
  /**
   * Set the directory for searching for executable subcommands of this command.
   *
   * @example
   * ```ts
   * program.executableDir(import.meta.dirname);
   * // or
   * program.executableDir('subcommands');
   * ```
   *
   * @returns `this` command for chaining
   */
  executableDir(path: string): this;
  /**
   * Get the executable search directory.
   */
  executableDir(): string | null;
  /**
   * Set the help group heading for this subcommand in parent command's help.
   *
   * @returns `this` command for chaining
   */
  helpGroup(heading: string): this;
  /**
   * Get the help group heading for this subcommand in parent command's help.
   */
  helpGroup(): string;
  /**
   * Set the default help group heading for subcommands added to this command.
   * (This does not override a group set directly on the subcommand using .helpGroup().)
   *
   * @example
   * program.commandsGroup('Development Commands:);
   * program.command('watch')...
   * program.command('lint')...
   * ...
   *
   * @returns `this` command for chaining
   */
  commandsGroup(heading: string): this;
  /**
   * Get the default help group heading for subcommands added to this command.
   */
  commandsGroup(): string;
  /**
   * Set the default help group heading for options added to this command.
   * (This does not override a group set directly on the option using .helpGroup().)
   *
   * @example
   * program
   *   .optionsGroup('Development Options:')
   *   .option('-d, --debug', 'output extra debugging')
   *   .option('-p, --profile', 'output profiling information')
   *
   * @returns `this` command for chaining
   */
  optionsGroup(heading: string): this;
  /**
   * Get the default help group heading for options added to this command.
   */
  optionsGroup(): string;
  /**
   * Output help information for this command.
   *
   * Outputs built-in help, and custom text added using `.addHelpText()`.
   *
   */
  outputHelp(context?: HelpContext): void;
  /** @deprecated since v7 */
  outputHelp(cb: (str: string) => string): void;
  /**
   * Return command help documentation.
   */
  helpInformation(context?: HelpContext): string;
  /**
   * You can pass in flags and a description to override the help
   * flags and help description for your command. Pass in false
   * to disable the built-in help option.
   */
  helpOption(flags?: string | boolean, description?: string): this;
  /**
   * Supply your own option to use for the built-in help option.
   * This is an alternative to using helpOption() to customise the flags and description etc.
   */
  addHelpOption(option: Option): this;
  /**
   * Output help information and exit.
   *
   * Outputs built-in help, and custom text added using `.addHelpText()`.
   */
  help(context?: HelpContext): never;
  /** @deprecated since v7 */
  help(cb: (str: string) => string): never;
  /**
   * Add additional text to be displayed with the built-in help.
   *
   * Position is 'before' or 'after' to affect just this command,
   * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.
   */
  addHelpText(position: AddHelpTextPosition, text: string): this;
  addHelpText(position: AddHelpTextPosition, text: (context: AddHelpTextContext) => string): this;
  /**
   * Add a listener (callback) for when events occur. (Implemented using EventEmitter.)
   */
  on(event: string | symbol, listener: (...args: any[]) => void): this;
}
interface CommandOptions {
  hidden?: boolean;
  isDefault?: boolean;
  /** @deprecated since v7, replaced by hidden */
  noHelp?: boolean;
}
interface ExecutableCommandOptions extends CommandOptions {
  executableFile?: string;
}
interface ParseOptionsResult {
  operands: string[];
  unknown: string[];
}
//#endregion
//#region src/cli/program.d.ts
export declare function createProgram(options?: {
  json?: boolean;
}): Command;
//#endregion
//#region src/core/agent/context.d.ts
interface AgentApiClient extends Pick<OpenTagApi, "createAgent" | "listAgents" | "getAgent" | "getAgentConfig" | "updateAgent" | "suspendAgent" | "reactivateAgent" | "rebindAgentComputer" | "deleteAgent" | "listAccountComputers" | "me" | "getAgentImBinding" | "getAgentImBindingConfig" | "createFeishuSetupAttempt" | "getFeishuSetupAttempt" | "cancelFeishuSetupAttempt" | "getImBindingDiagnostics" | "disableImBinding"> {}
interface AgentCommandDependencies {
  accessToken?: string;
  api?: AgentApiClient;
  home?: string;
}
//#endregion
//#region src/core/agent/mutations.d.ts
interface AgentCreateOptions extends AgentCommandDependencies {
  computerId?: string;
  displayName: string;
  instructions?: string;
  instructionsFile?: string;
  maxDurationMs?: number | string;
  model?: string;
  name: string;
  reasoningEffort?: string;
  runtimeProvider: string;
}
interface AgentCreateResult {
  agent: AgentAdminConfig;
  warning?: string;
}
interface AgentBindOptions extends AgentCommandDependencies {
  computerId?: string;
}
interface AgentBindResult {
  agent: AgentAdminConfig;
  warning?: string;
}
interface AgentUpdateOptions extends AgentCommandDependencies {
  clearInstructions?: boolean;
  clearMaxDuration?: boolean;
  clearModel?: boolean;
  clearReasoningEffort?: boolean;
  displayName?: string;
  instructions?: string;
  instructionsFile?: string;
  maxDurationMs?: number | string;
  model?: string;
  reasoningEffort?: string;
}
/**
 * Resolves the Computer an Agent runs on. Having none to select is no longer a failure: an Agent can
 * exist before a Computer does and be bound afterwards. An ambiguous choice still is, because
 * guessing which machine the Account meant would silently place the Agent on the wrong one.
 */
export declare function selectComputer(response: ListAccountComputersResponse, requestedComputerId?: string): AccountComputerSummary | undefined;
export declare function runAgentCreate(options: AgentCreateOptions): Promise<AgentCreateResult>;
export declare function runAgentBind(agentId: string, options: AgentBindOptions): Promise<AgentBindResult>;
export declare function runAgentUpdate(agentId: string, options: AgentUpdateOptions): Promise<AgentAdminConfig>;
export declare function runAgentDelete(agentId: string, options?: AgentCommandDependencies): Promise<string>;
//#endregion
//#region src/core/agent/formatting.d.ts
export declare function formatAgentCreated(result: AgentCreateResult): string;
export declare function formatAgentBound(result: AgentBindResult): string;
export declare function formatAgentList(response: ListAgentsResponse): string;
export declare function formatAgent(agent: AgentAdminConfig): string;
//#endregion
//#region src/core/agent/queries.d.ts
type AgentListOptions = AgentCommandDependencies;
export declare function runAgentList(options?: AgentListOptions): Promise<ListAgentsResponse>;
export declare function runAgentShow(agentId: string, options?: AgentCommandDependencies): Promise<AgentAdminConfig>;
//#endregion
//#region src/core/auth/login.d.ts
/** Reading the Account back is best effort, so a caller may hand in an API that cannot do it. */
type LoginApi = Pick<OpenTagApi, "exchangeConnectCode"> & Partial<Pick<OpenTagApi, "me">>;
interface LoginOptions {
  api?: LoginApi;
  code: string;
  home?: string;
  now?: () => Date;
  serverUrl: string;
  /** Where a best-effort step that did not change the outcome is noted. */
  logger?: Pick<ClientLogger, "warn">;
}
interface LoginResult {
  credentialsPath: string;
  message: string;
}
export declare function runLogin(options: LoginOptions): Promise<LoginResult>;
//#endregion
//#region src/core/channel/config.d.ts
export declare const channelConfig: ChannelConfig;
//#endregion
//#region src/core/command/context.d.ts
type CommandContextAuthOptions = {
  accessToken?: string;
  api?: OpenTagApi;
  requireAuth?: boolean;
};
type CommandContextLocationOptions = {
  environment?: NodeJS.ProcessEnv;
  home?: string;
  serverUrl?: string;
};
type CommandContextOptions = CommandContextAuthOptions & CommandContextLocationOptions;
type CommandContextIdentityAccess = {
  readonly accessToken?: string;
  readonly api?: OpenTagApi;
};
type CommandContextIdentity = CommandContextIdentityAccess & {
  readonly credentials?: StoredCredentials;
};
type CommandContextLocation = {
  readonly environment: NodeJS.ProcessEnv;
  readonly home: string;
};
type CommandContext = CommandContextIdentity & CommandContextLocation;
/** Resolve home, credentials, token, and API from one detached command context. */
export declare function resolveCommandContext(options?: CommandContextOptions): Promise<CommandContext>;
//#endregion
//#region src/core/command/environment.d.ts
/** Build a detached child-process environment without changing the parent process. */
export declare function buildChildEnvironment(baseEnvironment: NodeJS.ProcessEnv, options?: {
  keys?: readonly string[];
  overrides?: NodeJS.ProcessEnv;
}): NodeJS.ProcessEnv;
//#endregion
//#region src/core/computer/formatting.d.ts
export declare function formatComputerList(response: ListAccountComputersResponse): string;
//#endregion
//#region src/core/computer/queries.d.ts
export declare function listComputers(home?: string): Promise<ListAccountComputersResponse>;
//#endregion
//#region src/core/daemon/service/types.d.ts
type DaemonServiceState = "active" | "inactive" | "not-installed" | "unknown";
type DaemonServicePlatform = "launchd" | "systemd" | "unsupported";
interface RuntimeOwnerInfo {
  consistency: "consistent" | "malformed" | "missing" | "stale" | "unmanaged" | "unverified";
  pid?: number;
}
interface DaemonServiceInfo {
  configuredHome?: string;
  currentHome: string;
  definitionPath: string;
  detail?: string;
  drifted?: boolean;
  logHint: string;
  pid?: number;
  platform: DaemonServicePlatform;
  runtimeOwner?: RuntimeOwnerInfo;
  serviceId: string;
  state: DaemonServiceState;
}
//#endregion
//#region src/core/diagnostics/doctor.d.ts
type DoctorCheckStatus = "pass" | "fail" | "unknown" | "info" | "skipped";
type DoctorCheckScope = "target" | "local-configuration" | "daemon-service" | "server" | "agent-runtime" | "provider-cli";
interface DoctorCheck {
  code: string;
  scope: DoctorCheckScope;
  status: DoctorCheckStatus;
  blocking: boolean;
  label: string;
  detail: string;
  observedFrom?: string;
  path?: string;
  remediation?: string;
  command?: string;
}
interface DoctorNextAction {
  checkCode: string;
  command: string;
  reason: string;
}
interface DoctorTarget {
  home: string;
  homeSource: "environment" | "channel-default";
  cliVersion: string;
  channel: string;
  platform: NodeJS.Platform;
  arch: string;
  nodeVersion: string;
}
interface DoctorReport {
  target: DoctorTarget;
  checks: DoctorCheck[];
  nextActions: DoctorNextAction[];
  providerCliSetup: "ready" | "needs_attention" | "unknown";
  notEvaluated: readonly string[];
  exitCode: 0 | 1;
}
interface DoctorResult extends DoctorReport {
  message: string;
}
type HealthChecker = (serverUrl: string) => Promise<ServerHealth>;
type LocalConfigurationInspector = (home: string) => Promise<LocalComputerConfigurationInspection>;
type DaemonServiceInspector = (home: string) => Promise<DaemonServiceInfo>;
type RuntimeDetector = (options: {
  environment: NodeJS.ProcessEnv;
  platform: NodeJS.Platform;
}) => Promise<AgentRuntimeCliInstallation[]>;
type IntegrationCliDetector = (options: {
  environment: NodeJS.ProcessEnv;
  platform: NodeJS.Platform;
}) => Promise<IntegrationCliInstallation[]>;
interface DoctorOptions {
  env?: NodeJS.ProcessEnv;
  platform?: NodeJS.Platform;
  arch?: string;
  nodeVersion?: string;
  cliVersion?: string;
  channel?: string;
  healthChecker?: HealthChecker;
  inspectLocalConfiguration?: LocalConfigurationInspector;
  inspectDaemonService?: DaemonServiceInspector;
  runtimeDetector?: RuntimeDetector;
  integrationCliDetector?: IntegrationCliDetector;
}
export declare function runDoctor(options?: DoctorOptions): Promise<DoctorResult>;
//#endregion
//#region src/core/provider-cli/shared.d.ts
interface ProviderCliNextAction {
  readonly provider: ProviderCliProvider | "all";
  readonly command: string;
  readonly reason: string;
}
interface ProviderCliCommandDeps {
  /** OS account home override; tests inject an isolated account root. */
  readonly accountHome?: string;
  /** Invoking-process environment override (PATH authority for detection). */
  readonly env?: NodeJS.ProcessEnv;
  readonly platform?: NodeJS.Platform;
  readonly arch?: string;
  readonly catalog?: readonly ProviderCliCatalogEntry[];
  readonly fetcher?: ProviderCliFetcher;
  readonly execFile?: ProviderCliExecFile;
  /** Test-only hook: runs inside the provider lock before the winner is persisted. */
  readonly beforeWinnerReverify?: (winner: ProviderCliCandidate) => Promise<void>;
  /** Test-only hook: replaces the cross-process lock retry wait. */
  readonly sleep?: (ms: number) => Promise<void>;
  readonly stdout?: (chunk: string) => void;
  readonly stderr?: (chunk: string) => void;
}
//#endregion
//#region src/core/provider-cli/ensure.d.ts
/**
 * Reusable orchestration for `opentag provider-cli ensure`.
 *
 * Human mode prints bounded single-line phase updates and never prompts, with or
 * without a TTY. `--json` mode writes one common command envelope and suppresses phase lines.
 */
interface ProviderCliEnsureCommandOptions extends ProviderCliCommandDeps {
  readonly provider: string;
  /** Observe real foreground phases when a parent command owns final presentation. */
  readonly onPhase?: (event: ProviderCliPhaseEvent) => void;
  readonly managedOnly?: boolean;
  /** `--no-path-update` passes false. */
  readonly pathUpdate?: boolean;
  readonly dryRun?: boolean;
  readonly json?: boolean;
}
interface ProviderCliEnsureCommandResult {
  readonly exitCode: CommandExitCode;
  readonly results: readonly ProviderCliEnsureResult[];
  readonly nextActions: readonly ProviderCliNextAction[];
}
export declare function runProviderCliEnsure(options: ProviderCliEnsureCommandOptions): Promise<ProviderCliEnsureCommandResult>;
//#endregion
//#region src/core/provider-cli/inspect.d.ts
/**
 * Reusable orchestration for `opentag provider-cli inspect`: read-only diagnostics for
 * the selected Provider CLI. `--json` emits one common command envelope.
 */
interface ProviderCliInspectCommandOptions extends ProviderCliCommandDeps {
  readonly provider: string;
  readonly json?: boolean;
}
interface ProviderCliInspectCommandResult {
  readonly exitCode: CommandExitCode;
  readonly results: readonly ProviderCliInspection[];
  readonly nextActions: readonly ProviderCliNextAction[];
}
export declare function runProviderCliInspect(options: ProviderCliInspectCommandOptions): Promise<ProviderCliInspectCommandResult>;
//#endregion
//#region src/core/session/index.d.ts
interface SessionMessageOptions {
  message?: string;
  messageFile?: string;
  messageId?: string;
}
export declare function runSessionCreate(options: SessionMessageOptions & {
  model?: string;
  reasoningEffort?: string;
  maxDurationMs?: number;
}): Promise<SessionCliCommandResponse>;
export declare function runSessionSend(targetSessionId: string, options: SessionMessageOptions): Promise<SessionCliCommandResponse>;
export declare function runSessionList(options: {
  recursive?: boolean;
  limit?: number;
  cursor?: string;
  since?: string;
}): Promise<SessionCliListResponse>;
export declare function formatSessionCommandResult(result: SessionCliCommandResponse): string;
export declare function formatSessionList(result: SessionCliListResponse): string;
//#endregion
//#region src/index.d.ts
export declare const CommandError: typeof CommandError$1;
export declare const commandExitCode: typeof commandExitCode$1;
export declare const EXIT_CODES: {
  readonly success: 0;
  readonly failure: 1;
  readonly usage: 2;
  readonly serviceUnavailable: 3;
  readonly interrupted: 130;
};
export declare const executeCommand: typeof executeCommand$1;
export declare const presentCommand: typeof presentCommand$1;
export declare const toCommandError: typeof toCommandError$1;
//#endregion
export type { CommandResult, DoctorNextAction, DoctorOptions, DoctorResult, LoginOptions, LoginResult, ProviderCliEnsureCommandOptions, ProviderCliEnsureCommandResult, ProviderCliInspectCommandOptions, ProviderCliInspectCommandResult, ProviderCliNextAction };
//# sourceMappingURL=index.d.mts.map