kyber-chat 1.0.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.
Files changed (71) hide show
  1. kyber/__init__.py +6 -0
  2. kyber/__main__.py +8 -0
  3. kyber/agent/__init__.py +8 -0
  4. kyber/agent/context.py +224 -0
  5. kyber/agent/loop.py +687 -0
  6. kyber/agent/memory.py +109 -0
  7. kyber/agent/skills.py +244 -0
  8. kyber/agent/subagent.py +379 -0
  9. kyber/agent/tools/__init__.py +6 -0
  10. kyber/agent/tools/base.py +102 -0
  11. kyber/agent/tools/filesystem.py +191 -0
  12. kyber/agent/tools/message.py +86 -0
  13. kyber/agent/tools/registry.py +73 -0
  14. kyber/agent/tools/shell.py +141 -0
  15. kyber/agent/tools/spawn.py +65 -0
  16. kyber/agent/tools/task_status.py +53 -0
  17. kyber/agent/tools/web.py +163 -0
  18. kyber/bridge/package.json +26 -0
  19. kyber/bridge/src/index.ts +50 -0
  20. kyber/bridge/src/server.ts +104 -0
  21. kyber/bridge/src/types.d.ts +3 -0
  22. kyber/bridge/src/whatsapp.ts +185 -0
  23. kyber/bridge/tsconfig.json +16 -0
  24. kyber/bus/__init__.py +6 -0
  25. kyber/bus/events.py +37 -0
  26. kyber/bus/queue.py +81 -0
  27. kyber/channels/__init__.py +6 -0
  28. kyber/channels/base.py +121 -0
  29. kyber/channels/discord.py +304 -0
  30. kyber/channels/feishu.py +263 -0
  31. kyber/channels/manager.py +161 -0
  32. kyber/channels/telegram.py +302 -0
  33. kyber/channels/whatsapp.py +141 -0
  34. kyber/cli/__init__.py +1 -0
  35. kyber/cli/commands.py +736 -0
  36. kyber/config/__init__.py +6 -0
  37. kyber/config/loader.py +95 -0
  38. kyber/config/schema.py +205 -0
  39. kyber/cron/__init__.py +6 -0
  40. kyber/cron/service.py +346 -0
  41. kyber/cron/types.py +59 -0
  42. kyber/dashboard/__init__.py +5 -0
  43. kyber/dashboard/server.py +122 -0
  44. kyber/dashboard/static/app.js +458 -0
  45. kyber/dashboard/static/favicon.png +0 -0
  46. kyber/dashboard/static/index.html +107 -0
  47. kyber/dashboard/static/kyber_logo.png +0 -0
  48. kyber/dashboard/static/styles.css +608 -0
  49. kyber/heartbeat/__init__.py +5 -0
  50. kyber/heartbeat/service.py +130 -0
  51. kyber/providers/__init__.py +6 -0
  52. kyber/providers/base.py +69 -0
  53. kyber/providers/litellm_provider.py +227 -0
  54. kyber/providers/transcription.py +65 -0
  55. kyber/session/__init__.py +5 -0
  56. kyber/session/manager.py +202 -0
  57. kyber/skills/README.md +47 -0
  58. kyber/skills/github/SKILL.md +48 -0
  59. kyber/skills/skill-creator/SKILL.md +371 -0
  60. kyber/skills/summarize/SKILL.md +67 -0
  61. kyber/skills/tmux/SKILL.md +121 -0
  62. kyber/skills/tmux/scripts/find-sessions.sh +112 -0
  63. kyber/skills/tmux/scripts/wait-for-text.sh +83 -0
  64. kyber/skills/weather/SKILL.md +49 -0
  65. kyber/utils/__init__.py +5 -0
  66. kyber/utils/helpers.py +91 -0
  67. kyber_chat-1.0.0.dist-info/METADATA +35 -0
  68. kyber_chat-1.0.0.dist-info/RECORD +71 -0
  69. kyber_chat-1.0.0.dist-info/WHEEL +4 -0
  70. kyber_chat-1.0.0.dist-info/entry_points.txt +2 -0
  71. kyber_chat-1.0.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: summarize
