march-cli 0.1.32 → 0.1.33
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 +1 -1
- package/src/agent/output/binary-output-sink.mjs +17 -0
- package/src/agent/output/send-binary-tool.mjs +84 -0
- package/src/agent/tools.mjs +3 -0
- package/src/cli/args.mjs +3 -1
- package/src/cli/commands/help-command.mjs +1 -1
- package/src/cli/commands/mode-command.mjs +21 -0
- package/src/cli/repl-loop.mjs +1 -0
- package/src/cli/slash-commands.mjs +8 -0
- package/src/cli/startup/configured-command.mjs +17 -0
- package/src/cli/startup/gateway-daemon-command.mjs +21 -0
- package/src/config/loader.mjs +31 -0
- package/src/gateway/command-router.mjs +44 -0
- package/src/gateway/command.mjs +107 -0
- package/src/gateway/config.mjs +62 -0
- package/src/gateway/daemon.mjs +41 -0
- package/src/gateway/handler.mjs +29 -0
- package/src/gateway/message.mjs +37 -0
- package/src/gateway/platform-registry.mjs +38 -0
- package/src/gateway/platforms/telegram.mjs +241 -0
- package/src/gateway/runner-bridge.mjs +55 -0
- package/src/gateway/runtime/queue.mjs +46 -0
- package/src/gateway/session-store.mjs +46 -0
- package/src/gateway/setup/command.mjs +150 -0
- package/src/gateway/workspace-command.mjs +40 -0
- package/src/image-gen/tool.mjs +16 -9
- package/src/lsp/client.mjs +1 -0
- package/src/lsp/managed-node-server.mjs +1 -0
- package/src/lsp/server-definitions.mjs +8 -0
- package/src/main.mjs +6 -9
- package/src/platform/open-file.mjs +9 -10
|
@@ -12,6 +12,7 @@ const MANAGED_PACKAGES = {
|
|
|
12
12
|
"vscode-json-language-server": ["vscode-langservers-extracted"],
|
|
13
13
|
"vscode-html-language-server": ["vscode-langservers-extracted"],
|
|
14
14
|
"vscode-css-language-server": ["vscode-langservers-extracted"],
|
|
15
|
+
"sql-language-server": ["sql-language-server"],
|
|
15
16
|
"docker-langserver": ["dockerfile-language-server-nodejs"],
|
|
16
17
|
};
|
|
17
18
|
|
|
@@ -88,6 +88,14 @@ export function createLspServerDefinitions({ resolveTypeScriptProjectRoot, resol
|
|
|
88
88
|
managedCommand: "vscode-json-language-server",
|
|
89
89
|
args: ["--stdio"],
|
|
90
90
|
},
|
|
91
|
+
{
|
|
92
|
+
id: "sql",
|
|
93
|
+
extensions: [".sql"],
|
|
94
|
+
rootMarkers: [".sqllsrc.json", ".sqllsrc", "package.json", ".git"],
|
|
95
|
+
command: ["sql-language-server"],
|
|
96
|
+
managedCommand: "sql-language-server",
|
|
97
|
+
args: ["up", "--method", "stdio"],
|
|
98
|
+
},
|
|
91
99
|
{
|
|
92
100
|
id: "html",
|
|
93
101
|
extensions: [".html", ".htm"],
|
package/src/main.mjs
CHANGED
|
@@ -38,7 +38,8 @@ import { installNetworkEnvironment } from "./network/environment.mjs";
|
|
|
38
38
|
import { runMemoryCommand } from "./memory/command.mjs";
|
|
39
39
|
import { normalizeRemoteMemorySources } from "./memory/remote/config.mjs";
|
|
40
40
|
import { resolveMemoryRoot } from "./memory/root.mjs";
|
|
41
|
-
import {
|
|
41
|
+
import { runConfiguredCliCommand } from "./cli/startup/configured-command.mjs";
|
|
42
|
+
import { maybeRunGatewayDaemonCommand } from "./cli/startup/gateway-daemon-command.mjs";
|
|
42
43
|
import { ensureBrowserDaemon } from "./browser/client/lifecycle.mjs";
|
|
43
44
|
export async function run(argv) {
|
|
44
45
|
const cwd = process.cwd();
|
|
@@ -77,14 +78,8 @@ export async function run(argv) {
|
|
|
77
78
|
args.memoryRoot = resolveMemoryRoot(config.memoryRoot, stateRoot);
|
|
78
79
|
return await runMemoryCommand(args, { homeDir: homedir() });
|
|
79
80
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return await runBrowserCommand(args, { stateRoot });
|
|
83
|
-
} catch (err) {
|
|
84
|
-
process.stderr.write(`Error: ${err.message}\n`);
|
|
85
|
-
return 1;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
81
|
+
const configuredCommand = await runConfiguredCliCommand(args, { config, cwd, stateRoot });
|
|
82
|
+
if (configuredCommand.handled) return configuredCommand.code;
|
|
88
83
|
if (!existsSync(stateRoot)) mkdirSync(stateRoot, { recursive: true });
|
|
89
84
|
await ensureBrowserDaemon({ stateRoot }).catch(() => {});
|
|
90
85
|
const logger = createLogger({ logDir: join(stateRoot, "logs") });
|
|
@@ -243,6 +238,8 @@ export async function run(argv) {
|
|
|
243
238
|
ui,
|
|
244
239
|
});
|
|
245
240
|
refreshStatusBar();
|
|
241
|
+
const gatewayDaemonCommand = await maybeRunGatewayDaemonCommand(args, { config, cwd, runner, currentProject, memoryStore, ui, logger });
|
|
242
|
+
if (gatewayDaemonCommand.handled) return gatewayDaemonCommand.code;
|
|
246
243
|
|
|
247
244
|
if (args.prompt) {
|
|
248
245
|
turnRunning = true;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
|
|
3
|
-
export function openFileWithDefaultApp(filePath) {
|
|
3
|
+
export function openFileWithDefaultApp(filePath, { spawnFn = spawn } = {}) {
|
|
4
4
|
return new Promise((resolve, reject) => {
|
|
5
|
-
const { command, args } = openCommand(filePath);
|
|
6
|
-
const child =
|
|
5
|
+
const { command, args, options } = openCommand(filePath);
|
|
6
|
+
const child = spawnFn(command, args, { ...options, detached: true, stdio: "ignore" });
|
|
7
7
|
child.once("error", reject);
|
|
8
8
|
child.once("spawn", () => {
|
|
9
9
|
child.unref();
|
|
@@ -12,15 +12,14 @@ export function openFileWithDefaultApp(filePath) {
|
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
function openCommand(filePath) {
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
15
|
+
export function openCommand(filePath, { platform = process.platform } = {}) {
|
|
16
|
+
if (platform === "win32") {
|
|
17
|
+
// cmd.exe start delegates to the user's shell association more reliably than
|
|
18
|
+
// PowerShell Start-Process for media files on Windows.
|
|
19
|
+
return { command: "cmd.exe", args: ["/c", "start", "", filePath] };
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
if (
|
|
22
|
+
if (platform === "darwin") {
|
|
24
23
|
return { command: "open", args: [filePath] };
|
|
25
24
|
}
|
|
26
25
|
|