@brainervirus/workit-cli 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/README.md +1 -1
- package/assets/templates/issue-update.md +1 -2
- package/dist/index.js +155 -270
- package/package.json +4 -4
- package/assets/templates/greeting.md +0 -1
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ workit uninstall # remove host registrations (keeps ~/
|
|
|
34
34
|
workit # help
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
`workit init` guides you through: detected host selection, basic global config (locale,
|
|
37
|
+
`workit init` guides you through: detected host selection, basic global config (locale, branch policy), optional advanced commit policy, YouTrack, VCS, workspaces (scoped hosting/tracker/branch/commit rules, profiles and release tracks), and project hygiene files. The wizard is a TTY application — `workit init` requires an interactive terminal and prints guidance (exiting nonzero) when stdin is not a TTY.
|
|
38
38
|
|
|
39
39
|
Authenticate GitHub or GitLab with `gh auth login` or `glab auth login` before hosting actions; Workit does not need a second provider token file. `workit action` Git/hosting payloads accept `cwd` to target any checkout while task state stays in the session directory. Non-Git directories can host tasks for OS work; YouTrack keeps its own permanent token.
|
|
40
40
|
|
package/dist/index.js
CHANGED
|
@@ -42356,7 +42356,6 @@ var LOCALE_RE = /^[a-z]{2,3}(-(?:[A-Z]{2}|[0-9]{3}))?$/;
|
|
|
42356
42356
|
var DEFAULTS = {
|
|
42357
42357
|
locale: "en",
|
|
42358
42358
|
localeOptions: ["en", "es-CL", "es-MX", "es-AR", "pt-BR"],
|
|
42359
|
-
timezone: "America/Santiago",
|
|
42360
42359
|
branchPolicy: {
|
|
42361
42360
|
preset: "gitflow",
|
|
42362
42361
|
allowed: [...PRESETS.gitflow.allowed],
|
|
@@ -42394,7 +42393,6 @@ var parseConfigResult = (raw, file) => {
|
|
|
42394
42393
|
config: {
|
|
42395
42394
|
locale,
|
|
42396
42395
|
localeOptions: Array.isArray(input.localeOptions) ? input.localeOptions : DEFAULTS.localeOptions,
|
|
42397
|
-
timezone: input.timezone ?? DEFAULTS.timezone,
|
|
42398
42396
|
branchPolicy: mergePreset(preset, {
|
|
42399
42397
|
allowed: Array.isArray(input.branchPolicy?.allowed) ? input.branchPolicy.allowed : undefined,
|
|
42400
42398
|
protectedNames: Array.isArray(input.branchPolicy?.protected) ? input.branchPolicy.protected : undefined
|
|
@@ -50651,7 +50649,7 @@ import {
|
|
|
50651
50649
|
mkdtempSync,
|
|
50652
50650
|
readFileSync as readFileSync12,
|
|
50653
50651
|
readdirSync as readdirSync5,
|
|
50654
|
-
realpathSync as
|
|
50652
|
+
realpathSync as realpathSync3,
|
|
50655
50653
|
renameSync as renameSync2,
|
|
50656
50654
|
rmSync,
|
|
50657
50655
|
statSync as statSync4,
|
|
@@ -51934,9 +51932,6 @@ function previewConversion(input) {
|
|
|
51934
51932
|
if (config.locale !== undefined) {
|
|
51935
51933
|
mappings.push({ key: "locale", from: config.locale, to: config.locale });
|
|
51936
51934
|
}
|
|
51937
|
-
if (config.timezone !== undefined) {
|
|
51938
|
-
mappings.push({ key: "timezone", from: config.timezone, to: config.timezone });
|
|
51939
|
-
}
|
|
51940
51935
|
if (config.branchPolicy !== undefined && isConfigObject(config.branchPolicy)) {
|
|
51941
51936
|
const bp = config.branchPolicy;
|
|
51942
51937
|
const preset = bp.preset ?? "gitflow";
|
|
@@ -51986,7 +51981,7 @@ function applyConversionConfig(configDir, preview, resolutions) {
|
|
|
51986
51981
|
const raw = readJsonObject(configFile) ?? {};
|
|
51987
51982
|
const next = { ...raw };
|
|
51988
51983
|
for (const mapping of preview.mappings) {
|
|
51989
|
-
if (mapping.key === "locale"
|
|
51984
|
+
if (mapping.key === "locale") {
|
|
51990
51985
|
next[mapping.key] = mapping.to;
|
|
51991
51986
|
}
|
|
51992
51987
|
if (mapping.key === "branchPolicy" && !resolutions["branchPolicy.allowed"]) {
|
|
@@ -54644,7 +54639,15 @@ var runDoctor = (options = {}) => {
|
|
|
54644
54639
|
|
|
54645
54640
|
// packages/workit-core/src/core/host-install.ts
|
|
54646
54641
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
54647
|
-
import {
|
|
54642
|
+
import {
|
|
54643
|
+
accessSync,
|
|
54644
|
+
constants as constants2,
|
|
54645
|
+
existsSync as existsSync10,
|
|
54646
|
+
readFileSync as readFileSync11,
|
|
54647
|
+
readdirSync as readdirSync4,
|
|
54648
|
+
realpathSync as realpathSync2,
|
|
54649
|
+
statSync as statSync3
|
|
54650
|
+
} from "node:fs";
|
|
54648
54651
|
import os6 from "node:os";
|
|
54649
54652
|
import path13 from "node:path";
|
|
54650
54653
|
function hostCommand(name, args, options = {}) {
|
|
@@ -54978,6 +54981,11 @@ function runHostCommand(step, context = {}) {
|
|
|
54978
54981
|
};
|
|
54979
54982
|
}
|
|
54980
54983
|
var findNpmCli = (npm) => {
|
|
54984
|
+
try {
|
|
54985
|
+
const resolved = realpathSync2(npm);
|
|
54986
|
+
if (path13.basename(resolved) === "npm-cli.js")
|
|
54987
|
+
return resolved;
|
|
54988
|
+
} catch {}
|
|
54981
54989
|
const dir = path13.dirname(npm);
|
|
54982
54990
|
const candidates = [
|
|
54983
54991
|
path13.join(dir, "node_modules", "npm", "bin", "npm-cli.js"),
|
|
@@ -54995,8 +55003,6 @@ function parseList(raw) {
|
|
|
54995
55003
|
var YT_OVERRIDES = [
|
|
54996
55004
|
{ envKey: "WORKFLOW_YT_BASE_URL", affects: "youtrack.json baseUrl" },
|
|
54997
55005
|
{ envKey: "WORKFLOW_YT_TOKEN_FILE", affects: "youtrack.json tokenFile" },
|
|
54998
|
-
{ envKey: "WORKFLOW_YT_TIMEZONE", affects: "youtrack.json timezone" },
|
|
54999
|
-
{ envKey: "WORKFLOW_YT_MENTION", affects: "youtrack.json defaultMention" },
|
|
55000
55006
|
{ envKey: "WORKFLOW_YT_MEETING_ISSUE", affects: "youtrack.json meetingIssue" },
|
|
55001
55007
|
{ envKey: "WORKFLOW_YT_WEB_MEETING_ISSUE", affects: "youtrack.json web meeting issue" }
|
|
55002
55008
|
];
|
|
@@ -55027,7 +55033,6 @@ function youtrackDraft(values, tokenPath) {
|
|
|
55027
55033
|
return {
|
|
55028
55034
|
baseUrl: values.baseUrl.replace(/\/+$/, ""),
|
|
55029
55035
|
tokenFile: tokenPath,
|
|
55030
|
-
timezone: values.timezone,
|
|
55031
55036
|
locale: values.locale,
|
|
55032
55037
|
tokenDefaults: {
|
|
55033
55038
|
name: "workit",
|
|
@@ -55091,7 +55096,6 @@ function buildSetupPreview(values, opts = {}) {
|
|
|
55091
55096
|
value: {
|
|
55092
55097
|
locale: values.locale,
|
|
55093
55098
|
localeOptions: current.localeOptions,
|
|
55094
|
-
timezone: values.timezone,
|
|
55095
55099
|
...values.commitPolicy === undefined ? {} : { commitPolicy: values.commitPolicy },
|
|
55096
55100
|
branchPolicy: mergePreset(values.branchPreset, {
|
|
55097
55101
|
allowed: values.branchPreset === "custom" ? parseList(values.branchAllowed) : undefined,
|
|
@@ -55597,7 +55601,7 @@ var preservedCursorRules = (src, dest) => {
|
|
|
55597
55601
|
return preserved;
|
|
55598
55602
|
};
|
|
55599
55603
|
function copyPluginDir(src, dest) {
|
|
55600
|
-
const realSrc =
|
|
55604
|
+
const realSrc = realpathSync3(src);
|
|
55601
55605
|
const marker = path14.join(dest, ".workit-root");
|
|
55602
55606
|
const destIsLink = existsSync11(dest) && lstatSync4(dest).isSymbolicLink();
|
|
55603
55607
|
const synced = !destIsLink && readFileSafe(marker)?.trim() === realSrc && samePluginContent(realSrc, dest);
|
|
@@ -56052,16 +56056,6 @@ function validateLocale(locale) {
|
|
|
56052
56056
|
}
|
|
56053
56057
|
return null;
|
|
56054
56058
|
}
|
|
56055
|
-
var KNOWN_TIMEZONES = typeof Intl.supportedValuesOf === "function" ? Intl.supportedValuesOf("timeZone") : null;
|
|
56056
|
-
function validateTimezone(timezone) {
|
|
56057
|
-
const tz = timezone.trim();
|
|
56058
|
-
if (!tz)
|
|
56059
|
-
return "timezone is required";
|
|
56060
|
-
if (KNOWN_TIMEZONES && !KNOWN_TIMEZONES.includes(tz)) {
|
|
56061
|
-
return `unknown timezone "${tz}" — check the IANA name (e.g. America/Santiago)`;
|
|
56062
|
-
}
|
|
56063
|
-
return null;
|
|
56064
|
-
}
|
|
56065
56059
|
function validateBaseUrl(url) {
|
|
56066
56060
|
let parsed;
|
|
56067
56061
|
try {
|
|
@@ -56290,10 +56284,8 @@ import path15 from "node:path";
|
|
|
56290
56284
|
import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
|
|
56291
56285
|
var NEXT = {
|
|
56292
56286
|
platforms: "locale",
|
|
56293
|
-
locale: "
|
|
56294
|
-
localeOther: "
|
|
56295
|
-
timezone: "branchPreset",
|
|
56296
|
-
timezoneOther: "branchPreset",
|
|
56287
|
+
locale: "branchPreset",
|
|
56288
|
+
localeOther: "branchPreset",
|
|
56297
56289
|
branchPreset: "branchAllowed",
|
|
56298
56290
|
branchAllowed: "branchProtected",
|
|
56299
56291
|
branchProtected: "issueTracker",
|
|
@@ -56319,9 +56311,7 @@ var PREV = {
|
|
|
56319
56311
|
platforms: null,
|
|
56320
56312
|
locale: "platforms",
|
|
56321
56313
|
localeOther: "locale",
|
|
56322
|
-
|
|
56323
|
-
timezoneOther: "timezone",
|
|
56324
|
-
branchPreset: "timezone",
|
|
56314
|
+
branchPreset: "locale",
|
|
56325
56315
|
branchAllowed: "branchPreset",
|
|
56326
56316
|
branchProtected: "branchAllowed",
|
|
56327
56317
|
issueTracker: "branchProtected",
|
|
@@ -56378,23 +56368,26 @@ function validateScreen(draft) {
|
|
|
56378
56368
|
const { screen, values } = draft;
|
|
56379
56369
|
switch (screen) {
|
|
56380
56370
|
case "platforms":
|
|
56381
|
-
return values.platforms.length > 0 ? null : {
|
|
56371
|
+
return values.platforms.length > 0 ? null : {
|
|
56372
|
+
field: "platforms",
|
|
56373
|
+
message: "Select at least one platform to continue."
|
|
56374
|
+
};
|
|
56382
56375
|
case "locale":
|
|
56383
56376
|
return values.locale.trim() ? null : { field: "locale", message: "locale is required" };
|
|
56384
|
-
case "timezone":
|
|
56385
|
-
return values.timezone.trim() ? null : { field: "timezone", message: "timezone is required" };
|
|
56386
56377
|
case "localeOther": {
|
|
56387
56378
|
const error = validateLocale(values.locale);
|
|
56388
56379
|
return error ? { field: "locale", message: error } : null;
|
|
56389
56380
|
}
|
|
56390
|
-
case "timezoneOther": {
|
|
56391
|
-
const error = validateTimezone(values.timezone);
|
|
56392
|
-
return error ? { field: "timezone", message: error } : null;
|
|
56393
|
-
}
|
|
56394
56381
|
case "branchAllowed":
|
|
56395
|
-
return parseList(values.branchAllowed).length > 0 ? null : {
|
|
56382
|
+
return parseList(values.branchAllowed).length > 0 ? null : {
|
|
56383
|
+
field: "branchAllowed",
|
|
56384
|
+
message: "at least one allowed branch pattern is required"
|
|
56385
|
+
};
|
|
56396
56386
|
case "branchProtected":
|
|
56397
|
-
return parseList(values.branchProtected).length > 0 ? null : {
|
|
56387
|
+
return parseList(values.branchProtected).length > 0 ? null : {
|
|
56388
|
+
field: "branchProtected",
|
|
56389
|
+
message: "at least one protected branch name is required"
|
|
56390
|
+
};
|
|
56398
56391
|
case "youtrack": {
|
|
56399
56392
|
if (values.baseUrl.trim() === "")
|
|
56400
56393
|
return null;
|
|
@@ -56410,7 +56403,10 @@ function validateScreen(draft) {
|
|
|
56410
56403
|
case "workspaceGlob": {
|
|
56411
56404
|
const glob = (draft.workspaceDraft?.glob ?? "").trim();
|
|
56412
56405
|
if (!glob)
|
|
56413
|
-
return {
|
|
56406
|
+
return {
|
|
56407
|
+
field: "workspaceGlob",
|
|
56408
|
+
message: "workspace pattern is required"
|
|
56409
|
+
};
|
|
56414
56410
|
const v = validateWorkspaceGlob(glob);
|
|
56415
56411
|
return v.ok ? null : { field: "workspaceGlob", message: v.error };
|
|
56416
56412
|
}
|
|
@@ -56422,7 +56418,7 @@ var decodeBranchPreset = (value, fallback) => value === "gitflow" || value === "
|
|
|
56422
56418
|
var decodeVcsProvider = (value, fallback) => value === "gitlab" || value === "github" || value === "skip" ? value : fallback;
|
|
56423
56419
|
var decodeIssueTracker = (value, fallback) => value === "youtrack" || value === "github" || value === "gitlab" || value === "none" ? value : fallback;
|
|
56424
56420
|
function setTextValue(draft, field, value) {
|
|
56425
|
-
const message = field === "locale" ? validateLocale(value) : field === "
|
|
56421
|
+
const message = field === "locale" ? validateLocale(value) : field === "branchAllowed" ? parseList(value).length > 0 ? null : "at least one allowed branch pattern is required" : field === "branchProtected" ? parseList(value).length > 0 ? null : "at least one protected branch name is required" : field === "basePath" ? basePathMessage(value) : value.trim() === "" ? null : validateBaseUrl(value);
|
|
56426
56422
|
if (draft.values[field] === value && (draft.errors[field] ?? undefined) === (message ?? undefined)) {
|
|
56427
56423
|
return draft;
|
|
56428
56424
|
}
|
|
@@ -56440,7 +56436,6 @@ function createInitialDraft(config = readConfig(), opts = {}) {
|
|
|
56440
56436
|
values: {
|
|
56441
56437
|
platforms: opts.platforms ?? [],
|
|
56442
56438
|
locale: config.locale,
|
|
56443
|
-
timezone: config.timezone,
|
|
56444
56439
|
branchPreset: config.branchPolicy.preset,
|
|
56445
56440
|
branchAllowed: policy.allowed.join(", "),
|
|
56446
56441
|
branchProtected: policy.protected.join(", "),
|
|
@@ -56465,7 +56460,10 @@ function reducer3(draft, action) {
|
|
|
56465
56460
|
case "platforms":
|
|
56466
56461
|
if (isDeepStrictEqual3(action.value, draft.values.platforms))
|
|
56467
56462
|
return draft;
|
|
56468
|
-
return {
|
|
56463
|
+
return {
|
|
56464
|
+
...draft,
|
|
56465
|
+
values: { ...draft.values, platforms: action.value }
|
|
56466
|
+
};
|
|
56469
56467
|
case "branchPreset": {
|
|
56470
56468
|
const next = decodeBranchPreset(action.value, draft.values.branchPreset);
|
|
56471
56469
|
if (next === draft.values.branchPreset)
|
|
@@ -56499,9 +56497,15 @@ function reducer3(draft, action) {
|
|
|
56499
56497
|
case "applyProject":
|
|
56500
56498
|
if (action.value === draft.values.applyProject)
|
|
56501
56499
|
return draft;
|
|
56502
|
-
return {
|
|
56500
|
+
return {
|
|
56501
|
+
...draft,
|
|
56502
|
+
values: { ...draft.values, applyProject: action.value }
|
|
56503
|
+
};
|
|
56503
56504
|
case "branchPolicyDetected":
|
|
56504
|
-
return {
|
|
56505
|
+
return {
|
|
56506
|
+
...draft,
|
|
56507
|
+
values: { ...draft.values, branchPolicyDetected: action.value }
|
|
56508
|
+
};
|
|
56505
56509
|
case "branchPolicy":
|
|
56506
56510
|
if (draft.values.branchPolicy)
|
|
56507
56511
|
return draft;
|
|
@@ -56554,15 +56558,16 @@ function reducer3(draft, action) {
|
|
|
56554
56558
|
case "pickOther":
|
|
56555
56559
|
if (draft.screen === "locale")
|
|
56556
56560
|
return { ...draft, screen: "localeOther" };
|
|
56557
|
-
if (draft.screen === "timezone")
|
|
56558
|
-
return { ...draft, screen: "timezoneOther" };
|
|
56559
56561
|
return draft;
|
|
56560
56562
|
case "branchPolicyEditDevelop":
|
|
56561
56563
|
return { ...draft, screen: "branchPolicyDevelop" };
|
|
56562
56564
|
case "next": {
|
|
56563
56565
|
const invalid = validateScreen(draft);
|
|
56564
56566
|
if (invalid)
|
|
56565
|
-
return {
|
|
56567
|
+
return {
|
|
56568
|
+
...draft,
|
|
56569
|
+
errors: { ...draft.errors, [invalid.field]: invalid.message }
|
|
56570
|
+
};
|
|
56566
56571
|
return {
|
|
56567
56572
|
...draft,
|
|
56568
56573
|
screen: nextScreen(draft.screen, draft.values.branchPreset, draft.values.issueTracker, resolveBasePath(draft.values))
|
|
@@ -56662,7 +56667,11 @@ function reducer3(draft, action) {
|
|
|
56662
56667
|
};
|
|
56663
56668
|
}
|
|
56664
56669
|
case "workspaceAdvancedSelect":
|
|
56665
|
-
return {
|
|
56670
|
+
return {
|
|
56671
|
+
...draft,
|
|
56672
|
+
screen: "workspaceAdvancedValue",
|
|
56673
|
+
workspaceEditorField: action.field
|
|
56674
|
+
};
|
|
56666
56675
|
case "workspaceAdvancedSet": {
|
|
56667
56676
|
if (!draft.workspaceDraft)
|
|
56668
56677
|
return draft;
|
|
@@ -56706,7 +56715,10 @@ function reducer3(draft, action) {
|
|
|
56706
56715
|
...draft,
|
|
56707
56716
|
values: {
|
|
56708
56717
|
...draft.values,
|
|
56709
|
-
commitPolicy: {
|
|
56718
|
+
commitPolicy: {
|
|
56719
|
+
...draft.values.commitPolicy,
|
|
56720
|
+
pattern: action.value || undefined
|
|
56721
|
+
}
|
|
56710
56722
|
}
|
|
56711
56723
|
};
|
|
56712
56724
|
case "globalCommitPatternDone":
|
|
@@ -56719,7 +56731,10 @@ function reducer3(draft, action) {
|
|
|
56719
56731
|
...draft.workspaceDraft.profiles,
|
|
56720
56732
|
[name]: { commitPolicy: { preset: "conventional" } }
|
|
56721
56733
|
};
|
|
56722
|
-
return {
|
|
56734
|
+
return {
|
|
56735
|
+
...draft,
|
|
56736
|
+
workspaceDraft: { ...draft.workspaceDraft, profiles }
|
|
56737
|
+
};
|
|
56723
56738
|
}
|
|
56724
56739
|
case "workspaceProfileDelete": {
|
|
56725
56740
|
if (!draft.workspaceDraft?.profiles?.[action.name])
|
|
@@ -56738,7 +56753,13 @@ function reducer3(draft, action) {
|
|
|
56738
56753
|
case "workspaceProfileDefault": {
|
|
56739
56754
|
if (!draft.workspaceDraft?.profiles?.[action.name])
|
|
56740
56755
|
return draft;
|
|
56741
|
-
return {
|
|
56756
|
+
return {
|
|
56757
|
+
...draft,
|
|
56758
|
+
workspaceDraft: {
|
|
56759
|
+
...draft.workspaceDraft,
|
|
56760
|
+
defaultProfile: action.name
|
|
56761
|
+
}
|
|
56762
|
+
};
|
|
56742
56763
|
}
|
|
56743
56764
|
case "workspaceProfileSet": {
|
|
56744
56765
|
const profile = draft.workspaceDraft?.profiles?.[action.name];
|
|
@@ -56766,7 +56787,10 @@ function reducer3(draft, action) {
|
|
|
56766
56787
|
...draft,
|
|
56767
56788
|
workspaceDraft: {
|
|
56768
56789
|
...draft.workspaceDraft,
|
|
56769
|
-
releaseTracks: {
|
|
56790
|
+
releaseTracks: {
|
|
56791
|
+
...draft.workspaceDraft.releaseTracks,
|
|
56792
|
+
[name]: createReleaseTrack()
|
|
56793
|
+
}
|
|
56770
56794
|
}
|
|
56771
56795
|
};
|
|
56772
56796
|
}
|
|
@@ -56775,7 +56799,10 @@ function reducer3(draft, action) {
|
|
|
56775
56799
|
return draft;
|
|
56776
56800
|
const releaseTracks = { ...draft.workspaceDraft.releaseTracks };
|
|
56777
56801
|
delete releaseTracks[action.name];
|
|
56778
|
-
return {
|
|
56802
|
+
return {
|
|
56803
|
+
...draft,
|
|
56804
|
+
workspaceDraft: { ...draft.workspaceDraft, releaseTracks }
|
|
56805
|
+
};
|
|
56779
56806
|
}
|
|
56780
56807
|
case "workspaceTrackSet": {
|
|
56781
56808
|
const track = draft.workspaceDraft?.releaseTracks?.[action.name];
|
|
@@ -56847,7 +56874,7 @@ function workspaceDraftText(draft, field, value) {
|
|
|
56847
56874
|
import os9 from "node:os";
|
|
56848
56875
|
|
|
56849
56876
|
// packages/workit-core/src/core/uninstall.ts
|
|
56850
|
-
import { existsSync as existsSync13, readFileSync as readFileSync13, realpathSync as
|
|
56877
|
+
import { existsSync as existsSync13, readFileSync as readFileSync13, realpathSync as realpathSync4, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "node:fs";
|
|
56851
56878
|
import os8 from "node:os";
|
|
56852
56879
|
import path16 from "node:path";
|
|
56853
56880
|
var resolveUninstallPaths = (options = {}) => {
|
|
@@ -57046,7 +57073,7 @@ var canonicalRemoveDirAllowed = (actionPath, res) => {
|
|
|
57046
57073
|
return false;
|
|
57047
57074
|
}
|
|
57048
57075
|
try {
|
|
57049
|
-
return
|
|
57076
|
+
return realpathSync4(actionPath) === realpathSync4(expected);
|
|
57050
57077
|
} catch {
|
|
57051
57078
|
return true;
|
|
57052
57079
|
}
|
|
@@ -57273,7 +57300,6 @@ var BRANCH_PRESET_DESCRIPTIONS = {
|
|
|
57273
57300
|
var SCREEN_PLACEHOLDERS = {
|
|
57274
57301
|
youtrack: "e.g. https://example.youtrack.cloud",
|
|
57275
57302
|
localeOther: "e.g. en-US or es-CL",
|
|
57276
|
-
timezoneOther: "e.g. America/Santiago",
|
|
57277
57303
|
branchAllowed: "e.g. feature/*, bugfix/*",
|
|
57278
57304
|
branchProtected: "e.g. main, develop",
|
|
57279
57305
|
workspaceName: "e.g. work",
|
|
@@ -57388,38 +57414,8 @@ var commitPresetOptions = [
|
|
|
57388
57414
|
{ label: "Custom pattern", value: "custom" },
|
|
57389
57415
|
{ label: "Auto-detect", value: "auto" }
|
|
57390
57416
|
];
|
|
57391
|
-
var TIMEZONE_FALLBACK = [
|
|
57392
|
-
"UTC",
|
|
57393
|
-
"America/New_York",
|
|
57394
|
-
"America/Santiago",
|
|
57395
|
-
"America/Bogota",
|
|
57396
|
-
"America/Mexico_City",
|
|
57397
|
-
"America/Sao_Paulo",
|
|
57398
|
-
"America/Argentina/Buenos_Aires",
|
|
57399
|
-
"Europe/London",
|
|
57400
|
-
"Europe/Madrid",
|
|
57401
|
-
"Europe/Berlin",
|
|
57402
|
-
"Asia/Tokyo",
|
|
57403
|
-
"Asia/Shanghai",
|
|
57404
|
-
"Asia/Kolkata",
|
|
57405
|
-
"Australia/Sydney"
|
|
57406
|
-
];
|
|
57407
|
-
var TIMEZONES = typeof Intl.supportedValuesOf === "function" ? Intl.supportedValuesOf("timeZone") : TIMEZONE_FALLBACK;
|
|
57408
|
-
var DETECTED_TIMEZONE = Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
57409
|
-
function timezonePickerOptions() {
|
|
57410
|
-
return TIMEZONE_PICKER_OPTIONS;
|
|
57411
|
-
}
|
|
57412
|
-
var TIMEZONE_PICKER_OPTIONS = [
|
|
57413
|
-
{ label: DETECTED_TIMEZONE, value: DETECTED_TIMEZONE },
|
|
57414
|
-
...TIMEZONES.filter((timezone) => timezone !== DETECTED_TIMEZONE).map((timezone) => ({
|
|
57415
|
-
label: timezone,
|
|
57416
|
-
value: timezone
|
|
57417
|
-
})),
|
|
57418
|
-
{ label: "Other…", value: "other" }
|
|
57419
|
-
];
|
|
57420
57417
|
var TEXT_SCREENS = new Set([
|
|
57421
57418
|
"localeOther",
|
|
57422
|
-
"timezoneOther",
|
|
57423
57419
|
"branchAllowed",
|
|
57424
57420
|
"branchProtected",
|
|
57425
57421
|
"youtrack",
|
|
@@ -57430,7 +57426,7 @@ var TEXT_SCREENS = new Set([
|
|
|
57430
57426
|
"globalCommitPattern",
|
|
57431
57427
|
"branchPolicyDevelop"
|
|
57432
57428
|
]);
|
|
57433
|
-
var SEARCH_SCREENS = new Set(["locale"
|
|
57429
|
+
var SEARCH_SCREENS = new Set(["locale"]);
|
|
57434
57430
|
function workspacePreviewTargets(cwd) {
|
|
57435
57431
|
const norm = cwd.replace(/[\\/]+$/, "");
|
|
57436
57432
|
const idx = norm.lastIndexOf("/");
|
|
@@ -58312,80 +58308,6 @@ function Screen({
|
|
|
58312
58308
|
}, undefined, false, undefined, this)
|
|
58313
58309
|
]
|
|
58314
58310
|
}, undefined, true, undefined, this);
|
|
58315
|
-
case "timezone":
|
|
58316
|
-
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
|
|
58317
|
-
flexDirection: "column",
|
|
58318
|
-
gap: 1,
|
|
58319
|
-
children: [
|
|
58320
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
|
|
58321
|
-
bold: true,
|
|
58322
|
-
children: "Step 2 — Global config · Timezone"
|
|
58323
|
-
}, undefined, false, undefined, this),
|
|
58324
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
|
|
58325
|
-
dimColor: true,
|
|
58326
|
-
children: "Timezone (IANA name):"
|
|
58327
|
-
}, undefined, false, undefined, this),
|
|
58328
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
|
|
58329
|
-
children: [
|
|
58330
|
-
"Current: ",
|
|
58331
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
|
|
58332
|
-
color: "green",
|
|
58333
|
-
children: draft.values.timezone
|
|
58334
|
-
}, undefined, false, undefined, this)
|
|
58335
|
-
]
|
|
58336
|
-
}, undefined, true, undefined, this),
|
|
58337
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(SearchSelect, {
|
|
58338
|
-
options: timezonePickerOptions(),
|
|
58339
|
-
value: draft.values.timezone || DETECTED_TIMEZONE,
|
|
58340
|
-
placeholder: "Type to search timezones…",
|
|
58341
|
-
onQueryChange: onSearchQueryChange,
|
|
58342
|
-
onSelect: (value) => {
|
|
58343
|
-
if (value === "other")
|
|
58344
|
-
dispatch({ type: "pickOther" });
|
|
58345
|
-
else {
|
|
58346
|
-
dispatch({ type: "set", field: "timezone", value });
|
|
58347
|
-
dispatch({ type: "next" });
|
|
58348
|
-
}
|
|
58349
|
-
}
|
|
58350
|
-
}, undefined, false, undefined, this),
|
|
58351
|
-
draft.errors.timezone && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
|
|
58352
|
-
color: "red",
|
|
58353
|
-
children: draft.errors.timezone
|
|
58354
|
-
}, undefined, false, undefined, this),
|
|
58355
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
|
|
58356
|
-
dimColor: true,
|
|
58357
|
-
children: "Type to filter · Enter to continue · b Back · Esc Cancel"
|
|
58358
|
-
}, undefined, false, undefined, this)
|
|
58359
|
-
]
|
|
58360
|
-
}, undefined, true, undefined, this);
|
|
58361
|
-
case "timezoneOther":
|
|
58362
|
-
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
|
|
58363
|
-
flexDirection: "column",
|
|
58364
|
-
gap: 1,
|
|
58365
|
-
children: [
|
|
58366
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
|
|
58367
|
-
bold: true,
|
|
58368
|
-
children: "Step 2 — Global config · Timezone (custom)"
|
|
58369
|
-
}, undefined, false, undefined, this),
|
|
58370
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
|
|
58371
|
-
dimColor: true,
|
|
58372
|
-
children: "Type an IANA timezone (e.g. America/Santiago):"
|
|
58373
|
-
}, undefined, false, undefined, this),
|
|
58374
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(TextInput, {
|
|
58375
|
-
placeholder: SCREEN_PLACEHOLDERS.timezoneOther,
|
|
58376
|
-
onChange: (value) => dispatch({ type: "set", field: "timezone", value }),
|
|
58377
|
-
onSubmit: () => dispatch({ type: "next" })
|
|
58378
|
-
}, undefined, false, undefined, this),
|
|
58379
|
-
draft.errors.timezone && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
|
|
58380
|
-
color: "red",
|
|
58381
|
-
children: draft.errors.timezone
|
|
58382
|
-
}, undefined, false, undefined, this),
|
|
58383
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
|
|
58384
|
-
dimColor: true,
|
|
58385
|
-
children: "Enter to continue · Esc Back"
|
|
58386
|
-
}, undefined, false, undefined, this)
|
|
58387
|
-
]
|
|
58388
|
-
}, undefined, true, undefined, this);
|
|
58389
58311
|
case "branchPreset": {
|
|
58390
58312
|
const policy = effectivePolicy(draft.values);
|
|
58391
58313
|
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Box_default, {
|
|
@@ -59025,15 +58947,6 @@ function Screen({
|
|
|
59025
58947
|
}, undefined, false, undefined, this)
|
|
59026
58948
|
]
|
|
59027
58949
|
}, undefined, true, undefined, this),
|
|
59028
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
|
|
59029
|
-
children: [
|
|
59030
|
-
"Timezone: ",
|
|
59031
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
|
|
59032
|
-
color: "green",
|
|
59033
|
-
children: draft.values.timezone
|
|
59034
|
-
}, undefined, false, undefined, this)
|
|
59035
|
-
]
|
|
59036
|
-
}, undefined, true, undefined, this),
|
|
59037
58950
|
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Text, {
|
|
59038
58951
|
children: [
|
|
59039
58952
|
"Branch policy: ",
|
|
@@ -59670,7 +59583,7 @@ import { createInterface as createInterface2 } from "node:readline/promises";
|
|
|
59670
59583
|
|
|
59671
59584
|
// packages/workit-core/src/core.ts
|
|
59672
59585
|
import { spawnSync as spawnSync6 } from "node:child_process";
|
|
59673
|
-
import { existsSync as existsSync17, realpathSync as
|
|
59586
|
+
import { existsSync as existsSync17, realpathSync as realpathSync11 } from "node:fs";
|
|
59674
59587
|
import path27 from "node:path";
|
|
59675
59588
|
|
|
59676
59589
|
// packages/workit-core/src/core/task-store.ts
|
|
@@ -61414,7 +61327,7 @@ class TaskStore {
|
|
|
61414
61327
|
}
|
|
61415
61328
|
}
|
|
61416
61329
|
// packages/workit-core/src/core/task-engine.ts
|
|
61417
|
-
import { realpathSync as
|
|
61330
|
+
import { realpathSync as realpathSync9 } from "node:fs";
|
|
61418
61331
|
|
|
61419
61332
|
// packages/workit-core/src/core/authority.ts
|
|
61420
61333
|
import { createHash as createHash9 } from "node:crypto";
|
|
@@ -61423,7 +61336,7 @@ import path24 from "node:path";
|
|
|
61423
61336
|
|
|
61424
61337
|
// packages/workit-core/src/core/auto-approval.ts
|
|
61425
61338
|
import { createHash as createHash8 } from "node:crypto";
|
|
61426
|
-
import { readFileSync as readFileSync16, realpathSync as
|
|
61339
|
+
import { readFileSync as readFileSync16, realpathSync as realpathSync6 } from "node:fs";
|
|
61427
61340
|
import path23 from "node:path";
|
|
61428
61341
|
|
|
61429
61342
|
// packages/workit-core/src/core/branch.ts
|
|
@@ -62384,7 +62297,7 @@ var targetOf = (root, descriptor) => {
|
|
|
62384
62297
|
return root;
|
|
62385
62298
|
if (typeof cwd !== "string" || !path23.isAbsolute(cwd))
|
|
62386
62299
|
return null;
|
|
62387
|
-
return
|
|
62300
|
+
return realpathSync6(cwd);
|
|
62388
62301
|
} catch {
|
|
62389
62302
|
return null;
|
|
62390
62303
|
}
|
|
@@ -64479,7 +64392,7 @@ class WorkitCore {
|
|
|
64479
64392
|
}
|
|
64480
64393
|
contextRootError() {
|
|
64481
64394
|
try {
|
|
64482
|
-
if (
|
|
64395
|
+
if (realpathSync9(this.context.root) !== this.store.root)
|
|
64483
64396
|
return failure("invalid_input", "operation context root does not match the task store root");
|
|
64484
64397
|
} catch {
|
|
64485
64398
|
return failure("invalid_input", "operation context root cannot be resolved");
|
|
@@ -65810,7 +65723,7 @@ class WorkitCore {
|
|
|
65810
65723
|
if (view.task.workspaceId !== view.workspace.id)
|
|
65811
65724
|
return failure("invalid_input", "task and workspace bindings are invalid");
|
|
65812
65725
|
try {
|
|
65813
|
-
if (
|
|
65726
|
+
if (realpathSync9(view.workspace.root) !== this.store.root)
|
|
65814
65727
|
return failure("invalid_input", "task view root does not match the task store");
|
|
65815
65728
|
} catch {
|
|
65816
65729
|
return failure("invalid_input", "task view root cannot be resolved");
|
|
@@ -66065,7 +65978,7 @@ class WorkitCore {
|
|
|
66065
65978
|
var cache3 = new Map;
|
|
66066
65979
|
// packages/workit-core/src/core/external-action.ts
|
|
66067
65980
|
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
66068
|
-
import { realpathSync as
|
|
65981
|
+
import { realpathSync as realpathSync10 } from "node:fs";
|
|
66069
65982
|
import path26 from "node:path";
|
|
66070
65983
|
var chainStepSchema = union2([
|
|
66071
65984
|
string2().min(1),
|
|
@@ -66403,7 +66316,7 @@ var descriptorTargetRoot = (store, operation) => {
|
|
|
66403
66316
|
const cwd = descriptor.payload?.cwd;
|
|
66404
66317
|
if (cwd === undefined)
|
|
66405
66318
|
return store.root;
|
|
66406
|
-
return typeof cwd === "string" && path26.isAbsolute(cwd) ?
|
|
66319
|
+
return typeof cwd === "string" && path26.isAbsolute(cwd) ? realpathSync10(cwd) : null;
|
|
66407
66320
|
} catch {
|
|
66408
66321
|
return null;
|
|
66409
66322
|
}
|
|
@@ -66619,19 +66532,19 @@ var externalActionTargetRoot = (operation, coordinationRoot) => {
|
|
|
66619
66532
|
try {
|
|
66620
66533
|
value = JSON.parse(operation);
|
|
66621
66534
|
} catch {
|
|
66622
|
-
return
|
|
66535
|
+
return realpathSync10(coordinationRoot);
|
|
66623
66536
|
}
|
|
66624
66537
|
if (typeof value !== "object" || value === null)
|
|
66625
|
-
return
|
|
66538
|
+
return realpathSync10(coordinationRoot);
|
|
66626
66539
|
const descriptor = value;
|
|
66627
66540
|
if (typeof descriptor.operation !== "string" || typeof descriptor.payload !== "object" || descriptor.payload === null)
|
|
66628
|
-
return
|
|
66541
|
+
return realpathSync10(coordinationRoot);
|
|
66629
66542
|
if (!descriptor.operation.startsWith("git.") && !descriptor.operation.startsWith("hosting.") && descriptor.operation !== "changelog.apply")
|
|
66630
|
-
return
|
|
66543
|
+
return realpathSync10(coordinationRoot);
|
|
66631
66544
|
const payload = descriptor.payload;
|
|
66632
66545
|
const cwd = typeof payload.cwd === "string" ? payload.cwd : coordinationRoot;
|
|
66633
66546
|
try {
|
|
66634
|
-
return
|
|
66547
|
+
return realpathSync10(path26.resolve(coordinationRoot, cwd));
|
|
66635
66548
|
} catch {
|
|
66636
66549
|
return null;
|
|
66637
66550
|
}
|
|
@@ -66775,7 +66688,7 @@ function resolveGitRevision(root, value) {
|
|
|
66775
66688
|
}
|
|
66776
66689
|
}
|
|
66777
66690
|
function resolveInside(root, candidate) {
|
|
66778
|
-
const base =
|
|
66691
|
+
const base = realpathSync11(root);
|
|
66779
66692
|
const target = path27.resolve(base, candidate);
|
|
66780
66693
|
if (target !== base && !target.startsWith(base + path27.sep)) {
|
|
66781
66694
|
throw new Error("path must stay inside repository root");
|
|
@@ -66783,14 +66696,14 @@ function resolveInside(root, candidate) {
|
|
|
66783
66696
|
let ancestor = target;
|
|
66784
66697
|
while (!existsSync17(ancestor))
|
|
66785
66698
|
ancestor = path27.dirname(ancestor);
|
|
66786
|
-
const canonicalAncestor =
|
|
66699
|
+
const canonicalAncestor = realpathSync11(ancestor);
|
|
66787
66700
|
if (canonicalAncestor !== base && !canonicalAncestor.startsWith(base + path27.sep)) {
|
|
66788
66701
|
throw new Error("path must stay inside repository root");
|
|
66789
66702
|
}
|
|
66790
66703
|
return target;
|
|
66791
66704
|
}
|
|
66792
66705
|
function run2(root, executable, args, env = {}) {
|
|
66793
|
-
const cwd =
|
|
66706
|
+
const cwd = realpathSync11(root);
|
|
66794
66707
|
const result = spawnSync6(executable, args, {
|
|
66795
66708
|
cwd,
|
|
66796
66709
|
encoding: "utf8",
|
|
@@ -67988,51 +67901,29 @@ function tzParts(date, tz) {
|
|
|
67988
67901
|
timeZone: tz,
|
|
67989
67902
|
year: "numeric",
|
|
67990
67903
|
month: "2-digit",
|
|
67991
|
-
day: "2-digit"
|
|
67992
|
-
hour: "2-digit",
|
|
67993
|
-
minute: "2-digit",
|
|
67994
|
-
hourCycle: "h23"
|
|
67904
|
+
day: "2-digit"
|
|
67995
67905
|
}).formatToParts(date);
|
|
67996
67906
|
const map = Object.fromEntries(parts.map((p) => [p.type, p.value]));
|
|
67997
|
-
return { y: map.year, m: map.month, d: map.day
|
|
67998
|
-
}
|
|
67999
|
-
|
|
68000
|
-
|
|
68001
|
-
|
|
68002
|
-
|
|
68003
|
-
|
|
68004
|
-
|
|
68005
|
-
|
|
68006
|
-
|
|
68007
|
-
|
|
68008
|
-
|
|
68009
|
-
|
|
68010
|
-
|
|
68011
|
-
|
|
68012
|
-
|
|
68013
|
-
|
|
68014
|
-
const
|
|
68015
|
-
|
|
68016
|
-
|
|
68017
|
-
const now = new Date;
|
|
68018
|
-
const { y, m, d, hour, minute } = tzParts(now, tz);
|
|
68019
|
-
const cutoff = String(config.greetingCutoff ?? "12:00").split(":");
|
|
68020
|
-
const cutoffHour = Number(cutoff[0]);
|
|
68021
|
-
const cutoffMinute = Number(cutoff[1] ?? 0);
|
|
68022
|
-
const greetings = config.greetings ?? {};
|
|
68023
|
-
const isMorning = Number(hour) < cutoffHour || Number(hour) === cutoffHour && Number(minute) < cutoffMinute;
|
|
68024
|
-
const greeting = isMorning ? greetings.morning ?? "buenos días" : greetings.afternoon ?? "buenas tardes";
|
|
68025
|
-
const mention = String(config.defaultMention ?? "Alejandra.Flores");
|
|
68026
|
-
return { stdout: `@${mention} Hola, ${greeting}.
|
|
68027
|
-
`, exitCode: 0, stderr: "" };
|
|
68028
|
-
} catch (err) {
|
|
68029
|
-
return {
|
|
68030
|
-
stdout: "",
|
|
68031
|
-
exitCode: 1,
|
|
68032
|
-
stderr: err instanceof Error ? err.message : "greeting failed"
|
|
68033
|
-
};
|
|
68034
|
-
}
|
|
68035
|
-
}
|
|
67907
|
+
return { y: map.year, m: map.month, d: map.day };
|
|
67908
|
+
}
|
|
67909
|
+
var processTimezone = () => Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
67910
|
+
var effectiveWorkTimezone = (cfg) => {
|
|
67911
|
+
const configured = cfg?.timezone;
|
|
67912
|
+
return typeof configured === "string" && configured.trim() ? { timezone: configured.trim(), source: "youtrack.json" } : { timezone: processTimezone(), source: "process" };
|
|
67913
|
+
};
|
|
67914
|
+
var DEFAULT_MEETING_WORK_ITEM_TEXT = "Meetings";
|
|
67915
|
+
var meetingWorkItemText = (cfg, item) => {
|
|
67916
|
+
if (typeof item?.workItemText === "string" && item.workItemText)
|
|
67917
|
+
return item.workItemText;
|
|
67918
|
+
if (typeof cfg?.meetingWorkItemText === "string" && cfg.meetingWorkItemText)
|
|
67919
|
+
return cfg.meetingWorkItemText;
|
|
67920
|
+
return DEFAULT_MEETING_WORK_ITEM_TEXT;
|
|
67921
|
+
};
|
|
67922
|
+
var utcMidnight = (y, m, d) => {
|
|
67923
|
+
const ms = Date.UTC(y, m - 1, d);
|
|
67924
|
+
const check = new Date(ms);
|
|
67925
|
+
return check.getUTCFullYear() === y && check.getUTCMonth() === m - 1 && check.getUTCDate() === d ? ms : null;
|
|
67926
|
+
};
|
|
68036
67927
|
function youTrackParseDuration(text) {
|
|
68037
67928
|
const lower = String(text).toLowerCase().trim();
|
|
68038
67929
|
let total = 0;
|
|
@@ -68048,7 +67939,7 @@ function youTrackParseDuration(text) {
|
|
|
68048
67939
|
}
|
|
68049
67940
|
function youTrackWorkDateMs(dateRaw) {
|
|
68050
67941
|
const cfgPath = youTrackConfigPath();
|
|
68051
|
-
let
|
|
67942
|
+
let effective = effectiveWorkTimezone(null);
|
|
68052
67943
|
if (fs12.existsSync(cfgPath)) {
|
|
68053
67944
|
let parsed;
|
|
68054
67945
|
try {
|
|
@@ -68059,31 +67950,31 @@ function youTrackWorkDateMs(dateRaw) {
|
|
|
68059
67950
|
if (!isConfigObject(parsed)) {
|
|
68060
67951
|
return { error: `${cfgPath} is not a JSON object` };
|
|
68061
67952
|
}
|
|
68062
|
-
|
|
67953
|
+
effective = effectiveWorkTimezone(parsed);
|
|
68063
67954
|
}
|
|
67955
|
+
const tz = effective.timezone;
|
|
67956
|
+
const meta = { timezone: tz, timezoneSource: effective.source };
|
|
68064
67957
|
const raw = dateRaw || "auto";
|
|
68065
67958
|
try {
|
|
68066
|
-
if (raw === "auto"
|
|
68067
|
-
const
|
|
68068
|
-
const
|
|
68069
|
-
|
|
68070
|
-
|
|
67959
|
+
if (raw === "auto") {
|
|
67960
|
+
const { y, m, d } = tzParts(new Date, tz);
|
|
67961
|
+
const dateMs = utcMidnight(Number(y), Number(m), Number(d));
|
|
67962
|
+
if (dateMs === null)
|
|
67963
|
+
return { error: "could not resolve date" };
|
|
67964
|
+
return { data: { dateMs, ...meta, localDate: `${y}-${m}-${d}` } };
|
|
68071
67965
|
}
|
|
68072
67966
|
if (/^\d+$/.test(raw)) {
|
|
68073
67967
|
const dt = new Date(Number(raw));
|
|
68074
|
-
|
|
68075
|
-
|
|
68076
|
-
|
|
68077
|
-
|
|
68078
|
-
const
|
|
68079
|
-
const dateMs =
|
|
68080
|
-
|
|
68081
|
-
|
|
68082
|
-
|
|
68083
|
-
|
|
68084
|
-
localDate: `${y}-${String(m).padStart(2, "0")}-${String(d).padStart(2, "0")}`
|
|
68085
|
-
}
|
|
68086
|
-
};
|
|
67968
|
+
if (Number.isNaN(dt.getTime()))
|
|
67969
|
+
return { error: `invalid date: ${raw}` };
|
|
67970
|
+
return { data: { dateMs: Number(raw), ...meta, localDate: dt.toISOString().slice(0, 10) } };
|
|
67971
|
+
}
|
|
67972
|
+
const match = /^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(raw);
|
|
67973
|
+
const dateMs = match ? utcMidnight(Number(match[1]), Number(match[2]), Number(match[3])) : null;
|
|
67974
|
+
if (!match || dateMs === null)
|
|
67975
|
+
return { error: `invalid date: ${raw} (expected YYYY-MM-DD)` };
|
|
67976
|
+
const localDate = `${match[1]}-${match[2].padStart(2, "0")}-${match[3].padStart(2, "0")}`;
|
|
67977
|
+
return { data: { dateMs, ...meta, localDate } };
|
|
68087
67978
|
} catch (err) {
|
|
68088
67979
|
return { error: err instanceof Error ? err.message : "could not resolve date" };
|
|
68089
67980
|
}
|
|
@@ -68205,13 +68096,11 @@ function parseIssueRef(input) {
|
|
|
68205
68096
|
}
|
|
68206
68097
|
var defaultScripts = {
|
|
68207
68098
|
config: () => youTrackConfigLoad(),
|
|
68208
|
-
greeting: () => youTrackGreeting(),
|
|
68209
68099
|
parseDuration: (text) => youTrackParseDuration(text),
|
|
68210
68100
|
api: (args) => youTrackApi(args, process.env.WORKFLOW_YT_WRITE ?? "")
|
|
68211
68101
|
};
|
|
68212
68102
|
var contextScripts = {
|
|
68213
68103
|
config: readYouTrackContextConfig,
|
|
68214
|
-
greeting: () => youTrackGreeting(youTrackReadOnlyConfigPath()),
|
|
68215
68104
|
parseDuration: (text) => youTrackParseDuration(text),
|
|
68216
68105
|
api: () => ({ error: "YouTrack context is read-only" })
|
|
68217
68106
|
};
|
|
@@ -68243,7 +68132,7 @@ function meetingOptionsFromConfig(cfg) {
|
|
|
68243
68132
|
key,
|
|
68244
68133
|
issue: item.issue,
|
|
68245
68134
|
label: item.label ?? item.issue,
|
|
68246
|
-
workItemText: item
|
|
68135
|
+
workItemText: meetingWorkItemText(cfg, item),
|
|
68247
68136
|
url: item.url ?? (base && item.issue ? `${base}/issue/${item.issue}` : null)
|
|
68248
68137
|
}));
|
|
68249
68138
|
}
|
|
@@ -68253,7 +68142,7 @@ function meetingOptionsFromConfig(cfg) {
|
|
|
68253
68142
|
key: "general",
|
|
68254
68143
|
issue,
|
|
68255
68144
|
label: "General meetings",
|
|
68256
|
-
workItemText:
|
|
68145
|
+
workItemText: meetingWorkItemText(cfg),
|
|
68257
68146
|
url: base && issue ? `${base}/issue/${issue}` : null
|
|
68258
68147
|
}
|
|
68259
68148
|
];
|
|
@@ -68275,17 +68164,9 @@ var readOnlyYouTrackConfig = (cfg) => {
|
|
|
68275
68164
|
const baseUrl = publicUrl(cfg.baseUrl);
|
|
68276
68165
|
if (baseUrl)
|
|
68277
68166
|
safe.baseUrl = baseUrl;
|
|
68278
|
-
for (const key of ["timezone", "
|
|
68167
|
+
for (const key of ["timezone", "meetingIssue", "meetingWorkItemText"])
|
|
68279
68168
|
if (typeof cfg[key] === "string")
|
|
68280
68169
|
safe[key] = cfg[key];
|
|
68281
|
-
if (cfg.greetings && typeof cfg.greetings === "object" && !Array.isArray(cfg.greetings)) {
|
|
68282
|
-
const greetings = {};
|
|
68283
|
-
for (const key of ["morning", "afternoon"])
|
|
68284
|
-
if (typeof cfg.greetings[key] === "string")
|
|
68285
|
-
greetings[key] = cfg.greetings[key];
|
|
68286
|
-
if (Object.keys(greetings).length)
|
|
68287
|
-
safe.greetings = greetings;
|
|
68288
|
-
}
|
|
68289
68170
|
if (cfg.meetingIssues && typeof cfg.meetingIssues === "object" && !Array.isArray(cfg.meetingIssues)) {
|
|
68290
68171
|
safe.meetingIssues = Object.fromEntries(Object.entries(cfg.meetingIssues).flatMap(([key, value]) => {
|
|
68291
68172
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
@@ -68315,16 +68196,12 @@ function context({
|
|
|
68315
68196
|
const cfg = scripts.config();
|
|
68316
68197
|
if (cfg.error)
|
|
68317
68198
|
return { error: cfg.error };
|
|
68318
|
-
const greeting = scripts.greeting();
|
|
68319
|
-
if (greeting.exitCode !== 0) {
|
|
68320
|
-
return { error: (greeting.stderr || greeting.stdout || "greeting failed").trim() };
|
|
68321
|
-
}
|
|
68322
68199
|
const safeConfig = readOnlyYouTrackConfig(cfg.data);
|
|
68323
68200
|
const meetingOptions = meetingOptionsFromConfig(safeConfig);
|
|
68324
68201
|
if (mode === "meetings" && !issue_id && !issue_url && !issue_ref) {
|
|
68325
68202
|
return {
|
|
68326
68203
|
config: safeConfig,
|
|
68327
|
-
|
|
68204
|
+
workTimezone: effectiveWorkTimezone(safeConfig),
|
|
68328
68205
|
mode: "meetings",
|
|
68329
68206
|
requiresMeetingChoice: true,
|
|
68330
68207
|
meetingOptions,
|
|
@@ -68353,7 +68230,7 @@ function context({
|
|
|
68353
68230
|
const selectedMeeting = meetingOptions.find((m) => m.issue === issue);
|
|
68354
68231
|
return {
|
|
68355
68232
|
config: safeConfig,
|
|
68356
|
-
|
|
68233
|
+
workTimezone: effectiveWorkTimezone(safeConfig),
|
|
68357
68234
|
issueId: issue,
|
|
68358
68235
|
issueUrl,
|
|
68359
68236
|
mode: mode ?? (selectedMeeting ? "meetings" : "task"),
|
|
@@ -68898,6 +68775,11 @@ var actionProposalQuestion = (request, descriptorPayload) => {
|
|
|
68898
68775
|
const cwd = descriptorPayload?.cwd;
|
|
68899
68776
|
return typeof cwd === "string" ? { ...proposal, presented: `${proposal.presented} Target directory: ${cwd}` } : proposal;
|
|
68900
68777
|
};
|
|
68778
|
+
var workDateOf = (data) => ({
|
|
68779
|
+
localDate: data.localDate,
|
|
68780
|
+
timezone: data.timezone,
|
|
68781
|
+
timezoneSource: data.timezoneSource
|
|
68782
|
+
});
|
|
68901
68783
|
var approvedResolvedExternalAction = (content) => {
|
|
68902
68784
|
try {
|
|
68903
68785
|
const value = JSON.parse(content);
|
|
@@ -69735,6 +69617,7 @@ var resolveExternalActionAtRoot = (root, request, preservedDateMs) => {
|
|
|
69735
69617
|
return success(null, null, {
|
|
69736
69618
|
request,
|
|
69737
69619
|
marker,
|
|
69620
|
+
workDate: workDateOf(date.data),
|
|
69738
69621
|
descriptorPayload: {
|
|
69739
69622
|
...request.payload,
|
|
69740
69623
|
resolved: {
|
|
@@ -69771,6 +69654,7 @@ var resolveExternalActionAtRoot = (root, request, preservedDateMs) => {
|
|
|
69771
69654
|
return success(null, null, {
|
|
69772
69655
|
request,
|
|
69773
69656
|
marker,
|
|
69657
|
+
workDate: workDateOf(date.data),
|
|
69774
69658
|
descriptorPayload: {
|
|
69775
69659
|
...request.payload,
|
|
69776
69660
|
resolved: {
|
|
@@ -70634,7 +70518,8 @@ async function runActionCommand(argv, deps = {}) {
|
|
|
70634
70518
|
const result = success(null, null, {
|
|
70635
70519
|
operation: normalized.operation,
|
|
70636
70520
|
descriptor,
|
|
70637
|
-
payload: normalized.payload
|
|
70521
|
+
payload: normalized.payload,
|
|
70522
|
+
...resolved.data.workDate ? { workDate: resolved.data.workDate } : {}
|
|
70638
70523
|
});
|
|
70639
70524
|
if (json)
|
|
70640
70525
|
jsonResult(outOf(deps), result);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit CLI — setup wizard, doctor, and task control for agentic coding workflows",
|
|
6
6
|
"keywords": [
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"typecheck": "tsc --noEmit"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@brainervirus/workit-core": "^2.1.
|
|
41
|
-
"@brainervirus/workit-cursor": "^2.1.
|
|
42
|
-
"@brainervirus/workit-opencode": "^2.1.
|
|
40
|
+
"@brainervirus/workit-core": "^2.1.4",
|
|
41
|
+
"@brainervirus/workit-cursor": "^2.1.4",
|
|
42
|
+
"@brainervirus/workit-opencode": "^2.1.4",
|
|
43
43
|
"@inkjs/ui": "2.0.0",
|
|
44
44
|
"ink": "7.1.1",
|
|
45
45
|
"react": "19.2.8"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{{greetingText}}
|