@orkestrel/scaffold 0.0.143 → 0.0.145

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/agents/skills/orkestrel-publish/scripts/swap.js +111 -5
  2. package/dist/agents/templates/brief.md +1 -0
  3. package/dist/bin/main.js +87 -30
  4. package/dist/bin/main.js.map +1 -1
  5. package/dist/host/agents/platforms/windows.md +1 -0
  6. package/dist/host/agents/skills/orkestrel-publish/references/release.md +1 -0
  7. package/dist/host/agents/skills/orkestrel-publish/scripts/swap.ts +133 -6
  8. package/dist/host/agents/templates/brief.md +1 -0
  9. package/dist/host/claude/agents/orkestrel.md +52 -52
  10. package/dist/host/claude/rules/documentation.md +1 -0
  11. package/dist/host/claude/rules/quality.md +1 -0
  12. package/dist/host/claude/rules/tests.md +1 -0
  13. package/dist/host/claude/rules/workspace.md +14 -13
  14. package/dist/host/dotfiles/oxlintrc.json +1 -1
  15. package/dist/host/guides/browser.md +1 -1
  16. package/dist/host/guides/codec.md +29 -12
  17. package/dist/host/guides/contract.md +58 -57
  18. package/dist/host/guides/scaffold.md +63 -43
  19. package/dist/host/guides/server.md +1 -1
  20. package/dist/host/manifest.json +18 -18
  21. package/dist/host/scripts/browsers.sh +0 -0
  22. package/dist/host/scripts/codex.sh +0 -0
  23. package/dist/host/scripts/cursor.sh +0 -0
  24. package/dist/host/scripts/deps.sh +0 -0
  25. package/dist/host/scripts/npm.sh +0 -0
  26. package/dist/host/scripts/ollama.sh +0 -0
  27. package/dist/host/tests/config.test.ts +5 -0
  28. package/dist/host/tests/setupPolicy.ts +1 -0
  29. package/dist/src/core/index.cjs +64 -24
  30. package/dist/src/core/index.cjs.map +1 -1
  31. package/dist/src/core/index.d.cts +17 -2
  32. package/dist/src/core/index.d.ts +17 -2
  33. package/dist/src/core/index.js +64 -25
  34. package/dist/src/core/index.js.map +1 -1
  35. package/package.json +13 -13
@@ -336,61 +336,62 @@ The safe JSON surface keeps text parsing lazy: `parseJSON` returns `unknown`, wh
336
336
  | ---------------------- | ----- | --------------- | --------------------------------------------------------------------------------------------- |
337
337
  | `CONTRACT_ERROR_BRAND` | const | `unique symbol` | Holds the registry-global key used to recognize `ContractError` values across package copies. |
338
338
 
