kache-ssh 0.2.1__tar.gz → 0.4.0__tar.gz

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.
Files changed (68) hide show
  1. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/.gitignore +9 -7
  2. kache_ssh-0.4.0/AGENTS.md +45 -0
  3. kache_ssh-0.4.0/CHANGELOG.md +27 -0
  4. kache_ssh-0.4.0/IMPLEMENTATION.md +84 -0
  5. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/LICENSE +21 -21
  6. kache_ssh-0.4.0/PKG-INFO +146 -0
  7. kache_ssh-0.4.0/README.md +113 -0
  8. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/pyproject.toml +46 -43
  9. kache_ssh-0.4.0/src/kache/AGENTS.md +174 -0
  10. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/src/kache/__init__.py +17 -17
  11. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/src/kache/__main__.py +3 -3
  12. kache_ssh-0.4.0/src/kache/agent.py +1003 -0
  13. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/src/kache/cli.py +673 -250
  14. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/src/kache/client.py +260 -59
  15. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/src/kache/config.py +158 -151
  16. kache_ssh-0.4.0/src/kache/connections.py +93 -0
  17. kache_ssh-0.4.0/src/kache/control.py +302 -0
  18. kache_ssh-0.4.0/src/kache/desktop.py +667 -0
  19. kache_ssh-0.4.0/src/kache/evidence.py +218 -0
  20. kache_ssh-0.4.0/src/kache/files.py +101 -0
  21. kache_ssh-0.4.0/src/kache/fsops.py +263 -0
  22. kache_ssh-0.4.0/src/kache/job_worker.py +62 -0
  23. kache_ssh-0.4.0/src/kache/jobs.py +440 -0
  24. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/src/kache/keys.py +42 -42
  25. kache_ssh-0.4.0/src/kache/mcp.py +841 -0
  26. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/src/kache/network.py +191 -148
  27. kache_ssh-0.4.0/src/kache/platform.py +946 -0
  28. kache_ssh-0.4.0/src/kache/platform_cli.py +275 -0
  29. kache_ssh-0.4.0/src/kache/probe.py +320 -0
  30. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/src/kache/service.py +134 -37
  31. kache_ssh-0.4.0/src/kache/shells.py +286 -0
  32. kache_ssh-0.4.0/src/kache/ssh_audit.py +131 -0
  33. kache_ssh-0.4.0/src/kache/sync.py +98 -0
  34. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/src/kache/telemetry.py +147 -121
  35. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/src/kache/tui.py +369 -107
  36. kache_ssh-0.4.0/src/kache/updater.py +323 -0
  37. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/tests/test_agent_api.py +36 -21
  38. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/tests/test_e2e.py +159 -155
  39. kache_ssh-0.4.0/tests/test_platform.py +219 -0
  40. kache_ssh-0.4.0/tests/test_platform_network.py +207 -0
  41. kache_ssh-0.4.0/tests/test_platform_safety.py +293 -0
  42. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/tests/test_service.py +13 -13
  43. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/tests/test_tui.py +62 -62
  44. kache_ssh-0.4.0/tests/test_updater.py +110 -0
  45. {kache_ssh-0.2.1 → kache_ssh-0.4.0}/tests/test_v02.py +266 -292
  46. kache_ssh-0.4.0/tools/bootstrap_install.py +198 -0
  47. kache_ssh-0.4.0/tools/bootstrap_preflight.ps1 +6 -0
  48. kache_ssh-0.4.0/tools/check_artifacts.py +51 -0
  49. kache_ssh-0.4.0/tools/cleanup_smoke.py +48 -0
  50. kache_ssh-0.4.0/tools/package_probe.ps1 +4 -0
  51. kache_ssh-0.4.0/tools/prepare_desktop_stage.ps1 +5 -0
  52. kache_ssh-0.4.0/tools/refresh_terminology.py +49 -0
  53. kache_ssh-0.4.0/tools/release_probe.ps1 +12 -0
  54. kache_ssh-0.4.0/tools/release_smoke.py +148 -0
  55. kache_ssh-0.4.0/tools/smoke_desktop.py +28 -0
  56. kache_ssh-0.4.0/tools/startup_probe.ps1 +6 -0
  57. kache_ssh-0.4.0/tools/validate_desktop_stage.ps1 +14 -0
  58. kache_ssh-0.2.1/AGENTS.md +0 -37
  59. kache_ssh-0.2.1/PKG-INFO +0 -233
  60. kache_ssh-0.2.1/README.md +0 -205
  61. kache_ssh-0.2.1/src/kache/AGENTS.md +0 -263
  62. kache_ssh-0.2.1/src/kache/agent.py +0 -700
  63. kache_ssh-0.2.1/src/kache/evidence.py +0 -118
  64. kache_ssh-0.2.1/src/kache/files.py +0 -63
  65. kache_ssh-0.2.1/src/kache/jobs.py +0 -274
  66. kache_ssh-0.2.1/src/kache/mcp.py +0 -388
  67. kache_ssh-0.2.1/src/kache/notify.py +0 -173
  68. kache_ssh-0.2.1/src/kache/probe.py +0 -176
