@cryptiklemur/lattice 1.2.0 → 1.4.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 (95) hide show
  1. package/.serena/project.yml +138 -0
  2. package/bun.lock +705 -2
  3. package/client/index.html +1 -13
  4. package/client/package.json +6 -1
  5. package/client/src/App.tsx +2 -0
  6. package/client/src/commands.ts +36 -0
  7. package/client/src/components/chat/AttachmentChips.tsx +116 -0
  8. package/client/src/components/chat/ChatInput.tsx +250 -73
  9. package/client/src/components/chat/ChatView.tsx +242 -10
  10. package/client/src/components/chat/CommandPalette.tsx +162 -0
  11. package/client/src/components/chat/Message.tsx +23 -2
  12. package/client/src/components/chat/PromptQuestion.tsx +271 -0
  13. package/client/src/components/chat/TodoCard.tsx +57 -0
  14. package/client/src/components/chat/ToolResultRenderer.tsx +2 -1
  15. package/client/src/components/chat/VoiceRecorder.tsx +85 -0
  16. package/client/src/components/project-settings/ProjectClaude.tsx +14 -0
  17. package/client/src/components/project-settings/ProjectMemory.tsx +12 -2
  18. package/client/src/components/project-settings/ProjectNotifications.tsx +48 -0
  19. package/client/src/components/project-settings/ProjectRules.tsx +10 -1
  20. package/client/src/components/project-settings/ProjectSettingsView.tsx +6 -0
  21. package/client/src/components/settings/Appearance.tsx +1 -0
  22. package/client/src/components/settings/ClaudeSettings.tsx +24 -0
  23. package/client/src/components/settings/Editor.tsx +123 -0
  24. package/client/src/components/settings/GlobalMcp.tsx +10 -1
  25. package/client/src/components/settings/GlobalMemory.tsx +19 -0
  26. package/client/src/components/settings/GlobalRules.tsx +149 -0
  27. package/client/src/components/settings/GlobalSkills.tsx +10 -0
  28. package/client/src/components/settings/Notifications.tsx +88 -0
  29. package/client/src/components/settings/SettingsView.tsx +12 -0
  30. package/client/src/components/settings/skill-shared.tsx +2 -1
  31. package/client/src/components/setup/SetupWizard.tsx +1 -1
  32. package/client/src/components/sidebar/AddProjectModal.tsx +3 -2
  33. package/client/src/components/sidebar/NodeSettingsModal.tsx +23 -1
  34. package/client/src/components/sidebar/ProjectDropdown.tsx +176 -27
  35. package/client/src/components/sidebar/SettingsSidebar.tsx +11 -1
  36. package/client/src/components/sidebar/Sidebar.tsx +35 -2
  37. package/client/src/components/sidebar/UserIsland.tsx +18 -7
  38. package/client/src/components/ui/UpdatePrompt.tsx +47 -0
  39. package/client/src/components/workspace/FileBrowser.tsx +174 -0
  40. package/client/src/components/workspace/FileTree.tsx +129 -0
  41. package/client/src/components/workspace/FileViewer.tsx +211 -0
  42. package/client/src/components/workspace/NoteCard.tsx +119 -0
  43. package/client/src/components/workspace/NotesView.tsx +102 -0
  44. package/client/src/components/workspace/ScheduledTasksView.tsx +117 -0
  45. package/client/src/components/workspace/SplitPane.tsx +81 -0
  46. package/client/src/components/workspace/TabBar.tsx +185 -0
  47. package/client/src/components/workspace/TaskCard.tsx +158 -0
  48. package/client/src/components/workspace/TaskEditModal.tsx +114 -0
  49. package/client/src/components/{panels/Terminal.tsx → workspace/TerminalInstance.tsx} +50 -7
  50. package/client/src/components/workspace/TerminalView.tsx +110 -0
  51. package/client/src/components/workspace/WorkspaceView.tsx +116 -0
  52. package/client/src/hooks/useAttachments.ts +280 -0
  53. package/client/src/hooks/useEditorConfig.ts +28 -0
  54. package/client/src/hooks/useIdleDetection.ts +44 -0
  55. package/client/src/hooks/useInstallPrompt.ts +53 -0
  56. package/client/src/hooks/useNotifications.ts +54 -0
  57. package/client/src/hooks/useOnline.ts +6 -0
  58. package/client/src/hooks/useSession.ts +110 -4
  59. package/client/src/hooks/useSpinnerVerb.ts +36 -0
  60. package/client/src/hooks/useSwipeDrawer.ts +275 -0
  61. package/client/src/hooks/useVoiceRecorder.ts +123 -0
  62. package/client/src/hooks/useWorkspace.ts +48 -0
  63. package/client/src/providers/WebSocketProvider.tsx +18 -0
  64. package/client/src/router.tsx +48 -20
  65. package/client/src/stores/session.ts +136 -0
  66. package/client/src/stores/sidebar.ts +3 -2
  67. package/client/src/stores/workspace.ts +254 -0
  68. package/client/src/styles/global.css +131 -0
  69. package/client/src/utils/editorUrl.ts +62 -0
  70. package/client/vite.config.ts +53 -1
  71. package/package.json +1 -1
  72. package/server/src/daemon.ts +11 -1
  73. package/server/src/features/scheduler.ts +23 -0
  74. package/server/src/features/sticky-notes.ts +5 -3
  75. package/server/src/handlers/attachment.ts +172 -0
  76. package/server/src/handlers/chat.ts +43 -2
  77. package/server/src/handlers/editor.ts +40 -0
  78. package/server/src/handlers/fs.ts +10 -2
  79. package/server/src/handlers/memory.ts +3 -0
  80. package/server/src/handlers/notes.ts +4 -2
  81. package/server/src/handlers/scheduler.ts +18 -1
  82. package/server/src/handlers/session.ts +14 -8
  83. package/server/src/handlers/settings.ts +37 -2
  84. package/server/src/handlers/terminal.ts +13 -6
  85. package/server/src/project/pty-worker.cjs +83 -0
  86. package/server/src/project/sdk-bridge.ts +266 -11
  87. package/server/src/project/terminal.ts +78 -34
  88. package/shared/src/messages.ts +145 -4
  89. package/shared/src/models.ts +27 -1
  90. package/shared/src/project-settings.ts +1 -1
  91. package/tp.js +19 -0
  92. package/client/public/manifest.json +0 -24
  93. package/client/public/sw.js +0 -61
  94. package/client/src/components/panels/FileBrowser.tsx +0 -241
  95. package/client/src/components/panels/StickyNotes.tsx +0 -187
