rackmind-cli 0.1.6 → 0.2.1

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 (122) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +62 -176
  3. package/bin/rackmind.js +5 -1
  4. package/dist/ai/providers/anthropic-provider.d.ts +4 -0
  5. package/dist/ai/providers/anthropic-provider.d.ts.map +1 -1
  6. package/dist/ai/providers/anthropic-provider.js +17 -4
  7. package/dist/ai/providers/anthropic-provider.js.map +1 -1
  8. package/dist/ai/providers/base.d.ts +15 -0
  9. package/dist/ai/providers/base.d.ts.map +1 -1
  10. package/dist/ai/providers/claude-code-bridge.d.ts +7 -0
  11. package/dist/ai/providers/claude-code-bridge.d.ts.map +1 -1
  12. package/dist/ai/providers/claude-code-bridge.js +1 -1
  13. package/dist/ai/providers/claude-code-bridge.js.map +1 -1
  14. package/dist/ai/providers/claude-code-provider.d.ts.map +1 -1
  15. package/dist/ai/providers/claude-code-provider.js +1 -0
  16. package/dist/ai/providers/claude-code-provider.js.map +1 -1
  17. package/dist/ai/providers/index.d.ts +1 -1
  18. package/dist/ai/providers/index.d.ts.map +1 -1
  19. package/dist/ai/providers/index.js.map +1 -1
  20. package/dist/ai/system-prompt.d.ts.map +1 -1
  21. package/dist/ai/system-prompt.js +1 -26
  22. package/dist/ai/system-prompt.js.map +1 -1
  23. package/dist/ai/tool-executor.d.ts +39 -1
  24. package/dist/ai/tool-executor.d.ts.map +1 -1
  25. package/dist/ai/tool-executor.js +157 -2
  26. package/dist/ai/tool-executor.js.map +1 -1
  27. package/dist/commands/auth.d.ts.map +1 -1
  28. package/dist/commands/auth.js +21 -15
  29. package/dist/commands/auth.js.map +1 -1
  30. package/dist/commands/config.d.ts.map +1 -1
  31. package/dist/commands/config.js +37 -7
  32. package/dist/commands/config.js.map +1 -1
  33. package/dist/commands/containers.d.ts.map +1 -1
  34. package/dist/commands/containers.js +10 -3
  35. package/dist/commands/containers.js.map +1 -1
  36. package/dist/commands/exec.d.ts.map +1 -1
  37. package/dist/commands/exec.js +19 -7
  38. package/dist/commands/exec.js.map +1 -1
  39. package/dist/commands/lifecycle.d.ts.map +1 -1
  40. package/dist/commands/lifecycle.js +133 -105
  41. package/dist/commands/lifecycle.js.map +1 -1
  42. package/dist/commands/logs.d.ts.map +1 -1
  43. package/dist/commands/logs.js +10 -4
  44. package/dist/commands/logs.js.map +1 -1
  45. package/dist/commands/report.d.ts.map +1 -1
  46. package/dist/commands/report.js +20 -12
  47. package/dist/commands/report.js.map +1 -1
  48. package/dist/commands/servers.d.ts.map +1 -1
  49. package/dist/commands/servers.js +29 -2
  50. package/dist/commands/servers.js.map +1 -1
  51. package/dist/commands/status.d.ts +5 -0
  52. package/dist/commands/status.d.ts.map +1 -1
  53. package/dist/commands/status.js +118 -51
  54. package/dist/commands/status.js.map +1 -1
  55. package/dist/commands/vms.d.ts.map +1 -1
  56. package/dist/commands/vms.js +9 -3
  57. package/dist/commands/vms.js.map +1 -1
  58. package/dist/config/crypto.d.ts +10 -0
  59. package/dist/config/crypto.d.ts.map +1 -1
  60. package/dist/config/crypto.js +47 -2
  61. package/dist/config/crypto.js.map +1 -1
  62. package/dist/config/index.d.ts +51 -0
  63. package/dist/config/index.d.ts.map +1 -1
  64. package/dist/config/index.js +161 -17
  65. package/dist/config/index.js.map +1 -1
  66. package/dist/globals.d.ts +21 -3
  67. package/dist/globals.d.ts.map +1 -1
  68. package/dist/globals.js +30 -4
  69. package/dist/globals.js.map +1 -1
  70. package/dist/index.js +48 -7
  71. package/dist/index.js.map +1 -1
  72. package/dist/interactive/App.d.ts.map +1 -1
  73. package/dist/interactive/App.js +11 -5
  74. package/dist/interactive/App.js.map +1 -1
  75. package/dist/interactive/components/ConfirmDialog.d.ts +9 -0
  76. package/dist/interactive/components/ConfirmDialog.d.ts.map +1 -0
  77. package/dist/interactive/components/ConfirmDialog.js +26 -0
  78. package/dist/interactive/components/ConfirmDialog.js.map +1 -0
  79. package/dist/interactive/components/InputBar.d.ts.map +1 -1
  80. package/dist/interactive/components/InputBar.js +10 -1
  81. package/dist/interactive/components/InputBar.js.map +1 -1
  82. package/dist/interactive/launch.d.ts +5 -0
  83. package/dist/interactive/launch.d.ts.map +1 -1
  84. package/dist/interactive/launch.js +16 -0
  85. package/dist/interactive/launch.js.map +1 -1
  86. package/dist/interactive/slashCommands.d.ts +1 -0
  87. package/dist/interactive/slashCommands.d.ts.map +1 -1
  88. package/dist/interactive/slashCommands.js +13 -0
  89. package/dist/interactive/slashCommands.js.map +1 -1
  90. package/dist/interactive/useRackMind.d.ts +9 -1
  91. package/dist/interactive/useRackMind.d.ts.map +1 -1
  92. package/dist/interactive/useRackMind.js +83 -4
  93. package/dist/interactive/useRackMind.js.map +1 -1
  94. package/dist/oneshot/run.d.ts.map +1 -1
  95. package/dist/oneshot/run.js +51 -9
  96. package/dist/oneshot/run.js.map +1 -1
  97. package/dist/server/client.d.ts +4 -2
  98. package/dist/server/client.d.ts.map +1 -1
  99. package/dist/server/client.js +6 -4
  100. package/dist/server/client.js.map +1 -1
  101. package/dist/server/ssh.d.ts.map +1 -1
  102. package/dist/server/ssh.js +1 -1
  103. package/dist/server/ssh.js.map +1 -1
  104. package/dist/utils/command-safety.d.ts.map +1 -1
  105. package/dist/utils/command-safety.js +157 -5
  106. package/dist/utils/command-safety.js.map +1 -1
  107. package/dist/utils/logger.d.ts +20 -0
  108. package/dist/utils/logger.d.ts.map +1 -1
  109. package/dist/utils/logger.js +68 -1
  110. package/dist/utils/logger.js.map +1 -1
  111. package/dist/utils/prompt.d.ts.map +1 -1
  112. package/dist/utils/prompt.js +4 -1
  113. package/dist/utils/prompt.js.map +1 -1
  114. package/dist/utils/table.d.ts +3 -0
  115. package/dist/utils/table.d.ts.map +1 -1
  116. package/dist/utils/table.js +4 -1
  117. package/dist/utils/table.js.map +1 -1
  118. package/package.json +45 -12
  119. package/dist/ai/client.d.ts +0 -71
  120. package/dist/ai/client.d.ts.map +0 -1
  121. package/dist/ai/client.js +0 -198
  122. package/dist/ai/client.js.map +0 -1