@@ -1,7 +1,9 @@
1
- .venv/
2
- __pycache__/
3
- *.pyc
4
- dist/
5
- build/
6
- *.egg-info/
7
- .pytest_cache/
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ dist/
5
+ build/
6
+ *.egg-info/
7
+ .pytest_cache/
8
+ .ruff_cache/
9
+ release-test-results.xml
@@ -0,0 +1,45 @@
1
+ # Working on Kache
2
+
3
+ **Using Kache** (sending commands, reading the feed, MCP): read
4
+ [src/kache/AGENTS.md](src/kache/AGENTS.md), which is also printed by `kache guide`.
5
+
6
+ **Changing Kache:**
7
+
8
+ - Setup: `python -m venv .venv`, then `.venv/Scripts/pip install -e ".[dev]"`
9
+ (Windows) or `.venv/bin/pip install -e ".[dev]"`.
10
+ - Tests: `python -m pytest -q`. They start real proxies on 127.0.0.1
11
+ with temporary state folders and test through the real SSH path, the CLI
12
+ (subprocesses), the MCP server and the Textual app (`run_test`).
13
+
14
+ Layout (`src/kache/`):
15
+
16
+ | file | role |
17
+ |---|---|
18
+ | `agent.py` | the proxy: SSH server, internal `kache:` requests, commands, feed, pairing |
19
+ | `client.py` | connecting (address race, key pinning), commands, pairing, device list |
20
+ | `probe.py` | status snapshots, Tailscale discovery, `doctor` (shared by CLI, MCP, TUI) |
21
+ | `network.py` | Tailscale and interface addresses, listen modes |
22
+ | `cli.py` | the `kache` command |
23
+ | `tui.py` | the Kache terminal (Textual) |
24
+ | `mcp.py` | MCP server over stdio |
25
+ | `evidence.py`, `telemetry.py` | failure reports, health numbers |
26
+ | `config.py`, `keys.py`, `service.py` | state folder, device key, autostart |
27
+ | `control.py`, `platform.py`, `fsops.py` | transactional actors/work/chat/health, structured operations, file edits |
28
+ | `shells.py`, `connections.py` | persistent interpreters and pooled pinned transports |
29
+ | `desktop.py` | native Tk window, local show-only IPC, tray |
30
+ | `sync.py`, `updater.py`, `job_worker.py`, `ssh_audit.py` | staged transfers, updates, detached stdin, OS login audit |
31
+
32
+ Rules:
33
+
34
+ - Bump `PROTOCOL` in `__init__.py` when proxies of different versions
35
+ could misread each other.
36
+ - Bump `SCHEMA` when a JSON shape that agents read changes incompatibly, and
37
+ update `src/kache/AGENTS.md` with it.
38
+ - The client must only ever offer the device key. `_DeviceKeyClient` exists
39
+ because asyncssh would otherwise add ssh-agent keys first.
40
+ - Windows commands use UTF-8 `.ps1` files, dot-sourced by a persistent shell;
41
+ detached jobs use `-File`. Never use `-EncodedCommand`/CLIXML.
42
+ - Tests use temporary identities, ephemeral ports and isolated startup keys.
43
+ Never touch production pairing, running jobs or startup from tests.
44
+ - No auto-acknowledgement of another actor's work; no automatic clearing of
45
+ operator/resource stops. Labels are attribution, not a security sandbox.
@@ -0,0 +1,27 @@
1
+ # Changelog
2
+
3
+ ## 0.4.0
4
+
5
+ - Standalone native desktop, tray dot, shell/device selection, activity, actors,
6
+ chat and human-approved pairing prompts. Keep `kache tui` as a compatibility UI.
7
+ - Explicit PowerShell/Bash/cmd/Zsh selection. Stateful serial interpreter
8
+ sessions; no silent shell-language translation. Native Git Bash path handling.
9
+ - SQLite-backed actor presence, home device, job ownership, generation-checked
10
+ work notices and addressed chat. Unread messages stop an agent's next task
11
+ for review once; no claim of waking an idle model or guaranteeing a response.
12
+ - Structured filesystem/process/inventory/health operations, SHA-256 guarded
13
+ patches, backups, stale-safe undo, staged incremental sync and direct transfers.
14
+ - Supervised services, interval/daily schedules, bounded waits, line-oriented
15
+ detached-job stdin, Wake-on-LAN and interactive-desktop screenshots.
16
+ - Best-effort existing OpenSSH login logs and seven-day health retention.
17
+ - Side-by-side pinned update staging and guarded Windows login-proxy activation.
18
+ Boot tasks and other unsupported activation modes fail before stopping.
19
+ - Reuse pinned SSH transports in long-lived clients; enforce revocation on warm
20
+ connections and open SFTP handles. Bound streamed output and shell/UI resources.
21
+ - Command/proxy terminology; protocol 2 and JSON schema 2. Preserve historical
22
+ feed/job files, identities and legacy Python source aliases. Adopt existing
23
+ running jobs into ownership notices without restarting them.
24
+
25
+ Limits: no full PTY, no agent security sandbox, at-most-once message delivery,
26
+ per-file (not whole-folder) atomic sync, desktop/session-dependent capture/tray,
27
+ and platform/permission-dependent OpenSSH visibility. See `kache guide`.
@@ -0,0 +1,84 @@
1
+ # Kache platform release — implementation record
2
+
3
+ Operator: Simon. Implementation: Codex only. **Do not delegate to Claude.**
4
+ Baseline: 73e16ec / 0.3.0. Development branch: codex/platform-v04.
5
+ The existing installation, paired identities and Puck training stay untouched
6
+ until validated release installation. Never print private keys or publishing tokens.
7
+
8
+ ## Requested scope (numbers refer to Claude's 24-item list)
9
+
10
+ - [x] 1 structured cross-platform filesystem/process/health tools
11
+ - [x] 2 selectable PowerShell, Bash, cmd and Zsh execution
12
+ - [x] 3 optimistic-concurrency patching; 4 backups and undo
13
+ - [x] 5 incremental sync; 6 warm connections and persistent shell sessions
14
+ - [x] 7 bounded waits; 8 supervised services; 9 schedules; 10 job stdin
15
+ - [x] 13 direct device-to-device copy; 14 inventory; 16 Wake-on-LAN
16
+ - [x] 19 ordinary SSH-login visibility; 20 seven-day health history
17
+ - [x] 21 explicit coordinated updates
18
+ - [x] screenshot with honest interactive-session/platform errors
19
+ - [x] actor presence/home device, work-conflict acknowledgement, job ownership
20
+ - [x] addressed chat, unread mentions delivered once on the next agent operation
21
+ - [x] standalone desktop window, shell/device selectors, tray address/open/exit
22
+ - [x] command/proxy terminology, migration and compatibility documentation
23
+ - [ ] final Git/release artifacts, PyPI publication and production installs
24
+
25
+ ## Architecture and safety
26
+
27
+ Keep the existing AsyncSSH transport and pinned device identities. Add a typed
28
+ `kache:api` operation router, a SQLite transactional control plane, explicit
29
+ actor/session identity and a fixed allowlist of structured operations. Actor
30
+ labels are attribution, NOT a new security boundary: pairing still grants broad
31
+ user-level access. Never promise an LLM will wake up or answer; its next call
32
+ receives unread mentions once. Conflicting work requires explicit acknowledgement
33
+ of the current work generation and is checked again atomically when work starts.
34
+
35
+ Services/schedules are explicit persistent configurations, not blanket permission
36
+ to resume an operator-stopped task. Tests use isolated state, loopback listeners,
37
+ ephemeral ports and mocks for power, startup, update and screenshot side effects.
38
+ Screenshots must fail clearly when a proxy is in Windows session 0 or no desktop
39
+ is available. Plain-SSH monitoring is best effort and never requests elevation.
40
+ All requested shell types need installed executables; never silently translate
41
+ a command into a different shell. State migrations must not replace device keys.
42
+
43
+ ## Verification and release gates
44
+
45
+ Run existing regression tests plus new feature, isolation, concurrency and
46
+ negative/security cases. Test GUI logic headlessly and the real Windows window
47
+ when the available UI tools permit it. Build/inspect the wheel, install in an
48
+ isolated environment, then validate both real machines with recoverable backups
49
+ before publishing. If any required feature or release gate is not verified,
50
+ report it accurately instead of publishing an incomplete release.
51
+
52
+ ## Coordination note
53
+
54
+ An earlier request to the existing Claude session was sent before Simon clarified
55
+ that no Claude work was wanted. A cancellation-only relay was attempted but the
56
+ Claude API returned usage_limit_reached. No Claude implementation is incorporated;
57
+ all further implementation and decisions belong to Codex. Keep work isolated.
58
+
59
+
60
+ ## Validation performed during implementation
61
+
62
+ - Baseline: 26 existing tests passed before implementation.
63
+ - Final full feature/regression suite: **72 passed in 79.25 seconds**. Lint
64
+ (undefined/unused names, excluding pytest fixture shadowing) and diff checks
65
+ are clean. Includes transfer leases, direct MCP PNG output, initialization
66
+ readiness, native Bash and five updater control-flow/recovery cases.
67
+ - Native Windows window inspected with the supported computer-use API:
68
+ device/shell selectors, contrast correction, dot icon and actor table.
69
+ No terminal commands were entered through UI automation.
70
+ - Native PowerShell, cmd and Git Bash persistence tested, including Windows
71
+ path conversion and LF scripts. Zsh is not installed on these machines;
72
+ missing-shell behavior is tested and no Zsh runtime verification is claimed.
73
+ - Real desktop staging job J-12e09b: isolated wheel install, pip check and
74
+ installed-wheel smoke checks passed, while live 0.3.0 stayed running.
75
+ - Wake packet generation is mocked: no physical wake claim. Screenshots are
76
+ image-format/session/error tested with synthetic captures, not personal
77
+ desktop uploads. Existing OpenSSH log access is best effort/permission-bound.
78
+ - Coordinated update staging/activation/recovery logic is unit-tested. Real
79
+ privileged boot-task activation is deliberately refused by the managed updater.
80
+ The initial 0.3→0.4 bootstrap retains the existing global Python path and boot
81
+ task; it is not an unapproved task/security/hardware change.
82
+ - Tests use dedicated registry keys; production task deletion is explicitly
83
+ excluded for custom/test startup keys.
84
+ - Puck code, checkpoints, training jobs and hardware settings are out of scope.
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Simon Malm
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Simon Malm
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,146 @@
1
+ Metadata-Version: 2.5
2
+ Name: kache-ssh
3
+ Version: 0.4.0
4
+ Summary: Kache: a desktop and multi-agent orchestration platform for your paired devices over SSH.
5
+ Author: Simon Malm
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Keywords: ai-agents,fleet,mcp,orchestration,remote,ssh,tailscale,terminal,tui
9
+ Classifier: Environment :: Console
10
+ Classifier: Operating System :: MacOS
11
+ Classifier: Operating System :: Microsoft :: Windows
12
+ Classifier: Operating System :: POSIX :: Linux
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Topic :: System :: Systems Administration
15
+ Requires-Python: >=3.10
16
+ Requires-Dist: asyncssh>=2.14
17
+ Requires-Dist: pillow>=10.4
18
+ Requires-Dist: platformdirs>=4.0
19
+ Requires-Dist: psutil>=5.9
20
+ Requires-Dist: pystray>=0.19.5
21
+ Requires-Dist: regex>=2024.11.6
22
+ Requires-Dist: textual>=8.0
23
+ Provides-Extra: desktop
24
+ Requires-Dist: pillow>=10.4; extra == 'desktop'
25
+ Requires-Dist: pystray>=0.19.5; extra == 'desktop'
26
+ Provides-Extra: dev
27
+ Requires-Dist: build>=1.0; extra == 'dev'
28
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
29
+ Requires-Dist: pytest>=8; extra == 'dev'
30
+ Provides-Extra: gpu
31
+ Requires-Dist: nvidia-ml-py>=12; extra == 'gpu'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # Kache
35
+
36
+ A standalone desktop window, CLI and MCP server for working on your own paired
37
+ devices over SSH. Each device runs a **proxy**; commands, ownership and results
38
+ are visible in its activity feed.
39
+
40
+ ## Install and open
41
+
42
+ ```console
43
+ python -m pip install -U kache-ssh
44
+ kache
45
+ ```
46
+
47
+ The desktop has device and shell selectors, a terminal, activity, active actors
48
+ and addressed chat. PowerShell, Bash, cmd and Zsh commands run in that exact
49
+ installed interpreter, without translation. Closing hides the window in the tray;
50
+ the dot icon opens it and its menu shows addresses and Exit.
51
+ `kache tui` retains the previous Textual interface.
52
+
53
+ Python 3.10+ is required. Windows Python needs its bundled Tcl/Tk for the window.
54
+ Headless machines can use CLI, MCP and proxy without opening a window.
55
+ Opening the desktop starts the proxy if needed; startup registration is explicit:
56
+ `kache service install`.
57
+
58
+ ## Pair your own devices
59
+
60
+ Open Kache on both devices. Run `kache pair ADDRESS`; compare the six-digit
61
+ code on both screens and accept on the receiving device. Pairing grants broad
62
+ access as the proxy's OS user, not an agent sandbox. Clients offer only Kache's
63
+ device key and verify the destination's pinned fingerprint.
64
+
65
+ ```console
66
+ kache devices --json
67
+ kache run desktop --as codex --actor-id project-a --shell powershell --timeout 30 -- Get-Location
68
+ kache run desktop --as codex --detach -- python train.py
69
+ kache jobs --json
70
+ kache logs J-abc123 -d desktop
71
+ ```
72
+
73
+ Foreground sessions retain variables, cwd and activated environments. The proxy
74
+ limits them to 32 and expires idle sessions after 30 minutes. Cancellation resets
75
+ a busy shell. Detached jobs survive disconnection and proxy restart.
76
+
77
+ ## Working together
78
+
79
+ `kache actors --json` lists active actors, home devices and work across reachable
80
+ paired devices. Use KACHE_AS and a distinct stable KACHE_ACTOR for each CLI agent.
81
+ MCP instances have distinct ids. Labels are attribution, not security boundaries.
82
+
83
+ Starting work on an occupied device returns its owner/task and a generation token.
84
+ Decide whether to proceed, then retry with `--acknowledge TOKEN`. New work
85
+ invalidates old acknowledgements.
86
+
87
+ ```console
88
+ kache chat @alice "Please inspect the test report" -d desktop --as bob
89
+ kache inbox -d desktop --as alice --json
90
+ ```
91
+
92
+ Unread messages stop an agent's next command/job for review and are shown once.
93
+ This **does not wake an idle AI or guarantee a reply**. Delivery is at-most-once;
94
+ history remains after a lost response. Offline proxies retain mail.
95
+
96
+ ## Platform tools
97
+
98
+ - Shell-free ls/cat/tail/find/ps/top/gpu/disk/inventory.
99
+ - Hash-checked patch, backups and stale-safe undo.
100
+ - Incremental `sync SOURCE DEVICE:FOLDER`, optional --watch, per-file atomic
101
+ staged commits, no remote deletion.
102
+ - Direct `copy SOURCE_DEVICE:PATH DEST_DEVICE:PATH`, using an existing pairing
103
+ from source to destination. No payload relay through the controller.
104
+ - Bounded waits for files, log regexes, jobs and ports.
105
+ - Explicit supervised services and interval/daily schedules. Operator stops persist.
106
+ - Line-oriented job stdin, including EOF; not a full PTY.
107
+ - LAN Wake-on-LAN, interactive-desktop screenshots, seven-day health history.
108
+ - Best-effort OpenSSH successful-login visibility, without elevation or audit edits.
109
+
110
+ Full commands, schemas and limitations: `kache guide` or
111
+ [src/kache/AGENTS.md](src/kache/AGENTS.md).
112
+
113
+ ## Updates and compatibility
114
+
115
+ 0.4 uses **protocol 2 / JSON schema 2**. Update both endpoints. Historical feeds,
116
+ job files and identities are retained. Gatekeeper/run_order source aliases remain;
117
+ the preferred names are Proxy/run_command.
118
+
119
+ ```console
120
+ kache update all --to-version 0.4.0 --confirm
121
+ ```
122
+
123
+ Updates stage a pinned package in a separate environment, verify imports, activate
124
+ remotes before the controller, and check the same pinned key/version. Previous
125
+ environments and jobs remain. Managed activation supports Windows login proxies;
126
+ privileged boot tasks need explicit operator updates. Do not delete environments
127
+ while old jobs use them.
128
+
129
+ ## MCP and development
130
+
131
+ ```console
132
+ kache mcp
133
+ python -m venv .venv
134
+ .venv/Scripts/python -m pip install -e ".[dev]"
135
+ .venv/Scripts/python -m pytest -q
136
+ ```
137
+
138
+ Existing MCP tools remain, plus kache_tool for structured operations. Long-lived
139
+ MCP and desktop clients reuse pinned connections without retrying commands.
140
+ `kache_screenshot` returns an actual PNG image content block to MCP clients.
141
+
142
+ Tests use temporary identities and loopback proxies, not production startup,
143
+ pairing, hardware or training. See [IMPLEMENTATION.md](IMPLEMENTATION.md) for
144
+ validation and release status.
145
+
146
+ MIT · Simon Malm.
@@ -0,0 +1,113 @@
1
+ # Kache
2
+
3
+ A standalone desktop window, CLI and MCP server for working on your own paired
4
+ devices over SSH. Each device runs a **proxy**; commands, ownership and results
5
+ are visible in its activity feed.
6
+
7
+ ## Install and open
8
+
9
+ ```console
10
+ python -m pip install -U kache-ssh
11
+ kache
12
+ ```
13
+
14
+ The desktop has device and shell selectors, a terminal, activity, active actors
15
+ and addressed chat. PowerShell, Bash, cmd and Zsh commands run in that exact
16
+ installed interpreter, without translation. Closing hides the window in the tray;
17
+ the dot icon opens it and its menu shows addresses and Exit.
18
+ `kache tui` retains the previous Textual interface.
19
+
20
+ Python 3.10+ is required. Windows Python needs its bundled Tcl/Tk for the window.
21
+ Headless machines can use CLI, MCP and proxy without opening a window.
22
+ Opening the desktop starts the proxy if needed; startup registration is explicit:
23
+ `kache service install`.
24
+
25
+ ## Pair your own devices
26
+
27
+ Open Kache on both devices. Run `kache pair ADDRESS`; compare the six-digit
28
+ code on both screens and accept on the receiving device. Pairing grants broad
29
+ access as the proxy's OS user, not an agent sandbox. Clients offer only Kache's
30
+ device key and verify the destination's pinned fingerprint.
31
+
32
+ ```console
33
+ kache devices --json
34
+ kache run desktop --as codex --actor-id project-a --shell powershell --timeout 30 -- Get-Location
35
+ kache run desktop --as codex --detach -- python train.py
36
+ kache jobs --json
37
+ kache logs J-abc123 -d desktop
38
+ ```
39
+
40
+ Foreground sessions retain variables, cwd and activated environments. The proxy
41
+ limits them to 32 and expires idle sessions after 30 minutes. Cancellation resets
42
+ a busy shell. Detached jobs survive disconnection and proxy restart.
43
+
44
+ ## Working together
45
+
46
+ `kache actors --json` lists active actors, home devices and work across reachable
47
+ paired devices. Use KACHE_AS and a distinct stable KACHE_ACTOR for each CLI agent.
48
+ MCP instances have distinct ids. Labels are attribution, not security boundaries.
49
+
50
+ Starting work on an occupied device returns its owner/task and a generation token.
51
+ Decide whether to proceed, then retry with `--acknowledge TOKEN`. New work
52
+ invalidates old acknowledgements.
53
+
54
+ ```console
55
+ kache chat @alice "Please inspect the test report" -d desktop --as bob
56
+ kache inbox -d desktop --as alice --json
57
+ ```
58
+
59
+ Unread messages stop an agent's next command/job for review and are shown once.
60
+ This **does not wake an idle AI or guarantee a reply**. Delivery is at-most-once;
61
+ history remains after a lost response. Offline proxies retain mail.
62
+
63
+ ## Platform tools
64
+
65
+ - Shell-free ls/cat/tail/find/ps/top/gpu/disk/inventory.
66
+ - Hash-checked patch, backups and stale-safe undo.
67
+ - Incremental `sync SOURCE DEVICE:FOLDER`, optional --watch, per-file atomic
68
+ staged commits, no remote deletion.
69
+ - Direct `copy SOURCE_DEVICE:PATH DEST_DEVICE:PATH`, using an existing pairing
70
+ from source to destination. No payload relay through the controller.
71
+ - Bounded waits for files, log regexes, jobs and ports.
72
+ - Explicit supervised services and interval/daily schedules. Operator stops persist.
73
+ - Line-oriented job stdin, including EOF; not a full PTY.
74
+ - LAN Wake-on-LAN, interactive-desktop screenshots, seven-day health history.
75
+ - Best-effort OpenSSH successful-login visibility, without elevation or audit edits.
76
+
77
+ Full commands, schemas and limitations: `kache guide` or
78
+ [src/kache/AGENTS.md](src/kache/AGENTS.md).
79
+
80
+ ## Updates and compatibility
81
+
82
+ 0.4 uses **protocol 2 / JSON schema 2**. Update both endpoints. Historical feeds,
83
+ job files and identities are retained. Gatekeeper/run_order source aliases remain;
84
+ the preferred names are Proxy/run_command.
85
+
86
+ ```console
87
+ kache update all --to-version 0.4.0 --confirm
88
+ ```
89
+
90
+ Updates stage a pinned package in a separate environment, verify imports, activate
91
+ remotes before the controller, and check the same pinned key/version. Previous
92
+ environments and jobs remain. Managed activation supports Windows login proxies;
93
+ privileged boot tasks need explicit operator updates. Do not delete environments
94
+ while old jobs use them.
95
+
96
+ ## MCP and development
97
+
98
+ ```console
99
+ kache mcp
100
+ python -m venv .venv
101
+ .venv/Scripts/python -m pip install -e ".[dev]"
102
+ .venv/Scripts/python -m pytest -q
103
+ ```
104
+
105
+ Existing MCP tools remain, plus kache_tool for structured operations. Long-lived
106
+ MCP and desktop clients reuse pinned connections without retrying commands.
107
+ `kache_screenshot` returns an actual PNG image content block to MCP clients.
108
+
109
+ Tests use temporary identities and loopback proxies, not production startup,
110
+ pairing, hardware or training. See [IMPLEMENTATION.md](IMPLEMENTATION.md) for
111
+ validation and release status.
112
+
113
+ MIT · Simon Malm.
@@ -1,43 +1,46 @@
1
- [build-system]
2
- requires = ["hatchling>=1.24"]
3
- build-backend = "hatchling.build"
4
-
5
- [project]
6
- name = "kache-ssh"
7
- version = "0.2.1"
8
- description = "Kache: one terminal to command all your devices over SSH, with a gatekeeper agent on every device."
9
- readme = "README.md"
10
- requires-python = ">=3.10"
11
- license = "MIT"
12
- license-files = ["LICENSE"]
13
- authors = [{ name = "Simon Malm" }]
14
- keywords = ["ssh", "remote", "orchestration", "terminal", "tui", "fleet", "tailscale", "mcp", "ai-agents"]
15
- classifiers = [
16
- "Environment :: Console",
17
- "Operating System :: Microsoft :: Windows",
18
- "Operating System :: POSIX :: Linux",
19
- "Operating System :: MacOS",
20
- "Programming Language :: Python :: 3",
21
- "Topic :: System :: Systems Administration",
22
- ]
23
- dependencies = [
24
- "asyncssh>=2.14",
25
- "textual>=8.0",
26
- "psutil>=5.9",
27
- "platformdirs>=4.0",
28
- "segno>=1.5",
29
- ]
30
-
31
- [project.optional-dependencies]
32
- gpu = ["nvidia-ml-py>=12"]
33
- dev = ["pytest>=8", "pytest-asyncio>=0.23", "build>=1.0"]
34
-
35
- [project.scripts]
36
- kache = "kache.cli:main"
37
-
38
- [tool.hatch.build.targets.wheel]
39
- packages = ["src/kache"]
40
-
41
- [tool.pytest.ini_options]
42
- asyncio_mode = "auto"
43
- testpaths = ["tests"]
1
+ [build-system]
2
+ requires = ["hatchling>=1.24"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "kache-ssh"
7
+ version = "0.4.0"
8
+ description = "Kache: a desktop and multi-agent orchestration platform for your paired devices over SSH."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "Simon Malm" }]
14
+ keywords = ["ssh", "remote", "orchestration", "terminal", "tui", "fleet", "tailscale", "mcp", "ai-agents"]
15
+ classifiers = [
16
+ "Environment :: Console",
17
+ "Operating System :: Microsoft :: Windows",
18
+ "Operating System :: POSIX :: Linux",
19
+ "Operating System :: MacOS",
20
+ "Programming Language :: Python :: 3",
21
+ "Topic :: System :: Systems Administration",
22
+ ]
23
+ dependencies = [
24
+ "asyncssh>=2.14",
25
+ "textual>=8.0",
26
+ "psutil>=5.9",
27
+ "platformdirs>=4.0",
28
+ "Pillow>=10.4",
29
+ "pystray>=0.19.5",
30
+ "regex>=2024.11.6",
31
+ ]
32
+
33
+ [project.optional-dependencies]
34
+ gpu = ["nvidia-ml-py>=12"]
35
+ desktop = ["Pillow>=10.4", "pystray>=0.19.5"]
36
+ dev = ["pytest>=8", "pytest-asyncio>=0.23", "build>=1.0"]
37
+
38
+ [project.scripts]
39
+ kache = "kache.cli:main"
40
+
41
+ [tool.hatch.build.targets.wheel]
42
+ packages = ["src/kache"]
43
+
44
+ [tool.pytest.ini_options]
45
+ asyncio_mode = "auto"
46
+ testpaths = ["tests"]