taskin 2.2.2 → 2.3.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 +85 -37
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -7291,11 +7291,15 @@ ${result.error.message}`);
|
|
|
7291
7291
|
}
|
|
7292
7292
|
/**
|
|
7293
7293
|
* Get automation level from config
|
|
7294
|
-
* Returns 'assisted' as default if not configured
|
|
7294
|
+
* Returns 'assisted' as default if not configured or if config loading fails
|
|
7295
7295
|
*/
|
|
7296
7296
|
getAutomationLevel() {
|
|
7297
|
-
|
|
7298
|
-
|
|
7297
|
+
try {
|
|
7298
|
+
const config = this.loadConfig();
|
|
7299
|
+
return config.automation?.level ?? "assisted";
|
|
7300
|
+
} catch {
|
|
7301
|
+
return "assisted";
|
|
7302
|
+
}
|
|
7299
7303
|
}
|
|
7300
7304
|
/**
|
|
7301
7305
|
* Set automation level in config
|
|
@@ -7312,8 +7316,12 @@ ${result.error.message}`);
|
|
|
7312
7316
|
* Get automation configuration
|
|
7313
7317
|
*/
|
|
7314
7318
|
getAutomationConfig() {
|
|
7315
|
-
|
|
7316
|
-
|
|
7319
|
+
try {
|
|
7320
|
+
const config = this.loadConfig();
|
|
7321
|
+
return config.automation ?? { level: "assisted" };
|
|
7322
|
+
} catch {
|
|
7323
|
+
return { level: "assisted" };
|
|
7324
|
+
}
|
|
7317
7325
|
}
|
|
7318
7326
|
/**
|
|
7319
7327
|
* Set automation configuration
|
|
@@ -9470,6 +9478,7 @@ function registerExportCommand(program2) {
|
|
|
9470
9478
|
|
|
9471
9479
|
// src/commands/finish.ts
|
|
9472
9480
|
init_esm_shims();
|
|
9481
|
+
import { execSync } from "child_process";
|
|
9473
9482
|
import path9 from "path";
|
|
9474
9483
|
|
|
9475
9484
|
// src/lib/sound-player.ts
|
|
@@ -9545,43 +9554,75 @@ async function finishTask(taskId, options) {
|
|
|
9545
9554
|
error("Task is already done");
|
|
9546
9555
|
process.exit(1);
|
|
9547
9556
|
}
|
|
9557
|
+
const configManager = new ConfigManager(monorepoRoot);
|
|
9558
|
+
const behavior = configManager.getAutomationBehavior();
|
|
9548
9559
|
if (!options.skipUpdate) {
|
|
9549
9560
|
info("Marking task as done...");
|
|
9550
9561
|
const updatedTask = await taskManager.finishTask(task.id);
|
|
9551
9562
|
success(`Task ${updatedTask.id} completed successfully! \u{1F389}`);
|
|
9552
9563
|
success(`Status changed to: ${updatedTask.status}`);
|
|
9564
|
+
if (behavior.autoCommitStatusChange) {
|
|
9565
|
+
try {
|
|
9566
|
+
execSync(
|
|
9567
|
+
`git add TASKS/task-${normalizedId}-*.md && git commit -m "docs(TASKS): task-${normalizedId} - atualiza status para done [skip-ci]"`,
|
|
9568
|
+
{ cwd: process.cwd(), stdio: "ignore" }
|
|
9569
|
+
);
|
|
9570
|
+
success("\u2713 Auto-committed status change");
|
|
9571
|
+
} catch {
|
|
9572
|
+
}
|
|
9573
|
+
}
|
|
9574
|
+
if (behavior.autoCommitFinish) {
|
|
9575
|
+
const commitType = task.type || "feat";
|
|
9576
|
+
try {
|
|
9577
|
+
execSync("git add .", { cwd: process.cwd(), stdio: "ignore" });
|
|
9578
|
+
execSync(
|
|
9579
|
+
`git commit -m "${commitType}(task-${normalizedId}): ${task.title}"`,
|
|
9580
|
+
{ cwd: process.cwd(), stdio: "ignore" }
|
|
9581
|
+
);
|
|
9582
|
+
success("\u2713 Auto-committed completed work");
|
|
9583
|
+
} catch {
|
|
9584
|
+
}
|
|
9585
|
+
}
|
|
9553
9586
|
} else {
|
|
9554
9587
|
info("Skipping status update (--skip-update flag)");
|
|
9555
9588
|
}
|
|
9556
9589
|
console.log();
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
|
|
9569
|
-
|
|
9570
|
-
|
|
9571
|
-
|
|
9572
|
-
|
|
9590
|
+
if (!behavior.autoCommitFinish || options.skipUpdate) {
|
|
9591
|
+
info("Next steps (suggestions):");
|
|
9592
|
+
if (!options.skipUpdate) {
|
|
9593
|
+
const commitType = task.type || "feat";
|
|
9594
|
+
console.log(
|
|
9595
|
+
colors.secondary(
|
|
9596
|
+
` 1. Commit the status change: git add TASKS/task-${normalizedId}-*.md && git commit -m "docs(TASKS): task-${normalizedId} - atualiza status para done [skip-ci]"`
|
|
9597
|
+
)
|
|
9598
|
+
);
|
|
9599
|
+
console.log(colors.secondary(" 2. Review your changes"));
|
|
9600
|
+
console.log(
|
|
9601
|
+
colors.secondary(
|
|
9602
|
+
` 3. Commit your work: git add . && git commit -m "${commitType}(task-${normalizedId}): ${task.title}"`
|
|
9603
|
+
)
|
|
9604
|
+
);
|
|
9605
|
+
console.log(colors.secondary(" 4. Push: git push"));
|
|
9606
|
+
console.log(colors.secondary(" 5. Create a Pull Request"));
|
|
9607
|
+
} else {
|
|
9608
|
+
const commitType = task.type || "feat";
|
|
9609
|
+
console.log(colors.secondary(" 1. Review your changes"));
|
|
9610
|
+
console.log(
|
|
9611
|
+
colors.secondary(
|
|
9612
|
+
` 2. Commit your work: git add . && git commit -m "${commitType}(task-${normalizedId}): ${task.title}"`
|
|
9613
|
+
)
|
|
9614
|
+
);
|
|
9615
|
+
console.log(colors.secondary(" 3. Push: git push"));
|
|
9616
|
+
console.log(colors.secondary(" 4. Create a Pull Request"));
|
|
9617
|
+
}
|
|
9618
|
+
console.log();
|
|
9573
9619
|
} else {
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
console.log(
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
)
|
|
9580
|
-
);
|
|
9581
|
-
console.log(colors.secondary(" 3. Push: git push"));
|
|
9582
|
-
console.log(colors.secondary(" 4. Create a Pull Request"));
|
|
9620
|
+
info("All commits done automatically (autopilot mode)");
|
|
9621
|
+
info("Next steps:");
|
|
9622
|
+
console.log(colors.secondary(" 1. Push: git push"));
|
|
9623
|
+
console.log(colors.secondary(" 2. Create a Pull Request"));
|
|
9624
|
+
console.log();
|
|
9583
9625
|
}
|
|
9584
|
-
console.log();
|
|
9585
9626
|
success("Great work! \u{1F680}");
|
|
9586
9627
|
console.log();
|
|
9587
9628
|
if (options.sound !== false) {
|
|
@@ -9606,7 +9647,7 @@ init_esm_shims();
|
|
|
9606
9647
|
|
|
9607
9648
|
// src/lib/provider-installer/provider-installer.ts
|
|
9608
9649
|
init_esm_shims();
|
|
9609
|
-
import { execSync } from "child_process";
|
|
9650
|
+
import { execSync as execSync2 } from "child_process";
|
|
9610
9651
|
import { existsSync as existsSync4 } from "fs";
|
|
9611
9652
|
function detectPackageManager() {
|
|
9612
9653
|
if (existsSync4("pnpm-lock.yaml")) {
|
|
@@ -9655,7 +9696,7 @@ function installProvider(provider) {
|
|
|
9655
9696
|
default:
|
|
9656
9697
|
command = `npm install ${packageName}`;
|
|
9657
9698
|
}
|
|
9658
|
-
|
|
9699
|
+
execSync2(command, { stdio: "inherit" });
|
|
9659
9700
|
console.log(`\u2705 ${packageName} installed successfully!
|
|
9660
9701
|
`);
|
|
9661
9702
|
} catch (error2) {
|
|
@@ -14164,7 +14205,7 @@ Add any relevant notes or links here.
|
|
|
14164
14205
|
|
|
14165
14206
|
// src/commands/pause.ts
|
|
14166
14207
|
init_esm_shims();
|
|
14167
|
-
import { execSync as
|
|
14208
|
+
import { execSync as execSync3 } from "child_process";
|
|
14168
14209
|
import path13 from "path";
|
|
14169
14210
|
var pauseCommand = defineCommand({
|
|
14170
14211
|
name: "pause <task-id>",
|
|
@@ -14210,18 +14251,25 @@ async function pauseTask(taskId, options) {
|
|
|
14210
14251
|
process.exit(1);
|
|
14211
14252
|
}
|
|
14212
14253
|
const commitMessage = options.message || `WIP: task-${normalizedId} - ${task.title}`;
|
|
14254
|
+
const configManager = new ConfigManager(monorepoRoot);
|
|
14255
|
+
const behavior = configManager.getAutomationBehavior();
|
|
14213
14256
|
if (options.skipCommit) {
|
|
14214
14257
|
info("Would create commit with message:");
|
|
14215
14258
|
console.log(colors.highlight(` "${commitMessage}"`));
|
|
14216
14259
|
console.log();
|
|
14217
14260
|
info("Use without --skip-commit to actually commit");
|
|
14261
|
+
} else if (!behavior.autoCommitPause) {
|
|
14262
|
+
info("Commit suggestion (manual mode):");
|
|
14263
|
+
console.log(colors.secondary(` git add -A && git commit -m "${commitMessage}"`));
|
|
14264
|
+
console.log();
|
|
14265
|
+
info("Status will be updated to pending");
|
|
14218
14266
|
} else {
|
|
14219
14267
|
info("Creating commit...");
|
|
14220
14268
|
console.log(colors.secondary(` Message: "${commitMessage}"`));
|
|
14221
14269
|
console.log();
|
|
14222
14270
|
try {
|
|
14223
|
-
|
|
14224
|
-
|
|
14271
|
+
execSync3("git add -A", { cwd: process.cwd(), stdio: "ignore" });
|
|
14272
|
+
execSync3(`git commit -m "${commitMessage}"`, {
|
|
14225
14273
|
cwd: process.cwd(),
|
|
14226
14274
|
stdio: "ignore"
|
|
14227
14275
|
});
|
|
@@ -14230,7 +14278,7 @@ async function pauseTask(taskId, options) {
|
|
|
14230
14278
|
const updatedTask = { ...task, status: "pending" };
|
|
14231
14279
|
await taskProvider.updateTask(updatedTask);
|
|
14232
14280
|
success("Task paused successfully!");
|
|
14233
|
-
|
|
14281
|
+
success("\u2713 Auto-committed work in progress");
|
|
14234
14282
|
info("Status updated to pending");
|
|
14235
14283
|
console.log();
|
|
14236
14284
|
info("Next steps:");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "taskin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Task management system integrated with Git workflows",
|
|
5
5
|
"motivation": "Provide a CLI tool for task management integrated with Git workflows",
|
|
6
6
|
"solve": "Simplifies task tracking and management directly from the command line",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"ws": "^8.18.3",
|
|
84
84
|
"zod": "^3.25.76",
|
|
85
85
|
"@opentask/taskin-file-system-provider": "2.2.1",
|
|
86
|
-
"@opentask/taskin-
|
|
87
|
-
"@opentask/taskin-
|
|
86
|
+
"@opentask/taskin-utils": "1.1.0",
|
|
87
|
+
"@opentask/taskin-types": "1.0.6"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@types/node": "^20.19.24",
|