Skip to content

Commit 2ad410c

Browse files
Samanyu Goyalcursoragent
authored andcommitted
Simplify Moss Pikachu to local-only indexing and address PR review feedback.
Load search index from disk only, save locally on a schedule, stream folder scans to limit memory use, return per-file chunk counts for accurate manifest updates, gate debug logging behind --debug, remove unused bundled assets, and add first-run credential setup with configurable folder scope. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 5176646 commit 2ad410c

30 files changed

Lines changed: 1342 additions & 375 deletions

examples/moss-pikachu/.cursor/skills/moss-pikachu/SKILL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ description: >-
99

1010
# Moss Pikachu Agent Skill
1111

12+
## Project docs (start here)
13+
14+
| Doc | Purpose |
15+
|-----|---------|
16+
| [project-summary.md](../../project-summary.md) | Full technical reference |
17+
| [how-to.md](../../how-to.md) | End-user guide |
18+
| [contribution.md](../../contribution.md) | Contributor guide |
19+
20+
## Specialized skills
21+
22+
| Skill | Use when |
23+
|-------|----------|
24+
| [moss-pikachu-semantic-search](../moss-pikachu-semantic-search/SKILL.md) | Search quality, query tuning |
25+
| [moss-pikachu-indexing](../moss-pikachu-indexing/SKILL.md) | Indexing, manual/automatic modes |
26+
| [moss-pikachu-contributing](../moss-pikachu-contributing/SKILL.md) | PRs and contribution workflow |
27+
1228
## Read order
1329

1430
1. [architecture.md](architecture.md)

examples/moss-pikachu/.cursor/skills/moss-pikachu/moss-integration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Uses **PyPI `moss>=1.6.0`**, not editable install from `vendor/moss/sdks/python/
1919
|--------|-------|--------|
2020
| `ping` | `{}` | `{"status":"ok"}` |
2121
| `init_session` | `{"index_name":"documents"}` | `{"status":"ok","doc_count":N}` |
22-
| `add_docs` | `{"files":["/path/a.md"]}` | `{"status":"ok","added":N,"updated":M}` |
22+
| `add_docs` | `{"files":["/path/a.md"]}` | `{"status":"ok","chunks_indexed":N,"file_chunk_counts":{"/path/a.md":3}}` |
2323
| `query` | `{"query":"text","top_k":5}` | `{"results":[...],"timing_ms":4.2}` |
24-
| `push_index` | `{}` | `{"status":"ok","doc_count":N}` |
24+
| `save_session` | `{"cache_path":"..."}` | `{"status":"ok","doc_count":N}` |
2525
| `clear_index` | `{}` | `{"status":"ok"}` |
2626

2727
### Error shape
@@ -37,7 +37,7 @@ client = MossClient(os.environ["MOSS_PROJECT_ID"], os.environ["MOSS_PROJECT_KEY"
3737
session = await client.session(index_name="documents")
3838
await session.add_docs([DocumentInfo(id=path, text=content, metadata={"path": path, "filename": name})])
3939
results = await session.query("query", QueryOptions(top_k=5, alpha=0.6))
40-
await session.push_index() # optional cloud sync
40+
session._inner.save_to_disk(cache_path) # local persistence only
4141
```
4242

4343
## Text extraction

examples/moss-pikachu/.cursor/skills/moss-pikachu/ui-animations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Search overlay sizing
44

5-
- Width: 500pt
5+
- Width: 300pt (thought bubble)
66
- Max height: 600pt (results scroll inside)
77
- Corner radius: 12pt
88
- Shadow: `radius: 20, y: 8, opacity: 0.25`
@@ -28,4 +28,4 @@ Use SwiftUI `.animation(.easeInOut, value:)` and `Timer` for random idle interva
2828

2929
## Search input debounce
3030

31-
200ms after last keystroke before calling `SearchService.search`.
31+
160ms after last keystroke before calling `SearchService.search`.

