@workel/mcp 0.2.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.
Files changed (66) hide show
  1. package/README.md +86 -17
  2. package/dist/api/client.d.ts +19 -0
  3. package/dist/api/client.d.ts.map +1 -1
  4. package/dist/api/client.js +41 -6
  5. package/dist/api/client.js.map +1 -1
  6. package/dist/api/mapping.d.ts +13 -1
  7. package/dist/api/mapping.d.ts.map +1 -1
  8. package/dist/api/mapping.js +72 -0
  9. package/dist/api/mapping.js.map +1 -1
  10. package/dist/api/types.d.ts +106 -0
  11. package/dist/api/types.d.ts.map +1 -1
  12. package/dist/config.d.ts +5 -3
  13. package/dist/config.d.ts.map +1 -1
  14. package/dist/config.js +37 -10
  15. package/dist/config.js.map +1 -1
  16. package/dist/server.d.ts +2 -2
  17. package/dist/server.d.ts.map +1 -1
  18. package/dist/server.js +14 -4
  19. package/dist/server.js.map +1 -1
  20. package/dist/tools/createComment.js +1 -1
  21. package/dist/tools/createComment.js.map +1 -1
  22. package/dist/tools/createEvent.js +1 -1
  23. package/dist/tools/createEvent.js.map +1 -1
  24. package/dist/tools/createTask.js +1 -1
  25. package/dist/tools/createTask.js.map +1 -1
  26. package/dist/tools/index.d.ts.map +1 -1
  27. package/dist/tools/index.js +4 -0
  28. package/dist/tools/index.js.map +1 -1
  29. package/dist/tools/logTime.d.ts +28 -0
  30. package/dist/tools/logTime.d.ts.map +1 -0
  31. package/dist/tools/logTime.js +83 -0
  32. package/dist/tools/logTime.js.map +1 -0
  33. package/dist/tools/registration.d.ts +5 -2
  34. package/dist/tools/registration.d.ts.map +1 -1
  35. package/dist/tools/registration.js +9 -2
  36. package/dist/tools/registration.js.map +1 -1
  37. package/dist/tools/updateTask.d.ts +20 -6
  38. package/dist/tools/updateTask.d.ts.map +1 -1
  39. package/dist/tools/updateTask.js +37 -11
  40. package/dist/tools/updateTask.js.map +1 -1
  41. package/dist/tools/uploadAttachment.d.ts +49 -0
  42. package/dist/tools/uploadAttachment.d.ts.map +1 -0
  43. package/dist/tools/uploadAttachment.js +133 -0
  44. package/dist/tools/uploadAttachment.js.map +1 -0
  45. package/dist/tools/workel_projects.js +1 -1
  46. package/dist/tools/workel_projects.js.map +1 -1
  47. package/dist/tools/workel_task_activity.d.ts +27 -0
  48. package/dist/tools/workel_task_activity.d.ts.map +1 -0
  49. package/dist/tools/workel_task_activity.js +67 -0
  50. package/dist/tools/workel_task_activity.js.map +1 -0
  51. package/dist/tools/workel_tasks.d.ts.map +1 -1
  52. package/dist/tools/workel_tasks.js +10 -4
  53. package/dist/tools/workel_tasks.js.map +1 -1
  54. package/dist/tools/workel_time_entries.d.ts +25 -0
  55. package/dist/tools/workel_time_entries.d.ts.map +1 -0
  56. package/dist/tools/workel_time_entries.js +74 -0
  57. package/dist/tools/workel_time_entries.js.map +1 -0
  58. package/dist/version.d.ts +16 -0
  59. package/dist/version.d.ts.map +1 -1
  60. package/dist/version.js +17 -1
  61. package/dist/version.js.map +1 -1
  62. package/dist/worker.d.ts +41 -0
  63. package/dist/worker.d.ts.map +1 -0
  64. package/dist/worker.js +113 -0
  65. package/dist/worker.js.map +1 -0
  66. package/package.json +10 -4
