@togglhq/mcp 1.6.13 → 1.6.14

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-qnzTs1Xd.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-qnzTs1Xd.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");
@@ -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.14";
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-qnzTs1Xd.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.14",
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",