examples/moss-pikachu/MossPikachu.xcodeproj/project.pbxproj

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
MPB0000000000000000006 /* PikachuPetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000006 /* PikachuPetView.swift */; };
1616
MPB0000000000000000007 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000007 /* SettingsView.swift */; };
1717
MPB0000000000000000008 /* SettingsWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000008 /* SettingsWindowController.swift */; };
18-
MPB0000000000000000009 /* KeyEventHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000009 /* KeyEventHandler.swift */; };
1918
MPB0000000000000000010 /* SearchResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000010 /* SearchResult.swift */; };
2019
MPB0000000000000000011 /* PetState.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000011 /* PetState.swift */; };
2120
MPB0000000000000000012 /* FileSystemEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000012 /* FileSystemEvent.swift */; };
@@ -28,19 +27,20 @@
2827
MPB0000000000000000019 /* HotKeyManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000019 /* HotKeyManager.swift */; };
2928
MPB0000000000000000020 /* AppLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000020 /* AppLogger.swift */; };
3029
MPB0000000000000000021 /* moss_worker.py in Resources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000021 /* moss_worker.py */; };
31-
MPB0000000000000000022 /* config.json in Resources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000022 /* config.json */; };
3230
MPB0000000000000000023 /* capvolt-sticker.png in Resources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000023 /* capvolt-sticker.png */; };
33-
MPB0000000000000000024 /* capvolt-sticker.webp in Resources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000024 /* capvolt-sticker.webp */; };
3431
MPB0000000000000000025 /* CapvoltSticker.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000025 /* CapvoltSticker.swift */; };
3532
MPB0000000000000000026 /* DotEnvLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000026 /* DotEnvLoader.swift */; };
3633
MPB0000000000000000027 /* FloatingPetWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000027 /* FloatingPetWindowController.swift */; };
3734
MPB0000000000000000028 /* SearchOverlayPresentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000028 /* SearchOverlayPresentation.swift */; };
3835
MPB0000000000000000030 /* IndexingPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000030 /* IndexingPolicy.swift */; };
3936
MPB0000000000000000031 /* IndexingBootstrapWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000031 /* IndexingBootstrapWindowController.swift */; };
40-
MPB0000000000000000032 /* pet.json in Resources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000032 /* pet.json */; };
4137
MPB0000000000000000033 /* spritesheet.webp in Resources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000033 /* spritesheet.webp */; };
4238
MPB0000000000000000034 /* CapvoltPetAssets.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000034 /* CapvoltPetAssets.swift */; };
4339
MPB0000000000000000035 /* CapvoltSpritesheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000035 /* CapvoltSpritesheetView.swift */; };
40+
MPB0000000000000000036 /* MossPikachuPaths.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000036 /* MossPikachuPaths.swift */; };
41+
MPB0000000000000000037 /* PythonEnvironment.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000037 /* PythonEnvironment.swift */; };
42+
MPB0000000000000000038 /* CredentialsSetupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000038 /* CredentialsSetupView.swift */; };
43+
MPB0000000000000000039 /* CredentialsSetupWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = MPF0000000000000000039 /* CredentialsSetupWindowController.swift */; };
4444
/* End PBXBuildFile section */
4545

4646
/* Begin PBXFileReference section */
@@ -53,7 +53,6 @@
5353
MPF0000000000000000006 /* PikachuPetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PikachuPetView.swift; sourceTree = "<group>"; };
5454
MPF0000000000000000007 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
5555
MPF0000000000000000008 /* SettingsWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsWindowController.swift; sourceTree = "<group>"; };
56-
MPF0000000000000000009 /* KeyEventHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyEventHandler.swift; sourceTree = "<group>"; };
5756
MPF0000000000000000010 /* SearchResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResult.swift; sourceTree = "<group>"; };
5857
MPF0000000000000000011 /* PetState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetState.swift; sourceTree = "<group>"; };
5958
MPF0000000000000000012 /* FileSystemEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSystemEvent.swift; sourceTree = "<group>"; };
@@ -66,19 +65,20 @@
6665
MPF0000000000000000019 /* HotKeyManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HotKeyManager.swift; sourceTree = "<group>"; };
6766
MPF0000000000000000020 /* AppLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLogger.swift; sourceTree = "<group>"; };
6867
MPF0000000000000000021 /* moss_worker.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = moss_worker.py; sourceTree = "<group>"; };
69-
MPF0000000000000000022 /* config.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = config.json; sourceTree = "<group>"; };
7068
MPF0000000000000000023 /* capvolt-sticker.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = capvolt-sticker.png; sourceTree = "<group>"; };
71-
MPF0000000000000000024 /* capvolt-sticker.webp */ = {isa = PBXFileReference; lastKnownFileType = file; path = capvolt-sticker.webp; sourceTree = "<group>"; };
7269
MPF0000000000000000025 /* CapvoltSticker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CapvoltSticker.swift; sourceTree = "<group>"; };
7370
MPF0000000000000000026 /* DotEnvLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DotEnvLoader.swift; sourceTree = "<group>"; };
7471
MPF0000000000000000027 /* FloatingPetWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FloatingPetWindowController.swift; sourceTree = "<group>"; };
7572
MPF0000000000000000028 /* SearchOverlayPresentation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchOverlayPresentation.swift; sourceTree = "<group>"; };
7673
MPF0000000000000000030 /* IndexingPolicy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IndexingPolicy.swift; sourceTree = "<group>"; };
7774
MPF0000000000000000031 /* IndexingBootstrapWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IndexingBootstrapWindowController.swift; sourceTree = "<group>"; };
78-
MPF0000000000000000032 /* pet.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = pet.json; path = pets/capvolt/pet.json; sourceTree = "<group>"; };
7975
MPF0000000000000000033 /* spritesheet.webp */ = {isa = PBXFileReference; lastKnownFileType = file; name = spritesheet.webp; path = pets/capvolt/spritesheet.webp; sourceTree = "<group>"; };
8076
MPF0000000000000000034 /* CapvoltPetAssets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CapvoltPetAssets.swift; sourceTree = "<group>"; };
8177
MPF0000000000000000035 /* CapvoltSpritesheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CapvoltSpritesheetView.swift; sourceTree = "<group>"; };
78+
MPF0000000000000000036 /* MossPikachuPaths.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MossPikachuPaths.swift; sourceTree = "<group>"; };
79+
MPF0000000000000000037 /* PythonEnvironment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PythonEnvironment.swift; sourceTree = "<group>"; };
80+
MPF0000000000000000038 /* CredentialsSetupView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CredentialsSetupView.swift; sourceTree = "<group>"; };
81+
MPF0000000000000000039 /* CredentialsSetupWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CredentialsSetupWindowController.swift; sourceTree = "<group>"; };
8282
/* End PBXFileReference section */
8383

