@codemation/core-nodes 0.10.2 → 0.13.0

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 (39) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/dist/index.cjs +427 -102
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +205 -67
  5. package/dist/index.d.ts +206 -68
  6. package/dist/index.js +427 -99
  7. package/dist/index.js.map +1 -1
  8. package/dist/metadata.json +1 -1
  9. package/package.json +3 -2
  10. package/src/chatModels/CodemationChatModelConfig.ts +9 -21
  11. package/src/chatModels/CodemationChatModelFactory.ts +12 -9
  12. package/src/chatModels/OpenAIChatModelFactory.ts +3 -2
  13. package/src/index.ts +1 -1
  14. package/src/nodes/AIAgentConfig.ts +36 -0
  15. package/src/nodes/AIAgentNode.ts +81 -15
  16. package/src/nodes/AgentBinaryContentFactory.ts +74 -0
  17. package/src/nodes/AgentMessageFactory.ts +22 -6
  18. package/src/nodes/AgentToolResultContentFactory.ts +155 -0
  19. package/src/nodes/CallbackNodeFactory.ts +9 -6
  20. package/src/nodes/CronTriggerFactory.ts +6 -2
  21. package/src/nodes/DeferredMetaToolStrategy.ts +8 -2
  22. package/src/nodes/ManualTriggerFactory.ts +15 -11
  23. package/src/nodes/WebhookTriggerFactory.ts +9 -2
  24. package/src/nodes/aggregate.ts +9 -2
  25. package/src/nodes/assertion.ts +3 -0
  26. package/src/nodes/filter.ts +9 -2
  27. package/src/nodes/httpRequest.ts +6 -1
  28. package/src/nodes/if.ts +9 -2
  29. package/src/nodes/isTestRun.ts +6 -2
  30. package/src/nodes/mapData.ts +4 -2
  31. package/src/nodes/merge.ts +9 -2
  32. package/src/nodes/noOp.ts +9 -2
  33. package/src/nodes/nodeOptions.types.ts +12 -0
  34. package/src/nodes/split.ts +9 -2
  35. package/src/nodes/subWorkflow.ts +9 -2
  36. package/src/nodes/switch.ts +7 -1
  37. package/src/nodes/wait.ts +9 -2
  38. package/src/workflowAuthoring/WorkflowChatModelFactory.types.ts +8 -2
  39. package/src/chatModels/ManagedModelFetcher.ts +0 -23
