ask-graph 0.1.1 → 0.1.3

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: 79153d7eedc0823a4831f68994771bf5b57e7e50aa872ddafff3254670d2dc7a
4
- data.tar.gz: f5a32f4df22bfebefda9e8963684137bd620fbb47fa70cf088fed10cfb0e2d3f
3
+ metadata.gz: ad07fb878d69dbb0a0bd0065e5c26275bfeda6169fa36fb6aa5688e129534b20
4
+ data.tar.gz: b583bbe7555a92bfdb2bb5430e7498925e6aa6019f185e5147780861f9da94d8
5
5
  SHA512:
6
- metadata.gz: 1a502848e6dec5c7fdbf47bb5cdf7d74104d8706e68d674c7b9f33da462e330aa429fb9df493aa71d8309fe57cb46352461ff54a488452e4768d5628ed7a93ae
7
- data.tar.gz: 55b42aad5f0b6f1ec4e7bb81661ed068ebd37dabd1d95fe6429ffb09cf2ad5ba91aa747f46560a26b5f2b65e6b4b377d18be8bc07e45ea191eb4b147ec0fa0d6
6
+ metadata.gz: b2baa9116d362d868462bd420c968a52b887f27df32fef51f040180012df815af84b1f33b29ddc7794e896bae3e53779995019ce9515835a83371b9d3d572513
7
+ data.tar.gz: 7b3bcde81e887dddb9b9e2a51f2844eff4ea4d5f4197f40d41c3bf15c5d79b986b2153d409ebf37d902b3c05fdddf55a2596de153cd4b2732fd501d7786234fc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ ## [0.1.3] — 2026-07-28
2
+
3
+ ### Changed
4
+
5
+ - **Added `ask-state-providers` dependency** — `Ask::State::Memory` is now provided by the `ask-state-providers` gem (moved from `ask-core` 0.8.0). `ask-graph` automatically loads it.
6
+
7
+ ## [0.1.2] — 2026-07-28
8
+
9
+ ### Changed
10
+
11
+ - **`Graph.new(input).call` API** — input is now passed to the constructor, not to `call`. This reads more naturally: create a graph with data, then execute it. `Graph.call(input, checkpoint_store:)` class method still available for convenience.
12
+
13
+ ```ruby
14
+ # Before
15
+ HandleCall.new.call(recording: "call.wav")
16
+
17
+ # After
18
+ HandleCall.new({ recording: "call.wav" }).call
19
+ ```
20
+
21
+ ### Tested
22
+
23
+ - 36 tests, 52 assertions, 0 failures
24
+
1
25
  ## [0.1.1] — 2026-07-28
2
26
 
3
27
  ### Fixed
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  class Graph
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.3"
6
6
  end
7
7
  end
data/lib/ask/graph.rb CHANGED
@@ -83,15 +83,16 @@ module Ask
83
83
  # @param checkpoint_store [#set, #get, #delete] optional persistent store
84
84
  # @return [Ask::Graph::Context] the completed context
85
85
  def call(input = nil, checkpoint_store: nil)
86
- new(checkpoint_store: checkpoint_store).call(input)
86
+ new(input, checkpoint_store: checkpoint_store).call
87
87
  end
88
88
  alias run call
89
89
  end
90
90
 
91
- # @param checkpoint_store [#set, #get, #delete, nil] optional persistent store
92
- # Defaults to in-memory store (no durability). Pass a persistent store
93
- # for crash recovery.
94
- def initialize(checkpoint_store: nil)
91
+ # @param input [Object, nil] initial input for the graph execution
92
+ # @param checkpoint_store [#set, #get, #delete, nil] optional persistent store.
93
+ # Defaults to in-memory store. Pass a persistent store for crash recovery.
94
+ def initialize(input = nil, checkpoint_store: nil)
95
+ @input = input
95
96
  store = checkpoint_store || Ask::State::Memory.new
96
97
  @runner = Runner.new(self.class.declarations, checkpoint_store: store)
97
98
  @context = nil
@@ -103,11 +104,10 @@ module Ask
103
104
  # @return [Ask::Graph::Context, nil] the shared context
104
105
  attr_reader :context
105
106
 
106
- # Run the graph with the given input.
107
- # @param input [Object] optional initial input
107
+ # Execute the graph.
108
108
  # @return [Ask::Graph::Context] the completed context
109
- def call(input = nil)
110
- @context = Context.new(self, input)
109
+ def call
110
+ @context = Context.new(self, @input)
111
111
  @runner.run(@context)
112
112
  @context
113
113
  rescue => e
data/lib/ask-graph.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "ask"
4
+ require "ask-state-providers"
4
5
  require_relative "ask/graph"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto
@@ -15,14 +15,28 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '0.6'
18
+ version: '0.7'
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '0.6'
25
+ version: '0.7'
26
+ - !ruby/object:Gem::Dependency
27
+ name: ask-state-providers
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0.2'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0.2'
26
40
  - !ruby/object:Gem::Dependency
27
41
  name: minitest
28
42
  requirement: !ruby/object:Gem::Requirement