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.
- kaiten_cli/__init__.py +5 -0
- kaiten_cli/__main__.py +9 -0
- kaiten_cli/agent_gateway.py +577 -0
- kaiten_cli/app.py +1636 -0
- kaiten_cli/completion.py +570 -0
- kaiten_cli/discovery.py +39 -0
- kaiten_cli/errors.py +79 -0
- kaiten_cli/i18n.py +92 -0
- kaiten_cli/locales/ru.json +2967 -0
- kaiten_cli/localized_click.py +160 -0
- kaiten_cli/models.py +202 -0
- kaiten_cli/profiles.py +316 -0
- kaiten_cli/registry/__init__.py +260 -0
- kaiten_cli/registry/addons.py +392 -0
- kaiten_cli/registry/audit_and_analytics.py +451 -0
- kaiten_cli/registry/automation_schema.py +44 -0
- kaiten_cli/registry/automation_schemas.json +7417 -0
- kaiten_cli/registry/automations.py +342 -0
- kaiten_cli/registry/base.py +62 -0
- kaiten_cli/registry/blockers.py +320 -0
- kaiten_cli/registry/boards.py +520 -0
- kaiten_cli/registry/card_relations.py +376 -0
- kaiten_cli/registry/card_types.py +363 -0
- kaiten_cli/registry/cards.py +1329 -0
- kaiten_cli/registry/charts.py +539 -0
- kaiten_cli/registry/checklists.py +600 -0
- kaiten_cli/registry/columns.py +558 -0
- kaiten_cli/registry/comments.py +224 -0
- kaiten_cli/registry/custom_directories.py +980 -0
- kaiten_cli/registry/custom_properties.py +1460 -0
- kaiten_cli/registry/dashboards.py +564 -0
- kaiten_cli/registry/documents.py +761 -0
- kaiten_cli/registry/external_links.py +128 -0
- kaiten_cli/registry/files.py +738 -0
- kaiten_cli/registry/github_addon.py +613 -0
- kaiten_cli/registry/iterations.py +397 -0
- kaiten_cli/registry/lanes.py +205 -0
- kaiten_cli/registry/live_contracts.py +361 -0
- kaiten_cli/registry/members.py +336 -0
- kaiten_cli/registry/module_docs.py +108 -0
- kaiten_cli/registry/projects.py +369 -0
- kaiten_cli/registry/query.py +129 -0
- kaiten_cli/registry/restrictions.py +249 -0
- kaiten_cli/registry/roles_and_groups.py +1102 -0
- kaiten_cli/registry/scim.py +263 -0
- kaiten_cli/registry/service_desk.py +1270 -0
- kaiten_cli/registry/snapshot.py +187 -0
- kaiten_cli/registry/spaces.py +272 -0
- kaiten_cli/registry/subscribers.py +168 -0
- kaiten_cli/registry/tags.py +193 -0
- kaiten_cli/registry/time_logs.py +353 -0
- kaiten_cli/registry/tree.py +352 -0
- kaiten_cli/registry/utilities.py +287 -0
- kaiten_cli/registry/webhooks.py +265 -0
- kaiten_cli/runtime/__init__.py +1 -0
- kaiten_cli/runtime/automation_validation.py +115 -0
- kaiten_cli/runtime/behaviors.py +787 -0
- kaiten_cli/runtime/cache.py +733 -0
- kaiten_cli/runtime/client.py +387 -0
- kaiten_cli/runtime/endpoints.py +59 -0
- kaiten_cli/runtime/executor.py +269 -0
- kaiten_cli/runtime/fs_security.py +168 -0
- kaiten_cli/runtime/input.py +310 -0
- kaiten_cli/runtime/output.py +59 -0
- kaiten_cli/runtime/public_validation.py +35 -0
- kaiten_cli/runtime/snapshot_build.py +527 -0
- kaiten_cli/runtime/snapshot_common.py +363 -0
- kaiten_cli/runtime/snapshot_query.py +306 -0
- kaiten_cli/runtime/snapshot_store.py +1192 -0
- kaiten_cli/runtime/snapshots.py +62 -0
- kaiten_cli/runtime/sqlite_errors.py +23 -0
- kaiten_cli/runtime/support/__init__.py +1 -0
- kaiten_cli/runtime/support/addons.py +953 -0
- kaiten_cli/runtime/support/audit.py +70 -0
- kaiten_cli/runtime/support/batch.py +234 -0
- kaiten_cli/runtime/support/card_move_url.py +213 -0
- kaiten_cli/runtime/support/cards.py +174 -0
- kaiten_cli/runtime/support/checklists.py +21 -0
- kaiten_cli/runtime/support/company_users.py +117 -0
- kaiten_cli/runtime/support/dashboards.py +35 -0
- kaiten_cli/runtime/support/documents.py +175 -0
- kaiten_cli/runtime/support/files.py +561 -0
- kaiten_cli/runtime/support/markdown_export.py +525 -0
- kaiten_cli/runtime/support/pagination.py +167 -0
- kaiten_cli/runtime/support/projects.py +66 -0
- kaiten_cli/runtime/support/relations.py +86 -0
- kaiten_cli/runtime/support/restrictions.py +62 -0
- kaiten_cli/runtime/support/spaces.py +20 -0
- kaiten_cli/runtime/support/time_logs.py +61 -0
- kaiten_cli/runtime/support/tree.py +140 -0
- kaiten_cli/runtime/support/tree_sharing.py +447 -0
- kaiten_cli/runtime/trace.py +500 -0
- kaiten_cli/runtime/transforms.py +128 -0
- kaiten_cli/schema_docs.py +22 -0
- kaiten_cli/update_check.py +519 -0
- kaiten_cli-0.3.3.dist-info/METADATA +1110 -0
- kaiten_cli-0.3.3.dist-info/RECORD +99 -0
- kaiten_cli-0.3.3.dist-info/WHEEL +4 -0
- kaiten_cli-0.3.3.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"""Tag and card-tag tool specs."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from kaiten_cli.models import ExampleSpec, OperationSpec, ResponsePolicy
|
|
6
|
+
from kaiten_cli.registry.base import make_tool
|
|
7
|
+
from kaiten_cli.runtime.transforms import DEFAULT_LIMIT
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
TOOLS = (
|
|
11
|
+
make_tool(
|
|
12
|
+
canonical_name="tags.list",
|
|
13
|
+
mcp_alias="kaiten_list_tags",
|
|
14
|
+
description="List Kaiten tags. Note: API may return empty for company-level tags; tags are primarily card-scoped.",
|
|
15
|
+
input_schema={
|
|
16
|
+
"type": "object",
|
|
17
|
+
"properties": {
|
|
18
|
+
"query": {"type": "string", "description": "Search filter (matches by name)"},
|
|
19
|
+
"space_id": {
|
|
20
|
+
"type": "integer",
|
|
21
|
+
"description": "Filter tags by space (only tags used on cards in this space)",
|
|
22
|
+
},
|
|
23
|
+
"ids": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Comma-separated tag IDs to fetch specific tags",
|
|
26
|
+
},
|
|
27
|
+
"limit": {"type": "integer", "description": "Max results"},
|
|
28
|
+
"offset": {"type": "integer", "description": "Pagination offset"},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
operation=OperationSpec(
|
|
32
|
+
method="GET",
|
|
33
|
+
path_template="/tags",
|
|
34
|
+
query_fields=("query", "space_id", "ids", "limit", "offset"),
|
|
35
|
+
),
|
|
36
|
+
response_policy=ResponsePolicy(default_limit=DEFAULT_LIMIT, result_kind="list"),
|
|
37
|
+
examples=(
|
|
38
|
+
ExampleSpec(
|
|
39
|
+
command='kaiten --json tags list --query "backend"',
|
|
40
|
+
description="Search tags by name.",
|
|
41
|
+
),
|
|
42
|
+
),
|
|
43
|
+
),
|
|
44
|
+
make_tool(
|
|
45
|
+
canonical_name="tags.create",
|
|
46
|
+
mcp_alias="kaiten_create_tag",
|
|
47
|
+
description="Create a new Kaiten tag. Color is assigned randomly by the server (1-17).",
|
|
48
|
+
input_schema={
|
|
49
|
+
"type": "object",
|
|
50
|
+
"properties": {
|
|
51
|
+
"name": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"description": "Tag name (1-255 chars, must be unique within the company)",
|
|
54
|
+
},
|
|
55
|
+
"ids": {"type": "string", "description": "List of comma separated ids to sort by"},
|
|
56
|
+
"query": {"type": "string", "description": "Filter by name"},
|
|
57
|
+
"space_id": {"type": "integer", "description": "Filter by space id"},
|
|
58
|
+
"limit": {
|
|
59
|
+
"type": "integer",
|
|
60
|
+
"description": "Maximum amount of tags",
|
|
61
|
+
"x-documentation-constraints": "Default: 100\n Max: 100",
|
|
62
|
+
},
|
|
63
|
+
"offset": {"type": "integer", "description": "Number of records to skip"},
|
|
64
|
+
},
|
|
65
|
+
"required": ["name"],
|
|
66
|
+
},
|
|
67
|
+
operation=OperationSpec(
|
|
68
|
+
method="POST",
|
|
69
|
+
path_template="/tags",
|
|
70
|
+
body_fields=("name",),
|
|
71
|
+
query_fields=("ids", "query", "space_id", "limit", "offset"),
|
|
72
|
+
),
|
|
73
|
+
examples=(
|
|
74
|
+
ExampleSpec(
|
|
75
|
+
command='kaiten --json tags create --name "backend"',
|
|
76
|
+
description="Create a company tag.",
|
|
77
|
+
),
|
|
78
|
+
),
|
|
79
|
+
),
|
|
80
|
+
make_tool(
|
|
81
|
+
canonical_name="tags.update",
|
|
82
|
+
mcp_alias="kaiten_update_tag",
|
|
83
|
+
description="Update a Kaiten tag (name and/or color). Requires company tag management permission.",
|
|
84
|
+
input_schema={
|
|
85
|
+
"type": "object",
|
|
86
|
+
"properties": {
|
|
87
|
+
"tag_id": {"type": "integer", "description": "Tag ID"},
|
|
88
|
+
"name": {"type": "string", "description": "New tag name (1-255 chars)"},
|
|
89
|
+
"color": {"type": "integer", "description": "Color index (1-17)"},
|
|
90
|
+
},
|
|
91
|
+
"required": ["tag_id"],
|
|
92
|
+
},
|
|
93
|
+
operation=OperationSpec(
|
|
94
|
+
method="PATCH",
|
|
95
|
+
path_template="/company/tags/{tag_id}",
|
|
96
|
+
path_fields=("tag_id",),
|
|
97
|
+
body_fields=("name", "color"),
|
|
98
|
+
),
|
|
99
|
+
examples=(
|
|
100
|
+
ExampleSpec(
|
|
101
|
+
command='kaiten --json tags update --tag-id 10 --name "backend"',
|
|
102
|
+
description="Update a company tag.",
|
|
103
|
+
),
|
|
104
|
+
),
|
|
105
|
+
),
|
|
106
|
+
make_tool(
|
|
107
|
+
canonical_name="tags.delete",
|
|
108
|
+
mcp_alias="kaiten_delete_tag",
|
|
109
|
+
description="Delete a Kaiten tag. Requires company tag management permission. May be blocked if an async operation is in progress.",
|
|
110
|
+
input_schema={
|
|
111
|
+
"type": "object",
|
|
112
|
+
"properties": {"tag_id": {"type": "integer", "description": "Tag ID"}},
|
|
113
|
+
"required": ["tag_id"],
|
|
114
|
+
},
|
|
115
|
+
operation=OperationSpec(
|
|
116
|
+
method="DELETE", path_template="/company/tags/{tag_id}", path_fields=("tag_id",)
|
|
117
|
+
),
|
|
118
|
+
examples=(
|
|
119
|
+
ExampleSpec(
|
|
120
|
+
command="kaiten --json tags delete --tag-id 10", description="Delete a company tag."
|
|
121
|
+
),
|
|
122
|
+
),
|
|
123
|
+
),
|
|
124
|
+
make_tool(
|
|
125
|
+
canonical_name="card-tags.add",
|
|
126
|
+
mcp_alias="kaiten_add_card_tag",
|
|
127
|
+
description="Add a tag to a Kaiten card by name. Creates the tag if it doesn't exist.",
|
|
128
|
+
input_schema={
|
|
129
|
+
"type": "object",
|
|
130
|
+
"properties": {
|
|
131
|
+
"card_id": {"type": "integer", "description": "Card ID"},
|
|
132
|
+
"name": {"type": "string", "description": "Tag name (1-255 chars)"},
|
|
133
|
+
},
|
|
134
|
+
"required": ["card_id", "name"],
|
|
135
|
+
},
|
|
136
|
+
operation=OperationSpec(
|
|
137
|
+
method="POST",
|
|
138
|
+
path_template="/cards/{card_id}/tags",
|
|
139
|
+
path_fields=("card_id",),
|
|
140
|
+
body_fields=("name",),
|
|
141
|
+
),
|
|
142
|
+
examples=(
|
|
143
|
+
ExampleSpec(
|
|
144
|
+
command='kaiten --json card-tags add --card-id 10 --name "backend"',
|
|
145
|
+
description="Add a tag to a card.",
|
|
146
|
+
),
|
|
147
|
+
),
|
|
148
|
+
),
|
|
149
|
+
make_tool(
|
|
150
|
+
canonical_name="card-tags.list",
|
|
151
|
+
mcp_alias="kaiten_list_card_tags",
|
|
152
|
+
description="List tags attached to a Kaiten card.",
|
|
153
|
+
input_schema={
|
|
154
|
+
"type": "object",
|
|
155
|
+
"properties": {"card_id": {"type": "integer", "description": "Card ID"}},
|
|
156
|
+
"required": ["card_id"],
|
|
157
|
+
},
|
|
158
|
+
operation=OperationSpec(
|
|
159
|
+
method="GET", path_template="/cards/{card_id}/tags", path_fields=("card_id",)
|
|
160
|
+
),
|
|
161
|
+
response_policy=ResponsePolicy(result_kind="list"),
|
|
162
|
+
examples=(
|
|
163
|
+
ExampleSpec(
|
|
164
|
+
command="kaiten --json card-tags list --card-id 10",
|
|
165
|
+
description="List tags on a card.",
|
|
166
|
+
),
|
|
167
|
+
),
|
|
168
|
+
),
|
|
169
|
+
make_tool(
|
|
170
|
+
canonical_name="card-tags.remove",
|
|
171
|
+
mcp_alias="kaiten_remove_card_tag",
|
|
172
|
+
description="Remove a tag from a Kaiten card.",
|
|
173
|
+
input_schema={
|
|
174
|
+
"type": "object",
|
|
175
|
+
"properties": {
|
|
176
|
+
"card_id": {"type": "integer", "description": "Card ID"},
|
|
177
|
+
"tag_id": {"type": "integer", "description": "Tag ID"},
|
|
178
|
+
},
|
|
179
|
+
"required": ["card_id", "tag_id"],
|
|
180
|
+
},
|
|
181
|
+
operation=OperationSpec(
|
|
182
|
+
method="DELETE",
|
|
183
|
+
path_template="/cards/{card_id}/tags/{tag_id}",
|
|
184
|
+
path_fields=("card_id", "tag_id"),
|
|
185
|
+
),
|
|
186
|
+
examples=(
|
|
187
|
+
ExampleSpec(
|
|
188
|
+
command="kaiten --json card-tags remove --card-id 10 --tag-id 20",
|
|
189
|
+
description="Remove a tag from a card.",
|
|
190
|
+
),
|
|
191
|
+
),
|
|
192
|
+
),
|
|
193
|
+
)
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
"""Time-log 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
|
+
default_role_time_log_request,
|
|
9
|
+
execute_time_logs_batch_list,
|
|
10
|
+
validate_time_logs_batch_list,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
TOOLS = (
|
|
15
|
+
make_tool(
|
|
16
|
+
canonical_name="timesheet.list",
|
|
17
|
+
mcp_alias="kaiten_list_timesheet",
|
|
18
|
+
description="List time logs across cards from the company timesheet endpoint.",
|
|
19
|
+
input_schema={
|
|
20
|
+
"type": "object",
|
|
21
|
+
"properties": {
|
|
22
|
+
"user_id": {"type": "integer", "description": "Filter by user ID."},
|
|
23
|
+
"card_id": {"type": "integer", "description": "Filter by card ID."},
|
|
24
|
+
"for_date": {"type": "string", "description": "Filter by date (YYYY-MM-DD)."},
|
|
25
|
+
"date_from": {"type": "string", "description": "Start date filter."},
|
|
26
|
+
"date_to": {"type": "string", "description": "End date filter."},
|
|
27
|
+
"limit": {"type": "integer", "description": "Max results."},
|
|
28
|
+
"offset": {"type": "integer", "description": "Pagination offset."},
|
|
29
|
+
"compact": {
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
"description": "Strip heavy nested fields from time-log payloads.",
|
|
32
|
+
},
|
|
33
|
+
"fields": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "Comma-separated field names to keep for each time log.",
|
|
36
|
+
},
|
|
37
|
+
"from": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Date from, format YYYY-MM-DDExample: 2025-12-01",
|
|
40
|
+
},
|
|
41
|
+
"to": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "Date from, format YYYY-MM-DD Example: 2025-12-30",
|
|
44
|
+
},
|
|
45
|
+
"tag_ids": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"description": "Tag ids, comma-separatedExample: 234,2342,6435",
|
|
48
|
+
},
|
|
49
|
+
"user_ids": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"description": "User ids, comma-separated Example: 34,345,345345",
|
|
52
|
+
},
|
|
53
|
+
"group_ids": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "User group ids, comma-separated Example: 1,2,3",
|
|
56
|
+
},
|
|
57
|
+
"space_ids": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"description": "Space ids, comma-separated Example: 453,238945,2",
|
|
60
|
+
},
|
|
61
|
+
"board_ids": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "Board ids, comma-separatedExample: 654,24,243",
|
|
64
|
+
},
|
|
65
|
+
"column_ids": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"description": "Column ids, comma-separatedExample: 624,12,23",
|
|
68
|
+
},
|
|
69
|
+
"card_ids": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"description": "Card ids, comma-separatedExample: 624,12,23",
|
|
72
|
+
},
|
|
73
|
+
"visible_column_ids": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"description": "Visible column ids, comma-separated",
|
|
76
|
+
},
|
|
77
|
+
"condition": {"type": "integer", "description": "Number of records to skip"},
|
|
78
|
+
"group_by": {
|
|
79
|
+
"type": "integer",
|
|
80
|
+
"description": "Options to group by. 0 - no groups, 1 - by user, 2 - by card",
|
|
81
|
+
},
|
|
82
|
+
"time_precision": {
|
|
83
|
+
"type": "integer",
|
|
84
|
+
"description": "Time precision for specified time_unit",
|
|
85
|
+
},
|
|
86
|
+
"time_unit": {"type": "integer", "description": "Time unit"},
|
|
87
|
+
"with_daily_distribution": {
|
|
88
|
+
"type": "integer",
|
|
89
|
+
"description": "Returns data daily when grouped by user or card",
|
|
90
|
+
},
|
|
91
|
+
"only_general_sum": {
|
|
92
|
+
"type": "integer",
|
|
93
|
+
"description": "Returns general sum time spent",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
operation=OperationSpec(
|
|
98
|
+
method="GET",
|
|
99
|
+
path_template="/time-logs",
|
|
100
|
+
query_fields=(
|
|
101
|
+
"user_id",
|
|
102
|
+
"card_id",
|
|
103
|
+
"for_date",
|
|
104
|
+
"date_from",
|
|
105
|
+
"date_to",
|
|
106
|
+
"limit",
|
|
107
|
+
"offset",
|
|
108
|
+
"from",
|
|
109
|
+
"to",
|
|
110
|
+
"tag_ids",
|
|
111
|
+
"user_ids",
|
|
112
|
+
"group_ids",
|
|
113
|
+
"space_ids",
|
|
114
|
+
"board_ids",
|
|
115
|
+
"column_ids",
|
|
116
|
+
"card_ids",
|
|
117
|
+
"visible_column_ids",
|
|
118
|
+
"condition",
|
|
119
|
+
"group_by",
|
|
120
|
+
"time_precision",
|
|
121
|
+
"time_unit",
|
|
122
|
+
"with_daily_distribution",
|
|
123
|
+
"only_general_sum",
|
|
124
|
+
),
|
|
125
|
+
),
|
|
126
|
+
response_policy=ResponsePolicy(
|
|
127
|
+
compact_supported=True, fields_supported=True, default_limit=50, result_kind="list"
|
|
128
|
+
),
|
|
129
|
+
examples=(
|
|
130
|
+
ExampleSpec(
|
|
131
|
+
command="kaiten --json timesheet list --limit 50",
|
|
132
|
+
description="List company time logs.",
|
|
133
|
+
),
|
|
134
|
+
),
|
|
135
|
+
),
|
|
136
|
+
make_tool(
|
|
137
|
+
canonical_name="time-logs.list",
|
|
138
|
+
mcp_alias="kaiten_list_card_time_logs",
|
|
139
|
+
description="List one page of time logs for a card.",
|
|
140
|
+
input_schema={
|
|
141
|
+
"type": "object",
|
|
142
|
+
"properties": {
|
|
143
|
+
"card_id": {"type": "integer", "description": "ID of the card."},
|
|
144
|
+
"for_date": {"type": "string", "description": "Filter by date (YYYY-MM-DD)."},
|
|
145
|
+
"personal": {
|
|
146
|
+
"type": "boolean",
|
|
147
|
+
"description": "Return only the current user's time logs.",
|
|
148
|
+
},
|
|
149
|
+
"limit": {
|
|
150
|
+
"type": "integer",
|
|
151
|
+
"minimum": 1,
|
|
152
|
+
"maximum": 100,
|
|
153
|
+
"description": "Max results (default 50, max 100).",
|
|
154
|
+
},
|
|
155
|
+
"offset": {"type": "integer", "minimum": 0, "description": "Pagination offset."},
|
|
156
|
+
"compact": {
|
|
157
|
+
"type": "boolean",
|
|
158
|
+
"description": "Strip heavy nested fields from time-log payloads.",
|
|
159
|
+
},
|
|
160
|
+
"fields": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"description": "Comma-separated field names to keep for each time log.",
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
"required": ["card_id"],
|
|
166
|
+
},
|
|
167
|
+
operation=OperationSpec(
|
|
168
|
+
method="GET",
|
|
169
|
+
path_template="/cards/{card_id}/time-logs",
|
|
170
|
+
path_fields=("card_id",),
|
|
171
|
+
query_fields=("for_date", "personal", "limit", "offset"),
|
|
172
|
+
),
|
|
173
|
+
response_policy=ResponsePolicy(
|
|
174
|
+
compact_supported=True,
|
|
175
|
+
fields_supported=True,
|
|
176
|
+
default_limit=50,
|
|
177
|
+
result_kind="list",
|
|
178
|
+
),
|
|
179
|
+
examples=(
|
|
180
|
+
ExampleSpec(
|
|
181
|
+
command="kaiten --json time-logs list --card-id 10",
|
|
182
|
+
description="List time logs on a card.",
|
|
183
|
+
),
|
|
184
|
+
),
|
|
185
|
+
usage_notes=(
|
|
186
|
+
"This direct command returns one page; increase offset to read subsequent pages.",
|
|
187
|
+
"This is a per-card read and becomes expensive when repeated across large card populations.",
|
|
188
|
+
"For analytics snapshots and work-log investigations, prefer time-logs.batch-list over one-card-at-a-time loops.",
|
|
189
|
+
),
|
|
190
|
+
bulk_alternative="time-logs.batch-list",
|
|
191
|
+
),
|
|
192
|
+
make_tool(
|
|
193
|
+
canonical_name="time-logs.batch-list",
|
|
194
|
+
mcp_alias="kaiten_batch_list_time_logs",
|
|
195
|
+
description="Fetch time logs for multiple cards with bounded worker concurrency.",
|
|
196
|
+
input_schema={
|
|
197
|
+
"type": "object",
|
|
198
|
+
"properties": {
|
|
199
|
+
"card_ids": {
|
|
200
|
+
"type": "array",
|
|
201
|
+
"items": {"type": "integer"},
|
|
202
|
+
"description": "Card IDs to inspect",
|
|
203
|
+
},
|
|
204
|
+
"workers": {
|
|
205
|
+
"type": "integer",
|
|
206
|
+
"description": "Parallel workers (default 2, max 6)",
|
|
207
|
+
},
|
|
208
|
+
"page_size": {
|
|
209
|
+
"type": "integer",
|
|
210
|
+
"minimum": 1,
|
|
211
|
+
"maximum": 100,
|
|
212
|
+
"description": "Time logs per request (default 100, max 100).",
|
|
213
|
+
},
|
|
214
|
+
"max_pages": {
|
|
215
|
+
"type": "integer",
|
|
216
|
+
"minimum": 1,
|
|
217
|
+
"maximum": 1000,
|
|
218
|
+
"description": "Safety limit per card (default 100, max 1000).",
|
|
219
|
+
},
|
|
220
|
+
"for_date": {
|
|
221
|
+
"type": "string",
|
|
222
|
+
"description": "Optional YYYY-MM-DD filter passed to each per-card request.",
|
|
223
|
+
},
|
|
224
|
+
"personal": {
|
|
225
|
+
"type": "boolean",
|
|
226
|
+
"description": "Only include the current user's time logs.",
|
|
227
|
+
},
|
|
228
|
+
"compact": {
|
|
229
|
+
"type": "boolean",
|
|
230
|
+
"description": "Strip heavy nested fields from time-log payloads",
|
|
231
|
+
},
|
|
232
|
+
"fields": {
|
|
233
|
+
"type": "string",
|
|
234
|
+
"description": "Comma-separated field names to keep for each time log",
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
"required": ["card_ids"],
|
|
238
|
+
},
|
|
239
|
+
operation=OperationSpec(method="GET", path_template="/cards/time-logs/batch"),
|
|
240
|
+
response_policy=ResponsePolicy(result_kind="entity", heavy=True),
|
|
241
|
+
runtime_behavior=RuntimeBehavior(
|
|
242
|
+
execution_mode="aggregated",
|
|
243
|
+
payload_validator=validate_time_logs_batch_list,
|
|
244
|
+
custom_executor=execute_time_logs_batch_list,
|
|
245
|
+
),
|
|
246
|
+
examples=(
|
|
247
|
+
ExampleSpec(
|
|
248
|
+
command="kaiten --json time-logs batch-list --card-ids '[1,2,3]'",
|
|
249
|
+
description="Fetch time logs for several cards in one CLI call.",
|
|
250
|
+
),
|
|
251
|
+
ExampleSpec(
|
|
252
|
+
command="kaiten --json time-logs batch-list --card-ids '[1,2,3]' --workers 2 --fields id,time_spent,for_date",
|
|
253
|
+
description="Fetch narrowed time-log payloads with bounded concurrency.",
|
|
254
|
+
),
|
|
255
|
+
),
|
|
256
|
+
usage_notes=(
|
|
257
|
+
"The command returns items, errors, and meta so partial per-card failures stay visible without aborting the whole batch.",
|
|
258
|
+
"Each card is paginated to completion; a full max_pages boundary becomes a per-card error instead of a partial time-log list.",
|
|
259
|
+
"Use this bulk path for work-log analytics and snapshot builds instead of repeating time-logs.list for every card.",
|
|
260
|
+
),
|
|
261
|
+
),
|
|
262
|
+
make_tool(
|
|
263
|
+
canonical_name="time-logs.create",
|
|
264
|
+
mcp_alias="kaiten_create_time_log",
|
|
265
|
+
description="Log time spent on a card.",
|
|
266
|
+
input_schema={
|
|
267
|
+
"type": "object",
|
|
268
|
+
"properties": {
|
|
269
|
+
"card_id": {"type": "integer", "description": "ID of the card."},
|
|
270
|
+
"time_spent": {
|
|
271
|
+
"type": "integer",
|
|
272
|
+
"description": "Time spent in minutes (minimum 1).",
|
|
273
|
+
},
|
|
274
|
+
"role_id": {
|
|
275
|
+
"type": "integer",
|
|
276
|
+
"description": "Role ID for the time log. Use -1 for the default role.",
|
|
277
|
+
},
|
|
278
|
+
"for_date": {
|
|
279
|
+
"type": "string",
|
|
280
|
+
"description": "Date for the time log (YYYY-MM-DD). Defaults to today.",
|
|
281
|
+
},
|
|
282
|
+
"comment": {"type": "string", "description": "Optional comment for the time log."},
|
|
283
|
+
},
|
|
284
|
+
"required": ["card_id", "time_spent"],
|
|
285
|
+
},
|
|
286
|
+
operation=OperationSpec(
|
|
287
|
+
method="POST",
|
|
288
|
+
path_template="/cards/{card_id}/time-logs",
|
|
289
|
+
path_fields=("card_id",),
|
|
290
|
+
body_fields=("time_spent", "role_id", "for_date", "comment"),
|
|
291
|
+
),
|
|
292
|
+
runtime_behavior=RuntimeBehavior(request_shaper=default_role_time_log_request),
|
|
293
|
+
examples=(
|
|
294
|
+
ExampleSpec(
|
|
295
|
+
command='kaiten --json time-logs create --card-id 10 --time-spent 15 --comment "Analysis"',
|
|
296
|
+
description="Create a time log entry.",
|
|
297
|
+
),
|
|
298
|
+
),
|
|
299
|
+
),
|
|
300
|
+
make_tool(
|
|
301
|
+
canonical_name="time-logs.update",
|
|
302
|
+
mcp_alias="kaiten_update_time_log",
|
|
303
|
+
description="Update a time log entry on a card (author only).",
|
|
304
|
+
input_schema={
|
|
305
|
+
"type": "object",
|
|
306
|
+
"properties": {
|
|
307
|
+
"card_id": {"type": "integer", "description": "ID of the card."},
|
|
308
|
+
"time_log_id": {"type": "integer", "description": "ID of the time log to update."},
|
|
309
|
+
"time_spent": {"type": "integer", "description": "Updated time spent in minutes."},
|
|
310
|
+
"role_id": {"type": "integer", "description": "Updated role ID."},
|
|
311
|
+
"comment": {"type": "string", "description": "Updated comment."},
|
|
312
|
+
"for_date": {"type": "string", "description": "Updated date (YYYY-MM-DD)."},
|
|
313
|
+
},
|
|
314
|
+
"required": ["card_id", "time_log_id"],
|
|
315
|
+
},
|
|
316
|
+
operation=OperationSpec(
|
|
317
|
+
method="PATCH",
|
|
318
|
+
path_template="/cards/{card_id}/time-logs/{time_log_id}",
|
|
319
|
+
path_fields=("card_id", "time_log_id"),
|
|
320
|
+
body_fields=("time_spent", "role_id", "comment", "for_date"),
|
|
321
|
+
),
|
|
322
|
+
examples=(
|
|
323
|
+
ExampleSpec(
|
|
324
|
+
command="kaiten --json time-logs update --card-id 10 --time-log-id 20 --time-spent 20",
|
|
325
|
+
description="Update a time log.",
|
|
326
|
+
),
|
|
327
|
+
),
|
|
328
|
+
),
|
|
329
|
+
make_tool(
|
|
330
|
+
canonical_name="time-logs.delete",
|
|
331
|
+
mcp_alias="kaiten_delete_time_log",
|
|
332
|
+
description="Delete a time log entry from a card (author only).",
|
|
333
|
+
input_schema={
|
|
334
|
+
"type": "object",
|
|
335
|
+
"properties": {
|
|
336
|
+
"card_id": {"type": "integer", "description": "ID of the card."},
|
|
337
|
+
"time_log_id": {"type": "integer", "description": "ID of the time log to delete."},
|
|
338
|
+
},
|
|
339
|
+
"required": ["card_id", "time_log_id"],
|
|
340
|
+
},
|
|
341
|
+
operation=OperationSpec(
|
|
342
|
+
method="DELETE",
|
|
343
|
+
path_template="/cards/{card_id}/time-logs/{time_log_id}",
|
|
344
|
+
path_fields=("card_id", "time_log_id"),
|
|
345
|
+
),
|
|
346
|
+
examples=(
|
|
347
|
+
ExampleSpec(
|
|
348
|
+
command="kaiten --json time-logs delete --card-id 10 --time-log-id 20",
|
|
349
|
+
description="Delete a time log.",
|
|
350
|
+
),
|
|
351
|
+
),
|
|
352
|
+
),
|
|
353
|
+
)
|