@frenchtoastman/oh-my-groundcontrol 0.0.1
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/LICENSE +21 -0
- package/README.md +264 -0
- package/dist/agents/designer.d.ts +2 -0
- package/dist/agents/explorer.d.ts +2 -0
- package/dist/agents/fixer.d.ts +2 -0
- package/dist/agents/index.d.ts +22 -0
- package/dist/agents/librarian.d.ts +2 -0
- package/dist/agents/oracle.d.ts +2 -0
- package/dist/agents/orchestrator.d.ts +15 -0
- package/dist/background/background-manager.d.ts +175 -0
- package/dist/background/index.d.ts +2 -0
- package/dist/background/tmux-session-manager.d.ts +63 -0
- package/dist/cli/chutes-selection.d.ts +3 -0
- package/dist/cli/config-io.d.ts +26 -0
- package/dist/cli/config-manager.d.ts +12 -0
- package/dist/cli/custom-skills.d.ts +29 -0
- package/dist/cli/dynamic-model-selection.d.ts +14 -0
- package/dist/cli/external-rankings.d.ts +8 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +17082 -0
- package/dist/cli/install.d.ts +2 -0
- package/dist/cli/model-key-normalization.d.ts +1 -0
- package/dist/cli/model-selection.d.ts +30 -0
- package/dist/cli/opencode-models.d.ts +18 -0
- package/dist/cli/opencode-selection.d.ts +3 -0
- package/dist/cli/paths.d.ts +9 -0
- package/dist/cli/precedence-resolver.d.ts +16 -0
- package/dist/cli/providers.d.ts +204 -0
- package/dist/cli/scoring-v2/engine.d.ts +4 -0
- package/dist/cli/scoring-v2/features.d.ts +3 -0
- package/dist/cli/scoring-v2/index.d.ts +4 -0
- package/dist/cli/scoring-v2/types.d.ts +17 -0
- package/dist/cli/scoring-v2/weights.d.ts +2 -0
- package/dist/cli/skills.d.ts +52 -0
- package/dist/cli/system.d.ts +6 -0
- package/dist/cli/types.d.ts +138 -0
- package/dist/config/agent-mcps.d.ts +15 -0
- package/dist/config/constants.d.ts +14 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/loader.d.ts +30 -0
- package/dist/config/schema.d.ts +229 -0
- package/dist/config/utils.d.ts +10 -0
- package/dist/config/validate-providers.d.ts +7 -0
- package/dist/hooks/auto-update-checker/cache.d.ts +6 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +28 -0
- package/dist/hooks/auto-update-checker/constants.d.ts +11 -0
- package/dist/hooks/auto-update-checker/index.d.ts +17 -0
- package/dist/hooks/auto-update-checker/types.d.ts +23 -0
- package/dist/hooks/delegate-task-retry/guidance.d.ts +2 -0
- package/dist/hooks/delegate-task-retry/hook.d.ts +8 -0
- package/dist/hooks/delegate-task-retry/index.d.ts +4 -0
- package/dist/hooks/delegate-task-retry/patterns.d.ts +11 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/json-error-recovery/hook.d.ts +18 -0
- package/dist/hooks/json-error-recovery/index.d.ts +1 -0
- package/dist/hooks/phase-reminder/index.d.ts +25 -0
- package/dist/hooks/post-read-nudge/index.d.ts +18 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +33819 -0
- package/dist/mcp/context7.d.ts +6 -0
- package/dist/mcp/grep-app.d.ts +6 -0
- package/dist/mcp/index.d.ts +6 -0
- package/dist/mcp/types.d.ts +12 -0
- package/dist/mcp/websearch.d.ts +6 -0
- package/dist/session/index.d.ts +2 -0
- package/dist/session/session-exporter.d.ts +83 -0
- package/dist/tools/ast-grep/cli.d.ts +15 -0
- package/dist/tools/ast-grep/constants.d.ts +25 -0
- package/dist/tools/ast-grep/downloader.d.ts +5 -0
- package/dist/tools/ast-grep/index.d.ts +10 -0
- package/dist/tools/ast-grep/tools.d.ts +3 -0
- package/dist/tools/ast-grep/types.d.ts +30 -0
- package/dist/tools/ast-grep/utils.d.ts +4 -0
- package/dist/tools/background.d.ts +13 -0
- package/dist/tools/grep/cli.d.ts +3 -0
- package/dist/tools/grep/constants.d.ts +18 -0
- package/dist/tools/grep/downloader.d.ts +3 -0
- package/dist/tools/grep/index.d.ts +5 -0
- package/dist/tools/grep/tools.d.ts +2 -0
- package/dist/tools/grep/types.d.ts +35 -0
- package/dist/tools/grep/utils.d.ts +2 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/lsp/client.d.ts +42 -0
- package/dist/tools/lsp/config.d.ts +4 -0
- package/dist/tools/lsp/constants.d.ts +8 -0
- package/dist/tools/lsp/index.d.ts +3 -0
- package/dist/tools/lsp/tools.d.ts +5 -0
- package/dist/tools/lsp/types.d.ts +28 -0
- package/dist/tools/lsp/utils.d.ts +21 -0
- package/dist/utils/agent-variant.d.ts +47 -0
- package/dist/utils/env.d.ts +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/logger.d.ts +1 -0
- package/dist/utils/polling.d.ts +21 -0
- package/dist/utils/tmux.d.ts +32 -0
- package/dist/utils/zip-extractor.d.ts +1 -0
- package/package.json +68 -0
- package/src/skills/cartography/README.md +57 -0
- package/src/skills/cartography/SKILL.md +137 -0
- package/src/skills/cartography/scripts/cartographer.py +456 -0
- package/src/skills/cartography/scripts/test_cartographer.py +87 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
import os
|
|
3
|
+
import shutil
|
|
4
|
+
import json
|
|
5
|
+
import tempfile
|
|
6
|
+
import hashlib
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from cartographer import PatternMatcher, compute_file_hash, compute_folder_hash, select_files
|
|
9
|
+
|
|
10
|
+
class TestCartographer(unittest.TestCase):
|
|
11
|
+
def test_pattern_matcher(self):
|
|
12
|
+
patterns = ["node_modules/", "dist/", "*.log", "src/**/*.ts"]
|
|
13
|
+
matcher = PatternMatcher(patterns)
|
|
14
|
+
|
|
15
|
+
# Directory patterns
|
|
16
|
+
self.assertTrue(matcher.matches("node_modules/foo.js"))
|
|
17
|
+
self.assertTrue(matcher.matches("vendor/node_modules/bar.js"))
|
|
18
|
+
self.assertTrue(matcher.matches("dist/main.js"))
|
|
19
|
+
self.assertTrue(matcher.matches("src/dist/output.js"))
|
|
20
|
+
|
|
21
|
+
# Glob patterns
|
|
22
|
+
self.assertTrue(matcher.matches("error.log"))
|
|
23
|
+
self.assertTrue(matcher.matches("logs/access.log"))
|
|
24
|
+
|
|
25
|
+
# Recursive glob patterns
|
|
26
|
+
self.assertTrue(matcher.matches("src/index.ts"))
|
|
27
|
+
self.assertTrue(matcher.matches("src/utils/helper.ts"))
|
|
28
|
+
|
|
29
|
+
# Non-matches
|
|
30
|
+
self.assertFalse(matcher.matches("README.md"))
|
|
31
|
+
self.assertFalse(matcher.matches("tests/test.py"))
|
|
32
|
+
|
|
33
|
+
def test_compute_file_hash(self):
|
|
34
|
+
# Use binary mode to avoid any newline translation issues
|
|
35
|
+
with tempfile.NamedTemporaryFile(mode='wb', delete=False) as f:
|
|
36
|
+
f.write(b"test content")
|
|
37
|
+
f_path = f.name
|
|
38
|
+
|
|
39
|
+
try:
|
|
40
|
+
h1 = compute_file_hash(Path(f_path))
|
|
41
|
+
# md5 of b"test content" is 9473fdd0d880a43c21b7778d34872157
|
|
42
|
+
expected = hashlib.md5(b"test content").hexdigest()
|
|
43
|
+
self.assertEqual(h1, expected)
|
|
44
|
+
self.assertEqual(h1, "9473fdd0d880a43c21b7778d34872157")
|
|
45
|
+
finally:
|
|
46
|
+
if os.path.exists(f_path):
|
|
47
|
+
os.unlink(f_path)
|
|
48
|
+
|
|
49
|
+
def test_compute_folder_hash(self):
|
|
50
|
+
file_hashes = {
|
|
51
|
+
"src/a.ts": "hash-a",
|
|
52
|
+
"src/b.ts": "hash-b",
|
|
53
|
+
"tests/test.ts": "hash-test"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
h1 = compute_folder_hash("src", file_hashes)
|
|
57
|
+
h2 = compute_folder_hash("src", file_hashes)
|
|
58
|
+
self.assertEqual(h1, h2)
|
|
59
|
+
|
|
60
|
+
file_hashes_alt = {
|
|
61
|
+
"src/a.ts": "hash-a-modified",
|
|
62
|
+
"src/b.ts": "hash-b"
|
|
63
|
+
}
|
|
64
|
+
h3 = compute_folder_hash("src", file_hashes_alt)
|
|
65
|
+
self.assertNotEqual(h1, h3)
|
|
66
|
+
|
|
67
|
+
def test_select_files(self):
|
|
68
|
+
with tempfile.TemporaryDirectory() as tmpdir:
|
|
69
|
+
root = Path(tmpdir)
|
|
70
|
+
(root / "src").mkdir()
|
|
71
|
+
(root / "node_modules").mkdir()
|
|
72
|
+
(root / "src" / "index.ts").write_text("code")
|
|
73
|
+
(root / "src" / "index.test.ts").write_text("test")
|
|
74
|
+
(root / "node_modules" / "foo.js").write_text("dep")
|
|
75
|
+
(root / "package.json").write_text("{}")
|
|
76
|
+
|
|
77
|
+
includes = ["src/**/*.ts", "package.json"]
|
|
78
|
+
excludes = ["**/*.test.ts", "node_modules/"]
|
|
79
|
+
exceptions = []
|
|
80
|
+
|
|
81
|
+
selected = select_files(root, includes, excludes, exceptions, [])
|
|
82
|
+
|
|
83
|
+
rel_selected = sorted([os.path.relpath(f, root) for f in selected])
|
|
84
|
+
self.assertEqual(rel_selected, ["package.json", "src/index.ts"])
|
|
85
|
+
|
|
86
|
+
if __name__ == "__main__":
|
|
87
|
+
unittest.main()
|