mcp-pacemaker 2.0.2 → 2.1.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.
- package/CHANGELOG.md +171 -1
- package/CONTRIBUTING.md +46 -13
- package/README.md +109 -524
- package/THIRD_PARTY_NOTICES.txt +1 -28
- package/autostart/windows/account-task.ps1 +167 -0
- package/autostart/windows/inspect-task.ps1 +42 -0
- package/autostart/windows/inspect-worker-process-sessions.ps1 +155 -0
- package/autostart/windows/legacy-access.ps1 +359 -0
- package/autostart/windows/legacy-task.ps1 +301 -0
- package/autostart/windows/register-task.ps1 +11 -2
- package/bin/account-task-adapter.mjs +47 -0
- package/bin/account-upgrade-controller.mjs +198 -0
- package/bin/account-upgrade-worker.mjs +141 -0
- package/bin/account-worker-session.mjs +215 -0
- package/bin/cli-dispatch.mjs +154 -0
- package/bin/cli-main.mjs +1063 -0
- package/bin/cli-selection.mjs +43 -0
- package/bin/cli.mjs +7 -876
- package/bin/dependency-lock.json +642 -0
- package/bin/legacy-1.3.json +32 -0
- package/bin/legacy-access.mjs +73 -0
- package/bin/legacy-installation.mjs +273 -0
- package/bin/legacy-task.mjs +76 -0
- package/bin/legacy-upgrade.mjs +527 -0
- package/bin/managed-runtime.mjs +170 -0
- package/bin/managed-state.mjs +257 -0
- package/bin/managed-upgrade.mjs +581 -0
- package/bin/mcp-bridge.mjs +150 -4
- package/bin/pooling-batches.mjs +13 -0
- package/bin/pooling-writer.mjs +4 -0
- package/bin/prewarm.mjs +59 -25
- package/bin/runtime-context.mjs +100 -0
- package/bin/service-control.mjs +32 -4
- package/bin/stable-launcher.mjs +54 -0
- package/bin/task-only-controller.mjs +226 -0
- package/bin/task-scope.mjs +65 -0
- package/bin/task-transaction-protocol.mjs +173 -0
- package/bin/top.mjs +22 -10
- package/bin/update-check.mjs +13 -2
- package/bin/upgrade-autostart.mjs +47 -0
- package/bin/upgrade-capability.json +9 -0
- package/bin/upgrade-dependencies.mjs +183 -0
- package/bin/upgrade-package.mjs +205 -0
- package/bin/windows-legacy/LegacyProcessBroker.build.json +42 -0
- package/bin/windows-legacy/LegacyProcessBroker.exe +0 -0
- package/bin/windows-legacy/src/AssemblyInfo.cs +8 -0
- package/bin/windows-legacy/src/LegacyNative.cs +832 -0
- package/bin/windows-legacy/src/LegacyProcessBroker.cs +961 -0
- package/bin/windows-legacy-process.mjs +248 -0
- package/bin/windows-lifetime/ProcessLifetimeHelper.build.json +38 -0
- package/bin/windows-lifetime/ProcessLifetimeHelper.exe +0 -0
- package/bin/windows-lifetime/src/AssemblyInfo.cs +8 -0
- package/bin/windows-lifetime/src/ProcessLifetimeHelper.cs +468 -0
- package/bin/windows-process-lifetime.mjs +218 -0
- package/bin/windows-task-channel/TaskChannelGuard.build.json +45 -0
- package/bin/windows-task-channel/TaskChannelGuard.exe +0 -0
- package/bin/windows-task-channel/src/AssemblyInfo.cs +8 -0
- package/bin/windows-task-channel/src/ChannelCliContext.cs +210 -0
- package/bin/windows-task-channel/src/ChannelFiles.cs +231 -0
- package/bin/windows-task-channel/src/ChannelNative.cs +477 -0
- package/bin/windows-task-channel/src/ChannelSession.cs +203 -0
- package/bin/windows-task-channel/src/TaskChannelGuard.cs +686 -0
- package/bin/windows-task-channel.mjs +335 -0
- package/docs/account-upgrades.md +218 -0
- package/docs/compatibility.md +39 -0
- package/docs/configuration.md +146 -0
- package/docs/dashboards.md +125 -0
- package/docs/execution-context.md +119 -0
- package/docs/http-api.md +47 -0
- package/docs/install.md +52 -0
- package/docs/operations.md +99 -0
- package/docs/upgrades.md +324 -0
- package/package.json +19 -5
- package/supervisor/supervise.mjs +226 -40
- package/tools/account-upgrade/qualify-two-account.ps1 +66 -0
- package/tools/windows-legacy/README.md +251 -0
- package/tools/windows-legacy/build.ps1 +122 -0
- package/tools/windows-legacy/inventory.mjs +92 -0
- package/tools/windows-process-lifetime/README.md +119 -0
- package/tools/windows-process-lifetime/build.ps1 +122 -0
- package/tools/windows-process-lifetime/inventory.mjs +86 -0
- package/tools/windows-task-channel/README.md +329 -0
- package/tools/windows-task-channel/build.ps1 +107 -0
- package/tools/windows-task-channel/inventory.mjs +117 -0
- package/ui/dist/THIRD_PARTY_NOTICES.txt +1 -28
- package/ui/dist/assets/{index-CgPruWYi.js → index-CcwMo2sI.js} +1 -1
- package/ui/dist/assets/index-PVcuDNrN.css +1 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/third-party-manifest.json +37 -25
- package/ui/dist/assets/index-CaLPg0c-.css +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { realpathSync } from 'node:fs';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
|
|
4
|
+
export function canonicalPort(value) {
|
|
5
|
+
if (typeof value === 'number' &&
|
|
6
|
+
Number.isInteger(value) &&
|
|
7
|
+
value >= 1 &&
|
|
8
|
+
value <= 65535) return value;
|
|
9
|
+
const text = typeof value === 'string' ? value : '';
|
|
10
|
+
const decimal = text.length >= 1 &&
|
|
11
|
+
text.length <= 5 &&
|
|
12
|
+
text[0] !== '0' &&
|
|
13
|
+
[...text].every(character => character >= '0' && character <= '9');
|
|
14
|
+
const port = decimal ? Number(text) : 0;
|
|
15
|
+
if (!decimal ||
|
|
16
|
+
port > 65535) throw new Error('Port must be a canonical decimal integer from 1 to 65535.');
|
|
17
|
+
return port;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function validateSelectedCommand(instance, command, options) {
|
|
21
|
+
const commands = ['mcp-pacemaker', 'status', 'doctor', 'logs', 'top', 'dashboard',
|
|
22
|
+
'prewarm', 'reload', 'start', 'stop', 'upgrade', 'update-check', 'emit', 'plan'];
|
|
23
|
+
if (!commands.includes(command)) {
|
|
24
|
+
throw new Error(`${command} is not supported with --instance. No setup, host wiring or autostart change was made.`);
|
|
25
|
+
}
|
|
26
|
+
if (instance.port === 0 &&
|
|
27
|
+
!['mcp-pacemaker', 'status', 'logs', 'start', 'upgrade', 'update-check'].includes(command)) {
|
|
28
|
+
throw new Error('Selected instance has no verified listener port; no default port was used.');
|
|
29
|
+
}
|
|
30
|
+
if (command === 'upgrade' &&
|
|
31
|
+
!options.to &&
|
|
32
|
+
!options.recover &&
|
|
33
|
+
!options.self) throw new Error('Selected upgrade requires --to, --recover or --self; bare host repair is not instance-scoped.');
|
|
34
|
+
const sxsPort = command === 'upgrade' && options.sxs;
|
|
35
|
+
const port = options.port === undefined ? undefined : canonicalPort(options.port);
|
|
36
|
+
if (options.port !== undefined &&
|
|
37
|
+
!sxsPort &&
|
|
38
|
+
port !== instance.port) throw new Error('--port conflicts with the selected instance.');
|
|
39
|
+
if (options.config !== undefined &&
|
|
40
|
+
realpathSync(resolve(options.config)) !== realpathSync(instance.config)) {
|
|
41
|
+
throw new Error('--config conflicts with the selected instance.');
|
|
42
|
+
}
|
|
43
|
+
}
|