vibepulse 0.1.0 → 0.1.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.
Files changed (68) hide show
  1. package/README.md +7 -13
  2. package/bin/vibepulse.js +1 -0
  3. package/dist/index.js +1 -1
  4. package/dist/index.mjs +1 -1
  5. package/docs/session-status-detection.md +258 -0
  6. package/next.config.ts +11 -0
  7. package/package.json +17 -11
  8. package/postcss.config.mjs +7 -0
  9. package/public/file.svg +1 -0
  10. package/public/globe.svg +1 -0
  11. package/public/next.svg +1 -0
  12. package/public/readme-cover.png +0 -0
  13. package/public/vercel.svg +1 -0
  14. package/public/window.svg +1 -0
  15. package/src/app/api/opencode-config/route.ts +304 -0
  16. package/src/app/api/opencode-config/status/route.ts +31 -0
  17. package/src/app/api/opencode-events/route.ts +86 -0
  18. package/src/app/api/opencode-models/route.test.ts +135 -0
  19. package/src/app/api/opencode-models/route.ts +58 -0
  20. package/src/app/api/profiles/[id]/apply/route.ts +49 -0
  21. package/src/app/api/profiles/[id]/route.ts +160 -0
  22. package/src/app/api/profiles/route.ts +107 -0
  23. package/src/app/api/sessions/[id]/archive/route.ts +35 -0
  24. package/src/app/api/sessions/[id]/delete/route.ts +26 -0
  25. package/src/app/api/sessions/[id]/route.ts +45 -0
  26. package/src/app/api/sessions/route.ts +596 -0
  27. package/src/app/favicon.ico +0 -0
  28. package/src/app/globals.css +66 -0
  29. package/src/app/layout.tsx +37 -0
  30. package/src/app/page.tsx +239 -0
  31. package/src/components/ErrorBoundary.tsx +72 -0
  32. package/src/components/KanbanBoard.tsx +442 -0
  33. package/src/components/LoadingState.tsx +37 -0
  34. package/src/components/ProjectCard.tsx +382 -0
  35. package/src/components/QueryProvider.tsx +25 -0
  36. package/src/components/SessionCard.tsx +291 -0
  37. package/src/components/SessionList.tsx +60 -0
  38. package/src/components/opencode-config/AgentConfigForm.test.tsx +66 -0
  39. package/src/components/opencode-config/AgentConfigForm.tsx +445 -0
  40. package/src/components/opencode-config/AgentModelSelector.tsx +284 -0
  41. package/src/components/opencode-config/AgentsConfigPanel.tsx +162 -0
  42. package/src/components/opencode-config/ConfigButton.tsx +43 -0
  43. package/src/components/opencode-config/ConfigPanel.tsx +91 -0
  44. package/src/components/opencode-config/FullscreenConfigPanel.tsx +360 -0
  45. package/src/components/opencode-config/categories/CategoriesList.tsx +328 -0
  46. package/src/components/opencode-config/categories/CategoriesManager.test.tsx +97 -0
  47. package/src/components/opencode-config/categories/CategoriesManager.tsx +174 -0
  48. package/src/components/opencode-config/categories/CategoryConfigForm.tsx +384 -0
  49. package/src/components/opencode-config/profiles/ProfileCard.tsx +140 -0
  50. package/src/components/opencode-config/profiles/ProfileEditor.tsx +446 -0
  51. package/src/components/opencode-config/profiles/ProfileList.tsx +398 -0
  52. package/src/components/opencode-config/profiles/ProfileManager.test.tsx +122 -0
  53. package/src/components/opencode-config/profiles/ProfileManager.tsx +293 -0
  54. package/src/components/ui/Tabs.tsx +59 -0
  55. package/src/hooks/useOpencodeSync.ts +378 -0
  56. package/src/index.ts +2 -0
  57. package/src/lib/notificationSound.ts +266 -0
  58. package/src/lib/opencodeConfig.test.ts +81 -0
  59. package/src/lib/opencodeConfig.ts +48 -0
  60. package/src/lib/opencodeDiscovery.ts +154 -0
  61. package/src/lib/profiles/storage.ts +264 -0
  62. package/src/lib/transform.ts +84 -0
  63. package/src/test/setup.ts +8 -0
  64. package/src/types/index.ts +89 -0
  65. package/src/types/opencodeConfig.ts +133 -0
  66. package/src/types/testing-library-vitest.d.ts +17 -0
  67. package/tsconfig.json +34 -0
  68. package/tsconfig.lib.json +17 -0