@@ -1,3 +1,13 @@
1
+ /**
2
+ * Thrown when decryption fails with an integrity error that strongly suggests
3
+ * the ciphertext was produced on a different machine (different hostname or
4
+ * username, so the machine-derived key doesn't match). The most common cause
5
+ * is restoring `config.json` from a backup made on another computer.
6
+ */
7
+ export declare class MachineKeyMismatchError extends Error {
8
+ readonly cause?: unknown;
9
+ constructor(cause?: unknown);
10
+ }
1
11
  /**
2
12
  * Encrypt a plaintext string. Returns a hex-encoded string containing
3
13
  * the IV, auth tag, and ciphertext: `iv:authTag:ciphertext`
@@ -1 +1 @@
1
- {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/config/crypto.ts"],"names":[],"mappings":"AA0BA;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAWjD;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAwBjD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAMlD"}
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/config/crypto.ts"],"names":[],"mappings":"AAiBA;;;;;GAKG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAC9C,SAAgB,KAAK,CAAC,EAAE,OAAO,CAAC;gBAEpB,KAAK,CAAC,EAAE,OAAO;CAQ9B;AA+BD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAWjD;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAmCjD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAMlD"}
@@ -12,6 +12,39 @@ const ALGORITHM = 'aes-256-gcm';
12
12
  const IV_LENGTH = 16;
13
13
  const AUTH_TAG_LENGTH = 16;
14
14
  const KEY_SALT = 'rackmind-cli-v1';
15
+ /**
16
+ * Thrown when decryption fails with an integrity error that strongly suggests
17
+ * the ciphertext was produced on a different machine (different hostname or
18
+ * username, so the machine-derived key doesn't match). The most common cause
19
+ * is restoring `config.json` from a backup made on another computer.
20
+ */
21
+ export class MachineKeyMismatchError extends Error {
22
+ cause;
23
+ constructor(cause) {
24
+ super("Credentials in your config were encrypted on a different machine and can't be decrypted here. " +
25
+ 'Run `rackmind connect <alias>` to re-enter them, or restore from a backup made on this machine.');
26
+ this.name = 'MachineKeyMismatchError';
27
+ this.cause = cause;
28
+ }
29
+ }
30
+ /**
31
+ * Heuristic: does this Node `crypto` error look like an AES-GCM integrity
32
+ * failure caused by the wrong key/IV? Node throws an ERR_OSSL_BAD_DECRYPT
33
+ * or "Unsupported state or unable to authenticate data" — both indicate
34
+ * that the auth tag didn't validate, which is exactly what we get when the
35
+ * key was derived on a different machine.
36
+ */
37
+ function looksLikeAuthFailure(err) {
38
+ if (!(err instanceof Error))
39
+ return false;
40
+ const msg = err.message.toLowerCase();
41
+ const code = err.code;
42
+ return (msg.includes('unable to authenticate data') ||
43
+ msg.includes('unsupported state') ||
44
+ msg.includes('bad decrypt') ||
45
+ code === 'ERR_OSSL_BAD_DECRYPT' ||
46
+ code === 'ERR_CRYPTO_INVALID_AUTH_TAG');
47
+ }
15
48
  /**
16
49
  * Derive a 32-byte encryption key from machine-specific values.
17
50
  * Uses SHA-256(hostname + username + salt) to produce a deterministic key.
@@ -60,8 +93,20 @@ export function decrypt(encrypted) {
60
93
  }
61
94
  const decipher = createDecipheriv(ALGORITHM, key, iv);
62
95
  decipher.setAuthTag(authTag);
63
- const decrypted = Buffer.concat([decipher.update(ciphertext), decipher.final()]);
64
- return decrypted.toString('utf8');
96
+ try {
97
+ const decrypted = Buffer.concat([decipher.update(ciphertext), decipher.final()]);
98
+ return decrypted.toString('utf8');
99
+ }
100
+ catch (err) {
101
+ // AES-GCM auth-tag mismatch with a structurally valid ciphertext is the
102
+ // signature of a wrong key — overwhelmingly, that means this config was
103
+ // restored from a backup made on a different host. Surface a friendly
104
+ // diagnostic rather than the raw OpenSSL string.
105
+ if (looksLikeAuthFailure(err)) {
106
+ throw new MachineKeyMismatchError(err);
107
+ }
108
+ throw err;
109
+ }
65
110
  }
66
111
  /**
67
112
  * Test whether a string looks like an encrypted value (iv:authTag:ciphertext).
@@ -1 +1 @@
1
- {"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/config/crypto.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,+DAA+D;AAC/D,8EAA8E;AAC9E,4EAA4E;AAC5E,2EAA2E;AAC3E,2EAA2E;AAC3E,0EAA0E;AAC1E,8EAA8E;AAE9E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,MAAM,SAAS,GAAG,aAAa,CAAC;AAChC,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,QAAQ,GAAG,iBAAiB,CAAC;AAEnC;;;GAGG;AACH,SAAS,SAAS;IACd,MAAM,QAAQ,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7E,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;AAC1D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,SAAiB;IACrC,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAE1B,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;IACxB,MAAM,EAAE,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IACl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IACtD,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAE7B,IAAI,CAAC;QACD,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACjF,OAAO,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,wEAAwE;QACxE,wEAAwE;QACxE,sEAAsE;QACtE,iDAAiD;QACjD,IAAI,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,uBAAuB,CAAC,GAAG,CAAC,CAAC;QAC3C,CAAC;QACD,MAAM,GAAG,CAAC;IACd,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACrC,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACrC,gCAAgC;IAChC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC"}
@@ -1,11 +1,61 @@
1
1
  import { type RackMindConfig, type ServerProfile } from './types.js';
2
+ /**
3
+ * Thrown when ~/.config/rackmind/config.json exists but cannot be parsed
4
+ * (malformed JSON) or fails schema validation. Callers MUST surface this
5
+ * rather than silently returning defaults — otherwise the next `writeConfig`
6
+ * will overwrite the user's real profile data with an empty default.
7
+ */
8
+ export declare class CorruptConfigError extends Error {
9
+ /** Original path of the corrupted file. */
10
+ readonly originalPath: string;
11
+ /** Path the corrupted file was renamed to (if quarantine succeeded). */
12
+ readonly quarantinePath: string | null;
13
+ /** Why the file was rejected. */
14
+ readonly reason: 'parse-error' | 'validation-error' | 'unreadable';
15
+ readonly cause?: unknown;
16
+ constructor(opts: {
17
+ originalPath: string;
18
+ quarantinePath: string | null;
19
+ reason: 'parse-error' | 'validation-error' | 'unreadable';
20
+ details: string;
21
+ cause?: unknown;
22
+ });
23
+ }
2
24
  export declare function getConfigDir(): string;
