@smthrs/flow 1.0.0-rc.4 → 1.0.0-rc.6

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 (49) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/README.md +4 -4
  3. package/dist/cjs/DurableDeferred.js +3 -3
  4. package/dist/cjs/DurableDeferred.js.map +2 -2
  5. package/dist/cjs/DurableQueue.d.ts +1 -1
  6. package/dist/cjs/DurableQueue.d.ts.map +1 -1
  7. package/dist/cjs/DurableQueue.js +2 -2
  8. package/dist/cjs/DurableQueue.js.map +2 -2
  9. package/dist/cjs/Flow/ExecutionIds.js +1 -1
  10. package/dist/cjs/Flow/ExecutionIds.js.map +2 -2
  11. package/dist/cjs/Flow/Result.d.ts +1 -1
  12. package/dist/cjs/Flow/Result.d.ts.map +1 -1
  13. package/dist/cjs/Flow/Result.js.map +2 -2
  14. package/dist/cjs/Flow/Runtime.js +1 -1
  15. package/dist/cjs/Flow/Runtime.js.map +2 -2
  16. package/dist/cjs/Flow/internal.js +1 -1
  17. package/dist/cjs/Flow/internal.js.map +2 -2
  18. package/dist/cjs/Graph.d.ts.map +1 -1
  19. package/dist/cjs/Graph.js +1 -2
  20. package/dist/cjs/Graph.js.map +2 -2
  21. package/dist/esm/DurableDeferred.js +3 -3
  22. package/dist/esm/DurableDeferred.js.map +1 -1
  23. package/dist/esm/DurableQueue.d.ts +1 -1
  24. package/dist/esm/DurableQueue.d.ts.map +1 -1
  25. package/dist/esm/DurableQueue.js +2 -2
  26. package/dist/esm/DurableQueue.js.map +1 -1
  27. package/dist/esm/Flow/ExecutionIds.js +1 -1
  28. package/dist/esm/Flow/ExecutionIds.js.map +1 -1
  29. package/dist/esm/Flow/Result.d.ts +1 -1
  30. package/dist/esm/Flow/Result.d.ts.map +1 -1
  31. package/dist/esm/Flow/Result.js.map +1 -1
  32. package/dist/esm/Flow/Runtime.js +1 -1
  33. package/dist/esm/Flow/Runtime.js.map +1 -1
  34. package/dist/esm/Flow/internal.js +1 -1
  35. package/dist/esm/Flow/internal.js.map +1 -1
  36. package/dist/esm/Graph.d.ts.map +1 -1
  37. package/dist/esm/Graph.js +4 -2
  38. package/dist/esm/Graph.js.map +1 -1
  39. package/docs/README.md +1 -1
  40. package/docs/installation.md +4 -4
  41. package/docs/reference/flow.md +1 -1
  42. package/package.json +10 -10
  43. package/src/DurableDeferred.ts +3 -3
  44. package/src/DurableQueue.ts +2 -2
  45. package/src/Flow/ExecutionIds.ts +1 -1
  46. package/src/Flow/Result.ts +1 -1
  47. package/src/Flow/Runtime.ts +1 -1
  48. package/src/Flow/internal.ts +1 -1
  49. package/src/Graph.ts +5 -2
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: "Installation"
3
- description: "Install @smthrs/flow, its runtime requirements and pinned effect version, its import forms, and the packages a runnable composition adds."
3
+ description: "Install @smthrs/flow, its runtime requirements and effect range, its import forms, and the packages a runnable composition adds."
4
4
  sidebar:
5
5
  order: 1
6
6
  ---
@@ -9,8 +9,8 @@ sidebar:
9
9
 
