@rcrsr/rill 0.14.0 → 0.16.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 (305) hide show
  1. package/dist/ast-nodes.d.ts +2 -11
  2. package/dist/ast-nodes.js +0 -1
  3. package/dist/ast-unions.d.ts +0 -1
  4. package/dist/ast-unions.js +0 -1
  5. package/dist/constants.d.ts +0 -1
  6. package/dist/constants.js +0 -1
  7. package/dist/error-classes.d.ts +0 -1
  8. package/dist/error-classes.js +0 -1
  9. package/dist/error-formatter.d.ts +0 -1
  10. package/dist/error-formatter.js +0 -1
  11. package/dist/error-registry.d.ts +0 -1
  12. package/dist/error-registry.js +50 -1
  13. package/dist/ext/crypto/index.d.ts +0 -1
  14. package/dist/ext/crypto/index.js +5 -6
  15. package/dist/ext/exec/index.d.ts +0 -1
  16. package/dist/ext/exec/index.js +3 -4
  17. package/dist/ext/exec/runner.d.ts +0 -1
  18. package/dist/ext/exec/runner.js +0 -1
  19. package/dist/ext/fetch/index.d.ts +0 -1
  20. package/dist/ext/fetch/index.js +8 -39
  21. package/dist/ext/fetch/request.d.ts +0 -1
  22. package/dist/ext/fetch/request.js +0 -1
  23. package/dist/ext/fs/index.d.ts +0 -1
  24. package/dist/ext/fs/index.js +26 -27
  25. package/dist/ext/fs/sandbox.d.ts +0 -1
  26. package/dist/ext/fs/sandbox.js +0 -1
  27. package/dist/ext/kv/index.d.ts +0 -1
  28. package/dist/ext/kv/index.js +19 -20
  29. package/dist/ext/kv/store.d.ts +0 -1
  30. package/dist/ext/kv/store.js +0 -1
  31. package/dist/generated/introspection-data.d.ts +0 -1
  32. package/dist/generated/introspection-data.js +0 -1
  33. package/dist/generated/version-data.d.ts +1 -2
  34. package/dist/generated/version-data.js +2 -3
  35. package/dist/highlight-map.d.ts +0 -1
  36. package/dist/highlight-map.js +0 -1
  37. package/dist/index.d.ts +1 -2
  38. package/dist/index.js +1 -2
  39. package/dist/lexer/errors.d.ts +0 -1
  40. package/dist/lexer/errors.js +0 -1
  41. package/dist/lexer/helpers.d.ts +0 -1
  42. package/dist/lexer/helpers.js +0 -1
  43. package/dist/lexer/index.d.ts +0 -1
  44. package/dist/lexer/index.js +0 -1
  45. package/dist/lexer/operators.d.ts +0 -1
  46. package/dist/lexer/operators.js +0 -1
  47. package/dist/lexer/readers.d.ts +0 -1
  48. package/dist/lexer/readers.js +0 -1
  49. package/dist/lexer/state.d.ts +0 -1
  50. package/dist/lexer/state.js +0 -1
  51. package/dist/lexer/tokenizer.d.ts +0 -1
  52. package/dist/lexer/tokenizer.js +0 -1
  53. package/dist/parser/helpers.d.ts +0 -1
  54. package/dist/parser/helpers.js +0 -1
  55. package/dist/parser/index.d.ts +0 -1
  56. package/dist/parser/index.js +0 -1
  57. package/dist/parser/parser-collect.d.ts +0 -1
  58. package/dist/parser/parser-collect.js +0 -1
  59. package/dist/parser/parser-control.d.ts +0 -1
  60. package/dist/parser/parser-control.js +0 -1
  61. package/dist/parser/parser-expr.d.ts +0 -1
  62. package/dist/parser/parser-expr.js +0 -1
  63. package/dist/parser/parser-extract.d.ts +0 -1
  64. package/dist/parser/parser-extract.js +0 -1
  65. package/dist/parser/parser-functions.d.ts +0 -1
  66. package/dist/parser/parser-functions.js +0 -1
  67. package/dist/parser/parser-literals.d.ts +0 -1
  68. package/dist/parser/parser-literals.js +4 -2
  69. package/dist/parser/parser-script.d.ts +0 -1
  70. package/dist/parser/parser-script.js +0 -1
  71. package/dist/parser/parser-shape.d.ts +2 -3
  72. package/dist/parser/parser-shape.js +8 -40
  73. package/dist/parser/parser-types.d.ts +28 -2
  74. package/dist/parser/parser-types.js +64 -13
  75. package/dist/parser/parser-use.d.ts +0 -1
  76. package/dist/parser/parser-use.js +0 -1
  77. package/dist/parser/parser-variables.d.ts +0 -1
  78. package/dist/parser/parser-variables.js +0 -1
  79. package/dist/parser/parser.d.ts +0 -1
  80. package/dist/parser/parser.js +0 -1
  81. package/dist/parser/state.d.ts +0 -1
  82. package/dist/parser/state.js +0 -1
  83. package/dist/runtime/core/callable.d.ts +40 -13
  84. package/dist/runtime/core/callable.js +137 -31
  85. package/dist/runtime/core/context.d.ts +0 -1
  86. package/dist/runtime/core/context.js +1 -2
  87. package/dist/runtime/core/equals.d.ts +0 -1
  88. package/dist/runtime/core/equals.js +35 -3
  89. package/dist/runtime/core/eval/base.d.ts +0 -1
  90. package/dist/runtime/core/eval/base.js +0 -1
  91. package/dist/runtime/core/eval/evaluator.d.ts +0 -1
  92. package/dist/runtime/core/eval/evaluator.js +0 -1
  93. package/dist/runtime/core/eval/index.d.ts +0 -1
  94. package/dist/runtime/core/eval/index.js +0 -1
  95. package/dist/runtime/core/eval/mixins/annotations.d.ts +0 -1
  96. package/dist/runtime/core/eval/mixins/annotations.js +0 -1
  97. package/dist/runtime/core/eval/mixins/closures.d.ts +0 -1
  98. package/dist/runtime/core/eval/mixins/closures.js +82 -69
  99. package/dist/runtime/core/eval/mixins/collections.d.ts +0 -1
  100. package/dist/runtime/core/eval/mixins/collections.js +9 -4
  101. package/dist/runtime/core/eval/mixins/control-flow.d.ts +0 -1
  102. package/dist/runtime/core/eval/mixins/control-flow.js +0 -1
  103. package/dist/runtime/core/eval/mixins/conversion.d.ts +0 -1
  104. package/dist/runtime/core/eval/mixins/conversion.js +263 -16
  105. package/dist/runtime/core/eval/mixins/core.d.ts +0 -1
  106. package/dist/runtime/core/eval/mixins/core.js +0 -1
  107. package/dist/runtime/core/eval/mixins/expressions.d.ts +0 -1
  108. package/dist/runtime/core/eval/mixins/expressions.js +0 -1
  109. package/dist/runtime/core/eval/mixins/extraction.d.ts +0 -1
  110. package/dist/runtime/core/eval/mixins/extraction.js +8 -9
  111. package/dist/runtime/core/eval/mixins/list-dispatch.d.ts +0 -1
  112. package/dist/runtime/core/eval/mixins/list-dispatch.js +0 -1
  113. package/dist/runtime/core/eval/mixins/literals.d.ts +0 -1
  114. package/dist/runtime/core/eval/mixins/literals.js +3 -7
  115. package/dist/runtime/core/eval/mixins/types.d.ts +2 -1
  116. package/dist/runtime/core/eval/mixins/types.js +222 -200
  117. package/dist/runtime/core/eval/mixins/use.d.ts +0 -1
  118. package/dist/runtime/core/eval/mixins/use.js +0 -1
  119. package/dist/runtime/core/eval/mixins/variables.d.ts +0 -1
  120. package/dist/runtime/core/eval/mixins/variables.js +6 -7
  121. package/dist/runtime/core/eval/types.d.ts +0 -1
  122. package/dist/runtime/core/eval/types.js +0 -1
  123. package/dist/runtime/core/execute.d.ts +0 -1
  124. package/dist/runtime/core/execute.js +0 -1
  125. package/dist/runtime/core/field-descriptor.d.ts +2 -3
  126. package/dist/runtime/core/field-descriptor.js +0 -1
  127. package/dist/runtime/core/introspection.d.ts +0 -1
  128. package/dist/runtime/core/introspection.js +0 -1
  129. package/dist/runtime/core/resolvers.d.ts +0 -1
  130. package/dist/runtime/core/resolvers.js +0 -1
  131. package/dist/runtime/core/signals.d.ts +0 -1
  132. package/dist/runtime/core/signals.js +0 -1
  133. package/dist/runtime/core/types.d.ts +0 -1
  134. package/dist/runtime/core/types.js +0 -1
  135. package/dist/runtime/core/values.d.ts +59 -8
  136. package/dist/runtime/core/values.js +338 -36
  137. package/dist/runtime/ext/builtins.d.ts +0 -1
  138. package/dist/runtime/ext/builtins.js +43 -17
  139. package/dist/runtime/ext/extensions.d.ts +0 -1
  140. package/dist/runtime/ext/extensions.js +0 -1
  141. package/dist/runtime/index.d.ts +2 -3
  142. package/dist/runtime/index.js +1 -2
  143. package/dist/signature-parser.d.ts +0 -1
  144. package/dist/signature-parser.js +8 -4
  145. package/dist/source-location.d.ts +0 -1
  146. package/dist/source-location.js +0 -1
  147. package/dist/token-types.d.ts +0 -1
  148. package/dist/token-types.js +0 -1
  149. package/dist/types.d.ts +0 -1
  150. package/dist/types.js +0 -1
  151. package/dist/value-types.d.ts +15 -12
  152. package/dist/value-types.js +0 -1
  153. package/package.json +2 -1
  154. package/dist/ast-nodes.d.ts.map +0 -1
  155. package/dist/ast-nodes.js.map +0 -1
  156. package/dist/ast-unions.d.ts.map +0 -1
  157. package/dist/ast-unions.js.map +0 -1
  158. package/dist/constants.d.ts.map +0 -1
  159. package/dist/constants.js.map +0 -1
  160. package/dist/error-classes.d.ts.map +0 -1
  161. package/dist/error-classes.js.map +0 -1
  162. package/dist/error-formatter.d.ts.map +0 -1
  163. package/dist/error-formatter.js.map +0 -1
  164. package/dist/error-registry.d.ts.map +0 -1
  165. package/dist/error-registry.js.map +0 -1
  166. package/dist/ext/crypto/index.d.ts.map +0 -1
  167. package/dist/ext/crypto/index.js.map +0 -1
  168. package/dist/ext/exec/index.d.ts.map +0 -1
  169. package/dist/ext/exec/index.js.map +0 -1
  170. package/dist/ext/exec/runner.d.ts.map +0 -1
  171. package/dist/ext/exec/runner.js.map +0 -1
  172. package/dist/ext/fetch/index.d.ts.map +0 -1
  173. package/dist/ext/fetch/index.js.map +0 -1
  174. package/dist/ext/fetch/request.d.ts.map +0 -1
  175. package/dist/ext/fetch/request.js.map +0 -1
  176. package/dist/ext/fs/index.d.ts.map +0 -1
  177. package/dist/ext/fs/index.js.map +0 -1
  178. package/dist/ext/fs/sandbox.d.ts.map +0 -1
  179. package/dist/ext/fs/sandbox.js.map +0 -1
  180. package/dist/ext/kv/index.d.ts.map +0 -1
  181. package/dist/ext/kv/index.js.map +0 -1
  182. package/dist/ext/kv/store.d.ts.map +0 -1
  183. package/dist/ext/kv/store.js.map +0 -1
  184. package/dist/generated/introspection-data.d.ts.map +0 -1
  185. package/dist/generated/introspection-data.js.map +0 -1
  186. package/dist/generated/version-data.d.ts.map +0 -1
  187. package/dist/generated/version-data.js.map +0 -1
  188. package/dist/highlight-map.d.ts.map +0 -1
  189. package/dist/highlight-map.js.map +0 -1
  190. package/dist/index.d.ts.map +0 -1
  191. package/dist/index.js.map +0 -1
  192. package/dist/lexer/errors.d.ts.map +0 -1
  193. package/dist/lexer/errors.js.map +0 -1
  194. package/dist/lexer/helpers.d.ts.map +0 -1
  195. package/dist/lexer/helpers.js.map +0 -1
  196. package/dist/lexer/index.d.ts.map +0 -1
  197. package/dist/lexer/index.js.map +0 -1
  198. package/dist/lexer/operators.d.ts.map +0 -1
  199. package/dist/lexer/operators.js.map +0 -1
  200. package/dist/lexer/readers.d.ts.map +0 -1
  201. package/dist/lexer/readers.js.map +0 -1
  202. package/dist/lexer/state.d.ts.map +0 -1
  203. package/dist/lexer/state.js.map +0 -1
  204. package/dist/lexer/tokenizer.d.ts.map +0 -1
  205. package/dist/lexer/tokenizer.js.map +0 -1
  206. package/dist/parser/helpers.d.ts.map +0 -1
  207. package/dist/parser/helpers.js.map +0 -1
  208. package/dist/parser/index.d.ts.map +0 -1
  209. package/dist/parser/index.js.map +0 -1
  210. package/dist/parser/parser-collect.d.ts.map +0 -1
  211. package/dist/parser/parser-collect.js.map +0 -1
  212. package/dist/parser/parser-control.d.ts.map +0 -1
  213. package/dist/parser/parser-control.js.map +0 -1
  214. package/dist/parser/parser-expr.d.ts.map +0 -1
  215. package/dist/parser/parser-expr.js.map +0 -1
  216. package/dist/parser/parser-extract.d.ts.map +0 -1
  217. package/dist/parser/parser-extract.js.map +0 -1
  218. package/dist/parser/parser-functions.d.ts.map +0 -1
  219. package/dist/parser/parser-functions.js.map +0 -1
  220. package/dist/parser/parser-literals.d.ts.map +0 -1
  221. package/dist/parser/parser-literals.js.map +0 -1
  222. package/dist/parser/parser-script.d.ts.map +0 -1
  223. package/dist/parser/parser-script.js.map +0 -1
  224. package/dist/parser/parser-shape.d.ts.map +0 -1
  225. package/dist/parser/parser-shape.js.map +0 -1
  226. package/dist/parser/parser-types.d.ts.map +0 -1
  227. package/dist/parser/parser-types.js.map +0 -1
  228. package/dist/parser/parser-use.d.ts.map +0 -1
  229. package/dist/parser/parser-use.js.map +0 -1
  230. package/dist/parser/parser-variables.d.ts.map +0 -1
  231. package/dist/parser/parser-variables.js.map +0 -1
  232. package/dist/parser/parser.d.ts.map +0 -1
  233. package/dist/parser/parser.js.map +0 -1
  234. package/dist/parser/state.d.ts.map +0 -1
  235. package/dist/parser/state.js.map +0 -1
  236. package/dist/runtime/core/callable.d.ts.map +0 -1
  237. package/dist/runtime/core/callable.js.map +0 -1
  238. package/dist/runtime/core/context.d.ts.map +0 -1
  239. package/dist/runtime/core/context.js.map +0 -1
  240. package/dist/runtime/core/equals.d.ts.map +0 -1
  241. package/dist/runtime/core/equals.js.map +0 -1
  242. package/dist/runtime/core/eval/base.d.ts.map +0 -1
  243. package/dist/runtime/core/eval/base.js.map +0 -1
  244. package/dist/runtime/core/eval/evaluator.d.ts.map +0 -1
  245. package/dist/runtime/core/eval/evaluator.js.map +0 -1
  246. package/dist/runtime/core/eval/index.d.ts.map +0 -1
  247. package/dist/runtime/core/eval/index.js.map +0 -1
  248. package/dist/runtime/core/eval/mixins/annotations.d.ts.map +0 -1
  249. package/dist/runtime/core/eval/mixins/annotations.js.map +0 -1
  250. package/dist/runtime/core/eval/mixins/closures.d.ts.map +0 -1
  251. package/dist/runtime/core/eval/mixins/closures.js.map +0 -1
  252. package/dist/runtime/core/eval/mixins/collections.d.ts.map +0 -1
  253. package/dist/runtime/core/eval/mixins/collections.js.map +0 -1
  254. package/dist/runtime/core/eval/mixins/control-flow.d.ts.map +0 -1
  255. package/dist/runtime/core/eval/mixins/control-flow.js.map +0 -1
  256. package/dist/runtime/core/eval/mixins/conversion.d.ts.map +0 -1
  257. package/dist/runtime/core/eval/mixins/conversion.js.map +0 -1
  258. package/dist/runtime/core/eval/mixins/core.d.ts.map +0 -1
  259. package/dist/runtime/core/eval/mixins/core.js.map +0 -1
  260. package/dist/runtime/core/eval/mixins/expressions.d.ts.map +0 -1
  261. package/dist/runtime/core/eval/mixins/expressions.js.map +0 -1
  262. package/dist/runtime/core/eval/mixins/extraction.d.ts.map +0 -1
  263. package/dist/runtime/core/eval/mixins/extraction.js.map +0 -1
  264. package/dist/runtime/core/eval/mixins/list-dispatch.d.ts.map +0 -1
  265. package/dist/runtime/core/eval/mixins/list-dispatch.js.map +0 -1
  266. package/dist/runtime/core/eval/mixins/literals.d.ts.map +0 -1
  267. package/dist/runtime/core/eval/mixins/literals.js.map +0 -1
  268. package/dist/runtime/core/eval/mixins/types.d.ts.map +0 -1
  269. package/dist/runtime/core/eval/mixins/types.js.map +0 -1
  270. package/dist/runtime/core/eval/mixins/use.d.ts.map +0 -1
  271. package/dist/runtime/core/eval/mixins/use.js.map +0 -1
  272. package/dist/runtime/core/eval/mixins/variables.d.ts.map +0 -1
  273. package/dist/runtime/core/eval/mixins/variables.js.map +0 -1
  274. package/dist/runtime/core/eval/types.d.ts.map +0 -1
  275. package/dist/runtime/core/eval/types.js.map +0 -1
  276. package/dist/runtime/core/execute.d.ts.map +0 -1
  277. package/dist/runtime/core/execute.js.map +0 -1
  278. package/dist/runtime/core/field-descriptor.d.ts.map +0 -1
  279. package/dist/runtime/core/field-descriptor.js.map +0 -1
  280. package/dist/runtime/core/introspection.d.ts.map +0 -1
  281. package/dist/runtime/core/introspection.js.map +0 -1
  282. package/dist/runtime/core/resolvers.d.ts.map +0 -1
  283. package/dist/runtime/core/resolvers.js.map +0 -1
  284. package/dist/runtime/core/signals.d.ts.map +0 -1
  285. package/dist/runtime/core/signals.js.map +0 -1
  286. package/dist/runtime/core/types.d.ts.map +0 -1
  287. package/dist/runtime/core/types.js.map +0 -1
  288. package/dist/runtime/core/values.d.ts.map +0 -1
  289. package/dist/runtime/core/values.js.map +0 -1
  290. package/dist/runtime/ext/builtins.d.ts.map +0 -1
  291. package/dist/runtime/ext/builtins.js.map +0 -1
  292. package/dist/runtime/ext/extensions.d.ts.map +0 -1
  293. package/dist/runtime/ext/extensions.js.map +0 -1
  294. package/dist/runtime/index.d.ts.map +0 -1
  295. package/dist/runtime/index.js.map +0 -1
  296. package/dist/signature-parser.d.ts.map +0 -1
  297. package/dist/signature-parser.js.map +0 -1
  298. package/dist/source-location.d.ts.map +0 -1
  299. package/dist/source-location.js.map +0 -1
  300. package/dist/token-types.d.ts.map +0 -1
  301. package/dist/token-types.js.map +0 -1
  302. package/dist/types.d.ts.map +0 -1
  303. package/dist/types.js.map +0 -1
  304. package/dist/value-types.d.ts.map +0 -1
  305. package/dist/value-types.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import type { SourceSpan } from './source-location.js';
