Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Effect-TS/effect
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: effect@3.13.2
Choose a base ref
...
head repository: Effect-TS/effect
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: effect@3.13.3
Choose a head ref

Commits on Feb 18, 2025

  1. remove duplicate code in stm (#4459)

    fubhy authored Feb 18, 2025

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    lukekarrys Luke Karrys
    Copy the full SHA
    d63a5c4 View commit details
  2. suppress warning for experimental features (#4470)

    fubhy authored Feb 18, 2025
    Copy the full SHA
    780dec2 View commit details
  3. Fix Context.Tag unification (#4419)

    KhraksMamtsov authored Feb 18, 2025
    Copy the full SHA
    d7f6a5c View commit details

Commits on Feb 19, 2025

  1. Switch from @effect/dtslint to tstyche for type-level testing (#4467

    )
    
    Co-authored-by: Tom Mrazauskas <tom@mrazauskas.de>
    gcanti and mrazauskas authored Feb 19, 2025
    Copy the full SHA
    7e52318 View commit details
  2. Mark Option.filterMap as an alias of flatMap (#4475)

    gcanti authored Feb 19, 2025
    Copy the full SHA
    d3f3abd View commit details

Commits on Feb 20, 2025

  1. chore: add missing type assertions (#4481)

    mrazauskas authored Feb 20, 2025
    Copy the full SHA
    7828638 View commit details
  2. fix nested batching (#4483)

    mikearnaldi authored Feb 20, 2025
    Copy the full SHA
    2e15c1e View commit details

Commits on Feb 21, 2025

  1. chore: add references for type test projects (#4485)

    mrazauskas authored Feb 21, 2025
    Copy the full SHA
    8366ced View commit details
  2. Schema: more precise return types when transformations are involved (#…

    gcanti authored Feb 21, 2025
    Copy the full SHA
    2c639ec View commit details

Commits on Feb 22, 2025

  1. Schema: more precise return types when filters are involved (#4488)

    gcanti authored Feb 22, 2025
    Copy the full SHA
    00b4eb1 View commit details

Commits on Feb 23, 2025

  1. Schema: Improve Literal return type — now returns SchemaClass ins… (

    gcanti authored Feb 23, 2025
    Copy the full SHA
    886aaa8 View commit details
  2. Simplify signatures in Array module (#4495)

    KhraksMamtsov authored Feb 23, 2025
    Copy the full SHA
    9dd8979 View commit details
  3. ensure fibers can't be added to Fiber{Handle,Set,Map} during closing (#…

    tim-smart authored Feb 23, 2025
    Copy the full SHA
    b74255a View commit details

Commits on Feb 24, 2025

  1. Schema: Remove Redundant annotations Typings from Union Interface (

    gcanti authored Feb 24, 2025
    Copy the full SHA
    4942662 View commit details
  2. chore: simplify test-types script (#4498)

    mrazauskas authored Feb 24, 2025
    Copy the full SHA
    f1408dc View commit details
  3. Schema: Add Missing declare API Interface to Expose Type Parameters (

    gcanti authored Feb 24, 2025
    Copy the full SHA
    9f6c784 View commit details
  4. Schema: More Accurate Return Types for DataFromSelf and Data (#4502)

    gcanti authored Feb 24, 2025
    Copy the full SHA
    cc5588d View commit details

Commits on Feb 25, 2025

  1. Schema: Fix Constraint Definitions for DataFromSelf and Data (#4506)

    gcanti authored Feb 25, 2025
    Copy the full SHA
    3c4ac4f View commit details
  2. Schema: More Accurate Return Type for parseJson(schema) (#4507)

    gcanti authored Feb 25, 2025
    Copy the full SHA
    477b488 View commit details
  3. Schema: More Accurate Return Types for ArrayEnsure and `NonEmptyArr… (

    gcanti authored Feb 25, 2025
    Copy the full SHA
    f2aee98 View commit details
  4. Schema: More Accurate Return Types (#4509)

    gcanti authored Feb 25, 2025
    Copy the full SHA
    fb798eb View commit details
  5. Schema: More Accurate Return Type for compose (#4510)

    gcanti authored Feb 25, 2025
    Copy the full SHA
    623c8cd View commit details
  6. Schema: add missing from property to brand interface (#4514)

    gcanti authored Feb 25, 2025
    Copy the full SHA
    a4979db View commit details

Commits on Feb 26, 2025

  1. Schema: improve ArrayEnsure and NonEmptyArrayEnsure return types (#…

    gcanti authored Feb 26, 2025
    Copy the full SHA
    5c2ad19 View commit details
  2. Schema: improve type definitions for TaggedClass, TaggedError, and Ta… (

    gcanti authored Feb 26, 2025
    Copy the full SHA
    8b6a49e View commit details
  3. Schema: Use additionalProperties instead of patternProperties for… (

    gcanti authored Feb 26, 2025
    Copy the full SHA
    10932cb View commit details
  4. Schema: fix wrong EitherFromUnion return type (#4520)

    gcanti authored Feb 26, 2025
    Copy the full SHA
    c12b186 View commit details
  5. Schema: fix Datetime transformations (#4521)

    gcanti authored Feb 26, 2025
    Copy the full SHA
    62ad0b0 View commit details
  6. Schema: Cleanup as any usage and add Tuple2 API interface (#4523)

    gcanti authored Feb 26, 2025
    Copy the full SHA
    ce059f2 View commit details
  7. Schema: More Accurate Return Type for parseNumber (#4524)

    gcanti authored Feb 26, 2025
    Copy the full SHA
    2251b15 View commit details

Commits on Feb 27, 2025

  1. chore: test types against TypeScript’s nightly releases (#4515)

    mrazauskas authored Feb 27, 2025
    Copy the full SHA
    ecedb3d View commit details
  2. Introduce AiModel and AiModel.Plan (#4504)

    Co-authored-by: Tim <hello@timsmart.co>
    IMax153 and tim-smart authored Feb 27, 2025
    Copy the full SHA
    a67a8a1 View commit details
  3. Version Packages (#4474)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Feb 27, 2025
    Copy the full SHA
    5db2b37 View commit details
Showing with 16,676 additions and 14,439 deletions.
  1. +1 −1 .github/workflows/check.yml
  2. +17 −0 .github/workflows/nightly.yml
  3. +2 −2 README.md
  4. +2 −3 package.json
  5. +61 −0 packages/ai/ai/CHANGELOG.md
  6. +1 −1 packages/ai/ai/package.json
  7. +91 −0 packages/ai/ai/src/AiModel.ts
  8. +77 −0 packages/ai/ai/src/AiModels.ts
  9. +138 −0 packages/ai/ai/src/AiPlan.ts
  10. +15 −0 packages/ai/ai/src/index.ts
  11. +163 −0 packages/ai/ai/src/internal/aiPlan.ts
  12. +62 −0 packages/ai/anthropic/CHANGELOG.md
  13. +1 −1 packages/ai/anthropic/package.json
  14. +8 −2 packages/ai/anthropic/src/AnthropicClient.ts
  15. +181 −90 packages/ai/anthropic/src/AnthropicCompletions.ts
  16. +1 −12 packages/ai/anthropic/src/AnthropicConfig.ts
  17. +5 −1 packages/ai/anthropic/src/AnthropicTokenizer.ts
  18. +6 −7 packages/ai/anthropic/src/Generated.ts
  19. +62 −0 packages/ai/openai/CHANGELOG.md
  20. +1 −1 packages/ai/openai/package.json
  21. +9 −3 packages/ai/openai/src/OpenAiClient.ts
  22. +190 −93 packages/ai/openai/src/OpenAiCompletions.ts
  23. +2 −13 packages/ai/openai/src/OpenAiConfig.ts
  24. +149 −38 packages/ai/openai/src/OpenAiEmbeddings.ts
  25. +8 −5 packages/ai/openai/src/OpenAiTokenizer.ts
  26. +10 −0 packages/cli/CHANGELOG.md
  27. +1 −1 packages/cli/package.json
  28. +8 −0 packages/cluster-browser/CHANGELOG.md
  29. +1 −1 packages/cluster-browser/package.json
  30. +9 −0 packages/cluster-node/CHANGELOG.md
  31. +1 −1 packages/cluster-node/package.json
  32. +9 −0 packages/cluster-workflow/CHANGELOG.md
  33. +1 −1 packages/cluster-workflow/package.json
  34. +8 −0 packages/cluster/CHANGELOG.md
  35. +1 −1 packages/cluster/package.json
  36. +460 −0 packages/effect/CHANGELOG.md
  37. +0 −1,527 packages/effect/dtslint/Array.ts
  38. +1,233 −0 packages/effect/dtslint/Array.tst.ts
  39. +0 −31 packages/effect/dtslint/Cause.ts
  40. +22 −0 packages/effect/dtslint/Cause.tst.ts
  41. +0 −521 packages/effect/dtslint/Chunk.ts
  42. +470 −0 packages/effect/dtslint/Chunk.tst.ts
  43. +0 −62 packages/effect/dtslint/Config.ts
  44. +38 −0 packages/effect/dtslint/Config.tst.ts
  45. +0 −20 packages/effect/dtslint/Context.ts
  46. +15 −0 packages/effect/dtslint/Context.tst.ts
  47. +0 −226 packages/effect/dtslint/Data.ts
  48. +157 −0 packages/effect/dtslint/Data.tst.ts
  49. +0 −91 packages/effect/dtslint/DateTime.ts
  50. +42 −0 packages/effect/dtslint/DateTime.tst.ts
  51. +0 −174 packages/effect/dtslint/Duration.ts
  52. +108 −0 packages/effect/dtslint/Duration.tst.ts
  53. +0 −1,362 packages/effect/dtslint/Effect.ts
  54. +1,395 −0 packages/effect/dtslint/Effect.tst.ts
  55. +0 −277 packages/effect/dtslint/Either.ts
  56. +273 −0 packages/effect/dtslint/Either.tst.ts
  57. +1 −3 packages/effect/dtslint/{Equal.ts → Equal.tst.ts}
  58. +0 −60 packages/effect/dtslint/Exit.ts
  59. +43 −0 packages/effect/dtslint/Exit.tst.ts
  60. +0 −16 packages/effect/dtslint/Fiber.ts
  61. +21 −0 packages/effect/dtslint/Fiber.tst.ts
  62. +0 −27 packages/effect/dtslint/Function.ts
  63. +30 −0 packages/effect/dtslint/Function.tst.ts
  64. +0 −9 packages/effect/dtslint/HKT.ts
  65. +8 −0 packages/effect/dtslint/HKT.tst.ts
  66. +0 −110 packages/effect/dtslint/HashMap.ts
  67. +73 −0 packages/effect/dtslint/HashMap.tst.ts
  68. +0 −87 packages/effect/dtslint/HashSet.ts
  69. +82 −0 packages/effect/dtslint/HashSet.tst.ts
  70. +0 −60 packages/effect/dtslint/Layer.ts
  71. +45 −0 packages/effect/dtslint/Layer.tst.ts
  72. +0 −284 packages/effect/dtslint/List.ts
  73. +235 −0 packages/effect/dtslint/List.tst.ts
  74. +0 −20 packages/effect/dtslint/ManagedRuntime.ts
  75. +14 −0 packages/effect/dtslint/ManagedRuntime.tst.ts
  76. +0 −488 packages/effect/dtslint/Match.ts
  77. +521 −0 packages/effect/dtslint/Match.tst.ts
  78. +0 −22 packages/effect/dtslint/Micro.ts
  79. +25 −0 packages/effect/dtslint/Micro.tst.ts
  80. +0 −289 packages/effect/dtslint/Option.ts
  81. +223 −0 packages/effect/dtslint/Option.tst.ts
  82. +11 −0 packages/effect/dtslint/ParseResult.tst.ts
  83. +0 −332 packages/effect/dtslint/Predicate.ts
  84. +260 −0 packages/effect/dtslint/Predicate.tst.ts
  85. +0 −30 packages/effect/dtslint/Random.ts
  86. +23 −0 packages/effect/dtslint/Random.tst.ts
  87. +0 −719 packages/effect/dtslint/Record.ts
  88. +592 −0 packages/effect/dtslint/Record.tst.ts
  89. +0 −16 packages/effect/dtslint/RedBlackTree.ts
  90. +17 −0 packages/effect/dtslint/RedBlackTree.tst.ts
  91. +0 −4 packages/effect/dtslint/Runtime.ts
  92. +9 −0 packages/effect/dtslint/Runtime.tst.ts
  93. +0 −33 packages/effect/dtslint/Schedule.ts
  94. +35 −0 packages/effect/dtslint/Schedule.tst.ts
  95. +0 −3,064 packages/effect/dtslint/Schema.ts
  96. +21 −0 packages/effect/dtslint/Schema/Brand.tst.ts
  97. +412 −0 packages/effect/dtslint/Schema/Context.tst.ts
  98. 0 packages/effect/dtslint/{SchemaGeneric.ts → Schema/Generic.tst.ts}
  99. +34 −0 packages/effect/dtslint/Schema/PropertySignature.tst.ts
  100. +4,078 −0 packages/effect/dtslint/Schema/Schema.tst.ts
  101. +269 −0 packages/effect/dtslint/Schema/SchemaClass.tst.ts
  102. +78 −0 packages/effect/dtslint/Schema/Serializable.tst.ts
  103. +18 −0 packages/effect/dtslint/Schema/TaggedClass.tst.ts
  104. +31 −0 packages/effect/dtslint/Schema/TaggedError.tst.ts
  105. +46 −0 packages/effect/dtslint/Schema/TaggedRequest.tst.ts
  106. +44 −0 packages/effect/dtslint/Schema/Userland.tst.ts
  107. +0 −13 packages/effect/dtslint/SchemaAST.ts
  108. +11 −0 packages/effect/dtslint/SchemaAST.tst.ts
  109. +0 −19 packages/effect/dtslint/SchemaBrand.ts
  110. +0 −303 packages/effect/dtslint/SchemaClass.ts
  111. +0 −423 packages/effect/dtslint/SchemaContext.ts
  112. +0 −10 packages/effect/dtslint/SchemaParseResult.ts
  113. +0 −34 packages/effect/dtslint/SchemaPropertySignature.ts
  114. +0 −77 packages/effect/dtslint/SchemaSerializable.ts
  115. +0 −19 packages/effect/dtslint/SchemaTaggedClass.ts
  116. +0 −30 packages/effect/dtslint/SchemaTaggedError.ts
  117. +0 −43 packages/effect/dtslint/SchemaTaggedRequest.ts
  118. +0 −40 packages/effect/dtslint/SchemaUserland.ts
  119. +0 −19 packages/effect/dtslint/Sink.ts
  120. +16 −0 packages/effect/dtslint/Sink.tst.ts
  121. +0 −16 packages/effect/dtslint/SortedMap.ts
  122. +15 −0 packages/effect/dtslint/SortedMap.tst.ts
  123. +0 −91 packages/effect/dtslint/SortedSet.ts
  124. +96 −0 packages/effect/dtslint/SortedSet.tst.ts
  125. +0 −262 packages/effect/dtslint/Stream.ts
  126. +327 −0 packages/effect/dtslint/Stream.tst.ts
  127. +0 −95 packages/effect/dtslint/String.ts
  128. +100 −0 packages/effect/dtslint/String.tst.ts
  129. +0 −251 packages/effect/dtslint/Struct.ts
  130. +354 −0 packages/effect/dtslint/Struct.tst.ts
  131. +0 −48 packages/effect/dtslint/TMap.ts
  132. +44 −0 packages/effect/dtslint/TMap.tst.ts
  133. +0 −48 packages/effect/dtslint/TSet.ts
  134. +41 −0 packages/effect/dtslint/TSet.tst.ts
  135. +0 −84 packages/effect/dtslint/Tuple.ts
  136. +113 −0 packages/effect/dtslint/Tuple.tst.ts
  137. +0 −199 packages/effect/dtslint/Types.ts
  138. +246 −0 packages/effect/dtslint/Types.tst.ts
  139. +0 −236 packages/effect/dtslint/Unify.ts
  140. +295 −0 packages/effect/dtslint/Unify.tst.ts
  141. +3 −0 packages/effect/dtslint/tsconfig.json
  142. +2 −2 packages/effect/package.json
  143. +6 −6 packages/effect/src/Array.ts
  144. +1 −1 packages/effect/src/Context.ts
  145. +11 −7 packages/effect/src/FiberHandle.ts
  146. +11 −7 packages/effect/src/FiberMap.ts
  147. +9 −7 packages/effect/src/FiberSet.ts
  148. +7 −7 packages/effect/src/JSONSchema.ts
  149. +3 −18 packages/effect/src/Option.ts
  150. +1 −3 packages/effect/src/ParseResult.ts
  151. +1,352 −1,149 packages/effect/src/Schema.ts
  152. +3 −3 packages/effect/src/TRef.ts
  153. +5 −4 packages/effect/src/internal/fiberRuntime.ts
  154. +5 −5 packages/effect/src/internal/stm/core.ts
  155. +1 −1 packages/effect/src/internal/stm/{stm → }/entry.ts
  156. +1 −1 packages/effect/src/internal/stm/{stm → }/journal.ts
  157. +2 −2 packages/effect/src/internal/stm/stm.ts
  158. +0 −71 packages/effect/src/internal/stm/stm/opCodes/stm.ts
  159. +0 −17 packages/effect/src/internal/stm/stm/opCodes/stmState.ts
  160. +0 −17 packages/effect/src/internal/stm/stm/opCodes/strategy.ts
  161. +0 −29 packages/effect/src/internal/stm/stm/opCodes/tExit.ts
  162. +0 −11 packages/effect/src/internal/stm/stm/opCodes/tryCommit.ts
  163. +7 −7 packages/effect/src/internal/stm/{stm → }/stmState.ts
  164. +7 −7 packages/effect/src/internal/stm/{stm → }/tExit.ts
  165. +1 −1 packages/effect/src/internal/stm/tMap.ts
  166. +4 −4 packages/effect/src/internal/stm/tRef.ts
  167. +2 −2 packages/effect/src/internal/stm/{stm → }/tryCommit.ts
  168. 0 packages/effect/src/internal/stm/{stm → }/txnId.ts
  169. 0 packages/effect/src/internal/stm/{stm → }/versioned.ts
  170. +1 −1 packages/effect/src/internal/version.ts
  171. +4 −8 packages/effect/test/Schema/JSONSchema.test.ts
  172. +2 −2 packages/effect/test/Schema/ParseResult.test.ts
  173. +6 −7 packages/effect/test/Schema/Schema/Cause/Cause.test.ts
  174. +20 −3 packages/effect/test/Schema/Schema/Exit/Exit.test.ts
  175. +6 −1 packages/effect/test/Schema/Schema/Literal/Literal.test.ts
  176. +1 −1 packages/effect/test/Schema/Schema/Number/greaterThan.test.ts
  177. +1 −1 packages/effect/test/Schema/Schema/Number/greaterThanOrEqualTo.test.ts
  178. +4 −4 packages/effect/test/Schema/Schema/Number/lessThan.test.ts
  179. +4 −4 packages/effect/test/Schema/Schema/Number/lessThanOrEqualTo.test.ts
  180. +1 −1 packages/effect/test/Schema/Schema/Number/multipleOf.test.ts
  181. +1 −1 packages/effect/test/Schema/Schema/String/includes.test.ts
  182. +4 −4 packages/effect/test/Schema/Schema/String/maxLength.test.ts
  183. +4 −4 packages/effect/test/Schema/Schema/String/minLength.test.ts
  184. +5 −0 packages/effect/test/Schema/Schema/brand.test.ts
  185. +1 −1 packages/effect/test/Schema/Schema/filterEffect.test.ts
  186. +7 −0 packages/effect/test/Schema/Schema/fromBrand.test.ts
  187. +14 −9 packages/effect/test/Schema/Schema/parseJson.test.ts
  188. +9 −0 packages/experimental/CHANGELOG.md
  189. +1 −1 packages/experimental/package.json
  190. +7 −0 packages/opentelemetry/CHANGELOG.md
  191. +1 −1 packages/opentelemetry/package.json
  192. +8 −0 packages/platform-browser/CHANGELOG.md
  193. +1 −1 packages/platform-browser/package.json
  194. +9 −0 packages/platform-bun/CHANGELOG.md
  195. +1 −1 packages/platform-bun/package.json
  196. +8 −0 packages/platform-node-shared/CHANGELOG.md
  197. +1 −1 packages/platform-node-shared/package.json
  198. +9 −0 packages/platform-node/CHANGELOG.md
  199. +1 −1 packages/platform-node/package.json
  200. +7 −0 packages/platform/CHANGELOG.md
  201. +0 −127 packages/platform/dtslint/HttpApiClient.ts
  202. +192 −0 packages/platform/dtslint/HttpApiClient.tst.ts
  203. +0 −6 packages/platform/dtslint/HttpApiEndpoint.ts
  204. +11 −0 packages/platform/dtslint/HttpApiEndpoint.tst.ts
  205. +0 −8 packages/platform/dtslint/HttpRouter.ts
  206. +14 −0 packages/platform/dtslint/HttpRouter.tst.ts
  207. +3 −0 packages/platform/dtslint/tsconfig.json
  208. +2 −2 packages/platform/package.json
  209. +9 −0 packages/printer-ansi/CHANGELOG.md
  210. +1 −1 packages/printer-ansi/package.json
  211. +8 −0 packages/printer/CHANGELOG.md
  212. +1 −1 packages/printer/package.json
  213. +9 −0 packages/rpc-http/CHANGELOG.md
  214. +1 −1 packages/rpc-http/package.json
  215. +8 −0 packages/rpc/CHANGELOG.md
  216. +1 −1 packages/rpc/package.json
  217. +11 −0 packages/sql-clickhouse/CHANGELOG.md
  218. +1 −1 packages/sql-clickhouse/package.json
  219. +10 −0 packages/sql-d1/CHANGELOG.md
  220. +1 −1 packages/sql-d1/package.json
  221. +8 −0 packages/sql-drizzle/CHANGELOG.md
  222. +1 −1 packages/sql-drizzle/package.json
  223. +8 −0 packages/sql-kysely/CHANGELOG.md
  224. +1 −1 packages/sql-kysely/package.json
  225. +10 −0 packages/sql-libsql/CHANGELOG.md
  226. +1 −1 packages/sql-libsql/package.json
  227. +10 −0 packages/sql-mssql/CHANGELOG.md
  228. +1 −1 packages/sql-mssql/package.json
  229. +10 −0 packages/sql-mysql2/CHANGELOG.md
  230. +1 −1 packages/sql-mysql2/package.json
  231. +10 −0 packages/sql-pg/CHANGELOG.md
  232. +1 −1 packages/sql-pg/package.json
  233. +10 −0 packages/sql-sqlite-bun/CHANGELOG.md
  234. +1 −1 packages/sql-sqlite-bun/package.json
  235. +9 −0 packages/sql-sqlite-do/CHANGELOG.md
  236. +1 −1 packages/sql-sqlite-do/package.json
  237. +10 −0 packages/sql-sqlite-node/CHANGELOG.md
  238. +1 −1 packages/sql-sqlite-node/package.json
  239. +9 −0 packages/sql-sqlite-react-native/CHANGELOG.md
  240. +1 −1 packages/sql-sqlite-react-native/package.json
  241. +9 −0 packages/sql-sqlite-wasm/CHANGELOG.md
  242. +1 −1 packages/sql-sqlite-wasm/package.json
  243. +9 −0 packages/sql/CHANGELOG.md
  244. +1 −1 packages/sql/package.json
  245. +7 −0 packages/typeclass/CHANGELOG.md
  246. +0 −18 packages/typeclass/dtslint/FlatMap.ts
  247. +22 −0 packages/typeclass/dtslint/FlatMap.tst.ts
  248. +0 −23 packages/typeclass/dtslint/Monoid.ts
  249. +20 −0 packages/typeclass/dtslint/Monoid.tst.ts
  250. +0 −28 packages/typeclass/dtslint/Product.ts
  251. +35 −0 packages/typeclass/dtslint/Product.tst.ts
  252. +0 −18 packages/typeclass/dtslint/SemiAlternative.ts
  253. +23 −0 packages/typeclass/dtslint/SemiAlternative.tst.ts
  254. +0 −10 packages/typeclass/dtslint/SemiProduct.ts
  255. +19 −0 packages/typeclass/dtslint/SemiProduct.tst.ts
  256. +0 −23 packages/typeclass/dtslint/Semigroup.ts
  257. +20 −0 packages/typeclass/dtslint/Semigroup.tst.ts
  258. +3 −0 packages/typeclass/dtslint/tsconfig.json
  259. +2 −2 packages/typeclass/package.json
  260. +7 −0 packages/vitest/CHANGELOG.md
  261. +1 −1 packages/vitest/package.json
  262. +19 −106 pnpm-lock.yaml
  263. +8 −0 tstyche.config.json
  264. +18 −0 vitest.setup.ts
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ jobs:
- name: Install dependencies
uses: ./.github/actions/setup
- run: pnpm check
- run: pnpm dtslint
- run: pnpm test-types --target '>=5.4'

lint:
name: Lint
17 changes: 17 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: TypeScript's Nightly

on:
workflow_dispatch:
schedule:
- cron: "0 12 * * *"

jobs:
types:
name: Types
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/setup
- run: pnpm test-types --target next
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ git checkout -b my-branch
Ensure all required dependencies are installed by running:

```bash
pnpm install # Requires pnpm version 9.0.4
pnpm install # Requires pnpm version 10.4.0
```

## Making Changes
@@ -107,7 +107,7 @@ Run the following commands to ensure your changes do not introduce any issues:
- `pnpm circular`: Check for any circular dependencies in imports.
- `pnpm lint`: Ensure the code adheres to our coding standards.
- If you encounter style issues, use `pnpm lint-fix` to automatically correct some of these.
- `pnpm dtslint`: Run type-level tests.
- `pnpm test-types`: Run type-level tests. Tests are written using [tstyche](https://tstyche.org/).
- `pnpm docgen`: Ensure the documentation generates correctly and reflects any changes made.

### Document Your Changes
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -15,8 +15,7 @@
"lint": "eslint \"**/{src,test,examples,scripts,dtslint}/**/*.{ts,mjs}\"",
"lint-fix": "pnpm lint --fix",
"docgen": "pnpm --recursive --parallel exec docgen && node scripts/docs.mjs",
"dtslint": "pnpm --recursive --parallel run dtslint",
"dtslint-clean": "dtslint --clean",
"test-types": "tstyche",
"changeset-version": "changeset version && node scripts/version.mjs",
"changeset-publish": "pnpm codemod && pnpm build && TEST_DIST= pnpm vitest && changeset publish"
},
@@ -42,7 +41,6 @@
"@edge-runtime/vm": "^4.0.0",
"@effect/build-utils": "^0.7.7",
"@effect/docgen": "^0.5.2",
"@effect/dtslint": "^0.1.2",
"@effect/eslint-plugin": "^0.2.0",
"@effect/language-service": "^0.1.0",
"@effect/vitest": "workspace:^",
@@ -71,6 +69,7 @@
"playwright": "^1.46.0",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"tstyche": "^3.5.0",
"tsx": "^4.17.0",
"typescript": "^5.7.2",
"vite": "^6.0.11",
61 changes: 61 additions & 0 deletions packages/ai/ai/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,66 @@
# @effect/ai

## 0.10.3

### Patch Changes

- [#4504](https://github.com/Effect-TS/effect/pull/4504) [`a67a8a1`](https://github.com/Effect-TS/effect/commit/a67a8a1a4979fb7a039a060d067d805879da4d4b) Thanks @IMax153! - Introduce `AiModel` and `AiPlan` for describing retry / fallback logic between
models and providers

For example, the following program builds an `AiPlan` which will attempt to use
OpenAi's chat completions API, and if after three attempts the operation
is still failing, the plan will fallback to utilizing Anthropic's messages API
to resolve the request.

```ts
import { AiPlan, Completions } from "@effect/ai"
import { AnthropicClient, AnthropicCompletions } from "@effect/ai-anthropic"
import { OpenAiClient, OpenAiCompletions } from "@effect/ai-openai"
import { NodeHttpClient, NodeRuntime } from "@effect/platform-node"
import { Config, Console, Effect, Layer } from "effect"

// Create Anthropic client
const Anthropic = AnthropicClient.layerConfig({
apiKey: Config.redacted("ANTHROPIC_API_KEY")
}).pipe(Layer.provide(NodeHttpClient.layerUndici))

// Create OpenAi client
const OpenAi = OpenAiClient.layerConfig({
apiKey: Config.redacted("OPENAI_API_KEY")
}).pipe(Layer.provide(NodeHttpClient.layerUndici))

// Create a plan of request execution
const Plan = AiPlan.fromModel(OpenAiCompletions.model("gpt-4o-mini"), {
attempts: 3
}).pipe(
AiPlan.withFallback({
model: AnthropicCompletions.model("claude-3-5-haiku-latest")
})
)

const program = Effect.gen(function* () {
// Build the plan of execution
const plan = yield* Plan

// Create a program which uses the services provided by the plan
const getDadJoke = Effect.gen(function* () {
const completions = yield* Completions.Completions
const response = yield* completions.create("Tell me a dad joke")
yield* Console.log(response.text)
})

// Provide the plan to whichever programs need it
yield* plan.provide(getDadJoke)
})

program.pipe(Effect.provide([Anthropic, OpenAi]), NodeRuntime.runMain)
```

- Updated dependencies [[`cc5588d`](https://github.com/Effect-TS/effect/commit/cc5588df07f9103513547cb429ce041b9436a8bd), [`623c8cd`](https://github.com/Effect-TS/effect/commit/623c8cd053ed6ee3d353aaa8778d484670fca2bb), [`00b4eb1`](https://github.com/Effect-TS/effect/commit/00b4eb1ece12a16e222e6220965bb4024d6752ac), [`f2aee98`](https://github.com/Effect-TS/effect/commit/f2aee989b0a600900ce83e7f460d02908620c80f), [`fb798eb`](https://github.com/Effect-TS/effect/commit/fb798eb9061f1191badc017d1aa649360254da20), [`2251b15`](https://github.com/Effect-TS/effect/commit/2251b1528810bb695b37ce388b653cec0c5bf80c), [`2e15c1e`](https://github.com/Effect-TS/effect/commit/2e15c1e33648add0b29fe274fbcb7294b7515085), [`a4979db`](https://github.com/Effect-TS/effect/commit/a4979db021aef16e731be64df196b72088fc4376), [`b74255a`](https://github.com/Effect-TS/effect/commit/b74255a304ad49d60bedb1a260fd697f370af27a), [`d7f6a5c`](https://github.com/Effect-TS/effect/commit/d7f6a5c7d26c1963dcd864ca62360d20d08c7b49), [`9dd8979`](https://github.com/Effect-TS/effect/commit/9dd8979e940915b1cc1b1f264f3d019c77a65a02), [`477b488`](https://github.com/Effect-TS/effect/commit/477b488284f47c5469d7fba3e4065fb7e3b6556e), [`10932cb`](https://github.com/Effect-TS/effect/commit/10932cbf58fc721ada631cebec42f773ce96d3cc), [`9f6c784`](https://github.com/Effect-TS/effect/commit/9f6c78468b3b5e9ebfc38ffdfb70702901ee977b), [`2c639ec`](https://github.com/Effect-TS/effect/commit/2c639ecee332de4266e36022c989c35ae4e02105), [`886aaa8`](https://github.com/Effect-TS/effect/commit/886aaa81e06dfd3cd9391e8ea987d8cd5ada1124)]:
- effect@3.13.3
- @effect/experimental@0.41.3
- @effect/platform@0.77.3

## 0.10.2

### Patch Changes
2 changes: 1 addition & 1 deletion packages/ai/ai/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@effect/ai",
"type": "module",
"version": "0.10.2",
"version": "0.10.3",
"license": "MIT",
"description": "Effect modules for working with AI apis",
"homepage": "https://effect.website",
91 changes: 91 additions & 0 deletions packages/ai/ai/src/AiModel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/**
* @since 1.0.0
*/
import type * as Context from "effect/Context"
import type * as Effect from "effect/Effect"
import * as Option from "effect/Option"
import type * as Scope from "effect/Scope"
import type * as AiPlan from "./AiPlan.js"
import * as InternalAiPlan from "./internal/aiPlan.js"

/**
* @since 1.0.0
* @category type ids
*/
export const TypeId: unique symbol = Symbol.for("@effect/ai/AiModel")

/**
* @since 1.0.0
* @category type ids
*/
export type TypeId = typeof TypeId

/**
* @since 1.0.0
* @category type ids
*/
export const PlanTypeId: unique symbol = Symbol.for("@effect/ai/Plan")

/**
* @since 1.0.0
* @category type ids
*/
export type PlanTypeId = typeof TypeId

/**
* @since 1.0.0
* @category models
*/
export interface AiModel<in out Provides, in out Requires> extends AiPlan.AiPlan<unknown, Provides, Requires> {
readonly [TypeId]: TypeId
readonly model: string
readonly cacheKey: symbol
readonly requires: Context.Tag<Requires, any>
readonly provides: AiModel.ContextBuilder<Provides, Requires>
readonly updateContext: (context: Context.Context<Provides>) => Context.Context<Provides>
}

/**
* @since 1.0.0
*/
export declare namespace AiModel {
/**
* @since 1.0.0
* @category AiModel
*/
export type ContextBuilder<Provides, Requires> = Effect.Effect<
Context.Context<Provides>,
never,
Requires | Scope.Scope
>
}

const AiModelProto = {
...InternalAiPlan.PlanPrototype,
[TypeId]: TypeId
}

/**
* @since 1.0.0
* @category constructors
*/
export const make = <Provides, Requires>(options: {
readonly model: string
readonly cacheKey: symbol
readonly requires: Context.Tag<Requires, any>
readonly provides: AiModel.ContextBuilder<Provides, Requires>
readonly updateContext: (context: Context.Context<Provides>) => Context.Context<Provides>
}): AiModel<Provides, Requires> => {
const self = Object.create(AiModelProto)
self.cacheKey = options.cacheKey
self.model = options.model
self.provides = options.provides
self.requires = options.requires
self.updateContext = options.updateContext
self.steps = [{
model: self,
check: Option.none(),
schedule: Option.none()
}]
return self
}
77 changes: 77 additions & 0 deletions packages/ai/ai/src/AiModels.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/**
* @since 1.0.0
*/
import * as Context from "effect/Context"
import * as Effect from "effect/Effect"
import * as Equal from "effect/Equal"
import * as Hash from "effect/Hash"
import * as Layer from "effect/Layer"
import * as RcMap from "effect/RcMap"
import type * as Scope from "effect/Scope"
import type { AiModel } from "./AiModel.js"

/**
* @since 1.0.0
* @category tags
*/
export class AiModels extends Context.Tag("@effect/ai/AiModels")<
AiModels,
AiModels.Service
>() {}

/**
* @since 1.0.0
*/
export declare namespace AiModels {
/**
* @since 1.0.0
* @category models
*/
export interface Service {
readonly build: <Provides, Requires>(
model: AiModel<Provides, Requires>,
context: Context.Context<Requires>
) => Effect.Effect<Context.Context<Provides>, never, Scope.Scope>
}
}

class AiModelsKey {
constructor(
readonly model: AiModel<any, any>,
readonly service: unknown
) {}

[Equal.symbol](that: AiModelsKey): boolean {
return this.service === that.service && this.model.cacheKey === that.model.cacheKey
}
[Hash.symbol](): number {
return Hash.combine(Hash.hash(this.service))(Hash.hash(this.model.cacheKey))
}
}

const make = Effect.gen(function*() {
const services = yield* RcMap.make({
idleTimeToLive: "1 minute",
lookup: (key: AiModelsKey) => Effect.provideService(key.model.provides, key.model.requires, key.service)
})

const build = <Provides, Requires>(
model: AiModel<Provides, Requires>,
context: Context.Context<Requires>
): Effect.Effect<Context.Context<Provides>, never, Scope.Scope> =>
Effect.map(
RcMap.get(
services,
new AiModelsKey(model, Context.get(context, model.requires as any))
),
(context) => model.updateContext(context)
)

return { build } as const
})

/**
* @since 1.0.0
* @category layers
*/
export const layer: Layer.Layer<AiModels> = Layer.scoped(AiModels, make)
Loading