taskin 2.2.0 → 2.2.2
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 +18 -35
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -7225,10 +7225,9 @@ function info(message) {
|
|
|
7225
7225
|
|
|
7226
7226
|
// src/lib/config-manager.ts
|
|
7227
7227
|
init_esm_shims();
|
|
7228
|
-
import
|
|
7228
|
+
import { TaskinConfigSchema } from "@opentask/taskin-types";
|
|
7229
7229
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
7230
7230
|
import { join } from "path";
|
|
7231
|
-
var { TaskinConfigSchema } = TaskinTypes;
|
|
7232
7231
|
function getAutomationBehavior(level, commits) {
|
|
7233
7232
|
const presets = {
|
|
7234
7233
|
manual: {
|
|
@@ -8148,9 +8147,7 @@ var FileSystemTaskProvider = class {
|
|
|
8148
8147
|
}
|
|
8149
8148
|
async findTask(taskId) {
|
|
8150
8149
|
const files = await fs2.readdir(this.tasksDirectory);
|
|
8151
|
-
const taskFile = files.find(
|
|
8152
|
-
(file) => file.startsWith(`task-${taskId}-`) && file.endsWith(".md")
|
|
8153
|
-
);
|
|
8150
|
+
const taskFile = files.find((file) => file.startsWith(`task-${taskId}-`) && file.endsWith(".md"));
|
|
8154
8151
|
if (!taskFile) {
|
|
8155
8152
|
return void 0;
|
|
8156
8153
|
}
|
|
@@ -8166,7 +8163,8 @@ var FileSystemTaskProvider = class {
|
|
|
8166
8163
|
const escapedName = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
8167
8164
|
const rx = new RegExp(`^${escapedName}:\\s*(.+)$`, "im");
|
|
8168
8165
|
const m = content.match(rx);
|
|
8169
|
-
if (m)
|
|
8166
|
+
if (m)
|
|
8167
|
+
return m[1].trim();
|
|
8170
8168
|
}
|
|
8171
8169
|
return null;
|
|
8172
8170
|
};
|
|
@@ -8178,9 +8176,7 @@ var FileSystemTaskProvider = class {
|
|
|
8178
8176
|
const assigneeValue = assigneeMatch.trim();
|
|
8179
8177
|
assignee = this.userRegistry.resolveUser(assigneeValue);
|
|
8180
8178
|
if (!assignee) {
|
|
8181
|
-
console.warn(
|
|
8182
|
-
`[FS Provider] User "${assigneeValue}" not found in registry, creating temporary user`
|
|
8183
|
-
);
|
|
8179
|
+
console.warn(`[FS Provider] User "${assigneeValue}" not found in registry, creating temporary user`);
|
|
8184
8180
|
assignee = this.userRegistry.createTemporaryUser(assigneeValue);
|
|
8185
8181
|
}
|
|
8186
8182
|
}
|
|
@@ -8198,9 +8194,7 @@ var FileSystemTaskProvider = class {
|
|
|
8198
8194
|
}
|
|
8199
8195
|
async updateTask(task) {
|
|
8200
8196
|
const currentContent = await fs2.readFile(task.filePath, "utf-8");
|
|
8201
|
-
const hasSectionMetadata = /##\s*(Status|Type|Assignee)/i.test(
|
|
8202
|
-
currentContent
|
|
8203
|
-
);
|
|
8197
|
+
const hasSectionMetadata = /##\s*(Status|Type|Assignee)/i.test(currentContent);
|
|
8204
8198
|
if (hasSectionMetadata) {
|
|
8205
8199
|
const { fixTaskFile: fixTaskFile2 } = await Promise.resolve().then(() => (init_task_validator(), task_validator_exports));
|
|
8206
8200
|
await fixTaskFile2(task.filePath);
|
|
@@ -8208,24 +8202,16 @@ var FileSystemTaskProvider = class {
|
|
|
8208
8202
|
const content = await fs2.readFile(task.filePath, "utf-8");
|
|
8209
8203
|
let updatedContent;
|
|
8210
8204
|
if (/^Status:\s*.+$/im.test(content)) {
|
|
8211
|
-
updatedContent = content.replace(
|
|
8212
|
-
/^Status:\s*.+$/im,
|
|
8213
|
-
`Status: ${task.status}`
|
|
8214
|
-
);
|
|
8205
|
+
updatedContent = content.replace(/^Status:\s*.+$/im, `Status: ${task.status}`);
|
|
8215
8206
|
} else {
|
|
8216
|
-
updatedContent = content.replace(
|
|
8217
|
-
|
|
8218
|
-
`$1Status: ${task.status}
|
|
8219
|
-
`
|
|
8220
|
-
);
|
|
8207
|
+
updatedContent = content.replace(/(^#.*\n)/, `$1Status: ${task.status}
|
|
8208
|
+
`);
|
|
8221
8209
|
}
|
|
8222
8210
|
await fs2.writeFile(task.filePath, updatedContent, "utf-8");
|
|
8223
8211
|
}
|
|
8224
8212
|
async getAllTasks() {
|
|
8225
8213
|
const files = await fs2.readdir(this.tasksDirectory);
|
|
8226
|
-
const taskFiles = files.filter(
|
|
8227
|
-
(file) => file.startsWith("task-") && file.endsWith(".md")
|
|
8228
|
-
);
|
|
8214
|
+
const taskFiles = files.filter((file) => file.startsWith("task-") && file.endsWith(".md"));
|
|
8229
8215
|
const tasks = [];
|
|
8230
8216
|
for (const file of taskFiles) {
|
|
8231
8217
|
const filePath = path4.join(this.tasksDirectory, file);
|
|
@@ -8242,7 +8228,8 @@ var FileSystemTaskProvider = class {
|
|
|
8242
8228
|
const escapedName = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
8243
8229
|
const rx = new RegExp(`^${escapedName}:\\s*(.+)$`, "im");
|
|
8244
8230
|
const m = content.match(rx);
|
|
8245
|
-
if (m)
|
|
8231
|
+
if (m)
|
|
8232
|
+
return m[1].trim();
|
|
8246
8233
|
}
|
|
8247
8234
|
return null;
|
|
8248
8235
|
};
|
|
@@ -8391,9 +8378,7 @@ var UserRegistry = class {
|
|
|
8391
8378
|
console.log(`[UserRegistry] Loaded ${this.users.size} users`);
|
|
8392
8379
|
} catch (error2) {
|
|
8393
8380
|
if (error2.code === "ENOENT") {
|
|
8394
|
-
console.warn(
|
|
8395
|
-
"[UserRegistry] users.json not found, starting with empty registry"
|
|
8396
|
-
);
|
|
8381
|
+
console.warn("[UserRegistry] users.json not found, starting with empty registry");
|
|
8397
8382
|
this.users.clear();
|
|
8398
8383
|
} else {
|
|
8399
8384
|
throw error2;
|
|
@@ -8412,10 +8397,12 @@ var UserRegistry = class {
|
|
|
8412
8397
|
*/
|
|
8413
8398
|
resolveUser(nameOrId) {
|
|
8414
8399
|
const byId = this.users.get(nameOrId);
|
|
8415
|
-
if (byId)
|
|
8400
|
+
if (byId)
|
|
8401
|
+
return byId;
|
|
8416
8402
|
const slug = nameOrId.toLowerCase().replace(/\s+/g, "-");
|
|
8417
8403
|
const bySlug = this.users.get(slug);
|
|
8418
|
-
if (bySlug)
|
|
8404
|
+
if (bySlug)
|
|
8405
|
+
return bySlug;
|
|
8419
8406
|
for (const user of this.users.values()) {
|
|
8420
8407
|
if (user.name.toLowerCase() === nameOrId.toLowerCase()) {
|
|
8421
8408
|
return user;
|
|
@@ -8455,11 +8442,7 @@ var UserRegistry = class {
|
|
|
8455
8442
|
const data = {
|
|
8456
8443
|
users: Object.fromEntries(this.users.entries())
|
|
8457
8444
|
};
|
|
8458
|
-
await fs3.writeFile(
|
|
8459
|
-
this.usersFilePath,
|
|
8460
|
-
JSON.stringify(data, null, 2),
|
|
8461
|
-
"utf-8"
|
|
8462
|
-
);
|
|
8445
|
+
await fs3.writeFile(this.usersFilePath, JSON.stringify(data, null, 2), "utf-8");
|
|
8463
8446
|
}
|
|
8464
8447
|
};
|
|
8465
8448
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "taskin",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
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",
|
|
@@ -68,10 +68,10 @@
|
|
|
68
68
|
"LICENSE"
|
|
69
69
|
],
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@opentask/taskin-git-utils": "^2.
|
|
72
|
-
"@opentask/taskin-task-manager": "^1.0.
|
|
73
|
-
"@opentask/taskin-task-server-mcp": "^0.1.
|
|
74
|
-
"@opentask/taskin-task-server-ws": "^0.1.
|
|
71
|
+
"@opentask/taskin-git-utils": "^2.1.1",
|
|
72
|
+
"@opentask/taskin-task-manager": "^1.0.9",
|
|
73
|
+
"@opentask/taskin-task-server-mcp": "^0.1.7",
|
|
74
|
+
"@opentask/taskin-task-server-ws": "^0.1.4",
|
|
75
75
|
"@types/express": "^5.0.5",
|
|
76
76
|
"@types/inquirer": "^9.0.9",
|
|
77
77
|
"@types/play-sound": "^1.1.2",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"play-sound": "^1.1.6",
|
|
83
83
|
"ws": "^8.18.3",
|
|
84
84
|
"zod": "^3.25.76",
|
|
85
|
-
"@opentask/taskin-file-system-provider": "2.2.
|
|
86
|
-
"@opentask/taskin-types": "1.0.
|
|
85
|
+
"@opentask/taskin-file-system-provider": "2.2.1",
|
|
86
|
+
"@opentask/taskin-types": "1.0.6",
|
|
87
87
|
"@opentask/taskin-utils": "1.1.0"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|