liminal 0.5.1 → 0.5.2
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/Agent.ts +10 -0
- package/CHANGELOG.md +6 -0
- package/Exec.ts +19 -31
- package/L.ts +4 -7
- package/LiminalConfig.ts +1 -1
- package/Model.ts +8 -2
- package/PathLike.ts +8 -10
- package/Scope.ts +33 -14
- package/Tool.ts +3 -3
- package/actions/actions_derived/clear.ts +2 -2
- package/actions/actions_derived/declareModel.test.ts +10 -7
- package/actions/actions_derived/declareModel.ts +3 -3
- package/actions/actions_derived/messages.ts +0 -1
- package/actions/actions_derived/readers_derived.ts +15 -0
- package/actions/appendMessage.ts +27 -3
- package/actions/branch.ts +31 -33
- package/actions/catch.ts +3 -3
- package/actions/embed.ts +2 -1
- package/actions/enableTool.ts +2 -2
- package/actions/enableTool.type-test.ts +7 -7
- package/actions/infer.ts +15 -3
- package/actions/messages.ts +62 -0
- package/actions/pushModel.ts +22 -2
- package/actions/scope.ts +13 -0
- package/actions/section.ts +105 -0
- package/cli/cli_common.ts +1 -0
- package/cli/main.ts +6 -1
- package/cli/runExec.ts +20 -16
- package/dist/Agent.d.ts +7 -0
- package/dist/Agent.js +2 -0
- package/dist/Agent.js.map +1 -0
- package/dist/Exec.d.ts +5 -7
- package/dist/Exec.js +14 -17
- package/dist/Exec.js.map +1 -1
- package/dist/L.d.ts +4 -7
- package/dist/L.js +4 -7
- package/dist/L.js.map +1 -1
- package/dist/LiminalConfig.d.ts +1 -1
- package/dist/Model.d.ts +7 -2
- package/dist/PathLike.d.ts +4 -7
- package/dist/Scope.d.ts +11 -5
- package/dist/Scope.js +8 -5
- package/dist/Scope.js.map +1 -1
- package/dist/Tool.d.ts +2 -2
- package/dist/actions/actions_derived/clear.js +2 -2
- package/dist/actions/actions_derived/clear.js.map +1 -1
- package/dist/actions/actions_derived/declareModel.d.ts +2 -2
- package/dist/actions/actions_derived/declareModel.js +1 -1
- package/dist/actions/actions_derived/declareModel.js.map +1 -1
- package/dist/actions/actions_derived/declareModel.test.js +10 -7
- package/dist/actions/actions_derived/declareModel.test.js.map +1 -1
- package/dist/actions/actions_derived/messages.d.ts +3 -3
- package/dist/actions/actions_derived/messages.js.map +1 -1
- package/dist/actions/actions_derived/readers_derived.d.ts +6 -0
- package/dist/actions/actions_derived/readers_derived.js +14 -0
- package/dist/actions/actions_derived/readers_derived.js.map +1 -0
- package/dist/actions/appendMessage.d.ts +6 -2
- package/dist/actions/appendMessage.js +23 -2
- package/dist/actions/appendMessage.js.map +1 -1
- package/dist/actions/branch.d.ts +18 -14
- package/dist/actions/branch.js +10 -10
- package/dist/actions/branch.js.map +1 -1
- package/dist/actions/catch.d.ts +2 -2
- package/dist/actions/catch.js +2 -2
- package/dist/actions/embed.js +2 -1
- package/dist/actions/embed.js.map +1 -1
- package/dist/actions/enableTool.d.ts +2 -2
- package/dist/actions/enableTool.type-test.js +5 -5
- package/dist/actions/infer.d.ts +3 -1
- package/dist/actions/infer.js +11 -3
- package/dist/actions/infer.js.map +1 -1
- package/dist/actions/messages.d.ts +24 -0
- package/dist/actions/{setMessages.js → messages.js} +14 -10
- package/dist/actions/messages.js.map +1 -0
- package/dist/actions/pushModel.d.ts +5 -1
- package/dist/actions/pushModel.js +17 -2
- package/dist/actions/pushModel.js.map +1 -1
- package/dist/actions/{getScope.d.ts → scope.d.ts} +3 -1
- package/dist/actions/scope.js +10 -0
- package/dist/actions/scope.js.map +1 -0
- package/dist/actions/section.d.ts +23 -0
- package/dist/actions/section.js +64 -0
- package/dist/actions/section.js.map +1 -0
- package/dist/cli/cli_common.d.ts +1 -0
- package/dist/cli/main.js +6 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/runExec.js +21 -16
- package/dist/cli/runExec.js.map +1 -1
- package/dist/events/LEvent.d.ts +3 -1
- package/dist/events/SectionCleared.d.ts +5 -0
- package/dist/events/SectionCleared.js +2 -0
- package/dist/events/SectionCleared.js.map +1 -0
- package/dist/events/Sectioned.d.ts +5 -0
- package/dist/events/Sectioned.js +2 -0
- package/dist/events/Sectioned.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/testing/{ActorAssertions.d.ts → AgentAssertions.d.ts} +3 -3
- package/dist/testing/AgentAssertions.js +6 -0
- package/dist/testing/AgentAssertions.js.map +1 -0
- package/dist/testing/TestEmbeddingModel.js +1 -0
- package/dist/testing/TestEmbeddingModel.js.map +1 -1
- package/dist/testing/TestLanguageModel.js +1 -0
- package/dist/testing/TestLanguageModel.js.map +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/takeFirstAction.d.ts +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/Type.d.ts +1 -0
- package/dist/types/Type.js.map +1 -1
- package/dist/types/array.js +2 -2
- package/dist/types/array.js.map +1 -1
- package/dist/types/boolean.js +2 -2
- package/dist/types/boolean.js.map +1 -1
- package/dist/types/const.js +2 -2
- package/dist/types/const.js.map +1 -1
- package/dist/types/enum.js +2 -2
- package/dist/types/enum.js.map +1 -1
- package/dist/types/integer.js +2 -2
- package/dist/types/integer.js.map +1 -1
- package/dist/types/makeType.d.ts +2 -0
- package/dist/types/{declareType.js → makeType.js} +4 -3
- package/dist/types/makeType.js.map +1 -0
- package/dist/types/null.js +2 -2
- package/dist/types/null.js.map +1 -1
- package/dist/types/number.js +2 -2
- package/dist/types/number.js.map +1 -1
- package/dist/types/object.js +2 -2
- package/dist/types/object.js.map +1 -1
- package/dist/types/ref.js +2 -2
- package/dist/types/ref.js.map +1 -1
- package/dist/types/string.js +2 -2
- package/dist/types/string.js.map +1 -1
- package/dist/types/union.js +2 -2
- package/dist/types/union.js.map +1 -1
- package/dist/util/peekLast.d.ts +1 -0
- package/dist/util/peekLast.js +4 -0
- package/dist/util/peekLast.js.map +1 -0
- package/events/LEvent.ts +4 -0
- package/events/SectionCleared.ts +6 -0
- package/events/Sectioned.ts +6 -0
- package/index.ts +1 -1
- package/package.json +1 -1
- package/testing/{ActorAssertions.ts → AgentAssertions.ts} +3 -5
- package/testing/TestEmbeddingModel.ts +1 -0
- package/testing/TestLanguageModel.ts +1 -0
- package/testing/index.ts +1 -1
- package/testing/takeFirstAction.ts +2 -2
- package/types/Type.ts +1 -0
- package/types/array.ts +2 -2
- package/types/boolean.ts +2 -2
- package/types/const.ts +2 -2
- package/types/enum.ts +2 -2
- package/types/integer.ts +2 -2
- package/types/{declareType.ts → makeType.ts} +3 -2
- package/types/null.ts +2 -2
- package/types/number.ts +2 -2
- package/types/object.ts +2 -2
- package/types/ref.ts +2 -2
- package/types/string.ts +2 -2
- package/types/union.ts +2 -2
- package/util/peekLast.ts +3 -0
- package/Actor.ts +0 -20
- package/actions/actions_derived/getMessages.ts +0 -9
- package/actions/getScope.ts +0 -11
- package/actions/getSignal.ts +0 -10
- package/actions/getTools.ts +0 -11
- package/actions/removeMessage.ts +0 -22
- package/actions/removeModel.ts +0 -31
- package/actions/setMessages.ts +0 -66
- package/dist/Actor.d.ts +0 -14
- package/dist/Actor.js +0 -2
- package/dist/Actor.js.map +0 -1
- package/dist/actions/actions_derived/getMessages.d.ts +0 -3
- package/dist/actions/actions_derived/getMessages.js +0 -8
- package/dist/actions/actions_derived/getMessages.js.map +0 -1
- package/dist/actions/getScope.js +0 -8
- package/dist/actions/getScope.js.map +0 -1
- package/dist/actions/getSignal.d.ts +0 -4
- package/dist/actions/getSignal.js +0 -8
- package/dist/actions/getSignal.js.map +0 -1
- package/dist/actions/getTools.d.ts +0 -5
- package/dist/actions/getTools.js +0 -8
- package/dist/actions/getTools.js.map +0 -1
- package/dist/actions/removeMessage.d.ts +0 -9
- package/dist/actions/removeMessage.js +0 -17
- package/dist/actions/removeMessage.js.map +0 -1
- package/dist/actions/removeModel.d.ts +0 -10
- package/dist/actions/removeModel.js +0 -20
- package/dist/actions/removeModel.js.map +0 -1
- package/dist/actions/setMessages.d.ts +0 -16
- package/dist/actions/setMessages.js.map +0 -1
- package/dist/testing/ActorAssertions.js +0 -6
- package/dist/testing/ActorAssertions.js.map +0 -1
- package/dist/types/declareType.d.ts +0 -2
- package/dist/types/declareType.js.map +0 -1
package/dist/types/Type.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface TypeMembers<T extends JSONValue, J extends JSONType> extends St
|
|
|
21
21
|
declaration: () => Type<T, J> | ((...args: any) => Type<T, J>);
|
|
22
22
|
args?: Array<any>;
|
|
23
23
|
descriptions: Array<string>;
|
|
24
|
+
trace: string | undefined;
|
|
24
25
|
description(): string;
|
|
25
26
|
toJSON(): JSONRootType<J>;
|
|
26
27
|
assert(value: unknown): T;
|
package/dist/types/Type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Type.js","sourceRoot":"","sources":["../../types/Type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Type.js","sourceRoot":"","sources":["../../types/Type.ts"],"names":[],"mappings":"AA0CA,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;AAEjD,MAAM,UAAU,MAAM,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,UAAU,IAAI,OAAO,IAAI,KAAK,CAAA;AACxD,CAAC"}
|
package/dist/types/array.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { makeType } from "./makeType.js";
|
|
2
2
|
import { normalizeTypeLike } from "./TypeLike.js";
|
|
3
3
|
export function array(element) {
|
|
4
4
|
return _array(normalizeTypeLike(element));
|
|
5
5
|
}
|
|
6
6
|
export function _array(element) {
|
|
7
|
-
return
|
|
7
|
+
return makeType(() => _array, [element]);
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=array.js.map
|
package/dist/types/array.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.js","sourceRoot":"","sources":["../../types/array.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"array.js","sourceRoot":"","sources":["../../types/array.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,iBAAiB,EAAmE,MAAM,eAAe,CAAA;AAElH,MAAM,UAAU,KAAK,CACnB,OAAU;IAEV,OAAO,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAU,CAAA;AACpD,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,OAAa;IAClC,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;AAC1C,CAAC"}
|
package/dist/types/boolean.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const boolean =
|
|
1
|
+
import { makeType } from "./makeType.js";
|
|
2
|
+
export const boolean = makeType(() => boolean);
|
|
3
3
|
//# sourceMappingURL=boolean.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../types/boolean.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../types/boolean.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC,MAAM,CAAC,MAAM,OAAO,GAAmC,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAA"}
|
package/dist/types/const.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { makeType } from "./makeType.js";
|
|
2
2
|
function const_(type, value) {
|
|
3
|
-
return
|
|
3
|
+
return makeType(() => const_, [type, value]);
|
|
4
4
|
}
|
|
5
5
|
Object.defineProperty(const_, "name", { value: "const" });
|
|
6
6
|
export { const_ as const };
|
package/dist/types/const.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../types/const.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../types/const.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC,SAAS,MAAM,CACb,IAAgB,EAChB,KAAQ;IAER,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAe,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;AACvD,CAAC;AACD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;AACzD,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAA"}
|
package/dist/types/enum.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { makeType } from "./makeType.js";
|
|
2
2
|
export { enum_ as enum };
|
|
3
3
|
function enum_(...values) {
|
|
4
|
-
return
|
|
4
|
+
return makeType(() => enum_, values);
|
|
5
5
|
}
|
|
6
6
|
Object.defineProperty(enum_, "name", { value: "enum" });
|
|
7
7
|
//# sourceMappingURL=enum.js.map
|
package/dist/types/enum.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../types/enum.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../types/enum.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAA;AACxB,SAAS,KAAK,CAA0B,GAAG,MAAS;IAClD,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAQ,EAAE,MAAM,CAAC,CAAA;AACzC,CAAC;AACD,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA"}
|
package/dist/types/integer.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const integer =
|
|
1
|
+
import { makeType } from "./makeType.js";
|
|
2
|
+
export const integer = makeType(() => integer);
|
|
3
3
|
//# sourceMappingURL=integer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integer.js","sourceRoot":"","sources":["../../types/integer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"integer.js","sourceRoot":"","sources":["../../types/integer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC,MAAM,CAAC,MAAM,OAAO,GAAkC,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAA"}
|
|
@@ -5,12 +5,13 @@ import { isTemplateStringsArray } from "../util/isTemplateStringsArray.js";
|
|
|
5
5
|
import { AssertDiagnostics, formatAssertDiagnostics } from "./AssertDiagnostics.js";
|
|
6
6
|
import { toJSON } from "./toJSON.js";
|
|
7
7
|
import { TypeKey } from "./Type.js";
|
|
8
|
-
export function
|
|
8
|
+
export function makeType(declaration, args, descriptions = []) {
|
|
9
9
|
const type = Object.assign(Type, {
|
|
10
10
|
[TypeKey]: true,
|
|
11
11
|
declaration,
|
|
12
12
|
args,
|
|
13
13
|
descriptions,
|
|
14
|
+
trace: new Error().stack,
|
|
14
15
|
description() {
|
|
15
16
|
return descriptions.join("\n");
|
|
16
17
|
},
|
|
@@ -46,7 +47,7 @@ export function declareType(declaration, args, descriptions = []) {
|
|
|
46
47
|
});
|
|
47
48
|
return type;
|
|
48
49
|
function Type(e0, ...eRest) {
|
|
49
|
-
return
|
|
50
|
+
return makeType(declaration, args, [
|
|
50
51
|
...descriptions,
|
|
51
52
|
...isTemplateStringsArray(e0)
|
|
52
53
|
? [applyTemplateWithIndentation(e0, ...eRest)]
|
|
@@ -54,4 +55,4 @@ export function declareType(declaration, args, descriptions = []) {
|
|
|
54
55
|
]);
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
//# sourceMappingURL=
|
|
58
|
+
//# sourceMappingURL=makeType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"makeType.js","sourceRoot":"","sources":["../../types/makeType.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAA;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAE1E,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAEnF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAa,OAAO,EAAoB,MAAM,WAAW,CAAA;AAEhE,MAAM,UAAU,QAAQ,CACtB,WAA4C,EAC5C,IAAqB,EACrB,eAA8B,EAAE;IAEhC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CACxB,IAAI,EACJ;QACE,CAAC,OAAO,CAAC,EAAE,IAAI;QACf,WAAW;QACX,IAAI;QACJ,YAAY;QACZ,KAAK,EAAE,IAAI,KAAK,EAAE,CAAC,KAAK;QACxB,WAAW;YACT,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAChC,CAAC;QACD,WAAW,EAAE;YACX,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;gBAClB,MAAM,WAAW,GAAG,iBAAiB,CAAC,EAAE,EAAE,IAAa,EAAE,KAAK,CAAC,CAAA;gBAC/D,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;oBACvB,OAAO;wBACL,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAA0B,EAAE,CAAC,CAAC;4BACpE,IAAI;4BACJ,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;yBAC/B,CAAC,CAAC;qBACJ,CAAA;gBACH,CAAC;gBACD,OAAO,EAAE,KAAK,EAAE,KAAe,EAAE,CAAA;YACnC,CAAC;SACF;QACD,MAAM;QACN,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;YAChB,MAAM,WAAW,GAAG,iBAAiB,CAAC,EAAE,EAAE,IAAa,EAAE,KAAK,CAAC,CAAA;YAC/D,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;gBACvB,MAAM,IAAI,qBAAqB,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC,CAAA;YACvE,CAAC;YACD,OAAO,KAAc,CAAA;QACvB,CAAC;QACD,GAAG;YACD,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;gBAChB,OAAO,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YAC3B,CAAC;SACF;KACoC,CAC1B,CAAA;IACf,OAAO,IAAI,CAAA;IAIX,SAAS,IAAI,CAAC,EAAyC,EAAE,GAAG,KAA4B;QACtF,OAAO,QAAQ,CAAC,WAAW,EAAE,IAAI,EAAE;YACjC,GAAG,YAAY;YACf,GAAG,sBAAsB,CAAC,EAAE,CAAC;gBAC3B,CAAC,CAAC,CAAC,4BAA4B,CAAC,EAAE,EAAE,GAAG,KAAK,CAAC,CAAC;gBAC9C,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;SACnD,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
|
package/dist/types/null.js
CHANGED
package/dist/types/null.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"null.js","sourceRoot":"","sources":["../../types/null.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"null.js","sourceRoot":"","sources":["../../types/null.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC,MAAM,KAAK,GAA6B,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAA;AAC7D,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAA"}
|
package/dist/types/number.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const number =
|
|
1
|
+
import { makeType } from "./makeType.js";
|
|
2
|
+
export const number = makeType(() => number);
|
|
3
3
|
//# sourceMappingURL=number.js.map
|
package/dist/types/number.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.js","sourceRoot":"","sources":["../../types/number.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"number.js","sourceRoot":"","sources":["../../types/number.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC,MAAM,CAAC,MAAM,MAAM,GAAiC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA"}
|
package/dist/types/object.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { makeType } from "./makeType.js";
|
|
2
2
|
import {} from "./Type.js";
|
|
3
3
|
import { normalizeTypeLikes } from "./TypeLike.js";
|
|
4
4
|
export function object(fields) {
|
|
5
5
|
return normalizeTypeLikes(fields);
|
|
6
6
|
}
|
|
7
7
|
export function _object(fields) {
|
|
8
|
-
return
|
|
8
|
+
return makeType(() => _object, [fields]);
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=object.js.map
|
package/dist/types/object.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../types/object.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../types/object.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAa,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,kBAAkB,EAAsE,MAAM,eAAe,CAAA;AAEtH,MAAM,UAAU,MAAM,CACpB,MAAS;IAET,OAAO,kBAAkB,CAAC,MAAM,CAAU,CAAA;AAC5C,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,MAAoB;IAC1C,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;AAC1C,CAAC"}
|
package/dist/types/ref.js
CHANGED
package/dist/types/ref.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../types/ref.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../types/ref.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC,MAAM,UAAU,GAAG,CAA+C,OAAyB;IACzF,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAS,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;AAC7C,CAAC"}
|
package/dist/types/string.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const string =
|
|
1
|
+
import { makeType } from "./makeType.js";
|
|
2
|
+
export const string = makeType(() => string);
|
|
3
3
|
//# sourceMappingURL=string.js.map
|
package/dist/types/string.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../types/string.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../types/string.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC,MAAM,CAAC,MAAM,MAAM,GAAiC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA"}
|
package/dist/types/union.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { makeType } from "./makeType.js";
|
|
2
2
|
import { normalizeTypeLike } from "./TypeLike.js";
|
|
3
3
|
export function union(...members) {
|
|
4
4
|
return _union(...members.map(normalizeTypeLike));
|
|
5
5
|
}
|
|
6
6
|
export function _union(...members) {
|
|
7
|
-
return
|
|
7
|
+
return makeType(() => _union, members);
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=union.js.map
|
package/dist/types/union.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"union.js","sourceRoot":"","sources":["../../types/union.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"union.js","sourceRoot":"","sources":["../../types/union.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,iBAAiB,EAAmE,MAAM,eAAe,CAAA;AAElH,MAAM,UAAU,KAAK,CACnB,GAAG,OAAU;IAEb,OAAO,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAU,CAAA;AAC3D,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,GAAG,OAAoB;IAC5C,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AACxC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function peekLast<T>(set: Set<T>): T | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"peekLast.js","sourceRoot":"","sources":["../../util/peekLast.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CAAI,GAAW;IACrC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,CAAA;AAC/B,CAAC"}
|
package/events/LEvent.ts
CHANGED
|
@@ -11,6 +11,8 @@ import type { MessagesSet } from "./MessagesSet.ts"
|
|
|
11
11
|
import type { ModelPushed } from "./ModelPushed.ts"
|
|
12
12
|
import type { ModelRemoved } from "./ModelRemoved.ts"
|
|
13
13
|
import type { Returned } from "./Returned.ts"
|
|
14
|
+
import type { SectionCleared } from "./SectionCleared.ts"
|
|
15
|
+
import type { Sectioned } from "./Sectioned.ts"
|
|
14
16
|
import type { Threw } from "./Threw.ts"
|
|
15
17
|
import type { ToolCalled } from "./ToolCalled.ts"
|
|
16
18
|
import type { ToolDisabled } from "./ToolDisabled.ts"
|
|
@@ -34,3 +36,5 @@ export type LEvent =
|
|
|
34
36
|
| Forked
|
|
35
37
|
| ModelPushed
|
|
36
38
|
| ModelRemoved
|
|
39
|
+
| Sectioned
|
|
40
|
+
| SectionCleared
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import type { IsExact } from "conditional-type-checks"
|
|
2
2
|
import type { Action } from "../Action.ts"
|
|
3
|
-
import type {
|
|
3
|
+
import type { AgentLike } from "../Agent.ts"
|
|
4
4
|
import type { Spec } from "../Spec.ts"
|
|
5
5
|
import type { Expand } from "../util/Expand.ts"
|
|
6
6
|
|
|
7
|
-
export interface
|
|
7
|
+
export interface AgentAssertions<S extends Spec> {
|
|
8
8
|
assertSpec<A extends Spec>(
|
|
9
9
|
...[passes]: IsExact<S, Expand<A>> extends true ? [passes?: true] : [passes: false]
|
|
10
10
|
): void
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export function
|
|
14
|
-
_actorLike: ActorLike<Y, R>,
|
|
15
|
-
): ActorAssertions<Y[""]> {
|
|
13
|
+
export function AgentAssertions<Y extends Action, R>(_agentLike: AgentLike<Y, R>): AgentAssertions<Y[""]> {
|
|
16
14
|
return {
|
|
17
15
|
assertSpec: () => {},
|
|
18
16
|
}
|
package/testing/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Action } from "../Action.ts"
|
|
2
|
-
import type {
|
|
2
|
+
import type { AgentLike } from "../Agent.ts"
|
|
3
3
|
import { unwrapDeferred } from "../util/unwrapDeferred.ts"
|
|
4
4
|
|
|
5
|
-
export async function takeFirstAction<Y extends Action>(f:
|
|
5
|
+
export async function takeFirstAction<Y extends Action>(f: AgentLike<Y>): Promise<Y | undefined> {
|
|
6
6
|
const { value } = await unwrapDeferred(f).next()
|
|
7
7
|
return value
|
|
8
8
|
}
|
package/types/Type.ts
CHANGED
|
@@ -33,6 +33,7 @@ export interface TypeMembers<T extends JSONValue, J extends JSONType> extends St
|
|
|
33
33
|
declaration: () => Type<T, J> | ((...args: any) => Type<T, J>)
|
|
34
34
|
args?: Array<any>
|
|
35
35
|
descriptions: Array<string>
|
|
36
|
+
trace: string | undefined
|
|
36
37
|
description(): string
|
|
37
38
|
toJSON(): JSONRootType<J>
|
|
38
39
|
assert(value: unknown): T
|
package/types/array.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { declareType } from "./declareType.ts"
|
|
2
1
|
import type { JSONType } from "./JSONType.ts"
|
|
3
2
|
import type { JSONTypeBase } from "./JSONTypeBase.ts"
|
|
3
|
+
import { makeType } from "./makeType.ts"
|
|
4
4
|
import type { Type } from "./Type.ts"
|
|
5
5
|
import { normalizeTypeLike, type NormalizeTypeLikeJ, type NormalizeTypeLikeT, type TypeLike } from "./TypeLike.ts"
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ export function array<const F extends TypeLike>(
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export function _array(element: Type): Type {
|
|
14
|
-
return
|
|
14
|
+
return makeType(() => _array, [element])
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface JSONArrayType<E extends JSONType = any> extends JSONTypeBase {
|
package/types/boolean.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { declareType } from "./declareType.ts"
|
|
2
1
|
import type { JSONTypeBase } from "./JSONTypeBase.ts"
|
|
2
|
+
import { makeType } from "./makeType.ts"
|
|
3
3
|
import type { Type } from "./Type.ts"
|
|
4
4
|
|
|
5
|
-
export const boolean: Type<boolean, JSONBooleanType> =
|
|
5
|
+
export const boolean: Type<boolean, JSONBooleanType> = makeType(() => boolean)
|
|
6
6
|
|
|
7
7
|
export interface JSONBooleanType extends JSONTypeBase {
|
|
8
8
|
type: "boolean"
|
package/types/const.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { JSONValue } from "../util/JSONValue.ts"
|
|
2
|
-
import { declareType } from "./declareType.ts"
|
|
3
2
|
import type { ConstableType } from "./JSONType.ts"
|
|
3
|
+
import { makeType } from "./makeType.ts"
|
|
4
4
|
import type { Type } from "./Type.ts"
|
|
5
5
|
|
|
6
6
|
function const_<T extends JSONValue, J extends ConstableType, const V extends T>(
|
|
7
7
|
type: Type<T, J>,
|
|
8
8
|
value: V,
|
|
9
9
|
): Type<V, JSONConstType<J, V>> {
|
|
10
|
-
return
|
|
10
|
+
return makeType(() => const_<T, J, V>, [type, value])
|
|
11
11
|
}
|
|
12
12
|
Object.defineProperty(const_, "name", { value: "const" })
|
|
13
13
|
export { const_ as const }
|
package/types/enum.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { declareType } from "./declareType.ts"
|
|
2
1
|
import type { JSONTypeBase } from "./JSONTypeBase.ts"
|
|
2
|
+
import { makeType } from "./makeType.ts"
|
|
3
3
|
import type { Type } from "./Type.ts"
|
|
4
4
|
|
|
5
5
|
export { enum_ as enum }
|
|
6
6
|
function enum_<A extends Array<string>>(...values: A): Type<A[number], JSONEnumType<A[number]>> {
|
|
7
|
-
return
|
|
7
|
+
return makeType(() => enum_<A>, values)
|
|
8
8
|
}
|
|
9
9
|
Object.defineProperty(enum_, "name", { value: "enum" })
|
|
10
10
|
|
package/types/integer.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { declareType } from "./declareType.ts"
|
|
2
1
|
import type { JSONTypeBase } from "./JSONTypeBase.ts"
|
|
2
|
+
import { makeType } from "./makeType.ts"
|
|
3
3
|
import type { Type } from "./Type.ts"
|
|
4
4
|
|
|
5
|
-
export const integer: Type<number, JSONIntegerType> =
|
|
5
|
+
export const integer: Type<number, JSONIntegerType> = makeType(() => integer)
|
|
6
6
|
|
|
7
7
|
export interface JSONIntegerType extends JSONTypeBase {
|
|
8
8
|
type: "integer"
|
|
@@ -10,7 +10,7 @@ import type { JSONObjectType } from "./object.ts"
|
|
|
10
10
|
import { toJSON } from "./toJSON.ts"
|
|
11
11
|
import { type Type, TypeKey, type TypeMembers } from "./Type.ts"
|
|
12
12
|
|
|
13
|
-
export function
|
|
13
|
+
export function makeType<X extends Type>(
|
|
14
14
|
declaration: () => X | ((...args: any) => X),
|
|
15
15
|
args?: Array<unknown>,
|
|
16
16
|
descriptions: Array<string> = [],
|
|
@@ -22,6 +22,7 @@ export function declareType<X extends Type>(
|
|
|
22
22
|
declaration,
|
|
23
23
|
args,
|
|
24
24
|
descriptions,
|
|
25
|
+
trace: new Error().stack,
|
|
25
26
|
description() {
|
|
26
27
|
return descriptions.join("\n")
|
|
27
28
|
},
|
|
@@ -61,7 +62,7 @@ export function declareType<X extends Type>(
|
|
|
61
62
|
function Type(template: TemplateStringsArray, ...substitutions: Array<string>): X
|
|
62
63
|
function Type(...values: Array<Falsy | string>): X
|
|
63
64
|
function Type(e0: TemplateStringsArray | Falsy | string, ...eRest: Array<Falsy | string>): X {
|
|
64
|
-
return
|
|
65
|
+
return makeType(declaration, args, [
|
|
65
66
|
...descriptions,
|
|
66
67
|
...isTemplateStringsArray(e0)
|
|
67
68
|
? [applyTemplateWithIndentation(e0, ...eRest)]
|
package/types/null.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { declareType } from "./declareType.ts"
|
|
2
1
|
import type { JSONTypeBase } from "./JSONTypeBase.ts"
|
|
2
|
+
import { makeType } from "./makeType.ts"
|
|
3
3
|
import type { Type } from "./Type.ts"
|
|
4
4
|
|
|
5
|
-
const null_: Type<null, JSONNullType> =
|
|
5
|
+
const null_: Type<null, JSONNullType> = makeType(() => null_)
|
|
6
6
|
export { null_ as null }
|
|
7
7
|
|
|
8
8
|
export interface JSONNullType extends JSONTypeBase {
|
package/types/number.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { declareType } from "./declareType.ts"
|
|
2
1
|
import type { JSONTypeBase } from "./JSONTypeBase.ts"
|
|
2
|
+
import { makeType } from "./makeType.ts"
|
|
3
3
|
import type { Type } from "./Type.ts"
|
|
4
4
|
|
|
5
|
-
export const number: Type<number, JSONNumberType> =
|
|
5
|
+
export const number: Type<number, JSONNumberType> = makeType(() => number)
|
|
6
6
|
|
|
7
7
|
export interface JSONNumberType extends JSONTypeBase {
|
|
8
8
|
type: "number"
|
package/types/object.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JSONKey } from "../util/JSONKey.ts"
|
|
2
|
-
import { declareType } from "./declareType.ts"
|
|
3
2
|
import type { JSONType } from "./JSONType.ts"
|
|
4
3
|
import type { JSONTypeBase } from "./JSONTypeBase.ts"
|
|
4
|
+
import { makeType } from "./makeType.ts"
|
|
5
5
|
import { type Type } from "./Type.ts"
|
|
6
6
|
import { normalizeTypeLikes, type NormalizeTypeLikesJ, type NormalizeTypeLikesT, type TypeLikes } from "./TypeLike.ts"
|
|
7
7
|
|
|
@@ -12,7 +12,7 @@ export function object<const F extends TypeLikes>(
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export function _object(fields: ObjectFields): Type {
|
|
15
|
-
return
|
|
15
|
+
return makeType(() => _object, [fields])
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export interface JSONObjectType<F extends Record<JSONKey, JSONType> = any> extends JSONTypeBase {
|
package/types/ref.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { JSONValue } from "../util/JSONValue.ts"
|
|
2
|
-
import { declareType } from "./declareType.ts"
|
|
3
2
|
import type { ConstableType } from "./JSONType.ts"
|
|
3
|
+
import { makeType } from "./makeType.ts"
|
|
4
4
|
import type { Type } from "./Type.ts"
|
|
5
5
|
|
|
6
6
|
export function ref<T extends JSONValue, J extends ConstableType>(getType: () => Type<T, J>): Type<T, JSONRefType> {
|
|
7
|
-
return
|
|
7
|
+
return makeType(() => ref<T, J>, [getType])
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export interface JSONRefType {
|
package/types/string.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { declareType } from "./declareType.ts"
|
|
2
1
|
import type { JSONTypeBase } from "./JSONTypeBase.ts"
|
|
2
|
+
import { makeType } from "./makeType.ts"
|
|
3
3
|
import type { Type } from "./Type.ts"
|
|
4
4
|
|
|
5
|
-
export const string: Type<string, JSONStringType> =
|
|
5
|
+
export const string: Type<string, JSONStringType> = makeType(() => string)
|
|
6
6
|
|
|
7
7
|
export interface JSONStringType extends JSONTypeBase {
|
|
8
8
|
type: "string"
|
package/types/union.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { declareType } from "./declareType.ts"
|
|
2
1
|
import type { JSONType } from "./JSONType.ts"
|
|
3
2
|
import type { JSONTypeBase } from "./JSONTypeBase.ts"
|
|
3
|
+
import { makeType } from "./makeType.ts"
|
|
4
4
|
import type { Type } from "./Type.ts"
|
|
5
5
|
import { normalizeTypeLike, type NormalizeTypeLikeJ, type NormalizeTypeLikeT, type TypeLike } from "./TypeLike.ts"
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ export function union<const M extends Array<TypeLike>>(
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export function _union(...members: Array<Type>): Type {
|
|
14
|
-
return
|
|
14
|
+
return makeType(() => _union, members)
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface JSONUnionType<M extends JSONType = any> extends JSONTypeBase {
|
package/util/peekLast.ts
ADDED
package/Actor.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Action } from "./Action.ts"
|
|
2
|
-
import type { DeferredOr } from "./util/DeferredOr.ts"
|
|
3
|
-
import type { IteratorLike } from "./util/IteratorLike.ts"
|
|
4
|
-
import type { JSONKey } from "./util/JSONKey.ts"
|
|
5
|
-
|
|
6
|
-
export type Actor<Y extends Action = Action, R = any> = IteratorLike<Y, R>
|
|
7
|
-
|
|
8
|
-
export type ActorLike<Y extends Action = Action, R = any> = DeferredOr<Actor<Y, R>>
|
|
9
|
-
export type ActorLikeY<A extends ActorLike> = A extends ActorLike<infer Y> ? Y : never
|
|
10
|
-
export type ActorLikeT<A extends ActorLike> = A extends ActorLike<Action, infer T> ? T : never
|
|
11
|
-
|
|
12
|
-
export type ActorLikes = ActorLikeArray | ActorLikeRecord
|
|
13
|
-
export type ActorLikeArray = Array<ActorLike>
|
|
14
|
-
export type ActorLikeRecord = Record<JSONKey, ActorLike>
|
|
15
|
-
|
|
16
|
-
export type ActorLikesT<A extends ActorLikes> =
|
|
17
|
-
& {
|
|
18
|
-
-readonly [K in keyof A]: A[K] extends ActorLike<Action, infer T> ? T : never
|
|
19
|
-
}
|
|
20
|
-
& {}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Action } from "../../Action.ts"
|
|
2
|
-
import type { Message } from "../../Message.ts"
|
|
3
|
-
|
|
4
|
-
export function* getMessages(): Generator<Action<"get_messages">, Array<Message>> {
|
|
5
|
-
return yield Action("get_messages", (scope) => ({
|
|
6
|
-
...scope,
|
|
7
|
-
nextArg: [...scope.messages],
|
|
8
|
-
}))
|
|
9
|
-
}
|
package/actions/getScope.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Action } from "../Action.ts"
|
|
2
|
-
import type { Scope } from "../Scope.ts"
|
|
3
|
-
|
|
4
|
-
export interface getScope extends Action<"get_scope", never> {}
|
|
5
|
-
|
|
6
|
-
export function* getScope(): Generator<getScope, Scope> {
|
|
7
|
-
return yield Action("get_scope", (scope) => ({
|
|
8
|
-
...scope,
|
|
9
|
-
nextArg: scope,
|
|
10
|
-
}))
|
|
11
|
-
}
|
package/actions/getSignal.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Action } from "../Action.ts"
|
|
2
|
-
|
|
3
|
-
export interface getSignal extends Action<"get_signal", never> {}
|
|
4
|
-
|
|
5
|
-
export function* getSignal(): Generator<getSignal, AbortSignal> {
|
|
6
|
-
return yield (Action("get_signal", (scope) => ({
|
|
7
|
-
...scope,
|
|
8
|
-
nextArg: scope.controller.signal,
|
|
9
|
-
})))
|
|
10
|
-
}
|