10
10
  `@smthrs/flow` is not on npm yet. Link the source packages as described in [Use the libraries](#use-the-libraries).
11
11
 
12
- `effect` is a runtime dependency of this package and installs with it. Add it to
13
- your own dependencies at the same version anyway: your declarations import
12
+ `effect` is a peer dependency of this package, in the range `^4.0.4`. Add one
13
+ `effect` in that range to your own dependencies: your declarations import
14
14
  `effect/Schema` and your implementations import `effect/Effect` directly, and two
15
15
  copies of `effect` in one program are two sets of service tags.
16
16
 
@@ -23,7 +23,7 @@ from, and the canonical JSON checks applied to values.
23
23
 
24
24
  ## Use the libraries
25
25
 
26
- First [install the source checkout](https://github.com/smithersai/smithers/blob/main/packages/smithers/docs/installation.md#install-the-cli). The checkout's `examples` workspace carries the packages used by the flow tutorials and their pinned `effect@4.0.0-rc.115`.
26
+ First [install the source checkout](https://github.com/smithersai/smithers/blob/main/packages/smithers/docs/installation.md#install-the-cli). The checkout's `examples` workspace carries the packages used by the flow tutorials and their pinned `effect@4.0.4`.
27
27
 
28
28
  Create a project beside the checkout:
29
29
 
@@ -5,7 +5,7 @@ area: api
5
5
  order: 10
6
6
  ---
7
7
 
8
- Install the package with its exact `effect` peer. Not on npm yet; see [Installation](../installation.md#use-the-libraries).
8
+ Install the package with its `effect` peer. Not on npm yet; see [Installation](../installation.md#use-the-libraries).
9
9
 
10
10
  ## Entry points
11
11
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@smthrs/flow",
3
3
  "type": "module",
4
- "version": "1.0.0-rc.4",
4
+ "version": "1.0.0-rc.6",
5
5
  "license": "MIT",
6
6
  "smthrs": {
7
7
  "group": "engine"
@@ -289,21 +289,21 @@
289
289
  "tag": "next"
290
290
  },
291
291
  "dependencies": {
292
- "@smthrs/crypto": "1.0.0-rc.4",
293
- "@smthrs/keys": "1.0.0-rc.4",
294
- "@smthrs/plan": "1.0.0-rc.4",
295
- "@smthrs/canonical": "1.0.0-rc.4",
296
- "@smthrs/capability": "1.0.0-rc.4"
292
+ "@smthrs/crypto": "1.0.0-rc.6",
293
+ "@smthrs/keys": "1.0.0-rc.6",
294
+ "@smthrs/plan": "1.0.0-rc.6",
295
+ "@smthrs/canonical": "1.0.0-rc.6",
296
+ "@smthrs/capability": "1.0.0-rc.6"
297
297
  },
298
298
  "devDependencies": {
299
299
  "@effect/language-service": "0.87.2",
300
- "@effect/platform-node": "4.0.0-rc.115",
301
- "@effect/vitest": "4.0.0-rc.115",
300
+ "@effect/platform-node": "4.0.4",
301
+ "@effect/vitest": "4.0.4",
302
302
  "@eslint/js": "9.39.5",
303
303
  "@types/node": "26.4.1",
304
304
  "@vitest/coverage-v8": "5.0.0",
305
305
  "dprint": "0.57.1",
306
- "effect": "4.0.0-rc.115",
306
+ "effect": "4.0.4",
307
307
  "esbuild": "0.28.2",
308
308
  "eslint": "9.39.5",
309
309
  "eslint-import-resolver-typescript": "4.4.5",
@@ -316,7 +316,7 @@
316
316
  "vitest": "5.0.0"
317
317
  },
318
318
  "peerDependencies": {
319
- "effect": "4.0.0-rc.115"
319
+ "effect": "^4.0.4"
320
320
  },
321
321
  "scripts": {
322
322
  "lint": "eslint src --max-warnings=0 && dprint check",
@@ -19,7 +19,7 @@ import * as Cause from "effect/Cause"
19
19
  import * as Context from "effect/Context"
20
20
  import type * as Crypto from "effect/Crypto"
21
21
  import * as Effect from "effect/Effect"
22
- import * as Encoding from "effect/Encoding"
22
+ import * as Base64Url from "effect/encoding/Base64Url"
23
23
  import * as Exit from "effect/Exit"
24
24
  import * as Filter from "effect/Filter"
25
25
  import { dual } from "effect/Function"
@@ -249,7 +249,7 @@ export const into: {
249
249
  // Untraced because completion encoding is called for each deferred result.
250
250
  Effect.fnUntraced(function*(exit) {
251
251
  if (Exit.isFailure(exit)) {
252
- const [reasons, interrupts] = Arr.partition(
252
+ const [interrupts, reasons] = Arr.partition(
253
253
  exit.cause.reasons,
254
254
  Filter.fromPredicate(Cause.isInterruptReason)
255
255
  )
@@ -396,7 +396,7 @@ export class TokenParsed extends Schema.Class<TokenParsed>(
396
396
  * @since 0.1.0
397
397
  */
398
398
  get asToken(): Token {
399
- return Encoding.encodeBase64Url(
399
+ return Base64Url.encode(
400
400
  JSON.stringify([this.flowName, this.executionId, this.deferredName])
401
401
  ) as Token
402
402
  }
@@ -20,10 +20,10 @@ import * as Effect from "effect/Effect"
20
20
  import * as Exit from "effect/Exit"
21
21
  import * as Filter from "effect/Filter"
22
22
  import * as Layer from "effect/Layer"
23
+ import * as PersistedQueue from "effect/persistence/PersistedQueue"
23
24
  import * as Schedule from "effect/Schedule"
24
25
  import * as Schema from "effect/Schema"
25
26
  import * as Tracer from "effect/Tracer"
26
- import * as PersistedQueue from "effect/unstable/persistence/PersistedQueue"
27
27
  import * as Action from "./Action/index.ts"
28
28
  import * as DurableDeferred from "./DurableDeferred.ts"
29
29
  import { annotateWaiting, type FlowInstance, type FlowRuntime } from "./FlowRuntime/index.ts"
@@ -367,7 +367,7 @@ const makeWorkerEffect = Effect.fnUntraced(function*<
367
367
  })
368
368
  let exit = yield* Effect.exit(f(item.payload))
369
369
  if (Exit.isFailure(exit)) {
370
- const [reasons, interrupts] = Arr.partition(
370
+ const [interrupts, reasons] = Arr.partition(
371
371
  exit.cause.reasons,
372
372
  Filter.fromPredicate(Cause.isInterruptReason)
373
373
  )
@@ -99,7 +99,7 @@ export const derived: ExecutionIdSource = {
99
99
  * @since 0.1.0
100
100
  */
101
101
  export const fresh: ExecutionIdSource = {
102
- mint: () => Effect.flatMap(Crypto.Crypto, (crypto) => Effect.orDie(crypto.randomUUIDv4))
102
+ mint: () => Effect.flatMap(Crypto.Crypto, (crypto) => Effect.orDie(crypto.randomUUIDv4()))
103
103
  }
104
104
 
105
105
  /**
@@ -10,11 +10,11 @@ import { CapabilityPattern } from "@smthrs/capability/Capability"
10
10
  import * as Data from "effect/Data"
11
11
  import * as Effect from "effect/Effect"
12
12
  import type * as Exit from "effect/Exit"
13
+ import type { ExitEncoded } from "effect/rpc/RpcMessage"
13
14
  import * as Schema from "effect/Schema"
14
15
  import * as SchemaIssue from "effect/SchemaIssue"
15
16
  import * as SchemaParser from "effect/SchemaParser"
16
17
  import * as Transformation from "effect/SchemaTransformation"
17
- import type { ExitEncoded } from "effect/unstable/rpc/RpcMessage"
18
18
 
19
19
  const ResultTypeId = "@smthrs/flow/Flow/Result"
20
20
 
@@ -62,7 +62,7 @@ export const intoResult = <A, E, R>(
62
62
  instance.handoff ?? new Complete({ exit: Exit.succeed(value) })
63
63
  ),
64
64
  onFailure: (cause): Effect.Effect<Result<A, E>> => {
65
- const [reasons, interrupts] = Arr.partition(
65
+ const [interrupts, reasons] = Arr.partition(
66
66
  cause.reasons,
67
67
  Filter.fromPredicate(Cause.isInterruptReason)
68
68
  )
@@ -165,7 +165,7 @@ const Proto = {
165
165
  Crypto.Crypto,
166
166
  (crypto) =>
167
167
  Effect.flatMap(
168
- Effect.orDie(crypto.randomUUIDv4),
168
+ Effect.orDie(crypto.randomUUIDv4()),
169
169
  (executionId) => this.execute(payload, { executionId, discard: true })
170
170
  )
171
171
  )
package/src/Graph.ts CHANGED
@@ -65,7 +65,7 @@ import * as Planned from "@smthrs/plan/Planned"
65
65
  import * as Context from "effect/Context"
66
66
  import * as Option from "effect/Option"
67
67
  import * as Predicate from "effect/Predicate"
68
- import * as Schema from "effect/Schema"
68
+ import type * as Schema from "effect/Schema"
69
69
  import type * as Action from "./Action/Action.ts"
70
70
  import { TypeId as ActionTypeId } from "./Action/TypeId.ts"
71
71
  import * as Annotations from "./Flow/Annotations.ts"
@@ -321,12 +321,15 @@ const refusalMessage = (
321
321
  * transformation and needs the call re-keyed renames the declaration.
322
322
  * `@smthrs/core` carries the same algorithm and the same limit.
323
323
  *
324
+ * `Node.schemaIdentity` prints the document, not the installed `effect`: a
325
+ * release that prints a schema differently must not move the identity.
326
+ *
324
327
  * @private
325
328
  */
326
329
  const schemaIdentity = (schema: Schema.Top): unknown => {
327
330
  const cached = schemaDocuments.get(schema)
328
331
  if (cached !== undefined) return cached
329
- const document = Schema.toJsonSchemaDocument(schema, { onExcessProperty: "error" })
332
+ const document = Node.schemaIdentity(schema, { onExcessProperty: "error" })
330
333
  schemaDocuments.set(schema, document)
331
334
  return document
332
335
  }