2
- import type { RillTypeName, TypeRef } from './value-types.js';
2
+ import type { FieldArg, RillTypeName, TypeRef } from './value-types.js';
3
3
  interface BaseNode {
4
4
  readonly span: SourceSpan;
5
5
  }
@@ -245,16 +245,8 @@ export interface DictEntryNode extends BaseNode {
245
245
  export interface TypeConstructorNode extends BaseNode {
246
246
  readonly type: 'TypeConstructor';
247
247
  readonly constructorName: 'list' | 'dict' | 'tuple' | 'ordered';
248
- readonly args: TypeConstructorArg[];
248
+ readonly args: FieldArg[];
249
249
  }
250
- export type TypeConstructorArg = {
251
- kind: 'positional';
252
- value: ExpressionNode;
253
- } | {
254
- kind: 'named';
255
- name: string;
256
- value: ExpressionNode;
257
- };
258
250
  /**
259
251
  * Closure signature literal: |param: type, ...| :returnType
260
252
  * Represents a closure type signature as a first-class value.
@@ -810,4 +802,3 @@ export interface UseExprNode extends BaseNode {
810
802
  export type SimplePrimaryNode = LiteralNode | VariableNode | HostCallNode | MethodCallNode | BlockNode | BinaryExprNode | UnaryExprNode | GroupedExprNode | PostfixExprNode | TypeAssertionNode | TypeCheckNode;
811
803
  export type ASTNode = ScriptNode | FrontmatterNode | ClosureNode | ClosureParamNode | StatementNode | CaptureNode | BreakNode | ReturnNode | PassNode | AssertNode | PipeChainNode | PostfixExprNode | MethodCallNode | InvokeNode | AnnotationAccessNode | HostCallNode | HostRefNode | ClosureCallNode | PipeInvokeNode | VariableNode | ConditionalNode | WhileLoopNode | DoWhileLoopNode | BlockNode | StringLiteralNode | InterpolationNode | NumberLiteralNode | BoolLiteralNode | ListSpreadNode | DictNode | DictEntryNode | BinaryExprNode | UnaryExprNode | GroupedExprNode | DestructureNode | DestructPatternNode | SliceNode | TypeAssertionNode | TypeCheckNode | TypeConstructorNode | ClosureSigLiteralNode | AnnotatedStatementNode | AnnotatedExprNode | NamedArgNode | SpreadArgNode | EachExprNode | MapExprNode | FoldExprNode | FilterExprNode | RecoveryErrorNode | ErrorNode | TypeNameExprNode | ListLiteralNode | DictLiteralNode | TupleLiteralNode | OrderedLiteralNode | DestructNode | ConvertNode | UseExprNode;
812
804
  export {};
813
- //# sourceMappingURL=ast-nodes.d.ts.map
package/dist/ast-nodes.js CHANGED
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=ast-nodes.js.map
@@ -3,4 +3,3 @@
3
3
  * String union of all AST node type literals.
4
4
  */
5
5
  export type NodeType = 'Script' | 'Frontmatter' | 'Closure' | 'ClosureParam' | 'Statement' | 'PipeChain' | 'PostfixExpr' | 'MethodCall' | 'Invoke' | 'AnnotationAccess' | 'HostCall' | 'HostRef' | 'ClosureCall' | 'PipeInvoke' | 'Variable' | 'Capture' | 'Conditional' | 'WhileLoop' | 'DoWhileLoop' | 'Block' | 'StringLiteral' | 'Interpolation' | 'NumberLiteral' | 'BoolLiteral' | 'ListSpread' | 'Dict' | 'DictEntry' | 'Break' | 'Return' | 'Pass' | 'Assert' | 'BinaryExpr' | 'UnaryExpr' | 'GroupedExpr' | 'Destructure' | 'DestructPattern' | 'Slice' | 'TypeAssertion' | 'TypeCheck' | 'AnnotatedStatement' | 'AnnotatedExpr' | 'NamedArg' | 'SpreadArg' | 'EachExpr' | 'MapExpr' | 'FoldExpr' | 'FilterExpr' | 'RecoveryError' | 'Error' | 'TypeNameExpr' | 'TypeConstructor' | 'ClosureSigLiteral' | 'ListLiteral' | 'DictLiteral' | 'TupleLiteral' | 'OrderedLiteral' | 'Destruct' | 'Convert' | 'UseExpr';
6
- //# sourceMappingURL=ast-unions.d.ts.map
@@ -3,4 +3,3 @@
3
3
  * String union of all AST node type literals.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=ast-unions.js.map
@@ -11,4 +11,3 @@
11
11
  * - Runtime: Set-based O(1) membership lookup
12
12
  */
13
13
  export declare const VALID_TYPE_NAMES: readonly ["string", "number", "bool", "closure", "list", "dict", "tuple", "ordered", "vector", "any", "type", "iterator"];
14
- //# sourceMappingURL=constants.d.ts.map
package/dist/constants.js CHANGED
@@ -27,4 +27,3 @@ export const VALID_TYPE_NAMES = [
27
27
  'type',
28
28
  'iterator',
29
29
  ];
30
- //# sourceMappingURL=constants.js.map
@@ -94,4 +94,3 @@ export declare class AutoExceptionError extends RuntimeError {
94
94
  export declare class AbortError extends RuntimeError {
95
95
  constructor(location?: SourceLocation);
96
96
  }
97
- //# sourceMappingURL=error-classes.d.ts.map
@@ -191,4 +191,3 @@ export class AbortError extends RuntimeError {
191
191
  this.name = 'AbortError';
192
192
  }
193
193
  }
194
- //# sourceMappingURL=error-classes.js.map
@@ -53,4 +53,3 @@ export interface FormatErrorJsonOptions {
53
53
  * and callStack (when frames are present).
54
54
  */
55
55
  export declare function formatRillErrorJson(error: RillError, options?: FormatErrorJsonOptions): string;
56
- //# sourceMappingURL=error-formatter.d.ts.map
@@ -274,4 +274,3 @@ function appendCallStack(parts, data, visibleFrames, sources, filePath) {
274
274
  }
275
275
  }
276
276
  }
