@tasqmate/mcp 0.3.1 → 0.5.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 CHANGED
@@ -23,6 +23,7 @@ The same three variables the CLI reads.
23
23
  | `TASQMATE_API_KEY` | yes | A Tasqmate agent key (`tq_ag_…`). The server refuses to start without one. |
24
24
  | `TASQMATE_WORKSPACE` | no | Default workspace slug. Every tool takes a `workspace` input that overrides it. |
25
25
  | `TASQMATE_API_URL` | no | API base URL. Defaults to `https://tasqmate.pxlabz.com`. |
26
+ | `TASQMATE_RUN_ID` | no | Set by the Tasqmate Bridge for each run, so Tasqmate knows whose request a call is. Leave it unset. |
26
27
 
27
28
  The `TASQ_*` names from before the Tasqmate rename still work when the new one is unset.
28
29
 
@@ -62,7 +63,7 @@ moves together.
62
63
 
63
64
  ## Tools
64
65
 
65
- Thirty-seven tools, stdio transport only. No resources, no prompts. There is no
66
+ Fifty-two tools, stdio transport only. No resources, no prompts. There is no
66
67
  tool that sends a project update: an agent drafts, and a person sends. There
67
68
  is no tool that shares a project with a guest either: no agent may share,
68
69
  so `tasqmate project share` and the web Share dialog are the only ways in.
@@ -109,6 +110,27 @@ so `tasqmate project share` and the web Share dialog are the only ways in.
109
110
  | `doc_link` | `tasqmate doc link` | `workspace`, `id`, one of `task`, `project`, `team` |
110
111
  | `doc_archive` | `tasqmate doc archive` | `workspace`, `id`, `restore` |
111
112
  | `whoami` | `tasqmate auth whoami` | — |
113
+ | `team_list` | — | `workspace` |
114
+ | `project_view` | — | `workspace`, `project`: status, dates, lead, teams, milestones, task count |
115
+ | `project_create` | — | `workspace`, `name`, `teams` (identifiers, comma-separated), `description`, `status`, `start`, `target`, `lead` |
116
+ | `project_edit` | — | `workspace`, `project`, `name`, `description`, `status`, `start`, `target`, `lead` (`none` clears a date or the lead) |
117
+ | `milestone_create` | — | `workspace`, `project`, `name`, `description`, `target` |
118
+ | `milestone_update` | — | `workspace`, `project`, `milestone` (id or name), `name`, `description`, `target` |
119
+ | `label_create` | — | `workspace`, `name`, `color` (hex) |
120
+ | `initiative_create` | — | `workspace`, `name`, `owner`, `projects` |
121
+ | `initiative_update` | — | `workspace`, `initiative`, `name`, `status`, `owner`, `link`, `unlink` |
122
+ | `cycle_create` | — | `workspace`, `team`, `name`, `start`, `end`, `description` |
123
+ | `task_create_many` | — | `workspace`, `team`, `project`, `tasks` (up to 25: `title`, `description`, `priority`) |
124
+
125
+ ### Building structure (projects, milestones, labels)
126
+
127
+ The tools from `project_create` to `cycle_create` run admin-level actions. An
128
+ agent may run them when its policy grants them (Full does, since 0.5.0's
129
+ server) and the person it is working for is an admin: in a Bridge run, the
130
+ person in the chat or the one who woke it; otherwise its owner. The Bridge
131
+ names the run with `TASQMATE_RUN_ID`, which the server reads from the
132
+ `X-Tasqmate-Run` header. A refused call comes back as `Policy denied (4):` with
133
+ Tasqmate's reason; say what was refused rather than retrying.
112
134
 
113
135
  ### Custom fields
114
136
 
