crewx 0.8.0-rc.9 → 0.8.0-rc.91

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 (282) hide show
  1. package/README.md +197 -229
  2. package/bin/crewx-lib.js +108 -0
  3. package/bin/crewx-ui.js +83 -0
  4. package/bin/crewx.js +144 -3
  5. package/bin/package.json +1 -0
  6. package/dist/assets/MarketPage-Cvo8aVQt.js +31 -0
  7. package/dist/assets/PromptTab-ritoI9hm.js +37 -0
  8. package/dist/assets/_baseUniq-D-vYMu09.js +1 -0
  9. package/dist/assets/arc-BYanzRKX.js +1 -0
  10. package/dist/assets/architectureDiagram-Q4EWVU46-DiKRGwoM.js +36 -0
  11. package/dist/assets/blockDiagram-DXYQGD6D-BAlFcSgI.js +132 -0
  12. package/dist/assets/c4Diagram-AHTNJAMY-C8KLArMt.js +10 -0
  13. package/dist/assets/channel-0n1XK9nN.js +1 -0
  14. package/dist/assets/chatgpt-logo-dark.svg +15 -0
  15. package/dist/assets/chatgpt-logo.svg +15 -0
  16. package/dist/assets/chunk-4BX2VUAB-Dkx0jWDY.js +1 -0
  17. package/dist/assets/chunk-4TB4RGXK-_fW5ld1w.js +206 -0
  18. package/dist/assets/chunk-55IACEB6-kRhiL-bc.js +1 -0
  19. package/dist/assets/chunk-EDXVE4YY-DTha-Dl2.js +1 -0
  20. package/dist/assets/chunk-FMBD7UC4-CHl2rQqk.js +15 -0
  21. package/dist/assets/chunk-OYMX7WX6-HcHTeBom.js +231 -0
  22. package/dist/assets/chunk-QZHKN3VN-DLIaU0x1.js +1 -0
  23. package/dist/assets/chunk-YZCP3GAM-DAq_xC49.js +1 -0
  24. package/dist/assets/classDiagram-6PBFFD2Q-BAGFUSDM.js +1 -0
  25. package/dist/assets/classDiagram-v2-HSJHXN6E-BAGFUSDM.js +1 -0
  26. package/dist/assets/claude-logo-dark.svg +1 -0
  27. package/dist/assets/claude-logo.svg +1 -0
  28. package/dist/assets/clone-CtKj6sEW.js +1 -0
  29. package/dist/assets/cose-bilkent-S5V4N54A-Bumhm_n2.js +1 -0
  30. package/dist/assets/crewx-logo.png +0 -0
  31. package/dist/assets/cytoscape.esm-BiciSPf8.js +331 -0
  32. package/dist/assets/dagre-KV5264BT-CcQdJ_HT.js +4 -0
  33. package/dist/assets/defaultLocale-DX6XiGOO.js +1 -0
  34. package/dist/assets/diagram-5BDNPKRD-BRzhnTUO.js +10 -0
  35. package/dist/assets/diagram-G4DWMVQ6-DO2a0QyN.js +24 -0
  36. package/dist/assets/diagram-MMDJMWI5-8mzuGbGW.js +43 -0
  37. package/dist/assets/diagram-TYMM5635-BEMGFn90.js +24 -0
  38. package/dist/assets/erDiagram-SMLLAGMA-BQN5yqII.js +85 -0
  39. package/dist/assets/flowDiagram-DWJPFMVM-D4htmWZR.js +162 -0
  40. package/dist/assets/ganttDiagram-T4ZO3ILL-Dbu5yCGU.js +292 -0
  41. package/dist/assets/gemini-logo.svg +1 -0
  42. package/dist/assets/gitGraphDiagram-UUTBAWPF-CLEFY34L.js +106 -0
  43. package/dist/assets/github-copilot-logo-dark.svg +1 -0
  44. package/dist/assets/github-copilot-logo.svg +1 -0
  45. package/dist/assets/graph-BtAIaAZI.js +1 -0
  46. package/dist/assets/infoDiagram-42DDH7IO-CgjmqOx2.js +2 -0
  47. package/dist/assets/init-Gi6I4Gst.js +1 -0
  48. package/dist/assets/ishikawaDiagram-UXIWVN3A-CHYdITxe.js +70 -0
  49. package/dist/assets/journeyDiagram-VCZTEJTY-BBCOwqzV.js +139 -0
  50. package/dist/assets/kanban-definition-6JOO6SKY-Cg8Aus7V.js +89 -0
  51. package/dist/assets/katex-DkKDou_j.js +257 -0
  52. package/dist/assets/layout-CFl0_GxZ.js +1 -0
  53. package/dist/assets/linear-CkV62jWx.js +1 -0
  54. package/dist/assets/main-CmP-VosD.css +10 -0
  55. package/dist/assets/main-CqrnRrwT.js +1166 -0
  56. package/dist/assets/min-BdrLldJH.js +1 -0
  57. package/dist/assets/mindmap-definition-QFDTVHPH-jKsyKX-1.js +96 -0
  58. package/dist/assets/ordinal-Cboi1Yqb.js +1 -0
  59. package/dist/assets/pieDiagram-DEJITSTG-DggmHuIl.js +30 -0
  60. package/dist/assets/quadrantDiagram-34T5L4WZ-DVeG40E4.js +7 -0
  61. package/dist/assets/requirementDiagram-MS252O5E-D0ISCRPS.js +84 -0
  62. package/dist/assets/sankeyDiagram-XADWPNL6-BFaXlzcA.js +10 -0
  63. package/dist/assets/sequenceDiagram-FGHM5R23-B0ATS6Us.js +157 -0
  64. package/dist/assets/stateDiagram-FHFEXIEX-Dzetzj7w.js +1 -0
  65. package/dist/assets/stateDiagram-v2-QKLJ7IA2-CpR-vCrX.js +1 -0
  66. package/dist/assets/timeline-definition-GMOUNBTQ-gxk5Cthq.js +120 -0
  67. package/dist/assets/vennDiagram-DHZGUBPP-DuzISLu6.js +34 -0
  68. package/dist/assets/wardley-RL74JXVD-DIsZOdLy.js +162 -0
  69. package/dist/assets/wardleyDiagram-NUSXRM2D-ZOHcpxVD.js +20 -0
  70. package/dist/assets/xychartDiagram-5P7HB3ND-HGeoIY5m.js +7 -0
  71. package/dist/favicon.ico +0 -0
  72. package/dist/index.html +13 -0
  73. package/dist-electron/main.js +194 -0
  74. package/dist-electron/overlay.js +129 -0
  75. package/dist-electron/package.json +1 -0
  76. package/dist-electron/preload.js +12 -0
  77. package/dist-server/adapters/adapter.module.js +35 -0
  78. package/dist-server/adapters/adapter.service.js +79 -0
  79. package/dist-server/adapters/http-router.service.js +91 -0
  80. package/dist-server/app.module.js +85 -0
  81. package/dist-server/bootstrap/crewx-server.js +32 -0
  82. package/dist-server/common/decorators/project.decorator.js +21 -0
  83. package/dist-server/common/decorators/workspace.decorator.js +24 -0
  84. package/dist-server/common/interceptor/api-id-header.interceptor.js +55 -0
  85. package/dist-server/common/interceptor/http-logging.interceptor.js +121 -0
  86. package/dist-server/common/limits/defaults.js +13 -0
  87. package/dist-server/common/limits/limits-provider.js +6 -0
  88. package/dist-server/common/limits/limits.controller.js +38 -0
  89. package/dist-server/common/limits/limits.module.js +24 -0
  90. package/dist-server/common/limits/local-limits.provider.js +27 -0
  91. package/dist-server/common/middleware/workspace.middleware.js +170 -0
  92. package/dist-server/common/workspace-context.store.js +25 -0
  93. package/dist-server/domain/agent/agent.controller.js +125 -0
  94. package/dist-server/domain/agent/agent.module.js +27 -0
  95. package/dist-server/domain/agent/agent.service.js +342 -0
  96. package/dist-server/domain/agent/agent.types.js +3 -0
  97. package/dist-server/domain/agent/dto/create-agent.dto.js +73 -0
  98. package/dist-server/domain/agent/dto/preview-prompt.dto.js +77 -0
  99. package/dist-server/domain/agent/dto/update-agent.dto.js +66 -0
  100. package/dist-server/domain/agent/template-processor.service.js +71 -0
  101. package/dist-server/domain/box/box.controller.js +77 -0
  102. package/dist-server/domain/box/box.module.js +21 -0
  103. package/dist-server/domain/box/box.service.js +97 -0
  104. package/dist-server/domain/box/dto/create-box.dto.js +74 -0
  105. package/dist-server/domain/cli/cli.controller.js +88 -0
  106. package/dist-server/domain/cli/cli.module.js +21 -0
  107. package/dist-server/domain/cli/cli.service.js +427 -0
  108. package/dist-server/domain/cli/dto/update-cli.dto.js +31 -0
  109. package/dist-server/domain/doc/doc.controller.js +94 -0
  110. package/dist-server/domain/doc/doc.module.js +21 -0
  111. package/dist-server/domain/doc/doc.service.js +344 -0
  112. package/dist-server/domain/doc/dto/doc.dto.js +64 -0
  113. package/dist-server/domain/document/document.controller.js +57 -0
  114. package/dist-server/domain/document/document.module.js +22 -0
  115. package/dist-server/domain/document/document.service.js +271 -0
  116. package/dist-server/domain/document/dto/register-document.dto.js +24 -0
  117. package/dist-server/domain/fs/dto/tree-node.dto.js +2 -0
  118. package/dist-server/domain/fs/dto/tree-query.dto.js +35 -0
  119. package/dist-server/domain/fs/fs.controller.js +44 -0
  120. package/dist-server/domain/fs/fs.module.js +22 -0
  121. package/dist-server/domain/fs/fs.service.js +170 -0
  122. package/dist-server/domain/git/git.module.js +20 -0
  123. package/dist-server/domain/git/git.service.js +222 -0
  124. package/dist-server/domain/health/health.controller.js +38 -0
  125. package/dist-server/domain/health/health.module.js +19 -0
  126. package/dist-server/domain/knowledge/dto/graph-knowledge.dto.js +27 -0
  127. package/dist-server/domain/knowledge/dto/knowledge.dto.js +71 -0
  128. package/dist-server/domain/knowledge/knowledge.controller.js +122 -0
  129. package/dist-server/domain/knowledge/knowledge.module.js +21 -0
  130. package/dist-server/domain/knowledge/knowledge.service.js +538 -0
  131. package/dist-server/domain/mcp/crewx-tool.factory.js +175 -0
  132. package/dist-server/domain/mcp/mcp-auth.guard.js +61 -0
  133. package/dist-server/domain/mcp/mcp.constants.js +4 -0
  134. package/dist-server/domain/mcp/mcp.controller.js +73 -0
  135. package/dist-server/domain/mcp/mcp.dto.js +12 -0
  136. package/dist-server/domain/mcp/mcp.module.js +38 -0
  137. package/dist-server/domain/mcp/mcp.service.js +415 -0
  138. package/dist-server/domain/message/dto/list-messages.dto.js +57 -0
  139. package/dist-server/domain/message/dto/send-message.dto.js +45 -0
  140. package/dist-server/domain/message/message.controller.js +73 -0
  141. package/dist-server/domain/message/message.module.js +25 -0
  142. package/dist-server/domain/message/message.service.js +153 -0
  143. package/dist-server/domain/onboarding/onboarding.controller.js +97 -0
  144. package/dist-server/domain/onboarding/onboarding.module.js +23 -0
  145. package/dist-server/domain/onboarding/onboarding.service.js +106 -0
  146. package/dist-server/domain/onboarding/onboarding.types.js +2 -0
  147. package/dist-server/domain/onboarding/presets/custom.js +10 -0
  148. package/dist-server/domain/onboarding/presets/dev-team.js +41 -0
  149. package/dist-server/domain/onboarding/presets/index.js +15 -0
  150. package/dist-server/domain/onboarding/presets/marketing-team.js +29 -0
  151. package/dist-server/domain/onboarding/presets/planning-team.js +29 -0
  152. package/dist-server/domain/onboarding/presets/solo.js +17 -0
  153. package/dist-server/domain/project/dto/create-project.dto.js +46 -0
  154. package/dist-server/domain/project/dto/update-project.dto.js +60 -0
  155. package/dist-server/domain/project/project.controller.js +129 -0
  156. package/dist-server/domain/project/project.module.js +22 -0
  157. package/dist-server/domain/project/project.service.js +173 -0
  158. package/dist-server/domain/skill/dto/add-registry.dto.js +23 -0
  159. package/dist-server/domain/skill/dto/install-skill.dto.js +30 -0
  160. package/dist-server/domain/skill/skill.controller.js +136 -0
  161. package/dist-server/domain/skill/skill.module.js +22 -0
  162. package/dist-server/domain/skill/skill.service.js +612 -0
  163. package/dist-server/domain/task/dto/all-tasks.dto.js +55 -0
  164. package/dist-server/domain/task/dto/list-tasks.dto.js +69 -0
  165. package/dist-server/domain/task/dto/search-tasks.dto.js +66 -0
  166. package/dist-server/domain/task/dto/send-message.dto.js +31 -0
  167. package/dist-server/domain/task/dto/task-status.dto.js +34 -0
  168. package/dist-server/domain/task/dto/workspace-usage.dto.js +38 -0
  169. package/dist-server/domain/task/task.constants.js +5 -0
  170. package/dist-server/domain/task/task.controller.js +169 -0
  171. package/dist-server/domain/task/task.module.js +21 -0
  172. package/dist-server/domain/task/task.service.js +654 -0
  173. package/dist-server/domain/thread/dto/build-context.dto.js +42 -0
  174. package/dist-server/domain/thread/dto/list-messages.dto.js +49 -0
  175. package/dist-server/domain/thread/dto/list-threads.dto.js +70 -0
  176. package/dist-server/domain/thread/dto/search-threads.dto.js +13 -0
  177. package/dist-server/domain/thread/thread.controller.js +116 -0
  178. package/dist-server/domain/thread/thread.module.js +23 -0
  179. package/dist-server/domain/thread/thread.service.js +365 -0
  180. package/dist-server/domain/usage/usage.controller.js +118 -0
  181. package/dist-server/domain/usage/usage.module.js +21 -0
  182. package/dist-server/domain/usage/usage.service.js +343 -0
  183. package/dist-server/domain/usage/usage.types.js +4 -0
  184. package/dist-server/domain/wbs/wbs.controller.js +51 -0
  185. package/dist-server/domain/wbs/wbs.module.js +21 -0
  186. package/dist-server/domain/wbs/wbs.service.js +94 -0
  187. package/dist-server/domain/workflow/workflow.controller.js +53 -0
  188. package/dist-server/domain/workflow/workflow.module.js +21 -0
  189. package/dist-server/domain/workflow/workflow.service.js +209 -0
  190. package/dist-server/domain/workspace/dto/create-workspace.dto.js +45 -0
  191. package/dist-server/domain/workspace/dto/switch-workspace.dto.js +32 -0
  192. package/dist-server/domain/workspace/dto/workspace-info.dto.js +2 -0
  193. package/dist-server/domain/workspace/workspace.controller.js +83 -0
  194. package/dist-server/domain/workspace/workspace.module.js +22 -0
  195. package/dist-server/domain/workspace/workspace.service.js +206 -0
  196. package/dist-server/main.js +138 -0
  197. package/dist-server/modules/crewx.module.js +50 -0
  198. package/dist-server/package.json +3 -0
  199. package/dist-server/repository/base-sqlite.repository.js +103 -0
  200. package/dist-server/repository/box.repository.js +174 -0
  201. package/dist-server/repository/message.repository.js +22 -0
  202. package/dist-server/repository/project.repository.js +187 -0
  203. package/dist-server/repository/repository.module.js +34 -0
  204. package/dist-server/repository/request-log.repository.js +94 -0
  205. package/dist-server/repository/task.repository.js +365 -0
  206. package/dist-server/repository/thread.repository.js +352 -0
  207. package/dist-server/shared/crewx-home.js +58 -0
  208. package/dist-server/shared/crewx-state.js +66 -0
  209. package/dist-server/utils/tokenizer.js +8 -0
  210. package/package.json +198 -18
  211. package/packages/cli/dist/bootstrap/crewx-cli.d.ts +11 -0
  212. package/packages/cli/dist/bootstrap/crewx-cli.js +31 -0
  213. package/packages/cli/dist/builtin.d.ts +15 -0
  214. package/packages/cli/dist/builtin.js +124 -0
  215. package/packages/cli/dist/commands/agent.d.ts +12 -0
  216. package/packages/cli/dist/commands/agent.js +246 -0
  217. package/packages/cli/dist/commands/doctor.d.ts +12 -0
  218. package/packages/cli/dist/commands/doctor.js +190 -0
  219. package/packages/cli/dist/commands/execute.d.ts +21 -0
  220. package/packages/cli/dist/commands/execute.js +117 -0
  221. package/packages/cli/dist/commands/hook/install.d.ts +21 -0
  222. package/packages/cli/dist/commands/hook/install.js +175 -0
  223. package/packages/cli/dist/commands/hook/paths.d.ts +19 -0
  224. package/packages/cli/dist/commands/hook/paths.js +94 -0
  225. package/packages/cli/dist/commands/hook/status.d.ts +7 -0
  226. package/packages/cli/dist/commands/hook/status.js +86 -0
  227. package/packages/cli/dist/commands/hook/uninstall.d.ts +8 -0
  228. package/packages/cli/dist/commands/hook/uninstall.js +71 -0
  229. package/packages/cli/dist/commands/hook-dispatch.d.ts +15 -0
  230. package/packages/cli/dist/commands/hook-dispatch.js +180 -0
  231. package/packages/cli/dist/commands/init.d.ts +24 -0
  232. package/packages/cli/dist/commands/init.js +133 -0
  233. package/packages/cli/dist/commands/kill.d.ts +12 -0
  234. package/packages/cli/dist/commands/kill.js +49 -0
  235. package/packages/cli/dist/commands/log.d.ts +13 -0
  236. package/packages/cli/dist/commands/log.js +97 -0
  237. package/packages/cli/dist/commands/parse-agent-message.d.ts +31 -0
  238. package/packages/cli/dist/commands/parse-agent-message.js +52 -0
  239. package/packages/cli/dist/commands/parse-common-flags.d.ts +36 -0
  240. package/packages/cli/dist/commands/parse-common-flags.js +105 -0
  241. package/packages/cli/dist/commands/ps.d.ts +12 -0
  242. package/packages/cli/dist/commands/ps.js +71 -0
  243. package/packages/cli/dist/commands/query.d.ts +21 -0
  244. package/packages/cli/dist/commands/query.js +117 -0
  245. package/packages/cli/dist/commands/result.d.ts +13 -0
  246. package/packages/cli/dist/commands/result.js +73 -0
  247. package/packages/cli/dist/commands/slack.d.ts +12 -0
  248. package/packages/cli/dist/commands/slack.js +559 -0
  249. package/packages/cli/dist/commands/task-db.d.ts +33 -0
  250. package/packages/cli/dist/commands/task-db.js +107 -0
  251. package/packages/cli/dist/examples/deny-secrets-plugin.d.ts +22 -0
  252. package/packages/cli/dist/examples/deny-secrets-plugin.js +40 -0
  253. package/packages/cli/dist/index.d.ts +1 -0
  254. package/packages/cli/dist/index.js +5 -0
  255. package/packages/cli/dist/logging.d.ts +21 -0
  256. package/packages/cli/dist/logging.js +86 -0
  257. package/packages/cli/dist/main.d.ts +11 -0
  258. package/packages/cli/dist/main.js +301 -0
  259. package/packages/cli/dist/plugins/examples/echo-hook.d.ts +24 -0
  260. package/packages/cli/dist/plugins/examples/echo-hook.js +60 -0
  261. package/packages/cli/dist/plugins/examples/verify-echo-hook.d.ts +8 -0
  262. package/packages/cli/dist/plugins/examples/verify-echo-hook.js +47 -0
  263. package/packages/cli/dist/plugins/sqlite-tracing.d.ts +13 -0
  264. package/packages/cli/dist/plugins/sqlite-tracing.js +20 -0
  265. package/packages/cli/dist/register-builtin-tools.d.ts +5 -0
  266. package/packages/cli/dist/register-builtin-tools.js +9 -0
  267. package/packages/cli/dist/slack/file-download.d.ts +17 -0
  268. package/packages/cli/dist/slack/file-download.js +134 -0
  269. package/packages/cli/dist/slack/markdown.d.ts +5 -0
  270. package/packages/cli/dist/slack/markdown.js +33 -0
  271. package/packages/cli/dist/utils/env-defaults.d.ts +5 -0
  272. package/packages/cli/dist/utils/env-defaults.js +10 -0
  273. package/packages/cli/dist/utils/version.d.ts +1 -0
  274. package/packages/cli/dist/utils/version.js +28 -0
  275. package/packages/cli/package.json +52 -0
  276. package/scripts/build-manual.mjs +266 -0
  277. package/scripts/emit-dist-server-package-json.mjs +7 -0
  278. package/scripts/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  279. package/scripts/postinstall.mjs +44 -0
  280. package/scripts/smoke-tarball.mjs +285 -0
  281. package/scripts/snapshot-msg-list.sh +52 -0
  282. package/server.js +164 -0