@@ -0,0 +1,89 @@
1
+ // Core types
2
+ export type KanbanColumn = 'idle' | 'busy' | 'review' | 'done';
3
+
4
+ export interface KanbanCard {
5
+ id: string;
6
+ sessionSlug: string;
7
+ title: string;
8
+ directory: string;
9
+ projectName: string;
10
+ branch?: string;
11
+ agents: string[];
12
+ messageCount: number;
13
+ status: KanbanColumn;
14
+ opencodeStatus: OpencodeStatus;
15
+ waitingForUser: boolean;
16
+ todosTotal: number;
17
+ todosCompleted: number;
18
+ createdAt: number;
19
+ updatedAt: number;
20
+ archivedAt?: number;
21
+ sortOrder: number;
22
+ children?: {
23
+ id: string;
24
+ title?: string;
25
+ realTimeStatus: string;
26
+ waitingForUser: boolean;
27
+ }[];
28
+ }
29
+
30
+ // OpenCode event types
31
+ export interface OpencodeSession {
32
+ id: string;
33
+ slug: string;
34
+ title?: string;
35
+ directory: string;
36
+ projectName?: string;
37
+ branch?: string;
38
+ parentID?: string; // Used to filter subagents
39
+ time: {
40
+ created: number;
41
+ updated: number;
42
+ archived?: number;
43
+ };
44
+ messageCount?: number;
45
+ hasTodos?: boolean;
46
+ hasTranscript?: boolean;
47
+ realTimeStatus?: 'idle' | 'busy' | 'retry'; // Real-time status
48
+ waitingForUser?: boolean;
49
+ children?: OpencodeSession[];
50
+ }
51
+
52
+ export type OpencodeEventType =
53
+ | 'session.status'
54
+ | 'session.updated'
55
+ | 'session.created'
56
+ | 'session.deleted'
57
+ | 'session.archived'
58
+ | 'question.asked'
59
+ | 'permission.asked'
60
+ | 'permission.updated'
61
+ | 'question.replied'
62
+ | 'question.rejected'
63
+ | 'permission.replied'
64
+ | 'todo.updated';
65
+
66
+ export interface OpencodeEvent {
67
+ type: OpencodeEventType;
68
+ properties?: {
69
+ sessionID?: string;
70
+ info?: OpencodeSession;
71
+ status?: {
72
+ type?: OpencodeStatus;
73
+ };
74
+ [key: string]: unknown;
75
+ };
76
+ timestamp: number;
77
+ }
78
+
79
+ // Status mapping
80
+ export type OpencodeStatus = 'idle' | 'busy' | 'retry';
81
+
82
+ // Type guards
83
+ export function isKanbanColumn(value: string): value is KanbanColumn {
84
+ return ['idle', 'busy', 'review', 'done'].includes(value);
85
+ }
86
+
87
+ export function isOpencodeStatus(value: string): value is OpencodeStatus {
88
+ return ['idle', 'busy', 'retry'].includes(value);
89
+ }
@@ -0,0 +1,133 @@
1
+ // oh-my-opencode configuration types
2
+ // Reference: comment-json configuration structure
3
+
4
+ /**
5
+ * Agent configuration - defines how an agent behaves
6
+ * All fields are optional as configuration may be partial
7
+ */
8
+ export interface AgentConfig {
9
+ /** Model identifier (e.g., 'claude-3-5-sonnet-20241022') */
10
+ model?: string;
11
+ /** Sampling temperature (0-2) */
12
+ temperature?: number;
13
+ /** Top-p sampling parameter (0-1) */
14
+ top_p?: number;
15
+ /** Maximum tokens per response */
16
+ max_tokens?: number;
17
+ /** System prompt override for this agent */
18
+ system?: string;
19
+ /** Additional model-specific parameters */
20
+ [key: string]: unknown;
21
+ }
22
+
23
+ /**
24
+ * Category configuration - defines model settings for task categories
25
+ * Categories are used by task() to select appropriate models
26
+ * All fields are optional as configuration may be partial
27
+ */
28
+ export interface CategoryConfig {
29
+ /** Model identifier (e.g., 'google/gemini-3.1-pro') */
30
+ model?: string;
31
+ /** Model variant (e.g., 'max', 'high', 'medium', 'low', 'xhigh') */
32
+ variant?: string;
33
+ /** Sampling temperature (0-2) */
34
+ temperature?: number;
35
+ /** Top-p sampling parameter (0-1) */
36
+ top_p?: number;
37
+ /** Additional system prompt to append */
38
+ prompt_append?: string;
39
+ /** Human-readable description */
40
+ description?: string;
41
+ }
42
+
43
+ /**
44
+ * OhMyOpencode configuration
45
+ * Root configuration object for oh-my-opencode
46
+ * All fields are optional as configuration may be partial
47
+ */
48
+ export interface OhMyOpencodeConfig {
49
+ /** Global agent configurations keyed by agent name */
50
+ agents?: Record<string, AgentConfig>;
51
+ /** Category configurations for task type model selection */
52
+ categories?: Record<string, CategoryConfig>;
53
+ /** Default agent configuration to use as base */
54
+ defaultAgent?: AgentConfig;
55
+ /** Project-specific settings */
56
+ project?: {
57
+ /** Project name */
58
+ name?: string;
59
+ /** Working directory */
60
+ cwd?: string;
61
+ };
62
+ /** Runtime configuration */
63
+ runtime?: {
64
+ /** Enable/disable features */
65
+ features?: {
66
+ /** Enable auto-approval for safe operations */
67
+ autoApprove?: boolean;
68
+ /** Enable verbose logging */
69
+ verbose?: boolean;
70
+ /** Enable debug mode */
71
+ debug?: boolean;
72
+ };
73
+ /** Maximum retry attempts */
74
+ maxRetries?: number;
75
+ /** Request timeout in milliseconds */
76
+ timeout?: number;
77
+ };
78
+ /** Tool-specific configurations */
79
+ tools?: Record<string, unknown>;
80
+ /** Custom environment variables */
81
+ env?: Record<string, string>;
82
+ /** Additional custom configuration */
83
+ [key: string]: unknown;
84
+ }
85
+
86
+ /**
87
+ * Profile configuration - defines agent and category settings for a profile
88
+ * Profiles allow switching between different agent/category configurations
89
+ */
90
+ export interface ProfileConfig {
91
+ /** Agent configurations keyed by agent name */
92
+ agents: Record<string, AgentConfig>;
93
+ /** Category configurations for task type model selection */
94
+ categories?: Record<string, CategoryConfig>;
95
+ }
96
+
97
+ /**
98
+ * Profile - represents a named configuration profile
99
+ * Profiles can be built-in or user-created
100
+ */
101
+ export interface Profile {
102
+ /** Unique identifier */
103
+ id: string;
104
+ /** Human-readable name */
105
+ name: string;
106
+ /** Emoji icon for display */
107
+ emoji: string;
108
+ /** Optional description */
109
+ description?: string;
110
+ /** Creation timestamp */
111
+ createdAt: string;
112
+ /** Last update timestamp */
113
+ updatedAt: string;
114
+ /** Whether this is a default system profile */
115
+ isDefault?: boolean;
116
+ /** Whether this is a built-in profile that cannot be deleted */
117
+ isBuiltIn?: boolean;
118
+ }
119
+
120
+ /**
121
+ * Profile index - tracks all profiles and active selection
122
+ * This is the top-level structure for profile management
123
+ */
124
+ export interface ProfileIndex {
125
+ /** Schema version for migrations */
126
+ version: number;
127
+ /** All available profiles */
128
+ profiles: Profile[];
129
+ /** Currently active profile ID */
130
+ activeProfileId: string | null;
131
+ /** Last modification timestamp */
132
+ lastModified: string;
133
+ }
@@ -0,0 +1,17 @@
1
+ // Ambient type declarations for testing dependencies
2
+ // These declarations allow TypeScript to compile without the actual packages installed
3
+ // They provide minimal typing to satisfy the LSP
4
+
5
+ declare module '@testing-library/react' {
6
+ export function cleanup(): void;
7
+ // Other exports are implicitly any
8
+ }
9
+
10
+ declare module 'vitest' {
11
+ export function afterEach(fn: () => void): void;
12
+ // Other vitest exports are implicitly any
13
+ }
14
+
15
+ declare module '@testing-library/jest-dom' {
16
+ // This module extends expect with custom matchers, no exports needed
17
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2017",
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "allowJs": true,
6
+ "skipLibCheck": true,
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "esModuleInterop": true,
10
+ "module": "esnext",
11
+ "moduleResolution": "bundler",
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "jsx": "react-jsx",
15
+ "incremental": true,
16
+ "plugins": [
17
+ {
18
+ "name": "next"
19
+ }
20
+ ],
21
+ "paths": {
22
+ "@/*": ["./src/*"]
23
+ }
24
+ },
25
+ "include": [
26
+ "next-env.d.ts",
27
+ "**/*.ts",
28
+ "**/*.tsx",
29
+ ".next/types/**/*.ts",
30
+ ".next/dev/types/**/*.ts",
31
+ "**/*.mts"
32
+ ],
33
+ "exclude": ["node_modules"]
34
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "declaration": true,
6
+ "declarationDir": "./dist",
7
+ "emitDeclarationOnly": false,
8
+ "noEmit": false,
9
+ "jsx": "react-jsx",
10
+ "module": "ESNext",
11
+ "moduleResolution": "bundler",
12
+ "target": "ES2020",
13
+ "incremental": false
14
+ },
15
+ "include": ["src/**/*"],
16
+ "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.test.tsx"]
17
+ }