@togglhq/mcp 1.6.13 → 1.6.15

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/build/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as runMcpCli } from "./src-Dq2vtJKB.js";
2
+ import { n as runMcpCli } from "./src-C4C4XBSw.js";
3
3
  //#region src/cli.ts
4
4
  runMcpCli();
5
5
  //#endregion
package/build/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { n as runMcpCli, t as bootstrapServer } from "./src-Dq2vtJKB.js";
2
+ import { n as runMcpCli, t as bootstrapServer } from "./src-C4C4XBSw.js";
3
3
  export { bootstrapServer, runMcpCli };
@@ -25186,6 +25186,35 @@ var StdioServerTransport = class {
25186
25186
  }
25187
25187
  };
25188
25188
  //#endregion
25189
+ //#region src/auth-cli-args.ts
25190
+ function parseWorkspaceIdArg(raw) {
25191
+ const trimmedId = raw.trim();
25192
+ if (!/^\d+$/.test(trimmedId)) throw new Error(`Invalid workspace ID: ${raw}`);
25193
+ const workspaceId = Number(trimmedId);
25194
+ if (workspaceId <= 0 || workspaceId > Number.MAX_SAFE_INTEGER) throw new Error(`Invalid workspace ID: ${raw}`);
25195
+ return workspaceId;
25196
+ }
25197
+ function parseAuthCliArgs(argv) {
25198
+ const codeIdx = argv.indexOf("--code");
25199
+ const rawCode = codeIdx >= 0 ? argv[codeIdx + 1] : void 0;
25200
+ const authorizationCode = rawCode !== void 0 && !rawCode.startsWith("--") ? rawCode : void 0;
25201
+ const manualFlag = argv.includes("--manual");
25202
+ const workspaceIdFlagIdx = argv.findIndex((arg) => arg === "--workspace-id" || arg.startsWith("--workspace-id="));
25203
+ let workspaceId;
25204
+ if (workspaceIdFlagIdx >= 0) {
25205
+ const flag = argv[workspaceIdFlagIdx];
25206
+ const raw = flag.startsWith("--workspace-id=") ? flag.slice(15) : argv[workspaceIdFlagIdx + 1];
25207
+ if (raw === void 0 || raw === "" || raw.startsWith("--")) throw new Error("Missing value for --workspace-id");
25208
+ workspaceId = parseWorkspaceIdArg(raw);
25209
+ }
25210
+ return {
25211
+ authorizationCode,
25212
+ manualPrompt: manualFlag && authorizationCode === void 0,
25213
+ oauthFlowMode: manualFlag ? "manual" : "local",
25214
+ workspaceId
25215
+ };
25216
+ }
25217
+ //#endregion
25189
25218
  //#region ../cli-core/build/profile-Empu4JWK.js
25190
25219
  const CONFIG_DIR = path.join(os.homedir(), ".toggl");
25191
25220
  const CONFIG_FILE = path.join(CONFIG_DIR, "focus-tools.json");
@@ -30738,7 +30767,7 @@ const PublicMeEntryRequestSchema = /* @__PURE__ */ object$2({
30738
30767
  ]))
30739
30768
  });
30740
30769
  //#endregion
30741
- //#region ../../node_modules/.pnpm/@toggl+queries@2.1.167_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_f2613eb97f17fcabbe00d7ffd1d8c531/node_modules/@toggl/queries/dist/org/invitation/requests.mjs
30770
+ //#region ../../node_modules/.pnpm/@toggl+queries@2.1.194_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_cf1b2da807173ec251cc74d839ac4fe6/node_modules/@toggl/queries/dist/org/invitation/requests.mjs
30742
30771
  async function getInvitations(httpClient, signal) {
30743
30772
  return (await httpClient.get(`invitations`, { signal })).json();
30744
30773
  }
@@ -30755,7 +30784,7 @@ async function resendInvitation(httpClient, organization_id, organization_user_i
30755
30784
  return (await httpClient.post(`organizations/${organization_id}/invitations/${organization_user_id}/resend`, { signal })).json();
30756
30785
  }
30757
30786
  //#endregion
