@workel/mcp 0.1.0
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.
- package/README.md +152 -0
- package/dist/api/client.d.ts +126 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +313 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/errors.d.ts +142 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +262 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/mapping.d.ts +147 -0
- package/dist/api/mapping.d.ts.map +1 -0
- package/dist/api/mapping.js +248 -0
- package/dist/api/mapping.js.map +1 -0
- package/dist/api/redact.d.ts +54 -0
- package/dist/api/redact.d.ts.map +1 -0
- package/dist/api/redact.js +193 -0
- package/dist/api/redact.js.map +1 -0
- package/dist/api/types.d.ts +155 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +18 -0
- package/dist/api/types.js.map +1 -0
- package/dist/boot.d.ts +129 -0
- package/dist/boot.d.ts.map +1 -0
- package/dist/boot.js +245 -0
- package/dist/boot.js.map +1 -0
- package/dist/config.d.ts +24 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +77 -0
- package/dist/config.js.map +1 -0
- package/dist/doctor.d.ts +42 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +94 -0
- package/dist/doctor.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +66 -0
- package/dist/index.js.map +1 -0
- package/dist/output.d.ts +48 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +73 -0
- package/dist/output.js.map +1 -0
- package/dist/remote.d.ts +164 -0
- package/dist/remote.d.ts.map +1 -0
- package/dist/remote.js +456 -0
- package/dist/remote.js.map +1 -0
- package/dist/server.d.ts +34 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +59 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/conventions.d.ts +54 -0
- package/dist/tools/conventions.d.ts.map +1 -0
- package/dist/tools/conventions.js +71 -0
- package/dist/tools/conventions.js.map +1 -0
- package/dist/tools/createComment.d.ts +52 -0
- package/dist/tools/createComment.d.ts.map +1 -0
- package/dist/tools/createComment.js +99 -0
- package/dist/tools/createComment.js.map +1 -0
- package/dist/tools/createEvent.d.ts +63 -0
- package/dist/tools/createEvent.d.ts.map +1 -0
- package/dist/tools/createEvent.js +160 -0
- package/dist/tools/createEvent.js.map +1 -0
- package/dist/tools/createTask.d.ts +53 -0
- package/dist/tools/createTask.d.ts.map +1 -0
- package/dist/tools/createTask.js +136 -0
- package/dist/tools/createTask.js.map +1 -0
- package/dist/tools/defineTool.d.ts +76 -0
- package/dist/tools/defineTool.d.ts.map +1 -0
- package/dist/tools/defineTool.js +31 -0
- package/dist/tools/defineTool.js.map +1 -0
- package/dist/tools/index.d.ts +16 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +49 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/registration.d.ts +63 -0
- package/dist/tools/registration.d.ts.map +1 -0
- package/dist/tools/registration.js +95 -0
- package/dist/tools/registration.js.map +1 -0
- package/dist/tools/updateTask.d.ts +53 -0
- package/dist/tools/updateTask.d.ts.map +1 -0
- package/dist/tools/updateTask.js +119 -0
- package/dist/tools/updateTask.js.map +1 -0
- package/dist/tools/workel_events.d.ts +23 -0
- package/dist/tools/workel_events.d.ts.map +1 -0
- package/dist/tools/workel_events.js +60 -0
- package/dist/tools/workel_events.js.map +1 -0
- package/dist/tools/workel_members.d.ts +17 -0
- package/dist/tools/workel_members.d.ts.map +1 -0
- package/dist/tools/workel_members.js +46 -0
- package/dist/tools/workel_members.js.map +1 -0
- package/dist/tools/workel_project_columns.d.ts +13 -0
- package/dist/tools/workel_project_columns.d.ts.map +1 -0
- package/dist/tools/workel_project_columns.js +45 -0
- package/dist/tools/workel_project_columns.js.map +1 -0
- package/dist/tools/workel_projects.d.ts +20 -0
- package/dist/tools/workel_projects.d.ts.map +1 -0
- package/dist/tools/workel_projects.js +74 -0
- package/dist/tools/workel_projects.js.map +1 -0
- package/dist/tools/workel_task_comments.d.ts +21 -0
- package/dist/tools/workel_task_comments.d.ts.map +1 -0
- package/dist/tools/workel_task_comments.js +55 -0
- package/dist/tools/workel_task_comments.js.map +1 -0
- package/dist/tools/workel_tasks.d.ts +23 -0
- package/dist/tools/workel_tasks.d.ts.map +1 -0
- package/dist/tools/workel_tasks.js +104 -0
- package/dist/tools/workel_tasks.js.map +1 -0
- package/dist/tools/workel_whoami.d.ts +16 -0
- package/dist/tools/workel_whoami.d.ts.map +1 -0
- package/dist/tools/workel_whoami.js +36 -0
- package/dist/tools/workel_whoami.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +28 -0
- package/dist/version.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `workel_update_task` — `PATCH /tasks/{id}` (`write:tasks` scope).
|
|
4
|
+
*
|
|
5
|
+
* Registered only under the D5 double opt-in gate (`./registration.ts`);
|
|
6
|
+
* this module only declares `scope: 'write:tasks'`.
|
|
7
|
+
*
|
|
8
|
+
* PATCH semantics (verified against `UpdatePublicTaskRequest` and
|
|
9
|
+
* `TaskUpdateService`, backend/services/laravel-backend/app/{Http/Requests/PublicApi/V1/UpdatePublicTaskRequest,Services/TaskUpdateService}.php):
|
|
10
|
+
* a field OMITTED from the call is left untouched on the server; a field
|
|
11
|
+
* EXPLICITLY given as `null` clears it (e.g. `due_date: null` clears the due
|
|
12
|
+
* date, and the server's own orphan cleanup then also clears `due_time` if
|
|
13
|
+
* it was set — TaskUpdateService.php:72-77 — since a time with no day makes
|
|
14
|
+
* no sense). This tool builds the PATCH body by explicit
|
|
15
|
+
* `hasOwnProperty`-based presence check, one field at a time, rather than by
|
|
16
|
+
* dot-accessing a possibly-absent field into a new object literal — the
|
|
17
|
+
* latter would fabricate an `undefined` value for every omitted field, which
|
|
18
|
+
* only looks correct by accident (JSON.stringify happens to drop `undefined`
|
|
19
|
+
* values) rather than because the field was ever actually treated as absent.
|
|
20
|
+
* The wire rename itself (`title` -> `title_text`, `due_date` -> `end_date`,
|
|
21
|
+
* `due_time` -> `end_time`) happens ONLY in `../api/mapping.ts`'s
|
|
22
|
+
* `mapUpdateTaskToWire` — never re-implemented here.
|
|
23
|
+
*
|
|
24
|
+
* This tool CANNOT move a task between columns or projects, and CANNOT
|
|
25
|
+
* change its assignees: `card_id`, `project_id`, and `user_ids` are not
|
|
26
|
+
* declared by `UpdatePublicTaskRequest::rules()` at all, so there is no wire
|
|
27
|
+
* field to forward them through even if this tool's input schema offered
|
|
28
|
+
* them — moving/reassigning a task is a different endpoint's job, not yet
|
|
29
|
+
* exposed as a tool. `reminder_date` is likewise never exposed here even
|
|
30
|
+
* though the wire endpoint accepts it — see `../api/mapping.ts`'s
|
|
31
|
+
* file-level docblock (it is write-only over this API; there is no read
|
|
32
|
+
* endpoint that ever returns it, so exposing a field a caller can set but
|
|
33
|
+
* never read back would break read/write symmetry).
|
|
34
|
+
*
|
|
35
|
+
* IMPORTANT capability note, verified directly against
|
|
36
|
+
* `TasksController::update` vs. `TasksController::store`
|
|
37
|
+
* (backend/services/laravel-backend/app/Http/Controllers/Api/PublicApi/V1/TasksController.php):
|
|
38
|
+
* unlike `POST /tasks` — which requires `Permission::TASK_CREATE` on the
|
|
39
|
+
* TARGET project before creating (TasksController.php:244-252) —
|
|
40
|
+
* `PATCH /tasks/{id}` (TasksController.php:120-154) performs NO per-project
|
|
41
|
+
* permission re-check at all. It only re-resolves the task through the same
|
|
42
|
+
* visible-project chain `GET /tasks/{id}` already uses (bound workspace, not
|
|
43
|
+
* archived, not private, not the inbox project — `ChecksProjectVisibility`)
|
|
44
|
+
* — visibility, not project membership or role. A `write:tasks` key can
|
|
45
|
+
* therefore update ANY task in ANY visible project in its own workspace,
|
|
46
|
+
* regardless of whether the key's creator has any role or membership on
|
|
47
|
+
* that specific project — a `write:tasks` key is workspace-wide for
|
|
48
|
+
* updates, unlike task creation, which is project-scoped by the
|
|
49
|
+
* `TASK_CREATE` permission check above. This is a real capability shape of
|
|
50
|
+
* the underlying API, not something this tool works around.
|
|
51
|
+
*/
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.workelUpdateTask = void 0;
|
|
54
|
+
const zod_1 = require("zod");
|
|
55
|
+
const mapping_1 = require("../api/mapping");
|
|
56
|
+
const defineTool_1 = require("./defineTool");
|
|
57
|
+
const conventions_1 = require("./conventions");
|
|
58
|
+
const SCOPE = 'write:tasks';
|
|
59
|
+
const PRIORITY_VALUES = ['low', 'medium', 'high', 'urgent', 'none'];
|
|
60
|
+
const DESCRIPTION = 'Update fields on an existing task by id. Every field is optional: an OMITTED field is left ' +
|
|
61
|
+
'unchanged; a field EXPLICITLY set to null clears it (e.g. due_date: null clears the due date, ' +
|
|
62
|
+
'which also clears due_time if it was set — a time cannot outlive its day). This tool CANNOT move ' +
|
|
63
|
+
'a task to a different column or project, and CANNOT change its assignees — those are not accepted ' +
|
|
64
|
+
'by this endpoint at all; there is currently no tool for either. IMPORTANT: a write:tasks API key ' +
|
|
65
|
+
'can update ANY task in ANY project visible to its workspace, regardless of whether the key\'s ' +
|
|
66
|
+
"creator is actually a member of that specific project — this endpoint performs no per-project " +
|
|
67
|
+
'permission check the way task CREATION does. Treat this tool as workspace-wide for existing ' +
|
|
68
|
+
'tasks, not scoped to projects the key\'s creator personally belongs to. ' +
|
|
69
|
+
conventions_1.UNTRUSTED_CONTENT_NOTE;
|
|
70
|
+
function hasOwn(obj, key) {
|
|
71
|
+
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
72
|
+
}
|
|
73
|
+
const workelUpdateTask = (client) => (0, defineTool_1.defineTool)({
|
|
74
|
+
name: 'workel_update_task',
|
|
75
|
+
description: DESCRIPTION,
|
|
76
|
+
inputSchema: {
|
|
77
|
+
id: zod_1.z.string().min(1),
|
|
78
|
+
title: zod_1.z.string().nullable().optional(),
|
|
79
|
+
description: zod_1.z.string().nullable().optional(),
|
|
80
|
+
priority: zod_1.z.enum(PRIORITY_VALUES).nullable().optional(),
|
|
81
|
+
progress: zod_1.z.number().int().nullable().optional(),
|
|
82
|
+
due_date: zod_1.z.string().nullable().optional(),
|
|
83
|
+
due_time: zod_1.z.string().nullable().optional(),
|
|
84
|
+
},
|
|
85
|
+
annotations: {
|
|
86
|
+
title: 'Update task',
|
|
87
|
+
readOnlyHint: false,
|
|
88
|
+
destructiveHint: true,
|
|
89
|
+
idempotentHint: true,
|
|
90
|
+
openWorldHint: false,
|
|
91
|
+
},
|
|
92
|
+
scope: SCOPE,
|
|
93
|
+
handler: async (args) => {
|
|
94
|
+
const { id } = args;
|
|
95
|
+
const typedArgs = args;
|
|
96
|
+
// Explicit per-field presence check — see the file-level docblock for
|
|
97
|
+
// why this is not the same as dot-accessing each field into a fresh
|
|
98
|
+
// object literal.
|
|
99
|
+
const updateInput = {};
|
|
100
|
+
if (hasOwn(args, 'title'))
|
|
101
|
+
updateInput.title = typedArgs.title;
|
|
102
|
+
if (hasOwn(args, 'description'))
|
|
103
|
+
updateInput.description = typedArgs.description;
|
|
104
|
+
if (hasOwn(args, 'priority'))
|
|
105
|
+
updateInput.priority = typedArgs.priority;
|
|
106
|
+
if (hasOwn(args, 'progress'))
|
|
107
|
+
updateInput.progress = typedArgs.progress;
|
|
108
|
+
if (hasOwn(args, 'due_date'))
|
|
109
|
+
updateInput.due_date = typedArgs.due_date;
|
|
110
|
+
if (hasOwn(args, 'due_time'))
|
|
111
|
+
updateInput.due_time = typedArgs.due_time;
|
|
112
|
+
const wireBody = (0, mapping_1.mapUpdateTaskToWire)(updateInput);
|
|
113
|
+
const result = await client.patch(`/tasks/${encodeURIComponent(id)}`, wireBody);
|
|
114
|
+
const task = (0, mapping_1.mapTaskFromWire)(result.data);
|
|
115
|
+
return (0, conventions_1.jsonToolResult)(task);
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
exports.workelUpdateTask = workelUpdateTask;
|
|
119
|
+
//# sourceMappingURL=updateTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateTask.js","sourceRoot":"","sources":["../../src/tools/updateTask.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `workel_list_events` — `GET /events` (`read:events` scope).
|
|
3
|
+
*
|
|
4
|
+
* Result set = events bound directly to the workspace OR to one of its
|
|
5
|
+
* visible projects (`EventsController::index`); there is no per-project
|
|
6
|
+
* filter argument on this endpoint at all — narrowing to one project's
|
|
7
|
+
* events is not something this tool can do.
|
|
8
|
+
*
|
|
9
|
+
* Window semantics — verified directly against `EventsController::parseWindow`,
|
|
10
|
+
* not assumed: `from`/`to` compare with `whereDate('date', '>='/'<=', ...)` —
|
|
11
|
+
* i.e. from and to are INCLUSIVE of the boundary date itself. The window
|
|
12
|
+
* between them cannot exceed the server's 400-day maximum; a wider window is
|
|
13
|
+
* rejected by the server with a hard error rather than silently clamped, so
|
|
14
|
+
* this tool does not attempt to pre-validate the window width itself.
|
|
15
|
+
*
|
|
16
|
+
* There is no `workel_get_event` tool — the server has no `GET /events/{id}`
|
|
17
|
+
* endpoint at all, so a single event's full `description` is only ever
|
|
18
|
+
* visible through this list (truncated, never omitted, for the same reason
|
|
19
|
+
* `workel_list_task_comments` never omits `body`).
|
|
20
|
+
*/
|
|
21
|
+
import { type ToolFactory } from './defineTool';
|
|
22
|
+
export declare const workelListEvents: ToolFactory;
|
|
23
|
+
//# sourceMappingURL=workel_events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workel_events.d.ts","sourceRoot":"","sources":["../../src/tools/workel_events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAc5D,eAAO,MAAM,gBAAgB,EAAE,WA0B3B,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `workel_list_events` — `GET /events` (`read:events` scope).
|
|
4
|
+
*
|
|
5
|
+
* Result set = events bound directly to the workspace OR to one of its
|
|
6
|
+
* visible projects (`EventsController::index`); there is no per-project
|
|
7
|
+
* filter argument on this endpoint at all — narrowing to one project's
|
|
8
|
+
* events is not something this tool can do.
|
|
9
|
+
*
|
|
10
|
+
* Window semantics — verified directly against `EventsController::parseWindow`,
|
|
11
|
+
* not assumed: `from`/`to` compare with `whereDate('date', '>='/'<=', ...)` —
|
|
12
|
+
* i.e. from and to are INCLUSIVE of the boundary date itself. The window
|
|
13
|
+
* between them cannot exceed the server's 400-day maximum; a wider window is
|
|
14
|
+
* rejected by the server with a hard error rather than silently clamped, so
|
|
15
|
+
* this tool does not attempt to pre-validate the window width itself.
|
|
16
|
+
*
|
|
17
|
+
* There is no `workel_get_event` tool — the server has no `GET /events/{id}`
|
|
18
|
+
* endpoint at all, so a single event's full `description` is only ever
|
|
19
|
+
* visible through this list (truncated, never omitted, for the same reason
|
|
20
|
+
* `workel_list_task_comments` never omits `body`).
|
|
21
|
+
*/
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.workelListEvents = void 0;
|
|
24
|
+
const zod_1 = require("zod");
|
|
25
|
+
const mapping_1 = require("../api/mapping");
|
|
26
|
+
const output_1 = require("../output");
|
|
27
|
+
const defineTool_1 = require("./defineTool");
|
|
28
|
+
const conventions_1 = require("./conventions");
|
|
29
|
+
const DESCRIPTION = "List events visible to this API key's workspace — events on the workspace itself, plus events " +
|
|
30
|
+
'on any of its visible projects. There is no per-project filter; every visible event is returned, ' +
|
|
31
|
+
"optionally narrowed by `from`/`to`. from and to are INCLUSIVE of the date given (compared with " +
|
|
32
|
+
'`>=`/`<=` against each event\'s date), and the from/to window cannot exceed the server\'s 400-day ' +
|
|
33
|
+
'maximum — a wider window is rejected outright rather than silently narrowed. There is no ' +
|
|
34
|
+
"workel_get_event tool; an event's full description is only ever visible through this list " +
|
|
35
|
+
'(truncated for a very long one, never dropped). Paginated via an opaque `cursor`; a `null` ' +
|
|
36
|
+
'next_cursor means there are no more pages. ' +
|
|
37
|
+
conventions_1.UNTRUSTED_CONTENT_NOTE;
|
|
38
|
+
const workelListEvents = (client) => (0, defineTool_1.defineTool)({
|
|
39
|
+
name: 'workel_list_events',
|
|
40
|
+
description: DESCRIPTION,
|
|
41
|
+
inputSchema: {
|
|
42
|
+
limit: conventions_1.limitSchema,
|
|
43
|
+
cursor: zod_1.z.string().optional(),
|
|
44
|
+
from: zod_1.z.string().optional(),
|
|
45
|
+
to: zod_1.z.string().optional(),
|
|
46
|
+
},
|
|
47
|
+
annotations: { ...conventions_1.READ_ANNOTATIONS, title: 'List events' },
|
|
48
|
+
scope: 'read:events',
|
|
49
|
+
handler: async (args) => {
|
|
50
|
+
const { limit, cursor, from, to } = args;
|
|
51
|
+
const result = await client.get('/events', { limit, cursor, from, to });
|
|
52
|
+
const items = result.data.data.map((event) => {
|
|
53
|
+
const mapped = (0, mapping_1.mapEventFromWire)(event);
|
|
54
|
+
return { ...mapped, description: mapped.description === null ? null : (0, output_1.truncateText)(mapped.description) };
|
|
55
|
+
});
|
|
56
|
+
return (0, conventions_1.jsonToolResult)((0, output_1.listEnvelope)(items, result.data.meta.next_cursor));
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
exports.workelListEvents = workelListEvents;
|
|
60
|
+
//# sourceMappingURL=workel_events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workel_events.js","sourceRoot":"","sources":["../../src/tools/workel_events.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,6BAAwB;AAExB,4CAAkD;AAClD,sCAAuD;AACvD,6CAA4D;AAC5D,+CAAsG;AAEtG,MAAM,WAAW,GACf,gGAAgG;IAChG,mGAAmG;IACnG,iGAAiG;IACjG,oGAAoG;IACpG,2FAA2F;IAC3F,4FAA4F;IAC5F,6FAA6F;IAC7F,6CAA6C;IAC7C,oCAAsB,CAAC;AAElB,MAAM,gBAAgB,GAAgB,CAAC,MAAM,EAAE,EAAE,CACtD,IAAA,uBAAU,EAAC;IACT,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE;QACX,KAAK,EAAE,yBAAW;QAClB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC3B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC1B;IACD,WAAW,EAAE,EAAE,GAAG,8BAAgB,EAAE,KAAK,EAAE,aAAa,EAAE;IAC1D,KAAK,EAAE,aAAa;IACpB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,IAKnC,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAA4B,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QACnG,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YAC3C,MAAM,MAAM,GAAG,IAAA,0BAAgB,EAAC,KAAK,CAAC,CAAC;YACvC,OAAO,EAAE,GAAG,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,qBAAY,EAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QAC3G,CAAC,CAAC,CAAC;QACH,OAAO,IAAA,4BAAc,EAAC,IAAA,qBAAY,EAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC3E,CAAC;CACF,CAAC,CAAC;AA1BQ,QAAA,gBAAgB,oBA0BxB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `workel_list_members` — `GET /members` (`read:members` scope).
|
|
3
|
+
*
|
|
4
|
+
* Lists only ACTIVE members of the bound workspace — a pending invitation
|
|
5
|
+
* or a suspended membership is not a member yet, per
|
|
6
|
+
* `MembersController`'s docblock. `id` on each row is the member's own
|
|
7
|
+
* USER id (not a pivot-row id), so it can be used directly as an entry in
|
|
8
|
+
* a task's `assignee_ids`.
|
|
9
|
+
*
|
|
10
|
+
* `email` is present here and nowhere else on this API surface — a
|
|
11
|
+
* deliberate, scoped exception to the minimal-disclosure convention every
|
|
12
|
+
* other tool follows (owner decision; gated behind this tool's own
|
|
13
|
+
* `read:members` scope).
|
|
14
|
+
*/
|
|
15
|
+
import { type ToolFactory } from './defineTool';
|
|
16
|
+
export declare const workelListMembers: ToolFactory;
|
|
17
|
+
//# sourceMappingURL=workel_members.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workel_members.d.ts","sourceRoot":"","sources":["../../src/tools/workel_members.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAW5D,eAAO,MAAM,iBAAiB,EAAE,WAgB5B,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `workel_list_members` — `GET /members` (`read:members` scope).
|
|
4
|
+
*
|
|
5
|
+
* Lists only ACTIVE members of the bound workspace — a pending invitation
|
|
6
|
+
* or a suspended membership is not a member yet, per
|
|
7
|
+
* `MembersController`'s docblock. `id` on each row is the member's own
|
|
8
|
+
* USER id (not a pivot-row id), so it can be used directly as an entry in
|
|
9
|
+
* a task's `assignee_ids`.
|
|
10
|
+
*
|
|
11
|
+
* `email` is present here and nowhere else on this API surface — a
|
|
12
|
+
* deliberate, scoped exception to the minimal-disclosure convention every
|
|
13
|
+
* other tool follows (owner decision; gated behind this tool's own
|
|
14
|
+
* `read:members` scope).
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.workelListMembers = void 0;
|
|
18
|
+
const zod_1 = require("zod");
|
|
19
|
+
const mapping_1 = require("../api/mapping");
|
|
20
|
+
const output_1 = require("../output");
|
|
21
|
+
const defineTool_1 = require("./defineTool");
|
|
22
|
+
const conventions_1 = require("./conventions");
|
|
23
|
+
const DESCRIPTION = "List the active members of this API key's workspace: each member's user id, name, email, role " +
|
|
24
|
+
'(owner/admin/member, or null), and when they joined. A pending invitation or a suspended ' +
|
|
25
|
+
"membership is never included — only members who have actually joined. A member's `id` is the " +
|
|
26
|
+
"same id used elsewhere on this API as a task's assignee id. Paginated via an opaque `cursor`; a " +
|
|
27
|
+
'`null` next_cursor means there are no more pages. ' +
|
|
28
|
+
conventions_1.UNTRUSTED_CONTENT_NOTE;
|
|
29
|
+
const workelListMembers = (client) => (0, defineTool_1.defineTool)({
|
|
30
|
+
name: 'workel_list_members',
|
|
31
|
+
description: DESCRIPTION,
|
|
32
|
+
inputSchema: {
|
|
33
|
+
limit: conventions_1.limitSchema,
|
|
34
|
+
cursor: zod_1.z.string().optional(),
|
|
35
|
+
},
|
|
36
|
+
annotations: { ...conventions_1.READ_ANNOTATIONS, title: 'List members' },
|
|
37
|
+
scope: 'read:members',
|
|
38
|
+
handler: async (args) => {
|
|
39
|
+
const { limit, cursor } = args;
|
|
40
|
+
const result = await client.get('/members', { limit, cursor });
|
|
41
|
+
const items = result.data.data.map(mapping_1.mapMemberFromWire);
|
|
42
|
+
return (0, conventions_1.jsonToolResult)((0, output_1.listEnvelope)(items, result.data.meta.next_cursor));
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
exports.workelListMembers = workelListMembers;
|
|
46
|
+
//# sourceMappingURL=workel_members.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workel_members.js","sourceRoot":"","sources":["../../src/tools/workel_members.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,6BAAwB;AAExB,4CAAmD;AACnD,sCAAyC;AACzC,6CAA4D;AAC5D,+CAAsG;AAEtG,MAAM,WAAW,GACf,gGAAgG;IAChG,2FAA2F;IAC3F,+FAA+F;IAC/F,kGAAkG;IAClG,oDAAoD;IACpD,oCAAsB,CAAC;AAElB,MAAM,iBAAiB,GAAgB,CAAC,MAAM,EAAE,EAAE,CACvD,IAAA,uBAAU,EAAC;IACT,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE;QACX,KAAK,EAAE,yBAAW;QAClB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC9B;IACD,WAAW,EAAE,EAAE,GAAG,8BAAgB,EAAE,KAAK,EAAE,cAAc,EAAE;IAC3D,KAAK,EAAE,cAAc;IACrB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAA0C,CAAC;QACrE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAA6B,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAC3F,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,2BAAiB,CAAC,CAAC;QACtD,OAAO,IAAA,4BAAc,EAAC,IAAA,qBAAY,EAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC3E,CAAC;CACF,CAAC,CAAC;AAhBQ,QAAA,iBAAiB,qBAgBzB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `workel_list_project_columns` — `GET /projects/{id}/cards`
|
|
3
|
+
* (`read:projects` scope).
|
|
4
|
+
*
|
|
5
|
+
* A Workel "card" at this endpoint is a board COLUMN (a kanban list such as
|
|
6
|
+
* "To Do" / "In Progress" / "Done"), never a task — `CardResource`'s own
|
|
7
|
+
* docblock is explicit about this, and it's the single most likely
|
|
8
|
+
* misreading of this endpoint's name, hence spelling it out in the tool
|
|
9
|
+
* description itself rather than trusting the tool name alone to convey it.
|
|
10
|
+
*/
|
|
11
|
+
import { type ToolFactory } from './defineTool';
|
|
12
|
+
export declare const workelListProjectColumns: ToolFactory;
|
|
13
|
+
//# sourceMappingURL=workel_project_columns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workel_project_columns.d.ts","sourceRoot":"","sources":["../../src/tools/workel_project_columns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAa5D,eAAO,MAAM,wBAAwB,EAAE,WAoBnC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `workel_list_project_columns` — `GET /projects/{id}/cards`
|
|
4
|
+
* (`read:projects` scope).
|
|
5
|
+
*
|
|
6
|
+
* A Workel "card" at this endpoint is a board COLUMN (a kanban list such as
|
|
7
|
+
* "To Do" / "In Progress" / "Done"), never a task — `CardResource`'s own
|
|
8
|
+
* docblock is explicit about this, and it's the single most likely
|
|
9
|
+
* misreading of this endpoint's name, hence spelling it out in the tool
|
|
10
|
+
* description itself rather than trusting the tool name alone to convey it.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.workelListProjectColumns = void 0;
|
|
14
|
+
const zod_1 = require("zod");
|
|
15
|
+
const mapping_1 = require("../api/mapping");
|
|
16
|
+
const output_1 = require("../output");
|
|
17
|
+
const defineTool_1 = require("./defineTool");
|
|
18
|
+
const conventions_1 = require("./conventions");
|
|
19
|
+
const DESCRIPTION = "List the board columns of a project, in a project's saved display order. These columns are " +
|
|
20
|
+
'kanban lists, not tasks — a column such as "To Do" or "Done" holds tasks but is not one itself; ' +
|
|
21
|
+
'use workel_list_tasks with the returned column id (a task\'s `column_id`) to see the tasks inside ' +
|
|
22
|
+
'one. `is_done` marks a column whose tasks are treated as complete. A project id that is not ' +
|
|
23
|
+
"visible to this API key (archived, private, the inbox project, wrong workspace, or genuinely " +
|
|
24
|
+
'nonexistent) returns a not-found result either way. Paginated via an opaque `cursor`; a `null` ' +
|
|
25
|
+
'next_cursor means there are no more pages. ' +
|
|
26
|
+
conventions_1.UNTRUSTED_CONTENT_NOTE;
|
|
27
|
+
const workelListProjectColumns = (client) => (0, defineTool_1.defineTool)({
|
|
28
|
+
name: 'workel_list_project_columns',
|
|
29
|
+
description: DESCRIPTION,
|
|
30
|
+
inputSchema: {
|
|
31
|
+
id: zod_1.z.string().min(1),
|
|
32
|
+
limit: conventions_1.limitSchema,
|
|
33
|
+
cursor: zod_1.z.string().optional(),
|
|
34
|
+
},
|
|
35
|
+
annotations: { ...conventions_1.READ_ANNOTATIONS, title: 'List project columns' },
|
|
36
|
+
scope: 'read:projects',
|
|
37
|
+
handler: async (args) => {
|
|
38
|
+
const { id, limit, cursor } = args;
|
|
39
|
+
const result = await client.get(`/projects/${encodeURIComponent(id)}/cards`, { limit, cursor });
|
|
40
|
+
const items = result.data.data.map(mapping_1.mapProjectColumnFromWire);
|
|
41
|
+
return (0, conventions_1.jsonToolResult)((0, output_1.listEnvelope)(items, result.data.meta.next_cursor));
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
exports.workelListProjectColumns = workelListProjectColumns;
|
|
45
|
+
//# sourceMappingURL=workel_project_columns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workel_project_columns.js","sourceRoot":"","sources":["../../src/tools/workel_project_columns.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,6BAAwB;AAExB,4CAA0D;AAC1D,sCAAyC;AACzC,6CAA4D;AAC5D,+CAAsG;AAEtG,MAAM,WAAW,GACf,6FAA6F;IAC7F,kGAAkG;IAClG,oGAAoG;IACpG,8FAA8F;IAC9F,+FAA+F;IAC/F,iGAAiG;IACjG,6CAA6C;IAC7C,oCAAsB,CAAC;AAElB,MAAM,wBAAwB,GAAgB,CAAC,MAAM,EAAE,EAAE,CAC9D,IAAA,uBAAU,EAAC;IACT,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE;QACX,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACrB,KAAK,EAAE,yBAAW;QAClB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC9B;IACD,WAAW,EAAE,EAAE,GAAG,8BAAgB,EAAE,KAAK,EAAE,sBAAsB,EAAE;IACnE,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAsD,CAAC;QACrF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAC7B,aAAa,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAC3C,EAAE,KAAK,EAAE,MAAM,EAAE,CAClB,CAAC;QACF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,kCAAwB,CAAC,CAAC;QAC7D,OAAO,IAAA,4BAAc,EAAC,IAAA,qBAAY,EAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC3E,CAAC;CACF,CAAC,CAAC;AApBQ,QAAA,wBAAwB,4BAoBhC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `workel_list_projects` / `workel_get_project` — `GET /projects` and
|
|
3
|
+
* `GET /projects/{id}` (`read:projects` scope).
|
|
4
|
+
*
|
|
5
|
+
* Both tools operate on the bound workspace only — there is no workspace
|
|
6
|
+
* argument to either tool, because the server derives the workspace from
|
|
7
|
+
* the API key itself and ignores anything a caller could send (D3); this
|
|
8
|
+
* client has no notion of "which workspace" to ask for.
|
|
9
|
+
*
|
|
10
|
+
* A project reachable through this endpoint is never an inbox project, an
|
|
11
|
+
* archived project, or a private one — `ProjectsController::visibleProjects`
|
|
12
|
+
* filters all three out server-side; a project outside that set simply
|
|
13
|
+
* cannot be listed or fetched by id (a foreign/private/archived/nonexistent
|
|
14
|
+
* id all collapse to the same `not_found` — see `errors.ts`'s
|
|
15
|
+
* `not_found` message for why that's by design, not a bug).
|
|
16
|
+
*/
|
|
17
|
+
import { type ToolFactory } from './defineTool';
|
|
18
|
+
export declare const workelListProjects: ToolFactory;
|
|
19
|
+
export declare const workelGetProject: ToolFactory;
|
|
20
|
+
//# sourceMappingURL=workel_projects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workel_projects.d.ts","sourceRoot":"","sources":["../../src/tools/workel_projects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAqB5D,eAAO,MAAM,kBAAkB,EAAE,WAkB7B,CAAC;AAEL,eAAO,MAAM,gBAAgB,EAAE,WAkB3B,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `workel_list_projects` / `workel_get_project` — `GET /projects` and
|
|
4
|
+
* `GET /projects/{id}` (`read:projects` scope).
|
|
5
|
+
*
|
|
6
|
+
* Both tools operate on the bound workspace only — there is no workspace
|
|
7
|
+
* argument to either tool, because the server derives the workspace from
|
|
8
|
+
* the API key itself and ignores anything a caller could send (D3); this
|
|
9
|
+
* client has no notion of "which workspace" to ask for.
|
|
10
|
+
*
|
|
11
|
+
* A project reachable through this endpoint is never an inbox project, an
|
|
12
|
+
* archived project, or a private one — `ProjectsController::visibleProjects`
|
|
13
|
+
* filters all three out server-side; a project outside that set simply
|
|
14
|
+
* cannot be listed or fetched by id (a foreign/private/archived/nonexistent
|
|
15
|
+
* id all collapse to the same `not_found` — see `errors.ts`'s
|
|
16
|
+
* `not_found` message for why that's by design, not a bug).
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.workelGetProject = exports.workelListProjects = void 0;
|
|
20
|
+
const zod_1 = require("zod");
|
|
21
|
+
const mapping_1 = require("../api/mapping");
|
|
22
|
+
const output_1 = require("../output");
|
|
23
|
+
const defineTool_1 = require("./defineTool");
|
|
24
|
+
const conventions_1 = require("./conventions");
|
|
25
|
+
const SCOPE = 'read:projects';
|
|
26
|
+
const LIST_DESCRIPTION = "List the projects visible to this API key's workspace. Never includes archived projects, " +
|
|
27
|
+
'private projects, or the per-user inbox project — those are not reachable through this API at ' +
|
|
28
|
+
"all. Each project's `description` is omitted from this list view (call workel_get_project for " +
|
|
29
|
+
'the full description of one project); every other field is present. Results are ordered by id ' +
|
|
30
|
+
'and paginated via an opaque `cursor` — pass the `next_cursor` from a previous call to get the ' +
|
|
31
|
+
'next page; a `null` next_cursor means there are no more pages. ' +
|
|
32
|
+
conventions_1.UNTRUSTED_CONTENT_NOTE;
|
|
33
|
+
const GET_DESCRIPTION = 'Fetch a single project by id, including its full (possibly truncated) description. A project ' +
|
|
34
|
+
"id that does not exist, or that exists but isn't visible to this API key (archived, private, " +
|
|
35
|
+
'the inbox project, or in a different workspace), returns the same not-found result either way — ' +
|
|
36
|
+
'this tool cannot be used to tell those cases apart. ' +
|
|
37
|
+
conventions_1.UNTRUSTED_CONTENT_NOTE;
|
|
38
|
+
const workelListProjects = (client) => (0, defineTool_1.defineTool)({
|
|
39
|
+
name: 'workel_list_projects',
|
|
40
|
+
description: LIST_DESCRIPTION,
|
|
41
|
+
inputSchema: {
|
|
42
|
+
limit: conventions_1.limitSchema,
|
|
43
|
+
cursor: zod_1.z.string().optional(),
|
|
44
|
+
},
|
|
45
|
+
annotations: { ...conventions_1.READ_ANNOTATIONS, title: 'List projects' },
|
|
46
|
+
scope: SCOPE,
|
|
47
|
+
handler: async (args) => {
|
|
48
|
+
const { limit, cursor } = args;
|
|
49
|
+
const result = await client.get('/projects', { limit, cursor });
|
|
50
|
+
const items = result.data.data.map((project) => (0, output_1.omitLongText)((0, mapping_1.mapProjectFromWire)(project)));
|
|
51
|
+
return (0, conventions_1.jsonToolResult)((0, output_1.listEnvelope)(items, result.data.meta.next_cursor));
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
exports.workelListProjects = workelListProjects;
|
|
55
|
+
const workelGetProject = (client) => (0, defineTool_1.defineTool)({
|
|
56
|
+
name: 'workel_get_project',
|
|
57
|
+
description: GET_DESCRIPTION,
|
|
58
|
+
inputSchema: {
|
|
59
|
+
id: zod_1.z.string().min(1),
|
|
60
|
+
},
|
|
61
|
+
annotations: { ...conventions_1.READ_ANNOTATIONS, title: 'Get project' },
|
|
62
|
+
scope: SCOPE,
|
|
63
|
+
handler: async (args) => {
|
|
64
|
+
const { id } = args;
|
|
65
|
+
const result = await client.get(`/projects/${encodeURIComponent(id)}`);
|
|
66
|
+
const project = (0, mapping_1.mapProjectFromWire)(result.data);
|
|
67
|
+
return (0, conventions_1.jsonToolResult)({
|
|
68
|
+
...project,
|
|
69
|
+
description: project.description === null ? null : (0, output_1.truncateText)(project.description),
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
exports.workelGetProject = workelGetProject;
|
|
74
|
+
//# sourceMappingURL=workel_projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workel_projects.js","sourceRoot":"","sources":["../../src/tools/workel_projects.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,6BAAwB;AAExB,4CAAoD;AACpD,sCAAqE;AACrE,6CAA4D;AAC5D,+CAAsG;AAEtG,MAAM,KAAK,GAAG,eAAe,CAAC;AAE9B,MAAM,gBAAgB,GACpB,2FAA2F;IAC3F,gGAAgG;IAChG,gGAAgG;IAChG,gGAAgG;IAChG,gGAAgG;IAChG,iEAAiE;IACjE,oCAAsB,CAAC;AAEzB,MAAM,eAAe,GACnB,+FAA+F;IAC/F,+FAA+F;IAC/F,kGAAkG;IAClG,sDAAsD;IACtD,oCAAsB,CAAC;AAElB,MAAM,kBAAkB,GAAgB,CAAC,MAAM,EAAE,EAAE,CACxD,IAAA,uBAAU,EAAC;IACT,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE;QACX,KAAK,EAAE,yBAAW;QAClB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC9B;IACD,WAAW,EAAE,EAAE,GAAG,8BAAgB,EAAE,KAAK,EAAE,eAAe,EAAE;IAC5D,KAAK,EAAE,KAAK;IACZ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAA0C,CAAC;QACrE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAA8B,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7F,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAC7C,IAAA,qBAAY,EAAC,IAAA,4BAAkB,EAAC,OAAO,CAAuC,CAAC,CAChF,CAAC;QACF,OAAO,IAAA,4BAAc,EAAC,IAAA,qBAAY,EAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC3E,CAAC;CACF,CAAC,CAAC;AAlBQ,QAAA,kBAAkB,sBAkB1B;AAEE,MAAM,gBAAgB,GAAgB,CAAC,MAAM,EAAE,EAAE,CACtD,IAAA,uBAAU,EAAC;IACT,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE;QACX,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KACtB;IACD,WAAW,EAAE,EAAE,GAAG,8BAAgB,EAAE,KAAK,EAAE,aAAa,EAAE;IAC1D,KAAK,EAAE,KAAK;IACZ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,EAAE,EAAE,EAAE,GAAG,IAAsB,CAAC;QACtC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAAc,aAAa,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACpF,MAAM,OAAO,GAAG,IAAA,4BAAkB,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAChD,OAAO,IAAA,4BAAc,EAAC;YACpB,GAAG,OAAO;YACV,WAAW,EAAE,OAAO,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,qBAAY,EAAC,OAAO,CAAC,WAAW,CAAC;SACrF,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAlBQ,QAAA,gBAAgB,oBAkBxB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `workel_list_task_comments` — `GET /tasks/{id}/comments` (`read:tasks`
|
|
3
|
+
* scope, same scope as the task tools — comments are not their own scope
|
|
4
|
+
* on this surface).
|
|
5
|
+
*
|
|
6
|
+
* Returns every comment on the task, oldest first, top-level and replies
|
|
7
|
+
* alike — there is no threading filter. The parent task is resolved
|
|
8
|
+
* through the same visible-project chain `workel_get_task` uses, so a
|
|
9
|
+
* task outside it (or a genuinely nonexistent id) 404s before any comment
|
|
10
|
+
* is queried — a non-visible task's comments are never enumerable through
|
|
11
|
+
* this tool.
|
|
12
|
+
*
|
|
13
|
+
* There is no `workel_get_task_comment` tool and no way to fetch a single
|
|
14
|
+
* comment on its own — `body` is truncated per row here (never omitted the
|
|
15
|
+
* way a task/project's `description` is on their own list views) because
|
|
16
|
+
* this list IS the only place a comment's text is ever visible through
|
|
17
|
+
* this API.
|
|
18
|
+
*/
|
|
19
|
+
import { type ToolFactory } from './defineTool';
|
|
20
|
+
export declare const workelListTaskComments: ToolFactory;
|
|
21
|
+
//# sourceMappingURL=workel_task_comments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workel_task_comments.d.ts","sourceRoot":"","sources":["../../src/tools/workel_task_comments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAY5D,eAAO,MAAM,sBAAsB,EAAE,WAuBjC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `workel_list_task_comments` — `GET /tasks/{id}/comments` (`read:tasks`
|
|
4
|
+
* scope, same scope as the task tools — comments are not their own scope
|
|
5
|
+
* on this surface).
|
|
6
|
+
*
|
|
7
|
+
* Returns every comment on the task, oldest first, top-level and replies
|
|
8
|
+
* alike — there is no threading filter. The parent task is resolved
|
|
9
|
+
* through the same visible-project chain `workel_get_task` uses, so a
|
|
10
|
+
* task outside it (or a genuinely nonexistent id) 404s before any comment
|
|
11
|
+
* is queried — a non-visible task's comments are never enumerable through
|
|
12
|
+
* this tool.
|
|
13
|
+
*
|
|
14
|
+
* There is no `workel_get_task_comment` tool and no way to fetch a single
|
|
15
|
+
* comment on its own — `body` is truncated per row here (never omitted the
|
|
16
|
+
* way a task/project's `description` is on their own list views) because
|
|
17
|
+
* this list IS the only place a comment's text is ever visible through
|
|
18
|
+
* this API.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.workelListTaskComments = void 0;
|
|
22
|
+
const zod_1 = require("zod");
|
|
23
|
+
const mapping_1 = require("../api/mapping");
|
|
24
|
+
const output_1 = require("../output");
|
|
25
|
+
const defineTool_1 = require("./defineTool");
|
|
26
|
+
const conventions_1 = require("./conventions");
|
|
27
|
+
const DESCRIPTION = 'List every comment on a task, oldest first — top-level comments and replies together, with no ' +
|
|
28
|
+
'threading filter available. A task id that is not visible to this API key (its project is ' +
|
|
29
|
+
'archived, private, the inbox project, or in a different workspace, or the id is genuinely ' +
|
|
30
|
+
"nonexistent) returns a not-found result either way. There is no tool to fetch a single comment " +
|
|
31
|
+
'on its own — this list is the only way to read a comment\'s body through this API. Paginated via ' +
|
|
32
|
+
'an opaque `cursor`; a `null` next_cursor means there are no more pages. ' +
|
|
33
|
+
conventions_1.UNTRUSTED_CONTENT_NOTE;
|
|
34
|
+
const workelListTaskComments = (client) => (0, defineTool_1.defineTool)({
|
|
35
|
+
name: 'workel_list_task_comments',
|
|
36
|
+
description: DESCRIPTION,
|
|
37
|
+
inputSchema: {
|
|
38
|
+
id: zod_1.z.string().min(1),
|
|
39
|
+
limit: conventions_1.limitSchema,
|
|
40
|
+
cursor: zod_1.z.string().optional(),
|
|
41
|
+
},
|
|
42
|
+
annotations: { ...conventions_1.READ_ANNOTATIONS, title: 'List task comments' },
|
|
43
|
+
scope: 'read:tasks',
|
|
44
|
+
handler: async (args) => {
|
|
45
|
+
const { id, limit, cursor } = args;
|
|
46
|
+
const result = await client.get(`/tasks/${encodeURIComponent(id)}/comments`, { limit, cursor });
|
|
47
|
+
const items = result.data.data.map((comment) => {
|
|
48
|
+
const mapped = (0, mapping_1.mapTaskCommentFromWire)(comment);
|
|
49
|
+
return { ...mapped, body: (0, output_1.truncateText)(mapped.body) };
|
|
50
|
+
});
|
|
51
|
+
return (0, conventions_1.jsonToolResult)((0, output_1.listEnvelope)(items, result.data.meta.next_cursor));
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
exports.workelListTaskComments = workelListTaskComments;
|
|
55
|
+
//# sourceMappingURL=workel_task_comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workel_task_comments.js","sourceRoot":"","sources":["../../src/tools/workel_task_comments.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,6BAAwB;AAExB,4CAAwD;AACxD,sCAAuD;AACvD,6CAA4D;AAC5D,+CAAsG;AAEtG,MAAM,WAAW,GACf,gGAAgG;IAChG,4FAA4F;IAC5F,4FAA4F;IAC5F,iGAAiG;IACjG,mGAAmG;IACnG,0EAA0E;IAC1E,oCAAsB,CAAC;AAElB,MAAM,sBAAsB,GAAgB,CAAC,MAAM,EAAE,EAAE,CAC5D,IAAA,uBAAU,EAAC;IACT,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE;QACX,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACrB,KAAK,EAAE,yBAAW;QAClB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC9B;IACD,WAAW,EAAE,EAAE,GAAG,8BAAgB,EAAE,KAAK,EAAE,oBAAoB,EAAE;IACjE,KAAK,EAAE,YAAY;IACnB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAsD,CAAC;QACrF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAC7B,UAAU,kBAAkB,CAAC,EAAE,CAAC,WAAW,EAC3C,EAAE,KAAK,EAAE,MAAM,EAAE,CAClB,CAAC;QACF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7C,MAAM,MAAM,GAAG,IAAA,gCAAsB,EAAC,OAAO,CAAC,CAAC;YAC/C,OAAO,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,IAAA,qBAAY,EAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACxD,CAAC,CAAC,CAAC;QACH,OAAO,IAAA,4BAAc,EAAC,IAAA,qBAAY,EAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC3E,CAAC;CACF,CAAC,CAAC;AAvBQ,QAAA,sBAAsB,0BAuB9B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `workel_list_tasks` / `workel_get_task` — `GET /tasks` and
|
|
3
|
+
* `GET /tasks/{id}` (`read:tasks` scope).
|
|
4
|
+
*
|
|
5
|
+
* A task is only reachable through a card belonging to a VISIBLE project
|
|
6
|
+
* (`TasksController::visibleTasksQuery` — bound workspace, not inbox, not
|
|
7
|
+
* archived, not private); a task outside that chain and a genuinely
|
|
8
|
+
* nonexistent id both collapse to the same not-found result.
|
|
9
|
+
*
|
|
10
|
+
* Filter semantics — verified directly against `TasksController::applyFilters`,
|
|
11
|
+
* not assumed:
|
|
12
|
+
* - `due_before`/`due_after` compare with strict `<`/`>` against a task's due
|
|
13
|
+
* date — i.e. due_before and due_after are EXCLUSIVE of the date given (a
|
|
14
|
+
* task due exactly on that date is not returned by either).
|
|
15
|
+
* - `updated_since` compares with `>=` — i.e. updated_since is INCLUSIVE (a
|
|
16
|
+
* task updated exactly at that instant IS returned).
|
|
17
|
+
* - There is no text search filter on this endpoint at all — no `q`, no
|
|
18
|
+
* title/description match of any kind.
|
|
19
|
+
*/
|
|
20
|
+
import { type ToolFactory } from './defineTool';
|
|
21
|
+
export declare const workelListTasks: ToolFactory;
|
|
22
|
+
export declare const workelGetTask: ToolFactory;
|
|
23
|
+
//# sourceMappingURL=workel_tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workel_tasks.d.ts","sourceRoot":"","sources":["../../src/tools/workel_tasks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAqC5D,eAAO,MAAM,eAAe,EAAE,WAmD1B,CAAC;AAEL,eAAO,MAAM,aAAa,EAAE,WAkBxB,CAAC"}
|