getflightplan 0.9.0__py3-none-any.whl

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.
flightplan/__init__.py ADDED
@@ -0,0 +1 @@
1
+ """Intent registry: agents post what they're about to do, check overlap, log outcomes."""
flightplan/cli.py ADDED
@@ -0,0 +1,83 @@
1
+ """FlightPlan front door (`getflightplan`) — the one command humans type.
2
+
3
+ A thin multiplex over the two things the package does, so a single branded
4
+ verb covers install and the MCP stdio client:
5
+
6
+ - `getflightplan install …` — forwards verbatim to the install kit
7
+ (`install.main`).
8
+ - `getflightplan uninstall …` — forwards verbatim to the removal kit
9
+ (`uninstall.main`).
10
+ - `getflightplan mcp` — runs the stdio MCP client (`mcp_server.main`), the
11
+ process an agent's MCP config launches.
12
+
13
+ The import package is `flightplan` too — one name everywhere (decision
14
+ f95c02e6); the legacy `intent-registry-*` scripts were dropped in that rename.
15
+
16
+ Stdlib only, and every heavy import is deferred into the subcommand that needs
17
+ it: the uvx client ships only httpx+mcp (pyproject.toml). Keep this file's
18
+ top-level imports to the standard library.
19
+ """
20
+
21
+ from __future__ import annotations
22
+
23
+ import argparse
24
+
25
+
26
+ def _version() -> str:
27
+ """The installed distribution version, or "unknown" when the metadata is
28
+ absent (e.g. run straight from a source tree that was never installed)."""
29
+ from importlib.metadata import PackageNotFoundError, version
30
+
31
+ try:
32
+ return version("getflightplan")
33
+ except PackageNotFoundError:
34
+ return "unknown"
35
+
36
+
37
+ def main(argv: list[str] | None = None) -> int:
38
+ # A top-level positional `command` plus a REMAINDER tail: everything after
39
+ # the subcommand is forwarded to it verbatim, including leading-dash flags
40
+ # (`getflightplan install --dry-run --agent codex`). REMAINDER *on a
41
+ # subparser* mishandles a leading option — the top-level positional form
42
+ # does not — so we dispatch by hand and let each target parse its own args.
43
+ parser = argparse.ArgumentParser(
44
+ prog="getflightplan",
45
+ description="FlightPlan — shared task memory for coding agents.",
46
+ epilog="commands: install (per-repo setup) · uninstall (per-repo "
47
+ "removal) · mcp (stdio client an agent launches).",
48
+ )
49
+ parser.add_argument(
50
+ "--version", action="version", version=f"getflightplan {_version()}",
51
+ )
52
+ parser.add_argument(
53
+ "command", nargs="?", choices=["install", "uninstall", "mcp"],
54
+ help="what to run",
55
+ )
56
+ parser.add_argument("rest", nargs=argparse.REMAINDER, help=argparse.SUPPRESS)
57
+ args = parser.parse_args(argv)
58
+
59
+ if args.command == "install":
60
+ # Lazy import to keep dispatch uniform; install.py is itself stdlib-only.
61
+ from . import install
62
+
63
+ return install.main(args.rest)
64
+
65
+ if args.command == "uninstall":
66
+ # Lazy for the same reason as install; uninstall.py is stdlib-only too.
67
+ from . import uninstall
68
+
69
+ return uninstall.main(args.rest)
70
+
71
+ if args.command == "mcp":
72
+ # Lazy: mcp_server imports httpx+mcp (present in the thin uvx env).
73
+ from . import mcp_server
74
+
75
+ mcp_server.main()
76
+ return 0
77
+
78
+ parser.print_help()
79
+ return 0
80
+
81
+
82
+ if __name__ == "__main__":
83
+ raise SystemExit(main())