3
25
  export declare function getConfigPath(): string;
4
26
  export declare function configExists(): boolean;
27
+ /**
28
+ * Read and validate ~/.config/rackmind/config.json.
29
+ *
30
+ * - If the file doesn't exist: returns a fresh default config (this is the
31
+ * "first run" path; we WANT defaults here).
32
+ * - If the file exists but JSON is malformed: quarantines it as
33
+ * `config.json.corrupt-<ISO>` and throws `CorruptConfigError`.
34
+ * - If the file exists, parses, but fails Zod schema: same quarantine +
35
+ * throw. We do NOT silently fall back to defaults — that would let the
36
+ * next write erase the user's profile list.
37
+ * - If the file is unreadable for any other reason (permissions, I/O):
38
+ * throws `CorruptConfigError` without quarantining (we don't have a
39
+ * usable file to move).
40
+ *
41
+ * `src/index.ts` runs a `preflightConfigCheck()` at process start so every
42
+ * entry point (named commands, one-shot, REPL) surfaces a single clean
43
+ * diagnostic and exits 1 instead of a stack trace or silent overwrite.
44
+ */
5
45
  export declare function readConfig(): RackMindConfig;
6
46
  export declare function writeConfig(config: RackMindConfig): void;
7
47
  export declare function getServerProfile(alias: string): ServerProfile | null;
