@codeyam-editor/codeyam-editor 0.1.1 → 0.1.3

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 (53) hide show
  1. package/npm/cli.js +5 -2
  2. package/npm/cloud-branch-switch.js +442 -0
  3. package/npm/cloud.js +1929 -0
  4. package/npm/container.js +22 -3
  5. package/npm/editor-dev.js +368 -37
  6. package/npm/editor.js +133 -52
  7. package/npm/empty-project-dir.js +33 -0
  8. package/npm/fleet-auth.js +111 -0
  9. package/npm/fleet-branch.js +49 -0
  10. package/npm/fleet-broker-death.js +44 -0
  11. package/npm/fleet-broker-debounce.js +63 -0
  12. package/npm/fleet-broker-status.js +45 -0
  13. package/npm/fleet-cleanup.js +297 -0
  14. package/npm/fleet-effect-status.js +179 -0
  15. package/npm/fleet-env.js +125 -0
  16. package/npm/fleet-grouping.js +56 -0
  17. package/npm/fleet-job-badge.js +39 -0
  18. package/npm/fleet-memory.js +157 -0
  19. package/npm/fleet-pool-policy.js +78 -0
  20. package/npm/fleet-pool.js +401 -0
  21. package/npm/fleet-queue.js +40 -0
  22. package/npm/fleet-reconcile.js +36 -0
  23. package/npm/fleet-reset.js +222 -0
  24. package/npm/fleet-roster.js +81 -0
  25. package/npm/launch-config.js +622 -0
  26. package/npm/preflight-guidance.js +77 -0
  27. package/npm/scenario-check.js +323 -14
  28. package/npm/scenario-handlers.js +16 -5
  29. package/npm/scenario-interactivity.js +245 -0
  30. package/npm/scenario-metrics.js +16 -2
  31. package/npm/scenario-mocks.js +62 -25
  32. package/npm/scenario-playwright.js +350 -8
  33. package/npm/utils.js +562 -22
  34. package/npm/vm-urls.js +117 -0
  35. package/package.json +8 -7
  36. package/ui/dist/assets/ContainerInspector-C8EkH4PP.js +2 -0
  37. package/ui/dist/assets/EditorShell-CGsBSA6u.js +186 -0
  38. package/ui/dist/assets/Markdown-BHBqz-Mj.js +1 -0
  39. package/ui/dist/assets/ScenarioDataPanel-DYP7pi_n.css +32 -0
  40. package/ui/dist/assets/ScenarioDataPanel-nuLXJzLf.js +5 -0
  41. package/ui/dist/assets/ScenarioDataPanelFullPage-Bnghtj8a.js +1 -0
  42. package/ui/dist/assets/ScenarioRenderer-B_Za9jL8.js +1 -0
  43. package/ui/dist/assets/StepsSimulator-CRtmlyNZ.js +1 -0
  44. package/ui/dist/assets/index-Bih6HJ_u.css +1 -0
  45. package/ui/dist/assets/index-KDFAgt2e.js +27 -0
  46. package/ui/dist/assets/markdown-v0F0UEt3.js +37 -0
  47. package/ui/dist/assets/react-CSS0HapR.js +28 -0
  48. package/ui/dist/assets/useEvents-DggWrtHe.js +1 -0
  49. package/ui/dist/assets/xterm--24IGk-x.js +9 -0
  50. package/ui/dist/favicon.ico +0 -0
  51. package/ui/dist/favicon.png +0 -0
  52. package/ui/dist/index.html +16 -0
  53. package/npm/postinstall.js +0 -132
