praxis-agent 0.1.0

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 (395) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +534 -0
  3. package/dist/application/background-agent-manager.d.ts +66 -0
  4. package/dist/application/background-agent-manager.d.ts.map +1 -0
  5. package/dist/application/background-agent-manager.js +362 -0
  6. package/dist/application/background-agent-manager.js.map +1 -0
  7. package/dist/application/background-bash-manager.d.ts +54 -0
  8. package/dist/application/background-bash-manager.d.ts.map +1 -0
  9. package/dist/application/background-bash-manager.js +354 -0
  10. package/dist/application/background-bash-manager.js.map +1 -0
  11. package/dist/application/background-task-id.d.ts +5 -0
  12. package/dist/application/background-task-id.d.ts.map +1 -0
  13. package/dist/application/background-task-id.js +25 -0
  14. package/dist/application/background-task-id.js.map +1 -0
  15. package/dist/application/claude-project-purge.d.ts +50 -0
  16. package/dist/application/claude-project-purge.d.ts.map +1 -0
  17. package/dist/application/claude-project-purge.js +459 -0
  18. package/dist/application/claude-project-purge.js.map +1 -0
  19. package/dist/application/managed-worktree.d.ts +15 -0
  20. package/dist/application/managed-worktree.d.ts.map +1 -0
  21. package/dist/application/managed-worktree.js +127 -0
  22. package/dist/application/managed-worktree.js.map +1 -0
  23. package/dist/application/model-compactor.d.ts +8 -0
  24. package/dist/application/model-compactor.d.ts.map +1 -0
  25. package/dist/application/model-compactor.js +70 -0
  26. package/dist/application/model-compactor.js.map +1 -0
  27. package/dist/application/scheduled-prompt-manager.d.ts +69 -0
  28. package/dist/application/scheduled-prompt-manager.d.ts.map +1 -0
  29. package/dist/application/scheduled-prompt-manager.js +387 -0
  30. package/dist/application/scheduled-prompt-manager.js.map +1 -0
  31. package/dist/application/session-service.d.ts +142 -0
  32. package/dist/application/session-service.d.ts.map +1 -0
  33. package/dist/application/session-service.js +1690 -0
  34. package/dist/application/session-service.js.map +1 -0
  35. package/dist/application/session-worktree.d.ts +55 -0
  36. package/dist/application/session-worktree.d.ts.map +1 -0
  37. package/dist/application/session-worktree.js +311 -0
  38. package/dist/application/session-worktree.js.map +1 -0
  39. package/dist/application/subagent-service.d.ts +98 -0
  40. package/dist/application/subagent-service.d.ts.map +1 -0
  41. package/dist/application/subagent-service.js +1305 -0
  42. package/dist/application/subagent-service.js.map +1 -0
  43. package/dist/application/tool-use-summary.d.ts +8 -0
  44. package/dist/application/tool-use-summary.d.ts.map +1 -0
  45. package/dist/application/tool-use-summary.js +53 -0
  46. package/dist/application/tool-use-summary.js.map +1 -0
  47. package/dist/application/top-level-agent-manager.d.ts +58 -0
  48. package/dist/application/top-level-agent-manager.d.ts.map +1 -0
  49. package/dist/application/top-level-agent-manager.js +907 -0
  50. package/dist/application/top-level-agent-manager.js.map +1 -0
  51. package/dist/application/workflow-manager.d.ts +61 -0
  52. package/dist/application/workflow-manager.d.ts.map +1 -0
  53. package/dist/application/workflow-manager.js +582 -0
  54. package/dist/application/workflow-manager.js.map +1 -0
  55. package/dist/application/workflow-meta.d.ts +18 -0
  56. package/dist/application/workflow-meta.d.ts.map +1 -0
  57. package/dist/application/workflow-meta.js +146 -0
  58. package/dist/application/workflow-meta.js.map +1 -0
  59. package/dist/application/workflow-runtime.d.ts +29 -0
  60. package/dist/application/workflow-runtime.d.ts.map +1 -0
  61. package/dist/application/workflow-runtime.js +176 -0
  62. package/dist/application/workflow-runtime.js.map +1 -0
  63. package/dist/application/workflow-worktree.d.ts +9 -0
  64. package/dist/application/workflow-worktree.d.ts.map +1 -0
  65. package/dist/application/workflow-worktree.js +11 -0
  66. package/dist/application/workflow-worktree.js.map +1 -0
  67. package/dist/cli/agents-dashboard.d.ts +37 -0
  68. package/dist/cli/agents-dashboard.d.ts.map +1 -0
  69. package/dist/cli/agents-dashboard.js +408 -0
  70. package/dist/cli/agents-dashboard.js.map +1 -0
  71. package/dist/cli/controls.d.ts +15 -0
  72. package/dist/cli/controls.d.ts.map +1 -0
  73. package/dist/cli/controls.js +219 -0
  74. package/dist/cli/controls.js.map +1 -0
  75. package/dist/cli/debug.d.ts +13 -0
  76. package/dist/cli/debug.d.ts.map +1 -0
  77. package/dist/cli/debug.js +37 -0
  78. package/dist/cli/debug.js.map +1 -0
  79. package/dist/cli/interactive.d.ts +63 -0
  80. package/dist/cli/interactive.d.ts.map +1 -0
  81. package/dist/cli/interactive.js +600 -0
  82. package/dist/cli/interactive.js.map +1 -0
  83. package/dist/cli/protocol.d.ts +251 -0
  84. package/dist/cli/protocol.d.ts.map +1 -0
  85. package/dist/cli/protocol.js +2146 -0
  86. package/dist/cli/protocol.js.map +1 -0
  87. package/dist/cli.d.ts +116 -0
  88. package/dist/cli.d.ts.map +1 -0
  89. package/dist/cli.js +3901 -0
  90. package/dist/cli.js.map +1 -0
  91. package/dist/compatibility/claude/compaction.d.ts +19 -0
  92. package/dist/compatibility/claude/compaction.d.ts.map +1 -0
  93. package/dist/compatibility/claude/compaction.js +82 -0
  94. package/dist/compatibility/claude/compaction.js.map +1 -0
  95. package/dist/compatibility/claude/context.d.ts +24 -0
  96. package/dist/compatibility/claude/context.d.ts.map +1 -0
  97. package/dist/compatibility/claude/context.js +92 -0
  98. package/dist/compatibility/claude/context.js.map +1 -0
  99. package/dist/compatibility/claude/dynamic-context.d.ts +20 -0
  100. package/dist/compatibility/claude/dynamic-context.d.ts.map +1 -0
  101. package/dist/compatibility/claude/dynamic-context.js +168 -0
  102. package/dist/compatibility/claude/dynamic-context.js.map +1 -0
  103. package/dist/compatibility/claude/file-history.d.ts +14 -0
  104. package/dist/compatibility/claude/file-history.d.ts.map +1 -0
  105. package/dist/compatibility/claude/file-history.js +340 -0
  106. package/dist/compatibility/claude/file-history.js.map +1 -0
  107. package/dist/compatibility/claude/file-resources.d.ts +28 -0
  108. package/dist/compatibility/claude/file-resources.d.ts.map +1 -0
  109. package/dist/compatibility/claude/file-resources.js +168 -0
  110. package/dist/compatibility/claude/file-resources.js.map +1 -0
  111. package/dist/compatibility/claude/fork.d.ts +9 -0
  112. package/dist/compatibility/claude/fork.d.ts.map +1 -0
  113. package/dist/compatibility/claude/fork.js +225 -0
  114. package/dist/compatibility/claude/fork.js.map +1 -0
  115. package/dist/compatibility/claude/history.d.ts +4 -0
  116. package/dist/compatibility/claude/history.d.ts.map +1 -0
  117. package/dist/compatibility/claude/history.js +86 -0
  118. package/dist/compatibility/claude/history.js.map +1 -0
  119. package/dist/compatibility/claude/ownership.d.ts +87 -0
  120. package/dist/compatibility/claude/ownership.d.ts.map +1 -0
  121. package/dist/compatibility/claude/ownership.js +100 -0
  122. package/dist/compatibility/claude/ownership.js.map +1 -0
  123. package/dist/compatibility/claude/paths.d.ts +17 -0
  124. package/dist/compatibility/claude/paths.d.ts.map +1 -0
  125. package/dist/compatibility/claude/paths.js +54 -0
  126. package/dist/compatibility/claude/paths.js.map +1 -0
  127. package/dist/compatibility/claude/pr-links.d.ts +25 -0
  128. package/dist/compatibility/claude/pr-links.d.ts.map +1 -0
  129. package/dist/compatibility/claude/pr-links.js +80 -0
  130. package/dist/compatibility/claude/pr-links.js.map +1 -0
  131. package/dist/compatibility/claude/projection.d.ts +11 -0
  132. package/dist/compatibility/claude/projection.d.ts.map +1 -0
  133. package/dist/compatibility/claude/projection.js +325 -0
  134. package/dist/compatibility/claude/projection.js.map +1 -0
  135. package/dist/compatibility/claude/schema.d.ts +18 -0
  136. package/dist/compatibility/claude/schema.d.ts.map +1 -0
  137. package/dist/compatibility/claude/schema.js +983 -0
  138. package/dist/compatibility/claude/schema.js.map +1 -0
  139. package/dist/compatibility/claude/shared-resources.d.ts +51 -0
  140. package/dist/compatibility/claude/shared-resources.d.ts.map +1 -0
  141. package/dist/compatibility/claude/shared-resources.js +382 -0
  142. package/dist/compatibility/claude/shared-resources.js.map +1 -0
  143. package/dist/compatibility/claude/sidechain.d.ts +50 -0
  144. package/dist/compatibility/claude/sidechain.d.ts.map +1 -0
  145. package/dist/compatibility/claude/sidechain.js +90 -0
  146. package/dist/compatibility/claude/sidechain.js.map +1 -0
  147. package/dist/compatibility/claude/tool-links.d.ts +13 -0
  148. package/dist/compatibility/claude/tool-links.d.ts.map +1 -0
  149. package/dist/compatibility/claude/tool-links.js +61 -0
  150. package/dist/compatibility/claude/tool-links.js.map +1 -0
  151. package/dist/compatibility/claude/translation.d.ts +71 -0
  152. package/dist/compatibility/claude/translation.d.ts.map +1 -0
  153. package/dist/compatibility/claude/translation.js +443 -0
  154. package/dist/compatibility/claude/translation.js.map +1 -0
  155. package/dist/compatibility/claude/workflow-replay.d.ts +10 -0
  156. package/dist/compatibility/claude/workflow-replay.d.ts.map +1 -0
  157. package/dist/compatibility/claude/workflow-replay.js +66 -0
  158. package/dist/compatibility/claude/workflow-replay.js.map +1 -0
  159. package/dist/compatibility/claude/workflow.d.ts +33 -0
  160. package/dist/compatibility/claude/workflow.d.ts.map +1 -0
  161. package/dist/compatibility/claude/workflow.js +76 -0
  162. package/dist/compatibility/claude/workflow.js.map +1 -0
  163. package/dist/core/compaction.d.ts +16 -0
  164. package/dist/core/compaction.d.ts.map +1 -0
  165. package/dist/core/compaction.js +2 -0
  166. package/dist/core/compaction.js.map +1 -0
  167. package/dist/core/context-budget.d.ts +28 -0
  168. package/dist/core/context-budget.d.ts.map +1 -0
  169. package/dist/core/context-budget.js +108 -0
  170. package/dist/core/context-budget.js.map +1 -0
  171. package/dist/core/context.d.ts +16 -0
  172. package/dist/core/context.d.ts.map +1 -0
  173. package/dist/core/context.js +13 -0
  174. package/dist/core/context.js.map +1 -0
  175. package/dist/core/runtime.d.ts +394 -0
  176. package/dist/core/runtime.d.ts.map +1 -0
  177. package/dist/core/runtime.js +507 -0
  178. package/dist/core/runtime.js.map +1 -0
  179. package/dist/core/usage.d.ts +26 -0
  180. package/dist/core/usage.d.ts.map +1 -0
  181. package/dist/core/usage.js +133 -0
  182. package/dist/core/usage.js.map +1 -0
  183. package/dist/extensions/claude-extension-tools.d.ts +16 -0
  184. package/dist/extensions/claude-extension-tools.d.ts.map +1 -0
  185. package/dist/extensions/claude-extension-tools.js +78 -0
  186. package/dist/extensions/claude-extension-tools.js.map +1 -0
  187. package/dist/extensions/claude-extensions.d.ts +41 -0
  188. package/dist/extensions/claude-extensions.d.ts.map +1 -0
  189. package/dist/extensions/claude-extensions.js +270 -0
  190. package/dist/extensions/claude-extensions.js.map +1 -0
  191. package/dist/hooks/claude-hook-tools.d.ts +26 -0
  192. package/dist/hooks/claude-hook-tools.d.ts.map +1 -0
  193. package/dist/hooks/claude-hook-tools.js +129 -0
  194. package/dist/hooks/claude-hook-tools.js.map +1 -0
  195. package/dist/hooks/claude-hooks.d.ts +87 -0
  196. package/dist/hooks/claude-hooks.d.ts.map +1 -0
  197. package/dist/hooks/claude-hooks.js +411 -0
  198. package/dist/hooks/claude-hooks.js.map +1 -0
  199. package/dist/maintenance/doctor.d.ts +33 -0
  200. package/dist/maintenance/doctor.d.ts.map +1 -0
  201. package/dist/maintenance/doctor.js +391 -0
  202. package/dist/maintenance/doctor.js.map +1 -0
  203. package/dist/maintenance/self-update.d.ts +31 -0
  204. package/dist/maintenance/self-update.d.ts.map +1 -0
  205. package/dist/maintenance/self-update.js +81 -0
  206. package/dist/maintenance/self-update.js.map +1 -0
  207. package/dist/mcp/claude-mcp-management.d.ts +28 -0
  208. package/dist/mcp/claude-mcp-management.d.ts.map +1 -0
  209. package/dist/mcp/claude-mcp-management.js +169 -0
  210. package/dist/mcp/claude-mcp-management.js.map +1 -0
  211. package/dist/mcp/claude-mcp-oauth.d.ts +113 -0
  212. package/dist/mcp/claude-mcp-oauth.d.ts.map +1 -0
  213. package/dist/mcp/claude-mcp-oauth.js +1053 -0
  214. package/dist/mcp/claude-mcp-oauth.js.map +1 -0
  215. package/dist/mcp/claude-mcp-tools.d.ts +98 -0
  216. package/dist/mcp/claude-mcp-tools.d.ts.map +1 -0
  217. package/dist/mcp/claude-mcp-tools.js +1246 -0
  218. package/dist/mcp/claude-mcp-tools.js.map +1 -0
  219. package/dist/mcp/praxis-mcp-server.d.ts +35 -0
  220. package/dist/mcp/praxis-mcp-server.d.ts.map +1 -0
  221. package/dist/mcp/praxis-mcp-server.js +520 -0
  222. package/dist/mcp/praxis-mcp-server.js.map +1 -0
  223. package/dist/permissions/claude-auto-classifier.d.ts +20 -0
  224. package/dist/permissions/claude-auto-classifier.d.ts.map +1 -0
  225. package/dist/permissions/claude-auto-classifier.js +140 -0
  226. package/dist/permissions/claude-auto-classifier.js.map +1 -0
  227. package/dist/permissions/claude-permission-resolver.d.ts +30 -0
  228. package/dist/permissions/claude-permission-resolver.d.ts.map +1 -0
  229. package/dist/permissions/claude-permission-resolver.js +334 -0
  230. package/dist/permissions/claude-permission-resolver.js.map +1 -0
  231. package/dist/persistence/claude-job-store.d.ts +68 -0
  232. package/dist/persistence/claude-job-store.d.ts.map +1 -0
  233. package/dist/persistence/claude-job-store.js +311 -0
  234. package/dist/persistence/claude-job-store.js.map +1 -0
  235. package/dist/persistence/claude-scheduled-task-store.d.ts +29 -0
  236. package/dist/persistence/claude-scheduled-task-store.d.ts.map +1 -0
  237. package/dist/persistence/claude-scheduled-task-store.js +163 -0
  238. package/dist/persistence/claude-scheduled-task-store.js.map +1 -0
  239. package/dist/persistence/claude-sidechain-store.d.ts +18 -0
  240. package/dist/persistence/claude-sidechain-store.d.ts.map +1 -0
  241. package/dist/persistence/claude-sidechain-store.js +107 -0
  242. package/dist/persistence/claude-sidechain-store.js.map +1 -0
  243. package/dist/persistence/claude-task-store.d.ts +72 -0
  244. package/dist/persistence/claude-task-store.d.ts.map +1 -0
  245. package/dist/persistence/claude-task-store.js +440 -0
  246. package/dist/persistence/claude-task-store.js.map +1 -0
  247. package/dist/persistence/claude-transcript-store.d.ts +85 -0
  248. package/dist/persistence/claude-transcript-store.d.ts.map +1 -0
  249. package/dist/persistence/claude-transcript-store.js +385 -0
  250. package/dist/persistence/claude-transcript-store.js.map +1 -0
  251. package/dist/persistence/claude-workflow-store.d.ts +41 -0
  252. package/dist/persistence/claude-workflow-store.d.ts.map +1 -0
  253. package/dist/persistence/claude-workflow-store.js +263 -0
  254. package/dist/persistence/claude-workflow-store.js.map +1 -0
  255. package/dist/persistence/in-memory-sidechain-store.d.ts +12 -0
  256. package/dist/persistence/in-memory-sidechain-store.d.ts.map +1 -0
  257. package/dist/persistence/in-memory-sidechain-store.js +30 -0
  258. package/dist/persistence/in-memory-sidechain-store.js.map +1 -0
  259. package/dist/persistence/in-memory-transcript-store.d.ts +15 -0
  260. package/dist/persistence/in-memory-transcript-store.d.ts.map +1 -0
  261. package/dist/persistence/in-memory-transcript-store.js +95 -0
  262. package/dist/persistence/in-memory-transcript-store.js.map +1 -0
  263. package/dist/platform/atomic-write.d.ts +5 -0
  264. package/dist/platform/atomic-write.d.ts.map +1 -0
  265. package/dist/platform/atomic-write.js +25 -0
  266. package/dist/platform/atomic-write.js.map +1 -0
  267. package/dist/platform/bounded-process-runner.d.ts +28 -0
  268. package/dist/platform/bounded-process-runner.d.ts.map +1 -0
  269. package/dist/platform/bounded-process-runner.js +209 -0
  270. package/dist/platform/bounded-process-runner.js.map +1 -0
  271. package/dist/platform/claude-version.d.ts +5 -0
  272. package/dist/platform/claude-version.d.ts.map +1 -0
  273. package/dist/platform/claude-version.js +17 -0
  274. package/dist/platform/claude-version.js.map +1 -0
  275. package/dist/platform/command-shell.d.ts +3 -0
  276. package/dist/platform/command-shell.d.ts.map +1 -0
  277. package/dist/platform/command-shell.js +15 -0
  278. package/dist/platform/command-shell.js.map +1 -0
  279. package/dist/platform/exclusive-file-lease.d.ts +15 -0
  280. package/dist/platform/exclusive-file-lease.d.ts.map +1 -0
  281. package/dist/platform/exclusive-file-lease.js +265 -0
  282. package/dist/platform/exclusive-file-lease.js.map +1 -0
  283. package/dist/platform/sensitive-data.d.ts +8 -0
  284. package/dist/platform/sensitive-data.d.ts.map +1 -0
  285. package/dist/platform/sensitive-data.js +138 -0
  286. package/dist/platform/sensitive-data.js.map +1 -0
  287. package/dist/platform/tmux-worktree.d.ts +30 -0
  288. package/dist/platform/tmux-worktree.d.ts.map +1 -0
  289. package/dist/platform/tmux-worktree.js +138 -0
  290. package/dist/platform/tmux-worktree.js.map +1 -0
  291. package/dist/plugins/claude-plugin-eval-discovery.d.ts +20 -0
  292. package/dist/plugins/claude-plugin-eval-discovery.d.ts.map +1 -0
  293. package/dist/plugins/claude-plugin-eval-discovery.js +128 -0
  294. package/dist/plugins/claude-plugin-eval-discovery.js.map +1 -0
  295. package/dist/plugins/claude-plugin-eval-graders.d.ts +49 -0
  296. package/dist/plugins/claude-plugin-eval-graders.d.ts.map +1 -0
  297. package/dist/plugins/claude-plugin-eval-graders.js +137 -0
  298. package/dist/plugins/claude-plugin-eval-graders.js.map +1 -0
  299. package/dist/plugins/claude-plugin-eval-runner.d.ts +50 -0
  300. package/dist/plugins/claude-plugin-eval-runner.d.ts.map +1 -0
  301. package/dist/plugins/claude-plugin-eval-runner.js +189 -0
  302. package/dist/plugins/claude-plugin-eval-runner.js.map +1 -0
  303. package/dist/plugins/claude-plugin-eval-schema.d.ts +80 -0
  304. package/dist/plugins/claude-plugin-eval-schema.d.ts.map +1 -0
  305. package/dist/plugins/claude-plugin-eval-schema.js +436 -0
  306. package/dist/plugins/claude-plugin-eval-schema.js.map +1 -0
  307. package/dist/plugins/claude-plugin-eval.d.ts +66 -0
  308. package/dist/plugins/claude-plugin-eval.d.ts.map +1 -0
  309. package/dist/plugins/claude-plugin-eval.js +438 -0
  310. package/dist/plugins/claude-plugin-eval.js.map +1 -0
  311. package/dist/plugins/claude-plugin-maintenance.d.ts +39 -0
  312. package/dist/plugins/claude-plugin-maintenance.d.ts.map +1 -0
  313. package/dist/plugins/claude-plugin-maintenance.js +336 -0
  314. package/dist/plugins/claude-plugin-maintenance.js.map +1 -0
  315. package/dist/plugins/claude-plugin-marketplace.d.ts +97 -0
  316. package/dist/plugins/claude-plugin-marketplace.d.ts.map +1 -0
  317. package/dist/plugins/claude-plugin-marketplace.js +1433 -0
  318. package/dist/plugins/claude-plugin-marketplace.js.map +1 -0
  319. package/dist/plugins/claude-plugin-mcpb.d.ts +71 -0
  320. package/dist/plugins/claude-plugin-mcpb.d.ts.map +1 -0
  321. package/dist/plugins/claude-plugin-mcpb.js +885 -0
  322. package/dist/plugins/claude-plugin-mcpb.js.map +1 -0
  323. package/dist/plugins/claude-plugin-runtime.d.ts +120 -0
  324. package/dist/plugins/claude-plugin-runtime.d.ts.map +1 -0
  325. package/dist/plugins/claude-plugin-runtime.js +1263 -0
  326. package/dist/plugins/claude-plugin-runtime.js.map +1 -0
  327. package/dist/providers/anthropic-compatible.d.ts +35 -0
  328. package/dist/providers/anthropic-compatible.d.ts.map +1 -0
  329. package/dist/providers/anthropic-compatible.js +733 -0
  330. package/dist/providers/anthropic-compatible.js.map +1 -0
  331. package/dist/providers/environment.d.ts +14 -0
  332. package/dist/providers/environment.d.ts.map +1 -0
  333. package/dist/providers/environment.js +67 -0
  334. package/dist/providers/environment.js.map +1 -0
  335. package/dist/providers/fallback-provider.d.ts +17 -0
  336. package/dist/providers/fallback-provider.d.ts.map +1 -0
  337. package/dist/providers/fallback-provider.js +70 -0
  338. package/dist/providers/fallback-provider.js.map +1 -0
  339. package/dist/providers/openai-compatible.d.ts +30 -0
  340. package/dist/providers/openai-compatible.d.ts.map +1 -0
  341. package/dist/providers/openai-compatible.js +409 -0
  342. package/dist/providers/openai-compatible.js.map +1 -0
  343. package/dist/tools/claude-interactive-tools.d.ts +58 -0
  344. package/dist/tools/claude-interactive-tools.d.ts.map +1 -0
  345. package/dist/tools/claude-interactive-tools.js +390 -0
  346. package/dist/tools/claude-interactive-tools.js.map +1 -0
  347. package/dist/tools/claude-lsp-formatters.d.ts +2 -0
  348. package/dist/tools/claude-lsp-formatters.d.ts.map +1 -0
  349. package/dist/tools/claude-lsp-formatters.js +291 -0
  350. package/dist/tools/claude-lsp-formatters.js.map +1 -0
  351. package/dist/tools/claude-lsp-tool.d.ts +22 -0
  352. package/dist/tools/claude-lsp-tool.d.ts.map +1 -0
  353. package/dist/tools/claude-lsp-tool.js +744 -0
  354. package/dist/tools/claude-lsp-tool.js.map +1 -0
  355. package/dist/tools/claude-scheduled-tools.d.ts +20 -0
  356. package/dist/tools/claude-scheduled-tools.d.ts.map +1 -0
  357. package/dist/tools/claude-scheduled-tools.js +344 -0
  358. package/dist/tools/claude-scheduled-tools.js.map +1 -0
  359. package/dist/tools/claude-task-tools.d.ts +30 -0
  360. package/dist/tools/claude-task-tools.d.ts.map +1 -0
  361. package/dist/tools/claude-task-tools.js +503 -0
  362. package/dist/tools/claude-task-tools.js.map +1 -0
  363. package/dist/tools/claude-user-message.d.ts +16 -0
  364. package/dist/tools/claude-user-message.d.ts.map +1 -0
  365. package/dist/tools/claude-user-message.js +98 -0
  366. package/dist/tools/claude-user-message.js.map +1 -0
  367. package/dist/tools/claude-workflow-tools.d.ts +27 -0
  368. package/dist/tools/claude-workflow-tools.d.ts.map +1 -0
  369. package/dist/tools/claude-workflow-tools.js +257 -0
  370. package/dist/tools/claude-workflow-tools.js.map +1 -0
  371. package/dist/tools/claude-worktree-tools.d.ts +17 -0
  372. package/dist/tools/claude-worktree-tools.d.ts.map +1 -0
  373. package/dist/tools/claude-worktree-tools.js +135 -0
  374. package/dist/tools/claude-worktree-tools.js.map +1 -0
  375. package/dist/tools/filtered-tool-registry.d.ts +16 -0
  376. package/dist/tools/filtered-tool-registry.d.ts.map +1 -0
  377. package/dist/tools/filtered-tool-registry.js +51 -0
  378. package/dist/tools/filtered-tool-registry.js.map +1 -0
  379. package/dist/tools/glob.d.ts +9 -0
  380. package/dist/tools/glob.d.ts.map +1 -0
  381. package/dist/tools/glob.js +88 -0
  382. package/dist/tools/glob.js.map +1 -0
  383. package/dist/tools/local-tools.d.ts +47 -0
  384. package/dist/tools/local-tools.d.ts.map +1 -0
  385. package/dist/tools/local-tools.js +1082 -0
  386. package/dist/tools/local-tools.js.map +1 -0
  387. package/dist/tools/notebook.d.ts +22 -0
  388. package/dist/tools/notebook.d.ts.map +1 -0
  389. package/dist/tools/notebook.js +154 -0
  390. package/dist/tools/notebook.js.map +1 -0
  391. package/dist/tools/web.d.ts +48 -0
  392. package/dist/tools/web.d.ts.map +1 -0
  393. package/dist/tools/web.js +726 -0
  394. package/dist/tools/web.js.map +1 -0
  395. package/package.json +145 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 wuqisen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,534 @@
