@opencode/codemode 2.0.11 → 2.0.13
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/data.d.ts +5 -4
- package/dist/interpreter/callback.d.ts +11 -14
- package/dist/interpreter/callback.js +23 -7
- package/dist/interpreter/errors.d.ts +3 -3
- package/dist/interpreter/errors.js +2 -2
- package/dist/interpreter/execute.d.ts +2 -1
- package/dist/interpreter/extensions.d.ts +2 -1
- package/dist/interpreter/extensions.js +7 -35
- package/dist/interpreter/globals.d.ts +2 -1
- package/dist/interpreter/globals.js +1 -1
- package/dist/interpreter/interpreter.d.ts +9 -20
- package/dist/interpreter/interpreter.js +124 -122
- package/dist/interpreter/intrinsics.d.ts +4 -2
- package/dist/interpreter/intrinsics.js +12 -0
- package/dist/interpreter/model.d.ts +7 -8
- package/dist/interpreter/model.js +3 -3
- package/dist/interpreter/native.d.ts +5 -5
- package/dist/interpreter/objects.d.ts +148 -47
- package/dist/interpreter/objects.js +224 -26
- package/dist/interpreter/promises.d.ts +7 -7
- package/dist/interpreter/promises.js +32 -11
- package/dist/interpreter/references.d.ts +8 -7
- package/dist/interpreter/references.js +10 -46
- package/dist/interpreter/scope.d.ts +5 -4
- package/dist/stdlib/array.d.ts +2 -1
- package/dist/stdlib/array.js +37 -52
- package/dist/stdlib/bytes.js +14 -24
- package/dist/stdlib/collections.js +52 -30
- package/dist/stdlib/console.d.ts +2 -2
- package/dist/stdlib/console.js +6 -50
- package/dist/stdlib/date.js +6 -2
- package/dist/stdlib/headers.js +10 -22
- package/dist/stdlib/iterator.d.ts +1 -1
- package/dist/stdlib/iterator.js +294 -6
- package/dist/stdlib/json.js +3 -5
- package/dist/stdlib/math.js +5 -17
- package/dist/stdlib/number.js +9 -21
- package/dist/stdlib/object.d.ts +3 -4
- package/dist/stdlib/object.js +7 -18
- package/dist/stdlib/regexp.d.ts +3 -3
- package/dist/stdlib/regexp.js +1 -2
- package/dist/stdlib/string.js +12 -20
- package/dist/stdlib/url.d.ts +2 -1
- package/dist/stdlib/url.js +6 -16
- package/dist/stdlib/value.d.ts +0 -3
- package/dist/stdlib/value.js +2 -74
- package/dist/stdlib/web.js +1 -2
- package/dist/tool-runtime.d.ts +2 -0
- package/dist/tool-runtime.js +39 -27
- package/package.json +1 -1
package/dist/data.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
export * as Data from "./data.js";
|
|
2
2
|
import { Effect, type Schema } from "effect";
|
|
3
3
|
import type { Interpreter } from "./interpreter/interpreter.js";
|
|
4
|
+
import { type Value } from "./interpreter/objects.js";
|
|
4
5
|
export type Json = Schema.Json;
|
|
5
|
-
type Replacer<R> = (args: Array<
|
|
6
|
+
type Replacer<R> = (args: Array<Value>) => Effect.Effect<Value, unknown, R>;
|
|
6
7
|
/**
|
|
7
8
|
* What `JSON.stringify` would serialize for a program value, as host JSON: `toJSON` is honored, functions and
|
|
8
9
|
* `undefined` vanish, non-finite numbers become null, and everything else is copied. Two departures from JS
|
|
9
10
|
* so a mistake is not a silent `{}`: an Error serializes as `{ name, message, ...own }`, and a promise throws.
|
|
10
11
|
*/
|
|
11
|
-
export declare const toJson: <R>(ctx: Interpreter<R>, value:
|
|
12
|
+
export declare const toJson: <R>(ctx: Interpreter<R>, value: Value, replacer?: Replacer<R>) => Effect.Effect<Schema.Json | undefined, unknown, R>;
|
|
12
13
|
/**
|
|
13
14
|
* The host boundary: `toJson`, plus what a program most likely meant when a value cannot be JSON. A promise is
|
|
14
15
|
* awaited, a Set crosses as an array, a URLSearchParams as its query string, a Uint8Array asks to be encoded as
|
|
15
16
|
* text first, and a `__proto__` key is dropped so host code can never receive one.
|
|
16
17
|
*/
|
|
17
|
-
export declare const toBoundary: <R>(ctx: Interpreter<R>, value:
|
|
18
|
+
export declare const toBoundary: <R>(ctx: Interpreter<R>, value: Value) => Effect.Effect<Schema.Json | undefined, unknown, R>;
|
|
18
19
|
/** Host JSON as program values: objects and arrays are copied, primitives pass through. */
|
|
19
|
-
export declare const fromJson: <R>(ctx: Interpreter<R>, value:
|
|
20
|
+
export declare const fromJson: <R>(ctx: Interpreter<R>, value: Json | undefined) => Value;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import type { Interpreter } from "./interpreter.js";
|
|
3
|
-
import { Callable } from "./objects.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
readonly value: unknown;
|
|
8
|
-
}, unknown, R>;
|
|
9
|
-
readonly close: Effect.Effect<void, unknown, R>;
|
|
10
|
-
};
|
|
11
|
-
export declare const preserveConsumerError: <A, R>(cursor: IteratorCursor<R>, effect: Effect.Effect<A, unknown, R>) => Effect.Effect<A, unknown, R>;
|
|
3
|
+
import { Callable, type Cursor, type Value } from "./objects.js";
|
|
4
|
+
/** IteratorClose: a consumer failure closes the iterator and wins over any close failure, except that a generator's
|
|
5
|
+
* return() is a return completion, so a failing close wins over it, as after `break`. */
|
|
6
|
+
export declare const preserveConsumerError: <A, R>(close: Cursor<R>["close"], effect: Effect.Effect<A, unknown, R>) => Effect.Effect<A, unknown, R>;
|
|
12
7
|
/**
|
|
13
8
|
* ToPrimitive: calls `valueOf`/`toString` in hint order and returns the first primitive result. Dates treat the
|
|
14
9
|
* default hint as "string", like their `Symbol.toPrimitive`.
|
|
15
10
|
*/
|
|
16
|
-
export declare const toPrimitive: <R>(ctx: Interpreter<R>, value:
|
|
17
|
-
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
11
|
+
export declare const toPrimitive: <R>(ctx: Interpreter<R>, value: Value, hint: "number" | "string" | "default") => Effect.Effect<Value, unknown, R>;
|
|
12
|
+
/** Invoke(value, name): calls the method the value would find through its prototype. */
|
|
13
|
+
export declare const invoke: <R>(ctx: Interpreter<R>, value: Value, name: string, label: string) => Effect.Effect<Value, unknown, R>;
|
|
14
|
+
export declare const toPrimitiveString: <R>(ctx: Interpreter<R>, value: Value) => Effect.Effect<string, unknown, R>;
|
|
15
|
+
export declare const toPrimitiveNumber: <R>(ctx: Interpreter<R>, value: Value) => Effect.Effect<number, unknown, R>;
|
|
16
|
+
export declare const isSupportedCallback: (value: Value) => value is Callable;
|
|
17
|
+
export declare const applyCollectionCallback: <R>(ctx: Interpreter<R>, callback: Value, name: string) => ((args: Array<Value>) => Effect.Effect<Value, unknown, R>);
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import { Effect, Exit } from "effect";
|
|
2
|
-
import {
|
|
3
|
-
import { typeError } from "./model.js";
|
|
4
|
-
import { Callable, get, Native, DateObj, Obj } from "./objects.js";
|
|
1
|
+
import { Cause, Effect, Exit } from "effect";
|
|
2
|
+
import { primitivePrototype } from "./intrinsics.js";
|
|
3
|
+
import { GeneratorReturn, typeError } from "./model.js";
|
|
4
|
+
import { Callable, get, Native, DateObj, Obj, coerceToNumber, coerceToString, } from "./objects.js";
|
|
5
5
|
import { typeofValue } from "./references.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/** IteratorClose: a consumer failure closes the iterator and wins over any close failure, except that a generator's
|
|
7
|
+
* return() is a return completion, so a failing close wins over it, as after `break`. */
|
|
8
|
+
export const preserveConsumerError = (close, effect) => Effect.flatMap(Effect.exit(effect), (exit) => {
|
|
9
|
+
if (Exit.isSuccess(exit))
|
|
10
|
+
return Effect.succeed(exit.value);
|
|
11
|
+
return Effect.flatMap(Effect.exit(close), (closed) => {
|
|
12
|
+
if (!Exit.isSuccess(closed) && Cause.squash(exit.cause) instanceof GeneratorReturn) {
|
|
13
|
+
return Effect.failCause(closed.cause);
|
|
14
|
+
}
|
|
15
|
+
return Effect.failCause(exit.cause);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
9
18
|
/**
|
|
10
19
|
* ToPrimitive: calls `valueOf`/`toString` in hint order and returns the first primitive result. Dates treat the
|
|
11
20
|
* default hint as "string", like their `Symbol.toPrimitive`.
|
|
@@ -27,6 +36,13 @@ export const toPrimitive = (ctx, value, hint) => {
|
|
|
27
36
|
throw typeError("Cannot convert object to primitive value.");
|
|
28
37
|
});
|
|
29
38
|
};
|
|
39
|
+
/** Invoke(value, name): calls the method the value would find through its prototype. */
|
|
40
|
+
export const invoke = (ctx, value, name, label) => {
|
|
41
|
+
const target = value instanceof Obj ? value : primitivePrototype(ctx.builtins, value);
|
|
42
|
+
if (target === undefined)
|
|
43
|
+
throw typeError(`${label} called on null or undefined.`);
|
|
44
|
+
return ctx.call(get(target, name), value, []);
|
|
45
|
+
};
|
|
30
46
|
export const toPrimitiveString = (ctx, value) => Effect.map(toPrimitive(ctx, value, "string"), coerceToString);
|
|
31
47
|
export const toPrimitiveNumber = (ctx, value) => Effect.map(toPrimitive(ctx, value, "number"), coerceToNumber);
|
|
32
48
|
// The single acceptance list for callbacks: collections, sort, string replacers,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Diagnostic } from "../codemode.js";
|
|
2
2
|
import { type AstNode } from "./model.js";
|
|
3
3
|
import { type ErrorType } from "./intrinsics.js";
|
|
4
|
-
import { type Native, ErrorObj, Obj } from "./objects.js";
|
|
4
|
+
import { type Native, ErrorObj, Obj, type Value } from "./objects.js";
|
|
5
5
|
import type { Interpreter } from "./interpreter.js";
|
|
6
6
|
export declare const normalizeError: (error: unknown) => Diagnostic;
|
|
7
7
|
/**
|
|
@@ -10,7 +10,7 @@ export declare const normalizeError: (error: unknown) => Diagnostic;
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const locate: (error: unknown, node?: AstNode) => unknown;
|
|
12
12
|
/** The program value a handler receives for a failure; one failure always yields the same value. */
|
|
13
|
-
export declare const materialize: <R>(ctx: Interpreter<R>, thrown: unknown) =>
|
|
14
|
-
export declare const createAggregateErrorValue: <R>(ctx: Interpreter<R>, errors: Array<
|
|
13
|
+
export declare const materialize: <R>(ctx: Interpreter<R>, thrown: unknown) => Value;
|
|
14
|
+
export declare const createAggregateErrorValue: <R>(ctx: Interpreter<R>, errors: Array<Value>, message: string, proto?: Obj) => ErrorObj;
|
|
15
15
|
/** An error constructor such as `Error` or `TypeError`; callable with or without `new`, like JS. */
|
|
16
16
|
export declare const errorGlobal: <R>(type: ErrorType, ctx: Interpreter<R>) => Native<R>;
|
|
@@ -5,9 +5,8 @@ import { formatLocation, PendingThrow, Throw, sourceLocation, typeError } from "
|
|
|
5
5
|
import { containsRuntimeReference } from "./references.js";
|
|
6
6
|
import { createErrorValue, isErrorType } from "./intrinsics.js";
|
|
7
7
|
import { constructor, methods, prototypeFrom, receiver } from "./native.js";
|
|
8
|
-
import { define, get, has, hidden, Arr, ErrorObj, Obj } from "./objects.js";
|
|
8
|
+
import { define, get, has, hidden, Arr, ErrorObj, Obj, coerceToString, } from "./objects.js";
|
|
9
9
|
import { formatValue } from "../stdlib/console.js";
|
|
10
|
-
import { coerceToString } from "../stdlib/value.js";
|
|
11
10
|
export const normalizeError = (error) => {
|
|
12
11
|
if (error instanceof PendingThrow) {
|
|
13
12
|
return {
|
|
@@ -150,6 +149,7 @@ export const errorGlobal = (type, ctx) => {
|
|
|
150
149
|
methods(builtins, prototype, [
|
|
151
150
|
["toString", 0, (thisValue) => errorToString(receiver(Obj, thisValue, "Error.prototype.toString"))],
|
|
152
151
|
]);
|
|
152
|
+
methods(builtins, ctor, [["isError", 1, (_, args) => args[0] instanceof ErrorObj]]);
|
|
153
153
|
}
|
|
154
154
|
return ctor;
|
|
155
155
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import type { ResolvedExecutionLimits, Result } from "../codemode.js";
|
|
3
3
|
import { ToolRuntime } from "../tool-runtime.js";
|
|
4
|
+
import type { Value } from "./objects.js";
|
|
4
5
|
import { Interpreter } from "./interpreter.js";
|
|
5
|
-
export declare const executeProgram: <R>(code: string, prepared: ToolRuntime.Prepared<R>, limits: ResolvedExecutionLimits, hooks: ToolRuntime.Hooks<R>, globals?: (ctx: Interpreter<R>) => ReadonlyArray<readonly [string,
|
|
6
|
+
export declare const executeProgram: <R>(code: string, prepared: ToolRuntime.Prepared<R>, limits: ResolvedExecutionLimits, hooks: ToolRuntime.Hooks<R>, globals?: (ctx: Interpreter<R>) => ReadonlyArray<readonly [string, Value]>) => Effect.Effect<Result, never, R>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Extension } from "../extension.js";
|
|
2
2
|
import type { Interpreter } from "./interpreter.js";
|
|
3
|
+
import { type Value } from "./objects.js";
|
|
3
4
|
/**
|
|
4
5
|
* The global bindings of one run's extensions. Everything crossing the boundary is converted: plain data and
|
|
5
6
|
* built-in wrappers are copied, a host function becomes a program function whose calls cross the same way, and a
|
|
6
7
|
* host Promise becomes a program promise.
|
|
7
8
|
*/
|
|
8
|
-
export declare const extensionGlobals: <R>(ctx: Interpreter<R>, extensions: ReadonlyArray<Extension>) => ReadonlyArray<readonly [string,
|
|
9
|
+
export declare const extensionGlobals: <R>(ctx: Interpreter<R>, extensions: ReadonlyArray<Extension>) => ReadonlyArray<readonly [string, Value]>;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import { coerceToString } from "../stdlib/value.js";
|
|
3
2
|
import { hooked } from "../tool-runtime.js";
|
|
4
3
|
import { createErrorValue, isErrorType } from "./intrinsics.js";
|
|
5
4
|
import { MAX_VALUE_DEPTH } from "./limits.js";
|
|
6
5
|
import { PendingThrow, Throw, typeError } from "./model.js";
|
|
7
6
|
import { fn } from "./native.js";
|
|
8
|
-
import {
|
|
9
|
-
import { describeValue } from "./references.js";
|
|
7
|
+
import { define, get, has, hidden, keys, Arr, Bytes, DateObj, ErrorObj, HeadersObj, MapObj, Obj, RegExpObj, SetObj, URLObj, URLSearchParamsObj, coerceToString, } from "./objects.js";
|
|
8
|
+
import { describeValue, isOpaque } from "./references.js";
|
|
10
9
|
/**
|
|
11
10
|
* The global bindings of one run's extensions. Everything crossing the boundary is converted: plain data and
|
|
12
11
|
* built-in wrappers are copied, a host function becomes a program function whose calls cross the same way, and a
|
|
@@ -17,38 +16,15 @@ export const extensionGlobals = (ctx, extensions) => {
|
|
|
17
16
|
const toHost = (value, label, depth = 0, seen = new Set()) => {
|
|
18
17
|
if (depth > MAX_VALUE_DEPTH)
|
|
19
18
|
throw typeError(`${label} exceeds the maximum value depth of ${MAX_VALUE_DEPTH}.`);
|
|
20
|
-
if (value
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
throw typeError(`${label} contains ${describeValue(value)}, which cannot be passed to an extension.`);
|
|
24
|
-
}
|
|
25
|
-
if (value instanceof Bytes)
|
|
26
|
-
return new Uint8Array(value.bytes);
|
|
27
|
-
if (value instanceof DateObj)
|
|
28
|
-
return new Date(value.time);
|
|
29
|
-
if (value instanceof RegExpObj)
|
|
30
|
-
return new RegExp(value.regex.source, value.regex.flags);
|
|
31
|
-
if (value instanceof URLObj)
|
|
32
|
-
return new URL(value.url.href);
|
|
33
|
-
if (value instanceof URLSearchParamsObj)
|
|
34
|
-
return new URLSearchParams(value.params);
|
|
35
|
-
if (value instanceof HeadersObj)
|
|
36
|
-
return new Headers(value.headers);
|
|
37
|
-
const next = (item) => toHost(item, label, depth + 1, seen);
|
|
38
|
-
if (value instanceof MapObj)
|
|
39
|
-
return new Map([...value.map].map(([key, item]) => [next(key), next(item)]));
|
|
40
|
-
if (value instanceof SetObj)
|
|
41
|
-
return new Set([...value.set].map(next));
|
|
42
|
-
if (!(value instanceof Obj) ||
|
|
43
|
-
value instanceof Callable ||
|
|
44
|
-
value instanceof GeneratorObj ||
|
|
45
|
-
value instanceof IteratorObj ||
|
|
46
|
-
value instanceof PromiseObj) {
|
|
19
|
+
if (isPrimitive(value))
|
|
20
|
+
return value;
|
|
21
|
+
if (!(value instanceof Obj) || isOpaque(value)) {
|
|
47
22
|
throw typeError(`${label} contains ${describeValue(value)}, which cannot be passed to an extension.`);
|
|
48
23
|
}
|
|
49
24
|
if (seen.has(value))
|
|
50
25
|
throw typeError(`${label} contains a circular value.`);
|
|
51
26
|
seen.add(value);
|
|
27
|
+
const next = (item) => toHost(item, label, depth + 1, seen);
|
|
52
28
|
if (value instanceof ErrorObj) {
|
|
53
29
|
const name = coerceToString(get(value, "name"));
|
|
54
30
|
const message = get(value, "message");
|
|
@@ -70,11 +46,7 @@ export const extensionGlobals = (ctx, extensions) => {
|
|
|
70
46
|
seen.delete(value);
|
|
71
47
|
return copied;
|
|
72
48
|
}
|
|
73
|
-
const copied = value
|
|
74
|
-
? value.items.map(next)
|
|
75
|
-
: Object.fromEntries(entries(value)
|
|
76
|
-
.filter(([key]) => key !== "__proto__")
|
|
77
|
-
.map(([key, item]) => [key, next(item)]));
|
|
49
|
+
const copied = value.toHost(next);
|
|
78
50
|
seen.delete(value);
|
|
79
51
|
return copied;
|
|
80
52
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { Value } from "./objects.js";
|
|
1
2
|
import type { Interpreter } from "./interpreter.js";
|
|
2
3
|
/** Names bound in every program before extensions apply. */
|
|
3
4
|
export declare const globalNames: ReadonlySet<string>;
|
|
4
5
|
/** The immutable global bindings of every program, in declaration order. */
|
|
5
|
-
export declare const globals: <R>(ctx: Interpreter<R>) => ReadonlyArray<readonly [string,
|
|
6
|
+
export declare const globals: <R>(ctx: Interpreter<R>) => ReadonlyArray<readonly [string, Value]>;
|
|
@@ -60,6 +60,7 @@ const table = {
|
|
|
60
60
|
console: (ctx) => consoleGlobal(ctx),
|
|
61
61
|
Promise: (ctx) => promiseGlobal(ctx),
|
|
62
62
|
Symbol: (ctx) => symbolGlobal(ctx),
|
|
63
|
+
Iterator: (ctx) => iteratorGlobals(ctx),
|
|
63
64
|
Number: (ctx) => numberGlobal(ctx),
|
|
64
65
|
String: (ctx) => stringGlobal(ctx),
|
|
65
66
|
Boolean: (ctx) => booleanGlobal(ctx),
|
|
@@ -91,6 +92,5 @@ export const globalNames = new Set(Object.keys(table));
|
|
|
91
92
|
/** The immutable global bindings of every program, in declaration order. */
|
|
92
93
|
export const globals = (ctx) => {
|
|
93
94
|
generatorGlobals(ctx);
|
|
94
|
-
iteratorGlobals(ctx);
|
|
95
95
|
return Object.entries(table).map(([name, factory]) => [name, factory(ctx)]);
|
|
96
96
|
};
|
|
@@ -2,8 +2,8 @@ import type { Program } from "acorn";
|
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import { type Json } from "../data.js";
|
|
4
4
|
import { type ToolRuntime } from "../tool-runtime.js";
|
|
5
|
-
import type
|
|
6
|
-
import { PromiseObj } from "./objects.js";
|
|
5
|
+
import { type Builtins } from "./intrinsics.js";
|
|
6
|
+
import { type Cursor, PromiseObj, type Value } from "./objects.js";
|
|
7
7
|
import { Pending } from "./promises.js";
|
|
8
8
|
/** One program execution: the tool bridge, promise scheduler, captured logs, and the global scope built once. */
|
|
9
9
|
export declare class Interpreter<R> {
|
|
@@ -17,24 +17,13 @@ export declare class Interpreter<R> {
|
|
|
17
17
|
readonly pending: Pending<R>;
|
|
18
18
|
readonly builtins: Builtins;
|
|
19
19
|
readonly logs?: Array<string>;
|
|
20
|
-
readonly globals?: (ctx: Interpreter<R>) => ReadonlyArray<readonly [string,
|
|
20
|
+
readonly globals?: (ctx: Interpreter<R>) => ReadonlyArray<readonly [string, Value]>;
|
|
21
21
|
});
|
|
22
|
-
run(program: Program): Effect.Effect<
|
|
23
|
-
call(callable:
|
|
24
|
-
await(promise: PromiseObj): Effect.Effect<
|
|
25
|
-
iterate(value:
|
|
26
|
-
|
|
27
|
-
done: boolean;
|
|
28
|
-
value: any;
|
|
29
|
-
}, never, never>;
|
|
30
|
-
close: Effect.Effect<void, never, never>;
|
|
31
|
-
}, never, never> | Effect.Effect<{
|
|
32
|
-
next: Effect.Effect<{
|
|
33
|
-
done: boolean;
|
|
34
|
-
value: unknown;
|
|
35
|
-
}, unknown, R>;
|
|
36
|
-
close: Effect.Effect<void, unknown, R>;
|
|
37
|
-
} | undefined, unknown, R>;
|
|
22
|
+
run(program: Program): Effect.Effect<Value, unknown, R>;
|
|
23
|
+
call(callable: Value, thisValue: Value, args: Array<Value>): Effect.Effect<Value, unknown, R>;
|
|
24
|
+
await(promise: PromiseObj): Effect.Effect<Value, unknown, never>;
|
|
25
|
+
iterate(value: Value): Effect.Effect<Cursor<R> | undefined, unknown, R>;
|
|
26
|
+
iterateDirect(value: Value): Cursor<R>;
|
|
38
27
|
/** Runs one host tool: arguments cross as JSON and the result comes back as program values. */
|
|
39
|
-
tool(run: (args: Array<Json | undefined>) => Effect.Effect<Json | undefined, unknown, R>, args: Array<
|
|
28
|
+
tool(run: (args: Array<Json | undefined>) => Effect.Effect<Json | undefined, unknown, R>, args: Array<Value>): Effect.Effect<Value, unknown, R>;
|
|
40
29
|
}
|