@codeyam-editor/codeyam-editor 0.1.14-staging.ge9fdd0f → 0.1.15-staging.g8a9ebd4

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 (42) hide show
  1. package/npm/agent-cli-install.js +102 -0
  2. package/npm/cloud.js +273 -142
  3. package/npm/editor.js +23 -0
  4. package/npm/fleet-add-failure.js +53 -2
  5. package/npm/fleet-api-budget.js +21 -8
  6. package/npm/fleet-auth.js +17 -1
  7. package/npm/fleet-dev-server-health.js +86 -0
  8. package/npm/fleet-host-busy.js +52 -0
  9. package/npm/fleet-invoked-by.js +20 -0
  10. package/npm/fleet-queue.js +12 -2
  11. package/npm/fleet-status-refs.js +47 -0
  12. package/npm/google-ingress.js +84 -0
  13. package/npm/launch-config.js +20 -3
  14. package/npm/launcher-boot-log.js +57 -0
  15. package/npm/operator-host-disk.js +44 -0
  16. package/npm/scenario-check.js +854 -27
  17. package/npm/scenario-metrics.js +165 -0
  18. package/npm/scenario-mocks.js +4 -0
  19. package/npm/scenario-playwright.js +386 -11
  20. package/npm/utils.js +142 -21
  21. package/package.json +5 -5
  22. package/ui/dist/assets/{ContainerInspector-DhV9O4qu.js → ContainerInspector-Ceop11Fv.js} +2 -2
  23. package/ui/dist/assets/CyLogo-BIbFVvgW.js +1 -0
  24. package/ui/dist/assets/EditorShell-DTyhLLc8.css +1 -0
  25. package/ui/dist/assets/EditorShell-DjI5cEF_.js +366 -0
  26. package/ui/dist/assets/Markdown-BaLq9qkt.js +1 -0
  27. package/ui/dist/assets/ProjectLauncherScreen-DP25uSQm.js +1 -0
  28. package/ui/dist/assets/ScenarioDataPanel-D-nWT7xD.js +21 -0
  29. package/ui/dist/assets/{ScenarioDataPanelFullPage-DIm-kvtz.js → ScenarioDataPanelFullPage-ZNFZcTQU.js} +1 -1
  30. package/ui/dist/assets/ScenarioRenderer-BW6QLGFW.js +26 -0
  31. package/ui/dist/assets/{StepsSimulator-CymGgfbu.js → StepsSimulator-CcD_CR_X.js} +1 -1
  32. package/ui/dist/assets/index-B3SMxYUB.css +1 -0
  33. package/ui/dist/assets/index-ClrdYzlw.js +27 -0
  34. package/ui/dist/index.html +2 -2
  35. package/ui/dist/assets/EditorShell-LcMPxnNk.js +0 -286
  36. package/ui/dist/assets/EditorShell-lndJDLqT.css +0 -1
  37. package/ui/dist/assets/Markdown-Chgdf3PW.js +0 -1
  38. package/ui/dist/assets/ProjectLauncherScreen-E0NYYiwy.js +0 -1
  39. package/ui/dist/assets/ScenarioDataPanel-DSW29BTV.js +0 -21
  40. package/ui/dist/assets/ScenarioRenderer-DDT3dneh.js +0 -26
  41. package/ui/dist/assets/index-4TZsSjHA.css +0 -1
  42. package/ui/dist/assets/index-BDc44VP_.js +0 -27
