@arkhera30/cli 0.3.2 → 0.3.4

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 (2) hide show
  1. package/dist/index.js +45 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2854,11 +2854,46 @@ function removeSlotDirs(slotDataPath) {
2854
2854
  rmSync(slotDataPath, { recursive: true, force: true });
2855
2855
  }
2856
2856
  }
2857
+ async function preSeedNotesDir(dataDir, slotDataPath) {
2858
+ const srcNotesPath = join7(dataDir, "notes");
2859
+ const destNotesPath = join7(slotDataPath, "notes");
2860
+ if (existsSync9(join7(srcNotesPath, ".git"))) {
2861
+ if (existsSync9(destNotesPath)) {
2862
+ rmSync(destNotesPath, { recursive: true });
2863
+ }
2864
+ await execa3("git", ["clone", "--local", srcNotesPath, destNotesPath]);
2865
+ } else {
2866
+ await execa3("git", ["-C", destNotesPath, "init"]);
2867
+ await execa3("git", [
2868
+ "-C",
2869
+ destNotesPath,
2870
+ "-c",
2871
+ "user.email=horus@local",
2872
+ "-c",
2873
+ "user.name=Horus",
2874
+ "commit",
2875
+ "--allow-empty",
2876
+ "-m",
2877
+ "init"
2878
+ ]);
2879
+ }
2880
+ }
2857
2881
  function buildComposeEnv(runtime, ports, slotDataPath) {
2858
2882
  return {
2859
2883
  ...process.env,
2860
2884
  HORUS_RUNTIME: runtime.name,
2861
2885
  TEST_DATA_PATH: slotDataPath,
2886
+ // Override base compose port variables so the base file binds to test ports.
2887
+ // Without these, Docker Compose merges (appends) the ports lists from both
2888
+ // files, causing both the production port (e.g. 8100) and the test port
2889
+ // (e.g. 9100) to be bound — failing if the production stack is already up.
2890
+ ANVIL_PORT: String(ports.anvil),
2891
+ FORGE_PORT: String(ports.forge),
2892
+ VAULT_MCP_PORT: String(ports.vault_mcp),
2893
+ VAULT_ROUTER_PORT: String(ports.vault_router),
2894
+ VAULT_REST_PORT_PERSONAL: String(ports.vault_svc),
2895
+ TYPESENSE_PORT: String(ports.typesense),
2896
+ // TEST_PORT_* vars for overlay reference (harmless duplicates after above fix)
2862
2897
  TEST_PORT_ANVIL: String(ports.anvil),
2863
2898
  TEST_PORT_TYPESENSE: String(ports.typesense),
2864
2899
  TEST_PORT_VAULT_SVC: String(ports.vault_svc),
@@ -3003,6 +3038,16 @@ testEnvCommand.command("acquire").description("Start a shadow stack on alternate
3003
3038
  const dirSpinner = ora8(`Creating slot-${slot} data directories...`).start();
3004
3039
  createSlotDirs(slotDataPath);
3005
3040
  dirSpinner.succeed(`Data directory: ${chalk10.dim(slotDataPath)}`);
3041
+ const seedSpinner = ora8("Pre-seeding notes directory...").start();
3042
+ try {
3043
+ await preSeedNotesDir(dataDir, slotDataPath);
3044
+ seedSpinner.succeed("Notes directory ready");
3045
+ } catch (error) {
3046
+ seedSpinner.fail(`Notes pre-seed failed: ${error.message}`);
3047
+ removeLock(dataDir, slot);
3048
+ removeSlotDirs(slotDataPath);
3049
+ process.exit(1);
3050
+ }
3006
3051
  writeLock(dataDir, {
3007
3052
  slot,
3008
3053
  pid: process.pid,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkhera30/cli",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "CLI for managing the Horus AI development stack",
5
5
  "type": "module",
6
6
  "bin": {