local-mcp 3.0.428 → 3.0.430
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/README.md +53 -76
- package/bundled.js +35 -1
- package/index.js +74 -26
- package/launch-event.js +47 -14
- package/link.js +265 -0
- package/package.json +6 -5
- package/setup.js +63 -102
- package/unconfigure.js +514 -27
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Local MCP
|
|
2
2
|
|
|
3
|
-
> **Use your Mac or Windows PC from ChatGPT & Claude.ai on the web** — plus local tools for Claude Desktop, Cursor, Windsurf, VS Code & Zed. Connect any AI to Mail, Calendar, Contacts, iMessage, Teams, Slack, WhatsApp, Signal, OneDrive, Google Drive, Notion, Microsoft 365, Notes, Reminders, OmniFocus, Word/Excel/PowerPoint and more. Runs on your computer, no API keys — local tools read your data on your machine, and your AI provider receives the content needed for each request.
|
|
3
|
+
> **Use your Mac or Windows PC from ChatGPT & Claude.ai on the web** — plus local tools for Claude Desktop, Cursor, Windsurf (Devin), VS Code & Zed. Connect any AI to Mail, Calendar, Contacts, iMessage, Teams, Slack, WhatsApp, Signal, OneDrive, Google Drive, Notion, Microsoft 365, Notes, Reminders, OmniFocus, Word/Excel/PowerPoint and more. Runs on your computer, no API keys — local tools read your data on your machine, and your AI provider receives the content needed for each request.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/local-mcp)
|
|
6
6
|
[](https://local-mcp.com?ref=npm)
|
|
@@ -16,13 +16,21 @@
|
|
|
16
16
|
|
|
17
17
|
| Method | | Best for |
|
|
18
18
|
|---|---|---|
|
|
19
|
-
| **Installer** | [Download
|
|
20
|
-
| **Terminal** | `curl -fsSL 'https://local-mcp.com/install?ref=npm' \| bash` | One-line setup |
|
|
21
|
-
| **npx** | `npx -y local-mcp@latest setup` | Configuring AI clients from an existing Node environment |
|
|
19
|
+
| **Installer** | [Download LMCP](https://local-mcp.com/download?ref=npm) — picks Mac or Windows for you | Most users |
|
|
20
|
+
| **Terminal** | `curl -fsSL 'https://local-mcp.com/install?ref=npm' \| bash` | One-line setup on a Mac |
|
|
21
|
+
| **npx** | `npx -y local-mcp@latest setup` | Configuring AI clients from an existing Node environment; `link` then links this machine to your LMCP account with a code you approve on the web |
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
**Managed fleets (MDM):** deploy the signed package [`LMCP-Installer.pkg`](https://download.local-mcp.com/LMCP-Installer.pkg) on Macs.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
**Windows without Node.js:** `npx` is not available there. Use the Windows installer instead: [`LMCP-Setup.exe`](https://download.local-mcp.com/LMCP-Setup.exe).
|
|
26
|
+
|
|
27
|
+
Using ChatGPT or Claude.ai on the web needs the LMCP app (installer); npx sets up desktop AI clients.
|
|
28
|
+
|
|
29
|
+
<!-- generado:clientes (scripts/readme-npm.py; no editar a mano) -->
|
|
30
|
+
Auto-detects and configures Claude Desktop, Claude Code, Cursor, Windsurf (Devin), VS Code, Zed, LM Studio, Warp, Antigravity, Cline, Roo Code, Codex, Jan, OpenCode, Goose, and Hermes. Restart your AI client once.
|
|
31
|
+
<!-- /generado:clientes -->
|
|
32
|
+
|
|
33
|
+
> **Cursor users:** tools appear in Agent mode.
|
|
26
34
|
|
|
27
35
|
### MCP config (manual)
|
|
28
36
|
|
|
@@ -75,67 +83,17 @@ LMCP runs a native MCP server that bridges the apps on your Mac or Windows PC to
|
|
|
75
83
|
|
|
76
84
|
|
|
77
85
|
|
|
78
|
-
##
|
|
79
|
-
|
|
80
|
-
Email (12): `list_accounts` `list_email_accounts` `list_emails` `read_email` `send_email` `reply_email` `create_draft` `search_emails` `move_email` `save_attachment` `create_email_folder` `list_email_folders`
|
|
81
|
-
|
|
82
|
-
Calendar (5): `list_calendar_names` `list_calendar_events` `create_calendar_event` `update_calendar_event` `delete_calendar_event`
|
|
83
|
-
|
|
84
|
-
Contacts (3): `list_contacts` `search_contacts` `get_contact`
|
|
85
|
-
|
|
86
|
-
Teams (9): `teams_list_teams` `teams_list_channels` `teams_list_chats` `teams_read_channel_messages` `teams_read_chat_messages` `teams_search_messages` `teams_call_history` `teams_send_message` `teams_send_channel_message`
|
|
87
|
-
|
|
88
|
-
Slack (4): `slack_list_workspaces` `slack_list_channels` `slack_read_channel_messages` `slack_search_messages`
|
|
89
|
-
|
|
90
|
-
WhatsApp (7): `whatsapp_connect` `whatsapp_disconnect` `whatsapp_list_chats` `whatsapp_read_messages` `whatsapp_search_messages` `whatsapp_send_message` `whatsapp_send_file`
|
|
91
|
-
|
|
92
|
-
Signal (5): `signal_connect` `signal_list_chats` `signal_read_messages` `signal_search_messages` `signal_compose_guidance`
|
|
93
|
-
|
|
94
|
-
OneDrive (9): `onedrive_root` `onedrive_list_files` `onedrive_read_file` `onedrive_write_file` `onedrive_move_file` `onedrive_delete_file` `onedrive_search_files` `onedrive_file_info` `onedrive_set_scope`
|
|
95
|
-
|
|
96
|
-
Google Drive (6): `gdrive_root` `gdrive_list_files` `gdrive_read_file` `gdrive_write_file` `gdrive_search_files` `gdrive_file_info`
|
|
97
|
-
|
|
98
|
-
Zoom (2): `zoom_list_recordings` `zoom_read_transcript`
|
|
99
|
-
|
|
100
|
-
Notion (7): `notion_list_pages` `notion_read_page` `notion_search` `notion_list_databases` `notion_read_database` `notion_list_workspaces` `notion_open_page`
|
|
101
|
-
|
|
102
|
-
Documents (9): `word_create` `word_read` `word_append` `excel_create` `excel_read` `excel_write_cell` `ppt_create` `ppt_read` `pdf_read`
|
|
103
|
-
|
|
104
|
-
Image Playground (1): `image_playground_generate`
|
|
86
|
+
## Tools
|
|
105
87
|
|
|
106
|
-
|
|
88
|
+
The full, current list of tools, by app and platform: **[local-mcp.com/tools](https://local-mcp.com/tools?ref=npm)**.
|
|
107
89
|
|
|
108
|
-
|
|
90
|
+
<!-- generado:tools (scripts/readme-npm.py; no editar a mano) -->
|
|
91
|
+
**macOS and Windows:** `agent_ack` `agent_checkin` `agent_inbox` `agent_mesh_create` `agent_mesh_invite` `agent_mesh_join` `agent_mesh_revoke` `agent_mesh_status` `agent_send` `agent_sent` `agents_list` `configure_clients` `connect_m365_account` `connect_servicenow` `connect_todoist` `create_referral_invites` `daily_brief` `disconnect_m365_account` `disconnect_servicenow` `disconnect_todoist` `enable_service` `excel_create` `excel_read` `excel_write_cell` `file_list` `file_read` `file_search` `file_write` `gdrive_disconnect` `gdrive_file_info` `gdrive_list_files` `gdrive_read_file` `gdrive_root` `gdrive_search_files` `gdrive_write_file` `get_audit_log` `get_config` `get_datetime` `get_m365_person` `get_weather` `list_displays` `list_m365_accounts` `list_m365_people_insights` `list_referral_candidates` `list_windows` `lmcp_install_upgrade` `lmcp_state` `lmcp_upgrade_diagnostics` `m365_create_contact` `m365_create_draft` `m365_create_email_folder` `m365_create_event` `m365_delete_event` `m365_get_contact` `m365_list_contacts` `m365_list_email_folders` `m365_list_emails` `m365_list_events` `m365_mark_email_read` `m365_move_email` `m365_read_email` `m365_reply_email` `m365_search_contacts` `m365_search_emails` `m365_send_email` `m365_update_contact` `media_probe` `nordvpn_diagnose` `nordvpn_servers` `nordvpn_status` `obsidian_list_vaults` `obsidian_read_note` `obsidian_search_notes` `obsidian_write_note` `onedrive_delete_file` `onedrive_disconnect` `onedrive_file_info` `onedrive_list_files` `onedrive_move_file` `onedrive_read_file` `onedrive_root` `onedrive_search_files` `onedrive_set_scope` `onedrive_write_file` `outlook_diagnose` `pdf_read` `ppt_create` `ppt_read` `proton_disconnect` `proton_list_emails` `proton_read_email` `proton_search_emails` `proton_send_email` `proton_status` `recipe_delete` `recipe_discover` `recipe_export` `recipe_get` `recipe_import` `recipe_install` `recipe_list` `recipe_rename` `recipe_run` `recipe_runs` `recipe_save` `report_friction` `report_problem` `request_feature` `run_diagnostics` `run_terminal_command` `search_m365_directory` `servicenow_add_comment` `servicenow_create_incident` `servicenow_get_incident` `servicenow_list_my_incidents` `servicenow_search_incidents` `servicenow_search_kb` `servicenow_update_incident` `set_always_allowed` `set_default_m365_account` `set_default_telegram_account` `set_default_whatsapp_account` `slack_disconnect` `slack_list_workspaces` `stocks_get_chart` `stocks_get_quote` `stocks_search_symbol` `submit_diagnostics` `teams_call_history` `teams_list_channels` `teams_list_chats` `teams_list_teams` `teams_read_channel_messages` `teams_read_chat_messages` `teams_search_messages` `teams_send_channel_message` `teams_send_message` `telegram_connect` `telegram_delete_message` `telegram_disconnect` `telegram_list_accounts` `telegram_list_chats` `telegram_read_messages` `telegram_search_messages` `telegram_send_message` `telegram_unwatch_chats` `telegram_watch_chats` `telegram_watch_status` `thunderbird_accounts_status` `thunderbird_disconnect` `thunderbird_list_accounts` `thunderbird_list_emails` `thunderbird_read_email` `thunderbird_search_contacts` `thunderbird_search_emails` `thunderbird_send_email` `todo_complete_task` `todo_create_task` `todo_get_folders` `todo_list_tasks` `todoist_complete_task` `todoist_create_task` `todoist_list_projects` `todoist_list_tasks` `ui_click` `ui_find_element` `ui_get_element` `ui_keystroke` `ui_menu_bar_click` `ui_read_tree` `ui_type` `ui_wait_for_element` `video_blur_region` `video_concat` `video_export_gif` `video_reframe` `video_trim` `web_click` `web_eval` `web_extract` `web_find` `web_login` `web_navigate` `web_read` `web_screenshot` `web_session_close` `web_session_delete` `web_session_list` `web_show` `web_type` `web_wait_for` `whatsapp_connect` `whatsapp_create_group` `whatsapp_diagnose` `whatsapp_disconnect` `whatsapp_forward_message` `whatsapp_group_info` `whatsapp_list_accounts` `whatsapp_list_chats` `whatsapp_list_groups` `whatsapp_read_messages` `whatsapp_read_poll` `whatsapp_save_media` `whatsapp_search_contacts` `whatsapp_search_messages` `whatsapp_send_file` `whatsapp_send_message` `whatsapp_send_poll` `whatsapp_sync` `window_focus` `window_set_frame` `word_append` `word_create` `word_read` `zoom_list_recordings` `zoom_read_transcript`
|
|
109
92
|
|
|
110
|
-
|
|
93
|
+
**macOS only:** `agent_authorize` `agent_mesh_leave` `complete_omnifocus_task` `complete_reminder` `connect_chatgpt` `copy_email` `create_calendar_event` `create_draft` `create_email_folder` `create_note` `create_omnifocus_task` `create_reminder` `create_reminder_list` `delete_calendar_event` `delete_note` `delete_reminder` `delete_reminder_folder` `finder_list` `finder_search` `flag_email` `gdrive_delete_file` `get_contact` `get_reminder_folders` `image_playground_generate` `list_accounts` `list_calendar_events` `list_calendar_names` `list_contacts` `list_email_accounts` `list_email_folders` `list_emails` `list_message_chats` `list_missing_permissions` `list_notes` `list_omnifocus_folders` `list_omnifocus_projects` `list_omnifocus_tags` `list_omnifocus_tasks` `list_reminders` `lmcp_doctor` `mark_email_read` `move_email` `music_add_to_playlist` `music_list_playlists` `music_next_track` `music_now_playing` `music_pause` `music_play` `music_previous_track` `music_search_library` `music_set_volume` `notion_disconnect` `notion_list_databases` `notion_list_pages` `notion_list_workspaces` `notion_open_page` `notion_read_database` `notion_read_page` `notion_search` `permissions_status` `read_email` `read_messages` `read_note` `recipe_submit_for_review` `record_marker` `rename_reminder_folder` `reply_email` `save_attachment` `screen_record_start` `screen_record_status` `screen_record_stop` `screenshot_capture` `search_contacts` `search_emails` `search_messages` `search_notes` `search_omnifocus_tasks` `send_email` `send_message` `shortcuts_list` `shortcuts_run` `shortcuts_view` `signal_compose_guidance` `signal_connect` `signal_disconnect` `signal_list_chats` `signal_read_messages` `signal_search_messages` `slack_list_channels` `slack_read_channel_messages` `slack_search_messages` `survey_respond` `survey_skip` `update_calendar_event` `update_note` `update_reminder` `zalo_connect` `zalo_diagnose` `zalo_disconnect` `zalo_list_chats` `zalo_read_messages` `zalo_search_messages` `zalo_send_message`
|
|
111
94
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
Notes (5): `list_notes` `read_note` `search_notes` `create_note` `update_note`
|
|
115
|
-
|
|
116
|
-
Messages (4): `list_message_chats` `read_messages` `search_messages` `send_message`
|
|
117
|
-
|
|
118
|
-
Stocks (3): `stocks_get_quote` `stocks_get_chart` `stocks_search_symbol`
|
|
119
|
-
|
|
120
|
-
Weather (1): `get_weather`
|
|
121
|
-
|
|
122
|
-
Finder (5): `finder_search` `finder_list` `fs_list` `fs_read` `fs_search`
|
|
123
|
-
|
|
124
|
-
Web (13): `web_login` `web_navigate` `web_read` `web_find` `web_click` `web_type` `web_extract` `web_wait_for` `web_screenshot` `web_show` `web_eval` `web_session_list` `web_session_close`
|
|
125
|
-
|
|
126
|
-
Microsoft 365 (16): `connect_m365_account` `disconnect_m365_account` `m365_list_emails` `m365_read_email` `m365_send_email` `m365_reply_email` `m365_search_emails` `m365_list_events` `m365_create_event` `m365_delete_event` `search_m365_directory` `get_m365_person` `list_m365_people_insights` `m365_list_contacts` `m365_search_contacts` `m365_get_contact`
|
|
127
|
-
|
|
128
|
-
ServiceNow (9): `connect_servicenow` `disconnect_servicenow` `servicenow_list_my_incidents` `servicenow_search_incidents` `servicenow_get_incident` `servicenow_create_incident` `servicenow_update_incident` `servicenow_add_comment` `servicenow_search_kb`
|
|
129
|
-
|
|
130
|
-
NordVPN (3): `nordvpn_status` `nordvpn_servers` `nordvpn_diagnose`
|
|
131
|
-
|
|
132
|
-
Referral (2): `create_referral_invites` `list_referral_candidates`
|
|
133
|
-
|
|
134
|
-
Agent mesh (9): `agent_mesh_status` `agent_mesh_create` `agent_mesh_invite` `agent_mesh_join` `agent_mesh_revoke` `agent_checkin` `agents_list` `agent_send` `agent_inbox`
|
|
135
|
-
|
|
136
|
-
System (12): `lmcp_state` `get_config` `get_datetime` `daily_brief` `run_diagnostics` `get_audit_log` `lmcp_install_upgrade` `lmcp_upgrade_diagnostics` `report_problem` `request_feature` `report_friction` `run_terminal_command`
|
|
137
|
-
|
|
138
|
-
Shortcuts (3): `shortcuts_list` `shortcuts_run` `shortcuts_view`
|
|
95
|
+
**Windows only:** `explorer_list` `explorer_search` `gdrive_set_scope` `outlook_calendar_create_event` `outlook_calendar_delete_event` `outlook_calendar_list_events` `outlook_calendar_list_names` `outlook_contacts_list` `outlook_contacts_search` `outlook_create_folder` `outlook_flag_email` `outlook_forward_email` `outlook_get_contact` `outlook_list_accounts` `outlook_list_emails` `outlook_mark_email_read` `outlook_move_email` `outlook_read_email` `outlook_reply_all` `outlook_reply_email` `outlook_save_attachment` `outlook_search_emails` `outlook_send_email` `sharepoint_list_files` `sharepoint_list_sites` `sharepoint_read_file` `todo_list_lists` `update_local_mcp` `update_self_diagnosis`
|
|
96
|
+
<!-- /generado:tools -->
|
|
139
97
|
|
|
140
98
|
|
|
141
99
|
|
|
@@ -153,8 +111,8 @@ Shortcuts (3): `shortcuts_list` `shortcuts_run` `shortcuts_view`
|
|
|
153
111
|
Full policy: **[local-mcp.com/en/privacy](https://local-mcp.com/en/privacy)**.
|
|
154
112
|
|
|
155
113
|
- **What we collect from your apps:** Nothing. Reading email, calendar, contacts, messages, files, and other Mac apps runs entirely on your machine — no email content, calendar events, contacts, messages, or file contents are ever transmitted to our servers or any third party. No API keys or accounts are required for your apps.
|
|
156
|
-
- **Anonymous telemetry:** server/OS version, CPU architecture, uptime, a hashed machine ID, and tool-call counts (never content). No personal information included. Disable in LMCP
|
|
157
|
-
- **Optional cloud relay:** opt-in and disabled by default. When enabled, MCP traffic you initiate passes through an encrypted WebSocket tunnel and is never stored
|
|
114
|
+
- **Anonymous telemetry:** server/OS version, CPU architecture, uptime, a hashed machine ID, and tool-call counts (never content). No personal information included. Disable it in the LMCP menu-bar / tray settings.
|
|
115
|
+
- **Optional cloud relay:** opt-in and disabled by default. When enabled, MCP traffic you initiate passes through an encrypted WebSocket tunnel and is never stored. The tunnel belongs to the LMCP account you sign in with; no email is typed in to set it up.
|
|
158
116
|
- **Third-party sharing:** none. Hosting/CDN providers (Railway, Cloudflare) never receive your personal Mac data.
|
|
159
117
|
- **Retention:** heartbeats 90 days; install events 12 months (anonymized after); account records for their duration + 1 year; feedback until resolved or deleted on request.
|
|
160
118
|
- **Contact:** privacy and data-rights requests — [privacy@local-mcp.com](mailto:privacy@local-mcp.com).
|
|
@@ -164,18 +122,32 @@ Full policy: **[local-mcp.com/en/privacy](https://local-mcp.com/en/privacy)**.
|
|
|
164
122
|
## Requirements
|
|
165
123
|
|
|
166
124
|
- macOS 13 Ventura or later (Apple Silicon and Intel), or Windows 10 or later (64-bit)
|
|
167
|
-
|
|
125
|
+
<!-- generado:rutas (scripts/readme-npm.py; no editar a mano) -->
|
|
126
|
+
- One of: Claude Desktop, Claude Code, Cursor, Windsurf (Devin), VS Code, Zed, LM Studio, Warp, Antigravity, Cline, Roo Code, Codex, Jan, OpenCode, Goose, and Hermes
|
|
168
127
|
|
|
169
128
|
### Config file locations
|
|
170
129
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
|
174
|
-
|
|
175
|
-
|
|
|
176
|
-
|
|
|
177
|
-
|
|
|
178
|
-
|
|
|
130
|
+
`{host}` is the VS Code-family editor that hosts the extension: `Code`, `Code - Insiders`, `Cursor` or `VSCodium`.
|
|
131
|
+
|
|
132
|
+
| Client | macOS | Windows |
|
|
133
|
+
|--------|-------|---------|
|
|
134
|
+
| Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` | `%APPDATA%/Claude/claude_desktop_config.json`<br>`%LOCALAPPDATA%/Packages/Claude_*/LocalCache/Roaming/Claude/claude_desktop_config.json` |
|
|
135
|
+
| Claude Code | `~/.claude.json` | `~/.claude.json` |
|
|
136
|
+
| Cursor | `~/.cursor/mcp.json` | `~/.cursor/mcp.json` |
|
|
137
|
+
| Windsurf (Devin) | `~/.config/devin/mcp_config.json`<br>`~/.codeium/windsurf/mcp_config.json` | `~/.codeium/windsurf/mcp_config.json` |
|
|
138
|
+
| VS Code | `~/Library/Application Support/Code/User/mcp.json` | `%APPDATA%/Code/User/mcp.json` |
|
|
139
|
+
| Zed | `~/.config/zed/settings.json` | `%APPDATA%/Zed/settings.json` |
|
|
140
|
+
| LM Studio | `~/.lmstudio/mcp.json` | `~/.lmstudio/mcp.json` |
|
|
141
|
+
| Warp | `~/.warp/.mcp.json` | `~/.warp/.mcp.json` |
|
|
142
|
+
| Antigravity | `~/.gemini/config/mcp_config.json`<br>`~/.gemini/antigravity/mcp_config.json` | `~/.gemini/config/mcp_config.json`<br>`~/.gemini/antigravity/mcp_config.json` |
|
|
143
|
+
| Cline | `~/Library/Application Support/{host}/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` | `%APPDATA%/{host}/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` |
|
|
144
|
+
| Roo Code | `~/Library/Application Support/{host}/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json` | `%APPDATA%/{host}/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json` |
|
|
145
|
+
| Codex | `~/.codex/config.toml` | `~/.codex/config.toml` |
|
|
146
|
+
| Jan | `~/Library/Application Support/Jan/data/mcp_config.json` | `%APPDATA%/Jan/data/mcp_config.json` |
|
|
147
|
+
| OpenCode | `~/.config/opencode/opencode.json` | `~/.config/opencode/opencode.json` |
|
|
148
|
+
| Goose | `~/.config/goose/config.yaml` | `%APPDATA%/Block/goose/config/config.yaml` |
|
|
149
|
+
| Hermes | `~/.hermes/config.yaml` | `%LOCALAPPDATA%/hermes/config.yaml` |
|
|
150
|
+
<!-- /generado:rutas -->
|
|
179
151
|
|
|
180
152
|
|
|
181
153
|
|
|
@@ -183,6 +155,7 @@ Full policy: **[local-mcp.com/en/privacy](https://local-mcp.com/en/privacy)**.
|
|
|
183
155
|
|
|
184
156
|
```bash
|
|
185
157
|
npx -y local-mcp@latest setup # configure all detected AI clients
|
|
158
|
+
npx -y local-mcp@latest link # link this machine to your LMCP account (a code you approve on the web)
|
|
186
159
|
npx -y local-mcp@latest update # how to update (npx -y local-mcp@latest)
|
|
187
160
|
npx -y local-mcp@latest status # show server status
|
|
188
161
|
```
|
|
@@ -193,14 +166,18 @@ The LMCP server ships inside the npm package: npm installs the signed binary for
|
|
|
193
166
|
|
|
194
167
|
## Uninstall
|
|
195
168
|
|
|
169
|
+
Mac:
|
|
170
|
+
|
|
196
171
|
```bash
|
|
197
172
|
curl -fsSL 'https://local-mcp.com/uninstall' | bash
|
|
198
173
|
```
|
|
199
174
|
|
|
200
|
-
|
|
175
|
+
On a Mac: stops all background processes, removes the LaunchAgent, deletes the app and binaries, and cleans up MCP config entries from every configured AI client.
|
|
176
|
+
|
|
177
|
+
On Windows: **Settings → Apps → Installed apps → LMCP → Uninstall**. Your emails, calendar, and other data are never stored by LMCP and remain completely untouched.
|
|
201
178
|
|
|
202
179
|
|
|
203
180
|
|
|
204
181
|
## Links
|
|
205
182
|
|
|
206
|
-
[Website](https://local-mcp.com?ref=npm) · [GitHub](https://github.com/colibird-ai/local-mcp-releases) · [Guides](https://local-mcp.com/guides) · Support:
|
|
183
|
+
[Website](https://local-mcp.com?ref=npm) · [GitHub](https://github.com/colibird-ai/local-mcp-releases) · [Guides](https://local-mcp.com/guides) · [Tools](https://local-mcp.com/tools?ref=npm) · Support: [hello@local-mcp.com](mailto:hello@local-mcp.com)
|
package/bundled.js
CHANGED
|
@@ -22,6 +22,40 @@ const TARGETS = {
|
|
|
22
22
|
'win32-arm64': { pkg: 'local-mcp-windows-arm64', os: 'win32', cpu: 'arm64', bin: 'lmcp-server.exe', url: 'windows_arm64', hash: 'windows-arm64' },
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
// lmcp-npm#138: every server command the wrapper runs → the first release that has it, per OS.
|
|
26
|
+
// npm 3.0.429 shipped link.js with the 3.0.428 servers, which lack `link --json` (lmcp-win#1227,
|
|
27
|
+
// lmcp-mac#1457). scripts/paquetes-plataforma.sh refuses a binary below a floor, so the wrapper never
|
|
28
|
+
// publishes ahead of its servers; test/servidor-minimo-138.test.js holds every command to this table.
|
|
29
|
+
// 3.0.423 is the first release npm carries: older commands need nothing more.
|
|
30
|
+
const SERVER_MIN = {
|
|
31
|
+
'--auto': { darwin: '3.0.423', win32: '3.0.423' },
|
|
32
|
+
'--version': { darwin: '3.0.423', win32: '3.0.423' },
|
|
33
|
+
'--export-tools': { darwin: '3.0.423', win32: '3.0.423' },
|
|
34
|
+
// `extra`: value flags setup.js pushes onto the command (`--command=<c>`, `--arg=<a>`), same release.
|
|
35
|
+
'--configure-clients --json': { darwin: '3.0.423', win32: '3.0.423', extra: ['--command=', '--arg='] },
|
|
36
|
+
'link --json': { darwin: '3.0.429', win32: '3.0.429' },
|
|
37
|
+
'link --approve --json': { darwin: '3.0.429', win32: '3.0.429' },
|
|
38
|
+
'link --deny --json': { darwin: '3.0.429', win32: '3.0.429' },
|
|
39
|
+
// lmcp-api#761: optional. The wrapper goes on without it (runRegister reads «unsupported»), so it never
|
|
40
|
+
// holds a package back. Each OS's floor is set when that OS's release ships the subcommand: the Mac
|
|
41
|
+
// and Windows numbers are independent lines, the same number is not the same features.
|
|
42
|
+
'register --json': { darwin: null, win32: null, optional: true },
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const _version = (v) => (/^\d+\.\d+\.\d+$/.test(String(v)) ? String(v).split('.').map(Number) : null)
|
|
46
|
+
|
|
47
|
+
/** The commands a server of `os` at release `version` lacks; all of them when the version is unreadable. */
|
|
48
|
+
function serverMissing (os, version) {
|
|
49
|
+
const v = _version(version)
|
|
50
|
+
return Object.keys(SERVER_MIN).filter((c) => {
|
|
51
|
+
if (SERVER_MIN[c].optional) return false
|
|
52
|
+
const min = _version(SERVER_MIN[c][os])
|
|
53
|
+
if (!v || !min) return true
|
|
54
|
+
const d = v.findIndex((x, i) => x !== min[i])
|
|
55
|
+
return d !== -1 && v[d] < min[d]
|
|
56
|
+
}).sort()
|
|
57
|
+
}
|
|
58
|
+
|
|
25
59
|
/**
|
|
26
60
|
* Absolute path of the bundled server for this platform, or null when there is none: an
|
|
27
61
|
* unsupported platform/arch, or the platform package was not installed (`--omit=optional`, a
|
|
@@ -37,4 +71,4 @@ function bundledServerPath (platform = process.platform, arch = process.arch, re
|
|
|
37
71
|
}
|
|
38
72
|
}
|
|
39
73
|
|
|
40
|
-
module.exports = { TARGETS, bundledServerPath }
|
|
74
|
+
module.exports = { TARGETS, SERVER_MIN, serverMissing, bundledServerPath }
|
package/index.js
CHANGED
|
@@ -74,6 +74,8 @@ function marcarAvisoDesinstalado() {
|
|
|
74
74
|
// client would relaunch it in a loop). It stays alive on stdio and answers initialize and every tool
|
|
75
75
|
// with a clear error, until the client closes stdin. Newline-delimited JSON-RPC, no dependencies.
|
|
76
76
|
const MENSAJE_DESINSTALADO = 'LMCP was uninstalled; remove it from this AI client'
|
|
77
|
+
// #159: said before anything is touched. Stopping the server instead would end a live AI session.
|
|
78
|
+
const UNINSTALL_IN_USE = 'LMCP was not uninstalled: an open AI app is using it, and nothing was changed.\nClose your AI apps, then run again: npx -y local-mcp@latest uninstall'
|
|
77
79
|
function quedarseVivoDesinstalado() {
|
|
78
80
|
evento.silenciar()
|
|
79
81
|
if (process.stdin.isTTY) process.exit(0)
|
|
@@ -123,7 +125,7 @@ const cmd = process.argv[2]
|
|
|
123
125
|
|
|
124
126
|
// Comandos que este wrapper entiende. Sin argumentos arranca el server MCP por stdio, que es
|
|
125
127
|
// como lo lanzan los clientes de IA — ese camino NO cambia.
|
|
126
|
-
const COMANDOS = ['setup', 'update', 'uninstall', 'status']
|
|
128
|
+
const COMANDOS = ['setup', 'link', 'update', 'uninstall', 'status']
|
|
127
129
|
const PEDIDOS_DE_AYUDA = ['--help', '-h', 'help']
|
|
128
130
|
|
|
129
131
|
// Evento de lanzamiento (launch-event.js, #11): cada lanzamiento del camino del server reporta
|
|
@@ -136,10 +138,15 @@ function reportarLanzamiento(outcome, opciones) {
|
|
|
136
138
|
}
|
|
137
139
|
// Antes que nada: un `spawned` que en Windows esperaba su id sale ahora, por el proceso suelto (#21).
|
|
138
140
|
// La red dice además por qué (#82), como clase: una excepción que nadie atrapó, o no se sabe.
|
|
141
|
+
// #133: la excepción lleva su clase o su código de Node (evento.claseDeError), nunca el mensaje.
|
|
139
142
|
let razonDeSalida = 'unknown'
|
|
143
|
+
let claseDeSalida
|
|
140
144
|
if (ES_LANZAMIENTO) {
|
|
141
|
-
process.on('uncaughtExceptionMonitor', () => { razonDeSalida = 'uncaught-exception' })
|
|
142
|
-
process.on('exit', () => {
|
|
145
|
+
process.on('uncaughtExceptionMonitor', (err) => { razonDeSalida = 'uncaught-exception'; claseDeSalida = evento.claseDeError(err) })
|
|
146
|
+
process.on('exit', () => {
|
|
147
|
+
evento.soltarPendiente()
|
|
148
|
+
reportarLanzamiento('other', { reason: razonDeSalida, errorClass: claseDeSalida })
|
|
149
|
+
})
|
|
143
150
|
}
|
|
144
151
|
// #82: un server que sale con error dentro de esta ventana no arrancó. El `spawned` espera a que
|
|
145
152
|
// pase; el server y el cliente no esperan nada: sólo se demora el evento.
|
|
@@ -201,15 +208,18 @@ const SINONIMOS_DEL_SERVER = ['stdio']
|
|
|
201
208
|
function mostrarAyuda() {
|
|
202
209
|
console.log(`local-mcp — Local MCP Server
|
|
203
210
|
|
|
204
|
-
|
|
205
|
-
local-mcp
|
|
206
|
-
local-mcp stdio
|
|
207
|
-
local-mcp setup
|
|
208
|
-
local-mcp
|
|
209
|
-
local-mcp
|
|
210
|
-
local-mcp
|
|
211
|
-
|
|
212
|
-
local-mcp
|
|
211
|
+
Usage:
|
|
212
|
+
local-mcp start the MCP server over stdio (what an AI app does)
|
|
213
|
+
local-mcp stdio the same, said explicitly
|
|
214
|
+
local-mcp setup install and configure your AI apps
|
|
215
|
+
local-mcp link link this computer to your LMCP account (a code)
|
|
216
|
+
local-mcp link --approve approve a pending link on this computer
|
|
217
|
+
local-mcp link --deny decline a pending link on this computer
|
|
218
|
+
local-mcp status show the status
|
|
219
|
+
local-mcp update how to update (npx -y local-mcp@latest)
|
|
220
|
+
local-mcp uninstall uninstall
|
|
221
|
+
|
|
222
|
+
local-mcp --help this help`)
|
|
213
223
|
}
|
|
214
224
|
|
|
215
225
|
async function main() {
|
|
@@ -231,7 +241,7 @@ async function main() {
|
|
|
231
241
|
const pedidoDeAyuda = PEDIDOS_DE_AYUDA.includes(cmd)
|
|
232
242
|
mostrarAyuda()
|
|
233
243
|
if (!pedidoDeAyuda) {
|
|
234
|
-
console.error(`\
|
|
244
|
+
console.error(`\nUnknown command "${cmd}".`)
|
|
235
245
|
reportarLanzamiento('rejected-argument')
|
|
236
246
|
}
|
|
237
247
|
process.exit(pedidoDeAyuda ? 0 : 2)
|
|
@@ -246,17 +256,32 @@ async function main() {
|
|
|
246
256
|
process.exit(process.platform === 'linux' ? 1 : 0)
|
|
247
257
|
}
|
|
248
258
|
|
|
259
|
+
// #125: vuelve a mostrar el link y el código de la máquina y espera la aprobación (~2 min).
|
|
260
|
+
// Sale 0 como `status`: el estado está escrito en la salida, y un agente lo lee de ahí.
|
|
261
|
+
if (cmd === 'link') {
|
|
262
|
+
await require('./link').runLinkCommand(process.argv.slice(3))
|
|
263
|
+
return
|
|
264
|
+
}
|
|
265
|
+
|
|
249
266
|
// 3.0.423: el server viene dentro del paquete; no hay runtime en cache que borrar (ese directorio
|
|
250
267
|
// guarda el id de la máquina y el token del relay, que no son del server de npm).
|
|
251
268
|
if (cmd === 'update') {
|
|
252
|
-
console.log('
|
|
253
|
-
console.log('
|
|
269
|
+
console.log('The LMCP server ships inside the npm package. For the latest version: npx -y local-mcp@latest')
|
|
270
|
+
console.log('With the LMCP app installed, the app updates itself.')
|
|
254
271
|
return
|
|
255
272
|
}
|
|
256
273
|
|
|
257
274
|
if (cmd === 'uninstall') {
|
|
258
275
|
const { CACHE_DIR } = require('./download')
|
|
259
276
|
const fs = require('fs')
|
|
277
|
+
const { runtimeInUse } = require('./unconfigure')
|
|
278
|
+
|
|
279
|
+
// #159: with the app the runtime stays, so what runs from it does not matter.
|
|
280
|
+
if (!menuBarAppInstalled() && runtimeInUse(CACHE_DIR).length) {
|
|
281
|
+
console.error(UNINSTALL_IN_USE)
|
|
282
|
+
process.exitCode = 1
|
|
283
|
+
return
|
|
284
|
+
}
|
|
260
285
|
|
|
261
286
|
if (process.platform === 'darwin') {
|
|
262
287
|
const home = os.homedir()
|
|
@@ -293,23 +318,40 @@ async function main() {
|
|
|
293
318
|
? JSON.parse(fs.readFileSync(catalogFile, 'utf8'))
|
|
294
319
|
: await require('./setup')._fetchClientsCatalog()
|
|
295
320
|
if (!catalog) {
|
|
296
|
-
console.log('
|
|
321
|
+
console.log('Could not read the AI app catalog: the "local-mcp" entries in your AI apps stay; remove them by hand.')
|
|
297
322
|
} else {
|
|
298
323
|
const r = unconfigureClients(catalog)
|
|
299
|
-
for (const x of r.removed) console.log(`
|
|
300
|
-
for (const x of r.left) console.log(`
|
|
324
|
+
for (const x of r.removed) console.log(`Removed the local-mcp entry from ${x.client}: ${x.file}`)
|
|
325
|
+
for (const x of r.left) console.log(`Left in ${x.client}${x.file ? ' (' + x.file + ')' : ''}: ${x.reason}; remove "local-mcp" by hand.`)
|
|
301
326
|
}
|
|
302
327
|
} catch (e) {
|
|
303
|
-
console.log('
|
|
328
|
+
console.log('Could not remove the entries from your AI apps: ' + e.message)
|
|
304
329
|
}
|
|
305
330
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
331
|
+
// #144: on Windows the installed app shares the runtime folder (its lmcp-tray.exe lives there),
|
|
332
|
+
// the Roaming config and both credentials. Read before anything is removed; with the app, none of it is.
|
|
333
|
+
const { localState, removeLocalState, localStateReport } = require('./unconfigure')
|
|
334
|
+
const st = localState({ appInstalled: menuBarAppInstalled() })
|
|
335
|
+
if (st && st.appInstalled) {
|
|
336
|
+
console.log(`The LMCP app is installed: its runtime (${CACHE_DIR}), settings and sign-in stay. Uninstall the app from Windows Settings to remove them.`)
|
|
337
|
+
} else if (fs.existsSync(CACHE_DIR)) {
|
|
338
|
+
try {
|
|
339
|
+
fs.rmSync(CACHE_DIR, { recursive: true, force: true })
|
|
340
|
+
} catch (e) { // #159: started after the check, or held some other way
|
|
341
|
+
console.error(`LMCP was not fully uninstalled (${e.code}): close your AI apps, then run again: npx -y local-mcp@latest uninstall`)
|
|
342
|
+
process.exitCode = 1
|
|
343
|
+
return
|
|
344
|
+
}
|
|
345
|
+
console.log(`Removed the runtime from ${CACHE_DIR}`)
|
|
309
346
|
} else {
|
|
310
|
-
console.log('No
|
|
347
|
+
console.log('No cached runtime.')
|
|
348
|
+
}
|
|
349
|
+
// #144: without the app, also the relay token, the device key, the Roaming config, logs and caches.
|
|
350
|
+
try {
|
|
351
|
+
for (const line of localStateReport(removeLocalState(st))) console.log(line)
|
|
352
|
+
} catch (e) {
|
|
353
|
+
console.log('Could not remove all of LMCP\'s data: ' + e.message)
|
|
311
354
|
}
|
|
312
|
-
console.log('Local MCP desinstalado correctamente.')
|
|
313
355
|
return
|
|
314
356
|
}
|
|
315
357
|
|
|
@@ -324,7 +366,8 @@ async function main() {
|
|
|
324
366
|
console.log(`LMCP v${s.version} — ${s.server}`)
|
|
325
367
|
} catch { console.log(data) }
|
|
326
368
|
})
|
|
327
|
-
|
|
369
|
+
// #124 (7): without the LMCP app nothing listens on 8765, and that is the npx mode, not a failure.
|
|
370
|
+
}).on('error', () => console.log(`LMCP v${require('./package.json').version} — no background service: the server is started by your AI app when it needs it (npx -y local-mcp@latest).`))
|
|
328
371
|
return
|
|
329
372
|
}
|
|
330
373
|
|
|
@@ -465,7 +508,11 @@ async function main() {
|
|
|
465
508
|
if (arranque) {
|
|
466
509
|
clearTimeout(arranque)
|
|
467
510
|
if (code === 0) reportarLanzamiento('spawned')
|
|
468
|
-
else
|
|
511
|
+
else if (signal) {
|
|
512
|
+
// #133: el cliente que cierra el server es `client-closed`; una señal de caída sigue siendo una falla.
|
|
513
|
+
const s = evento.salidaPorSenal(signal)
|
|
514
|
+
reportarLanzamiento(s.outcome, { reason: s.reason, signal: s.signal })
|
|
515
|
+
} else reportarLanzamiento('spawn-failed', { reason: 'early-exit' })
|
|
469
516
|
}
|
|
470
517
|
process.exit(code ?? 0)
|
|
471
518
|
})
|
|
@@ -508,6 +555,7 @@ async function main() {
|
|
|
508
555
|
if (require.main === module) {
|
|
509
556
|
main().catch(err => {
|
|
510
557
|
razonDeSalida = 'uncaught-exception'
|
|
558
|
+
claseDeSalida = evento.claseDeError(err)
|
|
511
559
|
process.stderr.write(`Error fatal: ${err.message}\n`)
|
|
512
560
|
process.exit(1)
|
|
513
561
|
})
|
package/launch-event.js
CHANGED
|
@@ -20,7 +20,7 @@ const DESTINO = { hostname: 'office-mcp-production.up.railway.app', path: '/laun
|
|
|
20
20
|
const PLATAFORMAS = ['darwin', 'win32', 'linux', 'other']
|
|
21
21
|
const CLASES = ['none', 'stdio', 'unknown', 'start', 'serve', 'server', 'run', 'mcp', '--stdio', 'other-word', 'other-flag']
|
|
22
22
|
const OUTCOMES = ['spawned', 'rejected-argument', 'unsupported-node', 'unsupported-platform',
|
|
23
|
-
'download-failed', 'spawn-failed', 'uninstalled', 'other']
|
|
23
|
+
'download-failed', 'spawn-failed', 'uninstalled', 'other', 'client-closed']
|
|
24
24
|
// #82: por qué falló, como clase. Sólo acompaña a un outcome de falla, y sólo donde hay algo que
|
|
25
25
|
// clasificar (`download-failed`, `spawn-failed`, `other`); `checksum-mismatch` e `init-failed`
|
|
26
26
|
// son del contrato y este wrapper no los produce.
|
|
@@ -32,6 +32,23 @@ const CAMINO = 'npm-wrapper' // launch_path: quién arrancó el server
|
|
|
32
32
|
const FUENTES = ['bundled', 'app_embedded', 'missing_platform']
|
|
33
33
|
let fuenteBinario
|
|
34
34
|
function fuente (valor) { if (FUENTES.includes(valor)) fuenteBinario = valor }
|
|
35
|
+
// #133: la señal que terminó al server, por su nombre. Las que un cliente manda para cerrarlo son `client-closed`,
|
|
36
|
+
// no una falla; las demás son una caída. SIGKILL queda como caída: puede ser el cliente, pero también el sistema
|
|
37
|
+
// matando al proceso, y desde acá no se distingue.
|
|
38
|
+
const SENALES = ['SIGTERM', 'SIGINT', 'SIGHUP', 'SIGQUIT', 'SIGKILL', 'SIGPIPE', 'SIGSEGV', 'SIGABRT', 'SIGBUS',
|
|
39
|
+
'SIGILL', 'SIGFPE', 'SIGTRAP', 'SIGUSR1', 'SIGUSR2', 'SIGBREAK']
|
|
40
|
+
const DEL_CLIENTE = ['SIGTERM', 'SIGINT', 'SIGHUP', 'SIGQUIT', 'SIGPIPE', 'SIGBREAK']
|
|
41
|
+
function salidaPorSenal (signal) {
|
|
42
|
+
const s = SENALES.includes(signal) ? { signal } : {}
|
|
43
|
+
return DEL_CLIENTE.includes(signal) ? { outcome: 'client-closed', ...s } : { outcome: 'spawn-failed', reason: 'signal', ...s }
|
|
44
|
+
}
|
|
45
|
+
// #133: de una excepción no atrapada viaja su código de Node o su clase, nunca el mensaje.
|
|
46
|
+
const RE_CLASE_ERROR = /^[A-Za-z][A-Za-z0-9_]{0,47}$/
|
|
47
|
+
function claseDeError (err) {
|
|
48
|
+
if (!err || typeof err !== 'object') return undefined
|
|
49
|
+
for (const v of [err.code, err.name]) if (typeof v === 'string' && RE_CLASE_ERROR.test(v)) return v
|
|
50
|
+
return undefined
|
|
51
|
+
}
|
|
35
52
|
const RE_VERSION = /^\d{1,3}\.\d{1,3}\.\d{1,5}$/
|
|
36
53
|
const RE_MAQUINA = /^[A-Za-z0-9._:{}-]{1,64}$/
|
|
37
54
|
const [TIMEOUT_MS, TOPE_MS] = [3000, 4000] // el pedido · la vida del proceso suelto
|
|
@@ -90,7 +107,11 @@ function cuerpo (outcome, clase, deps = {}) {
|
|
|
90
107
|
launch_path: CAMINO
|
|
91
108
|
}
|
|
92
109
|
// Una razón fuera del conjunto no viaja, y un `spawned` no lleva razón; el evento sale igual.
|
|
93
|
-
if (outcome !== 'spawned' && RAZONES.includes(deps.reason)) c.reason = deps.reason
|
|
110
|
+
if (outcome !== 'spawned' && outcome !== 'client-closed' && RAZONES.includes(deps.reason)) c.reason = deps.reason
|
|
111
|
+
if (SENALES.includes(deps.signal) && (outcome === 'client-closed' || c.reason === 'signal')) c.signal_name = deps.signal
|
|
112
|
+
if (outcome !== 'spawned' && typeof deps.errorClass === 'string' && RE_CLASE_ERROR.test(deps.errorClass)) {
|
|
113
|
+
c.error_class = deps.errorClass
|
|
114
|
+
}
|
|
94
115
|
const f = 'binarySource' in deps ? deps.binarySource : fuenteBinario
|
|
95
116
|
if (FUENTES.includes(f)) c.binary_source = f
|
|
96
117
|
const id = 'machineId' in deps ? deps.machineId : idDeMaquina()
|
|
@@ -176,7 +197,7 @@ function idDeHardwareWindows (listo) {
|
|
|
176
197
|
// Una persona en una terminal (stdin TTY) no es un cliente de IA lanzando el server: no reporta.
|
|
177
198
|
let reportado = false
|
|
178
199
|
let pendiente = null
|
|
179
|
-
function reportar (outcome, clase, { enProceso = false, reason } = {}) {
|
|
200
|
+
function reportar (outcome, clase, { enProceso = false, reason, signal, errorClass } = {}) {
|
|
180
201
|
if (reportado) return
|
|
181
202
|
reportado = true
|
|
182
203
|
try {
|
|
@@ -207,7 +228,7 @@ function reportar (outcome, clase, { enProceso = false, reason } = {}) {
|
|
|
207
228
|
if (c) enviar(c, { soltar: true })
|
|
208
229
|
return
|
|
209
230
|
}
|
|
210
|
-
lanzarSuelto(outcome, clase, reason)
|
|
231
|
+
lanzarSuelto(outcome, clase, { reason, signal, errorClass })
|
|
211
232
|
} catch {}
|
|
212
233
|
}
|
|
213
234
|
|
|
@@ -215,11 +236,24 @@ function reportar (outcome, clase, { enProceso = false, reason } = {}) {
|
|
|
215
236
|
// como reportado para que la red del `exit` tampoco lo mande como `other`.
|
|
216
237
|
function silenciar () { reportado = true }
|
|
217
238
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
...(FUENTES.includes(fuenteBinario) ? [fuenteBinario] : [])
|
|
239
|
+
// La razón, la fuente del binario y la señal viajan como argumento sólo si son del conjunto (los tres no se
|
|
240
|
+
// cruzan); la clase de error, sólo si pasa su regex y con prefijo. Al proceso suelto no le llega texto libre.
|
|
241
|
+
function argumentosSueltos (outcome, clase, { reason, signal, errorClass } = {}) {
|
|
242
|
+
return [outcome, clase, ...(RAZONES.includes(reason) ? [reason] : []),
|
|
243
|
+
...(FUENTES.includes(fuenteBinario) ? [fuenteBinario] : []),
|
|
244
|
+
...(SENALES.includes(signal) ? [signal] : []),
|
|
245
|
+
...(typeof errorClass === 'string' && RE_CLASE_ERROR.test(errorClass) ? ['error_class=' + errorClass] : [])]
|
|
246
|
+
}
|
|
247
|
+
function desdeArgv (argv) {
|
|
248
|
+
const resto = argv.slice(2)
|
|
249
|
+
const clase = resto.map(a => a.startsWith('error_class=') ? a.slice(12) : null).find(a => a !== null)
|
|
250
|
+
return { outcome: argv[0], clase: argv[1], reason: resto.find(a => RAZONES.includes(a)),
|
|
251
|
+
binarySource: resto.find(a => FUENTES.includes(a)), signal: resto.find(a => SENALES.includes(a)),
|
|
252
|
+
errorClass: clase !== undefined && RE_CLASE_ERROR.test(clase) ? clase : undefined }
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function lanzarSuelto (outcome, clase, opciones) {
|
|
256
|
+
const hijo = cp.spawn(process.execPath, [__filename, ...argumentosSueltos(outcome, clase, opciones)],
|
|
223
257
|
{ detached: true, stdio: 'ignore', windowsHide: true })
|
|
224
258
|
hijo.on('error', () => {})
|
|
225
259
|
hijo.unref()
|
|
@@ -238,12 +272,11 @@ function soltarPendiente () {
|
|
|
238
272
|
// Como programa es el proceso suelto: `node launch-event.js <outcome> <clase> [reason] [binary_source]`.
|
|
239
273
|
if (require.main === module) {
|
|
240
274
|
setTimeout(() => process.exit(0), TOPE_MS).unref()
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
binarySource: process.argv.slice(4).find(a => FUENTES.includes(a))
|
|
244
|
-
})
|
|
275
|
+
const a = desdeArgv(process.argv.slice(2))
|
|
276
|
+
const c = apagado() ? null : cuerpo(a.outcome, a.clase, a)
|
|
245
277
|
if (c) enviar(c)
|
|
246
278
|
}
|
|
247
279
|
|
|
248
|
-
module.exports = { PLATAFORMAS, CLASES, OUTCOMES, RAZONES, CAMINO, FUENTES,
|
|
280
|
+
module.exports = { PLATAFORMAS, CLASES, OUTCOMES, RAZONES, CAMINO, FUENTES, SENALES, RE_CLASE_ERROR, fuente, razonDeError,
|
|
281
|
+
salidaPorSenal, claseDeError, argumentosSueltos, desdeArgv, RE_VERSION, RE_MAQUINA, TOPE_ID_MS, claseDeArgumento, apagado, cuerpo, reportar, silenciar, soltarPendiente,
|
|
249
282
|
_idDeHardwareWindows: idDeHardwareWindows } // costura de test
|