@mindexec/cli 0.2.49 → 0.2.51
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/package.json +2 -1
- package/remote-hub.js +70 -3
- package/server.js +299 -2
- package/wwwroot/_framework/MindExecution.Core.fv9epd367q.dll +0 -0
- package/wwwroot/_framework/{MindExecution.Kernel.erg96341xf.dll → MindExecution.Kernel.necgouk2lu.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.Admin.11j9vpdm9u.dll → MindExecution.Plugins.Admin.i1bsxgnkwb.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.Business.oyskf08knn.dll → MindExecution.Plugins.Business.opnf5esnox.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.Concept.152wyrfnp8.dll → MindExecution.Plugins.Concept.3c5vvjh1ax.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.Directory.7pus9p63ym.dll → MindExecution.Plugins.Directory.mcs5ilkrby.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.PlanMaster.2eou252nmu.dll → MindExecution.Plugins.PlanMaster.ofkqkx5csm.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.YouTube.4lf588qsm9.dll → MindExecution.Plugins.YouTube.si9ylbnkqo.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Shared.b5ygkh90kh.dll → MindExecution.Shared.w5v05uuccd.dll} +0 -0
- package/wwwroot/_framework/MindExecution.Web.y71txqhdir.dll +0 -0
- package/wwwroot/_framework/blazor.boot.json +21 -21
- package/wwwroot/index.html +3 -3
- package/wwwroot/service-worker-assets.js +23 -23
- package/wwwroot/service-worker.js +1 -1
- package/wwwroot/_framework/MindExecution.Core.xg9yy9l5dz.dll +0 -0
- package/wwwroot/_framework/MindExecution.Web.i1q5kqwk4a.dll +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindexec/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.51",
|
|
4
4
|
"description": "MindExec local runtime and bridge CLI",
|
|
5
5
|
"main": "server.js",
|
|
6
6
|
"type": "module",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"node": ">=20"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
+
"@mindexec/remote": "^0.1.11",
|
|
49
50
|
"@openai/codex-sdk": "^0.137.0",
|
|
50
51
|
"chokidar": "^3.6.0",
|
|
51
52
|
"cors": "^2.8.5",
|
package/remote-hub.js
CHANGED
|
@@ -3,7 +3,7 @@ import os from 'os';
|
|
|
3
3
|
import crypto from 'crypto';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_REMOTE_HUB_PORT = 5197;
|
|
6
|
-
const DEFAULT_REMOTE_HUB_HOST = '
|
|
6
|
+
const DEFAULT_REMOTE_HUB_HOST = '0.0.0.0';
|
|
7
7
|
const DEFAULT_HEARTBEAT_MS = 5000;
|
|
8
8
|
const DEFAULT_AGENT_TASK_TIMEOUT_MS = 120000;
|
|
9
9
|
const MAX_LINE_CHARS = 4 * 1024 * 1024;
|
|
@@ -50,6 +50,54 @@ function safeString(value, maxLength = 200) {
|
|
|
50
50
|
return String(value ?? '').replace(/[\r\n\t]/g, ' ').trim().slice(0, maxLength);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
function isLoopbackHost(value) {
|
|
54
|
+
const host = String(value || '').trim().toLowerCase();
|
|
55
|
+
return host === 'localhost'
|
|
56
|
+
|| host === '127.0.0.1'
|
|
57
|
+
|| host === '::1'
|
|
58
|
+
|| host === '[::1]';
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function isWildcardHost(value) {
|
|
62
|
+
const host = String(value || '').trim().toLowerCase();
|
|
63
|
+
return host === '0.0.0.0'
|
|
64
|
+
|| host === '::'
|
|
65
|
+
|| host === '[::]'
|
|
66
|
+
|| host === '';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function isPrivateIPv4(value) {
|
|
70
|
+
const parts = String(value || '').split('.').map(part => Number(part));
|
|
71
|
+
if (parts.length !== 4 || parts.some(part => !Number.isInteger(part) || part < 0 || part > 255)) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return parts[0] === 10
|
|
76
|
+
|| (parts[0] === 172 && parts[1] >= 16 && parts[1] <= 31)
|
|
77
|
+
|| (parts[0] === 192 && parts[1] === 168);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function getReachableIPv4Address() {
|
|
81
|
+
const candidates = [];
|
|
82
|
+
const interfaces = os.networkInterfaces();
|
|
83
|
+
for (const entries of Object.values(interfaces)) {
|
|
84
|
+
for (const entry of entries || []) {
|
|
85
|
+
if (entry?.family !== 'IPv4' || entry.internal) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const address = safeString(entry.address, 64);
|
|
90
|
+
if (!address || address === '0.0.0.0') {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
candidates.push(address);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return candidates.find(isPrivateIPv4) || candidates[0] || '127.0.0.1';
|
|
99
|
+
}
|
|
100
|
+
|
|
53
101
|
function safeText(value, maxLength = 1000) {
|
|
54
102
|
return String(value ?? '').replace(/\0/g, '').trim().slice(0, maxLength);
|
|
55
103
|
}
|
|
@@ -256,6 +304,8 @@ export function createRemoteHub(options = {}) {
|
|
|
256
304
|
DEFAULT_AGENT_TASK_TIMEOUT_MS);
|
|
257
305
|
const managerPackage = safeString(options.managerPackage ?? env.MINDEXEC_MANAGER_PACKAGE ?? '@mindexec/cli', 128);
|
|
258
306
|
const managerVersion = safeString(options.managerVersion ?? env.MINDEXEC_MANAGER_VERSION ?? '', 64);
|
|
307
|
+
const publicEndpoint = safeString(env.MINDEXEC_REMOTE_PUBLIC_ENDPOINT || env.REMOTE_HUB_PUBLIC_ENDPOINT, 256);
|
|
308
|
+
const publicHost = safeString(env.MINDEXEC_REMOTE_PUBLIC_HOST || env.REMOTE_HUB_PUBLIC_HOST, 128);
|
|
259
309
|
const pairToken = safeString(
|
|
260
310
|
env.REMOTE_HUB_PAIR_TOKEN || env.MINDEXEC_REMOTE_PAIR_TOKEN || crypto.randomBytes(6).toString('hex'),
|
|
261
311
|
256);
|
|
@@ -270,8 +320,24 @@ export function createRemoteHub(options = {}) {
|
|
|
270
320
|
let lastError = '';
|
|
271
321
|
let hostTarget = null;
|
|
272
322
|
|
|
323
|
+
function getAnnouncedHost() {
|
|
324
|
+
if (publicHost) {
|
|
325
|
+
return publicHost;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
if (isWildcardHost(host)) {
|
|
329
|
+
return getReachableIPv4Address();
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
return host;
|
|
333
|
+
}
|
|
334
|
+
|
|
273
335
|
function getAgentEndpoint() {
|
|
274
|
-
|
|
336
|
+
if (publicEndpoint) {
|
|
337
|
+
return publicEndpoint;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
return `${getAnnouncedHost()}:${boundPort || requestedPort}`;
|
|
275
341
|
}
|
|
276
342
|
|
|
277
343
|
function getActiveHostTarget() {
|
|
@@ -395,6 +461,7 @@ export function createRemoteHub(options = {}) {
|
|
|
395
461
|
enabled,
|
|
396
462
|
started,
|
|
397
463
|
host,
|
|
464
|
+
agentHost: getAnnouncedHost(),
|
|
398
465
|
port: boundPort || requestedPort,
|
|
399
466
|
protocol: 'tcp-jsonl',
|
|
400
467
|
protocolVersion: REMOTE_PROTOCOL_VERSION,
|
|
@@ -417,7 +484,7 @@ export function createRemoteHub(options = {}) {
|
|
|
417
484
|
hostTargetActivatedAt: activeHostTarget.activatedAt,
|
|
418
485
|
hostTargetUpdatedAt: activeHostTarget.updatedAt,
|
|
419
486
|
hostTargetExpiresAt: activeHostTarget.expiresAt,
|
|
420
|
-
externalExposure: host
|
|
487
|
+
externalExposure: isWildcardHost(host) || !isLoopbackHost(host),
|
|
421
488
|
lastError
|
|
422
489
|
};
|
|
423
490
|
}
|
package/server.js
CHANGED
|
@@ -2518,9 +2518,262 @@ const remoteHub = createRemoteHub({
|
|
|
2518
2518
|
managerVersion: BRIDGE_VERSION
|
|
2519
2519
|
});
|
|
2520
2520
|
|
|
2521
|
+
const REMOTE_AGENT_STDIO_TAIL_CHARS = 12000;
|
|
2522
|
+
const REMOTE_AGENT_DEFAULT_ENGINE = 'auto';
|
|
2523
|
+
let remoteAgentState = createRemoteAgentIdleState();
|
|
2524
|
+
|
|
2525
|
+
function createRemoteAgentIdleState(overrides = {}) {
|
|
2526
|
+
return {
|
|
2527
|
+
status: 'idle',
|
|
2528
|
+
manager: '',
|
|
2529
|
+
leaseId: '',
|
|
2530
|
+
nodeId: '',
|
|
2531
|
+
engine: REMOTE_AGENT_DEFAULT_ENGINE,
|
|
2532
|
+
source: '',
|
|
2533
|
+
connectionKey: '',
|
|
2534
|
+
pid: 0,
|
|
2535
|
+
startedAt: '',
|
|
2536
|
+
updatedAt: new Date().toISOString(),
|
|
2537
|
+
exitedAt: '',
|
|
2538
|
+
exitCode: null,
|
|
2539
|
+
signal: '',
|
|
2540
|
+
lastError: '',
|
|
2541
|
+
stdoutTail: '',
|
|
2542
|
+
stderrTail: '',
|
|
2543
|
+
launcher: '',
|
|
2544
|
+
usingNpx: false,
|
|
2545
|
+
proc: null,
|
|
2546
|
+
...overrides
|
|
2547
|
+
};
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
function serializeRemoteAgentState() {
|
|
2551
|
+
const { proc, ...publicState } = remoteAgentState;
|
|
2552
|
+
return {
|
|
2553
|
+
...publicState,
|
|
2554
|
+
running: remoteAgentState.status === 'running'
|
|
2555
|
+
&& !!remoteAgentState.proc
|
|
2556
|
+
&& remoteAgentState.proc.exitCode === null
|
|
2557
|
+
&& !remoteAgentState.proc.killed
|
|
2558
|
+
};
|
|
2559
|
+
}
|
|
2560
|
+
|
|
2561
|
+
function appendRemoteAgentOutput(stream, chunk) {
|
|
2562
|
+
const text = chunk.toString();
|
|
2563
|
+
const key = stream === 'stderr' ? 'stderrTail' : 'stdoutTail';
|
|
2564
|
+
remoteAgentState[key] = String((remoteAgentState[key] || '') + text).slice(-REMOTE_AGENT_STDIO_TAIL_CHARS);
|
|
2565
|
+
remoteAgentState.updatedAt = new Date().toISOString();
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
function normalizeRemoteAgentEngine(value) {
|
|
2569
|
+
const engine = String(value || REMOTE_AGENT_DEFAULT_ENGINE).trim().toLowerCase();
|
|
2570
|
+
if (engine === 'fast' || engine === 'csharp' || engine === 'c#') {
|
|
2571
|
+
return 'fast';
|
|
2572
|
+
}
|
|
2573
|
+
if (engine === 'node' || engine === 'legacy' || engine === 'js') {
|
|
2574
|
+
return 'node';
|
|
2575
|
+
}
|
|
2576
|
+
return REMOTE_AGENT_DEFAULT_ENGINE;
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
function normalizeRemoteManagerEndpoint(value) {
|
|
2580
|
+
const endpoint = String(value || '').trim();
|
|
2581
|
+
const match = endpoint.match(/^(\[[^\]]+\]|[^:\s]+):(\d{1,5})$/);
|
|
2582
|
+
if (!match) {
|
|
2583
|
+
return '';
|
|
2584
|
+
}
|
|
2585
|
+
|
|
2586
|
+
const host = match[1].replace(/^\[|\]$/g, '');
|
|
2587
|
+
const port = Number(match[2]);
|
|
2588
|
+
if (!host || !Number.isInteger(port) || port <= 0 || port > 65535) {
|
|
2589
|
+
return '';
|
|
2590
|
+
}
|
|
2591
|
+
|
|
2592
|
+
return `${match[1]}:${port}`;
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
function safeRemoteAgentField(value, maxLength = 128) {
|
|
2596
|
+
return String(value || '').replace(/[\r\n\t]/g, ' ').trim().slice(0, maxLength);
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
function createRemoteAgentConnectionKey(manager, leaseId) {
|
|
2600
|
+
return crypto
|
|
2601
|
+
.createHash('sha256')
|
|
2602
|
+
.update(`${manager}\n${leaseId || ''}`)
|
|
2603
|
+
.digest('hex')
|
|
2604
|
+
.slice(0, 24);
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
function isRemoteAgentProcessRunning() {
|
|
2608
|
+
const proc = remoteAgentState.proc;
|
|
2609
|
+
return remoteAgentState.status === 'running'
|
|
2610
|
+
&& !!proc
|
|
2611
|
+
&& proc.exitCode === null
|
|
2612
|
+
&& !proc.killed;
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
function resolveRemoteAgentLauncher() {
|
|
2616
|
+
const localLauncher = path.join(BRIDGE_ROOT, 'node_modules', '@mindexec', 'remote', 'bin', 'mindexec-remote.js');
|
|
2617
|
+
try {
|
|
2618
|
+
if (statSync(localLauncher).isFile()) {
|
|
2619
|
+
return {
|
|
2620
|
+
command: process.execPath,
|
|
2621
|
+
argsPrefix: [localLauncher],
|
|
2622
|
+
launcher: localLauncher,
|
|
2623
|
+
usingNpx: false
|
|
2624
|
+
};
|
|
2625
|
+
}
|
|
2626
|
+
} catch {
|
|
2627
|
+
// Fall back to npx for source checkouts or older package installs.
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
const npxCommand = process.platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
2631
|
+
return {
|
|
2632
|
+
command: npxCommand,
|
|
2633
|
+
argsPrefix: ['-y', '@mindexec/remote@latest'],
|
|
2634
|
+
launcher: npxCommand,
|
|
2635
|
+
usingNpx: true
|
|
2636
|
+
};
|
|
2637
|
+
}
|
|
2638
|
+
|
|
2639
|
+
async function stopRemoteAgentConnection(reason = 'stopped') {
|
|
2640
|
+
const previous = remoteAgentState;
|
|
2641
|
+
if (previous.proc) {
|
|
2642
|
+
try {
|
|
2643
|
+
await terminateProcessTree(previous.proc);
|
|
2644
|
+
} catch (err) {
|
|
2645
|
+
logWarn('remote', `managed RemoteAgent stop failed: ${err?.message || err}`);
|
|
2646
|
+
}
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2649
|
+
remoteAgentState = createRemoteAgentIdleState({
|
|
2650
|
+
status: 'stopped',
|
|
2651
|
+
manager: previous.manager,
|
|
2652
|
+
leaseId: previous.leaseId,
|
|
2653
|
+
nodeId: previous.nodeId,
|
|
2654
|
+
engine: previous.engine,
|
|
2655
|
+
source: previous.source,
|
|
2656
|
+
connectionKey: previous.connectionKey,
|
|
2657
|
+
startedAt: previous.startedAt,
|
|
2658
|
+
exitedAt: new Date().toISOString(),
|
|
2659
|
+
lastError: reason,
|
|
2660
|
+
stdoutTail: previous.stdoutTail,
|
|
2661
|
+
stderrTail: previous.stderrTail,
|
|
2662
|
+
launcher: previous.launcher,
|
|
2663
|
+
usingNpx: previous.usingNpx
|
|
2664
|
+
});
|
|
2665
|
+
emitBridgeEvent('RemoteAgentStopped', serializeRemoteAgentState());
|
|
2666
|
+
return serializeRemoteAgentState();
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
async function startRemoteAgentConnection(options = {}) {
|
|
2670
|
+
const manager = normalizeRemoteManagerEndpoint(options.manager || options.managerEndpoint || options.endpoint);
|
|
2671
|
+
const pairToken = safeRemoteAgentField(options.pairToken || options.pair, 512);
|
|
2672
|
+
const leaseId = safeRemoteAgentField(options.leaseId, 128);
|
|
2673
|
+
const nodeId = safeRemoteAgentField(options.nodeId, 128);
|
|
2674
|
+
const source = safeRemoteAgentField(options.source || 'registry', 64);
|
|
2675
|
+
const engine = normalizeRemoteAgentEngine(options.engine);
|
|
2676
|
+
|
|
2677
|
+
if (!manager) {
|
|
2678
|
+
return { ok: false, error: 'invalid-manager-endpoint', agent: serializeRemoteAgentState() };
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
if (!pairToken) {
|
|
2682
|
+
return { ok: false, error: 'missing-pair-token', agent: serializeRemoteAgentState() };
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
const connectionKey = createRemoteAgentConnectionKey(manager, leaseId);
|
|
2686
|
+
if (isRemoteAgentProcessRunning() && remoteAgentState.connectionKey === connectionKey) {
|
|
2687
|
+
return { ok: true, alreadyRunning: true, agent: serializeRemoteAgentState() };
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
if (isRemoteAgentProcessRunning()) {
|
|
2691
|
+
await stopRemoteAgentConnection('replaced-by-new-target');
|
|
2692
|
+
}
|
|
2693
|
+
|
|
2694
|
+
const launcher = resolveRemoteAgentLauncher();
|
|
2695
|
+
const args = [
|
|
2696
|
+
...launcher.argsPrefix,
|
|
2697
|
+
'connect',
|
|
2698
|
+
'--manager',
|
|
2699
|
+
manager,
|
|
2700
|
+
'--pair',
|
|
2701
|
+
pairToken,
|
|
2702
|
+
'--engine',
|
|
2703
|
+
engine
|
|
2704
|
+
];
|
|
2705
|
+
|
|
2706
|
+
remoteAgentState = createRemoteAgentIdleState({
|
|
2707
|
+
status: 'starting',
|
|
2708
|
+
manager,
|
|
2709
|
+
leaseId,
|
|
2710
|
+
nodeId,
|
|
2711
|
+
engine,
|
|
2712
|
+
source,
|
|
2713
|
+
connectionKey,
|
|
2714
|
+
startedAt: new Date().toISOString(),
|
|
2715
|
+
launcher: launcher.launcher,
|
|
2716
|
+
usingNpx: launcher.usingNpx
|
|
2717
|
+
});
|
|
2718
|
+
|
|
2719
|
+
let child;
|
|
2720
|
+
try {
|
|
2721
|
+
child = spawn(launcher.command, args, {
|
|
2722
|
+
cwd: BRIDGE_ROOT,
|
|
2723
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
2724
|
+
windowsHide: true,
|
|
2725
|
+
env: {
|
|
2726
|
+
...process.env,
|
|
2727
|
+
MINDEXEC_REMOTE_AGENT_MANAGED: '1'
|
|
2728
|
+
}
|
|
2729
|
+
});
|
|
2730
|
+
} catch (err) {
|
|
2731
|
+
remoteAgentState = {
|
|
2732
|
+
...remoteAgentState,
|
|
2733
|
+
status: 'failed',
|
|
2734
|
+
lastError: err?.message || String(err),
|
|
2735
|
+
updatedAt: new Date().toISOString()
|
|
2736
|
+
};
|
|
2737
|
+
return { ok: false, error: remoteAgentState.lastError, agent: serializeRemoteAgentState() };
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
remoteAgentState.proc = child;
|
|
2741
|
+
remoteAgentState.pid = Number(child.pid || 0);
|
|
2742
|
+
remoteAgentState.status = 'running';
|
|
2743
|
+
remoteAgentState.updatedAt = new Date().toISOString();
|
|
2744
|
+
|
|
2745
|
+
child.stdout.on('data', chunk => appendRemoteAgentOutput('stdout', chunk));
|
|
2746
|
+
child.stderr.on('data', chunk => appendRemoteAgentOutput('stderr', chunk));
|
|
2747
|
+
child.once('error', err => {
|
|
2748
|
+
remoteAgentState.status = 'failed';
|
|
2749
|
+
remoteAgentState.lastError = err?.message || String(err);
|
|
2750
|
+
remoteAgentState.updatedAt = new Date().toISOString();
|
|
2751
|
+
emitBridgeEvent('RemoteAgentFailed', serializeRemoteAgentState());
|
|
2752
|
+
});
|
|
2753
|
+
child.once('exit', (code, signal) => {
|
|
2754
|
+
remoteAgentState.status = code === 0 ? 'exited' : 'failed';
|
|
2755
|
+
remoteAgentState.exitCode = Number.isFinite(code) ? code : null;
|
|
2756
|
+
remoteAgentState.signal = signal || '';
|
|
2757
|
+
remoteAgentState.exitedAt = new Date().toISOString();
|
|
2758
|
+
remoteAgentState.updatedAt = remoteAgentState.exitedAt;
|
|
2759
|
+
if (code !== 0 && !remoteAgentState.lastError) {
|
|
2760
|
+
remoteAgentState.lastError = signal ? `signal:${signal}` : `exit:${code}`;
|
|
2761
|
+
}
|
|
2762
|
+
emitBridgeEvent(remoteAgentState.status === 'exited' ? 'RemoteAgentExited' : 'RemoteAgentFailed', serializeRemoteAgentState());
|
|
2763
|
+
});
|
|
2764
|
+
|
|
2765
|
+
logEvent(
|
|
2766
|
+
'remote',
|
|
2767
|
+
`managed RemoteAgent ${tone('>', 'accent')} ${manager} ${formatKeyValue('engine', engine)} ${leaseId ? formatKeyValue('lease', leaseId) : ''}`,
|
|
2768
|
+
'remote');
|
|
2769
|
+
emitBridgeEvent('RemoteAgentStarted', serializeRemoteAgentState());
|
|
2770
|
+
|
|
2771
|
+
return { ok: true, alreadyRunning: false, agent: serializeRemoteAgentState() };
|
|
2772
|
+
}
|
|
2773
|
+
|
|
2521
2774
|
function trimShellOutput(value, maxLength) {
|
|
2522
|
-
const text = String(value || '');
|
|
2523
|
-
if (text.length <= maxLength) {
|
|
2775
|
+
const text = String(value || '');
|
|
2776
|
+
if (text.length <= maxLength) {
|
|
2524
2777
|
return text;
|
|
2525
2778
|
}
|
|
2526
2779
|
|
|
@@ -6972,6 +7225,7 @@ app.get('/api/status', async (req, res) => {
|
|
|
6972
7225
|
bridgeTokenHeader,
|
|
6973
7226
|
bridgeAuthRequired,
|
|
6974
7227
|
remoteHub: remoteHub.getStatus({ includeSecrets: false }),
|
|
7228
|
+
remoteAgent: serializeRemoteAgentState(),
|
|
6975
7229
|
shellJobsPath: '/api/shell/jobs',
|
|
6976
7230
|
companyCore: {
|
|
6977
7231
|
baseUrl: companyCoreBaseUrl,
|
|
@@ -7045,6 +7299,40 @@ app.delete('/api/remote/host-target', (req, res) => {
|
|
|
7045
7299
|
}));
|
|
7046
7300
|
});
|
|
7047
7301
|
|
|
7302
|
+
app.get('/api/remote/agent/status', (req, res) => {
|
|
7303
|
+
res.setHeader('Cache-Control', 'no-store');
|
|
7304
|
+
res.json(serializeRemoteAgentState());
|
|
7305
|
+
});
|
|
7306
|
+
|
|
7307
|
+
app.post('/api/remote/agent/connect', async (req, res) => {
|
|
7308
|
+
res.setHeader('Cache-Control', 'no-store');
|
|
7309
|
+
try {
|
|
7310
|
+
const result = await startRemoteAgentConnection({
|
|
7311
|
+
manager: req.body?.manager || req.body?.managerEndpoint,
|
|
7312
|
+
pairToken: req.body?.pairToken || req.body?.pair,
|
|
7313
|
+
leaseId: req.body?.leaseId,
|
|
7314
|
+
nodeId: req.body?.nodeId,
|
|
7315
|
+
engine: req.body?.engine,
|
|
7316
|
+
source: req.body?.source || 'registry'
|
|
7317
|
+
});
|
|
7318
|
+
res.status(result.ok ? 200 : 400).json(result);
|
|
7319
|
+
} catch (err) {
|
|
7320
|
+
logError('remote', 'managed RemoteAgent connect failed.', err);
|
|
7321
|
+
res.status(500).json({
|
|
7322
|
+
ok: false,
|
|
7323
|
+
error: err?.message || String(err),
|
|
7324
|
+
agent: serializeRemoteAgentState()
|
|
7325
|
+
});
|
|
7326
|
+
}
|
|
7327
|
+
});
|
|
7328
|
+
|
|
7329
|
+
app.post('/api/remote/agent/disconnect', async (req, res) => {
|
|
7330
|
+
res.setHeader('Cache-Control', 'no-store');
|
|
7331
|
+
const reason = safeRemoteAgentField(req.body?.reason || 'registry-inactive', 128);
|
|
7332
|
+
const agent = await stopRemoteAgentConnection(reason);
|
|
7333
|
+
res.json({ ok: true, agent });
|
|
7334
|
+
});
|
|
7335
|
+
|
|
7048
7336
|
function isSyntheticRemoteFleetEnabled() {
|
|
7049
7337
|
return /^(1|true|yes|on)$/i.test(String(
|
|
7050
7338
|
process.env.MINDEXEC_REMOTE_SYNTHETIC_FLEET
|
|
@@ -8662,6 +8950,9 @@ async function startBridgeServer() {
|
|
|
8662
8950
|
formatKeyValue('remote', remoteHubStatus.started
|
|
8663
8951
|
? tone(`tcp://${remoteHubStatus.host}:${remoteHubStatus.port}`, 'accent')
|
|
8664
8952
|
: tone(remoteHubStatus.enabled ? 'failed' : 'disabled', 'warn')),
|
|
8953
|
+
formatKeyValue('agent', remoteHubStatus.started
|
|
8954
|
+
? tone(remoteHubStatus.agentEndpoint || '-', 'accent')
|
|
8955
|
+
: tone('-', 'muted')),
|
|
8665
8956
|
formatKeyValue('pair', remoteHubStatus.started
|
|
8666
8957
|
? tone(remoteHubStatus.pairTokenPreview, 'warn')
|
|
8667
8958
|
: tone('-', 'muted')),
|
|
@@ -8707,6 +8998,12 @@ async function shutdownBridge(signal) {
|
|
|
8707
8998
|
// Ignore if already closed
|
|
8708
8999
|
}
|
|
8709
9000
|
|
|
9001
|
+
try {
|
|
9002
|
+
await stopRemoteAgentConnection('bridge-shutdown');
|
|
9003
|
+
} catch {
|
|
9004
|
+
// Ignore managed RemoteAgent close errors during shutdown
|
|
9005
|
+
}
|
|
9006
|
+
|
|
8710
9007
|
try {
|
|
8711
9008
|
await remoteHub.close();
|
|
8712
9009
|
} catch {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"mainAssemblyName": "MindExecution.Web",
|
|
3
3
|
"resources": {
|
|
4
|
-
"hash": "sha256-
|
|
4
|
+
"hash": "sha256-9/5POBUnUjRLHnaTUce3v/cfR0oqf0jzjsZLKmmaF9k=",
|
|
5
5
|
"fingerprinting": {
|
|
6
6
|
"Google.Protobuf.9h59ukbel7.dll": "Google.Protobuf.dll",
|
|
7
7
|
"Markdig.d1j7v41cl1.dll": "Markdig.dll",
|
|
@@ -123,16 +123,16 @@
|
|
|
123
123
|
"System.brmz7yk5qh.dll": "System.dll",
|
|
124
124
|
"netstandard.yvr3prsx0x.dll": "netstandard.dll",
|
|
125
125
|
"System.Private.CoreLib.ns29bor93l.dll": "System.Private.CoreLib.dll",
|
|
126
|
-
"MindExecution.Core.
|
|
127
|
-
"MindExecution.Kernel.
|
|
128
|
-
"MindExecution.Plugins.Admin.
|
|
129
|
-
"MindExecution.Plugins.Business.
|
|
130
|
-
"MindExecution.Plugins.Concept.
|
|
131
|
-
"MindExecution.Plugins.Directory.
|
|
132
|
-
"MindExecution.Plugins.PlanMaster.
|
|
133
|
-
"MindExecution.Plugins.YouTube.
|
|
134
|
-
"MindExecution.Shared.
|
|
135
|
-
"MindExecution.Web.
|
|
126
|
+
"MindExecution.Core.fv9epd367q.dll": "MindExecution.Core.dll",
|
|
127
|
+
"MindExecution.Kernel.necgouk2lu.dll": "MindExecution.Kernel.dll",
|
|
128
|
+
"MindExecution.Plugins.Admin.i1bsxgnkwb.dll": "MindExecution.Plugins.Admin.dll",
|
|
129
|
+
"MindExecution.Plugins.Business.opnf5esnox.dll": "MindExecution.Plugins.Business.dll",
|
|
130
|
+
"MindExecution.Plugins.Concept.3c5vvjh1ax.dll": "MindExecution.Plugins.Concept.dll",
|
|
131
|
+
"MindExecution.Plugins.Directory.mcs5ilkrby.dll": "MindExecution.Plugins.Directory.dll",
|
|
132
|
+
"MindExecution.Plugins.PlanMaster.ofkqkx5csm.dll": "MindExecution.Plugins.PlanMaster.dll",
|
|
133
|
+
"MindExecution.Plugins.YouTube.si9ylbnkqo.dll": "MindExecution.Plugins.YouTube.dll",
|
|
134
|
+
"MindExecution.Shared.w5v05uuccd.dll": "MindExecution.Shared.dll",
|
|
135
|
+
"MindExecution.Web.y71txqhdir.dll": "MindExecution.Web.dll",
|
|
136
136
|
"dotnet.js": "dotnet.js",
|
|
137
137
|
"dotnet.native.qc8g39g30v.js": "dotnet.native.js",
|
|
138
138
|
"dotnet.native.boem75ye5i.wasm": "dotnet.native.wasm",
|
|
@@ -278,18 +278,18 @@
|
|
|
278
278
|
"System.Xml.XDocument.sn51jas17n.dll": "sha256-GNI2kFgFmPTwzuzwUn8gxK+AzGLUWRJFdg9JzIbrybQ=",
|
|
279
279
|
"System.brmz7yk5qh.dll": "sha256-CfM2miyj1KHApFmqMdLYWio3S/jrdON2pW9Xr2nTwlo=",
|
|
280
280
|
"netstandard.yvr3prsx0x.dll": "sha256-EksNn8Luo4bOWqJ6X7dIe9qG9oOqwOVzjH2xYyMNi+E=",
|
|
281
|
-
"MindExecution.Core.
|
|
282
|
-
"MindExecution.Kernel.
|
|
283
|
-
"MindExecution.Plugins.Concept.
|
|
284
|
-
"MindExecution.Plugins.PlanMaster.
|
|
285
|
-
"MindExecution.Shared.
|
|
286
|
-
"MindExecution.Web.
|
|
281
|
+
"MindExecution.Core.fv9epd367q.dll": "sha256-e+bWfgea05kkjqA0d7SoScYnRUTDwrAa8jGcE/9efgM=",
|
|
282
|
+
"MindExecution.Kernel.necgouk2lu.dll": "sha256-MU33gJtnXnCTK0arVlYP8NdKUNQmQCeew/ywgj2tgvA=",
|
|
283
|
+
"MindExecution.Plugins.Concept.3c5vvjh1ax.dll": "sha256-wyfXidn4Mwhv1tdPa/Zg2SA6siukk/wKFM5m4njh5Fk=",
|
|
284
|
+
"MindExecution.Plugins.PlanMaster.ofkqkx5csm.dll": "sha256-9PE8rjbSnD0GOryMtJHtpn5riVUL5GdBFDxDTXp4rqM=",
|
|
285
|
+
"MindExecution.Shared.w5v05uuccd.dll": "sha256-xNquLGF4gJlatw7ttFI6XIhlRHGjfcYPAKQLxbrpA60=",
|
|
286
|
+
"MindExecution.Web.y71txqhdir.dll": "sha256-bmQOJzNyNjQHR3e5FXnYm2vV7vU8U/EzqTJlJ4KwcGo="
|
|
287
287
|
},
|
|
288
288
|
"lazyAssembly": {
|
|
289
|
-
"MindExecution.Plugins.Admin.
|
|
290
|
-
"MindExecution.Plugins.Business.
|
|
291
|
-
"MindExecution.Plugins.Directory.
|
|
292
|
-
"MindExecution.Plugins.YouTube.
|
|
289
|
+
"MindExecution.Plugins.Admin.i1bsxgnkwb.dll": "sha256-5pd/Pw8FqxoZ/PqvlOz4EJuXGLmmTggZYpYjpj3chjA=",
|
|
290
|
+
"MindExecution.Plugins.Business.opnf5esnox.dll": "sha256-ND2mM989Ka3iOmyVqQtXkMVkR74oGR67uenBuStXGTA=",
|
|
291
|
+
"MindExecution.Plugins.Directory.mcs5ilkrby.dll": "sha256-xuSRgmxlBfx2qx0YiiyxrAvD6S5XKJrCdfxRCOWloqY=",
|
|
292
|
+
"MindExecution.Plugins.YouTube.si9ylbnkqo.dll": "sha256-TOoWWas3rXuwWEVbujJUco7sNB8P/fS4k2yB0Vqs0AY="
|
|
293
293
|
}
|
|
294
294
|
},
|
|
295
295
|
"cacheBootResources": true,
|
package/wwwroot/index.html
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
<title>MindExec | Run your ideas as AI task graphs</title>
|
|
8
8
|
<meta name="description" content="MindExec is an AI execution canvas for solo builders, researchers, developers, and creators. Start with free browser tools, then move serious work into saved MindCanvas projects." />
|
|
9
9
|
<base href="/" />
|
|
10
|
-
<link rel="stylesheet" href="_content/MindExecution.Shared/css/app.css?v=
|
|
11
|
-
<link rel="stylesheet" href="_content/MindExecution.Shared/css/mind-map-overrides.css?v=
|
|
10
|
+
<link rel="stylesheet" href="_content/MindExecution.Shared/css/app.css?v=20260614-remote-registry-v511" />
|
|
11
|
+
<link rel="stylesheet" href="_content/MindExecution.Shared/css/mind-map-overrides.css?v=20260614-remote-registry-v511" />
|
|
12
12
|
<!-- ?쇄뼹??Font Awesome (local) ?쇄뼹??-->
|
|
13
13
|
<link rel="stylesheet" href="_content/MindExecution.Shared/lib/font-awesome/css/all.min.css" />
|
|
14
14
|
<!-- ?꿎뼯??-->
|
|
@@ -558,7 +558,7 @@
|
|
|
558
558
|
}
|
|
559
559
|
|
|
560
560
|
const base = '_content/MindExecution.Shared/js/';
|
|
561
|
-
const scriptVersion = '
|
|
561
|
+
const scriptVersion = '20260614-remote-registry-v511';
|
|
562
562
|
const scriptUrl = (script) => `${base}${script}?v=${scriptVersion}`;
|
|
563
563
|
console.log(`[Script Loader] Shared JS version: ${scriptVersion}`);
|
|
564
564
|
const criticalScripts = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
self.assetsManifest = {
|
|
2
|
-
"version": "
|
|
2
|
+
"version": "Mphxacza",
|
|
3
3
|
"assets": [
|
|
4
4
|
{
|
|
5
5
|
"hash": "sha256-+CSYMcqLNTsq3VnH11jgYyOCCdxvHzL74CBmo4sCmMU=",
|
|
@@ -410,44 +410,44 @@
|
|
|
410
410
|
"url": "_framework/MimeMapping.og9ys58ylm.dll"
|
|
411
411
|
},
|
|
412
412
|
{
|
|
413
|
-
"hash": "sha256-
|
|
414
|
-
"url": "_framework/MindExecution.Core.
|
|
413
|
+
"hash": "sha256-e+bWfgea05kkjqA0d7SoScYnRUTDwrAa8jGcE/9efgM=",
|
|
414
|
+
"url": "_framework/MindExecution.Core.fv9epd367q.dll"
|
|
415
415
|
},
|
|
416
416
|
{
|
|
417
|
-
"hash": "sha256-
|
|
418
|
-
"url": "_framework/MindExecution.Kernel.
|
|
417
|
+
"hash": "sha256-MU33gJtnXnCTK0arVlYP8NdKUNQmQCeew/ywgj2tgvA=",
|
|
418
|
+
"url": "_framework/MindExecution.Kernel.necgouk2lu.dll"
|
|
419
419
|
},
|
|
420
420
|
{
|
|
421
|
-
"hash": "sha256-
|
|
422
|
-
"url": "_framework/MindExecution.Plugins.Admin.
|
|
421
|
+
"hash": "sha256-5pd/Pw8FqxoZ/PqvlOz4EJuXGLmmTggZYpYjpj3chjA=",
|
|
422
|
+
"url": "_framework/MindExecution.Plugins.Admin.i1bsxgnkwb.dll"
|
|
423
423
|
},
|
|
424
424
|
{
|
|
425
|
-
"hash": "sha256-
|
|
426
|
-
"url": "_framework/MindExecution.Plugins.Business.
|
|
425
|
+
"hash": "sha256-ND2mM989Ka3iOmyVqQtXkMVkR74oGR67uenBuStXGTA=",
|
|
426
|
+
"url": "_framework/MindExecution.Plugins.Business.opnf5esnox.dll"
|
|
427
427
|
},
|
|
428
428
|
{
|
|
429
|
-
"hash": "sha256-
|
|
430
|
-
"url": "_framework/MindExecution.Plugins.Concept.
|
|
429
|
+
"hash": "sha256-wyfXidn4Mwhv1tdPa/Zg2SA6siukk/wKFM5m4njh5Fk=",
|
|
430
|
+
"url": "_framework/MindExecution.Plugins.Concept.3c5vvjh1ax.dll"
|
|
431
431
|
},
|
|
432
432
|
{
|
|
433
|
-
"hash": "sha256-
|
|
434
|
-
"url": "_framework/MindExecution.Plugins.Directory.
|
|
433
|
+
"hash": "sha256-xuSRgmxlBfx2qx0YiiyxrAvD6S5XKJrCdfxRCOWloqY=",
|
|
434
|
+
"url": "_framework/MindExecution.Plugins.Directory.mcs5ilkrby.dll"
|
|
435
435
|
},
|
|
436
436
|
{
|
|
437
|
-
"hash": "sha256
|
|
438
|
-
"url": "_framework/MindExecution.Plugins.PlanMaster.
|
|
437
|
+
"hash": "sha256-9PE8rjbSnD0GOryMtJHtpn5riVUL5GdBFDxDTXp4rqM=",
|
|
438
|
+
"url": "_framework/MindExecution.Plugins.PlanMaster.ofkqkx5csm.dll"
|
|
439
439
|
},
|
|
440
440
|
{
|
|
441
|
-
"hash": "sha256-
|
|
442
|
-
"url": "_framework/MindExecution.Plugins.YouTube.
|
|
441
|
+
"hash": "sha256-TOoWWas3rXuwWEVbujJUco7sNB8P/fS4k2yB0Vqs0AY=",
|
|
442
|
+
"url": "_framework/MindExecution.Plugins.YouTube.si9ylbnkqo.dll"
|
|
443
443
|
},
|
|
444
444
|
{
|
|
445
|
-
"hash": "sha256-
|
|
446
|
-
"url": "_framework/MindExecution.Shared.
|
|
445
|
+
"hash": "sha256-xNquLGF4gJlatw7ttFI6XIhlRHGjfcYPAKQLxbrpA60=",
|
|
446
|
+
"url": "_framework/MindExecution.Shared.w5v05uuccd.dll"
|
|
447
447
|
},
|
|
448
448
|
{
|
|
449
|
-
"hash": "sha256-
|
|
450
|
-
"url": "_framework/MindExecution.Web.
|
|
449
|
+
"hash": "sha256-bmQOJzNyNjQHR3e5FXnYm2vV7vU8U/EzqTJlJ4KwcGo=",
|
|
450
|
+
"url": "_framework/MindExecution.Web.y71txqhdir.dll"
|
|
451
451
|
},
|
|
452
452
|
{
|
|
453
453
|
"hash": "sha256-IsZJ91/OW+fHzNqIgEc7Y072ns8z9dGritiSyvR9Wgc=",
|
|
@@ -770,7 +770,7 @@
|
|
|
770
770
|
"url": "_framework/Websocket.Client.vapounvmnl.dll"
|
|
771
771
|
},
|
|
772
772
|
{
|
|
773
|
-
"hash": "sha256-
|
|
773
|
+
"hash": "sha256-Dp7hmEZrcfmwHqq9wTzyrgD8uX+Rjk/Nca/UfWIO0ao=",
|
|
774
774
|
"url": "_framework/blazor.boot.json"
|
|
775
775
|
},
|
|
776
776
|
{
|
|
@@ -834,7 +834,7 @@
|
|
|
834
834
|
"url": "image-manifest.json"
|
|
835
835
|
},
|
|
836
836
|
{
|
|
837
|
-
"hash": "sha256-
|
|
837
|
+
"hash": "sha256-UcE/wpl6GRqeR7eg9lYKHo6tvWbqZSMb//rVca+L8qg=",
|
|
838
838
|
"url": "index.html"
|
|
839
839
|
},
|
|
840
840
|
{
|
|
Binary file
|
|
Binary file
|