@hera-al/server 1.6.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 (348) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +325 -0
  3. package/bundled/apple-notes/SKILL.md +77 -0
  4. package/bundled/apple-reminders/SKILL.md +96 -0
  5. package/bundled/blogwatcher/SKILL.md +69 -0
  6. package/bundled/camsnap/SKILL.md +45 -0
  7. package/bundled/discord/SKILL.md +578 -0
  8. package/bundled/gemini/SKILL.md +43 -0
  9. package/bundled/gifgrep/SKILL.md +79 -0
  10. package/bundled/github/SKILL.md +77 -0
  11. package/bundled/gog/SKILL.md +116 -0
  12. package/bundled/goplaces/SKILL.md +52 -0
  13. package/bundled/himalaya/SKILL.md +257 -0
  14. package/bundled/himalaya/references/configuration.md +184 -0
  15. package/bundled/himalaya/references/message-composition.md +199 -0
  16. package/bundled/homebrew/SKILL.md +82 -0
  17. package/bundled/local-places/SERVER_README.md +101 -0
  18. package/bundled/local-places/SKILL.md +102 -0
  19. package/bundled/local-places/pyproject.toml +21 -0
  20. package/bundled/local-places/src/local_places/__init__.py +2 -0
  21. package/bundled/local-places/src/local_places/google_places.py +314 -0
  22. package/bundled/local-places/src/local_places/main.py +65 -0
  23. package/bundled/local-places/src/local_places/schemas.py +107 -0
  24. package/bundled/markitdown/SKILL.md +96 -0
  25. package/bundled/mcporter/SKILL.md +61 -0
  26. package/bundled/merge-pr/SKILL.md +187 -0
  27. package/bundled/merge-pr/agents/openai.yaml +4 -0
  28. package/bundled/nano-banana-pro/SKILL.md +58 -0
  29. package/bundled/nano-banana-pro/scripts/generate_image.py +184 -0
  30. package/bundled/nano-pdf/SKILL.md +38 -0
  31. package/bundled/open-prose/README.md +25 -0
  32. package/bundled/open-prose/index.ts +5 -0
  33. package/bundled/open-prose/openclaw.plugin.json +11 -0
  34. package/bundled/open-prose/package.json +15 -0
  35. package/bundled/open-prose/skills/prose/LICENSE +21 -0
  36. package/bundled/open-prose/skills/prose/SKILL.md +323 -0
  37. package/bundled/open-prose/skills/prose/alt-borges.md +141 -0
  38. package/bundled/open-prose/skills/prose/alts/arabian-nights.md +358 -0
  39. package/bundled/open-prose/skills/prose/alts/borges.md +360 -0
  40. package/bundled/open-prose/skills/prose/alts/folk.md +322 -0
  41. package/bundled/open-prose/skills/prose/alts/homer.md +346 -0
  42. package/bundled/open-prose/skills/prose/alts/kafka.md +373 -0
  43. package/bundled/open-prose/skills/prose/compiler.md +2971 -0
  44. package/bundled/open-prose/skills/prose/examples/01-hello-world.prose +4 -0
  45. package/bundled/open-prose/skills/prose/examples/02-research-and-summarize.prose +6 -0
  46. package/bundled/open-prose/skills/prose/examples/03-code-review.prose +17 -0
  47. package/bundled/open-prose/skills/prose/examples/04-write-and-refine.prose +14 -0
  48. package/bundled/open-prose/skills/prose/examples/05-debug-issue.prose +20 -0
  49. package/bundled/open-prose/skills/prose/examples/06-explain-codebase.prose +17 -0
  50. package/bundled/open-prose/skills/prose/examples/07-refactor.prose +20 -0
  51. package/bundled/open-prose/skills/prose/examples/08-blog-post.prose +20 -0
  52. package/bundled/open-prose/skills/prose/examples/09-research-with-agents.prose +25 -0
  53. package/bundled/open-prose/skills/prose/examples/10-code-review-agents.prose +32 -0
  54. package/bundled/open-prose/skills/prose/examples/11-skills-and-imports.prose +27 -0
  55. package/bundled/open-prose/skills/prose/examples/12-secure-agent-permissions.prose +43 -0
  56. package/bundled/open-prose/skills/prose/examples/13-variables-and-context.prose +51 -0
  57. package/bundled/open-prose/skills/prose/examples/14-composition-blocks.prose +48 -0
  58. package/bundled/open-prose/skills/prose/examples/15-inline-sequences.prose +23 -0
  59. package/bundled/open-prose/skills/prose/examples/16-parallel-reviews.prose +19 -0
  60. package/bundled/open-prose/skills/prose/examples/17-parallel-research.prose +19 -0
  61. package/bundled/open-prose/skills/prose/examples/18-mixed-parallel-sequential.prose +36 -0
  62. package/bundled/open-prose/skills/prose/examples/19-advanced-parallel.prose +71 -0
  63. package/bundled/open-prose/skills/prose/examples/20-fixed-loops.prose +20 -0
  64. package/bundled/open-prose/skills/prose/examples/21-pipeline-operations.prose +35 -0
  65. package/bundled/open-prose/skills/prose/examples/22-error-handling.prose +51 -0
  66. package/bundled/open-prose/skills/prose/examples/23-retry-with-backoff.prose +63 -0
  67. package/bundled/open-prose/skills/prose/examples/24-choice-blocks.prose +86 -0
  68. package/bundled/open-prose/skills/prose/examples/25-conditionals.prose +114 -0
  69. package/bundled/open-prose/skills/prose/examples/26-parameterized-blocks.prose +100 -0
  70. package/bundled/open-prose/skills/prose/examples/27-string-interpolation.prose +105 -0
  71. package/bundled/open-prose/skills/prose/examples/28-automated-pr-review.prose +37 -0
  72. package/bundled/open-prose/skills/prose/examples/28-gas-town.prose +1572 -0
  73. package/bundled/open-prose/skills/prose/examples/29-captains-chair.prose +218 -0
  74. package/bundled/open-prose/skills/prose/examples/30-captains-chair-simple.prose +42 -0
  75. package/bundled/open-prose/skills/prose/examples/31-captains-chair-with-memory.prose +145 -0
  76. package/bundled/open-prose/skills/prose/examples/33-pr-review-autofix.prose +168 -0
  77. package/bundled/open-prose/skills/prose/examples/34-content-pipeline.prose +204 -0
  78. package/bundled/open-prose/skills/prose/examples/35-feature-factory.prose +296 -0
  79. package/bundled/open-prose/skills/prose/examples/36-bug-hunter.prose +237 -0
  80. package/bundled/open-prose/skills/prose/examples/37-the-forge.prose +1474 -0
  81. package/bundled/open-prose/skills/prose/examples/38-skill-scan.prose +455 -0
  82. package/bundled/open-prose/skills/prose/examples/39-architect-by-simulation.prose +277 -0
  83. package/bundled/open-prose/skills/prose/examples/40-rlm-self-refine.prose +32 -0
  84. package/bundled/open-prose/skills/prose/examples/41-rlm-divide-conquer.prose +38 -0
  85. package/bundled/open-prose/skills/prose/examples/42-rlm-filter-recurse.prose +46 -0
  86. package/bundled/open-prose/skills/prose/examples/43-rlm-pairwise.prose +50 -0
  87. package/bundled/open-prose/skills/prose/examples/44-run-endpoint-ux-test.prose +261 -0
  88. package/bundled/open-prose/skills/prose/examples/45-plugin-release.prose +159 -0
  89. package/bundled/open-prose/skills/prose/examples/45-run-endpoint-ux-test-with-remediation.prose +637 -0
  90. package/bundled/open-prose/skills/prose/examples/46-run-endpoint-ux-test-fast.prose +148 -0
  91. package/bundled/open-prose/skills/prose/examples/46-workflow-crystallizer.prose +225 -0
  92. package/bundled/open-prose/skills/prose/examples/47-language-self-improvement.prose +356 -0
  93. package/bundled/open-prose/skills/prose/examples/48-habit-miner.prose +445 -0
  94. package/bundled/open-prose/skills/prose/examples/49-prose-run-retrospective.prose +210 -0
  95. package/bundled/open-prose/skills/prose/examples/README.md +391 -0
  96. package/bundled/open-prose/skills/prose/examples/roadmap/README.md +22 -0
  97. package/bundled/open-prose/skills/prose/examples/roadmap/iterative-refinement.prose +20 -0
  98. package/bundled/open-prose/skills/prose/examples/roadmap/parallel-review.prose +18 -0
  99. package/bundled/open-prose/skills/prose/examples/roadmap/simple-pipeline.prose +17 -0
  100. package/bundled/open-prose/skills/prose/examples/roadmap/syntax/open-prose-syntax.prose +223 -0
  101. package/bundled/open-prose/skills/prose/guidance/antipatterns.md +951 -0
  102. package/bundled/open-prose/skills/prose/guidance/patterns.md +700 -0
  103. package/bundled/open-prose/skills/prose/guidance/system-prompt.md +180 -0
  104. package/bundled/open-prose/skills/prose/help.md +144 -0
  105. package/bundled/open-prose/skills/prose/lib/README.md +108 -0
  106. package/bundled/open-prose/skills/prose/lib/calibrator.prose +215 -0
  107. package/bundled/open-prose/skills/prose/lib/cost-analyzer.prose +174 -0
  108. package/bundled/open-prose/skills/prose/lib/error-forensics.prose +250 -0
  109. package/bundled/open-prose/skills/prose/lib/inspector.prose +196 -0
  110. package/bundled/open-prose/skills/prose/lib/profiler.prose +460 -0
  111. package/bundled/open-prose/skills/prose/lib/program-improver.prose +275 -0
  112. package/bundled/open-prose/skills/prose/lib/project-memory.prose +118 -0
  113. package/bundled/open-prose/skills/prose/lib/user-memory.prose +93 -0
  114. package/bundled/open-prose/skills/prose/lib/vm-improver.prose +243 -0
  115. package/bundled/open-prose/skills/prose/primitives/session.md +593 -0
  116. package/bundled/open-prose/skills/prose/prose.md +1237 -0
  117. package/bundled/open-prose/skills/prose/state/filesystem.md +498 -0
  118. package/bundled/open-prose/skills/prose/state/in-context.md +384 -0
  119. package/bundled/open-prose/skills/prose/state/postgres.md +880 -0
  120. package/bundled/open-prose/skills/prose/state/sqlite.md +574 -0
  121. package/bundled/peekaboo/SKILL.md +190 -0
  122. package/bundled/prepare-pr/SKILL.md +277 -0
  123. package/bundled/prepare-pr/agents/openai.yaml +4 -0
  124. package/bundled/review-pr/SKILL.md +228 -0
  125. package/bundled/review-pr/agents/openai.yaml +4 -0
  126. package/bundled/sag/SKILL.md +87 -0
  127. package/bundled/skill-creator/SKILL.md +370 -0
  128. package/bundled/skill-creator/license.txt +202 -0
  129. package/bundled/skill-creator/scripts/init_skill.py +378 -0
  130. package/bundled/skill-creator/scripts/package_skill.py +111 -0
  131. package/bundled/skill-creator/scripts/quick_validate.py +101 -0
  132. package/bundled/spotify-player/SKILL.md +64 -0
  133. package/bundled/ssh/SKILL.md +119 -0
  134. package/bundled/summarize/SKILL.md +87 -0
  135. package/bundled/video-frames/SKILL.md +46 -0
  136. package/bundled/video-frames/scripts/frame.sh +81 -0
  137. package/bundled/voice-call/SKILL.md +45 -0
  138. package/bundled/wacli/SKILL.md +72 -0
  139. package/bundled/weather/SKILL.md +54 -0
  140. package/dist/agent/agent-service.d.ts +88 -0
  141. package/dist/agent/agent-service.js +1 -0
  142. package/dist/agent/message-queue.d.ts +24 -0
  143. package/dist/agent/message-queue.js +1 -0
  144. package/dist/agent/prompt-builder.d.ts +58 -0
  145. package/dist/agent/prompt-builder.js +1 -0
  146. package/dist/agent/session-agent.d.ts +197 -0
  147. package/dist/agent/session-agent.js +1 -0
  148. package/dist/agent/session-db.d.ts +26 -0
  149. package/dist/agent/session-db.js +1 -0
  150. package/dist/agent/session-error-handler.d.ts +37 -0
  151. package/dist/agent/session-error-handler.js +1 -0
  152. package/dist/agent/session-manager.d.ts +19 -0
  153. package/dist/agent/session-manager.js +1 -0
  154. package/dist/agent/workspace-files.d.ts +51 -0
  155. package/dist/agent/workspace-files.js +1 -0
  156. package/dist/auth/auth-middleware.d.ts +9 -0
  157. package/dist/auth/auth-middleware.js +1 -0
  158. package/dist/auth/node-signature-db.d.ts +30 -0
  159. package/dist/auth/node-signature-db.js +1 -0
  160. package/dist/auth/token-db.d.ts +38 -0
  161. package/dist/auth/token-db.js +1 -0
  162. package/dist/browser/browser-service.d.ts +9 -0
  163. package/dist/browser/browser-service.js +1 -0
  164. package/dist/channels/channel.d.ts +2 -0
  165. package/dist/channels/channel.js +1 -0
  166. package/dist/channels/responses.d.ts +21 -0
  167. package/dist/channels/responses.js +1 -0
  168. package/dist/commands/clear.d.ts +7 -0
  169. package/dist/commands/clear.js +1 -0
  170. package/dist/commands/cmd.d.ts +7 -0
  171. package/dist/commands/cmd.js +1 -0
  172. package/dist/commands/coder.d.ts +12 -0
  173. package/dist/commands/coder.js +1 -0
  174. package/dist/commands/command-registry.d.ts +12 -0
  175. package/dist/commands/command-registry.js +1 -0
  176. package/dist/commands/command.d.ts +22 -0
  177. package/dist/commands/command.js +1 -0
  178. package/dist/commands/compact.d.ts +7 -0
  179. package/dist/commands/compact.js +1 -0
  180. package/dist/commands/customsubagents.d.ts +15 -0
  181. package/dist/commands/customsubagents.js +1 -0
  182. package/dist/commands/help.d.ts +9 -0
  183. package/dist/commands/help.js +1 -0
  184. package/dist/commands/mcp.d.ts +9 -0
  185. package/dist/commands/mcp.js +1 -0
  186. package/dist/commands/model.d.ts +22 -0
  187. package/dist/commands/model.js +1 -0
  188. package/dist/commands/models.d.ts +11 -0
  189. package/dist/commands/models.js +1 -0
  190. package/dist/commands/new.d.ts +7 -0
  191. package/dist/commands/new.js +1 -0
  192. package/dist/commands/plugin.d.ts +7 -0
  193. package/dist/commands/plugin.js +1 -0
  194. package/dist/commands/sandbox.d.ts +12 -0
  195. package/dist/commands/sandbox.js +1 -0
  196. package/dist/commands/showtool.d.ts +12 -0
  197. package/dist/commands/showtool.js +1 -0
  198. package/dist/commands/status.d.ts +24 -0
  199. package/dist/commands/status.js +1 -0
  200. package/dist/commands/stop.d.ts +10 -0
  201. package/dist/commands/stop.js +1 -0
  202. package/dist/commands/subagents.d.ts +12 -0
  203. package/dist/commands/subagents.js +1 -0
  204. package/dist/commands/usage.d.ts +25 -0
  205. package/dist/commands/usage.js +1 -0
  206. package/dist/commands/useplugin.d.ts +7 -0
  207. package/dist/commands/useplugin.js +1 -0
  208. package/dist/config-watcher.d.ts +14 -0
  209. package/dist/config-watcher.js +1 -0
  210. package/dist/config.d.ts +267 -0
  211. package/dist/config.js +1 -0
  212. package/dist/cron/cron-service.d.ts +57 -0
  213. package/dist/cron/cron-service.js +1 -0
  214. package/dist/cron/heartbeat-token.d.ts +29 -0
  215. package/dist/cron/heartbeat-token.js +1 -0
  216. package/dist/cron/schedule.d.ts +3 -0
  217. package/dist/cron/schedule.js +1 -0
  218. package/dist/cron/store.d.ts +4 -0
  219. package/dist/cron/store.js +1 -0
  220. package/dist/cron/types.d.ts +47 -0
  221. package/dist/cron/types.js +1 -0
  222. package/dist/gateway/bridge.d.ts +38 -0
  223. package/dist/gateway/bridge.js +1 -0
  224. package/dist/gateway/channel-manager.d.ts +45 -0
  225. package/dist/gateway/channel-manager.js +1 -0
  226. package/dist/gateway/channels/qr-image.d.ts +5 -0
  227. package/dist/gateway/channels/qr-image.js +1 -0
  228. package/dist/gateway/channels/telegram.d.ts +39 -0
  229. package/dist/gateway/channels/telegram.js +1 -0
  230. package/dist/gateway/channels/webchat.d.ts +51 -0
  231. package/dist/gateway/channels/webchat.js +1 -0
  232. package/dist/gateway/channels/whatsapp.d.ts +40 -0
  233. package/dist/gateway/channels/whatsapp.js +1 -0
  234. package/dist/gateway/node-registry.d.ts +38 -0
  235. package/dist/gateway/node-registry.js +1 -0
  236. package/dist/heracli/index.d.ts +3 -0
  237. package/dist/heracli/index.js +2 -0
  238. package/dist/heracli/logs.d.ts +13 -0
  239. package/dist/heracli/logs.js +1 -0
  240. package/dist/heracli/security/audit.d.ts +17 -0
  241. package/dist/heracli/security/audit.js +1 -0
  242. package/dist/heracli/security/checks/channel-policies.d.ts +6 -0
  243. package/dist/heracli/security/checks/channel-policies.js +1 -0
  244. package/dist/heracli/security/checks/credentials.d.ts +6 -0
  245. package/dist/heracli/security/checks/credentials.js +1 -0
  246. package/dist/heracli/security/checks/fs-permissions.d.ts +6 -0
  247. package/dist/heracli/security/checks/fs-permissions.js +1 -0
  248. package/dist/heracli/security/checks/network.d.ts +4 -0
  249. package/dist/heracli/security/checks/network.js +1 -0
  250. package/dist/heracli/security/report.d.ts +4 -0
  251. package/dist/heracli/security/report.js +1 -0
  252. package/dist/index.d.ts +3 -0
  253. package/dist/index.js +2 -0
  254. package/dist/installer/hera.d.ts +3 -0
  255. package/dist/installer/hera.js +2 -0
  256. package/dist/media/message-processor.d.ts +23 -0
  257. package/dist/media/message-processor.js +1 -0
  258. package/dist/memory/memory-manager.d.ts +21 -0
  259. package/dist/memory/memory-manager.js +1 -0
  260. package/dist/memory/memory-provider.d.ts +22 -0
  261. package/dist/memory/memory-provider.js +1 -0
  262. package/dist/memory/memory-search.d.ts +102 -0
  263. package/dist/memory/memory-search.js +1 -0
  264. package/dist/memory/recall-strategies.d.ts +2 -0
  265. package/dist/memory/recall-strategies.js +1 -0
  266. package/dist/nostromo/auth.d.ts +29 -0
  267. package/dist/nostromo/auth.js +1 -0
  268. package/dist/nostromo/nostromo.d.ts +23 -0
  269. package/dist/nostromo/nostromo.js +1 -0
  270. package/dist/nostromo/ui-html-layout.d.ts +3 -0
  271. package/dist/nostromo/ui-html-layout.js +1 -0
  272. package/dist/nostromo/ui-html-modals.d.ts +3 -0
  273. package/dist/nostromo/ui-html-modals.js +1 -0
  274. package/dist/nostromo/ui-js-agent.d.ts +3 -0
  275. package/dist/nostromo/ui-js-agent.js +1 -0
  276. package/dist/nostromo/ui-js-channels.d.ts +3 -0
  277. package/dist/nostromo/ui-js-channels.js +1 -0
  278. package/dist/nostromo/ui-js-competences.d.ts +3 -0
  279. package/dist/nostromo/ui-js-competences.js +1 -0
  280. package/dist/nostromo/ui-js-config.d.ts +3 -0
  281. package/dist/nostromo/ui-js-config.js +1 -0
  282. package/dist/nostromo/ui-js-core.d.ts +3 -0
  283. package/dist/nostromo/ui-js-core.js +1 -0
  284. package/dist/nostromo/ui-js-ops.d.ts +3 -0
  285. package/dist/nostromo/ui-js-ops.js +1 -0
  286. package/dist/nostromo/ui-js-prompts.d.ts +3 -0
  287. package/dist/nostromo/ui-js-prompts.js +1 -0
  288. package/dist/nostromo/ui-styles.d.ts +3 -0
  289. package/dist/nostromo/ui-styles.js +1 -0
  290. package/dist/nostromo/ui.d.ts +2 -0
  291. package/dist/nostromo/ui.js +1 -0
  292. package/dist/server.d.ts +80 -0
  293. package/dist/server.js +1 -0
  294. package/dist/stt/local-whisper.d.ts +9 -0
  295. package/dist/stt/local-whisper.js +1 -0
  296. package/dist/stt/openai-whisper.d.ts +14 -0
  297. package/dist/stt/openai-whisper.js +1 -0
  298. package/dist/stt/stt-loader.d.ts +4 -0
  299. package/dist/stt/stt-loader.js +1 -0
  300. package/dist/stt/stt-provider.d.ts +4 -0
  301. package/dist/stt/stt-provider.js +1 -0
  302. package/dist/tools/browser-tools.d.ts +9 -0
  303. package/dist/tools/browser-tools.js +1 -0
  304. package/dist/tools/cron-tools.d.ts +4 -0
  305. package/dist/tools/cron-tools.js +1 -0
  306. package/dist/tools/memory-tools.d.ts +3 -0
  307. package/dist/tools/memory-tools.js +1 -0
  308. package/dist/tools/message-tools.d.ts +5 -0
  309. package/dist/tools/message-tools.js +1 -0
  310. package/dist/tools/node-tools.d.ts +3 -0
  311. package/dist/tools/node-tools.js +1 -0
  312. package/dist/tools/server-tools.d.ts +2 -0
  313. package/dist/tools/server-tools.js +1 -0
  314. package/dist/tools/tts-tools.d.ts +3 -0
  315. package/dist/tools/tts-tools.js +1 -0
  316. package/dist/tts/tts-service.d.ts +19 -0
  317. package/dist/tts/tts-service.js +1 -0
  318. package/dist/utils/chunk.d.ts +3 -0
  319. package/dist/utils/chunk.js +1 -0
  320. package/dist/utils/logger.d.ts +16 -0
  321. package/dist/utils/logger.js +1 -0
  322. package/dist/utils/markdown/fences.d.ts +11 -0
  323. package/dist/utils/markdown/fences.js +1 -0
  324. package/dist/utils/markdown/ir.d.ts +33 -0
  325. package/dist/utils/markdown/ir.js +1 -0
  326. package/dist/utils/markdown/render.d.ts +19 -0
  327. package/dist/utils/markdown/render.js +1 -0
  328. package/dist/utils/markdown/tables.d.ts +3 -0
  329. package/dist/utils/markdown/tables.js +1 -0
  330. package/dist/utils/media-response.d.ts +29 -0
  331. package/dist/utils/media-response.js +1 -0
  332. package/dist/utils/package-paths.d.ts +5 -0
  333. package/dist/utils/package-paths.js +1 -0
  334. package/dist/utils/telegram-format.d.ts +13 -0
  335. package/dist/utils/telegram-format.js +1 -0
  336. package/installationPkg/.env.example +26 -0
  337. package/installationPkg/AGENTS.md +143 -0
  338. package/installationPkg/BOOTSTRAP.md +45 -0
  339. package/installationPkg/CBINT.json +16 -0
  340. package/installationPkg/HEARTBEAT.md +5 -0
  341. package/installationPkg/IDENTITY.md +7 -0
  342. package/installationPkg/SOUL.md +36 -0
  343. package/installationPkg/SYSTEM_PROMPT.md +55 -0
  344. package/installationPkg/SYSTEM_PROMPT_SUBAGENT.md +40 -0
  345. package/installationPkg/TOOLS.md +36 -0
  346. package/installationPkg/USER.md +11 -0
  347. package/installationPkg/config.example.yaml +291 -0
  348. package/package.json +95 -0
