mono-pilot 0.2.3 → 0.2.4
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.
|
@@ -2,6 +2,7 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
2
2
|
import { dirname, join, resolve } from "node:path";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { formatSkillsForPrompt, loadSkills } from "@mariozechner/pi-coding-agent";
|
|
5
6
|
const NO_DESCRIPTION_PLACEHOLDER = "No short description provided.";
|
|
6
7
|
const PROJECT_CONTEXT_HEADER = "# Project Context";
|
|
7
8
|
const CURRENT_DATETIME_PREFIX = "Current date and time:";
|
|
@@ -13,6 +14,7 @@ const CURRENT_WORKING_DIRECTORY_TOKEN = "{{CURRENT_WORKING_DIRECTORY}}";
|
|
|
13
14
|
const PI_README_PATH_TOKEN = "{{PI_README_PATH}}";
|
|
14
15
|
const PI_DOCS_PATH_TOKEN = "{{PI_DOCS_PATH}}";
|
|
15
16
|
const PI_EXAMPLES_PATH_TOKEN = "{{PI_EXAMPLES_PATH}}";
|
|
17
|
+
const SKILLS_BLOCK_TOKEN = "{{SKILLS_BLOCK}}";
|
|
16
18
|
const UNIFIED_SYSTEM_PROMPT_TEMPLATE = `You are an expert coding assistant operating inside MonoPilot (a pi-coding-agent compatibility harness) on a user's computer.
|
|
17
19
|
You help users by reading files, executing commands, editing code, and writing new files.
|
|
18
20
|
|
|
@@ -166,7 +168,8 @@ Your main goal is to follow the USER's instructions at each message, denoted by
|
|
|
166
168
|
<runtime_context>
|
|
167
169
|
Current date and time: ${CURRENT_DATETIME_TOKEN}
|
|
168
170
|
Current working directory: ${CURRENT_WORKING_DIRECTORY_TOKEN}
|
|
169
|
-
</runtime_context
|
|
171
|
+
</runtime_context>
|
|
172
|
+
${SKILLS_BLOCK_TOKEN}`;
|
|
170
173
|
function getFirstDescriptionLine(description) {
|
|
171
174
|
if (!description)
|
|
172
175
|
return NO_DESCRIPTION_PLACEHOLDER;
|
|
@@ -228,7 +231,9 @@ function renderTemplate(template, values) {
|
|
|
228
231
|
.split(PI_DOCS_PATH_TOKEN)
|
|
229
232
|
.join(values.piDocsPath)
|
|
230
233
|
.split(PI_EXAMPLES_PATH_TOKEN)
|
|
231
|
-
.join(values.piExamplesPath)
|
|
234
|
+
.join(values.piExamplesPath)
|
|
235
|
+
.split(SKILLS_BLOCK_TOKEN)
|
|
236
|
+
.join(values.skillsBlock);
|
|
232
237
|
}
|
|
233
238
|
function getFallbackDateTimeText() {
|
|
234
239
|
return new Date().toString();
|
|
@@ -284,6 +289,10 @@ export default function systemPromptExtension(pi) {
|
|
|
284
289
|
const projectContext = extractProjectContextBlock(event.systemPrompt) ?? "Project-specific instructions were not provided.";
|
|
285
290
|
const currentDateTime = extractValueAfterPrefix(event.systemPrompt, CURRENT_DATETIME_PREFIX) ?? getFallbackDateTimeText();
|
|
286
291
|
const cwd = extractValueAfterPrefix(event.systemPrompt, CURRENT_WORKING_DIRECTORY_PREFIX) ?? process.cwd();
|
|
292
|
+
// Load skills directly since pi-mono skips injection when "read" tool
|
|
293
|
+
// is not in the base tool set (mono-pilot uses "ReadFile" instead).
|
|
294
|
+
const { skills } = loadSkills({ cwd });
|
|
295
|
+
const skillsBlock = formatSkillsForPrompt(skills);
|
|
287
296
|
const unifiedPrompt = renderTemplate(UNIFIED_SYSTEM_PROMPT_TEMPLATE, {
|
|
288
297
|
tools,
|
|
289
298
|
projectContext,
|
|
@@ -292,6 +301,7 @@ export default function systemPromptExtension(pi) {
|
|
|
292
301
|
piReadmePath: piDocsPaths.readmePath,
|
|
293
302
|
piDocsPath: piDocsPaths.docsPath,
|
|
294
303
|
piExamplesPath: piDocsPaths.examplesPath,
|
|
304
|
+
skillsBlock,
|
|
295
305
|
});
|
|
296
306
|
if (unifiedPrompt === event.systemPrompt) {
|
|
297
307
|
return undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mono-pilot",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
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": "^0.55.
|
|
48
|
-
"@mariozechner/pi-ai": "^0.55.
|
|
49
|
-
"@mariozechner/pi-coding-agent": "^0.55.
|
|
50
|
-
"@mariozechner/pi-tui": "^0.55.
|
|
47
|
+
"@mariozechner/pi-agent-core": "^0.55.1",
|
|
48
|
+
"@mariozechner/pi-ai": "^0.55.1",
|
|
49
|
+
"@mariozechner/pi-coding-agent": "^0.55.1",
|
|
50
|
+
"@mariozechner/pi-tui": "^0.55.1",
|
|
51
51
|
"@sinclair/typebox": "^0.34.13",
|
|
52
52
|
"glob": "^13.0.1"
|
|
53
53
|
},
|