@workel/mcp 0.3.0 → 0.4.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 +85 -16
- package/dist/api/client.d.ts +19 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +41 -6
- package/dist/api/client.js.map +1 -1
- package/dist/api/mapping.d.ts +13 -1
- package/dist/api/mapping.d.ts.map +1 -1
- package/dist/api/mapping.js +72 -0
- package/dist/api/mapping.js.map +1 -1
- package/dist/api/types.d.ts +106 -0
- package/dist/api/types.d.ts.map +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +14 -4
- package/dist/server.js.map +1 -1
- package/dist/tools/createComment.js +1 -1
- package/dist/tools/createComment.js.map +1 -1
- package/dist/tools/createEvent.js +1 -1
- package/dist/tools/createEvent.js.map +1 -1
- package/dist/tools/createTask.js +1 -1
- package/dist/tools/createTask.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/logTime.d.ts +28 -0
- package/dist/tools/logTime.d.ts.map +1 -0
- package/dist/tools/logTime.js +83 -0
- package/dist/tools/logTime.js.map +1 -0
- package/dist/tools/registration.d.ts +5 -2
- package/dist/tools/registration.d.ts.map +1 -1
- package/dist/tools/registration.js +9 -2
- package/dist/tools/registration.js.map +1 -1
- package/dist/tools/updateTask.d.ts +20 -6
- package/dist/tools/updateTask.d.ts.map +1 -1
- package/dist/tools/updateTask.js +37 -11
- package/dist/tools/updateTask.js.map +1 -1
- package/dist/tools/uploadAttachment.d.ts +49 -0
- package/dist/tools/uploadAttachment.d.ts.map +1 -0
- package/dist/tools/uploadAttachment.js +133 -0
- package/dist/tools/uploadAttachment.js.map +1 -0
- package/dist/tools/workel_projects.js +1 -1
- package/dist/tools/workel_projects.js.map +1 -1
- package/dist/tools/workel_task_activity.d.ts +27 -0
- package/dist/tools/workel_task_activity.d.ts.map +1 -0
- package/dist/tools/workel_task_activity.js +67 -0
- package/dist/tools/workel_task_activity.js.map +1 -0
- package/dist/tools/workel_tasks.d.ts.map +1 -1
- package/dist/tools/workel_tasks.js +10 -4
- package/dist/tools/workel_tasks.js.map +1 -1
- package/dist/tools/workel_time_entries.d.ts +25 -0
- package/dist/tools/workel_time_entries.d.ts.map +1 -0
- package/dist/tools/workel_time_entries.js +74 -0
- package/dist/tools/workel_time_entries.js.map +1 -0
- package/dist/version.d.ts +16 -0
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +17 -1
- package/dist/version.js.map +1 -1
- package/dist/worker.d.ts +41 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +113 -0
- package/dist/worker.js.map +1 -0
- package/package.json +10 -4
package/dist/tools/updateTask.js
CHANGED
|
@@ -21,12 +21,26 @@
|
|
|
21
21
|
* `due_time` -> `end_time`) happens ONLY in `../api/mapping.ts`'s
|
|
22
22
|
* `mapUpdateTaskToWire` — never re-implemented here.
|
|
23
23
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* field
|
|
28
|
-
*
|
|
29
|
-
*
|
|
24
|
+
* Board moves and assignee changes ARE supported (`column_id` -> `card_id`,
|
|
25
|
+
* `assignee_ids` -> `user_ids`). An earlier revision of this file said the
|
|
26
|
+
* opposite, and it was true then: `UpdatePublicTaskRequest::rules()` did not
|
|
27
|
+
* declare either field, so there was no wire field to forward them through.
|
|
28
|
+
* Both are now accepted and server-validated — the target column must sit in
|
|
29
|
+
* a project the key can see, and every assignee must be a member of the key's
|
|
30
|
+
* workspace.
|
|
31
|
+
*
|
|
32
|
+
* `assignee_ids` is REPLACEMENT, not append: the given array becomes the
|
|
33
|
+
* assignee set, `[]` clears it, and omitting the key leaves it untouched. It
|
|
34
|
+
* is deliberately NOT nullable in the tool schema — `null` and `[]` would
|
|
35
|
+
* mean the same thing to the server, and offering two spellings of "clear"
|
|
36
|
+
* invites a model to guess. `column_id` is likewise non-nullable: a task
|
|
37
|
+
* always belongs to a column, and the server rejects a null with 422.
|
|
38
|
+
*
|
|
39
|
+
* `project_id` is still not exposed: a task's project follows its column, so
|
|
40
|
+
* `column_id` alone says where the task should live, and a `project_id` that
|
|
41
|
+
* disagreed with `column_id` would have no coherent meaning.
|
|
42
|
+
*
|
|
43
|
+
* `reminder_date` is likewise never exposed here even
|
|
30
44
|
* though the wire endpoint accepts it — see `../api/mapping.ts`'s
|
|
31
45
|
* file-level docblock (it is write-only over this API; there is no read
|
|
32
46
|
* endpoint that ever returns it, so exposing a field a caller can set but
|
|
@@ -57,11 +71,16 @@ const defineTool_1 = require("./defineTool");
|
|
|
57
71
|
const conventions_1 = require("./conventions");
|
|
58
72
|
const SCOPE = 'write:tasks';
|
|
59
73
|
const PRIORITY_VALUES = ['low', 'medium', 'high', 'urgent', 'none'];
|
|
60
|
-
const DESCRIPTION = 'Update fields on an existing task by id
|
|
74
|
+
const DESCRIPTION = 'Update fields on an existing task by id, including MOVING it to a different column (column_id) ' +
|
|
75
|
+
'and REASSIGNING it (assignee_ids). Every field is optional: an OMITTED field is left ' +
|
|
61
76
|
'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).
|
|
63
|
-
'
|
|
64
|
-
'
|
|
77
|
+
'which also clears due_time if it was set — a time cannot outlive its day). column_id moves the ' +
|
|
78
|
+
'task to that column, which may belong to a DIFFERENT project — the task lands at the end of the ' +
|
|
79
|
+
'destination column; get valid ids from workel_list_project_columns. assignee_ids REPLACES the ' +
|
|
80
|
+
'assignee set rather than adding to it, so pass the complete list you want (send [] to clear all ' +
|
|
81
|
+
'assignees, or omit the field to leave assignees alone) — read the current set from ' +
|
|
82
|
+
'workel_get_task first if you mean to add someone. A cover image and attachments are readable ' +
|
|
83
|
+
'via workel_get_task but cannot be set here: both are file uploads, not values. IMPORTANT: a write:tasks API key ' +
|
|
65
84
|
'can update ANY task in ANY project visible to its workspace, regardless of whether the key\'s ' +
|
|
66
85
|
"creator is actually a member of that specific project — this endpoint performs no per-project " +
|
|
67
86
|
'permission check the way task CREATION does. Treat this tool as workspace-wide for existing ' +
|
|
@@ -81,6 +100,9 @@ const workelUpdateTask = (client) => (0, defineTool_1.defineTool)({
|
|
|
81
100
|
progress: zod_1.z.number().int().nullable().optional(),
|
|
82
101
|
due_date: zod_1.z.string().nullable().optional(),
|
|
83
102
|
due_time: zod_1.z.string().nullable().optional(),
|
|
103
|
+
// Non-nullable on purpose — see the file-level docblock.
|
|
104
|
+
column_id: zod_1.z.string().min(1).optional(),
|
|
105
|
+
assignee_ids: zod_1.z.array(zod_1.z.string().min(1)).optional(),
|
|
84
106
|
},
|
|
85
107
|
annotations: {
|
|
86
108
|
title: 'Update task',
|
|
@@ -109,9 +131,13 @@ const workelUpdateTask = (client) => (0, defineTool_1.defineTool)({
|
|
|
109
131
|
updateInput.due_date = typedArgs.due_date;
|
|
110
132
|
if (hasOwn(args, 'due_time'))
|
|
111
133
|
updateInput.due_time = typedArgs.due_time;
|
|
134
|
+
if (hasOwn(args, 'column_id'))
|
|
135
|
+
updateInput.column_id = typedArgs.column_id;
|
|
136
|
+
if (hasOwn(args, 'assignee_ids'))
|
|
137
|
+
updateInput.assignee_ids = typedArgs.assignee_ids;
|
|
112
138
|
const wireBody = (0, mapping_1.mapUpdateTaskToWire)(updateInput);
|
|
113
139
|
const result = await client.patch(`/tasks/${encodeURIComponent(id)}`, wireBody);
|
|
114
|
-
const task = (0, mapping_1.mapTaskFromWire)(result.data);
|
|
140
|
+
const task = (0, mapping_1.mapTaskFromWire)(result.data.data);
|
|
115
141
|
return (0, conventions_1.jsonToolResult)(task);
|
|
116
142
|
},
|
|
117
143
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateTask.js","sourceRoot":"","sources":["../../src/tools/updateTask.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":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CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;QACxE,IAAI,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC;YAAE,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;QACxE,IAAI,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC;YAAE,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;QACxE,IAAI,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC;YAAE,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;QAC3E,IAAI,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC;YAAE,WAAW,CAAC,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;QAEpF,MAAM,QAAQ,GAAG,IAAA,6BAAmB,EAAC,WAAW,CAAC,CAAC;QAClD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAqB,UAAU,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QACpG,MAAM,IAAI,GAAG,IAAA,yBAAe,EAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE/C,OAAO,IAAA,4BAAc,EAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF,CAAC,CAAC;AA/CQ,QAAA,gBAAgB,oBA+CxB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `workel_upload_task_attachment` — `POST /tasks/{id}/attachments`
|
|
3
|
+
* (`write:attachments` scope — NOT `write:tasks`; attachments have their own
|
|
4
|
+
* scope on this surface, matching `routes/api/public/v1.php`'s
|
|
5
|
+
* `key.scope:write:attachments` middleware on this exact route). A key
|
|
6
|
+
* granted only `write:tasks` cannot upload, and this tool is not even
|
|
7
|
+
* registered for it (gate (a) in `./registration.ts`).
|
|
8
|
+
*
|
|
9
|
+
* ── Why the content is a STRING, not a path ─────────────────────────────
|
|
10
|
+
*
|
|
11
|
+
* MCP tool arguments are JSON. There is no file handle to pass and no shared
|
|
12
|
+
* filesystem to read from: an MCP server may well be running on a different
|
|
13
|
+
* machine from the model, so a `path` argument would be a promise this tool
|
|
14
|
+
* cannot keep. The file's CONTENT therefore comes in as a string and the
|
|
15
|
+
* multipart request is assembled here (`client.postFile` →
|
|
16
|
+
* `../api/client.ts`).
|
|
17
|
+
*
|
|
18
|
+
* That makes the natural fit text — markdown, CSV, JSON, logs, code — which
|
|
19
|
+
* is what an assistant actually has in hand. `encoding: 'base64'` exists for
|
|
20
|
+
* bytes (a small image, a PDF) but is not the main path: base64 inflates the
|
|
21
|
+
* payload by a third and the whole thing has to travel through the model's
|
|
22
|
+
* context, so anything large belongs in the web UI's drag-and-drop instead.
|
|
23
|
+
*
|
|
24
|
+
* ── Bounds and why they are where they are ──────────────────────────────
|
|
25
|
+
*
|
|
26
|
+
* `MAX_CONTENT_CHARS` is a client-side guard against a runaway argument, set
|
|
27
|
+
* far BELOW the server's own 100 MB file cap: a file that big could not have
|
|
28
|
+
* arrived through a tool call in the first place, so the useful limit here is
|
|
29
|
+
* "a plausible document", not "whatever the server would accept". Everything
|
|
30
|
+
* else is left to the server and surfaces as the mapped upstream error —
|
|
31
|
+
* this tool does not duplicate the blocked-extension list, the storage quota,
|
|
32
|
+
* or the project-permission rule, all of which can change server-side
|
|
33
|
+
* without a client release.
|
|
34
|
+
*
|
|
35
|
+
* A task id that is not visible to this key (foreign workspace, or an
|
|
36
|
+
* archived/private/inbox project) and a genuinely nonexistent id both return
|
|
37
|
+
* the same collapsed not-found error: the server offers no existence oracle
|
|
38
|
+
* and this tool does not try to build one.
|
|
39
|
+
*
|
|
40
|
+
* `idempotency_key` (D7): forwarded verbatim as `Idempotency-Key`. Reusing
|
|
41
|
+
* one across a retry of the SAME file returns the original attachment rather
|
|
42
|
+
* than storing a second copy (`replayed: true` says so). Reusing one with a
|
|
43
|
+
* DIFFERENT file is a 409 by design, not a silent replay — the server hashes
|
|
44
|
+
* the actual parts for multipart bodies precisely so that case is loud
|
|
45
|
+
* (`PublicApiIdempotency`).
|
|
46
|
+
*/
|
|
47
|
+
import { type ToolFactory } from './defineTool';
|
|
48
|
+
export declare const workelUploadTaskAttachment: ToolFactory;
|
|
49
|
+
//# sourceMappingURL=uploadAttachment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploadAttachment.d.ts","sourceRoot":"","sources":["../../src/tools/uploadAttachment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAKH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AA+D5D,eAAO,MAAM,0BAA0B,EAAE,WA4CrC,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `workel_upload_task_attachment` — `POST /tasks/{id}/attachments`
|
|
4
|
+
* (`write:attachments` scope — NOT `write:tasks`; attachments have their own
|
|
5
|
+
* scope on this surface, matching `routes/api/public/v1.php`'s
|
|
6
|
+
* `key.scope:write:attachments` middleware on this exact route). A key
|
|
7
|
+
* granted only `write:tasks` cannot upload, and this tool is not even
|
|
8
|
+
* registered for it (gate (a) in `./registration.ts`).
|
|
9
|
+
*
|
|
10
|
+
* ── Why the content is a STRING, not a path ─────────────────────────────
|
|
11
|
+
*
|
|
12
|
+
* MCP tool arguments are JSON. There is no file handle to pass and no shared
|
|
13
|
+
* filesystem to read from: an MCP server may well be running on a different
|
|
14
|
+
* machine from the model, so a `path` argument would be a promise this tool
|
|
15
|
+
* cannot keep. The file's CONTENT therefore comes in as a string and the
|
|
16
|
+
* multipart request is assembled here (`client.postFile` →
|
|
17
|
+
* `../api/client.ts`).
|
|
18
|
+
*
|
|
19
|
+
* That makes the natural fit text — markdown, CSV, JSON, logs, code — which
|
|
20
|
+
* is what an assistant actually has in hand. `encoding: 'base64'` exists for
|
|
21
|
+
* bytes (a small image, a PDF) but is not the main path: base64 inflates the
|
|
22
|
+
* payload by a third and the whole thing has to travel through the model's
|
|
23
|
+
* context, so anything large belongs in the web UI's drag-and-drop instead.
|
|
24
|
+
*
|
|
25
|
+
* ── Bounds and why they are where they are ──────────────────────────────
|
|
26
|
+
*
|
|
27
|
+
* `MAX_CONTENT_CHARS` is a client-side guard against a runaway argument, set
|
|
28
|
+
* far BELOW the server's own 100 MB file cap: a file that big could not have
|
|
29
|
+
* arrived through a tool call in the first place, so the useful limit here is
|
|
30
|
+
* "a plausible document", not "whatever the server would accept". Everything
|
|
31
|
+
* else is left to the server and surfaces as the mapped upstream error —
|
|
32
|
+
* this tool does not duplicate the blocked-extension list, the storage quota,
|
|
33
|
+
* or the project-permission rule, all of which can change server-side
|
|
34
|
+
* without a client release.
|
|
35
|
+
*
|
|
36
|
+
* A task id that is not visible to this key (foreign workspace, or an
|
|
37
|
+
* archived/private/inbox project) and a genuinely nonexistent id both return
|
|
38
|
+
* the same collapsed not-found error: the server offers no existence oracle
|
|
39
|
+
* and this tool does not try to build one.
|
|
40
|
+
*
|
|
41
|
+
* `idempotency_key` (D7): forwarded verbatim as `Idempotency-Key`. Reusing
|
|
42
|
+
* one across a retry of the SAME file returns the original attachment rather
|
|
43
|
+
* than storing a second copy (`replayed: true` says so). Reusing one with a
|
|
44
|
+
* DIFFERENT file is a 409 by design, not a silent replay — the server hashes
|
|
45
|
+
* the actual parts for multipart bodies precisely so that case is loud
|
|
46
|
+
* (`PublicApiIdempotency`).
|
|
47
|
+
*/
|
|
48
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
exports.workelUploadTaskAttachment = void 0;
|
|
50
|
+
const zod_1 = require("zod");
|
|
51
|
+
const mapping_1 = require("../api/mapping");
|
|
52
|
+
const defineTool_1 = require("./defineTool");
|
|
53
|
+
const conventions_1 = require("./conventions");
|
|
54
|
+
const SCOPE = 'write:attachments';
|
|
55
|
+
/**
|
|
56
|
+
* ~1 MB of characters. Not the server's limit — see the file docblock: this
|
|
57
|
+
* bounds the TOOL ARGUMENT, which has to fit in a model's context, and a
|
|
58
|
+
* request over it is rejected here rather than spending an upload on it.
|
|
59
|
+
*/
|
|
60
|
+
const MAX_CONTENT_CHARS = 1000000;
|
|
61
|
+
const DESCRIPTION = 'Attach a file to a task by task id, by passing the file CONTENT as text (markdown, CSV, JSON, ' +
|
|
62
|
+
'plain text, code). There is no path or filesystem argument — the content travels in this call, so ' +
|
|
63
|
+
'this is for files you can write out here, not for files on disk elsewhere. For binary (a small ' +
|
|
64
|
+
'image or PDF) set encoding to base64; prefer the Workel web app for anything large. filename ' +
|
|
65
|
+
'sets the attachment name and its extension decides how Workel displays it, so include one ' +
|
|
66
|
+
'(e.g. notes.md). Uploads count against the workspace storage plan and some file types are ' +
|
|
67
|
+
'refused for security (anything that renders as a page or script: .html, .svg, .js, .php and ' +
|
|
68
|
+
'similar) — both surface as a clear error. A task id this key cannot see (different workspace, or ' +
|
|
69
|
+
'an archived, private, or inbox project) and a nonexistent id both return not-found; this tool ' +
|
|
70
|
+
'cannot tell those apart. An optional idempotency_key, reused across a retry of the exact same ' +
|
|
71
|
+
'file, returns the ORIGINAL attachment instead of storing a second copy — `replayed` is true when ' +
|
|
72
|
+
'that happened. Reusing the same key with a DIFFERENT file is rejected rather than silently ' +
|
|
73
|
+
'replaying the first one. ' +
|
|
74
|
+
conventions_1.UNTRUSTED_CONTENT_NOTE;
|
|
75
|
+
/**
|
|
76
|
+
* Decode the caller's content into bytes.
|
|
77
|
+
*
|
|
78
|
+
* base64 is validated rather than trusted: `Buffer.from(x, 'base64')`
|
|
79
|
+
* silently DISCARDS every character outside the alphabet, so a caller who
|
|
80
|
+
* passed utf8 text under `encoding: 'base64'` would otherwise get a
|
|
81
|
+
* successfully-stored file full of garbage instead of an error. Re-encoding
|
|
82
|
+
* and comparing is the cheapest way to catch that.
|
|
83
|
+
*/
|
|
84
|
+
function decodeContent(content, encoding) {
|
|
85
|
+
if (encoding === 'utf8') {
|
|
86
|
+
return new Uint8Array(Buffer.from(content, 'utf8'));
|
|
87
|
+
}
|
|
88
|
+
const normalized = content.replace(/\s+/g, '');
|
|
89
|
+
const decoded = Buffer.from(normalized, 'base64');
|
|
90
|
+
if (decoded.toString('base64').replace(/=+$/, '') !== normalized.replace(/=+$/, '')) {
|
|
91
|
+
throw new Error('content is not valid base64. Pass encoding "utf8" for text, or a correctly base64-encoded string.');
|
|
92
|
+
}
|
|
93
|
+
return new Uint8Array(decoded);
|
|
94
|
+
}
|
|
95
|
+
const workelUploadTaskAttachment = (client) => (0, defineTool_1.defineTool)({
|
|
96
|
+
name: 'workel_upload_task_attachment',
|
|
97
|
+
description: DESCRIPTION,
|
|
98
|
+
inputSchema: {
|
|
99
|
+
id: zod_1.z.string().min(1),
|
|
100
|
+
filename: zod_1.z.string().min(1).max(255),
|
|
101
|
+
content: zod_1.z.string().min(1).max(MAX_CONTENT_CHARS),
|
|
102
|
+
encoding: zod_1.z.enum(['utf8', 'base64']).optional(),
|
|
103
|
+
content_type: zod_1.z.string().min(1).max(255).optional(),
|
|
104
|
+
idempotency_key: zod_1.z.string().optional(),
|
|
105
|
+
},
|
|
106
|
+
annotations: {
|
|
107
|
+
title: 'Upload task attachment',
|
|
108
|
+
readOnlyHint: false,
|
|
109
|
+
destructiveHint: false,
|
|
110
|
+
// Two calls without an idempotency_key store two copies — the honest
|
|
111
|
+
// answer is false, the same one workel_create_task gives.
|
|
112
|
+
idempotentHint: false,
|
|
113
|
+
openWorldHint: false,
|
|
114
|
+
},
|
|
115
|
+
scope: SCOPE,
|
|
116
|
+
handler: async (args) => {
|
|
117
|
+
const input = args;
|
|
118
|
+
const bytes = decodeContent(input.content, input.encoding ?? 'utf8');
|
|
119
|
+
const result = await client.postFile(`/tasks/${encodeURIComponent(input.id)}/attachments`, {
|
|
120
|
+
fileName: input.filename,
|
|
121
|
+
bytes,
|
|
122
|
+
// Omitted rather than guessed from the extension: the server
|
|
123
|
+
// sniffs the real content anyway (and refuses script-bearing
|
|
124
|
+
// types on that basis), so a client-side guess would only be a
|
|
125
|
+
// second, weaker opinion.
|
|
126
|
+
contentType: input.content_type,
|
|
127
|
+
}, { idempotencyKey: input.idempotency_key });
|
|
128
|
+
const attachment = (0, mapping_1.mapTaskAttachmentFromWire)(result.data.data);
|
|
129
|
+
return (0, conventions_1.jsonToolResult)({ ...attachment, replayed: result.replayed ?? false });
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
exports.workelUploadTaskAttachment = workelUploadTaskAttachment;
|
|
133
|
+
//# sourceMappingURL=uploadAttachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploadAttachment.js","sourceRoot":"","sources":["../../src/tools/uploadAttachment.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;;;AAEH,6BAAwB;AAExB,4CAA2D;AAC3D,6CAA4D;AAC5D,+CAAuE;AAEvE,MAAM,KAAK,GAAG,mBAAmB,CAAC;AAElC;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,OAAS,CAAC;AAEpC,MAAM,WAAW,GACf,gGAAgG;IAChG,oGAAoG;IACpG,iGAAiG;IACjG,+FAA+F;IAC/F,4FAA4F;IAC5F,4FAA4F;IAC5F,8FAA8F;IAC9F,mGAAmG;IACnG,gGAAgG;IAChG,gGAAgG;IAChG,mGAAmG;IACnG,6FAA6F;IAC7F,2BAA2B;IAC3B,oCAAsB,CAAC;AAWzB;;;;;;;;GAQG;AACH,SAAS,aAAa,CAAC,OAAe,EAAE,QAA2B;IACjE,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QACxB,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC/C,MAAM,O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B;IACD,KAAK,EAAE,KAAK;IACZ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,KAAK,GAAG,IAAuC,CAAC;QACtD,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC;QAErE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAClC,UAAU,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,cAAc,EACpD;YACE,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,KAAK;YACL,6DAA6D;YAC7D,6DAA6D;YAC7D,+DAA+D;YAC/D,0BAA0B;YAC1B,WAAW,EAAE,KAAK,CAAC,YAAY;SAChC,EACD,EAAE,cAAc,EAAE,KAAK,CAAC,eAAe,EAAE,CAC1C,CAAC;QAEF,MAAM,UAAU,GAAG,IAAA,mCAAyB,EAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE/D,OAAO,IAAA,4BAAc,EAAC,EAAE,GAAG,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,KAAK,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF,CAAC,CAAC;AA5CQ,QAAA,0BAA0B,8BA4ClC"}
|
|
@@ -63,7 +63,7 @@ const workelGetProject = (client) => (0, defineTool_1.defineTool)({
|
|
|
63
63
|
handler: async (args) => {
|
|
64
64
|
const { id } = args;
|
|
65
65
|
const result = await client.get(`/projects/${encodeURIComponent(id)}`);
|
|
66
|
-
const project = (0, mapping_1.mapProjectFromWire)(result.data);
|
|
66
|
+
const project = (0, mapping_1.mapProjectFromWire)(result.data.data);
|
|
67
67
|
return (0, conventions_1.jsonToolResult)({
|
|
68
68
|
...project,
|
|
69
69
|
description: project.description === null ? null : (0, output_1.truncateText)(project.description),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workel_projects.js","sourceRoot":"","sources":["../../src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,4BAAkB,EAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrD,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,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `workel_list_task_activity` — `GET /tasks/{id}/activity` (`read:tasks`
|
|
3
|
+
* scope, the same scope as the other task tools — activity is not its own
|
|
4
|
+
* scope on this surface).
|
|
5
|
+
*
|
|
6
|
+
* The task's own history: created, every logged field change, and its
|
|
7
|
+
* comments, newest first. Row selection on the server reuses the SAME
|
|
8
|
+
* predicate the app's task-detail Activity panel uses, so this tool and the
|
|
9
|
+
* UI can never show different histories for the same task.
|
|
10
|
+
*
|
|
11
|
+
* Two things are deliberately absent from every row:
|
|
12
|
+
*
|
|
13
|
+
* - Anything beyond who/what/when. The underlying `activity_logs` row also
|
|
14
|
+
* carries read state, subject payloads and comment snippets; none of it
|
|
15
|
+
* belongs on a timeline read by an integration, and the actor is `{id,
|
|
16
|
+
* name}` only — never an email or avatar.
|
|
17
|
+
* - A machine-readable action type. `action` is the same human prose the app
|
|
18
|
+
* renders ("updated progress", "commented on", suffixed " via API" when the
|
|
19
|
+
* change came through this API). It is copy, and copy changes — branching
|
|
20
|
+
* on its exact text is how a caller breaks on a wording tweak.
|
|
21
|
+
*
|
|
22
|
+
* Unlike `workel_list_task_comments`, this listing IS ordered — newest
|
|
23
|
+
* first — because a history is read backwards from now.
|
|
24
|
+
*/
|
|
25
|
+
import { type ToolFactory } from './defineTool';
|
|
26
|
+
export declare const workelListTaskActivity: ToolFactory;
|
|
27
|
+
//# sourceMappingURL=workel_task_activity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workel_task_activity.d.ts","sourceRoot":"","sources":["../../src/tools/workel_task_activity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAe5D,eAAO,MAAM,sBAAsB,EAAE,WA0BjC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `workel_list_task_activity` — `GET /tasks/{id}/activity` (`read:tasks`
|
|
4
|
+
* scope, the same scope as the other task tools — activity is not its own
|
|
5
|
+
* scope on this surface).
|
|
6
|
+
*
|
|
7
|
+
* The task's own history: created, every logged field change, and its
|
|
8
|
+
* comments, newest first. Row selection on the server reuses the SAME
|
|
9
|
+
* predicate the app's task-detail Activity panel uses, so this tool and the
|
|
10
|
+
* UI can never show different histories for the same task.
|
|
11
|
+
*
|
|
12
|
+
* Two things are deliberately absent from every row:
|
|
13
|
+
*
|
|
14
|
+
* - Anything beyond who/what/when. The underlying `activity_logs` row also
|
|
15
|
+
* carries read state, subject payloads and comment snippets; none of it
|
|
16
|
+
* belongs on a timeline read by an integration, and the actor is `{id,
|
|
17
|
+
* name}` only — never an email or avatar.
|
|
18
|
+
* - A machine-readable action type. `action` is the same human prose the app
|
|
19
|
+
* renders ("updated progress", "commented on", suffixed " via API" when the
|
|
20
|
+
* change came through this API). It is copy, and copy changes — branching
|
|
21
|
+
* on its exact text is how a caller breaks on a wording tweak.
|
|
22
|
+
*
|
|
23
|
+
* Unlike `workel_list_task_comments`, this listing IS ordered — newest
|
|
24
|
+
* first — because a history is read backwards from now.
|
|
25
|
+
*/
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.workelListTaskActivity = void 0;
|
|
28
|
+
const zod_1 = require("zod");
|
|
29
|
+
const mapping_1 = require("../api/mapping");
|
|
30
|
+
const output_1 = require("../output");
|
|
31
|
+
const defineTool_1 = require("./defineTool");
|
|
32
|
+
const conventions_1 = require("./conventions");
|
|
33
|
+
const DESCRIPTION = "List a task's activity history — who did what to it and when — newest first. Covers the task "
|
|
34
|
+
+ 'being created, each logged field change, and its comments. Each row is who acted (actor), what '
|
|
35
|
+
+ 'they did (action), and when (occurred_at); `action` is human-readable prose such as "updated '
|
|
36
|
+
+ 'progress" or "commented on" (suffixed " via API" when the change came through this API), NOT an '
|
|
37
|
+
+ 'enum — never branch on its exact wording. Rows that address one specific reader ("mentioned '
|
|
38
|
+
+ 'you...") are excluded, because "you" has no meaning on a shared timeline. A task id that is not '
|
|
39
|
+
+ 'visible to this API key (its project is archived, private, the inbox project, or in a different '
|
|
40
|
+
+ 'workspace, or the id is genuinely nonexistent) returns a not-found result either way. '
|
|
41
|
+
+ 'Paginated via an opaque `cursor`; a `null` next_cursor means there are no more pages. '
|
|
42
|
+
+ conventions_1.UNTRUSTED_CONTENT_NOTE;
|
|
43
|
+
const workelListTaskActivity = (client) => (0, defineTool_1.defineTool)({
|
|
44
|
+
name: 'workel_list_task_activity',
|
|
45
|
+
description: DESCRIPTION,
|
|
46
|
+
inputSchema: {
|
|
47
|
+
id: zod_1.z.string().min(1),
|
|
48
|
+
limit: conventions_1.limitSchema,
|
|
49
|
+
cursor: zod_1.z.string().optional(),
|
|
50
|
+
},
|
|
51
|
+
annotations: { ...conventions_1.READ_ANNOTATIONS, title: 'List task activity' },
|
|
52
|
+
scope: 'read:tasks',
|
|
53
|
+
handler: async (args) => {
|
|
54
|
+
const { id, limit, cursor } = args;
|
|
55
|
+
const result = await client.get(`/tasks/${encodeURIComponent(id)}/activity`, { limit, cursor });
|
|
56
|
+
const items = result.data.data.map((row) => {
|
|
57
|
+
const mapped = (0, mapping_1.mapTaskActivityFromWire)(row);
|
|
58
|
+
// `action` is short by construction, but it is server-stored text and
|
|
59
|
+
// this is the only place it surfaces — bound it like any other
|
|
60
|
+
// free-text field rather than trusting it to stay short.
|
|
61
|
+
return { ...mapped, action: mapped.action === null ? null : (0, output_1.truncateText)(mapped.action) };
|
|
62
|
+
});
|
|
63
|
+
return (0, conventions_1.jsonToolResult)((0, output_1.listEnvelope)(items, result.data.meta.next_cursor));
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
exports.workelListTaskActivity = workelListTaskActivity;
|
|
67
|
+
//# sourceMappingURL=workel_task_activity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workel_task_activity.js","sourceRoot":"","sources":["../../src/tools/workel_task_activity.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAEH,6BAAwB;AAExB,4CAAyD;AACzD,sCAAuD;AACvD,6CAA4D;AAC5D,+CAAsG;AAEtG,MAAM,WAAW,GACf,+FAA+F;MAC7F,iGAAiG;MACjG,+FAA+F;MAC/F,kGAAkG;MAClG,8FAA8F;MAC9F,kGAAkG;MAClG,kGAAkG;MAClG,wFAAwF;MACxF,wFAAwF;MACxF,oCAAsB,CAAC;AAEpB,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,GAAG,EAAE,EAAE;YACzC,MAAM,MAAM,GAAG,IAAA,iCAAuB,EAAC,GAAG,CAAC,CAAC;YAC5C,sEAAsE;YACtE,+DAA+D;YAC/D,yDAAyD;YACzD,OAAO,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,qBAAY,EAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5F,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,sBAAsB,0BA0B9B"}
|
|
@@ -1 +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;
|
|
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;AA2C5D,eAAO,MAAM,eAAe,EAAE,WAmD1B,CAAC;AAEL,eAAO,MAAM,aAAa,EAAE,WAkBxB,CAAC"}
|
|
@@ -33,11 +33,17 @@ const LIST_DESCRIPTION = 'List tasks visible to this API key\'s workspace, optio
|
|
|
33
33
|
'neither), while updated_since is INCLUSIVE (`>=` — a task updated at exactly that instant IS ' +
|
|
34
34
|
'returned). There is no text search on this endpoint — no title or description keyword filter ' +
|
|
35
35
|
"exists; narrow by project_id/column_id/completed/dates instead, or fetch a page and read the " +
|
|
36
|
-
"titles. Each task's `description` is omitted from this list view
|
|
37
|
-
'
|
|
36
|
+
"titles. Each task's `description` is omitted from this list view, and so are its cover image and " +
|
|
37
|
+
'attachments (call workel_get_task for those); every other field is present. Paginated via an ' +
|
|
38
|
+
'opaque `cursor`; a ' +
|
|
38
39
|
'`null` next_cursor means there are no more pages. ' +
|
|
39
40
|
conventions_1.UNTRUSTED_CONTENT_NOTE;
|
|
40
|
-
const GET_DESCRIPTION = 'Fetch a single task by id
|
|
41
|
+
const GET_DESCRIPTION = 'Fetch a single task by id — the full detail view. Includes everything the list view carries plus ' +
|
|
42
|
+
'the full (possibly truncated) description, the task\'s cover image (cover_image, null when it has ' +
|
|
43
|
+
'none), and its attachments (each with a downloadable url, size, and who uploaded it). For the ' +
|
|
44
|
+
"task's history — who changed what and when — call workel_list_task_activity; for its discussion, " +
|
|
45
|
+
'workel_list_task_comments. Cover image and attachments are read-only through this API: both are ' +
|
|
46
|
+
'file uploads, so no tool can set them. A task id that ' +
|
|
41
47
|
"does not exist, or that exists but isn't visible to this API key (its project is archived, " +
|
|
42
48
|
'private, the inbox project, or in a different workspace), returns the same not-found result ' +
|
|
43
49
|
'either way — this tool cannot be used to tell those cases apart. ' +
|
|
@@ -93,7 +99,7 @@ const workelGetTask = (client) => (0, defineTool_1.defineTool)({
|
|
|
93
99
|
handler: async (args) => {
|
|
94
100
|
const { id } = args;
|
|
95
101
|
const result = await client.get(`/tasks/${encodeURIComponent(id)}`);
|
|
96
|
-
const task = (0, mapping_1.mapTaskFromWire)(result.data);
|
|
102
|
+
const task = (0, mapping_1.mapTaskFromWire)(result.data.data);
|
|
97
103
|
return (0, conventions_1.jsonToolResult)({
|
|
98
104
|
...task,
|
|
99
105
|
description: task.description === null ? null : (0, output_1.truncateText)(task.description),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workel_tasks.js","sourceRoot":"","sources":["../../src/tools/workel_tasks.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAEH,6BAAwB;AAExB,4CAAiD;AACjD,sCAAqE;AACrE,6CAA4D;AAC5D,+CAAsG;AAEtG,MAAM,KAAK,GAAG,YAAY,CAAC;AAE3B,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AAEvC,MAAM,gBAAgB,GACpB,2FAA2F;IAC3F,iGAAiG;IACjG,gGAAgG;IAChG,+FAA+F;IAC/F,+FAA+F;IAC/F,+FAA+F;IAC/F,
|
|
1
|
+
{"version":3,"file":"workel_tasks.js","sourceRoot":"","sources":["../../src/tools/workel_tasks.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAEH,6BAAwB;AAExB,4CAAiD;AACjD,sCAAqE;AACrE,6CAA4D;AAC5D,+CAAsG;AAEtG,MAAM,KAAK,GAAG,YAAY,CAAC;AAE3B,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AAEvC,MAAM,gBAAgB,GACpB,2FAA2F;IAC3F,iGAAiG;IACjG,gGAAgG;IAChG,+FAA+F;IAC/F,+FAA+F;IAC/F,+FAA+F;IAC/F,mGAAmG;IACnG,+FAA+F;IAC/F,qBAAqB;IACrB,oDAAoD;IACpD,oCAAsB,CAAC;AAEzB,MAAM,eAAe,GACnB,mGAAmG;IACnG,oGAAoG;IACpG,gGAAgG;IAChG,mGAAmG;IACnG,kGAAkG;IAClG,wDAAwD;IACxD,6FAA6F;IAC7F,8FAA8F;IAC9F,mEAAmE;IACnE,oCAAsB,CAAC;AAalB,MAAM,eAAe,GAAgB,CAAC,MAAM,EAAE,EAAE,CACrD,IAAA,uBAAU,EAAC;IACT,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,gBAAgB;IAC7B,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AkBrB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `workel_list_time_entries` — `GET /time-entries` (`read:time` scope; time
|
|
3
|
+
* has its own scopes on this surface, NOT `read:tasks`).
|
|
4
|
+
*
|
|
5
|
+
* Time tracked on tasks: each row is one block of time someone ran a timer
|
|
6
|
+
* for or logged by hand. Verified against `TimeEntriesController::index`:
|
|
7
|
+
*
|
|
8
|
+
* - Rows are limited to tasks on the workspace's visible projects (the same
|
|
9
|
+
* `ChecksProjectVisibility` chain every task tool uses), so time on an
|
|
10
|
+
* archived, private or inbox project never appears.
|
|
11
|
+
* - `from` is inclusive and `to` is EXCLUSIVE, both compared against the
|
|
12
|
+
* entry's `started_at` (an entry belongs to the moment it started). Either
|
|
13
|
+
* accepts a date or a date-time; a bare date is midnight UTC. The window
|
|
14
|
+
* cannot exceed 400 days; the server rejects a wider one rather than
|
|
15
|
+
* narrowing it, so this tool does not pre-validate it.
|
|
16
|
+
* - `task_id`, `project_id` and `user_id` narrow by exact id.
|
|
17
|
+
* - A running timer is included, with `running: true` and `ended_at` /
|
|
18
|
+
* `duration_seconds` null: its elapsed time is now minus `started_at`.
|
|
19
|
+
*
|
|
20
|
+
* `note` is the tracker's own free text, so it is bounded like every other
|
|
21
|
+
* free-text field and carries the untrusted-content note.
|
|
22
|
+
*/
|
|
23
|
+
import { type ToolFactory } from './defineTool';
|
|
24
|
+
export declare const workelListTimeEntries: ToolFactory;
|
|
25
|
+
//# sourceMappingURL=workel_time_entries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workel_time_entries.d.ts","sourceRoot":"","sources":["../../src/tools/workel_time_entries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAe5D,eAAO,MAAM,qBAAqB,EAAE,WAwChC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `workel_list_time_entries` — `GET /time-entries` (`read:time` scope; time
|
|
4
|
+
* has its own scopes on this surface, NOT `read:tasks`).
|
|
5
|
+
*
|
|
6
|
+
* Time tracked on tasks: each row is one block of time someone ran a timer
|
|
7
|
+
* for or logged by hand. Verified against `TimeEntriesController::index`:
|
|
8
|
+
*
|
|
9
|
+
* - Rows are limited to tasks on the workspace's visible projects (the same
|
|
10
|
+
* `ChecksProjectVisibility` chain every task tool uses), so time on an
|
|
11
|
+
* archived, private or inbox project never appears.
|
|
12
|
+
* - `from` is inclusive and `to` is EXCLUSIVE, both compared against the
|
|
13
|
+
* entry's `started_at` (an entry belongs to the moment it started). Either
|
|
14
|
+
* accepts a date or a date-time; a bare date is midnight UTC. The window
|
|
15
|
+
* cannot exceed 400 days; the server rejects a wider one rather than
|
|
16
|
+
* narrowing it, so this tool does not pre-validate it.
|
|
17
|
+
* - `task_id`, `project_id` and `user_id` narrow by exact id.
|
|
18
|
+
* - A running timer is included, with `running: true` and `ended_at` /
|
|
19
|
+
* `duration_seconds` null: its elapsed time is now minus `started_at`.
|
|
20
|
+
*
|
|
21
|
+
* `note` is the tracker's own free text, so it is bounded like every other
|
|
22
|
+
* free-text field and carries the untrusted-content note.
|
|
23
|
+
*/
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.workelListTimeEntries = void 0;
|
|
26
|
+
const zod_1 = require("zod");
|
|
27
|
+
const mapping_1 = require("../api/mapping");
|
|
28
|
+
const output_1 = require("../output");
|
|
29
|
+
const defineTool_1 = require("./defineTool");
|
|
30
|
+
const conventions_1 = require("./conventions");
|
|
31
|
+
const DESCRIPTION = 'List time tracked on tasks: each row is one block of time a person ran a timer for or logged by ' +
|
|
32
|
+
'hand, with the task, its project, who tracked it, started_at, ended_at, duration_seconds, ' +
|
|
33
|
+
'billable and an optional note. Narrow by task_id, project_id or user_id, and by from/to: from is ' +
|
|
34
|
+
"inclusive and to is EXCLUSIVE, both compared against each entry's started_at, and either accepts " +
|
|
35
|
+
'a date (midnight UTC) or a date-time; the window cannot exceed 400 days. A running timer appears ' +
|
|
36
|
+
'with running: true and ended_at/duration_seconds null; its elapsed time is now minus started_at. ' +
|
|
37
|
+
'To total time, add duration_seconds across the rows (and the running ones by hand). Only time on ' +
|
|
38
|
+
"tasks of projects visible to this API key is returned. Paginated via an opaque `cursor`; a `null` " +
|
|
39
|
+
'next_cursor means there are no more pages. ' +
|
|
40
|
+
conventions_1.UNTRUSTED_CONTENT_NOTE;
|
|
41
|
+
const workelListTimeEntries = (client) => (0, defineTool_1.defineTool)({
|
|
42
|
+
name: 'workel_list_time_entries',
|
|
43
|
+
description: DESCRIPTION,
|
|
44
|
+
inputSchema: {
|
|
45
|
+
limit: conventions_1.limitSchema,
|
|
46
|
+
cursor: zod_1.z.string().optional(),
|
|
47
|
+
from: zod_1.z.string().optional(),
|
|
48
|
+
to: zod_1.z.string().optional(),
|
|
49
|
+
task_id: zod_1.z.string().optional(),
|
|
50
|
+
project_id: zod_1.z.string().optional(),
|
|
51
|
+
user_id: zod_1.z.string().optional(),
|
|
52
|
+
},
|
|
53
|
+
annotations: { ...conventions_1.READ_ANNOTATIONS, title: 'List time entries' },
|
|
54
|
+
scope: 'read:time',
|
|
55
|
+
handler: async (args) => {
|
|
56
|
+
const { limit, cursor, from, to, task_id, project_id, user_id } = args;
|
|
57
|
+
const result = await client.get('/time-entries', {
|
|
58
|
+
limit,
|
|
59
|
+
cursor,
|
|
60
|
+
from,
|
|
61
|
+
to,
|
|
62
|
+
task_id,
|
|
63
|
+
project_id,
|
|
64
|
+
user_id,
|
|
65
|
+
});
|
|
66
|
+
const items = result.data.data.map((row) => {
|
|
67
|
+
const mapped = (0, mapping_1.mapTimeEntryFromWire)(row);
|
|
68
|
+
return { ...mapped, note: mapped.note === null ? null : (0, output_1.truncateText)(mapped.note) };
|
|
69
|
+
});
|
|
70
|
+
return (0, conventions_1.jsonToolResult)((0, output_1.listEnvelope)(items, result.data.meta.next_cursor));
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
exports.workelListTimeEntries = workelListTimeEntries;
|
|
74
|
+
//# sourceMappingURL=workel_time_entries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workel_time_entries.js","sourceRoot":"","sources":["../../src/tools/workel_time_entries.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAEH,6BAAwB;AAExB,4CAAsD;AACtD,sCAAuD;AACvD,6CAA4D;AAC5D,+CAAsG;AAEtG,MAAM,WAAW,GACf,kGAAkG;IAClG,4FAA4F;IAC5F,mGAAmG;IACnG,mGAAmG;IACnG,mGAAmG;IACnG,mGAAmG;IACnG,mGAAmG;IACnG,oGAAoG;IACpG,6CAA6C;IAC7C,oCAAsB,CAAC;AAElB,MAAM,qBAAqB,GAAgB,CAAC,MAAM,EAAE,EAAE,CAC3D,IAAA,uBAAU,EAAC;IACT,IAAI,EAAE,0BAA0B;IAChC,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;QACzB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC9B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACjC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC/B;IACD,WAAW,EAAE,EAAE,GAAG,8BAAgB,EAAE,KAAK,EAAE,mBAAmB,EAAE;IAChE,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAQjE,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAAgC,eAAe,EAAE;YAC9E,KAAK;YACL,MAAM;YACN,IAAI;YACJ,EAAE;YACF,OAAO;YACP,UAAU;YACV,OAAO;SACR,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACzC,MAAM,MAAM,GAAG,IAAA,8BAAoB,EAAC,GAAG,CAAC,CAAC;YACzC,OAAO,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,qBAAY,EAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACtF,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;AAxCQ,QAAA,qBAAqB,yBAwC7B"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node reads package.json from disk; Workers cannot — it has no filesystem and
|
|
3
|
+
* no `__dirname`, so the read below throws at MODULE LOAD and the whole Worker
|
|
4
|
+
* fails to boot, not just the version lookup.
|
|
5
|
+
*
|
|
6
|
+
* The bundle-time constant is therefore checked first. This is not a fallback
|
|
7
|
+
* for a failed read: on Workers the read must never be attempted at all.
|
|
8
|
+
*
|
|
9
|
+
* The obvious alternative — `import pkg from '../package.json'` — was rejected
|
|
10
|
+
* because package.json sits outside `rootDir`, so enabling resolveJsonModule
|
|
11
|
+
* drags it into the emitted dist tree and changes the published layout.
|
|
12
|
+
*
|
|
13
|
+
* Drift between the injected value and package.json is prevented by a test
|
|
14
|
+
* (see server.redaction.test.ts), matching how RELEASING.md already pins the
|
|
15
|
+
* version across package.json / manifest.json / server.json.
|
|
16
|
+
*/
|
|
1
17
|
export declare const VERSION: string;
|
|
2
18
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAiCA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,OAAO,EAAE,MACiE,CAAC"}
|