From e3fdce750aa2534837cd386e6c6cdb4a0d936691 Mon Sep 17 00:00:00 2001 From: joelazar Date: Mon, 13 Jul 2026 13:47:09 +0200 Subject: [PATCH] :sparkles: add k8s-namespaces television channel - Simplify ssh-hosts cable: replace Python script with awk/shell, remove python3 dependency - Add max thinking level support to Claude Fable 5, Opus 4.8, Sonnet 4.6, and Sonnet 5 - Add thinkingMax color to catppuccin-mocha theme --- .../television/cable/k8s-namespaces.toml | 27 +++++ dot_config/television/cable/ssh-hosts.toml | 100 +----------------- .../agent/extensions/anthropic-extra/index.ts | 6 +- dot_pi/agent/themes/catppuccin-mocha.json | 1 + 4 files changed, 36 insertions(+), 98 deletions(-) create mode 100644 dot_config/television/cable/k8s-namespaces.toml diff --git a/dot_config/television/cable/k8s-namespaces.toml b/dot_config/television/cable/k8s-namespaces.toml new file mode 100644 index 00000000..40cee49e --- /dev/null +++ b/dot_config/television/cable/k8s-namespaces.toml @@ -0,0 +1,27 @@ +[metadata] +name = "k8s-namespaces" +description = "List and switch Kubernetes namespaces" +requirements = ["kubectl"] + +[source] +command = "kubectl get namespaces -o name | cut -d/ -f2" + +[preview] +command = "kubectl describe namespace {}" + +[ui] +layout = "portrait" + +[keybindings] +enter = "actions:use" +ctrl-d = "actions:delete" + +[actions.use] +description = "Set the selected namespace as default for the current context" +command = "kubectl config set-context --current --namespace={}" +mode = "execute" + +[actions.delete] +description = "Delete the selected namespace" +command = "kubectl delete namespace {}" +mode = "execute" diff --git a/dot_config/television/cable/ssh-hosts.toml b/dot_config/television/cable/ssh-hosts.toml index 138819c3..a1815b14 100644 --- a/dot_config/television/cable/ssh-hosts.toml +++ b/dot_config/television/cable/ssh-hosts.toml @@ -1,105 +1,13 @@ [metadata] name = "ssh-hosts" -description = "A channel to select hosts from your SSH config, including Include files" -requirements = ["python3", "ssh"] +description = "Select hosts from your SSH config, including Include files" +requirements = ["ssh"] [source] -command = '''python3 -c 'import glob, os, shlex -seen = set() -files = [] -def expand_include(pattern, base): - pattern = os.path.expanduser(os.path.expandvars(pattern)) - if not os.path.isabs(pattern): - pattern = os.path.join(base, pattern) - return glob.glob(pattern) -def visit(path): - path = os.path.abspath(os.path.expanduser(os.path.expandvars(path))) - if path in seen: - return - seen.add(path) - files.append(path) - try: - lines = open(path, encoding="utf-8").read().splitlines() - except OSError: - return - base = os.path.dirname(path) - for line in lines: - try: - parts = shlex.split(line, comments=True, posix=True) - except ValueError: - continue - if parts and parts[0].lower() == "include": - for include in parts[1:]: - for match in expand_include(include, base): - visit(match) -visit("~/.ssh/config") -hosts = set() -for path in files: - try: - lines = open(path, encoding="utf-8").read().splitlines() - except OSError: - continue - for line in lines: - try: - parts = shlex.split(line, comments=True, posix=True) - except ValueError: - continue - if parts and parts[0].lower() == "host": - for host in parts[1:]: - if not any(char in host for char in "*?!["): - hosts.add(host) -print("\n".join(sorted(hosts, key=str.lower)))' ''' +command = '''cd ~/.ssh && cat config $(awk 'tolower($1)=="include" {for(i=2;i<=NF;i++) print $i}' config) 2>/dev/null | awk 'tolower($1)=="host" {for(i=2;i<=NF;i++) if ($i !~ /[*?!\[]/) print $i}' | sort -fu''' [preview] -command = '''python3 -c 'import glob, os, shlex, sys -host = sys.argv[1] -seen = set() -files = [] -def expand_include(pattern, base): - pattern = os.path.expanduser(os.path.expandvars(pattern)) - if not os.path.isabs(pattern): - pattern = os.path.join(base, pattern) - return glob.glob(pattern) -def visit(path): - path = os.path.abspath(os.path.expanduser(os.path.expandvars(path))) - if path in seen: - return - seen.add(path) - files.append(path) - try: - lines = open(path, encoding="utf-8").read().splitlines() - except OSError: - return - base = os.path.dirname(path) - for line in lines: - try: - parts = shlex.split(line, comments=True, posix=True) - except ValueError: - continue - if parts and parts[0].lower() == "include": - for include in parts[1:]: - for match in expand_include(include, base): - visit(match) -visit("~/.ssh/config") -matched = False -for path in files: - found = False - try: - lines = open(path, encoding="utf-8").read().splitlines() - except OSError: - continue - for line in lines: - try: - parts = shlex.split(line, comments=True, posix=True) - except ValueError: - parts = [] - if parts and parts[0].lower() == "host": - found = host in parts[1:] - if found: - print(line) - matched = True -if not matched: - print("No Host block found for " + host)' '{}' ''' +command = "ssh -G '{}'" [keybindings] ctrl-enter = "actions:connect" diff --git a/dot_pi/agent/extensions/anthropic-extra/index.ts b/dot_pi/agent/extensions/anthropic-extra/index.ts index 2e3b3b5f..f954ba56 100644 --- a/dot_pi/agent/extensions/anthropic-extra/index.ts +++ b/dot_pi/agent/extensions/anthropic-extra/index.ts @@ -143,7 +143,7 @@ export default function (pi: ExtensionAPI) { name: "Claude Fable 5 (Extra)", reasoning: true, compat: { forceAdaptiveThinking: true }, - thinkingLevelMap: { off: null, xhigh: "xhigh" }, + thinkingLevelMap: { off: null, xhigh: "xhigh", max: "max" }, input: ["text", "image"], cost: { input: 10, output: 50, cacheRead: 1, cacheWrite: 12.5 }, contextWindow: 1_000_000, @@ -154,7 +154,7 @@ export default function (pi: ExtensionAPI) { name: "Claude Opus 4.8 (Extra)", reasoning: true, compat: { forceAdaptiveThinking: true, supportsTemperature: false }, - thinkingLevelMap: { xhigh: "xhigh" }, + thinkingLevelMap: { xhigh: "xhigh", max: "max" }, input: ["text", "image"], cost: { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 }, contextWindow: 1_000_000, @@ -165,6 +165,7 @@ export default function (pi: ExtensionAPI) { name: "Claude Sonnet 4.6 (Extra)", reasoning: true, compat: { forceAdaptiveThinking: true }, + thinkingLevelMap: { max: "max" }, input: ["text", "image"], cost: { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 3.75 }, contextWindow: 1_000_000, @@ -175,6 +176,7 @@ export default function (pi: ExtensionAPI) { name: "Claude Sonnet 5 (Extra)", reasoning: true, compat: { forceAdaptiveThinking: true }, + thinkingLevelMap: { xhigh: "xhigh", max: "max" }, input: ["text", "image"], cost: { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5 }, contextWindow: 1_000_000, diff --git a/dot_pi/agent/themes/catppuccin-mocha.json b/dot_pi/agent/themes/catppuccin-mocha.json index 4a7d3c73..d4b5bca7 100644 --- a/dot_pi/agent/themes/catppuccin-mocha.json +++ b/dot_pi/agent/themes/catppuccin-mocha.json @@ -80,6 +80,7 @@ "thinkingMedium": "sapphire", "thinkingHigh": "mauve", "thinkingXhigh": "pink", + "thinkingMax": "red", "bashMode": "green" }, "export": { -- 2.51.2