@@ -1 +1 @@
1
- {"version":3,"file":"registration.js","sourceRoot":"","sources":["../../src/tools/registration.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;;;AAuCH,oDAEC;AAgBD,oDAEC;AAzDD,6CAAgD;AAChD,6CAAgD;AAChD,mDAA0D;AAC1D,+CAAkD;AAGlD;;;;;;;GAOG;AACU,QAAA,WAAW,GAAkB;IACxC,6BAAgB;IAChB,6BAAgB;IAChB,uCAAuB;IACvB,+BAAiB;CAClB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,SAAS,sBAAsB,CAAC,KAAyB;IACvD,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC;AAC/D,CAAC;AAED,SAAgB,oBAAoB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACvE,OAAO,sBAAsB,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,oBAAoB,CAAC,gBAAyB,oBAAoB,EAAE;IAClF,OAAO,aAAa,CAAC,CAAC,CAAC,mBAAW,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1C,CAAC"}
1
+ {"version":3,"file":"registration.js","sourceRoot":"","sources":["../../src/tools/registration.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;;;AA8CH,oDAEC;AAgBD,oDAEC;AAhED,6CAAgD;AAChD,6CAAgD;AAChD,mDAA0D;AAC1D,+CAAkD;AAClD,yDAAgE;AAChE,uCAA0C;AAG1C;;;;;;;;;;GAUG;AACU,QAAA,WAAW,GAAkB;IACxC,6BAAgB;IAChB,6BAAgB;IAChB,uCAAuB;IACvB,+BAAiB;IACjB,6CAA0B;IAC1B,uBAAa;CACd,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,SAAS,sBAAsB,CAAC,KAAyB;IACvD,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC;AAC/D,CAAC;AAED,SAAgB,oBAAoB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACvE,OAAO,sBAAsB,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,oBAAoB,CAAC,gBAAyB,oBAAoB,EAAE;IAClF,OAAO,aAAa,CAAC,CAAC,CAAC,mBAAW,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1C,CAAC"}
@@ -20,12 +20,26 @@
20
20
  * `due_time` -> `end_time`) happens ONLY in `../api/mapping.ts`'s
21
21
  * `mapUpdateTaskToWire` — never re-implemented here.
22
22
  *
23
- * This tool CANNOT move a task between columns or projects, and CANNOT
24
- * change its assignees: `card_id`, `project_id`, and `user_ids` are not
25
- * declared by `UpdatePublicTaskRequest::rules()` at all, so there is no wire
26
- * field to forward them through even if this tool's input schema offered
27
- * them — moving/reassigning a task is a different endpoint's job, not yet
28
- * exposed as a tool. `reminder_date` is likewise never exposed here even
23
+ * Board moves and assignee changes ARE supported (`column_id` -> `card_id`,
24
+ * `assignee_ids` -> `user_ids`). An earlier revision of this file said the
25
+ * opposite, and it was true then: `UpdatePublicTaskRequest::rules()` did not
26
+ * declare either field, so there was no wire field to forward them through.
27
+ * Both are now accepted and server-validated — the target column must sit in
28
+ * a project the key can see, and every assignee must be a member of the key's
29
+ * workspace.
30
+ *
31
+ * `assignee_ids` is REPLACEMENT, not append: the given array becomes the
32
+ * assignee set, `[]` clears it, and omitting the key leaves it untouched. It
33
+ * is deliberately NOT nullable in the tool schema — `null` and `[]` would
34
+ * mean the same thing to the server, and offering two spellings of "clear"
35
+ * invites a model to guess. `column_id` is likewise non-nullable: a task
36
+ * always belongs to a column, and the server rejects a null with 422.
37
+ *
38
+ * `project_id` is still not exposed: a task's project follows its column, so
39
+ * `column_id` alone says where the task should live, and a `project_id` that
40
+ * disagreed with `column_id` would have no coherent meaning.
41
+ *
42
+ * `reminder_date` is likewise never exposed here even
29
43
  * though the wire endpoint accepts it — see `../api/mapping.ts`'s
30
44
  * file-level docblock (it is write-only over this API; there is no read
31
45
  * endpoint that ever returns it, so exposing a field a caller can set but
@@ -1 +1 @@
1
- {"version":3,"file":"updateTask.d.ts","sourceRoot":"","sources":["../../src/tools/updateTask.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAKH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAiC5D,eAAO,MAAM,gBAAgB,EAAE,WA0C3B,CAAC"}
1
+ {"version":3,"file":"updateTask.d.ts","sourceRoot":"","sources":["../../src/tools/updateTask.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAKH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAwC5D,eAAO,MAAM,gBAAgB,EAAE,WA+C3B,CAAC"}
@@ -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
- * 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
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. Every field is optional: an OMITTED field is left ' +
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). 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 ' +
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;;;AAEH,6BAAwB;AAExB,4CAA4F;AAC5F,6CAA4D;AAC5D,+CAAuE;AAEvE,MAAM,KAAK,GAAG,aAAa,CAAC;AAE5B,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;AAE7E,MAAM,WAAW,GACf,6FAA6F;IAC7F,gGAAgG;IAChG,mGAAmG;IACnG,oGAAoG;IACpG,mGAAmG;IACnG,gGAAgG;IAChG,gGAAgG;IAChG,8FAA8F;IAC9F,0EAA0E;IAC1E,oCAAsB,CAAC;AAYzB,SAAS,MAAM,CAAC,GAAW,EAAE,GAAW;IACtC,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,C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AAW,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","s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,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/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,sBA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AW,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,MA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AK,WAAW,EAAE,MAAM,cAAc,CAAC;AAqC5D,eAAO,MAAM,eAAe,EAAE,WAmD1B,CAAC;AAEL,eAAO,MAAM,aAAa,EAAE,WAkBxB,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 (call workel_get_task for the " +
37
- 'full description of one task); every other field is present. Paginated via an opaque `cursor`; a ' +
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, including its full (possibly truncated) description. A task id that ' +
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,iGAAiG;IACjG,mGAAmG;IACnG,oDAAoD;IACpD,oCAAsB,CAAC;AAEzB,MAAM,eAAe,GACnB,iGAAiG;IACjG,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,WAAW,EAAE;QACX,KAAK,EAAE,yBAAW;QAClB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC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gB,EAAE,KAAK,EAAE,UAAU,EAAE;IACvD,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,CAAqB,UAAU,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACxF,MAAM,IAAI,GAAG,IAAA,yBAAe,EAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/C,OAAO,IAAA,4BAAc,EAAC;YACpB,GAAG,IAAI;YACP,WAAW,EAAE,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,qBAAY,EAAC,IAAI,CAAC,WAAW,CAAC;SAC/E,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAlBQ,QAAA,aAAa,iBAkBrB"}
@@ -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"}