@tinkered/core 0.20.0 → 0.20.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinkered/core",
3
- "version": "0.20.0",
3
+ "version": "0.20.1",
4
4
  "description": "Tinkered core: a small, fast reactive/graph dependency engine.",
5
5
  "keywords": [
6
6
  "tanstack-intent"
@@ -13,7 +13,7 @@ metadata:
13
13
  task skill to load next.
14
14
  type: core
15
15
  library: '@tinkered/core'
16
- library_version: '0.20.0'
16
+ library_version: '0.20.1'
17
17
  sources:
18
18
  - 'lagz0ne/tinkered:packages/core/src/main.ts'
19
19
  - 'lagz0ne/tinkered:docs/best-practices.md'
@@ -83,8 +83,9 @@ id, fix the code, and run the check again.
83
83
  only. Check: lint and `InvalidDependency`.
84
84
  Skill: data.
85
85
  - `tinker/plain`: every named function is an
86
- operation. Check: `bun run check:plain`.
87
- Skill: operation.
86
+ operation. A Workflow SDK workflow or step in a
87
+ `*.flow.ts` file passes. Check:
88
+ `bun run check:plain`. Skill: operation.
88
89
  - `tinker/floating`: a root answers each call
89
90
  with a promise; await it. Check: lint
90
91
  `no-floating-promises`. Skill: operation.
@@ -13,7 +13,7 @@ metadata:
13
13
  binding only.
14
14
  type: sub-skill
15
15
  library: '@tinkered/core'
16
- library_version: '0.20.0'
16
+ library_version: '0.20.1'
17
17
  requires:
18
18
  - core
19
19
  sources:
@@ -13,7 +13,7 @@ metadata:
13
13
  cell read only.
14
14
  type: sub-skill
15
15
  library: '@tinkered/core'
16
- library_version: '0.20.0'
16
+ library_version: '0.20.1'
17
17
  requires:
18
18
  - core
19
19
  sources:
@@ -5,7 +5,7 @@ description: >
5
5
  Tinker app: its label, input shape, deps, run
6
6
  body, how to call it, or how it fails. Also
7
7
  when a check prints tinker/plain or
8
- tinker/floating.
8
+ tinker/floating, or for a Workflow SDK flow.
9
9
  metadata:
10
10
  purpose: >
11
11
  How to write, call and fail an operation,
@@ -13,7 +13,7 @@ metadata:
13
13
  allowed in app code.
14
14
  type: sub-skill
15
15
  library: '@tinkered/core'
16
- library_version: '0.20.0'
16
+ library_version: '0.20.1'
17
17
  requires:
18
18
  - core
19
19
  sources:
@@ -112,6 +112,36 @@ if (result.status === "cancelled") result.reason;
112
112
  - `settle` answers one of three: `success`,
113
113
  `failed` or `cancelled`.
114
114
 
115
+ ### A durable flow: the Workflow SDK
116
+
117
+ The [Workflow SDK](https://workflow-sdk.dev) finds
118
+ a workflow and a step by a directive, so they are
119
+ plain functions. Put them in a flow file: a name
120
+ that ends in `.flow.server.ts` (or `.flow.ts`).
121
+ There, `tinker/plain` lets them pass (ADR 0148).
122
+
123
+ ```ts no-check
124
+ // src/naming/naming.flow.server.ts
125
+ export async function nameFlow(idea: string) {
126
+ "use workflow";
127
+ return await suggest(idea);
128
+ }
129
+
130
+ async function suggest(idea: string) {
131
+ "use step";
132
+ return callOperation("naming.suggest", { idea });
133
+ }
134
+ ```
135
+
136
+ - Keep a flow function thin: it awaits hooks,
137
+ sleeps, and calls operations by name.
138
+ - The logic stays in operations. A step cannot
139
+ import a cell: the SDK bundles it on its own.
140
+ - A step can run again after a crash. Make each
141
+ step safe to repeat.
142
+ - The directive is first in the body. A helper
143
+ beside it in the file still fails.
144
+
115
145
  ## Common mistakes
116
146
 
117
147
  ### HIGH: a plain helper function [tinker/plain]
@@ -13,7 +13,7 @@ metadata:
13
13
  on the client with remote data.
14
14
  type: sub-skill
15
15
  library: '@tinkered/core'
16
- library_version: '0.20.0'
16
+ library_version: '0.20.1'
17
17
  requires:
18
18
  - core
19
19
  - capsule
@@ -12,7 +12,7 @@ metadata:
12
12
  and join two scopes with the memory backend.
13
13
  type: sub-skill
14
14
  library: '@tinkered/core'
15
- library_version: '0.20.0'
15
+ library_version: '0.20.1'
16
16
  requires:
17
17
  - core
18
18
  sources: