@pxlabz/tasq-mcp 0.1.17 → 0.1.18
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 +10 -3
- package/dist/tasq-mcp.js +166 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ moves together.
|
|
|
56
56
|
|
|
57
57
|
## Tools
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
Twenty-two tools, stdio transport only. No resources, no prompts. There is no
|
|
60
60
|
tool that sends a project update: an agent drafts, and a person sends. There
|
|
61
61
|
is no tool that shares a project with a guest either: no agent may share,
|
|
62
62
|
so `tasq project share` and the web Share dialog are the only ways in.
|
|
@@ -65,8 +65,10 @@ so `tasq project share` and the web Share dialog are the only ways in.
|
|
|
65
65
|
| ---------------- | ---------------------- | ---------------------------------------------------------------------------- |
|
|
66
66
|
| `task_list` | `tasq task list` | `workspace`, `team`, `status`, `assignee`, `priority`, `project`, `cycle`, `q`, `includeArchived` |
|
|
67
67
|
| `task_view` | `tasq task view` | `workspace`, `id` |
|
|
68
|
-
| `task_create` | `tasq task create` | `workspace`, `title`, `team`, `description`, `priority`, `project`, `labels` |
|
|
69
|
-
| `task_update` | `tasq task update` | `workspace`, `id`, `title`, `description`, `priority`, `status`
|
|
68
|
+
| `task_create` | `tasq task create` | `workspace`, `title`, `team`, `description`, `priority`, `project`, `labels`, `due`, `start`, `parent`, `fields` |
|
|
69
|
+
| `task_update` | `tasq task update` | `workspace`, `id`, `title`, `description`, `priority`, `status`, `due`, `start`, `parent`, `fields` |
|
|
70
|
+
| `task_request_approval` | `tasq task request-approval` | `workspace`, `id`, `approver` |
|
|
71
|
+
| `field_list` | `tasq field list` | `workspace`, `all` |
|
|
70
72
|
| `time_log` | `tasq time log` | `workspace`, `task`, `duration`, `day`, `note`, `billable` (`yes`/`no`/`unset`) |
|
|
71
73
|
| `time_list` | `tasq time list` | `workspace`, `task` |
|
|
72
74
|
| `time_edit` | `tasq time edit` | `workspace`, `entryId`, `duration`, `day`, `note` (`null` clears), `billable` |
|
|
@@ -76,6 +78,7 @@ so `tasq project share` and the web Share dialog are the only ways in.
|
|
|
76
78
|
| `thread_context` | `tasq thread context` | `workspace`, `threadId`, `format` (`markdown` by default) |
|
|
77
79
|
| `project_list` | `tasq project list` | `workspace` |
|
|
78
80
|
| `initiative_list` | `tasq initiative list` | `workspace` |
|
|
81
|
+
| `activity_list` | `tasq activity` | `workspace`, `limit` |
|
|
79
82
|
| `project_update_list` | `tasq update list` | `workspace`, `project`, `limit` |
|
|
80
83
|
| `project_update_draft` | `tasq update draft` | `workspace`, `project`, `health`, `body` |
|
|
81
84
|
| `cycle_current` | `tasq cycle current` | `workspace`, `team` |
|
|
@@ -83,6 +86,10 @@ so `tasq project share` and the web Share dialog are the only ways in.
|
|
|
83
86
|
| `events_ack` | `tasq events ack` | `workspace`, `ids` |
|
|
84
87
|
| `whoami` | `tasq auth whoami` | — |
|
|
85
88
|
|
|
89
|
+
### Custom fields
|
|
90
|
+
|
|
91
|
+
`field_list` returns each field compactly — `id`, `key`, `name`, `type`, `appliesTo`, live `options` by name, `archived` — rather than the full library `tasq field list --json` prints; archived fields only with `all`. `fields` on `task_create` and `task_update` is one object of field key to value, the CLI's repeated `--field key=value`: `{"budget": 1200, "tier": "Gold", "areas": ["Web", "API"], "owner": "ana@example.com"}`. Options and people go by name (a person also by email), a list field also takes `"a,b"`, and `null` clears. Each field is set after the task is written, one `task.setField` per key, and the result leads with a `Name: value.` line per field as the server read it. An unknown key is a usage error naming the task fields, before anything is written.
|
|
92
|
+
|
|
86
93
|
### The event loop
|
|
87
94
|
|
|
88
95
|
`events_listen` is one poll, not a stream: an MCP tool call has to return, so
|
package/dist/tasq-mcp.js
CHANGED
|
@@ -22583,6 +22583,19 @@ var TasqClient = class _TasqClient {
|
|
|
22583
22583
|
`/workspaces/${encodeURIComponent(slug)}/labels`
|
|
22584
22584
|
)).labels
|
|
22585
22585
|
};
|
|
22586
|
+
/**
|
|
22587
|
+
* Custom fields (6.4): the workspace library, archived fields included.
|
|
22588
|
+
* Values are set with `task.setField` and `project.setField`, by field key.
|
|
22589
|
+
*/
|
|
22590
|
+
fields = {
|
|
22591
|
+
list: async (slug) => (await this.#get(
|
|
22592
|
+
`/workspaces/${encodeURIComponent(slug)}/fields`
|
|
22593
|
+
)).fields,
|
|
22594
|
+
/** Set a task's value; null, `[]` or `false` clears it. */
|
|
22595
|
+
setTaskValue: (slug, taskId, fieldKey, value) => this.dispatch("task.setField", slug, { taskId, fieldKey, value }),
|
|
22596
|
+
/** Set a project field's value; null clears it. */
|
|
22597
|
+
setProjectValue: (slug, projectId, fieldKey, value) => this.dispatch("project.setField", slug, { projectId, fieldKey, value })
|
|
22598
|
+
};
|
|
22586
22599
|
agents = {
|
|
22587
22600
|
policy: (slug, agentId) => this.#get(
|
|
22588
22601
|
`/workspaces/${encodeURIComponent(slug)}/agents/${encodeURIComponent(agentId)}/policy`
|
|
@@ -30693,7 +30706,7 @@ var EMPTY_COMPLETION_RESULT = {
|
|
|
30693
30706
|
// package.json
|
|
30694
30707
|
var package_default = {
|
|
30695
30708
|
name: "@pxlabz/tasq-mcp",
|
|
30696
|
-
version: "0.1.
|
|
30709
|
+
version: "0.1.18",
|
|
30697
30710
|
description: "MCP stdio server for Tasq: tasks, threads, comments and mentions for MCP-capable agents",
|
|
30698
30711
|
keywords: [
|
|
30699
30712
|
"tasq",
|
|
@@ -30891,6 +30904,80 @@ function deliveryLines(outcomes, nameByAgentId, nameByMemberId = /* @__PURE__ */
|
|
|
30891
30904
|
return lines;
|
|
30892
30905
|
}
|
|
30893
30906
|
|
|
30907
|
+
// src/fields.ts
|
|
30908
|
+
var UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
30909
|
+
var FIELD_VALUE_INPUT = external_exports.union([
|
|
30910
|
+
external_exports.string(),
|
|
30911
|
+
external_exports.number(),
|
|
30912
|
+
external_exports.boolean(),
|
|
30913
|
+
external_exports.array(external_exports.string()),
|
|
30914
|
+
external_exports.null()
|
|
30915
|
+
]);
|
|
30916
|
+
function compactField(field) {
|
|
30917
|
+
return {
|
|
30918
|
+
id: field.id,
|
|
30919
|
+
key: field.key,
|
|
30920
|
+
name: field.name,
|
|
30921
|
+
type: field.type,
|
|
30922
|
+
appliesTo: field.appliesTo,
|
|
30923
|
+
options: field.options.filter((option) => option.archivedAt === null).map((option) => option.name),
|
|
30924
|
+
archived: field.archivedAt !== null
|
|
30925
|
+
};
|
|
30926
|
+
}
|
|
30927
|
+
function takesList(field) {
|
|
30928
|
+
return field.type === "multi_select" || field.type === "people";
|
|
30929
|
+
}
|
|
30930
|
+
function asPicks(value) {
|
|
30931
|
+
const picks = Array.isArray(value) ? value : String(value).split(",");
|
|
30932
|
+
return picks.map((pick2) => pick2.trim()).filter((pick2) => pick2 !== "");
|
|
30933
|
+
}
|
|
30934
|
+
function resolvePerson(members, field, ref) {
|
|
30935
|
+
if (UUID_PATTERN.test(ref)) return ref;
|
|
30936
|
+
const wanted = ref.toLowerCase();
|
|
30937
|
+
const matched = members.filter(
|
|
30938
|
+
(member) => member.role !== "guest" && ((member.name ?? "").toLowerCase() === wanted || member.type === "user" && (member.email ?? "").toLowerCase() === wanted)
|
|
30939
|
+
);
|
|
30940
|
+
const [only] = matched;
|
|
30941
|
+
if (only === void 0) {
|
|
30942
|
+
throw new UsageError(
|
|
30943
|
+
`No member named "${ref}" for ${field.name}. Pass a name, an email or a member id.`
|
|
30944
|
+
);
|
|
30945
|
+
}
|
|
30946
|
+
if (matched.length > 1) {
|
|
30947
|
+
throw new UsageError(
|
|
30948
|
+
`"${ref}" matches ${matched.length} members for ${field.name}. Pass their email or member id.`
|
|
30949
|
+
);
|
|
30950
|
+
}
|
|
30951
|
+
return only.id;
|
|
30952
|
+
}
|
|
30953
|
+
async function resolveFieldEdits(client, slug, fields) {
|
|
30954
|
+
if (fields.size === 0) return [];
|
|
30955
|
+
const library = await client.fields.list(slug);
|
|
30956
|
+
const taskFields = library.filter(
|
|
30957
|
+
(field) => field.appliesTo === "task" && field.archivedAt === null
|
|
30958
|
+
);
|
|
30959
|
+
const settled = [...fields].map(([key, value]) => {
|
|
30960
|
+
const wanted = key.trim().toLowerCase();
|
|
30961
|
+
const field = taskFields.find((candidate) => candidate.key === wanted);
|
|
30962
|
+
if (field === void 0) {
|
|
30963
|
+
throw new UsageError(
|
|
30964
|
+
taskFields.length === 0 ? `Unknown field "${key}". This workspace has no task fields.` : `Unknown field "${key}". Task fields: ${taskFields.map((candidate) => candidate.key).join(", ")}. Call field_list for their types and options.`
|
|
30965
|
+
);
|
|
30966
|
+
}
|
|
30967
|
+
if (value === null || !takesList(field)) return { field, value };
|
|
30968
|
+
const picks = asPicks(value);
|
|
30969
|
+
return { field, value: picks.length === 0 ? null : picks };
|
|
30970
|
+
});
|
|
30971
|
+
const needsMembers = settled.some(
|
|
30972
|
+
(edit) => edit.field.type === "people" && edit.value !== null
|
|
30973
|
+
);
|
|
30974
|
+
const members = needsMembers ? await client.members.list(slug) : [];
|
|
30975
|
+
return settled.map(({ field, value }) => ({
|
|
30976
|
+
key: field.key,
|
|
30977
|
+
value: field.type === "people" && Array.isArray(value) ? value.map((ref) => resolvePerson(members, field, ref)) : value
|
|
30978
|
+
}));
|
|
30979
|
+
}
|
|
30980
|
+
|
|
30894
30981
|
// src/render/thread-context.ts
|
|
30895
30982
|
function entityHeading(entity) {
|
|
30896
30983
|
return entity.key === null ? `**${entity.title}**` : `**${entity.key}** \u2014 ${entity.title}`;
|
|
@@ -30966,11 +31053,11 @@ function renderThreadContext(bundle) {
|
|
|
30966
31053
|
}
|
|
30967
31054
|
|
|
30968
31055
|
// src/resolve.ts
|
|
30969
|
-
var
|
|
31056
|
+
var UUID_PATTERN2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
30970
31057
|
var TASK_KEY_PATTERN = /^([A-Za-z][A-Za-z0-9]*)-(\d+)$/;
|
|
30971
31058
|
async function resolveTaskId(client, slug, ref) {
|
|
30972
31059
|
const trimmed = ref.trim();
|
|
30973
|
-
if (
|
|
31060
|
+
if (UUID_PATTERN2.test(trimmed)) return trimmed;
|
|
30974
31061
|
const match = TASK_KEY_PATTERN.exec(trimmed);
|
|
30975
31062
|
if (match?.[1] === void 0 || match[2] === void 0) {
|
|
30976
31063
|
throw new UsageError(
|
|
@@ -31025,7 +31112,7 @@ async function resolveLabelIds(client, slug, names) {
|
|
|
31025
31112
|
}
|
|
31026
31113
|
async function resolveProjectId(client, slug, ref) {
|
|
31027
31114
|
const trimmed = ref.trim();
|
|
31028
|
-
if (
|
|
31115
|
+
if (UUID_PATTERN2.test(trimmed)) return trimmed;
|
|
31029
31116
|
const wanted = trimmed.toLowerCase();
|
|
31030
31117
|
const projects = await client.projects.list(slug);
|
|
31031
31118
|
const matched = projects.filter(
|
|
@@ -31075,7 +31162,7 @@ function resolveMentions(members, names) {
|
|
|
31075
31162
|
}
|
|
31076
31163
|
async function resolveApproverId(client, slug, ref) {
|
|
31077
31164
|
const trimmed = ref.trim();
|
|
31078
|
-
if (
|
|
31165
|
+
if (UUID_PATTERN2.test(trimmed)) return trimmed;
|
|
31079
31166
|
const wanted = trimmed.toLowerCase();
|
|
31080
31167
|
const members = await client.members.list(slug);
|
|
31081
31168
|
const matched = members.filter(
|
|
@@ -31109,7 +31196,7 @@ function resolveDurationMinutes(raw) {
|
|
|
31109
31196
|
}
|
|
31110
31197
|
function resolveTimeEntryId(ref) {
|
|
31111
31198
|
const trimmed = ref.trim();
|
|
31112
|
-
if (!
|
|
31199
|
+
if (!UUID_PATTERN2.test(trimmed)) {
|
|
31113
31200
|
throw new UsageError(
|
|
31114
31201
|
`"${ref}" is not a time entry id. Call time_list on the task to see the ids.`
|
|
31115
31202
|
);
|
|
@@ -31142,6 +31229,30 @@ function datesInput(taskId, input) {
|
|
|
31142
31229
|
}
|
|
31143
31230
|
return action;
|
|
31144
31231
|
}
|
|
31232
|
+
var FIELDS_INPUT = external_exports.record(external_exports.string(), FIELD_VALUE_INPUT).describe(
|
|
31233
|
+
'Custom field values by key, e.g. {"budget": 1200, "tier": "Gold", "areas": ["Web", "API"]}: options and people by name, null clears. Call field_list for the keys.'
|
|
31234
|
+
);
|
|
31235
|
+
function fieldPairs(fields) {
|
|
31236
|
+
return new Map(Object.entries(fields ?? {}));
|
|
31237
|
+
}
|
|
31238
|
+
async function applyFieldEdits(client, slug, steps, taskId, edits) {
|
|
31239
|
+
const lines = [];
|
|
31240
|
+
for (const edit of edits) {
|
|
31241
|
+
const response = await steps.run(
|
|
31242
|
+
`field "${edit.key}"`,
|
|
31243
|
+
() => client.dispatch("task.setField", slug, {
|
|
31244
|
+
taskId,
|
|
31245
|
+
fieldKey: edit.key,
|
|
31246
|
+
value: edit.value
|
|
31247
|
+
})
|
|
31248
|
+
);
|
|
31249
|
+
const { field, display } = response.result;
|
|
31250
|
+
lines.push(
|
|
31251
|
+
display.value === null ? `${field.name}: cleared.` : `${field.name}: ${display.value}.`
|
|
31252
|
+
);
|
|
31253
|
+
}
|
|
31254
|
+
return lines;
|
|
31255
|
+
}
|
|
31145
31256
|
var BILLABLE_INPUT = external_exports.enum(["yes", "no", "unset"]);
|
|
31146
31257
|
var BILLABLE_VALUES = {
|
|
31147
31258
|
yes: "billable",
|
|
@@ -31291,7 +31402,8 @@ var definitions = [
|
|
|
31291
31402
|
start: DATE_INPUT.optional().describe("Start date, YYYY-MM-DD."),
|
|
31292
31403
|
parent: external_exports.string().optional().describe(
|
|
31293
31404
|
"Parent task key such as ENG-42, or a task id, to create this as its subtask."
|
|
31294
|
-
)
|
|
31405
|
+
),
|
|
31406
|
+
fields: FIELDS_INPUT.optional()
|
|
31295
31407
|
}),
|
|
31296
31408
|
run: async ({ client, config: config2 }, input) => {
|
|
31297
31409
|
const slug = requireWorkspace(config2, input);
|
|
@@ -31308,6 +31420,11 @@ var definitions = [
|
|
|
31308
31420
|
);
|
|
31309
31421
|
const labelNames = input.labels === void 0 || input.labels === "" ? [] : input.labels.split(",").map((name) => name.trim());
|
|
31310
31422
|
const labelIds = labelNames.length === 0 ? [] : await resolveLabelIds(client, slug, labelNames);
|
|
31423
|
+
const fieldEdits = await resolveFieldEdits(
|
|
31424
|
+
client,
|
|
31425
|
+
slug,
|
|
31426
|
+
fieldPairs(input.fields)
|
|
31427
|
+
);
|
|
31311
31428
|
const action = {
|
|
31312
31429
|
teamIdentifier,
|
|
31313
31430
|
title: input.title
|
|
@@ -31341,12 +31458,19 @@ var definitions = [
|
|
|
31341
31458
|
})
|
|
31342
31459
|
);
|
|
31343
31460
|
}
|
|
31344
|
-
|
|
31461
|
+
const lines = await applyFieldEdits(
|
|
31462
|
+
client,
|
|
31463
|
+
slug,
|
|
31464
|
+
steps,
|
|
31465
|
+
created.result.task.id,
|
|
31466
|
+
fieldEdits
|
|
31467
|
+
);
|
|
31468
|
+
return { data: created.result, lines };
|
|
31345
31469
|
}
|
|
31346
31470
|
}),
|
|
31347
31471
|
define({
|
|
31348
31472
|
name: "task_update",
|
|
31349
|
-
description: "Update a task's title, description, priority, status, dates or
|
|
31473
|
+
description: "Update a task's title, description, priority, status, dates, parent or custom fields.",
|
|
31350
31474
|
schema: external_exports.object({
|
|
31351
31475
|
...workspaceFields,
|
|
31352
31476
|
id: external_exports.string().describe("Task key such as ENG-42, or a task id."),
|
|
@@ -31362,15 +31486,21 @@ var definitions = [
|
|
|
31362
31486
|
),
|
|
31363
31487
|
parent: external_exports.string().optional().describe(
|
|
31364
31488
|
'Parent task key such as ENG-42 or a task id, or "none" to detach it.'
|
|
31365
|
-
)
|
|
31489
|
+
),
|
|
31490
|
+
fields: FIELDS_INPUT.optional()
|
|
31366
31491
|
}),
|
|
31367
31492
|
run: async ({ client, config: config2 }, input) => {
|
|
31368
31493
|
const slug = requireWorkspace(config2, input);
|
|
31369
|
-
if (input.title === void 0 && input.description === void 0 && input.priority === void 0 && input.status === void 0 && input.due === void 0 && input.start === void 0 && input.parent === void 0) {
|
|
31494
|
+
if (input.title === void 0 && input.description === void 0 && input.priority === void 0 && input.status === void 0 && input.due === void 0 && input.start === void 0 && input.parent === void 0 && fieldPairs(input.fields).size === 0) {
|
|
31370
31495
|
throw new UsageError(
|
|
31371
|
-
"Nothing to update. Pass at least one of title, description, priority, status, due, start, parent."
|
|
31496
|
+
"Nothing to update. Pass at least one of title, description, priority, status, due, start, parent, fields."
|
|
31372
31497
|
);
|
|
31373
31498
|
}
|
|
31499
|
+
const fieldEdits = await resolveFieldEdits(
|
|
31500
|
+
client,
|
|
31501
|
+
slug,
|
|
31502
|
+
fieldPairs(input.fields)
|
|
31503
|
+
);
|
|
31374
31504
|
const parentTaskId = input.parent === void 0 ? void 0 : input.parent === "none" ? null : await resolveTaskId(client, slug, input.parent);
|
|
31375
31505
|
const taskId = await resolveTaskId(client, slug, input.id);
|
|
31376
31506
|
const task = await client.tasks.get(slug, taskId);
|
|
@@ -31428,7 +31558,15 @@ var definitions = [
|
|
|
31428
31558
|
});
|
|
31429
31559
|
});
|
|
31430
31560
|
}
|
|
31431
|
-
|
|
31561
|
+
const lines = await applyFieldEdits(
|
|
31562
|
+
client,
|
|
31563
|
+
slug,
|
|
31564
|
+
steps,
|
|
31565
|
+
task.id,
|
|
31566
|
+
fieldEdits
|
|
31567
|
+
);
|
|
31568
|
+
const updated = await client.tasks.get(slug, task.id);
|
|
31569
|
+
return { data: updated, lines };
|
|
31432
31570
|
}
|
|
31433
31571
|
}),
|
|
31434
31572
|
define({
|
|
@@ -31451,6 +31589,21 @@ var definitions = [
|
|
|
31451
31589
|
return { data: response.result };
|
|
31452
31590
|
}
|
|
31453
31591
|
}),
|
|
31592
|
+
define({
|
|
31593
|
+
name: "field_list",
|
|
31594
|
+
description: "List the workspace's custom fields: the keys task_create and task_update take in fields, with types and option names.",
|
|
31595
|
+
schema: external_exports.object({
|
|
31596
|
+
...workspaceFields,
|
|
31597
|
+
all: external_exports.boolean().optional().describe("Include archived fields, which take no new values.")
|
|
31598
|
+
}),
|
|
31599
|
+
run: async ({ client, config: config2 }, input) => {
|
|
31600
|
+
const library = await client.fields.list(
|
|
31601
|
+
requireWorkspace(config2, input)
|
|
31602
|
+
);
|
|
31603
|
+
const fields = input.all === true ? library : library.filter((field) => field.archivedAt === null);
|
|
31604
|
+
return { data: fields.map(compactField) };
|
|
31605
|
+
}
|
|
31606
|
+
}),
|
|
31454
31607
|
define({
|
|
31455
31608
|
name: "time_log",
|
|
31456
31609
|
description: "Log time worked on a task for one day, as yourself.",
|