kaiten-cli 0.3.3__py3-none-any.whl

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.
Files changed (99) hide show
  1. kaiten_cli/__init__.py +5 -0
  2. kaiten_cli/__main__.py +9 -0
  3. kaiten_cli/agent_gateway.py +577 -0
  4. kaiten_cli/app.py +1636 -0
  5. kaiten_cli/completion.py +570 -0
  6. kaiten_cli/discovery.py +39 -0
  7. kaiten_cli/errors.py +79 -0
  8. kaiten_cli/i18n.py +92 -0
  9. kaiten_cli/locales/ru.json +2967 -0
  10. kaiten_cli/localized_click.py +160 -0
  11. kaiten_cli/models.py +202 -0
  12. kaiten_cli/profiles.py +316 -0
  13. kaiten_cli/registry/__init__.py +260 -0
  14. kaiten_cli/registry/addons.py +392 -0
  15. kaiten_cli/registry/audit_and_analytics.py +451 -0
  16. kaiten_cli/registry/automation_schema.py +44 -0
  17. kaiten_cli/registry/automation_schemas.json +7417 -0
  18. kaiten_cli/registry/automations.py +342 -0
  19. kaiten_cli/registry/base.py +62 -0
  20. kaiten_cli/registry/blockers.py +320 -0
  21. kaiten_cli/registry/boards.py +520 -0
  22. kaiten_cli/registry/card_relations.py +376 -0
  23. kaiten_cli/registry/card_types.py +363 -0
  24. kaiten_cli/registry/cards.py +1329 -0
  25. kaiten_cli/registry/charts.py +539 -0
  26. kaiten_cli/registry/checklists.py +600 -0
  27. kaiten_cli/registry/columns.py +558 -0
  28. kaiten_cli/registry/comments.py +224 -0
  29. kaiten_cli/registry/custom_directories.py +980 -0
  30. kaiten_cli/registry/custom_properties.py +1460 -0
  31. kaiten_cli/registry/dashboards.py +564 -0
  32. kaiten_cli/registry/documents.py +761 -0
  33. kaiten_cli/registry/external_links.py +128 -0
  34. kaiten_cli/registry/files.py +738 -0
  35. kaiten_cli/registry/github_addon.py +613 -0
  36. kaiten_cli/registry/iterations.py +397 -0
  37. kaiten_cli/registry/lanes.py +205 -0
  38. kaiten_cli/registry/live_contracts.py +361 -0
  39. kaiten_cli/registry/members.py +336 -0
  40. kaiten_cli/registry/module_docs.py +108 -0
  41. kaiten_cli/registry/projects.py +369 -0
  42. kaiten_cli/registry/query.py +129 -0
  43. kaiten_cli/registry/restrictions.py +249 -0
  44. kaiten_cli/registry/roles_and_groups.py +1102 -0
  45. kaiten_cli/registry/scim.py +263 -0
  46. kaiten_cli/registry/service_desk.py +1270 -0
  47. kaiten_cli/registry/snapshot.py +187 -0
  48. kaiten_cli/registry/spaces.py +272 -0
  49. kaiten_cli/registry/subscribers.py +168 -0
  50. kaiten_cli/registry/tags.py +193 -0
  51. kaiten_cli/registry/time_logs.py +353 -0
  52. kaiten_cli/registry/tree.py +352 -0
  53. kaiten_cli/registry/utilities.py +287 -0
  54. kaiten_cli/registry/webhooks.py +265 -0
  55. kaiten_cli/runtime/__init__.py +1 -0
  56. kaiten_cli/runtime/automation_validation.py +115 -0
  57. kaiten_cli/runtime/behaviors.py +787 -0
  58. kaiten_cli/runtime/cache.py +733 -0
  59. kaiten_cli/runtime/client.py +387 -0
  60. kaiten_cli/runtime/endpoints.py +59 -0
  61. kaiten_cli/runtime/executor.py +269 -0
  62. kaiten_cli/runtime/fs_security.py +168 -0
  63. kaiten_cli/runtime/input.py +310 -0
  64. kaiten_cli/runtime/output.py +59 -0
  65. kaiten_cli/runtime/public_validation.py +35 -0
  66. kaiten_cli/runtime/snapshot_build.py +527 -0
  67. kaiten_cli/runtime/snapshot_common.py +363 -0
  68. kaiten_cli/runtime/snapshot_query.py +306 -0
  69. kaiten_cli/runtime/snapshot_store.py +1192 -0
  70. kaiten_cli/runtime/snapshots.py +62 -0
  71. kaiten_cli/runtime/sqlite_errors.py +23 -0
  72. kaiten_cli/runtime/support/__init__.py +1 -0
  73. kaiten_cli/runtime/support/addons.py +953 -0
  74. kaiten_cli/runtime/support/audit.py +70 -0
  75. kaiten_cli/runtime/support/batch.py +234 -0
  76. kaiten_cli/runtime/support/card_move_url.py +213 -0
  77. kaiten_cli/runtime/support/cards.py +174 -0
  78. kaiten_cli/runtime/support/checklists.py +21 -0
  79. kaiten_cli/runtime/support/company_users.py +117 -0
  80. kaiten_cli/runtime/support/dashboards.py +35 -0
  81. kaiten_cli/runtime/support/documents.py +175 -0
  82. kaiten_cli/runtime/support/files.py +561 -0
  83. kaiten_cli/runtime/support/markdown_export.py +525 -0
  84. kaiten_cli/runtime/support/pagination.py +167 -0
  85. kaiten_cli/runtime/support/projects.py +66 -0
  86. kaiten_cli/runtime/support/relations.py +86 -0
  87. kaiten_cli/runtime/support/restrictions.py +62 -0
  88. kaiten_cli/runtime/support/spaces.py +20 -0
  89. kaiten_cli/runtime/support/time_logs.py +61 -0
  90. kaiten_cli/runtime/support/tree.py +140 -0
  91. kaiten_cli/runtime/support/tree_sharing.py +447 -0
  92. kaiten_cli/runtime/trace.py +500 -0
  93. kaiten_cli/runtime/transforms.py +128 -0
  94. kaiten_cli/schema_docs.py +22 -0
  95. kaiten_cli/update_check.py +519 -0
  96. kaiten_cli-0.3.3.dist-info/METADATA +1110 -0
  97. kaiten_cli-0.3.3.dist-info/RECORD +99 -0
  98. kaiten_cli-0.3.3.dist-info/WHEEL +4 -0
  99. kaiten_cli-0.3.3.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,376 @@