8
48
  export declare function getActiveProfile(): ServerProfile | null;
49
+ /**
50
+ * Resolve which server profile to use for an operation.
51
+ *
52
+ * Precedence:
53
+ * 1. Explicit `aliasOverride` argument (typically from `--server <alias>`).
54
+ * 2. The active server profile from config.
55
+ *
56
+ * Throws a user-readable error if the override doesn't match any profile.
57
+ */
58
+ export declare function resolveServerAlias(aliasOverride: string | null | undefined): ServerProfile | null;
9
59
  export declare function setActiveServer(alias: string): void;
10
60
  export declare function saveServerProfile(profile: ServerProfile): void;
11
61
  export declare function removeServerProfile(alias: string): boolean;
@@ -26,4 +76,5 @@ export declare function needsSetup(): boolean;
26
76
  export type { RackMindConfig, ServerProfile, Preferences } from './types.js';
27
77
  export { getDefaultConfig, getDefaultServerProfile } from './types.js';
28
78
  export type { ServerPlatform, SSHAuthType, ConnectionStatus } from './types.js';
79
+ export { MachineKeyMismatchError } from './crypto.js';
29
80
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAGH,KAAK,cAAc,EACnB,KAAK,aAAa,EACrB,MAAM,YAAY,CAAC;AAepB,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAMD,wBAAgB,UAAU,IAAI,cAAc,CAuB3C;AAMD,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAexD;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAGpE;AAED,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,IAAI,CAIvD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAOnD;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAU9D;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAc1D;AAED,wBAAgB,kBAAkB,IAAI,aAAa,EAAE,CAGpD;AAMD,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE3D;AAMD,wBAAgB,kBAAkB,IAAI,MAAM,CAS3C;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAIvD;AAMD,wBAAgB,YAAY,IAAI,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;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAQpF;AAMD,wBAAgB,UAAU,IAAI,OAAO,CAIpC;AAMD,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACvE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC"}
@@ -2,15 +2,74 @@
2
2
  // Config module — read/write/validate ~/.config/rackmind/config.json
3
3
  // ---------------------------------------------------------------------------
4
4
  // Atomic writes (tmp + rename). Zod validation on read. Encrypted credentials.
5
- // Falls back to defaults on parse failure so the CLI never crashes on bad config.
5
+ // On corruption: quarantines the bad file to config.json.corrupt-<ISO> and
6
+ // throws CorruptConfigError so callers can refuse to overwrite real user data.
6
7
  // ---------------------------------------------------------------------------