277
- //# sourceMappingURL=error-formatter.js.map
@@ -90,4 +90,3 @@ export declare function renderMessage(template: string, context: Record<string,
90
90
  * // Returns: ""
91
91
  */
92
92
  export declare function getHelpUrl(errorId: string, version: string): string;
93
- //# sourceMappingURL=error-registry.d.ts.map
@@ -336,6 +336,24 @@ const ERROR_DEFINITIONS = [
336
336
  },
337
337
  ],
338
338
  },
339
+ {
340
+ errorId: 'RILL-P014',
341
+ category: 'parse',
342
+ description: 'Malformed type argument list',
343
+ messageTemplate: '{details}',
344
+ cause: 'A type argument list has a syntax error: missing comma, closing paren, or invalid argument.',
345
+ resolution: 'Check the type argument list for missing commas or closing parentheses.',
346
+ examples: [
347
+ {
348
+ description: 'Missing comma between type arguments',
349
+ code: 'list(string number) # Error: expected , or )',
350
+ },
351
+ {
352
+ description: 'Missing closing paren',
353
+ code: 'dict(key: string # Error: expected )',
354
+ },
355
+ ],
356
+ },
339
357
  {
340
358
  errorId: 'RILL-P020',
341
359
  category: 'parse',
@@ -1075,6 +1093,38 @@ const ERROR_DEFINITIONS = [
1075
1093
  },
1076
1094
  ],