Binary file
Binary file
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>CodeYam</title>
7
+ <link rel="icon" type="image/x-icon" href="/favicon.ico" />
8
+ <script type="module" crossorigin src="/assets/index-KDFAgt2e.js"></script>
9
+ <link rel="modulepreload" crossorigin href="/assets/react-CSS0HapR.js">
10
+ <link rel="modulepreload" crossorigin href="/assets/markdown-v0F0UEt3.js">
11
+ <link rel="stylesheet" crossorigin href="/assets/index-Bih6HJ_u.css">
12
+ </head>
13
+ <body>
14
+ <div id="root"></div>
15
+ </body>
16
+ </html>
@@ -1,132 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Post-install script for @codeyam-editor/codeyam-editor.
5
- *
6
- * Downloads the pre-built platform binary and UI assets from GitHub Releases.
7
- * Skipped when running in local development (cargo builds from source instead).
8
- *
9
- * Cross-platform: uses Node-native `fetch` + the `tar` npm package to download
10
- * and extract. Avoids depending on `curl` / `tar` system binaries — those exist
11
- * on macOS and Linux but not on a default Windows install, and the previous
12
- * `curl | tar xz` shell pipe was the original Windows-install blocker.
13
- */
14
-
15
- const fs = require("fs");
16
- const path = require("path");
17
- const { Readable } = require("stream");
18
- const tar = require("tar");
19
-
20
- const rootDir = path.resolve(__dirname, "..");
21
-
22
- const PLATFORM_MAP = {
23
- "darwin-arm64": "codeyam-editor-darwin-arm64",
24
- "darwin-x64": "codeyam-editor-darwin-x64",
25
- "linux-x64": "codeyam-editor-linux-x64",
26
- "win32-x64": "codeyam-editor-win32-x64",
27
- };
28
-
29
- function binaryName() {
30
- return process.platform === "win32"
31
- ? "codeyam-editor.exe"
32
- : "codeyam-editor";
33
- }
34
-
35
- function getArtifactName() {
36
- const key = `${process.platform}-${process.arch}`;
37
- const name = PLATFORM_MAP[key];
38
- if (!name) {
39
- console.error(
40
- `codeyam-editor: unsupported platform ${process.platform} ${process.arch}`
41
- );
42
- console.error("Supported: macOS (arm64, x64), Linux (x64), Windows (x64)");
43
- console.error(
44
- "You can build from source instead: cargo build --release"
45
- );
46
- process.exit(0); // Don't fail the install — user may be building from source
47
- }
48
- return name;
49
- }
50
-
51
- /**
52
- * Determine the GitHub release tag from the installed package version.
53
- *
54
- * - "0.1.0-staging.abc1234" -> "staging"
55
- * - "0.1.2" -> "latest"
56
- */
57
- function getReleaseTag() {
58
- const pkg = JSON.parse(
59
- fs.readFileSync(path.join(rootDir, "package.json"), "utf8")
60
- );
61
- const version = pkg.version || "0.1.0";
62
- if (version.includes("-staging")) return "staging";
63
- return "latest";
64
- }
65
-
66
- async function downloadAndExtract(url, dest) {
67
- const res = await fetch(url);
68
- if (!res.ok) {
69
- throw new Error(`HTTP ${res.status} ${res.statusText}`);
70
- }
71
- await new Promise((resolve, reject) => {
72
- Readable.fromWeb(res.body)
73
- .pipe(tar.x({ cwd: dest }))
74
- .on("finish", resolve)
75
- .on("error", reject);
76
- });
77
- }
78
-
79
- async function download() {
80
- // Skip if a binary already exists (e.g. local dev with cargo build)
81
- const binPath = path.join(rootDir, "bin", binaryName());
82
- if (fs.existsSync(binPath)) {
83
- return;
84
- }
85
-
86
- // Skip if we're in a dev checkout (has Cargo.toml at root)
87
- if (fs.existsSync(path.join(rootDir, "Cargo.toml"))) {
88
- return;
89
- }
90
-
91
- const artifactName = getArtifactName();
92
- const tag = getReleaseTag();
93
- const url = `https://github.com/codeyam-ai/codeyam-editor/releases/download/${tag}/${artifactName}.tar.gz`;
94
-
95
- console.error(`Downloading codeyam-editor binary (${artifactName})...`);
96
-
97
- const binDir = path.join(rootDir, "bin");
98
- const uiDir = path.join(rootDir, "ui");
99
- fs.mkdirSync(binDir, { recursive: true });
100
- fs.mkdirSync(uiDir, { recursive: true });
101
-
102
- try {
103
- await downloadAndExtract(url, rootDir);
104
-
105
- // Ensure binary is executable. No-op on Windows but harmless.
106
- if (fs.existsSync(binPath)) {
107
- fs.chmodSync(binPath, 0o755);
108
- }
109
-
110
- console.error("codeyam-editor installed successfully!");
111
- } catch (err) {
112
- console.error(`Failed to download codeyam-editor binary from ${url}`);
113
- console.error(` Reason: ${err.message}`);
114
- console.error(
115
- "You can build from source instead: cargo build --release"
116
- );
117
- // Don't fail the install — user may want to build from source
118
- }
119
- }
120
-
121
- module.exports = {
122
- PLATFORM_MAP,
123
- binaryName,
124
- getArtifactName,
125
- getReleaseTag,
126
- downloadAndExtract,
127
- download,
128
- };
129
-
130
- if (require.main === module) {
131
- download();
132
- }