7
8
  import fs from 'node:fs';
8
9
  import path from 'node:path';
9
10
  import os from 'node:os';
10
11
  import { RackMindConfigSchema, getDefaultConfig, } from './types.js';
11
- import { encrypt, decrypt } from './crypto.js';
12
+ import { encrypt, decrypt, MachineKeyMismatchError } from './crypto.js';
12
13
  import { logger } from '../utils/logger.js';
13
14
  // ---------------------------------------------------------------------------
15
+ // Corruption handling
16
+ // ---------------------------------------------------------------------------
17
+ /**
18
+ * Thrown when ~/.config/rackmind/config.json exists but cannot be parsed
19
+ * (malformed JSON) or fails schema validation. Callers MUST surface this
20
+ * rather than silently returning defaults — otherwise the next `writeConfig`
21
+ * will overwrite the user's real profile data with an empty default.
22
+ */
23
+ export class CorruptConfigError extends Error {
24
+ /** Original path of the corrupted file. */
25
+ originalPath;
26
+ /** Path the corrupted file was renamed to (if quarantine succeeded). */
27
+ quarantinePath;
28
+ /** Why the file was rejected. */
29
+ reason;
30
+ cause;
31
+ constructor(opts) {
32
+ const recovered = opts.quarantinePath
33
+ ? `Your original file was preserved at:\n ${opts.quarantinePath}\n`
34
+ : `The file could NOT be moved aside — leaving it in place at:\n ${opts.originalPath}\n`;
35
+ super(`RackMind config at ${opts.originalPath} is corrupt and was rejected (${opts.reason}).\n` +
36
+ `Details: ${opts.details}\n` +
37
+ recovered +
38
+ `To recover, either restore from a backup made on this machine, or run:\n` +
39
+ ` rackmind connect <alias>\n` +
40
+ `to set up a fresh profile.`);
41
+ this.name = 'CorruptConfigError';
42
+ this.originalPath = opts.originalPath;
43
+ this.quarantinePath = opts.quarantinePath;
44
+ this.reason = opts.reason;
45
+ this.cause = opts.cause;
46
+ }
47
+ }
48
+ /**
49
+ * Move a corrupted config file aside so we never overwrite it. Returns the
50
+ * new path on success, or `null` if the rename itself failed (in which case
51
+ * the caller MUST NOT proceed to write a fresh config — the user's data is
52
+ * still in the original file).
53
+ */
54
+ function quarantineCorruptFile(filePath) {
55
+ const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
56
+ const corruptPath = `${filePath}.corrupt-${timestamp}`;
57
+ try {
58
+ fs.renameSync(filePath, corruptPath);
59
+ return corruptPath;
60
+ }
61
+ catch (err) {
62
+ // Best-effort logging; do NOT throw — the caller still needs to
63
+ // refuse to continue, and we need to leave the original in place.
64
+ const message = err instanceof Error ? err.message : String(err);
65
+ logger.error('Failed to quarantine corrupt config; leaving in place', {
66
+ path: filePath,
67
+ error: message,
68
+ });
69
+ return null;
70
+ }
71
+ }
72
+ // ---------------------------------------------------------------------------
14
73
  // Paths (XDG-compliant: ~/.config/rackmind/)
15
74
  // ---------------------------------------------------------------------------
