@vibetasks/core 0.5.3 → 0.5.5
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.d.ts +84 -14
- package/dist/index.js +106 -2
- package/package.json +48 -47
package/dist/index.d.ts
CHANGED
|
@@ -140,17 +140,24 @@ interface SupabaseConfig {
|
|
|
140
140
|
* @param config - Supabase configuration including URL, key, and optional access token
|
|
141
141
|
* @returns Configured Supabase client
|
|
142
142
|
*/
|
|
143
|
-
declare function createSupabaseClient(config: SupabaseConfig): SupabaseClient
|
|
143
|
+
declare function createSupabaseClient(config: SupabaseConfig): SupabaseClient<any, "public", "vibetasks", any, any>;
|
|
144
144
|
/**
|
|
145
145
|
* Create a Supabase client from environment variables
|
|
146
146
|
*
|
|
147
147
|
* @returns Configured Supabase client
|
|
148
148
|
* @throws Error if environment variables are not set
|
|
149
149
|
*/
|
|
150
|
-
declare function createSupabaseClientFromEnv(): SupabaseClient
|
|
150
|
+
declare function createSupabaseClientFromEnv(): SupabaseClient<any, "public", "vibetasks", any, any>;
|
|
151
151
|
|
|
152
|
-
type TaskFilter = 'all' | 'today' | 'upcoming' | 'completed';
|
|
152
|
+
type TaskFilter = 'all' | 'today' | 'upcoming' | 'completed' | 'archived';
|
|
153
153
|
type TaskPriority = 'none' | 'low' | 'medium' | 'high';
|
|
154
|
+
type TaskStatus = 'todo' | 'vibing' | 'done' | 'archived';
|
|
155
|
+
type EnergyLevel = 'low' | 'medium' | 'high';
|
|
156
|
+
/**
|
|
157
|
+
* Source type - where the task originated from
|
|
158
|
+
* Matches TaskSourceType in @vibetasks/shared
|
|
159
|
+
*/
|
|
160
|
+
type SourceType = 'manual' | 'github_bug' | 'github_feedback' | 'email_bug' | 'email_feedback' | 'slack_bug' | 'slack_feedback' | 'sentry_error' | 'browser_extension' | 'vscode_extension' | 'cli' | 'mcp' | 'github_action' | 'sentry' | 'ci';
|
|
154
161
|
interface Tag {
|
|
155
162
|
id: string;
|
|
156
163
|
user_id?: string;
|
|
@@ -158,14 +165,6 @@ interface Tag {
|
|
|
158
165
|
color: string;
|
|
159
166
|
created_at?: string;
|
|
160
167
|
}
|
|
161
|
-
/**
|
|
162
|
-
* Task status - simple 3-state flow + archive for VibeTasks
|
|
163
|
-
* - todo: Not started yet, waiting in backlog
|
|
164
|
-
* - vibing: Currently in progress (actively working on it)
|
|
165
|
-
* - done: Completed
|
|
166
|
-
* - archived: Archived (hidden from default views)
|
|
167
|
-
*/
|
|
168
|
-
type TaskStatus = 'todo' | 'vibing' | 'done' | 'archived';
|
|
169
168
|
interface Subtask {
|
|
170
169
|
id: string;
|
|
171
170
|
title: string;
|
|
@@ -175,13 +174,21 @@ interface Subtask {
|
|
|
175
174
|
interface Attachment {
|
|
176
175
|
id: string;
|
|
177
176
|
task_id: string;
|
|
177
|
+
user_id?: string;
|
|
178
178
|
file_name: string;
|
|
179
|
+
file_size?: number;
|
|
179
180
|
file_type: string;
|
|
180
181
|
storage_path: string;
|
|
182
|
+
url?: string;
|
|
181
183
|
is_image?: boolean;
|
|
182
184
|
alt_text?: string;
|
|
183
185
|
ai_description?: string;
|
|
186
|
+
created_at?: string;
|
|
184
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Task interface - comprehensive type matching @vibetasks/shared
|
|
190
|
+
* All fields are optional except id and title for flexibility in operations
|
|
191
|
+
*/
|
|
185
192
|
interface Task {
|
|
186
193
|
id: string;
|
|
187
194
|
user_id?: string;
|
|
@@ -211,7 +218,45 @@ interface Task {
|
|
|
211
218
|
project_tag?: string;
|
|
212
219
|
created_by?: 'ai' | 'human';
|
|
213
220
|
context_notes?: string;
|
|
214
|
-
energy_required?:
|
|
221
|
+
energy_required?: EnergyLevel;
|
|
222
|
+
source_type?: SourceType;
|
|
223
|
+
github_issue_id?: number | string;
|
|
224
|
+
github_issue_number?: number;
|
|
225
|
+
github_repo?: string;
|
|
226
|
+
github_url?: string;
|
|
227
|
+
github_labels?: string[];
|
|
228
|
+
github_author?: string;
|
|
229
|
+
email_message_id?: string;
|
|
230
|
+
email_from?: string;
|
|
231
|
+
email_subject?: string;
|
|
232
|
+
email_received_at?: string;
|
|
233
|
+
slack_message_id?: string;
|
|
234
|
+
slack_channel?: string;
|
|
235
|
+
slack_user?: string;
|
|
236
|
+
slack_ts?: string;
|
|
237
|
+
slack_thread_ts?: string;
|
|
238
|
+
slack_url?: string;
|
|
239
|
+
sentry_issue_id?: string;
|
|
240
|
+
sentry_project?: string;
|
|
241
|
+
sentry_error_count?: number;
|
|
242
|
+
sentry_first_seen?: string;
|
|
243
|
+
sentry_last_seen?: string;
|
|
244
|
+
sentry_level?: 'fatal' | 'error' | 'warning' | 'info' | 'debug';
|
|
245
|
+
sentry_url?: string;
|
|
246
|
+
error_context?: {
|
|
247
|
+
raw_text: string;
|
|
248
|
+
error_type?: string;
|
|
249
|
+
message?: string;
|
|
250
|
+
category?: string;
|
|
251
|
+
file_path?: string;
|
|
252
|
+
line_number?: number;
|
|
253
|
+
column?: number;
|
|
254
|
+
code?: string;
|
|
255
|
+
stack_trace?: string;
|
|
256
|
+
suggestion?: string;
|
|
257
|
+
captured_at: string;
|
|
258
|
+
capture_source?: 'paste' | 'clipboard' | 'terminal' | 'browser' | 'sentry' | 'ci';
|
|
259
|
+
};
|
|
215
260
|
}
|
|
216
261
|
/**
|
|
217
262
|
* TaskOperations class provides a high-level API for task management
|
|
@@ -219,7 +264,7 @@ interface Task {
|
|
|
219
264
|
*/
|
|
220
265
|
declare class TaskOperations {
|
|
221
266
|
private supabase;
|
|
222
|
-
constructor(supabase: SupabaseClient);
|
|
267
|
+
constructor(supabase: SupabaseClient<any, any, any>);
|
|
223
268
|
/**
|
|
224
269
|
* Create TaskOperations from AuthManager
|
|
225
270
|
* Automatically refreshes expired tokens
|
|
@@ -264,6 +309,31 @@ declare class TaskOperations {
|
|
|
264
309
|
getTaskAttachments(taskId: string): Promise<(Attachment & {
|
|
265
310
|
url: string;
|
|
266
311
|
})[]>;
|
|
312
|
+
/**
|
|
313
|
+
* Get inbox items - tasks from external sources that need attention
|
|
314
|
+
* Includes: errors (Sentry, CI), feedback (GitHub, Email, Slack)
|
|
315
|
+
*
|
|
316
|
+
* @param filter.source_type - Filter by source type(s)
|
|
317
|
+
* @param filter.priority - Filter by priority level(s)
|
|
318
|
+
* @param filter.unacknowledged_only - Only show unacknowledged items
|
|
319
|
+
* @param filter.limit - Maximum number of items to return
|
|
320
|
+
*/
|
|
321
|
+
getInboxItems(filter?: {
|
|
322
|
+
source_type?: SourceType | SourceType[];
|
|
323
|
+
priority?: TaskPriority | TaskPriority[];
|
|
324
|
+
unacknowledged_only?: boolean;
|
|
325
|
+
limit?: number;
|
|
326
|
+
}): Promise<Task[]>;
|
|
327
|
+
/**
|
|
328
|
+
* Get inbox statistics
|
|
329
|
+
*/
|
|
330
|
+
getInboxStats(): Promise<{
|
|
331
|
+
total: number;
|
|
332
|
+
unacknowledged: number;
|
|
333
|
+
by_source: Record<string, number>;
|
|
334
|
+
by_priority: Record<string, number>;
|
|
335
|
+
needs_attention: boolean;
|
|
336
|
+
}>;
|
|
267
337
|
}
|
|
268
338
|
|
|
269
339
|
/**
|
|
@@ -371,4 +441,4 @@ declare class ClaudeSync {
|
|
|
371
441
|
*/
|
|
372
442
|
declare function syncClaudeTodos(taskOps: TaskOperations, todos: ClaudeTodoItem[], options?: SyncOptions): Promise<SyncAllResult>;
|
|
373
443
|
|
|
374
|
-
export { AuthManager, ClaudeSync, type ClaudeTodoItem, ConfigManager, type SupabaseConfig, type SyncAllResult, type SyncOptions, type SyncResult, type Tag, type Task, type TaskFilter, type TaskFlowConfig, TaskOperations, type TaskPriority, type TaskStatus, createSupabaseClient, createSupabaseClientFromEnv, syncClaudeTodos };
|
|
444
|
+
export { type Attachment, AuthManager, ClaudeSync, type ClaudeTodoItem, ConfigManager, type SourceType, type Subtask, type SupabaseConfig, type SyncAllResult, type SyncOptions, type SyncResult, type Tag, type Task, type TaskFilter, type TaskFlowConfig, TaskOperations, type TaskPriority, type TaskStatus, createSupabaseClient, createSupabaseClientFromEnv, syncClaudeTodos };
|
package/dist/index.js
CHANGED
|
@@ -95,6 +95,10 @@ function createSupabaseClient(config) {
|
|
|
95
95
|
throw new Error("Supabase URL and key are required");
|
|
96
96
|
}
|
|
97
97
|
const client = createClient(supabaseUrl, supabaseKey, {
|
|
98
|
+
db: {
|
|
99
|
+
schema: "vibetasks"
|
|
100
|
+
// Use vibetasks schema for all queries
|
|
101
|
+
},
|
|
98
102
|
auth: {
|
|
99
103
|
persistSession: false,
|
|
100
104
|
// CLI/MCP don't need session persistence
|
|
@@ -129,7 +133,7 @@ function createSupabaseClientFromEnv() {
|
|
|
129
133
|
var SERVICE_NAME = "taskflow-cli";
|
|
130
134
|
var ACCESS_TOKEN_ACCOUNT = "access-token";
|
|
131
135
|
var REFRESH_TOKEN_ACCOUNT = "refresh-token";
|
|
132
|
-
var DEFAULT_SUPABASE_URL = "https://
|
|
136
|
+
var DEFAULT_SUPABASE_URL = "https://ihmayqzxqyednchbezya.supabase.co";
|
|
133
137
|
var DEFAULT_SUPABASE_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNia2t6dGJjb2l0cmZjbGVnaGZkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njc3NTc0MjgsImV4cCI6MjA4MzMzMzQyOH0.G7ILx-nntP0NbxO1gKt5yASb7nt7OmpJ8qtykeGYbQA";
|
|
134
138
|
var ENV_TOKEN = "VIBETASKS_TOKEN";
|
|
135
139
|
var ENV_ACCESS_TOKEN = "VIBETASKS_ACCESS_TOKEN";
|
|
@@ -379,7 +383,7 @@ var TaskOperations = class _TaskOperations {
|
|
|
379
383
|
* Automatically refreshes expired tokens
|
|
380
384
|
*/
|
|
381
385
|
static async fromAuthManager(authManager) {
|
|
382
|
-
const supabaseUrl = await authManager.getConfig("supabase_url") || "https://
|
|
386
|
+
const supabaseUrl = await authManager.getConfig("supabase_url") || "https://ihmayqzxqyednchbezya.supabase.co";
|
|
383
387
|
const supabaseKey = await authManager.getConfig("supabase_key") || "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNia2t6dGJjb2l0cmZjbGVnaGZkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njc3NTc0MjgsImV4cCI6MjA4MzMzMzQyOH0.G7ILx-nntP0NbxO1gKt5yASb7nt7OmpJ8qtykeGYbQA";
|
|
384
388
|
const accessToken = await authManager.getValidAccessToken();
|
|
385
389
|
if (!accessToken) {
|
|
@@ -647,6 +651,106 @@ var TaskOperations = class _TaskOperations {
|
|
|
647
651
|
);
|
|
648
652
|
return attachmentsWithUrls;
|
|
649
653
|
}
|
|
654
|
+
// ============================================
|
|
655
|
+
// INBOX OPERATIONS
|
|
656
|
+
// ============================================
|
|
657
|
+
/**
|
|
658
|
+
* Get inbox items - tasks from external sources that need attention
|
|
659
|
+
* Includes: errors (Sentry, CI), feedback (GitHub, Email, Slack)
|
|
660
|
+
*
|
|
661
|
+
* @param filter.source_type - Filter by source type(s)
|
|
662
|
+
* @param filter.priority - Filter by priority level(s)
|
|
663
|
+
* @param filter.unacknowledged_only - Only show unacknowledged items
|
|
664
|
+
* @param filter.limit - Maximum number of items to return
|
|
665
|
+
*/
|
|
666
|
+
async getInboxItems(filter = {}) {
|
|
667
|
+
const allTasks = await this.getTasks("all");
|
|
668
|
+
let inboxTasks = allTasks.filter((t) => {
|
|
669
|
+
if (t.source_type && t.source_type !== "manual") return true;
|
|
670
|
+
if (t.sentry_issue_id) return true;
|
|
671
|
+
if (t.github_issue_id) return true;
|
|
672
|
+
if (t.email_message_id) return true;
|
|
673
|
+
if (t.slack_message_id) return true;
|
|
674
|
+
if (t.priority === "high") {
|
|
675
|
+
const title = t.title?.toLowerCase() || "";
|
|
676
|
+
const patterns = ["error", "bug", "fix", "crash", "fail", "broken", "issue"];
|
|
677
|
+
if (patterns.some((p) => title.includes(p))) return true;
|
|
678
|
+
}
|
|
679
|
+
return false;
|
|
680
|
+
});
|
|
681
|
+
if (filter.source_type) {
|
|
682
|
+
const sourceTypes = Array.isArray(filter.source_type) ? filter.source_type : [filter.source_type];
|
|
683
|
+
inboxTasks = inboxTasks.filter((t) => {
|
|
684
|
+
if (t.source_type && sourceTypes.includes(t.source_type)) return true;
|
|
685
|
+
if (sourceTypes.includes("sentry") && t.sentry_issue_id) return true;
|
|
686
|
+
if (sourceTypes.includes("ci") && t.tags?.some((tag) => tag.name === "ci")) return true;
|
|
687
|
+
if ((sourceTypes.includes("github_bug") || sourceTypes.includes("github_feedback")) && t.github_issue_id) return true;
|
|
688
|
+
return false;
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
if (filter.priority) {
|
|
692
|
+
const priorities = Array.isArray(filter.priority) ? filter.priority : [filter.priority];
|
|
693
|
+
inboxTasks = inboxTasks.filter((t) => t.priority && priorities.includes(t.priority));
|
|
694
|
+
}
|
|
695
|
+
if (filter.unacknowledged_only) {
|
|
696
|
+
inboxTasks = inboxTasks.filter((t) => !t.context_notes?.includes("[AI_ACKNOWLEDGED]"));
|
|
697
|
+
}
|
|
698
|
+
inboxTasks.sort(
|
|
699
|
+
(a, b) => new Date(b.created_at || 0).getTime() - new Date(a.created_at || 0).getTime()
|
|
700
|
+
);
|
|
701
|
+
if (filter.limit) {
|
|
702
|
+
inboxTasks = inboxTasks.slice(0, filter.limit);
|
|
703
|
+
}
|
|
704
|
+
return inboxTasks;
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Get inbox statistics
|
|
708
|
+
*/
|
|
709
|
+
async getInboxStats() {
|
|
710
|
+
const inboxItems = await this.getInboxItems();
|
|
711
|
+
const unacknowledged = inboxItems.filter((t) => !t.context_notes?.includes("[AI_ACKNOWLEDGED]"));
|
|
712
|
+
const bySource = {
|
|
713
|
+
sentry: 0,
|
|
714
|
+
ci: 0,
|
|
715
|
+
github_bug: 0,
|
|
716
|
+
github_feedback: 0,
|
|
717
|
+
email_bug: 0,
|
|
718
|
+
email_feedback: 0,
|
|
719
|
+
slack_bug: 0,
|
|
720
|
+
slack_feedback: 0,
|
|
721
|
+
manual: 0
|
|
722
|
+
};
|
|
723
|
+
for (const task of inboxItems) {
|
|
724
|
+
if (task.source_type) {
|
|
725
|
+
bySource[task.source_type] = (bySource[task.source_type] || 0) + 1;
|
|
726
|
+
} else if (task.sentry_issue_id) {
|
|
727
|
+
bySource.sentry++;
|
|
728
|
+
} else if (task.github_issue_id) {
|
|
729
|
+
bySource.github_bug++;
|
|
730
|
+
} else if (task.tags?.some((tag) => tag.name === "ci")) {
|
|
731
|
+
bySource.ci++;
|
|
732
|
+
} else {
|
|
733
|
+
bySource.manual++;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
const byPriority = {
|
|
737
|
+
high: 0,
|
|
738
|
+
medium: 0,
|
|
739
|
+
low: 0,
|
|
740
|
+
none: 0
|
|
741
|
+
};
|
|
742
|
+
for (const task of inboxItems) {
|
|
743
|
+
const priority = task.priority || "none";
|
|
744
|
+
byPriority[priority]++;
|
|
745
|
+
}
|
|
746
|
+
return {
|
|
747
|
+
total: inboxItems.length,
|
|
748
|
+
unacknowledged: unacknowledged.length,
|
|
749
|
+
by_source: bySource,
|
|
750
|
+
by_priority: byPriority,
|
|
751
|
+
needs_attention: unacknowledged.length > 3 || byPriority.high > 0
|
|
752
|
+
};
|
|
753
|
+
}
|
|
650
754
|
};
|
|
651
755
|
|
|
652
756
|
// src/claude-sync.ts
|
package/package.json
CHANGED
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@vibetasks/core",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "Shared core logic for VibeTasks MCP server and CLI - authentication, task operations, and config management",
|
|
5
|
-
"author": "Vyas",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"main": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"type": "module",
|
|
10
|
-
"files": [
|
|
11
|
-
"dist"
|
|
12
|
-
],
|
|
13
|
-
"keywords": [
|
|
14
|
-
"vibetasks",
|
|
15
|
-
"vibe",
|
|
16
|
-
"vibecoding",
|
|
17
|
-
"mcp",
|
|
18
|
-
"task-management",
|
|
19
|
-
"supabase",
|
|
20
|
-
"authentication",
|
|
21
|
-
"productivity"
|
|
22
|
-
],
|
|
23
|
-
"repository": {
|
|
24
|
-
"type": "git",
|
|
25
|
-
"url": "https://github.com/vyassathya/vibetasks.git",
|
|
26
|
-
"directory": "packages/mcp-core"
|
|
27
|
-
},
|
|
28
|
-
"publishConfig": {
|
|
29
|
-
"access": "public"
|
|
30
|
-
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"dev": "tsx src/index.ts",
|
|
33
|
-
"build": "tsup src/index.ts --format esm --clean --dts",
|
|
34
|
-
"typecheck": "tsc --noEmit"
|
|
35
|
-
},
|
|
36
|
-
"dependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@vibetasks/core",
|
|
3
|
+
"version": "0.5.5",
|
|
4
|
+
"description": "Shared core logic for VibeTasks MCP server and CLI - authentication, task operations, and config management",
|
|
5
|
+
"author": "Vyas",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"keywords": [
|
|
14
|
+
"vibetasks",
|
|
15
|
+
"vibe",
|
|
16
|
+
"vibecoding",
|
|
17
|
+
"mcp",
|
|
18
|
+
"task-management",
|
|
19
|
+
"supabase",
|
|
20
|
+
"authentication",
|
|
21
|
+
"productivity"
|
|
22
|
+
],
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/vyassathya/vibetasks.git",
|
|
26
|
+
"directory": "packages/mcp-core"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"dev": "tsx src/index.ts",
|
|
33
|
+
"build": "tsup src/index.ts --format esm --clean --dts",
|
|
34
|
+
"typecheck": "tsc --noEmit"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@vibetasks/shared": "workspace:*",
|
|
38
|
+
"@supabase/supabase-js": "^2.39.0",
|
|
39
|
+
"keytar": "^7.9.0",
|
|
40
|
+
"zod": "^3.22.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^20.0.0",
|
|
44
|
+
"tsx": "^4.7.0",
|
|
45
|
+
"tsup": "^8.0.0",
|
|
46
|
+
"typescript": "^5.3.3"
|
|
47
|
+
}
|
|
48
|
+
}
|