@codemation/agent-skills 0.1.7 → 0.1.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @codemation/agent-skills
2
2
 
3
+ ## 0.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#78](https://github.com/MadeRelevant/codemation/pull/78) [`f451b1b`](https://github.com/MadeRelevant/codemation/commit/f451b1b4657b59406e15ce5f50b243e487ff99ed) Thanks [@cblokland90](https://github.com/cblokland90)! - Normalize fluent workflow DSL callback helpers around the runtime item contract.
8
+
9
+ `.map(...)`, `.if(...)`, and `.switch({ resolveCaseKey })` now receive `(item, ctx)` so workflow authors can use `item.json` consistently and read prior completed outputs through `ctx.data` without dropping down to direct node configs.
10
+
3
11
  ## 0.1.7
4
12
 
5
13
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemation/agent-skills",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Reusable agent skills for Codemation projects and plugin development.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -18,6 +18,7 @@ Do not use this skill for CLI-only troubleshooting or deep host architecture que
18
18
  2. The fluent authoring chain is the normal starting point for Codemation apps.
19
19
  3. Finish fluent workflow definitions with `.build()`.
20
20
  4. Activations are **batch-shaped** (`Items`); many steps use **per-item** execution (`execute`, including helper **`defineNode`**) with optional **`inputSchema`** and **`itemValue`** on config fields. Batch reshape steps (split/filter/aggregate, **`defineBatchNode`**) work on the whole batch.
21
+ 5. Fluent callback helpers follow the runtime item contract: `.map(...)`, `.if(...)`, and `.switch({ resolveCaseKey })` receive `(item, ctx)`, so row fields live under `item.json` and earlier completed outputs are available through `ctx.data`.
21
22
 
22
23
  ## Authoring rules
23
24
 
@@ -45,6 +46,7 @@ Do not use this skill for CLI-only troubleshooting or deep host architecture que
45
46
  - Define agent messages with `messages`, not a workflow-specific prompt shortcut.
46
47
  - Use a static `messages` array for fixed prompts.
47
48
  - Use `itemValue(...)` when agent messages depend on the current item.
49
+ - Use fluent `.map((item, ctx) => ...)` when workflow data itself needs reshaping before the agent step.
48
50
  - `model` may be a provider string such as `"openai:gpt-4o-mini"` or a `ChatModelConfig`.
49
51
 
50
52
  ## Read next when needed
@@ -8,8 +8,8 @@ export default workflow("wf.example.id")
8
8
  .manualTrigger("Start", {
9
9
  step: "start",
10
10
  })
11
- .map("Transform", (item) => ({
12
- ...item,
11
+ .map("Transform", (item, _ctx) => ({
12
+ ...item.json,
13
13
  transformed: true,
14
14
  }))
15
15
  .build();
@@ -27,6 +27,8 @@ export default workflow("wf.example.id")
27
27
  - items usually carry `json` data and optional `binary` data
28
28
  - runtime nodes receive batches of items, not just one record
29
29
  - author workflow steps with batching in mind
30
+ - fluent `.map(...)`, `.if(...)`, and `.switch({ resolveCaseKey })` callbacks receive `(item, ctx)`
31
+ - read row fields from `item.json` and earlier completed outputs from `ctx.data`
30
32
 
31
33
  ## When to move beyond callbacks
32
34