@mark1russell7/strategy-space 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +49 -2
- package/build/claim.d.ts +10 -0
- package/build/claim.d.ts.map +1 -0
- package/build/distinct.d.ts +49 -0
- package/build/distinct.d.ts.map +1 -0
- package/build/distinct.js +61 -0
- package/build/distinct.js.map +1 -0
- package/build/index.d.ts +5 -0
- package/build/index.js +4 -0
- package/build/space-walk.js +48 -0
- package/build/space-walk.js.map +1 -0
- package/build/strategy-options.d.ts +189 -0
- package/build/strategy-options.d.ts.map +1 -0
- package/build/strategy-options.js +211 -0
- package/build/strategy-options.js.map +1 -0
- package/build/strategy-space.d.ts +251 -0
- package/build/strategy-space.d.ts.map +1 -0
- package/build/strategy-space.js +1029 -0
- package/build/strategy-space.js.map +1 -0
- package/package.json +60 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strategy-space.js","names":[],"sources":["../src/strategy-space.ts"],"sourcesContent":["// The strategy space of an engine (`docs/STRATEGY-SPACE.md`): its stages, their options and the ranges of their params, as data.\nimport { canonicalJson, fnv1a32, mulberry32, sha256Hex } from \"@mark1russell7/rigor-generators\";\nimport type { ClaimBreak } from \"./claim.ts\";\nimport { holds, walkPlan, walkPoint } from \"./space-walk.ts\";\n\n/** The schema of a strategy space. */\nexport const STRATEGY_SPACE_SCHEMA = \"strategy-space/1\";\n\n/**\n * This function gives the generator of one step of a seeded draw: `mulberry32` of the `fnv1a32` hash of `\"<seed>:<step>\"`.\n * The hash reads the WTF-8 bytes, so a lone surrogate in a name gives the same stream as `stepRandom` of `layout-contract`.\n */\nconst stepRandom = (seed: number, step: string): (() => number) => mulberry32(fnv1a32(`${seed}:${step}`, { input: \"wtf8\" }));\n\n/** The kind of a param: a whole number, a real number, one value of a list, or `true` and `false`. */\nexport type ParamKind = \"int\" | \"real\" | \"enum\" | \"bool\";\n\n/** The value of one param in a config. */\nexport type ParamValue = number | string | boolean;\n\n/** The condition of a conditional param: the param is active only when an earlier param of the same option has one of the values `in`. */\nexport interface ParamWhen {\n /** The name of an earlier param of the same option. */\n readonly param: string;\n /** The values of that param that make this param active. */\n readonly in: readonly ParamValue[];\n}\n\n/** One param of a stage option, with its range. */\nexport interface SpaceParam {\n readonly name: string;\n readonly kind: ParamKind;\n /** The smallest value of an `int` or `real` param. */\n readonly min?: number;\n /** The largest value of an `int` or `real` param. */\n readonly max?: number;\n /** The step of the values from `min`. An `int` param has the step 1 by default. */\n readonly step?: number;\n /** The scale of the grid and of the samples. The scale `log` needs a `min` above 0. The default is `linear`. */\n readonly scale?: \"linear\" | \"log\";\n /** The values of an `enum` param. */\n readonly values?: readonly (string | number)[];\n /** The value that a config gets when it does not set the param. */\n readonly default: ParamValue;\n /** Without `when`, the param is active each time its option is chosen. */\n readonly when?: ParamWhen;\n}\n\n/**\n * The rule of the members of a meta option: a count from `min` to `max`. Members with `ordered: false` are sorted by their `configId`.\n * With `min` and `max` 0, the option chooses its members from the input, so a config lists none. This form has no `pool` and no `view`.\n */\nexport interface MemberRule {\n readonly min: number;\n readonly max: number;\n readonly ordered: boolean;\n /**\n * The member lists that the option permits. Each entry is a list of whole configs of the space of the members.\n * Without `pool`, each list of base configs with a good count is a member list.\n * With `pool`, a config of the option has the members of one entry, and `spaceSize` counts each entry one time.\n */\n readonly pool?: readonly (readonly StrategyConfig[])[];\n /**\n * The view of the items that the members get. With `bounds`, the option gives its members the bounding box of each item.\n * Then a shape filter checks the members with the kind `rect`, and the option itself with the kinds of the input. Without `view`, the members get the kinds of the input.\n */\n readonly view?: \"bounds\";\n}\n\n/** The inputs that an option supports. A missing field supports each value. */\nexport interface OptionSupports {\n /** The shape kinds of the boxes, as tags (for example `rect` or `circle`). Without it, the option supports each kind. */\n readonly shape?: readonly string[];\n}\n\n/** One implementation of a stage. An option with `members` is a meta option: it chooses between whole configs, or wraps them. */\nexport interface StageOption {\n readonly id: string;\n readonly params: readonly SpaceParam[];\n readonly members?: MemberRule;\n /** The inputs that the option supports. It describes the option, so it is not part of a config or of its id. */\n readonly supports?: OptionSupports;\n}\n\n/** The known shape kinds of a check. Without `kinds`, each string that is not empty is a shape kind. */\nexport interface KindOptions {\n /** The list of the known shape kinds, for example `SHAPE_KIND_IDS` of `layout-contract`. A kind that is not in the list is a problem. */\n readonly kinds?: readonly string[];\n}\n\n/** The shape kinds of the inputs of a check, a count or an enumeration. Without `shapes`, each option counts. */\nexport interface ShapeFilter extends KindOptions {\n /** The shape kinds of the input. Only the options that support each of these kinds count. */\n readonly shapes?: readonly string[];\n}\n\n/** One stage of the pipeline of an engine. A config of an `optional` stage can have no option. */\nexport interface SpaceStage {\n readonly name: string;\n readonly options: readonly StageOption[];\n readonly optional?: boolean;\n}\n\n/** A reference to one option of a stage. The option `null` refers to an optional stage that a config does not use. */\nexport interface OptionRef {\n readonly stage: string;\n readonly option: string | null;\n}\n\n/** A rule that keeps out invalid combinations. A config with the option `if` also has the option `then`, or does not have the option `then.not`. */\nexport interface SpaceConstraint {\n readonly if: OptionRef;\n readonly then: OptionRef | { readonly not: OptionRef };\n}\n\n/** The strategy space of an engine: the stages, the constraints and the named configs. `docs/STRATEGY-SPACE.md` tells the rules. */\nexport interface StrategySpace {\n readonly schema: typeof STRATEGY_SPACE_SCHEMA;\n /** The name of the space. A config names the space with this value. */\n readonly engine: string;\n /** The version of the space. It is not part of a config or of its id. A record writes it. */\n readonly version: string;\n readonly stages: readonly SpaceStage[];\n readonly constraints?: readonly SpaceConstraint[];\n /** The named strategies of the engine, as points of the space. Old records stay comparable through them. */\n readonly named?: Readonly<Record<string, StrategyConfig>>;\n /** The spaces of a product space, from `productSpace`. A meta option of a part takes members of that part. */\n readonly parts?: readonly StrategySpace[];\n}\n\n/** The choice of one stage in a config: an option, its params and, for a meta option, its members. */\nexport interface StageChoice {\n readonly option: string;\n /** The values of the active params. A param that is not set gets its default. */\n readonly params?: Readonly<Record<string, ParamValue>>;\n /** The members of a meta option: configs of the same space, with no meta option. */\n readonly members?: readonly StrategyConfig[];\n}\n\n/** One point of a strategy space. The value `null` of a stage tells that the config does not use the optional stage. */\nexport interface StrategyConfig {\n /** The `engine` of the space, without its version. */\n readonly space: string;\n readonly stages: Readonly<Record<string, StageChoice | null>>;\n}\n\n/** The count of the grid points of a space. */\nexport interface SpaceSize {\n /** The count of the configs without a meta option. */\n readonly base: bigint;\n /** The count of the configs with a meta option. The value is `null` when the count is more than `maxMeta`. */\n readonly meta: bigint | null;\n}\n\n/** The options of `spaceSize`. */\nexport interface SpaceSizeOptions extends ShapeFilter {\n /** The count of the levels of each numeric param, a whole number of 1 or more. */\n readonly levels: number;\n /** The largest meta count that `spaceSize` gives. The default is `10n ** 18n`. */\n readonly maxMeta?: bigint;\n}\n\n/** The options of a grid. The grid gives only the configs without a meta option. */\nexport interface GridOptions extends ShapeFilter {\n readonly mode: \"grid\";\n readonly levels: number;\n /** The largest count of configs. A larger grid causes a `RangeError`. The default is 100000. */\n readonly limit?: number;\n}\n\n/** The options of a sample. */\nexport interface SampleOptions extends ShapeFilter {\n readonly mode: \"sample\";\n /** The count of the configs, a whole number of 0 or more. */\n readonly n: number;\n readonly seed: number;\n /** With `skip` (the default), the sample has no meta option. With `sample`, a meta option draws its members from base samples, or one entry of its `pool`. */\n readonly meta?: \"skip\" | \"sample\";\n /** The largest count of option draws. The default is the larger value of 1000 and `100 * n`. */\n readonly maxTries?: number;\n /**\n * How a point keeps the constraints. With `reject` (the default), a point that breaks a constraint draws again.\n * With `walk`, a point draws its stages from the largest to the smallest. Each stage draws only from the options that keep the constraints with the stages before it.\n * The stages of `fixed` draw before the other stages.\n * A space whose constraints reject most draws gets its sample with `walk`. The two values give different configs for one seed.\n * A sample of `walk` is not uniform over the valid configs. Each option of the largest stage gets an equal share, whatever count of valid configs it has.\n * Thus a mean over this sample is not a mean of the space.\n */\n readonly draw?: \"reject\" | \"walk\";\n /**\n * The options that each config of the sample has. A key is the name of a stage, and its value is the id of one option of that stage. The other stages draw as before.\n * A stage of a product space has the name of its part before its own name, for example `pack.placement`.\n * A fixed meta option needs `meta: \"sample\"`. A meta option of another stage of the same part goes out, because such an option replaces the fixed stage.\n * A fixed option that the shape filter removes, or that the constraints forbid, gets a `RangeError` with the reason.\n */\n readonly fixed?: Readonly<Record<string, string>>;\n}\n\n/** The options of `enumerateSpace`. */\nexport type EnumerateOptions = GridOptions | SampleOptions;\n\ntype Problem = readonly [claim: string, detail: string];\ntype Choices = ReadonlyMap<string, StageOption | null>;\ntype Values = Record<string, ParamValue>;\n\nconst isObject = (value: unknown): value is Record<string, unknown> => value !== null && typeof value === \"object\" && !Array.isArray(value);\nconst show = (value: unknown): string => (typeof value === \"string\" ? `\"${value}\"` : String(value));\nconst isNumeric = (p: SpaceParam): boolean => p.kind === \"int\" || p.kind === \"real\";\nconst zero = (v: number): number => (v === 0 ? 0 : v);\n\n/** This function gives the stable form of a real number: 12 significant digits, with `-0` as `0`. */\nconst realForm = (v: number, digits = 12): number => zero(Number(v.toPrecision(digits)));\n\n/** This function gives the stable form of a value of a param. */\nfunction normalize(p: SpaceParam, v: ParamValue): ParamValue {\n if (typeof v !== \"number\") return v;\n if (p.kind !== \"real\") return zero(v);\n return Math.min(p.max ?? Infinity, Math.max(p.min ?? -Infinity, realForm(v)));\n}\n\n/** This function tells if a value is on the step of a param. */\nfunction onStep(p: SpaceParam, v: number): boolean {\n if (p.step === undefined || p.min === undefined) return true;\n const q = (v - p.min) / p.step;\n return Math.abs(q - Math.round(q)) <= 1e-9 * Math.max(1, Math.abs(q));\n}\n\n/** This function gives the problem of a value of a param, or `undefined` for a value in the range. */\nfunction valueProblem(p: SpaceParam, v: unknown): string | undefined {\n if (p.kind === \"bool\") return typeof v === \"boolean\" ? undefined : `${show(v)} is not true or false`;\n if (p.kind === \"enum\") return (p.values ?? []).some((x) => x === v) ? undefined : `${show(v)} is not one of ${(p.values ?? []).map(show).join(\", \")}`;\n if (typeof v !== \"number\" || !Number.isFinite(v)) return `${show(v)} is not a finite number`;\n if (p.kind === \"int\" && !Number.isInteger(v)) return `${v} is not a whole number`;\n if (p.min !== undefined && v < p.min) return `${v} is less than the min ${p.min}`;\n if (p.max !== undefined && v > p.max) return `${v} is more than the max ${p.max}`;\n if (!onStep(p, v)) return `${v} is not on the step ${p.step} from ${p.min}`;\n return undefined;\n}\n\n/** This function tells if a param is active for the values of the earlier params. */\nfunction isActive(p: SpaceParam, values: Values): boolean {\n if (p.when === undefined) return true;\n if (!Object.hasOwn(values, p.when.param)) return false;\n const v = values[p.when.param];\n return p.when.in.some((x) => x === v);\n}\n\n/** This function gives the problem of a value of a param, or `undefined` for a value in its range. The corpus dimensions of `families.ts` use it. */\nexport function paramProblem(param: SpaceParam, value: unknown): string | undefined {\n return valueProblem(param, value);\n}\n\n/** This function tells if a param is active for the values of the earlier params. A param without `when` is always active. */\nexport function paramActive(param: SpaceParam, values: Readonly<Record<string, ParamValue>>): boolean {\n return isActive(param, values);\n}\n\n/** This function gives the stable form of a value of a param: a real number gets 12 significant digits, and `-0` becomes `0`. */\nexport function paramValue(param: SpaceParam, value: ParamValue): ParamValue {\n return normalize(param, value);\n}\n\n/** This function gives the part of a space that has a stage, and the prefix of the names of its stages. */\nfunction partOf(space: StrategySpace, stage: string): { readonly space: StrategySpace; readonly prefix: string } {\n for (const part of space.parts ?? []) {\n const head = `${part.engine}.`;\n if (stage.startsWith(head)) {\n const inner = partOf(part, stage.slice(head.length));\n return { space: inner.space, prefix: head + inner.prefix };\n }\n }\n return { space, prefix: \"\" };\n}\n\n/** This function gives the prefix of the innermost part of each stage. */\nconst prefixes = (space: StrategySpace): Map<string, string> => new Map(space.stages.map((s) => [s.name, partOf(space, s.name).prefix]));\n\nconst describe = (c: SpaceConstraint): string => {\n const ref = (r: OptionRef): string => `${r.stage}=${r.option ?? \"null\"}`;\n return \"not\" in c.then ? `if ${ref(c.if)} then not ${ref(c.then.not)}` : `if ${ref(c.if)} then ${ref(c.then)}`;\n};\n\n/** This function gives the problems of the range and the default of one param. */\nfunction paramProblems(p: SpaceParam, at: string): Problem[] {\n const out: Problem[] = [];\n if (isNumeric(p)) {\n const { min, max, step } = p;\n if (typeof min !== \"number\" || typeof max !== \"number\" || !Number.isFinite(min) || !Number.isFinite(max)) {\n out.push([\"range\", `${at} has no finite min and max`]);\n return out;\n }\n if (min > max) out.push([\"range\", `${at} has an empty range: the min ${min} is more than the max ${max}`]);\n if (p.kind === \"int\" && (!Number.isInteger(min) || !Number.isInteger(max))) out.push([\"range\", `${at} is an int with a min or a max that is not whole`]);\n if (step !== undefined && (!Number.isFinite(step) || step <= 0 || (p.kind === \"int\" && !Number.isInteger(step))))\n out.push([\"range\", `${at} has the step ${step}, which is not a ${p.kind === \"int\" ? \"whole \" : \"\"}number above 0`]);\n if (p.scale === \"log\" && min <= 0) out.push([\"scale\", `${at} has the scale log with the min ${min}, which is not above 0`]);\n } else {\n if (p.scale !== undefined) out.push([\"scale\", `${at} is a ${p.kind} param with a scale`]);\n if (p.kind === \"enum\") {\n if (!Array.isArray(p.values) || p.values.length === 0) out.push([\"values\", `${at} is an enum without values`]);\n else {\n const seen = new Set<unknown>();\n for (const v of p.values) {\n if (seen.has(v)) out.push([\"duplicate\", `${at} has the value ${show(v)} two times`]);\n seen.add(v);\n }\n }\n }\n }\n if (out.length === 0) {\n const problem = valueProblem(p, p.default);\n if (problem !== undefined) out.push([\"default\", `the default of ${at} is not in its range: ${problem}`]);\n }\n return out;\n}\n\n/** This function tells why a value is not a known shape kind, or gives `undefined` for a good kind. */\nfunction kindProblem(k: unknown, kinds: readonly string[] | undefined): string | undefined {\n if (typeof k !== \"string\" || k === \"\") return \"is not a string with text\";\n if (kinds !== undefined && !kinds.includes(k)) return `is not one of ${kinds.join(\", \")}`;\n return undefined;\n}\n\n/** This function gives the problems of one stage option. */\nfunction optionProblems(stage: SpaceStage, o: StageOption, kinds: readonly string[] | undefined): Problem[] {\n const out: Problem[] = [];\n const at = `the option ${stage.name}.${o.id}`;\n if (!Array.isArray(o.params)) return [[\"config\", `${at} has no list of params`]];\n const names = o.params.map((p) => p.name);\n o.params.forEach((p, i) => {\n const pat = `the param ${stage.name}.${o.id}.${p.name}`;\n if (names.indexOf(p.name) !== i) out.push([\"duplicate\", `${at} has the param ${p.name} two times`]);\n out.push(...paramProblems(p, pat));\n if (p.when === undefined) return;\n const j = names.indexOf(p.when.param);\n if (j < 0) out.push([\"unknown\", `${pat} has a when with the unknown param ${p.when.param}`]);\n else if (j >= i) out.push([\"when\", `${pat} has a when with the param ${p.when.param}, which does not come before it`]);\n else if (!Array.isArray(p.when.in) || p.when.in.length === 0) out.push([\"when\", `${pat} has a when with no values`]);\n else for (const v of p.when.in) {\n const problem = valueProblem(o.params[j]!, v);\n if (problem !== undefined) out.push([\"when\", `${pat} has a when value that is not a value of ${p.when.param}: ${problem}`]);\n }\n });\n if (o.supports !== undefined) out.push(...supportsProblems(o.supports, at, kinds));\n if (o.members !== undefined) {\n const { min, max, ordered } = o.members;\n const noList = min === 0 && max === 0;\n if (!Number.isInteger(min) || !Number.isInteger(max) || (!noList && (min < 1 || min > max)) || typeof ordered !== \"boolean\")\n out.push([\"members\", `${at} has a member rule without whole counts 1 <= min <= max or min = max = 0, and a boolean ordered`]);\n if (noList && (o.members.pool !== undefined || o.members.view !== undefined))\n out.push([\"members\", `${at} has no member list, so its member rule cannot have a pool or a view`]);\n const pool: unknown = o.members.pool;\n if (pool !== undefined && (!Array.isArray(pool) || pool.length === 0 || !pool.every((entry: unknown) => Array.isArray(entry))))\n out.push([\"pool\", `${at} has a pool that is not a list of one or more member lists`]);\n const view: unknown = o.members.view;\n if (view !== undefined && view !== \"bounds\") out.push([\"view\", `${at} has the member view ${show(view)}, not \"bounds\"`]);\n }\n return out;\n}\n\n/** This function gives the problems of the `supports` of an option. */\nfunction supportsProblems(supports: unknown, at: string, kinds: readonly string[] | undefined): Problem[] {\n if (!isObject(supports)) return [[\"shape\", `the supports of ${at} are not an object`]];\n const shape = supports[\"shape\"];\n if (shape === undefined) return [];\n if (!Array.isArray(shape) || shape.length === 0) return [[\"shape\", `${at} supports no shape kind. Remove shape to support each kind`]];\n const out: Problem[] = [];\n shape.forEach((k: unknown, i) => {\n const problem = kindProblem(k, kinds);\n if (problem !== undefined) out.push([\"shape\", `${at} supports the shape kind ${show(k)}, which ${problem}`]);\n else if (shape.indexOf(k) !== i) out.push([\"duplicate\", `${at} has the shape kind ${k} two times`]);\n });\n return out;\n}\n\n/** This function tells if an option supports each shape kind of the list. */\nconst supportsShapes = (o: StageOption, shapes: readonly string[] | undefined): boolean =>\n shapes === undefined || o.supports?.shape === undefined || shapes.every((k) => o.supports!.shape!.includes(k));\n\n/** The shape kinds that the members of an option with `view: \"bounds\"` see: a bounding box is a `rect`. */\nconst BOUNDS_VIEW: readonly string[] = /* @__PURE__ */ Object.freeze([\"rect\"] as const);\n\n/**\n * This function gives the shape kinds of the members of a meta option. With `view: \"bounds\"`, a list with a kind becomes `BOUNDS_VIEW`.\n * Without a list, or with an empty list, the value does not change.\n */\nconst memberShapes = (rule: MemberRule, shapes: readonly string[] | undefined): readonly string[] | undefined =>\n rule.view === \"bounds\" && shapes !== undefined && shapes.length > 0 ? BOUNDS_VIEW : shapes;\n\n/** This function tells if two lists have the same shape kinds. */\nconst sameKinds = (a: readonly string[], b: readonly string[]): boolean => a.every((k) => b.includes(k)) && b.every((k) => a.includes(k));\n\n/** This function gives the problems of the params of one stage choice. */\nfunction choiceParamProblems(o: StageOption, params: unknown, at: string): Problem[] {\n if (params !== undefined && !isObject(params)) return [[\"config\", `the params of ${at} are not an object`]];\n const given = (params ?? {}) as Values;\n const out: Problem[] = [];\n for (const key of Object.keys(given)) if (!o.params.some((p) => p.name === key)) out.push([\"unknown\", `${at} has the unknown param ${key}`]);\n const values: Values = {};\n for (const p of o.params) {\n const has = Object.hasOwn(given, p.name);\n if (!isActive(p, values)) {\n if (has) out.push([\"inactive\", `${at} sets the param ${p.name}, which is not active`]);\n continue;\n }\n const v = has ? given[p.name] : p.default;\n const problem = valueProblem(p, v);\n if (problem !== undefined) out.push([\"param\", `the param ${p.name} of ${at} is not in its range: ${problem}`]);\n else values[p.name] = normalize(p, v as ParamValue);\n }\n return out;\n}\n\n/** This function gives the problems of a config of a space. A member of a meta option has `member: true`. */\nfunction configProblems(space: StrategySpace, config: unknown, member: boolean, shapes?: readonly string[]): Problem[] {\n if (!isObject(config) || !isObject(config[\"stages\"])) return [[\"config\", \"the config is not an object with stages\"]];\n const out: Problem[] = [];\n const stages = config[\"stages\"];\n if (config[\"space\"] !== space.engine) out.push([\"space\", `the space of the config is ${show(config[\"space\"])}, not ${show(space.engine)}`]);\n for (const key of Object.keys(stages)) if (!space.stages.some((s) => s.name === key)) out.push([\"unknown\", `the config has the unknown stage ${key}`]);\n const optionOf = (s: SpaceStage): StageOption | undefined => {\n const c = stages[s.name];\n return isObject(c) ? s.options.find((o) => o.id === c[\"option\"]) : undefined;\n };\n const prefix = prefixes(space);\n const metaStage = new Map<string, string>();\n for (const s of space.stages) {\n if (optionOf(s)?.members === undefined) continue;\n const p = prefix.get(s.name)!;\n if (metaStage.has(p)) out.push([\"meta\", `the stages ${metaStage.get(p)} and ${s.name} both have a meta option`]);\n else metaStage.set(p, s.name);\n }\n const chosen = new Map<string, string | null>();\n for (const s of space.stages) {\n const c = Object.hasOwn(stages, s.name) ? stages[s.name] : undefined;\n const meta = metaStage.get(prefix.get(s.name)!);\n chosen.set(s.name, null);\n if (c === undefined || c === null) {\n if (!s.optional && meta === undefined) out.push([\"missing\", `the config has no option for the stage ${s.name}`]);\n continue;\n }\n if (!isObject(c) || typeof c[\"option\"] !== \"string\") {\n out.push([\"config\", `the choice of the stage ${s.name} has no option`]);\n continue;\n }\n const o = s.options.find((x) => x.id === c[\"option\"]);\n if (o === undefined) {\n out.push([\"unknown\", `the stage ${s.name} has no option ${c[\"option\"]}`]);\n continue;\n }\n chosen.set(s.name, o.id);\n const at = `the option ${s.name}.${o.id}`;\n if (!supportsShapes(o, shapes)) {\n const missing = shapes!.filter((k) => !o.supports!.shape!.includes(k));\n out.push([\"shape\", `${at} supports the shape kinds ${o.supports!.shape!.join(\", \")}, not ${missing.join(\", \")}`]);\n }\n if (meta !== undefined && meta !== s.name) out.push([\"meta\", `the stage ${s.name} is set, but the meta option of ${meta} replaces the other stages of its part`]);\n out.push(...choiceParamProblems(o, c[\"params\"], at));\n if (o.members === undefined) {\n if (c[\"members\"] !== undefined) out.push([\"members\", `${at} is not a meta option, but the config gives members`]);\n continue;\n }\n if (member) {\n out.push([\"depth\", `a member has the meta option ${s.name}.${o.id}. The depth of a meta config is 1`]);\n continue;\n }\n out.push(...memberProblems(partOf(space, s.name).space, o.members, c[\"members\"], at, memberShapes(o.members, shapes)));\n }\n for (const c of space.constraints ?? []) if (!holds(c, chosen)) out.push([\"constraint\", `the config breaks the constraint ${describe(c)}`]);\n return out;\n}\n\n/** This function gives the problems of the members of a meta option. `part` is the space of the members. */\nfunction memberProblems(part: StrategySpace, rule: MemberRule, members: unknown, at: string, shapes?: readonly string[]): Problem[] {\n if (!Array.isArray(members)) return [[\"members\", `${at} is a meta option without a list of members`]];\n const out: Problem[] = [];\n if (members.length < rule.min || members.length > rule.max) out.push([\"members\", `${at} has ${members.length} members, not ${rule.min} to ${rule.max}`]);\n const ids = new Map<string, number>();\n members.forEach((m: unknown, k) => {\n const inner = configProblems(part, m, true, shapes);\n for (const [claim, detail] of inner) out.push([claim, `the member ${k} of ${at}: ${detail}`]);\n if (inner.length > 0) return;\n const id = idOf(canonicalOf(part, m as StrategyConfig, true));\n if (ids.has(id)) out.push([\"duplicate\", `the members ${ids.get(id)} and ${k} of ${at} are the same config ${id}`]);\n else ids.set(id, k);\n });\n if (rule.pool !== undefined && out.length === 0) {\n const key = memberKey(part, rule, members as readonly StrategyConfig[]);\n if (!rule.pool.some((entry) => memberKey(part, rule, entry) === key))\n out.push([\"pool\", `${at} has a member list that is not in its pool of ${rule.pool.length} ${rule.pool.length === 1 ? \"list\" : \"lists\"}`]);\n }\n return out;\n}\n\n/** This function gives the key of a good member list: the `configId` of each member, sorted when the rule is not ordered. */\nfunction memberKey(part: StrategySpace, rule: MemberRule, members: readonly StrategyConfig[]): string {\n const ids = members.map((m) => idOf(canonicalOf(part, m, true)));\n if (!rule.ordered) ids.sort();\n return ids.join(\",\");\n}\n\n/** This function gives the problems of the pool of a meta option of a good space. `part` is the space of the members. */\nfunction poolProblems(part: StrategySpace, rule: MemberRule, at: string): Problem[] {\n const out: Problem[] = [];\n const keys = new Map<string, number>();\n const plain: MemberRule = { min: rule.min, max: rule.max, ordered: rule.ordered };\n (rule.pool ?? []).forEach((entry, j) => {\n const inner = memberProblems(part, plain, entry, `the pool entry ${j} of ${at}`);\n out.push(...inner);\n if (inner.length > 0) return;\n const key = memberKey(part, rule, entry);\n if (keys.has(key)) out.push([\"duplicate\", `the pool entries ${keys.get(key)} and ${j} of ${at} have the same members`]);\n else keys.set(key, j);\n });\n return out;\n}\n\n/** This function tells if a member list fits a space: each member is a good config of the space. A shape filter removes options from the space. */\nconst fits = (part: StrategySpace, entry: readonly StrategyConfig[]): boolean => entry.every((m) => configProblems(part, m, true).length === 0);\n\nconst toBreaks = (problems: readonly Problem[], inputs: readonly string[] = []): ClaimBreak[] => problems.map(([claim, detail]) => ({ claim, detail, inputs }));\n\n/**\n * This function checks one config of a space. It gives one break for each problem. An empty list tells that the config is good.\n * The `claim` of a break is the kind of the problem, for example `missing`, `unknown`, `inactive`, `param`, `constraint`, `members` or `depth`.\n *\n * A member list that is not an entry of the `pool` of its option gives the claim `pool`.\n * With `shapes`, an option that does not support a kind of the list gives the claim `shape`. A member of a meta option gets the same check.\n * A member of an option with `view: \"bounds\"` gets the check with the kind `rect`.\n */\nexport function checkConfig(space: StrategySpace, config: StrategyConfig, options: ShapeFilter = {}): ClaimBreak[] {\n return toBreaks(configProblems(space, config, false, options.shapes));\n}\n\n/**\n * This function checks a space. It gives one break for each problem. An empty list tells that the space is good.\n * It finds duplicate names, empty ranges, defaults out of range, enums without values, bad log scales, unknown names and bad named configs.\n * It also checks each entry of a `pool`: the count of its members, each member and a repeated entry.\n * The `inputs` of a break of a named config have the name of the config.\n * With `kinds`, a shape kind of a `supports` that is not in the list gives the claim `shape`.\n */\nexport function checkSpace(space: StrategySpace, kindOptions: KindOptions = {}): ClaimBreak[] {\n if (!isObject(space) || !Array.isArray(space.stages)) return toBreaks([[\"schema\", \"the space is not an object with stages\"]]);\n const out: Problem[] = [];\n if (space.schema !== STRATEGY_SPACE_SCHEMA) out.push([\"schema\", `the schema is ${show(space.schema)}, not ${STRATEGY_SPACE_SCHEMA}`]);\n if (typeof space.engine !== \"string\" || space.engine === \"\") out.push([\"schema\", \"the space has no engine name\"]);\n if (typeof space.version !== \"string\") out.push([\"schema\", \"the space has no version\"]);\n const names = space.stages.map((s) => s.name);\n space.stages.forEach((s, i) => {\n if (names.indexOf(s.name) !== i) out.push([\"duplicate\", `the space has the stage ${s.name} two times`]);\n const options: readonly StageOption[] = Array.isArray(s.options) ? s.options : [];\n if (options.length === 0) {\n out.push([\"options\", `the stage ${s.name} has no options`]);\n return;\n }\n const ids = options.map((o) => o.id);\n options.forEach((o, j) => {\n if (ids.indexOf(o.id) !== j) out.push([\"duplicate\", `the stage ${s.name} has the option ${o.id} two times`]);\n out.push(...optionProblems(s, o, kindOptions.kinds));\n });\n if (!s.optional && options.every((o) => o.members !== undefined)) out.push([\"meta\", `the stage ${s.name} is not optional and has only meta options, so no base config exists`]);\n });\n const known = (ref: OptionRef, at: string): void => {\n const s = space.stages.find((x) => x.name === ref?.stage);\n if (s === undefined) out.push([\"unknown\", `${at} has the unknown stage ${ref?.stage}`]);\n else if (ref.option === null ? !s.optional : !s.options.some((o) => o.id === ref.option))\n out.push([\"unknown\", `${at} has the unknown option ${s.name}=${ref.option ?? \"null\"}`]);\n };\n (space.constraints ?? []).forEach((c, k) => {\n known(c.if, `the constraint ${k}`);\n known(\"not\" in c.then ? c.then.not : c.then, `the constraint ${k}`);\n });\n for (const part of space.parts ?? []) for (const b of checkSpace(part, kindOptions)) out.push([b.claim, `the part ${part.engine}: ${b.detail}`]);\n if (space.parts !== undefined)\n for (const s of space.stages) if (partOf(space, s.name).prefix === \"\") out.push([\"parts\", `the stage ${s.name} is not a stage of a part`]);\n const breaks = toBreaks(out);\n if (breaks.length > 0) return breaks;\n for (const s of space.stages)\n for (const o of s.options) if (o.members?.pool !== undefined) breaks.push(...toBreaks(poolProblems(partOf(space, s.name).space, o.members, `the option ${s.name}.${o.id}`)));\n if (breaks.length > 0) return breaks;\n for (const [name, config] of Object.entries(space.named ?? {}))\n breaks.push(...toBreaks(configProblems(space, config, false).map(([c, d]) => [c, `the named config ${name}: ${d}`] as const), [name]));\n return breaks;\n}\n\n/** This function gives the canonical form of a config that is known to be good. */\nfunction canonicalOf(space: StrategySpace, config: StrategyConfig, member: boolean): StrategyConfig {\n const stages: Record<string, StageChoice | null> = {};\n for (const s of space.stages) {\n const c = Object.hasOwn(config.stages, s.name) ? config.stages[s.name] : undefined;\n if (c === undefined || c === null) {\n stages[s.name] = null;\n continue;\n }\n const o = s.options.find((x) => x.id === c.option)!;\n const given = c.params ?? {};\n const params: Values = {};\n for (const p of o.params) if (isActive(p, params)) params[p.name] = normalize(p, Object.hasOwn(given, p.name) ? given[p.name]! : p.default);\n if (o.members === undefined || member) {\n stages[s.name] = { option: o.id, params };\n continue;\n }\n const part = partOf(space, s.name).space;\n const members = (c.members ?? []).map((m) => canonicalOf(part, m, true));\n if (!o.members.ordered) members.sort((a, b) => (idOf(a) < idOf(b) ? -1 : idOf(a) > idOf(b) ? 1 : 0));\n stages[s.name] = { option: o.id, params, members };\n }\n return { space: space.engine, stages };\n}\n\nconst idOf = (canonical: StrategyConfig): string => sha256Hex(canonicalJson(canonical, { form: \"json\" }), { input: \"wtf8\" }).slice(0, 16);\n\n/**\n * This function gives the canonical form of a config: each stage of the space, the active params only, the defaults, and stable numbers.\n * An unused optional stage is `null`. The members of an unordered meta option are sorted by their `configId`.\n * It throws an `Error` for a config with a break of `checkConfig`.\n */\nexport function canonicalConfig(space: StrategySpace, config: StrategyConfig): StrategyConfig {\n const problems = configProblems(space, config, false);\n if (problems.length > 0) throw new Error(`The config of the space ${space.engine} is not good: ${problems.map((p) => p[1]).join(\"; \")}.`);\n return canonicalOf(space, config, false);\n}\n\n/**\n * This function gives the id of a config: the first 16 hex characters of the SHA-256 of `canonicalJson` of `canonicalConfig`.\n * Two spellings of one config get one id. The version of the space is not part of the id.\n */\nexport function configId(space: StrategySpace, config: StrategyConfig): string {\n return idOf(canonicalConfig(space, config));\n}\n\n/** This function throws an `Error` for a space with a break of `checkSpace`. */\nfunction assertSpace(space: StrategySpace, kinds?: readonly string[]): void {\n const breaks = checkSpace(space, kinds === undefined ? {} : { kinds });\n if (breaks.length > 0) throw new Error(`The space ${String(space?.engine)} is not good: ${breaks.map((b) => b.detail).join(\"; \")}.`);\n}\n\n/** This function throws a `RangeError` when a value is not a whole number of `min` or more. */\nfunction assertWhole(value: number, name: string, min: number): void {\n if (!Number.isInteger(value) || value < min) throw new RangeError(`The option ${name} is ${value}, not a whole number of ${min} or more.`);\n}\n\n/** This function gives the last point of the step grid of a numeric param. */\nfunction lastPoint(p: SpaceParam): number {\n const min = p.min!;\n const step = p.step ?? (p.kind === \"int\" ? 1 : undefined);\n if (step === undefined) return p.max!;\n return min + Math.floor((p.max! - min) / step + 1e-9) * step;\n}\n\n/** This function moves a value of a numeric param onto its step and into its range. */\nfunction snap(p: SpaceParam, x: number, digits: number): number {\n const min = p.min!;\n const step = p.step ?? (p.kind === \"int\" ? 1 : undefined);\n let v = step === undefined ? x : min + Math.round((x - min) / step) * step;\n v = Math.min(lastPoint(p), Math.max(min, v));\n return p.kind === \"int\" ? zero(Math.round(v)) : Math.min(p.max!, Math.max(min, realForm(v, digits)));\n}\n\n/** This function gives the point at the fraction `t` of the range of a numeric param, on its scale. */\nfunction at01(p: SpaceParam, t: number): number {\n const min = p.min!;\n const max = p.max!;\n if (p.scale === \"log\") return Math.exp(Math.log(min) + t * (Math.log(max) - Math.log(min)));\n return min + t * (max - min);\n}\n\n/**\n * This function gives the grid values of one param, in increasing order. An `enum` gives its values, and a `bool` gives `false` and `true`.\n * With 1 level, a numeric param gives its default. With k levels, it gives k points from `min` to `max` on its scale and step, without repeats.\n */\nexport function paramLevels(param: SpaceParam, levels: number): ParamValue[] {\n assertWhole(levels, \"levels\", 1);\n if (param.kind === \"bool\") return [false, true];\n if (param.kind === \"enum\") return [...(param.values ?? [])];\n if (levels === 1 || param.min === param.max) return [normalize(param, param.default)];\n const out: number[] = [];\n const steps = param.kind === \"int\" || param.step !== undefined ? Math.round((lastPoint(param) - param.min!) / (param.step ?? 1)) + 1 : Infinity;\n if (steps <= levels && param.scale !== \"log\") {\n for (let j = 0; j < steps; j++) out.push(snap(param, param.min! + j * (param.step ?? 1), 12));\n } else {\n for (let j = 0; j < levels; j++) out.push(snap(param, at01(param, j / (levels - 1)), 12));\n }\n return [...new Set(out)];\n}\n\n/** This function tells if a later param of the list reads a param in its `when`. */\nconst readLater = (params: readonly SpaceParam[], i: number): boolean => params.slice(i + 1).some((q) => q.when?.param === params[i]!.name);\n\n/** This function gives the count of the grid assignments of the params of an option, with only the active params. */\nfunction countParams(params: readonly SpaceParam[], levels: number, i = 0, values: Values = {}): bigint {\n if (i === params.length) return 1n;\n const p = params[i]!;\n if (!isActive(p, values)) return countParams(params, levels, i + 1, values);\n const lv = paramLevels(p, levels);\n if (!readLater(params, i)) return BigInt(lv.length) * countParams(params, levels, i + 1, values);\n let sum = 0n;\n for (const v of lv) sum += countParams(params, levels, i + 1, { ...values, [p.name]: v });\n return sum;\n}\n\n/** This function gives the grid assignments of the params of an option, in a stable order. */\nfunction* gridParams(params: readonly SpaceParam[], levels: number, i = 0, values: Values = {}): Generator<Values> {\n if (i === params.length) {\n yield { ...values };\n return;\n }\n const p = params[i]!;\n if (!isActive(p, values)) {\n yield* gridParams(params, levels, i + 1, values);\n return;\n }\n for (const v of paramLevels(p, levels)) yield* gridParams(params, levels, i + 1, { ...values, [p.name]: v });\n}\n\n/** One combination of options of a space, with its count of grid points. */\ninterface Combo {\n readonly choices: Choices;\n readonly base: boolean;\n /** The count of the grid points, or `null` when the count is more than the limit. */\n readonly weight: bigint | null;\n}\n\nconst optionIds = (choices: Choices): Map<string, string | null> => new Map([...choices].map(([k, o]) => [k, o?.id ?? null]));\nconst keeps = (space: StrategySpace, choices: Choices): boolean => (space.constraints ?? []).every((c) => holds(c, optionIds(choices)));\n\n/**\n * This function gives the constraints of a space for each stage: a constraint goes to the last stage that it names.\n * The last list holds each constraint that names a stage outside the space, so a walk examines it at the end.\n */\nfunction constraintsByStage(space: StrategySpace): readonly (readonly SpaceConstraint[])[] {\n const place = new Map(space.stages.map((s, i) => [s.name, i]));\n const lists: SpaceConstraint[][] = Array.from({ length: space.stages.length + 1 }, () => []);\n for (const c of space.constraints ?? []) {\n const named = [c.if.stage, \"not\" in c.then ? c.then.not.stage : c.then.stage];\n lists[Math.max(...named.map((name) => place.get(name) ?? space.stages.length))]!.push(c);\n }\n return lists;\n}\n\n/** This function gives the count of the member lists of a meta option without a pool from `base` base configs, or `null` above `limit`. */\nfunction memberLists(base: bigint, rule: MemberRule, limit: bigint): bigint | null {\n let sum = 0n;\n for (let m = rule.min; m <= rule.max; m++) {\n let n = 1n;\n for (let k = 0; k < m; k++) {\n n = (n * (base - BigInt(k))) / (rule.ordered ? 1n : BigInt(k + 1));\n if (n <= 0n) break;\n }\n if (n <= 0n) break;\n sum += n;\n if (sum > limit) return null;\n }\n return sum;\n}\n\n/** This function multiplies two counts. A `null` count or a product above `limit` gives `null`. */\nconst times = (a: bigint | null, b: bigint | null, limit: bigint): bigint | null => (a === null || b === null ? null : a * b > limit ? null : a * b);\n\n/**\n * This function gives the combinations of options of a space and their grid counts.\n * A product space joins the combinations of its parts. Each combination keeps the constraints.\n */\nfunction combos(space: StrategySpace, levels: number, meta: boolean, limit: bigint): Combo[] {\n if (space.parts !== undefined && space.parts.length > 0) {\n let acc: Combo[] = [{ choices: new Map(), base: true, weight: 1n }];\n for (const part of space.parts) {\n const head = `${part.engine}.`;\n const own = combos(part, levels, meta, limit);\n const next: Combo[] = [];\n for (const a of acc)\n for (const b of own) {\n const choices = new Map(a.choices);\n for (const [k, o] of b.choices) choices.set(head + k, o);\n const base = a.base && b.base;\n next.push({ choices, base, weight: base ? a.weight! * b.weight! : times(a.weight, b.weight, limit) });\n }\n acc = next;\n }\n return acc.filter((c) => keeps(space, c.choices));\n }\n const counts = new Map<StageOption, bigint>();\n const countOf = (o: StageOption): bigint => {\n if (!counts.has(o)) counts.set(o, countParams(o.params, levels));\n return counts.get(o)!;\n };\n const out: Combo[] = [];\n const stages = space.stages;\n // A space can have hundreds of constraints. Each one is examined at its last stage, so the walk leaves a branch at the first break.\n const checks = constraintsByStage(space);\n const ids = new Map<string, string | null>();\n const walk = (i: number, choices: Map<string, StageOption | null>, weight: bigint): void => {\n if (i === stages.length) {\n if (checks[i]!.every((c) => holds(c, ids))) out.push({ choices: new Map(choices), base: true, weight });\n return;\n }\n const s = stages[i]!;\n const list: (StageOption | null)[] = s.options.filter((o) => o.members === undefined);\n if (s.optional) list.push(null);\n for (const o of list) {\n choices.set(s.name, o);\n ids.set(s.name, o?.id ?? null);\n if (checks[i]!.every((c) => holds(c, ids))) walk(i + 1, choices, o === null ? weight : weight * countOf(o));\n }\n choices.delete(s.name);\n ids.delete(s.name);\n };\n walk(0, new Map(), 1n);\n if (!meta) return out;\n const base = out.reduce((sum, c) => sum + c.weight!, 0n);\n for (const s of stages)\n for (const o of s.options) {\n if (o.members === undefined) continue;\n const choices = new Map<string, StageOption | null>(stages.map((x) => [x.name, x === s ? o : null]));\n const own = memberSpaces.get(o);\n const from = own === undefined ? base : baseCount(own, levels, limit);\n const lists = o.members.pool === undefined ? memberLists(from, o.members, limit) : BigInt(o.members.pool.length);\n if (keeps(space, choices)) out.push({ choices, base: false, weight: times(countOf(o), lists, limit) });\n }\n return out;\n}\n\n/**\n * This function gives the count of the grid points of a space, with `levels` levels for each numeric param.\n * It counts only the active params and the combinations that keep the constraints. It gives the meta configs apart.\n * A meta option with a `pool` counts each entry of the pool one time.\n * With `shapes`, it counts only the options that support each kind of the list.\n */\nexport function spaceSize(space: StrategySpace, options: SpaceSizeOptions): SpaceSize {\n assertSpace(space, options.kinds);\n assertWhole(options.levels, \"levels\", 1);\n assertShapes(options.shapes, options.kinds);\n return sizeOf(restrict(space, options.shapes), options.levels, options.maxMeta ?? 10n ** 18n);\n}\n\n/**\n * This function gives the space with only the options that support each shape kind of `shapes`. Without `shapes`, it gives the same space.\n * A stage can lose all of its options. Then the space has no config with that stage.\n * A pool keeps only the entries whose members fit the smaller space. A meta option without such an entry goes out.\n *\n * The members of an option with `view: \"bounds\"` come from the space for the kinds of `memberShapes`. `memberSpaces` keeps that space.\n */\nfunction restrict(space: StrategySpace, shapes: readonly string[] | undefined): StrategySpace {\n if (shapes === undefined) return space;\n const kept: StrategySpace = {\n ...space,\n stages: space.stages.map((s) => ({ ...s, options: s.options.filter((o) => supportsShapes(o, shapes)) })),\n ...(space.parts === undefined ? {} : { parts: space.parts.map((p) => restrict(p, shapes)) }),\n };\n const withPool = (s: SpaceStage, o: StageOption): StageOption[] => {\n if (o.members === undefined) return [o];\n const inner = memberShapes(o.members, shapes)!;\n const own = sameKinds(inner, shapes) ? undefined : restrict(partOf(space, s.name).space, inner);\n const mark = (option: StageOption): StageOption[] => {\n if (own !== undefined) memberSpaces.set(option, own);\n return [option];\n };\n if (o.members.pool === undefined) return own === undefined ? [o] : mark({ ...o });\n const part = own ?? partOf(kept, s.name).space;\n const pool = o.members.pool.filter((entry) => fits(part, entry));\n return pool.length === 0 ? [] : mark({ ...o, members: { ...o.members, pool } });\n };\n return { ...kept, stages: kept.stages.map((s) => ({ ...s, options: s.options.flatMap((o) => withPool(s, o)) })) };\n}\n\n/** The space of the members of a meta option of a restricted space, when it is not the part of the option. Only `view: \"bounds\"` makes such a space. */\nconst memberSpaces = /* @__PURE__ */ new WeakMap<StageOption, StrategySpace>();\n\n/**\n * This function tells if an option of a restricted space has a member list. A base option and a meta option with a `pool` have one.\n * A different meta option has one when its members have a base config. `restrict` keeps only the pool entries that fit.\n */\nconst hasMembers = (space: StrategySpace, stage: string, o: StageOption): boolean =>\n o.members === undefined || o.members.max === 0 || o.members.pool !== undefined || combos(memberSpaces.get(o) ?? partOf(space, stage).space, 1, false, 0n).length > 0;\n\n/** This function tells if a restricted space has a config. A base config counts. With `meta`, a meta config counts when each of its meta options has a member list. */\nconst hasConfig = (space: StrategySpace, meta: boolean): boolean =>\n combos(space, 1, meta, 0n).some((c) => c.base || [...c.choices].every(([stage, o]) => o === null || hasMembers(space, stage, o)));\n\n/** This function gives the error of a sample of a space that has no config for the shape kinds `shapes`. `kept` is the restricted space. */\nfunction noSample(space: StrategySpace, kept: StrategySpace, shapes: readonly string[], meta: boolean): RangeError {\n const list = (names: readonly string[], one: string, more: string): string => (names.length === 1 ? `${one} ${names[0]}` : `${more} ${names.join(\", \")}`);\n const empty = kept.stages.filter((s) => !s.optional && !s.options.some((o) => meta || o.members === undefined)).map((s) => s.name);\n const removed = !meta\n ? []\n : space.stages.flatMap((s) =>\n s.options\n .filter((o) => o.members !== undefined && o.members.view !== \"bounds\" && supportsShapes(o, shapes))\n .filter((o) => {\n const own = kept.stages.find((x) => x.name === s.name)?.options.find((x) => x.id === o.id);\n return own === undefined || !hasMembers(kept, s.name, own);\n })\n .map((o) => `${s.name}.${o.id}`),\n );\n let text = `The space ${space.engine} has no config for a sample with the shape kinds ${shapes.join(\", \")}.`;\n if (empty.length > 0) text += ` ${list(empty, \"The stage\", \"The stages\")} ${empty.length === 1 ? \"has\" : \"have\"} no option for these kinds.`;\n if (removed.length > 0)\n text += ` ${list(removed, \"The meta option\", \"The meta options\")} ${removed.length === 1 ? \"has\" : \"have\"} no member config for these kinds. Set members.view to \"bounds\" when the members see only the bounding boxes.`;\n if (empty.length === 0 && removed.length === 0) text += \" The constraints remove each config.\";\n return new RangeError(text);\n}\n\n/** This function gives a constraint in words, for the reason of an error. */\nfunction constraintText(c: SpaceConstraint): string {\n const ref = (r: OptionRef): string => `${r.stage} ${r.option === null ? \"has no option\" : `is ${r.option}`}`;\n return \"not\" in c.then ? `if ${ref(c.if)}, then not ${ref(c.then.not)}` : `if ${ref(c.if)}, then ${ref(c.then)}`;\n}\n\n/**\n * This function throws a `RangeError` for a bad `fixed` option of a sample. A stage or an option that the space does not have is bad.\n * A meta option without `meta: \"sample\"` is bad, and so are two fixed options that a constraint forbids.\n */\nfunction assertFixed(space: StrategySpace, fixed: Readonly<Record<string, string>>, meta: boolean): void {\n for (const [stage, id] of Object.entries(fixed)) {\n const s = space.stages.find((x) => x.name === stage);\n if (s === undefined) throw new RangeError(`The option fixed names the stage ${stage}, and the space ${space.engine} has no such stage.`);\n const o = s.options.find((x) => x.id === id);\n if (o === undefined) throw new RangeError(`The option fixed names the option ${String(id)} of the stage ${stage}, and the stage has no such option.`);\n if (o.members !== undefined && !meta) throw new RangeError(`The option fixed names the meta option ${stage}.${id}, and a sample with meta skip has no meta option. Set meta to \"sample\".`);\n }\n const ids = new Map<string, string | null>(Object.entries(fixed));\n const other = (c: SpaceConstraint): string => (\"not\" in c.then ? c.then.not.stage : c.then.stage);\n const broken = (space.constraints ?? []).filter((c) => ids.has(c.if.stage) && ids.has(other(c)) && !holds(c, ids));\n if (broken.length > 0) {\n const names = Object.entries(fixed).map(([stage, id]) => `${stage}.${id}`);\n throw new RangeError(`The constraints of the space ${space.engine} forbid the fixed options ${names.join(\", \")}. The broken constraints: ${broken.map(constraintText).join(\"; \")}.`);\n }\n}\n\n/**\n * This function gives the restricted space `kept` with only the fixed option at each fixed stage. A fixed stage that was optional stops being optional.\n * A meta option of another stage of the part of a fixed stage goes out. A sample gives no option to the other stages of the part of its meta option.\n */\nfunction fixStages(space: StrategySpace, kept: StrategySpace, fixed: Readonly<Record<string, string>>, shapes: readonly string[] | undefined): StrategySpace {\n const prefix = prefixes(kept);\n const parts = new Set(Object.keys(fixed).map((stage) => prefix.get(stage)!));\n const stages = kept.stages.map((s) => {\n const id = fixed[s.name];\n if (id === undefined) return parts.has(prefix.get(s.name)!) ? { ...s, options: s.options.filter((o) => o.members === undefined) } : s;\n // A fixed meta option takes its members from the space before the fix, because the fix removes each base config of its own stage.\n const options = s.options.filter((o) => o.id === id).map((o) => (o.members === undefined ? o : withMemberSpace(o, memberSpaces.get(o) ?? partOf(kept, s.name).space)));\n if (options.length === 0) throw new RangeError(`The fixed option ${s.name}.${id} of the space ${space.engine} does not support the shape kinds ${(shapes ?? []).join(\", \")}.`);\n return { ...s, options, optional: false };\n });\n return { ...kept, stages };\n}\n\n/** This function gives a copy of a meta option whose members come from `members`. */\nfunction withMemberSpace(o: StageOption, members: StrategySpace): StageOption {\n const copy = { ...o };\n memberSpaces.set(copy, members);\n return copy;\n}\n\n/** This function gives the error of a sample whose fixed options keep each constraint between them. The constraints with the other stages remove each config. */\nfunction noFixedSample(space: StrategySpace, fixed: Readonly<Record<string, string>>): RangeError {\n const names = Object.entries(fixed).map(([stage, id]) => `${stage}.${id}`);\n return new RangeError(\n `The space ${space.engine} has no config with the fixed options ${names.join(\", \")}. No constraint between two fixed options breaks, so the constraints with the other stages remove each config.`,\n );\n}\n\n/** This function gives the count of the base configs of a space that is known to be good. */\nconst baseCount = (space: StrategySpace, levels: number, limit: bigint): bigint => combos(space, levels, false, limit).reduce((sum, c) => sum + c.weight!, 0n);\n\n/** This function throws a `RangeError` for a list of shape kinds with a kind that is not known. */\nfunction assertShapes(shapes: readonly string[] | undefined, kinds: readonly string[] | undefined): void {\n if (shapes === undefined) return;\n if (!Array.isArray(shapes)) throw new RangeError(\"The option shapes is not a list of shape kinds.\");\n for (const k of shapes) {\n const problem = kindProblem(k, kinds);\n if (problem !== undefined) throw new RangeError(`The shape kind ${show(k)} ${problem}.`);\n }\n}\n\n/** This function gives the count of the grid points of a space that is known to be good. */\nfunction sizeOf(space: StrategySpace, levels: number, limit: bigint): SpaceSize {\n let base = 0n;\n let meta: bigint | null = 0n;\n for (const c of combos(space, levels, true, limit)) {\n if (c.base) base += c.weight!;\n else meta = meta === null || c.weight === null || meta + c.weight > limit ? null : meta + c.weight;\n }\n return { base, meta };\n}\n\n/** This function gives the cartesian product of lists, with the last list as the fastest. */\nfunction* product<T>(lists: readonly (readonly T[])[], i = 0, acc: T[] = []): Generator<T[]> {\n if (i === lists.length) {\n yield [...acc];\n return;\n }\n for (const x of lists[i]!) {\n acc.push(x);\n yield* product(lists, i + 1, acc);\n acc.pop();\n }\n}\n\n/** This function gives the configs of the grid of a space, without meta options. */\nfunction gridConfigs(space: StrategySpace, levels: number, limit: number, shapes: readonly string[] | undefined): StrategyConfig[] {\n const kept = restrict(space, shapes);\n const size = sizeOf(kept, levels, 0n).base;\n if (size > BigInt(limit)) throw new RangeError(`The grid of the space ${space.engine} has ${size} configs, more than the limit ${limit}.`);\n const out: StrategyConfig[] = [];\n for (const c of combos(kept, levels, false, 0n)) {\n const names = [...c.choices.keys()];\n const lists = names.map((k) => {\n const o = c.choices.get(k)!;\n return o === null ? [null] : [...gridParams(o.params, levels)].map((params): StageChoice => ({ option: o.id, params }));\n });\n for (const row of product<StageChoice | null>(lists)) out.push(canonicalOf(space, { space: space.engine, stages: Object.fromEntries(names.map((k, i) => [k, row[i]!])) }, false));\n }\n return out;\n}\n\n/** This function gives a random order of the numbers from 0 to `n - 1`. */\nfunction permutation(n: number, r: () => number): number[] {\n const out = Array.from({ length: n }, (_, i) => i);\n for (let i = n - 1; i > 0; i--) {\n const j = Math.floor(r() * (i + 1));\n [out[i], out[j]] = [out[j]!, out[i]!];\n }\n return out;\n}\n\n/** This function gives the value of a param at the fraction `u` of its range. A sampled real number has 6 significant digits. */\nfunction sampleValue(p: SpaceParam, u: number): ParamValue {\n if (p.kind === \"bool\") return u >= 0.5;\n if (p.kind === \"enum\") {\n const values = p.values!;\n return values[Math.min(values.length - 1, Math.floor(u * values.length))]!;\n }\n if (p.min === p.max) return normalize(p, p.min!);\n if (p.scale !== \"log\" && (p.kind === \"int\" || p.step !== undefined)) {\n const steps = Math.round((lastPoint(p) - p.min!) / (p.step ?? 1)) + 1;\n return snap(p, p.min! + Math.min(steps - 1, Math.floor(u * steps)) * (p.step ?? 1), 6);\n }\n return snap(p, at01(p, u), 6);\n}\n\n/** This function gives a seed of 32 bits from a seed and a step name. */\nconst subSeed = (seed: number, step: string): number => Math.floor(stepRandom(seed, step)() * 4294967296);\n\n/**\n * This function gives a sample of a space: Latin hypercube strata over the options, the params and the member counts.\n * `canon` is the space of `canonicalConfig`: the space before a shape filter. A member of an option with `view: \"bounds\"` can have an option that the filter removed.\n */\nfunction sampleConfigs(\n space: StrategySpace,\n n: number,\n seed: number,\n meta: boolean,\n maxTries: number,\n canon: StrategySpace = space,\n walk = false,\n first: ReadonlySet<string> = new Set(),\n): StrategyConfig[] {\n const stages = space.stages;\n const prefix = prefixes(space);\n // A stage without options can stay empty in a part with a meta option of `view: \"bounds\"` or with no member list, because that option replaces the stage.\n const bounded = new Set(stages.filter((s) => meta && s.options.some((o) => memberSpaces.has(o) || o.members?.max === 0)).map((s) => prefix.get(s.name)!));\n const lists = stages.map((s) => {\n const list: (StageOption | null)[] = s.options.filter((o) => meta || o.members === undefined);\n if (s.optional) list.push(null);\n if (list.length === 0 && bounded.has(prefix.get(s.name)!)) list.push(null);\n if (list.length === 0) throw new Error(`The stage ${s.name} of the space ${space.engine} has no option for a sample. A shape filter can remove all of its options.`);\n return list;\n });\n // A meta option without a member list stays in its list, so the strata of 0.2.16 do not change. A point that chooses it draws again.\n const usable = new Map<StageOption, boolean>();\n const withMembers = (s: SpaceStage, o: StageOption | null | undefined): boolean => {\n if (o === null || o === undefined || o.members === undefined) return true;\n if (!usable.has(o)) usable.set(o, hasMembers(space, s.name, o));\n return usable.get(o)!;\n };\n const plan = walk ? walkPlan(stages, lists, space.constraints ?? [], n, first) : null;\n const points: Map<string, StageOption | null>[] = [];\n let tries = 0;\n for (let round = 0; points.length < n; round++) {\n const r = stepRandom(seed, `options:${round}`);\n const picks = walk ? lists.map(() => permutation(n, r)) : [];\n const columns = walk ? [] : lists.map((list) => permutation(n, r).map((p) => list[Math.floor((p * list.length) / n)]!));\n for (let i = 0; i < n && points.length < n; i++) {\n if (tries >= maxTries) throw new Error(`The constraints of the space ${space.engine} remove too many points: ${points.length} of ${n} configs after ${tries} tries.${walk ? \"\" : ' The option draw: \"walk\" gets a sample of a space with many constraints.'}`);\n tries++;\n const choices = plan !== null ? walkPoint(plan, picks, i) : new Map<string, StageOption | null>(stages.map((s, k) => [s.name, columns[k]![i]!]));\n const metaPart = new Map<string, string>();\n for (const s of stages) {\n const o = choices.get(s.name);\n if (o?.members !== undefined && !metaPart.has(prefix.get(s.name)!)) metaPart.set(prefix.get(s.name)!, s.name);\n }\n for (const s of stages) {\n const m = metaPart.get(prefix.get(s.name)!);\n if (m !== undefined && m !== s.name) choices.set(s.name, null);\n }\n const filled = stages.every((s) => s.optional === true || choices.get(s.name) !== null || metaPart.has(prefix.get(s.name)!));\n if (filled && keeps(space, choices) && stages.every((s) => withMembers(s, choices.get(s.name)))) points.push(choices);\n }\n }\n const values: Values[][] = points.map(() => stages.map(() => ({})));\n const members: StrategyConfig[][][] = points.map(() => stages.map(() => []));\n stages.forEach((s, k) => {\n for (const o of s.options) {\n const users = points.flatMap((c, i) => (c.get(s.name) === o ? [i] : []));\n if (users.length === 0) continue;\n for (const p of o.params) {\n const active = users.filter((i) => isActive(p, values[i]![k]!));\n const r = stepRandom(seed, `param:${s.name}:${o.id}:${p.name}`);\n permutation(active.length, r).forEach((stratum, j) => {\n values[active[j]!]![k]![p.name] = sampleValue(p, (stratum + r()) / active.length);\n });\n }\n if (o.members === undefined || o.members.max === 0) continue;\n const fixed = o.members.pool;\n if (fixed !== undefined) {\n const r = stepRandom(seed, `pool-entry:${s.name}:${o.id}`);\n permutation(users.length, r).forEach((stratum, j) => {\n members[users[j]!]![k] = [...fixed[Math.min(fixed.length - 1, Math.floor(((stratum + r()) / users.length) * fixed.length))]!];\n });\n continue;\n }\n const part = memberSpaces.get(o) ?? partOf(space, s.name).space;\n const poolSize = Math.max(n, 4 * o.members.max, 8);\n const seen = new Set<string>();\n const pool = sampleConfigs(part, poolSize, subSeed(seed, `pool:${s.name}:${o.id}`), false, Math.max(1000, 100 * poolSize), part, walk).filter((c) => {\n const id = idOf(c);\n return seen.has(id) ? false : (seen.add(id), true);\n });\n const r = stepRandom(seed, `members:${s.name}:${o.id}`);\n const { min, max } = o.members;\n permutation(users.length, r).forEach((stratum, j) => {\n const count = min + Math.min(max - min, Math.floor(((stratum + r()) / users.length) * (max - min + 1)));\n if (pool.length < count) throw new Error(`The space ${part.engine} has only ${pool.length} distinct base samples, fewer than the ${count} members of ${s.name}.${o.id}.`);\n const picked = permutation(pool.length, r).slice(0, count);\n members[users[j]!]![k] = picked.map((x) => pool[x]!);\n });\n }\n });\n return points.map((choices, i) => {\n const out: Record<string, StageChoice | null> = {};\n stages.forEach((s, k) => {\n const o = choices.get(s.name)!;\n out[s.name] = o === null ? null : o.members === undefined ? { option: o.id, params: values[i]![k]! } : { option: o.id, params: values[i]![k]!, members: members[i]![k]! };\n });\n return canonicalConfig(canon, { space: space.engine, stages: out });\n });\n}\n\n/**\n * This function gives configs of a space, in their canonical form. Each config keeps the constraints. The result is deterministic.\n *\n * - The mode `grid` gives each grid point without a meta option, in a stable order. Stages, options and values go in the order of the space.\n * - The mode `sample` gives `n` configs of a seeded Latin hypercube. The options of a stage get equal strata, and each active param gets its own strata.\n * - A sample draws again when a point breaks a constraint. After `maxTries` draws, it throws an `Error`. Two sampled configs can be equal.\n * - With `draw: \"walk\"`, each stage draws only from the options that keep the constraints with the stages before it. The largest stage keeps its equal strata.\n * - With `shapes`, only the options that support each kind of the list count. Without `shapes`, the result does not change.\n * - A meta option with a `pool` gives only the entries of its pool. With `shapes`, only the entries whose members support each kind count.\n * - A sample draws again when a point chooses a meta option without a member list. `spaceSize` gives such an option 0.\n * - With `shapes`, a sample throws a `RangeError` when the space has no config for the kinds. The error names the stages without an option and the meta options without members.\n * - With `fixed`, each config has the fixed option at each named stage. A fixed option that the space, the shape filter or the constraints do not permit gets a `RangeError` with the reason.\n */\nexport function enumerateSpace(space: StrategySpace, options: EnumerateOptions): StrategyConfig[] {\n assertSpace(space, options.kinds);\n assertShapes(options.shapes, options.kinds);\n if (options.mode === \"grid\") {\n assertWhole(options.levels, \"levels\", 1);\n return gridConfigs(space, options.levels, options.limit ?? 100_000, options.shapes);\n }\n if (options.mode !== \"sample\") throw new RangeError(`The mode ${String((options as { mode?: unknown }).mode)} is not grid or sample.`);\n assertWhole(options.n, \"n\", 0);\n if (!Number.isInteger(options.seed)) throw new RangeError(`The seed ${options.seed} is not a whole number.`);\n const meta = options.meta ?? \"skip\";\n if (meta !== \"skip\" && meta !== \"sample\") throw new RangeError(`The option meta is ${String(meta)}, not skip or sample.`);\n const draw = options.draw ?? \"reject\";\n if (draw !== \"reject\" && draw !== \"walk\") throw new RangeError(`The option draw is ${String(draw)}, not reject or walk.`);\n const fixed = options.fixed;\n if (fixed !== undefined) assertFixed(space, fixed, meta === \"sample\");\n if (options.n === 0) return [];\n const kept = restrict(space, options.shapes);\n const drawn = fixed === undefined ? kept : fixStages(space, kept, fixed, options.shapes);\n try {\n return sampleConfigs(drawn, options.n, options.seed, meta === \"sample\", options.maxTries ?? Math.max(1000, 100 * options.n), space, draw === \"walk\", new Set(Object.keys(fixed ?? {})));\n } catch (error) {\n // Only a space without a config for the shape kinds, or for the fixed options, gives the RangeError. A different failure keeps its own error.\n if (options.shapes !== undefined && !hasConfig(kept, meta === \"sample\")) throw noSample(space, kept, options.shapes, meta === \"sample\");\n if (fixed !== undefined && !hasConfig(drawn, meta === \"sample\")) throw noFixedSample(space, fixed);\n throw error;\n }\n}\n\n/**\n * This function gives the shape kinds that a space accepts. The value comes from the `supports` of the options.\n * A space accepts a kind when it has at least one config without a meta option on that kind.\n * With `kinds`, it examines the kinds of that list, in its order. Without `kinds`, it examines the kinds that the `supports` of the space name, in the order of their first use.\n */\nexport function spaceShapeKinds(space: StrategySpace, options: KindOptions = {}): string[] {\n assertSpace(space, options.kinds);\n const named = [...new Set(space.stages.flatMap((s) => s.options.flatMap((o) => o.supports?.shape ?? [])))];\n return (options.kinds ?? named).filter((k) => sizeOf(restrict(space, [k]), 1, 0n).base > 0n);\n}\n\n/**\n * This function joins configs of the parts of a product space into one config of the space `space`.\n * The name of each stage gets the prefix `<space of the part>.`. The members of a meta option do not change.\n */\nexport function joinConfigs(space: string, parts: readonly StrategyConfig[]): StrategyConfig {\n const stages: Record<string, StageChoice | null> = {};\n for (const part of parts) for (const [k, c] of Object.entries(part.stages)) stages[`${part.space}.${k}`] = c;\n return { space, stages };\n}\n\n/** This function gives the config of the part `engine` of a joint config. It throws a `RangeError` when no stage has the prefix `<engine>.`. */\nexport function splitConfig(config: StrategyConfig, engine: string): StrategyConfig {\n const head = `${engine}.`;\n const entries = Object.entries(config.stages).filter(([k]) => k.startsWith(head));\n if (entries.length === 0) throw new RangeError(`The config of the space ${config.space} has no stage of the part ${engine}.`);\n return { space: engine, stages: Object.fromEntries(entries.map(([k, c]) => [k.slice(head.length), c])) };\n}\n\n/**\n * This function joins two spaces, for example a packer and a router, into the space `name`. The stages of `a` and `b` get the prefixes `<a.engine>.` and `<b.engine>.`.\n * The constraints get the same prefixes. The named configs are the pairs `<name of a>+<name of b>`. It throws a `RangeError` when the two engines have the same name.\n */\nexport function productSpace(a: StrategySpace, b: StrategySpace, name: string): StrategySpace {\n if (a.engine === b.engine) throw new RangeError(`The two spaces have the same engine ${a.engine}.`);\n if (name === \"\") throw new RangeError(\"The product space has no name.\");\n const stagesOf = (s: StrategySpace): SpaceStage[] => s.stages.map((x) => ({ ...x, name: `${s.engine}.${x.name}` }));\n const ref = (s: StrategySpace, r: OptionRef): OptionRef => ({ stage: `${s.engine}.${r.stage}`, option: r.option });\n const constraintsOf = (s: StrategySpace): SpaceConstraint[] =>\n (s.constraints ?? []).map((c) => ({ if: ref(s, c.if), then: \"not\" in c.then ? { not: ref(s, c.then.not) } : ref(s, c.then) }));\n const named: Record<string, StrategyConfig> = {};\n for (const [ka, ca] of Object.entries(a.named ?? {})) for (const [kb, cb] of Object.entries(b.named ?? {})) named[`${ka}+${kb}`] = joinConfigs(name, [ca, cb]);\n const constraints = [...constraintsOf(a), ...constraintsOf(b)];\n return {\n schema: STRATEGY_SPACE_SCHEMA,\n engine: name,\n version: `${a.engine}@${a.version}+${b.engine}@${b.version}`,\n stages: [...stagesOf(a), ...stagesOf(b)],\n ...(constraints.length > 0 ? { constraints } : {}),\n ...(Object.keys(named).length > 0 ? { named } : {}),\n parts: [a, b],\n };\n}\n"],"mappings":";;;;AAMA,MAAa,wBAAwB;;;;;AAMrC,MAAM,cAAc,MAAc,SAAiC,WAAW,QAAQ,GAAG,KAAK,GAAG,QAAQ,EAAE,OAAO,OAAO,CAAC,CAAC;AAiM3H,MAAM,YAAY,UAAqD,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAC1I,MAAM,QAAQ,UAA4B,OAAO,UAAU,WAAW,IAAI,MAAM,KAAK,OAAO,KAAK;AACjG,MAAM,aAAa,MAA2B,EAAE,SAAS,SAAS,EAAE,SAAS;AAC7E,MAAM,QAAQ,MAAuB,MAAM,IAAI,IAAI;;AAGnD,MAAM,YAAY,GAAW,SAAS,OAAe,KAAK,OAAO,EAAE,YAAY,MAAM,CAAC,CAAC;;AAGvF,SAAS,UAAU,GAAe,GAA2B;CAC3D,IAAI,OAAO,MAAM,UAAU,OAAO;CAClC,IAAI,EAAE,SAAS,QAAQ,OAAO,KAAK,CAAC;CACpC,OAAO,KAAK,IAAI,EAAE,OAAO,UAAU,KAAK,IAAI,EAAE,OAAO,WAAW,SAAS,CAAC,CAAC,CAAC;AAC9E;;AAGA,SAAS,OAAO,GAAe,GAAoB;CACjD,IAAI,EAAE,SAAS,KAAA,KAAa,EAAE,QAA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"https://json.schemastore.org/package",
|
|
2
3
|
"name": "@mark1russell7/strategy-space",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"description": "Layout strategies as data: the stages, options and parameters of a space, its checks, the id of a config, the count of the space, grids and seeded samples.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"strategy-space",
|
|
8
|
+
"layout",
|
|
9
|
+
"configuration-space",
|
|
10
|
+
"enumeration",
|
|
11
|
+
"sampling",
|
|
12
|
+
"search-space",
|
|
13
|
+
"deterministic"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/mark1russell7/strategy-space/tree/main/packages/strategy-space#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/mark1russell7/strategy-space/issues"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/mark1russell7/strategy-space.git",
|
|
22
|
+
"directory": "packages/strategy-space"
|
|
23
|
+
},
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"author": "Mark Russell (https://github.com/mark1russell7)",
|
|
26
|
+
"type": "module",
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
"main": "./build/index.js",
|
|
29
|
+
"files": [
|
|
30
|
+
"build"
|
|
31
|
+
],
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=22"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@mark1russell7/rigor-generators": "^0.1.7"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@mark1russell7/cue": "^2.0.0",
|
|
43
|
+
"@types/node": "^26.6.5",
|
|
44
|
+
"esbuild": "^0.28.2",
|
|
45
|
+
"tsdown": "^0.23.1",
|
|
46
|
+
"typescript": "^7.0.2",
|
|
47
|
+
"vitest": "^5.0.3"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsdown",
|
|
51
|
+
"test": "vitest run",
|
|
52
|
+
"test:watch": "vitest",
|
|
53
|
+
"typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.test.json"
|
|
54
|
+
},
|
|
55
|
+
"types": "./build/index.d.ts",
|
|
56
|
+
"exports": {
|
|
57
|
+
".": {
|
|
58
|
+
"types": "./build/index.d.ts",
|
|
59
|
+
"import": "./build/index.js"
|
|
60
|
+
},
|
|
61
|
+
"./package.json": "./package.json"
|
|
62
|
+
}
|
|
6
63
|
}
|