handinger 0.2.0 → 0.4.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 +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +11 -12
- data/SECURITY.md +4 -0
- data/lib/handinger/models/delete_task_response.rb +16 -0
- data/lib/handinger/models/delete_worker_response.rb +16 -0
- data/lib/handinger/models/task.rb +18 -1
- data/lib/handinger/models/task_delete_params.rb +20 -0
- data/lib/handinger/models/update_worker.rb +71 -0
- data/lib/handinger/models/worker.rb +23 -1
- data/lib/handinger/models/worker_delete_params.rb +20 -0
- data/lib/handinger/models/{worker_create_response.rb → worker_template.rb} +23 -6
- data/lib/handinger/models/worker_update_params.rb +20 -0
- data/lib/handinger/models.rb +14 -0
- data/lib/handinger/resources/tasks.rb +25 -3
- data/lib/handinger/resources/workers.rb +61 -2
- data/lib/handinger/version.rb +1 -1
- data/lib/handinger.rb +7 -1
- data/rbi/handinger/models/delete_task_response.rbi +23 -0
- data/rbi/handinger/models/delete_worker_response.rbi +23 -0
- data/rbi/handinger/models/task.rbi +8 -0
- data/rbi/handinger/models/task_delete_params.rbi +35 -0
- data/rbi/handinger/models/update_worker.rbi +112 -0
- data/rbi/handinger/models/worker.rbi +8 -0
- data/rbi/handinger/models/worker_delete_params.rbi +35 -0
- data/rbi/handinger/models/{worker_create_response.rbi → worker_template.rbi} +17 -28
- data/rbi/handinger/models/worker_update_params.rbi +35 -0
- data/rbi/handinger/models.rbi +14 -0
- data/rbi/handinger/resources/tasks.rbi +19 -3
- data/rbi/handinger/resources/workers.rbi +51 -1
- data/sig/handinger/models/delete_task_response.rbs +13 -0
- data/sig/handinger/models/delete_worker_response.rbs +13 -0
- data/sig/handinger/models/task.rbs +5 -0
- data/sig/handinger/models/task_delete_params.rbs +23 -0
- data/sig/handinger/models/update_worker.rbs +61 -0
- data/sig/handinger/models/worker.rbs +5 -0
- data/sig/handinger/models/worker_delete_params.rbs +23 -0
- data/sig/handinger/models/{worker_create_response.rbs → worker_template.rbs} +12 -7
- data/sig/handinger/models/worker_update_params.rbs +25 -0
- data/sig/handinger/models.rbs +14 -0
- data/sig/handinger/resources/tasks.rbs +5 -0
- data/sig/handinger/resources/workers.rbs +16 -1
- metadata +24 -6
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
class DeleteTaskResponse < Handinger::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Handinger::DeleteTaskResponse, Handinger::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig { returns(T::Boolean) }
|
|
12
|
+
attr_accessor :archived
|
|
13
|
+
|
|
14
|
+
sig { params(archived: T::Boolean).returns(T.attached_class) }
|
|
15
|
+
def self.new(archived:)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { override.returns({ archived: T::Boolean }) }
|
|
19
|
+
def to_hash
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
class DeleteWorkerResponse < Handinger::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Handinger::DeleteWorkerResponse, Handinger::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig { returns(T::Boolean) }
|
|
12
|
+
attr_accessor :deleted
|
|
13
|
+
|
|
14
|
+
sig { params(deleted: T::Boolean).returns(T.attached_class) }
|
|
15
|
+
def self.new(deleted:)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { override.returns({ deleted: T::Boolean }) }
|
|
19
|
+
def to_hash
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
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
|
)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
class TaskDeleteParams < Handinger::Internal::Type::BaseModel
|
|
6
|
+
extend Handinger::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Handinger::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Handinger::TaskDeleteParams, Handinger::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :task_id
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(
|
|
19
|
+
task_id: String,
|
|
20
|
+
request_options: Handinger::RequestOptions::OrHash
|
|
21
|
+
).returns(T.attached_class)
|
|
22
|
+
end
|
|
23
|
+
def self.new(task_id:, request_options: {})
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
override.returns(
|
|
28
|
+
{ task_id: String, request_options: Handinger::RequestOptions }
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
def to_hash
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
class UpdateWorker < Handinger::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Handinger::UpdateWorker, Handinger::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Replaces the persistent system prompt. Subsequent tasks pick up the new
|
|
12
|
+
# instructions immediately; in-flight tasks keep using the previous version.
|
|
13
|
+
sig { returns(T.nilable(String)) }
|
|
14
|
+
attr_reader :instructions
|
|
15
|
+
|
|
16
|
+
sig { params(instructions: String).void }
|
|
17
|
+
attr_writer :instructions
|
|
18
|
+
|
|
19
|
+
# Replace the worker's structured output schema. Pass `null` to clear it and
|
|
20
|
+
# return to free-form text responses.
|
|
21
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
22
|
+
attr_accessor :output_schema
|
|
23
|
+
|
|
24
|
+
# Replaces the worker's short one-line summary.
|
|
25
|
+
sig { returns(T.nilable(String)) }
|
|
26
|
+
attr_reader :summary
|
|
27
|
+
|
|
28
|
+
sig { params(summary: String).void }
|
|
29
|
+
attr_writer :summary
|
|
30
|
+
|
|
31
|
+
# New display name for the worker.
|
|
32
|
+
sig { returns(T.nilable(String)) }
|
|
33
|
+
attr_reader :title
|
|
34
|
+
|
|
35
|
+
sig { params(title: String).void }
|
|
36
|
+
attr_writer :title
|
|
37
|
+
|
|
38
|
+
# Change visibility between `public` (any org member can run tasks) and `private`
|
|
39
|
+
# (only invited members).
|
|
40
|
+
sig { returns(T.nilable(Handinger::UpdateWorker::Visibility::OrSymbol)) }
|
|
41
|
+
attr_reader :visibility
|
|
42
|
+
|
|
43
|
+
sig do
|
|
44
|
+
params(visibility: Handinger::UpdateWorker::Visibility::OrSymbol).void
|
|
45
|
+
end
|
|
46
|
+
attr_writer :visibility
|
|
47
|
+
|
|
48
|
+
sig do
|
|
49
|
+
params(
|
|
50
|
+
instructions: String,
|
|
51
|
+
output_schema: T.nilable(T::Hash[Symbol, T.anything]),
|
|
52
|
+
summary: String,
|
|
53
|
+
title: String,
|
|
54
|
+
visibility: Handinger::UpdateWorker::Visibility::OrSymbol
|
|
55
|
+
).returns(T.attached_class)
|
|
56
|
+
end
|
|
57
|
+
def self.new(
|
|
58
|
+
# Replaces the persistent system prompt. Subsequent tasks pick up the new
|
|
59
|
+
# instructions immediately; in-flight tasks keep using the previous version.
|
|
60
|
+
instructions: nil,
|
|
61
|
+
# Replace the worker's structured output schema. Pass `null` to clear it and
|
|
62
|
+
# return to free-form text responses.
|
|
63
|
+
output_schema: nil,
|
|
64
|
+
# Replaces the worker's short one-line summary.
|
|
65
|
+
summary: nil,
|
|
66
|
+
# New display name for the worker.
|
|
67
|
+
title: nil,
|
|
68
|
+
# Change visibility between `public` (any org member can run tasks) and `private`
|
|
69
|
+
# (only invited members).
|
|
70
|
+
visibility: nil
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
sig do
|
|
75
|
+
override.returns(
|
|
76
|
+
{
|
|
77
|
+
instructions: String,
|
|
78
|
+
output_schema: T.nilable(T::Hash[Symbol, T.anything]),
|
|
79
|
+
summary: String,
|
|
80
|
+
title: String,
|
|
81
|
+
visibility: Handinger::UpdateWorker::Visibility::OrSymbol
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
end
|
|
85
|
+
def to_hash
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Change visibility between `public` (any org member can run tasks) and `private`
|
|
89
|
+
# (only invited members).
|
|
90
|
+
module Visibility
|
|
91
|
+
extend Handinger::Internal::Type::Enum
|
|
92
|
+
|
|
93
|
+
TaggedSymbol =
|
|
94
|
+
T.type_alias { T.all(Symbol, Handinger::UpdateWorker::Visibility) }
|
|
95
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
96
|
+
|
|
97
|
+
PUBLIC =
|
|
98
|
+
T.let(:public, Handinger::UpdateWorker::Visibility::TaggedSymbol)
|
|
99
|
+
PRIVATE =
|
|
100
|
+
T.let(:private, Handinger::UpdateWorker::Visibility::TaggedSymbol)
|
|
101
|
+
|
|
102
|
+
sig do
|
|
103
|
+
override.returns(
|
|
104
|
+
T::Array[Handinger::UpdateWorker::Visibility::TaggedSymbol]
|
|
105
|
+
)
|
|
106
|
+
end
|
|
107
|
+
def self.values
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
@@ -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
|
)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
class WorkerDeleteParams < Handinger::Internal::Type::BaseModel
|
|
6
|
+
extend Handinger::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Handinger::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Handinger::WorkerDeleteParams, Handinger::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :worker_id
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(
|
|
19
|
+
worker_id: String,
|
|
20
|
+
request_options: Handinger::RequestOptions::OrHash
|
|
21
|
+
).returns(T.attached_class)
|
|
22
|
+
end
|
|
23
|
+
def self.new(worker_id:, request_options: {})
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
override.returns(
|
|
28
|
+
{ worker_id: String, request_options: Handinger::RequestOptions }
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
def to_hash
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
module Handinger
|
|
4
4
|
module Models
|
|
5
|
-
class
|
|
5
|
+
class WorkerTemplate < Handinger::Internal::Type::BaseModel
|
|
6
6
|
OrHash =
|
|
7
7
|
T.type_alias do
|
|
8
|
-
T.any(
|
|
9
|
-
Handinger::Models::WorkerCreateResponse,
|
|
10
|
-
Handinger::Internal::AnyHash
|
|
11
|
-
)
|
|
8
|
+
T.any(Handinger::WorkerTemplate, Handinger::Internal::AnyHash)
|
|
12
9
|
end
|
|
13
10
|
|
|
14
11
|
sig { returns(String) }
|
|
@@ -35,14 +32,14 @@ module Handinger
|
|
|
35
32
|
sig { returns(T.nilable(String)) }
|
|
36
33
|
attr_accessor :updated_at
|
|
37
34
|
|
|
35
|
+
# Web URL of the worker in the Handinger dashboard.
|
|
36
|
+
sig { returns(String) }
|
|
37
|
+
attr_accessor :url
|
|
38
|
+
|
|
38
39
|
sig { returns(String) }
|
|
39
40
|
attr_accessor :user_id
|
|
40
41
|
|
|
41
|
-
sig
|
|
42
|
-
returns(
|
|
43
|
-
Handinger::Models::WorkerCreateResponse::Visibility::TaggedSymbol
|
|
44
|
-
)
|
|
45
|
-
end
|
|
42
|
+
sig { returns(Handinger::WorkerTemplate::Visibility::TaggedSymbol) }
|
|
46
43
|
attr_accessor :visibility
|
|
47
44
|
|
|
48
45
|
sig do
|
|
@@ -55,9 +52,9 @@ module Handinger
|
|
|
55
52
|
summary: String,
|
|
56
53
|
title: String,
|
|
57
54
|
updated_at: T.nilable(String),
|
|
55
|
+
url: String,
|
|
58
56
|
user_id: String,
|
|
59
|
-
visibility:
|
|
60
|
-
Handinger::Models::WorkerCreateResponse::Visibility::OrSymbol
|
|
57
|
+
visibility: Handinger::WorkerTemplate::Visibility::OrSymbol
|
|
61
58
|
).returns(T.attached_class)
|
|
62
59
|
end
|
|
63
60
|
def self.new(
|
|
@@ -69,6 +66,8 @@ module Handinger
|
|
|
69
66
|
summary:,
|
|
70
67
|
title:,
|
|
71
68
|
updated_at:,
|
|
69
|
+
# Web URL of the worker in the Handinger dashboard.
|
|
70
|
+
url:,
|
|
72
71
|
user_id:,
|
|
73
72
|
visibility:
|
|
74
73
|
)
|
|
@@ -85,9 +84,9 @@ module Handinger
|
|
|
85
84
|
summary: String,
|
|
86
85
|
title: String,
|
|
87
86
|
updated_at: T.nilable(String),
|
|
87
|
+
url: String,
|
|
88
88
|
user_id: String,
|
|
89
|
-
visibility:
|
|
90
|
-
Handinger::Models::WorkerCreateResponse::Visibility::TaggedSymbol
|
|
89
|
+
visibility: Handinger::WorkerTemplate::Visibility::TaggedSymbol
|
|
91
90
|
}
|
|
92
91
|
)
|
|
93
92
|
end
|
|
@@ -98,27 +97,17 @@ module Handinger
|
|
|
98
97
|
extend Handinger::Internal::Type::Enum
|
|
99
98
|
|
|
100
99
|
TaggedSymbol =
|
|
101
|
-
T.type_alias
|
|
102
|
-
T.all(Symbol, Handinger::Models::WorkerCreateResponse::Visibility)
|
|
103
|
-
end
|
|
100
|
+
T.type_alias { T.all(Symbol, Handinger::WorkerTemplate::Visibility) }
|
|
104
101
|
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
105
102
|
|
|
106
103
|
PUBLIC =
|
|
107
|
-
T.let(
|
|
108
|
-
:public,
|
|
109
|
-
Handinger::Models::WorkerCreateResponse::Visibility::TaggedSymbol
|
|
110
|
-
)
|
|
104
|
+
T.let(:public, Handinger::WorkerTemplate::Visibility::TaggedSymbol)
|
|
111
105
|
PRIVATE =
|
|
112
|
-
T.let(
|
|
113
|
-
:private,
|
|
114
|
-
Handinger::Models::WorkerCreateResponse::Visibility::TaggedSymbol
|
|
115
|
-
)
|
|
106
|
+
T.let(:private, Handinger::WorkerTemplate::Visibility::TaggedSymbol)
|
|
116
107
|
|
|
117
108
|
sig do
|
|
118
109
|
override.returns(
|
|
119
|
-
T::Array[
|
|
120
|
-
Handinger::Models::WorkerCreateResponse::Visibility::TaggedSymbol
|
|
121
|
-
]
|
|
110
|
+
T::Array[Handinger::WorkerTemplate::Visibility::TaggedSymbol]
|
|
122
111
|
)
|
|
123
112
|
end
|
|
124
113
|
def self.values
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
class WorkerUpdateParams < Handinger::Models::UpdateWorker
|
|
6
|
+
extend Handinger::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Handinger::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Handinger::WorkerUpdateParams, Handinger::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :worker_id
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(
|
|
19
|
+
worker_id: String,
|
|
20
|
+
request_options: Handinger::RequestOptions::OrHash
|
|
21
|
+
).returns(T.attached_class)
|
|
22
|
+
end
|
|
23
|
+
def self.new(worker_id:, request_options: {})
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
override.returns(
|
|
28
|
+
{ worker_id: String, request_options: Handinger::RequestOptions }
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
def to_hash
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
data/rbi/handinger/models.rbi
CHANGED
|
@@ -5,21 +5,35 @@ module Handinger
|
|
|
5
5
|
|
|
6
6
|
CreateWorker = Handinger::Models::CreateWorker
|
|
7
7
|
|
|
8
|
+
DeleteTaskResponse = Handinger::Models::DeleteTaskResponse
|
|
9
|
+
|
|
10
|
+
DeleteWorkerResponse = Handinger::Models::DeleteWorkerResponse
|
|
11
|
+
|
|
8
12
|
Task = Handinger::Models::Task
|
|
9
13
|
|
|
10
14
|
TaskCreateParams = Handinger::Models::TaskCreateParams
|
|
11
15
|
|
|
16
|
+
TaskDeleteParams = Handinger::Models::TaskDeleteParams
|
|
17
|
+
|
|
12
18
|
TaskRetrieveParams = Handinger::Models::TaskRetrieveParams
|
|
13
19
|
|
|
14
20
|
TaskWithTurns = Handinger::Models::TaskWithTurns
|
|
15
21
|
|
|
22
|
+
UpdateWorker = Handinger::Models::UpdateWorker
|
|
23
|
+
|
|
16
24
|
Worker = Handinger::Models::Worker
|
|
17
25
|
|
|
18
26
|
WorkerCreateParams = Handinger::Models::WorkerCreateParams
|
|
19
27
|
|
|
28
|
+
WorkerDeleteParams = Handinger::Models::WorkerDeleteParams
|
|
29
|
+
|
|
20
30
|
WorkerRetrieveEmailParams = Handinger::Models::WorkerRetrieveEmailParams
|
|
21
31
|
|
|
22
32
|
WorkerRetrieveParams = Handinger::Models::WorkerRetrieveParams
|
|
23
33
|
|
|
24
34
|
Workers = Handinger::Models::Workers
|
|
35
|
+
|
|
36
|
+
WorkerTemplate = Handinger::Models::WorkerTemplate
|
|
37
|
+
|
|
38
|
+
WorkerUpdateParams = Handinger::Models::WorkerUpdateParams
|
|
25
39
|
end
|
|
@@ -4,9 +4,10 @@ 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 `
|
|
8
|
-
#
|
|
9
|
-
#
|
|
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.
|
|
10
11
|
sig do
|
|
11
12
|
params(
|
|
12
13
|
worker_id: String,
|
|
@@ -61,6 +62,21 @@ module Handinger
|
|
|
61
62
|
)
|
|
62
63
|
end
|
|
63
64
|
|
|
65
|
+
# Archive a task so it stops appearing in `GET /tasks` results. Turns and files
|
|
66
|
+
# are retained for audit purposes. Only the worker creator can archive a task.
|
|
67
|
+
sig do
|
|
68
|
+
params(
|
|
69
|
+
task_id: String,
|
|
70
|
+
request_options: Handinger::RequestOptions::OrHash
|
|
71
|
+
).returns(Handinger::DeleteTaskResponse)
|
|
72
|
+
end
|
|
73
|
+
def delete(
|
|
74
|
+
# Task id returned by the create task endpoint.
|
|
75
|
+
task_id,
|
|
76
|
+
request_options: {}
|
|
77
|
+
)
|
|
78
|
+
end
|
|
79
|
+
|
|
64
80
|
# @api private
|
|
65
81
|
sig { params(client: Handinger::Client).returns(T.attached_class) }
|
|
66
82
|
def self.new(client:)
|
|
@@ -19,7 +19,7 @@ module Handinger
|
|
|
19
19
|
title: String,
|
|
20
20
|
visibility: Handinger::CreateWorker::Visibility::OrSymbol,
|
|
21
21
|
request_options: Handinger::RequestOptions::OrHash
|
|
22
|
-
).returns(Handinger::
|
|
22
|
+
).returns(Handinger::WorkerTemplate)
|
|
23
23
|
end
|
|
24
24
|
def create(
|
|
25
25
|
# Persistent system prompt the worker uses for every task it runs.
|
|
@@ -64,6 +64,56 @@ module Handinger
|
|
|
64
64
|
)
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
+
# Update a worker's instructions, title, summary, visibility, or output schema.
|
|
68
|
+
# Only the fields you send are changed; omitted fields keep their current values.
|
|
69
|
+
# Only the worker creator can update a worker.
|
|
70
|
+
sig do
|
|
71
|
+
params(
|
|
72
|
+
worker_id: String,
|
|
73
|
+
instructions: String,
|
|
74
|
+
output_schema: T.nilable(T::Hash[Symbol, T.anything]),
|
|
75
|
+
summary: String,
|
|
76
|
+
title: String,
|
|
77
|
+
visibility: Handinger::UpdateWorker::Visibility::OrSymbol,
|
|
78
|
+
request_options: Handinger::RequestOptions::OrHash
|
|
79
|
+
).returns(Handinger::WorkerTemplate)
|
|
80
|
+
end
|
|
81
|
+
def update(
|
|
82
|
+
# Worker id returned by the create worker endpoint.
|
|
83
|
+
worker_id,
|
|
84
|
+
# Replaces the persistent system prompt. Subsequent tasks pick up the new
|
|
85
|
+
# instructions immediately; in-flight tasks keep using the previous version.
|
|
86
|
+
instructions: nil,
|
|
87
|
+
# Replace the worker's structured output schema. Pass `null` to clear it and
|
|
88
|
+
# return to free-form text responses.
|
|
89
|
+
output_schema: nil,
|
|
90
|
+
# Replaces the worker's short one-line summary.
|
|
91
|
+
summary: nil,
|
|
92
|
+
# New display name for the worker.
|
|
93
|
+
title: nil,
|
|
94
|
+
# Change visibility between `public` (any org member can run tasks) and `private`
|
|
95
|
+
# (only invited members).
|
|
96
|
+
visibility: nil,
|
|
97
|
+
request_options: {}
|
|
98
|
+
)
|
|
99
|
+
end
|
|
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.
|
|
104
|
+
sig do
|
|
105
|
+
params(
|
|
106
|
+
worker_id: String,
|
|
107
|
+
request_options: Handinger::RequestOptions::OrHash
|
|
108
|
+
).returns(Handinger::DeleteWorkerResponse)
|
|
109
|
+
end
|
|
110
|
+
def delete(
|
|
111
|
+
# Worker id returned by the create worker endpoint.
|
|
112
|
+
worker_id,
|
|
113
|
+
request_options: {}
|
|
114
|
+
)
|
|
115
|
+
end
|
|
116
|
+
|
|
67
117
|
# Retrieve the inbound email address for a worker.
|
|
68
118
|
sig do
|
|
69
119
|
params(
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module Handinger
|
|
2
|
+
module Models
|
|
3
|
+
type delete_task_response = { archived: bool }
|
|
4
|
+
|
|
5
|
+
class DeleteTaskResponse < Handinger::Internal::Type::BaseModel
|
|
6
|
+
attr_accessor archived: bool
|
|
7
|
+
|
|
8
|
+
def initialize: (archived: bool) -> void
|
|
9
|
+
|
|
10
|
+
def to_hash: -> { archived: bool }
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module Handinger
|
|
2
|
+
module Models
|
|
3
|
+
type delete_worker_response = { deleted: bool }
|
|
4
|
+
|
|
5
|
+
class DeleteWorkerResponse < Handinger::Internal::Type::BaseModel
|
|
6
|
+
attr_accessor deleted: bool
|
|
7
|
+
|
|
8
|
+
def initialize: (deleted: bool) -> void
|
|
9
|
+
|
|
10
|
+
def to_hash: -> { deleted: bool }
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
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
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Handinger
|
|
2
|
+
module Models
|
|
3
|
+
type task_delete_params =
|
|
4
|
+
{ task_id: String } & Handinger::Internal::Type::request_parameters
|
|
5
|
+
|
|
6
|
+
class TaskDeleteParams < Handinger::Internal::Type::BaseModel
|
|
7
|
+
extend Handinger::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Handinger::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
attr_accessor task_id: String
|
|
11
|
+
|
|
12
|
+
def initialize: (
|
|
13
|
+
task_id: String,
|
|
14
|
+
?request_options: Handinger::request_opts
|
|
15
|
+
) -> void
|
|
16
|
+
|
|
17
|
+
def to_hash: -> {
|
|
18
|
+
task_id: String,
|
|
19
|
+
request_options: Handinger::RequestOptions
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|