@portel/photon 1.4.1 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (379) hide show
  1. package/README.md +287 -1160
  2. package/dist/auto-ui/beam.d.ts +9 -0
  3. package/dist/auto-ui/beam.d.ts.map +1 -0
  4. package/dist/auto-ui/beam.js +2381 -0
  5. package/dist/auto-ui/beam.js.map +1 -0
  6. package/dist/auto-ui/components/card.d.ts +13 -0
  7. package/dist/auto-ui/components/card.d.ts.map +1 -0
  8. package/dist/auto-ui/components/card.js +64 -0
  9. package/dist/auto-ui/components/card.js.map +1 -0
  10. package/dist/auto-ui/components/form.d.ts +15 -0
  11. package/dist/auto-ui/components/form.d.ts.map +1 -0
  12. package/dist/auto-ui/components/form.js +72 -0
  13. package/dist/auto-ui/components/form.js.map +1 -0
  14. package/dist/auto-ui/components/list.d.ts +13 -0
  15. package/dist/auto-ui/components/list.d.ts.map +1 -0
  16. package/dist/auto-ui/components/list.js +58 -0
  17. package/dist/auto-ui/components/list.js.map +1 -0
  18. package/dist/auto-ui/components/progress.d.ts +18 -0
  19. package/dist/auto-ui/components/progress.d.ts.map +1 -0
  20. package/dist/auto-ui/components/progress.js +125 -0
  21. package/dist/auto-ui/components/progress.js.map +1 -0
  22. package/dist/auto-ui/components/table.d.ts +13 -0
  23. package/dist/auto-ui/components/table.d.ts.map +1 -0
  24. package/dist/auto-ui/components/table.js +82 -0
  25. package/dist/auto-ui/components/table.js.map +1 -0
  26. package/dist/auto-ui/components/tree.d.ts +13 -0
  27. package/dist/auto-ui/components/tree.d.ts.map +1 -0
  28. package/dist/auto-ui/components/tree.js +61 -0
  29. package/dist/auto-ui/components/tree.js.map +1 -0
  30. package/dist/auto-ui/daemon-tools.d.ts +45 -0
  31. package/dist/auto-ui/daemon-tools.d.ts.map +1 -0
  32. package/dist/auto-ui/daemon-tools.js +580 -0
  33. package/dist/auto-ui/daemon-tools.js.map +1 -0
  34. package/dist/auto-ui/design-system/index.d.ts +21 -0
  35. package/dist/auto-ui/design-system/index.d.ts.map +1 -0
  36. package/dist/auto-ui/design-system/index.js +27 -0
  37. package/dist/auto-ui/design-system/index.js.map +1 -0
  38. package/dist/auto-ui/design-system/tokens.d.ts +9 -0
  39. package/dist/auto-ui/design-system/tokens.d.ts.map +1 -0
  40. package/dist/auto-ui/design-system/tokens.js +27 -0
  41. package/dist/auto-ui/design-system/tokens.js.map +1 -0
  42. package/dist/auto-ui/design-system/transaction-ui.d.ts +70 -0
  43. package/dist/auto-ui/design-system/transaction-ui.d.ts.map +1 -0
  44. package/dist/auto-ui/design-system/transaction-ui.js +982 -0
  45. package/dist/auto-ui/design-system/transaction-ui.js.map +1 -0
  46. package/dist/auto-ui/frontend/index.html +84 -0
  47. package/dist/auto-ui/index.d.ts +21 -0
  48. package/dist/auto-ui/index.d.ts.map +1 -0
  49. package/dist/auto-ui/index.js +25 -0
  50. package/dist/auto-ui/index.js.map +1 -0
  51. package/dist/auto-ui/openapi-generator.d.ts +71 -0
  52. package/dist/auto-ui/openapi-generator.d.ts.map +1 -0
  53. package/dist/auto-ui/openapi-generator.js +223 -0
  54. package/dist/auto-ui/openapi-generator.js.map +1 -0
  55. package/dist/auto-ui/photon-bridge.d.ts +159 -0
  56. package/dist/auto-ui/photon-bridge.d.ts.map +1 -0
  57. package/dist/auto-ui/photon-bridge.js +262 -0
  58. package/dist/auto-ui/photon-bridge.js.map +1 -0
  59. package/dist/auto-ui/photon-host.d.ts +113 -0
  60. package/dist/auto-ui/photon-host.d.ts.map +1 -0
  61. package/dist/auto-ui/photon-host.js +284 -0
  62. package/dist/auto-ui/photon-host.js.map +1 -0
  63. package/dist/auto-ui/platform-compat.d.ts +71 -0
  64. package/dist/auto-ui/platform-compat.d.ts.map +1 -0
  65. package/dist/auto-ui/platform-compat.js +574 -0
  66. package/dist/auto-ui/platform-compat.js.map +1 -0
  67. package/dist/auto-ui/playground-html.d.ts +15 -0
  68. package/dist/auto-ui/playground-html.d.ts.map +1 -0
  69. package/dist/auto-ui/playground-html.js +1113 -0
  70. package/dist/auto-ui/playground-html.js.map +1 -0
  71. package/dist/auto-ui/playground-server.d.ts +7 -0
  72. package/dist/auto-ui/playground-server.d.ts.map +1 -0
  73. package/dist/auto-ui/playground-server.js +840 -0
  74. package/dist/auto-ui/playground-server.js.map +1 -0
  75. package/dist/auto-ui/registry.d.ts +13 -0
  76. package/dist/auto-ui/registry.d.ts.map +1 -0
  77. package/dist/auto-ui/registry.js +62 -0
  78. package/dist/auto-ui/registry.js.map +1 -0
  79. package/dist/auto-ui/renderer.d.ts +14 -0
  80. package/dist/auto-ui/renderer.d.ts.map +1 -0
  81. package/dist/auto-ui/renderer.js +88 -0
  82. package/dist/auto-ui/renderer.js.map +1 -0
  83. package/dist/auto-ui/rendering/components.d.ts +29 -0
  84. package/dist/auto-ui/rendering/components.d.ts.map +1 -0
  85. package/dist/auto-ui/rendering/components.js +773 -0
  86. package/dist/auto-ui/rendering/components.js.map +1 -0
  87. package/dist/auto-ui/rendering/field-analyzer.d.ts +48 -0
  88. package/dist/auto-ui/rendering/field-analyzer.d.ts.map +1 -0
  89. package/dist/auto-ui/rendering/field-analyzer.js +270 -0
  90. package/dist/auto-ui/rendering/field-analyzer.js.map +1 -0
  91. package/dist/auto-ui/rendering/field-renderers.d.ts +64 -0
  92. package/dist/auto-ui/rendering/field-renderers.d.ts.map +1 -0
  93. package/dist/auto-ui/rendering/field-renderers.js +317 -0
  94. package/dist/auto-ui/rendering/field-renderers.js.map +1 -0
  95. package/dist/auto-ui/rendering/index.d.ts +28 -0
  96. package/dist/auto-ui/rendering/index.d.ts.map +1 -0
  97. package/dist/auto-ui/rendering/index.js +60 -0
  98. package/dist/auto-ui/rendering/index.js.map +1 -0
  99. package/dist/auto-ui/rendering/layout-selector.d.ts +48 -0
  100. package/dist/auto-ui/rendering/layout-selector.d.ts.map +1 -0
  101. package/dist/auto-ui/rendering/layout-selector.js +352 -0
  102. package/dist/auto-ui/rendering/layout-selector.js.map +1 -0
  103. package/dist/auto-ui/rendering/template-engine.d.ts +41 -0
  104. package/dist/auto-ui/rendering/template-engine.d.ts.map +1 -0
  105. package/dist/auto-ui/rendering/template-engine.js +238 -0
  106. package/dist/auto-ui/rendering/template-engine.js.map +1 -0
  107. package/dist/auto-ui/streamable-http-transport.d.ts +79 -0
  108. package/dist/auto-ui/streamable-http-transport.d.ts.map +1 -0
  109. package/dist/auto-ui/streamable-http-transport.js +1314 -0
  110. package/dist/auto-ui/streamable-http-transport.js.map +1 -0
  111. package/dist/auto-ui/types.d.ts +310 -0
  112. package/dist/auto-ui/types.d.ts.map +1 -0
  113. package/dist/auto-ui/types.js +71 -0
  114. package/dist/auto-ui/types.js.map +1 -0
  115. package/dist/beam.bundle.js +13506 -0
  116. package/dist/beam.bundle.js.map +7 -0
  117. package/dist/claude-code-plugin.d.ts.map +1 -1
  118. package/dist/claude-code-plugin.js +30 -30
  119. package/dist/claude-code-plugin.js.map +1 -1
  120. package/dist/cli/commands/info.d.ts +11 -0
  121. package/dist/cli/commands/info.d.ts.map +1 -0
  122. package/dist/cli/commands/info.js +313 -0
  123. package/dist/cli/commands/info.js.map +1 -0
  124. package/dist/cli/commands/marketplace.d.ts +11 -0
  125. package/dist/cli/commands/marketplace.d.ts.map +1 -0
  126. package/dist/cli/commands/marketplace.js +198 -0
  127. package/dist/cli/commands/marketplace.js.map +1 -0
  128. package/dist/cli/commands/package-app.d.ts +9 -0
  129. package/dist/cli/commands/package-app.d.ts.map +1 -0
  130. package/dist/cli/commands/package-app.js +191 -0
  131. package/dist/cli/commands/package-app.js.map +1 -0
  132. package/dist/cli/commands/package.d.ts +11 -0
  133. package/dist/cli/commands/package.d.ts.map +1 -0
  134. package/dist/cli/commands/package.js +573 -0
  135. package/dist/cli/commands/package.js.map +1 -0
  136. package/dist/cli-alias.d.ts.map +1 -1
  137. package/dist/cli-alias.js +30 -28
  138. package/dist/cli-alias.js.map +1 -1
  139. package/dist/cli-formatter.d.ts +8 -24
  140. package/dist/cli-formatter.d.ts.map +1 -1
  141. package/dist/cli-formatter.js +8 -325
  142. package/dist/cli-formatter.js.map +1 -1
  143. package/dist/cli.d.ts +15 -1
  144. package/dist/cli.d.ts.map +1 -1
  145. package/dist/cli.js +1157 -1132
  146. package/dist/cli.js.map +1 -1
  147. package/dist/daemon/client.d.ts +79 -0
  148. package/dist/daemon/client.d.ts.map +1 -1
  149. package/dist/daemon/client.js +532 -8
  150. package/dist/daemon/client.js.map +1 -1
  151. package/dist/daemon/manager.d.ts +46 -12
  152. package/dist/daemon/manager.d.ts.map +1 -1
  153. package/dist/daemon/manager.js +102 -61
  154. package/dist/daemon/manager.js.map +1 -1
  155. package/dist/daemon/protocol.d.ts +62 -6
  156. package/dist/daemon/protocol.d.ts.map +1 -1
  157. package/dist/daemon/protocol.js +76 -1
  158. package/dist/daemon/protocol.js.map +1 -1
  159. package/dist/daemon/server.d.ts +6 -6
  160. package/dist/daemon/server.js +743 -133
  161. package/dist/daemon/server.js.map +1 -1
  162. package/dist/daemon/session-manager.d.ts +8 -1
  163. package/dist/daemon/session-manager.d.ts.map +1 -1
  164. package/dist/daemon/session-manager.js +32 -9
  165. package/dist/daemon/session-manager.js.map +1 -1
  166. package/dist/deploy/cloudflare.d.ts +12 -0
  167. package/dist/deploy/cloudflare.d.ts.map +1 -0
  168. package/dist/deploy/cloudflare.js +216 -0
  169. package/dist/deploy/cloudflare.js.map +1 -0
  170. package/dist/index.d.ts +1 -0
  171. package/dist/index.d.ts.map +1 -1
  172. package/dist/index.js +3 -0
  173. package/dist/index.js.map +1 -1
  174. package/dist/loader.d.ts +168 -21
  175. package/dist/loader.d.ts.map +1 -1
  176. package/dist/loader.js +1120 -318
  177. package/dist/loader.js.map +1 -1
  178. package/dist/markdown-utils.d.ts +8 -0
  179. package/dist/markdown-utils.d.ts.map +1 -0
  180. package/dist/markdown-utils.js +63 -0
  181. package/dist/markdown-utils.js.map +1 -0
  182. package/dist/marketplace-manager.d.ts +10 -0
  183. package/dist/marketplace-manager.d.ts.map +1 -1
  184. package/dist/marketplace-manager.js +112 -28
  185. package/dist/marketplace-manager.js.map +1 -1
  186. package/dist/mcp-client.d.ts +9 -0
  187. package/dist/mcp-client.d.ts.map +1 -0
  188. package/dist/mcp-client.js +11 -0
  189. package/dist/mcp-client.js.map +1 -0
  190. package/dist/mcp-elicitation.d.ts +32 -0
  191. package/dist/mcp-elicitation.d.ts.map +1 -0
  192. package/dist/mcp-elicitation.js +26 -0
  193. package/dist/mcp-elicitation.js.map +1 -0
  194. package/dist/path-resolver.d.ts +9 -12
  195. package/dist/path-resolver.d.ts.map +1 -1
  196. package/dist/path-resolver.js +13 -43
  197. package/dist/path-resolver.js.map +1 -1
  198. package/dist/photon-cli-runner.d.ts.map +1 -1
  199. package/dist/photon-cli-runner.js +202 -77
  200. package/dist/photon-cli-runner.js.map +1 -1
  201. package/dist/photon-doc-extractor.d.ts +88 -0
  202. package/dist/photon-doc-extractor.d.ts.map +1 -1
  203. package/dist/photon-doc-extractor.js +536 -27
  204. package/dist/photon-doc-extractor.js.map +1 -1
  205. package/dist/photons/maker.photon.d.ts +182 -0
  206. package/dist/photons/maker.photon.d.ts.map +1 -0
  207. package/dist/photons/maker.photon.js +504 -0
  208. package/dist/photons/maker.photon.js.map +1 -0
  209. package/dist/photons/maker.photon.ts +626 -0
  210. package/dist/photons/marketplace.photon.d.ts +110 -0
  211. package/dist/photons/marketplace.photon.d.ts.map +1 -0
  212. package/dist/photons/marketplace.photon.js +260 -0
  213. package/dist/photons/marketplace.photon.js.map +1 -0
  214. package/dist/photons/marketplace.photon.ts +378 -0
  215. package/dist/photons/tunnel.photon.d.ts +80 -0
  216. package/dist/photons/tunnel.photon.d.ts.map +1 -0
  217. package/dist/photons/tunnel.photon.js +269 -0
  218. package/dist/photons/tunnel.photon.js.map +1 -0
  219. package/dist/photons/tunnel.photon.ts +345 -0
  220. package/dist/security-scanner.d.ts.map +1 -1
  221. package/dist/security-scanner.js +18 -15
  222. package/dist/security-scanner.js.map +1 -1
  223. package/dist/serv/auth/jwt.d.ts +89 -0
  224. package/dist/serv/auth/jwt.d.ts.map +1 -0
  225. package/dist/serv/auth/jwt.js +239 -0
  226. package/dist/serv/auth/jwt.js.map +1 -0
  227. package/dist/serv/auth/oauth.d.ts +117 -0
  228. package/dist/serv/auth/oauth.d.ts.map +1 -0
  229. package/dist/serv/auth/oauth.js +395 -0
  230. package/dist/serv/auth/oauth.js.map +1 -0
  231. package/dist/serv/auth/well-known.d.ts +60 -0
  232. package/dist/serv/auth/well-known.d.ts.map +1 -0
  233. package/dist/serv/auth/well-known.js +154 -0
  234. package/dist/serv/auth/well-known.js.map +1 -0
  235. package/dist/serv/db/d1-client.d.ts +65 -0
  236. package/dist/serv/db/d1-client.d.ts.map +1 -0
  237. package/dist/serv/db/d1-client.js +137 -0
  238. package/dist/serv/db/d1-client.js.map +1 -0
  239. package/dist/serv/db/d1-stores.d.ts +62 -0
  240. package/dist/serv/db/d1-stores.d.ts.map +1 -0
  241. package/dist/serv/db/d1-stores.js +307 -0
  242. package/dist/serv/db/d1-stores.js.map +1 -0
  243. package/dist/serv/index.d.ts +114 -0
  244. package/dist/serv/index.d.ts.map +1 -0
  245. package/dist/serv/index.js +172 -0
  246. package/dist/serv/index.js.map +1 -0
  247. package/dist/serv/local.d.ts +118 -0
  248. package/dist/serv/local.d.ts.map +1 -0
  249. package/dist/serv/local.js +392 -0
  250. package/dist/serv/local.js.map +1 -0
  251. package/dist/serv/middleware/auth.d.ts +66 -0
  252. package/dist/serv/middleware/auth.d.ts.map +1 -0
  253. package/dist/serv/middleware/auth.js +178 -0
  254. package/dist/serv/middleware/auth.js.map +1 -0
  255. package/dist/serv/middleware/tenant.d.ts +94 -0
  256. package/dist/serv/middleware/tenant.d.ts.map +1 -0
  257. package/dist/serv/middleware/tenant.js +152 -0
  258. package/dist/serv/middleware/tenant.js.map +1 -0
  259. package/dist/serv/runtime/executor.d.ts +76 -0
  260. package/dist/serv/runtime/executor.d.ts.map +1 -0
  261. package/dist/serv/runtime/executor.js +105 -0
  262. package/dist/serv/runtime/executor.js.map +1 -0
  263. package/dist/serv/runtime/index.d.ts +8 -0
  264. package/dist/serv/runtime/index.d.ts.map +1 -0
  265. package/dist/serv/runtime/index.js +10 -0
  266. package/dist/serv/runtime/index.js.map +1 -0
  267. package/dist/serv/runtime/oauth-context.d.ts +121 -0
  268. package/dist/serv/runtime/oauth-context.d.ts.map +1 -0
  269. package/dist/serv/runtime/oauth-context.js +153 -0
  270. package/dist/serv/runtime/oauth-context.js.map +1 -0
  271. package/dist/serv/session/kv-store.d.ts +54 -0
  272. package/dist/serv/session/kv-store.d.ts.map +1 -0
  273. package/dist/serv/session/kv-store.js +149 -0
  274. package/dist/serv/session/kv-store.js.map +1 -0
  275. package/dist/serv/session/store.d.ts +113 -0
  276. package/dist/serv/session/store.d.ts.map +1 -0
  277. package/dist/serv/session/store.js +284 -0
  278. package/dist/serv/session/store.js.map +1 -0
  279. package/dist/serv/types/index.d.ts +147 -0
  280. package/dist/serv/types/index.d.ts.map +1 -0
  281. package/dist/serv/types/index.js +8 -0
  282. package/dist/serv/types/index.js.map +1 -0
  283. package/dist/serv/vault/token-vault.d.ts +102 -0
  284. package/dist/serv/vault/token-vault.d.ts.map +1 -0
  285. package/dist/serv/vault/token-vault.js +177 -0
  286. package/dist/serv/vault/token-vault.js.map +1 -0
  287. package/dist/server.d.ts +173 -0
  288. package/dist/server.d.ts.map +1 -1
  289. package/dist/server.js +1622 -86
  290. package/dist/server.js.map +1 -1
  291. package/dist/shared/cli-sections.d.ts +6 -0
  292. package/dist/shared/cli-sections.d.ts.map +1 -0
  293. package/dist/shared/cli-sections.js +16 -0
  294. package/dist/shared/cli-sections.js.map +1 -0
  295. package/dist/shared/cli-utils.d.ts +81 -0
  296. package/dist/shared/cli-utils.d.ts.map +1 -0
  297. package/dist/shared/cli-utils.js +174 -0
  298. package/dist/shared/cli-utils.js.map +1 -0
  299. package/dist/shared/config-docs.d.ts +6 -0
  300. package/dist/shared/config-docs.d.ts.map +1 -0
  301. package/dist/shared/config-docs.js +6 -0
  302. package/dist/shared/config-docs.js.map +1 -0
  303. package/dist/shared/error-handler.d.ts +128 -0
  304. package/dist/shared/error-handler.d.ts.map +1 -0
  305. package/dist/shared/error-handler.js +342 -0
  306. package/dist/shared/error-handler.js.map +1 -0
  307. package/dist/shared/logger.d.ts +42 -0
  308. package/dist/shared/logger.d.ts.map +1 -0
  309. package/dist/shared/logger.js +123 -0
  310. package/dist/shared/logger.js.map +1 -0
  311. package/dist/shared/performance.d.ts +65 -0
  312. package/dist/shared/performance.d.ts.map +1 -0
  313. package/dist/shared/performance.js +136 -0
  314. package/dist/shared/performance.js.map +1 -0
  315. package/dist/shared/task-runner.d.ts +2 -0
  316. package/dist/shared/task-runner.d.ts.map +1 -0
  317. package/dist/shared/task-runner.js +16 -0
  318. package/dist/shared/task-runner.js.map +1 -0
  319. package/dist/shared/validation.d.ts +6 -0
  320. package/dist/shared/validation.d.ts.map +1 -0
  321. package/dist/shared/validation.js +6 -0
  322. package/dist/shared/validation.js.map +1 -0
  323. package/dist/shared-utils.d.ts +63 -0
  324. package/dist/shared-utils.d.ts.map +1 -0
  325. package/dist/shared-utils.js +123 -0
  326. package/dist/shared-utils.js.map +1 -0
  327. package/dist/template-manager.d.ts +23 -2
  328. package/dist/template-manager.d.ts.map +1 -1
  329. package/dist/template-manager.js +175 -86
  330. package/dist/template-manager.js.map +1 -1
  331. package/dist/test-client.d.ts.map +1 -1
  332. package/dist/test-client.js +10 -8
  333. package/dist/test-client.js.map +1 -1
  334. package/dist/test-runner.d.ts +52 -0
  335. package/dist/test-runner.d.ts.map +1 -0
  336. package/dist/test-runner.js +785 -0
  337. package/dist/test-runner.js.map +1 -0
  338. package/dist/testing.d.ts +103 -0
  339. package/dist/testing.d.ts.map +1 -0
  340. package/dist/testing.js +163 -0
  341. package/dist/testing.js.map +1 -0
  342. package/dist/version-checker.d.ts.map +1 -1
  343. package/dist/version-checker.js +2 -2
  344. package/dist/version-checker.js.map +1 -1
  345. package/dist/version.d.ts +2 -0
  346. package/dist/version.d.ts.map +1 -0
  347. package/dist/version.js +5 -0
  348. package/dist/version.js.map +1 -0
  349. package/dist/watcher.d.ts +6 -3
  350. package/dist/watcher.d.ts.map +1 -1
  351. package/dist/watcher.js +49 -10
  352. package/dist/watcher.js.map +1 -1
  353. package/package.json +47 -7
  354. package/templates/cloudflare/worker.ts.template +381 -0
  355. package/templates/cloudflare/wrangler.toml.template +9 -0
  356. package/dist/base.d.ts +0 -58
  357. package/dist/base.d.ts.map +0 -1
  358. package/dist/base.js +0 -92
  359. package/dist/base.js.map +0 -1
  360. package/dist/dependency-manager.d.ts +0 -49
  361. package/dist/dependency-manager.d.ts.map +0 -1
  362. package/dist/dependency-manager.js +0 -165
  363. package/dist/dependency-manager.js.map +0 -1
  364. package/dist/registry-manager.d.ts +0 -76
  365. package/dist/registry-manager.d.ts.map +0 -1
  366. package/dist/registry-manager.js +0 -220
  367. package/dist/registry-manager.js.map +0 -1
  368. package/dist/schema-extractor.d.ts +0 -110
  369. package/dist/schema-extractor.d.ts.map +0 -1
  370. package/dist/schema-extractor.js +0 -727
  371. package/dist/schema-extractor.js.map +0 -1
  372. package/dist/test-marketplace-sources.d.ts +0 -5
  373. package/dist/test-marketplace-sources.d.ts.map +0 -1
  374. package/dist/test-marketplace-sources.js +0 -53
  375. package/dist/test-marketplace-sources.js.map +0 -1
  376. package/dist/types.d.ts +0 -109
  377. package/dist/types.d.ts.map +0 -1
  378. package/dist/types.js +0 -12
  379. package/dist/types.js.map +0 -1
