composable_agents 3.7.0 → 3.7.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 753d56bfc73e0b268d107ae37338f3efa465fc1fe559813228aa3498e6544d9e
4
- data.tar.gz: 21ac2d0a614a3044f392675dd988dce82c4ffcc5cb2c5192ae9a8f32416bab1d
3
+ metadata.gz: ca528fbcd43384651ac041c0b1f2b20fa437209cffb628a6bcd585e8dc3e1e35
4
+ data.tar.gz: 0e11d4f796c723f0682af2d92a0b9c1642feb7ac18aa5bc9665e134a248e2405
5
5
  SHA512:
6
- metadata.gz: 39d7fb3e1d61adb4ed78ca652b1f1aa5fc9b689cea004305de6ba14a56646725762ffb1c72965a69a516c804c5f3231197b474ebdcc4119830f708c9c85135b0
7
- data.tar.gz: b2a60316353effb352cd785e54faa5f0b3d07a01f3c46fdf447f0dfdb57dc990f495ed12fddaf70eeb800cccac4b05b71ac14543bf9057c17b32f90a313dd09a
6
+ metadata.gz: b73237c63d9c118f059472397c7b1d9132d96cdaa529fd5ece002a6a1a4df826fb4fb1ba2904202a055478081ae389ec5edc6162353290337071bd8af880d08c
7
+ data.tar.gz: 74b7902c87e91a3a6f3ce5377958bddad512d55c1495577f3c5c765c346fe9b2c92158a70d61001b5b454d3c66e9e481e3a116155d24b278fbaa2508a373c2ec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # [v3.7.1](https://github.com/Muriel-Salvan/composable_agents/compare/v3.7.0...v3.7.1) (2026-11-12 13:28:25)
2
+
3
+ ## Global changes
4
+ ### Patches
5
+
6
+ * [fix(MarkdownHeavyFiles): lazy-init MarkdownHeavyFiles artifact dirs](https://github.com/Muriel-Salvan/composable_agents/commit/bb64c69e65a60130e356c70755d0b862586a5351)
7
+
8
+ ## Changes for MarkdownHeavyFiles
9
+ ### Patches
10
+
11
+ * [fix(MarkdownHeavyFiles): lazy-init MarkdownHeavyFiles artifact dirs](https://github.com/Muriel-Salvan/composable_agents/commit/bb64c69e65a60130e356c70755d0b862586a5351)
12
+
1
13
  # [v3.7.0](https://github.com/Muriel-Salvan/composable_agents/compare/v3.6.1...v3.7.0) (2026-11-12 12:08:18)
2
14
 
3
15
  ## Global changes
data/README.md CHANGED
@@ -679,7 +679,7 @@ Three strategies are included, mixed into the agent at initialization via `singl
679
679
 
680
680
  - **`PromptRenderingStrategy::Markdown`** — Clean, minimal Markdown. Simple instructions and artifact references.
681
681
  - **`PromptRenderingStrategy::MarkdownHeavy`** (default for Cline) — Elaborate prompts with execution checklists, structured artifact definition sections, and **JSON-based output parsing**. Agents format their artifacts as JSON blocks tagged with `output_artifact=NAME`, which the strategy parses back into the output hash. Includes type-aware parsing (`:text`, `:markdown`, `:json`).
682
- - **`PromptRenderingStrategy::MarkdownHeavyFiles`** — Same heavy Markdown behavior as `MarkdownHeavy`, but artifacts are persisted as files on disk instead of being in-lined or returned as JSON. Input artifacts are written to files that the assistant is asked to open, and output artifacts are expected as files that are read back from disk. Accepts an `artifacts_directory` constructor parameter (defaults to `#{composable_agents_dir}/artifacts`).
682
+ - **`PromptRenderingStrategy::MarkdownHeavyFiles`** — Same heavy Markdown behavior as `MarkdownHeavy`, but artifacts are persisted as files on disk instead of being in-lined or returned as JSON. Input artifacts are written to files that the assistant is asked to open, and output artifacts are expected as files that are read back from disk. Accepts an `artifacts_directory` constructor parameter (defaults to `#{composable_agents_dir}/artifacts`); its artifacts directories are resolved lazily and created on first use.
683
683
 
684
684
  ### LLM backends: ai-agents vs cline-rb 🎯
685
685
 
@@ -15,10 +15,12 @@ module ComposableAgents
15
15
  # - `#parse_output_artifacts(text)` Parses a text that comes from the agent to retrieve output artifacts from files.
16
16
  # - `#artifact_ref(artifact_name) -> String` Returns the absolute path of the artifact file as seen by the assistant.
17
17
  # This can be used to refer to the artifact names properly in the user or system instructions.
18
- # The constructor accepts the following extra parameter:
19
- # - `artifacts_directory` [String, nil] Directory where artifacts are persisted, or nil to default to
20
- # `#{composable_agents_dir}/artifacts`. Input and output artifacts are persisted in the
21
- # `input` and `output` sub-directories respectively.
18
+ # Artifacts are persisted in a directory that defaults to `#{composable_agents_dir}/artifacts`, where input and
19
+ # output artifacts are persisted in its `input` and `output` sub-directories respectively.
20
+ # Those directories are resolved lazily and created on disk the first time they are needed, so that no state
21
+ # needs to be initialized by this module's constructor.
22
+ # They can be customized using the `artifacts_directory` constructor parameter, when this strategy is
23
+ # included in a class.
22
24
  module MarkdownHeavyFiles
23
25
  # @!group Internal
24
26
 
@@ -29,12 +31,8 @@ module ComposableAgents
29
31
  # @param artifacts_directory [String, nil] Directory where artifacts are persisted, or nil to default to
30
32
  # `#{composable_agents_dir}/artifacts`
31
33
  def initialize(*args, artifacts_directory: nil, **kwargs)
34
+ @artifacts_directory = artifacts_directory
32
35
  super(*args, **kwargs)
33
- artifacts_directory ||= "#{@composable_agents_dir}/artifacts"
34
- @input_artifacts_directory = File.join(artifacts_directory, 'input')
35
- @output_artifacts_directory = File.join(artifacts_directory, 'output')
36
- FileUtils.mkdir_p(@input_artifacts_directory)
37
- FileUtils.mkdir_p(@output_artifacts_directory)
38
36
  end
39
37
 
40
38
  # Render the user prompt
@@ -134,6 +132,33 @@ module ComposableAgents
134
132
 
135
133
  private
136
134
 
135
+ # Get the directory where artifacts are persisted.
136
+ # Defaults to `#{composable_agents_dir}/artifacts`.
137
+ # Memoized. This directory is not created on disk until it is actually needed.
138
+ #
139
+ # @return [String] The directory where artifacts are persisted
140
+ def artifacts_directory
141
+ @artifacts_directory ||= "#{@composable_agents_dir}/artifacts"
142
+ end
143
+
144
+ # Get the directory where input artifacts are persisted.
145
+ # Created on disk the first time it is needed.
146
+ # Memoized.
147
+ #
148
+ # @return [String] The directory where input artifacts are persisted
149
+ def input_artifacts_directory
150
+ @input_artifacts_directory ||= File.join(artifacts_directory, 'input').tap { |dir| FileUtils.mkdir_p(dir) }
151
+ end
152
+
153
+ # Get the directory where output artifacts are persisted.
154
+ # Created on disk the first time it is needed.
155
+ # Memoized.
156
+ #
157
+ # @return [String] The directory where output artifacts are persisted
158
+ def output_artifacts_directory
159
+ @output_artifacts_directory ||= File.join(artifacts_directory, 'output').tap { |dir| FileUtils.mkdir_p(dir) }
160
+ end
161
+
137
162
  # Render the input artifacts concept section of the system prompt.
138
163
  #
139
164
  # @param input_contracts [Hash{Symbol => Hash{Symbol => Object}}] The normalized input artifacts contracts
@@ -218,7 +243,7 @@ module ComposableAgents
218
243
  # @return [String] The absolute path of the input artifact file
219
244
  def input_artifact_path(artifact_name)
220
245
  File.join(
221
- @input_artifacts_directory,
246
+ input_artifacts_directory,
222
247
  "#{artifact_name}#{artifact_extension(normalized_input_artifacts_contracts.dig(artifact_name, :type))}"
223
248
  )
224
249
  end
@@ -229,7 +254,7 @@ module ComposableAgents
229
254
  # @return [String] The absolute path of the output artifact file
230
255
  def output_artifact_path(artifact_name)
231
256
  File.join(
232
- @output_artifacts_directory,
257
+ output_artifacts_directory,
233
258
  "#{artifact_name}#{artifact_extension(normalized_output_artifacts_contracts.dig(artifact_name, :type))}"
234
259
  )
235
260
  end
@@ -2,5 +2,5 @@ module ComposableAgents
2
2
  # @!group Public API
3
3
 
4
4
  # Gem version
5
- VERSION = '3.7.0'
5
+ VERSION = '3.7.1'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: composable_agents
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0
4
+ version: 3.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Muriel Salvan