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,352 @@
|
|
|
1
|
+
"""Tree navigation tool specs."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from kaiten_cli.models import (
|
|
6
|
+
CACHE_POLICY_REQUEST_SCOPE,
|
|
7
|
+
ExampleSpec,
|
|
8
|
+
OperationSpec,
|
|
9
|
+
ResponsePolicy,
|
|
10
|
+
RuntimeBehavior,
|
|
11
|
+
)
|
|
12
|
+
from kaiten_cli.registry.base import make_tool
|
|
13
|
+
from kaiten_cli.runtime.behaviors import execute_tree_children_list, execute_tree_get
|
|
14
|
+
from kaiten_cli.runtime.support.tree_sharing import (
|
|
15
|
+
execute_tree_entity_share_batch_enable,
|
|
16
|
+
execute_tree_entity_share_batch_get,
|
|
17
|
+
execute_tree_entity_share_disable,
|
|
18
|
+
execute_tree_entity_share_enable,
|
|
19
|
+
execute_tree_entity_share_get,
|
|
20
|
+
execute_tree_entity_share_update,
|
|
21
|
+
validate_tree_entity_share_batch_payload,
|
|
22
|
+
validate_tree_entity_share_payload,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
TREE_CATALOG_USAGE_NOTES = (
|
|
26
|
+
"This aggregated command builds its local catalog from `/spaces`, `/documents`, and `/document-groups`.",
|
|
27
|
+
"Here `catalog` means an internal fetched entity index for tree assembly, not UI catalog tables (`custom-directories`) and not `custom-properties catalog-values`.",
|
|
28
|
+
"Use `document-groups.*` to create, update, or delete document folder containers; tree commands are read-only aggregate views.",
|
|
29
|
+
"`/spaces`, `/documents`, and `/document-groups` are paginated internally with `limit=100` and `offset=0,100,...` until a short page is returned.",
|
|
30
|
+
"Legacy endpoints that ignore pagination are accepted when the first page is oversized or the second page is identical; duplicate rows are not appended.",
|
|
31
|
+
"No pagination options are required or accepted for this command; callers control only `parent_entity_uid` for children listing or `root_uid`/`depth` for nested tree output.",
|
|
32
|
+
"If the internal pagination safety cap is reached with full pages, the command fails instead of returning a silently truncated tree.",
|
|
33
|
+
"Visible entities whose `parent_entity_uid` is missing or inaccessible in the fetched catalog are promoted to root-level output.",
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
TREE_ENTITY_SHARE_USAGE_NOTES = (
|
|
37
|
+
"The share UID returned by Kaiten is converted into a ready-to-use public link at `<profile-origin>/p/<share-uid>`.",
|
|
38
|
+
"GET works for already published entities and requires read access; enable, update, and disable require the entity share permission.",
|
|
39
|
+
"Supported tree entity types are spaces, documents, document groups, and story maps.",
|
|
40
|
+
"This is shared-entity publication, not the legacy document `public` field or knowledge-base public-site publishing.",
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
ENTITY_UID_PROPERTY = {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "Tree entity UUID for a space, document, document group, or story map.",
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
EXPIRED_AT_PROPERTY = {
|
|
49
|
+
"type": ["string", "null"],
|
|
50
|
+
"description": "Future ISO-8601 expiration timestamp; pass null to remove expiration.",
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
ENTITY_UIDS_PROPERTY = {
|
|
54
|
+
"type": "array",
|
|
55
|
+
"items": {"type": "string"},
|
|
56
|
+
"description": "Explicit tree entity UUIDs to process in input order.",
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
WORKERS_PROPERTY = {
|
|
60
|
+
"type": "integer",
|
|
61
|
+
"description": "Parallel workers (default 2, max 6).",
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
EXAMPLE_ENTITY_UID = "11111111-1111-4111-8111-111111111111"
|
|
65
|
+
EXAMPLE_SECOND_ENTITY_UID = "22222222-2222-4222-8222-222222222222"
|
|
66
|
+
EXAMPLE_EXPIRED_AT = "2099-01-01T00:00:00Z"
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
TOOLS = (
|
|
70
|
+
make_tool(
|
|
71
|
+
canonical_name="tree-entities.list",
|
|
72
|
+
mcp_alias="kaiten_list_tree_entities",
|
|
73
|
+
description="List tree entities from Kaiten.",
|
|
74
|
+
input_schema={
|
|
75
|
+
"type": "object",
|
|
76
|
+
"properties": {
|
|
77
|
+
"query": {"type": "string", "description": "Search query."},
|
|
78
|
+
"limit": {"type": "integer", "description": "Max results."},
|
|
79
|
+
"offset": {"type": "integer", "description": "Pagination offset."},
|
|
80
|
+
"parent_entity_uid": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"description": "Get entities that are nested in entity with desired uid",
|
|
83
|
+
},
|
|
84
|
+
"levels_count": {
|
|
85
|
+
"type": "number",
|
|
86
|
+
"description": "Max depth level",
|
|
87
|
+
"x-documentation-constraints": "max: 2",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
operation=OperationSpec(
|
|
92
|
+
method="GET",
|
|
93
|
+
path_template="/tree-entities",
|
|
94
|
+
query_fields=("query", "limit", "offset", "parent_entity_uid", "levels_count"),
|
|
95
|
+
),
|
|
96
|
+
response_policy=ResponsePolicy(default_limit=50, result_kind="list"),
|
|
97
|
+
examples=(
|
|
98
|
+
ExampleSpec(
|
|
99
|
+
command="kaiten --json tree-entities list", description="List tree entities."
|
|
100
|
+
),
|
|
101
|
+
),
|
|
102
|
+
),
|
|
103
|
+
make_tool(
|
|
104
|
+
canonical_name="tree-entities.share.get",
|
|
105
|
+
mcp_alias="kaiten_get_tree_entity_share",
|
|
106
|
+
description="Get the public sharing state and ready-to-use public link for a tree entity.",
|
|
107
|
+
input_schema={
|
|
108
|
+
"type": "object",
|
|
109
|
+
"properties": {"entity_uid": ENTITY_UID_PROPERTY},
|
|
110
|
+
"required": ["entity_uid"],
|
|
111
|
+
},
|
|
112
|
+
operation=OperationSpec(
|
|
113
|
+
method="GET",
|
|
114
|
+
path_template="/tree-entities/{entity_uid}/share",
|
|
115
|
+
path_fields=("entity_uid",),
|
|
116
|
+
),
|
|
117
|
+
runtime_behavior=RuntimeBehavior(
|
|
118
|
+
execution_mode="custom",
|
|
119
|
+
custom_executor=execute_tree_entity_share_get,
|
|
120
|
+
payload_validator=validate_tree_entity_share_payload,
|
|
121
|
+
cache_policy=CACHE_POLICY_REQUEST_SCOPE,
|
|
122
|
+
),
|
|
123
|
+
examples=(
|
|
124
|
+
ExampleSpec(
|
|
125
|
+
command=f"kaiten --json tree-entities share get --entity-uid {EXAMPLE_ENTITY_UID}",
|
|
126
|
+
description="Get an existing public link without changing sharing state.",
|
|
127
|
+
),
|
|
128
|
+
),
|
|
129
|
+
usage_notes=TREE_ENTITY_SHARE_USAGE_NOTES,
|
|
130
|
+
bulk_alternative="tree-entities.share.batch-get",
|
|
131
|
+
),
|
|
132
|
+
make_tool(
|
|
133
|
+
canonical_name="tree-entities.share.enable",
|
|
134
|
+
mcp_alias="kaiten_enable_tree_entity_share",
|
|
135
|
+
description="Idempotently enable a public link for a tree entity.",
|
|
136
|
+
input_schema={
|
|
137
|
+
"type": "object",
|
|
138
|
+
"properties": {
|
|
139
|
+
"entity_uid": ENTITY_UID_PROPERTY,
|
|
140
|
+
"expired_at": EXPIRED_AT_PROPERTY,
|
|
141
|
+
},
|
|
142
|
+
"required": ["entity_uid"],
|
|
143
|
+
},
|
|
144
|
+
operation=OperationSpec(
|
|
145
|
+
method="POST",
|
|
146
|
+
path_template="/tree-entities/{entity_uid}/share",
|
|
147
|
+
path_fields=("entity_uid",),
|
|
148
|
+
body_fields=("expired_at",),
|
|
149
|
+
),
|
|
150
|
+
runtime_behavior=RuntimeBehavior(
|
|
151
|
+
execution_mode="custom",
|
|
152
|
+
custom_executor=execute_tree_entity_share_enable,
|
|
153
|
+
payload_validator=validate_tree_entity_share_payload,
|
|
154
|
+
),
|
|
155
|
+
examples=(
|
|
156
|
+
ExampleSpec(
|
|
157
|
+
command=f"kaiten --json tree-entities share enable --entity-uid {EXAMPLE_ENTITY_UID}",
|
|
158
|
+
description="Enable sharing and return the public link.",
|
|
159
|
+
),
|
|
160
|
+
ExampleSpec(
|
|
161
|
+
command=f'kaiten --json tree-entities share enable --entity-uid {EXAMPLE_ENTITY_UID} --expired-at "{EXAMPLE_EXPIRED_AT}"',
|
|
162
|
+
description="Enable sharing with an expiration timestamp.",
|
|
163
|
+
),
|
|
164
|
+
),
|
|
165
|
+
usage_notes=(
|
|
166
|
+
*TREE_ENTITY_SHARE_USAGE_NOTES,
|
|
167
|
+
"Repeated execution is safe: active shares are returned unchanged, while disabled or expired shares are reactivated using the existing share UID.",
|
|
168
|
+
),
|
|
169
|
+
bulk_alternative="tree-entities.share.batch-enable",
|
|
170
|
+
),
|
|
171
|
+
make_tool(
|
|
172
|
+
canonical_name="tree-entities.share.update",
|
|
173
|
+
mcp_alias="kaiten_update_tree_entity_share",
|
|
174
|
+
description="Idempotently set or clear a tree entity public-link expiration.",
|
|
175
|
+
input_schema={
|
|
176
|
+
"type": "object",
|
|
177
|
+
"properties": {
|
|
178
|
+
"entity_uid": ENTITY_UID_PROPERTY,
|
|
179
|
+
"expired_at": EXPIRED_AT_PROPERTY,
|
|
180
|
+
},
|
|
181
|
+
"required": ["entity_uid", "expired_at"],
|
|
182
|
+
},
|
|
183
|
+
operation=OperationSpec(
|
|
184
|
+
method="PATCH",
|
|
185
|
+
path_template="/tree-entities/{entity_uid}/share",
|
|
186
|
+
path_fields=("entity_uid",),
|
|
187
|
+
body_fields=("expired_at",),
|
|
188
|
+
),
|
|
189
|
+
runtime_behavior=RuntimeBehavior(
|
|
190
|
+
execution_mode="custom",
|
|
191
|
+
custom_executor=execute_tree_entity_share_update,
|
|
192
|
+
payload_validator=validate_tree_entity_share_payload,
|
|
193
|
+
),
|
|
194
|
+
examples=(
|
|
195
|
+
ExampleSpec(
|
|
196
|
+
command=f'kaiten --json tree-entities share update --entity-uid {EXAMPLE_ENTITY_UID} --expired-at "{EXAMPLE_EXPIRED_AT}"',
|
|
197
|
+
description="Set a public-link expiration timestamp.",
|
|
198
|
+
),
|
|
199
|
+
ExampleSpec(
|
|
200
|
+
command=f"kaiten --json tree-entities share update --entity-uid {EXAMPLE_ENTITY_UID} --expired-at null",
|
|
201
|
+
description="Remove the public-link expiration timestamp.",
|
|
202
|
+
),
|
|
203
|
+
),
|
|
204
|
+
usage_notes=TREE_ENTITY_SHARE_USAGE_NOTES,
|
|
205
|
+
),
|
|
206
|
+
make_tool(
|
|
207
|
+
canonical_name="tree-entities.share.disable",
|
|
208
|
+
mcp_alias="kaiten_disable_tree_entity_share",
|
|
209
|
+
description="Idempotently disable a tree entity public link.",
|
|
210
|
+
input_schema={
|
|
211
|
+
"type": "object",
|
|
212
|
+
"properties": {"entity_uid": ENTITY_UID_PROPERTY},
|
|
213
|
+
"required": ["entity_uid"],
|
|
214
|
+
},
|
|
215
|
+
operation=OperationSpec(
|
|
216
|
+
method="DELETE",
|
|
217
|
+
path_template="/tree-entities/{entity_uid}/share",
|
|
218
|
+
path_fields=("entity_uid",),
|
|
219
|
+
),
|
|
220
|
+
runtime_behavior=RuntimeBehavior(
|
|
221
|
+
execution_mode="custom",
|
|
222
|
+
custom_executor=execute_tree_entity_share_disable,
|
|
223
|
+
payload_validator=validate_tree_entity_share_payload,
|
|
224
|
+
),
|
|
225
|
+
examples=(
|
|
226
|
+
ExampleSpec(
|
|
227
|
+
command=f"kaiten --json tree-entities share disable --entity-uid {EXAMPLE_ENTITY_UID}",
|
|
228
|
+
description="Disable a public link without failing when it is already disabled.",
|
|
229
|
+
),
|
|
230
|
+
),
|
|
231
|
+
usage_notes=TREE_ENTITY_SHARE_USAGE_NOTES,
|
|
232
|
+
),
|
|
233
|
+
make_tool(
|
|
234
|
+
canonical_name="tree-entities.share.batch-get",
|
|
235
|
+
mcp_alias="kaiten_batch_get_tree_entity_shares",
|
|
236
|
+
description="Get public sharing states and links for explicit tree entity UUIDs.",
|
|
237
|
+
input_schema={
|
|
238
|
+
"type": "object",
|
|
239
|
+
"properties": {
|
|
240
|
+
"entity_uids": ENTITY_UIDS_PROPERTY,
|
|
241
|
+
"workers": WORKERS_PROPERTY,
|
|
242
|
+
},
|
|
243
|
+
"required": ["entity_uids"],
|
|
244
|
+
},
|
|
245
|
+
operation=OperationSpec(method="GET", path_template="/tree-entities/share/batch"),
|
|
246
|
+
response_policy=ResponsePolicy(heavy=True, result_kind="entity"),
|
|
247
|
+
runtime_behavior=RuntimeBehavior(
|
|
248
|
+
execution_mode="aggregated",
|
|
249
|
+
custom_executor=execute_tree_entity_share_batch_get,
|
|
250
|
+
payload_validator=validate_tree_entity_share_batch_payload,
|
|
251
|
+
cache_policy=CACHE_POLICY_REQUEST_SCOPE,
|
|
252
|
+
),
|
|
253
|
+
examples=(
|
|
254
|
+
ExampleSpec(
|
|
255
|
+
command=f'kaiten --json tree-entities share batch-get --entity-uids \'["{EXAMPLE_ENTITY_UID}","{EXAMPLE_SECOND_ENTITY_UID}"]\'',
|
|
256
|
+
description="Get public links for several entities with bounded concurrency.",
|
|
257
|
+
),
|
|
258
|
+
),
|
|
259
|
+
usage_notes=(
|
|
260
|
+
*TREE_ENTITY_SHARE_USAGE_NOTES,
|
|
261
|
+
"The command deduplicates UUIDs, preserves first-seen order, and returns per-entity errors without hiding successful links.",
|
|
262
|
+
),
|
|
263
|
+
),
|
|
264
|
+
make_tool(
|
|
265
|
+
canonical_name="tree-entities.share.batch-enable",
|
|
266
|
+
mcp_alias="kaiten_batch_enable_tree_entity_shares",
|
|
267
|
+
description="Idempotently enable public links for explicit tree entity UUIDs.",
|
|
268
|
+
input_schema={
|
|
269
|
+
"type": "object",
|
|
270
|
+
"properties": {
|
|
271
|
+
"entity_uids": ENTITY_UIDS_PROPERTY,
|
|
272
|
+
"expired_at": EXPIRED_AT_PROPERTY,
|
|
273
|
+
"workers": WORKERS_PROPERTY,
|
|
274
|
+
},
|
|
275
|
+
"required": ["entity_uids"],
|
|
276
|
+
},
|
|
277
|
+
operation=OperationSpec(method="POST", path_template="/tree-entities/share/batch"),
|
|
278
|
+
response_policy=ResponsePolicy(heavy=True, result_kind="entity"),
|
|
279
|
+
runtime_behavior=RuntimeBehavior(
|
|
280
|
+
execution_mode="aggregated",
|
|
281
|
+
custom_executor=execute_tree_entity_share_batch_enable,
|
|
282
|
+
payload_validator=validate_tree_entity_share_batch_payload,
|
|
283
|
+
),
|
|
284
|
+
examples=(
|
|
285
|
+
ExampleSpec(
|
|
286
|
+
command=f'kaiten --json tree-entities share batch-enable --entity-uids \'["{EXAMPLE_ENTITY_UID}","{EXAMPLE_SECOND_ENTITY_UID}"]\' --workers 2',
|
|
287
|
+
description="Publish several entities and return every public link.",
|
|
288
|
+
),
|
|
289
|
+
),
|
|
290
|
+
usage_notes=(
|
|
291
|
+
*TREE_ENTITY_SHARE_USAGE_NOTES,
|
|
292
|
+
"Only explicit entity UUIDs are accepted; the command does not publish an inferred query result or subtree.",
|
|
293
|
+
"The result contains ordered items, per-entity errors, and changed/unchanged counters so partial failures remain visible and reruns stay safe.",
|
|
294
|
+
),
|
|
295
|
+
),
|
|
296
|
+
make_tool(
|
|
297
|
+
canonical_name="tree.children.list",
|
|
298
|
+
mcp_alias="kaiten_list_children",
|
|
299
|
+
description="List direct children of an entity in the Kaiten sidebar tree.",
|
|
300
|
+
input_schema={
|
|
301
|
+
"type": "object",
|
|
302
|
+
"properties": {
|
|
303
|
+
"parent_entity_uid": {
|
|
304
|
+
"type": "string",
|
|
305
|
+
"description": "Parent entity UID. Omit to list root-level entities.",
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
operation=OperationSpec(method="GET", path_template="/tree/children"),
|
|
310
|
+
response_policy=ResponsePolicy(heavy=True, result_kind="list"),
|
|
311
|
+
runtime_behavior=RuntimeBehavior(
|
|
312
|
+
execution_mode="aggregated", custom_executor=execute_tree_children_list
|
|
313
|
+
),
|
|
314
|
+
examples=(
|
|
315
|
+
ExampleSpec(
|
|
316
|
+
command="kaiten --json tree children list --parent-entity-uid root-1",
|
|
317
|
+
description="List direct tree children.",
|
|
318
|
+
),
|
|
319
|
+
),
|
|
320
|
+
usage_notes=TREE_CATALOG_USAGE_NOTES,
|
|
321
|
+
),
|
|
322
|
+
make_tool(
|
|
323
|
+
canonical_name="tree.get",
|
|
324
|
+
mcp_alias="kaiten_get_tree",
|
|
325
|
+
description="Build a nested entity tree from the Kaiten sidebar.",
|
|
326
|
+
input_schema={
|
|
327
|
+
"type": "object",
|
|
328
|
+
"properties": {
|
|
329
|
+
"root_uid": {
|
|
330
|
+
"type": "string",
|
|
331
|
+
"description": "Start tree from this entity UID. Omit for full tree from roots.",
|
|
332
|
+
},
|
|
333
|
+
"depth": {
|
|
334
|
+
"type": "integer",
|
|
335
|
+
"description": "Max recursion depth (0 = unlimited). Default: 0.",
|
|
336
|
+
},
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
operation=OperationSpec(method="GET", path_template="/tree"),
|
|
340
|
+
response_policy=ResponsePolicy(heavy=True, result_kind="list"),
|
|
341
|
+
runtime_behavior=RuntimeBehavior(
|
|
342
|
+
execution_mode="aggregated", custom_executor=execute_tree_get
|
|
343
|
+
),
|
|
344
|
+
examples=(
|
|
345
|
+
ExampleSpec(
|
|
346
|
+
command="kaiten --json tree get --depth 1",
|
|
347
|
+
description="Build a bounded entity tree.",
|
|
348
|
+
),
|
|
349
|
+
),
|
|
350
|
+
usage_notes=TREE_CATALOG_USAGE_NOTES,
|
|
351
|
+
),
|
|
352
|
+
)
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"""Utility 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="api-keys.list",
|
|
13
|
+
mcp_alias="kaiten_list_api_keys",
|
|
14
|
+
description="List all API keys for the current user.",
|
|
15
|
+
input_schema={"type": "object", "properties": {}},
|
|
16
|
+
operation=OperationSpec(method="GET", path_template="/api-keys"),
|
|
17
|
+
examples=(
|
|
18
|
+
ExampleSpec(command="kaiten --json api-keys list", description="List API keys."),
|
|
19
|
+
),
|
|
20
|
+
),
|
|
21
|
+
make_tool(
|
|
22
|
+
canonical_name="api-keys.create",
|
|
23
|
+
mcp_alias="kaiten_create_api_key",
|
|
24
|
+
description="Create a new API key.",
|
|
25
|
+
input_schema={
|
|
26
|
+
"type": "object",
|
|
27
|
+
"properties": {
|
|
28
|
+
"name": {"type": "string", "description": "Name for the API key"},
|
|
29
|
+
},
|
|
30
|
+
"required": ["name"],
|
|
31
|
+
},
|
|
32
|
+
operation=OperationSpec(method="POST", path_template="/api-keys", body_fields=("name",)),
|
|
33
|
+
examples=(
|
|
34
|
+
ExampleSpec(
|
|
35
|
+
command='kaiten --json api-keys create --name "local-dev"',
|
|
36
|
+
description="Create an API key.",
|
|
37
|
+
),
|
|
38
|
+
),
|
|
39
|
+
),
|
|
40
|
+
make_tool(
|
|
41
|
+
canonical_name="api-keys.delete",
|
|
42
|
+
mcp_alias="kaiten_delete_api_key",
|
|
43
|
+
description="Delete an API key.",
|
|
44
|
+
input_schema={
|
|
45
|
+
"type": "object",
|
|
46
|
+
"properties": {
|
|
47
|
+
"key_id": {"type": "integer", "description": "API key ID"},
|
|
48
|
+
},
|
|
49
|
+
"required": ["key_id"],
|
|
50
|
+
},
|
|
51
|
+
operation=OperationSpec(
|
|
52
|
+
method="DELETE", path_template="/api-keys/{key_id}", path_fields=("key_id",)
|
|
53
|
+
),
|
|
54
|
+
examples=(
|
|
55
|
+
ExampleSpec(
|
|
56
|
+
command="kaiten --json api-keys delete --key-id 1", description="Delete an API key."
|
|
57
|
+
),
|
|
58
|
+
),
|
|
59
|
+
),
|
|
60
|
+
make_tool(
|
|
61
|
+
canonical_name="company.current",
|
|
62
|
+
mcp_alias="kaiten_get_company",
|
|
63
|
+
description="Get current company information.",
|
|
64
|
+
input_schema={"type": "object", "properties": {}},
|
|
65
|
+
operation=OperationSpec(method="GET", path_template="/companies/current"),
|
|
66
|
+
examples=(
|
|
67
|
+
ExampleSpec(
|
|
68
|
+
command="kaiten --json company current",
|
|
69
|
+
description="Get current company information.",
|
|
70
|
+
),
|
|
71
|
+
),
|
|
72
|
+
),
|
|
73
|
+
make_tool(
|
|
74
|
+
canonical_name="company.socket-token",
|
|
75
|
+
mcp_alias="kaiten_get_company_socket_token",
|
|
76
|
+
description="Get a websocket JWT for the current user.",
|
|
77
|
+
input_schema={"type": "object", "properties": {}},
|
|
78
|
+
operation=OperationSpec(method="GET", path_template="/token-please"),
|
|
79
|
+
examples=(
|
|
80
|
+
ExampleSpec(
|
|
81
|
+
command="kaiten --json company socket-token", description="Get a websocket JWT."
|
|
82
|
+
),
|
|
83
|
+
),
|
|
84
|
+
),
|
|
85
|
+
make_tool(
|
|
86
|
+
canonical_name="company.update",
|
|
87
|
+
mcp_alias="kaiten_update_company",
|
|
88
|
+
description="Update current company information.",
|
|
89
|
+
input_schema={
|
|
90
|
+
"type": "object",
|
|
91
|
+
"properties": {
|
|
92
|
+
"name": {"type": "string", "description": "Company name"},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
operation=OperationSpec(
|
|
96
|
+
method="PATCH", path_template="/companies/current", body_fields=("name",)
|
|
97
|
+
),
|
|
98
|
+
examples=(
|
|
99
|
+
ExampleSpec(
|
|
100
|
+
command='kaiten --json company update --name "Acme"',
|
|
101
|
+
description="Update current company information.",
|
|
102
|
+
),
|
|
103
|
+
),
|
|
104
|
+
),
|
|
105
|
+
make_tool(
|
|
106
|
+
canonical_name="calendars.list",
|
|
107
|
+
mcp_alias="kaiten_list_calendars",
|
|
108
|
+
description="List calendars.",
|
|
109
|
+
input_schema={
|
|
110
|
+
"type": "object",
|
|
111
|
+
"properties": {
|
|
112
|
+
"limit": {"type": "integer", "description": "Max results"},
|
|
113
|
+
"offset": {"type": "integer", "description": "Pagination offset"},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
operation=OperationSpec(
|
|
117
|
+
method="GET", path_template="/calendars", query_fields=("limit", "offset")
|
|
118
|
+
),
|
|
119
|
+
response_policy=ResponsePolicy(default_limit=DEFAULT_LIMIT, result_kind="list"),
|
|
120
|
+
examples=(
|
|
121
|
+
ExampleSpec(
|
|
122
|
+
command="kaiten --json calendars list --limit 5", description="List calendars."
|
|
123
|
+
),
|
|
124
|
+
),
|
|
125
|
+
),
|
|
126
|
+
make_tool(
|
|
127
|
+
canonical_name="calendars.get",
|
|
128
|
+
mcp_alias="kaiten_get_calendar",
|
|
129
|
+
description="Get a specific calendar by ID.",
|
|
130
|
+
input_schema={
|
|
131
|
+
"type": "object",
|
|
132
|
+
"properties": {
|
|
133
|
+
"calendar_id": {"type": "string", "description": "Calendar ID (UUID)"},
|
|
134
|
+
},
|
|
135
|
+
"required": ["calendar_id"],
|
|
136
|
+
},
|
|
137
|
+
operation=OperationSpec(
|
|
138
|
+
method="GET", path_template="/calendars/{calendar_id}", path_fields=("calendar_id",)
|
|
139
|
+
),
|
|
140
|
+
examples=(
|
|
141
|
+
ExampleSpec(
|
|
142
|
+
command="kaiten --json calendars get --calendar-id cal-1",
|
|
143
|
+
description="Get a calendar by ID.",
|
|
144
|
+
),
|
|
145
|
+
),
|
|
146
|
+
),
|
|
147
|
+
make_tool(
|
|
148
|
+
canonical_name="removed-cards.list",
|
|
149
|
+
mcp_alias="kaiten_list_removed_cards",
|
|
150
|
+
description="List removed cards from the recycle bin.",
|
|
151
|
+
input_schema={
|
|
152
|
+
"type": "object",
|
|
153
|
+
"properties": {
|
|
154
|
+
"limit": {"type": "integer", "description": "Max results"},
|
|
155
|
+
"offset": {"type": "integer", "description": "Pagination offset"},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
operation=OperationSpec(
|
|
159
|
+
method="GET", path_template="/removed/cards", query_fields=("limit", "offset")
|
|
160
|
+
),
|
|
161
|
+
response_policy=ResponsePolicy(default_limit=DEFAULT_LIMIT, result_kind="list"),
|
|
162
|
+
examples=(
|
|
163
|
+
ExampleSpec(
|
|
164
|
+
command="kaiten --json removed-cards list", description="List removed cards."
|
|
165
|
+
),
|
|
166
|
+
),
|
|
167
|
+
),
|
|
168
|
+
make_tool(
|
|
169
|
+
canonical_name="removed-boards.list",
|
|
170
|
+
mcp_alias="kaiten_list_removed_boards",
|
|
171
|
+
description="List removed boards from the recycle bin.",
|
|
172
|
+
input_schema={
|
|
173
|
+
"type": "object",
|
|
174
|
+
"properties": {
|
|
175
|
+
"limit": {"type": "integer", "description": "Max results"},
|
|
176
|
+
"offset": {"type": "integer", "description": "Pagination offset"},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
operation=OperationSpec(
|
|
180
|
+
method="GET", path_template="/removed/boards", query_fields=("limit", "offset")
|
|
181
|
+
),
|
|
182
|
+
response_policy=ResponsePolicy(default_limit=DEFAULT_LIMIT, result_kind="list"),
|
|
183
|
+
examples=(
|
|
184
|
+
ExampleSpec(
|
|
185
|
+
command="kaiten --json removed-boards list", description="List removed boards."
|
|
186
|
+
),
|
|
187
|
+
),
|
|
188
|
+
),
|
|
189
|
+
make_tool(
|
|
190
|
+
canonical_name="user-timers.list",
|
|
191
|
+
mcp_alias="kaiten_list_user_timers",
|
|
192
|
+
description="List all user timers.",
|
|
193
|
+
input_schema={"type": "object", "properties": {}},
|
|
194
|
+
operation=OperationSpec(method="GET", path_template="/user-timers"),
|
|
195
|
+
examples=(
|
|
196
|
+
ExampleSpec(command="kaiten --json user-timers list", description="List user timers."),
|
|
197
|
+
),
|
|
198
|
+
),
|
|
199
|
+
make_tool(
|
|
200
|
+
canonical_name="user-timers.create",
|
|
201
|
+
mcp_alias="kaiten_create_user_timer",
|
|
202
|
+
description="Create a new user timer for a card.",
|
|
203
|
+
input_schema={
|
|
204
|
+
"type": "object",
|
|
205
|
+
"properties": {
|
|
206
|
+
"card_id": {"type": "integer", "description": "Card ID to start timer for"},
|
|
207
|
+
},
|
|
208
|
+
"required": ["card_id"],
|
|
209
|
+
},
|
|
210
|
+
operation=OperationSpec(
|
|
211
|
+
method="POST", path_template="/user-timers", body_fields=("card_id",)
|
|
212
|
+
),
|
|
213
|
+
examples=(
|
|
214
|
+
ExampleSpec(
|
|
215
|
+
command="kaiten --json user-timers create --card-id 10",
|
|
216
|
+
description="Create a user timer.",
|
|
217
|
+
),
|
|
218
|
+
),
|
|
219
|
+
),
|
|
220
|
+
make_tool(
|
|
221
|
+
canonical_name="user-timers.get",
|
|
222
|
+
mcp_alias="kaiten_get_user_timer",
|
|
223
|
+
description="Get a specific user timer by ID.",
|
|
224
|
+
input_schema={
|
|
225
|
+
"type": "object",
|
|
226
|
+
"properties": {
|
|
227
|
+
"timer_id": {"type": "integer", "description": "Timer ID"},
|
|
228
|
+
},
|
|
229
|
+
"required": ["timer_id"],
|
|
230
|
+
},
|
|
231
|
+
operation=OperationSpec(
|
|
232
|
+
method="GET", path_template="/user-timers/{timer_id}", path_fields=("timer_id",)
|
|
233
|
+
),
|
|
234
|
+
examples=(
|
|
235
|
+
ExampleSpec(
|
|
236
|
+
command="kaiten --json user-timers get --timer-id 10",
|
|
237
|
+
description="Get a user timer.",
|
|
238
|
+
),
|
|
239
|
+
),
|
|
240
|
+
),
|
|
241
|
+
make_tool(
|
|
242
|
+
canonical_name="user-timers.update",
|
|
243
|
+
mcp_alias="kaiten_update_user_timer",
|
|
244
|
+
description="Update a user timer (e.g. pause or resume).",
|
|
245
|
+
input_schema={
|
|
246
|
+
"type": "object",
|
|
247
|
+
"properties": {
|
|
248
|
+
"timer_id": {"type": "integer", "description": "Timer ID"},
|
|
249
|
+
"paused": {"type": "boolean", "description": "Whether the timer is paused"},
|
|
250
|
+
},
|
|
251
|
+
"required": ["timer_id"],
|
|
252
|
+
},
|
|
253
|
+
operation=OperationSpec(
|
|
254
|
+
method="PATCH",
|
|
255
|
+
path_template="/user-timers/{timer_id}",
|
|
256
|
+
path_fields=("timer_id",),
|
|
257
|
+
body_fields=("paused",),
|
|
258
|
+
),
|
|
259
|
+
examples=(
|
|
260
|
+
ExampleSpec(
|
|
261
|
+
command="kaiten --json user-timers update --timer-id 10 --paused",
|
|
262
|
+
description="Pause a user timer.",
|
|
263
|
+
),
|
|
264
|
+
),
|
|
265
|
+
),
|
|
266
|
+
make_tool(
|
|
267
|
+
canonical_name="user-timers.delete",
|
|
268
|
+
mcp_alias="kaiten_delete_user_timer",
|
|
269
|
+
description="Delete a user timer.",
|
|
270
|
+
input_schema={
|
|
271
|
+
"type": "object",
|
|
272
|
+
"properties": {
|
|
273
|
+
"timer_id": {"type": "integer", "description": "Timer ID"},
|
|
274
|
+
},
|
|
275
|
+
"required": ["timer_id"],
|
|
276
|
+
},
|
|
277
|
+
operation=OperationSpec(
|
|
278
|
+
method="DELETE", path_template="/user-timers/{timer_id}", path_fields=("timer_id",)
|
|
279
|
+
),
|
|
280
|
+
examples=(
|
|
281
|
+
ExampleSpec(
|
|
282
|
+
command="kaiten --json user-timers delete --timer-id 10",
|
|
283
|
+
description="Delete a user timer.",
|
|
284
|
+
),
|
|
285
|
+
),
|
|
286
|
+
),
|
|
287
|
+
)
|