liminal 0.5.17 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/Context.ts +8 -47
  3. package/L.ts +4 -0
  4. package/assistant.ts +52 -0
  5. package/dist/Context.d.ts +13 -30
  6. package/dist/Context.js +9 -22
  7. package/dist/Context.js.map +1 -1
  8. package/dist/L.d.ts +4 -0
  9. package/dist/L.js +5 -0
  10. package/dist/L.js.map +1 -0
  11. package/dist/assistant.d.ts +9 -0
  12. package/dist/assistant.js +44 -0
  13. package/dist/assistant.js.map +1 -0
  14. package/dist/index.d.ts +2 -14
  15. package/dist/index.js +2 -14
  16. package/dist/index.js.map +1 -1
  17. package/dist/messages.d.ts +4 -0
  18. package/dist/messages.js +5 -0
  19. package/dist/messages.js.map +1 -0
  20. package/dist/set.d.ts +3 -0
  21. package/dist/set.js +11 -0
  22. package/dist/set.js.map +1 -0
  23. package/dist/strand.d.ts +15 -0
  24. package/dist/strand.js +19 -0
  25. package/dist/strand.js.map +1 -0
  26. package/dist/todo.test.js +3 -0
  27. package/dist/todo.test.js.map +1 -0
  28. package/dist/tsconfig.tsbuildinfo +1 -1
  29. package/dist/user.d.ts +6 -0
  30. package/dist/user.js +16 -0
  31. package/dist/user.js.map +1 -0
  32. package/dist/util/JSONValue.d.ts +0 -3
  33. package/dist/util/JSONValue.js +1 -31
  34. package/dist/util/JSONValue.js.map +1 -1
  35. package/index.ts +2 -14
  36. package/messages.ts +6 -0
  37. package/package.json +4 -3
  38. package/set.ts +11 -0
  39. package/strand.ts +38 -0
  40. package/todo.test.ts +3 -0
  41. package/user.ts +22 -0
  42. package/util/JSONValue.ts +0 -30
  43. package/Adapter.ts +0 -27
  44. package/AdapterRegistry.ts +0 -78
  45. package/Config.ts +0 -13
  46. package/Definition.ts +0 -48
  47. package/EventBase.ts +0 -23
  48. package/Handler.ts +0 -4
  49. package/L/L.ts +0 -24
  50. package/L/all.ts +0 -39
  51. package/L/assistant.ts +0 -28
  52. package/L/catch.ts +0 -38
  53. package/L/continuation.ts +0 -14
  54. package/L/emit.ts +0 -16
  55. package/L/focus.ts +0 -17
  56. package/L/infer.ts +0 -34
  57. package/L/message.ts +0 -16
  58. package/L/reflect.ts +0 -13
  59. package/L/run.ts +0 -29
  60. package/L/schema/_schema_common.ts +0 -30
  61. package/L/schema/anyOf.ts +0 -10
  62. package/L/schema/array.ts +0 -13
  63. package/L/schema/boolean.ts +0 -8
  64. package/L/schema/const.ts +0 -18
  65. package/L/schema/enum.ts +0 -18
  66. package/L/schema/integer.ts +0 -6
  67. package/L/schema/null.ts +0 -8
  68. package/L/schema/number.ts +0 -8
  69. package/L/schema/object.ts +0 -21
  70. package/L/schema/string.ts +0 -11
  71. package/L/strand.ts +0 -22
  72. package/L/stream.ts +0 -16
  73. package/L/system.ts +0 -19
  74. package/L/user.ts +0 -19
  75. package/LEvent.ts +0 -61
  76. package/LiminalAssertionError.ts +0 -19
  77. package/Message.ts +0 -16
  78. package/Rune.test.ts +0 -5
  79. package/Rune.ts +0 -60
  80. package/Schema.ts +0 -185
  81. package/Strand.ts +0 -284
  82. package/Tool.ts +0 -26
  83. package/TypeAdapter.ts +0 -3
  84. package/dist/Adapter.d.ts +0 -18
  85. package/dist/Adapter.js +0 -13
  86. package/dist/Adapter.js.map +0 -1
  87. package/dist/AdapterRegistry.d.ts +0 -27
  88. package/dist/AdapterRegistry.js +0 -62
  89. package/dist/AdapterRegistry.js.map +0 -1
  90. package/dist/Config.d.ts +0 -12
  91. package/dist/Config.js +0 -2
  92. package/dist/Config.js.map +0 -1
  93. package/dist/Definition.d.ts +0 -24
  94. package/dist/Definition.js +0 -29
  95. package/dist/Definition.js.map +0 -1
  96. package/dist/EventBase.d.ts +0 -11
  97. package/dist/EventBase.js +0 -16
  98. package/dist/EventBase.js.map +0 -1
  99. package/dist/Handler.d.ts +0 -3
  100. package/dist/Handler.js +0 -2
  101. package/dist/Handler.js.map +0 -1
  102. package/dist/L/L.d.ts +0 -24
  103. package/dist/L/L.js +0 -25
  104. package/dist/L/L.js.map +0 -1
  105. package/dist/L/all.d.ts +0 -14
  106. package/dist/L/all.js +0 -20
  107. package/dist/L/all.js.map +0 -1
  108. package/dist/L/assistant.d.ts +0 -11
  109. package/dist/L/assistant.js +0 -15
  110. package/dist/L/assistant.js.map +0 -1
  111. package/dist/L/catch.d.ts +0 -16
  112. package/dist/L/catch.js +0 -25
  113. package/dist/L/catch.js.map +0 -1
  114. package/dist/L/continuation.d.ts +0 -4
  115. package/dist/L/continuation.js +0 -13
  116. package/dist/L/continuation.js.map +0 -1
  117. package/dist/L/emit.d.ts +0 -7
  118. package/dist/L/emit.js +0 -15
  119. package/dist/L/emit.js.map +0 -1
  120. package/dist/L/focus.d.ts +0 -8
  121. package/dist/L/focus.js +0 -14
  122. package/dist/L/focus.js.map +0 -1
  123. package/dist/L/infer.d.ts +0 -8
  124. package/dist/L/infer.js +0 -30
  125. package/dist/L/infer.js.map +0 -1
  126. package/dist/L/message.d.ts +0 -8
  127. package/dist/L/message.js +0 -14
  128. package/dist/L/message.js.map +0 -1
  129. package/dist/L/reflect.d.ts +0 -5
  130. package/dist/L/reflect.js +0 -11
  131. package/dist/L/reflect.js.map +0 -1
  132. package/dist/L/run.d.ts +0 -14
  133. package/dist/L/run.js +0 -16
  134. package/dist/L/run.js.map +0 -1
  135. package/dist/L/schema/_schema_common.d.ts +0 -6
  136. package/dist/L/schema/_schema_common.js +0 -20
  137. package/dist/L/schema/_schema_common.js.map +0 -1
  138. package/dist/L/schema/anyOf.d.ts +0 -5
  139. package/dist/L/schema/anyOf.js +0 -5
  140. package/dist/L/schema/anyOf.js.map +0 -1
  141. package/dist/L/schema/array.d.ts +0 -5
  142. package/dist/L/schema/array.js +0 -8
  143. package/dist/L/schema/array.js.map +0 -1
  144. package/dist/L/schema/boolean.d.ts +0 -6
  145. package/dist/L/schema/boolean.js +0 -4
  146. package/dist/L/schema/boolean.js.map +0 -1
  147. package/dist/L/schema/const.d.ts +0 -8
  148. package/dist/L/schema/const.js +0 -10
  149. package/dist/L/schema/const.js.map +0 -1
  150. package/dist/L/schema/enum.d.ts +0 -8
  151. package/dist/L/schema/enum.js +0 -10
  152. package/dist/L/schema/enum.js.map +0 -1
  153. package/dist/L/schema/integer.d.ts +0 -5
  154. package/dist/L/schema/integer.js +0 -3
  155. package/dist/L/schema/integer.js.map +0 -1
  156. package/dist/L/schema/null.d.ts +0 -6
  157. package/dist/L/schema/null.js +0 -4
  158. package/dist/L/schema/null.js.map +0 -1
  159. package/dist/L/schema/number.d.ts +0 -6
  160. package/dist/L/schema/number.js +0 -4
  161. package/dist/L/schema/number.js.map +0 -1
  162. package/dist/L/schema/object.d.ts +0 -9
  163. package/dist/L/schema/object.js +0 -12
  164. package/dist/L/schema/object.js.map +0 -1
  165. package/dist/L/schema/string.d.ts +0 -8
  166. package/dist/L/schema/string.js +0 -4
  167. package/dist/L/schema/string.js.map +0 -1
  168. package/dist/L/strand.d.ts +0 -9
  169. package/dist/L/strand.js +0 -16
  170. package/dist/L/strand.js.map +0 -1
  171. package/dist/L/stream.d.ts +0 -4
  172. package/dist/L/stream.js +0 -15
  173. package/dist/L/stream.js.map +0 -1
  174. package/dist/L/system.d.ts +0 -4
  175. package/dist/L/system.js +0 -9
  176. package/dist/L/system.js.map +0 -1
  177. package/dist/L/user.d.ts +0 -4
  178. package/dist/L/user.js +0 -9
  179. package/dist/L/user.js.map +0 -1
  180. package/dist/LEvent.d.ts +0 -68
  181. package/dist/LEvent.js +0 -50
  182. package/dist/LEvent.js.map +0 -1
  183. package/dist/LiminalAssertionError.d.ts +0 -8
  184. package/dist/LiminalAssertionError.js +0 -20
  185. package/dist/LiminalAssertionError.js.map +0 -1
  186. package/dist/Message.d.ts +0 -14
  187. package/dist/Message.js +0 -2
  188. package/dist/Message.js.map +0 -1
  189. package/dist/Rune.d.ts +0 -46
  190. package/dist/Rune.js +0 -11
  191. package/dist/Rune.js.map +0 -1
  192. package/dist/Rune.test.js +0 -5
  193. package/dist/Rune.test.js.map +0 -1
  194. package/dist/Schema.d.ts +0 -46
  195. package/dist/Schema.js +0 -130
  196. package/dist/Schema.js.map +0 -1
  197. package/dist/Strand.d.ts +0 -81
  198. package/dist/Strand.js +0 -200
  199. package/dist/Strand.js.map +0 -1
  200. package/dist/Tool.d.ts +0 -10
  201. package/dist/Tool.js +0 -19
  202. package/dist/Tool.js.map +0 -1
  203. package/dist/TypeAdapter.d.ts +0 -1
  204. package/dist/TypeAdapter.js +0 -3
  205. package/dist/TypeAdapter.js.map +0 -1
  206. package/dist/errors.d.ts +0 -9
  207. package/dist/errors.js +0 -11
  208. package/dist/errors.js.map +0 -1
  209. package/dist/util/EnsureNarrow.d.ts +0 -1
  210. package/dist/util/EnsureNarrow.js +0 -2
  211. package/dist/util/EnsureNarrow.js.map +0 -1
  212. package/dist/util/attachCustomInspect.d.ts +0 -1
  213. package/dist/util/attachCustomInspect.js +0 -11
  214. package/dist/util/attachCustomInspect.js.map +0 -1
  215. package/errors.ts +0 -12
  216. package/util/EnsureNarrow.ts +0 -1
  217. package/util/attachCustomInspect.ts +0 -14
  218. /package/dist/{Rune.test.d.ts → todo.test.d.ts} +0 -0
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"}
@@ -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;
@@ -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
@@ -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
@@ -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"}
@@ -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>>;
@@ -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
@@ -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
@@ -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
@@ -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"}
@@ -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
@@ -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"}
@@ -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
@@ -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,14 +0,0 @@
1
- import type { Definition } from "../Definition.ts";
2
- import type { Handler } from "../Handler.ts";
3
- import type { Message } from "../Message.ts";
4
- import type { Rune } from "../Rune.ts";
5
- import { Strand } from "../Strand.ts";
6
- import type { Tool } from "../Tool.ts";
7
- /** Configuration options for running a definition. */
8
- export interface RunConfig<Y extends Rune<any>> {
9
- handler?: Handler<Y> | undefined;
10
- messages?: Array<Message> | undefined;
11
- tools?: Set<Tool> | undefined;
12
- signal?: AbortSignal | undefined;
13
- }
14
- 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: 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;AAWrC,MAAM,UAAU,GAAG,CAAyB,UAA4B,EAAE,MAAqB;IAC7F,MAAM,OAAO,GAAG,OAAO,CAAC;QACtB,OAAO,EAAE,MAAM,EAAE,OAAO;QACxB,QAAQ,EAAE,IAAI,eAAe,EAAE;QAC/B,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,20 +0,0 @@
1
- import { fixTemplateStrings } from "../../util/fixTemplateStrings.js";
2
- import { isTemplateStringsArray } from "../../util/isTemplateStringsArray.js";
3
- export function make(schema, description) {
4
- const schema_ = {
5
- ...schema,
6
- ...description && { description },
7
- };
8
- const Type = Object.assign(function describe(e0, ...rest) {
9
- const junction = isTemplateStringsArray(e0) ? String.raw(fixTemplateStrings(e0), ...rest) : e0;
10
- return make(schema_, description ? `${description}${junction ? `\n\n${junction}` : ""}` : junction);
11
- }, schema_);
12
- Object.defineProperty(Type, "toJSON", {
13
- value() {
14
- return schema_;
15
- },
16
- enumerable: false,
17
- });
18
- return Type;
19
- }
20
- //# 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,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AACrE,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,kBAAkB,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;QAC9F,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"}
@@ -1,5 +0,0 @@
1
- import type { Schema, SchemaAnyOf } from "../../Schema.ts";
2
- export interface anyOf<XA extends Array<Schema> = Array<Schema>> extends SchemaAnyOf<XA[number]["T"]> {
3
- anyOf: XA;
4
- }
5
- export declare function anyOf<XA extends Array<Schema>>(anyOf: XA): anyOf<XA>;
@@ -1,5 +0,0 @@
1
- import { make } from "./_schema_common.js";
2
- export function anyOf(anyOf) {
3
- return make({ anyOf });
4
- }
5
- //# sourceMappingURL=anyOf.js.map
@@ -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"}
@@ -1,5 +0,0 @@
1
- import type { Schema, SchemaArray } from "../../Schema.ts";
2
- export interface LArray<X extends Schema = Schema> extends SchemaArray<Array<X["T"]>> {
3
- items: X;
4
- }
5
- export declare function array<X extends Schema>(items: X): LArray<X>;
@@ -1,8 +0,0 @@
1
- import { make } from "./_schema_common.js";
2
- export function array(items) {
3
- return make({
4
- type: "array",
5
- items,
6
- });
7
- }
8
- //# sourceMappingURL=array.js.map
@@ -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"}
@@ -1,6 +0,0 @@
1
- import type { SchemaBoolean } from "../../Schema.ts";
2
- import { type TypeBase } from "./_schema_common.ts";
3
- interface boolean_ extends SchemaBoolean<boolean>, TypeBase {
4
- }
5
- declare const boolean_: boolean_;
6
- export { boolean_ as boolean };
@@ -1,4 +0,0 @@
1
- import { make } from "./_schema_common.js";
2
- const boolean_ = make({ type: "boolean" });
3
- export { boolean_ as boolean };
4
- //# sourceMappingURL=boolean.js.map
@@ -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"}
@@ -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 };
@@ -1,10 +0,0 @@
1
- import { make } from "./_schema_common.js";
2
- function const_(value) {
3
- return make({
4
- type: "string",
5
- const: value,
6
- });
7
- }
8
- Object.defineProperty(const_, "name", { value: "const" });
9
- export { const_ as const };
10
- //# sourceMappingURL=const.js.map
@@ -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"}
@@ -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 };
@@ -1,10 +0,0 @@
1
- import { make } from "./_schema_common.js";
2
- function enum_(...values) {
3
- return make({
4
- type: "string",
5
- enum: values,
6
- });
7
- }
8
- Object.defineProperty(enum_, "name", { value: "enum" });
9
- export { enum_ as enum };
10
- //# sourceMappingURL=enum.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../L/schema/enum.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAiB,MAAM,qBAAqB,CAAA;AAOzD,SAAS,KAAK,CAAgC,GAAG,MAAS;IACxD,OAAO,IAAI,CAAC;QACV,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM;KACb,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAA"}
@@ -1,5 +0,0 @@
1
- import type { SchemaInteger } from "../../Schema.ts";
2
- import { type TypeBase } from "./_schema_common.ts";
3
- export interface integer extends SchemaInteger<number>, TypeBase {
4
- }
5
- export declare const integer: integer;
@@ -1,3 +0,0 @@
1
- import { make } from "./_schema_common.js";
2
- export const integer = make({ type: "integer" });
3
- //# sourceMappingURL=integer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integer.js","sourceRoot":"","sources":["../../../L/schema/integer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAiB,MAAM,qBAAqB,CAAA;AAIzD,MAAM,CAAC,MAAM,OAAO,GAAY,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA"}
@@ -1,6 +0,0 @@
1
- import type { SchemaNull } from "../../Schema.ts";
2
- import { type TypeBase } from "./_schema_common.ts";
3
- export interface null_ extends SchemaNull<null>, TypeBase {
4
- }
5
- declare const null_: null_;
6
- export { null_ as null };
@@ -1,4 +0,0 @@
1
- import { make } from "./_schema_common.js";
2
- const null_ = make({ type: "null" });
3
- export { null_ as null };
4
- //# sourceMappingURL=null.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"null.js","sourceRoot":"","sources":["../../../L/schema/null.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAiB,MAAM,qBAAqB,CAAA;AAIzD,MAAM,KAAK,GAAU,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;AAE3C,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAA"}
@@ -1,6 +0,0 @@
1
- import type { SchemaNumber } from "../../Schema.ts";
2
- import { type TypeBase } from "./_schema_common.ts";
3
- interface number_ extends SchemaNumber<number>, TypeBase {
4
- }
5
- declare const number_: number_;
6
- export { number_ as number };
@@ -1,4 +0,0 @@
1
- import { make } from "./_schema_common.js";
2
- const number_ = make({ type: "number" });
3
- export { number_ as number };
4
- //# sourceMappingURL=number.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"number.js","sourceRoot":"","sources":["../../../L/schema/number.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAiB,MAAM,qBAAqB,CAAA;AAIzD,MAAM,OAAO,GAAY,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;AAEjD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAA"}
@@ -1,9 +0,0 @@
1
- import type { Schema, SchemaObject } from "../../Schema.ts";
2
- interface object_<F extends Record<string, Schema> = Record<string, Schema>> extends SchemaObject<{
3
- [K in keyof F]: F[K]["T"];
4
- }> {
5
- properties: F;
6
- required: Array<Extract<keyof F, string>>;
7
- }
8
- declare function object_<XR extends Record<string, Schema>>(properties: XR): object_<XR>;
9
- export { object_ as object };
@@ -1,12 +0,0 @@
1
- import { make } from "./_schema_common.js";
2
- function object_(properties) {
3
- return make({
4
- type: "object",
5
- properties,
6
- additionalProperties: false,
7
- required: Object.keys(properties),
8
- });
9
- }
10
- Object.defineProperty(object_, "name", { value: "object" });
11
- export { object_ as object };
12
- //# sourceMappingURL=object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"object.js","sourceRoot":"","sources":["../../../L/schema/object.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAS1C,SAAS,OAAO,CAAoC,UAAc;IAChE,OAAO,IAAI,CAAC;QACV,IAAI,EAAE,QAAQ;QACd,UAAU;QACV,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAU;KAC3C,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;AAC3D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAA"}
@@ -1,8 +0,0 @@
1
- import type { SchemaString } from "../../Schema.ts";
2
- import { type TypeBase } from "./_schema_common.ts";
3
- interface string_ extends SchemaString<string>, TypeBase {
4
- enum?: never;
5
- const?: never;
6
- }
7
- declare const string_: string_;
8
- export { string_ as string };
@@ -1,4 +0,0 @@
1
- import { make } from "./_schema_common.js";
2
- const string_ = make({ type: "string" });
3
- export { string_ as string };
4
- //# sourceMappingURL=string.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"string.js","sourceRoot":"","sources":["../../../L/schema/string.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAiB,MAAM,qBAAqB,CAAA;AAOzD,MAAM,OAAO,GAAY,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;AAEjD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAA"}
@@ -1,9 +0,0 @@
1
- import type { Context } from "../Context.ts";
2
- import type { Definition } from "../Definition.ts";
3
- import type { LEvent } from "../LEvent.ts";
4
- import { type Rune } from "../Rune.ts";
5
- /**
6
- * Creates a child strand that executes a definition.
7
- * Optionally specify the context. Otherwise the current context is inherited.
8
- */
9
- export declare function strand<Y extends Rune<any>, T>(definition: Definition<Y, T>, context?: Context): Generator<Rune<LEvent>, T>;
package/dist/L/strand.js DELETED
@@ -1,16 +0,0 @@
1
- import { RuneKey } from "../Rune.js";
2
- /**
3
- * Creates a child strand that executes a definition.
4
- * Optionally specify the context. Otherwise the current context is inherited.
5
- */
6
- export function* strand(definition, context) {
7
- return yield {
8
- [RuneKey]: true,
9
- instruction: {
10
- kind: "create_child",
11
- definition,
12
- context,
13
- },
14
- };
15
- }
16
- //# sourceMappingURL=strand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"strand.js","sourceRoot":"","sources":["../../L/strand.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,OAAO,EAAE,MAAM,YAAY,CAAA;AAE/C;;;GAGG;AACH,MAAM,SAAS,CAAC,CAAC,MAAM,CACrB,UAA4B,EAC5B,OAAiB;IAEjB,OAAO,MAAM;QACX,CAAC,OAAO,CAAC,EAAE,IAAI;QACf,WAAW,EAAE;YACX,IAAI,EAAE,cAAc;YACpB,UAAU;YACV,OAAO;SACR;KACF,CAAA;AACH,CAAC"}
@@ -1,4 +0,0 @@
1
- import { type LEvent } from "../LEvent.ts";
2
- import type { Rune } from "../Rune.ts";
3
- /** Creates a readable stream of content from the current model. */
4
- export declare const stream: Iterable<Rune<LEvent>, ReadableStream<string>>;
package/dist/L/stream.js DELETED
@@ -1,15 +0,0 @@
1
- import { InferenceRequested } from "../LEvent.js";
2
- import { continuation } from "./continuation.js";
3
- import { emit } from "./emit.js";
4
- import { reflect } from "./reflect.js";
5
- /** Creates a readable stream of content from the current model. */
6
- export const stream = {
7
- *[Symbol.iterator]() {
8
- const { context: { adapters, messages }, signal } = yield* reflect;
9
- const adapter = adapters.ensure();
10
- const requestId = crypto.randomUUID();
11
- yield* emit(new InferenceRequested(requestId));
12
- return yield* continuation("stream", adapter.seal({ messages, signal }).stream);
13
- },
14
- };
15
- //# sourceMappingURL=stream.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream.js","sourceRoot":"","sources":["../../L/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAe,MAAM,cAAc,CAAA;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,mEAAmE;AACnE,MAAM,CAAC,MAAM,MAAM,GAAmD;IACpE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,MAAM,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAA;QAClE,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAA;QACjC,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,EAAE,CAAA;QACrC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAA;QAC9C,OAAO,KAAK,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAA;IACjF,CAAC;CACF,CAAA"}
@@ -1,4 +0,0 @@
1
- import type { LEvent } from "../LEvent.ts";
2
- import type { Rune } from "../Rune.ts";
3
- export declare function system(template: TemplateStringsArray, ...substitutions: Array<number | string>): Generator<Rune<LEvent>, void>;
4
- export declare function system(value: string): Generator<Rune<LEvent>, void>;