package/README.md CHANGED
@@ -1,84 +1,38 @@
1
1
 
2
- ![Photon Logo](https://raw.githubusercontent.com/portel-dev/photon/refs/heads/main/assets/photon-logo.png)
2
+ <div align="center">
3
3
 
4
- [![npm version](https://badgen.net/npm/v/@portel/photon)](https://www.npmjs.com/package/@portel/photon)
5
- [![npm downloads](https://badgen.net/npm/dm/@portel/photon)](https://www.npmjs.com/package/@portel/photon)
6
- [![MCP](https://img.shields.io/badge/MCP-Compatible-blue)](https://modelcontextprotocol.io)
4
+ <img src="https://raw.githubusercontent.com/portel-dev/photon/main/assets/photon-logo.png" alt="Photon" width="500">
7
5
 
8
- # Photon
6
+ **Build MCP servers from single TypeScript files.**
9
7
 
10
- **Universal runtime that turns single-file TypeScript into MCP server, CLI, and more.**
8
+ Write business logic. Get an MCP server, CLI, and web UI — automatically.
11
9
 
12
- Photon TS files are Single file. Zero boilerplate. Pure business logic.
10
+ [![npm version](https://img.shields.io/npm/v/@portel/photon?color=cb3837&label=npm)](https://www.npmjs.com/package/@portel/photon)
11
+ [![npm downloads](https://img.shields.io/npm/dm/@portel/photon?color=cb3837)](https://www.npmjs.com/package/@portel/photon)
12
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/portel-dev/photon/blob/main/LICENSE)
13
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-3178c6.svg)](https://www.typescriptlang.org)
14
+ [![Node](https://img.shields.io/badge/node-%3E%3D18-43853d.svg)](https://nodejs.org)
15
+ [![MCP](https://img.shields.io/badge/MCP-compatible-7c3aed.svg)](https://modelcontextprotocol.io)
13
16
 
14
- ---
15
-
16
- ## TL;DR
17
-
18
- **The Problem with MCPs Today:**
19
-
20
- - Popular MCPs don't exactly match your specific requirements
21
- - **Security risk**: Malicious MCPs can steal your data through prompt injection—not just credentials
22
- - Scattered across 4-6 files, making security audits impractical
23
- - Too complex to fork and customize safely
24
-
25
- **Photon's Solution:** Single-file TypeScript format. Pure business logic, zero boilerplate. Fork-first design where every `.photon.ts` is trivial to audit and customize.
26
-
27
- Think of it like **NPM and Node, but for MCP**.
28
-
29
- ### Write Once, Use Everywhere
30
-
31
- The same `.photon.ts` file automatically becomes:
32
- - 🤖 **MCP Server** - Tools for Claude Desktop, Cursor, and AI assistants
33
- - 💻 **CLI Tool** - Beautiful command-line interface for humans
34
- - 🔌 **Platform Integrations** - NCP, Lumina, and future runtimes
35
-
36
- ```bash
37
- # Same file, multiple interfaces:
38
- photon mcp analytics # Run as MCP server for AI
39
- photon cli analytics revenue # Use as CLI tool for humans
40
- ```
41
-
42
- **Zero extra code. Pure business logic. Infinite deployment targets.**
43
-
44
- ### The Photon Ecosystem Flywheel
45
-
46
- ![Photon Ecosystem](https://raw.githubusercontent.com/portel-dev/photon/refs/heads/main/assets/photon-ecosystem.png)
17
+ [Quick Start](#quick-start) · [Features](#features) · [Beam UI](#beam) · [Marketplace](#marketplace) · [Docs](#documentation)
47
18
 
48
- The ecosystem creates a virtuous cycle: AI generates photons → Runtime executes them → Community shares → AI gets smarter.
19
+ </div>
49
20
 
50
21
  ---
51
22
 
52
- ## The Problem
53
-
54
- Traditional MCP servers scatter your logic across 4-6 files:
23
+ ## Quick Start
55
24
 
25
+ ```bash
26
+ npm install -g @portel/photon
27
+ photon init my-tool
28
+ photon # Open Beam UI in your browser
56
29
  ```
57
- traditional-mcp/
58
- ├── server.ts (50 lines of boilerplate)
59
- ├── transport.ts (40 lines of setup)
60
- ├── schemas.ts (40 lines of type definitions)
61
- ├── types.ts (30 lines more types)
62
- ├── package.json (dependencies)
63
- └── business.ts (20 lines of YOUR CODE)
64
- ```
65
-
66
- **This creates real problems:**
67
-
68
- - ❌ **For AI agents**: Scattered context across files makes understanding difficult
69
- - ❌ **For humans**: Jump between files to understand one feature
70
- - ❌ **For teams**: 200+ lines before you write business logic
71
- - ❌ **For maintenance**: Changes require updating multiple files and configs
72
30
 
73
- ---
74
-
75
- ## The Solution
76
-
77
- Photon puts everything in **one file**:
31
+ Create `analytics.photon.ts` — no boilerplate, no config files:
78
32
 
79
33
  ```typescript
80
34
  /**
81
- * Analytics - Query company analytics database
35
+ * Analytics - Query company analytics
82
36
  * @dependencies pg@^8.11.0
83
37
  */
84
38
  import { Client } from 'pg';
@@ -86,1285 +40,458 @@ import { Client } from 'pg';
86
40
  export default class Analytics {
87
41
  private db: Client;
88
42
 
89
- constructor(
90
- private host: string,
91
- private database: string,
92
- private password: string
93
- ) {}
43
+ constructor(private host: string, private database: string, private password: string) {}
94
44
 
95
45
  async onInitialize() {
96
- this.db = new Client({
97
- host: this.host,
98
- database: this.database,
99
- password: this.password
100
- });
46
+ this.db = new Client({ host: this.host, database: this.database, password: this.password });
101
47
  await this.db.connect();
102
48
  }
103
49
 
104
- /**
105
- * Get revenue by date range
106
- * @param startDate Start date (YYYY-MM-DD)
107
- * @param endDate End date (YYYY-MM-DD)
108
- */
50
+ /** Get revenue by date range */
109
51
  async revenue(params: { startDate: string; endDate: string }) {
110
- const result = await this.db.query(
52
+ return (await this.db.query(
111
53
  'SELECT date, SUM(amount) FROM orders WHERE date BETWEEN $1 AND $2 GROUP BY date',
112
54
  [params.startDate, params.endDate]
113
- );
114
- return result.rows;
55
+ )).rows;
115
56
  }
116
57
  }
117
58
  ```
118
59
 
119
- **40 lines. One file. Production-ready.**
120
-
121
- ### Use It Everywhere
122
-
123
- That single file now works as both an **MCP server** and a **CLI tool**:
60
+ Same file, three interfaces:
124
61
 
125
62
  ```bash
126
- # As an MCP server (for AI assistants)
127
- photon mcp analytics
128
- # Claude Desktop can now call revenue() as a tool
129
-
130
- # As a CLI (for humans)
131
- photon cli analytics revenue --startDate 2024-01-01 --endDate 2024-12-31
132
- # → Beautiful formatted output:
133
- # ┌────────────┬──────────┐
134
- # │ Date │ Revenue │
135
- # ├────────────┼──────────┤
136
- # │ 2024-01-01 │ $12,450 │
137
- # │ 2024-01-02 │ $15,320 │
138
- # └────────────┴──────────┘
63
+ photon mcp analytics # MCP server for Claude, Cursor, Zed
64
+ photon cli analytics revenue # CLI for humans
65
+ photon # Beam web UI
139
66
  ```
140
67
 
141
- **Same code. Same logic. Two interfaces. Zero duplication.**
68
+ <div align="center">
69
+ <img src="https://raw.githubusercontent.com/portel-dev/photon/main/assets/photon-concept.jpg" alt="Photon — One file, three interfaces" width="700">
70
+ </div>
142
71
 
143
72
  ---
144
73
 
145
- ## Why One File Changes Everything
74
+ ## Beam
146
75
 
147
- ### 🤖 AI-Native Design
76
+ Beam is the human interface to MCP — browse, configure, test, and execute tools visually.
148
77
 
149
- AI agents can now understand your entire MCP in one context:
78
+ <div align="center">
79
+ <img src="https://raw.githubusercontent.com/portel-dev/photon/main/assets/beam-dashboard.png" alt="Beam Dashboard" width="700">
80
+ </div>
150
81
 
151
- ```bash
152
- # AI can read, understand, and suggest improvements
153
- "Read my analytics.photon.ts and explain how it works"
154
- "Review this photon for security issues"
155
- "Add error handling to this photon"
156
- ```
82
+ <br>
157
83
 
158
- Traditional MCPs require AI to piece together scattered files — Photons give complete context.
84
+ <table>
85
+ <tr>
86
+ <td width="50%">
159
87
 
160
- ### 👤 Human-Friendly
88
+ <img src="https://raw.githubusercontent.com/portel-dev/photon/main/assets/beam-tool-form.png" alt="Auto-generated forms" width="100%">
161
89
 
162
- - **Understand**: Read one file, understand the whole system
163
- - **Review**: Code reviews are one file, one story
164
- - **Debug**: All logic in one place, no jumping around
165
- - **Learn**: New team members read one file
90
+ **Auto-generated forms** Built from your TypeScript types. Required fields marked, types validated.
166
91
 
167
- ### 🔧 Fork-First Philosophy
92
+ </td>
93
+ <td width="50%">
168
94
 
169
- Every photon is designed to be customized:
95
+ <img src="https://raw.githubusercontent.com/portel-dev/photon/main/assets/beam-execute.png" alt="Tool execution" width="100%">
170
96
 
171
- ```bash
172
- # Copy, modify, done — no build configs to update
173
- cp ~/.photon/jira.photon.ts ~/.photon/my-jira.photon.ts
174
- # Edit my-jira.photon.ts however you want
175
- photon mcp my-jira # Works immediately
176
- ```
177
-
178
- **Use cases:**
179
-
180
- - Add company-specific authentication
181
- - Customize business logic
182
- - Merge multiple photons
183
- - Experiment without breaking originals
184
-
185
- ### 🔒 Security Through Transparency
186
-
187
- Prompt injection attacks are the new supply-chain threat. A malicious MCP can manipulate AI responses to exfiltrate your entire conversation history—not just credentials.
188
-
189
- **One file = one audit:**
97
+ **Execute and verify** — Test every tool before deploying to AI. See exactly what AI will see.
190
98
 
191
- - Read 40 lines, understand everything
192
- - No hidden code scattered across imports
193
- - Fork and verify in minutes, not hours
194
- - Trust through transparency, not reputation
99
+ </td>
100
+ </tr>
101
+ </table>
195
102
 
196
- When you can't trust a photon, you can **safely fork and audit it**. Traditional MCPs with scattered logic? Nearly impossible to verify.
197
-
198
- ### 📦 Zero-Friction Dependencies
199
-
200
- Dependencies are auto-installed via JSDoc (like `npx` or `uv`):
103
+ Constructor parameters become form fields, environment variables, and CLI flags automatically:
201
104
 
202
105
  ```typescript
203
- /**
204
- * @dependencies axios@^1.6.0, lodash@^4.17.21
205
- */
106
+ constructor(
107
+ private host: string, // → ANALYTICS_HOST env var → text field
108
+ private database: string, // → ANALYTICS_DATABASE → text field
109
+ private password: string // → ANALYTICS_PASSWORD → password field
110
+ ) {}
206
111
  ```
207
112
 
208
- No manual `npm install`. No `package.json`. Photon handles it.
209
-
210
113
  ---
211
114
 
212
- ## Quick Start
115
+ ## Features
213
116
 
214
- ### Install
117
+ ### Convention Over Configuration
215
118
 
216
- ```bash
217
- npm install -g @portel/photon
218
- ```
219
-
220
- ### Use Ready-Made Photons
221
-
222
- The [**official Photon marketplace**](https://github.com/portel-dev/photons) comes pre-configured with 16+ production-ready photons:
119
+ | What You Write | What Photon Does |
120
+ |----------------|-----------------|
121
+ | `analytics.photon.ts` | MCP server name: `analytics` |
122
+ | `async revenue()` | MCP tool: `revenue` |
123
+ | TypeScript types | JSON Schema (auto-generated) |
124
+ | JSDoc comments | Tool descriptions |
125
+ | Constructor params | Env vars + config UI |
126
+ | `@dependencies pg@^8.11.0` | Auto-install on first run |
223
127
 
224
- ```bash
225
- # Browse all photons
226
- photon info
227
-
228
- # Install any photon (filesystem, git, postgres, mongodb, slack, etc.)
229
- photon add filesystem
128
+ ### Full Platform
230
129
 
231
- # or else copy your own .photon.ts file to
232
- # .photon folder in your user folder
233
-
234
- # Call info command with mcp option
235
- photon info filesystem --mcp
236
- # Get client config json
237
- {
238
- "filesystem": {
239
- "command": "photon",
240
- "args": [
241
- "mcp",
242
- "filesystem"
243
- ],
244
- "env": {
245
- "FILESYSTEM_WORKDIR": "/Users/arul/Documents",
246
- "FILESYSTEM_MAX_FILE_SIZE": "10485760",
247
- "FILESYSTEM_ALLOW_HIDDEN": "false"
248
- }
249
- }
250
- }
251
- # Add to your client
252
- ```
130
+ - **Hot Reload** `--dev` flag watches for changes and reloads instantly
131
+ - **Daemon Protocol** Pub/sub channels, distributed locks, scheduled jobs, webhooks
132
+ - **Custom UIs** — Build rich interfaces with `window.photon` API
133
+ - **OAuth** Built-in OAuth 2.1 with Google, GitHub, Microsoft providers
134
+ - **MCP Composition** — Call other MCP servers with `@mcp` tag
135
+ - **Deployment** Docker, Cloudflare Workers, AWS Lambda, Systemd
253
136
 
254
- ### Build Photons with AI
137
+ ### Why Single File?
255
138
 
256
- Use the [**photon-skill**](https://github.com/portel-dev/photon-skill) for Claude Desktop or Claude Code to generate `.photon.ts` files:
257
- - Single TypeScript files with metadata
258
- - AI understands complete context in one file
259
- - Zero boilerplate, just business logic
139
+ Traditional MCPs scatter logic across 4-6 files. Photon keeps everything in one:
260
140
 
261
- ### Add Your Own Marketplace
262
-
263
- ```bash
264
- # Add custom marketplace from GitHub
265
- photon marketplace add your-org/your-photons
266
-
267
- # Install from your marketplace
268
- photon add your-custom-tool
269
- ```
141
+ | | Traditional MCP | Photon |
142
+ |---|---|---|
143
+ | **Files** | 4-6 (server, transport, schemas, types, config) | 1 |
144
+ | **Boilerplate** | 150+ lines before business logic | 0 |
145
+ | **Security audit** | Hours across multiple files | Minutes, one file |
146
+ | **Fork and customize** | Build config, dependency management | Copy, edit, run |
147
+ | **AI context** | Scattered, multi-file coordination | Complete in one read |
270
148
 
271
149
  ---
272
150
 
273
- ## The Value Proposition
274
-
275
- | Metric | Traditional MCP | Photon |
276
- |--------|-----------------|--------|
277
- | **Setup Time** | 40 minutes | 5 minutes |
278
- | **Lines of Code** | 200+ | ~40 |
279
- | **Files Needed** | 4-6 files | 1 file |
280
- | **Boilerplate** | Manual | Auto-handled |
281
- | **Schema Generation** | Manual | Automatic from TypeScript |
282
- | **Dependencies** | Manual npm install | Auto-installed from @dependencies |
283
- | **Hot Reload** | Configure yourself | Built-in with --dev |
284
- | **AI Context** | Scattered | Single file |
285
- | **CLI Interface** | Write separate code | Automatic from same code |
286
- | **Deployment Targets** | MCP only | MCP, CLI, NCP, Lumina, APIs... |
287
-
288
- [See detailed comparison →](COMPARISON.md)
289
-
290
- ---
151
+ ## Marketplace
291
152
 
292
- ## CLI Interface
153
+ <div align="center">
154
+ <img src="https://raw.githubusercontent.com/portel-dev/photon/main/assets/beam-marketplace.png" alt="Marketplace" width="700">
155
+ </div>
293
156
 
294
- Every photon automatically provides a beautiful CLI interface with zero additional code. The same business logic that powers your MCP tools becomes instantly available from the terminal.
157
+ <br>
295
158
 
296
- ### Quick Example
159
+ Install production-ready photons or create team marketplaces:
297
160
 
298
161
  ```bash
299
- # List all methods
300
- photon cli lg-remote
301
-
302
- # Call methods with natural syntax
303
- photon cli lg-remote volume 50
304
- photon cli lg-remote volume +5
305
- photon cli lg-remote channel 7
306
- photon cli lg-remote app netflix
307
-
308
- # Get method help
309
- photon cli lg-remote volume --help
310
- ```
311
-
312
- ### Beautiful Output Formats
313
-
314
- Photon automatically formats output based on data structure:
315
-
316
- **Tables** - Key-value pairs and flat objects:
317
- ```bash
318
- $ photon cli lg-remote volume
319
- ┌─────────┬────┐
320
- │ volume │ 45 │
321
- ├─────────┼────┤
322
- │ muted │ no │
323
- ├─────────┼────┤
324
- │ maxVol │ 100│
325
- └─────────┴────┘
326
- ```
327
-
328
- **Lists** - Arrays of items:
329
- ```bash
330
- $ photon cli lg-remote apps
331
- • Netflix (netflix)
332
- • YouTube (youtube.leanback.v4)
333
- • HDMI1 (com.webos.app.hdmi1)
334
- • Disney+ (disney)
335
- ```
336
-
337
- **Trees** - Hierarchical data (shown as formatted JSON)
338
- **Primitives** - Simple values displayed directly
339
-
340
- ### Format System
341
-
342
- Photon uses a smart format system with 5 standard types:
343
-
344
- 1. **`primitive`** - String, number, boolean
345
- 2. **`table`** - Flat object or array of flat objects
346
- 3. **`tree`** - Nested/hierarchical data
347
- 4. **`list`** - Array of simple items
348
- 5. **`none`** - No return value (void operations)
349
-
350
- **Hint the format** (optional):
351
- ```typescript
352
- /**
353
- * Get current volume
354
- * @format table
355
- */
356
- async volume() {
357
- return this._request('ssap://audio/getVolume');
358
- }
162
+ photon search postgres # Find photons
163
+ photon add postgres # Install
164
+ photon upgrade # Keep current
359
165
  ```
360
166
 
361
- **Auto-detection**: If no `@format` tag is provided, Photon automatically detects the best format based on the return value structure.
362
-
363
- ### CLI Command Reference
167
+ **Available:** PostgreSQL, MongoDB, Redis, SQLite, AWS S3, Docker, Filesystem, Git, GitHub, Email, Slack, Google Calendar, Jira, and more.
364
168
 
365
- #### `photon cli <photon-name> [method] [args...]`
366
-
367
- **List all methods:**
368
169
  ```bash
369
- photon cli lg-remote
170
+ # Create a team marketplace
171
+ photon sync marketplace --claude-code
172
+ git push origin main
173
+ # Team members: photon marketplace add company/photons
370
174
  ```
371
175
 
372
- **Call a method:**
373
- ```bash
374
- # No parameters
375
- photon cli lg-remote status
376
-
377
- # Single parameter
378
- photon cli lg-remote volume 50
379
-
380
- # Multiple parameters
381
- photon cli lg-remote search query "breaking bad" limit 10
176
+ ---
382
177
 
383
- # Relative adjustments
384
- photon cli lg-remote volume +5
385
- photon cli lg-remote channel +1
386
- ```
178
+ ## Commands
387
179
 
388
- **Get method help:**
389
180
  ```bash
390
- photon cli lg-remote volume --help
391
- ```
392
-
393
- **Raw JSON output:**
394
- ```bash
395
- photon cli lg-remote volume --json
396
- ```
181
+ # Run
182
+ photon # Open Beam UI
183
+ photon mcp <name> # MCP server
184
+ photon mcp <name> --dev # MCP server with hot reload
185
+ photon cli <name> [method] # CLI interface
397
186
 
398
- ### One Codebase, Multiple Interfaces
187
+ # Manage
188
+ photon init <name> # Create new photon
189
+ photon info # List all photons
190
+ photon info <name> --mcp # Get MCP client config
191
+ photon validate <name> # Check for errors
399
192
 
400
- The beauty of Photon's design: **improvements to business logic automatically work across all interfaces**.
193
+ # Marketplace
194
+ photon add <name> # Install photon
195
+ photon search <query> # Search
196
+ photon upgrade # Upgrade all
401
197
 
402
- Write your logic once:
403
- ```typescript
404
- async volume(params?: { level?: number | string } | number | string) {
405
- // Handle relative adjustments
406
- if (typeof level === 'string' && level.startsWith('+')) {
407
- const delta = parseInt(level);
408
- const current = await this._getCurrentVolume();
409
- const newVolume = current + delta;
410
- await this._setVolume(newVolume);
411
- }
412
- // ... rest of logic
413
- return this._getCurrentVolume(); // Always return current state
414
- }
415
- ```
416
-
417
- **Works everywhere:**
418
- - ✅ **MCP**: Claude Desktop, Cursor, etc.
419
- - ✅ **CLI**: `photon cli lg-remote volume +5`
420
- - ✅ **Future interfaces**: HTTP, WebSocket, etc.
421
-
422
- ### Context-Aware Error Messages
423
-
424
- Photons can provide helpful, context-aware errors:
425
-
426
- ```bash
427
- $ photon cli lg-remote channels
428
- ❌ Error: TV channels not available. Currently on HDMI1.
429
- Switch to a TV tuner input to access channels.
430
- ```
431
-
432
- The same error quality appears in MCP tools—because it's the same code.
433
-
434
- ### Exit Codes
435
-
436
- The CLI properly returns exit codes for automation:
437
- - **0**: Success
438
- - **1**: Error (tool execution failed, invalid parameters, etc.)
439
-
440
- Perfect for shell scripts and CI/CD:
441
- ```bash
442
- if photon cli lg-remote volume 50; then
443
- echo "Volume set successfully"
444
- else
445
- echo "Failed to set volume"
446
- exit 1
447
- fi
198
+ # Ops
199
+ photon doctor # Diagnose environment
200
+ photon audit # Security audit
201
+ photon test # Run tests
202
+ photon deploy # Deploy to production
448
203
  ```
449
204
 
450
205
  ---
451
206
 
452
- ## How Photon Works
207
+ ## Documentation
453
208
 
454
- ### Convention = Automation
209
+ **Start here:**
455
210
 
456
- **File Name MCP Name**
457
- ```typescript
458
- // analytics.photon.ts "analytics" MCP
459
- ```
211
+ | Guide | |
212
+ |-------|-|
213
+ | [Getting Started](https://github.com/portel-dev/photon/blob/main/GUIDE.md) | Create your first photon, step by step |
214
+ | [Advanced](https://github.com/portel-dev/photon/blob/main/ADVANCED.md) | Lifecycle hooks, performance, testing |
215
+ | [Docblock Tags](https://github.com/portel-dev/photon/blob/main/DOCBLOCK-TAGS.md) | Complete JSDoc tag reference |
216
+ | [Troubleshooting](https://github.com/portel-dev/photon/blob/main/TROUBLESHOOTING.md) | Common issues and solutions |
460
217
 
461
- **Class Methods → Tools**
462
- ```typescript
463
- async revenue() {} // → "revenue" tool
464
- async topCustomers() {} // → "topCustomers" tool
465
- ```
218
+ **Deep dives:**
466
219
 
467
- **TypeScript Types JSON Schemas**
468
- ```typescript
469
- async create(params: { title: string; priority: number }) {}
470
- // Photon auto-generates JSON schema from TypeScript types
471
- ```
220
+ | Topic | |
221
+ |-------|-|
222
+ | [Custom UI](https://github.com/portel-dev/photon/blob/main/CUSTOM-UI.md) | Build rich interactive interfaces |
223
+ | [Auth](https://github.com/portel-dev/photon/blob/main/AUTH.md) | OAuth 2.1 with built-in providers |
224
+ | [Daemon Pub/Sub](https://github.com/portel-dev/photon/blob/main/DAEMON-PUBSUB.md) | Real-time cross-process messaging |
225
+ | [Webhooks](https://github.com/portel-dev/photon/blob/main/WEBHOOKS.md) | HTTP endpoints for external services |
226
+ | [Deployment](https://github.com/portel-dev/photon/blob/main/DEPLOYMENT.md) | Docker, Lambda, Workers, Systemd |
227
+ | [Security](https://github.com/portel-dev/photon/blob/main/SECURITY.md) | Best practices and audit checklist |
228
+ | [Marketplace Publishing](https://github.com/portel-dev/photon/blob/main/MARKETPLACE-PUBLISHING.md) | Create and share marketplaces |
472
229
 
473
- **JSDoc Tool Descriptions**
474
- ```typescript
475
- /**
476
- * Get revenue by date range
477
- * @param startDate Start date (YYYY-MM-DD)
478
- */
479
- // Photon extracts descriptions automatically
480
- ```
481
-
482
- **Constructor Parameters → Environment Variables**
483
- ```typescript
484
- constructor(private host: string, private database: string) {}
485
- // Maps to: ANALYTICS_HOST, ANALYTICS_DATABASE
486
- ```
487
-
488
- **JSDoc @dependencies → Auto-Install**
489
- ```typescript
490
- /**
491
- * @dependencies pg@^8.11.0, lodash@^4.17.21
492
- */
493
- // Photon auto-installs on first run (like npx or uv)
494
- ```
230
+ **Reference:** [Architecture](https://github.com/portel-dev/photon/blob/main/ARCHITECTURE.md) · [Best Practices](https://github.com/portel-dev/photon/blob/main/PHOTON_BEST_PRACTICES.md) · [Naming Conventions](https://github.com/portel-dev/photon/blob/main/NAMING-CONVENTIONS.md) · [Comparison](https://github.com/portel-dev/photon/blob/main/COMPARISON.md) · [Changelog](https://github.com/portel-dev/photon/blob/main/CHANGELOG.md)
495
231
 
496
232
  ---
497
233
 
498
- ## Available Photons
499
-
500
- Production-ready photons from **[portel-dev/photons](https://github.com/portel-dev/photons)**:
234
+ ## Contributing
501
235
 
502
- | Category | Photons | Total Tools |
503
- |----------|---------|-------------|
504
- | **Databases** | PostgreSQL (7), MongoDB (13), Redis (18), SQLite (9) | 47 |
505
- | **Infrastructure** | AWS S3 (11), Docker (10), Filesystem (13) | 34 |
506
- | **Development** | Git (11), GitHub Issues (7) | 18 |
507
- | **Communication** | Email (8), Slack (7) | 15 |
508
- | **Productivity** | Google Calendar (9), Jira (10) | 19 |
509
- | **Utilities** | Fetch (2), Time (3), Memory (10) | 15 |
236
+ See [CONTRIBUTING.md](https://github.com/portel-dev/photon/blob/main/CONTRIBUTING.md) and [ARCHITECTURE.md](https://github.com/portel-dev/photon/blob/main/ARCHITECTURE.md).
510
237
 
511
- **Total: 16 photons, 148 focused tools**
238
+ ## License
512
239
 
513
- Browse and install:
514
- ```bash
515
- photon info # See all available photons
516
- photon add postgres # Install any photon
517
- photon search git # Search by keyword
518
- ```
240
+ [MIT](https://github.com/portel-dev/photon/blob/main/LICENSE)
519
241
 
520
242
  ---
521
243
 
522
- ## Create Your Own Photon
523
-
524
- ### 1. Initialize
244
+ <div align="center">
525
245
 
526
- ```bash
527
- photon init analytics
528
- ```
246
+ *Singular focus. Precise target.*
529
247
 
530
- Creates `analytics.photon.ts` in `~/.photon/` (accessible from anywhere).
248
+ Made by [Portel](https://github.com/portel-dev)
531
249
 
532
- **Custom directory:**
533
- ```bash
534
- photon --working-dir ./my-photons init analytics
535
- ```
250
+ </div>
536
251
 
537
- ### 2. Write Business Logic
252
+ <!-- PHOTON_MARKETPLACE_START -->
253
+ # photon
538
254
 
539
- ```typescript
540
- /**
541
- * Analytics - Query company analytics database
542
- * @dependencies pg@^8.11.0
543
- */
544
- import { Client } from 'pg';
255
+ > **Singular focus. Precise target.**
545
256
 
546
- export default class Analytics {
547
- private db: Client;
257
+ **Photons** are single-file TypeScript MCP servers that supercharge AI assistants with focused capabilities. Each photon delivers ONE thing exceptionally well - from filesystem operations to cloud integrations.
548
258
 
549
- constructor(
550
- private host: string,
551
- private database: string,
552
- private password: string
553
- ) {}
259
+ Built on the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction), photons are:
260
+ - 📦 **One-command install** via [Photon CLI](https://github.com/portel-dev/photon)
261
+ - 🎯 **Laser-focused** on singular capabilities
262
+ - **Zero-config** with auto-dependency management
263
+ - 🔌 **Universal** - works with Claude Desktop, Claude Code, and any MCP client
554
264
 
555
- async onInitialize() {
556
- this.db = new Client({
557
- host: this.host,
558
- database: this.database,
559
- password: this.password
560
- });
561
- await this.db.connect();
562
- }
265
+ ## 📦 Available Photons
563
266
 
564
- /**
565
- * Get revenue by date range
566
- * @param startDate Start date (YYYY-MM-DD)
567
- * @param endDate End date (YYYY-MM-DD)
568
- */
569
- async revenue(params: { startDate: string; endDate: string }) {
570
- const result = await this.db.query(
571
- 'SELECT date, SUM(amount) FROM orders WHERE date BETWEEN $1 AND $2 GROUP BY date',
572
- [params.startDate, params.endDate]
573
- );
574
- return result.rows;
575
- }
576
-
577
- async onShutdown() {
578
- await this.db.end();
579
- }
580
- }
581
- ```
582
-
583
- ### 3. Run
584
-
585
- ```bash
586
- # Development mode (hot reload)
587
- photon mcp analytics --dev
588
-
589
- # Production mode
590
- photon mcp analytics
591
- ```
267
+ | Photon | Focus | Tools | Features |
268
+ |--------|-------|-------|----------|
269
+ | [**Code Diagram**](code-diagram.md) | Generate Mermaid diagrams from TypeScript/JavaScript code | 3 | 🔌📦 |
270
+ | [**Truth Serum**](serum.md) | Forces unfiltered honesty, no hedging or diplomacy @description Powerful prompt serums that force specific cognitive behaviors @icon 💉 /
271
+ export default class Serum {
272
+ / | 10 | - |
273
+ | [**Test Ui**](test-ui.md) | Test Custom UI | 1 | 🎨 |
592
274
 
593
- **That's it!** Photon handles:
594
- - ✅ TypeScript compilation (via esbuild)
595
- - ✅ Schema generation from types
596
- - ✅ MCP protocol implementation
597
- - ✅ Environment variable mapping
598
- - ✅ Dependency installation (@dependencies)
599
- - ✅ Hot reload in dev mode
600
275
 
601
- **You focus on:** Your business logic
602
- **Photon handles:** Everything else
276
+ **Total:** 3 photons ready to use
603
277
 
604
278
  ---
605
279
 
606
- ## Commands Reference
280
+ ## 🚀 Quick Start
607
281
 
608
- ### Global Options
282
+ ### 1. Install Photon
609
283
 
610
284
  ```bash
611
- --working-dir <dir> # Use custom directory instead of ~/.photon
612
- -V, --version # Show version number
613
- -h, --help # Show help
614
- ```
615
-
616
- ### Development Commands
617
-
618
- #### `photon init <name>`
619
- Create a new `.photon.ts` file from template.
620
-
621
- ```bash
622
- # Create in default directory (~/.photon)
623
- photon init calculator
624
-
625
- # Create in custom directory
626
- photon --working-dir ./my-photons init calculator
627
- ```
628
-
629
- #### `photon validate <name>`
630
- Validate syntax and extract schemas without running.
631
-
632
- ```bash
633
- photon validate calculator
634
- ```
635
-
636
- Useful for:
637
- - Checking syntax errors
638
- - Testing schema generation
639
- - CI/CD validation
640
-
641
- ### Running Photons
642
-
643
- #### `photon mcp <name>`
644
- Run a photon as an MCP server.
645
-
646
- ```bash
647
- # Production mode
648
- photon mcp calculator
649
-
650
- # Development mode (hot reload on file changes)
651
- photon mcp calculator --dev
652
-
653
- # Validate configuration without running
654
- photon mcp calculator --validate
655
-
656
- # Show MCP configuration template
657
- photon mcp calculator --config
658
- ```
659
-
660
- **Options:**
661
- - `--dev` - Enable hot reload for development
662
- - `--validate` - Validate configuration without running server
663
- - `--config` - Show configuration template and exit
664
-
665
- #### `photon cli <photon-name> [method] [args...]`
666
- Run photon methods directly from the command line.
667
-
668
- ```bash
669
- # List all available methods
670
- photon cli calculator
671
-
672
- # Call a method with arguments
673
- photon cli calculator add 5 10
674
-
675
- # Get method-specific help
676
- photon cli calculator add --help
677
-
678
- # Output raw JSON instead of formatted output
679
- photon cli calculator add 5 10 --json
680
- ```
681
-
682
- **Arguments:**
683
- - Arguments are automatically coerced to expected types (string, number, boolean)
684
- - Strings starting with `+` or `-` are preserved for relative adjustments
685
- - Arrays and objects can be passed as JSON strings
686
-
687
- **Options:**
688
- - `--help` - Show help for the photon or specific method
689
- - `--json` - Output raw JSON instead of formatted output
690
-
691
- **Exit Codes:**
692
- - `0` - Success
693
- - `1` - Error (invalid arguments, execution failure, etc.)
694
-
695
- **Examples:**
696
-
697
- ```bash
698
- # Smart home control
699
- photon cli lg-remote volume 50
700
- photon cli lg-remote volume +5 # Relative adjustment
701
- photon cli lg-remote channel 7
702
- photon cli lg-remote app netflix
703
-
704
- # Database queries
705
- photon cli postgres query "SELECT * FROM users LIMIT 10"
706
-
707
- # File operations
708
- photon cli filesystem read-file path "/home/user/document.txt"
709
-
710
- # Git operations
711
- photon cli git commit message "feat: add new feature"
712
- ```
713
-
714
- ### Inspect & Configure
715
-
716
- #### `photon info [name]`
717
- List all photons or show details for a specific one.
718
-
719
- ```bash
720
- # List all installed photons
721
- photon info
722
-
723
- # Show details for one photon
724
- photon info calculator
725
-
726
- # Get MCP client configuration
727
- photon info calculator --mcp
285
+ npm install -g @portel/photon
728
286
  ```
729
287
 
730
- **Options:**
731
- - `--mcp` - Output MCP server configuration for your client
732
-
733
- ### Marketplace Commands
734
-
735
- #### `photon add <name>`
736
- Install a photon from a marketplace.
288
+ ### 2. Add Any Photon
737
289
 
738
290
  ```bash
739
- # Install from any enabled marketplace
740
291
  photon add filesystem
741
-
742
- # Install from specific marketplace
743
- photon add filesystem --marketplace portel-dev/photons
744
- ```
745
-
746
- **Options:**
747
- - `--marketplace <name>` - Specify which marketplace to use
748
-
749
- #### `photon search <query>`
750
- Search for photons across all enabled marketplaces.
751
-
752
- ```bash
753
- photon search database
754
- photon search git
755
- ```
756
-
757
- #### `photon info <name>`
758
- Show detailed information about a photon from marketplaces.
759
-
760
- ```bash
761
- photon info postgres
292
+ photon add git
293
+ photon add aws-s3
762
294
  ```
763
295
 
764
- Shows:
765
- - Description
766
- - Available tools
767
- - Configuration requirements
768
- - Marketplace source
769
-
770
- #### `photon upgrade [name]`
771
- Upgrade photons from marketplaces.
296
+ ### 3. Use It
772
297
 
773
298
  ```bash
774
- # Upgrade all photons
775
- photon upgrade
776
-
777
- # Upgrade specific photon
778
- photon upgrade filesystem
299
+ # Run as MCP server
300
+ photon mcp filesystem
779
301
 
780
- # Check for updates without upgrading
781
- photon upgrade --check
302
+ # Get config for your MCP client
303
+ photon get filesystem --mcp
782
304
  ```
783
305
 
784
- **Options:**
785
- - `--check` - Only check for updates, don't install
786
-
787
- #### `photon conflicts`
788
- Show photons available in multiple marketplaces.
789
-
790
- ```bash
791
- photon conflicts
792
- ```
793
-
794
- Useful when same photon name exists in different marketplaces.
795
-
796
- ### Marketplace Management
797
-
798
- #### `photon marketplace list`
799
- List all configured marketplaces.
800
-
801
- ```bash
802
- photon marketplace list
306
+ Output (paste directly into your MCP client config):
307
+ ```json
308
+ {
309
+ "mcpServers": {
310
+ "filesystem": {
311
+ "command": "photon",
312
+ "args": ["mcp", "filesystem"]
313
+ }
314
+ }
315
+ }
803
316
  ```
804
317
 
805
- #### `photon marketplace add <repo>`
806
- Add a new marketplace.
318
+ Add the output to your MCP client's configuration. **Consult your client's documentation** for setup instructions.
807
319
 
808
- ```bash
809
- # GitHub shorthand
810
- photon marketplace add username/repo
811
-
812
- # Full HTTPS URL
813
- photon marketplace add https://github.com/username/repo
320
+ **That's it!** Your AI assistant now has 3 focused tools at its fingertips.
814
321
 
815
- # SSH URL
816
- photon marketplace add git@github.com:username/repo.git
322
+ ---
817
323
 
818
- # Direct URL
819
- photon marketplace add https://example.com/marketplace
324
+ ## 🎨 Claude Code Integration
820
325
 
821
- # Local path
822
- photon marketplace add ./my-local-marketplace
823
- ```
326
+ This marketplace is also available as a **Claude Code plugin**, enabling seamless installation of individual photons directly from Claude Code's plugin manager.
824
327
 
825
- #### `photon marketplace remove <name>`
826
- Remove a marketplace.
328
+ ### Install as Claude Code Plugin
827
329
 
828
330
  ```bash
829
- photon marketplace remove my-marketplace
830
- ```
831
-
832
- #### `photon marketplace enable <name>`
833
- Enable a previously disabled marketplace.
834
-
835
- ```bash
836
- photon marketplace enable my-marketplace
331
+ # In Claude Code, run:
332
+ /plugin marketplace add portel-dev/photons
837
333
  ```
838
334
 
839
- #### `photon marketplace disable <name>`
840
- Disable a marketplace without removing it.
335
+ Once added, you can install individual photons:
841
336
 
842
337
  ```bash
843
- photon marketplace disable my-marketplace
338
+ # Install specific photons you need
339
+ /plugin install filesystem@photons-marketplace
340
+ /plugin install git@photons-marketplace
341
+ /plugin install knowledge-graph@photons-marketplace
844
342
  ```
845
343
 
846
- #### `photon marketplace update [name]`
847
- Update marketplace metadata from remote.
344
+ ### Benefits of Claude Code Plugin
848
345
 
849
- ```bash
850
- # Update all marketplaces
851
- photon marketplace update
852
-
853
- # Update specific marketplace
854
- photon marketplace update portel-dev/photons
855
- ```
346
+ - **🎯 Granular Installation**: Install only the photons you need
347
+ - **🔄 Auto-Updates**: Plugin stays synced with marketplace
348
+ - **⚡ Zero Config**: Photon CLI auto-installs on first use
349
+ - **🛡️ Secure**: No credentials shared with AI (interactive setup available)
350
+ - **📦 Individual MCPs**: Each photon is a separate installable plugin
856
351
 
857
- ### Advanced Commands
352
+ ### How This Plugin Is Built
858
353
 
859
- #### `photon sync marketplace [path]`
860
- Generate marketplace manifest and documentation.
354
+ This marketplace doubles as a Claude Code plugin through automatic generation:
861
355
 
862
356
  ```bash
863
- # Sync current directory
864
- photon sync marketplace
865
-
866
- # Sync specific directory
867
- photon sync marketplace ./my-marketplace
868
-
869
- # Generate Claude Code plugin files too
870
- photon sync marketplace --claude-code
357
+ # Generate marketplace AND Claude Code plugin files
358
+ photon maker sync --claude-code
871
359
  ```
872
360
 
873
- **Options:**
874
- - `--claude-code` - Also generate Claude Code plugin files (`.claude-plugin/`)
875
- - `--name <name>` - Override marketplace name
876
- - `--description <desc>` - Set marketplace description
877
- - `--owner <owner>` - Set owner name
878
-
879
- Used when creating your own marketplace. See [Marketplace System](#marketplace-system) and [Claude Code Plugins](#claude-code-plugins).
361
+ This single command:
362
+ 1. Scans all `.photon.ts` files
363
+ 2. Generates `.marketplace/photons.json` manifest
364
+ 3. Creates `.claude-plugin/marketplace.json` for Claude Code
365
+ 4. Generates documentation for each photon
366
+ 5. Creates auto-install hooks for seamless setup
880
367
 
881
- #### `photon audit [name]`
882
- Security audit of photon dependencies.
883
-
884
- ```bash
885
- # Audit all photons
886
- photon audit
887
-
888
- # Audit specific photon
889
- photon audit postgres
890
- ```
891
-
892
- Checks for:
893
- - Vulnerable dependencies
894
- - Outdated packages
895
- - Security advisories
368
+ **Result**: One source of truth, two distribution channels (Photon CLI + Claude Code).
896
369
 
897
370
  ---
898
371
 
899
- ## Marketplace System
372
+ ## ⚛️ What Are Photons?
900
373
 
901
- ### For Users: Install from Marketplace
374
+ **Photons** are laser-focused modules - each does ONE thing exceptionally well:
375
+ - 📁 **Filesystem** - File operations
376
+ - 🐙 **Git** - Repository management
377
+ - ☁️ **AWS S3** - Cloud storage
378
+ - 📅 **Google Calendar** - Calendar integration
379
+ - 🕐 **Time** - Timezone operations
380
+ - ... and more
902
381
 
903
- ```bash
904
- # Install from official marketplace (portel-dev/photons)
905
- photon add github-issues
906
- photon add sqlite
907
- photon add memory
382
+ Each photon delivers **singular focus** to a **precise target**.
908
383
 
909
- # Search for photons
910
- photon search slack
911
- ```
384
+ **Key Features:**
385
+ - 🎯 Each photon does one thing perfectly
386
+ - 📦 3 production-ready photons available
387
+ - ⚡ Auto-installs dependencies
388
+ - 🔧 Works out of the box
389
+ - 📄 Single-file design (easy to fork and customize)
912
390
 
913
- ### For Teams: Create Your Marketplace
391
+ ## 🎯 The Value Proposition
914
392
 
915
- **Build an internal marketplace for your organization:**
916
-
917
- ```bash
918
- # 1. Organize your photons
919
- mkdir company-photons && cd company-photons
920
- cp ~/.photon/*.photon.ts .
393
+ ### Before Photon
921
394
 
922
- # 2. Generate marketplace manifest (and optionally Claude Code plugin)
923
- photon sync marketplace --claude-code
924
-
925
- # 3. Push to GitHub/Git
926
- git init
927
- git add .
928
- git commit -m "Initial marketplace"
929
- git push origin main
930
-
931
- # 4. Team members install (via CLI or Claude Code)
932
- photon marketplace add company/photons
933
- photon add internal-crm
934
- photon add analytics-db
935
- ```
395
+ For each MCP server:
396
+ 1. Find and clone the repository
397
+ 2. Install dependencies manually
398
+ 3. Configure environment variables
399
+ 4. Write MCP client config JSON by hand
400
+ 5. Repeat for every server
936
401
 
937
- **Benefits:**
938
-
939
- - 🔒 **Secure**: Your code, your infrastructure, your control
940
- - 📦 **Easy**: Single-file photons are trivial to maintain
941
- - 🎯 **Focused**: Build exact tools for your workflows
942
- - 📊 **Traceable**: Git-based versioning and attribution
943
- - 🔌 **Dual Distribution**: With `--claude-code`, also works as Claude Code plugin
944
-
945
- > **Tip:** Use `--claude-code` flag to enable installation via both Photon CLI and Claude Code plugin manager. See [Claude Code Plugins](#claude-code-plugins) for details.
946
-
947
- ### Manage Marketplaces
402
+ ### With Photon
948
403
 
949
404
  ```bash
950
- # List all marketplaces
951
- photon marketplace list
952
-
953
- # Add marketplace (multiple formats supported)
954
- photon marketplace add username/repo # GitHub shorthand
955
- photon marketplace add https://github.com/u/repo # HTTPS
956
- photon marketplace add git@github.com:u/repo.git # SSH
957
- photon marketplace add https://example.com/mkt # Direct URL
958
- photon marketplace add ./local-photons # Local path
959
-
960
- # Remove marketplace
961
- photon marketplace remove <name>
962
-
963
- # Search across all marketplaces
964
- photon search <keyword>
965
- ```
966
-
967
- ---
968
-
969
- ## Claude Code Plugins
970
-
971
- Photon marketplaces can be automatically published as **Claude Code plugins**, enabling users to install individual photons directly from Claude Code's plugin manager.
972
-
973
- ### Why Dual Distribution?
974
-
975
- One marketplace, two distribution channels:
976
-
977
- **Via Photon CLI:**
978
- ```bash
405
+ # Install from marketplace
979
406
  photon add filesystem
980
- photon add git
981
- ```
982
407
 
983
- **Via Claude Code Plugin:**
984
- ```bash
985
- /plugin marketplace add your-org/your-marketplace
986
- /plugin install filesystem@your-marketplace
987
- /plugin install git@your-marketplace
408
+ # Get MCP config
409
+ photon get filesystem --mcp
988
410
  ```
989
411
 
990
- **Benefits:**
991
- - 🎯 **Granular Installation**: Claude Code users can install only the photons they need
992
- - 🔄 **Auto-Sync**: Plugin stays in sync with your marketplace
993
- - ⚡ **Zero Config**: Photon CLI auto-installs on first use
994
- - 🛡️ **Secure**: Credentials never shared with AI (interactive setup available)
995
- - 📦 **Same Source**: One marketplace serves both CLI and plugin users
996
-
997
- ### Generate Plugin Files
998
-
999
- When creating your marketplace, add the `--claude-code` flag:
1000
-
1001
- ```bash
1002
- # In your marketplace directory
1003
- photon sync marketplace --claude-code
1004
- ```
1005
-
1006
- This generates:
1007
- - `.claude-plugin/marketplace.json` - Plugin manifest with individual photon entries
1008
- - `.claude-plugin/hooks.json` - SessionStart hook to auto-install Photon CLI
1009
- - `.claude-plugin/scripts/check-photon.sh` - Auto-installer script
1010
- - `.claude-plugin/scripts/setup-photon.sh` - Interactive credential setup tool
1011
-
1012
- ### What Gets Generated
1013
-
1014
- **Individual Plugins:** Each photon becomes a separate installable plugin in Claude Code:
1015
-
412
+ Output (paste directly into your MCP client config):
1016
413
  ```json
1017
414
  {
1018
- "name": "your-marketplace",
1019
- "plugins": [
1020
- {
1021
- "name": "filesystem",
1022
- "description": "Filesystem - File and directory operations",
1023
- "mcpServers": {
1024
- "filesystem": {
1025
- "command": "photon",
1026
- "args": ["mcp", "filesystem"]
1027
- }
1028
- }
415
+ "mcpServers": {
416
+ "filesystem": {
417
+ "command": "photon",
418
+ "args": ["mcp", "filesystem"]
1029
419
  }
1030
- // ... one entry per photon
1031
- ]
1032
- }
1033
- ```
1034
-
1035
- **Auto-Install Hook:** When users install your plugin, Claude Code automatically:
1036
- 1. Checks if `photon` CLI is installed
1037
- 2. Installs it globally via npm if missing
1038
- 3. Makes all photon tools available immediately
1039
-
1040
- ### Example: Official Photons Marketplace
1041
-
1042
- The [official photons marketplace](https://github.com/portel-dev/photons) uses this approach:
1043
-
1044
- ```bash
1045
- # In the photons repo
1046
- photon sync marketplace --claude-code
1047
- git commit -m "chore: update marketplace"
1048
- git push
1049
- ```
1050
-
1051
- Users can then install via Claude Code:
1052
- ```bash
1053
- /plugin marketplace add portel-dev/photons
1054
- /plugin install knowledge-graph@photons-marketplace
1055
- /plugin install git@photons-marketplace
1056
- ```
1057
-
1058
- ### Automated Git Hooks
1059
-
1060
- Add this to your `.git/hooks/pre-commit` to auto-sync:
1061
-
1062
- ```bash
1063
- #!/bin/bash
1064
- photon sync marketplace --claude-code
1065
- git add .marketplace/ .claude-plugin/ README.md *.md
1066
- ```
1067
-
1068
- Now your marketplace AND plugin files stay in sync automatically.
1069
-
1070
- ### Distribution Strategy
1071
-
1072
- **Recommended approach:**
1073
-
1074
- 1. **Commit both** `.marketplace/` and `.claude-plugin/` to your repo
1075
- 2. **Single command** keeps them in sync
1076
- 3. **Users choose** their preferred installation method
1077
- 4. **Same photons**, whether via CLI or Claude Code
1078
-
1079
- **Result:** Maximum reach with minimal maintenance.
1080
-
1081
- ---
1082
-
1083
- ## Advanced Features
1084
-
1085
- ### Lifecycle Hooks
1086
-
1087
- ```typescript
1088
- export default class MyPhoton {
1089
- async onInitialize() {
1090
- // Called when photon loads
1091
- console.error('Photon initialized');
1092
- }
1093
-
1094
- async onShutdown() {
1095
- // Called on shutdown
1096
- console.error('Photon shutting down');
1097
- }
1098
-
1099
- async myTool(params: { input: string }) {
1100
- return `Processed: ${params.input}`;
1101
- }
1102
- }
1103
- ```
1104
-
1105
- ### Templates (MCP Prompts)
1106
-
1107
- ```typescript
1108
- import { Template, asTemplate } from '@portel/photon';
1109
-
1110
- export default class MyPhoton {
1111
- /**
1112
- * Generate a code review prompt
1113
- * @Template
1114
- * @param language Programming language
1115
- * @param code Code to review
1116
- */
1117
- async codeReview(params: { language: string; code: string }): Promise<Template> {
1118
- const prompt = `Review this ${params.language} code:\n\`\`\`\n${params.code}\n\`\`\``;
1119
- return asTemplate(prompt);
1120
- }
1121
- }
1122
- ```
1123
-
1124
- ### Static Resources (MCP Resources)
1125
-
1126
- ```typescript
1127
- import { Static, asStatic } from '@portel/photon';
1128
-
1129
- export default class MyPhoton {
1130
- /**
1131
- * Get API documentation
1132
- * @Static api://docs
1133
- * @mimeType text/markdown
1134
- */
1135
- async apiDocs(params: {}): Promise<Static> {
1136
- const docs = `# API Documentation\n\n...`;
1137
- return asStatic(docs);
1138
- }
1139
- }
1140
- ```
1141
-
1142
- ### Private Methods
1143
-
1144
- Methods starting with `_` are private (not exposed as tools):
1145
-
1146
- ```typescript
1147
- export default class MyPhoton {
1148
- // Public tool
1149
- async publicTool(params: {}) {
1150
- return this._helperMethod();
1151
- }
1152
-
1153
- // Private helper (NOT exposed)
1154
- async _helperMethod() {
1155
- return "Internal logic only";
1156
420
  }
1157
421
  }
1158
422
  ```
1159
423
 
1160
- ---
1161
-
1162
- ## Examples
424
+ **That's it.** No dependencies, no environment setup, no configuration files.
1163
425
 
1164
- The repository includes example photons in `examples/`:
426
+ **Difference:**
427
+ - ✅ One CLI, one command
428
+ - ✅ Zero configuration
429
+ - ✅ Instant installation
430
+ - ✅ Auto-dependencies
431
+ - ✅ Consistent experience
1165
432
 
1166
- ### Content (Templates & Static Resources)
1167
- ```bash
1168
- npx photon --working-dir examples mcp content --dev
1169
- ```
1170
- Demonstrates Templates (MCP Prompts) and Static resources.
433
+ ## 💡 Use Cases
1171
434
 
1172
- ### Calculator
435
+ **For Claude Users:**
1173
436
  ```bash
1174
- npx photon --working-dir examples mcp math --dev
437
+ photon add filesystem git github-issues
438
+ photon get --mcp # Get config for all three
1175
439
  ```
1176
- Basic arithmetic operations.
440
+ Add to Claude Desktop → Now Claude can read files, manage repos, create issues
1177
441
 
1178
- ### String Utilities
442
+ **For Teams:**
1179
443
  ```bash
1180
- npx photon --working-dir examples mcp text --dev
444
+ photon add postgres mongodb redis
445
+ photon get --mcp
1181
446
  ```
1182
- Text manipulation tools.
447
+ Give Claude access to your data infrastructure
1183
448
 
1184
- ### Workflow
449
+ **For Developers:**
1185
450
  ```bash
1186
- npx photon --working-dir examples mcp workflow --dev
1187
- ```
1188
- Task management system.
1189
-
1190
- ---
1191
-
1192
- ## Architecture
1193
-
451
+ photon add docker git slack
452
+ photon get --mcp
1194
453
  ```
1195
- ┌─────────────────────┐
1196
- │ .photon.ts file │ ← Your single TypeScript file
1197
- └──────────┬──────────┘
1198
-
1199
-
1200
- ┌───────────────┐
1201
- │ Auto-Install │ ← Reads @dependencies, installs packages
1202
- └───────┬───────┘
1203
-
1204
-
1205
- ┌───────────────┐
1206
- │ Loader │ ← Compiles TypeScript with esbuild
1207
- └───────┬───────┘ Loads class dynamically
1208
-
1209
-
1210
- ┌─────────────────────┐
1211
- │ Schema Extractor │ ← Parses JSDoc + TypeScript types
1212
- └──────────┬──────────┘ Generates JSON schemas
1213
-
1214
-
1215
- ┌──────────────┐
1216
- │ MCP Server │ ← Implements MCP protocol
1217
- └──────┬───────┘ Using @modelcontextprotocol/sdk
1218
-
1219
-
1220
- ┌─────────────-─┐
1221
- │ stdio/JSON-RPC│ ← Communicates with MCP clients
1222
- └─────────────-─┘ (Claude Desktop, Cursor, Zed, etc.)
1223
- ```
1224
-
1225
- ---
1226
-
1227
- ## Philosophy
1228
-
1229
- > **"Singular focus. Precise target."**
1230
-
1231
- A **photon** is the smallest unit of light, delivering **singular focus** to a **precise target**.
1232
-
1233
- Each Photon module embodies this principle:
1234
-
1235
- - **Singular focus** - One responsibility, executed flawlessly
1236
- - **Precise target** - Clear purpose, clean API
1237
- - **Universal design** - Pure TypeScript, ready for future possibilities
1238
-
1239
- ---
1240
-
1241
- ## FAQ
1242
-
1243
- ### Do I need to extend a base class?
1244
-
1245
- No! Just export any class with async methods. Photon handles the rest.
454
+ Automate your workflow through AI
1246
455
 
1247
- ### How are parameters validated?
1248
-
1249
- Photon extracts JSON schemas from your TypeScript types. MCP clients validate parameters before calling your tools.
1250
-
1251
- ### Can I use external packages?
1252
-
1253
- Yes! Dependencies are **auto-installed** from JSDoc `@dependencies` tags (like `npx` or `uv`).
1254
-
1255
- ### How does hot reload work?
1256
-
1257
- In `--dev` mode, Photon watches your `.photon.ts` file and recompiles on save.
1258
-
1259
- ### Where are compiled files cached?
1260
-
1261
- `~/.cache/photon-mcp/compiled/`
1262
-
1263
- ### Where are my photons stored?
1264
-
1265
- **Default:** `~/.photon/`
1266
- **Custom:** Use `--working-dir` flag
1267
-
1268
- ### Can I fork and customize photons?
1269
-
1270
- Absolutely! That's the design. Copy any `.photon.ts` file, edit it, run it. No build config changes needed.
1271
-
1272
- ### How do I update photons?
456
+ ## 🔍 Browse & Search
1273
457
 
1274
458
  ```bash
1275
- photon upgrade # Update all
1276
- photon upgrade <name> # Update specific photon
1277
- ```
459
+ # List all photons
460
+ photon get
1278
461
 
1279
- ---
462
+ # Search by keyword
463
+ photon search calendar
1280
464
 
1281
- ## Roadmap
465
+ # View details
466
+ photon get google-calendar
1282
467
 
1283
- ### MCP Servers & CLI Interface (Available Now)
1284
-
1285
- **MCP Servers:**
1286
- Build and run photons as MCP servers for AI assistants. Works with Claude Desktop, Cursor, Zed, Continue, Cline, and any MCP-compatible client.
1287
-
1288
- **CLI Interface:**
1289
- Run photon methods directly from the command line with beautiful formatted output. Every photon automatically becomes a CLI tool with zero additional code.
1290
-
1291
- **Write once, deploy everywhere:** The same business logic powers both your MCP tools and CLI commands.
1292
-
1293
- ### 🔌 Ecosystem Integrations
1294
-
1295
- Photon files are first-class citizens across multiple platforms:
1296
-
1297
- #### NCP - Intelligent MCP Orchestration
1298
-
1299
- [NCP](https://github.com/portel-dev/ncp) runs as an MCP client hosting many MCPs intelligently, while acting as an MCP server for any client. Photon files integrate seamlessly as context providers.
1300
-
1301
- ```bash
1302
- # Photons work natively with NCP
1303
- ncp add analytics.photon.ts
468
+ # Upgrade all
469
+ photon upgrade
1304
470
  ```
1305
471
 
1306
- NCP enables sophisticated MCP orchestration patterns, and `.photon.ts` files are designed to work seamlessly in this environment.
472
+ ## 🏢 For Enterprises
1307
473
 
1308
- #### Lumina - Anything API Server *(Coming Soon)*
1309
-
1310
- Turn any photon into a production API endpoint with zero configuration.
474
+ Create your own marketplace:
1311
475
 
1312
476
  ```bash
1313
- # Same photon, now an HTTP API
1314
- lumina serve analytics.photon.ts
1315
- # → POST /revenue with JSON params
1316
- # → GET /status
1317
- # → Full REST API from your photon methods
1318
- ```
1319
-
1320
- Lumina will make photons available as HTTP/WebSocket endpoints, enabling web apps, mobile clients, and traditional API consumers to use the same business logic.
1321
-
1322
- #### Future Platforms
1323
-
1324
- The `.photon.ts` format is designed to be consumed by any runtime:
1325
- - WebSocket servers
1326
- - Serverless functions (AWS Lambda, Cloudflare Workers)
1327
- - Native desktop applications
1328
- - Browser extensions
1329
- - GraphQL servers
1330
-
1331
- **One file. Many platforms. Pure business logic.**
1332
-
1333
- ---
1334
-
1335
- Photon's framework-agnostic design enables future deployment targets. More on the way.
1336
-
1337
- ---
1338
-
1339
- ## Documentation
1340
-
1341
- - **[GUIDE.md](GUIDE.md)** - Complete tutorial for creating photons
1342
- - **[ADVANCED.md](ADVANCED.md)** - Lifecycle hooks, performance, production deployment
1343
- - **[COMPARISON.md](COMPARISON.md)** - Detailed comparison vs traditional MCP
1344
- - **[TROUBLESHOOTING.md](TROUBLESHOOTING.md)** - Common issues and solutions
1345
- - **[CHANGELOG.md](CHANGELOG.md)** - Version history
1346
-
1347
- ---
1348
-
1349
- ## Contributing
1350
-
1351
- Contributions welcome! Please open issues and PRs at [github.com/portel-dev/photon-mcp](https://github.com/portel-dev/photon-mcp).
1352
-
1353
- ---
1354
-
1355
- ## Related Projects
477
+ # 1. Organize photons
478
+ mkdir company-photons && cd company-photons
1356
479
 
1357
- - **[photons](https://github.com/portel-dev/photons)** - Official marketplace with 16+ production-ready photons
1358
- - **@modelcontextprotocol/sdk** - Official MCP TypeScript SDK
480
+ # 2. Generate marketplace
481
+ photon maker sync
1359
482
 
1360
- ---
1361
-
1362
- ## License
483
+ # 3. Share with team
484
+ git push origin main
1363
485
 
1364
- MIT © Portel
486
+ # Team members use:
487
+ photon marketplace add company/photons
488
+ photon add your-internal-tool
489
+ ```
1365
490
 
1366
491
  ---
1367
492
 
1368
493
  **Built with singular focus. Deployed with precise targeting.**
1369
494
 
1370
495
  Made with ⚛️ by [Portel](https://github.com/portel-dev)
496
+
497
+ <!-- PHOTON_MARKETPLACE_END -->