@frontera-sdk/workflow 1.50.80 → 1.50.82

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 (2) hide show
  1. package/package.json +3 -3
  2. package/src/definition.ts +21 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontera-sdk/workflow",
3
- "version": "1.50.80",
3
+ "version": "1.50.82",
4
4
  "description": "Typed headless client for starting, inspecting, waiting on and cancelling Frontera workflow runs from a script or backend.",
5
5
  "keywords": [
6
6
  "frontera",
@@ -38,8 +38,8 @@
38
38
  "typecheck": "bunx tsc --noEmit"
39
39
  },
40
40
  "dependencies": {
41
- "@frontera-sdk/core": "1.50.80",
42
- "@frontera-sdk/functions": "1.50.80"
41
+ "@frontera-sdk/core": "1.50.82",
42
+ "@frontera-sdk/functions": "1.50.82"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/bun": "^1.3.14",
package/src/definition.ts CHANGED
@@ -12,7 +12,7 @@
12
12
  * `params` discriminated by `kind` (and, inside `blueprint`, by `mode`), and
13
13
  * the shared settings every kind accepts.
14
14
  *
15
- * The node set is closed. All fourteen kinds are describable here, so a
15
+ * The node set is closed. All fifteen kinds are describable here, so a
16
16
  * definition written for a later phase is refused by the engine as "not yet
17
17
  * runnable", never as "unknown kind".
18
18
  *
@@ -28,6 +28,7 @@ export const NODE_KINDS = [
28
28
  'blueprint',
29
29
  'function',
30
30
  'llm',
31
+ 'decide',
31
32
  'action',
32
33
  'agent',
33
34
  'plugin',
@@ -215,6 +216,24 @@ export interface LlmParams {
215
216
  temperature?: number
216
217
  maxTokens?: number
217
218
  }
219
+ /**
220
+ * One question for the decisions model. `choice` picks one option from
221
+ * `criteria` (option name to what it means), `score` places the state on an
222
+ * ordered scale (`criteria` lists the levels, lowest first) and `noul` answers
223
+ * yes or no as a probability (`criteria` may say what yes and no mean).
224
+ */
225
+ export type DecideQuestion =
226
+ | { type: 'choice'; instructions: string; criteria: Record<string, string> }
227
+ | { type: 'score'; instructions: string; criteria: string[] }
228
+ | { type: 'noul'; instructions: string; criteria?: { true?: string; false?: string } }
229
+ export interface DecideParams {
230
+ /** The decisions model. Defaults to `typesafe/jev-1.13`. */
231
+ model: string
232
+ /** The facts the questions are about. */
233
+ state: DataInput
234
+ /** Question id to question; each id is a key of the result's `answers`. */
235
+ questions: Record<string, DecideQuestion>
236
+ }
218
237
  export interface ActionParams {
219
238
  input: DataInput
220
239
  }
@@ -271,6 +290,7 @@ export type WorkflowNode =
271
290
  | NodeOf<'blueprint', BlueprintQueryParams | BlueprintAggregateParams>
272
291
  | NodeOf<'function', FunctionParams>
273
292
  | NodeOf<'llm', LlmParams>
293
+ | NodeOf<'decide', DecideParams>
274
294
  | NodeOf<'action', ActionParams>
275
295
  | NodeOf<'agent', AgentParams>
276
296
  | NodeOf<'plugin', PluginParams>