@@ -1,187 +0,0 @@
1
- import { useCallback, useEffect, useState } from "react";
2
- import type { StickyNote, ServerMessage } from "@lattice/shared";
3
- import { useWebSocket } from "../../hooks/useWebSocket";
4
-
5
- interface NoteCardProps {
6
- note: StickyNote;
7
- onEdit: (id: string) => void;
8
- onDelete: (id: string) => void;
9
- }
10
-
11
- function NoteCard(props: NoteCardProps) {
12
- var { note, onEdit, onDelete } = props;
13
- return (
14
- <div className="card bg-base-200 border border-base-300">
15
- <div className="card-body p-3">
16
- <div className="text-[13px] text-base-content whitespace-pre-wrap break-words leading-relaxed min-h-12">
17
- {note.content}
18
- </div>
19
- <div className="flex gap-1.5 justify-end mt-2">
20
- <button
21
- onClick={function () { onEdit(note.id); }}
22
- className="btn btn-ghost btn-xs border border-base-300"
23
- >
24
- Edit
25
- </button>
26
- <button
27
- onClick={function () { onDelete(note.id); }}
28
- className="btn btn-ghost btn-xs border border-base-300 text-base-content/60"
29
- >
30
- Delete
31
- </button>
32
- </div>
33
- </div>
34
- </div>
35
- );
36
- }
37
-
38
- interface EditModalProps {
39
- initial: string;
40
- onSave: (content: string) => void;
41
- onCancel: () => void;
42
- }
43
-
44
- function EditModal(props: EditModalProps) {
45
- var { initial, onSave, onCancel } = props;
46
- var [content, setContent] = useState(initial);
47
-
48
- return (
49
- <div className="fixed inset-0 bg-black/50 z-[1000] flex items-center justify-center" role="dialog" aria-modal="true" aria-label="Edit note">
50
- <div className="card bg-base-200 border border-base-300 w-[400px] max-w-[90vw] shadow-2xl">
51
- <div className="card-body p-5">
52
- <div className="text-[13px] font-semibold text-base-content mb-3">Edit Note</div>
53
- <textarea
54
- autoFocus
55
- value={content}
56
- onChange={function (e) { setContent(e.target.value); }}
57
- className="textarea textarea-bordered w-full min-h-[120px] bg-base-300 text-base-content text-[13px] resize-y"
58
- />
59
- <div className="flex gap-2 justify-end mt-3">
60
- <button
61
- onClick={onCancel}
62
- className="btn btn-ghost btn-sm"
63
- >
64
- Cancel
65
- </button>
66
- <button
67
- onClick={function () { onSave(content); }}
68
- className="btn btn-primary btn-sm"
69
- >
70
- Save
71
- </button>
72
- </div>
73
- </div>
74
- </div>
75
- </div>
76
- );
77
- }
78
-
79
- export function StickyNotes() {
80
- var { send, subscribe, unsubscribe } = useWebSocket();
81
- var [notes, setNotes] = useState<StickyNote[]>([]);
82
- var [editingId, setEditingId] = useState<string | null>(null);
83
- var [creating, setCreating] = useState(false);
84
-
85
- var editingNote = editingId ? notes.find(function (n) { return n.id === editingId; }) : null;
86
-
87
- var handleMessage = useCallback(function (msg: ServerMessage) {
88
- if (msg.type === "notes:list_result") {
89
- setNotes(msg.notes);
90
- return;
91
- }
92
- if (msg.type === "notes:created") {
93
- setNotes(function (prev) { return [...prev, msg.note]; });
94
- return;
95
- }
96
- if (msg.type === "notes:updated") {
97
- setNotes(function (prev) {
98
- return prev.map(function (n) { return n.id === msg.note.id ? msg.note : n; });
99
- });
100
- return;
101
- }
102
- if (msg.type === "notes:deleted") {
103
- setNotes(function (prev) { return prev.filter(function (n) { return n.id !== msg.id; }); });
104
- return;
105
- }
106
- }, []);
107
-
108
- useEffect(function () {
109
- subscribe("notes:list_result", handleMessage);
110
- subscribe("notes:created", handleMessage);
111
- subscribe("notes:updated", handleMessage);
112
- subscribe("notes:deleted", handleMessage);
113
- send({ type: "notes:list" });
114
- return function () {
115
- unsubscribe("notes:list_result", handleMessage);
116
- unsubscribe("notes:created", handleMessage);
117
- unsubscribe("notes:updated", handleMessage);
118
- unsubscribe("notes:deleted", handleMessage);
119
- };
120
- }, [send, subscribe, unsubscribe, handleMessage]);
121
-
122
- function handleCreate(content: string) {
123
- if (content.trim()) {
124
- send({ type: "notes:create", content: content.trim() });
125
- }
126
- setCreating(false);
127
- }
128
-
129
- function handleEdit(content: string) {
130
- if (editingId && content.trim()) {
131
- send({ type: "notes:update", id: editingId, content: content.trim() });
132
- }
133
- setEditingId(null);
134
- }
135
-
136
- function handleDelete(id: string) {
137
- send({ type: "notes:delete", id });
138
- }
139
-
140
- return (
141
- <div className="flex flex-col h-full bg-base-100">
142
- <div className="flex items-center justify-between px-4 py-3 border-b border-base-300">
143
- <span className="text-[13px] font-semibold text-base-content">Sticky Notes</span>
144
- <button
145
- onClick={function () { setCreating(true); }}
146
- className="btn btn-primary btn-xs"
147
- >
148
- New Note
149
- </button>
150
- </div>
151
-
152
- <div className="flex-1 overflow-auto p-3 flex flex-col gap-2.5">
153
- {notes.length === 0 && (
154
- <div className="text-base-content/50 text-[13px] text-center mt-10">
155
- No notes yet. Create one to get started.
156
- </div>
157
- )}
158
- {notes.map(function (note) {
159
- return (
160
- <NoteCard
161
- key={note.id}
162
- note={note}
163
- onEdit={setEditingId}
164
- onDelete={handleDelete}
165
- />
166
- );
167
- })}
168
- </div>
169
-
170
- {creating && (
171
- <EditModal
172
- initial=""
173
- onSave={handleCreate}
174
- onCancel={function () { setCreating(false); }}
175
- />
176
- )}
177
-
178
- {editingNote && (
179
- <EditModal
180
- initial={editingNote.content}
181
- onSave={handleEdit}
182
- onCancel={function () { setEditingId(null); }}
183
- />
184
- )}
185
- </div>
186
- );
187
- }