339
- | Name | Kind | Signature | Summary |
340
- | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
341
- | `success` | function | `<T>(value: T) => Success<T>` | Boxes a value as the `Success` branch of a `Result`. |
342
- | `failure` | function | `<E>(error: E) => Failure<E>` | Boxes an error as the `Failure` branch of a `Result`. |
343
- | `isSuccess` | function | `<T, E>(result: Result<T, E>) => result is Success<T>` | Narrows a `Result` to its `Success` branch. |
344
- | `isFailure` | function | `<T, E>(result: Result<T, E>) => result is Failure<E>` | Narrows a `Result` to its `Failure` branch. |
345
- | `attempt` | function | `<T>(callback: () => T) => Result<T>` | Invokes a callback once and synchronously captures its exact outcome as a `Result`. |
346
- | `settle` | function | `<T>(callback: () => T \| PromiseLike<T>) => Promise<Result<T>>` | Settles a callback's outcome, synchronous or awaited, as a `Result`. |
347
- | `errorToMessage` | function | `(error: unknown) => string` | Renders a thrown value as a non-empty message. |
348
- | `INTRINSICS` | const | `Readonly<{ freeze: { <T extends Function>(f: T): T; <T extends { [idx: string]: U \| null \| undefined \| object; }, U extends string \| bigint \| number \| boolean \| symbol>(o: T): Readonly<T>; <T>(o: T): Readonly<T>; }; frozen: (o: any) => boolean; keys: { (o: object): string[]; (o: {}): string[]; }; values: { <T>(o: { [s: string]: T; } \| ArrayLike<T>): T[]; (o: {}): any[]; }; own: (o: object, v: PropertyKey) => boolean; same: (value1: any, value2: any) => boolean; create: { (o: object \| null): any; (o: object \| null, properties: PropertyDescriptorMap & ThisType<any>): any; }; proxy: ProxyConstructor; describe: (o: any, p: PropertyKey) => PropertyDescriptor \| undefined; define: <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T; definitions: <T>(o: T, properties: PropertyDescriptorMap & ThisType<any>) => T; prototype: (o: any) => any; symbols: (o: any) => symbol[]; names: (o: any) => string[]; base: Object; reflect: Readonly<{ read: typeof Reflect.get; write: typeof Reflect.set; members: typeof Reflect.ownKeys; present: typeof Reflect.has; describe: typeof Reflect.getOwnPropertyDescriptor; define: typeof Reflect.defineProperty; prototype: typeof Reflect.getPrototypeOf; apply: typeof Reflect.apply; construct: typeof Reflect.construct; }>; finite: (number: unknown) => boolean; integer: (number: unknown) => boolean; safe: (number: unknown) => boolean; nan: (number: unknown) => boolean; array: (arg: any) => arg is any[]; stringify: { (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string \| number): string; (value: any, replacer?: (number \| string)[] \| null, space?: string \| number): string; }; decode: (text: string, reviver?: (this: any, key: string, value: any) => any) => any; floor: (x: number) => number; ceil: (x: number) => number; max: (...values: number[]) => number; min: (...values: number[]) => number; imul: (x: number, y: number) => number; text: StringConstructor; numeric: NumberConstructor; pattern: RegExpConstructor; captures: (string: string) => RegExpExecArray \| null; expression: (() => any) \| undefined; modifiers: (() => any) \| undefined; list: ArrayConstructor; order: (compareFn?: ((a: any, b: any) => number) \| undefined) => any[]; some: (predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any) => boolean; every: { <S extends any>(predicate: (value: any, index: number, array: any[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): boolean; }; find: (predicate: (value: any, index: number, obj: any[]) => unknown, thisArg?: any) => number; each: (callbackfn: (value: any, index: number, array: any[]) => void, thisArg?: any) => void; from: { <T>(arrayLike: ArrayLike<T>): T[]; <T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; <T>(iterable: Iterable<T> \| ArrayLike<T>): T[]; <T, U>(iterable: Iterable<T> \| ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; }; fold: { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }; reduce: { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number) => U, initialValue: U): U; }; select: { <S extends any>(predicate: (value: any, index: number, array: any[]) => value is S, thisArg?: any): S[]; (predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): any[]; }; project: <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]; expand: <U, This = undefined>(callback: (this: This, value: any, index: number, array: any[]) => U \| readonly U[], thisArg?: This \| undefined) => U[]; flip: () => any[]; iterator: () => ArrayIterator<any>; indices: () => ArrayIterator<number>; advance: any; slice: (start?: number, end?: number) => string; join: (separator?: string) => string; bind: (this: Function, thisArg: any, ...argArray: any[]) => any; record: { <T = any>(entries: Iterable<readonly [PropertyKey, T]>): { [k: string]: T; }; (entries: Iterable<readonly any[]>): any; }; rebase: (o: any, proto: object \| null) => any; map: MapConstructor; fetch: (key: any) => any; store: (key: any, value: any) => Map<any, any>; keyed: (key: any) => boolean; pairs: (callbackfn: (value: any, key: any, map: Map<any, any>) => void, thisArg?: any) => void; set: SetConstructor; union: <U>(other: ReadonlySetLike<U>) => Set<any>; member: (value: any) => boolean; admit: (value: any) => Set<any>; sweep: (callbackfn: (value: any, value2: any, set: Set<any>) => void, thisArg?: any) => void; remove: (value: any) => boolean; weakMap: WeakMapConstructor; recall: (key: WeakKey) => any; retain: (key: WeakKey, value: any) => WeakMap<WeakKey, any>; weakSet: WeakSetConstructor; tracked: (value: WeakKey) => boolean; track: (value: WeakKey) => WeakSet<WeakKey>; untrack: (value: WeakKey) => boolean; error: ErrorConstructor; date: DateConstructor; instant: () => number; now: () => number; }>` | Captures every host operation this package dispatches through, while this module evaluates. |
349
- | `contain` | function | `<T>(callback: () => T, door: string, options?: ContainOptions) => T` | Runs a public door's whole body and publishes only this package's error class. |
350
- | `appendEntries` | function | `<T>(target: T[], source: readonly T[]) => void` | Appends every element of one array onto another, by index. |
351
- | `limitEntries` | function | `<T>(entries: readonly T[], limit: number) => readonly T[]` | Takes at most `limit` leading elements of an array, by index. |
352
- | `comparePrimitives` | function | `<T extends string \| number>(left: T, right: T) => number` | Orders two primitive keys or indices ascending. |
353
- | `sortValues` | function | `<T extends string \| number>(values: readonly T[]) => readonly T[]` | Orders primitive keys or indices deterministically, on an owned copy, through the captured sort. |
354
- | `pathOf` | function | `(path: readonly string[], ...segments: ReadonlyArray<string \| undefined>) => readonly string[]` | Builds a diagnostic path from an existing path and further segments, without dispatching through array iteration. |
355
- | `readValue` | function | `<T>(callback: () => T, reader: string, options?: ReadValueOptions) => T` | Reads a value through the shared containment boundary or refuses it with the contract module's uniform read diagnostic. |
356
- | `collectArrayEntries` | function | `<T>(value: readonly T[]) => ArrayRead<T>` | Collects an array's entries through its reflected own-index population. |
357
- | `readArrayEntries` | function | `<T>(value: readonly T[]) => Result<ArrayRead<T>>` | Snapshots an array through its reflected own-index population. |
358
- | `readGuardShape` | function | `(shape: GuardsShape, optional: readonly string[] \| true \| undefined, reader: string) => GuardShapeRead` | Snapshots a guard shape and its optional-key mode for a shape combinator. |
359
- | `holds` | function | `(callback: () => boolean) => boolean` | Invokes a predicate through the sanctioned never-throw boundary. |
360
- | `enumerableKeys` | function | `(value: object) => readonly string[] \| undefined` | Snapshots an object's own enumerable string keys through a total boundary. |
361
- | `matchesEnumerableKeys` | function | `(value: object, keys: readonly string[]) => boolean` | Checks whether an object owns no key outside the enumerable string keys already read from it. |
362
- | `readOptions` | function | `<T extends object>(source: T \| undefined, keys: ReadonlyArray<keyof T & string>, builder: string, shape: string) => T \| undefined` | Validates and snapshots a shape-builder options record through every reflective operation the builder relies on. |
363
- | `refuseOptionKeys` | function | `(source: object \| undefined, keys: readonly string[], builder: string, shape: string) => void` | Refuses an options record that holds a key its builder does not read. |
364
- | `refuseValue` | function | `<T>(value: unknown, guard: Guard<T>, door: string, options: RefuseValueOptions) => asserts value is T` | Refuses a value that fails a guard with a located, uniform diagnostic, and narrows it when the guard holds. |
365
- | `drawRandom` | function | `(random: RandomFunction, shape: string) => number` | Draws and validates one generator random sample. |
366
- | `enumerableSymbolCount` | function | `(value: object) => number` | Counts the enumerable own-symbol keys on a value. |
367
- | `matchesJSONValue` | function | `(entry: unknown, ancestors: WeakSet<object>, budget?: { left: number; }) => entry is JSONValue` | Matches an unknown value against the recursive JSON value structure. |
368
- | `matchesRecordBrand` | function | `(value: unknown) => boolean` | Determines whether a value carries the plain-record brand, raising an untrusted prototype observation instead of answering it. |
369
- | `matchesJSONDepth` | function | `(value: unknown) => boolean` | Determines whether a readable value stays within the fixed JSON container-depth limit. |
370
- | `resolveField` | function | `(record: Readonly<Record<string, unknown>>, path: FieldPath) => unknown` | Resolves a (possibly nested) field value from a record by a key or key path. |
371
- | `seededRandom` | function | `(seed: number) => RandomFunction` | Builds a deterministic pseudo-random source seeded from a single number. |
372
- | `schemaToParameters` | function | `(schema: JSONSchema) => Readonly<Record<string, unknown>> \| undefined` | Narrows a compiled `JSONSchema` down to the open `Readonly<Record<string, unknown>>` shape tool definitions advertise as `parameters` — through the `isRecord` boundary guard, never an assertion, as `.claude/rules/patterns.md` § Validation and contracts requires. |
373
- | `schemaToObject` | function | `(schema: JSONSchema) => JSONSchema` | Wraps a non-object `JSONSchema` root in a single-property object schema, so an inferred primitive/array/union schema can flow into `schemaToParameters` as an MCP-compatible `inputSchema`. |
374
- | `collectMembers` | function | `(values: readonly unknown[]) => Set<unknown>` | Collects an array's entries into a membership collection this package owns. |
375
- | `matchesMember` | function | `(members: ReadonlySet<unknown>, value: unknown) => boolean` | Determines whether a value is a member of a collected vocabulary, by SameValueZero. |
376
- | `admitMember` | function | `(members: Set<unknown>, value: unknown) => void` | Collects one more member into a vocabulary that grows as a walk proceeds. |
377
- | `matchesVisited` | function | `(visited: WeakSet<object>, value: object) => boolean` | Determines whether an object is already on a traversal's active path. |
378
- | `admitVisited` | function | `(visited: WeakSet<object>, value: object) => void` | Records an object as entered on a traversal's active path. |
379
- | `omitVisited` | function | `(visited: WeakSet<object>, value: object) => void` | Records an object as exited from a traversal's active path. |
380
- | `retainDepth` | function | `<T>(memo: WeakMap<object, Map<number, T>>, node: object, depth: number, answer: T) => void` | Records one node's answer at one remaining-depth allowance in a shared memo. |
381
- | `collectEntries` | function | `(target: unknown[][]) => EntryCollectorFunction` | Builds the collector a captured `forEach` sweep appends through. |
382
- | `readSetEntries` | function | `(value: ReadonlySet<unknown>) => Result<readonly unknown[]>` | Snapshots the genuine contents of a caller's `Set` without running an iterator. |
383
- | `readMapEntries` | function | `(value: ReadonlyMap<unknown, unknown>) => Result<ReadonlyArray<readonly unknown[]>>` | Snapshots the genuine entries of a caller's `Map` without running an iterator. |
384
- | `matchesPattern` | function | `(pattern: RegExp, value: string) => boolean` | Determines whether a string is in the language of a pattern this package owns. |
385
- | `matchesStringLength` | function | `(value: string, min: number \| undefined, max: number \| undefined) => boolean` | Checks whether a string's length in code points falls within optional bounds. |
386
- | `computeSurrogatePairs` | function | `(value: string, limit: number) => number` | Counts the surrogate pairs in a string, stopping at a limit. |
387
- | `escapeRegExp` | function | `(value: string) => string` | Escapes every regular-expression metacharacter in a text, so the text matches literally inside a larger `RegExp` source. |
388
- | `readPatternSource` | function | `(pattern: unknown) => string \| undefined` | Reads a regular expression's source text through the captured accessor. |
389
- | `readPatternFlags` | function | `(pattern: unknown) => string \| undefined` | Reads a regular expression's flag text through the captured accessor. |
390
- | `readPattern` | function | `(pattern: RegExp) => RegExp` | Rebuilds a caller's regular expression as a stateless pattern this package owns. |
391
- | `ownPattern` | function | `(pattern: RegExp, reader: string) => RegExp` | Rebuilds a declaration's regular expression as a stateless pattern this package owns, and refuses an unreadable one under the reader's own name. |
392
- | `pinMembers` | function | `(prototype: object, owner: string) => void` | Pins every own member of a class prototype as a non-configurable member — non-writable too when it is a data property — and verify the pin took. |
393
- | `refuseExpansion` | function | `(expansion: number \| undefined) => void` | Refuses a validated declaration whose compiled expansion exceeds `COMPILE_NODE_LIMIT`. |
339
+ | Name | Kind | Signature | Summary |
340
+ | ----------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
341
+ | `success` | function | `<T>(value: T) => Success<T>` | Boxes a value as the `Success` branch of a `Result`. |
342
+ | `failure` | function | `<E>(error: E) => Failure<E>` | Boxes an error as the `Failure` branch of a `Result`. |
343
+ | `isSuccess` | function | `<T, E>(result: Result<T, E>) => result is Success<T>` | Narrows a `Result` to its `Success` branch. |
344
+ | `isFailure` | function | `<T, E>(result: Result<T, E>) => result is Failure<E>` | Narrows a `Result` to its `Failure` branch. |
345
+ | `attempt` | function | `<T>(callback: () => T) => Result<T>` | Invokes a callback once and synchronously captures its exact outcome as a `Result`. |
346
+ | `settle` | function | `<T>(callback: () => T \| PromiseLike<T>) => Promise<Result<T>>` | Settles a callback's outcome, synchronous or awaited, as a `Result`. |
347
+ | `errorToMessage` | function | `(error: unknown) => string` | Renders a thrown value as a non-empty message. |
348
+ | `INTRINSICS` | const | `Readonly<{ freeze: { <T extends Function>(f: T): T; <T extends { [idx: string]: U \| null \| undefined \| object; }, U extends string \| bigint \| number \| boolean \| symbol>(o: T): Readonly<T>; <T>(o: T): Readonly<T>; }; frozen: (o: any) => boolean; keys: { (o: object): string[]; (o: {}): string[]; }; values: { <T>(o: { [s: string]: T; } \| ArrayLike<T>): T[]; (o: {}): any[]; }; own: (o: object, v: PropertyKey) => boolean; same: (value1: any, value2: any) => boolean; create: { (o: object \| null): any; (o: object \| null, properties: PropertyDescriptorMap & ThisType<any>): any; }; proxy: ProxyConstructor; describe: (o: any, p: PropertyKey) => PropertyDescriptor \| undefined; define: <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T; definitions: <T>(o: T, properties: PropertyDescriptorMap & ThisType<any>) => T; prototype: (o: any) => any; symbols: (o: any) => symbol[]; names: (o: any) => string[]; base: Object; reflect: Readonly<{ read: typeof Reflect.get; write: typeof Reflect.set; members: typeof Reflect.ownKeys; present: typeof Reflect.has; describe: typeof Reflect.getOwnPropertyDescriptor; define: typeof Reflect.defineProperty; prototype: typeof Reflect.getPrototypeOf; apply: typeof Reflect.apply; construct: typeof Reflect.construct; }>; finite: (number: unknown) => boolean; integer: (number: unknown) => boolean; safe: (number: unknown) => boolean; nan: (number: unknown) => boolean; array: (arg: any) => arg is any[]; stringify: { (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string \| number): string; (value: any, replacer?: (number \| string)[] \| null, space?: string \| number): string; }; decode: (text: string, reviver?: (this: any, key: string, value: any) => any) => any; floor: (x: number) => number; ceil: (x: number) => number; max: (...values: number[]) => number; min: (...values: number[]) => number; imul: (x: number, y: number) => number; text: StringConstructor; numeric: NumberConstructor; pattern: RegExpConstructor; captures: (string: string) => RegExpExecArray \| null; expression: (() => any) \| undefined; modifiers: (() => any) \| undefined; list: ArrayConstructor; order: (compareFn?: ((a: any, b: any) => number) \| undefined) => any[]; some: (predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any) => boolean; every: { <S extends any>(predicate: (value: any, index: number, array: any[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): boolean; }; find: (predicate: (value: any, index: number, obj: any[]) => unknown, thisArg?: any) => number; each: (callbackfn: (value: any, index: number, array: any[]) => void, thisArg?: any) => void; from: { <T>(arrayLike: ArrayLike<T>): T[]; <T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; <T>(iterable: Iterable<T> \| ArrayLike<T>): T[]; <T, U>(iterable: Iterable<T> \| ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; }; fold: { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }; reduce: { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number) => U, initialValue: U): U; }; select: { <S extends any>(predicate: (value: any, index: number, array: any[]) => value is S, thisArg?: any): S[]; (predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): any[]; }; project: <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]; expand: <U, This = undefined>(callback: (this: This, value: any, index: number, array: any[]) => U \| readonly U[], thisArg?: This \| undefined) => U[]; flip: () => any[]; iterator: () => ArrayIterator<any>; indices: () => ArrayIterator<number>; advance: any; slice: (start?: number, end?: number) => string; join: (separator?: string) => string; bind: (this: Function, thisArg: any, ...argArray: any[]) => any; record: { <T = any>(entries: Iterable<readonly [PropertyKey, T]>): { [k: string]: T; }; (entries: Iterable<readonly any[]>): any; }; rebase: (o: any, proto: object \| null) => any; map: MapConstructor; fetch: (key: any) => any; store: (key: any, value: any) => Map<any, any>; keyed: (key: any) => boolean; pairs: (callbackfn: (value: any, key: any, map: Map<any, any>) => void, thisArg?: any) => void; set: SetConstructor; union: <U>(other: ReadonlySetLike<U>) => Set<any>; member: (value: any) => boolean; admit: (value: any) => Set<any>; sweep: (callbackfn: (value: any, value2: any, set: Set<any>) => void, thisArg?: any) => void; remove: (value: any) => boolean; count: (() => any) \| undefined; cursor: () => SetIterator<any>; step: any; weakMap: WeakMapConstructor; recall: (key: WeakKey) => any; retain: (key: WeakKey, value: any) => WeakMap<WeakKey, any>; weakSet: WeakSetConstructor; tracked: (value: WeakKey) => boolean; track: (value: WeakKey) => WeakSet<WeakKey>; untrack: (value: WeakKey) => boolean; error: ErrorConstructor; date: DateConstructor; instant: () => number; now: () => number; }>` | Captures every host operation this package dispatches through, while this module evaluates. |
349
+ | `contain` | function | `<T>(callback: () => T, door: string, options?: ContainOptions) => T` | Runs a public door's whole body and publishes only this package's error class. |
350
+ | `appendEntries` | function | `<T>(target: T[], source: readonly T[]) => void` | Appends every element of one array onto another, by index. |
351
+ | `limitEntries` | function | `<T>(entries: readonly T[], limit: number) => readonly T[]` | Takes at most `limit` leading elements of an array, by index. |
352
+ | `comparePrimitives` | function | `<T extends string \| number>(left: T, right: T) => number` | Orders two primitive keys or indices ascending. |
353
+ | `sortValues` | function | `<T extends string \| number>(values: readonly T[]) => readonly T[]` | Orders primitive keys or indices deterministically, on an owned copy, through the captured sort. |
354
+ | `pathOf` | function | `(path: readonly string[], ...segments: ReadonlyArray<string \| undefined>) => readonly string[]` | Builds a diagnostic path from an existing path and further segments, without dispatching through array iteration. |
355
+ | `buildChildPath` | function | `(path: readonly string[], key: string) => readonly string[]` | Builds a child's path from a dense path this package built and the child's key, without dispatching through array iteration. |
356
+ | `readValue` | function | `<T>(callback: () => T, reader: string, options?: ReadValueOptions) => T` | Reads a value through the shared containment boundary or refuses it with the contract module's uniform read diagnostic. |
357
+ | `collectArrayEntries` | function | `<T>(value: readonly T[]) => ArrayRead<T>` | Collects an array's entries through its reflected own-index population. |
358
+ | `readArrayEntries` | function | `<T>(value: readonly T[]) => Result<ArrayRead<T>>` | Snapshots an array through its reflected own-index population. |
359
+ | `readGuardShape` | function | `(shape: GuardsShape, optional: readonly string[] \| true \| undefined, reader: string) => GuardShapeRead` | Snapshots a guard shape and its optional-key mode for a shape combinator. |
360
+ | `holds` | function | `(callback: () => boolean) => boolean` | Invokes a predicate through the sanctioned never-throw boundary. |
361
+ | `enumerableKeys` | function | `(value: object) => readonly string[] \| undefined` | Snapshots an object's own enumerable string keys through a total boundary. |
362
+ | `matchesEnumerableKeys` | function | `(value: object, keys: readonly string[]) => boolean` | Checks whether an object owns no key outside the enumerable string keys already read from it. |
363
+ | `readOptions` | function | `<T extends object>(source: T \| undefined, keys: ReadonlyArray<keyof T & string>, builder: string, shape: string) => T \| undefined` | Validates and snapshots a shape-builder options record through every reflective operation the builder relies on. |
364
+ | `refuseOptionKeys` | function | `(source: object \| undefined, keys: readonly string[], builder: string, shape: string) => void` | Refuses an options record that holds a key its builder does not read. |
365
+ | `refuseValue` | function | `<T>(value: unknown, guard: Guard<T>, door: string, options: RefuseValueOptions) => asserts value is T` | Refuses a value that fails a guard with a located, uniform diagnostic, and narrows it when the guard holds. |
366
+ | `drawRandom` | function | `(random: RandomFunction, shape: string) => number` | Draws and validates one generator random sample. |
367
+ | `enumerableSymbolCount` | function | `(value: object) => number` | Counts the enumerable own-symbol keys on a value. |
368
+ | `matchesJSONValue` | function | `(entry: unknown, ancestors: WeakSet<object>, budget?: { left: number; }) => entry is JSONValue` | Matches an unknown value against the recursive JSON value structure. |
369
+ | `matchesRecordBrand` | function | `(value: unknown) => boolean` | Determines whether a value carries the plain-record brand, raising an untrusted prototype observation instead of answering it. |
370
+ | `matchesJSONDepth` | function | `(value: unknown) => boolean` | Determines whether a readable value stays within the fixed JSON container-depth limit. |
371
+ | `resolveField` | function | `(record: Readonly<Record<string, unknown>>, path: FieldPath) => unknown` | Resolves a (possibly nested) field value from a record by a key or key path. |
372
+ | `seededRandom` | function | `(seed: number) => RandomFunction` | Builds a deterministic pseudo-random source seeded from a single number. |
373
+ | `schemaToParameters` | function | `(schema: JSONSchema) => Readonly<Record<string, unknown>> \| undefined` | Narrows a compiled `JSONSchema` down to the open `Readonly<Record<string, unknown>>` shape tool definitions advertise as `parameters` — through the `isRecord` boundary guard, never an assertion, as `.claude/rules/patterns.md` § Validation and contracts requires. |
374
+ | `schemaToObject` | function | `(schema: JSONSchema) => JSONSchema` | Wraps a non-object `JSONSchema` root in a single-property object schema, so an inferred primitive/array/union schema can flow into `schemaToParameters` as an MCP-compatible `inputSchema`. |
375
+ | `collectMembers` | function | `(values: readonly unknown[]) => Set<unknown>` | Collects an array's entries into a membership collection this package owns. |
376
+ | `matchesMember` | function | `(members: ReadonlySet<unknown>, value: unknown) => boolean` | Determines whether a value is a member of a collected vocabulary, by SameValueZero. |
377
+ | `admitMember` | function | `(members: Set<unknown>, value: unknown) => void` | Collects one more member into a vocabulary that grows as a walk proceeds. |
378
+ | `matchesVisited` | function | `(visited: WeakSet<object>, value: object) => boolean` | Determines whether an object is already on a traversal's active path. |
379
+ | `admitVisited` | function | `(visited: WeakSet<object>, value: object) => void` | Records an object as entered on a traversal's active path. |
380
+ | `omitVisited` | function | `(visited: WeakSet<object>, value: object) => void` | Records an object as exited from a traversal's active path. |
381
+ | `retainDepth` | function | `<T>(memo: WeakMap<object, Map<number, T>>, node: object, depth: number, answer: T) => void` | Records one node's answer at one remaining-depth allowance in a shared memo. |
382
+ | `collectEntries` | function | `(target: unknown[][]) => EntryCollectorFunction` | Builds the collector a captured `forEach` sweep appends through. |
383
+ | `readSetEntries` | function | `(value: ReadonlySet<unknown>) => Result<readonly unknown[]>` | Snapshots the genuine contents of a caller's `Set` without running an iterator. |
384
+ | `readMapEntries` | function | `(value: ReadonlyMap<unknown, unknown>) => Result<ReadonlyArray<readonly unknown[]>>` | Snapshots the genuine entries of a caller's `Map` without running an iterator. |
385
+ | `matchesPattern` | function | `(pattern: RegExp, value: string) => boolean` | Determines whether a string is in the language of a pattern this package owns. |
386
+ | `matchesStringLength` | function | `(value: string, min: number \| undefined, max: number \| undefined) => boolean` | Checks whether a string's length in code points falls within optional bounds. |
387
+ | `computeSurrogatePairs` | function | `(value: string, limit: number) => number` | Counts the surrogate pairs in a string, stopping at a limit. |
388
+ | `escapeRegExp` | function | `(value: string) => string` | Escapes every regular-expression metacharacter in a text, so the text matches literally inside a larger `RegExp` source. |
389
+ | `readPatternSource` | function | `(pattern: unknown) => string \| undefined` | Reads a regular expression's source text through the captured accessor. |
390
+ | `readPatternFlags` | function | `(pattern: unknown) => string \| undefined` | Reads a regular expression's flag text through the captured accessor. |
391
+ | `readPattern` | function | `(pattern: RegExp) => RegExp` | Rebuilds a caller's regular expression as a stateless pattern this package owns. |
392
+ | `ownPattern` | function | `(pattern: RegExp, reader: string) => RegExp` | Rebuilds a declaration's regular expression as a stateless pattern this package owns, and refuses an unreadable one under the reader's own name. |
393
+ | `pinMembers` | function | `(prototype: object, owner: string) => void` | Pins every own member of a class prototype as a non-configurable member — non-writable too when it is a data property — and verify the pin took. |
394
+ | `refuseExpansion` | function | `(expansion: number \| undefined) => void` | Refuses a validated declaration whose compiled expansion exceeds `COMPILE_NODE_LIMIT`. |
394
395
 
