linear-toon-mcp 0.5.1 → 0.5.2
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9a82a2dde95135b746bb825b13212ff5c3121f2d261112f48720a476b714bb52
|
|
4
|
+
data.tar.gz: f2cad1dd863fb879e406dd4454ed300d537c04c2b4e8722e6ba4da9cc3d9306e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5f9fdb4ff94f7d28432aa87df672c012fbb90b3e3eecfc5cf3d9421823c7550ee6f8591078b51390f3a285ad891bef228d7331e60d7cfe09163b66415d9b1a5c
|
|
7
|
+
data.tar.gz: 9e88a4e422ef214f46dfc502f4b2edeb974679f57807305915577b94dd00e3653eaa2f9ff3877431951b16f045919652135d0960bfb2c8e688cdbfca0451f987
|
|
@@ -92,10 +92,10 @@ module LinearToonMcp
|
|
|
92
92
|
raise Error, "Issue creation failed" unless result["success"]
|
|
93
93
|
|
|
94
94
|
issue = result["issue"]
|
|
95
|
-
|
|
96
|
-
create_links(client, issue["id"], kwargs[:links])
|
|
95
|
+
warnings = post_create(client, issue["id"], **kwargs)
|
|
97
96
|
|
|
98
97
|
text = Toon.encode(issue)
|
|
98
|
+
text += "\nWARNING (issue was created): #{warnings.join("; ")}" if warnings.any?
|
|
99
99
|
MCP::Tool::Response.new([{type: "text", text:}])
|
|
100
100
|
rescue Error => e
|
|
101
101
|
MCP::Tool::Response.new([{type: "text", text: e.message}], error: true)
|
|
@@ -103,6 +103,21 @@ module LinearToonMcp
|
|
|
103
103
|
|
|
104
104
|
private
|
|
105
105
|
|
|
106
|
+
def post_create(client, issue_id, links: nil, **kwargs)
|
|
107
|
+
warnings = []
|
|
108
|
+
begin
|
|
109
|
+
create_relations(client, issue_id, **kwargs)
|
|
110
|
+
rescue Error => e
|
|
111
|
+
warnings << e.message
|
|
112
|
+
end
|
|
113
|
+
begin
|
|
114
|
+
create_links(client, issue_id, links)
|
|
115
|
+
rescue Error => e
|
|
116
|
+
warnings << e.message
|
|
117
|
+
end
|
|
118
|
+
warnings
|
|
119
|
+
end
|
|
120
|
+
|
|
106
121
|
def add_direct_fields(input, description: nil, priority: nil, estimate: nil,
|
|
107
122
|
dueDate: nil, parentId: nil, **)
|
|
108
123
|
input[:description] = description if description
|
|
@@ -143,9 +158,9 @@ module LinearToonMcp
|
|
|
143
158
|
return unless links
|
|
144
159
|
|
|
145
160
|
links.each do |link|
|
|
146
|
-
data = client.query(LINK_MUTATION, variables: {url: link[
|
|
161
|
+
data = client.query(LINK_MUTATION, variables: {url: link[:url], issueId: issue_id, title: link[:title]})
|
|
147
162
|
next if data.dig("attachmentLinkURL", "success")
|
|
148
|
-
raise Error, "Failed to attach link: #{link[
|
|
163
|
+
raise Error, "Failed to attach link: #{link[:url]}"
|
|
149
164
|
end
|
|
150
165
|
end
|
|
151
166
|
end
|
|
@@ -115,10 +115,10 @@ module LinearToonMcp
|
|
|
115
115
|
raise Error, "Issue update failed" unless result["success"]
|
|
116
116
|
|
|
117
117
|
issue = result["issue"]
|
|
118
|
-
|
|
119
|
-
create_links(client, id, kwargs[:links])
|
|
118
|
+
warnings = post_update(client, id, **kwargs)
|
|
120
119
|
|
|
121
120
|
text = Toon.encode(issue)
|
|
121
|
+
text += "\nWARNING (issue was updated): #{warnings.join("; ")}" if warnings.any?
|
|
122
122
|
MCP::Tool::Response.new([{type: "text", text:}])
|
|
123
123
|
rescue Error => e
|
|
124
124
|
MCP::Tool::Response.new([{type: "text", text: e.message}], error: true)
|
|
@@ -126,6 +126,21 @@ module LinearToonMcp
|
|
|
126
126
|
|
|
127
127
|
private
|
|
128
128
|
|
|
129
|
+
def post_update(client, issue_id, links: nil, **kwargs)
|
|
130
|
+
warnings = []
|
|
131
|
+
begin
|
|
132
|
+
replace_relations(client, issue_id, kwargs)
|
|
133
|
+
rescue Error => e
|
|
134
|
+
warnings << e.message
|
|
135
|
+
end
|
|
136
|
+
begin
|
|
137
|
+
create_links(client, issue_id, links)
|
|
138
|
+
rescue Error => e
|
|
139
|
+
warnings << e.message
|
|
140
|
+
end
|
|
141
|
+
warnings
|
|
142
|
+
end
|
|
143
|
+
|
|
129
144
|
def resolve_team_id(client, issue_id, kwargs)
|
|
130
145
|
return Resolvers.resolve_team(client, kwargs[:team]) if kwargs.key?(:team)
|
|
131
146
|
return unless needs_team_id?(kwargs)
|
|
@@ -206,10 +221,10 @@ module LinearToonMcp
|
|
|
206
221
|
return unless links
|
|
207
222
|
|
|
208
223
|
links.each do |link|
|
|
209
|
-
vars = {url: link[
|
|
224
|
+
vars = {url: link[:url], issueId: issue_id, title: link[:title]}
|
|
210
225
|
data = client.query(LINK_MUTATION, variables: vars)
|
|
211
226
|
next if data.dig("attachmentLinkURL", "success")
|
|
212
|
-
raise Error, "Failed to attach link: #{link[
|
|
227
|
+
raise Error, "Failed to attach link: #{link[:url]}"
|
|
213
228
|
end
|
|
214
229
|
end
|
|
215
230
|
end
|