@brainervirus/workit-cursor 2.1.2 → 2.1.4
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/.cursor-plugin/plugin.json +1 -1
- package/dist/cursor-session-start.js +0 -2
- package/dist/mcp-server.js +18 -70
- package/dist/workit-hook.js +0 -2
- package/package.json +3 -3
|
@@ -10130,7 +10130,6 @@ var diagnosticLogger, PRESETS, mergePreset = (preset, input = {}, current = {
|
|
|
10130
10130
|
config: {
|
|
10131
10131
|
locale,
|
|
10132
10132
|
localeOptions: Array.isArray(input.localeOptions) ? input.localeOptions : DEFAULTS.localeOptions,
|
|
10133
|
-
timezone: input.timezone ?? DEFAULTS.timezone,
|
|
10134
10133
|
branchPolicy: mergePreset(preset, {
|
|
10135
10134
|
allowed: Array.isArray(input.branchPolicy?.allowed) ? input.branchPolicy.allowed : undefined,
|
|
10136
10135
|
protectedNames: Array.isArray(input.branchPolicy?.protected) ? input.branchPolicy.protected : undefined
|
|
@@ -10189,7 +10188,6 @@ var init_config = __esm(() => {
|
|
|
10189
10188
|
DEFAULTS = {
|
|
10190
10189
|
locale: "en",
|
|
10191
10190
|
localeOptions: ["en", "es-CL", "es-MX", "es-AR", "pt-BR"],
|
|
10192
|
-
timezone: "America/Santiago",
|
|
10193
10191
|
branchPolicy: {
|
|
10194
10192
|
preset: "gitflow",
|
|
10195
10193
|
allowed: [...PRESETS.gitflow.allowed],
|
package/dist/mcp-server.js
CHANGED
|
@@ -22837,7 +22837,6 @@ var LOCALE_RE = /^[a-z]{2,3}(-(?:[A-Z]{2}|[0-9]{3}))?$/;
|
|
|
22837
22837
|
var DEFAULTS = {
|
|
22838
22838
|
locale: "en",
|
|
22839
22839
|
localeOptions: ["en", "es-CL", "es-MX", "es-AR", "pt-BR"],
|
|
22840
|
-
timezone: "America/Santiago",
|
|
22841
22840
|
branchPolicy: {
|
|
22842
22841
|
preset: "gitflow",
|
|
22843
22842
|
allowed: [...PRESETS.gitflow.allowed],
|
|
@@ -22875,7 +22874,6 @@ var parseConfigResult = (raw, file) => {
|
|
|
22875
22874
|
config: {
|
|
22876
22875
|
locale,
|
|
22877
22876
|
localeOptions: Array.isArray(input.localeOptions) ? input.localeOptions : DEFAULTS.localeOptions,
|
|
22878
|
-
timezone: input.timezone ?? DEFAULTS.timezone,
|
|
22879
22877
|
branchPolicy: mergePreset(preset, {
|
|
22880
22878
|
allowed: Array.isArray(input.branchPolicy?.allowed) ? input.branchPolicy.allowed : undefined,
|
|
22881
22879
|
protectedNames: Array.isArray(input.branchPolicy?.protected) ? input.branchPolicy.protected : undefined
|
|
@@ -28312,56 +28310,19 @@ var readYouTrackContextConfig = () => {
|
|
|
28312
28310
|
return { error: "YouTrack configuration is unavailable" };
|
|
28313
28311
|
return { data: readOnlyYouTrackConfig(parsed) };
|
|
28314
28312
|
};
|
|
28315
|
-
|
|
28316
|
-
|
|
28317
|
-
|
|
28318
|
-
|
|
28319
|
-
|
|
28320
|
-
|
|
28321
|
-
|
|
28322
|
-
|
|
28323
|
-
|
|
28324
|
-
|
|
28325
|
-
|
|
28326
|
-
return
|
|
28327
|
-
}
|
|
28328
|
-
function youTrackGreeting(configOverride) {
|
|
28329
|
-
const cfgPath = configOverride ?? youTrackConfigPath();
|
|
28330
|
-
let parsed;
|
|
28331
|
-
try {
|
|
28332
|
-
parsed = JSON.parse(fs9.readFileSync(cfgPath, "utf8"));
|
|
28333
|
-
} catch {
|
|
28334
|
-
return {
|
|
28335
|
-
stdout: "",
|
|
28336
|
-
exitCode: 1,
|
|
28337
|
-
stderr: fs9.existsSync(cfgPath) ? `${cfgPath} is not valid JSON` : `missing youtrack.json: ${cfgPath}`
|
|
28338
|
-
};
|
|
28339
|
-
}
|
|
28340
|
-
if (!isConfigObject(parsed)) {
|
|
28341
|
-
return { stdout: "", exitCode: 1, stderr: `${cfgPath} is not a JSON object` };
|
|
28342
|
-
}
|
|
28343
|
-
const config = parsed;
|
|
28344
|
-
try {
|
|
28345
|
-
const tz = String(config.timezone ?? "America/Santiago");
|
|
28346
|
-
const now = new Date;
|
|
28347
|
-
const { y, m, d, hour, minute } = tzParts(now, tz);
|
|
28348
|
-
const cutoff = String(config.greetingCutoff ?? "12:00").split(":");
|
|
28349
|
-
const cutoffHour = Number(cutoff[0]);
|
|
28350
|
-
const cutoffMinute = Number(cutoff[1] ?? 0);
|
|
28351
|
-
const greetings = config.greetings ?? {};
|
|
28352
|
-
const isMorning = Number(hour) < cutoffHour || Number(hour) === cutoffHour && Number(minute) < cutoffMinute;
|
|
28353
|
-
const greeting = isMorning ? greetings.morning ?? "buenos días" : greetings.afternoon ?? "buenas tardes";
|
|
28354
|
-
const mention = String(config.defaultMention ?? "Alejandra.Flores");
|
|
28355
|
-
return { stdout: `@${mention} Hola, ${greeting}.
|
|
28356
|
-
`, exitCode: 0, stderr: "" };
|
|
28357
|
-
} catch (err) {
|
|
28358
|
-
return {
|
|
28359
|
-
stdout: "",
|
|
28360
|
-
exitCode: 1,
|
|
28361
|
-
stderr: err instanceof Error ? err.message : "greeting failed"
|
|
28362
|
-
};
|
|
28363
|
-
}
|
|
28364
|
-
}
|
|
28313
|
+
var processTimezone = () => Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
28314
|
+
var effectiveWorkTimezone = (cfg) => {
|
|
28315
|
+
const configured = cfg?.timezone;
|
|
28316
|
+
return typeof configured === "string" && configured.trim() ? { timezone: configured.trim(), source: "youtrack.json" } : { timezone: processTimezone(), source: "process" };
|
|
28317
|
+
};
|
|
28318
|
+
var DEFAULT_MEETING_WORK_ITEM_TEXT = "Meetings";
|
|
28319
|
+
var meetingWorkItemText = (cfg, item) => {
|
|
28320
|
+
if (typeof item?.workItemText === "string" && item.workItemText)
|
|
28321
|
+
return item.workItemText;
|
|
28322
|
+
if (typeof cfg?.meetingWorkItemText === "string" && cfg.meetingWorkItemText)
|
|
28323
|
+
return cfg.meetingWorkItemText;
|
|
28324
|
+
return DEFAULT_MEETING_WORK_ITEM_TEXT;
|
|
28325
|
+
};
|
|
28365
28326
|
function youTrackParseDuration(text) {
|
|
28366
28327
|
const lower = String(text).toLowerCase().trim();
|
|
28367
28328
|
let total = 0;
|
|
@@ -28438,7 +28399,6 @@ function parseIssueRef(input) {
|
|
|
28438
28399
|
}
|
|
28439
28400
|
var contextScripts = {
|
|
28440
28401
|
config: readYouTrackContextConfig,
|
|
28441
|
-
greeting: () => youTrackGreeting(youTrackReadOnlyConfigPath()),
|
|
28442
28402
|
parseDuration: (text) => youTrackParseDuration(text),
|
|
28443
28403
|
api: () => ({ error: "YouTrack context is read-only" })
|
|
28444
28404
|
};
|
|
@@ -28467,7 +28427,7 @@ function meetingOptionsFromConfig(cfg) {
|
|
|
28467
28427
|
key,
|
|
28468
28428
|
issue: item.issue,
|
|
28469
28429
|
label: item.label ?? item.issue,
|
|
28470
|
-
workItemText: item
|
|
28430
|
+
workItemText: meetingWorkItemText(cfg, item),
|
|
28471
28431
|
url: item.url ?? (base && item.issue ? `${base}/issue/${item.issue}` : null)
|
|
28472
28432
|
}));
|
|
28473
28433
|
}
|
|
@@ -28477,7 +28437,7 @@ function meetingOptionsFromConfig(cfg) {
|
|
|
28477
28437
|
key: "general",
|
|
28478
28438
|
issue,
|
|
28479
28439
|
label: "General meetings",
|
|
28480
|
-
workItemText:
|
|
28440
|
+
workItemText: meetingWorkItemText(cfg),
|
|
28481
28441
|
url: base && issue ? `${base}/issue/${issue}` : null
|
|
28482
28442
|
}
|
|
28483
28443
|
];
|
|
@@ -28499,17 +28459,9 @@ var readOnlyYouTrackConfig = (cfg) => {
|
|
|
28499
28459
|
const baseUrl = publicUrl(cfg.baseUrl);
|
|
28500
28460
|
if (baseUrl)
|
|
28501
28461
|
safe.baseUrl = baseUrl;
|
|
28502
|
-
for (const key of ["timezone", "
|
|
28462
|
+
for (const key of ["timezone", "meetingIssue", "meetingWorkItemText"])
|
|
28503
28463
|
if (typeof cfg[key] === "string")
|
|
28504
28464
|
safe[key] = cfg[key];
|
|
28505
|
-
if (cfg.greetings && typeof cfg.greetings === "object" && !Array.isArray(cfg.greetings)) {
|
|
28506
|
-
const greetings = {};
|
|
28507
|
-
for (const key of ["morning", "afternoon"])
|
|
28508
|
-
if (typeof cfg.greetings[key] === "string")
|
|
28509
|
-
greetings[key] = cfg.greetings[key];
|
|
28510
|
-
if (Object.keys(greetings).length)
|
|
28511
|
-
safe.greetings = greetings;
|
|
28512
|
-
}
|
|
28513
28465
|
if (cfg.meetingIssues && typeof cfg.meetingIssues === "object" && !Array.isArray(cfg.meetingIssues)) {
|
|
28514
28466
|
safe.meetingIssues = Object.fromEntries(Object.entries(cfg.meetingIssues).flatMap(([key, value]) => {
|
|
28515
28467
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
@@ -28539,16 +28491,12 @@ function context({
|
|
|
28539
28491
|
const cfg = scripts.config();
|
|
28540
28492
|
if (cfg.error)
|
|
28541
28493
|
return { error: cfg.error };
|
|
28542
|
-
const greeting = scripts.greeting();
|
|
28543
|
-
if (greeting.exitCode !== 0) {
|
|
28544
|
-
return { error: (greeting.stderr || greeting.stdout || "greeting failed").trim() };
|
|
28545
|
-
}
|
|
28546
28494
|
const safeConfig = readOnlyYouTrackConfig(cfg.data);
|
|
28547
28495
|
const meetingOptions = meetingOptionsFromConfig(safeConfig);
|
|
28548
28496
|
if (mode === "meetings" && !issue_id && !issue_url && !issue_ref) {
|
|
28549
28497
|
return {
|
|
28550
28498
|
config: safeConfig,
|
|
28551
|
-
|
|
28499
|
+
workTimezone: effectiveWorkTimezone(safeConfig),
|
|
28552
28500
|
mode: "meetings",
|
|
28553
28501
|
requiresMeetingChoice: true,
|
|
28554
28502
|
meetingOptions,
|
|
@@ -28577,7 +28525,7 @@ function context({
|
|
|
28577
28525
|
const selectedMeeting = meetingOptions.find((m) => m.issue === issue);
|
|
28578
28526
|
return {
|
|
28579
28527
|
config: safeConfig,
|
|
28580
|
-
|
|
28528
|
+
workTimezone: effectiveWorkTimezone(safeConfig),
|
|
28581
28529
|
issueId: issue,
|
|
28582
28530
|
issueUrl,
|
|
28583
28531
|
mode: mode ?? (selectedMeeting ? "meetings" : "task"),
|
package/dist/workit-hook.js
CHANGED
|
@@ -10021,7 +10021,6 @@ var LOCALE_RE = /^[a-z]{2,3}(-(?:[A-Z]{2}|[0-9]{3}))?$/;
|
|
|
10021
10021
|
var DEFAULTS = {
|
|
10022
10022
|
locale: "en",
|
|
10023
10023
|
localeOptions: ["en", "es-CL", "es-MX", "es-AR", "pt-BR"],
|
|
10024
|
-
timezone: "America/Santiago",
|
|
10025
10024
|
branchPolicy: {
|
|
10026
10025
|
preset: "gitflow",
|
|
10027
10026
|
allowed: [...PRESETS.gitflow.allowed],
|
|
@@ -10059,7 +10058,6 @@ var parseConfigResult = (raw, file) => {
|
|
|
10059
10058
|
config: {
|
|
10060
10059
|
locale,
|
|
10061
10060
|
localeOptions: Array.isArray(input.localeOptions) ? input.localeOptions : DEFAULTS.localeOptions,
|
|
10062
|
-
timezone: input.timezone ?? DEFAULTS.timezone,
|
|
10063
10061
|
branchPolicy: mergePreset(preset, {
|
|
10064
10062
|
allowed: Array.isArray(input.branchPolicy?.allowed) ? input.branchPolicy.allowed : undefined,
|
|
10065
10063
|
protectedNames: Array.isArray(input.branchPolicy?.protected) ? input.branchPolicy.protected : undefined
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-cursor",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit Cursor plugin — shared MCP transport, native hooks, and fourteen method skills",
|
|
6
6
|
"keywords": [
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"build": "bun scripts/build.ts"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@brainervirus/workit-core": "^2.1.
|
|
48
|
-
"@brainervirus/workit-mcp": "^2.1.
|
|
47
|
+
"@brainervirus/workit-core": "^2.1.4",
|
|
48
|
+
"@brainervirus/workit-mcp": "^2.1.4"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
51
|
"node": ">=24"
|