@useconvoy/cli 0.120.0 → 0.141.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 (266) hide show
  1. package/README.md +35 -9
  2. package/dist/bin/convoy.js +8 -0
  3. package/dist/bin/convoy.js.map +1 -1
  4. package/dist/marketplace/convoy/skills/convoy/SKILL.md +1 -0
  5. package/dist/marketplace/convoy/skills/convoy/references/inline-html.md +101 -0
  6. package/dist/src/agent/app/thread-processor.js +2 -1
  7. package/dist/src/agent/app/thread-processor.js.map +1 -1
  8. package/dist/src/agent/app/worktree-op-processor.js +13 -1
  9. package/dist/src/agent/app/worktree-op-processor.js.map +1 -1
  10. package/dist/src/agent/runtimes/agent-instructions.d.ts +2 -2
  11. package/dist/src/agent/runtimes/agent-instructions.js +6 -3
  12. package/dist/src/agent/runtimes/agent-instructions.js.map +1 -1
  13. package/dist/src/agent/runtimes/claudeCode/models.d.ts +1 -1
  14. package/dist/src/agent/runtimes/claudeCode/models.js +1 -0
  15. package/dist/src/agent/runtimes/claudeCode/models.js.map +1 -1
  16. package/dist/src/agent/runtimes/claudeCode/runner.js +16 -7
  17. package/dist/src/agent/runtimes/claudeCode/runner.js.map +1 -1
  18. package/dist/src/agent/runtimes/codex/app-server-runner.d.ts +2 -0
  19. package/dist/src/agent/runtimes/codex/app-server-runner.js +143 -16
  20. package/dist/src/agent/runtimes/codex/app-server-runner.js.map +1 -1
  21. package/dist/src/agent/runtimes/codex/commands.d.ts +6 -2
  22. package/dist/src/agent/runtimes/codex/commands.js +11 -2
  23. package/dist/src/agent/runtimes/codex/commands.js.map +1 -1
  24. package/dist/src/agent/runtimes/codex/goals/index.d.ts +25 -0
  25. package/dist/src/agent/runtimes/codex/goals/index.js +137 -0
  26. package/dist/src/agent/runtimes/codex/goals/index.js.map +1 -0
  27. package/dist/src/agent/runtimes/codex/goals/parsers.d.ts +9 -0
  28. package/dist/src/agent/runtimes/codex/goals/parsers.js +47 -0
  29. package/dist/src/agent/runtimes/codex/goals/parsers.js.map +1 -0
  30. package/dist/src/agent/runtimes/codex/goals/validators.d.ts +28 -0
  31. package/dist/src/agent/runtimes/codex/goals/validators.js.map +1 -0
  32. package/dist/src/agent/runtimes/codex/lifecycle.d.ts +7 -0
  33. package/dist/src/agent/runtimes/codex/lifecycle.js +27 -0
  34. package/dist/src/agent/runtimes/codex/lifecycle.js.map +1 -1
  35. package/dist/src/agent/runtimes/contracts.d.ts +6 -1
  36. package/dist/src/agent/runtimes/cursor/models.js +1 -0
  37. package/dist/src/agent/runtimes/cursor/models.js.map +1 -1
  38. package/dist/src/agent/sdk/adapters/executable-resolution.d.ts +1 -0
  39. package/dist/src/agent/sdk/adapters/executable-resolution.js +1 -1
  40. package/dist/src/agent/sdk/adapters/executable-resolution.js.map +1 -1
  41. package/dist/src/cli.js +0 -2
  42. package/dist/src/cli.js.map +1 -1
  43. package/dist/src/commands/connect/prompts.d.ts +2 -0
  44. package/dist/src/commands/connect/prompts.js +6 -0
  45. package/dist/src/commands/connect/prompts.js.map +1 -0
  46. package/dist/src/commands/connect/workflow.d.ts +2 -0
  47. package/dist/src/commands/connect/workflow.js +63 -9
  48. package/dist/src/commands/connect/workflow.js.map +1 -1
  49. package/dist/src/commands/devcontainer/command.js +9 -1
  50. package/dist/src/commands/devcontainer/command.js.map +1 -1
  51. package/dist/src/commands/devcontainer/install.d.ts +9 -0
  52. package/dist/src/commands/devcontainer/install.js +38 -0
  53. package/dist/src/commands/devcontainer/install.js.map +1 -1
  54. package/dist/src/commands/environment/command.js +19 -9
  55. package/dist/src/commands/environment/command.js.map +1 -1
  56. package/dist/src/commands/environment/formatters.d.ts +11 -0
  57. package/dist/src/commands/environment/formatters.js +28 -0
  58. package/dist/src/commands/environment/formatters.js.map +1 -0
  59. package/dist/src/commands/environment/index.d.ts +12 -5
  60. package/dist/src/commands/environment/index.js +2 -8
  61. package/dist/src/commands/environment/index.js.map +1 -1
  62. package/dist/src/commands/environment/paths.d.ts +20 -1
  63. package/dist/src/commands/environment/paths.js +132 -3
  64. package/dist/src/commands/environment/paths.js.map +1 -1
  65. package/dist/src/commands/environment/projects.js +1 -1
  66. package/dist/src/commands/environment/projects.js.map +1 -1
  67. package/dist/src/commands/environment/resolution.d.ts +45 -1
  68. package/dist/src/commands/environment/resolution.js +138 -0
  69. package/dist/src/commands/environment/resolution.js.map +1 -1
  70. package/dist/src/commands/environment/validators.d.ts +71 -2
  71. package/dist/src/commands/environment/validators.js +20 -3
  72. package/dist/src/commands/environment/validators.js.map +1 -1
  73. package/dist/src/commands/environment/workflow.d.ts +19 -1
  74. package/dist/src/commands/environment/workflow.js +114 -16
  75. package/dist/src/commands/environment/workflow.js.map +1 -1
  76. package/dist/src/commands/init/prompts.js +3 -0
  77. package/dist/src/commands/init/prompts.js.map +1 -1
  78. package/dist/src/commands/keys/command.js +3 -2
  79. package/dist/src/commands/keys/command.js.map +1 -1
  80. package/dist/src/commands/keys/workflow.d.ts +1 -0
  81. package/dist/src/commands/keys/workflow.js +11 -6
  82. package/dist/src/commands/keys/workflow.js.map +1 -1
  83. package/dist/src/commands/project/command.js +16 -15
  84. package/dist/src/commands/project/command.js.map +1 -1
  85. package/dist/src/commands/project/formatters.d.ts +11 -2
  86. package/dist/src/commands/project/formatters.js +47 -15
  87. package/dist/src/commands/project/formatters.js.map +1 -1
  88. package/dist/src/commands/project/launcher.d.ts +36 -3
  89. package/dist/src/commands/project/launcher.js +156 -8
  90. package/dist/src/commands/project/launcher.js.map +1 -1
  91. package/dist/src/commands/project/validators.d.ts +73 -1
  92. package/dist/src/commands/project/validators.js +39 -2
  93. package/dist/src/commands/project/validators.js.map +1 -1
  94. package/dist/src/commands/project/worker.js +19 -17
  95. package/dist/src/commands/project/worker.js.map +1 -1
  96. package/dist/src/commands/project/workflow.d.ts +11 -14
  97. package/dist/src/commands/project/workflow.js +158 -47
  98. package/dist/src/commands/project/workflow.js.map +1 -1
  99. package/dist/src/commands/remote/command.js +17 -2
  100. package/dist/src/commands/remote/command.js.map +1 -1
  101. package/dist/src/commands/remote/ssh.d.ts +4 -1
  102. package/dist/src/commands/remote/ssh.js +5 -2
  103. package/dist/src/commands/remote/ssh.js.map +1 -1
  104. package/dist/src/commands/remote/workflow.d.ts +12 -0
  105. package/dist/src/commands/remote/workflow.js +2 -1
  106. package/dist/src/commands/remote/workflow.js.map +1 -1
  107. package/dist/src/commands/service/command.d.ts +1 -0
  108. package/dist/src/commands/service/command.js +59 -14
  109. package/dist/src/commands/service/command.js.map +1 -1
  110. package/dist/src/commands/service/formatters.d.ts +2 -0
  111. package/dist/src/commands/service/formatters.js +17 -0
  112. package/dist/src/commands/service/formatters.js.map +1 -1
  113. package/dist/src/commands/service/paths.d.ts +16 -0
  114. package/dist/src/commands/service/paths.js +178 -1
  115. package/dist/src/commands/service/paths.js.map +1 -1
  116. package/dist/src/commands/service/resolution.d.ts +2 -0
  117. package/dist/src/commands/service/resolution.js +40 -2
  118. package/dist/src/commands/service/resolution.js.map +1 -1
  119. package/dist/src/commands/service/server.js +1 -1
  120. package/dist/src/commands/service/server.js.map +1 -1
  121. package/dist/src/commands/service/service-entrypoint.js +38 -11
  122. package/dist/src/commands/service/service-entrypoint.js.map +1 -1
  123. package/dist/src/commands/service/validators.d.ts +21 -2
  124. package/dist/src/commands/service/validators.js +7 -5
  125. package/dist/src/commands/service/validators.js.map +1 -1
  126. package/dist/src/commands/service/workflow.js +10 -8
  127. package/dist/src/commands/service/workflow.js.map +1 -1
  128. package/dist/src/commands/setup/prompts.js +7 -4
  129. package/dist/src/commands/setup/prompts.js.map +1 -1
  130. package/dist/src/commands/setup/resolution.js +1 -1
  131. package/dist/src/commands/setup/resolution.js.map +1 -1
  132. package/dist/src/commands/tasks/artifacts/create.js +12 -4
  133. package/dist/src/commands/tasks/artifacts/create.js.map +1 -1
  134. package/dist/src/commands/tasks/artifacts/list.js +12 -4
  135. package/dist/src/commands/tasks/artifacts/list.js.map +1 -1
  136. package/dist/src/commands/tasks/artifacts/move.js +14 -13
  137. package/dist/src/commands/tasks/artifacts/move.js.map +1 -1
  138. package/dist/src/commands/tasks/get.js +6 -4
  139. package/dist/src/commands/tasks/get.js.map +1 -1
  140. package/dist/src/commands/tasks/update.js +42 -14
  141. package/dist/src/commands/tasks/update.js.map +1 -1
  142. package/dist/src/commands/threads/attach.d.ts +1 -1
  143. package/dist/src/commands/threads/attach.js +55 -6
  144. package/dist/src/commands/threads/attach.js.map +1 -1
  145. package/dist/src/commands/threads/checks.d.ts +3 -0
  146. package/dist/src/commands/threads/checks.js +47 -0
  147. package/dist/src/commands/threads/checks.js.map +1 -0
  148. package/dist/src/commands/threads/index.js +3 -1
  149. package/dist/src/commands/threads/index.js.map +1 -1
  150. package/dist/src/commands/tui/actions/app.js +16 -8
  151. package/dist/src/commands/tui/actions/app.js.map +1 -1
  152. package/dist/src/commands/tui/actions/workflow.js +13 -7
  153. package/dist/src/commands/tui/actions/workflow.js.map +1 -1
  154. package/dist/src/commands/tui/app.js +65 -34
  155. package/dist/src/commands/tui/app.js.map +1 -1
  156. package/dist/src/commands/tui/credentials/app.js +8 -6
  157. package/dist/src/commands/tui/credentials/app.js.map +1 -1
  158. package/dist/src/commands/tui/credentials/formatters.d.ts +1 -1
  159. package/dist/src/commands/tui/credentials/formatters.js +2 -2
  160. package/dist/src/commands/tui/credentials/formatters.js.map +1 -1
  161. package/dist/src/commands/tui/credentials/index.d.ts +1 -0
  162. package/dist/src/commands/tui/credentials/index.js +1 -0
  163. package/dist/src/commands/tui/credentials/index.js.map +1 -1
  164. package/dist/src/commands/tui/dialog/app.d.ts +4 -0
  165. package/dist/src/commands/tui/dialog/app.js +8 -1
  166. package/dist/src/commands/tui/dialog/app.js.map +1 -1
  167. package/dist/src/commands/tui/dialog/index.d.ts +1 -1
  168. package/dist/src/commands/tui/dialog/index.js +1 -1
  169. package/dist/src/commands/tui/dialog/index.js.map +1 -1
  170. package/dist/src/commands/tui/environments/app.js +37 -20
  171. package/dist/src/commands/tui/environments/app.js.map +1 -1
  172. package/dist/src/commands/tui/formatters.d.ts +14 -2
  173. package/dist/src/commands/tui/formatters.js +38 -2
  174. package/dist/src/commands/tui/formatters.js.map +1 -1
  175. package/dist/src/commands/tui/onboarding/app.js +80 -9
  176. package/dist/src/commands/tui/onboarding/app.js.map +1 -1
  177. package/dist/src/commands/tui/onboarding/formatters.js +1 -1
  178. package/dist/src/commands/tui/onboarding/formatters.js.map +1 -1
  179. package/dist/src/commands/tui/onboarding/index.d.ts +1 -0
  180. package/dist/src/commands/tui/onboarding/runtime-access.d.ts +8 -0
  181. package/dist/src/commands/tui/onboarding/runtime-access.js +194 -0
  182. package/dist/src/commands/tui/onboarding/runtime-access.js.map +1 -0
  183. package/dist/src/commands/tui/onboarding/validators.d.ts +14 -0
  184. package/dist/src/commands/tui/onboarding/validators.js +2 -0
  185. package/dist/src/commands/tui/onboarding/validators.js.map +1 -0
  186. package/dist/src/commands/tui/onboarding/workflow.d.ts +11 -0
  187. package/dist/src/commands/tui/onboarding/workflow.js +4 -0
  188. package/dist/src/commands/tui/onboarding/workflow.js.map +1 -1
  189. package/dist/src/commands/tui/render.js +11 -2
  190. package/dist/src/commands/tui/render.js.map +1 -1
  191. package/dist/src/commands/tui/resolution.d.ts +12 -2
  192. package/dist/src/commands/tui/resolution.js +33 -13
  193. package/dist/src/commands/tui/resolution.js.map +1 -1
  194. package/dist/src/commands/tui/runtimes/app.d.ts +11 -0
  195. package/dist/src/commands/tui/runtimes/app.js +170 -0
  196. package/dist/src/commands/tui/runtimes/app.js.map +1 -0
  197. package/dist/src/commands/tui/runtimes/formatters.d.ts +10 -0
  198. package/dist/src/commands/tui/runtimes/formatters.js +16 -0
  199. package/dist/src/commands/tui/runtimes/formatters.js.map +1 -0
  200. package/dist/src/commands/tui/runtimes/index.d.ts +1 -0
  201. package/dist/src/commands/tui/runtimes/index.js +2 -0
  202. package/dist/src/commands/tui/runtimes/index.js.map +1 -0
  203. package/dist/src/commands/tui/validators.d.ts +2 -0
  204. package/dist/src/commands/tui/workflow.d.ts +96 -0
  205. package/dist/src/commands/tui/workflow.js +72 -7
  206. package/dist/src/commands/tui/workflow.js.map +1 -1
  207. package/dist/src/commands/update/prompts.js +1 -0
  208. package/dist/src/commands/update/prompts.js.map +1 -1
  209. package/dist/src/convex/_generated/ai/ai-files.state.json +2 -2
  210. package/dist/src/convex/_generated/ai/guidelines.md +185 -270
  211. package/dist/src/convex/_generated/api.d.ts +22 -0
  212. package/dist/src/convex/_generated/server.d.ts +19 -0
  213. package/dist/src/convex/_generated/server.js +8 -0
  214. package/dist/src/lib/config/credentials/resolution.d.ts +28 -2
  215. package/dist/src/lib/config/credentials/resolution.js +43 -24
  216. package/dist/src/lib/config/credentials/resolution.js.map +1 -1
  217. package/dist/src/lib/config/credentials/store.js +1 -1
  218. package/dist/src/lib/config/credentials/store.js.map +1 -1
  219. package/dist/src/lib/config/profile.js +32 -5
  220. package/dist/src/lib/config/profile.js.map +1 -1
  221. package/dist/src/lib/config/toml.js +2 -2
  222. package/dist/src/lib/config/toml.js.map +1 -1
  223. package/dist/src/lib/config/types.d.ts +4 -0
  224. package/dist/src/lib/config/types.js +4 -0
  225. package/dist/src/lib/config/types.js.map +1 -1
  226. package/dist/src/lib/connect-events.d.ts +1 -0
  227. package/dist/src/lib/git/index.d.ts +1 -1
  228. package/dist/src/lib/git/index.js +1 -1
  229. package/dist/src/lib/git/index.js.map +1 -1
  230. package/dist/src/lib/git/working-tree.d.ts +5 -0
  231. package/dist/src/lib/git/working-tree.js +18 -0
  232. package/dist/src/lib/git/working-tree.js.map +1 -1
  233. package/dist/src/lib/id.js +6 -1
  234. package/dist/src/lib/id.js.map +1 -1
  235. package/dist/src/lib/version.d.ts +3 -1
  236. package/dist/src/lib/version.js +17 -9
  237. package/dist/src/lib/version.js.map +1 -1
  238. package/dist/templates/devcontainer/Dockerfile +27 -16
  239. package/dist/templates/devcontainer/README.md +102 -18
  240. package/dist/templates/devcontainer/devcontainer.json +12 -6
  241. package/dist/templates/devcontainer/init-firewall.sh +13 -0
  242. package/dist/templates/project-isolation/Dockerfile +12 -5
  243. package/dist/templates/project-isolation/README.md +30 -15
  244. package/dist/templates/project-isolation/__pycache__/environment.cpython-311.pyc +0 -0
  245. package/dist/templates/project-isolation/__pycache__/install.cpython-311.pyc +0 -0
  246. package/dist/templates/project-isolation/__pycache__/launcher.cpython-311.pyc +0 -0
  247. package/dist/templates/project-isolation/devcontainer.json +1 -1
  248. package/dist/templates/project-isolation/environment.py +52 -18
  249. package/dist/templates/project-isolation/environment.test.py +109 -11
  250. package/dist/templates/project-isolation/install.py +9 -5
  251. package/dist/templates/project-isolation/install.test.py +13 -0
  252. package/dist/templates/project-isolation/launcher.py +75 -3
  253. package/dist/templates/project-isolation/launcher.test.py +33 -0
  254. package/package.json +3 -4
  255. package/dist/src/commands/browser/command.d.ts +0 -2
  256. package/dist/src/commands/browser/command.js +0 -42
  257. package/dist/src/commands/browser/command.js.map +0 -1
  258. package/dist/src/commands/browser/smoke.d.ts +0 -10
  259. package/dist/src/commands/browser/smoke.js +0 -67
  260. package/dist/src/commands/browser/smoke.js.map +0 -1
  261. package/dist/src/commands/browser/validators.d.ts +0 -18
  262. package/dist/src/commands/browser/validators.js.map +0 -1
  263. package/dist/src/commands/browser/workflow.d.ts +0 -4
  264. package/dist/src/commands/browser/workflow.js +0 -86
  265. package/dist/src/commands/browser/workflow.js.map +0 -1
  266. /package/dist/src/{commands/browser → agent/runtimes/codex/goals}/validators.js +0 -0