395
396
  | Name | Kind | Signature | Summary |
396
397
  | -------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
@@ -402,7 +403,7 @@ The safe JSON surface keeps text parsing lazy: `parseJSON` returns `unknown`, wh
402
403
  | `buildPositions` | function | `(names: readonly string[]) => Readonly<Record<string, number>>` | Builds a null-prototype lookup from names to their last index. |
403
404
  | `readPresence` | function | `(names: readonly string[], positions: Readonly<Record<string, number>>) => number` | Derives the bit mask of names present in an indexed lookup. |
404
405
  | `LengthReader` | type | `() => number` | Reads the current upper bound of an indexed walk. |
405
- | `EvaluationFunction` | type | `(value: unknown, path: readonly string[]) => T` | Evaluates a compiled node at one diagnostic path. |
406
+ | `EvaluationFunction` | type | `(value: unknown, path: readonly string[], built?: boolean) => T` | Evaluates a compiled node at one diagnostic path. |
406
407
  | `parseEnumValues` | function | `<const T extends LiteralValue>(values: readonly unknown[], allowed: readonly T[]) => Generator<T \| undefined, void, unknown>` | Parses indexed enum members, ending after the first undefined result. |
407
408
  | `readIndexView` | function | `(values: readonly unknown[]) => object` | Exposes indexed reads through a non-array receiver without species dispatch. |