30758
- //#region ../../node_modules/.pnpm/@toggl+queries@2.1.167_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_f2613eb97f17fcabbe00d7ffd1d8c531/node_modules/@toggl/queries/dist/org/utils/requests.mjs
30787
+ //#region ../../node_modules/.pnpm/@toggl+queries@2.1.194_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_cf1b2da807173ec251cc74d839ac4fe6/node_modules/@toggl/queries/dist/org/utils/requests.mjs
30759
30788
  function buildSearchParams$1(params, flattenArrays = false) {
30760
30789
  const searchParams = new URLSearchParams();
30761
30790
  Object.entries(params).forEach(([key, value]) => {
@@ -30767,7 +30796,7 @@ function buildSearchParams$1(params, flattenArrays = false) {
30767
30796
  return searchParams;
30768
30797
  }
30769
30798
  //#endregion
30770
- //#region ../../node_modules/.pnpm/@toggl+queries@2.1.167_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_f2613eb97f17fcabbe00d7ffd1d8c531/node_modules/@toggl/queries/dist/org/organization-user/requests.mjs
30799
+ //#region ../../node_modules/.pnpm/@toggl+queries@2.1.194_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_cf1b2da807173ec251cc74d839ac4fe6/node_modules/@toggl/queries/dist/org/organization-user/requests.mjs
30771
30800
  async function getOrganizationUser(httpClient, organization_id, organization_user_id, signal) {
30772
30801
  return (await httpClient.get(`organizations/${organization_id}/users/${organization_user_id}`, { signal })).json();
30773
30802
  }
@@ -30781,7 +30810,7 @@ async function patchOrganizationUserActive(httpClient, organization_id, organiza
30781
30810
  return (await httpClient.patch(`organizations/${organization_id}/users/${organization_user_id}/active_status/${status}`, { signal })).json();
30782
30811
  }
30783
30812
  //#endregion
30784
- //#region ../../node_modules/.pnpm/@toggl+queries@2.1.167_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_f2613eb97f17fcabbe00d7ffd1d8c531/node_modules/@toggl/queries/dist/org/workspace/requests.mjs
30813
+ //#region ../../node_modules/.pnpm/@toggl+queries@2.1.194_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_cf1b2da807173ec251cc74d839ac4fe6/node_modules/@toggl/queries/dist/org/workspace/requests.mjs
30785
30814
  async function getWorkspaces(httpClient, organization_id, signal) {
30786
30815
  return (await httpClient.get(`organizations/${organization_id}/workspaces`, { signal })).json();
30787
30816
  }
@@ -30801,7 +30830,7 @@ const WorkingHoursUpdateInputSchema = /* @__PURE__ */ object$2({
30801
30830
  });
30802
30831
  const StatusOKSchema = /* @__PURE__ */ object$2({ status: /* @__PURE__ */ string$1() });
30803
30832
  //#endregion
30804
- //#region ../../node_modules/.pnpm/@toggl+queries@2.1.167_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_f2613eb97f17fcabbe00d7ffd1d8c531/node_modules/@toggl/queries/dist/shared-data/utils/requests.mjs
30833
+ //#region ../../node_modules/.pnpm/@toggl+queries@2.1.194_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_cf1b2da807173ec251cc74d839ac4fe6/node_modules/@toggl/queries/dist/shared-data/utils/requests.mjs
30805
30834
  const META_SYMBOL = Symbol.for("querygen:response:meta");
30806
30835
  function withResponseMeta(data, headers, status) {
30807
30836
  if (!data) return data;
@@ -30828,7 +30857,7 @@ function buildSearchParams(params, flattenArrays = false) {
30828
30857
  return searchParams;
30829
30858
  }
30830
30859
  //#endregion
30831
- //#region ../../node_modules/.pnpm/@toggl+queries@2.1.167_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_f2613eb97f17fcabbe00d7ffd1d8c531/node_modules/@toggl/queries/dist/shared-data/public-holidays/requests.mjs
30860
+ //#region ../../node_modules/.pnpm/@toggl+queries@2.1.194_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_cf1b2da807173ec251cc74d839ac4fe6/node_modules/@toggl/queries/dist/shared-data/public-holidays/requests.mjs
30832
30861
  async function getPublicHolidays(httpClient, year, { country, organization_id } = {}, signal) {
30833
30862
  const response = await httpClient.get(`shared_data/api/publicholidays/${year}`, {
30834
30863
  signal,
@@ -30840,12 +30869,12 @@ async function getPublicHolidays(httpClient, year, { country, organization_id }
30840
30869
  return withResponseMeta(await response.json(), response.headers, response.status);
30841
30870
  }
30842
30871
  //#endregion
30843
- //#region ../../node_modules/.pnpm/@toggl+queries@2.1.167_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_f2613eb97f17fcabbe00d7ffd1d8c531/node_modules/@toggl/queries/dist/shared-data/status/requests.mjs
30872
+ //#region ../../node_modules/.pnpm/@toggl+queries@2.1.194_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_cf1b2da807173ec251cc74d839ac4fe6/node_modules/@toggl/queries/dist/shared-data/status/requests.mjs
30844
30873
  async function getStatus(httpClient, signal) {
30845
30874
  return (await httpClient.get(`shared_data/api/status`, { signal })).json();
30846
30875
  }
30847
30876
  //#endregion
30848
- //#region ../../node_modules/.pnpm/@toggl+queries@2.1.167_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_f2613eb97f17fcabbe00d7ffd1d8c531/node_modules/@toggl/queries/dist/org/timeoff/requests.mjs
30877
+ //#region ../../node_modules/.pnpm/@toggl+queries@2.1.194_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_cf1b2da807173ec251cc74d839ac4fe6/node_modules/@toggl/queries/dist/org/timeoff/requests.mjs
30849
30878
  async function timeoffListMyEntries(httpClient, organization_id, { from, to }, signal) {
30850
30879
  return (await httpClient.get(`timeoff/organizations/${organization_id}/me`, {
30851
30880
  signal,
@@ -30873,7 +30902,7 @@ async function timeoffDeleteMyEntry(httpClient, organization_id, id, signal) {
30873
30902
  return response.json();
30874
30903
  }
30875
30904
  //#endregion
30876
- //#region ../../node_modules/.pnpm/@toggl+queries@2.1.167_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_f2613eb97f17fcabbe00d7ffd1d8c531/node_modules/@toggl/queries/dist/shared-data/working-hours/requests.mjs
30905
+ //#region ../../node_modules/.pnpm/@toggl+queries@2.1.194_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_rea_cf1b2da807173ec251cc74d839ac4fe6/node_modules/@toggl/queries/dist/shared-data/working-hours/requests.mjs
30877
30906
  async function getMyWorkingHours(httpClient, organization_id, signal) {
30878
30907
  return (await httpClient.get(`shared_data/api/workinghours/${organization_id}/me`, { signal })).json();
30879
30908
  }
@@ -44954,7 +44983,7 @@ import_main.default.config({
44954
44983
  quiet: true,
44955
44984
  ignore: ["MISSING_ENV_FILE"]
44956
44985
  });
44957
- const packageVersion = "1.6.13";
44986
+ const packageVersion = "1.6.15";
44958
44987
  function resolvePublicUrls() {
44959
44988
  return {
44960
44989
  focusApiUrl: process.env.TOGGL_FOCUS_API_URL ?? "https://focus.toggl.com",
@@ -44972,16 +45001,15 @@ function runMcpCli(options = {}) {
44972
45001
  else bootstrapServer(options);
44973
45002
  }
44974
45003
  function runAuthCommand(urls) {
44975
- const argv = process.argv.slice(3);
44976
- const codeIdx = argv.indexOf("--code");
44977
- const authorizationCode = codeIdx >= 0 && argv[codeIdx + 1] !== void 0 ? argv[codeIdx + 1] : void 0;
44978
- const manualFlag = argv.includes("--manual");
44979
- const manualPrompt = manualFlag && authorizationCode === void 0;
44980
- runAuthFlow(urls.accountsApiUrl, urls.focusApiUrl, {
44981
- authorizationCode,
44982
- manualPrompt,
44983
- oauthFlowMode: manualFlag ? "manual" : "local"
44984
- }).catch((err) => {
45004
+ let authOptions;
45005
+ try {
45006
+ authOptions = parseAuthCliArgs(process.argv.slice(3));
45007
+ } catch (err) {
45008
+ console.error("Invalid arguments:", err instanceof Error ? err.message : err);
45009
+ process.exit(1);
45010
+ return;
45011
+ }
45012
+ runAuthFlow(urls.accountsApiUrl, urls.focusApiUrl, authOptions).catch((err) => {
44985
45013
  console.error("Auth failed:", err.message || err);
44986
45014
  process.exit(1);
44987
45015
  });
@@ -45019,4 +45047,4 @@ function bootstrapServer(options = {}) {
45019
45047
  //#endregion
45020
45048
  export { runMcpCli as n, bootstrapServer as t };
45021
45049
 
45022
- //# sourceMappingURL=src-Dq2vtJKB.js.map
45050
+ //# sourceMappingURL=src-C4C4XBSw.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@togglhq/mcp",
3
- "version": "1.6.13",
3
+ "version": "1.6.15",
4
4
  "description": "Toggl 2.0 MCP server for Claude Code, Claude Desktop, and other MCP clients.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",