1
+ # Praxis
2
+
3
+ [![CI](https://github.com/Forest-Isle/Praxis/actions/workflows/ci.yml/badge.svg)](https://github.com/Forest-Isle/Praxis/actions/workflows/ci.yml)
4
+ [![CodeQL](https://github.com/Forest-Isle/Praxis/actions/workflows/codeql.yml/badge.svg)](https://github.com/Forest-Isle/Praxis/actions/workflows/codeql.yml)
5
+ [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/Forest-Isle/Praxis/badge)](https://scorecard.dev/viewer/?uri=github.com/Forest-Isle/Praxis)
6
+ [![npm](https://img.shields.io/npm/v/praxis-agent)](https://www.npmjs.com/package/praxis-agent)
7
+ [![license](https://img.shields.io/github/license/Forest-Isle/Praxis)](LICENSE)
8
+
9
+ Praxis is a local-first, single-user general agent for the command line.
10
+
11
+ The project cleanly reimplements production-proven agent behavior without
12
+ copying Claude Code source. It keeps the CLI agent loop, tool use, permissions,
13
+ sessions, context compaction, skills, hooks, and MCP concepts while excluding
14
+ accounts, organizations, billing, managed enterprise policy, remote control,
15
+ IDE surfaces, and telemetry control planes.
16
+
17
+ ## Installation
18
+
19
+ Praxis requires Node.js 24 or newer and `ripgrep` (`rg`).
20
+
21
+ ```sh
22
+ npm install --global praxis-agent
23
+ praxis --version
24
+ ```
25
+
26
+ Release tarballs, SBOMs, SHA-256 checksums, and build attestations are attached
27
+ to each [GitHub release](https://github.com/Forest-Isle/Praxis/releases).
28
+
29
+ ## Status
30
+
31
+ Stage 90 exact CLI signature closure is implemented on top of the
32
+ Stage 89 executable CLI surface closure,
33
+ Stage 88 plugin MCP bundle parity,
34
+ Stage 87 protected plugin option parity,
35
+ Stage 86 interactive plugin LSP parity,
36
+ Stage 85 interactive question and plan-mode parity, and
37
+ Stage 84 completion audit, interactive dynamic wakeups,
38
+ Workflow, scheduled prompts, and
39
+ top-level background sessions and agent management, durable tasks, background Bash,
40
+ WebFetch/WebSearch, MCP resource tools,
41
+ native file globbing, notebook editing, CLI customization and session
42
+ controls, print and machine-I/O support, image tool results, native foreground
43
+ and background subagents, resilient sessions, native full-history forks, child-process
44
+ credential boundaries, shared memory, and native Anthropic/OpenAI-compatible
45
+ providers.
46
+ Headless runs support Claude-style settings/source isolation, safe and bare
47
+ modes, direct/file system prompts, additional canonical directory roots,
48
+ dynamic cwd/environment/memory/git context with optional first-user relocation,
49
+ explicit tool sets, CLI permission rules and modes, current-directory
50
+ continue/fork, PR-linked resume/fork, native session names, and in-memory
51
+ no-persistence execution.
52
+ `--resume` accepts an optional selector: UUID resumes directly, print/background
53
+ mode resolves an exact case-insensitive session title, and TTY text filters the
54
+ required session picker. Bare TTY `--resume` opens that picker.
55
+ The hidden-compatible `--permission-prompt-tool` control routes ask decisions
56
+ through a reserved MCP tool, supports approved input replacement, and keeps the
57
+ permission tool out of the model-visible tool surface. Denials can either return
58
+ a failed tool result or interrupt the run, matching the MCP response contract.
59
+ Classifier-backed `auto` permissions use the bounded provider decision path and
60
+ fail closed when classification is unavailable. No-persistence runs disable
61
+ Agent because native sidechains are disk-backed.
62
+ Running `praxis` or `praxis "prompt"` in a
63
+ TTY opens an
64
+ Ink session UI with streaming
65
+ responses, recent-session selection, runtime status, ask-permission prompts,
66
+ model-driven `AskUserQuestion`, and `EnterPlanMode`/`ExitPlanMode`. A positional
67
+ TTY prompt is submitted once after any required resume selection; `-p` remains
68
+ headless. Plan mode persists native `permission-mode` records, resumes across
69
+ Praxis and Claude transcripts, and restricts writes to the current session's
70
+ exact plan file under the shared Claude plans directory.
71
+ When resume finds a tool call interrupted before its result was persisted, the
72
+ UI shows the prepared tool name/input and requires a separate retry decision.
73
+ Praxis can run, resume, fork, and list Claude-compatible sessions
74
+ through a provider-neutral event loop and Anthropic-compatible or
75
+ OpenAI-compatible streaming providers. Built-in read, write, edit, glob, search,
76
+ shell, notebook, and web tools execute behind Claude-compatible local permission
77
+ rules with path checks, timeouts, cancellation, and bounded output. Notebook `Read`
78
+ emits Claude-compatible cell IDs and `NotebookEdit` performs one structured
79
+ replace, insert, or delete only after a successful read. `Read`, `Write`, and `Edit`
80
+ also accept the canonical shared Claude project-memory root; other external
81
+ paths and memory-root symlink escapes remain rejected.
82
+ `Read` detects PNG, JPEG, GIF, and WebP by file signature and returns bounded
83
+ provider-neutral image data. Anthropic receives a native image tool-result
84
+ block; OpenAI-compatible providers receive a paired tool confirmation and user
85
+ `image_url`. The image persists in Claude Code 2.1.208's native
86
+ `tool_result`/`toolUseResult` envelope and survives Praxis or Claude resume.
87
+ User image/document attachments and ordered MCP text, image, audio, resource,
88
+ and structured-content results use their validated native envelopes. Binary MCP
89
+ audio/resources are bounded and materialized under the session tool-result path.
90
+
91
+ Interactive plugin sessions expose Claude's `LSP` tool when an enabled plugin
92
+ provides `.lsp.json` or manifest `lspServers` configuration. Praxis implements
93
+ the nine Claude operations over bounded stdio JSON-RPC, exact result formatting,
94
+ document synchronization, gitignored-result filtering, transient retry,
95
+ crash recovery, and graceful shutdown. Plugin root/data/environment expansion,
96
+ effective user/project/local `${user_config.*}` options, workspace settings,
97
+ initialization options, and case-insensitive extension mapping follow the shared
98
+ plugin contract. Headless, safe, bare, explicitly denied, and `mcp serve`
99
+ surfaces do not expose LSP.
100
+ Plugin options merge user, project, and local settings with protected
101
+ `pluginSecrets`, with secure values winning collisions. Sensitive values are
102
+ stored in Claude-compatible credentials, scrubbed from plaintext settings,
103
+ removed after the last installed scope, and redacted from LSP, MCP, and hook
104
+ diagnostics. `${user_config.*}` substitution spans LSP/MCP/hook runtime config;
105
+ plugin hooks also receive `CLAUDE_PLUGIN_OPTION_*`. Commands, skills, and agents
106
+ receive non-sensitive values while sensitive references become explicit
107
+ model-safe placeholders.
108
+ Plugin MCP servers use Claude's `plugin:<plugin>:<server>` runtime namespace,
109
+ explicit plugin-origin metadata, manual-server-first signature deduplication,
110
+ and normalized model-visible tool names while preserving raw scoped names for
111
+ status and resource operations.
112
+ Manifest declarations support ordinary JSON plus local or HTTP(S) `.mcpb` and
113
+ `.dxt` bundles. Bundle loading uses the official MCPB schema/config generator,
114
+ sticky remote and change-aware local caches, bounded downloads and ZIP
115
+ extraction, traversal/symlink/bomb rejection, executable-bit restoration, and
116
+ per-bundle failure isolation. MCPB user config shares the protected plugin
117
+ option plane; required values, qualified `server.key=value` assignments,
118
+ defaults, arrays, platform overrides, plugin data/root expansion, and sensitive
119
+ diagnostic redaction are preserved through packed runtime execution.
120
+ Protected plugin configuration commits credentials and settings under one
121
+ cross-process lease with a crash-recovery journal; interrupted writes recover
122
+ forward or roll back from exact file hashes without exposing Keychain values in
123
+ process arguments.
124
+
125
+ Each run or resume holds one session lease through model completion and final
126
+ persistence. Native tool calls and results append immediately to the shared
127
+ Claude transcript, and Claude Code 2.1.208 can resume a Praxis tool session.
128
+ `--resume-session-at <message-id>` with explicit `--resume` starts from any
129
+ active user or assistant message. Praxis preserves abandoned descendants in
130
+ the append-only JSONL, appends a native `parentUuid` branch, projects only the
131
+ new active chain on later resumes, and applies the same boundary before a
132
+ generated or explicit `--fork-session`. Foreground, interactive, background,
133
+ and no-persistence paths share this behavior, and either CLI can resume the
134
+ other runtime's branch.
135
+ The synchronous `Agent` tool runs bounded `general-purpose` or shared custom
136
+ agents through the same provider, local/MCP/Skill tools, permissions, hooks,
137
+ context, and cancellation path. Completed work writes native sidechain JSONL,
138
+ metadata, and main-chain Agent results that Claude Code 2.1.208 can discover and
139
+ resume. Background Agent execution, output/stop, same-ID messaging, and
140
+ completion notifications share that sidechain path.
141
+ `TaskCreate`, `TaskGet`, `TaskList`, and `TaskUpdate` use Claude's authoritative
142
+ `<config>/tasks/<session-id>` graph, including reciprocal dependencies,
143
+ metadata merge/delete, monotonic IDs, internal-task filtering, optimistic
144
+ cross-runtime update replay, and bidirectional resume. Bash accepts
145
+ `run_in_background`, writes bounded redacted output under Claude's temporary
146
+ task path, and shares `TaskOutput`/`TaskStop` routing with Agent IDs. Resumable
147
+ Bash sidecars use atomic replacement and malformed records are ignored. Only
148
+ `Read` can access the temporary output root.
149
+ Top-level `--bg`/`--background` launches a detached, persistent session whose
150
+ eight-hex job ID owns an idle/active/stopped lifecycle. In a TTY, `praxis agents`
151
+ opens a live grouped dashboard for native Claude and Praxis sessions, including
152
+ history review, background dispatch, completed-session resume, attach,
153
+ continuation, detach, and stop. `agents --json [--all] [--cwd <path>]` retains a
154
+ non-interactive scripting surface; `logs`, `attach`, and `stop` use an
155
+ owner-authenticated local control socket. Job state follows Claude's local
156
+ `jobs/` and `sessions/` layout while Praxis-only dispatch ownership prevents
157
+ cross-runtime process takeover. Background user/assistant entries carry native
158
+ `sessionKind: "bg"` metadata, and either CLI can resume the shared transcript.
159
+ CLI worktree sessions support `--tmux`: iTerm2 receives a native split pane
160
+ with an explicitly rooted, shell-escaped child command; other terminals fall
161
+ back to detached classic tmux. `--tmux=classic` always forces traditional tmux.
162
+ `CronCreate`, `CronList`, and `CronDelete` expose Claude Code 2.1.208-compatible
163
+ schemas and results for session-only and durable prompts. Durable jobs share
164
+ `<cwd>/.claude/scheduled_tasks.json`, preserve unknown native fields, use atomic
165
+ optimistic mutations, avoid live foreign process owners, catch up missed
166
+ one-shot jobs, and expire recurring jobs after a final seven-day execution. The
167
+ interactive CLI keeps one service alive, submits due prompts while idle, and
168
+ releases timers on exit. Built-in `/loop` expands fixed intervals through
169
+ `CronCreate` and executes the prompt immediately once. In an interactive Praxis
170
+ service, `ScheduleWakeup` clamps session-only one-shot delays, submits the prompt
171
+ through the same idle queue, and supports stop/close cancellation. Headless runs
172
+ retain the observed Claude inactive result. Active replacement, max-age,
173
+ stop, and close behavior follows the validated process-local lifecycle.
174
+ The opt-in `Workflow` tool runs sandboxed JavaScript orchestration with agents,
175
+ parallel/pipeline helpers, structured results, token targets, worktree isolation,
176
+ background task control, native run/journal files, and same-run replay. Praxis can
177
+ fallback-replay a unique Claude-created prompt without semantic options. Exact
178
+ chained `v2` replay keys, semantic sidecars, and ordered fallbacks are validated
179
+ in both directions. Claude Code 2.1.208 exposes no standalone `Monitor` tool.
180
+ Forks preserve the complete supported main-chain native history, including
181
+ tool calls/results, compact boundaries/summaries, attachments, agent settings,
182
+ titles, images, errors, and interrupted-tool denial records. Existing UUIDs,
183
+ parent links, and payload fields remain unchanged; only `sessionId` changes.
184
+ Latest mode and permission state is retained. Queue and file-history records
185
+ are transient and excluded, while unknown entry types, mismatched session IDs,
186
+ and malformed cross-entry links fail closed. Subagent sidechains and orphaned
187
+ `last-prompt` hints are excluded from the main-session fork.
188
+ When `CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING=true`, successful `Write`,
189
+ `Edit`, and `NotebookEdit` calls append native file-history snapshot/delta
190
+ records and bounded backups under `<config>/file-history/<session-id>`.
191
+ `--resume <session-id> --rewind-files <user-message-uuid>` is a provider-free
192
+ standalone operation that restores or removes tracked files at that checkpoint.
193
+ Claude Code can rewind Praxis checkpoints, and Praxis can rewind Claude
194
+ checkpoints; restore paths remain confined to the active workspace, explicit
195
+ additional directories, and shared memory root.
196
+
197
+ Session leases now carry PID/token ownership and safely reclaim locks left by a
198
+ dead Praxis process while preserving live or unrecognized locks. Session
199
+ listing isolates malformed JSONL instead of failing the entire project and
200
+ reports the exact line and byte offset. `praxis inspect` exposes read/write
201
+ status and recovery metadata; `praxis export` returns the original transcript
202
+ bytes without normalization. Both commands remain available when the detected
203
+ Claude version is unsupported for writes or the transcript has a corrupt tail.
204
+ `praxis export --json` carries those bytes as base64 with explicit encoding
205
+ metadata.
206
+
207
+ Global and project `CLAUDE.md`, unconditional user/project rules, and the first
208
+ 200 lines of canonical project `MEMORY.md` now assemble into provider-neutral
209
+ system context for run and resume. A successful `Read` of a path matching a
210
+ conditional rule activates its instruction for later model turns and persists
211
+ the Claude 2.1.208 native `nested_memory` attachment, so both Praxis and Claude
212
+ Code retain it after resume. Prompt path mentions, Write, Grep, and Bash do not
213
+ activate path rules. Edit also remains non-activating; the compatibility probe
214
+ pre-reads its target before installing the matching rule so Edit can succeed
215
+ without a rule-activating Read.
216
+ Linked memory details remain explicit standard `Read` calls. Standard `Write`
217
+ and `Edit` calls update the same shared Markdown files, so Claude Code and
218
+ Praxis observe one memory plane without import or synchronization. Base system
219
+ context stays ephemeral and is not copied into the authoritative transcript.
220
+
221
+ Global and project commands and skills now expand from the shared Claude files
222
+ without entering base context. Slash invocation persists Claude-compatible
223
+ command wrapper plus expanded user entries; provider-selected skills use the
224
+ `Skill` tool/result flow and inject their scoped body before the next turn.
225
+ `--agent <name>` applies shared agent instructions and writes native
226
+ `agent-setting` metadata, which both Praxis and Claude restore on resume.
227
+
228
+ Command hooks load directly from user, project, and local Claude settings.
229
+ Praxis executes SessionStart, UserPromptSubmit, PreToolUse,
230
+ PermissionRequest, PostToolUse, PostToolUseFailure, Stop, and SessionEnd with
231
+ bounded subprocesses and native stdin envelopes. Pre-tool hooks can rewrite
232
+ input, decide permission, add resumable context, or block with exit code 2;
233
+ Stop hooks can request another model turn. Hook success, failure, and context
234
+ attachments before SessionEnd use the Claude 2.1.208 transcript profile and
235
+ survive bidirectional resume; SessionEnd executes after `last-prompt` without
236
+ writing its output to the transcript. Hook commands run without user shell
237
+ startup files or ambient credential variables. Exact credential values are
238
+ redacted from commands, stdout, stderr, blocking reasons, and additional
239
+ context before they can reach diagnostics or shared JSONL.
240
+
241
+ MCP servers load from Claude's shared user, project, and project-local config
242
+ with local-over-project-over-user precedence. Stdio, Streamable HTTP, and
243
+ legacy SSE servers expose `mcp__<server>__<tool>` definitions through the same
244
+ permission and hook pipeline as built-in tools. Unavailable servers emit a
245
+ warning; connected clients and stdio subprocesses close after each CLI
246
+ invocation. Multi-turn stream input intentionally reuses one connection set.
247
+ Resource-capable servers also expose Claude-compatible list, read, and
248
+ directory-resource tools. Resource discovery follows bounded MCP pagination;
249
+ text results stay inline, while bounded binary blobs are exclusively saved under
250
+ the active session's shared `tool-results` directory, including ephemeral
251
+ sessions that do not write JSONL. Stream init reports connected and failed
252
+ configured servers even when a server provides resources but no callable tools.
253
+ Stdio servers receive a sanitized ambient environment; values declared in that
254
+ server's explicit `env` config remain available to it. Credential-named MCP
255
+ environment values and sensitive HTTP headers are redacted from tool results,
256
+ discovery warnings, and errors. Plain, NDJSON, and interactive CLI diagnostics
257
+ also redact ambient credential values, including provider error bodies, failed
258
+ runtime events, tool failures, and approval descriptions that echo a key.
259
+ Prompt-capable servers expose `server:prompt (MCP)` slash commands with bounded
260
+ pagination, `list_changed` refresh, raw wire-name preservation, reconnect, and
261
+ positional argument mapping. Text, image, audio, resource, and resource-link
262
+ content follows the same bounded conversion path as MCP tools; binary prompt
263
+ content is written to the active session's durable `tool-results` directory so
264
+ resume never retains a deleted temporary path.
265
+
266
+ Normal and safe modes expose `WebFetch`; `WebSearch` is added only when the
267
+ selected provider advertises native search support. Bare mode excludes both,
268
+ including explicit tool selection. WebFetch upgrades HTTP to HTTPS, rejects
269
+ credentials and private/loopback destinations, pins each request to validated
270
+ public DNS results, revalidates same-host redirects, converts supported text to
271
+ Markdown, and bounds time, response bytes, output bytes, redirects, and cache.
272
+ Cross-host redirects are returned for a fresh explicit fetch. Anthropic-native
273
+ WebSearch supports allowed or blocked domain filters, links/citations, and the
274
+ Claude-compatible source reminder; OpenAI-compatible providers currently do
275
+ not advertise native WebSearch.
276
+
277
+ Provider-neutral context budgeting counts system/history/tool-schema input
278
+ before every model turn. When an explicitly configured provider window would
279
+ overflow, Praxis summarizes completed history without tools, atomically appends
280
+ the Claude 2.1.208 native `compact_boundary` plus compact-summary pair, and
281
+ rechecks the reduced request before continuing. Shared JSONL remains
282
+ append-only; Claude Code and Praxis both project only the latest summary and
283
+ later messages. Activated nested-memory rules remain active across compaction.
284
+
285
+ ## Product boundary
286
+
287
+ - CLI-only, including interactive and structured non-interactive output
288
+ - One local OS user, multiple workspaces and sessions
289
+ - Provider-capability-aware rather than tied to one model vendor
290
+ - Claude Code-compatible transcripts, configuration, permissions, and memory
291
+ - Shared local agent definitions plus background Agent launch, output, stop,
292
+ same-ID messaging, completion notification, and native sidechains
293
+ - Shared durable task graph plus foreground/background Bash lifecycle
294
+ - Persistent top-level background sessions plus native/Praxis agents dashboard,
295
+ history review/resume, JSON, logs, attach, continuation, and stop controls
296
+ - Session-only dynamic wakeups, shared durable scheduled prompts, and
297
+ fixed-interval `/loop`
298
+
299
+ ## Claude Code interoperability
300
+
301
+ Praxis uses Claude Code's local data layout as its default shared data plane.
302
+ The compatibility target is bidirectional: Praxis can resume Claude Code
303
+ sessions, and Claude Code can resume sessions written by Praxis. Project
304
+ instructions, auto memory, skills, agents, hooks, and MCP configuration are
305
+ shared rather than copied into a separate Praxis ecosystem.
306
+
307
+ See [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md) for protocol boundaries and
308
+ [docs/ROADMAP.md](docs/ROADMAP.md) for implementation gates.
309
+ See [docs/RELEASE.md](docs/RELEASE.md) for release verification and
310
+ [docs/RELEASE_AUTOMATION.md](docs/RELEASE_AUTOMATION.md) for maintainer
311
+ operations.
312
+
313
+ ## Development
314
+
315
+ Requires Node.js 24 or newer.
316
+ The Grep tool requires `rg`; command execution uses startup-file-free
317
+ `/bin/zsh` on macOS and `/bin/bash` on Linux.
318
+
319
+ ```sh
320
+ npm install
321
+ npm run typecheck
322
+ npm test
323
+ npm run build
324
+ npm run check
325
+ npm run test:performance
326
+ npm run test:package
327
+ node dist/cli.js --help
328
+ ```
329
+
330
+ Contributions use Conventional Commit pull-request titles and must pass the
331
+ required `CI` check. See [CONTRIBUTING.md](CONTRIBUTING.md).
332
+
333
+ Configure the first provider adapter, then run a prompt:
334
+
335
+ ```sh
336
+ export PRAXIS_API_KEY=...
337
+ export PRAXIS_MODEL=...
338
+ export PRAXIS_PROVIDER=openai # or anthropic
339
+ export PRAXIS_BASE_URL=https://api.openai.com/v1
340
+ # Optional startup file API overrides. Bearer token takes precedence.
341
+ export PRAXIS_FILES_BASE_URL=https://api.example.com
342
+ export PRAXIS_FILES_BEARER_TOKEN=...
343
+ # Or use PRAXIS_FILES_API_KEY; PRAXIS_API_KEY is the final fallback.
344
+ export PRAXIS_CONTEXT_WINDOW_TOKENS=200000
345
+ export PRAXIS_CONTEXT_RESERVE_TOKENS=8192
346
+ # Anthropic only: explicitly enable provider-native WebSearch.
347
+ export PRAXIS_ANTHROPIC_WEB_SEARCH=true
348
+
349
+ node dist/cli.js run "Inspect this project"
350
+ node dist/cli.js -p --output-format json "Inspect this project"
351
+ printf '%s\n' '{"type":"user","message":{"role":"user","content":"Inspect this project"}}' | \
352
+ node dist/cli.js -p --input-format stream-json --output-format stream-json --verbose
353
+ node dist/cli.js run "/my-command arguments"
354
+ node dist/cli.js run --agent reviewer "Inspect this project"
355
+ node dist/cli.js -p --setting-sources project --tools Read,Grep "Inspect this project"
356
+ node dist/cli.js -p --system-prompt-file prompt.txt --add-dir ../shared -- "Inspect both roots"
357
+ node dist/cli.js -p --continue --fork-session --name experiment "Try another approach"
358
+ node dist/cli.js -p --from-pr=owner/repo#42 --fork-session -- "Continue PR work"
359
+ node dist/cli.js -p --model claude-sonnet-4-20250514 --effort high "Try another approach"
360
+ node dist/cli.js -p --thinking adaptive --max-thinking-tokens 8192 "Reason within a cap"
361
+ node dist/cli.js -p --max-budget-usd 0.50 --output-format json "Bound this run"
362
+ node dist/cli.js -p --output-format stream-json --verbose --prompt-suggestions "Suggest the next step"
363
+ node dist/cli.js -p --prefill "ignored by Claude 2.1.208" "Inspect this project"
364
+ node dist/cli.js -p --no-session-persistence "Inspect without saving"
365
+ node dist/cli.js -p --file file_abc:input.txt -- "Inspect the downloaded file"
366
+ node dist/cli.js sessions --json
367
+ node dist/cli.js inspect --json <session-id>
368
+ node dist/cli.js export <session-id> > session.jsonl
369
+ node dist/cli.js resume <session-id> "Continue"
370
+ node dist/cli.js -p --resume="Named session" "Continue"
371
+ node dist/cli.js resume --retry-interrupted-tools <session-id> "Continue"
372
+ node dist/cli.js -p --resume <session-id> --resume-session-at <message-id> "Try another branch"
373
+ CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING=true node dist/cli.js -p "Edit with checkpoints"
374
+ node dist/cli.js -p --resume <session-id> --rewind-files <user-message-uuid>
375
+ node dist/cli.js --init-only
376
+ node dist/cli.js -p --init "Run setup hooks, then continue"
377
+ node dist/cli.js -p --maintenance "Run maintenance hooks, then continue"
378
+ node dist/cli.js fork <session-id>
379
+ node dist/cli.js --worktree=review --tmux "Inspect in a native pane"
380
+ node dist/cli.js --worktree=review --tmux=classic "Inspect in tmux"
381
+ node dist/cli.js --bg "Inspect this project"
382
+ node dist/cli.js agents
383
+ node dist/cli.js agents --json --all --cwd "$PWD"
384
+ node dist/cli.js logs <agent-id>
385
+ node dist/cli.js attach <agent-id>
386
+ node dist/cli.js stop <agent-id>
387
+ node dist/cli.js mcp list
388
+ node dist/cli.js mcp add-json fixture '{"type":"stdio","command":"node","args":["server.mjs"]}'
389
+ MCP_CLIENT_SECRET=secret node dist/cli.js mcp add-json oauth-fixture '{"type":"http","url":"https://example.test/mcp","oauth":{"clientId":"client"}}' --client-secret
390
+ node dist/cli.js mcp get fixture
391
+ node dist/cli.js mcp remove fixture --scope local
392
+ node dist/cli.js auto-mode defaults --label Read
393
+ node dist/cli.js --json plugin list --available
394
+ node dist/cli.js plugin init my-plugin --with skills agents
395
+ node dist/cli.js plugin marketplace add owner/repo --sparse .claude-plugin plugins
396
+ node dist/cli.js plugin disable --all
397
+ node dist/cli.js plugin eval --scaffold --allow-tools Bash ./my-plugin
398
+ node dist/cli.js plugin eval init --bare smoke-test
399
+ node dist/cli.js
400
+ ```
401
+
402
+ Claude-style `--output-format json` emits one result object. Stream input and
403
+ output require `--verbose`; `--include-partial-messages` adds model delta
404
+ records and `--replay-user-messages` echoes normalized input records. Multiple
405
+ stdin messages share one session and service lifecycle. Result JSON reports
406
+ measured provider API duration and cost when selected model has built-in or
407
+ explicit pricing. Unknown models remain `null` rather than invented estimates.
408
+ Set `PRAXIS_PRICING_JSON` to a JSON object keyed by model, with
409
+ `inputPerMillionUsd`, `outputPerMillionUsd`, and optional cache rates, to price
410
+ a private or relay model. `--max-budget-usd` requires print mode and fails closed
411
+ when no pricing is available.
412
+ Anthropic sessions enable extended thinking by default, matching the isolated
413
+ Claude Code 2.1.208 CLI contract. `--thinking enabled|adaptive|disabled`
414
+ overrides that mode, and `--max-thinking-tokens` applies a positive token
415
+ budget for enabled/adaptive thinking. Signed and redacted thinking blocks stay
416
+ hidden from text/JSON results, remain available in partial stream records, and
417
+ are preserved through tool continuations and shared Claude JSONL resume.
418
+ OpenAI-compatible adapters accept explicit `disabled`; enabled/adaptive or
419
+ token-budgeted thinking fail before a provider request because chat-completions
420
+ has no lossless mapping.
421
+ `--prompt-suggestions` is available only with print-mode stream JSON; it emits
422
+ one auxiliary `prompt_suggestion` record after each successful result without
423
+ mutating the session transcript.
424
+ Claude Code 2.1.208 accepts hidden `--prefill <text>` syntax but does not put
425
+ the value in provider requests, output, or persisted transcripts. Praxis
426
+ preserves that baseline no-op in text, JSON, stream JSON, resume, fork, and
427
+ non-persistent runs; repeated flags are accepted and the final parsed value is
428
+ retained only as an invocation control.
429
+ `--init` runs matching `Setup` hooks with the `init` trigger before normal
430
+ session startup and the provider turn. `--maintenance` uses the
431
+ `maintenance` trigger. `--init-only` runs `Setup(init)` and
432
+ `SessionStart(startup)` synchronously, exits without a provider request, and
433
+ does not write a session transcript. Bare mode skips both lifecycle hook
434
+ families, matching Claude's minimal mode.
435
+ `--from-pr [number-or-url]` filters native Claude `pr-link` metadata. Interactive
436
+ mode opens a filtered resume picker; headless mode resumes only a unique match
437
+ and reports zero or ambiguous matches instead of selecting silently. Forks
438
+ preserve the PR link with the new session ID, so Claude Code can resume them.
439
+ `--file <file_id:relative_path...>` downloads resources before the first model
440
+ turn into `<cwd>/<session-id>/uploads`. Paths cannot escape that directory.
441
+ `PRAXIS_FILES_BASE_URL` selects a separate Files API endpoint;
442
+ `PRAXIS_FILES_BEARER_TOKEN`, `PRAXIS_FILES_API_KEY`, then `PRAXIS_API_KEY` are
443
+ checked in that order. Anthropic providers receive their required files beta
444
+ and version headers; other providers use a standard Bearer API key.
445
+ MCP management commands write Claude-compatible local (`.claude.json` project
446
+ state), project (`.mcp.json`), or user (`.claude.json` root) scopes atomically;
447
+ `add`, `add-json`, `list`, `get`, `remove`, and `reset-project-choices` are
448
+ implemented. `add-json --client-secret` stores OAuth secrets outside shared MCP
449
+ configuration and rolls back config replacement if secret persistence fails.
450
+ OAuth login/logout and MCP server hosting are separate commands; Claude Desktop
451
+ import is intentionally excluded.
452
+
453
+ Plugin management supports local and marketplace installs, details, strict
454
+ manifest validation, typed `--config key=value` persistence (or
455
+ `--config server.key=value` for ambiguous MCPB options), JSON marketplace
456
+ availability, and native `plugin init <name>` scaffolds under
457
+ `~/.claude/skills/<name>`. Skills-directory plugins load with normal plugin
458
+ resources and can be enabled or disabled through their `<name>@skills-dir` ID.
459
+ Plugin config validates required/default/range/boolean behavior atomically;
460
+ sensitive options use shared protected credentials and never enter
461
+ `settings.json`.
462
+ Marketplace Git sources support bounded `--sparse <paths...>` checkout with
463
+ paths preserved for later updates; `plugin disable -a|--all` disables every
464
+ enabled native and skills-directory plugin.
465
+ `plugin eval` discovers strict YAML or prose cases under `evals/`, runs each case
466
+ in an isolated non-persistent session, supports with/without-plugin ablation,
467
+ bounded opt-in scaffolds, operator grants for gated tools, deterministic and
468
+ three-vote model graders, cost ceilings, scored JSON artifacts, and resumable
469
+ Claude JSONL history context. `plugin eval init` provides TTY authoring or an
470
+ immediately runnable `--bare` template.
471
+ Plugin LSP declarations may be inline objects, JSON paths, or ordered arrays;
472
+ manifest entries override same-named `.lsp.json` defaults. LSP subprocesses
473
+ receive sanitized ambient state plus explicit plugin env, `CLAUDE_PLUGIN_ROOT`,
474
+ and persistent `CLAUDE_PLUGIN_DATA`. Saved LSP options use Claude settings
475
+ precedence: local overrides project, project overrides user, and protected
476
+ secrets override legacy plaintext values. The same option plane feeds plugin
477
+ MCP servers and hooks; model-visible plugin content excludes sensitive values.
478
+
479
+ `PRAXIS_PROVIDER` defaults to `openai`. `PRAXIS_BASE_URL` defaults to the
480
+ selected provider's official `/v1` endpoint. Native Anthropic requests accept
481
+ `PRAXIS_MAX_OUTPUT_TOKENS` (default 8192) and
482
+ `PRAXIS_ANTHROPIC_VERSION` (default `2023-06-01`). Native Anthropic WebSearch
483
+ is advertised only with `PRAXIS_ANTHROPIC_WEB_SEARCH=true`, because arbitrary
484
+ models and compatible relays do not necessarily implement it. Context window
485
+ configuration is explicit because Praxis accepts arbitrary provider models; when
486
+ `PRAXIS_CONTEXT_WINDOW_TOKENS` is absent, Praxis does not invent a model limit.
487
+ Reserve defaults to 10% of the configured window, capped at 8192.
488
+ Provider credentials stay in the Praxis process. Bash, hooks, Claude version
489
+ detection, and ambient MCP stdio environments do not inherit credential-named
490
+ variables. Explicit per-server MCP `env` and HTTP headers are treated as
491
+ intentional grants to that server, with matching output redaction.
492
+
493
+ Permissions load from the shared global and current-project Claude settings.
494
+ `Read`, `Grep`, `LSP`, `Agent`, `SendMessage`, and Task tools default to `allow`;
495
+ `Write`, `Edit`, `Bash`, `WebFetch`, and `WebSearch` default to `ask`.
496
+ Interactive mode prompts before an `ask` tool call. Entering plan mode is
497
+ automatic; leaving it displays the plan and requires user approval. Question and
498
+ plan prompts honor tool cancellation. Headless commands remain non-interactive
499
+ and return a denied tool result
500
+ unless a compatible `allow` rule exists.
501
+
502
+ With a Claude Code 2.1.208 installation, run the isolated compatibility probes
503
+ separately. Claude-backed probes make real model requests; the context-runtime
504
+ probe uses a local provider fixture:
505
+
506
+ ```sh
507
+ npm run test:compat:all
508
+ ```
509
+
510
+ The aggregate command discovers every `test:*` compatibility gate except the
511
+ provider-free package and performance gates, validates each command shape, and
512
+ runs 52 isolated gates in sequence. The CLI surface gate dynamically walks all
513
+ included Claude Code 2.1.208 command routes and aliases, compares exact
514
+ route-local option and positional required/optional/variadic signatures,
515
+ verifies functional `help <command>` and alias dispatch, and keeps product-scope
516
+ exclusions explicit. Run an individual `test:*` command when iterating on one
517
+ surface.
518
+
519
+ `npm run test:performance` is a local, provider-free release gate covering CLI
520
+ process startup, 500-session discovery, and large transcript load, heap, and
521
+ append behavior. Exact fixtures and limits are documented in
522
+ [docs/PERFORMANCE.md](docs/PERFORMANCE.md).
523
+
524
+ `npm run test:package` builds the `praxis-agent` tarball, enforces its file and
525
+ size boundary, installs it into an empty project, and exercises both provider
526
+ adapters through the installed `praxis` bin plus the fail-closed Claude version
527
+ matrix. See
528
+ [docs/RELEASE.md](docs/RELEASE.md). Publishing remains an explicit separate
529
+ operation.
530
+
531
+ Architecture constraints live in [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
532
+ Runtime semantics and trust boundaries live in
533
+ [docs/RUNTIME_CONTRACT.md](docs/RUNTIME_CONTRACT.md) and
534
+ [docs/THREAT_MODEL.md](docs/THREAT_MODEL.md).
@@ -0,0 +1,66 @@
1
+ import type { ModelUsage } from '../core/runtime.js';
2
+ export interface BackgroundAgentRunResult {
3
+ text: string;
4
+ usage: ModelUsage;
5
+ toolUseCount: number;
6
+ durationMs: number;
7
+ isolationPath?: string;
8
+ isolationRetained?: boolean;
9
+ isolationWarning?: string;
10
+ }
11
+ export declare class BackgroundAgentRunError extends Error {
12
+ readonly result?: BackgroundAgentRunResult | undefined;
13
+ constructor(message: string, result?: BackgroundAgentRunResult | undefined, cause?: unknown);
14
+ }
15
+ export interface BackgroundAgentTaskSpec {
16
+ agentId: string;
17
+ name?: string;
18
+ agentType: string;
19
+ description: string;
20
+ prompt: string;
21
+ toolUseId: string;
22
+ outputFile: string;
23
+ resolvedModel: string;
24
+ run(message: string, signal: AbortSignal, continuation: boolean): Promise<BackgroundAgentRunResult>;
25
+ }
26
+ type BackgroundAgentStatus = 'running' | 'completed' | 'failed' | 'stopped';
27
+ export interface BackgroundAgentSnapshot {
28
+ agentId: string;
29
+ status: BackgroundAgentStatus;
30
+ outputFile: string;
31
+ result: BackgroundAgentRunResult | null;
32
+ error: string | null;
33
+ }
34
+ export declare class BackgroundAgentManager {
35
+ private readonly tasks;
36
+ private readonly names;
37
+ private closed;
38
+ launch(spec: BackgroundAgentTaskSpec): BackgroundAgentSnapshot;
39
+ registerCompleted(spec: BackgroundAgentTaskSpec, result: BackgroundAgentRunResult): BackgroundAgentSnapshot;
40
+ has(agentId: string): boolean;
41
+ snapshotById(agentId: string): BackgroundAgentSnapshot | null;
42
+ output(agentId: string, options: {
43
+ block: boolean;
44
+ timeout: number;
45
+ }): Promise<string>;
46
+ stop(agentId: string): string;
47
+ close(): Promise<void>;
48
+ send(agentId: string, message: string, summary: string | undefined, toolUseId: string): string;
49
+ notifications(options: {
50
+ waitForRunning: boolean;
51
+ excludeAgentId?: string;
52
+ }): Promise<{
53
+ messages: string[];
54
+ usage: ModelUsage;
55
+ }>;
56
+ private start;
57
+ private resolveOptional;
58
+ private assertNameAvailable;
59
+ private finishStopped;
60
+ private resolveRequired;
61
+ private snapshot;
62
+ private formatOutput;
63
+ private formatNotification;
64
+ }
65
+ export {};
66
+ //# sourceMappingURL=background-agent-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"background-agent-manager.d.ts","sourceRoot":"","sources":["../../src/application/background-agent-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAKpD,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,UAAU,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,qBAAa,uBAAwB,SAAQ,KAAK;IAG9C,QAAQ,CAAC,MAAM,CAAC,EAAE,wBAAwB;gBAD1C,OAAO,EAAE,MAAM,EACN,MAAM,CAAC,EAAE,wBAAwB,YAAA,EAC1C,KAAK,CAAC,EAAE,OAAO;CAKlB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,GAAG,CACD,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,wBAAwB,CAAC,CAAA;CACrC;AAED,KAAK,qBAAqB,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAA;AAqB3E,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,qBAAqB,CAAA;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,wBAAwB,GAAG,IAAI,CAAA;IACvC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAqCD,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyC;IAC/D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA4B;IAClD,OAAO,CAAC,MAAM,CAAQ;IAEtB,MAAM,CAAC,IAAI,EAAE,uBAAuB,GAAG,uBAAuB;IA8B9D,iBAAiB,CACf,IAAI,EAAE,uBAAuB,EAC7B,MAAM,EAAE,wBAAwB,GAC/B,uBAAuB;IA4B1B,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAI7B,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,uBAAuB,GAAG,IAAI;IAKvD,MAAM,CACV,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAC3C,OAAO,CAAC,MAAM,CAAC;IAqBlB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAcvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAe5B,IAAI,CACF,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,GAChB,MAAM;IA2BH,aAAa,CAAC,OAAO,EAAE;QAC3B,cAAc,EAAE,OAAO,CAAA;QACvB,cAAc,CAAC,EAAE,MAAM,CAAA;KACxB,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,UAAU,CAAA;KAAE,CAAC;IA2BtD,OAAO,CAAC,KAAK;IA6Db,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,aAAa;IAmBrB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,YAAY;IAuBpB,OAAO,CAAC,kBAAkB;CAkC3B"}