8484
/* Begin PBXFrameworksBuildPhase section */
@@ -134,7 +134,8 @@
134134
MPF0000000000000000007 /* SettingsView.swift */,
135135
MPF0000000000000000008 /* SettingsWindowController.swift */,
136136
MPF0000000000000000031 /* IndexingBootstrapWindowController.swift */,
137-
MPF0000000000000000009 /* KeyEventHandler.swift */,
137+
MPF0000000000000000038 /* CredentialsSetupView.swift */,
138+
MPF0000000000000000039 /* CredentialsSetupWindowController.swift */,
138139
);
139140
path = Views;
140141
sourceTree = "<group>";
@@ -147,6 +148,7 @@
147148
MPF0000000000000000012 /* FileSystemEvent.swift */,
148149
MPF0000000000000000013 /* UserSettings.swift */,
149150
MPF0000000000000000030 /* IndexingPolicy.swift */,
151+
MPF0000000000000000036 /* MossPikachuPaths.swift */,
150152
);
151153
path = Models;
152154
sourceTree = "<group>";
@@ -164,6 +166,7 @@
164166
MPF0000000000000000025 /* CapvoltSticker.swift */,
165167
MPF0000000000000000034 /* CapvoltPetAssets.swift */,
166168
MPF0000000000000000026 /* DotEnvLoader.swift */,
169+
MPF0000000000000000037 /* PythonEnvironment.swift */,
167170
);
168171
path = Services;
169172
sourceTree = "<group>";
@@ -172,10 +175,7 @@
172175
isa = PBXGroup;
173176
children = (
174177
MPF0000000000000000021 /* moss_worker.py */,
175-
MPF0000000000000000022 /* config.json */,
176178
MPF0000000000000000023 /* capvolt-sticker.png */,
177-
MPF0000000000000000024 /* capvolt-sticker.webp */,
178-
MPF0000000000000000032 /* pet.json */,
179179
MPF0000000000000000033 /* spritesheet.webp */,
180180
);
181181
path = Resources;
@@ -188,6 +188,7 @@
188188
isa = PBXNativeTarget;
189189
buildConfigurationList = MP0000000000000001100000 /* Build configuration list for PBXNativeTarget "MossPikachu" */;
190190
buildPhases = (
191+
MP0000000000000001500000 /* Setup Python venv */,
191192
MP0000000000000001200000 /* Sources */,
192193
MP0000000000000001300000 /* Frameworks */,
193194
MP0000000000000001400000 /* Resources */,
@@ -234,16 +235,35 @@
234235
};
235236
/* End PBXProject section */
236237