package/README.md CHANGED
@@ -1,300 +1,268 @@
1
- # SowonAI CrewX
1
+ # CrewX
2
2
 
3
- > Bring Your Own AI(BYOA) team in Slack/IDE(MCP) with your existing subscriptions
3
+ > Build your AI agent team bring any model, orchestrate any workflow
4
4
 
5
- Transform Claude, Gemini, Codex and Copilot into a collaborative development team. No extra costs—just your existing AI subscriptions working together.
5
+ [![npm version](https://img.shields.io/npm/v/crewx)](https://www.npmjs.com/package/crewx)
6
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D22-brightgreen)](https://nodejs.org/)
7
+ [![License](https://img.shields.io/badge/license-see%20below-blue)](#license)
6
8
 
7
- ![CrewX usage overview](docs/diagram1.svg)
9
+ ## What is CrewX?
8
10
 
9
- ## Why CrewX?
11
+ CrewX is a developer tool for building and managing AI agent teams. Define agents in YAML, wire them into workflows, and let them collaborate using built-in tools — all from a single CLI or web dashboard.
10
12
 
11
- ### **Slack Team Collaboration** - Your AI Team in Slack
12
- Bring AI agents directly into your team's workspace:
13
- - **Team-wide AI access** - Everyone benefits from AI expertise in Slack channels
14
- - **Thread-based context** - Maintains conversation history automatically
15
- - **Multi-agent collaboration** - `@claude`, `@gemini`, `@copilot` work together in real-time
16
- - **Natural integration** - Works like chatting with team members
17
- - **Shared knowledge** - Team learns from AI interactions, not isolated sessions
18
-
19
- ### **Remote Agents** - Distributed AI Teams
20
- Connect and orchestrate CrewX instances across projects and servers:
21
- - **Cross-project experts** - Frontend dev asks backend team's API specialist agent
22
- - **Team collaboration** - Each team builds their own agents, entire org can use them
23
- - **Expert knowledge sharing** - Ask senior's code review agent, security team's audit agent anytime
24
- - **Separate but connected** - Each project keeps its own context, collaborate when needed
25
-
26
- ```yaml
27
- # Access another project's specialized agents
28
- providers:
29
- - id: backend_project
30
- type: remote
31
- location: "file:///workspace/backend-api/crewx.yaml"
32
- external_agent_id: "api_expert"
33
-
34
- # Use their expertise in your project
35
- crewx query "@api_expert design user authentication API"
36
- crewx execute "@api_expert implement OAuth flow"
37
- ```
38
-
39
- ### **Plugin Provider System** - Universal AI Integration
40
- Transform any CLI tool or AI service into an agent:
41
- - **Bring Your Own AI** - OpenAI, Anthropic, Ollama, LiteLLM, or any AI service
42
- - **Bring Your Own Tools** - jq, curl, ffmpeg, or any CLI tool becomes an agent
43
- - **Bring Your Own Framework** - Integrate LangChain, CrewAI, AutoGPT seamlessly
44
- - **No coding required** - Simple YAML configuration
45
- - **Mix and match** - Combine different AI services in one workflow
46
-
47
- ```yaml
48
- # Example: Add any AI service as a plugin
49
- providers:
50
- - id: ollama
51
- type: plugin
52
- cli_command: ollama
53
- default_model: "llama3"
54
- query_args: ["run", "{model}"]
55
- prompt_in_args: false
56
-
57
- agents:
58
- - id: "local_llama"
59
- provider: "plugin/ollama"
60
- ```
61
-
62
- ### Other Benefits
63
- - **No additional costs** - Use existing Claude Pro, Gemini, Codex or GitHub Copilot subscriptions
64
- - **Multi-agent collaboration** - Different AI models working on specialized tasks
65
- - **Parallel execution** - Multiple agents working simultaneously
66
- - **Flexible integration** - CLI, MCP server, or Slack bot
13
+ - **Bring Your Own AI** Claude, Gemini, Copilot, Codex, or any OpenAI-compatible model
14
+ - **One command to start** `npx crewx` launches everything
15
+ - **Team orchestration** agents work together through threads, workflows, and shared memory
67
16
 
68
17
  ## Quick Start
69
18
 
70
19
  ```bash
71
- # Install
72
- npm install -g crewx
73
-
74
- # Initialize
75
- crewx init
76
-
77
- # Check system
78
- crewx doctor
79
-
80
- # Try it out
81
- crewx query "@claude analyze my code"
82
- crewx execute "@claude create a login component"
20
+ npx crewx
83
21
  ```
84
22
 
85
- ## Three Ways to Use
23
+ That's it. This launches the CrewX dashboard at `http://localhost:8150` where you can manage agents, create threads, and monitor workflows.
24
+
25
+ ### Initialize a new project
86
26
 
87
- ### Slack Mode - Team Collaboration (Recommended)
88
27
  ```bash
89
- # Start CrewX in your Slack workspace (read-only query mode)
90
- crewx slack
28
+ npx crewx init
29
+ ```
91
30
 
92
- # Allow agents to run execute tasks (file changes, migrations, etc.)
93
- crewx slack --mode execute
31
+ This creates a `crewx.yaml` in your project with default agents and settings.
94
32
 
95
- # Your team can now:
96
- # - @mention AI agents in channels
97
- # - Maintain context in threads
98
- # - Share AI insights with the whole team
99
- ```
100
- 👉 **[Complete Slack Setup Guide →](../../docs/slack-install.md)**
33
+ ### Talk to your agents
101
34
 
102
- ### CLI Mode - Direct terminal usage
103
35
  ```bash
104
- crewx query "@claude review this code"
105
- crewx execute "@gemini optimize performance"
106
- crewx query "@claude @gemini @copilot compare approaches"
107
- ```
36
+ # Ask a question (query mode)
37
+ npx crewx q "@claude review this codebase"
108
38
 
109
- ### MCP Server Mode - IDE integration
110
- ```bash
111
- crewx mcp # VS Code, Claude Desktop, Cursor
112
- ```
39
+ # Execute a task (agents can edit files)
40
+ npx crewx x "@copilot implement login component"
113
41
 
114
- ## Supported AI Tools
42
+ # Multi-agent collaboration
43
+ npx crewx q "@claude @gemini compare approaches for caching"
44
+ ```
115
45
 
116
- - **Claude Code** - Advanced reasoning and analysis
117
- - **Gemini CLI** - Real-time web access
118
- - **GitHub Copilot CLI** - Specialized coding assistant
119
- - **Codex CLI** - Open inference with workspace-aware execution
46
+ ## Key Features
120
47
 
121
- ## Basic Usage
48
+ ### BYOA (Bring Your Own AI)
122
49
 
123
- ```bash
124
- # Read-only analysis
125
- crewx query "@claude explain this function"
50
+ Use your existing AI subscriptions — or run fully local with Ollama. No vendor lock-in.
126
51
 
127
- # File creation/modification
128
- crewx execute "@claude implement user authentication"
52
+ | Provider | CLI | Status |
53
+ |----------|-----|--------|
54
+ | Claude | `claude` | Supported |
55
+ | Gemini | `gemini` | Supported |
56
+ | GitHub Copilot | `copilot` | Supported |
57
+ | Codex | `codex` | Supported |
58
+ | Ollama (local LLM) | API provider | Supported |
59
+ | OpenAI-compatible | API provider | Supported |
129
60
 
130
- # Parallel tasks
131
- crewx execute "@claude create tests" "@gemini write docs"
61
+ Build a **fully local AI team** with Ollama — no cloud, no API costs, complete data privacy. Mix and match cloud and local models in the same team.
132
62
 
133
- # Pipeline workflows
134
- crewx query "@architect design API" | \
135
- crewx execute "@backend implement it"
63
+ ### Agent Teams
136
64
 
137
- # Thread-based conversations
138
- crewx query "@claude design login" --thread "auth-feature"
139
- crewx execute "@gemini implement it" --thread "auth-feature"
65
+ Define your team in `crewx.yaml`:
140
66
 
141
- # Codex CLI agent
142
- crewx query "@codex draft a release checklist"
67
+ ```yaml
68
+ agents:
69
+ - id: reviewer
70
+ name: Code Reviewer
71
+ provider: cli/claude
72
+ inline:
73
+ model: claude-sonnet-4-6
74
+ prompt: |
75
+ You are a senior code reviewer.
76
+ Focus on correctness, performance, and security.
77
+
78
+ - id: implementer
79
+ name: Implementer
80
+ provider: cli/copilot
81
+ inline:
82
+ prompt: |
83
+ You are a full-stack developer.
84
+ Write clean, tested code following project conventions.
143
85
  ```
144
86
 
145
- Built-in CLI providers:
146
-
147
- - `cli/claude`
148
- - `cli/gemini`
149
- - `cli/copilot`
150
- - `cli/codex`
87
+ ### Thread Conversations
151
88
 
152
- ## Create Custom Agents
89
+ Thread-based conversations keep context across multiple interactions. Agents remember previous messages and can build on each other's work.
153
90
 
154
91
  ```bash
155
- # Let SowonAI CrewX create agents for you
156
- crewx execute "@crewx Create a Python expert agent"
157
- crewx execute "@crewx Create a React specialist with TypeScript"
158
- crewx execute "@crewx Create a DevOps agent for Docker"
92
+ # Start a thread
93
+ npx crewx q "@reviewer review PR #42" --thread="pr-42-review"
159
94
 
160
- # Test your new agent
161
- crewx query "@python_expert Review my code"
95
+ # Continue the conversation
96
+ npx crewx q "@implementer fix the issues found" --thread="pr-42-review"
162
97
  ```
163
98
 
164
- ## Agent Configuration
99
+ ### Semantic Workflows
165
100
 
166
- Create `crewx.yaml` (or `agents.yaml` for backward compatibility):
101
+ Define agent collaboration as semantic workflow YAML — branching, parallel execution, approval gates, and loops:
167
102
 
168
103
  ```yaml
169
- agents:
170
- - id: "frontend_dev"
171
- name: "React Expert"
172
- provider: "cli/claude" # Built-in CLI provider
173
- working_directory: "./src"
174
- inline:
175
- type: "agent"
176
- system_prompt: |
177
- You are a senior React developer.
178
- Provide detailed examples and best practices.
104
+ # workflows/code-review.yaml
105
+ workflows:
106
+ code-review:
107
+ metadata:
108
+ name: "Code Review Workflow"
109
+ nodes:
110
+ review:
111
+ type: agent_task
112
+ agent: reviewer
113
+ mode: query
114
+ input: "Review the latest changes for bugs and security issues"
115
+ output: review_result
116
+ next: fix
117
+
118
+ fix:
119
+ type: agent_task
120
+ agent: implementer
121
+ mode: execute
122
+ input: "Fix the issues found: {{review_result}}"
123
+ next: end
124
+
125
+ end:
126
+ type: end
179
127
  ```
180
128
 
181
- > **Note:** `crewx.yaml` is the preferred configuration file name. The legacy `agents.yaml` is still supported for backward compatibility. If both files exist, `crewx.yaml` takes priority.
129
+ ### Built-in Tools
182
130
 
183
- ## Remote Agents
131
+ Each tool is a standalone npm package — install individually or use all out of the box:
184
132
 
185
- Connect to other CrewX instances and delegate tasks across projects or servers.
133
+ | Package | npm | Description |
134
+ |---------|-----|-------------|
135
+ | `@crewx/memory` | [![npm](https://img.shields.io/npm/v/@crewx/memory)](https://www.npmjs.com/package/@crewx/memory) | Persistent agent memory (markdown + frontmatter) |
136
+ | `@crewx/doc` | [![npm](https://img.shields.io/npm/v/@crewx/doc)](https://www.npmjs.com/package/@crewx/doc) | Document TOC extraction and section reader |
137
+ | `@crewx/search` | [![npm](https://img.shields.io/npm/v/@crewx/search)](https://www.npmjs.com/package/@crewx/search) | BM25 full-text code/document search |
138
+ | `@crewx/cron` | [![npm](https://img.shields.io/npm/v/@crewx/cron)](https://www.npmjs.com/package/@crewx/cron) | Scheduled task execution |
139
+ | `@crewx/wbs` | [![npm](https://img.shields.io/npm/v/@crewx/wbs)](https://www.npmjs.com/package/@crewx/wbs) | Work breakdown structure management |
140
+ | `@crewx/workflow` | [![npm](https://img.shields.io/npm/v/@crewx/workflow)](https://www.npmjs.com/package/@crewx/workflow) | Semantic workflow engine (branch, parallel, approval) |
141
+ | `@crewx/skill` | [![npm](https://img.shields.io/npm/v/@crewx/skill)](https://www.npmjs.com/package/@crewx/skill) | Reusable skill system (Claude Code compatible) |
142
+ | `@crewx/knowledge-core` | [![npm](https://img.shields.io/npm/v/@crewx/knowledge-core)](https://www.npmjs.com/package/@crewx/knowledge-core) | Knowledge graph engine |
143
+ | `@crewx/shared` | [![npm](https://img.shields.io/npm/v/@crewx/shared)](https://www.npmjs.com/package/@crewx/shared) | Shared utilities for built-in tools |
186
144
 
187
- **Quick Example:**
188
- ```bash
189
- # Add a remote CrewX instance
190
- providers:
191
- - id: backend_server
192
- type: remote
193
- location: "http://api.example.com:3000"
194
- external_agent_id: "backend_team"
145
+ ### Desktop & Server
195
146
 
196
- agents:
197
- - id: "remote_backend"
198
- provider: "remote/backend_server"
147
+ - **Web Dashboard** — `npx crewx` serves a full management UI
148
+ - **Electron Desktop App** — native app with the same features
149
+ - **MCP Server** — JSON-RPC 2.0 endpoint for IDE integration (Claude Code, Cursor, etc.)
199
150
 
200
- # Use it like any other agent
201
- crewx query "@remote_backend check API status"
202
- ```
151
+ ## Use Cases
203
152
 
204
- **Use Cases:**
205
- - **Project isolation** - Separate configurations for different codebases
206
- - **Distributed teams** - Each team runs their own CrewX with specialized agents
207
- - **Resource sharing** - Access powerful compute resources remotely
208
- - **Multi-project coordination** - Orchestrate work across multiple projects
153
+ ### Development Workflow Automation
154
+ Set up AI-powered code review, testing, and deployment pipelines. Multiple agents handle different stages of your development process.
209
155
 
210
- 👉 **[Remote Agents Guide →](./docs/remote-agents.md)** for detailed setup and configuration
156
+ ### Team Productivity
157
+ Distribute tasks across specialized agents. A reviewer checks code quality while an implementer writes features — in parallel.
211
158
 
212
- ## Monorepo Architecture
159
+ ### AI-Powered Business Automation
160
+ Build agent teams that handle business processes end-to-end. From customer research to content generation, agents collaborate through workflows and shared knowledge.
213
161
 
214
- SowonAI CrewX is structured as a monorepo with separate packages for maximum flexibility:
162
+ ## Supported Providers
215
163
 
216
- ```
217
- crewx/
218
- ├── packages/
219
- │ ├── sdk/ # @sowonai/crewx-sdk (Apache-2.0)
220
- │ │ ├── Core AI provider interfaces
221
- │ │ ├── Conversation management
222
- │ │ ├── Knowledge utilities
223
- │ │ └── Agent domain types
224
- │ └── cli/ # crewx (MIT)
225
- │ ├── CLI implementation
226
- │ ├── Slack integration
227
- │ ├── MCP server
228
- │ └── Provider implementations
229
- ├── docs/ # Comprehensive documentation
230
- └── README.md # This file
231
- ```
164
+ ### CLI Providers
165
+ Use AI tools you already have installed:
232
166
 
233
- ### Package Overview
167
+ | Provider | CLI | Notes |
168
+ |----------|-----|-------|
169
+ | Claude (Anthropic) | `claude` | Complex reasoning, system design |
170
+ | Gemini (Google) | `gemini` | Research, data analysis |
171
+ | GitHub Copilot | `copilot` | Code generation |
172
+ | Codex (OpenAI) | `codex` | General-purpose coding |
234
173
 
235
- | Package | License | Description | Install |
236
- |---------|---------|-------------|---------|
237
- | `@sowonai/crewx-sdk` | Apache-2.0 | Core SDK for building custom AI integrations | `npm install @sowonai/crewx-sdk` |
238
- | `crewx` | MIT | Full-featured CLI tool for immediate use | `npm install -g crewx` |
174
+ ### API Providers
175
+ Connect any API-compatible model — including local LLMs:
239
176
 
240
- **When to use what:**
241
- - **Use `crewx` CLI** if you want to use AI agents immediately in your terminal, Slack, or IDE
242
- - **Use `@sowonai/crewx-sdk`** if you're building custom AI tools or integrating SowonAI CrewX into your application
177
+ | Provider | Type | Notes |
178
+ |----------|------|-------|
179
+ | Ollama | Local LLM | Run fully local zero cloud, zero cost, full privacy |
180
+ | OpenAI API | Cloud API | GPT-4o, o1, etc. |
181
+ | OpenAI-compatible | Cloud/Local | Any endpoint following OpenAI API spec |
243
182
 
244
- ### Development
183
+ Mix CLI and API providers in the same team. For example, Claude for planning + Ollama for execution — best of both worlds.
245
184
 
246
- ```bash
247
- # Install dependencies
248
- npm install
185
+ ## Requirements
186
+
187
+ - **Node.js** >= 22 (required by Copilot CLI provider)
188
+ - **OS**: macOS, Windows, or Linux
189
+ - At least one AI CLI installed: `claude`, `gemini`, `copilot`, or `codex`
190
+
191
+ ## Configuration
249
192
 
250
- # Build all packages
251
- npm run build
193
+ ### Minimal `crewx.yaml`
252
194
 
253
- # Run tests
254
- npm test
195
+ ```yaml
196
+ agents:
197
+ - id: assistant
198
+ provider: cli/claude
199
+ inline:
200
+ prompt: "You are a helpful coding assistant."
201
+ ```
202
+
203
+ ### Full example with skills and workflows
204
+
205
+ ```yaml
206
+ skills:
207
+ paths:
208
+ - ./skills # Custom skill directory
255
209
 
256
- # Build specific package
257
- npm run build --workspace @sowonai/crewx-sdk
258
- npm run build --workspace crewx
210
+ agents:
211
+ - id: lead
212
+ name: Tech Lead
213
+ provider: cli/claude
214
+ skills:
215
+ include:
216
+ - code-reviewer
217
+ - api-designer
218
+ inline:
219
+ model: claude-opus-4-6
220
+ prompt: |
221
+ You are a tech lead responsible for architecture decisions
222
+ and code quality.
223
+
224
+ - id: dev
225
+ name: Developer
226
+ provider: cli/copilot
227
+ inline:
228
+ prompt: |
229
+ You are a full-stack developer.
230
+ Follow the tech lead's guidance.
259
231
  ```
260
232
 
261
- For more information, see:
262
- - [SDK Development Guide](packages/sdk/README.md)
263
- - [CLI Development Guide](packages/cli/README.md)
264
- - [Build & Release Guide](BUILD.md)
233
+ ### CLI Commands
234
+
235
+ | Command | Description |
236
+ |---------|-------------|
237
+ | `npx crewx` | Launch web dashboard |
238
+ | `npx crewx init` | Initialize project with `crewx.yaml` |
239
+ | `npx crewx q "@agent message"` | Query an agent (read-only) |
240
+ | `npx crewx x "@agent message"` | Execute a task (can edit files) |
241
+ | `npx crewx agent list` | List configured agents |
242
+ | `npx crewx doctor` | Check system health |
243
+ | `npx crewx skill list` | List available skills |
244
+ | `npx crewx workflow list` | List workflows |
245
+ | `npx crewx memory index <agent>` | View agent memory |
246
+ | `npx crewx search "query"` | Full-text search |
265
247
 
266
248
  ## Documentation
267
249
 
268
- ### User Guides
269
- - [📖 CLI Guide](docs/cli-guide.md) - Complete CLI reference
270
- - [🔌 MCP Integration](docs/mcp-integration.md) - IDE setup and MCP servers
271
- - [⚙️ Agent Configuration](docs/agent-configuration.md) - Custom agents and advanced config
272
- - [🌐 Remote Agents](docs/remote-agents.md) - Connect to remote CrewX instances
273
- - [📚 Template System](docs/templates.md) - Knowledge management and dynamic prompts for agents
274
- - [📝 Template Variables](docs/template-variables.md) - Dynamic variables in agent configurations
275
- - [🔧 Tool System](docs/tools.md) - Tool integration and creation guide
276
- - [🔧 Troubleshooting](docs/troubleshooting.md) - Common issues and solutions
277
- - [💬 Slack Integration](../../docs/slack-install.md) - Slack bot setup
278
-
279
- ### Developer Guides
280
- - [🏗️ SDK API Reference](packages/sdk/README.md) - Build custom integrations
281
- - [⚙️ CLI Development](packages/cli/README.md) - CLI architecture and development
282
- - [📦 Build & Release](BUILD.md) - Building and releasing packages
283
- - [🔧 Development Workflow](docs/development.md) - Contributing guidelines
250
+ - **Web Dashboard**: Launch with `npx crewx` and explore at `http://localhost:8150`
251
+ - **API Reference**: Swagger UI available at `http://localhost:8150/api/docs`
252
+ - **Contributing**: See [CONTRIBUTING.md](CONTRIBUTING.md)
284
253
 
285
254
  ## License
286
255
 
287
- - **SDK** (`@sowonai/crewx-sdk`): Apache-2.0 License
288
- - **CLI** (`crewx`): MIT License
289
-
290
- Copyright (c) 2025 SowonLabs
291
-
292
- ## Contributing
256
+ CrewX is built on an open-source CLI engine:
293
257
 
294
- We welcome contributions! Please read our [Contributing Guide](CONTRIBUTING.md) before submitting pull requests.
258
+ | Component | License | Notes |
259
+ |-----------|---------|-------|
260
+ | CLI Engine + SDK | Apache-2.0 | Open source — [sowonlabs/crewx](https://github.com/sowonlabs/crewx) |
261
+ | Built-in Tools (`@crewx/*`) | Proprietary | Free to use via npm, source not published |
262
+ | Web UI + Server | Proprietary | Included in this package |
295
263
 
296
- For SDK contributions, please sign our [Contributor License Agreement (CLA)](docs/CLA.md).
264
+ The open-source CLI ([sowonlabs/crewx](https://github.com/sowonlabs/crewx)) is the foundation of this project. New CLI features are developed here first and periodically contributed back to the open-source repository.
297
265
 
298
266
  ---
299
267
 
300
- Built by [SowonLabs](https://github.com/sowonlabs)
268
+ **[SowonLabs](https://sowonlabs.com)** | [GitHub](https://github.com/sowonlabs/crewx) | hello@sowonlabs.com
@@ -0,0 +1,108 @@
1
+ /**
2
+ * crewx launcher library — testable pure-logic functions extracted from crewx.js.
3
+ */
4
+
5
+ /**
6
+ * Parse --port option from extra CLI args and validate the value.
7
+ *
8
+ * @param {string[]} extraArgs - remaining args after route resolution (e.g. ['--port', '3000'])
9
+ * @returns {{ port: number } | { error: string } | null}
10
+ * - `{ port }` when a valid port is found
11
+ * - `{ error }` when --port is present but the value is invalid
12
+ * - `null` when --port is not specified
13
+ */
14
+ export function parseWebPort(extraArgs) {
15
+ const portIdx = extraArgs.indexOf('--port');
16
+ if (portIdx === -1) return null;
17
+ const portVal = Number(extraArgs[portIdx + 1]);
18
+ if (!portVal || portVal < 1 || portVal > 65535) {
19
+ return { error: 'Invalid port number. Use 1-65535.' };
20
+ }
21
+ return { port: portVal };
22
+ }
23
+
24
+ /**
25
+ * Determine the route based on CLI arguments.
26
+ * UI flags (--web, --no-open, --overlay, --electron, --desktop) are checked first.
27
+ * Any other argument routes to CLI. No arguments → web default (with browser auto-open).
28
+ *
29
+ * @param {string[]} args - process.argv.slice(2)
30
+ * @returns {{ route: string, routeArgs: string[] }}
31
+ */
32
+ export function resolveRoute(args) {
33
+ const firstArg = args[0];
34
+
35
+ if (firstArg === '--web') return { route: 'web', routeArgs: args.slice(1) };
36
+ if (firstArg === '--no-open') return { route: 'web', routeArgs: args.slice(1) };
37
+ if (firstArg === '--overlay') return { route: 'overlay', routeArgs: args.slice(1) };
38
+ if (firstArg === '--electron') return { route: 'electron-explicit', routeArgs: args.slice(1) };
39
+ if (firstArg === '--desktop') return { route: 'electron-explicit', routeArgs: args.slice(1) };
40
+ if (firstArg !== undefined) return { route: 'cli', routeArgs: args };
41
+ return { route: 'web-default', routeArgs: args };
42
+ }
43
+
44
+ /**
45
+ * Forward signals to a child process for clean shutdown.
46
+ *
47
+ * Uses an `exited` flag (set by the child's 'exit' event) instead of
48
+ * `child.killed`, because `child.killed` becomes `true` immediately after
49
+ * calling `child.kill()` — even if the child process is still running.
50
+ * This ensures the SIGKILL escalation timer can actually fire.
51
+ *
52
+ * On Windows, SIGTERM is equivalent to an immediate kill.
53
+ *
54
+ * @param {import('child_process').ChildProcess} child
55
+ * @param {{ escalateKill?: boolean, detached?: boolean }} options
56
+ */
57
+ export function setupSignalForwarding(child, { escalateKill = false, detached = false } = {}) {
58
+ let exited = false;
59
+ let escalationScheduled = false;
60
+
61
+ child.on('exit', () => {
62
+ exited = true;
63
+ });
64
+
65
+ // When detached, the child runs in its own process group.
66
+ // Use process.kill(-pid) to kill the entire group (Electron + GPU helpers).
67
+ // When not detached, use child.kill() for single-process kill.
68
+ const killChild = (signal) => {
69
+ try {
70
+ if (detached) {
71
+ process.kill(-child.pid, signal);
72
+ } else {
73
+ child.kill(signal);
74
+ }
75
+ } catch {
76
+ // Process or process group already terminated
77
+ }
78
+ };
79
+
80
+ process.on('SIGINT', () => {
81
+ if (!exited) {
82
+ killChild('SIGTERM');
83
+ if (escalateKill && !escalationScheduled) {
84
+ escalationScheduled = true;
85
+ setTimeout(() => {
86
+ if (!exited) killChild('SIGKILL');
87
+ }, 3000).unref();
88
+ }
89
+ }
90
+ });
91
+
92
+ process.on('SIGTERM', () => {
93
+ if (!exited) killChild('SIGTERM');
94
+ });
95
+
96
+ process.on('SIGHUP', () => {
97
+ if (!exited) killChild('SIGHUP');
98
+ });
99
+
100
+ // Clean up the child process group when the parent exits unexpectedly
101
+ if (detached) {
102
+ process.on('exit', () => {
103
+ if (!exited) {
104
+ try { process.kill(-child.pid, 'SIGKILL'); } catch {}
105
+ }
106
+ });
107
+ }
108
+ }