@rcrsr/rill 0.16.0 → 0.17.0

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 (57) hide show
  1. package/README.md +37 -21
  2. package/dist/ext/crypto/index.d.ts +3 -3
  3. package/dist/ext/crypto/index.js +61 -58
  4. package/dist/ext/exec/index.d.ts +3 -3
  5. package/dist/ext/exec/index.js +14 -8
  6. package/dist/ext/fetch/index.d.ts +3 -3
  7. package/dist/ext/fetch/index.js +16 -11
  8. package/dist/ext/fs/index.d.ts +3 -3
  9. package/dist/ext/fs/index.js +242 -239
  10. package/dist/ext/kv/index.d.ts +3 -3
  11. package/dist/ext/kv/index.js +197 -195
  12. package/dist/ext/kv/store.js +2 -1
  13. package/dist/ext-parse-bridge.d.ts +10 -0
  14. package/dist/ext-parse-bridge.js +10 -0
  15. package/dist/generated/introspection-data.d.ts +1 -1
  16. package/dist/generated/introspection-data.js +385 -296
  17. package/dist/generated/version-data.d.ts +1 -1
  18. package/dist/generated/version-data.js +2 -2
  19. package/dist/index.d.ts +15 -4
  20. package/dist/index.js +14 -5
  21. package/dist/parser/parser-types.js +12 -0
  22. package/dist/parser/parser-use.js +7 -1
  23. package/dist/runtime/core/callable.d.ts +20 -8
  24. package/dist/runtime/core/callable.js +63 -23
  25. package/dist/runtime/core/context.d.ts +0 -11
  26. package/dist/runtime/core/context.js +76 -75
  27. package/dist/runtime/core/eval/index.d.ts +2 -2
  28. package/dist/runtime/core/eval/index.js +11 -0
  29. package/dist/runtime/core/eval/mixins/closures.js +15 -15
  30. package/dist/runtime/core/eval/mixins/conversion.js +51 -110
  31. package/dist/runtime/core/eval/mixins/core.js +2 -2
  32. package/dist/runtime/core/eval/mixins/expressions.js +35 -27
  33. package/dist/runtime/core/eval/mixins/literals.js +3 -3
  34. package/dist/runtime/core/eval/mixins/types.js +44 -54
  35. package/dist/runtime/core/eval/mixins/variables.js +10 -8
  36. package/dist/runtime/core/field-descriptor.d.ts +3 -3
  37. package/dist/runtime/core/field-descriptor.js +2 -1
  38. package/dist/runtime/core/introspection.js +6 -6
  39. package/dist/runtime/core/markers.d.ts +12 -0
  40. package/dist/runtime/core/markers.js +7 -0
  41. package/dist/runtime/core/type-registrations.d.ts +136 -0
  42. package/dist/runtime/core/type-registrations.js +749 -0
  43. package/dist/runtime/core/type-structures.d.ts +128 -0
  44. package/dist/runtime/core/type-structures.js +12 -0
  45. package/dist/runtime/core/types.d.ts +15 -3
  46. package/dist/runtime/core/values.d.ts +62 -153
  47. package/dist/runtime/core/values.js +308 -524
  48. package/dist/runtime/ext/builtins.js +83 -64
  49. package/dist/runtime/ext/extensions.d.ts +30 -124
  50. package/dist/runtime/ext/extensions.js +0 -93
  51. package/dist/runtime/ext/test-context.d.ts +28 -0
  52. package/dist/runtime/ext/test-context.js +154 -0
  53. package/dist/runtime/index.d.ts +22 -8
  54. package/dist/runtime/index.js +18 -4
  55. package/dist/signature-parser.d.ts +2 -2
  56. package/dist/signature-parser.js +14 -14
  57. package/package.json +1 -1
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Type Structure Definitions
3
+ *
4
+ * Defines the TypeStructure union (discriminated by `.kind`) and
5
+ * associated value interfaces. These types form the foundation for
6
+ * the type registration and dispatch system.
7
+ *
8
+ * The TypeStructure union mirrors the existing RillType union but uses
9
+ * `.kind` as its discriminator instead of `.type`, enabling future
10
+ * coexistence during migration.
11
+ */
12
+ import type { RillTypeName } from '../../types.js';
13
+ import type { CallableMarker, FieldDescriptorMarker } from './markers.js';
14
+ /**
15
+ * Field definition - describes a single field in a structural type.
16
+ * Used by dict, tuple, ordered, and closure type descriptors.
17
+ * Default detection: `field.defaultValue !== undefined`.
18
+ *
19
+ * Uses TypeStructure (not RillType) for the field's type descriptor.
20
+ */
21
+ export interface RillFieldDef {
22
+ name?: string | undefined;
23
+ type: TypeStructure;
24
+ defaultValue?: RillValue | undefined;
25
+ }
26
+ /**
27
+ * Structural type descriptor - describes the shape of a value in the type system.
28
+ * Discriminated by `.kind` (not `.type`).
29
+ *
30
+ * Includes all 12 built-in variants plus a catch-all for types without
31
+ * parameterized structure (e.g. iterator).
32
+ */
33
+ export type TypeStructure = {
34
+ kind: 'number';
35
+ } | {
36
+ kind: 'string';
37
+ } | {
38
+ kind: 'bool';
39
+ } | {
40
+ kind: 'vector';
41
+ } | {
42
+ kind: 'type';
43
+ } | {
44
+ kind: 'any';
45
+ } | {
46
+ kind: 'dict';
47
+ fields?: Record<string, RillFieldDef> | undefined;
48
+ valueType?: TypeStructure | undefined;
49
+ } | {
50
+ kind: 'list';
51
+ element?: TypeStructure | undefined;
52
+ } | {
53
+ kind: 'closure';
54
+ params?: RillFieldDef[] | undefined;
55
+ ret?: TypeStructure | undefined;
56
+ } | {
57
+ kind: 'tuple';
58
+ elements?: RillFieldDef[] | undefined;
59
+ valueType?: TypeStructure | undefined;
60
+ } | {
61
+ kind: 'ordered';
62
+ fields?: RillFieldDef[] | undefined;
63
+ valueType?: TypeStructure | undefined;
64
+ } | {
65
+ kind: 'union';
66
+ members: TypeStructure[];
67
+ } | {
68
+ kind: 'iterator';
69
+ } | {
70
+ kind: string;
71
+ data?: unknown;
72
+ };
73
+ /**
74
+ * Tuple type - represents positional unpacked arguments for closure invocation.
75
+ * Created by the * (spread) operator from lists.
76
+ * Entries are positional only.
77
+ *
78
+ * Note: In Rill, "tuple" refers to fixed-size argument packing (like function signatures),
79
+ * while "list" refers to dynamic ordered collections ([1, 2, 3]).
80
+ */
81
+ export interface RillTuple {
82
+ readonly __rill_tuple: true;
83
+ readonly entries: RillValue[];
84
+ }
85
+ /**
86
+ * Ordered type - represents named key-value pairs with preserved insertion order.
87
+ * Created by the * (spread) operator from dicts.
88
+ * Entries may carry an optional third element (default value) when representing
89
+ * closure parameter reflection via `.^input`.
90
+ */
91
+ export interface RillOrdered {
92
+ readonly __rill_ordered: true;
93
+ readonly entries: [string, RillValue, RillValue?][];
94
+ }
95
+ /**
96
+ * Vector type - represents dense numeric embeddings.
97
+ * Immutable Float32Array with associated model name.
98
+ */
99
+ export interface RillVector {
100
+ readonly __rill_vector: true;
101
+ readonly data: Float32Array;
102
+ readonly model: string;
103
+ }
104
+ /**
105
+ * Type value - represents a first-class type name at runtime.
106
+ * Created when a type name expression (e.g. `string`, `number`) is evaluated.
107
+ */
108
+ export interface RillTypeValue {
109
+ readonly __rill_type: true;
110
+ readonly typeName: RillTypeName;
111
+ readonly structure: TypeStructure;
112
+ }
113
+ /**
114
+ * Iterator type - represents a lazy sequence.
115
+ * An iterator is a dict with:
116
+ * - done: boolean - whether iteration is complete
117
+ * - next: callable - function to get next iterator
118
+ * - value?: any - current value (absent when done)
119
+ */
120
+ export interface RillIterator extends Record<string, RillValue> {
121
+ readonly done: boolean;
122
+ readonly next: CallableMarker;
123
+ readonly value?: RillValue;
124
+ }
125
+ /** Any value that can flow through Rill */
126
+ export type RillValue = string | number | boolean | null | RillValue[] | {
127
+ [key: string]: RillValue;
128
+ } | CallableMarker | RillTuple | RillOrdered | RillVector | FieldDescriptorMarker | RillTypeValue;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Type Structure Definitions
3
+ *
4
+ * Defines the TypeStructure union (discriminated by `.kind`) and
5
+ * associated value interfaces. These types form the foundation for
6
+ * the type registration and dispatch system.
7
+ *
8
+ * The TypeStructure union mirrors the existing RillType union but uses
9
+ * `.kind` as its discriminator instead of `.type`, enabling future
10
+ * coexistence during migration.
11
+ */
12
+ export {};
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import type { RillTypeName } from '../../types.js';
8
8
  import type { CallableFn, RillFunction } from './callable.js';
