@benzsiangco/jarvis 1.0.2 → 1.1.0

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 (53) hide show
  1. package/dist/cli.js +478 -347
  2. package/dist/electron/main.js +160 -0
  3. package/dist/electron/preload.js +19 -0
  4. package/package.json +19 -6
  5. package/skills.md +147 -0
  6. package/src/agents/index.ts +248 -0
  7. package/src/brain/loader.ts +136 -0
  8. package/src/cli.ts +411 -0
  9. package/src/config/index.ts +363 -0
  10. package/src/core/executor.ts +222 -0
  11. package/src/core/plugins.ts +148 -0
  12. package/src/core/types.ts +217 -0
  13. package/src/electron/main.ts +192 -0
  14. package/src/electron/preload.ts +25 -0
  15. package/src/electron/types.d.ts +20 -0
  16. package/src/index.ts +12 -0
  17. package/src/providers/antigravity-loader.ts +233 -0
  18. package/src/providers/antigravity.ts +585 -0
  19. package/src/providers/index.ts +523 -0
  20. package/src/sessions/index.ts +194 -0
  21. package/src/tools/index.ts +436 -0
  22. package/src/tui/index.tsx +784 -0
  23. package/src/utils/auth-prompt.ts +394 -0
  24. package/src/utils/index.ts +180 -0
  25. package/src/utils/native-picker.ts +71 -0
  26. package/src/utils/skills.ts +99 -0
  27. package/src/utils/table-integration-examples.ts +617 -0
  28. package/src/utils/table-utils.ts +401 -0
  29. package/src/web/build-ui.ts +27 -0
  30. package/src/web/server.ts +674 -0
  31. package/src/web/ui/dist/.gitkeep +0 -0
  32. package/src/web/ui/dist/main.css +1 -0
  33. package/src/web/ui/dist/main.js +320 -0
  34. package/src/web/ui/dist/main.js.map +20 -0
  35. package/src/web/ui/index.html +46 -0
  36. package/src/web/ui/src/App.tsx +143 -0
  37. package/src/web/ui/src/Modules/Safety/GuardianModal.tsx +83 -0
  38. package/src/web/ui/src/components/Layout/ContextPanel.tsx +243 -0
  39. package/src/web/ui/src/components/Layout/Header.tsx +91 -0
  40. package/src/web/ui/src/components/Layout/ModelSelector.tsx +235 -0
  41. package/src/web/ui/src/components/Layout/SessionStats.tsx +369 -0
  42. package/src/web/ui/src/components/Layout/Sidebar.tsx +895 -0
  43. package/src/web/ui/src/components/Modules/Chat/ChatStage.tsx +620 -0
  44. package/src/web/ui/src/components/Modules/Chat/MessageItem.tsx +446 -0
  45. package/src/web/ui/src/components/Modules/Editor/CommandInspector.tsx +71 -0
  46. package/src/web/ui/src/components/Modules/Editor/DiffViewer.tsx +83 -0
  47. package/src/web/ui/src/components/Modules/Terminal/TabbedTerminal.tsx +202 -0
  48. package/src/web/ui/src/components/Settings/SettingsModal.tsx +935 -0
  49. package/src/web/ui/src/config/models.ts +70 -0
  50. package/src/web/ui/src/main.tsx +13 -0
  51. package/src/web/ui/src/store/agentStore.ts +41 -0
  52. package/src/web/ui/src/store/uiStore.ts +64 -0
  53. package/src/web/ui/src/types/index.ts +54 -0