package/CHANGELOG.md CHANGED
@@ -1,5 +1,127 @@
1
1
  # @codemation/core-nodes
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#240](https://github.com/MadeRelevant/codemation/pull/240) [`d786fc6`](https://github.com/MadeRelevant/codemation/commit/d786fc6ff8684a9c29a6b343b64f2d813d745a5e) Thanks [@cblokland90](https://github.com/cblokland90)! - feat(core-nodes): agent nodes pass tool-returned image/PDF binaries to the chat model
8
+
9
+ When an agent tool (including MCP tools like Gmail/Drive) returns a binary — an image or
10
+ a PDF — inside a `CallToolResult` content array, the agent now forwards it to the chat model
11
+ as a native multimodal tool-result block instead of flattening it to inert JSON text. Images
12
+ become `image-data` parts (image blocks on the wire); PDFs become `file-data` document parts.
13
+ `resource_link`s, embedded text resources, and unsupported binary types surface as text
14
+ markers rather than being dropped, and a per-result size cap replaces oversize binaries with a
15
+ placeholder. This is the tool-result analogue of input-time `item.binary` passdown.
16
+
17
+ A new `passToolBinariesToModel` option on the AI agent (default `true`) keeps the old inert
18
+ JSON behavior when set to `false`.
19
+
20
+ ## 0.12.0
21
+
22
+ ### Minor Changes
23
+
24
+ - [#239](https://github.com/MadeRelevant/codemation/pull/239) [`bc164ef`](https://github.com/MadeRelevant/codemation/commit/bc164ef3dc1433af97beaf642a47a881ab702c62) Thanks [@cblokland90](https://github.com/cblokland90)! - The AI agent node now passes file binaries to its chat model as native inline multimodal blocks.
25
+ Every attachment on `item.binary` is resolved through `ctx.binary` (storage-backed, by reference —
26
+ never base64 on `item.json`) and injected on the last user message — images (`image/*`) as AI SDK
27
+ `image` parts and every other type (PDF, office docs, CSV, JSON, …) as `file` parts, which providers
28
+ map to the wire-level `image` / `document` blocks the model reads natively. Binaries are not filtered
29
+ by type: if a provider doesn't support a given file type the error surfaces at runtime, and the
30
+ workflow can filter the binary upstream. Built automations can now reason over documents and images
31
+ the way the concierge does.
32
+
33
+ Two config options control this passdown:
34
+ - `passBinariesToModel` (default `true`) — set to `false` to skip the passdown entirely.
35
+ - `binaries` — a static `BinaryAttachment[]` or a per-item function `({ item, itemIndex, items, ctx }) => BinaryAttachment[]`.
36
+ When provided, these replace the current item's `item.binary` as the passdown source, so an author
37
+ can forward binaries produced by an earlier node further back in the workflow.
38
+
39
+ ## 0.11.0
40
+
41
+ ### Minor Changes
42
+
43
+ - [#227](https://github.com/MadeRelevant/codemation/pull/227) [`2130eab`](https://github.com/MadeRelevant/codemation/commit/2130eab49bcba708eca898f45fc400913470b11f) Thanks [@cblokland90](https://github.com/cblokland90)! - feat(core-nodes): replace managed model-id with complexity token
44
+
45
+ `CodemationChatModelConfig` now takes a `complexity: ManagedComplexity` token
46
+ (`"low" | "medium" | "high" | "xhigh"`) instead of a free model-id string.
47
+ The managed LLM broker maps the token to a concrete provider model and thinking
48
+ effort server-side — the framework never references concrete model ids.
49
+
50
+ Breaking changes:
51
+ - `CodemationChatModelConfig(name, model)` → `CodemationChatModelConfig(name, complexity)`
52
+ where `complexity` is one of `"low" | "medium" | "high" | "xhigh"`.
53
+ - `temperature` option removed from `CodemationChatModelConfig` — Anthropic rejects
54
+ temperature when thinking is engaged; the broker injects thinking for medium/high.
55
+ - `ManagedModelDto`, `CodemationManagedModel` types removed.
56
+ - `ManagedModelFetcher` class removed — the `/api/llm/managed-models` discovery
57
+ endpoint is no longer part of the complexity-token contract.
58
+
59
+ Factory change: `CodemationChatModelFactory` now uses `@ai-sdk/anthropic` +
60
+ `createAnthropic` (Anthropic-native route) instead of `@ai-sdk/openai` +
61
+ `createOpenAI` (OpenAI-compat route). This is required so the broker's injected
62
+ `thinking` / `output_config.effort` fields survive the round-trip — they are
63
+ stripped by the OpenAI-compat route.
64
+
65
+ Examples and agent-skills updated to use complexity tokens throughout.
66
+
67
+ - [#234](https://github.com/MadeRelevant/codemation/pull/234) [`13f9f11`](https://github.com/MadeRelevant/codemation/commit/13f9f11454855f44cd0849ea7e8f0c60f4a28964) Thanks [@cblokland90](https://github.com/cblokland90)! - feat(core): make `description` a first-class config option every authorable node accepts directly
68
+
69
+ A node's plain-language `description` (the non-technical "what does this step do" line rendered in
70
+ the node properties sidebar) is now a normal option passed inline alongside `id`, exactly like any
71
+ other config field — no wrapper or clone helper:
72
+
73
+ ```ts
74
+ new Callback("Tag order as received", markReceived, { id: "mark", description: "Tags the order." });
75
+ new If("High value?", (i) => i.json.total > 1000, { id: "gate", description: "Routes big orders." });
76
+ new CronTrigger("Nightly", { schedule: "0 2 * * *" }, { id: "nightly", description: "Runs nightly." });
77
+ ```
78
+
79
+ - `NodeConfigBase` gains `readonly description?: string` (mirrors `icon`), and the
80
+ `WorkflowSnapshotCodec` carries it into the persisted snapshot config the host / canvas mappers
81
+ read — so the sidebar renders it. (`description` was added to the codec's non-serializable
82
+ fallback whitelist for parity with `icon`.)
83
+ - Every authorable built-in node threads `description` into its config: options-object nodes
84
+ (`Callback`, `MapData`, `Assertion`, `HttpRequest`, `AIAgent`, `TestTrigger`) accept it in their
85
+ options; bare-id nodes (`If`, `Split`, `Filter`, `Aggregate`, `Wait`, `Switch`, `SubWorkflow`,
86
+ `Merge`, `NoOp`, `IsTestRun`, `CronTrigger`, `WebhookTrigger`, `ManualTrigger`) now take a final
87
+ `string | { id?: string; description?: string }` argument — a bare `"id"` string still works
88
+ (back-compat).
89
+ - The `define*` factory helpers carry it too: `defineNode`, `defineBatchNode`,
90
+ `definePollingTrigger` (and everything layered on `defineNode` — `defineRestNode`,
91
+ `defineHumanApprovalNode`/`inboxApproval`, and the collection CRUD nodes) now accept
92
+ `{ id?, description? }` in the trailing `create(config, name, idOrOptions)` slot, so a per-instance
93
+ `description` survives into the persisted snapshot. A bare string id still works (back-compat).
94
+ - The `workflow-dsl` skill teaches business-action node titles and a one-line `description` set
95
+ directly in each node's options.
96
+
97
+ This supersedes the rejected `present(node, { description })` clone-helper approach (PR [#232](https://github.com/MadeRelevant/codemation/issues/232)/[#233](https://github.com/MadeRelevant/codemation/issues/233)):
98
+ `description` is a normal inline option, not a prototype clone.
99
+
100
+ ### Patch Changes
101
+
102
+ - [#221](https://github.com/MadeRelevant/codemation/pull/221) [`0cc3b13`](https://github.com/MadeRelevant/codemation/commit/0cc3b134e41fb38e6d89f48724da60a63ad4ae2e) Thanks [@cblokland90](https://github.com/cblokland90)! - perf(host): keep heavy conditional deps off the always-on boot graph
103
+
104
+ The always-on workspace Host pays its boot RSS for every workspace, idle or not. Three heavy dependencies were loaded eagerly at boot even though the managed pod never uses them in its default configuration:
105
+ - `@aws-sdk/client-s3` + `@aws-sdk/lib-storage` (~31MB) — only needed for S3 binary/workspace-file storage; the pod uses local/presigned storage.
106
+ - `bullmq` (~32MB) — only needed for the BullMQ scheduler and HITL-timeout worker; the pod runs `inline` execution with no Redis.
107
+ - `ai` / `@ai-sdk/openai` / `@ai-sdk/mcp` (~28MB) — only needed when an AI Agent node or chat model actually executes.
108
+
109
+ Each is now loaded lazily (`await import()`) at its selection/use site, behind the runtime gate that already decided not to use it. Measured host boot RSS drops ~224MB → ~170MB (-24%) with no behavior change. A spawned-process regression test (`eagerBootGraph.integration.test.ts`) asserts these modules stay off the boot graph.
110
+
111
+ - [#226](https://github.com/MadeRelevant/codemation/pull/226) [`6720268`](https://github.com/MadeRelevant/codemation/commit/672026861d15bfd8f64ea3e405e506a7184a2e77) Thanks [@cblokland90](https://github.com/cblokland90)! - test(core-nodes): regression tests for explicit id acceptance on Assertion and TestTrigger
112
+
113
+ Adds three regression tests that prove `Assertion` and `TestTrigger` accept an explicit `id`
114
+ in their options object and that the id survives into `WorkflowDefinition.nodes[].id` through
115
+ `WorkflowBuilder.add()`. A build-eval run had tripped on inconsistent id acceptance; this
116
+ establishes a permanent guard.
117
+
118
+ Also updates the `testing` skill's full example to set explicit ids on the `Assertion` and
119
+ `IsTestRun` nodes, consistent with the `workflow-dsl` gotcha ("Set an explicit `id` on every
120
+ node"). The `TestTrigger` in that example already carried an id.
121
+
122
+ - Updated dependencies [[`675260a`](https://github.com/MadeRelevant/codemation/commit/675260aa7a30c55a34b5a6107ad2222937f4a769), [`13f9f11`](https://github.com/MadeRelevant/codemation/commit/13f9f11454855f44cd0849ea7e8f0c60f4a28964), [`675260a`](https://github.com/MadeRelevant/codemation/commit/675260aa7a30c55a34b5a6107ad2222937f4a769), [`675260a`](https://github.com/MadeRelevant/codemation/commit/675260aa7a30c55a34b5a6107ad2222937f4a769), [`0881b46`](https://github.com/MadeRelevant/codemation/commit/0881b4676d2db29f36415d9b47709128d4c15e0e)]:
123
+ - @codemation/core@0.14.0
124
+
3
125
  ## 0.10.2
4
126
 
5
127
  ### Patch Changes