0xkobold 0.0.1

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 (258) hide show
  1. package/.agents/skills/nextjs-best-practices/SKILL.md +208 -0
  2. package/.agents/skills/sql-optimization-patterns/SKILL.md +509 -0
  3. package/HEARTBEAT.md +45 -0
  4. package/README.md +197 -0
  5. package/USAGE.md +191 -0
  6. package/dist/package.json +77 -0
  7. package/dist/src/agent/pi-adapter.js +307 -0
  8. package/dist/src/agent/pi-adapter.js.map +1 -0
  9. package/dist/src/agent/tool-adapter.js +86 -0
  10. package/dist/src/agent/tool-adapter.js.map +1 -0
  11. package/dist/src/approval/queue.js +114 -0
  12. package/dist/src/approval/queue.js.map +1 -0
  13. package/dist/src/ascii-kobold.js +76 -0
  14. package/dist/src/ascii-kobold.js.map +1 -0
  15. package/dist/src/cli/client.js +217 -0
  16. package/dist/src/cli/client.js.map +1 -0
  17. package/dist/src/cli/commands/agent.js +272 -0
  18. package/dist/src/cli/commands/agent.js.map +1 -0
  19. package/dist/src/cli/commands/chat.js +234 -0
  20. package/dist/src/cli/commands/chat.js.map +1 -0
  21. package/dist/src/cli/commands/config.js +202 -0
  22. package/dist/src/cli/commands/config.js.map +1 -0
  23. package/dist/src/cli/commands/daemon.js +203 -0
  24. package/dist/src/cli/commands/daemon.js.map +1 -0
  25. package/dist/src/cli/commands/gateway.js +184 -0
  26. package/dist/src/cli/commands/gateway.js.map +1 -0
  27. package/dist/src/cli/commands/init.js +175 -0
  28. package/dist/src/cli/commands/init.js.map +1 -0
  29. package/dist/src/cli/commands/kobold.js +21 -0
  30. package/dist/src/cli/commands/kobold.js.map +1 -0
  31. package/dist/src/cli/commands/logs.js +27 -0
  32. package/dist/src/cli/commands/logs.js.map +1 -0
  33. package/dist/src/cli/commands/mode.js +121 -0
  34. package/dist/src/cli/commands/mode.js.map +1 -0
  35. package/dist/src/cli/commands/persona.js +261 -0
  36. package/dist/src/cli/commands/persona.js.map +1 -0
  37. package/dist/src/cli/commands/start.js +66 -0
  38. package/dist/src/cli/commands/start.js.map +1 -0
  39. package/dist/src/cli/commands/status.js +117 -0
  40. package/dist/src/cli/commands/status.js.map +1 -0
  41. package/dist/src/cli/commands/stop.js +27 -0
  42. package/dist/src/cli/commands/stop.js.map +1 -0
  43. package/dist/src/cli/commands/system.js +128 -0
  44. package/dist/src/cli/commands/system.js.map +1 -0
  45. package/dist/src/cli/commands/tui.js +103 -0
  46. package/dist/src/cli/commands/tui.js.map +1 -0
  47. package/dist/src/cli/commands/update.js +133 -0
  48. package/dist/src/cli/commands/update.js.map +1 -0
  49. package/dist/src/cli/extensions/discord.js +113 -0
  50. package/dist/src/cli/extensions/discord.js.map +1 -0
  51. package/dist/src/cli/extensions/env.js +91 -0
  52. package/dist/src/cli/extensions/env.js.map +1 -0
  53. package/dist/src/cli/extensions/heartbeat.js +78 -0
  54. package/dist/src/cli/extensions/heartbeat.js.map +1 -0
  55. package/dist/src/cli/index.js +24 -0
  56. package/dist/src/cli/index.js.map +1 -0
  57. package/dist/src/cli/program.js +70 -0
  58. package/dist/src/cli/program.js.map +1 -0
  59. package/dist/src/cli/repl.js +184 -0
  60. package/dist/src/cli/repl.js.map +1 -0
  61. package/dist/src/cli/shared/discord-service.js +102 -0
  62. package/dist/src/cli/shared/discord-service.js.map +1 -0
  63. package/dist/src/config/index.js +10 -0
  64. package/dist/src/config/index.js.map +1 -0
  65. package/dist/src/config/loader.js +401 -0
  66. package/dist/src/config/loader.js.map +1 -0
  67. package/dist/src/config/paths.js +84 -0
  68. package/dist/src/config/paths.js.map +1 -0
  69. package/dist/src/config/types.js +8 -0
  70. package/dist/src/config/types.js.map +1 -0
  71. package/dist/src/context-detector.js +60 -0
  72. package/dist/src/context-detector.js.map +1 -0
  73. package/dist/src/discord/index.js +376 -0
  74. package/dist/src/discord/index.js.map +1 -0
  75. package/dist/src/event-bus/index.js +97 -0
  76. package/dist/src/event-bus/index.js.map +1 -0
  77. package/dist/src/extensions/command-args.js +68 -0
  78. package/dist/src/extensions/command-args.js.map +1 -0
  79. package/dist/src/extensions/core/agent-registry-extension.js +541 -0
  80. package/dist/src/extensions/core/agent-registry-extension.js.map +1 -0
  81. package/dist/src/extensions/core/agent-worker.js +148 -0
  82. package/dist/src/extensions/core/agent-worker.js.map +1 -0
  83. package/dist/src/extensions/core/compaction-safeguard.js +154 -0
  84. package/dist/src/extensions/core/compaction-safeguard.js.map +1 -0
  85. package/dist/src/extensions/core/confirm-destructive.js +43 -0
  86. package/dist/src/extensions/core/confirm-destructive.js.map +1 -0
  87. package/dist/src/extensions/core/context-aware-extension.js +124 -0
  88. package/dist/src/extensions/core/context-aware-extension.js.map +1 -0
  89. package/dist/src/extensions/core/context-pruning/extension.js +124 -0
  90. package/dist/src/extensions/core/context-pruning/extension.js.map +1 -0
  91. package/dist/src/extensions/core/context-pruning/pruner.js +312 -0
  92. package/dist/src/extensions/core/context-pruning/pruner.js.map +1 -0
  93. package/dist/src/extensions/core/context-pruning/runtime.js +48 -0
  94. package/dist/src/extensions/core/context-pruning/runtime.js.map +1 -0
  95. package/dist/src/extensions/core/context-pruning/settings.js +105 -0
  96. package/dist/src/extensions/core/context-pruning/settings.js.map +1 -0
  97. package/dist/src/extensions/core/dirty-repo-guard.js +42 -0
  98. package/dist/src/extensions/core/dirty-repo-guard.js.map +1 -0
  99. package/dist/src/extensions/core/discord-channel-extension.js +205 -0
  100. package/dist/src/extensions/core/discord-channel-extension.js.map +1 -0
  101. package/dist/src/extensions/core/discord-extension.js +142 -0
  102. package/dist/src/extensions/core/discord-extension.js.map +1 -0
  103. package/dist/src/extensions/core/env-loader-extension.js +157 -0
  104. package/dist/src/extensions/core/env-loader-extension.js.map +1 -0
  105. package/dist/src/extensions/core/fileops-extension.js +699 -0
  106. package/dist/src/extensions/core/fileops-extension.js.map +1 -0
  107. package/dist/src/extensions/core/gateway-extension.js +730 -0
  108. package/dist/src/extensions/core/gateway-extension.js.map +1 -0
  109. package/dist/src/extensions/core/git-checkpoint.js +46 -0
  110. package/dist/src/extensions/core/git-checkpoint.js.map +1 -0
  111. package/dist/src/extensions/core/handoff-extension.js +206 -0
  112. package/dist/src/extensions/core/handoff-extension.js.map +1 -0
  113. package/dist/src/extensions/core/heartbeat-extension.js +373 -0
  114. package/dist/src/extensions/core/heartbeat-extension.js.map +1 -0
  115. package/dist/src/extensions/core/mcp-extension.js +413 -0
  116. package/dist/src/extensions/core/mcp-extension.js.map +1 -0
  117. package/dist/src/extensions/core/mode-manager-extension.js +562 -0
  118. package/dist/src/extensions/core/mode-manager-extension.js.map +1 -0
  119. package/dist/src/extensions/core/multi-channel-extension.js +435 -0
  120. package/dist/src/extensions/core/multi-channel-extension.js.map +1 -0
  121. package/dist/src/extensions/core/ollama-provider-extension.js +66 -0
  122. package/dist/src/extensions/core/ollama-provider-extension.js.map +1 -0
  123. package/dist/src/extensions/core/onboarding-extension.js +122 -0
  124. package/dist/src/extensions/core/onboarding-extension.js.map +1 -0
  125. package/dist/src/extensions/core/persona-loader-extension.js +139 -0
  126. package/dist/src/extensions/core/persona-loader-extension.js.map +1 -0
  127. package/dist/src/extensions/core/pi-notify-extension.js +70 -0
  128. package/dist/src/extensions/core/pi-notify-extension.js.map +1 -0
  129. package/dist/src/extensions/core/protected-paths.js +24 -0
  130. package/dist/src/extensions/core/protected-paths.js.map +1 -0
  131. package/dist/src/extensions/core/questionnaire-extension.js +242 -0
  132. package/dist/src/extensions/core/questionnaire-extension.js.map +1 -0
  133. package/dist/src/extensions/core/self-update-extension.js +181 -0
  134. package/dist/src/extensions/core/self-update-extension.js.map +1 -0
  135. package/dist/src/extensions/core/session-bridge-extension.js +78 -0
  136. package/dist/src/extensions/core/session-bridge-extension.js.map +1 -0
  137. package/dist/src/extensions/core/session-manager-extension.js +319 -0
  138. package/dist/src/extensions/core/session-manager-extension.js.map +1 -0
  139. package/dist/src/extensions/core/session-name-extension.js +88 -0
  140. package/dist/src/extensions/core/session-name-extension.js.map +1 -0
  141. package/dist/src/extensions/core/session-pruning-extension.js +480 -0
  142. package/dist/src/extensions/core/session-pruning-extension.js.map +1 -0
  143. package/dist/src/extensions/core/task-manager-extension.js +661 -0
  144. package/dist/src/extensions/core/task-manager-extension.js.map +1 -0
  145. package/dist/src/extensions/core/update-extension.js +438 -0
  146. package/dist/src/extensions/core/update-extension.js.map +1 -0
  147. package/dist/src/extensions/core/websearch-extension.js +463 -0
  148. package/dist/src/extensions/core/websearch-extension.js.map +1 -0
  149. package/dist/src/extensions/index.js +5 -0
  150. package/dist/src/extensions/index.js.map +1 -0
  151. package/dist/src/extensions/loader.js +80 -0
  152. package/dist/src/extensions/loader.js.map +1 -0
  153. package/dist/src/gateway/index.js +353 -0
  154. package/dist/src/gateway/index.js.map +1 -0
  155. package/dist/src/index.js +150 -0
  156. package/dist/src/index.js.map +1 -0
  157. package/dist/src/llm/anthropic.js +86 -0
  158. package/dist/src/llm/anthropic.js.map +1 -0
  159. package/dist/src/llm/index.js +9 -0
  160. package/dist/src/llm/index.js.map +1 -0
  161. package/dist/src/llm/ollama.js +113 -0
  162. package/dist/src/llm/ollama.js.map +1 -0
  163. package/dist/src/llm/router.js +145 -0
  164. package/dist/src/llm/router.js.map +1 -0
  165. package/dist/src/llm/types.js +7 -0
  166. package/dist/src/llm/types.js.map +1 -0
  167. package/dist/src/memory/index.js +5 -0
  168. package/dist/src/memory/index.js.map +1 -0
  169. package/dist/src/memory/store.js +91 -0
  170. package/dist/src/memory/store.js.map +1 -0
  171. package/dist/src/pi-config.js +80 -0
  172. package/dist/src/pi-config.js.map +1 -0
  173. package/dist/src/skills/builtin/file.js +184 -0
  174. package/dist/src/skills/builtin/file.js.map +1 -0
  175. package/dist/src/skills/builtin/shell.js +100 -0
  176. package/dist/src/skills/builtin/shell.js.map +1 -0
  177. package/dist/src/skills/builtin/subagent.js +62 -0
  178. package/dist/src/skills/builtin/subagent.js.map +1 -0
  179. package/dist/src/skills/hello.js +42 -0
  180. package/dist/src/skills/hello.js.map +1 -0
  181. package/dist/src/skills/index.js +11 -0
  182. package/dist/src/skills/index.js.map +1 -0
  183. package/dist/src/skills/loader.js +382 -0
  184. package/dist/src/skills/loader.js.map +1 -0
  185. package/dist/src/skills/types.js +8 -0
  186. package/dist/src/skills/types.js.map +1 -0
  187. package/dist/src/utils/working-dir.js +71 -0
  188. package/dist/src/utils/working-dir.js.map +1 -0
  189. package/package.json +77 -0
  190. package/skills/1password/SKILL.md +70 -0
  191. package/skills/1password/references/cli-examples.md +29 -0
  192. package/skills/1password/references/get-started.md +17 -0
  193. package/skills/apple-notes/SKILL.md +77 -0
  194. package/skills/apple-reminders/SKILL.md +118 -0
  195. package/skills/bear-notes/SKILL.md +107 -0
  196. package/skills/blogwatcher/SKILL.md +69 -0
  197. package/skills/blucli/SKILL.md +47 -0
  198. package/skills/bluebubbles/SKILL.md +131 -0
  199. package/skills/camsnap/SKILL.md +45 -0
  200. package/skills/canvas/SKILL.md +198 -0
  201. package/skills/clawhub/SKILL.md +77 -0
  202. package/skills/coding-agent/SKILL.md +284 -0
  203. package/skills/discord/SKILL.md +197 -0
  204. package/skills/eightctl/SKILL.md +50 -0
  205. package/skills/food-order/SKILL.md +48 -0
  206. package/skills/gemini/SKILL.md +43 -0
  207. package/skills/gh-issues/SKILL.md +865 -0
  208. package/skills/gifgrep/SKILL.md +79 -0
  209. package/skills/github/SKILL.md +163 -0
  210. package/skills/gog/SKILL.md +116 -0
  211. package/skills/goplaces/SKILL.md +52 -0
  212. package/skills/healthcheck/SKILL.md +245 -0
  213. package/skills/himalaya/SKILL.md +257 -0
  214. package/skills/himalaya/references/configuration.md +184 -0
  215. package/skills/himalaya/references/message-composition.md +199 -0
  216. package/skills/imsg/SKILL.md +122 -0
  217. package/skills/mcporter/SKILL.md +61 -0
  218. package/skills/model-usage/SKILL.md +69 -0
  219. package/skills/model-usage/references/codexbar-cli.md +33 -0
  220. package/skills/model-usage/scripts/model_usage.py +310 -0
  221. package/skills/nano-banana-pro/SKILL.md +58 -0
  222. package/skills/nano-banana-pro/scripts/generate_image.py +184 -0
  223. package/skills/nano-pdf/SKILL.md +38 -0
  224. package/skills/notion/SKILL.md +172 -0
  225. package/skills/obsidian/SKILL.md +81 -0
  226. package/skills/openai-image-gen/SKILL.md +89 -0
  227. package/skills/openai-image-gen/scripts/gen.py +240 -0
  228. package/skills/openai-whisper/SKILL.md +38 -0
  229. package/skills/openai-whisper-api/SKILL.md +52 -0
  230. package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
  231. package/skills/openhue/SKILL.md +112 -0
  232. package/skills/oracle/SKILL.md +125 -0
  233. package/skills/ordercli/SKILL.md +78 -0
  234. package/skills/peekaboo/SKILL.md +190 -0
  235. package/skills/sag/SKILL.md +87 -0
  236. package/skills/session-logs/SKILL.md +115 -0
  237. package/skills/sherpa-onnx-tts/SKILL.md +103 -0
  238. package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
  239. package/skills/skill-creator/SKILL.md +370 -0
  240. package/skills/skill-creator/license.txt +202 -0
  241. package/skills/skill-creator/scripts/init_skill.py +378 -0
  242. package/skills/skill-creator/scripts/package_skill.py +111 -0
  243. package/skills/skill-creator/scripts/quick_validate.py +101 -0
  244. package/skills/slack/SKILL.md +144 -0
  245. package/skills/songsee/SKILL.md +49 -0
  246. package/skills/sonoscli/SKILL.md +46 -0
  247. package/skills/spotify-player/SKILL.md +64 -0
  248. package/skills/summarize/SKILL.md +87 -0
  249. package/skills/things-mac/SKILL.md +86 -0
  250. package/skills/tmux/SKILL.md +153 -0
  251. package/skills/tmux/scripts/find-sessions.sh +112 -0
  252. package/skills/tmux/scripts/wait-for-text.sh +83 -0
  253. package/skills/trello/SKILL.md +95 -0
  254. package/skills/video-frames/SKILL.md +46 -0
  255. package/skills/video-frames/scripts/frame.sh +81 -0
  256. package/skills/voice-call/SKILL.md +45 -0
  257. package/skills/wacli/SKILL.md +72 -0
  258. package/skills/weather/SKILL.md +112 -0
