taskin 2.1.0 → 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/dist/index.js +588 -294
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7180,6 +7180,385 @@ var require_dist = __commonJS({
|
|
|
7180
7180
|
init_esm_shims();
|
|
7181
7181
|
import { Command } from "commander";
|
|
7182
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
|
+
|
|
7183
7562
|
// src/commands/dashboard.ts
|
|
7184
7563
|
init_esm_shims();
|
|
7185
7564
|
|
|
@@ -7190,7 +7569,7 @@ init_esm_shims();
|
|
|
7190
7569
|
init_esm_shims();
|
|
7191
7570
|
import { UserStatsSchema } from "@opentask/taskin-types";
|
|
7192
7571
|
import { promises as fs } from "fs";
|
|
7193
|
-
import
|
|
7572
|
+
import path3 from "path";
|
|
7194
7573
|
var MILLISECONDS_PER_SECOND = 1e3;
|
|
7195
7574
|
var SECONDS_PER_MINUTE = 60;
|
|
7196
7575
|
var MINUTES_PER_HOUR = 60;
|
|
@@ -7410,7 +7789,7 @@ var FileSystemMetricsAdapter = class {
|
|
|
7410
7789
|
const taskFiles = files.filter((f) => f.startsWith("task-") && f.endsWith(".md"));
|
|
7411
7790
|
const tasks = [];
|
|
7412
7791
|
for (const file of taskFiles) {
|
|
7413
|
-
const filePath =
|
|
7792
|
+
const filePath = path3.join(this.tasksDirectory, file);
|
|
7414
7793
|
let content;
|
|
7415
7794
|
try {
|
|
7416
7795
|
content = await fs.readFile(filePath, "utf-8");
|
|
@@ -7741,23 +8120,23 @@ function slugify(text) {
|
|
|
7741
8120
|
|
|
7742
8121
|
// ../utils/dist/ui.js
|
|
7743
8122
|
init_esm_shims();
|
|
7744
|
-
import
|
|
7745
|
-
var
|
|
7746
|
-
primary:
|
|
7747
|
-
secondary:
|
|
7748
|
-
success:
|
|
7749
|
-
warning:
|
|
7750
|
-
error:
|
|
7751
|
-
info:
|
|
7752
|
-
highlight:
|
|
7753
|
-
normal:
|
|
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
|
|
7754
8133
|
};
|
|
7755
8134
|
|
|
7756
8135
|
// ../file-system-task-provider/dist/fs-task-provider.js
|
|
7757
8136
|
init_i18n();
|
|
7758
8137
|
init_task_validator();
|
|
7759
8138
|
import { promises as fs2 } from "fs";
|
|
7760
|
-
import
|
|
8139
|
+
import path4 from "path";
|
|
7761
8140
|
var FileSystemTaskProvider = class {
|
|
7762
8141
|
tasksDirectory;
|
|
7763
8142
|
userRegistry;
|
|
@@ -7775,7 +8154,7 @@ var FileSystemTaskProvider = class {
|
|
|
7775
8154
|
if (!taskFile) {
|
|
7776
8155
|
return void 0;
|
|
7777
8156
|
}
|
|
7778
|
-
const filePath =
|
|
8157
|
+
const filePath = path4.join(this.tasksDirectory, taskFile);
|
|
7779
8158
|
const content = await fs2.readFile(filePath, "utf-8");
|
|
7780
8159
|
const titleMatch = content.match(/^# .*Task.*?[—-]\s*(.+)$/im);
|
|
7781
8160
|
const title = titleMatch ? titleMatch[1].trim() : "Untitled";
|
|
@@ -7849,7 +8228,7 @@ var FileSystemTaskProvider = class {
|
|
|
7849
8228
|
);
|
|
7850
8229
|
const tasks = [];
|
|
7851
8230
|
for (const file of taskFiles) {
|
|
7852
|
-
const filePath =
|
|
8231
|
+
const filePath = path4.join(this.tasksDirectory, file);
|
|
7853
8232
|
const content = await fs2.readFile(filePath, "utf-8");
|
|
7854
8233
|
const idMatch = file.match(/^task-(\d+)-/);
|
|
7855
8234
|
const taskId = idMatch ? idMatch[1] : "unknown";
|
|
@@ -7908,7 +8287,7 @@ var FileSystemTaskProvider = class {
|
|
|
7908
8287
|
const taskId = String(nextNumber).padStart(3, "0");
|
|
7909
8288
|
const titleSlug = slugify(options.title);
|
|
7910
8289
|
const fileName = `task-${taskId}-${titleSlug}.md`;
|
|
7911
|
-
const filePath =
|
|
8290
|
+
const filePath = path4.join(this.tasksDirectory, fileName);
|
|
7912
8291
|
const fileExists = await fs2.access(filePath).then(() => true).catch(() => false);
|
|
7913
8292
|
if (fileExists) {
|
|
7914
8293
|
throw new Error(`Task file already exists: ${fileName}`);
|
|
@@ -7961,7 +8340,7 @@ ${i18n.notesPlaceholder}
|
|
|
7961
8340
|
}
|
|
7962
8341
|
async lint(fix) {
|
|
7963
8342
|
const files = await fs2.readdir(this.tasksDirectory);
|
|
7964
|
-
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));
|
|
7965
8344
|
if (fix) {
|
|
7966
8345
|
let fixedCount = 0;
|
|
7967
8346
|
for (const filePath of taskFiles) {
|
|
@@ -7989,14 +8368,14 @@ init_i18n();
|
|
|
7989
8368
|
// ../file-system-task-provider/dist/user-registry.js
|
|
7990
8369
|
init_esm_shims();
|
|
7991
8370
|
import { promises as fs3 } from "fs";
|
|
7992
|
-
import
|
|
8371
|
+
import path5 from "path";
|
|
7993
8372
|
var UserRegistry = class {
|
|
7994
8373
|
config;
|
|
7995
8374
|
users = /* @__PURE__ */ new Map();
|
|
7996
8375
|
usersFilePath;
|
|
7997
8376
|
constructor(config) {
|
|
7998
8377
|
this.config = config;
|
|
7999
|
-
this.usersFilePath =
|
|
8378
|
+
this.usersFilePath = path5.join(config.taskinDir, "users.json");
|
|
8000
8379
|
}
|
|
8001
8380
|
/**
|
|
8002
8381
|
* Load users from users.json
|
|
@@ -8480,97 +8859,11 @@ init_esm_shims();
|
|
|
8480
8859
|
init_esm_shims();
|
|
8481
8860
|
|
|
8482
8861
|
// src/commands/dashboard.ts
|
|
8483
|
-
import
|
|
8862
|
+
import chalk4 from "chalk";
|
|
8484
8863
|
import express from "express";
|
|
8485
8864
|
import { createServer } from "http";
|
|
8486
8865
|
import path6 from "path";
|
|
8487
8866
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
8488
|
-
|
|
8489
|
-
// src/lib/colors.ts
|
|
8490
|
-
init_esm_shims();
|
|
8491
|
-
import chalk2 from "chalk";
|
|
8492
|
-
var colors2 = {
|
|
8493
|
-
info: chalk2.cyan,
|
|
8494
|
-
success: chalk2.green,
|
|
8495
|
-
warning: chalk2.yellow,
|
|
8496
|
-
error: chalk2.red,
|
|
8497
|
-
highlight: chalk2.bold.white,
|
|
8498
|
-
secondary: chalk2.gray,
|
|
8499
|
-
normal: chalk2.white
|
|
8500
|
-
};
|
|
8501
|
-
var icons = {
|
|
8502
|
-
rocket: "\u{1F680}",
|
|
8503
|
-
list: "\u{1F4CA}",
|
|
8504
|
-
check: "\u2705",
|
|
8505
|
-
pause: "\u23F8\uFE0F",
|
|
8506
|
-
info: "\u{1F4A1}",
|
|
8507
|
-
task: "\u{1F4CB}",
|
|
8508
|
-
gear: "\u2699\uFE0F"
|
|
8509
|
-
};
|
|
8510
|
-
function printHeader(title, icon) {
|
|
8511
|
-
console.log();
|
|
8512
|
-
console.log(colors2.highlight("\u2550".repeat(60)));
|
|
8513
|
-
console.log(colors2.highlight(`${icon} ${title}`));
|
|
8514
|
-
console.log(colors2.highlight("\u2550".repeat(60)));
|
|
8515
|
-
console.log();
|
|
8516
|
-
}
|
|
8517
|
-
function success(message) {
|
|
8518
|
-
console.log(colors2.success(`\u2713 ${message}`));
|
|
8519
|
-
}
|
|
8520
|
-
function error(message) {
|
|
8521
|
-
console.error(colors2.error(`\u2717 ${message}`));
|
|
8522
|
-
}
|
|
8523
|
-
function info(message) {
|
|
8524
|
-
console.log(colors2.info(`\u2139 ${message}`));
|
|
8525
|
-
}
|
|
8526
|
-
|
|
8527
|
-
// src/lib/project-check.ts
|
|
8528
|
-
init_esm_shims();
|
|
8529
|
-
import { existsSync } from "fs";
|
|
8530
|
-
import path5 from "path";
|
|
8531
|
-
function isTaskinProject(cwd = process.cwd()) {
|
|
8532
|
-
return existsSync(path5.join(cwd, ".taskin.json"));
|
|
8533
|
-
}
|
|
8534
|
-
function requireTaskinProject(cwd = process.cwd()) {
|
|
8535
|
-
if (!isTaskinProject(cwd)) {
|
|
8536
|
-
error(
|
|
8537
|
-
'This directory is not initialized as a taskin project. Run "taskin init" first.'
|
|
8538
|
-
);
|
|
8539
|
-
process.exit(1);
|
|
8540
|
-
}
|
|
8541
|
-
}
|
|
8542
|
-
|
|
8543
|
-
// src/commands/define-command/index.ts
|
|
8544
|
-
init_esm_shims();
|
|
8545
|
-
|
|
8546
|
-
// src/commands/define-command/define-command.ts
|
|
8547
|
-
init_esm_shims();
|
|
8548
|
-
var defineCommand = (config) => {
|
|
8549
|
-
return (program2) => {
|
|
8550
|
-
const cmd = program2.command(config.name).description(config.description);
|
|
8551
|
-
if (config.alias) {
|
|
8552
|
-
cmd.alias(config.alias);
|
|
8553
|
-
}
|
|
8554
|
-
config.options?.forEach((opt) => {
|
|
8555
|
-
cmd.option(opt.flags, opt.description, opt.defaultValue);
|
|
8556
|
-
});
|
|
8557
|
-
cmd.action(async (...args) => {
|
|
8558
|
-
try {
|
|
8559
|
-
await config.handler(...args);
|
|
8560
|
-
} catch (err) {
|
|
8561
|
-
error(
|
|
8562
|
-
`Failed to execute command: ${err instanceof Error ? err.message : String(err)}`
|
|
8563
|
-
);
|
|
8564
|
-
process.exit(1);
|
|
8565
|
-
}
|
|
8566
|
-
});
|
|
8567
|
-
};
|
|
8568
|
-
};
|
|
8569
|
-
|
|
8570
|
-
// src/commands/define-command/define-command.types.ts
|
|
8571
|
-
init_esm_shims();
|
|
8572
|
-
|
|
8573
|
-
// src/commands/dashboard.ts
|
|
8574
8867
|
var __filename2 = fileURLToPath2(import.meta.url);
|
|
8575
8868
|
var __dirname2 = path6.dirname(__filename2);
|
|
8576
8869
|
var dashboardCommand = defineCommand({
|
|
@@ -8754,17 +9047,17 @@ async function startDashboard(options) {
|
|
|
8754
9047
|
});
|
|
8755
9048
|
}
|
|
8756
9049
|
info("");
|
|
8757
|
-
info(
|
|
9050
|
+
info(chalk4.bold("Dashboard Controls:"));
|
|
8758
9051
|
info(
|
|
8759
|
-
` \u2022 Dashboard: ${
|
|
9052
|
+
` \u2022 Dashboard: ${chalk4.cyan(`http://${host}:${port}${filterQuery}`)}`
|
|
8760
9053
|
);
|
|
8761
|
-
info(` \u2022 WebSocket: ${
|
|
9054
|
+
info(` \u2022 WebSocket: ${chalk4.cyan(`ws://${host}:${wsPort}`)}`);
|
|
8762
9055
|
if (options.filterOpen) {
|
|
8763
|
-
info(` \u2022 Filter: ${
|
|
9056
|
+
info(` \u2022 Filter: ${chalk4.yellow("Open tasks only")}`);
|
|
8764
9057
|
} else if (options.filterClosed) {
|
|
8765
|
-
info(` \u2022 Filter: ${
|
|
9058
|
+
info(` \u2022 Filter: ${chalk4.yellow("Closed tasks only")}`);
|
|
8766
9059
|
}
|
|
8767
|
-
info(` \u2022 Press ${
|
|
9060
|
+
info(` \u2022 Press ${chalk4.bold("Ctrl+C")} to stop both servers`);
|
|
8768
9061
|
info("");
|
|
8769
9062
|
const cleanup = async () => {
|
|
8770
9063
|
info("\nShutting down servers...");
|
|
@@ -9198,7 +9491,7 @@ import path9 from "path";
|
|
|
9198
9491
|
|
|
9199
9492
|
// src/lib/sound-player.ts
|
|
9200
9493
|
init_esm_shims();
|
|
9201
|
-
import { existsSync as
|
|
9494
|
+
import { existsSync as existsSync3 } from "fs";
|
|
9202
9495
|
import path8 from "path";
|
|
9203
9496
|
import player from "play-sound";
|
|
9204
9497
|
var soundPlayer = player({});
|
|
@@ -9215,7 +9508,7 @@ function playSound(soundName) {
|
|
|
9215
9508
|
// Custom sound in project root
|
|
9216
9509
|
path8.join(process.cwd(), ".taskin", `${soundName}.mp3`)
|
|
9217
9510
|
];
|
|
9218
|
-
const soundPath = possiblePaths.find((p) =>
|
|
9511
|
+
const soundPath = possiblePaths.find((p) => existsSync3(p));
|
|
9219
9512
|
if (!soundPath) {
|
|
9220
9513
|
return;
|
|
9221
9514
|
}
|
|
@@ -9282,28 +9575,28 @@ async function finishTask(taskId, options) {
|
|
|
9282
9575
|
if (!options.skipUpdate) {
|
|
9283
9576
|
const commitType = task.type || "feat";
|
|
9284
9577
|
console.log(
|
|
9285
|
-
|
|
9578
|
+
colors.secondary(
|
|
9286
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]"`
|
|
9287
9580
|
)
|
|
9288
9581
|
);
|
|
9289
|
-
console.log(
|
|
9582
|
+
console.log(colors.secondary(" 2. Review your changes"));
|
|
9290
9583
|
console.log(
|
|
9291
|
-
|
|
9584
|
+
colors.secondary(
|
|
9292
9585
|
` 3. Commit your work: git add . && git commit -m "${commitType}(task-${normalizedId}): ${task.title}"`
|
|
9293
9586
|
)
|
|
9294
9587
|
);
|
|
9295
|
-
console.log(
|
|
9296
|
-
console.log(
|
|
9588
|
+
console.log(colors.secondary(" 4. Push: git push"));
|
|
9589
|
+
console.log(colors.secondary(" 5. Create a Pull Request"));
|
|
9297
9590
|
} else {
|
|
9298
9591
|
const commitType = task.type || "feat";
|
|
9299
|
-
console.log(
|
|
9592
|
+
console.log(colors.secondary(" 1. Review your changes"));
|
|
9300
9593
|
console.log(
|
|
9301
|
-
|
|
9594
|
+
colors.secondary(
|
|
9302
9595
|
` 2. Commit your work: git add . && git commit -m "${commitType}(task-${normalizedId}): ${task.title}"`
|
|
9303
9596
|
)
|
|
9304
9597
|
);
|
|
9305
|
-
console.log(
|
|
9306
|
-
console.log(
|
|
9598
|
+
console.log(colors.secondary(" 3. Push: git push"));
|
|
9599
|
+
console.log(colors.secondary(" 4. Create a Pull Request"));
|
|
9307
9600
|
}
|
|
9308
9601
|
console.log();
|
|
9309
9602
|
success("Great work! \u{1F680}");
|
|
@@ -9316,14 +9609,14 @@ async function finishTask(taskId, options) {
|
|
|
9316
9609
|
// src/commands/init.ts
|
|
9317
9610
|
init_esm_shims();
|
|
9318
9611
|
import {
|
|
9319
|
-
existsSync as
|
|
9612
|
+
existsSync as existsSync5,
|
|
9320
9613
|
mkdirSync,
|
|
9321
|
-
readFileSync,
|
|
9614
|
+
readFileSync as readFileSync2,
|
|
9322
9615
|
readdirSync,
|
|
9323
|
-
writeFileSync
|
|
9616
|
+
writeFileSync as writeFileSync2
|
|
9324
9617
|
} from "fs";
|
|
9325
|
-
import
|
|
9326
|
-
import { join } from "path";
|
|
9618
|
+
import inquirer2 from "inquirer";
|
|
9619
|
+
import { join as join2 } from "path";
|
|
9327
9620
|
|
|
9328
9621
|
// src/lib/provider-installer/index.ts
|
|
9329
9622
|
init_esm_shims();
|
|
@@ -9331,12 +9624,12 @@ init_esm_shims();
|
|
|
9331
9624
|
// src/lib/provider-installer/provider-installer.ts
|
|
9332
9625
|
init_esm_shims();
|
|
9333
9626
|
import { execSync } from "child_process";
|
|
9334
|
-
import { existsSync as
|
|
9627
|
+
import { existsSync as existsSync4 } from "fs";
|
|
9335
9628
|
function detectPackageManager() {
|
|
9336
|
-
if (
|
|
9629
|
+
if (existsSync4("pnpm-lock.yaml")) {
|
|
9337
9630
|
return "pnpm";
|
|
9338
9631
|
}
|
|
9339
|
-
if (
|
|
9632
|
+
if (existsSync4("yarn.lock")) {
|
|
9340
9633
|
return "yarn";
|
|
9341
9634
|
}
|
|
9342
9635
|
return "npm";
|
|
@@ -9544,8 +9837,8 @@ var initCommand = defineCommand({
|
|
|
9544
9837
|
async function initializeTaskin(options) {
|
|
9545
9838
|
printHeader("Initializing Taskin", "\u{1F3AF}");
|
|
9546
9839
|
const cwd = process.cwd();
|
|
9547
|
-
const configFile =
|
|
9548
|
-
if (
|
|
9840
|
+
const configFile = join2(cwd, ".taskin.json");
|
|
9841
|
+
if (existsSync5(configFile) && !options.force) {
|
|
9549
9842
|
error("Taskin is already initialized in this project");
|
|
9550
9843
|
info("Use --force to reinitialize");
|
|
9551
9844
|
process.exit(1);
|
|
@@ -9564,12 +9857,12 @@ async function initializeTaskin(options) {
|
|
|
9564
9857
|
let providerId;
|
|
9565
9858
|
if (options.provider) {
|
|
9566
9859
|
providerId = options.provider;
|
|
9567
|
-
info(`Using provider from command line: ${
|
|
9860
|
+
info(`Using provider from command line: ${colors.highlight(providerId)}`);
|
|
9568
9861
|
} else if (process.env.CI === "true") {
|
|
9569
9862
|
providerId = "fs";
|
|
9570
9863
|
info("CI environment detected, using default provider: fs");
|
|
9571
9864
|
} else {
|
|
9572
|
-
const response = await
|
|
9865
|
+
const response = await inquirer2.prompt([
|
|
9573
9866
|
{
|
|
9574
9867
|
type: "list",
|
|
9575
9868
|
name: "providerId",
|
|
@@ -9586,7 +9879,7 @@ async function initializeTaskin(options) {
|
|
|
9586
9879
|
process.exit(1);
|
|
9587
9880
|
}
|
|
9588
9881
|
console.log();
|
|
9589
|
-
info(`Setting up task provider: ${
|
|
9882
|
+
info(`Setting up task provider: ${colors.highlight(selectedProvider.name)}`);
|
|
9590
9883
|
console.log();
|
|
9591
9884
|
const bundledProviders = ["fs"];
|
|
9592
9885
|
if (!bundledProviders.includes(selectedProvider.id)) {
|
|
@@ -9601,14 +9894,14 @@ async function initializeTaskin(options) {
|
|
|
9601
9894
|
}
|
|
9602
9895
|
};
|
|
9603
9896
|
info("Creating configuration file...");
|
|
9604
|
-
|
|
9605
|
-
success(`\u2713 Created ${
|
|
9606
|
-
const gitignorePath =
|
|
9607
|
-
if (
|
|
9608
|
-
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");
|
|
9609
9902
|
if (!gitignoreContent.includes(".taskin.json")) {
|
|
9610
9903
|
info("Adding .taskin.json to .gitignore...");
|
|
9611
|
-
|
|
9904
|
+
writeFileSync2(
|
|
9612
9905
|
gitignorePath,
|
|
9613
9906
|
`${gitignoreContent}
|
|
9614
9907
|
# Taskin configuration
|
|
@@ -9623,13 +9916,13 @@ async function initializeTaskin(options) {
|
|
|
9623
9916
|
success("\u{1F389} Taskin initialized successfully!");
|
|
9624
9917
|
console.log();
|
|
9625
9918
|
info("Next steps:");
|
|
9626
|
-
console.log(
|
|
9919
|
+
console.log(colors.secondary(" 1. Run: taskin list"));
|
|
9627
9920
|
console.log(
|
|
9628
|
-
|
|
9921
|
+
colors.secondary(
|
|
9629
9922
|
selectedProvider.id === "fs" ? " 2. Create a new task: taskin new (interactive mode)" : ` 2. Tasks will be synced with ${selectedProvider.name}`
|
|
9630
9923
|
)
|
|
9631
9924
|
);
|
|
9632
|
-
console.log(
|
|
9925
|
+
console.log(colors.secondary(" 3. Start working: taskin start <task-id>"));
|
|
9633
9926
|
console.log();
|
|
9634
9927
|
info("For more information, run: taskin --help");
|
|
9635
9928
|
console.log();
|
|
@@ -9653,29 +9946,29 @@ async function setupProviderConfig(provider, cwd) {
|
|
|
9653
9946
|
}
|
|
9654
9947
|
})
|
|
9655
9948
|
);
|
|
9656
|
-
const answers = await
|
|
9949
|
+
const answers = await inquirer2.prompt(questions);
|
|
9657
9950
|
console.log();
|
|
9658
9951
|
success(`\u2713 ${provider.name} configuration saved`);
|
|
9659
9952
|
return answers;
|
|
9660
9953
|
}
|
|
9661
9954
|
async function setupFileSystemProvider(cwd) {
|
|
9662
|
-
const tasksDir =
|
|
9663
|
-
if (!
|
|
9955
|
+
const tasksDir = join2(cwd, "TASKS");
|
|
9956
|
+
if (!existsSync5(tasksDir)) {
|
|
9664
9957
|
info(`Creating TASKS directory...`);
|
|
9665
9958
|
mkdirSync(tasksDir, { recursive: true });
|
|
9666
|
-
success(`\u2713 Created ${
|
|
9959
|
+
success(`\u2713 Created ${colors.highlight("TASKS/")} directory`);
|
|
9667
9960
|
} else {
|
|
9668
|
-
info(`${
|
|
9961
|
+
info(`${colors.highlight("TASKS/")} directory already exists`);
|
|
9669
9962
|
success("\u2713 Directory is ready to use");
|
|
9670
9963
|
}
|
|
9671
9964
|
const existingTask001 = readdirSync(tasksDir).find(
|
|
9672
9965
|
(file) => file.startsWith("task-001-") && file.endsWith(".md")
|
|
9673
9966
|
);
|
|
9674
9967
|
if (existingTask001) {
|
|
9675
|
-
info(`Sample task already exists: ${
|
|
9968
|
+
info(`Sample task already exists: ${colors.highlight(existingTask001)}`);
|
|
9676
9969
|
info("Skipping sample task creation (users already know the pattern)");
|
|
9677
9970
|
} else {
|
|
9678
|
-
const sampleTaskFile =
|
|
9971
|
+
const sampleTaskFile = join2(tasksDir, "task-001-setup-project.md");
|
|
9679
9972
|
info("Creating sample task...");
|
|
9680
9973
|
const sampleTask = `# Task 001 \u2014 Setup Project
|
|
9681
9974
|
|
|
@@ -9697,9 +9990,9 @@ This is a sample task created during Taskin initialization.
|
|
|
9697
9990
|
|
|
9698
9991
|
You can edit or delete this file. Use \`taskin list\` to see all tasks.
|
|
9699
9992
|
`;
|
|
9700
|
-
|
|
9993
|
+
writeFileSync2(sampleTaskFile, sampleTask, "utf-8");
|
|
9701
9994
|
success(
|
|
9702
|
-
`\u2713 Created sample task ${
|
|
9995
|
+
`\u2713 Created sample task ${colors.highlight("task-001-setup-project.md")}`
|
|
9703
9996
|
);
|
|
9704
9997
|
}
|
|
9705
9998
|
return {
|
|
@@ -9709,8 +10002,8 @@ You can edit or delete this file. Use \`taskin list\` to see all tasks.
|
|
|
9709
10002
|
|
|
9710
10003
|
// src/commands/lint.ts
|
|
9711
10004
|
init_esm_shims();
|
|
9712
|
-
import
|
|
9713
|
-
import { join as
|
|
10005
|
+
import chalk5 from "chalk";
|
|
10006
|
+
import { join as join3 } from "path";
|
|
9714
10007
|
var lintCommand = defineCommand({
|
|
9715
10008
|
name: "lint",
|
|
9716
10009
|
description: "\u{1F50D} Validate task markdown files",
|
|
@@ -9730,7 +10023,7 @@ var lintCommand = defineCommand({
|
|
|
9730
10023
|
}
|
|
9731
10024
|
});
|
|
9732
10025
|
async function executeLint(options) {
|
|
9733
|
-
const tasksDir = options.path ||
|
|
10026
|
+
const tasksDir = options.path || join3(process.cwd(), "TASKS");
|
|
9734
10027
|
if (options.fix) {
|
|
9735
10028
|
console.log(`\u{1F527} Fixing task files in: ${tasksDir}
|
|
9736
10029
|
`);
|
|
@@ -9739,26 +10032,26 @@ async function executeLint(options) {
|
|
|
9739
10032
|
`);
|
|
9740
10033
|
}
|
|
9741
10034
|
const userRegistry = new UserRegistry({
|
|
9742
|
-
taskinDir:
|
|
10035
|
+
taskinDir: join3(process.cwd(), ".taskin")
|
|
9743
10036
|
});
|
|
9744
10037
|
await userRegistry.load();
|
|
9745
10038
|
const provider = new FileSystemTaskProvider(tasksDir, userRegistry);
|
|
9746
10039
|
const result = await provider.lint(options.fix);
|
|
9747
10040
|
if (result.valid) {
|
|
9748
|
-
console.log(
|
|
10041
|
+
console.log(chalk5.green(`\u2705 All task files are valid!
|
|
9749
10042
|
`));
|
|
9750
10043
|
} else {
|
|
9751
|
-
console.log(
|
|
10044
|
+
console.log(chalk5.red(`
|
|
9752
10045
|
\u274C Found ${result.issues.length} issue(s):
|
|
9753
10046
|
`));
|
|
9754
10047
|
for (const issue of result.issues) {
|
|
9755
|
-
console.log(
|
|
10048
|
+
console.log(chalk5.yellow(` ${issue.file}: ${issue.message}`));
|
|
9756
10049
|
}
|
|
9757
10050
|
console.log();
|
|
9758
10051
|
}
|
|
9759
10052
|
if (!result.valid && !options.fix) {
|
|
9760
10053
|
console.log(
|
|
9761
|
-
|
|
10054
|
+
chalk5.blue(`\u{1F4A1} Run with --fix to automatically fix format issues
|
|
9762
10055
|
`)
|
|
9763
10056
|
);
|
|
9764
10057
|
process.exit(1);
|
|
@@ -9809,7 +10102,7 @@ async function listTasks(filter, options) {
|
|
|
9809
10102
|
const taskProvider = new FileSystemTaskProvider(tasksDir, userRegistry);
|
|
9810
10103
|
const tasks = await taskProvider.getAllTasks();
|
|
9811
10104
|
if (tasks.length === 0) {
|
|
9812
|
-
console.log(
|
|
10105
|
+
console.log(colors.warning("No tasks found in TASKS/ directory"));
|
|
9813
10106
|
return;
|
|
9814
10107
|
}
|
|
9815
10108
|
const openStatuses = ["pending", "in-progress", "blocked"];
|
|
@@ -9841,24 +10134,24 @@ async function listTasks(filter, options) {
|
|
|
9841
10134
|
);
|
|
9842
10135
|
}
|
|
9843
10136
|
if (filteredTasks.length === 0) {
|
|
9844
|
-
console.log(
|
|
10137
|
+
console.log(colors.warning("No tasks match the filters"));
|
|
9845
10138
|
return;
|
|
9846
10139
|
}
|
|
9847
10140
|
console.log(
|
|
9848
|
-
|
|
10141
|
+
colors.highlight(
|
|
9849
10142
|
`${"ID".padEnd(15)} ${"Status".padEnd(15)} ${"Type".padEnd(12)} ${"User".padEnd(15)} ${"Title"}`
|
|
9850
10143
|
)
|
|
9851
10144
|
);
|
|
9852
|
-
console.log(
|
|
10145
|
+
console.log(colors.secondary("\u2500".repeat(100)));
|
|
9853
10146
|
filteredTasks.forEach((task) => {
|
|
9854
10147
|
const statusColor = getStatusColor(task.status);
|
|
9855
10148
|
const typeColor = getTypeColor(task.type);
|
|
9856
10149
|
console.log(
|
|
9857
|
-
`${
|
|
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)}`
|
|
9858
10151
|
);
|
|
9859
10152
|
});
|
|
9860
10153
|
console.log();
|
|
9861
|
-
console.log(
|
|
10154
|
+
console.log(colors.secondary("\u2500".repeat(100)));
|
|
9862
10155
|
const statusCounts = {
|
|
9863
10156
|
pending: filteredTasks.filter((t) => t.status === "pending").length,
|
|
9864
10157
|
"in-progress": filteredTasks.filter((t) => t.status === "in-progress").length,
|
|
@@ -9866,7 +10159,7 @@ async function listTasks(filter, options) {
|
|
|
9866
10159
|
blocked: filteredTasks.filter((t) => t.status === "blocked").length
|
|
9867
10160
|
};
|
|
9868
10161
|
console.log(
|
|
9869
|
-
|
|
10162
|
+
colors.info(
|
|
9870
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}`
|
|
9871
10164
|
)
|
|
9872
10165
|
);
|
|
@@ -9875,33 +10168,33 @@ async function listTasks(filter, options) {
|
|
|
9875
10168
|
function getStatusColor(status) {
|
|
9876
10169
|
switch (status) {
|
|
9877
10170
|
case "pending":
|
|
9878
|
-
return
|
|
10171
|
+
return colors.secondary;
|
|
9879
10172
|
case "in-progress":
|
|
9880
|
-
return
|
|
10173
|
+
return colors.info;
|
|
9881
10174
|
case "done":
|
|
9882
|
-
return
|
|
10175
|
+
return colors.success;
|
|
9883
10176
|
case "blocked":
|
|
9884
|
-
return
|
|
10177
|
+
return colors.error;
|
|
9885
10178
|
default:
|
|
9886
|
-
return
|
|
10179
|
+
return colors.normal;
|
|
9887
10180
|
}
|
|
9888
10181
|
}
|
|
9889
10182
|
function getTypeColor(type) {
|
|
9890
10183
|
switch (type) {
|
|
9891
10184
|
case "feat":
|
|
9892
|
-
return
|
|
10185
|
+
return colors.success;
|
|
9893
10186
|
case "fix":
|
|
9894
|
-
return
|
|
10187
|
+
return colors.error;
|
|
9895
10188
|
case "refactor":
|
|
9896
|
-
return
|
|
10189
|
+
return colors.warning;
|
|
9897
10190
|
case "docs":
|
|
9898
|
-
return
|
|
10191
|
+
return colors.info;
|
|
9899
10192
|
case "test":
|
|
9900
|
-
return
|
|
10193
|
+
return colors.secondary;
|
|
9901
10194
|
case "chore":
|
|
9902
|
-
return
|
|
10195
|
+
return colors.normal;
|
|
9903
10196
|
default:
|
|
9904
|
-
return
|
|
10197
|
+
return colors.normal;
|
|
9905
10198
|
}
|
|
9906
10199
|
}
|
|
9907
10200
|
|
|
@@ -13633,7 +13926,7 @@ Let me start by marking the task as done using the finish_task tool.`
|
|
|
13633
13926
|
init_esm_shims();
|
|
13634
13927
|
|
|
13635
13928
|
// src/commands/mcp-server.ts
|
|
13636
|
-
import
|
|
13929
|
+
import chalk6 from "chalk";
|
|
13637
13930
|
import path11 from "path";
|
|
13638
13931
|
var mcpServerCommand = defineCommand({
|
|
13639
13932
|
name: "mcp-server",
|
|
@@ -13679,27 +13972,27 @@ async function startMCPServer(options) {
|
|
|
13679
13972
|
await mcpServer.connect({ transport });
|
|
13680
13973
|
success("\u2713 MCP server started successfully");
|
|
13681
13974
|
info("");
|
|
13682
|
-
info(
|
|
13683
|
-
info(` \u2022 Transport: ${
|
|
13684
|
-
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")}`);
|
|
13685
13978
|
info("");
|
|
13686
|
-
info(
|
|
13687
|
-
info(` \u2022 ${
|
|
13688
|
-
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`);
|
|
13689
13982
|
info("");
|
|
13690
|
-
info(
|
|
13983
|
+
info(chalk6.bold("Available Prompts:"));
|
|
13691
13984
|
info(
|
|
13692
|
-
` \u2022 ${
|
|
13985
|
+
` \u2022 ${chalk6.green("start-task-workflow")} - Guide for starting tasks`
|
|
13693
13986
|
);
|
|
13694
13987
|
info(
|
|
13695
|
-
` \u2022 ${
|
|
13988
|
+
` \u2022 ${chalk6.green("finish-task-workflow")} - Guide for finishing tasks`
|
|
13696
13989
|
);
|
|
13697
|
-
info(` \u2022 ${
|
|
13990
|
+
info(` \u2022 ${chalk6.green("task-summary")} - Get task summary and insights`);
|
|
13698
13991
|
info("");
|
|
13699
|
-
info(
|
|
13700
|
-
info(` \u2022 ${
|
|
13992
|
+
info(chalk6.bold("Available Resources:"));
|
|
13993
|
+
info(` \u2022 ${chalk6.green("taskin://tasks")} - Access all tasks`);
|
|
13701
13994
|
info("");
|
|
13702
|
-
info(`Press ${
|
|
13995
|
+
info(`Press ${chalk6.bold("Ctrl+C")} to stop the server`);
|
|
13703
13996
|
info("");
|
|
13704
13997
|
const cleanup = async () => {
|
|
13705
13998
|
info("\nShutting down MCP server...");
|
|
@@ -13724,8 +14017,8 @@ async function startMCPServer(options) {
|
|
|
13724
14017
|
|
|
13725
14018
|
// src/commands/new.ts
|
|
13726
14019
|
init_esm_shims();
|
|
13727
|
-
import { existsSync as
|
|
13728
|
-
import
|
|
14020
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
14021
|
+
import inquirer3 from "inquirer";
|
|
13729
14022
|
import path12 from "path";
|
|
13730
14023
|
var createCommand = defineCommand({
|
|
13731
14024
|
name: "new",
|
|
@@ -13760,7 +14053,7 @@ async function createTask(options) {
|
|
|
13760
14053
|
if (!options.type && !options.title) {
|
|
13761
14054
|
info("Interactive mode - Answer the questions below:");
|
|
13762
14055
|
console.log();
|
|
13763
|
-
const answers = await
|
|
14056
|
+
const answers = await inquirer3.prompt([
|
|
13764
14057
|
{
|
|
13765
14058
|
type: "list",
|
|
13766
14059
|
name: "type",
|
|
@@ -13819,7 +14112,7 @@ async function createTask(options) {
|
|
|
13819
14112
|
return;
|
|
13820
14113
|
}
|
|
13821
14114
|
const tasksDir = path12.join(process.cwd(), "TASKS");
|
|
13822
|
-
if (!
|
|
14115
|
+
if (!existsSync6(tasksDir)) {
|
|
13823
14116
|
mkdirSync2(tasksDir, { recursive: true });
|
|
13824
14117
|
}
|
|
13825
14118
|
const monorepoRoot = path12.dirname(tasksDir);
|
|
@@ -13837,7 +14130,7 @@ async function createTask(options) {
|
|
|
13837
14130
|
const titleSlug = slugify(options.title);
|
|
13838
14131
|
const fileName = `task-${taskId}-${titleSlug}.md`;
|
|
13839
14132
|
const filePath = path12.join(tasksDir, fileName);
|
|
13840
|
-
if (
|
|
14133
|
+
if (existsSync6(filePath)) {
|
|
13841
14134
|
error(`Task file already exists: ${fileName}`);
|
|
13842
14135
|
return;
|
|
13843
14136
|
}
|
|
@@ -13848,17 +14141,17 @@ async function createTask(options) {
|
|
|
13848
14141
|
description: options.description || "",
|
|
13849
14142
|
user: options.user || "A definir"
|
|
13850
14143
|
});
|
|
13851
|
-
|
|
14144
|
+
writeFileSync3(filePath, taskContent, "utf-8");
|
|
13852
14145
|
console.log();
|
|
13853
14146
|
success(`Task ${taskId} created successfully!`);
|
|
13854
|
-
console.log(
|
|
13855
|
-
console.log(
|
|
14147
|
+
console.log(colors.secondary(`\u{1F4C4} File: ${fileName}`));
|
|
14148
|
+
console.log(colors.secondary(`\u{1F4C1} Path: ${filePath}`));
|
|
13856
14149
|
console.log();
|
|
13857
|
-
console.log(
|
|
13858
|
-
console.log(
|
|
14150
|
+
console.log(colors.info("Next steps:"));
|
|
14151
|
+
console.log(colors.normal(` 1. Edit the task file to add more details`));
|
|
13859
14152
|
console.log(
|
|
13860
|
-
|
|
13861
|
-
` 2. Run ${
|
|
14153
|
+
colors.normal(
|
|
14154
|
+
` 2. Run ${colors.highlight("taskin start " + taskId)} to begin working on it`
|
|
13862
14155
|
)
|
|
13863
14156
|
);
|
|
13864
14157
|
console.log();
|
|
@@ -13936,12 +14229,12 @@ async function pauseTask(taskId, options) {
|
|
|
13936
14229
|
const commitMessage = options.message || `WIP: task-${normalizedId} - ${task.title}`;
|
|
13937
14230
|
if (options.skipCommit) {
|
|
13938
14231
|
info("Would create commit with message:");
|
|
13939
|
-
console.log(
|
|
14232
|
+
console.log(colors.highlight(` "${commitMessage}"`));
|
|
13940
14233
|
console.log();
|
|
13941
14234
|
info("Use without --skip-commit to actually commit");
|
|
13942
14235
|
} else {
|
|
13943
14236
|
info("Creating commit...");
|
|
13944
|
-
console.log(
|
|
14237
|
+
console.log(colors.secondary(` Message: "${commitMessage}"`));
|
|
13945
14238
|
console.log();
|
|
13946
14239
|
try {
|
|
13947
14240
|
execSync2("git add -A", { cwd: process.cwd(), stdio: "ignore" });
|
|
@@ -13958,9 +14251,9 @@ async function pauseTask(taskId, options) {
|
|
|
13958
14251
|
info("Status updated to pending");
|
|
13959
14252
|
console.log();
|
|
13960
14253
|
info("Next steps:");
|
|
13961
|
-
console.log(
|
|
14254
|
+
console.log(colors.secondary(" 1. Switch to another task"));
|
|
13962
14255
|
console.log(
|
|
13963
|
-
|
|
14256
|
+
colors.secondary(" 2. Or continue later with the same branch")
|
|
13964
14257
|
);
|
|
13965
14258
|
if (options.sound !== false) {
|
|
13966
14259
|
playSound("stop");
|
|
@@ -14027,17 +14320,17 @@ async function startTask(taskId, _options) {
|
|
|
14027
14320
|
console.log();
|
|
14028
14321
|
info("Next steps (suggestions):");
|
|
14029
14322
|
console.log(
|
|
14030
|
-
|
|
14323
|
+
colors.secondary(
|
|
14031
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]"`
|
|
14032
14325
|
)
|
|
14033
14326
|
);
|
|
14034
14327
|
console.log(
|
|
14035
|
-
|
|
14328
|
+
colors.secondary(
|
|
14036
14329
|
" 2. Create a branch: git checkout -b feat/task-" + normalizedId
|
|
14037
14330
|
)
|
|
14038
14331
|
);
|
|
14039
|
-
console.log(
|
|
14040
|
-
console.log(
|
|
14332
|
+
console.log(colors.secondary(" 3. Start coding! \u{1F4BB}"));
|
|
14333
|
+
console.log(colors.secondary(' 4. Use "taskin pause" to save progress'));
|
|
14041
14334
|
console.log();
|
|
14042
14335
|
if (_options.sound !== false) {
|
|
14043
14336
|
playSound("start");
|
|
@@ -14046,7 +14339,7 @@ async function startTask(taskId, _options) {
|
|
|
14046
14339
|
|
|
14047
14340
|
// src/commands/stats.ts
|
|
14048
14341
|
init_esm_shims();
|
|
14049
|
-
import
|
|
14342
|
+
import chalk7 from "chalk";
|
|
14050
14343
|
import path15 from "path";
|
|
14051
14344
|
var statsCommand = defineCommand({
|
|
14052
14345
|
name: "stats",
|
|
@@ -14109,27 +14402,27 @@ async function showStats(options) {
|
|
|
14109
14402
|
displayUserStats(stats, options.detailed);
|
|
14110
14403
|
}
|
|
14111
14404
|
} catch (error2) {
|
|
14112
|
-
console.error(
|
|
14405
|
+
console.error(chalk7.red("\n\u274C Error fetching stats:"), error2);
|
|
14113
14406
|
process.exit(1);
|
|
14114
14407
|
}
|
|
14115
14408
|
}
|
|
14116
14409
|
function displayUserStats(stats, detailed = false) {
|
|
14117
14410
|
console.log(
|
|
14118
|
-
`${
|
|
14411
|
+
`${chalk7.dim("Period:")} ${stats.period} (${formatDate(stats.periodStart)} to ${formatDate(stats.periodEnd)})
|
|
14119
14412
|
`
|
|
14120
14413
|
);
|
|
14121
|
-
console.log(
|
|
14414
|
+
console.log(chalk7.bold("\u{1F4DD} Code Metrics"));
|
|
14122
14415
|
console.log(
|
|
14123
|
-
` ${
|
|
14416
|
+
` ${chalk7.green("+")}${stats.codeMetrics.linesAdded} lines added`
|
|
14124
14417
|
);
|
|
14125
14418
|
console.log(
|
|
14126
|
-
` ${
|
|
14419
|
+
` ${chalk7.red("-")}${stats.codeMetrics.linesRemoved} lines removed`
|
|
14127
14420
|
);
|
|
14128
|
-
console.log(` ${
|
|
14421
|
+
console.log(` ${chalk7.cyan("=")}${stats.codeMetrics.netChange} net change`);
|
|
14129
14422
|
console.log(` \u{1F4C1} ${stats.codeMetrics.filesChanged} files changed`);
|
|
14130
14423
|
console.log(` \u{1F4BE} ${stats.codeMetrics.commits} commits
|
|
14131
14424
|
`);
|
|
14132
|
-
console.log(
|
|
14425
|
+
console.log(chalk7.bold("\u{1F3AF} Contribution"));
|
|
14133
14426
|
console.log(
|
|
14134
14427
|
` \u2705 ${stats.contributionMetrics.tasksCompleted} tasks completed`
|
|
14135
14428
|
);
|
|
@@ -14137,7 +14430,7 @@ function displayUserStats(stats, detailed = false) {
|
|
|
14137
14430
|
` \u{1F4CA} ${stats.contributionMetrics.activityFrequency.toFixed(2)} commits/day
|
|
14138
14431
|
`
|
|
14139
14432
|
);
|
|
14140
|
-
console.log(
|
|
14433
|
+
console.log(chalk7.bold("\u26A1 Engagement"));
|
|
14141
14434
|
console.log(
|
|
14142
14435
|
` \u{1F525} ${(stats.engagementMetrics.completionRate * 100).toFixed(1)}% completion rate`
|
|
14143
14436
|
);
|
|
@@ -14146,7 +14439,7 @@ function displayUserStats(stats, detailed = false) {
|
|
|
14146
14439
|
`
|
|
14147
14440
|
);
|
|
14148
14441
|
if (detailed) {
|
|
14149
|
-
console.log(
|
|
14442
|
+
console.log(chalk7.bold("\u23F0 Temporal Patterns"));
|
|
14150
14443
|
console.log(" By Day of Week:");
|
|
14151
14444
|
const days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
14152
14445
|
Object.entries(stats.temporalMetrics.byDayOfWeek).forEach(
|
|
@@ -14179,25 +14472,25 @@ function displayUserStats(stats, detailed = false) {
|
|
|
14179
14472
|
}
|
|
14180
14473
|
function displayTeamStats(stats, detailed = false) {
|
|
14181
14474
|
console.log(
|
|
14182
|
-
`${
|
|
14475
|
+
`${chalk7.dim("Period:")} ${stats.period} (${formatDate(stats.periodStart)} to ${formatDate(stats.periodEnd)})
|
|
14183
14476
|
`
|
|
14184
14477
|
);
|
|
14185
|
-
console.log(
|
|
14478
|
+
console.log(chalk7.bold("\u{1F465} Team Overview"));
|
|
14186
14479
|
console.log(` \u{1F464} ${stats.totalContributors} contributors`);
|
|
14187
14480
|
console.log(` \u{1F4BE} ${stats.totalCommits} total commits`);
|
|
14188
14481
|
console.log(` \u2705 ${stats.totalTasksCompleted} tasks completed
|
|
14189
14482
|
`);
|
|
14190
|
-
console.log(
|
|
14483
|
+
console.log(chalk7.bold("\u{1F4DD} Code Metrics"));
|
|
14191
14484
|
console.log(
|
|
14192
|
-
` ${
|
|
14485
|
+
` ${chalk7.green("+")}${stats.codeMetrics.linesAdded} lines added`
|
|
14193
14486
|
);
|
|
14194
14487
|
console.log(
|
|
14195
|
-
` ${
|
|
14488
|
+
` ${chalk7.red("-")}${stats.codeMetrics.linesRemoved} lines removed`
|
|
14196
14489
|
);
|
|
14197
14490
|
console.log(` \u{1F4C1} ${stats.codeMetrics.filesChanged} files changed
|
|
14198
14491
|
`);
|
|
14199
14492
|
if (detailed && stats.contributors.length > 0) {
|
|
14200
|
-
console.log(
|
|
14493
|
+
console.log(chalk7.bold("\u{1F3C6} Top Contributors"));
|
|
14201
14494
|
stats.contributors.sort((a, b) => {
|
|
14202
14495
|
if (b.commits !== a.commits) {
|
|
14203
14496
|
return b.commits - a.commits;
|
|
@@ -14214,24 +14507,24 @@ function displayTeamStats(stats, detailed = false) {
|
|
|
14214
14507
|
}
|
|
14215
14508
|
}
|
|
14216
14509
|
function displayTaskStats(stats, _detailed = false) {
|
|
14217
|
-
console.log(`${
|
|
14510
|
+
console.log(`${chalk7.dim("Task:")} ${stats.taskId} - ${stats.title}
|
|
14218
14511
|
`);
|
|
14219
|
-
console.log(
|
|
14512
|
+
console.log(chalk7.bold("\u{1F4CB} Task Info"));
|
|
14220
14513
|
console.log(` Status: ${getStatusEmoji(stats.status)} ${stats.status}`);
|
|
14221
14514
|
console.log(` Type: ${stats.type}`);
|
|
14222
14515
|
console.log(` Assignee: ${stats.assignee || "unassigned"}
|
|
14223
14516
|
`);
|
|
14224
|
-
console.log(
|
|
14517
|
+
console.log(chalk7.bold("\u{1F4DD} Code Metrics"));
|
|
14225
14518
|
console.log(
|
|
14226
|
-
` ${
|
|
14519
|
+
` ${chalk7.green("+")}${stats.codeMetrics.linesAdded} lines added`
|
|
14227
14520
|
);
|
|
14228
14521
|
console.log(
|
|
14229
|
-
` ${
|
|
14522
|
+
` ${chalk7.red("-")}${stats.codeMetrics.linesRemoved} lines removed`
|
|
14230
14523
|
);
|
|
14231
14524
|
console.log(` \u{1F4C1} ${stats.codeMetrics.filesChanged} files changed
|
|
14232
14525
|
`);
|
|
14233
14526
|
if (stats.contributors.length > 0) {
|
|
14234
|
-
console.log(
|
|
14527
|
+
console.log(chalk7.bold("\u{1F465} Contributors"));
|
|
14235
14528
|
stats.contributors.forEach((c) => {
|
|
14236
14529
|
console.log(` \u2022 ${c}`);
|
|
14237
14530
|
});
|
|
@@ -14243,7 +14536,7 @@ function formatDate(isoString) {
|
|
|
14243
14536
|
function createBar(value, max, length = 20) {
|
|
14244
14537
|
if (max === 0) return "\u2591".repeat(length);
|
|
14245
14538
|
const filled = Math.round(value / max * length);
|
|
14246
|
-
return
|
|
14539
|
+
return chalk7.cyan("\u2588".repeat(filled)) + chalk7.dim("\u2591".repeat(length - filled));
|
|
14247
14540
|
}
|
|
14248
14541
|
function getTrendEmoji(trend) {
|
|
14249
14542
|
switch (trend) {
|
|
@@ -14274,20 +14567,20 @@ function getStatusEmoji(status) {
|
|
|
14274
14567
|
init_esm_shims();
|
|
14275
14568
|
function showCustomHelp() {
|
|
14276
14569
|
printHeader("Taskin - Task Management System", icons.rocket);
|
|
14277
|
-
console.log(
|
|
14278
|
-
console.log(
|
|
14570
|
+
console.log(colors.info("\u{1F4CB} AVAILABLE COMMANDS"));
|
|
14571
|
+
console.log(colors.highlight("\u2550".repeat(60)));
|
|
14279
14572
|
console.log();
|
|
14280
14573
|
const commands = [
|
|
14281
14574
|
{
|
|
14282
|
-
name:
|
|
14283
|
-
alias:
|
|
14575
|
+
name: colors.highlight("taskin init"),
|
|
14576
|
+
alias: colors.secondary("Alias: setup"),
|
|
14284
14577
|
description: "Initialize Taskin in your project",
|
|
14285
14578
|
examples: ["taskin init", "taskin setup"],
|
|
14286
14579
|
icon: "\u{1F3AF}"
|
|
14287
14580
|
},
|
|
14288
14581
|
{
|
|
14289
|
-
name:
|
|
14290
|
-
alias:
|
|
14582
|
+
name: colors.highlight("taskin list") + colors.normal(" [filter]"),
|
|
14583
|
+
alias: colors.secondary("Alias: ls"),
|
|
14291
14584
|
description: "List all tasks in the project",
|
|
14292
14585
|
examples: [
|
|
14293
14586
|
"taskin list",
|
|
@@ -14298,8 +14591,8 @@ function showCustomHelp() {
|
|
|
14298
14591
|
icon: "\u{1F4CA}"
|
|
14299
14592
|
},
|
|
14300
14593
|
{
|
|
14301
|
-
name:
|
|
14302
|
-
alias:
|
|
14594
|
+
name: colors.highlight("taskin new"),
|
|
14595
|
+
alias: colors.secondary("Alias: create"),
|
|
14303
14596
|
description: "Create a new task",
|
|
14304
14597
|
examples: [
|
|
14305
14598
|
'taskin new -t feat -T "Add login" -d "Implement user authentication"',
|
|
@@ -14309,8 +14602,8 @@ function showCustomHelp() {
|
|
|
14309
14602
|
icon: "\u{1F4DD}"
|
|
14310
14603
|
},
|
|
14311
14604
|
{
|
|
14312
|
-
name:
|
|
14313
|
-
alias:
|
|
14605
|
+
name: colors.highlight("taskin start") + colors.normal(" <task-id>"),
|
|
14606
|
+
alias: colors.secondary("Alias: begin"),
|
|
14314
14607
|
description: "Start working on a task (suggests commits)",
|
|
14315
14608
|
examples: [
|
|
14316
14609
|
"taskin start 001",
|
|
@@ -14320,22 +14613,22 @@ function showCustomHelp() {
|
|
|
14320
14613
|
icon: "\u{1F680}"
|
|
14321
14614
|
},
|
|
14322
14615
|
{
|
|
14323
|
-
name:
|
|
14324
|
-
alias:
|
|
14616
|
+
name: colors.highlight("taskin pause") + colors.normal(" <task-id>"),
|
|
14617
|
+
alias: colors.secondary("Alias: stop"),
|
|
14325
14618
|
description: "Pause a task (auto-commits work in progress)",
|
|
14326
14619
|
examples: ["taskin pause 001", 'taskin pause 001 -m "saving progress"'],
|
|
14327
14620
|
icon: "\u23F8\uFE0F"
|
|
14328
14621
|
},
|
|
14329
14622
|
{
|
|
14330
|
-
name:
|
|
14331
|
-
alias:
|
|
14623
|
+
name: colors.highlight("taskin finish") + colors.normal(" <task-id>"),
|
|
14624
|
+
alias: colors.secondary("Alias: done"),
|
|
14332
14625
|
description: "Finish a task (suggests commits)",
|
|
14333
14626
|
examples: ["taskin finish 001", "taskin done task-001"],
|
|
14334
14627
|
icon: "\u2705"
|
|
14335
14628
|
},
|
|
14336
14629
|
{
|
|
14337
|
-
name:
|
|
14338
|
-
alias:
|
|
14630
|
+
name: colors.highlight("taskin config") + colors.normal(" [options]"),
|
|
14631
|
+
alias: colors.secondary("Options: --level <manual|assisted|autopilot>"),
|
|
14339
14632
|
description: "Configure automation level",
|
|
14340
14633
|
examples: [
|
|
14341
14634
|
"taskin config",
|
|
@@ -14345,8 +14638,8 @@ function showCustomHelp() {
|
|
|
14345
14638
|
icon: "\u2699\uFE0F"
|
|
14346
14639
|
},
|
|
14347
14640
|
{
|
|
14348
|
-
name:
|
|
14349
|
-
alias:
|
|
14641
|
+
name: colors.highlight("taskin lint") + colors.normal(" [options]"),
|
|
14642
|
+
alias: colors.secondary("Options: -p, --path <directory>"),
|
|
14350
14643
|
description: "Validate task markdown files",
|
|
14351
14644
|
examples: [
|
|
14352
14645
|
"taskin lint",
|
|
@@ -14356,8 +14649,8 @@ function showCustomHelp() {
|
|
|
14356
14649
|
icon: "\u{1F50D}"
|
|
14357
14650
|
},
|
|
14358
14651
|
{
|
|
14359
|
-
name:
|
|
14360
|
-
alias:
|
|
14652
|
+
name: colors.highlight("taskin dashboard") + colors.normal(" [options]"),
|
|
14653
|
+
alias: colors.secondary(
|
|
14361
14654
|
"Options: --host, --port, --filter-open, --filter-closed"
|
|
14362
14655
|
),
|
|
14363
14656
|
description: "Start the web dashboard",
|
|
@@ -14370,56 +14663,56 @@ function showCustomHelp() {
|
|
|
14370
14663
|
icon: "\u{1F4CA}"
|
|
14371
14664
|
},
|
|
14372
14665
|
{
|
|
14373
|
-
name:
|
|
14374
|
-
alias:
|
|
14666
|
+
name: colors.highlight("taskin mcp-server"),
|
|
14667
|
+
alias: colors.secondary("Alias: mcp"),
|
|
14375
14668
|
description: "Start MCP server for Claude Desktop integration",
|
|
14376
14669
|
examples: ["taskin mcp-server", "taskin mcp"],
|
|
14377
14670
|
icon: "\u{1F916}"
|
|
14378
14671
|
}
|
|
14379
14672
|
];
|
|
14380
14673
|
commands.forEach((cmd, index) => {
|
|
14381
|
-
console.log(
|
|
14382
|
-
console.log(
|
|
14383
|
-
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}`));
|
|
14384
14677
|
console.log();
|
|
14385
|
-
console.log(
|
|
14678
|
+
console.log(colors.normal(` ${colors.info("\u{1F4DD} Examples:")}`));
|
|
14386
14679
|
cmd.examples.forEach((example) => {
|
|
14387
|
-
console.log(
|
|
14680
|
+
console.log(colors.secondary(` ${example}`));
|
|
14388
14681
|
});
|
|
14389
14682
|
if (index < commands.length - 1) {
|
|
14390
14683
|
console.log();
|
|
14391
|
-
console.log(
|
|
14684
|
+
console.log(colors.normal(" " + colors.secondary("\u2500".repeat(50))));
|
|
14392
14685
|
console.log();
|
|
14393
14686
|
}
|
|
14394
14687
|
});
|
|
14395
14688
|
console.log();
|
|
14396
|
-
console.log(
|
|
14689
|
+
console.log(colors.highlight("\u2550".repeat(60)));
|
|
14397
14690
|
console.log();
|
|
14398
|
-
console.log(
|
|
14691
|
+
console.log(colors.info("\u{1F4A1} QUICK TIPS"));
|
|
14399
14692
|
console.log(
|
|
14400
|
-
|
|
14401
|
-
`${
|
|
14693
|
+
colors.normal(
|
|
14694
|
+
`${colors.warning("\u2022")} Use short IDs: ${colors.highlight("001")}, ${colors.highlight("task-001")}`
|
|
14402
14695
|
)
|
|
14403
14696
|
);
|
|
14404
14697
|
console.log(
|
|
14405
|
-
|
|
14406
|
-
`${
|
|
14698
|
+
colors.normal(
|
|
14699
|
+
`${colors.warning("\u2022")} Configure automation with ${colors.highlight("taskin config --level <manual|assisted|autopilot>")}`
|
|
14407
14700
|
)
|
|
14408
14701
|
);
|
|
14409
14702
|
console.log(
|
|
14410
|
-
|
|
14411
|
-
`${
|
|
14703
|
+
colors.normal(
|
|
14704
|
+
`${colors.warning("\u2022")} All commands support ${colors.highlight("--help")} for more options`
|
|
14412
14705
|
)
|
|
14413
14706
|
);
|
|
14414
14707
|
console.log(
|
|
14415
|
-
|
|
14416
|
-
`${
|
|
14708
|
+
colors.normal(
|
|
14709
|
+
`${colors.warning("\u2022")} Use aliases for faster commands: ${colors.highlight("ls")}, ${colors.highlight("begin")}, ${colors.highlight("stop")}, ${colors.highlight("done")}`
|
|
14417
14710
|
)
|
|
14418
14711
|
);
|
|
14419
14712
|
console.log();
|
|
14420
|
-
console.log(
|
|
14713
|
+
console.log(colors.info("\u{1F527} FOR MORE HELP"));
|
|
14421
14714
|
console.log(
|
|
14422
|
-
|
|
14715
|
+
colors.secondary("taskin ") + colors.highlight("<command>") + colors.secondary(" --help")
|
|
14423
14716
|
);
|
|
14424
14717
|
console.log();
|
|
14425
14718
|
return "";
|
|
@@ -14427,15 +14720,15 @@ function showCustomHelp() {
|
|
|
14427
14720
|
|
|
14428
14721
|
// src/version.ts
|
|
14429
14722
|
init_esm_shims();
|
|
14430
|
-
import { readFileSync as
|
|
14431
|
-
import { dirname, join as
|
|
14723
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
14724
|
+
import { dirname, join as join4 } from "path";
|
|
14432
14725
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
14433
14726
|
var __filename3 = fileURLToPath3(import.meta.url);
|
|
14434
14727
|
var __dirname3 = dirname(__filename3);
|
|
14435
14728
|
function getVersion() {
|
|
14436
14729
|
try {
|
|
14437
|
-
const packageJsonPath =
|
|
14438
|
-
const packageJson = JSON.parse(
|
|
14730
|
+
const packageJsonPath = join4(__dirname3, "../package.json");
|
|
14731
|
+
const packageJson = JSON.parse(readFileSync3(packageJsonPath, "utf-8"));
|
|
14439
14732
|
return packageJson.version;
|
|
14440
14733
|
} catch {
|
|
14441
14734
|
return "0.0.0";
|
|
@@ -14444,16 +14737,16 @@ function getVersion() {
|
|
|
14444
14737
|
|
|
14445
14738
|
// src/main.ts
|
|
14446
14739
|
init_esm_shims();
|
|
14447
|
-
import { dirname as dirname2, join as
|
|
14740
|
+
import { dirname as dirname2, join as join6 } from "path";
|
|
14448
14741
|
|
|
14449
14742
|
// src/lib/file-system-task-linter/index.ts
|
|
14450
14743
|
init_esm_shims();
|
|
14451
14744
|
|
|
14452
14745
|
// src/lib/file-system-task-linter/file-system-task-linter.ts
|
|
14453
14746
|
init_esm_shims();
|
|
14454
|
-
import
|
|
14747
|
+
import chalk8 from "chalk";
|
|
14455
14748
|
import { readdir, readFile as readFile2 } from "fs/promises";
|
|
14456
|
-
import { join as
|
|
14749
|
+
import { join as join5 } from "path";
|
|
14457
14750
|
var VALID_STATUSES = ["pending", "in-progress", "done", "blocked"];
|
|
14458
14751
|
var VALID_TYPES = ["feat", "fix", "chore", "docs", "refactor", "test"];
|
|
14459
14752
|
var FileSystemTaskLinter = class {
|
|
@@ -14607,7 +14900,7 @@ var FileSystemTaskLinter = class {
|
|
|
14607
14900
|
if (fileNameError) {
|
|
14608
14901
|
this.addError(file, fileNameError.message, fileNameError.severity);
|
|
14609
14902
|
}
|
|
14610
|
-
const content = await readFile2(
|
|
14903
|
+
const content = await readFile2(join5(tasksDir, file), "utf-8");
|
|
14611
14904
|
this.validateContent(file, content);
|
|
14612
14905
|
}
|
|
14613
14906
|
const errors = this.errors.filter((e) => e.severity === "error");
|
|
@@ -14625,13 +14918,13 @@ var FileSystemTaskLinter = class {
|
|
|
14625
14918
|
static printResults(result) {
|
|
14626
14919
|
if (result.errors.length === 0 && result.warnings.length === 0) {
|
|
14627
14920
|
console.log(
|
|
14628
|
-
|
|
14921
|
+
chalk8.green(`\u2705 All ${result.filesChecked} task files are valid!
|
|
14629
14922
|
`)
|
|
14630
14923
|
);
|
|
14631
14924
|
return;
|
|
14632
14925
|
}
|
|
14633
14926
|
console.log(
|
|
14634
|
-
|
|
14927
|
+
chalk8.bold(
|
|
14635
14928
|
`
|
|
14636
14929
|
\u{1F4CA} Validation Results (${result.filesChecked} files checked):
|
|
14637
14930
|
`
|
|
@@ -14645,19 +14938,19 @@ var FileSystemTaskLinter = class {
|
|
|
14645
14938
|
errorsByFile.get(error2.file).push(error2);
|
|
14646
14939
|
});
|
|
14647
14940
|
for (const [file, fileErrors] of errorsByFile) {
|
|
14648
|
-
console.log(
|
|
14941
|
+
console.log(chalk8.cyan(`
|
|
14649
14942
|
\u{1F4C4} ${file}`));
|
|
14650
14943
|
for (const error2 of fileErrors) {
|
|
14651
|
-
const icon = error2.severity === "error" ?
|
|
14944
|
+
const icon = error2.severity === "error" ? chalk8.red("\u274C") : chalk8.yellow("\u26A0\uFE0F");
|
|
14652
14945
|
const location = error2.line ? `:${error2.line}` : "";
|
|
14653
14946
|
console.log(` ${icon} ${error2.message}${location}`);
|
|
14654
14947
|
}
|
|
14655
14948
|
}
|
|
14656
14949
|
console.log("\n" + "\u2500".repeat(60));
|
|
14657
14950
|
console.log(
|
|
14658
|
-
|
|
14951
|
+
chalk8.bold(
|
|
14659
14952
|
`
|
|
14660
|
-
\u{1F4CA} Summary: ${
|
|
14953
|
+
\u{1F4CA} Summary: ${chalk8.red(result.errors.length + " error(s)")}, ${chalk8.yellow(result.warnings.length + " warning(s)")}
|
|
14661
14954
|
`
|
|
14662
14955
|
)
|
|
14663
14956
|
);
|
|
@@ -14805,8 +15098,8 @@ var Taskin = class {
|
|
|
14805
15098
|
|
|
14806
15099
|
// src/main.ts
|
|
14807
15100
|
function createTaskin(tasksDir) {
|
|
14808
|
-
const resolvedTasksDir = tasksDir ||
|
|
14809
|
-
const taskinDir =
|
|
15101
|
+
const resolvedTasksDir = tasksDir || join6(process.cwd(), "TASKS");
|
|
15102
|
+
const taskinDir = join6(dirname2(resolvedTasksDir), ".taskin");
|
|
14810
15103
|
const userRegistry = new UserRegistry({ taskinDir });
|
|
14811
15104
|
const taskProvider = new FileSystemTaskProvider(
|
|
14812
15105
|
resolvedTasksDir,
|
|
@@ -14834,6 +15127,7 @@ startCommand(program);
|
|
|
14834
15127
|
pauseCommand(program);
|
|
14835
15128
|
finishCommand(program);
|
|
14836
15129
|
statsCommand(program);
|
|
15130
|
+
configCommand(program);
|
|
14837
15131
|
registerExportCommand(program);
|
|
14838
15132
|
lintCommand(program);
|
|
14839
15133
|
dashboardCommand(program);
|