16
75
  function getXdgConfigHome() {
@@ -30,27 +89,77 @@ export function configExists() {
30
89
  // ---------------------------------------------------------------------------
31
90
  // Read
32
91
  // ---------------------------------------------------------------------------
92
+ /**
93
+ * Read and validate ~/.config/rackmind/config.json.
94
+ *
95
+ * - If the file doesn't exist: returns a fresh default config (this is the
96
+ * "first run" path; we WANT defaults here).
97
+ * - If the file exists but JSON is malformed: quarantines it as
98
+ * `config.json.corrupt-<ISO>` and throws `CorruptConfigError`.
99
+ * - If the file exists, parses, but fails Zod schema: same quarantine +
100
+ * throw. We do NOT silently fall back to defaults — that would let the
101
+ * next write erase the user's profile list.
102
+ * - If the file is unreadable for any other reason (permissions, I/O):
103
+ * throws `CorruptConfigError` without quarantining (we don't have a
104
+ * usable file to move).
105
+ *
106
+ * `src/index.ts` runs a `preflightConfigCheck()` at process start so every
107
+ * entry point (named commands, one-shot, REPL) surfaces a single clean
108
+ * diagnostic and exits 1 instead of a stack trace or silent overwrite.
109
+ */
33
110
  export function readConfig() {
34
111
  if (!configExists()) {
35
112
  return getDefaultConfig();
36
113
  }
114
+ let raw;
37
115
  try {
38
- const raw = fs.readFileSync(CONFIG_FILE, 'utf-8');
39
- const parsed = JSON.parse(raw);
40
- const result = RackMindConfigSchema.safeParse(parsed);
41
- if (!result.success) {
42
- logger.warn('Config validation failed, using defaults', {
43
- errors: result.error.issues.map((i) => i.message),
44
- });
45
- return getDefaultConfig();
46
- }
47
- return result.data;
116
+ raw = fs.readFileSync(CONFIG_FILE, 'utf-8');
48
117
  }
49
118
  catch (err) {
119
+ // We can't read the file at all (permissions, EBUSY, etc.) — don't
120
+ // quarantine (we couldn't read it; renaming might or might not work
121
+ // and either way it's not corruption per se). Just throw loudly.
50
122
  const message = err instanceof Error ? err.message : String(err);
51
123
  logger.error('Failed to read config', { error: message });
52
- return getDefaultConfig();
124
+ throw new CorruptConfigError({
125
+ originalPath: CONFIG_FILE,
126
+ quarantinePath: null,
127
+ reason: 'unreadable',
128
+ details: message,
129
+ cause: err,
130
+ });
131
+ }
132
+ let parsed;
133
+ try {
134
+ parsed = JSON.parse(raw);
135
+ }
136
+ catch (err) {
137
+ const message = err instanceof Error ? err.message : String(err);
138
+ logger.error('Config JSON parse failed; quarantining', { error: message });
139
+ const quarantined = quarantineCorruptFile(CONFIG_FILE);
140
+ throw new CorruptConfigError({
141
+ originalPath: CONFIG_FILE,
142
+ quarantinePath: quarantined,
143
+ reason: 'parse-error',
144
+ details: message,
145
+ cause: err,
146
+ });
53
147
  }
148
+ const result = RackMindConfigSchema.safeParse(parsed);
149
+ if (!result.success) {
150
+ const issues = result.error.issues
151
+ .map((i) => `${i.path.join('.') || '(root)'}: ${i.message}`)
152
+ .join('; ');
153
+ logger.error('Config schema validation failed; quarantining', { issues });
154
+ const quarantined = quarantineCorruptFile(CONFIG_FILE);
155
+ throw new CorruptConfigError({
156
+ originalPath: CONFIG_FILE,
157
+ quarantinePath: quarantined,
158
+ reason: 'validation-error',
159
+ details: issues,
160
+ });
161
+ }
162
+ return result.data;
54
163
  }
55
164
  // ---------------------------------------------------------------------------
56
165
  // Write (atomic: write to temp file, then rename)
@@ -83,6 +192,27 @@ export function getActiveProfile() {
83
192
  return null;
84
193
  return config.servers[config.activeServer] ?? null;
85
194
  }
195
+ /**
196
+ * Resolve which server profile to use for an operation.
197
+ *
198
+ * Precedence:
199
+ * 1. Explicit `aliasOverride` argument (typically from `--server <alias>`).
200
+ * 2. The active server profile from config.
201
+ *
202
+ * Throws a user-readable error if the override doesn't match any profile.
203
+ */
204
+ export function resolveServerAlias(aliasOverride) {
205
+ if (aliasOverride) {
206
+ const profile = getServerProfile(aliasOverride);
207
+ if (!profile) {
208
+ const available = Object.keys(readConfig().servers);
209
+ const hint = available.length > 0 ? ` Available: ${available.join(', ')}` : '';
210
+ throw new Error(`Server profile "${aliasOverride}" not found.${hint}`);
211
+ }
212
+ return profile;
213
+ }
214
+ return getActiveProfile();
215
+ }
86
216
  export function setActiveServer(alias) {
87
217
  const config = readConfig();
88
218
  if (!config.servers[alias]) {
@@ -136,8 +266,16 @@ export function getAnthropicApiKey() {
136
266
  try {
137
267
  return decrypt(config.encryptedAnthropicApiKey);
138
268
  }
139
- catch {
140
- logger.warn('Failed to decrypt Anthropic API key');
269
+ catch (err) {
270
+ // Surface the friendly machine-key-mismatch message to callers so
271
+ // they can show the user something actionable instead of silently
272
+ // pretending no key is configured.
273
+ if (err instanceof MachineKeyMismatchError) {
274
+ logger.warn('Anthropic API key decryption failed (machine-key mismatch)');
275
+ throw err;
276
+ }
277
+ const message = err instanceof Error ? err.message : String(err);
278
+ logger.warn('Failed to decrypt Anthropic API key', { error: message });
141
279
  return '';
142
280
  }
143
281
  }
@@ -156,8 +294,13 @@ export function getAuthToken() {
156
294
  try {
157
295
  return decrypt(config.encryptedAuthToken);
158
296
  }
159
- catch {
160
- logger.warn('Failed to decrypt auth token');
297
+ catch (err) {
298
+ if (err instanceof MachineKeyMismatchError) {
299
+ logger.warn('Auth token decryption failed (machine-key mismatch)');
300
+ throw err;
301
+ }
302
+ const message = err instanceof Error ? err.message : String(err);
303
+ logger.warn('Failed to decrypt auth token', { error: message });
161
304
  return '';
162
305
  }
163
306
  }
@@ -194,4 +337,5 @@ export function needsSetup() {
194
337
  return Object.keys(config.servers).length === 0;
195
338
  }
196
339
  export { getDefaultConfig, getDefaultServerProfile } from './types.js';
340
+ export { MachineKeyMismatchError } from './crypto.js';
197
341
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,qEAAqE;AACrE,8EAA8E;AAC9E,+EAA+E;AAC/E,kFAAkF;AAClF,8EAA8E;AAE9E,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EACH,oBAAoB,EACpB,gBAAgB,GAGnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,8EAA8E;AAC9E,6CAA6C;AAC7C,8EAA8E;AAE9E,SAAS,gBAAgB;IACrB,OAAO,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,IAAI,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,MAAM,CAAC,MAAM;QACrB,KAAK,EAAE,MAAM,CAAC,SAAS;QACvB,UAAU,EAAE,QAAQ;KACvB,CAAC;AACN,CAAC;AAED,8EAA8E;AAC9E,6BAA6B;AAC7B,8EAA8E;AAE9E,MAAM,UAAU,UAAU;IACtB,IAAI,CAAC,YAAY,EAAE;QAAE,OAAO,IAAI,CAAC;IACjC,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AACpD,CAAC;AAOD,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAEvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC"}
package/dist/globals.d.ts CHANGED
@@ -3,8 +3,10 @@ export interface GlobalOptions {
3
3
  json: boolean;
4
4
  /** Suppress non-essential output (spinners, banners, hints) */
5
5
  quiet: boolean;
6
- /** Override the rackmind server URL */
7
- serverUrl: string | null;
6
+ /** Override the active server profile alias (per-invocation) */
7
+ serverAlias: string | null;
8
+ /** Auto-confirm destructive prompts (passed via -y / --yes) */
9
+ autoYes: boolean;
8
10
  }
9
11
  /** Set global options from Commander's parsed flags. Call once at startup. */
10
12
  export declare function setGlobalOptions(opts: Partial<GlobalOptions>): void;
@@ -14,9 +16,25 @@ export declare function getGlobalOptions(): Readonly<GlobalOptions>;
14
16
  export declare function isJsonMode(): boolean;
15
17
  /** True when --quiet is active. Gates spinners, banners, and hints. */
16
18
  export declare function isQuietMode(): boolean;
19
+ /** True when -y / --yes is active. Skips interactive confirmation prompts. */
20
+ export declare function isAutoYes(): boolean;
21
+ /** Override server alias passed via --server <alias> at the command line, if any. */
22
+ export declare function getServerAliasOverride(): string | null;
17
23
  /**
18
- * Write to stderr only if --quiet is NOT set.
24
+ * Write a non-essential message to stderr only if --quiet is NOT set.
19
25
  * Returns false (did nothing) when quiet, true when it wrote.
26
+ *
27
+ * Stderr is the right channel here because this helper is used for
28
+ * status/progress text — stdout stays clean so pipelines work.
20
29
  */
21
30
  export declare function info(message: string): boolean;
31
+ /**
32
+ * Write user-facing human-readable output to stdout (e.g. tables, reports).
33
+ *
34
+ * Stdout is the right channel for pipelines: `rackmind status > out.txt`
35
+ * should yield a non-empty file. This helper does NOT suppress on --quiet —
36
+ * the data IS the point of the command. Callers that want to drop banners,
37
+ * separators, or hints should gate those on `isQuietMode()` directly.
38
+ */
39
+ export declare function out(message: string): boolean;
22
40
  //# sourceMappingURL=globals.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../src/globals.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,aAAa;IAC1B,sEAAsE;IACtE,IAAI,EAAE,OAAO,CAAC;IACd,+DAA+D;IAC/D,KAAK,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAQD,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,CAInE;AAED,6CAA6C;AAC7C,wBAAgB,gBAAgB,IAAI,QAAQ,CAAC,aAAa,CAAC,CAE1D;AAED,oFAAoF;AACpF,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,uEAAuE;AACvE,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAI7C"}
1
+ {"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../src/globals.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,aAAa;IAC1B,sEAAsE;IACtE,IAAI,EAAE,OAAO,CAAC;IACd,+DAA+D;IAC/D,KAAK,EAAE,OAAO,CAAC;IACf,gEAAgE;IAChE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,+DAA+D;IAC/D,OAAO,EAAE,OAAO,CAAC;CACpB;AASD,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,CAKnE;AAED,6CAA6C;AAC7C,wBAAgB,gBAAgB,IAAI,QAAQ,CAAC,aAAa,CAAC,CAE1D;AAED,oFAAoF;AACpF,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,uEAAuE;AACvE,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED,8EAA8E;AAC9E,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED,qFAAqF;AACrF,wBAAgB,sBAAsB,IAAI,MAAM,GAAG,IAAI,CAEtD;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAI7C;AAED;;;;;;;GAOG;AACH,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAG5C"}
package/dist/globals.js CHANGED
@@ -7,7 +7,8 @@
7
7
  const state = {
8
8
  json: false,
9
9
  quiet: false,
10
- serverUrl: null,
10
+ serverAlias: null,
11
+ autoYes: false,
11
12
  };
12
13
  /** Set global options from Commander's parsed flags. Call once at startup. */
13
14
  export function setGlobalOptions(opts) {
@@ -15,8 +16,10 @@ export function setGlobalOptions(opts) {
15
16
  state.json = opts.json;
16
17
  if (opts.quiet !== undefined)
17
18
  state.quiet = opts.quiet;
18
- if (opts.serverUrl !== undefined)
19
- state.serverUrl = opts.serverUrl;
19
+ if (opts.serverAlias !== undefined)
20
+ state.serverAlias = opts.serverAlias;
21
+ if (opts.autoYes !== undefined)
22
+ state.autoYes = opts.autoYes;
20
23
  }
21
24
  /** Read the current global option values. */
22
25
  export function getGlobalOptions() {
@@ -30,9 +33,20 @@ export function isJsonMode() {
30
33
  export function isQuietMode() {
31
34
  return state.quiet;
32
35
  }
36
+ /** True when -y / --yes is active. Skips interactive confirmation prompts. */
37
+ export function isAutoYes() {
38
+ return state.autoYes;
39
+ }
40
+ /** Override server alias passed via --server <alias> at the command line, if any. */
41
+ export function getServerAliasOverride() {
42
+ return state.serverAlias;
43
+ }
33
44
  /**
34
- * Write to stderr only if --quiet is NOT set.
45
+ * Write a non-essential message to stderr only if --quiet is NOT set.
35
46
  * Returns false (did nothing) when quiet, true when it wrote.
47
+ *
48
+ * Stderr is the right channel here because this helper is used for
49
+ * status/progress text — stdout stays clean so pipelines work.
36
50
  */
37
51
  export function info(message) {
38
52
  if (state.quiet)
@@ -40,4 +54,16 @@ export function info(message) {
40
54
  process.stderr.write(message);
41
55
  return true;
42
56
  }
57
+ /**
58
+ * Write user-facing human-readable output to stdout (e.g. tables, reports).
59
+ *
60
+ * Stdout is the right channel for pipelines: `rackmind status > out.txt`
61
+ * should yield a non-empty file. This helper does NOT suppress on --quiet —
62
+ * the data IS the point of the command. Callers that want to drop banners,
63
+ * separators, or hints should gate those on `isQuietMode()` directly.
64
+ */
65
+ export function out(message) {
66
+ process.stdout.write(message);
67
+ return true;
68
+ }
43
69
  //# sourceMappingURL=globals.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"globals.js","sourceRoot":"","sources":["../src/globals.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,2DAA2D;AAC3D,8EAA8E;AAC9E,sEAAsE;AACtE,wDAAwD;AACxD,8EAA8E;AAW9E,MAAM,KAAK,GAAkB;IACzB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,KAAK;IACZ,SAAS,EAAE,IAAI;CAClB,CAAC;AAEF,8EAA8E;AAC9E,MAAM,UAAU,gBAAgB,CAAC,IAA4B;IACzD,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACpD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;QAAE,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACvD,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;QAAE,K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