handinger 0.3.0 → 0.5.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: a53acab611d6eb55ba8f32f3b21854f6d936ff7fc2bdc0bda9da0394040bd3af
4
- data.tar.gz: 3f7daaeb057baa8ebf48a03e2db9a5d83706c3bdf3d46377337103be73bb569f
3
+ metadata.gz: ecd40670a310e06ad0f0b33baa0f620b434bb11398f45a9e44e9c536533441bd
4
+ data.tar.gz: 18bf80c24a1126bb839e73146ec8d5aab5c62aba54fbdf8d56f32a0fb3c97ec1
5
5
  SHA512:
6
- metadata.gz: 22c03ed4a0641b1b16427f0928804b695cb23923534a9abb233a47a247ecd94a77f0a34553c3658de15a556979abd85e10af7ae6a7e25fe07e48234db1d63c40
7
- data.tar.gz: 5e0bc25dc0a11ed63751c99f7d06ae807b778865bf5c96e6f141f9f5e40d512c95d9b740d4a99bd4ba50435f6889351659defb4340ad8fe8901c75f76bf452eb
6
+ metadata.gz: 7520dd4bf1e744831db561b4bc1af8ac9aea2c767f5f477e81604a6d7b1a4a45fc70328bf569832e774eed201bf7bff0ea0c6a80c015f6fea1130caeb6367b91
7
+ data.tar.gz: 40b7e0965ddc840e39988a2d3659d31d3a47074770054149e4c31534ddbee84162eb16ab61ae0831b8dba59b6bd312691223526e06c0dae9a8ff269fef63465f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0 (2026-05-11)
4
+
5
+ Full Changelog: [v0.4.0...v0.5.0](https://github.com/Ramensoft/handinger-ruby/compare/v0.4.0...v0.5.0)
6
+
7
+ ### Features
8
+
9
+ * Duplicate workers ([95c3bab](https://github.com/Ramensoft/handinger-ruby/commit/95c3babf3d9e97ad4d0b410f90c601e3613bdbee))
10
+
11
+
12
+ ### Chores
13
+
14
+ * remove custom code ([e9cece7](https://github.com/Ramensoft/handinger-ruby/commit/e9cece7ce4e8a03e89b558253048b19f2872f27a))
15
+
16
+ ## 0.4.0 (2026-05-11)
17
+
18
+ Full Changelog: [v0.3.0...v0.4.0](https://github.com/Ramensoft/handinger-ruby/compare/v0.3.0...v0.4.0)
19
+
20
+ ### Features
21
+
22
+ * Add worker and task url ([f1ebd4a](https://github.com/Ramensoft/handinger-ruby/commit/f1ebd4a48111a66ccc69f6b5bdec5c861a4c07b9))
23
+
3
24
  ## 0.3.0 (2026-05-11)
4
25
 
5
26
  Full Changelog: [v0.2.0...v0.3.0](https://github.com/Ramensoft/handinger-ruby/compare/v0.2.0...v0.3.0)
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.3.0"
20
+ gem "handinger", "~> 0.5.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -32,7 +32,7 @@ handinger = Handinger::Client.new(
32
32
  api_key: ENV["HANDINGER_API_KEY"] # This is the default and can be omitted
33
33
  )
34
34
 
35
- worker = handinger.tasks.create(worker_id: "wrk_vk81XUHKHG-qr4")
35
+ worker = handinger.tasks.create(input: "What's the weather today in Barcelona?", worker_id: "wrk_vk81XUHKHG-qr4")
36
36
 
37
37
  puts(worker.id)
38
38
  ```
@@ -43,7 +43,7 @@ When the library is unable to connect to the API, or if the API returns a non-su
43
43
 
44
44
  ```ruby
45
45
  begin
46
- task = handinger.tasks.create(worker_id: "wrk_vk81XUHKHG-qr4")
46
+ task = handinger.tasks.create(input: "What's the weather today in Barcelona?", worker_id: "wrk_vk81XUHKHG-qr4")
47
47
  rescue Handinger::Errors::APIConnectionError => e
48
48
  puts("The server could not be reached")
49
49
  puts(e.cause) # an underlying Exception, likely raised within `net/http`
@@ -86,7 +86,11 @@ handinger = Handinger::Client.new(
86
86
  )
87
87
 
88
88
  # Or, configure per-request:
89
- handinger.tasks.create(worker_id: "wrk_vk81XUHKHG-qr4", request_options: {max_retries: 5})
89
+ handinger.tasks.create(
90
+ input: "What's the weather today in Barcelona?",
91
+ worker_id: "wrk_vk81XUHKHG-qr4",
92
+ request_options: {max_retries: 5}
93
+ )
90
94
  ```
91
95
 
92
96
  ### Timeouts
@@ -100,7 +104,11 @@ handinger = Handinger::Client.new(
100
104
  )
101
105
 
102
106
  # Or, configure per-request:
103
- handinger.tasks.create(worker_id: "wrk_vk81XUHKHG-qr4", request_options: {timeout: 5})
107
+ handinger.tasks.create(
108
+ input: "What's the weather today in Barcelona?",
109
+ worker_id: "wrk_vk81XUHKHG-qr4",
110
+ request_options: {timeout: 5}
111
+ )
104
112
  ```
105
113
 
106
114
  On timeout, `Handinger::Errors::APITimeoutError` is raised.
@@ -132,6 +140,7 @@ Note: the `extra_` parameters of the same name overrides the documented paramete
132
140
  ```ruby
133
141
  worker =
134
142
  handinger.tasks.create(
143
+ input: "What's the weather today in Barcelona?",
135
144
  worker_id: "wrk_vk81XUHKHG-qr4",
136
145
  request_options: {
137
146
  extra_query: {my_query_parameter: value},
@@ -178,17 +187,20 @@ This library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitio
178
187
  You can provide typesafe request parameters like so:
179
188
 
180
189
  ```ruby
181
- handinger.tasks.create(worker_id: "wrk_vk81XUHKHG-qr4")
190
+ handinger.tasks.create(input: "What's the weather today in Barcelona?", worker_id: "wrk_vk81XUHKHG-qr4")
182
191
  ```
183
192
 
184
193
  Or, equivalently:
185
194
 
186
195
  ```ruby
187
196
  # Hashes work, but are not typesafe:
188
- handinger.tasks.create(worker_id: "wrk_vk81XUHKHG-qr4")
197
+ handinger.tasks.create(input: "What's the weather today in Barcelona?", worker_id: "wrk_vk81XUHKHG-qr4")
189
198
 
190
199
  # You can also splat a full Params class:
191
- params = Handinger::TaskCreateParams.new(worker_id: "wrk_vk81XUHKHG-qr4")
200
+ params = Handinger::TaskCreateParams.new(
201
+ input: "What's the weather today in Barcelona?",
202
+ worker_id: "wrk_vk81XUHKHG-qr4"
203
+ )
192
204
  handinger.tasks.create(**params)
193
205
  ```
194
206
 
@@ -57,7 +57,7 @@ module Handinger
57
57
  initial_retry_delay: self.class::DEFAULT_INITIAL_RETRY_DELAY,
58
58
  max_retry_delay: self.class::DEFAULT_MAX_RETRY_DELAY
59
59
  )
60
- base_url ||= "https://v3.handinger.com"
60
+ base_url ||= "https://handinger.com"
61
61
 
62
62
  if api_key.nil?
63
63
  raise ArgumentError.new("api_key is required, and can be set via environ: \"HANDINGER_API_KEY\"")
@@ -2,12 +2,21 @@
2
2
 
3
3
  module Handinger
4
4
  module Models
5
- class CreateTask < Handinger::Models::CreateWorker
6
- # @!attribute worker_id
7
- # Worker id the task belongs to.
5
+ class CreateTask < Handinger::Internal::Type::BaseModel
6
+ # @!attribute input
8
7
  #
9
8
  # @return [String]
10
- required :worker_id, String, api_name: :workerId
9
+ required :input, String
10
+
11
+ # @!attribute budget
12
+ #
13
+ # @return [Symbol, Handinger::Models::CreateTask::Budget, nil]
14
+ optional :budget, enum: -> { Handinger::CreateTask::Budget }
15
+
16
+ # @!attribute stream
17
+ #
18
+ # @return [Boolean, nil]
19
+ optional :stream, Handinger::Internal::Type::Boolean
11
20
 
12
21
  # @!attribute task_id
13
22
  # Optional client-provided task id. Reuse this id to add turns to an existing
@@ -16,13 +25,39 @@ module Handinger
16
25
  # @return [String, nil]
17
26
  optional :task_id, String, api_name: :taskId
18
27
 
19
- # @!method initialize(worker_id:, task_id: nil)
28
+ # @!attribute worker_id
29
+ # Worker id the task belongs to. If omitted, a new worker is created on-the-fly
30
+ # using the input as instructions.
31
+ #
32
+ # @return [String, nil]
33
+ optional :worker_id, String, api_name: :workerId
34
+
35
+ # @!method initialize(input:, budget: nil, stream: nil, task_id: nil, worker_id: nil)
20
36
  # Some parameter documentations has been truncated, see
21
37
  # {Handinger::Models::CreateTask} for more details.
22
38
  #
23
- # @param worker_id [String] Worker id the task belongs to.
39
+ # @param input [String]
40
+ #
41
+ # @param budget [Symbol, Handinger::Models::CreateTask::Budget]
42
+ #
43
+ # @param stream [Boolean]
24
44
  #
25
45
  # @param task_id [String] Optional client-provided task id. Reuse this id to add turns to an existing task
46
+ #
47
+ # @param worker_id [String] Worker id the task belongs to. If omitted, a new worker is created on-the-fly us
48
+
49
+ # @see Handinger::Models::CreateTask#budget
50
+ module Budget
51
+ extend Handinger::Internal::Type::Enum
52
+
53
+ LOW = :low
54
+ STANDARD = :standard
55
+ HIGH = :high
56
+ UNLIMITED = :unlimited
57
+
58
+ # @!method self.values
59
+ # @return [Array<Symbol>]
60
+ end
26
61
  end
27
62
  end
28
63
  end
@@ -48,21 +48,38 @@ module Handinger
48
48
  # @return [Symbol, Handinger::Models::Task::TriggeredBy]
49
49
  required :triggered_by, enum: -> { Handinger::Task::TriggeredBy }, api_name: :triggeredBy
50
50
 
51
+ # @!attribute url
52
+ # Web URL of the task in the Handinger dashboard.
53
+ #
54
+ # @return [String]
55
+ required :url, String
56
+
51
57
  # @!attribute worker_id
52
58
  #
53
59
  # @return [String]
54
60
  required :worker_id, String, api_name: :workerId
55
61
 
56
- # @!method initialize(id:, completed_at:, created_at:, created_by_user_id:, organization_id:, status:, title:, totals:, triggered_by:, worker_id:)
62
+ # @!method initialize(id:, completed_at:, created_at:, created_by_user_id:, organization_id:, status:, title:, totals:, triggered_by:, url:, worker_id:)
57
63
  # @param id [String]
64
+ #
58
65
  # @param completed_at [String, nil]
66
+ #
59
67
  # @param created_at [String]
68
+ #
60
69
  # @param created_by_user_id [String, nil]
70
+ #
61
71
  # @param organization_id [String]
72
+ #
62
73
  # @param status [Symbol, Handinger::Models::Task::Status]
74
+ #
63
75
  # @param title [String]
76
+ #
64
77
  # @param totals [Handinger::Models::Task::Totals]
78
+ #
65
79
  # @param triggered_by [Symbol, Handinger::Models::Task::TriggeredBy]
80
+ #
81
+ # @param url [String] Web URL of the task in the Handinger dashboard.
82
+ #
66
83
  # @param worker_id [String]
67
84
 
68
85
  # @see Handinger::Models::Task#status
@@ -76,26 +76,48 @@ module Handinger
76
76
  Handinger::Internal::Type::HashOf[Handinger::Internal::Type::Unknown],
77
77
  nil?: true
78
78
 
79
+ # @!attribute url
80
+ # Web URL of the worker in the Handinger dashboard.
81
+ #
82
+ # @return [String]
83
+ required :url, String
84
+
79
85
  # @!attribute usage
80
86
  #
81
87
  # @return [Handinger::Models::Worker::Usage, nil]
82
88
  optional :usage, -> { Handinger::Worker::Usage }
83
89
 
84
- # @!method initialize(id:, created_at:, error:, files:, incomplete_details:, messages:, metadata:, object:, output:, output_text:, running:, sources:, status:, structured_output:, usage: nil)
90
+ # @!method initialize(id:, created_at:, error:, files:, incomplete_details:, messages:, metadata:, object:, output:, output_text:, running:, sources:, status:, structured_output:, url:, usage: nil)
85
91
  # @param id [String]
92
+ #
86
93
  # @param created_at [Integer, nil]
94
+ #
87
95
  # @param error [nil]
96
+ #
88
97
  # @param files [Array<Handinger::Models::Worker::File>]
98
+ #
89
99
  # @param incomplete_details [nil]
100
+ #
90
101
  # @param messages [Array<Object>]
102
+ #
91
103
  # @param metadata [Hash{Symbol=>Object}]
104
+ #
92
105
  # @param object [Symbol, Handinger::Models::Worker::Object]
106
+ #
93
107
  # @param output [Array<Handinger::Models::Worker::Output>]
108
+ #
94
109
  # @param output_text [String]
110
+ #
95
111
  # @param running [Boolean]
112
+ #
96
113
  # @param sources [Array<Handinger::Models::Worker::Source>]
114
+ #
97
115
  # @param status [Symbol, Handinger::Models::Worker::Status]
116
+ #
98
117
  # @param structured_output [Hash{Symbol=>Object}, nil]
118
+ #
119
+ # @param url [String] Web URL of the worker in the Handinger dashboard.
120
+ #
99
121
  # @param usage [Handinger::Models::Worker::Usage]
100
122
 
101
123
  class File < Handinger::Internal::Type::BaseModel
@@ -47,6 +47,12 @@ module Handinger
47
47
  # @return [String, nil]
48
48
  required :updated_at, String, api_name: :updatedAt, nil?: true
49
49
 
50
+ # @!attribute url
51
+ # Web URL of the worker in the Handinger dashboard.
52
+ #
53
+ # @return [String]
54
+ required :url, String
55
+
50
56
  # @!attribute user_id
51
57
  #
52
58
  # @return [String]
@@ -57,16 +63,27 @@ module Handinger
57
63
  # @return [Symbol, Handinger::Models::WorkerTemplate::Visibility]
58
64
  required :visibility, enum: -> { Handinger::WorkerTemplate::Visibility }
59
65
 
60
- # @!method initialize(id:, created_at:, instructions:, organization_id:, output_schema:, summary:, title:, updated_at:, user_id:, visibility:)
66
+ # @!method initialize(id:, created_at:, instructions:, organization_id:, output_schema:, summary:, title:, updated_at:, url:, user_id:, visibility:)
61
67
  # @param id [String]
68
+ #
62
69
  # @param created_at [String, nil]
70
+ #
63
71
  # @param instructions [String]
72
+ #
64
73
  # @param organization_id [String]
74
+ #
65
75
  # @param output_schema [Hash{Symbol=>Object}, nil]
76
+ #
66
77
  # @param summary [String]
78
+ #
67
79
  # @param title [String]
80
+ #
68
81
  # @param updated_at [String, nil]
82
+ #
83
+ # @param url [String] Web URL of the worker in the Handinger dashboard.
84
+ #
69
85
  # @param user_id [String]
86
+ #
70
87
  # @param visibility [Symbol, Handinger::Models::WorkerTemplate::Visibility]
71
88
 
72
89
  # @see Handinger::Models::WorkerTemplate#visibility
@@ -12,23 +12,17 @@ module Handinger
12
12
  # `multipart/form-data` to attach files; the bytes are bootstrapped into the
13
13
  # worker's workspace before the task starts.
14
14
  #
15
- # @overload create(worker_id:, instructions: nil, output_schema: nil, prompt: nil, summary: nil, task_id: nil, title: nil, visibility: nil, request_options: {})
15
+ # @overload create(input:, budget: nil, stream: nil, task_id: nil, worker_id: nil, request_options: {})
16
16
  #
17
- # @param worker_id [String] Worker id the task belongs to.
17
+ # @param input [String]
18
18
  #
19
- # @param instructions [String] Persistent system prompt the worker uses for every task it runs.
19
+ # @param budget [Symbol, Handinger::Models::CreateTask::Budget]
20
20
  #
21
- # @param output_schema [Hash{Symbol=>Object}] Optional JSON Schema (Draft-07) describing the structured object the worker must
22
- #
23
- # @param prompt [String] Natural-language description of the worker to use for AI-generated instructions
24
- #
25
- # @param summary [String] Short one-line description of the worker's purpose. Auto-generated when omitted
21
+ # @param stream [Boolean]
26
22
  #
27
23
  # @param task_id [String] Optional client-provided task id. Reuse this id to add turns to an existing task
28
24
  #
29
- # @param title [String] Optional display name. When omitted, Handinger assigns a random dog-themed name.
30
- #
31
- # @param visibility [Symbol, Handinger::Models::CreateTask::Visibility] `public` (default) is visible to all org members. `private` is only visible to i
25
+ # @param worker_id [String] Worker id the task belongs to. If omitted, a new worker is created on-the-fly us
32
26
  #
33
27
  # @param request_options [Handinger::RequestOptions, Hash{Symbol=>Object}, nil]
34
28
  #
@@ -111,9 +111,9 @@ module Handinger
111
111
  )
112
112
  end
113
113
 
114
- # Permanently delete a worker template along with its tasks, turns, files,
115
- # schedules, and integrations. This action is not reversible. Only the worker
116
- # creator can delete a worker.
114
+ # Soft-delete a worker template so it no longer appears in list or retrieve
115
+ # endpoints. Tasks, turns, files, schedules, and integrations remain in the
116
+ # database for analytics. Only the worker creator can delete a worker.
117
117
  #
118
118
  # @overload delete(worker_id, request_options: {})
119
119
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Handinger
4
- VERSION = "0.3.0"
4
+ VERSION = "0.5.0"
5
5
  end
data/lib/handinger.rb CHANGED
@@ -52,8 +52,8 @@ require_relative "handinger/errors"
52
52
  require_relative "handinger/internal/transport/base_client"
53
53
  require_relative "handinger/internal/transport/pooled_net_requester"
54
54
  require_relative "handinger/client"
55
- require_relative "handinger/models/create_worker"
56
55
  require_relative "handinger/models/create_task"
56
+ require_relative "handinger/models/create_worker"
57
57
  require_relative "handinger/models/update_worker"
58
58
  require_relative "handinger/models/delete_task_response"
59
59
  require_relative "handinger/models/delete_worker_response"
@@ -2,15 +2,26 @@
2
2
 
3
3
  module Handinger
4
4
  module Models
5
- class CreateTask < Handinger::Models::CreateWorker
5
+ class CreateTask < Handinger::Internal::Type::BaseModel
6
6
  OrHash =
7
7
  T.type_alias do
8
8
  T.any(Handinger::CreateTask, Handinger::Internal::AnyHash)
9
9
  end
10
10
 
11
- # Worker id the task belongs to.
12
11
  sig { returns(String) }
13
- attr_accessor :worker_id
12
+ attr_accessor :input
13
+
14
+ sig { returns(T.nilable(Handinger::CreateTask::Budget::OrSymbol)) }
15
+ attr_reader :budget
16
+
17
+ sig { params(budget: Handinger::CreateTask::Budget::OrSymbol).void }
18
+ attr_writer :budget
19
+
20
+ sig { returns(T.nilable(T::Boolean)) }
21
+ attr_reader :stream
22
+
23
+ sig { params(stream: T::Boolean).void }
24
+ attr_writer :stream
14
25
 
15
26
  # Optional client-provided task id. Reuse this id to add turns to an existing
16
27
  # task.
@@ -20,21 +31,71 @@ module Handinger
20
31
  sig { params(task_id: String).void }
21
32
  attr_writer :task_id
22
33
 
34
+ # Worker id the task belongs to. If omitted, a new worker is created on-the-fly
35
+ # using the input as instructions.
36
+ sig { returns(T.nilable(String)) }
37
+ attr_reader :worker_id
38
+
39
+ sig { params(worker_id: String).void }
40
+ attr_writer :worker_id
41
+
23
42
  sig do
24
- params(worker_id: String, task_id: String).returns(T.attached_class)
43
+ params(
44
+ input: String,
45
+ budget: Handinger::CreateTask::Budget::OrSymbol,
46
+ stream: T::Boolean,
47
+ task_id: String,
48
+ worker_id: String
49
+ ).returns(T.attached_class)
25
50
  end
26
51
  def self.new(
27
- # Worker id the task belongs to.
28
- worker_id:,
52
+ input:,
53
+ budget: nil,
54
+ stream: nil,
29
55
  # Optional client-provided task id. Reuse this id to add turns to an existing
30
56
  # task.
31
- task_id: nil
57
+ task_id: nil,
58
+ # Worker id the task belongs to. If omitted, a new worker is created on-the-fly
59
+ # using the input as instructions.
60
+ worker_id: nil
32
61
  )
33
62
  end
34
63
 
35
- sig { override.returns({ worker_id: String, task_id: String }) }
64
+ sig do
65
+ override.returns(
66
+ {
67
+ input: String,
68
+ budget: Handinger::CreateTask::Budget::OrSymbol,
69
+ stream: T::Boolean,
70
+ task_id: String,
71
+ worker_id: String
72
+ }
73
+ )
74
+ end
36
75
  def to_hash
37
76
  end
77
+
78
+ module Budget
79
+ extend Handinger::Internal::Type::Enum
80
+
81
+ TaggedSymbol =
82
+ T.type_alias { T.all(Symbol, Handinger::CreateTask::Budget) }
83
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
84
+
85
+ LOW = T.let(:low, Handinger::CreateTask::Budget::TaggedSymbol)
86
+ STANDARD = T.let(:standard, Handinger::CreateTask::Budget::TaggedSymbol)
87
+ HIGH = T.let(:high, Handinger::CreateTask::Budget::TaggedSymbol)
88
+ UNLIMITED =
89
+ T.let(:unlimited, Handinger::CreateTask::Budget::TaggedSymbol)
90
+
91
+ sig do
92
+ override.returns(
93
+ T::Array[Handinger::CreateTask::Budget::TaggedSymbol]
94
+ )
95
+ end
96
+ def self.values
97
+ end
98
+ end
38
99
  end
39
100
  end
40
101
  end
@@ -36,6 +36,10 @@ module Handinger
36
36
  sig { returns(Handinger::Task::TriggeredBy::TaggedSymbol) }
37
37
  attr_accessor :triggered_by
38
38
 
39
+ # Web URL of the task in the Handinger dashboard.
40
+ sig { returns(String) }
41
+ attr_accessor :url
42
+
39
43
  sig { returns(String) }
40
44
  attr_accessor :worker_id
41
45
 
@@ -50,6 +54,7 @@ module Handinger
50
54
  title: String,
51
55
  totals: Handinger::Task::Totals::OrHash,
52
56
  triggered_by: Handinger::Task::TriggeredBy::OrSymbol,
57
+ url: String,
53
58
  worker_id: String
54
59
  ).returns(T.attached_class)
55
60
  end
@@ -63,6 +68,8 @@ module Handinger
63
68
  title:,
64
69
  totals:,
65
70
  triggered_by:,
71
+ # Web URL of the task in the Handinger dashboard.
72
+ url:,
66
73
  worker_id:
67
74
  )
68
75
  end
@@ -79,6 +86,7 @@ module Handinger
79
86
  title: String,
80
87
  totals: Handinger::Task::Totals,
81
88
  triggered_by: Handinger::Task::TriggeredBy::TaggedSymbol,
89
+ url: String,
82
90
  worker_id: String
83
91
  }
84
92
  )
@@ -48,6 +48,10 @@ module Handinger
48
48
  sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
49
49
  attr_accessor :structured_output
50
50
 
51
+ # Web URL of the worker in the Handinger dashboard.
52
+ sig { returns(String) }
53
+ attr_accessor :url
54
+
51
55
  sig { returns(T.nilable(Handinger::Worker::Usage)) }
52
56
  attr_reader :usage
53
57
 
@@ -70,6 +74,7 @@ module Handinger
70
74
  sources: T::Array[Handinger::Worker::Source::OrHash],
71
75
  status: Handinger::Worker::Status::OrSymbol,
72
76
  structured_output: T.nilable(T::Hash[Symbol, T.anything]),
77
+ url: String,
73
78
  usage: Handinger::Worker::Usage::OrHash
74
79
  ).returns(T.attached_class)
75
80
  end
@@ -88,6 +93,8 @@ module Handinger
88
93
  sources:,
89
94
  status:,
90
95
  structured_output:,
96
+ # Web URL of the worker in the Handinger dashboard.
97
+ url:,
91
98
  usage: nil
92
99
  )
93
100
  end
@@ -109,6 +116,7 @@ module Handinger
109
116
  sources: T::Array[Handinger::Worker::Source],
110
117
  status: Handinger::Worker::Status::TaggedSymbol,
111
118
  structured_output: T.nilable(T::Hash[Symbol, T.anything]),
119
+ url: String,
112
120
  usage: Handinger::Worker::Usage
113
121
  }
114
122
  )
@@ -32,6 +32,10 @@ module Handinger
32
32
  sig { returns(T.nilable(String)) }
33
33
  attr_accessor :updated_at
34
34
 
35
+ # Web URL of the worker in the Handinger dashboard.
36
+ sig { returns(String) }
37
+ attr_accessor :url
38
+
35
39
  sig { returns(String) }
36
40
  attr_accessor :user_id
37
41
 
@@ -48,6 +52,7 @@ module Handinger
48
52
  summary: String,
49
53
  title: String,
50
54
  updated_at: T.nilable(String),
55
+ url: String,
51
56
  user_id: String,
52
57
  visibility: Handinger::WorkerTemplate::Visibility::OrSymbol
53
58
  ).returns(T.attached_class)
@@ -61,6 +66,8 @@ module Handinger
61
66
  summary:,
62
67
  title:,
63
68
  updated_at:,
69
+ # Web URL of the worker in the Handinger dashboard.
70
+ url:,
64
71
  user_id:,
65
72
  visibility:
66
73
  )
@@ -77,6 +84,7 @@ module Handinger
77
84
  summary: String,
78
85
  title: String,
79
86
  updated_at: T.nilable(String),
87
+ url: String,
80
88
  user_id: String,
81
89
  visibility: Handinger::WorkerTemplate::Visibility::TaggedSymbol
82
90
  }
@@ -10,40 +10,24 @@ module Handinger
10
10
  # worker's workspace before the task starts.
11
11
  sig do
12
12
  params(
13
- worker_id: String,
14
- instructions: String,
15
- output_schema: T::Hash[Symbol, T.anything],
16
- prompt: String,
17
- summary: String,
13
+ input: String,
14
+ budget: Handinger::CreateTask::Budget::OrSymbol,
15
+ stream: T::Boolean,
18
16
  task_id: String,
19
- title: String,
20
- visibility: Handinger::CreateTask::Visibility::OrSymbol,
17
+ worker_id: String,
21
18
  request_options: Handinger::RequestOptions::OrHash
22
19
  ).returns(Handinger::Worker)
23
20
  end
24
21
  def create(
25
- # Worker id the task belongs to.
26
- worker_id:,
27
- # Persistent system prompt the worker uses for every task it runs.
28
- instructions: nil,
29
- # Optional JSON Schema (Draft-07) describing the structured object the worker must
30
- # produce. When set, every task response is validated against the schema and
31
- # exposed as `structuredOutput`.
32
- output_schema: nil,
33
- # Natural-language description of the worker to use for AI-generated instructions
34
- # when `instructions` is omitted.
35
- prompt: nil,
36
- # Short one-line description of the worker's purpose. Auto-generated when omitted
37
- # and a `prompt` is provided.
38
- summary: nil,
22
+ input:,
23
+ budget: nil,
24
+ stream: nil,
39
25
  # Optional client-provided task id. Reuse this id to add turns to an existing
40
26
  # task.
41
27
  task_id: nil,
42
- # Optional display name. When omitted, Handinger assigns a random dog-themed name.
43
- title: nil,
44
- # `public` (default) is visible to all org members. `private` is only visible to
45
- # invited members.
46
- visibility: nil,
28
+ # Worker id the task belongs to. If omitted, a new worker is created on-the-fly
29
+ # using the input as instructions.
30
+ worker_id: nil,
47
31
  request_options: {}
48
32
  )
49
33
  end
@@ -98,9 +98,9 @@ module Handinger
98
98
  )
99
99
  end
100
100
 
101
- # Permanently delete a worker template along with its tasks, turns, files,
102
- # schedules, and integrations. This action is not reversible. Only the worker
103
- # creator can delete a worker.
101
+ # Soft-delete a worker template so it no longer appears in list or retrieve
102
+ # endpoints. Tasks, turns, files, schedules, and integrations remain in the
103
+ # database for analytics. Only the worker creator can delete a worker.
104
104
  sig do
105
105
  params(
106
106
  worker_id: String,
@@ -1,19 +1,63 @@
1
1
  module Handinger
2
2
  module Models
3
- type create_task = { worker_id: String, task_id: String }
3
+ type create_task =
4
+ {
5
+ input: String,
6
+ budget: Handinger::Models::CreateTask::budget,
7
+ stream: bool,
8
+ task_id: String,
9
+ worker_id: String
10
+ }
4
11
 
5
- class CreateTask < Handinger::Models::CreateWorker
6
- def worker_id: -> String
12
+ class CreateTask < Handinger::Internal::Type::BaseModel
13
+ attr_accessor input: String
7
14
 
8
- def worker_id=: (String _) -> String
15
+ attr_reader budget: Handinger::Models::CreateTask::budget?
9
16
 
10
- def task_id: -> String?
17
+ def budget=: (
18
+ Handinger::Models::CreateTask::budget
19
+ ) -> Handinger::Models::CreateTask::budget
11
20
 
12
- def task_id=: (String _) -> String
21
+ attr_reader stream: bool?
13
22
 
14
- def initialize: (worker_id: String, ?task_id: String) -> void
23
+ def stream=: (bool) -> bool
15
24
 
16
- def to_hash: -> { worker_id: String, task_id: String }
25
+ attr_reader task_id: String?
26
+
27
+ def task_id=: (String) -> String
28
+
29
+ attr_reader worker_id: String?
30
+
31
+ def worker_id=: (String) -> String
32
+
33
+ def initialize: (
34
+ input: String,
35
+ ?budget: Handinger::Models::CreateTask::budget,
36
+ ?stream: bool,
37
+ ?task_id: String,
38
+ ?worker_id: String
39
+ ) -> void
40
+
41
+ def to_hash: -> {
42
+ input: String,
43
+ budget: Handinger::Models::CreateTask::budget,
44
+ stream: bool,
45
+ task_id: String,
46
+ worker_id: String
47
+ }
48
+
49
+ type budget = :low | :standard | :high | :unlimited
50
+
51
+ module Budget
52
+ extend Handinger::Internal::Type::Enum
53
+
54
+ LOW: :low
55
+ STANDARD: :standard
56
+ HIGH: :high
57
+ UNLIMITED: :unlimited
58
+
59
+ def self?.values: -> ::Array[Handinger::Models::CreateTask::budget]
60
+ end
17
61
  end
18
62
  end
19
63
  end
@@ -11,6 +11,7 @@ module Handinger
11
11
  title: String,
12
12
  totals: Handinger::Task::Totals,
13
13
  triggered_by: Handinger::Models::Task::triggered_by,
14
+ url: String,
14
15
  worker_id: String
15
16
  }
16
17
 
@@ -33,6 +34,8 @@ module Handinger
33
34
 
34
35
  attr_accessor triggered_by: Handinger::Models::Task::triggered_by
35
36
 
37
+ attr_accessor url: String
38
+
36
39
  attr_accessor worker_id: String
37
40
 
38
41
  def initialize: (
@@ -45,6 +48,7 @@ module Handinger
45
48
  title: String,
46
49
  totals: Handinger::Task::Totals,
47
50
  triggered_by: Handinger::Models::Task::triggered_by,
51
+ url: String,
48
52
  worker_id: String
49
53
  ) -> void
50
54
 
@@ -58,6 +62,7 @@ module Handinger
58
62
  title: String,
59
63
  totals: Handinger::Task::Totals,
60
64
  triggered_by: Handinger::Models::Task::triggered_by,
65
+ url: String,
61
66
  worker_id: String
62
67
  }
63
68
 
@@ -16,6 +16,7 @@ module Handinger
16
16
  sources: ::Array[Handinger::Worker::Source],
17
17
  status: Handinger::Models::Worker::status,
18
18
  structured_output: ::Hash[Symbol, top]?,
19
+ url: String,
19
20
  usage: Handinger::Worker::Usage
20
21
  }
21
22
 
@@ -48,6 +49,8 @@ module Handinger
48
49
 
49
50
  attr_accessor structured_output: ::Hash[Symbol, top]?
50
51
 
52
+ attr_accessor url: String
53
+
51
54
  attr_reader usage: Handinger::Worker::Usage?
52
55
 
53
56
  def usage=: (Handinger::Worker::Usage) -> Handinger::Worker::Usage
@@ -67,6 +70,7 @@ module Handinger
67
70
  sources: ::Array[Handinger::Worker::Source],
68
71
  status: Handinger::Models::Worker::status,
69
72
  structured_output: ::Hash[Symbol, top]?,
73
+ url: String,
70
74
  ?usage: Handinger::Worker::Usage
71
75
  ) -> void
72
76
 
@@ -85,6 +89,7 @@ module Handinger
85
89
  sources: ::Array[Handinger::Worker::Source],
86
90
  status: Handinger::Models::Worker::status,
87
91
  structured_output: ::Hash[Symbol, top]?,
92
+ url: String,
88
93
  usage: Handinger::Worker::Usage
89
94
  }
90
95
 
@@ -10,6 +10,7 @@ module Handinger
10
10
  summary: String,
11
11
  title: String,
12
12
  updated_at: String?,
13
+ url: String,
13
14
  user_id: String,
14
15
  visibility: Handinger::Models::WorkerTemplate::visibility
15
16
  }
@@ -31,6 +32,8 @@ module Handinger
31
32
 
32
33
  attr_accessor updated_at: String?
33
34
 
35
+ attr_accessor url: String
36
+
34
37
  attr_accessor user_id: String
35
38
 
36
39
  attr_accessor visibility: Handinger::Models::WorkerTemplate::visibility
@@ -44,6 +47,7 @@ module Handinger
44
47
  summary: String,
45
48
  title: String,
46
49
  updated_at: String?,
50
+ url: String,
47
51
  user_id: String,
48
52
  visibility: Handinger::Models::WorkerTemplate::visibility
49
53
  ) -> void
@@ -57,6 +61,7 @@ module Handinger
57
61
  summary: String,
58
62
  title: String,
59
63
  updated_at: String?,
64
+ url: String,
60
65
  user_id: String,
61
66
  visibility: Handinger::Models::WorkerTemplate::visibility
62
67
  }
@@ -2,14 +2,11 @@ module Handinger
2
2
  module Resources
3
3
  class Tasks
4
4
  def create: (
5
- worker_id: String,
6
- ?instructions: String,
7
- ?output_schema: ::Hash[Symbol, top],
8
- ?prompt: String,
9
- ?summary: String,
5
+ input: String,
6
+ ?budget: Handinger::Models::CreateTask::budget,
7
+ ?stream: bool,
10
8
  ?task_id: String,
11
- ?title: String,
12
- ?visibility: Handinger::Models::CreateTask::visibility,
9
+ ?worker_id: String,
13
10
  ?request_options: Handinger::request_opts
14
11
  ) -> Handinger::Worker
15
12
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: handinger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Handinger