408
409
 
@@ -789,7 +790,7 @@ Turn one `ContractShape` into the six lockstep outputs — `schema` / `is` / `pa
789
790
  | `matchesStepKey` | function | `(this: readonly string[], step: KeyStep, index: number) => boolean` | Checks whether a key-plan step names the key at its index in the list bound as `this`. |
790
791
  | `matchesStepGuard` | function | `(this: Readonly<Record<string, unknown>>, step: KeyStep) => boolean` | Checks whether the member of the record bound as `this` passes a key-plan step's guard. |
791
792
 
792
- A compiled closed-object guard keeps the plans of the key orders it accepts until it holds `KEY_PLAN_LIMIT` plans, and answers every other key order through the full walk. A plan is one `KeyStep` entry per key, in the order the value listed its own enumerable keys, and the `buildKeyPlan` helper builds it after a walk that accepted. Every call counts the value's own names and symbols first, on a hit as on a miss, because that check runs before the guard looks for a kept plan. A later value whose keys arrive in a kept order is answered by asking each step's guard in turn, through the captured `every` member with the `matchesStepGuard` predicate and the value as the `thisArg` argument; the `matchesKeyPlan` and `matchesStepKey` predicates find the kept plan the same way. The guard learns nothing from a refused call and never evicts a plan, so the kept plans are those of the earliest accepted key orders; both paths read the same members in the same order and answer alike, and only the cost differs. A tail-shaped object keeps no plans, because a dictionary's key list is data: it takes the full walk and the own-key count on every call.
793
+ A compiled closed-object guard keeps the plans of the key orders it accepts until it holds `KEY_PLAN_LIMIT` plans, and answers every other key order through the full walk. A plan is one `KeyStep` entry per key, in the order the value listed its own enumerable keys, and the `buildKeyPlan` helper builds it after a walk that accepted. Every call counts the value's own names and symbols first, on a hit as on a miss, because that check runs before the guard looks for a kept plan. A later value whose keys arrive in a kept order is answered by asking each step's guard in turn, in plan order, until the first refusal; the `matchesKeyPlan` predicate finds the kept plan by comparing each step's key with the key at its index, skipping a hole as the captured `every` member does. The `matchesStepGuard` and `matchesStepKey` predicates answer one step of each walk for a caller that passes them to `every` with the value or the key list as the `thisArg` argument. The guard learns nothing from a refused call and never evicts a plan, so the kept plans are those of the earliest accepted key orders; both paths read the same members in the same order and answer alike, and only the cost differs. A tail-shaped object keeps no plans, because a dictionary's key list is data: it takes the full walk and the own-key count on every call.
793
794
 
794
795
  `ContractCompilerInterface` declares no call-signature member, so it has no Methods table: its
795
796
  whole surface is the readonly data properties — `schema` (a `JSONSchema`), `guard` (a