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,224 @@
1
+ """Comment 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
+ comment_format_request,
9
+ execute_comments_batch_list,
10
+ validate_card_id_batch,
11
+ )
12
+
13
+
14
+ TOOLS = (
15
+ make_tool(
16
+ canonical_name="comments.list",
17
+ mcp_alias="kaiten_list_comments",
18
+ description="List one page of comments on a card.",
19
+ input_schema={
20
+ "type": "object",
21
+ "properties": {
22
+ "card_id": {
23
+ "type": "integer",
24
+ "description": "ID of the card whose comments to list.",
25
+ },
26
+ "limit": {
27
+ "type": "integer",
28
+ "minimum": 1,
29
+ "maximum": 100,
30
+ "description": "Max results (default 50, max 100).",
31
+ },
32
+ "offset": {"type": "integer", "minimum": 0, "description": "Pagination offset."},
33
+ "compact": {
34
+ "type": "boolean",
35
+ "description": "Return compact response without heavy fields (avatars, nested user objects).",
36
+ "default": False,
37
+ },
38
+ },
39
+ "required": ["card_id"],
40
+ },
41
+ operation=OperationSpec(
42
+ method="GET",
43
+ path_template="/cards/{card_id}/comments",
44
+ path_fields=("card_id",),
45
+ query_fields=("limit", "offset"),
46
+ ),
47
+ response_policy=ResponsePolicy(
48
+ compact_supported=True, default_limit=50, result_kind="list"
49
+ ),
50
+ examples=(
51
+ ExampleSpec(
52
+ command="kaiten --json comments list --card-id 10 --compact",
53
+ description="List comments on a card.",
54
+ ),
55
+ ),
56
+ usage_notes=(
57
+ "This direct command returns one page; increase offset to read subsequent pages.",
58
+ "This is a per-card read and becomes expensive when repeated across large card populations.",
59
+ "For report and investigation workflows, prefer comments.batch-list over one-card-at-a-time loops.",
60
+ ),
61
+ bulk_alternative="comments.batch-list",
62
+ ),
63
+ make_tool(
64
+ canonical_name="comments.batch-list",
65
+ mcp_alias="kaiten_batch_list_comments",
66
+ description="Fetch comments for multiple cards with bounded worker concurrency.",
67
+ input_schema={
68
+ "type": "object",
69
+ "properties": {
70
+ "card_ids": {
71
+ "type": "array",
72
+ "items": {"type": "integer"},
73
+ "description": "Card IDs to inspect",
74
+ },
75
+ "workers": {
76
+ "type": "integer",
77
+ "description": "Parallel workers (default 2, max 6)",
78
+ },
79
+ "page_size": {
80
+ "type": "integer",
81
+ "minimum": 1,
82
+ "maximum": 100,
83
+ "description": "Comments per request (default 100, max 100).",
84
+ },
85
+ "max_pages": {
86
+ "type": "integer",
87
+ "minimum": 1,
88
+ "maximum": 1000,
89
+ "description": "Safety limit per card (default 100, max 1000).",
90
+ },
91
+ "compact": {
92
+ "type": "boolean",
93
+ "description": "Strip heavy fields from comment payloads",
94
+ },
95
+ "fields": {
96
+ "type": "string",
97
+ "description": "Comma-separated field names to keep for each comment",
98
+ },
99
+ },
100
+ "required": ["card_ids"],
101
+ },
102
+ operation=OperationSpec(method="GET", path_template="/cards/comments/batch"),
103
+ response_policy=ResponsePolicy(result_kind="entity", heavy=True),
104
+ runtime_behavior=RuntimeBehavior(
105
+ execution_mode="aggregated",
106
+ payload_validator=validate_card_id_batch,
107
+ custom_executor=execute_comments_batch_list,
108
+ ),
109
+ examples=(
110
+ ExampleSpec(
111
+ command="kaiten --json comments batch-list --card-ids '[1,2,3]'",
112
+ description="Fetch comments for several cards in one CLI call.",
113
+ ),
114
+ ExampleSpec(
115
+ command="kaiten --json comments batch-list --card-ids '[1,2,3]' --workers 2 --compact --fields id,text",
116
+ description="Fetch narrowed comment payloads with bounded concurrency.",
117
+ ),
118
+ ),
119
+ usage_notes=(
120
+ "The command returns items, errors, and meta so partial per-card failures stay visible without aborting the whole batch.",
121
+ "Each card is paginated to completion; a full max_pages boundary becomes a per-card error instead of a partial comment list.",
122
+ "Use this bulk path when you need comment evidence across many cards.",
123
+ ),
124
+ ),
125
+ make_tool(
126
+ canonical_name="comments.create",
127
+ mcp_alias="kaiten_create_comment",
128
+ description="Add a comment to a card.",
129
+ input_schema={
130
+ "type": "object",
131
+ "properties": {
132
+ "card_id": {"type": "integer", "description": "ID of the card to comment on."},
133
+ "text": {
134
+ "type": "string",
135
+ "description": "Comment text. For format=html send HTML content.",
136
+ "x-documentation-constraints": "minLength: 0\nmaxLength: 4096",
137
+ },
138
+ "format": {
139
+ "type": "string",
140
+ "enum": ["markdown", "html"],
141
+ "description": "Comment format. 'markdown' (default) stores raw markdown, 'html' switches the request to HTML mode.",
142
+ },
143
+ "internal": {
144
+ "type": "boolean",
145
+ "description": "Mark the comment as internal (visible only to team).",
146
+ },
147
+ },
148
+ "required": ["card_id", "text"],
149
+ },
150
+ operation=OperationSpec(
151
+ method="POST",
152
+ path_template="/cards/{card_id}/comments",
153
+ path_fields=("card_id",),
154
+ body_fields=("text", "format", "internal"),
155
+ ),
156
+ runtime_behavior=RuntimeBehavior(request_shaper=comment_format_request),
157
+ examples=(
158
+ ExampleSpec(
159
+ command='kaiten --json comments create --card-id 10 --text "Looks good"',
160
+ description="Create a markdown comment.",
161
+ ),
162
+ ),
163
+ ),
164
+ make_tool(
165
+ canonical_name="comments.update",
166
+ mcp_alias="kaiten_update_comment",
167
+ description="Update a comment on a card (author only).",
168
+ input_schema={
169
+ "type": "object",
170
+ "properties": {
171
+ "card_id": {"type": "integer", "description": "ID of the card."},
172
+ "comment_id": {"type": "integer", "description": "ID of the comment to update."},
173
+ "text": {
174
+ "type": "string",
175
+ "description": "New comment text. For format=html send HTML content.",
176
+ "x-documentation-constraints": "minLength: 0\nmaxLength: 4096",
177
+ },
178
+ "format": {
179
+ "type": "string",
180
+ "enum": ["markdown", "html"],
181
+ "description": "Comment format. 'html' switches the request to HTML mode, 'markdown' switches back to markdown.",
182
+ },
183
+ },
184
+ "required": ["card_id", "comment_id"],
185
+ },
186
+ operation=OperationSpec(
187
+ method="PATCH",
188
+ path_template="/cards/{card_id}/comments/{comment_id}",
189
+ path_fields=("card_id", "comment_id"),
190
+ body_fields=("text", "format"),
191
+ ),
192
+ runtime_behavior=RuntimeBehavior(request_shaper=comment_format_request),
193
+ examples=(
194
+ ExampleSpec(
195
+ command='kaiten --json comments update --card-id 10 --comment-id 20 --text "Updated"',
196
+ description="Update a comment.",
197
+ ),
198
+ ),
199
+ ),
200
+ make_tool(
201
+ canonical_name="comments.delete",
202
+ mcp_alias="kaiten_delete_comment",
203
+ description="Delete a comment from a card (author only).",
204
+ input_schema={
205
+ "type": "object",
206
+ "properties": {
207
+ "card_id": {"type": "integer", "description": "ID of the card."},
208
+ "comment_id": {"type": "integer", "description": "ID of the comment to delete."},
209
+ },
210
+ "required": ["card_id", "comment_id"],
211
+ },
212
+ operation=OperationSpec(
213
+ method="DELETE",
214
+ path_template="/cards/{card_id}/comments/{comment_id}",
215
+ path_fields=("card_id", "comment_id"),
216
+ ),
217
+ examples=(
218
+ ExampleSpec(
219
+ command="kaiten --json comments delete --card-id 10 --comment-id 20",
220
+ description="Delete a comment.",
221
+ ),
222
+ ),
223
+ ),
224
+ )