9
- import type { RillType, RillValue } from './values.js';
9
+ import type { TypeStructure, RillValue } from './values.js';
10
10
  export type { NativeArray, NativePlainObject, NativeValue } from './values.js';
11
11
  /** I/O callbacks for runtime operations */
12
12
  export interface RuntimeCallbacks {
@@ -119,7 +119,7 @@ export interface RuntimeContext {
119
119
  /** Named variables ($varname) - local to this scope */
120
120
  readonly variables: Map<string, RillValue>;
121
121
  /** Variable types - locked after first assignment (local to this scope) */
122
- readonly variableTypes: Map<string, RillTypeName | RillType>;
122
+ readonly variableTypes: Map<string, RillTypeName | TypeStructure>;
123
123
  /** Built-in and user-defined functions (CallableFn for untyped, ApplicationCallable for typed) */
124
124
  readonly functions: Map<string, CallableFn | import('./callable.js').ApplicationCallable>;
125
125
  /** I/O callbacks */
@@ -158,9 +158,21 @@ export interface RuntimeContext {
158
158
  /**
159
159
  * Per-type method dictionaries: maps type name to a frozen dict of ApplicationCallable values.
160
160
  * Keys: "string", "list", "dict", "number", "bool", "vector".
161
- * Populated at context creation from BUILTIN_METHODS; propagated to child contexts.
161
+ * Populated at context creation from type registrations; propagated to child contexts.
162
162
  */
163
163
  readonly typeMethodDicts: ReadonlyMap<string, Readonly<Record<string, RillValue>>>;
164
+ /**
165
+ * Type names that reject type arguments in type constructors.
166
+ * Derived from BUILT_IN_TYPES registrations where isLeaf === true, plus 'any'.
167
+ * Used by type assertion/check evaluation to reject e.g. string(number).
168
+ */
169
+ readonly leafTypes: ReadonlySet<string>;
170
+ /**
171
+ * Method names that handle their own receiver type checking with specific
172
+ * error messages. Generic RILL-R003 must not fire before the method body runs.
173
+ * Derived from registration method dicts at context creation.
174
+ */
175
+ readonly unvalidatedMethodReceivers: ReadonlySet<string>;
164
176
  /** Scheme-to-resolver map, populated from RuntimeOptions.resolvers (empty Map when absent) */
165
177
  readonly resolvers: ReadonlyMap<string, SchemeResolver>;
166
178
  /** Per-scheme config data, populated from RuntimeOptions.configurations.resolvers (empty Map when absent) */
@@ -3,111 +3,30 @@
3
3
  *
4
4
  * Core value types that flow through Rill programs.
5
5
  * Public API for host applications.
6
- */
7
- import type { RillTypeName } from '../../types.js';
8
- interface CallableMarker {
9
- readonly __type: 'callable';
10
- }
11
- interface FieldDescriptorMarker {
12
- readonly __rill_field_descriptor: true;
13
- }
14
- /**
15
- * Tuple type - represents positional unpacked arguments for closure invocation.
16
- * Created by the * (spread) operator from lists.
17
- * Entries are positional only.
18
6
  *
19
- * Note: In Rill, "tuple" refers to fixed-size argument packing (like function signatures),
20
- * while "list" refers to dynamic ordered collections ([1, 2, 3]).
7
+ * Dispatch functions (inferType, formatValue, deepEquals, serializeValue,
8
+ * copyValue) re-export from type-registrations.ts protocol implementations.
21
9
  */
22
- export interface RillTuple {
23
- readonly __rill_tuple: true;
24
- readonly entries: RillValue[];
25
- }
26
- /**
27
- * Ordered type - represents named key-value pairs with preserved insertion order.
28
- * Created by the * (spread) operator from dicts.
29
- * Entries may carry an optional third element (default value) when representing
30
- * closure parameter reflection via `.^input`.
31
- */
32
- export interface RillOrdered {
33
- readonly __rill_ordered: true;
34
- readonly entries: [string, RillValue, RillValue?][];
35
- }
36
- /**
37
- * Vector type - represents dense numeric embeddings.
38
- * Immutable Float32Array with associated model name.
39
- */
40
- export interface RillVector {
41
- readonly __rill_vector: true;
42
- readonly data: Float32Array;
43
- readonly model: string;
44
- }
45
- /**
46
- * Field definition - describes a single field in a structural type.
47
- * Used by dict, tuple, ordered, and closure type descriptors.
48
- * Default detection: `field.defaultValue !== undefined`.
49
- */
50
- export interface RillFieldDef {
51
- name?: string;
52
- type: RillType;
53
- defaultValue?: RillValue;
54
- }
55
- /**
56
- * Structural type descriptor - describes the shape of a value in the type system.
57
- * Used by RillTypeValue to carry type structure information at runtime.
58
- */
59
- export type RillType = {
60
- type: 'number';
61
- } | {
62
- type: 'string';
63
- } | {
64
- type: 'bool';
65
- } | {
66
- type: 'vector';
67
- } | {
68
- type: 'type';
69
- } | {
70
- type: 'any';
71
- } | {
72
- type: 'dict';
10
+ import type { RillTypeName } from '../../types.js';
11
+ import type { RillFieldDef, RillIterator, RillOrdered, RillTuple, RillTypeValue, RillValue, RillVector, TypeStructure } from './type-structures.js';
12
+ export type { RillFieldDef, RillIterator, RillOrdered, RillTuple, RillTypeValue, RillValue, RillVector, TypeStructure, };
13
+ export type DictStructure = {
14
+ kind: 'dict';
73
15
  fields?: Record<string, RillFieldDef>;
74
- valueType?: RillType;
75
- } | {
76
- type: 'list';
77
- element?: RillType;
78
- } | {
79
- type: 'closure';
80
- params?: RillFieldDef[];
81
- ret?: RillType;
82
- } | {
83
- type: 'tuple';
16
+ valueType?: TypeStructure;
17
+ };
18
+ export type TupleStructure = {
19
+ kind: 'tuple';
84
20
  elements?: RillFieldDef[];
85
- valueType?: RillType;
86
- } | {
87
- type: 'ordered';
21
+ valueType?: TypeStructure;
22
+ };
23
+ export type OrderedStructure = {
24
+ kind: 'ordered';
88
25
  fields?: RillFieldDef[];
89
- valueType?: RillType;
90
- } | {
91
- type: 'union';
92
- members: RillType[];
26
+ valueType?: TypeStructure;
93
27
  };
94
- /**
95
- * @deprecated Use RillType instead. Will be removed in the next major version.
96
- */
97
- export type RillStructuralType = RillType;
98
- /**
99
- * Type value - represents a first-class type name at runtime.
100
- * Created when a type name expression (e.g. `string`, `number`) is evaluated.
101
- */
102
- export interface RillTypeValue {
103
- readonly __rill_type: true;
104
- readonly typeName: RillTypeName;
105
- readonly structure: RillType;
106
- }
107
- /** Any value that can flow through Rill */
108
- export type RillValue = string | number | boolean | null | RillValue[] | {
109
- [key: string]: RillValue;
110
- } | CallableMarker | RillTuple | RillOrdered | RillVector | FieldDescriptorMarker | RillTypeValue;
28
+ /** @deprecated Use TypeStructure instead. */
29
+ export type RillType = TypeStructure;
111
30
  /** Type guard for RillTuple (spread args) */
112
31
  export declare function isTuple(value: RillValue): value is RillTuple;
113
32
  /** Type guard for RillVector */
@@ -129,40 +48,48 @@ export declare function createTuple(entries: RillValue[]): RillTuple;
129
48
  * @throws {Error} if data.length is 0 (zero-dimension vectors not allowed)
130
49
  */
131
50
  export declare function createVector(data: Float32Array, model: string): RillVector;
132
- /** Infer the Rill type from a runtime value */
133
- export declare function inferType(value: RillValue): RillTypeName;
51
+ /** Infer the Rill type from a runtime value. Delegates to type-registrations. */
52
+ export declare const inferType: (value: RillValue) => string;
134
53
  /**
135
54
  * Infer the element type for a homogeneous list.
136
- * Empty arrays return { type: 'any' }.
55
+ * Empty arrays return { kind: 'any' }.
137
56
  * Mixed types throw RILL-R002.
138
57
  */
139
- export declare function inferElementType(elements: RillValue[]): RillType;
58
+ export declare function inferElementType(elements: RillValue[]): TypeStructure;
140
59
  /**
141
- * Return the most specific shared type for two RillType values.
60
+ * Return the most specific shared type for two TypeStructure values.
142
61
  * Returns null when types are incompatible at the top level.
143
62
  *
144
63
  * Cascade priority:
145
64
  * 1. Any-narrowing: if either side is `any`, return the other
146
- * 2. Structural match: delegate to structuralTypeEquals; on true, return a
65
+ * 2. Structural match: delegate to structureEquals; on true, return a
147
66
  * 3. Recursive list: merge inner element types
148
67
  * 3b. Uniform valueType: merge dict/tuple/ordered value types
149
68
  * 4. Bare type fallback: same compound type but structural mismatch
150
69
  * 5. Incompatible: different top-level types return null
151
70
  */
152
- export declare function commonType(a: RillType, b: RillType): RillType | null;
71
+ export declare function commonType(a: TypeStructure, b: TypeStructure): TypeStructure | null;
153
72
  /** Compare two structural types for equality. */
154
- export declare function structuralTypeEquals(a: RillType, b: RillType): boolean;
73
+ export declare function structureEquals(a: TypeStructure, b: TypeStructure): boolean;
74
+ /** @deprecated Use structureEquals instead. */
75
+ export declare const structuralTypeEquals: typeof structureEquals;
155
76
  /** Infer the structural type descriptor for any Rill value. */
156
- export declare function inferStructuralType(value: RillValue): RillType;
77
+ export declare function inferStructure(value: RillValue): TypeStructure;
78
+ /** @deprecated Use inferStructure instead. */
79
+ export declare const inferStructuralType: typeof inferStructure;
157
80
  /**
158
81
  * Check if a value matches a structural type descriptor.
159
82
  * Used for runtime type checking (`:?` operator).
160
83
  */
161
- export declare function structuralTypeMatches(value: RillValue, type: RillType): boolean;
84
+ export declare function structureMatches(value: RillValue, type: TypeStructure): boolean;
85
+ /** @deprecated Use structureMatches instead. */
86
+ export declare const structuralTypeMatches: typeof structureMatches;
162
87
  /** Build a closure param field definition from name, type, and optional default. */
163
- export declare function paramToFieldDef(name: string, type: RillType, defaultValue: RillValue | undefined): RillFieldDef;
88
+ export declare function paramToFieldDef(name: string, type: TypeStructure, defaultValue: RillValue | undefined): RillFieldDef;
164
89
  /** Format a structural type descriptor as a human-readable string. */
165
- export declare function formatStructuralType(type: RillType): string;
90
+ export declare function formatStructure(type: TypeStructure): string;
91
+ /** @deprecated Use formatStructure instead. */
92
+ export declare const formatStructuralType: typeof formatStructure;
166
93
  /**
167
94
  * Check if a value is of the expected type.
168
95
  * Returns true if the value matches the expected type, false otherwise.
@@ -172,8 +99,8 @@ export declare function checkType(value: RillValue, expected: RillTypeName): boo
172
99
  export declare function isTruthy(value: RillValue): boolean;
173
100
  /** Check if a value is empty (inverse of truthy) */
174
101
  export declare function isEmpty(value: RillValue): boolean;
175
- /** Format a value for display */
176
- export declare function formatValue(value: RillValue): string;
102
+ /** Format a value for display. Delegates to type-registrations. */
103
+ export declare const formatValue: (value: RillValue) => string;
177
104
  /**
178
105
  * Recursive native (host-side) value type.
179
106
  * Represents values that can cross the host/script boundary.
@@ -187,31 +114,25 @@ export type NativePlainObject = {
187
114
  };
188
115
  /** Structured result from toNative conversion */
189
116
  export interface NativeResult {
190
- /** Rill type name matches RillTypeName, or 'iterator' for lazy sequences */
117
+ /** Rill type name -- matches RillTypeName, or 'iterator' for lazy sequences */
191
118
  rillTypeName: string;
192
119
  /** Human-readable type signature, e.g. "string", "list(number)", "|x: number| :string" */
193
120
  rillTypeSignature: string;
194
121
  /** Native JS representation. Non-native types produce descriptor objects. */
195
122
  value: NativeValue;
196
123
  }
197
- /**
198
- * Convert a RillValue to a JSON-serializable value.
199
- * @throws {Error} plain Error (not RuntimeError) for non-serializable types
200
- */
201
- export declare function valueToJSON(value: RillValue): unknown;
124
+ /** Serialize a Rill value for JSON transport. Delegates to type-registrations. */
125
+ export declare const serializeValue: (value: RillValue) => unknown;
126
+ /** @deprecated Use serializeValue instead. */
127
+ export declare const valueToJSON: (value: RillValue) => unknown;
202
128
  /**
203
129
  * Convert a RillValue to a NativeResult for host consumption.
204
130
  * Non-representable types (closures, vectors, type values, iterators) produce descriptor objects.
205
131
  * Tuples convert to native arrays. Ordered values convert to plain objects.
206
132
  */
207
133
  export declare function toNative(value: RillValue): NativeResult;
208
- /**
209
- * Deep structural equality for all Rill values.
210
- * - Primitives: value equality
211
- * - Tuples: length + recursive element equality
212
- * - Dicts: same keys + recursive value equality (order-independent)
213
- */
214
- export declare function deepEquals(a: RillValue, b: RillValue): boolean;
134
+ /** Deep structural equality for all Rill values. Delegates to type-registrations. */
135
+ export declare const deepEquals: (a: RillValue, b: RillValue) => boolean;
215
136
  /** Reserved dict method names that cannot be overridden */
216
137
  export declare const RESERVED_DICT_METHODS: readonly ["keys", "values", "entries"];
217
138
  /**
@@ -220,36 +141,26 @@ export declare const RESERVED_DICT_METHODS: readonly ["keys", "values", "entries
220
141
  */
221
142
  export declare const anyTypeValue: RillTypeValue;
222
143
  /**
223
- * Convert a RillType structural descriptor to a RillTypeValue.
224
- * Uses the RillType's `type` field as the `typeName`.
144
+ * Convert a TypeStructure descriptor to a RillTypeValue.
145
+ * Uses the TypeStructure's `kind` field as the `typeName`.
225
146
  * Falls back to 'any' for compound types that lack a direct RillTypeName mapping.
226
147
  */
227
- export declare function rillTypeToTypeValue(type: RillType): RillTypeValue;
148
+ export declare function structureToTypeValue(type: TypeStructure): RillTypeValue;
149
+ /** @deprecated Use structureToTypeValue instead. */
150
+ export declare const rillTypeToTypeValue: typeof structureToTypeValue;
228
151
  /**
229
152
  * Check if a type is a collection (dict, ordered, tuple) with defined
230
153
  * fields or elements. Used to decide if an empty collection can be
231
154
  * synthesized and hydrated.
232
155
  */
233
- export declare function hasCollectionFields(type: RillType): boolean;
156
+ export declare function hasCollectionFields(type: TypeStructure): boolean;
234
157
  /**
235
- * Create an empty collection value matching the given RillType.
158
+ * Create an empty collection value matching the given TypeStructure.
236
159
  * Assumes the type is dict, ordered, or tuple.
237
160
  */
238
- export declare function emptyForType(type: RillType): RillValue;
161
+ export declare function emptyForType(type: TypeStructure): RillValue;
239
162
  /** Check if a key name is reserved */
240
163
  export declare function isReservedMethod(name: string): boolean;
241
- /**
242
- * Iterator type - represents a lazy sequence.
243
- * An iterator is a dict with:
244
- * - done: boolean - whether iteration is complete
245
- * - next: callable - function to get next iterator
246
- * - value: any (only required when not done) - current element
247
- */
248
- export interface RillIterator extends Record<string, RillValue> {
249
- readonly done: boolean;
250
- readonly next: CallableMarker;
251
- readonly value?: RillValue;
252
- }
253
164
  /**
254
165
  * Type guard for Rill iterator (lazy sequence).
255
166
  * An iterator is a dict with:
@@ -257,12 +168,10 @@ export interface RillIterator extends Record<string, RillValue> {
257
168
  * - next: callable - function to get next iterator
258
169
  * - value: any (only required when not done) - current element
259
170
  */
260
- export declare function isRillIterator(value: RillValue): value is RillIterator;
261
- /**
262
- * Deep copy a RillValue, producing a new independent value.
263
- * Handles primitives, arrays, plain dicts, and null.
264
- * Special markers (closures, tuples, ordered, vectors, type values) are returned
265
- * as-is since they are immutable by contract.
266
- */
267
- export declare function deepCopyRillValue(value: RillValue): RillValue;
268
- export {};
171
+ export declare function isIterator(value: RillValue): value is RillIterator;
172
+ /** @deprecated Use isIterator instead. */
173
+ export declare const isRillIterator: typeof isIterator;
174
+ /** Copy a RillValue. Delegates to type-registrations. */
175
+ export declare const copyValue: (value: RillValue) => RillValue;
176
+ /** @deprecated Use copyValue instead. */
177
+ export declare const deepCopyRillValue: (value: RillValue) => RillValue;