@vibetasks/core 0.5.3 → 0.5.4

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 CHANGED
@@ -149,8 +149,15 @@ declare function createSupabaseClient(config: SupabaseConfig): SupabaseClient;
149
149
  */
150
150
  declare function createSupabaseClientFromEnv(): SupabaseClient;
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?: 'low' | 'medium' | 'high';
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
@@ -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
@@ -129,7 +129,7 @@ function createSupabaseClientFromEnv() {
129
129
  var SERVICE_NAME = "taskflow-cli";
130
130
  var ACCESS_TOKEN_ACCOUNT = "access-token";
131
131
  var REFRESH_TOKEN_ACCOUNT = "refresh-token";
132
- var DEFAULT_SUPABASE_URL = "https://cbkkztbcoitrfcleghfd.supabase.co";
132
+ var DEFAULT_SUPABASE_URL = "https://ihmayqzxqyednchbezya.supabase.co";
133
133
  var DEFAULT_SUPABASE_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNia2t6dGJjb2l0cmZjbGVnaGZkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njc3NTc0MjgsImV4cCI6MjA4MzMzMzQyOH0.G7ILx-nntP0NbxO1gKt5yASb7nt7OmpJ8qtykeGYbQA";
134
134
  var ENV_TOKEN = "VIBETASKS_TOKEN";
135
135
  var ENV_ACCESS_TOKEN = "VIBETASKS_ACCESS_TOKEN";
@@ -379,7 +379,7 @@ var TaskOperations = class _TaskOperations {
379
379
  * Automatically refreshes expired tokens
380
380
  */
381
381
  static async fromAuthManager(authManager) {
382
- const supabaseUrl = await authManager.getConfig("supabase_url") || "https://cbkkztbcoitrfcleghfd.supabase.co";
382
+ const supabaseUrl = await authManager.getConfig("supabase_url") || "https://ihmayqzxqyednchbezya.supabase.co";
383
383
  const supabaseKey = await authManager.getConfig("supabase_key") || "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNia2t6dGJjb2l0cmZjbGVnaGZkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njc3NTc0MjgsImV4cCI6MjA4MzMzMzQyOH0.G7ILx-nntP0NbxO1gKt5yASb7nt7OmpJ8qtykeGYbQA";
384
384
  const accessToken = await authManager.getValidAccessToken();
385
385
  if (!accessToken) {
@@ -647,6 +647,106 @@ var TaskOperations = class _TaskOperations {
647
647
  );
648
648
  return attachmentsWithUrls;
649
649
  }
650
+ // ============================================
651
+ // INBOX OPERATIONS
652
+ // ============================================
653
+ /**
654
+ * Get inbox items - tasks from external sources that need attention
655
+ * Includes: errors (Sentry, CI), feedback (GitHub, Email, Slack)
656
+ *
657
+ * @param filter.source_type - Filter by source type(s)
658
+ * @param filter.priority - Filter by priority level(s)
659
+ * @param filter.unacknowledged_only - Only show unacknowledged items
660
+ * @param filter.limit - Maximum number of items to return
661
+ */
662
+ async getInboxItems(filter = {}) {
663
+ const allTasks = await this.getTasks("all");
664
+ let inboxTasks = allTasks.filter((t) => {
665
+ if (t.source_type && t.source_type !== "manual") return true;
666
+ if (t.sentry_issue_id) return true;
667
+ if (t.github_issue_id) return true;
668
+ if (t.email_message_id) return true;
669
+ if (t.slack_message_id) return true;
670
+ if (t.priority === "high") {
671
+ const title = t.title?.toLowerCase() || "";
672
+ const patterns = ["error", "bug", "fix", "crash", "fail", "broken", "issue"];
673
+ if (patterns.some((p) => title.includes(p))) return true;
674
+ }
675
+ return false;
676
+ });
677
+ if (filter.source_type) {
678
+ const sourceTypes = Array.isArray(filter.source_type) ? filter.source_type : [filter.source_type];
679
+ inboxTasks = inboxTasks.filter((t) => {
680
+ if (t.source_type && sourceTypes.includes(t.source_type)) return true;
681
+ if (sourceTypes.includes("sentry") && t.sentry_issue_id) return true;
682
+ if (sourceTypes.includes("ci") && t.tags?.some((tag) => tag.name === "ci")) return true;
683
+ if ((sourceTypes.includes("github_bug") || sourceTypes.includes("github_feedback")) && t.github_issue_id) return true;
684
+ return false;
685
+ });
686
+ }
687
+ if (filter.priority) {
688
+ const priorities = Array.isArray(filter.priority) ? filter.priority : [filter.priority];
689
+ inboxTasks = inboxTasks.filter((t) => t.priority && priorities.includes(t.priority));
690
+ }
691
+ if (filter.unacknowledged_only) {
692
+ inboxTasks = inboxTasks.filter((t) => !t.context_notes?.includes("[AI_ACKNOWLEDGED]"));
693
+ }
694
+ inboxTasks.sort(
695
+ (a, b) => new Date(b.created_at || 0).getTime() - new Date(a.created_at || 0).getTime()
696
+ );
697
+ if (filter.limit) {
698
+ inboxTasks = inboxTasks.slice(0, filter.limit);
699
+ }
700
+ return inboxTasks;
701
+ }
702
+ /**
703
+ * Get inbox statistics
704
+ */
705
+ async getInboxStats() {
706
+ const inboxItems = await this.getInboxItems();
707
+ const unacknowledged = inboxItems.filter((t) => !t.context_notes?.includes("[AI_ACKNOWLEDGED]"));
708
+ const bySource = {
709
+ sentry: 0,
710
+ ci: 0,
711
+ github_bug: 0,
712
+ github_feedback: 0,
713
+ email_bug: 0,
714
+ email_feedback: 0,
715
+ slack_bug: 0,
716
+ slack_feedback: 0,
717
+ manual: 0
718
+ };
719
+ for (const task of inboxItems) {
720
+ if (task.source_type) {
721
+ bySource[task.source_type] = (bySource[task.source_type] || 0) + 1;
722
+ } else if (task.sentry_issue_id) {
723
+ bySource.sentry++;
724
+ } else if (task.github_issue_id) {
725
+ bySource.github_bug++;
726
+ } else if (task.tags?.some((tag) => tag.name === "ci")) {
727
+ bySource.ci++;
728
+ } else {
729
+ bySource.manual++;
730
+ }
731
+ }
732
+ const byPriority = {
733
+ high: 0,
734
+ medium: 0,
735
+ low: 0,
736
+ none: 0
737
+ };
738
+ for (const task of inboxItems) {
739
+ const priority = task.priority || "none";
740
+ byPriority[priority]++;
741
+ }
742
+ return {
743
+ total: inboxItems.length,
744
+ unacknowledged: unacknowledged.length,
745
+ by_source: bySource,
746
+ by_priority: byPriority,
747
+ needs_attention: unacknowledged.length > 3 || byPriority.high > 0
748
+ };
749
+ }
650
750
  };
651
751
 
652
752
  // src/claude-sync.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibetasks/core",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "Shared core logic for VibeTasks MCP server and CLI - authentication, task operations, and config management",
5
5
  "author": "Vyas",
6
6
  "license": "MIT",
@@ -34,6 +34,7 @@
34
34
  "typecheck": "tsc --noEmit"
35
35
  },
36
36
  "dependencies": {
37
+ "@vibetasks/shared": "*",
37
38
  "@supabase/supabase-js": "^2.39.0",
38
39
  "keytar": "^7.9.0",
39
40
  "zod": "^3.22.0"