handinger 0.10.1 → 0.12.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 525e7644523c65d7c9f9757c6794a73c026dd34e44a92aff8157d74ca7e4163f
4
- data.tar.gz: a729c0b72466476b454020000bb9cc0f17ec8563e33b0e76c1307b1073e4fabf
3
+ metadata.gz: cc7d330384a0ff37cee9f18ad697e410a8cb931def3834447aca9724aa3fe098
4
+ data.tar.gz: 4e5e2ee2d79931da8d93b8ce0c3108be614b06de4cd2ed3b7f9156c03489dcf6
5
5
  SHA512:
6
- metadata.gz: 62e4c8c3c26a33f1928c40f02c390f28585a69e5032f5d0abe339bade2df9278c82774a847b6712caa9209ef838e5a2787762ec73403c48e77fb63ae90f08f86
7
- data.tar.gz: 5d5dbd1d615b4634827dd157135d8d87f899d8d7a016704dd7658ba74abda979c57db30902ae0c4d1e1fde5ec6d78a1f40d4046d47bce6e239adfd296668ea5e
6
+ metadata.gz: a894986cbb06d5de67b840d8e9b1206f09ce32321bbad244e7c10af3eb1e62a3ed16c8f953a627b274dc15c659518cd66a1fb0b9284f87ad9b03c36ae7c2b455
7
+ data.tar.gz: '096df7c53e269b14d163abe84d359260255453556a8af6ba8da4077cdbd7656973853ca96cc76437f61868f9e29a389ee752941f75e7672201dc02b4af7397ed'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.0 (2026-06-03)
4
+
5
+ Full Changelog: [v0.11.0...v0.12.0](https://github.com/ramensoft/handinger-ruby/compare/v0.11.0...v0.12.0)
6
+
7
+ ### Features
8
+
9
+ * Refactor task chat to use WebSocket agent connection ([64008fb](https://github.com/ramensoft/handinger-ruby/commit/64008fbcc2b333c98b8314db285f191bb37ed104))
10
+
11
+ ## 0.11.0 (2026-05-15)
12
+
13
+ Full Changelog: [v0.10.1...v0.11.0](https://github.com/ramensoft/handinger-ruby/compare/v0.10.1...v0.11.0)
14
+
15
+ ### Features
16
+
17
+ * Improve attachment information ([f95c640](https://github.com/ramensoft/handinger-ruby/commit/f95c640ad46ee1c58f83b763b179a4844f93a287))
18
+
3
19
  ## 0.10.1 (2026-05-14)
4
20
 
5
21
  Full Changelog: [v0.10.0...v0.10.1](https://github.com/ramensoft/handinger-ruby/compare/v0.10.0...v0.10.1)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "handinger", "~> 0.10.1"
20
+ gem "handinger", "~> 0.12.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -15,13 +15,6 @@ module Handinger
15
15
  # @return [Symbol, Handinger::Models::CreateTask::Budget, nil]
16
16
  optional :budget, enum: -> { Handinger::CreateTask::Budget }
17
17
 
18
- # @!attribute stream
19
- # Stream the response as server-sent events instead of waiting for the final
20
- # payload.
21
- #
22
- # @return [Boolean, nil]
23
- optional :stream, Handinger::Internal::Type::Boolean
24
-
25
18
  # @!attribute task_id
26
19
  # Optional client-provided task id. Reuse this id to add turns to an existing
27
20
  # task.
@@ -36,7 +29,7 @@ module Handinger
36
29
  # @return [String, nil]
37
30
  optional :worker_id, String, api_name: :workerId
38
31
 
39
- # @!method initialize(input:, budget: nil, stream: nil, task_id: nil, worker_id: nil)
32
+ # @!method initialize(input:, budget: nil, task_id: nil, worker_id: nil)
40
33
  # Some parameter documentations has been truncated, see
41
34
  # {Handinger::Models::CreateTask} for more details.
42
35
  #
@@ -44,8 +37,6 @@ module Handinger
44
37
  #
45
38
  # @param budget [Symbol, Handinger::Models::CreateTask::Budget] Compute budget the worker is allowed to spend on the task. Defaults to `standard
46
39
  #
47
- # @param stream [Boolean] Stream the response as server-sent events instead of waiting for the final paylo
48
- #
49
40
  # @param task_id [String] Optional client-provided task id. Reuse this id to add turns to an existing task
50
41
  #
51
42
  # @param worker_id [String] Worker id the task belongs to. If omitted, a new worker is created on-the-fly us
@@ -136,10 +136,16 @@ module Handinger
136
136
  # @return [String]
137
137
  required :url, String
138
138
 
139
- # @!method initialize(filename:, media_type:, url:)
139
+ # @!attribute size
140
+ #
141
+ # @return [Integer, nil]
142
+ optional :size, Integer
143
+
144
+ # @!method initialize(filename:, media_type:, url:, size: nil)
140
145
  # @param filename [String, nil]
141
146
  # @param media_type [String]
142
147
  # @param url [String]
148
+ # @param size [Integer]
143
149
  end
144
150
 
145
151
  class Output < Handinger::Internal::Type::BaseModel
@@ -12,36 +12,22 @@ module Handinger
12
12
  # @return [String]
13
13
  required :worker_id, String
14
14
 
15
- # @!attribute stream
16
- # Set to "true" to receive a server-sent event stream that replays all stored
17
- # messages and then continues with live chunks from the active task (if any)
18
- # before closing.
15
+ # @!attribute task_id
16
+ # Return the worker state and messages for a specific task instead of the most
17
+ # recent one.
19
18
  #
20
- # @return [Symbol, Handinger::Models::WorkerRetrieveParams::Stream, nil]
21
- optional :stream, enum: -> { Handinger::WorkerRetrieveParams::Stream }
19
+ # @return [String, nil]
20
+ optional :task_id, String
22
21
 
23
- # @!method initialize(worker_id:, stream: nil, request_options: {})
22
+ # @!method initialize(worker_id:, task_id: nil, request_options: {})
24
23
  # Some parameter documentations has been truncated, see
25
24
  # {Handinger::Models::WorkerRetrieveParams} for more details.
26
25
  #
27
26
  # @param worker_id [String]
28
27
  #
29
- # @param stream [Symbol, Handinger::Models::WorkerRetrieveParams::Stream] Set to "true" to receive a server-sent event stream that replays all stored mess
28
+ # @param task_id [String] Return the worker state and messages for a specific task instead of the most rec
30
29
  #
31
30
  # @param request_options [Handinger::RequestOptions, Hash{Symbol=>Object}]
32
-
33
- # Set to "true" to receive a server-sent event stream that replays all stored
34
- # messages and then continues with live chunks from the active task (if any)
35
- # before closing.
36
- module Stream
37
- extend Handinger::Internal::Type::Enum
38
-
39
- TRUE = :true
40
- FALSE = :false
41
-
42
- # @!method self.values
43
- # @return [Array<Symbol>]
44
- end
45
31
  end
46
32
  end
47
33
  end
@@ -7,19 +7,19 @@ module Handinger
7
7
  # Some parameter documentations has been truncated, see
8
8
  # {Handinger::Models::TaskCreateParams} for more details.
9
9
  #
10
- # Run a new task against an existing worker. Send a `taskId` of a prior task to
11
- # add a follow-up turn instead of starting a fresh task. Send
12
- # `multipart/form-data` to attach files; the bytes are bootstrapped into the
13
- # worker's workspace before the task starts.
10
+ # Run a new task against an existing worker and wait for the result. Send a
11
+ # `taskId` of a prior task to add a follow-up turn instead of starting a fresh
12
+ # task. Send `multipart/form-data` to attach files; the bytes are bootstrapped
13
+ # into the worker's workspace before the task starts. The task runs to completion
14
+ # on the server even if the connection drops; subscribe to task webhooks for
15
+ # long-running tasks.
14
16
  #
15
- # @overload create(input:, budget: nil, stream: nil, task_id: nil, worker_id: nil, request_options: {})
17
+ # @overload create(input:, budget: nil, task_id: nil, worker_id: nil, request_options: {})
16
18
  #
17
19
  # @param input [String]
18
20
  #
19
21
  # @param budget [Symbol, Handinger::Models::CreateTask::Budget] Compute budget the worker is allowed to spend on the task. Defaults to `standard
20
22
  #
21
- # @param stream [Boolean] Stream the response as server-sent events instead of waiting for the final paylo
22
- #
23
23
  # @param task_id [String] Optional client-provided task id. Reuse this id to add turns to an existing task
24
24
  #
25
25
  # @param worker_id [String] Worker id the task belongs to. If omitted, a new worker is created on-the-fly us
@@ -51,15 +51,14 @@ module Handinger
51
51
  # Some parameter documentations has been truncated, see
52
52
  # {Handinger::Models::WorkerRetrieveParams} for more details.
53
53
  #
54
- # Retrieve the current worker state and messages from its most recent task.
55
- # Returns a JSON worker object by default, or a server-sent event stream when
56
- # `stream=true`.
54
+ # Retrieve the current worker state and messages from its most recent task (or a
55
+ # specific task via `taskId`).
57
56
  #
58
- # @overload retrieve(worker_id, stream: nil, request_options: {})
57
+ # @overload retrieve(worker_id, task_id: nil, request_options: {})
59
58
  #
60
59
  # @param worker_id [String] Worker id returned by the create worker endpoint.
61
60
  #
62
- # @param stream [Symbol, Handinger::Models::WorkerRetrieveParams::Stream] Set to "true" to receive a server-sent event stream that replays all stored mess
61
+ # @param task_id [String] Return the worker state and messages for a specific task instead of the most rec
63
62
  #
64
63
  # @param request_options [Handinger::RequestOptions, Hash{Symbol=>Object}, nil]
65
64
  #
@@ -72,7 +71,7 @@ module Handinger
72
71
  @client.request(
73
72
  method: :get,
74
73
  path: ["api/workers/%1$s", worker_id],
75
- query: query,
74
+ query: query.transform_keys(task_id: "taskId"),
76
75
  model: Handinger::Worker,
77
76
  options: options
78
77
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Handinger
4
- VERSION = "0.10.1"
4
+ VERSION = "0.12.0"
5
5
  end
@@ -19,14 +19,6 @@ module Handinger
19
19
  sig { params(budget: Handinger::CreateTask::Budget::OrSymbol).void }
20
20
  attr_writer :budget
21
21
 
22
- # Stream the response as server-sent events instead of waiting for the final
23
- # payload.
24
- sig { returns(T.nilable(T::Boolean)) }
25
- attr_reader :stream
26
-
27
- sig { params(stream: T::Boolean).void }
28
- attr_writer :stream
29
-
30
22
  # Optional client-provided task id. Reuse this id to add turns to an existing
31
23
  # task.
32
24
  sig { returns(T.nilable(String)) }
@@ -47,7 +39,6 @@ module Handinger
47
39
  params(
48
40
  input: String,
49
41
  budget: Handinger::CreateTask::Budget::OrSymbol,
50
- stream: T::Boolean,
51
42
  task_id: String,
52
43
  worker_id: String
53
44
  ).returns(T.attached_class)
@@ -57,9 +48,6 @@ module Handinger
57
48
  # Compute budget the worker is allowed to spend on the task. Defaults to
58
49
  # `standard`.
59
50
  budget: nil,
60
- # Stream the response as server-sent events instead of waiting for the final
61
- # payload.
62
- stream: nil,
63
51
  # Optional client-provided task id. Reuse this id to add turns to an existing
64
52
  # task.
65
53
  task_id: nil,
@@ -74,7 +62,6 @@ module Handinger
74
62
  {
75
63
  input: String,
76
64
  budget: Handinger::CreateTask::Budget::OrSymbol,
77
- stream: T::Boolean,
78
65
  task_id: String,
79
66
  worker_id: String
80
67
  }
@@ -139,19 +139,31 @@ module Handinger
139
139
  sig { returns(String) }
140
140
  attr_accessor :url
141
141
 
142
+ sig { returns(T.nilable(Integer)) }
143
+ attr_reader :size
144
+
145
+ sig { params(size: Integer).void }
146
+ attr_writer :size
147
+
142
148
  sig do
143
149
  params(
144
150
  filename: T.nilable(String),
145
151
  media_type: String,
146
- url: String
152
+ url: String,
153
+ size: Integer
147
154
  ).returns(T.attached_class)
148
155
  end
149
- def self.new(filename:, media_type:, url:)
156
+ def self.new(filename:, media_type:, url:, size: nil)
150
157
  end
151
158
 
152
159
  sig do
153
160
  override.returns(
154
- { filename: T.nilable(String), media_type: String, url: String }
161
+ {
162
+ filename: T.nilable(String),
163
+ media_type: String,
164
+ url: String,
165
+ size: Integer
166
+ }
155
167
  )
156
168
  end
157
169
  def to_hash
@@ -14,32 +14,26 @@ module Handinger
14
14
  sig { returns(String) }
15
15
  attr_accessor :worker_id
16
16
 
17
- # Set to "true" to receive a server-sent event stream that replays all stored
18
- # messages and then continues with live chunks from the active task (if any)
19
- # before closing.
20
- sig do
21
- returns(T.nilable(Handinger::WorkerRetrieveParams::Stream::OrSymbol))
22
- end
23
- attr_reader :stream
17
+ # Return the worker state and messages for a specific task instead of the most
18
+ # recent one.
19
+ sig { returns(T.nilable(String)) }
20
+ attr_reader :task_id
24
21
 
25
- sig do
26
- params(stream: Handinger::WorkerRetrieveParams::Stream::OrSymbol).void
27
- end
28
- attr_writer :stream
22
+ sig { params(task_id: String).void }
23
+ attr_writer :task_id
29
24
 
30
25
  sig do
31
26
  params(
32
27
  worker_id: String,
33
- stream: Handinger::WorkerRetrieveParams::Stream::OrSymbol,
28
+ task_id: String,
34
29
  request_options: Handinger::RequestOptions::OrHash
35
30
  ).returns(T.attached_class)
36
31
  end
37
32
  def self.new(
38
33
  worker_id:,
39
- # Set to "true" to receive a server-sent event stream that replays all stored
40
- # messages and then continues with live chunks from the active task (if any)
41
- # before closing.
42
- stream: nil,
34
+ # Return the worker state and messages for a specific task instead of the most
35
+ # recent one.
36
+ task_id: nil,
43
37
  request_options: {}
44
38
  )
45
39
  end
@@ -48,39 +42,13 @@ module Handinger
48
42
  override.returns(
49
43
  {
50
44
  worker_id: String,
51
- stream: Handinger::WorkerRetrieveParams::Stream::OrSymbol,
45
+ task_id: String,
52
46
  request_options: Handinger::RequestOptions
53
47
  }
54
48
  )
55
49
  end
56
50
  def to_hash
57
51
  end
58
-
59
- # Set to "true" to receive a server-sent event stream that replays all stored
60
- # messages and then continues with live chunks from the active task (if any)
61
- # before closing.
62
- module Stream
63
- extend Handinger::Internal::Type::Enum
64
-
65
- TaggedSymbol =
66
- T.type_alias do
67
- T.all(Symbol, Handinger::WorkerRetrieveParams::Stream)
68
- end
69
- OrSymbol = T.type_alias { T.any(Symbol, String) }
70
-
71
- TRUE =
72
- T.let(:true, Handinger::WorkerRetrieveParams::Stream::TaggedSymbol)
73
- FALSE =
74
- T.let(:false, Handinger::WorkerRetrieveParams::Stream::TaggedSymbol)
75
-
76
- sig do
77
- override.returns(
78
- T::Array[Handinger::WorkerRetrieveParams::Stream::TaggedSymbol]
79
- )
80
- end
81
- def self.values
82
- end
83
- end
84
52
  end
85
53
  end
86
54
  end
@@ -4,15 +4,16 @@ module Handinger
4
4
  module Resources
5
5
  # Run and inspect tasks against a worker.
6
6
  class Tasks
7
- # Run a new task against an existing worker. Send a `taskId` of a prior task to
8
- # add a follow-up turn instead of starting a fresh task. Send
9
- # `multipart/form-data` to attach files; the bytes are bootstrapped into the
10
- # worker's workspace before the task starts.
7
+ # Run a new task against an existing worker and wait for the result. Send a
8
+ # `taskId` of a prior task to add a follow-up turn instead of starting a fresh
9
+ # task. Send `multipart/form-data` to attach files; the bytes are bootstrapped
10
+ # into the worker's workspace before the task starts. The task runs to completion
11
+ # on the server even if the connection drops; subscribe to task webhooks for
12
+ # long-running tasks.
11
13
  sig do
12
14
  params(
13
15
  input: String,
14
16
  budget: Handinger::CreateTask::Budget::OrSymbol,
15
- stream: T::Boolean,
16
17
  task_id: String,
17
18
  worker_id: String,
18
19
  request_options: Handinger::RequestOptions::OrHash
@@ -23,9 +24,6 @@ module Handinger
23
24
  # Compute budget the worker is allowed to spend on the task. Defaults to
24
25
  # `standard`.
25
26
  budget: nil,
26
- # Stream the response as server-sent events instead of waiting for the final
27
- # payload.
28
- stream: nil,
29
27
  # Optional client-provided task id. Reuse this id to add turns to an existing
30
28
  # task.
31
29
  task_id: nil,
@@ -47,23 +47,21 @@ module Handinger
47
47
  )
48
48
  end
49
49
 
50
- # Retrieve the current worker state and messages from its most recent task.
51
- # Returns a JSON worker object by default, or a server-sent event stream when
52
- # `stream=true`.
50
+ # Retrieve the current worker state and messages from its most recent task (or a
51
+ # specific task via `taskId`).
53
52
  sig do
54
53
  params(
55
54
  worker_id: String,
56
- stream: Handinger::WorkerRetrieveParams::Stream::OrSymbol,
55
+ task_id: String,
57
56
  request_options: Handinger::RequestOptions::OrHash
58
57
  ).returns(Handinger::Worker)
59
58
  end
60
59
  def retrieve(
61
60
  # Worker id returned by the create worker endpoint.
62
61
  worker_id,
63
- # Set to "true" to receive a server-sent event stream that replays all stored
64
- # messages and then continues with live chunks from the active task (if any)
65
- # before closing.
66
- stream: nil,
62
+ # Return the worker state and messages for a specific task instead of the most
63
+ # recent one.
64
+ task_id: nil,
67
65
  request_options: {}
68
66
  )
69
67
  end
@@ -4,7 +4,6 @@ module Handinger
4
4
  {
5
5
  input: String,
6
6
  budget: Handinger::Models::CreateTask::budget,
7
- stream: bool,
8
7
  task_id: String,
9
8
  worker_id: String
10
9
  }
@@ -18,10 +17,6 @@ module Handinger
18
17
  Handinger::Models::CreateTask::budget
19
18
  ) -> Handinger::Models::CreateTask::budget
20
19
 
21
- attr_reader stream: bool?
22
-
23
- def stream=: (bool) -> bool
24
-
25
20
  attr_reader task_id: String?
26
21
 
27
22
  def task_id=: (String) -> String
@@ -33,7 +28,6 @@ module Handinger
33
28
  def initialize: (
34
29
  input: String,
35
30
  ?budget: Handinger::Models::CreateTask::budget,
36
- ?stream: bool,
37
31
  ?task_id: String,
38
32
  ?worker_id: String
39
33
  ) -> void
@@ -41,7 +35,6 @@ module Handinger
41
35
  def to_hash: -> {
42
36
  input: String,
43
37
  budget: Handinger::Models::CreateTask::budget,
44
- stream: bool,
45
38
  task_id: String,
46
39
  worker_id: String
47
40
  }
@@ -93,7 +93,8 @@ module Handinger
93
93
  usage: Handinger::Worker::Usage
94
94
  }
95
95
 
96
- type file = { filename: String?, media_type: String, url: String }
96
+ type file =
97
+ { filename: String?, media_type: String, url: String, size: Integer }
97
98
 
98
99
  class File < Handinger::Internal::Type::BaseModel
99
100
  attr_accessor filename: String?
@@ -102,13 +103,23 @@ module Handinger
102
103
 
103
104
  attr_accessor url: String
104
105
 
106
+ attr_reader size: Integer?
107
+
108
+ def size=: (Integer) -> Integer
109
+
105
110
  def initialize: (
106
111
  filename: String?,
107
112
  media_type: String,
108
- url: String
113
+ url: String,
114
+ ?size: Integer
109
115
  ) -> void
110
116
 
111
- def to_hash: -> { filename: String?, media_type: String, url: String }
117
+ def to_hash: -> {
118
+ filename: String?,
119
+ media_type: String,
120
+ url: String,
121
+ size: Integer
122
+ }
112
123
  end
113
124
 
114
125
  type output =
@@ -1,10 +1,7 @@
1
1
  module Handinger
2
2
  module Models
3
3
  type worker_retrieve_params =
4
- {
5
- worker_id: String,
6
- stream: Handinger::Models::WorkerRetrieveParams::stream
7
- }
4
+ { worker_id: String, task_id: String }
8
5
  & Handinger::Internal::Type::request_parameters
9
6
 
10
7
  class WorkerRetrieveParams < Handinger::Internal::Type::BaseModel
@@ -13,34 +10,21 @@ module Handinger
13
10
 
14
11
  attr_accessor worker_id: String
15
12
 
16
- attr_reader stream: Handinger::Models::WorkerRetrieveParams::stream?
13
+ attr_reader task_id: String?
17
14
 
18
- def stream=: (
19
- Handinger::Models::WorkerRetrieveParams::stream
20
- ) -> Handinger::Models::WorkerRetrieveParams::stream
15
+ def task_id=: (String) -> String
21
16
 
22
17
  def initialize: (
23
18
  worker_id: String,
24
- ?stream: Handinger::Models::WorkerRetrieveParams::stream,
19
+ ?task_id: String,
25
20
  ?request_options: Handinger::request_opts
26
21
  ) -> void
27
22
 
28
23
  def to_hash: -> {
29
24
  worker_id: String,
30
- stream: Handinger::Models::WorkerRetrieveParams::stream,
25
+ task_id: String,
31
26
  request_options: Handinger::RequestOptions
32
27
  }
33
-
34
- type stream = :true | :false
35
-
36
- module Stream
37
- extend Handinger::Internal::Type::Enum
38
-
39
- TRUE: :true
40
- FALSE: :false
41
-
42
- def self?.values: -> ::Array[Handinger::Models::WorkerRetrieveParams::stream]
43
- end
44
28
  end
45
29
  end
46
30
  end
@@ -4,7 +4,6 @@ module Handinger
4
4
  def create: (
5
5
  input: String,
6
6
  ?budget: Handinger::Models::CreateTask::budget,
7
- ?stream: bool,
8
7
  ?task_id: String,
9
8
  ?worker_id: String,
10
9
  ?request_options: Handinger::request_opts
@@ -17,7 +17,7 @@ module Handinger
17
17
 
18
18
  def retrieve: (
19
19
  String worker_id,
20
- ?stream: Handinger::Models::WorkerRetrieveParams::stream,
20
+ ?task_id: String,
21
21
  ?request_options: Handinger::request_opts
22
22
  ) -> Handinger::Worker
23
23
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: handinger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Handinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-14 00:00:00.000000000 Z
11
+ date: 2026-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi