liminal 0.5.16 → 0.6.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/CHANGELOG.md +12 -0
- package/Context.ts +11 -47
- package/L.ts +4 -0
- package/LEvent.ts +20 -53
- package/_emit.ts +16 -0
- package/assistant.ts +53 -0
- package/dist/Context.d.ts +15 -30
- package/dist/Context.js +9 -22
- package/dist/Context.js.map +1 -1
- package/dist/L.d.ts +4 -0
- package/dist/L.js +5 -0
- package/dist/L.js.map +1 -0
- package/dist/LEvent.d.ts +29 -62
- package/dist/LEvent.js +14 -46
- package/dist/LEvent.js.map +1 -1
- package/dist/_emit.d.ts +2 -0
- package/dist/_emit.js +16 -0
- package/dist/_emit.js.map +1 -0
- package/dist/assistant.d.ts +8 -0
- package/dist/assistant.js +46 -0
- package/dist/assistant.js.map +1 -0
- package/dist/index.d.ts +2 -13
- package/dist/index.js +2 -13
- package/dist/index.js.map +1 -1
- package/dist/messages.d.ts +4 -0
- package/dist/messages.js +4 -0
- package/dist/messages.js.map +1 -0
- package/dist/set.d.ts +4 -0
- package/dist/set.js +9 -0
- package/dist/set.js.map +1 -0
- package/dist/strand.d.ts +16 -0
- package/dist/strand.js +16 -0
- package/dist/strand.js.map +1 -0
- package/dist/todo.test.js +3 -0
- package/dist/todo.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/user.d.ts +6 -0
- package/dist/user.js +18 -0
- package/dist/user.js.map +1 -0
- package/dist/util/JSONValue.d.ts +0 -3
- package/dist/util/JSONValue.js +1 -31
- package/dist/util/JSONValue.js.map +1 -1
- package/dist/util/fixTemplateStrings.d.ts +11 -0
- package/dist/util/fixTemplateStrings.js +83 -0
- package/dist/util/fixTemplateStrings.js.map +1 -0
- package/index.ts +2 -13
- package/messages.ts +5 -0
- package/package.json +4 -3
- package/set.ts +10 -0
- package/strand.ts +38 -0
- package/todo.test.ts +3 -0
- package/user.ts +24 -0
- package/util/JSONValue.ts +0 -30
- package/util/fixTemplateStrings.ts +99 -0
- package/Adapter.ts +0 -27
- package/AdapterRegistry.ts +0 -78
- package/Config.ts +0 -13
- package/Definition.ts +0 -48
- package/EventBase.ts +0 -23
- package/Handler.ts +0 -4
- package/L/L.ts +0 -24
- package/L/all.ts +0 -39
- package/L/assistant.ts +0 -28
- package/L/catch.ts +0 -38
- package/L/continuation.ts +0 -14
- package/L/emit.ts +0 -16
- package/L/focus.ts +0 -17
- package/L/infer.ts +0 -34
- package/L/message.ts +0 -16
- package/L/reflect.ts +0 -13
- package/L/run.ts +0 -30
- package/L/schema/_schema_common.ts +0 -29
- package/L/schema/anyOf.ts +0 -10
- package/L/schema/array.ts +0 -13
- package/L/schema/boolean.ts +0 -8
- package/L/schema/const.ts +0 -18
- package/L/schema/enum.ts +0 -18
- package/L/schema/integer.ts +0 -6
- package/L/schema/null.ts +0 -8
- package/L/schema/number.ts +0 -8
- package/L/schema/object.ts +0 -21
- package/L/schema/string.ts +0 -11
- package/L/strand.ts +0 -22
- package/L/stream.ts +0 -16
- package/L/system.ts +0 -18
- package/L/user.ts +0 -18
- package/LiminalAssertionError.ts +0 -19
- package/Message.ts +0 -16
- package/Rune.test.ts +0 -5
- package/Rune.ts +0 -60
- package/Schema.ts +0 -185
- package/Strand.ts +0 -284
- package/Tool.ts +0 -26
- package/TypeAdapter.ts +0 -3
- package/dist/Adapter.d.ts +0 -18
- package/dist/Adapter.js +0 -13
- package/dist/Adapter.js.map +0 -1
- package/dist/AdapterRegistry.d.ts +0 -27
- package/dist/AdapterRegistry.js +0 -62
- package/dist/AdapterRegistry.js.map +0 -1
- package/dist/Config.d.ts +0 -12
- package/dist/Config.js +0 -2
- package/dist/Config.js.map +0 -1
- package/dist/Definition.d.ts +0 -24
- package/dist/Definition.js +0 -29
- package/dist/Definition.js.map +0 -1
- package/dist/EventBase.d.ts +0 -11
- package/dist/EventBase.js +0 -16
- package/dist/EventBase.js.map +0 -1
- package/dist/Handler.d.ts +0 -3
- package/dist/Handler.js +0 -2
- package/dist/Handler.js.map +0 -1
- package/dist/L/L.d.ts +0 -24
- package/dist/L/L.js +0 -25
- package/dist/L/L.js.map +0 -1
- package/dist/L/all.d.ts +0 -14
- package/dist/L/all.js +0 -20
- package/dist/L/all.js.map +0 -1
- package/dist/L/assistant.d.ts +0 -11
- package/dist/L/assistant.js +0 -15
- package/dist/L/assistant.js.map +0 -1
- package/dist/L/catch.d.ts +0 -16
- package/dist/L/catch.js +0 -25
- package/dist/L/catch.js.map +0 -1
- package/dist/L/continuation.d.ts +0 -4
- package/dist/L/continuation.js +0 -13
- package/dist/L/continuation.js.map +0 -1
- package/dist/L/emit.d.ts +0 -7
- package/dist/L/emit.js +0 -15
- package/dist/L/emit.js.map +0 -1
- package/dist/L/focus.d.ts +0 -8
- package/dist/L/focus.js +0 -14
- package/dist/L/focus.js.map +0 -1
- package/dist/L/infer.d.ts +0 -8
- package/dist/L/infer.js +0 -30
- package/dist/L/infer.js.map +0 -1
- package/dist/L/message.d.ts +0 -8
- package/dist/L/message.js +0 -14
- package/dist/L/message.js.map +0 -1
- package/dist/L/reflect.d.ts +0 -5
- package/dist/L/reflect.js +0 -11
- package/dist/L/reflect.js.map +0 -1
- package/dist/L/run.d.ts +0 -16
- package/dist/L/run.js +0 -16
- package/dist/L/run.js.map +0 -1
- package/dist/L/schema/_schema_common.d.ts +0 -6
- package/dist/L/schema/_schema_common.js +0 -19
- package/dist/L/schema/_schema_common.js.map +0 -1
- package/dist/L/schema/anyOf.d.ts +0 -5
- package/dist/L/schema/anyOf.js +0 -5
- package/dist/L/schema/anyOf.js.map +0 -1
- package/dist/L/schema/array.d.ts +0 -5
- package/dist/L/schema/array.js +0 -8
- package/dist/L/schema/array.js.map +0 -1
- package/dist/L/schema/boolean.d.ts +0 -6
- package/dist/L/schema/boolean.js +0 -4
- package/dist/L/schema/boolean.js.map +0 -1
- package/dist/L/schema/const.d.ts +0 -8
- package/dist/L/schema/const.js +0 -10
- package/dist/L/schema/const.js.map +0 -1
- package/dist/L/schema/enum.d.ts +0 -8
- package/dist/L/schema/enum.js +0 -10
- package/dist/L/schema/enum.js.map +0 -1
- package/dist/L/schema/integer.d.ts +0 -5
- package/dist/L/schema/integer.js +0 -3
- package/dist/L/schema/integer.js.map +0 -1
- package/dist/L/schema/null.d.ts +0 -6
- package/dist/L/schema/null.js +0 -4
- package/dist/L/schema/null.js.map +0 -1
- package/dist/L/schema/number.d.ts +0 -6
- package/dist/L/schema/number.js +0 -4
- package/dist/L/schema/number.js.map +0 -1
- package/dist/L/schema/object.d.ts +0 -9
- package/dist/L/schema/object.js +0 -12
- package/dist/L/schema/object.js.map +0 -1
- package/dist/L/schema/string.d.ts +0 -8
- package/dist/L/schema/string.js +0 -4
- package/dist/L/schema/string.js.map +0 -1
- package/dist/L/strand.d.ts +0 -9
- package/dist/L/strand.js +0 -16
- package/dist/L/strand.js.map +0 -1
- package/dist/L/stream.d.ts +0 -4
- package/dist/L/stream.js +0 -15
- package/dist/L/stream.js.map +0 -1
- package/dist/L/system.d.ts +0 -4
- package/dist/L/system.js +0 -8
- package/dist/L/system.js.map +0 -1
- package/dist/L/user.d.ts +0 -4
- package/dist/L/user.js +0 -8
- package/dist/L/user.js.map +0 -1
- package/dist/LiminalAssertionError.d.ts +0 -8
- package/dist/LiminalAssertionError.js +0 -20
- package/dist/LiminalAssertionError.js.map +0 -1
- package/dist/Message.d.ts +0 -14
- package/dist/Message.js +0 -2
- package/dist/Message.js.map +0 -1
- package/dist/Rune.d.ts +0 -46
- package/dist/Rune.js +0 -11
- package/dist/Rune.js.map +0 -1
- package/dist/Rune.test.js +0 -5
- package/dist/Rune.test.js.map +0 -1
- package/dist/Schema.d.ts +0 -46
- package/dist/Schema.js +0 -130
- package/dist/Schema.js.map +0 -1
- package/dist/Strand.d.ts +0 -81
- package/dist/Strand.js +0 -200
- package/dist/Strand.js.map +0 -1
- package/dist/Tool.d.ts +0 -10
- package/dist/Tool.js +0 -19
- package/dist/Tool.js.map +0 -1
- package/dist/TypeAdapter.d.ts +0 -1
- package/dist/TypeAdapter.js +0 -3
- package/dist/TypeAdapter.js.map +0 -1
- package/dist/errors.d.ts +0 -9
- package/dist/errors.js +0 -11
- package/dist/errors.js.map +0 -1
- package/dist/util/EnsureNarrow.d.ts +0 -1
- package/dist/util/EnsureNarrow.js +0 -2
- package/dist/util/EnsureNarrow.js.map +0 -1
- package/dist/util/attachCustomInspect.d.ts +0 -1
- package/dist/util/attachCustomInspect.js +0 -11
- package/dist/util/attachCustomInspect.js.map +0 -1
- package/errors.ts +0 -12
- package/util/EnsureNarrow.ts +0 -1
- package/util/attachCustomInspect.ts +0 -14
- /package/dist/{Rune.test.d.ts → todo.test.d.ts} +0 -0
package/dist/Definition.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export var Definition;
|
|
2
|
-
(function (Definition) {
|
|
3
|
-
/**
|
|
4
|
-
* Converts a Definition into a RuneIterator.
|
|
5
|
-
*
|
|
6
|
-
* This function handles all the different forms a Definition can take:
|
|
7
|
-
* - Synchronous iterables
|
|
8
|
-
* - Asynchronous iterables
|
|
9
|
-
* - Factory functions returning iterables
|
|
10
|
-
*
|
|
11
|
-
* @param definition The definition to unwrap.
|
|
12
|
-
* @returns A RuneIterator ready for consumption.
|
|
13
|
-
*/
|
|
14
|
-
function unwrap(definition) {
|
|
15
|
-
if (Symbol.iterator in definition) {
|
|
16
|
-
return definition[Symbol.iterator]();
|
|
17
|
-
}
|
|
18
|
-
else if (Symbol.asyncIterator in definition) {
|
|
19
|
-
return definition[Symbol.asyncIterator]();
|
|
20
|
-
}
|
|
21
|
-
const iterable = definition();
|
|
22
|
-
if (Symbol.iterator in iterable) {
|
|
23
|
-
return iterable[Symbol.iterator]();
|
|
24
|
-
}
|
|
25
|
-
return iterable[Symbol.asyncIterator]();
|
|
26
|
-
}
|
|
27
|
-
Definition.unwrap = unwrap;
|
|
28
|
-
})(Definition || (Definition = {}));
|
|
29
|
-
//# sourceMappingURL=Definition.js.map
|
package/dist/Definition.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Definition.js","sourceRoot":"","sources":["../Definition.ts"],"names":[],"mappings":"AAQA,MAAM,KAAW,UAAU,CAuC1B;AAvCD,WAAiB,UAAU;IAgBzB;;;;;;;;;;OAUG;IACH,SAAgB,MAAM,CAAyB,UAA4B;QACzE,IAAI,MAAM,CAAC,QAAQ,IAAI,UAAU,EAAE,CAAC;YAClC,OAAO,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAA;QACtC,CAAC;aAAM,IAAI,MAAM,CAAC,aAAa,IAAI,UAAU,EAAE,CAAC;YAC9C,OAAO,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAA;QAC3C,CAAC;QACD,MAAM,QAAQ,GAAG,UAAU,EAAE,CAAA;QAC7B,IAAI,MAAM,CAAC,QAAQ,IAAI,QAAQ,EAAE,CAAC;YAChC,OAAO,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAA;QACpC,CAAC;QACD,OAAO,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAA;IACzC,CAAC;IAXe,iBAAM,SAWrB,CAAA;AACH,CAAC,EAvCgB,UAAU,KAAV,UAAU,QAuC1B"}
|
package/dist/EventBase.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface EventBase<B extends symbol = symbol, K extends string = string> {
|
|
2
|
-
readonly brand: B;
|
|
3
|
-
readonly type: K;
|
|
4
|
-
}
|
|
5
|
-
export declare function EventBase<B extends symbol, K extends string>(brand: B, type: K): {
|
|
6
|
-
new (): {
|
|
7
|
-
readonly brand: B;
|
|
8
|
-
readonly type: K;
|
|
9
|
-
};
|
|
10
|
-
is<T>(this: new (...args: any) => T, value: unknown): value is T;
|
|
11
|
-
};
|
package/dist/EventBase.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { attachCustomInspect } from "./util/attachCustomInspect.js";
|
|
2
|
-
export function EventBase(brand, type) {
|
|
3
|
-
return class {
|
|
4
|
-
static is(value) {
|
|
5
|
-
return typeof value === "object" && value !== null
|
|
6
|
-
&& "brand" in value && value.brand === brand
|
|
7
|
-
&& "type" in value && value.type === type;
|
|
8
|
-
}
|
|
9
|
-
brand = brand;
|
|
10
|
-
type = type;
|
|
11
|
-
static {
|
|
12
|
-
attachCustomInspect(this, ({ brand: _0, type: _1, ...rest }) => rest);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=EventBase.js.map
|
package/dist/EventBase.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EventBase.js","sourceRoot":"","sources":["../EventBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAOnE,MAAM,UAAU,SAAS,CAAqC,KAAQ,EAAE,IAAO;IAC7E,OAAO;QACL,MAAM,CAAC,EAAE,CAAkC,KAAc;YACvD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;mBAC7C,OAAO,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,KAAK,KAAK;mBACzC,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAA;QAC7C,CAAC;QAEQ,KAAK,GAAG,KAAK,CAAA;QACb,IAAI,GAAG,IAAI,CAAA;QAEpB;YACE,mBAAmB,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAA;QACvE,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/Handler.d.ts
DELETED
package/dist/Handler.js
DELETED
package/dist/Handler.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Handler.js","sourceRoot":"","sources":["../Handler.ts"],"names":[],"mappings":""}
|
package/dist/L/L.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export * from "./all.ts";
|
|
2
|
-
export * from "./assistant.ts";
|
|
3
|
-
export * from "./catch.ts";
|
|
4
|
-
export * from "./continuation.ts";
|
|
5
|
-
export * from "./emit.ts";
|
|
6
|
-
export * from "./focus.ts";
|
|
7
|
-
export * from "./infer.ts";
|
|
8
|
-
export * from "./message.ts";
|
|
9
|
-
export * from "./reflect.ts";
|
|
10
|
-
export * from "./run.ts";
|
|
11
|
-
export * from "./schema/anyOf.ts";
|
|
12
|
-
export * from "./schema/array.ts";
|
|
13
|
-
export * from "./schema/boolean.ts";
|
|
14
|
-
export * from "./schema/const.ts";
|
|
15
|
-
export * from "./schema/enum.ts";
|
|
16
|
-
export * from "./schema/integer.ts";
|
|
17
|
-
export * from "./schema/null.ts";
|
|
18
|
-
export * from "./schema/number";
|
|
19
|
-
export * from "./schema/object.ts";
|
|
20
|
-
export * from "./schema/string.ts";
|
|
21
|
-
export * from "./strand.ts";
|
|
22
|
-
export * from "./stream.ts";
|
|
23
|
-
export * from "./system.ts";
|
|
24
|
-
export * from "./user.ts";
|
package/dist/L/L.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export * from "./all.js";
|
|
2
|
-
export * from "./assistant.js";
|
|
3
|
-
export * from "./catch.js";
|
|
4
|
-
export * from "./continuation.js";
|
|
5
|
-
export * from "./emit.js";
|
|
6
|
-
export * from "./focus.js";
|
|
7
|
-
export * from "./infer.js";
|
|
8
|
-
export * from "./message.js";
|
|
9
|
-
export * from "./reflect.js";
|
|
10
|
-
export * from "./run.js";
|
|
11
|
-
export * from "./schema/anyOf.js";
|
|
12
|
-
export * from "./schema/array.js";
|
|
13
|
-
export * from "./schema/boolean.js";
|
|
14
|
-
export * from "./schema/const.js";
|
|
15
|
-
export * from "./schema/enum.js";
|
|
16
|
-
export * from "./schema/integer.js";
|
|
17
|
-
export * from "./schema/null.js";
|
|
18
|
-
export * from "./schema/number";
|
|
19
|
-
export * from "./schema/object.js";
|
|
20
|
-
export * from "./schema/string.js";
|
|
21
|
-
export * from "./strand.js";
|
|
22
|
-
export * from "./stream.js";
|
|
23
|
-
export * from "./system.js";
|
|
24
|
-
export * from "./user.js";
|
|
25
|
-
//# sourceMappingURL=L.js.map
|
package/dist/L/L.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"L.js","sourceRoot":"","sources":["../../L/L.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA"}
|
package/dist/L/all.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Context } from "../Context.ts";
|
|
2
|
-
import { Definition } from "../Definition.ts";
|
|
3
|
-
import type { LEvent } from "../LEvent.ts";
|
|
4
|
-
import type { Rune } from "../Rune.ts";
|
|
5
|
-
/**
|
|
6
|
-
* Runs multiple definitions in parallel and collects their results.
|
|
7
|
-
* Can be used with an array or object of definitions.
|
|
8
|
-
*/
|
|
9
|
-
export declare function all<A extends Array<Definition>>(definitions: A, context?: Context): Generator<Rune<LEvent> | Definition.Y<A[number]>, {
|
|
10
|
-
[I in keyof A]: Definition.T<A[I]>;
|
|
11
|
-
}>;
|
|
12
|
-
export declare function all<A extends Record<keyof any, Definition>>(definitions: A, context?: Context): Generator<Rune<LEvent> | Definition.Y<A[keyof A]>, {
|
|
13
|
-
[K in keyof A]: Definition.T<A[K]>;
|
|
14
|
-
}>;
|
package/dist/L/all.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Definition } from "../Definition.js";
|
|
2
|
-
import { Strand } from "../Strand.js";
|
|
3
|
-
import { continuation } from "./continuation.js";
|
|
4
|
-
import { reflect } from "./reflect.js";
|
|
5
|
-
export function* all(definitions, context) {
|
|
6
|
-
const parent = yield* reflect;
|
|
7
|
-
const strands = [];
|
|
8
|
-
for (const definition of Array.isArray(definitions) ? definitions : Object.values(definitions)) {
|
|
9
|
-
strands.push(new Strand(definition, {
|
|
10
|
-
parent,
|
|
11
|
-
context: context?.clone() ?? parent.context.clone(),
|
|
12
|
-
}));
|
|
13
|
-
}
|
|
14
|
-
const results = yield* continuation("all", () => Promise.all(strands));
|
|
15
|
-
if (Array.isArray(strands))
|
|
16
|
-
return results;
|
|
17
|
-
const keys = Object.keys(strands);
|
|
18
|
-
return Object.fromEntries(results.map((result, i) => [keys[i], result]));
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=all.js.map
|
package/dist/L/all.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"all.js","sourceRoot":"","sources":["../../L/all.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAG7C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AActC,MAAM,SAAS,CAAC,CAAC,GAAG,CAClB,WAAc,EACd,OAAiB;IAEjB,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,OAAO,CAAA;IAC7B,MAAM,OAAO,GAAkB,EAAE,CAAA;IACjC,KAAK,MAAM,UAAU,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/F,OAAO,CAAC,IAAI,CACV,IAAI,MAAM,CAAC,UAAU,EAAE;YACrB,MAAM;YACN,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE;SACpD,CAAC,CACH,CAAA;IACH,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;IACtE,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAA;IAC1C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACjC,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;AAC1E,CAAC"}
|
package/dist/L/assistant.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { LEvent } from "../LEvent.ts";
|
|
2
|
-
import type { Rune } from "../Rune.ts";
|
|
3
|
-
import { Schema } from "../Schema.ts";
|
|
4
|
-
/**
|
|
5
|
-
* Produces an assistant message when yielded. Can be called with a schema
|
|
6
|
-
* for structured output. Otherwise produces a string.
|
|
7
|
-
*/
|
|
8
|
-
export interface assistant extends Iterable<Rune<LEvent>, string> {
|
|
9
|
-
<T>(schema: Schema<T>): Generator<Rune<LEvent>, T>;
|
|
10
|
-
}
|
|
11
|
-
export declare const assistant: assistant;
|
package/dist/L/assistant.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Schema } from "../Schema.js";
|
|
2
|
-
import { infer } from "./infer.js";
|
|
3
|
-
import { message } from "./message.js";
|
|
4
|
-
export const assistant = Object.assign(function* assistant(schema) {
|
|
5
|
-
const inference = yield* infer(schema);
|
|
6
|
-
yield* message("assistant", [{ part: inference }]);
|
|
7
|
-
return JSON.parse(inference);
|
|
8
|
-
}, {
|
|
9
|
-
*[Symbol.iterator]() {
|
|
10
|
-
const inference = yield* infer();
|
|
11
|
-
yield* message("assistant", [{ part: inference }]);
|
|
12
|
-
return inference;
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=assistant.js.map
|
package/dist/L/assistant.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assistant.js","sourceRoot":"","sources":["../../L/assistant.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAUtC,MAAM,CAAC,MAAM,SAAS,GAAc,MAAM,CAAC,MAAM,CAC/C,QAAQ,CAAC,CAAC,SAAS,CAAI,MAAiB;IACtC,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IACtC,KAAK,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;IAClD,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;AAC9B,CAAC,EACD;IACE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,KAAK,EAAE,CAAA;QAChC,KAAK,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;QAClD,OAAO,SAAS,CAAA;IAClB,CAAC;CACF,CACF,CAAA"}
|
package/dist/L/catch.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Definition } from "../Definition.ts";
|
|
2
|
-
import type { LEvent } from "../LEvent.ts";
|
|
3
|
-
import type { Rune } from "../Rune.ts";
|
|
4
|
-
export { catch_ as catch };
|
|
5
|
-
/**
|
|
6
|
-
* Error handling utility that catches exceptions from running a definition.
|
|
7
|
-
* Returns a result object indicating whether the operation succeeded or failed.
|
|
8
|
-
*/
|
|
9
|
-
declare function catch_<Y extends Rune<any>, T>(definition: Definition<Y, T>): Generator<Rune<LEvent> | Rune<Y>, CatchResult<T>>;
|
|
10
|
-
export type CatchResult<T> = {
|
|
11
|
-
resolved: T;
|
|
12
|
-
rejected?: never;
|
|
13
|
-
} | {
|
|
14
|
-
resolved?: never;
|
|
15
|
-
rejected: unknown;
|
|
16
|
-
};
|
package/dist/L/catch.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Strand } from "../Strand.js";
|
|
2
|
-
import { continuation } from "./continuation.js";
|
|
3
|
-
import { reflect } from "./reflect.js";
|
|
4
|
-
export { catch_ as catch };
|
|
5
|
-
/**
|
|
6
|
-
* Error handling utility that catches exceptions from running a definition.
|
|
7
|
-
* Returns a result object indicating whether the operation succeeded or failed.
|
|
8
|
-
*/
|
|
9
|
-
function* catch_(definition) {
|
|
10
|
-
const parent = yield* reflect;
|
|
11
|
-
return yield* continuation("catch", async () => {
|
|
12
|
-
try {
|
|
13
|
-
const resolved = await new Strand(definition, {
|
|
14
|
-
parent,
|
|
15
|
-
context: parent.context.clone(),
|
|
16
|
-
}).then();
|
|
17
|
-
return { resolved };
|
|
18
|
-
}
|
|
19
|
-
catch (exception) {
|
|
20
|
-
return { rejected: exception };
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
Object.defineProperty(catch_, "name", { value: "catch" });
|
|
25
|
-
//# sourceMappingURL=catch.js.map
|
package/dist/L/catch.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"catch.js","sourceRoot":"","sources":["../../L/catch.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAA;AAE1B;;;GAGG;AACH,QAAQ,CAAC,CAAC,MAAM,CACd,UAA4B;IAE5B,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,OAAO,CAAA;IAC7B,OAAO,KAAK,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;QAC7C,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,MAAM,CAAC,UAAU,EAAE;gBAC5C,MAAM;gBACN,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE;aAChC,CAAC,CAAC,IAAI,EAAE,CAAA;YACT,OAAO,EAAE,QAAQ,EAAE,CAAA;QACrB,CAAC;QAAC,OAAO,SAAkB,EAAE,CAAC;YAC5B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAA;QAChC,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AACD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA"}
|
package/dist/L/continuation.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { LEvent } from "../LEvent.ts";
|
|
2
|
-
import { Rune } from "../Rune.ts";
|
|
3
|
-
/** Yields a continuation rune that executes a function and passes its result to the next iteration. */
|
|
4
|
-
export declare function continuation<R>(debug: string, f: () => R): Generator<Rune<LEvent>, Awaited<R>>;
|
package/dist/L/continuation.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Rune, RuneKey } from "../Rune.js";
|
|
2
|
-
/** Yields a continuation rune that executes a function and passes its result to the next iteration. */
|
|
3
|
-
export function* continuation(debug, f) {
|
|
4
|
-
return yield {
|
|
5
|
-
[RuneKey]: true,
|
|
6
|
-
instruction: {
|
|
7
|
-
kind: "continue",
|
|
8
|
-
debug,
|
|
9
|
-
f,
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=continuation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"continuation.js","sourceRoot":"","sources":["../../L/continuation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAE1C,uGAAuG;AACvG,MAAM,SAAS,CAAC,CAAC,YAAY,CAAI,KAAa,EAAE,CAAU;IACxD,OAAO,MAAM;QACX,CAAC,OAAO,CAAC,EAAE,IAAI;QACf,WAAW,EAAE;YACX,IAAI,EAAE,UAAU;YAChB,KAAK;YACL,CAAC;SACF;KACF,CAAA;AACH,CAAC"}
|
package/dist/L/emit.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Rune } from "../Rune.ts";
|
|
2
|
-
import type { EnsureNarrow } from "../util/EnsureNarrow.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Emits an event to be supplied to handlers.
|
|
5
|
-
* Used for broadcasting state changes and triggering side effects.
|
|
6
|
-
*/
|
|
7
|
-
export declare function emit<E>(event: EnsureNarrow<E>): Generator<Rune<E>, void>;
|
package/dist/L/emit.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Rune, RuneKey } from "../Rune.js";
|
|
2
|
-
/**
|
|
3
|
-
* Emits an event to be supplied to handlers.
|
|
4
|
-
* Used for broadcasting state changes and triggering side effects.
|
|
5
|
-
*/
|
|
6
|
-
export function* emit(event) {
|
|
7
|
-
return yield {
|
|
8
|
-
[RuneKey]: true,
|
|
9
|
-
instruction: {
|
|
10
|
-
kind: "emit",
|
|
11
|
-
event,
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=emit.js.map
|
package/dist/L/emit.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emit.js","sourceRoot":"","sources":["../../L/emit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAG1C;;;GAGG;AACH,MAAM,SAAS,CAAC,CAAC,IAAI,CAAI,KAAsB;IAC7C,OAAO,MAAM;QACX,CAAC,OAAO,CAAC,EAAE,IAAI;QACf,WAAW,EAAE;YACX,IAAI,EAAE,MAAM;YACZ,KAAK;SACN;KACF,CAAA;AACH,CAAC"}
|
package/dist/L/focus.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Adapter } from "../Adapter.ts";
|
|
2
|
-
import type { LEvent } from "../LEvent.ts";
|
|
3
|
-
import type { Rune } from "../Rune.ts";
|
|
4
|
-
/**
|
|
5
|
-
* Registers a model in the current context and emits a model registration event.
|
|
6
|
-
* Returns the registered model instance.
|
|
7
|
-
*/
|
|
8
|
-
export declare function focus(adapter: Adapter): Generator<Rune<LEvent>, Adapter>;
|
package/dist/L/focus.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AdapterFocused } from "../LEvent.js";
|
|
2
|
-
import { emit } from "./emit.js";
|
|
3
|
-
import { reflect } from "./reflect.js";
|
|
4
|
-
/**
|
|
5
|
-
* Registers a model in the current context and emits a model registration event.
|
|
6
|
-
* Returns the registered model instance.
|
|
7
|
-
*/
|
|
8
|
-
export function* focus(adapter) {
|
|
9
|
-
const { context: { adapters } } = yield* reflect;
|
|
10
|
-
adapters.register(adapter);
|
|
11
|
-
yield* emit(new AdapterFocused(adapter));
|
|
12
|
-
return adapter;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=focus.js.map
|
package/dist/L/focus.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"focus.js","sourceRoot":"","sources":["../../L/focus.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;GAGG;AACH,MAAM,SAAS,CAAC,CAAC,KAAK,CAAC,OAAgB;IACrC,MAAM,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAA;IAChD,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC1B,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IACxC,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
package/dist/L/infer.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type LEvent } from "../LEvent.ts";
|
|
2
|
-
import type { Rune } from "../Rune.ts";
|
|
3
|
-
import { Schema } from "../Schema.ts";
|
|
4
|
-
/**
|
|
5
|
-
* Requests an inference from the current model, optionally with a schema.
|
|
6
|
-
* Emits inference-related events and returns the model's response as a string.
|
|
7
|
-
*/
|
|
8
|
-
export declare function infer(schema?: Schema): Generator<Rune<LEvent>, string>;
|
package/dist/L/infer.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { InferenceRequested, Inferred } from "../LEvent.js";
|
|
2
|
-
import { Schema } from "../Schema.js";
|
|
3
|
-
import { continuation } from "./continuation.js";
|
|
4
|
-
import { emit } from "./emit.js";
|
|
5
|
-
import { reflect } from "./reflect.js";
|
|
6
|
-
/**
|
|
7
|
-
* Requests an inference from the current model, optionally with a schema.
|
|
8
|
-
* Emits inference-related events and returns the model's response as a string.
|
|
9
|
-
*/
|
|
10
|
-
export function* infer(schema) {
|
|
11
|
-
const { context: { adapters: models, messages }, signal } = yield* reflect;
|
|
12
|
-
const model = models.ensure();
|
|
13
|
-
const requestId = crypto.randomUUID();
|
|
14
|
-
yield* emit(new InferenceRequested(requestId, schema));
|
|
15
|
-
let inference = yield* continuation("infer", model
|
|
16
|
-
.seal({
|
|
17
|
-
messages,
|
|
18
|
-
...schema && {
|
|
19
|
-
schema: schema.type === "object" ? schema : Schema.wrap(schema),
|
|
20
|
-
},
|
|
21
|
-
signal,
|
|
22
|
-
})
|
|
23
|
-
.resolve);
|
|
24
|
-
if (schema?.type && schema.type !== "object") {
|
|
25
|
-
inference = JSON.stringify(JSON.parse(inference).value);
|
|
26
|
-
}
|
|
27
|
-
yield* emit(new Inferred(requestId, inference));
|
|
28
|
-
return inference;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=infer.js.map
|
package/dist/L/infer.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"infer.js","sourceRoot":"","sources":["../../L/infer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAe,MAAM,cAAc,CAAA;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;GAGG;AACH,MAAM,SAAS,CAAC,CAAC,KAAK,CAAC,MAAe;IACpC,MAAM,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAA;IAC1E,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,CAAA;IAC7B,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,EAAE,CAAA;IACrC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,kBAAkB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAA;IACtD,IAAI,SAAS,GAAG,KAAK,CAAC,CAAC,YAAY,CACjC,OAAO,EACP,KAAK;SACF,IAAI,CAAC;QACJ,QAAQ;QACR,GAAG,MAAM,IAAI;YACX,MAAM,EAAE,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;SAChE;QACD,MAAM;KACP,CAAC;SACD,OAAO,CACX,CAAA;IACD,IAAI,MAAM,EAAE,IAAI,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7C,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAA;IACzD,CAAC;IACD,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAA;IAC/C,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
package/dist/L/message.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { LEvent } from "../LEvent.ts";
|
|
2
|
-
import type { Content, MessageRole } from "../Message.ts";
|
|
3
|
-
import type { Rune } from "../Rune.ts";
|
|
4
|
-
/**
|
|
5
|
-
* Adds a new message to the current context's message list.
|
|
6
|
-
* Emits a message append event to observers.
|
|
7
|
-
*/
|
|
8
|
-
export declare function message(role: MessageRole, content: Array<Content>): Generator<Rune<LEvent>, void>;
|
package/dist/L/message.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { LEvent, MessageAppended } from "../LEvent.js";
|
|
2
|
-
import { emit } from "./emit.js";
|
|
3
|
-
import { reflect } from "./reflect.js";
|
|
4
|
-
/**
|
|
5
|
-
* Adds a new message to the current context's message list.
|
|
6
|
-
* Emits a message append event to observers.
|
|
7
|
-
*/
|
|
8
|
-
export function* message(role, content) {
|
|
9
|
-
const { context: { messages } } = yield* reflect;
|
|
10
|
-
const message = { role, parts: content };
|
|
11
|
-
yield* emit(new MessageAppended(message));
|
|
12
|
-
messages.push(message);
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=message.js.map
|
package/dist/L/message.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../L/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAGtD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;GAGG;AACH,MAAM,SAAS,CAAC,CAAC,OAAO,CAAC,IAAiB,EAAE,OAAuB;IACjE,MAAM,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAA;IAChD,MAAM,OAAO,GAAY,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAA;IACjD,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC,CAAA;IACzC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;AACxB,CAAC"}
|
package/dist/L/reflect.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { LEvent } from "../LEvent.ts";
|
|
2
|
-
import { Rune } from "../Rune.ts";
|
|
3
|
-
import type { Strand } from "../Strand.ts";
|
|
4
|
-
/** Returns the current strand instance, providing access to context and parent information. */
|
|
5
|
-
export declare const reflect: Iterable<Rune<LEvent>, Strand>;
|
package/dist/L/reflect.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Rune, RuneKey } from "../Rune.js";
|
|
2
|
-
/** Returns the current strand instance, providing access to context and parent information. */
|
|
3
|
-
export const reflect = {
|
|
4
|
-
*[Symbol.iterator]() {
|
|
5
|
-
return yield {
|
|
6
|
-
[RuneKey]: true,
|
|
7
|
-
instruction: { kind: "reflect" },
|
|
8
|
-
};
|
|
9
|
-
},
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=reflect.js.map
|
package/dist/L/reflect.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reflect.js","sourceRoot":"","sources":["../../L/reflect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAG1C,+FAA+F;AAC/F,MAAM,CAAC,MAAM,OAAO,GAAmC;IACrD,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,OAAO,MAAM;YACX,CAAC,OAAO,CAAC,EAAE,IAAI;YACf,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SACjC,CAAA;IACH,CAAC;CACF,CAAA"}
|
package/dist/L/run.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { AdapterRegistry } from "../AdapterRegistry.ts";
|
|
2
|
-
import type { Definition } from "../Definition.ts";
|
|
3
|
-
import type { Handler } from "../Handler.ts";
|
|
4
|
-
import type { Message } from "../Message.ts";
|
|
5
|
-
import type { Rune } from "../Rune.ts";
|
|
6
|
-
import { Strand } from "../Strand.ts";
|
|
7
|
-
import type { Tool } from "../Tool.ts";
|
|
8
|
-
/** Configuration options for running a definition. */
|
|
9
|
-
export interface RunConfig<Y extends Rune<any>> {
|
|
10
|
-
handler?: Handler<Y> | undefined;
|
|
11
|
-
models?: AdapterRegistry | undefined;
|
|
12
|
-
messages?: Array<Message> | undefined;
|
|
13
|
-
tools?: Set<Tool> | undefined;
|
|
14
|
-
signal?: AbortSignal | undefined;
|
|
15
|
-
}
|
|
16
|
-
export declare function run<Y extends Rune<any>, T>(definition: Definition<Y, T>, config?: RunConfig<Y>): Strand<Y, T>;
|
package/dist/L/run.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { AdapterRegistry } from "../AdapterRegistry.js";
|
|
2
|
-
import { Context } from "../Context.js";
|
|
3
|
-
import { Strand } from "../Strand.js";
|
|
4
|
-
export function run(definition, config) {
|
|
5
|
-
const context = Context({
|
|
6
|
-
handler: config?.handler,
|
|
7
|
-
adapters: config?.models ?? new AdapterRegistry(),
|
|
8
|
-
messages: config?.messages ?? [],
|
|
9
|
-
tools: config?.tools ?? new Set(),
|
|
10
|
-
});
|
|
11
|
-
return new Strand(definition, {
|
|
12
|
-
signal: config?.signal,
|
|
13
|
-
...config && { context },
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=run.js.map
|
package/dist/L/run.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../L/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAKvC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAYrC,MAAM,UAAU,GAAG,CAAyB,UAA4B,EAAE,MAAqB;IAC7F,MAAM,OAAO,GAAG,OAAO,CAAC;QACtB,OAAO,EAAE,MAAM,EAAE,OAAO;QACxB,QAAQ,EAAE,MAAM,EAAE,MAAM,IAAI,IAAI,eAAe,EAAE;QACjD,QAAQ,EAAE,MAAM,EAAE,QAAQ,IAAI,EAAE;QAChC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,IAAI,GAAG,EAAE;KAClC,CAAC,CAAA;IACF,OAAO,IAAI,MAAM,CAAC,UAAU,EAAE;QAC5B,MAAM,EAAE,MAAM,EAAE,MAAM;QACtB,GAAG,MAAM,IAAI,EAAE,OAAO,EAAE;KACzB,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Schema } from "../../Schema.ts";
|
|
2
|
-
export declare function make<S extends Schema>(schema: Omit<S, "T">, description?: string): S & TypeBase;
|
|
3
|
-
export interface TypeBase {
|
|
4
|
-
(template: TemplateStringsArray, ...substitutions: Array<string>): this;
|
|
5
|
-
(...values: Array<string>): this;
|
|
6
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { isTemplateStringsArray } from "../../util/isTemplateStringsArray.js";
|
|
2
|
-
export function make(schema, description) {
|
|
3
|
-
const schema_ = {
|
|
4
|
-
...schema,
|
|
5
|
-
...description && { description },
|
|
6
|
-
};
|
|
7
|
-
const Type = Object.assign(function describe(e0, ...rest) {
|
|
8
|
-
const junction = isTemplateStringsArray(e0) ? String.raw(e0, ...rest) : e0;
|
|
9
|
-
return make(schema_, description ? `${description}${junction ? `\n\n${junction}` : ""}` : junction);
|
|
10
|
-
}, schema_);
|
|
11
|
-
Object.defineProperty(Type, "toJSON", {
|
|
12
|
-
value() {
|
|
13
|
-
return schema_;
|
|
14
|
-
},
|
|
15
|
-
enumerable: false,
|
|
16
|
-
});
|
|
17
|
-
return Type;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=_schema_common.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_schema_common.js","sourceRoot":"","sources":["../../../L/schema/_schema_common.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAE7E,MAAM,UAAU,IAAI,CAAmB,MAAoB,EAAE,WAAoB;IAC/E,MAAM,OAAO,GAAG;QACd,GAAG,MAAM;QACT,GAAG,WAAW,IAAI,EAAE,WAAW,EAAE;KAClC,CAAA;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,QAAQ,CAAC,EAAkC,EAAE,GAAG,IAAmB;QACrG,MAAM,QAAQ,GAAG,sBAAsB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;QAC1E,OAAO,IAAI,CACT,OAAO,EACP,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAC9E,CAAA;IACH,CAAC,EAAE,OAAO,CAAC,CAAA;IACX,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE;QACpC,KAAK;YACH,OAAO,OAAO,CAAA;QAChB,CAAC;QACD,UAAU,EAAE,KAAK;KAClB,CAAC,CAAA;IACF,OAAO,IAAa,CAAA;AACtB,CAAC"}
|
package/dist/L/schema/anyOf.d.ts
DELETED
package/dist/L/schema/anyOf.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anyOf.js","sourceRoot":"","sources":["../../../L/schema/anyOf.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAM1C,MAAM,UAAU,KAAK,CAA2B,KAAS;IACvD,OAAO,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;AACxB,CAAC"}
|
package/dist/L/schema/array.d.ts
DELETED
package/dist/L/schema/array.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"array.js","sourceRoot":"","sources":["../../../L/schema/array.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAM1C,MAAM,UAAU,KAAK,CAAmB,KAAQ;IAC9C,OAAO,IAAI,CAAC;QACV,IAAI,EAAE,OAAO;QACb,KAAK;KACN,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/L/schema/boolean.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../../L/schema/boolean.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAiB,MAAM,qBAAqB,CAAA;AAIzD,MAAM,QAAQ,GAAa,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AAEpD,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAA"}
|
package/dist/L/schema/const.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { SchemaString } from "../../Schema.ts";
|
|
2
|
-
import { type TypeBase } from "./_schema_common.ts";
|
|
3
|
-
interface const_<K extends string> extends SchemaString<K>, TypeBase {
|
|
4
|
-
enum?: never;
|
|
5
|
-
const: K;
|
|
6
|
-
}
|
|
7
|
-
declare function const_<K extends string>(value: K): const_<K>;
|
|
8
|
-
export { const_ as const };
|
package/dist/L/schema/const.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../L/schema/const.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAiB,MAAM,qBAAqB,CAAA;AAOzD,SAAS,MAAM,CAAmB,KAAQ;IACxC,OAAO,IAAI,CAAC;QACV,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,KAAK;KACb,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;AAEzD,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAA"}
|
package/dist/L/schema/enum.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { SchemaString } from "../../Schema.ts";
|
|
2
|
-
import { type TypeBase } from "./_schema_common.ts";
|
|
3
|
-
interface enum_<V extends Array<string> = Array<string>> extends SchemaString<V[number]>, TypeBase {
|
|
4
|
-
enum: V;
|
|
5
|
-
const?: never;
|
|
6
|
-
}
|
|
7
|
-
declare function enum_<const V extends Array<string>>(...values: V): enum_<V>;
|
|
8
|
-
export { enum_ as enum };
|
package/dist/L/schema/enum.js
DELETED