1
+ """Card relation tool specs."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from kaiten_cli.models import ExampleSpec, OperationSpec, ResponsePolicy, RuntimeBehavior
6
+ from kaiten_cli.registry.base import make_tool
7
+ from kaiten_cli.runtime.behaviors import (
8
+ card_child_add_request,
9
+ card_parent_add_request,
10
+ execute_card_children_batch_list,
11
+ planned_relation_add_request,
12
+ validate_card_id_batch,
13
+ )
14
+
15
+
16
+ TOOLS = (
17
+ make_tool(
18
+ canonical_name="card-children.list",
19
+ mcp_alias="kaiten_list_card_children",
20
+ description="List one page of child cards for a given card.",
21
+ input_schema={
22
+ "type": "object",
23
+ "properties": {
24
+ "card_id": {"type": "integer", "description": "ID of the parent card."},
25
+ "limit": {
26
+ "type": "integer",
27
+ "minimum": 1,
28
+ "maximum": 100,
29
+ "description": "Max results (default 50, max 100).",
30
+ },
31
+ "offset": {
32
+ "type": "integer",
33
+ "minimum": 0,
34
+ "description": "Pagination offset.",
35
+ },
36
+ },
37
+ "required": ["card_id"],
38
+ },
39
+ operation=OperationSpec(
40
+ method="GET",
41
+ path_template="/cards/{card_id}/children",
42
+ path_fields=("card_id",),
43
+ query_fields=("limit", "offset"),
44
+ ),
45
+ response_policy=ResponsePolicy(default_limit=50, result_kind="list"),
46
+ examples=(
47
+ ExampleSpec(
48
+ command="kaiten --json card-children list --card-id 10",
49
+ description="List child cards.",
50
+ ),
51
+ ),
52
+ usage_notes=(
53
+ "This direct command returns one page; increase offset to read subsequent pages.",
54
+ "This is a per-card read and becomes expensive when repeated across many parent cards.",
55
+ "For investigation and reporting workflows, prefer card-children.batch-list over one-card-at-a-time loops.",
56
+ ),
57
+ bulk_alternative="card-children.batch-list",
58
+ ),
59
+ make_tool(
60
+ canonical_name="card-children.batch-list",
61
+ mcp_alias="kaiten_batch_list_card_children",
62
+ description="Fetch child-card relations for multiple parent cards with bounded worker concurrency.",
63
+ input_schema={
64
+ "type": "object",
65
+ "properties": {
66
+ "card_ids": {
67
+ "type": "array",
68
+ "items": {"type": "integer"},
69
+ "description": "Parent card IDs to inspect",
70
+ },
71
+ "workers": {
72
+ "type": "integer",
73
+ "description": "Parallel workers (default 2, max 6)",
74
+ },
75
+ "page_size": {
76
+ "type": "integer",
77
+ "minimum": 1,
78
+ "maximum": 100,
79
+ "description": "Child cards per request (default 100, max 100).",
80
+ },
81
+ "max_pages": {
82
+ "type": "integer",
83
+ "minimum": 1,
84
+ "maximum": 1000,
85
+ "description": "Safety limit per card (default 100, max 1000).",
86
+ },
87
+ "compact": {
88
+ "type": "boolean",
89
+ "description": "Strip heavy nested fields from child card payloads",
90
+ },
91
+ "fields": {
92
+ "type": "string",
93
+ "description": "Comma-separated field names to keep for each child card",
94
+ },
95
+ },
96
+ "required": ["card_ids"],
97
+ },
98
+ operation=OperationSpec(method="GET", path_template="/cards/children/batch"),
99
+ response_policy=ResponsePolicy(result_kind="entity", heavy=True),
100
+ runtime_behavior=RuntimeBehavior(
101
+ execution_mode="aggregated",
102
+ payload_validator=validate_card_id_batch,
103
+ custom_executor=execute_card_children_batch_list,
104
+ ),
105
+ examples=(
106
+ ExampleSpec(
107
+ command="kaiten --json card-children batch-list --card-ids '[1,2,3]'",
108
+ description="Fetch child-card relations for several parent cards.",
109
+ ),
110
+ ExampleSpec(
111
+ command="kaiten --json card-children batch-list --card-ids '[1,2,3]' --workers 2 --compact --fields id,title",
112
+ description="Fetch narrowed child-card payloads with bounded concurrency.",
113
+ ),
114
+ ),
115
+ usage_notes=(
116
+ "The command returns items, errors, and meta so partial per-card failures stay visible without aborting the whole batch.",
117
+ "Each card is paginated to completion; a full max_pages boundary becomes a per-card error instead of a partial child-card list.",
118
+ "Use this bulk path for relation-heavy investigations instead of per-parent card-children.list loops.",
119
+ ),
120
+ ),
121
+ make_tool(
122
+ canonical_name="card-children.add",
123
+ mcp_alias="kaiten_add_card_child",
124
+ description="Add a child card to a given card.",
125
+ input_schema={
126
+ "type": "object",
127
+ "properties": {
128
+ "card_id": {"type": "integer", "description": "ID of the parent card."},
129
+ "child_card_id": {
130
+ "type": "integer",
131
+ "description": "ID of the card to add as a child.",
132
+ },
133
+ },
134
+ "required": ["card_id", "child_card_id"],
135
+ },
136
+ operation=OperationSpec(
137
+ method="POST",
138
+ path_template="/cards/{card_id}/children",
139
+ path_fields=("card_id",),
140
+ body_fields=("child_card_id",),
141
+ ),
142
+ runtime_behavior=RuntimeBehavior(request_shaper=card_child_add_request),
143
+ examples=(
144
+ ExampleSpec(
145
+ command="kaiten --json card-children add --card-id 10 --child-card-id 11",
146
+ description="Add a child card relation.",
147
+ ),
148
+ ),
149
+ ),
150
+ make_tool(
151
+ canonical_name="card-children.remove",
152
+ mcp_alias="kaiten_remove_card_child",
153
+ description="Remove a child card from a given card.",
154
+ input_schema={
155
+ "type": "object",
156
+ "properties": {
157
+ "card_id": {"type": "integer", "description": "ID of the parent card."},
158
+ "child_id": {"type": "integer", "description": "ID of the child card to remove."},
159
+ },
160
+ "required": ["card_id", "child_id"],
161
+ },
162
+ operation=OperationSpec(
163
+ method="DELETE",
164
+ path_template="/cards/{card_id}/children/{child_id}",
165
+ path_fields=("card_id", "child_id"),
166
+ ),
167
+ examples=(
168
+ ExampleSpec(
169
+ command="kaiten --json card-children remove --card-id 10 --child-id 11",
170
+ description="Remove a child card relation.",
171
+ ),
172
+ ),
173
+ ),
174
+ make_tool(
175
+ canonical_name="card-parents.list",
176
+ mcp_alias="kaiten_list_card_parents",
177
+ description="List one page of parent cards for a given card.",
178
+ input_schema={
179
+ "type": "object",
180
+ "properties": {
181
+ "card_id": {"type": "integer", "description": "ID of the child card."},
182
+ "limit": {
183
+ "type": "integer",
184
+ "minimum": 1,
185
+ "maximum": 100,
186
+ "description": "Max results (default 50, max 100).",
187
+ },
188
+ "offset": {
189
+ "type": "integer",
190
+ "minimum": 0,
191
+ "description": "Pagination offset.",
192
+ },
193
+ },
194
+ "required": ["card_id"],
195
+ },
196
+ operation=OperationSpec(
197
+ method="GET",
198
+ path_template="/cards/{card_id}/parents",
199
+ path_fields=("card_id",),
200
+ query_fields=("limit", "offset"),
201
+ ),
202
+ response_policy=ResponsePolicy(default_limit=50, result_kind="list"),
203
+ examples=(
204
+ ExampleSpec(
205
+ command="kaiten --json card-parents list --card-id 10",
206
+ description="List parent cards.",
207
+ ),
208
+ ),
209
+ usage_notes=(
210
+ "This direct command returns one page; increase offset to read subsequent pages.",
211
+ ),
212
+ ),
213
+ make_tool(
214
+ canonical_name="card-parents.add",
215
+ mcp_alias="kaiten_add_card_parent",
216
+ description="Add a parent card to a given card.",
217
+ input_schema={
218
+ "type": "object",
219
+ "properties": {
220
+ "card_id": {"type": "integer", "description": "ID of the child card."},
221
+ "parent_card_id": {
222
+ "type": "integer",
223
+ "description": "ID of the card to add as a parent.",
224
+ },
225
+ },
226
+ "required": ["card_id", "parent_card_id"],
227
+ },
228
+ operation=OperationSpec(
229
+ method="POST",
230
+ path_template="/cards/{card_id}/parents",
231
+ path_fields=("card_id",),
232
+ body_fields=("parent_card_id",),
233
+ ),
234
+ runtime_behavior=RuntimeBehavior(request_shaper=card_parent_add_request),
235
+ examples=(
236
+ ExampleSpec(
237
+ command="kaiten --json card-parents add --card-id 10 --parent-card-id 11",
238
+ description="Add a parent card relation.",
239
+ ),
240
+ ),
241
+ ),
242
+ make_tool(
243
+ canonical_name="card-parents.remove",
244
+ mcp_alias="kaiten_remove_card_parent",
245
+ description="Remove a parent card from a given card.",
246
+ input_schema={
247
+ "type": "object",
248
+ "properties": {
249
+ "card_id": {"type": "integer", "description": "ID of the child card."},
250
+ "parent_id": {"type": "integer", "description": "ID of the parent card to remove."},
251
+ },
252
+ "required": ["card_id", "parent_id"],
253
+ },
254
+ operation=OperationSpec(
255
+ method="DELETE",
256
+ path_template="/cards/{card_id}/parents/{parent_id}",
257
+ path_fields=("card_id", "parent_id"),
258
+ ),
259
+ examples=(
260
+ ExampleSpec(
261
+ command="kaiten --json card-parents remove --card-id 10 --parent-id 11",
262
+ description="Remove a parent card relation.",
263
+ ),
264
+ ),
265
+ ),
266
+ make_tool(
267
+ canonical_name="planned-relations.add",
268
+ mcp_alias="kaiten_add_planned_relation",
269
+ description=(
270
+ "Create a planned relation (successor link) between two cards on Timeline/Gantt. "
271
+ "The source card becomes a predecessor and the target card becomes its successor."
272
+ ),
273
+ input_schema={
274
+ "type": "object",
275
+ "properties": {
276
+ "card_id": {
277
+ "type": "integer",
278
+ "description": "ID of the source (predecessor) card.",
279
+ },
280
+ "target_card_id": {
281
+ "type": "integer",
282
+ "description": "ID of the target (successor) card.",
283
+ },
284
+ "type": {
285
+ "type": "string",
286
+ "enum": ["end-start"],
287
+ "description": "Relation type. Defaults to 'end-start'.",
288
+ },
289
+ },
290
+ "required": ["card_id", "target_card_id"],
291
+ },
292
+ operation=OperationSpec(
293
+ method="POST",
294
+ path_template="/cards/{card_id}/planned-relation",
295
+ path_fields=("card_id",),
296
+ body_fields=("target_card_id", "type"),
297
+ ),
298
+ runtime_behavior=RuntimeBehavior(request_shaper=planned_relation_add_request),
299
+ examples=(
300
+ ExampleSpec(
301
+ command="kaiten --json planned-relations add --card-id 10 --target-card-id 11",
302
+ description="Create a finish-to-start planned relation.",
303
+ ),
304
+ ),
305
+ ),
306
+ make_tool(
307
+ canonical_name="planned-relations.update",
308
+ mcp_alias="kaiten_update_planned_relation",
309
+ description="Update the lag/lead gap of a planned relation between two cards.",
310
+ input_schema={
311
+ "type": "object",
312
+ "properties": {
313
+ "card_id": {
314
+ "type": "integer",
315
+ "description": "ID of the source (predecessor) card.",
316
+ },
317
+ "target_card_id": {
318
+ "type": "integer",
319
+ "description": "ID of the target (successor) card.",
320
+ },
321
+ "gap": {
322
+ "type": ["integer", "null"],
323
+ "description": "Distance between cards (-1000..1000). Positive = lag, negative = lead. null to clear.",
324
+ },
325
+ "gap_type": {
326
+ "type": ["string", "null"],
327
+ "enum": ["hours", "days"],
328
+ "description": "Unit of the gap: 'hours', 'days', or null to clear.",
329
+ },
330
+ },
331
+ "required": ["card_id", "target_card_id", "gap", "gap_type"],
332
+ },
333
+ operation=OperationSpec(
334
+ method="PATCH",
335
+ path_template="/cards/{card_id}/planned-relation/{target_card_id}",
336
+ path_fields=("card_id", "target_card_id"),
337
+ body_fields=("gap", "gap_type"),
338
+ ),
339
+ examples=(
340
+ ExampleSpec(
341
+ command="kaiten --json planned-relations update --card-id 10 --target-card-id 11 --gap 2 --gap-type days",
342
+ description="Set a 2-day lag for a planned relation.",
343
+ ),
344
+ ),
345
+ ),
346
+ make_tool(
347
+ canonical_name="planned-relations.remove",
348
+ mcp_alias="kaiten_remove_planned_relation",
349
+ description="Remove a planned relation (successor link) between two cards.",
350
+ input_schema={
351
+ "type": "object",
352
+ "properties": {
353
+ "card_id": {
354
+ "type": "integer",
355
+ "description": "ID of the source (predecessor) card.",
356
+ },
357
+ "target_card_id": {
358
+ "type": "integer",
359
+ "description": "ID of the target (successor) card to unlink.",
360
+ },
361
+ },
362
+ "required": ["card_id", "target_card_id"],
363
+ },
364
+ operation=OperationSpec(
365
+ method="DELETE",
366
+ path_template="/cards/{card_id}/planned-relation/{target_card_id}",
367
+ path_fields=("card_id", "target_card_id"),
368
+ ),
369
+ examples=(
370
+ ExampleSpec(
371
+ command="kaiten --json planned-relations remove --card-id 10 --target-card-id 11",
372
+ description="Remove a planned relation.",
373
+ ),
374
+ ),
375
+ ),
376
+ )