@rcrsr/rill 0.15.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.
- package/dist/ast-nodes.d.ts +2 -13
- package/dist/ast-nodes.js +0 -1
- package/dist/ast-unions.d.ts +0 -1
- package/dist/ast-unions.js +0 -1
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +0 -1
- package/dist/error-classes.d.ts +0 -1
- package/dist/error-classes.js +0 -1
- package/dist/error-formatter.d.ts +0 -1
- package/dist/error-formatter.js +0 -1
- package/dist/error-registry.d.ts +0 -1
- package/dist/error-registry.js +32 -1
- package/dist/ext/crypto/index.d.ts +0 -1
- package/dist/ext/crypto/index.js +5 -6
- package/dist/ext/exec/index.d.ts +0 -1
- package/dist/ext/exec/index.js +3 -4
- package/dist/ext/exec/runner.d.ts +0 -1
- package/dist/ext/exec/runner.js +0 -1
- package/dist/ext/fetch/index.d.ts +0 -1
- package/dist/ext/fetch/index.js +8 -39
- package/dist/ext/fetch/request.d.ts +0 -1
- package/dist/ext/fetch/request.js +0 -1
- package/dist/ext/fs/index.d.ts +0 -1
- package/dist/ext/fs/index.js +26 -27
- package/dist/ext/fs/sandbox.d.ts +0 -1
- package/dist/ext/fs/sandbox.js +0 -1
- package/dist/ext/kv/index.d.ts +0 -1
- package/dist/ext/kv/index.js +19 -20
- package/dist/ext/kv/store.d.ts +0 -1
- package/dist/ext/kv/store.js +0 -1
- package/dist/generated/introspection-data.d.ts +0 -1
- package/dist/generated/introspection-data.js +0 -1
- package/dist/generated/version-data.d.ts +1 -2
- package/dist/generated/version-data.js +2 -3
- package/dist/highlight-map.d.ts +0 -1
- package/dist/highlight-map.js +0 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/lexer/errors.d.ts +0 -1
- package/dist/lexer/errors.js +0 -1
- package/dist/lexer/helpers.d.ts +0 -1
- package/dist/lexer/helpers.js +0 -1
- package/dist/lexer/index.d.ts +0 -1
- package/dist/lexer/index.js +0 -1
- package/dist/lexer/operators.d.ts +0 -1
- package/dist/lexer/operators.js +0 -1
- package/dist/lexer/readers.d.ts +0 -1
- package/dist/lexer/readers.js +0 -1
- package/dist/lexer/state.d.ts +0 -1
- package/dist/lexer/state.js +0 -1
- package/dist/lexer/tokenizer.d.ts +0 -1
- package/dist/lexer/tokenizer.js +0 -1
- package/dist/parser/helpers.d.ts +0 -1
- package/dist/parser/helpers.js +0 -1
- package/dist/parser/index.d.ts +0 -1
- package/dist/parser/index.js +0 -1
- package/dist/parser/parser-collect.d.ts +0 -1
- package/dist/parser/parser-collect.js +0 -1
- package/dist/parser/parser-control.d.ts +0 -1
- package/dist/parser/parser-control.js +0 -1
- package/dist/parser/parser-expr.d.ts +0 -1
- package/dist/parser/parser-expr.js +0 -1
- package/dist/parser/parser-extract.d.ts +0 -1
- package/dist/parser/parser-extract.js +0 -1
- package/dist/parser/parser-functions.d.ts +0 -1
- package/dist/parser/parser-functions.js +0 -1
- package/dist/parser/parser-literals.d.ts +0 -1
- package/dist/parser/parser-literals.js +4 -2
- package/dist/parser/parser-script.d.ts +0 -1
- package/dist/parser/parser-script.js +0 -1
- package/dist/parser/parser-shape.d.ts +2 -3
- package/dist/parser/parser-shape.js +8 -52
- package/dist/parser/parser-types.d.ts +28 -2
- package/dist/parser/parser-types.js +64 -13
- package/dist/parser/parser-use.d.ts +0 -1
- package/dist/parser/parser-use.js +0 -1
- package/dist/parser/parser-variables.d.ts +0 -1
- package/dist/parser/parser-variables.js +0 -1
- package/dist/parser/parser.d.ts +0 -1
- package/dist/parser/parser.js +0 -1
- package/dist/parser/state.d.ts +0 -1
- package/dist/parser/state.js +0 -1
- package/dist/runtime/core/callable.d.ts +40 -13
- package/dist/runtime/core/callable.js +137 -28
- package/dist/runtime/core/context.d.ts +0 -1
- package/dist/runtime/core/context.js +1 -2
- package/dist/runtime/core/equals.d.ts +0 -1
- package/dist/runtime/core/equals.js +35 -3
- package/dist/runtime/core/eval/base.d.ts +0 -1
- package/dist/runtime/core/eval/base.js +0 -1
- package/dist/runtime/core/eval/evaluator.d.ts +0 -1
- package/dist/runtime/core/eval/evaluator.js +0 -1
- package/dist/runtime/core/eval/index.d.ts +0 -1
- package/dist/runtime/core/eval/index.js +0 -1
- package/dist/runtime/core/eval/mixins/annotations.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/annotations.js +0 -1
- package/dist/runtime/core/eval/mixins/closures.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/closures.js +82 -60
- package/dist/runtime/core/eval/mixins/collections.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/collections.js +9 -4
- package/dist/runtime/core/eval/mixins/control-flow.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/control-flow.js +0 -1
- package/dist/runtime/core/eval/mixins/conversion.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/conversion.js +153 -86
- package/dist/runtime/core/eval/mixins/core.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/core.js +0 -1
- package/dist/runtime/core/eval/mixins/expressions.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/expressions.js +0 -1
- package/dist/runtime/core/eval/mixins/extraction.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/extraction.js +8 -9
- package/dist/runtime/core/eval/mixins/list-dispatch.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/list-dispatch.js +0 -1
- package/dist/runtime/core/eval/mixins/literals.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/literals.js +3 -7
- package/dist/runtime/core/eval/mixins/types.d.ts +2 -1
- package/dist/runtime/core/eval/mixins/types.js +222 -242
- package/dist/runtime/core/eval/mixins/use.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/use.js +0 -1
- package/dist/runtime/core/eval/mixins/variables.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/variables.js +6 -7
- package/dist/runtime/core/eval/types.d.ts +0 -1
- package/dist/runtime/core/eval/types.js +0 -1
- package/dist/runtime/core/execute.d.ts +0 -1
- package/dist/runtime/core/execute.js +0 -1
- package/dist/runtime/core/field-descriptor.d.ts +2 -3
- package/dist/runtime/core/field-descriptor.js +0 -1
- package/dist/runtime/core/introspection.d.ts +0 -1
- package/dist/runtime/core/introspection.js +0 -1
- package/dist/runtime/core/resolvers.d.ts +0 -1
- package/dist/runtime/core/resolvers.js +0 -1
- package/dist/runtime/core/signals.d.ts +0 -1
- package/dist/runtime/core/signals.js +0 -1
- package/dist/runtime/core/types.d.ts +0 -1
- package/dist/runtime/core/types.js +0 -1
- package/dist/runtime/core/values.d.ts +59 -26
- package/dist/runtime/core/values.js +289 -77
- package/dist/runtime/ext/builtins.d.ts +0 -1
- package/dist/runtime/ext/builtins.js +43 -17
- package/dist/runtime/ext/extensions.d.ts +0 -1
- package/dist/runtime/ext/extensions.js +0 -1
- package/dist/runtime/index.d.ts +2 -3
- package/dist/runtime/index.js +1 -2
- package/dist/signature-parser.d.ts +0 -1
- package/dist/signature-parser.js +8 -6
- package/dist/source-location.d.ts +0 -1
- package/dist/source-location.js +0 -1
- package/dist/token-types.d.ts +0 -1
- package/dist/token-types.js +0 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.js +0 -1
- package/dist/value-types.d.ts +15 -12
- package/dist/value-types.js +0 -1
- package/package.json +2 -1
- package/dist/ast-nodes.d.ts.map +0 -1
- package/dist/ast-nodes.js.map +0 -1
- package/dist/ast-unions.d.ts.map +0 -1
- package/dist/ast-unions.js.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js.map +0 -1
- package/dist/error-classes.d.ts.map +0 -1
- package/dist/error-classes.js.map +0 -1
- package/dist/error-formatter.d.ts.map +0 -1
- package/dist/error-formatter.js.map +0 -1
- package/dist/error-registry.d.ts.map +0 -1
- package/dist/error-registry.js.map +0 -1
- package/dist/ext/crypto/index.d.ts.map +0 -1
- package/dist/ext/crypto/index.js.map +0 -1
- package/dist/ext/exec/index.d.ts.map +0 -1
- package/dist/ext/exec/index.js.map +0 -1
- package/dist/ext/exec/runner.d.ts.map +0 -1
- package/dist/ext/exec/runner.js.map +0 -1
- package/dist/ext/fetch/index.d.ts.map +0 -1
- package/dist/ext/fetch/index.js.map +0 -1
- package/dist/ext/fetch/request.d.ts.map +0 -1
- package/dist/ext/fetch/request.js.map +0 -1
- package/dist/ext/fs/index.d.ts.map +0 -1
- package/dist/ext/fs/index.js.map +0 -1
- package/dist/ext/fs/sandbox.d.ts.map +0 -1
- package/dist/ext/fs/sandbox.js.map +0 -1
- package/dist/ext/kv/index.d.ts.map +0 -1
- package/dist/ext/kv/index.js.map +0 -1
- package/dist/ext/kv/store.d.ts.map +0 -1
- package/dist/ext/kv/store.js.map +0 -1
- package/dist/generated/introspection-data.d.ts.map +0 -1
- package/dist/generated/introspection-data.js.map +0 -1
- package/dist/generated/version-data.d.ts.map +0 -1
- package/dist/generated/version-data.js.map +0 -1
- package/dist/highlight-map.d.ts.map +0 -1
- package/dist/highlight-map.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lexer/errors.d.ts.map +0 -1
- package/dist/lexer/errors.js.map +0 -1
- package/dist/lexer/helpers.d.ts.map +0 -1
- package/dist/lexer/helpers.js.map +0 -1
- package/dist/lexer/index.d.ts.map +0 -1
- package/dist/lexer/index.js.map +0 -1
- package/dist/lexer/operators.d.ts.map +0 -1
- package/dist/lexer/operators.js.map +0 -1
- package/dist/lexer/readers.d.ts.map +0 -1
- package/dist/lexer/readers.js.map +0 -1
- package/dist/lexer/state.d.ts.map +0 -1
- package/dist/lexer/state.js.map +0 -1
- package/dist/lexer/tokenizer.d.ts.map +0 -1
- package/dist/lexer/tokenizer.js.map +0 -1
- package/dist/parser/helpers.d.ts.map +0 -1
- package/dist/parser/helpers.js.map +0 -1
- package/dist/parser/index.d.ts.map +0 -1
- package/dist/parser/index.js.map +0 -1
- package/dist/parser/parser-collect.d.ts.map +0 -1
- package/dist/parser/parser-collect.js.map +0 -1
- package/dist/parser/parser-control.d.ts.map +0 -1
- package/dist/parser/parser-control.js.map +0 -1
- package/dist/parser/parser-expr.d.ts.map +0 -1
- package/dist/parser/parser-expr.js.map +0 -1
- package/dist/parser/parser-extract.d.ts.map +0 -1
- package/dist/parser/parser-extract.js.map +0 -1
- package/dist/parser/parser-functions.d.ts.map +0 -1
- package/dist/parser/parser-functions.js.map +0 -1
- package/dist/parser/parser-literals.d.ts.map +0 -1
- package/dist/parser/parser-literals.js.map +0 -1
- package/dist/parser/parser-script.d.ts.map +0 -1
- package/dist/parser/parser-script.js.map +0 -1
- package/dist/parser/parser-shape.d.ts.map +0 -1
- package/dist/parser/parser-shape.js.map +0 -1
- package/dist/parser/parser-types.d.ts.map +0 -1
- package/dist/parser/parser-types.js.map +0 -1
- package/dist/parser/parser-use.d.ts.map +0 -1
- package/dist/parser/parser-use.js.map +0 -1
- package/dist/parser/parser-variables.d.ts.map +0 -1
- package/dist/parser/parser-variables.js.map +0 -1
- package/dist/parser/parser.d.ts.map +0 -1
- package/dist/parser/parser.js.map +0 -1
- package/dist/parser/state.d.ts.map +0 -1
- package/dist/parser/state.js.map +0 -1
- package/dist/runtime/core/callable.d.ts.map +0 -1
- package/dist/runtime/core/callable.js.map +0 -1
- package/dist/runtime/core/context.d.ts.map +0 -1
- package/dist/runtime/core/context.js.map +0 -1
- package/dist/runtime/core/equals.d.ts.map +0 -1
- package/dist/runtime/core/equals.js.map +0 -1
- package/dist/runtime/core/eval/base.d.ts.map +0 -1
- package/dist/runtime/core/eval/base.js.map +0 -1
- package/dist/runtime/core/eval/evaluator.d.ts.map +0 -1
- package/dist/runtime/core/eval/evaluator.js.map +0 -1
- package/dist/runtime/core/eval/index.d.ts.map +0 -1
- package/dist/runtime/core/eval/index.js.map +0 -1
- package/dist/runtime/core/eval/mixins/annotations.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/annotations.js.map +0 -1
- package/dist/runtime/core/eval/mixins/closures.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/closures.js.map +0 -1
- package/dist/runtime/core/eval/mixins/collections.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/collections.js.map +0 -1
- package/dist/runtime/core/eval/mixins/control-flow.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/control-flow.js.map +0 -1
- package/dist/runtime/core/eval/mixins/conversion.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/conversion.js.map +0 -1
- package/dist/runtime/core/eval/mixins/core.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/core.js.map +0 -1
- package/dist/runtime/core/eval/mixins/expressions.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/expressions.js.map +0 -1
- package/dist/runtime/core/eval/mixins/extraction.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/extraction.js.map +0 -1
- package/dist/runtime/core/eval/mixins/list-dispatch.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/list-dispatch.js.map +0 -1
- package/dist/runtime/core/eval/mixins/literals.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/literals.js.map +0 -1
- package/dist/runtime/core/eval/mixins/types.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/types.js.map +0 -1
- package/dist/runtime/core/eval/mixins/use.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/use.js.map +0 -1
- package/dist/runtime/core/eval/mixins/variables.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/variables.js.map +0 -1
- package/dist/runtime/core/eval/types.d.ts.map +0 -1
- package/dist/runtime/core/eval/types.js.map +0 -1
- package/dist/runtime/core/execute.d.ts.map +0 -1
- package/dist/runtime/core/execute.js.map +0 -1
- package/dist/runtime/core/field-descriptor.d.ts.map +0 -1
- package/dist/runtime/core/field-descriptor.js.map +0 -1
- package/dist/runtime/core/introspection.d.ts.map +0 -1
- package/dist/runtime/core/introspection.js.map +0 -1
- package/dist/runtime/core/resolvers.d.ts.map +0 -1
- package/dist/runtime/core/resolvers.js.map +0 -1
- package/dist/runtime/core/signals.d.ts.map +0 -1
- package/dist/runtime/core/signals.js.map +0 -1
- package/dist/runtime/core/types.d.ts.map +0 -1
- package/dist/runtime/core/types.js.map +0 -1
- package/dist/runtime/core/values.d.ts.map +0 -1
- package/dist/runtime/core/values.js.map +0 -1
- package/dist/runtime/ext/builtins.d.ts.map +0 -1
- package/dist/runtime/ext/builtins.js.map +0 -1
- package/dist/runtime/ext/extensions.d.ts.map +0 -1
- package/dist/runtime/ext/extensions.js.map +0 -1
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js.map +0 -1
- package/dist/signature-parser.d.ts.map +0 -1
- package/dist/signature-parser.js.map +0 -1
- package/dist/source-location.d.ts.map +0 -1
- package/dist/source-location.js.map +0 -1
- package/dist/token-types.d.ts.map +0 -1
- package/dist/token-types.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/value-types.d.ts.map +0 -1
- package/dist/value-types.js.map +0 -1
package/dist/ast-nodes.d.ts
CHANGED
|
@@ -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,18 +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:
|
|
248
|
+
readonly args: FieldArg[];
|
|
249
249
|
}
|
|
250
|
-
export type TypeConstructorArg = {
|
|
251
|
-
kind: 'positional';
|
|
252
|
-
value: ExpressionNode;
|
|
253
|
-
defaultValue?: LiteralNode;
|
|
254
|
-
} | {
|
|
255
|
-
kind: 'named';
|
|
256
|
-
name: string;
|
|
257
|
-
value: ExpressionNode;
|
|
258
|
-
defaultValue?: LiteralNode;
|
|
259
|
-
};
|
|
260
250
|
/**
|
|
261
251
|
* Closure signature literal: |param: type, ...| :returnType
|
|
262
252
|
* Represents a closure type signature as a first-class value.
|
|
@@ -812,4 +802,3 @@ export interface UseExprNode extends BaseNode {
|
|
|
812
802
|
export type SimplePrimaryNode = LiteralNode | VariableNode | HostCallNode | MethodCallNode | BlockNode | BinaryExprNode | UnaryExprNode | GroupedExprNode | PostfixExprNode | TypeAssertionNode | TypeCheckNode;
|
|
813
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;
|
|
814
804
|
export {};
|
|
815
|
-
//# sourceMappingURL=ast-nodes.d.ts.map
|
package/dist/ast-nodes.js
CHANGED
package/dist/ast-unions.d.ts
CHANGED
|
@@ -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
|
package/dist/ast-unions.js
CHANGED
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
package/dist/error-classes.d.ts
CHANGED
package/dist/error-classes.js
CHANGED
package/dist/error-formatter.js
CHANGED
package/dist/error-registry.d.ts
CHANGED
package/dist/error-registry.js
CHANGED
|
@@ -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',
|
|
@@ -1093,6 +1111,20 @@ const ERROR_DEFINITIONS = [
|
|
|
1093
1111
|
},
|
|
1094
1112
|
],
|
|
1095
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
|
+
},
|
|
1096
1128
|
// Resolver errors (RILL-R050–RILL-R059)
|
|
1097
1129
|
{
|
|
1098
1130
|
errorId: 'RILL-R050',
|
|
@@ -1472,4 +1504,3 @@ export function getHelpUrl(errorId, version) {
|
|
|
1472
1504
|
const anchor = errorId.toLowerCase();
|
|
1473
1505
|
return `https://github.com/rcrsr/rill/blob/v${version}/docs/ref-errors.md#${anchor}`;
|
|
1474
1506
|
}
|
|
1475
|
-
//# sourceMappingURL=error-registry.js.map
|
package/dist/ext/crypto/index.js
CHANGED
|
@@ -56,8 +56,8 @@ export function createCryptoExtension(config = {}) {
|
|
|
56
56
|
* IR-23
|
|
57
57
|
*/
|
|
58
58
|
const hash = async (args) => {
|
|
59
|
-
const input = args[
|
|
60
|
-
const algorithm = args[
|
|
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[
|
|
77
|
-
const algorithm = args[
|
|
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[
|
|
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
|
package/dist/ext/exec/index.d.ts
CHANGED
package/dist/ext/exec/index.js
CHANGED
|
@@ -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
|
|
84
|
-
const argsParam = args[
|
|
85
|
-
const stdinParam = args[
|
|
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
|
package/dist/ext/exec/runner.js
CHANGED
package/dist/ext/fetch/index.js
CHANGED
|
@@ -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 {
|
|
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
|
|
56
|
-
*
|
|
57
|
-
*
|
|
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 -
|
|
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
|
-
|
|
69
|
-
|
|
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 (
|
|
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
|
package/dist/ext/fs/index.d.ts
CHANGED
package/dist/ext/fs/index.js
CHANGED
|
@@ -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[
|
|
79
|
-
const filePath = args[
|
|
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[
|
|
105
|
-
const filePath = args[
|
|
106
|
-
const content = args[
|
|
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[
|
|
124
|
-
const filePath = args[
|
|
125
|
-
const content = args[
|
|
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[
|
|
161
|
-
const dirPath = args[
|
|
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[
|
|
183
|
-
const pattern = args[
|
|
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[
|
|
215
|
-
const filePath = args[
|
|
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[
|
|
235
|
-
const filePath = args[
|
|
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[
|
|
268
|
-
const filePath = args[
|
|
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[
|
|
298
|
-
const dirPath = args[
|
|
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[
|
|
348
|
-
const srcPath = args[
|
|
349
|
-
const destPath = args[
|
|
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[
|
|
377
|
-
const srcPath = args[
|
|
378
|
-
const destPath = args[
|
|
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
|
package/dist/ext/fs/sandbox.d.ts
CHANGED
|
@@ -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
|
package/dist/ext/fs/sandbox.js
CHANGED
package/dist/ext/kv/index.d.ts
CHANGED
package/dist/ext/kv/index.js
CHANGED
|
@@ -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[
|
|
116
|
-
const key = args[
|
|
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[
|
|
129
|
-
const key = args[
|
|
130
|
-
const fallback = args[
|
|
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[
|
|
145
|
-
const key = args[
|
|
146
|
-
const value = args[
|
|
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[
|
|
157
|
-
const key = args[
|
|
158
|
-
const partial = args[
|
|
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[
|
|
181
|
-
const key = args[
|
|
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[
|
|
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[
|
|
200
|
-
const key = args[
|
|
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[
|
|
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[
|
|
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[
|
|
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
|
package/dist/ext/kv/store.d.ts
CHANGED
package/dist/ext/kv/store.js
CHANGED