mono-pilot 0.2.12 → 0.2.14
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
CHANGED
|
@@ -383,7 +383,7 @@ npm run dev:continue
|
|
|
383
383
|
npm run dev:watch:continue
|
|
384
384
|
```
|
|
385
385
|
|
|
386
|
-
When running in interactive mode, `option+o` opens the current workspace
|
|
386
|
+
When running in interactive mode, `option+o` opens the current workspace in `nvim` (falls back to `vim`), restores an existing workspace session from `.mono-pilot/nvim/session.vim`, and saves the session on exit.
|
|
387
387
|
|
|
388
388
|
## Prompt inspection
|
|
389
389
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { LSP } from "../lsp/index.js";
|
|
2
1
|
import { deriveAgentId } from "../agents-paths.js";
|
|
3
2
|
import { loadResolvedMemorySearchConfig } from "../memory/config/loader.js";
|
|
4
3
|
import { initCluster, closeCluster } from "../cluster/init.js";
|
|
@@ -17,7 +16,7 @@ export async function initSubsystems(pi, ctx, options) {
|
|
|
17
16
|
const getSessionId = () => sessionManager?.getSessionId?.() ?? "unknown";
|
|
18
17
|
const disposers = [];
|
|
19
18
|
// 1. LSP
|
|
20
|
-
LSP.init(ctx.cwd);
|
|
19
|
+
// LSP.init(ctx.cwd);
|
|
21
20
|
// 2. Cluster + 3. Memory (cluster provides embedding for memory)
|
|
22
21
|
const settings = await loadResolvedMemorySearchConfig();
|
|
23
22
|
let cluster = null;
|
|
@@ -3,34 +3,19 @@ import lsExtension from "../tools/ls.js";
|
|
|
3
3
|
import shellExtension from "../tools/shell.js";
|
|
4
4
|
import globExtension from "../tools/glob.js";
|
|
5
5
|
import rgExtension from "../tools/rg.js";
|
|
6
|
-
import astGrepExtension from "../tools/ast-grep.js";
|
|
7
6
|
import readFileExtension from "../tools/read-file.js";
|
|
8
7
|
import deleteExtension from "../tools/delete.js";
|
|
9
8
|
import semanticSearchExtension from "../tools/semantic-search.js";
|
|
10
9
|
import webSearchExtension from "../tools/web-search.js";
|
|
11
10
|
import webFetchExtension from "../tools/web-fetch.js";
|
|
12
|
-
import generateImageExtension from "../tools/generate-image.js";
|
|
13
|
-
import askUserQuestionExtension from "../tools/ask-user-question.js";
|
|
14
11
|
import subagentExtension from "../tools/subagent.js";
|
|
15
|
-
import listMcpResourcesExtension from "../tools/list-mcp-resources.js";
|
|
16
|
-
import fetchMcpResourceExtension from "../tools/fetch-mcp-resource.js";
|
|
17
|
-
import listMcpToolsExtension from "../tools/list-mcp-tools.js";
|
|
18
|
-
import callMcpToolExtension from "../tools/call-mcp-tool.js";
|
|
19
12
|
import switchModeExtension from "../tools/switch-mode.js";
|
|
20
13
|
import exitPlanModeExtension from "../tools/exit-plan-mode.js";
|
|
21
14
|
// import applyPatchExtension from "../tools/apply-patch.js";
|
|
22
15
|
import codexApplyPatchExtension from "../tools/codex-apply-patch.js";
|
|
23
16
|
import userMessageExtension from "./user-message.js";
|
|
24
17
|
import systemPromptExtension from "./system-prompt.js";
|
|
25
|
-
import
|
|
26
|
-
import nvimExtension from "./nvim.js";
|
|
27
|
-
import lspDiagnosticsExtension from "../tools/lsp-diagnostics.js";
|
|
28
|
-
import lspSymbolsExtension from "../tools/lsp-symbols.js";
|
|
29
|
-
import briefWriteExtension from "../tools/brief-write.js";
|
|
30
|
-
import memorySearchExtension from "../tools/memory-search.js";
|
|
31
|
-
import memoryGetExtension from "../tools/memory-get.js";
|
|
32
|
-
import busSendExtension, { setBusSendHandle } from "../tools/bus-send.js";
|
|
33
|
-
import mailboxExtension from "../tools/mailbox.js";
|
|
18
|
+
import { setBusSendHandle } from "../tools/bus-send.js";
|
|
34
19
|
import { registerSessionMemoryHook } from "../memory/session/hook.js";
|
|
35
20
|
import { registerBuildMemoryCommand } from "./commands/build-memory.js";
|
|
36
21
|
import { registerDigestCommand } from "./commands/digest/index.js";
|
|
@@ -44,35 +29,35 @@ const toolExtensions = [
|
|
|
44
29
|
shellExtension,
|
|
45
30
|
globExtension,
|
|
46
31
|
rgExtension,
|
|
47
|
-
astGrepExtension,
|
|
32
|
+
// astGrepExtension,
|
|
48
33
|
readFileExtension,
|
|
49
34
|
deleteExtension,
|
|
50
35
|
lsExtension,
|
|
51
36
|
semanticSearchExtension,
|
|
52
37
|
webSearchExtension,
|
|
53
38
|
webFetchExtension,
|
|
54
|
-
generateImageExtension,
|
|
55
|
-
askUserQuestionExtension,
|
|
39
|
+
// generateImageExtension,
|
|
40
|
+
// askUserQuestionExtension,
|
|
56
41
|
subagentExtension,
|
|
57
|
-
listMcpResourcesExtension,
|
|
58
|
-
fetchMcpResourceExtension,
|
|
59
|
-
listMcpToolsExtension,
|
|
60
|
-
callMcpToolExtension,
|
|
42
|
+
// listMcpResourcesExtension,
|
|
43
|
+
// fetchMcpResourceExtension,
|
|
44
|
+
// listMcpToolsExtension,
|
|
45
|
+
// callMcpToolExtension,
|
|
61
46
|
switchModeExtension,
|
|
62
47
|
exitPlanModeExtension,
|
|
63
48
|
// applyPatchExtension,
|
|
64
49
|
codexApplyPatchExtension,
|
|
65
50
|
userMessageExtension,
|
|
66
51
|
systemPromptExtension,
|
|
67
|
-
sessionHintsExtension,
|
|
68
|
-
nvimExtension,
|
|
69
|
-
lspDiagnosticsExtension,
|
|
70
|
-
lspSymbolsExtension,
|
|
71
|
-
briefWriteExtension,
|
|
72
|
-
memorySearchExtension,
|
|
73
|
-
memoryGetExtension,
|
|
74
|
-
busSendExtension,
|
|
75
|
-
mailboxExtension,
|
|
52
|
+
// sessionHintsExtension,
|
|
53
|
+
// nvimExtension,
|
|
54
|
+
// lspDiagnosticsExtension,
|
|
55
|
+
// lspSymbolsExtension,
|
|
56
|
+
// briefWriteExtension,
|
|
57
|
+
// memorySearchExtension,
|
|
58
|
+
// memoryGetExtension,
|
|
59
|
+
// busSendExtension,
|
|
60
|
+
// mailboxExtension,
|
|
76
61
|
];
|
|
77
62
|
export default function monoPilotExtension(pi) {
|
|
78
63
|
for (const register of toolExtensions) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { Text } from "@mariozechner/pi-tui";
|
|
2
3
|
const NVIM_SHORTCUT = "alt+o";
|
|
3
4
|
function commandExists(command) {
|
|
4
5
|
const probe = process.platform === "win32" ? "where" : "which";
|
|
@@ -12,7 +13,7 @@ function resolveEditor() {
|
|
|
12
13
|
return "vim";
|
|
13
14
|
return undefined;
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function runWorkspaceEditor(ctx, editor) {
|
|
16
17
|
const result = spawnSync(editor, [ctx.cwd], {
|
|
17
18
|
stdio: "inherit",
|
|
18
19
|
shell: process.platform === "win32",
|
|
@@ -26,6 +27,36 @@ function openWorkspaceInEditor(ctx, editor) {
|
|
|
26
27
|
}
|
|
27
28
|
return { ok: true };
|
|
28
29
|
}
|
|
30
|
+
async function openWorkspaceInEditor(ctx, editor) {
|
|
31
|
+
if (!ctx.hasUI) {
|
|
32
|
+
return runWorkspaceEditor(ctx, editor);
|
|
33
|
+
}
|
|
34
|
+
let launchResult = {
|
|
35
|
+
ok: false,
|
|
36
|
+
reason: "Editor launch did not complete.",
|
|
37
|
+
};
|
|
38
|
+
await ctx.ui.custom((tui, theme, _keybindings, done) => {
|
|
39
|
+
queueMicrotask(() => {
|
|
40
|
+
try {
|
|
41
|
+
tui.stop();
|
|
42
|
+
launchResult = runWorkspaceEditor(ctx, editor);
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
tui.start();
|
|
46
|
+
try {
|
|
47
|
+
tui.terminal.enableMouse();
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// Best-effort: mouse capability differs across terminals.
|
|
51
|
+
}
|
|
52
|
+
tui.requestRender(true);
|
|
53
|
+
done();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return new Text(theme.fg("muted", `Opening ${editor}...`), 0, 0);
|
|
57
|
+
}, { overlay: true });
|
|
58
|
+
return launchResult;
|
|
59
|
+
}
|
|
29
60
|
export default function nvimExtension(pi) {
|
|
30
61
|
pi.registerShortcut(NVIM_SHORTCUT, {
|
|
31
62
|
description: "Open workspace in nvim file explorer (fallback: vim)",
|
|
@@ -38,7 +69,7 @@ export default function nvimExtension(pi) {
|
|
|
38
69
|
ctx.ui.notify("nvim/vim not found in PATH.", "warning");
|
|
39
70
|
return;
|
|
40
71
|
}
|
|
41
|
-
const result = openWorkspaceInEditor(ctx, editor);
|
|
72
|
+
const result = await openWorkspaceInEditor(ctx, editor);
|
|
42
73
|
if (!result.ok) {
|
|
43
74
|
ctx.ui.notify(`Failed to open ${editor}: ${result.reason}`, "warning");
|
|
44
75
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mono-pilot",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"description": "Cursor-compatible coding agent powered by pi-mono",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"node": ">=20"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@mariozechner/pi-agent-core": "
|
|
48
|
-
"@mariozechner/pi-ai": "
|
|
49
|
-
"@mariozechner/pi-coding-agent": "
|
|
50
|
-
"@mariozechner/pi-tui": "
|
|
47
|
+
"@mariozechner/pi-agent-core": "^0.57.1",
|
|
48
|
+
"@mariozechner/pi-ai": "^0.57.1",
|
|
49
|
+
"@mariozechner/pi-coding-agent": "^0.57.1",
|
|
50
|
+
"@mariozechner/pi-tui": "^0.57.1",
|
|
51
51
|
"@sinclair/typebox": "^0.34.13",
|
|
52
52
|
"chokidar": "^5.0.0",
|
|
53
53
|
"glob": "^13.0.1",
|