@@ -0,0 +1,21 @@
1
+ import type { ChannelAdapter, MessageHandler } from "../gateway/bridge.js";
2
+ import type { TokenDB } from "../auth/token-db.js";
3
+ interface ResponsesConfig {
4
+ host?: string;
5
+ port: number;
6
+ }
7
+ export declare class ResponsesChannel implements ChannelAdapter {
8
+ readonly name = "responses";
9
+ private app;
10
+ private server;
11
+ private onMessage;
12
+ private config;
13
+ private tokenDb;
14
+ constructor(config: ResponsesConfig, tokenDb: TokenDB);
15
+ private setupRoutes;
16
+ start(onMessage: MessageHandler): Promise<void>;
17
+ sendText(_chatId: string, _text: string): Promise<void>;
18
+ stop(): Promise<void>;
19
+ }
20
+ export {};
21
+ //# sourceMappingURL=responses.d.ts.map
@@ -0,0 +1 @@
1
+ import{Hono as e}from"hono";import{streamSSE as t}from"hono/streaming";import{serve as s}from"@hono/node-server";import n from"node:crypto";import{validateBearerToken as o}from"../auth/auth-middleware.js";import{createLogger as r}from"../utils/logger.js";const i=r("Responses");function a(e){const t=e.match(/^data:(image\/[^;]+);base64,(.+)$/);return t?u(t[2],t[1]):{type:"image",mimeType:m(e),async getBuffer(){const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch image: ${t.status}`);return Buffer.from(await t.arrayBuffer())}}}function u(e,t){const s=Buffer.from(e,"base64");return{type:"image",mimeType:t||"image/png",fileSize:s.length,getBuffer:async()=>s}}function p(e){return e.startsWith("audio/")?"audio":e.startsWith("video/")?"video":e.startsWith("image/")?"image":"document"}function l(e,t,s){const n=e.match(/^data:([^;]+);base64,(.+)$/);if(n)return c(n[2],t||n[1],s);const o=t||m(e);return{type:p(o),mimeType:o,fileName:s||d(e),async getBuffer(){const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch file: ${t.status}`);return Buffer.from(await t.arrayBuffer())}}}function c(e,t,s){const n=Buffer.from(e,"base64"),o=t||"application/octet-stream";return{type:p(o),mimeType:o,fileName:s||"file",fileSize:n.length,getBuffer:async()=>n}}function m(e){const t=e.split("?")[0].toLowerCase();return t.endsWith(".png")?"image/png":t.endsWith(".gif")?"image/gif":t.endsWith(".webp")?"image/webp":t.endsWith(".pdf")?"application/pdf":t.endsWith(".txt")?"text/plain":t.endsWith(".csv")?"text/csv":t.endsWith(".json")?"application/json":t.endsWith(".mp3")?"audio/mpeg":t.endsWith(".wav")?"audio/wav":t.endsWith(".mp4")?"video/mp4":"image/jpeg"}function d(e){try{const t=new URL(e).pathname.split("/").filter(Boolean);return t[t.length-1]||"file"}catch{return"file"}}export class ResponsesChannel{name="responses";app;server=null;onMessage=null;config;tokenDb;constructor(t,s){this.config=t,this.tokenDb=s,this.app=new e,this.setupRoutes()}setupRoutes(){this.app.get("/health",e=>e.json({status:"ok"})),this.app.post("/v1/responses",async e=>{const s=o(this.tokenDb,e.req.header("Authorization"),"responses");if(!s.authorized)return e.json({error:{message:s.reason,type:"auth_error"}},401);const r=await e.req.json(),p=r.input,m=r.previous_response_id;let d="";const f=[];if("string"==typeof p)d=p;else{if(!Array.isArray(p))return e.json({error:{message:"Invalid input format",type:"invalid_request"}},400);{const t=p.filter(e=>"user"===e.role),s=t[t.length-1];if(!s)return e.json({error:{message:"No user message found in input",type:"invalid_request"}},400);if("string"==typeof s.content)d=s.content;else if(Array.isArray(s.content)){const e=[];for(const t of s.content)if("input_text"===t.type)e.push(t.text);else if("input_image"===t.type)if(t.image_url){const e="string"==typeof t.image_url?t.image_url:t.image_url.url;e&&f.push(a(e))}else t.file&&t.file.file_data&&f.push(u(t.file.file_data,t.file.mime_type));else if("input_file"===t.type){const e=t.filename||t.file_name;t.file_url?f.push(l(t.file_url,t.mime_type,e)):t.file_data?f.push(c(t.file_data,t.mime_type,e)):t.file&&t.file.file_data&&f.push(c(t.file.file_data,t.file.mime_type,e))}d=e.join("\n")}else d=String(s.content)}}if(!this.onMessage)return e.json({error:{message:"Server not ready",type:"server_error"}},503);const _=s.token.userId,g=`api_${_}`;if(f.length>0){const e={};for(const t of f)e[t.type]=(e[t.type]||0)+1;const t=Object.entries(e).map(([e,t])=>`${t} ${e}(s)`);i.info(`Request contains ${t.join(", ")}`)}const h={chatId:g,userId:_,channelName:"responses",text:d||void 0,attachments:f,rawContext:{previousResponseId:m,body:r}},y=r.model??"claude-sonnet-4-5-20250929";if(r.stream)return t(e,async e=>{const t=`resp_${n.randomBytes(24).toString("hex")}`,s=`msg_${n.randomBytes(24).toString("hex")}`;let o=0;const a={id:t,object:"response",created_at:Math.floor(Date.now()/1e3),status:"in_progress",completed_at:null,error:null,incomplete_details:null,instructions:r.instructions??null,max_output_tokens:r.max_output_tokens??null,model:y,output:[],output_text:"",parallel_tool_calls:!0,previous_response_id:m??null,reasoning:{effort:null,summary:null},store:!0,temperature:r.temperature??1,text:{format:{type:"text"}},tool_choice:"auto",tools:[],top_p:r.top_p??1,truncation:"disabled",usage:null,user:_,metadata:r.metadata??{}};await e.writeSSE({event:"response.created",data:JSON.stringify({type:"response.created",response:a,sequence_number:++o})});const u={id:s,type:"message",status:"in_progress",role:"assistant",content:[]};await e.writeSSE({event:"response.output_item.added",data:JSON.stringify({type:"response.output_item.added",output_index:0,item:u,sequence_number:++o})}),await e.writeSSE({event:"response.content_part.added",data:JSON.stringify({type:"response.content_part.added",item_id:s,output_index:0,content_index:0,part:{type:"output_text",text:"",annotations:[]},sequence_number:++o})});let p="";try{p=await this.onMessage(h)}catch(t){return i.error(`Error processing streaming request: ${t}`),void await e.writeSSE({event:"error",data:JSON.stringify({type:"error",message:"Internal server error",sequence_number:++o})})}await e.writeSSE({event:"response.output_text.delta",data:JSON.stringify({type:"response.output_text.delta",item_id:s,output_index:0,content_index:0,delta:p,sequence_number:++o})}),await e.writeSSE({event:"response.output_text.done",data:JSON.stringify({type:"response.output_text.done",item_id:s,output_index:0,content_index:0,text:p,sequence_number:++o})});const l={id:s,type:"message",status:"completed",role:"assistant",content:[{type:"output_text",annotations:[],logprobs:[],text:p}]};await e.writeSSE({event:"response.output_item.done",data:JSON.stringify({type:"response.output_item.done",output_index:0,item:l,sequence_number:++o})});const c=Math.floor(Date.now()/1e3),d={...a,status:"completed",completed_at:c,output:[l],output_text:p,usage:{input_tokens:0,input_tokens_details:{cached_tokens:0},output_tokens:0,output_tokens_details:{reasoning_tokens:0},total_tokens:0}};await e.writeSSE({event:"response.completed",data:JSON.stringify({type:"response.completed",response:d,sequence_number:++o})})});try{const t=await this.onMessage(h),s=`resp_${n.randomBytes(24).toString("hex")}`,o=`msg_${n.randomBytes(24).toString("hex")}`,i=Math.floor(Date.now()/1e3),a=Math.floor(Date.now()/1e3);return e.json({id:s,object:"response",created_at:i,status:"completed",completed_at:a,error:null,incomplete_details:null,instructions:r.instructions??null,max_output_tokens:r.max_output_tokens??null,model:y,output:[{id:o,type:"message",status:"completed",content:[{type:"output_text",annotations:[],logprobs:[],text:t}],role:"assistant"}],output_text:t,parallel_tool_calls:!0,previous_response_id:m??null,reasoning:{effort:null,summary:null},store:!0,temperature:r.temperature??1,text:{format:{type:"text"}},tool_choice:"auto",tools:[],top_p:r.top_p??1,truncation:"disabled",usage:{input_tokens:0,input_tokens_details:{cached_tokens:0},output_tokens:0,output_tokens_details:{reasoning_tokens:0},total_tokens:0},user:_,metadata:r.metadata??{}})}catch(t){return i.error(`Error processing request: ${t}`),e.json({error:{message:"Internal server error",type:"server_error"}},500)}})}async start(e){this.onMessage=e,this.server=s({fetch:this.app.fetch,hostname:this.config.host||"127.0.0.1",port:this.config.port}),i.info(`Responses API listening on http://${this.config.host||"127.0.0.1"}:${this.config.port}`)}async sendText(e,t){}async stop(){this.server&&(this.server.close(),i.info("Responses API stopped"))}}
@@ -0,0 +1,7 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export declare class ClearCommand implements Command {
3
+ name: string;
4
+ description: string;
5
+ execute(_ctx: CommandContext): Promise<CommandResult>;
6
+ }
7
+ //# sourceMappingURL=clear.d.ts.map
@@ -0,0 +1 @@
1
+ export class ClearCommand{name="clear";description="Clear all conversation history";async execute(e){return{text:"",passthrough:"/clear"}}}
@@ -0,0 +1,7 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export declare class CmdCommand implements Command {
3
+ name: string;
4
+ description: string;
5
+ execute(ctx: CommandContext): Promise<CommandResult>;
6
+ }
7
+ //# sourceMappingURL=cmd.d.ts.map
@@ -0,0 +1 @@
1
+ export class CmdCommand{name="cmd";description="Send a slash command directly to the SDK (e.g. /cmd doctor)";async execute(e){return e.args.trim()?{text:"",passthrough:`/${e.args}`}:{text:"Usage: /cmd <command>\nSends /<command> directly to the SDK."}}}
@@ -0,0 +1,12 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export type CoderGetHandler = (sessionKey: string) => boolean;
3
+ export type CoderSetHandler = (sessionKey: string, value: boolean) => void;
4
+ export declare class CoderCommand implements Command {
5
+ private getHandler;
6
+ private setHandler;
7
+ name: string;
8
+ description: string;
9
+ constructor(getHandler: CoderGetHandler, setHandler: CoderSetHandler);
10
+ execute(ctx: CommandContext): Promise<CommandResult>;
11
+ }
12
+ //# sourceMappingURL=coder.d.ts.map
@@ -0,0 +1 @@
1
+ export class CoderCommand{getHandler;setHandler;name="coder";description="Toggle coder skill (usage: /coder on|off)";constructor(e,s){this.getHandler=e,this.setHandler=s}async execute(e){const s=e.args.trim().toLowerCase();if("on"===s)return this.setHandler(e.sessionKey,!0),{text:"Coder skill enabled.",resetAgent:!0};if("off"===s)return this.setHandler(e.sessionKey,!1),{text:"Coder skill disabled.",resetAgent:!0};return{text:`Coder skill is currently ${this.getHandler(e.sessionKey)?"on":"off"}.\nUsage: /coder on|off`}}}
@@ -0,0 +1,12 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export declare class CommandRegistry {
3
+ private commands;
4
+ register(command: Command): void;
5
+ isCommand(text: string): boolean;
6
+ dispatch(text: string, ctx: Omit<CommandContext, "args">): Promise<CommandResult | null>;
7
+ listCommands(): Array<{
8
+ name: string;
9
+ description: string;
10
+ }>;
11
+ }
12
+ //# sourceMappingURL=command-registry.d.ts.map
@@ -0,0 +1 @@
1
+ import{createLogger as s}from"../utils/logger.js";const t=s("CommandRegistry");export class CommandRegistry{commands=new Map;register(s){this.commands.set(s.name,s),t.info(`Registered command: /${s.name}`)}isCommand(s){const t=s.trim();if(!t.startsWith("/"))return!1;const n=t.split(/\s+/)[0].slice(1).toLowerCase();return this.commands.has(n)}async dispatch(s,n){const e=s.trim();if(!e.startsWith("/"))return null;const i=e.split(/\s+/),m=i[0].slice(1).toLowerCase(),r=i.slice(1).join(" "),a=this.commands.get(m);return a?(t.info(`Dispatching command: /${m} (args: ${r})`),a.execute({...n,args:r})):null}listCommands(){return Array.from(this.commands.values()).map(s=>({name:s.name,description:s.description}))}}
@@ -0,0 +1,22 @@
1
+ export interface CommandContext {
2
+ sessionKey: string;
3
+ chatId: string;
4
+ channelName: string;
5
+ userId: string;
6
+ args: string;
7
+ }
8
+ export interface CommandResult {
9
+ text: string;
10
+ /** If true, the server should reset the session after this command. */
11
+ resetSession?: boolean;
12
+ /** If true, the server should destroy the current SessionAgent (but keep the session ID for resumption). */
13
+ resetAgent?: boolean;
14
+ /** If set, the server should re-send this text through the full handleMessage pipeline instead of returning text directly. */
15
+ passthrough?: string;
16
+ }
17
+ export interface Command {
18
+ name: string;
19
+ description: string;
20
+ execute(ctx: CommandContext): Promise<CommandResult>;
21
+ }
22
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,7 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export declare class CompactCommand implements Command {
3
+ name: string;
4
+ description: string;
5
+ execute(_ctx: CommandContext): Promise<CommandResult>;
6
+ }
7
+ //# sourceMappingURL=compact.d.ts.map
@@ -0,0 +1 @@
1
+ export class CompactCommand{name="compact";description="Compact conversation memory";async execute(t){return{text:"",passthrough:"/compact"}}}
@@ -0,0 +1,15 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ import type { AppConfig } from "../config.js";
3
+ export type CustomSubAgentsGetHandler = (sessionKey: string) => boolean;
4
+ export type CustomSubAgentsSetHandler = (sessionKey: string, value: boolean) => void;
5
+ export type CustomSubAgentsConfigProvider = () => AppConfig;
6
+ export declare class CustomSubAgentsCommand implements Command {
7
+ private getHandler;
8
+ private setHandler;
9
+ private configProvider;
10
+ name: string;
11
+ description: string;
12
+ constructor(getHandler: CustomSubAgentsGetHandler, setHandler: CustomSubAgentsSetHandler, configProvider: CustomSubAgentsConfigProvider);
13
+ execute(ctx: CommandContext): Promise<CommandResult>;
14
+ }
15
+ //# sourceMappingURL=customsubagents.d.ts.map
@@ -0,0 +1 @@
1
+ export class CustomSubAgentsCommand{getHandler;setHandler;configProvider;name="customsubagents";description="Toggle custom subagents (usage: /customsubagents on|off)";constructor(e,s,t){this.getHandler=e,this.setHandler=s,this.configProvider=t}async execute(e){const s=e.args.trim().toLowerCase();if("on"===s)return this.setHandler(e.sessionKey,!0),{text:"Custom subagents enabled.",resetAgent:!0};if("off"===s)return this.setHandler(e.sessionKey,!1),{text:"Custom subagents disabled.",resetAgent:!0};const t=this.getHandler(e.sessionKey),n=this.configProvider().agent.customSubAgents??[],o=[];if(o.push(`Custom subagents are currently ${t?"on":"off"}.`),n.length>0){o.push(`\nConfigured subagents (${n.length}):`);for(const e of n){const s=e.enabled?"enabled":"disabled";o.push(` - ${e.name} [${e.model}] (${s})`)}}else o.push("No custom subagents configured.");return o.push("\nUsage: /customsubagents on|off"),{text:o.join("\n")}}}
@@ -0,0 +1,9 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export declare class HelpCommand implements Command {
3
+ private getSdkCommands;
4
+ name: string;
5
+ description: string;
6
+ constructor(getSdkCommands: () => string[]);
7
+ execute(_ctx: CommandContext): Promise<CommandResult>;
8
+ }
9
+ //# sourceMappingURL=help.d.ts.map
@@ -0,0 +1 @@
1
+ export class HelpCommand{getSdkCommands;name="help";description="Show available commands";constructor(e){this.getSdkCommands=e}async execute(e){const o=["Available commands:","","/coder on|off — Toggle the built-in coder skill in the system prompt","/compact — Compress the current session context to reduce token usage","/customsubagents on|off — Pass custom subagents (configured in Nostromo) to the agent","/help — Show this message","/mcp — List available MCP skills","/model <name> — Switch the agent model for the current session","/models — List all models in the registry","/new — Start a fresh session (clears conversation history and memory)","/sandbox on|off — Toggle sandbox mode for command execution","/showtool on|off — Show tool-use notifications in the chat while the agent works","/status — Show current server state (model, fallback, toggles, connected nodes)","/stop — Interrupt the agent if it is currently processing","/subagents on|off — Enable or disable subagent invocation (removes the Task tool when off)","/usage — Show SDK usage for the current session (similar to /context)"],t=["compact","keybindings-help"],s=this.getSdkCommands();if(s.length>0){const e=s.filter(e=>!t.includes(e)&&!e.startsWith("mcp__")).sort((e,o)=>e.localeCompare(o));if(e.length>0){o.push(""),o.push("Claude SDK commands:");for(const t of e)o.push(` /${t}`)}}return{text:o.join("\n")}}}
@@ -0,0 +1,9 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export declare class McpCommand implements Command {
3
+ private getSdkCommands;
4
+ name: string;
5
+ description: string;
6
+ constructor(getSdkCommands: () => string[]);
7
+ execute(_ctx: CommandContext): Promise<CommandResult>;
8
+ }
9
+ //# sourceMappingURL=mcp.d.ts.map
@@ -0,0 +1 @@
1
+ export class McpCommand{getSdkCommands;name="mcp";description="List available MCP skills";constructor(s){this.getSdkCommands=s}async execute(s){const t=this.getSdkCommands().filter(s=>s.startsWith("mcp__"));if(0===t.length)return{text:"No MCP skills available. Start a conversation first or check your MCP server configuration."};const o=["MCP Skills:",""],n=new Map;for(const s of t){const t=s.split("__"),o=t.slice(1,-1).join(" / ")||"unknown",e=t[t.length-1]||s;n.has(o)||n.set(o,[]),n.get(o).push(e)}for(const[s,t]of n){o.push(`${s}:`);for(const s of t)o.push(`- ${s}`);o.push("")}return o.push("Invoke via: /mcp__<server>__<skill>"),{text:o.join("\n")}}}
@@ -0,0 +1,22 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export interface ModelEntry {
3
+ id: string;
4
+ name: string;
5
+ types?: string[];
6
+ proxy?: string;
7
+ fastUrl?: string;
8
+ fastProxyApiKey?: string;
9
+ apiKey?: string;
10
+ baseURL?: string;
11
+ }
12
+ export type ModelRegistryProvider = () => ModelEntry[];
13
+ export type ModelSetHandler = (sessionKey: string, modelId: string) => Promise<void>;
14
+ export declare class ModelCommand implements Command {
15
+ private registryProvider;
16
+ private setHandler;
17
+ name: string;
18
+ description: string;
19
+ constructor(registryProvider: ModelRegistryProvider, setHandler: ModelSetHandler);
20
+ execute(ctx: CommandContext): Promise<CommandResult>;
21
+ }
22
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ export class ModelCommand{registryProvider;setHandler;name="model";description="Switch model for this session (usage: /model <name or id>)";constructor(e,t){this.registryProvider=e,this.setHandler=t}async execute(e){const t=e.args.trim();if(!t)return{text:"Usage: /model <name or id>\nUse /models to see available models."};const n=this.registryProvider().filter(e=>{const t=e.types||["external"];return t.includes("internal")||t.includes("external")&&e.proxy&&"not-used"!==e.proxy}),s=t.toLowerCase();let i=n.find(e=>e.name===t)??n.find(e=>e.id===t)??n.find(e=>e.name.toLowerCase()===s)??n.find(e=>e.id.toLowerCase()===s);if(!i){const e=n.filter(e=>e.name.toLowerCase().includes(s)||e.id.toLowerCase().includes(s));if(1===e.length)i=e[0];else if(e.length>1){const n=e.map(e=>` ${e.name} (${e.id})`).join("\n");return{text:`"${t}" matches multiple models:\n${n}\n\nPlease be more specific.`}}}if(!i){const e=n.map(e=>` ${e.name} (${e.id})`).join("\n");return{text:`Model "${t}" not found.\n\nAvailable models:\n${e}`}}return await this.setHandler(e.sessionKey,i.id),{text:`Model switched to: ${i.name} (${i.id})`}}}
@@ -0,0 +1,11 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ import type { ModelEntry } from "./model.js";
3
+ export type ModelRegistryProvider = () => ModelEntry[];
4
+ export declare class ModelsCommand implements Command {
5
+ private registryProvider;
6
+ name: string;
7
+ description: string;
8
+ constructor(registryProvider: ModelRegistryProvider);
9
+ execute(_ctx: CommandContext): Promise<CommandResult>;
10
+ }
11
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ export class ModelsCommand{registryProvider;name="models";description="List configured models (usage: /models)";constructor(e){this.registryProvider=e}async execute(e){const r=this.registryProvider();if(0===r.length)return{text:"No models configured in the registry."};return{text:`Available models:\n${r.map(e=>{const r=e.proxy&&"not-used"!==e.proxy?" (proxied)":"";return` ${e.name} (${e.id})${r}`}).join("\n")}`}}}
@@ -0,0 +1,7 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export declare class NewCommand implements Command {
3
+ name: string;
4
+ description: string;
5
+ execute(_ctx: CommandContext): Promise<CommandResult>;
6
+ }
7
+ //# sourceMappingURL=new.d.ts.map
@@ -0,0 +1 @@
1
+ export class NewCommand{name="new";description="Start a new session (reset conversation history)";async execute(e){return{text:"Session reset. Starting a new conversation.",resetSession:!0}}}
@@ -0,0 +1,7 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export declare class PluginCommand implements Command {
3
+ name: string;
4
+ description: string;
5
+ execute(ctx: CommandContext): Promise<CommandResult>;
6
+ }
7
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ export class PluginCommand{name="plugin";description="Manage plugins (e.g. /plugin install <package>)";async execute(a){return a.args.trim()?{text:"",passthrough:`/${a.args}`}:{text:"Usage: /plugin install <package>"}}}
@@ -0,0 +1,12 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export type SandboxGetHandler = (sessionKey: string) => boolean;
3
+ export type SandboxSetHandler = (sessionKey: string, value: boolean) => void;
4
+ export declare class SandboxCommand implements Command {
5
+ private getHandler;
6
+ private setHandler;
7
+ name: string;
8
+ description: string;
9
+ constructor(getHandler: SandboxGetHandler, setHandler: SandboxSetHandler);
10
+ execute(ctx: CommandContext): Promise<CommandResult>;
11
+ }
12
+ //# sourceMappingURL=sandbox.d.ts.map
@@ -0,0 +1 @@
1
+ export class SandboxCommand{getHandler;setHandler;name="sandbox";description="Toggle sandbox mode (usage: /sandbox on|off)";constructor(e,n){this.getHandler=e,this.setHandler=n}async execute(e){const n=e.args.trim().toLowerCase();if("on"===n)return this.setHandler(e.sessionKey,!0),{text:"Sandbox mode enabled.",resetAgent:!0};if("off"===n)return this.setHandler(e.sessionKey,!1),{text:"Sandbox mode disabled.",resetAgent:!0};return{text:`Sandbox mode is currently ${this.getHandler(e.sessionKey)?"on":"off"}.\nUsage: /sandbox on|off`}}}
@@ -0,0 +1,12 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export type ShowToolGetHandler = (sessionKey: string) => boolean;
3
+ export type ShowToolSetHandler = (sessionKey: string, value: boolean) => void;
4
+ export declare class ShowToolCommand implements Command {
5
+ private getHandler;
6
+ private setHandler;
7
+ name: string;
8
+ description: string;
9
+ constructor(getHandler: ShowToolGetHandler, setHandler: ShowToolSetHandler);
10
+ execute(ctx: CommandContext): Promise<CommandResult>;
11
+ }
12
+ //# sourceMappingURL=showtool.d.ts.map
@@ -0,0 +1 @@
1
+ export class ShowToolCommand{getHandler;setHandler;name="showtool";description="Toggle tool-use notifications (usage: /showtool on|off)";constructor(o,e){this.getHandler=o,this.setHandler=e}async execute(o){const e=o.args.trim().toLowerCase();if("on"===e)return this.setHandler(o.sessionKey,!0),{text:"Tool-use notifications enabled."};if("off"===e)return this.setHandler(o.sessionKey,!1),{text:"Tool-use notifications disabled."};return{text:`Tool-use notifications are currently ${this.getHandler(o.sessionKey)?"on":"off"}.\nUsage: /showtool on|off`}}}
@@ -0,0 +1,24 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export interface StatusInfo {
3
+ agentModel: string;
4
+ fallbackModel: string;
5
+ coderSkill: boolean;
6
+ showToolUse: boolean;
7
+ subagentsEnabled: boolean;
8
+ customSubAgentsEnabled: boolean;
9
+ sandboxEnabled: boolean;
10
+ connectedNodes: Array<{
11
+ nodeId: string;
12
+ displayName?: string;
13
+ hostname?: string;
14
+ }>;
15
+ }
16
+ export type StatusProvider = (sessionKey: string) => StatusInfo;
17
+ export declare class StatusCommand implements Command {
18
+ private provider;
19
+ name: string;
20
+ description: string;
21
+ constructor(provider: StatusProvider);
22
+ execute(ctx: CommandContext): Promise<CommandResult>;
23
+ }
24
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ export class StatusCommand{provider;name="status";description="Show current server status (models, coder, nodes)";constructor(e){this.provider=e}async execute(e){const o=this.provider(e.sessionKey),s=[];if(s.push("Server Status"),s.push(` Agent model: ${o.agentModel}`),s.push(` Fallback model: ${o.fallbackModel||"(none)"}`),s.push(" Coder skill: "+(o.coderSkill?"on":"off")),s.push(" Show tool use: "+(o.showToolUse?"on":"off")),s.push(" SubAgents: "+(o.subagentsEnabled?"on":"off")),s.push(" Custom SubAgents: "+(o.customSubAgentsEnabled?"on":"off")),s.push(" Sandbox: "+(o.sandboxEnabled?"on":"off")),o.connectedNodes.length>0){s.push(` Connected nodes (${o.connectedNodes.length}):`);for(const e of o.connectedNodes){const o=e.displayName??e.nodeId,n=e.hostname?` (${e.hostname})`:"";s.push(` - ${o}${n}`)}}else s.push(" Connected nodes: none");return{text:s.join("\n")}}}
@@ -0,0 +1,10 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export type StopHandler = (sessionKey: string) => Promise<boolean>;
3
+ export declare class StopCommand implements Command {
4
+ private handler;
5
+ name: string;
6
+ description: string;
7
+ constructor(handler: StopHandler);
8
+ execute(ctx: CommandContext): Promise<CommandResult>;
9
+ }
10
+ //# sourceMappingURL=stop.d.ts.map
@@ -0,0 +1 @@
1
+ export class StopCommand{handler;name="stop";description="Interrupt the current query";constructor(e){this.handler=e}async execute(e){return{text:await this.handler(e.sessionKey)?"Query interrupted.":"No active query to interrupt."}}}
@@ -0,0 +1,12 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export type SubAgentsGetHandler = (sessionKey: string) => boolean;
3
+ export type SubAgentsSetHandler = (sessionKey: string, value: boolean) => void;
4
+ export declare class SubAgentsCommand implements Command {
5
+ private getHandler;
6
+ private setHandler;
7
+ name: string;
8
+ description: string;
9
+ constructor(getHandler: SubAgentsGetHandler, setHandler: SubAgentsSetHandler);
10
+ execute(ctx: CommandContext): Promise<CommandResult>;
11
+ }
12
+ //# sourceMappingURL=subagents.d.ts.map
@@ -0,0 +1 @@
1
+ export class SubAgentsCommand{getHandler;setHandler;name="subagents";description="Toggle subagent invocation (usage: /subagents on|off)";constructor(e,t){this.getHandler=e,this.setHandler=t}async execute(e){const t=e.args.trim().toLowerCase();if("on"===t)return this.setHandler(e.sessionKey,!0),{text:"SubAgents enabled (Task tool available).",resetAgent:!0};if("off"===t)return this.setHandler(e.sessionKey,!1),{text:"SubAgents disabled (Task tool removed).",resetAgent:!0};return{text:`SubAgents are currently ${this.getHandler(e.sessionKey)?"on":"off"}.\nUsage: /subagents on|off`}}}
@@ -0,0 +1,25 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export interface UsageData {
3
+ totalCostUsd?: number;
4
+ durationMs?: number;
5
+ numTurns?: number;
6
+ modelUsage?: Record<string, {
7
+ inputTokens?: number;
8
+ outputTokens?: number;
9
+ cacheReadInputTokens?: number;
10
+ cacheCreationInputTokens?: number;
11
+ webSearchRequests?: number;
12
+ costUSD?: number;
13
+ contextWindow?: number;
14
+ }>;
15
+ recordedAt: number;
16
+ }
17
+ export type UsageProvider = (sessionKey: string) => UsageData | undefined;
18
+ export declare class UsageCommand implements Command {
19
+ private provider;
20
+ name: string;
21
+ description: string;
22
+ constructor(provider: UsageProvider);
23
+ execute(ctx: CommandContext): Promise<CommandResult>;
24
+ }
25
+ //# sourceMappingURL=usage.d.ts.map
@@ -0,0 +1 @@
1
+ export class UsageCommand{provider;name="usage";description="Show SDK usage for the current session";constructor(e){this.provider=e}async execute(e){const o=this.provider(e.sessionKey);if(!o)return{text:"No usage data recorded for this session yet."};const s=[];if(s.push(`Usage for ${e.sessionKey}`),void 0!==o.totalCostUsd&&s.push(` Cost: $${Number(o.totalCostUsd).toFixed(4)}`),void 0!==o.durationMs&&s.push(` Duration: ${(o.durationMs/1e3).toFixed(1)}s`),void 0!==o.numTurns&&s.push(` Turns: ${o.numTurns}`),o.modelUsage)for(const[e,t]of Object.entries(o.modelUsage)){const o=[` ${e}:`];t.inputTokens&&o.push(`in=${t.inputTokens}`),t.outputTokens&&o.push(`out=${t.outputTokens}`),t.cacheReadInputTokens&&o.push(`cache_read=${t.cacheReadInputTokens}`),t.cacheCreationInputTokens&&o.push(`cache_create=${t.cacheCreationInputTokens}`),t.webSearchRequests&&o.push(`web_search=${t.webSearchRequests}`),t.contextWindow&&o.push(`ctx_window=${t.contextWindow}`),void 0!==t.costUSD&&o.push(`cost=$${Number(t.costUSD).toFixed(4)}`),s.push(o.join(" "))}const t=Date.now()-o.recordedAt,n=Math.floor(t/1e3),u=Math.floor(n/60);return u>0?s.push(` Recorded: ${u}m ago`):s.push(` Recorded: ${n}s ago`),{text:s.join("\n")}}}
@@ -0,0 +1,7 @@
1
+ import type { Command, CommandContext, CommandResult } from "./command.js";
2
+ export declare class UsePluginCommand implements Command {
3
+ name: string;
4
+ description: string;
5
+ execute(ctx: CommandContext): Promise<CommandResult>;
6
+ }
7
+ //# sourceMappingURL=useplugin.d.ts.map
@@ -0,0 +1 @@
1
+ export class UsePluginCommand{name="useplugin";description="Invoke a plugin skill (e.g. /useplugin my-first-plugin:hello)";async execute(e){return e.args.trim()?{text:"",passthrough:`/${e.args}`}:{text:"Usage: /useplugin <plugin-name>:<skill-name>\nExample: /useplugin my-first-plugin:hello"}}}
@@ -0,0 +1,14 @@
1
+ import type { Server } from "./server.js";
2
+ export declare class ConfigWatcher {
3
+ private currentHash;
4
+ private interval;
5
+ private configPath;
6
+ private server;
7
+ private checkIntervalSec;
8
+ constructor(server: Server, checkIntervalSec: number, configPath?: string);
9
+ private hashFile;
10
+ start(): void;
11
+ private check;
12
+ stop(): void;
13
+ }
14
+ //# sourceMappingURL=config-watcher.d.ts.map
@@ -0,0 +1 @@
1
+ import{readFileSync as t,existsSync as i}from"node:fs";import{createHash as e}from"node:crypto";import{resolve as r}from"node:path";import{loadConfig as n}from"./config.js";import{createLogger as s}from"./utils/logger.js";const o=s("ConfigWatcher");export class ConfigWatcher{currentHash="";interval=null;configPath;server;checkIntervalSec;constructor(t,i,e){this.server=t,this.checkIntervalSec=i,this.configPath=e??r(process.cwd(),"config.yaml")}hashFile(i){const r=t(i,"utf-8");return e("sha256").update(r).digest("hex")}start(){i(this.configPath)?(this.currentHash=this.hashFile(this.configPath),o.info(`Watching config file: ${this.configPath} (interval: ${this.checkIntervalSec}s)`),this.interval=setInterval(()=>{this.check()},1e3*this.checkIntervalSec)):o.warn(`Config file not found: ${this.configPath}, watcher disabled`)}async check(){try{if(!i(this.configPath))return;const t=this.hashFile(this.configPath);if(t===this.currentHash)return;this.currentHash=t;if(!this.server.getConfig().nostromo.autoRestart)return void o.info("Config file changed but auto-restart is disabled — skipping reconfigure");o.info("Config file changed, reloading...");const e=n(this.configPath);await this.server.reconfigure(e),o.info("Server reconfigured successfully")}catch(t){o.error(`Config reload failed: ${t}`)}}stop(){this.interval&&(clearInterval(this.interval),this.interval=null,o.info("Config watcher stopped"))}}