@brainervirus/workit-codex 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/.codex-plugin/plugin.json +1 -1
- package/dist/launch-mcp.js +18 -70
- package/dist/workit-hook.js +0 -2
- package/package.json +3 -3
package/dist/launch-mcp.js
CHANGED
|
@@ -16984,7 +16984,6 @@ var LOCALE_RE = /^[a-z]{2,3}(-(?:[A-Z]{2}|[0-9]{3}))?$/;
|
|
|
16984
16984
|
var DEFAULTS = {
|
|
16985
16985
|
locale: "en",
|
|
16986
16986
|
localeOptions: ["en", "es-CL", "es-MX", "es-AR", "pt-BR"],
|
|
16987
|
-
timezone: "America/Santiago",
|
|
16988
16987
|
branchPolicy: {
|
|
16989
16988
|
preset: "gitflow",
|
|
16990
16989
|
allowed: [...PRESETS.gitflow.allowed],
|
|
@@ -17022,7 +17021,6 @@ var parseConfigResult = (raw, file) => {
|
|
|
17022
17021
|
config: {
|
|
17023
17022
|
locale,
|
|
17024
17023
|
localeOptions: Array.isArray(input.localeOptions) ? input.localeOptions : DEFAULTS.localeOptions,
|
|
17025
|
-
timezone: input.timezone ?? DEFAULTS.timezone,
|
|
17026
17024
|
branchPolicy: mergePreset(preset, {
|
|
17027
17025
|
allowed: Array.isArray(input.branchPolicy?.allowed) ? input.branchPolicy.allowed : undefined,
|
|
17028
17026
|
protectedNames: Array.isArray(input.branchPolicy?.protected) ? input.branchPolicy.protected : undefined
|
|
@@ -28321,56 +28319,19 @@ var readYouTrackContextConfig = () => {
|
|
|
28321
28319
|
return { error: "YouTrack configuration is unavailable" };
|
|
28322
28320
|
return { data: readOnlyYouTrackConfig(parsed) };
|
|
28323
28321
|
};
|
|
28324
|
-
|
|
28325
|
-
|
|
28326
|
-
|
|
28327
|
-
|
|
28328
|
-
|
|
28329
|
-
|
|
28330
|
-
|
|
28331
|
-
|
|
28332
|
-
|
|
28333
|
-
|
|
28334
|
-
|
|
28335
|
-
return
|
|
28336
|
-
}
|
|
28337
|
-
function youTrackGreeting(configOverride) {
|
|
28338
|
-
const cfgPath = configOverride ?? youTrackConfigPath();
|
|
28339
|
-
let parsed;
|
|
28340
|
-
try {
|
|
28341
|
-
parsed = JSON.parse(fs9.readFileSync(cfgPath, "utf8"));
|
|
28342
|
-
} catch {
|
|
28343
|
-
return {
|
|
28344
|
-
stdout: "",
|
|
28345
|
-
exitCode: 1,
|
|
28346
|
-
stderr: fs9.existsSync(cfgPath) ? `${cfgPath} is not valid JSON` : `missing youtrack.json: ${cfgPath}`
|
|
28347
|
-
};
|
|
28348
|
-
}
|
|
28349
|
-
if (!isConfigObject(parsed)) {
|
|
28350
|
-
return { stdout: "", exitCode: 1, stderr: `${cfgPath} is not a JSON object` };
|
|
28351
|
-
}
|
|
28352
|
-
const config = parsed;
|
|
28353
|
-
try {
|
|
28354
|
-
const tz = String(config.timezone ?? "America/Santiago");
|
|
28355
|
-
const now = new Date;
|
|
28356
|
-
const { y, m, d, hour, minute } = tzParts(now, tz);
|
|
28357
|
-
const cutoff = String(config.greetingCutoff ?? "12:00").split(":");
|
|
28358
|
-
const cutoffHour = Number(cutoff[0]);
|
|
28359
|
-
const cutoffMinute = Number(cutoff[1] ?? 0);
|
|
28360
|
-
const greetings = config.greetings ?? {};
|
|
28361
|
-
const isMorning = Number(hour) < cutoffHour || Number(hour) === cutoffHour && Number(minute) < cutoffMinute;
|
|
28362
|
-
const greeting = isMorning ? greetings.morning ?? "buenos días" : greetings.afternoon ?? "buenas tardes";
|
|
28363
|
-
const mention = String(config.defaultMention ?? "Alejandra.Flores");
|
|
28364
|
-
return { stdout: `@${mention} Hola, ${greeting}.
|
|
28365
|
-
`, exitCode: 0, stderr: "" };
|
|
28366
|
-
} catch (err) {
|
|
28367
|
-
return {
|
|
28368
|
-
stdout: "",
|
|
28369
|
-
exitCode: 1,
|
|
28370
|
-
stderr: err instanceof Error ? err.message : "greeting failed"
|
|
28371
|
-
};
|
|
28372
|
-
}
|
|
28373
|
-
}
|
|
28322
|
+
var processTimezone = () => Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
28323
|
+
var effectiveWorkTimezone = (cfg) => {
|
|
28324
|
+
const configured = cfg?.timezone;
|
|
28325
|
+
return typeof configured === "string" && configured.trim() ? { timezone: configured.trim(), source: "youtrack.json" } : { timezone: processTimezone(), source: "process" };
|
|
28326
|
+
};
|
|
28327
|
+
var DEFAULT_MEETING_WORK_ITEM_TEXT = "Meetings";
|
|
28328
|
+
var meetingWorkItemText = (cfg, item) => {
|
|
28329
|
+
if (typeof item?.workItemText === "string" && item.workItemText)
|
|
28330
|
+
return item.workItemText;
|
|
28331
|
+
if (typeof cfg?.meetingWorkItemText === "string" && cfg.meetingWorkItemText)
|
|
28332
|
+
return cfg.meetingWorkItemText;
|
|
28333
|
+
return DEFAULT_MEETING_WORK_ITEM_TEXT;
|
|
28334
|
+
};
|
|
28374
28335
|
function youTrackParseDuration(text) {
|
|
28375
28336
|
const lower = String(text).toLowerCase().trim();
|
|
28376
28337
|
let total = 0;
|
|
@@ -28447,7 +28408,6 @@ function parseIssueRef(input) {
|
|
|
28447
28408
|
}
|
|
28448
28409
|
var contextScripts = {
|
|
28449
28410
|
config: readYouTrackContextConfig,
|
|
28450
|
-
greeting: () => youTrackGreeting(youTrackReadOnlyConfigPath()),
|
|
28451
28411
|
parseDuration: (text) => youTrackParseDuration(text),
|
|
28452
28412
|
api: () => ({ error: "YouTrack context is read-only" })
|
|
28453
28413
|
};
|
|
@@ -28476,7 +28436,7 @@ function meetingOptionsFromConfig(cfg) {
|
|
|
28476
28436
|
key,
|
|
28477
28437
|
issue: item.issue,
|
|
28478
28438
|
label: item.label ?? item.issue,
|
|
28479
|
-
workItemText: item
|
|
28439
|
+
workItemText: meetingWorkItemText(cfg, item),
|
|
28480
28440
|
url: item.url ?? (base && item.issue ? `${base}/issue/${item.issue}` : null)
|
|
28481
28441
|
}));
|
|
28482
28442
|
}
|
|
@@ -28486,7 +28446,7 @@ function meetingOptionsFromConfig(cfg) {
|
|
|
28486
28446
|
key: "general",
|
|
28487
28447
|
issue,
|
|
28488
28448
|
label: "General meetings",
|
|
28489
|
-
workItemText:
|
|
28449
|
+
workItemText: meetingWorkItemText(cfg),
|
|
28490
28450
|
url: base && issue ? `${base}/issue/${issue}` : null
|
|
28491
28451
|
}
|
|
28492
28452
|
];
|
|
@@ -28508,17 +28468,9 @@ var readOnlyYouTrackConfig = (cfg) => {
|
|
|
28508
28468
|
const baseUrl = publicUrl(cfg.baseUrl);
|
|
28509
28469
|
if (baseUrl)
|
|
28510
28470
|
safe.baseUrl = baseUrl;
|
|
28511
|
-
for (const key of ["timezone", "
|
|
28471
|
+
for (const key of ["timezone", "meetingIssue", "meetingWorkItemText"])
|
|
28512
28472
|
if (typeof cfg[key] === "string")
|
|
28513
28473
|
safe[key] = cfg[key];
|
|
28514
|
-
if (cfg.greetings && typeof cfg.greetings === "object" && !Array.isArray(cfg.greetings)) {
|
|
28515
|
-
const greetings = {};
|
|
28516
|
-
for (const key of ["morning", "afternoon"])
|
|
28517
|
-
if (typeof cfg.greetings[key] === "string")
|
|
28518
|
-
greetings[key] = cfg.greetings[key];
|
|
28519
|
-
if (Object.keys(greetings).length)
|
|
28520
|
-
safe.greetings = greetings;
|
|
28521
|
-
}
|
|
28522
28474
|
if (cfg.meetingIssues && typeof cfg.meetingIssues === "object" && !Array.isArray(cfg.meetingIssues)) {
|
|
28523
28475
|
safe.meetingIssues = Object.fromEntries(Object.entries(cfg.meetingIssues).flatMap(([key, value]) => {
|
|
28524
28476
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
@@ -28548,16 +28500,12 @@ function context({
|
|
|
28548
28500
|
const cfg = scripts.config();
|
|
28549
28501
|
if (cfg.error)
|
|
28550
28502
|
return { error: cfg.error };
|
|
28551
|
-
const greeting = scripts.greeting();
|
|
28552
|
-
if (greeting.exitCode !== 0) {
|
|
28553
|
-
return { error: (greeting.stderr || greeting.stdout || "greeting failed").trim() };
|
|
28554
|
-
}
|
|
28555
28503
|
const safeConfig = readOnlyYouTrackConfig(cfg.data);
|
|
28556
28504
|
const meetingOptions = meetingOptionsFromConfig(safeConfig);
|
|
28557
28505
|
if (mode === "meetings" && !issue_id && !issue_url && !issue_ref) {
|
|
28558
28506
|
return {
|
|
28559
28507
|
config: safeConfig,
|
|
28560
|
-
|
|
28508
|
+
workTimezone: effectiveWorkTimezone(safeConfig),
|
|
28561
28509
|
mode: "meetings",
|
|
28562
28510
|
requiresMeetingChoice: true,
|
|
28563
28511
|
meetingOptions,
|
|
@@ -28586,7 +28534,7 @@ function context({
|
|
|
28586
28534
|
const selectedMeeting = meetingOptions.find((m) => m.issue === issue);
|
|
28587
28535
|
return {
|
|
28588
28536
|
config: safeConfig,
|
|
28589
|
-
|
|
28537
|
+
workTimezone: effectiveWorkTimezone(safeConfig),
|
|
28590
28538
|
issueId: issue,
|
|
28591
28539
|
issueUrl,
|
|
28592
28540
|
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-codex",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit Codex CLI/desktop plugin — shared MCP transport, hooks, and fourteen method skills",
|
|
6
6
|
"keywords": [
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"build": "bun scripts/build.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@brainervirus/workit-core": "^2.1.
|
|
42
|
-
"@brainervirus/workit-mcp": "^2.1.
|
|
41
|
+
"@brainervirus/workit-core": "^2.1.4",
|
|
42
|
+
"@brainervirus/workit-mcp": "^2.1.4"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=24"
|