3
+ description: Summarize or extract text/transcripts from URLs, podcasts, and local files (great fallback for “transcribe this YouTube/video”).
4
+ homepage: https://summarize.sh
5
+ metadata: {"kyber":{"emoji":"🧾","requires":{"bins":["summarize"]},"install":[{"id":"brew","kind":"brew","formula":"steipete/tap/summarize","bins":["summarize"],"label":"Install summarize (brew)"}]}}
6
+ ---
7
+
8
+ # Summarize
9
+
10
+ Fast CLI to summarize URLs, local files, and YouTube links.
11
+
12
+ ## When to use (trigger phrases)
13
+
14
+ Use this skill immediately when the user asks any of:
15
+ - “use summarize.sh”
16
+ - “what’s this link/video about?”
17
+ - “summarize this URL/article”
18
+ - “transcribe this YouTube/video” (best-effort transcript extraction; no `yt-dlp` needed)
19
+
20
+ ## Quick start
21
+
22
+ ```bash
23
+ summarize "https://example.com" --model google/gemini-3-flash-preview
24
+ summarize "/path/to/file.pdf" --model google/gemini-3-flash-preview
25
+ summarize "https://youtu.be/dQw4w9WgXcQ" --youtube auto
26
+ ```
27
+
28
+ ## YouTube: summary vs transcript
29
+
30
+ Best-effort transcript (URLs only):
31
+
32
+ ```bash
33
+ summarize "https://youtu.be/dQw4w9WgXcQ" --youtube auto --extract-only
34
+ ```
35
+
36
+ If the user asked for a transcript but it’s huge, return a tight summary first, then ask which section/time range to expand.
37
+
38
+ ## Model + keys
39
+
40
+ Set the API key for your chosen provider:
41
+ - OpenAI: `OPENAI_API_KEY`
42
+ - Anthropic: `ANTHROPIC_API_KEY`
43
+ - xAI: `XAI_API_KEY`
44
+ - Google: `GEMINI_API_KEY` (aliases: `GOOGLE_GENERATIVE_AI_API_KEY`, `GOOGLE_API_KEY`)
45
+
46
+ Default model is `google/gemini-3-flash-preview` if none is set.
47
+
48
+ ## Useful flags
49
+
50
+ - `--length short|medium|long|xl|xxl|<chars>`
51
+ - `--max-output-tokens <count>`
52
+ - `--extract-only` (URLs only)
53
+ - `--json` (machine readable)
54
+ - `--firecrawl auto|off|always` (fallback extraction)
55
+ - `--youtube auto` (Apify fallback if `APIFY_API_TOKEN` set)
56
+
57
+ ## Config
58
+
59
+ Optional config file: `~/.summarize/config.json`
60
+
61
+ ```json
62
+ { "model": "openai/gpt-5.2" }
63
+ ```
64
+
65
+ Optional services:
66
+ - `FIRECRAWL_API_KEY` for blocked sites
67
+ - `APIFY_API_TOKEN` for YouTube fallback
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: tmux
3
+ description: Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
4
+ metadata: {"kyber":{"emoji":"🧵","os":["darwin","linux"],"requires":{"bins":["tmux"]}}}
5
+ ---
6
+
7
+ # tmux Skill
8
+
9
+ Use tmux only when you need an interactive TTY. Prefer exec background mode for long-running, non-interactive tasks.
10
+
11
+ ## Quickstart (isolated socket, exec tool)
12
+
13
+ ```bash
14
+ SOCKET_DIR="${KYBER_TMUX_SOCKET_DIR:-${TMPDIR:-/tmp}/kyber-tmux-sockets}"
15
+ mkdir -p "$SOCKET_DIR"
16
+ SOCKET="$SOCKET_DIR/kyber.sock"
17
+ SESSION=kyber-python
18
+
19
+ tmux -S "$SOCKET" new -d -s "$SESSION" -n shell
20
+ tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- 'PYTHON_BASIC_REPL=1 python3 -q' Enter
21
+ tmux -S "$SOCKET" capture-pane -p -J -t "$SESSION":0.0 -S -200
22
+ ```
23
+
24
+ After starting a session, always print monitor commands:
25
+
26
+ ```
27
+ To monitor:
28
+ tmux -S "$SOCKET" attach -t "$SESSION"
29
+ tmux -S "$SOCKET" capture-pane -p -J -t "$SESSION":0.0 -S -200
30
+ ```
31
+
32
+ ## Socket convention
33
+
34
+ - Use `KYBER_TMUX_SOCKET_DIR` environment variable.
35
+ - Default socket path: `"$KYBER_TMUX_SOCKET_DIR/kyber.sock"`.
36
+
37
+ ## Targeting panes and naming
38
+
39
+ - Target format: `session:window.pane` (defaults to `:0.0`).
40
+ - Keep names short; avoid spaces.
41
+ - Inspect: `tmux -S "$SOCKET" list-sessions`, `tmux -S "$SOCKET" list-panes -a`.
42
+
43
+ ## Finding sessions
44
+
45
+ - List sessions on your socket: `{baseDir}/scripts/find-sessions.sh -S "$SOCKET"`.
46
+ - Scan all sockets: `{baseDir}/scripts/find-sessions.sh --all` (uses `KYBER_TMUX_SOCKET_DIR`).
47
+
48
+ ## Sending input safely
49
+
50
+ - Prefer literal sends: `tmux -S "$SOCKET" send-keys -t target -l -- "$cmd"`.
51
+ - Control keys: `tmux -S "$SOCKET" send-keys -t target C-c`.
52
+
53
+ ## Watching output
54
+
55
+ - Capture recent history: `tmux -S "$SOCKET" capture-pane -p -J -t target -S -200`.
56
+ - Wait for prompts: `{baseDir}/scripts/wait-for-text.sh -t session:0.0 -p 'pattern'`.
57
+ - Attaching is OK; detach with `Ctrl+b d`.
58
+
59
+ ## Spawning processes
60
+
61
+ - For python REPLs, set `PYTHON_BASIC_REPL=1` (non-basic REPL breaks send-keys flows).
62
+
63
+ ## Windows / WSL
64
+
65
+ - tmux is supported on macOS/Linux. On Windows, use WSL and install tmux inside WSL.
66
+ - This skill is gated to `darwin`/`linux` and requires `tmux` on PATH.
67
+
68
+ ## Orchestrating Coding Agents (Codex, Claude Code)
69
+
70
+ tmux excels at running multiple coding agents in parallel:
71
+
72
+ ```bash
73
+ SOCKET="${TMPDIR:-/tmp}/codex-army.sock"
74
+
75
+ # Create multiple sessions
76
+ for i in 1 2 3 4 5; do
77
+ tmux -S "$SOCKET" new-session -d -s "agent-$i"
78
+ done
79
+
80
+ # Launch agents in different workdirs
81
+ tmux -S "$SOCKET" send-keys -t agent-1 "cd /tmp/project1 && codex --yolo 'Fix bug X'" Enter
82
+ tmux -S "$SOCKET" send-keys -t agent-2 "cd /tmp/project2 && codex --yolo 'Fix bug Y'" Enter
83
+
84
+ # Poll for completion (check if prompt returned)
85
+ for sess in agent-1 agent-2; do
86
+ if tmux -S "$SOCKET" capture-pane -p -t "$sess" -S -3 | grep -q "❯"; then
87
+ echo "$sess: DONE"
88
+ else
89
+ echo "$sess: Running..."
90
+ fi
91
+ done
92
+
93
+ # Get full output from completed session
94
+ tmux -S "$SOCKET" capture-pane -p -t agent-1 -S -500
95
+ ```
96
+
97
+ **Tips:**
98
+ - Use separate git worktrees for parallel fixes (no branch conflicts)
99
+ - `pnpm install` first before running codex in fresh clones
100
+ - Check for shell prompt (`❯` or `$`) to detect completion
101
+ - Codex needs `--yolo` or `--full-auto` for non-interactive fixes
102
+
103
+ ## Cleanup
104
+
105
+ - Kill a session: `tmux -S "$SOCKET" kill-session -t "$SESSION"`.
106
+ - Kill all sessions on a socket: `tmux -S "$SOCKET" list-sessions -F '#{session_name}' | xargs -r -n1 tmux -S "$SOCKET" kill-session -t`.
107
+ - Remove everything on the private socket: `tmux -S "$SOCKET" kill-server`.
108
+
109
+ ## Helper: wait-for-text.sh
110
+
111
+ `{baseDir}/scripts/wait-for-text.sh` polls a pane for a regex (or fixed string) with a timeout.
112
+
113
+ ```bash
114
+ {baseDir}/scripts/wait-for-text.sh -t session:0.0 -p 'pattern' [-F] [-T 20] [-i 0.5] [-l 2000]
115
+ ```
116
+
117
+ - `-t`/`--target` pane target (required)
118
+ - `-p`/`--pattern` regex to match (required); add `-F` for fixed string
119
+ - `-T` timeout seconds (integer, default 15)
120
+ - `-i` poll interval seconds (default 0.5)
121
+ - `-l` history lines to search (integer, default 1000)
@@ -0,0 +1,112 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ usage() {
5
+ cat <<'USAGE'
6
+ Usage: find-sessions.sh [-L socket-name|-S socket-path|-A] [-q pattern]
7
+
8
+ List tmux sessions on a socket (default tmux socket if none provided).
9
+
10
+ Options:
11
+ -L, --socket tmux socket name (passed to tmux -L)
12
+ -S, --socket-path tmux socket path (passed to tmux -S)
13
+ -A, --all scan all sockets under KYBER_TMUX_SOCKET_DIR
14
+ -q, --query case-insensitive substring to filter session names
15
+ -h, --help show this help
16
+ USAGE
17
+ }
18
+
19
+ socket_name=""
20
+ socket_path=""
21
+ query=""
22
+ scan_all=false
23
+ socket_dir="${KYBER_TMUX_SOCKET_DIR:-${TMPDIR:-/tmp}/kyber-tmux-sockets}"
24
+
25
+ while [[ $# -gt 0 ]]; do
26
+ case "$1" in
27
+ -L|--socket) socket_name="${2-}"; shift 2 ;;
28
+ -S|--socket-path) socket_path="${2-}"; shift 2 ;;
29
+ -A|--all) scan_all=true; shift ;;
30
+ -q|--query) query="${2-}"; shift 2 ;;
31
+ -h|--help) usage; exit 0 ;;
32
+ *) echo "Unknown option: $1" >&2; usage; exit 1 ;;
33
+ esac
34
+ done
35
+
36
+ if [[ "$scan_all" == true && ( -n "$socket_name" || -n "$socket_path" ) ]]; then
37
+ echo "Cannot combine --all with -L or -S" >&2
38
+ exit 1
39
+ fi
40
+
41
+ if [[ -n "$socket_name" && -n "$socket_path" ]]; then
42
+ echo "Use either -L or -S, not both" >&2
43
+ exit 1
44
+ fi
45
+
46
+ if ! command -v tmux >/dev/null 2>&1; then
47
+ echo "tmux not found in PATH" >&2
48
+ exit 1
49
+ fi
50
+
51
+ list_sessions() {
52
+ local label="$1"; shift
53
+ local tmux_cmd=(tmux "$@")
54
+
55
+ if ! sessions="$("${tmux_cmd[@]}" list-sessions -F '#{session_name}\t#{session_attached}\t#{session_created_string}' 2>/dev/null)"; then
56
+ echo "No tmux server found on $label" >&2
57
+ return 1
58
+ fi
59
+
60
+ if [[ -n "$query" ]]; then
61
+ sessions="$(printf '%s\n' "$sessions" | grep -i -- "$query" || true)"
62
+ fi
63
+
64
+ if [[ -z "$sessions" ]]; then
65
+ echo "No sessions found on $label"
66
+ return 0
67
+ fi
68
+
69
+ echo "Sessions on $label:"
70
+ printf '%s\n' "$sessions" | while IFS=$'\t' read -r name attached created; do
71
+ attached_label=$([[ "$attached" == "1" ]] && echo "attached" || echo "detached")
72
+ printf ' - %s (%s, started %s)\n' "$name" "$attached_label" "$created"
73
+ done
74
+ }
75
+
76
+ if [[ "$scan_all" == true ]]; then
77
+ if [[ ! -d "$socket_dir" ]]; then
78
+ echo "Socket directory not found: $socket_dir" >&2
79
+ exit 1
80
+ fi
81
+
82
+ shopt -s nullglob
83
+ sockets=("$socket_dir"/*)
84
+ shopt -u nullglob
85
+
86
+ if [[ "${#sockets[@]}" -eq 0 ]]; then
87
+ echo "No sockets found under $socket_dir" >&2
88
+ exit 1
89
+ fi
90
+
91
+ exit_code=0
92
+ for sock in "${sockets[@]}"; do
93
+ if [[ ! -S "$sock" ]]; then
94
+ continue
95
+ fi
96
+ list_sessions "socket path '$sock'" -S "$sock" || exit_code=$?
97
+ done
98
+ exit "$exit_code"
99
+ fi
100
+
101
+ tmux_cmd=(tmux)
102
+ socket_label="default socket"
103
+
104
+ if [[ -n "$socket_name" ]]; then
105
+ tmux_cmd+=(-L "$socket_name")
106
+ socket_label="socket name '$socket_name'"
107
+ elif [[ -n "$socket_path" ]]; then
108
+ tmux_cmd+=(-S "$socket_path")
109
+ socket_label="socket path '$socket_path'"
110
+ fi
111
+
112
+ list_sessions "$socket_label" "${tmux_cmd[@]:1}"
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ usage() {
5
+ cat <<'USAGE'
6
+ Usage: wait-for-text.sh -t target -p pattern [options]
7
+
8
+ Poll a tmux pane for text and exit when found.
9
+
10
+ Options:
11
+ -t, --target tmux target (session:window.pane), required
12
+ -p, --pattern regex pattern to look for, required
13
+ -F, --fixed treat pattern as a fixed string (grep -F)
14
+ -T, --timeout seconds to wait (integer, default: 15)
15
+ -i, --interval poll interval in seconds (default: 0.5)
16
+ -l, --lines number of history lines to inspect (integer, default: 1000)
17
+ -h, --help show this help
18
+ USAGE
19
+ }
20
+
21
+ target=""
22
+ pattern=""
23
+ grep_flag="-E"
24
+ timeout=15
25
+ interval=0.5
26
+ lines=1000
27
+
28
+ while [[ $# -gt 0 ]]; do
29
+ case "$1" in
30
+ -t|--target) target="${2-}"; shift 2 ;;
31
+ -p|--pattern) pattern="${2-}"; shift 2 ;;
32
+ -F|--fixed) grep_flag="-F"; shift ;;
33
+ -T|--timeout) timeout="${2-}"; shift 2 ;;
34
+ -i|--interval) interval="${2-}"; shift 2 ;;
35
+ -l|--lines) lines="${2-}"; shift 2 ;;
36
+ -h|--help) usage; exit 0 ;;
37
+ *) echo "Unknown option: $1" >&2; usage; exit 1 ;;
38
+ esac
39
+ done
40
+
41
+ if [[ -z "$target" || -z "$pattern" ]]; then
42
+ echo "target and pattern are required" >&2
43
+ usage
44
+ exit 1
45
+ fi
46
+
47
+ if ! [[ "$timeout" =~ ^[0-9]+$ ]]; then
48
+ echo "timeout must be an integer number of seconds" >&2
49
+ exit 1
50
+ fi
51
+
52
+ if ! [[ "$lines" =~ ^[0-9]+$ ]]; then
53
+ echo "lines must be an integer" >&2
54
+ exit 1
55
+ fi
56
+
57
+ if ! command -v tmux >/dev/null 2>&1; then
58
+ echo "tmux not found in PATH" >&2
59
+ exit 1
60
+ fi
61
+
62
+ # End time in epoch seconds (integer, good enough for polling)
63
+ start_epoch=$(date +%s)
64
+ deadline=$((start_epoch + timeout))
65
+
66
+ while true; do
67
+ # -J joins wrapped lines, -S uses negative index to read last N lines
68
+ pane_text="$(tmux capture-pane -p -J -t "$target" -S "-${lines}" 2>/dev/null || true)"
69
+
70
+ if printf '%s\n' "$pane_text" | grep $grep_flag -- "$pattern" >/dev/null 2>&1; then
71
+ exit 0
72
+ fi
73
+
74
+ now=$(date +%s)
75
+ if (( now >= deadline )); then
76
+ echo "Timed out after ${timeout}s waiting for pattern: $pattern" >&2
77
+ echo "Last ${lines} lines from $target:" >&2
78
+ printf '%s\n' "$pane_text" >&2
79
+ exit 1
80
+ fi
81
+
82
+ sleep "$interval"
83
+ done
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: weather
3
+ description: Get current weather and forecasts (no API key required).
4
+ homepage: https://wttr.in/:help
5
+ metadata: {"kyber":{"emoji":"🌤️","requires":{"bins":["curl"]}}}
6
+ ---
7
+
8
+ # Weather
9
+
10
+ Two free services, no API keys needed.
11
+
12
+ ## wttr.in (primary)
13
+
14
+ Quick one-liner:
15
+ ```bash
16
+ curl -s "wttr.in/London?format=3"
17
+ # Output: London: ⛅️ +8°C
18
+ ```
19
+
20
+ Compact format:
21
+ ```bash
22
+ curl -s "wttr.in/London?format=%l:+%c+%t+%h+%w"
23
+ # Output: London: ⛅️ +8°C 71% ↙5km/h
24
+ ```
25
+
26
+ Full forecast:
27
+ ```bash
28
+ curl -s "wttr.in/London?T"
29
+ ```
30
+
31
+ Format codes: `%c` condition · `%t` temp · `%h` humidity · `%w` wind · `%l` location · `%m` moon
32
+
33
+ Tips:
34
+ - URL-encode spaces: `wttr.in/New+York`
35
+ - Airport codes: `wttr.in/JFK`
36
+ - Units: `?m` (metric) `?u` (USCS)
37
+ - Today only: `?1` · Current only: `?0`
38
+ - PNG: `curl -s "wttr.in/Berlin.png" -o /tmp/weather.png`
39
+
40
+ ## Open-Meteo (fallback, JSON)
41
+
42
+ Free, no key, good for programmatic use:
43
+ ```bash
44
+ curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12&current_weather=true"
45
+ ```
46
+
47
+ Find coordinates for a city, then query. Returns JSON with temp, windspeed, weathercode.
48
+
49
+ Docs: https://open-meteo.com/en/docs
@@ -0,0 +1,5 @@
1
+ """Utility functions for kyber."""
2
+
3
+ from kyber.utils.helpers import ensure_dir, get_workspace_path, get_data_path
4
+
5
+ __all__ = ["ensure_dir", "get_workspace_path", "get_data_path"]
kyber/utils/helpers.py ADDED
@@ -0,0 +1,91 @@
1
+ """Utility functions for kyber."""
2
+
3
+ from pathlib import Path
4
+ from datetime import datetime
5
+
6
+
7
+ def ensure_dir(path: Path) -> Path:
8
+ """Ensure a directory exists, creating it if necessary."""
9
+ path.mkdir(parents=True, exist_ok=True)
10
+ return path
11
+
12
+
13
+ def get_data_path() -> Path:
14
+ """Get the kyber data directory (~/.kyber)."""
15
+ return ensure_dir(Path.home() / ".kyber")
16
+
17
+
18
+ def get_workspace_path(workspace: str | None = None) -> Path:
19
+ """
20
+ Get the workspace path.
21
+
22
+ Args:
23
+ workspace: Optional workspace path. Defaults to ~/.kyber/workspace.
24
+
25
+ Returns:
26
+ Expanded and ensured workspace path.
27
+ """
28
+ if workspace:
29
+ path = Path(workspace).expanduser()
30
+ else:
31
+ path = Path.home() / ".kyber" / "workspace"
32
+ return ensure_dir(path)
33
+
34
+
35
+ def get_sessions_path() -> Path:
36
+ """Get the sessions storage directory."""
37
+ return ensure_dir(get_data_path() / "sessions")
38
+
39
+
40
+ def get_memory_path(workspace: Path | None = None) -> Path:
41
+ """Get the memory directory within the workspace."""
42
+ ws = workspace or get_workspace_path()
43
+ return ensure_dir(ws / "memory")
44
+
45
+
46
+ def get_skills_path(workspace: Path | None = None) -> Path:
47
+ """Get the skills directory within the workspace."""
48
+ ws = workspace or get_workspace_path()
49
+ return ensure_dir(ws / "skills")
50
+
51
+
52
+ def today_date() -> str:
53
+ """Get today's date in YYYY-MM-DD format."""
54
+ return datetime.now().strftime("%Y-%m-%d")
55
+
56
+
57
+ def timestamp() -> str:
58
+ """Get current timestamp in ISO format."""
59
+ return datetime.now().isoformat()
60
+
61
+
62
+ def truncate_string(s: str, max_len: int = 100, suffix: str = "...") -> str:
63
+ """Truncate a string to max length, adding suffix if truncated."""
64
+ if len(s) <= max_len:
65
+ return s
66
+ return s[: max_len - len(suffix)] + suffix
67
+
68
+
69
+ def safe_filename(name: str) -> str:
70
+ """Convert a string to a safe filename."""
71
+ # Replace unsafe characters
72
+ unsafe = '<>:"/\\|?*'
73
+ for char in unsafe:
74
+ name = name.replace(char, "_")
75
+ return name.strip()
76
+
77
+
78
+ def parse_session_key(key: str) -> tuple[str, str]:
79
+ """
80
+ Parse a session key into channel and chat_id.
81
+
82
+ Args:
83
+ key: Session key in format "channel:chat_id"
84
+
85
+ Returns:
86
+ Tuple of (channel, chat_id)
87
+ """
88
+ parts = key.split(":", 1)
89
+ if len(parts) != 2:
90
+ raise ValueError(f"Invalid session key: {key}")
91
+ return parts[0], parts[1]
@@ -0,0 +1,35 @@
1
+ Metadata-Version: 2.4
2
+ Name: kyber-chat
3
+ Version: 1.0.0
4
+ Summary: A lightweight personal AI assistant framework
5
+ Author: kyber contributors
6
+ License: MIT
7
+ License-File: LICENSE
8
+ Keywords: agent,ai,chatbot
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Requires-Python: >=3.11
15
+ Requires-Dist: croniter>=2.0.0
16
+ Requires-Dist: discord-py>=2.4.0
17
+ Requires-Dist: fastapi>=0.115.0
18
+ Requires-Dist: httpx>=0.25.0
19
+ Requires-Dist: litellm>=1.0.0
20
+ Requires-Dist: loguru>=0.7.0
21
+ Requires-Dist: pydantic-settings>=2.0.0
22
+ Requires-Dist: pydantic>=2.0.0
23
+ Requires-Dist: python-telegram-bot>=21.0
24
+ Requires-Dist: readability-lxml>=0.8.0
25
+ Requires-Dist: rich>=13.0.0
26
+ Requires-Dist: typer>=0.9.0
27
+ Requires-Dist: uvicorn>=0.30.0
28
+ Requires-Dist: websocket-client>=1.6.0
29
+ Requires-Dist: websockets>=12.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
32
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
33
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
34
+ Provides-Extra: feishu
35
+ Requires-Dist: lark-oapi>=1.0.0; extra == 'feishu'
@@ -0,0 +1,71 @@
1
+ kyber/__init__.py,sha256=VpQFQmxz16xRrHAr4L0QZKk-HRKuaBOeVyaagwysV4Y,90
2
+ kyber/__main__.py,sha256=GnuXALV8N2rrM8ljzwkitfT_JNdGS6duBIbBOAVhwQo,141
3
+ kyber/agent/__init__.py,sha256=2XQIfkYC6flAWz5ymKgJ6Mep0LB0Hvp6unNSr4UyrT8,273
4
+ kyber/agent/context.py,sha256=PwFMg1KL0-_X-jKkpx7w9EI1VlYyFamYzRbzhFgRS48,7848
5
+ kyber/agent/loop.py,sha256=z5tn0Lnn2c6zlCEmcbvm3Hc9Ts2r_Cfprl66Fnikh8w,27651
6
+ kyber/agent/memory.py,sha256=KLj5oMNXf_sP3Lkdcpc-8iR0KNHrBEUkbgbXtJg2dhQ,3437
7
+ kyber/agent/skills.py,sha256=yY-PXr1LbeHnlTO2CJypn97wX3lchogKDmeJoegMDHk,8889
8
+ kyber/agent/subagent.py,sha256=16HmezXuCNumpxTwzCJAM0NB1rp7EiLsAcYMiaUWkGQ,13964
9
+ kyber/agent/tools/__init__.py,sha256=Z9TH9aBV-IAk0Z-bH6kyvaMwPn5ghxS-btkrlfnFpTQ,155
10
+ kyber/agent/tools/base.py,sha256=1WHEsaXd4K2w4cZp8zWIBDKPPwNIRmWQe1RXF_cZ1E0,3665
11
+ kyber/agent/tools/filesystem.py,sha256=bBMudfIRFmOkXanrZ2dCJTuVt102dP1QAXhnYxTf3FI,6093
12
+ kyber/agent/tools/message.py,sha256=3p-6vg1WTSUjJnFjogrApYvvWCj1iexh7hQ1EGNg2IA,2721
13
+ kyber/agent/tools/registry.py,sha256=VPeUuDYJ0luCrqG0Akdyaun5FaQSpPfC-VEq7m_-3XY,2092
14
+ kyber/agent/tools/shell.py,sha256=EUiy5nedaaCOk79JVivQA4dpiDLjE7fdJtg7TGa4gL4,4995
15
+ kyber/agent/tools/spawn.py,sha256=KToJ_AxKX0s-iEqE7Zq8J4OF9plpI8caa9WdYVNLvpA,2048
16
+ kyber/agent/tools/task_status.py,sha256=dRF-d6qQAFVTONRU8jVjlcIH5tsCDMMrrpBysrrKPFQ,1711
17
+ kyber/agent/tools/web.py,sha256=aOw6wWZkN2cfrposCW-F1cKshuDl4OWOTHp4rE6RjNE,6375
18
+ kyber/bus/__init__.py,sha256=TB9puUlsrLiVUNFN65lcWjjEfFzN7YeeJ9ZD6uxfJxE,232
19
+ kyber/bus/events.py,sha256=HUAQytJao-mTFfbhcGHd5EmLFiFsW3gAYA_6Tp0-Bnw,1038
20
+ kyber/bus/queue.py,sha256=4K9Fr6TFMue2rKTX96l7HX_stIoPt6kXAXdbhhGonu8,2927
21
+ kyber/channels/__init__.py,sha256=qNntfGVxTHQWIy7b4gtO0M3IU9bL8qLwdFW-ifB8Qik,193
22
+ kyber/channels/base.py,sha256=8NxSMK3cltnT1CL-c9ENnSYd2u9RPzcr27Rjqsvoimk,3364
23
+ kyber/channels/discord.py,sha256=fajwf1e8S3AyBYSGb6CDKZGqgQdvh_0c1QIueWLACYg,11150
24
+ kyber/channels/feishu.py,sha256=kaiW-ibLWX2yBDgiM3LCoVPYFK631axG3CkA3gj9ZhQ,9515
25
+ kyber/channels/manager.py,sha256=OjWxpSU6740-tI6o5v2C64KLktkS4vrsm7obB3FqOCU,5681
26
+ kyber/channels/telegram.py,sha256=j6DE8zBHiazPamyrYYN0VOhbejY9uzhyws8KLMa4Mak,11300
27
+ kyber/channels/whatsapp.py,sha256=3vD9kflGrA2azNIBn2m7SHwJoiXUM0XgdsiHre9gjT8,5001
28
+ kyber/cli/__init__.py,sha256=rKbjv4nJc1XUP2GSGtDi5YgeP5b1UsvJhJkpQsCWwVs,28
29
+ kyber/cli/commands.py,sha256=gd8dwhUObINivFaKuG02D5pP5C0w0rSQGBsldP8_uMU,24265
30
+ kyber/config/__init__.py,sha256=zvSCVmT6XgLhuoDfAGNxAh58eTz8qrwUYNx9lFtUDPs,195
31
+ kyber/config/loader.py,sha256=-hDE7a6kvOCkdUpkPjMGWCNyN_7-OZ6_CnPmaOuLQzg,2710
32
+ kyber/config/schema.py,sha256=h7D6e_ZS1wXfzJRrSlSZJaMVZxvN28iPgOjsJWKswD8,7878
33
+ kyber/cron/__init__.py,sha256=evX6oofNybqJ86_-62IsUIwyrSB0hGdU37VguRFbHoI,195
34
+ kyber/cron/service.py,sha256=cSEyfw1I4LSACevow72_44K6_UtLLJiRP7qtesRQJdc,12029
35
+ kyber/cron/types.py,sha256=Vx4qLOCu1vE90hqICsACwN3GlWj_GVOYCaV7bCpjCvc,1586
36
+ kyber/dashboard/__init__.py,sha256=c24XI1WyuOG-phxk9hvC8j5mICZdMVyjnB9NNKHuqNI,128
37
+ kyber/dashboard/server.py,sha256=FONDaIz5uExLHp9lDbzor522wD_qijQg46DHgDaHYMk,4691
38
+ kyber/dashboard/static/app.js,sha256=G_QGFXO8FxWP8NEymoBkWJkG4GT-nCPYfSW7-iXWxfY,13844
39
+ kyber/dashboard/static/favicon.png,sha256=7OddkzMJN5B51-FYW2a_87WD6tFGjpdK9pAz2K8r98o,302086
40
+ kyber/dashboard/static/index.html,sha256=rkwdSesIXt7qH_P4266_kSwuc_mVkMR9Mtu1tNFDzNI,5718
41
+ kyber/dashboard/static/kyber_logo.png,sha256=roE9L_V1Fxr3Ku4_vO5Cd3zH17FW121dyzuYNSktavY,279574
42
+ kyber/dashboard/static/styles.css,sha256=p5JWu5rIpfV5hLbqyuYK6S2jiLncxTOBKAT270KBJmM,11485
43
+ kyber/heartbeat/__init__.py,sha256=6iDEjnhDiifpKU4FNKrJS_GUYsw8GqFCOQUqh5spzOU,139
44
+ kyber/heartbeat/service.py,sha256=AndTBgyF0uWLDgbe47UW3mdHBjg28tbm0MLzh5-6uqY,4310
45
+ kyber/providers/__init__.py,sha256=3-FCxmyeNMh9dpVcJwC1qsZUaOOA6efCXFnMLA99UJQ,220
46
+ kyber/providers/base.py,sha256=XNPYJzTiVUwiV3GPbk-XNMlA62wIo2BeBH-j0S5tVPo,1900
47
+ kyber/providers/litellm_provider.py,sha256=BdYy7wSxNXp4AjjN1GnB9TpQDLw3p1gXyyDLLmfJEgg,8862
48
+ kyber/providers/transcription.py,sha256=pAZ7I8vwu1XDMa_SPhqBdbQd13Fjhxx8hrWiidTdgas,2021
49
+ kyber/session/__init__.py,sha256=PCQGGO_WWC_fwxIxsqJ2Gb_jzIXWpj86gs4vKqnK_yU,133
50
+ kyber/session/manager.py,sha256=g5U5NNe_wiJTBst16WezIBxZ8aqdOyZNsDrYkPQqDk8,6321
51
+ kyber/skills/README.md,sha256=SzKIXeVw9SktN2sAVIFhSh8VxolTVnSb6lc9It9ecpY,1581
52
+ kyber/skills/github/SKILL.md,sha256=49Nx7QLVFs91FslHGtTlu3r0g1hXVwBGhbGYT-sAWPk,1372
53
+ kyber/skills/skill-creator/SKILL.md,sha256=yyeFoRM5BbzJUq_FABub0g-SqPRzvpM2_R-fAdsFtqA,18460
54
+ kyber/skills/summarize/SKILL.md,sha256=lt02zgVmnRUQ5m814ecyyGr4IAak9CLbRFOE4kTGju0,2038
55
+ kyber/skills/tmux/SKILL.md,sha256=7GHli3hZgyA86CdxcQIJnwijfmZPaNajPfasUT_FcHU,4045
56
+ kyber/skills/tmux/scripts/find-sessions.sh,sha256=s4lTwzXQ2EsddN3yWjv4dchoNqX5V7IcDOoaYR6tvfU,2936
57
+ kyber/skills/tmux/scripts/wait-for-text.sh,sha256=lrxCcC9zU8MiM8Ij1h3RHy-ZAzJnru-sg4rqiYOmdzU,2139
58
+ kyber/skills/weather/SKILL.md,sha256=aKkh-TcygH9Y0K83kFa_6YsQE7CSg6GtB5Rn8QX52EU,1166
59
+ kyber/utils/__init__.py,sha256=zM9NlSzkdh9AsNh5mPpaNgPnexsY8VTJZjrZ7YNmFcI,179
60
+ kyber/utils/helpers.py,sha256=a7Qr3DLDv7fvGo6K48TcY-wxwzcLByqx9mC5J5v7Yeg,2412
61
+ kyber/bridge/package.json,sha256=qSNprnBSiomX_GJezBhMs9nwH3-KCdBAg_tx80KVTuw,584
62
+ kyber/bridge/tsconfig.json,sha256=UIB9xDM5Cdn5zy-L6R_ecbWMHCKcb5JCLLMheh_Zs_Y,355
63
+ kyber/bridge/src/index.ts,sha256=0TyPqG2_pKINYeV5sANBXq5Su7CvqraO8N_kYbH7_ek,1246
64
+ kyber/bridge/src/server.ts,sha256=9PxZg5LN_4WE1Nob9FuC6q-BwBAZPA9iosXp0epZyAc,2763
65
+ kyber/bridge/src/types.d.ts,sha256=q1myb2dTPBoosZ9T5WVoteyRTSzkx0jaHghpxQpn078,116
66
+ kyber/bridge/src/whatsapp.ts,sha256=meJfzBMCbNz8DbhhQklcgdMZgB8POM0BcC1rvpurxQc,5030
67
+ kyber_chat-1.0.0.dist-info/METADATA,sha256=wp-wWiLKel-BOWf_OOPhHAGaN4JRdhpHvvwW7NjFJPc,1192
68
+ kyber_chat-1.0.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
69
+ kyber_chat-1.0.0.dist-info/entry_points.txt,sha256=PL1YUXp_jpeB1T9RKvVJ3mINrLLkFe69BsaxJKB7vd4,49
70
+ kyber_chat-1.0.0.dist-info/licenses/LICENSE,sha256=L8f1oGLQ3ccz7gqTpD0HRF5g5ojNfROfdSkQM2k3rqs,1074
71
+ kyber_chat-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.28.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ kyber = kyber.cli.commands:app
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 kyber contributors
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.