taskin 2.0.4 → 2.2.0
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 +28 -5
- package/dashboard-dist/assets/index-CsqqVa6u.js +21 -0
- package/dashboard-dist/index.html +1 -1
- package/dist/index.js +975 -493
- package/package.json +6 -6
- package/dashboard-dist/assets/index--4kB9amy.js +0 -21
package/dist/index.js
CHANGED
|
@@ -51,7 +51,7 @@ var init_esm_shims = __esm({
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
//
|
|
54
|
+
// ../file-system-task-provider/dist/i18n.js
|
|
55
55
|
function getI18n(locale = "en-US") {
|
|
56
56
|
return i18nConfig[locale];
|
|
57
57
|
}
|
|
@@ -63,7 +63,7 @@ function detectLocale(content) {
|
|
|
63
63
|
}
|
|
64
64
|
var i18nConfig;
|
|
65
65
|
var init_i18n = __esm({
|
|
66
|
-
"
|
|
66
|
+
"../file-system-task-provider/dist/i18n.js"() {
|
|
67
67
|
"use strict";
|
|
68
68
|
init_esm_shims();
|
|
69
69
|
i18nConfig = {
|
|
@@ -93,7 +93,7 @@ var init_i18n = __esm({
|
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
//
|
|
96
|
+
// ../file-system-task-provider/dist/task-validator.js
|
|
97
97
|
var task_validator_exports = {};
|
|
98
98
|
__export(task_validator_exports, {
|
|
99
99
|
createLintResult: () => createLintResult,
|
|
@@ -137,7 +137,6 @@ async function fixTaskFile(filePath) {
|
|
|
137
137
|
return false;
|
|
138
138
|
}
|
|
139
139
|
let newContent = content;
|
|
140
|
-
let wasModified = false;
|
|
141
140
|
if (hasSectionStatus || hasSectionType || hasSectionAssignee) {
|
|
142
141
|
const statusMatch = content.match(statusPattern);
|
|
143
142
|
const typeMatch = content.match(typePattern);
|
|
@@ -176,7 +175,6 @@ async function fixTaskFile(filePath) {
|
|
|
176
175
|
"",
|
|
177
176
|
...afterTitle
|
|
178
177
|
].join("\n");
|
|
179
|
-
wasModified = true;
|
|
180
178
|
}
|
|
181
179
|
if (needsSpaceFix) {
|
|
182
180
|
newContent = newContent.replace(
|
|
@@ -191,7 +189,6 @@ async function fixTaskFile(filePath) {
|
|
|
191
189
|
/^(Assignee|Responsável):\s*(.+?)([ \t]*)$/im,
|
|
192
190
|
(_, key, value) => `${key}: ${value.trim()} `
|
|
193
191
|
);
|
|
194
|
-
wasModified = true;
|
|
195
192
|
}
|
|
196
193
|
const finalContentRaw = newContent.replace(/\n{3,}/g, "\n\n").trim() + "\n";
|
|
197
194
|
const originalContentRaw = content.replace(/\n{3,}/g, "\n\n").trim() + "\n";
|
|
@@ -343,7 +340,7 @@ function createLintResult(allIssues) {
|
|
|
343
340
|
};
|
|
344
341
|
}
|
|
345
342
|
var init_task_validator = __esm({
|
|
346
|
-
"
|
|
343
|
+
"../file-system-task-provider/dist/task-validator.js"() {
|
|
347
344
|
"use strict";
|
|
348
345
|
init_esm_shims();
|
|
349
346
|
init_i18n();
|
|
@@ -7183,17 +7180,396 @@ var require_dist = __commonJS({
|
|
|
7183
7180
|
init_esm_shims();
|
|
7184
7181
|
import { Command } from "commander";
|
|
7185
7182
|
|
|
7183
|
+
// src/commands/config.ts
|
|
7184
|
+
init_esm_shims();
|
|
7185
|
+
import chalk2 from "chalk";
|
|
7186
|
+
import inquirer from "inquirer";
|
|
7187
|
+
|
|
7188
|
+
// src/lib/colors.ts
|
|
7189
|
+
init_esm_shims();
|
|
7190
|
+
import chalk from "chalk";
|
|
7191
|
+
var colors = {
|
|
7192
|
+
info: chalk.cyan,
|
|
7193
|
+
success: chalk.green,
|
|
7194
|
+
warning: chalk.yellow,
|
|
7195
|
+
error: chalk.red,
|
|
7196
|
+
highlight: chalk.bold.white,
|
|
7197
|
+
secondary: chalk.gray,
|
|
7198
|
+
normal: chalk.white
|
|
7199
|
+
};
|
|
7200
|
+
var icons = {
|
|
7201
|
+
rocket: "\u{1F680}",
|
|
7202
|
+
list: "\u{1F4CA}",
|
|
7203
|
+
check: "\u2705",
|
|
7204
|
+
pause: "\u23F8\uFE0F",
|
|
7205
|
+
info: "\u{1F4A1}",
|
|
7206
|
+
task: "\u{1F4CB}",
|
|
7207
|
+
gear: "\u2699\uFE0F"
|
|
7208
|
+
};
|
|
7209
|
+
function printHeader(title, icon) {
|
|
7210
|
+
console.log();
|
|
7211
|
+
console.log(colors.highlight("\u2550".repeat(60)));
|
|
7212
|
+
console.log(colors.highlight(`${icon} ${title}`));
|
|
7213
|
+
console.log(colors.highlight("\u2550".repeat(60)));
|
|
7214
|
+
console.log();
|
|
7215
|
+
}
|
|
7216
|
+
function success(message) {
|
|
7217
|
+
console.log(colors.success(`\u2713 ${message}`));
|
|
7218
|
+
}
|
|
7219
|
+
function error(message) {
|
|
7220
|
+
console.error(colors.error(`\u2717 ${message}`));
|
|
7221
|
+
}
|
|
7222
|
+
function info(message) {
|
|
7223
|
+
console.log(colors.info(`\u2139 ${message}`));
|
|
7224
|
+
}
|
|
7225
|
+
|
|
7226
|
+
// src/lib/config-manager.ts
|
|
7227
|
+
init_esm_shims();
|
|
7228
|
+
import * as TaskinTypes from "@opentask/taskin-types";
|
|
7229
|
+
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
7230
|
+
import { join } from "path";
|
|
7231
|
+
var { TaskinConfigSchema } = TaskinTypes;
|
|
7232
|
+
function getAutomationBehavior(level, commits) {
|
|
7233
|
+
const presets = {
|
|
7234
|
+
manual: {
|
|
7235
|
+
autoCommitStatusChange: false,
|
|
7236
|
+
autoCommitPause: false,
|
|
7237
|
+
autoCommitFinish: false
|
|
7238
|
+
},
|
|
7239
|
+
assisted: {
|
|
7240
|
+
autoCommitStatusChange: true,
|
|
7241
|
+
autoCommitPause: true,
|
|
7242
|
+
autoCommitFinish: false
|
|
7243
|
+
},
|
|
7244
|
+
autopilot: {
|
|
7245
|
+
autoCommitStatusChange: true,
|
|
7246
|
+
autoCommitPause: true,
|
|
7247
|
+
autoCommitFinish: true
|
|
7248
|
+
}
|
|
7249
|
+
};
|
|
7250
|
+
const behavior = presets[level];
|
|
7251
|
+
if (commits) {
|
|
7252
|
+
return {
|
|
7253
|
+
autoCommitStatusChange: commits.taskStatusChanges ?? behavior.autoCommitStatusChange,
|
|
7254
|
+
autoCommitPause: commits.workInProgress ?? behavior.autoCommitPause,
|
|
7255
|
+
autoCommitFinish: commits.completedWork ?? behavior.autoCommitFinish
|
|
7256
|
+
};
|
|
7257
|
+
}
|
|
7258
|
+
return behavior;
|
|
7259
|
+
}
|
|
7260
|
+
var ConfigManager = class {
|
|
7261
|
+
constructor(projectRoot = process.cwd()) {
|
|
7262
|
+
this.projectRoot = projectRoot;
|
|
7263
|
+
this.configPath = join(projectRoot, ".taskin.json");
|
|
7264
|
+
}
|
|
7265
|
+
configPath;
|
|
7266
|
+
/**
|
|
7267
|
+
* Load configuration from .taskin.json
|
|
7268
|
+
* @throws Error if config file not found or invalid
|
|
7269
|
+
*/
|
|
7270
|
+
loadConfig() {
|
|
7271
|
+
if (!existsSync(this.configPath)) {
|
|
7272
|
+
throw new Error(
|
|
7273
|
+
`Taskin configuration not found at ${this.configPath}.
|
|
7274
|
+
Run 'taskin init' to initialize.`
|
|
7275
|
+
);
|
|
7276
|
+
}
|
|
7277
|
+
const content = readFileSync(this.configPath, "utf-8");
|
|
7278
|
+
const json = JSON.parse(content);
|
|
7279
|
+
const result = TaskinConfigSchema.safeParse(json);
|
|
7280
|
+
if (!result.success) {
|
|
7281
|
+
throw new Error(`Invalid Taskin configuration:
|
|
7282
|
+
${result.error.message}`);
|
|
7283
|
+
}
|
|
7284
|
+
return result.data;
|
|
7285
|
+
}
|
|
7286
|
+
/**
|
|
7287
|
+
* Save configuration to .taskin.json
|
|
7288
|
+
*/
|
|
7289
|
+
saveConfig(config) {
|
|
7290
|
+
const validated = TaskinConfigSchema.parse(config);
|
|
7291
|
+
writeFileSync(this.configPath, JSON.stringify(validated, null, 2), "utf-8");
|
|
7292
|
+
}
|
|
7293
|
+
/**
|
|
7294
|
+
* Get automation level from config
|
|
7295
|
+
* Returns 'assisted' as default if not configured
|
|
7296
|
+
*/
|
|
7297
|
+
getAutomationLevel() {
|
|
7298
|
+
const config = this.loadConfig();
|
|
7299
|
+
return config.automation?.level ?? "assisted";
|
|
7300
|
+
}
|
|
7301
|
+
/**
|
|
7302
|
+
* Set automation level in config
|
|
7303
|
+
*/
|
|
7304
|
+
setAutomationLevel(level) {
|
|
7305
|
+
const config = this.loadConfig();
|
|
7306
|
+
config.automation = {
|
|
7307
|
+
...config.automation,
|
|
7308
|
+
level
|
|
7309
|
+
};
|
|
7310
|
+
this.saveConfig(config);
|
|
7311
|
+
}
|
|
7312
|
+
/**
|
|
7313
|
+
* Get automation configuration
|
|
7314
|
+
*/
|
|
7315
|
+
getAutomationConfig() {
|
|
7316
|
+
const config = this.loadConfig();
|
|
7317
|
+
return config.automation ?? { level: "assisted" };
|
|
7318
|
+
}
|
|
7319
|
+
/**
|
|
7320
|
+
* Set automation configuration
|
|
7321
|
+
*/
|
|
7322
|
+
setAutomationConfig(automation) {
|
|
7323
|
+
const config = this.loadConfig();
|
|
7324
|
+
config.automation = automation;
|
|
7325
|
+
this.saveConfig(config);
|
|
7326
|
+
}
|
|
7327
|
+
/**
|
|
7328
|
+
* Get resolved automation behavior
|
|
7329
|
+
*/
|
|
7330
|
+
getAutomationBehavior() {
|
|
7331
|
+
const automation = this.getAutomationConfig();
|
|
7332
|
+
return getAutomationBehavior(automation.level, automation.commits);
|
|
7333
|
+
}
|
|
7334
|
+
/**
|
|
7335
|
+
* Check if config file exists
|
|
7336
|
+
*/
|
|
7337
|
+
exists() {
|
|
7338
|
+
return existsSync(this.configPath);
|
|
7339
|
+
}
|
|
7340
|
+
};
|
|
7341
|
+
|
|
7342
|
+
// src/lib/project-check.ts
|
|
7343
|
+
init_esm_shims();
|
|
7344
|
+
import { existsSync as existsSync2 } from "fs";
|
|
7345
|
+
import path2 from "path";
|
|
7346
|
+
function isTaskinProject(cwd = process.cwd()) {
|
|
7347
|
+
return existsSync2(path2.join(cwd, ".taskin.json"));
|
|
7348
|
+
}
|
|
7349
|
+
function requireTaskinProject(cwd = process.cwd()) {
|
|
7350
|
+
if (!isTaskinProject(cwd)) {
|
|
7351
|
+
error(
|
|
7352
|
+
'This directory is not initialized as a taskin project. Run "taskin init" first.'
|
|
7353
|
+
);
|
|
7354
|
+
process.exit(1);
|
|
7355
|
+
}
|
|
7356
|
+
}
|
|
7357
|
+
|
|
7358
|
+
// src/commands/define-command/index.ts
|
|
7359
|
+
init_esm_shims();
|
|
7360
|
+
|
|
7361
|
+
// src/commands/define-command/define-command.ts
|
|
7362
|
+
init_esm_shims();
|
|
7363
|
+
var defineCommand = (config) => {
|
|
7364
|
+
return (program2) => {
|
|
7365
|
+
const cmd = program2.command(config.name).description(config.description);
|
|
7366
|
+
if (config.alias) {
|
|
7367
|
+
cmd.alias(config.alias);
|
|
7368
|
+
}
|
|
7369
|
+
config.options?.forEach((opt) => {
|
|
7370
|
+
cmd.option(opt.flags, opt.description, opt.defaultValue);
|
|
7371
|
+
});
|
|
7372
|
+
cmd.action(async (...args) => {
|
|
7373
|
+
try {
|
|
7374
|
+
await config.handler(...args);
|
|
7375
|
+
} catch (err) {
|
|
7376
|
+
error(
|
|
7377
|
+
`Failed to execute command: ${err instanceof Error ? err.message : String(err)}`
|
|
7378
|
+
);
|
|
7379
|
+
process.exit(1);
|
|
7380
|
+
}
|
|
7381
|
+
});
|
|
7382
|
+
};
|
|
7383
|
+
};
|
|
7384
|
+
|
|
7385
|
+
// src/commands/define-command/define-command.types.ts
|
|
7386
|
+
init_esm_shims();
|
|
7387
|
+
|
|
7388
|
+
// src/commands/config.ts
|
|
7389
|
+
var configCommand = defineCommand({
|
|
7390
|
+
name: "config",
|
|
7391
|
+
description: "\u2699\uFE0F Configure Taskin settings",
|
|
7392
|
+
options: [
|
|
7393
|
+
{
|
|
7394
|
+
flags: "-l, --level <level>",
|
|
7395
|
+
description: "Set automation level (manual|assisted|autopilot)"
|
|
7396
|
+
},
|
|
7397
|
+
{
|
|
7398
|
+
flags: "-s, --show",
|
|
7399
|
+
description: "Show current configuration"
|
|
7400
|
+
}
|
|
7401
|
+
],
|
|
7402
|
+
handler: async (options) => {
|
|
7403
|
+
await handleConfigCommand(options);
|
|
7404
|
+
}
|
|
7405
|
+
});
|
|
7406
|
+
async function handleConfigCommand(options) {
|
|
7407
|
+
requireTaskinProject();
|
|
7408
|
+
const configManager = new ConfigManager(process.cwd());
|
|
7409
|
+
if (options.show) {
|
|
7410
|
+
await showConfiguration(configManager);
|
|
7411
|
+
return;
|
|
7412
|
+
}
|
|
7413
|
+
if (options.level) {
|
|
7414
|
+
await setAutomationLevel(configManager, options.level);
|
|
7415
|
+
return;
|
|
7416
|
+
}
|
|
7417
|
+
await interactiveConfig(configManager);
|
|
7418
|
+
}
|
|
7419
|
+
async function showConfiguration(configManager) {
|
|
7420
|
+
printHeader("Current Configuration", "\u2699\uFE0F");
|
|
7421
|
+
try {
|
|
7422
|
+
const config = configManager.loadConfig();
|
|
7423
|
+
const automationLevel = configManager.getAutomationLevel();
|
|
7424
|
+
const behavior = configManager.getAutomationBehavior();
|
|
7425
|
+
console.log(chalk2.bold("\n\u{1F4CB} General"));
|
|
7426
|
+
console.log(` Version: ${chalk2.cyan(config.version)}`);
|
|
7427
|
+
console.log(` Provider: ${chalk2.cyan(config.provider.type)}
|
|
7428
|
+
`);
|
|
7429
|
+
console.log(chalk2.bold("\u{1F916} Automation"));
|
|
7430
|
+
console.log(` Level: ${chalk2.cyan(automationLevel)}`);
|
|
7431
|
+
console.log(
|
|
7432
|
+
` Auto-commit status changes: ${behavior.autoCommitStatusChange ? chalk2.green("\u2713 Yes") : chalk2.red("\u2717 No")}`
|
|
7433
|
+
);
|
|
7434
|
+
console.log(
|
|
7435
|
+
` Auto-commit on pause: ${behavior.autoCommitPause ? chalk2.green("\u2713 Yes") : chalk2.red("\u2717 No")}`
|
|
7436
|
+
);
|
|
7437
|
+
console.log(
|
|
7438
|
+
` Auto-commit on finish: ${behavior.autoCommitFinish ? chalk2.green("\u2713 Yes") : chalk2.red("\u2717 No")}
|
|
7439
|
+
`
|
|
7440
|
+
);
|
|
7441
|
+
console.log(chalk2.bold("\u{1F4D6} Available Levels:"));
|
|
7442
|
+
console.log(
|
|
7443
|
+
` ${chalk2.yellow("manual")} - You're in control: all commits are suggestions only`
|
|
7444
|
+
);
|
|
7445
|
+
console.log(
|
|
7446
|
+
` ${chalk2.yellow("assisted")} - Smart suggestions: auto-commits status changes, suggests work commits`
|
|
7447
|
+
);
|
|
7448
|
+
console.log(
|
|
7449
|
+
` ${chalk2.yellow("autopilot")} - Let Taskin drive: auto-commits everything
|
|
7450
|
+
`
|
|
7451
|
+
);
|
|
7452
|
+
} catch (err) {
|
|
7453
|
+
error("Failed to load configuration");
|
|
7454
|
+
if (err instanceof Error) {
|
|
7455
|
+
console.error(chalk2.dim(err.message));
|
|
7456
|
+
}
|
|
7457
|
+
process.exit(1);
|
|
7458
|
+
}
|
|
7459
|
+
}
|
|
7460
|
+
async function setAutomationLevel(configManager, level) {
|
|
7461
|
+
printHeader("Configure Automation Level", "\u2699\uFE0F");
|
|
7462
|
+
const validLevels = ["manual", "assisted", "autopilot"];
|
|
7463
|
+
if (!validLevels.includes(level)) {
|
|
7464
|
+
error(
|
|
7465
|
+
`Invalid automation level: ${level}. Valid options: ${validLevels.join(", ")}`
|
|
7466
|
+
);
|
|
7467
|
+
process.exit(1);
|
|
7468
|
+
}
|
|
7469
|
+
try {
|
|
7470
|
+
const currentLevel = configManager.getAutomationLevel();
|
|
7471
|
+
if (currentLevel === level) {
|
|
7472
|
+
info(`Automation level is already set to ${colors.highlight(level)}`);
|
|
7473
|
+
return;
|
|
7474
|
+
}
|
|
7475
|
+
configManager.setAutomationLevel(level);
|
|
7476
|
+
success(`\u2713 Automation level set to ${colors.highlight(level)}`);
|
|
7477
|
+
const behavior = configManager.getAutomationBehavior();
|
|
7478
|
+
console.log(chalk2.dim("\nCurrent behavior:"));
|
|
7479
|
+
console.log(
|
|
7480
|
+
chalk2.dim(
|
|
7481
|
+
` Auto-commit status changes: ${behavior.autoCommitStatusChange ? "\u2713" : "\u2717"}`
|
|
7482
|
+
)
|
|
7483
|
+
);
|
|
7484
|
+
console.log(
|
|
7485
|
+
chalk2.dim(
|
|
7486
|
+
` Auto-commit on pause: ${behavior.autoCommitPause ? "\u2713" : "\u2717"}`
|
|
7487
|
+
)
|
|
7488
|
+
);
|
|
7489
|
+
console.log(
|
|
7490
|
+
chalk2.dim(
|
|
7491
|
+
` Auto-commit on finish: ${behavior.autoCommitFinish ? "\u2713" : "\u2717"}`
|
|
7492
|
+
)
|
|
7493
|
+
);
|
|
7494
|
+
} catch (err) {
|
|
7495
|
+
error("Failed to update configuration");
|
|
7496
|
+
if (err instanceof Error) {
|
|
7497
|
+
console.error(chalk2.dim(err.message));
|
|
7498
|
+
}
|
|
7499
|
+
process.exit(1);
|
|
7500
|
+
}
|
|
7501
|
+
}
|
|
7502
|
+
async function interactiveConfig(configManager) {
|
|
7503
|
+
printHeader("Configure Taskin", "\u2699\uFE0F");
|
|
7504
|
+
try {
|
|
7505
|
+
const currentLevel = configManager.getAutomationLevel();
|
|
7506
|
+
console.log(`Current automation level: ${chalk2.cyan(currentLevel)}
|
|
7507
|
+
`);
|
|
7508
|
+
const { level } = await inquirer.prompt([
|
|
7509
|
+
{
|
|
7510
|
+
type: "list",
|
|
7511
|
+
name: "level",
|
|
7512
|
+
message: "Select automation level:",
|
|
7513
|
+
default: currentLevel,
|
|
7514
|
+
choices: [
|
|
7515
|
+
{
|
|
7516
|
+
name: "\u{1F527} manual - You control all commits (suggestions only)",
|
|
7517
|
+
value: "manual"
|
|
7518
|
+
},
|
|
7519
|
+
{
|
|
7520
|
+
name: "\u{1F91D} assisted - Auto-commit status changes, suggest work commits (recommended)",
|
|
7521
|
+
value: "assisted"
|
|
7522
|
+
},
|
|
7523
|
+
{
|
|
7524
|
+
name: "\u{1F680} autopilot - Auto-commit everything",
|
|
7525
|
+
value: "autopilot"
|
|
7526
|
+
}
|
|
7527
|
+
]
|
|
7528
|
+
}
|
|
7529
|
+
]);
|
|
7530
|
+
if (level === currentLevel) {
|
|
7531
|
+
info(`Keeping current automation level: ${colors.highlight(level)}`);
|
|
7532
|
+
return;
|
|
7533
|
+
}
|
|
7534
|
+
configManager.setAutomationLevel(level);
|
|
7535
|
+
success(`\u2713 Automation level set to ${colors.highlight(level)}`);
|
|
7536
|
+
const behavior = configManager.getAutomationBehavior();
|
|
7537
|
+
console.log(chalk2.dim("\nNew behavior:"));
|
|
7538
|
+
console.log(
|
|
7539
|
+
chalk2.dim(
|
|
7540
|
+
` Auto-commit status changes: ${behavior.autoCommitStatusChange ? "\u2713" : "\u2717"}`
|
|
7541
|
+
)
|
|
7542
|
+
);
|
|
7543
|
+
console.log(
|
|
7544
|
+
chalk2.dim(
|
|
7545
|
+
` Auto-commit on pause: ${behavior.autoCommitPause ? "\u2713" : "\u2717"}`
|
|
7546
|
+
)
|
|
7547
|
+
);
|
|
7548
|
+
console.log(
|
|
7549
|
+
chalk2.dim(
|
|
7550
|
+
` Auto-commit on finish: ${behavior.autoCommitFinish ? "\u2713" : "\u2717"}`
|
|
7551
|
+
)
|
|
7552
|
+
);
|
|
7553
|
+
} catch (err) {
|
|
7554
|
+
error("Configuration cancelled or failed");
|
|
7555
|
+
if (err instanceof Error) {
|
|
7556
|
+
console.error(chalk2.dim(err.message));
|
|
7557
|
+
}
|
|
7558
|
+
process.exit(1);
|
|
7559
|
+
}
|
|
7560
|
+
}
|
|
7561
|
+
|
|
7186
7562
|
// src/commands/dashboard.ts
|
|
7187
7563
|
init_esm_shims();
|
|
7188
7564
|
|
|
7189
|
-
//
|
|
7565
|
+
// ../file-system-task-provider/dist/index.js
|
|
7190
7566
|
init_esm_shims();
|
|
7191
7567
|
|
|
7192
|
-
//
|
|
7568
|
+
// ../file-system-task-provider/dist/file-system-metrics-adapter.js
|
|
7193
7569
|
init_esm_shims();
|
|
7194
7570
|
import { UserStatsSchema } from "@opentask/taskin-types";
|
|
7195
7571
|
import { promises as fs } from "fs";
|
|
7196
|
-
import
|
|
7572
|
+
import path3 from "path";
|
|
7197
7573
|
var MILLISECONDS_PER_SECOND = 1e3;
|
|
7198
7574
|
var SECONDS_PER_MINUTE = 60;
|
|
7199
7575
|
var MINUTES_PER_HOUR = 60;
|
|
@@ -7237,6 +7613,46 @@ function emptyTemporalMetrics() {
|
|
|
7237
7613
|
function removeCodeBlocks(content) {
|
|
7238
7614
|
return content.replace(/```[\s\S]*?```/g, "");
|
|
7239
7615
|
}
|
|
7616
|
+
function resolvePeriod(period = "week") {
|
|
7617
|
+
const now = /* @__PURE__ */ new Date();
|
|
7618
|
+
const until = now;
|
|
7619
|
+
let since;
|
|
7620
|
+
switch (period) {
|
|
7621
|
+
case "day":
|
|
7622
|
+
since = new Date(Date.now() - MILLISECONDS_PER_DAY);
|
|
7623
|
+
break;
|
|
7624
|
+
case "week":
|
|
7625
|
+
since = new Date(Date.now() - DAYS_PER_WEEK * MILLISECONDS_PER_DAY);
|
|
7626
|
+
break;
|
|
7627
|
+
case "month":
|
|
7628
|
+
since = new Date(Date.now() - 30 * MILLISECONDS_PER_DAY);
|
|
7629
|
+
break;
|
|
7630
|
+
case "quarter":
|
|
7631
|
+
since = new Date(Date.now() - 90 * MILLISECONDS_PER_DAY);
|
|
7632
|
+
break;
|
|
7633
|
+
case "year":
|
|
7634
|
+
since = new Date(Date.now() - 365 * MILLISECONDS_PER_DAY);
|
|
7635
|
+
break;
|
|
7636
|
+
case "all":
|
|
7637
|
+
since = /* @__PURE__ */ new Date(0);
|
|
7638
|
+
break;
|
|
7639
|
+
default:
|
|
7640
|
+
since = new Date(Date.now() - DAYS_PER_WEEK * MILLISECONDS_PER_DAY);
|
|
7641
|
+
}
|
|
7642
|
+
return { since, until };
|
|
7643
|
+
}
|
|
7644
|
+
function calculateActivityFrequency(commits, period) {
|
|
7645
|
+
const daysInPeriod = {
|
|
7646
|
+
day: 1,
|
|
7647
|
+
week: 7,
|
|
7648
|
+
month: 30,
|
|
7649
|
+
quarter: 90,
|
|
7650
|
+
year: 365,
|
|
7651
|
+
all: 365
|
|
7652
|
+
// Use 1 year as baseline for 'all'
|
|
7653
|
+
};
|
|
7654
|
+
return commits / daysInPeriod[period];
|
|
7655
|
+
}
|
|
7240
7656
|
async function calculateCodeMetrics(gitAnalyzer, username, since, until) {
|
|
7241
7657
|
if (!gitAnalyzer) {
|
|
7242
7658
|
return emptyCodeMetrics();
|
|
@@ -7373,7 +7789,7 @@ var FileSystemMetricsAdapter = class {
|
|
|
7373
7789
|
const taskFiles = files.filter((f) => f.startsWith("task-") && f.endsWith(".md"));
|
|
7374
7790
|
const tasks = [];
|
|
7375
7791
|
for (const file of taskFiles) {
|
|
7376
|
-
const filePath =
|
|
7792
|
+
const filePath = path3.join(this.tasksDirectory, file);
|
|
7377
7793
|
let content;
|
|
7378
7794
|
try {
|
|
7379
7795
|
content = await fs.readFile(filePath, "utf-8");
|
|
@@ -7422,11 +7838,12 @@ var FileSystemMetricsAdapter = class {
|
|
|
7422
7838
|
}
|
|
7423
7839
|
return tasks;
|
|
7424
7840
|
}
|
|
7425
|
-
async getUserMetrics(userId,
|
|
7841
|
+
async getUserMetrics(userId, query) {
|
|
7426
7842
|
const user = this.userRegistry.getUser(userId);
|
|
7427
7843
|
const username = user ? user.name : userId;
|
|
7428
|
-
const
|
|
7429
|
-
const
|
|
7844
|
+
const { since, until } = resolvePeriod(query?.period || "week");
|
|
7845
|
+
const now = until;
|
|
7846
|
+
const weekAgo = since;
|
|
7430
7847
|
const tasks = await this.readTaskFiles();
|
|
7431
7848
|
const assigned = tasks.filter((t) => {
|
|
7432
7849
|
if (!t.assignee)
|
|
@@ -7439,7 +7856,7 @@ var FileSystemMetricsAdapter = class {
|
|
|
7439
7856
|
const temporalMetrics = await calculateTemporalMetrics(this.gitAnalyzer, username, weekAgo, now);
|
|
7440
7857
|
const rawMetrics = {
|
|
7441
7858
|
username,
|
|
7442
|
-
period: "week",
|
|
7859
|
+
period: query?.period || "week",
|
|
7443
7860
|
periodStart: toISOString(weekAgo),
|
|
7444
7861
|
periodEnd: toISOString(now),
|
|
7445
7862
|
codeMetrics,
|
|
@@ -7451,11 +7868,10 @@ var FileSystemMetricsAdapter = class {
|
|
|
7451
7868
|
// TODO: calculate from task timestamps
|
|
7452
7869
|
taskTypeDistribution: {},
|
|
7453
7870
|
// TODO: calculate from task types
|
|
7454
|
-
activityFrequency: codeMetrics.commits
|
|
7455
|
-
// commits per day
|
|
7871
|
+
activityFrequency: calculateActivityFrequency(codeMetrics.commits, query?.period || "week")
|
|
7456
7872
|
},
|
|
7457
7873
|
engagementMetrics: {
|
|
7458
|
-
commitsPerDay: codeMetrics.commits
|
|
7874
|
+
commitsPerDay: calculateActivityFrequency(codeMetrics.commits, query?.period || "week"),
|
|
7459
7875
|
consistency: 0,
|
|
7460
7876
|
// TODO: calculate standard deviation
|
|
7461
7877
|
activeTasksCount: active,
|
|
@@ -7465,14 +7881,17 @@ var FileSystemMetricsAdapter = class {
|
|
|
7465
7881
|
};
|
|
7466
7882
|
return UserStatsSchema.parse(rawMetrics);
|
|
7467
7883
|
}
|
|
7468
|
-
async getTeamMetrics(_teamId,
|
|
7469
|
-
const
|
|
7470
|
-
const
|
|
7884
|
+
async getTeamMetrics(_teamId, query) {
|
|
7885
|
+
const { since, until } = resolvePeriod(query?.period || "week");
|
|
7886
|
+
const now = until;
|
|
7887
|
+
const weekAgo = since;
|
|
7471
7888
|
const tasks = await this.readTaskFiles();
|
|
7472
7889
|
const contributors = /* @__PURE__ */ new Map();
|
|
7890
|
+
const normalizeKey = (name) => name.toLowerCase();
|
|
7473
7891
|
for (const t of tasks) {
|
|
7474
7892
|
const assignee = t.assignee || "unknown";
|
|
7475
|
-
const
|
|
7893
|
+
const key = normalizeKey(assignee);
|
|
7894
|
+
const prev = contributors.get(key) || {
|
|
7476
7895
|
username: assignee,
|
|
7477
7896
|
commits: 0,
|
|
7478
7897
|
tasksCompleted: 0,
|
|
@@ -7480,15 +7899,54 @@ var FileSystemMetricsAdapter = class {
|
|
|
7480
7899
|
};
|
|
7481
7900
|
if (t.status === "done")
|
|
7482
7901
|
prev.tasksCompleted += 1;
|
|
7483
|
-
contributors.set(
|
|
7902
|
+
contributors.set(key, prev);
|
|
7484
7903
|
}
|
|
7485
|
-
|
|
7904
|
+
try {
|
|
7905
|
+
const allUsers = this.userRegistry.getAllUsers?.() || [];
|
|
7906
|
+
for (const u of allUsers) {
|
|
7907
|
+
const username = u.name || u.id;
|
|
7908
|
+
const key = normalizeKey(username);
|
|
7909
|
+
if (!contributors.has(key)) {
|
|
7910
|
+
contributors.set(key, {
|
|
7911
|
+
username,
|
|
7912
|
+
commits: 0,
|
|
7913
|
+
tasksCompleted: 0,
|
|
7914
|
+
codeMetrics: emptyCodeMetrics()
|
|
7915
|
+
});
|
|
7916
|
+
}
|
|
7917
|
+
}
|
|
7918
|
+
} catch (error2) {
|
|
7919
|
+
console.warn("Failed to include registry users in team metrics:", error2);
|
|
7920
|
+
}
|
|
7921
|
+
if (this.gitAnalyzer) {
|
|
7486
7922
|
try {
|
|
7487
|
-
const
|
|
7923
|
+
const authors = await this.gitAnalyzer.getAuthors({
|
|
7924
|
+
since: weekAgo.toISOString(),
|
|
7925
|
+
until: now.toISOString()
|
|
7926
|
+
});
|
|
7927
|
+
for (const a of authors) {
|
|
7928
|
+
const name = a.name || a.email || "unknown";
|
|
7929
|
+
const key = normalizeKey(name);
|
|
7930
|
+
if (!contributors.has(key)) {
|
|
7931
|
+
contributors.set(key, {
|
|
7932
|
+
username: name,
|
|
7933
|
+
commits: 0,
|
|
7934
|
+
tasksCompleted: 0,
|
|
7935
|
+
codeMetrics: emptyCodeMetrics()
|
|
7936
|
+
});
|
|
7937
|
+
}
|
|
7938
|
+
}
|
|
7939
|
+
} catch (error2) {
|
|
7940
|
+
console.warn("Failed to fetch git authors for team metrics:", error2);
|
|
7941
|
+
}
|
|
7942
|
+
}
|
|
7943
|
+
for (const [_key, data] of contributors.entries()) {
|
|
7944
|
+
try {
|
|
7945
|
+
const codeMetrics = await calculateCodeMetrics(this.gitAnalyzer, data.username, weekAgo, now);
|
|
7488
7946
|
data.commits = codeMetrics.commits;
|
|
7489
7947
|
data.codeMetrics = codeMetrics;
|
|
7490
7948
|
} catch (error2) {
|
|
7491
|
-
console.error(`Failed to calculate metrics for ${username}:`, error2);
|
|
7949
|
+
console.error(`Failed to calculate metrics for ${data.username}:`, error2);
|
|
7492
7950
|
}
|
|
7493
7951
|
}
|
|
7494
7952
|
const totalCommits = Array.from(contributors.values()).reduce((sum, c) => sum + c.commits, 0);
|
|
@@ -7502,7 +7960,7 @@ var FileSystemMetricsAdapter = class {
|
|
|
7502
7960
|
commits: acc.commits + c.codeMetrics.commits
|
|
7503
7961
|
}), emptyCodeMetrics());
|
|
7504
7962
|
const team = {
|
|
7505
|
-
period: "week",
|
|
7963
|
+
period: query?.period || "week",
|
|
7506
7964
|
periodStart: toISOString(weekAgo),
|
|
7507
7965
|
periodEnd: toISOString(now),
|
|
7508
7966
|
totalContributors: contributors.size,
|
|
@@ -7556,14 +8014,129 @@ var FileSystemMetricsAdapter = class {
|
|
|
7556
8014
|
};
|
|
7557
8015
|
return base;
|
|
7558
8016
|
}
|
|
7559
|
-
};
|
|
8017
|
+
};
|
|
8018
|
+
|
|
8019
|
+
// ../file-system-task-provider/dist/fs-task-provider.js
|
|
8020
|
+
init_esm_shims();
|
|
8021
|
+
|
|
8022
|
+
// ../utils/dist/index.js
|
|
8023
|
+
init_esm_shims();
|
|
8024
|
+
|
|
8025
|
+
// ../utils/dist/security.js
|
|
8026
|
+
init_esm_shims();
|
|
8027
|
+
import { z } from "zod";
|
|
8028
|
+
var HostSchema = z.string().refine(
|
|
8029
|
+
(host) => {
|
|
8030
|
+
if (!host || host.length === 0) return false;
|
|
8031
|
+
if (host === "localhost") return true;
|
|
8032
|
+
const parts = host.split(".");
|
|
8033
|
+
const allNumeric = parts.every((p) => /^\d+$/.test(p));
|
|
8034
|
+
if (allNumeric) {
|
|
8035
|
+
if (parts.length !== 4) return false;
|
|
8036
|
+
return parts.every((part) => {
|
|
8037
|
+
const num = parseInt(part, 10);
|
|
8038
|
+
return !isNaN(num) && num >= 0 && num <= 255 && part === num.toString();
|
|
8039
|
+
});
|
|
8040
|
+
}
|
|
8041
|
+
const hostnameRegex = /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
8042
|
+
return hostnameRegex.test(host);
|
|
8043
|
+
},
|
|
8044
|
+
{
|
|
8045
|
+
message: "Invalid host. Must be localhost, a valid IPv4 address, or hostname."
|
|
8046
|
+
}
|
|
8047
|
+
);
|
|
8048
|
+
var PortSchema = z.union([
|
|
8049
|
+
z.number().int().min(1).max(65535),
|
|
8050
|
+
z.string().regex(/^\d+$/).transform((val) => parseInt(val, 10)).pipe(z.number().int().min(1).max(65535))
|
|
8051
|
+
]);
|
|
8052
|
+
var WebSocketUrlSchema = z.string().refine(
|
|
8053
|
+
(url) => {
|
|
8054
|
+
try {
|
|
8055
|
+
const parsed = new URL(url);
|
|
8056
|
+
return parsed.protocol === "ws:" || parsed.protocol === "wss:";
|
|
8057
|
+
} catch {
|
|
8058
|
+
return false;
|
|
8059
|
+
}
|
|
8060
|
+
},
|
|
8061
|
+
{ message: "Invalid WebSocket URL. Must use ws:// or wss:// protocol." }
|
|
8062
|
+
);
|
|
8063
|
+
var TaskIdSchema = z.string().min(1).max(100).regex(/^[a-zA-Z0-9_-]+$/, {
|
|
8064
|
+
message: "Task ID must contain only alphanumeric characters, hyphens, and underscores."
|
|
8065
|
+
});
|
|
8066
|
+
var UserIdSchema = z.string().min(1).max(100).regex(/^[a-zA-Z0-9._-]+$/, {
|
|
8067
|
+
message: "User ID must contain only alphanumeric characters, dots, hyphens, and underscores."
|
|
8068
|
+
});
|
|
8069
|
+
var EmailSchema = z.string().email().max(254);
|
|
8070
|
+
var SafePathSchema = z.string().refine(
|
|
8071
|
+
(filePath) => {
|
|
8072
|
+
if (!filePath || filePath.length === 0) return false;
|
|
8073
|
+
const dangerousPatterns = [
|
|
8074
|
+
/\.\./,
|
|
8075
|
+
// Parent directory (..)
|
|
8076
|
+
/~\//,
|
|
8077
|
+
// Home directory
|
|
8078
|
+
/^\//,
|
|
8079
|
+
// Absolute path
|
|
8080
|
+
/^[A-Za-z]:\\/
|
|
8081
|
+
// Windows absolute path
|
|
8082
|
+
];
|
|
8083
|
+
return !dangerousPatterns.some((pattern) => pattern.test(filePath));
|
|
8084
|
+
},
|
|
8085
|
+
{
|
|
8086
|
+
message: "Invalid path. Must be a relative path without traversal patterns."
|
|
8087
|
+
}
|
|
8088
|
+
);
|
|
8089
|
+
var DashboardOptionsSchema = z.object({
|
|
8090
|
+
host: HostSchema.optional(),
|
|
8091
|
+
port: PortSchema.optional(),
|
|
8092
|
+
wsPort: PortSchema.optional()
|
|
8093
|
+
});
|
|
8094
|
+
function isValidHost(host) {
|
|
8095
|
+
return HostSchema.safeParse(host).success;
|
|
8096
|
+
}
|
|
8097
|
+
function isValidPort(port) {
|
|
8098
|
+
return PortSchema.safeParse(port).success;
|
|
8099
|
+
}
|
|
8100
|
+
function escapeHtml(text) {
|
|
8101
|
+
if (!text || typeof text !== "string") {
|
|
8102
|
+
return "";
|
|
8103
|
+
}
|
|
8104
|
+
const htmlEscapeMap = {
|
|
8105
|
+
"&": "&",
|
|
8106
|
+
"<": "<",
|
|
8107
|
+
">": ">",
|
|
8108
|
+
'"': """,
|
|
8109
|
+
"'": "'",
|
|
8110
|
+
"/": "/"
|
|
8111
|
+
};
|
|
8112
|
+
return text.replace(/[&<>"'/]/g, (char) => htmlEscapeMap[char]);
|
|
8113
|
+
}
|
|
7560
8114
|
|
|
7561
|
-
//
|
|
8115
|
+
// ../utils/dist/string.js
|
|
7562
8116
|
init_esm_shims();
|
|
8117
|
+
function slugify(text) {
|
|
8118
|
+
return text.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
8119
|
+
}
|
|
8120
|
+
|
|
8121
|
+
// ../utils/dist/ui.js
|
|
8122
|
+
init_esm_shims();
|
|
8123
|
+
import chalk3 from "chalk";
|
|
8124
|
+
var colors2 = {
|
|
8125
|
+
primary: chalk3.blue,
|
|
8126
|
+
secondary: chalk3.gray,
|
|
8127
|
+
success: chalk3.green,
|
|
8128
|
+
warning: chalk3.yellow,
|
|
8129
|
+
error: chalk3.red,
|
|
8130
|
+
info: chalk3.cyan,
|
|
8131
|
+
highlight: chalk3.magenta,
|
|
8132
|
+
normal: chalk3.white
|
|
8133
|
+
};
|
|
8134
|
+
|
|
8135
|
+
// ../file-system-task-provider/dist/fs-task-provider.js
|
|
7563
8136
|
init_i18n();
|
|
7564
8137
|
init_task_validator();
|
|
7565
8138
|
import { promises as fs2 } from "fs";
|
|
7566
|
-
import
|
|
8139
|
+
import path4 from "path";
|
|
7567
8140
|
var FileSystemTaskProvider = class {
|
|
7568
8141
|
tasksDirectory;
|
|
7569
8142
|
userRegistry;
|
|
@@ -7581,7 +8154,7 @@ var FileSystemTaskProvider = class {
|
|
|
7581
8154
|
if (!taskFile) {
|
|
7582
8155
|
return void 0;
|
|
7583
8156
|
}
|
|
7584
|
-
const filePath =
|
|
8157
|
+
const filePath = path4.join(this.tasksDirectory, taskFile);
|
|
7585
8158
|
const content = await fs2.readFile(filePath, "utf-8");
|
|
7586
8159
|
const titleMatch = content.match(/^# .*Task.*?[—-]\s*(.+)$/im);
|
|
7587
8160
|
const title = titleMatch ? titleMatch[1].trim() : "Untitled";
|
|
@@ -7655,7 +8228,7 @@ var FileSystemTaskProvider = class {
|
|
|
7655
8228
|
);
|
|
7656
8229
|
const tasks = [];
|
|
7657
8230
|
for (const file of taskFiles) {
|
|
7658
|
-
const filePath =
|
|
8231
|
+
const filePath = path4.join(this.tasksDirectory, file);
|
|
7659
8232
|
const content = await fs2.readFile(filePath, "utf-8");
|
|
7660
8233
|
const idMatch = file.match(/^task-(\d+)-/);
|
|
7661
8234
|
const taskId = idMatch ? idMatch[1] : "unknown";
|
|
@@ -7712,9 +8285,9 @@ var FileSystemTaskProvider = class {
|
|
|
7712
8285
|
}).filter((num) => !isNaN(num));
|
|
7713
8286
|
const nextNumber = taskNumbers.length > 0 ? Math.max(...taskNumbers) + 1 : 1;
|
|
7714
8287
|
const taskId = String(nextNumber).padStart(3, "0");
|
|
7715
|
-
const titleSlug = options.title
|
|
8288
|
+
const titleSlug = slugify(options.title);
|
|
7716
8289
|
const fileName = `task-${taskId}-${titleSlug}.md`;
|
|
7717
|
-
const filePath =
|
|
8290
|
+
const filePath = path4.join(this.tasksDirectory, fileName);
|
|
7718
8291
|
const fileExists = await fs2.access(filePath).then(() => true).catch(() => false);
|
|
7719
8292
|
if (fileExists) {
|
|
7720
8293
|
throw new Error(`Task file already exists: ${fileName}`);
|
|
@@ -7767,7 +8340,7 @@ ${i18n.notesPlaceholder}
|
|
|
7767
8340
|
}
|
|
7768
8341
|
async lint(fix) {
|
|
7769
8342
|
const files = await fs2.readdir(this.tasksDirectory);
|
|
7770
|
-
const taskFiles = files.filter((file) => file.startsWith("task-") && file.endsWith(".md")).map((file) =>
|
|
8343
|
+
const taskFiles = files.filter((file) => file.startsWith("task-") && file.endsWith(".md")).map((file) => path4.join(this.tasksDirectory, file));
|
|
7771
8344
|
if (fix) {
|
|
7772
8345
|
let fixedCount = 0;
|
|
7773
8346
|
for (const filePath of taskFiles) {
|
|
@@ -7789,20 +8362,20 @@ ${i18n.notesPlaceholder}
|
|
|
7789
8362
|
}
|
|
7790
8363
|
};
|
|
7791
8364
|
|
|
7792
|
-
//
|
|
8365
|
+
// ../file-system-task-provider/dist/index.js
|
|
7793
8366
|
init_i18n();
|
|
7794
8367
|
|
|
7795
|
-
//
|
|
8368
|
+
// ../file-system-task-provider/dist/user-registry.js
|
|
7796
8369
|
init_esm_shims();
|
|
7797
8370
|
import { promises as fs3 } from "fs";
|
|
7798
|
-
import
|
|
8371
|
+
import path5 from "path";
|
|
7799
8372
|
var UserRegistry = class {
|
|
7800
8373
|
config;
|
|
7801
8374
|
users = /* @__PURE__ */ new Map();
|
|
7802
8375
|
usersFilePath;
|
|
7803
8376
|
constructor(config) {
|
|
7804
8377
|
this.config = config;
|
|
7805
|
-
this.usersFilePath =
|
|
8378
|
+
this.usersFilePath = path5.join(config.taskinDir, "users.json");
|
|
7806
8379
|
}
|
|
7807
8380
|
/**
|
|
7808
8381
|
* Load users from users.json
|
|
@@ -8285,200 +8858,12 @@ init_esm_shims();
|
|
|
8285
8858
|
// ../../node_modules/.pnpm/@opentask+taskin-task-server-ws@0.1.3/node_modules/@opentask/taskin-task-server-ws/dist/task-server-ws.types.js
|
|
8286
8859
|
init_esm_shims();
|
|
8287
8860
|
|
|
8288
|
-
// ../../node_modules/.pnpm/@opentask+taskin-utils@1.0.5/node_modules/@opentask/taskin-utils/dist/index.js
|
|
8289
|
-
init_esm_shims();
|
|
8290
|
-
|
|
8291
|
-
// ../../node_modules/.pnpm/@opentask+taskin-utils@1.0.5/node_modules/@opentask/taskin-utils/dist/security.js
|
|
8292
|
-
init_esm_shims();
|
|
8293
|
-
import { z } from "zod";
|
|
8294
|
-
var HostSchema = z.string().refine((host) => {
|
|
8295
|
-
if (!host || host.length === 0)
|
|
8296
|
-
return false;
|
|
8297
|
-
if (host === "localhost")
|
|
8298
|
-
return true;
|
|
8299
|
-
const parts = host.split(".");
|
|
8300
|
-
const allNumeric = parts.every((p) => /^\d+$/.test(p));
|
|
8301
|
-
if (allNumeric) {
|
|
8302
|
-
if (parts.length !== 4)
|
|
8303
|
-
return false;
|
|
8304
|
-
return parts.every((part) => {
|
|
8305
|
-
const num = parseInt(part, 10);
|
|
8306
|
-
return !isNaN(num) && num >= 0 && num <= 255 && part === num.toString();
|
|
8307
|
-
});
|
|
8308
|
-
}
|
|
8309
|
-
const hostnameRegex = /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
8310
|
-
return hostnameRegex.test(host);
|
|
8311
|
-
}, {
|
|
8312
|
-
message: "Invalid host. Must be localhost, a valid IPv4 address, or hostname."
|
|
8313
|
-
});
|
|
8314
|
-
var PortSchema = z.union([
|
|
8315
|
-
z.number().int().min(1).max(65535),
|
|
8316
|
-
z.string().regex(/^\d+$/).transform((val) => parseInt(val, 10)).pipe(z.number().int().min(1).max(65535))
|
|
8317
|
-
]);
|
|
8318
|
-
var WebSocketUrlSchema = z.string().refine((url) => {
|
|
8319
|
-
try {
|
|
8320
|
-
const parsed = new URL(url);
|
|
8321
|
-
return parsed.protocol === "ws:" || parsed.protocol === "wss:";
|
|
8322
|
-
} catch {
|
|
8323
|
-
return false;
|
|
8324
|
-
}
|
|
8325
|
-
}, { message: "Invalid WebSocket URL. Must use ws:// or wss:// protocol." });
|
|
8326
|
-
var TaskIdSchema = z.string().min(1).max(100).regex(/^[a-zA-Z0-9_-]+$/, {
|
|
8327
|
-
message: "Task ID must contain only alphanumeric characters, hyphens, and underscores."
|
|
8328
|
-
});
|
|
8329
|
-
var UserIdSchema = z.string().min(1).max(100).regex(/^[a-zA-Z0-9._-]+$/, {
|
|
8330
|
-
message: "User ID must contain only alphanumeric characters, dots, hyphens, and underscores."
|
|
8331
|
-
});
|
|
8332
|
-
var EmailSchema = z.string().email().max(254);
|
|
8333
|
-
var SafePathSchema = z.string().refine((filePath) => {
|
|
8334
|
-
if (!filePath || filePath.length === 0)
|
|
8335
|
-
return false;
|
|
8336
|
-
const dangerousPatterns = [
|
|
8337
|
-
/\.\./,
|
|
8338
|
-
// Parent directory (..)
|
|
8339
|
-
/~\//,
|
|
8340
|
-
// Home directory
|
|
8341
|
-
/^\//,
|
|
8342
|
-
// Absolute path
|
|
8343
|
-
/^[A-Za-z]:\\/
|
|
8344
|
-
// Windows absolute path
|
|
8345
|
-
];
|
|
8346
|
-
return !dangerousPatterns.some((pattern) => pattern.test(filePath));
|
|
8347
|
-
}, {
|
|
8348
|
-
message: "Invalid path. Must be a relative path without traversal patterns."
|
|
8349
|
-
});
|
|
8350
|
-
var DashboardOptionsSchema = z.object({
|
|
8351
|
-
host: HostSchema.optional(),
|
|
8352
|
-
port: PortSchema.optional(),
|
|
8353
|
-
wsPort: PortSchema.optional()
|
|
8354
|
-
});
|
|
8355
|
-
function isValidHost(host) {
|
|
8356
|
-
return HostSchema.safeParse(host).success;
|
|
8357
|
-
}
|
|
8358
|
-
function isValidPort(port) {
|
|
8359
|
-
return PortSchema.safeParse(port).success;
|
|
8360
|
-
}
|
|
8361
|
-
function escapeHtml(text) {
|
|
8362
|
-
if (!text || typeof text !== "string") {
|
|
8363
|
-
return "";
|
|
8364
|
-
}
|
|
8365
|
-
const htmlEscapeMap = {
|
|
8366
|
-
"&": "&",
|
|
8367
|
-
"<": "<",
|
|
8368
|
-
">": ">",
|
|
8369
|
-
'"': """,
|
|
8370
|
-
"'": "'",
|
|
8371
|
-
"/": "/"
|
|
8372
|
-
};
|
|
8373
|
-
return text.replace(/[&<>"'/]/g, (char) => htmlEscapeMap[char]);
|
|
8374
|
-
}
|
|
8375
|
-
|
|
8376
|
-
// ../../node_modules/.pnpm/@opentask+taskin-utils@1.0.5/node_modules/@opentask/taskin-utils/dist/ui.js
|
|
8377
|
-
init_esm_shims();
|
|
8378
|
-
import chalk from "chalk";
|
|
8379
|
-
var colors = {
|
|
8380
|
-
primary: chalk.blue,
|
|
8381
|
-
secondary: chalk.gray,
|
|
8382
|
-
success: chalk.green,
|
|
8383
|
-
warning: chalk.yellow,
|
|
8384
|
-
error: chalk.red,
|
|
8385
|
-
info: chalk.cyan,
|
|
8386
|
-
highlight: chalk.magenta,
|
|
8387
|
-
normal: chalk.white
|
|
8388
|
-
};
|
|
8389
|
-
|
|
8390
8861
|
// src/commands/dashboard.ts
|
|
8391
|
-
import
|
|
8862
|
+
import chalk4 from "chalk";
|
|
8392
8863
|
import express from "express";
|
|
8393
8864
|
import { createServer } from "http";
|
|
8394
8865
|
import path6 from "path";
|
|
8395
8866
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
8396
|
-
|
|
8397
|
-
// src/lib/colors.ts
|
|
8398
|
-
init_esm_shims();
|
|
8399
|
-
import chalk2 from "chalk";
|
|
8400
|
-
var colors2 = {
|
|
8401
|
-
info: chalk2.cyan,
|
|
8402
|
-
success: chalk2.green,
|
|
8403
|
-
warning: chalk2.yellow,
|
|
8404
|
-
error: chalk2.red,
|
|
8405
|
-
highlight: chalk2.bold.white,
|
|
8406
|
-
secondary: chalk2.gray,
|
|
8407
|
-
normal: chalk2.white
|
|
8408
|
-
};
|
|
8409
|
-
var icons = {
|
|
8410
|
-
rocket: "\u{1F680}",
|
|
8411
|
-
list: "\u{1F4CA}",
|
|
8412
|
-
check: "\u2705",
|
|
8413
|
-
pause: "\u23F8\uFE0F",
|
|
8414
|
-
info: "\u{1F4A1}",
|
|
8415
|
-
task: "\u{1F4CB}",
|
|
8416
|
-
gear: "\u2699\uFE0F"
|
|
8417
|
-
};
|
|
8418
|
-
function printHeader(title, icon) {
|
|
8419
|
-
console.log();
|
|
8420
|
-
console.log(colors2.highlight("\u2550".repeat(60)));
|
|
8421
|
-
console.log(colors2.highlight(`${icon} ${title}`));
|
|
8422
|
-
console.log(colors2.highlight("\u2550".repeat(60)));
|
|
8423
|
-
console.log();
|
|
8424
|
-
}
|
|
8425
|
-
function success(message) {
|
|
8426
|
-
console.log(colors2.success(`\u2713 ${message}`));
|
|
8427
|
-
}
|
|
8428
|
-
function error(message) {
|
|
8429
|
-
console.error(colors2.error(`\u2717 ${message}`));
|
|
8430
|
-
}
|
|
8431
|
-
function info(message) {
|
|
8432
|
-
console.log(colors2.info(`\u2139 ${message}`));
|
|
8433
|
-
}
|
|
8434
|
-
|
|
8435
|
-
// src/lib/project-check.ts
|
|
8436
|
-
init_esm_shims();
|
|
8437
|
-
import { existsSync } from "fs";
|
|
8438
|
-
import path5 from "path";
|
|
8439
|
-
function isTaskinProject(cwd = process.cwd()) {
|
|
8440
|
-
return existsSync(path5.join(cwd, ".taskin.json"));
|
|
8441
|
-
}
|
|
8442
|
-
function requireTaskinProject(cwd = process.cwd()) {
|
|
8443
|
-
if (!isTaskinProject(cwd)) {
|
|
8444
|
-
error(
|
|
8445
|
-
'This directory is not initialized as a taskin project. Run "taskin init" first.'
|
|
8446
|
-
);
|
|
8447
|
-
process.exit(1);
|
|
8448
|
-
}
|
|
8449
|
-
}
|
|
8450
|
-
|
|
8451
|
-
// src/commands/define-command/index.ts
|
|
8452
|
-
init_esm_shims();
|
|
8453
|
-
|
|
8454
|
-
// src/commands/define-command/define-command.ts
|
|
8455
|
-
init_esm_shims();
|
|
8456
|
-
var defineCommand = (config) => {
|
|
8457
|
-
return (program2) => {
|
|
8458
|
-
const cmd = program2.command(config.name).description(config.description);
|
|
8459
|
-
if (config.alias) {
|
|
8460
|
-
cmd.alias(config.alias);
|
|
8461
|
-
}
|
|
8462
|
-
config.options?.forEach((opt) => {
|
|
8463
|
-
cmd.option(opt.flags, opt.description, opt.defaultValue);
|
|
8464
|
-
});
|
|
8465
|
-
cmd.action(async (...args) => {
|
|
8466
|
-
try {
|
|
8467
|
-
await config.handler(...args);
|
|
8468
|
-
} catch (err) {
|
|
8469
|
-
error(
|
|
8470
|
-
`Failed to execute command: ${err instanceof Error ? err.message : String(err)}`
|
|
8471
|
-
);
|
|
8472
|
-
process.exit(1);
|
|
8473
|
-
}
|
|
8474
|
-
});
|
|
8475
|
-
};
|
|
8476
|
-
};
|
|
8477
|
-
|
|
8478
|
-
// src/commands/define-command/define-command.types.ts
|
|
8479
|
-
init_esm_shims();
|
|
8480
|
-
|
|
8481
|
-
// src/commands/dashboard.ts
|
|
8482
8867
|
var __filename2 = fileURLToPath2(import.meta.url);
|
|
8483
8868
|
var __dirname2 = path6.dirname(__filename2);
|
|
8484
8869
|
var dashboardCommand = defineCommand({
|
|
@@ -8504,6 +8889,14 @@ var dashboardCommand = defineCommand({
|
|
|
8504
8889
|
{
|
|
8505
8890
|
flags: "-o, --open",
|
|
8506
8891
|
description: "Open browser automatically"
|
|
8892
|
+
},
|
|
8893
|
+
{
|
|
8894
|
+
flags: "--filter-open",
|
|
8895
|
+
description: "Show only open tasks (pending, in-progress, blocked)"
|
|
8896
|
+
},
|
|
8897
|
+
{
|
|
8898
|
+
flags: "--filter-closed",
|
|
8899
|
+
description: "Show only closed tasks (done, canceled)"
|
|
8507
8900
|
}
|
|
8508
8901
|
],
|
|
8509
8902
|
handler: async (options) => {
|
|
@@ -8639,18 +9032,32 @@ async function startDashboard(options) {
|
|
|
8639
9032
|
});
|
|
8640
9033
|
});
|
|
8641
9034
|
success(`\u2713 Dashboard available at http://${host}:${port}`);
|
|
9035
|
+
const filterParams = new URLSearchParams();
|
|
9036
|
+
if (options.filterOpen) {
|
|
9037
|
+
filterParams.set("filter", "open");
|
|
9038
|
+
} else if (options.filterClosed) {
|
|
9039
|
+
filterParams.set("filter", "closed");
|
|
9040
|
+
}
|
|
9041
|
+
const filterQuery = filterParams.toString() ? `?${filterParams.toString()}` : "";
|
|
8642
9042
|
if (options.open) {
|
|
8643
|
-
const url = `http://${host}:${port}`;
|
|
9043
|
+
const url = `http://${host}:${port}${filterQuery}`;
|
|
8644
9044
|
await import("child_process").then((cp) => {
|
|
8645
9045
|
const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
8646
9046
|
cp.exec(`${cmd} ${url}`);
|
|
8647
9047
|
});
|
|
8648
9048
|
}
|
|
8649
9049
|
info("");
|
|
8650
|
-
info(
|
|
8651
|
-
info(
|
|
8652
|
-
|
|
8653
|
-
|
|
9050
|
+
info(chalk4.bold("Dashboard Controls:"));
|
|
9051
|
+
info(
|
|
9052
|
+
` \u2022 Dashboard: ${chalk4.cyan(`http://${host}:${port}${filterQuery}`)}`
|
|
9053
|
+
);
|
|
9054
|
+
info(` \u2022 WebSocket: ${chalk4.cyan(`ws://${host}:${wsPort}`)}`);
|
|
9055
|
+
if (options.filterOpen) {
|
|
9056
|
+
info(` \u2022 Filter: ${chalk4.yellow("Open tasks only")}`);
|
|
9057
|
+
} else if (options.filterClosed) {
|
|
9058
|
+
info(` \u2022 Filter: ${chalk4.yellow("Closed tasks only")}`);
|
|
9059
|
+
}
|
|
9060
|
+
info(` \u2022 Press ${chalk4.bold("Ctrl+C")} to stop both servers`);
|
|
8654
9061
|
info("");
|
|
8655
9062
|
const cleanup = async () => {
|
|
8656
9063
|
info("\nShutting down servers...");
|
|
@@ -8675,13 +9082,13 @@ async function startDashboard(options) {
|
|
|
8675
9082
|
// src/commands/export.ts
|
|
8676
9083
|
init_esm_shims();
|
|
8677
9084
|
|
|
8678
|
-
// ../../node_modules/.pnpm/@opentask+taskin-git-utils@2.0
|
|
9085
|
+
// ../../node_modules/.pnpm/@opentask+taskin-git-utils@2.1.0/node_modules/@opentask/taskin-git-utils/dist/src/index.js
|
|
8679
9086
|
init_esm_shims();
|
|
8680
9087
|
|
|
8681
|
-
// ../../node_modules/.pnpm/@opentask+taskin-git-utils@2.0
|
|
9088
|
+
// ../../node_modules/.pnpm/@opentask+taskin-git-utils@2.1.0/node_modules/@opentask/taskin-git-utils/dist/src/git.js
|
|
8682
9089
|
init_esm_shims();
|
|
8683
9090
|
|
|
8684
|
-
// ../../node_modules/.pnpm/@opentask+taskin-git-utils@2.0
|
|
9091
|
+
// ../../node_modules/.pnpm/@opentask+taskin-git-utils@2.1.0/node_modules/@opentask/taskin-git-utils/dist/src/git-analyzer.js
|
|
8685
9092
|
init_esm_shims();
|
|
8686
9093
|
import { exec } from "child_process";
|
|
8687
9094
|
import { promisify } from "util";
|
|
@@ -8694,8 +9101,10 @@ async function executeGit(command, cwd) {
|
|
|
8694
9101
|
const { stdout } = await execAsync(`git ${command}`, {
|
|
8695
9102
|
cwd: cwd || process.cwd(),
|
|
8696
9103
|
encoding: "utf8",
|
|
8697
|
-
maxBuffer: 10 * 1024 * 1024
|
|
9104
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
8698
9105
|
// 10MB buffer for large repos
|
|
9106
|
+
timeout: 3e4
|
|
9107
|
+
// 30 second timeout
|
|
8699
9108
|
});
|
|
8700
9109
|
return stdout.trim();
|
|
8701
9110
|
} catch (error2) {
|
|
@@ -8734,10 +9143,10 @@ var GitAnalyzer = class {
|
|
|
8734
9143
|
args.push(`--since="${options.since}"`);
|
|
8735
9144
|
}
|
|
8736
9145
|
if (options.until) {
|
|
8737
|
-
args.push(`--until
|
|
9146
|
+
args.push(`--until=${options.until}`);
|
|
8738
9147
|
}
|
|
8739
9148
|
if (options.author) {
|
|
8740
|
-
args.push(`--author=
|
|
9149
|
+
args.push(`--author='${options.author}'`);
|
|
8741
9150
|
}
|
|
8742
9151
|
if (options.maxCount) {
|
|
8743
9152
|
args.push(`-n ${options.maxCount}`);
|
|
@@ -8767,7 +9176,7 @@ var GitAnalyzer = class {
|
|
|
8767
9176
|
}
|
|
8768
9177
|
if (line.includes("|")) {
|
|
8769
9178
|
const parts = line.split("|");
|
|
8770
|
-
if (parts.length < 4 || !/^[0-9a-f]{40}
|
|
9179
|
+
if (parts.length < 4 || !/^[0-9a-f]{6,40}$/i.test(parts[0])) {
|
|
8771
9180
|
i++;
|
|
8772
9181
|
continue;
|
|
8773
9182
|
}
|
|
@@ -8920,7 +9329,7 @@ ${body}` : subject;
|
|
|
8920
9329
|
let lineNumber = 0;
|
|
8921
9330
|
for (let i = 0; i < lines.length; i++) {
|
|
8922
9331
|
const line = lines[i];
|
|
8923
|
-
if (line.match(/^[0-9a-f]{40}/)) {
|
|
9332
|
+
if (line.match(/^[0-9a-f]{6,40}/i)) {
|
|
8924
9333
|
const parts = line.split(" ");
|
|
8925
9334
|
currentHash = parts[0];
|
|
8926
9335
|
lineNumber = parseInt(parts[2], 10);
|
|
@@ -8945,10 +9354,10 @@ ${body}` : subject;
|
|
|
8945
9354
|
async getAuthors(options = {}) {
|
|
8946
9355
|
const args = ["shortlog", "-sne"];
|
|
8947
9356
|
if (options.since) {
|
|
8948
|
-
args.push(`--since
|
|
9357
|
+
args.push(`--since=${options.since}`);
|
|
8949
9358
|
}
|
|
8950
9359
|
if (options.until) {
|
|
8951
|
-
args.push(`--until
|
|
9360
|
+
args.push(`--until=${options.until}`);
|
|
8952
9361
|
}
|
|
8953
9362
|
if (!options.includeMerges) {
|
|
8954
9363
|
args.push("--no-merges");
|
|
@@ -8956,7 +9365,8 @@ ${body}` : subject;
|
|
|
8956
9365
|
if (options.filePath) {
|
|
8957
9366
|
args.push("--", options.filePath);
|
|
8958
9367
|
}
|
|
8959
|
-
const
|
|
9368
|
+
const command = args.join(" ");
|
|
9369
|
+
const output = await executeGit(command, this.repositoryPath);
|
|
8960
9370
|
if (!output) {
|
|
8961
9371
|
return [];
|
|
8962
9372
|
}
|
|
@@ -8986,10 +9396,10 @@ ${body}` : subject;
|
|
|
8986
9396
|
}
|
|
8987
9397
|
};
|
|
8988
9398
|
|
|
8989
|
-
// ../../node_modules/.pnpm/@opentask+taskin-git-utils@2.0
|
|
9399
|
+
// ../../node_modules/.pnpm/@opentask+taskin-git-utils@2.1.0/node_modules/@opentask/taskin-git-utils/dist/src/git-analyzer.types.js
|
|
8990
9400
|
init_esm_shims();
|
|
8991
9401
|
|
|
8992
|
-
// ../../node_modules/.pnpm/@opentask+taskin-git-utils@2.0
|
|
9402
|
+
// ../../node_modules/.pnpm/@opentask+taskin-git-utils@2.1.0/node_modules/@opentask/taskin-git-utils/dist/src/git.types.js
|
|
8993
9403
|
init_esm_shims();
|
|
8994
9404
|
|
|
8995
9405
|
// src/commands/export.ts
|
|
@@ -9081,11 +9491,14 @@ import path9 from "path";
|
|
|
9081
9491
|
|
|
9082
9492
|
// src/lib/sound-player.ts
|
|
9083
9493
|
init_esm_shims();
|
|
9084
|
-
import { existsSync as
|
|
9494
|
+
import { existsSync as existsSync3 } from "fs";
|
|
9085
9495
|
import path8 from "path";
|
|
9086
9496
|
import player from "play-sound";
|
|
9087
9497
|
var soundPlayer = player({});
|
|
9088
9498
|
function playSound(soundName) {
|
|
9499
|
+
if (process.env.CI === "true" || process.env.NODE_ENV === "test") {
|
|
9500
|
+
return;
|
|
9501
|
+
}
|
|
9089
9502
|
try {
|
|
9090
9503
|
const possiblePaths = [
|
|
9091
9504
|
// In development (from src)
|
|
@@ -9095,7 +9508,7 @@ function playSound(soundName) {
|
|
|
9095
9508
|
// Custom sound in project root
|
|
9096
9509
|
path8.join(process.cwd(), ".taskin", `${soundName}.mp3`)
|
|
9097
9510
|
];
|
|
9098
|
-
const soundPath = possiblePaths.find((p) =>
|
|
9511
|
+
const soundPath = possiblePaths.find((p) => existsSync3(p));
|
|
9099
9512
|
if (!soundPath) {
|
|
9100
9513
|
return;
|
|
9101
9514
|
}
|
|
@@ -9158,17 +9571,33 @@ async function finishTask(taskId, options) {
|
|
|
9158
9571
|
info("Skipping status update (--skip-update flag)");
|
|
9159
9572
|
}
|
|
9160
9573
|
console.log();
|
|
9161
|
-
info("
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9574
|
+
info("Next steps (suggestions):");
|
|
9575
|
+
if (!options.skipUpdate) {
|
|
9576
|
+
const commitType = task.type || "feat";
|
|
9577
|
+
console.log(
|
|
9578
|
+
colors.secondary(
|
|
9579
|
+
` 1. Commit the status change: git add TASKS/task-${normalizedId}-*.md && git commit -m "docs(TASKS): task-${normalizedId} - atualiza status para done [skip-ci]"`
|
|
9580
|
+
)
|
|
9581
|
+
);
|
|
9582
|
+
console.log(colors.secondary(" 2. Review your changes"));
|
|
9583
|
+
console.log(
|
|
9584
|
+
colors.secondary(
|
|
9585
|
+
` 3. Commit your work: git add . && git commit -m "${commitType}(task-${normalizedId}): ${task.title}"`
|
|
9586
|
+
)
|
|
9587
|
+
);
|
|
9588
|
+
console.log(colors.secondary(" 4. Push: git push"));
|
|
9589
|
+
console.log(colors.secondary(" 5. Create a Pull Request"));
|
|
9590
|
+
} else {
|
|
9591
|
+
const commitType = task.type || "feat";
|
|
9592
|
+
console.log(colors.secondary(" 1. Review your changes"));
|
|
9593
|
+
console.log(
|
|
9594
|
+
colors.secondary(
|
|
9595
|
+
` 2. Commit your work: git add . && git commit -m "${commitType}(task-${normalizedId}): ${task.title}"`
|
|
9596
|
+
)
|
|
9597
|
+
);
|
|
9598
|
+
console.log(colors.secondary(" 3. Push: git push"));
|
|
9599
|
+
console.log(colors.secondary(" 4. Create a Pull Request"));
|
|
9600
|
+
}
|
|
9172
9601
|
console.log();
|
|
9173
9602
|
success("Great work! \u{1F680}");
|
|
9174
9603
|
console.log();
|
|
@@ -9180,14 +9609,14 @@ async function finishTask(taskId, options) {
|
|
|
9180
9609
|
// src/commands/init.ts
|
|
9181
9610
|
init_esm_shims();
|
|
9182
9611
|
import {
|
|
9183
|
-
existsSync as
|
|
9612
|
+
existsSync as existsSync5,
|
|
9184
9613
|
mkdirSync,
|
|
9185
|
-
readFileSync,
|
|
9614
|
+
readFileSync as readFileSync2,
|
|
9186
9615
|
readdirSync,
|
|
9187
|
-
writeFileSync
|
|
9616
|
+
writeFileSync as writeFileSync2
|
|
9188
9617
|
} from "fs";
|
|
9189
|
-
import
|
|
9190
|
-
import { join } from "path";
|
|
9618
|
+
import inquirer2 from "inquirer";
|
|
9619
|
+
import { join as join2 } from "path";
|
|
9191
9620
|
|
|
9192
9621
|
// src/lib/provider-installer/index.ts
|
|
9193
9622
|
init_esm_shims();
|
|
@@ -9195,12 +9624,12 @@ init_esm_shims();
|
|
|
9195
9624
|
// src/lib/provider-installer/provider-installer.ts
|
|
9196
9625
|
init_esm_shims();
|
|
9197
9626
|
import { execSync } from "child_process";
|
|
9198
|
-
import { existsSync as
|
|
9627
|
+
import { existsSync as existsSync4 } from "fs";
|
|
9199
9628
|
function detectPackageManager() {
|
|
9200
|
-
if (
|
|
9629
|
+
if (existsSync4("pnpm-lock.yaml")) {
|
|
9201
9630
|
return "pnpm";
|
|
9202
9631
|
}
|
|
9203
|
-
if (
|
|
9632
|
+
if (existsSync4("yarn.lock")) {
|
|
9204
9633
|
return "yarn";
|
|
9205
9634
|
}
|
|
9206
9635
|
return "npm";
|
|
@@ -9408,8 +9837,8 @@ var initCommand = defineCommand({
|
|
|
9408
9837
|
async function initializeTaskin(options) {
|
|
9409
9838
|
printHeader("Initializing Taskin", "\u{1F3AF}");
|
|
9410
9839
|
const cwd = process.cwd();
|
|
9411
|
-
const configFile =
|
|
9412
|
-
if (
|
|
9840
|
+
const configFile = join2(cwd, ".taskin.json");
|
|
9841
|
+
if (existsSync5(configFile) && !options.force) {
|
|
9413
9842
|
error("Taskin is already initialized in this project");
|
|
9414
9843
|
info("Use --force to reinitialize");
|
|
9415
9844
|
process.exit(1);
|
|
@@ -9428,12 +9857,12 @@ async function initializeTaskin(options) {
|
|
|
9428
9857
|
let providerId;
|
|
9429
9858
|
if (options.provider) {
|
|
9430
9859
|
providerId = options.provider;
|
|
9431
|
-
info(`Using provider from command line: ${
|
|
9860
|
+
info(`Using provider from command line: ${colors.highlight(providerId)}`);
|
|
9432
9861
|
} else if (process.env.CI === "true") {
|
|
9433
9862
|
providerId = "fs";
|
|
9434
9863
|
info("CI environment detected, using default provider: fs");
|
|
9435
9864
|
} else {
|
|
9436
|
-
const response = await
|
|
9865
|
+
const response = await inquirer2.prompt([
|
|
9437
9866
|
{
|
|
9438
9867
|
type: "list",
|
|
9439
9868
|
name: "providerId",
|
|
@@ -9450,7 +9879,7 @@ async function initializeTaskin(options) {
|
|
|
9450
9879
|
process.exit(1);
|
|
9451
9880
|
}
|
|
9452
9881
|
console.log();
|
|
9453
|
-
info(`Setting up task provider: ${
|
|
9882
|
+
info(`Setting up task provider: ${colors.highlight(selectedProvider.name)}`);
|
|
9454
9883
|
console.log();
|
|
9455
9884
|
const bundledProviders = ["fs"];
|
|
9456
9885
|
if (!bundledProviders.includes(selectedProvider.id)) {
|
|
@@ -9465,14 +9894,14 @@ async function initializeTaskin(options) {
|
|
|
9465
9894
|
}
|
|
9466
9895
|
};
|
|
9467
9896
|
info("Creating configuration file...");
|
|
9468
|
-
|
|
9469
|
-
success(`\u2713 Created ${
|
|
9470
|
-
const gitignorePath =
|
|
9471
|
-
if (
|
|
9472
|
-
const gitignoreContent =
|
|
9897
|
+
writeFileSync2(configFile, JSON.stringify(config, null, 2), "utf-8");
|
|
9898
|
+
success(`\u2713 Created ${colors.highlight(".taskin.json")}`);
|
|
9899
|
+
const gitignorePath = join2(cwd, ".gitignore");
|
|
9900
|
+
if (existsSync5(gitignorePath)) {
|
|
9901
|
+
const gitignoreContent = readFileSync2(gitignorePath, "utf-8");
|
|
9473
9902
|
if (!gitignoreContent.includes(".taskin.json")) {
|
|
9474
9903
|
info("Adding .taskin.json to .gitignore...");
|
|
9475
|
-
|
|
9904
|
+
writeFileSync2(
|
|
9476
9905
|
gitignorePath,
|
|
9477
9906
|
`${gitignoreContent}
|
|
9478
9907
|
# Taskin configuration
|
|
@@ -9487,13 +9916,13 @@ async function initializeTaskin(options) {
|
|
|
9487
9916
|
success("\u{1F389} Taskin initialized successfully!");
|
|
9488
9917
|
console.log();
|
|
9489
9918
|
info("Next steps:");
|
|
9490
|
-
console.log(
|
|
9919
|
+
console.log(colors.secondary(" 1. Run: taskin list"));
|
|
9491
9920
|
console.log(
|
|
9492
|
-
|
|
9921
|
+
colors.secondary(
|
|
9493
9922
|
selectedProvider.id === "fs" ? " 2. Create a new task: taskin new (interactive mode)" : ` 2. Tasks will be synced with ${selectedProvider.name}`
|
|
9494
9923
|
)
|
|
9495
9924
|
);
|
|
9496
|
-
console.log(
|
|
9925
|
+
console.log(colors.secondary(" 3. Start working: taskin start <task-id>"));
|
|
9497
9926
|
console.log();
|
|
9498
9927
|
info("For more information, run: taskin --help");
|
|
9499
9928
|
console.log();
|
|
@@ -9517,29 +9946,29 @@ async function setupProviderConfig(provider, cwd) {
|
|
|
9517
9946
|
}
|
|
9518
9947
|
})
|
|
9519
9948
|
);
|
|
9520
|
-
const answers = await
|
|
9949
|
+
const answers = await inquirer2.prompt(questions);
|
|
9521
9950
|
console.log();
|
|
9522
9951
|
success(`\u2713 ${provider.name} configuration saved`);
|
|
9523
9952
|
return answers;
|
|
9524
9953
|
}
|
|
9525
9954
|
async function setupFileSystemProvider(cwd) {
|
|
9526
|
-
const tasksDir =
|
|
9527
|
-
if (!
|
|
9955
|
+
const tasksDir = join2(cwd, "TASKS");
|
|
9956
|
+
if (!existsSync5(tasksDir)) {
|
|
9528
9957
|
info(`Creating TASKS directory...`);
|
|
9529
9958
|
mkdirSync(tasksDir, { recursive: true });
|
|
9530
|
-
success(`\u2713 Created ${
|
|
9959
|
+
success(`\u2713 Created ${colors.highlight("TASKS/")} directory`);
|
|
9531
9960
|
} else {
|
|
9532
|
-
info(`${
|
|
9961
|
+
info(`${colors.highlight("TASKS/")} directory already exists`);
|
|
9533
9962
|
success("\u2713 Directory is ready to use");
|
|
9534
9963
|
}
|
|
9535
9964
|
const existingTask001 = readdirSync(tasksDir).find(
|
|
9536
9965
|
(file) => file.startsWith("task-001-") && file.endsWith(".md")
|
|
9537
9966
|
);
|
|
9538
9967
|
if (existingTask001) {
|
|
9539
|
-
info(`Sample task already exists: ${
|
|
9968
|
+
info(`Sample task already exists: ${colors.highlight(existingTask001)}`);
|
|
9540
9969
|
info("Skipping sample task creation (users already know the pattern)");
|
|
9541
9970
|
} else {
|
|
9542
|
-
const sampleTaskFile =
|
|
9971
|
+
const sampleTaskFile = join2(tasksDir, "task-001-setup-project.md");
|
|
9543
9972
|
info("Creating sample task...");
|
|
9544
9973
|
const sampleTask = `# Task 001 \u2014 Setup Project
|
|
9545
9974
|
|
|
@@ -9561,9 +9990,9 @@ This is a sample task created during Taskin initialization.
|
|
|
9561
9990
|
|
|
9562
9991
|
You can edit or delete this file. Use \`taskin list\` to see all tasks.
|
|
9563
9992
|
`;
|
|
9564
|
-
|
|
9993
|
+
writeFileSync2(sampleTaskFile, sampleTask, "utf-8");
|
|
9565
9994
|
success(
|
|
9566
|
-
`\u2713 Created sample task ${
|
|
9995
|
+
`\u2713 Created sample task ${colors.highlight("task-001-setup-project.md")}`
|
|
9567
9996
|
);
|
|
9568
9997
|
}
|
|
9569
9998
|
return {
|
|
@@ -9573,8 +10002,8 @@ You can edit or delete this file. Use \`taskin list\` to see all tasks.
|
|
|
9573
10002
|
|
|
9574
10003
|
// src/commands/lint.ts
|
|
9575
10004
|
init_esm_shims();
|
|
9576
|
-
import
|
|
9577
|
-
import { join as
|
|
10005
|
+
import chalk5 from "chalk";
|
|
10006
|
+
import { join as join3 } from "path";
|
|
9578
10007
|
var lintCommand = defineCommand({
|
|
9579
10008
|
name: "lint",
|
|
9580
10009
|
description: "\u{1F50D} Validate task markdown files",
|
|
@@ -9594,7 +10023,7 @@ var lintCommand = defineCommand({
|
|
|
9594
10023
|
}
|
|
9595
10024
|
});
|
|
9596
10025
|
async function executeLint(options) {
|
|
9597
|
-
const tasksDir = options.path ||
|
|
10026
|
+
const tasksDir = options.path || join3(process.cwd(), "TASKS");
|
|
9598
10027
|
if (options.fix) {
|
|
9599
10028
|
console.log(`\u{1F527} Fixing task files in: ${tasksDir}
|
|
9600
10029
|
`);
|
|
@@ -9603,26 +10032,26 @@ async function executeLint(options) {
|
|
|
9603
10032
|
`);
|
|
9604
10033
|
}
|
|
9605
10034
|
const userRegistry = new UserRegistry({
|
|
9606
|
-
taskinDir:
|
|
10035
|
+
taskinDir: join3(process.cwd(), ".taskin")
|
|
9607
10036
|
});
|
|
9608
10037
|
await userRegistry.load();
|
|
9609
10038
|
const provider = new FileSystemTaskProvider(tasksDir, userRegistry);
|
|
9610
10039
|
const result = await provider.lint(options.fix);
|
|
9611
10040
|
if (result.valid) {
|
|
9612
|
-
console.log(
|
|
10041
|
+
console.log(chalk5.green(`\u2705 All task files are valid!
|
|
9613
10042
|
`));
|
|
9614
10043
|
} else {
|
|
9615
|
-
console.log(
|
|
10044
|
+
console.log(chalk5.red(`
|
|
9616
10045
|
\u274C Found ${result.issues.length} issue(s):
|
|
9617
10046
|
`));
|
|
9618
10047
|
for (const issue of result.issues) {
|
|
9619
|
-
console.log(
|
|
10048
|
+
console.log(chalk5.yellow(` ${issue.file}: ${issue.message}`));
|
|
9620
10049
|
}
|
|
9621
10050
|
console.log();
|
|
9622
10051
|
}
|
|
9623
10052
|
if (!result.valid && !options.fix) {
|
|
9624
10053
|
console.log(
|
|
9625
|
-
|
|
10054
|
+
chalk5.blue(`\u{1F4A1} Run with --fix to automatically fix format issues
|
|
9626
10055
|
`)
|
|
9627
10056
|
);
|
|
9628
10057
|
process.exit(1);
|
|
@@ -9648,6 +10077,14 @@ var listCommand = defineCommand({
|
|
|
9648
10077
|
{
|
|
9649
10078
|
flags: "-u, --user <user>",
|
|
9650
10079
|
description: "Filter by user"
|
|
10080
|
+
},
|
|
10081
|
+
{
|
|
10082
|
+
flags: "--open",
|
|
10083
|
+
description: "Show only open tasks (pending, in-progress, blocked)"
|
|
10084
|
+
},
|
|
10085
|
+
{
|
|
10086
|
+
flags: "--closed",
|
|
10087
|
+
description: "Show only closed tasks (done, canceled)"
|
|
9651
10088
|
}
|
|
9652
10089
|
],
|
|
9653
10090
|
handler: async (filter, options) => {
|
|
@@ -9665,12 +10102,22 @@ async function listTasks(filter, options) {
|
|
|
9665
10102
|
const taskProvider = new FileSystemTaskProvider(tasksDir, userRegistry);
|
|
9666
10103
|
const tasks = await taskProvider.getAllTasks();
|
|
9667
10104
|
if (tasks.length === 0) {
|
|
9668
|
-
console.log(
|
|
10105
|
+
console.log(colors.warning("No tasks found in TASKS/ directory"));
|
|
9669
10106
|
return;
|
|
9670
10107
|
}
|
|
10108
|
+
const openStatuses = ["pending", "in-progress", "blocked"];
|
|
10109
|
+
const closedStatuses = ["done", "canceled"];
|
|
9671
10110
|
let filteredTasks = tasks;
|
|
9672
10111
|
if (options.status) {
|
|
9673
10112
|
filteredTasks = filteredTasks.filter((t) => t.status === options.status);
|
|
10113
|
+
} else if (options.open) {
|
|
10114
|
+
filteredTasks = filteredTasks.filter(
|
|
10115
|
+
(t) => t.status && openStatuses.includes(t.status)
|
|
10116
|
+
);
|
|
10117
|
+
} else if (options.closed) {
|
|
10118
|
+
filteredTasks = filteredTasks.filter(
|
|
10119
|
+
(t) => t.status && closedStatuses.includes(t.status)
|
|
10120
|
+
);
|
|
9674
10121
|
}
|
|
9675
10122
|
if (options.type) {
|
|
9676
10123
|
filteredTasks = filteredTasks.filter((t) => t.type === options.type);
|
|
@@ -9687,24 +10134,24 @@ async function listTasks(filter, options) {
|
|
|
9687
10134
|
);
|
|
9688
10135
|
}
|
|
9689
10136
|
if (filteredTasks.length === 0) {
|
|
9690
|
-
console.log(
|
|
10137
|
+
console.log(colors.warning("No tasks match the filters"));
|
|
9691
10138
|
return;
|
|
9692
10139
|
}
|
|
9693
10140
|
console.log(
|
|
9694
|
-
|
|
10141
|
+
colors.highlight(
|
|
9695
10142
|
`${"ID".padEnd(15)} ${"Status".padEnd(15)} ${"Type".padEnd(12)} ${"User".padEnd(15)} ${"Title"}`
|
|
9696
10143
|
)
|
|
9697
10144
|
);
|
|
9698
|
-
console.log(
|
|
10145
|
+
console.log(colors.secondary("\u2500".repeat(100)));
|
|
9699
10146
|
filteredTasks.forEach((task) => {
|
|
9700
10147
|
const statusColor = getStatusColor(task.status);
|
|
9701
10148
|
const typeColor = getTypeColor(task.type);
|
|
9702
10149
|
console.log(
|
|
9703
|
-
`${
|
|
10150
|
+
`${colors.info(task.id.padEnd(15))} ${statusColor(task.status.padEnd(15))} ${typeColor(task.type.padEnd(12))} ${colors.secondary((task.assignee?.name || "unassigned").padEnd(15))} ${colors.normal(task.title)}`
|
|
9704
10151
|
);
|
|
9705
10152
|
});
|
|
9706
10153
|
console.log();
|
|
9707
|
-
console.log(
|
|
10154
|
+
console.log(colors.secondary("\u2500".repeat(100)));
|
|
9708
10155
|
const statusCounts = {
|
|
9709
10156
|
pending: filteredTasks.filter((t) => t.status === "pending").length,
|
|
9710
10157
|
"in-progress": filteredTasks.filter((t) => t.status === "in-progress").length,
|
|
@@ -9712,7 +10159,7 @@ async function listTasks(filter, options) {
|
|
|
9712
10159
|
blocked: filteredTasks.filter((t) => t.status === "blocked").length
|
|
9713
10160
|
};
|
|
9714
10161
|
console.log(
|
|
9715
|
-
|
|
10162
|
+
colors.info(
|
|
9716
10163
|
`\u{1F4CA} Total: ${filteredTasks.length} tasks | \u23F3 Pending: ${statusCounts.pending} | \u{1F680} In Progress: ${statusCounts["in-progress"]} | \u2705 Done: ${statusCounts.done} | \u{1F6AB} Blocked: ${statusCounts.blocked}`
|
|
9717
10164
|
)
|
|
9718
10165
|
);
|
|
@@ -9721,52 +10168,52 @@ async function listTasks(filter, options) {
|
|
|
9721
10168
|
function getStatusColor(status) {
|
|
9722
10169
|
switch (status) {
|
|
9723
10170
|
case "pending":
|
|
9724
|
-
return
|
|
10171
|
+
return colors.secondary;
|
|
9725
10172
|
case "in-progress":
|
|
9726
|
-
return
|
|
10173
|
+
return colors.info;
|
|
9727
10174
|
case "done":
|
|
9728
|
-
return
|
|
10175
|
+
return colors.success;
|
|
9729
10176
|
case "blocked":
|
|
9730
|
-
return
|
|
10177
|
+
return colors.error;
|
|
9731
10178
|
default:
|
|
9732
|
-
return
|
|
10179
|
+
return colors.normal;
|
|
9733
10180
|
}
|
|
9734
10181
|
}
|
|
9735
10182
|
function getTypeColor(type) {
|
|
9736
10183
|
switch (type) {
|
|
9737
10184
|
case "feat":
|
|
9738
|
-
return
|
|
10185
|
+
return colors.success;
|
|
9739
10186
|
case "fix":
|
|
9740
|
-
return
|
|
10187
|
+
return colors.error;
|
|
9741
10188
|
case "refactor":
|
|
9742
|
-
return
|
|
10189
|
+
return colors.warning;
|
|
9743
10190
|
case "docs":
|
|
9744
|
-
return
|
|
10191
|
+
return colors.info;
|
|
9745
10192
|
case "test":
|
|
9746
|
-
return
|
|
10193
|
+
return colors.secondary;
|
|
9747
10194
|
case "chore":
|
|
9748
|
-
return
|
|
10195
|
+
return colors.normal;
|
|
9749
10196
|
default:
|
|
9750
|
-
return
|
|
10197
|
+
return colors.normal;
|
|
9751
10198
|
}
|
|
9752
10199
|
}
|
|
9753
10200
|
|
|
9754
10201
|
// src/commands/mcp-server.ts
|
|
9755
10202
|
init_esm_shims();
|
|
9756
10203
|
|
|
9757
|
-
// ../../node_modules/.pnpm/@opentask+taskin-task-server-mcp@0.1.
|
|
10204
|
+
// ../../node_modules/.pnpm/@opentask+taskin-task-server-mcp@0.1.5_zod@3.25.76/node_modules/@opentask/taskin-task-server-mcp/dist/index.js
|
|
9758
10205
|
init_esm_shims();
|
|
9759
10206
|
|
|
9760
|
-
// ../../node_modules/.pnpm/@opentask+taskin-task-server-mcp@0.1.
|
|
10207
|
+
// ../../node_modules/.pnpm/@opentask+taskin-task-server-mcp@0.1.5_zod@3.25.76/node_modules/@opentask/taskin-task-server-mcp/dist/task-server-mcp.js
|
|
9761
10208
|
init_esm_shims();
|
|
9762
10209
|
|
|
9763
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
10210
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.4_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
9764
10211
|
init_esm_shims();
|
|
9765
10212
|
|
|
9766
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
10213
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.4_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
9767
10214
|
init_esm_shims();
|
|
9768
10215
|
|
|
9769
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
10216
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.4_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
9770
10217
|
init_esm_shims();
|
|
9771
10218
|
import * as z3rt from "zod/v3";
|
|
9772
10219
|
import * as z4mini from "zod/v4-mini";
|
|
@@ -9832,7 +10279,7 @@ function getLiteralValue(schema) {
|
|
|
9832
10279
|
return void 0;
|
|
9833
10280
|
}
|
|
9834
10281
|
|
|
9835
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
10282
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.4_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
9836
10283
|
init_esm_shims();
|
|
9837
10284
|
import * as z2 from "zod/v4";
|
|
9838
10285
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
@@ -11340,138 +11787,138 @@ var UrlElicitationRequiredError = class extends McpError {
|
|
|
11340
11787
|
}
|
|
11341
11788
|
};
|
|
11342
11789
|
|
|
11343
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
11790
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.4_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
|
|
11344
11791
|
init_esm_shims();
|
|
11345
11792
|
function isTerminal(status) {
|
|
11346
11793
|
return status === "completed" || status === "failed" || status === "cancelled";
|
|
11347
11794
|
}
|
|
11348
11795
|
|
|
11349
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
11796
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.4_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
11350
11797
|
init_esm_shims();
|
|
11351
11798
|
import * as z4mini2 from "zod/v4-mini";
|
|
11352
11799
|
|
|
11353
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11800
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/index.js
|
|
11354
11801
|
init_esm_shims();
|
|
11355
11802
|
|
|
11356
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11803
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
11357
11804
|
init_esm_shims();
|
|
11358
11805
|
|
|
11359
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11806
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js
|
|
11360
11807
|
init_esm_shims();
|
|
11361
11808
|
|
|
11362
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11809
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
11363
11810
|
init_esm_shims();
|
|
11364
11811
|
|
|
11365
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11812
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
|
|
11366
11813
|
init_esm_shims();
|
|
11367
11814
|
|
|
11368
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11815
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js
|
|
11369
11816
|
init_esm_shims();
|
|
11370
11817
|
|
|
11371
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11818
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
11372
11819
|
init_esm_shims();
|
|
11373
11820
|
import { ZodFirstPartyTypeKind as ZodFirstPartyTypeKind3 } from "zod/v3";
|
|
11374
11821
|
|
|
11375
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11822
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
|
|
11376
11823
|
init_esm_shims();
|
|
11377
11824
|
|
|
11378
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11825
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
|
|
11379
11826
|
init_esm_shims();
|
|
11380
11827
|
import { ZodFirstPartyTypeKind } from "zod/v3";
|
|
11381
11828
|
|
|
11382
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11829
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
|
|
11383
11830
|
init_esm_shims();
|
|
11384
11831
|
|
|
11385
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11832
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
|
|
11386
11833
|
init_esm_shims();
|
|
11387
11834
|
|
|
11388
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11835
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
|
|
11389
11836
|
init_esm_shims();
|
|
11390
11837
|
|
|
11391
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11838
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
|
|
11392
11839
|
init_esm_shims();
|
|
11393
11840
|
|
|
11394
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11841
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
|
|
11395
11842
|
init_esm_shims();
|
|
11396
11843
|
|
|
11397
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11844
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
|
|
11398
11845
|
init_esm_shims();
|
|
11399
11846
|
|
|
11400
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11847
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
|
|
11401
11848
|
init_esm_shims();
|
|
11402
11849
|
|
|
11403
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11850
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
|
|
11404
11851
|
init_esm_shims();
|
|
11405
11852
|
|
|
11406
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11853
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
|
|
11407
11854
|
init_esm_shims();
|
|
11408
11855
|
|
|
11409
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11856
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
|
|
11410
11857
|
init_esm_shims();
|
|
11411
11858
|
|
|
11412
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11859
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
|
|
11413
11860
|
init_esm_shims();
|
|
11414
11861
|
|
|
11415
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11862
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
|
|
11416
11863
|
init_esm_shims();
|
|
11417
11864
|
import { ZodFirstPartyTypeKind as ZodFirstPartyTypeKind2 } from "zod/v3";
|
|
11418
11865
|
|
|
11419
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11866
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
11420
11867
|
init_esm_shims();
|
|
11421
11868
|
var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
11422
11869
|
|
|
11423
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11870
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
|
|
11424
11871
|
init_esm_shims();
|
|
11425
11872
|
|
|
11426
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11873
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
|
|
11427
11874
|
init_esm_shims();
|
|
11428
11875
|
|
|
11429
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11876
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
|
|
11430
11877
|
init_esm_shims();
|
|
11431
11878
|
|
|
11432
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11879
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
|
|
11433
11880
|
init_esm_shims();
|
|
11434
11881
|
|
|
11435
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11882
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
|
|
11436
11883
|
init_esm_shims();
|
|
11437
11884
|
|
|
11438
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11885
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
|
|
11439
11886
|
init_esm_shims();
|
|
11440
11887
|
|
|
11441
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11888
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
|
|
11442
11889
|
init_esm_shims();
|
|
11443
11890
|
|
|
11444
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11891
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
|
|
11445
11892
|
init_esm_shims();
|
|
11446
11893
|
|
|
11447
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11894
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
|
|
11448
11895
|
init_esm_shims();
|
|
11449
11896
|
|
|
11450
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11897
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
|
|
11451
11898
|
init_esm_shims();
|
|
11452
11899
|
|
|
11453
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11900
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
|
|
11454
11901
|
init_esm_shims();
|
|
11455
11902
|
|
|
11456
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11903
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
|
|
11457
11904
|
init_esm_shims();
|
|
11458
11905
|
|
|
11459
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11906
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
|
|
11460
11907
|
init_esm_shims();
|
|
11461
11908
|
|
|
11462
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11909
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
|
|
11463
11910
|
init_esm_shims();
|
|
11464
11911
|
|
|
11465
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11912
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
|
|
11466
11913
|
init_esm_shims();
|
|
11467
11914
|
|
|
11468
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11915
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseTypes.js
|
|
11469
11916
|
init_esm_shims();
|
|
11470
11917
|
|
|
11471
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.
|
|
11918
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
|
|
11472
11919
|
init_esm_shims();
|
|
11473
11920
|
|
|
11474
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
11921
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.4_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
11475
11922
|
function getMethodLiteral(schema) {
|
|
11476
11923
|
const shape = getObjectShape(schema);
|
|
11477
11924
|
const methodSchema = shape?.method;
|
|
@@ -11492,7 +11939,7 @@ function parseWithCompat(schema, data) {
|
|
|
11492
11939
|
return result.data;
|
|
11493
11940
|
}
|
|
11494
11941
|
|
|
11495
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
11942
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.4_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
11496
11943
|
var DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
|
|
11497
11944
|
var Protocol = class {
|
|
11498
11945
|
constructor(_options) {
|
|
@@ -12428,7 +12875,7 @@ function mergeCapabilities(base, additional) {
|
|
|
12428
12875
|
return result;
|
|
12429
12876
|
}
|
|
12430
12877
|
|
|
12431
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
12878
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.4_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
12432
12879
|
init_esm_shims();
|
|
12433
12880
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
12434
12881
|
var import_ajv_formats = __toESM(require_dist(), 1);
|
|
@@ -12497,7 +12944,7 @@ var AjvJsonSchemaValidator = class {
|
|
|
12497
12944
|
}
|
|
12498
12945
|
};
|
|
12499
12946
|
|
|
12500
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
12947
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.4_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
|
|
12501
12948
|
init_esm_shims();
|
|
12502
12949
|
var ExperimentalServerTasks = class {
|
|
12503
12950
|
constructor(_server) {
|
|
@@ -12570,7 +13017,7 @@ var ExperimentalServerTasks = class {
|
|
|
12570
13017
|
}
|
|
12571
13018
|
};
|
|
12572
13019
|
|
|
12573
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
13020
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.4_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
|
|
12574
13021
|
init_esm_shims();
|
|
12575
13022
|
function assertToolsCallTaskCapability(requests, method, entityName) {
|
|
12576
13023
|
if (!requests) {
|
|
@@ -12606,7 +13053,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
|
12606
13053
|
}
|
|
12607
13054
|
}
|
|
12608
13055
|
|
|
12609
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
13056
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.4_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
12610
13057
|
var Server = class extends Protocol {
|
|
12611
13058
|
/**
|
|
12612
13059
|
* Initializes this server with the given name and version information.
|
|
@@ -12986,11 +13433,11 @@ var Server = class extends Protocol {
|
|
|
12986
13433
|
}
|
|
12987
13434
|
};
|
|
12988
13435
|
|
|
12989
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
13436
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.4_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
12990
13437
|
init_esm_shims();
|
|
12991
13438
|
import process2 from "process";
|
|
12992
13439
|
|
|
12993
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
13440
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.4_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
12994
13441
|
init_esm_shims();
|
|
12995
13442
|
var ReadBuffer = class {
|
|
12996
13443
|
append(chunk) {
|
|
@@ -13019,7 +13466,7 @@ function serializeMessage(message) {
|
|
|
13019
13466
|
return JSON.stringify(message) + "\n";
|
|
13020
13467
|
}
|
|
13021
13468
|
|
|
13022
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
13469
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.4_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
13023
13470
|
var StdioServerTransport = class {
|
|
13024
13471
|
constructor(_stdin = process2.stdin, _stdout = process2.stdout) {
|
|
13025
13472
|
this._stdin = _stdin;
|
|
@@ -13080,7 +13527,7 @@ var StdioServerTransport = class {
|
|
|
13080
13527
|
}
|
|
13081
13528
|
};
|
|
13082
13529
|
|
|
13083
|
-
// ../../node_modules/.pnpm/@opentask+taskin-task-server-mcp@0.1.
|
|
13530
|
+
// ../../node_modules/.pnpm/@opentask+taskin-task-server-mcp@0.1.5_zod@3.25.76/node_modules/@opentask/taskin-task-server-mcp/dist/task-server-mcp.js
|
|
13084
13531
|
var TaskMCPServer = class {
|
|
13085
13532
|
server;
|
|
13086
13533
|
taskManager;
|
|
@@ -13475,11 +13922,11 @@ Let me start by marking the task as done using the finish_task tool.`
|
|
|
13475
13922
|
}
|
|
13476
13923
|
};
|
|
13477
13924
|
|
|
13478
|
-
// ../../node_modules/.pnpm/@opentask+taskin-task-server-mcp@0.1.
|
|
13925
|
+
// ../../node_modules/.pnpm/@opentask+taskin-task-server-mcp@0.1.5_zod@3.25.76/node_modules/@opentask/taskin-task-server-mcp/dist/task-server-mcp.types.js
|
|
13479
13926
|
init_esm_shims();
|
|
13480
13927
|
|
|
13481
13928
|
// src/commands/mcp-server.ts
|
|
13482
|
-
import
|
|
13929
|
+
import chalk6 from "chalk";
|
|
13483
13930
|
import path11 from "path";
|
|
13484
13931
|
var mcpServerCommand = defineCommand({
|
|
13485
13932
|
name: "mcp-server",
|
|
@@ -13525,27 +13972,27 @@ async function startMCPServer(options) {
|
|
|
13525
13972
|
await mcpServer.connect({ transport });
|
|
13526
13973
|
success("\u2713 MCP server started successfully");
|
|
13527
13974
|
info("");
|
|
13528
|
-
info(
|
|
13529
|
-
info(` \u2022 Transport: ${
|
|
13530
|
-
info(` \u2022 Debug: ${
|
|
13975
|
+
info(chalk6.bold("Server Information:"));
|
|
13976
|
+
info(` \u2022 Transport: ${chalk6.cyan(transport)}`);
|
|
13977
|
+
info(` \u2022 Debug: ${chalk6.cyan(debug ? "enabled" : "disabled")}`);
|
|
13531
13978
|
info("");
|
|
13532
|
-
info(
|
|
13533
|
-
info(` \u2022 ${
|
|
13534
|
-
info(` \u2022 ${
|
|
13979
|
+
info(chalk6.bold("Available Tools:"));
|
|
13980
|
+
info(` \u2022 ${chalk6.green("start_task")} - Start working on a task`);
|
|
13981
|
+
info(` \u2022 ${chalk6.green("finish_task")} - Mark a task as finished`);
|
|
13535
13982
|
info("");
|
|
13536
|
-
info(
|
|
13983
|
+
info(chalk6.bold("Available Prompts:"));
|
|
13537
13984
|
info(
|
|
13538
|
-
` \u2022 ${
|
|
13985
|
+
` \u2022 ${chalk6.green("start-task-workflow")} - Guide for starting tasks`
|
|
13539
13986
|
);
|
|
13540
13987
|
info(
|
|
13541
|
-
` \u2022 ${
|
|
13988
|
+
` \u2022 ${chalk6.green("finish-task-workflow")} - Guide for finishing tasks`
|
|
13542
13989
|
);
|
|
13543
|
-
info(` \u2022 ${
|
|
13990
|
+
info(` \u2022 ${chalk6.green("task-summary")} - Get task summary and insights`);
|
|
13544
13991
|
info("");
|
|
13545
|
-
info(
|
|
13546
|
-
info(` \u2022 ${
|
|
13992
|
+
info(chalk6.bold("Available Resources:"));
|
|
13993
|
+
info(` \u2022 ${chalk6.green("taskin://tasks")} - Access all tasks`);
|
|
13547
13994
|
info("");
|
|
13548
|
-
info(`Press ${
|
|
13995
|
+
info(`Press ${chalk6.bold("Ctrl+C")} to stop the server`);
|
|
13549
13996
|
info("");
|
|
13550
13997
|
const cleanup = async () => {
|
|
13551
13998
|
info("\nShutting down MCP server...");
|
|
@@ -13570,8 +14017,8 @@ async function startMCPServer(options) {
|
|
|
13570
14017
|
|
|
13571
14018
|
// src/commands/new.ts
|
|
13572
14019
|
init_esm_shims();
|
|
13573
|
-
import { existsSync as
|
|
13574
|
-
import
|
|
14020
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
14021
|
+
import inquirer3 from "inquirer";
|
|
13575
14022
|
import path12 from "path";
|
|
13576
14023
|
var createCommand = defineCommand({
|
|
13577
14024
|
name: "new",
|
|
@@ -13606,7 +14053,7 @@ async function createTask(options) {
|
|
|
13606
14053
|
if (!options.type && !options.title) {
|
|
13607
14054
|
info("Interactive mode - Answer the questions below:");
|
|
13608
14055
|
console.log();
|
|
13609
|
-
const answers = await
|
|
14056
|
+
const answers = await inquirer3.prompt([
|
|
13610
14057
|
{
|
|
13611
14058
|
type: "list",
|
|
13612
14059
|
name: "type",
|
|
@@ -13665,7 +14112,7 @@ async function createTask(options) {
|
|
|
13665
14112
|
return;
|
|
13666
14113
|
}
|
|
13667
14114
|
const tasksDir = path12.join(process.cwd(), "TASKS");
|
|
13668
|
-
if (!
|
|
14115
|
+
if (!existsSync6(tasksDir)) {
|
|
13669
14116
|
mkdirSync2(tasksDir, { recursive: true });
|
|
13670
14117
|
}
|
|
13671
14118
|
const monorepoRoot = path12.dirname(tasksDir);
|
|
@@ -13680,10 +14127,10 @@ async function createTask(options) {
|
|
|
13680
14127
|
}).filter((num) => !isNaN(num));
|
|
13681
14128
|
const nextNumber = taskNumbers.length > 0 ? Math.max(...taskNumbers) + 1 : 1;
|
|
13682
14129
|
const taskId = String(nextNumber).padStart(3, "0");
|
|
13683
|
-
const titleSlug = options.title
|
|
14130
|
+
const titleSlug = slugify(options.title);
|
|
13684
14131
|
const fileName = `task-${taskId}-${titleSlug}.md`;
|
|
13685
14132
|
const filePath = path12.join(tasksDir, fileName);
|
|
13686
|
-
if (
|
|
14133
|
+
if (existsSync6(filePath)) {
|
|
13687
14134
|
error(`Task file already exists: ${fileName}`);
|
|
13688
14135
|
return;
|
|
13689
14136
|
}
|
|
@@ -13694,17 +14141,17 @@ async function createTask(options) {
|
|
|
13694
14141
|
description: options.description || "",
|
|
13695
14142
|
user: options.user || "A definir"
|
|
13696
14143
|
});
|
|
13697
|
-
|
|
14144
|
+
writeFileSync3(filePath, taskContent, "utf-8");
|
|
13698
14145
|
console.log();
|
|
13699
14146
|
success(`Task ${taskId} created successfully!`);
|
|
13700
|
-
console.log(
|
|
13701
|
-
console.log(
|
|
14147
|
+
console.log(colors.secondary(`\u{1F4C4} File: ${fileName}`));
|
|
14148
|
+
console.log(colors.secondary(`\u{1F4C1} Path: ${filePath}`));
|
|
13702
14149
|
console.log();
|
|
13703
|
-
console.log(
|
|
13704
|
-
console.log(
|
|
14150
|
+
console.log(colors.info("Next steps:"));
|
|
14151
|
+
console.log(colors.normal(` 1. Edit the task file to add more details`));
|
|
13705
14152
|
console.log(
|
|
13706
|
-
|
|
13707
|
-
` 2. Run ${
|
|
14153
|
+
colors.normal(
|
|
14154
|
+
` 2. Run ${colors.highlight("taskin start " + taskId)} to begin working on it`
|
|
13708
14155
|
)
|
|
13709
14156
|
);
|
|
13710
14157
|
console.log();
|
|
@@ -13782,12 +14229,12 @@ async function pauseTask(taskId, options) {
|
|
|
13782
14229
|
const commitMessage = options.message || `WIP: task-${normalizedId} - ${task.title}`;
|
|
13783
14230
|
if (options.skipCommit) {
|
|
13784
14231
|
info("Would create commit with message:");
|
|
13785
|
-
console.log(
|
|
14232
|
+
console.log(colors.highlight(` "${commitMessage}"`));
|
|
13786
14233
|
console.log();
|
|
13787
14234
|
info("Use without --skip-commit to actually commit");
|
|
13788
14235
|
} else {
|
|
13789
14236
|
info("Creating commit...");
|
|
13790
|
-
console.log(
|
|
14237
|
+
console.log(colors.secondary(` Message: "${commitMessage}"`));
|
|
13791
14238
|
console.log();
|
|
13792
14239
|
try {
|
|
13793
14240
|
execSync2("git add -A", { cwd: process.cwd(), stdio: "ignore" });
|
|
@@ -13804,9 +14251,9 @@ async function pauseTask(taskId, options) {
|
|
|
13804
14251
|
info("Status updated to pending");
|
|
13805
14252
|
console.log();
|
|
13806
14253
|
info("Next steps:");
|
|
13807
|
-
console.log(
|
|
14254
|
+
console.log(colors.secondary(" 1. Switch to another task"));
|
|
13808
14255
|
console.log(
|
|
13809
|
-
|
|
14256
|
+
colors.secondary(" 2. Or continue later with the same branch")
|
|
13810
14257
|
);
|
|
13811
14258
|
if (options.sound !== false) {
|
|
13812
14259
|
playSound("stop");
|
|
@@ -13871,14 +14318,19 @@ async function startTask(taskId, _options) {
|
|
|
13871
14318
|
success(`Task ${updatedTask.id} started successfully!`);
|
|
13872
14319
|
success(`Status changed to: ${updatedTask.status}`);
|
|
13873
14320
|
console.log();
|
|
13874
|
-
info("Next steps:");
|
|
14321
|
+
info("Next steps (suggestions):");
|
|
13875
14322
|
console.log(
|
|
13876
|
-
|
|
13877
|
-
|
|
14323
|
+
colors.secondary(
|
|
14324
|
+
` 1. Commit the status change: git add TASKS/task-${normalizedId}-*.md && git commit -m "docs(TASKS): task-${normalizedId} - atualiza status para in-progress [skip ci]"`
|
|
13878
14325
|
)
|
|
13879
14326
|
);
|
|
13880
|
-
console.log(
|
|
13881
|
-
|
|
14327
|
+
console.log(
|
|
14328
|
+
colors.secondary(
|
|
14329
|
+
" 2. Create a branch: git checkout -b feat/task-" + normalizedId
|
|
14330
|
+
)
|
|
14331
|
+
);
|
|
14332
|
+
console.log(colors.secondary(" 3. Start coding! \u{1F4BB}"));
|
|
14333
|
+
console.log(colors.secondary(' 4. Use "taskin pause" to save progress'));
|
|
13882
14334
|
console.log();
|
|
13883
14335
|
if (_options.sound !== false) {
|
|
13884
14336
|
playSound("start");
|
|
@@ -13887,7 +14339,7 @@ async function startTask(taskId, _options) {
|
|
|
13887
14339
|
|
|
13888
14340
|
// src/commands/stats.ts
|
|
13889
14341
|
init_esm_shims();
|
|
13890
|
-
import
|
|
14342
|
+
import chalk7 from "chalk";
|
|
13891
14343
|
import path15 from "path";
|
|
13892
14344
|
var statsCommand = defineCommand({
|
|
13893
14345
|
name: "stats",
|
|
@@ -13950,27 +14402,27 @@ async function showStats(options) {
|
|
|
13950
14402
|
displayUserStats(stats, options.detailed);
|
|
13951
14403
|
}
|
|
13952
14404
|
} catch (error2) {
|
|
13953
|
-
console.error(
|
|
14405
|
+
console.error(chalk7.red("\n\u274C Error fetching stats:"), error2);
|
|
13954
14406
|
process.exit(1);
|
|
13955
14407
|
}
|
|
13956
14408
|
}
|
|
13957
14409
|
function displayUserStats(stats, detailed = false) {
|
|
13958
14410
|
console.log(
|
|
13959
|
-
`${
|
|
14411
|
+
`${chalk7.dim("Period:")} ${stats.period} (${formatDate(stats.periodStart)} to ${formatDate(stats.periodEnd)})
|
|
13960
14412
|
`
|
|
13961
14413
|
);
|
|
13962
|
-
console.log(
|
|
14414
|
+
console.log(chalk7.bold("\u{1F4DD} Code Metrics"));
|
|
13963
14415
|
console.log(
|
|
13964
|
-
` ${
|
|
14416
|
+
` ${chalk7.green("+")}${stats.codeMetrics.linesAdded} lines added`
|
|
13965
14417
|
);
|
|
13966
14418
|
console.log(
|
|
13967
|
-
` ${
|
|
14419
|
+
` ${chalk7.red("-")}${stats.codeMetrics.linesRemoved} lines removed`
|
|
13968
14420
|
);
|
|
13969
|
-
console.log(` ${
|
|
14421
|
+
console.log(` ${chalk7.cyan("=")}${stats.codeMetrics.netChange} net change`);
|
|
13970
14422
|
console.log(` \u{1F4C1} ${stats.codeMetrics.filesChanged} files changed`);
|
|
13971
14423
|
console.log(` \u{1F4BE} ${stats.codeMetrics.commits} commits
|
|
13972
14424
|
`);
|
|
13973
|
-
console.log(
|
|
14425
|
+
console.log(chalk7.bold("\u{1F3AF} Contribution"));
|
|
13974
14426
|
console.log(
|
|
13975
14427
|
` \u2705 ${stats.contributionMetrics.tasksCompleted} tasks completed`
|
|
13976
14428
|
);
|
|
@@ -13978,7 +14430,7 @@ function displayUserStats(stats, detailed = false) {
|
|
|
13978
14430
|
` \u{1F4CA} ${stats.contributionMetrics.activityFrequency.toFixed(2)} commits/day
|
|
13979
14431
|
`
|
|
13980
14432
|
);
|
|
13981
|
-
console.log(
|
|
14433
|
+
console.log(chalk7.bold("\u26A1 Engagement"));
|
|
13982
14434
|
console.log(
|
|
13983
14435
|
` \u{1F525} ${(stats.engagementMetrics.completionRate * 100).toFixed(1)}% completion rate`
|
|
13984
14436
|
);
|
|
@@ -13987,7 +14439,7 @@ function displayUserStats(stats, detailed = false) {
|
|
|
13987
14439
|
`
|
|
13988
14440
|
);
|
|
13989
14441
|
if (detailed) {
|
|
13990
|
-
console.log(
|
|
14442
|
+
console.log(chalk7.bold("\u23F0 Temporal Patterns"));
|
|
13991
14443
|
console.log(" By Day of Week:");
|
|
13992
14444
|
const days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
13993
14445
|
Object.entries(stats.temporalMetrics.byDayOfWeek).forEach(
|
|
@@ -14020,25 +14472,25 @@ function displayUserStats(stats, detailed = false) {
|
|
|
14020
14472
|
}
|
|
14021
14473
|
function displayTeamStats(stats, detailed = false) {
|
|
14022
14474
|
console.log(
|
|
14023
|
-
`${
|
|
14475
|
+
`${chalk7.dim("Period:")} ${stats.period} (${formatDate(stats.periodStart)} to ${formatDate(stats.periodEnd)})
|
|
14024
14476
|
`
|
|
14025
14477
|
);
|
|
14026
|
-
console.log(
|
|
14478
|
+
console.log(chalk7.bold("\u{1F465} Team Overview"));
|
|
14027
14479
|
console.log(` \u{1F464} ${stats.totalContributors} contributors`);
|
|
14028
14480
|
console.log(` \u{1F4BE} ${stats.totalCommits} total commits`);
|
|
14029
14481
|
console.log(` \u2705 ${stats.totalTasksCompleted} tasks completed
|
|
14030
14482
|
`);
|
|
14031
|
-
console.log(
|
|
14483
|
+
console.log(chalk7.bold("\u{1F4DD} Code Metrics"));
|
|
14032
14484
|
console.log(
|
|
14033
|
-
` ${
|
|
14485
|
+
` ${chalk7.green("+")}${stats.codeMetrics.linesAdded} lines added`
|
|
14034
14486
|
);
|
|
14035
14487
|
console.log(
|
|
14036
|
-
` ${
|
|
14488
|
+
` ${chalk7.red("-")}${stats.codeMetrics.linesRemoved} lines removed`
|
|
14037
14489
|
);
|
|
14038
14490
|
console.log(` \u{1F4C1} ${stats.codeMetrics.filesChanged} files changed
|
|
14039
14491
|
`);
|
|
14040
14492
|
if (detailed && stats.contributors.length > 0) {
|
|
14041
|
-
console.log(
|
|
14493
|
+
console.log(chalk7.bold("\u{1F3C6} Top Contributors"));
|
|
14042
14494
|
stats.contributors.sort((a, b) => {
|
|
14043
14495
|
if (b.commits !== a.commits) {
|
|
14044
14496
|
return b.commits - a.commits;
|
|
@@ -14054,25 +14506,25 @@ function displayTeamStats(stats, detailed = false) {
|
|
|
14054
14506
|
});
|
|
14055
14507
|
}
|
|
14056
14508
|
}
|
|
14057
|
-
function displayTaskStats(stats,
|
|
14058
|
-
console.log(`${
|
|
14509
|
+
function displayTaskStats(stats, _detailed = false) {
|
|
14510
|
+
console.log(`${chalk7.dim("Task:")} ${stats.taskId} - ${stats.title}
|
|
14059
14511
|
`);
|
|
14060
|
-
console.log(
|
|
14512
|
+
console.log(chalk7.bold("\u{1F4CB} Task Info"));
|
|
14061
14513
|
console.log(` Status: ${getStatusEmoji(stats.status)} ${stats.status}`);
|
|
14062
14514
|
console.log(` Type: ${stats.type}`);
|
|
14063
14515
|
console.log(` Assignee: ${stats.assignee || "unassigned"}
|
|
14064
14516
|
`);
|
|
14065
|
-
console.log(
|
|
14517
|
+
console.log(chalk7.bold("\u{1F4DD} Code Metrics"));
|
|
14066
14518
|
console.log(
|
|
14067
|
-
` ${
|
|
14519
|
+
` ${chalk7.green("+")}${stats.codeMetrics.linesAdded} lines added`
|
|
14068
14520
|
);
|
|
14069
14521
|
console.log(
|
|
14070
|
-
` ${
|
|
14522
|
+
` ${chalk7.red("-")}${stats.codeMetrics.linesRemoved} lines removed`
|
|
14071
14523
|
);
|
|
14072
14524
|
console.log(` \u{1F4C1} ${stats.codeMetrics.filesChanged} files changed
|
|
14073
14525
|
`);
|
|
14074
14526
|
if (stats.contributors.length > 0) {
|
|
14075
|
-
console.log(
|
|
14527
|
+
console.log(chalk7.bold("\u{1F465} Contributors"));
|
|
14076
14528
|
stats.contributors.forEach((c) => {
|
|
14077
14529
|
console.log(` \u2022 ${c}`);
|
|
14078
14530
|
});
|
|
@@ -14084,7 +14536,7 @@ function formatDate(isoString) {
|
|
|
14084
14536
|
function createBar(value, max, length = 20) {
|
|
14085
14537
|
if (max === 0) return "\u2591".repeat(length);
|
|
14086
14538
|
const filled = Math.round(value / max * length);
|
|
14087
|
-
return
|
|
14539
|
+
return chalk7.cyan("\u2588".repeat(filled)) + chalk7.dim("\u2591".repeat(length - filled));
|
|
14088
14540
|
}
|
|
14089
14541
|
function getTrendEmoji(trend) {
|
|
14090
14542
|
switch (trend) {
|
|
@@ -14115,20 +14567,20 @@ function getStatusEmoji(status) {
|
|
|
14115
14567
|
init_esm_shims();
|
|
14116
14568
|
function showCustomHelp() {
|
|
14117
14569
|
printHeader("Taskin - Task Management System", icons.rocket);
|
|
14118
|
-
console.log(
|
|
14119
|
-
console.log(
|
|
14570
|
+
console.log(colors.info("\u{1F4CB} AVAILABLE COMMANDS"));
|
|
14571
|
+
console.log(colors.highlight("\u2550".repeat(60)));
|
|
14120
14572
|
console.log();
|
|
14121
14573
|
const commands = [
|
|
14122
14574
|
{
|
|
14123
|
-
name:
|
|
14124
|
-
alias:
|
|
14575
|
+
name: colors.highlight("taskin init"),
|
|
14576
|
+
alias: colors.secondary("Alias: setup"),
|
|
14125
14577
|
description: "Initialize Taskin in your project",
|
|
14126
14578
|
examples: ["taskin init", "taskin setup"],
|
|
14127
14579
|
icon: "\u{1F3AF}"
|
|
14128
14580
|
},
|
|
14129
14581
|
{
|
|
14130
|
-
name:
|
|
14131
|
-
alias:
|
|
14582
|
+
name: colors.highlight("taskin list") + colors.normal(" [filter]"),
|
|
14583
|
+
alias: colors.secondary("Alias: ls"),
|
|
14132
14584
|
description: "List all tasks in the project",
|
|
14133
14585
|
examples: [
|
|
14134
14586
|
"taskin list",
|
|
@@ -14139,8 +14591,8 @@ function showCustomHelp() {
|
|
|
14139
14591
|
icon: "\u{1F4CA}"
|
|
14140
14592
|
},
|
|
14141
14593
|
{
|
|
14142
|
-
name:
|
|
14143
|
-
alias:
|
|
14594
|
+
name: colors.highlight("taskin new"),
|
|
14595
|
+
alias: colors.secondary("Alias: create"),
|
|
14144
14596
|
description: "Create a new task",
|
|
14145
14597
|
examples: [
|
|
14146
14598
|
'taskin new -t feat -T "Add login" -d "Implement user authentication"',
|
|
@@ -14150,9 +14602,9 @@ function showCustomHelp() {
|
|
|
14150
14602
|
icon: "\u{1F4DD}"
|
|
14151
14603
|
},
|
|
14152
14604
|
{
|
|
14153
|
-
name:
|
|
14154
|
-
alias:
|
|
14155
|
-
description: "Start working on a task",
|
|
14605
|
+
name: colors.highlight("taskin start") + colors.normal(" <task-id>"),
|
|
14606
|
+
alias: colors.secondary("Alias: begin"),
|
|
14607
|
+
description: "Start working on a task (suggests commits)",
|
|
14156
14608
|
examples: [
|
|
14157
14609
|
"taskin start 001",
|
|
14158
14610
|
"taskin start task-001",
|
|
@@ -14161,22 +14613,33 @@ function showCustomHelp() {
|
|
|
14161
14613
|
icon: "\u{1F680}"
|
|
14162
14614
|
},
|
|
14163
14615
|
{
|
|
14164
|
-
name:
|
|
14165
|
-
alias:
|
|
14166
|
-
description: "Pause a task (
|
|
14616
|
+
name: colors.highlight("taskin pause") + colors.normal(" <task-id>"),
|
|
14617
|
+
alias: colors.secondary("Alias: stop"),
|
|
14618
|
+
description: "Pause a task (auto-commits work in progress)",
|
|
14167
14619
|
examples: ["taskin pause 001", 'taskin pause 001 -m "saving progress"'],
|
|
14168
14620
|
icon: "\u23F8\uFE0F"
|
|
14169
14621
|
},
|
|
14170
14622
|
{
|
|
14171
|
-
name:
|
|
14172
|
-
alias:
|
|
14173
|
-
description: "Finish a task",
|
|
14623
|
+
name: colors.highlight("taskin finish") + colors.normal(" <task-id>"),
|
|
14624
|
+
alias: colors.secondary("Alias: done"),
|
|
14625
|
+
description: "Finish a task (suggests commits)",
|
|
14174
14626
|
examples: ["taskin finish 001", "taskin done task-001"],
|
|
14175
14627
|
icon: "\u2705"
|
|
14176
14628
|
},
|
|
14177
14629
|
{
|
|
14178
|
-
name:
|
|
14179
|
-
alias:
|
|
14630
|
+
name: colors.highlight("taskin config") + colors.normal(" [options]"),
|
|
14631
|
+
alias: colors.secondary("Options: --level <manual|assisted|autopilot>"),
|
|
14632
|
+
description: "Configure automation level",
|
|
14633
|
+
examples: [
|
|
14634
|
+
"taskin config",
|
|
14635
|
+
"taskin config --level assisted",
|
|
14636
|
+
"taskin config --level autopilot"
|
|
14637
|
+
],
|
|
14638
|
+
icon: "\u2699\uFE0F"
|
|
14639
|
+
},
|
|
14640
|
+
{
|
|
14641
|
+
name: colors.highlight("taskin lint") + colors.normal(" [options]"),
|
|
14642
|
+
alias: colors.secondary("Options: -p, --path <directory>"),
|
|
14180
14643
|
description: "Validate task markdown files",
|
|
14181
14644
|
examples: [
|
|
14182
14645
|
"taskin lint",
|
|
@@ -14186,62 +14649,70 @@ function showCustomHelp() {
|
|
|
14186
14649
|
icon: "\u{1F50D}"
|
|
14187
14650
|
},
|
|
14188
14651
|
{
|
|
14189
|
-
name:
|
|
14190
|
-
alias:
|
|
14652
|
+
name: colors.highlight("taskin dashboard") + colors.normal(" [options]"),
|
|
14653
|
+
alias: colors.secondary(
|
|
14654
|
+
"Options: --host, --port, --filter-open, --filter-closed"
|
|
14655
|
+
),
|
|
14191
14656
|
description: "Start the web dashboard",
|
|
14192
14657
|
examples: [
|
|
14193
14658
|
"taskin dashboard",
|
|
14194
14659
|
"taskin dashboard --port 3000",
|
|
14195
|
-
"taskin dashboard --
|
|
14660
|
+
"taskin dashboard --filter-open",
|
|
14661
|
+
"taskin dashboard --filter-closed -o"
|
|
14196
14662
|
],
|
|
14197
14663
|
icon: "\u{1F4CA}"
|
|
14198
14664
|
},
|
|
14199
14665
|
{
|
|
14200
|
-
name:
|
|
14201
|
-
alias:
|
|
14666
|
+
name: colors.highlight("taskin mcp-server"),
|
|
14667
|
+
alias: colors.secondary("Alias: mcp"),
|
|
14202
14668
|
description: "Start MCP server for Claude Desktop integration",
|
|
14203
14669
|
examples: ["taskin mcp-server", "taskin mcp"],
|
|
14204
14670
|
icon: "\u{1F916}"
|
|
14205
14671
|
}
|
|
14206
14672
|
];
|
|
14207
14673
|
commands.forEach((cmd, index) => {
|
|
14208
|
-
console.log(
|
|
14209
|
-
console.log(
|
|
14210
|
-
console.log(
|
|
14674
|
+
console.log(colors.warning(`${cmd.icon} ${cmd.name}`));
|
|
14675
|
+
console.log(colors.normal(` ${cmd.alias}`));
|
|
14676
|
+
console.log(colors.info(` ${cmd.description}`));
|
|
14211
14677
|
console.log();
|
|
14212
|
-
console.log(
|
|
14678
|
+
console.log(colors.normal(` ${colors.info("\u{1F4DD} Examples:")}`));
|
|
14213
14679
|
cmd.examples.forEach((example) => {
|
|
14214
|
-
console.log(
|
|
14680
|
+
console.log(colors.secondary(` ${example}`));
|
|
14215
14681
|
});
|
|
14216
14682
|
if (index < commands.length - 1) {
|
|
14217
14683
|
console.log();
|
|
14218
|
-
console.log(
|
|
14684
|
+
console.log(colors.normal(" " + colors.secondary("\u2500".repeat(50))));
|
|
14219
14685
|
console.log();
|
|
14220
14686
|
}
|
|
14221
14687
|
});
|
|
14222
14688
|
console.log();
|
|
14223
|
-
console.log(
|
|
14689
|
+
console.log(colors.highlight("\u2550".repeat(60)));
|
|
14224
14690
|
console.log();
|
|
14225
|
-
console.log(
|
|
14691
|
+
console.log(colors.info("\u{1F4A1} QUICK TIPS"));
|
|
14692
|
+
console.log(
|
|
14693
|
+
colors.normal(
|
|
14694
|
+
`${colors.warning("\u2022")} Use short IDs: ${colors.highlight("001")}, ${colors.highlight("task-001")}`
|
|
14695
|
+
)
|
|
14696
|
+
);
|
|
14226
14697
|
console.log(
|
|
14227
|
-
|
|
14228
|
-
`${
|
|
14698
|
+
colors.normal(
|
|
14699
|
+
`${colors.warning("\u2022")} Configure automation with ${colors.highlight("taskin config --level <manual|assisted|autopilot>")}`
|
|
14229
14700
|
)
|
|
14230
14701
|
);
|
|
14231
14702
|
console.log(
|
|
14232
|
-
|
|
14233
|
-
`${
|
|
14703
|
+
colors.normal(
|
|
14704
|
+
`${colors.warning("\u2022")} All commands support ${colors.highlight("--help")} for more options`
|
|
14234
14705
|
)
|
|
14235
14706
|
);
|
|
14236
14707
|
console.log(
|
|
14237
|
-
|
|
14238
|
-
`${
|
|
14708
|
+
colors.normal(
|
|
14709
|
+
`${colors.warning("\u2022")} Use aliases for faster commands: ${colors.highlight("ls")}, ${colors.highlight("begin")}, ${colors.highlight("stop")}, ${colors.highlight("done")}`
|
|
14239
14710
|
)
|
|
14240
14711
|
);
|
|
14241
14712
|
console.log();
|
|
14242
|
-
console.log(
|
|
14713
|
+
console.log(colors.info("\u{1F527} FOR MORE HELP"));
|
|
14243
14714
|
console.log(
|
|
14244
|
-
|
|
14715
|
+
colors.secondary("taskin ") + colors.highlight("<command>") + colors.secondary(" --help")
|
|
14245
14716
|
);
|
|
14246
14717
|
console.log();
|
|
14247
14718
|
return "";
|
|
@@ -14249,15 +14720,15 @@ function showCustomHelp() {
|
|
|
14249
14720
|
|
|
14250
14721
|
// src/version.ts
|
|
14251
14722
|
init_esm_shims();
|
|
14252
|
-
import { readFileSync as
|
|
14253
|
-
import { dirname, join as
|
|
14723
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
14724
|
+
import { dirname, join as join4 } from "path";
|
|
14254
14725
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
14255
14726
|
var __filename3 = fileURLToPath3(import.meta.url);
|
|
14256
14727
|
var __dirname3 = dirname(__filename3);
|
|
14257
14728
|
function getVersion() {
|
|
14258
14729
|
try {
|
|
14259
|
-
const packageJsonPath =
|
|
14260
|
-
const packageJson = JSON.parse(
|
|
14730
|
+
const packageJsonPath = join4(__dirname3, "../package.json");
|
|
14731
|
+
const packageJson = JSON.parse(readFileSync3(packageJsonPath, "utf-8"));
|
|
14261
14732
|
return packageJson.version;
|
|
14262
14733
|
} catch {
|
|
14263
14734
|
return "0.0.0";
|
|
@@ -14266,16 +14737,16 @@ function getVersion() {
|
|
|
14266
14737
|
|
|
14267
14738
|
// src/main.ts
|
|
14268
14739
|
init_esm_shims();
|
|
14269
|
-
import { dirname as dirname2, join as
|
|
14740
|
+
import { dirname as dirname2, join as join6 } from "path";
|
|
14270
14741
|
|
|
14271
14742
|
// src/lib/file-system-task-linter/index.ts
|
|
14272
14743
|
init_esm_shims();
|
|
14273
14744
|
|
|
14274
14745
|
// src/lib/file-system-task-linter/file-system-task-linter.ts
|
|
14275
14746
|
init_esm_shims();
|
|
14276
|
-
import
|
|
14747
|
+
import chalk8 from "chalk";
|
|
14277
14748
|
import { readdir, readFile as readFile2 } from "fs/promises";
|
|
14278
|
-
import { join as
|
|
14749
|
+
import { join as join5 } from "path";
|
|
14279
14750
|
var VALID_STATUSES = ["pending", "in-progress", "done", "blocked"];
|
|
14280
14751
|
var VALID_TYPES = ["feat", "fix", "chore", "docs", "refactor", "test"];
|
|
14281
14752
|
var FileSystemTaskLinter = class {
|
|
@@ -14429,7 +14900,7 @@ var FileSystemTaskLinter = class {
|
|
|
14429
14900
|
if (fileNameError) {
|
|
14430
14901
|
this.addError(file, fileNameError.message, fileNameError.severity);
|
|
14431
14902
|
}
|
|
14432
|
-
const content = await readFile2(
|
|
14903
|
+
const content = await readFile2(join5(tasksDir, file), "utf-8");
|
|
14433
14904
|
this.validateContent(file, content);
|
|
14434
14905
|
}
|
|
14435
14906
|
const errors = this.errors.filter((e) => e.severity === "error");
|
|
@@ -14447,13 +14918,13 @@ var FileSystemTaskLinter = class {
|
|
|
14447
14918
|
static printResults(result) {
|
|
14448
14919
|
if (result.errors.length === 0 && result.warnings.length === 0) {
|
|
14449
14920
|
console.log(
|
|
14450
|
-
|
|
14921
|
+
chalk8.green(`\u2705 All ${result.filesChecked} task files are valid!
|
|
14451
14922
|
`)
|
|
14452
14923
|
);
|
|
14453
14924
|
return;
|
|
14454
14925
|
}
|
|
14455
14926
|
console.log(
|
|
14456
|
-
|
|
14927
|
+
chalk8.bold(
|
|
14457
14928
|
`
|
|
14458
14929
|
\u{1F4CA} Validation Results (${result.filesChecked} files checked):
|
|
14459
14930
|
`
|
|
@@ -14467,19 +14938,19 @@ var FileSystemTaskLinter = class {
|
|
|
14467
14938
|
errorsByFile.get(error2.file).push(error2);
|
|
14468
14939
|
});
|
|
14469
14940
|
for (const [file, fileErrors] of errorsByFile) {
|
|
14470
|
-
console.log(
|
|
14941
|
+
console.log(chalk8.cyan(`
|
|
14471
14942
|
\u{1F4C4} ${file}`));
|
|
14472
14943
|
for (const error2 of fileErrors) {
|
|
14473
|
-
const icon = error2.severity === "error" ?
|
|
14944
|
+
const icon = error2.severity === "error" ? chalk8.red("\u274C") : chalk8.yellow("\u26A0\uFE0F");
|
|
14474
14945
|
const location = error2.line ? `:${error2.line}` : "";
|
|
14475
14946
|
console.log(` ${icon} ${error2.message}${location}`);
|
|
14476
14947
|
}
|
|
14477
14948
|
}
|
|
14478
14949
|
console.log("\n" + "\u2500".repeat(60));
|
|
14479
14950
|
console.log(
|
|
14480
|
-
|
|
14951
|
+
chalk8.bold(
|
|
14481
14952
|
`
|
|
14482
|
-
\u{1F4CA} Summary: ${
|
|
14953
|
+
\u{1F4CA} Summary: ${chalk8.red(result.errors.length + " error(s)")}, ${chalk8.yellow(result.warnings.length + " warning(s)")}
|
|
14483
14954
|
`
|
|
14484
14955
|
)
|
|
14485
14956
|
);
|
|
@@ -14627,8 +15098,8 @@ var Taskin = class {
|
|
|
14627
15098
|
|
|
14628
15099
|
// src/main.ts
|
|
14629
15100
|
function createTaskin(tasksDir) {
|
|
14630
|
-
const resolvedTasksDir = tasksDir ||
|
|
14631
|
-
const taskinDir =
|
|
15101
|
+
const resolvedTasksDir = tasksDir || join6(process.cwd(), "TASKS");
|
|
15102
|
+
const taskinDir = join6(dirname2(resolvedTasksDir), ".taskin");
|
|
14632
15103
|
const userRegistry = new UserRegistry({ taskinDir });
|
|
14633
15104
|
const taskProvider = new FileSystemTaskProvider(
|
|
14634
15105
|
resolvedTasksDir,
|
|
@@ -14644,8 +15115,10 @@ function getTaskin() {
|
|
|
14644
15115
|
|
|
14645
15116
|
// src/index.ts
|
|
14646
15117
|
var program = new Command();
|
|
14647
|
-
program.name("taskin").description("\u{1F680} Task Management System").version(getVersion())
|
|
14648
|
-
|
|
15118
|
+
program.name("taskin").description("\u{1F680} Task Management System").version(getVersion());
|
|
15119
|
+
program.helpOption("-h, --help", "Display help information");
|
|
15120
|
+
program.command("help").description("Show help information").action(() => {
|
|
15121
|
+
showCustomHelp();
|
|
14649
15122
|
});
|
|
14650
15123
|
initCommand(program);
|
|
14651
15124
|
listCommand(program);
|
|
@@ -14654,14 +15127,23 @@ startCommand(program);
|
|
|
14654
15127
|
pauseCommand(program);
|
|
14655
15128
|
finishCommand(program);
|
|
14656
15129
|
statsCommand(program);
|
|
15130
|
+
configCommand(program);
|
|
14657
15131
|
registerExportCommand(program);
|
|
14658
15132
|
lintCommand(program);
|
|
14659
15133
|
dashboardCommand(program);
|
|
14660
15134
|
mcpServerCommand(program);
|
|
15135
|
+
program.on("option:help", () => {
|
|
15136
|
+
showCustomHelp();
|
|
15137
|
+
process.exit(0);
|
|
15138
|
+
});
|
|
14661
15139
|
if (process.argv.length <= 2) {
|
|
14662
15140
|
showCustomHelp();
|
|
14663
15141
|
process.exit(0);
|
|
14664
15142
|
}
|
|
15143
|
+
if (process.argv.length === 3 && (process.argv[2] === "--help" || process.argv[2] === "-h")) {
|
|
15144
|
+
showCustomHelp();
|
|
15145
|
+
process.exit(0);
|
|
15146
|
+
}
|
|
14665
15147
|
program.parse();
|
|
14666
15148
|
export {
|
|
14667
15149
|
Taskin,
|