@useconvoy/cli 0.48.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 (664) hide show
  1. package/LICENSE +90 -0
  2. package/README.md +495 -0
  3. package/dist/bin/convoy.d.ts +2 -0
  4. package/dist/bin/convoy.js +129 -0
  5. package/dist/bin/convoy.js.map +1 -0
  6. package/dist/marketplace/.claude-plugin/marketplace.json +14 -0
  7. package/dist/marketplace/opensana/.claude-plugin/plugin.json +5 -0
  8. package/dist/marketplace/opensana/README.md +90 -0
  9. package/dist/marketplace/opensana/skills/tasks/SKILL.md +133 -0
  10. package/dist/marketplace/opensana/skills/tasks/references/mcp-setup.md +164 -0
  11. package/dist/src/agent/app/chunk-flush-buffer.d.ts +35 -0
  12. package/dist/src/agent/app/chunk-flush-buffer.js +133 -0
  13. package/dist/src/agent/app/chunk-flush-buffer.js.map +1 -0
  14. package/dist/src/agent/app/chunk-scrub.d.ts +9 -0
  15. package/dist/src/agent/app/chunk-scrub.js +120 -0
  16. package/dist/src/agent/app/chunk-scrub.js.map +1 -0
  17. package/dist/src/agent/app/interaction-router.d.ts +16 -0
  18. package/dist/src/agent/app/interaction-router.js +29 -0
  19. package/dist/src/agent/app/interaction-router.js.map +1 -0
  20. package/dist/src/agent/app/runner.d.ts +41 -0
  21. package/dist/src/agent/app/runner.js +353 -0
  22. package/dist/src/agent/app/runner.js.map +1 -0
  23. package/dist/src/agent/app/runtime-config.d.ts +3 -0
  24. package/dist/src/agent/app/runtime-config.js +4 -0
  25. package/dist/src/agent/app/runtime-config.js.map +1 -0
  26. package/dist/src/agent/app/thread-attachment-cache.d.ts +17 -0
  27. package/dist/src/agent/app/thread-attachment-cache.js +124 -0
  28. package/dist/src/agent/app/thread-attachment-cache.js.map +1 -0
  29. package/dist/src/agent/app/thread-processor.d.ts +40 -0
  30. package/dist/src/agent/app/thread-processor.js +792 -0
  31. package/dist/src/agent/app/thread-processor.js.map +1 -0
  32. package/dist/src/agent/app/worktree-op-processor.d.ts +27 -0
  33. package/dist/src/agent/app/worktree-op-processor.js +173 -0
  34. package/dist/src/agent/app/worktree-op-processor.js.map +1 -0
  35. package/dist/src/agent/runtimes/agent-instructions.d.ts +16 -0
  36. package/dist/src/agent/runtimes/agent-instructions.js +33 -0
  37. package/dist/src/agent/runtimes/agent-instructions.js.map +1 -0
  38. package/dist/src/agent/runtimes/claudeCode/continuation.d.ts +1 -0
  39. package/dist/src/agent/runtimes/claudeCode/continuation.js +30 -0
  40. package/dist/src/agent/runtimes/claudeCode/continuation.js.map +1 -0
  41. package/dist/src/agent/runtimes/claudeCode/detect.d.ts +12 -0
  42. package/dist/src/agent/runtimes/claudeCode/detect.js +109 -0
  43. package/dist/src/agent/runtimes/claudeCode/detect.js.map +1 -0
  44. package/dist/src/agent/runtimes/claudeCode/interactions.d.ts +13 -0
  45. package/dist/src/agent/runtimes/claudeCode/interactions.js +167 -0
  46. package/dist/src/agent/runtimes/claudeCode/interactions.js.map +1 -0
  47. package/dist/src/agent/runtimes/claudeCode/models.d.ts +3 -0
  48. package/dist/src/agent/runtimes/claudeCode/models.js +16 -0
  49. package/dist/src/agent/runtimes/claudeCode/models.js.map +1 -0
  50. package/dist/src/agent/runtimes/claudeCode/prompts.d.ts +1 -0
  51. package/dist/src/agent/runtimes/claudeCode/prompts.js +5 -0
  52. package/dist/src/agent/runtimes/claudeCode/prompts.js.map +1 -0
  53. package/dist/src/agent/runtimes/claudeCode/runner.d.ts +32 -0
  54. package/dist/src/agent/runtimes/claudeCode/runner.js +941 -0
  55. package/dist/src/agent/runtimes/claudeCode/runner.js.map +1 -0
  56. package/dist/src/agent/runtimes/claudeCode/runtime.d.ts +2 -0
  57. package/dist/src/agent/runtimes/claudeCode/runtime.js +126 -0
  58. package/dist/src/agent/runtimes/claudeCode/runtime.js.map +1 -0
  59. package/dist/src/agent/runtimes/claudeCode/streaming.d.ts +8 -0
  60. package/dist/src/agent/runtimes/claudeCode/streaming.js +88 -0
  61. package/dist/src/agent/runtimes/claudeCode/streaming.js.map +1 -0
  62. package/dist/src/agent/runtimes/codex/app-server-rpc.d.ts +26 -0
  63. package/dist/src/agent/runtimes/codex/app-server-rpc.js +109 -0
  64. package/dist/src/agent/runtimes/codex/app-server-rpc.js.map +1 -0
  65. package/dist/src/agent/runtimes/codex/app-server-runner.d.ts +59 -0
  66. package/dist/src/agent/runtimes/codex/app-server-runner.js +688 -0
  67. package/dist/src/agent/runtimes/codex/app-server-runner.js.map +1 -0
  68. package/dist/src/agent/runtimes/codex/commands.d.ts +23 -0
  69. package/dist/src/agent/runtimes/codex/commands.js +25 -0
  70. package/dist/src/agent/runtimes/codex/commands.js.map +1 -0
  71. package/dist/src/agent/runtimes/codex/detect.d.ts +5 -0
  72. package/dist/src/agent/runtimes/codex/detect.js +17 -0
  73. package/dist/src/agent/runtimes/codex/detect.js.map +1 -0
  74. package/dist/src/agent/runtimes/codex/models.d.ts +2 -0
  75. package/dist/src/agent/runtimes/codex/models.js +4 -0
  76. package/dist/src/agent/runtimes/codex/models.js.map +1 -0
  77. package/dist/src/agent/runtimes/codex/runner.d.ts +46 -0
  78. package/dist/src/agent/runtimes/codex/runner.js +298 -0
  79. package/dist/src/agent/runtimes/codex/runner.js.map +1 -0
  80. package/dist/src/agent/runtimes/codex/runtime.d.ts +10 -0
  81. package/dist/src/agent/runtimes/codex/runtime.js +73 -0
  82. package/dist/src/agent/runtimes/codex/runtime.js.map +1 -0
  83. package/dist/src/agent/runtimes/contracts.d.ts +215 -0
  84. package/dist/src/agent/runtimes/contracts.js +33 -0
  85. package/dist/src/agent/runtimes/contracts.js.map +1 -0
  86. package/dist/src/agent/runtimes/cursor/commands.d.ts +7 -0
  87. package/dist/src/agent/runtimes/cursor/commands.js +39 -0
  88. package/dist/src/agent/runtimes/cursor/commands.js.map +1 -0
  89. package/dist/src/agent/runtimes/cursor/detect.d.ts +17 -0
  90. package/dist/src/agent/runtimes/cursor/detect.js +54 -0
  91. package/dist/src/agent/runtimes/cursor/detect.js.map +1 -0
  92. package/dist/src/agent/runtimes/cursor/models.d.ts +9 -0
  93. package/dist/src/agent/runtimes/cursor/models.js +97 -0
  94. package/dist/src/agent/runtimes/cursor/models.js.map +1 -0
  95. package/dist/src/agent/runtimes/cursor/runner.d.ts +36 -0
  96. package/dist/src/agent/runtimes/cursor/runner.js +293 -0
  97. package/dist/src/agent/runtimes/cursor/runner.js.map +1 -0
  98. package/dist/src/agent/runtimes/cursor/runtime.d.ts +2 -0
  99. package/dist/src/agent/runtimes/cursor/runtime.js +48 -0
  100. package/dist/src/agent/runtimes/cursor/runtime.js.map +1 -0
  101. package/dist/src/agent/runtimes/cursor/streaming.d.ts +8 -0
  102. package/dist/src/agent/runtimes/cursor/streaming.js +78 -0
  103. package/dist/src/agent/runtimes/cursor/streaming.js.map +1 -0
  104. package/dist/src/agent/runtimes/debug.d.ts +8 -0
  105. package/dist/src/agent/runtimes/debug.js +19 -0
  106. package/dist/src/agent/runtimes/debug.js.map +1 -0
  107. package/dist/src/agent/runtimes/message-format.d.ts +6 -0
  108. package/dist/src/agent/runtimes/message-format.js +31 -0
  109. package/dist/src/agent/runtimes/message-format.js.map +1 -0
  110. package/dist/src/agent/runtimes/opencode/client.d.ts +82 -0
  111. package/dist/src/agent/runtimes/opencode/client.js +109 -0
  112. package/dist/src/agent/runtimes/opencode/client.js.map +1 -0
  113. package/dist/src/agent/runtimes/opencode/detect.d.ts +18 -0
  114. package/dist/src/agent/runtimes/opencode/detect.js +100 -0
  115. package/dist/src/agent/runtimes/opencode/detect.js.map +1 -0
  116. package/dist/src/agent/runtimes/opencode/json.d.ts +4 -0
  117. package/dist/src/agent/runtimes/opencode/json.js +17 -0
  118. package/dist/src/agent/runtimes/opencode/json.js.map +1 -0
  119. package/dist/src/agent/runtimes/opencode/runner.d.ts +50 -0
  120. package/dist/src/agent/runtimes/opencode/runner.js +598 -0
  121. package/dist/src/agent/runtimes/opencode/runner.js.map +1 -0
  122. package/dist/src/agent/runtimes/opencode/runtime.d.ts +9 -0
  123. package/dist/src/agent/runtimes/opencode/runtime.js +82 -0
  124. package/dist/src/agent/runtimes/opencode/runtime.js.map +1 -0
  125. package/dist/src/agent/runtimes/opencode/server.d.ts +36 -0
  126. package/dist/src/agent/runtimes/opencode/server.js +210 -0
  127. package/dist/src/agent/runtimes/opencode/server.js.map +1 -0
  128. package/dist/src/agent/runtimes/opencode/streaming.d.ts +7 -0
  129. package/dist/src/agent/runtimes/opencode/streaming.js +47 -0
  130. package/dist/src/agent/runtimes/opencode/streaming.js.map +1 -0
  131. package/dist/src/agent/runtimes/registry.d.ts +10 -0
  132. package/dist/src/agent/runtimes/registry.js +48 -0
  133. package/dist/src/agent/runtimes/registry.js.map +1 -0
  134. package/dist/src/agent/sdk/adapters/adapter-interface.d.ts +2 -0
  135. package/dist/src/agent/sdk/adapters/adapter-interface.js +4 -0
  136. package/dist/src/agent/sdk/adapters/adapter-interface.js.map +1 -0
  137. package/dist/src/agent/sdk/adapters/claude/claude-adapter.d.ts +9 -0
  138. package/dist/src/agent/sdk/adapters/claude/claude-adapter.js +95 -0
  139. package/dist/src/agent/sdk/adapters/claude/claude-adapter.js.map +1 -0
  140. package/dist/src/agent/sdk/adapters/codex/codex-adapter.d.ts +10 -0
  141. package/dist/src/agent/sdk/adapters/codex/codex-adapter.js +87 -0
  142. package/dist/src/agent/sdk/adapters/codex/codex-adapter.js.map +1 -0
  143. package/dist/src/agent/sdk/adapters/executable-resolution.d.ts +2 -0
  144. package/dist/src/agent/sdk/adapters/executable-resolution.js +50 -0
  145. package/dist/src/agent/sdk/adapters/executable-resolution.js.map +1 -0
  146. package/dist/src/agent/sdk/adapters/generic/generic-subprocess-adapter.d.ts +11 -0
  147. package/dist/src/agent/sdk/adapters/generic/generic-subprocess-adapter.js +61 -0
  148. package/dist/src/agent/sdk/adapters/generic/generic-subprocess-adapter.js.map +1 -0
  149. package/dist/src/agent/sdk/adapters/provider-registry.d.ts +8 -0
  150. package/dist/src/agent/sdk/adapters/provider-registry.js +32 -0
  151. package/dist/src/agent/sdk/adapters/provider-registry.js.map +1 -0
  152. package/dist/src/agent/sdk/constants.d.ts +5 -0
  153. package/dist/src/agent/sdk/constants.js +29 -0
  154. package/dist/src/agent/sdk/constants.js.map +1 -0
  155. package/dist/src/agent/sdk/index.d.ts +2 -0
  156. package/dist/src/agent/sdk/index.js +2 -0
  157. package/dist/src/agent/sdk/index.js.map +1 -0
  158. package/dist/src/agent/sdk/run-handle.d.ts +22 -0
  159. package/dist/src/agent/sdk/run-handle.js +90 -0
  160. package/dist/src/agent/sdk/run-handle.js.map +1 -0
  161. package/dist/src/agent/sdk/runtime/isolation-env.d.ts +9 -0
  162. package/dist/src/agent/sdk/runtime/isolation-env.js +39 -0
  163. package/dist/src/agent/sdk/runtime/isolation-env.js.map +1 -0
  164. package/dist/src/agent/sdk/runtime/line-parser.d.ts +11 -0
  165. package/dist/src/agent/sdk/runtime/line-parser.js +59 -0
  166. package/dist/src/agent/sdk/runtime/line-parser.js.map +1 -0
  167. package/dist/src/agent/sdk/runtime/output-pump.d.ts +20 -0
  168. package/dist/src/agent/sdk/runtime/output-pump.js +88 -0
  169. package/dist/src/agent/sdk/runtime/output-pump.js.map +1 -0
  170. package/dist/src/agent/sdk/runtime/process-group.d.ts +9 -0
  171. package/dist/src/agent/sdk/runtime/process-group.js +69 -0
  172. package/dist/src/agent/sdk/runtime/process-group.js.map +1 -0
  173. package/dist/src/agent/sdk/runtime/provider-supervisor-entrypoint.d.ts +1 -0
  174. package/dist/src/agent/sdk/runtime/provider-supervisor-entrypoint.js +3 -0
  175. package/dist/src/agent/sdk/runtime/provider-supervisor-entrypoint.js.map +1 -0
  176. package/dist/src/agent/sdk/runtime/provider-supervisor.d.ts +1 -0
  177. package/dist/src/agent/sdk/runtime/provider-supervisor.js +190 -0
  178. package/dist/src/agent/sdk/runtime/provider-supervisor.js.map +1 -0
  179. package/dist/src/agent/sdk/runtime/spawn-process.d.ts +7 -0
  180. package/dist/src/agent/sdk/runtime/spawn-process.js +16 -0
  181. package/dist/src/agent/sdk/runtime/spawn-process.js.map +1 -0
  182. package/dist/src/agent/sdk/runtime/spawn-supervised-process.d.ts +17 -0
  183. package/dist/src/agent/sdk/runtime/spawn-supervised-process.js +203 -0
  184. package/dist/src/agent/sdk/runtime/spawn-supervised-process.js.map +1 -0
  185. package/dist/src/agent/sdk/runtime/supervisor-protocol.d.ts +29 -0
  186. package/dist/src/agent/sdk/runtime/supervisor-protocol.js +90 -0
  187. package/dist/src/agent/sdk/runtime/supervisor-protocol.js.map +1 -0
  188. package/dist/src/agent/sdk/runtime/timeouts.d.ts +24 -0
  189. package/dist/src/agent/sdk/runtime/timeouts.js +65 -0
  190. package/dist/src/agent/sdk/runtime/timeouts.js.map +1 -0
  191. package/dist/src/agent/sdk/session-manager.d.ts +38 -0
  192. package/dist/src/agent/sdk/session-manager.js +557 -0
  193. package/dist/src/agent/sdk/session-manager.js.map +1 -0
  194. package/dist/src/agent/sdk/transport/json-stream-decoder.d.ts +6 -0
  195. package/dist/src/agent/sdk/transport/json-stream-decoder.js +29 -0
  196. package/dist/src/agent/sdk/transport/json-stream-decoder.js.map +1 -0
  197. package/dist/src/agent/sdk/transport/line-text-decoder.d.ts +6 -0
  198. package/dist/src/agent/sdk/transport/line-text-decoder.js +9 -0
  199. package/dist/src/agent/sdk/transport/line-text-decoder.js.map +1 -0
  200. package/dist/src/agent/sdk/transport/pty-contract.d.ts +12 -0
  201. package/dist/src/agent/sdk/transport/pty-contract.js +2 -0
  202. package/dist/src/agent/sdk/transport/pty-contract.js.map +1 -0
  203. package/dist/src/agent/sdk/types.d.ts +194 -0
  204. package/dist/src/agent/sdk/types.js +2 -0
  205. package/dist/src/agent/sdk/types.js.map +1 -0
  206. package/dist/src/agent/sdk/versioning/provider-version.d.ts +9 -0
  207. package/dist/src/agent/sdk/versioning/provider-version.js +41 -0
  208. package/dist/src/agent/sdk/versioning/provider-version.js.map +1 -0
  209. package/dist/src/cli.d.ts +7 -0
  210. package/dist/src/cli.js +56 -0
  211. package/dist/src/cli.js.map +1 -0
  212. package/dist/src/commands/config/command.d.ts +2 -0
  213. package/dist/src/commands/config/command.js +150 -0
  214. package/dist/src/commands/config/command.js.map +1 -0
  215. package/dist/src/commands/connect/command.d.ts +4 -0
  216. package/dist/src/commands/connect/command.js +19 -0
  217. package/dist/src/commands/connect/command.js.map +1 -0
  218. package/dist/src/commands/connect/workflow.d.ts +92 -0
  219. package/dist/src/commands/connect/workflow.js +381 -0
  220. package/dist/src/commands/connect/workflow.js.map +1 -0
  221. package/dist/src/commands/devcontainer/command.d.ts +2 -0
  222. package/dist/src/commands/devcontainer/command.js +49 -0
  223. package/dist/src/commands/devcontainer/command.js.map +1 -0
  224. package/dist/src/commands/devcontainer/install.d.ts +46 -0
  225. package/dist/src/commands/devcontainer/install.js +107 -0
  226. package/dist/src/commands/devcontainer/install.js.map +1 -0
  227. package/dist/src/commands/init/config/claude-mcp.d.ts +27 -0
  228. package/dist/src/commands/init/config/claude-mcp.js +56 -0
  229. package/dist/src/commands/init/config/claude-mcp.js.map +1 -0
  230. package/dist/src/commands/init/config/codex-mcp.d.ts +12 -0
  231. package/dist/src/commands/init/config/codex-mcp.js +83 -0
  232. package/dist/src/commands/init/config/codex-mcp.js.map +1 -0
  233. package/dist/src/commands/init/config/opencode-mcp.d.ts +16 -0
  234. package/dist/src/commands/init/config/opencode-mcp.js +55 -0
  235. package/dist/src/commands/init/config/opencode-mcp.js.map +1 -0
  236. package/dist/src/commands/init/errors.d.ts +3 -0
  237. package/dist/src/commands/init/errors.js +7 -0
  238. package/dist/src/commands/init/errors.js.map +1 -0
  239. package/dist/src/commands/init/index.d.ts +9 -0
  240. package/dist/src/commands/init/index.js +10 -0
  241. package/dist/src/commands/init/index.js.map +1 -0
  242. package/dist/src/commands/init/io/file-copy.d.ts +18 -0
  243. package/dist/src/commands/init/io/file-copy.js +129 -0
  244. package/dist/src/commands/init/io/file-copy.js.map +1 -0
  245. package/dist/src/commands/init/marketplace.d.ts +8 -0
  246. package/dist/src/commands/init/marketplace.js +25 -0
  247. package/dist/src/commands/init/marketplace.js.map +1 -0
  248. package/dist/src/commands/init/mcp-service.d.ts +2 -0
  249. package/dist/src/commands/init/mcp-service.js +66 -0
  250. package/dist/src/commands/init/mcp-service.js.map +1 -0
  251. package/dist/src/commands/init/parsers.d.ts +4 -0
  252. package/dist/src/commands/init/parsers.js +40 -0
  253. package/dist/src/commands/init/parsers.js.map +1 -0
  254. package/dist/src/commands/init/prompts.d.ts +4 -0
  255. package/dist/src/commands/init/prompts.js +72 -0
  256. package/dist/src/commands/init/prompts.js.map +1 -0
  257. package/dist/src/commands/init/skill-service.d.ts +2 -0
  258. package/dist/src/commands/init/skill-service.js +36 -0
  259. package/dist/src/commands/init/skill-service.js.map +1 -0
  260. package/dist/src/commands/init/summary.d.ts +2 -0
  261. package/dist/src/commands/init/summary.js +22 -0
  262. package/dist/src/commands/init/summary.js.map +1 -0
  263. package/dist/src/commands/init/targets/claude.d.ts +4 -0
  264. package/dist/src/commands/init/targets/claude.js +178 -0
  265. package/dist/src/commands/init/targets/claude.js.map +1 -0
  266. package/dist/src/commands/init/targets/codex.d.ts +4 -0
  267. package/dist/src/commands/init/targets/codex.js +75 -0
  268. package/dist/src/commands/init/targets/codex.js.map +1 -0
  269. package/dist/src/commands/init/targets/driver.d.ts +28 -0
  270. package/dist/src/commands/init/targets/driver.js +2 -0
  271. package/dist/src/commands/init/targets/driver.js.map +1 -0
  272. package/dist/src/commands/init/targets/opencode.d.ts +4 -0
  273. package/dist/src/commands/init/targets/opencode.js +77 -0
  274. package/dist/src/commands/init/targets/opencode.js.map +1 -0
  275. package/dist/src/commands/init/targets/registry.d.ts +4 -0
  276. package/dist/src/commands/init/targets/registry.js +15 -0
  277. package/dist/src/commands/init/targets/registry.js.map +1 -0
  278. package/dist/src/commands/init/types.d.ts +30 -0
  279. package/dist/src/commands/init/types.js +7 -0
  280. package/dist/src/commands/init/types.js.map +1 -0
  281. package/dist/src/commands/init.d.ts +3 -0
  282. package/dist/src/commands/init.js +143 -0
  283. package/dist/src/commands/init.js.map +1 -0
  284. package/dist/src/commands/keys/command.d.ts +2 -0
  285. package/dist/src/commands/keys/command.js +154 -0
  286. package/dist/src/commands/keys/command.js.map +1 -0
  287. package/dist/src/commands/labels/create.d.ts +2 -0
  288. package/dist/src/commands/labels/create.js +31 -0
  289. package/dist/src/commands/labels/create.js.map +1 -0
  290. package/dist/src/commands/labels/delete.d.ts +2 -0
  291. package/dist/src/commands/labels/delete.js +51 -0
  292. package/dist/src/commands/labels/delete.js.map +1 -0
  293. package/dist/src/commands/labels/formatters.d.ts +4 -0
  294. package/dist/src/commands/labels/formatters.js +6 -0
  295. package/dist/src/commands/labels/formatters.js.map +1 -0
  296. package/dist/src/commands/labels/index.d.ts +2 -0
  297. package/dist/src/commands/labels/index.js +13 -0
  298. package/dist/src/commands/labels/index.js.map +1 -0
  299. package/dist/src/commands/labels/list.d.ts +2 -0
  300. package/dist/src/commands/labels/list.js +29 -0
  301. package/dist/src/commands/labels/list.js.map +1 -0
  302. package/dist/src/commands/labels/resolve.d.ts +9 -0
  303. package/dist/src/commands/labels/resolve.js +23 -0
  304. package/dist/src/commands/labels/resolve.js.map +1 -0
  305. package/dist/src/commands/labels/update.d.ts +2 -0
  306. package/dist/src/commands/labels/update.js +37 -0
  307. package/dist/src/commands/labels/update.js.map +1 -0
  308. package/dist/src/commands/lists/constants.d.ts +7 -0
  309. package/dist/src/commands/lists/constants.js +14 -0
  310. package/dist/src/commands/lists/constants.js.map +1 -0
  311. package/dist/src/commands/lists/create.d.ts +2 -0
  312. package/dist/src/commands/lists/create.js +45 -0
  313. package/dist/src/commands/lists/create.js.map +1 -0
  314. package/dist/src/commands/lists/index.d.ts +2 -0
  315. package/dist/src/commands/lists/index.js +10 -0
  316. package/dist/src/commands/lists/index.js.map +1 -0
  317. package/dist/src/commands/lists/list.d.ts +2 -0
  318. package/dist/src/commands/lists/list.js +66 -0
  319. package/dist/src/commands/lists/list.js.map +1 -0
  320. package/dist/src/commands/lists/resolve.d.ts +11 -0
  321. package/dist/src/commands/lists/resolve.js +24 -0
  322. package/dist/src/commands/lists/resolve.js.map +1 -0
  323. package/dist/src/commands/lists/update.d.ts +2 -0
  324. package/dist/src/commands/lists/update.js +61 -0
  325. package/dist/src/commands/lists/update.js.map +1 -0
  326. package/dist/src/commands/login/command.d.ts +8 -0
  327. package/dist/src/commands/login/command.js +20 -0
  328. package/dist/src/commands/login/command.js.map +1 -0
  329. package/dist/src/commands/orgs/index.d.ts +2 -0
  330. package/dist/src/commands/orgs/index.js +6 -0
  331. package/dist/src/commands/orgs/index.js.map +1 -0
  332. package/dist/src/commands/orgs/list.d.ts +2 -0
  333. package/dist/src/commands/orgs/list.js +29 -0
  334. package/dist/src/commands/orgs/list.js.map +1 -0
  335. package/dist/src/commands/paths/command.d.ts +2 -0
  336. package/dist/src/commands/paths/command.js +90 -0
  337. package/dist/src/commands/paths/command.js.map +1 -0
  338. package/dist/src/commands/profiles/index.d.ts +2 -0
  339. package/dist/src/commands/profiles/index.js +6 -0
  340. package/dist/src/commands/profiles/index.js.map +1 -0
  341. package/dist/src/commands/profiles/list.d.ts +2 -0
  342. package/dist/src/commands/profiles/list.js +50 -0
  343. package/dist/src/commands/profiles/list.js.map +1 -0
  344. package/dist/src/commands/project-agents/create.d.ts +2 -0
  345. package/dist/src/commands/project-agents/create.js +53 -0
  346. package/dist/src/commands/project-agents/create.js.map +1 -0
  347. package/dist/src/commands/project-agents/index.d.ts +2 -0
  348. package/dist/src/commands/project-agents/index.js +10 -0
  349. package/dist/src/commands/project-agents/index.js.map +1 -0
  350. package/dist/src/commands/project-agents/list.d.ts +2 -0
  351. package/dist/src/commands/project-agents/list.js +30 -0
  352. package/dist/src/commands/project-agents/list.js.map +1 -0
  353. package/dist/src/commands/project-agents/parsers.d.ts +16 -0
  354. package/dist/src/commands/project-agents/parsers.js +80 -0
  355. package/dist/src/commands/project-agents/parsers.js.map +1 -0
  356. package/dist/src/commands/project-agents/update.d.ts +2 -0
  357. package/dist/src/commands/project-agents/update.js +74 -0
  358. package/dist/src/commands/project-agents/update.js.map +1 -0
  359. package/dist/src/commands/projects/index.d.ts +2 -0
  360. package/dist/src/commands/projects/index.js +6 -0
  361. package/dist/src/commands/projects/index.js.map +1 -0
  362. package/dist/src/commands/projects/list.d.ts +2 -0
  363. package/dist/src/commands/projects/list.js +41 -0
  364. package/dist/src/commands/projects/list.js.map +1 -0
  365. package/dist/src/commands/prompts/create.d.ts +2 -0
  366. package/dist/src/commands/prompts/create.js +48 -0
  367. package/dist/src/commands/prompts/create.js.map +1 -0
  368. package/dist/src/commands/prompts/formatters.d.ts +4 -0
  369. package/dist/src/commands/prompts/formatters.js +7 -0
  370. package/dist/src/commands/prompts/formatters.js.map +1 -0
  371. package/dist/src/commands/prompts/index.d.ts +2 -0
  372. package/dist/src/commands/prompts/index.js +11 -0
  373. package/dist/src/commands/prompts/index.js.map +1 -0
  374. package/dist/src/commands/prompts/list.d.ts +2 -0
  375. package/dist/src/commands/prompts/list.js +34 -0
  376. package/dist/src/commands/prompts/list.js.map +1 -0
  377. package/dist/src/commands/prompts/parsers.d.ts +9 -0
  378. package/dist/src/commands/prompts/parsers.js +12 -0
  379. package/dist/src/commands/prompts/parsers.js.map +1 -0
  380. package/dist/src/commands/prompts/resolve.d.ts +17 -0
  381. package/dist/src/commands/prompts/resolve.js +43 -0
  382. package/dist/src/commands/prompts/resolve.js.map +1 -0
  383. package/dist/src/commands/prompts/update.d.ts +2 -0
  384. package/dist/src/commands/prompts/update.js +58 -0
  385. package/dist/src/commands/prompts/update.js.map +1 -0
  386. package/dist/src/commands/setup/command.d.ts +2 -0
  387. package/dist/src/commands/setup/command.js +15 -0
  388. package/dist/src/commands/setup/command.js.map +1 -0
  389. package/dist/src/commands/setup/prompts.d.ts +66 -0
  390. package/dist/src/commands/setup/prompts.js +199 -0
  391. package/dist/src/commands/setup/prompts.js.map +1 -0
  392. package/dist/src/commands/setup/workflow.d.ts +17 -0
  393. package/dist/src/commands/setup/workflow.js +141 -0
  394. package/dist/src/commands/setup/workflow.js.map +1 -0
  395. package/dist/src/commands/status/command.d.ts +2 -0
  396. package/dist/src/commands/status/command.js +83 -0
  397. package/dist/src/commands/status/command.js.map +1 -0
  398. package/dist/src/commands/task-types/index.d.ts +2 -0
  399. package/dist/src/commands/task-types/index.js +6 -0
  400. package/dist/src/commands/task-types/index.js.map +1 -0
  401. package/dist/src/commands/task-types/list.d.ts +2 -0
  402. package/dist/src/commands/task-types/list.js +32 -0
  403. package/dist/src/commands/task-types/list.js.map +1 -0
  404. package/dist/src/commands/tasks/artifacts/comments/add.d.ts +2 -0
  405. package/dist/src/commands/tasks/artifacts/comments/add.js +32 -0
  406. package/dist/src/commands/tasks/artifacts/comments/add.js.map +1 -0
  407. package/dist/src/commands/tasks/artifacts/comments/formatters.d.ts +7 -0
  408. package/dist/src/commands/tasks/artifacts/comments/formatters.js +32 -0
  409. package/dist/src/commands/tasks/artifacts/comments/formatters.js.map +1 -0
  410. package/dist/src/commands/tasks/artifacts/comments/index.d.ts +2 -0
  411. package/dist/src/commands/tasks/artifacts/comments/index.js +13 -0
  412. package/dist/src/commands/tasks/artifacts/comments/index.js.map +1 -0
  413. package/dist/src/commands/tasks/artifacts/comments/list.d.ts +2 -0
  414. package/dist/src/commands/tasks/artifacts/comments/list.js +24 -0
  415. package/dist/src/commands/tasks/artifacts/comments/list.js.map +1 -0
  416. package/dist/src/commands/tasks/artifacts/comments/parsers.d.ts +6 -0
  417. package/dist/src/commands/tasks/artifacts/comments/parsers.js +8 -0
  418. package/dist/src/commands/tasks/artifacts/comments/parsers.js.map +1 -0
  419. package/dist/src/commands/tasks/artifacts/comments/reply.d.ts +2 -0
  420. package/dist/src/commands/tasks/artifacts/comments/reply.js +23 -0
  421. package/dist/src/commands/tasks/artifacts/comments/reply.js.map +1 -0
  422. package/dist/src/commands/tasks/artifacts/comments/resolve.d.ts +3 -0
  423. package/dist/src/commands/tasks/artifacts/comments/resolve.js +26 -0
  424. package/dist/src/commands/tasks/artifacts/comments/resolve.js.map +1 -0
  425. package/dist/src/commands/tasks/artifacts/create.d.ts +2 -0
  426. package/dist/src/commands/tasks/artifacts/create.js +63 -0
  427. package/dist/src/commands/tasks/artifacts/create.js.map +1 -0
  428. package/dist/src/commands/tasks/artifacts/delete.d.ts +2 -0
  429. package/dist/src/commands/tasks/artifacts/delete.js +27 -0
  430. package/dist/src/commands/tasks/artifacts/delete.js.map +1 -0
  431. package/dist/src/commands/tasks/artifacts/get.d.ts +2 -0
  432. package/dist/src/commands/tasks/artifacts/get.js +54 -0
  433. package/dist/src/commands/tasks/artifacts/get.js.map +1 -0
  434. package/dist/src/commands/tasks/artifacts/index.d.ts +2 -0
  435. package/dist/src/commands/tasks/artifacts/index.js +18 -0
  436. package/dist/src/commands/tasks/artifacts/index.js.map +1 -0
  437. package/dist/src/commands/tasks/artifacts/list.d.ts +2 -0
  438. package/dist/src/commands/tasks/artifacts/list.js +31 -0
  439. package/dist/src/commands/tasks/artifacts/list.js.map +1 -0
  440. package/dist/src/commands/tasks/artifacts/parsers.d.ts +13 -0
  441. package/dist/src/commands/tasks/artifacts/parsers.js +24 -0
  442. package/dist/src/commands/tasks/artifacts/parsers.js.map +1 -0
  443. package/dist/src/commands/tasks/artifacts/replace.d.ts +2 -0
  444. package/dist/src/commands/tasks/artifacts/replace.js +62 -0
  445. package/dist/src/commands/tasks/artifacts/replace.js.map +1 -0
  446. package/dist/src/commands/tasks/artifacts/update.d.ts +2 -0
  447. package/dist/src/commands/tasks/artifacts/update.js +55 -0
  448. package/dist/src/commands/tasks/artifacts/update.js.map +1 -0
  449. package/dist/src/commands/tasks/attach.d.ts +2 -0
  450. package/dist/src/commands/tasks/attach.js +70 -0
  451. package/dist/src/commands/tasks/attach.js.map +1 -0
  452. package/dist/src/commands/tasks/attachments/delete.d.ts +2 -0
  453. package/dist/src/commands/tasks/attachments/delete.js +61 -0
  454. package/dist/src/commands/tasks/attachments/delete.js.map +1 -0
  455. package/dist/src/commands/tasks/attachments/download.d.ts +2 -0
  456. package/dist/src/commands/tasks/attachments/download.js +42 -0
  457. package/dist/src/commands/tasks/attachments/download.js.map +1 -0
  458. package/dist/src/commands/tasks/attachments/formatters.d.ts +5 -0
  459. package/dist/src/commands/tasks/attachments/formatters.js +18 -0
  460. package/dist/src/commands/tasks/attachments/formatters.js.map +1 -0
  461. package/dist/src/commands/tasks/attachments/index.d.ts +2 -0
  462. package/dist/src/commands/tasks/attachments/index.js +11 -0
  463. package/dist/src/commands/tasks/attachments/index.js.map +1 -0
  464. package/dist/src/commands/tasks/attachments/list.d.ts +2 -0
  465. package/dist/src/commands/tasks/attachments/list.js +36 -0
  466. package/dist/src/commands/tasks/attachments/list.js.map +1 -0
  467. package/dist/src/commands/tasks/attachments/resolve.d.ts +6 -0
  468. package/dist/src/commands/tasks/attachments/resolve.js +15 -0
  469. package/dist/src/commands/tasks/attachments/resolve.js.map +1 -0
  470. package/dist/src/commands/tasks/attachments/transfer.d.ts +11 -0
  471. package/dist/src/commands/tasks/attachments/transfer.js +71 -0
  472. package/dist/src/commands/tasks/attachments/transfer.js.map +1 -0
  473. package/dist/src/commands/tasks/comments/add.d.ts +2 -0
  474. package/dist/src/commands/tasks/comments/add.js +44 -0
  475. package/dist/src/commands/tasks/comments/add.js.map +1 -0
  476. package/dist/src/commands/tasks/comments/index.d.ts +2 -0
  477. package/dist/src/commands/tasks/comments/index.js +6 -0
  478. package/dist/src/commands/tasks/comments/index.js.map +1 -0
  479. package/dist/src/commands/tasks/create.d.ts +2 -0
  480. package/dist/src/commands/tasks/create.js +77 -0
  481. package/dist/src/commands/tasks/create.js.map +1 -0
  482. package/dist/src/commands/tasks/delete.d.ts +2 -0
  483. package/dist/src/commands/tasks/delete.js +31 -0
  484. package/dist/src/commands/tasks/delete.js.map +1 -0
  485. package/dist/src/commands/tasks/formatters.d.ts +25 -0
  486. package/dist/src/commands/tasks/formatters.js +40 -0
  487. package/dist/src/commands/tasks/formatters.js.map +1 -0
  488. package/dist/src/commands/tasks/get.d.ts +2 -0
  489. package/dist/src/commands/tasks/get.js +94 -0
  490. package/dist/src/commands/tasks/get.js.map +1 -0
  491. package/dist/src/commands/tasks/hydrate.d.ts +20 -0
  492. package/dist/src/commands/tasks/hydrate.js +47 -0
  493. package/dist/src/commands/tasks/hydrate.js.map +1 -0
  494. package/dist/src/commands/tasks/index.d.ts +2 -0
  495. package/dist/src/commands/tasks/index.js +33 -0
  496. package/dist/src/commands/tasks/index.js.map +1 -0
  497. package/dist/src/commands/tasks/links.d.ts +4 -0
  498. package/dist/src/commands/tasks/links.js +121 -0
  499. package/dist/src/commands/tasks/links.js.map +1 -0
  500. package/dist/src/commands/tasks/list.d.ts +2 -0
  501. package/dist/src/commands/tasks/list.js +47 -0
  502. package/dist/src/commands/tasks/list.js.map +1 -0
  503. package/dist/src/commands/tasks/move-to-list.d.ts +2 -0
  504. package/dist/src/commands/tasks/move-to-list.js +41 -0
  505. package/dist/src/commands/tasks/move-to-list.js.map +1 -0
  506. package/dist/src/commands/tasks/move.d.ts +2 -0
  507. package/dist/src/commands/tasks/move.js +61 -0
  508. package/dist/src/commands/tasks/move.js.map +1 -0
  509. package/dist/src/commands/tasks/parsers.d.ts +22 -0
  510. package/dist/src/commands/tasks/parsers.js +118 -0
  511. package/dist/src/commands/tasks/parsers.js.map +1 -0
  512. package/dist/src/commands/tasks/refs.d.ts +2 -0
  513. package/dist/src/commands/tasks/refs.js +89 -0
  514. package/dist/src/commands/tasks/refs.js.map +1 -0
  515. package/dist/src/commands/tasks/resolve.d.ts +20 -0
  516. package/dist/src/commands/tasks/resolve.js +57 -0
  517. package/dist/src/commands/tasks/resolve.js.map +1 -0
  518. package/dist/src/commands/tasks/search.d.ts +2 -0
  519. package/dist/src/commands/tasks/search.js +110 -0
  520. package/dist/src/commands/tasks/search.js.map +1 -0
  521. package/dist/src/commands/tasks/update.d.ts +2 -0
  522. package/dist/src/commands/tasks/update.js +101 -0
  523. package/dist/src/commands/tasks/update.js.map +1 -0
  524. package/dist/src/commands/test-helpers.d.ts +2 -0
  525. package/dist/src/commands/test-helpers.js +6 -0
  526. package/dist/src/commands/test-helpers.js.map +1 -0
  527. package/dist/src/commands/threads/create.d.ts +2 -0
  528. package/dist/src/commands/threads/create.js +99 -0
  529. package/dist/src/commands/threads/create.js.map +1 -0
  530. package/dist/src/commands/threads/formatters.d.ts +10 -0
  531. package/dist/src/commands/threads/formatters.js +17 -0
  532. package/dist/src/commands/threads/formatters.js.map +1 -0
  533. package/dist/src/commands/threads/get.d.ts +2 -0
  534. package/dist/src/commands/threads/get.js +53 -0
  535. package/dist/src/commands/threads/get.js.map +1 -0
  536. package/dist/src/commands/threads/index.d.ts +2 -0
  537. package/dist/src/commands/threads/index.js +14 -0
  538. package/dist/src/commands/threads/index.js.map +1 -0
  539. package/dist/src/commands/threads/list.d.ts +2 -0
  540. package/dist/src/commands/threads/list.js +69 -0
  541. package/dist/src/commands/threads/list.js.map +1 -0
  542. package/dist/src/commands/threads/messages.d.ts +2 -0
  543. package/dist/src/commands/threads/messages.js +59 -0
  544. package/dist/src/commands/threads/messages.js.map +1 -0
  545. package/dist/src/commands/threads/parsers.d.ts +5 -0
  546. package/dist/src/commands/threads/parsers.js +19 -0
  547. package/dist/src/commands/threads/parsers.js.map +1 -0
  548. package/dist/src/commands/threads/send.d.ts +2 -0
  549. package/dist/src/commands/threads/send.js +49 -0
  550. package/dist/src/commands/threads/send.js.map +1 -0
  551. package/dist/src/commands/threads/spawn-target.d.ts +29 -0
  552. package/dist/src/commands/threads/spawn-target.js +62 -0
  553. package/dist/src/commands/threads/spawn-target.js.map +1 -0
  554. package/dist/src/convex/_generated/ai/ai-files.state.json +6 -0
  555. package/dist/src/convex/_generated/ai/guidelines.md +371 -0
  556. package/dist/src/convex/_generated/api.d.ts +598 -0
  557. package/dist/src/convex/_generated/api.js +23 -0
  558. package/dist/src/convex/_generated/dataModel.d.ts +60 -0
  559. package/dist/src/convex/_generated/server.d.ts +143 -0
  560. package/dist/src/convex/_generated/server.js +93 -0
  561. package/dist/src/lib/argv.d.ts +1 -0
  562. package/dist/src/lib/argv.js +7 -0
  563. package/dist/src/lib/argv.js.map +1 -0
  564. package/dist/src/lib/browser-login.d.ts +43 -0
  565. package/dist/src/lib/browser-login.js +216 -0
  566. package/dist/src/lib/browser-login.js.map +1 -0
  567. package/dist/src/lib/config/convex-client.d.ts +41 -0
  568. package/dist/src/lib/config/convex-client.js +53 -0
  569. package/dist/src/lib/config/convex-client.js.map +1 -0
  570. package/dist/src/lib/config/index.d.ts +7 -0
  571. package/dist/src/lib/config/index.js +13 -0
  572. package/dist/src/lib/config/index.js.map +1 -0
  573. package/dist/src/lib/config/profile.d.ts +40 -0
  574. package/dist/src/lib/config/profile.js +155 -0
  575. package/dist/src/lib/config/profile.js.map +1 -0
  576. package/dist/src/lib/config/provider-keys.d.ts +47 -0
  577. package/dist/src/lib/config/provider-keys.js +97 -0
  578. package/dist/src/lib/config/provider-keys.js.map +1 -0
  579. package/dist/src/lib/config/toml.d.ts +78 -0
  580. package/dist/src/lib/config/toml.js +228 -0
  581. package/dist/src/lib/config/toml.js.map +1 -0
  582. package/dist/src/lib/config/types.d.ts +98 -0
  583. package/dist/src/lib/config/types.js +65 -0
  584. package/dist/src/lib/config/types.js.map +1 -0
  585. package/dist/src/lib/config/validate.d.ts +30 -0
  586. package/dist/src/lib/config/validate.js +66 -0
  587. package/dist/src/lib/config/validate.js.map +1 -0
  588. package/dist/src/lib/connect-events.d.ts +42 -0
  589. package/dist/src/lib/connect-events.js +65 -0
  590. package/dist/src/lib/connect-events.js.map +1 -0
  591. package/dist/src/lib/constants.d.ts +20 -0
  592. package/dist/src/lib/constants.js +27 -0
  593. package/dist/src/lib/constants.js.map +1 -0
  594. package/dist/src/lib/content-type.d.ts +1 -0
  595. package/dist/src/lib/content-type.js +27 -0
  596. package/dist/src/lib/content-type.js.map +1 -0
  597. package/dist/src/lib/convex-error.d.ts +12 -0
  598. package/dist/src/lib/convex-error.js +33 -0
  599. package/dist/src/lib/convex-error.js.map +1 -0
  600. package/dist/src/lib/git/checkpoint.d.ts +74 -0
  601. package/dist/src/lib/git/checkpoint.js +210 -0
  602. package/dist/src/lib/git/checkpoint.js.map +1 -0
  603. package/dist/src/lib/git/exec.d.ts +23 -0
  604. package/dist/src/lib/git/exec.js +46 -0
  605. package/dist/src/lib/git/exec.js.map +1 -0
  606. package/dist/src/lib/git/file-index.d.ts +8 -0
  607. package/dist/src/lib/git/file-index.js +125 -0
  608. package/dist/src/lib/git/file-index.js.map +1 -0
  609. package/dist/src/lib/git/index.d.ts +5 -0
  610. package/dist/src/lib/git/index.js +6 -0
  611. package/dist/src/lib/git/index.js.map +1 -0
  612. package/dist/src/lib/git/repo.d.ts +32 -0
  613. package/dist/src/lib/git/repo.js +95 -0
  614. package/dist/src/lib/git/repo.js.map +1 -0
  615. package/dist/src/lib/git/worktrees.d.ts +49 -0
  616. package/dist/src/lib/git/worktrees.js +97 -0
  617. package/dist/src/lib/git/worktrees.js.map +1 -0
  618. package/dist/src/lib/global-options.d.ts +3 -0
  619. package/dist/src/lib/global-options.js +8 -0
  620. package/dist/src/lib/global-options.js.map +1 -0
  621. package/dist/src/lib/id.d.ts +3 -0
  622. package/dist/src/lib/id.js +14 -0
  623. package/dist/src/lib/id.js.map +1 -0
  624. package/dist/src/lib/one-shot-command.d.ts +7 -0
  625. package/dist/src/lib/one-shot-command.js +30 -0
  626. package/dist/src/lib/one-shot-command.js.map +1 -0
  627. package/dist/src/lib/one-shot-config.d.ts +3 -0
  628. package/dist/src/lib/one-shot-config.js +7 -0
  629. package/dist/src/lib/one-shot-config.js.map +1 -0
  630. package/dist/src/lib/output.d.ts +10 -0
  631. package/dist/src/lib/output.js +27 -0
  632. package/dist/src/lib/output.js.map +1 -0
  633. package/dist/src/lib/pagination.d.ts +16 -0
  634. package/dist/src/lib/pagination.js +45 -0
  635. package/dist/src/lib/pagination.js.map +1 -0
  636. package/dist/src/lib/parsers.d.ts +2 -0
  637. package/dist/src/lib/parsers.js +21 -0
  638. package/dist/src/lib/parsers.js.map +1 -0
  639. package/dist/src/lib/project-resolution.d.ts +41 -0
  640. package/dist/src/lib/project-resolution.js +84 -0
  641. package/dist/src/lib/project-resolution.js.map +1 -0
  642. package/dist/src/lib/pull-requests.d.ts +47 -0
  643. package/dist/src/lib/pull-requests.js +305 -0
  644. package/dist/src/lib/pull-requests.js.map +1 -0
  645. package/dist/src/lib/skill-install-guidance.d.ts +5 -0
  646. package/dist/src/lib/skill-install-guidance.js +41 -0
  647. package/dist/src/lib/skill-install-guidance.js.map +1 -0
  648. package/dist/src/lib/text-input.d.ts +18 -0
  649. package/dist/src/lib/text-input.js +36 -0
  650. package/dist/src/lib/text-input.js.map +1 -0
  651. package/dist/src/lib/thread-attachments.d.ts +21 -0
  652. package/dist/src/lib/thread-attachments.js +104 -0
  653. package/dist/src/lib/thread-attachments.js.map +1 -0
  654. package/dist/src/lib/url.d.ts +13 -0
  655. package/dist/src/lib/url.js +25 -0
  656. package/dist/src/lib/url.js.map +1 -0
  657. package/dist/src/lib/version.d.ts +2 -0
  658. package/dist/src/lib/version.js +33 -0
  659. package/dist/src/lib/version.js.map +1 -0
  660. package/dist/templates/devcontainer/Dockerfile +95 -0
  661. package/dist/templates/devcontainer/README.md +129 -0
  662. package/dist/templates/devcontainer/devcontainer.json +92 -0
  663. package/dist/templates/devcontainer/init-firewall.sh +271 -0
  664. package/package.json +79 -0
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Get the git remote "origin" URL for a directory.
3
+ * Returns null if the directory is not a git repo or has no origin remote.
4
+ */
5
+ export declare function getGitRemoteUrl(dir: string): Promise<string | null>;
6
+ /**
7
+ * The repo's default branch name (without the remote prefix): `origin/HEAD`
8
+ * when known, falling back to the currently checked-out branch. Returns null
9
+ * for detached HEAD in a repo with no `origin/HEAD` ref.
10
+ */
11
+ export declare function getDefaultBranch(dir: string): Promise<string | null>;
12
+ /**
13
+ * The currently checked-out branch (short name). Returns null for detached
14
+ * HEAD, non-Git directories, and any git failure — callers treat "no branch"
15
+ * as absent display metadata, never an error.
16
+ */
17
+ export declare function getCurrentBranch(dir: string): Promise<string | null>;
18
+ /** Whether a local branch with this exact name exists. */
19
+ export declare function branchExists(dir: string, branch: string): Promise<boolean>;
20
+ /** Whether the working tree has uncommitted changes (staged, unstaged, or untracked). */
21
+ export declare function isWorkingTreeDirty(dir: string): Promise<boolean>;
22
+ export interface BranchRef {
23
+ /** Short refname, e.g. "main" or "origin/feat/x". */
24
+ name: string;
25
+ isCurrent: boolean;
26
+ isRemote: boolean;
27
+ }
28
+ /**
29
+ * Local branches plus `origin/*` remote branches, most recently committed
30
+ * first, capped at {@link MAX_BRANCH_REFS}. `origin/HEAD` is excluded.
31
+ */
32
+ export declare function listBranchRefs(dir: string): Promise<BranchRef[]>;
@@ -0,0 +1,95 @@
1
+ import { runGit } from "./exec.js";
2
+ /**
3
+ * Get the git remote "origin" URL for a directory.
4
+ * Returns null if the directory is not a git repo or has no origin remote.
5
+ */
6
+ export async function getGitRemoteUrl(dir) {
7
+ try {
8
+ const result = await runGit(dir, ["remote", "get-url", "origin"]);
9
+ return result.stdout.trim() || null;
10
+ }
11
+ catch {
12
+ return null;
13
+ }
14
+ }
15
+ /**
16
+ * The repo's default branch name (without the remote prefix): `origin/HEAD`
17
+ * when known, falling back to the currently checked-out branch. Returns null
18
+ * for detached HEAD in a repo with no `origin/HEAD` ref.
19
+ */
20
+ export async function getDefaultBranch(dir) {
21
+ const originHead = await runGit(dir, ["symbolic-ref", "--short", "refs/remotes/origin/HEAD"], { allowNonZeroExit: true });
22
+ if (originHead.exitCode === 0) {
23
+ const shortRef = originHead.stdout.trim();
24
+ const separatorIndex = shortRef.indexOf("/");
25
+ return separatorIndex > 0 ? shortRef.slice(separatorIndex + 1) : shortRef;
26
+ }
27
+ const head = await runGit(dir, ["rev-parse", "--abbrev-ref", "HEAD"], {
28
+ allowNonZeroExit: true,
29
+ });
30
+ if (head.exitCode === 0) {
31
+ const name = head.stdout.trim();
32
+ return name.length > 0 && name !== "HEAD" ? name : null;
33
+ }
34
+ return null;
35
+ }
36
+ /**
37
+ * The currently checked-out branch (short name). Returns null for detached
38
+ * HEAD, non-Git directories, and any git failure — callers treat "no branch"
39
+ * as absent display metadata, never an error.
40
+ */
41
+ export async function getCurrentBranch(dir) {
42
+ try {
43
+ const result = await runGit(dir, ["rev-parse", "--abbrev-ref", "HEAD"], { allowNonZeroExit: true });
44
+ if (result.exitCode !== 0) {
45
+ return null;
46
+ }
47
+ const name = result.stdout.trim();
48
+ return name.length > 0 && name !== "HEAD" ? name : null;
49
+ }
50
+ catch {
51
+ return null;
52
+ }
53
+ }
54
+ /** Whether a local branch with this exact name exists. */
55
+ export async function branchExists(dir, branch) {
56
+ const result = await runGit(dir, ["rev-parse", "--verify", "--quiet", `refs/heads/${branch}`], { allowNonZeroExit: true });
57
+ return result.exitCode === 0;
58
+ }
59
+ /** Whether the working tree has uncommitted changes (staged, unstaged, or untracked). */
60
+ export async function isWorkingTreeDirty(dir) {
61
+ const result = await runGit(dir, ["status", "--porcelain"]);
62
+ return result.stdout.trim().length > 0;
63
+ }
64
+ const MAX_BRANCH_REFS = 500;
65
+ /**
66
+ * Local branches plus `origin/*` remote branches, most recently committed
67
+ * first, capped at {@link MAX_BRANCH_REFS}. `origin/HEAD` is excluded.
68
+ */
69
+ export async function listBranchRefs(dir) {
70
+ const result = await runGit(dir, [
71
+ "for-each-ref",
72
+ "--format=%(HEAD)%09%(refname:short)",
73
+ "--sort=-committerdate",
74
+ `--count=${MAX_BRANCH_REFS}`,
75
+ "refs/heads",
76
+ "refs/remotes/origin",
77
+ ]);
78
+ const refs = [];
79
+ for (const line of result.stdout.split("\n")) {
80
+ if (!line.trim()) {
81
+ continue;
82
+ }
83
+ const [headMarker, name] = line.split("\t");
84
+ if (!name || name === "origin/HEAD" || name === "origin") {
85
+ continue;
86
+ }
87
+ refs.push({
88
+ name,
89
+ isCurrent: headMarker === "*",
90
+ isRemote: name.startsWith("origin/"),
91
+ });
92
+ }
93
+ return refs;
94
+ }
95
+ //# sourceMappingURL=repo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo.js","sourceRoot":"","sources":["../../../../src/lib/git/repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,GAAW;IAC/C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;QAClE,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,GAAW;IAChD,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC,cAAc,EAAE,SAAS,EAAE,0BAA0B,CAAC,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1H,IAAI,UAAU,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QAC1C,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7C,OAAO,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC5E,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE;QACpE,gBAAgB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M,CAAC,KAAK,UAAU,kBAAkB,CAAC,GAAW;IAClD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;IAC5D,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AACzC,CAAC;AASD,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAW;IAC9C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE;QAC/B,cAAc;QACd,qCAAqC;QACrC,uBAAuB;QACvB,WAAW,eAAe,EAAE;QAC5B,YAAY;QACZ,qBAAqB;KACtB,CAAC,CAAC;IAEH,MAAM,IAAI,GAAgB,EAAE,CAAC;IAC7B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;YACjB,SAAS;QACX,CAAC;QACD,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YACzD,SAAS;QACX,CAAC;QACD,IAAI,CAAC,IAAI,CAAC;YACR,IAAI;YACJ,SAAS,EAAE,UAAU,KAAK,GAAG;YAC7B,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;SACrC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,49 @@
1
+ export interface WorktreeInfo {
2
+ path: string;
3
+ /** Checked-out branch (short name), or null when detached/bare. */
4
+ branch: string | null;
5
+ /** The main working tree (the repo checkout itself, always listed first). */
6
+ isMain: boolean;
7
+ }
8
+ /** Parse `git worktree list --porcelain` output. */
9
+ export declare function parseWorktreeList(porcelain: string): WorktreeInfo[];
10
+ /** All worktrees of the repo at `parentPath` (including the main checkout). */
11
+ export declare function listWorktrees(parentPath: string): Promise<WorktreeInfo[]>;
12
+ /**
13
+ * Default on-disk location for OpenSana-created worktrees: a sibling folder
14
+ * `<repo>-worktrees/<branch>` next to the parent repo (v2 config will make
15
+ * this overridable).
16
+ */
17
+ export declare function buildDefaultWorktreePath(parentPath: string, branch: string): string;
18
+ export interface CreateWorktreeInput {
19
+ parentPath: string;
20
+ branch: string;
21
+ baseRef?: string;
22
+ startFromOrigin?: boolean;
23
+ }
24
+ export interface CreateWorktreeResult {
25
+ path: string;
26
+ /** True when an existing worktree for this branch was reused. */
27
+ reused: boolean;
28
+ /** The ref the new branch was based on (absent when reused/attached). */
29
+ baseRef?: string;
30
+ }
31
+ /**
32
+ * Create (or idempotently reuse) a worktree for `branch`.
33
+ *
34
+ * - A worktree already on `branch` is reused as-is (retry path).
35
+ * - An existing local branch without one gets a worktree attached (`baseRef` ignored).
36
+ * - Otherwise a new branch is created from `baseRef` (default: the repo's default branch,
37
+ * falling back to HEAD), optionally after fetching so the base is `origin/<baseRef>`.
38
+ *
39
+ * The v2 seam: custom create commands will replace this body based on local CLI config.
40
+ */
41
+ export declare function createWorktree(input: CreateWorktreeInput): Promise<CreateWorktreeResult>;
42
+ /**
43
+ * Remove a worktree. Refuses when the worktree has uncommitted changes —
44
+ * surfacing the error instead of forcing is deliberate (destructive op).
45
+ */
46
+ export declare function removeWorktree(input: {
47
+ parentPath: string;
48
+ worktreePath: string;
49
+ }): Promise<void>;
@@ -0,0 +1,97 @@
1
+ import { mkdir } from "node:fs/promises";
2
+ import { basename, dirname, join } from "node:path";
3
+ import { GitCommandError, runGit } from "./exec.js";
4
+ import { branchExists, getDefaultBranch, isWorkingTreeDirty } from "./repo.js";
5
+ /** Parse `git worktree list --porcelain` output. */
6
+ export function parseWorktreeList(porcelain) {
7
+ const worktrees = [];
8
+ let current = { branch: null };
9
+ const flush = () => {
10
+ if (current.path !== undefined) {
11
+ worktrees.push({
12
+ path: current.path,
13
+ branch: current.branch,
14
+ isMain: worktrees.length === 0,
15
+ });
16
+ }
17
+ current = { branch: null };
18
+ };
19
+ for (const line of porcelain.split("\n")) {
20
+ if (line.trim().length === 0) {
21
+ flush();
22
+ continue;
23
+ }
24
+ if (line.startsWith("worktree ")) {
25
+ current.path = line.slice("worktree ".length);
26
+ }
27
+ else if (line.startsWith("branch ")) {
28
+ const ref = line.slice("branch ".length);
29
+ current.branch = ref.startsWith("refs/heads/") ? ref.slice("refs/heads/".length) : ref;
30
+ }
31
+ }
32
+ flush();
33
+ return worktrees;
34
+ }
35
+ /** All worktrees of the repo at `parentPath` (including the main checkout). */
36
+ export async function listWorktrees(parentPath) {
37
+ const result = await runGit(parentPath, ["worktree", "list", "--porcelain"]);
38
+ return parseWorktreeList(result.stdout);
39
+ }
40
+ /**
41
+ * Default on-disk location for OpenSana-created worktrees: a sibling folder
42
+ * `<repo>-worktrees/<branch>` next to the parent repo (v2 config will make
43
+ * this overridable).
44
+ */
45
+ export function buildDefaultWorktreePath(parentPath, branch) {
46
+ const container = `${basename(parentPath)}-worktrees`;
47
+ const dirName = branch.replace(/\//g, "-");
48
+ return join(dirname(parentPath), container, dirName);
49
+ }
50
+ /**
51
+ * Create (or idempotently reuse) a worktree for `branch`.
52
+ *
53
+ * - A worktree already on `branch` is reused as-is (retry path).
54
+ * - An existing local branch without one gets a worktree attached (`baseRef` ignored).
55
+ * - Otherwise a new branch is created from `baseRef` (default: the repo's default branch,
56
+ * falling back to HEAD), optionally after fetching so the base is `origin/<baseRef>`.
57
+ *
58
+ * The v2 seam: custom create commands will replace this body based on local CLI config.
59
+ */
60
+ export async function createWorktree(input) {
61
+ const { parentPath, branch } = input;
62
+ const existing = await listWorktrees(parentPath);
63
+ const match = existing.find((wt) => !wt.isMain && wt.branch === branch);
64
+ if (match) {
65
+ return { path: match.path, reused: true };
66
+ }
67
+ const targetPath = buildDefaultWorktreePath(parentPath, branch);
68
+ if (existing.some((wt) => wt.path === targetPath)) {
69
+ throw new GitCommandError(`Worktree directory already exists on another branch: ${targetPath}`, ["worktree", "add"], null, "");
70
+ }
71
+ await mkdir(dirname(targetPath), { recursive: true });
72
+ if (await branchExists(parentPath, branch)) {
73
+ await runGit(parentPath, ["worktree", "add", targetPath, branch]);
74
+ return { path: targetPath, reused: false };
75
+ }
76
+ let baseRef = input.baseRef ?? (await getDefaultBranch(parentPath)) ?? "HEAD";
77
+ if (input.startFromOrigin && baseRef !== "HEAD") {
78
+ await runGit(parentPath, ["fetch", "origin", baseRef], {
79
+ timeoutMs: 120_000,
80
+ });
81
+ baseRef = `origin/${baseRef}`;
82
+ }
83
+ await runGit(parentPath, ["worktree", "add", targetPath, "-b", branch, baseRef]);
84
+ return { path: targetPath, reused: false, baseRef };
85
+ }
86
+ /**
87
+ * Remove a worktree. Refuses when the worktree has uncommitted changes —
88
+ * surfacing the error instead of forcing is deliberate (destructive op).
89
+ */
90
+ export async function removeWorktree(input) {
91
+ const dirty = await isWorkingTreeDirty(input.worktreePath).catch(() => false);
92
+ if (dirty) {
93
+ throw new GitCommandError("Worktree has uncommitted changes", ["worktree", "remove"], null, "");
94
+ }
95
+ await runGit(input.parentPath, ["worktree", "remove", input.worktreePath]);
96
+ }
97
+ //# sourceMappingURL=worktrees.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktrees.js","sourceRoot":"","sources":["../../../../src/lib/git/worktrees.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,W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AC;IAC9E,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,IAAI,eAAe,CAAC,kCAAkC,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IAClG,CAAC;IAED,MAAM,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;AAC7E,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from "commander";
2
+ export declare function getGlobalStringOption(cmd: Command, optionName: string): string | undefined;
3
+ export declare function getGlobalProjectOption(cmd: Command): string | undefined;
@@ -0,0 +1,8 @@
1
+ export function getGlobalStringOption(cmd, optionName) {
2
+ const value = Reflect.get(cmd.optsWithGlobals(), optionName);
3
+ return typeof value === "string" ? value : undefined;
4
+ }
5
+ export function getGlobalProjectOption(cmd) {
6
+ return getGlobalStringOption(cmd, "project");
7
+ }
8
+ //# sourceMappingURL=global-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global-options.js","sourceRoot":"","sources":["../../../src/lib/global-options.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,qBAAqB,CACnC,GAAY,EACZ,UAAkB;IAElB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,UAAU,CAAC,CAAC;IAC7D,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,GAAY;IACjD,OAAO,qBAAqB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Id, TableNames } from "../convex/_generated/dataModel.js";
2
+ import type { SystemTableNames } from "convex/server";
3
+ export declare function parseId<T extends TableNames | SystemTableNames>(value: string, label: string): Id<T>;
@@ -0,0 +1,14 @@
1
+ const CONVEX_ID_PATTERN = /^[A-Za-z0-9_-]+$/;
2
+ export function parseId(value, label) {
3
+ const trimmed = value.trim();
4
+ if (!trimmed) {
5
+ throw new Error(`${label} is required`);
6
+ }
7
+ if (!CONVEX_ID_PATTERN.test(trimmed)) {
8
+ throw new Error(`${label} must be a valid Convex ID`);
9
+ }
10
+ // Convex performs the canonical ID validation at the API boundary. This
11
+ // helper rejects obvious bad input before applying the branded ID type.
12
+ return trimmed;
13
+ }
14
+ //# sourceMappingURL=id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.js","sourceRoot":"","sources":["../../../src/lib/id.ts"],"names":[],"mappings":"AAGA,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAE7C,MAAM,UAAU,OAAO,CACrB,KAAa,EACb,KAAa;IAEb,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,cAAc,CAAC,CAAC;IAC1C,CAAC;IAED,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,4BAA4B,CAAC,CAAC;IACxD,CAAC;IAED,wEAAwE;IACxE,wEAAwE;IACxE,OAAO,OAAgB,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { Command } from "commander";
2
+ import { type OpenSanaClient, type RequiredConfig } from "./config/index.js";
3
+ export interface OneShotCommandContext {
4
+ config: RequiredConfig;
5
+ client: OpenSanaClient;
6
+ }
7
+ export declare function runOneShotCommand(cmd: Command, run: (context: OneShotCommandContext) => Promise<void>): Promise<void>;
@@ -0,0 +1,30 @@
1
+ import chalk from "chalk";
2
+ import { ConfigError, createConvexClient, handleConfigError, } from "./config/index.js";
3
+ import { toUserFacingError } from "./convex-error.js";
4
+ import { resolveOneShotConfig } from "./one-shot-config.js";
5
+ export async function runOneShotCommand(cmd, run) {
6
+ let client;
7
+ try {
8
+ const config = resolveOneShotConfig(cmd);
9
+ client = createConvexClient({
10
+ url: config.convexUrl,
11
+ apiKey: config.apiKey,
12
+ });
13
+ await run({ config, client });
14
+ }
15
+ catch (error) {
16
+ if (error instanceof ConfigError) {
17
+ handleConfigError(error);
18
+ return;
19
+ }
20
+ // `--cursor` is only declared on paginated commands, so this is undefined
21
+ // elsewhere and the cursor hint stays out of unrelated errors.
22
+ const cursor = cmd.opts().cursor;
23
+ console.error(chalk.red(`Error: ${toUserFacingError(error, typeof cursor === "string" ? cursor : undefined)}`));
24
+ process.exit(1);
25
+ }
26
+ finally {
27
+ await client?.close();
28
+ }
29
+ }
30
+ //# sourceMappingURL=one-shot-command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"one-shot-command.js","sourceRoot":"","sources":["../../../src/lib/one-shot-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,iBAAiB,GAGlB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAO5D,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,GAAY,EACZ,GAAsD;IAEtD,IAAI,MAAkC,CAAC;IAEvC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;QACzC,MAAM,GAAG,kBAAkB,CAAC;YAC1B,GAAG,EAAE,MAAM,CAAC,SAAS;YACrB,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;QAEH,MAAM,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;YACjC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,OAAO;QACT,CAAC;QAED,0EAA0E;QAC1E,+DAA+D;QAC/D,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC;QACjC,OAAO,CAAC,KAAK,CACX,KAAK,CAAC,GAAG,CACP,UAAU,iBAAiB,CAAC,KAAK,EAAE,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CACtF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC;IACxB,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from "commander";
2
+ import { type RequiredConfig } from "./config/index.js";
3
+ export declare function resolveOneShotConfig(cmd: Command, cwd?: string): RequiredConfig;
@@ -0,0 +1,7 @@
1
+ import { requireCredentials, resolveConfigFromProfileCommand, } from "./config/index.js";
2
+ export function resolveOneShotConfig(cmd, cwd) {
3
+ const resolved = resolveConfigFromProfileCommand(cmd, cwd);
4
+ requireCredentials(resolved);
5
+ return resolved;
6
+ }
7
+ //# sourceMappingURL=one-shot-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"one-shot-config.js","sourceRoot":"","sources":["../../../src/lib/one-shot-config.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,+BAA+B,GAEhC,MAAM,mBAAmB,CAAC;AAE3B,MAAM,UAAU,oBAAoB,CAAC,GAAY,EAAE,GAAY;IAC7D,MAAM,QAAQ,GAAG,+BAA+B,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3D,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC7B,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type Command } from "commander";
2
+ export declare const OUTPUT_MODES: readonly ["text", "json"];
3
+ export type OutputMode = (typeof OUTPUT_MODES)[number];
4
+ export interface OutputOptions {
5
+ output?: OutputMode;
6
+ json?: boolean;
7
+ }
8
+ export declare function addOutputOptions<T extends Command>(cmd: T): T;
9
+ export declare function resolveOutputMode(options: OutputOptions): OutputMode;
10
+ export declare function printOutput<T>(outputMode: OutputMode, value: T, renderText: (value: T) => void): void;
@@ -0,0 +1,27 @@
1
+ import { Option } from "commander";
2
+ export const OUTPUT_MODES = ["text", "json"];
3
+ export function addOutputOptions(cmd) {
4
+ return cmd
5
+ .addOption(new Option("--output <mode>", "Output format: text or json")
6
+ .choices([...OUTPUT_MODES])
7
+ .default("text"))
8
+ .option("--json", "Alias for --output json");
9
+ }
10
+ export function resolveOutputMode(options) {
11
+ if (options.json) {
12
+ return "json";
13
+ }
14
+ const output = options.output ?? "text";
15
+ if (output === "text" || output === "json") {
16
+ return output;
17
+ }
18
+ throw new Error(`Invalid output mode "${output}". Valid values: ${OUTPUT_MODES.join(", ")}`);
19
+ }
20
+ export function printOutput(outputMode, value, renderText) {
21
+ if (outputMode === "json") {
22
+ console.log(JSON.stringify(value, null, 2));
23
+ return;
24
+ }
25
+ renderText(value);
26
+ }
27
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/lib/output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,WAAW,CAAC;AAEjD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AAStD,MAAM,UAAU,gBAAgB,CAAoB,GAAM;IACxD,OAAO,GAAG;SACP,SAAS,CACR,IAAI,MAAM,CAAC,iBAAiB,EAAE,6BAA6B,CAAC;SACzD,OAAO,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC;SAC1B,OAAO,CAAC,MAAM,CAAC,CACnB;SACA,MAAM,CAAC,QAAQ,EAAE,yBAAyB,CAAM,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAsB;IACtD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC;IACxC,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QAC3C,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,IAAI,KAAK,CACb,wBAAwB,MAAM,oBAAoB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC5E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,UAAsB,EACtB,KAAQ,EACR,UAA8B;IAE9B,IAAI,UAAU,KAAK,MAAM,EAAE,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5C,OAAO;IACT,CAAC;IAED,UAAU,CAAC,KAAK,CAAC,CAAC;AACpB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Command } from "commander";
2
+ import type { OutputMode } from "./output.js";
3
+ export interface PaginationOptions {
4
+ limit?: string | number;
5
+ cursor?: string;
6
+ }
7
+ export interface CursorPageResult<T> {
8
+ page: T[];
9
+ isDone: boolean;
10
+ continueCursor: string;
11
+ }
12
+ export declare function addPaginationOptions<T extends Command>(cmd: T): T;
13
+ export declare function parsePageSize(value: string | number | undefined): number;
14
+ export declare function parsePaginationCursor(value: string | undefined): string | null;
15
+ export declare function shellQuote(value: string): string;
16
+ export declare function printPaginatedOutput<T>(outputMode: OutputMode, value: CursorPageResult<T>, renderText: (value: CursorPageResult<T>) => void, nextCommand: string): void;
@@ -0,0 +1,45 @@
1
+ import chalk from "chalk";
2
+ import { printOutput } from "./output.js";
3
+ const DEFAULT_PAGE_SIZE = 20;
4
+ const MAX_PAGE_SIZE = 50;
5
+ export function addPaginationOptions(cmd) {
6
+ return cmd
7
+ .option("--limit <n>", `Page size from 1 to ${MAX_PAGE_SIZE}`)
8
+ .option("--cursor <cursor>", "Opaque pagination cursor");
9
+ }
10
+ export function parsePageSize(value) {
11
+ if (value === undefined) {
12
+ return DEFAULT_PAGE_SIZE;
13
+ }
14
+ const numeric = typeof value === "number" ? value : Number.parseInt(value, 10);
15
+ if (!Number.isInteger(numeric) || numeric < 1 || numeric > MAX_PAGE_SIZE) {
16
+ throw new Error(`Invalid limit "${String(value)}". Valid values: 1-${MAX_PAGE_SIZE}.`);
17
+ }
18
+ return numeric;
19
+ }
20
+ export function parsePaginationCursor(value) {
21
+ if (value === undefined) {
22
+ return null;
23
+ }
24
+ const cursor = value.trim();
25
+ if (cursor.length === 0) {
26
+ throw new Error("Cursor must be a non-empty string.");
27
+ }
28
+ return cursor;
29
+ }
30
+ export function shellQuote(value) {
31
+ const escaped = value.split("'").join(`'"'"'`);
32
+ return `'${escaped}'`;
33
+ }
34
+ export function printPaginatedOutput(outputMode, value, renderText, nextCommand) {
35
+ printOutput(outputMode, value, (result) => {
36
+ renderText(result);
37
+ if (result.isDone) {
38
+ return;
39
+ }
40
+ console.log(chalk.dim(`Next cursor: ${result.continueCursor}`));
41
+ console.log(chalk.dim(`Next page: ${nextCommand}`));
42
+ console.log();
43
+ });
44
+ }
45
+ //# sourceMappingURL=pagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../src/lib/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,aAAa,GAAG,EAAE,CAAC;AAazB,MAAM,UAAU,oBAAoB,CAAoB,GAAM;IAC5D,OAAO,GAAG;SACP,MAAM,CAAC,aAAa,EAAE,uBAAuB,aA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MAAM,EAAE,EAAE;QACxC,UAAU,CAAC,MAAM,CAAC,CAAC;QAEnB,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAClB,OAAO;QACT,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAChE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,WAAW,EAAE,CAAC,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function parseOptionalNonEmptyString(value: string | undefined, label: string): string | undefined;
2
+ export declare function parseOptionalEnum<T extends string>(value: string | undefined, label: string, valid: readonly T[]): T | undefined;
@@ -0,0 +1,21 @@
1
+ export function parseOptionalNonEmptyString(value, label) {
2
+ if (value === undefined) {
3
+ return undefined;
4
+ }
5
+ const normalized = value.trim();
6
+ if (normalized.length === 0) {
7
+ throw new Error(`${label} must be a non-empty string.`);
8
+ }
9
+ return normalized;
10
+ }
11
+ export function parseOptionalEnum(value, label, valid) {
12
+ const normalized = parseOptionalNonEmptyString(value, label);
13
+ if (normalized === undefined) {
14
+ return undefined;
15
+ }
16
+ if (!valid.includes(normalized)) {
17
+ throw new Error(`${label} must be one of: ${valid.join(", ")}.`);
18
+ }
19
+ return normalized;
20
+ }
21
+ //# sourceMappingURL=parsers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../../src/lib/parsers.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,2BAA2B,CACzC,KAAyB,EACzB,KAAa;IAEb,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAChC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,8BAA8B,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,KAAyB,EACzB,KAAa,EACb,KAAmB;IAEnB,MAAM,UAAU,GAAG,2BAA2B,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC7D,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,CAAE,KAA2B,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,oBAAoB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,UAAe,CAAC;AACzB,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { api } from "../convex/_generated/api.js";
2
+ import type { FunctionReturnType } from "convex/server";
3
+ import type { Command } from "commander";
4
+ import type { Id } from "../convex/_generated/dataModel.js";
5
+ import type { OpenSanaClient, RequiredConfig } from "./config/index.js";
6
+ type AccessibleProjects = FunctionReturnType<typeof api.projects.core.listAccessible>;
7
+ export type AccessibleProject = AccessibleProjects[number];
8
+ type AccessibleOrganizations = FunctionReturnType<typeof api.organizations.core.listForUser>;
9
+ export type AccessibleOrganization = AccessibleOrganizations[number];
10
+ export interface ResolveProjectIdArgs {
11
+ projects: AccessibleProjects;
12
+ defaultProjectId?: string;
13
+ projectRef?: string;
14
+ orgRef?: string;
15
+ }
16
+ export interface OrganizationSummary {
17
+ organizationId: string;
18
+ organizationSlug: string;
19
+ organizationName: string;
20
+ projectCount: number;
21
+ }
22
+ export declare function filterProjectsByOrgRef(projects: AccessibleProjects, orgRef: string): AccessibleProjects;
23
+ export declare function resolveProjectId(args: ResolveProjectIdArgs): string;
24
+ export interface ResolvedProjectContext {
25
+ projects: AccessibleProjects;
26
+ projectId: Id<"projects">;
27
+ }
28
+ /** Resolves `--project`/`--org` against an already-fetched project list. */
29
+ export declare function resolveProjectIdFromCommand(projects: AccessibleProjects, config: RequiredConfig, cmd: Command, orgRef?: string): Id<"projects">;
30
+ /**
31
+ * The one-shot project preamble: list accessible projects, resolve the ref, brand
32
+ * the ID. `projects` comes back for callers that also resolve task refs.
33
+ */
34
+ export declare function resolveProjectFromCommand(client: OpenSanaClient, config: RequiredConfig, cmd: Command, orgRef?: string): Promise<ResolvedProjectContext>;
35
+ /**
36
+ * Memberships are the source of truth for which organizations exist; projects
37
+ * only supply the counts. Deriving the list from projects instead would hide
38
+ * an organization the caller belongs to but whose projects it cannot reach.
39
+ */
40
+ export declare function summarizeOrganizations(organizations: AccessibleOrganizations, projects: AccessibleProjects): OrganizationSummary[];
41
+ export {};