packet-tracer-skill 0.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.
- package/LICENSE +21 -0
- package/LICENSES/LICENSE.Twofish-BSD-3-Clause.txt +29 -0
- package/README.md +687 -0
- package/SKILL.md +221 -0
- package/bin/packet-tracer-skill.js +635 -0
- package/examples/blueprint_minimal.json +46 -0
- package/package.json +42 -0
- package/references/packettracer-sample-catalog.json +21410 -0
- package/references/packettracer-sample-catalog.md +1124 -0
- package/references/pkt-format.md +57 -0
- package/references/xml-skeleton-notes.md +44 -0
- package/requirements-dev.txt +1 -0
- package/requirements.txt +6 -0
- package/scripts/build_sample_catalog.py +65 -0
- package/scripts/donor_diagnostics.py +35 -0
- package/scripts/generate_pkt.py +1264 -0
- package/scripts/install_skill.py +71 -0
- package/scripts/intent_parser.py +712 -0
- package/scripts/packet_tracer_env.py +278 -0
- package/scripts/pkt_builder.py +15 -0
- package/scripts/pkt_codec.py +181 -0
- package/scripts/pkt_editor.py +752 -0
- package/scripts/pkt_transformer.py +541 -0
- package/scripts/sample_catalog.py +385 -0
- package/scripts/sample_selector.py +156 -0
- package/scripts/setup.ps1 +26 -0
- package/scripts/twofish_diagnostics.py +91 -0
- package/scripts/vendor/README.md +46 -0
- package/scripts/vendor/twofish.py +81 -0
- package/scripts/workspace_repair.py +441 -0
- package/templates/pt900/base_empty.xml +21 -0
- package/templates/pt900/device_library/pc.xml +20 -0
- package/templates/pt900/device_library/printer.xml +432 -0
- package/templates/pt900/device_library/router.xml +16 -0
- package/templates/pt900/device_library/switch.xml +38 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import shutil
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
HOST_PATHS = {
|
|
9
|
+
"codex": Path.home() / ".codex" / "skills" / "pkt",
|
|
10
|
+
"claude": Path.home() / ".claude" / "skills" / "pkt",
|
|
11
|
+
"cursor": Path.home() / ".cursor" / "skills" / "pkt",
|
|
12
|
+
"kiro": Path.home() / ".kiro" / "skills" / "pkt",
|
|
13
|
+
"adal": Path.home() / ".adal" / "skills" / "pkt",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
IGNORE_NAMES = {
|
|
17
|
+
".git",
|
|
18
|
+
".venv",
|
|
19
|
+
"venv",
|
|
20
|
+
"__pycache__",
|
|
21
|
+
".pytest_cache",
|
|
22
|
+
"output",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _copytree(src: Path, dst: Path) -> None:
|
|
27
|
+
for item in src.iterdir():
|
|
28
|
+
if item.name in IGNORE_NAMES:
|
|
29
|
+
continue
|
|
30
|
+
if item.suffix.lower() in {".pyc", ".pyo", ".pkt", ".xml"}:
|
|
31
|
+
continue
|
|
32
|
+
target = dst / item.name
|
|
33
|
+
if item.is_dir():
|
|
34
|
+
target.mkdir(parents=True, exist_ok=True)
|
|
35
|
+
_copytree(item, target)
|
|
36
|
+
else:
|
|
37
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
38
|
+
shutil.copy2(item, target)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def main() -> int:
|
|
42
|
+
parser = argparse.ArgumentParser(description="Install pkt skill into a local host skill directory.")
|
|
43
|
+
parser.add_argument("--host", choices=sorted(HOST_PATHS), help="Known host name.")
|
|
44
|
+
parser.add_argument("--path", help="Custom destination directory. Final skill folder will be <path>/pkt unless --direct is used.")
|
|
45
|
+
parser.add_argument("--direct", action="store_true", help="Treat --path as the final skill directory instead of the parent skills folder.")
|
|
46
|
+
parser.add_argument("--force", action="store_true", help="Replace the target directory if it already exists.")
|
|
47
|
+
args = parser.parse_args()
|
|
48
|
+
|
|
49
|
+
repo_root = Path(__file__).resolve().parents[1]
|
|
50
|
+
|
|
51
|
+
if args.host:
|
|
52
|
+
destination = HOST_PATHS[args.host]
|
|
53
|
+
elif args.path:
|
|
54
|
+
base = Path(args.path).expanduser()
|
|
55
|
+
destination = base if args.direct else base / "pkt"
|
|
56
|
+
else:
|
|
57
|
+
parser.error("Provide --host or --path.")
|
|
58
|
+
|
|
59
|
+
if destination.exists():
|
|
60
|
+
if not args.force:
|
|
61
|
+
raise SystemExit(f"Target already exists: {destination}. Use --force to replace it.")
|
|
62
|
+
shutil.rmtree(destination)
|
|
63
|
+
|
|
64
|
+
destination.mkdir(parents=True, exist_ok=True)
|
|
65
|
+
_copytree(repo_root, destination)
|
|
66
|
+
print(destination)
|
|
67
|
+
return 0
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
if __name__ == "__main__":
|
|
71
|
+
raise SystemExit(main())
|