@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
package/skills/core/SKILL.md
CHANGED
|
@@ -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.
|
|
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.
|
|
87
|
-
|
|
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.
|
|
@@ -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.
|
|
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]
|
package/skills/core/rpc/SKILL.md
CHANGED