mcp-ssh-manager 3.8.7 → 4.0.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 (104) hide show
  1. package/.eslintignore +5 -0
  2. package/.gitattributes +5 -0
  3. package/CHANGELOG.md +371 -6
  4. package/CLAUDE.md +6 -0
  5. package/CODE_OF_CONDUCT.md +18 -0
  6. package/CONTRIBUTING.md +30 -0
  7. package/Formula/ssh-manager.rb +60 -0
  8. package/README.md +484 -964
  9. package/ROADMAP-V4.md +451 -0
  10. package/brand/README.md +43 -0
  11. package/brand/icon.svg +32 -0
  12. package/brand/mark.svg +18 -0
  13. package/brand/wordmark.svg +30 -0
  14. package/cli/app.js +230 -0
  15. package/cli/control.js +116 -0
  16. package/cli/lib/colors.sh +15 -0
  17. package/cli/lib/menu.sh +145 -96
  18. package/cli/portability.js +186 -0
  19. package/cli/ssh-manager +197 -91
  20. package/cli/ssh-manager.js +14 -0
  21. package/cli/style.js +17 -0
  22. package/cli/vault.js +411 -0
  23. package/desktop/ControlPlaneApp.swift +219 -0
  24. package/desktop/build.sh +58 -0
  25. package/desktop/electron/after-pack.cjs +39 -0
  26. package/desktop/electron/electron-builder.yml +148 -0
  27. package/desktop/electron/finalize-artifacts.mjs +83 -0
  28. package/desktop/electron/main.js +815 -0
  29. package/desktop/electron/package-lock.json +3656 -0
  30. package/desktop/electron/package.json +30 -0
  31. package/desktop/electron/prepare-engine.mjs +84 -0
  32. package/desktop/electron/resources/entitlements.mac.plist +22 -0
  33. package/desktop/electron/resources/icon.png +0 -0
  34. package/desktop/electron/resources/trayTemplate.png +0 -0
  35. package/desktop/electron/resources/trayTemplate@2x.png +0 -0
  36. package/desktop/electron/smoke-test.mjs +184 -0
  37. package/dist/ui/app.css +1 -0
  38. package/dist/ui/app.js +501 -0
  39. package/dist/ui/assets/Forum-Regular.woff2 +0 -0
  40. package/dist/ui/assets/JetBrainsMono-Bold.woff2 +0 -0
  41. package/dist/ui/assets/JetBrainsMono-Regular.woff2 +0 -0
  42. package/dist/ui/assets/Karla-Variable.woff2 +0 -0
  43. package/dist/ui/index.html +16 -0
  44. package/docs/DISTRIBUTION.md +136 -0
  45. package/docs/FINAL-TEST-V4.md +209 -0
  46. package/docs/MIGRATION.md +334 -0
  47. package/docs/TESTING-V4.md +119 -0
  48. package/docs/superpowers/specs/2026-10-08-desktop-from-npm-and-cli-design.md +187 -0
  49. package/docs/videos/control-plane.mp4 +0 -0
  50. package/package.json +61 -30
  51. package/scripts/build-interface.mjs +73 -0
  52. package/scripts/capture-screenshots.mjs +191 -0
  53. package/scripts/demo-env.mjs +461 -0
  54. package/scripts/frame-screenshots.py +176 -0
  55. package/scripts/macbook-mockup.py +296 -0
  56. package/scripts/make-tray-icon.py +61 -0
  57. package/scripts/preview-candidate.mjs +291 -0
  58. package/scripts/publish-desktop.mjs +46 -0
  59. package/scripts/record-demo.mjs +229 -0
  60. package/scripts/release-version.mjs +32 -0
  61. package/scripts/render-cli-menu.py +157 -0
  62. package/scripts/requirements-dev.in +12 -0
  63. package/scripts/requirements-dev.txt +424 -0
  64. package/scripts/run-ui-regression.mjs +48 -0
  65. package/scripts/setup-hooks.sh +7 -13
  66. package/scripts/smoke-desktop.mjs +80 -0
  67. package/scripts/test-drag-and-drop.mjs +114 -0
  68. package/scripts/test-first-run.mjs +5 -0
  69. package/scripts/test-import-ui.mjs +5 -0
  70. package/scripts/test-preferences-persist.mjs +5 -0
  71. package/scripts/test-upgrade-from-published.mjs +226 -0
  72. package/scripts/verify-mac-build.sh +153 -0
  73. package/scripts/verify-windows-build.ps1 +15 -0
  74. package/server.json +3 -3
  75. package/skills/README.md +42 -0
  76. package/skills/ssh-incident/SKILL.md +55 -0
  77. package/skills/ssh-operations/SKILL.md +62 -0
  78. package/skills/ssh-restricted/SKILL.md +57 -0
  79. package/src/agent-clients.js +482 -0
  80. package/src/approval.js +291 -0
  81. package/src/audit.js +11 -1
  82. package/src/command-log.js +162 -0
  83. package/src/config-loader.js +119 -4
  84. package/src/config-paths.js +101 -0
  85. package/src/control-plane.js +2730 -0
  86. package/src/desktop-install.js +747 -0
  87. package/src/index.js +179 -213
  88. package/src/live-stream.js +261 -0
  89. package/src/saved-commands.js +150 -0
  90. package/src/secret-store.js +573 -0
  91. package/src/server-aliases.js +8 -7
  92. package/src/server-config-manager.js +33 -7
  93. package/src/server-export.js +106 -0
  94. package/src/server-groups.js +82 -21
  95. package/src/server-import.js +477 -0
  96. package/src/shell-quote.js +9 -2
  97. package/src/ssh-connection.js +155 -0
  98. package/src/ssh-manager.js +186 -13
  99. package/src/tunnel-manager.js +79 -0
  100. package/src/vault-recovery.js +206 -0
  101. package/src/xlsx.js +322 -0
  102. package/docs/images/social-preview.png +0 -0
  103. package/docs/images/social-preview@2x.png +0 -0
  104. package/docs/images/ssh-manager-cli-menu.png +0 -0
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Give node-pty's spawn helper back its executable bit.
3
+ *
4
+ * The npm tarball ships `prebuilds/<platform>/spawn-helper` as 644. node-pty
5
+ * runs it for every pseudo-terminal it opens, so without the bit the first
6
+ * local shell dies on `posix_spawnp failed` — and only in a packaged build,
7
+ * because a developer's checkout usually has a chmod'd copy from somewhere.
8
+ *
9
+ * Before signing rather than after: this is a nested Mach-O executable, and it
10
+ * has to be signed as one for the notarized app to pass Gatekeeper.
11
+ */
12
+ const fs = require('fs');
13
+ const path = require('path');
14
+
15
+ exports.default = async function afterPack(context) {
16
+ const unpacked = context.appOutDir;
17
+ const found = [];
18
+
19
+ const walk = (dir) => {
20
+ let entries;
21
+ try {
22
+ entries = fs.readdirSync(dir, { withFileTypes: true });
23
+ } catch {
24
+ return; // a directory we cannot read has nothing we need
25
+ }
26
+ for (const entry of entries) {
27
+ const full = path.join(dir, entry.name);
28
+ if (entry.isDirectory()) walk(full);
29
+ else if (entry.name === 'spawn-helper') found.push(full);
30
+ }
31
+ };
32
+ walk(unpacked);
33
+
34
+ for (const file of found) {
35
+ fs.chmodSync(file, 0o755);
36
+ console.log(` • made executable ${path.relative(unpacked, file)}`);
37
+ }
38
+ if (found.length === 0) console.log(' • no macOS spawn-helper present; packaged smoke tests verify the native shell');
39
+ };
@@ -0,0 +1,148 @@
1
+ appId: com.bvisible.ssh-manager
2
+ productName: SSH Manager
3
+ copyright: Copyright © 2026 bvisible
4
+
5
+ directories:
6
+ output: dist
7
+ buildResources: resources
8
+
9
+ # Only this directory's own files go in the asar. The engine is carried as a
10
+ # resource instead — see extraResources — because ssh2 loads optional native
11
+ # bindings at runtime and those cannot be read from inside an archive.
12
+ files:
13
+ - main.js
14
+ - smoke-test.mjs
15
+ - package.json
16
+ # The menu-bar glyph is loaded at runtime from __dirname/resources, so it has
17
+ # to be inside the asar with main.js. `resources` is also buildResources,
18
+ # which electron-builder excludes by default — leaving the packaged app with
19
+ # a Tray it cannot give an icon to, and therefore no menu bar item at all.
20
+ - resources/trayTemplate.png
21
+ - resources/trayTemplate@2x.png
22
+ # A shell on *this* machine needs a pseudo-terminal, and allocating one needs
23
+ # a native module. It lives here rather than in the engine on purpose: the
24
+ # engine is published on npm and installs on machines with no compiler, while
25
+ # this is built with a toolchain. node-pty ships N-API prebuilds, so Electron
26
+ # loads them as they are — nothing is rebuilt.
27
+ - node_modules/node-pty/lib/**/*
28
+ - node_modules/node-pty/package.json
29
+ - node_modules/node-pty/prebuilds/**/*
30
+ - node_modules/node-pty/build/Release/**/*
31
+ # Sources, headers and the winpty tree: needed to *build* node-pty, never to
32
+ # run it.
33
+ - '!node_modules/node-pty/{src,deps,scripts,third_party,typings}/**'
34
+
35
+ # The pty binary and its spawn helper are executed, and nothing executes from
36
+ # inside an asar — it is an archive, not a filesystem.
37
+ asarUnpack:
38
+ - node_modules/node-pty/prebuilds/**
39
+ - node_modules/node-pty/build/Release/**
40
+
41
+ # node-pty's tarball ships spawn-helper without its executable bit, and without
42
+ # it every local shell dies on `posix_spawnp failed`. Restored before signing,
43
+ # because a nested Mach-O executable has to be signed as one.
44
+ afterPack: ./after-pack.cjs
45
+
46
+ extraResources:
47
+ # Assembled by prepare-engine.mjs, which installs only the production
48
+ # dependencies — pointing at the repository's node_modules put 55 MB of
49
+ # eslint and friends inside the application.
50
+ - from: engine
51
+ to: engine
52
+ filter:
53
+ - '**/*'
54
+ # node_modules has to be named explicitly. electron-builder's matcher
55
+ # treats it specially — `**/*` does not reach into it — so without this
56
+ # line the engine ships as bare source with no dependencies, and the app
57
+ # dies on launch with "Cannot find package 'dotenv'". 30 MB became 2.2 MB
58
+ # and nothing said so.
59
+ - 'node_modules/**/*'
60
+ - '!**/{test,tests,__tests__,example,examples,docs,doc}/**'
61
+ - '!**/*.{md,map,ts}'
62
+ - '!**/.bin/**'
63
+
64
+ # node_modules needs its own entry. electron-builder never descends into a
65
+ # directory called node_modules while copying an extraResource — with or
66
+ # without a filter — so the engine shipped as bare source and the app died on
67
+ # launch with "Cannot find package 'dotenv'". Naming the directory as the
68
+ # *root* of a copy sidesteps the rule, because there is then nothing to
69
+ # descend into.
70
+ - from: engine/node_modules
71
+ to: engine/node_modules
72
+ filter:
73
+ - '**/*'
74
+ - '!**/{test,tests,__tests__,example,examples,docs,doc}/**'
75
+ - '!**/*.{md,map,ts}'
76
+ - '!**/.bin/**'
77
+
78
+ mac:
79
+ files:
80
+ - '!node_modules/node-pty/prebuilds/win32-*/**'
81
+ category: public.app-category.developer-tools
82
+ target:
83
+ - target: dmg
84
+ arch: [arm64, x64]
85
+ - target: zip
86
+ arch: [arm64, x64]
87
+ # Keychain access is what the vault uses on macOS; without the entitlement the
88
+ # `security` call fails and the vault silently falls back to a key file.
89
+ entitlements: resources/entitlements.mac.plist
90
+ entitlementsInherit: resources/entitlements.mac.plist
91
+ # Without a document type, the Dock icon refuses every drop and `open-file`
92
+ # never fires. `public.item` is "any file or folder": this application does
93
+ # not open documents, it sends them somewhere, so narrowing by extension
94
+ # would only make it refuse the files people actually have.
95
+ fileAssociations:
96
+ - ext: '*'
97
+ name: File
98
+ role: Viewer
99
+ rank: Alternate
100
+ extendInfo:
101
+ NSDownloadsFolderUsageDescription: SSH Manager reads and writes files here when you transfer them to or from a server.
102
+ NSDocumentsFolderUsageDescription: SSH Manager reads and writes files here when you transfer them to or from a server.
103
+ artifactName: ${productName}-${version}-${arch}.${ext}
104
+
105
+ dmg:
106
+ artifactName: ${productName}-${version}-${arch}.${ext}
107
+ # Signed with the same Developer ID as the app, then notarized and stapled by
108
+ # the release workflow. Unsigned, it opened without a warning but Apple's
109
+ # syspolicy_check called it not distributable (4.0.0-beta.1). Skipped by
110
+ # electron-builder when no identity is available, as on a local build.
111
+ sign: true
112
+
113
+ win:
114
+ files:
115
+ - '!node_modules/node-pty/prebuilds/darwin-*/**'
116
+ target:
117
+ - target: nsis
118
+ arch: [x64, arm64]
119
+ artifactName: ${productName}-${version}-setup.${ext}
120
+
121
+ nsis:
122
+ oneClick: false
123
+ perMachine: false
124
+ allowToChangeInstallationDirectory: true
125
+ # Uninstalling must not take the vault with it: the servers and their
126
+ # encrypted credentials live in the user's home, not in the install directory,
127
+ # and someone reinstalling expects to find them again.
128
+ deleteAppDataOnUninstall: false
129
+
130
+ linux:
131
+ files:
132
+ - '!node_modules/node-pty/prebuilds/{darwin,win32}-*/**'
133
+ target:
134
+ - AppImage
135
+ - deb
136
+ category: Development
137
+ maintainer: bvisible
138
+ artifactName: ${productName}-${version}-${arch}.${ext}
139
+
140
+ # Where the application looks for updates, and where the release workflow puts
141
+ # them. GitHub Releases rather than a server of our own: the repository is
142
+ # already public, the releases already live there, and there is nothing to run
143
+ # or pay for. electron-updater reads latest-mac.yml / latest.yml from the
144
+ # release assets, which electron-builder writes beside the installers.
145
+ publish:
146
+ provider: github
147
+ owner: bvisible
148
+ repo: mcp-ssh-manager
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env node
2
+ // Called after signing/stapling. Hash the final bytes, regenerate the DMG's
3
+ // differential map, and record exactly which files may be published.
4
+ import assert from 'node:assert/strict';
5
+ import fs from 'node:fs';
6
+ import path from 'node:path';
7
+ import crypto from 'node:crypto';
8
+ import { createRequire } from 'node:module';
9
+ import { fileURLToPath } from 'node:url';
10
+ import { releaseVersion } from '../../scripts/release-version.mjs';
11
+ const require = createRequire(import.meta.url);
12
+
13
+ const artifact = /\.(?:zip|dmg|exe|AppImage|deb|blockmap)$/;
14
+ export const digest = (file, algorithm = 'sha512') => crypto.createHash(algorithm).update(fs.readFileSync(file)).digest(algorithm === 'sha512' ? 'base64' : 'hex');
15
+
16
+ // The update metadata electron-builder writes for the GitHub provider. It is
17
+ // always the `latest` channel, prerelease or not: app-builder-lib's
18
+ // computeChannelNames() returns the configured channel (default `latest`) for
19
+ // GitHub, because a prerelease is expressed by the GitHub release flag rather
20
+ // than by a channel file. electron-updater follows suit: a prerelease build
21
+ // asks for `<channel>-mac.yml` first and falls back to `latest-mac.yml` on a
22
+ // 404 (GitHubProvider, 6.8.9). Expecting `beta-mac.yml` here refused the files
23
+ // the first real prerelease build produced.
24
+ const UPDATE_METADATA = { darwin: 'latest-mac.yml', win32: 'latest.yml', linux: 'latest-linux.yml' };
25
+
26
+ // Only these prerelease names can reach the stable release by themselves.
27
+ // electron-updater lets an alpha or beta build take the newest release in the
28
+ // feed, stable included; any other name (`rc`, `next`) is a custom channel
29
+ // that only ever follows its own kind, so everyone who installed an `rc`
30
+ // would stay on it after 4.0.0 shipped, waiting for an `rc` that never comes.
31
+ const DESKTOP_PRERELEASE_CHANNELS = ['alpha', 'beta'];
32
+
33
+ export async function finalizeArtifacts(dir, version, platform, { rebuildBlockmaps = true, yaml = null } = {}) {
34
+ const { prerelease, channel } = releaseVersion(version);
35
+ assert.ok(!prerelease || DESKTOP_PRERELEASE_CHANNELS.includes(channel),
36
+ `Desktop prereleases must be alpha or beta, not "${channel}": electron-updater never moves any other prerelease on to a stable release`);
37
+ const { load, dump } = yaml || require('js-yaml');
38
+ for (const file of fs.readdirSync(dir).filter(name => artifact.test(name))) {
39
+ const safe = file.replace(/ /g, '-');
40
+ if (safe !== file) {
41
+ assert.equal(fs.existsSync(path.join(dir, safe)), false, `Duplicate artifact ${safe}`);
42
+ fs.renameSync(path.join(dir, file), path.join(dir, safe));
43
+ }
44
+ }
45
+ if (rebuildBlockmaps) {
46
+ const { buildBlockMap } = require('app-builder-lib/out/targets/blockmap/blockmap.js');
47
+ for (const file of fs.readdirSync(dir).filter(name => name.endsWith('.dmg'))) {
48
+ await buildBlockMap(path.join(dir, file), 'gzip', path.join(dir, `${file}.blockmap`));
49
+ }
50
+ }
51
+ const metadataFiles = fs.readdirSync(dir).filter(name => /\.yml$/.test(name) && !name.startsWith('builder-'));
52
+ assert.ok(metadataFiles.length, 'No updater metadata was built');
53
+ assert.deepEqual(metadataFiles, [UPDATE_METADATA[platform]], `Unexpected update metadata: ${metadataFiles.join(', ')}`);
54
+ for (const file of metadataFiles) {
55
+ const metadata = load(fs.readFileSync(path.join(dir, file), 'utf8'));
56
+ assert.equal(metadata.version, version, 'Updater metadata version mismatch');
57
+ assert.ok(metadata.files?.length, 'Updater metadata has no files');
58
+ for (const entry of metadata.files) {
59
+ const name = decodeURIComponent(entry.url).replace(/ /g, '-');
60
+ assert.equal(path.basename(name), name, 'Artifact path must be a filename');
61
+ const full = path.join(dir, name);
62
+ entry.url = name;
63
+ entry.sha512 = digest(full);
64
+ entry.size = fs.statSync(full).size;
65
+ }
66
+ metadata.path = metadata.files[0].url;
67
+ metadata.sha512 = metadata.files[0].sha512;
68
+ fs.writeFileSync(path.join(dir, file), dump(metadata, { lineWidth: -1 }));
69
+ }
70
+ const files = fs.readdirSync(dir).filter(name => artifact.test(name) || metadataFiles.includes(name)).sort();
71
+ const expected = platform === 'darwin' ? ['arm64.dmg', 'x64.dmg', 'arm64.zip', 'x64.zip']
72
+ : platform === 'win32' ? ['setup.exe'] : ['.AppImage', '.deb'];
73
+ for (const suffix of expected) assert.ok(files.some(name => name.endsWith(suffix)), `Missing ${suffix}`);
74
+ for (const file of files.filter(name => artifact.test(name))) assert.ok(file.includes(version), `Wrong-version artifact: ${file}`);
75
+ const manifest = { version, platform, commit: process.env.RELEASE_COMMIT || null, files: files.map(name => ({ name, size: fs.statSync(path.join(dir, name)).size, sha256: digest(path.join(dir, name), 'sha256') })) };
76
+ fs.writeFileSync(path.join(dir, `release-manifest-${platform}.json`), `${JSON.stringify(manifest, null, 2)}\n`);
77
+ return manifest;
78
+ }
79
+
80
+ if (process.argv[1] && fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) {
81
+ const version = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url))).version;
82
+ console.log(await finalizeArtifacts(process.argv[2] || 'dist', version, process.platform));
83
+ }