@task-mcp/shared 1.0.6 → 1.0.7
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/schemas/inbox.d.ts +49 -18
- package/dist/schemas/inbox.d.ts.map +1 -1
- package/dist/schemas/inbox.js +16 -16
- package/dist/schemas/inbox.js.map +1 -1
- package/dist/schemas/project.d.ts +154 -41
- package/dist/schemas/project.d.ts.map +1 -1
- package/dist/schemas/project.js +38 -33
- package/dist/schemas/project.js.map +1 -1
- package/dist/schemas/response-format.d.ts +3 -2
- package/dist/schemas/response-format.d.ts.map +1 -1
- package/dist/schemas/response-format.js +2 -2
- package/dist/schemas/response-format.js.map +1 -1
- package/dist/schemas/task.d.ts +588 -147
- package/dist/schemas/task.d.ts.map +1 -1
- package/dist/schemas/task.js +114 -88
- package/dist/schemas/task.js.map +1 -1
- package/dist/schemas/view.d.ts +128 -37
- package/dist/schemas/view.d.ts.map +1 -1
- package/dist/schemas/view.js +38 -24
- package/dist/schemas/view.js.map +1 -1
- package/package.json +2 -2
- package/src/schemas/inbox.ts +20 -20
- package/src/schemas/project.ts +43 -40
- package/src/schemas/response-format.ts +3 -3
- package/src/schemas/task.ts +128 -110
- package/src/schemas/view.ts +43 -33
package/src/schemas/inbox.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
// Inbox item status
|
|
4
|
-
export const InboxStatus =
|
|
5
|
-
export type InboxStatus = typeof InboxStatus
|
|
4
|
+
export const InboxStatus = z.enum(["pending", "promoted", "discarded"]);
|
|
5
|
+
export type InboxStatus = z.infer<typeof InboxStatus>;
|
|
6
6
|
|
|
7
7
|
// Inbox item schema - lightweight idea/memo capture
|
|
8
|
-
export const InboxItem =
|
|
9
|
-
id:
|
|
10
|
-
content:
|
|
11
|
-
capturedAt:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
export const InboxItem = z.object({
|
|
9
|
+
id: z.string(),
|
|
10
|
+
content: z.string(), // The memo/idea content
|
|
11
|
+
capturedAt: z.string(), // ISO timestamp
|
|
12
|
+
source: z.string().optional(), // Origin: 'cli', 'mcp', 'api', etc.
|
|
13
|
+
tags: z.array(z.string()).optional(), // Simple tags for organization
|
|
14
|
+
promotedToTaskId: z.string().optional(), // Task ID if promoted
|
|
15
15
|
status: InboxStatus,
|
|
16
16
|
});
|
|
17
|
-
export type InboxItem = typeof InboxItem
|
|
17
|
+
export type InboxItem = z.infer<typeof InboxItem>;
|
|
18
18
|
|
|
19
19
|
// Inbox item creation input (minimal)
|
|
20
|
-
export const InboxCreateInput =
|
|
21
|
-
content:
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
export const InboxCreateInput = z.object({
|
|
21
|
+
content: z.string(),
|
|
22
|
+
source: z.string().optional(),
|
|
23
|
+
tags: z.array(z.string()).optional(),
|
|
24
24
|
});
|
|
25
|
-
export type InboxCreateInput = typeof InboxCreateInput
|
|
25
|
+
export type InboxCreateInput = z.infer<typeof InboxCreateInput>;
|
|
26
26
|
|
|
27
27
|
// Inbox item update input
|
|
28
|
-
export const InboxUpdateInput =
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
export const InboxUpdateInput = z.object({
|
|
29
|
+
content: z.string().optional(),
|
|
30
|
+
tags: z.array(z.string()).optional(),
|
|
31
31
|
});
|
|
32
|
-
export type InboxUpdateInput = typeof InboxUpdateInput
|
|
32
|
+
export type InboxUpdateInput = z.infer<typeof InboxUpdateInput>;
|
package/src/schemas/project.ts
CHANGED
|
@@ -1,62 +1,65 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
import { Priority } from "./task.js";
|
|
3
3
|
|
|
4
4
|
// Project status
|
|
5
|
-
export const ProjectStatus =
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export const ProjectStatus = z.enum([
|
|
6
|
+
"active",
|
|
7
|
+
"on_hold",
|
|
8
|
+
"completed",
|
|
9
|
+
"archived",
|
|
10
|
+
]);
|
|
11
|
+
export type ProjectStatus = z.infer<typeof ProjectStatus>;
|
|
9
12
|
|
|
10
13
|
// Context definition
|
|
11
|
-
export const Context =
|
|
12
|
-
name:
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
export const Context = z.object({
|
|
15
|
+
name: z.string(),
|
|
16
|
+
color: z.string().optional(), // hex color
|
|
17
|
+
description: z.string().optional(),
|
|
15
18
|
});
|
|
16
|
-
export type Context = typeof Context
|
|
19
|
+
export type Context = z.infer<typeof Context>;
|
|
17
20
|
|
|
18
21
|
// Project schema
|
|
19
|
-
export const Project =
|
|
20
|
-
id:
|
|
21
|
-
name:
|
|
22
|
-
|
|
22
|
+
export const Project = z.object({
|
|
23
|
+
id: z.string(),
|
|
24
|
+
name: z.string(),
|
|
25
|
+
description: z.string().optional(),
|
|
23
26
|
status: ProjectStatus,
|
|
24
27
|
|
|
25
28
|
// Project-level settings
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
defaultPriority: Priority.optional(),
|
|
30
|
+
contexts: z.array(Context).optional(),
|
|
28
31
|
|
|
29
32
|
// Metadata
|
|
30
|
-
createdAt:
|
|
31
|
-
updatedAt:
|
|
32
|
-
|
|
33
|
+
createdAt: z.string(),
|
|
34
|
+
updatedAt: z.string(),
|
|
35
|
+
targetDate: z.string().optional(),
|
|
33
36
|
|
|
34
37
|
// Computed stats
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
completionPercentage: z.number().optional(),
|
|
39
|
+
criticalPathLength: z.number().optional(), // Total minutes on critical path
|
|
40
|
+
blockedTaskCount: z.number().optional(),
|
|
41
|
+
totalTasks: z.number().optional(),
|
|
42
|
+
completedTasks: z.number().optional(),
|
|
40
43
|
});
|
|
41
|
-
export type Project = typeof Project
|
|
44
|
+
export type Project = z.infer<typeof Project>;
|
|
42
45
|
|
|
43
46
|
// Project creation input
|
|
44
|
-
export const ProjectCreateInput =
|
|
45
|
-
name:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
export const ProjectCreateInput = z.object({
|
|
48
|
+
name: z.string(),
|
|
49
|
+
description: z.string().optional(),
|
|
50
|
+
defaultPriority: Priority.optional(),
|
|
51
|
+
contexts: z.array(Context).optional(),
|
|
52
|
+
targetDate: z.string().optional(),
|
|
50
53
|
});
|
|
51
|
-
export type ProjectCreateInput = typeof ProjectCreateInput
|
|
54
|
+
export type ProjectCreateInput = z.infer<typeof ProjectCreateInput>;
|
|
52
55
|
|
|
53
56
|
// Project update input
|
|
54
|
-
export const ProjectUpdateInput =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
export const ProjectUpdateInput = z.object({
|
|
58
|
+
name: z.string().optional(),
|
|
59
|
+
description: z.string().optional(),
|
|
60
|
+
status: ProjectStatus.optional(),
|
|
61
|
+
defaultPriority: Priority.optional(),
|
|
62
|
+
contexts: z.array(Context).optional(),
|
|
63
|
+
targetDate: z.string().optional(),
|
|
61
64
|
});
|
|
62
|
-
export type ProjectUpdateInput = typeof ProjectUpdateInput
|
|
65
|
+
export type ProjectUpdateInput = z.infer<typeof ProjectUpdateInput>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Response Format Schema
|
|
@@ -12,8 +12,8 @@ import { type } from "arktype";
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
// Response format options
|
|
15
|
-
export const ResponseFormat =
|
|
16
|
-
export type ResponseFormat = typeof ResponseFormat
|
|
15
|
+
export const ResponseFormat = z.enum(["concise", "standard", "detailed"]);
|
|
16
|
+
export type ResponseFormat = z.infer<typeof ResponseFormat>;
|
|
17
17
|
|
|
18
18
|
// Default limits for pagination
|
|
19
19
|
export const DEFAULT_LIMIT = 20;
|
package/src/schemas/task.ts
CHANGED
|
@@ -1,166 +1,184 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
// Priority levels
|
|
4
|
-
export const Priority =
|
|
5
|
-
export type Priority = typeof Priority
|
|
4
|
+
export const Priority = z.enum(["critical", "high", "medium", "low"]);
|
|
5
|
+
export type Priority = z.infer<typeof Priority>;
|
|
6
6
|
|
|
7
7
|
// Task status with clear state machine
|
|
8
|
-
export const TaskStatus =
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
export const TaskStatus = z.enum([
|
|
9
|
+
"pending",
|
|
10
|
+
"in_progress",
|
|
11
|
+
"blocked",
|
|
12
|
+
"completed",
|
|
13
|
+
"cancelled",
|
|
14
|
+
]);
|
|
15
|
+
export type TaskStatus = z.infer<typeof TaskStatus>;
|
|
12
16
|
|
|
13
17
|
// Dependency relationship types
|
|
14
|
-
export const DependencyType =
|
|
15
|
-
|
|
16
|
-
);
|
|
17
|
-
export type DependencyType = typeof DependencyType.infer;
|
|
18
|
+
export const DependencyType = z.enum(["blocks", "blocked_by", "related"]);
|
|
19
|
+
export type DependencyType = z.infer<typeof DependencyType>;
|
|
18
20
|
|
|
19
21
|
// A single dependency link
|
|
20
|
-
export const Dependency =
|
|
21
|
-
taskId:
|
|
22
|
+
export const Dependency = z.object({
|
|
23
|
+
taskId: z.string(),
|
|
22
24
|
type: DependencyType,
|
|
23
|
-
|
|
25
|
+
reason: z.string().optional(),
|
|
24
26
|
});
|
|
25
|
-
export type Dependency = typeof Dependency
|
|
27
|
+
export type Dependency = z.infer<typeof Dependency>;
|
|
26
28
|
|
|
27
29
|
// Time estimation
|
|
28
|
-
export const TimeEstimate =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
export const TimeEstimate = z.object({
|
|
31
|
+
optimistic: z.number().optional(), // minutes
|
|
32
|
+
expected: z.number().optional(), // minutes
|
|
33
|
+
pessimistic: z.number().optional(), // minutes
|
|
34
|
+
confidence: z.enum(["low", "medium", "high"]).optional(),
|
|
33
35
|
});
|
|
34
|
-
export type TimeEstimate = typeof TimeEstimate
|
|
36
|
+
export type TimeEstimate = z.infer<typeof TimeEstimate>;
|
|
35
37
|
|
|
36
38
|
// Recurrence pattern
|
|
37
|
-
export const Recurrence =
|
|
38
|
-
pattern: "
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
export const Recurrence = z.object({
|
|
40
|
+
pattern: z.enum(["daily", "weekly", "monthly", "after_completion"]),
|
|
41
|
+
interval: z.number().optional(), // every N days/weeks/months
|
|
42
|
+
daysOfWeek: z.array(z.number()).optional(), // 0-6 for weekly
|
|
43
|
+
endDate: z.string().optional(),
|
|
42
44
|
});
|
|
43
|
-
export type Recurrence = typeof Recurrence
|
|
45
|
+
export type Recurrence = z.infer<typeof Recurrence>;
|
|
44
46
|
|
|
45
47
|
// Complexity factors that contribute to task difficulty
|
|
46
|
-
export const ComplexityFactor =
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
export const ComplexityFactor = z.enum([
|
|
49
|
+
"cross_cutting",
|
|
50
|
+
"state_management",
|
|
51
|
+
"error_handling",
|
|
52
|
+
"performance",
|
|
53
|
+
"security",
|
|
54
|
+
"external_dependency",
|
|
55
|
+
"data_migration",
|
|
56
|
+
"breaking_change",
|
|
57
|
+
"unclear_requirements",
|
|
58
|
+
"coordination",
|
|
59
|
+
]);
|
|
60
|
+
export type ComplexityFactor = z.infer<typeof ComplexityFactor>;
|
|
50
61
|
|
|
51
62
|
// Complexity analysis result (populated by Claude)
|
|
52
|
-
export const ComplexityAnalysis =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
63
|
+
export const ComplexityAnalysis = z.object({
|
|
64
|
+
score: z.number().optional(), // 1-10 complexity score
|
|
65
|
+
factors: z.array(ComplexityFactor).optional(),
|
|
66
|
+
suggestedSubtasks: z.number().optional(), // 0-10 recommended subtask count
|
|
67
|
+
rationale: z.string().optional(),
|
|
68
|
+
analyzedAt: z.string().optional(),
|
|
58
69
|
});
|
|
59
|
-
export type ComplexityAnalysis = typeof ComplexityAnalysis
|
|
70
|
+
export type ComplexityAnalysis = z.infer<typeof ComplexityAnalysis>;
|
|
60
71
|
|
|
61
72
|
// Tech area categories for ordering
|
|
62
|
-
export const TechArea =
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
export const TechArea = z.enum([
|
|
74
|
+
"schema",
|
|
75
|
+
"backend",
|
|
76
|
+
"frontend",
|
|
77
|
+
"infra",
|
|
78
|
+
"devops",
|
|
79
|
+
"test",
|
|
80
|
+
"docs",
|
|
81
|
+
"refactor",
|
|
82
|
+
]);
|
|
83
|
+
export type TechArea = z.infer<typeof TechArea>;
|
|
66
84
|
|
|
67
85
|
// Risk level for changes
|
|
68
|
-
export const RiskLevel =
|
|
69
|
-
export type RiskLevel = typeof RiskLevel
|
|
86
|
+
export const RiskLevel = z.enum(["low", "medium", "high", "critical"]);
|
|
87
|
+
export type RiskLevel = z.infer<typeof RiskLevel>;
|
|
70
88
|
|
|
71
89
|
// Tech stack analysis result (populated by Claude)
|
|
72
|
-
export const TechStackAnalysis =
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
90
|
+
export const TechStackAnalysis = z.object({
|
|
91
|
+
areas: z.array(TechArea).optional(),
|
|
92
|
+
hasBreakingChange: z.boolean().optional(),
|
|
93
|
+
riskLevel: RiskLevel.optional(),
|
|
94
|
+
affectedComponents: z.array(z.string()).optional(),
|
|
95
|
+
rationale: z.string().optional(),
|
|
96
|
+
analyzedAt: z.string().optional(),
|
|
79
97
|
});
|
|
80
|
-
export type TechStackAnalysis = typeof TechStackAnalysis
|
|
98
|
+
export type TechStackAnalysis = z.infer<typeof TechStackAnalysis>;
|
|
81
99
|
|
|
82
100
|
// Core Task schema
|
|
83
|
-
export const Task =
|
|
84
|
-
id:
|
|
85
|
-
title:
|
|
86
|
-
|
|
101
|
+
export const Task = z.object({
|
|
102
|
+
id: z.string(),
|
|
103
|
+
title: z.string(),
|
|
104
|
+
description: z.string().optional(),
|
|
87
105
|
status: TaskStatus,
|
|
88
106
|
priority: Priority,
|
|
89
|
-
projectId:
|
|
107
|
+
projectId: z.string(),
|
|
90
108
|
|
|
91
109
|
// Hierarchy (subtask support)
|
|
92
|
-
|
|
93
|
-
|
|
110
|
+
parentId: z.string().nullable().optional(), // Parent task ID for subtasks (null to unlink)
|
|
111
|
+
level: z.number().optional(), // Hierarchy depth (0=root, 1=subtask, 2=sub-subtask, max 3)
|
|
94
112
|
|
|
95
113
|
// Dependencies
|
|
96
|
-
|
|
114
|
+
dependencies: z.array(Dependency).optional(),
|
|
97
115
|
|
|
98
116
|
// Time tracking
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
117
|
+
estimate: TimeEstimate.optional(),
|
|
118
|
+
actualMinutes: z.number().optional(),
|
|
119
|
+
dueDate: z.string().optional(), // ISO date string
|
|
120
|
+
startDate: z.string().optional(), // When task can start
|
|
121
|
+
startedAt: z.string().optional(),
|
|
122
|
+
completedAt: z.string().optional(),
|
|
105
123
|
|
|
106
124
|
// Organization
|
|
107
|
-
|
|
108
|
-
|
|
125
|
+
contexts: z.array(z.string()).optional(), // e.g., ["focus", "review"]
|
|
126
|
+
tags: z.array(z.string()).optional(),
|
|
109
127
|
|
|
110
128
|
// Recurrence
|
|
111
|
-
|
|
129
|
+
recurrence: Recurrence.optional(),
|
|
112
130
|
|
|
113
131
|
// Metadata
|
|
114
|
-
createdAt:
|
|
115
|
-
updatedAt:
|
|
132
|
+
createdAt: z.string(),
|
|
133
|
+
updatedAt: z.string(),
|
|
116
134
|
|
|
117
135
|
// Computed fields (populated at runtime)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
136
|
+
criticalPath: z.boolean().optional(),
|
|
137
|
+
slack: z.number().optional(), // Minutes of slack time
|
|
138
|
+
earliestStart: z.number().optional(), // Minutes from project start
|
|
139
|
+
latestStart: z.number().optional(),
|
|
122
140
|
|
|
123
141
|
// Analysis fields (populated by Claude)
|
|
124
|
-
|
|
125
|
-
|
|
142
|
+
complexity: ComplexityAnalysis.optional(),
|
|
143
|
+
techStack: TechStackAnalysis.optional(),
|
|
126
144
|
});
|
|
127
|
-
export type Task = typeof Task
|
|
145
|
+
export type Task = z.infer<typeof Task>;
|
|
128
146
|
|
|
129
147
|
// Task creation input (minimal required fields)
|
|
130
|
-
export const TaskCreateInput =
|
|
131
|
-
title:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
148
|
+
export const TaskCreateInput = z.object({
|
|
149
|
+
title: z.string(),
|
|
150
|
+
description: z.string().optional(),
|
|
151
|
+
projectId: z.string().optional(),
|
|
152
|
+
priority: Priority.optional(),
|
|
153
|
+
parentId: z.string().nullable().optional(), // Parent task ID for creating subtasks (null to unlink)
|
|
154
|
+
dependencies: z.array(Dependency).optional(),
|
|
155
|
+
estimate: TimeEstimate.optional(),
|
|
156
|
+
dueDate: z.string().optional(),
|
|
157
|
+
startDate: z.string().optional(),
|
|
158
|
+
contexts: z.array(z.string()).optional(),
|
|
159
|
+
tags: z.array(z.string()).optional(),
|
|
160
|
+
recurrence: Recurrence.optional(),
|
|
143
161
|
});
|
|
144
|
-
export type TaskCreateInput = typeof TaskCreateInput
|
|
162
|
+
export type TaskCreateInput = z.infer<typeof TaskCreateInput>;
|
|
145
163
|
|
|
146
164
|
// Task update input
|
|
147
|
-
export const TaskUpdateInput =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
165
|
+
export const TaskUpdateInput = z.object({
|
|
166
|
+
title: z.string().optional(),
|
|
167
|
+
description: z.string().optional(),
|
|
168
|
+
status: TaskStatus.optional(),
|
|
169
|
+
priority: Priority.optional(),
|
|
170
|
+
projectId: z.string().optional(),
|
|
171
|
+
parentId: z.string().nullable().optional(), // Parent task ID for moving task in hierarchy (null to unlink)
|
|
172
|
+
dependencies: z.array(Dependency).optional(),
|
|
173
|
+
estimate: TimeEstimate.optional(),
|
|
174
|
+
actualMinutes: z.number().optional(),
|
|
175
|
+
dueDate: z.string().optional(),
|
|
176
|
+
startDate: z.string().optional(),
|
|
177
|
+
contexts: z.array(z.string()).optional(),
|
|
178
|
+
tags: z.array(z.string()).optional(),
|
|
179
|
+
recurrence: Recurrence.optional(),
|
|
162
180
|
// Analysis fields
|
|
163
|
-
|
|
164
|
-
|
|
181
|
+
complexity: ComplexityAnalysis.optional(),
|
|
182
|
+
techStack: TechStackAnalysis.optional(),
|
|
165
183
|
});
|
|
166
|
-
export type TaskUpdateInput = typeof TaskUpdateInput
|
|
184
|
+
export type TaskUpdateInput = z.infer<typeof TaskUpdateInput>;
|
package/src/schemas/view.ts
CHANGED
|
@@ -1,46 +1,56 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
import { Priority, TaskStatus } from "./task.js";
|
|
3
3
|
|
|
4
4
|
// Smart View filter
|
|
5
|
-
export const SmartViewFilter =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
export const SmartViewFilter = z.object({
|
|
6
|
+
statuses: z.array(TaskStatus).optional(),
|
|
7
|
+
priorities: z.array(Priority).optional(),
|
|
8
|
+
contexts: z.array(z.string()).optional(),
|
|
9
|
+
tags: z.array(z.string()).optional(),
|
|
10
|
+
projectIds: z.array(z.string()).optional(),
|
|
11
|
+
dueBefore: z.string().optional(),
|
|
12
|
+
dueAfter: z.string().optional(),
|
|
13
|
+
isBlocked: z.boolean().optional(),
|
|
14
|
+
isCriticalPath: z.boolean().optional(),
|
|
15
|
+
hasNoDependencies: z.boolean().optional(),
|
|
16
|
+
search: z.string().optional(), // Search in title/description
|
|
17
17
|
});
|
|
18
|
-
export type SmartViewFilter = typeof SmartViewFilter
|
|
18
|
+
export type SmartViewFilter = z.infer<typeof SmartViewFilter>;
|
|
19
19
|
|
|
20
20
|
// Sort options
|
|
21
|
-
export const SortField =
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
export const SortField = z.enum([
|
|
22
|
+
"priority",
|
|
23
|
+
"dueDate",
|
|
24
|
+
"createdAt",
|
|
25
|
+
"criticalPath",
|
|
26
|
+
"slack",
|
|
27
|
+
"title",
|
|
28
|
+
]);
|
|
29
|
+
export type SortField = z.infer<typeof SortField>;
|
|
25
30
|
|
|
26
|
-
export const SortOrder =
|
|
27
|
-
export type SortOrder = typeof SortOrder
|
|
31
|
+
export const SortOrder = z.enum(["asc", "desc"]);
|
|
32
|
+
export type SortOrder = z.infer<typeof SortOrder>;
|
|
28
33
|
|
|
29
34
|
// Smart View definition
|
|
30
|
-
export const SmartView =
|
|
31
|
-
id:
|
|
32
|
-
name:
|
|
33
|
-
|
|
35
|
+
export const SmartView = z.object({
|
|
36
|
+
id: z.string(),
|
|
37
|
+
name: z.string(),
|
|
38
|
+
description: z.string().optional(),
|
|
34
39
|
filter: SmartViewFilter,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
createdAt:
|
|
38
|
-
updatedAt:
|
|
40
|
+
sortBy: SortField.optional(),
|
|
41
|
+
sortOrder: SortOrder.optional(),
|
|
42
|
+
createdAt: z.string(),
|
|
43
|
+
updatedAt: z.string(),
|
|
39
44
|
});
|
|
40
|
-
export type SmartView = typeof SmartView
|
|
45
|
+
export type SmartView = z.infer<typeof SmartView>;
|
|
41
46
|
|
|
42
47
|
// Built-in view names
|
|
43
|
-
export const BuiltInView =
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
export const BuiltInView = z.enum([
|
|
49
|
+
"today",
|
|
50
|
+
"this_week",
|
|
51
|
+
"blocked",
|
|
52
|
+
"critical_path",
|
|
53
|
+
"quick_wins",
|
|
54
|
+
"all",
|
|
55
|
+
]);
|
|
56
|
+
export type BuiltInView = z.infer<typeof BuiltInView>;
|