238+
/* Begin PBXShellScriptBuildPhase section */
239+
MP0000000000000001500000 /* Setup Python venv */ = {
240+
isa = PBXShellScriptBuildPhase;
241+
alwaysOutOfDate = 1;
242+
buildActionMask = 2147483647;
243+
files = (
244+
);
245+
inputFileListPaths = (
246+
);
247+
inputPaths = (
248+
);
249+
name = "Setup Python venv";
250+
outputFileListPaths = (
251+
);
252+
outputPaths = (
253+
);
254+
runOnlyForDeploymentPostprocessing = 0;
255+
shellPath = /bin/bash;
256+
shellScript = "set -euo pipefail\nif [ ! -x \"${SRCROOT}/.venv/bin/python3\" ] || ! \"${SRCROOT}/.venv/bin/python3\" -c \"from moss import MossClient\" 2>/dev/null; then\n echo \"Picklight: setting up Python venv...\"\n bash \"${SRCROOT}/scripts/setup-moss-venv.sh\"\nfi\n\"${SRCROOT}/.venv/bin/python3\" -c \"from moss import MossClient\"\n";
257+
};
258+
/* End PBXShellScriptBuildPhase section */
259+
237260
/* Begin PBXResourcesBuildPhase section */
238261
MP0000000000000001400000 /* Resources */ = {
239262
isa = PBXResourcesBuildPhase;
240263
buildActionMask = 2147483647;
241264
files = (
242265
MPB0000000000000000021 /* moss_worker.py in Resources */,
243-
MPB0000000000000000022 /* config.json in Resources */,
244266
MPB0000000000000000023 /* capvolt-sticker.png in Resources */,
245-
MPB0000000000000000024 /* capvolt-sticker.webp in Resources */,
246-
MPB0000000000000000032 /* pet.json in Resources */,
247267
MPB0000000000000000033 /* spritesheet.webp in Resources */,
248268
);
249269
runOnlyForDeploymentPostprocessing = 0;
@@ -263,7 +283,6 @@
263283
MPB0000000000000000006 /* PikachuPetView.swift in Sources */,
264284
MPB0000000000000000007 /* SettingsView.swift in Sources */,
265285
MPB0000000000000000008 /* SettingsWindowController.swift in Sources */,
266-
MPB0000000000000000009 /* KeyEventHandler.swift in Sources */,
267286
MPB0000000000000000010 /* SearchResult.swift in Sources */,
268287
MPB0000000000000000011 /* PetState.swift in Sources */,
269288
MPB0000000000000000012 /* FileSystemEvent.swift in Sources */,
@@ -283,6 +302,10 @@
283302
MPB0000000000000000031 /* IndexingBootstrapWindowController.swift in Sources */,
284303
MPB0000000000000000034 /* CapvoltPetAssets.swift in Sources */,
285304
MPB0000000000000000035 /* CapvoltSpritesheetView.swift in Sources */,
305+
MPB0000000000000000036 /* MossPikachuPaths.swift in Sources */,
306+
MPB0000000000000000037 /* PythonEnvironment.swift in Sources */,
307+
MPB0000000000000000038 /* CredentialsSetupView.swift in Sources */,
308+
MPB0000000000000000039 /* CredentialsSetupWindowController.swift in Sources */,
286309
);
287310
runOnlyForDeploymentPostprocessing = 0;
288311
};
@@ -376,15 +399,16 @@
376399
ENABLE_HARDENED_RUNTIME = YES;
377400
ENABLE_PREVIEWS = YES;
378401
GENERATE_INFOPLIST_FILE = YES;
402+
INFOPLIST_KEY_CFBundleDisplayName = Picklight;
379403
INFOPLIST_KEY_LSUIElement = YES;
380-
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2026 Moss Pikachu.";
404+
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2026 Picklight.";
381405
LD_RUNPATH_SEARCH_PATHS = (
382406
"$(inherited)",
383407
"@executable_path/../Frameworks",
384408
);
385409
MARKETING_VERSION = 1.0;
386410
PRODUCT_BUNDLE_IDENTIFIER = dev.moss.pikachu;
387-
PRODUCT_NAME = "$(TARGET_NAME)";
411+
PRODUCT_NAME = Picklight;
388412
SUPPORTED_PLATFORMS = macosx;
389413
SWIFT_APPROACHABLE_CONCURRENCY = YES;
390414
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
@@ -404,15 +428,16 @@
404428
ENABLE_HARDENED_RUNTIME = YES;
405429
ENABLE_PREVIEWS = YES;
406430
GENERATE_INFOPLIST_FILE = YES;
431+
INFOPLIST_KEY_CFBundleDisplayName = Picklight;
407432
INFOPLIST_KEY_LSUIElement = YES;
408-
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2026 Moss Pikachu.";
433+
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2026 Picklight.";
409434
LD_RUNPATH_SEARCH_PATHS = (
410435
"$(inherited)",
411436
"@executable_path/../Frameworks",
412437
);
413438
MARKETING_VERSION = 1.0;
414439
PRODUCT_BUNDLE_IDENTIFIER = dev.moss.pikachu;
415-
PRODUCT_NAME = "$(TARGET_NAME)";
440+
PRODUCT_NAME = Picklight;
416441
SUPPORTED_PLATFORMS = macosx;
417442
SWIFT_APPROACHABLE_CONCURRENCY = YES;
418443
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;

0 commit comments

Comments
 (0)