1077
1095
  },
1096
+ {
1097
+ errorId: 'RILL-R044',
1098
+ category: 'runtime',
1099
+ description: 'Missing required member in conversion',
1100
+ messageTemplate: "cannot convert {source} to {target}: missing required member '{name}'",
1101
+ cause: 'The :> operator requires all fields/elements without defaults to be present in the source value.',
1102
+ resolution: 'Supply the missing field or element in the source value, or add a default to the type annotation.',
1103
+ examples: [
1104
+ {
1105
+ description: 'Dict missing a required field',
1106
+ code: '{name: "Alice"} :> {name: string, age: number} # age is missing',
1107
+ },
1108
+ {
1109
+ description: 'Tuple missing a required element',
1110
+ code: 'tuple["a"] :> tuple(string, number) # element at position 1 is missing',
1111
+ },
1112
+ ],
1113
+ },
1114
+ {
1115
+ errorId: 'RILL-R045',
1116
+ category: 'runtime',
1117
+ description: 'Too many arguments passed to callable',
1118
+ messageTemplate: 'Expected {expected} args, got {actual}',
1119
+ cause: 'The number of arguments passed to a callable exceeds the number of declared parameters.',
1120
+ resolution: 'Remove the excess arguments or add more parameters to the callable definition.',
1121
+ examples: [
1122
+ {
1123
+ description: 'Too many arguments to a two-param closure',
1124
+ code: '|x: number, y: number| { x + y } -> app::call(1, 2, 3) # 3 args, 2 params',
1125
+ },
1126
+ ],
1127
+ },
1078
1128
  // Resolver errors (RILL-R050–RILL-R059)