@@ -0,0 +1,102 @@
1
+ 'use strict';
2
+ // How each build agent's CLI gets installed on a fleet VM, and the in-container
3
+ // install script that does it. Pure — no I/O; npm/cloud.js runs the script over
4
+ // SSH (ensureAgentCliInstalled) and owns the gates around it. Split out of
5
+ // cloud.js so the install dimension is one concern with one test file.
6
+ //
7
+ // Two install kinds, mirroring the Rust `CliInstall::{Npm, Script}` split in
8
+ // BuildAgentProvider::cli_spec() (crates/types/src/config/harness.rs):
9
+ // npm — a global npm package (claude, codex, gemini)
10
+ // script — the agent's own install command, run verbatim (muse)
11
+
12
+ // Muse is not on npm: it installs through Meta's curl launcher into
13
+ // `~/.local/bin`. Mirrors `MUSE_INSTALL_COMMAND` in
14
+ // crates/types/src/config/harness.rs (the spike-verified command — the launcher
15
+ // download answers unauthenticated, so a VM needs no sign-in to install).
16
+ // Cross-reference: keep the two strings identical.
17
+ const MUSE_INSTALL_COMMAND =
18
+ 'mkdir -p "$HOME/.local/bin" && curl -fsSL https://api.meta.ai/muse-launcher.sh -o "$HOME/.local/bin/muse" && chmod +x "$HOME/.local/bin/muse" && MUSE_LAUNCHER_INSTALL=1 "$HOME/.local/bin/muse"';
19
+
20
+ const AGENT_CLI_INSTALLS = {
21
+ claude: { kind: "npm", package: "@anthropic-ai/claude-code" },
22
+ codex: { kind: "npm", package: "@openai/codex" },
23
+ gemini: { kind: "npm", package: "@google/gemini-cli" },
24
+ muse: { kind: "script", command: MUSE_INSTALL_COMMAND },
25
+ };
26
+
27
+ /** Map an agent name to how its CLI is installed — `{ kind: "npm", package }`
28
+ * or `{ kind: "script", command }`. Throws on unknown agents so adding an
29
+ * agent is a one-entry change in `AGENT_CLI_INSTALLS`. */
30
+ function agentCliInstall(agent) {
31
+ if (!Object.prototype.hasOwnProperty.call(AGENT_CLI_INSTALLS, agent)) {
32
+ throw new Error(
33
+ `Unknown agent: ${agent}. Supported: ${Object.keys(AGENT_CLI_INSTALLS).join(", ")}`,
34
+ );
35
+ }
36
+ return AGENT_CLI_INSTALLS[agent];
37
+ }
38
+
39
+ /** The bash script that installs `agent`'s CLI inside the editor container,
40
+ * dispatched on its install kind (see `agentCliInstall`). Pure — returns the
41
+ * script text. Both kinds short-circuit when the binary already resolves. A
42
+ * script install must end with a binary that runs and reports a version, so a
43
+ * launcher that downloaded but cannot execute fails provisioning loudly (with
44
+ * the install output attached by runFatalSshStep) instead of rostering a VM
45
+ * whose CLI was never usable. */
46
+ function buildAgentCliInstallScript(agent, install) {
47
+ const header = [
48
+ "#!/usr/bin/env bash",
49
+ "set -euo pipefail",
50
+ `BINARY="${agent}"`,
51
+ "",
52
+ ];
53
+ if (install.kind === "script") {
54
+ return [
55
+ ...header,
56
+ "if command -v \"$BINARY\" >/dev/null 2>&1 || [ -x \"$HOME/.local/bin/$BINARY\" ]; then",
57
+ " echo \" ✓ $BINARY already installed\"",
58
+ " exit 0",
59
+ "fi",
60
+ "",
61
+ "echo \"Installing $BINARY via its install script in container...\"",
62
+ install.command,
63
+ "RESOLVED=$(command -v \"$BINARY\" 2>/dev/null || echo \"$HOME/.local/bin/$BINARY\")",
64
+ "if [ ! -x \"$RESOLVED\" ]; then",
65
+ " echo \" ✗ $BINARY install script finished but no $BINARY binary was found (looked on PATH and in $HOME/.local/bin)\" >&2",
66
+ " exit 1",
67
+ "fi",
68
+ "\"$RESOLVED\" --version",
69
+ "echo \" ✓ Successfully installed $BINARY at $RESOLVED\"",
70
+ ].join("\n");
71
+ }
72
+ return [
73
+ ...header,
74
+ `PACKAGE="${install.package}"`,
75
+ `AGENT="${agent}"`,
76
+ "",
77
+ "if command -v \"$BINARY\" >/dev/null 2>&1; then",
78
+ " echo \" ✓ $BINARY already installed on PATH\"",
79
+ " exit 0",
80
+ "fi",
81
+ "",
82
+ "echo \"Installing $PACKAGE globally in container...\"",
83
+ "if [ \"$AGENT\" = \"claude\" ]; then",
84
+ " rm -rf /usr/lib/node_modules/@anthropic-ai/.claude-code-*",
85
+ " npm install -g \"$PACKAGE\"",
86
+ " RESOLVED=$(find /usr/lib/node_modules/@anthropic-ai -name claude -type f -path '*linux-x64*' 2>/dev/null | head -1)",
87
+ " if [ -n \"$RESOLVED\" ]; then",
88
+ " ln -sf \"$RESOLVED\" /usr/local/bin/claude",
89
+ " fi",
90
+ "else",
91
+ " npm install -g \"$PACKAGE\"",
92
+ "fi",
93
+ "echo \" ✓ Successfully installed $BINARY\"",
94
+ ].join("\n");
95
+ }
96
+
97
+ module.exports = {
98
+ MUSE_INSTALL_COMMAND,
99
+ AGENT_CLI_INSTALLS,
100
+ agentCliInstall,
101
+ buildAgentCliInstallScript,
102
+ };