@mindexec/cli 0.2.59 → 0.2.61

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 (25) hide show
  1. package/package.json +2 -2
  2. package/remote-hub.js +52 -0
  3. package/scripts/remote-http-smoke.mjs +13 -0
  4. package/scripts/remote-hub-smoke.mjs +19 -1
  5. package/server.js +4 -0
  6. package/wwwroot/_content/MindExecution.Shared/css/app.css +1 -1
  7. package/wwwroot/_content/MindExecution.Shared/js/mind-map-css3d-manager.js +556 -17
  8. package/wwwroot/_content/MindExecution.Shared/js/mind-map-menu-manager.js +64 -18
  9. package/wwwroot/_content/MindExecution.Shared/js/mind-map-nodes.js +2 -2
  10. package/wwwroot/_framework/MindExecution.Core.csfu1xtj3l.dll +0 -0
  11. package/wwwroot/_framework/{MindExecution.Kernel.cqcbagjpqb.dll → MindExecution.Kernel.mdo1lzjvvp.dll} +0 -0
  12. package/wwwroot/_framework/{MindExecution.Plugins.Admin.tsn0j478un.dll → MindExecution.Plugins.Admin.5fctwf65dx.dll} +0 -0
  13. package/wwwroot/_framework/{MindExecution.Plugins.Business.xg74dmn0vz.dll → MindExecution.Plugins.Business.nwivpk9djf.dll} +0 -0
  14. package/wwwroot/_framework/{MindExecution.Plugins.Concept.xyf0dtv4lr.dll → MindExecution.Plugins.Concept.aa243ne54e.dll} +0 -0
  15. package/wwwroot/_framework/{MindExecution.Plugins.Directory.9i4bd043ia.dll → MindExecution.Plugins.Directory.jnzcrwl049.dll} +0 -0
  16. package/wwwroot/_framework/{MindExecution.Plugins.PlanMaster.6awpgrbi0w.dll → MindExecution.Plugins.PlanMaster.udoktewe31.dll} +0 -0
  17. package/wwwroot/_framework/{MindExecution.Plugins.YouTube.phonjrgb40.dll → MindExecution.Plugins.YouTube.z4bhlt9iy7.dll} +0 -0
  18. package/wwwroot/_framework/{MindExecution.Shared.wv4gm07egs.dll → MindExecution.Shared.32hytvk3ws.dll} +0 -0
  19. package/wwwroot/_framework/MindExecution.Web.730hm0dubp.dll +0 -0
  20. package/wwwroot/_framework/blazor.boot.json +21 -21
  21. package/wwwroot/index.html +3 -3
  22. package/wwwroot/service-worker-assets.js +27 -27
  23. package/wwwroot/service-worker.js +1 -1
  24. package/wwwroot/_framework/MindExecution.Core.fu1rl67yt3.dll +0 -0
  25. package/wwwroot/_framework/MindExecution.Web.2qteyfmk41.dll +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindexec/cli",
3
- "version": "0.2.59",
3
+ "version": "0.2.61",
4
4
  "description": "MindExec local runtime and bridge CLI",
5
5
  "main": "server.js",
6
6
  "type": "module",
@@ -46,7 +46,7 @@
46
46
  "node": ">=20"
47
47
  },
