This commit is contained in:
kiri committed 2026-09-22 22:05:11 +02:00
1 parent 9c3b7c3735
commit 98a9be3615
9 files changed
+31 -153

No files matched your search

-14
View File
@@ -1,14 +0,0 @@
# AI tools
Nix installs the tools, assets, skills and system Codex defaults. Codex owns its
writable user configuration; credentials, session history and other runtime state
remain outside this repository. `instructions/codex.md` owns global agent guidance.
Herdr is optional experimentation. Reload its managed configuration with
Ctrl+Alt+Shift+R (or Ctrl+B then Shift+R); its configuration owns the binding reference.
Home Manager may preserve an earlier regular configuration file with `.bak`.
Ollama supplies `nomic-embed-text` for grounded-docs. The latter runs on localhost
port 6280 with persistent Podman volumes. Removing another tool must not delete
these models or volumes. No mandatory agent persistence or orchestration workflow
is defined here.
@@ -14,9 +14,8 @@
# Validation
- Write or run automated tests only when explicitly requested or covered by the repository's established testing policy. Do not invent a testing policy or introduce tests into a repository without tests unless explicitly requested.
- Validate changes with the smallest relevant build, manual behaviour check, or review of code and output.
- Broaden or repeat validation only for changes, failures or unresolved concerns. Report only checks performed.
- Do not write or run tests or perform extensive validation unless explicitly requested.
- For routine changes, use a focused review or small manual check. Report only checks performed.
# Writing
@@ -1,37 +0,0 @@
"""Synthetic key-state checks; never reads a keyboard or records audio."""
from unittest.mock import Mock, patch
import push_to_talk as ptt
down = [ptt.key.KEY_LEFTMETA, ptt.key.KEY_D]
def check(states, expected, error=None):
device = Mock()
device.active_keys.side_effect = states
device.read_loop.return_value = iter([object(), object()])
if error:
device.read_loop.side_effect = error
with (
patch.object(ptt, "list_devices", return_value=["keyboard"]),
patch.object(ptt, "InputDevice", return_value=device),
patch.object(ptt.signal, "signal"),
patch.object(ptt.subprocess, "run") as run,
):
try:
ptt.main("handy")
except (OSError, KeyboardInterrupt):
assert error is not None
assert [call.args[0][1] for call in run.call_args_list] == expected
device.close.assert_called_once()
check([[]], []) # Released before the listener starts: do not record.
check([down, []], ["--toggle-transcription", "--toggle-transcription"])
check([down, down, down, [ptt.key.KEY_D]], ["--toggle-transcription"] * 2)
check([down, down], ["--toggle-transcription", "--cancel"], OSError("unplugged"))
check([down, down], ["--toggle-transcription", "--cancel"], KeyboardInterrupt())
assert ptt.held([ptt.key.KEY_RIGHTMETA, ptt.key.KEY_D])
assert not ptt.held([ptt.key.KEY_LEFTMETA])
print("Push-to-talk release, repeat, disconnect and cancellation checks passed")
-12
View File
@@ -23,16 +23,6 @@
...
}:
let
elephantPackages = inputs.walker.inputs.elephant.packages.${pkgs.stdenv.hostPlatform.system};
# Upstream initializes rbw at startup. Drop this patch when it supports lazy vault access.
providers = elephantPackages.elephant-providers.overrideAttrs (old: {
patches = (old.patches or [ ]) ++ [ ./demand-driven-vault.patch ];
});
elephant = elephantPackages.elephant-with-providers.overrideAttrs (old: {
installPhase =
builtins.replaceStrings [ "${elephantPackages.elephant-providers}" ] [ "${providers}" ]
old.installPhase;
});
walkerDefaults = builtins.fromTOML (builtins.readFile "${inputs.walker}/resources/config.toml");
launcher = pkgs.writeShellApplication {
@@ -46,8 +36,6 @@
{
imports = [ inputs.walker.homeManagerModules.default ];
programs.elephant.package = elephant;
desktop.commands.launcher = [ (lib.getExe launcher) ];
programs.walker = {
enable = true;
@@ -1,55 +0,0 @@
--- a/internal/providers/bitwarden/setup.go
+++ b/internal/providers/bitwarden/setup.go
@@ -34,7 +34,7 @@
func Setup() {
LoadConfig()
- initItems()
+ // Vault access is initiated by an explicit query, never daemon startup.
}
func LoadConfig() {
--- a/internal/providers/bitwarden/query.go
+++ b/internal/providers/bitwarden/query.go
@@ -7,6 +7,7 @@
"net"
"os/exec"
"strings"
+ "sync"
"time"
"github.com/abenz1267/elephant/v2/pkg/common"
@@ -20,7 +21,24 @@
Folder string `json:"folder"`
}
+var itemsMu sync.Mutex
+
func initItems() {
+ itemsMu.Lock()
+ defer itemsMu.Unlock()
+ initItemsLocked()
+}
+
+func items() []RbwItem {
+ itemsMu.Lock()
+ defer itemsMu.Unlock()
+ if cachedItems == nil {
+ initItemsLocked()
+ }
+ return cachedItems
+}
+
+func initItemsLocked() {
cachedItems = nil
cmd := exec.Command("rbw", "list", "--raw")
output, err := cmd.CombinedOutput()
@@ -40,7 +58,7 @@
entries := []*pb.QueryResponse_Item{}
- for k, v := range cachedItems {
+ for k, v := range items() {
var subtexts []string
actions := []string{ActionCopyPassword, ActionCopyTotp, ActionSyncVault}
if config.AutoTypeSupport {