@chankov/agent-fleet 0.0.9 → 0.0.11

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 (661) hide show
  1. package/.claude/commands/doctor-agent-fleet.md +12 -7
  2. package/.claude/commands/setup-agent-fleet.md +7 -15
  3. package/.opencode/commands/af-doctor-agent-fleet.md +12 -7
  4. package/.opencode/commands/af-setup-agent-fleet.md +8 -6
  5. package/.pi/extensions/agent-fleet-update-check/README.md +2 -3
  6. package/.pi/extensions/btw/README.md +5 -4
  7. package/.pi/extensions/chrome-devtools-mcp/README.md +3 -6
  8. package/.pi/extensions/compact-and-continue/README.md +3 -3
  9. package/.pi/extensions/mcp-bridge/README.md +1 -1
  10. package/.pi/extensions/pi-voice-stt/README.md +3 -0
  11. package/.pi/harnesses/agent-hub/README.md +142 -10
  12. package/.pi/harnesses/agent-hub/docs-lane.js +122 -0
  13. package/.pi/harnesses/agent-hub/external-blocker.js +85 -0
  14. package/.pi/harnesses/agent-hub/index.ts +448 -39
  15. package/.pi/harnesses/agent-hub/package.json +1 -1
  16. package/.pi/harnesses/agent-hub/review-findings.js +102 -0
  17. package/.pi/harnesses/agent-hub/run-budget.js +302 -4
  18. package/.pi/harnesses/agent-hub/run-namespace.js +87 -0
  19. package/.pi/harnesses/coms/package.json +1 -1
  20. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  21. package/.pi/prompts/af-doctor-agent-fleet.md +13 -6
  22. package/.pi/prompts/af-setup-agent-fleet.md +7 -15
  23. package/.versions/0.0.10/.claude/commands/build.md +44 -0
  24. package/.versions/0.0.10/.claude/commands/code-simplify.md +22 -0
  25. package/.versions/0.0.10/.claude/commands/design-agent.md +14 -0
  26. package/.versions/0.0.10/.claude/commands/doctor-agent-fleet.md +22 -0
  27. package/.versions/0.0.10/.claude/commands/orchestrate.md +112 -0
  28. package/.versions/0.0.10/.claude/commands/plan.md +16 -0
  29. package/.versions/0.0.10/.claude/commands/prime.md +22 -0
  30. package/.versions/0.0.10/.claude/commands/review.md +16 -0
  31. package/.versions/0.0.10/.claude/commands/set-hermes-telegram.md +15 -0
  32. package/.versions/0.0.10/.claude/commands/set-hermes-watchdog.md +6 -0
  33. package/.versions/0.0.10/.claude/commands/setup-agent-fleet.md +17 -0
  34. package/.versions/0.0.10/.claude/commands/ship.md +72 -0
  35. package/.versions/0.0.10/.claude/commands/spec.md +15 -0
  36. package/.versions/0.0.10/.claude/commands/test.md +19 -0
  37. package/.versions/0.0.10/.claude/commands/webperf.md +32 -0
  38. package/.versions/0.0.10/.claude/orchestrate-teams.yaml +24 -0
  39. package/.versions/0.0.10/.opencode/commands/af-build.md +17 -0
  40. package/.versions/0.0.10/.opencode/commands/af-code-simplify.md +16 -0
  41. package/.versions/0.0.10/.opencode/commands/af-compound.md +16 -0
  42. package/.versions/0.0.10/.opencode/commands/af-design-agent.md +15 -0
  43. package/.versions/0.0.10/.opencode/commands/af-doctor-agent-fleet.md +22 -0
  44. package/.versions/0.0.10/.opencode/commands/af-orchestrate.md +112 -0
  45. package/.versions/0.0.10/.opencode/commands/af-plan.md +16 -0
  46. package/.versions/0.0.10/.opencode/commands/af-prime.md +22 -0
  47. package/.versions/0.0.10/.opencode/commands/af-review.md +15 -0
  48. package/.versions/0.0.10/.opencode/commands/af-set-hermes-telegram.md +15 -0
  49. package/.versions/0.0.10/.opencode/commands/af-set-hermes-watchdog.md +6 -0
  50. package/.versions/0.0.10/.opencode/commands/af-setup-agent-fleet.md +17 -0
  51. package/.versions/0.0.10/.opencode/commands/af-ship.md +16 -0
  52. package/.versions/0.0.10/.opencode/commands/af-spec.md +16 -0
  53. package/.versions/0.0.10/.opencode/commands/af-test.md +21 -0
  54. package/.versions/0.0.10/.opencode/commands/af-webperf.md +32 -0
  55. package/.versions/0.0.10/.opencode/orchestrate-teams.yaml +24 -0
  56. package/.versions/0.0.10/.pi/agents/dispatch-policy.yaml +32 -0
  57. package/.versions/0.0.10/.pi/agents/model-profiles.yaml +27 -0
  58. package/.versions/0.0.10/.pi/agents/peers.yaml +142 -0
  59. package/.versions/0.0.10/.pi/agents/teams.yaml +41 -0
  60. package/.versions/0.0.10/.pi/damage-control-rules.yaml +297 -0
  61. package/.versions/0.0.10/.pi/extensions/agent-fleet-update-check/README.md +57 -0
  62. package/.versions/0.0.10/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
  63. package/.versions/0.0.10/.pi/extensions/agent-fleet-update-check/package.json +6 -0
  64. package/.versions/0.0.10/.pi/extensions/btw/README.md +118 -0
  65. package/.versions/0.0.10/.pi/extensions/btw/index.ts +917 -0
  66. package/.versions/0.0.10/.pi/extensions/btw/package.json +6 -0
  67. package/.versions/0.0.10/.pi/extensions/btw/state.js +179 -0
  68. package/.versions/0.0.10/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  69. package/.versions/0.0.10/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  70. package/.versions/0.0.10/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  71. package/.versions/0.0.10/.pi/extensions/compact-and-continue/README.md +42 -0
  72. package/.versions/0.0.10/.pi/extensions/compact-and-continue/index.ts +120 -0
  73. package/.versions/0.0.10/.pi/extensions/compact-and-continue/package.json +6 -0
  74. package/.versions/0.0.10/.pi/extensions/mcp-bridge/README.md +46 -0
  75. package/.versions/0.0.10/.pi/extensions/mcp-bridge/index.ts +206 -0
  76. package/.versions/0.0.10/.pi/extensions/mcp-bridge/package.json +6 -0
  77. package/.versions/0.0.10/.pi/extensions/package-lock.json +1143 -0
  78. package/.versions/0.0.10/.pi/extensions/package.json +9 -0
  79. package/.versions/0.0.10/.pi/extensions/pi-voice-stt/README.md +201 -0
  80. package/.versions/0.0.10/.pi/extensions/pi-voice-stt/config.ts +198 -0
  81. package/.versions/0.0.10/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  82. package/.versions/0.0.10/.pi/extensions/pi-voice-stt/index.ts +248 -0
  83. package/.versions/0.0.10/.pi/extensions/pi-voice-stt/package.json +6 -0
  84. package/.versions/0.0.10/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  85. package/.versions/0.0.10/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  86. package/.versions/0.0.10/.pi/harnesses/agent-hub/README.md +1001 -0
  87. package/.versions/0.0.10/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  88. package/.versions/0.0.10/.pi/harnesses/agent-hub/artifacts.js +146 -0
  89. package/.versions/0.0.10/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
  90. package/.versions/0.0.10/.pi/harnesses/agent-hub/backend-policy.js +153 -0
  91. package/.versions/0.0.10/.pi/harnesses/agent-hub/context-window.js +106 -0
  92. package/.versions/0.0.10/.pi/harnesses/agent-hub/delegate.ts +435 -0
  93. package/.versions/0.0.10/.pi/harnesses/agent-hub/docs-lane.js +122 -0
  94. package/.versions/0.0.10/.pi/harnesses/agent-hub/drift-watchdog.js +211 -0
  95. package/.versions/0.0.10/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  96. package/.versions/0.0.10/.pi/harnesses/agent-hub/external-blocker.js +85 -0
  97. package/.versions/0.0.10/.pi/harnesses/agent-hub/footer.ts +31 -0
  98. package/.versions/0.0.10/.pi/harnesses/agent-hub/helpers.ts +248 -0
  99. package/.versions/0.0.10/.pi/harnesses/agent-hub/index.ts +9111 -0
  100. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  101. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  102. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  103. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  104. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  105. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  106. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  107. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-session-bridge.ts +257 -0
  108. package/.versions/0.0.10/.pi/harnesses/agent-hub/package.json +7 -0
  109. package/.versions/0.0.10/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
  110. package/.versions/0.0.10/.pi/harnesses/agent-hub/research-retention.js +34 -0
  111. package/.versions/0.0.10/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  112. package/.versions/0.0.10/.pi/harnesses/agent-hub/return-contract.js +293 -0
  113. package/.versions/0.0.10/.pi/harnesses/agent-hub/return-extract.js +75 -0
  114. package/.versions/0.0.10/.pi/harnesses/agent-hub/review-findings.js +102 -0
  115. package/.versions/0.0.10/.pi/harnesses/agent-hub/run-budget.js +479 -0
  116. package/.versions/0.0.10/.pi/harnesses/agent-hub/run-namespace.js +87 -0
  117. package/.versions/0.0.10/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  118. package/.versions/0.0.10/.pi/harnesses/agent-hub/scope-gate.js +103 -0
  119. package/.versions/0.0.10/.pi/harnesses/agent-hub/session-health.js +110 -0
  120. package/.versions/0.0.10/.pi/harnesses/agent-hub/spawn.ts +354 -0
  121. package/.versions/0.0.10/.pi/harnesses/agent-hub/version.ts +42 -0
  122. package/.versions/0.0.10/.pi/harnesses/ask-user-remote/README.md +19 -0
  123. package/.versions/0.0.10/.pi/harnesses/ask-user-remote/index.ts +321 -0
  124. package/.versions/0.0.10/.pi/harnesses/ask-user-remote/race-core.js +106 -0
  125. package/.versions/0.0.10/.pi/harnesses/coms/README.md +100 -0
  126. package/.versions/0.0.10/.pi/harnesses/coms/index.ts +1767 -0
  127. package/.versions/0.0.10/.pi/harnesses/coms/package.json +7 -0
  128. package/.versions/0.0.10/.pi/harnesses/coms/version.ts +42 -0
  129. package/.versions/0.0.10/.pi/harnesses/damage-control-continue/README.md +124 -0
  130. package/.versions/0.0.10/.pi/harnesses/damage-control-continue/index.ts +536 -0
  131. package/.versions/0.0.10/.pi/harnesses/damage-control-continue/package.json +7 -0
  132. package/.versions/0.0.10/.pi/harnesses/damage-control-continue/version.ts +42 -0
  133. package/.versions/0.0.10/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
  134. package/.versions/0.0.10/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  135. package/.versions/0.0.10/.pi/harnesses/lib/herdr-client.ts +472 -0
  136. package/.versions/0.0.10/.pi/harnesses/lib/herdr-presence.ts +399 -0
  137. package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  138. package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  139. package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  140. package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  141. package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  142. package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  143. package/.versions/0.0.10/.pi/harnesses/lib/spawned-peers.js +190 -0
  144. package/.versions/0.0.10/.pi/harnesses/package-lock.json +35 -0
  145. package/.versions/0.0.10/.pi/harnesses/package.json +9 -0
  146. package/.versions/0.0.10/.pi/prompts/af-build.md +24 -0
  147. package/.versions/0.0.10/.pi/prompts/af-code-simplify.md +22 -0
  148. package/.versions/0.0.10/.pi/prompts/af-doctor-agent-fleet.md +22 -0
  149. package/.versions/0.0.10/.pi/prompts/af-plan.md +16 -0
  150. package/.versions/0.0.10/.pi/prompts/af-review.md +16 -0
  151. package/.versions/0.0.10/.pi/prompts/af-set-hermes-telegram.md +15 -0
  152. package/.versions/0.0.10/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  153. package/.versions/0.0.10/.pi/prompts/af-setup-agent-fleet.md +19 -0
  154. package/.versions/0.0.10/.pi/prompts/af-ship.md +17 -0
  155. package/.versions/0.0.10/.pi/prompts/af-spec.md +15 -0
  156. package/.versions/0.0.10/.pi/prompts/af-test.md +19 -0
  157. package/.versions/0.0.10/.pi/skills/bowser/SKILL.md +145 -0
  158. package/.versions/0.0.10/.version +1 -0
  159. package/.versions/0.0.10/agents/architect.md +24 -0
  160. package/.versions/0.0.10/agents/bowser.md +27 -0
  161. package/.versions/0.0.10/agents/builder.md +54 -0
  162. package/.versions/0.0.10/agents/code-reviewer.md +208 -0
  163. package/.versions/0.0.10/agents/deep-researcher.md +32 -0
  164. package/.versions/0.0.10/agents/documenter.md +18 -0
  165. package/.versions/0.0.10/agents/orchestrator.md +72 -0
  166. package/.versions/0.0.10/agents/plan-reviewer.md +83 -0
  167. package/.versions/0.0.10/agents/planner.md +70 -0
  168. package/.versions/0.0.10/agents/releaser.md +24 -0
  169. package/.versions/0.0.10/agents/researcher.md +28 -0
  170. package/.versions/0.0.10/agents/security-auditor.md +167 -0
  171. package/.versions/0.0.10/agents/test-engineer.md +153 -0
  172. package/.versions/0.0.10/agents/web-debugger.md +43 -0
  173. package/.versions/0.0.10/agents/web-performance-auditor.md +193 -0
  174. package/.versions/0.0.10/codex/CONDUCTOR.md +148 -0
  175. package/.versions/0.0.10/docs/ARCHITECTURE.md +303 -0
  176. package/.versions/0.0.10/docs/agent-fleet-setup.md +377 -0
  177. package/.versions/0.0.10/docs/claude-code-coms-bridge.md +109 -0
  178. package/.versions/0.0.10/docs/codex-remote-conductor.md +170 -0
  179. package/.versions/0.0.10/docs/coms-hermes-bridge.md +189 -0
  180. package/.versions/0.0.10/docs/getting-started.md +254 -0
  181. package/.versions/0.0.10/docs/npm-install.md +514 -0
  182. package/.versions/0.0.10/docs/opencode-setup.md +281 -0
  183. package/.versions/0.0.10/docs/pi-extensions.md +363 -0
  184. package/.versions/0.0.10/docs/pi-setup.md +571 -0
  185. package/.versions/0.0.10/docs/skill-anatomy.md +150 -0
  186. package/.versions/0.0.10/hermes/README.md +347 -0
  187. package/.versions/0.0.10/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  188. package/.versions/0.0.10/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  189. package/.versions/0.0.10/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  190. package/.versions/0.0.10/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  191. package/.versions/0.0.10/hermes/gates/gate-o-capability.md +8 -0
  192. package/.versions/0.0.10/hermes/gates/gate-o-validator-fixtures.json +1 -0
  193. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +770 -0
  194. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  195. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  196. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  197. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  198. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  199. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  200. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  201. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  202. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  203. package/.versions/0.0.10/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  204. package/.versions/0.0.10/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  205. package/.versions/0.0.10/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  206. package/.versions/0.0.10/hermes/skills/hub-conductor/SKILL.md +84 -0
  207. package/.versions/0.0.10/hermes/skills/hub-liaison/SKILL.md +84 -0
  208. package/.versions/0.0.10/hermes/skills/hub-watchdog/SKILL.md +76 -0
  209. package/.versions/0.0.10/hermes/skills/hub-watchdog/manifest.json +1 -0
  210. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  211. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  212. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  213. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  214. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  215. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  216. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  217. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  218. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  219. package/.versions/0.0.10/hermes/watchdog-tests/__init__.py +0 -0
  220. package/.versions/0.0.10/hooks/SIMPLIFY-IGNORE.md +90 -0
  221. package/.versions/0.0.10/hooks/coms-stop-hook.mjs +84 -0
  222. package/.versions/0.0.10/hooks/hooks.json +14 -0
  223. package/.versions/0.0.10/hooks/session-start.sh +74 -0
  224. package/.versions/0.0.10/hooks/simplify-ignore.sh +302 -0
  225. package/.versions/0.0.10/install-manifest.json +3615 -0
  226. package/.versions/0.0.10/justfile +254 -0
  227. package/.versions/0.0.10/manifest-meta.json +472 -0
  228. package/.versions/0.0.10/references/accessibility-checklist.md +160 -0
  229. package/.versions/0.0.10/references/definition-of-done.md +67 -0
  230. package/.versions/0.0.10/references/fleet-coordination-patterns.md +151 -0
  231. package/.versions/0.0.10/references/observability-checklist.md +91 -0
  232. package/.versions/0.0.10/references/orchestration-patterns.md +370 -0
  233. package/.versions/0.0.10/references/performance-checklist.md +153 -0
  234. package/.versions/0.0.10/references/prompting-patterns.md +380 -0
  235. package/.versions/0.0.10/references/security-checklist.md +179 -0
  236. package/.versions/0.0.10/references/testing-patterns.md +236 -0
  237. package/.versions/0.0.10/scripts/codex-conductor.ts +41 -0
  238. package/.versions/0.0.10/scripts/codex-remote-control.ts +167 -0
  239. package/.versions/0.0.10/scripts/coms-claude-bridge.ts +401 -0
  240. package/.versions/0.0.10/scripts/coms-cli.ts +484 -0
  241. package/.versions/0.0.10/scripts/coms-hermes-bridge.ts +413 -0
  242. package/.versions/0.0.10/scripts/fleet.ts +168 -0
  243. package/.versions/0.0.10/scripts/hermes-monitor-capability-runner.ts +25 -0
  244. package/.versions/0.0.10/scripts/hermes-monitor-scenario.ts +474 -0
  245. package/.versions/0.0.10/scripts/hermes-watchdog-capability-probe.ts +45 -0
  246. package/.versions/0.0.10/scripts/install-hermes-plugin.sh +180 -0
  247. package/.versions/0.0.10/scripts/lib/claude-bridge-core.ts +165 -0
  248. package/.versions/0.0.10/scripts/lib/codex-conductor.ts +88 -0
  249. package/.versions/0.0.10/scripts/lib/codex-remote-control.ts +480 -0
  250. package/.versions/0.0.10/scripts/lib/coms-envelope.ts +582 -0
  251. package/.versions/0.0.10/scripts/lib/fake-herdr-server.ts +88 -0
  252. package/.versions/0.0.10/scripts/lib/fleet-command.ts +111 -0
  253. package/.versions/0.0.10/scripts/lib/herdr-layout.ts +281 -0
  254. package/.versions/0.0.10/scripts/lib/hermes-bridge-core.ts +241 -0
  255. package/.versions/0.0.10/scripts/lib/hermes-monitor-events.ts +1 -0
  256. package/.versions/0.0.10/scripts/lib/hermes-monitor-herdr.ts +2 -0
  257. package/.versions/0.0.10/scripts/lib/hermes-monitor-model.ts +3 -0
  258. package/.versions/0.0.10/scripts/lib/hermes-monitor-registry.ts +2 -0
  259. package/.versions/0.0.10/scripts/lib/hermes-monitor-socket.ts +2 -0
  260. package/.versions/0.0.10/scripts/lib/hermes-monitor-store.ts +2 -0
  261. package/.versions/0.0.10/scripts/lib/monitor-env.ts +120 -0
  262. package/.versions/0.0.10/scripts/lib/peer-launch.ts +314 -0
  263. package/.versions/0.0.10/scripts/lib/persona-banner.ts +62 -0
  264. package/.versions/0.0.10/scripts/lib/spawn-stagger.ts +101 -0
  265. package/.versions/0.0.10/scripts/lib/team-project.ts +193 -0
  266. package/.versions/0.0.10/scripts/lib/team-snapshot.ts +147 -0
  267. package/.versions/0.0.10/scripts/peer-banner.ts +40 -0
  268. package/.versions/0.0.10/scripts/peer-launch.ts +259 -0
  269. package/.versions/0.0.10/scripts/team-snapshot.ts +237 -0
  270. package/.versions/0.0.10/scripts/team-up.ts +360 -0
  271. package/.versions/0.0.10/skills/_internal/grilling.md +11 -0
  272. package/.versions/0.0.10/skills/browser-testing-with-devtools/SKILL.md +351 -0
  273. package/.versions/0.0.10/skills/code-review-and-quality/SKILL.md +381 -0
  274. package/.versions/0.0.10/skills/compound-learning/SKILL.md +137 -0
  275. package/.versions/0.0.10/skills/context-engineering/SKILL.md +291 -0
  276. package/.versions/0.0.10/skills/deprecation-and-migration/SKILL.md +206 -0
  277. package/.versions/0.0.10/skills/designing-agents/SKILL.md +394 -0
  278. package/.versions/0.0.10/skills/designing-agents/pi-harness-authoring.md +222 -0
  279. package/.versions/0.0.10/skills/frontend-ui-engineering/SKILL.md +328 -0
  280. package/.versions/0.0.10/skills/git-workflow-and-versioning/SKILL.md +316 -0
  281. package/.versions/0.0.10/skills/guided-workspace-setup/SKILL.md +226 -0
  282. package/.versions/0.0.10/skills/guided-workspace-setup/companion-manifest.json +38 -0
  283. package/.versions/0.0.10/skills/idea-refine/SKILL.md +182 -0
  284. package/.versions/0.0.10/skills/idea-refine/examples.md +238 -0
  285. package/.versions/0.0.10/skills/idea-refine/frameworks.md +99 -0
  286. package/.versions/0.0.10/skills/idea-refine/refinement-criteria.md +113 -0
  287. package/.versions/0.0.10/skills/idea-refine/scripts/idea-refine.sh +15 -0
  288. package/.versions/0.0.10/skills/incremental-implementation/SKILL.md +287 -0
  289. package/.versions/0.0.10/skills/interview-me/SKILL.md +226 -0
  290. package/.versions/0.0.10/skills/orchestration-verification/SKILL.md +181 -0
  291. package/.versions/0.0.10/skills/peer-coms/SKILL.md +90 -0
  292. package/.versions/0.0.10/skills/performance-optimization/SKILL.md +350 -0
  293. package/.versions/0.0.10/skills/planning-and-task-breakdown/SKILL.md +254 -0
  294. package/.versions/0.0.10/skills/security-and-hardening/SKILL.md +461 -0
  295. package/.versions/0.0.10/skills/spec-driven-development/SKILL.md +257 -0
  296. package/.versions/0.0.10/skills/using-agent-skills/SKILL.md +199 -0
  297. package/.versions/0.0.10/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
  298. package/.versions/0.0.10/vendor/agent-skills-upstream/LICENSE +21 -0
  299. package/.versions/0.0.10/vendor/agent-skills-upstream/README.md +11 -0
  300. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
  301. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  302. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  303. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  304. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  305. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
  306. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  307. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  308. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
  309. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  310. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  311. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  312. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  313. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  314. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  315. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  316. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  317. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  318. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  319. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
  320. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
  321. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
  322. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
  323. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
  324. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
  325. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
  326. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
  327. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
  328. package/.versions/0.0.11/.claude/commands/build.md +44 -0
  329. package/.versions/0.0.11/.claude/commands/code-simplify.md +22 -0
  330. package/.versions/0.0.11/.claude/commands/design-agent.md +14 -0
  331. package/.versions/0.0.11/.claude/commands/doctor-agent-fleet.md +22 -0
  332. package/.versions/0.0.11/.claude/commands/orchestrate.md +112 -0
  333. package/.versions/0.0.11/.claude/commands/plan.md +16 -0
  334. package/.versions/0.0.11/.claude/commands/prime.md +22 -0
  335. package/.versions/0.0.11/.claude/commands/review.md +16 -0
  336. package/.versions/0.0.11/.claude/commands/set-hermes-telegram.md +15 -0
  337. package/.versions/0.0.11/.claude/commands/set-hermes-watchdog.md +6 -0
  338. package/.versions/0.0.11/.claude/commands/setup-agent-fleet.md +17 -0
  339. package/.versions/0.0.11/.claude/commands/ship.md +72 -0
  340. package/.versions/0.0.11/.claude/commands/spec.md +15 -0
  341. package/.versions/0.0.11/.claude/commands/test.md +19 -0
  342. package/.versions/0.0.11/.claude/commands/webperf.md +32 -0
  343. package/.versions/0.0.11/.claude/orchestrate-teams.yaml +24 -0
  344. package/.versions/0.0.11/.opencode/commands/af-build.md +17 -0
  345. package/.versions/0.0.11/.opencode/commands/af-code-simplify.md +16 -0
  346. package/.versions/0.0.11/.opencode/commands/af-compound.md +16 -0
  347. package/.versions/0.0.11/.opencode/commands/af-design-agent.md +15 -0
  348. package/.versions/0.0.11/.opencode/commands/af-doctor-agent-fleet.md +22 -0
  349. package/.versions/0.0.11/.opencode/commands/af-orchestrate.md +112 -0
  350. package/.versions/0.0.11/.opencode/commands/af-plan.md +16 -0
  351. package/.versions/0.0.11/.opencode/commands/af-prime.md +22 -0
  352. package/.versions/0.0.11/.opencode/commands/af-review.md +15 -0
  353. package/.versions/0.0.11/.opencode/commands/af-set-hermes-telegram.md +15 -0
  354. package/.versions/0.0.11/.opencode/commands/af-set-hermes-watchdog.md +6 -0
  355. package/.versions/0.0.11/.opencode/commands/af-setup-agent-fleet.md +17 -0
  356. package/.versions/0.0.11/.opencode/commands/af-ship.md +16 -0
  357. package/.versions/0.0.11/.opencode/commands/af-spec.md +16 -0
  358. package/.versions/0.0.11/.opencode/commands/af-test.md +21 -0
  359. package/.versions/0.0.11/.opencode/commands/af-webperf.md +32 -0
  360. package/.versions/0.0.11/.opencode/orchestrate-teams.yaml +24 -0
  361. package/.versions/0.0.11/.pi/agents/dispatch-policy.yaml +32 -0
  362. package/.versions/0.0.11/.pi/agents/model-profiles.yaml +27 -0
  363. package/.versions/0.0.11/.pi/agents/peers.yaml +142 -0
  364. package/.versions/0.0.11/.pi/agents/teams.yaml +41 -0
  365. package/.versions/0.0.11/.pi/damage-control-rules.yaml +297 -0
  366. package/.versions/0.0.11/.pi/extensions/agent-fleet-update-check/README.md +57 -0
  367. package/.versions/0.0.11/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
  368. package/.versions/0.0.11/.pi/extensions/agent-fleet-update-check/package.json +6 -0
  369. package/.versions/0.0.11/.pi/extensions/btw/README.md +119 -0
  370. package/.versions/0.0.11/.pi/extensions/btw/index.ts +917 -0
  371. package/.versions/0.0.11/.pi/extensions/btw/package.json +6 -0
  372. package/.versions/0.0.11/.pi/extensions/btw/state.js +179 -0
  373. package/.versions/0.0.11/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  374. package/.versions/0.0.11/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  375. package/.versions/0.0.11/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  376. package/.versions/0.0.11/.pi/extensions/compact-and-continue/README.md +42 -0
  377. package/.versions/0.0.11/.pi/extensions/compact-and-continue/index.ts +120 -0
  378. package/.versions/0.0.11/.pi/extensions/compact-and-continue/package.json +6 -0
  379. package/.versions/0.0.11/.pi/extensions/mcp-bridge/README.md +46 -0
  380. package/.versions/0.0.11/.pi/extensions/mcp-bridge/index.ts +206 -0
  381. package/.versions/0.0.11/.pi/extensions/mcp-bridge/package.json +6 -0
  382. package/.versions/0.0.11/.pi/extensions/package-lock.json +1143 -0
  383. package/.versions/0.0.11/.pi/extensions/package.json +9 -0
  384. package/.versions/0.0.11/.pi/extensions/pi-voice-stt/README.md +204 -0
  385. package/.versions/0.0.11/.pi/extensions/pi-voice-stt/config.ts +198 -0
  386. package/.versions/0.0.11/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  387. package/.versions/0.0.11/.pi/extensions/pi-voice-stt/index.ts +248 -0
  388. package/.versions/0.0.11/.pi/extensions/pi-voice-stt/package.json +6 -0
  389. package/.versions/0.0.11/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  390. package/.versions/0.0.11/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  391. package/.versions/0.0.11/.pi/harnesses/agent-hub/README.md +1004 -0
  392. package/.versions/0.0.11/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  393. package/.versions/0.0.11/.pi/harnesses/agent-hub/artifacts.js +146 -0
  394. package/.versions/0.0.11/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
  395. package/.versions/0.0.11/.pi/harnesses/agent-hub/backend-policy.js +153 -0
  396. package/.versions/0.0.11/.pi/harnesses/agent-hub/context-window.js +106 -0
  397. package/.versions/0.0.11/.pi/harnesses/agent-hub/delegate.ts +435 -0
  398. package/.versions/0.0.11/.pi/harnesses/agent-hub/docs-lane.js +122 -0
  399. package/.versions/0.0.11/.pi/harnesses/agent-hub/drift-watchdog.js +211 -0
  400. package/.versions/0.0.11/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  401. package/.versions/0.0.11/.pi/harnesses/agent-hub/external-blocker.js +85 -0
  402. package/.versions/0.0.11/.pi/harnesses/agent-hub/footer.ts +31 -0
  403. package/.versions/0.0.11/.pi/harnesses/agent-hub/helpers.ts +248 -0
  404. package/.versions/0.0.11/.pi/harnesses/agent-hub/index.ts +9111 -0
  405. package/.versions/0.0.11/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  406. package/.versions/0.0.11/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  407. package/.versions/0.0.11/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  408. package/.versions/0.0.11/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  409. package/.versions/0.0.11/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  410. package/.versions/0.0.11/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  411. package/.versions/0.0.11/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  412. package/.versions/0.0.11/.pi/harnesses/agent-hub/monitor-session-bridge.ts +257 -0
  413. package/.versions/0.0.11/.pi/harnesses/agent-hub/package.json +7 -0
  414. package/.versions/0.0.11/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
  415. package/.versions/0.0.11/.pi/harnesses/agent-hub/research-retention.js +34 -0
  416. package/.versions/0.0.11/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  417. package/.versions/0.0.11/.pi/harnesses/agent-hub/return-contract.js +293 -0
  418. package/.versions/0.0.11/.pi/harnesses/agent-hub/return-extract.js +75 -0
  419. package/.versions/0.0.11/.pi/harnesses/agent-hub/review-findings.js +102 -0
  420. package/.versions/0.0.11/.pi/harnesses/agent-hub/run-budget.js +479 -0
  421. package/.versions/0.0.11/.pi/harnesses/agent-hub/run-namespace.js +87 -0
  422. package/.versions/0.0.11/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  423. package/.versions/0.0.11/.pi/harnesses/agent-hub/scope-gate.js +103 -0
  424. package/.versions/0.0.11/.pi/harnesses/agent-hub/session-health.js +110 -0
  425. package/.versions/0.0.11/.pi/harnesses/agent-hub/spawn.ts +354 -0
  426. package/.versions/0.0.11/.pi/harnesses/agent-hub/version.ts +42 -0
  427. package/.versions/0.0.11/.pi/harnesses/ask-user-remote/README.md +19 -0
  428. package/.versions/0.0.11/.pi/harnesses/ask-user-remote/index.ts +321 -0
  429. package/.versions/0.0.11/.pi/harnesses/ask-user-remote/race-core.js +106 -0
  430. package/.versions/0.0.11/.pi/harnesses/coms/README.md +100 -0
  431. package/.versions/0.0.11/.pi/harnesses/coms/index.ts +1767 -0
  432. package/.versions/0.0.11/.pi/harnesses/coms/package.json +7 -0
  433. package/.versions/0.0.11/.pi/harnesses/coms/version.ts +42 -0
  434. package/.versions/0.0.11/.pi/harnesses/damage-control-continue/README.md +124 -0
  435. package/.versions/0.0.11/.pi/harnesses/damage-control-continue/index.ts +536 -0
  436. package/.versions/0.0.11/.pi/harnesses/damage-control-continue/package.json +7 -0
  437. package/.versions/0.0.11/.pi/harnesses/damage-control-continue/version.ts +42 -0
  438. package/.versions/0.0.11/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
  439. package/.versions/0.0.11/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  440. package/.versions/0.0.11/.pi/harnesses/lib/herdr-client.ts +472 -0
  441. package/.versions/0.0.11/.pi/harnesses/lib/herdr-presence.ts +399 -0
  442. package/.versions/0.0.11/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  443. package/.versions/0.0.11/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  444. package/.versions/0.0.11/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  445. package/.versions/0.0.11/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  446. package/.versions/0.0.11/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  447. package/.versions/0.0.11/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  448. package/.versions/0.0.11/.pi/harnesses/lib/spawned-peers.js +190 -0
  449. package/.versions/0.0.11/.pi/harnesses/package-lock.json +35 -0
  450. package/.versions/0.0.11/.pi/harnesses/package.json +9 -0
  451. package/.versions/0.0.11/.pi/prompts/af-build.md +24 -0
  452. package/.versions/0.0.11/.pi/prompts/af-code-simplify.md +22 -0
  453. package/.versions/0.0.11/.pi/prompts/af-doctor-agent-fleet.md +22 -0
  454. package/.versions/0.0.11/.pi/prompts/af-plan.md +16 -0
  455. package/.versions/0.0.11/.pi/prompts/af-review.md +16 -0
  456. package/.versions/0.0.11/.pi/prompts/af-set-hermes-telegram.md +15 -0
  457. package/.versions/0.0.11/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  458. package/.versions/0.0.11/.pi/prompts/af-setup-agent-fleet.md +19 -0
  459. package/.versions/0.0.11/.pi/prompts/af-ship.md +17 -0
  460. package/.versions/0.0.11/.pi/prompts/af-spec.md +15 -0
  461. package/.versions/0.0.11/.pi/prompts/af-test.md +19 -0
  462. package/.versions/0.0.11/.pi/skills/bowser/SKILL.md +145 -0
  463. package/.versions/0.0.11/.version +1 -0
  464. package/.versions/0.0.11/agents/architect.md +24 -0
  465. package/.versions/0.0.11/agents/bowser.md +27 -0
  466. package/.versions/0.0.11/agents/builder.md +54 -0
  467. package/.versions/0.0.11/agents/code-reviewer.md +208 -0
  468. package/.versions/0.0.11/agents/deep-researcher.md +32 -0
  469. package/.versions/0.0.11/agents/documenter.md +18 -0
  470. package/.versions/0.0.11/agents/orchestrator.md +72 -0
  471. package/.versions/0.0.11/agents/plan-reviewer.md +83 -0
  472. package/.versions/0.0.11/agents/planner.md +70 -0
  473. package/.versions/0.0.11/agents/releaser.md +24 -0
  474. package/.versions/0.0.11/agents/researcher.md +28 -0
  475. package/.versions/0.0.11/agents/security-auditor.md +167 -0
  476. package/.versions/0.0.11/agents/test-engineer.md +153 -0
  477. package/.versions/0.0.11/agents/web-debugger.md +43 -0
  478. package/.versions/0.0.11/agents/web-performance-auditor.md +193 -0
  479. package/.versions/0.0.11/codex/CONDUCTOR.md +148 -0
  480. package/.versions/0.0.11/docs/ARCHITECTURE.md +303 -0
  481. package/.versions/0.0.11/docs/agent-fleet-setup.md +377 -0
  482. package/.versions/0.0.11/docs/claude-code-coms-bridge.md +109 -0
  483. package/.versions/0.0.11/docs/codex-remote-conductor.md +170 -0
  484. package/.versions/0.0.11/docs/coms-hermes-bridge.md +189 -0
  485. package/.versions/0.0.11/docs/getting-started.md +254 -0
  486. package/.versions/0.0.11/docs/npm-install.md +514 -0
  487. package/.versions/0.0.11/docs/opencode-setup.md +281 -0
  488. package/.versions/0.0.11/docs/pi-extensions.md +368 -0
  489. package/.versions/0.0.11/docs/pi-setup.md +571 -0
  490. package/.versions/0.0.11/docs/skill-anatomy.md +150 -0
  491. package/.versions/0.0.11/hermes/README.md +347 -0
  492. package/.versions/0.0.11/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  493. package/.versions/0.0.11/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  494. package/.versions/0.0.11/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  495. package/.versions/0.0.11/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  496. package/.versions/0.0.11/hermes/gates/gate-o-capability.md +8 -0
  497. package/.versions/0.0.11/hermes/gates/gate-o-validator-fixtures.json +1 -0
  498. package/.versions/0.0.11/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +770 -0
  499. package/.versions/0.0.11/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  500. package/.versions/0.0.11/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  501. package/.versions/0.0.11/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  502. package/.versions/0.0.11/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  503. package/.versions/0.0.11/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  504. package/.versions/0.0.11/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  505. package/.versions/0.0.11/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  506. package/.versions/0.0.11/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  507. package/.versions/0.0.11/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  508. package/.versions/0.0.11/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  509. package/.versions/0.0.11/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  510. package/.versions/0.0.11/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  511. package/.versions/0.0.11/hermes/skills/hub-conductor/SKILL.md +84 -0
  512. package/.versions/0.0.11/hermes/skills/hub-liaison/SKILL.md +84 -0
  513. package/.versions/0.0.11/hermes/skills/hub-watchdog/SKILL.md +76 -0
  514. package/.versions/0.0.11/hermes/skills/hub-watchdog/manifest.json +1 -0
  515. package/.versions/0.0.11/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  516. package/.versions/0.0.11/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  517. package/.versions/0.0.11/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  518. package/.versions/0.0.11/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  519. package/.versions/0.0.11/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  520. package/.versions/0.0.11/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  521. package/.versions/0.0.11/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  522. package/.versions/0.0.11/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  523. package/.versions/0.0.11/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  524. package/.versions/0.0.11/hermes/watchdog-tests/__init__.py +0 -0
  525. package/.versions/0.0.11/hooks/SIMPLIFY-IGNORE.md +90 -0
  526. package/.versions/0.0.11/hooks/coms-stop-hook.mjs +84 -0
  527. package/.versions/0.0.11/hooks/hooks.json +14 -0
  528. package/.versions/0.0.11/hooks/session-start.sh +74 -0
  529. package/.versions/0.0.11/hooks/simplify-ignore.sh +302 -0
  530. package/.versions/0.0.11/install-manifest.json +3615 -0
  531. package/.versions/0.0.11/justfile +254 -0
  532. package/.versions/0.0.11/manifest-meta.json +472 -0
  533. package/.versions/0.0.11/references/accessibility-checklist.md +160 -0
  534. package/.versions/0.0.11/references/definition-of-done.md +67 -0
  535. package/.versions/0.0.11/references/fleet-coordination-patterns.md +151 -0
  536. package/.versions/0.0.11/references/observability-checklist.md +91 -0
  537. package/.versions/0.0.11/references/orchestration-patterns.md +370 -0
  538. package/.versions/0.0.11/references/performance-checklist.md +153 -0
  539. package/.versions/0.0.11/references/prompting-patterns.md +380 -0
  540. package/.versions/0.0.11/references/security-checklist.md +179 -0
  541. package/.versions/0.0.11/references/testing-patterns.md +236 -0
  542. package/.versions/0.0.11/scripts/codex-conductor.ts +41 -0
  543. package/.versions/0.0.11/scripts/codex-remote-control.ts +167 -0
  544. package/.versions/0.0.11/scripts/coms-claude-bridge.ts +401 -0
  545. package/.versions/0.0.11/scripts/coms-cli.ts +484 -0
  546. package/.versions/0.0.11/scripts/coms-hermes-bridge.ts +413 -0
  547. package/.versions/0.0.11/scripts/fleet.ts +168 -0
  548. package/.versions/0.0.11/scripts/hermes-monitor-capability-runner.ts +25 -0
  549. package/.versions/0.0.11/scripts/hermes-monitor-scenario.ts +474 -0
  550. package/.versions/0.0.11/scripts/hermes-watchdog-capability-probe.ts +45 -0
  551. package/.versions/0.0.11/scripts/install-hermes-plugin.sh +180 -0
  552. package/.versions/0.0.11/scripts/lib/claude-bridge-core.ts +165 -0
  553. package/.versions/0.0.11/scripts/lib/codex-conductor.ts +88 -0
  554. package/.versions/0.0.11/scripts/lib/codex-remote-control.ts +480 -0
  555. package/.versions/0.0.11/scripts/lib/coms-envelope.ts +582 -0
  556. package/.versions/0.0.11/scripts/lib/fake-herdr-server.ts +88 -0
  557. package/.versions/0.0.11/scripts/lib/fleet-command.ts +111 -0
  558. package/.versions/0.0.11/scripts/lib/herdr-layout.ts +281 -0
  559. package/.versions/0.0.11/scripts/lib/hermes-bridge-core.ts +241 -0
  560. package/.versions/0.0.11/scripts/lib/hermes-monitor-events.ts +1 -0
  561. package/.versions/0.0.11/scripts/lib/hermes-monitor-herdr.ts +2 -0
  562. package/.versions/0.0.11/scripts/lib/hermes-monitor-model.ts +3 -0
  563. package/.versions/0.0.11/scripts/lib/hermes-monitor-registry.ts +2 -0
  564. package/.versions/0.0.11/scripts/lib/hermes-monitor-socket.ts +2 -0
  565. package/.versions/0.0.11/scripts/lib/hermes-monitor-store.ts +2 -0
  566. package/.versions/0.0.11/scripts/lib/monitor-env.ts +134 -0
  567. package/.versions/0.0.11/scripts/lib/peer-launch.ts +314 -0
  568. package/.versions/0.0.11/scripts/lib/persona-banner.ts +62 -0
  569. package/.versions/0.0.11/scripts/lib/spawn-stagger.ts +101 -0
  570. package/.versions/0.0.11/scripts/lib/team-project.ts +193 -0
  571. package/.versions/0.0.11/scripts/lib/team-snapshot.ts +147 -0
  572. package/.versions/0.0.11/scripts/peer-banner.ts +40 -0
  573. package/.versions/0.0.11/scripts/peer-launch.ts +259 -0
  574. package/.versions/0.0.11/scripts/team-snapshot.ts +237 -0
  575. package/.versions/0.0.11/scripts/team-up.ts +360 -0
  576. package/.versions/0.0.11/skills/_internal/grilling.md +11 -0
  577. package/.versions/0.0.11/skills/browser-testing-with-devtools/SKILL.md +351 -0
  578. package/.versions/0.0.11/skills/code-review-and-quality/SKILL.md +381 -0
  579. package/.versions/0.0.11/skills/compound-learning/SKILL.md +137 -0
  580. package/.versions/0.0.11/skills/context-engineering/SKILL.md +291 -0
  581. package/.versions/0.0.11/skills/deprecation-and-migration/SKILL.md +206 -0
  582. package/.versions/0.0.11/skills/designing-agents/SKILL.md +394 -0
  583. package/.versions/0.0.11/skills/designing-agents/pi-harness-authoring.md +222 -0
  584. package/.versions/0.0.11/skills/frontend-ui-engineering/SKILL.md +328 -0
  585. package/.versions/0.0.11/skills/git-workflow-and-versioning/SKILL.md +316 -0
  586. package/.versions/0.0.11/skills/guided-workspace-setup/SKILL.md +226 -0
  587. package/.versions/0.0.11/skills/guided-workspace-setup/companion-manifest.json +38 -0
  588. package/.versions/0.0.11/skills/idea-refine/SKILL.md +182 -0
  589. package/.versions/0.0.11/skills/idea-refine/examples.md +238 -0
  590. package/.versions/0.0.11/skills/idea-refine/frameworks.md +99 -0
  591. package/.versions/0.0.11/skills/idea-refine/refinement-criteria.md +113 -0
  592. package/.versions/0.0.11/skills/idea-refine/scripts/idea-refine.sh +15 -0
  593. package/.versions/0.0.11/skills/incremental-implementation/SKILL.md +287 -0
  594. package/.versions/0.0.11/skills/interview-me/SKILL.md +226 -0
  595. package/.versions/0.0.11/skills/orchestration-verification/SKILL.md +181 -0
  596. package/.versions/0.0.11/skills/peer-coms/SKILL.md +90 -0
  597. package/.versions/0.0.11/skills/performance-optimization/SKILL.md +350 -0
  598. package/.versions/0.0.11/skills/planning-and-task-breakdown/SKILL.md +254 -0
  599. package/.versions/0.0.11/skills/security-and-hardening/SKILL.md +461 -0
  600. package/.versions/0.0.11/skills/spec-driven-development/SKILL.md +257 -0
  601. package/.versions/0.0.11/skills/using-agent-skills/SKILL.md +199 -0
  602. package/.versions/0.0.11/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
  603. package/.versions/0.0.11/vendor/agent-skills-upstream/LICENSE +21 -0
  604. package/.versions/0.0.11/vendor/agent-skills-upstream/README.md +11 -0
  605. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
  606. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  607. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  608. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  609. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  610. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
  611. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  612. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  613. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
  614. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  615. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  616. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  617. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  618. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  619. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  620. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  621. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  622. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  623. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  624. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
  625. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
  626. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
  627. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
  628. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
  629. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
  630. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
  631. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
  632. package/.versions/0.0.11/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
  633. package/CHANGELOG.md +110 -0
  634. package/README.md +22 -5
  635. package/agents/code-reviewer.md +4 -0
  636. package/agents/orchestrator.md +7 -1
  637. package/agents/plan-reviewer.md +22 -1
  638. package/bin/build-manifest.js +68 -0
  639. package/bin/cli.js +679 -49
  640. package/bin/lib/apply.js +641 -0
  641. package/bin/lib/manifest.js +731 -0
  642. package/bin/lib/merge-forms.js +106 -0
  643. package/bin/lib/plan.js +569 -0
  644. package/bin/lib/state.js +213 -0
  645. package/bin/lib/verify.js +576 -0
  646. package/bin/snapshot-version.js +5 -0
  647. package/docs/ARCHITECTURE.md +52 -11
  648. package/docs/agent-fleet-setup.md +59 -48
  649. package/docs/getting-started.md +29 -6
  650. package/docs/npm-install.md +208 -31
  651. package/docs/opencode-setup.md +32 -0
  652. package/docs/pi-extensions.md +22 -10
  653. package/docs/pi-setup.md +164 -69
  654. package/install-manifest.json +3615 -0
  655. package/manifest-meta.json +472 -0
  656. package/package.json +8 -3
  657. package/scripts/lib/monitor-env.ts +15 -1
  658. package/skills/browser-testing-with-devtools/SKILL.md +3 -4
  659. package/skills/guided-workspace-setup/SKILL.md +172 -490
  660. package/skills/planning-and-task-breakdown/SKILL.md +18 -0
  661. package/skills/spec-driven-development/SKILL.md +12 -0
