taskin 0.1.0-beta.0 → 0.1.0-beta.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/README.md +91 -12
- package/dist/index.d.ts +380 -5
- package/dist/index.js +1372 -25
- package/package.json +15 -11
- package/dist/commands/commands.types.d.ts +0 -13
- package/dist/commands/commands.types.js +0 -6
- package/dist/commands/commands.types.js.map +0 -1
- package/dist/commands/define-command/define-command.d.ts +0 -6
- package/dist/commands/define-command/define-command.js +0 -27
- package/dist/commands/define-command/define-command.js.map +0 -1
- package/dist/commands/define-command/define-command.test.d.ts +0 -4
- package/dist/commands/define-command/define-command.test.js +0 -125
- package/dist/commands/define-command/define-command.test.js.map +0 -1
- package/dist/commands/define-command/define-command.types.d.ts +0 -49
- package/dist/commands/define-command/define-command.types.js +0 -5
- package/dist/commands/define-command/define-command.types.js.map +0 -1
- package/dist/commands/define-command/index.d.ts +0 -5
- package/dist/commands/define-command/index.js +0 -6
- package/dist/commands/define-command/index.js.map +0 -1
- package/dist/commands/finish.d.ts +0 -4
- package/dist/commands/finish.js +0 -69
- package/dist/commands/finish.js.map +0 -1
- package/dist/commands/index.d.ts +0 -9
- package/dist/commands/index.js +0 -10
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/init.d.ts +0 -4
- package/dist/commands/init.js +0 -192
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/lint.d.ts +0 -4
- package/dist/commands/lint.js +0 -31
- package/dist/commands/lint.js.map +0 -1
- package/dist/commands/list.d.ts +0 -4
- package/dist/commands/list.js +0 -132
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/pause.d.ts +0 -4
- package/dist/commands/pause.js +0 -69
- package/dist/commands/pause.js.map +0 -1
- package/dist/commands/start.d.ts +0 -4
- package/dist/commands/start.js +0 -70
- package/dist/commands/start.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/colors.d.ts +0 -26
- package/dist/lib/colors.js +0 -42
- package/dist/lib/colors.js.map +0 -1
- package/dist/lib/file-system-task-linter/file-system-task-linter.d.ts +0 -36
- package/dist/lib/file-system-task-linter/file-system-task-linter.js +0 -219
- package/dist/lib/file-system-task-linter/file-system-task-linter.js.map +0 -1
- package/dist/lib/file-system-task-linter/file-system-task-linter.mock.d.ts +0 -81
- package/dist/lib/file-system-task-linter/file-system-task-linter.mock.js +0 -152
- package/dist/lib/file-system-task-linter/file-system-task-linter.mock.js.map +0 -1
- package/dist/lib/file-system-task-linter/file-system-task-linter.test.d.ts +0 -4
- package/dist/lib/file-system-task-linter/file-system-task-linter.test.js +0 -146
- package/dist/lib/file-system-task-linter/file-system-task-linter.test.js.map +0 -1
- package/dist/lib/file-system-task-linter/file-system-task-linter.types.d.ts +0 -52
- package/dist/lib/file-system-task-linter/file-system-task-linter.types.js +0 -6
- package/dist/lib/file-system-task-linter/file-system-task-linter.types.js.map +0 -1
- package/dist/lib/file-system-task-linter/index.d.ts +0 -6
- package/dist/lib/file-system-task-linter/index.js +0 -7
- package/dist/lib/file-system-task-linter/index.js.map +0 -1
- package/dist/lib/help.d.ts +0 -4
- package/dist/lib/help.js +0 -104
- package/dist/lib/help.js.map +0 -1
- package/dist/lib/index.d.ts +0 -6
- package/dist/lib/index.js +0 -7
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/provider-installer/index.d.ts +0 -5
- package/dist/lib/provider-installer/index.js +0 -6
- package/dist/lib/provider-installer/index.js.map +0 -1
- package/dist/lib/provider-installer/provider-installer.d.ts +0 -28
- package/dist/lib/provider-installer/provider-installer.js +0 -86
- package/dist/lib/provider-installer/provider-installer.js.map +0 -1
- package/dist/lib/provider-installer/provider-installer.types.d.ts +0 -4
- package/dist/lib/provider-installer/provider-installer.types.js +0 -5
- package/dist/lib/provider-installer/provider-installer.types.js.map +0 -1
- package/dist/lib/provider-installer.d.ts +0 -27
- package/dist/lib/provider-installer.js +0 -86
- package/dist/lib/provider-installer.js.map +0 -1
- package/dist/lib/provider-registry/index.d.ts +0 -5
- package/dist/lib/provider-registry/index.js +0 -6
- package/dist/lib/provider-registry/index.js.map +0 -1
- package/dist/lib/provider-registry/provider-registry.d.ts +0 -9
- package/dist/lib/provider-registry/provider-registry.js +0 -111
- package/dist/lib/provider-registry/provider-registry.js.map +0 -1
- package/dist/lib/provider-registry/provider-registry.types.d.ts +0 -5
- package/dist/lib/provider-registry/provider-registry.types.js +0 -6
- package/dist/lib/provider-registry/provider-registry.types.js.map +0 -1
- package/dist/lib/provider-registry.d.ts +0 -26
- package/dist/lib/provider-registry.js +0 -111
- package/dist/lib/provider-registry.js.map +0 -1
- package/dist/lib/task-linter/index.d.ts +0 -5
- package/dist/lib/task-linter/index.js +0 -6
- package/dist/lib/task-linter/index.js.map +0 -1
- package/dist/lib/task-linter/task-linter.d.ts +0 -36
- package/dist/lib/task-linter/task-linter.js +0 -219
- package/dist/lib/task-linter/task-linter.js.map +0 -1
- package/dist/lib/task-linter/task-linter.types.d.ts +0 -52
- package/dist/lib/task-linter/task-linter.types.js +0 -6
- package/dist/lib/task-linter/task-linter.types.js.map +0 -1
- package/dist/lib/task-linter.d.ts +0 -29
- package/dist/lib/task-linter.js +0 -215
- package/dist/lib/task-linter.js.map +0 -1
- package/dist/lib/task-linter.types.d.ts +0 -38
- package/dist/lib/task-linter.types.js +0 -5
- package/dist/lib/task-linter.types.js.map +0 -1
- package/dist/main.d.ts +0 -14
- package/dist/main.js +0 -29
- package/dist/main.js.map +0 -1
- package/dist/taskin.d.ts +0 -33
- package/dist/taskin.js +0 -101
- package/dist/taskin.js.map +0 -1
package/README.md
CHANGED
|
@@ -20,21 +20,57 @@ Taskin is a command-line tool that helps you manage tasks directly from your ter
|
|
|
20
20
|
## 🚀 Installation
|
|
21
21
|
|
|
22
22
|
\`\`\`bash
|
|
23
|
+
|
|
23
24
|
# Using npx (recommended - no installation needed!)
|
|
25
|
+
|
|
24
26
|
npx taskin init
|
|
25
27
|
|
|
26
28
|
# Or install globally
|
|
29
|
+
|
|
27
30
|
npm install -g taskin
|
|
28
31
|
|
|
29
32
|
# Or with pnpm
|
|
33
|
+
|
|
30
34
|
pnpm add -g taskin
|
|
31
35
|
|
|
32
36
|
# Or with yarn
|
|
37
|
+
|
|
33
38
|
yarn global add taskin
|
|
34
39
|
\`\`\`
|
|
35
40
|
|
|
36
41
|
> **Note:** This is a beta version. Please report any issues on [GitHub](https://github.com/opentask-app/taskin/issues).
|
|
37
42
|
|
|
43
|
+
## 📦 Available Packages
|
|
44
|
+
|
|
45
|
+
Taskin is built as a modular ecosystem. Besides the CLI, you can use individual packages:
|
|
46
|
+
|
|
47
|
+
### Core Packages
|
|
48
|
+
|
|
49
|
+
| Package | Description | npm |
|
|
50
|
+
| --------------------------------- | -------------------------------- | --------------------------------------------------------------------------------------- |
|
|
51
|
+
| **taskin** | Complete CLI + programmatic API | [](https://www.npmjs.com/package/taskin) |
|
|
52
|
+
| **@opentask/taskin-types** | TypeScript types and Zod schemas | Coming soon |
|
|
53
|
+
| **@opentask/taskin-core** | Core task management logic | Coming soon |
|
|
54
|
+
| **@opentask/taskin-task-manager** | Task lifecycle orchestration | Coming soon |
|
|
55
|
+
|
|
56
|
+
### Task Providers
|
|
57
|
+
|
|
58
|
+
| Provider | Description | Status | npm |
|
|
59
|
+
| ------------------------------------- | ------------------------------------- | -------------- | ----------- |
|
|
60
|
+
| **@opentask/taskin-fs-provider** | File System provider (Markdown files) | ✅ Stable | Coming soon |
|
|
61
|
+
| **@opentask/taskin-redmine-provider** | Redmine integration | 🚧 Coming Soon | - |
|
|
62
|
+
| **@opentask/taskin-jira-provider** | Jira Cloud integration | 🚧 Coming Soon | - |
|
|
63
|
+
| **@opentask/taskin-github-provider** | GitHub Issues integration | 🚧 Coming Soon | - |
|
|
64
|
+
|
|
65
|
+
### Utilities
|
|
66
|
+
|
|
67
|
+
| Package | Description | npm |
|
|
68
|
+
| ------------------------------ | -------------------- | ----------- |
|
|
69
|
+
| **@opentask/taskin-git-utils** | Git workflow helpers | Coming soon |
|
|
70
|
+
| **@opentask/taskin-utils** | Shared utilities | Coming soon |
|
|
71
|
+
|
|
72
|
+
> 💡 **Tip:** When you run `taskin init`, providers are automatically installed on-demand. You don't need to install them manually!
|
|
73
|
+
|
|
38
74
|
## Quick Start
|
|
39
75
|
|
|
40
76
|
1. **Initialize Taskin in your project:**
|
|
@@ -60,12 +96,53 @@ yarn global add taskin
|
|
|
60
96
|
|
|
61
97
|
## Commands
|
|
62
98
|
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
99
|
+
- `taskin init` - Initialize Taskin in your project with interactive setup
|
|
100
|
+
- `taskin list` - List all tasks
|
|
101
|
+
- `taskin start <id>` - Start working on a task
|
|
102
|
+
- `taskin pause <id>` - Pause work on a task
|
|
103
|
+
- `taskin finish <id>` - Complete a task
|
|
104
|
+
- `taskin lint` - Validate task files
|
|
105
|
+
|
|
106
|
+
## 📦 Programmatic Usage
|
|
107
|
+
|
|
108
|
+
Taskin can also be used as a library in your TypeScript/JavaScript projects:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npm install taskin
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
import { createTaskin, getTaskin, type ITaskin } from 'taskin';
|
|
116
|
+
|
|
117
|
+
// Create a Taskin instance with custom tasks directory
|
|
118
|
+
const taskin = createTaskin('./my-tasks');
|
|
119
|
+
|
|
120
|
+
// Or use the default instance (uses ./TASKS)
|
|
121
|
+
const taskin = getTaskin();
|
|
122
|
+
|
|
123
|
+
// Use the API
|
|
124
|
+
const tasks = await taskin.list();
|
|
125
|
+
await taskin.start('task-001');
|
|
126
|
+
await taskin.pause('task-001', { message: 'Break time!' });
|
|
127
|
+
await taskin.finish('task-001');
|
|
128
|
+
|
|
129
|
+
// Lint tasks
|
|
130
|
+
const lintResult = await taskin.lint({ path: './TASKS' });
|
|
131
|
+
console.log(`Checked ${lintResult.tasksChecked} tasks`);
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### TypeScript Support
|
|
135
|
+
|
|
136
|
+
Taskin is written in TypeScript and exports full type definitions:
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
import type { Task, TaskId, TaskStatus, ITaskin } from 'taskin';
|
|
140
|
+
|
|
141
|
+
// All types are available for your TypeScript projects
|
|
142
|
+
function processTask(task: Task): void {
|
|
143
|
+
console.log(`Processing ${task.title}`);
|
|
144
|
+
}
|
|
145
|
+
```
|
|
69
146
|
|
|
70
147
|
## 🏗️ Architecture
|
|
71
148
|
|
|
@@ -83,12 +160,12 @@ See [EXAMPLES.md](./EXAMPLES.md) for detailed usage examples and workflows.
|
|
|
83
160
|
|
|
84
161
|
## 🔌 Available Providers
|
|
85
162
|
|
|
86
|
-
| Provider | Status | Package
|
|
87
|
-
| ---------------- | -------------- |
|
|
88
|
-
| 📁 File System | ✅ Stable |
|
|
89
|
-
| 🔴 Redmine | 🚧 Coming Soon |
|
|
90
|
-
| 🔵 Jira | 🚧 Coming Soon |
|
|
91
|
-
| 🐙 GitHub Issues | 🚧 Coming Soon |
|
|
163
|
+
| Provider | Status | Package |
|
|
164
|
+
| ---------------- | -------------- | ----------------------------------- |
|
|
165
|
+
| 📁 File System | ✅ Stable | `@opentask/taskin-fs-provider` |
|
|
166
|
+
| 🔴 Redmine | 🚧 Coming Soon | `@opentask/taskin-redmine-provider` |
|
|
167
|
+
| 🔵 Jira | 🚧 Coming Soon | `@opentask/taskin-jira-provider` |
|
|
168
|
+
| 🐙 GitHub Issues | 🚧 Coming Soon | `@opentask/taskin-github-provider` |
|
|
92
169
|
|
|
93
170
|
Want to create your own provider? See [ARCHITECTURE.md](./ARCHITECTURE.md#-criando-um-novo-provider).
|
|
94
171
|
|
|
@@ -108,10 +185,12 @@ Found a bug? Have a feature request? Please [open an issue](https://github.com/o
|
|
|
108
185
|
## � Team
|
|
109
186
|
|
|
110
187
|
**OpenTask**
|
|
188
|
+
|
|
111
189
|
- Website: [opentask.com.br](https://opentask.com.br)
|
|
112
190
|
- Email: contato@opentask.com.br
|
|
113
191
|
|
|
114
192
|
**Contributors:**
|
|
193
|
+
|
|
115
194
|
- Sidarta Veloso ([@sidartaveloso](https://github.com/sidartaveloso))
|
|
116
195
|
|
|
117
196
|
## 📄 License
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,383 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
2
4
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
+
* Task identifier schema.
|
|
6
|
+
* Represents a unique identifier for a task (UUID format).
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
5
9
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
declare const TaskIdSchema: z.ZodBranded<z.ZodString, "TaskId">;
|
|
11
|
+
/**
|
|
12
|
+
* Runtime validator for task type values.
|
|
13
|
+
* Use this to validate user input or external data.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
declare const TaskTypeSchema: z.ZodEnum<["feat", "fix", "refactor", "docs", "test", "chore"]>;
|
|
18
|
+
/**
|
|
19
|
+
* Runtime validator for task objects.
|
|
20
|
+
* Use this to parse and validate task data from external sources (API, database, forms).
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* // Parse and validate task data
|
|
26
|
+
* const task = TaskSchema.parse(userInput);
|
|
27
|
+
*
|
|
28
|
+
* // Safe parse with error handling
|
|
29
|
+
* const result = TaskSchema.safeParse(untrustedData);
|
|
30
|
+
* if (result.success) {
|
|
31
|
+
* console.log(result.data);
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare const TaskSchema: z.ZodObject<{
|
|
36
|
+
createdAt: z.ZodString;
|
|
37
|
+
id: z.ZodBranded<z.ZodString, "TaskId">;
|
|
38
|
+
status: z.ZodEnum<["pending", "in-progress", "done", "blocked"]>;
|
|
39
|
+
title: z.ZodString;
|
|
40
|
+
type: z.ZodEnum<["feat", "fix", "refactor", "docs", "test", "chore"]>;
|
|
41
|
+
assignee: z.ZodOptional<z.ZodString>;
|
|
42
|
+
completed: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
+
description: z.ZodOptional<z.ZodString>;
|
|
44
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
createdAt: string;
|
|
47
|
+
id: string & z.BRAND<"TaskId">;
|
|
48
|
+
status: "pending" | "in-progress" | "done" | "blocked";
|
|
49
|
+
title: string;
|
|
50
|
+
type: "feat" | "fix" | "refactor" | "docs" | "test" | "chore";
|
|
51
|
+
assignee?: string | undefined;
|
|
52
|
+
completed?: boolean | undefined;
|
|
53
|
+
description?: string | undefined;
|
|
54
|
+
userId?: string | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
createdAt: string;
|
|
57
|
+
id: string;
|
|
58
|
+
status: "pending" | "in-progress" | "done" | "blocked";
|
|
59
|
+
title: string;
|
|
60
|
+
type: "feat" | "fix" | "refactor" | "docs" | "test" | "chore";
|
|
61
|
+
assignee?: string | undefined;
|
|
62
|
+
completed?: boolean | undefined;
|
|
63
|
+
description?: string | undefined;
|
|
64
|
+
userId?: string | undefined;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Runtime validator for user objects.
|
|
68
|
+
* Use this to parse and validate user data from external sources.
|
|
69
|
+
*
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
declare const UserSchema: z.ZodObject<{
|
|
73
|
+
email: z.ZodString;
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
name: z.ZodString;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
id: string;
|
|
78
|
+
email: string;
|
|
79
|
+
name: string;
|
|
80
|
+
}, {
|
|
81
|
+
id: string;
|
|
82
|
+
email: string;
|
|
83
|
+
name: string;
|
|
84
|
+
}>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Taskin Core Interface
|
|
88
|
+
* Main interface for task management operations
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
interface ListTasksOptions {
|
|
92
|
+
assignee?: string;
|
|
93
|
+
status?: string;
|
|
94
|
+
type?: string;
|
|
95
|
+
}
|
|
96
|
+
interface StartTaskOptions {
|
|
97
|
+
base?: string;
|
|
98
|
+
force?: boolean;
|
|
99
|
+
}
|
|
100
|
+
interface PauseTaskOptions {
|
|
101
|
+
message?: string;
|
|
102
|
+
skipCommit?: boolean;
|
|
103
|
+
}
|
|
104
|
+
interface FinishTaskOptions {
|
|
105
|
+
push?: boolean;
|
|
106
|
+
skipUpdate?: boolean;
|
|
107
|
+
}
|
|
108
|
+
interface LintTasksOptions {
|
|
109
|
+
path?: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Validation issue found during task linting
|
|
113
|
+
* Provider-agnostic - works with any task storage backend
|
|
114
|
+
*/
|
|
115
|
+
interface TaskValidationIssue {
|
|
116
|
+
message: string;
|
|
117
|
+
severity: 'error' | 'warning';
|
|
118
|
+
taskId: string;
|
|
119
|
+
line?: number;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Task metadata extracted from task source
|
|
123
|
+
*/
|
|
124
|
+
interface TaskMetadata {
|
|
125
|
+
assignee?: string;
|
|
126
|
+
status?: string;
|
|
127
|
+
type?: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Result of task validation/linting operation
|
|
131
|
+
*/
|
|
132
|
+
interface LintResult {
|
|
133
|
+
errors: TaskValidationIssue[];
|
|
134
|
+
tasksChecked: number;
|
|
135
|
+
valid: boolean;
|
|
136
|
+
warnings: TaskValidationIssue[];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* ITaskin - Core interface for task management system
|
|
140
|
+
*/
|
|
141
|
+
interface ITaskin {
|
|
142
|
+
/**
|
|
143
|
+
* Finish a task
|
|
144
|
+
*/
|
|
145
|
+
finish(taskId: TaskId, options?: FinishTaskOptions): Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Lint/validate tasks from the configured provider
|
|
148
|
+
*/
|
|
149
|
+
lint(options?: LintTasksOptions): Promise<LintResult>;
|
|
150
|
+
/**
|
|
151
|
+
* List all tasks with optional filters
|
|
152
|
+
*/
|
|
153
|
+
list(options?: ListTasksOptions): Promise<Task[]>;
|
|
154
|
+
/**
|
|
155
|
+
* Pause work on a task
|
|
156
|
+
*/
|
|
157
|
+
pause(taskId: TaskId, options?: PauseTaskOptions): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Start working on a task
|
|
160
|
+
*/
|
|
161
|
+
start(taskId: TaskId, options?: StartTaskOptions): Promise<void>;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Unique identifier for a task (UUID branded type).
|
|
165
|
+
* Use this type for type-safe task ID handling across the system.
|
|
166
|
+
*
|
|
167
|
+
* @public
|
|
168
|
+
* @example
|
|
169
|
+
* ```ts
|
|
170
|
+
* function getTask(id: TaskId): Task { ... }
|
|
171
|
+
* const taskId: TaskId = '550e8400-e29b-41d4-a716-446655440000' as TaskId;
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
type TaskId = z.infer<typeof TaskIdSchema>;
|
|
175
|
+
/**
|
|
176
|
+
* Type of task based on the kind of work being performed.
|
|
177
|
+
* Follows conventional commit types for consistency across the codebase.
|
|
178
|
+
*
|
|
179
|
+
* @public
|
|
180
|
+
*/
|
|
181
|
+
type TaskType = z.infer<typeof TaskTypeSchema>;
|
|
182
|
+
/**
|
|
183
|
+
* Represents a task in the Taskin system.
|
|
184
|
+
* Contains all core information needed to track and manage work items.
|
|
185
|
+
*
|
|
186
|
+
* @public
|
|
187
|
+
*/
|
|
188
|
+
type Task = z.infer<typeof TaskSchema>;
|
|
189
|
+
/**
|
|
190
|
+
* Represents a user in the Taskin system.
|
|
191
|
+
* Contains basic user identification and contact information.
|
|
192
|
+
*
|
|
193
|
+
* @public
|
|
194
|
+
*/
|
|
195
|
+
type User = z.infer<typeof UserSchema>;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* A task with additional file system metadata.
|
|
199
|
+
* Extends the base Task type with content and path information.
|
|
200
|
+
* @public
|
|
201
|
+
*/
|
|
202
|
+
type TaskFile = Task & {
|
|
203
|
+
/** The raw markdown content of the task file */
|
|
204
|
+
content: string;
|
|
205
|
+
/** Absolute or relative path to the task file */
|
|
206
|
+
filePath: string;
|
|
207
|
+
/** The type of work this task represents */
|
|
208
|
+
type: TaskType;
|
|
209
|
+
/** Optional user assigned to this task */
|
|
210
|
+
assignee?: User;
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* Interface for task storage providers.
|
|
214
|
+
* Implementations handle reading and writing tasks from different sources
|
|
215
|
+
* (e.g., file system, database, API).
|
|
216
|
+
* @public
|
|
217
|
+
*/
|
|
218
|
+
interface ITaskProvider {
|
|
219
|
+
/**
|
|
220
|
+
* Find a specific task by its ID.
|
|
221
|
+
* @param taskId - The unique identifier of the task
|
|
222
|
+
* @returns The task if found, undefined otherwise
|
|
223
|
+
*/
|
|
224
|
+
findTask(taskId: string): Promise<TaskFile | undefined>;
|
|
225
|
+
/**
|
|
226
|
+
* Retrieve all tasks from the provider.
|
|
227
|
+
* @returns Array of all tasks
|
|
228
|
+
*/
|
|
229
|
+
getAllTasks(): Promise<TaskFile[]>;
|
|
230
|
+
/**
|
|
231
|
+
* Update an existing task.
|
|
232
|
+
* @param task - The task with updated information
|
|
233
|
+
*/
|
|
234
|
+
updateTask(task: TaskFile): Promise<void>;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Interface for task management operations.
|
|
238
|
+
* Provides high-level methods for managing task workflow and state transitions.
|
|
239
|
+
* @public
|
|
240
|
+
*/
|
|
241
|
+
interface ITaskManager {
|
|
242
|
+
/**
|
|
243
|
+
* Mark a task as finished.
|
|
244
|
+
* Transitions the task to 'done' status.
|
|
245
|
+
* @param taskId - The unique identifier of the task
|
|
246
|
+
* @returns The updated task
|
|
247
|
+
* @throws Error if task is not found
|
|
248
|
+
*/
|
|
249
|
+
finishTask(taskId: string): Promise<TaskFile>;
|
|
250
|
+
/**
|
|
251
|
+
* Start working on a task.
|
|
252
|
+
* Transitions the task to 'in-progress' status.
|
|
253
|
+
* @param taskId - The unique identifier of the task
|
|
254
|
+
* @returns The updated task
|
|
255
|
+
* @throws Error if task is not found, already in progress, or already done
|
|
256
|
+
*/
|
|
257
|
+
startTask(taskId: string): Promise<TaskFile>;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
declare class TaskManager implements ITaskManager {
|
|
261
|
+
private taskProvider;
|
|
262
|
+
constructor(taskProvider: ITaskProvider);
|
|
263
|
+
startTask(taskId: string): Promise<TaskFile>;
|
|
264
|
+
finishTask(taskId: string): Promise<TaskFile>;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
declare class FileSystemTaskProvider implements ITaskProvider {
|
|
268
|
+
private tasksDirectory;
|
|
269
|
+
constructor(tasksDirectory: string);
|
|
270
|
+
findTask(taskId: string): Promise<TaskFile | undefined>;
|
|
271
|
+
updateTask(task: TaskFile): Promise<void>;
|
|
272
|
+
getAllTasks(): Promise<TaskFile[]>;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* FileSystem task linter types
|
|
277
|
+
* Re-exports from @opentask/taskin-types + FileSystem-specific extensions
|
|
278
|
+
*/
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* FileSystem-specific validation error
|
|
282
|
+
* Extends TaskValidationIssue with file-specific information
|
|
283
|
+
*/
|
|
284
|
+
interface FileValidationError extends Omit<TaskValidationIssue, 'taskId'> {
|
|
285
|
+
file: string;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* FileSystem-specific lint result
|
|
289
|
+
* Contains file-based validation results
|
|
290
|
+
*/
|
|
291
|
+
interface FileLintResult {
|
|
292
|
+
errors: FileValidationError[];
|
|
293
|
+
filesChecked: number;
|
|
294
|
+
valid: boolean;
|
|
295
|
+
warnings: FileValidationError[];
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* FileSystem-specific task linter interface
|
|
299
|
+
* Defines validation operations for file-based task providers
|
|
300
|
+
*/
|
|
301
|
+
interface IFileSystemTaskLinter {
|
|
302
|
+
/**
|
|
303
|
+
* Lint all task files in a directory
|
|
304
|
+
* @param tasksDir - Directory containing task markdown files
|
|
305
|
+
* @returns Validation results for all files
|
|
306
|
+
*/
|
|
307
|
+
lintDirectory(tasksDir: string): Promise<FileLintResult>;
|
|
308
|
+
/**
|
|
309
|
+
* Lint a single task file
|
|
310
|
+
* @param filePath - Path to the task markdown file
|
|
311
|
+
* @returns Array of validation errors found in the file
|
|
312
|
+
*/
|
|
313
|
+
lintFile(filePath: string): Promise<FileValidationError[]>;
|
|
314
|
+
/**
|
|
315
|
+
* Validate task metadata
|
|
316
|
+
* @param metadata - Task metadata to validate
|
|
317
|
+
* @param fileName - Name of the file being validated
|
|
318
|
+
* @returns Array of validation errors
|
|
319
|
+
*/
|
|
320
|
+
validateMetadata(metadata: Record<string, unknown>, fileName: string): FileValidationError[];
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* FileSystem-specific task linter implementation
|
|
325
|
+
* Validates task markdown files in the local filesystem
|
|
326
|
+
*/
|
|
327
|
+
declare class FileSystemTaskLinter implements IFileSystemTaskLinter {
|
|
328
|
+
private errors;
|
|
329
|
+
private addError;
|
|
330
|
+
/**
|
|
331
|
+
* Validate task file name format (FileSystem-specific)
|
|
332
|
+
*/
|
|
333
|
+
validateFileName(fileName: string): FileValidationError | null;
|
|
334
|
+
private extractMetadata;
|
|
335
|
+
/**
|
|
336
|
+
* Validate task metadata (FileSystem-specific)
|
|
337
|
+
*/
|
|
338
|
+
validateMetadata(metadata: TaskMetadata, filePath: string): FileValidationError[];
|
|
339
|
+
private validateContent;
|
|
340
|
+
/**
|
|
341
|
+
* Lint a single task file (FileSystem-specific)
|
|
342
|
+
*/
|
|
343
|
+
lintFile(filePath: string): Promise<FileValidationError[]>;
|
|
344
|
+
/**
|
|
345
|
+
* Lint all task files in the specified directory (FileSystem-specific)
|
|
346
|
+
*/
|
|
347
|
+
lintDirectory(tasksDir: string): Promise<FileLintResult>;
|
|
348
|
+
static printResults(result: FileLintResult): void;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Taskin - Concrete implementation of ITaskin
|
|
353
|
+
* Main class that implements task management with dependency injection
|
|
354
|
+
*/
|
|
355
|
+
|
|
356
|
+
declare class Taskin implements ITaskin {
|
|
357
|
+
private readonly taskProvider;
|
|
358
|
+
private readonly taskManager;
|
|
359
|
+
private readonly linter;
|
|
360
|
+
constructor(taskProvider: FileSystemTaskProvider, taskManager: TaskManager, linter: FileSystemTaskLinter);
|
|
361
|
+
list(options?: ListTasksOptions): Promise<Task[]>;
|
|
362
|
+
start(taskId: TaskId, options?: StartTaskOptions): Promise<void>;
|
|
363
|
+
pause(taskId: TaskId, options?: PauseTaskOptions): Promise<void>;
|
|
364
|
+
finish(taskId: TaskId, _options?: FinishTaskOptions): Promise<void>;
|
|
365
|
+
lint(options?: LintTasksOptions): Promise<LintResult>;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Main entry point for Taskin CLI
|
|
370
|
+
* Handles dependency injection and initialization
|
|
371
|
+
*/
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Factory function to create a configured Taskin instance
|
|
375
|
+
*/
|
|
376
|
+
declare function createTaskin(tasksDir?: string): Taskin;
|
|
377
|
+
/**
|
|
378
|
+
* Get the default Taskin instance
|
|
379
|
+
* Uses current working directory TASKS folder
|
|
380
|
+
*/
|
|
381
|
+
declare function getTaskin(): Taskin;
|
|
382
|
+
|
|
383
|
+
export { type ITaskin, Taskin, createTaskin, getTaskin };
|