diff --git a/apps/device-host-agent/host_agent/__init__.py b/apps/device-host-agent/host_agent/__init__.py new file mode 100644 index 0000000..44b6730 --- /dev/null +++ b/apps/device-host-agent/host_agent/__init__.py @@ -0,0 +1,3 @@ +from host_agent.app import HostAgentApplication, create_application + +__all__ = ["HostAgentApplication", "create_application"] diff --git a/apps/device-host-agent/host_agent/app.py b/apps/device-host-agent/host_agent/app.py new file mode 100644 index 0000000..fef486e --- /dev/null +++ b/apps/device-host-agent/host_agent/app.py @@ -0,0 +1,15 @@ +from __future__ import annotations + +from dataclasses import dataclass + + +@dataclass +class HostAgentApplication: + """Process shell expanded by the Host Agent implementation tasks.""" + + def run(self) -> None: + return None + + +def create_application() -> HostAgentApplication: + return HostAgentApplication() diff --git a/apps/device-host-agent/host_agent/cli.py b/apps/device-host-agent/host_agent/cli.py new file mode 100644 index 0000000..5c2723c --- /dev/null +++ b/apps/device-host-agent/host_agent/cli.py @@ -0,0 +1,12 @@ +from __future__ import annotations + +import argparse +from collections.abc import Sequence + +from host_agent.app import create_application + + +def main(argv: Sequence[str] | None = None) -> None: + parser = argparse.ArgumentParser(description="Run the Device Host Agent") + parser.parse_args(argv) + create_application().run() diff --git a/apps/device-host-agent/pyproject.toml b/apps/device-host-agent/pyproject.toml new file mode 100644 index 0000000..4ae53e4 --- /dev/null +++ b/apps/device-host-agent/pyproject.toml @@ -0,0 +1,25 @@ +[project] +name = "device-host-agent" +version = "0.1.0" +description = "Outbound device-host worker for the Device Cloud Platform." +requires-python = ">=3.14" +dependencies = [ + "device-agent-runtime==0.1.0", + "device-cloud-platform==0.1.0", + "httpx>=0.27.0", +] + +[project.scripts] +device-host-agent = "host_agent.cli:main" + +[build-system] +requires = ["setuptools>=69"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.packages.find] +where = ["."] +include = ["host_agent*"] + +[tool.uv.sources] +device-agent-runtime = { workspace = true } +device-cloud-platform = { workspace = true } diff --git a/apps/device-host-agent/tests/test_app.py b/apps/device-host-agent/tests/test_app.py new file mode 100644 index 0000000..d71bb48 --- /dev/null +++ b/apps/device-host-agent/tests/test_app.py @@ -0,0 +1,10 @@ +from __future__ import annotations + +from host_agent.app import HostAgentApplication, create_application + + +def test_create_application_returns_host_agent_process_shell() -> None: + application = create_application() + + assert isinstance(application, HostAgentApplication) + assert application.run() is None diff --git a/openspec/changes/cloud-control-plane-integration/tasks.md b/openspec/changes/cloud-control-plane-integration/tasks.md index 3f8dbf0..7542768 100644 --- a/openspec/changes/cloud-control-plane-integration/tasks.md +++ b/openspec/changes/cloud-control-plane-integration/tasks.md @@ -3,7 +3,7 @@ - [x] 1.1 Complete and verify every task in `uv-workspace-packaging` before changing cloud behavior. - Verified 17/17 tasks complete, strict OpenSpec validation passed, and the shared lockfile is current. - [x] 1.2 Add `apps/cloud-api` as the `device-cloud-api` workspace project with an app factory and CLI/server entry point. -- [ ] 1.3 Add `apps/device-host-agent` as the `device-host-agent` workspace project with a CLI entry point and explicit Runtime/cloud dependencies. +- [x] 1.3 Add `apps/device-host-agent` as the `device-host-agent` workspace project with a CLI entry point and explicit Runtime/cloud dependencies. - [ ] 1.4 Add configuration models that validate environment, database URL, scheduler intervals, lease durations, retry limits, poll settings, host identity, and insecure-development overrides. ## 2. Repository Contract And Migrations diff --git a/pyproject.toml b/pyproject.toml index 9a461b0..d66ff44 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,7 @@ dev = [ [tool.uv.workspace] members = [ "apps/cloud-api", + "apps/device-host-agent", "packages/cloud-platform", ] diff --git a/uv.lock b/uv.lock index 9357b2d..01342d6 100644 --- a/uv.lock +++ b/uv.lock @@ -14,6 +14,7 @@ members = [ "device-agent-runtime", "device-cloud-api", "device-cloud-platform", + "device-host-agent", ] [[package]] @@ -491,6 +492,23 @@ dependencies = [ [package.metadata] requires-dist = [{ name = "device-agent-runtime", editable = "." }] +[[package]] +name = "device-host-agent" +version = "0.1.0" +source = { editable = "apps/device-host-agent" } +dependencies = [ + { name = "device-agent-runtime" }, + { name = "device-cloud-platform" }, + { name = "httpx" }, +] + +[package.metadata] +requires-dist = [ + { name = "device-agent-runtime", editable = "." }, + { name = "device-cloud-platform", editable = "packages/cloud-platform" }, + { name = "httpx", specifier = ">=0.27.0" }, +] + [[package]] name = "distro" version = "1.9.0"