@@ -0,0 +1,461 @@
1
+ ---
2
+ name: security-and-hardening
3
+ description: Hardens code against vulnerabilities. Use when handling user input, authentication, data storage, or external integrations. Use when building any feature that accepts untrusted data, manages user sessions, or interacts with third-party services.
4
+ ---
5
+
6
+ # Security and Hardening
7
+
8
+ ## Overview
9
+
10
+ Security-first development practices for web applications. Treat every external input as hostile, every secret as sacred, and every authorization check as mandatory. Security isn't a phase — it's a constraint on every line of code that touches user data, authentication, or external systems.
11
+
12
+ ## When to Use
13
+
14
+ - Building anything that accepts user input
15
+ - Implementing authentication or authorization
16
+ - Storing or transmitting sensitive data
17
+ - Integrating with external APIs or services
18
+ - Adding file uploads, webhooks, or callbacks
19
+ - Handling payment or PII data
20
+
21
+ ## Process: Threat Model First
22
+
23
+ Controls bolted on without a threat model are guesses. Before hardening, spend five minutes thinking like an attacker:
24
+
25
+ 1. **Map the trust boundaries.** Where does untrusted data cross into your system? HTTP requests, form fields, file uploads, webhooks, third-party APIs, message queues, and **LLM output**. Every boundary is attack surface.
26
+ 2. **Name the assets.** What's worth stealing or breaking? Credentials, PII, payment data, admin actions, money movement.
27
+ 3. **Run STRIDE over each boundary** — a quick lens, not a ceremony:
28
+
29
+ | Threat | Ask | Typical mitigation |
30
+ |---|---|---|
31
+ | **S**poofing | Can someone impersonate a user/service? | Authentication, signature verification |
32
+ | **T**ampering | Can data be altered in transit or at rest? | Integrity checks, parameterized queries, HTTPS |
33
+ | **R**epudiation | Can an action be denied later? | Audit logging of security events |
34
+ | **I**nformation disclosure | Can data leak? | Encryption, field allowlists, generic errors |
35
+ | **D**enial of service | Can it be overwhelmed? | Rate limiting, input size caps, timeouts |
36
+ | **E**levation of privilege | Can a user gain rights they shouldn't? | Authorization checks, least privilege |
37
+
38
+ 4. **Write abuse cases next to use cases.** For each feature, ask "how would I misuse this?" — then make that your first test.
39
+
40
+ If you can't name the trust boundaries for a feature, you're not ready to secure it. This is OWASP **A04: Insecure Design** — most breaches begin in design, not code.
41
+
42
+ ## The Three-Tier Boundary System
43
+
44
+ ### Always Do (No Exceptions)
45
+
46
+ - **Validate all external input** at the system boundary (API routes, form handlers)
47
+ - **Parameterize all database queries** — never concatenate user input into SQL
48
+ - **Encode output** to prevent XSS (use framework auto-escaping, don't bypass it)
49
+ - **Use HTTPS** for all external communication
50
+ - **Hash passwords** with bcrypt/scrypt/argon2 (never store plaintext)
51
+ - **Set security headers** (CSP, HSTS, X-Frame-Options, X-Content-Type-Options)
52
+ - **Use httpOnly, secure, sameSite cookies** for sessions
53
+ - **Run `npm audit`** (or equivalent) before every release
54
+
55
+ ### Ask First (Requires Human Approval)
56
+
57
+ - Adding new authentication flows or changing auth logic
58
+ - Storing new categories of sensitive data (PII, payment info)
59
+ - Adding new external service integrations
60
+ - Changing CORS configuration
61
+ - Adding file upload handlers
62
+ - Modifying rate limiting or throttling
63
+ - Granting elevated permissions or roles
64
+
65
+ ### Never Do
66
+
67
+ - **Never commit secrets** to version control (API keys, passwords, tokens)
68
+ - **Never log sensitive data** (passwords, tokens, full credit card numbers)
69
+ - **Never trust client-side validation** as a security boundary
70
+ - **Never disable security headers** for convenience
71
+ - **Never use `eval()` or `innerHTML`** with user-provided data
72
+ - **Never store sessions in client-accessible storage** (localStorage for auth tokens)
73
+ - **Never expose stack traces** or internal error details to users
74
+
75
+ ## OWASP Top 10 Prevention Patterns
76
+
77
+ These are prevention patterns, not a ranking. For the 2021 ordering, see the quick-reference table in `references/security-checklist.md`.
78
+
79
+ ### Injection (SQL, NoSQL, OS Command)
80
+
81
+ ```typescript
82
+ // BAD: SQL injection via string concatenation
83
+ const query = `SELECT * FROM users WHERE id = '${userId}'`;
84
+
85
+ // GOOD: Parameterized query
86
+ const user = await db.query('SELECT * FROM users WHERE id = $1', [userId]);
87
+
88
+ // GOOD: ORM with parameterized input
89
+ const user = await prisma.user.findUnique({ where: { id: userId } });
90
+ ```
91
+
92
+ ### Broken Authentication
93
+
94
+ ```typescript
95
+ // Password hashing
96
+ import { hash, compare } from 'bcrypt';
97
+
98
+ const SALT_ROUNDS = 12;
99
+ const hashedPassword = await hash(plaintext, SALT_ROUNDS);
100
+ const isValid = await compare(plaintext, hashedPassword);
101
+
102
+ // Session management
103
+ app.use(session({
104
+ secret: process.env.SESSION_SECRET, // From environment, not code
105
+ resave: false,
106
+ saveUninitialized: false,
107
+ cookie: {
108
+ httpOnly: true, // Not accessible via JavaScript
109
+ secure: true, // HTTPS only
110
+ sameSite: 'lax', // CSRF protection
111
+ maxAge: 24 * 60 * 60 * 1000, // 24 hours
112
+ },
113
+ }));
114
+ ```
115
+
116
+ ### Cross-Site Scripting (XSS)
117
+
118
+ ```typescript
119
+ // BAD: Rendering user input as HTML
120
+ element.innerHTML = userInput;
121
+
122
+ // GOOD: Use framework auto-escaping (React does this by default)
123
+ return <div>{userInput}</div>;
124
+
125
+ // If you MUST render HTML, sanitize first
126
+ import DOMPurify from 'dompurify';
127
+ const clean = DOMPurify.sanitize(userInput);
128
+ ```
129
+
130
+ ### Broken Access Control
131
+
132
+ ```typescript
133
+ // Always check authorization, not just authentication
134
+ app.patch('/api/tasks/:id', authenticate, async (req, res) => {
135
+ const task = await taskService.findById(req.params.id);
136
+
137
+ // Check that the authenticated user owns this resource
138
+ if (task.ownerId !== req.user.id) {
139
+ return res.status(403).json({
140
+ error: { code: 'FORBIDDEN', message: 'Not authorized to modify this task' }
141
+ });
142
+ }
143
+
144
+ // Proceed with update
145
+ const updated = await taskService.update(req.params.id, req.body);
146
+ return res.json(updated);
147
+ });
148
+ ```
149
+
150
+ ### Security Misconfiguration
151
+
152
+ ```typescript
153
+ // Security headers (use helmet for Express)
154
+ import helmet from 'helmet';
155
+ app.use(helmet());
156
+
157
+ // Content Security Policy
158
+ app.use(helmet.contentSecurityPolicy({
159
+ directives: {
160
+ defaultSrc: ["'self'"],
161
+ scriptSrc: ["'self'"],
162
+ styleSrc: ["'self'", "'unsafe-inline'"], // Tighten if possible
163
+ imgSrc: ["'self'", 'data:', 'https:'],
164
+ connectSrc: ["'self'"],
165
+ },
166
+ }));
167
+
168
+ // CORS — restrict to known origins
169
+ app.use(cors({
170
+ origin: process.env.ALLOWED_ORIGINS?.split(',') || 'http://localhost:3000',
171
+ credentials: true,
172
+ }));
173
+ ```
174
+
175
+ ### Sensitive Data Exposure
176
+
177
+ ```typescript
178
+ // Never return sensitive fields in API responses
179
+ function sanitizeUser(user: UserRecord): PublicUser {
180
+ const { passwordHash, resetToken, ...publicFields } = user;
181
+ return publicFields;
182
+ }
183
+
184
+ // Use environment variables for secrets
185
+ const API_KEY = process.env.STRIPE_API_KEY;
186
+ if (!API_KEY) throw new Error('STRIPE_API_KEY not configured');
187
+ ```
188
+
189
+ ### Server-Side Request Forgery (SSRF)
190
+
191
+ Any time the server fetches a URL the user influenced — webhooks, "import from URL", image proxies, link previews — an attacker can aim it at internal services (cloud metadata, `localhost`, private IPs).
192
+
193
+ ```typescript
194
+ // BAD: fetch whatever the user gives you
195
+ await fetch(req.body.webhookUrl);
196
+
197
+ // GOOD: allowlist scheme + host, reject if ANY resolved IP is private, forbid redirects
198
+ import { lookup } from 'node:dns/promises';
199
+ import ipaddr from 'ipaddr.js';
200
+
201
+ const ALLOWED_HOSTS = new Set(['hooks.example.com']);
202
+
203
+ async function assertSafeUrl(raw: string): Promise<URL> {
204
+ const url = new URL(raw);
205
+ if (url.protocol !== 'https:') throw new Error('https only');
206
+ if (!ALLOWED_HOSTS.has(url.hostname)) throw new Error('host not allowed');
207
+ // Resolve ALL records; a single private/reserved address fails the check.
208
+ const addrs = await lookup(url.hostname, { all: true });
209
+ if (addrs.some((a) => ipaddr.parse(a.address).range() !== 'unicast')) {
210
+ throw new Error('private/reserved IP');
211
+ }
212
+ return url;
213
+ }
214
+
215
+ await fetch(await assertSafeUrl(req.body.webhookUrl), { redirect: 'error' });
216
+ ```
217
+
218
+ The `range() !== 'unicast'` check covers loopback, link-local `169.254.169.254` (cloud metadata, the #1 SSRF target), private, and unique-local ranges across IPv4 and IPv6.
219
+
220
+ **Caveat — this still has a TOCTOU gap.** `fetch` resolves DNS again after the check, so an attacker using a short-TTL record can rebind to an internal IP between validation and connection. For high-risk surfaces, resolve once and connect to the pinned IP, or put a filtering agent in front (`request-filtering-agent` / `ssrf-req-filter`).
221
+
222
+ ## Input Validation Patterns
223
+
224
+ ### Schema Validation at Boundaries
225
+
226
+ ```typescript
227
+ import { z } from 'zod';
228
+
229
+ const CreateTaskSchema = z.object({
230
+ title: z.string().min(1).max(200).trim(),
231
+ description: z.string().max(2000).optional(),
232
+ priority: z.enum(['low', 'medium', 'high']).default('medium'),
233
+ dueDate: z.string().datetime().optional(),
234
+ });
235
+
236
+ // Validate at the route handler
237
+ app.post('/api/tasks', async (req, res) => {
238
+ const result = CreateTaskSchema.safeParse(req.body);
239
+ if (!result.success) {
240
+ return res.status(422).json({
241
+ error: {
242
+ code: 'VALIDATION_ERROR',
243
+ message: 'Invalid input',
244
+ details: result.error.flatten(),
245
+ },
246
+ });
247
+ }
248
+ // result.data is now typed and validated
249
+ const task = await taskService.create(result.data);
250
+ return res.status(201).json(task);
251
+ });
252
+ ```
253
+
254
+ ### File Upload Safety
255
+
256
+ ```typescript
257
+ // Restrict file types and sizes
258
+ const ALLOWED_TYPES = ['image/jpeg', 'image/png', 'image/webp'];
259
+ const MAX_SIZE = 5 * 1024 * 1024; // 5MB
260
+
261
+ function validateUpload(file: UploadedFile) {
262
+ if (!ALLOWED_TYPES.includes(file.mimetype)) {
263
+ throw new ValidationError('File type not allowed');
264
+ }
265
+ if (file.size > MAX_SIZE) {
266
+ throw new ValidationError('File too large (max 5MB)');
267
+ }
268
+ // Don't trust the file extension — check magic bytes if critical
269
+ }
270
+ ```
271
+
272
+ ## Triaging npm audit Results
273
+
274
+ Not all audit findings require immediate action. Use this decision tree:
275
+
276
+ ```
277
+ npm audit reports a vulnerability
278
+ ├── Severity: critical or high
279
+ │ ├── Is the vulnerable code reachable in your app?
280
+ │ │ ├── YES --> Fix immediately (update, patch, or replace the dependency)
281
+ │ │ └── NO (dev-only dep, unused code path) --> Fix soon, but not a blocker
282
+ │ └── Is a fix available?
283
+ │ ├── YES --> Update to the patched version
284
+ │ └── NO --> Check for workarounds, consider replacing the dependency, or add to allowlist with a review date
285
+ ├── Severity: moderate
286
+ │ ├── Reachable in production? --> Fix in the next release cycle
287
+ │ └── Dev-only? --> Fix when convenient, track in backlog
288
+ └── Severity: low
289
+ └── Track and fix during regular dependency updates
290
+ ```
291
+
292
+ **Key questions:**
293
+ - Is the vulnerable function actually called in your code path?
294
+ - Is the dependency a runtime dependency or dev-only?
295
+ - Is the vulnerability exploitable given your deployment context (e.g., a server-side vulnerability in a client-only app)?
296
+
297
+ When you defer a fix, document the reason and set a review date.
298
+
299
+ ### Supply-Chain Hygiene
300
+
301
+ `npm audit` catches known CVEs; it won't catch a malicious or typosquatted package. Also:
302
+
303
+ - **Commit the lockfile** and install with `npm ci` (not `npm install`) in CI — reproducible builds, no silent version drift.
304
+ - **Review new dependencies before adding them** — maintenance, download counts, and whether they truly earn their place. Every dependency is attack surface (OWASP **A06: Vulnerable Components**, **LLM03: Supply Chain**).
305
+ - **Be wary of `postinstall` scripts** in unfamiliar packages — they run arbitrary code at install time.
306
+ - **Watch for typosquats** — `cross-env` vs `crossenv`, `react-dom` vs `reactdom`.
307
+
308
+ ## Rate Limiting
309
+
310
+ ```typescript
311
+ import rateLimit from 'express-rate-limit';
312
+
313
+ // General API rate limit
314
+ app.use('/api/', rateLimit({
315
+ windowMs: 15 * 60 * 1000, // 15 minutes
316
+ max: 100, // 100 requests per window
317
+ standardHeaders: true,
318
+ legacyHeaders: false,
319
+ }));
320
+
321
+ // Stricter limit for auth endpoints
322
+ app.use('/api/auth/', rateLimit({
323
+ windowMs: 15 * 60 * 1000,
324
+ max: 10, // 10 attempts per 15 minutes
325
+ }));
326
+ ```
327
+
328
+ ## Secrets Management
329
+
330
+ ```
331
+ .env files:
332
+ ├── .env.example → Committed (template with placeholder values)
333
+ ├── .env → NOT committed (contains real secrets)
334
+ └── .env.local → NOT committed (local overrides)
335
+
336
+ .gitignore must include:
337
+ .env
338
+ .env.local
339
+ .env.*.local
340
+ *.pem
341
+ *.key
342
+ ```
343
+
344
+ **Always check before committing:**
345
+ ```bash
346
+ # Check for accidentally staged secrets
347
+ git diff --cached | grep -i "password\|secret\|api_key\|token"
348
+ ```
349
+
350
+ **If a secret is ever committed, rotate it.** Deleting the line or rewriting history is not enough — assume it's compromised the moment it reaches a remote. Revoke and reissue the key first, then purge it from history.
351
+
352
+ ## Securing AI / LLM Features
353
+
354
+ If your app calls an LLM — chatbots, summarizers, agents, RAG — it inherits a new attack surface. Map it to the [OWASP Top 10 for LLM Applications (2025)](https://genai.owasp.org/llm-top-10/):
355
+
356
+ - **Treat all model output as untrusted input (LLM05: Improper Output Handling).** Never pass LLM output straight into `eval`, SQL, a shell, `innerHTML`, or a file path. Validate and encode it exactly as you would raw user input.
357
+ - **Assume prompts can be hijacked (LLM01: Prompt Injection).** Untrusted text in the context window — a user message, a fetched web page, a PDF — can carry instructions. The system prompt is not a security boundary; enforce permissions in code, not in the prompt.
358
+ - **Keep secrets and other users' data out of prompts (LLM02 / LLM07).** Anything in the context can be echoed back. Don't put API keys, cross-tenant data, or the full system prompt where the model can repeat it.
359
+ - **Constrain tool and agent permissions (LLM06: Excessive Agency).** Scope tools to the minimum, require confirmation for destructive or irreversible actions, and validate every tool argument.
360
+ - **Bound consumption (LLM10: Unbounded Consumption).** Cap tokens, request rate, and loop/recursion depth so a crafted input can't run up cost or hang the system.
361
+ - **Isolate retrieval data (LLM08: Vector and Embedding Weaknesses).** In RAG, treat the vector store as a trust boundary: partition embeddings per tenant so one user can't retrieve another's data, and validate documents before indexing so poisoned content can't steer answers.
362
+
363
+ ```typescript
364
+ // BAD: trusting model output as a command or as markup
365
+ const sql = await llm.generate(`Write SQL for: ${userQuestion}`);
366
+ await db.query(sql); // arbitrary query execution
367
+ container.innerHTML = await llm.reply(userMessage); // stored XSS, via the model
368
+
369
+ // GOOD: model output is data — parse defensively, then validate, then encode
370
+ let intent;
371
+ try {
372
+ intent = CommandSchema.parse(JSON.parse(await llm.replyJson(userMessage)));
373
+ } catch {
374
+ throw new ValidationError('unexpected model output'); // JSON.parse or schema failed
375
+ }
376
+ await runAllowlistedAction(intent.action, intent.params);
377
+ container.textContent = await llm.reply(userMessage);
378
+ ```
379
+
380
+ ## Security Review Checklist
381
+
382
+ ```markdown
383
+ ### Authentication
384
+ - [ ] Passwords hashed with bcrypt/scrypt/argon2 (salt rounds ≥ 12)
385
+ - [ ] Session tokens are httpOnly, secure, sameSite
386
+ - [ ] Login has rate limiting
387
+ - [ ] Password reset tokens expire
388
+
389
+ ### Authorization
390
+ - [ ] Every endpoint checks user permissions
391
+ - [ ] Users can only access their own resources
392
+ - [ ] Admin actions require admin role verification
393
+
394
+ ### Input
395
+ - [ ] All user input validated at the boundary
396
+ - [ ] SQL queries are parameterized
397
+ - [ ] HTML output is encoded/escaped
398
+ - [ ] Server-side URL fetches are allowlisted (no SSRF to internal services)
399
+
400
+ ### Data
401
+ - [ ] No secrets in code or version control
402
+ - [ ] Sensitive fields excluded from API responses
403
+ - [ ] PII encrypted at rest (if applicable)
404
+
405
+ ### Infrastructure
406
+ - [ ] Security headers configured (CSP, HSTS, etc.)
407
+ - [ ] CORS restricted to known origins
408
+ - [ ] Dependencies audited for vulnerabilities
409
+ - [ ] Error messages don't expose internals
410
+
411
+ ### Supply Chain
412
+ - [ ] Lockfile committed; CI installs with `npm ci`
413
+ - [ ] New dependencies reviewed (maintenance, downloads, postinstall scripts)
414
+
415
+ ### AI / LLM (if used)
416
+ - [ ] Model output treated as untrusted (no eval/SQL/innerHTML/shell)
417
+ - [ ] Secrets and other users' data kept out of prompts
418
+ - [ ] Tool/agent permissions scoped; destructive actions require confirmation
419
+ ```
420
+ ## See Also
421
+
422
+ For detailed security checklists and pre-commit verification steps, see `references/security-checklist.md`.
423
+
424
+ ## Common Rationalizations
425
+
426
+ | Rationalization | Reality |
427
+ |---|---|
428
+ | "This is an internal tool, security doesn't matter" | Internal tools get compromised. Attackers target the weakest link. |
429
+ | "We'll add security later" | Security retrofitting is 10x harder than building it in. Add it now. |
430
+ | "No one would try to exploit this" | Automated scanners will find it. Security by obscurity is not security. |
431
+ | "The framework handles security" | Frameworks provide tools, not guarantees. You still need to use them correctly. |
432
+ | "It's just a prototype" | Prototypes become production. Security habits from day one. |
433
+ | "Threat modeling is overkill here" | Five minutes of "how would I attack this?" prevents the design flaws no control can patch later. |
434
+ | "It's just LLM output, it's only text" | That "text" can be a SQL statement, a script tag, or a shell command. Treat it like any untrusted input. |
435
+
436
+ ## Red Flags
437
+
438
+ - User input passed directly to database queries, shell commands, or HTML rendering
439
+ - Secrets in source code or commit history
440
+ - API endpoints without authentication or authorization checks
441
+ - Missing CORS configuration or wildcard (`*`) origins
442
+ - No rate limiting on authentication endpoints
443
+ - Stack traces or internal errors exposed to users
444
+ - Dependencies with known critical vulnerabilities
445
+ - Server fetches user-supplied URLs without an allowlist (SSRF)
446
+ - LLM/model output passed into a query, the DOM, a shell, or `eval`
447
+ - Secrets, PII, or the full system prompt placed inside an LLM context window
448
+
449
+ ## Verification
450
+
451
+ After implementing security-relevant code:
452
+
453
+ - [ ] `npm audit` shows no critical or high vulnerabilities
454
+ - [ ] No secrets in source code or git history
455
+ - [ ] All user input validated at system boundaries
456
+ - [ ] Authentication and authorization checked on every protected endpoint
457
+ - [ ] Security headers present in response (check with browser DevTools)
458
+ - [ ] Error responses don't expose internal details
459
+ - [ ] Rate limiting active on auth endpoints
460
+ - [ ] Server-side URL fetches validated against an allowlist (no SSRF)
461
+ - [ ] LLM/model output validated and encoded before use (if AI features present)