@@ -0,0 +1,240 @@
1
+ #!/usr/bin/env python3
2
+ import argparse
3
+ import base64
4
+ import datetime as dt
5
+ import json
6
+ import os
7
+ import random
8
+ import re
9
+ import sys
10
+ import urllib.error
11
+ import urllib.request
12
+ from pathlib import Path
13
+
14
+
15
+ def slugify(text: str) -> str:
16
+ text = text.lower().strip()
17
+ text = re.sub(r"[^a-z0-9]+", "-", text)
18
+ text = re.sub(r"-{2,}", "-", text).strip("-")
19
+ return text or "image"
20
+
21
+
22
+ def default_out_dir() -> Path:
23
+ now = dt.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
24
+ preferred = Path.home() / "Projects" / "tmp"
25
+ base = preferred if preferred.is_dir() else Path("./tmp")
26
+ base.mkdir(parents=True, exist_ok=True)
27
+ return base / f"openai-image-gen-{now}"
28
+
29
+
30
+ def pick_prompts(count: int) -> list[str]:
31
+ subjects = [
32
+ "a lobster astronaut",
33
+ "a brutalist lighthouse",
34
+ "a cozy reading nook",
35
+ "a cyberpunk noodle shop",
36
+ "a Vienna street at dusk",
37
+ "a minimalist product photo",
38
+ "a surreal underwater library",
39
+ ]
40
+ styles = [
41
+ "ultra-detailed studio photo",
42
+ "35mm film still",
43
+ "isometric illustration",
44
+ "editorial photography",
45
+ "soft watercolor",
46
+ "architectural render",
47
+ "high-contrast monochrome",
48
+ ]
49
+ lighting = [
50
+ "golden hour",
51
+ "overcast soft light",
52
+ "neon lighting",
53
+ "dramatic rim light",
54
+ "candlelight",
55
+ "foggy atmosphere",
56
+ ]
57
+ prompts: list[str] = []
58
+ for _ in range(count):
59
+ prompts.append(
60
+ f"{random.choice(styles)} of {random.choice(subjects)}, {random.choice(lighting)}"
61
+ )
62
+ return prompts
63
+
64
+
65
+ def get_model_defaults(model: str) -> tuple[str, str]:
66
+ """Return (default_size, default_quality) for the given model."""
67
+ if model == "dall-e-2":
68
+ # quality will be ignored
69
+ return ("1024x1024", "standard")
70
+ elif model == "dall-e-3":
71
+ return ("1024x1024", "standard")
72
+ else:
73
+ # GPT image or future models
74
+ return ("1024x1024", "high")
75
+
76
+
77
+ def request_images(
78
+ api_key: str,
79
+ prompt: str,
80
+ model: str,
81
+ size: str,
82
+ quality: str,
83
+ background: str = "",
84
+ output_format: str = "",
85
+ style: str = "",
86
+ ) -> dict:
87
+ url = "https://api.openai.com/v1/images/generations"
88
+ args = {
89
+ "model": model,
90
+ "prompt": prompt,
91
+ "size": size,
92
+ "n": 1,
93
+ }
94
+
95
+ # Quality parameter - dall-e-2 doesn't accept this parameter
96
+ if model != "dall-e-2":
97
+ args["quality"] = quality
98
+
99
+ # Note: response_format no longer supported by OpenAI Images API
100
+ # dall-e models now return URLs by default
101
+
102
+ if model.startswith("gpt-image"):
103
+ if background:
104
+ args["background"] = background
105
+ if output_format:
106
+ args["output_format"] = output_format
107
+
108
+ if model == "dall-e-3" and style:
109
+ args["style"] = style
110
+
111
+ body = json.dumps(args).encode("utf-8")
112
+ req = urllib.request.Request(
113
+ url,
114
+ method="POST",
115
+ headers={
116
+ "Authorization": f"Bearer {api_key}",
117
+ "Content-Type": "application/json",
118
+ },
119
+ data=body,
120
+ )
121
+ try:
122
+ with urllib.request.urlopen(req, timeout=300) as resp:
123
+ return json.loads(resp.read().decode("utf-8"))
124
+ except urllib.error.HTTPError as e:
125
+ payload = e.read().decode("utf-8", errors="replace")
126
+ raise RuntimeError(f"OpenAI Images API failed ({e.code}): {payload}") from e
127
+
128
+
129
+ def write_gallery(out_dir: Path, items: list[dict]) -> None:
130
+ thumbs = "\n".join(
131
+ [
132
+ f"""
133
+ <figure>
134
+ <a href="{it["file"]}"><img src="{it["file"]}" loading="lazy" /></a>
135
+ <figcaption>{it["prompt"]}</figcaption>
136
+ </figure>
137
+ """.strip()
138
+ for it in items
139
+ ]
140
+ )
141
+ html = f"""<!doctype html>
142
+ <meta charset="utf-8" />
143
+ <title>openai-image-gen</title>
144
+ <style>
145
+ :root {{ color-scheme: dark; }}
146
+ body {{ margin: 24px; font: 14px/1.4 ui-sans-serif, system-ui; background: #0b0f14; color: #e8edf2; }}
147
+ h1 {{ font-size: 18px; margin: 0 0 16px; }}
148
+ .grid {{ display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }}
149
+ figure {{ margin: 0; padding: 12px; border: 1px solid #1e2a36; border-radius: 14px; background: #0f1620; }}
150
+ img {{ width: 100%; height: auto; border-radius: 10px; display: block; }}
151
+ figcaption {{ margin-top: 10px; color: #b7c2cc; }}
152
+ code {{ color: #9cd1ff; }}
153
+ </style>
154
+ <h1>openai-image-gen</h1>
155
+ <p>Output: <code>{out_dir.as_posix()}</code></p>
156
+ <div class="grid">
157
+ {thumbs}
158
+ </div>
159
+ """
160
+ (out_dir / "index.html").write_text(html, encoding="utf-8")
161
+
162
+
163
+ def main() -> int:
164
+ ap = argparse.ArgumentParser(description="Generate images via OpenAI Images API.")
165
+ ap.add_argument("--prompt", help="Single prompt. If omitted, random prompts are generated.")
166
+ ap.add_argument("--count", type=int, default=8, help="How many images to generate.")
167
+ ap.add_argument("--model", default="gpt-image-1", help="Image model id.")
168
+ ap.add_argument("--size", default="", help="Image size (e.g. 1024x1024, 1536x1024). Defaults based on model if not specified.")
169
+ ap.add_argument("--quality", default="", help="Image quality (e.g. high, standard). Defaults based on model if not specified.")
170
+ ap.add_argument("--background", default="", help="Background transparency (GPT models only): transparent, opaque, or auto.")
171
+ ap.add_argument("--output-format", default="", help="Output format (GPT models only): png, jpeg, or webp.")
172
+ ap.add_argument("--style", default="", help="Image style (dall-e-3 only): vivid or natural.")
173
+ ap.add_argument("--out-dir", default="", help="Output directory (default: ./tmp/openai-image-gen-<ts>).")
174
+ args = ap.parse_args()
175
+
176
+ api_key = (os.environ.get("OPENAI_API_KEY") or "").strip()
177
+ if not api_key:
178
+ print("Missing OPENAI_API_KEY", file=sys.stderr)
179
+ return 2
180
+
181
+ # Apply model-specific defaults if not specified
182
+ default_size, default_quality = get_model_defaults(args.model)
183
+ size = args.size or default_size
184
+ quality = args.quality or default_quality
185
+
186
+ count = args.count
187
+ if args.model == "dall-e-3" and count > 1:
188
+ print(f"Warning: dall-e-3 only supports generating 1 image at a time. Reducing count from {count} to 1.", file=sys.stderr)
189
+ count = 1
190
+
191
+ out_dir = Path(args.out_dir).expanduser() if args.out_dir else default_out_dir()
192
+ out_dir.mkdir(parents=True, exist_ok=True)
193
+
194
+ prompts = [args.prompt] * count if args.prompt else pick_prompts(count)
195
+
196
+ # Determine file extension based on output format
197
+ if args.model.startswith("gpt-image") and args.output_format:
198
+ file_ext = args.output_format
199
+ else:
200
+ file_ext = "png"
201
+
202
+ items: list[dict] = []
203
+ for idx, prompt in enumerate(prompts, start=1):
204
+ print(f"[{idx}/{len(prompts)}] {prompt}")
205
+ res = request_images(
206
+ api_key,
207
+ prompt,
208
+ args.model,
209
+ size,
210
+ quality,
211
+ args.background,
212
+ args.output_format,
213
+ args.style,
214
+ )
215
+ data = res.get("data", [{}])[0]
216
+ image_b64 = data.get("b64_json")
217
+ image_url = data.get("url")
218
+ if not image_b64 and not image_url:
219
+ raise RuntimeError(f"Unexpected response: {json.dumps(res)[:400]}")
220
+
221
+ filename = f"{idx:03d}-{slugify(prompt)[:40]}.{file_ext}"
222
+ filepath = out_dir / filename
223
+ if image_b64:
224
+ filepath.write_bytes(base64.b64decode(image_b64))
225
+ else:
226
+ try:
227
+ urllib.request.urlretrieve(image_url, filepath)
228
+ except urllib.error.URLError as e:
229
+ raise RuntimeError(f"Failed to download image from {image_url}: {e}") from e
230
+
231
+ items.append({"prompt": prompt, "file": filename})
232
+
233
+ (out_dir / "prompts.json").write_text(json.dumps(items, indent=2), encoding="utf-8")
234
+ write_gallery(out_dir, items)
235
+ print(f"\nWrote: {(out_dir / 'index.html').as_posix()}")
236
+ return 0
237
+
238
+
239
+ if __name__ == "__main__":
240
+ raise SystemExit(main())
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: openai-whisper
3
+ description: Local speech-to-text with the Whisper CLI (no API key).
4
+ homepage: https://openai.com/research/whisper
5
+ metadata:
6
+ {
7
+ "kobold":
8
+ {
9
+ "emoji": "🎙️",
10
+ "requires": { "bins": ["whisper"] },
11
+ "install":
12
+ [
13
+ {
14
+ "id": "brew",
15
+ "kind": "brew",
16
+ "formula": "openai-whisper",
17
+ "bins": ["whisper"],
18
+ "label": "Install OpenAI Whisper (brew)",
19
+ },
20
+ ],
21
+ },
22
+ }
23
+ ---
24
+
25
+ # Whisper (CLI)
26
+
27
+ Use `whisper` to transcribe audio locally.
28
+
29
+ Quick start
30
+
31
+ - `whisper /path/audio.mp3 --model medium --output_format txt --output_dir .`
32
+ - `whisper /path/audio.m4a --task translate --output_format srt`
33
+
34
+ Notes
35
+
36
+ - Models download to `~/.cache/whisper` on first run.
37
+ - `--model` defaults to `turbo` on this install.
38
+ - Use smaller models for speed, larger for accuracy.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: openai-whisper-api
3
+ description: Transcribe audio via OpenAI Audio Transcriptions API (Whisper).
4
+ homepage: https://platform.openai.com/docs/guides/speech-to-text
5
+ metadata:
6
+ {
7
+ "kobold":
8
+ {
9
+ "emoji": "☁️",
10
+ "requires": { "bins": ["curl"], "env": ["OPENAI_API_KEY"] },
11
+ "primaryEnv": "OPENAI_API_KEY",
12
+ },
13
+ }
14
+ ---
15
+
16
+ # OpenAI Whisper API (curl)
17
+
18
+ Transcribe an audio file via OpenAI’s `/v1/audio/transcriptions` endpoint.
19
+
20
+ ## Quick start
21
+
22
+ ```bash
23
+ {baseDir}/scripts/transcribe.sh /path/to/audio.m4a
24
+ ```
25
+
26
+ Defaults:
27
+
28
+ - Model: `whisper-1`
29
+ - Output: `<input>.txt`
30
+
31
+ ## Useful flags
32
+
33
+ ```bash
34
+ {baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model whisper-1 --out /tmp/transcript.txt
35
+ {baseDir}/scripts/transcribe.sh /path/to/audio.m4a --language en
36
+ {baseDir}/scripts/transcribe.sh /path/to/audio.m4a --prompt "Speaker names: Peter, Daniel"
37
+ {baseDir}/scripts/transcribe.sh /path/to/audio.m4a --json --out /tmp/transcript.json
38
+ ```
39
+
40
+ ## API key
41
+
42
+ Set `OPENAI_API_KEY`, or configure it in `~/.kobold/kobold.json`:
43
+
44
+ ```json5
45
+ {
46
+ skills: {
47
+ "openai-whisper-api": {
48
+ apiKey: "OPENAI_KEY_HERE",
49
+ },
50
+ },
51
+ }
52
+ ```
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ usage() {
5
+ cat >&2 <<'EOF'
6
+ Usage:
7
+ transcribe.sh <audio-file> [--model whisper-1] [--out /path/to/out.txt] [--language en] [--prompt "hint"] [--json]
8
+ EOF
9
+ exit 2
10
+ }
11
+
12
+ if [[ "${1:-}" == "" || "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
13
+ usage
14
+ fi
15
+
16
+ in="${1:-}"
17
+ shift || true
18
+
19
+ model="whisper-1"
20
+ out=""
21
+ language=""
22
+ prompt=""
23
+ response_format="text"
24
+
25
+ while [[ $# -gt 0 ]]; do
26
+ case "$1" in
27
+ --model)
28
+ model="${2:-}"
29
+ shift 2
30
+ ;;
31
+ --out)
32
+ out="${2:-}"
33
+ shift 2
34
+ ;;
35
+ --language)
36
+ language="${2:-}"
37
+ shift 2
38
+ ;;
39
+ --prompt)
40
+ prompt="${2:-}"
41
+ shift 2
42
+ ;;
43
+ --json)
44
+ response_format="json"
45
+ shift 1
46
+ ;;
47
+ *)
48
+ echo "Unknown arg: $1" >&2
49
+ usage
50
+ ;;
51
+ esac
52
+ done
53
+
54
+ if [[ ! -f "$in" ]]; then
55
+ echo "File not found: $in" >&2
56
+ exit 1
57
+ fi
58
+
59
+ if [[ "${OPENAI_API_KEY:-}" == "" ]]; then
60
+ echo "Missing OPENAI_API_KEY" >&2
61
+ exit 1
62
+ fi
63
+
64
+ if [[ "$out" == "" ]]; then
65
+ base="${in%.*}"
66
+ if [[ "$response_format" == "json" ]]; then
67
+ out="${base}.json"
68
+ else
69
+ out="${base}.txt"
70
+ fi
71
+ fi
72
+
73
+ mkdir -p "$(dirname "$out")"
74
+
75
+ curl -sS https://api.openai.com/v1/audio/transcriptions \
76
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
77
+ -H "Accept: application/json" \
78
+ -F "file=@${in}" \
79
+ -F "model=${model}" \
80
+ -F "response_format=${response_format}" \
81
+ ${language:+-F "language=${language}"} \
82
+ ${prompt:+-F "prompt=${prompt}"} \
83
+ >"$out"
84
+
85
+ echo "$out"
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: openhue
3
+ description: Control Philips Hue lights and scenes via the OpenHue CLI.
4
+ homepage: https://www.openhue.io/cli
5
+ metadata:
6
+ {
7
+ "kobold":
8
+ {
9
+ "emoji": "💡",
10
+ "requires": { "bins": ["openhue"] },
11
+ "install":
12
+ [
13
+ {
14
+ "id": "brew",
15
+ "kind": "brew",
16
+ "formula": "openhue/cli/openhue-cli",
17
+ "bins": ["openhue"],
18
+ "label": "Install OpenHue CLI (brew)",
19
+ },
20
+ ],
21
+ },
22
+ }
23
+ ---
24
+
25
+ # OpenHue CLI
26
+
27
+ Use `openhue` to control Philips Hue lights and scenes via a Hue Bridge.
28
+
29
+ ## When to Use
30
+
31
+ ✅ **USE this skill when:**
32
+
33
+ - "Turn on/off the lights"
34
+ - "Dim the living room lights"
35
+ - "Set a scene" or "movie mode"
36
+ - Controlling specific Hue rooms or zones
37
+ - Adjusting brightness, color, or color temperature
38
+
39
+ ## When NOT to Use
40
+
41
+ ❌ **DON'T use this skill when:**
42
+
43
+ - Non-Hue smart devices (other brands) → not supported
44
+ - HomeKit scenes or Shortcuts → use Apple's ecosystem
45
+ - TV or entertainment system control
46
+ - Thermostat or HVAC
47
+ - Smart plugs (unless Hue smart plugs)
48
+
49
+ ## Common Commands
50
+
51
+ ### List Resources
52
+
53
+ ```bash
54
+ openhue get light # List all lights
55
+ openhue get room # List all rooms
56
+ openhue get scene # List all scenes
57
+ ```
58
+
59
+ ### Control Lights
60
+
61
+ ```bash
62
+ # Turn on/off
63
+ openhue set light "Bedroom Lamp" --on
64
+ openhue set light "Bedroom Lamp" --off
65
+
66
+ # Brightness (0-100)
67
+ openhue set light "Bedroom Lamp" --on --brightness 50
68
+
69
+ # Color temperature (warm to cool: 153-500 mirek)
70
+ openhue set light "Bedroom Lamp" --on --temperature 300
71
+
72
+ # Color (by name or hex)
73
+ openhue set light "Bedroom Lamp" --on --color red
74
+ openhue set light "Bedroom Lamp" --on --rgb "#FF5500"
75
+ ```
76
+
77
+ ### Control Rooms
78
+
79
+ ```bash
80
+ # Turn off entire room
81
+ openhue set room "Bedroom" --off
82
+
83
+ # Set room brightness
84
+ openhue set room "Bedroom" --on --brightness 30
85
+ ```
86
+
87
+ ### Scenes
88
+
89
+ ```bash
90
+ # Activate scene
91
+ openhue set scene "Relax" --room "Bedroom"
92
+ openhue set scene "Concentrate" --room "Office"
93
+ ```
94
+
95
+ ## Quick Presets
96
+
97
+ ```bash
98
+ # Bedtime (dim warm)
99
+ openhue set room "Bedroom" --on --brightness 20 --temperature 450
100
+
101
+ # Work mode (bright cool)
102
+ openhue set room "Office" --on --brightness 100 --temperature 250
103
+
104
+ # Movie mode (dim)
105
+ openhue set room "Living Room" --on --brightness 10
106
+ ```
107
+
108
+ ## Notes
109
+
110
+ - Bridge must be on local network
111
+ - First run requires button press on Hue bridge to pair
112
+ - Colors only work on color-capable bulbs (not white-only)
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: oracle
3
+ description: Best practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
4
+ homepage: https://askoracle.dev
5
+ metadata:
6
+ {
7
+ "kobold":
8
+ {
9
+ "emoji": "🧿",
10
+ "requires": { "bins": ["oracle"] },
11
+ "install":
12
+ [
13
+ {
14
+ "id": "node",
15
+ "kind": "node",
16
+ "package": "@steipete/oracle",
17
+ "bins": ["oracle"],
18
+ "label": "Install oracle (node)",
19
+ },
20
+ ],
21
+ },
22
+ }
23
+ ---
24
+
25
+ # oracle — best use
26
+
27
+ Oracle bundles your prompt + selected files into one “one-shot” request so another model can answer with real repo context (API or browser automation). Treat output as advisory: verify against code + tests.
28
+
29
+ ## Main use case (browser, GPT‑5.2 Pro)
30
+
31
+ Default workflow here: `--engine browser` with GPT‑5.2 Pro in ChatGPT. This is the common “long think” path: ~10 minutes to ~1 hour is normal; expect a stored session you can reattach to.
32
+
33
+ Recommended defaults:
34
+
35
+ - Engine: browser (`--engine browser`)
36
+ - Model: GPT‑5.2 Pro (`--model gpt-5.2-pro` or `--model "5.2 Pro"`)
37
+
38
+ ## Golden path
39
+
40
+ 1. Pick a tight file set (fewest files that still contain the truth).
41
+ 2. Preview payload + token spend (`--dry-run` + `--files-report`).
42
+ 3. Use browser mode for the usual GPT‑5.2 Pro workflow; use API only when you explicitly want it.
43
+ 4. If the run detaches/timeouts: reattach to the stored session (don’t re-run).
44
+
45
+ ## Commands (preferred)
46
+
47
+ - Help:
48
+ - `oracle --help`
49
+ - If the binary isn’t installed: `npx -y @steipete/oracle --help` (avoid `pnpx` here; sqlite bindings).
50
+
51
+ - Preview (no tokens):
52
+ - `oracle --dry-run summary -p "<task>" --file "src/**" --file "!**/*.test.*"`
53
+ - `oracle --dry-run full -p "<task>" --file "src/**"`
54
+
55
+ - Token sanity:
56
+ - `oracle --dry-run summary --files-report -p "<task>" --file "src/**"`
57
+
58
+ - Browser run (main path; long-running is normal):
59
+ - `oracle --engine browser --model gpt-5.2-pro -p "<task>" --file "src/**"`
60
+
61
+ - Manual paste fallback:
62
+ - `oracle --render --copy -p "<task>" --file "src/**"`
63
+ - Note: `--copy` is a hidden alias for `--copy-markdown`.
64
+
65
+ ## Attaching files (`--file`)
66
+
67
+ `--file` accepts files, directories, and globs. You can pass it multiple times; entries can be comma-separated.
68
+
69
+ - Include:
70
+ - `--file "src/**"`
71
+ - `--file src/index.ts`
72
+ - `--file docs --file README.md`
73
+
74
+ - Exclude:
75
+ - `--file "src/**" --file "!src/**/*.test.ts" --file "!**/*.snap"`
76
+
77
+ - Defaults (implementation behavior):
78
+ - Default-ignored dirs: `node_modules`, `dist`, `coverage`, `.git`, `.turbo`, `.next`, `build`, `tmp` (skipped unless explicitly passed as literal dirs/files).
79
+ - Honors `.gitignore` when expanding globs.
80
+ - Does not follow symlinks.
81
+ - Dotfiles filtered unless opted in via pattern (e.g. `--file ".github/**"`).
82
+ - Files > 1 MB rejected.
83
+
84
+ ## Engines (API vs browser)
85
+
86
+ - Auto-pick: `api` when `OPENAI_API_KEY` is set; otherwise `browser`.
87
+ - Browser supports GPT + Gemini only; use `--engine api` for Claude/Grok/Codex or multi-model runs.
88
+ - Browser attachments:
89
+ - `--browser-attachments auto|never|always` (auto pastes inline up to ~60k chars then uploads).
90
+ - Remote browser host:
91
+ - Host: `oracle serve --host 0.0.0.0 --port 9473 --token <secret>`
92
+ - Client: `oracle --engine browser --remote-host <host:port> --remote-token <secret> -p "<task>" --file "src/**"`
93
+
94
+ ## Sessions + slugs
95
+
96
+ - Stored under `~/.oracle/sessions` (override with `ORACLE_HOME_DIR`).
97
+ - Runs may detach or take a long time (browser + GPT‑5.2 Pro often does). If the CLI times out: don’t re-run; reattach.
98
+ - List: `oracle status --hours 72`
99
+ - Attach: `oracle session <id> --render`
100
+ - Use `--slug "<3-5 words>"` to keep session IDs readable.
101
+ - Duplicate prompt guard exists; use `--force` only when you truly want a fresh run.
102
+
103
+ ## Prompt template (high signal)
104
+
105
+ Oracle starts with **zero** project knowledge. Assume the model cannot infer your stack, build tooling, conventions, or “obvious” paths. Include:
106
+
107
+ - Project briefing (stack + build/test commands + platform constraints).
108
+ - “Where things live” (key directories, entrypoints, config files, boundaries).
109
+ - Exact question + what you tried + the error text (verbatim).
110
+ - Constraints (“don’t change X”, “must keep public API”, etc).
111
+ - Desired output (“return patch plan + tests”, “give 3 options with tradeoffs”).
112
+
113
+ ## Safety
114
+
115
+ - Don’t attach secrets by default (`.env`, key files, auth tokens). Redact aggressively; share only what’s required.
116
+
117
+ ## “Exhaustive prompt” restoration pattern
118
+
119
+ For long investigations, write a standalone prompt + file set so you can rerun days later:
120
+
121
+ - 6–30 sentence project briefing + the goal.
122
+ - Repro steps + exact errors + what you tried.
123
+ - Attach all context files needed (entrypoints, configs, key modules, docs).
124
+
125
+ Oracle runs are one-shot; the model doesn’t remember prior runs. “Restoring context” means re-running with the same prompt + `--file …` set (or reattaching a still-running stored session).