48
48
  "dependencies": {
49
- "@mindexec/remote": "^0.1.12",
49
+ "@mindexec/remote": "^0.1.13",
50
50
  "@openai/codex-sdk": "^0.137.0",
51
51
  "chokidar": "^3.6.0",
52
52
  "cors": "^2.8.5",
package/remote-hub.js CHANGED
@@ -107,6 +107,29 @@ function normalizeApprovalLevel(value) {
107
107
  return level === 'ai-assist' ? 'ai-assist' : 'task-only';
108
108
  }
109
109
 
110
+ function normalizeRemoteInputEvent(value = {}) {
111
+ const input = value && typeof value === 'object' ? value : {};
112
+ const type = safeString(input.type || input.Type, 48);
113
+ const normalizedX = Number(input.normalizedX ?? input.NormalizedX);
114
+ const normalizedY = Number(input.normalizedY ?? input.NormalizedY);
115
+ const deltaX = Number(input.deltaX ?? input.DeltaX);
116
+ const deltaY = Number(input.deltaY ?? input.DeltaY);
117
+ return {
118
+ type,
119
+ normalizedX: Number.isFinite(normalizedX) ? Math.max(0, Math.min(1, normalizedX)) : undefined,
120
+ normalizedY: Number.isFinite(normalizedY) ? Math.max(0, Math.min(1, normalizedY)) : undefined,
121
+ button: safeString(input.button || input.Button, 24),
122
+ deltaX: Number.isFinite(deltaX) ? Math.max(-4096, Math.min(4096, deltaX)) : 0,
123
+ deltaY: Number.isFinite(deltaY) ? Math.max(-4096, Math.min(4096, deltaY)) : 0,
124
+ key: safeString(input.key || input.Key, 80),
125
+ code: safeString(input.code || input.Code, 80),
126
+ text: safeText(input.text || input.Text, 256),
127
+ repeat: input.repeat === true || input.Repeat === true,
128
+ controlLeaseId: safeString(input.controlLeaseId || input.ControlLeaseId, 128),
129
+ issuedAt: safeString(input.issuedAt || input.IssuedAt, 80)
130
+ };
131
+ }
132
+
110
133
  function readCapabilityFlag(capabilities, key) {
111
134
  const value = capabilities?.[key];
112
135
  if (typeof value === 'boolean') {
@@ -1722,6 +1745,34 @@ export function createRemoteHub(options = {}) {
1722
1745
  return { ok: true, commandId };
1723
1746
  }
1724
1747
 
1748
+ function sendInputControl(deviceId, input = {}) {
1749
+ const device = devices.get(String(deviceId || ''));
1750
+ if (!device) {
1751
+ return { ok: false, error: 'device-not-found' };
1752
+ }
1753
+
1754
+ if (!device.connected) {
1755
+ return { ok: false, error: 'device-not-connected' };
1756
+ }
1757
+
1758
+ if (!readCapabilityFlag(device.capabilities, 'control')) {
1759
+ return { ok: false, error: 'device-input-control-unavailable' };
1760
+ }
1761
+
1762
+ const normalized = normalizeRemoteInputEvent(input);
1763
+ if (!normalized.type) {
1764
+ return { ok: false, error: 'missing-input-type' };
1765
+ }
1766
+
1767
+ return sendCommand(deviceId, {
1768
+ command: 'input.control',
1769
+ payload: {
1770
+ ...normalized,
1771
+ issuedAt: normalized.issuedAt || new Date().toISOString()
1772
+ }
1773
+ });
1774
+ }
1775
+
1725
1776
  function requestAgentTask(deviceId, options = {}) {
1726
1777
  const device = devices.get(String(deviceId || ''));
1727
1778
  if (!device) {
@@ -2131,6 +2182,7 @@ export function createRemoteHub(options = {}) {
2131
2182
  listDeviceFrames,
2132
2183
  disconnectDevice,
2133
2184
  sendCommand,
2185
+ sendInputControl,
2134
2186
  requestAgentTask,
2135
2187
  requestAgentTaskBatch,
2136
2188
  setHostTarget,
@@ -270,6 +270,19 @@ async function runSyntheticEnabledSmoke() {
270
270
  assert.equal(devicesResult.payload?.devices?.length, SYNTHETIC_COUNT);
271
271
  assert.equal(devicesResult.payload.devices.some(device => device.connected === false), true);
272
272
 
273
+ const noControlTarget = devicesResult.payload.devices.find(device => device.connected);
274
+ assert.ok(noControlTarget);
275
+ const inputUnavailable = await fetchJson(`${baseUrl}/api/remote/devices/${encodeURIComponent(noControlTarget.deviceId)}/input`, {
276
+ method: 'POST',
277
+ token: BRIDGE_TOKEN,
278
+ body: JSON.stringify({
279
+ type: 'noop'
280
+ })
281
+ });
282
+ assert.equal(inputUnavailable.ok, true, JSON.stringify(inputUnavailable.payload));
283
+ assert.equal(inputUnavailable.payload?.ok, false);
284
+ assert.equal(inputUnavailable.payload?.error, 'device-input-control-unavailable');
285
+
273
286
  const connectedTargets = devicesResult.payload.devices
274
287
  .filter(device => device.connected && device.capabilities?.taskDispatch)
275
288
  .slice(0, 500)
@@ -73,7 +73,7 @@ try {
73
73
  capabilities: {
74
74
  status: true,
75
75
  thumbnail: false,
76
- control: false,
76
+ control: true,
77
77
  liveStream: true,
78
78
  computerAgent: true,
79
79
  taskDispatch: true,
@@ -99,6 +99,24 @@ try {
99
99
  assert.equal(devices[0].connected, true);
100
100
  assert.equal(hub.getStatus().deviceCount, 1);
101
101
 
102
+ const inputCommand = hub.sendInputControl('smoke-device', {
103
+ type: 'noop'
104
+ });
105
+ assert.equal(inputCommand.ok, true);
106
+ writeJsonLine(socket, {
107
+ type: 'command.result',
108
+ commandId: inputCommand.commandId,
109
+ result: {
110
+ input: true,
111
+ handled: true
112
+ }
113
+ });
114
+ const inputDevice = await waitFor(() => {
115
+ const current = hub.listDevices();
116
+ return current[0]?.counters?.commandResultsReceived === 1 ? current[0] : null;
117
+ });
118
+ assert.equal(inputDevice.counters.commandsSent, 1);
119
+
102
120
  const thumbnailCommand = hub.requestThumbnail('smoke-device', {
103
121
  streamId: 'smoke-thumb',
104
122
  maxWidth: 320,
package/server.js CHANGED
@@ -7398,6 +7398,10 @@ app.post('/api/remote/devices/:deviceId/ping', (req, res) => {
7398
7398
  }));
7399
7399
  });
7400
7400
 
7401
+ app.post('/api/remote/devices/:deviceId/input', (req, res) => {
7402
+ res.json(remoteHub.sendInputControl(req.params.deviceId, req.body || {}));
7403
+ });
7404
+
7401
7405
  app.post('/api/remote/devices/:deviceId/tasks', (req, res) => {
7402
7406
  res.json(remoteHub.requestAgentTask(req.params.deviceId, {
7403
7407
  instruction: req.body?.instruction,