@@ -22378,6 +22378,7 @@ function toTasqmateError(status, body, retryAfterHeader) {
22378
22378
 
22379
22379
  // ../sdk/src/client.ts
22380
22380
  var PROJECT_UPDATES_PAGE_MAX = 100;
22381
+ var RUN_HEADER = "x-tasqmate-run";
22381
22382
  function assertPrefix(token, prefix, label) {
22382
22383
  if (!token.startsWith(prefix)) {
22383
22384
  throw new Error(
@@ -22411,6 +22412,7 @@ var TasqmateClient = class _TasqmateClient {
22411
22412
  #baseUrl;
22412
22413
  #token;
22413
22414
  #fetch;
22415
+ #runId;
22414
22416
  /** A client with no credential, for the two anonymous auth calls. */
22415
22417
  static anonymous(baseUrl, fetchImpl) {
22416
22418
  return new _TasqmateClient({ baseUrl, fetch: fetchImpl });
@@ -22419,6 +22421,7 @@ var TasqmateClient = class _TasqmateClient {
22419
22421
  this.#baseUrl = normaliseBaseUrl(options.baseUrl);
22420
22422
  this.#token = credential(options.auth);
22421
22423
  this.#fetch = options.fetch ?? globalThis.fetch;
22424
+ this.#runId = options.runId === void 0 || options.runId === "" ? void 0 : options.runId;
22422
22425
  }
22423
22426
  async #request(path, init = {}) {
22424
22427
  const { anonymous = false, timeoutMs, ...requestInit } = init;
@@ -22426,6 +22429,7 @@ var TasqmateClient = class _TasqmateClient {
22426
22429
  if (!anonymous) {
22427
22430
  if (this.#token === void 0) throw noCredentialError();
22428
22431
  headers.set("authorization", `Bearer ${this.#token}`);
22432
+ if (this.#runId !== void 0) headers.set(RUN_HEADER, this.#runId);
22429
22433
  }
22430
22434
  if (requestInit.body !== void 0 && !headers.has("content-type")) {
22431
22435
  headers.set("content-type", "application/json");
@@ -22891,6 +22895,28 @@ var TasqmateClient = class _TasqmateClient {
22891
22895
  `/workspaces/${encodeURIComponent(slug)}/agents/me/chats/${encodeURIComponent(chatId)}/reply`,
22892
22896
  { method: "POST", body: JSON.stringify(reply) }
22893
22897
  ),
22898
+ /**
22899
+ * Open a run for one of this agent's wakes (CHAT-2). Opening the same
22900
+ * wake again while its run is still going returns that run.
22901
+ */
22902
+ openRun: (slug, input) => this.#request(
22903
+ `/workspaces/${encodeURIComponent(slug)}/agents/me/runs`,
22904
+ { method: "POST", body: JSON.stringify(input) }
22905
+ ),
22906
+ /**
22907
+ * Post a batch of a run's steps (at most 100). A `seq` already stored is
22908
+ * skipped, so a retried batch is harmless. The answer says whether
22909
+ * someone pressed Stop.
22910
+ */
22911
+ postRunEvents: (slug, runId, events) => this.#request(
22912
+ `/workspaces/${encodeURIComponent(slug)}/agents/me/runs/${encodeURIComponent(runId)}/events`,
22913
+ { method: "POST", body: JSON.stringify({ events }) }
22914
+ ),
22915
+ /** End a run: `done`, `failed` or `stopped`, with one line on how it went. */
22916
+ finishRun: (slug, runId, finish) => this.#request(
22917
+ `/workspaces/${encodeURIComponent(slug)}/agents/me/runs/${encodeURIComponent(runId)}/finish`,
22918
+ { method: "POST", body: JSON.stringify(finish) }
22919
+ ),
22894
22920
  /** The bridge unpairs itself: its record and this key are revoked. */
22895
22921
  unpairBridge: (slug) => this.#request(
22896
22922
  `/workspaces/${encodeURIComponent(slug)}/agents/me/bridge`,
@@ -23079,6 +23105,7 @@ function readEnv(source) {
23079
23105
  for (const [name, legacy] of Object.entries(LEGACY_ENV)) {
23080
23106
  env[name] = source[name] ?? source[legacy];
23081
23107
  }
23108
+ env.TASQMATE_RUN_ID = source.TASQMATE_RUN_ID;
23082
23109
  return env;
23083
23110
  }
23084
23111
  var DEFAULT_API_URL = "https://tasqmate.pxlabz.com";
@@ -23099,14 +23126,16 @@ function loadConfig(env) {
23099
23126
  return {
23100
23127
  apiUrl: env.TASQMATE_API_URL ?? DEFAULT_API_URL,
23101
23128
  workspace,
23102
- credential: { agentKey: key }
23129
+ credential: { agentKey: key },
23130
+ runId: env.TASQMATE_RUN_ID === void 0 || env.TASQMATE_RUN_ID === "" ? void 0 : env.TASQMATE_RUN_ID
23103
23131
  };
23104
23132
  }
23105
23133
  function createClient(config2, fetchImpl) {
23106
23134
  return new TasqmateClient({
23107
23135
  baseUrl: config2.apiUrl,
23108
23136
  auth: config2.credential,
23109
- fetch: fetchImpl
23137
+ fetch: fetchImpl,
23138
+ runId: config2.runId
23110
23139
  });
23111
23140
  }
23112
23141
 
@@ -31044,7 +31073,7 @@ var EMPTY_COMPLETION_RESULT = {
31044
31073
  // package.json
31045
31074
  var package_default = {
31046
31075
  name: "@tasqmate/mcp",
31047
- version: "0.3.1",
31076
+ version: "0.5.0",
31048
31077
  description: "MCP stdio server for Tasqmate: tasks, threads, comments and mentions for MCP-capable agents",
31049
31078
  keywords: [
31050
31079
  "tasqmate",
@@ -31166,10 +31195,9 @@ function toToolError(error48) {
31166
31195
  ]);
31167
31196
  }
31168
31197
  if (error48 instanceof TasqmatePolicyDeniedError) {
31169
- const version2 = error48.policyVersion ?? "?";
31170
- const action = error48.action ?? "this action";
31198
+ const reason = error48.policyVersion === void 0 && error48.message !== "" ? `${error48.message.replace(/\.$/, "")}.` : `policy v${error48.policyVersion ?? "?"} does not allow ${error48.action ?? "this action"}.`;
31171
31199
  return mapped(error48, [
31172
- `${ERROR_PREFIX.policyDenied} policy v${version2} does not allow ${action}. Do not retry it; say what was refused.`
31200
+ `${ERROR_PREFIX.policyDenied} ${reason} Do not retry it; say what was refused.`
31173
31201
  ]);
31174
31202
  }
31175
31203
  if (error48 instanceof TasqmateValidationError) {
@@ -31600,10 +31628,81 @@ function commentIdOf(ref) {
31600
31628
  const hash2 = ref.lastIndexOf("#");
31601
31629
  return hash2 === -1 ? ref.trim() : ref.slice(hash2 + 1).trim();
31602
31630
  }
31631
+ async function resolvePersonId(client, slug, ref) {
31632
+ const trimmed = ref.trim();
31633
+ if (UUID_PATTERN2.test(trimmed)) return trimmed;
31634
+ const wanted = trimmed.toLowerCase();
31635
+ const members = await client.members.list(slug);
31636
+ const matched = members.filter(
31637
+ (member) => member.type === "user" && ((member.name ?? "").toLowerCase() === wanted || (member.email ?? "").toLowerCase() === wanted)
31638
+ );
31639
+ if (matched.length === 0) {
31640
+ throw new UsageError(`No person named "${ref}" in this workspace.`);
31641
+ }
31642
+ if (matched.length > 1) {
31643
+ throw new UsageError(
31644
+ `"${ref}" matches ${matched.length} people. Pass their email or member id.`
31645
+ );
31646
+ }
31647
+ return matched[0]?.id ?? "";
31648
+ }
31649
+ async function resolveTeamIds(client, slug, refs) {
31650
+ const teams = await client.teams.list(slug);
31651
+ const wanted = refs === void 0 || refs.trim() === "" ? [] : refs.split(",").map((ref) => ref.trim()).filter((ref) => ref !== "");
31652
+ if (wanted.length === 0) {
31653
+ if (teams.length === 1 && teams[0] !== void 0) return [teams[0].id];
31654
+ throw new UsageError(
31655
+ teams.length === 0 ? "This workspace has no teams." : `teams is required. Teams: ${teams.map((t) => t.identifier).join(", ")}.`
31656
+ );
31657
+ }
31658
+ return wanted.map((ref) => {
31659
+ const lower = ref.toLowerCase();
31660
+ const match = teams.find(
31661
+ (team) => team.id === ref || team.identifier.toLowerCase() === lower || team.name.toLowerCase() === lower
31662
+ );
31663
+ if (match === void 0) {
31664
+ throw new UsageError(
31665
+ `Unknown team "${ref}". Teams: ${teams.map((t) => t.identifier).join(", ")}.`
31666
+ );
31667
+ }
31668
+ return match.id;
31669
+ });
31670
+ }
31671
+ async function resolveMilestoneId(client, slug, projectId, ref) {
31672
+ const trimmed = ref.trim();
31673
+ if (UUID_PATTERN2.test(trimmed)) return trimmed;
31674
+ const project = await client.projects.get(slug, projectId);
31675
+ const wanted = trimmed.toLowerCase();
31676
+ const matched = project.milestones.filter(
31677
+ (milestone) => milestone.name.toLowerCase() === wanted
31678
+ );
31679
+ if (matched.length !== 1) {
31680
+ throw new UsageError(
31681
+ matched.length === 0 ? `No milestone named "${ref}" on ${project.name}. Milestones: ${project.milestones.map((m) => m.name).join(", ") || "none"}.` : `"${ref}" matches ${matched.length} milestones. Pass the milestone id.`
31682
+ );
31683
+ }
31684
+ return matched[0]?.id ?? "";
31685
+ }
31686
+ async function resolveInitiativeId(client, slug, ref) {
31687
+ const trimmed = ref.trim();
31688
+ if (UUID_PATTERN2.test(trimmed)) return trimmed;
31689
+ const wanted = trimmed.toLowerCase();
31690
+ const matched = (await client.initiatives.list(slug)).filter(
31691
+ (initiative) => initiative.name.toLowerCase() === wanted
31692
+ );
31693
+ if (matched.length !== 1) {
31694
+ throw new UsageError(
31695
+ matched.length === 0 ? `No initiative named "${ref}". Call initiative_list to see the names.` : `"${ref}" matches ${matched.length} initiatives. Pass the initiative id.`
31696
+ );
31697
+ }
31698
+ return matched[0]?.id ?? "";
31699
+ }
31603
31700
 
31604
31701
  // src/tools.ts
31605
31702
  var PRIORITY_INPUT = external_exports.enum(["urgent", "high", "medium", "low", "none"]);
31606
31703
  var HEALTH_INPUT = external_exports.enum(PROJECT_HEALTH_VALUES);
31704
+ var PROJECT_STATUS_INPUT = external_exports.enum(["backlog", "planned", "in_progress", "completed", "cancelled"]);
31705
+ var DEFAULT_LABEL_COLOR = "#6b7280";
31607
31706
  var DATE_INPUT = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Use YYYY-MM-DD");
31608
31707
  var DATE_OR_NONE = external_exports.union([DATE_INPUT, external_exports.literal("none")]);
31609
31708
  function datesInput(taskId, input) {
@@ -32747,6 +32846,315 @@ var definitions = [
32747
32846
  data: await client.projects.list(requireWorkspace(config2, input))
32748
32847
  })
32749
32848
  }),
32849
+ // Workspace structure (AGW-1). Admin-level: Tasqmate runs these only when
32850
+ // the agent's policy grants them and the person it is working for is an
32851
+ // admin; otherwise the call is refused with the reason.
32852
+ define({
32853
+ name: "team_list",
32854
+ description: "List the workspace's teams with their identifiers (ENG, DES\u2026).",
32855
+ schema: external_exports.object({ ...workspaceFields }),
32856
+ run: async ({ client, config: config2 }, input) => ({
32857
+ data: (await client.teams.list(requireWorkspace(config2, input))).map((team) => ({
32858
+ id: team.id,
32859
+ identifier: team.identifier,
32860
+ name: team.name,
32861
+ memberCount: team.memberCount
32862
+ }))
32863
+ })
32864
+ }),
32865
+ define({
32866
+ name: "project_view",
32867
+ description: "Show one project: status, dates, lead, teams, milestones and how many tasks it has.",
32868
+ schema: external_exports.object({
32869
+ ...workspaceFields,
32870
+ project: external_exports.string().describe("Project id or name.")
32871
+ }),
32872
+ run: async ({ client, config: config2 }, input) => {
32873
+ const slug = requireWorkspace(config2, input);
32874
+ const projectId = await resolveProjectId(client, slug, input.project);
32875
+ const { tasks, comments, ...project } = await client.projects.get(slug, projectId);
32876
+ return {
32877
+ data: { ...project, taskCount: tasks.length, commentCount: comments.length }
32878
+ };
32879
+ }
32880
+ }),
32881
+ define({
32882
+ name: "project_create",
32883
+ description: "Create a project on one or more teams (only when the person you work for is an admin).",
32884
+ schema: external_exports.object({
32885
+ ...workspaceFields,
32886
+ name: external_exports.string().describe("Project name."),
32887
+ teams: external_exports.string().optional().describe("Comma-separated team identifiers, e.g. ENG,DES; defaults to the only team."),
32888
+ description: external_exports.string().optional().describe("What the project is for, in plain text."),
32889
+ status: PROJECT_STATUS_INPUT.optional(),
32890
+ start: DATE_INPUT.optional().describe("Start date, YYYY-MM-DD."),
32891
+ target: DATE_INPUT.optional().describe("Target date, YYYY-MM-DD."),
32892
+ lead: external_exports.string().optional().describe("The lead: a person's name, email or member id.")
32893
+ }),
32894
+ run: async ({ client, config: config2 }, input) => {
32895
+ const slug = requireWorkspace(config2, input);
32896
+ const action = {
32897
+ name: input.name,
32898
+ teamIds: await resolveTeamIds(client, slug, input.teams)
32899
+ };
32900
+ if (input.description !== void 0) action.description = input.description;
32901
+ if (input.status !== void 0) action.status = input.status;
32902
+ if (input.start !== void 0) action.startDate = input.start;
32903
+ if (input.target !== void 0) action.targetDate = input.target;
32904
+ if (input.lead !== void 0) {
32905
+ action.leadId = await resolvePersonId(client, slug, input.lead);
32906
+ }
32907
+ const created = await client.dispatch("project.create", slug, action);
32908
+ return {
32909
+ data: created.result,
32910
+ lines: [`Created project "${created.result.project.name}" (${created.result.project.id}).`]
32911
+ };
32912
+ }
32913
+ }),
32914
+ define({
32915
+ name: "project_edit",
32916
+ description: "Edit a project's name, description, status, dates or lead, not a status update (only for an admin).",
32917
+ schema: external_exports.object({
32918
+ ...workspaceFields,
32919
+ project: external_exports.string().describe("Project id or name."),
32920
+ name: external_exports.string().optional(),
32921
+ description: external_exports.string().optional().describe('Plain text; "" clears it.'),
32922
+ status: PROJECT_STATUS_INPUT.optional(),
32923
+ start: DATE_OR_NONE.optional().describe('Start date, YYYY-MM-DD, or "none" to clear it.'),
32924
+ target: DATE_OR_NONE.optional().describe('Target date, YYYY-MM-DD, or "none" to clear it.'),
32925
+ lead: external_exports.string().optional().describe(`The lead: a person's name, email or member id, or "none" to clear it.`)
32926
+ }),
32927
+ run: async ({ client, config: config2 }, input) => {
32928
+ const slug = requireWorkspace(config2, input);
32929
+ const action = {
32930
+ projectId: await resolveProjectId(client, slug, input.project)
32931
+ };
32932
+ if (input.name !== void 0) action.name = input.name;
32933
+ if (input.description !== void 0) {
32934
+ action.description = input.description === "" ? null : input.description;
32935
+ }
32936
+ if (input.status !== void 0) action.status = input.status;
32937
+ if (input.start !== void 0) action.startDate = input.start === "none" ? null : input.start;
32938
+ if (input.target !== void 0) {
32939
+ action.targetDate = input.target === "none" ? null : input.target;
32940
+ }
32941
+ if (input.lead !== void 0) {
32942
+ action.leadId = input.lead === "none" ? null : await resolvePersonId(client, slug, input.lead);
32943
+ }
32944
+ const updated = await client.dispatch("project.update", slug, action);
32945
+ return { data: updated.result, lines: ["Updated the project."] };
32946
+ }
32947
+ }),
32948
+ define({
32949
+ name: "milestone_create",
32950
+ description: "Add a milestone to a project (only for an admin).",
32951
+ schema: external_exports.object({
32952
+ ...workspaceFields,
32953
+ project: external_exports.string().describe("Project id or name."),
32954
+ name: external_exports.string().describe("Milestone name, e.g. Beta."),
32955
+ description: external_exports.string().optional(),
32956
+ target: DATE_INPUT.optional().describe("Target date, YYYY-MM-DD.")
32957
+ }),
32958
+ run: async ({ client, config: config2 }, input) => {
32959
+ const slug = requireWorkspace(config2, input);
32960
+ const action = {
32961
+ projectId: await resolveProjectId(client, slug, input.project),
32962
+ name: input.name
32963
+ };
32964
+ if (input.description !== void 0) action.description = input.description;
32965
+ if (input.target !== void 0) action.targetDate = input.target;
32966
+ const created = await client.dispatch("milestone.create", slug, action);
32967
+ return { data: created.result, lines: [`Added milestone "${input.name}".`] };
32968
+ }
32969
+ }),
32970
+ define({
32971
+ name: "milestone_update",
32972
+ description: "Rename a milestone or change its description or target date (only for an admin).",
32973
+ schema: external_exports.object({
32974
+ ...workspaceFields,
32975
+ project: external_exports.string().describe("Project id or name."),
32976
+ milestone: external_exports.string().describe("Milestone id or name."),
32977
+ name: external_exports.string().optional(),
32978
+ description: external_exports.string().optional().describe('"" clears it.'),
32979
+ target: DATE_OR_NONE.optional().describe('Target date, YYYY-MM-DD, or "none" to clear it.')
32980
+ }),
32981
+ run: async ({ client, config: config2 }, input) => {
32982
+ const slug = requireWorkspace(config2, input);
32983
+ const projectId = await resolveProjectId(client, slug, input.project);
32984
+ const action = {
32985
+ milestoneId: await resolveMilestoneId(client, slug, projectId, input.milestone)
32986
+ };
32987
+ if (input.name !== void 0) action.name = input.name;
32988
+ if (input.description !== void 0) {
32989
+ action.description = input.description === "" ? null : input.description;
32990
+ }
32991
+ if (input.target !== void 0) {
32992
+ action.targetDate = input.target === "none" ? null : input.target;
32993
+ }
32994
+ const updated = await client.dispatch("milestone.update", slug, action);
32995
+ return { data: updated.result, lines: ["Updated the milestone."] };
32996
+ }
32997
+ }),
32998
+ define({
32999
+ name: "label_create",
33000
+ description: "Create a workspace label for tasks (only for an admin).",
33001
+ schema: external_exports.object({
33002
+ ...workspaceFields,
33003
+ name: external_exports.string().describe("Label name."),
33004
+ color: external_exports.string().regex(/^#[0-9a-fA-F]{6}$/, "Use a hex colour such as #6b7280").optional().describe("Hex colour such as #e5533d; a grey when left out.")
33005
+ }),
33006
+ run: async ({ client, config: config2 }, input) => {
33007
+ const slug = requireWorkspace(config2, input);
33008
+ const created = await client.dispatch("label.create", slug, {
33009
+ name: input.name,
33010
+ color: input.color ?? DEFAULT_LABEL_COLOR
33011
+ });
33012
+ return { data: created.result, lines: [`Created label "${input.name}".`] };
33013
+ }
33014
+ }),
33015
+ define({
33016
+ name: "initiative_create",
33017
+ description: "Create an initiative, a group of projects such as a client or goal, and link projects to it (only for an admin).",
33018
+ schema: external_exports.object({
33019
+ ...workspaceFields,
33020
+ name: external_exports.string().describe("Initiative name."),
33021
+ owner: external_exports.string().optional().describe("Owner: a person's name, email or member id."),
33022
+ projects: external_exports.array(external_exports.string()).max(50).optional().describe("Project ids or names to link to it.")
33023
+ }),
33024
+ run: async ({ client, config: config2 }, input) => {
33025
+ const slug = requireWorkspace(config2, input);
33026
+ const projectIds = await Promise.all(
33027
+ (input.projects ?? []).map((ref) => resolveProjectId(client, slug, ref))
33028
+ );
33029
+ const action = { name: input.name };
33030
+ if (input.owner !== void 0) {
33031
+ action.ownerMemberId = await resolvePersonId(client, slug, input.owner);
33032
+ }
33033
+ const steps = new StepRunner();
33034
+ const created = await steps.run(
33035
+ "create",
33036
+ () => client.dispatch("initiative.create", slug, action)
33037
+ );
33038
+ const initiativeId = created.result.initiative.id;
33039
+ for (const [index, projectId] of projectIds.entries()) {
33040
+ await steps.run(
33041
+ `link "${input.projects?.[index] ?? projectId}"`,
33042
+ () => client.dispatch("initiative.linkProject", slug, { initiativeId, projectId })
33043
+ );
33044
+ }
33045
+ return {
33046
+ data: created.result,
33047
+ lines: [
33048
+ `Created initiative "${input.name}"${projectIds.length === 0 ? "" : ` with ${projectIds.length} project(s)`}.`
33049
+ ]
33050
+ };
33051
+ }
33052
+ }),
33053
+ define({
33054
+ name: "initiative_update",
33055
+ description: "Rename an initiative, change its owner or status, or link and unlink projects (only for an admin).",
33056
+ schema: external_exports.object({
33057
+ ...workspaceFields,
33058
+ initiative: external_exports.string().describe("Initiative id or name."),
33059
+ name: external_exports.string().optional(),
33060
+ status: external_exports.enum(["active", "archived"]).optional(),
33061
+ owner: external_exports.string().optional().describe(`Owner: a person's name, email or member id, or "none" to clear it.`),
33062
+ link: external_exports.array(external_exports.string()).max(50).optional().describe("Project ids or names to link."),
33063
+ unlink: external_exports.array(external_exports.string()).max(50).optional().describe("Project ids or names to unlink.")
33064
+ }),
33065
+ run: async ({ client, config: config2 }, input) => {
33066
+ const slug = requireWorkspace(config2, input);
33067
+ const initiativeId = await resolveInitiativeId(client, slug, input.initiative);
33068
+ const steps = new StepRunner();
33069
+ const action = { initiativeId };
33070
+ if (input.name !== void 0) action.name = input.name;
33071
+ if (input.status !== void 0) action.status = input.status;
33072
+ if (input.owner !== void 0) {
33073
+ action.ownerMemberId = input.owner === "none" ? null : await resolvePersonId(client, slug, input.owner);
33074
+ }
33075
+ if (Object.keys(action).length > 1) {
33076
+ await steps.run("update", () => client.dispatch("initiative.update", slug, action));
33077
+ }
33078
+ for (const ref of input.link ?? []) {
33079
+ const projectId = await resolveProjectId(client, slug, ref);
33080
+ await steps.run(
33081
+ `link "${ref}"`,
33082
+ () => client.dispatch("initiative.linkProject", slug, { initiativeId, projectId })
33083
+ );
33084
+ }
33085
+ for (const ref of input.unlink ?? []) {
33086
+ const projectId = await resolveProjectId(client, slug, ref);
33087
+ await steps.run(
33088
+ `unlink "${ref}"`,
33089
+ () => client.dispatch("initiative.unlinkProject", slug, { initiativeId, projectId })
33090
+ );
33091
+ }
33092
+ return { data: { initiativeId }, lines: ["Updated the initiative."] };
33093
+ }
33094
+ }),
33095
+ define({
33096
+ name: "cycle_create",
33097
+ description: "Create a cycle, a sprint, on a team (only for an admin).",
33098
+ schema: external_exports.object({
33099
+ ...workspaceFields,
33100
+ team: external_exports.string().optional().describe("Team identifier, e.g. ENG; defaults to the only team."),
33101
+ name: external_exports.string().describe("Cycle name, e.g. Sprint 12."),
33102
+ start: DATE_INPUT.describe("First day, YYYY-MM-DD."),
33103
+ end: DATE_INPUT.describe("Last day, YYYY-MM-DD."),
33104
+ description: external_exports.string().optional()
33105
+ }),
33106
+ run: async ({ client, config: config2 }, input) => {
33107
+ const slug = requireWorkspace(config2, input);
33108
+ const teamIdentifier = await resolveTeamIdentifier(client, slug, input.team);
33109
+ const action = {
33110
+ teamIdentifier,
33111
+ name: input.name,
33112
+ startDate: input.start,
33113
+ endDate: input.end
33114
+ };
33115
+ if (input.description !== void 0) action.description = input.description;
33116
+ const created = await client.dispatch("cycle.create", slug, action);
33117
+ return { data: created.result, lines: [`Created cycle "${input.name}".`] };
33118
+ }
33119
+ }),
33120
+ define({
33121
+ name: "task_create_many",
33122
+ description: "Create up to 25 tasks at once on one team, optionally all in one project.",
33123
+ schema: external_exports.object({
33124
+ ...workspaceFields,
33125
+ team: external_exports.string().optional().describe("Team identifier, e.g. ENG."),
33126
+ project: external_exports.string().optional().describe("Project id or name for all of them."),
33127
+ tasks: external_exports.array(
33128
+ external_exports.object({
33129
+ title: external_exports.string(),
33130
+ description: external_exports.string().optional().describe(`Description in ${MARKDOWN_BODY}`),
33131
+ priority: PRIORITY_INPUT.optional()
33132
+ })
33133
+ ).min(1).max(25)
33134
+ }),
33135
+ run: async ({ client, config: config2 }, input) => {
33136
+ const slug = requireWorkspace(config2, input);
33137
+ const teamIdentifier = await resolveTeamIdentifier(client, slug, input.team);
33138
+ const projectId = input.project === void 0 ? void 0 : await resolveProjectId(client, slug, input.project);
33139
+ const steps = new StepRunner();
33140
+ const created = [];
33141
+ for (const task of input.tasks) {
33142
+ const action = { teamIdentifier, title: task.title };
33143
+ if (task.description !== void 0) action.descriptionMarkdown = task.description;
33144
+ if (task.priority !== void 0) action.priority = task.priority;
33145
+ if (projectId !== void 0) action.projectId = projectId;
33146
+ const made = await steps.run(
33147
+ `"${task.title}"`,
33148
+ () => client.dispatch("task.create", slug, action)
33149
+ );
33150
+ created.push({ identifier: made.result.identifier, title: task.title });
33151
+ }
33152
+ return {
33153
+ data: { tasks: created },
33154
+ lines: created.map((task) => `Created ${task.identifier} "${task.title}".`)
33155
+ };
33156
+ }
33157
+ }),
32750
33158
  define({
32751
33159
  name: "initiative_list",
32752
33160
  description: "List the workspace's initiatives, the groups of projects, with their project ids.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tasqmate/mcp",
3
- "version": "0.3.1",
3
+ "version": "0.5.0",
4
4
  "description": "MCP stdio server for Tasqmate: tasks, threads, comments and mentions for MCP-capable agents",
5
5
  "keywords": [
6
6
  "tasqmate",
@@ -48,7 +48,7 @@
48
48
  "zod": "4.3.6"
49
49
  },
50
50
  "devDependencies": {
51
- "@tasqmate/sdk": "0.3.1",
51
+ "@tasqmate/sdk": "0.5.0",
52
52
  "@types/bun": "^1.3.12",
53
53
  "tsup": "^8.5.0",
54
54
  "typescript": "^5.7.2"