1079
1129
  {
1080
1130
  errorId: 'RILL-R050',
@@ -1454,4 +1504,3 @@ export function getHelpUrl(errorId, version) {
1454
1504
  const anchor = errorId.toLowerCase();
1455
1505
  return `https://github.com/rcrsr/rill/blob/v${version}/docs/ref-errors.md#${anchor}`;
1456
1506
  }
1457
- //# sourceMappingURL=error-registry.js.map
@@ -31,4 +31,3 @@ export interface CryptoConfig {
31
31
  */
32
32
  export declare function createCryptoExtension(config?: CryptoConfig): ExtensionResult;
33
33
  export declare const extensionManifest: ExtensionManifest;
34
- //# sourceMappingURL=index.d.ts.map
@@ -56,8 +56,8 @@ export function createCryptoExtension(config = {}) {
56
56
  * IR-23
57
57
  */
58
58
  const hash = async (args) => {
59
- const input = args[0];
60
- const algorithm = args[1] ?? defaultAlgorithm;
59
+ const input = args['input'];
60
+ const algorithm = args['algorithm'] ?? defaultAlgorithm;
61
61
  // EC-27: Invalid algorithm
62
62
  validateAlgorithm(algorithm);
63
63
  const hashObject = crypto.createHash(algorithm);
@@ -73,8 +73,8 @@ export function createCryptoExtension(config = {}) {
73
73
  if (!hmacKey) {
74
74
  throw new RuntimeError('RILL-R004', 'hmacKey required for hmac() — set in config', undefined, {});
75
75
  }
76
- const input = args[0];
77
- const algorithm = args[1] ?? defaultAlgorithm;
76
+ const input = args['input'];
77
+ const algorithm = args['algorithm'] ?? defaultAlgorithm;
78
78
  // EC-27: Invalid algorithm
79
79
  validateAlgorithm(algorithm);
80
80
  const hmacObject = crypto.createHmac(algorithm, hmacKey);
@@ -93,7 +93,7 @@ export function createCryptoExtension(config = {}) {
93
93
  * IR-26
94
94
  */
95
95
  const random = async (args) => {
96
- const bytes = args[0];
96
+ const bytes = args['bytes'];
97
97
  return crypto.randomBytes(bytes).toString('hex');
98
98
  };
99
99
  // ============================================================
@@ -168,4 +168,3 @@ export const extensionManifest = {
168
168
  factory: createCryptoExtension,
169
169
  configSchema,
170
170
  };
171
- //# sourceMappingURL=index.js.map
@@ -44,4 +44,3 @@ export type { CommandConfig };
44
44
  */
45
45
  export declare function createExecExtension(config: ExecConfig): ExtensionResult;
46
46
  export declare const extensionManifest: ExtensionManifest;
47
- //# sourceMappingURL=index.d.ts.map
@@ -80,9 +80,9 @@ export function createExecExtension(config) {
80
80
  for (const [commandName, commandConfig] of Object.entries(config.commands)) {
81
81
  // Create function for this command
82
82
  const commandFn = async (args) => {
83
- // Extract args and stdin from RillValue array
84
- const argsParam = args[0] ?? [];
85
- const stdinParam = args[1];
83
+ // Extract args and stdin from named arg map
84
+ const argsParam = args['args'] ?? [];
85
+ const stdinParam = args['stdin'];
86
86
  // Convert args to string array
87
87
  const stringArgs = argsParam.map((arg) => String(arg));
88
88
  // Create abort controller for this execution
@@ -180,4 +180,3 @@ export const extensionManifest = {
180
180
  factory: createExecExtension,
181
181
  configSchema,
182
182
  };
183
- //# sourceMappingURL=index.js.map
@@ -59,4 +59,3 @@ export interface CommandResult {
59
59
  * ```
60
60
  */
61
61
  export declare function runCommand(commandName: string, config: CommandConfig, args: readonly string[], stdinData?: string | undefined, signal?: AbortSignal | undefined): Promise<CommandResult>;
62
- //# sourceMappingURL=runner.d.ts.map
@@ -165,4 +165,3 @@ export async function runCommand(commandName, config, args, stdinData, signal) {
165
165
  throw err;
166
166
  }
167
167
  }
168
- //# sourceMappingURL=runner.js.map
@@ -67,4 +67,3 @@ export interface FetchConfig {
67
67
  */
68
68
  export declare function createFetchExtension(config: FetchConfig): ExtensionResult;
69
69
  export declare const extensionManifest: ExtensionManifest;
70
- //# sourceMappingURL=index.d.ts.map
@@ -6,7 +6,7 @@
6
6
  * All URLs are constructed from config - scripts cannot specify arbitrary URLs.
7
7
  */
8
8
  import { RuntimeError } from '../../error-classes.js';
9
- import { isDict } from '../../runtime/core/callable.js';
9
+ import {} from '../../runtime/core/callable.js';
10
10
  import { rillTypeToTypeValue, } from '../../runtime/core/values.js';
11
11
  import { buildRequest, executeRequest, createSemaphore, } from './request.js';
12
12
  // ============================================================
@@ -52,12 +52,11 @@ function mapEndpointConfig(config) {
52
52
  // ARGUMENT PROCESSING
53
53
  // ============================================================
54
54
  /**
55
- * Process arguments from positional or dict form.
56
- * Supports two calling conventions:
57
- * 1. Positional: endpoint(arg1, arg2, arg3)
58
- * 2. Dict: endpoint({name: value, ...})
55
+ * Process named arguments dict, applying defaults and required checks.
56
+ * Called from endpointFn after runtime has already marshaled positional args
57
+ * to a named Record<string, RillValue> map.
59
58
  *
60
- * @param args - Raw arguments from call site
59
+ * @param args - Named argument map from runtime
61
60
  * @param params - Parameter definitions
62
61
  * @param functionName - Function name for error messages
63
62
  * @returns Dict of argument name to value
@@ -65,37 +64,8 @@ function mapEndpointConfig(config) {
65
64
  */
66
65
  function processArguments(args, params, functionName) {
67
66
  const result = {};
68
- // Case 1: Single dict argument - extract named parameters
69
- const firstArg = args[0];
70
- if (args.length === 1 && firstArg !== undefined && isDict(firstArg)) {
71
- const argsDict = firstArg;
72
- for (const param of params) {
73
- const value = argsDict[param.name];
74
- if (value === undefined) {
75
- // Check if parameter has default value
76
- if (param.defaultValue !== undefined) {
77
- result[param.name] = param.defaultValue;
78
- }
79
- else if (param.required !== false) {
80
- // EC-8: Missing required parameter
81
- throw new RuntimeError('RILL-R001', `parameter "${param.name}" is required`, undefined, {
82
- functionName,
83
- paramName: param.name,
84
- });
85
- }
86
- }
87
- else {
88
- result[param.name] = value;
89
- }
90
- }
91
- return result;
92
- }
93
- // Case 2: Positional arguments - map by position
94
- for (let i = 0; i < params.length; i++) {
95
- const param = params[i];
96
- if (param === undefined)
97
- continue;
98
- const value = args[i];
67
+ for (const param of params) {
68
+ const value = args[param.name];
99
69
  if (value === undefined) {
100
70
  // Check if parameter has default value
101
71
  if (param.defaultValue !== undefined) {
@@ -176,7 +146,7 @@ export function createFetchExtension(config) {
176
146
  const params = endpointConfig.params ?? [];
177
147
  // Generate function for this endpoint
178
148
  const endpointFn = async (args) => {
179
- // Process arguments (positional or dict)
149
+ // Process named arguments (apply defaults, check required)
180
150
  const processedArgs = processArguments(args, params, endpointName);
181
151
  // Build request
182
152
  const { url, options, responseShape } = buildRequest(requestConfig, endpointName, processedArgs);
@@ -270,4 +240,3 @@ export const extensionManifest = {
270
240
  factory: createFetchExtension,
271
241
  configSchema,
272
242
  };
273
- //# sourceMappingURL=index.js.map
@@ -87,4 +87,3 @@ export declare function buildRequest(config: FetchExtensionConfig, endpointName:
87
87
  responseShape: ResponseShape;
88
88
  };
89
89
  export {};
90
- //# sourceMappingURL=request.d.ts.map
@@ -412,4 +412,3 @@ export function buildRequest(config, endpointName, args) {
412
412
  responseShape: endpoint.responseShape ?? 'body',
413
413
  };
414
414
  }
415
- //# sourceMappingURL=request.js.map
@@ -38,4 +38,3 @@ export declare const configSchema: ExtensionConfigSchema;
38
38
  */
39
39
  export declare function createFsExtension(config: FsConfig): ExtensionResult;
40
40
  export declare const extensionManifest: ExtensionManifest;
41
- //# sourceMappingURL=index.d.ts.map
@@ -75,8 +75,8 @@ export function createFsExtension(config) {
75
75
  // ctx and location not used but required by CallableFn signature
76
76
  ) => {
77
77
  await ensureInitialized();
78
- const mountName = args[0];
79
- const filePath = args[1];
78
+ const mountName = args['mount'];
79
+ const filePath = args['path'];
80
80
  // EC-5: Catch file not found from resolvePath
81
81
  let resolvedPath;
82
82
  try {
@@ -101,9 +101,9 @@ export function createFsExtension(config) {
101
101
  */
102
102
  const write = async (args) => {
103
103
  await ensureInitialized();
104
- const mountName = args[0];
105
- const filePath = args[1];
106
- const content = args[2];
104
+ const mountName = args['mount'];
105
+ const filePath = args['path'];
106
+ const content = args['content'];
107
107
  const resolvedPath = await resolvePath(mountName, filePath, mounts, 'write', true // createMode: resolve parent directory
108
108
  );
109
109
  // Check content size before writing
@@ -120,9 +120,9 @@ export function createFsExtension(config) {
120
120
  */
121
121
  const append = async (args) => {
122
122
  await ensureInitialized();
123
- const mountName = args[0];
124
- const filePath = args[1];
125
- const content = args[2];
123
+ const mountName = args['mount'];
124
+ const filePath = args['path'];
125
+ const content = args['content'];
126
126
  const resolvedPath = await resolvePath(mountName, filePath, mounts, 'write', true // createMode: allow new files
127
127
  );
128
128
  // Check content size before appending
@@ -157,8 +157,8 @@ export function createFsExtension(config) {
157
157
  */
158
158
  const list = async (args) => {
159
159
  await ensureInitialized();
160
- const mountName = args[0];
161
- const dirPath = args[1] ?? '';
160
+ const mountName = args['mount'];
161
+ const dirPath = args['path'] ?? '';
162
162
  const resolvedPath = await resolvePath(mountName, dirPath, mounts, 'read');
163
163
  const entries = await fs.readdir(resolvedPath, { withFileTypes: true });
164
164
  const result = [];
@@ -179,8 +179,8 @@ export function createFsExtension(config) {
179
179
  */
180
180
  const find = async (args) => {
181
181
  await ensureInitialized();
182
- const mountName = args[0];
183
- const pattern = args[1] ?? '*';
182
+ const mountName = args['mount'];
183
+ const pattern = args['pattern'] ?? '*';
184
184
  const mount = mounts[mountName];
185
185
  if (!mount || !mount.resolvedPath) {
186
186
  throw new RuntimeError('RILL-R004', `mount "${mountName}" not configured`, undefined, { mountName });
@@ -211,8 +211,8 @@ export function createFsExtension(config) {
211
211
  */
212
212
  const exists = async (args) => {
213
213
  await ensureInitialized();
214
- const mountName = args[0];
215
- const filePath = args[1];
214
+ const mountName = args['mount'];
215
+ const filePath = args['path'];
216
216
  try {
217
217
  await resolvePath(mountName, filePath, mounts, 'read');
218
218
  return true;
@@ -231,8 +231,8 @@ export function createFsExtension(config) {
231
231
  */
232
232
  const remove = async (args) => {
233
233
  await ensureInitialized();
234
- const mountName = args[0];
235
- const filePath = args[1];
234
+ const mountName = args['mount'];
235
+ const filePath = args['path'];
236
236
  // Catch file not found from resolvePath
237
237
  let resolvedPath;
238
238
  try {
@@ -264,8 +264,8 @@ export function createFsExtension(config) {
264
264
  */
265
265
  const stat = async (args) => {
266
266
  await ensureInitialized();
267
- const mountName = args[0];
268
- const filePath = args[1];
267
+ const mountName = args['mount'];
268
+ const filePath = args['path'];
269
269
  // Catch file not found from resolvePath
270
270
  let resolvedPath;
271
271
  try {
@@ -294,8 +294,8 @@ export function createFsExtension(config) {
294
294
  */
295
295
  const mkdir = async (args) => {
296
296
  await ensureInitialized();
297
- const mountName = args[0];
298
- const dirPath = args[1];
297
+ const mountName = args['mount'];
298
+ const dirPath = args['path'];
299
299
  const mount = mounts[mountName];
300
300
  if (!mount || !mount.resolvedPath) {
301
301
  throw new RuntimeError('RILL-R004', `mount "${mountName}" not configured`, undefined, { mountName });
@@ -344,9 +344,9 @@ export function createFsExtension(config) {
344
344
  */
345
345
  const copy = async (args) => {
346
346
  await ensureInitialized();
347
- const mountName = args[0];
348
- const srcPath = args[1];
349
- const destPath = args[2];
347
+ const mountName = args['mount'];
348
+ const srcPath = args['src'];
349
+ const destPath = args['dest'];
350
350
  const resolvedSrc = await resolvePath(mountName, srcPath, mounts, 'read');
351
351
  const resolvedDest = await resolvePath(mountName, destPath, mounts, 'write', true // createMode
352
352
  );
@@ -373,9 +373,9 @@ export function createFsExtension(config) {
373
373
  */
374
374
  const move = async (args) => {
375
375
  await ensureInitialized();
376
- const mountName = args[0];
377
- const srcPath = args[1];
378
- const destPath = args[2];
376
+ const mountName = args['mount'];
377
+ const srcPath = args['src'];
378
+ const destPath = args['dest'];
379
379
  const resolvedSrc = await resolvePath(mountName, srcPath, mounts, 'read');
380
380
  const resolvedDest = await resolvePath(mountName, destPath, mounts, 'write', true // createMode
381
381
  );
@@ -660,4 +660,3 @@ export const extensionManifest = {
660
660
  factory: createFsExtension,
661
661
  configSchema,
662
662
  };
663
- //# sourceMappingURL=index.js.map
@@ -75,4 +75,3 @@ export declare function checkMode(mode: 'read' | 'write' | 'read-write', operati
75
75
  * @throws RuntimeError - If mount path invalid or inaccessible
76
76
  */
77
77
  export declare function initializeMount(mount: MountConfig): Promise<void>;
78
- //# sourceMappingURL=sandbox.d.ts.map
@@ -205,4 +205,3 @@ export async function initializeMount(mount) {
205
205
  throw error;
206
206
  }
207
207
  }
208
- //# sourceMappingURL=sandbox.js.map
@@ -80,4 +80,3 @@ export declare const configSchema: ExtensionConfigSchema;
80
80
  */
81
81
  export declare function createKvExtension(config: KvConfig): ExtensionResult;
82
82
  export declare const extensionManifest: ExtensionManifest;
83
- //# sourceMappingURL=index.d.ts.map
@@ -112,8 +112,8 @@ export function createKvExtension(config) {
112
112
  * Returns empty string for missing keys in open mode.
113
113
  */
114
114
  const get = async (args) => {
115
- const mountName = args[0];
116
- const key = args[1];
115
+ const mountName = args['mount'];
116
+ const key = args['key'];
117
117
  const store = await getStore(mountName);
118
118
  const value = store.get(key);
119
119
  // In rill, functions cannot return undefined - return empty string for missing keys in open mode
@@ -125,9 +125,9 @@ export function createKvExtension(config) {
125
125
  * Never throws for missing keys (unlike get in declared mode).
126
126
  */
127
127
  const get_or = async (args) => {
128
- const mountName = args[0];
129
- const key = args[1];
130
- const fallback = args[2];
128
+ const mountName = args['mount'];
129
+ const key = args['key'];
130
+ const fallback = args['fallback'];
131
131
  const store = await getStore(mountName);
132
132
  // Check if key exists using has() to avoid schema validation errors
133
133
  if (store.has(key)) {
@@ -141,9 +141,9 @@ export function createKvExtension(config) {
141
141
  * IR-16, EC-20-24
142
142
  */
143
143
  const set = async (args) => {
144
- const mountName = args[0];
145
- const key = args[1];
146
- const value = args[2];
144
+ const mountName = args['mount'];
145
+ const key = args['key'];
146
+ const value = args['value'];
147
147
  const store = await getStore(mountName);
148
148
  await store.set(key, value);
149
149
  return true;
@@ -153,9 +153,9 @@ export function createKvExtension(config) {
153
153
  * IR-4, EC-5, EC-6
154
154
  */
155
155
  const merge = async (args) => {
156
- const mountName = args[0];
157
- const key = args[1];
158
- const partial = args[2];
156
+ const mountName = args['mount'];
157
+ const key = args['key'];
158
+ const partial = args['partial'];
159
159
  const store = await getStore(mountName);
160
160
  // Get current value
161
161
  const currentValue = store.get(key);
@@ -177,8 +177,8 @@ export function createKvExtension(config) {
177
177
  * IR-17
178
178
  */
179
179
  const deleteKey = async (args) => {
180
- const mountName = args[0];
181
- const key = args[1];
180
+ const mountName = args['mount'];
181
+ const key = args['key'];
182
182
  const store = await getStore(mountName);
183
183
  return store.delete(key);
184
184
  };
@@ -187,7 +187,7 @@ export function createKvExtension(config) {
187
187
  * IR-6
188
188
  */
189
189
  const keys = async (args) => {
190
- const mountName = args[0];
190
+ const mountName = args['mount'];
191
191
  const store = await getStore(mountName);
192
192
  return store.keys();
193
193
  };
@@ -196,8 +196,8 @@ export function createKvExtension(config) {
196
196
  * IR-7
197
197
  */
198
198
  const has = async (args) => {
199
- const mountName = args[0];
200
- const key = args[1];
199
+ const mountName = args['mount'];
200
+ const key = args['key'];
201
201
  const store = await getStore(mountName);
202
202
  return store.has(key);
203
203
  };
@@ -206,7 +206,7 @@ export function createKvExtension(config) {
206
206
  * IR-8
207
207
  */
208
208
  const clear = async (args) => {
209
- const mountName = args[0];
209
+ const mountName = args['mount'];
210
210
  const store = await getStore(mountName);
211
211
  store.clear();
212
212
  return true;
@@ -216,7 +216,7 @@ export function createKvExtension(config) {
216
216
  * IR-9
217
217
  */
218
218
  const getAll = async (args) => {
219
- const mountName = args[0];
219
+ const mountName = args['mount'];
220
220
  const store = await getStore(mountName);
221
221
  return store.getAll();
222
222
  };
@@ -225,7 +225,7 @@ export function createKvExtension(config) {
225
225
  * IR-10
226
226
  */
227
227
  const schema = async (args) => {
228
- const mountName = args[0];
228
+ const mountName = args['mount'];
229
229
  const mountConfig = mounts[mountName];
230
230
  if (!mountConfig) {
231
231
  throw new RuntimeError('RILL-R004', `Mount '${mountName}' not found`, undefined, { mountName, availableMounts: Object.keys(mounts) });
@@ -485,4 +485,3 @@ export const extensionManifest = {
485
485
  factory: createKvExtension,
486
486
  configSchema,
487
487
  };
488
- //# sourceMappingURL=index.js.map
@@ -47,4 +47,3 @@ export declare function createStore(config: StoreConfig): Promise<{
47
47
  getAll: () => Record<string, RillValue>;
48
48
  flush: () => Promise<void>;
49
49
  }>;
50
- //# sourceMappingURL=store.d.ts.map
@@ -267,4 +267,3 @@ export async function createStore(config) {
267
267
  flush,
268
268
  };
269
269
  }
270
- //# sourceMappingURL=store.js.map