@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 +1 -1
- package/build/index.js +1 -1
- package/build/{src-Dq2vtJKB.js → src-qnzTs1Xd.js} +40 -12
- package/package.json +1 -1
package/build/cli.js
CHANGED
package/build/index.js
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
44976
|
-
|
|
44977
|
-
|
|
44978
|
-
|
|
44979
|
-
|
|
44980
|
-
|
|
44981
|
-
|
|
44982
|
-
|
|
44983
|
-
|
|
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-
|
|
45050
|
+
//# sourceMappingURL=src-qnzTs1Xd.js.map
|