@@ -0,0 +1,70 @@
1
+ // Model context limits (in tokens)
2
+ export const MODEL_CONTEXT_LIMITS: Record<string, number> = {
3
+ 'gemini-2.0-flash-exp': 1_000_000,
4
+ 'gemini-2.0-flash-thinking-exp': 1_000_000,
5
+ 'gemini-1.5-pro-002': 2_000_000,
6
+ 'gemini-1.5-pro': 2_000_000,
7
+ 'gemini-1.5-flash-002': 1_000_000,
8
+ 'gemini-1.5-flash': 1_000_000,
9
+ 'claude-3-5-sonnet-20241022': 200_000,
10
+ 'claude-3-5-sonnet-20240620': 200_000,
11
+ 'claude-3-opus-20240229': 200_000,
12
+ 'claude-3-sonnet-20240229': 200_000,
13
+ 'gpt-4o': 128_000,
14
+ 'gpt-4o-2024-11-20': 128_000,
15
+ 'gpt-4o-mini': 128_000,
16
+ 'gpt-4-turbo': 128_000,
17
+ 'o1-preview': 128_000,
18
+ 'o1-mini': 128_000,
19
+ 'o3-mini': 200_000,
20
+ };
21
+
22
+ // Model pricing (per 1M tokens)
23
+ export const MODEL_PRICING: Record<string, { input: number; output: number }> = {
24
+ 'gemini-2.0-flash-exp': { input: 0, output: 0 }, // Free
25
+ 'gemini-2.0-flash-thinking-exp': { input: 0, output: 0 }, // Free
26
+ 'gemini-1.5-pro-002': { input: 1.25, output: 5.0 },
27
+ 'gemini-1.5-pro': { input: 1.25, output: 5.0 },
28
+ 'gemini-1.5-flash-002': { input: 0.075, output: 0.3 },
29
+ 'gemini-1.5-flash': { input: 0.075, output: 0.3 },
30
+ 'claude-3-5-sonnet-20241022': { input: 3.0, output: 15.0 },
31
+ 'claude-3-5-sonnet-20240620': { input: 3.0, output: 15.0 },
32
+ 'claude-3-opus-20240229': { input: 15.0, output: 75.0 },
33
+ 'claude-3-sonnet-20240229': { input: 3.0, output: 15.0 },
34
+ 'gpt-4o': { input: 2.5, output: 10.0 },
35
+ 'gpt-4o-2024-11-20': { input: 2.5, output: 10.0 },
36
+ 'gpt-4o-mini': { input: 0.15, output: 0.6 },
37
+ 'gpt-4-turbo': { input: 10.0, output: 30.0 },
38
+ 'o1-preview': { input: 15.0, output: 60.0 },
39
+ 'o1-mini': { input: 3.0, output: 12.0 },
40
+ 'o3-mini': { input: 1.1, output: 4.4 },
41
+ };
42
+
43
+ // Model display names
44
+ export const MODEL_DISPLAY_NAMES: Record<string, string> = {
45
+ 'gemini-2.0-flash-exp': 'Gemini 2.0 Flash',
46
+ 'gemini-2.0-flash-thinking-exp': 'Gemini 2.0 Flash Thinking',
47
+ 'gemini-1.5-pro-002': 'Gemini 1.5 Pro',
48
+ 'gemini-1.5-pro': 'Gemini 1.5 Pro',
49
+ 'gemini-1.5-flash-002': 'Gemini 1.5 Flash',
50
+ 'gemini-1.5-flash': 'Gemini 1.5 Flash',
51
+ 'claude-3-5-sonnet-20241022': 'Claude Sonnet 3.5',
52
+ 'claude-3-5-sonnet-20240620': 'Claude Sonnet 3.5',
53
+ 'claude-3-opus-20240229': 'Claude Opus 3',
54
+ 'claude-3-sonnet-20240229': 'Claude Sonnet 3',
55
+ 'gpt-4o': 'GPT-4o',
56
+ 'gpt-4o-2024-11-20': 'GPT-4o',
57
+ 'gpt-4o-mini': 'GPT-4o Mini',
58
+ 'gpt-4-turbo': 'GPT-4 Turbo',
59
+ 'o1-preview': 'O1 Preview',
60
+ 'o1-mini': 'O1 Mini',
61
+ 'o3-mini': 'O3 Mini',
62
+ };
63
+
64
+ // Provider display names
65
+ export const PROVIDER_NAMES: Record<string, string> = {
66
+ 'google': 'Google',
67
+ 'anthropic': 'Anthropic',
68
+ 'openai': 'OpenAI',
69
+ 'unknown': 'Unknown',
70
+ };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { createRoot } from 'react-dom/client';
3
+ import App from './App';
4
+
5
+ const container = document.getElementById('root');
6
+ if (container) {
7
+ const root = createRoot(container);
8
+ root.render(
9
+ <React.StrictMode>
10
+ <App />
11
+ </React.StrictMode>
12
+ );
13
+ }
@@ -0,0 +1,41 @@
1
+ import { create } from 'zustand';
2
+
3
+ export type Persona = 'it-expert' | 'hacker' | 'designer' | 'minimalist';
4
+ export type Variant = 'standard' | 'creative' | 'precise';
5
+
6
+ interface AgentState {
7
+ persona: Persona;
8
+ selectedModelId: string;
9
+ selectedAgentId: string;
10
+ variant: Variant;
11
+ activeAccount: string | null;
12
+ accountPool: Array<{ id: string; label: string; provider: string; status: 'active' | 'rate-limited' | 'offline' }>;
13
+ taskTree: any[]; // Nested sub-agent tasks
14
+
15
+ // Actions
16
+ setPersona: (persona: Persona) => void;
17
+ setSelectedModelId: (id: string) => void;
18
+ setSelectedAgentId: (id: string) => void;
19
+ setVariant: (variant: Variant) => void;
20
+ updateAccountStatus: (id: string, status: 'active' | 'rate-limited' | 'offline') => void;
21
+ setTaskTree: (tasks: any[]) => void;
22
+ }
23
+
24
+ export const useAgentStore = create<AgentState>((set) => ({
25
+ persona: 'it-expert',
26
+ selectedModelId: '',
27
+ selectedAgentId: 'build',
28
+ variant: 'standard',
29
+ activeAccount: null,
30
+ accountPool: [],
31
+ taskTree: [],
32
+
33
+ setPersona: (persona) => set({ persona }),
34
+ setSelectedModelId: (id) => set({ selectedModelId: id }),
35
+ setSelectedAgentId: (id) => set({ selectedAgentId: id }),
36
+ setVariant: (variant) => set({ variant }),
37
+ updateAccountStatus: (id, status) => set((state) => ({
38
+ accountPool: state.accountPool.map(a => a.id === id ? { ...a, status } : a)
39
+ })),
40
+ setTaskTree: (tasks) => set({ taskTree: tasks }),
41
+ }));
@@ -0,0 +1,64 @@
1
+ import { create } from 'zustand';
2
+
3
+ export interface Workspace {
4
+ id: string;
5
+ name: string;
6
+ path: string;
7
+ icon: string;
8
+ }
9
+
10
+ interface UIState {
11
+ // Layout State
12
+ isMobile: boolean;
13
+ isSidebarOpen: boolean;
14
+ isContextOpen: boolean;
15
+ activeModule: 'chat' | 'settings';
16
+ terminalVisible: boolean;
17
+ isSettingsOpen: boolean;
18
+
19
+ // Workspace State
20
+ workspaces: Workspace[];
21
+ activeWorkspaceId: string | null;
22
+
23
+ // Actions
24
+ setMobile: (isMobile: boolean) => void;
25
+ toggleSidebar: () => void;
26
+ toggleContext: () => void;
27
+ setActiveModule: (module: 'chat' | 'settings') => void;
28
+ setTerminalVisible: (visible: boolean) => void;
29
+ setSettingsOpen: (open: boolean) => void;
30
+ setWorkspaces: (workspaces: Workspace[]) => void;
31
+ addWorkspace: (workspace: Workspace) => void;
32
+ removeWorkspace: (id: string) => void;
33
+ setActiveWorkspace: (id: string | null) => void;
34
+ }
35
+
36
+ export const useUIStore = create<UIState>((set) => ({
37
+ isMobile: typeof window !== 'undefined' ? window.innerWidth < 768 : false,
38
+ isSidebarOpen: true,
39
+ isContextOpen: true,
40
+ activeModule: 'chat',
41
+ terminalVisible: false,
42
+ isSettingsOpen: false,
43
+ workspaces: [],
44
+ activeWorkspaceId: null,
45
+
46
+ setMobile: (isMobile) => set({ isMobile }),
47
+ toggleSidebar: () => set((state) => ({ isSidebarOpen: !state.isSidebarOpen })),
48
+ toggleContext: () => set((state) => ({ isContextOpen: !state.isContextOpen })),
49
+ setActiveModule: (module) => set({ activeModule: module }),
50
+ setTerminalVisible: (visible) => set({ terminalVisible: visible }),
51
+ setSettingsOpen: (open) => set({ isSettingsOpen: open }),
52
+ setWorkspaces: (workspaces) => set({ workspaces }),
53
+ addWorkspace: (workspace) => set((state) => ({
54
+ workspaces: [...state.workspaces, workspace],
55
+ activeWorkspaceId: workspace.id
56
+ })),
57
+ removeWorkspace: (id) => set((state) => ({
58
+ workspaces: state.workspaces.filter(ws => ws.id !== id),
59
+ activeWorkspaceId: state.activeWorkspaceId === id
60
+ ? (state.workspaces.find(ws => ws.id !== id)?.id || null)
61
+ : state.activeWorkspaceId
62
+ })),
63
+ setActiveWorkspace: (id) => set({ activeWorkspaceId: id }),
64
+ }));
@@ -0,0 +1,54 @@
1
+ export interface Message {
2
+ id: string;
3
+ role: 'user' | 'assistant' | 'system';
4
+ content: string;
5
+ timestamp: string;
6
+ thinking?: string;
7
+ toolCalls?: ToolCall[];
8
+ attachments?: any[];
9
+ }
10
+
11
+ export interface ToolCall {
12
+ name: string;
13
+ args: any;
14
+ result?: any;
15
+ }
16
+
17
+ export interface Session {
18
+ id: string;
19
+ title: string;
20
+ agentId: string;
21
+ workdir?: string;
22
+ parentId?: string;
23
+ updatedAt: string;
24
+ messages: Message[];
25
+ }
26
+
27
+ export interface Agent {
28
+ id: string;
29
+ name: string;
30
+ description: string;
31
+ }
32
+
33
+ export interface Model {
34
+ id: string;
35
+ name: string;
36
+ provider: string;
37
+ isAvailable?: boolean;
38
+ }
39
+
40
+ export interface FSItem {
41
+ name: string;
42
+ path: string;
43
+ isDirectory: boolean;
44
+ size: number;
45
+ }
46
+
47
+ export interface SidebarProps {
48
+ isCollapsed: boolean;
49
+ onToggle: () => void;
50
+ currentSessionId: string | null;
51
+ onSessionSelect: (id: string) => void;
52
+ activeModule: 'chat' | 'explorer';
53
+ onModuleChange: (module: 'chat' | 'explorer') => void;
54
+ }