@@ -20,17 +20,21 @@ function readPackageVersion(packageJsonPath) {
20
20
  }
21
21
  return version;
22
22
  }
23
- /** The @useconvoy/cli package version, walking up from this module. */
24
- export function getCliVersion() {
23
+ /** The @useconvoy/cli package folder, walking up from this module. */
24
+ export function cliPackageRoot() {
25
25
  let dir = path.dirname(fileURLToPath(import.meta.url));
26
26
  for (let depth = 0; depth < 5; depth += 1) {
27
- const version = readPackageVersion(path.join(dir, "package.json"));
28
- if (version) {
29
- return version;
27
+ if (readPackageVersion(path.join(dir, "package.json"))) {
28
+ return dir;
30
29
  }
31
30
  dir = path.dirname(dir);
32
31
  }
33
- return "0.0.0";
32
+ return undefined;
33
+ }
34
+ /** The @useconvoy/cli package version. */
35
+ export function getCliVersion() {
36
+ const root = cliPackageRoot();
37
+ return (root && readPackageVersion(path.join(root, "package.json"))) || "0.0.0";
34
38
  }
35
39
  /**
36
40
  * The npm `latest` version if it is newer than the running one, else null.
@@ -38,10 +42,11 @@ export function getCliVersion() {
38
42
  * See docs/specs/cli-update-notice.md.
39
43
  */
40
44
  export async function checkForNewerVersion(timeoutMs = 1500) {
45
+ // AbortSignal.timeout does not keep the process alive; a stalled fetch would exit it (code 13).
46
+ const controller = new AbortController();
47
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
41
48
  try {
42
- const response = await fetch(NPM_LATEST_URL, {
43
- signal: AbortSignal.timeout(timeoutMs),
44
- });
49
+ const response = await fetch(NPM_LATEST_URL, { signal: controller.signal });
45
50
  if (!response.ok) {
46
51
  return null;
47
52
  }
@@ -54,5 +59,8 @@ export async function checkForNewerVersion(timeoutMs = 1500) {
54
59
  catch {
55
60
  return null;
56
61
  }
62
+ finally {
63
+ clearTimeout(timer);
64
+ }
57
65
  }
58
66
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/lib/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,MAAM,cAAc,GAAG,kDAAkD,CAAC;AAE1E,SAAS,kBAAkB,CAAC,eAAuB;IACjD,IAAI,WAAoB,CAAC;IAEzB,IAAI,CAAC;QACH,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,OAA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AAE,CAAC;YAChC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,eAAe,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;IACxE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- FROM node:20
1
+ FROM node:22
2
2
 
3
3
  ARG TZ
4
4
  ENV TZ="$TZ"
@@ -25,16 +25,20 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
25
25
  vim \
26
26
  && apt-get clean && rm -rf /var/lib/apt/lists/*
27
27
 
28
- # Ensure default node user has access to /usr/local/share
28
+ # Keep image tooling root-owned; only global npm installs belong to node.
29
29
  RUN mkdir -p /usr/local/share/npm-global && \
30
- chown -R node:node /usr/local/share
31
-
32
- # Match the Playwright version in apps/cli/package.json. Install before the firewall.
33
- ARG PLAYWRIGHT_VERSION=1.63.0
34
- RUN PLAYWRIGHT_BROWSERS_PATH=/usr/local/share/convoy-browsers \
35
- npx --yes playwright@${PLAYWRIGHT_VERSION} install --with-deps chromium \
36
- && chmod -R a+rX /usr/local/share/convoy-browsers
37
-
30
+ chown -R node:node /usr/local/share/npm-global
31
+
32
+ # Browser tooling belongs to the image, independently of the Convoy package.
33
+ ARG PLAYWRIGHT_CLI_VERSION=0.1.21
34
+ RUN npm install --prefix /usr/local/lib/playwright-cli @playwright/cli@${PLAYWRIGHT_CLI_VERSION} \
35
+ && ln -s /usr/local/lib/playwright-cli/node_modules/.bin/playwright-cli /usr/local/bin/playwright-cli \
36
+ && PLAYWRIGHT_BROWSERS_PATH=/usr/local/share/ms-playwright \
37
+ /usr/local/lib/playwright-cli/node_modules/.bin/playwright install --with-deps chromium \
38
+ && mkdir -p /usr/local/share/playwright-cli \
39
+ && PLAYWRIGHT_BROWSERS_PATH=/usr/local/share/ms-playwright node -e 'const fs=require("node:fs"); const {chromium}=require("/usr/local/lib/playwright-cli/node_modules/playwright"); fs.writeFileSync("/usr/local/share/playwright-cli/config.json", JSON.stringify({browser:{browserName:"chromium",launchOptions:{executablePath:chromium.executablePath(),headless:true,chromiumSandbox:false}}}));' \
40
+ && chmod -R go-w /usr/local/lib/playwright-cli /usr/local/share/playwright-cli /usr/local/share/ms-playwright \
41
+ && chmod -R a+rX /usr/local/share/ms-playwright
38
42
 
39
43
  ARG USERNAME=node
40
44
 
@@ -47,9 +51,13 @@ RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhisto
47
51
  # Set `DEVCONTAINER` environment variable to help with orientation
48
52
  ENV DEVCONTAINER=true
49
53
 
50
- # Create workspace and config directories and set permissions
51
- RUN mkdir -p /workspace /home/node/.claude && \
52
- chown -R node:node /workspace /home/node/.claude
54
+ # Create workspace and config directories and set permissions. Named volumes
55
+ # copy these folders' owner and mode; Convoy refuses config or state wider than 0700.
56
+ # ~/.local must pre-exist owned by node: the ~/.local/share/opencode bind mount
57
+ # otherwise makes Docker create it as root, which breaks the cursor-agent installer.
58
+ RUN mkdir -p /workspace /home/node/.claude /home/node/.local/share /home/node/.local/bin /home/node/.config/convoy /home/node/.convoy && \
59
+ chown -R node:node /workspace /home/node/.claude /home/node/.local /home/node/.config /home/node/.convoy && \
60
+ chmod 700 /home/node/.config/convoy /home/node/.convoy
53
61
 
54
62
  WORKDIR /workspace
55
63
 
@@ -90,11 +98,14 @@ RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/
90
98
  # A `RUN npm install -g ...@latest` layer is cached, so every rebuild reinstates
91
99
  # whatever version the first build happened to fetch. They install from
92
100
  # `postCreateCommand` instead, which Docker never caches. cursor-agent lands in
93
- # ~/.local/bin, hence the PATH entry.
94
- ENV PATH=$PATH:/home/node/.local/bin
101
+ # ~/.local/bin and opencode in ~/.opencode/bin. They go on the image PATH because
102
+ # the project service starts from postStartCommand, which reads no shell rc file.
103
+ ENV PATH=$PATH:/home/node/.local/bin:/home/node/.opencode/bin
95
104
 
96
105
  # Copy and set up the firewall script
97
106
  COPY init-firewall.sh /usr/local/bin/
107
+ # postStartCommand compares this copy with the checkout to flag a stale image.
108
+ COPY Dockerfile /usr/local/share/convoy-devcontainer/Dockerfile
98
109
  USER root
99
110
  # env_keep is load-bearing: sudo's default env_reset strips the vars the firewall
100
111
  # reads, so a strict-mode start (and the manual re-run in README.md) would silently
@@ -102,7 +113,7 @@ USER root
102
113
  RUN chmod +x /usr/local/bin/init-firewall.sh && \
103
114
  printf '%s\n' \
104
115
  'node ALL=(root) NOPASSWD: /usr/local/bin/init-firewall.sh' \
105
- 'Defaults env_keep += "CONVEX_DEPLOYMENT AWS_REGION DEVCONTAINER_EXTRA_ALLOWED_DOMAINS"' \
116
+ 'Defaults env_keep += "CODEX_HOME CONVEX_DEPLOYMENT AWS_REGION DEVCONTAINER_EXTRA_ALLOWED_DOMAINS"' \
106
117
  > /etc/sudoers.d/node-devcontainer && \
107
118
  chmod 0440 /etc/sudoers.d/node-devcontainer
108
119
  USER node
@@ -7,7 +7,8 @@ This is the distributable version of the [Convoy](https://convoy.build) dev cont
7
7
  ## What you get
8
8
 
9
9
  - **Claude Code, Codex CLI, OpenCode CLI, and Cursor CLI** installed globally from `latest` on container create (via `postCreateCommand`, so rebuilds are never stuck on a cached image layer's versions)
10
- - **Agent auth shared with the host** — log in once on the host, the container reuses `~/.codex`, `~/.cursor`, `~/.local/share/opencode`, `~/.config/opencode`, and (optionally) `~/.config/convoy`
10
+ - **Agent auth shared with the host** — log in once on the host, the container reuses `~/.codex`, `~/.cursor`, `~/.local/share/opencode` and `~/.config/opencode`
11
+ - **Its own Convoy environment** — Convoy profiles, keys and the project service live in container volumes, not in the host's `~/.config/convoy`
11
12
  - **Two network modes** — `strict` blocks all outbound traffic except a curated allowlist; `open` skips the firewall
12
13
  - **Persistent shell history and Claude Code config** across container rebuilds (Docker volumes)
13
14
  - zsh + powerlevel10k, fzf, git-delta, gh, jq, corepack (pnpm/yarn via project pin)
@@ -45,7 +46,7 @@ Everything is optional. The container pulls values from your host environment vi
45
46
  | `AWS_BEARER_TOKEN_BEDROCK` | (unset) | Set to use Claude Code via AWS Bedrock |
46
47
  | `CLAUDE_CODE_USE_BEDROCK` | (unset) | Set to `1` to route Claude Code through Bedrock |
47
48
  | `AWS_REGION` | `us-east-1` | AWS region for the Bedrock firewall allowlist entry |
48
- | `CONVEX_DEPLOYMENT` | (unset) | Convoy/Convex deployment slug — adds `$CONVEX_DEPLOYMENT.convex.site` and `.convex.cloud` to the allowlist |
49
+ | `CONVEX_DEPLOYMENT` | (unset) | Convoy/Convex deployment slug — adds `$CONVEX_DEPLOYMENT.convex.site` and `.convex.cloud` to the allowlist. In strict mode, set it before the first `convoy setup` in a new container |
49
50
 
50
51
  Export them in your shell profile (`~/.zshrc` / `~/.bashrc`) **before** the container starts, then rebuild.
51
52
 
@@ -101,7 +102,7 @@ The firewall resolves allowed domains to IPs once at startup. Providers rotate I
101
102
  - **Codex** — shared with the host via `~/.codex`. Run `codex login` on the host; the container reuses `~/.codex/auth.json`.
102
103
  - **OpenCode** — shared with the host via `~/.local/share/opencode` (auth) and `~/.config/opencode` (config). Run `opencode auth login` on the host. Providers other than Anthropic/OpenAI need their API endpoints added to the allowlist in strict mode.
103
104
  - **Cursor CLI** — shared with the host via `~/.cursor`. Run `cursor-agent login` on the host; the container reuses the stored credentials.
104
- - **Convoy CLI** — profiles and API keys shared via `~/.config/convoy`. If you don't use Convoy the mount is harmless (the directory is auto-created empty).
105
+ - **Convoy CLI** — profiles and API keys live in a container volume. Run `convoy setup` inside the container once; see [Convoy connection setup](#convoy-connection-setup).
105
106
 
106
107
  ## Mounted volumes
107
108
 
@@ -113,7 +114,8 @@ The firewall resolves allowed domains to IPs once at startup. Providers rotate I
113
114
  | `~/.cursor/` | `/home/node/.cursor/` | Cursor CLI auth and config (shared with host) |
114
115
  | `~/.local/share/opencode/` | `/home/node/.local/share/opencode/` | OpenCode auth and sessions (shared with host) |
115
116
  | `~/.config/opencode/` | `/home/node/.config/opencode/` | OpenCode configuration (shared with host) |
116
- | `~/.config/convoy/` | `/home/node/.config/convoy/` | Convoy CLI profiles and API keys (optional) |
117
+ | (Docker volume) | `/home/node/.config/convoy` | Convoy CLI profiles, API keys and managed credentials |
118
+ | (Docker volume) | `/home/node/.convoy` | Convoy project service: socket, leases, logs, environment mode |
117
119
 
118
120
  The container's `initializeCommand` creates the host directories automatically if they are missing.
119
121
 
@@ -132,17 +134,99 @@ and run your package manager's install inside the container after the first star
132
134
 
133
135
  ## Browser automation
134
136
 
135
- The image installs Playwright Chromium and OS dependencies before firewall startup.
136
- CLI 0.66.0 adds `convoy browser smoke` and `convoy browser run script.mjs`.
137
- Run them inside the project shell or agent, using `--session <name>` to retain
138
- private login state. No browser debugging port or host browser profile is shared.
139
- Chromium sandboxing defaults on; `--no-browser-sandbox` is an explicit choice
140
- when the outer container/project boundary works but nested browser sandboxing
141
- is unavailable. It does not change the firewall or outer isolation.
142
-
143
- Existing containers need a rebuild or administrator library installation.
144
- For the existing A/B VM, upgrade the root-owned CLI, install
145
- Chromium with the bundled Playwright installer as administrator, and reinstall
146
- the bundled project launcher with the same configuration. Registrations and
147
- credentials remain in place. Full setup, agent examples and acceptance checks:
148
- [Browser automation](https://docs.convoy.build/docs/cli/browser-automation).
137
+ The image preinstalls a pinned upstream `@playwright/cli` release (the Dockerfile's
138
+ `PLAYWRIGHT_CLI_VERSION` build arg), matching Chromium and OS libraries. Use
139
+ `playwright-cli` on PATH, independently of the Convoy CLI.
140
+ The configuration below selects image-installed headless Chromium and explicitly
141
+ disables its inner sandbox inside this dedicated container. Container/project
142
+ isolation and the firewall remain in force. Do not copy this sandbox setting to
143
+ an ordinary host.
144
+
145
+ ```bash
146
+ playwright-cli -s=ui open --config=/usr/local/share/playwright-cli/config.json
147
+ playwright-cli -s=ui goto <url>
148
+ playwright-cli -s=ui set-color-scheme light
149
+ playwright-cli -s=ui screenshot --filename=/tmp/page-light.png
150
+ playwright-cli -s=ui set-color-scheme dark
151
+ playwright-cli -s=ui screenshot --filename=/tmp/page-dark.png
152
+ playwright-cli -s=ui close
153
+ ```
154
+
155
+ Run inside the private project shell or agent when using project isolation.
156
+ Use a unique session name for concurrent work and close that session when done.
157
+ Profiles and session state belong to the invoking project; no host profile is
158
+ imported. Color preference does not override a site's saved theme. Use upstream
159
+ click and scripting commands for application-specific controls.
160
+
161
+ Browser updates require an image rebuild. Updating Convoy does not install or
162
+ update browsers. CLI 0.128.0 removes all `convoy browser` commands; rewrite old
163
+ scripts to use the upstream CLI. Existing profiles are left untouched, without
164
+ automatic migration. A managed environment's legacy browser cache volume is no
165
+ longer mounted and goes away with `environment delete`.
166
+
167
+ ## Convoy connection setup
168
+
169
+ The container installs the Convoy CLI and is its own Convoy environment. It does
170
+ not read the host's `~/.config/convoy`: profiles, keys and project service state
171
+ stay in two container volumes and survive rebuilds. The environment is
172
+ **shared**: every project runs as `node`, with the agent logins above, and
173
+ projects can read each other's files. The container itself is the boundary that
174
+ keeps agents away from your host.
175
+
176
+ Connect this checkout once, inside the container, in one of two ways:
177
+
178
+ ```bash
179
+ # Background: the project service connects it right away and after every restart
180
+ convoy project add /workspace # prompts for backend, key and project
181
+
182
+ # Or foreground: an ordinary profile, connected while `convoy setup` runs
183
+ convoy setup
184
+ ```
185
+
186
+ Use one or the other: `project add` refuses a folder that an ordinary profile
187
+ already covers. Then run `convoy devcontainer --configure` to configure MCP.
188
+
189
+ In strict mode, the firewall must already allow your backend, so export
190
+ `CONVEX_DEPLOYMENT` (or `DEVCONTAINER_EXTRA_ALLOWED_DOMAINS` for a self-hosted
191
+ backend) on the host before the first start. `npx @useconvoy/cli devcontainer`
192
+ prints the value for your profile. After setup, restart the container so the
193
+ firewall also picks up the hosts of the selected profile.
194
+
195
+ Startup configures Convoy MCP in the container's private Codex config and
196
+ allowlists the selected backend. Host Codex settings remain unchanged. Start a
197
+ new agent after changing the profile. Export `CONVOY_PROFILE` on the host only
198
+ when you want to select a profile explicitly. Missing explicit profiles produce
199
+ an actionable error. With no Convoy account, startup prints a hint and the
200
+ container remains usable.
201
+
202
+ ### The project service
203
+
204
+ The project service starts with every container start, after the firewall, even
205
+ before any project is registered. `convoy project add` hands a new project to it,
206
+ so no manual start is needed. If it cannot start, startup prints a `WARN:` line
207
+ and the container still comes up; fix the error and run `convoy service start -b`.
208
+ `convoy service status` and `convoy tui` (under Local) show the registered
209
+ projects. They use the agent logins from [Agent auth](#agent-auth): Codex,
210
+ Cursor and OpenCode reuse the host's, Claude Code logs in inside the container.
211
+ A login applies to every project. The service keeps the container's
212
+ `CODEX_HOME` and `CLAUDE_CONFIG_DIR` but not the Bedrock variables, so for Claude
213
+ Code on Bedrock under the service, store the token as a managed key:
214
+ `convoy keys add work-bedrock --provider bedrock --auth api-key --region us-east-1`,
215
+ then `convoy keys use work-bedrock --profile <profile> --runtime claude-code`. See [Persistent project service](https://docs.convoy.build/docs/cli/project-service)
216
+ for pause, reload, logs and checks. A service that crashes is not restarted until
217
+ the next container start.
218
+
219
+ ### Migrating from the host config mount
220
+
221
+ Containers created from an older template bind-mount the host's `~/.config/convoy`
222
+ and keep it until you install the new template and rebuild:
223
+
224
+ ```bash
225
+ npx @useconvoy/cli devcontainer --force
226
+ ```
227
+
228
+ `--force` overwrites `.devcontainer/`, so reapply your own edits afterwards.
229
+ Then run **Dev Containers: Rebuild Container** and connect the checkout as above. The
230
+ host config and its profiles are untouched; the container no longer sees them.
231
+ Do not add the bind mount back: a container service would then register
232
+ container paths such as `/workspace` in the host's `config.toml`.
@@ -42,11 +42,15 @@
42
42
  "source=${localEnv:HOME}/.cursor,target=/home/node/.cursor,type=bind,consistency=cached",
43
43
  "source=${localEnv:HOME}/.local/share/opencode,target=/home/node/.local/share/opencode,type=bind,consistency=cached",
44
44
  "source=${localEnv:HOME}/.config/opencode,target=/home/node/.config/opencode,type=bind,consistency=cached",
45
- // Optional: Convoy CLI profiles and API keys (harmless if you don't use Convoy)
46
- "source=${localEnv:HOME}/.config/convoy,target=/home/node/.config/convoy,type=bind,consistency=cached"
45
+ // Convoy profiles, keys and service state stay in the container: it is its own shared environment
46
+ "source=agent-sandbox-convoy-config-${devcontainerId},target=/home/node/.config/convoy,type=volume",
47
+ "source=agent-sandbox-convoy-state-${devcontainerId},target=/home/node/.convoy,type=volume"
47
48
  ],
48
49
  "containerEnv": {
49
50
  "DEVCONTAINER_NETWORK_MODE": "${localEnv:DEVCONTAINER_NETWORK_MODE:strict}",
51
+ "CONVOY_PROFILE": "${localEnv:CONVOY_PROFILE}",
52
+ "CONVOY_HOST_WORKSPACE": "${localWorkspaceFolder}",
53
+ "CONVOY_CONTAINER_WORKSPACE": "/workspace",
50
54
  "NODE_OPTIONS": "--max-old-space-size=4096",
51
55
  "CLAUDE_CONFIG_DIR": "/home/node/.claude",
52
56
  "POWERLEVEL9K_DISABLE_GITSTATUS": "true",
@@ -74,19 +78,21 @@
74
78
  },
75
79
  "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=delegated",
76
80
  "workspaceFolder": "/workspace",
77
- "initializeCommand": "mkdir -p \"${localEnv:HOME}/.codex\" \"${localEnv:HOME}/.cursor\" \"${localEnv:HOME}/.local/share/opencode\" \"${localEnv:HOME}/.config/opencode\" \"${localEnv:HOME}/.config/convoy\"",
81
+ "initializeCommand": "mkdir -p \"${localEnv:HOME}/.codex\" \"${localEnv:HOME}/.cursor\" \"${localEnv:HOME}/.local/share/opencode\" \"${localEnv:HOME}/.config/opencode\"",
78
82
  // Agent CLIs install here, not in the Dockerfile: Docker caches a
79
83
  // `RUN npm install -g ...@latest` layer forever, so rebuilds silently keep the
80
84
  // first build's versions. postCreateCommand runs once per container create,
81
85
  // uncached and before the firewall, so it always resolves the real `latest`.
82
86
  // The $CODEX_HOME symlinks are (re)created here because /home/node/.codex-local
83
87
  // lives on the container filesystem and does not survive a rebuild. Only
84
- // state_5.sqlite stays container-private; `sessions` is shared, and Codex
88
+ // state_5.sqlite stays container-private; startup also copies config locally. Codex
85
89
  // falls back to scanning it by thread id when the db has no row, so threads
86
90
  // started on either side remain resumable. `rm -rf` on the sessions path is
87
91
  // load-bearing: `ln -sfn` onto an existing real directory nests the link
88
92
  // inside it (sessions/sessions) instead of replacing it.
89
- "postCreateCommand": "npm install -g @anthropic-ai/claude-code@latest @openai/codex@latest opencode-ai@latest && curl -fsSL https://cursor.com/install | bash && mkdir -p \"$CODEX_HOME\" && rm -rf \"$CODEX_HOME/sessions\" && ln -sfn /home/node/.codex/sessions \"$CODEX_HOME/sessions\" && ln -sfn /home/node/.codex/auth.json \"$CODEX_HOME/auth.json\" && ln -sfn /home/node/.codex/config.toml \"$CODEX_HOME/config.toml\"",
90
- "postStartCommand": "if [ \"$DEVCONTAINER_NETWORK_MODE\" = \"strict\" ]; then sudo /usr/local/bin/init-firewall.sh; else echo \"Skipping firewall setup (DEVCONTAINER_NETWORK_MODE=$DEVCONTAINER_NETWORK_MODE)\"; fi",
93
+ "postCreateCommand": "npm install -g @useconvoy/cli@latest @anthropic-ai/claude-code@latest @openai/codex@latest && curl -fsSL https://opencode.ai/install | bash && curl -fsSL https://cursor.com/install | bash && mkdir -p \"$CODEX_HOME\" && rm -rf \"$CODEX_HOME/sessions\" && ln -sfn /home/node/.codex/sessions \"$CODEX_HOME/sessions\" && ln -sfn /home/node/.codex/auth.json \"$CODEX_HOME/auth.json\" && ln -sfn /home/node/.codex/config.toml \"$CODEX_HOME/config.toml\"",
94
+ // The Convoy project service starts last, once the firewall is up, even with no
95
+ // projects yet: `convoy project add` then connects a new project to it live.
96
+ "postStartCommand": "convoy devcontainer --configure; { cmp -s /usr/local/share/convoy-devcontainer/Dockerfile .devcontainer/Dockerfile && cmp -s /usr/local/bin/init-firewall.sh .devcontainer/init-firewall.sh; } || echo \"WARN: this container's image is older than .devcontainer/. Rebuild the container.\" >&2; if [ \"$DEVCONTAINER_NETWORK_MODE\" = \"strict\" ]; then sudo /usr/local/bin/init-firewall.sh; else echo \"Skipping firewall setup (DEVCONTAINER_NETWORK_MODE=$DEVCONTAINER_NETWORK_MODE)\"; fi; convoy service start -b || echo \"WARN: the Convoy project service did not start. Fix the error above, then run convoy service start -b.\" >&2",
91
97
  "waitFor": "postStartCommand"
92
98
  }
@@ -2,6 +2,17 @@
2
2
  set -euo pipefail # Exit on error, undefined vars, and pipeline failures
3
3
  IFS=$'\n\t' # Stricter word splitting
4
4
 
5
+ # The CLI writes hostnames only; never source a user-writable shell file as root.
6
+ add_convoy_domains() {
7
+ local file="${CODEX_HOME:-}/convoy-domains" domain
8
+ [ -r "$file" ] || return 0
9
+ while IFS= read -r domain; do
10
+ if [[ "$domain" =~ ^[a-zA-Z0-9][a-zA-Z0-9.-]*$ ]]; then
11
+ ALLOWED_DOMAINS+=("$domain")
12
+ fi
13
+ done < "$file"
14
+ }
15
+
5
16
  resolve_ipv4_records() {
6
17
  local domain="$1"
7
18
 
@@ -134,6 +145,8 @@ ALLOWED_DOMAINS=(
134
145
  )
135
146
 
136
147
  # Optional: Convoy/Convex backend (set CONVEX_DEPLOYMENT on the host to enable)
148
+ add_convoy_domains
149
+
137
150
  if [ -n "${CONVEX_DEPLOYMENT:-}" ]; then
138
151
  ALLOWED_DOMAINS+=(
139
152
  "${CONVEX_DEPLOYMENT}.convex.site"
@@ -1,7 +1,7 @@
1
1
  FROM node:22-bookworm
2
2
  ARG CONVOY_VERSION
3
3
  RUN apt-get update && apt-get install -y --no-install-recommends \
4
- python3 bubblewrap sudo git util-linux procps ca-certificates iptables ipset iproute2 dnsutils aggregate jq \
4
+ python3 bubblewrap sudo git gh util-linux procps ca-certificates iptables ipset iproute2 dnsutils aggregate jq \
5
5
  && rm -rf /var/lib/apt/lists/*
6
6
  RUN npm install --prefix /opt/convoy @useconvoy/cli@${CONVOY_VERSION} \
7
7
  && npm install -g @anthropic-ai/claude-code @openai/codex@0.156.1 opencode-ai@1.19.5 \
@@ -19,10 +19,17 @@ RUN case "$(dpkg --print-architecture)" in \
19
19
  && tar --no-same-owner --strip-components=1 -xzf /tmp/cursor-agent.tgz -C /usr/local/lib/cursor-agent \
20
20
  && rm /tmp/cursor-agent.tgz && chmod -R go-w /usr/local/lib/cursor-agent \
21
21
  && ln -s /usr/local/lib/cursor-agent/cursor-agent /usr/local/bin/cursor-agent
22
- # Use the exact browser library shipped with the installed CLI.
23
- RUN PLAYWRIGHT_BROWSERS_PATH=/usr/local/share/convoy-browsers \
24
- /opt/convoy/node_modules/.bin/playwright install --with-deps chromium \
25
- && chmod -R a+rX /usr/local/share/convoy-browsers
22
+ # Browser tooling belongs to the image, independently of the Convoy package.
23
+ ARG PLAYWRIGHT_CLI_VERSION=0.1.21
24
+ RUN npm install --prefix /usr/local/lib/playwright-cli @playwright/cli@${PLAYWRIGHT_CLI_VERSION} \
25
+ && ln -s /usr/local/lib/playwright-cli/node_modules/.bin/playwright-cli /usr/local/bin/playwright-cli \
26
+ && PLAYWRIGHT_BROWSERS_PATH=/usr/local/share/ms-playwright \
27
+ /usr/local/lib/playwright-cli/node_modules/.bin/playwright install --with-deps chromium \
28
+ && mkdir -p /usr/local/share/playwright-cli \
29
+ && PLAYWRIGHT_BROWSERS_PATH=/usr/local/share/ms-playwright node -e 'const fs=require("node:fs"); const {chromium}=require("/usr/local/lib/playwright-cli/node_modules/playwright"); fs.writeFileSync("/usr/local/share/playwright-cli/config.json", JSON.stringify({browser:{browserName:"chromium",launchOptions:{executablePath:chromium.executablePath(),headless:true,chromiumSandbox:false}}}));' \
30
+ && chmod -R go-w /usr/local/lib/playwright-cli /usr/local/share/playwright-cli /usr/local/share/ms-playwright \
31
+ && chmod -R a+rX /usr/local/share/ms-playwright
32
+
26
33
  COPY launcher.py install.py /usr/local/share/convoy-projects/
27
34
  COPY start.sh /usr/local/libexec/convoy-project-start
28
35
  COPY init-firewall.sh /usr/local/bin/init-firewall.sh
@@ -148,20 +148,35 @@ and release when their owner exits.
148
148
 
149
149
  ## Browser automation
150
150
 
151
- The image installs Playwright Chromium and OS dependencies before firewall startup.
152
- CLI 0.66.0 adds `convoy browser smoke` and `convoy browser run script.mjs`.
153
- Run them inside the project shell or agent, using `--session <name>` to retain
154
- private login state. No browser debugging port or host browser profile is shared.
155
- Chromium sandboxing defaults on; `--no-browser-sandbox` is an explicit choice
156
- when the outer container/project boundary works but nested browser sandboxing
157
- is unavailable. It does not change the firewall or outer isolation.
158
-
159
- Existing containers need a rebuild or administrator library installation.
160
- For the existing A/B VM, upgrade the root-owned CLI, install
161
- Chromium with the bundled Playwright installer as administrator, and reinstall
162
- the bundled project launcher with the same configuration. Registrations and
163
- credentials remain in place. Full setup, agent examples and acceptance checks:
164
- [Browser automation](https://docs.convoy.build/docs/cli/browser-automation).
151
+ The image preinstalls a pinned upstream `@playwright/cli` release (the Dockerfile's
152
+ `PLAYWRIGHT_CLI_VERSION` build arg), matching Chromium and OS libraries. Use
153
+ `playwright-cli` on PATH, independently of the Convoy CLI.
154
+ The configuration below selects image-installed headless Chromium and explicitly
155
+ disables its inner sandbox inside this dedicated container. Container/project
156
+ isolation and the firewall remain in force. Do not copy this sandbox setting to
157
+ an ordinary host.
158
+
159
+ ```bash
160
+ playwright-cli -s=ui open --config=/usr/local/share/playwright-cli/config.json
161
+ playwright-cli -s=ui goto <url>
162
+ playwright-cli -s=ui set-color-scheme light
163
+ playwright-cli -s=ui screenshot --filename=/tmp/page-light.png
164
+ playwright-cli -s=ui set-color-scheme dark
165
+ playwright-cli -s=ui screenshot --filename=/tmp/page-dark.png
166
+ playwright-cli -s=ui close
167
+ ```
168
+
169
+ Run inside the private project shell or agent when using project isolation.
170
+ Use a unique session name for concurrent work and close that session when done.
171
+ Profiles and session state belong to the invoking project; no host profile is
172
+ imported. Color preference does not override a site's saved theme. Use upstream
173
+ click and scripting commands for application-specific controls.
174
+
175
+ Browser updates require an image rebuild. Updating Convoy does not install or
176
+ update browsers. CLI 0.128.0 removes all `convoy browser` commands; rewrite old
177
+ scripts to use the upstream CLI. Existing profiles are left untouched, without
178
+ automatic migration. A managed environment's legacy browser cache volume is no
179
+ longer mounted and goes away with `environment delete`.
165
180
 
166
181
  ## Keep registered projects running
167
182
 
@@ -200,7 +215,7 @@ for creating or attaching projects, manual setup keys, and service commands.
200
215
  ## Managed host workflow
201
216
 
202
217
  CLI 0.75.0 adds `convoy run --environment dev` and explicit `--environment` routing
203
- for project, service, attachment and browser smoke commands. It builds this
218
+ for project, service and attachment commands. It builds this
204
219
  bundled template through Docker with labeled Linux volumes, a custom seccomp
205
220
  policy for nested bubblewrap, and a host-only root lifecycle helper. See
206
221
  [Managed local environments](https://docs.convoy.build/docs/cli/managed-environments)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "Convoy projects",
3
- "build": { "dockerfile": "Dockerfile", "args": { "CONVOY_VERSION": "0.120.0" } },
3
+ "build": { "dockerfile": "Dockerfile", "args": { "CONVOY_VERSION": "0.141.0" } },
4
4
  "remoteUser": "node",
5
5
  "updateRemoteUserUID": false,
6
6
  "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind",
@@ -4,6 +4,7 @@ import fcntl
4
4
  import json
5
5
  import os
6
6
  from pathlib import Path
7
+ import pwd
7
8
  import re
8
9
  import shutil
9
10
  import signal
@@ -17,6 +18,13 @@ PACKAGE = ROOT / 'node_modules/@useconvoy/cli'
17
18
  JOURNAL = ROOT / 'update.json'
18
19
  NETWORK = ROOT / 'network.json'
19
20
  CLI = str(PACKAGE / 'dist/bin/convoy.js')
21
+ HOME = Path('/home/node')
22
+ SERVICE = HOME / '.convoy/service'
23
+ IMAGE = Path('/etc/convoy-environment.json')
24
+ MARKER = Path('/run/convoy-initialized')
25
+ BOOT = Path('/proc/1/stat')
26
+ # Mounted host repos often use SSH remotes; the container's gh login covers HTTPS (OS-2251).
27
+ GITCONFIG = '[url "https://github.com/"]\n\tinsteadOf = git@github.com:\n\tinsteadOf = ssh://git@github.com/\n'
20
28
 
21
29
 
22
30
  def run(args, **kwargs):
@@ -47,19 +55,30 @@ def version():
47
55
  return json.loads((PACKAGE / 'package.json').read_text())['version']
48
56
 
49
57
 
58
+ def shared():
59
+ """Images without the record predate OS-2251 and are isolated."""
60
+ return IMAGE.exists() and json.loads(IMAGE.read_text()).get('mode') == 'shared'
61
+
62
+
63
+ def held(path):
64
+ """Whether the CLI lock file at path names a live holder: same PID and start time."""
65
+ try:
66
+ entry = json.loads(path.read_text())
67
+ pid = entry['pid']
68
+ stat = Path(f'/proc/{pid}/stat').read_text()
69
+ except (OSError, ValueError, KeyError, TypeError):
70
+ return False
71
+ start = stat[stat.rindex(')') + 2:].split(' ')[19]
72
+ return not isinstance(entry.get('start'), str) or entry['start'] == start
73
+
74
+
50
75
  def free_lock():
51
- lock = Path('/home/node/.convoy/service/owner.lock')
52
- if not lock.exists():
53
- return True
54
- with lock.open('r') as stream:
55
- try:
56
- fcntl.flock(stream, fcntl.LOCK_EX | fcntl.LOCK_NB)
57
- return True
58
- except BlockingIOError:
59
- return False
76
+ return not held(SERVICE / 'owner.lock')
60
77
 
61
78
 
62
79
  def require_idle_projects():
80
+ if any(held(path) for path in (SERVICE / 'leases').glob('*.lease')):
81
+ raise RuntimeError('A project shell or direct connection is active. Close it before changing the environment.')
63
82
  for path in STATE.glob('*.lease'):
64
83
  with path.open('r') as lease:
65
84
  try:
@@ -82,6 +101,8 @@ def stop():
82
101
 
83
102
 
84
103
  def install():
104
+ if shared():
105
+ return
85
106
  run(['python3', '-I', str(PACKAGE / 'dist/templates/project-isolation/install.py'),
86
107
  '--control-user', 'node', '--workspace', '/workspace', '--package-root', str(PACKAGE)])
87
108
 
@@ -127,15 +148,30 @@ def firewall(domain=None):
127
148
  run(['/usr/local/bin/init-firewall.sh'], env={**os.environ, 'DEVCONTAINER_EXTRA_ALLOWED_DOMAINS': extra})
128
149
 
129
150
 
151
+ def boot():
152
+ """PID 1's start time. It changes with each container start; the marker file survives a restart."""
153
+ stat = BOOT.read_text()
154
+ return stat[stat.rindex(')') + 2:].split()[19]
155
+
156
+
130
157
  def start():
131
- marker = Path('/run/convoy-initialized')
132
- if not marker.exists():
158
+ if not MARKER.exists() or MARKER.read_text() != boot():
133
159
  firewall()
134
- for path in ['/workspace', '/home/node/.config/convoy', '/home/node/.convoy']:
135
- os.chown(path, 1000, 1000)
136
- os.chmod('/home/node/.config/convoy', 0o700)
137
- os.chmod('/home/node/.convoy', 0o700)
138
- marker.touch()
160
+ if shared():
161
+ # One home volume; node may carry the host user's ids (OS-2251).
162
+ account = pwd.getpwnam('node')
163
+ for path in ['/workspace', str(HOME)]:
164
+ os.chown(path, account.pw_uid, account.pw_gid)
165
+ gitconfig = HOME / '.gitconfig'
166
+ if not gitconfig.exists():
167
+ gitconfig.write_text(GITCONFIG)
168
+ os.chown(gitconfig, account.pw_uid, account.pw_gid)
169
+ else:
170
+ for path in ['/workspace', '/home/node/.config/convoy', '/home/node/.convoy']:
171
+ os.chown(path, 1000, 1000)
172
+ os.chmod('/home/node/.config/convoy', 0o700)
173
+ os.chmod('/home/node/.convoy', 0o700)
174
+ MARKER.write_text(boot())
139
175
  recover()
140
176
  install()
141
177
  start_service()
@@ -171,8 +207,6 @@ def update(target, local=False):
171
207
  (ROOT / 'node_modules').rename(backup)
172
208
  (staging / 'node_modules').rename(ROOT / 'node_modules')
173
209
  install()
174
- run([str(ROOT / 'node_modules/.bin/playwright'), 'install', 'chromium'],
175
- env={**os.environ, 'PLAYWRIGHT_BROWSERS_PATH': '/usr/local/share/convoy-browsers', 'PLAYWRIGHT_SKIP_BROWSER_GC': '1'}, timeout=1200)
176
210
  start_service()
177
211
  JOURNAL.unlink()
178
212
  print('Updated service to ' + target, file=sys.stderr)